@opengis/admin 0.1.55 → 0.1.57

Sign up to get free protection for your applications and to get access to all the features.
@@ -33,7 +33,7 @@ Use slot props instead:
33
33
  - Location:`,Te),G({});let Ke;if(Te.path!=null)process.env.NODE_ENV!=="production"&&"params"in Te&&!("name"in Te)&&Object.keys(Te.params).length&&tn(`Path "${Te.path}" was passed with params but they will be ignored. Use a named route alongside params instead.`),Ke=wn({},Te,{path:mg(n,Te.path,je.path).path});else{const At=wn({},Te.params);for(const cn in At)At[cn]==null&&delete At[cn];Ke=wn({},Te,{params:E(At)}),je.params=E(je.params)}const ct=e.resolve(Ke,je),Lt=Te.hash||"";process.env.NODE_ENV!=="production"&&Lt&&!Lt.startsWith("#")&&tn(`A \`hash\` should always start with the character "#". Replace "${Lt}" with "#${Lt}".`),ct.params=S(T(ct.params));const sn=aM(i,wn({},Te,{hash:tM(Lt),path:ct.path})),Dt=r.createHref(sn);return process.env.NODE_ENV!=="production"&&(Dt.startsWith("//")?tn(`Location "${Te}" resolved to "${Dt}". A resolved location cannot start with multiple slashes.`):ct.matched.length||tn(`No match found for location with path "${Te.path!=null?Te.path:Te}"`)),wn({fullPath:sn,hash:Lt,query:i===bb?jM(Te.query):Te.query||{}},ct,{redirectedFrom:void 0,href:Dt})}function ie(Te){return typeof Te=="string"?mg(n,Te,m.value.path):wn({},Te)}function ae(Te,je){if(x!==Te)return fc(8,{from:je,to:Te})}function J(Te){return Ae(Te)}function Ce(Te){return J(wn(ie(Te),{replace:!0}))}function be(Te){const je=Te.matched[Te.matched.length-1];if(je&&je.redirect){const{redirect:Ke}=je;let ct=typeof Ke=="function"?Ke(Te):Ke;if(typeof ct=="string"&&(ct=ct.includes("?")||ct.includes("#")?ct=ie(ct):{path:ct},ct.params={}),process.env.NODE_ENV!=="production"&&ct.path==null&&!("name"in ct))throw tn(`Invalid redirect found:
34
34
  ${JSON.stringify(ct,null,2)}
35
35
  when navigating to "${Te.fullPath}". A redirect must contain a name or path. This will break in production.`),new Error("Invalid redirect");return wn({query:Te.query,hash:Te.hash,params:ct.path!=null?{}:Te.params},ct)}}function Ae(Te,je){const Ke=x=G(Te),ct=m.value,Lt=Te.state,sn=Te.force,Dt=Te.replace===!0,At=be(Ke);if(At)return Ae(wn(ie(At),{state:typeof At=="object"?wn({},Lt,At.state):Lt,force:sn,replace:Dt}),je||Ke);const cn=Ke;cn.redirectedFrom=je;let ke;return!sn&&sb(i,ct,Ke)&&(ke=fc(16,{to:cn,from:ct}),En(ct,ct,!0,!1)),(ke?Promise.resolve(ke):Xe(cn,ct)).catch(Cn=>vo(Cn)?vo(Cn,2)?Cn:Mt(Cn):Kt(Cn,cn,ct)).then(Cn=>{if(Cn){if(vo(Cn,2))return process.env.NODE_ENV!=="production"&&sb(i,G(Cn.to),cn)&&je&&(je._count=je._count?je._count+1:1)>30?(tn(`Detected a possibly infinite redirection in a navigation guard when going from "${ct.fullPath}" to "${cn.fullPath}". Aborting to avoid a Stack Overflow.
36
- Are you always returning a new location within a navigation guard? That would lead to this error. Only return when redirecting or aborting, that should fix this. This might break in production if not fixed.`),Promise.reject(new Error("Infinite redirect in navigation guard"))):Ae(wn({replace:Dt},ie(Cn.to),{state:typeof Cn.to=="object"?wn({},Lt,Cn.to.state):Lt,force:sn}),je||cn)}else Cn=Bt(cn,ct,!0,Dt,Lt);return rt(cn,ct,Cn),Cn})}function Fe(Te,je){const Ke=ae(Te,je);return Ke?Promise.reject(Ke):Promise.resolve()}function Pe(Te){const je=Rn.values().next().value;return je&&typeof je.runWithContext=="function"?je.runWithContext(Te):Te()}function Xe(Te,je){let Ke;const[ct,Lt,sn]=cA(Te,je);Ke=vg(ct.reverse(),"beforeRouteLeave",Te,je);for(const At of ct)At.leaveGuards.forEach(cn=>{Ke.push(oa(cn,Te,je))});const Dt=Fe.bind(null,Te,je);return Ke.push(Dt),qn(Ke).then(()=>{Ke=[];for(const At of a.list())Ke.push(oa(At,Te,je));return Ke.push(Dt),qn(Ke)}).then(()=>{Ke=vg(Lt,"beforeRouteUpdate",Te,je);for(const At of Lt)At.updateGuards.forEach(cn=>{Ke.push(oa(cn,Te,je))});return Ke.push(Dt),qn(Ke)}).then(()=>{Ke=[];for(const At of sn)if(At.beforeEnter)if(Hr(At.beforeEnter))for(const cn of At.beforeEnter)Ke.push(oa(cn,Te,je));else Ke.push(oa(At.beforeEnter,Te,je));return Ke.push(Dt),qn(Ke)}).then(()=>(Te.matched.forEach(At=>At.enterCallbacks={}),Ke=vg(sn,"beforeRouteEnter",Te,je,Pe),Ke.push(Dt),qn(Ke))).then(()=>{Ke=[];for(const At of u.list())Ke.push(oa(At,Te,je));return Ke.push(Dt),qn(Ke)}).catch(At=>vo(At,8)?At:Promise.reject(At))}function rt(Te,je,Ke){l.list().forEach(ct=>Pe(()=>ct(Te,je,Ke)))}function Bt(Te,je,Ke,ct,Lt){const sn=ae(Te,je);if(sn)return sn;const Dt=je===sa,At=bo?history.state:{};Ke&&(ct||Dt?r.replace(Te.fullPath,wn({scroll:Dt&&At&&At.scroll},Lt)):r.push(Te.fullPath,Lt)),m.value=Te,En(Te,je,Ke,Dt),Mt()}let dt;function Nt(){dt||(dt=r.listen((Te,je,Ke)=>{if(!Pn.listening)return;const ct=G(Te),Lt=be(ct);if(Lt){Ae(wn(Lt,{replace:!0}),ct).catch(Ju);return}x=ct;const sn=m.value;bo&&mM(lb(sn.fullPath,Ke.delta),dp()),Xe(ct,sn).catch(Dt=>vo(Dt,12)?Dt:vo(Dt,2)?(Ae(Dt.to,ct).then(At=>{vo(At,20)&&!Ke.delta&&Ke.type===Qu.pop&&r.go(-1,!1)}).catch(Ju),Promise.reject()):(Ke.delta&&r.go(-Ke.delta,!1),Kt(Dt,ct,sn))).then(Dt=>{Dt=Dt||Bt(ct,sn,!1),Dt&&(Ke.delta&&!vo(Dt,8)?r.go(-Ke.delta,!1):Ke.type===Qu.pop&&vo(Dt,20)&&r.go(-1,!1)),rt(ct,sn,Dt)}).catch(Ju)}))}let Xt=th(),rn=th(),jt;function Kt(Te,je,Ke){Mt(Te);const ct=rn.list();return ct.length?ct.forEach(Lt=>Lt(Te,je,Ke)):(process.env.NODE_ENV!=="production"&&tn("uncaught error during route navigation:"),console.error(Te)),Promise.reject(Te)}function Sn(){return jt&&m.value!==sa?Promise.resolve():new Promise((Te,je)=>{Xt.add([Te,je])})}function Mt(Te){return jt||(jt=!Te,Nt(),Xt.list().forEach(([je,Ke])=>Te?Ke(Te):je()),Xt.reset()),Te}function En(Te,je,Ke,ct){const{scrollBehavior:Lt}=t;if(!bo||!Lt)return Promise.resolve();const sn=!Ke&&gM(lb(Te.fullPath,0))||(ct||!Ke)&&history.state&&history.state.scroll||null;return _.nextTick().then(()=>Lt(Te,je,sn)).then(Dt=>Dt&&fM(Dt)).catch(Dt=>Kt(Dt,Te,je))}const dn=Te=>r.go(Te);let ti;const Rn=new Set,Pn={currentRoute:m,listening:!0,addRoute:I,removeRoute:z,clearRoutes:e.clearRoutes,hasRoute:j,getRoutes:F,resolve:G,options:t,push:J,replace:Ce,go:dn,back:()=>dn(-1),forward:()=>dn(1),beforeEach:a.add,beforeResolve:u.add,afterEach:l.add,onError:rn.add,isReady:Sn,install(Te){const je=this;Te.component("RouterLink",qM),Te.component("RouterView",YM),Te.config.globalProperties.$router=je,Object.defineProperty(Te.config.globalProperties,"$route",{enumerable:!0,get:()=>_.unref(m)}),bo&&!ti&&m.value===sa&&(ti=!0,J(r.location).catch(Lt=>{process.env.NODE_ENV!=="production"&&tn("Unexpected error when starting the router:",Lt)}));const Ke={};for(const Lt in sa)Object.defineProperty(Ke,Lt,{get:()=>m.value[Lt],enumerable:!0});Te.provide(xg,je),Te.provide(wb,_.shallowReactive(Ke)),Te.provide(bg,m);const ct=Te.unmount;Rn.add(Te),Te.unmount=function(){Rn.delete(Te),Rn.size<1&&(x=sa,dt&&dt(),dt=null,m.value=sa,ti=!1,jt=!1),ct()},process.env.NODE_ENV!=="production"&&bo&&JM(Te,je,e)}};function qn(Te){return Te.reduce((je,Ke)=>je.then(()=>Pe(Ke)),Promise.resolve())}return Pn}function cA(t,e){const n=[],i=[],r=[],a=Math.max(e.matched.length,t.matched.length);for(let u=0;u<a;u++){const l=e.matched[u];l&&(t.matched.find(x=>ra(x,l))?i.push(l):n.push(l));const m=t.matched[u];m&&(e.matched.find(x=>ra(x,m))||r.push(m))}return[n,i,r]}const uA=[{name:"edit",path:"/edit",component:()=>Promise.resolve().then(()=>F8)},{name:"add",path:"/add",component:()=>Promise.resolve().then(()=>Z8)},{name:"card-view",path:"/card",component:()=>Promise.resolve().then(()=>kS),children:[{name:"table",path:":table",component:()=>Promise.resolve().then(()=>kS),children:[{name:"card",path:":id",component:()=>Promise.resolve().then(()=>_j)}]}]}],hA={},dA={class:"bg-gray-200 w-full px-16 md:px-0 h-screen flex items-center justify-center"},pA={class:"bg-white border border-gray-200 flex flex-col items-center justify-center px-4 md:px-8 lg:px-24 py-8 rounded-lg shadow-2xl"};function fA(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("div",dA,[_.createElementVNode("div",pA,[e[2]||(e[2]=_.createElementVNode("p",{class:"text-6xl md:text-7xl lg:text-9xl font-bold tracking-wider text-gray-300"}," 404 ",-1)),e[3]||(e[3]=_.createElementVNode("p",{class:"text-2xl md:text-3xl lg:text-5xl font-bold tracking-wider text-gray-500 mt-4"}," Сторінку не знайдено ",-1)),e[4]||(e[4]=_.createElementVNode("p",{class:"text-gray-500 mt-4 pb-4 border-b-2 text-center"}," Вибачте, така сторінка не існує ",-1)),_.createElementVNode("div",{onClick:e[0]||(e[0]=u=>t.$router.push("/")),class:"flex cursor-pointer items-center space-x-2 bg-blue-600 hover:bg-blue-700 text-gray-100 px-4 py-2 mt-6 rounded transition duration-150",title:"Return Home"},e[1]||(e[1]=[_.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},[_.createElementVNode("path",{"fill-rule":"evenodd",d:"M9.707 14.707a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 1.414L7.414 9H15a1 1 0 110 2H7.414l2.293 2.293a1 1 0 010 1.414z","clip-rule":"evenodd"})],-1),_.createElementVNode("span",null,"Повернутись на головну",-1)]))])])}const mA=Ge(hA,[["render",fA]]),gA=t=>{const e=uA.map(i=>({...i}));return{router:lA({history:bM(),routes:[{path:"/404",name:"404",component:mA},{path:"/",name:"home",component:()=>Promise.resolve().then(()=>S7),children:[...e,...t,{path:"/:catchAll(.*)",component:()=>Promise.resolve().then(()=>WU)}]}]}),routerData:e}},yA={props:{value:{type:null,default:()=>""},data:{type:Object},table:{type:String},name:String,edit:{type:null,default:()=>!1}},methods:{async changeData(t){var e;try{await vt.put(`/api/table/${this.table}/${(e=this.data)==null?void 0:e.id}`,{...this.data,[this.name]:t}),await this.$emit("update-table")}catch(n){console.log(n)}}}},_A={class:"underline text-start decoration-dashed"},xA={key:1,class:"text-start"};function bA(t,e,n,i,r,a){const u=_.resolveComponent("VsInlineEdit");return n.edit?(_.openBlock(),_.createBlock(u,{key:0,"model-value":n.value,onUpdateValue:a.changeData},{default:_.withCtx(()=>[_.createElementVNode("button",_A,_.toDisplayString(n.value),1)]),_:1},8,["model-value","onUpdateValue"])):(_.openBlock(),_.createElementBlock("div",xA,_.toDisplayString(n.value),1))}const zb=Ge(yA,[["render",bA]]),vA={props:{value:{type:[String,Number],default:()=>""},data:Object,name:String},computed:{getData(){var t;return(t=this.data)==null?void 0:t[this.name+"_data"]}},methods:{getBGColor(t){if(t!=null&&t.includes("#")){let e;if(/^#([A-Fa-f0-9]{3}){1,2}$/.test(t))return e=t.substring(1).split(""),e.length==3&&(e=[e[0],e[0],e[1],e[1],e[2],e[2]]),e="0x"+e.join(""),"rgba("+[e>>16&255,e>>8&255,e&255].join(",")+",0.2)";throw new Error("Bad Hex")}else if(typeof t=="string"){const e=document.createElement("div");e.style.color=t,document.body.appendChild(e);const n=getComputedStyle(e).color;return document.body.removeChild(e),n.replace("rgb","rgba").replace(")",", 0.2)")}else throw new Error("Invalid color format")}}},wA={class:"flex justify-start w-full"},kA={key:1};function SA(t,e,n,i,r,a){var u,l,m;return _.openBlock(),_.createElementBlock("div",wA,[a.getData?(_.openBlock(),_.createElementBlock("div",{key:0,class:"p-2 ps-1.5 px-2 inline-flex items-center gap-x-1.5 text-xs font-medium text-black rounded-full",style:_.normalizeStyle({backgroundColor:a.getBGColor((u=a.getData)==null?void 0:u.color),color:(l=a.getData)==null?void 0:l.color})},_.toDisplayString((m=a.getData)==null?void 0:m.text),5)):(_.openBlock(),_.createElementBlock("div",kA,"-"))])}const EA=Ge(vA,[["render",SA]]),CA={},TA={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-check"};function MA(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("svg",TA,e[0]||(e[0]=[_.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),_.createElementVNode("path",{d:"M5 12l5 5l10 -10"},null,-1)]))}const Nb=Ge(CA,[["render",MA]]),AA={components:{IconCheck:Nb},props:{value:Boolean}},IA={class:"px-[20px]"},PA={key:1};function DA(t,e,n,i,r,a){const u=_.resolveComponent("IconCheck");return _.openBlock(),_.createElementBlock("div",IA,[n.value?(_.openBlock(),_.createBlock(u,{key:0,height:"24",width:"24",class:"text-blue-500"})):(_.openBlock(),_.createElementBlock("div",PA))])}const Rb=Ge(AA,[["render",DA]]),OA={props:{data:Object,name:String},computed:{getData(){var t,e,n;return((e=(t=this.data)==null?void 0:t[this.name+"_data"])==null?void 0:e.text)||((n=this.data)==null?void 0:n[this.name+"_text"])}}},zA={class:""},NA={key:0},RA={key:1},BA={key:1};function LA(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("div",zA,[a.getData?(_.openBlock(),_.createElementBlock("div",NA,[typeof a.getData=="object"?(_.openBlock(!0),_.createElementBlock(_.Fragment,{key:0},_.renderList(a.getData,(u,l)=>(_.openBlock(),_.createElementBlock("div",{key:l},_.toDisplayString(u),1))),128)):(_.openBlock(),_.createElementBlock("div",RA,_.toDisplayString(a.getData),1))])):(_.openBlock(),_.createElementBlock("div",BA,"-"))])}const VA=Ge(OA,[["render",LA]]),FA={props:{value:{type:[String,Number],default:()=>""},data:Object,name:String},computed:{getData(){var t,e;return((t=this.data)==null?void 0:t[this.name])||((e=this.data)==null?void 0:e[this.name+"_data"])}},methods:{}},$A={class:"w-full flex justify-start"},jA={key:0,class:"js-clipboard [--is-toggle-tooltip:false] hs-tooltip p-2 bg-stone-100 text-stone-800 text-xs rounded-md cursor-pointer"},UA={key:1};function HA(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("div",$A,[a.getData?(_.openBlock(),_.createElementBlock("div",jA,_.toDisplayString(a.getData),1)):(_.openBlock(),_.createElementBlock("div",UA,"-"))])}const qA=Ge(FA,[["render",HA]]);//! moment.js
36
+ Are you always returning a new location within a navigation guard? That would lead to this error. Only return when redirecting or aborting, that should fix this. This might break in production if not fixed.`),Promise.reject(new Error("Infinite redirect in navigation guard"))):Ae(wn({replace:Dt},ie(Cn.to),{state:typeof Cn.to=="object"?wn({},Lt,Cn.to.state):Lt,force:sn}),je||cn)}else Cn=Bt(cn,ct,!0,Dt,Lt);return rt(cn,ct,Cn),Cn})}function Fe(Te,je){const Ke=ae(Te,je);return Ke?Promise.reject(Ke):Promise.resolve()}function Pe(Te){const je=Rn.values().next().value;return je&&typeof je.runWithContext=="function"?je.runWithContext(Te):Te()}function Xe(Te,je){let Ke;const[ct,Lt,sn]=cA(Te,je);Ke=vg(ct.reverse(),"beforeRouteLeave",Te,je);for(const At of ct)At.leaveGuards.forEach(cn=>{Ke.push(oa(cn,Te,je))});const Dt=Fe.bind(null,Te,je);return Ke.push(Dt),qn(Ke).then(()=>{Ke=[];for(const At of a.list())Ke.push(oa(At,Te,je));return Ke.push(Dt),qn(Ke)}).then(()=>{Ke=vg(Lt,"beforeRouteUpdate",Te,je);for(const At of Lt)At.updateGuards.forEach(cn=>{Ke.push(oa(cn,Te,je))});return Ke.push(Dt),qn(Ke)}).then(()=>{Ke=[];for(const At of sn)if(At.beforeEnter)if(Hr(At.beforeEnter))for(const cn of At.beforeEnter)Ke.push(oa(cn,Te,je));else Ke.push(oa(At.beforeEnter,Te,je));return Ke.push(Dt),qn(Ke)}).then(()=>(Te.matched.forEach(At=>At.enterCallbacks={}),Ke=vg(sn,"beforeRouteEnter",Te,je,Pe),Ke.push(Dt),qn(Ke))).then(()=>{Ke=[];for(const At of u.list())Ke.push(oa(At,Te,je));return Ke.push(Dt),qn(Ke)}).catch(At=>vo(At,8)?At:Promise.reject(At))}function rt(Te,je,Ke){l.list().forEach(ct=>Pe(()=>ct(Te,je,Ke)))}function Bt(Te,je,Ke,ct,Lt){const sn=ae(Te,je);if(sn)return sn;const Dt=je===sa,At=bo?history.state:{};Ke&&(ct||Dt?r.replace(Te.fullPath,wn({scroll:Dt&&At&&At.scroll},Lt)):r.push(Te.fullPath,Lt)),m.value=Te,En(Te,je,Ke,Dt),Mt()}let dt;function Nt(){dt||(dt=r.listen((Te,je,Ke)=>{if(!Pn.listening)return;const ct=G(Te),Lt=be(ct);if(Lt){Ae(wn(Lt,{replace:!0}),ct).catch(Ju);return}x=ct;const sn=m.value;bo&&mM(lb(sn.fullPath,Ke.delta),dp()),Xe(ct,sn).catch(Dt=>vo(Dt,12)?Dt:vo(Dt,2)?(Ae(Dt.to,ct).then(At=>{vo(At,20)&&!Ke.delta&&Ke.type===Qu.pop&&r.go(-1,!1)}).catch(Ju),Promise.reject()):(Ke.delta&&r.go(-Ke.delta,!1),Kt(Dt,ct,sn))).then(Dt=>{Dt=Dt||Bt(ct,sn,!1),Dt&&(Ke.delta&&!vo(Dt,8)?r.go(-Ke.delta,!1):Ke.type===Qu.pop&&vo(Dt,20)&&r.go(-1,!1)),rt(ct,sn,Dt)}).catch(Ju)}))}let Xt=th(),rn=th(),jt;function Kt(Te,je,Ke){Mt(Te);const ct=rn.list();return ct.length?ct.forEach(Lt=>Lt(Te,je,Ke)):(process.env.NODE_ENV!=="production"&&tn("uncaught error during route navigation:"),console.error(Te)),Promise.reject(Te)}function Sn(){return jt&&m.value!==sa?Promise.resolve():new Promise((Te,je)=>{Xt.add([Te,je])})}function Mt(Te){return jt||(jt=!Te,Nt(),Xt.list().forEach(([je,Ke])=>Te?Ke(Te):je()),Xt.reset()),Te}function En(Te,je,Ke,ct){const{scrollBehavior:Lt}=t;if(!bo||!Lt)return Promise.resolve();const sn=!Ke&&gM(lb(Te.fullPath,0))||(ct||!Ke)&&history.state&&history.state.scroll||null;return _.nextTick().then(()=>Lt(Te,je,sn)).then(Dt=>Dt&&fM(Dt)).catch(Dt=>Kt(Dt,Te,je))}const dn=Te=>r.go(Te);let ti;const Rn=new Set,Pn={currentRoute:m,listening:!0,addRoute:I,removeRoute:z,clearRoutes:e.clearRoutes,hasRoute:j,getRoutes:F,resolve:G,options:t,push:J,replace:Ce,go:dn,back:()=>dn(-1),forward:()=>dn(1),beforeEach:a.add,beforeResolve:u.add,afterEach:l.add,onError:rn.add,isReady:Sn,install(Te){const je=this;Te.component("RouterLink",qM),Te.component("RouterView",YM),Te.config.globalProperties.$router=je,Object.defineProperty(Te.config.globalProperties,"$route",{enumerable:!0,get:()=>_.unref(m)}),bo&&!ti&&m.value===sa&&(ti=!0,J(r.location).catch(Lt=>{process.env.NODE_ENV!=="production"&&tn("Unexpected error when starting the router:",Lt)}));const Ke={};for(const Lt in sa)Object.defineProperty(Ke,Lt,{get:()=>m.value[Lt],enumerable:!0});Te.provide(xg,je),Te.provide(wb,_.shallowReactive(Ke)),Te.provide(bg,m);const ct=Te.unmount;Rn.add(Te),Te.unmount=function(){Rn.delete(Te),Rn.size<1&&(x=sa,dt&&dt(),dt=null,m.value=sa,ti=!1,jt=!1),ct()},process.env.NODE_ENV!=="production"&&bo&&JM(Te,je,e)}};function qn(Te){return Te.reduce((je,Ke)=>je.then(()=>Pe(Ke)),Promise.resolve())}return Pn}function cA(t,e){const n=[],i=[],r=[],a=Math.max(e.matched.length,t.matched.length);for(let u=0;u<a;u++){const l=e.matched[u];l&&(t.matched.find(x=>ra(x,l))?i.push(l):n.push(l));const m=t.matched[u];m&&(e.matched.find(x=>ra(x,m))||r.push(m))}return[n,i,r]}const uA=[{name:"edit",path:"/edit",component:()=>Promise.resolve().then(()=>F8)},{name:"add",path:"/add",component:()=>Promise.resolve().then(()=>Z8)},{name:"card-view",path:"/card",component:()=>Promise.resolve().then(()=>kS),children:[{name:"table",path:":table",component:()=>Promise.resolve().then(()=>kS),children:[{name:"card",path:":id",component:()=>Promise.resolve().then(()=>_j)}]}]}],hA={},dA={class:"bg-gray-200 w-full px-16 md:px-0 h-screen flex items-center justify-center"},pA={class:"bg-white border border-gray-200 flex flex-col items-center justify-center px-4 md:px-8 lg:px-24 py-8 rounded-lg shadow-2xl"};function fA(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("div",dA,[_.createElementVNode("div",pA,[e[2]||(e[2]=_.createElementVNode("p",{class:"text-6xl md:text-7xl lg:text-9xl font-bold tracking-wider text-gray-300"}," 404 ",-1)),e[3]||(e[3]=_.createElementVNode("p",{class:"text-2xl md:text-3xl lg:text-5xl font-bold tracking-wider text-gray-500 mt-4"}," Сторінку не знайдено ",-1)),e[4]||(e[4]=_.createElementVNode("p",{class:"text-gray-500 mt-4 pb-4 border-b-2 text-center"}," Вибачте, така сторінка не існує ",-1)),_.createElementVNode("div",{onClick:e[0]||(e[0]=u=>t.$router.push("/")),class:"flex cursor-pointer items-center space-x-2 bg-blue-600 hover:bg-blue-700 text-gray-100 px-4 py-2 mt-6 rounded transition duration-150",title:"Return Home"},e[1]||(e[1]=[_.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},[_.createElementVNode("path",{"fill-rule":"evenodd",d:"M9.707 14.707a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 1.414L7.414 9H15a1 1 0 110 2H7.414l2.293 2.293a1 1 0 010 1.414z","clip-rule":"evenodd"})],-1),_.createElementVNode("span",null,"Повернутись на головну",-1)]))])])}const mA=Ge(hA,[["render",fA]]),gA=t=>{const e=uA.map(i=>({...i}));return{router:lA({history:bM(),routes:[{path:"/404",name:"404",component:mA},{path:"/",name:"home",component:()=>Promise.resolve().then(()=>S7),children:[...e,...t,{path:"/:catchAll(.*)",component:()=>Promise.resolve().then(()=>WU)}]}]}),routerData:e}},yA={props:{value:{type:null,default:()=>""},data:{type:Object},table:{type:String},name:String,edit:{type:null,default:()=>!1}},methods:{async changeData(t){var e;try{await vt.put(`/api/table/${this.table}/${(e=this.data)==null?void 0:e.id}`,{...this.data,[this.name]:t}),await this.$emit("update-table")}catch(n){console.log(n)}}}},_A={class:"underline text-start decoration-dashed"},xA={key:1,class:"text-start"};function bA(t,e,n,i,r,a){const u=_.resolveComponent("VsInlineEdit");return n.edit?(_.openBlock(),_.createBlock(u,{key:0,"model-value":n.value,onUpdateValue:a.changeData},{default:_.withCtx(()=>[_.createElementVNode("button",_A,_.toDisplayString(n.value),1)]),_:1},8,["model-value","onUpdateValue"])):(_.openBlock(),_.createElementBlock("div",xA,_.toDisplayString(n.value),1))}const zb=Ge(yA,[["render",bA]]),vA={props:{value:{type:[String,Number],default:()=>""},data:Object,name:String},computed:{getData(){var t;return(t=this.data)==null?void 0:t[this.name+"_data"]}},methods:{getBGColor(t){if(t!=null&&t.includes("#")){let e;if(/^#([A-Fa-f0-9]{3}){1,2}$/.test(t))return e=t.substring(1).split(""),e.length==3&&(e=[e[0],e[0],e[1],e[1],e[2],e[2]]),e="0x"+e.join(""),"rgba("+[e>>16&255,e>>8&255,e&255].join(",")+",0.2)";throw new Error("Bad Hex")}else if(typeof t=="string"){const e=document.createElement("div");e.style.color=t,document.body.appendChild(e);const n=getComputedStyle(e).color;return document.body.removeChild(e),n.replace("rgb","rgba").replace(")",", 0.2)")}else throw new Error("Invalid color format")}}},wA={class:"flex justify-start w-full"},kA={key:1};function SA(t,e,n,i,r,a){var u,l,m;return _.openBlock(),_.createElementBlock("div",wA,[a.getData?(_.openBlock(),_.createElementBlock("div",{key:0,class:"py-1 px-2.5 inline-flex items-center gap-x-1.5 text-xs font-medium bg-green-100 text-green-800 rounded-full",style:_.normalizeStyle({backgroundColor:a.getBGColor((u=a.getData)==null?void 0:u.color),color:(l=a.getData)==null?void 0:l.color})},_.toDisplayString((m=a.getData)==null?void 0:m.text),5)):(_.openBlock(),_.createElementBlock("div",kA,"-"))])}const EA=Ge(vA,[["render",SA]]),CA={},TA={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-check"};function MA(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("svg",TA,e[0]||(e[0]=[_.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),_.createElementVNode("path",{d:"M5 12l5 5l10 -10"},null,-1)]))}const Nb=Ge(CA,[["render",MA]]),AA={components:{IconCheck:Nb},props:{value:Boolean}},IA={class:"px-[20px]"},PA={key:1};function DA(t,e,n,i,r,a){const u=_.resolveComponent("IconCheck");return _.openBlock(),_.createElementBlock("div",IA,[n.value?(_.openBlock(),_.createBlock(u,{key:0,height:"24",width:"24",class:"text-blue-500"})):(_.openBlock(),_.createElementBlock("div",PA))])}const Rb=Ge(AA,[["render",DA]]),OA={props:{data:Object,name:String},computed:{getData(){var t,e,n;return((e=(t=this.data)==null?void 0:t[this.name+"_data"])==null?void 0:e.text)||((n=this.data)==null?void 0:n[this.name+"_text"])}}},zA={class:""},NA={key:0},RA={key:1},BA={key:1};function LA(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("div",zA,[a.getData?(_.openBlock(),_.createElementBlock("div",NA,[typeof a.getData=="object"?(_.openBlock(!0),_.createElementBlock(_.Fragment,{key:0},_.renderList(a.getData,(u,l)=>(_.openBlock(),_.createElementBlock("div",{key:l},_.toDisplayString(u),1))),128)):(_.openBlock(),_.createElementBlock("div",RA,_.toDisplayString(a.getData),1))])):(_.openBlock(),_.createElementBlock("div",BA,"-"))])}const VA=Ge(OA,[["render",LA]]),FA={props:{value:{type:[String,Number],default:()=>""},data:Object,name:String},computed:{getData(){var t,e;return((t=this.data)==null?void 0:t[this.name])||((e=this.data)==null?void 0:e[this.name+"_data"])}},methods:{}},$A={class:"w-full flex justify-start"},jA={key:0,class:"js-clipboard [--is-toggle-tooltip:false] hs-tooltip p-2 bg-stone-100 text-stone-800 text-xs rounded-md cursor-pointer"},UA={key:1};function HA(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("div",$A,[a.getData?(_.openBlock(),_.createElementBlock("div",jA,_.toDisplayString(a.getData),1)):(_.openBlock(),_.createElementBlock("div",UA,"-"))])}const qA=Ge(FA,[["render",HA]]);//! moment.js
37
37
  //! version : 2.30.1
38
38
  //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
39
39
  //! license : MIT
@@ -738,4 +738,4 @@ img.ProseMirror-separator {
738
738
 
739
739
  `);return!a||!u?!1:t.chain().command(({tr:l})=>(l.delete(i.pos-2,i.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:i}=e,{$from:r,empty:a}=n;if(!a||r.parent.type!==this.type||!(r.parentOffset===r.parent.nodeSize-2))return!1;const l=r.after();return l===void 0?!1:i.nodeAt(l)?t.commands.command(({tr:x})=>(x.setSelection(Gt.near(i.resolve(l))),!0)):t.commands.exitCode()}}},addInputRules(){return[E0({find:QV,type:this.type,getAttributes:t=>({language:t[1]})}),E0({find:eF,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new Fi({key:new Mr("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),i=e.clipboardData.getData("vscode-editor-data"),r=i?JSON.parse(i):void 0,a=r==null?void 0:r.mode;if(!n||!a)return!1;const{tr:u,schema:l}=t.state,m=l.text(n.replace(/\r\n?/g,`
740
740
  `));return u.replaceSelectionWith(this.type.create({language:a},m)),u.selection.$from.parent.type!==this.type&&u.setSelection(Ft.near(u.doc.resolve(Math.max(0,u.selection.from-2)))),u.setMeta("paste",!0),t.dispatch(u),!0}}})]}}),tF=bs.create({name:"doc",topNode:!0,content:"block+"});function nF(t={}){return new Fi({view(e){return new iF(e,t)}})}class iF{constructor(e,n){var i;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(i=n.width)!==null&&i!==void 0?i:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(r=>{let a=u=>{this[r](u)};return e.dom.addEventListener(r,a),{name:r,handler:a}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,i;if(n){let l=e.nodeBefore,m=e.nodeAfter;if(l||m){let x=this.editorView.nodeDOM(this.cursorPos-(l?l.nodeSize:0));if(x){let S=x.getBoundingClientRect(),E=l?S.bottom:S.top;l&&m&&(E=(E+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),i={left:S.left,right:S.right,top:E-this.width/2,bottom:E+this.width/2}}}}if(!i){let l=this.editorView.coordsAtPos(this.cursorPos);i={left:l.left-this.width/2,right:l.left+this.width/2,top:l.top,bottom:l.bottom}}let r=this.editorView.dom.offsetParent;this.element||(this.element=r.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let a,u;if(!r||r==document.body&&getComputedStyle(r).position=="static")a=-pageXOffset,u=-pageYOffset;else{let l=r.getBoundingClientRect();a=l.left-r.scrollLeft,u=l.top-r.scrollTop}this.element.style.left=i.left-a+"px",this.element.style.top=i.top-u+"px",this.element.style.width=i.right-i.left+"px",this.element.style.height=i.bottom-i.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),i=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),r=i&&i.type.spec.disableDropCursor,a=typeof r=="function"?r(this.editorView,n,e):r;if(n&&!a){let u=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=bw(this.editorView.state.doc,u,this.editorView.dragging.slice);l!=null&&(u=l)}this.setCursor(u),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const rF=Ai.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[nF(this.options)]}});class ri extends Gt{constructor(e){super(e,e)}map(e,n){let i=e.resolve(n.map(this.head));return ri.valid(i)?new ri(i):Gt.near(i)}content(){return ht.empty}eq(e){return e instanceof ri&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new ri(e.resolve(n.pos))}getBookmark(){return new H0(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!sF(e)||!oF(e))return!1;let i=n.type.spec.allowGapCursor;if(i!=null)return i;let r=n.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,n,i=!1){e:for(;;){if(!i&&ri.valid(e))return e;let r=e.pos,a=null;for(let u=e.depth;;u--){let l=e.node(u);if(n>0?e.indexAfter(u)<l.childCount:e.index(u)>0){a=l.child(n>0?e.indexAfter(u):e.index(u)-1);break}else if(u==0)return null;r+=n;let m=e.doc.resolve(r);if(ri.valid(m))return m}for(;;){let u=n>0?a.firstChild:a.lastChild;if(!u){if(a.isAtom&&!a.isText&&!zt.isSelectable(a)){e=e.doc.resolve(r+a.nodeSize*n),i=!1;continue e}break}a=u,r+=n;let l=e.doc.resolve(r);if(ri.valid(l))return l}return null}}}ri.prototype.visible=!1,ri.findFrom=ri.findGapCursorFrom,Gt.jsonID("gapcursor",ri);class H0{constructor(e){this.pos=e}map(e){return new H0(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return ri.valid(n)?new ri(n):Gt.near(n)}}function sF(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),i=t.node(e);if(n==0){if(i.type.spec.isolating)return!0;continue}for(let r=i.child(n-1);;r=r.lastChild){if(r.childCount==0&&!r.inlineContent||r.isAtom||r.type.spec.isolating)return!0;if(r.inlineContent)return!1}}return!0}function oF(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),i=t.node(e);if(n==i.childCount){if(i.type.spec.isolating)return!0;continue}for(let r=i.child(n);;r=r.firstChild){if(r.childCount==0&&!r.inlineContent||r.isAtom||r.type.spec.isolating)return!0;if(r.inlineContent)return!1}}return!0}function aF(){return new Fi({props:{decorations:hF,createSelectionBetween(t,e,n){return e.pos==n.pos&&ri.valid(n)?new ri(n):null},handleClick:cF,handleKeyDown:lF,handleDOMEvents:{beforeinput:uF}}})}const lF=Wk({ArrowLeft:Hf("horiz",-1),ArrowRight:Hf("horiz",1),ArrowUp:Hf("vert",-1),ArrowDown:Hf("vert",1)});function Hf(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(i,r,a){let u=i.selection,l=e>0?u.$to:u.$from,m=u.empty;if(u instanceof Ft){if(!a.endOfTextblock(n)||l.depth==0)return!1;m=!1,l=i.doc.resolve(e>0?l.after():l.before())}let x=ri.findGapCursorFrom(l,e,m);return x?(r&&r(i.tr.setSelection(new ri(x))),!0):!1}}function cF(t,e,n){if(!t||!t.editable)return!1;let i=t.state.doc.resolve(e);if(!ri.valid(i))return!1;let r=t.posAtCoords({left:n.clientX,top:n.clientY});return r&&r.inside>-1&&zt.isSelectable(t.state.doc.nodeAt(r.inside))?!1:(t.dispatch(t.state.tr.setSelection(new ri(i))),!0)}function uF(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof ri))return!1;let{$from:n}=t.state.selection,i=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!i)return!1;let r=Ve.empty;for(let u=i.length-1;u>=0;u--)r=Ve.from(i[u].createAndFill(null,r));let a=t.state.tr.replace(n.pos,n.pos,new ht(r,0,0));return a.setSelection(Ft.near(a.doc.resolve(n.pos+1))),t.dispatch(a),!1}function hF(t){if(!(t.selection instanceof ri))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",pi.create(t.doc,[Gr.widget(t.selection.head,e,{key:"gapcursor"})])}const dF=Ai.create({name:"gapCursor",addProseMirrorPlugins(){return[aF()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=nn(wt(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}}),pF=bs.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",ci(this.options.HTMLAttributes,t)]},renderText(){return`
741
- `},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:i})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:r,storedMarks:a}=n;if(r.$from.parent.type.spec.isolating)return!1;const{keepMarks:u}=this.options,{splittableMarks:l}=i.extensionManager,m=a||r.$to.parentOffset&&r.$from.marks();return e().insertContent({type:this.name}).command(({tr:x,dispatch:S})=>{if(S&&m&&u){const E=m.filter(T=>l.includes(T.type.name));x.ensureMarks(E)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),fF=bs.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,ci(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>E0({find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var qf=200,Ii=function(){};Ii.prototype.append=function(e){return e.length?(e=Ii.from(e),!this.length&&e||e.length<qf&&this.leafAppend(e)||this.length<qf&&e.leafPrepend(this)||this.appendInner(e)):this},Ii.prototype.prepend=function(e){return e.length?Ii.from(e).append(this):this},Ii.prototype.appendInner=function(e){return new mF(this,e)},Ii.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?Ii.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))},Ii.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Ii.prototype.forEach=function(e,n,i){n===void 0&&(n=0),i===void 0&&(i=this.length),n<=i?this.forEachInner(e,n,i,0):this.forEachInvertedInner(e,n,i,0)},Ii.prototype.map=function(e,n,i){n===void 0&&(n=0),i===void 0&&(i=this.length);var r=[];return this.forEach(function(a,u){return r.push(e(a,u))},n,i),r},Ii.from=function(e){return e instanceof Ii?e:e&&e.length?new aS(e):Ii.empty};var aS=function(t){function e(i){t.call(this),this.values=i}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(r,a){return r==0&&a==this.length?this:new e(this.values.slice(r,a))},e.prototype.getInner=function(r){return this.values[r]},e.prototype.forEachInner=function(r,a,u,l){for(var m=a;m<u;m++)if(r(this.values[m],l+m)===!1)return!1},e.prototype.forEachInvertedInner=function(r,a,u,l){for(var m=a-1;m>=u;m--)if(r(this.values[m],l+m)===!1)return!1},e.prototype.leafAppend=function(r){if(this.length+r.length<=qf)return new e(this.values.concat(r.flatten()))},e.prototype.leafPrepend=function(r){if(this.length+r.length<=qf)return new e(r.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Ii);Ii.empty=new aS([]);var mF=function(t){function e(n,i){t.call(this),this.left=n,this.right=i,this.length=n.length+i.length,this.depth=Math.max(n.depth,i.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(i){return i<this.left.length?this.left.get(i):this.right.get(i-this.left.length)},e.prototype.forEachInner=function(i,r,a,u){var l=this.left.length;if(r<l&&this.left.forEachInner(i,r,Math.min(a,l),u)===!1||a>l&&this.right.forEachInner(i,Math.max(r-l,0),Math.min(this.length,a)-l,u+l)===!1)return!1},e.prototype.forEachInvertedInner=function(i,r,a,u){var l=this.left.length;if(r>l&&this.right.forEachInvertedInner(i,r-l,Math.max(a,l)-l,u+l)===!1||a<l&&this.left.forEachInvertedInner(i,Math.min(r,l),a,u)===!1)return!1},e.prototype.sliceInner=function(i,r){if(i==0&&r==this.length)return this;var a=this.left.length;return r<=a?this.left.slice(i,r):i>=a?this.right.slice(i-a,r-a):this.left.slice(i,a).append(this.right.slice(0,r-a))},e.prototype.leafAppend=function(i){var r=this.right.leafAppend(i);if(r)return new e(this.left,r)},e.prototype.leafPrepend=function(i){var r=this.left.leafPrepend(i);if(r)return new e(r,this.right)},e.prototype.appendInner=function(i){return this.left.depth>=Math.max(this.right.depth,i.depth)+1?new e(this.left,new e(this.right,i)):new e(this,i)},e}(Ii);const gF=500;class Us{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let i=this.items.length;for(;;i--)if(this.items.get(i-1).selection){--i;break}let r,a;n&&(r=this.remapping(i,this.items.length),a=r.maps.length);let u=e.tr,l,m,x=[],S=[];return this.items.forEach((E,T)=>{if(!E.step){r||(r=this.remapping(i,T+1),a=r.maps.length),a--,S.push(E);return}if(r){S.push(new uo(E.map));let I=E.step.map(r.slice(a)),z;I&&u.maybeStep(I).doc&&(z=u.mapping.maps[u.mapping.maps.length-1],x.push(new uo(z,void 0,void 0,x.length+S.length))),a--,z&&r.appendMap(z,a)}else u.maybeStep(E.step);if(E.selection)return l=r?E.selection.map(r.slice(a)):E.selection,m=new Us(this.items.slice(0,i).append(S.reverse().concat(x)),this.eventCount-1),!1},this.items.length,0),{remaining:m,transform:u,selection:l}}addTransform(e,n,i,r){let a=[],u=this.eventCount,l=this.items,m=!r&&l.length?l.get(l.length-1):null;for(let S=0;S<e.steps.length;S++){let E=e.steps[S].invert(e.docs[S]),T=new uo(e.mapping.maps[S],E,n),I;(I=m&&m.merge(T))&&(T=I,S?a.pop():l=l.slice(0,l.length-1)),a.push(T),n&&(u++,n=void 0),r||(m=T)}let x=u-i.depth;return x>_F&&(l=yF(l,x),u-=x),new Us(l.append(a),u)}remapping(e,n){let i=new Ic;return this.items.forEach((r,a)=>{let u=r.mirrorOffset!=null&&a-r.mirrorOffset>=e?i.maps.length-r.mirrorOffset:void 0;i.appendMap(r.map,u)},e,n),i}addMaps(e){return this.eventCount==0?this:new Us(this.items.append(e.map(n=>new uo(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let i=[],r=Math.max(0,this.items.length-n),a=e.mapping,u=e.steps.length,l=this.eventCount;this.items.forEach(T=>{T.selection&&l--},r);let m=n;this.items.forEach(T=>{let I=a.getMirror(--m);if(I==null)return;u=Math.min(u,I);let z=a.maps[I];if(T.step){let F=e.steps[I].invert(e.docs[I]),j=T.selection&&T.selection.map(a.slice(m+1,I));j&&l++,i.push(new uo(z,F,j))}else i.push(new uo(z))},r);let x=[];for(let T=n;T<u;T++)x.push(new uo(a.maps[T]));let S=this.items.slice(0,r).append(x).append(i),E=new Us(S,l);return E.emptyItemCount()>gF&&(E=E.compress(this.items.length-i.length)),E}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),i=n.maps.length,r=[],a=0;return this.items.forEach((u,l)=>{if(l>=e)r.push(u),u.selection&&a++;else if(u.step){let m=u.step.map(n.slice(i)),x=m&&m.getMap();if(i--,x&&n.appendMap(x,i),m){let S=u.selection&&u.selection.map(n.slice(i));S&&a++;let E=new uo(x.invert(),m,S),T,I=r.length-1;(T=r.length&&r[I].merge(E))?r[I]=T:r.push(E)}}else u.map&&i--},this.items.length,0),new Us(Ii.from(r.reverse()),a)}}Us.empty=new Us(Ii.empty,0);function yF(t,e){let n;return t.forEach((i,r)=>{if(i.selection&&e--==0)return n=r,!1}),t.slice(n)}class uo{constructor(e,n,i,r){this.map=e,this.step=n,this.selection=i,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new uo(n.getMap().invert(),n,this.selection)}}}class Ta{constructor(e,n,i,r,a){this.done=e,this.undone=n,this.prevRanges=i,this.prevTime=r,this.prevComposition=a}}const _F=20;function xF(t,e,n,i){let r=n.getMeta(Rl),a;if(r)return r.historyState;n.getMeta(wF)&&(t=new Ta(t.done,t.undone,null,0,-1));let u=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(u&&u.getMeta(Rl))return u.getMeta(Rl).redo?new Ta(t.done.addTransform(n,void 0,i,Wf(e)),t.undone,lS(n.mapping.maps),t.prevTime,t.prevComposition):new Ta(t.done,t.undone.addTransform(n,void 0,i,Wf(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(u&&u.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),m=t.prevTime==0||!u&&t.prevComposition!=l&&(t.prevTime<(n.time||0)-i.newGroupDelay||!bF(n,t.prevRanges)),x=u?q0(t.prevRanges,n.mapping):lS(n.mapping.maps);return new Ta(t.done.addTransform(n,m?e.selection.getBookmark():void 0,i,Wf(e)),Us.empty,x,n.time,l??t.prevComposition)}else return(a=n.getMeta("rebased"))?new Ta(t.done.rebased(n,a),t.undone.rebased(n,a),q0(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Ta(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),q0(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function bF(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((i,r)=>{for(let a=0;a<e.length;a+=2)i<=e[a+1]&&r>=e[a]&&(n=!0)}),n}function lS(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((i,r,a,u)=>e.push(a,u));return e}function q0(t,e){if(!t)return null;let n=[];for(let i=0;i<t.length;i+=2){let r=e.map(t[i],1),a=e.map(t[i+1],-1);r<=a&&n.push(r,a)}return n}function vF(t,e,n){let i=Wf(e),r=Rl.get(e).spec.config,a=(n?t.undone:t.done).popEvent(e,i);if(!a)return null;let u=a.selection.resolve(a.transform.doc),l=(n?t.done:t.undone).addTransform(a.transform,e.selection.getBookmark(),r,i),m=new Ta(n?l:a.remaining,n?a.remaining:l,null,0,-1);return a.transform.setSelection(u).setMeta(Rl,{redo:n,historyState:m})}let W0=!1,cS=null;function Wf(t){let e=t.plugins;if(cS!=e){W0=!1,cS=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){W0=!0;break}}return W0}const Rl=new Mr("history"),wF=new Mr("closeHistory");function kF(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Fi({key:Rl,state:{init(){return new Ta(Us.empty,Us.empty,null,0,-1)},apply(e,n,i){return xF(n,i,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let i=n.inputType,r=i=="historyUndo"?hS:i=="historyRedo"?dS:null;return r?(n.preventDefault(),r(e.state,e.dispatch)):!1}}}})}function uS(t,e){return(n,i)=>{let r=Rl.getState(n);if(!r||(t?r.undone:r.done).eventCount==0)return!1;if(i){let a=vF(r,n,t);a&&i(e?a.scrollIntoView():a)}return!0}}const hS=uS(!1,!0),dS=uS(!0,!0),SF=Ai.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>hS(t,e),redo:()=>({state:t,dispatch:e})=>dS(t,e)}},addProseMirrorPlugins(){return[kF(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),EF=bs.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",ci(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{const{selection:n}=e,{$from:i,$to:r}=n,a=t();return i.parentOffset===0?a.insertContentAt({from:Math.max(i.pos-1,0),to:r.pos},{type:this.name}):p2(n)?a.insertContentAt(r.pos,{type:this.name}):a.insertContent({type:this.name}),a.command(({tr:u,dispatch:l})=>{var m;if(l){const{$to:x}=u.selection,S=x.end();if(x.nodeAfter)x.nodeAfter.isTextblock?u.setSelection(Ft.create(u.doc,x.pos+1)):x.nodeAfter.isBlock?u.setSelection(zt.create(u.doc,x.pos)):u.setSelection(Ft.create(u.doc,x.pos));else{const E=(m=x.parent.type.contentMatch.defaultType)===null||m===void 0?void 0:m.create();E&&(u.insert(S,E),u.setSelection(Ft.create(u.doc,S+1)))}u.scrollIntoView()}return!0}).run()}}},addInputRules(){return[i3({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),CF=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,TF=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,MF=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,AF=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,IF=oo.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",ci(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[qc({find:CF,type:this.type}),qc({find:MF,type:this.type})]},addPasteRules(){return[Wc({find:TF,type:this.type}),Wc({find:AF,type:this.type})]}}),pS=/^(\d+)\.\s$/,PF=bs.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:void 0,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",ci(this.options.HTMLAttributes,n),0]:["ol",ci(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(U0.name,this.editor.getAttributes(Zh.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Bh({find:pS,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Bh({find:pS,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Zh.name)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),DF=bs.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",ci(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),OF=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,zF=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,NF=oo.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",ci(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[qc({find:OF,type:this.type})]},addPasteRules(){return[Wc({find:zF,type:this.type})]}}),fS=bs.create({name:"text",group:"inline"}),RF=Ai.create({name:"starterKit",addExtensions(){var t,e,n,i,r,a,u,l,m,x,S,E,T,I,z,F,j,G;const ie=[];return this.options.bold!==!1&&ie.push(ZV.configure((t=this.options)===null||t===void 0?void 0:t.bold)),this.options.blockquote!==!1&&ie.push(UV.configure((e=this.options)===null||e===void 0?void 0:e.blockquote)),this.options.bulletList!==!1&&ie.push(YV.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&ie.push(JV.configure((i=this.options)===null||i===void 0?void 0:i.code)),this.options.codeBlock!==!1&&ie.push(oS.configure((r=this.options)===null||r===void 0?void 0:r.codeBlock)),this.options.document!==!1&&ie.push(tF.configure((a=this.options)===null||a===void 0?void 0:a.document)),this.options.dropcursor!==!1&&ie.push(rF.configure((u=this.options)===null||u===void 0?void 0:u.dropcursor)),this.options.gapcursor!==!1&&ie.push(dF.configure((l=this.options)===null||l===void 0?void 0:l.gapcursor)),this.options.hardBreak!==!1&&ie.push(pF.configure((m=this.options)===null||m===void 0?void 0:m.hardBreak)),this.options.heading!==!1&&ie.push(fF.configure((x=this.options)===null||x===void 0?void 0:x.heading)),this.options.history!==!1&&ie.push(SF.configure((S=this.options)===null||S===void 0?void 0:S.history)),this.options.horizontalRule!==!1&&ie.push(EF.configure((E=this.options)===null||E===void 0?void 0:E.horizontalRule)),this.options.italic!==!1&&ie.push(IF.configure((T=this.options)===null||T===void 0?void 0:T.italic)),this.options.listItem!==!1&&ie.push(U0.configure((I=this.options)===null||I===void 0?void 0:I.listItem)),this.options.orderedList!==!1&&ie.push(PF.configure((z=this.options)===null||z===void 0?void 0:z.orderedList)),this.options.paragraph!==!1&&ie.push(DF.configure((F=this.options)===null||F===void 0?void 0:F.paragraph)),this.options.strike!==!1&&ie.push(NF.configure((j=this.options)===null||j===void 0?void 0:j.strike)),this.options.text!==!1&&ie.push(fS.configure((G=this.options)===null||G===void 0?void 0:G.text)),ie}}),BF=Ai.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;return(e=t.style.color)===null||e===void 0?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}});function LF(t){var e;const{char:n,allowSpaces:i,allowedPrefixes:r,startOfLine:a,$position:u}=t,l=r3(n),m=new RegExp(`\\s${l}$`),x=a?"^":"",S=i?new RegExp(`${x}${l}.*?(?=\\s${l}|$)`,"gm"):new RegExp(`${x}(?:^)?${l}[^\\s${l}]*`,"gm"),E=((e=u.nodeBefore)===null||e===void 0?void 0:e.isText)&&u.nodeBefore.text;if(!E)return null;const T=u.pos-E.length,I=Array.from(E.matchAll(S)).pop();if(!I||I.input===void 0||I.index===void 0)return null;const z=I.input.slice(Math.max(0,I.index-1),I.index),F=new RegExp(`^[${r==null?void 0:r.join("")}\0]?$`).test(z);if(r!==null&&!F)return null;const j=T+I.index;let G=j+I[0].length;return i&&m.test(E.slice(G-1,G+1))&&(I[0]+=" ",G+=1),j<u.pos&&G>=u.pos?{range:{from:j,to:G},query:I[0].slice(n.length),text:I[0]}:null}const VF=new Mr("suggestion");function FF({pluginKey:t=VF,editor:e,char:n="@",allowSpaces:i=!1,allowedPrefixes:r=[" "],startOfLine:a=!1,decorationTag:u="span",decorationClass:l="suggestion",command:m=()=>null,items:x=()=>[],render:S=()=>({}),allow:E=()=>!0,findSuggestionMatch:T=LF}){let I;const z=S==null?void 0:S(),F=new Fi({key:t,view(){return{update:async(j,G)=>{var ie,ae,J,Ce,be,Ae,Fe;const Pe=(ie=this.key)===null||ie===void 0?void 0:ie.getState(G),Xe=(ae=this.key)===null||ae===void 0?void 0:ae.getState(j.state),rt=Pe.active&&Xe.active&&Pe.range.from!==Xe.range.from,Bt=!Pe.active&&Xe.active,dt=Pe.active&&!Xe.active,Nt=!Bt&&!dt&&Pe.query!==Xe.query,Xt=Bt||rt&&Nt,rn=Nt||rt,jt=dt||rt&&Nt;if(!Xt&&!rn&&!jt)return;const Kt=jt&&!Xt?Pe:Xe,Sn=j.dom.querySelector(`[data-decoration-id="${Kt.decorationId}"]`);I={editor:e,range:Kt.range,query:Kt.query,text:Kt.text,items:[],command:Mt=>m({editor:e,range:Kt.range,props:Mt}),decorationNode:Sn,clientRect:Sn?()=>{var Mt;const{decorationId:En}=(Mt=this.key)===null||Mt===void 0?void 0:Mt.getState(e.state),dn=j.dom.querySelector(`[data-decoration-id="${En}"]`);return(dn==null?void 0:dn.getBoundingClientRect())||null}:null},Xt&&((J=z==null?void 0:z.onBeforeStart)===null||J===void 0||J.call(z,I)),rn&&((Ce=z==null?void 0:z.onBeforeUpdate)===null||Ce===void 0||Ce.call(z,I)),(rn||Xt)&&(I.items=await x({editor:e,query:Kt.query})),jt&&((be=z==null?void 0:z.onExit)===null||be===void 0||be.call(z,I)),rn&&((Ae=z==null?void 0:z.onUpdate)===null||Ae===void 0||Ae.call(z,I)),Xt&&((Fe=z==null?void 0:z.onStart)===null||Fe===void 0||Fe.call(z,I))},destroy:()=>{var j;I&&((j=z==null?void 0:z.onExit)===null||j===void 0||j.call(z,I))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(j,G,ie,ae){const{isEditable:J}=e,{composing:Ce}=e.view,{selection:be}=j,{empty:Ae,from:Fe}=be,Pe={...G};if(Pe.composing=Ce,J&&(Ae||e.view.composing)){(Fe<G.range.from||Fe>G.range.to)&&!Ce&&!G.composing&&(Pe.active=!1);const Xe=T({char:n,allowSpaces:i,allowedPrefixes:r,startOfLine:a,$position:be.$from}),rt=`id_${Math.floor(Math.random()*4294967295)}`;Xe&&E({editor:e,state:ae,range:Xe.range,isActive:G.active})?(Pe.active=!0,Pe.decorationId=G.decorationId?G.decorationId:rt,Pe.range=Xe.range,Pe.query=Xe.query,Pe.text=Xe.text):Pe.active=!1}else Pe.active=!1;return Pe.active||(Pe.decorationId=null,Pe.range={from:0,to:0},Pe.query=null,Pe.text=null),Pe}},props:{handleKeyDown(j,G){var ie;const{active:ae,range:J}=F.getState(j.state);return ae&&((ie=z==null?void 0:z.onKeyDown)===null||ie===void 0?void 0:ie.call(z,{view:j,event:G,range:J}))||!1},decorations(j){const{active:G,range:ie,decorationId:ae}=F.getState(j);return G?pi.create(j.doc,[Gr.inline(ie.from,ie.to,{nodeName:u,class:l,"data-decoration-id":ae})]):null}}});return F}const $F=new Mr("mention"),jF=bs.create({name:"mention",addOptions(){return{HTMLAttributes:{},renderText({options:t,node:e}){var n;return`${t.suggestion.char}${(n=e.attrs.label)!==null&&n!==void 0?n:e.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:t,node:e}){var n;return["span",ci(this.HTMLAttributes,t.HTMLAttributes),`${t.suggestion.char}${(n=e.attrs.label)!==null&&n!==void 0?n:e.attrs.id}`]},suggestion:{char:"@",pluginKey:$F,command:({editor:t,range:e,props:n})=>{var i,r,a;const u=t.view.state.selection.$to.nodeAfter;((i=u==null?void 0:u.text)===null||i===void 0?void 0:i.startsWith(" "))&&(e.to+=1),t.chain().focus().insertContentAt(e,[{type:this.name,attrs:n},{type:"text",text:" "}]).run(),(a=(r=t.view.dom.ownerDocument.defaultView)===null||r===void 0?void 0:r.getSelection())===null||a===void 0||a.collapseToEnd()},allow:({state:t,range:e})=>{const n=t.doc.resolve(e.from),i=t.schema.nodes[this.name];return!!n.parent.type.contentMatch.matchType(i)}}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-id"),renderHTML:t=>t.id?{"data-id":t.id}:{}},label:{default:null,parseHTML:t=>t.getAttribute("data-label"),renderHTML:t=>t.label?{"data-label":t.label}:{}}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:t,HTMLAttributes:e}){if(this.options.renderLabel!==void 0)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",ci({"data-type":this.name},this.options.HTMLAttributes,e),this.options.renderLabel({options:this.options,node:t})];const n={...this.options};n.HTMLAttributes=ci({"data-type":this.name},this.options.HTMLAttributes,e);const i=this.options.renderHTML({options:n,node:t});return typeof i=="string"?["span",ci({"data-type":this.name},this.options.HTMLAttributes,e),i]:i},renderText({node:t}){return this.options.renderLabel!==void 0?(console.warn("renderLabel is deprecated use renderText and renderHTML instead"),this.options.renderLabel({options:this.options,node:t})):this.options.renderText({options:this.options,node:t})},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:t,state:e})=>{let n=!1;const{selection:i}=e,{empty:r,anchor:a}=i;return r?(e.doc.nodesBetween(a-1,a,(u,l)=>{if(u.type.name===this.name)return n=!0,t.insertText(this.options.deleteTriggerWithBackspace?"":this.options.suggestion.char||"",l,l+u.nodeSize),!1}),n):!1})}},addProseMirrorPlugins(){return[FF({editor:this.editor,...this.options.suggestion})]}}),UF=oo.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",ci(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),HF={props:{editor:Object},methods:{toggleBlockquote(){this.editor&&this.editor.chain().toggleBlockquote().run()}}};function qF(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("button",{onClick:e[0]||(e[0]=(...u)=>a.toggleBlockquote&&a.toggleBlockquote(...u)),class:"p-1.5 text-gray-500 rounded hover:text-gray-900 dark:hover:text-white focus:outline-none"},e[1]||(e[1]=[_.createElementVNode("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[_.createElementVNode("path",{"fill-rule":"evenodd",d:"M6 6a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h3a3 3 0 0 1-3 3H5a1 1 0 1 0 0 2h1a5 5 0 0 0 5-5V8a2 2 0 0 0-2-2H6Zm9 0a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h3a3 3 0 0 1-3 3h-1a1 1 0 1 0 0 2h1a5 5 0 0 0 5-5V8a2 2 0 0 0-2-2h-3Z"})],-1)]))}const WF=Ge(HF,[["render",qF]]),GF={props:{editor:Object},methods:{toggleBulletList(){this.editor&&this.editor.chain().focus().toggleBulletList().run()}}};function ZF(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("button",{onClick:e[0]||(e[0]=(...u)=>a.toggleBulletList&&a.toggleBulletList(...u)),class:"p-1.5 text-gray-500 rounded hover:text-gray-900 dark:hover:text-white focus:outline-none"},e[1]||(e[1]=[_.createElementVNode("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[_.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-width":"2",d:"M9 8h10M9 12h10M9 16h10M4.99 8H5m-.02 4h.01m0 4H5"})],-1)]))}const YF=Ge(GF,[["render",ZF]]),XF={props:{editor:Object},methods:{toggleOrderedList(){this.editor&&this.editor.chain().focus().toggleOrderedList().run()}}};function KF(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("button",{onClick:e[0]||(e[0]=(...u)=>a.toggleOrderedList&&a.toggleOrderedList(...u)),class:"p-1.5 text-gray-500 rounded hover:text-gray-900 dark:hover:text-white focus:outline-none"},e[1]||(e[1]=[_.createElementVNode("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[_.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 6h8m-8 6h8m-8 6h8M4 16a2 2 0 1 1 3.321 1.5L4 20h5M4 5l2-1v6m-2 0h4"})],-1)]))}const JF=Ge(XF,[["render",KF]]),QF={props:{editor:Object},methods:{toggleCodeBlock(){this.editor&&this.editor.chain().focus().toggleCodeBlock().run()}}};function e6(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("button",{onClick:e[0]||(e[0]=(...u)=>a.toggleCodeBlock&&a.toggleCodeBlock(...u)),class:"p-1.5 text-gray-500 rounded hover:text-gray-900 dark:hover:text-white focus:outline-none"},e[1]||(e[1]=[_.createElementVNode("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},[_.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m8 8-4 4 4 4m8 0 4-4-4-4m-2-3-4 14"})],-1)]))}const t6=Ge(QF,[["render",e6]]),n6={props:{editor:Object},methods:{toggleBold(){this.editor&&this.editor.chain().toggleBold().run()}}};function i6(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("button",{onClick:e[0]||(e[0]=(...u)=>a.toggleBold&&a.toggleBold(...u)),class:_.normalizeClass(["p-1.5 text-gray-500 rounded cursor-pointer hover:text-gray-900 hover:bg-gray-200",{"bg-gray-200 text-gray-900":n.editor.isActive("bold")}])},e[1]||(e[1]=[_.createElementVNode("svg",{class:"w-5 h-5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},[_.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 5h4.5a3.5 3.5 0 1 1 0 7H8m0-7v7m0-7H6m2 7h6.5a3.5 3.5 0 1 1 0 7H8m0-7v7m0 0H6"})],-1),_.createElementVNode("span",{class:"sr-only"},"Bold",-1)]),2)}const r6=Ge(n6,[["render",i6]]),s6={props:{editor:Object},methods:{toggleItalic(){this.editor&&this.editor.chain().toggleItalic().run()}}};function o6(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("button",{onClick:e[0]||(e[0]=(...u)=>a.toggleItalic&&a.toggleItalic(...u)),class:_.normalizeClass(["p-1.5 text-gray-500 rounded cursor-pointer hover:text-gray-900 hover:bg-gray-200",{"bg-gray-200 text-gray-900":n.editor.isActive("italic")}])},e[1]||(e[1]=[_.createElementVNode("svg",{class:"w-5 h-5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},[_.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m8.874 19 6.143-14M6 19h6.33m-.66-14H18"})],-1),_.createElementVNode("span",{class:"sr-only"},"Italic",-1)]),2)}const a6=Ge(s6,[["render",o6]]),l6={},c6={"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"};function u6(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("svg",c6,e[0]||(e[0]=[_.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-width":"2",d:"M9 19.2H5.5c-.3 0-.5-.2-.5-.5V16c0-.2.2-.4.5-.4h13c.3 0 .5.2.5.4v2.7c0 .3-.2.5-.5.5H18m-6-1 1.4 1.8h.2l1.4-1.7m-7-5.4L12 4c0-.1 0-.1 0 0l4 8.8m-6-2.7h4m-7 2.7h2.5m5 0H17"},null,-1)]))}const h6={components:{IconA:Ge(l6,[["render",u6]])},props:{editor:Object},data(){return{color:"#000000",colors:["#000000","#0055CC","#206A83","#216E4E","#E56910","#AE2E24","#5E4DB2","#758195","#FF0000","#008000","#28A9AB","#AB7222"]}},methods:{setColor(t){this.editor&&(this.editor.chain().focus().setColor(t).run(),this.$refs.popover.togglePopover(),this.color=t)}}},d6={class:"relative flex"},p6={class:"flex w-[160px] flex-wrap gap-[4px]"},f6=["onClick"];function m6(t,e,n,i,r,a){const u=_.resolveComponent("IconA"),l=_.resolveComponent("VsPopover");return _.openBlock(),_.createBlock(l,{ref:"popover",placement:"bottom"},{reference:_.withCtx(()=>[_.createElementVNode("button",d6,[_.createVNode(u,{height:"20",width:"20",class:"text-gray-500"}),_.createElementVNode("span",{class:"absolute h-[4px] w-[80%] bottom-[2px] left-[2px]",style:_.normalizeStyle({backgroundColor:r.color})},null,4)])]),default:_.withCtx(()=>[_.createElementVNode("div",null,[_.createElementVNode("ul",p6,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(r.colors,m=>(_.openBlock(),_.createElementBlock("li",{class:"h-[37px] w-[37px] rounded",style:_.normalizeStyle({backgroundColor:m}),onClick:x=>a.setColor(m),key:m},null,12,f6))),128))])])]),_:1},512)}const g6=Ge(h6,[["render",m6]]),y6={},_6={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-dots-vertical"};function x6(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("svg",_6,e[0]||(e[0]=[_.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),_.createElementVNode("path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1),_.createElementVNode("path",{d:"M12 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1),_.createElementVNode("path",{d:"M12 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1)]))}const mS=Ge(y6,[["render",x6]]),b6={components:{IconMore:mS},props:{editor:Object},methods:{toggleUnderline(){this.$refs.popover.togglePopover(),this.editor&&this.editor.chain().focus().toggleUnderline().run()},toggleStrike(){this.$refs.popover.togglePopover(),this.editor&&this.editor.chain().focus().toggleStrike().run()}}};function v6(t,e,n,i,r,a){const u=_.resolveComponent("IconMore"),l=_.resolveComponent("VsPopover");return _.openBlock(),_.createBlock(l,{ref:"popover",placement:"bottom"},{reference:_.withCtx(()=>[_.createElementVNode("button",{class:_.normalizeClass(["p-1.5 text-gray-500 rounded cursor-pointer hover:text-gray-900 hover:bg-gray-200",{"bg-gray-200 text-gray-900":n.editor.isActive("underline")||n.editor.isActive("strike")}])},[_.createVNode(u,{height:"18",width:"18",class:"rotate-90"})],2)]),default:_.withCtx(()=>[_.createElementVNode("div",null,[_.createElementVNode("button",{onClick:e[0]||(e[0]=(...m)=>a.toggleUnderline&&a.toggleUnderline(...m)),class:_.normalizeClass(["p-[8px] block rounded-lg w-[140px] mb-[4px] text-start hover:bg-gray-100 !duration-300 underline underline-offset-1",{"bg-gray-100 text-gray-900":n.editor.isActive("underline")}])}," Підкресленний ",2),_.createElementVNode("button",{onClick:e[1]||(e[1]=(...m)=>a.toggleStrike&&a.toggleStrike(...m)),class:_.normalizeClass(["p-[8px] block rounded-lg w-[140px] text-start hover:bg-gray-100 !duration-300 line-through",{"bg-gray-100 text-gray-900":n.editor.isActive("strike")}])}," Перекресленний ",2)])]),_:1},512)}const w6={bold:r6,italic:a6,text_more:Ge(b6,[["render",v6]]),color:g6,bullet_list:YF,ordered_list:JF,blockquote:WF,codeblock:t6},k6={components:{EditorContent:$V},props:{controls:{type:Array,default:()=>["bold","italic","color","blockquote","bullet_list","ordered_list","codeblock","text_more"]},options:{type:Array,default:()=>[]},modelValue:{type:String,default:()=>""}},data(){return{editor:null}},computed:{controlsList(){return Object.entries(w6).filter(([t])=>this.controls.includes(t)).map(([t,e])=>e)}},watch:{modelValue(t){this.editor&&this.editor.getHTML()!==t&&this.editor.commands.setContent(t)},editor(t){t&&this.editor.on("update",({editor:e})=>{const n=e.getHTML();n!==this.modelValue&&this.$emit("update:modelValue",n)})}},mounted(){this.editor&&this.editor.destroy(),this.initEditor()},beforeDestroy(){this.editor&&this.editor.destroy()},methods:{initEditor(){this.editor=new FV({content:this.modelValue,extensions:[RF,oS,Zh,BF,UF,fS,jF.configure({HTMLAttributes:{class:"mention"},suggestion:{items:({query:t})=>{const e=this.options.filter(n=>{var i,r;return(r=(i=n==null?void 0:n.email)==null?void 0:i.toLowerCase())==null?void 0:r.includes(t==null?void 0:t.toLowerCase())}).slice(0,5);return e.length?e:[{id:null,text:"Данні відсутні",email:null}]},render:()=>{let t,e;return{onStart:n=>{t=document.createElement("div"),t.className="mention-popup",n.items.forEach(a=>{const u=document.createElement("div");u.className="mention-option",a.id===null?(u.textContent=a.text,u.style.pointerEvents="none",u.style.color="#999"):(u.textContent=a.text,u.addEventListener("click",()=>{n.command({id:a.id,label:a.email})})),t.appendChild(u)}),document.body.appendChild(t);const{from:i}=n.range,r=n.editor.view.coordsAtPos(i);t.style.position="absolute",t.style.left=`${r.left}px`,t.style.top=`${r.top-t.offsetHeight}px`,e=t},onUpdate:n=>{for(;t.firstChild;)t.removeChild(t.firstChild);n.items.forEach(a=>{const u=document.createElement("div");u.className="mention-option",a.id===null?(u.textContent=a.text,u.style.pointerEvents="none",u.style.color="#999"):(u.textContent=a.text,u.addEventListener("click",()=>{n.command({id:a.id,label:a.email})})),t.appendChild(u)});const{from:i}=n.range,r=n.editor.view.coordsAtPos(i);t.style.left=`${r.left}px`,t.style.top=`${r.top-t.offsetHeight}px`},onExit:()=>{e&&e.remove()}}}}})]})},focusEditor(){this.editor&&!this.editor.isFocused&&this.editor.commands.focus()}}},S6={class:"editor-container w-full min-w-[600px] border border-gray-200 rounded-lg bg-gray-50 dark:bg-gray-700 dark:border-gray-600"},E6={key:0,class:"editor-toolbar px-3 py-2 border-b dark:border-gray-600 flex flex-wrap items-center gap-2"};function C6(t,e,n,i,r,a){const u=_.resolveComponent("EditorContent");return _.openBlock(),_.createElementBlock("div",S6,[r.editor?(_.openBlock(),_.createElementBlock("div",E6,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(a.controlsList,(l,m)=>(_.openBlock(),_.createBlock(_.resolveDynamicComponent(l),{key:m,editor:r.editor},null,8,["editor"]))),128))])):_.createCommentVNode("",!0),_.createElementVNode("div",{onClick:e[0]||(e[0]=(...l)=>a.focusEditor&&a.focusEditor(...l)),class:"editor-content px-4 py-2 bg-white rounded-b-lg dark:bg-gray-800 relative"},[_.createVNode(u,{editor:r.editor,class:"relative"},null,8,["editor"])])])}const gS=Ge(k6,[["render",C6]]),T6=t=>{const e=/(\b\S)?/g,n=t.match(e);return n?n.join("").toUpperCase():""},M6={props:{name:{type:String,default(){return""}},avatar:{type:String,default(){return""}}},computed:{inItials(){return T6(this.name)}}},A6={class:"mr-2"},I6=["src"],P6={key:1,class:"flex flex-shrink-0 items-center justify-center w-6 h-6 bg-gray-500 text-xs text-white rounded-full"},D6={key:0},O6={key:1,class:"text-sm"};function z6(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("div",A6,[n.avatar?(_.openBlock(),_.createElementBlock("img",{key:0,src:n.avatar,alt:"avatar",class:"flex flex-shrink-0 items-center justify-center w-6 h-6 rounded-full"},null,8,I6)):n.name?(_.openBlock(),_.createElementBlock("div",P6,[a.inItials.length?(_.openBlock(),_.createElementBlock("span",D6,_.toDisplayString(a.inItials),1)):(_.openBlock(),_.createElementBlock("span",O6,e[0]||(e[0]=[_.createElementVNode("i",{class:"ti ti-user"},null,-1)])))])):_.createCommentVNode("",!0)])}const N6={components:{VsWidgetCommentsAvatar:Ge(M6,[["render",z6]]),VsTextEditor:gS},props:{comment:{type:Object,default:()=>({})},user:{type:Object,default:()=>({})},id:{type:String,default:""},options:Array},data(){return{commentContent:this.comment.body,isCommentActionVisible:!1,isOpen:!1,textareaValue:""}},computed:{isUserAutor(){return this.user.uid===this.comment.uid},createDate(){try{const t=lt(this.comment.cdate,"YYYY-MM-DD");return new Date(t).toLocaleDateString("uk-UA",{day:"2-digit",month:"long",year:"numeric"})}catch{return""}}},watch:{isOpen(t){t&&(this.textareaValue=this.comment.body)}},methods:{confirnDeleteComment(){document.body.click(),this.$emit("openModal",{title:"Ви впевнені?",message:"Ви впевнені, що хочете видалити цей коментар?",confirmButtonText:"Так, я впевнена/ий",cancelButtonText:"Скасувати",confirm:this.deleteComment,updateListOnConfirm:!0})},async updateComment(){try{await vt.post(`/api/widget/comment/${this.id}/${this.comment.communication_id}`,{body:this.textareaValue}),this.$emit("list-update"),this.isOpen=!1}catch{this.$notify({title:"Помилка!",message:"Сталася помилка",type:"error"})}},openEditModal(){document.body.click(),this.isOpen=!0},async deleteComment(){try{await vt.delete(`/api/widget/comment/${this.id}/${this.comment.communication_id}`),this.$emit("list-update"),this.isCommentActionVisible=!1}catch{this.$notify({title:"Помилка!",message:"Сталася помилка",type:"error"})}},toggleCommentAction(){this.isCommentActionVisible=!this.isCommentActionVisible}}},R6={class:"p-6 pl-1 text-base bg-white dark:bg-gray-900"},B6={class:"flex justify-between items-center mb-2"},L6={class:"flex items-center"},V6={class:"inline-flex items-center mr-3 text-sm text-gray-900 dark:text-white font-semibold"},F6={class:"text-sm text-gray-600 dark:text-gray-400"},$6={class:"flex flex-col items-center gap-[4px]"},j6=["innerHTML"],U6={class:"flex flex-col gap-[8px] text-sm font-medium text-gray-500"},H6={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"};function q6(t,e,n,i,r,a){const u=_.resolveComponent("VsWidgetCommentsAvatar"),l=_.resolveComponent("VsPopover"),m=_.resolveComponent("VsTextEditor"),x=_.resolveComponent("VsDialog");return _.openBlock(),_.createElementBlock(_.Fragment,null,[_.createElementVNode("div",R6,[_.createElementVNode("div",B6,[_.createElementVNode("div",L6,[_.createElementVNode("p",V6,[_.createVNode(u,{name:n.comment.username,avatar:n.comment.avatar},null,8,["name","avatar"]),_.createTextVNode(_.toDisplayString(n.comment.username),1)]),_.createElementVNode("p",F6,[_.createElementVNode("time",null,_.toDisplayString(a.createDate),1)])]),_.createVNode(l,{placement:"bottom"},{reference:_.withCtx(()=>e[6]||(e[6]=[_.createElementVNode("button",{class:"inline-flex items-center p-2 text-sm font-medium text-center text-gray-500 dark:text-gray-40 bg-white rounded-lg hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-50 dark:bg-gray-900 dark:hover:bg-gray-700 dark:focus:ring-gray-600",type:"button"},[_.createElementVNode("svg",{class:"w-4 h-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 16 3"},[_.createElementVNode("path",{d:"M2 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3Zm6.041 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM14 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3Z"})])],-1)])),default:_.withCtx(()=>[_.createElementVNode("div",$6,[_.createElementVNode("button",{type:"button",class:"block px-[12px] rounded-lg py-[4px] text-start w-[100px] duration-300 hover:bg-gray-100",onClick:e[0]||(e[0]=(...S)=>a.openEditModal&&a.openEditModal(...S))}," Редагувати "),_.createElementVNode("button",{type:"button",class:"block py-2 px-[12px] rounded-lg py-[6px] text-start duration-300 w-[100px] hover:bg-gray-100",onClick:e[1]||(e[1]=S=>a.confirnDeleteComment())}," Видалити ")])]),_:1})]),_.createElementVNode("p",{class:"text-gray-500 dark:text-gray-400",innerHTML:n.comment.body},null,8,j6)]),_.createVNode(x,{visible:r.isOpen,"onUpdate:visible":e[5]||(e[5]=S=>r.isOpen=S),title:"Редагувати",size:"small"},{footer:_.withCtx(()=>[_.createElementVNode("div",H6,[_.createElementVNode("button",{onClick:e[3]||(e[3]=S=>r.isOpen=!1),class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border rounded-lg !border-gray-200 hover:bg-gray-100 duration-300"}," Відмінити "),_.createElementVNode("button",{onClick:e[4]||(e[4]=(...S)=>a.updateComment&&a.updateComment(...S)),class:"py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"}," Зберегти ")])]),default:_.withCtx(()=>[_.createElementVNode("div",U6,[e[7]||(e[7]=_.createTextVNode(" Коментар ")),_.createVNode(m,{modelValue:r.textareaValue,"onUpdate:modelValue":e[2]||(e[2]=S=>r.textareaValue=S),options:n.options},null,8,["modelValue","options"])])]),_:1},8,["visible"])],64)}const W6={components:{VsWidgetCommentsItem:Ge(N6,[["render",q6]])},inject:["activeAddFormEditor"],props:{id:{type:String,default:()=>""},prefilledData:{type:Object,default:null},options:Array},data(){return{isLoaded:!1,isLoadFailed:!1,comments:[],user:{},modal:{title:"",message:"",cancel:"",confirm:"",cancelButtonText:"",confirmButtonText:""},isModalVisible:!1}},async created(){await this.getComments()},methods:{async getComments(){if(this.prefilledData){this.comments=this.prefilledData.rows,this.isLoaded=!0;return}try{const{data:t}=await vt.get(`/api/widget/comment/${this.id}`);this.comments=t.rows,this.user=t.user}catch(t){this.isLoadFailed=!0,console.error(t)}this.isLoaded=!0,this.$emit("update-comment-count")},prepareModal(t){const e={...t};return t.cancel||(e.cancel=()=>{this.isModalVisible=!1}),t.updateListOnConfirm&&(e.confirm=async()=>{await t.confirm(),this.isModalVisible=!1}),e},handleOpenModal(t){this.modal=this.prepareModal(t),this.isModalVisible=!0}}},G6={class:"flex flex-col"},Z6={key:0,class:"max-h-[300px] overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},Y6={key:1},X6={class:"p-4"},K6={class:"mt-1 text-gray-500 dark:text-neutral-500"},J6={class:"mt-4 flex justify-end gap-x-3"};function Q6(t,e,n,i,r,a){const u=_.resolveComponent("VsErrorOnLoading"),l=_.resolveComponent("VsWidgetCommentsItem"),m=_.resolveComponent("VsLoader"),x=_.resolveComponent("VsDialog");return _.openBlock(),_.createElementBlock("div",G6,[r.isLoaded?(_.openBlock(),_.createElementBlock(_.Fragment,{key:0},[r.isLoadFailed?(_.openBlock(),_.createBlock(u,{key:0})):(_.openBlock(),_.createElementBlock(_.Fragment,{key:1},[r.comments.length?(_.openBlock(),_.createElementBlock("div",Z6,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(r.comments,(S,E)=>(_.openBlock(),_.createBlock(l,{key:E,comment:S,user:r.user,options:n.options,index:E,id:n.id,onListUpdate:a.getComments,class:"border-top",onOpenModal:e[0]||(e[0]=T=>a.handleOpenModal(T))},null,8,["comment","user","options","index","id","onListUpdate"]))),128))])):(_.openBlock(),_.createElementBlock("div",Y6,e[4]||(e[4]=[_.createElementVNode("p",{class:"pl-3 text-sm font-medium text-gray-600"}," Коментарі відсутні ",-1)])))],64))],64)):(_.openBlock(),_.createBlock(m,{key:1,class:"justify-center",text:"Please wait..."})),_.createVNode(x,{title:r.modal.title,size:"small",visible:r.isModalVisible,"onUpdate:visible":e[3]||(e[3]=S=>r.isModalVisible=S)},{default:_.withCtx(()=>[_.createElementVNode("div",X6,[_.createElementVNode("p",K6,_.toDisplayString(r.modal.message),1),_.createElementVNode("div",J6,[_.createElementVNode("button",{type:"button",class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:e[1]||(e[1]=(...S)=>r.modal.cancel&&r.modal.cancel(...S))},_.toDisplayString(r.modal.cancelButtonText),1),_.createElementVNode("button",{type:"button",class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm font-semibold rounded-lg border border-transparent bg-red-500 text-white hover:bg-red-600 disabled:opacity-50 disabled:pointer-events-none",onClick:e[2]||(e[2]=(...S)=>r.modal.confirm&&r.modal.confirm(...S))},_.toDisplayString(r.modal.confirmButtonText),1)])])]),_:1},8,["title","visible"])])}const e$=Ge(W6,[["render",Q6]]),t$={components:{VsTextEditor:gS},props:{id:{type:String,default:()=>""},autofocus:{type:Boolean,default:()=>!0},options:Array},data(){return{isEditorOpen:!1,commentContent:""}},methods:{async addNewComment(){if(this.commentContent)try{await vt.post(`/api/widget/comment/${this.id}`,{body:this.commentContent}),this.commentContent="",this.$emit("list-update")}catch(t){console.error(t)}},setNewContent(t){this.commentContent=t}}},n$={class:"w-full widget-comment-form flex flex-col items-start"},i$={class:"mb-4 bg-white border-gray-200 dark:bg-gray-800 dark:border-gray-700"},r$={class:"flex"};function s$(t,e,n,i,r,a){const u=_.resolveComponent("VsTextEditor");return _.openBlock(),_.createElementBlock("div",n$,[_.createElementVNode("div",i$,[_.createVNode(u,{modelValue:r.commentContent,"onUpdate:modelValue":e[0]||(e[0]=l=>r.commentContent=l),options:n.options},null,8,["modelValue","options"])]),_.createElementVNode("div",r$,[_.createElementVNode("button",{ref:"buttonAdd",class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent bg-blue-600 text-white hover:bg-blue-700 hover:text-white duration-300",onClick:e[1]||(e[1]=(...l)=>a.addNewComment&&a.addNewComment(...l))}," Відправити коментар ",512)])])}const o$={components:{VsWidgetCommentsList:e$,VsWidgetCommentsAddForm:Ge(t$,[["render",s$]])},props:{id:{type:String,default(){return""}},prefilledData:{type:Object,default:null}},data(){return{activeAddFormEditor:"",comments:[],totalComment:"0",options:[]}},mounted(){this.comments=this.$refs.commentListRef.comments,this.getUsersList()},watch:{comments(t){this.$emit("count-change",t.length)}},methods:{async getUsersList(){try{const{data:t}=await vt.get("/api/suggest/core.user_mentioned");this.options=t}catch(t){console.log(t)}},listUpdate(){this.$refs.commentListRef.getComments()},updateCommentCount(){this.totalComment=this.$refs.commentListRef.comments.length||"0"}}},a$={class:"bg-white-200"};function l$(t,e,n,i,r,a){const u=_.resolveComponent("VsWidgetCommentsAddForm"),l=_.resolveComponent("VsWidgetCommentsList");return _.openBlock(),_.createElementBlock("div",a$,[e[2]||(e[2]=_.createElementVNode("div",{class:"flex justify-between items-center gap-x-2 mb-4"},null,-1)),_.createVNode(u,{options:r.options,class:"mb-6",id:n.id,onListUpdate:e[0]||(e[0]=m=>a.listUpdate())},null,8,["options","id"]),_.createVNode(l,{options:r.options,id:n.id,onUpdateCommentCount:e[1]||(e[1]=m=>a.updateCommentCount()),"prefilled-data":n.prefilledData,ref:"commentListRef"},null,8,["options","id","prefilled-data"])])}const yS=Ge(o$,[["render",l$]]),_S=t=>new Date(t).toLocaleDateString("uk-UK",{day:"numeric",month:"long",year:"numeric",hour:"numeric",minute:"numeric"}),c$=t=>new Date(t).toLocaleDateString("uk-UK",{day:"numeric",month:"numeric",year:"numeric",hour:"numeric",minute:"numeric"}),u$=t=>{const e=/(\b\S)?/g,n=t.match(e);return n?n.join("").toUpperCase():""},h$=_.defineComponent({props:{username:{type:String,default:()=>""}},computed:{inItials(){return u$(this.username)}}}),d$={class:"flex flex-shrink-0 items-center justify-center w-8 h-8 bg-gray-500 text-xs text-white rounded-full"};function p$(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("div",d$,_.toDisplayString(t.inItials),1)}const f$=Ge(h$,[["render",p$]]),G0={load(){try{const t=Array.from(arguments);window.headLoadedFiles||(window.headLoadedFiles=[]);const e=typeof arguments[arguments.length-1]=="function"?arguments[arguments.length-1]:null,n=t.filter(i=>typeof i!="function").reduce((i,r)=>i.concat(r),[]).filter(i=>i&&!window.headLoadedFiles[i.url||i.split("?")[0]]);Promise.all(n.map(i=>this.loadFile1(i))).then(()=>{e&&e()})}catch(t){console.log(t)}},promise(t){return new Promise((e,n)=>{G0.load(t,()=>{e()})})},loadFile1(t){let e=!1;typeof t=="object"&&(e=t.type,t=t.url);const n=t.split("?")[0];return new Promise((i,r)=>{function a(l){delete window.headLoadedFiles[`_${n}`],window.headLoadedFiles[n]=l.type,i(l.type)}let u;window.headLoadedFiles[`_${n}`]?u=window.headLoadedFiles[`_${n}`]:(n.includes(".css")?(u=document.createElement("link"),u.href=t,u.type="text/css",u.rel="stylesheet"):(u=document.createElement("script"),u.type="text/javascript",u.src=t,e&&(u.type=e)),window.headLoadedFiles[`_${n}`]=u,document.head.appendChild(u)),u.addEventListener("load",a),u.addEventListener("error",a)})}},m$={props:{point:{type:String,default:()=>""}},data(){return{zoom:18}},computed:{parsedPoint(){return JSON.parse(this.point)},tooltipText(){return this.parsedPoint.coordinates.join(", ")},coordinates(){return[...this.parsedPoint.coordinates].reverse()}},async mounted(){typeof window>"u"||(window!=null&&window.L||(await G0.promise("https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/leaflet.js"),await G0.promise("https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/leaflet.js")),this.initMap())},methods:{initMap(){const t=window.L.map("map",{center:this.coordinates,zoom:this.zoom});window.L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png").addTo(t),window.L.circle(this.coordinates,{color:"red",fillColor:"red",fillOpacity:.2,radius:10}).addTo(t).bindTooltip(this.tooltipText)}}},g$={id:"map",style:{height:"9rem",width:"24rem"}};function y$(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("div",g$)}const _$=Ge(m$,[["render",y$]]),x$=_.defineComponent({components:{VsWidgetHistoryItemAvatar:f$,VsWidgetHistoryItemMap:_$},props:{item:{type:Object,default:()=>{}}},methods:{getTitle(t){return t.title||t.attr},getOldValue(t){return t.old||"Не вказано"},getNewValue(t){return t.new||"Не вказано"},getDate(t){return c$(t.cdate)}}}),b$={class:"relative [&_p]:m-0"},v$={class:"flex items-center gap-3"},w$={class:"w-full flex justify-between"},k$={class:"text-gray-500"},S$={class:"text-gray-800 font-medium"},E$={class:"text-gray-500 text-sm"},C$={class:"mt-2 pl-10"},T$={key:0},M$={key:1,class:"flex items-center gap-2 text-gray-700 text-sm"},A$={class:"font-medium"},I$={class:"font-medium"};function P$(t,e,n,i,r,a){const u=_.resolveComponent("VsWidgetHistoryItemAvatar"),l=_.resolveComponent("VsWidgetHistoryItemMap");return _.openBlock(),_.createElementBlock("div",b$,[_.createElementVNode("div",v$,[_.createVNode(u,{username:t.item.username},null,8,["username"]),_.createElementVNode("div",w$,[_.createElementVNode("p",k$,[_.createElementVNode("span",S$,_.toDisplayString(t.item.username),1),e[0]||(e[0]=_.createTextVNode(" змінив данні: "))]),_.createElementVNode("p",E$,_.toDisplayString(t.getDate(t.item)),1)])]),_.createElementVNode("div",C$,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(t.item.changes,(m,x)=>(_.openBlock(),_.createElementBlock("div",{key:x},[m.attr==="geom"?(_.openBlock(),_.createElementBlock("div",T$,[e[1]||(e[1]=_.createElementVNode("p",null,"Додана геометрія:",-1)),m.new?(_.openBlock(),_.createBlock(l,{key:0,point:m.new},null,8,["point"])):_.createCommentVNode("",!0)])):(_.openBlock(),_.createElementBlock("div",M$,[_.createElementVNode("p",null,_.toDisplayString(`- ${t.getTitle(m)}:`),1),_.createElementVNode("p",A$,_.toDisplayString(t.getOldValue(m)),1),e[2]||(e[2]=_.createElementVNode("i",{class:"ti ti-arrow-right"},null,-1)),_.createElementVNode("p",I$,_.toDisplayString(t.getNewValue(m)),1)]))]))),128))])])}const D$=Ge(x$,[["render",P$]]),O$=_.defineComponent({components:{VsWidgetHistoryItem:D$,VsEmptyWidget:Sy},props:{id:{type:String,default:""},prefilledData:{type:Object,default:null}},data:()=>({history:{}}),computed:{createdDate(){return this.history.data?_S(this.history.data.cdate):""},lastEditDate(){return this.history.data?_S(this.history.data.edate):""},authorName(){return this.history.data?this.history.data.author:""}},methods:{async getHistoryData(){if(this.prefilledData){this.history=this.prefilledData;return}try{const{data:t}=await vt.get(`/api/widget/history/${this.id}`);this.history=t}catch(t){console.error(t)}}},async mounted(){await this.getHistoryData()},watch:{"history.rows":function(t){this.$emit("count-change",t.length)}}}),z$={class:"bg-white"},N$={key:0,class:"space-y-6 list-none relative !px-0 sm:before:absolute sm:before:top-2 sm:before:bottom-0 sm:before:w-0.5 sm:before:left-4 before:bg-gray-200 max-h-[400px] overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},R$={key:1,class:"w-full h-[330px] flex items-center justify-center"};function B$(t,e,n,i,r,a){var l;const u=_.resolveComponent("VsWidgetHistoryItem");return _.openBlock(),_.createElementBlock("div",z$,[e[0]||(e[0]=_.createElementVNode("div",{class:"flex justify-between items-center gap-x-2 mb-4"},null,-1)),(l=t.history.rows)!=null&&l.length?(_.openBlock(),_.createElementBlock("ul",N$,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(t.history.rows,m=>(_.openBlock(),_.createElementBlock("li",{class:"list-none",key:m.uid},[_.createVNode(u,{item:m},null,8,["item"])]))),128))])):(_.openBlock(),_.createElementBlock("div",R$," Історія відсутні "))])}const L$={"vs-widget-map":L1,"vs-widget-gallery":fR,"vs-widget-comments":yS,"vs-widget-file":Rv,"vs-widget-history":Ge(O$,[["render",B$]])},V$={},F$={style:{width:"calc(100vw - 300px)",height:"calc(100vh - 60px)"},class:"bg-gray-50 flex items-center justify-center"},$$={__name:"vs-dashboard",setup(t){return(e,n)=>(_.openBlock(),_.createElementBlock("div",F$,n[0]||(n[0]=[_.createElementVNode("div",{class:"p-5 md:p-8 bg-white border border-gray-200 shadow-sm rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},[_.createElementVNode("div",{class:"mb-4 xl:mb-8"},[_.createElementVNode("h1",{class:"text-lg font-semibold text-gray-800 dark:text-neutral-200"}," Members "),_.createElementVNode("p",{class:"text-sm text-gray-500 dark:text-neutral-500"}," Manage members and users of your workspace and set their access level. ")]),_.createElementVNode("div",{class:"space-y-5"},[_.createElementVNode("div",{class:"flex sm:grid sm:grid-cols-2 gap-x-2 sm:gap-x-5"},[_.createElementVNode("div",{class:"relative w-full"},[_.createElementVNode("div",{class:"absolute inset-y-0 start-0 flex items-center pointer-events-none z-20 ps-3.5"},[_.createElementVNode("svg",{class:"shrink-0 size-4 text-gray-500 dark:text-neutral-400",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[_.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),_.createElementVNode("path",{d:"m21 21-4.3-4.3"})])]),_.createElementVNode("input",{type:"text",class:"py-2 ps-10 pe-8 block w-full bg-gray-100 border-transparent rounded-lg text-sm focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:border-transparent dark:text-neutral-400 dark:placeholder:text-neutral-400 dark:focus:ring-neutral-600",placeholder:"Search by name or email"}),_.createElementVNode("div",{class:"hidden absolute inset-y-0 end-0 flex items-center pointer-events-none z-20 pe-1"},[_.createElementVNode("button",{type:"button",class:"inline-flex shrink-0 justify-center items-center size-6 rounded-full text-gray-500 hover:text-blue-600 focus:outline-none focus:text-blue-600 dark:text-neutral-500 dark:hover:text-blue-500 dark:focus:text-blue-500","aria-label":"Close"},[_.createElementVNode("span",{class:"sr-only"},"Close"),_.createElementVNode("svg",{class:"shrink-0 size-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[_.createElementVNode("circle",{cx:"12",cy:"12",r:"10"}),_.createElementVNode("path",{d:"m15 9-6 6"}),_.createElementVNode("path",{d:"m9 9 6 6"})])])])]),_.createElementVNode("div",{class:"flex justify-end items-center gap-x-2"},[_.createElementVNode("button",{type:"button",class:"p-2.5 sm:py-2 sm:px-3 inline-flex items-center text-sm font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},[_.createElementVNode("svg",{class:"shrink-0 sm:me-2 size-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[_.createElementVNode("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),_.createElementVNode("polyline",{points:"7 10 12 15 17 10"}),_.createElementVNode("line",{x1:"12",x2:"12",y1:"15",y2:"3"})]),_.createElementVNode("span",{class:"hidden sm:block"}," Download CSV ")]),_.createElementVNode("button",{type:"button",class:"py-2 px-3 inline-flex items-center gap-x-1 text-sm font-medium rounded-lg border border-transparent bg-blue-600 text-white hover:bg-blue-700 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:ring-2 focus:ring-blue-500","data-hs-overlay":"#hs-pro-dshm"},[_.createElementVNode("span",{class:"hidden sm:block"},"Send"),_.createTextVNode("Invite ")])])]),_.createElementVNode("div",{class:"grid sm:grid-cols-2 lg:grid-cols-4 gap-2 xl:gap-4"},[_.createElementVNode("div",{class:"p-4 flex flex-col bg-white border border-gray-200 rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},[_.createElementVNode("div",{class:"flex justify-between items-center mb-1"},[_.createElementVNode("h2",{class:"text-4xl font-semibold text-gray-800 dark:text-neutral-200"}),_.createElementVNode("div",{class:"flex items-center -space-x-2"},[_.createElementVNode("img",{class:"shrink-0 size-7 rounded-full",src:"https://images.unsplash.com/photo-1659482633369-9fe69af50bfb?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=3&w=320&h=320&q=80",alt:"Avatar"})])]),_.createElementVNode("h3",{class:"text-gray-500 dark:text-neutral-500"},"Admin")]),_.createElementVNode("div",{class:"p-4 flex flex-col bg-white border border-gray-200 rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},[_.createElementVNode("div",{class:"flex justify-between items-center mb-1"},[_.createElementVNode("h2",{class:"text-4xl font-semibold text-gray-800 dark:text-neutral-200"}," 5 "),_.createElementVNode("div",{class:"flex items-center -space-x-2"},[_.createElementVNode("img",{class:"shrink-0 size-7 shadow-md rounded-full",src:"https://images.unsplash.com/photo-1659482633369-9fe69af50bfb?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=2.5&w=320&h=320&q=80",alt:"Avatar"}),_.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-7 bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," L "),_.createElementVNode("img",{class:"shrink-0 size-7 shadow-md rounded-full",src:"https://images.unsplash.com/photo-1679412330254-90cb240038c5?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=2.5&w=320&h=320&q=80",alt:"Avatar"}),_.createElementVNode("img",{class:"shrink-0 size-7 shadow-md rounded-full",src:"https://images.unsplash.com/photo-1659482634023-2c4fda99ac0c?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=2.5&w=320&h=320&q=80",alt:"Avatar"}),_.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-7 bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," O ")])]),_.createElementVNode("div",{class:"inline-flex items-center gap-x-2"},[_.createElementVNode("h3",{class:"text-gray-500 dark:text-neutral-500"},"Members"),_.createElementVNode("div",{class:"hs-tooltip inline-block"},[_.createElementVNode("svg",{class:"hs-tooltip-toggle shrink-0 size-3.5 text-gray-500 dark:text-neutral-500",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16"},[_.createElementVNode("path",{d:"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"}),_.createElementVNode("path",{d:"m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"})]),_.createElementVNode("div",{class:"hs-tooltip-content hs-tooltip-shown:opacity-100 hs-tooltip-shown:visible opacity-0 inline-block absolute invisible z-20 w-60 py-1.5 px-2.5 bg-gray-900 text-xs text-white rounded dark:bg-neutral-700",role:"tooltip","data-popper-placement":"top",style:{position:"fixed",inset:"auto auto 0px 0px",margin:"0px",transform:"translate(689px, -708px)"}}," Limited Access Members can only access the projects, tasks, and messages explicitly shared with them. ")])])]),_.createElementVNode("div",{class:"p-4 flex flex-col bg-white border border-gray-200 rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},[_.createElementVNode("div",{class:"flex justify-between items-center mb-1"},[_.createElementVNode("h2",{class:"text-4xl font-semibold text-gray-800 dark:text-neutral-200"}," 2 "),_.createElementVNode("div",{class:"flex items-center -space-x-2"},[_.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-7 bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," L "),_.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-7 bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," 0 ")])]),_.createElementVNode("div",{class:"inline-flex items-center gap-x-2"},[_.createElementVNode("h3",{class:"text-gray-500 dark:text-neutral-500"}," Limited access members "),_.createElementVNode("div",{class:"hs-tooltip inline-block"},[_.createElementVNode("svg",{class:"hs-tooltip-toggle shrink-0 size-3.5 text-gray-500 dark:text-neutral-500",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16"},[_.createElementVNode("path",{d:"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"}),_.createElementVNode("path",{d:"m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"})]),_.createElementVNode("div",{class:"hs-tooltip-content hs-tooltip-shown:opacity-100 hs-tooltip-shown:visible opacity-0 inline-block absolute invisible z-20 w-60 py-1.5 px-2.5 bg-gray-900 text-xs text-white rounded dark:bg-neutral-700",role:"tooltip","data-popper-placement":"top",style:{position:"fixed",inset:"auto auto 0px 0px",margin:"0px",transform:"translate(1198px, -708px)"}}," Limited Access Members can only access the projects, tasks, and messages explicitly shared with them. ")])])]),_.createElementVNode("div",{class:"p-4 flex flex-col bg-white border border-gray-200 rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},[_.createElementVNode("div",{class:"flex justify-between items-center mb-1"},[_.createElementVNode("h2",{class:"text-4xl font-semibold text-gray-800 dark:text-neutral-200"}," 0 "),_.createElementVNode("div",{class:"flex items-center -space-x-2"})]),_.createElementVNode("h3",{class:"text-gray-500 dark:text-neutral-500"},"Pending invites")])]),_.createElementVNode("div",{class:"overflow-x-auto [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},[_.createElementVNode("div",{class:"min-w-full inline-block align-middle"},[_.createElementVNode("table",{class:"min-w-full divide-y divide-gray-200 dark:divide-neutral-700"},[_.createElementVNode("thead",null,[_.createElementVNode("tr",null,[_.createElementVNode("th",{scope:"col",class:"min-w-[250px]"},[_.createElementVNode("div",{class:"pe-4 py-3 text-start flex items-center gap-x-1 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Member ")]),_.createElementVNode("th",{scope:"col",class:"min-w-48"},[_.createElementVNode("div",{class:"px-4 py-3 text-start flex items-center gap-x-1 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Role ")]),_.createElementVNode("th",{scope:"col"},[_.createElementVNode("div",{class:"px-4 py-3 text-start flex items-center gap-x-1 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Email ")]),_.createElementVNode("th",{scope:"col",class:"min-w-36"},[_.createElementVNode("div",{class:"px-4 py-3 text-start flex items-center gap-x-1 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Last activity ")]),_.createElementVNode("th",{scope:"col"},[_.createElementVNode("div",{class:"px-4 py-3 text-start flex items-center gap-x-1 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Status ")])])]),_.createElementVNode("tbody",{class:"divide-y divide-gray-200 dark:divide-neutral-700"},[_.createElementVNode("tr",null,[_.createElementVNode("td",{class:"size-px whitespace-nowrap pe-4 py-3"},[_.createElementVNode("div",{class:"w-full flex items-center gap-x-3"},[_.createElementVNode("img",{class:"shrink-0 size-[38px] rounded-full",src:"https://images.unsplash.com/photo-1659482633369-9fe69af50bfb?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=3&w=320&h=320&q=80",alt:"Avatar"}),_.createElementVNode("div",{class:"grow"},[_.createElementVNode("span",{class:"text-sm font-medium text-gray-800 dark:text-neutral-200"}," James Collins ")])])]),_.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[_.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Admin ")]),_.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[_.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," james@site.com ")]),_.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[_.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Today ")]),_.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[_.createElementVNode("span",{class:"inline-flex items-center gap-x-1.5 py-1.5 px-2.5 text-xs font-medium bg-teal-100 text-teal-800 rounded-full dark:bg-teal-500/10 dark:text-teal-500"},[_.createElementVNode("span",{class:"size-1.5 inline-block bg-gray-800 rounded-full dark:bg-neutral-200"}),_.createTextVNode(" Active ")])])]),_.createElementVNode("tr",null,[_.createElementVNode("td",{class:"size-px whitespace-nowrap pe-4 py-3"},[_.createElementVNode("div",{class:"w-full flex items-center gap-x-3"},[_.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-[38px] bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," L "),_.createElementVNode("div",{class:"grow"},[_.createElementVNode("span",{class:"text-sm font-medium text-gray-800 dark:text-neutral-200"}," James Collins ")])])]),_.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[_.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Can view ")]),_.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[_.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," liza@site.com ")]),_.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[_.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," 2 days ago ")]),_.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[_.createElementVNode("span",{class:"inline-flex items-center gap-1.5 py-1.5 px-2 text-xs font-medium bg-gray-100 text-gray-800 rounded-full dark:bg-neutral-500/20 dark:text-neutral-400"},[_.createElementVNode("span",{class:"size-1.5 inline-block bg-gray-800 rounded-full dark:bg-neutral-400"}),_.createTextVNode(" Inactive ")])])]),_.createElementVNode("tr",null,[_.createElementVNode("td",{class:"size-px whitespace-nowrap pe-4 py-3"},[_.createElementVNode("div",{class:"w-full flex items-center gap-x-3"},[_.createElementVNode("img",{class:"shrink-0 size-[38px] rounded-full",src:"https://images.unsplash.com/photo-1601935111741-ae98b2b230b0?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=2.5&w=320&h=320&q=80",alt:"Avatar"}),_.createElementVNode("div",{class:"grow"},[_.createElementVNode("span",{class:"text-sm font-medium text-gray-800 dark:text-neutral-200"}," Daniel Hobbs ")])])]),_.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[_.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Can edit ")]),_.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[_.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," dhobbs@site.com ")]),_.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[_.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Today ")]),_.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[_.createElementVNode("span",{class:"inline-flex items-center gap-1.5 py-1.5 px-2 text-xs font-medium bg-gray-100 text-gray-800 rounded-full dark:bg-neutral-500/20 dark:text-neutral-400"},[_.createElementVNode("span",{class:"size-1.5 inline-block bg-gray-800 rounded-full dark:bg-neutral-400"}),_.createTextVNode(" Inactive ")])])]),_.createElementVNode("tr",null,[_.createElementVNode("td",{class:"size-px whitespace-nowrap pe-4 py-3"},[_.createElementVNode("div",{class:"w-full flex items-center gap-x-3"},[_.createElementVNode("img",{class:"shrink-0 size-[38px] rounded-full",src:"https://images.unsplash.com/photo-1679412330254-90cb240038c5?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=2.5&w=320&h=320&q=80",alt:"Avatar"}),_.createElementVNode("div",{class:"grow"},[_.createElementVNode("span",{class:"text-sm font-medium text-gray-800 dark:text-neutral-200"}," Brian Warner ")])])]),_.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[_.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Can edit ")]),_.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[_.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," brian@site.com ")]),_.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[_.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," 1 months ago ")]),_.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[_.createElementVNode("span",{class:"inline-flex items-center gap-x-1.5 py-1.5 px-2.5 text-xs font-medium bg-teal-100 text-teal-800 rounded-full dark:bg-teal-500/10 dark:text-teal-500"},[_.createElementVNode("span",{class:"size-1.5 inline-block bg-gray-800 rounded-full dark:bg-neutral-200"}),_.createTextVNode(" Active ")])])]),_.createElementVNode("tr",null,[_.createElementVNode("td",{class:"size-px whitespace-nowrap pe-4 py-3"},[_.createElementVNode("div",{class:"w-full flex items-center gap-x-3"},[_.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-[38px] bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," O "),_.createElementVNode("div",{class:"grow"},[_.createElementVNode("span",{class:"text-sm font-medium text-gray-800 dark:text-neutral-200"}," Ols Shols ")])])]),_.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[_.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Can view ")]),_.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[_.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," olsshols@site.com ")]),_.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[_.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," 6 days ago ")]),_.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[_.createElementVNode("span",{class:"inline-flex items-center gap-1.5 py-1.5 px-2 text-xs font-medium bg-gray-100 text-gray-800 rounded-full dark:bg-neutral-500/20 dark:text-neutral-400"},[_.createElementVNode("span",{class:"size-1.5 inline-block bg-gray-800 rounded-full dark:bg-neutral-400"}),_.createTextVNode(" Inactive ")])])])])])])])])],-1)])))}},j$={},U$={class:"shrink-0 size-4 text-gray-400 dark:text-white/60",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function H$(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("svg",U$,e[0]||(e[0]=[_.createElementVNode("circle",{cx:"11",cy:"11",r:"8"},null,-1),_.createElementVNode("path",{d:"m21 21-4.3-4.3"},null,-1)]))}const Z0=Ge(j$,[["render",H$]]),q$={components:{IconSearch:Z0},data(){return{link:null,color:void 0,data:null,searchValue:""}},mounted(){this.link="/admin.user-cls",this.getData()},computed:{rows(){var t,e;return((e=(t=this.data)==null?void 0:t.rows)==null?void 0:e.filter(n=>{var i;return(i=n==null?void 0:n.name)==null?void 0:i.includes(this.searchValue)}))||null}},methods:{async getData(){try{const{data:t}=await vt.get("/api/user-cls");this.data=t}catch{}}}},W$={class:"w-[300px] border-r",style:{height:"calc(100vh - 60px)"}},G$={class:"relative"},Z$={class:"flex flex-col w-[300px] gap-[4px] overflow-y-auto overflow-x-hidden p-[10px] pr-0 [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300",style:{height:"calc(100vh - 100px)"}},Y$={class:"w-[99%] overflow-hidden overflow-ellipsis"},X$={class:"ml-auto text-[10px] h-[16px] px-[6px] flex items-center justify-center rounded-full bg-gray-200"};function K$(t,e,n,i,r,a){const u=_.resolveComponent("IconSearch"),l=_.resolveComponent("VsText"),m=_.resolveComponent("router-link");return _.openBlock(),_.createElementBlock("div",W$,[_.createElementVNode("div",G$,[_.createVNode(u,{height:"16",width:"16",class:"absolute top-[12px] left-[30px] text-gray-500 z-[1]"}),_.createVNode(l,{type:"text",modelValue:r.searchValue,"onUpdate:modelValue":e[0]||(e[0]=x=>r.searchValue=x),clearable:!0,placeholder:"Пошук по меню",class:"[&>input]:h-[40px] [&>input]:block [&>input]:rounded-none [&>input]:border-x-0 [&>input]:pl-[60px] [&>input:focus]:outline-none [&>input:focus]:focus:ring-0 [&>input:focus]:border-y-gray-200 [&>input:focus]:border-y-1 [&>input:focus]:border-x-0"},null,8,["modelValue"])]),_.createElementVNode("ul",Z$,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(a.rows,x=>{var S,E;return _.openBlock(),_.createElementBlock("li",{key:x==null?void 0:x.id,class:"w-full pr-[10px]"},[_.createVNode(m,{to:r.link+"?name="+((x==null?void 0:x.name)||(x==null?void 0:x.id)),class:_.normalizeClass(["py-2 px-5 group pr-[10px] flex items-center gap-x-3 w-full flex justify-between hover:bg-gray-100 rounded-lg duration-300",{"bg-gray-100":((E=(S=t.$route)==null?void 0:S.query)==null?void 0:E.name)===(x==null?void 0:x.name)}])},{default:_.withCtx(()=>[_.createElementVNode("span",Y$,_.toDisplayString((x==null?void 0:x.name)||(x==null?void 0:x.id)),1),_.createElementVNode("span",X$,_.toDisplayString((x==null?void 0:x.children)||0),1)]),_:2},1032,["to","class"])])}),128))])])}const J$=Ge(q$,[["render",K$]]),Q$={props:{title:{type:String,default:()=>"Дані для відображення відсутні"},text:{type:String,default:()=>"Змініть параметри пошуку або спробуйте пізніше"}}},e8={class:"w-full"},t8={class:"p-5 min-h-[500px] flex flex-col justify-center items-center text-center"},n8={class:"max-w-sm mx-auto mt-6"},i8={class:"font-medium text-gray-800 dark:text-neutral-200"},r8={class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"};function s8(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("div",e8,[_.createElementVNode("div",t8,[e[0]||(e[0]=_.createStaticVNode('<svg class="w-48 mx-auto" viewBox="0 0 178 90" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs></svg>',1)),_.createElementVNode("div",n8,[_.createElementVNode("p",i8,_.toDisplayString(n.title),1),_.createElementVNode("p",r8,_.toDisplayString(n.text),1)])])])}const xS=Ge(Q$,[["render",s8]]),o8={props:{modelValue:{type:String,default:()=>"#172B4D"},colors:{type:Array,default:()=>["#172B4D","#0055CC","#206A83","#216E4E","#E56910","#AE2E24","#5E4DB2","#758195","#FF0000","#008000","#28A9AB","#AB7222"]}},methods:{updateColor(t){this.$emit("update:modelValue",t),this.$refs.popover.togglePopover()}}},a8={class:"flex w-[160px] flex-wrap gap-[4px]"},l8=["onClick"];function c8(t,e,n,i,r,a){const u=_.resolveComponent("VsPopover");return _.openBlock(),_.createBlock(u,{ref:"popover",placement:"bottom"},{reference:_.withCtx(()=>[_.createElementVNode("button",{class:"h-[37px] w-[37px] rounded-lg flex items-center justify-center",style:_.normalizeStyle({backgroundColor:n.modelValue})},null,4)]),default:_.withCtx(()=>[_.createElementVNode("div",null,[_.createElementVNode("ul",a8,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(n.colors,l=>(_.openBlock(),_.createElementBlock("li",{class:"h-[37px] w-[37px] rounded",style:_.normalizeStyle({backgroundColor:l}),onClick:m=>a.updateColor(l),key:l},null,12,l8))),128))])])]),_:1},512)}const bS=Ge(o8,[["render",c8]]),u8={components:{VsChoceColor:bS},props:{item:Object},data(){var t,e,n;return{color:((t=this.item)==null?void 0:t.color)||"#D1D5DB",text:((e=this.item)==null?void 0:e.text)||"",id:(n=this.item)==null?void 0:n.id}},watch:{color(t){this.$emit("update-item",{...this.item,color:t})},text(t){this.$emit("update-item",{...this.item,text:t})},id(t){this.$emit("update-item",{...this.item,id:t})}}},h8={class:"relative flex items-center p-3 bg-white border border-gray-200 group gap-x-3 rounded-xl"},d8={class:"flex flex-col"},p8={class:"flex gap-[30px]"},f8={class:"block text-sm font-semibold text-gray-800 text-start z-[10] cursor-pointer"},m8={class:"block text-sm font-semibold text-gray-400 text-start z-[10] cursor-pointer"},g8={class:"block text-xs text-gray-500 truncate dark:text-neutral-500"};function y8(t,e,n,i,r,a){var m;const u=_.resolveComponent("VsChoceColor"),l=_.resolveComponent("VsInlineEdit");return _.openBlock(),_.createElementBlock("div",h8,[_.createVNode(u,{modelValue:r.color,"onUpdate:modelValue":e[0]||(e[0]=x=>r.color=x)},null,8,["modelValue"]),_.createElementVNode("div",d8,[_.createElementVNode("div",p8,[_.createVNode(l,{modelValue:r.text,"onUpdate:modelValue":e[1]||(e[1]=x=>r.text=x),onUpdateValue:e[2]||(e[2]=x=>r.text=x)},{default:_.withCtx(()=>[_.createElementVNode("p",f8,_.toDisplayString(r.text),1)]),_:1},8,["modelValue"]),_.createVNode(l,{modelValue:r.id,"onUpdate:modelValue":e[3]||(e[3]=x=>r.id=x),onUpdateValue:e[4]||(e[4]=x=>r.id=x)},{default:_.withCtx(()=>[_.createElementVNode("p",m8,_.toDisplayString(r.id),1)]),_:1},8,["modelValue"])]),_.createElementVNode("p",g8,_.toDisplayString((m=n.item)==null?void 0:m.parent),1)])])}const _8={components:{VsReesterUsersItem:Ge(u8,[["render",y8]])},props:{list:Array},data(){return{draggedItemIndex:null}},methods:{dragStart(t,e){this.draggedItemIndex=e,t.dataTransfer.effectAllowed="move"},dragOver(t){t.preventDefault()},drop(t,e){t.preventDefault();const n=this.draggedItemIndex;if(n!==e){const i=[...this.list],r=i[n];i.splice(n,1),i.splice(e,0,r),this.$emit("update-list",i)}this.draggedItemIndex=null},dragEnd(){this.draggedItemIndex=null},updateItem(t){var n;const e=(n=this.list)==null?void 0:n.findIndex(i=>(i==null?void 0:i.id)===(t==null?void 0:t.id));this.list[e]=t,this.$emit("update-list",this.list)}}},x8={class:"flex flex w-full flex-col gap-[10px] p-[10px] pt-[40px] overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300",style:{width:"calc(100vw - 1000px)","max-height":"calc(100vh - 430px)"}},b8=["onDragstart","onDrop"];function v8(t,e,n,i,r,a){const u=_.resolveComponent("VsReesterUsersItem");return _.openBlock(),_.createElementBlock("ul",x8,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(n.list,(l,m)=>(_.openBlock(),_.createElementBlock("li",{key:l==null?void 0:l.id,draggable:!0,onDragstart:x=>a.dragStart(x,m),onDragover:e[0]||(e[0]=x=>a.dragOver(x)),onDrop:x=>a.drop(x,m),onDragend:e[1]||(e[1]=(...x)=>a.dragEnd&&a.dragEnd(...x))},[_.createVNode(u,{item:l,onUpdateItem:a.updateItem},null,8,["item","onUpdateItem"])],40,b8))),128))])}const w8={components:{VsNoData:xS,VsChoceColor:bS,IconCheck:Nb,VsReesterUsersList:Ge(_8,[["render",v8],["__scopeId","data-v-d46b1d2e"]])},data(){return{scheme:{text:{type:"Text",ua:"Ім'я",validators:["required"]}},formVisible:!0,formValues:{},color:"#172B4D",data:null}},watch:{$route:{handler(t,e){var n,i;((n=t==null?void 0:t.query)==null?void 0:n.name)!==((i=e==null?void 0:e.query)==null?void 0:i.name)&&this.getData()}}},mounted(){this.getData()},methods:{async getData(){var t;this.data=null;try{const{data:e}=await vt.get(`/api/user-cls/${(t=this.$route.query)==null?void 0:t.name}`);this.data=e}catch{}},async addOneChild(){var t,e,n,i;try{const{form:r}=this.$refs;await r.doValidation(),await vt.post("/api/user-cls",{name:(t=this.$route.query)==null?void 0:t.name,children:[...((e=this.data)==null?void 0:e.children)||[],{...this.formValues,color:this.color,id:(((i=(n=this.data)==null?void 0:n.children)==null?void 0:i.length)||0)+1}]}),this.formVisible=!1,this.formValues={},setTimeout(()=>this.formVisible=!0),await this.getData()}catch(r){console.log(r)}},async updateChildren(t){var e,n;this.data.children=t;try{await vt.post("/api/user-cls",{name:(e=this.$route.query)==null?void 0:e.name,children:[...((n=this.data)==null?void 0:n.children)||[]]}),await this.getData()}catch(i){console.log(i)}}}},k8={class:"flex justify-center bg-gray-50",style:{height:"calc(100vh - 60px)",width:"calc(100vw - 560px)"}},S8={key:0,class:"mt-[100px] p-[10px]",style:{"max-height":"calc(100vh - 300px)",width:"calc(100vw - 1000px)"}},E8={class:"flex items-end w-full gap-[4px]"};function C8(t,e,n,i,r,a){var E,T,I,z,F;const u=_.resolveComponent("VsForm"),l=_.resolveComponent("VsChoceColor"),m=_.resolveComponent("IconCheck"),x=_.resolveComponent("VsReesterUsersList"),S=_.resolveComponent("VsNoData");return _.openBlock(),_.createElementBlock("div",k8,[(T=(E=t.$route)==null?void 0:E.query)!=null&&T.name?(_.openBlock(),_.createElementBlock("div",S8,[e[3]||(e[3]=_.createElementVNode("h2",{class:"font-bold mb-[10px]"},"Створити",-1)),_.createElementVNode("div",E8,[r.formVisible?(_.openBlock(),_.createBlock(u,{key:0,ref:"form",scheme:r.scheme,modelValue:r.formValues,"onUpdate:modelValue":e[0]||(e[0]=j=>r.formValues=j),class:"p-0 m-0 h-[65px] w-full"},null,8,["scheme","modelValue"])):_.createCommentVNode("",!0),_.createVNode(l,{modelValue:r.color,"onUpdate:modelValue":e[1]||(e[1]=j=>r.color=j)},null,8,["modelValue"]),_.createElementVNode("button",{onClick:e[2]||(e[2]=(...j)=>a.addOneChild&&a.addOneChild(...j)),class:"h-[37px] w-[37px] rounded-lg bg-blue-600 ml-[6px] flex items-center justify-center text-white hover:bg-blue-700 duration-300"},[_.createVNode(m,{height:"20",width:"20"})])]),(z=(I=r.data)==null?void 0:I.children)!=null&&z.length?(_.openBlock(),_.createBlock(x,{key:0,list:(F=r.data)==null?void 0:F.children,onUpdateList:a.updateChildren},null,8,["list","onUpdateList"])):_.createCommentVNode("",!0)])):(_.openBlock(),_.createBlock(S,{key:1,class:"mt-[100px]",text:"Оберіть один з пунктів меню для відображення"}))])}const T8={components:{VsReesterNavList:J$,VsReesterContent:Ge(w8,[["render",C8]])}},M8={class:"flex items-start gap-0"};function A8(t,e,n,i,r,a){const u=_.resolveComponent("VsReesterNavList"),l=_.resolveComponent("VsReesterContent");return _.openBlock(),_.createElementBlock("div",M8,[_.createVNode(u),_.createVNode(l)])}const vS={...L$,...V$,"vs-dashboard":$$,...{"user-cls-page":Ge(T8,[["render",A8]])}},wS=t=>{const e=[];return t.forEach(n=>{n.menu?e.push(...wS(n.menu)):e.push(n)}),e},Xr=_.ref(null),I8=async()=>{try{const{data:t}=await vt.get("/api/user-menu");return Xr.value=t,wS(t)}catch(t){return console.error(t),[]}},P8=(t,e)=>{Object.entries(e).forEach(([n,i])=>{t.component(n,i)})},D8={async install(t,{componentsApp:e={}}){try{const i=(await I8()).filter(a=>a==null?void 0:a.component).map(a=>({...a,component:{...vS,...e}[a==null?void 0:a.component]}));P8(t,{...vS,...e}),t.component("admin",RT);const{router:r}=await gA(i);t.config.globalProperties={...t.config.globalProperties,$componentsConfig:{...ez,componentsApp:e},$router:r},t.use(r)}catch(n){console.error(n)}}},O8={data(){return{formValues:{},scheme:null,table:""}},mounted(){this.getFormScheme()},methods:{flattenMenu(t){const e=[];return t.forEach(n=>{n.menu?e.push(...this.flattenMenu(n.menu)):e.push(n)}),e},async getFormScheme(){var i,r;const t=this.flattenMenu(Xr.value);t!=null&&t.length||this.$router.replace("/404");const e=t==null?void 0:t.find(a=>{var u,l;return(a==null?void 0:a.path)==((l=(u=this.$route)==null?void 0:u.query)==null?void 0:l.table)});e||this.$router.replace("/404");const n=e==null?void 0:e.table;this.table=n;try{const{data:{form:a}}=await vt.get(`/api/template/table/${n}`),{data:{rows:u}}=await vt.get(`/api/table-data/${this.table}/${(r=(i=this.$route)==null?void 0:i.query)==null?void 0:r.id}`);this.formValues=u==null?void 0:u[0];const{data:l}=await vt.get(`/api/template/form/${a}`);this.scheme=(l==null?void 0:l.schema)||l}catch{}},async editObject(){var t,e;try{await this.$refs.form.doValidation(),await vt.put(`/api/table/${this.table}/${(e=(t=this.$route)==null?void 0:t.query)==null?void 0:e.id}`,this.formValues),await this.$router.back(),await this.$notify({title:"Успішно!",message:"Об'єкт успішно створено",type:"success"})}catch{this.$notify({title:"Помилка!",message:"Сталася помилка",type:"error"})}}}},z8={style:{width:"calc(100vw - 260px)"}},N8={class:"h-[76px] bg-gray-50 flex items-center justify-between px-[30px]"},R8={class:"flex items-center gap-[6px]"},B8={style:{height:"calc(100vh - 140px)",width:"calc(100vw - 260px)"},class:"bg-gray-50 p-[20px] flex"},L8={class:"bg-white w-full rounded-xl border p-[20px] overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"};function V8(t,e,n,i,r,a){const u=_.resolveComponent("VsForm");return _.openBlock(),_.createElementBlock("div",z8,[_.createElementVNode("div",N8,[e[3]||(e[3]=_.createElementVNode("h2",{class:"text-xl font-medium"},"Редагувати",-1)),_.createElementVNode("div",R8,[_.createElementVNode("button",{onClick:e[0]||(e[0]=l=>t.$router.back()),class:"py-2 px-3 flex items-center gap-x-2 text-sm font-medium rounded-lg border bg-white border-gray-100 text-gray-800 shadow focus:outline-none hover:bg-gray-50 hover:border-gray-100 duration-300"}," Скасувати "),_.createElementVNode("button",{onClick:e[1]||(e[1]=(...l)=>a.editObject&&a.editObject(...l)),class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent bg-blue-600 text-white hover:bg-blue-700 hover:text-white duration-300"}," Зберегти ")])]),_.createElementVNode("div",B8,[_.createElementVNode("div",L8,[r.scheme?(_.openBlock(),_.createBlock(u,{key:0,ref:"form",scheme:r.scheme,modelValue:r.formValues,"onUpdate:modelValue":e[2]||(e[2]=l=>r.formValues=l),class:"p-0 mt-[20px]"},null,8,["scheme","modelValue"])):_.createCommentVNode("",!0)])])])}const F8=Object.freeze(Object.defineProperty({__proto__:null,default:Ge(O8,[["render",V8]])},Symbol.toStringTag,{value:"Module"})),$8={data(){return{formValues:{},scheme:null,table:""}},mounted(){this.getFormScheme()},methods:{flattenMenu(t){const e=[];return t.forEach(n=>{n.menu?e.push(...this.flattenMenu(n.menu)):e.push(n)}),e},async getFormScheme(){const t=this.flattenMenu(Xr.value);t!=null&&t.length||this.$router.replace("/404");const e=t==null?void 0:t.find(i=>{var r,a;return(i==null?void 0:i.path)==((a=(r=this.$route)==null?void 0:r.query)==null?void 0:a.table)});e||this.$router.replace("/404");const n=e==null?void 0:e.table;this.table=n;try{const{data:{form:i}}=await vt.get(`/api/template/table/${n}`),{data:r}=await vt.get(`/api/template/form/${i}`);this.scheme=(r==null?void 0:r.schema)||r}catch{}},async createObject(){try{await this.$refs.form.doValidation(),await vt.post(`/api/table/${this.table}`,this.formValues),await this.$router.back(),await this.$notify({title:"Успішно!",message:"Об'єкт успішно створено",type:"success"})}catch{this.$notify({title:"Помилка!",message:"Сталася помилка",type:"error"})}}}},j8={style:{width:"calc(100vw - 260px)"}},U8={class:"h-[76px] bg-gray-50 flex items-center justify-between px-[30px]"},H8={class:"flex items-center gap-[6px]"},q8={style:{height:"calc(100vh - 150px)",width:"calc(100vw - 260px)"},class:"bg-gray-50 p-[20px] flex"},W8={class:"bg-white w-full rounded-xl border p-[20px] overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"};function G8(t,e,n,i,r,a){const u=_.resolveComponent("VsForm");return _.openBlock(),_.createElementBlock("div",j8,[_.createElementVNode("div",U8,[e[3]||(e[3]=_.createElementVNode("h2",{class:"text-xl font-medium"},"Створити",-1)),_.createElementVNode("div",H8,[_.createElementVNode("button",{onClick:e[0]||(e[0]=l=>t.$router.back()),class:"py-2 px-3 flex items-center gap-x-2 text-sm font-medium rounded-lg border bg-white border-gray-100 text-gray-800 shadow focus:outline-none hover:bg-gray-50 hover:border-gray-100 duration-300"}," Скасувати "),_.createElementVNode("button",{onClick:e[1]||(e[1]=(...l)=>a.createObject&&a.createObject(...l)),class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent bg-blue-600 text-white hover:bg-blue-700 hover:text-white duration-300"}," Зберегти ")])]),_.createElementVNode("div",q8,[_.createElementVNode("div",W8,[r.scheme?(_.openBlock(),_.createBlock(u,{key:0,ref:"form",scheme:r.scheme,modelValue:r.formValues,"onUpdate:modelValue":e[2]||(e[2]=l=>r.formValues=l),class:"p-0 mt-[20px]"},null,8,["scheme","modelValue"])):_.createCommentVNode("",!0)])])])}const Z8=Object.freeze(Object.defineProperty({__proto__:null,default:Ge($8,[["render",G8]])},Symbol.toStringTag,{value:"Module"})),Y8={};function X8(t,e,n,i,r,a){const u=_.resolveComponent("router-view");return _.openBlock(),_.createBlock(u)}const kS=Object.freeze(Object.defineProperty({__proto__:null,default:Ge(Y8,[["render",X8]])},Symbol.toStringTag,{value:"Module"})),K8={data(){return{objectData:null,component:""}},computed:{getRoute(){const t=this.flattenMenu(Xr.value);t!=null&&t.length||this.$router.replace("/404");const e=t==null?void 0:t.find(n=>{var i,r;return(n==null?void 0:n.table)==((r=(i=this.$route)==null?void 0:i.params)==null?void 0:r.table)});return e||this.$router.replace("/404"),e==null?void 0:e.path},getTitle(){var t,e,n,i,r,a,u,l,m,x,S,E,T,I,z;if((n=(e=(t=this.objectData)==null?void 0:t.rows)==null?void 0:e[0])!=null&&n.name)return((u=(a=(r=(i=this.objectData)==null?void 0:i.rows)==null?void 0:r[0])==null?void 0:a.name)==null?void 0:u.length)<35?(x=(m=(l=this.objectData)==null?void 0:l.rows)==null?void 0:m[0])==null?void 0:x.name:((I=(T=(E=(S=this.objectData)==null?void 0:S.rows)==null?void 0:E[0])==null?void 0:T.name)==null?void 0:I.slice(0,35))+" ...";{const F=(z=this.flattenMenu(Xr.value))==null?void 0:z.find(j=>{var G,ie;return(j==null?void 0:j.table)===((ie=(G=this.$route)==null?void 0:G.params)==null?void 0:ie.table)});return F==null?void 0:F.ua}}},async mounted(){await this.getObjectData(),await this.checkActiveComponent()},watch:{component(t){this.$router.replace({...this.$route,query:{tab:t}})}},methods:{async getObjectData(){var n;const{table:t,id:e}=(n=this.$route)==null?void 0:n.params;(!t||!e)&&this.$router.replace("/404");try{const{data:i}=await vt.get(`/api/table-data/${t}/${e}`);this.objectData=i}catch(i){console.error(i)}},getColClass(t){return`col-span-${t||12}`},getGridClass(){return"grid-cols-12"},checkActiveComponent(){var t,e,n,i,r,a,u,l,m;if((e=(t=this.$route)==null?void 0:t.query)!=null&&e.tab)this.component=(i=(n=this.$route)==null?void 0:n.query)==null?void 0:i.tab;else{const x=(a=(r=this.objectData)==null?void 0:r.panels)==null?void 0:a.find(S=>(S==null?void 0:S.type)==="tabs");(u=x==null?void 0:x.items)!=null&&u.length&&(this.component=((l=x.items[0])==null?void 0:l.component)||((m=x.items[0])==null?void 0:m.name))}},flattenMenu(t){const e=[];return t.forEach(n=>{n.menu?e.push(...this.flattenMenu(n.menu)):e.push(n)}),e}}},J8={style:{width:"calc(100vw - 260px)",height:"calc(100vh - 60px)"},class:"p-4 overflow-y-auto bg-gray-50"},Q8={class:"h-[76px] bg-gray-50 flex items-center justify-between pl-[15px]"},ej={class:""},tj={class:"text-lg font-semibold md:text-xl text-stone-800 dark:text-neutral-200"},nj={class:"flex items-center gap-[6px]"},ij={key:0,class:"bg-white border rounded-xl"},rj={class:"p-[10px] pl-[20px] text-xl"},sj=["innerHTML"],oj={key:1},aj={class:"p-[10px] pl-[20px] text-xl"},lj={key:0,class:"p-[20px] border-t"},cj={key:1,class:"p-[20px] border-t"},uj=["innerHTML"],hj={class:"flex space-x-1 w-full bg-white border border-b-0 rounded-tr-xl rounded-tl-xl h-[60px] items-center pl-[20px]"},dj=["onClick"],pj={key:0,class:"bg-white border border-t-0 rounded-bl-xl rounded-br-xl"},fj={key:0,class:"p-[20px] border-t"},mj={key:1,class:"p-[20px] border-t"},gj=["innerHTML"];function yj(t,e,n,i,r,a){var l,m,x;const u=_.resolveComponent("router-link");return _.openBlock(),_.createElementBlock("div",J8,[_.createElementVNode("div",Q8,[_.createElementVNode("div",ej,[_.createElementVNode("button",{onClick:e[0]||(e[0]=S=>t.$router.back()),class:"text-sm h-[20px] text-blue-600 font-medium hover:border-b hover:border-b-2 hover:border-b-blue-500"}," До таблиці "),_.createElementVNode("h2",tj,_.toDisplayString(a.getTitle),1)]),_.createElementVNode("div",nj,[_.createVNode(u,{to:`/edit?table=${a.getRoute}&id=${(m=(l=t.$route)==null?void 0:l.params)==null?void 0:m.id}`,class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white"},{default:_.withCtx(()=>e[1]||(e[1]=[_.createTextVNode(" Редагувати ")])),_:1},8,["to"])])]),_.createElementVNode("div",{class:_.normalizeClass(["grid gap-[20px]",a.getGridClass()])},[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList((x=r.objectData)==null?void 0:x.panels,(S,E)=>{var T;return _.openBlock(),_.createElementBlock("div",{key:E,class:_.normalizeClass(a.getColClass(S.col))},[S!=null&&S.name?(_.openBlock(),_.createElementBlock("div",ij,[_.createElementVNode("h2",rj,_.toDisplayString((S==null?void 0:S.title)||"Панель"),1),_.createElementVNode("div",{class:"p-[20px] border-t",innerHTML:(T=r.objectData)==null?void 0:T.data[S==null?void 0:S.name]},null,8,sj)])):S.type==="container"?(_.openBlock(),_.createElementBlock("div",oj,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(S.items,(I,z)=>{var F,j,G,ie,ae;return _.openBlock(),_.createElementBlock("div",{key:z,class:"border rounded-xl bg-white mb-[20px]"},[_.createElementVNode("h2",aj,_.toDisplayString((I==null?void 0:I.title)||"Панель"),1),I!=null&&I.component?(_.openBlock(),_.createElementBlock("div",lj,[(_.openBlock(),_.createBlock(_.resolveDynamicComponent(I.component),{geometry:(j=(F=r.objectData)==null?void 0:F.rows[0])==null?void 0:j.geom,zoom:16,id:(ie=(G=t.$route)==null?void 0:G.params)==null?void 0:ie.id},null,8,["geometry","id"]))])):_.createCommentVNode("",!0),I!=null&&I.name?(_.openBlock(),_.createElementBlock("div",cj,[_.createElementVNode("div",{innerHTML:(ae=r.objectData)==null?void 0:ae.data[I==null?void 0:I.name]},null,8,uj)])):_.createCommentVNode("",!0)])}),128))])):_.createCommentVNode("",!0),(S==null?void 0:S.type)==="tabs"?(_.openBlock(),_.createElementBlock(_.Fragment,{key:2},[_.createElementVNode("nav",hj,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(S==null?void 0:S.items,I=>(_.openBlock(),_.createElementBlock("button",{key:(I==null?void 0:I.name)||(I==null?void 0:I.component),onClick:z=>r.component=(I==null?void 0:I.component)||(I==null?void 0:I.name),class:_.normalizeClass(["px-2.5 h-[30px] py-1.5 relative inline-flex items-center gap-x-2 text-gray-500 hover:bg-gray-100 focus:bg-gray-100 hover:text-gray-800 text-sm whitespace-nowrap rounded-lg focus:outline-none",{" font-semibold after:absolute after:bottom-[-14px] after:left-2.5 after:right-2.5 after:z-10 after:h-0.5 after:bg-gray-800":r.component===(I==null?void 0:I.component)||r.component===(I==null?void 0:I.name),"":r.component!==(I==null?void 0:I.component)&&r.component!==(I==null?void 0:I.name)}])},_.toDisplayString(I==null?void 0:I.title),11,dj))),128))]),(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(S.items,(I,z)=>{var F,j,G,ie,ae;return _.openBlock(),_.createElementBlock(_.Fragment,{key:z},[r.component===(I==null?void 0:I.component)||r.component===(I==null?void 0:I.name)?(_.openBlock(),_.createElementBlock("div",pj,[I!=null&&I.component?(_.openBlock(),_.createElementBlock("div",fj,[(_.openBlock(),_.createBlock(_.resolveDynamicComponent(I.component),{geometry:(j=(F=r.objectData)==null?void 0:F.rows[0])==null?void 0:j.geom,zoom:16,id:(ie=(G=t.$route)==null?void 0:G.params)==null?void 0:ie.id},null,8,["geometry","id"]))])):_.createCommentVNode("",!0),I!=null&&I.name?(_.openBlock(),_.createElementBlock("div",mj,[_.createElementVNode("div",{innerHTML:(ae=r.objectData)==null?void 0:ae.data[I==null?void 0:I.name]},null,8,gj)])):_.createCommentVNode("",!0)])):_.createCommentVNode("",!0)],64)}),128))],64)):_.createCommentVNode("",!0)],2)}),128))],2)])}const _j=Object.freeze(Object.defineProperty({__proto__:null,default:Ge(K8,[["render",yj],["__scopeId","data-v-e9d5b2dd"]])},Symbol.toStringTag,{value:"Module"})),xj={},bj={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-logout"};function vj(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("svg",bj,e[0]||(e[0]=[_.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),_.createElementVNode("path",{d:"M14 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2"},null,-1),_.createElementVNode("path",{d:"M9 12h12l-3 -3"},null,-1),_.createElementVNode("path",{d:"M18 15l3 -3"},null,-1)]))}const wj=Ge(xj,[["render",vj]]),kj={},Sj={viewBox:"0 0 1823 249",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Ej(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("svg",Sj,e[0]||(e[0]=[_.createStaticVNode('<path d="M218.88 96.05C223.55 99.19 228.69 101.56 234.09 103.07V145.42C212.05 151.54 195.83 171.79 195.83 195.75C195.83 200.22 196.41 204.65 197.53 208.94L160.92 230.08C156.82 226.06 152.08 222.73 146.91 220.24V171.62C164.83 163.13 176.59 145.06 176.59 124.48C176.59 123.17 176.54 121.86 176.44 120.56L218.88 96.05ZM220.32 79.09L160.97 113.36C162.04 116.88 162.61 120.61 162.61 124.48C162.61 142.66 149.93 157.87 132.93 161.76V230.05C143.4 232.46 152.23 239.16 157.46 248.21L215 214.99C211.7 209.34 209.81 202.77 209.81 195.75C209.81 174.62 226.94 157.49 248.07 157.49V91.02C237.14 91.02 227.29 86.43 220.32 79.09Z" fill="#CE3936"></path><path d="M161.39 19.13L197.44 39.94C196.39 44.11 195.84 48.42 195.84 52.75C195.84 54.21 195.9 55.65 196.02 57.1L153.9 81.42C145.27 75.5 134.95 72.24 124.36 72.24C113.83 72.24 103.57 75.47 94.96 81.32L52.71 56.93C52.82 55.55 52.88 54.16 52.88 52.76C52.88 48.43 52.34 44.12 51.28 39.95L87.3 19.16C96.98 28.89 110.26 34.58 124.34 34.58C138.42 34.57 151.7 28.87 161.39 19.13ZM157.77 0.919983C151.24 12.66 138.71 20.6 124.33 20.6C109.95 20.6 97.44 12.67 90.9 0.939983L33.9 33.85C37.08 39.43 38.91 45.88 38.91 52.76C38.91 56.71 38.31 60.52 37.2 64.11L96.46 98.32C103.44 90.87 113.36 86.22 124.37 86.22C135.44 86.22 145.41 90.93 152.39 98.44L211.59 64.27C210.45 60.64 209.83 56.78 209.83 52.77C209.83 45.89 211.65 39.44 214.84 33.86L157.77 0.919983Z" fill="#CE3936"></path><path d="M29.97 95.95L72.28 120.38C72.17 121.74 72.12 123.1 72.12 124.47C72.12 145.02 83.86 163.08 101.74 171.58V220.23C96.58 222.71 91.84 226.04 87.75 230.05L51.17 208.93C52.29 204.64 52.87 200.21 52.87 195.74C52.87 171.78 36.65 151.53 14.61 145.41V103.06C20.07 101.55 25.27 99.14 29.97 95.95ZM28.5 78.97C21.52 86.38 11.63 91.02 0.640015 91.02V157.49C21.77 157.49 38.9 174.62 38.9 195.75C38.9 202.77 37 209.33 33.71 214.99L91.2 248.18C96.43 239.14 105.25 232.45 115.71 230.04V161.73C98.74 157.81 86.09 142.62 86.09 124.46C86.09 120.54 86.68 116.75 87.78 113.18L28.5 78.97Z" fill="#CE3936"></path><path d="M498.39 177.5V144.88C498.39 128.55 485.11 115.27 468.78 115.27H343.22C342.69 115.27 342.18 115.32 341.67 115.4H337.19C332.35 115.4 328.42 111.46 328.42 106.63V74C328.42 69.16 332.36 65.23 337.19 65.23H486.33C492.08 65.23 496.75 60.57 496.75 54.81C496.75 49.06 492.08 44.39 486.33 44.39H337.19C320.86 44.39 307.58 57.67 307.58 74V106.62C307.58 122.95 320.86 136.23 337.19 136.23H462.75C463.28 136.23 463.79 136.18 464.3 136.1H468.78C473.62 136.1 477.55 140.04 477.55 144.87V177.49C477.55 182.33 473.61 186.26 468.78 186.26H319.64C313.89 186.26 309.22 190.92 309.22 196.68C309.22 202.43 313.89 207.1 319.64 207.1H468.78C485.11 207.11 498.39 193.83 498.39 177.5Z" fill="#CE3935"></path><path d="M710.7 177.32V75.24C710.7 58.91 697.42 45.63 681.09 45.63H550.05C533.72 45.63 520.44 58.91 520.44 75.24V177.32C520.44 193.65 533.72 206.93 550.05 206.93H681.1C697.42 206.93 710.7 193.65 710.7 177.32ZM541.27 75.24C541.27 70.4 545.21 66.47 550.04 66.47H681.09C685.93 66.47 689.86 70.41 689.86 75.24V177.32C689.86 182.16 685.92 186.09 681.09 186.09H550.05C545.21 186.09 541.28 182.15 541.28 177.32V75.24H541.27Z" fill="#CE3935"></path><path d="M1823 177.32V75.24C1823 58.91 1809.72 45.63 1793.39 45.63H1662.34C1646.01 45.63 1632.73 58.91 1632.73 75.24V177.32C1632.73 193.65 1646.01 206.93 1662.34 206.93H1793.39C1809.72 206.93 1823 193.65 1823 177.32ZM1653.57 75.24C1653.57 70.4 1657.51 66.47 1662.34 66.47H1793.39C1798.23 66.47 1802.16 70.41 1802.16 75.24V177.32C1802.16 182.16 1798.22 186.09 1793.39 186.09H1662.34C1657.5 186.09 1653.57 182.15 1653.57 177.32V75.24Z" fill="#CE3935"></path><path d="M756.76 196.51V152H849.42C855.17 152 859.84 147.34 859.84 141.58C859.84 135.83 855.17 131.16 849.42 131.16H756.76V75.23C756.76 70.39 760.7 66.46 765.53 66.46H893.29C899.04 66.46 903.71 61.8 903.71 56.04C903.71 50.29 899.04 45.62 893.29 45.62H765.53C749.2 45.62 735.92 58.9 735.92 75.23V196.5C735.92 202.25 740.59 206.92 746.34 206.92C752.09 206.93 756.76 202.27 756.76 196.51Z" fill="#CE3935"></path><path d="M933.86 66.47H1006.51V194.32C1006.51 200.07 1011.18 204.74 1016.93 204.74C1022.68 204.74 1027.35 200.07 1027.35 194.32V66.47H1100C1105.75 66.47 1110.42 61.81 1110.42 56.05C1110.42 50.3 1105.76 45.63 1100 45.63H933.86C928.11 45.63 923.44 50.29 923.44 56.05C923.45 61.81 928.11 66.47 933.86 66.47Z" fill="#CE3935"></path><path d="M1218.44 204.19C1224.19 204.19 1228.86 199.53 1228.86 193.77V152H1368.13C1384.46 152 1397.74 138.72 1397.74 122.39V75.24C1397.74 58.91 1384.46 45.63 1368.13 45.63H1237.63C1221.3 45.63 1208.02 58.91 1208.02 75.24V193.77C1208.02 199.53 1212.68 204.19 1218.44 204.19ZM1237.63 66.47H1368.13C1372.97 66.47 1376.9 70.41 1376.9 75.24V122.39C1376.9 127.23 1372.96 131.16 1368.13 131.16H1228.86V75.23C1228.86 70.41 1232.79 66.47 1237.63 66.47Z" fill="#CE3935"></path><path d="M1430.64 204.19C1436.39 204.19 1441.06 199.53 1441.06 193.77V152H1523.95C1524.57 153.18 1525.42 154.26 1526.51 155.17L1581.89 201.23C1583.83 202.85 1586.2 203.64 1588.55 203.64C1591.54 203.64 1594.5 202.36 1596.57 199.88C1600.25 195.46 1599.64 188.89 1595.22 185.21L1555.29 152H1580.33C1596.66 152 1609.94 138.72 1609.94 122.39V75.24C1609.94 58.91 1596.66 45.63 1580.33 45.63H1449.83C1433.5 45.63 1420.22 58.91 1420.22 75.24V193.77C1420.22 199.53 1424.88 204.19 1430.64 204.19ZM1449.83 66.47H1580.33C1585.17 66.47 1589.1 70.41 1589.1 75.24V122.39C1589.1 127.23 1585.17 131.16 1580.33 131.16H1441.06V75.23C1441.05 70.41 1444.99 66.47 1449.83 66.47Z" fill="#CE3935"></path>',10)]))}const Cj=Ge(kj,[["render",Ej]]),Tj={},Mj={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-chevron-down"};function Aj(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("svg",Mj,e[0]||(e[0]=[_.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),_.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)]))}const Ij={components:{IconChevronDown:Ge(Tj,[["render",Aj]])},props:{route:Object},mounted(){var t,e,n;(t=this.route)!=null&&t.menu&&(n=(e=this.route)==null?void 0:e.menu)!=null&&n.some(i=>{var r,a;return(i==null?void 0:i.path)===this.$route.path.replace("/","")||((a=(r=this.$route)==null?void 0:r.params)==null?void 0:a.table)===(i==null?void 0:i.table)&&(i==null?void 0:i.table)})&&(this.isOpen=!0)},data(){return{isOpen:!1}}},Pj={key:0,class:""},Dj={class:"ml-[30px] py-[6px] before:block before:absolute relative w-[196px] flex flex-col gap-[6px] inline-block before:w-[2px] before:h-[100%] before:bg-gray-100 before:left-[-14px] cursor-pointer"},Oj={key:1};function zj(t,e,n,i,r,a){var m,x,S,E,T,I,z,F,j,G,ie,ae,J;const u=_.resolveComponent("IconChevronDown"),l=_.resolveComponent("router-link");return(m=n.route)!=null&&m.menu?(_.openBlock(),_.createElementBlock("div",Pj,[_.createElementVNode("button",{onClick:e[0]||(e[0]=Ce=>r.isOpen=!r.isOpen),class:_.normalizeClass(["flex cursor-pointer gap-x-3 py-2 px-3 text-sm text-gray-800 justify-start w-full border-none focus:outline-none text-gray-800 rounded-lg items-center hover:bg-gray-100 duration-300",[((S=(x=n.route)==null?void 0:x.menu)==null?void 0:S.some(Ce=>{var be,Ae;return(Ce==null?void 0:Ce.path)===t.$route.path.replace("/","")||(Ce==null?void 0:Ce.table)===((Ae=(be=t.$route)==null?void 0:be.params)==null?void 0:Ae.table)&&(Ce==null?void 0:Ce.table)}))&&"bg-gray-100"]])},[_.createTextVNode(_.toDisplayString((E=n.route)==null?void 0:E.ua)+" ",1),_.createVNode(u,{class:_.normalizeClass([[r.isOpen&&"-rotate-180"],"ml-auto duration-300"]),width:"14",height:"14"},null,8,["class"])],2),_.createVNode(_.Transition,{name:"fade"},{default:_.withCtx(()=>{var Ce;return[_.withDirectives(_.createElementVNode("ul",Dj,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList((Ce=n.route)==null?void 0:Ce.menu,(be,Ae)=>{var Fe,Pe;return _.openBlock(),_.createElementBlock("li",{key:Ae,class:"w-full"},[_.createVNode(l,{to:"/"+(be==null?void 0:be.path),class:_.normalizeClass([[((be==null?void 0:be.path)===t.$route.path.replace("/","")||((Pe=(Fe=t.$route)==null?void 0:Fe.params)==null?void 0:Pe.table)===(be==null?void 0:be.table)&&(be==null?void 0:be.table))&&"bg-gray-100"],"flex gap-x-4 py-2 px-3 text-sm text-gray-800 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100"])},{default:_.withCtx(()=>[_.createTextVNode(_.toDisplayString(be==null?void 0:be.ua),1)]),_:2},1032,["to","class"])])}),128))],512),[[_.vShow,r.isOpen]])]}),_:1})])):(_.openBlock(),_.createElementBlock("div",Oj,[_.createVNode(l,{to:((I=(T=n.route)==null?void 0:T.path)==null?void 0:I[0])==="/"?(z=n.route)==null?void 0:z.path:"/"+((F=n.route)==null?void 0:F.path),class:_.normalizeClass([[(((j=n.route)==null?void 0:j.path.replace("/",""))===t.$route.path.replace("/","")||((ie=(G=t.$route)==null?void 0:G.params)==null?void 0:ie.table)===((ae=n.route)==null?void 0:ae.table)&&((J=n.route)==null?void 0:J.table))&&"bg-gray-100"],"flex gap-x-3 py-2 w-full font-[400] px-3 text-sm text-gray-800 rounded-lg items-center hover:bg-gray-100 duration-300 hover:text-gray-800"])},{default:_.withCtx(()=>{var Ce;return[_.createTextVNode(_.toDisplayString((Ce=n.route)==null?void 0:Ce.ua),1)]}),_:1},8,["to","class"])]))}const Nj={components:{IconLogout:wj,NavbarItem:Ge(Ij,[["render",zj]]),IconLogo:Cj,IconSearch:Z0},data(){return{activeIndex:null,data:null,searchValue:""}},computed:{data(){var t,e;return(t=this.searchValue)!=null&&t.trim()?(e=this.flattenMenu(Xr.value))==null?void 0:e.filter(n=>{var i,r,a;return(a=(i=n==null?void 0:n.ua)==null?void 0:i.toLowerCase())==null?void 0:a.includes((r=this.searchValue)==null?void 0:r.toLowerCase())}):Xr.value}},methods:{flattenMenu(t){const e=[];return t.forEach(n=>{n.menu?e.push(...this.flattenMenu(n.menu)):e.push(n)}),e}}},Rj={class:"flex flex-col h-[100vh] border-r w-[260px] shrink-0"},Bj={class:"relative"},Lj={class:"p-[16px] overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},Vj={class:"pb-3 w-full flex flex-col flex-wrap"},Fj={key:0,class:"flex flex-col gap-[6px]"},$j={key:1,class:"text-gray-800 text-lg mt-[20px]"};function jj(t,e,n,i,r,a){var S;const u=_.resolveComponent("IconLogo"),l=_.resolveComponent("IconSearch"),m=_.resolveComponent("VsText"),x=_.resolveComponent("NavbarItem");return _.openBlock(),_.createElementBlock("div",Rj,[_.createVNode(u,{height:"40",width:"200",class:"my-[20px] ml-[20px]"}),_.createElementVNode("div",Bj,[_.createVNode(l,{height:"16",width:"16",class:"absolute top-[12px] left-[30px] text-gray-500 z-[1]"}),_.createVNode(m,{type:"text",modelValue:r.searchValue,"onUpdate:modelValue":e[0]||(e[0]=E=>r.searchValue=E),clearable:!0,placeholder:"Пошук по меню",class:"[&>input]:h-[40px] [&>input]:block [&>input]:rounded-none [&>input]:border-x-0 [&>input]:pl-[60px] [&>input:focus]:outline-none [&>input:focus]:focus:ring-0 [&>input:focus]:border-y-gray-200 [&>input:focus]:border-y-1 [&>input:focus]:border-x-0"},null,8,["modelValue"])]),_.createElementVNode("div",Lj,[_.createElementVNode("nav",Vj,[(S=a.data)!=null&&S.length?(_.openBlock(),_.createElementBlock("ul",Fj,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(a.data,(E,T)=>(_.openBlock(),_.createElementBlock("li",{key:T,class:"flex flex-col gap-[6px]"},[_.createVNode(x,{route:E},null,8,["route"])]))),128))])):(_.openBlock(),_.createElementBlock("div",$j,"Не знайдено"))])])])}const Uj=Ge(Nj,[["render",jj]]),Hj={},qj={class:"flex-shrink-0 size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function Wj(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("svg",qj,e[0]||(e[0]=[_.createElementVNode("path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9"},null,-1),_.createElementVNode("path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0"},null,-1)]))}const Gj={components:{IconMessage:Ge(Hj,[["render",Wj]])},mounted(){this.getNotificationsCount},data(){return{count:0}},methods:{async getNotificationsCount(){try{const{data:t}=await axios.get("/api/user-info");this.count=t==null?void 0:t.notifications}catch{}}}},Zj={class:"hs-tooltip [--placement:bottom] inline-block show"},Yj={class:"hs-tooltip-toggle relative size-[38px] inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent text-gray-500 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100"},Xj={key:0,class:"flex absolute top-0 end-0 -mt-1.5 -me-1.5"},Kj={class:"relative min-w-[18px] min-h-[18px] inline-flex justify-center items-center text-[10px] bg-red-500 text-white rounded-full px-1"};function Jj(t,e,n,i,r,a){const u=_.resolveComponent("IconMessage");return _.openBlock(),_.createElementBlock("div",Zj,[_.createElementVNode("button",Yj,[_.createVNode(u,{height:"24",width:"24"}),r.count?(_.openBlock(),_.createElementBlock("span",Xj,[e[0]||(e[0]=_.createElementVNode("span",{class:"absolute inline-flex bg-red-400 rounded-full opacity-75 animate-ping size-full dark:bg-red-600"},null,-1)),_.createElementVNode("span",Kj,_.toDisplayString(r.count),1)])):_.createCommentVNode("",!0)]),e[1]||(e[1]=_.createElementVNode("span",{class:"hs-tooltip-content hs-tooltip-shown:opacity-100 hs-tooltip-shown:visible opacity-0 inline-block absolute invisible z-20 py-1.5 px-2.5 bg-gray-900 text-xs text-white rounded-lg dark:bg-neutral-700 hidden",role:"tooltip","data-popper-placement":"bottom",style:{position:"fixed",inset:"0px auto auto 0px",margin:"0px",transform:"translate(1686px, 53px)"}},null,-1))])}const Qj=Ge(Gj,[["render",Jj]]),e7={},t7={class:"flex-shrink-0 size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function n7(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("svg",t7,e[0]||(e[0]=[_.createElementVNode("circle",{cx:"12",cy:"12",r:"10"},null,-1),_.createElementVNode("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"},null,-1),_.createElementVNode("path",{d:"M12 17h.01"},null,-1)]))}const i7=Ge(e7,[["render",n7]]),r7={},s7={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",class:"icon icon-tabler icons-tabler-filled icon-tabler-user"};function o7(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("svg",s7,e[0]||(e[0]=[_.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),_.createElementVNode("path",{d:"M12 2a5 5 0 1 1 -5 5l.005 -.217a5 5 0 0 1 4.995 -4.783z"},null,-1),_.createElementVNode("path",{d:"M14 14a5 5 0 0 1 5 5v1a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-1a5 5 0 0 1 5 -5h4z"},null,-1)]))}const a7={components:{IconQuestion:i7,IconUser:Ge(r7,[["render",o7]]),AdminNotifucation:Qj},mounted(){this.getUserData()},data(){return{userData:null,isVisible:!1}},watch:{isVisible(t){t?setTimeout(()=>window.addEventListener("click",this.closeOnOutsideClick),0):window.removeEventListener("click",this.closeOnOutsideClick)}},methods:{async getUserData(){try{const{data:t}=await vt.get("/user");this.userData=t}catch{}},async logout(){try{await vt.get("/logout"),await window.history.pushState({},"","/login"),await location.reload(),localStorage.removeItem("user")}catch{}},closeOnOutsideClick(){this.isVisible=!1}},beforeUnmount(){window.removeEventListener("click",this.closeOnOutsideClick)}},l7={class:"h-[60px] border-b flex justify-end px-[20px]",style:{width:"calc(100vw - 260px)"}},c7={class:"flex items-center gap-[6px]"},u7={href:"docs-softpro.com",class:"size-[38px] inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent text-gray-500 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100 dark:text-neutral-400 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},h7={class:"relative"},d7=["src"],p7={key:1,class:"size-[40px] rounded-full bg-gray-200 flex items-center justify-center"},f7={class:"p-[10px] gap-[6px] items-center border-b flex justify-between"},m7=["src"],g7={key:1,class:"size-[40px] rounded-full bg-gray-200 flex items-center justify-center"},y7={class:"text-[14px] mr-[10px] text-gray-500"},_7={class:"flex flex-col p-[4px]"};function x7(t,e,n,i,r,a){var S,E,T,I,z,F,j,G,ie,ae;const u=_.resolveComponent("IconQuestion"),l=_.resolveComponent("AdminNotifucation"),m=_.resolveComponent("IconUser"),x=_.resolveComponent("router-link");return _.openBlock(),_.createElementBlock("div",l7,[_.createElementVNode("div",c7,[_.createElementVNode("a",u7,[_.createVNode(u,{height:"24",width:"24"})]),_.createVNode(l),e[4]||(e[4]=_.createElementVNode("div",{class:"h-[30px] w-[1px] bg-gray-200 ml-[10px] mr-[10px]"},null,-1)),_.createElementVNode("div",h7,[_.createElementVNode("div",{onClick:e[0]||(e[0]=J=>r.isVisible=!0),class:"cursor-pointer"},[(E=(S=r.userData)==null?void 0:S.user)!=null&&E.avatar?(_.openBlock(),_.createElementBlock("img",{key:0,class:"flex-shrink-0 size-[30px] rounded-full",src:(I=(T=r.userData)==null?void 0:T.user)==null?void 0:I.avatar,alt:"Image Description"},null,8,d7)):(_.openBlock(),_.createElementBlock("div",p7,[_.createVNode(m)]))]),r.isVisible?(_.openBlock(),_.createElementBlock("div",{key:0,onClick:e[2]||(e[2]=_.withModifiers(()=>{},["stop"])),class:"fixed bg-white w-[180px] top-[55px] right-[20px] shadow-xl rounded-xl z-[1]"},[_.createElementVNode("div",f7,[(F=(z=r.userData)==null?void 0:z.user)!=null&&F.avatar?(_.openBlock(),_.createElementBlock("img",{key:0,class:"flex-shrink-0 size-[30px] rounded-full",src:(G=(j=r.userData)==null?void 0:j.user)==null?void 0:G.avatar,alt:"Image Description"},null,8,m7)):(_.openBlock(),_.createElementBlock("div",g7,[_.createVNode(m)])),_.createElementVNode("div",null,[_.createElementVNode("p",y7,_.toDisplayString((ae=(ie=r.userData)==null?void 0:ie.user)==null?void 0:ae.username),1)])]),_.createElementVNode("div",_7,[_.createVNode(x,{disabled:!0,class:"p-[8px] block rounded-lg w-full mb-[4px] text-start hover:bg-gray-100 !duration-300"},{default:_.withCtx(()=>e[3]||(e[3]=[_.createTextVNode("Профіль")])),_:1}),_.createElementVNode("button",{onClick:e[1]||(e[1]=(...J)=>a.logout&&a.logout(...J)),class:"p-[8px] block rounded-lg w-full text-start hover:bg-gray-100 !duration-300"}," Вийти ")])])):_.createCommentVNode("",!0)])])])}const b7={components:{navbar:Uj,AdminHeader:Ge(a7,[["render",x7]])},mounted(){this.getMenu()},computed:{isMenu(){return Xr.value}},methods:{async getMenu(){try{const{data:t}=await vt.get("/api/user-menu");t.filter(e=>e.path==="/"),Xr.value=t}catch{}}}},v7={class:"admin-wrapper"},w7={class:"flex flex-col"};function k7(t,e,n,i,r,a){const u=_.resolveComponent("navbar"),l=_.resolveComponent("admin-header"),m=_.resolveComponent("router-view");return _.openBlock(),_.createElementBlock("div",v7,[_.createVNode(u),_.createElementVNode("div",w7,[a.isMenu?(_.openBlock(),_.createElementBlock(_.Fragment,{key:0},[_.createVNode(l),_.createVNode(m)],64)):_.createCommentVNode("",!0)])])}const S7=Object.freeze(Object.defineProperty({__proto__:null,default:Ge(b7,[["render",k7],["__scopeId","data-v-776e8b33"]])},Symbol.toStringTag,{value:"Module"})),E7={data(){return{currentSort:""}},props:{data:{type:Object,default:()=>null},activeColumn:{type:String}},computed:{label(){var t,e;return((t=this.data)==null?void 0:t.ua)||((e=this.data)==null?void 0:e.label)||this.data.title||"null"},selectedSortParam(){var t,e;return(e=(t=this.$route)==null?void 0:t.query)==null?void 0:e.sort},getVisibleIcon(){return this.data.format!=="image"&&this.data.format!=="verify"}},watch:{activeColumn(t){t!==this.data.name&&(this.currentSort="")}},methods:{changeCurrentSort(t){switch(t){case"":return"asc";case"asc":return"desc";case"desc":return"";default:return""}},handleClickSortBtn(t){this.$emit("change-active",this.data.name),this.currentSort=this.changeCurrentSort(t);const e=this.$route.query,{sort:n,...i}=e,r=this.currentSort?`${this.data.name}-${this.currentSort}`:"";this.$router.replace({query:{...i,...r&&{sort:r}}})},isValueEqualToSelected(t){return`${this.data.name}-${t}`===this.selectedSortParam}}},C7={scope:"col",class:"text-start"},T7={class:"flex-shrink-0 size-3.5",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},M7={key:0,d:"m7 15 5 5 5-5"},A7={key:1,d:"m7 9 5-5 5 5"},I7={key:1,class:"text-sm text-gray-800 px-[4px] py-2.5 text-start font-normal text-gray-500"};function P7(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("th",C7,[a.getVisibleIcon?(_.openBlock(),_.createElementBlock("button",{key:0,type:"button",class:"text-sm text-gray-800 px-[4px] py-2.5 text-start font-normal text-gray-500 flex items-center gap-[6px]",onClick:e[0]||(e[0]=u=>a.handleClickSortBtn(r.currentSort))},[_.createTextVNode(_.toDisplayString(a.label)+" ",1),(_.openBlock(),_.createElementBlock("svg",T7,[r.currentSort==="asc"||r.currentSort===""?(_.openBlock(),_.createElementBlock("path",M7)):_.createCommentVNode("",!0),r.currentSort==="desc"||r.currentSort===""?(_.openBlock(),_.createElementBlock("path",A7)):_.createCommentVNode("",!0)]))])):(_.openBlock(),_.createElementBlock("p",I7,_.toDisplayString(a.label),1))])}const D7=Ge(E7,[["render",P7]]),O7={},z7={class:"flex-shrink-0 size-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function N7(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("svg",z7,e[0]||(e[0]=[_.createStaticVNode('<path d="M3 6h18"></path><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"></path><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"></path><line x1="10" x2="10" y1="11" y2="17"></line><line x1="14" x2="14" y1="11" y2="17"></line>',5)]))}const R7=Ge(O7,[["render",N7]]),B7={props:{height:{type:String,default:"16"},width:{type:String,default:"12"},color:{type:String,default:"black"}}},L7={style:{display:"none"}},V7=["height","width","fill"];function F7(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock(_.Fragment,null,[(_.openBlock(),_.createElementBlock("svg",L7,e[0]||(e[0]=[_.createElementVNode("symbol",{id:"icon-pencil",viewBox:"0 0 32 32"},[_.createElementVNode("path",{d:"M27 0c2.761 0 5 2.239 5 5 0 1.126-0.372 2.164-1 3l-2 2-7-7 2-2c0.836-0.628 1.874-1 3-1zM2 23l-2 9 9-2 18.5-18.5-7-7-18.5 18.5zM22.362 11.362l-14 14-1.724-1.724 14-14 1.724 1.724z"})],-1)]))),(_.openBlock(),_.createElementBlock("svg",{height:n.height,width:n.width,fill:n.color},e[1]||(e[1]=[_.createElementVNode("use",{"xlink:href":"#icon-pencil"},null,-1)]),8,V7))],64)}const $7={components:{IconMore:mS,IconDelete:R7,IconEdit:Ge(B7,[["render",F7]])},emits:["updateTable"],props:{item:Object,table:String,isForm:null,actions:Array,default:()=>[]},data(){return{formVisible:!1,isDeleteConfirm:!1,formValue:{},top:0,left:0}},methods:{openConfirm(){this.isDeleteConfirm=!0,document.querySelector("body").click()},async getData(){var t;try{const{data:e}=await vt.get(`/api/table/${this.table}/${(t=this.item)==null?void 0:t.id}`);this.formValue=e}catch(e){console.error(e)}},doSomethingOnCancel(){this.formVisible=!1},async deleteElement(){var t;try{vt.delete(`/api/table/${this.table}/${(t=this.item)==null?void 0:t.id}`),this.$notify({title:"Успішно!",message:"Об`єкт успішно видалeно",type:"success"}),await this.$emit("update-table"),this.isDeleteConfirm=!1}catch{this.$notify({title:"Помилка!",message:"Сталася помилка",type:"error"})}}}},j7={class:"hs-dropdown [--placement:bottom-right] inline-flex"},U7={class:"gap-x-2 p-[4px] rounded-lg shadow-sm hover:border-transparent border focus:outline-none text-black hover:bg-gray-50"},H7={class:"flex flex-col items-start"},q7={key:1,class:"h-[1px] w-[80%] bg-gray-200 ml-auto mr-auto"},W7={class:"p-4"},G7={class:"flex justify-end mt-4 gap-x-3"};function Z7(t,e,n,i,r,a){const u=_.resolveComponent("IconMore"),l=_.resolveComponent("IconEdit"),m=_.resolveComponent("router-link"),x=_.resolveComponent("IconDelete"),S=_.resolveComponent("VsPopover"),E=_.resolveComponent("VsDialog");return _.openBlock(),_.createElementBlock(_.Fragment,null,[_.createElementVNode("div",j7,[_.createVNode(S,{trigger:"click",placement:"bottom"},{reference:_.withCtx(()=>[_.createElementVNode("button",U7,[_.createVNode(u,{height:"16",width:"16"})])]),default:_.withCtx(()=>{var T,I,z,F,j;return[_.createElementVNode("div",H7,[(T=n.actions)!=null&&T.includes("edit")&&n.isForm?(_.openBlock(),_.createBlock(m,{key:0,to:`/edit?table=${(z=(I=t.$route)==null?void 0:I.params)==null?void 0:z.catchAll}&id=${(F=n.item)==null?void 0:F.id}`,class:"w-full flex items-center gap-x-3 py-1.5 px-2 rounded-lg text-[13px] text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"},{default:_.withCtx(()=>[_.createVNode(l,{color:"#000"}),e[4]||(e[4]=_.createTextVNode(" Редагувати "))]),_:1},8,["to"])):_.createCommentVNode("",!0),n.isForm?(_.openBlock(),_.createElementBlock("div",q7)):_.createCommentVNode("",!0),(j=n.actions)!=null&&j.includes("del")?(_.openBlock(),_.createElementBlock("button",{key:2,onClick:e[0]||(e[0]=_.withModifiers((...G)=>a.openConfirm&&a.openConfirm(...G),["stop"])),class:"w-full flex items-center gap-x-3 py-1.5 px-2 rounded-lg text-[13px] text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"},[_.createVNode(x),e[5]||(e[5]=_.createElementVNode("span",{class:"text-gray-800"},"Видалити",-1))])):_.createCommentVNode("",!0)])]}),_:1})]),_.createVNode(E,{visible:r.isDeleteConfirm,"onUpdate:visible":e[3]||(e[3]=T=>r.isDeleteConfirm=T),title:"Ви впевнені?"},{default:_.withCtx(()=>[_.createElementVNode("div",W7,[e[6]||(e[6]=_.createElementVNode("p",{class:"mt-1 text-gray-500 dark:text-neutral-500"}," Ви впевнені, що хочете видалити цей об'єкт? ",-1)),_.createElementVNode("div",G7,[_.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-sm font-medium text-gray-800 bg-white border border-gray-200 rounded-lg shadow-sm gap-x-2 hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:e[1]||(e[1]=T=>r.isDeleteConfirm=!1)}," Скасувати "),_.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-sm font-semibold text-white bg-red-500 border border-transparent rounded-lg gap-x-2 hover:bg-red-600 disabled:opacity-50 disabled:pointer-events-none",onClick:e[2]||(e[2]=(...T)=>a.deleteElement&&a.deleteElement(...T))}," Так, я впевнена/ий ")])])]),_:1},8,["visible"])],64)}const Y7=Ge($7,[["render",Z7]]),X7={},K7={class:"flex-shrink-0 mt-0.5 size-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function J7(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("svg",K7,e[0]||(e[0]=[_.createElementVNode("path",{d:"m3 16 4 4 4-4"},null,-1),_.createElementVNode("path",{d:"M7 20V4"},null,-1),_.createElementVNode("path",{d:"m21 8-4-4-4 4"},null,-1),_.createElementVNode("path",{d:"M17 4v16"},null,-1)]))}const Q7={components:{IconExport:Ge(X7,[["render",J7]])},props:{table:String,columns:Array},data(){return{isOpen:!1,tableFormats:["json","csv","xlsx"],format:"",cols:[]}},methods:{async exportTable(){try{const t=await vt.get("/api/export",{params:{table:this.table,format:this.format,cols:this.cols.join(",")},responseType:"blob"}),e=new Blob([t.data],{type:"application/octet-stream"}),n=window.URL.createObjectURL(e),i=document.createElement("a");i.href=n,i.setAttribute("download",`${this.table.split(".")[0]}.${this.format}`),document.body.appendChild(i),i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(n),this.$notify({type:"success",title:"Експорт",message:"Файл успішно експортовано!"})}catch(t){console.error("Ошибка при экспорте файла:",t),this.$notify({type:"error",title:"Помилка",message:"Не вдалося експортувати файл."})}},selectFormat(t){this.format=t}}},e9={class:"p-4"},t9={class:"pb-5 mb-5 last:pb-0 last:mb-0 border-b last:border-b-0 border-gray-200 dark:border-neutral-700"},n9={class:"mt-2 flex row flex-wrap gap-y-[5px] gap-x-[10px]"},i9={class:"pb-5 mb-5 last:pb-0 last:mb-0 border-b last:border-b-0 border-gray-200 dark:border-neutral-700"},r9={class:"mt-2 space-y-2"},s9=["id","onChange"],o9=["for"],a9={class:"flex w-full justify-end p-[20px] gap-[6px] border-t"};function l9(t,e,n,i,r,a){const u=_.resolveComponent("IconExport"),l=_.resolveComponent("VsCheckbox"),m=_.resolveComponent("VsDialog");return _.openBlock(),_.createElementBlock(_.Fragment,null,[_.createElementVNode("button",{onClick:e[0]||(e[0]=x=>r.isOpen=!0),class:"py-2 px-2.5 inline-flex items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},[_.createVNode(u,{height:"16",width:"16"}),e[4]||(e[4]=_.createTextVNode(" Експорт ")),e[5]||(e[5]=_.createElementVNode("svg",{class:"shrink-0 size-3.5",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[_.createElementVNode("path",{d:"m6 9 6 6 6-6"})],-1))]),_.createVNode(m,{visible:r.isOpen,"onUpdate:visible":e[3]||(e[3]=x=>r.isOpen=x),title:"Експорт таблиці",size:"small"},{footer:_.withCtx(()=>[_.createElementVNode("div",a9,[e[8]||(e[8]=_.createElementVNode("button",{type:"button",class:"py-2 px-3 text-nowrap inline-flex justify-center items-center text-start bg-white border border-gray-200 text-gray-800 text-sm font-medium rounded-lg shadow-sm align-middle hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700","data-hs-overlay":"#hs-pro-decm"}," Скасувати ",-1)),_.createElementVNode("button",{type:"button",class:"py-2 px-3 text-nowrap inline-flex justify-center items-center gap-x-2 text-start bg-blue-600 border border-blue-600 text-white text-sm font-medium rounded-lg shadow-sm align-middle hover:bg-blue-700 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:ring-1 focus:ring-blue-300 dark:focus:ring-blue-500",onClick:e[2]||(e[2]=(...x)=>a.exportTable&&a.exportTable(...x))}," Завантажити таблицю ")])]),default:_.withCtx(()=>[e[9]||(e[9]=_.createElementVNode("div",{class:"dark:border-neutral-700"},null,-1)),_.createElementVNode("div",e9,[_.createElementVNode("div",t9,[e[6]||(e[6]=_.createElementVNode("h2",{class:"text-sm text-gray-500"}," Виберіть стовпці таблиці для експорту: ",-1)),_.createElementVNode("div",n9,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(n.columns,(x,S)=>(_.openBlock(),_.createElementBlock("div",{class:"flex items-center",key:S,style:{width:"calc((100% - 10px) / 2)"}},[_.createVNode(l,{class:"[&>label]:text-sm [&>label]:text-gray-800 [&>label]:ms-3 !gap-x-[1px] !p-0",modelValue:r.cols,"onUpdate:modelValue":e[1]||(e[1]=E=>r.cols=E),value:x==null?void 0:x.name,label:x==null?void 0:x.ua},null,8,["modelValue","value","label"])]))),128))])]),_.createElementVNode("div",i9,[e[7]||(e[7]=_.createElementVNode("h2",{class:"text-sm text-gray-500"},"Виберіть формат таблиці:",-1)),_.createElementVNode("div",r9,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(r.tableFormats,(x,S)=>(_.openBlock(),_.createElementBlock("div",{class:"flex items-center",key:S},[_.createElementVNode("input",{type:"radio",name:"hs-pro-duecmfm",class:"shrink-0 border-gray-300 rounded-full text-blue-600 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-500 dark:checked:bg-blue-500 dark:checked:border-blue-500 dark:focus:ring-offset-gray-800",id:x,onChange:E=>a.selectFormat(x)},null,40,s9),_.createElementVNode("label",{for:x,class:"text-sm text-gray-800 ms-3 dark:text-neutral-400"}," Формат "+_.toDisplayString(x),9,o9)]))),128))])])])]),_:1},8,["visible"])],64)}const c9=Ge(Q7,[["render",l9]]),u9={},h9={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-columns"};function d9(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("svg",h9,e[0]||(e[0]=[_.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 6l5.5 0"></path><path d="M4 10l5.5 0"></path><path d="M4 14l5.5 0"></path><path d="M4 18l5.5 0"></path><path d="M14.5 6l5.5 0"></path><path d="M14.5 10l5.5 0"></path><path d="M14.5 14l5.5 0"></path><path d="M14.5 18l5.5 0"></path>',9)]))}const p9=Ge(u9,[["render",d9]]),f9={props:{column:Object},emits:["update-column"],data(){return{value:!1}},watch:{value(t){this.$emit("update-column",{...this.column,hidden:!t})}},mounted(){var t;((t=this.column)==null?void 0:t.hidden)!==!0&&(this.value=!0)}},m9={class:"flex w-full gap-[8px] items-centr"};function g9(t,e,n,i,r,a){var u,l;return _.openBlock(),_.createElementBlock("label",m9,[_.withDirectives(_.createElementVNode("input",{"onUpdate:modelValue":e[0]||(e[0]=m=>r.value=m),type:"checkbox"},null,512),[[_.vModelCheckbox,r.value]]),_.createTextVNode(" "+_.toDisplayString(((u=n.column)==null?void 0:u.ua)||((l=n.column)==null?void 0:l.title)),1)])}const y9={components:{IconColumns:p9,AdminTableColumnsHiddenItem:Ge(f9,[["render",g9]])},emits:["update-columns"],props:{columns:Array},methods:{updateColumn(t){const e=this.columns.findIndex(i=>(i==null?void 0:i.name)===(t==null?void 0:t.name)),n=this.columns;n[e]=t,this.$emit("update-columns",[...n])}}},_9={class:"py-2 px-2.5 inline-flex items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},x9={class:"py-[10px] px-[10px] w-[260px]"},b9={class:"flex flex-col gap-[3px] max-h-[400px] w-full overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"};function v9(t,e,n,i,r,a){const u=_.resolveComponent("IconColumns"),l=_.resolveComponent("AdminTableColumnsHiddenItem"),m=_.resolveComponent("VsPopover");return _.openBlock(),_.createBlock(m,{trigger:"click",placement:"bottom"},{reference:_.withCtx(()=>[_.createElementVNode("button",_9,[_.createVNode(u,{height:"20",width:"16"})])]),default:_.withCtx(()=>[_.createElementVNode("div",x9,[e[0]||(e[0]=_.createElementVNode("h2",{class:"text-sm mb-[8px]"},"Оберіть колонки, щоб приховати",-1)),_.createElementVNode("ul",b9,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(n.columns,(x,S)=>(_.openBlock(),_.createElementBlock("li",{key:S},[_.createVNode(l,{column:x,onUpdateColumn:a.updateColumn},null,8,["column","onUpdateColumn"])]))),128))])])]),_:1})}const w9=Ge(y9,[["render",v9]]),k9={},S9={class:"hidden sm:block shrink-0 size-3",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 16 16"};function E9(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("svg",S9,e[0]||(e[0]=[_.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8 1C8.55228 1 9 1.44772 9 2V7L14 7C14.5523 7 15 7.44771 15 8C15 8.55228 14.5523 9 14 9L9 9V14C9 14.5523 8.55228 15 8 15C7.44772 15 7 14.5523 7 14V9.00001L2 9.00001C1.44772 9.00001 1 8.5523 1 8.00001C0.999999 7.44773 1.44771 7.00001 2 7.00001L7 7.00001V2C7 1.44772 7.44772 1 8 1Z"},null,-1)]))}const SS=Ge(k9,[["render",E9]]),C9={},T9={class:"vs-table-interface__table-wrp w-full rounded h-fit overflow-hidden"};function M9(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("div",T9,e[0]||(e[0]=[_.createStaticVNode('<div><div class="p-5 min-h-[500px] flex flex-col justify-center items-center text-center"><svg class="w-48 mx-auto" viewBox="0 0 178 90" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs></svg><div class="max-w-sm mx-auto mt-6"><p class="font-medium text-gray-800 dark:text-neutral-200"> Дані для відображення відсутні </p><p class="mt-2 text-sm text-gray-500 dark:text-neutral-500"> Змініть параметри пошуку або спробуйте пізніше </p></div></div></div>',1)]))}const A9=Ge(C9,[["render",M9]]),I9={props:{row:Object,column:Object,table:String}};function P9(t,e,n,i,r,a){var u,l,m,x,S,E,T,I;return _.openBlock(),_.createBlock(_.resolveDynamicComponent(((u=n.column)==null?void 0:u.format)==="custom"?(l=n.column)==null?void 0:l.component:t.$componentsConfig[`table-format-${((x=(m=n.column)==null?void 0:m.format)==null?void 0:x.toLowerCase())||"text"}`]),{onUpdateTable:e[0]||(e[0]=z=>t.$emit("update-table")),name:(S=n.column)==null?void 0:S.name,data:n.row,value:(T=n.row)==null?void 0:T[(E=n.column)==null?void 0:E.name],table:n.table,edit:(I=n.column)==null?void 0:I.edit},null,40,["name","data","value","table","edit"])}const ES=Ge(I9,[["render",P9]]),D9={},O9={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus"};function z9(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("svg",O9,e[0]||(e[0]=[_.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),_.createElementVNode("path",{d:"M5 12l14 0"},null,-1)]))}const N9={components:{IconPlus:SS,IconMinus:Ge(D9,[["render",z9]])},props:{title:String},data(){return{expanded:!1}}},R9={class:"hs-accordion"},B9={class:"py-0.5 flex items-center gap-x-0.5 w-full"},L9={class:"text-sm font-medium"},V9={class:"w-full duration-150 before:block before:absolute relative inline-block b cursor-pointer"};function F9(t,e,n,i,r,a){const u=_.resolveComponent("IconPlus"),l=_.resolveComponent("IconMinus");return _.openBlock(),_.createElementBlock("div",null,[_.createElementVNode("div",null,[_.createElementVNode("div",R9,[_.createElementVNode("div",B9,[_.createElementVNode("div",{onClick:e[0]||(e[0]=m=>r.expanded=!r.expanded),class:"grow rounded-md cursor-pointer"},[_.createElementVNode("span",L9,_.toDisplayString(n.title),1)]),_.createElementVNode("button",{class:"size-6 flex justify-center items-center hover:bg-gray-100 rounded-md",onClick:e[1]||(e[1]=m=>r.expanded=!r.expanded)},[r.expanded?(_.openBlock(),_.createBlock(l,{key:1,width:"14"})):(_.openBlock(),_.createBlock(u,{key:0}))])]),_.createVNode(_.Transition,{name:"fade"},{default:_.withCtx(()=>[_.withDirectives(_.createElementVNode("div",V9,[_.renderSlot(t.$slots,"default",{},void 0,!0)],512),[[_.vShow,r.expanded]])]),_:3})])])])}const $9={components:{AdminComponentIs:ES,AdminTree:Ge(N9,[["render",F9],["__scopeId","data-v-f5ecdb9a"]]),VsNoData:xS,VsWidgetComments:yS,VsWidgetMap:L1,VsWidgetFileList:Rv},props:{table:String,columns:Array,row:Object}},j9={class:"hs-accordion border-gray-100 w-[360px] overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500",style:{height:"calc(100vh - 310px)"}},U9={class:"border-l",style:{height:"calc(100vh - 360px)"}},H9={class:"py-1 flex justify-between items-center gap-x-4"},q9={class:"col-span-1"},W9={class:"inline-flex items-center gap-x-2 text-[13px] text-gray-500 dark:text-neutral-500"},G9={class:"col-span-2"},Z9={class:"font-medium text-[13px] text-gray-800 dark:text-neutral-200"},Y9={class:"table-info-card"},X9={class:"table-info-card"};function K9(t,e,n,i,r,a){var T,I;const u=_.resolveComponent("AdminComponentIs"),l=_.resolveComponent("AdminTree"),m=_.resolveComponent("VsWidgetMap"),x=_.resolveComponent("VsNoData"),S=_.resolveComponent("VsWidgetComments"),E=_.resolveComponent("VsWidgetFileList");return _.openBlock(),_.createElementBlock("div",j9,[e[0]||(e[0]=_.createElementVNode("div",{class:"p-[10px] pl-[18px] pb-[18px] border-b"},[_.createElementVNode("h2",{class:"text-sm font-medium"},"Інформація про об'єкт")],-1)),_.createElementVNode("div",U9,[(I=(T=t.$route)==null?void 0:T.query)!=null&&I.card?(_.openBlock(),_.createElementBlock(_.Fragment,{key:0},[n.row?(_.openBlock(),_.createBlock(l,{key:0,title:"Основна інформація",class:"border-b p-[10px] py-[16px] w-[280px]"},{default:_.withCtx(()=>[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(n.columns,z=>(_.openBlock(),_.createElementBlock("dl",H9,[_.createElementVNode("dt",q9,[_.createElementVNode("p",W9,_.toDisplayString((z==null?void 0:z.ua)||(z==null?void 0:z.title))+": ",1)]),_.createElementVNode("dd",G9,[_.createElementVNode("p",Z9,[_.createVNode(u,{row:n.row,column:z,table:n.table},null,8,["row","column","table"])])])]))),256))]),_:1})):_.createCommentVNode("",!0),_.createVNode(l,{title:"Карта",class:"border-b p-[10px] py-[16px] w-[280px]"},{default:_.withCtx(()=>{var z,F;return[(z=n.row)!=null&&z.geom?(_.openBlock(),_.createBlock(m,{key:0,geometry:(F=n.row)==null?void 0:F.geom,zoom:14},null,8,["geometry"])):(_.openBlock(),_.createBlock(x,{key:1,title:"У об'єкта відсутня геометрія",text:"",class:"[&>div]:h-[200px] [&>div]:min-h-[400px] h-[400px]"}))]}),_:1}),_.createVNode(l,{title:"Коментарі",class:"border-b p-[10px] py-[16px] w-[280px]"},{default:_.withCtx(()=>{var z;return[_.createElementVNode("div",Y9,[_.createVNode(S,{id:(z=n.row)==null?void 0:z.id},null,8,["id"])])]}),_:1}),_.createVNode(l,{title:"Файли",class:"border-b p-[10px] py-[16px] w-[280px]"},{default:_.withCtx(()=>{var z;return[_.createElementVNode("div",X9,[_.createVNode(E,{id:(z=n.row)==null?void 0:z.id},null,8,["id"])])]}),_:1})],64)):(_.openBlock(),_.createBlock(x,{key:1,text:"Оберіть один з об'єктів в таблиці для відображення інформаціі про нього"}))])])}const J9=Ge($9,[["render",K9]]),Q9={},eU={class:"hidden xl:block shrink-0 size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function tU(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("svg",eU,e[0]||(e[0]=[_.createElementVNode("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"},null,-1),_.createElementVNode("path",{d:"M15 3v18"},null,-1),_.createElementVNode("path",{d:"m8 9 3 3-3 3"},null,-1)]))}const nU=Ge(Q9,[["render",tU]]),iU={},rU={class:"h21yx vs0hq",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function sU(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("svg",rU,e[0]||(e[0]=[_.createStaticVNode('<line x1="21" x2="14" y1="4" y2="4"></line><line x1="10" x2="3" y1="4" y2="4"></line><line x1="21" x2="12" y1="12" y2="12"></line><line x1="8" x2="3" y1="12" y2="12"></line><line x1="21" x2="16" y1="20" y2="20"></line><line x1="12" x2="3" y1="20" y2="20"></line><line x1="14" x2="14" y1="2" y2="6"></line><line x1="8" x2="8" y1="10" y2="14"></line><line x1="16" x2="16" y1="18" y2="22"></line>',9)]))}const oU={props:{scheme:{type:Object},onFilters:{type:Number}},components:{IconFilter:Ge(iU,[["render",sU]])},data(){return{isFilters:!1}},methods:{closeFilter({target:t}){this.isFilters&&t.classList.contains("filter-container")&&(this.isFilters=!1)}}},aU={key:0,class:"font-medium text-[10px] py-0.5 px-[5px] bg-gray-800 text-white leading-3 rounded-full dark:bg-neutral-500"},lU={class:"filter-content h-screen bg-white w-[400px] p-[20px] pt-[10px] overflow-x-auto bg-white [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"};function cU(t,e,n,i,r,a){const u=_.resolveComponent("IconFilter"),l=_.resolveComponent("VsFilter");return _.openBlock(),_.createElementBlock(_.Fragment,null,[_.createElementVNode("button",{onClick:e[0]||(e[0]=m=>r.isFilters=!r.isFilters),class:"py-2 px-2.5 inline-flex items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},[_.createVNode(u,{height:"16",width:"16"}),e[4]||(e[4]=_.createTextVNode(" Фільтри ")),n.onFilters?(_.openBlock(),_.createElementBlock("span",aU,_.toDisplayString(n.onFilters),1)):_.createCommentVNode("",!0)]),_.createVNode(_.Transition,{name:"fade"},{default:_.withCtx(()=>{var m;return[_.withDirectives(_.createElementVNode("div",{onClick:e[3]||(e[3]=(...x)=>a.closeFilter&&a.closeFilter(...x)),style:{height:"100vh"},class:"fixed filter-container top-0 flex justify-end items-center z-[2] right-0 left-0 bottom-0 bg-[rgba(0,0,0,0.5)]"},[_.createElementVNode("div",lU,[(m=n.scheme)!=null&&m.length?(_.openBlock(),_.createBlock(l,{key:0,ref:"filter",scheme:n.scheme,layout:"default","apply-vue-router":"",history:"",name:"filter",onFilterChange:e[1]||(e[1]=x=>t.$emit("filterChange",x)),closeFilterBtn:!0,onFilterClose:e[2]||(e[2]=x=>r.isFilters=!1)},null,8,["scheme"])):_.createCommentVNode("",!0)])],512),[[_.vShow,r.isFilters]])]}),_:1})],64)}const uU=Ge(oU,[["render",cU]]),hU={props:{tabsList:{type:Array,default:()=>[]},filterState:String}},dU={class:"relative flex space-x-1 mb-[20px] after:absolute after:w-[99%] after:bottom-0 after:inset-x-0 after:border-b-2 after:border-gray-200 dark:after:border-neutral-700","aria-label":"Tabs",role:"tablist","aria-orientation":"horizontal"},pU=["onClick"];function fU(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("nav",dU,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(n.tabsList,u=>(_.openBlock(),_.createElementBlock("button",{onClick:l=>t.$emit("update:filterState",u==null?void 0:u.name),class:_.normalizeClass(["hs-tab-active:after:bg-gray-800 hs-tab-active:text-gray-800 px-2.5 py-1.5 mb-2 relative inline-flex justify-center items-center gap-x-2 hover:bg-gray-100 text-gray-500 hover:text-gray-800 text-sm rounded-lg disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100 after:absolute after:-bottom-2 after:inset-x-0 after:z-10 after:h-0.5 after:pointer-events-none dark:hs-tab-active:text-neutral-200 dark:hs-tab-active:after:bg-neutral-400 dark:text-neutral-500 dark:hover:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700 active",{" font-semibold after:absolute after:bottom-[-8px] after:left-2.5 after:right-2.5 after:z-10 after:h-0.5 after:bg-gray-800":(u==null?void 0:u.name)===n.filterState}])},_.toDisplayString(u==null?void 0:u.label),11,pU))),256))])}const mU=Ge(hU,[["render",fU]]),gU={},yU={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-filter"};function _U(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("svg",yU,e[0]||(e[0]=[_.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),_.createElementVNode("path",{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z"},null,-1)]))}const xU={components:{IconFilter2:Ge(gU,[["render",_U]])},props:{filterCustom:String,customList:Array}},bU={class:"py-2 px-2.5 inline-flex items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},vU={class:"flex flex-col gap-[4px]"},wU=["onClick"];function kU(t,e,n,i,r,a){const u=_.resolveComponent("IconFilter2"),l=_.resolveComponent("VsPopover");return _.openBlock(),_.createBlock(l,{ref:"popover",placement:"bottom"},{reference:_.withCtx(()=>[_.createElementVNode("button",bU,[_.createVNode(u,{height:"20",width:"20"})])]),default:_.withCtx(()=>[_.createElementVNode("div",vU,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(n.customList,(m,x)=>(_.openBlock(),_.createElementBlock("button",{onClick:S=>{var E;t.$emit("update:filterCustom",m==null?void 0:m.name),(E=t.$refs)==null||E.popover.togglePopover()},key:x,class:_.normalizeClass(["p-[8px] block rounded-lg w-[140px] text-start hover:bg-gray-100 !duration-300",{"bg-gray-100":n.filterCustom===(m==null?void 0:m.name)}])},_.toDisplayString(m==null?void 0:m.label),11,wU))),128)),_.createElementVNode("button",{class:"p-[8px] block rounded-lg w-[140px] text-start hover:bg-gray-100 !duration-300",onClick:e[0]||(e[0]=m=>{var x;t.$emit("update:filterCustom",void 0),(x=t.$refs)==null||x.popover.togglePopover()})}," Скинути фільтри ")])]),_:1},512)}const SU={props:{table:String,title:String},components:{AdminTableControl:Y7,AdminTableExport:c9,AdminTableColumnsHidden:w9,AdminTableColumn:D7,AdminNodata:A9,IconPlus:SS,IconSearch:Z0,AdminTableCardInfo:J9,IconOpenCard:nU,AdminComponentIs:ES,AdminTableFilters:uU,AdminTableTabs:mU,AdminTableCustomFilters:Ge(xU,[["render",kU]])},data(){return{tableData:{},filterScheme:[],page:1,searchValue:"",limit:0,filters:null,activeColumn:"",isVisibleCardInfo:!1,onFilters:0,filterState:null,filterCustom:null}},async mounted(){await this.checkUrlMounted(),await this.getTableData(),await this.getFilters()},computed:{defaultPage(){var t,e;return((e=(t=this.$route)==null?void 0:t.query)==null?void 0:e.page)||1},columns(){var t,e;return(e=(t=this.tableData)==null?void 0:t.columns)==null?void 0:e.filter(n=>(n==null?void 0:n.hidden)!==!0)},isForm(){var t;return(t=this.tableData)==null?void 0:t.form},isNoData(){var t,e;return!((t=this.tableData)!=null&&t.rows)||!((e=this.columns)!=null&&e.length)},rowWidth(){var t;return((t=this.tableData)==null?void 0:t.width)||"100px"},activeCardRow(){var t,e;return((e=(t=this.tableData)==null?void 0:t.rows)==null?void 0:e.find(n=>{var i,r;return(n==null?void 0:n.id)===((r=(i=this.$route)==null?void 0:i.query)==null?void 0:r.card)}))||{}},getActions(){var t;return(t=this.tableData)==null?void 0:t.actions}},watch:{async table(){this.tableData=null,await this.getTableData()},searchValue(){this.getTableData()},$route:{handler(t,e){var n,i;((n=t==null?void 0:t.params)==null?void 0:n.catchAll)!==((i=e==null?void 0:e.params)==null?void 0:i.catchAll)&&(this.unmountedData(),this.getFilters())},deep:!0},limit(t){var e;this.$router.replace({query:{...(e=this.$route)==null?void 0:e.query,limit:t}})},filterState(t){var e;t&&(this.$router.replace({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,filterState:t}}),this.getTableData())},filterCustom(t){var e;this.$router.push({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,filterCustom:t}}),this.getTableData()}},methods:{async checkUrlMounted(){var t,e,n,i,r,a,u,l,m;this.page=((e=(t=this.$route)==null?void 0:t.query)==null?void 0:e.page)||1,this.limit=((i=(n=this.$route)==null?void 0:n.query)==null?void 0:i.limit)||20,this.filterState=((a=(r=this.$route)==null?void 0:r.query)==null?void 0:a.filterState)||null,this.filterCustom=((l=(u=this.$route)==null?void 0:u.query)==null?void 0:l.filterCustom)||null,(m=this.$route)!=null&&m.query.card&&(this.isVisibleCardInfo=!0)},unmountedData(){this.page=1,this.filterCustom=null,this.filterState=null,this.isVisibleCardInfo=!1,this.filterScheme=null,this.filters=null,this.onFilters=0},async getTableData(){var t,e;try{const{data:n}=await vt.get(`/api/template/table/${this.table}`),i=await vt.get(`/api/table-data/${this.table}`,{params:{page:this.page,search:this.searchValue||null,limit:this.limit,filter:this.filters||null,order:((e=(t=this.$route)==null?void 0:t.query)==null?void 0:e.sort)||null,state:this.filterState||null,custom:this.filterCustom||null}});this.tableData={...n,...(i==null?void 0:i.data)||{}}}catch{}},async getFilters(){var t;try{const{data:e}=await vt.get(`/api/table-filter/${this.table}`);this.filterScheme=(t=e==null?void 0:e.list)==null?void 0:t.map(n=>({...n,label:(n==null?void 0:n.label)||(n==null?void 0:n.ua)}))}catch{}},async handlePageChange(t){const e=this.$route.query;this.page=t,!(!(e!=null&&e.page)&&t===1||e.page===t)&&(await this.$router.replace({query:{...e,page:t}}),await this.getTableData())},async changeLimit(t){this.limit=await t,this.defaultPage=1,await this.getTableData()},async filterChange({url:t,state:e}){var n;this.filters=t!=="no-url"?t:null,this.onFilters=(n=Object.entries(e))==null?void 0:n.length,this.page=1,await this.getTableData()},changeActiveColumn(t){this.activeColumn=t,this.getTableData()},pushToCard(t){var e;((e=this.tableData)==null?void 0:e.card)===!1||this.$router.push(`/card/${this.table}/${t}`)},changeActiveCardInfo(t){var e;this.isVisibleCardInfo&&this.$router.push({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,card:t}})},toggleCardInfo(){var t;this.isVisibleCardInfo=!this.isVisibleCardInfo,this.isVisibleCardInfo||this.$router.push({...this.$route,query:{...(t=this.$route)==null?void 0:t.query,card:void 0}})}}},EU={class:"w-[calc(100vw - 320px)]"},CU={class:"h-[76px] bg-gray-50 flex items-center justify-between px-[30px]"},TU={class:"text-xl font-medium h-[20px]"},MU={style:{height:"calc(100vh - 140px)",width:"calc(100vw - 260px)"},class:"bg-gray-50 p-[20px] flex pt-[10px]"},AU={class:"bg-white w-full rounded-xl border p-[20px] pr-0"},IU={class:"flex"},PU={class:"w-full"},DU={class:"flex gap-[6px] ml-auto"},OU={class:"inline-block w-full align-middle"},zU={key:0,class:"relative min-w-full divide-y divide-gray-200 table-fixed dark:divide-neutral-700"},NU={class:"sticky top-0 bg-white w-full after:absolute after:content-[''] z-[1] after:block after:w-full after:h-px after:bg-stone-200"},RU={class:"right-0 border-stone-200"},BU={class:"divide-y divide-gray-200"},LU=["onClick"],VU=["onClick"],FU={key:0,class:"text-center sticky right-0 bg-white w-[80px] px-[10px]"},$U={class:"p-[20px] flex justify-end w-full"};function jU(t,e,n,i,r,a){var be,Ae,Fe,Pe,Xe,rt,Bt,dt,Nt,Xt,rn,jt,Kt,Sn;const u=_.resolveComponent("IconPlus"),l=_.resolveComponent("router-link"),m=_.resolveComponent("AdminTableTabs"),x=_.resolveComponent("IconSearch"),S=_.resolveComponent("VsText"),E=_.resolveComponent("AdminTableCustomFilters"),T=_.resolveComponent("AdminTableColumnsHidden"),I=_.resolveComponent("AdminTableExport"),z=_.resolveComponent("AdminTableFilters"),F=_.resolveComponent("IconOpenCard"),j=_.resolveComponent("AdminTableColumn"),G=_.resolveComponent("AdminComponentIs"),ie=_.resolveComponent("AdminTableControl"),ae=_.resolveComponent("AdminNodata"),J=_.resolveComponent("VsPagination"),Ce=_.resolveComponent("AdminTableCardInfo");return _.openBlock(),_.createElementBlock("div",EU,[_.createElementVNode("div",CU,[_.createElementVNode("h2",TU,_.toDisplayString(n.title),1),a.isForm?(_.openBlock(),_.createBlock(l,{key:0,to:`/add?table=${(Ae=(be=t.$route)==null?void 0:be.params)==null?void 0:Ae.catchAll}`,class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white"},{default:_.withCtx(()=>[_.createVNode(u,{height:"16",width:"16"}),e[5]||(e[5]=_.createTextVNode(" Додати "))]),_:1},8,["to"])):_.createCommentVNode("",!0)]),_.createElementVNode("div",MU,[_.createElementVNode("div",AU,[(Pe=(Fe=r.tableData)==null?void 0:Fe.filterState)!=null&&Pe.length?(_.openBlock(),_.createBlock(m,{key:0,tabsList:(Xe=r.tableData)==null?void 0:Xe.filterState,filterState:r.filterState,"onUpdate:filterState":e[0]||(e[0]=Mt=>r.filterState=Mt)},null,8,["tabsList","filterState"])):_.createCommentVNode("",!0),_.createElementVNode("div",IU,[_.createElementVNode("div",PU,[_.createElementVNode("div",{class:_.normalizeClass(["flex sm:grid sm:grid-cols-2 gap-x-2 sm:gap-x-5 mb-[10px] relative",{"pr-[20px]":!r.isVisibleCardInfo}])},[_.createVNode(x,{height:"14",width:"14",class:"absolute top-[10px] left-[14px] text-gray-500 z-[1]"}),_.createVNode(S,{modelValue:r.searchValue,"onUpdate:modelValue":e[1]||(e[1]=Mt=>r.searchValue=Mt),placeholder:"Пошук...",clearable:!0,class:"[&>input]:py-[7px] [&>input]:ps-10 [&>input]:pe-8 [&>input]:block [&>input]:w-full [&>input]:bg-gray-100 [&>input]:border-transparent [&>input]:rounded-lg [&>input]:text-sm [&>input]:focus:bg-white [&>input]:focus:border-blue-500 [&>input]:focus:ring-blue-500 [&>input]:disabled:opacity-50 [&>input]:disabled:pointer-events-none [&>input]:dark:bg-neutral-700 [&>input]:dark:border-transparent [&>input]:dark:text-neutral-400 [&>input]:dark:placeholder:text-neutral-400 dark:focus:bg-neutral-800 dark:focus:ring-neutral-600"},null,8,["modelValue"]),_.createElementVNode("div",DU,[(Bt=(rt=r.tableData)==null?void 0:rt.filterCustom)!=null&&Bt.length?(_.openBlock(),_.createBlock(E,{key:0,customList:(dt=r.tableData)==null?void 0:dt.filterCustom,filterCustom:r.filterCustom,"onUpdate:filterCustom":e[2]||(e[2]=Mt=>r.filterCustom=Mt)},null,8,["customList","filterCustom"])):_.createCommentVNode("",!0),_.createVNode(T,{columns:(Nt=r.tableData)==null?void 0:Nt.columns,onUpdateColumns:e[3]||(e[3]=Mt=>r.tableData.columns=Mt)},null,8,["columns"]),_.createVNode(I,{table:n.table,columns:(Xt=r.tableData)==null?void 0:Xt.columns},null,8,["table","columns"]),_.createVNode(z,{scheme:r.filterScheme,onFilters:r.onFilters,onFilterChange:a.filterChange},null,8,["scheme","onFilters","onFilterChange"]),_.createElementVNode("button",{onClick:e[4]||(e[4]=(...Mt)=>a.toggleCardInfo&&a.toggleCardInfo(...Mt)),class:"py-2 px-2.5 inline-flex items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},[_.createVNode(F,{class:_.normalizeClass({"rotate-180 duration-300":!r.isVisibleCardInfo})},null,8,["class"])])])],2),_.createElementVNode("div",{class:_.normalizeClass(["flex items-start justify-start w-full space-y-5",{"pr-[20px]":!r.isVisibleCardInfo}])},[_.createElementVNode("div",{style:_.normalizeStyle({height:(jt=(rn=r.tableData)==null?void 0:rn.filterState)!=null&&jt.length?"calc(100vh - 370px)":"calc(100vh - 320px)"}),class:"overflow-x-auto w-full border-t [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},[_.createElementVNode("div",OU,[a.isNoData?(_.openBlock(),_.createBlock(ae,{key:1})):(_.openBlock(),_.createElementBlock("table",zU,[_.createElementVNode("thead",NU,[_.createElementVNode("tr",RU,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(a.columns,Mt=>(_.openBlock(),_.createBlock(j,{key:Mt.name,style:_.normalizeStyle({minWidth:a.rowWidth,maxWidth:a.rowWidth}),data:Mt,activeColumn:r.activeColumn,onChangeActive:a.changeActiveColumn},null,8,["style","data","activeColumn","onChangeActive"]))),128)),e[6]||(e[6]=_.createElementVNode("th",{class:"w-[70px] sticky right-0 top-0 bg-white"},null,-1))])]),_.createElementVNode("tbody",BU,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList((Kt=r.tableData)==null?void 0:Kt.rows,(Mt,En)=>{var dn,ti,Rn;return _.openBlock(),_.createElementBlock("tr",{key:En},[_.createElementVNode("td",{class:"text-sm text-gray-600",style:_.normalizeStyle({minWidth:a.rowWidth,maxWidth:a.rowWidth})},[_.createElementVNode("button",{onClick:()=>a.pushToCard(Mt==null?void 0:Mt.id),class:_.normalizeClass(["text-sm font-medium",[((dn=r.tableData)==null?void 0:dn.card)===!1?"":"text-blue-600 decoration-2 focus:outline-none focus:underline hover:text-blue-600 hover:underline"]])},[_.createVNode(G,{row:Mt,column:a.columns[0],table:n.table,onUpdateTable:a.getTableData},null,8,["row","column","table","onUpdateTable"])],10,LU)],4),(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList((ti=a.columns)==null?void 0:ti.slice(1),Pn=>(_.openBlock(),_.createElementBlock("td",{onClick:qn=>a.changeActiveCardInfo(Mt==null?void 0:Mt.id),class:_.normalizeClass(["text-start px-[4px] py-3 text-sm text-gray-600",{"cursor-pointer":r.isVisibleCardInfo}]),style:_.normalizeStyle({minWidth:a.rowWidth,maxWidth:a.rowWidth}),key:Pn.name},[_.createVNode(G,{row:Mt,column:Pn,table:n.table,onUpdateTable:a.getTableData},null,8,["row","column","table","onUpdateTable"])],14,VU))),128)),(Rn=a.getActions)!=null&&Rn.length?(_.openBlock(),_.createElementBlock("td",FU,[_.createVNode(ie,{actions:a.getActions,isForm:a.isForm,item:Mt,table:n.table,onUpdateTable:a.getTableData},null,8,["actions","isForm","item","table","onUpdateTable"])])):_.createCommentVNode("",!0)])}),128))])]))])],4)],2),_.createElementVNode("div",$U,[r.limit?(_.openBlock(),_.createBlock(J,{key:0,goTo:!1,class:"justify-end","default-page":a.defaultPage,total:((Sn=r.tableData)==null?void 0:Sn.total)||0,pageSize:parseInt(r.limit),onPageChange:a.handlePageChange,pageSizes:[10,16,20],onPageSizeChange:a.changeLimit},null,8,["default-page","total","pageSize","onPageChange","onPageSizeChange"])):_.createCommentVNode("",!0)])]),_.createVNode(_.Transition,{name:"slide-fade"},{default:_.withCtx(()=>[r.isVisibleCardInfo?(_.openBlock(),_.createBlock(Ce,{key:0,table:n.table,columns:a.columns,row:a.activeCardRow},null,8,["table","columns","row"])):_.createCommentVNode("",!0)]),_:1})])])])])}const UU={components:{AdminTable:Ge(SU,[["render",jU],["__scopeId","data-v-d1eaaef8"]])},data(){return{table:!1,interface:"",title:""}},watch:{$route:{async handler(){Xr!=null&&Xr.value||await this.getMenu(),await this.checkPageType()},deep:!0},title(t){t&&(document.title=t)}},async mounted(){await this.checkPageType()},methods:{flattenMenu(t){const e=[];return t.forEach(n=>{n.menu?e.push(...this.flattenMenu(n.menu)):e.push(n)}),e},async checkPageType(){var i,r;const t=this.flattenMenu(Xr.value);t!=null&&t.length||this.$router.replace("/404");const e=t==null?void 0:t.find(a=>{var u,l;return(a==null?void 0:a.path)==((l=(u=this.$route)==null?void 0:u.params)==null?void 0:l.catchAll)});this.title=e==null?void 0:e.ua,e||this.$router.replace("/404"),e!=null&&e.component&&this.$router.replace((r=(i=this.$route)==null?void 0:i.params)==null?void 0:r.catchAll);const n=e==null?void 0:e.table;this.table=n||!1,!n&&this.getInterface()},async getInterface(){var t,e;try{const{data:n}=await vt.get(`/api/template/interface/${((e=(t=this.$route)==null?void 0:t.params)==null?void 0:e.catchAll)||""}`);this.interface=n||""}catch{this.interface=""}}}},HU=["innerHTML"];function qU(t,e,n,i,r,a){const u=_.resolveComponent("AdminTable");return r.table?(_.openBlock(),_.createBlock(u,{key:0,table:r.table,title:r.title},null,8,["table","title"])):(_.openBlock(),_.createElementBlock("div",{key:1,class:"w-full bg-gray-50",style:{height:"calc(100vh - 120px)"},innerHTML:r.interface},null,8,HU))}const WU=Object.freeze(Object.defineProperty({__proto__:null,default:Ge(UU,[["render",qU]])},Symbol.toStringTag,{value:"Module"}));return D8});
741
+ `},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:i})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:r,storedMarks:a}=n;if(r.$from.parent.type.spec.isolating)return!1;const{keepMarks:u}=this.options,{splittableMarks:l}=i.extensionManager,m=a||r.$to.parentOffset&&r.$from.marks();return e().insertContent({type:this.name}).command(({tr:x,dispatch:S})=>{if(S&&m&&u){const E=m.filter(T=>l.includes(T.type.name));x.ensureMarks(E)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),fF=bs.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,ci(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>E0({find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var qf=200,Ii=function(){};Ii.prototype.append=function(e){return e.length?(e=Ii.from(e),!this.length&&e||e.length<qf&&this.leafAppend(e)||this.length<qf&&e.leafPrepend(this)||this.appendInner(e)):this},Ii.prototype.prepend=function(e){return e.length?Ii.from(e).append(this):this},Ii.prototype.appendInner=function(e){return new mF(this,e)},Ii.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?Ii.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))},Ii.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Ii.prototype.forEach=function(e,n,i){n===void 0&&(n=0),i===void 0&&(i=this.length),n<=i?this.forEachInner(e,n,i,0):this.forEachInvertedInner(e,n,i,0)},Ii.prototype.map=function(e,n,i){n===void 0&&(n=0),i===void 0&&(i=this.length);var r=[];return this.forEach(function(a,u){return r.push(e(a,u))},n,i),r},Ii.from=function(e){return e instanceof Ii?e:e&&e.length?new aS(e):Ii.empty};var aS=function(t){function e(i){t.call(this),this.values=i}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(r,a){return r==0&&a==this.length?this:new e(this.values.slice(r,a))},e.prototype.getInner=function(r){return this.values[r]},e.prototype.forEachInner=function(r,a,u,l){for(var m=a;m<u;m++)if(r(this.values[m],l+m)===!1)return!1},e.prototype.forEachInvertedInner=function(r,a,u,l){for(var m=a-1;m>=u;m--)if(r(this.values[m],l+m)===!1)return!1},e.prototype.leafAppend=function(r){if(this.length+r.length<=qf)return new e(this.values.concat(r.flatten()))},e.prototype.leafPrepend=function(r){if(this.length+r.length<=qf)return new e(r.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Ii);Ii.empty=new aS([]);var mF=function(t){function e(n,i){t.call(this),this.left=n,this.right=i,this.length=n.length+i.length,this.depth=Math.max(n.depth,i.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(i){return i<this.left.length?this.left.get(i):this.right.get(i-this.left.length)},e.prototype.forEachInner=function(i,r,a,u){var l=this.left.length;if(r<l&&this.left.forEachInner(i,r,Math.min(a,l),u)===!1||a>l&&this.right.forEachInner(i,Math.max(r-l,0),Math.min(this.length,a)-l,u+l)===!1)return!1},e.prototype.forEachInvertedInner=function(i,r,a,u){var l=this.left.length;if(r>l&&this.right.forEachInvertedInner(i,r-l,Math.max(a,l)-l,u+l)===!1||a<l&&this.left.forEachInvertedInner(i,Math.min(r,l),a,u)===!1)return!1},e.prototype.sliceInner=function(i,r){if(i==0&&r==this.length)return this;var a=this.left.length;return r<=a?this.left.slice(i,r):i>=a?this.right.slice(i-a,r-a):this.left.slice(i,a).append(this.right.slice(0,r-a))},e.prototype.leafAppend=function(i){var r=this.right.leafAppend(i);if(r)return new e(this.left,r)},e.prototype.leafPrepend=function(i){var r=this.left.leafPrepend(i);if(r)return new e(r,this.right)},e.prototype.appendInner=function(i){return this.left.depth>=Math.max(this.right.depth,i.depth)+1?new e(this.left,new e(this.right,i)):new e(this,i)},e}(Ii);const gF=500;class Us{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let i=this.items.length;for(;;i--)if(this.items.get(i-1).selection){--i;break}let r,a;n&&(r=this.remapping(i,this.items.length),a=r.maps.length);let u=e.tr,l,m,x=[],S=[];return this.items.forEach((E,T)=>{if(!E.step){r||(r=this.remapping(i,T+1),a=r.maps.length),a--,S.push(E);return}if(r){S.push(new uo(E.map));let I=E.step.map(r.slice(a)),z;I&&u.maybeStep(I).doc&&(z=u.mapping.maps[u.mapping.maps.length-1],x.push(new uo(z,void 0,void 0,x.length+S.length))),a--,z&&r.appendMap(z,a)}else u.maybeStep(E.step);if(E.selection)return l=r?E.selection.map(r.slice(a)):E.selection,m=new Us(this.items.slice(0,i).append(S.reverse().concat(x)),this.eventCount-1),!1},this.items.length,0),{remaining:m,transform:u,selection:l}}addTransform(e,n,i,r){let a=[],u=this.eventCount,l=this.items,m=!r&&l.length?l.get(l.length-1):null;for(let S=0;S<e.steps.length;S++){let E=e.steps[S].invert(e.docs[S]),T=new uo(e.mapping.maps[S],E,n),I;(I=m&&m.merge(T))&&(T=I,S?a.pop():l=l.slice(0,l.length-1)),a.push(T),n&&(u++,n=void 0),r||(m=T)}let x=u-i.depth;return x>_F&&(l=yF(l,x),u-=x),new Us(l.append(a),u)}remapping(e,n){let i=new Ic;return this.items.forEach((r,a)=>{let u=r.mirrorOffset!=null&&a-r.mirrorOffset>=e?i.maps.length-r.mirrorOffset:void 0;i.appendMap(r.map,u)},e,n),i}addMaps(e){return this.eventCount==0?this:new Us(this.items.append(e.map(n=>new uo(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let i=[],r=Math.max(0,this.items.length-n),a=e.mapping,u=e.steps.length,l=this.eventCount;this.items.forEach(T=>{T.selection&&l--},r);let m=n;this.items.forEach(T=>{let I=a.getMirror(--m);if(I==null)return;u=Math.min(u,I);let z=a.maps[I];if(T.step){let F=e.steps[I].invert(e.docs[I]),j=T.selection&&T.selection.map(a.slice(m+1,I));j&&l++,i.push(new uo(z,F,j))}else i.push(new uo(z))},r);let x=[];for(let T=n;T<u;T++)x.push(new uo(a.maps[T]));let S=this.items.slice(0,r).append(x).append(i),E=new Us(S,l);return E.emptyItemCount()>gF&&(E=E.compress(this.items.length-i.length)),E}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),i=n.maps.length,r=[],a=0;return this.items.forEach((u,l)=>{if(l>=e)r.push(u),u.selection&&a++;else if(u.step){let m=u.step.map(n.slice(i)),x=m&&m.getMap();if(i--,x&&n.appendMap(x,i),m){let S=u.selection&&u.selection.map(n.slice(i));S&&a++;let E=new uo(x.invert(),m,S),T,I=r.length-1;(T=r.length&&r[I].merge(E))?r[I]=T:r.push(E)}}else u.map&&i--},this.items.length,0),new Us(Ii.from(r.reverse()),a)}}Us.empty=new Us(Ii.empty,0);function yF(t,e){let n;return t.forEach((i,r)=>{if(i.selection&&e--==0)return n=r,!1}),t.slice(n)}class uo{constructor(e,n,i,r){this.map=e,this.step=n,this.selection=i,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new uo(n.getMap().invert(),n,this.selection)}}}class Ta{constructor(e,n,i,r,a){this.done=e,this.undone=n,this.prevRanges=i,this.prevTime=r,this.prevComposition=a}}const _F=20;function xF(t,e,n,i){let r=n.getMeta(Rl),a;if(r)return r.historyState;n.getMeta(wF)&&(t=new Ta(t.done,t.undone,null,0,-1));let u=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(u&&u.getMeta(Rl))return u.getMeta(Rl).redo?new Ta(t.done.addTransform(n,void 0,i,Wf(e)),t.undone,lS(n.mapping.maps),t.prevTime,t.prevComposition):new Ta(t.done,t.undone.addTransform(n,void 0,i,Wf(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(u&&u.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),m=t.prevTime==0||!u&&t.prevComposition!=l&&(t.prevTime<(n.time||0)-i.newGroupDelay||!bF(n,t.prevRanges)),x=u?q0(t.prevRanges,n.mapping):lS(n.mapping.maps);return new Ta(t.done.addTransform(n,m?e.selection.getBookmark():void 0,i,Wf(e)),Us.empty,x,n.time,l??t.prevComposition)}else return(a=n.getMeta("rebased"))?new Ta(t.done.rebased(n,a),t.undone.rebased(n,a),q0(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Ta(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),q0(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function bF(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((i,r)=>{for(let a=0;a<e.length;a+=2)i<=e[a+1]&&r>=e[a]&&(n=!0)}),n}function lS(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((i,r,a,u)=>e.push(a,u));return e}function q0(t,e){if(!t)return null;let n=[];for(let i=0;i<t.length;i+=2){let r=e.map(t[i],1),a=e.map(t[i+1],-1);r<=a&&n.push(r,a)}return n}function vF(t,e,n){let i=Wf(e),r=Rl.get(e).spec.config,a=(n?t.undone:t.done).popEvent(e,i);if(!a)return null;let u=a.selection.resolve(a.transform.doc),l=(n?t.done:t.undone).addTransform(a.transform,e.selection.getBookmark(),r,i),m=new Ta(n?l:a.remaining,n?a.remaining:l,null,0,-1);return a.transform.setSelection(u).setMeta(Rl,{redo:n,historyState:m})}let W0=!1,cS=null;function Wf(t){let e=t.plugins;if(cS!=e){W0=!1,cS=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){W0=!0;break}}return W0}const Rl=new Mr("history"),wF=new Mr("closeHistory");function kF(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Fi({key:Rl,state:{init(){return new Ta(Us.empty,Us.empty,null,0,-1)},apply(e,n,i){return xF(n,i,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let i=n.inputType,r=i=="historyUndo"?hS:i=="historyRedo"?dS:null;return r?(n.preventDefault(),r(e.state,e.dispatch)):!1}}}})}function uS(t,e){return(n,i)=>{let r=Rl.getState(n);if(!r||(t?r.undone:r.done).eventCount==0)return!1;if(i){let a=vF(r,n,t);a&&i(e?a.scrollIntoView():a)}return!0}}const hS=uS(!1,!0),dS=uS(!0,!0),SF=Ai.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>hS(t,e),redo:()=>({state:t,dispatch:e})=>dS(t,e)}},addProseMirrorPlugins(){return[kF(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),EF=bs.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",ci(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{const{selection:n}=e,{$from:i,$to:r}=n,a=t();return i.parentOffset===0?a.insertContentAt({from:Math.max(i.pos-1,0),to:r.pos},{type:this.name}):p2(n)?a.insertContentAt(r.pos,{type:this.name}):a.insertContent({type:this.name}),a.command(({tr:u,dispatch:l})=>{var m;if(l){const{$to:x}=u.selection,S=x.end();if(x.nodeAfter)x.nodeAfter.isTextblock?u.setSelection(Ft.create(u.doc,x.pos+1)):x.nodeAfter.isBlock?u.setSelection(zt.create(u.doc,x.pos)):u.setSelection(Ft.create(u.doc,x.pos));else{const E=(m=x.parent.type.contentMatch.defaultType)===null||m===void 0?void 0:m.create();E&&(u.insert(S,E),u.setSelection(Ft.create(u.doc,S+1)))}u.scrollIntoView()}return!0}).run()}}},addInputRules(){return[i3({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),CF=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,TF=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,MF=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,AF=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,IF=oo.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",ci(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[qc({find:CF,type:this.type}),qc({find:MF,type:this.type})]},addPasteRules(){return[Wc({find:TF,type:this.type}),Wc({find:AF,type:this.type})]}}),pS=/^(\d+)\.\s$/,PF=bs.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:void 0,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",ci(this.options.HTMLAttributes,n),0]:["ol",ci(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(U0.name,this.editor.getAttributes(Zh.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Bh({find:pS,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Bh({find:pS,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Zh.name)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),DF=bs.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",ci(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),OF=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,zF=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,NF=oo.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",ci(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[qc({find:OF,type:this.type})]},addPasteRules(){return[Wc({find:zF,type:this.type})]}}),fS=bs.create({name:"text",group:"inline"}),RF=Ai.create({name:"starterKit",addExtensions(){var t,e,n,i,r,a,u,l,m,x,S,E,T,I,z,F,j,G;const ie=[];return this.options.bold!==!1&&ie.push(ZV.configure((t=this.options)===null||t===void 0?void 0:t.bold)),this.options.blockquote!==!1&&ie.push(UV.configure((e=this.options)===null||e===void 0?void 0:e.blockquote)),this.options.bulletList!==!1&&ie.push(YV.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&ie.push(JV.configure((i=this.options)===null||i===void 0?void 0:i.code)),this.options.codeBlock!==!1&&ie.push(oS.configure((r=this.options)===null||r===void 0?void 0:r.codeBlock)),this.options.document!==!1&&ie.push(tF.configure((a=this.options)===null||a===void 0?void 0:a.document)),this.options.dropcursor!==!1&&ie.push(rF.configure((u=this.options)===null||u===void 0?void 0:u.dropcursor)),this.options.gapcursor!==!1&&ie.push(dF.configure((l=this.options)===null||l===void 0?void 0:l.gapcursor)),this.options.hardBreak!==!1&&ie.push(pF.configure((m=this.options)===null||m===void 0?void 0:m.hardBreak)),this.options.heading!==!1&&ie.push(fF.configure((x=this.options)===null||x===void 0?void 0:x.heading)),this.options.history!==!1&&ie.push(SF.configure((S=this.options)===null||S===void 0?void 0:S.history)),this.options.horizontalRule!==!1&&ie.push(EF.configure((E=this.options)===null||E===void 0?void 0:E.horizontalRule)),this.options.italic!==!1&&ie.push(IF.configure((T=this.options)===null||T===void 0?void 0:T.italic)),this.options.listItem!==!1&&ie.push(U0.configure((I=this.options)===null||I===void 0?void 0:I.listItem)),this.options.orderedList!==!1&&ie.push(PF.configure((z=this.options)===null||z===void 0?void 0:z.orderedList)),this.options.paragraph!==!1&&ie.push(DF.configure((F=this.options)===null||F===void 0?void 0:F.paragraph)),this.options.strike!==!1&&ie.push(NF.configure((j=this.options)===null||j===void 0?void 0:j.strike)),this.options.text!==!1&&ie.push(fS.configure((G=this.options)===null||G===void 0?void 0:G.text)),ie}}),BF=Ai.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;return(e=t.style.color)===null||e===void 0?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}});function LF(t){var e;const{char:n,allowSpaces:i,allowedPrefixes:r,startOfLine:a,$position:u}=t,l=r3(n),m=new RegExp(`\\s${l}$`),x=a?"^":"",S=i?new RegExp(`${x}${l}.*?(?=\\s${l}|$)`,"gm"):new RegExp(`${x}(?:^)?${l}[^\\s${l}]*`,"gm"),E=((e=u.nodeBefore)===null||e===void 0?void 0:e.isText)&&u.nodeBefore.text;if(!E)return null;const T=u.pos-E.length,I=Array.from(E.matchAll(S)).pop();if(!I||I.input===void 0||I.index===void 0)return null;const z=I.input.slice(Math.max(0,I.index-1),I.index),F=new RegExp(`^[${r==null?void 0:r.join("")}\0]?$`).test(z);if(r!==null&&!F)return null;const j=T+I.index;let G=j+I[0].length;return i&&m.test(E.slice(G-1,G+1))&&(I[0]+=" ",G+=1),j<u.pos&&G>=u.pos?{range:{from:j,to:G},query:I[0].slice(n.length),text:I[0]}:null}const VF=new Mr("suggestion");function FF({pluginKey:t=VF,editor:e,char:n="@",allowSpaces:i=!1,allowedPrefixes:r=[" "],startOfLine:a=!1,decorationTag:u="span",decorationClass:l="suggestion",command:m=()=>null,items:x=()=>[],render:S=()=>({}),allow:E=()=>!0,findSuggestionMatch:T=LF}){let I;const z=S==null?void 0:S(),F=new Fi({key:t,view(){return{update:async(j,G)=>{var ie,ae,J,Ce,be,Ae,Fe;const Pe=(ie=this.key)===null||ie===void 0?void 0:ie.getState(G),Xe=(ae=this.key)===null||ae===void 0?void 0:ae.getState(j.state),rt=Pe.active&&Xe.active&&Pe.range.from!==Xe.range.from,Bt=!Pe.active&&Xe.active,dt=Pe.active&&!Xe.active,Nt=!Bt&&!dt&&Pe.query!==Xe.query,Xt=Bt||rt&&Nt,rn=Nt||rt,jt=dt||rt&&Nt;if(!Xt&&!rn&&!jt)return;const Kt=jt&&!Xt?Pe:Xe,Sn=j.dom.querySelector(`[data-decoration-id="${Kt.decorationId}"]`);I={editor:e,range:Kt.range,query:Kt.query,text:Kt.text,items:[],command:Mt=>m({editor:e,range:Kt.range,props:Mt}),decorationNode:Sn,clientRect:Sn?()=>{var Mt;const{decorationId:En}=(Mt=this.key)===null||Mt===void 0?void 0:Mt.getState(e.state),dn=j.dom.querySelector(`[data-decoration-id="${En}"]`);return(dn==null?void 0:dn.getBoundingClientRect())||null}:null},Xt&&((J=z==null?void 0:z.onBeforeStart)===null||J===void 0||J.call(z,I)),rn&&((Ce=z==null?void 0:z.onBeforeUpdate)===null||Ce===void 0||Ce.call(z,I)),(rn||Xt)&&(I.items=await x({editor:e,query:Kt.query})),jt&&((be=z==null?void 0:z.onExit)===null||be===void 0||be.call(z,I)),rn&&((Ae=z==null?void 0:z.onUpdate)===null||Ae===void 0||Ae.call(z,I)),Xt&&((Fe=z==null?void 0:z.onStart)===null||Fe===void 0||Fe.call(z,I))},destroy:()=>{var j;I&&((j=z==null?void 0:z.onExit)===null||j===void 0||j.call(z,I))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(j,G,ie,ae){const{isEditable:J}=e,{composing:Ce}=e.view,{selection:be}=j,{empty:Ae,from:Fe}=be,Pe={...G};if(Pe.composing=Ce,J&&(Ae||e.view.composing)){(Fe<G.range.from||Fe>G.range.to)&&!Ce&&!G.composing&&(Pe.active=!1);const Xe=T({char:n,allowSpaces:i,allowedPrefixes:r,startOfLine:a,$position:be.$from}),rt=`id_${Math.floor(Math.random()*4294967295)}`;Xe&&E({editor:e,state:ae,range:Xe.range,isActive:G.active})?(Pe.active=!0,Pe.decorationId=G.decorationId?G.decorationId:rt,Pe.range=Xe.range,Pe.query=Xe.query,Pe.text=Xe.text):Pe.active=!1}else Pe.active=!1;return Pe.active||(Pe.decorationId=null,Pe.range={from:0,to:0},Pe.query=null,Pe.text=null),Pe}},props:{handleKeyDown(j,G){var ie;const{active:ae,range:J}=F.getState(j.state);return ae&&((ie=z==null?void 0:z.onKeyDown)===null||ie===void 0?void 0:ie.call(z,{view:j,event:G,range:J}))||!1},decorations(j){const{active:G,range:ie,decorationId:ae}=F.getState(j);return G?pi.create(j.doc,[Gr.inline(ie.from,ie.to,{nodeName:u,class:l,"data-decoration-id":ae})]):null}}});return F}const $F=new Mr("mention"),jF=bs.create({name:"mention",addOptions(){return{HTMLAttributes:{},renderText({options:t,node:e}){var n;return`${t.suggestion.char}${(n=e.attrs.label)!==null&&n!==void 0?n:e.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:t,node:e}){var n;return["span",ci(this.HTMLAttributes,t.HTMLAttributes),`${t.suggestion.char}${(n=e.attrs.label)!==null&&n!==void 0?n:e.attrs.id}`]},suggestion:{char:"@",pluginKey:$F,command:({editor:t,range:e,props:n})=>{var i,r,a;const u=t.view.state.selection.$to.nodeAfter;((i=u==null?void 0:u.text)===null||i===void 0?void 0:i.startsWith(" "))&&(e.to+=1),t.chain().focus().insertContentAt(e,[{type:this.name,attrs:n},{type:"text",text:" "}]).run(),(a=(r=t.view.dom.ownerDocument.defaultView)===null||r===void 0?void 0:r.getSelection())===null||a===void 0||a.collapseToEnd()},allow:({state:t,range:e})=>{const n=t.doc.resolve(e.from),i=t.schema.nodes[this.name];return!!n.parent.type.contentMatch.matchType(i)}}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-id"),renderHTML:t=>t.id?{"data-id":t.id}:{}},label:{default:null,parseHTML:t=>t.getAttribute("data-label"),renderHTML:t=>t.label?{"data-label":t.label}:{}}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:t,HTMLAttributes:e}){if(this.options.renderLabel!==void 0)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",ci({"data-type":this.name},this.options.HTMLAttributes,e),this.options.renderLabel({options:this.options,node:t})];const n={...this.options};n.HTMLAttributes=ci({"data-type":this.name},this.options.HTMLAttributes,e);const i=this.options.renderHTML({options:n,node:t});return typeof i=="string"?["span",ci({"data-type":this.name},this.options.HTMLAttributes,e),i]:i},renderText({node:t}){return this.options.renderLabel!==void 0?(console.warn("renderLabel is deprecated use renderText and renderHTML instead"),this.options.renderLabel({options:this.options,node:t})):this.options.renderText({options:this.options,node:t})},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:t,state:e})=>{let n=!1;const{selection:i}=e,{empty:r,anchor:a}=i;return r?(e.doc.nodesBetween(a-1,a,(u,l)=>{if(u.type.name===this.name)return n=!0,t.insertText(this.options.deleteTriggerWithBackspace?"":this.options.suggestion.char||"",l,l+u.nodeSize),!1}),n):!1})}},addProseMirrorPlugins(){return[FF({editor:this.editor,...this.options.suggestion})]}}),UF=oo.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",ci(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),HF={props:{editor:Object},methods:{toggleBlockquote(){this.editor&&this.editor.chain().toggleBlockquote().run()}}};function qF(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("button",{onClick:e[0]||(e[0]=(...u)=>a.toggleBlockquote&&a.toggleBlockquote(...u)),class:"p-1.5 text-gray-500 rounded hover:text-gray-900 dark:hover:text-white focus:outline-none"},e[1]||(e[1]=[_.createElementVNode("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[_.createElementVNode("path",{"fill-rule":"evenodd",d:"M6 6a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h3a3 3 0 0 1-3 3H5a1 1 0 1 0 0 2h1a5 5 0 0 0 5-5V8a2 2 0 0 0-2-2H6Zm9 0a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h3a3 3 0 0 1-3 3h-1a1 1 0 1 0 0 2h1a5 5 0 0 0 5-5V8a2 2 0 0 0-2-2h-3Z"})],-1)]))}const WF=Ge(HF,[["render",qF]]),GF={props:{editor:Object},methods:{toggleBulletList(){this.editor&&this.editor.chain().focus().toggleBulletList().run()}}};function ZF(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("button",{onClick:e[0]||(e[0]=(...u)=>a.toggleBulletList&&a.toggleBulletList(...u)),class:"p-1.5 text-gray-500 rounded hover:text-gray-900 dark:hover:text-white focus:outline-none"},e[1]||(e[1]=[_.createElementVNode("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[_.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-width":"2",d:"M9 8h10M9 12h10M9 16h10M4.99 8H5m-.02 4h.01m0 4H5"})],-1)]))}const YF=Ge(GF,[["render",ZF]]),XF={props:{editor:Object},methods:{toggleOrderedList(){this.editor&&this.editor.chain().focus().toggleOrderedList().run()}}};function KF(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("button",{onClick:e[0]||(e[0]=(...u)=>a.toggleOrderedList&&a.toggleOrderedList(...u)),class:"p-1.5 text-gray-500 rounded hover:text-gray-900 dark:hover:text-white focus:outline-none"},e[1]||(e[1]=[_.createElementVNode("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[_.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 6h8m-8 6h8m-8 6h8M4 16a2 2 0 1 1 3.321 1.5L4 20h5M4 5l2-1v6m-2 0h4"})],-1)]))}const JF=Ge(XF,[["render",KF]]),QF={props:{editor:Object},methods:{toggleCodeBlock(){this.editor&&this.editor.chain().focus().toggleCodeBlock().run()}}};function e6(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("button",{onClick:e[0]||(e[0]=(...u)=>a.toggleCodeBlock&&a.toggleCodeBlock(...u)),class:"p-1.5 text-gray-500 rounded hover:text-gray-900 dark:hover:text-white focus:outline-none"},e[1]||(e[1]=[_.createElementVNode("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},[_.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m8 8-4 4 4 4m8 0 4-4-4-4m-2-3-4 14"})],-1)]))}const t6=Ge(QF,[["render",e6]]),n6={props:{editor:Object},methods:{toggleBold(){this.editor&&this.editor.chain().toggleBold().run()}}};function i6(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("button",{onClick:e[0]||(e[0]=(...u)=>a.toggleBold&&a.toggleBold(...u)),class:_.normalizeClass(["p-1.5 text-gray-500 rounded cursor-pointer hover:text-gray-900 hover:bg-gray-200",{"bg-gray-200 text-gray-900":n.editor.isActive("bold")}])},e[1]||(e[1]=[_.createElementVNode("svg",{class:"w-5 h-5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},[_.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 5h4.5a3.5 3.5 0 1 1 0 7H8m0-7v7m0-7H6m2 7h6.5a3.5 3.5 0 1 1 0 7H8m0-7v7m0 0H6"})],-1),_.createElementVNode("span",{class:"sr-only"},"Bold",-1)]),2)}const r6=Ge(n6,[["render",i6]]),s6={props:{editor:Object},methods:{toggleItalic(){this.editor&&this.editor.chain().toggleItalic().run()}}};function o6(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("button",{onClick:e[0]||(e[0]=(...u)=>a.toggleItalic&&a.toggleItalic(...u)),class:_.normalizeClass(["p-1.5 text-gray-500 rounded cursor-pointer hover:text-gray-900 hover:bg-gray-200",{"bg-gray-200 text-gray-900":n.editor.isActive("italic")}])},e[1]||(e[1]=[_.createElementVNode("svg",{class:"w-5 h-5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},[_.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m8.874 19 6.143-14M6 19h6.33m-.66-14H18"})],-1),_.createElementVNode("span",{class:"sr-only"},"Italic",-1)]),2)}const a6=Ge(s6,[["render",o6]]),l6={},c6={"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"};function u6(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("svg",c6,e[0]||(e[0]=[_.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-width":"2",d:"M9 19.2H5.5c-.3 0-.5-.2-.5-.5V16c0-.2.2-.4.5-.4h13c.3 0 .5.2.5.4v2.7c0 .3-.2.5-.5.5H18m-6-1 1.4 1.8h.2l1.4-1.7m-7-5.4L12 4c0-.1 0-.1 0 0l4 8.8m-6-2.7h4m-7 2.7h2.5m5 0H17"},null,-1)]))}const h6={components:{IconA:Ge(l6,[["render",u6]])},props:{editor:Object},data(){return{color:"#000000",colors:["#000000","#0055CC","#206A83","#216E4E","#E56910","#AE2E24","#5E4DB2","#758195","#FF0000","#008000","#28A9AB","#AB7222"]}},methods:{setColor(t){this.editor&&(this.editor.chain().focus().setColor(t).run(),this.$refs.popover.togglePopover(),this.color=t)}}},d6={class:"relative flex"},p6={class:"flex w-[160px] flex-wrap gap-[4px]"},f6=["onClick"];function m6(t,e,n,i,r,a){const u=_.resolveComponent("IconA"),l=_.resolveComponent("VsPopover");return _.openBlock(),_.createBlock(l,{ref:"popover",placement:"bottom"},{reference:_.withCtx(()=>[_.createElementVNode("button",d6,[_.createVNode(u,{height:"20",width:"20",class:"text-gray-500"}),_.createElementVNode("span",{class:"absolute h-[4px] w-[80%] bottom-[2px] left-[2px]",style:_.normalizeStyle({backgroundColor:r.color})},null,4)])]),default:_.withCtx(()=>[_.createElementVNode("div",null,[_.createElementVNode("ul",p6,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(r.colors,m=>(_.openBlock(),_.createElementBlock("li",{class:"h-[37px] w-[37px] rounded",style:_.normalizeStyle({backgroundColor:m}),onClick:x=>a.setColor(m),key:m},null,12,f6))),128))])])]),_:1},512)}const g6=Ge(h6,[["render",m6]]),y6={},_6={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-dots-vertical"};function x6(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("svg",_6,e[0]||(e[0]=[_.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),_.createElementVNode("path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1),_.createElementVNode("path",{d:"M12 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1),_.createElementVNode("path",{d:"M12 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1)]))}const mS=Ge(y6,[["render",x6]]),b6={components:{IconMore:mS},props:{editor:Object},methods:{toggleUnderline(){this.$refs.popover.togglePopover(),this.editor&&this.editor.chain().focus().toggleUnderline().run()},toggleStrike(){this.$refs.popover.togglePopover(),this.editor&&this.editor.chain().focus().toggleStrike().run()}}};function v6(t,e,n,i,r,a){const u=_.resolveComponent("IconMore"),l=_.resolveComponent("VsPopover");return _.openBlock(),_.createBlock(l,{ref:"popover",placement:"bottom"},{reference:_.withCtx(()=>[_.createElementVNode("button",{class:_.normalizeClass(["p-1.5 text-gray-500 rounded cursor-pointer hover:text-gray-900 hover:bg-gray-200",{"bg-gray-200 text-gray-900":n.editor.isActive("underline")||n.editor.isActive("strike")}])},[_.createVNode(u,{height:"18",width:"18",class:"rotate-90"})],2)]),default:_.withCtx(()=>[_.createElementVNode("div",null,[_.createElementVNode("button",{onClick:e[0]||(e[0]=(...m)=>a.toggleUnderline&&a.toggleUnderline(...m)),class:_.normalizeClass(["p-[8px] block rounded-lg w-[140px] mb-[4px] text-start hover:bg-gray-100 !duration-300 underline underline-offset-1",{"bg-gray-100 text-gray-900":n.editor.isActive("underline")}])}," Підкресленний ",2),_.createElementVNode("button",{onClick:e[1]||(e[1]=(...m)=>a.toggleStrike&&a.toggleStrike(...m)),class:_.normalizeClass(["p-[8px] block rounded-lg w-[140px] text-start hover:bg-gray-100 !duration-300 line-through",{"bg-gray-100 text-gray-900":n.editor.isActive("strike")}])}," Перекресленний ",2)])]),_:1},512)}const w6={bold:r6,italic:a6,text_more:Ge(b6,[["render",v6]]),color:g6,bullet_list:YF,ordered_list:JF,blockquote:WF,codeblock:t6},k6={components:{EditorContent:$V},props:{controls:{type:Array,default:()=>["bold","italic","color","blockquote","bullet_list","ordered_list","codeblock","text_more"]},options:{type:Array,default:()=>[]},modelValue:{type:String,default:()=>""}},data(){return{editor:null}},computed:{controlsList(){return Object.entries(w6).filter(([t])=>this.controls.includes(t)).map(([t,e])=>e)}},watch:{modelValue(t){this.editor&&this.editor.getHTML()!==t&&this.editor.commands.setContent(t)},editor(t){t&&this.editor.on("update",({editor:e})=>{const n=e.getHTML();n!==this.modelValue&&this.$emit("update:modelValue",n)})}},mounted(){this.editor&&this.editor.destroy(),this.initEditor()},beforeDestroy(){this.editor&&this.editor.destroy()},methods:{initEditor(){this.editor=new FV({content:this.modelValue,extensions:[RF,oS,Zh,BF,UF,fS,jF.configure({HTMLAttributes:{class:"mention"},suggestion:{items:({query:t})=>{const e=this.options.filter(n=>{var i,r;return(r=(i=n==null?void 0:n.email)==null?void 0:i.toLowerCase())==null?void 0:r.includes(t==null?void 0:t.toLowerCase())}).slice(0,5);return e.length?e:[{id:null,text:"Данні відсутні",email:null}]},render:()=>{let t,e;return{onStart:n=>{t=document.createElement("div"),t.className="mention-popup",n.items.forEach(a=>{const u=document.createElement("div");u.className="mention-option",a.id===null?(u.textContent=a.text,u.style.pointerEvents="none",u.style.color="#999"):(u.textContent=a.text,u.addEventListener("click",()=>{n.command({id:a.id,label:a.email})})),t.appendChild(u)}),document.body.appendChild(t);const{from:i}=n.range,r=n.editor.view.coordsAtPos(i);t.style.position="absolute",t.style.left=`${r.left}px`,t.style.top=`${r.top-t.offsetHeight}px`,e=t},onUpdate:n=>{for(;t.firstChild;)t.removeChild(t.firstChild);n.items.forEach(a=>{const u=document.createElement("div");u.className="mention-option",a.id===null?(u.textContent=a.text,u.style.pointerEvents="none",u.style.color="#999"):(u.textContent=a.text,u.addEventListener("click",()=>{n.command({id:a.id,label:a.email})})),t.appendChild(u)});const{from:i}=n.range,r=n.editor.view.coordsAtPos(i);t.style.left=`${r.left}px`,t.style.top=`${r.top-t.offsetHeight}px`},onExit:()=>{e&&e.remove()}}}}})]})},focusEditor(){this.editor&&!this.editor.isFocused&&this.editor.commands.focus()}}},S6={class:"editor-container w-full min-w-[600px] border border-gray-200 rounded-lg bg-gray-50 dark:bg-gray-700 dark:border-gray-600"},E6={key:0,class:"editor-toolbar px-3 py-2 border-b dark:border-gray-600 flex flex-wrap items-center gap-2"};function C6(t,e,n,i,r,a){const u=_.resolveComponent("EditorContent");return _.openBlock(),_.createElementBlock("div",S6,[r.editor?(_.openBlock(),_.createElementBlock("div",E6,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(a.controlsList,(l,m)=>(_.openBlock(),_.createBlock(_.resolveDynamicComponent(l),{key:m,editor:r.editor},null,8,["editor"]))),128))])):_.createCommentVNode("",!0),_.createElementVNode("div",{onClick:e[0]||(e[0]=(...l)=>a.focusEditor&&a.focusEditor(...l)),class:"editor-content px-4 py-2 bg-white rounded-b-lg dark:bg-gray-800 relative"},[_.createVNode(u,{editor:r.editor,class:"relative"},null,8,["editor"])])])}const gS=Ge(k6,[["render",C6]]),T6=t=>{const e=/(\b\S)?/g,n=t.match(e);return n?n.join("").toUpperCase():""},M6={props:{name:{type:String,default(){return""}},avatar:{type:String,default(){return""}}},computed:{inItials(){return T6(this.name)}}},A6={class:"mr-2"},I6=["src"],P6={key:1,class:"flex flex-shrink-0 items-center justify-center w-6 h-6 bg-gray-500 text-xs text-white rounded-full"},D6={key:0},O6={key:1,class:"text-sm"};function z6(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("div",A6,[n.avatar?(_.openBlock(),_.createElementBlock("img",{key:0,src:n.avatar,alt:"avatar",class:"flex flex-shrink-0 items-center justify-center w-6 h-6 rounded-full"},null,8,I6)):n.name?(_.openBlock(),_.createElementBlock("div",P6,[a.inItials.length?(_.openBlock(),_.createElementBlock("span",D6,_.toDisplayString(a.inItials),1)):(_.openBlock(),_.createElementBlock("span",O6,e[0]||(e[0]=[_.createElementVNode("i",{class:"ti ti-user"},null,-1)])))])):_.createCommentVNode("",!0)])}const N6={components:{VsWidgetCommentsAvatar:Ge(M6,[["render",z6]]),VsTextEditor:gS},props:{comment:{type:Object,default:()=>({})},user:{type:Object,default:()=>({})},id:{type:String,default:""},options:Array},data(){return{commentContent:this.comment.body,isCommentActionVisible:!1,isOpen:!1,textareaValue:""}},computed:{isUserAutor(){return this.user.uid===this.comment.uid},createDate(){try{const t=lt(this.comment.cdate,"YYYY-MM-DD");return new Date(t).toLocaleDateString("uk-UA",{day:"2-digit",month:"long",year:"numeric"})}catch{return""}}},watch:{isOpen(t){t&&(this.textareaValue=this.comment.body)}},methods:{confirnDeleteComment(){document.body.click(),this.$emit("openModal",{title:"Ви впевнені?",message:"Ви впевнені, що хочете видалити цей коментар?",confirmButtonText:"Так, я впевнена/ий",cancelButtonText:"Скасувати",confirm:this.deleteComment,updateListOnConfirm:!0})},async updateComment(){try{await vt.post(`/api/widget/comment/${this.id}/${this.comment.communication_id}`,{body:this.textareaValue}),this.$emit("list-update"),this.isOpen=!1}catch{this.$notify({title:"Помилка!",message:"Сталася помилка",type:"error"})}},openEditModal(){document.body.click(),this.isOpen=!0},async deleteComment(){try{await vt.delete(`/api/widget/comment/${this.id}/${this.comment.communication_id}`),this.$emit("list-update"),this.isCommentActionVisible=!1}catch{this.$notify({title:"Помилка!",message:"Сталася помилка",type:"error"})}},toggleCommentAction(){this.isCommentActionVisible=!this.isCommentActionVisible}}},R6={class:"p-6 pl-1 text-base bg-white dark:bg-gray-900"},B6={class:"flex justify-between items-center mb-2"},L6={class:"flex items-center"},V6={class:"inline-flex items-center mr-3 text-sm text-gray-900 dark:text-white font-semibold"},F6={class:"text-sm text-gray-600 dark:text-gray-400"},$6={class:"flex flex-col items-center gap-[4px]"},j6=["innerHTML"],U6={class:"flex flex-col gap-[8px] text-sm font-medium text-gray-500"},H6={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"};function q6(t,e,n,i,r,a){const u=_.resolveComponent("VsWidgetCommentsAvatar"),l=_.resolveComponent("VsPopover"),m=_.resolveComponent("VsTextEditor"),x=_.resolveComponent("VsDialog");return _.openBlock(),_.createElementBlock(_.Fragment,null,[_.createElementVNode("div",R6,[_.createElementVNode("div",B6,[_.createElementVNode("div",L6,[_.createElementVNode("p",V6,[_.createVNode(u,{name:n.comment.username,avatar:n.comment.avatar},null,8,["name","avatar"]),_.createTextVNode(_.toDisplayString(n.comment.username),1)]),_.createElementVNode("p",F6,[_.createElementVNode("time",null,_.toDisplayString(a.createDate),1)])]),_.createVNode(l,{placement:"bottom"},{reference:_.withCtx(()=>e[6]||(e[6]=[_.createElementVNode("button",{class:"inline-flex items-center p-2 text-sm font-medium text-center text-gray-500 dark:text-gray-40 bg-white rounded-lg hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-50 dark:bg-gray-900 dark:hover:bg-gray-700 dark:focus:ring-gray-600",type:"button"},[_.createElementVNode("svg",{class:"w-4 h-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 16 3"},[_.createElementVNode("path",{d:"M2 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3Zm6.041 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM14 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3Z"})])],-1)])),default:_.withCtx(()=>[_.createElementVNode("div",$6,[_.createElementVNode("button",{type:"button",class:"block px-[12px] rounded-lg py-[4px] text-start w-[100px] duration-300 hover:bg-gray-100",onClick:e[0]||(e[0]=(...S)=>a.openEditModal&&a.openEditModal(...S))}," Редагувати "),_.createElementVNode("button",{type:"button",class:"block py-2 px-[12px] rounded-lg py-[6px] text-start duration-300 w-[100px] hover:bg-gray-100",onClick:e[1]||(e[1]=S=>a.confirnDeleteComment())}," Видалити ")])]),_:1})]),_.createElementVNode("p",{class:"text-gray-500 dark:text-gray-400",innerHTML:n.comment.body},null,8,j6)]),_.createVNode(x,{visible:r.isOpen,"onUpdate:visible":e[5]||(e[5]=S=>r.isOpen=S),title:"Редагувати",size:"small"},{footer:_.withCtx(()=>[_.createElementVNode("div",H6,[_.createElementVNode("button",{onClick:e[3]||(e[3]=S=>r.isOpen=!1),class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border rounded-lg !border-gray-200 hover:bg-gray-100 duration-300"}," Відмінити "),_.createElementVNode("button",{onClick:e[4]||(e[4]=(...S)=>a.updateComment&&a.updateComment(...S)),class:"py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"}," Зберегти ")])]),default:_.withCtx(()=>[_.createElementVNode("div",U6,[e[7]||(e[7]=_.createTextVNode(" Коментар ")),_.createVNode(m,{modelValue:r.textareaValue,"onUpdate:modelValue":e[2]||(e[2]=S=>r.textareaValue=S),options:n.options},null,8,["modelValue","options"])])]),_:1},8,["visible"])],64)}const W6={components:{VsWidgetCommentsItem:Ge(N6,[["render",q6]])},inject:["activeAddFormEditor"],props:{id:{type:String,default:()=>""},prefilledData:{type:Object,default:null},options:Array},data(){return{isLoaded:!1,isLoadFailed:!1,comments:[],user:{},modal:{title:"",message:"",cancel:"",confirm:"",cancelButtonText:"",confirmButtonText:""},isModalVisible:!1}},async created(){await this.getComments()},methods:{async getComments(){if(this.prefilledData){this.comments=this.prefilledData.rows,this.isLoaded=!0;return}try{const{data:t}=await vt.get(`/api/widget/comment/${this.id}`);this.comments=t.rows,this.user=t.user}catch(t){this.isLoadFailed=!0,console.error(t)}this.isLoaded=!0,this.$emit("update-comment-count")},prepareModal(t){const e={...t};return t.cancel||(e.cancel=()=>{this.isModalVisible=!1}),t.updateListOnConfirm&&(e.confirm=async()=>{await t.confirm(),this.isModalVisible=!1}),e},handleOpenModal(t){this.modal=this.prepareModal(t),this.isModalVisible=!0}}},G6={class:"flex flex-col"},Z6={key:0,class:"max-h-[300px] overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},Y6={key:1},X6={class:"p-4"},K6={class:"mt-1 text-gray-500 dark:text-neutral-500"},J6={class:"mt-4 flex justify-end gap-x-3"};function Q6(t,e,n,i,r,a){const u=_.resolveComponent("VsErrorOnLoading"),l=_.resolveComponent("VsWidgetCommentsItem"),m=_.resolveComponent("VsLoader"),x=_.resolveComponent("VsDialog");return _.openBlock(),_.createElementBlock("div",G6,[r.isLoaded?(_.openBlock(),_.createElementBlock(_.Fragment,{key:0},[r.isLoadFailed?(_.openBlock(),_.createBlock(u,{key:0})):(_.openBlock(),_.createElementBlock(_.Fragment,{key:1},[r.comments.length?(_.openBlock(),_.createElementBlock("div",Z6,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(r.comments,(S,E)=>(_.openBlock(),_.createBlock(l,{key:E,comment:S,user:r.user,options:n.options,index:E,id:n.id,onListUpdate:a.getComments,class:"border-top",onOpenModal:e[0]||(e[0]=T=>a.handleOpenModal(T))},null,8,["comment","user","options","index","id","onListUpdate"]))),128))])):(_.openBlock(),_.createElementBlock("div",Y6,e[4]||(e[4]=[_.createElementVNode("p",{class:"pl-3 text-sm font-medium text-gray-600"}," Коментарі відсутні ",-1)])))],64))],64)):(_.openBlock(),_.createBlock(m,{key:1,class:"justify-center",text:"Please wait..."})),_.createVNode(x,{title:r.modal.title,size:"small",visible:r.isModalVisible,"onUpdate:visible":e[3]||(e[3]=S=>r.isModalVisible=S)},{default:_.withCtx(()=>[_.createElementVNode("div",X6,[_.createElementVNode("p",K6,_.toDisplayString(r.modal.message),1),_.createElementVNode("div",J6,[_.createElementVNode("button",{type:"button",class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:e[1]||(e[1]=(...S)=>r.modal.cancel&&r.modal.cancel(...S))},_.toDisplayString(r.modal.cancelButtonText),1),_.createElementVNode("button",{type:"button",class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm font-semibold rounded-lg border border-transparent bg-red-500 text-white hover:bg-red-600 disabled:opacity-50 disabled:pointer-events-none",onClick:e[2]||(e[2]=(...S)=>r.modal.confirm&&r.modal.confirm(...S))},_.toDisplayString(r.modal.confirmButtonText),1)])])]),_:1},8,["title","visible"])])}const e$=Ge(W6,[["render",Q6]]),t$={components:{VsTextEditor:gS},props:{id:{type:String,default:()=>""},autofocus:{type:Boolean,default:()=>!0},options:Array},data(){return{isEditorOpen:!1,commentContent:""}},methods:{async addNewComment(){if(this.commentContent)try{await vt.post(`/api/widget/comment/${this.id}`,{body:this.commentContent}),this.commentContent="",this.$emit("list-update")}catch(t){console.error(t)}},setNewContent(t){this.commentContent=t}}},n$={class:"w-full widget-comment-form flex flex-col items-start"},i$={class:"mb-4 bg-white border-gray-200 dark:bg-gray-800 dark:border-gray-700"},r$={class:"flex"};function s$(t,e,n,i,r,a){const u=_.resolveComponent("VsTextEditor");return _.openBlock(),_.createElementBlock("div",n$,[_.createElementVNode("div",i$,[_.createVNode(u,{modelValue:r.commentContent,"onUpdate:modelValue":e[0]||(e[0]=l=>r.commentContent=l),options:n.options},null,8,["modelValue","options"])]),_.createElementVNode("div",r$,[_.createElementVNode("button",{ref:"buttonAdd",class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent bg-blue-600 text-white hover:bg-blue-700 hover:text-white duration-300",onClick:e[1]||(e[1]=(...l)=>a.addNewComment&&a.addNewComment(...l))}," Відправити коментар ",512)])])}const o$={components:{VsWidgetCommentsList:e$,VsWidgetCommentsAddForm:Ge(t$,[["render",s$]])},props:{id:{type:String,default(){return""}},prefilledData:{type:Object,default:null}},data(){return{activeAddFormEditor:"",comments:[],totalComment:"0",options:[]}},mounted(){this.comments=this.$refs.commentListRef.comments,this.getUsersList()},watch:{comments(t){this.$emit("count-change",t.length)}},methods:{async getUsersList(){try{const{data:t}=await vt.get("/api/suggest/core.user_mentioned");this.options=t}catch(t){console.log(t)}},listUpdate(){this.$refs.commentListRef.getComments()},updateCommentCount(){this.totalComment=this.$refs.commentListRef.comments.length||"0"}}},a$={class:"bg-white-200"};function l$(t,e,n,i,r,a){const u=_.resolveComponent("VsWidgetCommentsAddForm"),l=_.resolveComponent("VsWidgetCommentsList");return _.openBlock(),_.createElementBlock("div",a$,[e[2]||(e[2]=_.createElementVNode("div",{class:"flex justify-between items-center gap-x-2 mb-4"},null,-1)),_.createVNode(u,{options:r.options,class:"mb-6",id:n.id,onListUpdate:e[0]||(e[0]=m=>a.listUpdate())},null,8,["options","id"]),_.createVNode(l,{options:r.options,id:n.id,onUpdateCommentCount:e[1]||(e[1]=m=>a.updateCommentCount()),"prefilled-data":n.prefilledData,ref:"commentListRef"},null,8,["options","id","prefilled-data"])])}const yS=Ge(o$,[["render",l$]]),_S=t=>new Date(t).toLocaleDateString("uk-UK",{day:"numeric",month:"long",year:"numeric",hour:"numeric",minute:"numeric"}),c$=t=>new Date(t).toLocaleDateString("uk-UK",{day:"numeric",month:"numeric",year:"numeric",hour:"numeric",minute:"numeric"}),u$=t=>{const e=/(\b\S)?/g,n=t.match(e);return n?n.join("").toUpperCase():""},h$=_.defineComponent({props:{username:{type:String,default:()=>""}},computed:{inItials(){return u$(this.username)}}}),d$={class:"flex flex-shrink-0 items-center justify-center w-8 h-8 bg-gray-500 text-xs text-white rounded-full"};function p$(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("div",d$,_.toDisplayString(t.inItials),1)}const f$=Ge(h$,[["render",p$]]),G0={load(){try{const t=Array.from(arguments);window.headLoadedFiles||(window.headLoadedFiles=[]);const e=typeof arguments[arguments.length-1]=="function"?arguments[arguments.length-1]:null,n=t.filter(i=>typeof i!="function").reduce((i,r)=>i.concat(r),[]).filter(i=>i&&!window.headLoadedFiles[i.url||i.split("?")[0]]);Promise.all(n.map(i=>this.loadFile1(i))).then(()=>{e&&e()})}catch(t){console.log(t)}},promise(t){return new Promise((e,n)=>{G0.load(t,()=>{e()})})},loadFile1(t){let e=!1;typeof t=="object"&&(e=t.type,t=t.url);const n=t.split("?")[0];return new Promise((i,r)=>{function a(l){delete window.headLoadedFiles[`_${n}`],window.headLoadedFiles[n]=l.type,i(l.type)}let u;window.headLoadedFiles[`_${n}`]?u=window.headLoadedFiles[`_${n}`]:(n.includes(".css")?(u=document.createElement("link"),u.href=t,u.type="text/css",u.rel="stylesheet"):(u=document.createElement("script"),u.type="text/javascript",u.src=t,e&&(u.type=e)),window.headLoadedFiles[`_${n}`]=u,document.head.appendChild(u)),u.addEventListener("load",a),u.addEventListener("error",a)})}},m$={props:{point:{type:String,default:()=>""}},data(){return{zoom:18}},computed:{parsedPoint(){return JSON.parse(this.point)},tooltipText(){return this.parsedPoint.coordinates.join(", ")},coordinates(){return[...this.parsedPoint.coordinates].reverse()}},async mounted(){typeof window>"u"||(window!=null&&window.L||(await G0.promise("https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/leaflet.js"),await G0.promise("https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/leaflet.js")),this.initMap())},methods:{initMap(){const t=window.L.map("map",{center:this.coordinates,zoom:this.zoom});window.L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png").addTo(t),window.L.circle(this.coordinates,{color:"red",fillColor:"red",fillOpacity:.2,radius:10}).addTo(t).bindTooltip(this.tooltipText)}}},g$={id:"map",style:{height:"9rem",width:"24rem"}};function y$(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("div",g$)}const _$=Ge(m$,[["render",y$]]),x$=_.defineComponent({components:{VsWidgetHistoryItemAvatar:f$,VsWidgetHistoryItemMap:_$},props:{item:{type:Object,default:()=>{}}},methods:{getTitle(t){return t.title||t.attr},getOldValue(t){return t.old||"Не вказано"},getNewValue(t){return t.new||"Не вказано"},getDate(t){return c$(t.cdate)}}}),b$={class:"relative [&_p]:m-0"},v$={class:"flex items-center gap-3"},w$={class:"w-full flex justify-between"},k$={class:"text-gray-500"},S$={class:"text-gray-800 font-medium"},E$={class:"text-gray-500 text-sm"},C$={class:"mt-2 pl-10"},T$={key:0},M$={key:1,class:"flex items-center gap-2 text-gray-700 text-sm"},A$={class:"font-medium"},I$={class:"font-medium"};function P$(t,e,n,i,r,a){const u=_.resolveComponent("VsWidgetHistoryItemAvatar"),l=_.resolveComponent("VsWidgetHistoryItemMap");return _.openBlock(),_.createElementBlock("div",b$,[_.createElementVNode("div",v$,[_.createVNode(u,{username:t.item.username},null,8,["username"]),_.createElementVNode("div",w$,[_.createElementVNode("p",k$,[_.createElementVNode("span",S$,_.toDisplayString(t.item.username),1),e[0]||(e[0]=_.createTextVNode(" змінив данні: "))]),_.createElementVNode("p",E$,_.toDisplayString(t.getDate(t.item)),1)])]),_.createElementVNode("div",C$,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(t.item.changes,(m,x)=>(_.openBlock(),_.createElementBlock("div",{key:x},[m.attr==="geom"?(_.openBlock(),_.createElementBlock("div",T$,[e[1]||(e[1]=_.createElementVNode("p",null,"Додана геометрія:",-1)),m.new?(_.openBlock(),_.createBlock(l,{key:0,point:m.new},null,8,["point"])):_.createCommentVNode("",!0)])):(_.openBlock(),_.createElementBlock("div",M$,[_.createElementVNode("p",null,_.toDisplayString(`- ${t.getTitle(m)}:`),1),_.createElementVNode("p",A$,_.toDisplayString(t.getOldValue(m)),1),e[2]||(e[2]=_.createElementVNode("i",{class:"ti ti-arrow-right"},null,-1)),_.createElementVNode("p",I$,_.toDisplayString(t.getNewValue(m)),1)]))]))),128))])])}const D$=Ge(x$,[["render",P$]]),O$=_.defineComponent({components:{VsWidgetHistoryItem:D$,VsEmptyWidget:Sy},props:{id:{type:String,default:""},prefilledData:{type:Object,default:null}},data:()=>({history:{}}),computed:{createdDate(){return this.history.data?_S(this.history.data.cdate):""},lastEditDate(){return this.history.data?_S(this.history.data.edate):""},authorName(){return this.history.data?this.history.data.author:""}},methods:{async getHistoryData(){if(this.prefilledData){this.history=this.prefilledData;return}try{const{data:t}=await vt.get(`/api/widget/history/${this.id}`);this.history=t}catch(t){console.error(t)}}},async mounted(){await this.getHistoryData()},watch:{"history.rows":function(t){this.$emit("count-change",t.length)}}}),z$={class:"bg-white"},N$={key:0,class:"space-y-6 list-none relative !px-0 sm:before:absolute sm:before:top-2 sm:before:bottom-0 sm:before:w-0.5 sm:before:left-4 before:bg-gray-200 max-h-[400px] overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},R$={key:1,class:"w-full h-[330px] flex items-center justify-center"};function B$(t,e,n,i,r,a){var l;const u=_.resolveComponent("VsWidgetHistoryItem");return _.openBlock(),_.createElementBlock("div",z$,[e[0]||(e[0]=_.createElementVNode("div",{class:"flex justify-between items-center gap-x-2 mb-4"},null,-1)),(l=t.history.rows)!=null&&l.length?(_.openBlock(),_.createElementBlock("ul",N$,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(t.history.rows,m=>(_.openBlock(),_.createElementBlock("li",{class:"list-none",key:m.uid},[_.createVNode(u,{item:m},null,8,["item"])]))),128))])):(_.openBlock(),_.createElementBlock("div",R$," Історія відсутні "))])}const L$={"vs-widget-map":L1,"vs-widget-gallery":fR,"vs-widget-comments":yS,"vs-widget-file":Rv,"vs-widget-history":Ge(O$,[["render",B$]])},V$={},F$={style:{width:"calc(100vw - 300px)",height:"calc(100vh - 60px)"},class:"bg-gray-50 flex items-center justify-center"},$$={__name:"vs-dashboard",setup(t){return(e,n)=>(_.openBlock(),_.createElementBlock("div",F$,n[0]||(n[0]=[_.createElementVNode("div",{class:"p-5 md:p-8 bg-white border border-gray-200 shadow-sm rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},[_.createElementVNode("div",{class:"mb-4 xl:mb-8"},[_.createElementVNode("h1",{class:"text-lg font-semibold text-gray-800 dark:text-neutral-200"}," Members "),_.createElementVNode("p",{class:"text-sm text-gray-500 dark:text-neutral-500"}," Manage members and users of your workspace and set their access level. ")]),_.createElementVNode("div",{class:"space-y-5"},[_.createElementVNode("div",{class:"flex sm:grid sm:grid-cols-2 gap-x-2 sm:gap-x-5"},[_.createElementVNode("div",{class:"relative w-full"},[_.createElementVNode("div",{class:"absolute inset-y-0 start-0 flex items-center pointer-events-none z-20 ps-3.5"},[_.createElementVNode("svg",{class:"shrink-0 size-4 text-gray-500 dark:text-neutral-400",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[_.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),_.createElementVNode("path",{d:"m21 21-4.3-4.3"})])]),_.createElementVNode("input",{type:"text",class:"py-2 ps-10 pe-8 block w-full bg-gray-100 border-transparent rounded-lg text-sm focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:border-transparent dark:text-neutral-400 dark:placeholder:text-neutral-400 dark:focus:ring-neutral-600",placeholder:"Search by name or email"}),_.createElementVNode("div",{class:"hidden absolute inset-y-0 end-0 flex items-center pointer-events-none z-20 pe-1"},[_.createElementVNode("button",{type:"button",class:"inline-flex shrink-0 justify-center items-center size-6 rounded-full text-gray-500 hover:text-blue-600 focus:outline-none focus:text-blue-600 dark:text-neutral-500 dark:hover:text-blue-500 dark:focus:text-blue-500","aria-label":"Close"},[_.createElementVNode("span",{class:"sr-only"},"Close"),_.createElementVNode("svg",{class:"shrink-0 size-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[_.createElementVNode("circle",{cx:"12",cy:"12",r:"10"}),_.createElementVNode("path",{d:"m15 9-6 6"}),_.createElementVNode("path",{d:"m9 9 6 6"})])])])]),_.createElementVNode("div",{class:"flex justify-end items-center gap-x-2"},[_.createElementVNode("button",{type:"button",class:"p-2.5 sm:py-2 sm:px-3 inline-flex items-center text-sm font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},[_.createElementVNode("svg",{class:"shrink-0 sm:me-2 size-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[_.createElementVNode("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),_.createElementVNode("polyline",{points:"7 10 12 15 17 10"}),_.createElementVNode("line",{x1:"12",x2:"12",y1:"15",y2:"3"})]),_.createElementVNode("span",{class:"hidden sm:block"}," Download CSV ")]),_.createElementVNode("button",{type:"button",class:"py-2 px-3 inline-flex items-center gap-x-1 text-sm font-medium rounded-lg border border-transparent bg-blue-600 text-white hover:bg-blue-700 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:ring-2 focus:ring-blue-500","data-hs-overlay":"#hs-pro-dshm"},[_.createElementVNode("span",{class:"hidden sm:block"},"Send"),_.createTextVNode("Invite ")])])]),_.createElementVNode("div",{class:"grid sm:grid-cols-2 lg:grid-cols-4 gap-2 xl:gap-4"},[_.createElementVNode("div",{class:"p-4 flex flex-col bg-white border border-gray-200 rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},[_.createElementVNode("div",{class:"flex justify-between items-center mb-1"},[_.createElementVNode("h2",{class:"text-4xl font-semibold text-gray-800 dark:text-neutral-200"}),_.createElementVNode("div",{class:"flex items-center -space-x-2"},[_.createElementVNode("img",{class:"shrink-0 size-7 rounded-full",src:"https://images.unsplash.com/photo-1659482633369-9fe69af50bfb?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=3&w=320&h=320&q=80",alt:"Avatar"})])]),_.createElementVNode("h3",{class:"text-gray-500 dark:text-neutral-500"},"Admin")]),_.createElementVNode("div",{class:"p-4 flex flex-col bg-white border border-gray-200 rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},[_.createElementVNode("div",{class:"flex justify-between items-center mb-1"},[_.createElementVNode("h2",{class:"text-4xl font-semibold text-gray-800 dark:text-neutral-200"}," 5 "),_.createElementVNode("div",{class:"flex items-center -space-x-2"},[_.createElementVNode("img",{class:"shrink-0 size-7 shadow-md rounded-full",src:"https://images.unsplash.com/photo-1659482633369-9fe69af50bfb?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=2.5&w=320&h=320&q=80",alt:"Avatar"}),_.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-7 bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," L "),_.createElementVNode("img",{class:"shrink-0 size-7 shadow-md rounded-full",src:"https://images.unsplash.com/photo-1679412330254-90cb240038c5?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=2.5&w=320&h=320&q=80",alt:"Avatar"}),_.createElementVNode("img",{class:"shrink-0 size-7 shadow-md rounded-full",src:"https://images.unsplash.com/photo-1659482634023-2c4fda99ac0c?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=2.5&w=320&h=320&q=80",alt:"Avatar"}),_.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-7 bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," O ")])]),_.createElementVNode("div",{class:"inline-flex items-center gap-x-2"},[_.createElementVNode("h3",{class:"text-gray-500 dark:text-neutral-500"},"Members"),_.createElementVNode("div",{class:"hs-tooltip inline-block"},[_.createElementVNode("svg",{class:"hs-tooltip-toggle shrink-0 size-3.5 text-gray-500 dark:text-neutral-500",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16"},[_.createElementVNode("path",{d:"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"}),_.createElementVNode("path",{d:"m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"})]),_.createElementVNode("div",{class:"hs-tooltip-content hs-tooltip-shown:opacity-100 hs-tooltip-shown:visible opacity-0 inline-block absolute invisible z-20 w-60 py-1.5 px-2.5 bg-gray-900 text-xs text-white rounded dark:bg-neutral-700",role:"tooltip","data-popper-placement":"top",style:{position:"fixed",inset:"auto auto 0px 0px",margin:"0px",transform:"translate(689px, -708px)"}}," Limited Access Members can only access the projects, tasks, and messages explicitly shared with them. ")])])]),_.createElementVNode("div",{class:"p-4 flex flex-col bg-white border border-gray-200 rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},[_.createElementVNode("div",{class:"flex justify-between items-center mb-1"},[_.createElementVNode("h2",{class:"text-4xl font-semibold text-gray-800 dark:text-neutral-200"}," 2 "),_.createElementVNode("div",{class:"flex items-center -space-x-2"},[_.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-7 bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," L "),_.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-7 bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," 0 ")])]),_.createElementVNode("div",{class:"inline-flex items-center gap-x-2"},[_.createElementVNode("h3",{class:"text-gray-500 dark:text-neutral-500"}," Limited access members "),_.createElementVNode("div",{class:"hs-tooltip inline-block"},[_.createElementVNode("svg",{class:"hs-tooltip-toggle shrink-0 size-3.5 text-gray-500 dark:text-neutral-500",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16"},[_.createElementVNode("path",{d:"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"}),_.createElementVNode("path",{d:"m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"})]),_.createElementVNode("div",{class:"hs-tooltip-content hs-tooltip-shown:opacity-100 hs-tooltip-shown:visible opacity-0 inline-block absolute invisible z-20 w-60 py-1.5 px-2.5 bg-gray-900 text-xs text-white rounded dark:bg-neutral-700",role:"tooltip","data-popper-placement":"top",style:{position:"fixed",inset:"auto auto 0px 0px",margin:"0px",transform:"translate(1198px, -708px)"}}," Limited Access Members can only access the projects, tasks, and messages explicitly shared with them. ")])])]),_.createElementVNode("div",{class:"p-4 flex flex-col bg-white border border-gray-200 rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},[_.createElementVNode("div",{class:"flex justify-between items-center mb-1"},[_.createElementVNode("h2",{class:"text-4xl font-semibold text-gray-800 dark:text-neutral-200"}," 0 "),_.createElementVNode("div",{class:"flex items-center -space-x-2"})]),_.createElementVNode("h3",{class:"text-gray-500 dark:text-neutral-500"},"Pending invites")])]),_.createElementVNode("div",{class:"overflow-x-auto [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},[_.createElementVNode("div",{class:"min-w-full inline-block align-middle"},[_.createElementVNode("table",{class:"min-w-full divide-y divide-gray-200 dark:divide-neutral-700"},[_.createElementVNode("thead",null,[_.createElementVNode("tr",null,[_.createElementVNode("th",{scope:"col",class:"min-w-[250px]"},[_.createElementVNode("div",{class:"pe-4 py-3 text-start flex items-center gap-x-1 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Member ")]),_.createElementVNode("th",{scope:"col",class:"min-w-48"},[_.createElementVNode("div",{class:"px-4 py-3 text-start flex items-center gap-x-1 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Role ")]),_.createElementVNode("th",{scope:"col"},[_.createElementVNode("div",{class:"px-4 py-3 text-start flex items-center gap-x-1 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Email ")]),_.createElementVNode("th",{scope:"col",class:"min-w-36"},[_.createElementVNode("div",{class:"px-4 py-3 text-start flex items-center gap-x-1 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Last activity ")]),_.createElementVNode("th",{scope:"col"},[_.createElementVNode("div",{class:"px-4 py-3 text-start flex items-center gap-x-1 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Status ")])])]),_.createElementVNode("tbody",{class:"divide-y divide-gray-200 dark:divide-neutral-700"},[_.createElementVNode("tr",null,[_.createElementVNode("td",{class:"size-px whitespace-nowrap pe-4 py-3"},[_.createElementVNode("div",{class:"w-full flex items-center gap-x-3"},[_.createElementVNode("img",{class:"shrink-0 size-[38px] rounded-full",src:"https://images.unsplash.com/photo-1659482633369-9fe69af50bfb?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=3&w=320&h=320&q=80",alt:"Avatar"}),_.createElementVNode("div",{class:"grow"},[_.createElementVNode("span",{class:"text-sm font-medium text-gray-800 dark:text-neutral-200"}," James Collins ")])])]),_.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[_.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Admin ")]),_.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[_.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," james@site.com ")]),_.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[_.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Today ")]),_.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[_.createElementVNode("span",{class:"inline-flex items-center gap-x-1.5 py-1.5 px-2.5 text-xs font-medium bg-teal-100 text-teal-800 rounded-full dark:bg-teal-500/10 dark:text-teal-500"},[_.createElementVNode("span",{class:"size-1.5 inline-block bg-gray-800 rounded-full dark:bg-neutral-200"}),_.createTextVNode(" Active ")])])]),_.createElementVNode("tr",null,[_.createElementVNode("td",{class:"size-px whitespace-nowrap pe-4 py-3"},[_.createElementVNode("div",{class:"w-full flex items-center gap-x-3"},[_.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-[38px] bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," L "),_.createElementVNode("div",{class:"grow"},[_.createElementVNode("span",{class:"text-sm font-medium text-gray-800 dark:text-neutral-200"}," James Collins ")])])]),_.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[_.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Can view ")]),_.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[_.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," liza@site.com ")]),_.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[_.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," 2 days ago ")]),_.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[_.createElementVNode("span",{class:"inline-flex items-center gap-1.5 py-1.5 px-2 text-xs font-medium bg-gray-100 text-gray-800 rounded-full dark:bg-neutral-500/20 dark:text-neutral-400"},[_.createElementVNode("span",{class:"size-1.5 inline-block bg-gray-800 rounded-full dark:bg-neutral-400"}),_.createTextVNode(" Inactive ")])])]),_.createElementVNode("tr",null,[_.createElementVNode("td",{class:"size-px whitespace-nowrap pe-4 py-3"},[_.createElementVNode("div",{class:"w-full flex items-center gap-x-3"},[_.createElementVNode("img",{class:"shrink-0 size-[38px] rounded-full",src:"https://images.unsplash.com/photo-1601935111741-ae98b2b230b0?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=2.5&w=320&h=320&q=80",alt:"Avatar"}),_.createElementVNode("div",{class:"grow"},[_.createElementVNode("span",{class:"text-sm font-medium text-gray-800 dark:text-neutral-200"}," Daniel Hobbs ")])])]),_.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[_.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Can edit ")]),_.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[_.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," dhobbs@site.com ")]),_.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[_.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Today ")]),_.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[_.createElementVNode("span",{class:"inline-flex items-center gap-1.5 py-1.5 px-2 text-xs font-medium bg-gray-100 text-gray-800 rounded-full dark:bg-neutral-500/20 dark:text-neutral-400"},[_.createElementVNode("span",{class:"size-1.5 inline-block bg-gray-800 rounded-full dark:bg-neutral-400"}),_.createTextVNode(" Inactive ")])])]),_.createElementVNode("tr",null,[_.createElementVNode("td",{class:"size-px whitespace-nowrap pe-4 py-3"},[_.createElementVNode("div",{class:"w-full flex items-center gap-x-3"},[_.createElementVNode("img",{class:"shrink-0 size-[38px] rounded-full",src:"https://images.unsplash.com/photo-1679412330254-90cb240038c5?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=2.5&w=320&h=320&q=80",alt:"Avatar"}),_.createElementVNode("div",{class:"grow"},[_.createElementVNode("span",{class:"text-sm font-medium text-gray-800 dark:text-neutral-200"}," Brian Warner ")])])]),_.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[_.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Can edit ")]),_.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[_.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," brian@site.com ")]),_.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[_.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," 1 months ago ")]),_.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[_.createElementVNode("span",{class:"inline-flex items-center gap-x-1.5 py-1.5 px-2.5 text-xs font-medium bg-teal-100 text-teal-800 rounded-full dark:bg-teal-500/10 dark:text-teal-500"},[_.createElementVNode("span",{class:"size-1.5 inline-block bg-gray-800 rounded-full dark:bg-neutral-200"}),_.createTextVNode(" Active ")])])]),_.createElementVNode("tr",null,[_.createElementVNode("td",{class:"size-px whitespace-nowrap pe-4 py-3"},[_.createElementVNode("div",{class:"w-full flex items-center gap-x-3"},[_.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-[38px] bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," O "),_.createElementVNode("div",{class:"grow"},[_.createElementVNode("span",{class:"text-sm font-medium text-gray-800 dark:text-neutral-200"}," Ols Shols ")])])]),_.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[_.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Can view ")]),_.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[_.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," olsshols@site.com ")]),_.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[_.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," 6 days ago ")]),_.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[_.createElementVNode("span",{class:"inline-flex items-center gap-1.5 py-1.5 px-2 text-xs font-medium bg-gray-100 text-gray-800 rounded-full dark:bg-neutral-500/20 dark:text-neutral-400"},[_.createElementVNode("span",{class:"size-1.5 inline-block bg-gray-800 rounded-full dark:bg-neutral-400"}),_.createTextVNode(" Inactive ")])])])])])])])])],-1)])))}},j$={},U$={class:"shrink-0 size-4 text-gray-400 dark:text-white/60",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function H$(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("svg",U$,e[0]||(e[0]=[_.createElementVNode("circle",{cx:"11",cy:"11",r:"8"},null,-1),_.createElementVNode("path",{d:"m21 21-4.3-4.3"},null,-1)]))}const Z0=Ge(j$,[["render",H$]]),q$={components:{IconSearch:Z0},data(){return{link:null,color:void 0,data:null,searchValue:""}},mounted(){this.link="/admin.user-cls",this.getData()},computed:{rows(){var t,e;return((e=(t=this.data)==null?void 0:t.rows)==null?void 0:e.filter(n=>{var i;return(i=n==null?void 0:n.name)==null?void 0:i.includes(this.searchValue)}))||null}},methods:{async getData(){try{const{data:t}=await vt.get("/api/user-cls");this.data=t}catch{}}}},W$={class:"w-[300px] border-r",style:{height:"calc(100vh - 60px)"}},G$={class:"relative"},Z$={class:"flex flex-col w-[300px] gap-[4px] overflow-y-auto overflow-x-hidden p-[10px] pr-0 [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300",style:{height:"calc(100vh - 100px)"}},Y$={class:"w-[99%] overflow-hidden overflow-ellipsis"},X$={class:"ml-auto text-[10px] h-[16px] px-[6px] flex items-center justify-center rounded-full bg-gray-200"};function K$(t,e,n,i,r,a){const u=_.resolveComponent("IconSearch"),l=_.resolveComponent("VsText"),m=_.resolveComponent("router-link");return _.openBlock(),_.createElementBlock("div",W$,[_.createElementVNode("div",G$,[_.createVNode(u,{height:"16",width:"16",class:"absolute top-[12px] left-[30px] text-gray-500 z-[1]"}),_.createVNode(l,{type:"text",modelValue:r.searchValue,"onUpdate:modelValue":e[0]||(e[0]=x=>r.searchValue=x),clearable:!0,placeholder:"Пошук по меню",class:"[&>input]:h-[40px] [&>input]:block [&>input]:rounded-none [&>input]:border-x-0 [&>input]:pl-[60px] [&>input:focus]:outline-none [&>input:focus]:focus:ring-0 [&>input:focus]:border-y-gray-200 [&>input:focus]:border-y-1 [&>input:focus]:border-x-0"},null,8,["modelValue"])]),_.createElementVNode("ul",Z$,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(a.rows,x=>{var S,E;return _.openBlock(),_.createElementBlock("li",{key:x==null?void 0:x.id,class:"w-full pr-[10px]"},[_.createVNode(m,{to:r.link+"?name="+((x==null?void 0:x.name)||(x==null?void 0:x.id)),class:_.normalizeClass(["py-2 px-5 group pr-[10px] flex items-center gap-x-3 w-full flex justify-between hover:bg-gray-100 rounded-lg duration-300",{"bg-gray-100":((E=(S=t.$route)==null?void 0:S.query)==null?void 0:E.name)===(x==null?void 0:x.name)}])},{default:_.withCtx(()=>[_.createElementVNode("span",Y$,_.toDisplayString((x==null?void 0:x.name)||(x==null?void 0:x.id)),1),_.createElementVNode("span",X$,_.toDisplayString((x==null?void 0:x.children)||0),1)]),_:2},1032,["to","class"])])}),128))])])}const J$=Ge(q$,[["render",K$]]),Q$={props:{title:{type:String,default:()=>"Дані для відображення відсутні"},text:{type:String,default:()=>"Змініть параметри пошуку або спробуйте пізніше"}}},e8={class:"w-full"},t8={class:"p-5 min-h-[500px] flex flex-col justify-center items-center text-center"},n8={class:"max-w-sm mx-auto mt-6"},i8={class:"font-medium text-gray-800 dark:text-neutral-200"},r8={class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"};function s8(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("div",e8,[_.createElementVNode("div",t8,[e[0]||(e[0]=_.createStaticVNode('<svg class="w-48 mx-auto" viewBox="0 0 178 90" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs></svg>',1)),_.createElementVNode("div",n8,[_.createElementVNode("p",i8,_.toDisplayString(n.title),1),_.createElementVNode("p",r8,_.toDisplayString(n.text),1)])])])}const xS=Ge(Q$,[["render",s8]]),o8={props:{modelValue:{type:String,default:()=>"#172B4D"},colors:{type:Array,default:()=>["#172B4D","#0055CC","#206A83","#216E4E","#E56910","#AE2E24","#5E4DB2","#758195","#FF0000","#008000","#28A9AB","#AB7222"]}},methods:{updateColor(t){this.$emit("update:modelValue",t),this.$refs.popover.togglePopover()}}},a8={class:"flex w-[160px] flex-wrap gap-[4px]"},l8=["onClick"];function c8(t,e,n,i,r,a){const u=_.resolveComponent("VsPopover");return _.openBlock(),_.createBlock(u,{ref:"popover",placement:"bottom"},{reference:_.withCtx(()=>[_.createElementVNode("button",{class:"h-[37px] w-[37px] rounded-lg flex items-center justify-center",style:_.normalizeStyle({backgroundColor:n.modelValue})},null,4)]),default:_.withCtx(()=>[_.createElementVNode("div",null,[_.createElementVNode("ul",a8,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(n.colors,l=>(_.openBlock(),_.createElementBlock("li",{class:"h-[37px] w-[37px] rounded",style:_.normalizeStyle({backgroundColor:l}),onClick:m=>a.updateColor(l),key:l},null,12,l8))),128))])])]),_:1},512)}const bS=Ge(o8,[["render",c8]]),u8={components:{VsChoceColor:bS},props:{item:Object},data(){var t,e,n;return{color:((t=this.item)==null?void 0:t.color)||"#D1D5DB",text:((e=this.item)==null?void 0:e.text)||"",id:(n=this.item)==null?void 0:n.id}},watch:{color(t){this.$emit("update-item",{...this.item,color:t})},text(t){this.$emit("update-item",{...this.item,text:t})},id(t){this.$emit("update-item",{...this.item},t)}}},h8={class:"relative flex items-center p-3 bg-white border border-gray-200 group gap-x-3 rounded-xl"},d8={class:"flex flex-col"},p8={class:"flex gap-[30px]"},f8={class:"block text-sm font-semibold text-gray-800 text-start z-[10] cursor-pointer"},m8={class:"block text-sm font-semibold text-gray-400 text-start z-[10] cursor-pointer"},g8={class:"block text-xs text-gray-500 truncate dark:text-neutral-500"};function y8(t,e,n,i,r,a){var m;const u=_.resolveComponent("VsChoceColor"),l=_.resolveComponent("VsInlineEdit");return _.openBlock(),_.createElementBlock("div",h8,[_.createVNode(u,{modelValue:r.color,"onUpdate:modelValue":e[0]||(e[0]=x=>r.color=x)},null,8,["modelValue"]),_.createElementVNode("div",d8,[_.createElementVNode("div",p8,[_.createVNode(l,{modelValue:r.text,"onUpdate:modelValue":e[1]||(e[1]=x=>r.text=x),onUpdateValue:e[2]||(e[2]=x=>r.text=x)},{default:_.withCtx(()=>[_.createElementVNode("p",f8,_.toDisplayString(r.text),1)]),_:1},8,["modelValue"]),_.createVNode(l,{modelValue:r.id,"onUpdate:modelValue":e[3]||(e[3]=x=>r.id=x),onUpdateValue:e[4]||(e[4]=x=>r.id=x)},{default:_.withCtx(()=>[_.createElementVNode("p",m8,_.toDisplayString(r.id),1)]),_:1},8,["modelValue"])]),_.createElementVNode("p",g8,_.toDisplayString((m=n.item)==null?void 0:m.parent),1)])])}const _8={components:{VsReesterUsersItem:Ge(u8,[["render",y8]])},props:{list:Array},data(){return{draggedItemIndex:null}},methods:{dragStart(t,e){this.draggedItemIndex=e,t.dataTransfer.effectAllowed="move"},dragOver(t){t.preventDefault()},drop(t,e){t.preventDefault();const n=this.draggedItemIndex;if(n!==e){const i=[...this.list],r=i[n];i.splice(n,1),i.splice(e,0,r),this.$emit("update-list",i)}this.draggedItemIndex=null},dragEnd(){this.draggedItemIndex=null},updateItem(t,e){var i;const n=(i=this.list)==null?void 0:i.findIndex(r=>(r==null?void 0:r.id)===(t==null?void 0:t.id));this.list[n]=t,e&&(this.list[n].id=e),this.$emit("update-list",this.list)}}},x8={class:"flex flex w-full flex-col gap-[10px] p-[10px] pt-[40px] overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300",style:{width:"calc(100vw - 1000px)","max-height":"calc(100vh - 430px)"}},b8=["onDragstart","onDrop"];function v8(t,e,n,i,r,a){const u=_.resolveComponent("VsReesterUsersItem");return _.openBlock(),_.createElementBlock("ul",x8,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(n.list,(l,m)=>(_.openBlock(),_.createElementBlock("li",{key:l==null?void 0:l.id,draggable:!0,onDragstart:x=>a.dragStart(x,m),onDragover:e[0]||(e[0]=x=>a.dragOver(x)),onDrop:x=>a.drop(x,m),onDragend:e[1]||(e[1]=(...x)=>a.dragEnd&&a.dragEnd(...x))},[_.createVNode(u,{item:l,onUpdateItem:a.updateItem},null,8,["item","onUpdateItem"])],40,b8))),128))])}const w8={components:{VsNoData:xS,VsChoceColor:bS,IconCheck:Nb,VsReesterUsersList:Ge(_8,[["render",v8],["__scopeId","data-v-293d7735"]])},data(){return{scheme:{text:{type:"Text",ua:"Ім'я",validators:["required"]}},formVisible:!0,formValues:{},color:"#172B4D",data:null}},watch:{$route:{handler(t,e){var n,i;((n=t==null?void 0:t.query)==null?void 0:n.name)!==((i=e==null?void 0:e.query)==null?void 0:i.name)&&this.getData()}}},mounted(){this.getData()},methods:{async getData(){var t;this.data=null;try{const{data:e}=await vt.get(`/api/user-cls/${(t=this.$route.query)==null?void 0:t.name}`);this.data=e}catch{}},async addOneChild(){var t,e,n,i;try{const{form:r}=this.$refs;await r.doValidation(),await vt.post("/api/user-cls",{name:(t=this.$route.query)==null?void 0:t.name,children:[...((e=this.data)==null?void 0:e.children)||[],{...this.formValues,color:this.color,id:(((i=(n=this.data)==null?void 0:n.children)==null?void 0:i.length)||0)+1}]}),this.formVisible=!1,this.formValues={},setTimeout(()=>this.formVisible=!0),await this.getData()}catch(r){console.log(r)}},async updateChildren(t){var e,n;this.data.children=t;try{await vt.post("/api/user-cls",{name:(e=this.$route.query)==null?void 0:e.name,children:[...((n=this.data)==null?void 0:n.children)||[]]}),await this.getData()}catch(i){console.log(i)}}}},k8={class:"flex justify-center bg-gray-50",style:{height:"calc(100vh - 60px)",width:"calc(100vw - 560px)"}},S8={key:0,class:"mt-[100px] p-[10px]",style:{"max-height":"calc(100vh - 300px)",width:"calc(100vw - 1000px)"}},E8={class:"flex items-end w-full gap-[4px]"};function C8(t,e,n,i,r,a){var E,T,I,z,F;const u=_.resolveComponent("VsForm"),l=_.resolveComponent("VsChoceColor"),m=_.resolveComponent("IconCheck"),x=_.resolveComponent("VsReesterUsersList"),S=_.resolveComponent("VsNoData");return _.openBlock(),_.createElementBlock("div",k8,[(T=(E=t.$route)==null?void 0:E.query)!=null&&T.name?(_.openBlock(),_.createElementBlock("div",S8,[e[3]||(e[3]=_.createElementVNode("h2",{class:"font-bold mb-[10px]"},"Створити",-1)),_.createElementVNode("div",E8,[r.formVisible?(_.openBlock(),_.createBlock(u,{key:0,ref:"form",scheme:r.scheme,modelValue:r.formValues,"onUpdate:modelValue":e[0]||(e[0]=j=>r.formValues=j),class:"p-0 m-0 h-[65px] w-full"},null,8,["scheme","modelValue"])):_.createCommentVNode("",!0),_.createVNode(l,{modelValue:r.color,"onUpdate:modelValue":e[1]||(e[1]=j=>r.color=j)},null,8,["modelValue"]),_.createElementVNode("button",{onClick:e[2]||(e[2]=(...j)=>a.addOneChild&&a.addOneChild(...j)),class:"h-[37px] w-[37px] rounded-lg bg-blue-600 ml-[6px] flex items-center justify-center text-white hover:bg-blue-700 duration-300"},[_.createVNode(m,{height:"20",width:"20"})])]),(z=(I=r.data)==null?void 0:I.children)!=null&&z.length?(_.openBlock(),_.createBlock(x,{key:0,list:(F=r.data)==null?void 0:F.children,onUpdateList:a.updateChildren},null,8,["list","onUpdateList"])):_.createCommentVNode("",!0)])):(_.openBlock(),_.createBlock(S,{key:1,class:"mt-[100px]",text:"Оберіть один з пунктів меню для відображення"}))])}const T8={components:{VsReesterNavList:J$,VsReesterContent:Ge(w8,[["render",C8]])}},M8={class:"flex items-start gap-0"};function A8(t,e,n,i,r,a){const u=_.resolveComponent("VsReesterNavList"),l=_.resolveComponent("VsReesterContent");return _.openBlock(),_.createElementBlock("div",M8,[_.createVNode(u),_.createVNode(l)])}const vS={...L$,...V$,"vs-dashboard":$$,...{"user-cls-page":Ge(T8,[["render",A8]])}},wS=t=>{const e=[];return t.forEach(n=>{n.menu?e.push(...wS(n.menu)):e.push(n)}),e},Xr=_.ref(null),I8=async()=>{try{const{data:t}=await vt.get("/api/user-menu");return Xr.value=t,wS(t)}catch(t){return console.error(t),[]}},P8=(t,e)=>{Object.entries(e).forEach(([n,i])=>{t.component(n,i)})},D8={async install(t,{componentsApp:e={}}){try{const i=(await I8()).filter(a=>a==null?void 0:a.component).map(a=>({...a,component:{...vS,...e}[a==null?void 0:a.component]}));P8(t,{...vS,...e}),t.component("admin",RT);const{router:r}=await gA(i);t.config.globalProperties={...t.config.globalProperties,$componentsConfig:{...ez,componentsApp:e},$router:r},t.use(r)}catch(n){console.error(n)}}},O8={data(){return{formValues:{},scheme:null,table:""}},mounted(){this.getFormScheme()},methods:{flattenMenu(t){const e=[];return t.forEach(n=>{n.menu?e.push(...this.flattenMenu(n.menu)):e.push(n)}),e},async getFormScheme(){var i,r;const t=this.flattenMenu(Xr.value);t!=null&&t.length||this.$router.replace("/404");const e=t==null?void 0:t.find(a=>{var u,l;return(a==null?void 0:a.path)==((l=(u=this.$route)==null?void 0:u.query)==null?void 0:l.table)});e||this.$router.replace("/404");const n=e==null?void 0:e.table;this.table=n;try{const{data:{form:a}}=await vt.get(`/api/template/table/${n}`),{data:{rows:u}}=await vt.get(`/api/table-data/${this.table}/${(r=(i=this.$route)==null?void 0:i.query)==null?void 0:r.id}`);this.formValues=u==null?void 0:u[0];const{data:l}=await vt.get(`/api/template/form/${a}`);this.scheme=(l==null?void 0:l.schema)||l}catch{}},async editObject(){var t,e;try{await this.$refs.form.doValidation(),await vt.put(`/api/table/${this.table}/${(e=(t=this.$route)==null?void 0:t.query)==null?void 0:e.id}`,this.formValues),await this.$router.back(),await this.$notify({title:"Успішно!",message:"Об'єкт успішно створено",type:"success"})}catch{this.$notify({title:"Помилка!",message:"Сталася помилка",type:"error"})}}}},z8={style:{width:"calc(100vw - 260px)"}},N8={class:"h-[76px] bg-gray-50 flex items-center justify-between px-[30px]"},R8={class:"flex items-center gap-[6px]"},B8={style:{height:"calc(100vh - 140px)",width:"calc(100vw - 260px)"},class:"bg-gray-50 p-[20px] flex"},L8={class:"bg-white w-full rounded-xl border p-[20px] overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"};function V8(t,e,n,i,r,a){const u=_.resolveComponent("VsForm");return _.openBlock(),_.createElementBlock("div",z8,[_.createElementVNode("div",N8,[e[3]||(e[3]=_.createElementVNode("h2",{class:"text-xl font-medium"},"Редагувати",-1)),_.createElementVNode("div",R8,[_.createElementVNode("button",{onClick:e[0]||(e[0]=l=>t.$router.back()),class:"py-2 px-3 flex items-center gap-x-2 text-sm font-medium rounded-lg border bg-white border-gray-100 text-gray-800 shadow focus:outline-none hover:bg-gray-50 hover:border-gray-100 duration-300"}," Скасувати "),_.createElementVNode("button",{onClick:e[1]||(e[1]=(...l)=>a.editObject&&a.editObject(...l)),class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent bg-blue-600 text-white hover:bg-blue-700 hover:text-white duration-300"}," Зберегти ")])]),_.createElementVNode("div",B8,[_.createElementVNode("div",L8,[r.scheme?(_.openBlock(),_.createBlock(u,{key:0,ref:"form",scheme:r.scheme,modelValue:r.formValues,"onUpdate:modelValue":e[2]||(e[2]=l=>r.formValues=l),class:"p-0 mt-[20px]"},null,8,["scheme","modelValue"])):_.createCommentVNode("",!0)])])])}const F8=Object.freeze(Object.defineProperty({__proto__:null,default:Ge(O8,[["render",V8]])},Symbol.toStringTag,{value:"Module"})),$8={data(){return{formValues:{},scheme:null,table:""}},mounted(){this.getFormScheme()},methods:{flattenMenu(t){const e=[];return t.forEach(n=>{n.menu?e.push(...this.flattenMenu(n.menu)):e.push(n)}),e},async getFormScheme(){const t=this.flattenMenu(Xr.value);t!=null&&t.length||this.$router.replace("/404");const e=t==null?void 0:t.find(i=>{var r,a;return(i==null?void 0:i.path)==((a=(r=this.$route)==null?void 0:r.query)==null?void 0:a.table)});e||this.$router.replace("/404");const n=e==null?void 0:e.table;this.table=n;try{const{data:{form:i}}=await vt.get(`/api/template/table/${n}`),{data:r}=await vt.get(`/api/template/form/${i}`);this.scheme=(r==null?void 0:r.schema)||r}catch{}},async createObject(){try{await this.$refs.form.doValidation(),await vt.post(`/api/table/${this.table}`,this.formValues),await this.$router.back(),await this.$notify({title:"Успішно!",message:"Об'єкт успішно створено",type:"success"})}catch{this.$notify({title:"Помилка!",message:"Сталася помилка",type:"error"})}}}},j8={style:{width:"calc(100vw - 260px)"}},U8={class:"h-[76px] bg-gray-50 flex items-center justify-between px-[30px]"},H8={class:"flex items-center gap-[6px]"},q8={style:{height:"calc(100vh - 150px)",width:"calc(100vw - 260px)"},class:"bg-gray-50 p-[20px] flex"},W8={class:"bg-white w-full rounded-xl border p-[20px] overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"};function G8(t,e,n,i,r,a){const u=_.resolveComponent("VsForm");return _.openBlock(),_.createElementBlock("div",j8,[_.createElementVNode("div",U8,[e[3]||(e[3]=_.createElementVNode("h2",{class:"text-xl font-medium"},"Створити",-1)),_.createElementVNode("div",H8,[_.createElementVNode("button",{onClick:e[0]||(e[0]=l=>t.$router.back()),class:"py-2 px-3 flex items-center gap-x-2 text-sm font-medium rounded-lg border bg-white border-gray-100 text-gray-800 shadow focus:outline-none hover:bg-gray-50 hover:border-gray-100 duration-300"}," Скасувати "),_.createElementVNode("button",{onClick:e[1]||(e[1]=(...l)=>a.createObject&&a.createObject(...l)),class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent bg-blue-600 text-white hover:bg-blue-700 hover:text-white duration-300"}," Зберегти ")])]),_.createElementVNode("div",q8,[_.createElementVNode("div",W8,[r.scheme?(_.openBlock(),_.createBlock(u,{key:0,ref:"form",scheme:r.scheme,modelValue:r.formValues,"onUpdate:modelValue":e[2]||(e[2]=l=>r.formValues=l),class:"p-0 mt-[20px]"},null,8,["scheme","modelValue"])):_.createCommentVNode("",!0)])])])}const Z8=Object.freeze(Object.defineProperty({__proto__:null,default:Ge($8,[["render",G8]])},Symbol.toStringTag,{value:"Module"})),Y8={};function X8(t,e,n,i,r,a){const u=_.resolveComponent("router-view");return _.openBlock(),_.createBlock(u)}const kS=Object.freeze(Object.defineProperty({__proto__:null,default:Ge(Y8,[["render",X8]])},Symbol.toStringTag,{value:"Module"})),K8={data(){return{objectData:null,component:""}},computed:{getRoute(){const t=this.flattenMenu(Xr.value);t!=null&&t.length||this.$router.replace("/404");const e=t==null?void 0:t.find(n=>{var i,r;return(n==null?void 0:n.table)==((r=(i=this.$route)==null?void 0:i.params)==null?void 0:r.table)});return e||this.$router.replace("/404"),e==null?void 0:e.path},getTitle(){var t,e,n,i,r,a,u,l,m,x,S,E,T,I,z;if((n=(e=(t=this.objectData)==null?void 0:t.rows)==null?void 0:e[0])!=null&&n.name)return((u=(a=(r=(i=this.objectData)==null?void 0:i.rows)==null?void 0:r[0])==null?void 0:a.name)==null?void 0:u.length)<35?(x=(m=(l=this.objectData)==null?void 0:l.rows)==null?void 0:m[0])==null?void 0:x.name:((I=(T=(E=(S=this.objectData)==null?void 0:S.rows)==null?void 0:E[0])==null?void 0:T.name)==null?void 0:I.slice(0,35))+" ...";{const F=(z=this.flattenMenu(Xr.value))==null?void 0:z.find(j=>{var G,ie;return(j==null?void 0:j.table)===((ie=(G=this.$route)==null?void 0:G.params)==null?void 0:ie.table)});return F==null?void 0:F.ua}}},async mounted(){await this.getObjectData(),await this.checkActiveComponent()},watch:{component(t){this.$router.replace({...this.$route,query:{tab:t}})}},methods:{async getObjectData(){var n;const{table:t,id:e}=(n=this.$route)==null?void 0:n.params;(!t||!e)&&this.$router.replace("/404");try{const{data:i}=await vt.get(`/api/table-data/${t}/${e}`);this.objectData=i}catch(i){console.error(i)}},getColClass(t){return`col-span-${t||12}`},getGridClass(){return"grid-cols-12"},checkActiveComponent(){var t,e,n,i,r,a,u,l,m;if((e=(t=this.$route)==null?void 0:t.query)!=null&&e.tab)this.component=(i=(n=this.$route)==null?void 0:n.query)==null?void 0:i.tab;else{const x=(a=(r=this.objectData)==null?void 0:r.panels)==null?void 0:a.find(S=>(S==null?void 0:S.type)==="tabs");(u=x==null?void 0:x.items)!=null&&u.length&&(this.component=((l=x.items[0])==null?void 0:l.component)||((m=x.items[0])==null?void 0:m.name))}},flattenMenu(t){const e=[];return t.forEach(n=>{n.menu?e.push(...this.flattenMenu(n.menu)):e.push(n)}),e}}},J8={style:{width:"calc(100vw - 260px)",height:"calc(100vh - 60px)"},class:"p-4 overflow-y-auto bg-gray-50"},Q8={class:"h-[76px] bg-gray-50 flex items-center justify-between pl-[15px]"},ej={class:""},tj={class:"text-lg font-semibold md:text-xl text-stone-800 dark:text-neutral-200"},nj={class:"flex items-center gap-[6px]"},ij={key:0,class:"bg-white border rounded-xl"},rj={class:"p-[10px] pl-[20px] text-xl"},sj=["innerHTML"],oj={key:1},aj={class:"p-[10px] pl-[20px] text-xl"},lj={key:0,class:"p-[20px] border-t"},cj={key:1,class:"p-[20px] border-t"},uj=["innerHTML"],hj={class:"flex space-x-1 w-full bg-white border border-b-0 rounded-tr-xl rounded-tl-xl h-[60px] items-center pl-[20px]"},dj=["onClick"],pj={key:0,class:"bg-white border border-t-0 rounded-bl-xl rounded-br-xl"},fj={key:0,class:"p-[20px] border-t"},mj={key:1,class:"p-[20px] border-t"},gj=["innerHTML"];function yj(t,e,n,i,r,a){var l,m,x;const u=_.resolveComponent("router-link");return _.openBlock(),_.createElementBlock("div",J8,[_.createElementVNode("div",Q8,[_.createElementVNode("div",ej,[_.createElementVNode("button",{onClick:e[0]||(e[0]=S=>t.$router.back()),class:"text-sm h-[20px] text-blue-600 font-medium hover:border-b hover:border-b-2 hover:border-b-blue-500"}," До таблиці "),_.createElementVNode("h2",tj,_.toDisplayString(a.getTitle),1)]),_.createElementVNode("div",nj,[_.createVNode(u,{to:`/edit?table=${a.getRoute}&id=${(m=(l=t.$route)==null?void 0:l.params)==null?void 0:m.id}`,class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white"},{default:_.withCtx(()=>e[1]||(e[1]=[_.createTextVNode(" Редагувати ")])),_:1},8,["to"])])]),_.createElementVNode("div",{class:_.normalizeClass(["grid gap-[20px]",a.getGridClass()])},[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList((x=r.objectData)==null?void 0:x.panels,(S,E)=>{var T;return _.openBlock(),_.createElementBlock("div",{key:E,class:_.normalizeClass(a.getColClass(S.col))},[S!=null&&S.name?(_.openBlock(),_.createElementBlock("div",ij,[_.createElementVNode("h2",rj,_.toDisplayString((S==null?void 0:S.title)||"Панель"),1),_.createElementVNode("div",{class:"p-[20px] border-t",innerHTML:(T=r.objectData)==null?void 0:T.data[S==null?void 0:S.name]},null,8,sj)])):S.type==="container"?(_.openBlock(),_.createElementBlock("div",oj,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(S.items,(I,z)=>{var F,j,G,ie,ae;return _.openBlock(),_.createElementBlock("div",{key:z,class:"border rounded-xl bg-white mb-[20px]"},[_.createElementVNode("h2",aj,_.toDisplayString((I==null?void 0:I.title)||"Панель"),1),I!=null&&I.component?(_.openBlock(),_.createElementBlock("div",lj,[(_.openBlock(),_.createBlock(_.resolveDynamicComponent(I.component),{geometry:(j=(F=r.objectData)==null?void 0:F.rows[0])==null?void 0:j.geom,zoom:16,id:(ie=(G=t.$route)==null?void 0:G.params)==null?void 0:ie.id},null,8,["geometry","id"]))])):_.createCommentVNode("",!0),I!=null&&I.name?(_.openBlock(),_.createElementBlock("div",cj,[_.createElementVNode("div",{innerHTML:(ae=r.objectData)==null?void 0:ae.data[I==null?void 0:I.name]},null,8,uj)])):_.createCommentVNode("",!0)])}),128))])):_.createCommentVNode("",!0),(S==null?void 0:S.type)==="tabs"?(_.openBlock(),_.createElementBlock(_.Fragment,{key:2},[_.createElementVNode("nav",hj,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(S==null?void 0:S.items,I=>(_.openBlock(),_.createElementBlock("button",{key:(I==null?void 0:I.name)||(I==null?void 0:I.component),onClick:z=>r.component=(I==null?void 0:I.component)||(I==null?void 0:I.name),class:_.normalizeClass(["px-2.5 h-[30px] py-1.5 relative inline-flex items-center gap-x-2 text-gray-500 hover:bg-gray-100 focus:bg-gray-100 hover:text-gray-800 text-sm whitespace-nowrap rounded-lg focus:outline-none",{" font-semibold after:absolute after:bottom-[-14px] after:left-2.5 after:right-2.5 after:z-10 after:h-0.5 after:bg-gray-800":r.component===(I==null?void 0:I.component)||r.component===(I==null?void 0:I.name),"":r.component!==(I==null?void 0:I.component)&&r.component!==(I==null?void 0:I.name)}])},_.toDisplayString(I==null?void 0:I.title),11,dj))),128))]),(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(S.items,(I,z)=>{var F,j,G,ie,ae;return _.openBlock(),_.createElementBlock(_.Fragment,{key:z},[r.component===(I==null?void 0:I.component)||r.component===(I==null?void 0:I.name)?(_.openBlock(),_.createElementBlock("div",pj,[I!=null&&I.component?(_.openBlock(),_.createElementBlock("div",fj,[(_.openBlock(),_.createBlock(_.resolveDynamicComponent(I.component),{geometry:(j=(F=r.objectData)==null?void 0:F.rows[0])==null?void 0:j.geom,zoom:16,id:(ie=(G=t.$route)==null?void 0:G.params)==null?void 0:ie.id},null,8,["geometry","id"]))])):_.createCommentVNode("",!0),I!=null&&I.name?(_.openBlock(),_.createElementBlock("div",mj,[_.createElementVNode("div",{innerHTML:(ae=r.objectData)==null?void 0:ae.data[I==null?void 0:I.name]},null,8,gj)])):_.createCommentVNode("",!0)])):_.createCommentVNode("",!0)],64)}),128))],64)):_.createCommentVNode("",!0)],2)}),128))],2)])}const _j=Object.freeze(Object.defineProperty({__proto__:null,default:Ge(K8,[["render",yj],["__scopeId","data-v-e9d5b2dd"]])},Symbol.toStringTag,{value:"Module"})),xj={},bj={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-logout"};function vj(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("svg",bj,e[0]||(e[0]=[_.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),_.createElementVNode("path",{d:"M14 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2"},null,-1),_.createElementVNode("path",{d:"M9 12h12l-3 -3"},null,-1),_.createElementVNode("path",{d:"M18 15l3 -3"},null,-1)]))}const wj=Ge(xj,[["render",vj]]),kj={},Sj={viewBox:"0 0 1823 249",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Ej(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("svg",Sj,e[0]||(e[0]=[_.createStaticVNode('<path d="M218.88 96.05C223.55 99.19 228.69 101.56 234.09 103.07V145.42C212.05 151.54 195.83 171.79 195.83 195.75C195.83 200.22 196.41 204.65 197.53 208.94L160.92 230.08C156.82 226.06 152.08 222.73 146.91 220.24V171.62C164.83 163.13 176.59 145.06 176.59 124.48C176.59 123.17 176.54 121.86 176.44 120.56L218.88 96.05ZM220.32 79.09L160.97 113.36C162.04 116.88 162.61 120.61 162.61 124.48C162.61 142.66 149.93 157.87 132.93 161.76V230.05C143.4 232.46 152.23 239.16 157.46 248.21L215 214.99C211.7 209.34 209.81 202.77 209.81 195.75C209.81 174.62 226.94 157.49 248.07 157.49V91.02C237.14 91.02 227.29 86.43 220.32 79.09Z" fill="#CE3936"></path><path d="M161.39 19.13L197.44 39.94C196.39 44.11 195.84 48.42 195.84 52.75C195.84 54.21 195.9 55.65 196.02 57.1L153.9 81.42C145.27 75.5 134.95 72.24 124.36 72.24C113.83 72.24 103.57 75.47 94.96 81.32L52.71 56.93C52.82 55.55 52.88 54.16 52.88 52.76C52.88 48.43 52.34 44.12 51.28 39.95L87.3 19.16C96.98 28.89 110.26 34.58 124.34 34.58C138.42 34.57 151.7 28.87 161.39 19.13ZM157.77 0.919983C151.24 12.66 138.71 20.6 124.33 20.6C109.95 20.6 97.44 12.67 90.9 0.939983L33.9 33.85C37.08 39.43 38.91 45.88 38.91 52.76C38.91 56.71 38.31 60.52 37.2 64.11L96.46 98.32C103.44 90.87 113.36 86.22 124.37 86.22C135.44 86.22 145.41 90.93 152.39 98.44L211.59 64.27C210.45 60.64 209.83 56.78 209.83 52.77C209.83 45.89 211.65 39.44 214.84 33.86L157.77 0.919983Z" fill="#CE3936"></path><path d="M29.97 95.95L72.28 120.38C72.17 121.74 72.12 123.1 72.12 124.47C72.12 145.02 83.86 163.08 101.74 171.58V220.23C96.58 222.71 91.84 226.04 87.75 230.05L51.17 208.93C52.29 204.64 52.87 200.21 52.87 195.74C52.87 171.78 36.65 151.53 14.61 145.41V103.06C20.07 101.55 25.27 99.14 29.97 95.95ZM28.5 78.97C21.52 86.38 11.63 91.02 0.640015 91.02V157.49C21.77 157.49 38.9 174.62 38.9 195.75C38.9 202.77 37 209.33 33.71 214.99L91.2 248.18C96.43 239.14 105.25 232.45 115.71 230.04V161.73C98.74 157.81 86.09 142.62 86.09 124.46C86.09 120.54 86.68 116.75 87.78 113.18L28.5 78.97Z" fill="#CE3936"></path><path d="M498.39 177.5V144.88C498.39 128.55 485.11 115.27 468.78 115.27H343.22C342.69 115.27 342.18 115.32 341.67 115.4H337.19C332.35 115.4 328.42 111.46 328.42 106.63V74C328.42 69.16 332.36 65.23 337.19 65.23H486.33C492.08 65.23 496.75 60.57 496.75 54.81C496.75 49.06 492.08 44.39 486.33 44.39H337.19C320.86 44.39 307.58 57.67 307.58 74V106.62C307.58 122.95 320.86 136.23 337.19 136.23H462.75C463.28 136.23 463.79 136.18 464.3 136.1H468.78C473.62 136.1 477.55 140.04 477.55 144.87V177.49C477.55 182.33 473.61 186.26 468.78 186.26H319.64C313.89 186.26 309.22 190.92 309.22 196.68C309.22 202.43 313.89 207.1 319.64 207.1H468.78C485.11 207.11 498.39 193.83 498.39 177.5Z" fill="#CE3935"></path><path d="M710.7 177.32V75.24C710.7 58.91 697.42 45.63 681.09 45.63H550.05C533.72 45.63 520.44 58.91 520.44 75.24V177.32C520.44 193.65 533.72 206.93 550.05 206.93H681.1C697.42 206.93 710.7 193.65 710.7 177.32ZM541.27 75.24C541.27 70.4 545.21 66.47 550.04 66.47H681.09C685.93 66.47 689.86 70.41 689.86 75.24V177.32C689.86 182.16 685.92 186.09 681.09 186.09H550.05C545.21 186.09 541.28 182.15 541.28 177.32V75.24H541.27Z" fill="#CE3935"></path><path d="M1823 177.32V75.24C1823 58.91 1809.72 45.63 1793.39 45.63H1662.34C1646.01 45.63 1632.73 58.91 1632.73 75.24V177.32C1632.73 193.65 1646.01 206.93 1662.34 206.93H1793.39C1809.72 206.93 1823 193.65 1823 177.32ZM1653.57 75.24C1653.57 70.4 1657.51 66.47 1662.34 66.47H1793.39C1798.23 66.47 1802.16 70.41 1802.16 75.24V177.32C1802.16 182.16 1798.22 186.09 1793.39 186.09H1662.34C1657.5 186.09 1653.57 182.15 1653.57 177.32V75.24Z" fill="#CE3935"></path><path d="M756.76 196.51V152H849.42C855.17 152 859.84 147.34 859.84 141.58C859.84 135.83 855.17 131.16 849.42 131.16H756.76V75.23C756.76 70.39 760.7 66.46 765.53 66.46H893.29C899.04 66.46 903.71 61.8 903.71 56.04C903.71 50.29 899.04 45.62 893.29 45.62H765.53C749.2 45.62 735.92 58.9 735.92 75.23V196.5C735.92 202.25 740.59 206.92 746.34 206.92C752.09 206.93 756.76 202.27 756.76 196.51Z" fill="#CE3935"></path><path d="M933.86 66.47H1006.51V194.32C1006.51 200.07 1011.18 204.74 1016.93 204.74C1022.68 204.74 1027.35 200.07 1027.35 194.32V66.47H1100C1105.75 66.47 1110.42 61.81 1110.42 56.05C1110.42 50.3 1105.76 45.63 1100 45.63H933.86C928.11 45.63 923.44 50.29 923.44 56.05C923.45 61.81 928.11 66.47 933.86 66.47Z" fill="#CE3935"></path><path d="M1218.44 204.19C1224.19 204.19 1228.86 199.53 1228.86 193.77V152H1368.13C1384.46 152 1397.74 138.72 1397.74 122.39V75.24C1397.74 58.91 1384.46 45.63 1368.13 45.63H1237.63C1221.3 45.63 1208.02 58.91 1208.02 75.24V193.77C1208.02 199.53 1212.68 204.19 1218.44 204.19ZM1237.63 66.47H1368.13C1372.97 66.47 1376.9 70.41 1376.9 75.24V122.39C1376.9 127.23 1372.96 131.16 1368.13 131.16H1228.86V75.23C1228.86 70.41 1232.79 66.47 1237.63 66.47Z" fill="#CE3935"></path><path d="M1430.64 204.19C1436.39 204.19 1441.06 199.53 1441.06 193.77V152H1523.95C1524.57 153.18 1525.42 154.26 1526.51 155.17L1581.89 201.23C1583.83 202.85 1586.2 203.64 1588.55 203.64C1591.54 203.64 1594.5 202.36 1596.57 199.88C1600.25 195.46 1599.64 188.89 1595.22 185.21L1555.29 152H1580.33C1596.66 152 1609.94 138.72 1609.94 122.39V75.24C1609.94 58.91 1596.66 45.63 1580.33 45.63H1449.83C1433.5 45.63 1420.22 58.91 1420.22 75.24V193.77C1420.22 199.53 1424.88 204.19 1430.64 204.19ZM1449.83 66.47H1580.33C1585.17 66.47 1589.1 70.41 1589.1 75.24V122.39C1589.1 127.23 1585.17 131.16 1580.33 131.16H1441.06V75.23C1441.05 70.41 1444.99 66.47 1449.83 66.47Z" fill="#CE3935"></path>',10)]))}const Cj=Ge(kj,[["render",Ej]]),Tj={},Mj={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-chevron-down"};function Aj(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("svg",Mj,e[0]||(e[0]=[_.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),_.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)]))}const Ij={components:{IconChevronDown:Ge(Tj,[["render",Aj]])},props:{route:Object},mounted(){var t,e,n;(t=this.route)!=null&&t.menu&&(n=(e=this.route)==null?void 0:e.menu)!=null&&n.some(i=>{var r,a;return(i==null?void 0:i.path)===this.$route.path.replace("/","")||((a=(r=this.$route)==null?void 0:r.params)==null?void 0:a.table)===(i==null?void 0:i.table)&&(i==null?void 0:i.table)})&&(this.isOpen=!0)},data(){return{isOpen:!1}}},Pj={key:0,class:""},Dj={class:"ml-[30px] py-[6px] before:block before:absolute relative w-[196px] flex flex-col gap-[6px] inline-block before:w-[2px] before:h-[100%] before:bg-gray-100 before:left-[-14px] cursor-pointer"},Oj={key:1};function zj(t,e,n,i,r,a){var m,x,S,E,T,I,z,F,j,G,ie,ae,J;const u=_.resolveComponent("IconChevronDown"),l=_.resolveComponent("router-link");return(m=n.route)!=null&&m.menu?(_.openBlock(),_.createElementBlock("div",Pj,[_.createElementVNode("button",{onClick:e[0]||(e[0]=Ce=>r.isOpen=!r.isOpen),class:_.normalizeClass(["flex cursor-pointer gap-x-3 py-2 px-3 text-sm text-gray-800 justify-start w-full border-none focus:outline-none text-gray-800 rounded-lg items-center hover:bg-gray-100 duration-300",[((S=(x=n.route)==null?void 0:x.menu)==null?void 0:S.some(Ce=>{var be,Ae;return(Ce==null?void 0:Ce.path)===t.$route.path.replace("/","")||(Ce==null?void 0:Ce.table)===((Ae=(be=t.$route)==null?void 0:be.params)==null?void 0:Ae.table)&&(Ce==null?void 0:Ce.table)}))&&"bg-gray-100"]])},[_.createTextVNode(_.toDisplayString((E=n.route)==null?void 0:E.ua)+" ",1),_.createVNode(u,{class:_.normalizeClass([[r.isOpen&&"-rotate-180"],"ml-auto duration-300"]),width:"14",height:"14"},null,8,["class"])],2),_.createVNode(_.Transition,{name:"fade"},{default:_.withCtx(()=>{var Ce;return[_.withDirectives(_.createElementVNode("ul",Dj,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList((Ce=n.route)==null?void 0:Ce.menu,(be,Ae)=>{var Fe,Pe;return _.openBlock(),_.createElementBlock("li",{key:Ae,class:"w-full"},[_.createVNode(l,{to:"/"+(be==null?void 0:be.path),class:_.normalizeClass([[((be==null?void 0:be.path)===t.$route.path.replace("/","")||((Pe=(Fe=t.$route)==null?void 0:Fe.params)==null?void 0:Pe.table)===(be==null?void 0:be.table)&&(be==null?void 0:be.table))&&"bg-gray-100"],"flex gap-x-4 py-2 px-3 text-sm text-gray-800 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100"])},{default:_.withCtx(()=>[_.createTextVNode(_.toDisplayString(be==null?void 0:be.ua),1)]),_:2},1032,["to","class"])])}),128))],512),[[_.vShow,r.isOpen]])]}),_:1})])):(_.openBlock(),_.createElementBlock("div",Oj,[_.createVNode(l,{to:((I=(T=n.route)==null?void 0:T.path)==null?void 0:I[0])==="/"?(z=n.route)==null?void 0:z.path:"/"+((F=n.route)==null?void 0:F.path),class:_.normalizeClass([[(((j=n.route)==null?void 0:j.path.replace("/",""))===t.$route.path.replace("/","")||((ie=(G=t.$route)==null?void 0:G.params)==null?void 0:ie.table)===((ae=n.route)==null?void 0:ae.table)&&((J=n.route)==null?void 0:J.table))&&"bg-gray-100"],"flex gap-x-3 py-2 w-full font-[400] px-3 text-sm text-gray-800 rounded-lg items-center hover:bg-gray-100 duration-300 hover:text-gray-800"])},{default:_.withCtx(()=>{var Ce;return[_.createTextVNode(_.toDisplayString((Ce=n.route)==null?void 0:Ce.ua),1)]}),_:1},8,["to","class"])]))}const Nj={components:{IconLogout:wj,NavbarItem:Ge(Ij,[["render",zj]]),IconLogo:Cj,IconSearch:Z0},data(){return{activeIndex:null,data:null,searchValue:""}},computed:{data(){var t,e;return(t=this.searchValue)!=null&&t.trim()?(e=this.flattenMenu(Xr.value))==null?void 0:e.filter(n=>{var i,r,a;return(a=(i=n==null?void 0:n.ua)==null?void 0:i.toLowerCase())==null?void 0:a.includes((r=this.searchValue)==null?void 0:r.toLowerCase())}):Xr.value}},methods:{flattenMenu(t){const e=[];return t.forEach(n=>{n.menu?e.push(...this.flattenMenu(n.menu)):e.push(n)}),e}}},Rj={class:"flex flex-col h-[100vh] border-r w-[260px] shrink-0"},Bj={class:"relative"},Lj={class:"p-[16px] overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},Vj={class:"pb-3 w-full flex flex-col flex-wrap"},Fj={key:0,class:"flex flex-col gap-[6px]"},$j={key:1,class:"text-gray-800 text-lg mt-[20px]"};function jj(t,e,n,i,r,a){var S;const u=_.resolveComponent("IconLogo"),l=_.resolveComponent("IconSearch"),m=_.resolveComponent("VsText"),x=_.resolveComponent("NavbarItem");return _.openBlock(),_.createElementBlock("div",Rj,[_.createVNode(u,{height:"40",width:"200",class:"my-[20px] ml-[20px]"}),_.createElementVNode("div",Bj,[_.createVNode(l,{height:"16",width:"16",class:"absolute top-[12px] left-[30px] text-gray-500 z-[1]"}),_.createVNode(m,{type:"text",modelValue:r.searchValue,"onUpdate:modelValue":e[0]||(e[0]=E=>r.searchValue=E),clearable:!0,placeholder:"Пошук по меню",class:"[&>input]:h-[40px] [&>input]:block [&>input]:rounded-none [&>input]:border-x-0 [&>input]:pl-[60px] [&>input:focus]:outline-none [&>input:focus]:focus:ring-0 [&>input:focus]:border-y-gray-200 [&>input:focus]:border-y-1 [&>input:focus]:border-x-0"},null,8,["modelValue"])]),_.createElementVNode("div",Lj,[_.createElementVNode("nav",Vj,[(S=a.data)!=null&&S.length?(_.openBlock(),_.createElementBlock("ul",Fj,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(a.data,(E,T)=>(_.openBlock(),_.createElementBlock("li",{key:T,class:"flex flex-col gap-[6px]"},[_.createVNode(x,{route:E},null,8,["route"])]))),128))])):(_.openBlock(),_.createElementBlock("div",$j,"Не знайдено"))])])])}const Uj=Ge(Nj,[["render",jj]]),Hj={},qj={class:"flex-shrink-0 size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function Wj(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("svg",qj,e[0]||(e[0]=[_.createElementVNode("path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9"},null,-1),_.createElementVNode("path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0"},null,-1)]))}const Gj={components:{IconMessage:Ge(Hj,[["render",Wj]])},mounted(){this.getNotificationsCount},data(){return{count:0}},methods:{async getNotificationsCount(){try{const{data:t}=await axios.get("/api/user-info");this.count=t==null?void 0:t.notifications}catch{}}}},Zj={class:"hs-tooltip [--placement:bottom] inline-block show"},Yj={class:"hs-tooltip-toggle relative size-[38px] inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent text-gray-500 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100"},Xj={key:0,class:"flex absolute top-0 end-0 -mt-1.5 -me-1.5"},Kj={class:"relative min-w-[18px] min-h-[18px] inline-flex justify-center items-center text-[10px] bg-red-500 text-white rounded-full px-1"};function Jj(t,e,n,i,r,a){const u=_.resolveComponent("IconMessage");return _.openBlock(),_.createElementBlock("div",Zj,[_.createElementVNode("button",Yj,[_.createVNode(u,{height:"24",width:"24"}),r.count?(_.openBlock(),_.createElementBlock("span",Xj,[e[0]||(e[0]=_.createElementVNode("span",{class:"absolute inline-flex bg-red-400 rounded-full opacity-75 animate-ping size-full dark:bg-red-600"},null,-1)),_.createElementVNode("span",Kj,_.toDisplayString(r.count),1)])):_.createCommentVNode("",!0)]),e[1]||(e[1]=_.createElementVNode("span",{class:"hs-tooltip-content hs-tooltip-shown:opacity-100 hs-tooltip-shown:visible opacity-0 inline-block absolute invisible z-20 py-1.5 px-2.5 bg-gray-900 text-xs text-white rounded-lg dark:bg-neutral-700 hidden",role:"tooltip","data-popper-placement":"bottom",style:{position:"fixed",inset:"0px auto auto 0px",margin:"0px",transform:"translate(1686px, 53px)"}},null,-1))])}const Qj=Ge(Gj,[["render",Jj]]),e7={},t7={class:"flex-shrink-0 size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function n7(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("svg",t7,e[0]||(e[0]=[_.createElementVNode("circle",{cx:"12",cy:"12",r:"10"},null,-1),_.createElementVNode("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"},null,-1),_.createElementVNode("path",{d:"M12 17h.01"},null,-1)]))}const i7=Ge(e7,[["render",n7]]),r7={},s7={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",class:"icon icon-tabler icons-tabler-filled icon-tabler-user"};function o7(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("svg",s7,e[0]||(e[0]=[_.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),_.createElementVNode("path",{d:"M12 2a5 5 0 1 1 -5 5l.005 -.217a5 5 0 0 1 4.995 -4.783z"},null,-1),_.createElementVNode("path",{d:"M14 14a5 5 0 0 1 5 5v1a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-1a5 5 0 0 1 5 -5h4z"},null,-1)]))}const a7={components:{IconQuestion:i7,IconUser:Ge(r7,[["render",o7]]),AdminNotifucation:Qj},mounted(){this.getUserData()},data(){return{userData:null,isVisible:!1}},watch:{isVisible(t){t?setTimeout(()=>window.addEventListener("click",this.closeOnOutsideClick),0):window.removeEventListener("click",this.closeOnOutsideClick)}},methods:{async getUserData(){try{const{data:t}=await vt.get("/user");this.userData=t}catch{}},async logout(){try{await vt.get("/logout"),await window.history.pushState({},"","/login"),await location.reload(),localStorage.removeItem("user")}catch{}},closeOnOutsideClick(){this.isVisible=!1}},beforeUnmount(){window.removeEventListener("click",this.closeOnOutsideClick)}},l7={class:"h-[60px] border-b flex justify-end px-[20px]",style:{width:"calc(100vw - 260px)"}},c7={class:"flex items-center gap-[6px]"},u7={href:"docs-softpro.com",class:"size-[38px] inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent text-gray-500 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100 dark:text-neutral-400 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},h7={class:"relative"},d7=["src"],p7={key:1,class:"size-[40px] rounded-full bg-gray-200 flex items-center justify-center"},f7={class:"p-[10px] gap-[6px] items-center border-b flex justify-between"},m7=["src"],g7={key:1,class:"size-[40px] rounded-full bg-gray-200 flex items-center justify-center"},y7={class:"text-[14px] mr-[10px] text-gray-500"},_7={class:"flex flex-col p-[4px]"};function x7(t,e,n,i,r,a){var S,E,T,I,z,F,j,G,ie,ae;const u=_.resolveComponent("IconQuestion"),l=_.resolveComponent("AdminNotifucation"),m=_.resolveComponent("IconUser"),x=_.resolveComponent("router-link");return _.openBlock(),_.createElementBlock("div",l7,[_.createElementVNode("div",c7,[_.createElementVNode("a",u7,[_.createVNode(u,{height:"24",width:"24"})]),_.createVNode(l),e[4]||(e[4]=_.createElementVNode("div",{class:"h-[30px] w-[1px] bg-gray-200 ml-[10px] mr-[10px]"},null,-1)),_.createElementVNode("div",h7,[_.createElementVNode("div",{onClick:e[0]||(e[0]=J=>r.isVisible=!0),class:"cursor-pointer"},[(E=(S=r.userData)==null?void 0:S.user)!=null&&E.avatar?(_.openBlock(),_.createElementBlock("img",{key:0,class:"flex-shrink-0 size-[30px] rounded-full",src:(I=(T=r.userData)==null?void 0:T.user)==null?void 0:I.avatar,alt:"Image Description"},null,8,d7)):(_.openBlock(),_.createElementBlock("div",p7,[_.createVNode(m)]))]),r.isVisible?(_.openBlock(),_.createElementBlock("div",{key:0,onClick:e[2]||(e[2]=_.withModifiers(()=>{},["stop"])),class:"fixed bg-white w-[180px] top-[55px] right-[20px] shadow-xl rounded-xl z-[1]"},[_.createElementVNode("div",f7,[(F=(z=r.userData)==null?void 0:z.user)!=null&&F.avatar?(_.openBlock(),_.createElementBlock("img",{key:0,class:"flex-shrink-0 size-[30px] rounded-full",src:(G=(j=r.userData)==null?void 0:j.user)==null?void 0:G.avatar,alt:"Image Description"},null,8,m7)):(_.openBlock(),_.createElementBlock("div",g7,[_.createVNode(m)])),_.createElementVNode("div",null,[_.createElementVNode("p",y7,_.toDisplayString((ae=(ie=r.userData)==null?void 0:ie.user)==null?void 0:ae.username),1)])]),_.createElementVNode("div",_7,[_.createVNode(x,{disabled:!0,class:"p-[8px] block rounded-lg w-full mb-[4px] text-start hover:bg-gray-100 !duration-300"},{default:_.withCtx(()=>e[3]||(e[3]=[_.createTextVNode("Профіль")])),_:1}),_.createElementVNode("button",{onClick:e[1]||(e[1]=(...J)=>a.logout&&a.logout(...J)),class:"p-[8px] block rounded-lg w-full text-start hover:bg-gray-100 !duration-300"}," Вийти ")])])):_.createCommentVNode("",!0)])])])}const b7={components:{navbar:Uj,AdminHeader:Ge(a7,[["render",x7]])},mounted(){this.getMenu()},computed:{isMenu(){return Xr.value}},methods:{async getMenu(){try{const{data:t}=await vt.get("/api/user-menu");t.filter(e=>e.path==="/"),Xr.value=t}catch{}}}},v7={class:"admin-wrapper"},w7={class:"flex flex-col"};function k7(t,e,n,i,r,a){const u=_.resolveComponent("navbar"),l=_.resolveComponent("admin-header"),m=_.resolveComponent("router-view");return _.openBlock(),_.createElementBlock("div",v7,[_.createVNode(u),_.createElementVNode("div",w7,[a.isMenu?(_.openBlock(),_.createElementBlock(_.Fragment,{key:0},[_.createVNode(l),_.createVNode(m)],64)):_.createCommentVNode("",!0)])])}const S7=Object.freeze(Object.defineProperty({__proto__:null,default:Ge(b7,[["render",k7],["__scopeId","data-v-776e8b33"]])},Symbol.toStringTag,{value:"Module"})),E7={data(){return{currentSort:""}},props:{data:{type:Object,default:()=>null},activeColumn:{type:String}},computed:{label(){var t,e;return((t=this.data)==null?void 0:t.ua)||((e=this.data)==null?void 0:e.label)||this.data.title||"null"},selectedSortParam(){var t,e;return(e=(t=this.$route)==null?void 0:t.query)==null?void 0:e.sort},getVisibleIcon(){return this.data.format!=="image"&&this.data.format!=="verify"}},watch:{activeColumn(t){t!==this.data.name&&(this.currentSort="")}},methods:{changeCurrentSort(t){switch(t){case"":return"asc";case"asc":return"desc";case"desc":return"";default:return""}},handleClickSortBtn(t){this.$emit("change-active",this.data.name),this.currentSort=this.changeCurrentSort(t);const e=this.$route.query,{sort:n,...i}=e,r=this.currentSort?`${this.data.name}-${this.currentSort}`:"";this.$router.replace({query:{...i,...r&&{sort:r}}})},isValueEqualToSelected(t){return`${this.data.name}-${t}`===this.selectedSortParam}}},C7={scope:"col",class:"text-start whitespace-nowrap px-2 py-1"},T7={class:"flex-shrink-0 size-3.5",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},M7={key:0,d:"m7 15 5 5 5-5"},A7={key:1,d:"m7 9 5-5 5 5"},I7={key:1,class:"text-sm text-stone-500 px-[4px] py-2.5 text-start font-normal text-gray-500"};function P7(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("th",C7,[a.getVisibleIcon?(_.openBlock(),_.createElementBlock("button",{key:0,type:"button",class:"text-sm text-stone-500 px-[4px] py-2.5 text-start font-normal text-gray-500 flex items-center gap-[6px]",onClick:e[0]||(e[0]=u=>a.handleClickSortBtn(r.currentSort))},[_.createTextVNode(_.toDisplayString(a.label)+" ",1),(_.openBlock(),_.createElementBlock("svg",T7,[r.currentSort==="asc"||r.currentSort===""?(_.openBlock(),_.createElementBlock("path",M7)):_.createCommentVNode("",!0),r.currentSort==="desc"||r.currentSort===""?(_.openBlock(),_.createElementBlock("path",A7)):_.createCommentVNode("",!0)]))])):(_.openBlock(),_.createElementBlock("p",I7,_.toDisplayString(a.label),1))])}const D7=Ge(E7,[["render",P7]]),O7={},z7={class:"flex-shrink-0 size-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function N7(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("svg",z7,e[0]||(e[0]=[_.createStaticVNode('<path d="M3 6h18"></path><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"></path><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"></path><line x1="10" x2="10" y1="11" y2="17"></line><line x1="14" x2="14" y1="11" y2="17"></line>',5)]))}const R7=Ge(O7,[["render",N7]]),B7={props:{height:{type:String,default:"16"},width:{type:String,default:"12"},color:{type:String,default:"black"}}},L7={style:{display:"none"}},V7=["height","width","fill"];function F7(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock(_.Fragment,null,[(_.openBlock(),_.createElementBlock("svg",L7,e[0]||(e[0]=[_.createElementVNode("symbol",{id:"icon-pencil",viewBox:"0 0 32 32"},[_.createElementVNode("path",{d:"M27 0c2.761 0 5 2.239 5 5 0 1.126-0.372 2.164-1 3l-2 2-7-7 2-2c0.836-0.628 1.874-1 3-1zM2 23l-2 9 9-2 18.5-18.5-7-7-18.5 18.5zM22.362 11.362l-14 14-1.724-1.724 14-14 1.724 1.724z"})],-1)]))),(_.openBlock(),_.createElementBlock("svg",{height:n.height,width:n.width,fill:n.color},e[1]||(e[1]=[_.createElementVNode("use",{"xlink:href":"#icon-pencil"},null,-1)]),8,V7))],64)}const $7={components:{IconMore:mS,IconDelete:R7,IconEdit:Ge(B7,[["render",F7]])},emits:["updateTable"],props:{item:Object,table:String,isForm:null,actions:Array,default:()=>[]},data(){return{formVisible:!1,isDeleteConfirm:!1,formValue:{},top:0,left:0}},methods:{openConfirm(){this.isDeleteConfirm=!0,document.querySelector("body").click()},async getData(){var t;try{const{data:e}=await vt.get(`/api/table/${this.table}/${(t=this.item)==null?void 0:t.id}`);this.formValue=e}catch(e){console.error(e)}},doSomethingOnCancel(){this.formVisible=!1},async deleteElement(){var t;try{vt.delete(`/api/table/${this.table}/${(t=this.item)==null?void 0:t.id}`),this.$notify({title:"Успішно!",message:"Об`єкт успішно видалeно",type:"success"}),await this.$emit("update-table"),this.isDeleteConfirm=!1}catch{this.$notify({title:"Помилка!",message:"Сталася помилка",type:"error"})}}}},j7={class:"hs-dropdown [--placement:bottom-right] inline-flex"},U7={class:"size-7 inline-flex justify-center items-center gap-x-2 rounded-lg border border-stone-200 bg-white text-stone-800 shadow-sm hover:bg-stone-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-50"},H7={class:"flex flex-col items-start"},q7={key:1,class:"h-[1px] w-[80%] bg-gray-200 ml-auto mr-auto"},W7={class:"p-4"},G7={class:"flex justify-end mt-4 gap-x-3"};function Z7(t,e,n,i,r,a){const u=_.resolveComponent("IconMore"),l=_.resolveComponent("IconEdit"),m=_.resolveComponent("router-link"),x=_.resolveComponent("IconDelete"),S=_.resolveComponent("VsPopover"),E=_.resolveComponent("VsDialog");return _.openBlock(),_.createElementBlock(_.Fragment,null,[_.createElementVNode("div",j7,[_.createVNode(S,{trigger:"click",placement:"bottom"},{reference:_.withCtx(()=>[_.createElementVNode("button",U7,[_.createVNode(u,{height:"16",width:"16"})])]),default:_.withCtx(()=>{var T,I,z,F,j;return[_.createElementVNode("div",H7,[(T=n.actions)!=null&&T.includes("edit")&&n.isForm?(_.openBlock(),_.createBlock(m,{key:0,to:`/edit?table=${(z=(I=t.$route)==null?void 0:I.params)==null?void 0:z.catchAll}&id=${(F=n.item)==null?void 0:F.id}`,class:"w-full flex items-center gap-x-3 py-1.5 px-2 rounded-lg text-[13px] text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"},{default:_.withCtx(()=>[_.createVNode(l,{color:"#000"}),e[4]||(e[4]=_.createTextVNode(" Редагувати "))]),_:1},8,["to"])):_.createCommentVNode("",!0),n.isForm?(_.openBlock(),_.createElementBlock("div",q7)):_.createCommentVNode("",!0),(j=n.actions)!=null&&j.includes("del")?(_.openBlock(),_.createElementBlock("button",{key:2,onClick:e[0]||(e[0]=_.withModifiers((...G)=>a.openConfirm&&a.openConfirm(...G),["stop"])),class:"w-full flex items-center gap-x-3 py-1.5 px-2 rounded-lg text-[13px] text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"},[_.createVNode(x),e[5]||(e[5]=_.createElementVNode("span",{class:"text-gray-800"},"Видалити",-1))])):_.createCommentVNode("",!0)])]}),_:1})]),_.createVNode(E,{visible:r.isDeleteConfirm,"onUpdate:visible":e[3]||(e[3]=T=>r.isDeleteConfirm=T),title:"Ви впевнені?"},{default:_.withCtx(()=>[_.createElementVNode("div",W7,[e[6]||(e[6]=_.createElementVNode("p",{class:"mt-1 text-gray-500 dark:text-neutral-500"}," Ви впевнені, що хочете видалити цей об'єкт? ",-1)),_.createElementVNode("div",G7,[_.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-sm font-medium text-gray-800 bg-white border border-gray-200 rounded-lg shadow-sm gap-x-2 hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:e[1]||(e[1]=T=>r.isDeleteConfirm=!1)}," Скасувати "),_.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-sm font-semibold text-white bg-red-500 border border-transparent rounded-lg gap-x-2 hover:bg-red-600 disabled:opacity-50 disabled:pointer-events-none",onClick:e[2]||(e[2]=(...T)=>a.deleteElement&&a.deleteElement(...T))}," Так, я впевнена/ий ")])])]),_:1},8,["visible"])],64)}const Y7=Ge($7,[["render",Z7]]),X7={},K7={class:"flex-shrink-0 mt-0.5 size-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function J7(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("svg",K7,e[0]||(e[0]=[_.createElementVNode("path",{d:"m3 16 4 4 4-4"},null,-1),_.createElementVNode("path",{d:"M7 20V4"},null,-1),_.createElementVNode("path",{d:"m21 8-4-4-4 4"},null,-1),_.createElementVNode("path",{d:"M17 4v16"},null,-1)]))}const Q7={components:{IconExport:Ge(X7,[["render",J7]])},props:{table:String,columns:Array},data(){return{isOpen:!1,tableFormats:["json","csv","xlsx"],format:"",cols:[]}},methods:{async exportTable(){try{const t=await vt.get("/api/export",{params:{table:this.table,format:this.format,cols:this.cols.join(",")},responseType:"blob"}),e=new Blob([t.data],{type:"application/octet-stream"}),n=window.URL.createObjectURL(e),i=document.createElement("a");i.href=n,i.setAttribute("download",`${this.table.split(".")[0]}.${this.format}`),document.body.appendChild(i),i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(n),this.$notify({type:"success",title:"Експорт",message:"Файл успішно експортовано!"})}catch(t){console.error("Ошибка при экспорте файла:",t),this.$notify({type:"error",title:"Помилка",message:"Не вдалося експортувати файл."})}},selectFormat(t){this.format=t}}},e9={class:"p-4"},t9={class:"pb-5 mb-5 last:pb-0 last:mb-0 border-b last:border-b-0 border-gray-200 dark:border-neutral-700"},n9={class:"mt-2 flex row flex-wrap gap-y-[5px] gap-x-[10px]"},i9={class:"pb-5 mb-5 last:pb-0 last:mb-0 border-b last:border-b-0 border-gray-200 dark:border-neutral-700"},r9={class:"mt-2 space-y-2"},s9=["id","onChange"],o9=["for"],a9={class:"flex w-full justify-end p-[20px] gap-[6px] border-t"};function l9(t,e,n,i,r,a){const u=_.resolveComponent("IconExport"),l=_.resolveComponent("VsCheckbox"),m=_.resolveComponent("VsDialog");return _.openBlock(),_.createElementBlock(_.Fragment,null,[_.createElementVNode("button",{onClick:e[0]||(e[0]=x=>r.isOpen=!0),class:"py-2 px-2.5 inline-flex items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},[_.createVNode(u,{height:"16",width:"16"}),e[4]||(e[4]=_.createTextVNode(" Експорт ")),e[5]||(e[5]=_.createElementVNode("svg",{class:"shrink-0 size-3.5",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[_.createElementVNode("path",{d:"m6 9 6 6 6-6"})],-1))]),_.createVNode(m,{visible:r.isOpen,"onUpdate:visible":e[3]||(e[3]=x=>r.isOpen=x),title:"Експорт таблиці",size:"small"},{footer:_.withCtx(()=>[_.createElementVNode("div",a9,[e[8]||(e[8]=_.createElementVNode("button",{type:"button",class:"py-2 px-3 text-nowrap inline-flex justify-center items-center text-start bg-white border border-gray-200 text-gray-800 text-sm font-medium rounded-lg shadow-sm align-middle hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700","data-hs-overlay":"#hs-pro-decm"}," Скасувати ",-1)),_.createElementVNode("button",{type:"button",class:"py-2 px-3 text-nowrap inline-flex justify-center items-center gap-x-2 text-start bg-blue-600 border border-blue-600 text-white text-sm font-medium rounded-lg shadow-sm align-middle hover:bg-blue-700 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:ring-1 focus:ring-blue-300 dark:focus:ring-blue-500",onClick:e[2]||(e[2]=(...x)=>a.exportTable&&a.exportTable(...x))}," Завантажити таблицю ")])]),default:_.withCtx(()=>[e[9]||(e[9]=_.createElementVNode("div",{class:"dark:border-neutral-700"},null,-1)),_.createElementVNode("div",e9,[_.createElementVNode("div",t9,[e[6]||(e[6]=_.createElementVNode("h2",{class:"text-sm text-gray-500"}," Виберіть стовпці таблиці для експорту: ",-1)),_.createElementVNode("div",n9,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(n.columns,(x,S)=>(_.openBlock(),_.createElementBlock("div",{class:"flex items-center",key:S,style:{width:"calc((100% - 10px) / 2)"}},[_.createVNode(l,{class:"[&>label]:text-sm [&>label]:text-gray-800 [&>label]:ms-3 !gap-x-[1px] !p-0",modelValue:r.cols,"onUpdate:modelValue":e[1]||(e[1]=E=>r.cols=E),value:x==null?void 0:x.name,label:x==null?void 0:x.ua},null,8,["modelValue","value","label"])]))),128))])]),_.createElementVNode("div",i9,[e[7]||(e[7]=_.createElementVNode("h2",{class:"text-sm text-gray-500"},"Виберіть формат таблиці:",-1)),_.createElementVNode("div",r9,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(r.tableFormats,(x,S)=>(_.openBlock(),_.createElementBlock("div",{class:"flex items-center",key:S},[_.createElementVNode("input",{type:"radio",name:"hs-pro-duecmfm",class:"shrink-0 border-gray-300 rounded-full text-blue-600 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-500 dark:checked:bg-blue-500 dark:checked:border-blue-500 dark:focus:ring-offset-gray-800",id:x,onChange:E=>a.selectFormat(x)},null,40,s9),_.createElementVNode("label",{for:x,class:"text-sm text-gray-800 ms-3 dark:text-neutral-400"}," Формат "+_.toDisplayString(x),9,o9)]))),128))])])])]),_:1},8,["visible"])],64)}const c9=Ge(Q7,[["render",l9]]),u9={},h9={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-columns"};function d9(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("svg",h9,e[0]||(e[0]=[_.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 6l5.5 0"></path><path d="M4 10l5.5 0"></path><path d="M4 14l5.5 0"></path><path d="M4 18l5.5 0"></path><path d="M14.5 6l5.5 0"></path><path d="M14.5 10l5.5 0"></path><path d="M14.5 14l5.5 0"></path><path d="M14.5 18l5.5 0"></path>',9)]))}const p9=Ge(u9,[["render",d9]]),f9={props:{column:Object},emits:["update-column"],data(){return{value:!1}},watch:{value(t){this.$emit("update-column",{...this.column,hidden:!t})}},mounted(){var t;((t=this.column)==null?void 0:t.hidden)!==!0&&(this.value=!0)}},m9={class:"flex w-full gap-[8px] items-centr"};function g9(t,e,n,i,r,a){var u,l;return _.openBlock(),_.createElementBlock("label",m9,[_.withDirectives(_.createElementVNode("input",{"onUpdate:modelValue":e[0]||(e[0]=m=>r.value=m),type:"checkbox"},null,512),[[_.vModelCheckbox,r.value]]),_.createTextVNode(" "+_.toDisplayString(((u=n.column)==null?void 0:u.ua)||((l=n.column)==null?void 0:l.title)),1)])}const y9={components:{IconColumns:p9,AdminTableColumnsHiddenItem:Ge(f9,[["render",g9]])},emits:["update-columns"],props:{columns:Array},methods:{updateColumn(t){const e=this.columns.findIndex(i=>(i==null?void 0:i.name)===(t==null?void 0:t.name)),n=this.columns;n[e]=t,this.$emit("update-columns",[...n])}}},_9={class:"py-2 px-2.5 inline-flex items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},x9={class:"py-[10px] px-[10px] w-[260px]"},b9={class:"flex flex-col gap-[3px] max-h-[400px] w-full overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"};function v9(t,e,n,i,r,a){const u=_.resolveComponent("IconColumns"),l=_.resolveComponent("AdminTableColumnsHiddenItem"),m=_.resolveComponent("VsPopover");return _.openBlock(),_.createBlock(m,{trigger:"click",placement:"bottom"},{reference:_.withCtx(()=>[_.createElementVNode("button",_9,[_.createVNode(u,{height:"20",width:"16"})])]),default:_.withCtx(()=>[_.createElementVNode("div",x9,[e[0]||(e[0]=_.createElementVNode("h2",{class:"text-sm mb-[8px]"},"Оберіть колонки, щоб приховати",-1)),_.createElementVNode("ul",b9,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(n.columns,(x,S)=>(_.openBlock(),_.createElementBlock("li",{key:S},[_.createVNode(l,{column:x,onUpdateColumn:a.updateColumn},null,8,["column","onUpdateColumn"])]))),128))])])]),_:1})}const w9=Ge(y9,[["render",v9]]),k9={},S9={class:"hidden sm:block shrink-0 size-3",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 16 16"};function E9(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("svg",S9,e[0]||(e[0]=[_.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8 1C8.55228 1 9 1.44772 9 2V7L14 7C14.5523 7 15 7.44771 15 8C15 8.55228 14.5523 9 14 9L9 9V14C9 14.5523 8.55228 15 8 15C7.44772 15 7 14.5523 7 14V9.00001L2 9.00001C1.44772 9.00001 1 8.5523 1 8.00001C0.999999 7.44773 1.44771 7.00001 2 7.00001L7 7.00001V2C7 1.44772 7.44772 1 8 1Z"},null,-1)]))}const SS=Ge(k9,[["render",E9]]),C9={},T9={class:"vs-table-interface__table-wrp w-full rounded h-fit overflow-hidden"};function M9(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("div",T9,e[0]||(e[0]=[_.createStaticVNode('<div><div class="p-5 min-h-[500px] flex flex-col justify-center items-center text-center"><svg class="w-48 mx-auto" viewBox="0 0 178 90" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs></svg><div class="max-w-sm mx-auto mt-6"><p class="font-medium text-gray-800 dark:text-neutral-200"> Дані для відображення відсутні </p><p class="mt-2 text-sm text-gray-500 dark:text-neutral-500"> Змініть параметри пошуку або спробуйте пізніше </p></div></div></div>',1)]))}const A9=Ge(C9,[["render",M9]]),I9={props:{row:Object,column:Object,table:String}};function P9(t,e,n,i,r,a){var u,l,m,x,S,E,T,I;return _.openBlock(),_.createBlock(_.resolveDynamicComponent(((u=n.column)==null?void 0:u.format)==="custom"?(l=n.column)==null?void 0:l.component:t.$componentsConfig[`table-format-${((x=(m=n.column)==null?void 0:m.format)==null?void 0:x.toLowerCase())||"text"}`]),{onUpdateTable:e[0]||(e[0]=z=>t.$emit("update-table")),name:(S=n.column)==null?void 0:S.name,data:n.row,value:(T=n.row)==null?void 0:T[(E=n.column)==null?void 0:E.name],table:n.table,edit:(I=n.column)==null?void 0:I.edit},null,40,["name","data","value","table","edit"])}const ES=Ge(I9,[["render",P9]]),D9={},O9={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus"};function z9(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("svg",O9,e[0]||(e[0]=[_.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),_.createElementVNode("path",{d:"M5 12l14 0"},null,-1)]))}const N9={components:{IconPlus:SS,IconMinus:Ge(D9,[["render",z9]])},props:{title:String},data(){return{expanded:!1}}},R9={class:"hs-accordion"},B9={class:"py-0.5 flex items-center gap-x-0.5 w-full"},L9={class:"text-sm font-medium"},V9={class:"w-full duration-150 before:block before:absolute relative inline-block b cursor-pointer"};function F9(t,e,n,i,r,a){const u=_.resolveComponent("IconPlus"),l=_.resolveComponent("IconMinus");return _.openBlock(),_.createElementBlock("div",null,[_.createElementVNode("div",null,[_.createElementVNode("div",R9,[_.createElementVNode("div",B9,[_.createElementVNode("div",{onClick:e[0]||(e[0]=m=>r.expanded=!r.expanded),class:"grow rounded-md cursor-pointer"},[_.createElementVNode("span",L9,_.toDisplayString(n.title),1)]),_.createElementVNode("button",{class:"size-6 flex justify-center items-center hover:bg-gray-100 rounded-md",onClick:e[1]||(e[1]=m=>r.expanded=!r.expanded)},[r.expanded?(_.openBlock(),_.createBlock(l,{key:1,width:"14"})):(_.openBlock(),_.createBlock(u,{key:0}))])]),_.createVNode(_.Transition,{name:"fade"},{default:_.withCtx(()=>[_.withDirectives(_.createElementVNode("div",V9,[_.renderSlot(t.$slots,"default",{},void 0,!0)],512),[[_.vShow,r.expanded]])]),_:3})])])])}const $9={components:{AdminComponentIs:ES,AdminTree:Ge(N9,[["render",F9],["__scopeId","data-v-f5ecdb9a"]]),VsNoData:xS,VsWidgetComments:yS,VsWidgetMap:L1,VsWidgetFileList:Rv},props:{table:String,columns:Array,row:Object}},j9={class:"hs-accordion border-gray-100 w-[360px] shrink-0 overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500",style:{height:"calc(100vh - 310px)"}},U9={class:"border-l",style:{height:"calc(100vh - 360px)"}},H9={class:"py-1 flex justify-between items-center gap-x-4"},q9={class:"col-span-1"},W9={class:"inline-flex items-center gap-x-2 text-[13px] text-gray-500 dark:text-neutral-500"},G9={class:"col-span-2"},Z9={class:"font-medium text-[13px] text-gray-800 dark:text-neutral-200"},Y9={class:"table-info-card"},X9={class:"table-info-card"};function K9(t,e,n,i,r,a){var T,I;const u=_.resolveComponent("AdminComponentIs"),l=_.resolveComponent("AdminTree"),m=_.resolveComponent("VsWidgetMap"),x=_.resolveComponent("VsNoData"),S=_.resolveComponent("VsWidgetComments"),E=_.resolveComponent("VsWidgetFileList");return _.openBlock(),_.createElementBlock("div",j9,[e[0]||(e[0]=_.createElementVNode("div",{class:"p-[10px] pl-[18px] pb-[18px] border-b"},[_.createElementVNode("h2",{class:"text-sm font-medium"},"Інформація про об'єкт")],-1)),_.createElementVNode("div",U9,[(I=(T=t.$route)==null?void 0:T.query)!=null&&I.card?(_.openBlock(),_.createElementBlock(_.Fragment,{key:0},[n.row?(_.openBlock(),_.createBlock(l,{key:0,title:"Основна інформація",class:"border-b p-[10px] py-[16px] w-[280px]"},{default:_.withCtx(()=>[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(n.columns,z=>(_.openBlock(),_.createElementBlock("dl",H9,[_.createElementVNode("dt",q9,[_.createElementVNode("p",W9,_.toDisplayString((z==null?void 0:z.ua)||(z==null?void 0:z.title))+": ",1)]),_.createElementVNode("dd",G9,[_.createElementVNode("p",Z9,[_.createVNode(u,{row:n.row,column:z,table:n.table},null,8,["row","column","table"])])])]))),256))]),_:1})):_.createCommentVNode("",!0),_.createVNode(l,{title:"Карта",class:"border-b p-[10px] py-[16px] w-[280px]"},{default:_.withCtx(()=>{var z,F;return[(z=n.row)!=null&&z.geom?(_.openBlock(),_.createBlock(m,{key:0,geometry:(F=n.row)==null?void 0:F.geom,zoom:14},null,8,["geometry"])):(_.openBlock(),_.createBlock(x,{key:1,title:"У об'єкта відсутня геометрія",text:"",class:"[&>div]:h-[200px] [&>div]:min-h-[400px] h-[400px]"}))]}),_:1}),_.createVNode(l,{title:"Коментарі",class:"border-b p-[10px] py-[16px] w-[280px]"},{default:_.withCtx(()=>{var z;return[_.createElementVNode("div",Y9,[_.createVNode(S,{id:(z=n.row)==null?void 0:z.id},null,8,["id"])])]}),_:1}),_.createVNode(l,{title:"Файли",class:"border-b p-[10px] py-[16px] w-[280px]"},{default:_.withCtx(()=>{var z;return[_.createElementVNode("div",X9,[_.createVNode(E,{id:(z=n.row)==null?void 0:z.id},null,8,["id"])])]}),_:1})],64)):(_.openBlock(),_.createBlock(x,{key:1,text:"Оберіть один з об'єктів в таблиці для відображення інформаціі про нього"}))])])}const J9=Ge($9,[["render",K9]]),Q9={},eU={class:"hidden xl:block shrink-0 size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function tU(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("svg",eU,e[0]||(e[0]=[_.createElementVNode("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"},null,-1),_.createElementVNode("path",{d:"M15 3v18"},null,-1),_.createElementVNode("path",{d:"m8 9 3 3-3 3"},null,-1)]))}const nU=Ge(Q9,[["render",tU]]),iU={},rU={class:"h21yx vs0hq",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function sU(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("svg",rU,e[0]||(e[0]=[_.createStaticVNode('<line x1="21" x2="14" y1="4" y2="4"></line><line x1="10" x2="3" y1="4" y2="4"></line><line x1="21" x2="12" y1="12" y2="12"></line><line x1="8" x2="3" y1="12" y2="12"></line><line x1="21" x2="16" y1="20" y2="20"></line><line x1="12" x2="3" y1="20" y2="20"></line><line x1="14" x2="14" y1="2" y2="6"></line><line x1="8" x2="8" y1="10" y2="14"></line><line x1="16" x2="16" y1="18" y2="22"></line>',9)]))}const oU={props:{scheme:{type:Object},onFilters:{type:Number}},components:{IconFilter:Ge(iU,[["render",sU]])},data(){return{isFilters:!1}},methods:{closeFilter({target:t}){this.isFilters&&t.classList.contains("filter-container")&&(this.isFilters=!1)}}},aU={key:0,class:"font-medium text-[10px] py-0.5 px-[5px] bg-gray-800 text-white leading-3 rounded-full dark:bg-neutral-500"},lU={class:"filter-content h-screen bg-white w-[400px] p-[20px] pt-[10px] overflow-x-auto bg-white [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"};function cU(t,e,n,i,r,a){const u=_.resolveComponent("IconFilter"),l=_.resolveComponent("VsFilter");return _.openBlock(),_.createElementBlock(_.Fragment,null,[_.createElementVNode("button",{onClick:e[0]||(e[0]=m=>r.isFilters=!r.isFilters),class:"py-2 px-2.5 inline-flex items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},[_.createVNode(u,{height:"16",width:"16"}),e[4]||(e[4]=_.createTextVNode(" Фільтри ")),n.onFilters?(_.openBlock(),_.createElementBlock("span",aU,_.toDisplayString(n.onFilters),1)):_.createCommentVNode("",!0)]),_.createVNode(_.Transition,{name:"fade"},{default:_.withCtx(()=>{var m;return[_.withDirectives(_.createElementVNode("div",{onClick:e[3]||(e[3]=(...x)=>a.closeFilter&&a.closeFilter(...x)),style:{height:"100vh"},class:"fixed filter-container top-0 flex justify-end items-center z-[2] right-0 left-0 bottom-0 bg-[rgba(0,0,0,0.5)]"},[_.createElementVNode("div",lU,[(m=n.scheme)!=null&&m.length?(_.openBlock(),_.createBlock(l,{key:0,ref:"filter",scheme:n.scheme,layout:"default","apply-vue-router":"",history:"",name:"filter",onFilterChange:e[1]||(e[1]=x=>t.$emit("filterChange",x)),closeFilterBtn:!0,onFilterClose:e[2]||(e[2]=x=>r.isFilters=!1)},null,8,["scheme"])):_.createCommentVNode("",!0)])],512),[[_.vShow,r.isFilters]])]}),_:1})],64)}const uU=Ge(oU,[["render",cU]]),hU={props:{tabsList:{type:Array,default:()=>[]},filterState:String}},dU={class:"relative flex space-x-1 mb-[20px] after:absolute after:w-[99%] after:bottom-0 after:inset-x-0 after:border-b-2 after:border-gray-200 dark:after:border-neutral-700","aria-label":"Tabs",role:"tablist","aria-orientation":"horizontal"},pU=["onClick"];function fU(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("nav",dU,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(n.tabsList,u=>(_.openBlock(),_.createElementBlock("button",{onClick:l=>t.$emit("update:filterState",u==null?void 0:u.name),class:_.normalizeClass(["hs-tab-active:after:bg-gray-800 hs-tab-active:text-gray-800 px-2.5 py-1.5 mb-2 relative inline-flex justify-center items-center gap-x-2 hover:bg-gray-100 text-gray-500 hover:text-gray-800 text-sm rounded-lg disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100 after:absolute after:-bottom-2 after:inset-x-0 after:z-10 after:h-0.5 after:pointer-events-none dark:hs-tab-active:text-neutral-200 dark:hs-tab-active:after:bg-neutral-400 dark:text-neutral-500 dark:hover:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700 active",{" font-semibold after:absolute after:bottom-[-8px] after:left-2.5 after:right-2.5 after:z-10 after:h-0.5 after:bg-gray-800":(u==null?void 0:u.name)===n.filterState}])},_.toDisplayString(u==null?void 0:u.label),11,pU))),256))])}const mU=Ge(hU,[["render",fU]]),gU={},yU={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-filter"};function _U(t,e,n,i,r,a){return _.openBlock(),_.createElementBlock("svg",yU,e[0]||(e[0]=[_.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),_.createElementVNode("path",{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z"},null,-1)]))}const xU={components:{IconFilter2:Ge(gU,[["render",_U]])},props:{filterCustom:String,customList:Array}},bU={class:"py-2 px-2.5 inline-flex items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},vU={class:"flex flex-col gap-[4px]"},wU=["onClick"];function kU(t,e,n,i,r,a){const u=_.resolveComponent("IconFilter2"),l=_.resolveComponent("VsPopover");return _.openBlock(),_.createBlock(l,{ref:"popover",placement:"bottom"},{reference:_.withCtx(()=>[_.createElementVNode("button",bU,[_.createVNode(u,{height:"20",width:"20"})])]),default:_.withCtx(()=>[_.createElementVNode("div",vU,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(n.customList,(m,x)=>(_.openBlock(),_.createElementBlock("button",{onClick:S=>{var E;t.$emit("update:filterCustom",m==null?void 0:m.name),(E=t.$refs)==null||E.popover.togglePopover()},key:x,class:_.normalizeClass(["p-[8px] block rounded-lg w-[140px] text-start hover:bg-gray-100 !duration-300",{"bg-gray-100":n.filterCustom===(m==null?void 0:m.name)}])},_.toDisplayString(m==null?void 0:m.label),11,wU))),128)),_.createElementVNode("button",{class:"p-[8px] block rounded-lg w-[140px] text-start hover:bg-gray-100 !duration-300",onClick:e[0]||(e[0]=m=>{var x;t.$emit("update:filterCustom",void 0),(x=t.$refs)==null||x.popover.togglePopover()})}," Скинути фільтри ")])]),_:1},512)}const SU={props:{table:String,title:String},components:{AdminTableControl:Y7,AdminTableExport:c9,AdminTableColumnsHidden:w9,AdminTableColumn:D7,AdminNodata:A9,IconPlus:SS,IconSearch:Z0,AdminTableCardInfo:J9,IconOpenCard:nU,AdminComponentIs:ES,AdminTableFilters:uU,AdminTableTabs:mU,AdminTableCustomFilters:Ge(xU,[["render",kU]])},data(){return{tableData:{},filterScheme:[],page:1,searchValue:"",limit:0,filters:null,activeColumn:"",isVisibleCardInfo:!1,onFilters:0,filterState:null,filterCustom:null}},async mounted(){await this.checkUrlMounted(),await this.getTableData(),await this.getFilters()},computed:{defaultPage(){var t,e;return((e=(t=this.$route)==null?void 0:t.query)==null?void 0:e.page)||1},columns(){var t,e;return(e=(t=this.tableData)==null?void 0:t.columns)==null?void 0:e.filter(n=>(n==null?void 0:n.hidden)!==!0)},isForm(){var t;return(t=this.tableData)==null?void 0:t.form},isNoData(){var t,e;return!((t=this.tableData)!=null&&t.rows)||!((e=this.columns)!=null&&e.length)},rowWidth(){var t;return((t=this.tableData)==null?void 0:t.width)||"100px"},activeCardRow(){var t,e;return((e=(t=this.tableData)==null?void 0:t.rows)==null?void 0:e.find(n=>{var i,r;return(n==null?void 0:n.id)===((r=(i=this.$route)==null?void 0:i.query)==null?void 0:r.card)}))||{}},getActions(){var t;return(t=this.tableData)==null?void 0:t.actions}},watch:{async table(){this.tableData=null,await this.getTableData()},searchValue(){this.getTableData()},$route:{handler(t,e){var n,i;((n=t==null?void 0:t.params)==null?void 0:n.catchAll)!==((i=e==null?void 0:e.params)==null?void 0:i.catchAll)&&(this.unmountedData(),this.getFilters())},deep:!0},limit(t){var e;this.$router.replace({query:{...(e=this.$route)==null?void 0:e.query,limit:t}})},filterState(t){var e;t&&(this.$router.replace({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,filterState:t}}),this.getTableData())},filterCustom(t){var e;this.$router.push({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,filterCustom:t}}),this.getTableData()}},methods:{async checkUrlMounted(){var t,e,n,i,r,a,u,l,m;this.page=((e=(t=this.$route)==null?void 0:t.query)==null?void 0:e.page)||1,this.limit=((i=(n=this.$route)==null?void 0:n.query)==null?void 0:i.limit)||20,this.filterState=((a=(r=this.$route)==null?void 0:r.query)==null?void 0:a.filterState)||null,this.filterCustom=((l=(u=this.$route)==null?void 0:u.query)==null?void 0:l.filterCustom)||null,(m=this.$route)!=null&&m.query.card&&(this.isVisibleCardInfo=!0)},unmountedData(){this.page=1,this.filterCustom=null,this.filterState=null,this.isVisibleCardInfo=!1,this.filterScheme=null,this.filters=null,this.onFilters=0},async getTableData(){var t,e;try{const{data:n}=await vt.get(`/api/template/table/${this.table}`),i=await vt.get(`/api/table-data/${this.table}`,{params:{page:this.page,search:this.searchValue||null,limit:this.limit,filter:this.filters||null,order:((e=(t=this.$route)==null?void 0:t.query)==null?void 0:e.sort)||null,state:this.filterState||null,custom:this.filterCustom||null}});this.tableData={...n,...(i==null?void 0:i.data)||{}}}catch{}},async getFilters(){var t;try{const{data:e}=await vt.get(`/api/table-filter/${this.table}`);this.filterScheme=(t=e==null?void 0:e.list)==null?void 0:t.map(n=>({...n,label:(n==null?void 0:n.label)||(n==null?void 0:n.ua)}))}catch{}},async handlePageChange(t){const e=this.$route.query;this.page=t,!(!(e!=null&&e.page)&&t===1||e.page===t)&&(await this.$router.replace({query:{...e,page:t}}),await this.getTableData())},async changeLimit(t){this.limit=await t,this.defaultPage=1,await this.getTableData()},async filterChange({url:t,state:e}){var n;this.filters=t!=="no-url"?t:null,this.onFilters=(n=Object.entries(e))==null?void 0:n.length,this.page=1,await this.getTableData()},changeActiveColumn(t){this.activeColumn=t,this.getTableData()},pushToCard(t){var e;((e=this.tableData)==null?void 0:e.card)===!1||this.$router.push(`/card/${this.table}/${t}`)},changeActiveCardInfo(t){var e;this.isVisibleCardInfo&&this.$router.push({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,card:t}})},toggleCardInfo(){var t;this.isVisibleCardInfo=!this.isVisibleCardInfo,this.isVisibleCardInfo||this.$router.push({...this.$route,query:{...(t=this.$route)==null?void 0:t.query,card:void 0}})}}},EU={class:"w-[calc(100vw - 320px)]"},CU={class:"h-[76px] bg-gray-50 flex items-center justify-between px-[30px]"},TU={class:"text-xl font-medium h-[20px]"},MU={style:{height:"calc(100vh - 140px)",width:"calc(100vw - 260px)"},class:"bg-gray-50 p-[20px] flex pt-[10px]"},AU={class:"bg-white w-full rounded-xl border p-[20px] pr-0"},IU={class:"flex"},PU={class:"flex gap-[6px] ml-auto"},DU={class:"inline-block w-full align-middle"},OU={key:0,class:"relative min-w-full divide-y divide-gray-200 table-fixed dark:divide-neutral-700"},zU={class:"sticky top-0 bg-white w-full after:absolute after:content-[''] z-[1] after:block after:w-full after:h-px after:bg-stone-200"},NU={class:"right-0 border-t border-stone-200"},RU={class:"divide-y divide-gray-200"},BU={class:"text-sm text-gray-600 px-4 py-3 whitespace-nowrap"},LU=["onClick"],VU=["onClick"],FU={key:0,class:"text-center sticky right-0 bg-white w-[80px] px-[10px]"},$U={class:"p-[20px] flex justify-end w-full"};function jU(t,e,n,i,r,a){var be,Ae,Fe,Pe,Xe,rt,Bt,dt,Nt,Xt,rn,jt,Kt,Sn;const u=_.resolveComponent("IconPlus"),l=_.resolveComponent("router-link"),m=_.resolveComponent("AdminTableTabs"),x=_.resolveComponent("IconSearch"),S=_.resolveComponent("VsText"),E=_.resolveComponent("AdminTableCustomFilters"),T=_.resolveComponent("AdminTableColumnsHidden"),I=_.resolveComponent("AdminTableExport"),z=_.resolveComponent("AdminTableFilters"),F=_.resolveComponent("IconOpenCard"),j=_.resolveComponent("AdminTableColumn"),G=_.resolveComponent("AdminComponentIs"),ie=_.resolveComponent("AdminTableControl"),ae=_.resolveComponent("AdminNodata"),J=_.resolveComponent("VsPagination"),Ce=_.resolveComponent("AdminTableCardInfo");return _.openBlock(),_.createElementBlock("div",EU,[_.createElementVNode("div",CU,[_.createElementVNode("h2",TU,_.toDisplayString(n.title),1),a.isForm?(_.openBlock(),_.createBlock(l,{key:0,to:`/add?table=${(Ae=(be=t.$route)==null?void 0:be.params)==null?void 0:Ae.catchAll}`,class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white"},{default:_.withCtx(()=>[_.createVNode(u,{height:"16",width:"16"}),e[5]||(e[5]=_.createTextVNode(" Додати "))]),_:1},8,["to"])):_.createCommentVNode("",!0)]),_.createElementVNode("div",MU,[_.createElementVNode("div",AU,[(Pe=(Fe=r.tableData)==null?void 0:Fe.filterState)!=null&&Pe.length?(_.openBlock(),_.createBlock(m,{key:0,tabsList:(Xe=r.tableData)==null?void 0:Xe.filterState,filterState:r.filterState,"onUpdate:filterState":e[0]||(e[0]=Mt=>r.filterState=Mt)},null,8,["tabsList","filterState"])):_.createCommentVNode("",!0),_.createElementVNode("div",IU,[_.createElementVNode("div",{class:_.normalizeClass([r.isVisibleCardInfo?"w-[calc(100%-360px)]":"w-full"])},[_.createElementVNode("div",{class:_.normalizeClass(["flex sm:grid sm:grid-cols-2 gap-x-2 sm:gap-x-5 mb-[10px] relative",{"pr-[20px]":!r.isVisibleCardInfo}])},[_.createVNode(x,{height:"14",width:"14",class:"absolute top-[10px] left-[14px] text-gray-500 z-[1]"}),_.createVNode(S,{modelValue:r.searchValue,"onUpdate:modelValue":e[1]||(e[1]=Mt=>r.searchValue=Mt),placeholder:"Пошук...",clearable:!0,class:"[&>input]:py-[7px] [&>input]:ps-10 [&>input]:pe-8 [&>input]:block [&>input]:w-full [&>input]:bg-gray-100 [&>input]:border-transparent [&>input]:rounded-lg [&>input]:text-sm [&>input]:focus:bg-white [&>input]:focus:border-blue-500 [&>input]:focus:ring-blue-500 [&>input]:disabled:opacity-50 [&>input]:disabled:pointer-events-none [&>input]:dark:bg-neutral-700 [&>input]:dark:border-transparent [&>input]:dark:text-neutral-400 [&>input]:dark:placeholder:text-neutral-400 dark:focus:bg-neutral-800 dark:focus:ring-neutral-600"},null,8,["modelValue"]),_.createElementVNode("div",PU,[(Bt=(rt=r.tableData)==null?void 0:rt.filterCustom)!=null&&Bt.length?(_.openBlock(),_.createBlock(E,{key:0,customList:(dt=r.tableData)==null?void 0:dt.filterCustom,filterCustom:r.filterCustom,"onUpdate:filterCustom":e[2]||(e[2]=Mt=>r.filterCustom=Mt)},null,8,["customList","filterCustom"])):_.createCommentVNode("",!0),_.createVNode(T,{columns:(Nt=r.tableData)==null?void 0:Nt.columns,onUpdateColumns:e[3]||(e[3]=Mt=>r.tableData.columns=Mt)},null,8,["columns"]),_.createVNode(I,{table:n.table,columns:(Xt=r.tableData)==null?void 0:Xt.columns},null,8,["table","columns"]),_.createVNode(z,{scheme:r.filterScheme,onFilters:r.onFilters,onFilterChange:a.filterChange},null,8,["scheme","onFilters","onFilterChange"]),_.createElementVNode("button",{onClick:e[4]||(e[4]=(...Mt)=>a.toggleCardInfo&&a.toggleCardInfo(...Mt)),class:"py-2 px-2.5 inline-flex items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},[_.createVNode(F,{class:_.normalizeClass({"rotate-180 duration-300":!r.isVisibleCardInfo})},null,8,["class"])])])],2),_.createElementVNode("div",{class:_.normalizeClass(["flex items-start justify-start w-full space-y-5",{"pr-[20px]":!r.isVisibleCardInfo}])},[_.createElementVNode("div",{style:_.normalizeStyle({height:(jt=(rn=r.tableData)==null?void 0:rn.filterState)!=null&&jt.length?"calc(100vh - 370px)":"calc(100vh - 315px)"}),class:"overflow-x-auto w-full [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-stone-100 [&::-webkit-scrollbar-thumb]:bg-stone-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},[_.createElementVNode("div",DU,[a.isNoData?(_.openBlock(),_.createBlock(ae,{key:1})):(_.openBlock(),_.createElementBlock("table",OU,[_.createElementVNode("thead",zU,[_.createElementVNode("tr",NU,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(a.columns,Mt=>(_.openBlock(),_.createBlock(j,{key:Mt.name,data:Mt,activeColumn:r.activeColumn,onChangeActive:a.changeActiveColumn},null,8,["data","activeColumn","onChangeActive"]))),128)),e[6]||(e[6]=_.createElementVNode("th",{class:"w-[70px] sticky right-0 top-0 bg-white"},null,-1))])]),_.createElementVNode("tbody",RU,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList((Kt=r.tableData)==null?void 0:Kt.rows,(Mt,En)=>{var dn,ti,Rn;return _.openBlock(),_.createElementBlock("tr",{key:En},[_.createElementVNode("td",BU,[_.createElementVNode("button",{onClick:()=>a.pushToCard(Mt==null?void 0:Mt.id),class:_.normalizeClass(["text-sm font-medium",[((dn=r.tableData)==null?void 0:dn.card)===!1?"":"text-blue-600 decoration-2 focus:outline-none focus:underline hover:text-blue-600 hover:underline"]])},[_.createVNode(G,{row:Mt,column:a.columns[0],table:n.table,onUpdateTable:a.getTableData},null,8,["row","column","table","onUpdateTable"])],10,LU)]),(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList((ti=a.columns)==null?void 0:ti.slice(1),Pn=>(_.openBlock(),_.createElementBlock("td",{onClick:qn=>a.changeActiveCardInfo(Mt==null?void 0:Mt.id),class:_.normalizeClass(["text-start px-3 py-3 text-sm text-gray-600 whitespace-nowrap",{"cursor-pointer":r.isVisibleCardInfo}]),key:Pn.name},[_.createVNode(G,{row:Mt,column:Pn,table:n.table,onUpdateTable:a.getTableData},null,8,["row","column","table","onUpdateTable"])],10,VU))),128)),(Rn=a.getActions)!=null&&Rn.length?(_.openBlock(),_.createElementBlock("td",FU,[_.createVNode(ie,{actions:a.getActions,isForm:a.isForm,item:Mt,table:n.table,onUpdateTable:a.getTableData},null,8,["actions","isForm","item","table","onUpdateTable"])])):_.createCommentVNode("",!0)])}),128))])]))])],4)],2),_.createElementVNode("div",$U,[r.limit?(_.openBlock(),_.createBlock(J,{key:0,goTo:!1,class:"justify-end","default-page":a.defaultPage,total:((Sn=r.tableData)==null?void 0:Sn.total)||0,pageSize:parseInt(r.limit),onPageChange:a.handlePageChange,pageSizes:[10,16,20],onPageSizeChange:a.changeLimit},null,8,["default-page","total","pageSize","onPageChange","onPageSizeChange"])):_.createCommentVNode("",!0)])],2),_.createVNode(_.Transition,{name:"slide-fade"},{default:_.withCtx(()=>[r.isVisibleCardInfo?(_.openBlock(),_.createBlock(Ce,{key:0,table:n.table,columns:a.columns,row:a.activeCardRow},null,8,["table","columns","row"])):_.createCommentVNode("",!0)]),_:1})])])])])}const UU={components:{AdminTable:Ge(SU,[["render",jU],["__scopeId","data-v-f40661d7"]])},data(){return{table:!1,interface:"",title:""}},watch:{$route:{async handler(){Xr!=null&&Xr.value||await this.getMenu(),await this.checkPageType()},deep:!0},title(t){t&&(document.title=t)}},async mounted(){await this.checkPageType()},methods:{flattenMenu(t){const e=[];return t.forEach(n=>{n.menu?e.push(...this.flattenMenu(n.menu)):e.push(n)}),e},async checkPageType(){var i,r;const t=this.flattenMenu(Xr.value);t!=null&&t.length||this.$router.replace("/404");const e=t==null?void 0:t.find(a=>{var u,l;return(a==null?void 0:a.path)==((l=(u=this.$route)==null?void 0:u.params)==null?void 0:l.catchAll)});this.title=e==null?void 0:e.ua,e||this.$router.replace("/404"),e!=null&&e.component&&this.$router.replace((r=(i=this.$route)==null?void 0:i.params)==null?void 0:r.catchAll);const n=e==null?void 0:e.table;this.table=n||!1,!n&&this.getInterface()},async getInterface(){var t,e;try{const{data:n}=await vt.get(`/api/template/interface/${((e=(t=this.$route)==null?void 0:t.params)==null?void 0:e.catchAll)||""}`);this.interface=n||""}catch{this.interface=""}}}},HU=["innerHTML"];function qU(t,e,n,i,r,a){const u=_.resolveComponent("AdminTable");return r.table?(_.openBlock(),_.createBlock(u,{key:0,table:r.table,title:r.title},null,8,["table","title"])):(_.openBlock(),_.createElementBlock("div",{key:1,class:"w-full bg-gray-50",style:{height:"calc(100vh - 120px)"},innerHTML:r.interface},null,8,HU))}const WU=Object.freeze(Object.defineProperty({__proto__:null,default:Ge(UU,[["render",qU]])},Symbol.toStringTag,{value:"Module"}));return D8});