From 8adb4301534deb80262ef5b5134f227f1497b7a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=2E=20Nagy=20Gerg=C5=91?= Date: Wed, 17 Aug 2022 09:03:17 +0200 Subject: [PATCH] fixes --- ...ctions.11134f97.js => Actions.312fea0a.js} | 2 +- ...oard.62d23070.js => Dashboard.7e30a98a.js} | 2 +- .../{Error.fadf721f.js => Error.754993f2.js} | 2 +- .../{Form.50517212.js => Form.01a88f8e.js} | 2 +- .../{Form.613d7faf.js => Form.2e661f90.js} | 2 +- .../{Form.fd558b22.js => Form.90c43959.js} | 2 +- .../{Index.1735a2c5.js => Index.4d7adba7.js} | 2 +- .../{Index.716ca1a5.js => Index.f053e239.js} | 2 +- .../{Index.f789e89b.js => Index.fdd4b3f1.js} | 2 +- .../{Show.55e23a01.js => Show.695e0034.js} | 2 +- .../{Show.3bdc90f3.js => Show.c28251c6.js} | 2 +- .../{Table.65514b14.js => Table.5ca6e4fc.js} | 2 +- .../{app.fa6c6c43.js => app.1185eb56.js} | 4 +- public/build/manifest.json | 52 +++++++++---------- .../Components/Notifications/Notification.vue | 2 +- .../Notifications/Notifications.vue | 8 ++- src/Root.php | 4 +- 17 files changed, 50 insertions(+), 44 deletions(-) rename public/build/assets/{Actions.11134f97.js => Actions.312fea0a.js} (97%) rename public/build/assets/{Dashboard.62d23070.js => Dashboard.7e30a98a.js} (85%) rename public/build/assets/{Error.fadf721f.js => Error.754993f2.js} (90%) rename public/build/assets/{Form.50517212.js => Form.01a88f8e.js} (84%) rename public/build/assets/{Form.613d7faf.js => Form.2e661f90.js} (96%) rename public/build/assets/{Form.fd558b22.js => Form.90c43959.js} (84%) rename public/build/assets/{Index.1735a2c5.js => Index.4d7adba7.js} (86%) rename public/build/assets/{Index.716ca1a5.js => Index.f053e239.js} (84%) rename public/build/assets/{Index.f789e89b.js => Index.fdd4b3f1.js} (85%) rename public/build/assets/{Show.55e23a01.js => Show.695e0034.js} (93%) rename public/build/assets/{Show.3bdc90f3.js => Show.c28251c6.js} (95%) rename public/build/assets/{Table.65514b14.js => Table.5ca6e4fc.js} (98%) rename public/build/assets/{app.fa6c6c43.js => app.1185eb56.js} (97%) diff --git a/public/build/assets/Actions.11134f97.js b/public/build/assets/Actions.312fea0a.js similarity index 97% rename from public/build/assets/Actions.11134f97.js rename to public/build/assets/Actions.312fea0a.js index 5a354bb3..b63def99 100644 --- a/public/build/assets/Actions.11134f97.js +++ b/public/build/assets/Actions.312fea0a.js @@ -1 +1 @@ -import{_ as b,r as d,o as r,c as l,f as A,j as h,d as s,t as m,n as k,F as f,a as _,b as p,m as w,w as y,g as B,k as M}from"./app.fa6c6c43.js";const S={props:{action:{type:Object,required:!0},selection:{type:Array,required:!0},allMatching:{type:Boolean,required:!0}},emits:["success","error"],data(){return{form:this.$inertia.form(this.action.key,Object.assign({},this.action.data))}},methods:{open(){this.$refs.modal.open()},submit(){this.form.transform(o=>({...o,all:this.allMatching,models:this.selection})).post(this.action.url+window.location.search,{onBefore:()=>{if(this.action.confirmable)return window.confirm(this.__("Are you sure?"))},onSuccess:()=>{this.$emit("success"),this.$refs.modal.close()},onError:o=>{this.$emit("error")}},{errorBag:this.action.key})}}};function V(o,i,n,g,a,c){const u=d("FormHandler"),e=d("Modal");return r(),l("form",{onSubmit:i[0]||(i[0]=y((...t)=>c.submit&&c.submit(...t),["prevent"]))},[A(e,{ref:"modal",title:n.action.name},{footer:h(()=>[s("button",{type:"submit",class:k(["btn",{"btn--delete":n.action.destructive,"btn--primary":!n.action.destructive}])},m(o.__("Run")),3)]),default:h(()=>[(r(!0),l(f,null,_(n.action.fields,t=>(r(),p(u,w(t,{modelValue:a.form[t.name],"onUpdate:modelValue":v=>a.form[t.name]=v,form:a.form,key:t.name,name:t.name}),null,16,["modelValue","onUpdate:modelValue","form","name"]))),128))]),_:1},8,["title"])],32)}const E=b(S,[["render",V]]),F={components:{Action:E},props:{actions:{type:Array,default:()=>[]},selection:{type:Array,default:()=>[]},allMatching:{type:Boolean,default:!1}},emits:["success","error"],data(){return{_action:null}},methods:{submit(){this.$refs.action[this._action].open()}}},j={class:"form-group form-group--inline"},q={class:"form-label",for:"actions-select"},C={value:null},U=["value"],D=["disabled"];function H(o,i,n,g,a,c){const u=d("Action");return r(),l("div",null,[s("form",{onSubmit:i[1]||(i[1]=y((...e)=>c.submit&&c.submit(...e),["prevent"])),class:"form--inline"},[s("div",j,[s("label",q,m(o.__("Action")),1),B(s("select",{id:"actions-select",class:"form-control","onUpdate:modelValue":i[0]||(i[0]=e=>a._action=e)},[s("option",C,m(o.__("Select :label",{label:o.__("Action")})),1),(r(!0),l(f,null,_(n.actions,(e,t)=>(r(),l("option",{value:t,key:t},m(e.name),9,U))),128))],512),[[M,a._action]])]),s("button",{type:"submit",class:"btn btn--primary",disabled:a._action===null||n.selection.length===0},m(o.__("Run")),9,D)],32),s("div",null,[(r(!0),l(f,null,_(n.actions,e=>(r(),p(u,{ref_for:!0,ref:"action",action:e,"all-matching":n.allMatching,key:e.key,selection:n.selection,onError:t=>o.$emit("error",e),onSuccess:t=>o.$emit("success",e)},null,8,["action","all-matching","selection","onError","onSuccess"]))),128))])])}const O=b(F,[["render",H]]);export{O as A}; +import{_ as b,r as d,o as r,c as l,f as A,j as h,d as s,t as m,n as k,F as f,a as _,b as p,m as w,w as y,g as B,k as M}from"./app.1185eb56.js";const S={props:{action:{type:Object,required:!0},selection:{type:Array,required:!0},allMatching:{type:Boolean,required:!0}},emits:["success","error"],data(){return{form:this.$inertia.form(this.action.key,Object.assign({},this.action.data))}},methods:{open(){this.$refs.modal.open()},submit(){this.form.transform(o=>({...o,all:this.allMatching,models:this.selection})).post(this.action.url+window.location.search,{onBefore:()=>{if(this.action.confirmable)return window.confirm(this.__("Are you sure?"))},onSuccess:()=>{this.$emit("success"),this.$refs.modal.close()},onError:o=>{this.$emit("error")}},{errorBag:this.action.key})}}};function V(o,i,n,g,a,c){const u=d("FormHandler"),e=d("Modal");return r(),l("form",{onSubmit:i[0]||(i[0]=y((...t)=>c.submit&&c.submit(...t),["prevent"]))},[A(e,{ref:"modal",title:n.action.name},{footer:h(()=>[s("button",{type:"submit",class:k(["btn",{"btn--delete":n.action.destructive,"btn--primary":!n.action.destructive}])},m(o.__("Run")),3)]),default:h(()=>[(r(!0),l(f,null,_(n.action.fields,t=>(r(),p(u,w(t,{modelValue:a.form[t.name],"onUpdate:modelValue":v=>a.form[t.name]=v,form:a.form,key:t.name,name:t.name}),null,16,["modelValue","onUpdate:modelValue","form","name"]))),128))]),_:1},8,["title"])],32)}const E=b(S,[["render",V]]),F={components:{Action:E},props:{actions:{type:Array,default:()=>[]},selection:{type:Array,default:()=>[]},allMatching:{type:Boolean,default:!1}},emits:["success","error"],data(){return{_action:null}},methods:{submit(){this.$refs.action[this._action].open()}}},j={class:"form-group form-group--inline"},q={class:"form-label",for:"actions-select"},C={value:null},U=["value"],D=["disabled"];function H(o,i,n,g,a,c){const u=d("Action");return r(),l("div",null,[s("form",{onSubmit:i[1]||(i[1]=y((...e)=>c.submit&&c.submit(...e),["prevent"])),class:"form--inline"},[s("div",j,[s("label",q,m(o.__("Action")),1),B(s("select",{id:"actions-select",class:"form-control","onUpdate:modelValue":i[0]||(i[0]=e=>a._action=e)},[s("option",C,m(o.__("Select :label",{label:o.__("Action")})),1),(r(!0),l(f,null,_(n.actions,(e,t)=>(r(),l("option",{value:t,key:t},m(e.name),9,U))),128))],512),[[M,a._action]])]),s("button",{type:"submit",class:"btn btn--primary",disabled:a._action===null||n.selection.length===0},m(o.__("Run")),9,D)],32),s("div",null,[(r(!0),l(f,null,_(n.actions,e=>(r(),p(u,{ref_for:!0,ref:"action",action:e,"all-matching":n.allMatching,key:e.key,selection:n.selection,onError:t=>o.$emit("error",e),onSuccess:t=>o.$emit("success",e)},null,8,["action","all-matching","selection","onError","onSuccess"]))),128))])])}const O=b(F,[["render",H]]);export{O as A}; diff --git a/public/build/assets/Dashboard.62d23070.js b/public/build/assets/Dashboard.7e30a98a.js similarity index 85% rename from public/build/assets/Dashboard.62d23070.js rename to public/build/assets/Dashboard.7e30a98a.js index 371c182f..a598e5e9 100644 --- a/public/build/assets/Dashboard.62d23070.js +++ b/public/build/assets/Dashboard.7e30a98a.js @@ -1 +1 @@ -import{_ as c,W as l,r as p,o as e,c as r,F as d,a as i,b as u,m as _}from"./app.fa6c6c43.js";const m={components:{Widget:l},props:{widgets:{type:Array,default:()=>[]}},layout:function(t,s){return t(this.resolveDefaultLayout(),()=>s)}},f={class:"app-widget"};function g(t,s,a,y,k,h){const n=p("Widget");return e(),r("div",f,[(e(!0),r(d,null,i(a.widgets,o=>(e(),u(n,_({key:o.key},o),null,16))),128))])}const v=c(m,[["render",g]]);export{v as default}; +import{_ as c,W as l,r as p,o as e,c as r,F as d,a as i,b as u,m as _}from"./app.1185eb56.js";const m={components:{Widget:l},props:{widgets:{type:Array,default:()=>[]}},layout:function(t,s){return t(this.resolveDefaultLayout(),()=>s)}},f={class:"app-widget"};function g(t,s,a,y,k,h){const n=p("Widget");return e(),r("div",f,[(e(!0),r(d,null,i(a.widgets,o=>(e(),u(n,_({key:o.key},o),null,16))),128))])}const v=c(m,[["render",g]]);export{v as default}; diff --git a/public/build/assets/Error.fadf721f.js b/public/build/assets/Error.754993f2.js similarity index 90% rename from public/build/assets/Error.fadf721f.js rename to public/build/assets/Error.754993f2.js index 1968b136..df0a946a 100644 --- a/public/build/assets/Error.fadf721f.js +++ b/public/build/assets/Error.754993f2.js @@ -1 +1 @@ -import{_ as t,o as s,c as n,d as r,t as o}from"./app.fa6c6c43.js";const a={props:{status:{type:Number,required:!0}},computed:{title(){return{503:"503: Service Unavailable",500:"500: Server Error",404:"404: Page Not Found",403:"403: Forbidden"}[this.status]},description(){return{503:"Sorry, we are doing some maintenance. Please check back soon.",500:"Whoops, something went wrong on our servers.",404:"Sorry, the page you are looking for could not be found.",403:"Sorry, you are forbidden from accessing this page."}[this.status]}}};function c(i,u,d,l,p,e){return s(),n("div",null,[r("h1",null,o(e.title),1),r("div",null,o(e.description),1)])}const m=t(a,[["render",c]]);export{m as default}; +import{_ as t,o as s,c as n,d as r,t as o}from"./app.1185eb56.js";const a={props:{status:{type:Number,required:!0}},computed:{title(){return{503:"503: Service Unavailable",500:"500: Server Error",404:"404: Page Not Found",403:"403: Forbidden"}[this.status]},description(){return{503:"Sorry, we are doing some maintenance. Please check back soon.",500:"Whoops, something went wrong on our servers.",404:"Sorry, the page you are looking for could not be found.",403:"Sorry, you are forbidden from accessing this page."}[this.status]}}};function c(i,u,d,l,p,e){return s(),n("div",null,[r("h1",null,o(e.title),1),r("div",null,o(e.description),1)])}const m=t(a,[["render",c]]);export{m as default}; diff --git a/public/build/assets/Form.50517212.js b/public/build/assets/Form.01a88f8e.js similarity index 84% rename from public/build/assets/Form.50517212.js rename to public/build/assets/Form.01a88f8e.js index a8f17218..9d113fc6 100644 --- a/public/build/assets/Form.50517212.js +++ b/public/build/assets/Form.01a88f8e.js @@ -1 +1 @@ -import{F as s}from"./Form.613d7faf.js";import{_ as l,r as p,o as t,c as u,a as d,F as c,b as f,m as i}from"./app.fa6c6c43.js";const _={props:{model:{type:Object,required:!0},resource:{type:Object,required:!0},parent:{type:Object,required:!0},field:{type:Object,required:!0}},layout:function(e,r){return e(this.resolveDefaultLayout(),()=>e(s,{model:r.props.model,model_name:r.props.model.exists?r.props.field.related_name:r.props.field.name},()=>r))}};function y(e,r,n,F,$,b){const a=p("FormHandler");return t(!0),u(c,null,d(n.model.fields,o=>(t(),f(a,i(o,{modelValue:e.$parent.form[o.name],"onUpdate:modelValue":m=>e.$parent.form[o.name]=m,form:e.$parent.form,key:o.name,name:o.name}),null,16,["modelValue","onUpdate:modelValue","form","name"]))),128)}const q=l(_,[["render",y]]);export{q as default}; +import{F as s}from"./Form.2e661f90.js";import{_ as l,r as p,o as t,c as u,a as d,F as c,b as f,m as i}from"./app.1185eb56.js";const _={props:{model:{type:Object,required:!0},resource:{type:Object,required:!0},parent:{type:Object,required:!0},field:{type:Object,required:!0}},layout:function(e,r){return e(this.resolveDefaultLayout(),()=>e(s,{model:r.props.model,model_name:r.props.model.exists?r.props.field.related_name:r.props.field.name},()=>r))}};function y(e,r,n,F,$,b){const a=p("FormHandler");return t(!0),u(c,null,d(n.model.fields,o=>(t(),f(a,i(o,{modelValue:e.$parent.form[o.name],"onUpdate:modelValue":m=>e.$parent.form[o.name]=m,form:e.$parent.form,key:o.name,name:o.name}),null,16,["modelValue","onUpdate:modelValue","form","name"]))),128)}const q=l(_,[["render",y]]);export{q as default}; diff --git a/public/build/assets/Form.613d7faf.js b/public/build/assets/Form.2e661f90.js similarity index 96% rename from public/build/assets/Form.613d7faf.js rename to public/build/assets/Form.2e661f90.js index 0787e458..9b225565 100644 --- a/public/build/assets/Form.613d7faf.js +++ b/public/build/assets/Form.2e661f90.js @@ -1 +1 @@ -import{_ as u,o as n,c as d,d as o,w as a,l as f,t as m,e as c}from"./app.fa6c6c43.js";const h={props:{model:{type:Object,required:!0},model_name:{type:String,required:!0}},mounted(){window.addEventListener("beforeunload",this.onBeforeunload),this.notifier=this.$inertia.on("before",e=>{if(this.form.isDirty&&e.detail.visit.method==="get")return window.confirm(this.__("You may have unsaved form data. Are you sure you want to navigate away?"))})},beforeUnmount(){this.notifier.call(),this.notifier=null,window.removeEventListener("beforeunload",this.onBeforeunload)},data(){return{form:this.$inertia.form(Object.assign({},this.model.data)),notifier:null}},computed:{method(){return this.model.exists?"patch":"post"}},methods:{onBeforeunload(e){this.form.isDirty&&e.preventDefault()},submit(){this.form.submit(this.method,this.model.url,{onStart:()=>{this.form.clearErrors()},onFinish:()=>{window.scrollTo({top:0,behavior:"smooth"})}})},destroy(){this.$inertia.delete(this.model.url,{onBefore:()=>window.confirm(this.__("Are you sure?"))})}}},b={class:"form-layout"},_={class:"app-card card card--edit"},p={class:"card__inner"},y={class:"form-group-stack"},v={class:"form-group--submit"},w=["disabled"],g=["disabled"];function B(e,t,l,S,r,i){return n(),d("div",b,[o("div",_,[o("div",p,[o("form",{onSubmit:t[1]||(t[1]=a((...s)=>i.submit&&i.submit(...s),["prevent"])),onReset:t[2]||(t[2]=a((...s)=>r.form.reset&&r.form.reset(...s),["prevent"]))},[o("div",y,[f(e.$slots,"default"),o("div",v,[o("button",{type:"submit",class:"btn btn--primary",disabled:r.form.processing},m(e.__("Save")),9,w),l.model.exists?(n(),d("button",{key:0,type:"button",class:"btn btn--delete",disabled:r.form.processing,onClick:t[0]||(t[0]=(...s)=>i.destroy&&i.destroy(...s))},m(e.__("Delete")),9,g)):c("",!0)])])],32)])])])}const D=u(h,[["render",B]]);export{D as F}; +import{_ as u,o as n,c as d,d as o,w as a,l as f,t as m,e as c}from"./app.1185eb56.js";const h={props:{model:{type:Object,required:!0},model_name:{type:String,required:!0}},mounted(){window.addEventListener("beforeunload",this.onBeforeunload),this.notifier=this.$inertia.on("before",e=>{if(this.form.isDirty&&e.detail.visit.method==="get")return window.confirm(this.__("You may have unsaved form data. Are you sure you want to navigate away?"))})},beforeUnmount(){this.notifier.call(),this.notifier=null,window.removeEventListener("beforeunload",this.onBeforeunload)},data(){return{form:this.$inertia.form(Object.assign({},this.model.data)),notifier:null}},computed:{method(){return this.model.exists?"patch":"post"}},methods:{onBeforeunload(e){this.form.isDirty&&e.preventDefault()},submit(){this.form.submit(this.method,this.model.url,{onStart:()=>{this.form.clearErrors()},onFinish:()=>{window.scrollTo({top:0,behavior:"smooth"})}})},destroy(){this.$inertia.delete(this.model.url,{onBefore:()=>window.confirm(this.__("Are you sure?"))})}}},b={class:"form-layout"},_={class:"app-card card card--edit"},p={class:"card__inner"},y={class:"form-group-stack"},v={class:"form-group--submit"},w=["disabled"],g=["disabled"];function B(e,t,l,S,r,i){return n(),d("div",b,[o("div",_,[o("div",p,[o("form",{onSubmit:t[1]||(t[1]=a((...s)=>i.submit&&i.submit(...s),["prevent"])),onReset:t[2]||(t[2]=a((...s)=>r.form.reset&&r.form.reset(...s),["prevent"]))},[o("div",y,[f(e.$slots,"default"),o("div",v,[o("button",{type:"submit",class:"btn btn--primary",disabled:r.form.processing},m(e.__("Save")),9,w),l.model.exists?(n(),d("button",{key:0,type:"button",class:"btn btn--delete",disabled:r.form.processing,onClick:t[0]||(t[0]=(...s)=>i.destroy&&i.destroy(...s))},m(e.__("Delete")),9,g)):c("",!0)])])],32)])])])}const D=u(h,[["render",B]]);export{D as F}; diff --git a/public/build/assets/Form.fd558b22.js b/public/build/assets/Form.90c43959.js similarity index 84% rename from public/build/assets/Form.fd558b22.js rename to public/build/assets/Form.90c43959.js index 832490a1..6954ca40 100644 --- a/public/build/assets/Form.fd558b22.js +++ b/public/build/assets/Form.90c43959.js @@ -1 +1 @@ -import{F as l}from"./Form.613d7faf.js";import{_ as p,r as u,o as t,c,a as d,F as f,b as i,m as _}from"./app.fa6c6c43.js";let n=new Date().getTime();const y={props:{model:{type:Object,required:!0},resource:{type:Object,required:!0}},layout:function(r,e){return Object.keys(e.props.errors).length===0&&(n=new Date().getTime()),r(this.resolveDefaultLayout(),()=>r(l,{key:n,model:e.props.model,model_name:e.props.model.exists?e.props.resource.model_name:e.props.resource.name},()=>e))}};function k(r,e,m,F,$,b){const a=u("FormHandler");return t(!0),c(f,null,d(m.model.fields,o=>(t(),i(a,_(o,{modelValue:r.$parent.form[o.name],"onUpdate:modelValue":s=>r.$parent.form[o.name]=s,form:r.$parent.form,key:o.name,name:o.name}),null,16,["modelValue","onUpdate:modelValue","form","name"]))),128)}const B=p(y,[["render",k]]);export{B as default}; +import{F as l}from"./Form.2e661f90.js";import{_ as p,r as u,o as t,c,a as d,F as f,b as i,m as _}from"./app.1185eb56.js";let n=new Date().getTime();const y={props:{model:{type:Object,required:!0},resource:{type:Object,required:!0}},layout:function(r,e){return Object.keys(e.props.errors).length===0&&(n=new Date().getTime()),r(this.resolveDefaultLayout(),()=>r(l,{key:n,model:e.props.model,model_name:e.props.model.exists?e.props.resource.model_name:e.props.resource.name},()=>e))}};function k(r,e,m,F,$,b){const a=u("FormHandler");return t(!0),c(f,null,d(m.model.fields,o=>(t(),i(a,_(o,{modelValue:r.$parent.form[o.name],"onUpdate:modelValue":s=>r.$parent.form[o.name]=s,form:r.$parent.form,key:o.name,name:o.name}),null,16,["modelValue","onUpdate:modelValue","form","name"]))),128)}const B=p(y,[["render",k]]);export{B as default}; diff --git a/public/build/assets/Index.1735a2c5.js b/public/build/assets/Index.4d7adba7.js similarity index 86% rename from public/build/assets/Index.1735a2c5.js rename to public/build/assets/Index.4d7adba7.js index 9f8a441a..b41e99f7 100644 --- a/public/build/assets/Index.1735a2c5.js +++ b/public/build/assets/Index.4d7adba7.js @@ -1 +1 @@ -import{_ as c,L as l,r as a,o as s,c as d,d as o,b as f,j as u,e as _,f as m,h as p,t as b}from"./app.fa6c6c43.js";import{T as y}from"./Table.65514b14.js";import"./Actions.11134f97.js";const h={components:{Link:l,Table:y},props:{items:{type:Object,required:!0},filters:{type:Array,default:()=>[]},resource:{type:Object,required:!0},field:{type:Object,required:!0}},layout:function(t,r){return t(this.resolveDefaultLayout(),()=>r)}},k={class:"app-operation"},v={class:"app-operation__edit"};function x(t,r,e,L,T,j){const i=a("Link"),n=a("Table");return s(),d("div",null,[o("div",k,[o("div",v,[e.field.abilities.create?(s(),f(i,{key:0,class:"btn btn--sm btn--tertiary",href:`${e.field.url}/create`},{default:u(()=>[p(b(t.__("Add :model",{model:e.field.related_name})),1)]),_:1},8,["href"])):_("",!0)])]),m(n,{filters:e.filters,items:e.items},null,8,["filters","items"])])}const q=c(h,[["render",x]]);export{q as default}; +import{_ as c,L as l,r as a,o as s,c as d,d as o,b as f,j as u,e as _,f as m,h as p,t as b}from"./app.1185eb56.js";import{T as y}from"./Table.5ca6e4fc.js";import"./Actions.312fea0a.js";const h={components:{Link:l,Table:y},props:{items:{type:Object,required:!0},filters:{type:Array,default:()=>[]},resource:{type:Object,required:!0},field:{type:Object,required:!0}},layout:function(t,r){return t(this.resolveDefaultLayout(),()=>r)}},k={class:"app-operation"},v={class:"app-operation__edit"};function x(t,r,e,L,T,j){const i=a("Link"),n=a("Table");return s(),d("div",null,[o("div",k,[o("div",v,[e.field.abilities.create?(s(),f(i,{key:0,class:"btn btn--sm btn--tertiary",href:`${e.field.url}/create`},{default:u(()=>[p(b(t.__("Add :model",{model:e.field.related_name})),1)]),_:1},8,["href"])):_("",!0)])]),m(n,{filters:e.filters,items:e.items},null,8,["filters","items"])])}const q=c(h,[["render",x]]);export{q as default}; diff --git a/public/build/assets/Index.716ca1a5.js b/public/build/assets/Index.f053e239.js similarity index 84% rename from public/build/assets/Index.716ca1a5.js rename to public/build/assets/Index.f053e239.js index cea27f5c..35534501 100644 --- a/public/build/assets/Index.716ca1a5.js +++ b/public/build/assets/Index.f053e239.js @@ -1 +1 @@ -import{T as l}from"./Table.65514b14.js";import{_ as d,W as u,r as o,o as t,c as n,d as f,F as m,a as _,f as p,b as y,m as x}from"./app.fa6c6c43.js";import"./Actions.11134f97.js";const g={components:{Table:l,Widget:u},props:{items:{type:Object,required:!0},filters:{type:Array,default:()=>[]},actions:{type:Array,default:()=>[]},extracts:{type:Array,default:()=>[]},widgets:{type:Array,default:()=>[]}},layout:function(a,s){return a(this.resolveDefaultLayout(),()=>s)}},b={class:"app-widget"};function k(a,s,e,v,A,B){const c=o("Widget"),i=o("Table");return t(),n("div",null,[f("div",b,[(t(!0),n(m,null,_(e.widgets,r=>(t(),y(c,x(r,{key:r.key}),null,16))),128))]),p(i,{actions:e.actions,extracts:e.extracts,filters:e.filters,items:e.items},null,8,["actions","extracts","filters","items"])])}const w=d(g,[["render",k]]);export{w as default}; +import{T as l}from"./Table.5ca6e4fc.js";import{_ as d,W as u,r as o,o as t,c as n,d as f,F as m,a as _,f as p,b as y,m as x}from"./app.1185eb56.js";import"./Actions.312fea0a.js";const g={components:{Table:l,Widget:u},props:{items:{type:Object,required:!0},filters:{type:Array,default:()=>[]},actions:{type:Array,default:()=>[]},extracts:{type:Array,default:()=>[]},widgets:{type:Array,default:()=>[]}},layout:function(a,s){return a(this.resolveDefaultLayout(),()=>s)}},b={class:"app-widget"};function k(a,s,e,v,A,B){const c=o("Widget"),i=o("Table");return t(),n("div",null,[f("div",b,[(t(!0),n(m,null,_(e.widgets,r=>(t(),y(c,x(r,{key:r.key}),null,16))),128))]),p(i,{actions:e.actions,extracts:e.extracts,filters:e.filters,items:e.items},null,8,["actions","extracts","filters","items"])])}const w=d(g,[["render",k]]);export{w as default}; diff --git a/public/build/assets/Index.f789e89b.js b/public/build/assets/Index.fdd4b3f1.js similarity index 85% rename from public/build/assets/Index.f789e89b.js rename to public/build/assets/Index.fdd4b3f1.js index deb76c28..5be3f261 100644 --- a/public/build/assets/Index.f789e89b.js +++ b/public/build/assets/Index.fdd4b3f1.js @@ -1 +1 @@ -import{T as l}from"./Table.65514b14.js";import{_ as u,W as d,r as n,o as t,c as r,F as m,a as f,e as p,f as _,b as y,m as g}from"./app.fa6c6c43.js";import"./Actions.11134f97.js";const b={components:{Table:l,Widget:d},props:{items:{type:Object,required:!0},filters:{type:Array,default:()=>[]},actions:{type:Array,default:()=>[]},widgets:{type:Array,default:()=>[]},resource:{type:Object,required:!0},extract:{type:Object,required:!0}},layout:function(s,a){return s(this.resolveDefaultLayout(),()=>a)}},k={key:0,class:"app-widget"};function x(s,a,e,h,v,T){const c=n("Widget"),i=n("Table");return t(),r("div",null,[e.widgets.length>0?(t(),r("div",k,[(t(!0),r(m,null,f(e.widgets,o=>(t(),y(c,g(o,{key:o.key}),null,16))),128))])):p("",!0),_(i,{actions:e.actions,filters:e.filters,items:e.items},null,8,["actions","filters","items"])])}const w=u(b,[["render",x]]);export{w as default}; +import{T as l}from"./Table.5ca6e4fc.js";import{_ as u,W as d,r as n,o as t,c as r,F as m,a as f,e as p,f as _,b as y,m as g}from"./app.1185eb56.js";import"./Actions.312fea0a.js";const b={components:{Table:l,Widget:d},props:{items:{type:Object,required:!0},filters:{type:Array,default:()=>[]},actions:{type:Array,default:()=>[]},widgets:{type:Array,default:()=>[]},resource:{type:Object,required:!0},extract:{type:Object,required:!0}},layout:function(s,a){return s(this.resolveDefaultLayout(),()=>a)}},k={key:0,class:"app-widget"};function x(s,a,e,h,v,T){const c=n("Widget"),i=n("Table");return t(),r("div",null,[e.widgets.length>0?(t(),r("div",k,[(t(!0),r(m,null,f(e.widgets,o=>(t(),y(c,g(o,{key:o.key}),null,16))),128))])):p("",!0),_(i,{actions:e.actions,filters:e.filters,items:e.items},null,8,["actions","filters","items"])])}const w=u(b,[["render",x]]);export{w as default}; diff --git a/public/build/assets/Show.55e23a01.js b/public/build/assets/Show.695e0034.js similarity index 93% rename from public/build/assets/Show.55e23a01.js rename to public/build/assets/Show.695e0034.js index 7b607455..21dca45f 100644 --- a/public/build/assets/Show.55e23a01.js +++ b/public/build/assets/Show.695e0034.js @@ -1 +1 @@ -import{_ as f,L as p,W as k,r as l,o as t,c as o,F as _,a as m,e as i,d as s,b as d,j as g,t as c,m as v,h as L}from"./app.fa6c6c43.js";import{A}from"./Actions.11134f97.js";const w={components:{Actions:A,Link:p,Widget:k},props:{actions:{type:Array,default:()=>[]},model:{type:Object,required:!0},widgets:{type:Array,default:()=>[]},resource:{type:Object,required:!0}},layout:function(a,r){return a(this.resolveDefaultLayout(),()=>r)},methods:{destroy(){this.$inertia.delete(this.model.url,{onBefore:()=>confirm(this.__("Are you sure?"))})}}},B={key:0,class:"app-widget"},S={class:"app-operation"},C={class:"app-operation__edit"},W={class:"app-card card"},j={class:"table-responsive"},x={class:"table table--striped table--clear-border table--rounded table--sm"},D={style:{width:"10rem","text-align":"end"}},N=["innerHTML"];function T(a,r,e,V,q,u){const y=l("Widget"),b=l("Actions"),h=l("Link");return t(),o("div",null,[e.widgets.length>0?(t(),o("div",B,[(t(!0),o(_,null,m(e.widgets,n=>(t(),d(y,v({key:n.key},n),null,16))),128))])):i("",!0),s("div",S,[e.actions.length>0?(t(),d(b,{key:0,selection:[e.model.id],actions:e.actions,onSuccess:a.clearSelection},null,8,["selection","actions","onSuccess"])):i("",!0),s("div",C,[e.model.abilities.update?(t(),d(h,{key:0,class:"btn btn--sm btn--tertiary",href:`${e.model.url}/edit`},{default:g(()=>[L(c(a.__("Edit")),1)]),_:1},8,["href"])):i("",!0),e.model.abilities.delete?(t(),o("button",{key:1,type:"button",class:"btn btn--sm btn--delete",onClick:r[0]||(r[0]=(...n)=>u.destroy&&u.destroy(...n))},c(a.__("Delete")),1)):i("",!0)])]),s("div",W,[s("div",j,[s("table",x,[s("tbody",null,[(t(!0),o(_,null,m(e.model.fields,n=>(t(),o("tr",{key:n.name},[s("th",D,c(n.label),1),s("td",null,[s("div",{innerHTML:n.formatted_value},null,8,N)])]))),128))])])])])])}const H=f(w,[["render",T]]);export{H as default}; +import{_ as f,L as p,W as k,r as l,o as t,c as o,F as _,a as m,e as i,d as s,b as d,j as g,t as c,m as v,h as L}from"./app.1185eb56.js";import{A}from"./Actions.312fea0a.js";const w={components:{Actions:A,Link:p,Widget:k},props:{actions:{type:Array,default:()=>[]},model:{type:Object,required:!0},widgets:{type:Array,default:()=>[]},resource:{type:Object,required:!0}},layout:function(a,r){return a(this.resolveDefaultLayout(),()=>r)},methods:{destroy(){this.$inertia.delete(this.model.url,{onBefore:()=>confirm(this.__("Are you sure?"))})}}},B={key:0,class:"app-widget"},S={class:"app-operation"},C={class:"app-operation__edit"},W={class:"app-card card"},j={class:"table-responsive"},x={class:"table table--striped table--clear-border table--rounded table--sm"},D={style:{width:"10rem","text-align":"end"}},N=["innerHTML"];function T(a,r,e,V,q,u){const y=l("Widget"),b=l("Actions"),h=l("Link");return t(),o("div",null,[e.widgets.length>0?(t(),o("div",B,[(t(!0),o(_,null,m(e.widgets,n=>(t(),d(y,v({key:n.key},n),null,16))),128))])):i("",!0),s("div",S,[e.actions.length>0?(t(),d(b,{key:0,selection:[e.model.id],actions:e.actions,onSuccess:a.clearSelection},null,8,["selection","actions","onSuccess"])):i("",!0),s("div",C,[e.model.abilities.update?(t(),d(h,{key:0,class:"btn btn--sm btn--tertiary",href:`${e.model.url}/edit`},{default:g(()=>[L(c(a.__("Edit")),1)]),_:1},8,["href"])):i("",!0),e.model.abilities.delete?(t(),o("button",{key:1,type:"button",class:"btn btn--sm btn--delete",onClick:r[0]||(r[0]=(...n)=>u.destroy&&u.destroy(...n))},c(a.__("Delete")),1)):i("",!0)])]),s("div",W,[s("div",j,[s("table",x,[s("tbody",null,[(t(!0),o(_,null,m(e.model.fields,n=>(t(),o("tr",{key:n.name},[s("th",D,c(n.label),1),s("td",null,[s("div",{innerHTML:n.formatted_value},null,8,N)])]))),128))])])])])])}const H=f(w,[["render",T]]);export{H as default}; diff --git a/public/build/assets/Show.3bdc90f3.js b/public/build/assets/Show.c28251c6.js similarity index 95% rename from public/build/assets/Show.3bdc90f3.js rename to public/build/assets/Show.c28251c6.js index 956f015f..60145854 100644 --- a/public/build/assets/Show.3bdc90f3.js +++ b/public/build/assets/Show.c28251c6.js @@ -1 +1 @@ -import{_ as u,L as _,r as b,o as s,c as n,d as e,b as m,j as p,e as i,t as l,F as h,a as y,h as f}from"./app.fa6c6c43.js";const k={components:{Link:_},props:{model:{type:Object,required:!0},resource:{type:Object,required:!0},field:{type:Object,required:!0}},layout:function(o,r){return o(this.resolveDefaultLayout(),()=>r)},methods:{destroy(){this.$inertia.delete(this.model.url,{onBefore:()=>confirm(this.__("Are you sure?"))})}}},v={class:"app-operation"},L={class:"app-operation__edit"},B={class:"app-card card"},j={class:"table-responsive"},x={class:"table table--striped table--clear-border table--rounded table--sm"},C={style:{width:"10rem","text-align":"end"}},g=["innerHTML"];function q(o,r,a,w,D,d){const c=b("Link");return s(),n("div",null,[e("div",v,[e("div",L,[a.model.abilities.update?(s(),m(c,{key:0,class:"btn btn--sm btn--tertiary",href:`${a.model.url}/edit`},{default:p(()=>[f(l(o.__("Edit")),1)]),_:1},8,["href"])):i("",!0),a.model.abilities.delete?(s(),n("button",{key:1,type:"button",class:"btn btn--sm btn--delete",onClick:r[0]||(r[0]=(...t)=>d.destroy&&d.destroy(...t))},l(o.__("Delete")),1)):i("",!0)])]),e("div",B,[e("div",j,[e("table",x,[e("tbody",null,[(s(!0),n(h,null,y(a.model.fields,t=>(s(),n("tr",{key:t.name},[e("th",C,l(t.label),1),e("td",null,[e("div",{innerHTML:t.formatted_value},null,8,g)])]))),128))])])])])])}const O=u(k,[["render",q]]);export{O as default}; +import{_ as u,L as _,r as b,o as s,c as n,d as e,b as m,j as p,e as i,t as l,F as h,a as y,h as f}from"./app.1185eb56.js";const k={components:{Link:_},props:{model:{type:Object,required:!0},resource:{type:Object,required:!0},field:{type:Object,required:!0}},layout:function(o,r){return o(this.resolveDefaultLayout(),()=>r)},methods:{destroy(){this.$inertia.delete(this.model.url,{onBefore:()=>confirm(this.__("Are you sure?"))})}}},v={class:"app-operation"},L={class:"app-operation__edit"},B={class:"app-card card"},j={class:"table-responsive"},x={class:"table table--striped table--clear-border table--rounded table--sm"},C={style:{width:"10rem","text-align":"end"}},g=["innerHTML"];function q(o,r,a,w,D,d){const c=b("Link");return s(),n("div",null,[e("div",v,[e("div",L,[a.model.abilities.update?(s(),m(c,{key:0,class:"btn btn--sm btn--tertiary",href:`${a.model.url}/edit`},{default:p(()=>[f(l(o.__("Edit")),1)]),_:1},8,["href"])):i("",!0),a.model.abilities.delete?(s(),n("button",{key:1,type:"button",class:"btn btn--sm btn--delete",onClick:r[0]||(r[0]=(...t)=>d.destroy&&d.destroy(...t))},l(o.__("Delete")),1)):i("",!0)])]),e("div",B,[e("div",j,[e("table",x,[e("tbody",null,[(s(!0),n(h,null,y(a.model.fields,t=>(s(),n("tr",{key:t.name},[e("th",C,l(t.label),1),e("td",null,[e("div",{innerHTML:t.formatted_value},null,8,g)])]))),128))])])])])])}const O=u(k,[["render",q]]);export{O as default}; diff --git a/public/build/assets/Table.65514b14.js b/public/build/assets/Table.5ca6e4fc.js similarity index 98% rename from public/build/assets/Table.65514b14.js rename to public/build/assets/Table.5ca6e4fc.js index 93f7b67d..02cf582e 100644 --- a/public/build/assets/Table.65514b14.js +++ b/public/build/assets/Table.5ca6e4fc.js @@ -1 +1 @@ -import{A as U}from"./Actions.11134f97.js";import{_ as g,r as d,o as i,c as o,f as _,w as M,C as $,d as r,t as b,e as m,g as q,v as x,h as S,F as y,a as f,b as p,m as H,i as v,j as w,L as A,k as L,n as O}from"./app.fa6c6c43.js";const I={props:{extracts:{type:Array,required:!0}},data(){return{_extract:null,form:this.$inertia.form(this.name,{})}},computed:{name(){return window.location.pathname+"-extracts"},options(){return this.extracts.map(e=>({value:e.key,formatted_value:e.name}))}},methods:{submit(){const e=this.extracts.find(s=>s.key=this._extract);this.form.get(e.url)}}};function j(e,s,t,h,c,n){const u=d("FormHandler");return i(),o("form",{onSubmit:s[1]||(s[1]=M(()=>{},["prevent"])),onReset:s[2]||(s[2]=M(()=>{},["prevent"]))},[_(u,{nullable:"",class:"form-group--inline",component:"Select",modelValue:c._extract,"onUpdate:modelValue":[s[0]||(s[0]=a=>c._extract=a),n.submit],name:n.name,id:n.name,form:c.form,label:e.__("Extract"),options:n.options},null,8,["modelValue","name","id","form","label","options","onUpdate:modelValue"])],32)}const T=g(I,[["render",j]]),E={mixins:[$],props:{filters:{type:Array,default:()=>[]},query:{type:Object,required:!0}},emits:["update:query"],computed:{activeFilters(){return this.filters.filter(e=>e.active).length}},methods:{emit(){this.$emit("update:query")},reset(){this.$inertia.get(this.$parent.items.path)}}},R={class:"app-operation__filter"},B=["aria-label"],D={key:0,class:"btn__counter"},N={class:"app-drawer"},P={class:"app-drawer__title"},z={class:"app-drawer__inner"},G={class:"form-group--reset"},J=["aria-label"];function K(e,s,t,h,c,n){const u=d("Icon"),a=d("FormHandler");return i(),o("div",R,[r("button",{type:"button",class:"btn btn--secondary btn--icon btn--has-counter","aria-label":e.isOpen?e.__("Close filters"):e.__("Open filters"),onClick:s[0]||(s[0]=(...l)=>e.toggle&&e.toggle(...l))},[_(u,{class:"btn__icon btn__icon--start",name:e.isOpen?"filter-list-off":"filter-list"},null,8,["name"]),n.activeFilters>0?(i(),o("span",D,b(n.activeFilters),1)):m("",!0)],8,B),q(r("div",N,[r("h2",P,[S(b(e.__("Filters"))+" ",1),r("button",{type:"button",class:"btn btn--secondary btn--sm btn--icon",onClick:s[1]||(s[1]=(...l)=>e.close&&e.close(...l))},[_(u,{class:"btn__icon btn__icon--sm",name:"close"})])]),r("div",z,[(i(!0),o(y,null,f(t.filters,l=>(i(),p(a,H(l,{modelValue:t.query[l.key],"onUpdate:modelValue":[k=>t.query[l.key]=k,n.emit],form:t.query,key:l.key,name:l.key,label:l.name}),null,16,["modelValue","onUpdate:modelValue","form","name","label"]))),128)),r("div",G,[r("button",{type:"button",class:"btn btn--sm btn--icon btn--tertiary","aria-label":e.__("Reset"),onClick:s[2]||(s[2]=(...l)=>n.reset&&n.reset(...l))},b(e.__("Reset")),9,J)])])],512),[[x,e.isOpen]])])}const Q=g(E,[["render",K]]),W={props:{items:{type:Array,required:!0},selection:{type:Array,required:!0},query:{type:Object,required:!0},columns:{type:Array,required:!0}},emits:["update:query"],watch:{indeterminate(e,s){this.$refs.input.indeterminate=e}},computed:{selected:{get(){return this.selection.length>0&&this.selection.length===this.items.length},set(e){e?this.$parent.selectAll():this.$parent.clearSelection()}},allMatching:{get(){return this.$parent.allMatching},set(e){e?this.$parent.selectAll(!0):this.$parent.clearSelection()}},indeterminate(){return this.selection.length>0&&this.selection.length0?(i(),o("th",X,[r("div",Y,[r("label",Z,[q(r("input",{ref:"input",class:"form-check__control",type:"checkbox","onUpdate:modelValue":s[0]||(s[0]=l=>n.selected=l),style:{"margin-inline-end":"0"}},null,512),[[v,n.selected]]),ee]),_(u,{id:"table-selection-control"},{default:w(()=>[r("li",te,b(e.__(":count items are selected",{count:n.totalItems})),1),se,r("li",ne,[r("label",le,[q(r("input",{class:"form-check__control",type:"checkbox","onUpdate:modelValue":s[1]||(s[1]=l=>n.allMatching=l)},null,512),[[v,n.allMatching]]),r("span",re,b(e.__("Select all matching (:count)",{count:e.$parent.items.total})),1)])])]),_:1})])])):m("",!0),(i(!0),o(y,null,f(t.columns,l=>(i(),o("th",{key:l.name,scope:"col"},[r("div",ie,[S(b(l.label)+" ",1),l.sortable?(i(),o("button",{key:0,type:"button",onClick:k=>n.sort(l.name),class:"table-sort-btn"},[_(a,{name:n.icon(l.name)},null,8,["name"])],8,ae)):m("",!0)])]))),128)),oe])])}const ue=g(W,[["render",ce]]),de={components:{Link:A},props:{items:{type:Object,required:!0},query:{type:Object,required:!0}},emits:["update:query"],data(){return{counts:[15,25,50,100]}},methods:{emit(){this.$emit("update:query")}}},me={class:"list-footer"},_e={class:"list-footer__pager"},he=["value"],be=["value"],pe={for:"per-page"},ye={class:"list-footer__pagination"};function fe(e,s,t,h,c,n){const u=d("Link");return i(),o("div",me,[r("div",_e,[q(r("select",{class:"form-control form-control--sm",id:"per-page","onUpdate:modelValue":[s[0]||(s[0]=a=>t.query.per_page=a),s[1]||(s[1]=(...a)=>n.emit&&n.emit(...a))]},[c.counts.includes(t.query.per_page)?m("",!0):(i(),o("option",{key:0,disabled:"",value:t.query.per_page},b(e.__("Custom (:count)",{count:t.query.per_page})),9,he)),(i(!0),o(y,null,f(c.counts,a=>(i(),o("option",{key:a,value:a},b(a),9,be))),128))],512),[[L,t.query.per_page,void 0,{number:!0}]]),r("label",pe,b(e.__("of :count items",{count:t.items.total})),1)]),r("ul",ye,[(i(!0),o(y,null,f(t.items.links,(a,l)=>(i(),o("li",{key:l},[_(u,{class:"btn btn--primary btn--sm",type:"button",as:a.url===null||a.active?"button":"a",disabled:a.url===null||a.active,href:a.url,"aria-current":a.active?"page":"",innerHTML:a.label},null,8,["as","disabled","href","aria-current","innerHTML"])]))),128))])])}const ge=g(de,[["render",fe]]),qe={components:{Link:A},props:{item:{type:Object,required:!0}},computed:{selected:{get(){return this.$parent.selected(this.item)},set(e){e?this.$parent.select(this.item):this.$parent.deselect(this.item)}}},methods:{destroy(){this.$inertia.delete(this.item.url,{onBefore:()=>confirm(this.__("Are you sure?")),onStart:e=>this.$parent.deselect(this.item)})}}},ke={key:0,scope:"row"},ve={class:"form-check",style:{position:"relative",top:"3px"}},we=r("span",{class:"form-label form-check__label","aria-label":""},null,-1),Ve=["innerHTML"],Me={class:"table__actions"},Se=["aria-label"];function Ae(e,s,t,h,c,n){const u=d("Icon"),a=d("Link");return i(),o("tr",{class:O({"is-selected":n.selected,"is-trashed":t.item.trashed})},[e.$parent.actions.length>0?(i(),o("th",ke,[r("label",ve,[q(r("input",{class:"form-check__control",type:"checkbox","onUpdate:modelValue":s[0]||(s[0]=l=>n.selected=l)},null,512),[[v,n.selected]]),we])])):m("",!0),(i(!0),o(y,null,f(t.item.fields,l=>(i(),o("td",{key:`${t.item.id}-${l.name}`,innerHTML:l.formatted_value},null,8,Ve))),128)),r("td",null,[r("div",Me,[t.item.abilities.delete?(i(),o("button",{key:0,type:"button",class:"btn btn--icon btn--delete btn--sm","aria-label":e.__("Delete"),onClick:s[1]||(s[1]=(...l)=>n.destroy&&n.destroy(...l))},[_(u,{class:"btn__icon",name:"delete"})],8,Se)):m("",!0),t.item.abilities.view?(i(),p(a,{key:1,href:t.item.url,class:"btn btn--icon btn--tertiary btn--sm","aria-label":e.__("View")},{default:w(()=>[_(u,{class:"btn__icon",name:"view"})]),_:1},8,["href","aria-label"])):m("",!0),t.item.abilities.update?(i(),p(a,{key:2,href:`${t.item.url}/edit`,class:"btn btn--icon btn--tertiary btn--sm","aria-label":e.__("Edit")},{default:w(()=>[_(u,{class:"btn__icon",name:"edit"})]),_:1},8,["href","aria-label"])):m("",!0)])])],2)}const Ce=g(qe,[["render",Ae]]),Fe={components:{Actions:U,Extracts:T,Filters:Q,Head:ue,Pagination:ge,Row:Ce},props:{actions:{type:Array,default:()=>[]},extracts:{type:Array,default:()=>[]},filters:{type:Array,default:()=>[]},items:{type:Object,required:!0}},data(){return{selection:[],allMatching:!1,processing:!1,query:this.$inertia.form(window.location.href,this.items.query)}},computed:{columns(){var s,t;return(((t=(s=this.items.data)==null?void 0:s[0])==null?void 0:t.fields)||[]).map(h=>({label:h.label,name:h.name,sortable:h.sortable,searchable:h.searchable}))}},methods:{selected(e){return this.selection.includes(e.id)},select(e){this.selection.includes(e.id)||this.selection.push(e.id)},deselect(e){const s=this.selection.indexOf(e.id);s!==-1&&this.selection.splice(s,1),this.allMatching=!1},selectAll(e=!1){this.allMatching=e,this.selection=this.items.data.map(s=>s.id)},clearSelection(){this.allMatching=!1,this.selection=[]},fetch(){this.query.transform(e=>({...e,page:1})).get(this.items.path,{replace:!0,preserveState:!0,preserveScroll:!0,onStart:()=>{this.processing=!0},onFinish:()=>{this.clearSelection(),this.processing=!1}})}}},Ue={key:0,class:"app-operation"},$e={class:"app-list"},xe={class:"card"},He={class:"table-responsive"},Le={key:0,class:"table table--striped table--clear-border table--rounded"},Oe={key:1,class:"alert alert--info"};function Ie(e,s,t,h,c,n){const u=d("Filters"),a=d("Actions"),l=d("Extracts"),k=d("Head"),C=d("Row"),F=d("Pagination");return i(),o("div",null,[t.filters.length>0||t.actions.length>0||t.extracts.length>0?(i(),o("div",Ue,[t.filters.length>0?(i(),p(u,{key:0,query:c.query,filters:t.filters,"onUpdate:query":n.fetch},null,8,["query","filters","onUpdate:query"])):m("",!0),t.actions.length>0?(i(),p(a,{key:1,actions:t.actions,"all-matching":c.allMatching,selection:c.selection,onSuccess:n.clearSelection},null,8,["actions","all-matching","selection","onSuccess"])):m("",!0),t.extracts.length>0?(i(),p(l,{key:2,extracts:t.extracts},null,8,["extracts"])):m("",!0)])):m("",!0),r("div",$e,[r("div",xe,[r("div",He,[t.items.data.length?(i(),o("table",Le,[_(k,{items:t.items.data,query:c.query,selection:c.selection,columns:n.columns,"onUpdate:query":n.fetch},null,8,["items","query","selection","columns","onUpdate:query"]),r("tbody",null,[(i(!0),o(y,null,f(t.items.data,V=>(i(),p(C,{key:V.id,item:V},null,8,["item"]))),128))])])):(i(),o("div",Oe,b(e.__("No results found.")),1))])]),_(F,{query:c.query,items:t.items,"onUpdate:query":n.fetch},null,8,["query","items","onUpdate:query"])])])}const Ee=g(Fe,[["render",Ie]]);export{Ee as T}; +import{A as U}from"./Actions.312fea0a.js";import{_ as g,r as d,o as i,c as o,f as _,w as M,C as $,d as r,t as b,e as m,g as q,v as x,h as S,F as y,a as f,b as p,m as H,i as v,j as w,L as A,k as L,n as O}from"./app.1185eb56.js";const I={props:{extracts:{type:Array,required:!0}},data(){return{_extract:null,form:this.$inertia.form(this.name,{})}},computed:{name(){return window.location.pathname+"-extracts"},options(){return this.extracts.map(e=>({value:e.key,formatted_value:e.name}))}},methods:{submit(){const e=this.extracts.find(s=>s.key=this._extract);this.form.get(e.url)}}};function j(e,s,t,h,c,n){const u=d("FormHandler");return i(),o("form",{onSubmit:s[1]||(s[1]=M(()=>{},["prevent"])),onReset:s[2]||(s[2]=M(()=>{},["prevent"]))},[_(u,{nullable:"",class:"form-group--inline",component:"Select",modelValue:c._extract,"onUpdate:modelValue":[s[0]||(s[0]=a=>c._extract=a),n.submit],name:n.name,id:n.name,form:c.form,label:e.__("Extract"),options:n.options},null,8,["modelValue","name","id","form","label","options","onUpdate:modelValue"])],32)}const T=g(I,[["render",j]]),E={mixins:[$],props:{filters:{type:Array,default:()=>[]},query:{type:Object,required:!0}},emits:["update:query"],computed:{activeFilters(){return this.filters.filter(e=>e.active).length}},methods:{emit(){this.$emit("update:query")},reset(){this.$inertia.get(this.$parent.items.path)}}},R={class:"app-operation__filter"},B=["aria-label"],D={key:0,class:"btn__counter"},N={class:"app-drawer"},P={class:"app-drawer__title"},z={class:"app-drawer__inner"},G={class:"form-group--reset"},J=["aria-label"];function K(e,s,t,h,c,n){const u=d("Icon"),a=d("FormHandler");return i(),o("div",R,[r("button",{type:"button",class:"btn btn--secondary btn--icon btn--has-counter","aria-label":e.isOpen?e.__("Close filters"):e.__("Open filters"),onClick:s[0]||(s[0]=(...l)=>e.toggle&&e.toggle(...l))},[_(u,{class:"btn__icon btn__icon--start",name:e.isOpen?"filter-list-off":"filter-list"},null,8,["name"]),n.activeFilters>0?(i(),o("span",D,b(n.activeFilters),1)):m("",!0)],8,B),q(r("div",N,[r("h2",P,[S(b(e.__("Filters"))+" ",1),r("button",{type:"button",class:"btn btn--secondary btn--sm btn--icon",onClick:s[1]||(s[1]=(...l)=>e.close&&e.close(...l))},[_(u,{class:"btn__icon btn__icon--sm",name:"close"})])]),r("div",z,[(i(!0),o(y,null,f(t.filters,l=>(i(),p(a,H(l,{modelValue:t.query[l.key],"onUpdate:modelValue":[k=>t.query[l.key]=k,n.emit],form:t.query,key:l.key,name:l.key,label:l.name}),null,16,["modelValue","onUpdate:modelValue","form","name","label"]))),128)),r("div",G,[r("button",{type:"button",class:"btn btn--sm btn--icon btn--tertiary","aria-label":e.__("Reset"),onClick:s[2]||(s[2]=(...l)=>n.reset&&n.reset(...l))},b(e.__("Reset")),9,J)])])],512),[[x,e.isOpen]])])}const Q=g(E,[["render",K]]),W={props:{items:{type:Array,required:!0},selection:{type:Array,required:!0},query:{type:Object,required:!0},columns:{type:Array,required:!0}},emits:["update:query"],watch:{indeterminate(e,s){this.$refs.input.indeterminate=e}},computed:{selected:{get(){return this.selection.length>0&&this.selection.length===this.items.length},set(e){e?this.$parent.selectAll():this.$parent.clearSelection()}},allMatching:{get(){return this.$parent.allMatching},set(e){e?this.$parent.selectAll(!0):this.$parent.clearSelection()}},indeterminate(){return this.selection.length>0&&this.selection.length0?(i(),o("th",X,[r("div",Y,[r("label",Z,[q(r("input",{ref:"input",class:"form-check__control",type:"checkbox","onUpdate:modelValue":s[0]||(s[0]=l=>n.selected=l),style:{"margin-inline-end":"0"}},null,512),[[v,n.selected]]),ee]),_(u,{id:"table-selection-control"},{default:w(()=>[r("li",te,b(e.__(":count items are selected",{count:n.totalItems})),1),se,r("li",ne,[r("label",le,[q(r("input",{class:"form-check__control",type:"checkbox","onUpdate:modelValue":s[1]||(s[1]=l=>n.allMatching=l)},null,512),[[v,n.allMatching]]),r("span",re,b(e.__("Select all matching (:count)",{count:e.$parent.items.total})),1)])])]),_:1})])])):m("",!0),(i(!0),o(y,null,f(t.columns,l=>(i(),o("th",{key:l.name,scope:"col"},[r("div",ie,[S(b(l.label)+" ",1),l.sortable?(i(),o("button",{key:0,type:"button",onClick:k=>n.sort(l.name),class:"table-sort-btn"},[_(a,{name:n.icon(l.name)},null,8,["name"])],8,ae)):m("",!0)])]))),128)),oe])])}const ue=g(W,[["render",ce]]),de={components:{Link:A},props:{items:{type:Object,required:!0},query:{type:Object,required:!0}},emits:["update:query"],data(){return{counts:[15,25,50,100]}},methods:{emit(){this.$emit("update:query")}}},me={class:"list-footer"},_e={class:"list-footer__pager"},he=["value"],be=["value"],pe={for:"per-page"},ye={class:"list-footer__pagination"};function fe(e,s,t,h,c,n){const u=d("Link");return i(),o("div",me,[r("div",_e,[q(r("select",{class:"form-control form-control--sm",id:"per-page","onUpdate:modelValue":[s[0]||(s[0]=a=>t.query.per_page=a),s[1]||(s[1]=(...a)=>n.emit&&n.emit(...a))]},[c.counts.includes(t.query.per_page)?m("",!0):(i(),o("option",{key:0,disabled:"",value:t.query.per_page},b(e.__("Custom (:count)",{count:t.query.per_page})),9,he)),(i(!0),o(y,null,f(c.counts,a=>(i(),o("option",{key:a,value:a},b(a),9,be))),128))],512),[[L,t.query.per_page,void 0,{number:!0}]]),r("label",pe,b(e.__("of :count items",{count:t.items.total})),1)]),r("ul",ye,[(i(!0),o(y,null,f(t.items.links,(a,l)=>(i(),o("li",{key:l},[_(u,{class:"btn btn--primary btn--sm",type:"button",as:a.url===null||a.active?"button":"a",disabled:a.url===null||a.active,href:a.url,"aria-current":a.active?"page":"",innerHTML:a.label},null,8,["as","disabled","href","aria-current","innerHTML"])]))),128))])])}const ge=g(de,[["render",fe]]),qe={components:{Link:A},props:{item:{type:Object,required:!0}},computed:{selected:{get(){return this.$parent.selected(this.item)},set(e){e?this.$parent.select(this.item):this.$parent.deselect(this.item)}}},methods:{destroy(){this.$inertia.delete(this.item.url,{onBefore:()=>confirm(this.__("Are you sure?")),onStart:e=>this.$parent.deselect(this.item)})}}},ke={key:0,scope:"row"},ve={class:"form-check",style:{position:"relative",top:"3px"}},we=r("span",{class:"form-label form-check__label","aria-label":""},null,-1),Ve=["innerHTML"],Me={class:"table__actions"},Se=["aria-label"];function Ae(e,s,t,h,c,n){const u=d("Icon"),a=d("Link");return i(),o("tr",{class:O({"is-selected":n.selected,"is-trashed":t.item.trashed})},[e.$parent.actions.length>0?(i(),o("th",ke,[r("label",ve,[q(r("input",{class:"form-check__control",type:"checkbox","onUpdate:modelValue":s[0]||(s[0]=l=>n.selected=l)},null,512),[[v,n.selected]]),we])])):m("",!0),(i(!0),o(y,null,f(t.item.fields,l=>(i(),o("td",{key:`${t.item.id}-${l.name}`,innerHTML:l.formatted_value},null,8,Ve))),128)),r("td",null,[r("div",Me,[t.item.abilities.delete?(i(),o("button",{key:0,type:"button",class:"btn btn--icon btn--delete btn--sm","aria-label":e.__("Delete"),onClick:s[1]||(s[1]=(...l)=>n.destroy&&n.destroy(...l))},[_(u,{class:"btn__icon",name:"delete"})],8,Se)):m("",!0),t.item.abilities.view?(i(),p(a,{key:1,href:t.item.url,class:"btn btn--icon btn--tertiary btn--sm","aria-label":e.__("View")},{default:w(()=>[_(u,{class:"btn__icon",name:"view"})]),_:1},8,["href","aria-label"])):m("",!0),t.item.abilities.update?(i(),p(a,{key:2,href:`${t.item.url}/edit`,class:"btn btn--icon btn--tertiary btn--sm","aria-label":e.__("Edit")},{default:w(()=>[_(u,{class:"btn__icon",name:"edit"})]),_:1},8,["href","aria-label"])):m("",!0)])])],2)}const Ce=g(qe,[["render",Ae]]),Fe={components:{Actions:U,Extracts:T,Filters:Q,Head:ue,Pagination:ge,Row:Ce},props:{actions:{type:Array,default:()=>[]},extracts:{type:Array,default:()=>[]},filters:{type:Array,default:()=>[]},items:{type:Object,required:!0}},data(){return{selection:[],allMatching:!1,processing:!1,query:this.$inertia.form(window.location.href,this.items.query)}},computed:{columns(){var s,t;return(((t=(s=this.items.data)==null?void 0:s[0])==null?void 0:t.fields)||[]).map(h=>({label:h.label,name:h.name,sortable:h.sortable,searchable:h.searchable}))}},methods:{selected(e){return this.selection.includes(e.id)},select(e){this.selection.includes(e.id)||this.selection.push(e.id)},deselect(e){const s=this.selection.indexOf(e.id);s!==-1&&this.selection.splice(s,1),this.allMatching=!1},selectAll(e=!1){this.allMatching=e,this.selection=this.items.data.map(s=>s.id)},clearSelection(){this.allMatching=!1,this.selection=[]},fetch(){this.query.transform(e=>({...e,page:1})).get(this.items.path,{replace:!0,preserveState:!0,preserveScroll:!0,onStart:()=>{this.processing=!0},onFinish:()=>{this.clearSelection(),this.processing=!1}})}}},Ue={key:0,class:"app-operation"},$e={class:"app-list"},xe={class:"card"},He={class:"table-responsive"},Le={key:0,class:"table table--striped table--clear-border table--rounded"},Oe={key:1,class:"alert alert--info"};function Ie(e,s,t,h,c,n){const u=d("Filters"),a=d("Actions"),l=d("Extracts"),k=d("Head"),C=d("Row"),F=d("Pagination");return i(),o("div",null,[t.filters.length>0||t.actions.length>0||t.extracts.length>0?(i(),o("div",Ue,[t.filters.length>0?(i(),p(u,{key:0,query:c.query,filters:t.filters,"onUpdate:query":n.fetch},null,8,["query","filters","onUpdate:query"])):m("",!0),t.actions.length>0?(i(),p(a,{key:1,actions:t.actions,"all-matching":c.allMatching,selection:c.selection,onSuccess:n.clearSelection},null,8,["actions","all-matching","selection","onSuccess"])):m("",!0),t.extracts.length>0?(i(),p(l,{key:2,extracts:t.extracts},null,8,["extracts"])):m("",!0)])):m("",!0),r("div",$e,[r("div",xe,[r("div",He,[t.items.data.length?(i(),o("table",Le,[_(k,{items:t.items.data,query:c.query,selection:c.selection,columns:n.columns,"onUpdate:query":n.fetch},null,8,["items","query","selection","columns","onUpdate:query"]),r("tbody",null,[(i(!0),o(y,null,f(t.items.data,V=>(i(),p(C,{key:V.id,item:V},null,8,["item"]))),128))])])):(i(),o("div",Oe,b(e.__("No results found.")),1))])]),_(F,{query:c.query,items:t.items,"onUpdate:query":n.fetch},null,8,["query","items","onUpdate:query"])])])}const Ee=g(Fe,[["render",Ie]]);export{Ee as T}; diff --git a/public/build/assets/app.fa6c6c43.js b/public/build/assets/app.1185eb56.js similarity index 97% rename from public/build/assets/app.fa6c6c43.js rename to public/build/assets/app.1185eb56.js index b2c7e6d8..8a782ffe 100644 --- a/public/build/assets/app.fa6c6c43.js +++ b/public/build/assets/app.1185eb56.js @@ -9,7 +9,7 @@ const xd="modulepreload",Pd=function(e){return"/build/"+e},Is={},nn=function(t,n Please specify a more appropriate element using the "as" attribute. For example: -...'),xt.h(i.as,un({},r,o==="a"?{href:u}:{},{onClick:function(m){var c;Pt.shouldIntercept(m)&&(m.preventDefault(),Pt.Inertia.visit(u,{data:d,method:a,replace:i.replace,preserveScroll:i.preserveScroll,preserveState:(c=i.preserveState)!=null?c:a!=="get",only:i.only,headers:i.headers,onCancelToken:r.onCancelToken||function(){return{}},onBefore:r.onBefore||function(){return{}},onStart:r.onStart||function(){return{}},onProgress:r.onProgress||function(){return{}},onFinish:r.onFinish||function(){return{}},onCancel:r.onCancel||function(){return{}},onSuccess:r.onSuccess||function(){return{}},onError:r.onError||function(){return{}}}))}}),n)}}};Ii=bb,_d=function(e){try{var t,n,r,i,o,a,s;n=(t=e.id)===void 0?"app":t,r=e.resolve,i=e.setup,o=e.title,a=e.page,s=e.render;var u=typeof window>"u",d=u?null:document.getElementById(n),m=a||JSON.parse(d.dataset.page),c=function(f){return Promise.resolve(r(f)).then(function(b){return b.default||b})},l=[];return Promise.resolve(c(m.component).then(function(f){return i({el:d,app:of,App:of,props:{initialPage:m,initialComponent:f,resolveComponent:c,titleCallback:o,onHeadUpdate:u?function(b){return l=b}:null},plugin:gb})})).then(function(f){return function(){if(u)return Promise.resolve(s(xt.createSSRApp({render:function(){return xt.h("div",{id:n,"data-page":JSON.stringify(m),innerHTML:s(f)})}}))).then(function(b){return{head:l,body:b}})}()})}catch(f){return Promise.reject(f)}};async function _b(e,t){const n=t[e];if(typeof n>"u")throw new Error(`Page not found: ${e}`);return typeof n=="function"?n():n}const pn={data(){return{isOpen:!1}},methods:{open(){this.isOpen||(this.isOpen=!0,this.$dispatcher.emit("open"))},close(){this.isOpen&&(this.isOpen=!1,this.$dispatcher.emit("close"))},toggle(){this.isOpen?this.close():this.open()}}},Le=(e,t)=>{const n=e.__vccOpts||e;for(const[r,i]of t)n[r]=i;return n},Ob={mixins:[pn],props:{message:{type:String,required:!0},type:{type:String,default:"info"}},inheritAttrs:!1,data(){return{isOpen:!0}}},Eb=["innerHTML"];function wb(e,t,n,r,i,o){const a=ke("Icon");return Ye((se(),fe("div",{class:we(["alert",`alert--${n.type}`])},[X("div",{class:"alert__message",innerHTML:n.message},null,8,Eb),X("button",{type:"button",class:"alert__close",onClick:t[0]||(t[0]=(...s)=>e.close&&e.close(...s))},[Oe(a,{name:"close"})])],2)),[[qr,i.isOpen]])}const Sb=Le(Ob,[["render",wb]]),Ab={components:{Link:Ii},props:{items:{type:Array,default:()=>[]}}},Tb=["aria-label"],kb={class:"breadcrumbs"},xb={key:1,"aria-current":"page"};function Pb(e,t,n,r,i,o){const a=ke("Link");return se(),fe("nav",{class:"app-header__breadcrumbs","aria-label":e.__("Breadcrumbs")},[X("ol",kb,[(se(!0),fe(Me,null,ot(n.items,s=>(se(),fe("li",{key:s.url,class:"breadcrumb-item"},[s.active?(se(),fe("span",xb,pe(s.label),1)):(se(),Et(a,{key:0,href:s.url},{default:mt(()=>[wt(pe(s.label),1)]),_:2},1032,["href"]))]))),128))])],8,Tb)}const Nb=Le(Ab,[["render",Pb]]),Rb={components:{Breadcrumbs:Nb},props:{title:{type:String,required:!0},breadcrumbs:{type:Array,default:()=>[]}}},Lb={class:"app-header"},Cb={class:"app-header__heading"},Ib={class:"app-header__title"},Mb=X("div",{class:"app-header__actions"},null,-1);function $b(e,t,n,r,i,o){const a=ke("Breadcrumbs");return se(),fe("header",Lb,[X("div",Cb,[X("h1",Ib,pe(n.title),1),Oe(a,{items:n.breadcrumbs},null,8,["items"])]),Mb])}const jb=Le(Rb,[["render",$b]]),wd=(e,t=300)=>{let n=null;return function(){clearTimeout(n);const r=arguments,i=this;n=setTimeout(function(){e.apply(i,r)},t)}},Sd=(e,t=300)=>{let n,r;return function(){const i=arguments,o=this;r?(clearTimeout(n),n=setTimeout(function(){Date.now()-r>=t&&(e.apply(o,i),r=Date.now())},t-(Date.now()-r))):(e.apply(o,i),r=Date.now())}},qb={props:{notification:{type:Object,required:!0}},mounted(){this.$refs.accordion.$dispatcher.on("open",()=>{this.notification.read_at===null&&!this.processing&&this.read()})},data(){return{processing:!1}},methods:{read(){this.processing=!0,this.$http.patch(`/api/notifications/${this.notification.id}`).then(e=>{Object.assign(this.notification,e.data),this.$parent.response.total_unread--}).catch(e=>{}).finally(()=>{this.processing=!1})}}},Db={class:"accordion__caption"},Bb={class:"accordion__meta"},Fb=["datetime"],Ub=["innerHTML"];function Hb(e,t,n,r,i,o){const a=ke("Accordion");return se(),Et(a,{ref:"accordion",class:we({"accordion--read":n.notification.read_at!==null})},{header:mt(()=>[X("span",Db,[wt(pe(n.notification.title)+" ",1),X("span",Bb,[X("time",{datetime:n.notification.created_at},pe(n.notification.formatted_created_at),9,Fb)])])]),default:mt(()=>[X("div",{innerHTML:n.notification.content},null,8,Ub)]),_:1},8,["class"])}const Vb=Le(qb,[["render",Hb]]),Kb={components:{Notification:Vb},mixins:[pn],mounted(){this.fetch(),window.addEventListener("keydown",e=>{this.isOpen&&e.code==="Escape"&&this.close()}),this.$refs.container.addEventListener("scroll",Sd(e=>{this.shouldPaginate()&&this.paginate()},300))},data(){return{processing:!1,response:{data:[],total_unread:0}}},methods:{fetch(){this.processing=!0,this.$http.get("/api/notifications").then(e=>{this.response=e.data}).catch(e=>{}).finally(()=>{this.processing=!1})},paginate(){this.processing=!0,this.$http.get(this.response.next_page_url).then(e=>{this.response.data.push(...e.data.data),this.response.next_page_url=e.data.next_page_url,this.response.prev_page_url=e.data.prev_page_url,this.response.total_unread=e.data.total_unread}).catch(e=>{}).finally(()=>{this.processing=!1})},shouldPaginate(){const e=this.$refs.container;return!this.processing&&this.response.next_page_url!==null&&this.response.data.length>0&&e.scrollHeight-e.scrollTop-e.clientHeight<1}}},zb=["aria-label"],Wb={key:0,class:"btn__counter"},Gb={ref:"container",class:"app-drawer",style:{overflow:"auto"}},Zb={class:"app-drawer__title"},Jb={class:"app-drawer__inner"},Yb={key:0,class:"accordion-wrapper"},Xb={key:1,class:"alert alert--info"};function Qb(e,t,n,r,i,o){const a=ke("Icon"),s=ke("Notification");return se(),fe(Me,null,[X("button",{ref:"button",type:"button",class:"btn btn--secondary btn--icon btn--has-counter","aria-label":e.__("View notifications"),onClick:t[0]||(t[0]=(...u)=>e.toggle&&e.toggle(...u))},[Oe(a,{class:"btn__icon btn__icon--start",name:"notification"}),i.response.total_unread>0?(se(),fe("span",Wb,pe(i.response.total_unread),1)):je("",!0)],8,zb),Ye(X("div",Gb,[X("h2",Zb,[wt(pe(e.__("Notifications"))+" ",1),X("button",{type:"button",class:"btn btn--secondary btn--sm btn--icon",onClick:t[1]||(t[1]=(...u)=>e.close&&e.close(...u))},[Oe(a,{class:"btn__icon btn__icon--sm",name:"close"})])]),X("div",Jb,[i.response.data.length>0?(se(),fe("div",Yb,[(se(!0),fe(Me,null,ot(i.response.data,u=>(se(),Et(s,{key:u.id,notification:u},null,8,["notification"]))),128))])):(se(),fe("div",Xb,pe(e.__("No results found.")),1))])],512),[[qr,e.isOpen]])],64)}const e_=Le(Kb,[["render",Qb]]),t_={mixins:[pn],props:{direction:{type:String,default:"top"}},computed:{classNames(){return`user-menu-navigation--${this.direction}`}}},n_={class:"user-menu-wrapper"},r_=["aria-expanded","aria-label"],i_=["src"],o_={class:"user-menu__caption"},a_={class:"user-menu__name"},l_={class:"user-menu__role"},s_={class:"user-menu__toggle"},u_={type:"submit",form:"logout-form",class:"user-menu-navigation__item"};function f_(e,t,n,r,i,o){const a=ke("Icon");return se(),fe("div",n_,[X("button",{type:"button",class:"user-menu","aria-expanded":e.isOpen?"true":"false","aria-label":e.__("User Menu"),onClick:t[0]||(t[0]=(...s)=>e.toggle&&e.toggle(...s))},[X("img",{class:"user-menu__avatar",src:e.$app.user.avatar},null,8,i_),X("div",o_,[X("span",a_,pe(e.$app.user.name),1),X("span",l_,pe(e.$app.user.email),1)]),X("div",s_,[Oe(a,{class:"user-menu__arrow",name:"unfold-more"})])],8,r_),X("ul",{class:we(["user-menu-navigation",o.classNames]),"aria-labelledby":"user-user-navigation"},[X("li",null,[X("button",u_,pe(e.__("Logout")),1)])],2)])}const Ad=Le(t_,[["render",f_]]),c_={components:{Link:Ii,Notifications:e_,UserMenu:Ad},mounted(){this.sync(),this.$parent.$refs.sidebar.$dispatcher.on("open",this.sync),this.$parent.$refs.sidebar.$dispatcher.on("close",this.sync)},data(){return{isOpen:!1}},methods:{toggleSidebar(){this.$parent.$refs.sidebar.toggle()},sync(){this.isOpen=this.$parent.$refs.sidebar.isOpen}}},d_={class:"app-topbar"},h_={class:"app-topbar__inner"},p_=["src","alt"],y_={class:"app-topbar__actions"};function m_(e,t,n,r,i,o){const a=ke("Link"),s=ke("Icon"),u=ke("Notifications"),d=ke("UserMenu");return se(),fe("div",d_,[X("div",h_,[Oe(a,{href:e.$app.config.url},{default:mt(()=>[X("img",{class:"app-topbar__logo",src:e.$app.config.branding.logo,alt:e.$app.config.name},null,8,p_)]),_:1},8,["href"]),X("div",y_,[X("button",{type:"button",class:"btn btn--secondary btn--icon","data-action":"open-navigation",onClick:t[0]||(t[0]=(...m)=>o.toggleSidebar&&o.toggleSidebar(...m))},[Oe(s,{class:"btn__icon btn__icon--start",name:i.isOpen?"menu-open":"menu"},null,8,["name"])]),Oe(u),Oe(d,{direction:"bottom"})])])])}const v_=Le(c_,[["render",m_]]),g_={components:{Link:Ii,UserMenu:Ad},mixins:[pn],mounted(){this.$inertia.on("success",this.close)},methods:{isActive(e){return this.$page.props.url.startsWith(e)}}},b_={class:"app-sidebar__header"},__=["src","alt"],O_=["aria-label"],E_={class:"navigation-item__caption"},w_={class:"app-sidebar__title"},S_={class:"navigation-item__caption"},A_={class:"navigation-submenu"},T_={key:0},k_={key:1};function x_(e,t,n,r,i,o){const a=ke("Link"),s=ke("Icon");return se(),fe("aside",{class:we(["app-sidebar",{"app-sidebar--open":e.isOpen}])},[X("div",b_,[Oe(a,{href:e.$app.config.url},{default:mt(()=>[X("img",{class:"app-sidebar__logo",src:e.$app.config.branding.logo,alt:e.$app.config.name},null,8,__)]),_:1},8,["href"])]),X("nav",{class:"navigation app-sidebar__navigation","aria-label":e.__("Site")},[X("ul",null,[X("li",{class:we(["navigation-item",{"is-open":e.$app.config.url===e.$page.props.url}])},[Oe(a,{class:we(["navigation-item__link",{"is-active":e.$app.config.url===e.$page.props.url}]),href:e.$app.config.url},{default:mt(()=>[Oe(s,{class:"navigation-item__icon",name:"dashboard"}),X("span",E_,pe(e.__("Dashboard")),1)]),_:1},8,["href","class"])],2)]),X("p",w_,pe(e.__("Resources")),1),X("ul",null,[(se(!0),fe(Me,null,ot(e.$app.resources,u=>(se(),fe("li",{class:we(["navigation-item",{"is-open":o.isActive(u.urls.index)}]),key:u.key},[Oe(a,{class:we(["navigation-item__link",{"is-active":o.isActive(u.urls.index)}]),href:u.urls.index},{default:mt(()=>[Oe(s,{class:"navigation-item__icon",name:u.icon},null,8,["name"]),X("span",S_,pe(u.name),1)]),_:2},1032,["href","class"]),X("ul",A_,[u.abilities.viewAny?(se(),fe("li",T_,[Oe(a,{href:u.urls.index,"aria-current":u.urls.index===e.$page.props.url?"page":""},{default:mt(()=>[wt(pe(e.__("All :resource",{resource:u.name})),1)]),_:2},1032,["href","aria-current"])])):je("",!0),u.abilities.create?(se(),fe("li",k_,[Oe(a,{href:u.urls.create,"aria-current":u.urls.create===e.$page.props.url?"page":""},{default:mt(()=>[wt(pe(e.__("Create :model",{model:u.model_name})),1)]),_:2},1032,["href","aria-current"])])):je("",!0)])],2))),128))])],8,O_)],2)}const P_=Le(g_,[["render",x_]]),N_={components:{Alert:Sb,Header:jb,Nav:v_,Sidebar:P_},mounted(){const e=document.title;document.title=`${e} | ${this.title}`,this.$inertia.on("finish",()=>{document.title=`${e} | ${this.title}`})},computed:{token(){return this.$page.props.csrf_token},alerts(){return this.$page.props.alerts},title(){return this.$page.props.title||this.__("Dashboard")},breadcrumbs(){return this.$page.props.breadcrumbs||[]}}},R_={class:"app"},L_={class:"app-body"},C_={class:"app-body__inner"},I_={key:0,class:"app-alert"},M_={id:"logout-form",action:"/logout",method:"POST",style:{display:"none"}},$_=["value"];function j_(e,t,n,r,i,o){const a=ke("Sidebar"),s=ke("Nav"),u=ke("Header"),d=ke("Alert");return se(),fe("div",R_,[Oe(a,{ref:"sidebar"},null,512),X("main",L_,[Oe(s),X("div",C_,[Oe(u,{title:o.title,breadcrumbs:o.breadcrumbs},null,8,["title","breadcrumbs"]),o.alerts.length>0?(se(),fe("div",I_,[(se(!0),fe(Me,null,ot(o.alerts,(m,c)=>(se(),Et(d,dt({key:`${m.timestamp}-${c}`},m),null,16))),128))])):je("",!0),Qn(e.$slots,"default")])]),X("form",M_,[X("input",{type:"hidden",name:"_token",value:o.token},null,8,$_)])])}const q_=Le(N_,[["render",j_]]);var Td={exports:{}};/*! +...'),xt.h(i.as,un({},r,o==="a"?{href:u}:{},{onClick:function(m){var c;Pt.shouldIntercept(m)&&(m.preventDefault(),Pt.Inertia.visit(u,{data:d,method:a,replace:i.replace,preserveScroll:i.preserveScroll,preserveState:(c=i.preserveState)!=null?c:a!=="get",only:i.only,headers:i.headers,onCancelToken:r.onCancelToken||function(){return{}},onBefore:r.onBefore||function(){return{}},onStart:r.onStart||function(){return{}},onProgress:r.onProgress||function(){return{}},onFinish:r.onFinish||function(){return{}},onCancel:r.onCancel||function(){return{}},onSuccess:r.onSuccess||function(){return{}},onError:r.onError||function(){return{}}}))}}),n)}}};Ii=bb,_d=function(e){try{var t,n,r,i,o,a,s;n=(t=e.id)===void 0?"app":t,r=e.resolve,i=e.setup,o=e.title,a=e.page,s=e.render;var u=typeof window>"u",d=u?null:document.getElementById(n),m=a||JSON.parse(d.dataset.page),c=function(f){return Promise.resolve(r(f)).then(function(b){return b.default||b})},l=[];return Promise.resolve(c(m.component).then(function(f){return i({el:d,app:of,App:of,props:{initialPage:m,initialComponent:f,resolveComponent:c,titleCallback:o,onHeadUpdate:u?function(b){return l=b}:null},plugin:gb})})).then(function(f){return function(){if(u)return Promise.resolve(s(xt.createSSRApp({render:function(){return xt.h("div",{id:n,"data-page":JSON.stringify(m),innerHTML:s(f)})}}))).then(function(b){return{head:l,body:b}})}()})}catch(f){return Promise.reject(f)}};async function _b(e,t){const n=t[e];if(typeof n>"u")throw new Error(`Page not found: ${e}`);return typeof n=="function"?n():n}const pn={data(){return{isOpen:!1}},methods:{open(){this.isOpen||(this.isOpen=!0,this.$dispatcher.emit("open"))},close(){this.isOpen&&(this.isOpen=!1,this.$dispatcher.emit("close"))},toggle(){this.isOpen?this.close():this.open()}}},Le=(e,t)=>{const n=e.__vccOpts||e;for(const[r,i]of t)n[r]=i;return n},Ob={mixins:[pn],props:{message:{type:String,required:!0},type:{type:String,default:"info"}},inheritAttrs:!1,data(){return{isOpen:!0}}},Eb=["innerHTML"];function wb(e,t,n,r,i,o){const a=ke("Icon");return Ye((se(),fe("div",{class:we(["alert",`alert--${n.type}`])},[X("div",{class:"alert__message",innerHTML:n.message},null,8,Eb),X("button",{type:"button",class:"alert__close",onClick:t[0]||(t[0]=(...s)=>e.close&&e.close(...s))},[Oe(a,{name:"close"})])],2)),[[qr,i.isOpen]])}const Sb=Le(Ob,[["render",wb]]),Ab={components:{Link:Ii},props:{items:{type:Array,default:()=>[]}}},Tb=["aria-label"],kb={class:"breadcrumbs"},xb={key:1,"aria-current":"page"};function Pb(e,t,n,r,i,o){const a=ke("Link");return se(),fe("nav",{class:"app-header__breadcrumbs","aria-label":e.__("Breadcrumbs")},[X("ol",kb,[(se(!0),fe(Me,null,ot(n.items,s=>(se(),fe("li",{key:s.url,class:"breadcrumb-item"},[s.active?(se(),fe("span",xb,pe(s.label),1)):(se(),Et(a,{key:0,href:s.url},{default:mt(()=>[wt(pe(s.label),1)]),_:2},1032,["href"]))]))),128))])],8,Tb)}const Nb=Le(Ab,[["render",Pb]]),Rb={components:{Breadcrumbs:Nb},props:{title:{type:String,required:!0},breadcrumbs:{type:Array,default:()=>[]}}},Lb={class:"app-header"},Cb={class:"app-header__heading"},Ib={class:"app-header__title"},Mb=X("div",{class:"app-header__actions"},null,-1);function $b(e,t,n,r,i,o){const a=ke("Breadcrumbs");return se(),fe("header",Lb,[X("div",Cb,[X("h1",Ib,pe(n.title),1),Oe(a,{items:n.breadcrumbs},null,8,["items"])]),Mb])}const jb=Le(Rb,[["render",$b]]),wd=(e,t=300)=>{let n=null;return function(){clearTimeout(n);const r=arguments,i=this;n=setTimeout(function(){e.apply(i,r)},t)}},Sd=(e,t=300)=>{let n,r;return function(){const i=arguments,o=this;r?(clearTimeout(n),n=setTimeout(function(){Date.now()-r>=t&&(e.apply(o,i),r=Date.now())},t-(Date.now()-r))):(e.apply(o,i),r=Date.now())}},qb={props:{notification:{type:Object,required:!0}},mounted(){this.$refs.accordion.$dispatcher.on("open",()=>{this.notification.read_at===null&&!this.processing&&this.read()})},data(){return{processing:!1}},methods:{read(){this.processing=!0,this.$http.patch(`${this.$parent.url}/${this.notification.id}`).then(e=>{Object.assign(this.notification,e.data),this.$parent.response.total_unread--}).catch(e=>{}).finally(()=>{this.processing=!1})}}},Db={class:"accordion__caption"},Bb={class:"accordion__meta"},Fb=["datetime"],Ub=["innerHTML"];function Hb(e,t,n,r,i,o){const a=ke("Accordion");return se(),Et(a,{ref:"accordion",class:we({"accordion--read":n.notification.read_at!==null})},{header:mt(()=>[X("span",Db,[wt(pe(n.notification.title)+" ",1),X("span",Bb,[X("time",{datetime:n.notification.created_at},pe(n.notification.formatted_created_at),9,Fb)])])]),default:mt(()=>[X("div",{innerHTML:n.notification.content},null,8,Ub)]),_:1},8,["class"])}const Vb=Le(qb,[["render",Hb]]),Kb={components:{Notification:Vb},mixins:[pn],mounted(){this.fetch(),window.addEventListener("keydown",e=>{this.isOpen&&e.code==="Escape"&&this.close()}),this.$refs.container.addEventListener("scroll",Sd(e=>{this.shouldPaginate()&&this.paginate()},300))},data(){return{processing:!1,response:{data:[],total_unread:0}}},computed:{url(){return(window.Root.config.url+"/api/notifications").replaceAll("//","/")}},methods:{fetch(){this.processing=!0,this.$http.get(this.url).then(e=>{this.response=e.data}).catch(e=>{}).finally(()=>{this.processing=!1})},paginate(){this.processing=!0,this.$http.get(this.response.next_page_url).then(e=>{this.response.data.push(...e.data.data),this.response.next_page_url=e.data.next_page_url,this.response.prev_page_url=e.data.prev_page_url,this.response.total_unread=e.data.total_unread}).catch(e=>{}).finally(()=>{this.processing=!1})},shouldPaginate(){const e=this.$refs.container;return!this.processing&&this.response.next_page_url!==null&&this.response.data.length>0&&e.scrollHeight-e.scrollTop-e.clientHeight<1}}},zb=["aria-label"],Wb={key:0,class:"btn__counter"},Gb={ref:"container",class:"app-drawer",style:{overflow:"auto"}},Zb={class:"app-drawer__title"},Jb={class:"app-drawer__inner"},Yb={key:0,class:"accordion-wrapper"},Xb={key:1,class:"alert alert--info"};function Qb(e,t,n,r,i,o){const a=ke("Icon"),s=ke("Notification");return se(),fe(Me,null,[X("button",{ref:"button",type:"button",class:"btn btn--secondary btn--icon btn--has-counter","aria-label":e.__("View notifications"),onClick:t[0]||(t[0]=(...u)=>e.toggle&&e.toggle(...u))},[Oe(a,{class:"btn__icon btn__icon--start",name:"notification"}),i.response.total_unread>0?(se(),fe("span",Wb,pe(i.response.total_unread),1)):je("",!0)],8,zb),Ye(X("div",Gb,[X("h2",Zb,[wt(pe(e.__("Notifications"))+" ",1),X("button",{type:"button",class:"btn btn--secondary btn--sm btn--icon",onClick:t[1]||(t[1]=(...u)=>e.close&&e.close(...u))},[Oe(a,{class:"btn__icon btn__icon--sm",name:"close"})])]),X("div",Jb,[i.response.data.length>0?(se(),fe("div",Yb,[(se(!0),fe(Me,null,ot(i.response.data,u=>(se(),Et(s,{key:u.id,notification:u},null,8,["notification"]))),128))])):(se(),fe("div",Xb,pe(e.__("No results found.")),1))])],512),[[qr,e.isOpen]])],64)}const e_=Le(Kb,[["render",Qb]]),t_={mixins:[pn],props:{direction:{type:String,default:"top"}},computed:{classNames(){return`user-menu-navigation--${this.direction}`}}},n_={class:"user-menu-wrapper"},r_=["aria-expanded","aria-label"],i_=["src"],o_={class:"user-menu__caption"},a_={class:"user-menu__name"},l_={class:"user-menu__role"},s_={class:"user-menu__toggle"},u_={type:"submit",form:"logout-form",class:"user-menu-navigation__item"};function f_(e,t,n,r,i,o){const a=ke("Icon");return se(),fe("div",n_,[X("button",{type:"button",class:"user-menu","aria-expanded":e.isOpen?"true":"false","aria-label":e.__("User Menu"),onClick:t[0]||(t[0]=(...s)=>e.toggle&&e.toggle(...s))},[X("img",{class:"user-menu__avatar",src:e.$app.user.avatar},null,8,i_),X("div",o_,[X("span",a_,pe(e.$app.user.name),1),X("span",l_,pe(e.$app.user.email),1)]),X("div",s_,[Oe(a,{class:"user-menu__arrow",name:"unfold-more"})])],8,r_),X("ul",{class:we(["user-menu-navigation",o.classNames]),"aria-labelledby":"user-user-navigation"},[X("li",null,[X("button",u_,pe(e.__("Logout")),1)])],2)])}const Ad=Le(t_,[["render",f_]]),c_={components:{Link:Ii,Notifications:e_,UserMenu:Ad},mounted(){this.sync(),this.$parent.$refs.sidebar.$dispatcher.on("open",this.sync),this.$parent.$refs.sidebar.$dispatcher.on("close",this.sync)},data(){return{isOpen:!1}},methods:{toggleSidebar(){this.$parent.$refs.sidebar.toggle()},sync(){this.isOpen=this.$parent.$refs.sidebar.isOpen}}},d_={class:"app-topbar"},h_={class:"app-topbar__inner"},p_=["src","alt"],y_={class:"app-topbar__actions"};function m_(e,t,n,r,i,o){const a=ke("Link"),s=ke("Icon"),u=ke("Notifications"),d=ke("UserMenu");return se(),fe("div",d_,[X("div",h_,[Oe(a,{href:e.$app.config.url},{default:mt(()=>[X("img",{class:"app-topbar__logo",src:e.$app.config.branding.logo,alt:e.$app.config.name},null,8,p_)]),_:1},8,["href"]),X("div",y_,[X("button",{type:"button",class:"btn btn--secondary btn--icon","data-action":"open-navigation",onClick:t[0]||(t[0]=(...m)=>o.toggleSidebar&&o.toggleSidebar(...m))},[Oe(s,{class:"btn__icon btn__icon--start",name:i.isOpen?"menu-open":"menu"},null,8,["name"])]),Oe(u),Oe(d,{direction:"bottom"})])])])}const v_=Le(c_,[["render",m_]]),g_={components:{Link:Ii,UserMenu:Ad},mixins:[pn],mounted(){this.$inertia.on("success",this.close)},methods:{isActive(e){return this.$page.props.url.startsWith(e)}}},b_={class:"app-sidebar__header"},__=["src","alt"],O_=["aria-label"],E_={class:"navigation-item__caption"},w_={class:"app-sidebar__title"},S_={class:"navigation-item__caption"},A_={class:"navigation-submenu"},T_={key:0},k_={key:1};function x_(e,t,n,r,i,o){const a=ke("Link"),s=ke("Icon");return se(),fe("aside",{class:we(["app-sidebar",{"app-sidebar--open":e.isOpen}])},[X("div",b_,[Oe(a,{href:e.$app.config.url},{default:mt(()=>[X("img",{class:"app-sidebar__logo",src:e.$app.config.branding.logo,alt:e.$app.config.name},null,8,__)]),_:1},8,["href"])]),X("nav",{class:"navigation app-sidebar__navigation","aria-label":e.__("Site")},[X("ul",null,[X("li",{class:we(["navigation-item",{"is-open":e.$app.config.url===e.$page.props.url}])},[Oe(a,{class:we(["navigation-item__link",{"is-active":e.$app.config.url===e.$page.props.url}]),href:e.$app.config.url},{default:mt(()=>[Oe(s,{class:"navigation-item__icon",name:"dashboard"}),X("span",E_,pe(e.__("Dashboard")),1)]),_:1},8,["href","class"])],2)]),X("p",w_,pe(e.__("Resources")),1),X("ul",null,[(se(!0),fe(Me,null,ot(e.$app.resources,u=>(se(),fe("li",{class:we(["navigation-item",{"is-open":o.isActive(u.urls.index)}]),key:u.key},[Oe(a,{class:we(["navigation-item__link",{"is-active":o.isActive(u.urls.index)}]),href:u.urls.index},{default:mt(()=>[Oe(s,{class:"navigation-item__icon",name:u.icon},null,8,["name"]),X("span",S_,pe(u.name),1)]),_:2},1032,["href","class"]),X("ul",A_,[u.abilities.viewAny?(se(),fe("li",T_,[Oe(a,{href:u.urls.index,"aria-current":u.urls.index===e.$page.props.url?"page":""},{default:mt(()=>[wt(pe(e.__("All :resource",{resource:u.name})),1)]),_:2},1032,["href","aria-current"])])):je("",!0),u.abilities.create?(se(),fe("li",k_,[Oe(a,{href:u.urls.create,"aria-current":u.urls.create===e.$page.props.url?"page":""},{default:mt(()=>[wt(pe(e.__("Create :model",{model:u.model_name})),1)]),_:2},1032,["href","aria-current"])])):je("",!0)])],2))),128))])],8,O_)],2)}const P_=Le(g_,[["render",x_]]),N_={components:{Alert:Sb,Header:jb,Nav:v_,Sidebar:P_},mounted(){const e=document.title;document.title=`${e} | ${this.title}`,this.$inertia.on("finish",()=>{document.title=`${e} | ${this.title}`})},computed:{token(){return this.$page.props.csrf_token},alerts(){return this.$page.props.alerts},title(){return this.$page.props.title||this.__("Dashboard")},breadcrumbs(){return this.$page.props.breadcrumbs||[]}}},R_={class:"app"},L_={class:"app-body"},C_={class:"app-body__inner"},I_={key:0,class:"app-alert"},M_={id:"logout-form",action:"/logout",method:"POST",style:{display:"none"}},$_=["value"];function j_(e,t,n,r,i,o){const a=ke("Sidebar"),s=ke("Nav"),u=ke("Header"),d=ke("Alert");return se(),fe("div",R_,[Oe(a,{ref:"sidebar"},null,512),X("main",L_,[Oe(s),X("div",C_,[Oe(u,{title:o.title,breadcrumbs:o.breadcrumbs},null,8,["title","breadcrumbs"]),o.alerts.length>0?(se(),fe("div",I_,[(se(!0),fe(Me,null,ot(o.alerts,(m,c)=>(se(),Et(d,dt({key:`${m.timestamp}-${c}`},m),null,16))),128))])):je("",!0),Qn(e.$slots,"default")])]),X("form",M_,[X("input",{type:"hidden",name:"_token",value:o.token},null,8,$_)])])}const q_=Le(N_,[["render",j_]]);var Td={exports:{}};/*! * Quill Editor v1.3.7 * https://quilljs.com/ * Copyright (c) 2014, Jason Chen @@ -49,4 +49,4 @@ Please specify a more appropriate element using the "as" attribute. For example: `),Z}function ee(V,Z){if(M(V)&&V.nextElementSibling!=null&&!z(Z,` `)){var Y=V.offsetHeight+parseFloat(J(V).marginTop)+parseFloat(J(V).marginBottom);V.nextElementSibling.offsetTop>V.offsetTop+Y*1.5&&Z.insert(` -`)}return Z}function ae(V,Z){var Y={},te=V.style||{};return te.fontStyle&&J(V).fontStyle==="italic"&&(Y.italic=!0),te.fontWeight&&(J(V).fontWeight.startsWith("bold")||parseInt(J(V).fontWeight)>=700)&&(Y.bold=!0),Object.keys(Y).length>0&&(Z=D(Z,Y)),parseFloat(te.textIndent||0)>0&&(Z=new c.default().insert(" ").concat(Z)),Z}function ie(V,Z){var Y=V.data;if(V.parentNode.tagName==="O:P")return Z.insert(Y.trim());if(Y.trim().length===0&&V.parentNode.classList.contains("ql-clipboard"))return Z;if(!J(V.parentNode).whiteSpace.startsWith("pre")){var te=function(de,ue){return ue=ue.replace(/[^\u00a0]/g,""),ue.length<1&&de?" ":ue};Y=Y.replace(/\r\n/g," ").replace(/\n/g," "),Y=Y.replace(/\s\s+/g,te.bind(te,!0)),(V.previousSibling==null&&M(V.parentNode)||V.previousSibling!=null&&M(V.previousSibling))&&(Y=Y.replace(/^\s+/,te.bind(te,!1))),(V.nextSibling==null&&M(V.parentNode)||V.nextSibling!=null&&M(V.nextSibling))&&(Y=Y.replace(/\s+$/,te.bind(te,!1)))}return Z.insert(Y)}r.default=q,r.matchAttributor=ne,r.matchBlot=le,r.matchNewline=B,r.matchSpacing=ee,r.matchText=ie},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function b(g,v){for(var p=0;p '},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function b(g,v){for(var p=0;pf.right&&(g=f.right-b.right,this.root.style.left=c+g+"px"),b.leftf.bottom){var v=b.bottom-b.top,p=m.bottom-m.top+v;this.root.style.top=l-p+"px",this.root.classList.add("ql-flip")}return g}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),u}();r.default=s},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function S(A,k){var N=[],R=!0,I=!1,U=void 0;try{for(var G=A[Symbol.iterator](),re;!(R=(re=G.next()).done)&&(N.push(re.value),!(k&&N.length===k));R=!0);}catch(K){I=!0,U=K}finally{try{!R&&G.return&&G.return()}finally{if(I)throw U}}return N}return function(A,k){if(Array.isArray(A))return A;if(Symbol.iterator in Object(A))return S(A,k);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function S(A,k,N){A===null&&(A=Function.prototype);var R=Object.getOwnPropertyDescriptor(A,k);if(R===void 0){var I=Object.getPrototypeOf(A);return I===null?void 0:S(I,k,N)}else{if("value"in R)return R.value;var U=R.get;return U===void 0?void 0:U.call(N)}},s=function(){function S(A,k){for(var N=0;N','','',''].join(""),r.default=_},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=i(29),a=W(o),s=i(36),u=i(38),d=i(64),m=i(65),c=W(m),l=i(66),f=W(l),b=i(67),g=W(b),v=i(37),p=i(26),h=i(39),O=i(40),y=i(56),w=W(y),P=i(68),T=W(P),_=i(27),x=W(_),S=i(69),A=W(S),k=i(70),N=W(k),R=i(71),I=W(R),U=i(72),G=W(U),re=i(73),K=W(re),j=i(13),L=W(j),q=i(74),D=W(q),J=i(75),z=W(J),M=i(57),H=W(M),Q=i(41),ne=W(Q),le=i(28),he=W(le),be=i(59),$=W(be),B=i(60),ee=W(B),ae=i(61),ie=W(ae),V=i(108),Z=W(V),Y=i(62),te=W(Y);function W(de){return de&&de.__esModule?de:{default:de}}a.default.register({"attributors/attribute/direction":u.DirectionAttribute,"attributors/class/align":s.AlignClass,"attributors/class/background":v.BackgroundClass,"attributors/class/color":p.ColorClass,"attributors/class/direction":u.DirectionClass,"attributors/class/font":h.FontClass,"attributors/class/size":O.SizeClass,"attributors/style/align":s.AlignStyle,"attributors/style/background":v.BackgroundStyle,"attributors/style/color":p.ColorStyle,"attributors/style/direction":u.DirectionStyle,"attributors/style/font":h.FontStyle,"attributors/style/size":O.SizeStyle},!0),a.default.register({"formats/align":s.AlignClass,"formats/direction":u.DirectionClass,"formats/indent":d.IndentClass,"formats/background":v.BackgroundStyle,"formats/color":p.ColorStyle,"formats/font":h.FontClass,"formats/size":O.SizeClass,"formats/blockquote":c.default,"formats/code-block":L.default,"formats/header":f.default,"formats/list":g.default,"formats/bold":w.default,"formats/code":j.Code,"formats/italic":T.default,"formats/link":x.default,"formats/script":A.default,"formats/strike":N.default,"formats/underline":I.default,"formats/image":G.default,"formats/video":K.default,"formats/list/item":b.ListItem,"modules/formula":D.default,"modules/syntax":z.default,"modules/toolbar":H.default,"themes/bubble":Z.default,"themes/snow":te.default,"ui/icons":ne.default,"ui/picker":he.default,"ui/icon-picker":ee.default,"ui/color-picker":$.default,"ui/tooltip":ie.default},!0),r.default=a.default},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.IndentClass=void 0;var o=function(){function g(v,p){for(var h=0;h0&&this.children.tail.format(T,_)}},{key:"formats",value:function(){return b({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(T,_){if(T instanceof h)a(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"insertBefore",this).call(this,T,_);else{var x=_==null?this.length():_.offset(this),S=this.split(x);S.parent.insertBefore(T,S)}}},{key:"optimize",value:function(T){a(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"optimize",this).call(this,T);var _=this.next;_!=null&&_.prev===this&&_.statics.blotName===this.statics.blotName&&_.domNode.tagName===this.domNode.tagName&&_.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(_.moveChildren(this),_.remove())}},{key:"replace",value:function(T){if(T.statics.blotName!==this.statics.blotName){var _=u.default.create(this.statics.defaultChild);T.moveChildren(_),this.appendChild(_)}a(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"replace",this).call(this,T)}}]),w}(l.default);O.blotName="list",O.scope=u.default.Scope.BLOCK_BLOT,O.tagName=["OL","UL"],O.defaultChild="list-item",O.allowedChildren=[h],r.ListItem=h,r.default=O},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=i(56),a=s(o);function s(l){return l&&l.__esModule?l:{default:l}}function u(l,f){if(!(l instanceof f))throw new TypeError("Cannot call a class as a function")}function d(l,f){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:l}function m(l,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);l.prototype=Object.create(f&&f.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(l,f):l.__proto__=f)}var c=function(l){m(f,l);function f(){return u(this,f),d(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(a.default);c.blotName="italic",c.tagName=["EM","I"],r.default=c},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function b(g,v){for(var p=0;p-1?y?this.domNode.setAttribute(O,y):this.domNode.removeAttribute(O):a(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"format",this).call(this,O,y)}}],[{key:"create",value:function(O){var y=a(p.__proto__||Object.getPrototypeOf(p),"create",this).call(this,O);return typeof O=="string"&&y.setAttribute("src",this.sanitize(O)),y}},{key:"formats",value:function(O){return b.reduce(function(y,w){return O.hasAttribute(w)&&(y[w]=O.getAttribute(w)),y},{})}},{key:"match",value:function(O){return/\.(jpe?g|gif|png)$/.test(O)||/^data:image\/.+;base64/.test(O)}},{key:"sanitize",value:function(O){return(0,d.sanitize)(O,["http","https","data"])?O:"//:0"}},{key:"value",value:function(O){return O.getAttribute("src")}}]),p}(u.default.Embed);g.blotName="image",g.tagName="IMG",r.default=g},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function v(p,h){for(var O=0;O-1?y?this.domNode.setAttribute(O,y):this.domNode.removeAttribute(O):a(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"format",this).call(this,O,y)}}],[{key:"create",value:function(O){var y=a(p.__proto__||Object.getPrototypeOf(p),"create",this).call(this,O);return y.setAttribute("frameborder","0"),y.setAttribute("allowfullscreen",!0),y.setAttribute("src",this.sanitize(O)),y}},{key:"formats",value:function(O){return b.reduce(function(y,w){return O.hasAttribute(w)&&(y[w]=O.getAttribute(w)),y},{})}},{key:"sanitize",value:function(O){return d.default.sanitize(O)}},{key:"value",value:function(O){return O.getAttribute("src")}}]),p}(s.BlockEmbed);g.blotName="video",g.className="ql-video",g.tagName="IFRAME",r.default=g},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.FormulaBlot=void 0;var o=function(){function O(y,w){for(var P=0;P0||this.cachedText==null)&&(this.domNode.innerHTML=x(S),this.domNode.normalize(),this.attach()),this.cachedText=S)}}]),T}(b.default);O.className="ql-syntax";var y=new u.default.Attributor.Class("token","hljs",{scope:u.default.Scope.INLINE}),w=function(P){h(T,P),o(T,null,[{key:"register",value:function(){m.default.register(y,!0),m.default.register(O,!0)}}]);function T(_,x){v(this,T);var S=p(this,(T.__proto__||Object.getPrototypeOf(T)).call(this,_,x));if(typeof S.options.highlight!="function")throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var A=null;return S.quill.on(m.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(A),A=setTimeout(function(){S.highlight(),A=null},S.options.interval)}),S.highlight(),S}return o(T,[{key:"highlight",value:function(){var x=this;if(!this.quill.selection.composing){this.quill.update(m.default.sources.USER);var S=this.quill.getSelection();this.quill.scroll.descendants(O).forEach(function(A){A.highlight(x.options.highlight)}),this.quill.update(m.default.sources.SILENT),S!=null&&this.quill.setSelection(S,m.default.sources.SILENT)}}}]),T}(l.default);w.DEFAULTS={highlight:function(){return window.hljs==null?null:function(P){var T=window.hljs.highlightAuto(P);return T.value}}(),interval:1e3},r.CodeBlock=O,r.CodeToken=y,r.default=w},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.BubbleTooltip=void 0;var o=function T(_,x,S){_===null&&(_=Function.prototype);var A=Object.getOwnPropertyDescriptor(_,x);if(A===void 0){var k=Object.getPrototypeOf(_);return k===null?void 0:T(k,x,S)}else{if("value"in A)return A.value;var N=A.get;return N===void 0?void 0:N.call(S)}},a=function(){function T(_,x){for(var S=0;S0&&I===m.default.sources.USER){A.show(),A.root.style.left="0px",A.root.style.width="",A.root.style.width=A.root.offsetWidth+"px";var U=A.quill.getLines(N.index,N.length);if(U.length===1)A.position(A.quill.getBounds(N));else{var G=U[U.length-1],re=A.quill.getIndex(G),K=Math.min(G.length()-1,N.index+N.length-re),j=A.quill.getBounds(new f.Range(re,K));A.position(j)}}else document.activeElement!==A.textbox&&A.quill.hasFocus()&&A.hide()}),A}return a(_,[{key:"listen",value:function(){var S=this;o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){S.root.classList.remove("ql-editing")}),this.quill.on(m.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!S.root.classList.contains("ql-hidden")){var A=S.quill.getSelection();A!=null&&S.position(S.quill.getBounds(A))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(S){var A=o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"position",this).call(this,S),k=this.root.querySelector(".ql-tooltip-arrow");if(k.style.marginLeft="",A===0)return A;k.style.marginLeft=-1*A-k.offsetWidth/2+"px"}}]),_}(c.BaseTooltip);P.TEMPLATE=['','
','','',"
"].join(""),r.BubbleTooltip=P,r.default=w},function(n,r,i){n.exports=i(63)}]).default})})(Td);const _r=af(Td.exports),D_={mixins:[pn],props:{title:{type:String,default:null}}},B_={class:"accordion"},F_={class:"accordion__title"},U_=["aria-expanded"],H_=X("svg",{class:"accordion__icon","aria-hidden":"true",focusable:"false",height:"24px",viewBox:"0 0 24 24",width:"24px"},[X("path",{d:"M12,2c-5.52,0 -10,4.48 -10,10c0,5.52 4.48,10 10,10c5.52,0 10,-4.48 10,-10c0,-5.52 -4.48,-10 -10,-10Zm0,18c-4.41,0 -8,-3.59 -8,-8c0,-4.41 3.59,-8 8,-8c4.41,0 8,3.59 8,8c0,4.41 -3.59,8 -8,8Z",fill:"currentColor"}),X("path",{d:"M7,12c0,0.55 0.45,1 1,1l8,0c0.55,0 1,-0.45 1,-1c0,-0.55 -0.45,-1 -1,-1l-8,0c-0.55,0 -1,0.45 -1,1Z",fill:"currentColor"}),X("path",{class:"vert",d:"M12,7c-0.55,0 -1,0.45 -1,1l0,8c0,0.55 0.45,1 1,1c0.55,0 1,-0.45 1,-1l0,-8c0,-0.55 -0.45,-1 -1,-1Z",fill:"currentColor"})],-1);function V_(e,t,n,r,i,o){return se(),fe("div",B_,[X("h2",F_,[X("button",{type:"button","aria-expanded":e.isOpen,onClick:t[0]||(t[0]=(...a)=>e.toggle&&e.toggle(...a))},[Qn(e.$slots,"header",{},()=>[wt(pe(n.title),1)]),H_],8,U_)]),X("div",{class:we(["accordion__content",{hidden:!e.isOpen}])},[Qn(e.$slots,"default")],2)])}const K_=Le(D_,[["render",V_]]);class z_{set(t,n,r=null,i="/",o={SameSite:"Lax"}){const a=Object.assign({[t]:n,expires:r instanceof Date?r.toUTCString():r,path:i},o);document.cookie=Object.entries(a).reduce((s,u)=>s.concat(u.join("=")),[]).join("; ")}get(t,n=null){const r=document.cookie.match(new RegExp("(^| )"+t+"=([^;]+)"));return r&&r[2]?r[2]:n}isset(t){return document.cookie.match(new RegExp("(^| )"+t+"=([^;]+)"))!==null}remove(t){this.set(t,null,"Thu, 01 Jan 1970 00:00:01 GMT")}}const W_={beforeMount(e,t){t.value!==t.oldValue&&(e.oninput=wd(n=>{e.dispatchEvent(new Event("change"))},parseInt(t.value)||300))}};class G_{constructor(){this.dispatcher=document.createElement("dispatcher")}addEventListener(t,n,r={}){this.dispatcher.addEventListener(t,n,r)}removeEventListener(t,n){this.dispatcher.removeEventListener(t,n)}dispatchEvent(t,n={}){this.dispatcher.dispatchEvent(new CustomEvent(t,{detail:n}))}}const Z_={beforeCreate(){const e=new G_;this.$dispatcher={on:(...t)=>e.addEventListener(...t),once:(t,n,r={})=>e.addEventListener(t,n,{once:!0,...r}),off:(...t)=>e.removeEventListener(...t),emit:(...t)=>e.dispatchEvent(...t)}}},J_={mixins:[pn],props:{id:{type:String,required:!0}},mounted(){window.addEventListener("keyup",e=>{this.isOpen&&e.code==="Escape"&&this.close()}),window.addEventListener("click",e=>{this.isOpen&&!this.$el.contains(e.target)&&this.close()})}},Y_={class:"dropdown"},X_=["aria-expanded","aria-controls"],Q_=["id"];function e1(e,t,n,r,i,o){const a=ke("Icon");return se(),fe("div",Y_,[X("button",{type:"button",class:"dropdown__btn","aria-expanded":e.isOpen?"true":"false","aria-controls":n.id,onClick:t[0]||(t[0]=(...s)=>e.toggle&&e.toggle(...s))},[Oe(a,{name:"more-vert"})],8,X_),X("ul",{class:"dropdown__menu",id:n.id},[Qn(e.$slots,"default")],8,Q_)])}const t1=Le(J_,[["render",e1]]),n1={mixins:[pn],props:{class:{type:[String,Array,Object],default:null},style:{type:[String,Array,Object],default:null},modelValue:{type:[String,Number,Array,Object],default:null},label:{type:String,required:!0},name:{type:String,required:!0},error:{type:String,default:null},multiple:{type:Boolean,default:!1},url:{type:String,required:!0},selectResolver:{type:Function,default:(e,t)=>e},value:{type:[String,Number,Array,Object],default:null},formatted_value:{type:[String,Number,Array,Object],default:null}},inheritAttrs:!1,emits:["update:modelValue"],mounted(){this.$dispatcher.once("open",this.fetch),this.formattedValue=this.formatted_value===null?{}:Object.assign({},this.multiple?this.formatted_value:{[this.modelValue]:this.formatted_value})},data(){return{active:-1,processing:!1,response:{data:[]},search:null,formattedValue:null}},methods:{commit(){this.close();const e=this.response.data[this.active].value,t=this.multiple?this.modelValue.concat([e]):[e];this.$emit("update:modelValue",this.selectResolver(this.multiple?t:t[0],JSON.parse(JSON.stringify(this.response.data)))),this.updateFormattedValue(t),this.search=null},select(e){this.highlight(e),this.commit()},highlight(e){this.open(),this.active=e,this.$refs.option&&this.$refs.option[e]&&this.$nextTick(()=>{this.$refs.option[e].scrollIntoView({block:"nearest"})})},highlightNext(){this.isOpen&&this.highlight(this.active+1>=this.response.data.length?0:this.active+1)},highlightPrev(){this.isOpen&&this.highlight(this.active===0?this.response.data.length-1:this.active-1)},clear(){this.search=null,this.$emit("update:modelValue",this.multiple?[]:null)},fetch(){this.processing=!0,this.$http.get(this.url,{params:{search:this.search}}).then(e=>{this.response=e.data}).catch(e=>{}).finally(()=>{this.processing=!1})},selected(e){return this.multiple?this.modelValue.includes(e):e===this.modelValue},remove(e){if(!this.multiple)this.$emit("update:modelValue",null),this.formattedValue={};else{const t=Array.from(this.modelValue);t.splice(t.findIndex(n=>n===e),1),this.updateFormattedValue(t),this.$emit("update:modelValue",t)}},updateFormattedValue(e){this.formattedValue=e.reduce((t,n)=>Object.assign(t,{[n]:this.formattedValue.hasOwnProperty(n)?this.formattedValue[n]:this.response.data.find(r=>r.value===n).formatted_value}),{})}}},r1=["for"],i1=["aria-label"],o1={class:"tag__label"},a1=["onClick"],l1={key:0,class:"field-feedback field-feedback--invalid"},s1={role:"listbox",style:{"z-index":"1000"}},u1=["innerHTML","aria-selected","onMousedown"],f1={key:0,"aria-live":"polite",role:"status",class:"field-feedback field-feedback--invalid"};function c1(e,t,n,r,i,o){const a=ke("Icon"),s=cs("debounce");return se(),fe("div",{class:we(["form-group form-group--autocomplete",n.class]),style:Xe(n.style)},[X("label",{class:"form-label",for:e.$attrs.id},[X("span",null,pe(n.label),1),e.$attrs.required?(se(),fe("span",{key:0,class:"form-label__required-marker","aria-label":e.__("Required")},"*",8,i1)):je("",!0)],8,r1),X("div",{class:we(["form-control tag-control",{"form-control--invalid":n.error!==null}]),onClick:t[7]||(t[7]=Tt((...u)=>e.$refs.input.focus&&e.$refs.input.focus(...u),["self"]))},[(se(!0),fe(Me,null,ot(i.formattedValue,(u,d)=>(se(),fe("span",{class:"tag",key:d},[X("span",o1,pe(u),1),X("button",{type:"button",class:"tag__remove",onClick:m=>o.remove(d)},[Oe(a,{name:"close"})],8,a1)]))),128)),Ye(X("input",dt({ref:"input",type:"text",style:{width:"150px"},autocomplete:"off"},e.$attrs,{"onUpdate:modelValue":t[0]||(t[0]=u=>i.search=u),class:{"form-control--invalid":n.error!==null},onFocus:t[1]||(t[1]=(...u)=>e.open&&e.open(...u)),onBlur:t[2]||(t[2]=(...u)=>e.close&&e.close(...u)),onKeydown:[t[3]||(t[3]=Ar((...u)=>o.highlightPrev&&o.highlightPrev(...u),["up"])),t[4]||(t[4]=Ar((...u)=>o.highlightNext&&o.highlightNext(...u),["down"])),t[5]||(t[5]=Ar(Tt((...u)=>o.commit&&o.commit(...u),["prevent"]),["enter"]))],onChange:t[6]||(t[6]=(...u)=>o.fetch&&o.fetch(...u))}),null,16),[[cn,i.search,void 0,{lazy:!0}],[s,300]])],2),n.error?(se(),fe("span",l1,pe(n.error),1)):je("",!0),Ye(X("ul",s1,[(se(!0),fe(Me,null,ot(i.response.data,(u,d)=>(se(),fe("li",{ref_for:!0,ref:"option",innerHTML:u.formatted_value,tabindex:"-1","aria-selected":d===i.active?"true":"false",class:we({"is-active":d===i.active,"is-selected":o.selected(u.value)}),key:u.value,onMousedown:m=>o.select(d)},null,42,u1))),128)),i.response.data.length===0?(se(),fe("li",f1,pe(e.__("No items found for the given keyword.")),1)):je("",!0)],512),[[qr,e.isOpen]])],6)}const d1=Le(n1,[["render",c1]]),h1={props:{class:{type:[String,Array,Object],default:null},style:{type:[String,Array,Object],default:null},modelValue:{default:null},value:{default:null},formatted_value:{default:null},label:{type:String,required:!0},error:{type:String,default:null},id:{type:String,requried:!0},name:{type:String,requried:!0},options:{type:Array,default:()=>[]},help:{type:String,default:null}},inheritAttrs:!1,emits:["update:modelValue"],computed:{_value:{set(e){this.$emit("update:modelValue",e)},get(){return this.modelValue===null&&this.options.length>0?[]:this.modelValue}}}},p1=["for"],y1=["aria-label"],m1=["name","value"],v1=["innerHTML"],g1={key:0,class:"form-check"},b1=["id","name"],_1={class:"form-check__label"},O1=["innerHTML"];function E1(e,t,n,r,i,o){return se(),fe("div",{class:we(["form-group form-group--vertical-check",n.class]),style:Xe(n.style)},[X("label",{class:"form-label",for:n.id},[X("span",null,pe(n.label),1),e.$attrs.required?(se(),fe("span",{key:0,class:"form-label__required-marker","aria-label":e.__("Required")},"*",8,y1)):je("",!0)],8,p1),(se(!0),fe(Me,null,ot(n.options,a=>(se(),fe("label",{class:"form-check",key:a.value},[Ye(X("input",dt(e.$attrs,{class:"form-check__control","onUpdate:modelValue":t[0]||(t[0]=s=>o._value=s),name:`${n.name}.${a.value}`,value:a.value}),null,16,m1),[[dn,o._value]]),X("span",{class:"form-check__label",innerHTML:a.formatted_value},null,8,v1)]))),128)),n.options.length===0?(se(),fe("label",g1,[Ye(X("input",dt(e.$attrs,{class:"form-check__control","onUpdate:modelValue":t[1]||(t[1]=a=>o._value=a),id:n.id,name:n.name}),null,16,b1),[[dn,o._value]]),X("span",_1,pe(n.label),1)])):je("",!0),n.error!==null||n.help?(se(),fe("span",{key:1,class:we(["field-feedback",{"field-feedback--invalid":n.error!==null}]),innerHTML:n.error||n.help},null,10,O1)):je("",!0)],6)}const w1=Le(h1,[["render",E1]]),S1={props:{class:{type:[String,Array,Object],default:null},style:{type:[String,Array,Object],default:null},modelValue:{type:String,default:null},label:{type:String,default:null},error:{type:String,default:null},with_time:{type:Boolean,default:!1},value:{type:String,default:null},formatted_value:{type:String,default:null},help:{type:String,default:null}},inheritAttrs:!1,emits:["update:modelValue"],data(){return{_value:new Date(this.modelValue)}},computed:{date:{set(e){e=e.split("-"),this._value.setFullYear(e[0]),this._value.setMonth(e[1]-1),this._value.setDate(e[2]),this.$emit("update:modelValue",this._value.toISOString())},get(){return this.modelValue?[this._value.getFullYear(),(this._value.getMonth()+1).toString().padStart(2,0),this._value.getDate().toString().padStart(2,0)].join("-"):null}},time:{set(e){e=e.split(":"),this._value.setHours(e[0]),this._value.setMinutes(e[1]),this._value.setSeconds(e[2]),this.$emit("update:modelValue",this._value.toISOString())},get(){return this.modelValue?[this._value.getHours().toString().padStart(2,0),this._value.getMinutes().toString().padStart(2,0),this._value.getSeconds().toString().padStart(2,0)].join(":"):null}}}},A1=["for"],T1=["aria-label"],k1={class:"form-group-inner--stack"},x1=["disabled"],P1=["innerHTML"];function N1(e,t,n,r,i,o){return se(),fe("div",{class:we(["form-group",n.class]),style:Xe(n.style)},[X("label",{class:"form-label",for:e.$attrs.id},[X("span",null,pe(n.label),1),e.$attrs.required?(se(),fe("span",{key:0,class:"form-label__required-marker","aria-label":e.__("Required")},"*",8,T1)):je("",!0)],8,A1),X("div",k1,[Ye(X("input",dt({class:"form-control"},e.$attrs,{"onUpdate:modelValue":t[0]||(t[0]=a=>o.date=a),class:{"form-control--invalid":n.error!==null}}),null,16),[[dn,o.date]]),n.with_time?Ye((se(),fe("input",{key:0,type:"time",step:"1",class:we(["form-control",{"form-control--invalid":n.error!==null}]),"onUpdate:modelValue":t[1]||(t[1]=a=>o.time=a),disabled:e.$attrs.disabled},null,10,x1)),[[cn,o.time]]):je("",!0)]),n.error!==null||n.help?(se(),fe("span",{key:0,class:we(["field-feedback",{"field-feedback--invalid":n.error!==null}]),innerHTML:n.error||n.help},null,10,P1)):je("",!0)],6)}const R1=Le(S1,[["render",N1]]),L1={},C1={class:"modal-filter"},I1={class:"form-group--inline"},M1={for:"media-search",class:"sr-only"},$1=["placeholder","readonly"],j1={class:"form-group--inline"},q1={for:"media-type",class:"form-group__label is-prepend"},D1={class:"form-group-text"},B1={class:"custom-select"},F1=["disabled"],U1={value:null},H1={value:"file"},V1={value:"image"};function K1(e,t,n,r,i,o){const a=cs("debounce");return se(),fe("div",C1,[X("div",I1,[X("label",M1,pe(e.__("Search")),1),Ye(X("input",{id:"media-search",type:"text",class:"form-control form-control--sm",style:{width:"15rem"},placeholder:e.__("Search"),readonly:e.$parent.processing,"onUpdate:modelValue":t[0]||(t[0]=s=>e.$parent.query.search=s)},null,8,$1),[[cn,e.$parent.query.search,void 0,{lazy:!0}],[a,500]])]),X("div",j1,[X("label",q1,[X("span",D1,pe(e.__("Type")),1)]),X("div",B1,[Ye(X("select",{id:"media-type",class:"form-control form-control--sm",disabled:e.$parent.processing,"onUpdate:modelValue":t[1]||(t[1]=s=>e.$parent.query.type=s)},[X("option",U1,pe(e.__("All")),1),X("option",H1,pe(e.__("File")),1),X("option",V1,pe(e.__("Image")),1)],8,F1),[[Wo,e.$parent.query.type]])])])])}const z1=Le(L1,[["render",K1]]),W1={props:{item:{type:Object,required:!0}},data(){return{tries:0,loading:!1,url:this.item.urls.thumb||this.item.urls.original}},computed:{classNames(){return{"is-image":this.item.is_image,"is-svg":this.item.mime_type.startsWith("image/svg"),"is-document":!this.item.is_image,"is-selected":this.selected,"is-loading":this.loading}},selected(){return this.$parent.selection.some(e=>e.id===this.item.id)}},methods:{toggle(){this.$parent.processing||(this.selected?this.$parent.deselect(this.item):this.$parent.select(this.item))},reload(){if(this.tries>=5)return;this.loading=!0;const e=setInterval(()=>{const t=new URL(this.url);t.searchParams.set("key",new Date().getTime()),this.url=t.toString(),this.tries++,clearInterval(e)},5e3)}}},G1=["src","alt"],Z1={key:1,class:"media-item__caption"};function J1(e,t,n,r,i,o){const a=ke("Icon");return se(),fe("div",{class:we(["media-item",o.classNames]),style:{cursor:"pointer"},onClick:t[2]||(t[2]=Tt((...s)=>o.toggle&&o.toggle(...s),["prevent"]))},[n.item.is_image?(se(),fe("img",{key:0,src:i.url,alt:n.item.name,onError:t[0]||(t[0]=(...s)=>o.reload&&o.reload(...s)),onLoad:t[1]||(t[1]=s=>i.loading=!1)},null,40,G1)):(se(),fe("span",Z1,[Oe(a,{name:"description"}),X("span",null,pe(n.item.file_name),1)]))],2)}const Y1=Le(W1,[["render",J1]]),X1={props:{item:{type:Object,required:!0}},emits:["deselect"],data(){return{tries:0,loading:!1,processing:!1,url:this.item.urls.thumb||this.item.urls.original}},computed:{invalid(){return Object.keys(this.$parent.$parent.$parent.$parent.form.errors).some(e=>e.startsWith(`${this.$parent.$parent.$parent.name}.${this.item.id}.`))},size(){if(this.item.size===0)return"1 KB";const e=["KB","MB","GB","TB"],t=Math.floor(Math.log(this.item.size)/Math.log(1024));return(this.item.size/Math.pow(1024,t)).toFixed(2)*1+" "+e[t]},dimensions(){return this.item.width&&this.item.height?`${this.item.width}×${this.item.height} px`:null}},methods:{deselect(){this.$emit("deselect",this.item)},destroy(){window.confirm(this.__("Are you sure?"))&&(this.processing=!0,this.$http.delete(this.$parent.$parent.url,{data:{models:[this.item.id]}}).then(t=>{this.deselect();const n=this.$parent.$parent.response.data.findIndex(r=>r.id===this.item.id);this.$parent.$parent.response.data.splice(n,1)}).catch(t=>{}).finally(()=>{this.processing=!1}))},reload(){if(this.tries>=5){this.loading=!1;return}this.loading=!0;const e=setInterval(()=>{const t=new URL(this.url);t.searchParams.set("key",new Date().getTime()),this.url=t.toString(),this.tries++,clearInterval(e)},5e3)}}},Q1=["src"],e0={key:1,class:"media-accordion__icon"},t0={class:"accordion__caption"},n0={class:"media-sidebar__list mt-3 mb-3"},r0={key:0},i0=wt(": "),o0=["innerHTML"],a0={class:"form-group-stack"},l0={class:"form-group",style:{display:"flex","justify-content":"space-between"}},s0=["disabled"],u0=["disabled"];function f0(e,t,n,r,i,o){const a=ke("Icon"),s=ke("FormHandler"),u=ke("Accordion");return se(),Et(u,{ref:"accordion",title:n.item.file_name,class:we({"is-invalid":o.invalid})},{header:mt(()=>[n.item.is_image?(se(),fe("div",{key:0,class:we(["media-accordion__image-wrapper",{"is-loading":i.loading}])},[X("img",{src:i.url,class:"media-accordion__image",alt:"",onError:t[0]||(t[0]=(...d)=>o.reload&&o.reload(...d)),onLoad:t[1]||(t[1]=d=>i.loading=!1)},null,40,Q1)],2)):(se(),fe("span",e0,[Oe(a,{name:"description"})])),X("span",t0,pe(n.item.file_name),1)]),default:mt(()=>[X("ul",n0,[X("li",null,[X("strong",null,pe(e.__("Created At")),1),wt(": "+pe(n.item.created_at),1)]),X("li",null,[X("strong",null,pe(e.__("Size")),1),wt(": "+pe(o.size),1)]),o.dimensions?(se(),fe("li",r0,[X("strong",null,pe(e.__("Dimensions")),1),i0,X("span",{innerHTML:o.dimensions},null,8,o0)])):je("",!0)]),X("div",a0,[(se(!0),fe(Me,null,ot(n.item.fields,d=>(se(),Et(s,dt(d,{modelValue:e.$parent.$parent.value[n.item.id][d.name],"onUpdate:modelValue":m=>e.$parent.$parent.value[n.item.id][d.name]=m,form:e.$parent.$parent.$parent.$parent.form,key:`${n.item.id}-${d.name}`,id:`${e.$parent.$parent.$parent.name}.${n.item.id}.${d.name}`,name:`${e.$parent.$parent.$parent.name}.${n.item.id}.${d.name}`,disabled:i.processing}),null,16,["modelValue","onUpdate:modelValue","form","id","name","disabled"]))),128)),X("div",l0,[X("button",{type:"button",class:"btn btn--delete btn--sm btn--tertiary",disabled:i.processing,onClick:t[2]||(t[2]=(...d)=>o.deselect&&o.deselect(...d))},pe(e.__("Remove from Selection")),9,s0),X("button",{type:"button",class:"btn btn--delete btn--sm",disabled:i.processing,onClick:t[3]||(t[3]=(...d)=>o.destroy&&o.destroy(...d))},pe(e.__("Delete")),9,u0)])])]),_:1},8,["title","class"])}const c0=Le(X1,[["render",f0]]),d0={components:{Item:c0},props:{items:{type:Array,required:!0}},methods:{deselect(e){this.items.splice(this.items.findIndex(t=>t.id===e.id),1)}}},h0={class:"media-sidebar"},p0={class:"media-sidebar__section"},y0={class:"media-sidebar__title"},m0={class:"accordion-wrapper"};function v0(e,t,n,r,i,o){const a=ke("Item");return se(),fe("div",h0,[X("div",p0,[X("h3",y0,pe(e.__(":files files selected",{files:n.items.length})),1),X("div",m0,[(se(!0),fe(Me,null,ot(n.items,s=>(se(),Et(a,{key:s.id,item:s,onDeselect:u=>o.deselect(s)},null,8,["item","onDeselect"]))),128))])])])}const g0=Le(d0,[["render",v0]]),b0={},_0={class:"modal-footer"},O0=["disabled"],E0={class:"modal-footer-actions"},w0=["disabled"],S0=["disabled"];function A0(e,t,n,r,i,o){return se(),fe("div",_0,[X("div",null,[X("input",{multiple:"",type:"file",disabled:e.$parent.processing,onChange:t[0]||(t[0]=a=>e.$parent.handleFiles(a.target.files))},null,40,O0)]),X("div",E0,[X("button",{type:"button",class:"btn btn--primary",disabled:e.$parent.processing,onClick:t[1]||(t[1]=(...a)=>e.$parent.updateSelection&&e.$parent.updateSelection(...a))},pe(e.__("Select")),9,w0),X("button",{type:"button",class:"btn btn--tertiary",disabled:e.$parent.processing,onClick:t[2]||(t[2]=(...a)=>e.$parent.close&&e.$parent.close(...a))},pe(e.__("Close")),9,S0)])])}const T0=Le(b0,[["render",A0]]),k0={props:{file:{type:File,required:!0},url:{type:String,required:!0}},beforeMount(){this.generateHash(),this.createChunks()},watch:{chunks:{handler(e,t){e.length>0&&this.upload()},deep:!0}},data(){return{chunks:[],hash:null,error:null,uploaded:0}},computed:{progress(){return Math.floor(this.uploaded*100/this.file.size)},formData(){const e=new FormData;return e.set("is_last",this.chunks.length===1),e.set("file",this.chunks[0],`${this.hash}__${this.file.name}.chunk`),e}},methods:{upload(){this.$http.post(this.url,this.formData,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:e=>{this.uploaded+=e.loaded}}).then(e=>{this.onSuccess(e.data)}).catch(e=>{this.error=this.__("Something went wrong!")})},retry(){this.chunks=[],this.error=null,this.uploaded=0,this.generateHash(),this.createChunks()},onSuccess(e){this.chunks.shift(),this.chunks.length===0&&(this.$parent.response.total++,this.$parent.response.data.unshift(e),this.$parent.queue.splice(this.$parent.queue.indexOf(this.file),1))},generateHash(){this.hash=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)},createChunks(){let e=[];const n=Math.ceil(this.file.size/1048576);for(let r=0;ro.retry&&o.retry(...a))},pe(e.__("Retry")),1)])):(se(),fe("div",{key:0,class:"uploader-item__progress",style:Xe({width:`${o.progress}%`})},null,4))])}const R0=Le(k0,[["render",N0]]),L0={components:{Item:Y1,Filters:z1,Sidebar:g0,Toolbar:T0,Uploader:R0},mixins:[pn],props:{modelValue:{type:[Array,Object],default:()=>[]},multiple:{type:Boolean,default:!1},url:{type:String,required:!0},title:{type:String,default:function(){return this.__("Media")}},selectResolver:{type:Function,default:(e,t)=>e}},inheritAttrs:!1,emits:["update:modelValue"],watch:{isOpen(e,t){document.body.classList.toggle("has-modal-open",e)},query:{handler(e,t){this.fetch()},deep:!0}},mounted(){this.$dispatcher.once("open",this.fetch),window.addEventListener("keyup",e=>{this.isOpen&&e.code==="Escape"&&this.close()}),this.$refs.container.addEventListener("scroll",Sd(e=>{this.shouldPaginate()&&this.paginate()},300))},data(){return{dragging:!1,processing:!1,query:{type:null,search:null},queue:[],response:{data:[],next_page_url:null,prev_page_url:null},selection:[],value:Object.assign({},JSON.parse(JSON.stringify(this.modelValue)))}},methods:{fetch(){this.processing=!0,this.$http.get(this.url,{params:this.query}).then(e=>{this.response=e.data}).catch(e=>{}).finally(()=>{this.processing=!1})},paginate(){this.processing=!0,this.$http.get(this.response.next_page_url).then(e=>{this.response.data.push(...e.data.data),this.response.next_page_url=e.data.next_page_url,this.response.prev_page_url=e.data.prev_page_url}).catch(e=>{}).finally(()=>{this.processing=!1})},handleFiles(e){this.dragging=!1;for(let t=0;t0&&e.scrollHeight-e.scrollTop-e.clientHeight<1},select(e){this.multiple?this.selection.push(e):(this.value={},this.selection=[e]),this.value=Object.assign(this.value,{[e.id]:e.fields.reduce((t,n)=>Object.assign(t,{[n.name]:n.value}),{})})},deselect(e){const t=this.selection.findIndex(n=>n.id===e.id);this.selection.splice(t,1),delete this.value[e.id]},updateSelection(){this.update(),this.close()},update(){this.$emit("update:modelValue",this.selectResolver(this.value,this.selection))},clearSelection(){this.value={},this.selection=[],this.$emit("update:modelValue",this.value)}}},C0=["aria-label"],I0={class:"modal-inner"},M0={class:"modal-header"},$0={class:"modal-title"},j0=["aria-label"],q0=["data-dropzone-text"],D0={ref:"container"},B0={class:"media-item-list__body"},F0={class:"media-item-list__sidebar"},U0={key:1,class:"alert alert--info",role:"alert"};function H0(e,t,n,r,i,o){const a=ke("Icon"),s=ke("Filters"),u=ke("Uploader"),d=ke("Item"),m=ke("Sidebar"),c=ke("Toolbar");return se(),fe("div",{class:we(["modal-backdrop",{"modal-backdrop--visible":e.isOpen}]),onClick:t[6]||(t[6]=Tt((...l)=>e.close&&e.close(...l),["self"]))},[X("div",{role:"dialog","aria-modal":"true",class:we(["modal modal--media",{hidden:!e.isOpen}]),"aria-label":n.title},[X("div",I0,[X("div",M0,[X("h2",$0,pe(n.title),1),X("button",{type:"button",class:"modal-close btn btn--secondary btn--sm btn--icon","aria-label":e.__("Close modal"),onClick:t[0]||(t[0]=(...l)=>e.close&&e.close(...l))},[Oe(a,{name:"close",class:"btn__icon"})],8,j0)]),X("div",{class:we(["modal-body modal-body--media",{"has-active-dropzone":i.dragging}]),"data-dropzone-text":e.__("Drop your files here"),onDragstart:t[1]||(t[1]=Tt(()=>{},["prevent"])),onDragend:t[2]||(t[2]=Tt(l=>i.dragging=!1,["prevent"])),onDragover:t[3]||(t[3]=Tt(l=>i.dragging=!0,["prevent"])),onDragleave:t[4]||(t[4]=Tt(l=>i.dragging=!1,["prevent"])),onDrop:t[5]||(t[5]=Tt(l=>o.handleFiles(l.dataTransfer.files),["prevent"]))},[X("div",D0,[Oe(s),i.queue.length||i.response.data.length?(se(),fe("div",{key:0,class:we(["media-item-list-wrapper",{"is-sidebar-open":i.selection.length>0}])},[X("div",B0,[(se(!0),fe(Me,null,ot(i.queue,(l,f)=>(se(),Et(u,{key:`uploader-${f}`,file:l,url:n.url},null,8,["file","url"]))),128)),(se(!0),fe(Me,null,ot(i.response.data,(l,f)=>(se(),Et(d,{key:`${l.file_name}-${f}`,item:l},null,8,["item"]))),128))]),Ye(X("div",F0,[Oe(m,{items:i.selection},null,8,["items"])],512),[[qr,i.selection.length]])],2)):(se(),fe("div",U0,pe(e.__("No results found.")),1))],512)],42,q0),Oe(c)])],10,C0)],2)}const kd=Le(L0,[["render",H0]]),V0={components:{Media:kd},props:{class:{type:[String,Array,Object],default:null},style:{type:[String,Array,Object],default:null},modelValue:{type:String,default:""},value:{type:String,default:""},formatted_value:{type:String,default:""},with_media:{type:Boolean,default:!1},media_url:{type:String,default:null},label:{type:String,required:!0},error:{type:String,default:null},placeholder:{type:String,default:""},config:{type:Object,requried:!0},help:{type:String,default:""}},inheritAttrs:!1,emits:["update:modelValue"],mounted(){const e=JSON.parse(JSON.stringify(Object.assign({},this.config,{placeholder:this.placeholder})));this.with_media&&(e.modules.toolbar.handlers.image=()=>{this.$refs.media.open()});const t=new _r(this.$refs.input,e);t.root.innerHTML=this.modelValue,t.enable(!this.$attrs.disabled),t.on("text-change",()=>{this.$emit("update:modelValue",t.root.innerHTML==="


"?"":t.root.innerHTML)}),this.selectResolver=(n,r)=>(this.insertMedia(t,r),n)},data(){return{selectResolver:e=>e}},methods:{insertMedia(e,t){const n=e.getSelection(!0);t.forEach(r=>{r.is_image?(e.editor.insertEmbed(n.index,"image",r.urls.original,_r.sources.USER),e.setSelection(n.index+1,0,_r.sources.SILENT)):(e.editor.insertText(n.index,r.name,"link",r.urls.original,_r.sources.USER),e.setSelection(n.index+r.name.length,0,_r.sources.SILENT))}),e.emitter.emit("text-change"),this.$refs.media.clearSelection()}}},K0=["for"],z0=["aria-label"],W0={ref:"input",class:"editor",spellcheck:"false"},G0=["innerHTML"];function Z0(e,t,n,r,i,o){const a=ke("Media");return se(),fe("div",{class:we(["form-group",n.class]),style:Xe(n.style)},[X("label",{class:"form-label",for:e.$attrs.id},[X("span",null,pe(n.label),1),e.$attrs.required?(se(),fe("span",{key:0,class:"form-label__required-marker","aria-label":e.__("Required")},"*",8,z0)):je("",!0)],8,K0),X("div",W0,null,512),n.with_media?(se(),Et(a,{key:0,ref:"media",url:n.media_url,title:e.__("Media"),"select-resolver":i.selectResolver},null,8,["url","title","select-resolver"])):je("",!0),n.error!==null||n.help?(se(),fe("span",{key:1,class:we(["field-feedback",{"field-feedback--invalid":n.error!==null}]),innerHTML:n.error||n.help},null,10,G0)):je("",!0)],6)}const J0=Le(V0,[["render",Z0]]),Y0={props:{modelValue:{type:[String,Number],default:null},label:{type:String,required:!0},error:{type:String,default:null},value:{type:[String,Number],default:null},formatted_value:{type:[String,Number],default:null}},inheritAttrs:!1,emits:["update:modelValue"],computed:{_value:{set(e){this.$emit("update:modelValue",e)},get(){return this.modelValue}}}};function X0(e,t,n,r,i,o){return Ye((se(),fe("input",dt(e.$attrs,{"onUpdate:modelValue":t[0]||(t[0]=a=>o._value=a)}),null,16)),[[dn,o._value]])}const Q0=Le(Y0,[["render",X0]]),eO={props:{class:{type:[String,Array,Object],default:null},style:{type:[String,Array,Object],default:null},modelValue:{type:[String,Number],default:null},label:{type:String,required:!0},error:{type:String,default:null},value:{type:[String,Number],default:null},formatted_value:{type:[String,Number],default:null},help:{type:String,default:null}},inheritAttrs:!1,emits:["update:modelValue"],computed:{_value:{set(e){this.$emit("update:modelValue",e)},get(){return this.modelValue}}}},tO=["for"],nO=["aria-label"],rO=["innerHTML"];function iO(e,t,n,r,i,o){return se(),fe("div",{class:we(["form-group",n.class]),style:Xe(n.style)},[X("label",{class:"form-label",for:e.$attrs.id},[X("span",null,pe(n.label),1),e.$attrs.required?(se(),fe("span",{key:0,class:"form-label__required-marker","aria-label":e.__("Required")},"*",8,nO)):je("",!0)],8,tO),Ye(X("input",dt({class:"form-control"},e.$attrs,{"onUpdate:modelValue":t[0]||(t[0]=a=>o._value=a),class:{"form-control--invalid":n.error!==null}}),null,16),[[dn,o._value]]),n.error!==null||n.help?(se(),fe("span",{key:0,class:we(["field-feedback",{"field-feedback--invalid":n.error!==null}]),innerHTML:n.error||n.help},null,10,rO)):je("",!0)],6)}const oO=Le(eO,[["render",iO]]),aO={props:{class:{type:[String,Array,Object],default:null},style:{type:[String,Array,Object],default:null},modelValue:{type:[Object,Array],default:()=>[]},fields:{type:Array,default:()=>[]},label:{type:String,required:!0},name:{type:String,required:!0}},inheritAttrs:!1},lO={class:"form-group-stack"};function sO(e,t,n,r,i,o){const a=ke("FormHandler");return se(),fe("fieldset",{class:we(["is-json",n.class]),style:Xe(n.style)},[X("legend",null,pe(n.label),1),X("div",lO,[(se(!0),fe(Me,null,ot(n.fields,s=>(se(),Et(a,dt(s,{modelValue:n.modelValue[s.name],"onUpdate:modelValue":u=>n.modelValue[s.name]=u,form:e.$parent.form,key:`${n.name}-${s.name}`,id:`${n.name}.${s.name}`,name:`${n.name}.${s.name}`}),null,16,["modelValue","onUpdate:modelValue","form","id","name"]))),128))])],6)}const uO=Le(aO,[["render",sO]]),fO={components:{Media:kd},props:{class:{type:[String,Array,Object],default:null},style:{type:[String,Array,Object],default:null},modelValue:{type:[Array,Object],default:()=>[]},label:{type:String,required:!0},name:{type:String,required:!0},error:{type:String,default:null},url:{type:String,required:!0},selection:{type:Array,default:()=>[]},multiple:{type:Boolean,default:!1},help:{type:String,default:null}},inheritAttrs:!1,emits:["update:modelValue"],mounted(){this.$refs.media.selection=Array.from(this.items)},data(){return{items:JSON.parse(JSON.stringify(this.selection))}},computed:{invalid(){return Object.keys(this.$parent.form.errors).some(e=>e.startsWith(`${this.name}.`))}},methods:{remove(e){this.$refs.media.deselect(e),this.items=this.$refs.media.selection},selectResolver(e,t){return this.items=t,e},update(e){this.$emit("update:modelValue",e)}}},cO=["for"],dO=["aria-label"],hO=["innerHTML"],pO={class:"selected-media-item-list"},yO=["onClick"],mO=["src","alt"],vO=["title"],gO={style:{"max-width":"100%",overflow:"hidden","text-overflow":"ellipsis","text-align":"center"}};function bO(e,t,n,r,i,o){const a=ke("Media",!0),s=ke("Icon");return se(),fe("div",{class:we(["form-group",n.class]),style:Xe(n.style)},[X("label",{class:"form-label",for:e.$attrs.id},[X("span",null,pe(n.label),1),e.$attrs.required?(se(),fe("span",{key:0,class:"form-label__required-marker","aria-label":e.__("Required")},"*",8,dO)):je("",!0)],8,cO),X("div",null,[X("button",{type:"button",class:we(["btn btn--sm btn--tertiary",{"btn--delete":o.invalid}]),onClick:t[0]||(t[0]=(...u)=>e.$refs.media.open&&e.$refs.media.open(...u))},pe(e.__("Select :label",{label:n.label})),3),Oe(a,{ref:"media",url:n.url,title:n.label,modelValue:n.modelValue,"select-resolver":o.selectResolver,multiple:n.multiple,"onUpdate:modelValue":o.update},null,8,["url","title","modelValue","select-resolver","multiple","onUpdate:modelValue"])]),o.invalid||n.help?(se(),fe("span",{key:0,class:we(["field-feedback",{"field-feedback--invalid":o.invalid}]),innerHTML:o.invalid?e.__("The given pivot data is invalid!"):n.help},null,10,hO)):je("",!0),X("div",pO,[(se(!0),fe(Me,null,ot(i.items,u=>(se(),fe("div",{class:"selected-media-item",key:u.id},[X("button",{type:"button",class:"selected-media-item__remove",onClick:d=>o.remove(u)},[Oe(s,{name:"close"})],8,yO),u.is_image?(se(),fe("img",{key:0,src:u.urls.thumb||u.urls.original,alt:u.file_name},null,8,mO)):(se(),fe("span",{key:1,class:"selected-media-item__document",title:u.file_name},[Oe(s,{name:"description"}),X("span",gO,pe(u.file_name),1)],8,vO))]))),128))])],6)}const _O=Le(fO,[["render",bO]]),OO={props:{class:{type:[String,Array,Object],default:null},style:{type:[String,Array,Object],default:null},modelValue:{default:null},value:{default:null},formatted_value:{default:null},label:{type:String,required:!0},error:{type:String,default:null},id:{type:String,requried:!0},options:{type:Array,default:()=>[]},help:{type:String,default:null}},inheritAttrs:!1,emits:["update:modelValue"],computed:{_value:{set(e){this.$emit("update:modelValue",e)},get(){return this.modelValue}}}},EO=["for"],wO=["aria-label"],SO=["value"],AO=["innerHTML"];function TO(e,t,n,r,i,o){return se(),fe("div",{class:we(["form-group form-group--vertical-check",n.class]),style:Xe(n.style)},[X("label",{class:"form-label",for:n.id},[X("span",null,pe(n.label),1),e.$attrs.required?(se(),fe("span",{key:0,class:"form-label__required-marker","aria-label":e.__("Required")},"*",8,wO)):je("",!0)],8,EO),(se(!0),fe(Me,null,ot(n.options,a=>(se(),fe("label",{class:"form-check",key:a.value},[Ye(X("input",dt(e.$attrs,{class:"form-check__control","onUpdate:modelValue":t[0]||(t[0]=s=>o._value=s),value:a.value}),null,16,SO),[[dn,o._value]]),n.error!==null||n.help?(se(),fe("span",{key:0,class:we(["field-feedback",{"field-feedback--invalid":n.error!==null}]),innerHTML:n.error||n.help},null,10,AO)):je("",!0)]))),128))],6)}const kO=Le(OO,[["render",TO]]),xO={props:{class:{type:[String,Array,Object],default:null},style:{type:[String,Array,Object],default:null},modelValue:{type:[String,Number],default:null},value:{type:[String,Number],default:null},formatted_value:{type:[String,Number],default:null},label:{type:String,required:!0},error:{type:String,default:null},help:{type:String,default:null}},inheritAttrs:!1,emits:["update:modelValue"],computed:{_value:{set(e){this.$emit("update:modelValue",e)},get(){return this.modelValue}}}},PO=["for"],NO=["aria-label"],RO={class:"form-range-display"},LO={class:"form-range-display__item is-min"},CO={class:"form-range-display__item is-current"},IO={class:"form-range-display__item is-max"},MO=["innerHTML"];function $O(e,t,n,r,i,o){return se(),fe("div",{class:we(["form-group form-group--range",n.class]),style:Xe(n.style)},[X("label",{class:"form-label",for:e.$attrs.id},[X("span",null,pe(n.label),1),e.$attrs.required?(se(),fe("span",{key:0,class:"form-label__required-marker","aria-label":e.__("Required")},"*",8,NO)):je("",!0)],8,PO),Ye(X("input",dt({ref:"input",class:"form-range"},e.$attrs,{"onUpdate:modelValue":t[0]||(t[0]=a=>o._value=a),class:{"form-control--invalid":n.error!==null}}),null,16),[[dn,o._value]]),X("div",RO,[X("span",LO,pe(e.$attrs.min),1),X("span",CO,pe(o._value||"-"),1),X("span",IO,pe(e.$attrs.max),1)]),n.error!==null||n.help?(se(),fe("span",{key:0,class:we(["field-feedback",{"field-feedback--invalid":n.error!==null}]),innerHTML:n.error||n.help},null,10,MO)):je("",!0)],6)}const jO=Le(xO,[["render",$O]]),qO={props:{class:{type:[String,Array,Object],default:null},style:{type:[String,Array,Object],default:null},modelValue:{type:[String,Number,Array,Object],default:null},value:{type:[String,Number,Array,Object],default:null},formatted_value:{type:[String,Number,Array,Object],default:null},label:{type:String,required:!0},error:{type:String,default:null},help:{type:String,default:null},options:{type:Object,required:!0},nullable:{type:Boolean,default:!1},selectResolver:{type:Function,default:(e,t)=>e}},inheritAttrs:!1,emits:["update:modelValue"],computed:{_value:{set(e){this.$emit("update:modelValue",this.selectResolver(e,this.options))},get(){return JSON.parse(JSON.stringify(this.modelValue))}}}},DO=["for"],BO=["aria-label"],FO=["disabled"],UO=["value"],HO=["innerHTML"];function VO(e,t,n,r,i,o){return se(),fe("div",{class:we(["form-group",n.class]),style:Xe(n.style)},[X("label",{class:"form-label",for:e.$attrs.id},[X("span",null,pe(n.label),1),e.$attrs.required?(se(),fe("span",{key:0,class:"form-label__required-marker","aria-label":e.__("Required")},"*",8,BO)):je("",!0)],8,DO),Ye(X("select",dt({class:"form-control"},e.$attrs,{"onUpdate:modelValue":t[0]||(t[0]=a=>o._value=a),class:{"form-control--invalid":n.error!==null}}),[X("option",{disabled:!n.nullable||e.$attrs.multiple,value:null,selected:""},pe(e.__("Select :label",{label:n.label})),9,FO),(se(!0),fe(Me,null,ot(n.options,a=>(se(),fe("option",{value:a.value,key:a.value},pe(a.formatted_value),9,UO))),128))],16),[[Wo,o._value]]),n.error!==null||n.help?(se(),fe("span",{key:0,class:we(["field-feedback",{"field-feedback--invalid":n.error!==null}]),innerHTML:n.error||n.help},null,10,HO)):je("",!0)],6)}const KO=Le(qO,[["render",VO]]),zO={components:{Link:Ii},props:{class:{type:[String,Array,Object],default:null},style:{type:[String,Array,Object],default:null},modelValue:{type:[Array,Object],default:null},value:{type:[Array,Object],default:null},formatted_value:{type:[Array,Object,String],default:null},label:{type:String,required:!0},name:{type:String,required:!0},url:{type:String,required:!0}}},WO=["for"];function GO(e,t,n,r,i,o){const a=ke("Link");return se(),fe("div",{class:we(["form-group",n.class]),style:Xe(n.style)},[X("label",{class:"form-label",for:e.$attrs.id},[X("span",null,pe(n.label),1)],8,WO),X("div",null,[Oe(a,{class:"btn btn--sm btn--tertiary",href:n.url},{default:mt(()=>[wt(pe(n.label),1)]),_:1},8,["href"])])],6)}const ZO=Le(zO,[["render",GO]]),JO={props:{class:{type:[String,Array,Object],default:null},style:{type:[String,Array,Object],default:null},modelValue:{type:Array,default:()=>[]},label:{type:String,required:!0},name:{type:String,required:!0},error:{type:String,default:null},value:{type:Array,default:()=>[]},formatted_value:{type:String,default:null},help:{type:String,default:null}},inheritAttrs:!1,emits:["update:modelValue"],data(){return{tag:null}},methods:{add(){const e=Array.from(this.modelValue||[]);this.tag&&!e.includes(this.tag)&&(e.push(this.tag),this.$emit("update:modelValue",e),this.tag=null)},remove(e){const t=Array.from(this.modelValue||[]);t.splice(e,1),this.$emit("update:modelValue",t)},removeLast(){Array.isArray(this.modelValue)&&!this.tag&&this.remove(this.modelValue.length-1)}}},YO=["for"],XO=["aria-label"],QO={class:"tag__label"},eE=["onClick"],tE=["innerHTML"];function nE(e,t,n,r,i,o){const a=ke("Icon");return se(),fe("div",{class:we(["form-group",n.class]),style:Xe(n.style)},[X("label",{class:"form-label",for:e.$attrs.id},[X("span",null,pe(n.label),1),e.$attrs.required?(se(),fe("span",{key:0,class:"form-label__required-marker","aria-label":e.__("Required")},"*",8,XO)):je("",!0)],8,YO),X("div",{class:we(["form-control tag-control",{"form-control--invalid":n.error!==null}]),onClick:t[4]||(t[4]=Tt((...s)=>e.$refs.input.focus&&e.$refs.input.focus(...s),["self"]))},[(se(!0),fe(Me,null,ot(n.modelValue,(s,u)=>(se(),fe("span",{class:"tag",key:u},[X("span",QO,pe(s),1),X("button",{type:"button",class:"tag__remove",onClick:d=>o.remove(u)},[Oe(a,{name:"close"})],8,eE)]))),128)),Ye(X("input",dt({ref:"input",type:"text",style:{width:"150px"}},e.$attrs,{"onUpdate:modelValue":t[0]||(t[0]=s=>i.tag=s),onBlur:t[1]||(t[1]=(...s)=>o.add&&o.add(...s)),onKeydown:[t[2]||(t[2]=Ar(Tt((...s)=>o.add&&o.add(...s),["prevent"]),["enter"])),t[3]||(t[3]=Ar((...s)=>o.removeLast&&o.removeLast(...s),["backspace"]))]}),null,16),[[cn,i.tag]])],2),n.error!==null||n.help?(se(),fe("span",{key:0,class:we(["field-feedback",{"field-feedback--invalid":n.error!==null}]),innerHTML:n.error||n.help},null,10,tE)):je("",!0)],6)}const rE=Le(JO,[["render",nE]]),iE={props:{class:{type:[String,Array,Object],default:null},style:{type:[String,Array,Object],default:null},modelValue:{type:[String,Number],default:null},formatted_value:{type:[String,Number],default:null},label:{type:String,required:!0},error:{type:String,default:null},help:{type:String,default:null}},inheritAttrs:!1,emits:["update:modelValue"],computed:{_value:{set(e){this.$emit("update:modelValue",e)},get(){return this.modelValue}}}},oE=["for"],aE=["aria-label"],lE=["innerHTML"];function sE(e,t,n,r,i,o){return se(),fe("div",{class:we(["form-group",n.class]),style:Xe(n.style)},[X("label",{class:"form-label",for:e.$attrs.id},[X("span",null,pe(n.label),1),e.$attrs.required?(se(),fe("span",{key:0,class:"form-label__required-marker","aria-label":e.__("Required")},"*",8,aE)):je("",!0)],8,oE),Ye(X("textarea",dt({class:"form-control"},e.$attrs,{"onUpdate:modelValue":t[0]||(t[0]=a=>o._value=a),class:{"form-control--invalid":n.error!==null}}),null,16),[[cn,o._value]]),n.error!==null||n.help?(se(),fe("span",{key:0,class:we(["field-feedback",{"field-feedback--invalid":n.error!==null}]),innerHTML:n.error||n.help},null,10,lE)):je("",!0)],6)}const uE=Le(iE,[["render",sE]]),fE={name:"FormHandler",components:{AsyncSelect:d1,Checkbox:w1,DateTime:R1,Editor:J0,Hidden:Q0,Input:oO,Json:uO,Media:_O,Radio:kO,Range:jO,Select:KO,SubResource:ZO,Tag:rE,Textarea:uE},props:{modelValue:{default:null},name:{type:String,required:!0},component:{type:String,default:"Input"},form:{type:Object,required:!0},componentResolver:{type:Function,default:e=>ke(e)},debounce:{type:Number,default:0}},inheritAttrs:!1,emits:["update:modelValue"],render(){return Ri(this.componentResolver(this.component),{...this.$attrs,name:this.name,modelValue:this.modelValue,error:this.form.errors[this.name],readonly:this.form.processing||![void 0,"false",!1].includes(this.$attrs.readonly),required:![void 0,"false",!1].includes(this.$attrs.required),"onUpdate:modelValue":wd(e=>{this.$emit("update:modelValue",e),this.form.clearErrors(this.name)},this.debounce||0)},this.$slots)}},cE={props:{name:{type:String,required:!0}}},dE={class:"icon","aria-hidden":"true",focusable:"false",role:"img",fill:"currentColor",viewBox:"0 0 24 24",width:"24",height:"24"},hE=["xlink:href"];function pE(e,t,n,r,i,o){return se(),fe("svg",dE,[X("use",{"xlink:href":`#icon-${n.name}`},null,8,hE)])}const yE=Le(cE,[["render",pE]]),mE={mixins:[pn],props:{title:{type:String,required:!0}},watch:{isOpen(e,t){document.body.classList.toggle("has-modal-open",e)}}},vE=["aria-label"],gE={class:"modal-header"},bE={class:"modal-title"},_E={class:"modal-body"},OE={class:"modal-action"};function EE(e,t,n,r,i,o){return se(),fe("div",{class:we(["modal-backdrop",{"modal-backdrop--visible":e.isOpen}]),onClick:t[1]||(t[1]=Tt((...a)=>e.close&&e.close(...a),["self"]))},[X("div",{role:"dialog","aria-modal":"true",class:we(["modal",{hidden:!e.isOpen}]),"aria-label":n.title},[X("div",gE,[X("h2",bE,pe(n.title),1)]),X("div",_E,[Qn(e.$slots,"default")]),X("div",OE,[Qn(e.$slots,"footer"),X("button",{type:"button",class:"btn btn--secondary",onClick:t[0]||(t[0]=(...a)=>e.close&&e.close(...a))},pe(e.__("Close")),1)])],10,vE)],2)}const wE=Le(mE,[["render",EE]]);class SE{constructor(t){this.translations=t}__(t,n={}){t=this.translations[t]||t;for(let r in n)t=t.toString().replace(`:${r}`,n[r]).replace(`:${r.toUpperCase()}`,n[r].toString().toUpperCase()).replace(`:${r.charAt(0).toUpperCase()}${r.slice(1)}`,n[r].toString().charAt(0).toUpperCase()+n[r].toString().slice(1));return t.toString().trim()}}const AE={props:{template:{type:String,default:null},async:{type:Boolean,default:!1},url:{type:String,default:null}},inheritAttrs:!1,mounted(){this.async&&this.fetch()},data(){return{content:this.template}},methods:{fetch(){this.$http.get(this.url).then(e=>{this.content=e.data})}}},TE=["innerHTML"];function kE(e,t,n,r,i,o){return se(),fe("div",{innerHTML:i.content},null,8,TE)}const xE=Le(AE,[["render",kE]]),PE={name:"WidgetHandler",components:{Widget:xE},props:{component:{type:String,default:"Widget"}},inheritAttrs:!1,render(){return Ri(ke(this.component),this.$attrs,this.$slots)}},NE={install(e,t={}){e.mixin(Z_),e.component("Accordion",K_),e.component("Dropdown",t1),e.component("FormHandler",fE),e.component("Icon",yE),e.component("Modal",wE),e.component("WidgetHandler",PE),e.directive("debounce",W_),e.config.globalProperties.$app=t,e.config.globalProperties.$cookie=new z_;const n=new SE(t.translations||{});e.config.globalProperties.__=(r,i={})=>n.__(r,i),e.config.globalProperties.$http=lv.create({headers:{Accept:"application/json","Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}})}};window.Vue=Uc;window.Quill=_r;_d({resolve:e=>_b(`./Pages/${e}.vue`,Object.assign({"./Pages/Dashboard.vue":()=>nn(()=>import("./Dashboard.62d23070.js"),[]),"./Pages/Error.vue":()=>nn(()=>import("./Error.fadf721f.js"),[]),"./Pages/Extracts/Index.vue":()=>nn(()=>import("./Index.f789e89b.js"),["assets/Index.f789e89b.js","assets/Table.65514b14.js","assets/Actions.11134f97.js"]),"./Pages/Relations/Form.vue":()=>nn(()=>import("./Form.50517212.js"),["assets/Form.50517212.js","assets/Form.613d7faf.js"]),"./Pages/Relations/Index.vue":()=>nn(()=>import("./Index.1735a2c5.js"),["assets/Index.1735a2c5.js","assets/Table.65514b14.js","assets/Actions.11134f97.js"]),"./Pages/Relations/Show.vue":()=>nn(()=>import("./Show.3bdc90f3.js"),[]),"./Pages/Resources/Form.vue":()=>nn(()=>import("./Form.fd558b22.js"),["assets/Form.fd558b22.js","assets/Form.613d7faf.js"]),"./Pages/Resources/Index.vue":()=>nn(()=>import("./Index.716ca1a5.js"),["assets/Index.716ca1a5.js","assets/Table.65514b14.js","assets/Actions.11134f97.js"]),"./Pages/Resources/Show.vue":()=>nn(()=>import("./Show.55e23a01.js"),["assets/Show.55e23a01.js","assets/Actions.11134f97.js"])})).catch(()=>new Promise((t,n)=>{t(ke(e))})).then(t=>(t.default.resolveDefaultLayout=()=>q_,t)),setup({el:e,App:t,props:n,plugin:r}){const i=Bc({render:()=>Ri(t,n)});i.use(r),i.use(NE,window.Root),document.dispatchEvent(new CustomEvent("root:booting",{detail:{app:i}}));const o=i.mount(e);document.dispatchEvent(new CustomEvent("root:booted",{detail:{app:i,instance:o}}))}});export{pn as C,Me as F,Ii as L,PE as W,Le as _,ot as a,Et as b,fe as c,X as d,je as e,Oe as f,Ye as g,wt as h,vs as i,mt as j,Wo as k,Qn as l,dt as m,we as n,se as o,ke as r,pe as t,qr as v,Tt as w}; +`)}return Z}function ae(V,Z){var Y={},te=V.style||{};return te.fontStyle&&J(V).fontStyle==="italic"&&(Y.italic=!0),te.fontWeight&&(J(V).fontWeight.startsWith("bold")||parseInt(J(V).fontWeight)>=700)&&(Y.bold=!0),Object.keys(Y).length>0&&(Z=D(Z,Y)),parseFloat(te.textIndent||0)>0&&(Z=new c.default().insert(" ").concat(Z)),Z}function ie(V,Z){var Y=V.data;if(V.parentNode.tagName==="O:P")return Z.insert(Y.trim());if(Y.trim().length===0&&V.parentNode.classList.contains("ql-clipboard"))return Z;if(!J(V.parentNode).whiteSpace.startsWith("pre")){var te=function(de,ue){return ue=ue.replace(/[^\u00a0]/g,""),ue.length<1&&de?" ":ue};Y=Y.replace(/\r\n/g," ").replace(/\n/g," "),Y=Y.replace(/\s\s+/g,te.bind(te,!0)),(V.previousSibling==null&&M(V.parentNode)||V.previousSibling!=null&&M(V.previousSibling))&&(Y=Y.replace(/^\s+/,te.bind(te,!1))),(V.nextSibling==null&&M(V.parentNode)||V.nextSibling!=null&&M(V.nextSibling))&&(Y=Y.replace(/\s+$/,te.bind(te,!1)))}return Z.insert(Y)}r.default=q,r.matchAttributor=ne,r.matchBlot=le,r.matchNewline=B,r.matchSpacing=ee,r.matchText=ie},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function b(g,v){for(var p=0;p '},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function b(g,v){for(var p=0;pf.right&&(g=f.right-b.right,this.root.style.left=c+g+"px"),b.leftf.bottom){var v=b.bottom-b.top,p=m.bottom-m.top+v;this.root.style.top=l-p+"px",this.root.classList.add("ql-flip")}return g}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),u}();r.default=s},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function S(A,k){var N=[],R=!0,I=!1,U=void 0;try{for(var G=A[Symbol.iterator](),re;!(R=(re=G.next()).done)&&(N.push(re.value),!(k&&N.length===k));R=!0);}catch(K){I=!0,U=K}finally{try{!R&&G.return&&G.return()}finally{if(I)throw U}}return N}return function(A,k){if(Array.isArray(A))return A;if(Symbol.iterator in Object(A))return S(A,k);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function S(A,k,N){A===null&&(A=Function.prototype);var R=Object.getOwnPropertyDescriptor(A,k);if(R===void 0){var I=Object.getPrototypeOf(A);return I===null?void 0:S(I,k,N)}else{if("value"in R)return R.value;var U=R.get;return U===void 0?void 0:U.call(N)}},s=function(){function S(A,k){for(var N=0;N','','',''].join(""),r.default=_},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=i(29),a=W(o),s=i(36),u=i(38),d=i(64),m=i(65),c=W(m),l=i(66),f=W(l),b=i(67),g=W(b),v=i(37),p=i(26),h=i(39),O=i(40),y=i(56),w=W(y),P=i(68),T=W(P),_=i(27),x=W(_),S=i(69),A=W(S),k=i(70),N=W(k),R=i(71),I=W(R),U=i(72),G=W(U),re=i(73),K=W(re),j=i(13),L=W(j),q=i(74),D=W(q),J=i(75),z=W(J),M=i(57),H=W(M),Q=i(41),ne=W(Q),le=i(28),he=W(le),be=i(59),$=W(be),B=i(60),ee=W(B),ae=i(61),ie=W(ae),V=i(108),Z=W(V),Y=i(62),te=W(Y);function W(de){return de&&de.__esModule?de:{default:de}}a.default.register({"attributors/attribute/direction":u.DirectionAttribute,"attributors/class/align":s.AlignClass,"attributors/class/background":v.BackgroundClass,"attributors/class/color":p.ColorClass,"attributors/class/direction":u.DirectionClass,"attributors/class/font":h.FontClass,"attributors/class/size":O.SizeClass,"attributors/style/align":s.AlignStyle,"attributors/style/background":v.BackgroundStyle,"attributors/style/color":p.ColorStyle,"attributors/style/direction":u.DirectionStyle,"attributors/style/font":h.FontStyle,"attributors/style/size":O.SizeStyle},!0),a.default.register({"formats/align":s.AlignClass,"formats/direction":u.DirectionClass,"formats/indent":d.IndentClass,"formats/background":v.BackgroundStyle,"formats/color":p.ColorStyle,"formats/font":h.FontClass,"formats/size":O.SizeClass,"formats/blockquote":c.default,"formats/code-block":L.default,"formats/header":f.default,"formats/list":g.default,"formats/bold":w.default,"formats/code":j.Code,"formats/italic":T.default,"formats/link":x.default,"formats/script":A.default,"formats/strike":N.default,"formats/underline":I.default,"formats/image":G.default,"formats/video":K.default,"formats/list/item":b.ListItem,"modules/formula":D.default,"modules/syntax":z.default,"modules/toolbar":H.default,"themes/bubble":Z.default,"themes/snow":te.default,"ui/icons":ne.default,"ui/picker":he.default,"ui/icon-picker":ee.default,"ui/color-picker":$.default,"ui/tooltip":ie.default},!0),r.default=a.default},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.IndentClass=void 0;var o=function(){function g(v,p){for(var h=0;h0&&this.children.tail.format(T,_)}},{key:"formats",value:function(){return b({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(T,_){if(T instanceof h)a(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"insertBefore",this).call(this,T,_);else{var x=_==null?this.length():_.offset(this),S=this.split(x);S.parent.insertBefore(T,S)}}},{key:"optimize",value:function(T){a(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"optimize",this).call(this,T);var _=this.next;_!=null&&_.prev===this&&_.statics.blotName===this.statics.blotName&&_.domNode.tagName===this.domNode.tagName&&_.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(_.moveChildren(this),_.remove())}},{key:"replace",value:function(T){if(T.statics.blotName!==this.statics.blotName){var _=u.default.create(this.statics.defaultChild);T.moveChildren(_),this.appendChild(_)}a(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"replace",this).call(this,T)}}]),w}(l.default);O.blotName="list",O.scope=u.default.Scope.BLOCK_BLOT,O.tagName=["OL","UL"],O.defaultChild="list-item",O.allowedChildren=[h],r.ListItem=h,r.default=O},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=i(56),a=s(o);function s(l){return l&&l.__esModule?l:{default:l}}function u(l,f){if(!(l instanceof f))throw new TypeError("Cannot call a class as a function")}function d(l,f){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:l}function m(l,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);l.prototype=Object.create(f&&f.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(l,f):l.__proto__=f)}var c=function(l){m(f,l);function f(){return u(this,f),d(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(a.default);c.blotName="italic",c.tagName=["EM","I"],r.default=c},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function b(g,v){for(var p=0;p-1?y?this.domNode.setAttribute(O,y):this.domNode.removeAttribute(O):a(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"format",this).call(this,O,y)}}],[{key:"create",value:function(O){var y=a(p.__proto__||Object.getPrototypeOf(p),"create",this).call(this,O);return typeof O=="string"&&y.setAttribute("src",this.sanitize(O)),y}},{key:"formats",value:function(O){return b.reduce(function(y,w){return O.hasAttribute(w)&&(y[w]=O.getAttribute(w)),y},{})}},{key:"match",value:function(O){return/\.(jpe?g|gif|png)$/.test(O)||/^data:image\/.+;base64/.test(O)}},{key:"sanitize",value:function(O){return(0,d.sanitize)(O,["http","https","data"])?O:"//:0"}},{key:"value",value:function(O){return O.getAttribute("src")}}]),p}(u.default.Embed);g.blotName="image",g.tagName="IMG",r.default=g},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function v(p,h){for(var O=0;O-1?y?this.domNode.setAttribute(O,y):this.domNode.removeAttribute(O):a(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"format",this).call(this,O,y)}}],[{key:"create",value:function(O){var y=a(p.__proto__||Object.getPrototypeOf(p),"create",this).call(this,O);return y.setAttribute("frameborder","0"),y.setAttribute("allowfullscreen",!0),y.setAttribute("src",this.sanitize(O)),y}},{key:"formats",value:function(O){return b.reduce(function(y,w){return O.hasAttribute(w)&&(y[w]=O.getAttribute(w)),y},{})}},{key:"sanitize",value:function(O){return d.default.sanitize(O)}},{key:"value",value:function(O){return O.getAttribute("src")}}]),p}(s.BlockEmbed);g.blotName="video",g.className="ql-video",g.tagName="IFRAME",r.default=g},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.FormulaBlot=void 0;var o=function(){function O(y,w){for(var P=0;P0||this.cachedText==null)&&(this.domNode.innerHTML=x(S),this.domNode.normalize(),this.attach()),this.cachedText=S)}}]),T}(b.default);O.className="ql-syntax";var y=new u.default.Attributor.Class("token","hljs",{scope:u.default.Scope.INLINE}),w=function(P){h(T,P),o(T,null,[{key:"register",value:function(){m.default.register(y,!0),m.default.register(O,!0)}}]);function T(_,x){v(this,T);var S=p(this,(T.__proto__||Object.getPrototypeOf(T)).call(this,_,x));if(typeof S.options.highlight!="function")throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var A=null;return S.quill.on(m.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(A),A=setTimeout(function(){S.highlight(),A=null},S.options.interval)}),S.highlight(),S}return o(T,[{key:"highlight",value:function(){var x=this;if(!this.quill.selection.composing){this.quill.update(m.default.sources.USER);var S=this.quill.getSelection();this.quill.scroll.descendants(O).forEach(function(A){A.highlight(x.options.highlight)}),this.quill.update(m.default.sources.SILENT),S!=null&&this.quill.setSelection(S,m.default.sources.SILENT)}}}]),T}(l.default);w.DEFAULTS={highlight:function(){return window.hljs==null?null:function(P){var T=window.hljs.highlightAuto(P);return T.value}}(),interval:1e3},r.CodeBlock=O,r.CodeToken=y,r.default=w},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r){n.exports=' '},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.BubbleTooltip=void 0;var o=function T(_,x,S){_===null&&(_=Function.prototype);var A=Object.getOwnPropertyDescriptor(_,x);if(A===void 0){var k=Object.getPrototypeOf(_);return k===null?void 0:T(k,x,S)}else{if("value"in A)return A.value;var N=A.get;return N===void 0?void 0:N.call(S)}},a=function(){function T(_,x){for(var S=0;S0&&I===m.default.sources.USER){A.show(),A.root.style.left="0px",A.root.style.width="",A.root.style.width=A.root.offsetWidth+"px";var U=A.quill.getLines(N.index,N.length);if(U.length===1)A.position(A.quill.getBounds(N));else{var G=U[U.length-1],re=A.quill.getIndex(G),K=Math.min(G.length()-1,N.index+N.length-re),j=A.quill.getBounds(new f.Range(re,K));A.position(j)}}else document.activeElement!==A.textbox&&A.quill.hasFocus()&&A.hide()}),A}return a(_,[{key:"listen",value:function(){var S=this;o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){S.root.classList.remove("ql-editing")}),this.quill.on(m.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!S.root.classList.contains("ql-hidden")){var A=S.quill.getSelection();A!=null&&S.position(S.quill.getBounds(A))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(S){var A=o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"position",this).call(this,S),k=this.root.querySelector(".ql-tooltip-arrow");if(k.style.marginLeft="",A===0)return A;k.style.marginLeft=-1*A-k.offsetWidth/2+"px"}}]),_}(c.BaseTooltip);P.TEMPLATE=['','
','','',"
"].join(""),r.BubbleTooltip=P,r.default=w},function(n,r,i){n.exports=i(63)}]).default})})(Td);const _r=af(Td.exports),D_={mixins:[pn],props:{title:{type:String,default:null}}},B_={class:"accordion"},F_={class:"accordion__title"},U_=["aria-expanded"],H_=X("svg",{class:"accordion__icon","aria-hidden":"true",focusable:"false",height:"24px",viewBox:"0 0 24 24",width:"24px"},[X("path",{d:"M12,2c-5.52,0 -10,4.48 -10,10c0,5.52 4.48,10 10,10c5.52,0 10,-4.48 10,-10c0,-5.52 -4.48,-10 -10,-10Zm0,18c-4.41,0 -8,-3.59 -8,-8c0,-4.41 3.59,-8 8,-8c4.41,0 8,3.59 8,8c0,4.41 -3.59,8 -8,8Z",fill:"currentColor"}),X("path",{d:"M7,12c0,0.55 0.45,1 1,1l8,0c0.55,0 1,-0.45 1,-1c0,-0.55 -0.45,-1 -1,-1l-8,0c-0.55,0 -1,0.45 -1,1Z",fill:"currentColor"}),X("path",{class:"vert",d:"M12,7c-0.55,0 -1,0.45 -1,1l0,8c0,0.55 0.45,1 1,1c0.55,0 1,-0.45 1,-1l0,-8c0,-0.55 -0.45,-1 -1,-1Z",fill:"currentColor"})],-1);function V_(e,t,n,r,i,o){return se(),fe("div",B_,[X("h2",F_,[X("button",{type:"button","aria-expanded":e.isOpen,onClick:t[0]||(t[0]=(...a)=>e.toggle&&e.toggle(...a))},[Qn(e.$slots,"header",{},()=>[wt(pe(n.title),1)]),H_],8,U_)]),X("div",{class:we(["accordion__content",{hidden:!e.isOpen}])},[Qn(e.$slots,"default")],2)])}const K_=Le(D_,[["render",V_]]);class z_{set(t,n,r=null,i="/",o={SameSite:"Lax"}){const a=Object.assign({[t]:n,expires:r instanceof Date?r.toUTCString():r,path:i},o);document.cookie=Object.entries(a).reduce((s,u)=>s.concat(u.join("=")),[]).join("; ")}get(t,n=null){const r=document.cookie.match(new RegExp("(^| )"+t+"=([^;]+)"));return r&&r[2]?r[2]:n}isset(t){return document.cookie.match(new RegExp("(^| )"+t+"=([^;]+)"))!==null}remove(t){this.set(t,null,"Thu, 01 Jan 1970 00:00:01 GMT")}}const W_={beforeMount(e,t){t.value!==t.oldValue&&(e.oninput=wd(n=>{e.dispatchEvent(new Event("change"))},parseInt(t.value)||300))}};class G_{constructor(){this.dispatcher=document.createElement("dispatcher")}addEventListener(t,n,r={}){this.dispatcher.addEventListener(t,n,r)}removeEventListener(t,n){this.dispatcher.removeEventListener(t,n)}dispatchEvent(t,n={}){this.dispatcher.dispatchEvent(new CustomEvent(t,{detail:n}))}}const Z_={beforeCreate(){const e=new G_;this.$dispatcher={on:(...t)=>e.addEventListener(...t),once:(t,n,r={})=>e.addEventListener(t,n,{once:!0,...r}),off:(...t)=>e.removeEventListener(...t),emit:(...t)=>e.dispatchEvent(...t)}}},J_={mixins:[pn],props:{id:{type:String,required:!0}},mounted(){window.addEventListener("keyup",e=>{this.isOpen&&e.code==="Escape"&&this.close()}),window.addEventListener("click",e=>{this.isOpen&&!this.$el.contains(e.target)&&this.close()})}},Y_={class:"dropdown"},X_=["aria-expanded","aria-controls"],Q_=["id"];function e1(e,t,n,r,i,o){const a=ke("Icon");return se(),fe("div",Y_,[X("button",{type:"button",class:"dropdown__btn","aria-expanded":e.isOpen?"true":"false","aria-controls":n.id,onClick:t[0]||(t[0]=(...s)=>e.toggle&&e.toggle(...s))},[Oe(a,{name:"more-vert"})],8,X_),X("ul",{class:"dropdown__menu",id:n.id},[Qn(e.$slots,"default")],8,Q_)])}const t1=Le(J_,[["render",e1]]),n1={mixins:[pn],props:{class:{type:[String,Array,Object],default:null},style:{type:[String,Array,Object],default:null},modelValue:{type:[String,Number,Array,Object],default:null},label:{type:String,required:!0},name:{type:String,required:!0},error:{type:String,default:null},multiple:{type:Boolean,default:!1},url:{type:String,required:!0},selectResolver:{type:Function,default:(e,t)=>e},value:{type:[String,Number,Array,Object],default:null},formatted_value:{type:[String,Number,Array,Object],default:null}},inheritAttrs:!1,emits:["update:modelValue"],mounted(){this.$dispatcher.once("open",this.fetch),this.formattedValue=this.formatted_value===null?{}:Object.assign({},this.multiple?this.formatted_value:{[this.modelValue]:this.formatted_value})},data(){return{active:-1,processing:!1,response:{data:[]},search:null,formattedValue:null}},methods:{commit(){this.close();const e=this.response.data[this.active].value,t=this.multiple?this.modelValue.concat([e]):[e];this.$emit("update:modelValue",this.selectResolver(this.multiple?t:t[0],JSON.parse(JSON.stringify(this.response.data)))),this.updateFormattedValue(t),this.search=null},select(e){this.highlight(e),this.commit()},highlight(e){this.open(),this.active=e,this.$refs.option&&this.$refs.option[e]&&this.$nextTick(()=>{this.$refs.option[e].scrollIntoView({block:"nearest"})})},highlightNext(){this.isOpen&&this.highlight(this.active+1>=this.response.data.length?0:this.active+1)},highlightPrev(){this.isOpen&&this.highlight(this.active===0?this.response.data.length-1:this.active-1)},clear(){this.search=null,this.$emit("update:modelValue",this.multiple?[]:null)},fetch(){this.processing=!0,this.$http.get(this.url,{params:{search:this.search}}).then(e=>{this.response=e.data}).catch(e=>{}).finally(()=>{this.processing=!1})},selected(e){return this.multiple?this.modelValue.includes(e):e===this.modelValue},remove(e){if(!this.multiple)this.$emit("update:modelValue",null),this.formattedValue={};else{const t=Array.from(this.modelValue);t.splice(t.findIndex(n=>n===e),1),this.updateFormattedValue(t),this.$emit("update:modelValue",t)}},updateFormattedValue(e){this.formattedValue=e.reduce((t,n)=>Object.assign(t,{[n]:this.formattedValue.hasOwnProperty(n)?this.formattedValue[n]:this.response.data.find(r=>r.value===n).formatted_value}),{})}}},r1=["for"],i1=["aria-label"],o1={class:"tag__label"},a1=["onClick"],l1={key:0,class:"field-feedback field-feedback--invalid"},s1={role:"listbox",style:{"z-index":"1000"}},u1=["innerHTML","aria-selected","onMousedown"],f1={key:0,"aria-live":"polite",role:"status",class:"field-feedback field-feedback--invalid"};function c1(e,t,n,r,i,o){const a=ke("Icon"),s=cs("debounce");return se(),fe("div",{class:we(["form-group form-group--autocomplete",n.class]),style:Xe(n.style)},[X("label",{class:"form-label",for:e.$attrs.id},[X("span",null,pe(n.label),1),e.$attrs.required?(se(),fe("span",{key:0,class:"form-label__required-marker","aria-label":e.__("Required")},"*",8,i1)):je("",!0)],8,r1),X("div",{class:we(["form-control tag-control",{"form-control--invalid":n.error!==null}]),onClick:t[7]||(t[7]=Tt((...u)=>e.$refs.input.focus&&e.$refs.input.focus(...u),["self"]))},[(se(!0),fe(Me,null,ot(i.formattedValue,(u,d)=>(se(),fe("span",{class:"tag",key:d},[X("span",o1,pe(u),1),X("button",{type:"button",class:"tag__remove",onClick:m=>o.remove(d)},[Oe(a,{name:"close"})],8,a1)]))),128)),Ye(X("input",dt({ref:"input",type:"text",style:{width:"150px"},autocomplete:"off"},e.$attrs,{"onUpdate:modelValue":t[0]||(t[0]=u=>i.search=u),class:{"form-control--invalid":n.error!==null},onFocus:t[1]||(t[1]=(...u)=>e.open&&e.open(...u)),onBlur:t[2]||(t[2]=(...u)=>e.close&&e.close(...u)),onKeydown:[t[3]||(t[3]=Ar((...u)=>o.highlightPrev&&o.highlightPrev(...u),["up"])),t[4]||(t[4]=Ar((...u)=>o.highlightNext&&o.highlightNext(...u),["down"])),t[5]||(t[5]=Ar(Tt((...u)=>o.commit&&o.commit(...u),["prevent"]),["enter"]))],onChange:t[6]||(t[6]=(...u)=>o.fetch&&o.fetch(...u))}),null,16),[[cn,i.search,void 0,{lazy:!0}],[s,300]])],2),n.error?(se(),fe("span",l1,pe(n.error),1)):je("",!0),Ye(X("ul",s1,[(se(!0),fe(Me,null,ot(i.response.data,(u,d)=>(se(),fe("li",{ref_for:!0,ref:"option",innerHTML:u.formatted_value,tabindex:"-1","aria-selected":d===i.active?"true":"false",class:we({"is-active":d===i.active,"is-selected":o.selected(u.value)}),key:u.value,onMousedown:m=>o.select(d)},null,42,u1))),128)),i.response.data.length===0?(se(),fe("li",f1,pe(e.__("No items found for the given keyword.")),1)):je("",!0)],512),[[qr,e.isOpen]])],6)}const d1=Le(n1,[["render",c1]]),h1={props:{class:{type:[String,Array,Object],default:null},style:{type:[String,Array,Object],default:null},modelValue:{default:null},value:{default:null},formatted_value:{default:null},label:{type:String,required:!0},error:{type:String,default:null},id:{type:String,requried:!0},name:{type:String,requried:!0},options:{type:Array,default:()=>[]},help:{type:String,default:null}},inheritAttrs:!1,emits:["update:modelValue"],computed:{_value:{set(e){this.$emit("update:modelValue",e)},get(){return this.modelValue===null&&this.options.length>0?[]:this.modelValue}}}},p1=["for"],y1=["aria-label"],m1=["name","value"],v1=["innerHTML"],g1={key:0,class:"form-check"},b1=["id","name"],_1={class:"form-check__label"},O1=["innerHTML"];function E1(e,t,n,r,i,o){return se(),fe("div",{class:we(["form-group form-group--vertical-check",n.class]),style:Xe(n.style)},[X("label",{class:"form-label",for:n.id},[X("span",null,pe(n.label),1),e.$attrs.required?(se(),fe("span",{key:0,class:"form-label__required-marker","aria-label":e.__("Required")},"*",8,y1)):je("",!0)],8,p1),(se(!0),fe(Me,null,ot(n.options,a=>(se(),fe("label",{class:"form-check",key:a.value},[Ye(X("input",dt(e.$attrs,{class:"form-check__control","onUpdate:modelValue":t[0]||(t[0]=s=>o._value=s),name:`${n.name}.${a.value}`,value:a.value}),null,16,m1),[[dn,o._value]]),X("span",{class:"form-check__label",innerHTML:a.formatted_value},null,8,v1)]))),128)),n.options.length===0?(se(),fe("label",g1,[Ye(X("input",dt(e.$attrs,{class:"form-check__control","onUpdate:modelValue":t[1]||(t[1]=a=>o._value=a),id:n.id,name:n.name}),null,16,b1),[[dn,o._value]]),X("span",_1,pe(n.label),1)])):je("",!0),n.error!==null||n.help?(se(),fe("span",{key:1,class:we(["field-feedback",{"field-feedback--invalid":n.error!==null}]),innerHTML:n.error||n.help},null,10,O1)):je("",!0)],6)}const w1=Le(h1,[["render",E1]]),S1={props:{class:{type:[String,Array,Object],default:null},style:{type:[String,Array,Object],default:null},modelValue:{type:String,default:null},label:{type:String,default:null},error:{type:String,default:null},with_time:{type:Boolean,default:!1},value:{type:String,default:null},formatted_value:{type:String,default:null},help:{type:String,default:null}},inheritAttrs:!1,emits:["update:modelValue"],data(){return{_value:new Date(this.modelValue)}},computed:{date:{set(e){e=e.split("-"),this._value.setFullYear(e[0]),this._value.setMonth(e[1]-1),this._value.setDate(e[2]),this.$emit("update:modelValue",this._value.toISOString())},get(){return this.modelValue?[this._value.getFullYear(),(this._value.getMonth()+1).toString().padStart(2,0),this._value.getDate().toString().padStart(2,0)].join("-"):null}},time:{set(e){e=e.split(":"),this._value.setHours(e[0]),this._value.setMinutes(e[1]),this._value.setSeconds(e[2]),this.$emit("update:modelValue",this._value.toISOString())},get(){return this.modelValue?[this._value.getHours().toString().padStart(2,0),this._value.getMinutes().toString().padStart(2,0),this._value.getSeconds().toString().padStart(2,0)].join(":"):null}}}},A1=["for"],T1=["aria-label"],k1={class:"form-group-inner--stack"},x1=["disabled"],P1=["innerHTML"];function N1(e,t,n,r,i,o){return se(),fe("div",{class:we(["form-group",n.class]),style:Xe(n.style)},[X("label",{class:"form-label",for:e.$attrs.id},[X("span",null,pe(n.label),1),e.$attrs.required?(se(),fe("span",{key:0,class:"form-label__required-marker","aria-label":e.__("Required")},"*",8,T1)):je("",!0)],8,A1),X("div",k1,[Ye(X("input",dt({class:"form-control"},e.$attrs,{"onUpdate:modelValue":t[0]||(t[0]=a=>o.date=a),class:{"form-control--invalid":n.error!==null}}),null,16),[[dn,o.date]]),n.with_time?Ye((se(),fe("input",{key:0,type:"time",step:"1",class:we(["form-control",{"form-control--invalid":n.error!==null}]),"onUpdate:modelValue":t[1]||(t[1]=a=>o.time=a),disabled:e.$attrs.disabled},null,10,x1)),[[cn,o.time]]):je("",!0)]),n.error!==null||n.help?(se(),fe("span",{key:0,class:we(["field-feedback",{"field-feedback--invalid":n.error!==null}]),innerHTML:n.error||n.help},null,10,P1)):je("",!0)],6)}const R1=Le(S1,[["render",N1]]),L1={},C1={class:"modal-filter"},I1={class:"form-group--inline"},M1={for:"media-search",class:"sr-only"},$1=["placeholder","readonly"],j1={class:"form-group--inline"},q1={for:"media-type",class:"form-group__label is-prepend"},D1={class:"form-group-text"},B1={class:"custom-select"},F1=["disabled"],U1={value:null},H1={value:"file"},V1={value:"image"};function K1(e,t,n,r,i,o){const a=cs("debounce");return se(),fe("div",C1,[X("div",I1,[X("label",M1,pe(e.__("Search")),1),Ye(X("input",{id:"media-search",type:"text",class:"form-control form-control--sm",style:{width:"15rem"},placeholder:e.__("Search"),readonly:e.$parent.processing,"onUpdate:modelValue":t[0]||(t[0]=s=>e.$parent.query.search=s)},null,8,$1),[[cn,e.$parent.query.search,void 0,{lazy:!0}],[a,500]])]),X("div",j1,[X("label",q1,[X("span",D1,pe(e.__("Type")),1)]),X("div",B1,[Ye(X("select",{id:"media-type",class:"form-control form-control--sm",disabled:e.$parent.processing,"onUpdate:modelValue":t[1]||(t[1]=s=>e.$parent.query.type=s)},[X("option",U1,pe(e.__("All")),1),X("option",H1,pe(e.__("File")),1),X("option",V1,pe(e.__("Image")),1)],8,F1),[[Wo,e.$parent.query.type]])])])])}const z1=Le(L1,[["render",K1]]),W1={props:{item:{type:Object,required:!0}},data(){return{tries:0,loading:!1,url:this.item.urls.thumb||this.item.urls.original}},computed:{classNames(){return{"is-image":this.item.is_image,"is-svg":this.item.mime_type.startsWith("image/svg"),"is-document":!this.item.is_image,"is-selected":this.selected,"is-loading":this.loading}},selected(){return this.$parent.selection.some(e=>e.id===this.item.id)}},methods:{toggle(){this.$parent.processing||(this.selected?this.$parent.deselect(this.item):this.$parent.select(this.item))},reload(){if(this.tries>=5)return;this.loading=!0;const e=setInterval(()=>{const t=new URL(this.url);t.searchParams.set("key",new Date().getTime()),this.url=t.toString(),this.tries++,clearInterval(e)},5e3)}}},G1=["src","alt"],Z1={key:1,class:"media-item__caption"};function J1(e,t,n,r,i,o){const a=ke("Icon");return se(),fe("div",{class:we(["media-item",o.classNames]),style:{cursor:"pointer"},onClick:t[2]||(t[2]=Tt((...s)=>o.toggle&&o.toggle(...s),["prevent"]))},[n.item.is_image?(se(),fe("img",{key:0,src:i.url,alt:n.item.name,onError:t[0]||(t[0]=(...s)=>o.reload&&o.reload(...s)),onLoad:t[1]||(t[1]=s=>i.loading=!1)},null,40,G1)):(se(),fe("span",Z1,[Oe(a,{name:"description"}),X("span",null,pe(n.item.file_name),1)]))],2)}const Y1=Le(W1,[["render",J1]]),X1={props:{item:{type:Object,required:!0}},emits:["deselect"],data(){return{tries:0,loading:!1,processing:!1,url:this.item.urls.thumb||this.item.urls.original}},computed:{invalid(){return Object.keys(this.$parent.$parent.$parent.$parent.form.errors).some(e=>e.startsWith(`${this.$parent.$parent.$parent.name}.${this.item.id}.`))},size(){if(this.item.size===0)return"1 KB";const e=["KB","MB","GB","TB"],t=Math.floor(Math.log(this.item.size)/Math.log(1024));return(this.item.size/Math.pow(1024,t)).toFixed(2)*1+" "+e[t]},dimensions(){return this.item.width&&this.item.height?`${this.item.width}×${this.item.height} px`:null}},methods:{deselect(){this.$emit("deselect",this.item)},destroy(){window.confirm(this.__("Are you sure?"))&&(this.processing=!0,this.$http.delete(this.$parent.$parent.url,{data:{models:[this.item.id]}}).then(t=>{this.deselect();const n=this.$parent.$parent.response.data.findIndex(r=>r.id===this.item.id);this.$parent.$parent.response.data.splice(n,1)}).catch(t=>{}).finally(()=>{this.processing=!1}))},reload(){if(this.tries>=5){this.loading=!1;return}this.loading=!0;const e=setInterval(()=>{const t=new URL(this.url);t.searchParams.set("key",new Date().getTime()),this.url=t.toString(),this.tries++,clearInterval(e)},5e3)}}},Q1=["src"],e0={key:1,class:"media-accordion__icon"},t0={class:"accordion__caption"},n0={class:"media-sidebar__list mt-3 mb-3"},r0={key:0},i0=wt(": "),o0=["innerHTML"],a0={class:"form-group-stack"},l0={class:"form-group",style:{display:"flex","justify-content":"space-between"}},s0=["disabled"],u0=["disabled"];function f0(e,t,n,r,i,o){const a=ke("Icon"),s=ke("FormHandler"),u=ke("Accordion");return se(),Et(u,{ref:"accordion",title:n.item.file_name,class:we({"is-invalid":o.invalid})},{header:mt(()=>[n.item.is_image?(se(),fe("div",{key:0,class:we(["media-accordion__image-wrapper",{"is-loading":i.loading}])},[X("img",{src:i.url,class:"media-accordion__image",alt:"",onError:t[0]||(t[0]=(...d)=>o.reload&&o.reload(...d)),onLoad:t[1]||(t[1]=d=>i.loading=!1)},null,40,Q1)],2)):(se(),fe("span",e0,[Oe(a,{name:"description"})])),X("span",t0,pe(n.item.file_name),1)]),default:mt(()=>[X("ul",n0,[X("li",null,[X("strong",null,pe(e.__("Created At")),1),wt(": "+pe(n.item.created_at),1)]),X("li",null,[X("strong",null,pe(e.__("Size")),1),wt(": "+pe(o.size),1)]),o.dimensions?(se(),fe("li",r0,[X("strong",null,pe(e.__("Dimensions")),1),i0,X("span",{innerHTML:o.dimensions},null,8,o0)])):je("",!0)]),X("div",a0,[(se(!0),fe(Me,null,ot(n.item.fields,d=>(se(),Et(s,dt(d,{modelValue:e.$parent.$parent.value[n.item.id][d.name],"onUpdate:modelValue":m=>e.$parent.$parent.value[n.item.id][d.name]=m,form:e.$parent.$parent.$parent.$parent.form,key:`${n.item.id}-${d.name}`,id:`${e.$parent.$parent.$parent.name}.${n.item.id}.${d.name}`,name:`${e.$parent.$parent.$parent.name}.${n.item.id}.${d.name}`,disabled:i.processing}),null,16,["modelValue","onUpdate:modelValue","form","id","name","disabled"]))),128)),X("div",l0,[X("button",{type:"button",class:"btn btn--delete btn--sm btn--tertiary",disabled:i.processing,onClick:t[2]||(t[2]=(...d)=>o.deselect&&o.deselect(...d))},pe(e.__("Remove from Selection")),9,s0),X("button",{type:"button",class:"btn btn--delete btn--sm",disabled:i.processing,onClick:t[3]||(t[3]=(...d)=>o.destroy&&o.destroy(...d))},pe(e.__("Delete")),9,u0)])])]),_:1},8,["title","class"])}const c0=Le(X1,[["render",f0]]),d0={components:{Item:c0},props:{items:{type:Array,required:!0}},methods:{deselect(e){this.items.splice(this.items.findIndex(t=>t.id===e.id),1)}}},h0={class:"media-sidebar"},p0={class:"media-sidebar__section"},y0={class:"media-sidebar__title"},m0={class:"accordion-wrapper"};function v0(e,t,n,r,i,o){const a=ke("Item");return se(),fe("div",h0,[X("div",p0,[X("h3",y0,pe(e.__(":files files selected",{files:n.items.length})),1),X("div",m0,[(se(!0),fe(Me,null,ot(n.items,s=>(se(),Et(a,{key:s.id,item:s,onDeselect:u=>o.deselect(s)},null,8,["item","onDeselect"]))),128))])])])}const g0=Le(d0,[["render",v0]]),b0={},_0={class:"modal-footer"},O0=["disabled"],E0={class:"modal-footer-actions"},w0=["disabled"],S0=["disabled"];function A0(e,t,n,r,i,o){return se(),fe("div",_0,[X("div",null,[X("input",{multiple:"",type:"file",disabled:e.$parent.processing,onChange:t[0]||(t[0]=a=>e.$parent.handleFiles(a.target.files))},null,40,O0)]),X("div",E0,[X("button",{type:"button",class:"btn btn--primary",disabled:e.$parent.processing,onClick:t[1]||(t[1]=(...a)=>e.$parent.updateSelection&&e.$parent.updateSelection(...a))},pe(e.__("Select")),9,w0),X("button",{type:"button",class:"btn btn--tertiary",disabled:e.$parent.processing,onClick:t[2]||(t[2]=(...a)=>e.$parent.close&&e.$parent.close(...a))},pe(e.__("Close")),9,S0)])])}const T0=Le(b0,[["render",A0]]),k0={props:{file:{type:File,required:!0},url:{type:String,required:!0}},beforeMount(){this.generateHash(),this.createChunks()},watch:{chunks:{handler(e,t){e.length>0&&this.upload()},deep:!0}},data(){return{chunks:[],hash:null,error:null,uploaded:0}},computed:{progress(){return Math.floor(this.uploaded*100/this.file.size)},formData(){const e=new FormData;return e.set("is_last",this.chunks.length===1),e.set("file",this.chunks[0],`${this.hash}__${this.file.name}.chunk`),e}},methods:{upload(){this.$http.post(this.url,this.formData,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:e=>{this.uploaded+=e.loaded}}).then(e=>{this.onSuccess(e.data)}).catch(e=>{this.error=this.__("Something went wrong!")})},retry(){this.chunks=[],this.error=null,this.uploaded=0,this.generateHash(),this.createChunks()},onSuccess(e){this.chunks.shift(),this.chunks.length===0&&(this.$parent.response.total++,this.$parent.response.data.unshift(e),this.$parent.queue.splice(this.$parent.queue.indexOf(this.file),1))},generateHash(){this.hash=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)},createChunks(){let e=[];const n=Math.ceil(this.file.size/1048576);for(let r=0;ro.retry&&o.retry(...a))},pe(e.__("Retry")),1)])):(se(),fe("div",{key:0,class:"uploader-item__progress",style:Xe({width:`${o.progress}%`})},null,4))])}const R0=Le(k0,[["render",N0]]),L0={components:{Item:Y1,Filters:z1,Sidebar:g0,Toolbar:T0,Uploader:R0},mixins:[pn],props:{modelValue:{type:[Array,Object],default:()=>[]},multiple:{type:Boolean,default:!1},url:{type:String,required:!0},title:{type:String,default:function(){return this.__("Media")}},selectResolver:{type:Function,default:(e,t)=>e}},inheritAttrs:!1,emits:["update:modelValue"],watch:{isOpen(e,t){document.body.classList.toggle("has-modal-open",e)},query:{handler(e,t){this.fetch()},deep:!0}},mounted(){this.$dispatcher.once("open",this.fetch),window.addEventListener("keyup",e=>{this.isOpen&&e.code==="Escape"&&this.close()}),this.$refs.container.addEventListener("scroll",Sd(e=>{this.shouldPaginate()&&this.paginate()},300))},data(){return{dragging:!1,processing:!1,query:{type:null,search:null},queue:[],response:{data:[],next_page_url:null,prev_page_url:null},selection:[],value:Object.assign({},JSON.parse(JSON.stringify(this.modelValue)))}},methods:{fetch(){this.processing=!0,this.$http.get(this.url,{params:this.query}).then(e=>{this.response=e.data}).catch(e=>{}).finally(()=>{this.processing=!1})},paginate(){this.processing=!0,this.$http.get(this.response.next_page_url).then(e=>{this.response.data.push(...e.data.data),this.response.next_page_url=e.data.next_page_url,this.response.prev_page_url=e.data.prev_page_url}).catch(e=>{}).finally(()=>{this.processing=!1})},handleFiles(e){this.dragging=!1;for(let t=0;t0&&e.scrollHeight-e.scrollTop-e.clientHeight<1},select(e){this.multiple?this.selection.push(e):(this.value={},this.selection=[e]),this.value=Object.assign(this.value,{[e.id]:e.fields.reduce((t,n)=>Object.assign(t,{[n.name]:n.value}),{})})},deselect(e){const t=this.selection.findIndex(n=>n.id===e.id);this.selection.splice(t,1),delete this.value[e.id]},updateSelection(){this.update(),this.close()},update(){this.$emit("update:modelValue",this.selectResolver(this.value,this.selection))},clearSelection(){this.value={},this.selection=[],this.$emit("update:modelValue",this.value)}}},C0=["aria-label"],I0={class:"modal-inner"},M0={class:"modal-header"},$0={class:"modal-title"},j0=["aria-label"],q0=["data-dropzone-text"],D0={ref:"container"},B0={class:"media-item-list__body"},F0={class:"media-item-list__sidebar"},U0={key:1,class:"alert alert--info",role:"alert"};function H0(e,t,n,r,i,o){const a=ke("Icon"),s=ke("Filters"),u=ke("Uploader"),d=ke("Item"),m=ke("Sidebar"),c=ke("Toolbar");return se(),fe("div",{class:we(["modal-backdrop",{"modal-backdrop--visible":e.isOpen}]),onClick:t[6]||(t[6]=Tt((...l)=>e.close&&e.close(...l),["self"]))},[X("div",{role:"dialog","aria-modal":"true",class:we(["modal modal--media",{hidden:!e.isOpen}]),"aria-label":n.title},[X("div",I0,[X("div",M0,[X("h2",$0,pe(n.title),1),X("button",{type:"button",class:"modal-close btn btn--secondary btn--sm btn--icon","aria-label":e.__("Close modal"),onClick:t[0]||(t[0]=(...l)=>e.close&&e.close(...l))},[Oe(a,{name:"close",class:"btn__icon"})],8,j0)]),X("div",{class:we(["modal-body modal-body--media",{"has-active-dropzone":i.dragging}]),"data-dropzone-text":e.__("Drop your files here"),onDragstart:t[1]||(t[1]=Tt(()=>{},["prevent"])),onDragend:t[2]||(t[2]=Tt(l=>i.dragging=!1,["prevent"])),onDragover:t[3]||(t[3]=Tt(l=>i.dragging=!0,["prevent"])),onDragleave:t[4]||(t[4]=Tt(l=>i.dragging=!1,["prevent"])),onDrop:t[5]||(t[5]=Tt(l=>o.handleFiles(l.dataTransfer.files),["prevent"]))},[X("div",D0,[Oe(s),i.queue.length||i.response.data.length?(se(),fe("div",{key:0,class:we(["media-item-list-wrapper",{"is-sidebar-open":i.selection.length>0}])},[X("div",B0,[(se(!0),fe(Me,null,ot(i.queue,(l,f)=>(se(),Et(u,{key:`uploader-${f}`,file:l,url:n.url},null,8,["file","url"]))),128)),(se(!0),fe(Me,null,ot(i.response.data,(l,f)=>(se(),Et(d,{key:`${l.file_name}-${f}`,item:l},null,8,["item"]))),128))]),Ye(X("div",F0,[Oe(m,{items:i.selection},null,8,["items"])],512),[[qr,i.selection.length]])],2)):(se(),fe("div",U0,pe(e.__("No results found.")),1))],512)],42,q0),Oe(c)])],10,C0)],2)}const kd=Le(L0,[["render",H0]]),V0={components:{Media:kd},props:{class:{type:[String,Array,Object],default:null},style:{type:[String,Array,Object],default:null},modelValue:{type:String,default:""},value:{type:String,default:""},formatted_value:{type:String,default:""},with_media:{type:Boolean,default:!1},media_url:{type:String,default:null},label:{type:String,required:!0},error:{type:String,default:null},placeholder:{type:String,default:""},config:{type:Object,requried:!0},help:{type:String,default:""}},inheritAttrs:!1,emits:["update:modelValue"],mounted(){const e=JSON.parse(JSON.stringify(Object.assign({},this.config,{placeholder:this.placeholder})));this.with_media&&(e.modules.toolbar.handlers.image=()=>{this.$refs.media.open()});const t=new _r(this.$refs.input,e);t.root.innerHTML=this.modelValue,t.enable(!this.$attrs.disabled),t.on("text-change",()=>{this.$emit("update:modelValue",t.root.innerHTML==="


"?"":t.root.innerHTML)}),this.selectResolver=(n,r)=>(this.insertMedia(t,r),n)},data(){return{selectResolver:e=>e}},methods:{insertMedia(e,t){const n=e.getSelection(!0);t.forEach(r=>{r.is_image?(e.editor.insertEmbed(n.index,"image",r.urls.original,_r.sources.USER),e.setSelection(n.index+1,0,_r.sources.SILENT)):(e.editor.insertText(n.index,r.name,"link",r.urls.original,_r.sources.USER),e.setSelection(n.index+r.name.length,0,_r.sources.SILENT))}),e.emitter.emit("text-change"),this.$refs.media.clearSelection()}}},K0=["for"],z0=["aria-label"],W0={ref:"input",class:"editor",spellcheck:"false"},G0=["innerHTML"];function Z0(e,t,n,r,i,o){const a=ke("Media");return se(),fe("div",{class:we(["form-group",n.class]),style:Xe(n.style)},[X("label",{class:"form-label",for:e.$attrs.id},[X("span",null,pe(n.label),1),e.$attrs.required?(se(),fe("span",{key:0,class:"form-label__required-marker","aria-label":e.__("Required")},"*",8,z0)):je("",!0)],8,K0),X("div",W0,null,512),n.with_media?(se(),Et(a,{key:0,ref:"media",url:n.media_url,title:e.__("Media"),"select-resolver":i.selectResolver},null,8,["url","title","select-resolver"])):je("",!0),n.error!==null||n.help?(se(),fe("span",{key:1,class:we(["field-feedback",{"field-feedback--invalid":n.error!==null}]),innerHTML:n.error||n.help},null,10,G0)):je("",!0)],6)}const J0=Le(V0,[["render",Z0]]),Y0={props:{modelValue:{type:[String,Number],default:null},label:{type:String,required:!0},error:{type:String,default:null},value:{type:[String,Number],default:null},formatted_value:{type:[String,Number],default:null}},inheritAttrs:!1,emits:["update:modelValue"],computed:{_value:{set(e){this.$emit("update:modelValue",e)},get(){return this.modelValue}}}};function X0(e,t,n,r,i,o){return Ye((se(),fe("input",dt(e.$attrs,{"onUpdate:modelValue":t[0]||(t[0]=a=>o._value=a)}),null,16)),[[dn,o._value]])}const Q0=Le(Y0,[["render",X0]]),eO={props:{class:{type:[String,Array,Object],default:null},style:{type:[String,Array,Object],default:null},modelValue:{type:[String,Number],default:null},label:{type:String,required:!0},error:{type:String,default:null},value:{type:[String,Number],default:null},formatted_value:{type:[String,Number],default:null},help:{type:String,default:null}},inheritAttrs:!1,emits:["update:modelValue"],computed:{_value:{set(e){this.$emit("update:modelValue",e)},get(){return this.modelValue}}}},tO=["for"],nO=["aria-label"],rO=["innerHTML"];function iO(e,t,n,r,i,o){return se(),fe("div",{class:we(["form-group",n.class]),style:Xe(n.style)},[X("label",{class:"form-label",for:e.$attrs.id},[X("span",null,pe(n.label),1),e.$attrs.required?(se(),fe("span",{key:0,class:"form-label__required-marker","aria-label":e.__("Required")},"*",8,nO)):je("",!0)],8,tO),Ye(X("input",dt({class:"form-control"},e.$attrs,{"onUpdate:modelValue":t[0]||(t[0]=a=>o._value=a),class:{"form-control--invalid":n.error!==null}}),null,16),[[dn,o._value]]),n.error!==null||n.help?(se(),fe("span",{key:0,class:we(["field-feedback",{"field-feedback--invalid":n.error!==null}]),innerHTML:n.error||n.help},null,10,rO)):je("",!0)],6)}const oO=Le(eO,[["render",iO]]),aO={props:{class:{type:[String,Array,Object],default:null},style:{type:[String,Array,Object],default:null},modelValue:{type:[Object,Array],default:()=>[]},fields:{type:Array,default:()=>[]},label:{type:String,required:!0},name:{type:String,required:!0}},inheritAttrs:!1},lO={class:"form-group-stack"};function sO(e,t,n,r,i,o){const a=ke("FormHandler");return se(),fe("fieldset",{class:we(["is-json",n.class]),style:Xe(n.style)},[X("legend",null,pe(n.label),1),X("div",lO,[(se(!0),fe(Me,null,ot(n.fields,s=>(se(),Et(a,dt(s,{modelValue:n.modelValue[s.name],"onUpdate:modelValue":u=>n.modelValue[s.name]=u,form:e.$parent.form,key:`${n.name}-${s.name}`,id:`${n.name}.${s.name}`,name:`${n.name}.${s.name}`}),null,16,["modelValue","onUpdate:modelValue","form","id","name"]))),128))])],6)}const uO=Le(aO,[["render",sO]]),fO={components:{Media:kd},props:{class:{type:[String,Array,Object],default:null},style:{type:[String,Array,Object],default:null},modelValue:{type:[Array,Object],default:()=>[]},label:{type:String,required:!0},name:{type:String,required:!0},error:{type:String,default:null},url:{type:String,required:!0},selection:{type:Array,default:()=>[]},multiple:{type:Boolean,default:!1},help:{type:String,default:null}},inheritAttrs:!1,emits:["update:modelValue"],mounted(){this.$refs.media.selection=Array.from(this.items)},data(){return{items:JSON.parse(JSON.stringify(this.selection))}},computed:{invalid(){return Object.keys(this.$parent.form.errors).some(e=>e.startsWith(`${this.name}.`))}},methods:{remove(e){this.$refs.media.deselect(e),this.items=this.$refs.media.selection},selectResolver(e,t){return this.items=t,e},update(e){this.$emit("update:modelValue",e)}}},cO=["for"],dO=["aria-label"],hO=["innerHTML"],pO={class:"selected-media-item-list"},yO=["onClick"],mO=["src","alt"],vO=["title"],gO={style:{"max-width":"100%",overflow:"hidden","text-overflow":"ellipsis","text-align":"center"}};function bO(e,t,n,r,i,o){const a=ke("Media",!0),s=ke("Icon");return se(),fe("div",{class:we(["form-group",n.class]),style:Xe(n.style)},[X("label",{class:"form-label",for:e.$attrs.id},[X("span",null,pe(n.label),1),e.$attrs.required?(se(),fe("span",{key:0,class:"form-label__required-marker","aria-label":e.__("Required")},"*",8,dO)):je("",!0)],8,cO),X("div",null,[X("button",{type:"button",class:we(["btn btn--sm btn--tertiary",{"btn--delete":o.invalid}]),onClick:t[0]||(t[0]=(...u)=>e.$refs.media.open&&e.$refs.media.open(...u))},pe(e.__("Select :label",{label:n.label})),3),Oe(a,{ref:"media",url:n.url,title:n.label,modelValue:n.modelValue,"select-resolver":o.selectResolver,multiple:n.multiple,"onUpdate:modelValue":o.update},null,8,["url","title","modelValue","select-resolver","multiple","onUpdate:modelValue"])]),o.invalid||n.help?(se(),fe("span",{key:0,class:we(["field-feedback",{"field-feedback--invalid":o.invalid}]),innerHTML:o.invalid?e.__("The given pivot data is invalid!"):n.help},null,10,hO)):je("",!0),X("div",pO,[(se(!0),fe(Me,null,ot(i.items,u=>(se(),fe("div",{class:"selected-media-item",key:u.id},[X("button",{type:"button",class:"selected-media-item__remove",onClick:d=>o.remove(u)},[Oe(s,{name:"close"})],8,yO),u.is_image?(se(),fe("img",{key:0,src:u.urls.thumb||u.urls.original,alt:u.file_name},null,8,mO)):(se(),fe("span",{key:1,class:"selected-media-item__document",title:u.file_name},[Oe(s,{name:"description"}),X("span",gO,pe(u.file_name),1)],8,vO))]))),128))])],6)}const _O=Le(fO,[["render",bO]]),OO={props:{class:{type:[String,Array,Object],default:null},style:{type:[String,Array,Object],default:null},modelValue:{default:null},value:{default:null},formatted_value:{default:null},label:{type:String,required:!0},error:{type:String,default:null},id:{type:String,requried:!0},options:{type:Array,default:()=>[]},help:{type:String,default:null}},inheritAttrs:!1,emits:["update:modelValue"],computed:{_value:{set(e){this.$emit("update:modelValue",e)},get(){return this.modelValue}}}},EO=["for"],wO=["aria-label"],SO=["value"],AO=["innerHTML"];function TO(e,t,n,r,i,o){return se(),fe("div",{class:we(["form-group form-group--vertical-check",n.class]),style:Xe(n.style)},[X("label",{class:"form-label",for:n.id},[X("span",null,pe(n.label),1),e.$attrs.required?(se(),fe("span",{key:0,class:"form-label__required-marker","aria-label":e.__("Required")},"*",8,wO)):je("",!0)],8,EO),(se(!0),fe(Me,null,ot(n.options,a=>(se(),fe("label",{class:"form-check",key:a.value},[Ye(X("input",dt(e.$attrs,{class:"form-check__control","onUpdate:modelValue":t[0]||(t[0]=s=>o._value=s),value:a.value}),null,16,SO),[[dn,o._value]]),n.error!==null||n.help?(se(),fe("span",{key:0,class:we(["field-feedback",{"field-feedback--invalid":n.error!==null}]),innerHTML:n.error||n.help},null,10,AO)):je("",!0)]))),128))],6)}const kO=Le(OO,[["render",TO]]),xO={props:{class:{type:[String,Array,Object],default:null},style:{type:[String,Array,Object],default:null},modelValue:{type:[String,Number],default:null},value:{type:[String,Number],default:null},formatted_value:{type:[String,Number],default:null},label:{type:String,required:!0},error:{type:String,default:null},help:{type:String,default:null}},inheritAttrs:!1,emits:["update:modelValue"],computed:{_value:{set(e){this.$emit("update:modelValue",e)},get(){return this.modelValue}}}},PO=["for"],NO=["aria-label"],RO={class:"form-range-display"},LO={class:"form-range-display__item is-min"},CO={class:"form-range-display__item is-current"},IO={class:"form-range-display__item is-max"},MO=["innerHTML"];function $O(e,t,n,r,i,o){return se(),fe("div",{class:we(["form-group form-group--range",n.class]),style:Xe(n.style)},[X("label",{class:"form-label",for:e.$attrs.id},[X("span",null,pe(n.label),1),e.$attrs.required?(se(),fe("span",{key:0,class:"form-label__required-marker","aria-label":e.__("Required")},"*",8,NO)):je("",!0)],8,PO),Ye(X("input",dt({ref:"input",class:"form-range"},e.$attrs,{"onUpdate:modelValue":t[0]||(t[0]=a=>o._value=a),class:{"form-control--invalid":n.error!==null}}),null,16),[[dn,o._value]]),X("div",RO,[X("span",LO,pe(e.$attrs.min),1),X("span",CO,pe(o._value||"-"),1),X("span",IO,pe(e.$attrs.max),1)]),n.error!==null||n.help?(se(),fe("span",{key:0,class:we(["field-feedback",{"field-feedback--invalid":n.error!==null}]),innerHTML:n.error||n.help},null,10,MO)):je("",!0)],6)}const jO=Le(xO,[["render",$O]]),qO={props:{class:{type:[String,Array,Object],default:null},style:{type:[String,Array,Object],default:null},modelValue:{type:[String,Number,Array,Object],default:null},value:{type:[String,Number,Array,Object],default:null},formatted_value:{type:[String,Number,Array,Object],default:null},label:{type:String,required:!0},error:{type:String,default:null},help:{type:String,default:null},options:{type:Object,required:!0},nullable:{type:Boolean,default:!1},selectResolver:{type:Function,default:(e,t)=>e}},inheritAttrs:!1,emits:["update:modelValue"],computed:{_value:{set(e){this.$emit("update:modelValue",this.selectResolver(e,this.options))},get(){return JSON.parse(JSON.stringify(this.modelValue))}}}},DO=["for"],BO=["aria-label"],FO=["disabled"],UO=["value"],HO=["innerHTML"];function VO(e,t,n,r,i,o){return se(),fe("div",{class:we(["form-group",n.class]),style:Xe(n.style)},[X("label",{class:"form-label",for:e.$attrs.id},[X("span",null,pe(n.label),1),e.$attrs.required?(se(),fe("span",{key:0,class:"form-label__required-marker","aria-label":e.__("Required")},"*",8,BO)):je("",!0)],8,DO),Ye(X("select",dt({class:"form-control"},e.$attrs,{"onUpdate:modelValue":t[0]||(t[0]=a=>o._value=a),class:{"form-control--invalid":n.error!==null}}),[X("option",{disabled:!n.nullable||e.$attrs.multiple,value:null,selected:""},pe(e.__("Select :label",{label:n.label})),9,FO),(se(!0),fe(Me,null,ot(n.options,a=>(se(),fe("option",{value:a.value,key:a.value},pe(a.formatted_value),9,UO))),128))],16),[[Wo,o._value]]),n.error!==null||n.help?(se(),fe("span",{key:0,class:we(["field-feedback",{"field-feedback--invalid":n.error!==null}]),innerHTML:n.error||n.help},null,10,HO)):je("",!0)],6)}const KO=Le(qO,[["render",VO]]),zO={components:{Link:Ii},props:{class:{type:[String,Array,Object],default:null},style:{type:[String,Array,Object],default:null},modelValue:{type:[Array,Object],default:null},value:{type:[Array,Object],default:null},formatted_value:{type:[Array,Object,String],default:null},label:{type:String,required:!0},name:{type:String,required:!0},url:{type:String,required:!0}}},WO=["for"];function GO(e,t,n,r,i,o){const a=ke("Link");return se(),fe("div",{class:we(["form-group",n.class]),style:Xe(n.style)},[X("label",{class:"form-label",for:e.$attrs.id},[X("span",null,pe(n.label),1)],8,WO),X("div",null,[Oe(a,{class:"btn btn--sm btn--tertiary",href:n.url},{default:mt(()=>[wt(pe(n.label),1)]),_:1},8,["href"])])],6)}const ZO=Le(zO,[["render",GO]]),JO={props:{class:{type:[String,Array,Object],default:null},style:{type:[String,Array,Object],default:null},modelValue:{type:Array,default:()=>[]},label:{type:String,required:!0},name:{type:String,required:!0},error:{type:String,default:null},value:{type:Array,default:()=>[]},formatted_value:{type:String,default:null},help:{type:String,default:null}},inheritAttrs:!1,emits:["update:modelValue"],data(){return{tag:null}},methods:{add(){const e=Array.from(this.modelValue||[]);this.tag&&!e.includes(this.tag)&&(e.push(this.tag),this.$emit("update:modelValue",e),this.tag=null)},remove(e){const t=Array.from(this.modelValue||[]);t.splice(e,1),this.$emit("update:modelValue",t)},removeLast(){Array.isArray(this.modelValue)&&!this.tag&&this.remove(this.modelValue.length-1)}}},YO=["for"],XO=["aria-label"],QO={class:"tag__label"},eE=["onClick"],tE=["innerHTML"];function nE(e,t,n,r,i,o){const a=ke("Icon");return se(),fe("div",{class:we(["form-group",n.class]),style:Xe(n.style)},[X("label",{class:"form-label",for:e.$attrs.id},[X("span",null,pe(n.label),1),e.$attrs.required?(se(),fe("span",{key:0,class:"form-label__required-marker","aria-label":e.__("Required")},"*",8,XO)):je("",!0)],8,YO),X("div",{class:we(["form-control tag-control",{"form-control--invalid":n.error!==null}]),onClick:t[4]||(t[4]=Tt((...s)=>e.$refs.input.focus&&e.$refs.input.focus(...s),["self"]))},[(se(!0),fe(Me,null,ot(n.modelValue,(s,u)=>(se(),fe("span",{class:"tag",key:u},[X("span",QO,pe(s),1),X("button",{type:"button",class:"tag__remove",onClick:d=>o.remove(u)},[Oe(a,{name:"close"})],8,eE)]))),128)),Ye(X("input",dt({ref:"input",type:"text",style:{width:"150px"}},e.$attrs,{"onUpdate:modelValue":t[0]||(t[0]=s=>i.tag=s),onBlur:t[1]||(t[1]=(...s)=>o.add&&o.add(...s)),onKeydown:[t[2]||(t[2]=Ar(Tt((...s)=>o.add&&o.add(...s),["prevent"]),["enter"])),t[3]||(t[3]=Ar((...s)=>o.removeLast&&o.removeLast(...s),["backspace"]))]}),null,16),[[cn,i.tag]])],2),n.error!==null||n.help?(se(),fe("span",{key:0,class:we(["field-feedback",{"field-feedback--invalid":n.error!==null}]),innerHTML:n.error||n.help},null,10,tE)):je("",!0)],6)}const rE=Le(JO,[["render",nE]]),iE={props:{class:{type:[String,Array,Object],default:null},style:{type:[String,Array,Object],default:null},modelValue:{type:[String,Number],default:null},formatted_value:{type:[String,Number],default:null},label:{type:String,required:!0},error:{type:String,default:null},help:{type:String,default:null}},inheritAttrs:!1,emits:["update:modelValue"],computed:{_value:{set(e){this.$emit("update:modelValue",e)},get(){return this.modelValue}}}},oE=["for"],aE=["aria-label"],lE=["innerHTML"];function sE(e,t,n,r,i,o){return se(),fe("div",{class:we(["form-group",n.class]),style:Xe(n.style)},[X("label",{class:"form-label",for:e.$attrs.id},[X("span",null,pe(n.label),1),e.$attrs.required?(se(),fe("span",{key:0,class:"form-label__required-marker","aria-label":e.__("Required")},"*",8,aE)):je("",!0)],8,oE),Ye(X("textarea",dt({class:"form-control"},e.$attrs,{"onUpdate:modelValue":t[0]||(t[0]=a=>o._value=a),class:{"form-control--invalid":n.error!==null}}),null,16),[[cn,o._value]]),n.error!==null||n.help?(se(),fe("span",{key:0,class:we(["field-feedback",{"field-feedback--invalid":n.error!==null}]),innerHTML:n.error||n.help},null,10,lE)):je("",!0)],6)}const uE=Le(iE,[["render",sE]]),fE={name:"FormHandler",components:{AsyncSelect:d1,Checkbox:w1,DateTime:R1,Editor:J0,Hidden:Q0,Input:oO,Json:uO,Media:_O,Radio:kO,Range:jO,Select:KO,SubResource:ZO,Tag:rE,Textarea:uE},props:{modelValue:{default:null},name:{type:String,required:!0},component:{type:String,default:"Input"},form:{type:Object,required:!0},componentResolver:{type:Function,default:e=>ke(e)},debounce:{type:Number,default:0}},inheritAttrs:!1,emits:["update:modelValue"],render(){return Ri(this.componentResolver(this.component),{...this.$attrs,name:this.name,modelValue:this.modelValue,error:this.form.errors[this.name],readonly:this.form.processing||![void 0,"false",!1].includes(this.$attrs.readonly),required:![void 0,"false",!1].includes(this.$attrs.required),"onUpdate:modelValue":wd(e=>{this.$emit("update:modelValue",e),this.form.clearErrors(this.name)},this.debounce||0)},this.$slots)}},cE={props:{name:{type:String,required:!0}}},dE={class:"icon","aria-hidden":"true",focusable:"false",role:"img",fill:"currentColor",viewBox:"0 0 24 24",width:"24",height:"24"},hE=["xlink:href"];function pE(e,t,n,r,i,o){return se(),fe("svg",dE,[X("use",{"xlink:href":`#icon-${n.name}`},null,8,hE)])}const yE=Le(cE,[["render",pE]]),mE={mixins:[pn],props:{title:{type:String,required:!0}},watch:{isOpen(e,t){document.body.classList.toggle("has-modal-open",e)}}},vE=["aria-label"],gE={class:"modal-header"},bE={class:"modal-title"},_E={class:"modal-body"},OE={class:"modal-action"};function EE(e,t,n,r,i,o){return se(),fe("div",{class:we(["modal-backdrop",{"modal-backdrop--visible":e.isOpen}]),onClick:t[1]||(t[1]=Tt((...a)=>e.close&&e.close(...a),["self"]))},[X("div",{role:"dialog","aria-modal":"true",class:we(["modal",{hidden:!e.isOpen}]),"aria-label":n.title},[X("div",gE,[X("h2",bE,pe(n.title),1)]),X("div",_E,[Qn(e.$slots,"default")]),X("div",OE,[Qn(e.$slots,"footer"),X("button",{type:"button",class:"btn btn--secondary",onClick:t[0]||(t[0]=(...a)=>e.close&&e.close(...a))},pe(e.__("Close")),1)])],10,vE)],2)}const wE=Le(mE,[["render",EE]]);class SE{constructor(t){this.translations=t}__(t,n={}){t=this.translations[t]||t;for(let r in n)t=t.toString().replace(`:${r}`,n[r]).replace(`:${r.toUpperCase()}`,n[r].toString().toUpperCase()).replace(`:${r.charAt(0).toUpperCase()}${r.slice(1)}`,n[r].toString().charAt(0).toUpperCase()+n[r].toString().slice(1));return t.toString().trim()}}const AE={props:{template:{type:String,default:null},async:{type:Boolean,default:!1},url:{type:String,default:null}},inheritAttrs:!1,mounted(){this.async&&this.fetch()},data(){return{content:this.template}},methods:{fetch(){this.$http.get(this.url).then(e=>{this.content=e.data})}}},TE=["innerHTML"];function kE(e,t,n,r,i,o){return se(),fe("div",{innerHTML:i.content},null,8,TE)}const xE=Le(AE,[["render",kE]]),PE={name:"WidgetHandler",components:{Widget:xE},props:{component:{type:String,default:"Widget"}},inheritAttrs:!1,render(){return Ri(ke(this.component),this.$attrs,this.$slots)}},NE={install(e,t={}){e.mixin(Z_),e.component("Accordion",K_),e.component("Dropdown",t1),e.component("FormHandler",fE),e.component("Icon",yE),e.component("Modal",wE),e.component("WidgetHandler",PE),e.directive("debounce",W_),e.config.globalProperties.$app=t,e.config.globalProperties.$cookie=new z_;const n=new SE(t.translations||{});e.config.globalProperties.__=(r,i={})=>n.__(r,i),e.config.globalProperties.$http=lv.create({headers:{Accept:"application/json","Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}})}};window.Vue=Uc;window.Quill=_r;_d({resolve:e=>_b(`./Pages/${e}.vue`,Object.assign({"./Pages/Dashboard.vue":()=>nn(()=>import("./Dashboard.7e30a98a.js"),[]),"./Pages/Error.vue":()=>nn(()=>import("./Error.754993f2.js"),[]),"./Pages/Extracts/Index.vue":()=>nn(()=>import("./Index.fdd4b3f1.js"),["assets/Index.fdd4b3f1.js","assets/Table.5ca6e4fc.js","assets/Actions.312fea0a.js"]),"./Pages/Relations/Form.vue":()=>nn(()=>import("./Form.01a88f8e.js"),["assets/Form.01a88f8e.js","assets/Form.2e661f90.js"]),"./Pages/Relations/Index.vue":()=>nn(()=>import("./Index.4d7adba7.js"),["assets/Index.4d7adba7.js","assets/Table.5ca6e4fc.js","assets/Actions.312fea0a.js"]),"./Pages/Relations/Show.vue":()=>nn(()=>import("./Show.c28251c6.js"),[]),"./Pages/Resources/Form.vue":()=>nn(()=>import("./Form.90c43959.js"),["assets/Form.90c43959.js","assets/Form.2e661f90.js"]),"./Pages/Resources/Index.vue":()=>nn(()=>import("./Index.f053e239.js"),["assets/Index.f053e239.js","assets/Table.5ca6e4fc.js","assets/Actions.312fea0a.js"]),"./Pages/Resources/Show.vue":()=>nn(()=>import("./Show.695e0034.js"),["assets/Show.695e0034.js","assets/Actions.312fea0a.js"])})).catch(()=>new Promise((t,n)=>{t(ke(e))})).then(t=>(t.default.resolveDefaultLayout=()=>q_,t)),setup({el:e,App:t,props:n,plugin:r}){const i=Bc({render:()=>Ri(t,n)});i.use(r),i.use(NE,window.Root),document.dispatchEvent(new CustomEvent("root:booting",{detail:{app:i}}));const o=i.mount(e);document.dispatchEvent(new CustomEvent("root:booted",{detail:{app:i,instance:o}}))}});export{pn as C,Me as F,Ii as L,PE as W,Le as _,ot as a,Et as b,fe as c,X as d,je as e,Oe as f,Ye as g,wt as h,vs as i,mt as j,Wo as k,Qn as l,dt as m,we as n,se as o,ke as r,pe as t,qr as v,Tt as w}; diff --git a/public/build/manifest.json b/public/build/manifest.json index 35ffe391..6b9c0bd7 100644 --- a/public/build/manifest.json +++ b/public/build/manifest.json @@ -1,6 +1,6 @@ { "resources/js/app.js": { - "file": "assets/app.fa6c6c43.js", + "file": "assets/app.1185eb56.js", "src": "resources/js/app.js", "isEntry": true, "dynamicImports": [ @@ -16,7 +16,7 @@ ] }, "resources/js/Pages/Dashboard.vue": { - "file": "assets/Dashboard.62d23070.js", + "file": "assets/Dashboard.7e30a98a.js", "src": "resources/js/Pages/Dashboard.vue", "isDynamicEntry": true, "imports": [ @@ -24,7 +24,7 @@ ] }, "resources/js/Pages/Error.vue": { - "file": "assets/Error.fadf721f.js", + "file": "assets/Error.754993f2.js", "src": "resources/js/Pages/Error.vue", "isDynamicEntry": true, "imports": [ @@ -32,55 +32,55 @@ ] }, "resources/js/Pages/Extracts/Index.vue": { - "file": "assets/Index.f789e89b.js", + "file": "assets/Index.fdd4b3f1.js", "src": "resources/js/Pages/Extracts/Index.vue", "isDynamicEntry": true, "imports": [ - "_Table.65514b14.js", + "_Table.5ca6e4fc.js", "resources/js/app.js", - "_Actions.11134f97.js" + "_Actions.312fea0a.js" ] }, - "_Table.65514b14.js": { - "file": "assets/Table.65514b14.js", + "_Table.5ca6e4fc.js": { + "file": "assets/Table.5ca6e4fc.js", "imports": [ - "_Actions.11134f97.js", + "_Actions.312fea0a.js", "resources/js/app.js" ] }, - "_Actions.11134f97.js": { - "file": "assets/Actions.11134f97.js", + "_Actions.312fea0a.js": { + "file": "assets/Actions.312fea0a.js", "imports": [ "resources/js/app.js" ] }, "resources/js/Pages/Relations/Form.vue": { - "file": "assets/Form.50517212.js", + "file": "assets/Form.01a88f8e.js", "src": "resources/js/Pages/Relations/Form.vue", "isDynamicEntry": true, "imports": [ - "_Form.613d7faf.js", + "_Form.2e661f90.js", "resources/js/app.js" ] }, - "_Form.613d7faf.js": { - "file": "assets/Form.613d7faf.js", + "_Form.2e661f90.js": { + "file": "assets/Form.2e661f90.js", "imports": [ "resources/js/app.js" ] }, "resources/js/Pages/Relations/Index.vue": { - "file": "assets/Index.1735a2c5.js", + "file": "assets/Index.4d7adba7.js", "src": "resources/js/Pages/Relations/Index.vue", "isDynamicEntry": true, "imports": [ "resources/js/app.js", - "_Table.65514b14.js", - "_Actions.11134f97.js" + "_Table.5ca6e4fc.js", + "_Actions.312fea0a.js" ] }, "resources/js/Pages/Relations/Show.vue": { - "file": "assets/Show.3bdc90f3.js", + "file": "assets/Show.c28251c6.js", "src": "resources/js/Pages/Relations/Show.vue", "isDynamicEntry": true, "imports": [ @@ -88,31 +88,31 @@ ] }, "resources/js/Pages/Resources/Form.vue": { - "file": "assets/Form.fd558b22.js", + "file": "assets/Form.90c43959.js", "src": "resources/js/Pages/Resources/Form.vue", "isDynamicEntry": true, "imports": [ - "_Form.613d7faf.js", + "_Form.2e661f90.js", "resources/js/app.js" ] }, "resources/js/Pages/Resources/Index.vue": { - "file": "assets/Index.716ca1a5.js", + "file": "assets/Index.f053e239.js", "src": "resources/js/Pages/Resources/Index.vue", "isDynamicEntry": true, "imports": [ - "_Table.65514b14.js", + "_Table.5ca6e4fc.js", "resources/js/app.js", - "_Actions.11134f97.js" + "_Actions.312fea0a.js" ] }, "resources/js/Pages/Resources/Show.vue": { - "file": "assets/Show.55e23a01.js", + "file": "assets/Show.695e0034.js", "src": "resources/js/Pages/Resources/Show.vue", "isDynamicEntry": true, "imports": [ "resources/js/app.js", - "_Actions.11134f97.js" + "_Actions.312fea0a.js" ] }, "resources/sass/app.scss": { diff --git a/resources/js/Components/Notifications/Notification.vue b/resources/js/Components/Notifications/Notification.vue index c02ff9b2..c83eb08c 100644 --- a/resources/js/Components/Notifications/Notification.vue +++ b/resources/js/Components/Notifications/Notification.vue @@ -39,7 +39,7 @@ read() { this.processing = true; - this.$http.patch(`/api/notifications/${this.notification.id}`).then((response) => { + this.$http.patch(`${this.$parent.url}/${this.notification.id}`).then((response) => { Object.assign(this.notification, response.data); this.$parent.response.total_unread--; }).catch((error) => { diff --git a/resources/js/Components/Notifications/Notifications.vue b/resources/js/Components/Notifications/Notifications.vue index 2d0c4fbe..5ed6257f 100644 --- a/resources/js/Components/Notifications/Notifications.vue +++ b/resources/js/Components/Notifications/Notifications.vue @@ -66,11 +66,17 @@ }; }, + computed: { + url() { + return (window.Root.config.url + '/api/notifications').replaceAll('//', '/'); + }, + }, + methods: { fetch() { this.processing = true; - this.$http.get('/api/notifications').then((response) => { + this.$http.get(this.url).then((response) => { this.response = response.data; }).catch((error) => { // diff --git a/src/Root.php b/src/Root.php index 4a0eb365..d752f970 100644 --- a/src/Root.php +++ b/src/Root.php @@ -15,7 +15,7 @@ abstract class Root * * @var string */ - public const VERSION = '0.8.3'; + public const VERSION = '0.8.4'; /** * The registered callbacks. @@ -33,7 +33,7 @@ abstract class Root public static function shouldRun(Request $request): bool { return $request->getHost() === static::getDomain() - || (! empty(static::getPath()) && str_starts_with($request->getRequestUri(), '/'.static::getPath())); + || (! empty(static::getPath()) && str_starts_with($request->getRequestUri(), static::getPath())); } /**