@opengis/cms 0.0.31 → 0.0.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -224,9 +224,9 @@ ${u}`:c)}else throw s},onCacheKey:s=>Xi(t,a,s)}}function Md(l){if(J(l))return l;
224
224
  * (c) 2025 kazuya kawaguchi
225
225
  * Released under the MIT License.
226
226
  */const jd="11.1.5";function zd(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(ol().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(ol().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(ol().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(ol().__INTLIFY_PROD_DEVTOOLS__=!1)}const Me={UNEXPECTED_RETURN_TYPE:Xc,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:30,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32,NOT_COMPATIBLE_LEGACY_VUE_I18N:33,NOT_AVAILABLE_COMPOSITION_IN_LEGACY:34};function ct(l,...t){return El(l,null,process.env.NODE_ENV!=="production"?{messages:Hd,args:t}:void 0)}const Hd={[Me.UNEXPECTED_RETURN_TYPE]:"Unexpected return type in composer",[Me.INVALID_ARGUMENT]:"Invalid argument",[Me.MUST_BE_CALL_SETUP_TOP]:"Must be called at the top of a `setup` function",[Me.NOT_INSTALLED]:"Need to install with `app.use` function",[Me.UNEXPECTED_ERROR]:"Unexpected error",[Me.REQUIRED_VALUE]:"Required in value: {0}",[Me.INVALID_VALUE]:"Invalid value",[Me.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN]:"Cannot setup vue-devtools plugin",[Me.NOT_INSTALLED_WITH_PROVIDE]:"Need to install with `provide` function",[Me.NOT_COMPATIBLE_LEGACY_VUE_I18N]:"Not compatible legacy VueI18n.",[Me.NOT_AVAILABLE_COMPOSITION_IN_LEGACY]:"Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly"},xr=St("__translateVNode"),wr=St("__datetimeParts"),_r=St("__numberParts"),il=St("__enableEmitter"),jl=St("__disableEmitter"),Co=St("__setPluralRules"),Vo=St("__injectWithOption"),Er=St("__dispose"),At={FALLBACK_TO_ROOT:cd,NOT_FOUND_PARENT_SCOPE:9,IGNORE_OBJ_FLATTEN:10,DEPRECATE_LEGACY_MODE:11,DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE:12},qd={[At.FALLBACK_TO_ROOT]:"Fall back to {type} '{key}' with root locale.",[At.NOT_FOUND_PARENT_SCOPE]:"Not found parent scope. use the global scope.",[At.IGNORE_OBJ_FLATTEN]:"Ignore object flatten: '{key}' key has an string value",[At.DEPRECATE_LEGACY_MODE]:`Legacy API mode has been deprecated in v11. Use Composition API mode instead.
227
- About how to use the Composition API mode, see https://vue-i18n.intlify.dev/guide/advanced/composition.html`,[At.DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE]:"'v-t' has been deprecated in v11. Use translate APIs ('t' or '$t') instead."};function zl(l,...t){return ha(qd[l],...t)}function Hl(l){if(!Ee(l)||kt(l))return l;for(const t in l)if(Vt(l,t))if(!t.includes("."))Ee(l[t])&&Hl(l[t]);else{const a=t.split("."),r=a.length-1;let n=l,o=!1;for(let s=0;s<r;s++){if(a[s]==="__proto__")throw new Error(`unsafe key: ${a[s]}`);if(a[s]in n||(n[a[s]]=Se()),!Ee(n[a[s]])){process.env.NODE_ENV!=="production"&&Wt(zl(At.IGNORE_OBJ_FLATTEN,{key:a[s]})),o=!0;break}n=n[a[s]]}if(o||(kt(n)?Wn.includes(a[r])||delete l[t]:(n[a[r]]=l[t],delete l[t])),!kt(n)){const s=n[a[r]];Ee(s)&&Hl(s)}}return l}function Cr(l,t){const{messages:a,__i18n:r,messageResolver:n,flatJson:o}=t,s=ke(a)?a:Pe(r)?Se():{[l]:Se()};if(Pe(r)&&r.forEach(i=>{if("locale"in i&&"resource"in i){const{locale:c,resource:u}=i;c?(s[c]=s[c]||Se(),ya(u,s[c])):ya(u,s)}else J(i)&&ya(JSON.parse(i),s)}),n==null&&o)for(const i in s)Vt(s,i)&&Hl(s[i]);return s}function No(l){return l.type}function vo(l,t,a){let r=Ee(t.messages)?t.messages:Se();"__i18nGlobal"in a&&(r=Cr(l.locale.value,{messages:r,__i18n:a.__i18nGlobal}));const n=Object.keys(r);n.length&&n.forEach(o=>{l.mergeLocaleMessage(o,r[o])});{if(Ee(t.datetimeFormats)){const o=Object.keys(t.datetimeFormats);o.length&&o.forEach(s=>{l.mergeDateTimeFormat(s,t.datetimeFormats[s])})}if(Ee(t.numberFormats)){const o=Object.keys(t.numberFormats);o.length&&o.forEach(s=>{l.mergeNumberFormat(s,t.numberFormats[s])})}}}function Bo(l){return e.createVNode(e.Text,null,l,0)}const So="__INTLIFY_META__",Do=()=>[],Gd=()=>!1;let Ao=0;function Mo(l){return(t,a,r,n)=>l(a,r,e.getCurrentInstance()||void 0,n)}const Wd=()=>{const l=e.getCurrentInstance();let t=null;return l&&(t=No(l)[So])?{[So]:t}:null};function Vr(l={}){const{__root:t,__injectWithOption:a}=l,r=t===void 0,n=l.flatJson,o=Ct?e.ref:e.shallowRef;let s=Ce(l.inheritLocale)?l.inheritLocale:!0;const i=o(t&&s?t.locale.value:J(l.locale)?l.locale:Rl),c=o(t&&s?t.fallbackLocale.value:J(l.fallbackLocale)||Pe(l.fallbackLocale)||ke(l.fallbackLocale)||l.fallbackLocale===!1?l.fallbackLocale:i.value),u=o(Cr(i.value,l)),d=o(ke(l.datetimeFormats)?l.datetimeFormats:{[i.value]:{}}),m=o(ke(l.numberFormats)?l.numberFormats:{[i.value]:{}});let f=t?t.missingWarn:Ce(l.missingWarn)||_l(l.missingWarn)?l.missingWarn:!0,p=t?t.fallbackWarn:Ce(l.fallbackWarn)||_l(l.fallbackWarn)?l.fallbackWarn:!0,y=t?t.fallbackRoot:Ce(l.fallbackRoot)?l.fallbackRoot:!0,h=!!l.fallbackFormat,g=De(l.missing)?l.missing:null,b=De(l.missing)?Mo(l.missing):null,w=De(l.postTranslation)?l.postTranslation:null,x=t?t.warnHtmlMessage:Ce(l.warnHtmlMessage)?l.warnHtmlMessage:!0,k=!!l.escapeParameter;const _=t?t.modifiers:ke(l.modifiers)?l.modifiers:{};let N=l.pluralRules||t&&t.pluralRules,V;V=(()=>{r&&no(null);const O={version:jd,locale:i.value,fallbackLocale:c.value,messages:u.value,modifiers:_,pluralRules:N,missing:b===null?void 0:b,missingWarn:f,fallbackWarn:p,fallbackFormat:h,unresolving:!0,postTranslation:w===null?void 0:w,warnHtmlMessage:x,escapeParameter:k,messageResolver:l.messageResolver,messageCompiler:l.messageCompiler,__meta:{framework:"vue"}};O.datetimeFormats=d.value,O.numberFormats=m.value,O.__datetimeFormatters=ke(V)?V.__datetimeFormatters:void 0,O.__numberFormatters=ke(V)?V.__numberFormatters:void 0,process.env.NODE_ENV!=="production"&&(O.__v_emitter=ke(V)?V.__v_emitter:void 0);const G=kd(O);return r&&no(G),G})(),Ul(V,i.value,c.value);function $(){return[i.value,c.value,u.value,d.value,m.value]}const M=e.computed({get:()=>i.value,set:O=>{V.locale=O,i.value=O}}),A=e.computed({get:()=>c.value,set:O=>{V.fallbackLocale=O,c.value=O,Ul(V,i.value,O)}}),q=e.computed(()=>u.value),Q=e.computed(()=>d.value),R=e.computed(()=>m.value);function I(){return De(w)?w:null}function F(O){w=O,V.postTranslation=O}function D(){return g}function z(O){O!==null&&(b=Mo(O)),g=O,V.missing=b}function ee(O,G){return O!=="translate"||!G.resolvedMessage}const me=(O,G,ye,Be,E,S)=>{$();let j;try{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,r||(V.fallbackContext=t?yd():void 0),j=O(V)}finally{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,r||(V.fallbackContext=void 0)}if(ye!=="translate exists"&&ze(j)&&j===wa||ye==="translate exists"&&!j){const[W,Z]=G();if(process.env.NODE_ENV!=="production"&&t&&J(W)&&ee(ye,Z)&&(y&&(Ea(p,W)||so(f,W))&&Wt(zl(At.FALLBACK_TO_ROOT,{key:W,type:ye})),process.env.NODE_ENV!=="production")){const{__v_emitter:B}=V;B&&y&&B.emit("fallback",{type:ye,key:W,to:"global",groupId:`${ye}:${W}`})}return t&&y?Be(t):E(W)}else{if(S(j))return j;throw ct(Me.UNEXPECTED_RETURN_TYPE)}};function Ne(...O){return me(G=>Reflect.apply(xo,null,[G,...O]),()=>yr(...O),"translate",G=>Reflect.apply(G.t,G,[...O]),G=>G,G=>J(G))}function Ke(...O){const[G,ye,Be]=O;if(Be&&!Ee(Be))throw ct(Me.INVALID_ARGUMENT);return Ne(G,ye,Ge({resolvedMessage:!0},Be||{}))}function qt(...O){return me(G=>Reflect.apply(mo,null,[G,...O]),()=>gr(...O),"datetime format",G=>Reflect.apply(G.d,G,[...O]),()=>_a,G=>J(G)||Pe(G))}function Re(...O){return me(G=>Reflect.apply(ho,null,[G,...O]),()=>br(...O),"number format",G=>Reflect.apply(G.n,G,[...O]),()=>_a,G=>J(G)||Pe(G))}function Ye(O){return O.map(G=>J(G)||ze(G)||Ce(G)?Bo(String(G)):G)}const yt={normalize:Ye,interpolate:O=>O,type:"vnode"};function Et(...O){return me(G=>{let ye;const Be=G;try{Be.processor=yt,ye=Reflect.apply(xo,null,[Be,...O])}finally{Be.processor=null}return ye},()=>yr(...O),"translate",G=>G[xr](...O),G=>[Bo(G)],G=>Pe(G))}function Pt(...O){return me(G=>Reflect.apply(ho,null,[G,...O]),()=>br(...O),"number format",G=>G[_r](...O),Do,G=>J(G)||Pe(G))}function at(...O){return me(G=>Reflect.apply(mo,null,[G,...O]),()=>gr(...O),"datetime format",G=>G[wr](...O),Do,G=>J(G)||Pe(G))}function st(O){N=O,V.pluralRules=N}function U(O,G){return me(()=>{if(!O)return!1;const ye=J(G)?G:i.value,Be=ae(ye),E=V.messageResolver(Be,O);return kt(E)||xt(E)||J(E)},()=>[O],"translate exists",ye=>Reflect.apply(ye.te,ye,[O,G]),Gd,ye=>Ce(ye))}function Y(O){let G=null;const ye=Xn(V,c.value,i.value);for(let Be=0;Be<ye.length;Be++){const E=u.value[ye[Be]]||{},S=V.messageResolver(E,O);if(S!=null){G=S;break}}return G}function le(O){const G=Y(O);return G??(t?t.tm(O)||{}:{})}function ae(O){return u.value[O]||{}}function de(O,G){if(n){const ye={[O]:G};for(const Be in ye)Vt(ye,Be)&&Hl(ye[Be]);G=ye[O]}u.value[O]=G,V.messages=u.value}function Ae(O,G){u.value[O]=u.value[O]||{};const ye={[O]:G};if(n)for(const Be in ye)Vt(ye,Be)&&Hl(ye[Be]);G=ye[O],ya(G,u.value[O]),V.messages=u.value}function C(O){return d.value[O]||{}}function v(O,G){d.value[O]=G,V.datetimeFormats=d.value,fo(V,O,G)}function H(O,G){d.value[O]=Ge(d.value[O]||{},G),V.datetimeFormats=d.value,fo(V,O,G)}function re(O){return m.value[O]||{}}function Te(O,G){m.value[O]=G,V.numberFormats=m.value,bo(V,O,G)}function Le(O,G){m.value[O]=Ge(m.value[O]||{},G),V.numberFormats=m.value,bo(V,O,G)}Ao++,t&&Ct&&(e.watch(t.locale,O=>{s&&(i.value=O,V.locale=O,Ul(V,i.value,c.value))}),e.watch(t.fallbackLocale,O=>{s&&(c.value=O,V.fallbackLocale=O,Ul(V,i.value,c.value))}));const be={id:Ao,locale:M,fallbackLocale:A,get inheritLocale(){return s},set inheritLocale(O){s=O,O&&t&&(i.value=t.locale.value,c.value=t.fallbackLocale.value,Ul(V,i.value,c.value))},get availableLocales(){return Object.keys(u.value).sort()},messages:q,get modifiers(){return _},get pluralRules(){return N||{}},get isGlobal(){return r},get missingWarn(){return f},set missingWarn(O){f=O,V.missingWarn=f},get fallbackWarn(){return p},set fallbackWarn(O){p=O,V.fallbackWarn=p},get fallbackRoot(){return y},set fallbackRoot(O){y=O},get fallbackFormat(){return h},set fallbackFormat(O){h=O,V.fallbackFormat=h},get warnHtmlMessage(){return x},set warnHtmlMessage(O){x=O,V.warnHtmlMessage=O},get escapeParameter(){return k},set escapeParameter(O){k=O,V.escapeParameter=O},t:Ne,getLocaleMessage:ae,setLocaleMessage:de,mergeLocaleMessage:Ae,getPostTranslationHandler:I,setPostTranslationHandler:F,getMissingHandler:D,setMissingHandler:z,[Co]:st};return be.datetimeFormats=Q,be.numberFormats=R,be.rt=Ke,be.te=U,be.tm=le,be.d=qt,be.n=Re,be.getDateTimeFormat=C,be.setDateTimeFormat=v,be.mergeDateTimeFormat=H,be.getNumberFormat=re,be.setNumberFormat=Te,be.mergeNumberFormat=Le,be[Vo]=a,be[xr]=Et,be[wr]=at,be[_r]=Pt,process.env.NODE_ENV!=="production"&&(be[il]=O=>{V.__v_emitter=O},be[jl]=()=>{V.__v_emitter=void 0}),be}const To="vue-i18n: composer properties",Nr={"vue-devtools-plugin-vue-i18n":"Vue I18n DevTools","vue-i18n-resource-inspector":"Vue I18n DevTools","vue-i18n-timeline":"Vue I18n"},Kd={"vue-i18n-resource-inspector":"Search for scopes ..."},Yd={"vue-i18n-timeline":16764185};let vr;async function Xd(l,t){return new Promise((a,r)=>{try{Ud({id:"vue-devtools-plugin-vue-i18n",label:Nr["vue-devtools-plugin-vue-i18n"],packageName:"vue-i18n",homepage:"https://vue-i18n.intlify.dev",logo:"https://vue-i18n.intlify.dev/vue-i18n-devtools-logo.png",componentStateTypes:[To],app:l},n=>{vr=n,n.on.visitComponentTree(({componentInstance:s,treeNode:i})=>{Zd(s,i,t)}),n.on.inspectComponent(({componentInstance:s,instanceData:i})=>{s.vnode.el&&s.vnode.el.__VUE_I18N__&&i&&(t.mode==="legacy"?s.vnode.el.__VUE_I18N__!==t.global.__composer&&$o(i,s.vnode.el.__VUE_I18N__):$o(i,s.vnode.el.__VUE_I18N__))}),n.addInspector({id:"vue-i18n-resource-inspector",label:Nr["vue-i18n-resource-inspector"],icon:"language",treeFilterPlaceholder:Kd["vue-i18n-resource-inspector"]}),n.on.getInspectorTree(s=>{s.app===l&&s.inspectorId==="vue-i18n-resource-inspector"&&lu(s,t)});const o=new Map;n.on.getInspectorState(async s=>{if(s.app===l&&s.inspectorId==="vue-i18n-resource-inspector")if(n.unhighlightElement(),ru(s,t),s.nodeId==="global"){if(!o.has(s.app)){const[i]=await n.getComponentInstances(s.app);o.set(s.app,i)}n.highlightElement(o.get(s.app))}else{const i=au(s.nodeId,t);i&&n.highlightElement(i)}}),n.on.editInspectorState(s=>{s.app===l&&s.inspectorId==="vue-i18n-resource-inspector"&&ou(s,t)}),n.addTimelineLayer({id:"vue-i18n-timeline",label:Nr["vue-i18n-timeline"],color:Yd["vue-i18n-timeline"]}),a(!0)})}catch(n){console.error(n),r(!1)}})}function Lo(l){return l.type.name||l.type.displayName||l.type.__file||"Anonymous"}function Zd(l,t,a){const r=a.mode==="composition"?a.global:a.global.__composer;if(l&&l.vnode.el&&l.vnode.el.__VUE_I18N__&&l.vnode.el.__VUE_I18N__!==r){const n={label:`i18n (${Lo(l)} Scope)`,textColor:0,backgroundColor:16764185};t.tags.push(n)}}function $o(l,t){const a=To;l.state.push({type:a,key:"locale",editable:!0,value:t.locale.value}),l.state.push({type:a,key:"availableLocales",editable:!1,value:t.availableLocales}),l.state.push({type:a,key:"fallbackLocale",editable:!0,value:t.fallbackLocale.value}),l.state.push({type:a,key:"inheritLocale",editable:!0,value:t.inheritLocale}),l.state.push({type:a,key:"messages",editable:!1,value:Br(t.messages.value)}),l.state.push({type:a,key:"datetimeFormats",editable:!1,value:t.datetimeFormats.value}),l.state.push({type:a,key:"numberFormats",editable:!1,value:t.numberFormats.value})}function Br(l){const t={};return Object.keys(l).forEach(a=>{const r=l[a];De(r)&&"source"in r?t[a]=tu(r):kt(r)&&r.loc&&r.loc.source?t[a]=r.loc.source:Ee(r)?t[a]=Br(r):t[a]=r}),t}const Qd={"<":"&lt;",">":"&gt;",'"':"&quot;","&":"&amp;"};function Jd(l){return l.replace(/[<>"&]/g,eu)}function eu(l){return Qd[l]||l}function tu(l){return{_custom:{type:"function",display:`<span>ƒ</span> ${l.source?`("${Jd(l.source)}")`:"(?)"}`}}}function lu(l,t){l.rootNodes.push({id:"global",label:"Global Scope"});const a=t.mode==="composition"?t.global:t.global.__composer;for(const[r,n]of t.__instances){const o=t.mode==="composition"?n:n.__composer;a!==o&&l.rootNodes.push({id:o.id.toString(),label:`${Lo(r)} Scope`})}}function au(l,t){let a=null;if(l!=="global"){for(const[r,n]of t.__instances.entries())if(n.id.toString()===l){a=r;break}}return a}function Fo(l,t){if(l==="global")return t.mode==="composition"?t.global:t.global.__composer;{const a=Array.from(t.__instances.values()).find(r=>r.id.toString()===l);return a?t.mode==="composition"?a:a.__composer:null}}function ru(l,t){const a=Fo(l.nodeId,t);return a&&(l.state=nu(a)),null}function nu(l){const t={},a="Locale related info",r=[{type:a,key:"locale",editable:!0,value:l.locale.value},{type:a,key:"fallbackLocale",editable:!0,value:l.fallbackLocale.value},{type:a,key:"availableLocales",editable:!1,value:l.availableLocales},{type:a,key:"inheritLocale",editable:!0,value:l.inheritLocale}];t[a]=r;const n="Locale messages info",o=[{type:n,key:"messages",editable:!1,value:Br(l.messages.value)}];t[n]=o;{const s="Datetime formats info",i=[{type:s,key:"datetimeFormats",editable:!1,value:l.datetimeFormats.value}];t[s]=i;const c="Datetime formats info",u=[{type:c,key:"numberFormats",editable:!1,value:l.numberFormats.value}];t[c]=u}return t}function ql(l,t){if(vr){let a;t&&"groupId"in t&&(a=t.groupId,delete t.groupId),vr.addTimelineEvent({layerId:"vue-i18n-timeline",event:{title:l,groupId:a,time:Date.now(),meta:{},data:t||{},logType:l==="compile-error"?"error":l==="fallback"||l==="missing"?"warning":"default"}})}}function ou(l,t){const a=Fo(l.nodeId,t);if(a){const[r]=l.path;r==="locale"&&J(l.state.value)?a.locale.value=l.state.value:r==="fallbackLocale"&&(J(l.state.value)||Pe(l.state.value)||Ee(l.state.value))?a.fallbackLocale.value=l.state.value:r==="inheritLocale"&&Ce(l.state.value)&&(a.inheritLocale=l.state.value)}}function su(l){const t=J(l.locale)?l.locale:Rl,a=J(l.fallbackLocale)||Pe(l.fallbackLocale)||ke(l.fallbackLocale)||l.fallbackLocale===!1?l.fallbackLocale:t,r=De(l.missing)?l.missing:void 0,n=Ce(l.silentTranslationWarn)||_l(l.silentTranslationWarn)?!l.silentTranslationWarn:!0,o=Ce(l.silentFallbackWarn)||_l(l.silentFallbackWarn)?!l.silentFallbackWarn:!0,s=Ce(l.fallbackRoot)?l.fallbackRoot:!0,i=!!l.formatFallbackMessages,c=ke(l.modifiers)?l.modifiers:{},u=l.pluralizationRules,d=De(l.postTranslation)?l.postTranslation:void 0,m=J(l.warnHtmlInMessage)?l.warnHtmlInMessage!=="off":!0,f=!!l.escapeParameterHtml,p=Ce(l.sync)?l.sync:!0;let y=l.messages;if(ke(l.sharedMessages)){const _=l.sharedMessages;y=Object.keys(_).reduce((V,P)=>{const $=V[P]||(V[P]={});return Ge($,_[P]),V},y||{})}const{__i18n:h,__root:g,__injectWithOption:b}=l,w=l.datetimeFormats,x=l.numberFormats,k=l.flatJson;return{locale:t,fallbackLocale:a,messages:y,flatJson:k,datetimeFormats:w,numberFormats:x,missing:r,missingWarn:n,fallbackWarn:o,fallbackRoot:s,fallbackFormat:i,modifiers:c,pluralRules:u,postTranslation:d,warnHtmlMessage:m,escapeParameter:f,messageResolver:l.messageResolver,inheritLocale:p,__i18n:h,__root:g,__injectWithOption:b}}function Sr(l={}){const t=Vr(su(l)),{__extender:a}=l,r={id:t.id,get locale(){return t.locale.value},set locale(n){t.locale.value=n},get fallbackLocale(){return t.fallbackLocale.value},set fallbackLocale(n){t.fallbackLocale.value=n},get messages(){return t.messages.value},get datetimeFormats(){return t.datetimeFormats.value},get numberFormats(){return t.numberFormats.value},get availableLocales(){return t.availableLocales},get missing(){return t.getMissingHandler()},set missing(n){t.setMissingHandler(n)},get silentTranslationWarn(){return Ce(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(n){t.missingWarn=Ce(n)?!n:n},get silentFallbackWarn(){return Ce(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(n){t.fallbackWarn=Ce(n)?!n:n},get modifiers(){return t.modifiers},get formatFallbackMessages(){return t.fallbackFormat},set formatFallbackMessages(n){t.fallbackFormat=n},get postTranslation(){return t.getPostTranslationHandler()},set postTranslation(n){t.setPostTranslationHandler(n)},get sync(){return t.inheritLocale},set sync(n){t.inheritLocale=n},get warnHtmlInMessage(){return t.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(n){t.warnHtmlMessage=n!=="off"},get escapeParameterHtml(){return t.escapeParameter},set escapeParameterHtml(n){t.escapeParameter=n},get pluralizationRules(){return t.pluralRules||{}},__composer:t,t(...n){return Reflect.apply(t.t,t,[...n])},rt(...n){return Reflect.apply(t.rt,t,[...n])},te(n,o){return t.te(n,o)},tm(n){return t.tm(n)},getLocaleMessage(n){return t.getLocaleMessage(n)},setLocaleMessage(n,o){t.setLocaleMessage(n,o)},mergeLocaleMessage(n,o){t.mergeLocaleMessage(n,o)},d(...n){return Reflect.apply(t.d,t,[...n])},getDateTimeFormat(n){return t.getDateTimeFormat(n)},setDateTimeFormat(n,o){t.setDateTimeFormat(n,o)},mergeDateTimeFormat(n,o){t.mergeDateTimeFormat(n,o)},n(...n){return Reflect.apply(t.n,t,[...n])},getNumberFormat(n){return t.getNumberFormat(n)},setNumberFormat(n,o){t.setNumberFormat(n,o)},mergeNumberFormat(n,o){t.mergeNumberFormat(n,o)}};return r.__extender=a,process.env.NODE_ENV!=="production"&&(r.__enableEmitter=n=>{const o=t;o[il]&&o[il](n)},r.__disableEmitter=()=>{const n=t;n[jl]&&n[jl]()}),r}function iu(l,t,a){return{beforeCreate(){const r=e.getCurrentInstance();if(!r)throw ct(Me.UNEXPECTED_ERROR);const n=this.$options;if(n.i18n){const o=n.i18n;if(n.__i18n&&(o.__i18n=n.__i18n),o.__root=t,this===this.$root)this.$i18n=Io(l,o);else{o.__injectWithOption=!0,o.__extender=a.__vueI18nExtend,this.$i18n=Sr(o);const s=this.$i18n;s.__extender&&(s.__disposer=s.__extender(this.$i18n))}}else if(n.__i18n)if(this===this.$root)this.$i18n=Io(l,n);else{this.$i18n=Sr({__i18n:n.__i18n,__injectWithOption:!0,__extender:a.__vueI18nExtend,__root:t});const o=this.$i18n;o.__extender&&(o.__disposer=o.__extender(this.$i18n))}else this.$i18n=l;n.__i18nGlobal&&vo(t,n,n),this.$t=(...o)=>this.$i18n.t(...o),this.$rt=(...o)=>this.$i18n.rt(...o),this.$te=(o,s)=>this.$i18n.te(o,s),this.$d=(...o)=>this.$i18n.d(...o),this.$n=(...o)=>this.$i18n.n(...o),this.$tm=o=>this.$i18n.tm(o),a.__setInstance(r,this.$i18n)},mounted(){if(process.env.NODE_ENV!=="production"&&this.$el&&this.$i18n){const r=this.$i18n;this.$el.__VUE_I18N__=r.__composer;const n=this.__v_emitter=or();r.__enableEmitter&&r.__enableEmitter(n),n.on("*",ql)}},unmounted(){const r=e.getCurrentInstance();if(!r)throw ct(Me.UNEXPECTED_ERROR);const n=this.$i18n;process.env.NODE_ENV!=="production"&&this.$el&&this.$el.__VUE_I18N__&&(this.__v_emitter&&(this.__v_emitter.off("*",ql),delete this.__v_emitter),this.$i18n&&(n.__disableEmitter&&n.__disableEmitter(),delete this.$el.__VUE_I18N__)),delete this.$t,delete this.$rt,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,n.__disposer&&(n.__disposer(),delete n.__disposer,delete n.__extender),a.__deleteInstance(r),delete this.$i18n}}}function Io(l,t){l.locale=t.locale||l.locale,l.fallbackLocale=t.fallbackLocale||l.fallbackLocale,l.missing=t.missing||l.missing,l.silentTranslationWarn=t.silentTranslationWarn||l.silentFallbackWarn,l.silentFallbackWarn=t.silentFallbackWarn||l.silentFallbackWarn,l.formatFallbackMessages=t.formatFallbackMessages||l.formatFallbackMessages,l.postTranslation=t.postTranslation||l.postTranslation,l.warnHtmlInMessage=t.warnHtmlInMessage||l.warnHtmlInMessage,l.escapeParameterHtml=t.escapeParameterHtml||l.escapeParameterHtml,l.sync=t.sync||l.sync,l.__composer[Co](t.pluralizationRules||l.pluralizationRules);const a=Cr(l.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(a).forEach(r=>l.mergeLocaleMessage(r,a[r])),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach(r=>l.mergeDateTimeFormat(r,t.datetimeFormats[r])),t.numberFormats&&Object.keys(t.numberFormats).forEach(r=>l.mergeNumberFormat(r,t.numberFormats[r])),l}const Dr={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:l=>l==="parent"||l==="global",default:"parent"},i18n:{type:Object}};function cu({slots:l},t){return t.length===1&&t[0]==="default"?(l.default?l.default():[]).reduce((r,n)=>[...r,...n.type===e.Fragment?n.children:[n]],[]):t.reduce((a,r)=>{const n=l[r];return n&&(a[r]=n()),a},Se())}function Oo(){return e.Fragment}const Po=e.defineComponent({name:"i18n-t",props:Ge({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:l=>ze(l)||!isNaN(l)}},Dr),setup(l,t){const{slots:a,attrs:r}=t,n=l.i18n||Fe({useScope:l.scope,__useComponent:!0});return()=>{const o=Object.keys(a).filter(m=>m[0]!=="_"),s=Se();l.locale&&(s.locale=l.locale),l.plural!==void 0&&(s.plural=J(l.plural)?+l.plural:l.plural);const i=cu(t,o),c=n[xr](l.keypath,i,s),u=Ge(Se(),r),d=J(l.tag)||Ee(l.tag)?l.tag:Oo();return e.h(d,u,c)}}});function du(l){return Pe(l)&&!J(l[0])}function Ro(l,t,a,r){const{slots:n,attrs:o}=t;return()=>{const s={part:!0};let i=Se();l.locale&&(s.locale=l.locale),J(l.format)?s.key=l.format:Ee(l.format)&&(J(l.format.key)&&(s.key=l.format.key),i=Object.keys(l.format).reduce((f,p)=>a.includes(p)?Ge(Se(),f,{[p]:l.format[p]}):f,Se()));const c=r(l.value,s,i);let u=[s.key];Pe(c)?u=c.map((f,p)=>{const y=n[f.type],h=y?y({[f.type]:f.value,index:p,parts:c}):[f.value];return du(h)&&(h[0].key=`${f.type}-${p}`),h}):J(c)&&(u=[c]);const d=Ge(Se(),o),m=J(l.tag)||Ee(l.tag)?l.tag:Oo();return e.h(m,d,u)}}const Uo=e.defineComponent({name:"i18n-n",props:Ge({value:{type:Number,required:!0},format:{type:[String,Object]}},Dr),setup(l,t){const a=l.i18n||Fe({useScope:l.scope,__useComponent:!0});return Ro(l,t,go,(...r)=>a[_r](...r))}});function uu(l,t){const a=l;if(l.mode==="composition")return a.__getInstance(t)||l.global;{const r=a.__getInstance(t);return r!=null?r.__composer:l.global.__composer}}function mu(l){const t=s=>{process.env.NODE_ENV!=="production"&&nr(zl(At.DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE));const{instance:i,value:c}=s;if(!i||!i.$)throw ct(Me.UNEXPECTED_ERROR);const u=uu(l,i.$),d=jo(c);return[Reflect.apply(u.t,u,[...zo(d)]),u]};return{created:(s,i)=>{const[c,u]=t(i);Ct&&l.global===u&&(s.__i18nWatcher=e.watch(u.locale,()=>{i.instance&&i.instance.$forceUpdate()})),s.__composer=u,s.textContent=c},unmounted:s=>{Ct&&s.__i18nWatcher&&(s.__i18nWatcher(),s.__i18nWatcher=void 0,delete s.__i18nWatcher),s.__composer&&(s.__composer=void 0,delete s.__composer)},beforeUpdate:(s,{value:i})=>{if(s.__composer){const c=s.__composer,u=jo(i);s.textContent=Reflect.apply(c.t,c,[...zo(u)])}},getSSRProps:s=>{const[i]=t(s);return{textContent:i}}}}function jo(l){if(J(l))return{path:l};if(ke(l)){if(!("path"in l))throw ct(Me.REQUIRED_VALUE,"path");return l}else throw ct(Me.INVALID_VALUE)}function zo(l){const{path:t,locale:a,args:r,choice:n,plural:o}=l,s={},i=r||{};return J(a)&&(s.locale=a),ze(n)&&(s.plural=n),ze(o)&&(s.plural=o),[t,i,s]}function pu(l,t,...a){const r=ke(a[0])?a[0]:{};(Ce(r.globalInstall)?r.globalInstall:!0)&&([Po.name,"I18nT"].forEach(o=>l.component(o,Po)),[Uo.name,"I18nN"].forEach(o=>l.component(o,Uo)),[qo.name,"I18nD"].forEach(o=>l.component(o,qo))),l.directive("t",mu(t))}const fu=St("global-vue-i18n");function hu(l={}){const t=__VUE_I18N_LEGACY_API__&&Ce(l.legacy)?l.legacy:__VUE_I18N_LEGACY_API__;process.env.NODE_ENV!=="production"&&t&&nr(zl(At.DEPRECATE_LEGACY_MODE));const a=Ce(l.globalInjection)?l.globalInjection:!0,r=new Map,[n,o]=gu(l,t),s=St(process.env.NODE_ENV!=="production"?"vue-i18n":"");function i(m){return r.get(m)||null}function c(m,f){r.set(m,f)}function u(m){r.delete(m)}const d={get mode(){return __VUE_I18N_LEGACY_API__&&t?"legacy":"composition"},async install(m,...f){if(process.env.NODE_ENV!=="production"&&(m.__VUE_I18N__=d),m.__VUE_I18N_SYMBOL__=s,m.provide(m.__VUE_I18N_SYMBOL__,d),ke(f[0])){const h=f[0];d.__composerExtend=h.__composerExtend,d.__vueI18nExtend=h.__vueI18nExtend}let p=null;!t&&a&&(p=Cu(m,d.global)),__VUE_I18N_FULL_INSTALL__&&pu(m,d,...f),__VUE_I18N_LEGACY_API__&&t&&m.mixin(iu(o,o.__composer,d));const y=m.unmount;if(m.unmount=()=>{p&&p(),d.dispose(),y()},process.env.NODE_ENV!=="production"){if(!await Xd(m,d))throw ct(Me.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN);const g=or();if(t){const b=o;b.__enableEmitter&&b.__enableEmitter(g)}else{const b=o;b[il]&&b[il](g)}g.on("*",ql)}},get global(){return o},dispose(){n.stop()},__instances:r,__getInstance:i,__setInstance:c,__deleteInstance:u};return d}function Fe(l={}){const t=e.getCurrentInstance();if(t==null)throw ct(Me.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw ct(Me.NOT_INSTALLED);const a=bu(t),r=ku(a),n=No(t),o=yu(l,n);if(o==="global")return vo(r,l,n),r;if(o==="parent"){let c=xu(a,t,l.__useComponent);return c==null&&(process.env.NODE_ENV!=="production"&&Wt(zl(At.NOT_FOUND_PARENT_SCOPE)),c=r),c}const s=a;let i=s.__getInstance(t);if(i==null){const c=Ge({},l);"__i18n"in n&&(c.__i18n=n.__i18n),r&&(c.__root=r),i=Vr(c),s.__composerExtend&&(i[Er]=s.__composerExtend(i)),_u(s,t,i),s.__setInstance(t,i)}return i}function gu(l,t){const a=e.effectScope(),r=__VUE_I18N_LEGACY_API__&&t?a.run(()=>Sr(l)):a.run(()=>Vr(l));if(r==null)throw ct(Me.UNEXPECTED_ERROR);return[a,r]}function bu(l){const t=e.inject(l.isCE?fu:l.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw ct(l.isCE?Me.NOT_INSTALLED_WITH_PROVIDE:Me.UNEXPECTED_ERROR);return t}function yu(l,t){return ga(l)?"__i18n"in t?"local":"global":l.useScope?l.useScope:"local"}function ku(l){return l.mode==="composition"?l.global:l.global.__composer}function xu(l,t,a=!1){let r=null;const n=t.root;let o=wu(t,a);for(;o!=null;){const s=l;if(l.mode==="composition")r=s.__getInstance(o);else if(__VUE_I18N_LEGACY_API__){const i=s.__getInstance(o);i!=null&&(r=i.__composer,a&&r&&!r[Vo]&&(r=null))}if(r!=null||n===o)break;o=o.parent}return r}function wu(l,t=!1){return l==null?null:t&&l.vnode.ctx||l.parent}function _u(l,t,a){let r=null;e.onMounted(()=>{if(process.env.NODE_ENV!=="production"&&t.vnode.el){t.vnode.el.__VUE_I18N__=a,r=or();const n=a;n[il]&&n[il](r),r.on("*",ql)}},t),e.onUnmounted(()=>{const n=a;process.env.NODE_ENV!=="production"&&t.vnode.el&&t.vnode.el.__VUE_I18N__&&(r&&r.off("*",ql),n[jl]&&n[jl](),delete t.vnode.el.__VUE_I18N__),l.__deleteInstance(t);const o=n[Er];o&&(o(),delete n[Er])},t)}const Eu=["locale","fallbackLocale","availableLocales"],Ho=["t","rt","d","n","tm","te"];function Cu(l,t){const a=Object.create(null);return Eu.forEach(n=>{const o=Object.getOwnPropertyDescriptor(t,n);if(!o)throw ct(Me.UNEXPECTED_ERROR);const s=e.isRef(o.value)?{get(){return o.value.value},set(i){o.value.value=i}}:{get(){return o.get&&o.get()}};Object.defineProperty(a,n,s)}),l.config.globalProperties.$i18n=a,Ho.forEach(n=>{const o=Object.getOwnPropertyDescriptor(t,n);if(!o||!o.value)throw ct(Me.UNEXPECTED_ERROR);Object.defineProperty(l.config.globalProperties,`$${n}`,o)}),()=>{delete l.config.globalProperties.$i18n,Ho.forEach(n=>{delete l.config.globalProperties[`$${n}`]})}}const qo=e.defineComponent({name:"i18n-d",props:Ge({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},Dr),setup(l,t){const a=l.i18n||Fe({useScope:l.scope,__useComponent:!0});return Ro(l,t,po,(...r)=>a[wr](...r))}});if(zd(),pd(qc),fd(id),hd(Xn),process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__){const l=ol();l.__INTLIFY__=!0,Gc(l.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}process.env.NODE_ENV;const Vu={class:"flex items-center justify-between"},Nu={class:"flex items-center gap-2"},vu={class:"text-4xl font-bold text-slate-800 dark:text-slate-100 mb-2"},Bu=["href","title"],Su={class:"text-lg text-slate-600 dark:text-slate-300"},Du=e.defineComponent({__name:"DashboardHeader",setup(l){const{locale:t}=Fe();return(a,r)=>{const n=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("div",Vu,[e.createElementVNode("div",null,[e.createElementVNode("div",Nu,[e.createElementVNode("h1",vu,e.toDisplayString(a.$t("cms.dashboard.title")),1),e.createElementVNode("a",{href:`https://cms.opengis.info/${e.unref(t)}/get-started/app-overview`,target:"_blank",title:a.$t("cms.guide.appOverview")},[e.createVNode(e.unref(kl),{class:"w-5 h-5"})],8,Bu)]),e.createElementVNode("div",Su,e.toDisplayString(a.$t("cms.dashboard.description")),1)]),e.createElementVNode("div",null,[e.createVNode(n,{to:"/settings/collections",class:"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 shadow h-9 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white"},{default:e.withCtx(()=>[e.createVNode(e.unref(rl),{class:"w-4 h-4 mr-2"}),e.createTextVNode(" "+e.toDisplayString(a.$t("cms.dashboard.newCollection")),1)]),_:1})])])}}}),Au={class:"rounded-xl text-card-foreground shadow-lg border-0 bg-white dark:bg-slate-800 backdrop-blur-sm hover:shadow-xl transition-all duration-300 transform hover:scale-105"},Mu={class:"p-6"},Tu={class:"flex items-start justify-between"},Lu={class:"flex-1"},$u={class:"flex items-center space-x-2 mb-2"},Fu={class:"text-sm font-medium text-slate-600 dark:text-slate-400"},Iu={class:"text-3xl font-bold text-slate-800 dark:text-slate-100 mb-1"},Ou={class:"text-xs text-slate-500 dark:text-slate-400 mb-3"},Pu=e.defineComponent({__name:"StatCard",props:{stat:{}},setup(l){const t=a=>({"file-text":Il,users:lr,image:ma,eye:Ja})[a]||Il;return(a,r)=>(e.openBlock(),e.createElementBlock("div",Au,[e.createElementVNode("div",Mu,[e.createElementVNode("div",Tu,[e.createElementVNode("div",Lu,[e.createElementVNode("div",$u,[e.createElementVNode("div",{class:e.normalizeClass(`p-2 rounded-lg bg-${a.stat.color}-50 dark:bg-${a.stat.color}-900/20`)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t(a.stat.icon)),{class:e.normalizeClass(`w-5 h-5 text-${a.stat.color}-600`)},null,8,["class"]))],2),e.createElementVNode("p",Fu,e.toDisplayString(a.stat.title),1)]),e.createElementVNode("p",Iu,e.toDisplayString(a.stat.value),1),e.createElementVNode("p",Ou,e.toDisplayString(a.stat.description),1)])])])]))}}),Ru={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6"},Uu=e.defineComponent({__name:"StatsGrid",props:{stats:{}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",Ru,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.stats,r=>(e.openBlock(),e.createBlock(Pu,{key:r.id,stat:r},null,8,["stat"]))),128))]))}}),ju={class:"p-4 hover:bg-slate-50 dark:hover:bg-slate-700/50 transition-colors"},zu={class:"flex items-center justify-between"},Hu={class:"flex-1"},qu={class:"flex items-center space-x-3 mb-2"},Gu={class:"inline-flex items-center rounded-md border px-2.5 py-0.5 font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 text-xs bg-white dark:bg-slate-700 border-slate-300 dark:border-slate-600 text-slate-600 dark:text-slate-300"},Wu={class:"font-semibold text-slate-800 dark:text-slate-100 mb-1"},Ku={class:"flex items-center space-x-4 text-sm text-slate-500 dark:text-slate-400"},Yu={class:"flex items-center"},Xu={class:"flex items-center"},Zu={class:"flex items-center"},Qu={class:"flex items-center space-x-2"},Ju=e.defineComponent({__name:"ContentItem",props:{item:{}},setup(l){const t=r=>{const n={published:"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent hover:bg-secondary/80 bg-green-100 dark:bg-green-900/30 text-green-800 dark:text-green-300",draft:"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent hover:bg-secondary/80 bg-yellow-100 dark:bg-yellow-900/30 text-yellow-800 dark:text-yellow-300",review:"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent hover:bg-secondary/80 bg-blue-100 dark:bg-blue-900/30 text-blue-800 dark:text-blue-300"};return n[r]||n.draft},a=r=>{if(!r)return"--.--.--";const n=new Date(r);return new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}).format(n)};return(r,n)=>{const o=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("div",ju,[e.createElementVNode("div",zu,[e.createElementVNode("div",Hu,[e.createElementVNode("div",qu,[e.createElementVNode("div",Gu,e.toDisplayString(r.item.type),1),e.createElementVNode("div",{class:e.normalizeClass(t(r.item.status))},e.toDisplayString(r.item.status||"--"),3)]),e.createElementVNode("h3",Wu,e.toDisplayString(r.item.title||"--"),1),e.createElementVNode("div",Ku,[e.createElementVNode("span",Yu,[e.createVNode(e.unref(lr),{class:"w-4 h-4 mr-1"}),e.createTextVNode(" "+e.toDisplayString(r.item.author||"--"),1)]),e.createElementVNode("span",Xu,[e.createVNode(e.unref(ua),{class:"w-4 h-4 mr-1"}),e.createTextVNode(" "+e.toDisplayString(a(r.item.updated_at)||"--.--.--"),1)]),e.createElementVNode("span",Zu,[e.createVNode(e.unref(Ja),{class:"w-4 h-4 mr-1"}),e.createTextVNode(" "+e.toDisplayString(r.item.views||"--")+" "+e.toDisplayString(r.$t("cms.dashboard.views")),1)])])]),e.createElementVNode("div",Qu,[e.createVNode(o,{to:`/collections/${r.item.object_id}/${r.item.content_id}`,class:"inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors border shadow-sm rounded-md text-xs h-8 w-8 p-0 bg-white border-slate-300 hover:text-accent-foreground hover:bg-slate-50 dark:border-slate-600 dark:bg-slate-700 dark:hover:bg-slate-600"},{default:e.withCtx(()=>[e.createVNode(e.unref(wl),{class:"w-4 h-4 dark:text-blue-50"})]),_:1},8,["to"])])])])}}}),em={class:"lg:col-span-2"},tm={class:"rounded-xl text-card-foreground shadow-lg border-0 bg-white dark:bg-slate-800 backdrop-blur-sm"},lm={class:"flex flex-col space-y-1.5 p-6 border-b border-slate-200 dark:border-slate-700 bg-gradient-to-r from-slate-50 dark:from-slate-800 to-white dark:to-slate-800"},am={class:"flex items-center justify-between"},rm={class:"tracking-tight text-xl font-semibold text-slate-800 dark:text-slate-100 flex items-center"},nm={class:"p-0"},om={class:"divide-y divide-slate-100 dark:divide-slate-700"},sm=e.defineComponent({__name:"RecentContent",props:{content:{}},setup(l){const t=rt.useRouter(),a=r=>{t.push(r)};return(r,n)=>(e.openBlock(),e.createElementBlock("div",em,[e.createElementVNode("div",tm,[e.createElementVNode("div",lm,[e.createElementVNode("div",am,[e.createElementVNode("h3",rm,[e.createVNode(e.unref(Ii),{class:"w-5 h-5 mr-2"}),e.createTextVNode(" "+e.toDisplayString(r.$t("cms.dashboard.recentContent")),1)]),e.createElementVNode("button",{onClick:n[0]||(n[0]=o=>a("/settings/collections")),class:"inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 border shadow-sm hover:text-accent-foreground h-8 rounded-md px-3 text-xs bg-white dark:bg-slate-700 border-slate-300 dark:border-slate-600 text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-600"},e.toDisplayString(r.$t("cms.dashboard.viewAll")),1)])]),e.createElementVNode("div",nm,[e.createElementVNode("div",om,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.content,o=>(e.openBlock(),e.createBlock(Ju,{key:o.id,item:o},null,8,["item"]))),128))])])])]))}}),im={class:"rounded-xl text-card-foreground shadow-lg border-0 bg-white dark:bg-slate-800 backdrop-blur-sm"},cm={class:"flex flex-col space-y-1.5 p-6 border-b border-slate-200 dark:border-slate-700 bg-gradient-to-r from-slate-50 dark:from-slate-800 to-white dark:to-slate-800"},dm={class:"tracking-tight text-lg font-semibold text-slate-800 dark:text-slate-100 flex items-center"},um={class:"p-4"},mm={class:"grid grid-cols-2 gap-3"},pm=["onClick"],fm={class:"p-2 rounded-lg bg-blue-50 dark:bg-blue-900/20 mb-2 w-fit"},hm={class:"font-medium text-slate-800 dark:text-slate-100 text-sm mb-1 group-hover:text-slate-900 dark:group-hover:text-slate-50"},gm={class:"text-xs text-slate-500 dark:text-slate-400 group-hover:text-slate-600 dark:group-hover:text-slate-300"},bm=e.defineComponent({__name:"QuickActions",setup(l){const t=rt.useRouter(),{t:a}=Fe(),r=[{id:"create-article",title:a("cms.dashboard.createArticle"),description:a("cms.dashboard.createArticleDescription"),icon:Il,iconColor:"text-blue-500",link:"/collections/pages/create"},{id:"upload-media",title:a("cms.dashboard.uploadMedia"),description:a("cms.dashboard.uploadMediaDescription"),icon:ma,iconColor:"text-purple-500",link:"/media"},{id:"manage-users",title:a("cms.dashboard.manageUsers"),description:a("cms.dashboard.manageUsersDescription"),icon:lr,iconColor:"text-green-500",link:"/settings/users"}],n=o=>{o&&t.push(o)};return(o,s)=>(e.openBlock(),e.createElementBlock("div",im,[e.createElementVNode("div",cm,[e.createElementVNode("h3",dm,[e.createVNode(e.unref(Ki),{class:"w-5 h-5 mr-2"}),e.createTextVNode(" "+e.toDisplayString(o.$t("cms.dashboard.quickActions")),1)])]),e.createElementVNode("div",um,[e.createElementVNode("div",mm,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(r,i=>e.createElementVNode("button",{key:i.id,class:"p-3 rounded-lg border border-slate-200 transition-all duration-200 text-left group hover:bg-slate-50 hover:shadow-md dark:border-slate-600 bg-white dark:bg-slate-700 dark:hover:bg-slate-600",onClick:c=>n(i==null?void 0:i.link)},[e.createElementVNode("div",fm,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i==null?void 0:i.icon),{class:e.normalizeClass(`w-4 h-4 ${i==null?void 0:i.iconColor}`)},null,8,["class"]))]),e.createElementVNode("h3",hm,e.toDisplayString(i==null?void 0:i.title),1),e.createElementVNode("p",gm,e.toDisplayString(i==null?void 0:i.description),1)],8,pm)),64))])])]))}}),ym={class:"w-full max-w-7xl mx-auto space-y-8"},km={class:"grid grid-cols-1 lg:grid-cols-3 gap-6"},Ar=e.defineComponent({__name:"Dashboard",setup(l){const{t}=Fe(),a=e.ref([{id:"total-content",title:t("cms.dashboard.totalContent"),value:"2,847",description:t("cms.dashboard.articlesPostsPages"),change:{value:"+12.5%",isPositive:!0},icon:"file-text",color:"blue"},{id:"active-users",title:t("cms.dashboard.activeUsers"),value:"1,234",description:t("cms.dashboard.monthlyActiveUsers"),change:{value:"+8.2%",isPositive:!0},icon:"users",color:"emerald"},{id:"media-files",title:t("cms.dashboard.mediaFiles"),value:"5,692",description:t("cms.dashboard.imagesVideosDocs"),change:{value:"+23.1%",isPositive:!0},icon:"image",color:"purple"},{id:"new-media",title:t("cms.dashboard.newMediaFiles"),value:"89.2K",description:t("cms.dashboard.thisMonth"),change:{value:"-2.4%",isPositive:!1},icon:"eye",color:"orange"}]),r=e.ref([{id:1,type:"Article",status:"published",title:t("cms.dashboard.gettingStartedWithNextJs14"),author:t("cms.dashboard.sarahJohnson"),updated_at:"2024-01-15",views:1247},{id:2,type:"Post",status:"draft",title:t("cms.dashboard.advancedReactPatterns"),author:t("cms.dashboard.mikeChen"),updated_at:"2024-01-14",views:0},{id:3,type:"Article",status:"published",title:t("cms.dashboard.uiUxDesignPrinciples"),author:t("cms.dashboard.emmaWilson"),updated_at:"2024-01-13",views:892},{id:4,type:"Post",status:"review",title:t("cms.dashboard.databaseOptimizationTips"),author:t("cms.dashboard.alexRodriguez"),updated_at:"2024-01-12",views:0}]),n=s=>{a.value=a.value.map(i=>{var c,u,d,m;switch(i.id){case"total-content":return{...i,value:((c=s.totalContent)==null?void 0:c.toLocaleString())??i.value};case"active-users":return{...i,value:((u=s.totalUsers)==null?void 0:u.toLocaleString())??i.value};case"media-files":return{...i,value:((d=s.totalMediaFiles)==null?void 0:d.toLocaleString())??i.value};case"new-media":return{...i,value:((m=s.newMediaFiles)==null?void 0:m.toLocaleString())??i.value};default:return i}})},o=async()=>{const i=await(await fetch("api/cms-stat")).json();r.value=i.recentContent,n(i.stat)};return e.onMounted(()=>{o()}),(s,i)=>(e.openBlock(),e.createElementBlock("div",ym,[e.createVNode(Du),e.createVNode(Uu,{stats:a.value},null,8,["stats"]),e.createElementVNode("div",km,[e.createVNode(sm,{content:r.value,class:"lg:col-span-2"},null,8,["content"]),e.createElementVNode("div",null,[e.createVNode(bm)])])]))}}),xm={class:"rounded-xl text-card-foreground shadow-lg bg-white dark:bg-slate-800 backdrop-blur-sm border-2 border-dashed border-slate-300 dark:border-slate-600"},wm={class:"p-12 text-center"},_m={class:"text-lg font-medium text-slate-600 dark:text-slate-300 mb-2"},Em={class:"text-slate-500 dark:text-slate-400 mb-6"},Go={__name:"EmptyData",props:{title:{type:String,default:()=>"emptyData.title"},description:{type:String,default:()=>"emptyData.description"},buttonText:{type:String,default:()=>"emptyData.buttonText"},showButton:{type:Boolean,default:!0}},emits:["action"],setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",xm,[e.createElementVNode("div",wm,[a[2]||(a[2]=e.createElementVNode("svg",{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",class:"lucide lucide-layers w-12 h-12 mx-auto mb-4 text-slate-400 dark:text-slate-500"},[e.createElementVNode("path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z"}),e.createElementVNode("path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65"}),e.createElementVNode("path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65"})],-1)),e.createElementVNode("h3",_m,e.toDisplayString(t.$t(l.title)),1),e.createElementVNode("p",Em,e.toDisplayString(t.$t(l.description)),1),l.showButton?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:a[0]||(a[0]=r=>t.$emit("action")),class:"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 shadow h-9 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white"},[a[1]||(a[1]=e.createElementVNode("svg",{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",class:"lucide lucide-plus w-4 h-4 mr-2"},[e.createElementVNode("path",{d:"M5 12h14"}),e.createElementVNode("path",{d:"M12 5v14"})],-1)),e.createTextVNode(" "+e.toDisplayString(t.$t(l.buttonText)),1)])):e.createCommentVNode("",!0)])]))}},Cm={class:"space-y-6 max-w-7xl mx-auto"},Vm={class:"flex items-center justify-between mb-8"},Nm={class:"flex gap-4"},vm={class:"text-3xl font-bold text-slate-800 dark:text-slate-100 mb-2"},Bm={class:"text-slate-600 dark:text-slate-300"},Sm=["href","title"],Dm={class:"relative w-full max-w-sm"},Am={class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},Mm=["placeholder"],Tm={key:0},Lm={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 mb-6"},$m=["onClick"],Fm={class:"flex items-start justify-between"},Im={class:"flex items-start gap-3"},Om={class:"text-sm font-semibold text-gray-800 mb-1"},Pm={class:"text-xs text-gray-600"},Rm={class:"flex items-center gap-2"},Um={class:"text-xs text-gray-500 whitespace-nowrap"},jm={key:1,class:"flex items-center justify-center min-h-[400px]"},Mr=e.defineComponent({__name:"CollectionsPage",setup(l){const{t,locale:a}=Fe(),r=rt.useRouter();e.inject("fetchContentTypes");const n=e.ref([]),o=e.ref(""),s=e.computed(()=>{const u=n.value.filter(p=>p.type!=="single"),d=o.value.trim().toLowerCase();return[...d?u.filter(p=>[p==null?void 0:p.title,p==null?void 0:p.name,p==null?void 0:p.id,p==null?void 0:p.description].filter(Boolean).join(" ").toLowerCase().includes(d)):u].sort((p,y)=>p.id==="pages"?-1:y.id==="pages"?1:0)});async function i(){try{const u=await fetch("/api/cms-type?type=collection");if(!u.ok)throw new Error("Failed to fetch collections");const d=await u.json();n.value=d.rows||[]}catch(u){console.error("Error fetching collections:",u)}}const c=u=>{r.push(`/collections/${u.id}`)};return e.onMounted(()=>{i()}),(u,d)=>(e.openBlock(),e.createElementBlock("div",Cm,[e.createElementVNode("div",Vm,[e.createElementVNode("div",Nm,[e.createElementVNode("div",null,[e.createElementVNode("h1",vm,e.toDisplayString(u.$t("cms.navigation.collections")),1),e.createElementVNode("p",Bm,e.toDisplayString(u.$t("cms.collections.selectCollection")),1)]),e.createElementVNode("a",{href:`https://cms.opengis.info/${e.unref(a)}/guides/collections/`,target:"_blank",title:u.$t("cms.guide.collections"),class:"mt-2"},[e.createVNode(e.unref(kl),{class:"w-5 h-5"})],8,Sm)]),e.createElementVNode("div",Dm,[e.createElementVNode("div",Am,[e.createVNode(e.unref(tr),{class:"w-5 h-5 text-gray-400"})]),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":d[0]||(d[0]=m=>o.value=m),type:"text",class:"block w-full py-2 pl-10 pr-3 leading-5 text-gray-900 placeholder-gray-500 transition-colors bg-white border border-gray-300 rounded-md dark:border-gray-600 dark:bg-gray-700 dark:placeholder-gray-400 focus:outline-none focus:ring-sky-500 focus:border-sky-500 dark:text-white sm:text-sm",placeholder:u.$t("cms.collections.searchCollections")},null,8,Mm),[[e.vModelText,o.value]])])]),n.value.length>0?(e.openBlock(),e.createElementBlock("div",Tm,[e.createElementVNode("div",Lm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,m=>(e.openBlock(),e.createElementBlock("button",{key:m.id,onClick:f=>c(m),class:"w-full border border-gray-200 bg-white rounded-lg p-4 text-left hover:shadow-md transition-all hover:border-gray-300"},[e.createElementVNode("div",Fm,[e.createElementVNode("div",Im,[m.id==="pages"?(e.openBlock(),e.createBlock(e.unref(yl),{key:0,class:"shrink-0 lucide lucide-page w-5 h-5 text-blue-600"})):(e.openBlock(),e.createBlock(e.unref(xl),{key:1,class:"shrink-0 lucide lucide-layers w-5 h-5 text-blue-600"})),e.createElementVNode("div",null,[e.createElementVNode("h4",Om,e.toDisplayString(m.title),1),e.createElementVNode("p",Pm,e.toDisplayString(m.description||"Опис відсутній"),1)])]),e.createElementVNode("div",Rm,[e.createElementVNode("span",Um,e.toDisplayString(m.entries)+" записів",1),e.createVNode(e.unref(bl),{class:"w-4 h-4 text-gray-400"})])])],8,$m))),128))])])):(e.openBlock(),e.createElementBlock("div",jm,[e.createVNode(Go)]))]))}}),zm={class:"text-card-foreground border-0 bg-white/80 dark:bg-slate-800/80 backdrop-blur-sm"},Hm={class:"p-0"},qm={class:"table-scroll overflow-x-auto"},Gm={class:"relative w-full overflow-auto max-h-[calc(100vh-270px)]"},Wm={class:"w-full caption-bottom text-sm"},Km={class:"border-b border-slate-200 dark:border-slate-700 bg-slate-50/50 dark:bg-slate-700/50 hover:bg-slate-50/80 dark:hover:bg-slate-700/80 transition-colors"},Ym={class:"flex items-center gap-2"},Xm={class:"h-10 text-center px-4 font-semibold text-slate-700 dark:text-slate-300 max-w-32"},Zm=["onClick"],Qm={key:1,class:"whitespace-nowrap"},Jm={key:2,class:"whitespace-nowrap"},ep={key:3,class:"flex items-center"},tp={key:4,class:"inline-flex whitespace-nowrap items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors bg-white dark:bg-slate-700 border-slate-300 dark:border-slate-600 text-slate-700 dark:text-slate-300"},lp={key:5,class:"flex items-center"},ap={key:6,class:"flex items-center gap-3"},rp={key:8,class:"flex items-center gap-3"},np={key:11,class:"flex items-center gap-3"},op={class:"line-clamp-2"},sp={class:"flex justify-end py-2 px-4 align-middle max-w-40"},ip={class:"flex items-center justify-center gap-1"},cp=["onClick"],dp=["onClick"],Wo=e.defineComponent({__name:"UniversalTable",props:{rows:{},query:{},filterFn:{type:Function},onEdit:{type:Function},onView:{type:Function},onDelete:{type:Function},columns:{},onMore:{type:Function},customRender:{}},emits:["edit","view","delete","more"],setup(l,{emit:t}){const{t:a}=Fe();e.ref(null);const r=l,n=t,o=e.computed(()=>!r.query||!r.filterFn?r.rows:r.rows.filter(m=>r.filterFn(m,r.query))),s=m=>{if(!m)return"";const f=new Date(m);return isNaN(f.getTime())?"":m.includes("T")||m.includes(" ")||m.includes(":")?f.toLocaleString("uk-UA",{dateStyle:"medium",timeStyle:"medium"}):f.toLocaleDateString("uk-UA",{dateStyle:"medium"})},i=m=>{switch(m){case"published":return{icon:wn,text:a("cms.common.status.published"),classes:"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-200 border-green-200 dark:border-green-700"};case"draft":return{icon:wl,text:a("cms.common.status.draft"),classes:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-200 border-yellow-200 dark:border-yellow-700"};case"archived":return{icon:Dn,text:a("cms.common.status.archived"),classes:"bg-gray-100 text-gray-800 dark:bg-gray-900/30 dark:text-gray-300 border-gray-200 dark:border-gray-700"};default:return null}},c=(m,f)=>{switch(m){case"edit":n("cms.edit",f),r.onEdit&&r.onEdit(f);break;case"view":n("cms.view",f),r.onView&&r.onView(f);break;case"delete":n("cms.delete",f);break;case"more":n("cms.more",f),r.onMore&&r.onMore(f);break}},u=m=>{c("edit",m)},d=m=>{const f=new Date,p=new Date(m),y=f-p,h=Math.floor(y/1e3),g=Math.floor(h/60),b=Math.floor(g/60),w=Number(Math.floor(b/24)),x=Number(Math.floor(w/7));return x>=2?a("cms.table.time.weeksAgo",{count:x}):x===1?a("cms.table.time.weekAgo"):w>=2?a("cms.table.time.daysAgo",{count:w}):w===1?a("cms.table.time.dayAgo"):b>=2?a("cms.table.time.hoursAgo",{count:b}):b===1?a("cms.table.time.hourAgo"):g>=2?a("cms.table.time.minutesAgo",{count:g}):a(g===1?"cms.table.time.minuteAgo":"cms.table.time.justNow")};return(m,f)=>(e.openBlock(),e.createElementBlock("div",zm,[e.createElementVNode("div",Hm,[e.createElementVNode("div",qm,[e.createElementVNode("div",Gm,[e.createElementVNode("table",Wm,[e.createElementVNode("thead",null,[e.createElementVNode("tr",Km,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.columns,p=>(e.openBlock(),e.createElementBlock("th",{key:p.name,class:e.normalizeClass(["h-10 px-4 text-left align-middle font-semibold text-slate-700 dark:text-slate-300 max-w-80",{"min-w-[200px]":["title","name"].includes(p.name),"min-w-[150px]":p.name==="slug","min-w-[250px]":p.name==="description"}])},[e.createElementVNode("div",Ym,[p.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(p.icon),{key:0,class:"w-5 h-5"})):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(p.label||p.title||p.ua||p.name),1)])],2))),128)),e.createElementVNode("th",Xm,e.toDisplayString(m.$t("cms.table.actions")),1)])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,p=>(e.openBlock(),e.createElementBlock("tr",{key:p.id||p._id||p.name,class:"transition-all duration-200 hover:bg-slate-50/60 dark:hover:bg-slate-700/60"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.columns,(y,h)=>{var g,b,w,x,k;return e.openBlock(),e.createElementBlock("td",{key:y.name,class:e.normalizeClass(["py-2 px-4 align-middle max-w-80",{"font-medium text-slate-800 dark:text-white cursor-pointer":h===0,"text-slate-600 dark:text-slate-400 font-mono text-sm":h!==0}]),onClick:_=>h===0?u(p):void 0},[m.customRender&&m.customRender[y.name]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(m.customRender[y.name](p[y.name],p)),{key:0})):e.createCommentVNode("",!0),["published_at","publish_at","created_at","date"].includes(y.name)&&p[y.name]?(e.openBlock(),e.createElementBlock("span",Qm,e.toDisplayString(s(p[y.name])),1)):["updated_at","lastModified","last_edit"].includes(y.name)?(e.openBlock(),e.createElementBlock("span",Jm,e.toDisplayString(d(p[y.name])||"--"),1)):y.name==="views"?(e.openBlock(),e.createElementBlock("div",ep,[e.createVNode(e.unref(Ja),{class:"w-4 h-4 mr-1"}),e.createTextVNode(" "+e.toDisplayString(((b=(g=p[y.name])==null?void 0:g.toLocaleString)==null?void 0:b.call(g))??p[y.name]),1)])):["entries","fields"].includes(y.name)?(e.openBlock(),e.createElementBlock("div",tp,e.toDisplayString(p[y.name]||"-"),1)):y.name==="type"?(e.openBlock(),e.createElementBlock("div",lp,[e.createElementVNode("div",{class:e.normalizeClass(["whitespace-nowrap inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors border-transparent hover:bg-secondary/80",p[y.name]==="pages"?"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300":"bg-purple-100 text-purple-800 dark:bg-purple-900/30 dark:text-purple-300"])},e.toDisplayString(p[y.name]||"-"),3)])):y.name==="name"?(e.openBlock(),e.createElementBlock("div",ap,[p.type==="single"?(e.openBlock(),e.createBlock(e.unref(yl),{key:0,class:"shrink-0 lucide lucide-page w-5 h-5 text-blue-600"})):(e.openBlock(),e.createBlock(e.unref(xl),{key:1,class:"shrink-0 lucide lucide-layers w-5 h-5 text-blue-600"})),e.createTextVNode(" "+e.toDisplayString(p[y.name]),1)])):y.name==="status"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:7},[i(p[y.name])?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["whitespace-nowrap rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors hover:bg-secondary/80 flex items-center w-fit bg-green-100 text-green-800 border-green-200 dark:bg-green-900/30 dark:text-green-300 dark:border-green-700",(w=i(p[y.name]))==null?void 0:w.classes])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent((x=i(p[y.name]))==null?void 0:x.icon),{class:"w-3 h-3 mr-1"})),e.createTextVNode(" "+e.toDisplayString((k=i(p[y.name]))==null?void 0:k.text),1)],2)):e.createCommentVNode("",!0)],64)):y.name==="slug"?(e.openBlock(),e.createElementBlock("div",rp,e.toDisplayString(p[y.name]?"/"+p[y.name]:"-"),1)):y.name==="color"?(e.openBlock(),e.createElementBlock("span",{key:9,class:e.normalizeClass(["w-4 h-4 rounded-full block ml-2","bg-["+p[y.name]+"]"])},null,2)):y.name==="enabled"?(e.openBlock(),e.createElementBlock("span",{key:10,class:e.normalizeClass(["whitespace-nowrap rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors hover:bg-secondary/80 flex items-center w-fit",p[y.name]?"bg-green-100 text-green-800 border-green-200":"bg-red-100 text-red-800 border-red-200"])},e.toDisplayString(p[y.name]?"Доступ":"Заборонено"),3)):(e.openBlock(),e.createElementBlock("div",np,[e.createElementVNode("p",op,e.toDisplayString(p[y.name]||"-"),1)]))],10,Zm)}),128)),e.createElementVNode("td",sp,[e.createElementVNode("div",ip,[e.createElementVNode("button",{onClick:e.withModifiers(y=>c("edit",p),["stop"]),class:"inline-flex items-center justify-center whitespace-nowrap font-medium border rounded-md text-xs h-8 w-8 p-0 border-slate-300 bg-white transition-all duration-200 shadow-sm dark:border-slate-600 dark:bg-slate-700 dark:hover:bg-slate-600 dark:hover:text-slate-200 hover:border-blue-300 hover:bg-blue-50 hover:text-blue-600",title:"Edit"},[e.createVNode(e.unref(Sn),{class:"text-slate-800 dark:text-slate-200 w-4 h-4 group-hover:text-green-600 dark:group-hover:text-blue-50"})],8,cp),e.createElementVNode("button",{onClick:e.withModifiers(y=>c("delete",p),["stop"]),class:"inline-flex items-center justify-center whitespace-nowrap font-medium border rounded-md text-xs h-8 w-8 p-0 border-slate-300 bg-white transition-all duration-200 shadow-sm dark:border-slate-600 dark:bg-slate-700 dark:hover:bg-slate-600 dark:hover:text-slate-200 hover:border-blue-300 hover:bg-blue-50 hover:text-blue-600",title:"Preview"},[e.createVNode(e.unref(Gt),{class:"w-4 h-4 text-slate-800 dark:text-slate-200 group-hover:text-red-600 dark:group-hover:text-blue-50"})],8,dp),e.renderSlot(m.$slots,"actions",{row:p})])])]))),128))])])])])])]))}}),up={class:"flex items-center justify-between px-6 py-4 border-t border-slate-200 dark:border-slate-700 bg-white dark:bg-slate-800"},mp={class:"flex justify-between flex-1 sm:hidden"},pp={class:"relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50"},fp={class:"relative inline-flex items-center px-4 py-2 ml-3 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50"},hp={class:"hidden sm:flex-1 sm:flex sm:items-center sm:justify-between"},gp={class:"text-sm text-slate-600 dark:text-slate-400"},bp={class:"font-medium text-slate-800 dark:text-slate-100"},yp={class:"font-medium text-slate-800 dark:text-slate-100"},kp={class:"relative z-0 inline-flex space-x-2 rounded-md shadow-sm","aria-label":"Pagination"},xp=["disabled"],wp={class:"sr-only"},_p={class:"space-x-1"},Ep={key:0,class:"px-2 py-2 text-gray-400"},Cp=["onClick"],Vp=["disabled"],Np={class:"sr-only"},Ko=e.defineComponent({__name:"UniversalTablePagination",props:e.mergeModels({total:{},count:{},limit:{}},{page:{},pageModifiers:{}}),emits:["update:page"],setup(l){const t=e.useModel(l,"page"),a=e.computed(()=>Math.ceil(l.total/l.limit)),r=e.computed(()=>{const o=[];if(a.value<=4){for(let c=1;c<=a.value;c++)o.push(c);return o}const s=Math.max(2,t.value-2),i=Math.min(a.value-1,t.value+2);o.push(1),s>2&&o.push("ellipsis");for(let c=s;c<=i;c++)o.push(c);return i<a.value-1&&o.push("ellipsis"),o.push(a.value),o});return(n,o)=>(e.openBlock(),e.createElementBlock("div",up,[e.createElementVNode("div",mp,[e.createElementVNode("button",pp,e.toDisplayString(n.$t("cms.common.pagination.previous")),1),e.createElementVNode("button",fp,e.toDisplayString(n.$t("cms.common.pagination.next")),1)]),e.createElementVNode("div",hp,[e.createElementVNode("div",null,[e.createElementVNode("p",gp,[e.createTextVNode(e.toDisplayString(n.$t("cms.common.pagination.showing"))+" ",1),e.createElementVNode("span",bp,e.toDisplayString(n.count),1),e.createTextVNode(" "+e.toDisplayString(n.$t("cms.common.pagination.of"))+" ",1),e.createElementVNode("span",yp,e.toDisplayString(n.total),1),e.createTextVNode(" "+e.toDisplayString(n.$t("cms.common.pagination.results")),1)])]),e.createElementVNode("div",null,[e.createElementVNode("nav",kp,[e.createElementVNode("button",{onClick:o[0]||(o[0]=s=>t.value=t.value>1?t.value-1:1),disabled:t.value===1,class:"inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors border shadow-sm rounded-md text-xs h-8 w-8 p-0 bg-white border-slate-300 text-slate-600 disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed hover:text-accent-foreground hover:bg-slate-50 dark:bg-slate-700 dark:border-slate-600 dark:text-slate-300 dark:hover:bg-slate-600"},[e.createElementVNode("span",wp,e.toDisplayString(n.$t("cms.common.pagination.previous")),1),e.createVNode(e.unref(Pi),{class:"w-5 h-5"})],8,xp),e.createElementVNode("div",_p,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:s+"-"+i},[s==="ellipsis"?(e.openBlock(),e.createElementBlock("span",Ep,"...")):(e.openBlock(),e.createElementBlock("button",{key:1,onClick:c=>t.value=s,class:e.normalizeClass(["inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors h-8 w-8 p-0 text-sm rounded-md",{"border shadow-sm hover:text-accent-foreground bg-white dark:bg-slate-700 border-slate-300 dark:border-slate-600 text-slate-600 dark:text-slate-300 hover:border-blue-600 hover:bg-slate-50 dark:hover:bg-slate-600":s!==t.value,"shadow bg-blue-600 hover:bg-blue-700 text-white border-blue-600":s===t.value}])},e.toDisplayString(s),11,Cp))],64))),128))]),e.createElementVNode("button",{onClick:o[1]||(o[1]=s=>t.value=t.value<Math.ceil(n.total/n.limit)?t.value+1:Math.ceil(n.total/n.limit)),disabled:t.value===Math.ceil(n.total/n.limit),class:"inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors border shadow-sm rounded-md text-xs h-8 w-8 p-0 bg-white border-slate-300 text-slate-600 disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed hover:text-accent-foreground hover:bg-slate-50 dark:bg-slate-700 dark:border-slate-600 dark:text-slate-300 dark:hover:bg-slate-600"},[e.createElementVNode("span",Np,e.toDisplayString(n.$t("cms.common.pagination.next")),1),e.createVNode(e.unref(bl),{class:"w-5 h-5"})],8,Vp)])])])]))}}),cl=(l,t)=>{const a=l.__vccOpts||l;for(const[r,n]of t)a[r]=n;return a},vp={key:0,class:"fixed inset-0 z-[2000] flex items-center justify-center bg-gray-600 bg-opacity-75"},Bp={key:0,class:"relative transform overflow-hidden rounded-lg bg-white text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-lg",role:"dialog","aria-modal":"true","aria-labelledby":"dialog-title"},Sp={class:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},Dp={class:"mt-3 text-center sm:mt-5"},Ap={id:"dialog-title",class:"text-base font-semibold text-gray-900"},Mp={class:"mt-2"},Tp={class:"text-sm text-gray-500"},Lp={class:"bg-gray-50 px-4 py-3 sm:px-6 flex justify-center"},$p={key:1,class:"relative transform overflow-hidden rounded-lg bg-white text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-lg",role:"dialog","aria-modal":"true","aria-labelledby":"dialog-title"},Fp={class:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},Ip={class:"sm:flex sm:items-start"},Op={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"},Pp={id:"dialog-title",class:"text-base font-semibold text-gray-900"},Rp={class:"mt-2"},Up={class:"text-sm text-gray-500"},jp={key:0,class:"mt-2"},zp=["placeholder"],Hp=e.defineComponent({__name:"message-box",props:{type:{default:"error"},mode:{default:"confirm"},title:{default:""},message:{default:""},confirmButtonText:{default:"OK"},cancelButtonText:{default:"Cancel"},modelValue:{type:Boolean,default:!1},promptPlaceholder:{default:""},align:{type:Boolean,default:!0}},emits:["confirm","cancel","update:modelValue"],setup(l,{emit:t}){const a=e.ref(null);e.onMounted(()=>{var y;(y=a.value)==null||y.focus()});const r={success:()=>e.h("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true",class:"size-6 text-green-600"},[e.h("path",{d:"m4.5 12.75 6 6 9-13.5","stroke-linecap":"round","stroke-linejoin":"round"})]),error:()=>e.h("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true",class:"size-6 text-red-600"},[e.h("path",{d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z","stroke-linecap":"round","stroke-linejoin":"round"})]),info:()=>e.h("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"size-6 text-blue-600"},[e.h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M13 16h-1v-4h-1m1-4h.01M12 20a8 8 0 100-16 8 8 0 000 16z"})]),warning:()=>e.h("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"size-6 text-yellow-600"},[e.h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v2m0 4h.01M10.29 3.86L1.82 17a1 1 0 0 0 .87 1.5h18.62a1 1 0 0 0 .87-1.5L13.71 3.86a1 1 0 0 0-1.42 0z"})])},n=l,o=t,s=e.ref(n.modelValue),i=e.ref("");e.watch(()=>n.modelValue,y=>{s.value=y,y===!0&&n.mode==="prompt"&&(i.value="")});function c(y){s.value=!1,o("update:modelValue",!1),y==="confirm"&&n.mode==="prompt"?o("confirm",i.value):o(y)}function u(){c("confirm")}const d=e.computed(()=>{switch(n.type){case"success":return"bg-green-100";case"error":return"bg-red-100";case"info":return"bg-blue-100";case"warning":return"bg-yellow-100";default:return"bg-gray-100"}}),m=e.computed(()=>n.type==="warning"?"bg-orange-600 hover:bg-orange-500":n.type==="success"?"bg-green-600 hover:bg-green-500":n.type==="error"?"bg-red-600 hover:bg-red-500":"bg-blue-600 hover:bg-blue-500"),f=e.computed(()=>r[n.type||"error"]||r.error),p=e.computed(()=>n.title&&n.title.trim()!==""?n.title:n.type?n.type.charAt(0).toUpperCase()+n.type.slice(1):"Notification");return(y,h)=>{const g=e.resolveDirective("focus");return e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[s.value?(e.openBlock(),e.createElementBlock("div",vp,[y.mode==="alert"?(e.openBlock(),e.createElementBlock("div",Bp,[e.createElementVNode("div",Sp,[e.createElementVNode("div",null,[h[4]||(h[4]=e.createElementVNode("div",{class:"mx-auto flex size-12 shrink-0 items-center justify-center rounded-full bg-green-100"},[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true",class:"size-6 text-green-600"},[e.createElementVNode("path",{d:"m4.5 12.75 6 6 9-13.5","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)),e.createElementVNode("div",Dp,[e.createElementVNode("h3",Ap,e.toDisplayString(p.value),1),e.createElementVNode("div",Mp,[e.createElementVNode("p",Tp,e.toDisplayString(y.message),1)])])])]),e.createElementVNode("div",Lp,[e.createElementVNode("button",{type:"button",onClick:h[0]||(h[0]=b=>c("confirm")),class:"inline-flex min-w-[70px] w-full justify-center rounded-md bg-indigo-600 px-3 py-2 text-sm font-semibold text-white shadow-xs hover:bg-indigo-500 sm:w-auto"},e.toDisplayString(y.confirmButtonText),1)])])):(e.openBlock(),e.createElementBlock("div",$p,[e.createElementVNode("div",Fp,[e.createElementVNode("div",Ip,[e.createElementVNode("div",{class:e.normalizeClass(["mx-auto flex size-12 shrink-0 items-center justify-center rounded-full sm:mx-0 sm:size-10",d.value])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f.value)))],2),e.createElementVNode("div",Op,[e.createElementVNode("h3",Pp,e.toDisplayString(p.value),1),e.createElementVNode("div",Rp,[e.createElementVNode("p",Up,e.toDisplayString(y.message),1)]),y.mode==="prompt"?(e.openBlock(),e.createElementBlock("div",jp,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":h[1]||(h[1]=b=>i.value=b),placeholder:y.promptPlaceholder,class:"w-full rounded-md py-1.5 pl-2 text-gray-900 shadow-sm placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6",onKeyup:e.withKeys(u,["enter"]),type:"text"},null,40,zp),[[e.vModelText,i.value],[g]])])):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",{class:e.normalizeClass(["bg-gray-50 px-4 py-3",y.align?"sm:flex sm:flex-row-reverse sm:px-6 gap-x-2.5":"sm:flex sm:flex-row sm:px-6 gap-x-2.5"])},[e.createElementVNode("button",{type:"button",onClick:h[2]||(h[2]=b=>c("confirm")),class:e.normalizeClass(["inline-flex w-full justify-center rounded-md px-3 py-2 text-sm font-semibold text-white shadow-xs sm:w-auto",m.value])},e.toDisplayString(y.confirmButtonText),3),e.createElementVNode("button",{type:"button",onClick:h[3]||(h[3]=b=>c("cancel")),class:"mt-3 inline-flex w-full justify-center rounded-md bg-white px-3 py-2 text-sm font-semibold text-gray-900 shadow-xs ring-1 ring-inset ring-gray-300 hover:bg-gray-50 sm:mt-0 sm:w-auto"},e.toDisplayString(y.cancelButtonText),1)],2)]))])):e.createCommentVNode("",!0)])}}}),qp=cl(Hp,[["__scopeId","data-v-047caa71"]]);e.defineComponent({props:{modelValue:{type:Boolean,default:()=>!1},title:{type:String,default:()=>""},disabled:{type:Boolean,default:()=>!1}},data(){return{}},mounted(){this.modelValue||this.$emit("update:modelValue",!1)},computed:{modelState:{get(){return this.modelValue},set(l){this.$emit("update:modelValue",l)}},labelCursorClasses(){return[{"cursor-not-allowed":this.disabled},{"cursor-pointer":!this.disabled}]}},methods:{handleEnterDown(l){const{keyCode:t}=l;t===13&&(this.modelState=!this.modelState)},addKeyHandler(){window.addEventListener("keydown",this.handleEnterDown)},removeKeyHandler(){window.removeEventListener("keydown",this.handleEnterDown)}}});const Gp={key:0,class:"vsTailwind ui-dialog__wrapper text-gray-800"},Wp={class:"py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]"},Kp={class:"font-medium text-gray-800 dark:text-[#ffffff]"},Yp={class:"ui-dialog__content p-4"},Xp={key:0,class:"flex justify-end gap-x-2"},Zp={key:1,class:"flex justify-end items-center gap-x-2 py-3 px-4 border-t border-gray-200 dark:border-neutral-700"},Qp=e.defineComponent({__name:"vs-modal",props:{title:{default:""},template:{},visible:{type:Boolean,default:!1},size:{default:"small"},closeClickBack:{type:Boolean,default:!1},content:{},buttonText:{},contentProps:{},teleport:{default:"body"}},emits:["update:visible","close","done"],setup(l,{emit:t}){const a=l,r=t,n=e.computed(()=>a.size==="small"?"md:w-5/12 w-9/12":a.size==="medium"?"md:w-6/12 w-9/12":"lg:w-7/12 w-11/12"),o=e.useAttrs();function s(){r("done")}function i(){r("update:visible",!1),r("close")}function c(d){d.key==="Escape"&&i()}function u(d,m){m&&d.target.classList.contains("vs-dialog-overlay")&&i()}return e.onMounted(()=>{window.addEventListener("keydown",c)}),e.onUnmounted(()=>{window.removeEventListener("keydown",c)}),(d,m)=>(e.openBlock(),e.createBlock(e.Teleport,{to:d.teleport},[d.visible?(e.openBlock(),e.createElementBlock("div",Gp,[e.createElementVNode("div",{onMousedown:m[0]||(m[0]=f=>u(f,d.closeClickBack)),class:e.normalizeClass(["vs-dialog-overlay vs-dialog w-full h-full fixed top-0 start-0 bg-black bg-opacity-50",[e.unref(o).class]])},[e.createVNode(e.Transition,{name:"content",appear:""},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["ui-dialog__modal opacity-1 flex flex-col bg-white dark:bg-[#1A1A1A] border dark:border-[#454545] pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl",n.value])},[e.createElementVNode("div",Wp,[e.createElementVNode("h3",Kp,e.toDisplayString(d.title),1),e.createElementVNode("button",{type:"button",class:"size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600",onClick:i},[...m[1]||(m[1]=[e.createElementVNode("span",{class:"sr-only"},"Close",-1),e.createElementVNode("svg",{class:"flex-shrink-0 w-4 h-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"},[e.createElementVNode("path",{d:"M18 6 6 18"}),e.createElementVNode("path",{d:"m6 6 12 12"})],-1)])])]),e.createElementVNode("div",Yp,[e.renderSlot(d.$slots,"default",{},void 0,!0)]),d.$slots.footer?(e.openBlock(),e.createElementBlock("div",Xp,[e.renderSlot(d.$slots,"footer",{handleClose:i},void 0,!0)])):e.createCommentVNode("",!0),d.buttonText?(e.openBlock(),e.createElementBlock("div",Zp,[e.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-2xs hover:bg-gray-50 focus:outline-hidden focus:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:i}," Close "),e.createElementVNode("button",{type:"button",onClick:s,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 focus:outline-hidden focus:bg-blue-700 disabled:opacity-50 disabled:pointer-events-none"},e.toDisplayString(d.buttonText),1)])):e.createCommentVNode("",!0)],2)]),_:3})],34)])):e.createCommentVNode("",!0)],8,["to"]))}}),Zt=cl(Qp,[["__scopeId","data-v-a6807cab"]]),Jp={key:0,class:"vsTailwind ui-drawer__wrapper"},ef={class:"py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]"},tf={class:"font-medium text-gray-800 dark:text-[#ffffff]"},lf={class:"flex gap-2"},af={class:"sr-only"},rf={key:0,class:"flex-shrink-0 w-4 h-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"},nf={key:1,class:"flex-shrink-0 w-4 h-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"},of={class:"ui-drawer__content p-4 flex-1 overflow-auto"},sf={key:0,class:"flex justify-end gap-x-2 p-4 border-0 border-t border-solid border-gray-200 dark:border-t-[#454545]"},cf=e.defineComponent({__name:"vs-drawer",props:{title:{default:""},visible:{type:Boolean,default:!1},position:{default:"right"},size:{default:"500px"},closeClickBack:{type:Boolean,default:!1}},emits:["update:visible","close"],setup(l,{emit:t}){const a=l,r=t,n=e.ref(!1),o=e.computed(()=>n.value?"fixed top-0 left-0 w-full h-full":a.position==="left"?"fixed top-0 left-0 h-full":a.position==="right"?"fixed top-0 right-0 h-full":a.position==="top"?"fixed top-0 left-0 w-full":"fixed bottom-0 left-0 w-full");function s(){r("update:visible",!1),r("close")}function i(){n.value=!n.value}function c(d){d.key==="Escape"&&s()}function u(d,m){m&&d.target.classList.contains("vs-drawer-overlay")&&s()}return e.onMounted(()=>{window.addEventListener("keydown",c)}),e.onUnmounted(()=>{window.removeEventListener("keydown",c)}),(d,m)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"#modal"},[d.visible?(e.openBlock(),e.createElementBlock("div",Jp,[e.createElementVNode("div",{onMousedown:m[0]||(m[0]=f=>u(f,d.closeClickBack)),class:"vs-drawer-overlay vs-drawer w-full h-full fixed top-0 start-0 bg-black bg-opacity-50"},[e.createVNode(e.Transition,{name:"drawer",appear:""},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["ui-drawer__drawer opacity-1 flex flex-col bg-white dark:bg-[#1A1A1A] border dark:border-[#454545] pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)]",[o.value,n.value?"w-full":`w-[${a.size}]`,`drawer-${a.position}`]])},[e.createElementVNode("div",ef,[e.createElementVNode("h3",tf,e.toDisplayString(d.title),1),e.createElementVNode("div",lf,[e.createElementVNode("button",{type:"button",class:"size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600",onClick:i},[e.createElementVNode("span",af,e.toDisplayString(n.value?"Exit fullscreen":"Enter fullscreen"),1),n.value?(e.openBlock(),e.createElementBlock("svg",nf,[...m[2]||(m[2]=[e.createElementVNode("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",rf,[...m[1]||(m[1]=[e.createElementVNode("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"},null,-1)])]))]),e.createElementVNode("button",{type:"button",class:"size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600",onClick:s},[...m[3]||(m[3]=[e.createElementVNode("span",{class:"sr-only"},"Close",-1),e.createElementVNode("svg",{class:"flex-shrink-0 w-4 h-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"},[e.createElementVNode("path",{d:"M18 6 6 18"}),e.createElementVNode("path",{d:"m6 6 12 12"})],-1)])])])]),e.createElementVNode("div",of,[e.renderSlot(d.$slots,"default",{},void 0,!0)]),d.$slots.footer?(e.openBlock(),e.createElementBlock("div",sf,[e.renderSlot(d.$slots,"footer",{handleClose:s},void 0,!0)])):e.createCommentVNode("",!0)],2)]),_:3})],32)])):e.createCommentVNode("",!0)]))}}),Yo=cl(cf,[["__scopeId","data-v-c808fe88"]]),df={},uf={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-6 text-green-600"};function mf(l,t){return e.openBlock(),e.createElementBlock("svg",uf,[...t[0]||(t[0]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)])])}const pf=cl(df,[["render",mf]]),ff={},hf={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"orange",class:"size-6 text-orange-600"};function gf(l,t){return e.openBlock(),e.createElementBlock("svg",hf,[...t[0]||(t[0]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)])])}const bf=cl(ff,[["render",gf]]),yf={},kf={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-6 text-blue-600"};function xf(l,t){return e.openBlock(),e.createElementBlock("svg",kf,[...t[0]||(t[0]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"},null,-1)])])}const wf=cl(yf,[["render",xf]]),_f={},Ef={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"red",class:"size-6 text-red-600"};function Cf(l,t){return e.openBlock(),e.createElementBlock("svg",Ef,[...t[0]||(t[0]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)])])}const Vf=cl(_f,[["render",Cf]]),Nf={class:"rounded-md border border-gray-300 bg-white p-4 shadow-sm"},vf={class:"flex items-start gap-4 opacity-100 scale-5 transition-all duration-300"},Bf={class:"flex-1"},Sf={class:"font-medium text-gray-900"},Df={class:"mt-0.5 text-sm text-gray-700"},Af=e.defineComponent({__name:"vs-notify",props:{type:{},title:{},message:{}},setup(l){const t={success:pf,warning:bf,error:Vf,info:wf};return(a,r)=>(e.openBlock(),e.createElementBlock("div",Nf,[e.createElementVNode("div",vf,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t[a.type]))),e.createElementVNode("div",Bf,[e.createElementVNode("strong",Sf,e.toDisplayString(a.title),1),e.createElementVNode("p",Df,e.toDisplayString(a.message),1)]),r[0]||(r[0]=e.createElementVNode("button",{class:"m-3 rounded-full p-1.5 text-gray-500 transition-colors hover:bg-gray-50 hover:text-gray-700",type:"button","aria-label":"Dismiss notify"},[e.createElementVNode("span",{class:"sr-only"},"Dismiss popup"),e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})])],-1))])]))}}),Ca=l=>{const{message:t,title:a,mode:r="confirm",type:n="info",confirmButtonText:o,cancelButtonText:s,onConfirm:i,onCancel:c,cascade:u,confirmButtonStyle:d,cancelButtonStyle:m}=l||{},f=document.querySelector("body");if(!f){console.error('Modal root element with id "#modal" not found!');return}const p=document.createElement("div");f.appendChild(p);const y=()=>{p.remove()};e.createApp({render(){return e.h(qp,{title:a,message:t,mode:r,type:n,cascade:u,confirmButtonText:o,cancelButtonText:s,cancelButtonStyle:m,confirmButtonStyle:d,modelValue:!0,onConfirm:()=>{i==null||i(),y()},onCancel:()=>{c==null||c(),y()}})}}).mount(p)};e.reactive({visible:!0});const Mf=l=>{const{template:t="",title:a="",content:r,contentProps:n={},size:o="medium"}=l,s=document.querySelector("body");if(!s)return console.error('Modal root element with id "#modal" not found!'),{close:()=>{}};const i=document.createElement("div");s.appendChild(i);const c={title:a,template:t,visible:!0,size:o,closeClickBack:!0,onClose:d},u=e.createApp({render(){return e.h(Zt,c,{default:()=>[r?e.h(r,n):e.h("p",t)]})}});function d(){u.unmount(),i.remove()}return u.mount(i),{close:d}},Va={top:"top-4 left-1/2 transform -translate-x-1/2","left-bottom":"bottom-4 left-4 transform","right-bottom":"bottom-4 right-4 transform",bottom:"bottom-4 left-1/2 transform -translate-x-1/2"},xe=l=>{var c;const{type:t="info",title:a,message:r,position:n="right-bottom"}=l||{};let o=document.querySelector("#notify-root");o||(o=document.createElement("div"),o.id="notify-root",o.className=`fixed z-[2000] flex flex-col gap-3 ${Va[n]} p-6 max-w-md mx-auto font-sans antialiased`,document.body.appendChild(o)),o.className.includes(Va[n])||(Object.values(Va).forEach(u=>{o.classList.remove(...u.split(" "))}),o.classList.add(...Va[n].split(" ")));const s=document.createElement("div");o.appendChild(s);const i=e.createApp({render(){return e.h(Af,{type:t,title:a,message:r,onClose:()=>{i.unmount(),s.remove()}})}});i.mount(s),(c=s.querySelector("button"))==null||c.addEventListener("click",()=>{s.classList.add("opacity-0","scale-95","transition-all","duration-300"),setTimeout(()=>{i.unmount(),s.remove()},350)}),setTimeout(()=>{s.classList.add("opacity-0","scale-95","transition-all","duration-300"),setTimeout(()=>{i.unmount(),s.remove()},350)},3500)},Tf={class:"w-full relative"},Lf={key:0,class:"text-[14px] font-medium text-gray-900 mb-2"},$f={class:"opacity-100"},Ff={key:0,class:"text-red-500 text-[14px]"},If={key:1,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},Of=e.defineComponent({__name:"vs-layout-default",props:{ua:{default:""},uk:{},en:{},de:{},es:{},fr:{},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""},columns:{}},setup(l){const t=e.ref("uk"),a=r=>{r.detail.key==="locale"&&(t.value=r.detail.newValue)};return e.onMounted(()=>{t.value=localStorage.locale,window.addEventListener("storage",a)}),e.onUnmounted(()=>{window.removeEventListener("resize",a)}),(r,n)=>{var o,s;return e.openBlock(),e.createElementBlock("div",Tf,[r.ua||r.label?(e.openBlock(),e.createElementBlock("div",Lf,[e.createElementVNode("span",$f,e.toDisplayString(r.item[t.value]||r.ua||r.label),1),(s=(o=r.item)==null?void 0:o.rules)!=null&&s.includes("required")?(e.openBlock(),e.createElementBlock("span",Ff,"*")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.renderSlot(r.$slots,"default",e.mergeProps(r.$attrs,{class:{"opacity-60":r.item.disabled}})),r.error?(e.openBlock(),e.createElementBlock("span",If,e.toDisplayString(r.error),1)):e.createCommentVNode("",!0)])}}}),Pf={class:"w-full relative flex flex-row items-center gap-2"},Rf={key:0,class:"text-red-500 text-[14px]"},Uf={key:1,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},jf=e.defineComponent({__name:"vs-layout-horizontal",props:{ua:{default:""},uk:{},en:{},de:{},es:{},fr:{},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""},columns:{default:()=>({container:12,label:3})}},setup(l){const t=l,a=e.computed(()=>t.columns??{container:12,label:3}),r=e.computed(()=>{const{container:i,label:c}=a.value;return!i||i<=0?0:Math.min(Math.max(c??0,0),i)/i}),n=e.computed(()=>{var i;return((i=t.item)==null?void 0:i.type)==="html"||r.value<=0?!1:!!(t.ua||t.label)}),o=e.computed(()=>{if(!n.value)return{};const i=`${r.value*100}%`;return{flexBasis:i,maxWidth:i}}),s=e.computed(()=>{var m;const{container:i,label:c}=a.value;if(!i||i<=0)return{};if(((m=t.item)==null?void 0:m.type)==="html")return{flexBasis:"100%",maxWidth:"100%"};if(!n.value)return{flexBasis:"100%",maxWidth:"100%"};const u=Math.max(i-Math.max(c??0,0),0)/i;if(!u)return{};const d=`${u*100}%`;return{flexBasis:d,maxWidth:d}});return(i,c)=>{var u,d;return e.openBlock(),e.createElementBlock("div",Pf,[n.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:"text-sm text-gray-900 font-medium flex shrink-0",style:e.normalizeStyle(o.value)},[e.createTextVNode(e.toDisplayString(i.ua||i.label)+" ",1),(d=(u=i.item)==null?void 0:u.rules)!=null&&d.includes("required")&&(i.ua||i.label)?(e.openBlock(),e.createElementBlock("span",Rf,"*")):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"flex-1 min-w-0",style:e.normalizeStyle(s.value)},[e.renderSlot(i.$slots,"default",e.normalizeProps(e.guardReactiveProps(i.$attrs)))],4),i.error?(e.openBlock(),e.createElementBlock("span",Uf,e.toDisplayString(i.error),1)):e.createCommentVNode("",!0)])}}}),zf={class:"w-full relative"},Hf={key:0,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},qf=e.defineComponent({__name:"vs-layout-inline",props:{ua:{default:""},uk:{},en:{},de:{},es:{},fr:{},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""},columns:{}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",zf,[e.renderSlot(t.$slots,"default",e.normalizeProps(e.guardReactiveProps(t.$attrs))),t.error?(e.openBlock(),e.createElementBlock("span",Hf,e.toDisplayString(t.error),1)):e.createCommentVNode("",!0)]))}}),Gf={class:"flex-1 min-w-0"},Wf={key:0,class:"text-sm font-medium text-slate-700 dark:text-slate-200 flex items-center gap-1"},Kf={class:"truncate"},Yf={key:0,class:"text-red-500 text-[14px]"},Xf={key:1,class:"text-xs text-slate-500 dark:text-slate-400"},Zf={key:0,class:"mt-1 text-xs text-red-500"},Qf=e.defineComponent({__name:"vs-layout-settings",props:{ua:{default:""},uk:{},en:{},de:{},es:{},fr:{},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""},columns:{}},setup(l){const t=l,a=e.ref("uk");e.computed(()=>{var i;return((i=t.item??{})==null?void 0:i[a.value])??t.ua??t.label??""});const r=e.computed(()=>{var i;return((i=t.item)==null?void 0:i.description)??""}),n=e.computed(()=>{var i;return Array.isArray((i=t.item)==null?void 0:i.rules)&&t.item.rules.includes("required")}),o=e.computed(()=>(typeof t.error=="string"?t.error:"")??""),s=i=>{i.key==="locale"&&(a.value=i.newValue??"uk")};return e.onMounted(()=>{try{typeof localStorage<"u"&&localStorage.locale&&(a.value=localStorage.locale)}catch{}window.addEventListener("storage",s)}),e.onUnmounted(()=>{window.removeEventListener("storage",s)}),(i,c)=>{var u;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["w-full relative",{"opacity-60":(u=i.item)==null?void 0:u.disabled}])},[e.createElementVNode("div",{class:e.normalizeClass(["gap-2 md:flex-row md:items-center md:justify-between",[["switcher","native-select"].includes(i.item.type)?"flex flex-col":""]])},[e.createElementVNode("div",Gf,[i.ua||i.label?(e.openBlock(),e.createElementBlock("p",Wf,[e.createElementVNode("span",Kf,e.toDisplayString(i.item[a.value]||i.ua||i.label),1),n.value?(e.openBlock(),e.createElementBlock("span",Yf,"*")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),r.value?(e.openBlock(),e.createElementBlock("p",Xf,e.toDisplayString(r.value),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["w-full",["select","native-select"].includes(i.item.type)?"md:w-[30%]":"md:w-auto"])},[e.renderSlot(i.$slots,"default",e.normalizeProps(e.guardReactiveProps(i.$attrs)))],2)],2),o.value?(e.openBlock(),e.createElementBlock("p",Zf,e.toDisplayString(o.value),1)):e.createCommentVNode("",!0)],2)}}}),Jf={default:Of,horizontal:jf,inline:qf,settings:Qf};function ft(l){return{inputClass:e.computed(()=>{const t=`disabled:opacity-50 disabled:cursor-not-allowed outline-none focus:ring-2 focus:ring-ring focus:ring-${(l==null?void 0:l.primaryColor)||"blue"}-500 border border-solid border-stone-200 rounded-md text-sm text-stone-800 placeholder:text-stone-400 `;return(l==null?void 0:l.size)==="sm"?`${t}h-[32px]`:`${t}h-[38px]`})}}const eh=["placeholder","disabled"],th=e.defineComponent({__name:"vs-input-password",props:e.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{default:""}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,{inputClass:a}=ft(t.style),r=e.useModel(l,"modelValue"),n=e.computed(()=>!!t.disabled),o=e.computed(()=>t.placeholder??"");return(s,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{type:"password","onUpdate:modelValue":i[0]||(i[0]=c=>r.value=c),placeholder:o.value,disabled:n.value,class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[e.unref(a),{"!border-red-600":s.error}]]),style:{border:"1px solid #CFD9E0"}},null,10,eh)),[[e.vModelText,r.value]])}}),lh=["placeholder","disabled"],Na=e.defineComponent({__name:"vs-input-text",props:e.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{default:""}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,{inputClass:a}=ft(t.style),r=e.useModel(l,"modelValue"),n=e.computed(()=>!!t.disabled),o=e.computed(()=>t.placeholder??"");return(s,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{type:"text","onUpdate:modelValue":i[0]||(i[0]=c=>r.value=c),placeholder:o.value,disabled:n.value,class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[e.unref(a),{"!border-red-600":s.error}]]),style:{border:"1px solid #CFD9E0"}},null,10,lh)),[[e.vModelText,r.value]])}}),ah=["placeholder","disabled","min","max"],rh=e.defineComponent({__name:"vs-input-number",props:e.mergeModels({min:{},max:{},style:{default:()=>({})},customClass:{},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""}},{modelValue:{default:null},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,{inputClass:a}=ft(t.style),r=e.useModel(l,"modelValue"),n=e.computed(()=>!!t.disabled);return(o,s)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{type:"number",step:"any","onUpdate:modelValue":s[0]||(s[0]=i=>r.value=i),placeholder:o.placeholder,disabled:n.value,class:e.normalizeClass(["py-1.5 px-3 block w-full bg-white",[e.unref(a)]]),style:{border:"1px solid #CFD9E0"},min:o.min,max:o.max},null,10,ah)),[[e.vModelText,r.value]])}}),_e=(l,t)=>{const a=l.__vccOpts||l;for(const[r,n]of t)a[r]=n;return a},nh={},oh={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-check"};function sh(l,t){return e.openBlock(),e.createElementBlock("svg",oh,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M5 12l5 5l10 -10"},null,-1)]))}const ih=_e(nh,[["render",sh]]),ch={class:"flex items-center gap-[4px]"},dh=["value","id","disabled"],uh=["for"],mh={class:"text-[14px] text-gray-700 flex items-center dark:text-neutral-400"},ph=e.defineComponent({__name:"vs-checkbox-default",props:{value:{default:""},label:{default:""},disabled:{type:Boolean,default:!1},id:{},modelValue:{default:""},info:{},error:{}},emits:["update:modelValue"],setup(l,{emit:t}){const a=t,r=l,n=e.computed({get:()=>r.modelValue,set:s=>a("update:modelValue",s)}),o=e.computed(()=>!!r.disabled);return(s,i)=>(e.openBlock(),e.createElementBlock("div",ch,[e.withDirectives(e.createElementVNode("input",{type:"checkbox",value:s.value,"onUpdate:modelValue":i[0]||(i[0]=c=>n.value=c),class:e.normalizeClass(["shrink-0 border border-solid hidden border-gray-700 w-3.5 h-3.5 rounded text-blue-600 focus:ring-offset-0 dark:bg-neutral-800 dark:border-neutral-700 cursor-pointer",{"!cursor-not-allowed":o.value}]),id:s.id,disabled:o.value},null,10,dh),[[e.vModelCheckbox,n.value]]),e.createElementVNode("label",{for:s.id,class:e.normalizeClass(["flex flex-1 checkbox-label items-center gap-x-2 cursor-pointer text-sm text-gray-800 dark:text-neutral-300",{"!cursor-not-allowed":o.value}])},[e.createElementVNode("div",{class:e.normalizeClass(["h-[16px] text-white w-[16px] flex items-center justify-center shrink-0 border rounded",[n.value?"bg-blue-600 border-blue-600":"bg-white border-gray-600",s.error?"border-red-600":""]])},[e.createVNode(ih,{height:"12",width:"12"})],2),e.createElementVNode("span",mh,[e.renderSlot(s.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(s.label),1)])])],10,uh)]))}}),fh=["name","value","disabled"],hh={class:"flex items-center gap-[6px] text-[14px]"},gh={key:0,class:"text-[16px]"},bh=["src"],yh=e.defineComponent({__name:"vs-checkbox-buttons",props:{value:{type:[String,Number,Boolean],default:""},label:{default:""},modelValue:{default:""},disabled:{type:Boolean},id:{},icon:{},imgUrl:{},style:{}},emits:["update:modelValue"],setup(l,{emit:t}){const a=l,r=t,n=e.computed({get:()=>a.modelValue,set:i=>{r("update:modelValue",i)}}),o=e.computed(()=>Array.isArray(n.value)?n.value.includes(a.value):n.value===!0||n.value===a.value),s=e.computed(()=>{var i,c;return((i=a.style)==null?void 0:i.size)==="xs"?"p-1.5 text-xs":((c=a.style)==null?void 0:c.size)==="lg"?"p-3.5 text-[20px]":"p-2.5 text-xs"});return(i,c)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["group relative flex justify-center items-center gap-x-3 text-center bg-white text-gray-800 ring-ring ring-2 cursor-pointer rounded-lg",[s.value,o.value?"ring-blue-500":"border border-gray-200 ring-transparent"]])},[e.withDirectives(e.createElementVNode("input",{type:"checkbox",class:"hidden",name:i.id,value:i.value,"onUpdate:modelValue":c[0]||(c[0]=u=>n.value=u),disabled:i.disabled},null,8,fh),[[e.vModelCheckbox,n.value]]),e.createElementVNode("span",hh,[i.icon||i.imgUrl?(e.openBlock(),e.createElementBlock("span",gh,[i.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(i.icon)},null,2)):e.createCommentVNode("",!0),i.imgUrl?(e.openBlock(),e.createElementBlock("img",{key:1,src:i.imgUrl,width:"16",height:"16",alt:"icon"},null,8,bh)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.renderSlot(i.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(i.label),1)])])],2))}}),kh={class:"flex items-center"},Tr=e.defineComponent({__name:"vs-input-checkbox-item",props:{value:{default:""},label:{default:""},disabled:{type:Boolean,default:!1},view:{default:"default"},modelValue:{type:[Boolean,Array],default:!1},icon:{},imgUrl:{},slots:{},option:{},style:{},error:{default:""}},emits:["update:modelValue"],setup(l,{emit:t}){const a=l,r=t,n=`radio-${Math.floor(Math.random()*1e4)}`,o=e.computed({get:()=>Array.isArray(a.modelValue)?Array.isArray(a.modelValue)&&a.modelValue.includes(a.value):a.modelValue,set:i=>{if(Array.isArray(a.modelValue)){let c=[...a.modelValue];i?c.includes(a.value)||c.push(a.value):c=c.filter(u=>u!==a.value),r("update:modelValue",c)}else r("update:modelValue",i)}}),s=e.ref(`vs-checkbox-${a.view||"default"}`);return(i,c)=>{var u;return e.openBlock(),e.createElementBlock("div",kh,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s.value==="vs-checkbox-buttons"?e.unref(yh):e.unref(ph)),{value:i.value,label:i.label,info:(u=i.option)==null?void 0:u.info,disabled:i.disabled,modelValue:o.value,"onUpdate:modelValue":c[0]||(c[0]=d=>o.value=d),id:n,icon:i.icon,imgUrl:i.imgUrl,style:e.normalizeStyle(i.style),error:i.error},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.label),1)]),_:1},8,["value","label","info","disabled","modelValue","icon","imgUrl","style","error"]))])}}}),xh={},wh={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 _h(l,t){return e.openBlock(),e.createElementBlock("svg",wh,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)]))}const Eh=_e(xh,[["render",_h]]),Ch={},Vh={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-x"};function Nh(l,t){return e.openBlock(),e.createElementBlock("svg",Vh,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M18 6l-12 12"},null,-1),e.createElementVNode("path",{d:"M6 6l12 12"},null,-1)]))}const vh=_e(Ch,[["render",Nh]]),Bh={},Sh={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 Dh(l,t){return e.openBlock(),e.createElementBlock("svg",Sh,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M12 9h.01"},null,-1),e.createElementVNode("path",{d:"M11 12h1v4h1"},null,-1),e.createElementVNode("path",{d:"M12 3c7.2 0 9 1.8 9 9s-1.8 9 -9 9s-9 -1.8 -9 -9s1.8 -9 9 -9z"},null,-1)]))}const Ah=_e(Bh,[["render",Dh]]),Mh={key:0,class:"flex items-start gap-x-1"},Th={key:0,class:"text-red-500 text-[14px]"},Lh=["title"],$h=["disabled"],Xo=e.defineComponent({__name:"vs-input-switcher",props:e.mergeModels({rules:{default:()=>[]},view:{default:"checkbox"},label:{default:""},i:{default:""},text:{default:""},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,a=e.useModel(l,"modelValue");return(r,n)=>{var o,s;return t.view==="checkbox"?(e.openBlock(),e.createElementBlock("div",Mh,[e.createVNode(Tr,{modelValue:a.value,"onUpdate:modelValue":n[0]||(n[0]=i=>a.value=i),label:r.text,error:r.error||""},null,8,["modelValue","label","error"]),(o=r.rules)!=null&&o.includes("required")?(e.openBlock(),e.createElementBlock("span",Th,"*")):e.createCommentVNode("",!0),r.i?(e.openBlock(),e.createElementBlock("button",{key:1,class:"cursor-pointer",title:r.i,onClick:n[1]||(n[1]=e.withModifiers(()=>{},["prevent"]))},[e.createVNode(e.unref(Ah),{class:"text-gray-500 w-[14px] h-[14px]"})],8,Lh)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:e.normalizeClass(["inline-flex h-5 w-9 shrink-0 px-[2px] cursor-pointer items-center rounded-full shadow-sm disabled:cursor-not-allowed disabled:opacity-50",[a.value?`bg-${((s=r.style)==null?void 0:s.primaryColor)||"blue"}-500`:"bg-stone-200",r.customClass]]),disabled:r.disabled,onClick:n[2]||(n[2]=i=>a.value=!a.value)},[e.createElementVNode("span",{"data-state":"checked",class:e.normalizeClass(["pointer-events-none block h-4 w-4 rounded-full bg-white shadow-lg ring-0 transition-transform",[a.value?"translate-x-4":"translate-x-0"]])},null,2)],10,$h))}}}),Fh=["id","innerHTML"],Zo=e.defineComponent({__name:"vs-input-static",props:{text:{default:""},html:{default:""},style:{},customClass:{default:""},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",{id:t.name,class:e.normalizeClass(["text-gray-900",t.customClass]),innerHTML:t.html?t.html:t.text},null,10,Fh))}}),Ih=["placeholder","disabled","name"],Oh=e.defineComponent({__name:"vs-input-mask",props:e.mergeModels({name:{},mask:{default:""},unmask:{type:Boolean,default:!1},placeholder:{default:"_"},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,{inputClass:a}=ft(t.style),r=e.useModel(l,"modelValue"),n=e.ref(null);let o=null;return e.onMounted(async()=>{if(n.value){const{default:s}=await Promise.resolve().then(()=>l4);o=s(n.value,{mask:t.mask||"",definitions:{9:/[0-9]/,A:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/},lazy:!1}),o.on("accept",()=>{r.value=t.unmask?o.unmaskedValue:o.value}),o.on("complete",()=>{r.value=t.unmask?o.unmaskedValue:o.value}),o.value=r.value??""}}),e.onBeforeUnmount(()=>{o==null||o.destroy()}),e.watch(()=>t.mask,s=>{o&&o.updateOptions({mask:s,definitions:{9:/[0-9]/,A:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/}})}),e.watch(r,s=>{o&&o.unmaskedValue!==s&&(o.value=s||"")}),(s,i)=>(e.openBlock(),e.createElementBlock("input",{type:"text",ref_key:"inputEl",ref:n,placeholder:s.placeholder,disabled:s.disabled,name:s.name,class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[e.unref(a)]]),style:{border:"1px solid #CFD9E0"}},null,10,Ih))}}),Ph={class:"relative w-full bg-white rounded-lg"},Rh=["placeholder","disabled"],Uh=e.defineComponent({__name:"vs-input-email",props:e.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:null},name:{},placeholder:{default:""}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,{inputClass:a}=ft(t.style),r=e.useModel(l,"modelValue");return(n,o)=>(e.openBlock(),e.createElementBlock("div",Ph,[o[1]||(o[1]=e.createStaticVNode('<div class="absolute bottom-2/4 translate-y-2/4 left-[10px] cursor-pointer"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="stroke-gray-500 transition-all"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10z"></path><path d="M3 7l9 6l9 -6"></path></svg></div>',1)),e.withDirectives(e.createElementVNode("input",{type:"email","onUpdate:modelValue":o[0]||(o[0]=s=>r.value=s),placeholder:n.placeholder,disabled:n.disabled,class:e.normalizeClass(["!pl-8 py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[e.unref(a),{"!border-red-600":n.error}]]),style:{border:"1px solid #CFD9E0"}},null,10,Rh),[[e.vModelText,r.value]])]))}}),jh=["value","disabled"],zh={class:"text-[13px] text-gray-700"},Hh=e.defineComponent({__name:"vs-input-radio-default",props:e.mergeModels({style:{},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{},value:{},text:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,a=e.useModel(l,"modelValue"),r=e.computed(()=>!!t.disabled);return(n,o)=>{var s,i;return e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["flex items-center gap-0",[t.customClass,r.value?"cursor-not-allowed opacity-60":""]])},[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":o[0]||(o[0]=c=>a.value=c),type:"radio",value:t.value,disabled:r.value,class:"hidden"},null,8,jh),[[e.vModelRadio,a.value]]),e.createElementVNode("span",{class:e.normalizeClass(["w-[16px] shrink-0 h-[16px] border rounded-full flex items-center justify-center mr-[10px]",[`border-${((s=t.style)==null?void 0:s.primaryColor)||"blue"}-500`,r.value?"opacity-50 cursor-not-allowed":""]])},[a.value==t.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["w-[12px] h-[12px] shrink-0 rounded-full",[`bg-${((i=t.style)==null?void 0:i.primaryColor)||"blue"}-500`]])},null,2)):e.createCommentVNode("",!0)],2),e.createElementVNode("span",zh,e.toDisplayString(t.text),1)],2)}}}),qh=["value","disabled"],Gh={class:"text-[13px] text-gray-700"},Wh=e.defineComponent({__name:"vs-input-radio-buttons",props:e.mergeModels({style:{},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{},value:{},text:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,a=e.useModel(l,"modelValue"),r=e.computed(()=>!!t.disabled);return(n,o)=>{var s;return e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["flex items-center border rounded-lg px-2 py-1",[a.value==t.value?`ring-2 ring-ring ring-${((s=t.style)==null?void 0:s.primaryColor)||"blue"}-500`:"",t.customClass,r.value?"cursor-not-allowed opacity-60":""]])},[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":o[0]||(o[0]=i=>a.value=i),type:"radio",value:t.value,disabled:r.value,class:"hidden"},null,8,qh),[[e.vModelRadio,a.value]]),e.createElementVNode("span",Gh,e.toDisplayString(t.text),1)],2)}}}),Kh={"vs-input-radio-default":Hh,"vs-input-radio-buttons":Wh},Qo=e.defineComponent({__name:"vs-input-radio",props:e.mergeModels({options:{},position:{default:"vertical"},view:{default:"default"},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,a=e.useModel(l,"modelValue"),r=e.computed(()=>Kh[`vs-input-radio-${t.view}`]);return(n,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([n.position==="horizontal"?"flex items-center flex-wrap gap-2":""])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.options,s=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),e.mergeProps({key:s==null?void 0:s.id,text:s.text,value:s.id.toString(),checked:a.value===s.id,modelValue:a.value,"onUpdate:modelValue":o[0]||(o[0]=i=>a.value=i)},{ref_for:!0},n.$attrs),null,16,["text","value","checked","modelValue"]))),128))],2))}}),Yh={key:1,class:"w-full flex flex-col gap-4"},Xh={key:0,class:"text-sm font-medium text-muted-foreground my-2"},Zh="Без категорії",Qh=e.defineComponent({__name:"vs-input-checkbox",props:{options:{default:()=>[]},position:{default:"vertical"},slots:{default:null},colSpan:{default:0},data:{},view:{},group:{default:void 0},values:{default:()=>[]},style:{},customClass:{},disabled:{type:Boolean},modelValue:{default:!1},error:{},name:{},placeholder:{}},emits:["update:modelValue"],setup(l,{emit:t}){const a=l,r=t,n=e.ref([]),o=e.reactive({}),s=p=>(p==null?void 0:p.value)||(p==null?void 0:p.id)||(p==null?void 0:p.text)||p,i=p=>p.text||String(p),c=p=>`lg:col-span-${p||12}`,u=e.computed(()=>[a.position==="vertical"?"flex flex-col":"",a.colSpan?"grid":"flex justify-start"]),d=p=>p==null||p===""?null:typeof p=="string"||typeof p=="number"?p:String(p),m=e.computed(()=>{var w;if(!a.group)return[];const p=new Map;n.value.forEach(x=>{var N;const k=x[a.group],_=d(k);p.has(_)||p.set(_,[]),(N=p.get(_))==null||N.push(x)});const y=[];(w=a.values)!=null&&w.length&&a.values.forEach(x=>{const k=d(x);y.push(k)});const h=new Set,g=x=>{const k=p.get(x)||[];if(!k.length)return null;const _=x===null?"group-null":`group-${String(x)}`,N=x===null?Zh:String(x);return h.add(x),{key:_,label:N,options:k}},b=[];return y.forEach(x=>{const k=g(x);k&&b.push(k)}),p.forEach((x,k)=>{if(h.has(k))return;const _=g(k);_&&b.push(_)}),b}),f=async()=>{try{const p=await fetch(`/api/suggest/${a.data}`).then(y=>y.json());n.value=(p==null?void 0:p.data)||p}catch(p){console.error(p)}};return e.watch(()=>a.modelValue,p=>{if(typeof p=="boolean"&&n.value.length===1){const y=s(n.value[0]);o[y]=p}else if(Array.isArray(p)){const y=new Set(p);n.value.forEach(h=>{if(!h.disabled){const g=s(h);o[g]=y.has(g)}})}},{immediate:!0}),e.watch(o,()=>{if(!n.value.length){r("update:modelValue",null);return}const p=Object.entries(o).filter(([,y])=>y).map(([y])=>y);r("update:modelValue",p.length===0?[]:p)},{deep:!0}),e.onMounted(()=>{if(a.data)f().then(()=>{if(typeof a.modelValue=="boolean"&&n.value.length===1){const p=s(n.value[0]);o[p]=a.modelValue}else if(Array.isArray(a.modelValue)){const p=new Set(a.modelValue);n.value.forEach(y=>{if(!y.disabled){const h=s(y);o[h]=p.has(h)}})}});else if(n.value=a.options,typeof a.modelValue=="boolean"&&n.value.length===1){const p=s(n.value[0]);o[p]=a.modelValue}else if(Array.isArray(a.modelValue)){const p=new Set(a.modelValue);n.value.forEach(y=>{if(!y.disabled){const h=s(y);o[h]=p.has(h)}})}}),(p,y)=>a.group?(e.openBlock(),e.createElementBlock("div",Yh,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,h=>(e.openBlock(),e.createElementBlock("div",{key:h.key,class:"flex flex-col gap-2"},[h.label?(e.openBlock(),e.createElementBlock("span",Xh,e.toDisplayString(h.label),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["p-0 w-full gap-[12px]",u.value])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.options,g=>(e.openBlock(),e.createBlock(Tr,{modelValue:o[s(g)],"onUpdate:modelValue":b=>o[s(g)]=b,value:s(g),class:e.normalizeClass(c(p.colSpan)),disabled:a.disabled||g.disabled,label:i(g),key:`${h.key}-${s(g)}`,icon:g==null?void 0:g.icon,imgUrl:g==null?void 0:g.imgUrl,option:g,view:p.view},null,8,["modelValue","onUpdate:modelValue","value","class","disabled","label","icon","imgUrl","option","view"]))),128))],2)]))),128))])):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["p-0 w-full gap-[10px]",u.value])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,h=>(e.openBlock(),e.createBlock(Tr,{modelValue:o[s(h)],"onUpdate:modelValue":g=>o[s(h)]=g,value:s(h),class:e.normalizeClass(c(p.colSpan)),disabled:a.disabled||h.disabled,label:i(h),key:s(h),icon:h==null?void 0:h.icon,imgUrl:h==null?void 0:h.imgUrl,option:h,view:p.view},null,8,["modelValue","onUpdate:modelValue","value","class","disabled","label","icon","imgUrl","option","view"]))),128))],2))}}),Jo=_e(Qh,[["__scopeId","data-v-8e66207e"]]),Jh=["type","placeholder","disabled"],e0=e.defineComponent({__name:"vs-input-date1",props:{style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""},mode:{default:"date"}},emits:["update:modelValue"],setup(l,{emit:t}){const a=l;function r(d){return d?a.mode==="datetime"?(d.includes("T")?d:null)||d+(d.includes(" ")?"":"T00:00"):d==null?void 0:d.split(" ")[0]:null}const{inputClass:n}=ft(a.style),o=t,s=e.computed({get:()=>r(a.modelValue),set:d=>o("update:modelValue",d)}),i=e.computed(()=>a.mode==="datetime"?"datetime-local":a.mode),c=e.computed(()=>!!a.disabled),u=e.computed(()=>a.placeholder??"");return(d,m)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{type:i.value,"onUpdate:modelValue":m[0]||(m[0]=f=>s.value=f),placeholder:u.value,disabled:c.value,ref:"date",class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[d.modelValue?"":"text-opacity-50",e.unref(n)].join(" ")]),style:{border:"1px solid #CFD9E0"}},null,10,Jh)),[[e.vModelDynamic,s.value]])}}),es=async(l,t,a,r)=>{var n;try{const o=new FormData;return o.append("unique","true"),o.append("file",l),(n=await fetch(`/file/upload/uploads?id=${t||""}&form=${a||""}&table=${r||""}`,{method:"POST",body:o}).then(s=>s.json()))==null?void 0:n.result}catch(o){return xe({type:"error",title:"Помилка!",message:"Сталась помилка під час завантаження файлу",position:"right-bottom"}),console.error("Сталась помилка завантаження файлу",o),null}},t0=async l=>{try{return await fetch(`file/delete${l}`),!0}catch(t){return console.error(t),!1}},ts=async l=>{try{const t=await fetch(`file/download/files/uploads${l}`),a=await t.arrayBuffer(),r=t.headers["content-type"],n=new TextDecoder("utf-8").decode(a),o=new Blob([n],{type:r}),s=document.createElement("a");s.setAttribute("download",l),s.href=window.URL.createObjectURL(o),s.click()}catch(t){console.error(t.message)}},l0={},a0={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 r0(l,t){return e.openBlock(),e.createElementBlock("svg",a0,t[0]||(t[0]=[e.createElementVNode("path",{d:"M5 12h14"},null,-1),e.createElementVNode("path",{d:"M12 5v14"},null,-1)]))}const Gl=_e(l0,[["render",r0]]),n0={},o0={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-text",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function s0(l,t,a,r,n,o){return e.openBlock(),e.createElementBlock("svg",o0,t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><line x1="9" y1="9" x2="10" y2="9"></line><line x1="9" y1="13" x2="15" y2="13"></line><line x1="9" y1="17" x2="15" y2="17"></line>',6)]))}const i0=_e(n0,[["render",s0]]),c0={},d0={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-table",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function u0(l,t,a,r,n,o){return e.openBlock(),e.createElementBlock("svg",d0,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"},null,-1),e.createElementVNode("line",{x1:"4",y1:"10",x2:"20",y2:"10"},null,-1),e.createElementVNode("line",{x1:"10",y1:"4",x2:"10",y2:"20"},null,-1)]))}const m0=_e(c0,[["render",u0]]),p0={},f0={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 h0(l,t){return e.openBlock(),e.createElementBlock("svg",f0,t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><path d="M9 9l1 0"></path><path d="M9 13l6 0"></path><path d="M9 17l6 0"></path>',6)]))}const ls=_e(p0,[["render",h0]]),g0={},b0={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-zip",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function y0(l,t,a,r,n,o){return e.openBlock(),e.createElementBlock("svg",b0,t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M6 20.735a2 2 0 0 1 -1 -1.735v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2h-1"></path><path d="M11 17a2 2 0 0 1 2 2v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1v-2a2 2 0 0 1 2 -2z"></path><line x1="11" y1="5" x2="10" y2="5"></line><line x1="13" y1="7" x2="12" y2="7"></line><line x1="11" y1="9" x2="10" y2="9"></line><line x1="13" y1="11" x2="12" y2="11"></line><line x1="11" y1="13" x2="10" y2="13"></line><line x1="13" y1="15" x2="12" y2="15"></line>',9)]))}const k0=_e(g0,[["render",y0]]),x0={},w0={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-code",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function _0(l,t,a,r,n,o){return e.openBlock(),e.createElementBlock("svg",w0,t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><path d="M10 13l-1 2l1 2"></path><path d="M14 13l1 2l-1 2"></path>',5)]))}const E0=_e(x0,[["render",_0]]),C0=l=>{if(!l)return"";const t=l==null?void 0:l.split(".");return t[t.length-1]},V0=l=>{const t=C0(l),a={imageFormat:["tiff","jpg","jpeg","png","svg","ico","webp"],sheetsFormat:["xls","csv","xlsx"],archivesFormat:["zip","rar"],textsFormat:["json","geojson","txt","yml","yaml","shp"],documentsFormat:["pdf"]};return a.imageFormat.includes(t)?"img":a.sheetsFormat.includes(t)?m0:a.textsFormat.includes(t)?E0:a.documentsFormat.includes(t)?i0:a.archivesFormat.includes(t)?k0:ls},N0={},v0={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",class:"icon icon-tabler icons-tabler-outline icon-tabler-trash"};function B0(l,t){return e.openBlock(),e.createElementBlock("svg",v0,t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 7l16 0"></path><path d="M10 11l0 6"></path><path d="M14 11l0 6"></path><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"></path><path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"></path>',6)]))}const va=_e(N0,[["render",B0]]),S0={},D0={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",class:"icon icon-tabler icons-tabler-outline icon-tabler-download"};function A0(l,t){return e.openBlock(),e.createElementBlock("svg",D0,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),e.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),e.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const as=_e(S0,[["render",A0]]),M0=["title"],T0={class:"absolute hidden top-0 right-0 flex items-center gap-x-2 w-full h-full justify-center"},L0=e.defineComponent({__name:"vs-input-file-list-item",props:e.mergeModels({format:{},multiple:{type:Boolean},max_size:{},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},{value:{},valueModifiers:{},item:{},itemModifiers:{}}),emits:["update:value","update:item"],setup(l){const t=e.useModel(l,"value"),a=e.useModel(l,"item"),r=l;return(n,o)=>(e.openBlock(),e.createElementBlock("div",{title:a.value,class:"h-[120px] w-[120px] border text-gray-300 border-dashed border-[#CFD9E0] rounded-lg overflow-hidden relative item-file"},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(V0)(a.value)),{src:a.value,alt:"file",class:"w-full h-full object-cover cursor-pointer",onClick:o[0]||(o[0]=s=>e.unref(ts)(a.value))},null,8,["src"])),e.createElementVNode("div",T0,[e.createElementVNode("button",{type:"button",onClick:o[1]||(o[1]=s=>{var i;e.unref(t0)(a.value),t.value=r.multiple?(i=t.value)==null?void 0:i.filter(c=>c!==a.value):""}),class:"w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-red-500"},[e.createVNode(va,{class:"w-4 h-4"})]),e.createElementVNode("button",{type:"button",onClick:o[2]||(o[2]=s=>e.unref(ts)(a.value)),class:"w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-blue-500"},[e.createVNode(as,{class:"w-4 h-4"})])])],8,M0))}}),rs=_e(L0,[["__scopeId","data-v-286cdbc0"]]),$0={class:"flex items-center gap-x-2"},F0=["multiple","disabled"],I0={key:1,class:"flex items-center flex-wrap gap-2"},O0={key:1,class:"loader"},P0={key:1,class:"loader"},R0=e.defineComponent({__name:"vs-input-file",props:e.mergeModels({format:{},multiple:{type:Boolean},max_size:{},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["change"],["update:modelValue"]),setup(l,{emit:t}){const a=l,r=e.useModel(l,"modelValue"),n=t,o=e.ref(null),s=e.ref(!1),i=d=>Array.isArray(r.value)&&r.value[d]||"",c=d=>{if(a.max_size&&d.size>a.max_size*1024*1024){const m=(d.size/1048576).toFixed(2);return xe({type:"error",title:"Помилка!",message:`Файл "${d.name}" занадто великий. Максимальний розмір: ${a.max_size} МБ, розмір файлу: ${m} МБ`,position:"right-bottom"}),!1}return!0},u=async d=>{const{files:m}=d.target;if(!m||m.length===0)return;const f=Array.from(m);if(a.max_size&&f.filter(p=>!c(p)).length>0){o.value&&(o.value.value="");return}s.value=!0;try{if(a.multiple){const p=Array.from(m).map(async h=>a.format&&!h.name.endsWith(a.format)?null:await es(h,"1","form","table")),y=(await Promise.all(p)).filter(h=>h!==null).map(h=>h==null?void 0:h.file_path).filter(Boolean);r.value=[...r.value||[],...y],n("change",r.value)}else{const p=m[0];if(a.format&&!p.name.endsWith(a.format))return;const y=await es(p,"1","form","table");r.value=y==null?void 0:y.file_path,n("change",r.value||"")}}finally{s.value=!1,o.value&&(o.value.value="")}};return(d,m)=>(e.openBlock(),e.createElementBlock("div",$0,[e.createElementVNode("input",{class:"hidden",ref_key:"fileInput",ref:o,type:"file",multiple:d.multiple,onChange:u,disabled:s.value||d.disabled},null,40,F0),!d.multiple&&r.value?(e.openBlock(),e.createBlock(rs,{key:0,item:r.value,"onUpdate:item":m[0]||(m[0]=f=>r.value=f),value:r.value,"onUpdate:value":m[1]||(m[1]=f=>r.value=f)},null,8,["item","value"])):d.multiple?(e.openBlock(),e.createElementBlock("div",I0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(f,p)=>(e.openBlock(),e.createBlock(rs,{multiple:d.multiple,key:p,value:r.value,"onUpdate:value":m[2]||(m[2]=y=>r.value=y),item:i(p)},null,8,["multiple","value","item"]))),128)),e.createElementVNode("div",{onClick:m[3]||(m[3]=f=>{var p;return!d.disabled&&!s.value&&((p=o.value)==null?void 0:p.click())}),class:e.normalizeClass(["relative h-[120px] w-[120px] border text-gray-300 hover:text-blue-500 border-dashed border-[#CFD9E0] rounded-lg flex items-center justify-center transition-all duration-300",d.disabled||s.value?"opacity-50 cursor-not-allowed":"cursor-pointer hover:border-blue-500 hover:bg-blue-50"])},[s.value?(e.openBlock(),e.createElementBlock("div",O0)):(e.openBlock(),e.createBlock(Gl,{key:0,class:"w-6 h-6"}))],2)])):e.createCommentVNode("",!0),d.multiple?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:2,onClick:m[4]||(m[4]=f=>{var p;return(p=o.value)==null?void 0:p.click()}),class:e.normalizeClass([d.disabled||s.value?"opacity-50 cursor-not-allowed":"cursor-pointer hover:border-blue-500","relative h-[120px] w-[120px] border text-gray-300 hover:text-blue-500 border-dashed border-gray-300 rounded-lg flex items-center justify-center cursor-pointer hover:border-blue-500 transition-all duration-300 hover:bg-blue-50"])},[s.value?(e.openBlock(),e.createElementBlock("div",P0)):(e.openBlock(),e.createBlock(Gl,{key:0,class:"w-6 h-6"}))],2))]))}}),U0=_e(R0,[["__scopeId","data-v-e613a523"]]),j0={class:"max-w-[55vw]"},z0={class:"text-sm font-semibold text-gray-800 truncate dark:text-neutral-200"},H0={class:"flex items-center text-xs text-gray-500 truncate dark:text-neutral-500"},q0={class:"px-[5px]"},G0={class:""},Ba=e.defineComponent({__name:"vs-widget-file-info",props:{item:{default:null}},setup(l){const t=l,a=e.computed(()=>{try{return new Date(t.item.cdate).toLocaleDateString("uk-UA",{day:"2-digit",month:"long",year:"numeric"})}catch{return""}});function r(n){if(n<1024)return`${n} B`;const o=n/1024;return o<1024?`${o.toFixed(2)} KB`:`${(o/1024).toFixed(2)} MB`}return(n,o)=>{var s,i,c,u;return e.openBlock(),e.createElementBlock(e.Fragment,null,[o[1]||(o[1]=e.createStaticVNode('<div class="flex items-center justify-center h-[30px] w-[30px]"><svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" 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-file"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path></svg></div>',1)),e.createElementVNode("div",j0,[e.createElementVNode("p",z0,e.toDisplayString((s=n.item)==null?void 0:s.uploaded_name),1),e.createElementVNode("p",H0,[e.createElementVNode("span",null,e.toDisplayString((i=n.item)==null?void 0:i.username),1),e.withDirectives(e.createElementVNode("span",q0,"|",512),[[e.vShow,(c=n.item)==null?void 0:c.username]]),e.createElementVNode("span",null,e.toDisplayString(a.value),1),o[0]||(o[0]=e.createElementVNode("span",{class:"px-[5px]"},"|",-1)),e.createElementVNode("span",G0,e.toDisplayString(r((u=n.item)==null?void 0:u.size)),1)])])],64)}}}),W0={class:"p-3 relative group flex items-center gap-x-3 border border-gray-200 bg-white rounded-md w-full"},K0={key:0,class:"flex w-full gap-x-3 items-center"},Y0={key:1,class:"flex gap-x-3 w-full items-center"},X0={key:2,class:"flex gap-x-3 w-full items-center"},Z0=["href"],Q0={key:3,class:"flex gap-x-3 w-full items-center"},J0={class:"lg:absolute lg:top-3 lg:end-1 opacity-100"},eg={class:"p-0.5 sm:p-1 inline-flex items-center gap-0.5 bg-white rounded-lg dark:bg-neutral-800 dark:border-neutral-700"},tg={class:"inline-block"},lg={class:"inline-block"},ag=e.defineComponent({__name:"vs-widget-file-item",props:{item:{default:null},index:{default:0},prefix:{default:"/api"}},emits:["update","openModal","openLightbox"],setup(l,{emit:t}){const a=l,r=t;function n(d){return["pdf","json"].includes(d.ext)}function o(d){return["ppt","pptx","doc","docx","xls","xlsx"].includes(d.ext)}function s(d){const m=document.createElement("a");m.setAttribute("download",d==null?void 0:d.uploaded_name),m.href=d==null?void 0:d.file_path,m.click()}async function i(){try{await fetch(`${a.prefix}/widget/file/${a.item.entity_id}/${a.item.file_id}`),r("update")}catch(d){console.error(d)}}function c(){r("openModal",{title:"Ви впевнені?",message:"Ви впевнені, що хочете видалити цей файл?",confirmButtonText:"Так, я впевнена/ий",cancelButtonText:"Скасувати",confirm:i,updateListOnConfirm:!0})}function u(d){(a.item.ext==="jpg"||a.item.ext==="png")&&r("openLightbox",{item:a.item,index:d})}return(d,m)=>(e.openBlock(),e.createElementBlock("div",W0,[d.item.ext==="jpg"||d.item.ext==="png"?(e.openBlock(),e.createElementBlock("div",K0,[e.createElementVNode("div",{class:"max-w-[55vw] cursor-pointer flex gap-x-3 w-full items-center",onClick:m[0]||(m[0]=f=>u(d.index))},[e.createVNode(Ba,{item:d.item},null,8,["item"])])])):n(d.item)?(e.openBlock(),e.createElementBlock("div",Y0,[e.createVNode(Ba,{item:d.item},null,8,["item"])])):o(d.item)?(e.openBlock(),e.createElementBlock("div",X0,[e.createElementVNode("a",{href:`/api/file-preview?id=${d.item.file_id}`,target:"_blank",class:"flex gap-x-3 w-full items-center"},[e.createVNode(Ba,{item:d.item},null,8,["item"])],8,Z0)])):(e.openBlock(),e.createElementBlock("div",Q0,[e.createVNode(Ba,{item:d.item},null,8,["item"])])),e.createElementVNode("div",J0,[e.createElementVNode("div",eg,[e.createElementVNode("div",tg,[e.createElementVNode("button",{class:"inline-flex p-[6px] justify-center items-center gap-x-2 rounded-lg border border-transparent text-gray-500 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none dark:text-neutral-400 focus:outline-none focus:bg-gray-100 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:m[1]||(m[1]=f=>s(d.item))},[e.createVNode(as,{height:"14",width:"14"})])]),m[3]||(m[3]=e.createElementVNode("div",{class:"w-px h-5 mx-1 bg-gray-200 dark:bg-neutral-700"},null,-1)),e.createElementVNode("div",lg,[e.createElementVNode("button",{type:"button",class:"size-[30px] inline-flex justify-center items-center gap-x-2 rounded-lg border border-transparent text-red-600 hover:bg-red-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-red-100 dark:text-red-500 dark:hover:bg-red-500/20 dark:focus:bg-red-500/20",onClick:m[2]||(m[2]=f=>c())},[e.createVNode(va,{height:"14",width:"14"})])])])])]))}}),rg={},ng={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",class:"icon icon-tabler icons-tabler-outline icon-tabler-download"};function og(l,t){return e.openBlock(),e.createElementBlock("svg",ng,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),e.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),e.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const sg=_e(rg,[["render",og]]),ig={class:"flex flex-col widget-file xl:bg-white xl:rounded-xl dark:xl:bg-neutral-800 dark:xl:border-neutral-700 w-full"},cg={class:"flex w-full mb-[12px] items-center gap-x-2"},dg={class:"font-semibold text-gray-800 dark:text-neutral-200 text-[14px]"},ug={class1:"ml-auto"},mg={class:"py-1.5 px-4 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg bg-gray-100 cursor-pointer hover:bg-gray-200 text-gray-800 shadow-2xs hover:bg-gray-50 focus:outline-hidden focus:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},pg={key:0,class:"py-4 mb-4 space-y-4 border-gray-200 border-y dark:border-neutral-700"},fg={class:"relative"},hg={key:1,class:"space-y-3 max-h-[300px] 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"},gg={key:0},bg=e.defineComponent({__name:"vs-input-file-list",props:{id:{default:""},prefix:{default:"/api"},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},emits:["update"],setup(l,{emit:t}){const a=l,r=e.inject("form"),n=e.computed(()=>r.value.formId),o=e.ref(!1),s=e.ref(0),i=t,c=e.ref(!1),u=e.ref({}),d=e.ref([]),m=e.ref(""),f=e.computed(()=>Array.isArray(d.value)?d.value.filter(x=>x.ext==="jpg"||x.ext==="png").map(x=>x==null?void 0:x.file_path):[]),p=e.computed(()=>m.value===""?d.value:d.value.filter(x=>{var k;return(k=x==null?void 0:x.uploaded_name)==null?void 0:k.includes(m.value)})),y=x=>{const k=f.value.findIndex(_=>_===x.item.file_path);k!==-1&&(o.value=!0,s.value=k)},h=async()=>{try{const x=await fetch(`${a.prefix}/widget/file/${n.value}`).then(k=>k.json());d.value=x==null?void 0:x.rows}catch(x){console.error(x)}},g=async x=>{await Promise.all(Array.from(x.target.files).map(async k=>{const _=new FormData;_.append("file",k);try{const N=`${a.prefix}/widget/file/${n.value}`,V=await fetch(N,{method:"POST",body:_});return V.ok?(i("update","file-list"),k):(xe({type:V.status>=400&&V.status<500?"warning":"error",title:"Error",message:`Error code: ${V.status}`}),null)}catch(N){return xe({type:"error",title:"Error",message:N.message||"Unknown error"}),console.error(N),null}})),await h()},b=x=>{const k={...x};return x.cancel||(k.cancel=()=>{c.value=!1}),x.updateListOnConfirm&&(k.confirm=async()=>{await x.confirm(),c.value=!1,h()}),k},w=x=>{u.value=b(x),c.value=!0};return e.watch(n,x=>{x&&h()}),e.onMounted(()=>{n.value&&h()}),(x,k)=>{var V,P,$;const _=e.resolveComponent("Lightbox"),N=e.resolveComponent("MessageBox");return e.openBlock(),e.createElementBlock("div",ig,[e.createElementVNode("div",cg,[e.createElementVNode("h2",dg," Файлів: "+e.toDisplayString((V=d.value)==null?void 0:V.length),1),e.createElementVNode("div",ug,[e.createElementVNode("label",null,[e.createElementVNode("input",{type:"file",class:"hidden",onChange:k[0]||(k[0]=M=>g(M))},null,32),e.createElementVNode("div",mg,[e.createVNode(sg,{height:"16",width:"16"})])])])]),((P=d.value)==null?void 0:P.length)>4?(e.openBlock(),e.createElementBlock("div",pg,[e.createElementVNode("div",null,[e.createElementVNode("div",fg,[k[8]||(k[8]=e.createElementVNode("div",{class:"absolute inset-y-0 start-0 flex items-center pointer-events-none z-[1] ps-3.5"},[e.createElementVNode("svg",{class:"flex-shrink-0 text-gray-500 size-4 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"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),e.createElementVNode("path",{d:"m21 21-4.3-4.3"})])],-1)),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":k[1]||(k[1]=M=>m.value=M),class:"py-2 px-3 ps-10 pe-16 block w-full bg-gray-200 xl:bg-gray-100 rounded-lg text-sm focus:border-blue-500 h-[40px] focus:border-2 focus:outline-none 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:"Введіть назву файлу"},null,512),[[e.vModelText,m.value,void 0,{trim:!0}]])])])])):e.createCommentVNode("",!0),($=d.value)!=null&&$.length?(e.openBlock(),e.createElementBlock("div",hg,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,(M,A)=>(e.openBlock(),e.createBlock(ag,{key:A,prefix:x.prefix,item:M,index:A,onUpdate:k[2]||(k[2]=q=>x.$emit("update","file-list")),onOpenModal:k[3]||(k[3]=q=>w(q)),onOpenLightbox:k[4]||(k[4]=q=>y(q))},null,8,["prefix","item","index"]))),128)),p.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",gg,k[9]||(k[9]=[e.createElementVNode("p",{class:"text-sm text-gray-600 font-sm"}," Файлів з такою назвою не існує, введіть інше пошукове слово ",-1)])))])):e.createCommentVNode("",!0),e.createVNode(_,{modelValue:o.value,"onUpdate:modelValue":k[5]||(k[5]=M=>o.value=M),startIndex:s.value,"onUpdate:index":k[6]||(k[6]=M=>s.value=M),images:f.value},null,8,["modelValue","startIndex","images"]),e.createVNode(N,e.mergeProps({modelValue:c.value,"onUpdate:modelValue":k[7]||(k[7]=M=>c.value=M),onConfirm:u.value.confirm},u.value),null,16,["modelValue","onConfirm"])])}}}),yg={class:"flex items-center justify-between"},kg={class:"text-[16px] text-gray-900 font-medium"},xg={class:"grid gap-3"},wg=e.defineComponent({__name:"vs-container-switcher",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})},isOpen:{type:Boolean,default:!1}},setup(l){const t=l,a=e.ref(t.isOpen);return e.watch(()=>t.isOpen,r=>{a.value=r}),(r,n)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",yg,[e.createElementVNode("p",kg,e.toDisplayString(l.title),1),e.createVNode(Xo,{modelValue:a.value,"onUpdate:modelValue":n[0]||(n[0]=o=>a.value=o),style:e.normalizeStyle(l.style)},null,8,["modelValue","style"])]),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",xg,[e.renderSlot(r.$slots,"default",{},void 0,!0)],512),[[e.vShow,a.value]])]),_:3})]))}}),_g=_e(wg,[["__scopeId","data-v-90320b87"]]),Eg={class:"text-[16px] text-gray-900 font-medium"},Cg={class:"grid gap-3"},Vg=e.defineComponent({__name:"vs-container-accordion",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})},isOpen:{type:Boolean,default:!1}},setup(l){const t=l,a=e.ref(t.isOpen);return e.watch(()=>t.isOpen,r=>{a.value=r}),(r,n)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("button",{type:"button",onClick:n[0]||(n[0]=o=>a.value=!a.value),class:"flex items-center gap-2"},[e.createVNode(e.unref(Eh),{class:e.normalizeClass(["h-4 w-4 duration-300",[a.value?"-rotate-180":""]])},null,8,["class"]),e.createElementVNode("span",Eg,e.toDisplayString(l.title),1)]),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",Cg,[e.renderSlot(r.$slots,"default",{},void 0,!0)],512),[[e.vShow,a.value]])]),_:3})]))}}),Ng=_e(Vg,[["__scopeId","data-v-590eff11"]]),vg={class:"flex items-center justify-between"},Bg=e.defineComponent({__name:"vs-container-default",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",vg,[e.createElementVNode("p",null,e.toDisplayString(l.title),1)]),e.renderSlot(t.$slots,"default")]))}}),Sg={switcher:_g,accordion:Ng,default:Bg},wt={Equal:"==",Inequal:"!=",Higer:">",HigerOrEqual:">=",Lower:"<",LowerOrEqual:"<=",Between:"between",StartWith:"^",EndWith:"$",Contain:"*",In:"in",NotIn:"not_in"},Dg=(l,t)=>String(l)===String(t),Ag=(l,t)=>String(l)!==String(t),Mg=(l,t)=>l>t,Tg=(l,t)=>l>=t,Lg=(l,t)=>l<t,$g=(l,t)=>l<=t,Fg=(l,t)=>Array.isArray(t)&&t.length===2?l>=t[0]&&l<=t[1]:!1,Ig=(l,t)=>String(l).startsWith(String(t)),Og=(l,t)=>String(l).endsWith(String(t)),Pg=(l,t)=>String(l).includes(String(t)),Rg=(l,t)=>Array.isArray(t)?t.includes(l):!1,Ug=(l,t)=>Array.isArray(t)?!t.includes(l):!0,ns=(l,t)=>{if(!t)return!0;switch(t==null?void 0:t[1]){case wt.Equal:return Dg(l,t==null?void 0:t[2]);case wt.Inequal:return Ag(l,t==null?void 0:t[2]);case wt.Higer:return Mg(l,t==null?void 0:t[2]);case wt.HigerOrEqual:return Tg(l,t==null?void 0:t[2]);case wt.Lower:return Lg(l,t==null?void 0:t[2]);case wt.LowerOrEqual:return $g(l,t==null?void 0:t[2]);case wt.Between:return Fg(l,t==null?void 0:t[2]);case wt.StartWith:return Ig(l,t==null?void 0:t[2]);case wt.EndWith:return Og(l,t==null?void 0:t[2]);case wt.Contain:return Pg(l,t==null?void 0:t[2]);case wt.In:return Rg(l,t==null?void 0:t[2]);case wt.NotIn:return Ug(l,t==null?void 0:t[2]);default:return!0}},jg=e.defineComponent({__name:"vs-input-container",props:{style:{type:Object,default:()=>({})},title:{type:String,default:""},view:{type:String,default:"default"},name:{type:String,default:""},schema:{type:Array,default:()=>[]}},setup(l){const t=l,a=e.inject("values",e.ref({})),r=e.inject("form"),n=e.computed(()=>{var i;return(i=t.schema)==null?void 0:i.filter(c=>{var f,p,y,h;const u=c==null?void 0:c.conditions;if(!u)return!0;const d=Array.isArray(u)?u[0]:u,m=t.name?((p=(f=a.value)==null?void 0:f[t.name])==null?void 0:p[d])??((y=a.value)==null?void 0:y[d]):(h=a.value)==null?void 0:h[d];return ns(m,u)})}),o=e.computed(()=>Sg[t.view]),s=e.computed(()=>{if(a.value||(a.value={}),!t.name)return a.value;const i=a.value[t.name];if(i)return i;const c={};return a.value={...a.value,[t.name]:c},c});return(i,c)=>{var u;return(u=l.schema)!=null&&u.length?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value),{key:0,title:l.title,style:e.normalizeStyle(l.style)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,d=>{var m,f;return e.openBlock(),e.createBlock(ss,e.mergeProps({key:d.name},{ref_for:!0},d,{item:d,modelValue:s.value[d.name],"onUpdate:modelValue":p=>s.value[d.name]=p,style:l.style,error:(f=(m=e.unref(r))==null?void 0:m.errors)==null?void 0:f[d.name]}),null,16,["item","modelValue","onUpdate:modelValue","style","error"])}),128))]),_:1},8,["title","style"])):e.createCommentVNode("",!0)}}}),zg=["aria-expanded","data-focus"],Hg={key:0,class:"flex flex-wrap items-center gap-1 overflow-y-auto min-w-0 flex-1"},qg={class:"flex items-center min-w-0"},Gg=["title"],Wg=["innerHTML"],Kg=["onClick"],Yg={class:"flex-1 min-w-[2px]"},Xg=["placeholder"],Zg=["title"],Qg=["innerHTML"],Jg={key:2,class:"flex-1 min-w-[2px]"},eb=["placeholder"],tb={class:"flex items-center shrink-0"},lb=["disabled"],ab=["disabled","title"],rb=["aria-disabled","onClick"],nb=["innerHTML"],ob={key:1,class:"px-3 py-2 text-center text-gray-500"},sb=["disabled"],Lr=e.defineComponent({__name:"vs-input-select",props:{multiple:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},mode:{},defaultValue:{},search:{type:Boolean,default:!0},placeholder:{default:"Оберіть значення"},prefix:{default:"api"},host:{default:""},data:{default:""},options:{default:()=>[]},api:{default:null},maxHeight:{default:400},parent:{},set:{},slot:{},add:{},teleport:{default:"body"},auto:{default:0},style:{default:()=>({})},customClass:{default:""},modelValue:{},error:{default:null},name:{}},emits:["change","update:modelValue"],setup(l,{emit:t}){const a=l,r=t,n=e.computed(()=>a.multiple),o=e.computed(()=>a.disabled);ft(a.style);const s=e.computed({get:()=>a.modelValue,set:B=>r("update:modelValue",B)});!s.value&&a.defaultValue&&(s.value=a.defaultValue);const i=e.ref(null),c=e.ref(null),u=e.ref(null),d=e.ref(null),m=e.ref(!1),f=e.ref(!1),p=e.ref(null),y=e.ref([]),h=e.ref(-1),g=e.ref([]),b=e.ref(""),w=e.ref(null),x=e.ref("bottom"),k=e.ref({}),_=e.ref([]),N=e.computed(()=>{if(!_.value.length)return[];const B=y.value,T=new Map(B.map(K=>{var te;return[(te=K.id)==null?void 0:te.toString(),K]}));return _.value.map(K=>T.get(K==null?void 0:K.toString())).filter(K=>!!K)}),V=e.computed(()=>a.placeholder||"Select..."),P=e.computed(()=>D(p.value));e.computed(()=>n.value?!_.value.length&&b.value==="":!P.value&&b.value==="");const $=e.computed(()=>o.value?!1:n.value?_.value.length>0:!!s.value),M=B=>{var T;return n.value?_.value.some(K=>(K==null?void 0:K.toString())===(B==null?void 0:B.toString())):((T=s.value)==null?void 0:T.toString())===(B==null?void 0:B.toString())},A=e.computed(()=>{let B=y.value??[];if(!a.data&&b.value.trim()!==""){const T=b.value.toLowerCase();B=B.filter(K=>{var we,Oe;const te=D(K).toLowerCase(),he=((Oe=(we=K.text)==null?void 0:we.toLowerCase)==null?void 0:Oe.call(we))||"";return te.includes(T)||he.includes(T)})}if(n.value&&_.value.length){const T=new Set(_.value.map(K=>K==null?void 0:K.toString()));B=B.filter(K=>{var te;return!T.has((te=K.id)==null?void 0:te.toString())})}return B}),q=e.inject("values"),Q=/\{\{\s*([^}]+?)\s*\}\}/g,R=B=>(B?String(B):"").replace(/<[^>]*>/g,"").trim(),I=e.computed(()=>a.slot??(a==null?void 0:a.optionTemplate)??""),F=B=>{if(!B)return"";const T=I.value;return T?T.replace(Q,(K,te)=>{const he=te.trim(),we=B[he];return we!=null?String(we):""}):B.text??""},D=B=>{if(!B)return"";if(!I.value)return B.text??"";const T=F(B);return R(T)||B.text||""},z=B=>{a.set&&(q!=null&&q.value)&&Object.entries(a.set).forEach(([T,K])=>{if(!T)return;const te=B?B[K]:null;q.value[T]=te??null})},ee=e.computed(()=>{var B,T;return a.parent?((T=(B=q==null?void 0:q.value)==null?void 0:B[a.parent])==null?void 0:T.toString())??null:null}),me=async B=>{var T;if(!a.data){let K=a.options??[];if(B!=null&&B.trim()){const te=B.toLowerCase();K=K.filter(he=>{var oe,mt;const we=D(he).toLowerCase(),Oe=((mt=(oe=he.text)==null?void 0:oe.toLowerCase)==null?void 0:mt.call(oe))||"";return we.includes(te)||Oe.includes(te)})}return K}try{const K=a.host??"",te=a.prefix??"api",he=a.api??`/${te}/suggest/${a.data}`,we=`${K}${he}`,Oe=new URLSearchParams;return Oe.set("json","1"),B&&Oe.set("key",B),ee.value!==void 0&&ee.value!==null&&ee.value!==""&&Oe.set("parent",ee.value),((T=await fetch(`${we}?${Oe.toString()}`).then(oe=>oe.json()))==null?void 0:T.data)??[]}catch{return[]}},Ne=async()=>{a.data?y.value=await me(b.value):y.value=a.options?[...a.options]:[]},Ke=async B=>{var K,te,he;if(B==null)return null;const T=(K=y.value)==null?void 0:K.find(we=>{var Oe;return((Oe=we==null?void 0:we.id)==null?void 0:Oe.toString())===String(B)});if(T)return T;if(a.data)try{const we=a.host??"",Oe=a.prefix??"api",oe=a.api??`/${Oe}/suggest/${a.data}`,mt=`${we}${oe}`,Bt=new URLSearchParams;return Bt.set("json","1"),Bt.set("val",String(B)),ee.value!==void 0&&ee.value!==null&&ee.value!==""&&Bt.set("parent",ee.value),((he=((te=await fetch(`${mt}?${Bt.toString()}`).then(gl=>gl.json()))==null?void 0:te.data)??[])==null?void 0:he[0])??null}catch{return null}return null},qt=async B=>{const T=new Set(y.value.map(te=>{var he;return(he=te.id)==null?void 0:he.toString()})),K=B.filter(te=>!T.has(te==null?void 0:te.toString()));K.length&&await K.reduce(async(te,he)=>{await te;const we=await Ke(he);we&&y.value.push(we)},Promise.resolve())},Re=async()=>{o.value||(m.value=!0,await Ne(),await e.nextTick(()=>{var B;le(),(B=w.value)==null||B.focus(),A.value.length?h.value=0:h.value=-1}))},Ye=()=>{m.value=!1,h.value=-1},vt=async B=>{o.value||(m.value?Ye():await Re())},yt=async()=>{var B;m.value?(B=w.value)==null||B.focus():await Re()},Et=()=>{n.value?(_.value=[],s.value=[],r("change",[])):(p.value=null,s.value=null,r("change",null)),z(null),b.value="",e.nextTick(()=>{var B;return(B=w.value)==null?void 0:B.focus()})},Pt=B=>{n.value&&(_.value=_.value.filter(T=>(T==null?void 0:T.toString())!==(B==null?void 0:B.toString())),s.value=[..._.value],r("change",s.value),e.nextTick(()=>{var T;return(T=w.value)==null?void 0:T.focus()}))},at=B=>{n.value?(M(B.id)||(_.value=[..._.value,B.id],s.value=[..._.value],r("change",s.value)),b.value="",e.nextTick(()=>{var T;(T=w.value)==null||T.focus(),h.value=Math.min(h.value,A.value.length-1)}),z(null)):(p.value=B,s.value=B.id,r("change",s.value),b.value="",Ye(),z(B))},st=B=>{M(B.id)||at(B)},U=(B,T)=>{if(!B||!T)return;const K=B.offsetTop,te=K+B.offsetHeight,he=T.scrollTop,we=he+T.clientHeight;let Oe=T.scrollTop;K<he?Oe=K-80:te>we&&(Oe=te-T.clientHeight+4);const oe=T;oe.scrollTop=Oe},Y=B=>{let T=B.parentElement;for(;T;){if(T.classList.contains("ui-dialog__content"))return T;const K=window.getComputedStyle(T),te=K.overflow+K.overflowY+K.overflowX;if(te.includes("auto")||te.includes("scroll")||T===document.body||T===document.documentElement)return T;T=T.parentElement}return document.body},le=()=>{if(!c.value)return;const B=c.value.getBoundingClientRect(),T=window.innerHeight||document.documentElement.clientHeight,K=window.innerWidth||document.documentElement.clientWidth,te=8,he=8,we=a.maxHeight||300,Oe=T-B.bottom-he-te,oe=B.top-he-te,mt=Oe>=oe,Bt=Math.max(K-te*2,0);let{width:gl}=B;Bt>0&&gl>Bt&&(gl=Bt);let{left:ca}=B;ca+gl+te>K&&(ca=K-gl-te),ca=Math.max(ca,te);const n4=Math.min(we,Math.max(mt?Oe:oe,50));x.value=mt?"bottom":"top",k.value={position:"fixed",left:`${ca}px`,width:`${gl}px`,minWidth:"300px",maxHeight:`${n4}px`,transform:mt?"none":"translateY(-100%)",top:mt?`${B.bottom+he}px`:`${B.top-he}px`}},ae=async B=>{o.value||!m.value&&(B.key==="ArrowDown"||B.key==="ArrowUp")&&(B.preventDefault(),await Re())},de=B=>{var K;if(!m.value)return;const{key:T}=B;if(T==="ArrowDown")B.preventDefault(),h.value+1<A.value.length&&(h.value+=1,U(g.value[h.value],u.value));else if(T==="ArrowUp")B.preventDefault(),h.value>0&&(h.value-=1,U(g.value[h.value],u.value));else if(T==="Enter"){B.preventDefault();const te=A.value[h.value];te&&at(te),(K=w.value)==null||K.blur()}else T==="Escape"?(B.preventDefault(),Ye()):T==="Backspace"?n.value&&b.value===""&&_.value.length&&(_.value=_.value.slice(0,-1),s.value=[..._.value],r("change",s.value)):T==="Home"?(h.value=0,U(g.value[0],u.value)):T==="End"?(h.value=A.value.length-1,U(g.value[h.value],u.value)):T==="Tab"&&Ye()},Ae=()=>{o.value||(f.value=!0)},C=()=>{f.value=!1,b.value=""},v=B=>{B.key==="Escape"&&m.value&&Ye()},H=B=>{var K,te;const T=B.target;(K=i.value)!=null&&K.contains(T)||(te=d.value)!=null&&te.contains(T)||Ye()},re=B=>{m.value&&u.value&&!u.value.contains(B.target)&&le()},Te=()=>{m.value&&le()},Le=()=>{m.value&&le()};e.watch(()=>a.options,B=>{B!=null&&B.length&&(y.value=[...B],be())},{immediate:!0});async function be(){if(n.value)Array.isArray(s.value)?_.value=[...s.value]:(_.value=s.value==null?[]:[s.value],s.value=[..._.value]),a.data&&_.value.length&&(await qt(_.value),await e.nextTick());else{if(Array.isArray(s.value)){const B=s.value[0]??null;s.value=B??null}s.value!=null&&(p.value=await Ke(s.value)),z(p.value??null)}}e.watch(s,()=>{be()}),e.onMounted(async()=>{var B;addEventListener("keydown",v),addEventListener("scroll",re,!0),addEventListener("resize",Te),document.addEventListener("click",H,!0),c.value&&Y(c.value).addEventListener("scroll",Le,!0),(B=a.options)!=null&&B.length&&!a.data?y.value=[...a.options]:a.data&&(y.value=await me("")),await be(),Z.value=!1}),e.onUnmounted(()=>{removeEventListener("keydown",v),removeEventListener("scroll",re,!0),removeEventListener("resize",Te),document.removeEventListener("click",H,!0),c.value&&Y(c.value).removeEventListener("scroll",Le,!0)});const O=e.ref(!1),G=e.ref({}),ye=e.ref([]),Be=e.ref(null);async function E(){var K,te;if(!((K=a.add)!=null&&K.token)||Be!=null&&Be.value.validate())return;const B=a.add.api??`/api/table/${a.add.token}`,{id:T}=await fetch(B,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(G.value)}).then(he=>he.json());if(!((te=a.options)!=null&&te.length)&&a.data){const{data:he}=await fetch(`${a.api??`/api/suggest/${a.data}`}?val=${T}`).then(we=>we.json());p.value=he[0],y.value.push(he[0]),s.value=T}O.value=!1,xe({title:"Success!",message:"Object created."})}async function S(){if(!a.add)return null;const B=await fetch(`/api/template/form/${a.add.form}`).then(T=>T.json());return ye.value=B.schema,O.value=!0,null}function j(B,T=200){let K;return(...te)=>{K&&clearTimeout(K),K=window.setTimeout(()=>B(...te),T)}}const W=j(async B=>{y.value=await me(B)},200);e.watch(b,B=>{a.data&&W(B.trim())}),e.watch(()=>a.options,B=>{!a.data&&(B!=null&&B.length)&&(y.value=[...B],be())},{immediate:!0}),e.watch(()=>a.parent??a.parentValue,()=>{a.data&&Ne()});const Z=e.ref(!0);return e.watch(ee,async()=>{if(a.data&&(Z.value||(n.value?(_.value=[],s.value=[],r("change",[])):(p.value=null,s.value=null,r("change",null))),await Ne(),a.auto===1&&ee.value&&y.value.length>0)){const B=y.value[0];B&&at(B)}}),(B,T)=>{var K,te,he,we,Oe;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(Zt),{visible:O.value,"onUpdate:visible":T[1]||(T[1]=oe=>O.value=oe),title:"Додати",buttonText:"Додати",onDone:E,teleport:B.teleport},{default:e.withCtx(()=>[e.createVNode(Xe,{schema:ye.value,modelValue:G.value,"onUpdate:modelValue":T[0]||(T[0]=oe=>G.value=oe),ref_key:"addForm",ref:Be},null,8,["schema","modelValue"])]),_:1},8,["visible","teleport"]),e.createElementVNode("div",{class:"flex gap-1 w-full",ref_key:"selectRoot",ref:i,onClick:T[5]||(T[5]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:e.normalizeClass(["relative w-full font-sans",a.customClass])},[T[10]||(T[10]=e.createElementVNode("span",{id:"react-select-live-region",class:"sr-only"},null,-1)),T[11]||(T[11]=e.createElementVNode("span",{"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions text",role:"log",class:"sr-only"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["flex min-h-[38px] items-center justify-between rounded border transition-colors bg-white","border-gray-300 hover:border-gray-400",m.value||f.value?"border-blue-500 ring-1 ring-blue-500":"",o.value?"bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300":""]),role:"combobox","aria-expanded":m.value,"aria-haspopup":"listbox",onKeydown:ae,onClick:yt,"data-focus":m.value||f.value?"true":"false"},[e.createElementVNode("div",{class:"flex flex-1 items-center gap-1 py-0.5 pl-2 pr-0 overflow-hidden h-full",ref_key:"triggerRef",ref:c},[n.value?(e.openBlock(),e.createElementBlock("div",Hg,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,oe=>(e.openBlock(),e.createElementBlock("div",{class:"flex min-w-0 bg-[#e6e6e6] rounded-sm m-0.5 box-border max-w-full",key:oe.id},[e.createElementVNode("div",qg,[oe!=null&&oe.color?(e.openBlock(),e.createElementBlock("span",{key:0,class:"w-[16px] h-[16px] rounded-md block ml-1.5 flex-shrink-0",style:e.normalizeStyle({backgroundColor:oe==null?void 0:oe.color})},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"truncate text-gray-900 overflow-hidden max-w-[200px] px-0.5 py-[2px] pl-1.5",title:D(oe)},[I.value?(e.openBlock(),e.createElementBlock("span",{key:0,innerHTML:F(oe)},null,8,Wg)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(oe.text),1)],64))],8,Gg)]),e.createElementVNode("div",{role:"button",class:"flex items-center rounded-sm px-1 box-border hover:bg-[#ffbdad] hover:text-[#de350b] flex-shrink-0",onClick:e.withModifiers(mt=>Pt(oe.id),["stop"])},T[6]||(T[6]=[e.createElementVNode("svg",{height:"14",width:"14",viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",class:"inline-block fill-current stroke-current leading-none stroke-0"},[e.createElementVNode("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"})],-1)]),8,Kg)]))),128)),e.createElementVNode("div",Yg,[!o.value&&B.search?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,ref_key:"inputRef",ref:w,class:"w-full bg-transparent outline-none border-0 m-0 p-0 text-gray-900",autocapitalize:"none",autocomplete:"off",autocorrect:"off",spellcheck:"false",type:"text",tabindex:"0","aria-autocomplete":"list",placeholder:_.value.length?" ":V.value,"onUpdate:modelValue":T[2]||(T[2]=oe=>b.value=oe),onFocus:Ae,onBlur:C,onKeydown:de},null,40,Xg)),[[e.vModelText,b.value]]):e.createCommentVNode("",!0)])])):!n.value&&!f.value&&P.value&&b.value===""?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["truncate text-gray-900"]),title:P.value},[(K=p.value)!=null&&K.color?(e.openBlock(),e.createElementBlock("span",{key:0,class:"w-[14px] h-[14px] rounded-md block mr-1 mt-1 absolute",style:e.normalizeStyle({backgroundColor:(te=p.value)==null?void 0:te.color})},null,4)):e.createCommentVNode("",!0),I.value?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass({"pl-5":(he=p.value)==null?void 0:he.color}),innerHTML:F(p.value)},null,10,Qg)):(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass({"pl-5":(we=p.value)==null?void 0:we.color})},e.toDisplayString((Oe=p.value)==null?void 0:Oe.text),3))],8,Zg)):e.createCommentVNode("",!0),n.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Jg,[!o.value&&B.search?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,ref_key:"inputRef",ref:w,class:"w-full bg-transparent outline-none border-0 m-0 p-0 text-gray-900",autocapitalize:"none",autocomplete:"off",autocorrect:"off",spellcheck:"false",type:"text",tabindex:"0","aria-autocomplete":"list",placeholder:P.value?" ":V.value,"onUpdate:modelValue":T[3]||(T[3]=oe=>b.value=oe),onFocus:Ae,onBlur:C,onKeydown:de},null,40,eb)),[[e.vModelText,b.value]]):e.createCommentVNode("",!0)]))],512),e.createElementVNode("div",tb,[$.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50","aria-hidden":"true",disabled:o.value,onClick:e.withModifiers(Et,["stop"])},T[7]||(T[7]=[e.createElementVNode("svg",{height:"20",width:"20",viewBox:"0 0 20 20",class:"fill-current"},[e.createElementVNode("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"})],-1)]),8,lb)):e.createCommentVNode("",!0),T[9]||(T[9]=e.createElementVNode("div",{class:"self-stretch w-px bg-[#ccc] my-[1px]"},null,-1)),e.createElementVNode("button",{type:"button",class:"px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50","aria-hidden":"true",disabled:o.value,onClick:T[4]||(T[4]=e.withModifiers(oe=>vt(),["stop"])),title:m.value?"Закрити список":"Відкрити список"},T[8]||(T[8]=[e.createElementVNode("svg",{height:"20",width:"20",viewBox:"0 0 20 20",class:"fill-current"},[e.createElementVNode("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"})],-1)]),8,ab)])],42,zg),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[m.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"dropdownRef",ref:d,class:e.normalizeClass(["fixed z-[3000] rounded bg-white shadow-[0_0_0_1px_rgba(0,0,0,0.1),0_4px_11px_rgba(0,0,0,0.1)]"]),style:e.normalizeStyle(k.value),role:"listbox"},[e.createElementVNode("div",{class:"overflow-y-auto py-1",style:e.normalizeStyle({maxHeight:k.value.maxHeight||"300px"}),ref_key:"listRef",ref:u},[A.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(A.value,(oe,mt)=>(e.openBlock(),e.createElementBlock("div",{key:oe.id,ref_for:!0,ref:Bt=>g.value[mt]=Bt,class:e.normalizeClass(["flex px-3 py-2 cursor-default select-none text-gray-900 ",M(oe.id)?"bg-blue-500 text-white":"bg-white hover:bg-blue-100",h.value===mt&&!M(oe.id)?"bg-blue-100":""]),"aria-disabled":M(oe.id)?"true":"false",role:"option",tabindex:"-1",onClick:Bt=>st(oe)},[oe!=null&&oe.color?(e.openBlock(),e.createElementBlock("span",{key:0,class:"w-[11px] h-[11px] rounded-full block mr-1 mt-1.5",style:e.normalizeStyle({backgroundColor:oe==null?void 0:oe.color})},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["leading-[19px]",h.value===oe.id?"text-white":"",(h.value,"")])},[I.value?(e.openBlock(),e.createElementBlock("span",{key:0,innerHTML:F(oe)},null,8,nb)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(oe.text),1)],64))],2)],10,rb))),128)):(e.openBlock(),e.createElementBlock("div",ob," No options "))],4)],4)):e.createCommentVNode("",!0)]))],2),a.add?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:S,class:"bg-white hover:bg-gray-100 text-sm text-gray-900 py-[10px] px-3 border border-stone-200 rounded-md h-[38px] flex items-center gap-2",disabled:o.value,type:"button"},[e.createVNode(Gl,{width:"16",height:"16"}),T[12]||(T[12]=e.createElementVNode("span",null,"Додати",-1))],8,sb)):e.createCommentVNode("",!0)],512)],64)}}}),ib=["placeholder","disabled"],cb=e.defineComponent({__name:"vs-input-textarea",props:e.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,{inputClass:a}=ft(t.style),r=e.useModel(l,"modelValue"),n=e.computed(()=>!!t.disabled),o=e.computed(()=>t.placeholder??"");return(s,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{"onUpdate:modelValue":i[0]||(i[0]=c=>r.value=c),placeholder:o.value,disabled:n.value,row:"2",class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] h-auto bg-white",[e.unref(a)]]),style:{border:"1px solid #CFD9E0"}},null,10,ib)),[[e.vModelText,r.value]])}}),db={},ub={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-search stroke-gray-500 transition-all"};function mb(l,t){return e.openBlock(),e.createElementBlock("svg",ub,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"},null,-1),e.createElementVNode("path",{d:"M21 21l-6 -6"},null,-1)]))}const pb=_e(db,[["render",mb]]),fb={},hb={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 gb(l,t){return e.openBlock(),e.createElementBlock("svg",hb,t[0]||(t[0]=[e.createElementVNode("path",{d:"m3 16 4 4 4-4"},null,-1),e.createElementVNode("path",{d:"M7 20V4"},null,-1),e.createElementVNode("path",{d:"m21 8-4-4-4 4"},null,-1),e.createElementVNode("path",{d:"M17 4v16"},null,-1)]))}const bb=_e(fb,[["render",gb]]),yb={},kb={xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function xb(l,t){return e.openBlock(),e.createElementBlock("svg",kb,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),e.createElementVNode("path",{d:"M7 9l5 -5l5 5"},null,-1),e.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const wb=_e(yb,[["render",xb]]),_b={},Eb={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 Cb(l,t){return e.openBlock(),e.createElementBlock("svg",Eb,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),e.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),e.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const Vb=_e(_b,[["render",Cb]]),Nb={},vb={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 Bb(l,t){return e.openBlock(),e.createElementBlock("svg",vb,t[0]||(t[0]=[e.createStaticVNode('<circle cx="9" cy="12" r="1"></circle><circle cx="9" cy="5" r="1"></circle><circle cx="9" cy="19" r="1"></circle><circle cx="15" cy="12" r="1"></circle><circle cx="15" cy="5" r="1"></circle><circle cx="15" cy="19" r="1"></circle>',6)]))}const os=_e(Nb,[["render",Bb]]),Sb={},Db={viewBox:"0 0 178 90",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Ab(l,t){return e.openBlock(),e.createElementBlock("svg",Db,t[0]||(t[0]=[e.createStaticVNode('<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>',12)]))}const Mb=_e(Sb,[["render",Ab]]),Tb={},Lb={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 $b(l,t){return e.openBlock(),e.createElementBlock("svg",Lb,t[0]||(t[0]=[e.createElementVNode("path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"},null,-1)]))}const Fb=_e(Tb,[["render",$b]]),Ib={class:"vs-datatable border rounded-xl w-full flex-grow"},Ob={class:"flex items-center npm gap-[16px] justify-between p-[20px] pb-[16px]"},Pb={class:"relative w-full"},Rb={class:"table-wrapper flex gap-2"},Ub={class:"vs-popover inline-block text-slate-700"},jb={class:"text-center"},zb={class:""},Hb={class:"py-1 px-0 w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg focus:outline-none focus:bg-stone-100 dark:bg-neutral-900 dark:text-neutral-200 dark:focus:bg-neutral-800 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full"},qb={class:"flex flex-col p-[1px] gap-[2px] w-[140px]"},Gb={class:"text-sm items-center text-gray-800 flex gap-1"},Wb={class:"w-full overflow-x-auto"},Kb={class:"w-full table-auto caption-bottom text-sm"},Yb={class:"[&_tr]:border-b"},Xb={class:"border-b data-[state=selected]:bg-muted bg-slate-50/50 dark:bg-slate-700/50 hover:bg-slate-50/80 dark:hover:bg-slate-700/80 transition-colors"},Zb={class:"h-10 px-2 align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] w-12 text-center"},Qb={key:0,colspan:"100%",class:"text-center"},Jb={class:"w-full"},ey={class:"p-5 min-h-[200px] flex flex-col justify-center items-center text-center"},ty=["onDragstart","onDragover","onDrop"],ly={class:"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] text-center"},ay={class:"flex items-center justify-center"},ry={key:0,class:"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-slate-100 dark:bg-slate-700 text-slate-700 dark:text-slate-300 hover:bg-slate-200 dark:hover:bg-slate-600 transition-colors"},ny={key:0},oy=["src"],sy={key:1,class:"rounded-md max-w-[45px] w-[45px] max-h-[45px] h-[45px] bg-gray-200 flex items-center justify-center"},iy=["innerHTML"],cy={key:2,class:"line-clamp-2 rounded-md border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-slate-100 dark:bg-slate-700 text-slate-700 dark:text-slate-300 hover:bg-slate-200 dark:hover:bg-slate-600 transition-colors"},dy={key:3,class:"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-slate-100 dark:bg-slate-700 text-slate-700 dark:text-slate-300 hover:bg-slate-200 dark:hover:bg-slate-600 transition-colors"},uy={class:"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]"},my={class:"flex items-center justify-center gap-2"},py=["onClick"],fy=["onClick"],hy={class:"vs-form__head mr-5 mt-3 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white"},gy=e.defineComponent({__name:"vs-input-datatable",props:e.mergeModels({colModel:{},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,a=e.useModel(l,"modelValue"),r=e.ref({}),n=e.ref(""),o=e.computed(()=>{if(!n.value)return a.value??[];const I=n.value.toLowerCase();return a.value.filter(F=>{var D;return(D=t.colModel)==null?void 0:D.some(z=>{const ee=F[z.key];return ee?Array.isArray(ee)?ee.join(", ").toLowerCase().includes(I):String(ee).toLowerCase().includes(I):!1})})}),s=e.ref(null),i=e.ref(null),c=e.ref(!1),u=e.ref(null),d=e.ref({top:0,left:0}),m=I=>{s.value=I},f=I=>{i.value=I},p=I=>{if(s.value===null||s.value===I){s.value=null,i.value=null;return}const F=[...a.value],[D]=F.splice(s.value,1);F.splice(I,0,D),a.value=F,s.value=null,i.value=null},y=I=>{const F=I.currentTarget.getBoundingClientRect();d.value={top:F.bottom+window.scrollY,left:F.left+window.scrollX},c.value=!c.value},h=()=>{u.value&&u.value.click()},g=I=>{const F=[".jpg",".jpeg",".png",".gif",".bmp",".webp",".svg",".ico",".tiff",".tif"],D=I.toLowerCase();return F.some(z=>D.endsWith(z))},b=I=>{var z;const F=(z=I.target.files)==null?void 0:z[0];if(!F)return;const D=new FileReader;D.onload=ee=>{var me;try{const Ne=(me=ee.target)==null?void 0:me.result;if(typeof Ne=="string"){const Ke=JSON.parse(Ne);Array.isArray(Ke)&&a.value.push(...Ke)}}catch(Ne){console.error("Error parsing file:",Ne)}},D.readAsText(F)},w=()=>{const I=JSON.stringify(a.value,null,2),F=new Blob([I],{type:"application/json"}),D=URL.createObjectURL(F),z=document.createElement("a");z.href=D,z.download="data.json",z.click(),URL.revokeObjectURL(D)};e.onMounted(async()=>{var F;const I=(F=t.colModel)==null?void 0:F.filter(D=>D.data);I!=null&&I.length&&Promise.all(I.map(async D=>{const z=await(await fetch(`/api/suggest/${D.data}`)).json();r.value[D.key]=z.data}))});const x=e.ref(""),k=e.ref(!1);let _="edit",N=0;const V=e.ref({}),P=e.ref({});async function $(){x.value="Додати",k.value=!0,_="add",V.value={}}function M(I,F){var z;const D=F.key||F.name;return r.value[D]&&I[D]?((z=r.value[D].find(ee=>ee.id.toString()===I[D].toString()))==null?void 0:z.text)??I[D]:I[D]||"-"}async function A(I,F){x.value="Редагувати",k.value=!0,_="edit",N=F,V.value={...I}}function q(){const I=P.value.validate();if(I){xe({type:"warning",title:"Помилка валідації",message:Object.entries(I).map(([F,D])=>`${F}: ${D}`).join(`
227
+ About how to use the Composition API mode, see https://vue-i18n.intlify.dev/guide/advanced/composition.html`,[At.DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE]:"'v-t' has been deprecated in v11. Use translate APIs ('t' or '$t') instead."};function zl(l,...t){return ha(qd[l],...t)}function Hl(l){if(!Ee(l)||kt(l))return l;for(const t in l)if(Vt(l,t))if(!t.includes("."))Ee(l[t])&&Hl(l[t]);else{const a=t.split("."),r=a.length-1;let n=l,o=!1;for(let s=0;s<r;s++){if(a[s]==="__proto__")throw new Error(`unsafe key: ${a[s]}`);if(a[s]in n||(n[a[s]]=Se()),!Ee(n[a[s]])){process.env.NODE_ENV!=="production"&&Wt(zl(At.IGNORE_OBJ_FLATTEN,{key:a[s]})),o=!0;break}n=n[a[s]]}if(o||(kt(n)?Wn.includes(a[r])||delete l[t]:(n[a[r]]=l[t],delete l[t])),!kt(n)){const s=n[a[r]];Ee(s)&&Hl(s)}}return l}function Cr(l,t){const{messages:a,__i18n:r,messageResolver:n,flatJson:o}=t,s=ke(a)?a:Pe(r)?Se():{[l]:Se()};if(Pe(r)&&r.forEach(i=>{if("locale"in i&&"resource"in i){const{locale:c,resource:u}=i;c?(s[c]=s[c]||Se(),ya(u,s[c])):ya(u,s)}else J(i)&&ya(JSON.parse(i),s)}),n==null&&o)for(const i in s)Vt(s,i)&&Hl(s[i]);return s}function No(l){return l.type}function vo(l,t,a){let r=Ee(t.messages)?t.messages:Se();"__i18nGlobal"in a&&(r=Cr(l.locale.value,{messages:r,__i18n:a.__i18nGlobal}));const n=Object.keys(r);n.length&&n.forEach(o=>{l.mergeLocaleMessage(o,r[o])});{if(Ee(t.datetimeFormats)){const o=Object.keys(t.datetimeFormats);o.length&&o.forEach(s=>{l.mergeDateTimeFormat(s,t.datetimeFormats[s])})}if(Ee(t.numberFormats)){const o=Object.keys(t.numberFormats);o.length&&o.forEach(s=>{l.mergeNumberFormat(s,t.numberFormats[s])})}}}function Bo(l){return e.createVNode(e.Text,null,l,0)}const So="__INTLIFY_META__",Do=()=>[],Gd=()=>!1;let Ao=0;function Mo(l){return(t,a,r,n)=>l(a,r,e.getCurrentInstance()||void 0,n)}const Wd=()=>{const l=e.getCurrentInstance();let t=null;return l&&(t=No(l)[So])?{[So]:t}:null};function Vr(l={}){const{__root:t,__injectWithOption:a}=l,r=t===void 0,n=l.flatJson,o=Ct?e.ref:e.shallowRef;let s=Ce(l.inheritLocale)?l.inheritLocale:!0;const i=o(t&&s?t.locale.value:J(l.locale)?l.locale:Rl),c=o(t&&s?t.fallbackLocale.value:J(l.fallbackLocale)||Pe(l.fallbackLocale)||ke(l.fallbackLocale)||l.fallbackLocale===!1?l.fallbackLocale:i.value),u=o(Cr(i.value,l)),d=o(ke(l.datetimeFormats)?l.datetimeFormats:{[i.value]:{}}),m=o(ke(l.numberFormats)?l.numberFormats:{[i.value]:{}});let f=t?t.missingWarn:Ce(l.missingWarn)||_l(l.missingWarn)?l.missingWarn:!0,p=t?t.fallbackWarn:Ce(l.fallbackWarn)||_l(l.fallbackWarn)?l.fallbackWarn:!0,y=t?t.fallbackRoot:Ce(l.fallbackRoot)?l.fallbackRoot:!0,h=!!l.fallbackFormat,g=De(l.missing)?l.missing:null,b=De(l.missing)?Mo(l.missing):null,w=De(l.postTranslation)?l.postTranslation:null,x=t?t.warnHtmlMessage:Ce(l.warnHtmlMessage)?l.warnHtmlMessage:!0,k=!!l.escapeParameter;const _=t?t.modifiers:ke(l.modifiers)?l.modifiers:{};let N=l.pluralRules||t&&t.pluralRules,V;V=(()=>{r&&no(null);const O={version:jd,locale:i.value,fallbackLocale:c.value,messages:u.value,modifiers:_,pluralRules:N,missing:b===null?void 0:b,missingWarn:f,fallbackWarn:p,fallbackFormat:h,unresolving:!0,postTranslation:w===null?void 0:w,warnHtmlMessage:x,escapeParameter:k,messageResolver:l.messageResolver,messageCompiler:l.messageCompiler,__meta:{framework:"vue"}};O.datetimeFormats=d.value,O.numberFormats=m.value,O.__datetimeFormatters=ke(V)?V.__datetimeFormatters:void 0,O.__numberFormatters=ke(V)?V.__numberFormatters:void 0,process.env.NODE_ENV!=="production"&&(O.__v_emitter=ke(V)?V.__v_emitter:void 0);const G=kd(O);return r&&no(G),G})(),Ul(V,i.value,c.value);function $(){return[i.value,c.value,u.value,d.value,m.value]}const M=e.computed({get:()=>i.value,set:O=>{V.locale=O,i.value=O}}),A=e.computed({get:()=>c.value,set:O=>{V.fallbackLocale=O,c.value=O,Ul(V,i.value,O)}}),q=e.computed(()=>u.value),Q=e.computed(()=>d.value),R=e.computed(()=>m.value);function I(){return De(w)?w:null}function F(O){w=O,V.postTranslation=O}function D(){return g}function z(O){O!==null&&(b=Mo(O)),g=O,V.missing=b}function ee(O,G){return O!=="translate"||!G.resolvedMessage}const me=(O,G,ye,Be,E,S)=>{$();let j;try{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,r||(V.fallbackContext=t?yd():void 0),j=O(V)}finally{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,r||(V.fallbackContext=void 0)}if(ye!=="translate exists"&&ze(j)&&j===wa||ye==="translate exists"&&!j){const[W,Z]=G();if(process.env.NODE_ENV!=="production"&&t&&J(W)&&ee(ye,Z)&&(y&&(Ea(p,W)||so(f,W))&&Wt(zl(At.FALLBACK_TO_ROOT,{key:W,type:ye})),process.env.NODE_ENV!=="production")){const{__v_emitter:B}=V;B&&y&&B.emit("fallback",{type:ye,key:W,to:"global",groupId:`${ye}:${W}`})}return t&&y?Be(t):E(W)}else{if(S(j))return j;throw ct(Me.UNEXPECTED_RETURN_TYPE)}};function Ne(...O){return me(G=>Reflect.apply(xo,null,[G,...O]),()=>yr(...O),"translate",G=>Reflect.apply(G.t,G,[...O]),G=>G,G=>J(G))}function Ke(...O){const[G,ye,Be]=O;if(Be&&!Ee(Be))throw ct(Me.INVALID_ARGUMENT);return Ne(G,ye,Ge({resolvedMessage:!0},Be||{}))}function qt(...O){return me(G=>Reflect.apply(mo,null,[G,...O]),()=>gr(...O),"datetime format",G=>Reflect.apply(G.d,G,[...O]),()=>_a,G=>J(G)||Pe(G))}function Re(...O){return me(G=>Reflect.apply(ho,null,[G,...O]),()=>br(...O),"number format",G=>Reflect.apply(G.n,G,[...O]),()=>_a,G=>J(G)||Pe(G))}function Ye(O){return O.map(G=>J(G)||ze(G)||Ce(G)?Bo(String(G)):G)}const yt={normalize:Ye,interpolate:O=>O,type:"vnode"};function Et(...O){return me(G=>{let ye;const Be=G;try{Be.processor=yt,ye=Reflect.apply(xo,null,[Be,...O])}finally{Be.processor=null}return ye},()=>yr(...O),"translate",G=>G[xr](...O),G=>[Bo(G)],G=>Pe(G))}function Pt(...O){return me(G=>Reflect.apply(ho,null,[G,...O]),()=>br(...O),"number format",G=>G[_r](...O),Do,G=>J(G)||Pe(G))}function at(...O){return me(G=>Reflect.apply(mo,null,[G,...O]),()=>gr(...O),"datetime format",G=>G[wr](...O),Do,G=>J(G)||Pe(G))}function st(O){N=O,V.pluralRules=N}function U(O,G){return me(()=>{if(!O)return!1;const ye=J(G)?G:i.value,Be=ae(ye),E=V.messageResolver(Be,O);return kt(E)||xt(E)||J(E)},()=>[O],"translate exists",ye=>Reflect.apply(ye.te,ye,[O,G]),Gd,ye=>Ce(ye))}function Y(O){let G=null;const ye=Xn(V,c.value,i.value);for(let Be=0;Be<ye.length;Be++){const E=u.value[ye[Be]]||{},S=V.messageResolver(E,O);if(S!=null){G=S;break}}return G}function le(O){const G=Y(O);return G??(t?t.tm(O)||{}:{})}function ae(O){return u.value[O]||{}}function de(O,G){if(n){const ye={[O]:G};for(const Be in ye)Vt(ye,Be)&&Hl(ye[Be]);G=ye[O]}u.value[O]=G,V.messages=u.value}function Ae(O,G){u.value[O]=u.value[O]||{};const ye={[O]:G};if(n)for(const Be in ye)Vt(ye,Be)&&Hl(ye[Be]);G=ye[O],ya(G,u.value[O]),V.messages=u.value}function C(O){return d.value[O]||{}}function v(O,G){d.value[O]=G,V.datetimeFormats=d.value,fo(V,O,G)}function H(O,G){d.value[O]=Ge(d.value[O]||{},G),V.datetimeFormats=d.value,fo(V,O,G)}function re(O){return m.value[O]||{}}function Te(O,G){m.value[O]=G,V.numberFormats=m.value,bo(V,O,G)}function Le(O,G){m.value[O]=Ge(m.value[O]||{},G),V.numberFormats=m.value,bo(V,O,G)}Ao++,t&&Ct&&(e.watch(t.locale,O=>{s&&(i.value=O,V.locale=O,Ul(V,i.value,c.value))}),e.watch(t.fallbackLocale,O=>{s&&(c.value=O,V.fallbackLocale=O,Ul(V,i.value,c.value))}));const be={id:Ao,locale:M,fallbackLocale:A,get inheritLocale(){return s},set inheritLocale(O){s=O,O&&t&&(i.value=t.locale.value,c.value=t.fallbackLocale.value,Ul(V,i.value,c.value))},get availableLocales(){return Object.keys(u.value).sort()},messages:q,get modifiers(){return _},get pluralRules(){return N||{}},get isGlobal(){return r},get missingWarn(){return f},set missingWarn(O){f=O,V.missingWarn=f},get fallbackWarn(){return p},set fallbackWarn(O){p=O,V.fallbackWarn=p},get fallbackRoot(){return y},set fallbackRoot(O){y=O},get fallbackFormat(){return h},set fallbackFormat(O){h=O,V.fallbackFormat=h},get warnHtmlMessage(){return x},set warnHtmlMessage(O){x=O,V.warnHtmlMessage=O},get escapeParameter(){return k},set escapeParameter(O){k=O,V.escapeParameter=O},t:Ne,getLocaleMessage:ae,setLocaleMessage:de,mergeLocaleMessage:Ae,getPostTranslationHandler:I,setPostTranslationHandler:F,getMissingHandler:D,setMissingHandler:z,[Co]:st};return be.datetimeFormats=Q,be.numberFormats=R,be.rt=Ke,be.te=U,be.tm=le,be.d=qt,be.n=Re,be.getDateTimeFormat=C,be.setDateTimeFormat=v,be.mergeDateTimeFormat=H,be.getNumberFormat=re,be.setNumberFormat=Te,be.mergeNumberFormat=Le,be[Vo]=a,be[xr]=Et,be[wr]=at,be[_r]=Pt,process.env.NODE_ENV!=="production"&&(be[il]=O=>{V.__v_emitter=O},be[jl]=()=>{V.__v_emitter=void 0}),be}const To="vue-i18n: composer properties",Nr={"vue-devtools-plugin-vue-i18n":"Vue I18n DevTools","vue-i18n-resource-inspector":"Vue I18n DevTools","vue-i18n-timeline":"Vue I18n"},Kd={"vue-i18n-resource-inspector":"Search for scopes ..."},Yd={"vue-i18n-timeline":16764185};let vr;async function Xd(l,t){return new Promise((a,r)=>{try{Ud({id:"vue-devtools-plugin-vue-i18n",label:Nr["vue-devtools-plugin-vue-i18n"],packageName:"vue-i18n",homepage:"https://vue-i18n.intlify.dev",logo:"https://vue-i18n.intlify.dev/vue-i18n-devtools-logo.png",componentStateTypes:[To],app:l},n=>{vr=n,n.on.visitComponentTree(({componentInstance:s,treeNode:i})=>{Zd(s,i,t)}),n.on.inspectComponent(({componentInstance:s,instanceData:i})=>{s.vnode.el&&s.vnode.el.__VUE_I18N__&&i&&(t.mode==="legacy"?s.vnode.el.__VUE_I18N__!==t.global.__composer&&$o(i,s.vnode.el.__VUE_I18N__):$o(i,s.vnode.el.__VUE_I18N__))}),n.addInspector({id:"vue-i18n-resource-inspector",label:Nr["vue-i18n-resource-inspector"],icon:"language",treeFilterPlaceholder:Kd["vue-i18n-resource-inspector"]}),n.on.getInspectorTree(s=>{s.app===l&&s.inspectorId==="vue-i18n-resource-inspector"&&lu(s,t)});const o=new Map;n.on.getInspectorState(async s=>{if(s.app===l&&s.inspectorId==="vue-i18n-resource-inspector")if(n.unhighlightElement(),ru(s,t),s.nodeId==="global"){if(!o.has(s.app)){const[i]=await n.getComponentInstances(s.app);o.set(s.app,i)}n.highlightElement(o.get(s.app))}else{const i=au(s.nodeId,t);i&&n.highlightElement(i)}}),n.on.editInspectorState(s=>{s.app===l&&s.inspectorId==="vue-i18n-resource-inspector"&&ou(s,t)}),n.addTimelineLayer({id:"vue-i18n-timeline",label:Nr["vue-i18n-timeline"],color:Yd["vue-i18n-timeline"]}),a(!0)})}catch(n){console.error(n),r(!1)}})}function Lo(l){return l.type.name||l.type.displayName||l.type.__file||"Anonymous"}function Zd(l,t,a){const r=a.mode==="composition"?a.global:a.global.__composer;if(l&&l.vnode.el&&l.vnode.el.__VUE_I18N__&&l.vnode.el.__VUE_I18N__!==r){const n={label:`i18n (${Lo(l)} Scope)`,textColor:0,backgroundColor:16764185};t.tags.push(n)}}function $o(l,t){const a=To;l.state.push({type:a,key:"locale",editable:!0,value:t.locale.value}),l.state.push({type:a,key:"availableLocales",editable:!1,value:t.availableLocales}),l.state.push({type:a,key:"fallbackLocale",editable:!0,value:t.fallbackLocale.value}),l.state.push({type:a,key:"inheritLocale",editable:!0,value:t.inheritLocale}),l.state.push({type:a,key:"messages",editable:!1,value:Br(t.messages.value)}),l.state.push({type:a,key:"datetimeFormats",editable:!1,value:t.datetimeFormats.value}),l.state.push({type:a,key:"numberFormats",editable:!1,value:t.numberFormats.value})}function Br(l){const t={};return Object.keys(l).forEach(a=>{const r=l[a];De(r)&&"source"in r?t[a]=tu(r):kt(r)&&r.loc&&r.loc.source?t[a]=r.loc.source:Ee(r)?t[a]=Br(r):t[a]=r}),t}const Qd={"<":"&lt;",">":"&gt;",'"':"&quot;","&":"&amp;"};function Jd(l){return l.replace(/[<>"&]/g,eu)}function eu(l){return Qd[l]||l}function tu(l){return{_custom:{type:"function",display:`<span>ƒ</span> ${l.source?`("${Jd(l.source)}")`:"(?)"}`}}}function lu(l,t){l.rootNodes.push({id:"global",label:"Global Scope"});const a=t.mode==="composition"?t.global:t.global.__composer;for(const[r,n]of t.__instances){const o=t.mode==="composition"?n:n.__composer;a!==o&&l.rootNodes.push({id:o.id.toString(),label:`${Lo(r)} Scope`})}}function au(l,t){let a=null;if(l!=="global"){for(const[r,n]of t.__instances.entries())if(n.id.toString()===l){a=r;break}}return a}function Fo(l,t){if(l==="global")return t.mode==="composition"?t.global:t.global.__composer;{const a=Array.from(t.__instances.values()).find(r=>r.id.toString()===l);return a?t.mode==="composition"?a:a.__composer:null}}function ru(l,t){const a=Fo(l.nodeId,t);return a&&(l.state=nu(a)),null}function nu(l){const t={},a="Locale related info",r=[{type:a,key:"locale",editable:!0,value:l.locale.value},{type:a,key:"fallbackLocale",editable:!0,value:l.fallbackLocale.value},{type:a,key:"availableLocales",editable:!1,value:l.availableLocales},{type:a,key:"inheritLocale",editable:!0,value:l.inheritLocale}];t[a]=r;const n="Locale messages info",o=[{type:n,key:"messages",editable:!1,value:Br(l.messages.value)}];t[n]=o;{const s="Datetime formats info",i=[{type:s,key:"datetimeFormats",editable:!1,value:l.datetimeFormats.value}];t[s]=i;const c="Datetime formats info",u=[{type:c,key:"numberFormats",editable:!1,value:l.numberFormats.value}];t[c]=u}return t}function ql(l,t){if(vr){let a;t&&"groupId"in t&&(a=t.groupId,delete t.groupId),vr.addTimelineEvent({layerId:"vue-i18n-timeline",event:{title:l,groupId:a,time:Date.now(),meta:{},data:t||{},logType:l==="compile-error"?"error":l==="fallback"||l==="missing"?"warning":"default"}})}}function ou(l,t){const a=Fo(l.nodeId,t);if(a){const[r]=l.path;r==="locale"&&J(l.state.value)?a.locale.value=l.state.value:r==="fallbackLocale"&&(J(l.state.value)||Pe(l.state.value)||Ee(l.state.value))?a.fallbackLocale.value=l.state.value:r==="inheritLocale"&&Ce(l.state.value)&&(a.inheritLocale=l.state.value)}}function su(l){const t=J(l.locale)?l.locale:Rl,a=J(l.fallbackLocale)||Pe(l.fallbackLocale)||ke(l.fallbackLocale)||l.fallbackLocale===!1?l.fallbackLocale:t,r=De(l.missing)?l.missing:void 0,n=Ce(l.silentTranslationWarn)||_l(l.silentTranslationWarn)?!l.silentTranslationWarn:!0,o=Ce(l.silentFallbackWarn)||_l(l.silentFallbackWarn)?!l.silentFallbackWarn:!0,s=Ce(l.fallbackRoot)?l.fallbackRoot:!0,i=!!l.formatFallbackMessages,c=ke(l.modifiers)?l.modifiers:{},u=l.pluralizationRules,d=De(l.postTranslation)?l.postTranslation:void 0,m=J(l.warnHtmlInMessage)?l.warnHtmlInMessage!=="off":!0,f=!!l.escapeParameterHtml,p=Ce(l.sync)?l.sync:!0;let y=l.messages;if(ke(l.sharedMessages)){const _=l.sharedMessages;y=Object.keys(_).reduce((V,P)=>{const $=V[P]||(V[P]={});return Ge($,_[P]),V},y||{})}const{__i18n:h,__root:g,__injectWithOption:b}=l,w=l.datetimeFormats,x=l.numberFormats,k=l.flatJson;return{locale:t,fallbackLocale:a,messages:y,flatJson:k,datetimeFormats:w,numberFormats:x,missing:r,missingWarn:n,fallbackWarn:o,fallbackRoot:s,fallbackFormat:i,modifiers:c,pluralRules:u,postTranslation:d,warnHtmlMessage:m,escapeParameter:f,messageResolver:l.messageResolver,inheritLocale:p,__i18n:h,__root:g,__injectWithOption:b}}function Sr(l={}){const t=Vr(su(l)),{__extender:a}=l,r={id:t.id,get locale(){return t.locale.value},set locale(n){t.locale.value=n},get fallbackLocale(){return t.fallbackLocale.value},set fallbackLocale(n){t.fallbackLocale.value=n},get messages(){return t.messages.value},get datetimeFormats(){return t.datetimeFormats.value},get numberFormats(){return t.numberFormats.value},get availableLocales(){return t.availableLocales},get missing(){return t.getMissingHandler()},set missing(n){t.setMissingHandler(n)},get silentTranslationWarn(){return Ce(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(n){t.missingWarn=Ce(n)?!n:n},get silentFallbackWarn(){return Ce(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(n){t.fallbackWarn=Ce(n)?!n:n},get modifiers(){return t.modifiers},get formatFallbackMessages(){return t.fallbackFormat},set formatFallbackMessages(n){t.fallbackFormat=n},get postTranslation(){return t.getPostTranslationHandler()},set postTranslation(n){t.setPostTranslationHandler(n)},get sync(){return t.inheritLocale},set sync(n){t.inheritLocale=n},get warnHtmlInMessage(){return t.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(n){t.warnHtmlMessage=n!=="off"},get escapeParameterHtml(){return t.escapeParameter},set escapeParameterHtml(n){t.escapeParameter=n},get pluralizationRules(){return t.pluralRules||{}},__composer:t,t(...n){return Reflect.apply(t.t,t,[...n])},rt(...n){return Reflect.apply(t.rt,t,[...n])},te(n,o){return t.te(n,o)},tm(n){return t.tm(n)},getLocaleMessage(n){return t.getLocaleMessage(n)},setLocaleMessage(n,o){t.setLocaleMessage(n,o)},mergeLocaleMessage(n,o){t.mergeLocaleMessage(n,o)},d(...n){return Reflect.apply(t.d,t,[...n])},getDateTimeFormat(n){return t.getDateTimeFormat(n)},setDateTimeFormat(n,o){t.setDateTimeFormat(n,o)},mergeDateTimeFormat(n,o){t.mergeDateTimeFormat(n,o)},n(...n){return Reflect.apply(t.n,t,[...n])},getNumberFormat(n){return t.getNumberFormat(n)},setNumberFormat(n,o){t.setNumberFormat(n,o)},mergeNumberFormat(n,o){t.mergeNumberFormat(n,o)}};return r.__extender=a,process.env.NODE_ENV!=="production"&&(r.__enableEmitter=n=>{const o=t;o[il]&&o[il](n)},r.__disableEmitter=()=>{const n=t;n[jl]&&n[jl]()}),r}function iu(l,t,a){return{beforeCreate(){const r=e.getCurrentInstance();if(!r)throw ct(Me.UNEXPECTED_ERROR);const n=this.$options;if(n.i18n){const o=n.i18n;if(n.__i18n&&(o.__i18n=n.__i18n),o.__root=t,this===this.$root)this.$i18n=Io(l,o);else{o.__injectWithOption=!0,o.__extender=a.__vueI18nExtend,this.$i18n=Sr(o);const s=this.$i18n;s.__extender&&(s.__disposer=s.__extender(this.$i18n))}}else if(n.__i18n)if(this===this.$root)this.$i18n=Io(l,n);else{this.$i18n=Sr({__i18n:n.__i18n,__injectWithOption:!0,__extender:a.__vueI18nExtend,__root:t});const o=this.$i18n;o.__extender&&(o.__disposer=o.__extender(this.$i18n))}else this.$i18n=l;n.__i18nGlobal&&vo(t,n,n),this.$t=(...o)=>this.$i18n.t(...o),this.$rt=(...o)=>this.$i18n.rt(...o),this.$te=(o,s)=>this.$i18n.te(o,s),this.$d=(...o)=>this.$i18n.d(...o),this.$n=(...o)=>this.$i18n.n(...o),this.$tm=o=>this.$i18n.tm(o),a.__setInstance(r,this.$i18n)},mounted(){if(process.env.NODE_ENV!=="production"&&this.$el&&this.$i18n){const r=this.$i18n;this.$el.__VUE_I18N__=r.__composer;const n=this.__v_emitter=or();r.__enableEmitter&&r.__enableEmitter(n),n.on("*",ql)}},unmounted(){const r=e.getCurrentInstance();if(!r)throw ct(Me.UNEXPECTED_ERROR);const n=this.$i18n;process.env.NODE_ENV!=="production"&&this.$el&&this.$el.__VUE_I18N__&&(this.__v_emitter&&(this.__v_emitter.off("*",ql),delete this.__v_emitter),this.$i18n&&(n.__disableEmitter&&n.__disableEmitter(),delete this.$el.__VUE_I18N__)),delete this.$t,delete this.$rt,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,n.__disposer&&(n.__disposer(),delete n.__disposer,delete n.__extender),a.__deleteInstance(r),delete this.$i18n}}}function Io(l,t){l.locale=t.locale||l.locale,l.fallbackLocale=t.fallbackLocale||l.fallbackLocale,l.missing=t.missing||l.missing,l.silentTranslationWarn=t.silentTranslationWarn||l.silentFallbackWarn,l.silentFallbackWarn=t.silentFallbackWarn||l.silentFallbackWarn,l.formatFallbackMessages=t.formatFallbackMessages||l.formatFallbackMessages,l.postTranslation=t.postTranslation||l.postTranslation,l.warnHtmlInMessage=t.warnHtmlInMessage||l.warnHtmlInMessage,l.escapeParameterHtml=t.escapeParameterHtml||l.escapeParameterHtml,l.sync=t.sync||l.sync,l.__composer[Co](t.pluralizationRules||l.pluralizationRules);const a=Cr(l.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(a).forEach(r=>l.mergeLocaleMessage(r,a[r])),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach(r=>l.mergeDateTimeFormat(r,t.datetimeFormats[r])),t.numberFormats&&Object.keys(t.numberFormats).forEach(r=>l.mergeNumberFormat(r,t.numberFormats[r])),l}const Dr={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:l=>l==="parent"||l==="global",default:"parent"},i18n:{type:Object}};function cu({slots:l},t){return t.length===1&&t[0]==="default"?(l.default?l.default():[]).reduce((r,n)=>[...r,...n.type===e.Fragment?n.children:[n]],[]):t.reduce((a,r)=>{const n=l[r];return n&&(a[r]=n()),a},Se())}function Oo(){return e.Fragment}const Po=e.defineComponent({name:"i18n-t",props:Ge({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:l=>ze(l)||!isNaN(l)}},Dr),setup(l,t){const{slots:a,attrs:r}=t,n=l.i18n||Fe({useScope:l.scope,__useComponent:!0});return()=>{const o=Object.keys(a).filter(m=>m[0]!=="_"),s=Se();l.locale&&(s.locale=l.locale),l.plural!==void 0&&(s.plural=J(l.plural)?+l.plural:l.plural);const i=cu(t,o),c=n[xr](l.keypath,i,s),u=Ge(Se(),r),d=J(l.tag)||Ee(l.tag)?l.tag:Oo();return e.h(d,u,c)}}});function du(l){return Pe(l)&&!J(l[0])}function Ro(l,t,a,r){const{slots:n,attrs:o}=t;return()=>{const s={part:!0};let i=Se();l.locale&&(s.locale=l.locale),J(l.format)?s.key=l.format:Ee(l.format)&&(J(l.format.key)&&(s.key=l.format.key),i=Object.keys(l.format).reduce((f,p)=>a.includes(p)?Ge(Se(),f,{[p]:l.format[p]}):f,Se()));const c=r(l.value,s,i);let u=[s.key];Pe(c)?u=c.map((f,p)=>{const y=n[f.type],h=y?y({[f.type]:f.value,index:p,parts:c}):[f.value];return du(h)&&(h[0].key=`${f.type}-${p}`),h}):J(c)&&(u=[c]);const d=Ge(Se(),o),m=J(l.tag)||Ee(l.tag)?l.tag:Oo();return e.h(m,d,u)}}const Uo=e.defineComponent({name:"i18n-n",props:Ge({value:{type:Number,required:!0},format:{type:[String,Object]}},Dr),setup(l,t){const a=l.i18n||Fe({useScope:l.scope,__useComponent:!0});return Ro(l,t,go,(...r)=>a[_r](...r))}});function uu(l,t){const a=l;if(l.mode==="composition")return a.__getInstance(t)||l.global;{const r=a.__getInstance(t);return r!=null?r.__composer:l.global.__composer}}function mu(l){const t=s=>{process.env.NODE_ENV!=="production"&&nr(zl(At.DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE));const{instance:i,value:c}=s;if(!i||!i.$)throw ct(Me.UNEXPECTED_ERROR);const u=uu(l,i.$),d=jo(c);return[Reflect.apply(u.t,u,[...zo(d)]),u]};return{created:(s,i)=>{const[c,u]=t(i);Ct&&l.global===u&&(s.__i18nWatcher=e.watch(u.locale,()=>{i.instance&&i.instance.$forceUpdate()})),s.__composer=u,s.textContent=c},unmounted:s=>{Ct&&s.__i18nWatcher&&(s.__i18nWatcher(),s.__i18nWatcher=void 0,delete s.__i18nWatcher),s.__composer&&(s.__composer=void 0,delete s.__composer)},beforeUpdate:(s,{value:i})=>{if(s.__composer){const c=s.__composer,u=jo(i);s.textContent=Reflect.apply(c.t,c,[...zo(u)])}},getSSRProps:s=>{const[i]=t(s);return{textContent:i}}}}function jo(l){if(J(l))return{path:l};if(ke(l)){if(!("path"in l))throw ct(Me.REQUIRED_VALUE,"path");return l}else throw ct(Me.INVALID_VALUE)}function zo(l){const{path:t,locale:a,args:r,choice:n,plural:o}=l,s={},i=r||{};return J(a)&&(s.locale=a),ze(n)&&(s.plural=n),ze(o)&&(s.plural=o),[t,i,s]}function pu(l,t,...a){const r=ke(a[0])?a[0]:{};(Ce(r.globalInstall)?r.globalInstall:!0)&&([Po.name,"I18nT"].forEach(o=>l.component(o,Po)),[Uo.name,"I18nN"].forEach(o=>l.component(o,Uo)),[qo.name,"I18nD"].forEach(o=>l.component(o,qo))),l.directive("t",mu(t))}const fu=St("global-vue-i18n");function hu(l={}){const t=__VUE_I18N_LEGACY_API__&&Ce(l.legacy)?l.legacy:__VUE_I18N_LEGACY_API__;process.env.NODE_ENV!=="production"&&t&&nr(zl(At.DEPRECATE_LEGACY_MODE));const a=Ce(l.globalInjection)?l.globalInjection:!0,r=new Map,[n,o]=gu(l,t),s=St(process.env.NODE_ENV!=="production"?"vue-i18n":"");function i(m){return r.get(m)||null}function c(m,f){r.set(m,f)}function u(m){r.delete(m)}const d={get mode(){return __VUE_I18N_LEGACY_API__&&t?"legacy":"composition"},async install(m,...f){if(process.env.NODE_ENV!=="production"&&(m.__VUE_I18N__=d),m.__VUE_I18N_SYMBOL__=s,m.provide(m.__VUE_I18N_SYMBOL__,d),ke(f[0])){const h=f[0];d.__composerExtend=h.__composerExtend,d.__vueI18nExtend=h.__vueI18nExtend}let p=null;!t&&a&&(p=Cu(m,d.global)),__VUE_I18N_FULL_INSTALL__&&pu(m,d,...f),__VUE_I18N_LEGACY_API__&&t&&m.mixin(iu(o,o.__composer,d));const y=m.unmount;if(m.unmount=()=>{p&&p(),d.dispose(),y()},process.env.NODE_ENV!=="production"){if(!await Xd(m,d))throw ct(Me.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN);const g=or();if(t){const b=o;b.__enableEmitter&&b.__enableEmitter(g)}else{const b=o;b[il]&&b[il](g)}g.on("*",ql)}},get global(){return o},dispose(){n.stop()},__instances:r,__getInstance:i,__setInstance:c,__deleteInstance:u};return d}function Fe(l={}){const t=e.getCurrentInstance();if(t==null)throw ct(Me.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw ct(Me.NOT_INSTALLED);const a=bu(t),r=ku(a),n=No(t),o=yu(l,n);if(o==="global")return vo(r,l,n),r;if(o==="parent"){let c=xu(a,t,l.__useComponent);return c==null&&(process.env.NODE_ENV!=="production"&&Wt(zl(At.NOT_FOUND_PARENT_SCOPE)),c=r),c}const s=a;let i=s.__getInstance(t);if(i==null){const c=Ge({},l);"__i18n"in n&&(c.__i18n=n.__i18n),r&&(c.__root=r),i=Vr(c),s.__composerExtend&&(i[Er]=s.__composerExtend(i)),_u(s,t,i),s.__setInstance(t,i)}return i}function gu(l,t){const a=e.effectScope(),r=__VUE_I18N_LEGACY_API__&&t?a.run(()=>Sr(l)):a.run(()=>Vr(l));if(r==null)throw ct(Me.UNEXPECTED_ERROR);return[a,r]}function bu(l){const t=e.inject(l.isCE?fu:l.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw ct(l.isCE?Me.NOT_INSTALLED_WITH_PROVIDE:Me.UNEXPECTED_ERROR);return t}function yu(l,t){return ga(l)?"__i18n"in t?"local":"global":l.useScope?l.useScope:"local"}function ku(l){return l.mode==="composition"?l.global:l.global.__composer}function xu(l,t,a=!1){let r=null;const n=t.root;let o=wu(t,a);for(;o!=null;){const s=l;if(l.mode==="composition")r=s.__getInstance(o);else if(__VUE_I18N_LEGACY_API__){const i=s.__getInstance(o);i!=null&&(r=i.__composer,a&&r&&!r[Vo]&&(r=null))}if(r!=null||n===o)break;o=o.parent}return r}function wu(l,t=!1){return l==null?null:t&&l.vnode.ctx||l.parent}function _u(l,t,a){let r=null;e.onMounted(()=>{if(process.env.NODE_ENV!=="production"&&t.vnode.el){t.vnode.el.__VUE_I18N__=a,r=or();const n=a;n[il]&&n[il](r),r.on("*",ql)}},t),e.onUnmounted(()=>{const n=a;process.env.NODE_ENV!=="production"&&t.vnode.el&&t.vnode.el.__VUE_I18N__&&(r&&r.off("*",ql),n[jl]&&n[jl](),delete t.vnode.el.__VUE_I18N__),l.__deleteInstance(t);const o=n[Er];o&&(o(),delete n[Er])},t)}const Eu=["locale","fallbackLocale","availableLocales"],Ho=["t","rt","d","n","tm","te"];function Cu(l,t){const a=Object.create(null);return Eu.forEach(n=>{const o=Object.getOwnPropertyDescriptor(t,n);if(!o)throw ct(Me.UNEXPECTED_ERROR);const s=e.isRef(o.value)?{get(){return o.value.value},set(i){o.value.value=i}}:{get(){return o.get&&o.get()}};Object.defineProperty(a,n,s)}),l.config.globalProperties.$i18n=a,Ho.forEach(n=>{const o=Object.getOwnPropertyDescriptor(t,n);if(!o||!o.value)throw ct(Me.UNEXPECTED_ERROR);Object.defineProperty(l.config.globalProperties,`$${n}`,o)}),()=>{delete l.config.globalProperties.$i18n,Ho.forEach(n=>{delete l.config.globalProperties[`$${n}`]})}}const qo=e.defineComponent({name:"i18n-d",props:Ge({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},Dr),setup(l,t){const a=l.i18n||Fe({useScope:l.scope,__useComponent:!0});return Ro(l,t,po,(...r)=>a[wr](...r))}});if(zd(),pd(qc),fd(id),hd(Xn),process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__){const l=ol();l.__INTLIFY__=!0,Gc(l.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}process.env.NODE_ENV;const Vu={class:"flex items-center justify-between"},Nu={class:"flex items-center gap-2"},vu={class:"text-4xl font-bold text-slate-800 dark:text-slate-100 mb-2"},Bu=["href","title"],Su={class:"text-lg text-slate-600 dark:text-slate-300"},Du=e.defineComponent({__name:"DashboardHeader",setup(l){const{locale:t}=Fe();return(a,r)=>{const n=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("div",Vu,[e.createElementVNode("div",null,[e.createElementVNode("div",Nu,[e.createElementVNode("h1",vu,e.toDisplayString(a.$t("cms.dashboard.title")),1),e.createElementVNode("a",{href:`https://cms.opengis.info/${e.unref(t)}/get-started/app-overview`,target:"_blank",title:a.$t("cms.guide.appOverview")},[e.createVNode(e.unref(kl),{class:"w-5 h-5"})],8,Bu)]),e.createElementVNode("div",Su,e.toDisplayString(a.$t("cms.dashboard.description")),1)]),e.createElementVNode("div",null,[e.createVNode(n,{to:"/settings/collections",class:"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 shadow h-9 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white"},{default:e.withCtx(()=>[e.createVNode(e.unref(rl),{class:"w-4 h-4 mr-2"}),e.createTextVNode(" "+e.toDisplayString(a.$t("cms.dashboard.newCollection")),1)]),_:1})])])}}}),Au={class:"rounded-xl text-card-foreground shadow-lg border-0 bg-white dark:bg-slate-800 backdrop-blur-sm hover:shadow-xl transition-all duration-300 transform hover:scale-105"},Mu={class:"p-6"},Tu={class:"flex items-start justify-between"},Lu={class:"flex-1"},$u={class:"flex items-center space-x-2 mb-2"},Fu={class:"text-sm font-medium text-slate-600 dark:text-slate-400"},Iu={class:"text-3xl font-bold text-slate-800 dark:text-slate-100 mb-1"},Ou={class:"text-xs text-slate-500 dark:text-slate-400 mb-3"},Pu=e.defineComponent({__name:"StatCard",props:{stat:{}},setup(l){const t=a=>({"file-text":Il,users:lr,image:ma,eye:Ja})[a]||Il;return(a,r)=>(e.openBlock(),e.createElementBlock("div",Au,[e.createElementVNode("div",Mu,[e.createElementVNode("div",Tu,[e.createElementVNode("div",Lu,[e.createElementVNode("div",$u,[e.createElementVNode("div",{class:e.normalizeClass(`p-2 rounded-lg bg-${a.stat.color}-50 dark:bg-${a.stat.color}-900/20`)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t(a.stat.icon)),{class:e.normalizeClass(`w-5 h-5 text-${a.stat.color}-600`)},null,8,["class"]))],2),e.createElementVNode("p",Fu,e.toDisplayString(a.stat.title),1)]),e.createElementVNode("p",Iu,e.toDisplayString(a.stat.value),1),e.createElementVNode("p",Ou,e.toDisplayString(a.stat.description),1)])])])]))}}),Ru={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6"},Uu=e.defineComponent({__name:"StatsGrid",props:{stats:{}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",Ru,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.stats,r=>(e.openBlock(),e.createBlock(Pu,{key:r.id,stat:r},null,8,["stat"]))),128))]))}}),ju={class:"p-4 hover:bg-slate-50 dark:hover:bg-slate-700/50 transition-colors"},zu={class:"flex items-center justify-between"},Hu={class:"flex-1"},qu={class:"flex items-center space-x-3 mb-2"},Gu={class:"inline-flex items-center rounded-md border px-2.5 py-0.5 font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 text-xs bg-white dark:bg-slate-700 border-slate-300 dark:border-slate-600 text-slate-600 dark:text-slate-300"},Wu={class:"font-semibold text-slate-800 dark:text-slate-100 mb-1"},Ku={class:"flex items-center space-x-4 text-sm text-slate-500 dark:text-slate-400"},Yu={class:"flex items-center"},Xu={class:"flex items-center"},Zu={class:"flex items-center"},Qu={class:"flex items-center space-x-2"},Ju=e.defineComponent({__name:"ContentItem",props:{item:{}},setup(l){const t=r=>{const n={published:"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent hover:bg-secondary/80 bg-green-100 dark:bg-green-900/30 text-green-800 dark:text-green-300",draft:"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent hover:bg-secondary/80 bg-yellow-100 dark:bg-yellow-900/30 text-yellow-800 dark:text-yellow-300",review:"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent hover:bg-secondary/80 bg-blue-100 dark:bg-blue-900/30 text-blue-800 dark:text-blue-300"};return n[r]||n.draft},a=r=>{if(!r)return"--.--.--";const n=new Date(r);return new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}).format(n)};return(r,n)=>{const o=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("div",ju,[e.createElementVNode("div",zu,[e.createElementVNode("div",Hu,[e.createElementVNode("div",qu,[e.createElementVNode("div",Gu,e.toDisplayString(r.item.type),1),e.createElementVNode("div",{class:e.normalizeClass(t(r.item.status))},e.toDisplayString(r.item.status||"--"),3)]),e.createElementVNode("h3",Wu,e.toDisplayString(r.item.title||"--"),1),e.createElementVNode("div",Ku,[e.createElementVNode("span",Yu,[e.createVNode(e.unref(lr),{class:"w-4 h-4 mr-1"}),e.createTextVNode(" "+e.toDisplayString(r.item.author||"--"),1)]),e.createElementVNode("span",Xu,[e.createVNode(e.unref(ua),{class:"w-4 h-4 mr-1"}),e.createTextVNode(" "+e.toDisplayString(a(r.item.updated_at)||"--.--.--"),1)]),e.createElementVNode("span",Zu,[e.createVNode(e.unref(Ja),{class:"w-4 h-4 mr-1"}),e.createTextVNode(" "+e.toDisplayString(r.item.views||"--")+" "+e.toDisplayString(r.$t("cms.dashboard.views")),1)])])]),e.createElementVNode("div",Qu,[e.createVNode(o,{to:`/collections/${r.item.object_id}/${r.item.content_id}`,class:"inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors border shadow-sm rounded-md text-xs h-8 w-8 p-0 bg-white border-slate-300 hover:text-accent-foreground hover:bg-slate-50 dark:border-slate-600 dark:bg-slate-700 dark:hover:bg-slate-600"},{default:e.withCtx(()=>[e.createVNode(e.unref(wl),{class:"w-4 h-4 dark:text-blue-50"})]),_:1},8,["to"])])])])}}}),em={class:"lg:col-span-2"},tm={class:"rounded-xl text-card-foreground shadow-lg border-0 bg-white dark:bg-slate-800 backdrop-blur-sm"},lm={class:"flex flex-col space-y-1.5 p-6 border-b border-slate-200 dark:border-slate-700 bg-gradient-to-r from-slate-50 dark:from-slate-800 to-white dark:to-slate-800"},am={class:"flex items-center justify-between"},rm={class:"tracking-tight text-xl font-semibold text-slate-800 dark:text-slate-100 flex items-center"},nm={class:"p-0"},om={class:"divide-y divide-slate-100 dark:divide-slate-700"},sm=e.defineComponent({__name:"RecentContent",props:{content:{}},setup(l){const t=rt.useRouter(),a=r=>{t.push(r)};return(r,n)=>(e.openBlock(),e.createElementBlock("div",em,[e.createElementVNode("div",tm,[e.createElementVNode("div",lm,[e.createElementVNode("div",am,[e.createElementVNode("h3",rm,[e.createVNode(e.unref(Ii),{class:"w-5 h-5 mr-2"}),e.createTextVNode(" "+e.toDisplayString(r.$t("cms.dashboard.recentContent")),1)]),e.createElementVNode("button",{onClick:n[0]||(n[0]=o=>a("/settings/collections")),class:"inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 border shadow-sm hover:text-accent-foreground h-8 rounded-md px-3 text-xs bg-white dark:bg-slate-700 border-slate-300 dark:border-slate-600 text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-600"},e.toDisplayString(r.$t("cms.dashboard.viewAll")),1)])]),e.createElementVNode("div",nm,[e.createElementVNode("div",om,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.content,o=>(e.openBlock(),e.createBlock(Ju,{key:o.id,item:o},null,8,["item"]))),128))])])])]))}}),im={class:"rounded-xl text-card-foreground shadow-lg border-0 bg-white dark:bg-slate-800 backdrop-blur-sm"},cm={class:"flex flex-col space-y-1.5 p-6 border-b border-slate-200 dark:border-slate-700 bg-gradient-to-r from-slate-50 dark:from-slate-800 to-white dark:to-slate-800"},dm={class:"tracking-tight text-lg font-semibold text-slate-800 dark:text-slate-100 flex items-center"},um={class:"p-4"},mm={class:"grid grid-cols-2 gap-3"},pm=["onClick"],fm={class:"p-2 rounded-lg bg-blue-50 dark:bg-blue-900/20 mb-2 w-fit"},hm={class:"font-medium text-slate-800 dark:text-slate-100 text-sm mb-1 group-hover:text-slate-900 dark:group-hover:text-slate-50"},gm={class:"text-xs text-slate-500 dark:text-slate-400 group-hover:text-slate-600 dark:group-hover:text-slate-300"},bm=e.defineComponent({__name:"QuickActions",setup(l){const t=rt.useRouter(),{t:a}=Fe(),r=[{id:"create-article",title:a("cms.dashboard.createArticle"),description:a("cms.dashboard.createArticleDescription"),icon:Il,iconColor:"text-blue-500",link:"/collections/pages/create"},{id:"upload-media",title:a("cms.dashboard.uploadMedia"),description:a("cms.dashboard.uploadMediaDescription"),icon:ma,iconColor:"text-purple-500",link:"/media"},{id:"manage-users",title:a("cms.dashboard.manageUsers"),description:a("cms.dashboard.manageUsersDescription"),icon:lr,iconColor:"text-green-500",link:"/settings/users"}],n=o=>{o&&t.push(o)};return(o,s)=>(e.openBlock(),e.createElementBlock("div",im,[e.createElementVNode("div",cm,[e.createElementVNode("h3",dm,[e.createVNode(e.unref(Ki),{class:"w-5 h-5 mr-2"}),e.createTextVNode(" "+e.toDisplayString(o.$t("cms.dashboard.quickActions")),1)])]),e.createElementVNode("div",um,[e.createElementVNode("div",mm,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(r,i=>e.createElementVNode("button",{key:i.id,class:"p-3 rounded-lg border border-slate-200 transition-all duration-200 text-left group hover:bg-slate-50 hover:shadow-md dark:border-slate-600 bg-white dark:bg-slate-700 dark:hover:bg-slate-600",onClick:c=>n(i==null?void 0:i.link)},[e.createElementVNode("div",fm,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i==null?void 0:i.icon),{class:e.normalizeClass(`w-4 h-4 ${i==null?void 0:i.iconColor}`)},null,8,["class"]))]),e.createElementVNode("h3",hm,e.toDisplayString(i==null?void 0:i.title),1),e.createElementVNode("p",gm,e.toDisplayString(i==null?void 0:i.description),1)],8,pm)),64))])])]))}}),ym={class:"w-full max-w-7xl mx-auto space-y-8"},km={class:"grid grid-cols-1 lg:grid-cols-3 gap-6"},Ar=e.defineComponent({__name:"Dashboard",setup(l){const{t}=Fe(),a=e.ref([{id:"total-content",title:t("cms.dashboard.totalContent"),value:"2,847",description:t("cms.dashboard.articlesPostsPages"),change:{value:"+12.5%",isPositive:!0},icon:"file-text",color:"blue"},{id:"active-users",title:t("cms.dashboard.activeUsers"),value:"1,234",description:t("cms.dashboard.monthlyActiveUsers"),change:{value:"+8.2%",isPositive:!0},icon:"users",color:"emerald"},{id:"media-files",title:t("cms.dashboard.mediaFiles"),value:"5,692",description:t("cms.dashboard.imagesVideosDocs"),change:{value:"+23.1%",isPositive:!0},icon:"image",color:"purple"},{id:"new-media",title:t("cms.dashboard.newMediaFiles"),value:"89.2K",description:t("cms.dashboard.thisMonth"),change:{value:"-2.4%",isPositive:!1},icon:"eye",color:"orange"}]),r=e.ref([{id:1,type:"Article",status:"published",title:t("cms.dashboard.gettingStartedWithNextJs14"),author:t("cms.dashboard.sarahJohnson"),updated_at:"2024-01-15",views:1247},{id:2,type:"Post",status:"draft",title:t("cms.dashboard.advancedReactPatterns"),author:t("cms.dashboard.mikeChen"),updated_at:"2024-01-14",views:0},{id:3,type:"Article",status:"published",title:t("cms.dashboard.uiUxDesignPrinciples"),author:t("cms.dashboard.emmaWilson"),updated_at:"2024-01-13",views:892},{id:4,type:"Post",status:"review",title:t("cms.dashboard.databaseOptimizationTips"),author:t("cms.dashboard.alexRodriguez"),updated_at:"2024-01-12",views:0}]),n=s=>{a.value=a.value.map(i=>{var c,u,d,m;switch(i.id){case"total-content":return{...i,value:((c=s.totalContent)==null?void 0:c.toLocaleString())??i.value};case"active-users":return{...i,value:((u=s.totalUsers)==null?void 0:u.toLocaleString())??i.value};case"media-files":return{...i,value:((d=s.totalMediaFiles)==null?void 0:d.toLocaleString())??i.value};case"new-media":return{...i,value:((m=s.newMediaFiles)==null?void 0:m.toLocaleString())??i.value};default:return i}})},o=async()=>{const i=await(await fetch("api/cms-stat")).json();r.value=i.recentContent,n(i.stat)};return e.onMounted(()=>{o()}),(s,i)=>(e.openBlock(),e.createElementBlock("div",ym,[e.createVNode(Du),e.createVNode(Uu,{stats:a.value},null,8,["stats"]),e.createElementVNode("div",km,[e.createVNode(sm,{content:r.value,class:"lg:col-span-2"},null,8,["content"]),e.createElementVNode("div",null,[e.createVNode(bm)])])]))}}),xm={class:"rounded-xl text-card-foreground shadow-lg bg-white dark:bg-slate-800 backdrop-blur-sm border-2 border-dashed border-slate-300 dark:border-slate-600"},wm={class:"p-12 text-center"},_m={class:"text-lg font-medium text-slate-600 dark:text-slate-300 mb-2"},Em={class:"text-slate-500 dark:text-slate-400 mb-6"},Go={__name:"EmptyData",props:{title:{type:String,default:()=>"emptyData.title"},description:{type:String,default:()=>"emptyData.description"},buttonText:{type:String,default:()=>"emptyData.buttonText"},showButton:{type:Boolean,default:!0}},emits:["action"],setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",xm,[e.createElementVNode("div",wm,[a[2]||(a[2]=e.createElementVNode("svg",{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",class:"lucide lucide-layers w-12 h-12 mx-auto mb-4 text-slate-400 dark:text-slate-500"},[e.createElementVNode("path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z"}),e.createElementVNode("path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65"}),e.createElementVNode("path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65"})],-1)),e.createElementVNode("h3",_m,e.toDisplayString(t.$t(l.title)),1),e.createElementVNode("p",Em,e.toDisplayString(t.$t(l.description)),1),l.showButton?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:a[0]||(a[0]=r=>t.$emit("action")),class:"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 shadow h-9 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white"},[a[1]||(a[1]=e.createElementVNode("svg",{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",class:"lucide lucide-plus w-4 h-4 mr-2"},[e.createElementVNode("path",{d:"M5 12h14"}),e.createElementVNode("path",{d:"M12 5v14"})],-1)),e.createTextVNode(" "+e.toDisplayString(t.$t(l.buttonText)),1)])):e.createCommentVNode("",!0)])]))}},Cm={class:"space-y-6 max-w-7xl mx-auto"},Vm={class:"flex items-center justify-between mb-8"},Nm={class:"flex gap-4"},vm={class:"text-3xl font-bold text-slate-800 dark:text-slate-100 mb-2"},Bm={class:"text-slate-600 dark:text-slate-300"},Sm=["href","title"],Dm={class:"relative w-full max-w-sm"},Am={class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},Mm=["placeholder"],Tm={key:0},Lm={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 mb-6"},$m=["onClick"],Fm={class:"flex items-start justify-between"},Im={class:"flex items-start gap-3"},Om={class:"text-sm font-semibold text-gray-800 mb-1"},Pm={class:"text-xs text-gray-600"},Rm={class:"flex items-center gap-2"},Um={class:"text-xs text-gray-500 whitespace-nowrap"},jm={key:1,class:"flex items-center justify-center min-h-[400px]"},Mr=e.defineComponent({__name:"CollectionsPage",setup(l){const{t,locale:a}=Fe(),r=rt.useRouter();e.inject("fetchContentTypes");const n=e.ref([]),o=e.ref(""),s=e.computed(()=>{const u=n.value.filter(p=>p.type!=="single"),d=o.value.trim().toLowerCase();return[...d?u.filter(p=>[p==null?void 0:p.title,p==null?void 0:p.name,p==null?void 0:p.id,p==null?void 0:p.description].filter(Boolean).join(" ").toLowerCase().includes(d)):u].sort((p,y)=>p.id==="pages"?-1:y.id==="pages"?1:0)});async function i(){try{const u=await fetch("/api/cms-type?type=collection");if(!u.ok)throw new Error("Failed to fetch collections");const d=await u.json();n.value=d.rows||[]}catch(u){console.error("Error fetching collections:",u)}}const c=u=>{r.push(`/collections/${u.id}`)};return e.onMounted(()=>{i()}),(u,d)=>(e.openBlock(),e.createElementBlock("div",Cm,[e.createElementVNode("div",Vm,[e.createElementVNode("div",Nm,[e.createElementVNode("div",null,[e.createElementVNode("h1",vm,e.toDisplayString(u.$t("cms.navigation.collections")),1),e.createElementVNode("p",Bm,e.toDisplayString(u.$t("cms.collections.selectCollection")),1)]),e.createElementVNode("a",{href:`https://cms.opengis.info/${e.unref(a)}/guides/collections/`,target:"_blank",title:u.$t("cms.guide.collections"),class:"mt-2"},[e.createVNode(e.unref(kl),{class:"w-5 h-5"})],8,Sm)]),e.createElementVNode("div",Dm,[e.createElementVNode("div",Am,[e.createVNode(e.unref(tr),{class:"w-5 h-5 text-gray-400"})]),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":d[0]||(d[0]=m=>o.value=m),type:"text",class:"block w-full py-2 pl-10 pr-3 leading-5 text-gray-900 placeholder-gray-500 transition-colors bg-white border border-gray-300 rounded-md dark:border-gray-600 dark:bg-gray-700 dark:placeholder-gray-400 focus:outline-none focus:ring-sky-500 focus:border-sky-500 dark:text-white sm:text-sm",placeholder:u.$t("cms.collections.searchCollections")},null,8,Mm),[[e.vModelText,o.value]])])]),n.value.length>0?(e.openBlock(),e.createElementBlock("div",Tm,[e.createElementVNode("div",Lm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,m=>(e.openBlock(),e.createElementBlock("button",{key:m.id,onClick:f=>c(m),class:"w-full border border-gray-200 bg-white rounded-lg p-4 text-left hover:shadow-md transition-all hover:border-gray-300"},[e.createElementVNode("div",Fm,[e.createElementVNode("div",Im,[m.id==="pages"?(e.openBlock(),e.createBlock(e.unref(yl),{key:0,class:"shrink-0 lucide lucide-page w-5 h-5 text-blue-600"})):(e.openBlock(),e.createBlock(e.unref(xl),{key:1,class:"shrink-0 lucide lucide-layers w-5 h-5 text-blue-600"})),e.createElementVNode("div",null,[e.createElementVNode("h4",Om,e.toDisplayString(m.title),1),e.createElementVNode("p",Pm,e.toDisplayString(m.description||"Опис відсутній"),1)])]),e.createElementVNode("div",Rm,[e.createElementVNode("span",Um,e.toDisplayString(m.entries)+" записів",1),e.createVNode(e.unref(bl),{class:"w-4 h-4 text-gray-400"})])])],8,$m))),128))])])):(e.openBlock(),e.createElementBlock("div",jm,[e.createVNode(Go)]))]))}}),zm={class:"text-card-foreground border-0 bg-white/80 dark:bg-slate-800/80 backdrop-blur-sm"},Hm={class:"p-0"},qm={class:"table-scroll overflow-x-auto"},Gm={class:"relative w-full overflow-auto max-h-[calc(100vh-270px)]"},Wm={class:"w-full caption-bottom text-sm"},Km={class:"border-b border-slate-200 dark:border-slate-700 bg-slate-50/50 dark:bg-slate-700/50 hover:bg-slate-50/80 dark:hover:bg-slate-700/80 transition-colors"},Ym={class:"flex items-center gap-2"},Xm={class:"h-10 text-center px-4 font-semibold text-slate-700 dark:text-slate-300 max-w-32"},Zm=["onClick"],Qm={key:1,class:"whitespace-nowrap"},Jm={key:2,class:"whitespace-nowrap"},ep={key:3,class:"flex items-center"},tp={key:4,class:"inline-flex whitespace-nowrap items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors bg-white dark:bg-slate-700 border-slate-300 dark:border-slate-600 text-slate-700 dark:text-slate-300"},lp={key:5,class:"flex items-center"},ap={key:6,class:"flex items-center gap-3"},rp={key:8,class:"flex items-center gap-3"},np={key:11,class:"flex items-center gap-3"},op={class:"line-clamp-2"},sp={class:"flex justify-end py-2 px-4 align-middle max-w-40"},ip={class:"flex items-center justify-center gap-1"},cp=["onClick"],dp=["onClick"],Wo=e.defineComponent({__name:"UniversalTable",props:{rows:{},query:{},filterFn:{type:Function},onEdit:{type:Function},onView:{type:Function},onDelete:{type:Function},columns:{},onMore:{type:Function},customRender:{}},emits:["edit","view","delete","more"],setup(l,{emit:t}){const{t:a}=Fe();e.ref(null);const r=l,n=t,o=e.computed(()=>!r.query||!r.filterFn?r.rows:r.rows.filter(m=>r.filterFn(m,r.query))),s=m=>{if(!m)return"";const f=new Date(m);return isNaN(f.getTime())?"":m.includes("T")||m.includes(" ")||m.includes(":")?f.toLocaleString("uk-UA",{dateStyle:"medium",timeStyle:"medium"}):f.toLocaleDateString("uk-UA",{dateStyle:"medium"})},i=m=>{switch(m){case"published":return{icon:wn,text:a("cms.common.status.published"),classes:"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-200 border-green-200 dark:border-green-700"};case"draft":return{icon:wl,text:a("cms.common.status.draft"),classes:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-200 border-yellow-200 dark:border-yellow-700"};case"archived":return{icon:Dn,text:a("cms.common.status.archived"),classes:"bg-gray-100 text-gray-800 dark:bg-gray-900/30 dark:text-gray-300 border-gray-200 dark:border-gray-700"};default:return null}},c=(m,f)=>{switch(m){case"edit":n("edit",f),r.onEdit&&r.onEdit(f);break;case"view":n("view",f),r.onView&&r.onView(f);break;case"delete":n("delete",f);break;case"more":n("more",f),r.onMore&&r.onMore(f);break}},u=m=>{c("edit",m)},d=m=>{const f=new Date,p=new Date(m),y=f-p,h=Math.floor(y/1e3),g=Math.floor(h/60),b=Math.floor(g/60),w=Number(Math.floor(b/24)),x=Number(Math.floor(w/7));return x>=2?a("cms.table.time.weeksAgo",{count:x}):x===1?a("cms.table.time.weekAgo"):w>=2?a("cms.table.time.daysAgo",{count:w}):w===1?a("cms.table.time.dayAgo"):b>=2?a("cms.table.time.hoursAgo",{count:b}):b===1?a("cms.table.time.hourAgo"):g>=2?a("cms.table.time.minutesAgo",{count:g}):a(g===1?"cms.table.time.minuteAgo":"cms.table.time.justNow")};return(m,f)=>(e.openBlock(),e.createElementBlock("div",zm,[e.createElementVNode("div",Hm,[e.createElementVNode("div",qm,[e.createElementVNode("div",Gm,[e.createElementVNode("table",Wm,[e.createElementVNode("thead",null,[e.createElementVNode("tr",Km,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.columns,p=>(e.openBlock(),e.createElementBlock("th",{key:p.name,class:e.normalizeClass(["h-10 px-4 text-left align-middle font-semibold text-slate-700 dark:text-slate-300 max-w-80",{"min-w-[200px]":["title","name"].includes(p.name),"min-w-[150px]":p.name==="slug","min-w-[250px]":p.name==="description"}])},[e.createElementVNode("div",Ym,[p.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(p.icon),{key:0,class:"w-5 h-5"})):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(p.label||p.title||p.ua||p.name),1)])],2))),128)),e.createElementVNode("th",Xm,e.toDisplayString(m.$t("cms.table.actions")),1)])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,p=>(e.openBlock(),e.createElementBlock("tr",{key:p.id||p._id||p.name,class:"transition-all duration-200 hover:bg-slate-50/60 dark:hover:bg-slate-700/60"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.columns,(y,h)=>{var g,b,w,x,k;return e.openBlock(),e.createElementBlock("td",{key:y.name,class:e.normalizeClass(["py-2 px-4 align-middle max-w-80",{"font-medium text-slate-800 dark:text-white cursor-pointer":h===0,"text-slate-600 dark:text-slate-400 font-mono text-sm":h!==0}]),onClick:_=>h===0?u(p):void 0},[m.customRender&&m.customRender[y.name]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(m.customRender[y.name](p[y.name],p)),{key:0})):e.createCommentVNode("",!0),["published_at","publish_at","created_at","date"].includes(y.name)&&p[y.name]?(e.openBlock(),e.createElementBlock("span",Qm,e.toDisplayString(s(p[y.name])),1)):["updated_at","lastModified","last_edit"].includes(y.name)?(e.openBlock(),e.createElementBlock("span",Jm,e.toDisplayString(d(p[y.name])||"--"),1)):y.name==="views"?(e.openBlock(),e.createElementBlock("div",ep,[e.createVNode(e.unref(Ja),{class:"w-4 h-4 mr-1"}),e.createTextVNode(" "+e.toDisplayString(((b=(g=p[y.name])==null?void 0:g.toLocaleString)==null?void 0:b.call(g))??p[y.name]),1)])):["entries","fields"].includes(y.name)?(e.openBlock(),e.createElementBlock("div",tp,e.toDisplayString(p[y.name]||"-"),1)):y.name==="type"?(e.openBlock(),e.createElementBlock("div",lp,[e.createElementVNode("div",{class:e.normalizeClass(["whitespace-nowrap inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors border-transparent hover:bg-secondary/80",p[y.name]==="pages"?"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300":"bg-purple-100 text-purple-800 dark:bg-purple-900/30 dark:text-purple-300"])},e.toDisplayString(p[y.name]||"-"),3)])):y.name==="name"?(e.openBlock(),e.createElementBlock("div",ap,[p.type==="single"?(e.openBlock(),e.createBlock(e.unref(yl),{key:0,class:"shrink-0 lucide lucide-page w-5 h-5 text-blue-600"})):(e.openBlock(),e.createBlock(e.unref(xl),{key:1,class:"shrink-0 lucide lucide-layers w-5 h-5 text-blue-600"})),e.createTextVNode(" "+e.toDisplayString(p[y.name]),1)])):y.name==="status"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:7},[i(p[y.name])?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["whitespace-nowrap rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors hover:bg-secondary/80 flex items-center w-fit bg-green-100 text-green-800 border-green-200 dark:bg-green-900/30 dark:text-green-300 dark:border-green-700",(w=i(p[y.name]))==null?void 0:w.classes])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent((x=i(p[y.name]))==null?void 0:x.icon),{class:"w-3 h-3 mr-1"})),e.createTextVNode(" "+e.toDisplayString((k=i(p[y.name]))==null?void 0:k.text),1)],2)):e.createCommentVNode("",!0)],64)):y.name==="slug"?(e.openBlock(),e.createElementBlock("div",rp,e.toDisplayString(p[y.name]?"/"+p[y.name]:"-"),1)):y.name==="color"?(e.openBlock(),e.createElementBlock("span",{key:9,class:e.normalizeClass(["w-4 h-4 rounded-full block ml-2","bg-["+p[y.name]+"]"])},null,2)):y.name==="enabled"?(e.openBlock(),e.createElementBlock("span",{key:10,class:e.normalizeClass(["whitespace-nowrap rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors hover:bg-secondary/80 flex items-center w-fit",p[y.name]?"bg-green-100 text-green-800 border-green-200":"bg-red-100 text-red-800 border-red-200"])},e.toDisplayString(p[y.name]?"Доступ":"Заборонено"),3)):(e.openBlock(),e.createElementBlock("div",np,[e.createElementVNode("p",op,e.toDisplayString(p[y.name]||"-"),1)]))],10,Zm)}),128)),e.createElementVNode("td",sp,[e.createElementVNode("div",ip,[e.createElementVNode("button",{onClick:e.withModifiers(y=>c("edit",p),["stop"]),class:"inline-flex items-center justify-center whitespace-nowrap font-medium border rounded-md text-xs h-8 w-8 p-0 border-slate-300 bg-white transition-all duration-200 shadow-sm dark:border-slate-600 dark:bg-slate-700 dark:hover:bg-slate-600 dark:hover:text-slate-200 hover:border-blue-300 hover:bg-blue-50 hover:text-blue-600",title:"Edit"},[e.createVNode(e.unref(Sn),{class:"text-slate-800 dark:text-slate-200 w-4 h-4 group-hover:text-green-600 dark:group-hover:text-blue-50"})],8,cp),e.createElementVNode("button",{onClick:e.withModifiers(y=>c("delete",p),["stop"]),class:"inline-flex items-center justify-center whitespace-nowrap font-medium border rounded-md text-xs h-8 w-8 p-0 border-slate-300 bg-white transition-all duration-200 shadow-sm dark:border-slate-600 dark:bg-slate-700 dark:hover:bg-slate-600 dark:hover:text-slate-200 hover:border-blue-300 hover:bg-blue-50 hover:text-blue-600",title:"Preview"},[e.createVNode(e.unref(Gt),{class:"w-4 h-4 text-slate-800 dark:text-slate-200 group-hover:text-red-600 dark:group-hover:text-blue-50"})],8,dp),e.renderSlot(m.$slots,"actions",{row:p})])])]))),128))])])])])])]))}}),up={class:"flex items-center justify-between px-6 py-4 border-t border-slate-200 dark:border-slate-700 bg-white dark:bg-slate-800"},mp={class:"flex justify-between flex-1 sm:hidden"},pp={class:"relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50"},fp={class:"relative inline-flex items-center px-4 py-2 ml-3 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50"},hp={class:"hidden sm:flex-1 sm:flex sm:items-center sm:justify-between"},gp={class:"text-sm text-slate-600 dark:text-slate-400"},bp={class:"font-medium text-slate-800 dark:text-slate-100"},yp={class:"font-medium text-slate-800 dark:text-slate-100"},kp={class:"relative z-0 inline-flex space-x-2 rounded-md shadow-sm","aria-label":"Pagination"},xp=["disabled"],wp={class:"sr-only"},_p={class:"space-x-1"},Ep={key:0,class:"px-2 py-2 text-gray-400"},Cp=["onClick"],Vp=["disabled"],Np={class:"sr-only"},Ko=e.defineComponent({__name:"UniversalTablePagination",props:e.mergeModels({total:{},count:{},limit:{}},{page:{},pageModifiers:{}}),emits:["update:page"],setup(l){const t=e.useModel(l,"page"),a=e.computed(()=>Math.ceil(l.total/l.limit)),r=e.computed(()=>{const o=[];if(a.value<=4){for(let c=1;c<=a.value;c++)o.push(c);return o}const s=Math.max(2,t.value-2),i=Math.min(a.value-1,t.value+2);o.push(1),s>2&&o.push("ellipsis");for(let c=s;c<=i;c++)o.push(c);return i<a.value-1&&o.push("ellipsis"),o.push(a.value),o});return(n,o)=>(e.openBlock(),e.createElementBlock("div",up,[e.createElementVNode("div",mp,[e.createElementVNode("button",pp,e.toDisplayString(n.$t("cms.common.pagination.previous")),1),e.createElementVNode("button",fp,e.toDisplayString(n.$t("cms.common.pagination.next")),1)]),e.createElementVNode("div",hp,[e.createElementVNode("div",null,[e.createElementVNode("p",gp,[e.createTextVNode(e.toDisplayString(n.$t("cms.common.pagination.showing"))+" ",1),e.createElementVNode("span",bp,e.toDisplayString(n.count),1),e.createTextVNode(" "+e.toDisplayString(n.$t("cms.common.pagination.of"))+" ",1),e.createElementVNode("span",yp,e.toDisplayString(n.total),1),e.createTextVNode(" "+e.toDisplayString(n.$t("cms.common.pagination.results")),1)])]),e.createElementVNode("div",null,[e.createElementVNode("nav",kp,[e.createElementVNode("button",{onClick:o[0]||(o[0]=s=>t.value=t.value>1?t.value-1:1),disabled:t.value===1,class:"inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors border shadow-sm rounded-md text-xs h-8 w-8 p-0 bg-white border-slate-300 text-slate-600 disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed hover:text-accent-foreground hover:bg-slate-50 dark:bg-slate-700 dark:border-slate-600 dark:text-slate-300 dark:hover:bg-slate-600"},[e.createElementVNode("span",wp,e.toDisplayString(n.$t("cms.common.pagination.previous")),1),e.createVNode(e.unref(Pi),{class:"w-5 h-5"})],8,xp),e.createElementVNode("div",_p,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:s+"-"+i},[s==="ellipsis"?(e.openBlock(),e.createElementBlock("span",Ep,"...")):(e.openBlock(),e.createElementBlock("button",{key:1,onClick:c=>t.value=s,class:e.normalizeClass(["inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors h-8 w-8 p-0 text-sm rounded-md",{"border shadow-sm hover:text-accent-foreground bg-white dark:bg-slate-700 border-slate-300 dark:border-slate-600 text-slate-600 dark:text-slate-300 hover:border-blue-600 hover:bg-slate-50 dark:hover:bg-slate-600":s!==t.value,"shadow bg-blue-600 hover:bg-blue-700 text-white border-blue-600":s===t.value}])},e.toDisplayString(s),11,Cp))],64))),128))]),e.createElementVNode("button",{onClick:o[1]||(o[1]=s=>t.value=t.value<Math.ceil(n.total/n.limit)?t.value+1:Math.ceil(n.total/n.limit)),disabled:t.value===Math.ceil(n.total/n.limit),class:"inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors border shadow-sm rounded-md text-xs h-8 w-8 p-0 bg-white border-slate-300 text-slate-600 disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed hover:text-accent-foreground hover:bg-slate-50 dark:bg-slate-700 dark:border-slate-600 dark:text-slate-300 dark:hover:bg-slate-600"},[e.createElementVNode("span",Np,e.toDisplayString(n.$t("cms.common.pagination.next")),1),e.createVNode(e.unref(bl),{class:"w-5 h-5"})],8,Vp)])])])]))}}),cl=(l,t)=>{const a=l.__vccOpts||l;for(const[r,n]of t)a[r]=n;return a},vp={key:0,class:"fixed inset-0 z-[2000] flex items-center justify-center bg-gray-600 bg-opacity-75"},Bp={key:0,class:"relative transform overflow-hidden rounded-lg bg-white text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-lg",role:"dialog","aria-modal":"true","aria-labelledby":"dialog-title"},Sp={class:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},Dp={class:"mt-3 text-center sm:mt-5"},Ap={id:"dialog-title",class:"text-base font-semibold text-gray-900"},Mp={class:"mt-2"},Tp={class:"text-sm text-gray-500"},Lp={class:"bg-gray-50 px-4 py-3 sm:px-6 flex justify-center"},$p={key:1,class:"relative transform overflow-hidden rounded-lg bg-white text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-lg",role:"dialog","aria-modal":"true","aria-labelledby":"dialog-title"},Fp={class:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},Ip={class:"sm:flex sm:items-start"},Op={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"},Pp={id:"dialog-title",class:"text-base font-semibold text-gray-900"},Rp={class:"mt-2"},Up={class:"text-sm text-gray-500"},jp={key:0,class:"mt-2"},zp=["placeholder"],Hp=e.defineComponent({__name:"message-box",props:{type:{default:"error"},mode:{default:"confirm"},title:{default:""},message:{default:""},confirmButtonText:{default:"OK"},cancelButtonText:{default:"Cancel"},modelValue:{type:Boolean,default:!1},promptPlaceholder:{default:""},align:{type:Boolean,default:!0}},emits:["confirm","cancel","update:modelValue"],setup(l,{emit:t}){const a=e.ref(null);e.onMounted(()=>{var y;(y=a.value)==null||y.focus()});const r={success:()=>e.h("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true",class:"size-6 text-green-600"},[e.h("path",{d:"m4.5 12.75 6 6 9-13.5","stroke-linecap":"round","stroke-linejoin":"round"})]),error:()=>e.h("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true",class:"size-6 text-red-600"},[e.h("path",{d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z","stroke-linecap":"round","stroke-linejoin":"round"})]),info:()=>e.h("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"size-6 text-blue-600"},[e.h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M13 16h-1v-4h-1m1-4h.01M12 20a8 8 0 100-16 8 8 0 000 16z"})]),warning:()=>e.h("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"size-6 text-yellow-600"},[e.h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v2m0 4h.01M10.29 3.86L1.82 17a1 1 0 0 0 .87 1.5h18.62a1 1 0 0 0 .87-1.5L13.71 3.86a1 1 0 0 0-1.42 0z"})])},n=l,o=t,s=e.ref(n.modelValue),i=e.ref("");e.watch(()=>n.modelValue,y=>{s.value=y,y===!0&&n.mode==="prompt"&&(i.value="")});function c(y){s.value=!1,o("update:modelValue",!1),y==="confirm"&&n.mode==="prompt"?o("confirm",i.value):o(y)}function u(){c("confirm")}const d=e.computed(()=>{switch(n.type){case"success":return"bg-green-100";case"error":return"bg-red-100";case"info":return"bg-blue-100";case"warning":return"bg-yellow-100";default:return"bg-gray-100"}}),m=e.computed(()=>n.type==="warning"?"bg-orange-600 hover:bg-orange-500":n.type==="success"?"bg-green-600 hover:bg-green-500":n.type==="error"?"bg-red-600 hover:bg-red-500":"bg-blue-600 hover:bg-blue-500"),f=e.computed(()=>r[n.type||"error"]||r.error),p=e.computed(()=>n.title&&n.title.trim()!==""?n.title:n.type?n.type.charAt(0).toUpperCase()+n.type.slice(1):"Notification");return(y,h)=>{const g=e.resolveDirective("focus");return e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[s.value?(e.openBlock(),e.createElementBlock("div",vp,[y.mode==="alert"?(e.openBlock(),e.createElementBlock("div",Bp,[e.createElementVNode("div",Sp,[e.createElementVNode("div",null,[h[4]||(h[4]=e.createElementVNode("div",{class:"mx-auto flex size-12 shrink-0 items-center justify-center rounded-full bg-green-100"},[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true",class:"size-6 text-green-600"},[e.createElementVNode("path",{d:"m4.5 12.75 6 6 9-13.5","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)),e.createElementVNode("div",Dp,[e.createElementVNode("h3",Ap,e.toDisplayString(p.value),1),e.createElementVNode("div",Mp,[e.createElementVNode("p",Tp,e.toDisplayString(y.message),1)])])])]),e.createElementVNode("div",Lp,[e.createElementVNode("button",{type:"button",onClick:h[0]||(h[0]=b=>c("confirm")),class:"inline-flex min-w-[70px] w-full justify-center rounded-md bg-indigo-600 px-3 py-2 text-sm font-semibold text-white shadow-xs hover:bg-indigo-500 sm:w-auto"},e.toDisplayString(y.confirmButtonText),1)])])):(e.openBlock(),e.createElementBlock("div",$p,[e.createElementVNode("div",Fp,[e.createElementVNode("div",Ip,[e.createElementVNode("div",{class:e.normalizeClass(["mx-auto flex size-12 shrink-0 items-center justify-center rounded-full sm:mx-0 sm:size-10",d.value])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f.value)))],2),e.createElementVNode("div",Op,[e.createElementVNode("h3",Pp,e.toDisplayString(p.value),1),e.createElementVNode("div",Rp,[e.createElementVNode("p",Up,e.toDisplayString(y.message),1)]),y.mode==="prompt"?(e.openBlock(),e.createElementBlock("div",jp,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":h[1]||(h[1]=b=>i.value=b),placeholder:y.promptPlaceholder,class:"w-full rounded-md py-1.5 pl-2 text-gray-900 shadow-sm placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6",onKeyup:e.withKeys(u,["enter"]),type:"text"},null,40,zp),[[e.vModelText,i.value],[g]])])):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",{class:e.normalizeClass(["bg-gray-50 px-4 py-3",y.align?"sm:flex sm:flex-row-reverse sm:px-6 gap-x-2.5":"sm:flex sm:flex-row sm:px-6 gap-x-2.5"])},[e.createElementVNode("button",{type:"button",onClick:h[2]||(h[2]=b=>c("confirm")),class:e.normalizeClass(["inline-flex w-full justify-center rounded-md px-3 py-2 text-sm font-semibold text-white shadow-xs sm:w-auto",m.value])},e.toDisplayString(y.confirmButtonText),3),e.createElementVNode("button",{type:"button",onClick:h[3]||(h[3]=b=>c("cancel")),class:"mt-3 inline-flex w-full justify-center rounded-md bg-white px-3 py-2 text-sm font-semibold text-gray-900 shadow-xs ring-1 ring-inset ring-gray-300 hover:bg-gray-50 sm:mt-0 sm:w-auto"},e.toDisplayString(y.cancelButtonText),1)],2)]))])):e.createCommentVNode("",!0)])}}}),qp=cl(Hp,[["__scopeId","data-v-047caa71"]]);e.defineComponent({props:{modelValue:{type:Boolean,default:()=>!1},title:{type:String,default:()=>""},disabled:{type:Boolean,default:()=>!1}},data(){return{}},mounted(){this.modelValue||this.$emit("update:modelValue",!1)},computed:{modelState:{get(){return this.modelValue},set(l){this.$emit("update:modelValue",l)}},labelCursorClasses(){return[{"cursor-not-allowed":this.disabled},{"cursor-pointer":!this.disabled}]}},methods:{handleEnterDown(l){const{keyCode:t}=l;t===13&&(this.modelState=!this.modelState)},addKeyHandler(){window.addEventListener("keydown",this.handleEnterDown)},removeKeyHandler(){window.removeEventListener("keydown",this.handleEnterDown)}}});const Gp={key:0,class:"vsTailwind ui-dialog__wrapper text-gray-800"},Wp={class:"py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]"},Kp={class:"font-medium text-gray-800 dark:text-[#ffffff]"},Yp={class:"ui-dialog__content p-4"},Xp={key:0,class:"flex justify-end gap-x-2"},Zp={key:1,class:"flex justify-end items-center gap-x-2 py-3 px-4 border-t border-gray-200 dark:border-neutral-700"},Qp=e.defineComponent({__name:"vs-modal",props:{title:{default:""},template:{},visible:{type:Boolean,default:!1},size:{default:"small"},closeClickBack:{type:Boolean,default:!1},content:{},buttonText:{},contentProps:{},teleport:{default:"body"}},emits:["update:visible","close","done"],setup(l,{emit:t}){const a=l,r=t,n=e.computed(()=>a.size==="small"?"md:w-5/12 w-9/12":a.size==="medium"?"md:w-6/12 w-9/12":"lg:w-7/12 w-11/12"),o=e.useAttrs();function s(){r("done")}function i(){r("update:visible",!1),r("close")}function c(d){d.key==="Escape"&&i()}function u(d,m){m&&d.target.classList.contains("vs-dialog-overlay")&&i()}return e.onMounted(()=>{window.addEventListener("keydown",c)}),e.onUnmounted(()=>{window.removeEventListener("keydown",c)}),(d,m)=>(e.openBlock(),e.createBlock(e.Teleport,{to:d.teleport},[d.visible?(e.openBlock(),e.createElementBlock("div",Gp,[e.createElementVNode("div",{onMousedown:m[0]||(m[0]=f=>u(f,d.closeClickBack)),class:e.normalizeClass(["vs-dialog-overlay vs-dialog w-full h-full fixed top-0 start-0 bg-black bg-opacity-50",[e.unref(o).class]])},[e.createVNode(e.Transition,{name:"content",appear:""},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["ui-dialog__modal opacity-1 flex flex-col bg-white dark:bg-[#1A1A1A] border dark:border-[#454545] pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl",n.value])},[e.createElementVNode("div",Wp,[e.createElementVNode("h3",Kp,e.toDisplayString(d.title),1),e.createElementVNode("button",{type:"button",class:"size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600",onClick:i},[...m[1]||(m[1]=[e.createElementVNode("span",{class:"sr-only"},"Close",-1),e.createElementVNode("svg",{class:"flex-shrink-0 w-4 h-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"},[e.createElementVNode("path",{d:"M18 6 6 18"}),e.createElementVNode("path",{d:"m6 6 12 12"})],-1)])])]),e.createElementVNode("div",Yp,[e.renderSlot(d.$slots,"default",{},void 0,!0)]),d.$slots.footer?(e.openBlock(),e.createElementBlock("div",Xp,[e.renderSlot(d.$slots,"footer",{handleClose:i},void 0,!0)])):e.createCommentVNode("",!0),d.buttonText?(e.openBlock(),e.createElementBlock("div",Zp,[e.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-2xs hover:bg-gray-50 focus:outline-hidden focus:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:i}," Close "),e.createElementVNode("button",{type:"button",onClick:s,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 focus:outline-hidden focus:bg-blue-700 disabled:opacity-50 disabled:pointer-events-none"},e.toDisplayString(d.buttonText),1)])):e.createCommentVNode("",!0)],2)]),_:3})],34)])):e.createCommentVNode("",!0)],8,["to"]))}}),Zt=cl(Qp,[["__scopeId","data-v-a6807cab"]]),Jp={key:0,class:"vsTailwind ui-drawer__wrapper"},ef={class:"py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]"},tf={class:"font-medium text-gray-800 dark:text-[#ffffff]"},lf={class:"flex gap-2"},af={class:"sr-only"},rf={key:0,class:"flex-shrink-0 w-4 h-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"},nf={key:1,class:"flex-shrink-0 w-4 h-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"},of={class:"ui-drawer__content p-4 flex-1 overflow-auto"},sf={key:0,class:"flex justify-end gap-x-2 p-4 border-0 border-t border-solid border-gray-200 dark:border-t-[#454545]"},cf=e.defineComponent({__name:"vs-drawer",props:{title:{default:""},visible:{type:Boolean,default:!1},position:{default:"right"},size:{default:"500px"},closeClickBack:{type:Boolean,default:!1}},emits:["update:visible","close"],setup(l,{emit:t}){const a=l,r=t,n=e.ref(!1),o=e.computed(()=>n.value?"fixed top-0 left-0 w-full h-full":a.position==="left"?"fixed top-0 left-0 h-full":a.position==="right"?"fixed top-0 right-0 h-full":a.position==="top"?"fixed top-0 left-0 w-full":"fixed bottom-0 left-0 w-full");function s(){r("update:visible",!1),r("close")}function i(){n.value=!n.value}function c(d){d.key==="Escape"&&s()}function u(d,m){m&&d.target.classList.contains("vs-drawer-overlay")&&s()}return e.onMounted(()=>{window.addEventListener("keydown",c)}),e.onUnmounted(()=>{window.removeEventListener("keydown",c)}),(d,m)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"#modal"},[d.visible?(e.openBlock(),e.createElementBlock("div",Jp,[e.createElementVNode("div",{onMousedown:m[0]||(m[0]=f=>u(f,d.closeClickBack)),class:"vs-drawer-overlay vs-drawer w-full h-full fixed top-0 start-0 bg-black bg-opacity-50"},[e.createVNode(e.Transition,{name:"drawer",appear:""},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["ui-drawer__drawer opacity-1 flex flex-col bg-white dark:bg-[#1A1A1A] border dark:border-[#454545] pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)]",[o.value,n.value?"w-full":`w-[${a.size}]`,`drawer-${a.position}`]])},[e.createElementVNode("div",ef,[e.createElementVNode("h3",tf,e.toDisplayString(d.title),1),e.createElementVNode("div",lf,[e.createElementVNode("button",{type:"button",class:"size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600",onClick:i},[e.createElementVNode("span",af,e.toDisplayString(n.value?"Exit fullscreen":"Enter fullscreen"),1),n.value?(e.openBlock(),e.createElementBlock("svg",nf,[...m[2]||(m[2]=[e.createElementVNode("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",rf,[...m[1]||(m[1]=[e.createElementVNode("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"},null,-1)])]))]),e.createElementVNode("button",{type:"button",class:"size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600",onClick:s},[...m[3]||(m[3]=[e.createElementVNode("span",{class:"sr-only"},"Close",-1),e.createElementVNode("svg",{class:"flex-shrink-0 w-4 h-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"},[e.createElementVNode("path",{d:"M18 6 6 18"}),e.createElementVNode("path",{d:"m6 6 12 12"})],-1)])])])]),e.createElementVNode("div",of,[e.renderSlot(d.$slots,"default",{},void 0,!0)]),d.$slots.footer?(e.openBlock(),e.createElementBlock("div",sf,[e.renderSlot(d.$slots,"footer",{handleClose:s},void 0,!0)])):e.createCommentVNode("",!0)],2)]),_:3})],32)])):e.createCommentVNode("",!0)]))}}),Yo=cl(cf,[["__scopeId","data-v-c808fe88"]]),df={},uf={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-6 text-green-600"};function mf(l,t){return e.openBlock(),e.createElementBlock("svg",uf,[...t[0]||(t[0]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)])])}const pf=cl(df,[["render",mf]]),ff={},hf={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"orange",class:"size-6 text-orange-600"};function gf(l,t){return e.openBlock(),e.createElementBlock("svg",hf,[...t[0]||(t[0]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)])])}const bf=cl(ff,[["render",gf]]),yf={},kf={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-6 text-blue-600"};function xf(l,t){return e.openBlock(),e.createElementBlock("svg",kf,[...t[0]||(t[0]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"},null,-1)])])}const wf=cl(yf,[["render",xf]]),_f={},Ef={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"red",class:"size-6 text-red-600"};function Cf(l,t){return e.openBlock(),e.createElementBlock("svg",Ef,[...t[0]||(t[0]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)])])}const Vf=cl(_f,[["render",Cf]]),Nf={class:"rounded-md border border-gray-300 bg-white p-4 shadow-sm"},vf={class:"flex items-start gap-4 opacity-100 scale-5 transition-all duration-300"},Bf={class:"flex-1"},Sf={class:"font-medium text-gray-900"},Df={class:"mt-0.5 text-sm text-gray-700"},Af=e.defineComponent({__name:"vs-notify",props:{type:{},title:{},message:{}},setup(l){const t={success:pf,warning:bf,error:Vf,info:wf};return(a,r)=>(e.openBlock(),e.createElementBlock("div",Nf,[e.createElementVNode("div",vf,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t[a.type]))),e.createElementVNode("div",Bf,[e.createElementVNode("strong",Sf,e.toDisplayString(a.title),1),e.createElementVNode("p",Df,e.toDisplayString(a.message),1)]),r[0]||(r[0]=e.createElementVNode("button",{class:"m-3 rounded-full p-1.5 text-gray-500 transition-colors hover:bg-gray-50 hover:text-gray-700",type:"button","aria-label":"Dismiss notify"},[e.createElementVNode("span",{class:"sr-only"},"Dismiss popup"),e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})])],-1))])]))}}),Ca=l=>{const{message:t,title:a,mode:r="confirm",type:n="info",confirmButtonText:o,cancelButtonText:s,onConfirm:i,onCancel:c,cascade:u,confirmButtonStyle:d,cancelButtonStyle:m}=l||{},f=document.querySelector("body");if(!f){console.error('Modal root element with id "#modal" not found!');return}const p=document.createElement("div");f.appendChild(p);const y=()=>{p.remove()};e.createApp({render(){return e.h(qp,{title:a,message:t,mode:r,type:n,cascade:u,confirmButtonText:o,cancelButtonText:s,cancelButtonStyle:m,confirmButtonStyle:d,modelValue:!0,onConfirm:()=>{i==null||i(),y()},onCancel:()=>{c==null||c(),y()}})}}).mount(p)};e.reactive({visible:!0});const Mf=l=>{const{template:t="",title:a="",content:r,contentProps:n={},size:o="medium"}=l,s=document.querySelector("body");if(!s)return console.error('Modal root element with id "#modal" not found!'),{close:()=>{}};const i=document.createElement("div");s.appendChild(i);const c={title:a,template:t,visible:!0,size:o,closeClickBack:!0,onClose:d},u=e.createApp({render(){return e.h(Zt,c,{default:()=>[r?e.h(r,n):e.h("p",t)]})}});function d(){u.unmount(),i.remove()}return u.mount(i),{close:d}},Va={top:"top-4 left-1/2 transform -translate-x-1/2","left-bottom":"bottom-4 left-4 transform","right-bottom":"bottom-4 right-4 transform",bottom:"bottom-4 left-1/2 transform -translate-x-1/2"},xe=l=>{var c;const{type:t="info",title:a,message:r,position:n="right-bottom"}=l||{};let o=document.querySelector("#notify-root");o||(o=document.createElement("div"),o.id="notify-root",o.className=`fixed z-[2000] flex flex-col gap-3 ${Va[n]} p-6 max-w-md mx-auto font-sans antialiased`,document.body.appendChild(o)),o.className.includes(Va[n])||(Object.values(Va).forEach(u=>{o.classList.remove(...u.split(" "))}),o.classList.add(...Va[n].split(" ")));const s=document.createElement("div");o.appendChild(s);const i=e.createApp({render(){return e.h(Af,{type:t,title:a,message:r,onClose:()=>{i.unmount(),s.remove()}})}});i.mount(s),(c=s.querySelector("button"))==null||c.addEventListener("click",()=>{s.classList.add("opacity-0","scale-95","transition-all","duration-300"),setTimeout(()=>{i.unmount(),s.remove()},350)}),setTimeout(()=>{s.classList.add("opacity-0","scale-95","transition-all","duration-300"),setTimeout(()=>{i.unmount(),s.remove()},350)},3500)},Tf={class:"w-full relative"},Lf={key:0,class:"text-[14px] font-medium text-gray-900 mb-2"},$f={class:"opacity-100"},Ff={key:0,class:"text-red-500 text-[14px]"},If={key:1,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},Of=e.defineComponent({__name:"vs-layout-default",props:{ua:{default:""},uk:{},en:{},de:{},es:{},fr:{},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""},columns:{}},setup(l){const t=e.ref("uk"),a=r=>{r.detail.key==="locale"&&(t.value=r.detail.newValue)};return e.onMounted(()=>{t.value=localStorage.locale,window.addEventListener("storage",a)}),e.onUnmounted(()=>{window.removeEventListener("resize",a)}),(r,n)=>{var o,s;return e.openBlock(),e.createElementBlock("div",Tf,[r.ua||r.label?(e.openBlock(),e.createElementBlock("div",Lf,[e.createElementVNode("span",$f,e.toDisplayString(r.item[t.value]||r.ua||r.label),1),(s=(o=r.item)==null?void 0:o.rules)!=null&&s.includes("required")?(e.openBlock(),e.createElementBlock("span",Ff,"*")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.renderSlot(r.$slots,"default",e.mergeProps(r.$attrs,{class:{"opacity-60":r.item.disabled}})),r.error?(e.openBlock(),e.createElementBlock("span",If,e.toDisplayString(r.error),1)):e.createCommentVNode("",!0)])}}}),Pf={class:"w-full relative flex flex-row items-center gap-2"},Rf={key:0,class:"text-red-500 text-[14px]"},Uf={key:1,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},jf=e.defineComponent({__name:"vs-layout-horizontal",props:{ua:{default:""},uk:{},en:{},de:{},es:{},fr:{},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""},columns:{default:()=>({container:12,label:3})}},setup(l){const t=l,a=e.computed(()=>t.columns??{container:12,label:3}),r=e.computed(()=>{const{container:i,label:c}=a.value;return!i||i<=0?0:Math.min(Math.max(c??0,0),i)/i}),n=e.computed(()=>{var i;return((i=t.item)==null?void 0:i.type)==="html"||r.value<=0?!1:!!(t.ua||t.label)}),o=e.computed(()=>{if(!n.value)return{};const i=`${r.value*100}%`;return{flexBasis:i,maxWidth:i}}),s=e.computed(()=>{var m;const{container:i,label:c}=a.value;if(!i||i<=0)return{};if(((m=t.item)==null?void 0:m.type)==="html")return{flexBasis:"100%",maxWidth:"100%"};if(!n.value)return{flexBasis:"100%",maxWidth:"100%"};const u=Math.max(i-Math.max(c??0,0),0)/i;if(!u)return{};const d=`${u*100}%`;return{flexBasis:d,maxWidth:d}});return(i,c)=>{var u,d;return e.openBlock(),e.createElementBlock("div",Pf,[n.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:"text-sm text-gray-900 font-medium flex shrink-0",style:e.normalizeStyle(o.value)},[e.createTextVNode(e.toDisplayString(i.ua||i.label)+" ",1),(d=(u=i.item)==null?void 0:u.rules)!=null&&d.includes("required")&&(i.ua||i.label)?(e.openBlock(),e.createElementBlock("span",Rf,"*")):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"flex-1 min-w-0",style:e.normalizeStyle(s.value)},[e.renderSlot(i.$slots,"default",e.normalizeProps(e.guardReactiveProps(i.$attrs)))],4),i.error?(e.openBlock(),e.createElementBlock("span",Uf,e.toDisplayString(i.error),1)):e.createCommentVNode("",!0)])}}}),zf={class:"w-full relative"},Hf={key:0,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},qf=e.defineComponent({__name:"vs-layout-inline",props:{ua:{default:""},uk:{},en:{},de:{},es:{},fr:{},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""},columns:{}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",zf,[e.renderSlot(t.$slots,"default",e.normalizeProps(e.guardReactiveProps(t.$attrs))),t.error?(e.openBlock(),e.createElementBlock("span",Hf,e.toDisplayString(t.error),1)):e.createCommentVNode("",!0)]))}}),Gf={class:"flex-1 min-w-0"},Wf={key:0,class:"text-sm font-medium text-slate-700 dark:text-slate-200 flex items-center gap-1"},Kf={class:"truncate"},Yf={key:0,class:"text-red-500 text-[14px]"},Xf={key:1,class:"text-xs text-slate-500 dark:text-slate-400"},Zf={key:0,class:"mt-1 text-xs text-red-500"},Qf=e.defineComponent({__name:"vs-layout-settings",props:{ua:{default:""},uk:{},en:{},de:{},es:{},fr:{},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""},columns:{}},setup(l){const t=l,a=e.ref("uk");e.computed(()=>{var i;return((i=t.item??{})==null?void 0:i[a.value])??t.ua??t.label??""});const r=e.computed(()=>{var i;return((i=t.item)==null?void 0:i.description)??""}),n=e.computed(()=>{var i;return Array.isArray((i=t.item)==null?void 0:i.rules)&&t.item.rules.includes("required")}),o=e.computed(()=>(typeof t.error=="string"?t.error:"")??""),s=i=>{i.key==="locale"&&(a.value=i.newValue??"uk")};return e.onMounted(()=>{try{typeof localStorage<"u"&&localStorage.locale&&(a.value=localStorage.locale)}catch{}window.addEventListener("storage",s)}),e.onUnmounted(()=>{window.removeEventListener("storage",s)}),(i,c)=>{var u;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["w-full relative",{"opacity-60":(u=i.item)==null?void 0:u.disabled}])},[e.createElementVNode("div",{class:e.normalizeClass(["gap-2 md:flex-row md:items-center md:justify-between",[["switcher","native-select"].includes(i.item.type)?"flex flex-col":""]])},[e.createElementVNode("div",Gf,[i.ua||i.label?(e.openBlock(),e.createElementBlock("p",Wf,[e.createElementVNode("span",Kf,e.toDisplayString(i.item[a.value]||i.ua||i.label),1),n.value?(e.openBlock(),e.createElementBlock("span",Yf,"*")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),r.value?(e.openBlock(),e.createElementBlock("p",Xf,e.toDisplayString(r.value),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["w-full",["select","native-select"].includes(i.item.type)?"md:w-[30%]":"md:w-auto"])},[e.renderSlot(i.$slots,"default",e.normalizeProps(e.guardReactiveProps(i.$attrs)))],2)],2),o.value?(e.openBlock(),e.createElementBlock("p",Zf,e.toDisplayString(o.value),1)):e.createCommentVNode("",!0)],2)}}}),Jf={default:Of,horizontal:jf,inline:qf,settings:Qf};function ft(l){return{inputClass:e.computed(()=>{const t=`disabled:opacity-50 disabled:cursor-not-allowed outline-none focus:ring-2 focus:ring-ring focus:ring-${(l==null?void 0:l.primaryColor)||"blue"}-500 border border-solid border-stone-200 rounded-md text-sm text-stone-800 placeholder:text-stone-400 `;return(l==null?void 0:l.size)==="sm"?`${t}h-[32px]`:`${t}h-[38px]`})}}const eh=["placeholder","disabled"],th=e.defineComponent({__name:"vs-input-password",props:e.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{default:""}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,{inputClass:a}=ft(t.style),r=e.useModel(l,"modelValue"),n=e.computed(()=>!!t.disabled),o=e.computed(()=>t.placeholder??"");return(s,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{type:"password","onUpdate:modelValue":i[0]||(i[0]=c=>r.value=c),placeholder:o.value,disabled:n.value,class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[e.unref(a),{"!border-red-600":s.error}]]),style:{border:"1px solid #CFD9E0"}},null,10,eh)),[[e.vModelText,r.value]])}}),lh=["placeholder","disabled"],Na=e.defineComponent({__name:"vs-input-text",props:e.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{default:""}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,{inputClass:a}=ft(t.style),r=e.useModel(l,"modelValue"),n=e.computed(()=>!!t.disabled),o=e.computed(()=>t.placeholder??"");return(s,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{type:"text","onUpdate:modelValue":i[0]||(i[0]=c=>r.value=c),placeholder:o.value,disabled:n.value,class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[e.unref(a),{"!border-red-600":s.error}]]),style:{border:"1px solid #CFD9E0"}},null,10,lh)),[[e.vModelText,r.value]])}}),ah=["placeholder","disabled","min","max"],rh=e.defineComponent({__name:"vs-input-number",props:e.mergeModels({min:{},max:{},style:{default:()=>({})},customClass:{},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""}},{modelValue:{default:null},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,{inputClass:a}=ft(t.style),r=e.useModel(l,"modelValue"),n=e.computed(()=>!!t.disabled);return(o,s)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{type:"number",step:"any","onUpdate:modelValue":s[0]||(s[0]=i=>r.value=i),placeholder:o.placeholder,disabled:n.value,class:e.normalizeClass(["py-1.5 px-3 block w-full bg-white",[e.unref(a)]]),style:{border:"1px solid #CFD9E0"},min:o.min,max:o.max},null,10,ah)),[[e.vModelText,r.value]])}}),_e=(l,t)=>{const a=l.__vccOpts||l;for(const[r,n]of t)a[r]=n;return a},nh={},oh={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-check"};function sh(l,t){return e.openBlock(),e.createElementBlock("svg",oh,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M5 12l5 5l10 -10"},null,-1)]))}const ih=_e(nh,[["render",sh]]),ch={class:"flex items-center gap-[4px]"},dh=["value","id","disabled"],uh=["for"],mh={class:"text-[14px] text-gray-700 flex items-center dark:text-neutral-400"},ph=e.defineComponent({__name:"vs-checkbox-default",props:{value:{default:""},label:{default:""},disabled:{type:Boolean,default:!1},id:{},modelValue:{default:""},info:{},error:{}},emits:["update:modelValue"],setup(l,{emit:t}){const a=t,r=l,n=e.computed({get:()=>r.modelValue,set:s=>a("update:modelValue",s)}),o=e.computed(()=>!!r.disabled);return(s,i)=>(e.openBlock(),e.createElementBlock("div",ch,[e.withDirectives(e.createElementVNode("input",{type:"checkbox",value:s.value,"onUpdate:modelValue":i[0]||(i[0]=c=>n.value=c),class:e.normalizeClass(["shrink-0 border border-solid hidden border-gray-700 w-3.5 h-3.5 rounded text-blue-600 focus:ring-offset-0 dark:bg-neutral-800 dark:border-neutral-700 cursor-pointer",{"!cursor-not-allowed":o.value}]),id:s.id,disabled:o.value},null,10,dh),[[e.vModelCheckbox,n.value]]),e.createElementVNode("label",{for:s.id,class:e.normalizeClass(["flex flex-1 checkbox-label items-center gap-x-2 cursor-pointer text-sm text-gray-800 dark:text-neutral-300",{"!cursor-not-allowed":o.value}])},[e.createElementVNode("div",{class:e.normalizeClass(["h-[16px] text-white w-[16px] flex items-center justify-center shrink-0 border rounded",[n.value?"bg-blue-600 border-blue-600":"bg-white border-gray-600",s.error?"border-red-600":""]])},[e.createVNode(ih,{height:"12",width:"12"})],2),e.createElementVNode("span",mh,[e.renderSlot(s.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(s.label),1)])])],10,uh)]))}}),fh=["name","value","disabled"],hh={class:"flex items-center gap-[6px] text-[14px]"},gh={key:0,class:"text-[16px]"},bh=["src"],yh=e.defineComponent({__name:"vs-checkbox-buttons",props:{value:{type:[String,Number,Boolean],default:""},label:{default:""},modelValue:{default:""},disabled:{type:Boolean},id:{},icon:{},imgUrl:{},style:{}},emits:["update:modelValue"],setup(l,{emit:t}){const a=l,r=t,n=e.computed({get:()=>a.modelValue,set:i=>{r("update:modelValue",i)}}),o=e.computed(()=>Array.isArray(n.value)?n.value.includes(a.value):n.value===!0||n.value===a.value),s=e.computed(()=>{var i,c;return((i=a.style)==null?void 0:i.size)==="xs"?"p-1.5 text-xs":((c=a.style)==null?void 0:c.size)==="lg"?"p-3.5 text-[20px]":"p-2.5 text-xs"});return(i,c)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["group relative flex justify-center items-center gap-x-3 text-center bg-white text-gray-800 ring-ring ring-2 cursor-pointer rounded-lg",[s.value,o.value?"ring-blue-500":"border border-gray-200 ring-transparent"]])},[e.withDirectives(e.createElementVNode("input",{type:"checkbox",class:"hidden",name:i.id,value:i.value,"onUpdate:modelValue":c[0]||(c[0]=u=>n.value=u),disabled:i.disabled},null,8,fh),[[e.vModelCheckbox,n.value]]),e.createElementVNode("span",hh,[i.icon||i.imgUrl?(e.openBlock(),e.createElementBlock("span",gh,[i.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(i.icon)},null,2)):e.createCommentVNode("",!0),i.imgUrl?(e.openBlock(),e.createElementBlock("img",{key:1,src:i.imgUrl,width:"16",height:"16",alt:"icon"},null,8,bh)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.renderSlot(i.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(i.label),1)])])],2))}}),kh={class:"flex items-center"},Tr=e.defineComponent({__name:"vs-input-checkbox-item",props:{value:{default:""},label:{default:""},disabled:{type:Boolean,default:!1},view:{default:"default"},modelValue:{type:[Boolean,Array],default:!1},icon:{},imgUrl:{},slots:{},option:{},style:{},error:{default:""}},emits:["update:modelValue"],setup(l,{emit:t}){const a=l,r=t,n=`radio-${Math.floor(Math.random()*1e4)}`,o=e.computed({get:()=>Array.isArray(a.modelValue)?Array.isArray(a.modelValue)&&a.modelValue.includes(a.value):a.modelValue,set:i=>{if(Array.isArray(a.modelValue)){let c=[...a.modelValue];i?c.includes(a.value)||c.push(a.value):c=c.filter(u=>u!==a.value),r("update:modelValue",c)}else r("update:modelValue",i)}}),s=e.ref(`vs-checkbox-${a.view||"default"}`);return(i,c)=>{var u;return e.openBlock(),e.createElementBlock("div",kh,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s.value==="vs-checkbox-buttons"?e.unref(yh):e.unref(ph)),{value:i.value,label:i.label,info:(u=i.option)==null?void 0:u.info,disabled:i.disabled,modelValue:o.value,"onUpdate:modelValue":c[0]||(c[0]=d=>o.value=d),id:n,icon:i.icon,imgUrl:i.imgUrl,style:e.normalizeStyle(i.style),error:i.error},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.label),1)]),_:1},8,["value","label","info","disabled","modelValue","icon","imgUrl","style","error"]))])}}}),xh={},wh={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 _h(l,t){return e.openBlock(),e.createElementBlock("svg",wh,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)]))}const Eh=_e(xh,[["render",_h]]),Ch={},Vh={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-x"};function Nh(l,t){return e.openBlock(),e.createElementBlock("svg",Vh,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M18 6l-12 12"},null,-1),e.createElementVNode("path",{d:"M6 6l12 12"},null,-1)]))}const vh=_e(Ch,[["render",Nh]]),Bh={},Sh={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 Dh(l,t){return e.openBlock(),e.createElementBlock("svg",Sh,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M12 9h.01"},null,-1),e.createElementVNode("path",{d:"M11 12h1v4h1"},null,-1),e.createElementVNode("path",{d:"M12 3c7.2 0 9 1.8 9 9s-1.8 9 -9 9s-9 -1.8 -9 -9s1.8 -9 9 -9z"},null,-1)]))}const Ah=_e(Bh,[["render",Dh]]),Mh={key:0,class:"flex items-start gap-x-1"},Th={key:0,class:"text-red-500 text-[14px]"},Lh=["title"],$h=["disabled"],Xo=e.defineComponent({__name:"vs-input-switcher",props:e.mergeModels({rules:{default:()=>[]},view:{default:"checkbox"},label:{default:""},i:{default:""},text:{default:""},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,a=e.useModel(l,"modelValue");return(r,n)=>{var o,s;return t.view==="checkbox"?(e.openBlock(),e.createElementBlock("div",Mh,[e.createVNode(Tr,{modelValue:a.value,"onUpdate:modelValue":n[0]||(n[0]=i=>a.value=i),label:r.text,error:r.error||""},null,8,["modelValue","label","error"]),(o=r.rules)!=null&&o.includes("required")?(e.openBlock(),e.createElementBlock("span",Th,"*")):e.createCommentVNode("",!0),r.i?(e.openBlock(),e.createElementBlock("button",{key:1,class:"cursor-pointer",title:r.i,onClick:n[1]||(n[1]=e.withModifiers(()=>{},["prevent"]))},[e.createVNode(e.unref(Ah),{class:"text-gray-500 w-[14px] h-[14px]"})],8,Lh)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:e.normalizeClass(["inline-flex h-5 w-9 shrink-0 px-[2px] cursor-pointer items-center rounded-full shadow-sm disabled:cursor-not-allowed disabled:opacity-50",[a.value?`bg-${((s=r.style)==null?void 0:s.primaryColor)||"blue"}-500`:"bg-stone-200",r.customClass]]),disabled:r.disabled,onClick:n[2]||(n[2]=i=>a.value=!a.value)},[e.createElementVNode("span",{"data-state":"checked",class:e.normalizeClass(["pointer-events-none block h-4 w-4 rounded-full bg-white shadow-lg ring-0 transition-transform",[a.value?"translate-x-4":"translate-x-0"]])},null,2)],10,$h))}}}),Fh=["id","innerHTML"],Zo=e.defineComponent({__name:"vs-input-static",props:{text:{default:""},html:{default:""},style:{},customClass:{default:""},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",{id:t.name,class:e.normalizeClass(["text-gray-900",t.customClass]),innerHTML:t.html?t.html:t.text},null,10,Fh))}}),Ih=["placeholder","disabled","name"],Oh=e.defineComponent({__name:"vs-input-mask",props:e.mergeModels({name:{},mask:{default:""},unmask:{type:Boolean,default:!1},placeholder:{default:"_"},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,{inputClass:a}=ft(t.style),r=e.useModel(l,"modelValue"),n=e.ref(null);let o=null;return e.onMounted(async()=>{if(n.value){const{default:s}=await Promise.resolve().then(()=>l4);o=s(n.value,{mask:t.mask||"",definitions:{9:/[0-9]/,A:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/},lazy:!1}),o.on("accept",()=>{r.value=t.unmask?o.unmaskedValue:o.value}),o.on("complete",()=>{r.value=t.unmask?o.unmaskedValue:o.value}),o.value=r.value??""}}),e.onBeforeUnmount(()=>{o==null||o.destroy()}),e.watch(()=>t.mask,s=>{o&&o.updateOptions({mask:s,definitions:{9:/[0-9]/,A:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/}})}),e.watch(r,s=>{o&&o.unmaskedValue!==s&&(o.value=s||"")}),(s,i)=>(e.openBlock(),e.createElementBlock("input",{type:"text",ref_key:"inputEl",ref:n,placeholder:s.placeholder,disabled:s.disabled,name:s.name,class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[e.unref(a)]]),style:{border:"1px solid #CFD9E0"}},null,10,Ih))}}),Ph={class:"relative w-full bg-white rounded-lg"},Rh=["placeholder","disabled"],Uh=e.defineComponent({__name:"vs-input-email",props:e.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:null},name:{},placeholder:{default:""}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,{inputClass:a}=ft(t.style),r=e.useModel(l,"modelValue");return(n,o)=>(e.openBlock(),e.createElementBlock("div",Ph,[o[1]||(o[1]=e.createStaticVNode('<div class="absolute bottom-2/4 translate-y-2/4 left-[10px] cursor-pointer"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="stroke-gray-500 transition-all"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10z"></path><path d="M3 7l9 6l9 -6"></path></svg></div>',1)),e.withDirectives(e.createElementVNode("input",{type:"email","onUpdate:modelValue":o[0]||(o[0]=s=>r.value=s),placeholder:n.placeholder,disabled:n.disabled,class:e.normalizeClass(["!pl-8 py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[e.unref(a),{"!border-red-600":n.error}]]),style:{border:"1px solid #CFD9E0"}},null,10,Rh),[[e.vModelText,r.value]])]))}}),jh=["value","disabled"],zh={class:"text-[13px] text-gray-700"},Hh=e.defineComponent({__name:"vs-input-radio-default",props:e.mergeModels({style:{},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{},value:{},text:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,a=e.useModel(l,"modelValue"),r=e.computed(()=>!!t.disabled);return(n,o)=>{var s,i;return e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["flex items-center gap-0",[t.customClass,r.value?"cursor-not-allowed opacity-60":""]])},[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":o[0]||(o[0]=c=>a.value=c),type:"radio",value:t.value,disabled:r.value,class:"hidden"},null,8,jh),[[e.vModelRadio,a.value]]),e.createElementVNode("span",{class:e.normalizeClass(["w-[16px] shrink-0 h-[16px] border rounded-full flex items-center justify-center mr-[10px]",[`border-${((s=t.style)==null?void 0:s.primaryColor)||"blue"}-500`,r.value?"opacity-50 cursor-not-allowed":""]])},[a.value==t.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["w-[12px] h-[12px] shrink-0 rounded-full",[`bg-${((i=t.style)==null?void 0:i.primaryColor)||"blue"}-500`]])},null,2)):e.createCommentVNode("",!0)],2),e.createElementVNode("span",zh,e.toDisplayString(t.text),1)],2)}}}),qh=["value","disabled"],Gh={class:"text-[13px] text-gray-700"},Wh=e.defineComponent({__name:"vs-input-radio-buttons",props:e.mergeModels({style:{},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{},value:{},text:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,a=e.useModel(l,"modelValue"),r=e.computed(()=>!!t.disabled);return(n,o)=>{var s;return e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["flex items-center border rounded-lg px-2 py-1",[a.value==t.value?`ring-2 ring-ring ring-${((s=t.style)==null?void 0:s.primaryColor)||"blue"}-500`:"",t.customClass,r.value?"cursor-not-allowed opacity-60":""]])},[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":o[0]||(o[0]=i=>a.value=i),type:"radio",value:t.value,disabled:r.value,class:"hidden"},null,8,qh),[[e.vModelRadio,a.value]]),e.createElementVNode("span",Gh,e.toDisplayString(t.text),1)],2)}}}),Kh={"vs-input-radio-default":Hh,"vs-input-radio-buttons":Wh},Qo=e.defineComponent({__name:"vs-input-radio",props:e.mergeModels({options:{},position:{default:"vertical"},view:{default:"default"},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,a=e.useModel(l,"modelValue"),r=e.computed(()=>Kh[`vs-input-radio-${t.view}`]);return(n,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([n.position==="horizontal"?"flex items-center flex-wrap gap-2":""])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.options,s=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),e.mergeProps({key:s==null?void 0:s.id,text:s.text,value:s.id.toString(),checked:a.value===s.id,modelValue:a.value,"onUpdate:modelValue":o[0]||(o[0]=i=>a.value=i)},{ref_for:!0},n.$attrs),null,16,["text","value","checked","modelValue"]))),128))],2))}}),Yh={key:1,class:"w-full flex flex-col gap-4"},Xh={key:0,class:"text-sm font-medium text-muted-foreground my-2"},Zh="Без категорії",Qh=e.defineComponent({__name:"vs-input-checkbox",props:{options:{default:()=>[]},position:{default:"vertical"},slots:{default:null},colSpan:{default:0},data:{},view:{},group:{default:void 0},values:{default:()=>[]},style:{},customClass:{},disabled:{type:Boolean},modelValue:{default:!1},error:{},name:{},placeholder:{}},emits:["update:modelValue"],setup(l,{emit:t}){const a=l,r=t,n=e.ref([]),o=e.reactive({}),s=p=>(p==null?void 0:p.value)||(p==null?void 0:p.id)||(p==null?void 0:p.text)||p,i=p=>p.text||String(p),c=p=>`lg:col-span-${p||12}`,u=e.computed(()=>[a.position==="vertical"?"flex flex-col":"",a.colSpan?"grid":"flex justify-start"]),d=p=>p==null||p===""?null:typeof p=="string"||typeof p=="number"?p:String(p),m=e.computed(()=>{var w;if(!a.group)return[];const p=new Map;n.value.forEach(x=>{var N;const k=x[a.group],_=d(k);p.has(_)||p.set(_,[]),(N=p.get(_))==null||N.push(x)});const y=[];(w=a.values)!=null&&w.length&&a.values.forEach(x=>{const k=d(x);y.push(k)});const h=new Set,g=x=>{const k=p.get(x)||[];if(!k.length)return null;const _=x===null?"group-null":`group-${String(x)}`,N=x===null?Zh:String(x);return h.add(x),{key:_,label:N,options:k}},b=[];return y.forEach(x=>{const k=g(x);k&&b.push(k)}),p.forEach((x,k)=>{if(h.has(k))return;const _=g(k);_&&b.push(_)}),b}),f=async()=>{try{const p=await fetch(`/api/suggest/${a.data}`).then(y=>y.json());n.value=(p==null?void 0:p.data)||p}catch(p){console.error(p)}};return e.watch(()=>a.modelValue,p=>{if(typeof p=="boolean"&&n.value.length===1){const y=s(n.value[0]);o[y]=p}else if(Array.isArray(p)){const y=new Set(p);n.value.forEach(h=>{if(!h.disabled){const g=s(h);o[g]=y.has(g)}})}},{immediate:!0}),e.watch(o,()=>{if(!n.value.length){r("update:modelValue",null);return}const p=Object.entries(o).filter(([,y])=>y).map(([y])=>y);r("update:modelValue",p.length===0?[]:p)},{deep:!0}),e.onMounted(()=>{if(a.data)f().then(()=>{if(typeof a.modelValue=="boolean"&&n.value.length===1){const p=s(n.value[0]);o[p]=a.modelValue}else if(Array.isArray(a.modelValue)){const p=new Set(a.modelValue);n.value.forEach(y=>{if(!y.disabled){const h=s(y);o[h]=p.has(h)}})}});else if(n.value=a.options,typeof a.modelValue=="boolean"&&n.value.length===1){const p=s(n.value[0]);o[p]=a.modelValue}else if(Array.isArray(a.modelValue)){const p=new Set(a.modelValue);n.value.forEach(y=>{if(!y.disabled){const h=s(y);o[h]=p.has(h)}})}}),(p,y)=>a.group?(e.openBlock(),e.createElementBlock("div",Yh,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,h=>(e.openBlock(),e.createElementBlock("div",{key:h.key,class:"flex flex-col gap-2"},[h.label?(e.openBlock(),e.createElementBlock("span",Xh,e.toDisplayString(h.label),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["p-0 w-full gap-[12px]",u.value])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.options,g=>(e.openBlock(),e.createBlock(Tr,{modelValue:o[s(g)],"onUpdate:modelValue":b=>o[s(g)]=b,value:s(g),class:e.normalizeClass(c(p.colSpan)),disabled:a.disabled||g.disabled,label:i(g),key:`${h.key}-${s(g)}`,icon:g==null?void 0:g.icon,imgUrl:g==null?void 0:g.imgUrl,option:g,view:p.view},null,8,["modelValue","onUpdate:modelValue","value","class","disabled","label","icon","imgUrl","option","view"]))),128))],2)]))),128))])):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["p-0 w-full gap-[10px]",u.value])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,h=>(e.openBlock(),e.createBlock(Tr,{modelValue:o[s(h)],"onUpdate:modelValue":g=>o[s(h)]=g,value:s(h),class:e.normalizeClass(c(p.colSpan)),disabled:a.disabled||h.disabled,label:i(h),key:s(h),icon:h==null?void 0:h.icon,imgUrl:h==null?void 0:h.imgUrl,option:h,view:p.view},null,8,["modelValue","onUpdate:modelValue","value","class","disabled","label","icon","imgUrl","option","view"]))),128))],2))}}),Jo=_e(Qh,[["__scopeId","data-v-8e66207e"]]),Jh=["type","placeholder","disabled"],e0=e.defineComponent({__name:"vs-input-date1",props:{style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""},mode:{default:"date"}},emits:["update:modelValue"],setup(l,{emit:t}){const a=l;function r(d){return d?a.mode==="datetime"?(d.includes("T")?d:null)||d+(d.includes(" ")?"":"T00:00"):d==null?void 0:d.split(" ")[0]:null}const{inputClass:n}=ft(a.style),o=t,s=e.computed({get:()=>r(a.modelValue),set:d=>o("update:modelValue",d)}),i=e.computed(()=>a.mode==="datetime"?"datetime-local":a.mode),c=e.computed(()=>!!a.disabled),u=e.computed(()=>a.placeholder??"");return(d,m)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{type:i.value,"onUpdate:modelValue":m[0]||(m[0]=f=>s.value=f),placeholder:u.value,disabled:c.value,ref:"date",class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[d.modelValue?"":"text-opacity-50",e.unref(n)].join(" ")]),style:{border:"1px solid #CFD9E0"}},null,10,Jh)),[[e.vModelDynamic,s.value]])}}),es=async(l,t,a,r)=>{var n;try{const o=new FormData;return o.append("unique","true"),o.append("file",l),(n=await fetch(`/file/upload/uploads?id=${t||""}&form=${a||""}&table=${r||""}`,{method:"POST",body:o}).then(s=>s.json()))==null?void 0:n.result}catch(o){return xe({type:"error",title:"Помилка!",message:"Сталась помилка під час завантаження файлу",position:"right-bottom"}),console.error("Сталась помилка завантаження файлу",o),null}},t0=async l=>{try{return await fetch(`file/delete${l}`),!0}catch(t){return console.error(t),!1}},ts=async l=>{try{const t=await fetch(`file/download/files/uploads${l}`),a=await t.arrayBuffer(),r=t.headers["content-type"],n=new TextDecoder("utf-8").decode(a),o=new Blob([n],{type:r}),s=document.createElement("a");s.setAttribute("download",l),s.href=window.URL.createObjectURL(o),s.click()}catch(t){console.error(t.message)}},l0={},a0={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 r0(l,t){return e.openBlock(),e.createElementBlock("svg",a0,t[0]||(t[0]=[e.createElementVNode("path",{d:"M5 12h14"},null,-1),e.createElementVNode("path",{d:"M12 5v14"},null,-1)]))}const Gl=_e(l0,[["render",r0]]),n0={},o0={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-text",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function s0(l,t,a,r,n,o){return e.openBlock(),e.createElementBlock("svg",o0,t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><line x1="9" y1="9" x2="10" y2="9"></line><line x1="9" y1="13" x2="15" y2="13"></line><line x1="9" y1="17" x2="15" y2="17"></line>',6)]))}const i0=_e(n0,[["render",s0]]),c0={},d0={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-table",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function u0(l,t,a,r,n,o){return e.openBlock(),e.createElementBlock("svg",d0,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"},null,-1),e.createElementVNode("line",{x1:"4",y1:"10",x2:"20",y2:"10"},null,-1),e.createElementVNode("line",{x1:"10",y1:"4",x2:"10",y2:"20"},null,-1)]))}const m0=_e(c0,[["render",u0]]),p0={},f0={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 h0(l,t){return e.openBlock(),e.createElementBlock("svg",f0,t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><path d="M9 9l1 0"></path><path d="M9 13l6 0"></path><path d="M9 17l6 0"></path>',6)]))}const ls=_e(p0,[["render",h0]]),g0={},b0={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-zip",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function y0(l,t,a,r,n,o){return e.openBlock(),e.createElementBlock("svg",b0,t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M6 20.735a2 2 0 0 1 -1 -1.735v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2h-1"></path><path d="M11 17a2 2 0 0 1 2 2v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1v-2a2 2 0 0 1 2 -2z"></path><line x1="11" y1="5" x2="10" y2="5"></line><line x1="13" y1="7" x2="12" y2="7"></line><line x1="11" y1="9" x2="10" y2="9"></line><line x1="13" y1="11" x2="12" y2="11"></line><line x1="11" y1="13" x2="10" y2="13"></line><line x1="13" y1="15" x2="12" y2="15"></line>',9)]))}const k0=_e(g0,[["render",y0]]),x0={},w0={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-code",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function _0(l,t,a,r,n,o){return e.openBlock(),e.createElementBlock("svg",w0,t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><path d="M10 13l-1 2l1 2"></path><path d="M14 13l1 2l-1 2"></path>',5)]))}const E0=_e(x0,[["render",_0]]),C0=l=>{if(!l)return"";const t=l==null?void 0:l.split(".");return t[t.length-1]},V0=l=>{const t=C0(l),a={imageFormat:["tiff","jpg","jpeg","png","svg","ico","webp"],sheetsFormat:["xls","csv","xlsx"],archivesFormat:["zip","rar"],textsFormat:["json","geojson","txt","yml","yaml","shp"],documentsFormat:["pdf"]};return a.imageFormat.includes(t)?"img":a.sheetsFormat.includes(t)?m0:a.textsFormat.includes(t)?E0:a.documentsFormat.includes(t)?i0:a.archivesFormat.includes(t)?k0:ls},N0={},v0={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",class:"icon icon-tabler icons-tabler-outline icon-tabler-trash"};function B0(l,t){return e.openBlock(),e.createElementBlock("svg",v0,t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 7l16 0"></path><path d="M10 11l0 6"></path><path d="M14 11l0 6"></path><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"></path><path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"></path>',6)]))}const va=_e(N0,[["render",B0]]),S0={},D0={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",class:"icon icon-tabler icons-tabler-outline icon-tabler-download"};function A0(l,t){return e.openBlock(),e.createElementBlock("svg",D0,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),e.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),e.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const as=_e(S0,[["render",A0]]),M0=["title"],T0={class:"absolute hidden top-0 right-0 flex items-center gap-x-2 w-full h-full justify-center"},L0=e.defineComponent({__name:"vs-input-file-list-item",props:e.mergeModels({format:{},multiple:{type:Boolean},max_size:{},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},{value:{},valueModifiers:{},item:{},itemModifiers:{}}),emits:["update:value","update:item"],setup(l){const t=e.useModel(l,"value"),a=e.useModel(l,"item"),r=l;return(n,o)=>(e.openBlock(),e.createElementBlock("div",{title:a.value,class:"h-[120px] w-[120px] border text-gray-300 border-dashed border-[#CFD9E0] rounded-lg overflow-hidden relative item-file"},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(V0)(a.value)),{src:a.value,alt:"file",class:"w-full h-full object-cover cursor-pointer",onClick:o[0]||(o[0]=s=>e.unref(ts)(a.value))},null,8,["src"])),e.createElementVNode("div",T0,[e.createElementVNode("button",{type:"button",onClick:o[1]||(o[1]=s=>{var i;e.unref(t0)(a.value),t.value=r.multiple?(i=t.value)==null?void 0:i.filter(c=>c!==a.value):""}),class:"w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-red-500"},[e.createVNode(va,{class:"w-4 h-4"})]),e.createElementVNode("button",{type:"button",onClick:o[2]||(o[2]=s=>e.unref(ts)(a.value)),class:"w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-blue-500"},[e.createVNode(as,{class:"w-4 h-4"})])])],8,M0))}}),rs=_e(L0,[["__scopeId","data-v-286cdbc0"]]),$0={class:"flex items-center gap-x-2"},F0=["multiple","disabled"],I0={key:1,class:"flex items-center flex-wrap gap-2"},O0={key:1,class:"loader"},P0={key:1,class:"loader"},R0=e.defineComponent({__name:"vs-input-file",props:e.mergeModels({format:{},multiple:{type:Boolean},max_size:{},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["change"],["update:modelValue"]),setup(l,{emit:t}){const a=l,r=e.useModel(l,"modelValue"),n=t,o=e.ref(null),s=e.ref(!1),i=d=>Array.isArray(r.value)&&r.value[d]||"",c=d=>{if(a.max_size&&d.size>a.max_size*1024*1024){const m=(d.size/1048576).toFixed(2);return xe({type:"error",title:"Помилка!",message:`Файл "${d.name}" занадто великий. Максимальний розмір: ${a.max_size} МБ, розмір файлу: ${m} МБ`,position:"right-bottom"}),!1}return!0},u=async d=>{const{files:m}=d.target;if(!m||m.length===0)return;const f=Array.from(m);if(a.max_size&&f.filter(p=>!c(p)).length>0){o.value&&(o.value.value="");return}s.value=!0;try{if(a.multiple){const p=Array.from(m).map(async h=>a.format&&!h.name.endsWith(a.format)?null:await es(h,"1","form","table")),y=(await Promise.all(p)).filter(h=>h!==null).map(h=>h==null?void 0:h.file_path).filter(Boolean);r.value=[...r.value||[],...y],n("change",r.value)}else{const p=m[0];if(a.format&&!p.name.endsWith(a.format))return;const y=await es(p,"1","form","table");r.value=y==null?void 0:y.file_path,n("change",r.value||"")}}finally{s.value=!1,o.value&&(o.value.value="")}};return(d,m)=>(e.openBlock(),e.createElementBlock("div",$0,[e.createElementVNode("input",{class:"hidden",ref_key:"fileInput",ref:o,type:"file",multiple:d.multiple,onChange:u,disabled:s.value||d.disabled},null,40,F0),!d.multiple&&r.value?(e.openBlock(),e.createBlock(rs,{key:0,item:r.value,"onUpdate:item":m[0]||(m[0]=f=>r.value=f),value:r.value,"onUpdate:value":m[1]||(m[1]=f=>r.value=f)},null,8,["item","value"])):d.multiple?(e.openBlock(),e.createElementBlock("div",I0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(f,p)=>(e.openBlock(),e.createBlock(rs,{multiple:d.multiple,key:p,value:r.value,"onUpdate:value":m[2]||(m[2]=y=>r.value=y),item:i(p)},null,8,["multiple","value","item"]))),128)),e.createElementVNode("div",{onClick:m[3]||(m[3]=f=>{var p;return!d.disabled&&!s.value&&((p=o.value)==null?void 0:p.click())}),class:e.normalizeClass(["relative h-[120px] w-[120px] border text-gray-300 hover:text-blue-500 border-dashed border-[#CFD9E0] rounded-lg flex items-center justify-center transition-all duration-300",d.disabled||s.value?"opacity-50 cursor-not-allowed":"cursor-pointer hover:border-blue-500 hover:bg-blue-50"])},[s.value?(e.openBlock(),e.createElementBlock("div",O0)):(e.openBlock(),e.createBlock(Gl,{key:0,class:"w-6 h-6"}))],2)])):e.createCommentVNode("",!0),d.multiple?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:2,onClick:m[4]||(m[4]=f=>{var p;return(p=o.value)==null?void 0:p.click()}),class:e.normalizeClass([d.disabled||s.value?"opacity-50 cursor-not-allowed":"cursor-pointer hover:border-blue-500","relative h-[120px] w-[120px] border text-gray-300 hover:text-blue-500 border-dashed border-gray-300 rounded-lg flex items-center justify-center cursor-pointer hover:border-blue-500 transition-all duration-300 hover:bg-blue-50"])},[s.value?(e.openBlock(),e.createElementBlock("div",P0)):(e.openBlock(),e.createBlock(Gl,{key:0,class:"w-6 h-6"}))],2))]))}}),U0=_e(R0,[["__scopeId","data-v-e613a523"]]),j0={class:"max-w-[55vw]"},z0={class:"text-sm font-semibold text-gray-800 truncate dark:text-neutral-200"},H0={class:"flex items-center text-xs text-gray-500 truncate dark:text-neutral-500"},q0={class:"px-[5px]"},G0={class:""},Ba=e.defineComponent({__name:"vs-widget-file-info",props:{item:{default:null}},setup(l){const t=l,a=e.computed(()=>{try{return new Date(t.item.cdate).toLocaleDateString("uk-UA",{day:"2-digit",month:"long",year:"numeric"})}catch{return""}});function r(n){if(n<1024)return`${n} B`;const o=n/1024;return o<1024?`${o.toFixed(2)} KB`:`${(o/1024).toFixed(2)} MB`}return(n,o)=>{var s,i,c,u;return e.openBlock(),e.createElementBlock(e.Fragment,null,[o[1]||(o[1]=e.createStaticVNode('<div class="flex items-center justify-center h-[30px] w-[30px]"><svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" 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-file"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path></svg></div>',1)),e.createElementVNode("div",j0,[e.createElementVNode("p",z0,e.toDisplayString((s=n.item)==null?void 0:s.uploaded_name),1),e.createElementVNode("p",H0,[e.createElementVNode("span",null,e.toDisplayString((i=n.item)==null?void 0:i.username),1),e.withDirectives(e.createElementVNode("span",q0,"|",512),[[e.vShow,(c=n.item)==null?void 0:c.username]]),e.createElementVNode("span",null,e.toDisplayString(a.value),1),o[0]||(o[0]=e.createElementVNode("span",{class:"px-[5px]"},"|",-1)),e.createElementVNode("span",G0,e.toDisplayString(r((u=n.item)==null?void 0:u.size)),1)])])],64)}}}),W0={class:"p-3 relative group flex items-center gap-x-3 border border-gray-200 bg-white rounded-md w-full"},K0={key:0,class:"flex w-full gap-x-3 items-center"},Y0={key:1,class:"flex gap-x-3 w-full items-center"},X0={key:2,class:"flex gap-x-3 w-full items-center"},Z0=["href"],Q0={key:3,class:"flex gap-x-3 w-full items-center"},J0={class:"lg:absolute lg:top-3 lg:end-1 opacity-100"},eg={class:"p-0.5 sm:p-1 inline-flex items-center gap-0.5 bg-white rounded-lg dark:bg-neutral-800 dark:border-neutral-700"},tg={class:"inline-block"},lg={class:"inline-block"},ag=e.defineComponent({__name:"vs-widget-file-item",props:{item:{default:null},index:{default:0},prefix:{default:"/api"}},emits:["update","openModal","openLightbox"],setup(l,{emit:t}){const a=l,r=t;function n(d){return["pdf","json"].includes(d.ext)}function o(d){return["ppt","pptx","doc","docx","xls","xlsx"].includes(d.ext)}function s(d){const m=document.createElement("a");m.setAttribute("download",d==null?void 0:d.uploaded_name),m.href=d==null?void 0:d.file_path,m.click()}async function i(){try{await fetch(`${a.prefix}/widget/file/${a.item.entity_id}/${a.item.file_id}`),r("update")}catch(d){console.error(d)}}function c(){r("openModal",{title:"Ви впевнені?",message:"Ви впевнені, що хочете видалити цей файл?",confirmButtonText:"Так, я впевнена/ий",cancelButtonText:"Скасувати",confirm:i,updateListOnConfirm:!0})}function u(d){(a.item.ext==="jpg"||a.item.ext==="png")&&r("openLightbox",{item:a.item,index:d})}return(d,m)=>(e.openBlock(),e.createElementBlock("div",W0,[d.item.ext==="jpg"||d.item.ext==="png"?(e.openBlock(),e.createElementBlock("div",K0,[e.createElementVNode("div",{class:"max-w-[55vw] cursor-pointer flex gap-x-3 w-full items-center",onClick:m[0]||(m[0]=f=>u(d.index))},[e.createVNode(Ba,{item:d.item},null,8,["item"])])])):n(d.item)?(e.openBlock(),e.createElementBlock("div",Y0,[e.createVNode(Ba,{item:d.item},null,8,["item"])])):o(d.item)?(e.openBlock(),e.createElementBlock("div",X0,[e.createElementVNode("a",{href:`/api/file-preview?id=${d.item.file_id}`,target:"_blank",class:"flex gap-x-3 w-full items-center"},[e.createVNode(Ba,{item:d.item},null,8,["item"])],8,Z0)])):(e.openBlock(),e.createElementBlock("div",Q0,[e.createVNode(Ba,{item:d.item},null,8,["item"])])),e.createElementVNode("div",J0,[e.createElementVNode("div",eg,[e.createElementVNode("div",tg,[e.createElementVNode("button",{class:"inline-flex p-[6px] justify-center items-center gap-x-2 rounded-lg border border-transparent text-gray-500 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none dark:text-neutral-400 focus:outline-none focus:bg-gray-100 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:m[1]||(m[1]=f=>s(d.item))},[e.createVNode(as,{height:"14",width:"14"})])]),m[3]||(m[3]=e.createElementVNode("div",{class:"w-px h-5 mx-1 bg-gray-200 dark:bg-neutral-700"},null,-1)),e.createElementVNode("div",lg,[e.createElementVNode("button",{type:"button",class:"size-[30px] inline-flex justify-center items-center gap-x-2 rounded-lg border border-transparent text-red-600 hover:bg-red-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-red-100 dark:text-red-500 dark:hover:bg-red-500/20 dark:focus:bg-red-500/20",onClick:m[2]||(m[2]=f=>c())},[e.createVNode(va,{height:"14",width:"14"})])])])])]))}}),rg={},ng={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",class:"icon icon-tabler icons-tabler-outline icon-tabler-download"};function og(l,t){return e.openBlock(),e.createElementBlock("svg",ng,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),e.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),e.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const sg=_e(rg,[["render",og]]),ig={class:"flex flex-col widget-file xl:bg-white xl:rounded-xl dark:xl:bg-neutral-800 dark:xl:border-neutral-700 w-full"},cg={class:"flex w-full mb-[12px] items-center gap-x-2"},dg={class:"font-semibold text-gray-800 dark:text-neutral-200 text-[14px]"},ug={class1:"ml-auto"},mg={class:"py-1.5 px-4 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg bg-gray-100 cursor-pointer hover:bg-gray-200 text-gray-800 shadow-2xs hover:bg-gray-50 focus:outline-hidden focus:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},pg={key:0,class:"py-4 mb-4 space-y-4 border-gray-200 border-y dark:border-neutral-700"},fg={class:"relative"},hg={key:1,class:"space-y-3 max-h-[300px] 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"},gg={key:0},bg=e.defineComponent({__name:"vs-input-file-list",props:{id:{default:""},prefix:{default:"/api"},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},emits:["update"],setup(l,{emit:t}){const a=l,r=e.inject("form"),n=e.computed(()=>r.value.formId),o=e.ref(!1),s=e.ref(0),i=t,c=e.ref(!1),u=e.ref({}),d=e.ref([]),m=e.ref(""),f=e.computed(()=>Array.isArray(d.value)?d.value.filter(x=>x.ext==="jpg"||x.ext==="png").map(x=>x==null?void 0:x.file_path):[]),p=e.computed(()=>m.value===""?d.value:d.value.filter(x=>{var k;return(k=x==null?void 0:x.uploaded_name)==null?void 0:k.includes(m.value)})),y=x=>{const k=f.value.findIndex(_=>_===x.item.file_path);k!==-1&&(o.value=!0,s.value=k)},h=async()=>{try{const x=await fetch(`${a.prefix}/widget/file/${n.value}`).then(k=>k.json());d.value=x==null?void 0:x.rows}catch(x){console.error(x)}},g=async x=>{await Promise.all(Array.from(x.target.files).map(async k=>{const _=new FormData;_.append("file",k);try{const N=`${a.prefix}/widget/file/${n.value}`,V=await fetch(N,{method:"POST",body:_});return V.ok?(i("update","file-list"),k):(xe({type:V.status>=400&&V.status<500?"warning":"error",title:"Error",message:`Error code: ${V.status}`}),null)}catch(N){return xe({type:"error",title:"Error",message:N.message||"Unknown error"}),console.error(N),null}})),await h()},b=x=>{const k={...x};return x.cancel||(k.cancel=()=>{c.value=!1}),x.updateListOnConfirm&&(k.confirm=async()=>{await x.confirm(),c.value=!1,h()}),k},w=x=>{u.value=b(x),c.value=!0};return e.watch(n,x=>{x&&h()}),e.onMounted(()=>{n.value&&h()}),(x,k)=>{var V,P,$;const _=e.resolveComponent("Lightbox"),N=e.resolveComponent("MessageBox");return e.openBlock(),e.createElementBlock("div",ig,[e.createElementVNode("div",cg,[e.createElementVNode("h2",dg," Файлів: "+e.toDisplayString((V=d.value)==null?void 0:V.length),1),e.createElementVNode("div",ug,[e.createElementVNode("label",null,[e.createElementVNode("input",{type:"file",class:"hidden",onChange:k[0]||(k[0]=M=>g(M))},null,32),e.createElementVNode("div",mg,[e.createVNode(sg,{height:"16",width:"16"})])])])]),((P=d.value)==null?void 0:P.length)>4?(e.openBlock(),e.createElementBlock("div",pg,[e.createElementVNode("div",null,[e.createElementVNode("div",fg,[k[8]||(k[8]=e.createElementVNode("div",{class:"absolute inset-y-0 start-0 flex items-center pointer-events-none z-[1] ps-3.5"},[e.createElementVNode("svg",{class:"flex-shrink-0 text-gray-500 size-4 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"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),e.createElementVNode("path",{d:"m21 21-4.3-4.3"})])],-1)),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":k[1]||(k[1]=M=>m.value=M),class:"py-2 px-3 ps-10 pe-16 block w-full bg-gray-200 xl:bg-gray-100 rounded-lg text-sm focus:border-blue-500 h-[40px] focus:border-2 focus:outline-none 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:"Введіть назву файлу"},null,512),[[e.vModelText,m.value,void 0,{trim:!0}]])])])])):e.createCommentVNode("",!0),($=d.value)!=null&&$.length?(e.openBlock(),e.createElementBlock("div",hg,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,(M,A)=>(e.openBlock(),e.createBlock(ag,{key:A,prefix:x.prefix,item:M,index:A,onUpdate:k[2]||(k[2]=q=>x.$emit("update","file-list")),onOpenModal:k[3]||(k[3]=q=>w(q)),onOpenLightbox:k[4]||(k[4]=q=>y(q))},null,8,["prefix","item","index"]))),128)),p.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",gg,k[9]||(k[9]=[e.createElementVNode("p",{class:"text-sm text-gray-600 font-sm"}," Файлів з такою назвою не існує, введіть інше пошукове слово ",-1)])))])):e.createCommentVNode("",!0),e.createVNode(_,{modelValue:o.value,"onUpdate:modelValue":k[5]||(k[5]=M=>o.value=M),startIndex:s.value,"onUpdate:index":k[6]||(k[6]=M=>s.value=M),images:f.value},null,8,["modelValue","startIndex","images"]),e.createVNode(N,e.mergeProps({modelValue:c.value,"onUpdate:modelValue":k[7]||(k[7]=M=>c.value=M),onConfirm:u.value.confirm},u.value),null,16,["modelValue","onConfirm"])])}}}),yg={class:"flex items-center justify-between"},kg={class:"text-[16px] text-gray-900 font-medium"},xg={class:"grid gap-3"},wg=e.defineComponent({__name:"vs-container-switcher",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})},isOpen:{type:Boolean,default:!1}},setup(l){const t=l,a=e.ref(t.isOpen);return e.watch(()=>t.isOpen,r=>{a.value=r}),(r,n)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",yg,[e.createElementVNode("p",kg,e.toDisplayString(l.title),1),e.createVNode(Xo,{modelValue:a.value,"onUpdate:modelValue":n[0]||(n[0]=o=>a.value=o),style:e.normalizeStyle(l.style)},null,8,["modelValue","style"])]),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",xg,[e.renderSlot(r.$slots,"default",{},void 0,!0)],512),[[e.vShow,a.value]])]),_:3})]))}}),_g=_e(wg,[["__scopeId","data-v-90320b87"]]),Eg={class:"text-[16px] text-gray-900 font-medium"},Cg={class:"grid gap-3"},Vg=e.defineComponent({__name:"vs-container-accordion",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})},isOpen:{type:Boolean,default:!1}},setup(l){const t=l,a=e.ref(t.isOpen);return e.watch(()=>t.isOpen,r=>{a.value=r}),(r,n)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("button",{type:"button",onClick:n[0]||(n[0]=o=>a.value=!a.value),class:"flex items-center gap-2"},[e.createVNode(e.unref(Eh),{class:e.normalizeClass(["h-4 w-4 duration-300",[a.value?"-rotate-180":""]])},null,8,["class"]),e.createElementVNode("span",Eg,e.toDisplayString(l.title),1)]),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",Cg,[e.renderSlot(r.$slots,"default",{},void 0,!0)],512),[[e.vShow,a.value]])]),_:3})]))}}),Ng=_e(Vg,[["__scopeId","data-v-590eff11"]]),vg={class:"flex items-center justify-between"},Bg=e.defineComponent({__name:"vs-container-default",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",vg,[e.createElementVNode("p",null,e.toDisplayString(l.title),1)]),e.renderSlot(t.$slots,"default")]))}}),Sg={switcher:_g,accordion:Ng,default:Bg},wt={Equal:"==",Inequal:"!=",Higer:">",HigerOrEqual:">=",Lower:"<",LowerOrEqual:"<=",Between:"between",StartWith:"^",EndWith:"$",Contain:"*",In:"in",NotIn:"not_in"},Dg=(l,t)=>String(l)===String(t),Ag=(l,t)=>String(l)!==String(t),Mg=(l,t)=>l>t,Tg=(l,t)=>l>=t,Lg=(l,t)=>l<t,$g=(l,t)=>l<=t,Fg=(l,t)=>Array.isArray(t)&&t.length===2?l>=t[0]&&l<=t[1]:!1,Ig=(l,t)=>String(l).startsWith(String(t)),Og=(l,t)=>String(l).endsWith(String(t)),Pg=(l,t)=>String(l).includes(String(t)),Rg=(l,t)=>Array.isArray(t)?t.includes(l):!1,Ug=(l,t)=>Array.isArray(t)?!t.includes(l):!0,ns=(l,t)=>{if(!t)return!0;switch(t==null?void 0:t[1]){case wt.Equal:return Dg(l,t==null?void 0:t[2]);case wt.Inequal:return Ag(l,t==null?void 0:t[2]);case wt.Higer:return Mg(l,t==null?void 0:t[2]);case wt.HigerOrEqual:return Tg(l,t==null?void 0:t[2]);case wt.Lower:return Lg(l,t==null?void 0:t[2]);case wt.LowerOrEqual:return $g(l,t==null?void 0:t[2]);case wt.Between:return Fg(l,t==null?void 0:t[2]);case wt.StartWith:return Ig(l,t==null?void 0:t[2]);case wt.EndWith:return Og(l,t==null?void 0:t[2]);case wt.Contain:return Pg(l,t==null?void 0:t[2]);case wt.In:return Rg(l,t==null?void 0:t[2]);case wt.NotIn:return Ug(l,t==null?void 0:t[2]);default:return!0}},jg=e.defineComponent({__name:"vs-input-container",props:{style:{type:Object,default:()=>({})},title:{type:String,default:""},view:{type:String,default:"default"},name:{type:String,default:""},schema:{type:Array,default:()=>[]}},setup(l){const t=l,a=e.inject("values",e.ref({})),r=e.inject("form"),n=e.computed(()=>{var i;return(i=t.schema)==null?void 0:i.filter(c=>{var f,p,y,h;const u=c==null?void 0:c.conditions;if(!u)return!0;const d=Array.isArray(u)?u[0]:u,m=t.name?((p=(f=a.value)==null?void 0:f[t.name])==null?void 0:p[d])??((y=a.value)==null?void 0:y[d]):(h=a.value)==null?void 0:h[d];return ns(m,u)})}),o=e.computed(()=>Sg[t.view]),s=e.computed(()=>{if(a.value||(a.value={}),!t.name)return a.value;const i=a.value[t.name];if(i)return i;const c={};return a.value={...a.value,[t.name]:c},c});return(i,c)=>{var u;return(u=l.schema)!=null&&u.length?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value),{key:0,title:l.title,style:e.normalizeStyle(l.style)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,d=>{var m,f;return e.openBlock(),e.createBlock(ss,e.mergeProps({key:d.name},{ref_for:!0},d,{item:d,modelValue:s.value[d.name],"onUpdate:modelValue":p=>s.value[d.name]=p,style:l.style,error:(f=(m=e.unref(r))==null?void 0:m.errors)==null?void 0:f[d.name]}),null,16,["item","modelValue","onUpdate:modelValue","style","error"])}),128))]),_:1},8,["title","style"])):e.createCommentVNode("",!0)}}}),zg=["aria-expanded","data-focus"],Hg={key:0,class:"flex flex-wrap items-center gap-1 overflow-y-auto min-w-0 flex-1"},qg={class:"flex items-center min-w-0"},Gg=["title"],Wg=["innerHTML"],Kg=["onClick"],Yg={class:"flex-1 min-w-[2px]"},Xg=["placeholder"],Zg=["title"],Qg=["innerHTML"],Jg={key:2,class:"flex-1 min-w-[2px]"},eb=["placeholder"],tb={class:"flex items-center shrink-0"},lb=["disabled"],ab=["disabled","title"],rb=["aria-disabled","onClick"],nb=["innerHTML"],ob={key:1,class:"px-3 py-2 text-center text-gray-500"},sb=["disabled"],Lr=e.defineComponent({__name:"vs-input-select",props:{multiple:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},mode:{},defaultValue:{},search:{type:Boolean,default:!0},placeholder:{default:"Оберіть значення"},prefix:{default:"api"},host:{default:""},data:{default:""},options:{default:()=>[]},api:{default:null},maxHeight:{default:400},parent:{},set:{},slot:{},add:{},teleport:{default:"body"},auto:{default:0},style:{default:()=>({})},customClass:{default:""},modelValue:{},error:{default:null},name:{}},emits:["change","update:modelValue"],setup(l,{emit:t}){const a=l,r=t,n=e.computed(()=>a.multiple),o=e.computed(()=>a.disabled);ft(a.style);const s=e.computed({get:()=>a.modelValue,set:B=>r("update:modelValue",B)});!s.value&&a.defaultValue&&(s.value=a.defaultValue);const i=e.ref(null),c=e.ref(null),u=e.ref(null),d=e.ref(null),m=e.ref(!1),f=e.ref(!1),p=e.ref(null),y=e.ref([]),h=e.ref(-1),g=e.ref([]),b=e.ref(""),w=e.ref(null),x=e.ref("bottom"),k=e.ref({}),_=e.ref([]),N=e.computed(()=>{if(!_.value.length)return[];const B=y.value,T=new Map(B.map(K=>{var te;return[(te=K.id)==null?void 0:te.toString(),K]}));return _.value.map(K=>T.get(K==null?void 0:K.toString())).filter(K=>!!K)}),V=e.computed(()=>a.placeholder||"Select..."),P=e.computed(()=>D(p.value));e.computed(()=>n.value?!_.value.length&&b.value==="":!P.value&&b.value==="");const $=e.computed(()=>o.value?!1:n.value?_.value.length>0:!!s.value),M=B=>{var T;return n.value?_.value.some(K=>(K==null?void 0:K.toString())===(B==null?void 0:B.toString())):((T=s.value)==null?void 0:T.toString())===(B==null?void 0:B.toString())},A=e.computed(()=>{let B=y.value??[];if(!a.data&&b.value.trim()!==""){const T=b.value.toLowerCase();B=B.filter(K=>{var we,Oe;const te=D(K).toLowerCase(),he=((Oe=(we=K.text)==null?void 0:we.toLowerCase)==null?void 0:Oe.call(we))||"";return te.includes(T)||he.includes(T)})}if(n.value&&_.value.length){const T=new Set(_.value.map(K=>K==null?void 0:K.toString()));B=B.filter(K=>{var te;return!T.has((te=K.id)==null?void 0:te.toString())})}return B}),q=e.inject("values"),Q=/\{\{\s*([^}]+?)\s*\}\}/g,R=B=>(B?String(B):"").replace(/<[^>]*>/g,"").trim(),I=e.computed(()=>a.slot??(a==null?void 0:a.optionTemplate)??""),F=B=>{if(!B)return"";const T=I.value;return T?T.replace(Q,(K,te)=>{const he=te.trim(),we=B[he];return we!=null?String(we):""}):B.text??""},D=B=>{if(!B)return"";if(!I.value)return B.text??"";const T=F(B);return R(T)||B.text||""},z=B=>{a.set&&(q!=null&&q.value)&&Object.entries(a.set).forEach(([T,K])=>{if(!T)return;const te=B?B[K]:null;q.value[T]=te??null})},ee=e.computed(()=>{var B,T;return a.parent?((T=(B=q==null?void 0:q.value)==null?void 0:B[a.parent])==null?void 0:T.toString())??null:null}),me=async B=>{var T;if(!a.data){let K=a.options??[];if(B!=null&&B.trim()){const te=B.toLowerCase();K=K.filter(he=>{var oe,mt;const we=D(he).toLowerCase(),Oe=((mt=(oe=he.text)==null?void 0:oe.toLowerCase)==null?void 0:mt.call(oe))||"";return we.includes(te)||Oe.includes(te)})}return K}try{const K=a.host??"",te=a.prefix??"api",he=a.api??`/${te}/suggest/${a.data}`,we=`${K}${he}`,Oe=new URLSearchParams;return Oe.set("json","1"),B&&Oe.set("key",B),ee.value!==void 0&&ee.value!==null&&ee.value!==""&&Oe.set("parent",ee.value),((T=await fetch(`${we}?${Oe.toString()}`).then(oe=>oe.json()))==null?void 0:T.data)??[]}catch{return[]}},Ne=async()=>{a.data?y.value=await me(b.value):y.value=a.options?[...a.options]:[]},Ke=async B=>{var K,te,he;if(B==null)return null;const T=(K=y.value)==null?void 0:K.find(we=>{var Oe;return((Oe=we==null?void 0:we.id)==null?void 0:Oe.toString())===String(B)});if(T)return T;if(a.data)try{const we=a.host??"",Oe=a.prefix??"api",oe=a.api??`/${Oe}/suggest/${a.data}`,mt=`${we}${oe}`,Bt=new URLSearchParams;return Bt.set("json","1"),Bt.set("val",String(B)),ee.value!==void 0&&ee.value!==null&&ee.value!==""&&Bt.set("parent",ee.value),((he=((te=await fetch(`${mt}?${Bt.toString()}`).then(gl=>gl.json()))==null?void 0:te.data)??[])==null?void 0:he[0])??null}catch{return null}return null},qt=async B=>{const T=new Set(y.value.map(te=>{var he;return(he=te.id)==null?void 0:he.toString()})),K=B.filter(te=>!T.has(te==null?void 0:te.toString()));K.length&&await K.reduce(async(te,he)=>{await te;const we=await Ke(he);we&&y.value.push(we)},Promise.resolve())},Re=async()=>{o.value||(m.value=!0,await Ne(),await e.nextTick(()=>{var B;le(),(B=w.value)==null||B.focus(),A.value.length?h.value=0:h.value=-1}))},Ye=()=>{m.value=!1,h.value=-1},vt=async B=>{o.value||(m.value?Ye():await Re())},yt=async()=>{var B;m.value?(B=w.value)==null||B.focus():await Re()},Et=()=>{n.value?(_.value=[],s.value=[],r("change",[])):(p.value=null,s.value=null,r("change",null)),z(null),b.value="",e.nextTick(()=>{var B;return(B=w.value)==null?void 0:B.focus()})},Pt=B=>{n.value&&(_.value=_.value.filter(T=>(T==null?void 0:T.toString())!==(B==null?void 0:B.toString())),s.value=[..._.value],r("change",s.value),e.nextTick(()=>{var T;return(T=w.value)==null?void 0:T.focus()}))},at=B=>{n.value?(M(B.id)||(_.value=[..._.value,B.id],s.value=[..._.value],r("change",s.value)),b.value="",e.nextTick(()=>{var T;(T=w.value)==null||T.focus(),h.value=Math.min(h.value,A.value.length-1)}),z(null)):(p.value=B,s.value=B.id,r("change",s.value),b.value="",Ye(),z(B))},st=B=>{M(B.id)||at(B)},U=(B,T)=>{if(!B||!T)return;const K=B.offsetTop,te=K+B.offsetHeight,he=T.scrollTop,we=he+T.clientHeight;let Oe=T.scrollTop;K<he?Oe=K-80:te>we&&(Oe=te-T.clientHeight+4);const oe=T;oe.scrollTop=Oe},Y=B=>{let T=B.parentElement;for(;T;){if(T.classList.contains("ui-dialog__content"))return T;const K=window.getComputedStyle(T),te=K.overflow+K.overflowY+K.overflowX;if(te.includes("auto")||te.includes("scroll")||T===document.body||T===document.documentElement)return T;T=T.parentElement}return document.body},le=()=>{if(!c.value)return;const B=c.value.getBoundingClientRect(),T=window.innerHeight||document.documentElement.clientHeight,K=window.innerWidth||document.documentElement.clientWidth,te=8,he=8,we=a.maxHeight||300,Oe=T-B.bottom-he-te,oe=B.top-he-te,mt=Oe>=oe,Bt=Math.max(K-te*2,0);let{width:gl}=B;Bt>0&&gl>Bt&&(gl=Bt);let{left:ca}=B;ca+gl+te>K&&(ca=K-gl-te),ca=Math.max(ca,te);const n4=Math.min(we,Math.max(mt?Oe:oe,50));x.value=mt?"bottom":"top",k.value={position:"fixed",left:`${ca}px`,width:`${gl}px`,minWidth:"300px",maxHeight:`${n4}px`,transform:mt?"none":"translateY(-100%)",top:mt?`${B.bottom+he}px`:`${B.top-he}px`}},ae=async B=>{o.value||!m.value&&(B.key==="ArrowDown"||B.key==="ArrowUp")&&(B.preventDefault(),await Re())},de=B=>{var K;if(!m.value)return;const{key:T}=B;if(T==="ArrowDown")B.preventDefault(),h.value+1<A.value.length&&(h.value+=1,U(g.value[h.value],u.value));else if(T==="ArrowUp")B.preventDefault(),h.value>0&&(h.value-=1,U(g.value[h.value],u.value));else if(T==="Enter"){B.preventDefault();const te=A.value[h.value];te&&at(te),(K=w.value)==null||K.blur()}else T==="Escape"?(B.preventDefault(),Ye()):T==="Backspace"?n.value&&b.value===""&&_.value.length&&(_.value=_.value.slice(0,-1),s.value=[..._.value],r("change",s.value)):T==="Home"?(h.value=0,U(g.value[0],u.value)):T==="End"?(h.value=A.value.length-1,U(g.value[h.value],u.value)):T==="Tab"&&Ye()},Ae=()=>{o.value||(f.value=!0)},C=()=>{f.value=!1,b.value=""},v=B=>{B.key==="Escape"&&m.value&&Ye()},H=B=>{var K,te;const T=B.target;(K=i.value)!=null&&K.contains(T)||(te=d.value)!=null&&te.contains(T)||Ye()},re=B=>{m.value&&u.value&&!u.value.contains(B.target)&&le()},Te=()=>{m.value&&le()},Le=()=>{m.value&&le()};e.watch(()=>a.options,B=>{B!=null&&B.length&&(y.value=[...B],be())},{immediate:!0});async function be(){if(n.value)Array.isArray(s.value)?_.value=[...s.value]:(_.value=s.value==null?[]:[s.value],s.value=[..._.value]),a.data&&_.value.length&&(await qt(_.value),await e.nextTick());else{if(Array.isArray(s.value)){const B=s.value[0]??null;s.value=B??null}s.value!=null&&(p.value=await Ke(s.value)),z(p.value??null)}}e.watch(s,()=>{be()}),e.onMounted(async()=>{var B;addEventListener("keydown",v),addEventListener("scroll",re,!0),addEventListener("resize",Te),document.addEventListener("click",H,!0),c.value&&Y(c.value).addEventListener("scroll",Le,!0),(B=a.options)!=null&&B.length&&!a.data?y.value=[...a.options]:a.data&&(y.value=await me("")),await be(),Z.value=!1}),e.onUnmounted(()=>{removeEventListener("keydown",v),removeEventListener("scroll",re,!0),removeEventListener("resize",Te),document.removeEventListener("click",H,!0),c.value&&Y(c.value).removeEventListener("scroll",Le,!0)});const O=e.ref(!1),G=e.ref({}),ye=e.ref([]),Be=e.ref(null);async function E(){var K,te;if(!((K=a.add)!=null&&K.token)||Be!=null&&Be.value.validate())return;const B=a.add.api??`/api/table/${a.add.token}`,{id:T}=await fetch(B,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(G.value)}).then(he=>he.json());if(!((te=a.options)!=null&&te.length)&&a.data){const{data:he}=await fetch(`${a.api??`/api/suggest/${a.data}`}?val=${T}`).then(we=>we.json());p.value=he[0],y.value.push(he[0]),s.value=T}O.value=!1,xe({title:"Success!",message:"Object created."})}async function S(){if(!a.add)return null;const B=await fetch(`/api/template/form/${a.add.form}`).then(T=>T.json());return ye.value=B.schema,O.value=!0,null}function j(B,T=200){let K;return(...te)=>{K&&clearTimeout(K),K=window.setTimeout(()=>B(...te),T)}}const W=j(async B=>{y.value=await me(B)},200);e.watch(b,B=>{a.data&&W(B.trim())}),e.watch(()=>a.options,B=>{!a.data&&(B!=null&&B.length)&&(y.value=[...B],be())},{immediate:!0}),e.watch(()=>a.parent??a.parentValue,()=>{a.data&&Ne()});const Z=e.ref(!0);return e.watch(ee,async()=>{if(a.data&&(Z.value||(n.value?(_.value=[],s.value=[],r("change",[])):(p.value=null,s.value=null,r("change",null))),await Ne(),a.auto===1&&ee.value&&y.value.length>0)){const B=y.value[0];B&&at(B)}}),(B,T)=>{var K,te,he,we,Oe;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(Zt),{visible:O.value,"onUpdate:visible":T[1]||(T[1]=oe=>O.value=oe),title:"Додати",buttonText:"Додати",onDone:E,teleport:B.teleport},{default:e.withCtx(()=>[e.createVNode(Xe,{schema:ye.value,modelValue:G.value,"onUpdate:modelValue":T[0]||(T[0]=oe=>G.value=oe),ref_key:"addForm",ref:Be},null,8,["schema","modelValue"])]),_:1},8,["visible","teleport"]),e.createElementVNode("div",{class:"flex gap-1 w-full",ref_key:"selectRoot",ref:i,onClick:T[5]||(T[5]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:e.normalizeClass(["relative w-full font-sans",a.customClass])},[T[10]||(T[10]=e.createElementVNode("span",{id:"react-select-live-region",class:"sr-only"},null,-1)),T[11]||(T[11]=e.createElementVNode("span",{"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions text",role:"log",class:"sr-only"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["flex min-h-[38px] items-center justify-between rounded border transition-colors bg-white","border-gray-300 hover:border-gray-400",m.value||f.value?"border-blue-500 ring-1 ring-blue-500":"",o.value?"bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300":""]),role:"combobox","aria-expanded":m.value,"aria-haspopup":"listbox",onKeydown:ae,onClick:yt,"data-focus":m.value||f.value?"true":"false"},[e.createElementVNode("div",{class:"flex flex-1 items-center gap-1 py-0.5 pl-2 pr-0 overflow-hidden h-full",ref_key:"triggerRef",ref:c},[n.value?(e.openBlock(),e.createElementBlock("div",Hg,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,oe=>(e.openBlock(),e.createElementBlock("div",{class:"flex min-w-0 bg-[#e6e6e6] rounded-sm m-0.5 box-border max-w-full",key:oe.id},[e.createElementVNode("div",qg,[oe!=null&&oe.color?(e.openBlock(),e.createElementBlock("span",{key:0,class:"w-[16px] h-[16px] rounded-md block ml-1.5 flex-shrink-0",style:e.normalizeStyle({backgroundColor:oe==null?void 0:oe.color})},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"truncate text-gray-900 overflow-hidden max-w-[200px] px-0.5 py-[2px] pl-1.5",title:D(oe)},[I.value?(e.openBlock(),e.createElementBlock("span",{key:0,innerHTML:F(oe)},null,8,Wg)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(oe.text),1)],64))],8,Gg)]),e.createElementVNode("div",{role:"button",class:"flex items-center rounded-sm px-1 box-border hover:bg-[#ffbdad] hover:text-[#de350b] flex-shrink-0",onClick:e.withModifiers(mt=>Pt(oe.id),["stop"])},T[6]||(T[6]=[e.createElementVNode("svg",{height:"14",width:"14",viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",class:"inline-block fill-current stroke-current leading-none stroke-0"},[e.createElementVNode("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"})],-1)]),8,Kg)]))),128)),e.createElementVNode("div",Yg,[!o.value&&B.search?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,ref_key:"inputRef",ref:w,class:"w-full bg-transparent outline-none border-0 m-0 p-0 text-gray-900",autocapitalize:"none",autocomplete:"off",autocorrect:"off",spellcheck:"false",type:"text",tabindex:"0","aria-autocomplete":"list",placeholder:_.value.length?" ":V.value,"onUpdate:modelValue":T[2]||(T[2]=oe=>b.value=oe),onFocus:Ae,onBlur:C,onKeydown:de},null,40,Xg)),[[e.vModelText,b.value]]):e.createCommentVNode("",!0)])])):!n.value&&!f.value&&P.value&&b.value===""?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["truncate text-gray-900"]),title:P.value},[(K=p.value)!=null&&K.color?(e.openBlock(),e.createElementBlock("span",{key:0,class:"w-[14px] h-[14px] rounded-md block mr-1 mt-1 absolute",style:e.normalizeStyle({backgroundColor:(te=p.value)==null?void 0:te.color})},null,4)):e.createCommentVNode("",!0),I.value?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass({"pl-5":(he=p.value)==null?void 0:he.color}),innerHTML:F(p.value)},null,10,Qg)):(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass({"pl-5":(we=p.value)==null?void 0:we.color})},e.toDisplayString((Oe=p.value)==null?void 0:Oe.text),3))],8,Zg)):e.createCommentVNode("",!0),n.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Jg,[!o.value&&B.search?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,ref_key:"inputRef",ref:w,class:"w-full bg-transparent outline-none border-0 m-0 p-0 text-gray-900",autocapitalize:"none",autocomplete:"off",autocorrect:"off",spellcheck:"false",type:"text",tabindex:"0","aria-autocomplete":"list",placeholder:P.value?" ":V.value,"onUpdate:modelValue":T[3]||(T[3]=oe=>b.value=oe),onFocus:Ae,onBlur:C,onKeydown:de},null,40,eb)),[[e.vModelText,b.value]]):e.createCommentVNode("",!0)]))],512),e.createElementVNode("div",tb,[$.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50","aria-hidden":"true",disabled:o.value,onClick:e.withModifiers(Et,["stop"])},T[7]||(T[7]=[e.createElementVNode("svg",{height:"20",width:"20",viewBox:"0 0 20 20",class:"fill-current"},[e.createElementVNode("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"})],-1)]),8,lb)):e.createCommentVNode("",!0),T[9]||(T[9]=e.createElementVNode("div",{class:"self-stretch w-px bg-[#ccc] my-[1px]"},null,-1)),e.createElementVNode("button",{type:"button",class:"px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50","aria-hidden":"true",disabled:o.value,onClick:T[4]||(T[4]=e.withModifiers(oe=>vt(),["stop"])),title:m.value?"Закрити список":"Відкрити список"},T[8]||(T[8]=[e.createElementVNode("svg",{height:"20",width:"20",viewBox:"0 0 20 20",class:"fill-current"},[e.createElementVNode("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"})],-1)]),8,ab)])],42,zg),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[m.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"dropdownRef",ref:d,class:e.normalizeClass(["fixed z-[3000] rounded bg-white shadow-[0_0_0_1px_rgba(0,0,0,0.1),0_4px_11px_rgba(0,0,0,0.1)]"]),style:e.normalizeStyle(k.value),role:"listbox"},[e.createElementVNode("div",{class:"overflow-y-auto py-1",style:e.normalizeStyle({maxHeight:k.value.maxHeight||"300px"}),ref_key:"listRef",ref:u},[A.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(A.value,(oe,mt)=>(e.openBlock(),e.createElementBlock("div",{key:oe.id,ref_for:!0,ref:Bt=>g.value[mt]=Bt,class:e.normalizeClass(["flex px-3 py-2 cursor-default select-none text-gray-900 ",M(oe.id)?"bg-blue-500 text-white":"bg-white hover:bg-blue-100",h.value===mt&&!M(oe.id)?"bg-blue-100":""]),"aria-disabled":M(oe.id)?"true":"false",role:"option",tabindex:"-1",onClick:Bt=>st(oe)},[oe!=null&&oe.color?(e.openBlock(),e.createElementBlock("span",{key:0,class:"w-[11px] h-[11px] rounded-full block mr-1 mt-1.5",style:e.normalizeStyle({backgroundColor:oe==null?void 0:oe.color})},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["leading-[19px]",h.value===oe.id?"text-white":"",(h.value,"")])},[I.value?(e.openBlock(),e.createElementBlock("span",{key:0,innerHTML:F(oe)},null,8,nb)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(oe.text),1)],64))],2)],10,rb))),128)):(e.openBlock(),e.createElementBlock("div",ob," No options "))],4)],4)):e.createCommentVNode("",!0)]))],2),a.add?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:S,class:"bg-white hover:bg-gray-100 text-sm text-gray-900 py-[10px] px-3 border border-stone-200 rounded-md h-[38px] flex items-center gap-2",disabled:o.value,type:"button"},[e.createVNode(Gl,{width:"16",height:"16"}),T[12]||(T[12]=e.createElementVNode("span",null,"Додати",-1))],8,sb)):e.createCommentVNode("",!0)],512)],64)}}}),ib=["placeholder","disabled"],cb=e.defineComponent({__name:"vs-input-textarea",props:e.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,{inputClass:a}=ft(t.style),r=e.useModel(l,"modelValue"),n=e.computed(()=>!!t.disabled),o=e.computed(()=>t.placeholder??"");return(s,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{"onUpdate:modelValue":i[0]||(i[0]=c=>r.value=c),placeholder:o.value,disabled:n.value,row:"2",class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] h-auto bg-white",[e.unref(a)]]),style:{border:"1px solid #CFD9E0"}},null,10,ib)),[[e.vModelText,r.value]])}}),db={},ub={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-search stroke-gray-500 transition-all"};function mb(l,t){return e.openBlock(),e.createElementBlock("svg",ub,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"},null,-1),e.createElementVNode("path",{d:"M21 21l-6 -6"},null,-1)]))}const pb=_e(db,[["render",mb]]),fb={},hb={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 gb(l,t){return e.openBlock(),e.createElementBlock("svg",hb,t[0]||(t[0]=[e.createElementVNode("path",{d:"m3 16 4 4 4-4"},null,-1),e.createElementVNode("path",{d:"M7 20V4"},null,-1),e.createElementVNode("path",{d:"m21 8-4-4-4 4"},null,-1),e.createElementVNode("path",{d:"M17 4v16"},null,-1)]))}const bb=_e(fb,[["render",gb]]),yb={},kb={xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function xb(l,t){return e.openBlock(),e.createElementBlock("svg",kb,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),e.createElementVNode("path",{d:"M7 9l5 -5l5 5"},null,-1),e.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const wb=_e(yb,[["render",xb]]),_b={},Eb={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 Cb(l,t){return e.openBlock(),e.createElementBlock("svg",Eb,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),e.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),e.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const Vb=_e(_b,[["render",Cb]]),Nb={},vb={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 Bb(l,t){return e.openBlock(),e.createElementBlock("svg",vb,t[0]||(t[0]=[e.createStaticVNode('<circle cx="9" cy="12" r="1"></circle><circle cx="9" cy="5" r="1"></circle><circle cx="9" cy="19" r="1"></circle><circle cx="15" cy="12" r="1"></circle><circle cx="15" cy="5" r="1"></circle><circle cx="15" cy="19" r="1"></circle>',6)]))}const os=_e(Nb,[["render",Bb]]),Sb={},Db={viewBox:"0 0 178 90",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Ab(l,t){return e.openBlock(),e.createElementBlock("svg",Db,t[0]||(t[0]=[e.createStaticVNode('<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>',12)]))}const Mb=_e(Sb,[["render",Ab]]),Tb={},Lb={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 $b(l,t){return e.openBlock(),e.createElementBlock("svg",Lb,t[0]||(t[0]=[e.createElementVNode("path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"},null,-1)]))}const Fb=_e(Tb,[["render",$b]]),Ib={class:"vs-datatable border rounded-xl w-full flex-grow"},Ob={class:"flex items-center npm gap-[16px] justify-between p-[20px] pb-[16px]"},Pb={class:"relative w-full"},Rb={class:"table-wrapper flex gap-2"},Ub={class:"vs-popover inline-block text-slate-700"},jb={class:"text-center"},zb={class:""},Hb={class:"py-1 px-0 w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg focus:outline-none focus:bg-stone-100 dark:bg-neutral-900 dark:text-neutral-200 dark:focus:bg-neutral-800 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full"},qb={class:"flex flex-col p-[1px] gap-[2px] w-[140px]"},Gb={class:"text-sm items-center text-gray-800 flex gap-1"},Wb={class:"w-full overflow-x-auto"},Kb={class:"w-full table-auto caption-bottom text-sm"},Yb={class:"[&_tr]:border-b"},Xb={class:"border-b data-[state=selected]:bg-muted bg-slate-50/50 dark:bg-slate-700/50 hover:bg-slate-50/80 dark:hover:bg-slate-700/80 transition-colors"},Zb={class:"h-10 px-2 align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] w-12 text-center"},Qb={key:0,colspan:"100%",class:"text-center"},Jb={class:"w-full"},ey={class:"p-5 min-h-[200px] flex flex-col justify-center items-center text-center"},ty=["onDragstart","onDragover","onDrop"],ly={class:"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] text-center"},ay={class:"flex items-center justify-center"},ry={key:0,class:"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-slate-100 dark:bg-slate-700 text-slate-700 dark:text-slate-300 hover:bg-slate-200 dark:hover:bg-slate-600 transition-colors"},ny={key:0},oy=["src"],sy={key:1,class:"rounded-md max-w-[45px] w-[45px] max-h-[45px] h-[45px] bg-gray-200 flex items-center justify-center"},iy=["innerHTML"],cy={key:2,class:"line-clamp-2 rounded-md border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-slate-100 dark:bg-slate-700 text-slate-700 dark:text-slate-300 hover:bg-slate-200 dark:hover:bg-slate-600 transition-colors"},dy={key:3,class:"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-slate-100 dark:bg-slate-700 text-slate-700 dark:text-slate-300 hover:bg-slate-200 dark:hover:bg-slate-600 transition-colors"},uy={class:"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]"},my={class:"flex items-center justify-center gap-2"},py=["onClick"],fy=["onClick"],hy={class:"vs-form__head mr-5 mt-3 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white"},gy=e.defineComponent({__name:"vs-input-datatable",props:e.mergeModels({colModel:{},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,a=e.useModel(l,"modelValue"),r=e.ref({}),n=e.ref(""),o=e.computed(()=>{if(!n.value)return a.value??[];const I=n.value.toLowerCase();return a.value.filter(F=>{var D;return(D=t.colModel)==null?void 0:D.some(z=>{const ee=F[z.key];return ee?Array.isArray(ee)?ee.join(", ").toLowerCase().includes(I):String(ee).toLowerCase().includes(I):!1})})}),s=e.ref(null),i=e.ref(null),c=e.ref(!1),u=e.ref(null),d=e.ref({top:0,left:0}),m=I=>{s.value=I},f=I=>{i.value=I},p=I=>{if(s.value===null||s.value===I){s.value=null,i.value=null;return}const F=[...a.value],[D]=F.splice(s.value,1);F.splice(I,0,D),a.value=F,s.value=null,i.value=null},y=I=>{const F=I.currentTarget.getBoundingClientRect();d.value={top:F.bottom+window.scrollY,left:F.left+window.scrollX},c.value=!c.value},h=()=>{u.value&&u.value.click()},g=I=>{const F=[".jpg",".jpeg",".png",".gif",".bmp",".webp",".svg",".ico",".tiff",".tif"],D=I.toLowerCase();return F.some(z=>D.endsWith(z))},b=I=>{var z;const F=(z=I.target.files)==null?void 0:z[0];if(!F)return;const D=new FileReader;D.onload=ee=>{var me;try{const Ne=(me=ee.target)==null?void 0:me.result;if(typeof Ne=="string"){const Ke=JSON.parse(Ne);Array.isArray(Ke)&&a.value.push(...Ke)}}catch(Ne){console.error("Error parsing file:",Ne)}},D.readAsText(F)},w=()=>{const I=JSON.stringify(a.value,null,2),F=new Blob([I],{type:"application/json"}),D=URL.createObjectURL(F),z=document.createElement("a");z.href=D,z.download="data.json",z.click(),URL.revokeObjectURL(D)};e.onMounted(async()=>{var F;const I=(F=t.colModel)==null?void 0:F.filter(D=>D.data);I!=null&&I.length&&Promise.all(I.map(async D=>{const z=await(await fetch(`/api/suggest/${D.data}`)).json();r.value[D.key]=z.data}))});const x=e.ref(""),k=e.ref(!1);let _="edit",N=0;const V=e.ref({}),P=e.ref({});async function $(){x.value="Додати",k.value=!0,_="add",V.value={}}function M(I,F){var z;const D=F.key||F.name;return r.value[D]&&I[D]?((z=r.value[D].find(ee=>ee.id.toString()===I[D].toString()))==null?void 0:z.text)??I[D]:I[D]||"-"}async function A(I,F){x.value="Редагувати",k.value=!0,_="edit",N=F,V.value={...I}}function q(){const I=P.value.validate();if(I){xe({type:"warning",title:"Помилка валідації",message:Object.entries(I).map(([F,D])=>`${F}: ${D}`).join(`
228
228
  `)});return}_==="add"?Array.isArray(a.value)?a.value=[...a.value,V.value]:a.value=[V.value]:a.value=a.value.map((F,D)=>D===N?V.value:F),k.value=!1}function Q(I){a.value=a.value.filter((F,D)=>D!==I)}function R(){k.value=!1}return(I,F)=>(e.openBlock(),e.createElementBlock("div",Ib,[e.createElementVNode("div",Ob,[e.createElementVNode("div",Pb,[e.createVNode(pb,{width:"14",height:"14",class:"absolute left-3 top-1/2 transform -translate-y-1/2 text-stone-500"}),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":F[0]||(F[0]=D=>n.value=D),placeholder:"Пошук",class:"py-2 px-3 pl-10 w-full bg-gray-100 h-[36px] rounded-[8px] text-[15px] leading-[18px] focus:border-1 text-stone-800 placeholder:text-[#6B7280] focus:outline-blue-500 focus:outline-2"},null,512),[[e.vModelText,n.value]])]),e.createElementVNode("div",Rb,[e.createElementVNode("input",{ref_key:"fileInput",ref:u,onChange:b,class:"hidden",accept:".json",type:"file"},null,544),e.createElementVNode("div",Ub,[e.createElementVNode("div",jb,[e.createElementVNode("div",zb,[e.createElementVNode("button",{onClick:y,class:"bg-white hover:bg-gray-100 font-semibold text-[15px] leadig-[18.5px] py-[10px] px-[12px] border border-[#E5E7EB] rounded-[8px] h-[38px] max-h-[38px] gap-[8px] flex items-center"},[e.createVNode(bb,{height:"16",width:"16"})])])])])]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[c.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"text-slate-700 vsTailwind vs-popover__content bottom",style:e.normalizeStyle([{width:"fit-content","z-index":"10002",position:"fixed"},{position:"absolute",top:d.value.top+"px",left:d.value.left+"px"}])},[e.createElementVNode("div",Hb,[e.createElementVNode("div",qb,[e.createElementVNode("button",{onClick:h,class:"text-slate-700 flex items-center gap-1 px-3 py-2 rounded-md cursor-pointer group hover:bg-gray-100"},[e.createVNode(wb,{class:"text-black",width:"14",height:"14"}),F[4]||(F[4]=e.createTextVNode(" Імпортувати ",-1))]),e.createElementVNode("button",{onClick:w,class:"text-slate-700 flex items-center px-3 py-2 rounded-md cursor-pointer group hover:bg-gray-100"},[e.createElementVNode("span",Gb,[e.createVNode(Vb,{class:"text-black",width:"14",height:"14"}),F[5]||(F[5]=e.createTextVNode(" Експортувати ",-1))])])])])],4)):e.createCommentVNode("",!0)])),e.createElementVNode("button",{onClick:$,class:"text-slate-700 bg-white hover:bg-gray-100 font-semibold text-[15px] leadig-[18.5px] py-[10px] px-[12px] border border-[#E5E7EB] rounded-[8px] h-[38px] max-h-[38px] gap-[8px] flex items-center"},[e.createVNode(Gl),F[6]||(F[6]=e.createTextVNode(" Додати ",-1))])]),e.createElementVNode("div",Wb,[e.createElementVNode("table",Kb,[e.createElementVNode("thead",Yb,[e.createElementVNode("tr",Xb,[e.createElementVNode("th",Zb,[e.createVNode(os,{width:"24",height:"24",class:"w-4 h-4 mx-auto text-slate-400 dark:text-slate-500"})]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.colModel,D=>(e.openBlock(),e.createElementBlock("th",{key:D.key,class:"h-10 px-2 text-left align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] font-semibold text-slate-700 dark:text-slate-300 min-w-[150px]"},e.toDisplayString(D.ua||D.label),1))),128)),F[7]||(F[7]=e.createElementVNode("th",{class:"h-10 px-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] font-semibold text-slate-700 dark:text-slate-300 text-center"}," Дії ",-1))])]),e.createElementVNode("tbody",{class:e.normalizeClass({"[&_tr:last-child]:border-0":!i.value})},[o.value.length===0?(e.openBlock(),e.createElementBlock("td",Qb,[e.createElementVNode("div",Jb,[e.createElementVNode("div",ey,[e.createVNode(Mb,{class:"w-48 mx-auto"}),F[8]||(F[8]=e.createElementVNode("div",{class:"max-w-sm mx-auto mt-6"},[e.createElementVNode("p",{class:"font-medium text-gray-800 dark:text-neutral-200"},"Нічого не знайдено"),e.createElementVNode("p",{class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"})],-1))])])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(D,z)=>(e.openBlock(),e.createElementBlock("tr",{key:D.id,class:e.normalizeClass(["border-b data-[state=selected]:bg-muted transition-all duration-200 hover:bg-slate-50/60 dark:hover:bg-slate-700/60 cursor-move",{"opacity-50":s.value===z,"border-t-2 border-b-2 border-blue-500 bg-blue-50 dark:bg-blue-900/20":i.value===z}]),draggable:"true",onDragstart:ee=>m(z),onDragover:e.withModifiers(ee=>f(z),["prevent"]),onDrop:ee=>p(z)},[e.createElementVNode("td",ly,[e.createElementVNode("div",ay,[e.createVNode(os,{width:"24",height:"24",class:"w-4 h-4 mx-auto text-slate-400 dark:text-slate-500"})])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.colModel,ee=>(e.openBlock(),e.createElementBlock("td",{key:ee.key,class:"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]"},[ee.type==="file"?(e.openBlock(),e.createElementBlock("div",ry,[g(M(D,ee))?(e.openBlock(),e.createElementBlock("div",ny,[e.createElementVNode("img",{src:M(D,ee),alt:"alt",width:"45",class:"rounded-md max-w-[45px] h-[45px] object-cover"},null,8,oy)])):(e.openBlock(),e.createElementBlock("div",sy,[e.createVNode(ls,{class:"w-[25px] min-w-[25px] h-[25px]"})]))])):ee.type==="tiptap-editor"?(e.openBlock(),e.createElementBlock("div",{key:1,class:"rounded-md border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-slate-100 dark:bg-slate-700 text-slate-700 dark:text-slate-300 hover:bg-slate-200 dark:hover:bg-slate-600 transition-colors line-clamp-3",innerHTML:M(D,ee)},null,8,iy)):ee.type==="reference"?(e.openBlock(),e.createElementBlock("div",cy,e.toDisplayString(M(D,ee)),1)):(e.openBlock(),e.createElementBlock("div",dy,e.toDisplayString(M(D,ee)),1))]))),128)),e.createElementVNode("td",uy,[e.createElementVNode("div",my,[e.createElementVNode("button",{onClick:ee=>A(D,z),class:"text-slate-700 inline-flex items-center justify-center whitespace-nowrap font-medium focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 border rounded-md text-xs h-7 w-7 p-0 border-slate-300 dark:border-slate-600 bg-white dark:bg-slate-700 hover:bg-blue-50 dark:hover:bg-slate-600 hover:border-blue-300 dark:hover:border-slate-500 hover:text-blue-600 dark:hover:text-slate-200 transition-all duration-200 shadow-sm"},[e.createVNode(Fb,{width:"24",height:"24",class:"w-3 h-3"})],8,py),e.createElementVNode("button",{onClick:ee=>Q(z),class:"text-slate-700 inline-flex items-center justify-center whitespace-nowrap font-medium focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 border rounded-md text-xs h-7 w-7 p-0 border-slate-300 dark:border-slate-600 bg-white dark:bg-slate-700 hover:bg-red-50 dark:hover:bg-slate-600 hover:border-red-300 dark:hover:border-slate-500 hover:text-red-600 dark:hover:text-slate-200 transition-all duration-200 shadow-sm"},[e.createVNode(va,{width:"24",height:"24",class:"w-3 h-3"})],8,fy)])])],42,ty))),128))],2)])]),e.createVNode(e.unref(Zt),{teleport:"#modal",visible:k.value,title:x.value,size:"lg",onClose:R},{default:e.withCtx(()=>[e.createVNode(Xe,{schema:t.colModel,values:V.value,"onUpdate:values":F[1]||(F[1]=D=>V.value=D),form:P.value,"onUpdate:form":F[2]||(F[2]=D=>P.value=D)},null,8,["schema","values","form"]),e.createElementVNode("div",hy,[e.createElementVNode("button",{type:"button",onClick:F[3]||(F[3]=D=>k.value=!1),class:"vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-red-500 hover:border-red-500 hover:bg-red-500 focus:ring-red-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 mr-2"}," Скасувати "),e.createElementVNode("button",{onClick:q,type:"button",class:"vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border-1 border-transparent text-white bg-blue-500 hover:bg-blue-600 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1"}," Зберегти ")])]),_:1},8,["visible","title"])]))}}),by={draw:{toolbar:{actions:{title:"Скасувати малювання",text:"Скасувати"},finish:{title:"Завершити малювання",text:"Завершити"},undo:{title:"Видалити останню точку",text:"Видалити останню"},buttons:{polyline:"Намалювати лінію",polygon:"Намалювати полігон",rectangle:"Намалювати прямокутник",circle:"Намалювати коло",marker:"Додати точку",circlemarker:"Додати маркер-коло"}},handlers:{circle:{tooltip:{start:"Клацніть і тягніть, щоб намалювати коло",end:"Відпустіть кнопку миші, щоб завершити"},radius:"Радіус"},circlemarker:{tooltip:{start:"Клацніть на карту, щоб додати маркер-коло"}},marker:{tooltip:{start:"Клацніть на карту, щоб додати точку"}},polygon:{tooltip:{start:"Клацніть, щоб почати малювати полігон",cont:"Клацайте, щоб продовжити малювати полігон",end:"Клацніть першу точку, щоб завершити полігон"}},polyline:{error:"<strong>Помилка:</strong> лінія не може перетинатися сама з собою",tooltip:{start:"Клацніть, щоб почати малювати лінію",cont:"Клацайте, щоб продовжити малювати лінію",end:"Клацніть останню точку, щоб завершити лінію"}},rectangle:{tooltip:{start:"Клацніть і тягніть, щоб намалювати прямокутник",end:"Відпустіть кнопку миші, щоб завершити"}},simpleshape:{tooltip:{end:"Відпустіть кнопку миші, щоб завершити"}}}},edit:{toolbar:{actions:{save:{title:"Зберегти зміни",text:"Зберегти"},cancel:{title:"Скасувати редагування",text:"Скасувати"},clearAll:{title:"Очистити всі шари",text:"Очистити все"}},buttons:{edit:"Редагувати шари",editDisabled:"Немає шарів для редагування",remove:"Видалити шари",removeDisabled:"Немає шарів для видалення"}},handlers:{edit:{tooltip:{text:"Перетягніть маркери, щоб редагувати шари",subtext:"Натисніть 'Скасувати', щоб повернутися"}},remove:{tooltip:{text:"Клацніть на шари, щоб видалити їх"}}}}};function Wl(l){return l?l.type==="Polygon"?{type:"MultiPolygon",coordinates:[l.coordinates]}:l.type==="Feature"?{...l,geometry:Wl(l.geometry)}:l.type==="FeatureCollection"?{...l,features:(l.features||[]).map(t=>Wl(t)).filter(Boolean)}:l:null}function yy(l){return l?l.type==="FeatureCollection"||l.type==="Feature"?Wl(l):l.geom?{type:"Feature",geometry:Wl({type:l.geom.type,coordinates:l.geom.coordinates}),properties:{}}:l.type&&l.coordinates?{type:"Feature",geometry:Wl(l),properties:{}}:null:null}const ky={},xy={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",stroke:"currentColor",fill:"none","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-map-pin"};function wy(l,t){return e.openBlock(),e.createElementBlock("svg",xy,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M9 11a3 3 0 1 0 6 0a3 3 0 0 0 -6 0"},null,-1),e.createElementVNode("path",{d:"M17.657 16.657l-4.243 4.243a2 2 0 0 1 -2.827 0l-4.244 -4.243a8 8 0 1 1 11.314 0z"},null,-1)]))}const _y=_e(ky,[["render",wy]]),Ey={},Cy={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none","stroke-width":"2",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-line"};function Vy(l,t){return e.openBlock(),e.createElementBlock("svg",Cy,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M6 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},null,-1),e.createElementVNode("path",{d:"M18 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},null,-1),e.createElementVNode("path",{d:"M7.5 16.5l9 -9"},null,-1)]))}const Ny=_e(Ey,[["render",Vy]]),vy={},By={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-polygon"};function Sy(l,t){return e.openBlock(),e.createElementBlock("svg",By,t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M12 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M19 8m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M5 11m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M15 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M6.5 9.5l3.5 -3"></path><path d="M14 5.5l3 1.5"></path><path d="M18.5 10l-2.5 7"></path><path d="M13.5 17.5l-7 -5"></path>',9)]))}const Dy=_e(vy,[["render",Sy]]),Ay={},My={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-topology-ring-3"};function Ty(l,t){return e.openBlock(),e.createElementBlock("svg",My,t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M8 18a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M20 18a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M20 6a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M8 6a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M6 8v8"></path><path d="M18 16v-8"></path><path d="M8 6h8"></path><path d="M16 18h-8"></path>',9)]))}const Ly=_e(Ay,[["render",Ty]]),$y={},Fy={version:"1.1",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg","xmlns:sketch":"http://www.bohemiancoding.com/sketch/ns","xmlns:xlink":"http://www.w3.org/1999/xlink",class:"fullscreen-icon"};function Iy(l,t){return e.openBlock(),e.createElementBlock("svg",Fy,t[0]||(t[0]=[e.createElementVNode("title",null,null,-1),e.createElementVNode("desc",null,null,-1),e.createElementVNode("defs",null,null,-1),e.createElementVNode("g",{fill:"none","fill-rule":"evenodd",id:"Page-1",stroke:"none","stroke-width":"1"},[e.createElementVNode("g",{fill:"#000000",id:"Core",transform:"translate(-215.000000, -257.000000)"},[e.createElementVNode("g",{id:"fullscreen",transform:"translate(215.000000, 257.000000)"},[e.createElementVNode("path",{d:"M2,9 L0,9 L0,14 L5,14 L5,12 L2,12 L2,9 L2,9 Z M0,5 L2,5 L2,2 L5,2 L5,0 L0,0 L0,5 L0,5 Z M12,12 L9,12 L9,14 L14,14 L14,9 L12,9 L12,12 L12,12 Z M9,0 L9,2 L12,2 L12,5 L14,5 L14,0 L9,0 L9,0 Z",id:"Shape"})])])],-1)]))}const Oy=_e($y,[["render",Iy]]),Py={class:"map-search-widget flex flex-col gap-2 rounded-xl widget min-w-[200px]"},Ry={key:0,class:"vs-select__options absolute z-50 mt-1 w-full bg-white border border-gray-300 shadow-lg rounded-lg text-sm"},Uy=["onClick"],jy={class:"relative flex-1 min-w-[140px]"},zy=["placeholder"],Hy="https://data.softpro.ua/api-user/gis-url-proxy",qy="https://geo.rv.ua/api-user/dzk.api",Gy=e.defineComponent({__name:"map-search",props:{config:{}},emits:["goToCoordinates"],setup(l,{emit:t}){const a=l,r=t,n=["here","xy","parcel"],o=e.computed(()=>{var _,N;const k=(N=(_=a.config)==null?void 0:_.tools)==null?void 0:N.filter(V=>n.includes(V));return k&&k.length?k:n}),s=e.computed(()=>{var k,_;return((_=(k=a.config)==null?void 0:k.placeholder)==null?void 0:_.trim())||"Пошук…"}),i=e.ref(o.value[0]??n[0]);e.watch(o,k=>{k.includes(i.value)||(i.value=k[0])});const c=e.ref(""),u=e.ref(!1),d=e.ref(null);e.watch(i,()=>{c.value="",u.value=!1});function m(k){i.value=k}function f(k){if(!u.value)return;const _=d.value;_&&!_.contains(k.target)&&(u.value=!1)}e.onMounted(()=>{window.addEventListener("click",f,!0)}),e.onBeforeUnmount(()=>{window.removeEventListener("click",f,!0)});function p(k){return k==="xy"?"Координати":k==="parcel"?"Кадастр":"Адреси"}function y(k){const _=k.replace(/[,]+/g," ").trim();if(!_)return null;const N=_.split(/\s+/).filter(Boolean);if(N.length<2)return null;const V=N.slice(0,2).map(Number);if(!V.every(R=>Number.isFinite(R)))return null;let[P,$]=V,M=P,A=$;const q=R=>Math.abs(R)<=90,Q=R=>Math.abs(R)<=180;if(!q(M)||!Q(A))if(q(A)&&Q(M))M=$,A=P;else return null;return{lat:M,lng:A}}function h(k){return((k==null?void 0:k.items)||[]).map((_,N)=>{var V,P,$;return{id:String((_==null?void 0:_.id)??N),title:(_==null?void 0:_.title)||((V=_==null?void 0:_.address)==null?void 0:V.label)||"Знайдений обʼєкт",lat:Number((P=_==null?void 0:_.position)==null?void 0:P.lat),lng:Number(($=_==null?void 0:_.position)==null?void 0:$.lng)}}).filter(_=>Number.isFinite(_.lat)&&Number.isFinite(_.lng))}function g(k){const _=(k==null?void 0:k.result)||(k==null?void 0:k.data)||k;if(!_)return[];const N=_.geom_centroid;if(!N||!Array.isArray(N.coordinates))return[];const[V,P]=N.coordinates;return!Number.isFinite(P)||!Number.isFinite(V)?[]:[{id:"parcel",title:_.cadnum||_.cad_num||"Земельна ділянка",lat:P,lng:V}]}function b(k){const _=k.replace(/\s+/g,"").split(":");if(_.length!==4)return!1;const N=[10,2,3,4];return _.every((V,P)=>V.length===N[P]&&/^\d+$/.test(V))}function w(k){r("goToCoordinates",[k.lat,k.lng])}async function x(){const k=c.value.trim();if(k){if(i.value==="xy"){const _=y(k);if(!_){xe({type:"warning",title:"Пошук координат",message:"Не знайдено або невірний формат координат"});return}w(_),c.value="";return}try{const _=new URL(i.value==="here"?Hy:qy);if(i.value==="here")_.searchParams.set("searchtext",k);else{if(!b(k)){xe({type:"warning",title:"Пошук кадастру",message:"Кадастровий номер має формат ХХХХХХХХХХ:ХХ:ХХХ:ХХХХ"});return}_.searchParams.set("cad_num",k)}const N=await fetch(_.toString());if(!N.ok)throw new Error(`HTTP ${N.status}`);const V=await N.json(),P=i.value==="here"?h(V):g(V);if(!P.length)xe({type:"warning",title:"Пошук",message:"Не знайдено результатів"});else{const $=P[0];w($),c.value=""}}catch(_){const N=(_==null?void 0:_.message)||"Помилка пошуку";xe({type:"error",title:"Пошук",message:N})}}}return(k,_)=>(e.openBlock(),e.createElementBlock("div",Py,[e.createElementVNode("form",{class:"flex gap-2",onSubmit:e.withModifiers(x,["prevent"])},[o.value.length>1?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"dropdownRef",ref:d,class:"relative search-type w-[140px]"},[e.createElementVNode("button",{type:"button",class:"vstSelect-input transition-all text-left bg-white border border-gray-200 text-gray-900 rounded-lg focus:ring-blue-500 focus:border-blue-100 block w-full py-1.5 px-3 text-sm cursor-pointer flex items-center justify-between gap-2",onClick:_[0]||(_[0]=N=>u.value=!u.value)},[e.createElementVNode("span",null,e.toDisplayString(p(i.value)),1),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["w-4 h-4 text-gray-500 transition-transform",{"rotate-180":u.value}]),viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_[2]||(_[2]=[e.createElementVNode("path",{d:"M6 9l6 6 6-6",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]),2))]),u.value?(e.openBlock(),e.createElementBlock("div",Ry,[e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,N=>(e.openBlock(),e.createElementBlock("li",{key:N,class:"px-3 py-2 cursor-pointer hover:bg-gray-100",onClick:V=>m(N)},e.toDisplayString(p(N)),9,Uy))),128))])])):e.createCommentVNode("",!0)],512)):e.createCommentVNode("",!0),e.createElementVNode("div",jy,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":_[1]||(_[1]=N=>c.value=N),placeholder:s.value,type:"text",class:"vs-input transition-all border block w-full border-gray-200 rounded-md focus:border-blue-100 border-solid !pr-8 py-1.5 pl-3 text-sm"},null,8,zy),[[e.vModelText,c.value,void 0,{trim:!0}]]),_[3]||(_[3]=e.createElementVNode("button",{type:"submit",class:"absolute inset-y-0 right-2 flex items-center text-gray-400 hover:text-gray-600","aria-label":"Пошук"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m21 21-4.35-4.35m0 0A7.5 7.5 0 1 0 5 5a7.5 7.5 0 0 0 11.65 11.65Z"})])],-1))])],32)]))}}),Wy=_e(Gy,[["__scopeId","data-v-3048520a"]]),Ky={class:"bg-white/30 p-1 rounded-md shadow"},Yy={class:"flex gap-2"},Xy=["onClick","title"],Zy=["src"],Qy=e.defineComponent({__name:"map-layers",props:{basemaps:{}},emits:["onLayerChange"],setup(l,{emit:t}){const a=e.ref(Object.keys(l.basemaps)[0]),r=t;function n(o){r("onLayerChange",o),a.value=o}return(o,s)=>(e.openBlock(),e.createElementBlock("div",Ky,[e.createElementVNode("div",Yy,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.basemaps,(i,c)=>(e.openBlock(),e.createElementBlock("div",{key:c,class:e.normalizeClass(["cursor-pointer border rounded-lg overflow-hidden hover:shadow-sm",{"ring-2 ring-blue-500 border-blue-300":a.value===c}]),onClick:u=>n(c),title:i.name||c,role:"button",tabindex:"0"},[e.createElementVNode("img",{src:i.preview,alt:"",class:"w-10 h-10 object-cover"},null,8,Zy)],10,Xy))),128))])]))}}),Jy={key:0,class:"absolute inset-0 z-[2000] flex items-center justify-center pointer-events-none bg-black/20"},e1={class:"bg-black/50 text-white px-6 py-2 rounded-lg text-center max-w-sm mx-4 backdrop-blur-sm"},t1={class:"text-sm font-medium"},l1={key:0,class:"absolute top-4 left-4 z-[1000] w-[calc(100%-20px)] sm:w-[350px]"},a1={key:1,class:"form-geom__panel flex gap-1 items-start mt-2"},r1={class:"flex items-center gap-1"},n1=["disabled"],o1=["disabled"],s1=["disabled"],i1={class:"absolute top-4 right-4 z-[1000]"},c1={class:"flex flex-col gap-[2px]"},d1=["disabled"],u1=["disabled"],m1=["disabled"],p1=["disabled"],f1={class:"flex flex-col gap-2"},h1={key:0,class:"bg-white/95 border border-gray-200 rounded-md shadow-sm px-3 py-2 text-xs text-gray-700 min-w-[200px]"},g1={class:"flex flex-col gap-1"},b1=["checked","disabled","onChange"],y1={class:"text-gray-700 text-xs font-medium"},k1={class:"absolute bottom-0 left-0 right-0 z-[1000] bg-white/95 border-t border-gray-200 text-xs text-gray-700 flex items-center gap-4 pt-1"},x1={key:0,class:"form-geom__feature flex items-center text-xs transition-all gap-2 w-full"},w1={class:"shrink-0"},_1={class:"font-bold"},E1={class:"flex items-center"},C1={class:"text-xs mr-2"},V1={key:0,class:"text-xs"},N1={key:1,class:"text-xs"},v1=["disabled"],B1=["disabled"],S1=e.defineComponent({__name:"vs-input-map",props:{tools:{},handleZoom:{type:Boolean,default:!0},geomType:{default:()=>[]},prefix:{default:""},layers:{default:()=>[]},api:{},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},emits:["update:modelValue"],setup(l,{emit:t}){var Be;const a=e.getCurrentInstance(),r=l,n=t,o=e.computed(()=>{const E={search:!1,import:!1,export:!1,point:!1,line:!1,polygon:!1,rectangle:!1};if(!r.tools||!r.tools.length)return E;const S=new Set(r.tools.map(j=>j.toLowerCase()));return{search:S.has("search"),import:S.has("import"),export:S.has("export"),point:S.has("point"),line:S.has("line"),polygon:S.has("polygon"),rectangle:S.has("rectangle")}}),s=e.computed(()=>!!r.disabled),i=e.ref(!1),c=e.ref(null),u=e.ref(null),d=e.ref(!1),m=e.ref(""),f=e.reactive({}),p=e.ref([]),y=e.computed(()=>p.value.map(E=>f[E]).filter(E=>!!E)),h=e.computed(()=>Array.isArray(r.layers)&&r.layers.some(E=>`${(E==null?void 0:E.service)??""}`.toLowerCase()==="vtile"));let g,b,w;function x(){return navigator.platform.toUpperCase().indexOf("MAC")>=0,/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?"Використовуйте два пальці для зуму карти.":"Використовуйте Ctrl + прокрутка для зуму карти."}const k=e.ref(null),_=e.ref(null);let N=null;const V=e.ref(null),P=E=>{E.ctrlKey&&E.preventDefault()};function $(E,S){return E!=null&&E.id?String(E.id):E!=null&&E.url?`${E.url}-${S}`:`layer-${S}`}function M(E){if(!E)return"";if(/^https?:\/\//i.test(E))return E.replace(/\/+$/,"");const S=E.replace(/^\/+/,"").replace(/\/+$/,"");return S?`/${S}`:""}function A(E){var te;const S=(E==null?void 0:E.url)??"";if(!S||/^https?:\/\//i.test(S))return S;const j=typeof window<"u"&&((te=window.location)!=null&&te.origin)?window.location.origin:"";if(S.startsWith("/"))return j?`${j}${S}`:S;const W=M(E==null?void 0:E.prefix),Z=M(r.prefix),B=W||Z,T=S.replace(/^\/+/,""),K=B?`${B.replace(/\/$/,"")}/${T}`:`/${T}`;return j?`${j}${K}`:K}function q(E){const S=(E==null?void 0:E.style)??{};return j=>{const W=S.colorAttr,Z=S.colorSet??{},B=typeof W=="string"?(Z==null?void 0:Z[j==null?void 0:j[W]])??S.color??"#3388ff":S.color??"#3388ff",T=S.stroke??B;return{weight:S.width??1,color:T,opacity:S.opacity??1,fill:S.type?S.type!=="polyline":!0,fillColor:B,fillOpacity:S.opacity??.5}}}function Q(E){const S=(E==null?void 0:E.colorSet)||(E==null?void 0:E.colors);if(E!=null&&E.colorAttr&&S){const j=Object.entries(S).flat();return["match",["get",E.colorAttr],...j,E.color??"#94a3b8"]}return(E==null?void 0:E.color)??"#3388ff"}function R(E,S,j){if(!E)return[];const W=[],Z=Q(E);return E.icon&&W.push({id:`${S}-icon`,type:"symbol",source:S,"source-layer":j,minzoom:E.iconZoom||0,layout:{"icon-image":E.icon,"icon-size":1,"icon-allow-overlap":!0,"icon-ignore-placement":!0}}),E.pointZoom&&W.push({id:`${S}-point`,type:"circle",source:S,"source-layer":j,maxzoom:E.pointZoom,paint:{"circle-stroke-color":E.stroke||"#fff","circle-opacity":E.opacity??1,"circle-color":Z,"circle-stroke-width":E.width??1,"circle-radius":E.radius??5}}),E.type==="polygon"?W.push({id:`${S}-fill`,type:"fill",source:S,"source-layer":j,minzoom:E.pointZoom||0,paint:{"fill-color":Z,"fill-opacity":E.opacity??.5,"fill-outline-color":E.stroke||Z}}):E.type==="line"?W.push({id:`${S}-line`,type:"line",source:S,"source-layer":j,paint:{"line-color":Z,"line-opacity":E.opacity??1,"line-width":E.width??1.5}}):E.icon||W.push({id:`${S}-circle`,type:"circle",source:S,"source-layer":j,paint:{"circle-stroke-color":E.stroke||"#fff","circle-opacity":E.opacity??1,"circle-color":Z,"circle-stroke-width":E.width??1,"circle-radius":E.radius??5}}),W}function I(E,S){var B;const j=E.id||`source-${Math.random().toString(36).slice(2,8)}`,W=E.sourceLayer||E.layer||E.service_layer||E.service_key||E.map_key||((B=E.dataset)==null?void 0:B.layer)||E.id||E.table_name||j,Z=R(E.style||{},j,W||j);return Z.length?{version:8,glyphs:"https://demotiles.maplibre.org/font/{fontstack}/{range}.pbf",sources:{[j]:{type:"vector",tiles:[S],minzoom:E.minzoom??0,maxzoom:E.maxzoom??19}},layers:Z}:null}function F(E){var Z,B,T,K;const S=((E==null?void 0:E.service)??"").toLowerCase(),j=A(E),W=E.sourceLayer||E.layer||E.service_layer||E.service_key||E.map_key||((Z=E.dataset)==null?void 0:Z.layer)||E.id||E.table_name;if(console.info("[vs-input-map] create overlay layer",{id:E.id,service:S,url:j,sourceLayer:W,hasSourceLayer:!!W}),S==="vtile"){if((B=L==null?void 0:L.vectorGrid)!=null&&B.protobuf&&!(L!=null&&L.maplibreGL))return console.info("[vs-input-map] using Leaflet.vectorGrid"),L.vectorGrid.protobuf(j,{interactive:!0,vectorTileLayerStyles:{default:q(E)}});if(L!=null&&L.maplibreGL&&(window!=null&&window.maplibregl)){console.info("[vs-input-map] using maplibre-gl-leaflet");const te=I(E,j);return te?L.maplibreGL({style:te,interactive:!1,pane:"overlayPane"}):(console.warn("[vs-input-map] maplibre spec is empty",E.id),null)}return null}return S==="tile"||/^https?:\/\//i.test(j)||j.includes("{z}")?L.tileLayer(j,{opacity:((T=E==null?void 0:E.style)==null?void 0:T.opacity)??1}):L.tileLayer(j,{opacity:((K=E==null?void 0:E.style)==null?void 0:K.opacity)??1})}function D(){g&&p.value.forEach(E=>{const S=f[E];S&&(S.visible?(S.layer||(S.layer=F(S.config)),S.layer&&!g.hasLayer(S.layer)?(console.info("[vs-input-map] add overlay layer to map",S.id),S.layer.addTo(g)):S.layer||console.warn("[vs-input-map] overlay layer is null",S.id)):S.layer&&g.hasLayer(S.layer)&&(console.info("[vs-input-map] remove overlay layer from map",S.id),g.removeLayer(S.layer)))})}function z(E){if(s.value)return;const S=f[E];S&&(S.visible=!S.visible,g&&(console.info("[vs-input-map] toggle overlay",{id:E,nextVisible:S.visible,hasLayerInstance:!!S.layer}),S.visible?(S.layer||(S.layer=F(S.config)),S.layer&&!g.hasLayer(S.layer)&&(console.info("[vs-input-map] add overlay layer to map",S.id),S.layer.addTo(g))):S.layer&&g.hasLayer(S.layer)&&g.removeLayer(S.layer)))}function ee(){if(!r.handleZoom)return null;let E;const S=W=>{const Z=W.ctrlKey||W.metaKey,B=W.shiftKey;if(!Z&&!B){d.value=!0,m.value=x(),clearTimeout(E),E=window.setTimeout(()=>{d.value=!1},1e3);return}d.value=!1,g.scrollWheelZoom.enable(),setTimeout(()=>{g.scrollWheelZoom.disable()},100)},j=W=>{if(W.touches.length===1){d.value=!0,m.value=x(),clearTimeout(E),E=window.setTimeout(()=>{d.value=!1},3e3);return}d.value=!1};return _.value&&(_.value.addEventListener("wheel",S,{passive:!1}),_.value.addEventListener("touchstart",j,{passive:!0})),g&&g.on("wheel",W=>{const Z=W.originalEvent.ctrlKey||W.originalEvent.metaKey,B=W.originalEvent.shiftKey;!Z&&!B&&(W.originalEvent.preventDefault(),W.originalEvent.stopPropagation())}),()=>{_.value&&(_.value.removeEventListener("wheel",S),_.value.removeEventListener("touchstart",j)),g&&g.off("wheel"),clearTimeout(E)}}const me=e.ref(null),Ne=e.ref(6),Ke=e.ref(0),qt=e.ref(((Be=a==null?void 0:a.appContext.config.globalProperties.$settings)==null?void 0:Be.center)||[50,30]),Re=e.ref(null),Ye=G();let vt;const yt=e.ref("topo100");function Et(E){return E?E.type==="Polygon"?{type:"MultiPolygon",coordinates:[E.coordinates]}:(E.type,E):null}function Pt(){return new Promise((E,S)=>{window.L&&window.L.Draw&&E(0);const j=B=>{if(Array.from(document.styleSheets).some(K=>{var te;return(te=K==null?void 0:K.href)==null?void 0:te.includes(B)}))return;const T=document.createElement("link");T.rel="stylesheet",T.href=B,document.head.appendChild(T)},W=B=>new Promise((T,K)=>{const te=Array.from(document.scripts).find(we=>we.src===B);if(te){te.addEventListener("load",()=>T()),te.addEventListener("error",we=>K(we));return}const he=document.createElement("script");he.src=B,he.async=!0,he.onload=()=>T(),he.onerror=we=>K(we),document.body.appendChild(he)});j("https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"),j("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.css"),h.value&&j("https://unpkg.com/maplibre-gl@4.5.0/dist/maplibre-gl.css");let Z=W("https://unpkg.com/leaflet@1.9.4/dist/leaflet.js").then(()=>W("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.js"));h.value?Z=Z.then(()=>W("https://unpkg.com/maplibre-gl@4.5.0/dist/maplibre-gl.js")).then(()=>(window.maplibregl&&!window.mapboxgl&&(window.mapboxgl=window.maplibregl),W("https://unpkg.com/@maplibre/maplibre-gl-leaflet@0.0.20/leaflet-maplibre-gl.js"))):Z=Z.then(()=>W("https://unpkg.com/leaflet.vectorgrid@1.3.0/dist/Leaflet.VectorGrid.bundled.js").catch(()=>Promise.resolve())),Z.then(()=>E(0)).catch(S)})}function at(){const E=b.toGeoJSON(),S=[];let j=null;const W=B=>{if(B)switch(B.type){case"Point":j=B;break;case"Polygon":S.push(B.coordinates);break;case"MultiPolygon":S.push(...B.coordinates);break;case"GeometryCollection":(B.geometries||[]).forEach(W);break}};((E==null?void 0:E.features)||[]).forEach(B=>W(B.geometry));const Z=j||(S.length?{type:"MultiPolygon",coordinates:S}:null);n("update:modelValue",Z?Et(Z):null),Ke.value=b.getLayers().length}function st(E=30){const S=b.getLayers();if(!S.length)return;const j=L.featureGroup(S).getBounds();j&&j.isValid()&&g.fitBounds(j,{padding:[E,E]})}function U(){var E;s.value||((E=V.value)==null||E.click())}const Y=e.ref("");e.watch(o,E=>{Y.value&&!Object.entries(E).filter(([S,j])=>j).map(([S])=>S).includes(Y.value)&&(w!=null&&w.disable&&w.disable(),Y.value="")}),e.watch(()=>r.layers,E=>{const S=Array.isArray(E)?E:[],j=[],W=new Set;S.forEach((Z,B)=>{if(!Z)return;const T=$(Z,B);j.push(T),W.add(T),console.info("[vs-input-map] overlay register",{id:T,service:Z==null?void 0:Z.service,url:Z==null?void 0:Z.url});const K=f[T];K?f[T]={...K,config:{...Z,id:T}}:f[T]={id:T,config:{...Z,id:T},visible:(Z==null?void 0:Z.overlay)!==!1,layer:null}}),Object.keys(f).forEach(Z=>{if(W.has(Z))return;const B=f[Z];B!=null&&B.layer&&(g!=null&&g.hasLayer)&&g.hasLayer(B.layer)&&g.removeLayer(B.layer),delete f[Z]}),p.value=j,D()},{immediate:!0,deep:!0}),e.watch(s,E=>{E&&w&&(w.disable(),Y.value=""),b&&b.eachLayer(S=>{var j,W,Z,B,T;E?(W=(j=S.dragging)==null?void 0:j.disable)==null||W.call(j):(Z=S.dragging)!=null&&Z.enable&&(S.dragging.enable(),(T=(B=S.dragging).enabled)==null||T.call(B))})});function le(E){return E instanceof L.Circle?"Circle":E instanceof L.Rectangle?"Rectangle":E instanceof L.Polygon&&!(E instanceof L.Rectangle)?"Polygon":E instanceof L.Polyline&&!(E instanceof L.Polygon)?"Polyline":E instanceof L.Marker?"Point":"Feature"}function ae(E){var S;if(E instanceof L.Circle){const j=E.getRadius();return Math.PI*(j*j)/1e6}if(E instanceof L.Polygon||E instanceof L.Rectangle)try{const j=E.getLatLngs(),W=Array.isArray(j[0])?j[0]:j,Z=(S=L.GeometryUtil)!=null&&S.geodesicArea?L.GeometryUtil.geodesicArea(W):0;return Z?Z/1e6:0}catch{return null}return null}function de(E){return E instanceof L.Circle?E.getLatLng():E.getBounds?E.getBounds().getCenter():E.getLatLng?E.getLatLng():g.getCenter()}async function Ae(E,S){var Z;if(k.value="",!((Z=r.api)!=null&&Z.length))return;const[j,W]=r.api;try{const B=new URL(j);B.searchParams.set("lat",String(E)),B.searchParams.set("lon",String(S));const T=await fetch(B.toString());if(!T.ok)throw new Error("Request failed");const K=await T.json();W&&K[W]!==void 0?k.value=String(K[W]):k.value=JSON.stringify(K)}catch(B){console.error("[vs-input-map] reverse geocode failed:",B),k.value=null}}function C(){const E=b.getLayers();if(!E.length){Re.value=null,Ke.value=0;return}const S=E[E.length-1],j=le(S),W=de(S),Z=ae(S);Re.value={type:j,center:W,areaKm2:Z,layer:S},Ke.value=E.length,Ae(W.lat,W.lng)}function v(){var S;if(s.value)return;const E=(S=Re.value)==null?void 0:S.layer;E&&(E instanceof L.Circle&&E.getBounds?g.fitBounds(E.getBounds(),{padding:[30,30]}):E.getBounds?g.fitBounds(E.getBounds(),{padding:[30,30]}):E.getLatLng&&g.setView(E.getLatLng(),Math.max(Ne.value,14)))}function H(){var S;if(s.value)return;const E=(S=Re.value)==null?void 0:S.layer;E&&(b.removeLayer(E),at(),C())}e.onMounted(async()=>{document.addEventListener("wheel",P,{passive:!1}),await Pt(),L.drawLocal=by;const E=r.handleZoom;g=L.map(_.value,{zoomControl:!1,scrollWheelZoom:!E}).setView(qt.value,10),setTimeout(()=>{N=ee()},100),L.control.zoom({position:"bottomright"}).addTo(g),yt.value=Object.keys(Ye)[0],vt=L.tileLayer(Ye[yt.value].url,{maxZoom:19,minZoom:6}).addTo(g),b=new L.FeatureGroup().addTo(g),g.on(L.Draw.Event.CREATED,W=>{if(s.value)return;const{layer:Z}=W;b.clearLayers(),b.addLayer(Z),at(),st(),Y.value=""}),g.on(L.Draw.Event.EDITED,()=>{s.value||(at(),C(),st())}),g.on(L.Draw.Event.DELETED,()=>{s.value||(at(),C(),st())});let S=!1;g.on("mousemove",W=>{S||(g.invalidateSize(),S=!0),me.value=W.latlng}),g.on("zoomend",()=>{Ne.value=g.getZoom()});const j=yy(r.modelValue);if(j){const W=[];L.geoJSON(j).eachLayer(Z=>W.push(Z)),W.length&&b.addLayer(W[0]),at(),C(),st()}D()}),e.onUnmounted(()=>{document.removeEventListener("wheel",P),N&&N(),Object.values(f).forEach(E=>{var S;E!=null&&E.layer&&((S=g==null?void 0:g.hasLayer)!=null&&S.call(g,E.layer)&&g.removeLayer(E.layer),typeof E.layer.remove=="function"&&E.layer.remove())})});function re(E){if(!s.value&&g){switch(w&&w.disable(),E){case"marker":w=new L.Draw.Marker(g);break;case"polyline":w=new L.Draw.Polyline(g);break;case"polygon":w=new L.Draw.Polygon(g);break;case"rectangle":w=new L.Draw.Rectangle(g);break;default:w=new L.Draw.Rectangle(g);break}w&&(w.enable(),Y.value=E)}}function Te(){if(s.value)return;const E=b.toGeoJSON(),S=new Blob([JSON.stringify(E,null,2)],{type:"application/json"}),j=URL.createObjectURL(S),W=document.createElement("a");W.href=j,W.download="data.geojson",W.click(),URL.revokeObjectURL(j)}function Le(E){var Z;if(s.value)return;const S=E.target,j=(Z=S.files)==null?void 0:Z[0];if(!j)return;const W=new FileReader;W.onload=()=>{if(typeof W.result=="string")try{const B=JSON.parse(W.result);b.clearLayers(),B&&L.geoJSON({type:"Feature",geometry:B}).eachLayer(T=>{b.addLayer(T)}),at(),C(),st()}finally{S.value=""}},W.readAsText(j)}function be(E){g&&(vt&&g.removeLayer(vt),vt=L.tileLayer(Ye[E].url,{maxZoom:19,minZoom:6}).addTo(g),yt.value=E)}function O(E){const S=L.latLng(E[0],E[1]);g.setView(S,13)}e.watch(()=>r.modelValue,E=>{const S=Et(E);if(E&&S!==E){n("update:modelValue",S);return}b.clearLayers(),S&&L.geoJSON({type:"Feature",geometry:S}).eachLayer(j=>{var W,Z,B,T,K,te;if(b.addLayer(j),s.value){(Z=(W=j.dragging)==null?void 0:W.disable)==null||Z.call(W);return}(T=(B=j.dragging)==null?void 0:B.enable)==null||T.call(B),(te=(K=j.dragging)==null?void 0:K.enabled)==null||te.call(K),j.on("dragend",he=>{const we=he.target.getLatLng();n("update:modelValue",{type:"Point",coordinates:[we.lng,we.lat]})})}),Ke.value=b.getLayers().length,C(),st()});function G(){var E,S;return(E=a==null?void 0:a.appContext.config.globalProperties.$settings)!=null&&E.basemaps?(S=a==null?void 0:a.appContext.config.globalProperties.$settings)==null?void 0:S.basemaps.map((j,W)=>Object.assign(j,{key:`b${W}`,preview:j.preview||j.url.replace("{z}/{x}/{y}.png","13/4790/2762.png")})).reduce((j,W)=>({...j,[W.key]:W}),{}):{topo100:{url:"https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png",preview:"https://data.gki.com.ua/api-user/rtile/voyager/ua/13/4790/2762.png"},orto10:{url:"https://data.gki.com.ua/api-user/rtile/orto10/ua/{z}/{x}/{y}.png",preview:"https://data.gki.com.ua/api-user/rtile/orto10/ua/13/4790/2762.png"},osmb:{url:"https://tile.openstreetmap.org.ua/styles/osm-bright/{z}/{x}/{y}.png",preview:"https://tile.openstreetmap.org.ua/styles/osm-bright/13/4790/2762.png"}}}const ye=e.ref(!1);return e.watch(ye,()=>{setTimeout(()=>{g.invalidateSize()},50)}),e.watch(i,async E=>{if(!E||!u.value){c.value=null;return}await e.nextTick();const S=u.value.getBoundingClientRect();c.value={top:S.bottom+6,left:S.left}}),e.onUnmounted(()=>{i.value=!1,c.value=null}),(E,S)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["leaflet-map-wrapper relative w-full h-[400px]",{fullscreen:ye.value}])},[e.createElementVNode("div",{ref_key:"mapContainer",ref:_,class:"w-full h-full"},null,512),e.createVNode(e.Transition,{name:"zoom-instructions","enter-active-class":"transition-all duration-200 ease-out","leave-active-class":"transition-all duration-500 ease-in","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[d.value&&r.handleZoom?(e.openBlock(),e.createElementBlock("div",Jy,[e.createElementVNode("div",e1,[e.createElementVNode("p",t1,e.toDisplayString(m.value),1)])])):e.createCommentVNode("",!0)]),_:1}),o.value.search||o.value.import||o.value.export?(e.openBlock(),e.createElementBlock("div",l1,[o.value.search?(e.openBlock(),e.createBlock(Wy,{key:0,onGoToCoordinates:O})):e.createCommentVNode("",!0),o.value.import||o.value.export?(e.openBlock(),e.createElementBlock("div",a1,[e.createElementVNode("div",r1,[o.value.import?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"inline-flex items-center gap-2 text-sm font-medium border rounded-md px-3 py-2 bg-white text-blue-600 border-stone-200 hover:bg-blue-500 hover:text-white transition",onClick:U,disabled:s.value}," Import ",8,n1)):e.createCommentVNode("",!0),o.value.export?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"inline-flex items-center gap-2 text-sm font-medium border rounded-md px-3 py-2 bg-white text-blue-600 border-stone-200 hover:bg-blue-500 hover:text-white transition",onClick:Te,disabled:s.value||Ke.value===0}," Export ",8,o1)):e.createCommentVNode("",!0)]),e.createElementVNode("input",{ref_key:"importRef",ref:V,type:"file",onChange:Le,accept:".json,.geojson",class:"hidden",disabled:s.value},null,40,s1)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",i1,[e.createElementVNode("div",c1,[o.value.point?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["vs-btn",{"vs-active":Y.value==="marker"}]),title:"Point",onClick:S[0]||(S[0]=j=>re("marker")),disabled:s.value},[e.createVNode(_y)],10,d1)):e.createCommentVNode("",!0),o.value.line?(e.openBlock(),e.createElementBlock("button",{key:1,class:e.normalizeClass(["vs-btn",{"vs-active":Y.value==="polyline"}]),title:"Line",onClick:S[1]||(S[1]=j=>re("polyline")),disabled:s.value},[e.createVNode(Ny)],10,u1)):e.createCommentVNode("",!0),o.value.polygon?(e.openBlock(),e.createElementBlock("button",{key:2,class:e.normalizeClass(["vs-btn",{"vs-active":Y.value==="polygon"}]),title:"Polygon",onClick:S[2]||(S[2]=j=>re("polygon")),disabled:s.value},[e.createVNode(Dy)],10,m1)):e.createCommentVNode("",!0),o.value.rectangle?(e.openBlock(),e.createElementBlock("button",{key:3,class:e.normalizeClass(["vs-btn",{"vs-active":Y.value==="rectangle"}]),title:"Rectangle",onClick:S[3]||(S[3]=j=>re("rectangle")),disabled:s.value},[e.createVNode(Ly)],10,p1)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"vs-btn mt-5",onClick:S[4]||(S[4]=j=>ye.value=!ye.value),title:"Full Screen"},[e.createVNode(Oy,{style:{width:"12px",height:"12px"}})])])]),e.createElementVNode("div",{class:e.normalizeClass(["absolute left-4 z-[1000]",Re.value?"bottom-8":"bottom-4"])},[e.createElementVNode("div",f1,[e.createVNode(Qy,{basemaps:e.unref(Ye),onOnLayerChange:be},null,8,["basemaps"]),y.value.length?(e.openBlock(),e.createElementBlock("div",h1,[S[9]||(S[9]=e.createElementVNode("p",{class:"font-semibold text-[11px] uppercase tracking-wide text-gray-500 mb-2"},"Layers",-1)),e.createElementVNode("div",g1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,j=>(e.openBlock(),e.createElementBlock("label",{key:j.id,class:"flex items-center gap-2 cursor-pointer select-none"},[e.createElementVNode("input",{type:"checkbox",class:"rounded border-gray-300 text-blue-600 focus:ring-blue-500",checked:j.visible,disabled:s.value,onChange:W=>z(j.id)},null,40,b1),e.createElementVNode("span",y1,e.toDisplayString(j.config.title||j.config.name||j.id),1)]))),128))])])):e.createCommentVNode("",!0)])],2),e.createElementVNode("div",k1,[Re.value?(e.openBlock(),e.createElementBlock("div",x1,[e.createElementVNode("div",{class:"mr-auto flex items-center gap-2 min-w-0 relative",onMouseenter:S[5]||(S[5]=j=>i.value=!0),onMouseleave:S[6]||(S[6]=j=>i.value=!1)},[e.createElementVNode("div",w1,[S[10]||(S[10]=e.createTextVNode(" Type: ",-1)),e.createElementVNode("span",_1,e.toDisplayString(Re.value.type),1)]),k.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"addressEl",ref:u,class:"text-gray-500 text-xs truncate cursor-help",style:{"max-width":"260px"}}," Address: "+e.toDisplayString(k.value),513)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[i.value&&k.value&&c.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed z-[99999] pointer-events-none bg-gray-800 text-white text-xs px-2 py-1 rounded shadow whitespace-nowrap",style:e.normalizeStyle({top:c.value.top+"px",left:c.value.left+"px"})},e.toDisplayString(k.value),5)):e.createCommentVNode("",!0)]))],32),e.createElementVNode("div",E1,[e.createElementVNode("div",C1,[S[11]||(S[11]=e.createTextVNode(" Center: ",-1)),e.createElementVNode("b",null,e.toDisplayString(Re.value.center.lat.toFixed(5))+", "+e.toDisplayString(Re.value.center.lng.toFixed(5)),1)]),Re.value.areaKm2!==null?(e.openBlock(),e.createElementBlock("div",V1,[S[12]||(S[12]=e.createTextVNode(" Area: ",-1)),e.createElementVNode("b",null,e.toDisplayString(Re.value.areaKm2.toFixed(1))+" km²",1)])):(e.openBlock(),e.createElementBlock("div",N1,S[13]||(S[13]=[e.createTextVNode("Area: ",-1),e.createElementVNode("b",null,"—",-1)]))),e.createElementVNode("button",{class:"tool bg-gray-100 py-1.5 px-2 rounded-lg text-md mr-1 cursor-pointer hover:bg-blue-500 hover:text-white transition-all",title:"Zoom to feature",onClick:S[7]||(S[7]=j=>v()),disabled:s.value},S[14]||(S[14]=[e.createStaticVNode('<svg 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="w-3 h-3" data-v-150e767b><path d="M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0" data-v-150e767b></path><path d="M7 10l6 0" data-v-150e767b></path><path d="M10 7l0 6" data-v-150e767b></path><path d="M21 21l-6 -6" data-v-150e767b></path></svg>',1)]),8,v1),e.createElementVNode("button",{class:"tool bg-gray-100 py-1.5 px-2 rounded-lg text-md cursor-pointer hover:bg-blue-500 hover:text-white transition-all",title:"Delete feature",onClick:S[8]||(S[8]=j=>H()),disabled:s.value},[e.createVNode(va,{class:"w-3 h-3"})],8,B1)])])):e.createCommentVNode("",!0)])],2))}}),D1=_e(S1,[["__scopeId","data-v-150e767b"]]),A1=["data-focus"],M1={class:"flex items-center"},T1={class:"overflow-hidden text-ellipsis whitespace-nowrap rounded-sm text-[#333] text-[85%] px-0.5 py-[3px] pl-1.5 box-border"},L1=["onClick","aria-label"],$1={key:0,class:"absolute text-gray-500 truncate pl-2"},F1={class:"flex-1 min-w-[2px]"},I1=["placeholder"],O1={class:"flex items-center shrink-0"},P1=["disabled"],R1=e.defineComponent({__name:"vs-input-tag",props:e.mergeModels({unique:{type:Boolean,default:!0},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:"Введіть тег"}},{modelValue:{default:[]},modelModifiers:{}}),emits:e.mergeModels(["update:modelValue"],["update:modelValue"]),setup(l,{emit:t}){const a=l,r=t;ft(a.style);const n=e.ref(null),o=e.ref(null),s=e.ref(null),i=e.ref(!1),c=e.ref(""),u=e.useModel(l,"modelValue"),d=e.computed(()=>a.placeholder||"Add tag…"),m=e.computed(()=>{var N;return((N=u.value)==null?void 0:N.length)===0&&c.value===""}),f=e.computed(()=>{var N;return!a.disabled&&((N=u.value)==null?void 0:N.length)>0}),p=e.computed(()=>a.disabled),y=async()=>{p.value||await e.nextTick(()=>{var N;return(N=s.value)==null?void 0:N.focus()})},h=N=>{const V=N.trim();V!==""&&(!u.value||!Array.isArray(u.value)?u.value=[V]:a.unique?u.value.includes(V)||(u.value=[...u.value,V]):u.value=[...u.value,V],c.value="")},g=()=>{const N=c.value;N.trim()!==""&&h(N),c.value=""},b=N=>{const V=u.value.slice();V.splice(N,1),r("update:modelValue",V)},w=()=>{r("update:modelValue",[])},x=()=>{p.value||(i.value=!0)},k=()=>{i.value=!1,!p.value&&g()},_=N=>{const{key:V}=N;V==="Enter"?(N.preventDefault(),g()):V==="Backspace"&&c.value===""&&u.value.length>0&&b(u.value.length-1)};return(N,V)=>(e.openBlock(),e.createElementBlock("div",{class:"flex gap-1 w-full",ref_key:"root",ref:n,onClick:V[1]||(V[1]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:e.normalizeClass(["relative w-full font-sans",a.customClass]),role:"group","aria-label":"Tag input"},[e.createElementVNode("div",{class:e.normalizeClass(["flex min-h-[38px] items-center justify-between rounded border transition-colors bg-white","border-gray-300 hover:border-gray-400",i.value?"border-blue-500 ring-1 ring-blue-500":"",p.value?"bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300":""]),"data-focus":i.value?"true":"false",onClick:y},[e.createElementVNode("div",{class:"flex flex-1 flex-wrap items-center gap-1 py-0.5 pl-2 pr-0 overflow-hidden",ref_key:"chipsRef",ref:o},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(P,$)=>(e.openBlock(),e.createElementBlock("div",{key:$,class:"flex min-w-0 bg-[#e6e6e6] rounded-sm m-0.5 box-border"},[e.createElementVNode("div",M1,[e.createElementVNode("div",T1,e.toDisplayString(P),1)]),e.createElementVNode("div",{role:"button",class:"flex items-center rounded-sm px-1 box-border hover:bg-[#ffbdad] hover:text-[#de350b]",onClick:e.withModifiers(M=>b($),["stop"]),"aria-label":`Remove ${P}`},V[2]||(V[2]=[e.createElementVNode("svg",{height:"14",width:"14",viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",class:"inline-block fill-current stroke-current leading-none stroke-0"},[e.createElementVNode("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"})],-1)]),8,L1)]))),128)),m.value?(e.openBlock(),e.createElementBlock("div",$1,e.toDisplayString(d.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",F1,[p.value?e.createCommentVNode("",!0):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,ref_key:"inputRef",ref:s,class:"pl-2 w-full bg-transparent outline-none border-0 m-0 p-0 text-gray-900",autocapitalize:"none",autocomplete:"off",autocorrect:"off",spellcheck:"false",type:"text",tabindex:"0","aria-label":"Add tag","onUpdate:modelValue":V[0]||(V[0]=P=>c.value=P),onFocus:x,onBlur:k,onKeydown:_,placeholder:u.value&&u.value.length?"":void 0},null,40,I1)),[[e.vModelText,c.value]])])],512),e.createElementVNode("div",O1,[f.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50","aria-label":"Clear all tags",disabled:p.value,onClick:e.withModifiers(w,["stop"])},V[3]||(V[3]=[e.createElementVNode("svg",{height:"20",width:"20",viewBox:"0 0 20 20",class:"fill-current"},[e.createElementVNode("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"})],-1)]),8,P1)):e.createCommentVNode("",!0)])],10,A1)],2)],512))}}),U1={class:"relative flex gap-1 bg-white w-full"},j1=["disabled","placeholder"],z1=e.defineComponent({__name:"vs-input-slug",props:e.mergeModels({disabled:{type:Boolean},placeholder:{},parent:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=e.inject("values"),a=l,r=e.useModel(l,"modelValue");function n(s){const i={а:"a",б:"b",в:"v",г:"g",д:"d",е:"e",ё:"e",ж:"zh",з:"z",и:"i",й:"y",к:"k",л:"l",м:"m",н:"n",о:"o",п:"p",р:"r",с:"s",т:"t",у:"u",ф:"f",х:"kh",ц:"ts",ч:"ch",ш:"sh",щ:"shch",ы:"y",э:"e",ю:"yu",я:"ya",ь:"",ъ:"",є:"ye",і:"i",ї:"yi",ґ:"g"};return s.toLowerCase().split("").map(c=>i[c]||c).join("").replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}const o=()=>{var c,u;const s=(u=(c=t==null?void 0:t.value)==null?void 0:c[a.parent||""])==null?void 0:u.toString(),i=n(s);r.value=i.toString()};return(s,i)=>(e.openBlock(),e.createElementBlock("div",U1,[e.withDirectives(e.createElementVNode("input",{ref:"vsText",disabled:s.disabled,placeholder:s.placeholder,"onUpdate:modelValue":i[0]||(i[0]=c=>r.value=c),class:"block w-full px-3 py-2 text-sm border border-solid rounded-lg placeholder:text-nowrap border-stone-200 text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"},null,8,j1),[[e.vModelText,r.value]]),e.createElementVNode("button",{class:"px-2 bg-gray-100 border rounded-lg hover:bg-gray-200",onClick:o}," Gen ")]))}}),H1=_e(z1,[["__scopeId","data-v-b0eba370"]]),q1={class:"relative flex gap-1 bg-white w-full"},G1=["disabled","placeholder"],W1=["disabled"],K1={key:0},Y1={key:1},X1=e.defineComponent({__name:"vs-input-codegen",props:e.mergeModels({table:{},code:{},init:{type:Boolean},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,a=e.useModel(l,"modelValue"),r=e.ref(!1),n=e.computed(()=>t.init!==!1),o=e.computed(()=>!!t.table&&!!t.code),s=()=>{if(!o.value)return"";const u=encodeURIComponent(String(t.table)),d=encodeURIComponent(String(t.code));return`/api/code-gen/${u}/${d}`},i=async()=>{if(!o.value||r.value)return;const u=s();if(u){r.value=!0;try{const d=await(await fetch(u)).text();a.value=d}finally{r.value=!1}}},c=()=>{n.value&&(a.value||i())};return e.onMounted(()=>{c()}),e.watch(()=>[t.table,t.code,t.init],()=>{c()}),(u,d)=>(e.openBlock(),e.createElementBlock("div",q1,[e.withDirectives(e.createElementVNode("input",{disabled:u.disabled,placeholder:u.placeholder,"onUpdate:modelValue":d[0]||(d[0]=m=>a.value=m),class:"block w-full px-3 py-2 text-sm border border-solid rounded-lg placeholder:text-nowrap border-stone-200 text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"},null,8,G1),[[e.vModelText,a.value]]),e.createElementVNode("button",{class:"px-2 bg-gray-100 border rounded-lg hover:bg-gray-200 disabled:opacity-50 disabled:cursor-not-allowed",disabled:r.value||u.disabled||!o.value,onClick:i},[r.value?(e.openBlock(),e.createElementBlock("span",Y1,"...")):(e.openBlock(),e.createElementBlock("span",K1,"Gen"))],8,W1)]))}}),Z1=_e(X1,[["__scopeId","data-v-6ee5237d"]]),Q1={class:"w-full"},J1={ref:"sortableContainer",class:"flex flex-col gap-1"},ek=["onDragstart","onDrop"],tk={class:"w-1/3"},lk={class:"w-2/3"},ak=["onClick"],rk={key:0,class:"text-[14px] text-gray-700"},nk={class:"mt-2 w-full flex items-center"},ok=["disabled"],sk=e.defineComponent({__name:"vs-input-key-value",props:{parent:{},ignore:{},addButtonText:{},modelValue:{}},emits:["update:modelValue"],setup(l,{emit:t}){const a=h=>`${h}-${Math.random().toString(36).substring(2,15)}`,r=e.inject("values"),n=l,o=t,s=n.addButtonText??"Додати",i=n.ignore??[],c=e.ref([]),u=e.ref(null);(()=>{var g;const h=n.parent&&((g=r==null?void 0:r.value)==null?void 0:g[n.parent])||n.modelValue||{};c.value=Object.entries(h).filter(([b])=>!i.includes(b)).map(([b,w])=>({id:a("key-value-"),key:b,value:w}))})();function d(h){u.value=h}function m(h){if(u.value===null||u.value===h)return;const g=c.value.splice(u.value,1)[0];c.value.splice(h,0,g),u.value=null}const f=e.computed(()=>c.value.some(h=>h.key&&!h.value||!h.key&&h.value)),p=()=>{c.value.push({id:a("key-value-"),key:"",value:""})},y=h=>{c.value=c.value.filter(g=>g.id!==h)};return e.watch(c,h=>{const g={};h.forEach(w=>{w.key&&w.value!==void 0&&(g[w.key]=w.value)});const b={};i.length&&i.forEach(w=>{var x,k;b[w]=n.parent?(k=(x=r==null?void 0:r.value)==null?void 0:x[n.parent])==null?void 0:k[w]:void 0}),r!=null&&r.value&&n.parent&&(r.value[n.parent]={...b,...g}),o("update:modelValue",g)},{deep:!0}),(h,g)=>(e.openBlock(),e.createElementBlock("div",Q1,[e.createElementVNode("div",J1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(b,w)=>(e.openBlock(),e.createElementBlock("div",{key:b.id,class:e.normalizeClass(["flex items-center gap-2 w-full",{"opacity-50":u.value===w}]),draggable:"true",onDragstart:x=>d(w),onDragover:g[0]||(g[0]=e.withModifiers(()=>{},["prevent"])),onDrop:x=>m(w)},[g[1]||(g[1]=e.createStaticVNode('<button class="cursor-move" data-v-a0f7fbfc><svg fill="#000000" width="20" height="20" viewBox="0 0 36 36" data-v-a0f7fbfc><circle cx="15" cy="12" r="1.5" data-v-a0f7fbfc></circle><circle cx="15" cy="24" r="1.5" data-v-a0f7fbfc></circle><circle cx="21" cy="12" r="1.5" data-v-a0f7fbfc></circle><circle cx="21" cy="24" r="1.5" data-v-a0f7fbfc></circle><circle cx="21" cy="18" r="1.5" data-v-a0f7fbfc></circle><circle cx="15" cy="18" r="1.5" data-v-a0f7fbfc></circle></svg></button>',1)),e.createElementVNode("div",tk,[e.createVNode(Na,{modelValue:b.key,"onUpdate:modelValue":x=>b.key=x,placeholder:"Ключ"},null,8,["modelValue","onUpdate:modelValue"])]),e.createElementVNode("div",lk,[e.createVNode(Na,{modelValue:b.value,"onUpdate:modelValue":x=>b.value=x,placeholder:"Значення"},null,8,["modelValue","onUpdate:modelValue"])]),e.createElementVNode("button",{onClick:x=>y(b.id),class:"shrink-0 w-[30px] text-gray-600 h-[30px] rounded-full flex items-center justify-center bg-gray-100 hover:bg-gray-200"},[e.createVNode(e.unref(vh),{height:"16",width:"16"})],8,ak)],42,ek))),128))],512),c.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",rk," Дані для відображення відсутні ")),e.createElementVNode("div",nk,[e.createElementVNode("button",{type:"button",onClick:p,disabled:f.value,class:"py-1.5 px-2 flex items-center gap-x-1 text-xs font-medium rounded-full border border-dashed border-gray-200 bg-white text-gray-800 hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed"},[e.createVNode(Gl,{height:"14",width:"14"}),e.createTextVNode(" "+e.toDisplayString(e.unref(s)),1)],8,ok)])]))}}),ik=_e(sk,[["__scopeId","data-v-a0f7fbfc"]]),ck={class:"flex items-center gap-2 w-full"},dk=["disabled"],uk=["disabled"],mk=e.defineComponent({__name:"vs-input-color",props:{style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""}},emits:["update:modelValue"],setup(l,{emit:t}){const a=l,{inputClass:r}=ft(a.style),n=t,o=e.computed({get:()=>a.modelValue||"#000000",set:i=>n("update:modelValue",i)}),s=e.computed(()=>!!a.disabled);return(i,c)=>(e.openBlock(),e.createElementBlock("div",ck,[e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":c[0]||(c[0]=u=>o.value=u),disabled:s.value,ref:"color",class:e.normalizeClass(["py-1.5 px-1 block w-full bg-white cursor-pointer max-w-[50px]",[i.modelValue?"":"text-opacity-50",e.unref(r)].join(" ")]),style:{border:"1px solid #CFD9E0"}},null,10,dk),[[e.vModelText,o.value]]),e.withDirectives(e.createElementVNode("input",{class:"text-sm text-gray-600 border border-solid border-stone-200 rounded-md p-2","onUpdate:modelValue":c[1]||(c[1]=u=>o.value=u),disabled:s.value},null,8,uk),[[e.vModelText,o.value]])]))}}),pk={class:"flex items-center gap-2 w-full"},fk=["min","max","step","disabled"],hk=["disabled"],gk=e.defineComponent({__name:"vs-input-range",props:{style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""},min:{default:0},max:{default:100},step:{default:1}},emits:["update:modelValue"],setup(l,{emit:t}){const a=l,{inputClass:r}=ft(a.style),n=t,o=e.computed({get:()=>Number(a.modelValue??a.min),set:i=>n("update:modelValue",Number(i))}),s=e.computed(()=>!!a.disabled);return(i,c)=>(e.openBlock(),e.createElementBlock("div",pk,[e.withDirectives(e.createElementVNode("input",{type:"range","onUpdate:modelValue":c[0]||(c[0]=u=>o.value=u),min:i.min,max:i.max,step:i.step,disabled:s.value,ref:"range",class:e.normalizeClass(["w-full cursor-pointer accent-blue-500",[i.modelValue?"":"text-opacity-50",e.unref(r)].join(" ")])},null,10,fk),[[e.vModelText,o.value]]),e.withDirectives(e.createElementVNode("input",{class:"text-sm text-gray-600 border border-solid border-stone-200 rounded-md p-2 max-w-[100px]",type:"number","onUpdate:modelValue":c[1]||(c[1]=u=>o.value=u),disabled:s.value},null,8,hk),[[e.vModelText,o.value]])]))}}),bk=["type","value","onInput","placeholder","disabled"],yk=e.defineComponent({__name:"vs-input-array",props:e.mergeModels({count:{default:1},limit:{default:l=>l.count??1},inputType:{default:"text"},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{default:""}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,{inputClass:a}=ft(t.style),r=e.useModel(l,"modelValue"),n=e.computed(()=>!!t.disabled),o=e.computed(()=>t.placeholder??"");e.watchEffect(()=>{var c;const i=((c=r.value)==null?void 0:c.length)??0;i<t.count&&(r.value=[...r.value??[],...Array(t.count-i)])});function s(i,c){if(n.value)return;const u=i.target.value,d=[...r.value];d[c]=t.inputType==="text"?u:Number(u),r.value=d}return(i,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["grid gap-2",`grid-cols-${i.limit}`])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.count,u=>{var d;return e.openBlock(),e.createElementBlock("input",{type:i.inputType,value:((d=r.value)==null?void 0:d[u-1])??"",onInput:m=>s(m,u-1),placeholder:o.value,disabled:n.value,class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[e.unref(a),{"!border-red-600":i.error}]]),style:{border:"1px solid #CFD9E0"}},null,42,bk)}),256))],2))}}),kk={class:"flex items-center gap-2 w-full"},xk={class:"relative flex-1"},wk=["placeholder","disabled","onKeydown"],_k=["disabled"],Ek={key:0,xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Ck={key:1,class:"animate-spin h-5 w-5 text-gray-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},Vk={key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/50"},Nk={class:"bg-white text-gray-900 rounded-lg shadow-lg w-[480px] max-h-[80vh] overflow-y-auto"},vk={class:"p-3 border-b font-semibold text-gray-900 flex justify-between items-center"},Bk=["onClick"],Sk={key:0,class:"p-4 text-sm text-gray-500"},Dk=e.defineComponent({__name:"vs-input-address",props:e.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{},api:{default:""},geom:{default:""},includes:{default:()=>[]}},{modelValue:{default:""},modelModifiers:{}}),emits:e.mergeModels(["update:modelValue","update:geom"],["update:modelValue"]),setup(l,{emit:t}){const a=l,r=t,{inputClass:n}=ft(a.style),o=e.useModel(l,"modelValue"),s=e.computed({get:()=>o.value,set:b=>{o.value=b}}),i=e.ref(!1),c=e.ref([]),u=e.ref(!1),d=e.computed(()=>a.placeholder??""),m=e.computed(()=>!!a.disabled),f=e.inject("values");function p(){!m.value&&s.value.trim()&&y()}async function y(){var k;const b=(s.value||"").trim();if(!b)return;let w=b;if((k=a.includes)!=null&&k.length&&(f!=null&&f.value)){const _=a.includes.map(N=>{var V;return(V=f.value)==null?void 0:V[N]}).filter(Boolean);_.length&&(w=`${_.join(", ")}, ${b}`)}const x=a.api.replace("{{value}}",encodeURIComponent(w));i.value=!0;try{const _=await(await fetch(x)).json();c.value=Array.isArray(_)?_:[],u.value=!0}catch(_){console.error("Address search error:",_)}finally{i.value=!1}}function h(){u.value=!u.value}function g(b){if(!b)return;u.value=!1;const w=parseFloat(b.lat),x={type:"Point",coordinates:[parseFloat(b.lon),w]};a.geom&&(f!=null&&f.value)&&(f.value[a.geom]=x),r("update:geom",x)}return(b,w)=>{var x;return e.openBlock(),e.createElementBlock("div",kk,[e.createElementVNode("div",xk,[e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":w[0]||(w[0]=k=>s.value=k),placeholder:d.value,disabled:m.value,class:e.normalizeClass(["py-1.5 px-3 block w-full bg-white border rounded-md placeholder:text-gray-400 focus:ring-2 focus:ring-blue-500",[e.unref(n),{"!border-red-600":a.error}]]),style:{border:"1px solid #CFD9E0"},onKeydown:e.withKeys(e.withModifiers(p,["prevent"]),["enter"])},null,42,wk),[[e.vModelText,s.value]]),c.value.length?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-500 hover:text-blue-600",onClick:h,title:"Show search results"},w[2]||(w[2]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"12",cy:"12",r:"10"}),e.createElementVNode("path",{d:"M12 16v-4"}),e.createElementVNode("path",{d:"M12 8h.01"})],-1)]))):e.createCommentVNode("",!0)]),e.createElementVNode("button",{type:"button",onClick:y,class:"flex items-center justify-center px-2 py-2 border rounded-md bg-white hover:bg-gray-50 text-gray-600 hover:text-blue-600 disabled:opacity-50 h-[38px]",disabled:i.value||!((x=s.value)!=null&&x.trim())},[i.value?(e.openBlock(),e.createElementBlock("svg",Ck,w[4]||(w[4]=[e.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"},null,-1)]))):(e.openBlock(),e.createElementBlock("svg",Ek,w[3]||(w[3]=[e.createElementVNode("circle",{cx:"11",cy:"11",r:"8"},null,-1),e.createElementVNode("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"},null,-1)])))],8,_k),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[u.value?(e.openBlock(),e.createElementBlock("div",Vk,[e.createElementVNode("div",Nk,[e.createElementVNode("div",vk,[w[6]||(w[6]=e.createElementVNode("span",null,"Search results",-1)),e.createElementVNode("button",{class:"text-gray-500 hover:text-blue-600",onClick:w[1]||(w[1]=k=>u.value=!1),title:"Close"},w[5]||(w[5]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)]))]),e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(k,_)=>(e.openBlock(),e.createElementBlock("li",{key:_,onClick:N=>g(k),class:"px-3 py-2 cursor-pointer hover:bg-gray-100 border-b text-sm"},e.toDisplayString(k.display_name),9,Bk))),128))]),c.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Sk," No results found "))])])):e.createCommentVNode("",!0)]))])}}}),$e={VsInputText:Na,VsInputRadio:Qo,"vs-input-text":Na,"vs-input-password":th,"vs-input-textarea":cb,"vs-input-mask":Oh,"vs-input-number":rh,"vs-input-radio":Qo,"vs-input-select":Lr,"vs-input-switcher":Xo,"vs-input-static":Zo,"vs-input-container":jg,"vs-input-date":e0,"vs-input-checkbox":Jo,"vs-input-file":U0,"vs-input-html":Zo,"vs-input-email":Uh,"vs-input-datatable":gy,"vs-input-map":D1,"vs-input-file-list":bg,"vs-input-tags":R1,"vs-input-slug":H1,"vs-input-codegen":Z1,"vs-input-key-value":ik,"vs-input-range":gk,"vs-input-color":mk,"vs-input-native-select":Lr,"vs-input-array":yk,"vs-input-address":Dk},Ak=e.defineComponent({__name:"behavior",props:{api:{},set:{},button:{},error:{},value:{}},setup(l){const t=l,a=e.inject("values");async function r(){try{if(!t.api)return;const n=t.api.replace("{{value}}",t.value),o=await fetch(n);if(!o.ok){xe({type:"warning",title:"Validation",message:"При спробі завантажити дані виникла помилка."});return}const s=await o.json();if(!t.set||!a)return;for(const[i,c]of Object.entries(t.set))a.value[i]=s.result[c]}catch(n){console.error(t.error,n)}}return(n,o)=>(e.openBlock(),e.createElementBlock("button",{onClick:r,class:"vs-button relative inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-blue-500 hover:border-blue-500 hover:bg-blue-500 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 ml-0 md:ml-2 mt-2 md:mt-0 py-[8px] md:w-2/4 whitespace-nowrap w-full"},e.toDisplayString(n.button),1))}}),Mk={class:"flex flex-col gap-1 w-full"},Tk={key:0,class:"text-sm text-gray-500"},ss=e.defineComponent({__name:"vs-compact-form-layout",props:e.mergeModels({item:{default:{}},layout:{default:"default"},style:{default:{}},type:{default:""},error:{type:[String,Boolean]},columns:{default:()=>({container:12,label:3})}},{modelValue:{default:null},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,a=e.useModel(l,"modelValue"),r=e.computed(()=>Jf[`${t.layout}`]),n=e.computed(()=>$e==null?void 0:$e[`vs-input-${t.item.type}`]),o=e.computed(()=>{var d;const i=e.unref(n);if(!i)return new Set;const c=i.props??((d=i.__vccOpts)==null?void 0:d.props);if(!c)return new Set;const u=Array.isArray(c)?c:Object.keys(c);return new Set(u)}),s=e.computed(()=>{const i=t.item??{},c=o.value;return c.size?Object.fromEntries(Object.entries(i).filter(([u])=>c.has(u))):{}});return(i,c)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),{ua:t.item.ua,error:t.error||"",item:i.item,columns:t.columns,label:t.item.label},{default:e.withCtx(()=>{var u,d;return[e.createElementVNode("div",{class:e.normalizeClass(["flex w-full",`${t.item.type}-component`])},[e.createElementVNode("div",Mk,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.value),e.mergeProps(s.value,{modelValue:a.value,"onUpdate:modelValue":c[0]||(c[0]=m=>a.value=m)}),null,16,["modelValue"])),i.item.description&&t.layout!=="settings"?(e.openBlock(),e.createElementBlock("p",Tk,e.toDisplayString(i.item.description),1)):e.createCommentVNode("",!0)]),(u=i.item.behavior)!=null&&u.api&&((d=i.item.behavior)!=null&&d.button)?(e.openBlock(),e.createBlock(Ak,e.mergeProps({key:0},i.item.behavior,{value:a.value}),null,16,["value"])):e.createCommentVNode("",!0)],2)]}),_:1},8,["ua","error","item","columns","label"]))}}),Lk={class:"text-sm text-gray-800 mb-[4px] font-medium dark:text-neutral-300"},$k={class:"vs-compact-form-navigation__rail mt-[6px]"},Fk=["onClick"],Ik=e.defineComponent({__name:"vs-compact-form-navigation",props:{target:{},scrollContainer:{},title:{default:"Навігація"},enabled:{type:Boolean,default:!0},width:{default:400}},setup(l,{expose:t}){const a=l,r=e.ref([]),n=e.ref(""),o=e.ref(""),s=e.computed(()=>!!a.enabled),i=e.computed(()=>["vs-compact-form-navigation flex flex-col pl-[6px] pt-[8px] pr-[8px]","sticky top-0 self-start shrink-0","max-h-full min-h-0 overflow-y-auto"]),c=e.computed(()=>{const A=a.width;if(A==null)return{};const q=typeof A=="number"?`${A}px`:`${A}`;return{width:q,minWidth:q}});let u=null,d=0,m=0,f=null,p=null,y=null;const h=()=>$(),g=()=>w();e.watch(()=>a.target,async A=>{if(N(),!A){f=null,r.value=[],n.value="";return}f=A,s.value&&(await e.nextTick(),_(A),w())},{immediate:!0}),e.watch(()=>a.scrollContainer,A=>{if(!s.value){p=A??null;return}b(A??null),e.nextTick(()=>w())},{immediate:!0}),e.onMounted(()=>{a.scrollContainer||b(null),w()}),e.onBeforeUnmount(()=>{N(),b(null,!0),f=null,typeof window<"u"&&(d&&window.cancelAnimationFrame(d),m&&window.cancelAnimationFrame(m))});function b(A,q=!1){if(y&&(y(),y=null),q){p=null;return}if(p=A??null,typeof window>"u")return;const Q=A??window,R=window;Q.addEventListener("scroll",h,{passive:!0}),R.addEventListener("resize",g),y=()=>{Q.removeEventListener("scroll",h),R.removeEventListener("resize",g)}}function w(){if(!s.value||!f)return;d&&typeof window<"u"&&window.cancelAnimationFrame(d);const A=()=>{x(),d=0};typeof window>"u"?A():d=window.requestAnimationFrame(A)}function x(){if(!s.value||!f)return;const A=Array.from(f.querySelectorAll("h1, h2")),q=new Set,Q=[];A.forEach((R,I)=>{var me;const F=((me=R.textContent)==null?void 0:me.trim())??"";if(!F)return;let D=(R.getAttribute("id")??"").trim();D||(D=k(F)||`heading-${I+1}`);let z=D,ee=1;for(;q.has(z);)z=`${D}-${ee+=1}`;R.id!==z&&Object.assign(R,{id:z}),q.add(z),Q.push({id:z,text:F,level:R.tagName.toLowerCase()==="h1"?1:2})}),r.value=Q,Q.length||(n.value=""),P()}function k(A){return A.toLowerCase().replace(/[^a-z0-9\s-]/g,"").trim().replace(/\s+/g,"-")}function _(A){!A||!s.value||typeof MutationObserver>"u"||(N(),u=new MutationObserver(()=>w()),u.observe(A,{childList:!0,subtree:!0}))}function N(){u&&(u.disconnect(),u=null)}function V(A){const q=p;if(!q)return typeof window>"u"?A.offsetTop:A.getBoundingClientRect().top+window.scrollY;const Q=A.getBoundingClientRect(),R=q.getBoundingClientRect();return Q.top-R.top+q.scrollTop}function P(){if(!s.value||!r.value.length)return;const A=p,q=(A?A.scrollTop:null)||(typeof window<"u"?window.scrollY:0),Q=(A?A.clientHeight:null)||(typeof window<"u"?window.innerHeight:0),R=q+Q;let I=null;for(let D=0;D<r.value.length;D+=1){const z=r.value[D],ee=document.getElementById(z.id);if(ee){const me=V(ee);me+ee.offsetHeight>q&&me<R&&(I=z.id)}}!I&&o.value&&(I=o.value),I&&(o.value=I);const F=A?A.scrollHeight-A.clientHeight:document.documentElement.scrollHeight-window.innerHeight;q+5>=F&&(I=r.value[r.value.length-1].id),I&&(n.value=I)}function $(){s.value&&(m&&window.cancelAnimationFrame(m),m=window.requestAnimationFrame(()=>{P(),m=0}))}function M(A){if(!s.value)return;const q=document.getElementById(A);if(!q)return;const Q=p,R=Math.max(0,V(q));Q?Q.scrollTo({top:R,behavior:"smooth"}):typeof window<"u"&&window.scrollTo({top:R,behavior:"smooth"})}return t({refresh:w}),(A,q)=>s.value&&r.value.length?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(i.value),style:e.normalizeStyle(c.value)},[e.createElementVNode("h2",Lk,e.toDisplayString(A.title),1),e.createElementVNode("div",$k,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,Q=>(e.openBlock(),e.createElementBlock("div",{key:Q.id,class:e.normalizeClass(["vs-compact-form-navigation__item relative",Q.level===2?"vs-compact-form-navigation__item--nested":"",Q.id===n.value?"vs-compact-form-navigation__item--active":""])},[e.createElementVNode("button",{type:"button",onClick:R=>M(Q.id),class:e.normalizeClass(["vs-compact-form-navigation__button flex gap-x-3 py-[6px] pr-3 text-sm duration-200 hover:text-gray-800",Q.level===2?"pl-[15px]":"pl-[18px]",Q.id===n.value?"text-gray-800":"text-gray-500"])},[e.createElementVNode("span",null,e.toDisplayString(Q.text),1)],10,Fk)],2))),128))])],6)):e.createCommentVNode("",!0)}}),Ok=_e(Ik,[["__scopeId","data-v-1584a562"]]),is={required:"Це поле є обов’язковим",email:"Неправильний email"},Pk=l=>l?!1:is.required,Rk=l=>l?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(l)?!1:is.email:!1,Uk=(l,t)=>{const a=t.pattern??t.regexp;return!(typeof a=="string"?new RegExp(a):a).test(l)&&l?t.message:!1},jk=(l,t)=>!1,zk=(l,t)=>{switch(typeof t=="string"?t:t.type){case"required":return Pk(l);case"email":return Rk(l);case"regexp":return Uk(l,t);case"custom":return jk();default:return!1}},Hk={autocomplete:"select",combobox:"select",datepicker:"date",markedtext:"mask",html:"static",geom:"map",filelist:"file-list",datalist:"datatable",file:"file",dropzone:"file"};function cs(l){const t=l.toLowerCase();return Hk[t]||t}function $r(l,t=!1){if(Array.isArray(l)){const r=[];return l.forEach(n=>{const o={...n};o.name=(n.name||n.id||n.key||"").toString(),o.type=cs(n.type),o.label=n.label||n.ua,o.rules=n.rules||n.validators,o.type==="email"&&!o.rules&&(o.rules=["email"]),n.data&&(o.api=`/api/suggest/${n.data}`),o.disabled=t||o.disabled,Array.isArray(o.schema)&&(o.schema=$r(o.schema,o.disabled)),r.push(o)}),r}const a=[];return Object.entries(l).forEach(r=>{const n={name:r[0],...r[1],type:cs(r[1].type),label:r[1].label||r[1].ua,rules:r[1].rules||r[1].validators,disabled:t};n.type==="email"&&!n.rules&&(n.rules=["email"]),r[1].type.includes("list")&&(n.multiple=!0),!n.api&&r[1].data&&(n.api=`/api/suggest/${r[1].data}`),Array.isArray(n.schema)&&(n.schema=$r(n.schema,n.disabled)),a.push(n)}),a}function qk(l,t,a=!1){const r=e.computed(()=>$r(t,typeof a=="boolean"?a:a.value)),n=e.ref({});function o(c){var f;const u=c==null?void 0:c.conditions;if(!u)return!0;const d=Array.isArray(u)?u[0]:u,m=(f=l==null?void 0:l.value)==null?void 0:f[d];return ns(m,u)}const s=(c=r.value,u=!0)=>(c.forEach(d=>{if(d.rules){if(!o(d)){delete n.value[d.name];return}let m=!1,f=null;d.rules.forEach(p=>{const y=zk(l.value[d.name],p);y&&(m=!0,!f&&typeof y=="string"&&(f=y))}),m&&f?n.value[d.name]=f:delete n.value[d.name]}d.schema&&s(d.schema,!1)}),u&&Object.values(n.value).some(Boolean)?n.value:null),i=e.computed(()=>{var c;return(c=r.value)==null?void 0:c.filter(u=>u.hidden!==!0&&o(u))});return{errors:n,validate:s,reset:()=>{l.value={},n.value={}},visibleSchema:i}}const Gk={class:"flex w-full h-full min-h-0 gap-6"},Wk={key:0,"data-orientation":"horizontal",role:"none",class:"mt-1 shrink-0 h-[1px] w-full bg-slate-100 dark:bg-slate-600"},Xe=e.defineComponent({__name:"vs-compact-form",props:e.mergeModels({schema:{default:()=>[]},style:{default:()=>({})},modelValue:{},layout:{default:()=>"default"},formId:{default:()=>""},disabled:{type:Boolean,default:!1},navigation:{type:Boolean,default:!1},navWidth:{default:400},columns:{}},{form:{default:()=>({})},formModifiers:{},values:{default:()=>({})},valuesModifiers:{}}),emits:e.mergeModels(["handle-submit","update:modelValue"],["update:form","update:values"]),setup(l,{expose:t,emit:a}){const r=a,n=l,o=e.useModel(l,"form"),s=e.useModel(l,"values"),{errors:i,validate:c,reset:u,visibleSchema:d}=qk(s,n.schema,e.toRef(n,"disabled")),m=e.ref(null),f=e.ref(null),p=e.computed(()=>n.navigation),y=e.computed(()=>n.navWidth),h=e.computed(()=>{var P;return(P=n.style)==null?void 0:P.columns}),g=Object.freeze({container:12,label:3}),b=e.computed(()=>n.columns??h.value??g),w=e.computed(()=>n.columns!=null||h.value!=null),x=e.computed(()=>w.value?"horizontal":n.layout),k=P=>P!=null&&P.columns?"horizontal":x.value,_=P=>(P==null?void 0:P.columns)??b.value,N=()=>{r("update:modelValue",s.value),c(),r("handle-submit",s.value)};t({validate:c,reset:u,errors:i}),e.onMounted(()=>{n.modelValue&&(s.value=n.modelValue),o.value={value:s.value,errors:i.value,reset:u,validate:c,formId:n.formId}});function V(P,$){if(P===$)return!0;if(typeof P!="object"||typeof $!="object"||!P||!$)return!1;const M=Object.keys(P),A=Object.keys($);return M.length!==A.length?!1:M.every(q=>P[q]===$[q])}return e.provide("form",o),e.provide("values",s),(P,$)=>(e.openBlock(),e.createElementBlock("div",Gk,[e.createElementVNode("div",{class:"flex-1 min-h-0 overflow-y-auto overflow-x-visible",ref_key:"formScrollContainer",ref:f},[e.createElementVNode("form",{ref_key:"formRef",ref:m,onSubmit:e.withModifiers(N,["prevent"]),class:e.normalizeClass(["grid grid-cols-12 p-1",x.value==="default"?"gap-6":"gap-4"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(d),(M,A)=>(e.openBlock(),e.createElementBlock("div",{key:M.name,class:e.normalizeClass(k(M)==="horizontal"?"col-span-12":`col-span-${M.col||12}`)},[e.createVNode(ss,{style:e.normalizeStyle(P.style),item:M,layout:k(M),columns:_(M),"model-value":s.value[M.name],"onUpdate:modelValue":q=>{const Q=s.value[M.name];V(Q,q)||(s.value[M.name]=q)},error:e.unref(i)[M.name]},null,8,["style","item","layout","columns","model-value","onUpdate:modelValue","error"]),k(M)==="settings"&&A+1!==e.unref(d).length?(e.openBlock(),e.createElementBlock("div",Wk)):e.createCommentVNode("",!0)],2))),128))],34)],512),e.createVNode(Ok,{target:m.value,"scroll-container":f.value,enabled:p.value,width:y.value},null,8,["target","scroll-container","enabled","width"])]))}}),Kk={class:"relative"},Yk={class:"w-full h-full fixed top-0 start-0 z-[1000] bg-black bg-opacity-50"},Xk={class:"m-[10px] fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 min-h-0 h-fit max-h-[80vh] overflow-hidden opacity-1 flex flex-col bg-white dark:bg-[#1A1A1A] border dark:border-[#454545] pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl lg:w-7/12 w-11/12"},Zk={class:"py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]"},Qk={class:"font-medium text-gray-800 dark:text-[#ffffff]"},Jk={class:"p-4 mim-h-0 h-full overflow-auto"},ex=e.defineComponent({__name:"modal-edit",props:{schema:{},defaultValue:{},mode:{},token:{},form:{}},emits:["close","save","edit"],setup(l,{emit:t}){const a=l,r=t,n=e.ref(a.schema),o=e.ref(a.defaultValue?JSON.parse(JSON.stringify(a.defaultValue)):{}),s=e.ref({}),i=e.ref(),c=e.ref(a.mode);async function u(){const m=s.value.validate();if(m){xe({type:"warning",title:"Помилка валідації",message:Object.entries(m).map(([f,p])=>`${f}: ${p}`).join(`
229
- `)});return}if(i.value)try{const f=await fetch(`/api/table/${i.value}`,{method:c.value==="add"?"POST":"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(o.value)});if(f.ok)await f.json(),xe({type:"success",title:"Успішно",message:`Дані успішно ${c.value==="add"?"збережено":"оновлено"}`}),r("save",o.value);else if(f.status===400){const p=await f.json().catch(()=>({}));xe({type:"warning",title:"Помилка валідації",message:p.message||"Некоректні дані (400)"})}else f.status===500?xe({type:"error",title:"Серверна помилка",message:"Виникла помилка на сервері (500)"}):xe({type:"error",title:"Помилка",message:`Статус: ${f.status}`})}catch(f){xe({type:"error",title:"Помилка з’єднання",message:f.message||"Не вдалося виконати запит"})}}function d(){r("close")}return e.onMounted(async()=>{try{if(a.form){const m=await fetch(`/api/template/form/${a.form}`);if(!m.ok){xe({type:m.status>=400&&m.status<500?"warning":"error",title:"Error",message:`Error code: ${m.status}`});return}const f=await m.json();n.value=f.schema,i.value=f.token}else if(a.token){i.value=a.token;const m=await fetch(`/api/form/${i.value}`);if(!m.ok){xe({type:m.status>=400&&m.status<500?"warning":"error",title:"Error",message:`Error code: ${m.status}`});return}const f=await m.json();n.value=f.schema,f.data?o.value=f.data:c.value="add"}}catch(m){xe({type:"error",title:"Error",message:m.message||"Unexpected error"}),console.error(m)}}),(m,f)=>(e.openBlock(),e.createElementBlock("div",Kk,[e.createElementVNode("div",Yk,[e.createElementVNode("div",Xk,[e.createElementVNode("div",Zk,[e.createElementVNode("h3",Qk,e.toDisplayString(c.value==="add"?"Додати":"Змінити"),1),e.createElementVNode("button",{onClick:d,type:"button",class:"size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600"},f[2]||(f[2]=[e.createElementVNode("span",{class:"sr-only"},"Close",-1),e.createElementVNode("svg",{class:"flex-shrink-0 w-4 h-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"},[e.createElementVNode("path",{d:"M18 6 6 18"}),e.createElementVNode("path",{d:"m6 6 12 12"})],-1)]))]),e.createElementVNode("div",Jk,[n.value?(e.openBlock(),e.createBlock(Xe,{key:0,schema:n.value,values:o.value,"onUpdate:values":f[0]||(f[0]=p=>o.value=p),form:s.value,"onUpdate:form":f[1]||(f[1]=p=>s.value=p)},null,8,["schema","values","form"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:"vs-form__head mr-5 mb-5 mt-3 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white"},[e.createElementVNode("button",{type:"button",onClick:d,class:"vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-red-500 hover:border-red-500 hover:bg-red-500 focus:ring-red-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 mr-2"}," Скасувати "),e.createElementVNode("button",{onClick:u,type:"button",class:"vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border-1 border-transparent text-white bg-blue-500 hover:bg-blue-600 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1"}," Зберегти ")])])])]))}}),ds=(l={mode:"edit",schema:null})=>new Promise(t=>{const{close:a}=Mf({title:l.mode==="add"?"Додати":"Редагувати",template:"",visible:!0,size:"medium",closeClickBack:!0,content:ex,contentProps:{...l,onClose:()=>{t(null),a()},onSave:r=>{t(r),a()}}})});Xe.install=function(l){l.component("VForm",Xe),Object.assign(l.config.globalProperties,{$form:ds}),l.provide("form",ds),window.v3plugin||(window.v3plugin={})};const Mt=(l,t)=>{const a=l.__vccOpts||l;for(const[r,n]of t)a[r]=n;return a},tx={},lx={xmlns:"http://www.w3.org/2000/svg",width:"15px",height:"24",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-reload absolute inline mr-1 text-gray-800 transition-all cursor-pointer active:rotate-90 right-1 top-1 hover:text-blue-500"};function ax(l,t){return e.openBlock(),e.createElementBlock("svg",lx,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M19.933 13.041a8 8 0 1 1 -9.925 -8.788c3.899 -1 7.935 1.007 9.425 4.747"},null,-1),e.createElementVNode("path",{d:"M20 4v5h-5"},null,-1)])])}const rx=Mt(tx,[["render",ax]]),nx={class:"flex items-center justify-between w-full text-sm"},ox={class:"flex items-center cursor-pointer w-full"},sx={key:0,width:"16",height:"auto",src:"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMTYgMTYnIGZpbGw9J3doaXRlJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnPjxwYXRoIGQ9J00xMi4yMDcgNC43OTNhMSAxIDAgMDEwIDEuNDE0bC01IDVhMSAxIDAgMDEtMS40MTQgMGwtMi0yYTEgMSAwIDAxMS40MTQtMS40MTRMNi41IDkuMDg2bDQuMjkzLTQuMjkzYTEgMSAwIDAxMS40MTQgMHonLz48L3N2Zz4="},ix=["value"],cx={class:"w-[calc(100%-18px)] flex flex-row items-center justify-between pl-[10px]"},dx={class:"flex flex-row items-center font-normal text-gray-800 gap-x-1"},ux={key:0,class:"text-xs text-gray-500 dark:text-neutral-500 pr-1"},Fr=e.defineComponent({__name:"list-item",props:{layout:{},count:{},type:{},label:{},value:{},isSelected:{type:Boolean},color:{},highlighted:{type:Boolean}},emits:["itemClick"],setup(l,{expose:t,emit:a}){const r=l,n=a;function o(){n("itemClick",r.value)}const s=e.ref(null);return t({el:s}),(i,c)=>(e.openBlock(),e.createElementBlock("div",{class:"flex items-center w-full rounded-lg group hover:bg-gray-100",ref_key:"el",ref:s},[e.createElementVNode("div",nx,[e.createElementVNode("div",ox,[e.createElementVNode("label",{for:"radio-9740",class:e.normalizeClass([["inline","popover"].includes(l.layout)?"text-sm text-gray-500 px-2 w-full py-2 cursor-pointer !flex flex-row items-center":"flex flex-row items-center w-full px-2 py-2 text-sm text-gray-500 cursor-pointer",{"bg-blue-100":l.highlighted}]),onClick:e.withModifiers(o,["stop","prevent"])},[e.createElementVNode("div",{class:e.normalizeClass(["w-[18px] h-[18px] border flex items-center justify-center",[l.type=="checkbox"?"rounded-[4px]":"rounded-full",l.color?`bg-[${l.color}] border-[#ffffff]`:l.isSelected?"bg-[#2563eb] border-[#ffffff]":"bg-[#ffffff] border-[#d9d9d9]"]])},[l.isSelected?(e.openBlock(),e.createElementBlock("img",sx)):e.createCommentVNode("",!0)],2),e.createElementVNode("input",{type:"checkbox",class:"hidden",id:"radio-9740",value:l.value},null,8,ix),e.createElementVNode("div",cx,[e.createElementVNode("span",dx,e.toDisplayString(l.label??"Відсутні данні"),1),l.count?(e.openBlock(),e.createElementBlock("div",ux," ("+e.toDisplayString(l.count)+") ",1)):e.createCommentVNode("",!0)])],2)])])],512))}});function us(l,t){const{options:a=[],limit:r=20}=l;function n(x){return Array.isArray(x)?x[0]:x}const o=e.ref(n(l.modelValue)),s=e.ref(""),i=e.ref(!1),c=e.ref([]),u=e.ref("id"),d=e.ref("text"),m=e.ref(!1),f=e.ref(l.layout!=="popover"&&a.length>r);function p(x){const k=x.find(Boolean)??{},_=["id","value","code","key"].find(V=>V in k)??"id",N=["text","label","name","title"].find(V=>V in k)??"text";return{autoValueKey:_,autoLabelKey:N}}if(a.length>0){const x=p(a);u.value=x.autoValueKey,d.value=x.autoLabelKey}const y=e.computed(()=>{const x=c.value;return l.layout==="popover"||m.value?x:x.slice(0,r)});e.watch(()=>l.modelValue,x=>{o.value=n(x)},{immediate:!0}),c.value=[...a].sort((x,k)=>l.sort==="count"?k.count&&x.count?k.count-x.count:0:l.sort==="name"?String(x[d.value]??"").localeCompare(String(k[d.value]??"")):0);function h(x){return o.value===x[u.value]}function g(x){o.value=x[u.value],t("update:modelValue",o.value),t("change",{name:l.name,value:o.value})}function b(){o.value=void 0,t("update:modelValue",o.value),t("clear",l.name)}function w(){m.value=!m.value}return{innerValue:o,searchTerm:s,filteredOptions:y,isSelected:h,selectItem:g,clear:b,toggleShowAll:w,isReqProc:i,showAll:m,isEnableShowAll:f,labelKey:d,valueKey:u,allOptions:c}}const mx={},px={class:"w-48 mx-auto",viewBox:"0 0 178 90",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function fx(l,t){return e.openBlock(),e.createElementBlock("svg",px,[...t[0]||(t[0]=[e.createStaticVNode('<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>',12)])])}const Ir=Mt(mx,[["render",fx]]),hx={},gx={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",class:"icon icon-tabler icons-tabler-outline icon-tabler-chevron-down w-[14px] rotate"};function bx(l,t){return e.openBlock(),e.createElementBlock("svg",gx,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)])])}const Sa=Mt(hx,[["render",bx]]),yx={},kx={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",class:"icon icon-tabler icons-tabler-outline icon-tabler-chevron-down w-[14px] rotate-[180deg]"};function xx(l,t){return e.openBlock(),e.createElementBlock("svg",kx,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)])])}const Or=Mt(yx,[["render",xx]]),wx={key:0,class:"w-full"},_x={class:"flex flex-col items-center justify-center p-5 text-center"},Ex={key:0,class:"flex justify-between p-2 border-t bg-gray-50 text-xs text-gray-500"},Cx={key:1,class:"flex justify-between items-center text-xs text-gray-500 p-1 border-t"},Vx=e.defineComponent({__name:"radio",props:{id:{},name:{},title:{},type:{},label:{},width:{},options:{default:()=>[]},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean,default:!1},layout:{default:"inline"},cleanable:{type:Boolean},limit:{default:10},multi:{type:Boolean},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{},ua:{}},emits:["update:modelValue","change","clear"],setup(l,{expose:t,emit:a}){const r=l,n=e.ref(null),o=a,{innerValue:s,filteredOptions:i,isSelected:c,selectItem:u,clear:d,toggleShowAll:m,isReqProc:f,showAll:p,isEnableShowAll:y,labelKey:h,valueKey:g,allOptions:b}=us({...r,modelValue:r.modelValue??r.default??""},o);return t({clear:d,inputTextRef:n}),e.watch(()=>r.modelValue,w=>{w===void 0&&(s.value=void 0)}),(w,x)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([l.layout==="popover"?"flex flex-col h-full":"flex flex-col vs-filter-checkbox"])},[e.createElementVNode("div",{class:e.normalizeClass([l.layout==="popover"?"flex-1 overflow-y-auto max-h-64 p-2":"",l.layout==="inline"?"flex-1 overflow-y-auto max-h-80":""])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(i),k=>(e.openBlock(),e.createBlock(Fr,{layout:l.layout,key:k[e.unref(g)],count:k.count,label:k[e.unref(h)],color:k.color,type:"radio",value:k[e.unref(g)],"is-selected":e.unref(c)(k),onItemClick:_=>e.unref(u)(k)},null,8,["layout","count","label","color","value","is-selected","onItemClick"]))),128))],2),l.type==="select"&&e.unref(i).length===0&&!e.unref(f)?(e.openBlock(),e.createElementBlock("div",wx,[e.createElementVNode("div",_x,[e.createVNode(Ir),x[4]||(x[4]=e.createElementVNode("div",{class:"max-w-sm mx-auto mt-6"},[e.createElementVNode("p",{class:"font-medium text-gray-800 dark:text-neutral-200"},"За вашим запитом нічого не знайдено"),e.createElementVNode("p",{class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"})],-1))])])):e.createCommentVNode("",!0),l.layout!=="popover"&&l.type!=="select"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[!e.unref(p)&&e.unref(y)?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:x[0]||(x[0]=(...k)=>e.unref(m)&&e.unref(m)(...k)),class:"inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"},[x[5]||(x[5]=e.createTextVNode(" Показати більше ",-1)),e.createVNode(Sa)])):e.createCommentVNode("",!0),e.unref(p)?(e.openBlock(),e.createElementBlock("div",{key:1,onClick:x[1]||(x[1]=(...k)=>e.unref(m)&&e.unref(m)(...k)),class:"inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"},[x[6]||(x[6]=e.createTextVNode(" Показати менше ",-1)),e.createVNode(Or)])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),l.cleanable?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[l.layout==="inline"?(e.openBlock(),e.createElementBlock("div",Ex,[e.createTextVNode(e.toDisplayString(e.unref(s)||e.unref(s)===null?1:0)+" з "+e.toDisplayString(e.unref(b).length)+" обрано ",1),e.withDirectives(e.createElementVNode("button",{class:"text-gray-600 hover:text-gray-800",onClick:x[2]||(x[2]=(...k)=>e.unref(d)&&e.unref(d)(...k))}," Очистити ",512),[[e.vShow,e.unref(s)!==""&&e.unref(s)!==void 0]])])):e.createCommentVNode("",!0),l.layout==="popover"?(e.openBlock(),e.createElementBlock("div",Cx,[e.createElementVNode("span",null,e.toDisplayString(e.unref(s)||e.unref(s)===null?1:0)+" з "+e.toDisplayString(e.unref(b).length)+" обрано",1),e.withDirectives(e.createElementVNode("button",{class:"text-gray-600 hover:text-gray-800",onClick:x[3]||(x[3]=(...k)=>e.unref(d)&&e.unref(d)(...k))}," Очистити ",512),[[e.vShow,e.unref(s)!==""&&e.unref(s)!==void 0]])])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],2))}});function ms(l,t){const{options:a=[],limit:r=20}=l;function n(x){return Array.isArray(x)?x:x?[x]:[]}const o=e.ref(n(l.modelValue)),s=e.ref(""),i=e.ref(!1),c=e.ref([]),u=e.ref("id"),d=e.ref("text"),m=e.ref(!1),f=e.ref(l.layout!=="popover"&&a.length>r);function p(x){const k=x.find(Boolean)??{},_=["id","value","code","key"].find(V=>V in k)??"id",N=["text","label","name","title"].find(V=>V in k)??"text";return{autoValueKey:_,autoLabelKey:N}}if(a.length>0){const x=p(a);u.value=x.autoValueKey,d.value=x.autoLabelKey}const y=e.computed(()=>{const x=c.value;return l.layout==="popover"||m.value?x:x.slice(0,r)});e.watch(()=>l.modelValue,x=>{o.value=n(x)},{immediate:!0}),c.value=[...a].sort((x,k)=>l.sort==="count"?k.count&&x.count?k.count-x.count:0:l.sort==="name"?String(x[d.value]).localeCompare(String(k[d.value])):0);function h(x){return o.value&&o.value.includes(x[u.value])}function g(x){const k=o.value.includes(x[u.value]);o.value=k?o.value.filter(_=>_!==x[u.value]):[...o.value,x[u.value]],t("update:modelValue",o.value),t("change",{name:l.name,value:o.value})}function b(){o.value=[],t("update:modelValue",o.value),t("clear",l.name)}function w(){m.value=!m.value}return{innerValue:o,searchTerm:s,filteredOptions:y,isSelected:h,selectItem:g,clear:b,toggleShowAll:w,isReqProc:i,showAll:m,isEnableShowAll:f,labelKey:d,valueKey:u,allOptions:c}}const ps={en:{search:"Search",more:"Show more",less:"Show less",selected:"selected",clear:"Clear",notfound:"Nothing found",period:"Period",today:"Today",week:"Week",month:"Month",quarter:"Quarter",year:"Year",alltime:"All Time",prev:"Prev",next:"Next"},uk:{search:"Пошук",more:"Показати більше",less:"Показати меньше",selected:"обрано",clear:"Очистити",notfound:"Нічого не знайдено",period:"Період",today:"Сьогодні",week:"Тиждень",month:"Місяць",quarter:"Квартал",year:"Рік",alltime:"Весь час",prev:"Попередній період",next:"Настпуний період"}};function Nx(l){const t=l.split(".")[1];return(ps[localStorage.locale||navigator.language]||ps.uk)[t]}function vl(){const l=e.getCurrentInstance();return l.appContext.config.globalProperties.$i18n?l.appContext.config.globalProperties.$t:Nx}const vx={key:0,class:"w-full"},Bx={class:"flex flex-col items-center justify-center p-5 text-center"},Sx={class:"max-w-sm mx-auto mt-6"},Dx={class:"font-medium text-gray-800 dark:text-neutral-200"},Ax={key:0,class:"flex justify-between p-2 border-t bg-gray-50 text-xs text-gray-500"},Mx={key:1,class:"flex justify-between items-center text-xs text-gray-500 p-1 border-t"},fs=e.defineComponent({__name:"checkbox",props:{id:{},name:{},title:{},type:{},label:{},width:{},options:{default:()=>[]},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean,default:!1},layout:{default:"inline"},cleanable:{type:Boolean},limit:{default:10},multi:{type:Boolean},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{},ua:{}},emits:["update:modelValue","change","clear"],setup(l,{expose:t,emit:a}){const r=vl(),n=l,o=a,{innerValue:s,filteredOptions:i,isSelected:c,selectItem:u,clear:d,toggleShowAll:m,isReqProc:f,showAll:p,isEnableShowAll:y,labelKey:h,valueKey:g,allOptions:b}=ms({...n,modelValue:n.modelValue},o);return e.watch(()=>n.modelValue,w=>{w===void 0&&(s.value=[])}),t({clear:d}),(w,x)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([l.layout==="popover"?"flex flex-col h-full":"flex flex-col vs-filter-checkbox space-y-0.5"])},[e.createElementVNode("div",{class:e.normalizeClass([l.layout==="popover"?"flex-1 overflow-y-auto max-h-64 p-2":"",l.layout==="inline"?"flex-1 overflow-y-auto max-h-80":""])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(i),k=>(e.openBlock(),e.createBlock(Fr,{layout:l.layout,count:k.count,label:k[e.unref(h)],color:k.color,type:"checkbox",value:k[e.unref(g)],"is-selected":e.unref(c)(k),onItemClick:_=>e.unref(u)(k)},null,8,["layout","count","label","color","value","is-selected","onItemClick"]))),256))],2),l.type==="select"&&e.unref(i).length===0&&!e.unref(f)?(e.openBlock(),e.createElementBlock("div",vx,[e.createElementVNode("div",Bx,[e.createVNode(Ir),e.createElementVNode("div",Sx,[e.createElementVNode("p",Dx,e.toDisplayString(e.unref(r)("filter.notfound")),1),x[4]||(x[4]=e.createElementVNode("p",{class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"},null,-1))])])])):e.createCommentVNode("",!0),l.layout!=="popover"&&l.type!=="select"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[!e.unref(p)&&e.unref(y)?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:x[0]||(x[0]=(...k)=>e.unref(m)&&e.unref(m)(...k)),class:"inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"},[e.createTextVNode(e.toDisplayString(e.unref(r)("filter.more"))+" ",1),e.createVNode(Sa)])):e.createCommentVNode("",!0),e.unref(p)?(e.openBlock(),e.createElementBlock("div",{key:1,onClick:x[1]||(x[1]=(...k)=>e.unref(m)&&e.unref(m)(...k)),class:"inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"},[e.createTextVNode(e.toDisplayString(e.unref(r)("filter.less"))+" ",1),e.createVNode(Or)])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),l.cleanable?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[l.layout==="inline"?(e.openBlock(),e.createElementBlock("div",Ax,[e.createTextVNode(e.toDisplayString(e.unref(s).length)+" / "+e.toDisplayString(e.unref(b).length)+" "+e.toDisplayString(e.unref(r)("filter.selected"))+" ",1),e.withDirectives(e.createElementVNode("button",{class:"text-gray-600 hover:text-gray-800",onClick:x[2]||(x[2]=(...k)=>e.unref(d)&&e.unref(d)(...k))},e.toDisplayString(e.unref(r)("filter.clear")),513),[[e.vShow,e.unref(s).length!==0]])])):e.createCommentVNode("",!0),l.layout==="popover"?(e.openBlock(),e.createElementBlock("div",Mx,[e.createElementVNode("span",null,e.toDisplayString(e.unref(s).length)+" / "+e.toDisplayString(e.unref(b).length)+" "+e.toDisplayString(e.unref(r)("filter.selected")),1),e.withDirectives(e.createElementVNode("button",{class:"text-gray-600 hover:text-gray-800",onClick:x[3]||(x[3]=(...k)=>e.unref(d)&&e.unref(d)(...k))},e.toDisplayString(e.unref(r)("filter.clear")),513),[[e.vShow,e.unref(s).length!==0]])])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],2))}}),Tx={},Lx={xmlns:"http://www.w3.org/2000/svg",width:"15px",height:"15px",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-search stroke-gray-500 transition-all"};function $x(l,t){return e.openBlock(),e.createElementBlock("svg",Lx,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"},null,-1),e.createElementVNode("path",{d:"M21 21l-6 -6"},null,-1)])])}const hs=Mt(Tx,[["render",$x]]),Fx={},Ix={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-x stroke-gray-500 hover:stroke-red-500 transition-all",width:"15px",height:"15px"};function Ox(l,t){return e.openBlock(),e.createElementBlock("svg",Ix,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M18 6l-12 12"},null,-1),e.createElementVNode("path",{d:"M6 6l12 12"},null,-1)])])}const gs=Mt(Fx,[["render",Ox]]);class Pr{static getWidthClass(t){return typeof t=="number"?`max-w-[${t}px]`:typeof t=="string"?t.endsWith("%")||t.endsWith("px")?`max-w-[${t}]`:`max-w-${t}`:"w-full"}}const Px={class:"absolute bottom-2/4 translate-y-2/4 cursor-pointer left-3"},Rx=["placeholder"],Ux=e.defineComponent({__name:"text-input",props:{id:{},name:{},title:{},type:{},label:{},width:{default:220},options:{},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean},layout:{default:"inline"},cleanable:{type:Boolean},limit:{},multi:{type:Boolean},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{},ua:{}},emits:["update:modelValue","change","clear"],setup(l,{emit:t}){var u;const a=l,r=e.ref((a.placeholder||a.label||a.title||a.name||"search").toString()),n=t,o=e.ref(((u=a.modelValue)==null?void 0:u.toString())??"");e.watch(()=>a.modelValue,d=>{d!==o.value&&(o.value=(d==null?void 0:d.toString())??"")});let s=null;function i(){if(o.value=o.value.trimStart(),o.value.length===0){c();return}s&&clearTimeout(s),s=setTimeout(()=>{n("update:modelValue",o.value),n("change",{name:a.name,value:o.value})},300)}function c(){o.value="",n("update:modelValue",""),n("clear",a.name)}return(d,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["vs-form-text relative bg-white rounded-lg [&>input]:py-[7px] [&>input]:max-h-[38px] [&>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",l.layout==="inline"?e.unref(Pr).getWidthClass(l.width):"mb-2"+(l.layout==="popover"?" m-2":"")])},[e.createElementVNode("div",Px,[e.createVNode(hs)]),o.value!==""?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:c,class:"absolute bottom-2/4 translate-y-2/4 right-3 cursor-pointer"},[e.createVNode(gs)])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":m[0]||(m[0]=f=>o.value=f),onInput:i,placeholder:r.value,class:"!pr-7 !pl-8 bg-white h-[38px] min-w-[100px] text-sm py-2 px-3 block w-full border border-solid placeholder:text-nowrap border-stone-200 rounded-lg text-sm text-stone-800 placeholder:text-stone-400 focus:border-2 focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"},null,40,Rx),[[e.vModelText,o.value]])],2))}});function bs(l={color:"blue"}){return e.computed(()=>{const t=`w-full px-3 py-2 border-solid border border-gray-300 text-sm rounded focus:outline-none focus:ring-2 focus:ring-${l.color}-500 focus:border-transparent`;return(l==null?void 0:l.size)==="sm"?`${t}h-[32px]`:`${t}h-[38px]`})}function jx(){return"rounded-md font-medium border-gray-200 border-solid disabled:pointer-events-none disabled:opacity-50 px-4 py-2 w-full bg-transparent border text-black text-sm h-[38px]"}function zx(){return"font-medium border-gray-200 border-solid disabled:pointer-events-none disabled:opacity-50 border h-7 rounded-md text-xs px-2 py-1 hover:bg-gray-100"}function ys(l){return l==="ghost"?"inline-flex relative py-2 px-4 items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent text-gray-600 hover:bg-blue-100 hover:text-gray-800 focus:outline-hidden focus:bg-gray-100 focus:text-gray-800 disabled:opacity-50 disabled:pointer-events-none dark:text-gray-500 dark:hover:bg-blue-800/30 dark:hover:text-blue-400 dark:focus:bg-blue-800/30 dark:focus:text-blue-400":l==="soft"?"inline-flex relative py-2 px-4 items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 hover:bg-gray-200 focus:outline-hidden focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:text-blue-400 dark:hover:bg-blue-900 dark:focus:bg-blue-900":"relative border-solid border-gray-200 focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border-input hover:bg-gray-100 border px-4 py-2 gap-2 bg-transparent h-[38px]"}const Hx={key:0,class:"block text-xs font-medium text-gray-600 mb-1"},qx=["placeholder","disabled"],Gx={key:0,class:"block text-xs font-medium text-gray-600 mb-1"},Wx={key:0,class:"block text-xs font-medium text-gray-600 mb-1"},Kx=["placeholder","disabled"],Yx=["disabled"],Xx=e.defineComponent({__name:"range-input",props:{id:{},name:{},title:{},type:{},label:{},width:{},options:{},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean,default:!1},layout:{default:"inline"},cleanable:{type:Boolean},limit:{},multi:{type:Boolean},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{},ua:{}},emits:["update:modelValue","change","clear"],setup(l,{expose:t,emit:a}){const r=bs(),n=jx(),o=vl(),s=l,i=e.ref(s.modelValue??s.default??[]),c=a,u=e.computed({get:()=>s.modelValue??i.value,set:f=>{s.modelValue!==void 0?c("update:modelValue",f):i.value=f}});function d(){c("change",{name:s.name,value:u.value||i.value})}function m(){i.value=[],u.value=i.value,c("clear",s.name)}return e.watch(()=>s.modelValue,f=>{f!==void 0&&s.layout!=="popover"?(i.value=f,c("update:modelValue",f)):i.value=[]}),t({clear:m,currentValue:u}),(f,p)=>{var y,h;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",null,[e.createElementVNode("div",{class:e.normalizeClass(l.layout==="vertical"?"inline-flex items-center gap-2":"space-y-3 p-2")},[e.createElementVNode("div",null,[l.layout!=="vertical"?(e.openBlock(),e.createElementBlock("label",Hx,e.toDisplayString(e.unref(o)("filter.from")),1)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{type:"number",class:e.normalizeClass(e.unref(r)),placeholder:((y=l.placeholder)==null?void 0:y[0])??"min",step:"1",style:{outline:"none"},"onUpdate:modelValue":p[0]||(p[0]=g=>u.value[0]=g),disabled:l.disabled},null,10,qx),[[e.vModelText,u.value[0]]])]),l.layout==="vertical"?(e.openBlock(),e.createElementBlock("label",Gx," - ")):e.createCommentVNode("",!0),e.createElementVNode("div",null,[l.layout!=="vertical"?(e.openBlock(),e.createElementBlock("label",Wx,e.toDisplayString(e.unref(o)("filter.to")),1)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{type:"number",class:e.normalizeClass(e.unref(r)),placeholder:((h=l.placeholder)==null?void 0:h[1])??"max",min:"0",max:"1000000000000000",step:"1",style:{outline:"none"},"onUpdate:modelValue":p[1]||(p[1]=g=>u.value[1]=g),disabled:l.disabled},null,10,Kx),[[e.vModelText,u.value[1]]])]),["popover","inline","vertical"].includes(l.layout)?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:d,class:e.normalizeClass(e.unref(n)+(l.layout==="vertical"?" w-[50px]":" bg-blue-100 hover:bg-blue-200"))},e.toDisplayString(l.layout==="vertical"?"Ok":e.unref(o)("filter.apply")),3)):e.createCommentVNode("",!0),["popover","inline"].includes(l.layout)?(e.openBlock(),e.createElementBlock("button",{key:2,disabled:!(u.value[0]||u.value[1]),onClick:m,class:e.normalizeClass(e.unref(n)+" hover:bg-gray-100")},e.toDisplayString(e.unref(o)("filter.clear")),11,Yx)):e.createCommentVNode("",!0)],2)]),(l.cleanable&&i.value.length,e.createCommentVNode("",!0))],64)}}});function Zx(l){return String(l).charAt(0).toUpperCase()+String(l).slice(1)}let Ze=class{static format(t){const a=t.getFullYear(),r=(t.getMonth()+1).toString().padStart(2,"0"),n=t.getDate().toString().padStart(2,"0");return`${a}-${r}-${n}`}static getShiftedDay(t,a=0){const r=t?new Date(t):new Date;return r.setDate(r.getDate()+a),this.format(r)}static getLastWeekRange(t,a,r=0){if(t&&a){const u=new Date(t),d=new Date(a);return u.setDate(u.getDate()+r*7),d.setDate(d.getDate()+r*7),[this.format(u),this.format(d)]}const n=new Date,o=n.getDay(),s=o===0?13:o-1+7,i=new Date(n);i.setDate(n.getDate()-s+r*7);const c=new Date(i);return c.setDate(i.getDate()+6),[this.format(i),this.format(c)]}static getMonthRange(t,a,r=0){let n;t?n=new Date(t):n=new Date,n=new Date(n.getFullYear(),n.getMonth()+r,1);const o=n,s=new Date(n.getFullYear(),n.getMonth()+1,0);return[this.format(o),this.format(s)]}static getQuarterRange(t,a,r=0){const n=t||a,o=n?new Date(n):new Date;let s=Math.floor(o.getMonth()/3);s+=r;const i=(s%4+4)%4*3,c=o.getFullYear()+Math.floor(s/4),u=new Date(c,i,1),d=new Date(c,i+3,0);return[this.format(u),this.format(d)]}static getYear(t,a=0){let r;return t&&/^\d{4}$/.test(t)?r=parseInt(t,10):t?r=new Date(t).getFullYear():r=new Date().getFullYear(),String(r+a)}static getYearRange(t,a=0){let r;return t&&/^\d{4}$/.test(t)?r=parseInt(t,10):t?r=new Date(t).getFullYear():r=new Date().getFullYear(),[this.format(new Date(r+a,0,1)),this.format(new Date(r+a+1,0,0))]}static getRangeFromDaysBefore(t){const a=new Date,r=new Date(a.getTime());return r.setDate(a.getDate()-t),[this.format(r),this.format(a)]}};function ks(l,t){const{popoverRef:a}=l,r=vl(),n=e.ref(""),o=e.ref(l.modelValue??l.default??[]),s=e.ref(0);function i(){const b=Ze.getRangeFromDaysBefore(s.value);return o.value=[...b],t("change",{name:l.name,value:o.value}),t("update:modelValue",o.value),b}function c(b){var x;n.value=b,(x=a.value)==null||x.close();const w=[];switch(n.value){case"today":w.push(Ze.getShiftedDay()),w.push(Ze.getShiftedDay());break;case"week":w.push(...Ze.getLastWeekRange());break;case"month":w.push(...Ze.getMonthRange());break;case"quarter":w.push(...Ze.getQuarterRange());break;case"year":w.push(...Ze.getYearRange());break;case"last_7_days":s.value=7,i();break;case"range":s.value=7,w.push(...i());break}o.value=[...w],t("change",{name:l.name,value:o.value}),t("update:modelValue",o.value)}function u(){const b=[];switch(n.value){case"today":b.push(Ze.getShiftedDay(o.value[0],1));break;case"week":b.push(...Ze.getLastWeekRange(o.value[0],o.value[1],1));break;case"month":b.push(...Ze.getMonthRange(o.value[0],o.value[1],1));break;case"quarter":b.push(...Ze.getQuarterRange(o.value[0],o.value[1],1));break;case"year":b.push(...Ze.getYearRange(o.value[0],1));break}o.value=[...b],t("change",{name:l.name,value:o.value}),t("update:modelValue",o.value)}function d(){const b=[];switch(n.value){case"today":b.push(Ze.getShiftedDay(o.value[0],-1));break;case"week":b.push(...Ze.getLastWeekRange(o.value[0],o.value[1],-1));break;case"month":b.push(...Ze.getMonthRange(o.value[0],o.value[1],-1));break;case"quarter":b.push(...Ze.getQuarterRange(o.value[0],o.value[1],-1));break;case"year":b.push(...Ze.getYearRange(o.value[0],-1));break}o.value=[...b],t("change",{name:l.name,value:o.value}),t("update:modelValue",o.value)}const m=["Січень","Лютий","Березень","Квітень","Травень","Червень","Липень","Серпень","Вересень","Жовтень","Листопад","Грудень"];function f(b){const[w,x,k]=b.split("-");return`${k}.${x}.${w}`}function p(b,w="long"){const x=new Date(Date.UTC(2e3,b-1,1));return new Intl.DateTimeFormat(localStorage.locale,{month:w,timeZone:"UTC"}).format(x)}function y(b){const{value:w}=o;switch(b){case"today":return f(w[0]);case"range":return"Період";case"week":return w[0]&&w[1]?`${f(w[0])} – ${f(w[1])}`:"";case"quarter":if(w[0]){const x=new Date(w[0]),k=x.getFullYear(),_=x.getMonth();return`${Math.floor(_/3)+1} ${r("filter.quarter")} ${k}`}return"";case"month":if(w[0]){const[x,k]=w[0].split("-");return`${p(parseInt(k,10))} ${x}`}return"";case"year":return w[0]||"";case"last_7_days":return"За останні дні";default:return l.label??""}}const h=e.computed(()=>n.value?y(n.value):l.label??"");function g(){n.value="",o.value=[],t("update:modelValue",[]),t("clear",l.name)}return{activeMode:n,innerValue:o,daysBefore:s,onDaysBeforeChange:i,onSelectChange:c,nextClick:u,prevClick:d,ukMonths:m,formatDisplayDate:f,getModeLabel:y,currentLabel:h,clear:g}}const Qx={key:0,class:"relative flex w-full h-auto gap-2 filter-date m-2 flex-wrap"},Jx={key:0,class:"flex gap-1 !w-[75%] rounded-lg"},ew=["max","disabled"],tw=["min","disabled"],lw={key:0,class:"block text-xs font-medium text-gray-600 mb-1"},aw=["max","disabled"],rw={key:0,class:"block text-xs font-medium text-gray-600 mb-1"},nw={key:0,class:"block text-xs font-medium text-gray-600 mb-1"},ow=["min","disabled"],sw={class:"flex gap-1 pt-2"},iw=["onClick"],cw=e.defineComponent({__name:"date-input",props:{id:{},name:{},title:{},type:{},label:{},width:{},options:{},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean},layout:{default:"inline"},cleanable:{type:Boolean},limit:{},multi:{type:Boolean},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{},ua:{}},emits:["update:modelValue","change","clear"],setup(l,{expose:t,emit:a}){const r=l,n=bs(),o=zx(),s=a,i=e.ref(null),{activeMode:c,innerValue:u,onSelectChange:d,nextClick:m,prevClick:f,clear:p}=ks({...r,popoverRef:i},s);return e.watch(()=>r.modelValue,y=>{y!==void 0?(u.value=y,s("update:modelValue",y)):(c.value="",u.value=[])}),t({clear:p,popoverRef:i}),(y,h)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[l.layout==="inline"?(e.openBlock(),e.createElementBlock("div",Qx,[e.unref(c)!==""&&e.unref(c)==="range"?(e.openBlock(),e.createElementBlock("div",Jx,[e.withDirectives(e.createElementVNode("input",{type:"date",max:e.unref(u)[1],locale:"uk-UA","onUpdate:modelValue":h[0]||(h[0]=g=>e.unref(u)[0]=g),class:"px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-lg focus:outline-blue-600",disabled:l.disabled},null,8,ew),[[e.vModelText,e.unref(u)[0]]]),e.withDirectives(e.createElementVNode("input",{type:"date",min:e.unref(u)[0],locale:"uk-UA","onUpdate:modelValue":h[1]||(h[1]=g=>e.unref(u)[1]=g),class:"px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-lg focus:outline-blue-600 appearance-auto",disabled:l.disabled},null,8,tw),[[e.vModelText,e.unref(u)[1]]])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(l.layout==="popover"?"space-y-3 p-2":"flex items-center gap-2")},[e.createElementVNode("div",{class:e.normalizeClass(l.layout!=="popover"?"w-[48%]":"")},[l.layout==="popover"?(e.openBlock(),e.createElementBlock("label",lw,"Від")):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{type:"date",max:e.unref(u)[1],locale:"uk-UA","onUpdate:modelValue":h[2]||(h[2]=g=>e.unref(u)[0]=g),class:e.normalizeClass(e.unref(n)),disabled:l.disabled},null,10,aw),[[e.vModelText,e.unref(u)[0]]])],2),l.layout!=="popover"?(e.openBlock(),e.createElementBlock("label",rw," - ")):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(l.layout!=="popover"?"w-[48%]":"")},[l.layout==="popover"?(e.openBlock(),e.createElementBlock("label",nw,"До")):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{type:"date",min:e.unref(u)[0],locale:"uk-UA","onUpdate:modelValue":h[3]||(h[3]=g=>e.unref(u)[1]=g),class:e.normalizeClass(e.unref(n)),disabled:l.disabled},null,10,ow),[[e.vModelText,e.unref(u)[1]]])],2)],2),e.createElementVNode("div",sw,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(["today","week","month","quarter","year"],g=>e.createElementVNode("button",{key:g,class:e.normalizeClass(e.unref(o)+(e.unref(c)===g?" bg-blue-100":"")),onClick:b=>e.unref(d)(g)},e.toDisplayString(e.unref(Zx)(g)),11,iw)),64)),e.createElementVNode("button",{class:e.normalizeClass(e.unref(o)),onClick:h[4]||(h[4]=(...g)=>e.unref(f)&&e.unref(f)(...g))}," <",2),e.createElementVNode("button",{class:e.normalizeClass(e.unref(o)),onClick:h[5]||(h[5]=(...g)=>e.unref(m)&&e.unref(m)(...g))}," >",2)]),(l.cleanable,e.createCommentVNode("",!0))],64))}});function dw(l,t){const{api:a,options:r=[],limit:n=20,dataKey:o="data"}=l,s=l.multi;function i(R){return s?Array.isArray(R)?R:R?[R]:[]:Array.isArray(R)?R[0]:R}const c=e.ref(i(l.modelValue)),u=e.ref(""),d=e.ref(!1),m=e.ref(r),f=e.ref("id"),p=e.ref("text"),y=e.ref(!1),h=e.ref(l.layout!=="popover"&&r.length>n),g=e.ref([]),b=e.ref(0);function w(R){const I=R.find(Boolean)??{},F=["id","value","code","key"].find(z=>z in I)??"id",D=["text","label","name","title"].find(z=>z in I)??"text";return{autoValueKey:F,autoLabelKey:D}}if(r.length>0){const R=w(r);f.value=R.autoValueKey,p.value=R.autoLabelKey}const x=e.computed(()=>{if(a)return m.value;const R=m.value;if(l.layout==="popover")return R;if(!u.value)return y.value?R:R.slice(0,n);const I=u.value.toLowerCase();return R.filter(F=>F[p.value].toLowerCase().includes(I))});let k=null;async function _(R){if(a){d.value=!0;try{const I=new URL(a,window.location.origin);I.searchParams.set("json","1"),I.searchParams.set("key",R),I.searchParams.set("limit",n.toString());const F=await fetch(I.toString());if(!F.ok){xe({type:"error",title:"Error",message:"Failed to fetch remote options"}),m.value=[];return}const D=await F.json();if(!D[o]){xe({type:"error",title:"Error",message:D}),m.value=[];return}if(m.value=D[o],m.value.length>0){const z=w(m.value);f.value=z.autoValueKey,p.value=z.autoLabelKey}b.value=D.total}catch(I){console.error("Failed to fetch remote options:",I)}finally{d.value=!1}}}e.watch(u,R=>{a&&(k&&clearTimeout(k),k=setTimeout(()=>{_(R)},200))}),e.watch(()=>l.modelValue,R=>{c.value=i(R)},{immediate:!0});function N(R){return s&&Array.isArray(c.value)?c.value.includes(R[f.value]):c.value&&c.value===R[f.value]}function V(R){if(s&&!Array.isArray(c.value)&&(c.value=[]),s&&Array.isArray(c.value)){const I=c.value.includes(R[f.value]);c.value=I?c.value.filter(F=>F!==R[f.value]):[...c.value,R[f.value]],g.value=I?g.value.filter(F=>F!==R[p.value]):[...g.value,R[p.value]]}else c.value=R[f.value],g.value=R[p.value];t("update:modelValue",c.value),t("change",{name:l.name,value:c.value})}function P(){s?(c.value=[],g.value=[]):(c.value=void 0,g.value=[]),t("update:modelValue",c.value),t("clear",l.name)}function $(){k&&clearTimeout(k),u.value="",y.value=!1}function M(){y.value=!y.value}e.onBeforeUnmount(()=>{k&&clearTimeout(k)});const A=e.ref(-1);e.watch(x,()=>{A.value=x.value.length>0?0:-1});function q(R){const I=x.value.length;if(R.key==="ArrowDown")R.preventDefault(),A.value=(A.value+1)%I;else if(R.key==="ArrowUp")R.preventDefault(),A.value=(A.value-1+I)%I;else if(R.key==="Enter"&&(R.preventDefault(),A.value>=0&&A.value<x.value.length)){const F=x.value[A.value];V(F)}}function Q(){a&&m.value.length===0&&u.value.length===0&&_(u.value)}return{innerValue:c,searchTerm:u,filteredOptions:x,isSelected:N,selectItem:V,clear:P,resetSearch:$,toggleShowAll:M,isReqProc:d,showAll:y,isEnableShowAll:h,labelKey:p,valueKey:f,allOptions:m,highlightedIndex:A,onKeyDown:q,selectedLabels:g,totalCount:b,loadData:Q}}const uw={class:"h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relative justify-center"},mw=["placeholder"],pw={key:0,class:"w-full"},fw={class:"flex flex-col items-center justify-center p-5 text-center"},hw={class:"max-w-sm mx-auto mt-6"},gw={class:"font-medium text-gray-800 dark:text-neutral-200"},bw={key:0,class:"flex justify-between p-2 border-t bg-gray-50 text-xs text-gray-500"},yw={key:1,class:"flex justify-between items-center text-xs text-gray-500 p-1 border-t"},kw=e.defineComponent({__name:"select",props:{id:{},name:{},title:{},type:{},label:{},width:{},options:{default:()=>[]},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean,default:!1},layout:{default:"inline"},cleanable:{type:Boolean},limit:{default:10},multi:{type:Boolean},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{},ua:{}},emits:["update:modelValue","change","clear"],setup(l,{expose:t,emit:a}){const r=vl(),n=l,o=a,s=e.ref(null),{innerValue:i,filteredOptions:c,isSelected:u,selectItem:d,clear:m,resetSearch:f,toggleShowAll:p,isReqProc:y,showAll:h,isEnableShowAll:g,searchTerm:b,labelKey:w,valueKey:x,highlightedIndex:k,onKeyDown:_,selectedLabels:N,totalCount:V,loadData:P}=dw({...n,modelValue:n.modelValue},o);e.onMounted(()=>{f(),n.layout!=="inline"&&(P(),s.value&&n.layout==="popover"&&s.value.focus())}),e.watch(()=>n.modelValue,M=>{M===void 0&&(n.multi?i.value=[]:i.value=void 0)});const $=e.ref([]);return e.watch(k,M=>{var A;M>=0&&$.value[M]&&((A=$.value[M])==null||A.scrollIntoView({block:"nearest",behavior:"smooth"}))}),e.watch(c,()=>{$.value=[]}),t({clear:m,inputTextRef:s,selectedLabels:N,loadData:P}),(M,A)=>{var q,Q;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([l.layout==="popover"?"flex flex-col h-full":"flex flex-col vs-filter-checkbox space-y-0.5"])},[e.createElementVNode("div",uw,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":A[0]||(A[0]=R=>e.isRef(b)?b.value=R:null),onKeydown:A[1]||(A[1]=(...R)=>e.unref(_)&&e.unref(_)(...R)),class:"w-full h-full text-[13px] px-4 border rounded-sm pl-9 focus:outline-none focus:ring-ring focus:ring-1 focus:ring-blue-500 text-gray-700",placeholder:e.unref(r)("filter.search"),type:"text",ref_key:"inputTextRef",ref:s},null,40,mw),[[e.vModelText,e.unref(b)]]),e.createVNode(hs,{class:"absolute text-gray-400 -translate-y-1/2 left-4 top-1/2"}),e.unref(b)!=""?(e.openBlock(),e.createBlock(gs,{key:0,onClick:A[2]||(A[2]=R=>b.value=""),class:"absolute text-gray-400 -translate-y-1/2 cursor-pointer hover:text-red-500 right-4 top-1/2"})):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass([l.layout==="popover"?"flex-1 overflow-y-auto max-h-64 p-2":"",l.layout==="inline"?"flex-1 overflow-y-auto max-h-80":""])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(c),(R,I)=>(e.openBlock(),e.createBlock(Fr,{layout:l.layout,count:R.count,label:R[e.unref(w)],color:R.color,type:l.multi?"checkbox":"radio",value:R[e.unref(x)],"is-selected":e.unref(u)(R),highlighted:I===e.unref(k),onItemClick:F=>e.unref(d)(R),ref_for:!0,ref:F=>$.value[I]=F==null?void 0:F.el},null,8,["layout","count","label","color","type","value","is-selected","highlighted","onItemClick"]))),256))],2),l.type==="select"&&e.unref(c).length===0&&!e.unref(y)?(e.openBlock(),e.createElementBlock("div",pw,[e.createElementVNode("div",fw,[e.createVNode(Ir),e.createElementVNode("div",hw,[e.createElementVNode("p",gw,e.toDisplayString(e.unref(r)("filter.notfound")),1),A[7]||(A[7]=e.createElementVNode("p",{class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"},null,-1))])])])):e.createCommentVNode("",!0),l.layout!=="popover"&&l.type!=="select"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[!e.unref(h)&&e.unref(g)?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:A[3]||(A[3]=(...R)=>e.unref(p)&&e.unref(p)(...R)),class:"inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"},[e.createTextVNode(e.toDisplayString(e.unref(r)("filter.more"))+" ",1),e.createVNode(Sa)])):e.createCommentVNode("",!0),e.unref(h)?(e.openBlock(),e.createElementBlock("div",{key:1,onClick:A[4]||(A[4]=(...R)=>e.unref(p)&&e.unref(p)(...R)),class:"inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"},[e.createTextVNode(e.toDisplayString(e.unref(r)("filter.less"))+" ",1),e.createVNode(Or)])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),l.cleanable?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[l.layout==="inline"?(e.openBlock(),e.createElementBlock("div",bw,[e.createTextVNode(e.toDisplayString(l.multi&&Array.isArray(e.unref(i))?(q=e.unref(i))==null?void 0:q.length:e.unref(i)!==void 0&&(e.unref(i)||e.unref(i)===null)?1:0)+" / "+e.toDisplayString(e.unref(V))+" "+e.toDisplayString(e.unref(r)("filter.selected"))+" ",1),e.withDirectives(e.createElementVNode("button",{class:"text-gray-600 hover:text-gray-800",onClick:A[5]||(A[5]=(...R)=>e.unref(m)&&e.unref(m)(...R))},e.toDisplayString(e.unref(r)("filter.clear")),513),[[e.vShow,e.unref(i)!==""&&e.unref(i)!==void 0||e.unref(i)]])])):e.createCommentVNode("",!0),l.layout==="popover"?(e.openBlock(),e.createElementBlock("div",yw,[e.createElementVNode("span",null,e.toDisplayString(l.multi&&Array.isArray(e.unref(i))?(Q=e.unref(i))==null?void 0:Q.length:e.unref(i)!==void 0&&(e.unref(i)||e.unref(i)===null)?1:0)+" / "+e.toDisplayString(e.unref(V))+" "+e.toDisplayString(e.unref(r)("filter.selected")),1),e.withDirectives(e.createElementVNode("button",{class:"text-gray-600 hover:text-gray-800",onClick:A[6]||(A[6]=(...R)=>e.unref(m)&&e.unref(m)(...R))},e.toDisplayString(e.unref(r)("filter.clear")),513),[[e.vShow,e.unref(i)!==""&&e.unref(i)!==void 0||e.unref(i)]])])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],2)}}}),xw=["for","onClick"],ww=["id","name","value"],_w={class:"block"},Ew={key:0,class:"flex justify-between p-2 border-t bg-gray-50 text-xs text-gray-500"},Cw={key:1,class:"flex justify-between items-center text-xs text-gray-500 p-1 border-t"},Vw=e.defineComponent({__name:"tag-field",props:{id:{},name:{},title:{},type:{},label:{},width:{},options:{default:()=>[]},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean,default:!1},layout:{default:"inline"},cleanable:{type:Boolean},limit:{},multi:{type:Boolean},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{},ua:{}},emits:["update:modelValue","change","clear"],setup(l,{expose:t,emit:a}){const r=l,n=a,{innerValue:o,isSelected:s,selectItem:i,clear:c,labelKey:u,valueKey:d,allOptions:m}=r.multi?ms({...r,modelValue:r.modelValue??r.default??[]},n):us({...r,modelValue:r.modelValue!==void 0?r.modelValue:r.default??""},n);return t({clear:c}),e.watch(()=>r.modelValue,f=>{f===void 0&&(r.multi?o.value=[]:o.value=void 0)}),(f,p)=>{var y,h;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["grid grid-cols-3 gap-2 mx-[1px]",l.layout==="popover"?"m-1":"mb-1"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(m),g=>(e.openBlock(),e.createElementBlock("label",{key:`item-${g[e.unref(d)]}`,for:`item-${g[e.unref(d)]}`,onClick:e.withModifiers(b=>e.unref(i)(g),["stop","prevent"]),class:e.normalizeClass([e.unref(s)(g)?"ring-2 ring-indigo-600":"","p-2.5 group relative flex justify-center items-center gap-x-12 text-center text-xs bg-white text-gray-800 border border-gray-200 cursor-pointer rounded-lg dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-200 peer-checked:text-indigo-600 dark:has-checked:text-indigo-500 peer-checked:border-indigo-600 dark:has-checked:border-indigo-500 peer-checked:ring peer-checked:shadow focus:ring dark:has-checked:ring-indigo-500 has-disabled:pointer-events-none has-disabled:text-gray-200 dark:has-disabled:text-neutral-700 has-disabled:after:absolute has-disabled:after:inset-0 has-disabled:after:bg-[linear-gradient(to_right_bottom,transparent_calc(50%-1px),var(--color-gray-200)_calc(50%-1px),var(--color-gray-200)_50%,transparent_50%)] dark:has-disabled:after:bg-[linear-gradient(to_right_bottom,transparent_calc(50%-1px),var(--color-neutral-700)_calc(50%-1px),var(--color-neutral-700)_50%,transparent_50%)]"])},[e.createElementVNode("input",{type:"checkbox",id:`item-${g[e.unref(d)]}`,class:"hidden w4poy border-gray-200 g41z1 g22e3 axcnw dark:text-indigo-500 dark:border-neutral-700 dark:focus:ring-neutral-900",name:`item-${g[e.unref(d)]}`,value:g[e.unref(d)]},null,8,ww),e.createElementVNode("span",_w,e.toDisplayString(g[e.unref(u)]),1)],10,xw))),128))],2),l.cleanable?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[l.layout==="inline"?(e.openBlock(),e.createElementBlock("div",Ew,[e.createTextVNode(e.toDisplayString(l.multi&&Array.isArray(e.unref(o))?(y=e.unref(o))==null?void 0:y.length:e.unref(o)!==void 0&&(e.unref(o)||e.unref(o)===null)?1:0)+" з "+e.toDisplayString(e.unref(m).length)+" обрано ",1),e.withDirectives(e.createElementVNode("button",{class:"text-gray-600 hover:text-gray-800",onClick:p[0]||(p[0]=(...g)=>e.unref(c)&&e.unref(c)(...g))}," Очистити ",512),[[e.vShow,e.unref(o)!==""&&e.unref(o)!==void 0||e.unref(o)]])])):e.createCommentVNode("",!0),l.layout==="popover"?(e.openBlock(),e.createElementBlock("div",Cw,[e.createElementVNode("span",null,e.toDisplayString(l.multi&&Array.isArray(e.unref(o))?(h=e.unref(o))==null?void 0:h.length:e.unref(o)!==void 0&&(e.unref(o)||e.unref(o)===null)?1:0)+" з "+e.toDisplayString(e.unref(m).length)+" обрано",1),e.withDirectives(e.createElementVNode("button",{class:"text-gray-600 hover:text-gray-800",onClick:p[1]||(p[1]=(...g)=>e.unref(c)&&e.unref(c)(...g))}," Очистити ",512),[[e.vShow,e.unref(o)!==void 0&&e.unref(o)!==""||e.unref(o)]])])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64)}}}),Nw=["disabled","title"],vw={key:0,class:"absolute top-0 end-0 inline-flex min-h-[10px] min-w-[10px] z-10 items-center py-0.5 rounded-full text-xs font-medium transform -translate-y-1/2 translate-x-1/2 bg-blue-600 text-white px-1"},Bw={class:"w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg focus:outline-none focus:bg-stone-100 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full"},Sw={class:"w-[360px] max-h-[500px] overflow-auto [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-1 [&::-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 before:w-full p-2"},Rr=e.defineComponent({__name:"popover-field",props:{disabled:{type:Boolean,default:!1},label:{},en:{},ua:{},uk:{},fr:{},de:{},es:{},currentValue:{},fieldRef:{},width:{},mode:{},layout:{}},setup(l,{expose:t}){const a=l,r=e.computed(()=>ys(a.mode)),n=e.ref(!1),o=e.ref({top:0,left:0}),s=e.ref(null),i=e.ref(null),c=e.ref(null);function u(){const w=i.value,x=c.value;if(!w||!x)return;const k=w.getBoundingClientRect(),_=x.offsetWidth,N=window.innerWidth,V=k.bottom+8;let{left:P}=k;P+_>N&&(P=Math.max(N-_-10,10)),o.value={top:V,left:P}}function d(){console.log("~~~~~~~~~~"),console.log(n.value),n.value=!n.value,console.log(n.value),n.value&&e.nextTick(()=>{var w,x,k,_,N,V,P;u(),(w=a.fieldRef)!=null&&w.inputTextRef&&((_=(k=(x=a.fieldRef)==null?void 0:x.inputTextRef)==null?void 0:k.focus)==null||_.call(k)),(N=a.fieldRef)!=null&&N.loadData&&((P=(V=a.fieldRef)==null?void 0:V.loadData)==null||P.call(V))})}function m(w){var x,k,_;!((x=s.value)!=null&&x.contains(w.target))&&!((k=c.value)!=null&&k.contains(w.target))&&!((_=i.value)!=null&&_.contains(w.target))&&(n.value=!1)}function f(w){w.key==="Escape"&&(n.value=!1)}const p=e.ref(!1),y=e.ref("ua"),h=w=>{w.detail.key==="locale"&&(y.value=w.detail.newValue)};e.onMounted(()=>{p.value=!0,y.value=localStorage.locale,window.addEventListener("storage",h),document.addEventListener("click",m,!0),document.addEventListener("keydown",f),window.addEventListener("scroll",u,!0)}),e.onBeforeUnmount(()=>{window.removeEventListener("resize",h),document.removeEventListener("click",m,!0),document.removeEventListener("keydown",f),window.removeEventListener("scroll",u,!0)});function g(){n.value=!1}t({close:g});const b=e.computed(()=>{var x;const w=(x=a.fieldRef)==null?void 0:x.selectedLabels;return!w||["inline"].includes(a.layout||"")?a[y.value]||(a.label??""):Array.isArray(w)?w.length>0?w.join(", "):a.label??"":String(w)});return(w,x)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("button",{onClick:d,disabled:l.disabled,ref_key:"triggerRef",ref:i,title:l.label,class:e.normalizeClass(r.value+" "+(l.width?e.unref(Pr).getWidthClass(l.width):"w-full"))},[e.createElementVNode("span",{class:e.normalizeClass(["truncate text-ellipsis block",l.width?e.unref(Pr).getWidthClass(l.width-50):"w-full"])},e.toDisplayString(b.value),3),e.createVNode(Sa,{class:"h-4 w-4"}),(Array.isArray(l.currentValue)?l.currentValue===null||l.currentValue.length>0:l.currentValue===null||l.currentValue)&&l.layout==="inline"?(e.openBlock(),e.createElementBlock("span",vw)):e.createCommentVNode("",!0)],10,Nw),p.value?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:"body"},[e.withDirectives(e.createElementVNode("div",{ref_key:"popperRef",ref:c,class:"vsTailwind vs-popover__content bottom-right w-fit fixed z-[1000]",style:e.normalizeStyle({top:`${o.value.top}px`,left:`${o.value.left}px`}),"data-inside-popover":""},[e.createElementVNode("div",Bw,[e.createElementVNode("div",Sw,[e.renderSlot(w.$slots,"default")])])],4),[[e.vShow,n.value]])])):e.createCommentVNode("",!0)]))}}),Dw={},Aw={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",class:"text-blue-600 w-[16px] h-[16px]"};function Mw(l,t){return e.openBlock(),e.createElementBlock("svg",Aw,[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M20 6 9 17l-5-5"},null,-1)])])}const dl=Mt(Dw,[["render",Mw]]),Tw={},Lw={xmlns:"http://www.w3.org/2000/svg",width:"15px",height:"24",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 text-gray-800 rotate-[90deg]"};function $w(l,t){return e.openBlock(),e.createElementBlock("svg",Lw,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)])])}const Fw=Mt(Tw,[["render",$w]]),Iw={},Ow={xmlns:"http://www.w3.org/2000/svg",width:"15px",height:"24",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 text-gray-800 rotate-[270deg]"};function Pw(l,t){return e.openBlock(),e.createElementBlock("svg",Ow,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)])])}const Rw=Mt(Iw,[["render",Pw]]),Uw={class:"flex"},jw={class:"mb-1"},zw={class:"mb-1"},Hw={class:"inline-flex rounded-lg shrink-0 pl-1"},qw=["title"],Gw={class:"inline-flex rounded-lg shrink-0 pl-1"},Ww=["title"],Kw={key:1,class:"flex gap-1 !w-[75%] rounded-lg"},Yw=["max","disabled"],Xw=["min","disabled"],Zw=e.defineComponent({__name:"date-input-inline",props:{id:{},name:{},title:{},type:{},label:{},width:{},options:{},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean},layout:{default:"inline"},cleanable:{type:Boolean},limit:{},multi:{type:Boolean},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{},ua:{}},emits:["update:modelValue","change","clear"],setup(l,{expose:t,emit:a}){const r=vl(),n=l,o=a,s=e.ref(null),{activeMode:i,innerValue:c,onSelectChange:u,nextClick:d,prevClick:m,currentLabel:f,clear:p}=ks({...n,popoverRef:s},o);return e.watch(()=>n.modelValue,y=>{y!==void 0?(c.value=y,o("update:modelValue",y)):(i.value="",c.value=[])}),t({clear:p,popoverRef:s}),(y,h)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Uw,[e.createVNode(Rr,{ref_key:"popoverRef",ref:s,label:e.unref(f),"current-value":e.unref(c),mode:l.mode,onClear:e.unref(p),layout:l.layout},{default:e.withCtx(()=>[e.createElementVNode("div",null,[e.createElementVNode("button",{type:"button",onClick:h[0]||(h[0]=g=>e.unref(u)("range")),class:"flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"},[e.createTextVNode(e.toDisplayString(e.unref(r)("filter.period"))+" ",1),e.unref(i)==="range"?(e.openBlock(),e.createBlock(dl,{key:0})):e.createCommentVNode("",!0)])]),h[12]||(h[12]=e.createElementVNode("div",null,[e.createElementVNode("div",{class:"pt-1 mt-1 border-t"})],-1)),e.createElementVNode("div",null,[e.createElementVNode("button",{type:"button",onClick:h[1]||(h[1]=g=>e.unref(u)("today")),class:"flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"},[e.createTextVNode(e.toDisplayString(e.unref(r)("filter.today"))+" ",1),e.unref(i)==="today"?(e.openBlock(),e.createBlock(dl,{key:0})):e.createCommentVNode("",!0)])]),e.createElementVNode("div",null,[e.createElementVNode("button",{type:"button",onClick:h[2]||(h[2]=g=>e.unref(u)("week")),class:"flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"},[e.createTextVNode(e.toDisplayString(e.unref(r)("filter.week"))+" ",1),e.unref(i)==="week"?(e.openBlock(),e.createBlock(dl,{key:0})):e.createCommentVNode("",!0)])]),e.createElementVNode("div",null,[e.createElementVNode("button",{type:"button",onClick:h[3]||(h[3]=g=>e.unref(u)("month")),class:"flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"},[e.createTextVNode(e.toDisplayString(e.unref(r)("filter.month"))+" ",1),e.unref(i)==="month"?(e.openBlock(),e.createBlock(dl,{key:0})):e.createCommentVNode("",!0)])]),e.createElementVNode("div",null,[e.createElementVNode("button",{type:"button",onClick:h[4]||(h[4]=g=>e.unref(u)("quarter")),class:"flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"},[e.createTextVNode(e.toDisplayString(e.unref(r)("filter.quarter"))+" ",1),e.unref(i)==="quarter"?(e.openBlock(),e.createBlock(dl,{key:0})):e.createCommentVNode("",!0)])]),e.createElementVNode("div",jw,[e.createElementVNode("button",{type:"button",onClick:h[5]||(h[5]=g=>e.unref(u)("year")),class:"flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"},[e.createTextVNode(e.toDisplayString(e.unref(r)("filter.year"))+" ",1),e.unref(i)==="year"?(e.openBlock(),e.createBlock(dl,{key:0})):e.createCommentVNode("",!0)])]),e.createElementVNode("div",zw,[e.createElementVNode("button",{type:"button",onClick:h[6]||(h[6]=g=>e.unref(p)()),class:"flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"},[e.createTextVNode(e.toDisplayString(e.unref(r)("filter.alltime"))+" ",1),e.unref(c)[0]?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(dl,{key:0}))])])]),_:1},8,["label","current-value","mode","onClear","layout"]),e.unref(i)!==""&&e.unref(i)!=="range"&&e.unref(i)!=="last_7_days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",Hw,[e.createElementVNode("button",{type:"button",title:e.unref(r)("filter.prev"),class:"inline-flex h-[38px] items-center px-2 text-sm text-gray-800 bg-gray-100 gap-x-2 -ms-px first:rounded-s-lg first:ms-0 last:rounded-e-lg focus:z-10 hover:bg-gray-200 focus:bg-gray-200 duration-300",onClick:h[7]||(h[7]=(...g)=>e.unref(m)&&e.unref(m)(...g))},[e.createVNode(Fw)],8,qw)]),e.createElementVNode("div",Gw,[e.createElementVNode("button",{type:"button",title:e.unref(r)("filter.next"),class:"inline-flex h-[38px] items-center px-2 text-sm text-gray-800 gap-x-2 bg-gray-100 -ms-px first:rounded-s-lg first:ms-0 last:rounded-e-lg focus:z-10 hover:bg-gray-200 focus:bg-gray-200 duration-300",onClick:h[8]||(h[8]=(...g)=>e.unref(d)&&e.unref(d)(...g))},[e.createVNode(Rw)],8,Ww)])],64)):e.createCommentVNode("",!0),e.unref(i)!==""&&e.unref(i)==="range"?(e.openBlock(),e.createElementBlock("div",Kw,[e.withDirectives(e.createElementVNode("input",{type:"date",max:e.unref(c)[1],locale:"uk-UA","onUpdate:modelValue":h[9]||(h[9]=g=>e.unref(c)[0]=g),class:"px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-lg focus:outline-blue-600",disabled:l.disabled},null,8,Yw),[[e.vModelText,e.unref(c)[0]]]),e.withDirectives(e.createElementVNode("input",{type:"date",min:e.unref(c)[0],locale:"uk-UA","onUpdate:modelValue":h[10]||(h[10]=g=>e.unref(c)[1]=g),class:"px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-lg focus:outline-blue-600 appearance-auto",disabled:l.disabled},null,8,Xw),[[e.vModelText,e.unref(c)[1]]])])):e.createCommentVNode("",!0)]),(l.cleanable,e.createCommentVNode("",!0))],64))}}),xs={radio:Vx,checkbox:fs,check:fs,text:Ux,range:Xx,date:cw,select:kw,tag:Vw,"date:inline":Zw};function Ur(l,t){let a;switch(l.toLowerCase()){case"autocomplete":a="select";break;case"check":a="checkbox";break;default:a=l==null?void 0:l.toString().toLowerCase()}return a==="date"&&t&&t==="inline"&&(a="date:inline"),{component:xs[a]||xs.text,type:a}}const Qw={style:{display:"inline-flex",margin:"0px",width:"100%"}},Jw={class:"relative w-full mb-2 p-4 bg-white rounded-lg shadow-sm"},e2={class:"block mb-3 text-sm font-medium text-gray-800 dark:text-neutral-200"},t2={class:"flex items-center"},l2={class:"text-sm font-medium max-w-[80%] text-gray-800 flex items-center gap-x-1"},a2={class:"filter-layout__body"},r2=e.defineComponent({__name:"vertical-layout",props:{id:{},name:{},title:{},type:{},label:{},width:{},options:{},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean},layout:{},cleanable:{type:Boolean},limit:{},multi:{type:Boolean},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{},ua:{}},emits:["update:modelValue","change","clear"],setup(l,{expose:t,emit:a}){const r=l,n=a,o=e.ref(),s=Ur(r.type,r.layout),i=e.computed({get:()=>r.modelValue,set:m=>n("update:modelValue",m)});function c(m){n("clear",m)}function u(m,f){n("change",{name:m,value:f}),r.modelValue!==void 0&&n("update:modelValue",f)}function d(){o.value&&o.value.clear(),n("clear",r.name)}return e.watch(()=>r.default,m=>{i.value=m}),e.watch(()=>r.modelValue,m=>{i.value=m}),t({filterRef:o}),(m,f)=>{var p,y,h;return e.openBlock(),e.createElementBlock("div",Qw,[e.createElementVNode("div",Jw,[e.createElementVNode("div",e2,[e.createElementVNode("div",t2,[e.createElementVNode("span",l2,e.toDisplayString(l.label),1)]),typeof i.value=="string"&&i.value.trim()!==""||Array.isArray(i.value)&&i.value.length>0&&i.value.some(g=>g!==void 0)||i.value===null?(e.openBlock(),e.createBlock(rx,{key:0,onClick:d})):e.createCommentVNode("",!0)]),e.createElementVNode("div",a2,[((p=e.unref(s))==null?void 0:p.type)!=="select"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent((y=e.unref(s))==null?void 0:y.component),e.mergeProps({key:0},r,{type:(h=e.unref(s))==null?void 0:h.type,onChange:f[0]||(f[0]=g=>u(g.name,g.value)),onClear:f[1]||(f[1]=g=>c(g)),ref_key:"filterRef",ref:o}),null,16,["type"])):(e.openBlock(),e.createBlock(Rr,{key:1,"current-value":i.value,label:l.label,mode:l.mode,onClear:d,fieldRef:o.value,width:void 0,disabled:l.disabled,layout:"vertical"},{default:e.withCtx(()=>{var g,b;return[(e.openBlock(),e.createBlock(e.resolveDynamicComponent((g=e.unref(s))==null?void 0:g.component),e.mergeProps({ref_key:"filterRef",ref:o},r,{type:(b=e.unref(s))==null?void 0:b.type,onChange:f[2]||(f[2]=w=>u(w.name,w.value)),onClear:f[3]||(f[3]=w=>c(w))}),null,16,["type"]))]}),_:1},8,["current-value","label","mode","fieldRef","disabled"]))])])])}}}),ws=e.defineComponent({__name:"inline-layout",props:{id:{},name:{},title:{},type:{},label:{},width:{},options:{},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean},layout:{},cleanable:{type:Boolean},limit:{},multi:{type:Boolean},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{},ua:{}},emits:["update:modelValue","change","clear"],setup(l,{expose:t,emit:a}){const r=l,n=a,o=e.ref(),s=Ur(r.type,r.layout),i=e.computed({get:()=>r.modelValue,set:d=>n("update:modelValue",d)});function c(d=r.name){n("clear",d)}function u(d,m){n("change",{name:d,value:m}),r.modelValue!==void 0&&n("update:modelValue",m)}return e.watch(()=>r.default,d=>{i.value=d}),e.watch(()=>r.modelValue,d=>{i.value=d}),t({filterRef:o}),(d,m)=>{var f,p;return["text","date"].includes(l.type.toLocaleLowerCase())?(e.openBlock(),e.createBlock(e.resolveDynamicComponent((f=e.unref(s))==null?void 0:f.component),e.mergeProps({key:0},r,{type:(p=e.unref(s))==null?void 0:p.type,onChange:m[0]||(m[0]=y=>u(y.name,y.value)),onClear:m[1]||(m[1]=y=>c(y)),disabled:l.disabled,modelValue:i.value,"onUpdate:modelValue":m[2]||(m[2]=y=>i.value=y)}),null,16,["type","disabled","modelValue"])):(e.openBlock(),e.createBlock(Rr,{key:1,"current-value":i.value,label:l.label,mode:l.mode,onClear:c,fieldRef:o.value,width:r.width,disabled:l.disabled,layout:"inline"},{default:e.withCtx(()=>{var y,h;return[(e.openBlock(),e.createBlock(e.resolveDynamicComponent((y=e.unref(s))==null?void 0:y.component),e.mergeProps({ref_key:"filterRef",ref:o},r,{modelValue:i.value,"onUpdate:modelValue":m[3]||(m[3]=g=>i.value=g),type:(h=e.unref(s))==null?void 0:h.type,onChange:m[4]||(m[4]=g=>u(g.name,g.value)),onClear:m[5]||(m[5]=g=>c(g))}),null,16,["modelValue","type"]))]}),_:1},8,["current-value","label","mode","fieldRef","width","disabled"]))}}}),n2=e.defineComponent({__name:"popover-layout",props:{id:{},name:{},title:{},type:{},label:{},width:{},options:{},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean},layout:{},cleanable:{type:Boolean},limit:{},multi:{type:Boolean},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{},ua:{}},emits:["update:modelValue","change","clear"],setup(l,{expose:t,emit:a}){const r=l,n=a,o=e.ref(),s=e.ref(Ur(r.type,r.layout)),i=e.computed({get:()=>r.modelValue,set:d=>n("update:modelValue",d)});function c(d){n("clear",d)}function u(d,m){n("change",{name:d,value:m}),r.modelValue!==void 0&&n("update:modelValue",m)}return e.watch(()=>r.default,d=>{i.value=d}),e.watch(()=>r.modelValue,d=>{i.value=d}),e.watch(()=>r,d=>{i.value=d}),t({filterRef:o}),(d,m)=>{var f,p;return e.openBlock(),e.createBlock(e.resolveDynamicComponent((f=s.value)==null?void 0:f.component),e.mergeProps(r,{type:(p=s.value)==null?void 0:p.type,modelValue:i.value,"onUpdate:modelValue":m[0]||(m[0]=y=>i.value=y),onChange:m[1]||(m[1]=y=>u(y.name,y.value)),onClear:m[2]||(m[2]=y=>c(y)),ref_key:"filterRef",ref:o}),null,16,["type","modelValue"])}}}),ul=e.defineComponent({__name:"filter-field",props:{id:{},name:{},title:{},type:{},label:{},width:{},options:{default:()=>[]},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean,default:!1},layout:{default:"inline"},cleanable:{type:Boolean},limit:{default:10},multi:{type:Boolean,default:!0},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{default:"name"},ua:{}},emits:["update:modelValue","change","clear"],setup(l,{expose:t,emit:a}){const r=l,n=a,o=e.ref(),s=e.computed({get:()=>r.modelValue,set:d=>n("update:modelValue",d)});function i(d){n("clear",d)}function c(d,m){n("change",{name:d,value:m}),r.modelValue!==void 0&&n("update:modelValue",m)}e.watch(()=>r.default,d=>{s.value=d}),e.watch(()=>r.modelValue,d=>{s.value=d}),t({filterRef:o});function u(){switch(r.layout){case"inline":return ws;case"vertical":return r2;case"popover":return n2;default:return ws}}return(d,m)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(u()),e.mergeProps(r,{onChange:m[0]||(m[0]=f=>c(f.name,f.value)),onClear:m[1]||(m[1]=f=>i(f)),modelValue:s.value,"onUpdate:modelValue":m[2]||(m[2]=f=>s.value=f)}),null,16,["modelValue"]))}});function jr(l,t){const{slots:a}=l,r=e.ref(l.value??{}),n=e.computed(()=>{var g;return(e.toRaw((g=a==null?void 0:a.default)==null?void 0:g.call(a))??[]).flatMap(b=>Array.isArray(b.children)?b.children:[b])});function o(g){delete r.value[g],t("clear",{data:e.toRaw(r.value),name:g})}function s(g,b){b===void 0?o(g):r.value={...r.value,[g]:b},t("change",{data:e.toRaw(r.value),name:g,value:b})}const i=e.computed(()=>n.value.map(g=>{var w;const b=(w=g.props)==null?void 0:w.name;return e.cloneVNode(g,{...g.props,layout:l.view,showClean:!0,modelValue:r.value[b],"onUpdate:modelValue":x=>{s(b,x)},onClear:()=>o(b)})})),c=e.computed(()=>new Map(i.value.map(g=>{var w;const b=(w=g.props)==null?void 0:w.name;return b?[b,g]:null}).filter(g=>g!==null)));function u(g=!1){r.value={},g||t("clearAll",{data:e.toRaw(r.value),name:"ALL"})}const d=e.ref(""),m=e.computed(()=>{var g;return(g=l.schema)!=null&&g.value?Object.entries(r.value).filter(([b,w])=>l.schema&&!(b in l.schema.value)?!1:Array.isArray(w)?w.some(x=>x!==""&&x!==void 0):w!==""&&w!==void 0).length:0}),f=e.ref();e.watch(d,async()=>{var g,b;await e.nextTick(),(b=(g=f==null?void 0:f.value)==null?void 0:g.filterRef)!=null&&b.inputTextRef&&f.value.filterRef.inputTextRef.focus()});const p=e.computed(()=>{var g,b;return(g=l.schema)!=null&&g.value?Object.fromEntries(Object.entries((b=l.schema)==null?void 0:b.value).slice(0,l.limit)):{}}),y=e.computed(()=>{var b;if(i.value.length===0)return[];let g=0;if((b=l.schema)!=null&&b.value){const w=Object.entries(l.schema.value).length;l.limit&&w<l.limit?g=l.limit-w:g=0}return i.value.slice(0,g)}),h=e.computed(()=>i.value.length===0?[]:l.view!=="inline"?i.value:i.value.slice(y.value.length));return{activeFilter:r,activeFilterCount:m,onFilterChange:s,clearFilter:o,clearAllFilters:u,limitedSchema:p,filtersSlot:i,limitedFiltersSlot:y,popoverFiltersSlot:h,vnodeMap:c,selectedFilter:d,filterRef:f}}const o2=e.defineComponent({__name:"popover",emits:["open","close"],setup(l,{emit:t}){const a=e.ref(!1),r=e.ref(null),n=e.ref(null),o=e.ref(null),s=e.ref({top:"0px",left:"0px",position:"absolute"});function i(){a.value=!a.value}function c(){const p=o.value,y=r.value;if(!p||!y)return;const h=p.getBoundingClientRect(),g=y.offsetWidth,b=window.innerWidth-h.left;let w=h.left+window.scrollX;g>b&&(w=window.innerWidth-g-8,w<8&&(w=8)),s.value={position:"absolute",top:`${h.bottom+window.scrollY+8}px`,left:`${w}px`}}const u=e.computed(()=>Object.entries(s.value).map(p=>p.join(":")).join(";"));function d(p){var h,g;const y=p.target;!((h=o.value)!=null&&h.contains(p.target))&&!((g=r.value)!=null&&g.contains(p.target))&&!y.closest("[data-inside-popover]")&&(a.value=!1)}const m=e.ref(!1);e.onMounted(()=>{m.value=!0}),e.onMounted(()=>{var p,y;o.value=((p=n.value)==null?void 0:p.querySelector("[data-popover-trigger]"))||null,(y=o.value)==null||y.addEventListener("click",i),document.addEventListener("click",d),window.addEventListener("resize",c),window.addEventListener("scroll",c,!0)}),e.onBeforeUnmount(()=>{var p;(p=o.value)==null||p.removeEventListener("click",i),document.removeEventListener("click",d),window.removeEventListener("resize",c),window.removeEventListener("scroll",c,!0)});const f=t;return e.watch(a,async p=>{p?(f("open"),await e.nextTick(),c()):f("close")}),(p,y)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:n},[e.renderSlot(p.$slots,"trigger"),m.value?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:"body"},[e.withDirectives(e.createElementVNode("div",{ref_key:"popoverRef",ref:r,class:"absolute z-[50] w-[600px] rounded-md border bg-white shadow-md",style:e.normalizeStyle(u.value)},[e.renderSlot(p.$slots,"default")],4),[[e.vShow,a.value]])])):e.createCommentVNode("",!0)],512))}}),s2={},i2={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",class:"lucide lucide-filter h-4 w-4"};function c2(l,t){return e.openBlock(),e.createElementBlock("svg",i2,[...t[0]||(t[0]=[e.createElementVNode("polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"},null,-1)])])}const d2=Mt(s2,[["render",c2]]),u2={key:0,class:"inline-flex rounded-sm items-center border font-semibold border-transparent hover:bg-secondary/80 bg-blue-500 text-white text-xs px-1.5"},m2={class:"flex"},p2={class:"w-64 border-r border-gray-200"},f2={class:"p-2"},h2=["onClick"],g2={class:"flex items-center gap-2"},b2={class:"text-sm font-medium"},y2={key:0,class:"inline-flex items-center rounded-full border font-semibold transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent hover:bg-secondary/80 bg-blue-100 text-blue-700 text-xs p-2"},k2=["onClick"],x2={class:"flex items-center gap-2"},w2={class:"text-sm font-medium"},_2={key:0,class:"inline-flex items-center rounded-full border font-semibold transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent hover:bg-secondary/80 bg-blue-100 text-blue-700 text-xs p-2"},E2={key:0,class:"p-2 border-t"},C2={class:"flex-1 min-h-[300px] overflow-y-auto"},V2={key:0,class:"flex items-center justify-center h-full text-gray-500"},_s=e.defineComponent({__name:"popover-filter-layout",props:{schema:{},view:{},value:{},history:{type:Boolean},mode:{},limit:{default:3}},emits:["change","clear","clearAll"],setup(l,{expose:t,emit:a}){const r=l,n=ys(r.mode),o=e.useSlots(),s=a,i=e.ref({}),c=e.computed(()=>i!=null&&i.value?r.view!=="inline"?i==null?void 0:i.value:Object.fromEntries(Object.entries(i==null?void 0:i.value).slice(r.limit)):{}),{activeFilter:u,activeFilterCount:d,onFilterChange:m,clearFilter:f,clearAllFilters:p,popoverFiltersSlot:y,selectedFilter:h,filterRef:g}=jr({...r,schema:i.value,slots:o},s);function b(){if(c.value){const[w]=Object.keys(c.value);h.value=w}else y.value.length>0?h.value=y.value[0].props.name:h.value=""}return e.watch(()=>r.schema,w=>{i.value=w},{deep:!0,immediate:!0}),t({clearFilter:f,clearAllFilters:p}),(w,x)=>(e.openBlock(),e.createBlock(o2,{onOpen:b,onClose:x[5]||(x[5]=k=>h.value="")},{trigger:e.withCtx(()=>[e.createElementVNode("button",{"data-popover-trigger":"","aria-haspopup":"dialog","aria-expanded":"false",class:e.normalizeClass(e.unref(n)+(e.unref(d)>0?"bg-blue-50 border-blue-200 text-blue-700 hover:bg-blue-100":"text-gray-800 hover:bg-gray-200 focus:bg-gray-200")),type:"button"},[e.createVNode(d2),x[6]||(x[6]=e.createTextVNode(" Фільтр ",-1)),e.unref(d)>0?(e.openBlock(),e.createElementBlock("div",u2,e.toDisplayString(e.unref(d)),1)):e.createCommentVNode("",!0)],2)]),default:e.withCtx(()=>[e.createElementVNode("div",m2,[e.createElementVNode("div",p2,[x[7]||(x[7]=e.createElementVNode("div",{class:"p-4 border-b"},[e.createElementVNode("p",{class:"text-sm text-gray-600"},"Select a field to start creating a filter.")],-1)),e.createElementVNode("div",f2,[l.schema?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Object.entries(c.value),([k,_])=>{var N;return e.openBlock(),e.createElementBlock("button",{key:k,onClick:()=>{h.value=k},class:e.normalizeClass(["w-full flex items-center justify-between px-3 py-2 text-left hover:bg-gray-50 transition-colors",e.unref(h)===k?"bg-blue-50 text-blue-700 border-l-2 border-blue-500":"text-gray-700"])},[e.createElementVNode("div",g2,[e.createElementVNode("span",b2,e.toDisplayString(_.label),1)]),(Array.isArray(e.unref(u)[k])?((N=e.unref(u)[k])==null?void 0:N.length)>0:e.unref(u)[k]||e.unref(u)[k]===null)?(e.openBlock(),e.createElementBlock("div",y2)):e.createCommentVNode("",!0)],10,h2)}),128)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(y),(k,_)=>{var N;return e.openBlock(),e.createElementBlock("button",{key:"slot-"+_,onClick:V=>h.value=k.props.name,class:e.normalizeClass(["w-full flex items-center justify-between px-3 py-2 text-left hover:bg-gray-50 transition-colors",e.unref(h)===k.props.name?"bg-blue-50 text-blue-700 border-l-2 border-blue-500":""])},[e.createElementVNode("div",x2,[e.createElementVNode("span",w2,e.toDisplayString(k.props.label),1)]),((N=e.unref(u)[k.props.name])==null?void 0:N.length)>0?(e.openBlock(),e.createElementBlock("div",_2)):e.createCommentVNode("",!0)],10,k2)}),128))]),e.unref(d)>0?(e.openBlock(),e.createElementBlock("div",E2,[e.createElementVNode("button",{class:"w-full px-3 py-2 text-left text-sm text-gray-600 hover:bg-gray-50 transition-colors",onClick:x[0]||(x[0]=k=>e.unref(p)()),"data-inside-popover":""}," Очистити всі ")])):e.createCommentVNode("",!0)]),e.createElementVNode("div",C2,[e.unref(h)===""?(e.openBlock(),e.createElementBlock("div",V2,[...x[8]||(x[8]=[e.createElementVNode("p",{class:"text-sm"},"Select a field to start creating a filter.",-1)])])):e.createCommentVNode("",!0),e.unref(h)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[c.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Object.entries(c.value),([k,_])=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(h)===k?(e.openBlock(),e.createBlock(ul,e.mergeProps({key:k,layout:"popover",ref_for:!0,ref_key:"filterRef",ref:g},{ref_for:!0},_,{onChange:x[1]||(x[1]=N=>e.unref(m)(N.name,N.value)),onClear:x[2]||(x[2]=N=>{e.unref(f)(N),e.unref(m)(N,void 0)}),modelValue:e.unref(u)[k],"onUpdate:modelValue":N=>e.unref(u)[k]=N,cleanable:!0}),null,16,["modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0)],64))),256)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(y),(k,_)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"slot-"+_},[e.unref(h)===k.props.name?(e.openBlock(),e.createBlock(ul,e.mergeProps({key:0,layout:"popover"},{ref_for:!0},k.props,{ref_for:!0,ref_key:"filterRef",ref:g,onChange:x[3]||(x[3]=N=>e.unref(m)(N.name,N.value)),onClear:x[4]||(x[4]=N=>{e.unref(f)(N),e.unref(m)(N,void 0)}),modelValue:e.unref(u)[k.props.name],"onUpdate:modelValue":N=>e.unref(u)[k.props.name]=N,cleanable:!0}),null,16,["modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0)],64))),128))],64)):e.createCommentVNode("",!0)])])]),_:1}))}}),N2={class:"flex gap-1 items-center flex-wrap"},Es=e.defineComponent({__name:"inline-filter-layout",props:{schema:{},view:{},value:{},history:{type:Boolean},mode:{},limit:{default:3}},emits:["change","clear","clearAll"],setup(l,{expose:t,emit:a}){const r=vl(),n=l,o=a,s=e.useSlots(),i=e.ref({}),c=e.computed(()=>Object.keys(n.schema).length>n.limit),{activeFilter:u,activeFilterCount:d,onFilterChange:m,clearFilter:f,clearAllFilters:p,limitedSchema:y,filtersSlot:h,limitedFiltersSlot:g}=jr({...n,schema:i,slots:s},o),b=e.ref();function w(){b.value&&b.value.clearAllFilters(!0),p()}return e.watch(()=>n.schema,x=>{i.value=x},{deep:!0,immediate:!0}),t({clearFilter:f,clearAllFilters:p}),(x,k)=>(e.openBlock(),e.createElementBlock("div",N2,[l.schema?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Object.entries(e.unref(y)),([_,N])=>(e.openBlock(),e.createBlock(ul,e.mergeProps({key:_,mode:l.mode},{ref_for:!0},N,{onChange:k[0]||(k[0]=V=>e.unref(m)(V.name,V.value)),onClear:e.unref(f),layout:"inline",cleanable:!0,modelValue:e.unref(u)[_],"onUpdate:modelValue":V=>e.unref(u)[_]=V}),null,16,["mode","onClear","modelValue","onUpdate:modelValue"]))),128)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(g),(_,N)=>(e.openBlock(),e.createBlock(ul,e.mergeProps({key:"slot-"+N,layout:"inline"},{ref_for:!0},_.props,{onChange:k[1]||(k[1]=V=>e.unref(m)(V.name,V.value)),onClear:k[2]||(k[2]=V=>{e.unref(f)(V),e.unref(m)(V,void 0)}),cleanable:!0,modelValue:e.unref(u)[_.props.name],"onUpdate:modelValue":V=>e.unref(u)[_.props.name]=V}),null,16,["modelValue","onUpdate:modelValue"]))),128)),c.value?(e.openBlock(),e.createBlock(_s,e.mergeProps({key:1},n,{schema:l.schema,limit:l.limit,onChange:k[3]||(k[3]=_=>e.unref(m)(_.name,_.value)),onClearAll:k[4]||(k[4]=_=>e.unref(p)()),onClear:k[5]||(k[5]=_=>e.unref(f)(_.name)),mode:l.mode,ref_key:"popoverRef",ref:b,cleanable:!0}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(h),(_,N)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(_),e.mergeProps({key:"slot-"+N,layout:"popover"},{ref_for:!0},_.props,{cleanable:!0}),null,16))),128))]),_:1},16,["schema","limit","mode"])):e.createCommentVNode("",!0),e.unref(d)>0?(e.openBlock(),e.createElementBlock("button",{key:2,onClick:w,class:"relative py-2 px-3 inline-flex justify-center items-center gap-x-2 text-sm font-medium rounded-lg bg-gray-100 border border-transparent text-gray-800 hover:bg-gray-200 focus:bg-gray-200"},e.toDisplayString(e.unref(r)("filter.clear")),1)):e.createCommentVNode("",!0)]))}}),v2={key:0,class:"p-2 overflow-y-auto overflow-hidden [&::-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 dark:bg-neutral-800 max-h-[calc(100%-142px)] h-full bg-gray-100"},B2={class:"flex items-center vst-filters vsTailwind flex-col w-full"},S2=e.defineComponent({__name:"vertical-filter-layout",props:{schema:{},view:{},value:{},history:{type:Boolean},mode:{},limit:{default:3}},emits:["change","clear","clearAll"],setup(l,{expose:t,emit:a}){const r=l,n=a,o=e.useSlots(),{activeFilter:s,activeFilterCount:i,onFilterChange:c,clearFilter:u,clearAllFilters:d,filtersSlot:m}=jr({...r,slots:o},n);return t({clearFilter:u,clearAllFilters:d}),(f,p)=>l.view==="vertical"?(e.openBlock(),e.createElementBlock("div",v2,[e.createElementVNode("div",B2,[e.unref(i)>0?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:p[0]||(p[0]=y=>e.unref(d)()),"data-popover-trigger":"","aria-haspopup":"dialog","aria-expanded":"false",class:"w-full ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:text-accent-foreground border h-10 px-4 py-2 gap-2 m-2 bg-white text-gray-800 hover:bg-gray-200 focus:bg-gray-200",type:"button"}," Очистити ")):e.createCommentVNode("",!0),l.schema?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(Object.entries(l.schema),([y,h])=>(e.openBlock(),e.createBlock(ul,e.mergeProps({layout:"vertical"},{ref_for:!0},h,{onChange:p[1]||(p[1]=g=>e.unref(c)(g.name,g.value)),onClear:p[2]||(p[2]=g=>{e.unref(u)(g),e.unref(c)(g,void 0)}),modelValue:e.unref(s)[y],"onUpdate:modelValue":g=>e.unref(s)[y]=g,showClean:!0}),null,16,["modelValue","onUpdate:modelValue"]))),256)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(m),(y,h)=>(e.openBlock(),e.createBlock(ul,e.mergeProps({key:"slot-"+h,layout:"vertical"},{ref_for:!0},y.props,{onChange:p[3]||(p[3]=g=>e.unref(c)(g.name,g.value)),onClear:p[4]||(p[4]=g=>{e.unref(u)(g),e.unref(c)(g,void 0)}),modelValue:e.unref(s)[y.props.name],"onUpdate:modelValue":g=>e.unref(s)[y.props.name]=g,showClean:!0}),null,16,["modelValue","onUpdate:modelValue"]))),128))])])):e.createCommentVNode("",!0)}}),zr=e.defineComponent({__name:"filter",props:{schema:{},view:{default:"inline"},value:{},history:{type:Boolean},mode:{},limit:{default:3}},emits:["change","clear","clearAll"],setup(l,{expose:t,emit:a}){const r=l,n=e.ref(r.value??{}),o=a,s=e.ref();function i(h){if(Array.isArray(h))return h.map(g=>i(g));if(h!==null&&typeof h=="object"){const g=e.toRaw(h),b={};for(const w in g)b[w]=i(g[w]);return b}return h}function c(h,g){g!==void 0?n.value={...n.value,[h]:g}:delete n.value[h],o("change",{data:i(n.value),name:h,value:i(g)})}function u(h){delete n.value[h],o("clear",{data:i(n.value),name:h}),o("change",{data:i(n.value),name:h,value:null})}function d(){n.value={},o("clear",{data:i(n.value),name:"ALL"}),o("change",{data:i(n.value),name:"ALL",value:null})}const m=e.ref({});function f(){switch(r.view){case"inline":return Es;case"vertical":return S2;case"popover":return _s;default:return Es}}e.watch(()=>r.schema,h=>{if(!h){m.value={};return}if(Array.isArray(h)&&!h.length){m.value={};return}Array.isArray(h)?m.value=h.filter(g=>g.type).reduce((g,b)=>(Object.assign(b,{name:b.id||b.name,type:{datepicker:"date"}[b.type.toLowerCase()]||b.type.toLowerCase(),label:b.label||b.ua}),g[b.name]=b,b.data&&!b.api&&!b.options&&Object.assign(b,{api:`/api/suggest/${b.data}`}),g),{}):(Object.entries(h).forEach(([g,b])=>{Object.assign(b,{name:g||b.name||b.id,type:b.type.toLowerCase()})}),m.value={...h})},{immediate:!0,deep:!0});function p(h){s.value.clearFilter(h),u(h)}function y(){s.value.clearAllFilters(),d()}return e.watch(()=>n.value,h=>{if(r.history){const g=new URL(window.location.href),b=new URLSearchParams(window.location.search);Object.keys(h).length>0?b.set("filter",Object.entries(h).filter(([,w])=>w).map(([w,x])=>`${w}=${x}`).join("|")):b.delete("filter"),g.search=decodeURI(b.toString()),window.history.pushState({},"",g)}}),t({clearAllFilters:y,clearFilter:p}),(h,g)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f()),e.mergeProps(r,{schema:m.value,onChange:g[0]||(g[0]=b=>c(b.name,b.value)),onClear:g[1]||(g[1]=b=>u(b.name)),onClearAll:d,ref_key:"filterRef",ref:s}),{default:e.withCtx(()=>[e.renderSlot(h.$slots,"default")]),_:3},16,["schema"]))}});zr.install=function(l){l.component("Filter",zr),l.component("FilterField",ul)};const D2={class:"flex items-center space-x-1 mb-4"},A2=["onClick"],M2={key:1,class:"flex gap-x-1 items-center px-2 py-1 rounded text-sm font-medium text-slate-700 dark:text-slate-300"},Cs=e.defineComponent({__name:"CollectionsBreadcrumb",props:{items:{}},emits:["navigate"],setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",D2,[e.createElementVNode("button",{class:"flex gap-x-1 items-center px-2 py-1 rounded text-sm font-medium transition-all duration-200 text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20 hover:bg-blue-100 dark:hover:bg-blue-900/30",onClick:a[0]||(a[0]=r=>t.$emit("navigate","collections"))},[e.createVNode(e.unref(xl),{class:"w-3 h-3"}),e.createTextVNode(" "+e.toDisplayString(t.$t("cms.navigation.collections")),1)]),t.items.length>0?(e.openBlock(),e.createBlock(e.unref(bl),{key:0,class:"w-3 h-3 text-slate-400 dark:text-slate-500"})):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(r,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:n},[n<t.items.length-1?(e.openBlock(),e.createElementBlock("button",{key:0,class:"flex gap-x-1 items-center px-2 py-1 rounded text-sm font-medium transition-all duration-200 text-blue-700 dark:text-blue-300 bg-blue-50 dark:bg-blue-900/20 hover:bg-blue-100 dark:hover:bg-blue-900/30",onClick:o=>t.$emit("navigate",r.route)},e.toDisplayString(r.label),9,A2)):(e.openBlock(),e.createElementBlock("span",M2,e.toDisplayString(r.label),1)),n<t.items.length-1?(e.openBlock(),e.createBlock(e.unref(bl),{key:2,class:"w-3 h-3 text-slate-400 dark:text-slate-500"})):e.createCommentVNode("",!0)],64))),128))]))}}),T2={class:"space-y-6 max-w-7xl mx-auto"},L2={class:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between"},$2={class:"flex items-center gap-2"},F2={class:"text-3xl font-bold text-slate-800 dark:text-white mb-2"},I2=["href","title"],O2={key:0,class:"text-card-foreground shadow-lg border-0 bg-white/80 dark:bg-slate-800/80 backdrop-blur-sm"},P2={key:0,class:"p-2 border-b border-gray-200 sm:px-4 sm:py-2 dark:border-gray-700"},R2={class:"flex flex-col gap-4 sm:flex-row"},U2={class:"relative flex items-center gap-2 ml-auto"},j2={key:1,class:"absolute top-full right-1/2 translate-x-1/2 min-w-full p-4 z-10 bg-white border border-gray-300 rounded-md mt-2 dark:bg-slate-800 dark:border-slate-700"},z2={class:"max-h-60 overflow-y-auto overflow-x-hidden"},H2={key:1},Vs=e.defineComponent({__name:"ArticlesPage",setup(l){const t=rt.useRoute(),a=rt.useRouter(),r=e.ref(null),n=e.ref(""),{t:o,locale:s}=Fe(),i=e.ref([]),c=e.inject("cms.menu")||[],u=e.ref(""),d=e.ref(1),m=e.ref(!1),f=e.ref(["title","slug","author","publish_at","published_at","status"]),p=e.ref([]),y=e.ref([]),h=e.ref([]),g=e.ref({}),b=e.ref(0),w=e.ref(!1),x=()=>{var F;let I=(F=r.value)==null?void 0:F.columns.filter(D=>{var z;return(z=f==null?void 0:f.value)==null?void 0:z.includes(D.name)});p.value=I.map(D=>{switch(D.name){case"title":return{...D,title:D.name?D.name.charAt(0).toUpperCase()+D.name.slice(1):"--",icon:Il};case"slug":return{...D,title:D.name?D.name.charAt(0).toUpperCase()+D.name.slice(1):"-",icon:ji};case"author":return{...D,title:D.name?D.name.charAt(0).toUpperCase()+D.name.slice(1):"-",icon:Wi};case"publish_at":return{...D,title:D.name?D.name.charAt(0).toUpperCase()+D.name.slice(1):"-",icon:ua};case"published_at":return{...D,title:D.name?D.name.charAt(0).toUpperCase()+D.name.slice(1):"-",icon:ua};default:return{...D,title:D.name?D.name.charAt(0).toUpperCase()+D.name.slice(1):"-"}}}),m.value=!1},k=e.computed(()=>{var I,F;return(F=(I=c.value)==null?void 0:I.find(D=>D.id===t.params.id))==null?void 0:F.title}),_=e.computed(()=>[{label:k.value||t.params.id,route:`collections/${t.params.id}`}]),N=I=>{I==="collections"?a.push("/collections"):a.push(`/${I}`)},V=()=>{a.push(`/collections/${t.params.id}/create`)},P=async I=>{console.log("handleRemoveArticle"),Ca({title:o("cms.builder.deleteTitle"),message:o("cms.builder.deleteObject"),type:"error",onConfirm:async()=>{await fetch(`/api/cms/${t.params.id}/${I.id}`,{method:"DELETE"}),M()}})},$=I=>{a.push(`/collections/${t.params.id}/${I.id}`)},M=async()=>{if(!w.value){w.value=!0;try{const F=await(await fetch(`/api/cms/${t.params.id}?page=${d.value}&filter=${u.value}`)).json();i.value=F.rows||[],r.value=F;const D=(F.filters||[]).map(z=>{const{extra:ee,title:me,...Ne}=z;return Ne});h.value=D,t.params.id==="pages"&&f.value.push("type"),A(),x()}finally{w.value=!1}}},A=()=>{var F;if(!((F=r.value)!=null&&F.columns))return;const I=r.value.columns.map((D,z)=>({text:D.label,id:D.name}));y.value=[...f.value.map(D=>I.find(z=>z.id===D)).filter(Boolean),...I.filter(D=>!f.value.includes(D.id))]},q=(I,F)=>{if(!F)return!0;const D=F.toLowerCase();return p.value.some(z=>{const ee=I[z.name];return ee&&ee.toString().toLowerCase().includes(D)})},Q=I=>{const F=Object.entries(I==null?void 0:I.data).filter(([,z])=>z!=null).map(([z,ee])=>`${z}=${ee}`).join("|");u.value=F;const D={...t.query};F?D.filter=F:delete D.filter,a.replace({query:D})},R=()=>{if(t.query.filter){u.value=t.query.filter;const I=t.query.filter.split("cms.|"),F={};I.forEach(D=>{const[z,ee]=D.split("cms.=");z&&ee&&(F[z]=ee)}),g.value=F}else u.value="",g.value={},b.value++};return e.onMounted(()=>{R(),M()}),e.watch(()=>t.params.id,()=>{g.value={},u.value="",h.value=[];const I={...t.query};delete I.filter,a.replace({query:I}),b.value++,R(),M()}),e.watch(()=>t.query,async()=>{R(),await e.nextTick(),M()},{deep:!0}),e.watch(d,async()=>{t.query.filter||(u.value="",g.value={},b.value++),await e.nextTick(),M()}),(I,F)=>{var D,z,ee;return e.openBlock(),e.createElementBlock("div",T2,[e.createVNode(Cs,{items:_.value,onNavigate:N},null,8,["items"]),e.createElementVNode("div",L2,[e.createElementVNode("div",$2,[e.createElementVNode("h1",F2,e.toDisplayString(k.value),1),e.createElementVNode("a",{href:`https://cms.opengis.info/${e.unref(s)}/guides/content/`,target:"_blank",title:I.$t("cms.guide.content")},[e.createVNode(e.unref(kl),{class:"w-5 h-5"})],8,I2)]),i.value.length?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:V,class:"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium h-9 px-4 py-2 bg-blue-600 text-white shadow-md transition-all duration-200 transform hover:bg-blue-700 hover:shadow-lg hover:scale-105 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"},[e.createVNode(e.unref(rl),{class:"w-4 h-4 mr-2"}),e.createTextVNode(" "+e.toDisplayString(I.$t("cms.articles.createArticle")),1)])):e.createCommentVNode("",!0)]),i.value.length||u.value.length?(e.openBlock(),e.createElementBlock("div",O2,[(e.openBlock(),e.createElementBlock("div",P2,[e.createElementVNode("div",R2,[(e.openBlock(),e.createBlock(e.unref(zr),{key:b.value,schema:h.value,history:!0,value:g.value,view:"inline",onChange:Q},null,8,["schema","value"])),e.createElementVNode("div",U2,[y.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:"flex items-center gap-2 cursor-pointer text-sm border border-gray-300 rounded-md p-2 dark:text-white",onClick:F[0]||(F[0]=me=>m.value=!m.value)},[e.createElementVNode("p",null,e.toDisplayString(I.$t("cms.articles.showColumns")),1),e.createVNode(e.unref(En),{class:"w-4 h-4"})])):e.createCommentVNode("",!0),y.value.length>0&&m.value?(e.openBlock(),e.createElementBlock("div",j2,[e.createElementVNode("div",z2,[y.value.length>0&&m.value?(e.openBlock(),e.createBlock(e.unref(Jo),{key:0,options:y.value,modelValue:f.value,"onUpdate:modelValue":F[1]||(F[1]=me=>f.value=me)},null,8,["options","modelValue"])):e.createCommentVNode("",!0)]),e.createElementVNode("button",{class:"text-sm bg-blue-600 text-white rounded-md p-2 mt-4 w-full",onClick:x},e.toDisplayString(I.$t("cms.articles.update")),1)])):e.createCommentVNode("",!0)])])])),p.value.length>0?(e.openBlock(),e.createBlock(Wo,{key:1,class:"max-h-[calc(100vh-270px)] overflow-y-auto",rows:i.value,columns:p.value,query:n.value,filterFn:q,onDelete:P,onEdit:$},null,8,["rows","columns","query"])):e.createCommentVNode("",!0),((D=r.value)==null?void 0:D.total)>20?(e.openBlock(),e.createBlock(Ko,{key:2,total:(z=r.value)==null?void 0:z.filtered,count:(ee=r.value)==null?void 0:ee.count,page:d.value,"onUpdate:page":F[2]||(F[2]=me=>d.value=me),limit:20},null,8,["total","count","page"])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",H2,[e.createVNode(Go,{onAction:V})]))])}}}),q2={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"},G2={__name:"CreateForm",setup(l){const t=e.inject("cms.fetchContentTypes"),{t:a}=Fe(),r=rt.useRouter(),n=e.ref({}),o=e.ref(!1),s=e.ref({type:"collection"}),i={name:{type:"text",label:a("cms.builder.scheme.name.label"),required:!0,placeholder:a("cms.builder.scheme.name.placeholder"),validators:["required"]},title:{type:"text",label:a("cms.builder.scheme.title.label"),required:!0,placeholder:a("cms.builder.scheme.title.placeholder"),validators:["required"]},type:{type:"combobox",mode:"combo",label:a("cms.builder.scheme.type.label"),required:!0,placeholder:a("cms.builder.scheme.type.placeholder"),validators:["required"],options:[{text:a("cms.builder.scheme.type.options.collection"),id:"collection"},{text:a("cms.builder.scheme.type.options.single"),id:"single"}]},customTable:{type:"switcher",label:a("cms.builder.scheme.customTable.label")}},c=async()=>{if(await n.value.validate()){xe({type:"warning",title:a("cms.common.actions.warning"),message:a("cms.collections.collectionCreationFailed")});return}try{const m=await(await fetch("/api/cms-type",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s.value)})).json();r.push(`/settings/collections/edit/${m.id}`),t(),xe({type:"success",title:a("cms.common.actions.success"),message:a("cms.collections.collectionCreated")})}catch(d){xe({type:"error",title:a("cms.common.actions.error"),message:a("cms.collections.collectionCreationFailed")}),console.error(d)}};return(u,d)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("button",{onClick:d[0]||(d[0]=m=>o.value=!0),class:"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 h-9 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white shadow-md hover:shadow-lg transition-all duration-200 transform hover:scale-105"},[e.createVNode(e.unref(rl),{class:"w-4 h-4 mr-2"}),e.createTextVNode(" "+e.toDisplayString(u.$t("cms.collections.createCollection")),1)]),e.createVNode(e.unref(Zt),{teleport:"#modal",visible:o.value,title:u.$t("cms.collections.createCollection"),onClose:d[4]||(d[4]=m=>o.value=!1)},{footer:e.withCtx(()=>[e.createElementVNode("div",q2,[e.createElementVNode("button",{class:"inline-flex items-center px-3 py-2 text-sm text-black duration-300 border border-gray-200 rounded-lg gap-x-2 whitespace-nowrap hover:bg-gray-100",onClick:d[3]||(d[3]=m=>o.value=!1)},e.toDisplayString(u.$t("cms.common.actions.cancel")),1),e.createElementVNode("button",{onClick:c,class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"},e.toDisplayString(u.$t("cms.common.actions.save")),1)])]),default:e.withCtx(()=>[e.createVNode(e.unref(Xe),{form:n.value,"onUpdate:form":d[1]||(d[1]=m=>n.value=m),modelValue:s.value,"onUpdate:modelValue":d[2]||(d[2]=m=>s.value=m),schema:i},null,8,["form","modelValue"])]),_:1},8,["visible","title"])]))}};let W2;function K2(){return W2}e.version[0];function Y2(l){return typeof l=="function"?l():e.unref(l)}function Hr(l){if(l instanceof Promise||l instanceof Date||l instanceof RegExp)return l;const t=Y2(l);if(!l||!t)return t;if(Array.isArray(t))return t.map(a=>Hr(a));if(typeof t=="object"){const a={};for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(r==="titleTemplate"||r[0]==="o"&&r[1]==="n"){a[r]=e.unref(t[r]);continue}a[r]=Hr(t[r])}return a}return t}const X2="usehead",Ns=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},vs="__unhead_injection_handler__";function Z2(){if(vs in Ns)return Ns[vs]();const l=e.inject(X2);return!l&&process.env.NODE_ENV!=="production"&&console.warn("Unhead is missing Vue context, falling back to shared context. This may have unexpected results."),l||K2()}function Q2(l,t={}){const a=t.head||Z2();if(a)return a.ssr?a.push(l,t):J2(a,l,t)}function J2(l,t,a={}){const r=e.ref(!1),n=e.ref({});e.watchEffect(()=>{n.value=r.value?{}:Hr(t)});const o=l.push(n.value,a);return e.watch(n,i=>{o.patch(i)}),e.getCurrentInstance()&&(e.onBeforeUnmount(()=>{o.dispose()}),e.onDeactivated(()=>{r.value=!0}),e.onActivated(()=>{r.value=!1})),o}function e_(l,t=300){const a=e.ref(l.value);let r;return e.watch(l,n=>{clearTimeout(r),r=setTimeout(()=>{a.value=n},t)},{immediate:!0}),a}const Qt=(l,t)=>{const a=l.__vccOpts||l;for(const[r,n]of t)a[r]=n;return a},t_={},l_={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 a_(l,t){return e.openBlock(),e.createElementBlock("svg",l_,[...t[0]||(t[0]=[e.createStaticVNode('<line x1="8" x2="21" y1="6" y2="6"></line><line x1="8" x2="21" y1="12" y2="12"></line><line x1="8" x2="21" y1="18" y2="18"></line><line x1="3" x2="3.01" y1="6" y2="6"></line><line x1="3" x2="3.01" y1="12" y2="12"></line><line x1="3" x2="3.01" y1="18" y2="18"></line>',6)])])}const r_=Qt(t_,[["render",a_]]),n_={},o_={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 s_(l,t){return e.openBlock(),e.createElementBlock("svg",o_,[...t[0]||(t[0]=[e.createStaticVNode('<rect width="18" height="18" x="3" y="3" rx="2"></rect><path d="M3 9h18"></path><path d="M3 15h18"></path><path d="M9 3v18"></path><path d="M15 3v18"></path>',5)])])}const i_=Qt(n_,[["render",s_]]),c_={class:"grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-6 pb-6"},d_={class:"flex items-center gap-2 space-y-1.5 p-6 border-b border-slate-200 dark:border-slate-700 bg-gradient-to-r from-slate-50 dark:from-slate-800 to-white dark:to-slate-800"},u_={class:"line-clamp-1 tracking-tight text-lg font-semibold text-slate-800 dark:text-slate-100 vertical-center"},m_={class:"w-full flex flex-col gap-2 p-6"},p_=["title"],f_={class:"flex items-center justify-between gap-2"},h_={class:"text-sm text-slate-600 dark:text-slate-400"},g_={class:"font-semibold text-slate-800 dark:text-slate-100"},b_={class:"flex items-center justify-between gap-2"},y_={class:"text-sm text-slate-500 dark:text-slate-400"},k_={class:"font-semibold text-slate-800 dark:text-slate-100"},x_={class:"flex items-center justify-between gap-2"},w_={class:"text-sm text-slate-500 dark:text-slate-400"},__={class:"text-sm text-slate-600 dark:text-slate-300"},E_={class:"flex items-center justify-between gap-2 mt-6"},C_=["onClick"],V_={class:"text-slate-800 dark:text-slate-200 group-hover:text-green-600 dark:group-hover:text-blue-50"},N_=["onClick"],v_=["onClick"],B_=e.defineComponent({__name:"CollectionsGrid",props:{collections:{},onEdit:{type:Function},onView:{type:Function},onDelete:{type:Function}},emits:["edit","view","delete"],setup(l,{emit:t}){e.ref(!1),e.ref(null);const a=l,r=t,n=(i,c)=>{switch(i){case"edit":r("cms.edit",c),a.onEdit&&a.onEdit(c);break;case"view":r("cms.view",c),a.onView&&a.onView(c);break;case"delete":r("cms.delete",c),a.onDelete&&a.onDelete(c);break}},o=i=>{const c=new Date,u=new Date(i),d=c.getTime()-u.getTime(),m=Math.floor(d/1e3),f=Math.floor(m/60),p=Math.floor(f/60),y=Math.floor(p/24),h=Math.floor(y/7);return h>=2?`${h} weeks ago`:h===1?"1 week ago":y>=2?`${y} days ago`:y===1?"1 day ago":p>=2?`${p} hours ago`:p===1?"1 hour ago":f>=2?`${f} minutes ago`:f===1?"1 minute ago":"just now"},s=i=>{switch(i){case"published":return{icon:wn,text:"Published",classes:"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-200 border-green-200 dark:border-green-700"};case"draft":return{icon:wl,text:"Draft",classes:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-200 border-yellow-200 dark:border-yellow-700"};case"archived":return{icon:Dn,text:"Archived",classes:"bg-gray-100 text-gray-800 dark:bg-gray-900/30 dark:text-gray-300 border-gray-200 dark:border-gray-700"};default:return{icon:kl,text:"--",classes:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-200 border-yellow-200 dark:border-yellow-700"}}};return(i,c)=>(e.openBlock(),e.createElementBlock("div",c_,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.collections,u=>{var d,m,f;return e.openBlock(),e.createElementBlock("div",{key:u.id,class:"rounded-xl text-card-foreground shadow-lg border-0 bg-white dark:bg-slate-800 backdrop-blur-sm hover:shadow-xl transition-all duration-200 transform hover:bg-slate-50"},[e.createElementVNode("div",d_,[u.type==="single"?(e.openBlock(),e.createBlock(e.unref(yl),{key:0,class:"shrink-0 lucide lucide-page w-5 h-5 text-blue-600"})):(e.openBlock(),e.createBlock(e.unref(xl),{key:1,class:"shrink-0 lucide lucide-layers w-5 h-5 text-blue-600"})),e.createElementVNode("p",u_,e.toDisplayString(u.title),1),s(u.status)?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["whitespace-nowrap rounded-md border ml-auto px-2.5 py-0.5 text-xs font-semibold transition-colors hover:bg-secondary/80 flex items-center w-fit bg-green-100 text-green-800 border-green-200 dark:bg-green-900/30 dark:text-green-300 dark:border-green-700",(d=s(u.status))==null?void 0:d.classes])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent((m=s(u.status))==null?void 0:m.icon),{class:"w-3 h-3 mr-1"})),e.createTextVNode(" "+e.toDisplayString((f=s(u.status))==null?void 0:f.text),1)],2)):e.createCommentVNode("",!0)]),e.createElementVNode("div",m_,[e.createElementVNode("p",{class:"text-slate-600 dark:text-slate-300 mb-4 line-clamp-2",title:u.description},e.toDisplayString(u.description!==null?u.description:"No description"),9,p_),e.createElementVNode("div",f_,[e.createElementVNode("p",h_,e.toDisplayString(i.$t("cms.collections.entries"))+":",1),e.createElementVNode("p",g_,e.toDisplayString(u.entries),1)]),e.createElementVNode("div",b_,[e.createElementVNode("p",y_,e.toDisplayString(i.$t("cms.collections.fields"))+":",1),e.createElementVNode("p",k_,e.toDisplayString(u.fields),1)]),e.createElementVNode("div",x_,[e.createElementVNode("p",w_,e.toDisplayString(i.$t("cms.collections.lastModified"))+":",1),e.createElementVNode("p",__,e.toDisplayString(o(u.last_edit)),1)]),e.createElementVNode("div",E_,[e.renderSlot(i.$slots,"actions",{collection:u,handleAction:n},()=>[e.createElementVNode("button",{class:"inline-flex gap-1 items-center justify-center whitespace-nowrap font-medium border rounded-md text-xs h-8 w-4/5 p-0 border-slate-300 bg-white transition-all duration-200 shadow-sm group dark:border-slate-600 dark:bg-slate-700 dark:hover:bg-slate-600 dark:hover:border-slate-500 dark:hover:text-slate-200 hover:bg-green-50 hover:border-green-300",onClick:e.withModifiers(p=>n("edit",u),["stop"])},[e.createVNode(e.unref(wl),{class:"text-slate-800 dark:text-slate-200 w-4 h-4 group-hover:text-green-600 dark:group-hover:text-blue-50"}),e.createElementVNode("span",V_,e.toDisplayString(i.$t("cms.common.actions.edit")),1)],8,C_),e.createElementVNode("button",{class:e.normalizeClass([u.id==="pages"?"disabled":"","inline-flex items-center justify-center whitespace-nowrap font-medium border rounded-md text-xs h-8 w-8 p-0 border-slate-300 bg-white transition-all duration-200 shadow-sm group dark:border-slate-600 dark:bg-slate-700 dark:hover:bg-slate-600 dark:hover:border-slate-500 dark:hover:text-slate-200 hover:bg-red-50 hover:border-red-300"]),onClick:e.withModifiers(p=>u.id==="pages"?null:n("delete",u),["stop"])},[e.createVNode(e.unref(Gt),{class:"text-slate-800 dark:text-slate-200 w-4 h-4 group-hover:text-red-600 dark:group-hover:text-blue-50"})],10,N_),e.createElementVNode("button",{class:e.normalizeClass([u.type==="single"?"disabled cursor-not-allowed":"","inline-flex items-center justify-center whitespace-nowrap font-medium border rounded-md text-xs h-8 w-8 p-0 border-slate-300 bg-white transition-all duration-200 shadow-sm group dark:border-slate-600 dark:bg-slate-700 dark:hover:bg-slate-600 dark:hover:border-slate-500 dark:hover:text-slate-200 hover:bg-blue-50 hover:border-blue-300"]),onClick:e.withModifiers(p=>u.type==="single"?null:n("view",u),["stop"])},[e.createVNode(e.unref(pa),{class:"text-slate-800 dark:text-slate-200 w-4 h-4 group-hover:text-blue-600 dark:group-hover:text-blue-50"})],10,v_)])])])])}),128))]))}}),qr=localStorage.getItem("collectionView"),Da=e.ref(qr==="list"||qr==="grid"?qr:"list");e.watch(Da,l=>{localStorage.setItem("collectionView",l)});function S_(){Da.value=Da.value==="grid"?"list":"grid"}function D_(){return{collectionView:Da,toggleCollectionView:S_}}const A_={class:"space-y-6 max-w-7xl mx-auto"},M_={class:"flex items-center justify-between mb-8"},T_={class:"flex gap-4"},L_={class:"text-3xl font-bold text-slate-800 dark:text-slate-100 mb-2"},$_={class:"text-slate-600 dark:text-slate-300"},F_=["href","title"],I_={class:"flex items-center gap-3"},O_={class:"relative"},P_={class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},R_=["placeholder"],U_={class:"flex items-center bg-white dark:bg-slate-700 border border-slate-200 dark:border-slate-600 rounded-lg p-1 max-w-[fit-content]"},j_=["onClick"],z_=e.defineComponent({__name:"BuilderPage",setup(l){const{t,locale:a}=Fe(),r=rt.useRouter(),n=[{name:"name",title:t("cms.builder.collectionName"),type:"text",icon:xl},{name:"title",title:t("cms.builder.title"),type:"text",icon:xl},{name:"description",title:t("cms.common.description"),type:"text"},{name:"entries",title:t("cms.builder.entries"),type:"number"},{name:"fields",title:t("cms.builder.fields"),type:"number"},{name:"status",title:t("cms.builder.status"),type:"text"},{name:"last_edit",title:t("cms.builder.lastModified"),type:"date"}],o=e.ref(""),s=e_(o,300);Q2({title:()=>t("cms.collections.title")+" | CMS"});const i=e.ref([]),c=e.inject("fetchContentTypes"),u=e.ref(1),d=e.ref(16),m=e.ref(null),{collectionView:f,toggleCollectionView:p}=D_();async function y(){try{const x=s.value?`&search=${encodeURIComponent(String(s.value))}`:"",k=`/api/cms-type?page=${u.value}&limit=${d.value}${x}`;console.log("Fetching collections with URL:",k);const _=await fetch(k);if(!_.ok)throw new Error("Failed to fetch collections");const N=await _.json();console.log("Collections fetched:",N),i.value=N.rows,m.value=N}catch(x){console.error("Error fetching collections:",x)}}e.onMounted(()=>{y()});const h=e.computed(()=>[...i.value].sort((k,_)=>k.id==="pages"?-1:_.id==="pages"?1:0)),g=async x=>{try{await fetch(`/api/cms-type/${x.id}`,{method:"DELETE"}),y(),c()}catch(k){console.error("Error deleting collection:",k)}},b=x=>{r.push(`/settings/collections/edit/${x.id||x.name}`)},w=x=>{x.type==="single"?r.push(`/collections/single/${x.name}`):r.push(`/collections/${x.name}`)};return e.watch(u,()=>{y()}),e.watch(s,x=>{console.log("Search query changed:",x),u.value=1,y()}),(x,k)=>{var _,N,V,P;return e.openBlock(),e.createElementBlock("div",A_,[e.createElementVNode("div",M_,[e.createElementVNode("div",T_,[e.createElementVNode("div",null,[e.createElementVNode("h1",L_,e.toDisplayString(x.$t("cms.builder.collections")),1),e.createElementVNode("p",$_,e.toDisplayString(x.$t("cms.builder.manageContentCollections")),1)]),e.createElementVNode("a",{href:`https://cms.opengis.info/${e.unref(a)}/guides/collections/`,target:"_blank",title:x.$t("cms.guide.collections"),class:"mt-2"},[e.createVNode(e.unref(kl),{class:"w-5 h-5"})],8,F_)]),e.createElementVNode("div",I_,[e.createElementVNode("div",O_,[e.createElementVNode("div",P_,[e.createVNode(e.unref(tr),{class:"w-5 h-5 text-gray-400"})]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"block w-full py-2 pl-10 pr-3 leading-5 text-gray-900 placeholder-gray-500 transition-colors bg-white border border-gray-300 rounded-md dark:border-gray-600 dark:bg-gray-700 dark:placeholder-gray-400 focus:outline-none focus:ring-sky-500 focus:border-sky-500 dark:text-white sm:text-sm",placeholder:x.$t("cms.builder.searchCollections"),"onUpdate:modelValue":k[0]||(k[0]=$=>o.value=$)},null,8,R_),[[e.vModelText,o.value]])]),e.createElementVNode("div",U_,[e.createElementVNode("button",{class:e.normalizeClass(["inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors rounded-md text-xs h-8 w-8 p-0 hover:bg-blue-700 hover:text-white cursor-pointer",{"bg-blue-600 text-white":e.unref(f)==="list"}]),onClick:k[1]||(k[1]=$=>f.value="list")},[e.createVNode(r_,{class:"dark:text-blue-50 w-4 h-4"})],2),e.createElementVNode("button",{class:e.normalizeClass(["inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors rounded-md text-xs h-8 w-8 p-0 hover:bg-blue-700 hover:text-white cursor-pointer",{"bg-blue-600 text-white":e.unref(f)==="grid"}]),onClick:k[2]||(k[2]=$=>f.value="grid")},[e.createVNode(i_,{class:"dark:text-blue-50 w-4 h-4"})],2)]),e.createVNode(G2)])]),e.createElementVNode("div",null,[e.unref(f)==="list"?(e.openBlock(),e.createBlock(Wo,{key:0,class:"max-h-[calc(100vh-270px)] overflow-y-auto overflow-x-hidden",columns:n,rows:h.value,onDelete:g,onEdit:b,onView:w},{actions:e.withCtx(({row:$})=>[e.createElementVNode("button",{class:"inline-flex items-center justify-center whitespace-nowrap font-medium border rounded-md text-xs h-8 w-8 p-0 border-slate-300 bg-white transition-all duration-200 shadow-sm group dark:border-slate-600 dark:bg-slate-700 dark:hover:bg-slate-600 dark:hover:border-slate-500 dark:hover:text-slate-200 hover:bg-blue-50 hover:border-blue-300 hover:text-blue-600",onClick:M=>w($)},[e.createVNode(e.unref(pa),{class:"text-slate-800 dark:text-slate-200 w-4 h-4 group-hover:text-blue-600 dark:group-hover:text-blue-50"})],8,j_)]),_:1},8,["rows"])):e.createCommentVNode("",!0),e.unref(f)==="grid"?(e.openBlock(),e.createBlock(B_,{key:1,collections:h.value,onEdit:b,onView:w,onDelete:g,class:"max-h-[calc(100vh-270px)] overflow-y-auto overflow-x-hidden"},null,8,["collections"])):e.createCommentVNode("",!0),((_=m.value)==null?void 0:_.total)>16?(e.openBlock(),e.createBlock(Ko,{key:2,total:(N=m.value)==null?void 0:N.filtered,count:((V=m.value)==null?void 0:V.count)||((P=m.value)==null?void 0:P.total),page:u.value,"onUpdate:page":k[3]||(k[3]=$=>u.value=$),limit:d.value},null,8,["total","count","page","limit"])):e.createCommentVNode("",!0)])])}}});async function H_(){if(window.monaco)return window.monaco;const l="https://cdn.jsdelivr.net/npm/monaco-editor@0.45.0/min";return window.require||(window.require={paths:{vs:`${l}/vs`}},await new Promise((t,a)=>{const r=document.createElement("cms.script");r.src=`${l}/vs/loader.min.js`,r.onload=()=>t(),r.onerror=a,document.head.appendChild(r)})),new Promise(t=>{window.require(["vs/editor/editor.main"],()=>t(window.monaco))})}const q_=e.defineComponent({__name:"MonacoEditor",props:e.mergeModels({language:{default:"javascript"},theme:{default:"vs-dark"},width:{default:"100%"},height:{default:"100%"},options:{default:()=>({minimap:{enabled:!1}})}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,a=e.useModel(l,"modelValue"),r=e.ref(null);let n=null,o=null;return e.onMounted(async()=>{var s;if(r.value)try{o=await H_();const i=((s=a.value)==null?void 0:s.replace(/\\n/g,`
229
+ `)});return}if(i.value)try{const f=await fetch(`/api/table/${i.value}`,{method:c.value==="add"?"POST":"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(o.value)});if(f.ok)await f.json(),xe({type:"success",title:"Успішно",message:`Дані успішно ${c.value==="add"?"збережено":"оновлено"}`}),r("save",o.value);else if(f.status===400){const p=await f.json().catch(()=>({}));xe({type:"warning",title:"Помилка валідації",message:p.message||"Некоректні дані (400)"})}else f.status===500?xe({type:"error",title:"Серверна помилка",message:"Виникла помилка на сервері (500)"}):xe({type:"error",title:"Помилка",message:`Статус: ${f.status}`})}catch(f){xe({type:"error",title:"Помилка з’єднання",message:f.message||"Не вдалося виконати запит"})}}function d(){r("close")}return e.onMounted(async()=>{try{if(a.form){const m=await fetch(`/api/template/form/${a.form}`);if(!m.ok){xe({type:m.status>=400&&m.status<500?"warning":"error",title:"Error",message:`Error code: ${m.status}`});return}const f=await m.json();n.value=f.schema,i.value=f.token}else if(a.token){i.value=a.token;const m=await fetch(`/api/form/${i.value}`);if(!m.ok){xe({type:m.status>=400&&m.status<500?"warning":"error",title:"Error",message:`Error code: ${m.status}`});return}const f=await m.json();n.value=f.schema,f.data?o.value=f.data:c.value="add"}}catch(m){xe({type:"error",title:"Error",message:m.message||"Unexpected error"}),console.error(m)}}),(m,f)=>(e.openBlock(),e.createElementBlock("div",Kk,[e.createElementVNode("div",Yk,[e.createElementVNode("div",Xk,[e.createElementVNode("div",Zk,[e.createElementVNode("h3",Qk,e.toDisplayString(c.value==="add"?"Додати":"Змінити"),1),e.createElementVNode("button",{onClick:d,type:"button",class:"size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600"},f[2]||(f[2]=[e.createElementVNode("span",{class:"sr-only"},"Close",-1),e.createElementVNode("svg",{class:"flex-shrink-0 w-4 h-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"},[e.createElementVNode("path",{d:"M18 6 6 18"}),e.createElementVNode("path",{d:"m6 6 12 12"})],-1)]))]),e.createElementVNode("div",Jk,[n.value?(e.openBlock(),e.createBlock(Xe,{key:0,schema:n.value,values:o.value,"onUpdate:values":f[0]||(f[0]=p=>o.value=p),form:s.value,"onUpdate:form":f[1]||(f[1]=p=>s.value=p)},null,8,["schema","values","form"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:"vs-form__head mr-5 mb-5 mt-3 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white"},[e.createElementVNode("button",{type:"button",onClick:d,class:"vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-red-500 hover:border-red-500 hover:bg-red-500 focus:ring-red-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 mr-2"}," Скасувати "),e.createElementVNode("button",{onClick:u,type:"button",class:"vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border-1 border-transparent text-white bg-blue-500 hover:bg-blue-600 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1"}," Зберегти ")])])])]))}}),ds=(l={mode:"edit",schema:null})=>new Promise(t=>{const{close:a}=Mf({title:l.mode==="add"?"Додати":"Редагувати",template:"",visible:!0,size:"medium",closeClickBack:!0,content:ex,contentProps:{...l,onClose:()=>{t(null),a()},onSave:r=>{t(r),a()}}})});Xe.install=function(l){l.component("VForm",Xe),Object.assign(l.config.globalProperties,{$form:ds}),l.provide("form",ds),window.v3plugin||(window.v3plugin={})};const Mt=(l,t)=>{const a=l.__vccOpts||l;for(const[r,n]of t)a[r]=n;return a},tx={},lx={xmlns:"http://www.w3.org/2000/svg",width:"15px",height:"24",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-reload absolute inline mr-1 text-gray-800 transition-all cursor-pointer active:rotate-90 right-1 top-1 hover:text-blue-500"};function ax(l,t){return e.openBlock(),e.createElementBlock("svg",lx,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M19.933 13.041a8 8 0 1 1 -9.925 -8.788c3.899 -1 7.935 1.007 9.425 4.747"},null,-1),e.createElementVNode("path",{d:"M20 4v5h-5"},null,-1)])])}const rx=Mt(tx,[["render",ax]]),nx={class:"flex items-center justify-between w-full text-sm"},ox={class:"flex items-center cursor-pointer w-full"},sx={key:0,width:"16",height:"auto",src:"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMTYgMTYnIGZpbGw9J3doaXRlJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnPjxwYXRoIGQ9J00xMi4yMDcgNC43OTNhMSAxIDAgMDEwIDEuNDE0bC01IDVhMSAxIDAgMDEtMS40MTQgMGwtMi0yYTEgMSAwIDAxMS40MTQtMS40MTRMNi41IDkuMDg2bDQuMjkzLTQuMjkzYTEgMSAwIDAxMS40MTQgMHonLz48L3N2Zz4="},ix=["value"],cx={class:"w-[calc(100%-18px)] flex flex-row items-center justify-between pl-[10px]"},dx={class:"flex flex-row items-center font-normal text-gray-800 gap-x-1"},ux={key:0,class:"text-xs text-gray-500 dark:text-neutral-500 pr-1"},Fr=e.defineComponent({__name:"list-item",props:{layout:{},count:{},type:{},label:{},value:{},isSelected:{type:Boolean},color:{},highlighted:{type:Boolean}},emits:["itemClick"],setup(l,{expose:t,emit:a}){const r=l,n=a;function o(){n("itemClick",r.value)}const s=e.ref(null);return t({el:s}),(i,c)=>(e.openBlock(),e.createElementBlock("div",{class:"flex items-center w-full rounded-lg group hover:bg-gray-100",ref_key:"el",ref:s},[e.createElementVNode("div",nx,[e.createElementVNode("div",ox,[e.createElementVNode("label",{for:"radio-9740",class:e.normalizeClass([["inline","popover"].includes(l.layout)?"text-sm text-gray-500 px-2 w-full py-2 cursor-pointer !flex flex-row items-center":"flex flex-row items-center w-full px-2 py-2 text-sm text-gray-500 cursor-pointer",{"bg-blue-100":l.highlighted}]),onClick:e.withModifiers(o,["stop","prevent"])},[e.createElementVNode("div",{class:e.normalizeClass(["w-[18px] h-[18px] border flex items-center justify-center",[l.type=="checkbox"?"rounded-[4px]":"rounded-full",l.color?`bg-[${l.color}] border-[#ffffff]`:l.isSelected?"bg-[#2563eb] border-[#ffffff]":"bg-[#ffffff] border-[#d9d9d9]"]])},[l.isSelected?(e.openBlock(),e.createElementBlock("img",sx)):e.createCommentVNode("",!0)],2),e.createElementVNode("input",{type:"checkbox",class:"hidden",id:"radio-9740",value:l.value},null,8,ix),e.createElementVNode("div",cx,[e.createElementVNode("span",dx,e.toDisplayString(l.label??"Відсутні данні"),1),l.count?(e.openBlock(),e.createElementBlock("div",ux," ("+e.toDisplayString(l.count)+") ",1)):e.createCommentVNode("",!0)])],2)])])],512))}});function us(l,t){const{options:a=[],limit:r=20}=l;function n(x){return Array.isArray(x)?x[0]:x}const o=e.ref(n(l.modelValue)),s=e.ref(""),i=e.ref(!1),c=e.ref([]),u=e.ref("id"),d=e.ref("text"),m=e.ref(!1),f=e.ref(l.layout!=="popover"&&a.length>r);function p(x){const k=x.find(Boolean)??{},_=["id","value","code","key"].find(V=>V in k)??"id",N=["text","label","name","title"].find(V=>V in k)??"text";return{autoValueKey:_,autoLabelKey:N}}if(a.length>0){const x=p(a);u.value=x.autoValueKey,d.value=x.autoLabelKey}const y=e.computed(()=>{const x=c.value;return l.layout==="popover"||m.value?x:x.slice(0,r)});e.watch(()=>l.modelValue,x=>{o.value=n(x)},{immediate:!0}),c.value=[...a].sort((x,k)=>l.sort==="count"?k.count&&x.count?k.count-x.count:0:l.sort==="name"?String(x[d.value]??"").localeCompare(String(k[d.value]??"")):0);function h(x){return o.value===x[u.value]}function g(x){o.value=x[u.value],t("update:modelValue",o.value),t("change",{name:l.name,value:o.value})}function b(){o.value=void 0,t("update:modelValue",o.value),t("clear",l.name)}function w(){m.value=!m.value}return{innerValue:o,searchTerm:s,filteredOptions:y,isSelected:h,selectItem:g,clear:b,toggleShowAll:w,isReqProc:i,showAll:m,isEnableShowAll:f,labelKey:d,valueKey:u,allOptions:c}}const mx={},px={class:"w-48 mx-auto",viewBox:"0 0 178 90",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function fx(l,t){return e.openBlock(),e.createElementBlock("svg",px,[...t[0]||(t[0]=[e.createStaticVNode('<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>',12)])])}const Ir=Mt(mx,[["render",fx]]),hx={},gx={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",class:"icon icon-tabler icons-tabler-outline icon-tabler-chevron-down w-[14px] rotate"};function bx(l,t){return e.openBlock(),e.createElementBlock("svg",gx,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)])])}const Sa=Mt(hx,[["render",bx]]),yx={},kx={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",class:"icon icon-tabler icons-tabler-outline icon-tabler-chevron-down w-[14px] rotate-[180deg]"};function xx(l,t){return e.openBlock(),e.createElementBlock("svg",kx,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)])])}const Or=Mt(yx,[["render",xx]]),wx={key:0,class:"w-full"},_x={class:"flex flex-col items-center justify-center p-5 text-center"},Ex={key:0,class:"flex justify-between p-2 border-t bg-gray-50 text-xs text-gray-500"},Cx={key:1,class:"flex justify-between items-center text-xs text-gray-500 p-1 border-t"},Vx=e.defineComponent({__name:"radio",props:{id:{},name:{},title:{},type:{},label:{},width:{},options:{default:()=>[]},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean,default:!1},layout:{default:"inline"},cleanable:{type:Boolean},limit:{default:10},multi:{type:Boolean},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{},ua:{}},emits:["update:modelValue","change","clear"],setup(l,{expose:t,emit:a}){const r=l,n=e.ref(null),o=a,{innerValue:s,filteredOptions:i,isSelected:c,selectItem:u,clear:d,toggleShowAll:m,isReqProc:f,showAll:p,isEnableShowAll:y,labelKey:h,valueKey:g,allOptions:b}=us({...r,modelValue:r.modelValue??r.default??""},o);return t({clear:d,inputTextRef:n}),e.watch(()=>r.modelValue,w=>{w===void 0&&(s.value=void 0)}),(w,x)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([l.layout==="popover"?"flex flex-col h-full":"flex flex-col vs-filter-checkbox"])},[e.createElementVNode("div",{class:e.normalizeClass([l.layout==="popover"?"flex-1 overflow-y-auto max-h-64 p-2":"",l.layout==="inline"?"flex-1 overflow-y-auto max-h-80":""])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(i),k=>(e.openBlock(),e.createBlock(Fr,{layout:l.layout,key:k[e.unref(g)],count:k.count,label:k[e.unref(h)],color:k.color,type:"radio",value:k[e.unref(g)],"is-selected":e.unref(c)(k),onItemClick:_=>e.unref(u)(k)},null,8,["layout","count","label","color","value","is-selected","onItemClick"]))),128))],2),l.type==="select"&&e.unref(i).length===0&&!e.unref(f)?(e.openBlock(),e.createElementBlock("div",wx,[e.createElementVNode("div",_x,[e.createVNode(Ir),x[4]||(x[4]=e.createElementVNode("div",{class:"max-w-sm mx-auto mt-6"},[e.createElementVNode("p",{class:"font-medium text-gray-800 dark:text-neutral-200"},"За вашим запитом нічого не знайдено"),e.createElementVNode("p",{class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"})],-1))])])):e.createCommentVNode("",!0),l.layout!=="popover"&&l.type!=="select"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[!e.unref(p)&&e.unref(y)?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:x[0]||(x[0]=(...k)=>e.unref(m)&&e.unref(m)(...k)),class:"inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"},[x[5]||(x[5]=e.createTextVNode(" Показати більше ",-1)),e.createVNode(Sa)])):e.createCommentVNode("",!0),e.unref(p)?(e.openBlock(),e.createElementBlock("div",{key:1,onClick:x[1]||(x[1]=(...k)=>e.unref(m)&&e.unref(m)(...k)),class:"inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"},[x[6]||(x[6]=e.createTextVNode(" Показати менше ",-1)),e.createVNode(Or)])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),l.cleanable?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[l.layout==="inline"?(e.openBlock(),e.createElementBlock("div",Ex,[e.createTextVNode(e.toDisplayString(e.unref(s)||e.unref(s)===null?1:0)+" з "+e.toDisplayString(e.unref(b).length)+" обрано ",1),e.withDirectives(e.createElementVNode("button",{class:"text-gray-600 hover:text-gray-800",onClick:x[2]||(x[2]=(...k)=>e.unref(d)&&e.unref(d)(...k))}," Очистити ",512),[[e.vShow,e.unref(s)!==""&&e.unref(s)!==void 0]])])):e.createCommentVNode("",!0),l.layout==="popover"?(e.openBlock(),e.createElementBlock("div",Cx,[e.createElementVNode("span",null,e.toDisplayString(e.unref(s)||e.unref(s)===null?1:0)+" з "+e.toDisplayString(e.unref(b).length)+" обрано",1),e.withDirectives(e.createElementVNode("button",{class:"text-gray-600 hover:text-gray-800",onClick:x[3]||(x[3]=(...k)=>e.unref(d)&&e.unref(d)(...k))}," Очистити ",512),[[e.vShow,e.unref(s)!==""&&e.unref(s)!==void 0]])])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],2))}});function ms(l,t){const{options:a=[],limit:r=20}=l;function n(x){return Array.isArray(x)?x:x?[x]:[]}const o=e.ref(n(l.modelValue)),s=e.ref(""),i=e.ref(!1),c=e.ref([]),u=e.ref("id"),d=e.ref("text"),m=e.ref(!1),f=e.ref(l.layout!=="popover"&&a.length>r);function p(x){const k=x.find(Boolean)??{},_=["id","value","code","key"].find(V=>V in k)??"id",N=["text","label","name","title"].find(V=>V in k)??"text";return{autoValueKey:_,autoLabelKey:N}}if(a.length>0){const x=p(a);u.value=x.autoValueKey,d.value=x.autoLabelKey}const y=e.computed(()=>{const x=c.value;return l.layout==="popover"||m.value?x:x.slice(0,r)});e.watch(()=>l.modelValue,x=>{o.value=n(x)},{immediate:!0}),c.value=[...a].sort((x,k)=>l.sort==="count"?k.count&&x.count?k.count-x.count:0:l.sort==="name"?String(x[d.value]).localeCompare(String(k[d.value])):0);function h(x){return o.value&&o.value.includes(x[u.value])}function g(x){const k=o.value.includes(x[u.value]);o.value=k?o.value.filter(_=>_!==x[u.value]):[...o.value,x[u.value]],t("update:modelValue",o.value),t("change",{name:l.name,value:o.value})}function b(){o.value=[],t("update:modelValue",o.value),t("clear",l.name)}function w(){m.value=!m.value}return{innerValue:o,searchTerm:s,filteredOptions:y,isSelected:h,selectItem:g,clear:b,toggleShowAll:w,isReqProc:i,showAll:m,isEnableShowAll:f,labelKey:d,valueKey:u,allOptions:c}}const ps={en:{search:"Search",more:"Show more",less:"Show less",selected:"selected",clear:"Clear",notfound:"Nothing found",period:"Period",today:"Today",week:"Week",month:"Month",quarter:"Quarter",year:"Year",alltime:"All Time",prev:"Prev",next:"Next"},uk:{search:"Пошук",more:"Показати більше",less:"Показати меньше",selected:"обрано",clear:"Очистити",notfound:"Нічого не знайдено",period:"Період",today:"Сьогодні",week:"Тиждень",month:"Місяць",quarter:"Квартал",year:"Рік",alltime:"Весь час",prev:"Попередній період",next:"Настпуний період"}};function Nx(l){const t=l.split(".")[1];return(ps[localStorage.locale||navigator.language]||ps.uk)[t]}function vl(){const l=e.getCurrentInstance();return l.appContext.config.globalProperties.$i18n?l.appContext.config.globalProperties.$t:Nx}const vx={key:0,class:"w-full"},Bx={class:"flex flex-col items-center justify-center p-5 text-center"},Sx={class:"max-w-sm mx-auto mt-6"},Dx={class:"font-medium text-gray-800 dark:text-neutral-200"},Ax={key:0,class:"flex justify-between p-2 border-t bg-gray-50 text-xs text-gray-500"},Mx={key:1,class:"flex justify-between items-center text-xs text-gray-500 p-1 border-t"},fs=e.defineComponent({__name:"checkbox",props:{id:{},name:{},title:{},type:{},label:{},width:{},options:{default:()=>[]},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean,default:!1},layout:{default:"inline"},cleanable:{type:Boolean},limit:{default:10},multi:{type:Boolean},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{},ua:{}},emits:["update:modelValue","change","clear"],setup(l,{expose:t,emit:a}){const r=vl(),n=l,o=a,{innerValue:s,filteredOptions:i,isSelected:c,selectItem:u,clear:d,toggleShowAll:m,isReqProc:f,showAll:p,isEnableShowAll:y,labelKey:h,valueKey:g,allOptions:b}=ms({...n,modelValue:n.modelValue},o);return e.watch(()=>n.modelValue,w=>{w===void 0&&(s.value=[])}),t({clear:d}),(w,x)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([l.layout==="popover"?"flex flex-col h-full":"flex flex-col vs-filter-checkbox space-y-0.5"])},[e.createElementVNode("div",{class:e.normalizeClass([l.layout==="popover"?"flex-1 overflow-y-auto max-h-64 p-2":"",l.layout==="inline"?"flex-1 overflow-y-auto max-h-80":""])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(i),k=>(e.openBlock(),e.createBlock(Fr,{layout:l.layout,count:k.count,label:k[e.unref(h)],color:k.color,type:"checkbox",value:k[e.unref(g)],"is-selected":e.unref(c)(k),onItemClick:_=>e.unref(u)(k)},null,8,["layout","count","label","color","value","is-selected","onItemClick"]))),256))],2),l.type==="select"&&e.unref(i).length===0&&!e.unref(f)?(e.openBlock(),e.createElementBlock("div",vx,[e.createElementVNode("div",Bx,[e.createVNode(Ir),e.createElementVNode("div",Sx,[e.createElementVNode("p",Dx,e.toDisplayString(e.unref(r)("filter.notfound")),1),x[4]||(x[4]=e.createElementVNode("p",{class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"},null,-1))])])])):e.createCommentVNode("",!0),l.layout!=="popover"&&l.type!=="select"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[!e.unref(p)&&e.unref(y)?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:x[0]||(x[0]=(...k)=>e.unref(m)&&e.unref(m)(...k)),class:"inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"},[e.createTextVNode(e.toDisplayString(e.unref(r)("filter.more"))+" ",1),e.createVNode(Sa)])):e.createCommentVNode("",!0),e.unref(p)?(e.openBlock(),e.createElementBlock("div",{key:1,onClick:x[1]||(x[1]=(...k)=>e.unref(m)&&e.unref(m)(...k)),class:"inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"},[e.createTextVNode(e.toDisplayString(e.unref(r)("filter.less"))+" ",1),e.createVNode(Or)])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),l.cleanable?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[l.layout==="inline"?(e.openBlock(),e.createElementBlock("div",Ax,[e.createTextVNode(e.toDisplayString(e.unref(s).length)+" / "+e.toDisplayString(e.unref(b).length)+" "+e.toDisplayString(e.unref(r)("filter.selected"))+" ",1),e.withDirectives(e.createElementVNode("button",{class:"text-gray-600 hover:text-gray-800",onClick:x[2]||(x[2]=(...k)=>e.unref(d)&&e.unref(d)(...k))},e.toDisplayString(e.unref(r)("filter.clear")),513),[[e.vShow,e.unref(s).length!==0]])])):e.createCommentVNode("",!0),l.layout==="popover"?(e.openBlock(),e.createElementBlock("div",Mx,[e.createElementVNode("span",null,e.toDisplayString(e.unref(s).length)+" / "+e.toDisplayString(e.unref(b).length)+" "+e.toDisplayString(e.unref(r)("filter.selected")),1),e.withDirectives(e.createElementVNode("button",{class:"text-gray-600 hover:text-gray-800",onClick:x[3]||(x[3]=(...k)=>e.unref(d)&&e.unref(d)(...k))},e.toDisplayString(e.unref(r)("filter.clear")),513),[[e.vShow,e.unref(s).length!==0]])])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],2))}}),Tx={},Lx={xmlns:"http://www.w3.org/2000/svg",width:"15px",height:"15px",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-search stroke-gray-500 transition-all"};function $x(l,t){return e.openBlock(),e.createElementBlock("svg",Lx,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"},null,-1),e.createElementVNode("path",{d:"M21 21l-6 -6"},null,-1)])])}const hs=Mt(Tx,[["render",$x]]),Fx={},Ix={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-x stroke-gray-500 hover:stroke-red-500 transition-all",width:"15px",height:"15px"};function Ox(l,t){return e.openBlock(),e.createElementBlock("svg",Ix,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M18 6l-12 12"},null,-1),e.createElementVNode("path",{d:"M6 6l12 12"},null,-1)])])}const gs=Mt(Fx,[["render",Ox]]);class Pr{static getWidthClass(t){return typeof t=="number"?`max-w-[${t}px]`:typeof t=="string"?t.endsWith("%")||t.endsWith("px")?`max-w-[${t}]`:`max-w-${t}`:"w-full"}}const Px={class:"absolute bottom-2/4 translate-y-2/4 cursor-pointer left-3"},Rx=["placeholder"],Ux=e.defineComponent({__name:"text-input",props:{id:{},name:{},title:{},type:{},label:{},width:{default:220},options:{},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean},layout:{default:"inline"},cleanable:{type:Boolean},limit:{},multi:{type:Boolean},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{},ua:{}},emits:["update:modelValue","change","clear"],setup(l,{emit:t}){var u;const a=l,r=e.ref((a.placeholder||a.label||a.title||a.name||"search").toString()),n=t,o=e.ref(((u=a.modelValue)==null?void 0:u.toString())??"");e.watch(()=>a.modelValue,d=>{d!==o.value&&(o.value=(d==null?void 0:d.toString())??"")});let s=null;function i(){if(o.value=o.value.trimStart(),o.value.length===0){c();return}s&&clearTimeout(s),s=setTimeout(()=>{n("update:modelValue",o.value),n("change",{name:a.name,value:o.value})},300)}function c(){o.value="",n("update:modelValue",""),n("clear",a.name)}return(d,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["vs-form-text relative bg-white rounded-lg [&>input]:py-[7px] [&>input]:max-h-[38px] [&>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",l.layout==="inline"?e.unref(Pr).getWidthClass(l.width):"mb-2"+(l.layout==="popover"?" m-2":"")])},[e.createElementVNode("div",Px,[e.createVNode(hs)]),o.value!==""?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:c,class:"absolute bottom-2/4 translate-y-2/4 right-3 cursor-pointer"},[e.createVNode(gs)])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":m[0]||(m[0]=f=>o.value=f),onInput:i,placeholder:r.value,class:"!pr-7 !pl-8 bg-white h-[38px] min-w-[100px] text-sm py-2 px-3 block w-full border border-solid placeholder:text-nowrap border-stone-200 rounded-lg text-sm text-stone-800 placeholder:text-stone-400 focus:border-2 focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"},null,40,Rx),[[e.vModelText,o.value]])],2))}});function bs(l={color:"blue"}){return e.computed(()=>{const t=`w-full px-3 py-2 border-solid border border-gray-300 text-sm rounded focus:outline-none focus:ring-2 focus:ring-${l.color}-500 focus:border-transparent`;return(l==null?void 0:l.size)==="sm"?`${t}h-[32px]`:`${t}h-[38px]`})}function jx(){return"rounded-md font-medium border-gray-200 border-solid disabled:pointer-events-none disabled:opacity-50 px-4 py-2 w-full bg-transparent border text-black text-sm h-[38px]"}function zx(){return"font-medium border-gray-200 border-solid disabled:pointer-events-none disabled:opacity-50 border h-7 rounded-md text-xs px-2 py-1 hover:bg-gray-100"}function ys(l){return l==="ghost"?"inline-flex relative py-2 px-4 items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent text-gray-600 hover:bg-blue-100 hover:text-gray-800 focus:outline-hidden focus:bg-gray-100 focus:text-gray-800 disabled:opacity-50 disabled:pointer-events-none dark:text-gray-500 dark:hover:bg-blue-800/30 dark:hover:text-blue-400 dark:focus:bg-blue-800/30 dark:focus:text-blue-400":l==="soft"?"inline-flex relative py-2 px-4 items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 hover:bg-gray-200 focus:outline-hidden focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:text-blue-400 dark:hover:bg-blue-900 dark:focus:bg-blue-900":"relative border-solid border-gray-200 focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border-input hover:bg-gray-100 border px-4 py-2 gap-2 bg-transparent h-[38px]"}const Hx={key:0,class:"block text-xs font-medium text-gray-600 mb-1"},qx=["placeholder","disabled"],Gx={key:0,class:"block text-xs font-medium text-gray-600 mb-1"},Wx={key:0,class:"block text-xs font-medium text-gray-600 mb-1"},Kx=["placeholder","disabled"],Yx=["disabled"],Xx=e.defineComponent({__name:"range-input",props:{id:{},name:{},title:{},type:{},label:{},width:{},options:{},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean,default:!1},layout:{default:"inline"},cleanable:{type:Boolean},limit:{},multi:{type:Boolean},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{},ua:{}},emits:["update:modelValue","change","clear"],setup(l,{expose:t,emit:a}){const r=bs(),n=jx(),o=vl(),s=l,i=e.ref(s.modelValue??s.default??[]),c=a,u=e.computed({get:()=>s.modelValue??i.value,set:f=>{s.modelValue!==void 0?c("update:modelValue",f):i.value=f}});function d(){c("change",{name:s.name,value:u.value||i.value})}function m(){i.value=[],u.value=i.value,c("clear",s.name)}return e.watch(()=>s.modelValue,f=>{f!==void 0&&s.layout!=="popover"?(i.value=f,c("update:modelValue",f)):i.value=[]}),t({clear:m,currentValue:u}),(f,p)=>{var y,h;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",null,[e.createElementVNode("div",{class:e.normalizeClass(l.layout==="vertical"?"inline-flex items-center gap-2":"space-y-3 p-2")},[e.createElementVNode("div",null,[l.layout!=="vertical"?(e.openBlock(),e.createElementBlock("label",Hx,e.toDisplayString(e.unref(o)("filter.from")),1)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{type:"number",class:e.normalizeClass(e.unref(r)),placeholder:((y=l.placeholder)==null?void 0:y[0])??"min",step:"1",style:{outline:"none"},"onUpdate:modelValue":p[0]||(p[0]=g=>u.value[0]=g),disabled:l.disabled},null,10,qx),[[e.vModelText,u.value[0]]])]),l.layout==="vertical"?(e.openBlock(),e.createElementBlock("label",Gx," - ")):e.createCommentVNode("",!0),e.createElementVNode("div",null,[l.layout!=="vertical"?(e.openBlock(),e.createElementBlock("label",Wx,e.toDisplayString(e.unref(o)("filter.to")),1)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{type:"number",class:e.normalizeClass(e.unref(r)),placeholder:((h=l.placeholder)==null?void 0:h[1])??"max",min:"0",max:"1000000000000000",step:"1",style:{outline:"none"},"onUpdate:modelValue":p[1]||(p[1]=g=>u.value[1]=g),disabled:l.disabled},null,10,Kx),[[e.vModelText,u.value[1]]])]),["popover","inline","vertical"].includes(l.layout)?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:d,class:e.normalizeClass(e.unref(n)+(l.layout==="vertical"?" w-[50px]":" bg-blue-100 hover:bg-blue-200"))},e.toDisplayString(l.layout==="vertical"?"Ok":e.unref(o)("filter.apply")),3)):e.createCommentVNode("",!0),["popover","inline"].includes(l.layout)?(e.openBlock(),e.createElementBlock("button",{key:2,disabled:!(u.value[0]||u.value[1]),onClick:m,class:e.normalizeClass(e.unref(n)+" hover:bg-gray-100")},e.toDisplayString(e.unref(o)("filter.clear")),11,Yx)):e.createCommentVNode("",!0)],2)]),(l.cleanable&&i.value.length,e.createCommentVNode("",!0))],64)}}});function Zx(l){return String(l).charAt(0).toUpperCase()+String(l).slice(1)}let Ze=class{static format(t){const a=t.getFullYear(),r=(t.getMonth()+1).toString().padStart(2,"0"),n=t.getDate().toString().padStart(2,"0");return`${a}-${r}-${n}`}static getShiftedDay(t,a=0){const r=t?new Date(t):new Date;return r.setDate(r.getDate()+a),this.format(r)}static getLastWeekRange(t,a,r=0){if(t&&a){const u=new Date(t),d=new Date(a);return u.setDate(u.getDate()+r*7),d.setDate(d.getDate()+r*7),[this.format(u),this.format(d)]}const n=new Date,o=n.getDay(),s=o===0?13:o-1+7,i=new Date(n);i.setDate(n.getDate()-s+r*7);const c=new Date(i);return c.setDate(i.getDate()+6),[this.format(i),this.format(c)]}static getMonthRange(t,a,r=0){let n;t?n=new Date(t):n=new Date,n=new Date(n.getFullYear(),n.getMonth()+r,1);const o=n,s=new Date(n.getFullYear(),n.getMonth()+1,0);return[this.format(o),this.format(s)]}static getQuarterRange(t,a,r=0){const n=t||a,o=n?new Date(n):new Date;let s=Math.floor(o.getMonth()/3);s+=r;const i=(s%4+4)%4*3,c=o.getFullYear()+Math.floor(s/4),u=new Date(c,i,1),d=new Date(c,i+3,0);return[this.format(u),this.format(d)]}static getYear(t,a=0){let r;return t&&/^\d{4}$/.test(t)?r=parseInt(t,10):t?r=new Date(t).getFullYear():r=new Date().getFullYear(),String(r+a)}static getYearRange(t,a=0){let r;return t&&/^\d{4}$/.test(t)?r=parseInt(t,10):t?r=new Date(t).getFullYear():r=new Date().getFullYear(),[this.format(new Date(r+a,0,1)),this.format(new Date(r+a+1,0,0))]}static getRangeFromDaysBefore(t){const a=new Date,r=new Date(a.getTime());return r.setDate(a.getDate()-t),[this.format(r),this.format(a)]}};function ks(l,t){const{popoverRef:a}=l,r=vl(),n=e.ref(""),o=e.ref(l.modelValue??l.default??[]),s=e.ref(0);function i(){const b=Ze.getRangeFromDaysBefore(s.value);return o.value=[...b],t("change",{name:l.name,value:o.value}),t("update:modelValue",o.value),b}function c(b){var x;n.value=b,(x=a.value)==null||x.close();const w=[];switch(n.value){case"today":w.push(Ze.getShiftedDay()),w.push(Ze.getShiftedDay());break;case"week":w.push(...Ze.getLastWeekRange());break;case"month":w.push(...Ze.getMonthRange());break;case"quarter":w.push(...Ze.getQuarterRange());break;case"year":w.push(...Ze.getYearRange());break;case"last_7_days":s.value=7,i();break;case"range":s.value=7,w.push(...i());break}o.value=[...w],t("change",{name:l.name,value:o.value}),t("update:modelValue",o.value)}function u(){const b=[];switch(n.value){case"today":b.push(Ze.getShiftedDay(o.value[0],1));break;case"week":b.push(...Ze.getLastWeekRange(o.value[0],o.value[1],1));break;case"month":b.push(...Ze.getMonthRange(o.value[0],o.value[1],1));break;case"quarter":b.push(...Ze.getQuarterRange(o.value[0],o.value[1],1));break;case"year":b.push(...Ze.getYearRange(o.value[0],1));break}o.value=[...b],t("change",{name:l.name,value:o.value}),t("update:modelValue",o.value)}function d(){const b=[];switch(n.value){case"today":b.push(Ze.getShiftedDay(o.value[0],-1));break;case"week":b.push(...Ze.getLastWeekRange(o.value[0],o.value[1],-1));break;case"month":b.push(...Ze.getMonthRange(o.value[0],o.value[1],-1));break;case"quarter":b.push(...Ze.getQuarterRange(o.value[0],o.value[1],-1));break;case"year":b.push(...Ze.getYearRange(o.value[0],-1));break}o.value=[...b],t("change",{name:l.name,value:o.value}),t("update:modelValue",o.value)}const m=["Січень","Лютий","Березень","Квітень","Травень","Червень","Липень","Серпень","Вересень","Жовтень","Листопад","Грудень"];function f(b){const[w,x,k]=b.split("-");return`${k}.${x}.${w}`}function p(b,w="long"){const x=new Date(Date.UTC(2e3,b-1,1));return new Intl.DateTimeFormat(localStorage.locale,{month:w,timeZone:"UTC"}).format(x)}function y(b){const{value:w}=o;switch(b){case"today":return f(w[0]);case"range":return"Період";case"week":return w[0]&&w[1]?`${f(w[0])} – ${f(w[1])}`:"";case"quarter":if(w[0]){const x=new Date(w[0]),k=x.getFullYear(),_=x.getMonth();return`${Math.floor(_/3)+1} ${r("filter.quarter")} ${k}`}return"";case"month":if(w[0]){const[x,k]=w[0].split("-");return`${p(parseInt(k,10))} ${x}`}return"";case"year":return w[0]||"";case"last_7_days":return"За останні дні";default:return l.label??""}}const h=e.computed(()=>n.value?y(n.value):l.label??"");function g(){n.value="",o.value=[],t("update:modelValue",[]),t("clear",l.name)}return{activeMode:n,innerValue:o,daysBefore:s,onDaysBeforeChange:i,onSelectChange:c,nextClick:u,prevClick:d,ukMonths:m,formatDisplayDate:f,getModeLabel:y,currentLabel:h,clear:g}}const Qx={key:0,class:"relative flex w-full h-auto gap-2 filter-date m-2 flex-wrap"},Jx={key:0,class:"flex gap-1 !w-[75%] rounded-lg"},ew=["max","disabled"],tw=["min","disabled"],lw={key:0,class:"block text-xs font-medium text-gray-600 mb-1"},aw=["max","disabled"],rw={key:0,class:"block text-xs font-medium text-gray-600 mb-1"},nw={key:0,class:"block text-xs font-medium text-gray-600 mb-1"},ow=["min","disabled"],sw={class:"flex gap-1 pt-2"},iw=["onClick"],cw=e.defineComponent({__name:"date-input",props:{id:{},name:{},title:{},type:{},label:{},width:{},options:{},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean},layout:{default:"inline"},cleanable:{type:Boolean},limit:{},multi:{type:Boolean},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{},ua:{}},emits:["update:modelValue","change","clear"],setup(l,{expose:t,emit:a}){const r=l,n=bs(),o=zx(),s=a,i=e.ref(null),{activeMode:c,innerValue:u,onSelectChange:d,nextClick:m,prevClick:f,clear:p}=ks({...r,popoverRef:i},s);return e.watch(()=>r.modelValue,y=>{y!==void 0?(u.value=y,s("update:modelValue",y)):(c.value="",u.value=[])}),t({clear:p,popoverRef:i}),(y,h)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[l.layout==="inline"?(e.openBlock(),e.createElementBlock("div",Qx,[e.unref(c)!==""&&e.unref(c)==="range"?(e.openBlock(),e.createElementBlock("div",Jx,[e.withDirectives(e.createElementVNode("input",{type:"date",max:e.unref(u)[1],locale:"uk-UA","onUpdate:modelValue":h[0]||(h[0]=g=>e.unref(u)[0]=g),class:"px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-lg focus:outline-blue-600",disabled:l.disabled},null,8,ew),[[e.vModelText,e.unref(u)[0]]]),e.withDirectives(e.createElementVNode("input",{type:"date",min:e.unref(u)[0],locale:"uk-UA","onUpdate:modelValue":h[1]||(h[1]=g=>e.unref(u)[1]=g),class:"px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-lg focus:outline-blue-600 appearance-auto",disabled:l.disabled},null,8,tw),[[e.vModelText,e.unref(u)[1]]])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(l.layout==="popover"?"space-y-3 p-2":"flex items-center gap-2")},[e.createElementVNode("div",{class:e.normalizeClass(l.layout!=="popover"?"w-[48%]":"")},[l.layout==="popover"?(e.openBlock(),e.createElementBlock("label",lw,"Від")):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{type:"date",max:e.unref(u)[1],locale:"uk-UA","onUpdate:modelValue":h[2]||(h[2]=g=>e.unref(u)[0]=g),class:e.normalizeClass(e.unref(n)),disabled:l.disabled},null,10,aw),[[e.vModelText,e.unref(u)[0]]])],2),l.layout!=="popover"?(e.openBlock(),e.createElementBlock("label",rw," - ")):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(l.layout!=="popover"?"w-[48%]":"")},[l.layout==="popover"?(e.openBlock(),e.createElementBlock("label",nw,"До")):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{type:"date",min:e.unref(u)[0],locale:"uk-UA","onUpdate:modelValue":h[3]||(h[3]=g=>e.unref(u)[1]=g),class:e.normalizeClass(e.unref(n)),disabled:l.disabled},null,10,ow),[[e.vModelText,e.unref(u)[1]]])],2)],2),e.createElementVNode("div",sw,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(["today","week","month","quarter","year"],g=>e.createElementVNode("button",{key:g,class:e.normalizeClass(e.unref(o)+(e.unref(c)===g?" bg-blue-100":"")),onClick:b=>e.unref(d)(g)},e.toDisplayString(e.unref(Zx)(g)),11,iw)),64)),e.createElementVNode("button",{class:e.normalizeClass(e.unref(o)),onClick:h[4]||(h[4]=(...g)=>e.unref(f)&&e.unref(f)(...g))}," <",2),e.createElementVNode("button",{class:e.normalizeClass(e.unref(o)),onClick:h[5]||(h[5]=(...g)=>e.unref(m)&&e.unref(m)(...g))}," >",2)]),(l.cleanable,e.createCommentVNode("",!0))],64))}});function dw(l,t){const{api:a,options:r=[],limit:n=20,dataKey:o="data"}=l,s=l.multi;function i(R){return s?Array.isArray(R)?R:R?[R]:[]:Array.isArray(R)?R[0]:R}const c=e.ref(i(l.modelValue)),u=e.ref(""),d=e.ref(!1),m=e.ref(r),f=e.ref("id"),p=e.ref("text"),y=e.ref(!1),h=e.ref(l.layout!=="popover"&&r.length>n),g=e.ref([]),b=e.ref(0);function w(R){const I=R.find(Boolean)??{},F=["id","value","code","key"].find(z=>z in I)??"id",D=["text","label","name","title"].find(z=>z in I)??"text";return{autoValueKey:F,autoLabelKey:D}}if(r.length>0){const R=w(r);f.value=R.autoValueKey,p.value=R.autoLabelKey}const x=e.computed(()=>{if(a)return m.value;const R=m.value;if(l.layout==="popover")return R;if(!u.value)return y.value?R:R.slice(0,n);const I=u.value.toLowerCase();return R.filter(F=>F[p.value].toLowerCase().includes(I))});let k=null;async function _(R){if(a){d.value=!0;try{const I=new URL(a,window.location.origin);I.searchParams.set("json","1"),I.searchParams.set("key",R),I.searchParams.set("limit",n.toString());const F=await fetch(I.toString());if(!F.ok){xe({type:"error",title:"Error",message:"Failed to fetch remote options"}),m.value=[];return}const D=await F.json();if(!D[o]){xe({type:"error",title:"Error",message:D}),m.value=[];return}if(m.value=D[o],m.value.length>0){const z=w(m.value);f.value=z.autoValueKey,p.value=z.autoLabelKey}b.value=D.total}catch(I){console.error("Failed to fetch remote options:",I)}finally{d.value=!1}}}e.watch(u,R=>{a&&(k&&clearTimeout(k),k=setTimeout(()=>{_(R)},200))}),e.watch(()=>l.modelValue,R=>{c.value=i(R)},{immediate:!0});function N(R){return s&&Array.isArray(c.value)?c.value.includes(R[f.value]):c.value&&c.value===R[f.value]}function V(R){if(s&&!Array.isArray(c.value)&&(c.value=[]),s&&Array.isArray(c.value)){const I=c.value.includes(R[f.value]);c.value=I?c.value.filter(F=>F!==R[f.value]):[...c.value,R[f.value]],g.value=I?g.value.filter(F=>F!==R[p.value]):[...g.value,R[p.value]]}else c.value=R[f.value],g.value=R[p.value];t("update:modelValue",c.value),t("change",{name:l.name,value:c.value})}function P(){s?(c.value=[],g.value=[]):(c.value=void 0,g.value=[]),t("update:modelValue",c.value),t("clear",l.name)}function $(){k&&clearTimeout(k),u.value="",y.value=!1}function M(){y.value=!y.value}e.onBeforeUnmount(()=>{k&&clearTimeout(k)});const A=e.ref(-1);e.watch(x,()=>{A.value=x.value.length>0?0:-1});function q(R){const I=x.value.length;if(R.key==="ArrowDown")R.preventDefault(),A.value=(A.value+1)%I;else if(R.key==="ArrowUp")R.preventDefault(),A.value=(A.value-1+I)%I;else if(R.key==="Enter"&&(R.preventDefault(),A.value>=0&&A.value<x.value.length)){const F=x.value[A.value];V(F)}}function Q(){a&&m.value.length===0&&u.value.length===0&&_(u.value)}return{innerValue:c,searchTerm:u,filteredOptions:x,isSelected:N,selectItem:V,clear:P,resetSearch:$,toggleShowAll:M,isReqProc:d,showAll:y,isEnableShowAll:h,labelKey:p,valueKey:f,allOptions:m,highlightedIndex:A,onKeyDown:q,selectedLabels:g,totalCount:b,loadData:Q}}const uw={class:"h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relative justify-center"},mw=["placeholder"],pw={key:0,class:"w-full"},fw={class:"flex flex-col items-center justify-center p-5 text-center"},hw={class:"max-w-sm mx-auto mt-6"},gw={class:"font-medium text-gray-800 dark:text-neutral-200"},bw={key:0,class:"flex justify-between p-2 border-t bg-gray-50 text-xs text-gray-500"},yw={key:1,class:"flex justify-between items-center text-xs text-gray-500 p-1 border-t"},kw=e.defineComponent({__name:"select",props:{id:{},name:{},title:{},type:{},label:{},width:{},options:{default:()=>[]},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean,default:!1},layout:{default:"inline"},cleanable:{type:Boolean},limit:{default:10},multi:{type:Boolean},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{},ua:{}},emits:["update:modelValue","change","clear"],setup(l,{expose:t,emit:a}){const r=vl(),n=l,o=a,s=e.ref(null),{innerValue:i,filteredOptions:c,isSelected:u,selectItem:d,clear:m,resetSearch:f,toggleShowAll:p,isReqProc:y,showAll:h,isEnableShowAll:g,searchTerm:b,labelKey:w,valueKey:x,highlightedIndex:k,onKeyDown:_,selectedLabels:N,totalCount:V,loadData:P}=dw({...n,modelValue:n.modelValue},o);e.onMounted(()=>{f(),n.layout!=="inline"&&(P(),s.value&&n.layout==="popover"&&s.value.focus())}),e.watch(()=>n.modelValue,M=>{M===void 0&&(n.multi?i.value=[]:i.value=void 0)});const $=e.ref([]);return e.watch(k,M=>{var A;M>=0&&$.value[M]&&((A=$.value[M])==null||A.scrollIntoView({block:"nearest",behavior:"smooth"}))}),e.watch(c,()=>{$.value=[]}),t({clear:m,inputTextRef:s,selectedLabels:N,loadData:P}),(M,A)=>{var q,Q;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([l.layout==="popover"?"flex flex-col h-full":"flex flex-col vs-filter-checkbox space-y-0.5"])},[e.createElementVNode("div",uw,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":A[0]||(A[0]=R=>e.isRef(b)?b.value=R:null),onKeydown:A[1]||(A[1]=(...R)=>e.unref(_)&&e.unref(_)(...R)),class:"w-full h-full text-[13px] px-4 border rounded-sm pl-9 focus:outline-none focus:ring-ring focus:ring-1 focus:ring-blue-500 text-gray-700",placeholder:e.unref(r)("filter.search"),type:"text",ref_key:"inputTextRef",ref:s},null,40,mw),[[e.vModelText,e.unref(b)]]),e.createVNode(hs,{class:"absolute text-gray-400 -translate-y-1/2 left-4 top-1/2"}),e.unref(b)!=""?(e.openBlock(),e.createBlock(gs,{key:0,onClick:A[2]||(A[2]=R=>b.value=""),class:"absolute text-gray-400 -translate-y-1/2 cursor-pointer hover:text-red-500 right-4 top-1/2"})):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass([l.layout==="popover"?"flex-1 overflow-y-auto max-h-64 p-2":"",l.layout==="inline"?"flex-1 overflow-y-auto max-h-80":""])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(c),(R,I)=>(e.openBlock(),e.createBlock(Fr,{layout:l.layout,count:R.count,label:R[e.unref(w)],color:R.color,type:l.multi?"checkbox":"radio",value:R[e.unref(x)],"is-selected":e.unref(u)(R),highlighted:I===e.unref(k),onItemClick:F=>e.unref(d)(R),ref_for:!0,ref:F=>$.value[I]=F==null?void 0:F.el},null,8,["layout","count","label","color","type","value","is-selected","highlighted","onItemClick"]))),256))],2),l.type==="select"&&e.unref(c).length===0&&!e.unref(y)?(e.openBlock(),e.createElementBlock("div",pw,[e.createElementVNode("div",fw,[e.createVNode(Ir),e.createElementVNode("div",hw,[e.createElementVNode("p",gw,e.toDisplayString(e.unref(r)("filter.notfound")),1),A[7]||(A[7]=e.createElementVNode("p",{class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"},null,-1))])])])):e.createCommentVNode("",!0),l.layout!=="popover"&&l.type!=="select"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[!e.unref(h)&&e.unref(g)?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:A[3]||(A[3]=(...R)=>e.unref(p)&&e.unref(p)(...R)),class:"inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"},[e.createTextVNode(e.toDisplayString(e.unref(r)("filter.more"))+" ",1),e.createVNode(Sa)])):e.createCommentVNode("",!0),e.unref(h)?(e.openBlock(),e.createElementBlock("div",{key:1,onClick:A[4]||(A[4]=(...R)=>e.unref(p)&&e.unref(p)(...R)),class:"inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"},[e.createTextVNode(e.toDisplayString(e.unref(r)("filter.less"))+" ",1),e.createVNode(Or)])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),l.cleanable?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[l.layout==="inline"?(e.openBlock(),e.createElementBlock("div",bw,[e.createTextVNode(e.toDisplayString(l.multi&&Array.isArray(e.unref(i))?(q=e.unref(i))==null?void 0:q.length:e.unref(i)!==void 0&&(e.unref(i)||e.unref(i)===null)?1:0)+" / "+e.toDisplayString(e.unref(V))+" "+e.toDisplayString(e.unref(r)("filter.selected"))+" ",1),e.withDirectives(e.createElementVNode("button",{class:"text-gray-600 hover:text-gray-800",onClick:A[5]||(A[5]=(...R)=>e.unref(m)&&e.unref(m)(...R))},e.toDisplayString(e.unref(r)("filter.clear")),513),[[e.vShow,e.unref(i)!==""&&e.unref(i)!==void 0||e.unref(i)]])])):e.createCommentVNode("",!0),l.layout==="popover"?(e.openBlock(),e.createElementBlock("div",yw,[e.createElementVNode("span",null,e.toDisplayString(l.multi&&Array.isArray(e.unref(i))?(Q=e.unref(i))==null?void 0:Q.length:e.unref(i)!==void 0&&(e.unref(i)||e.unref(i)===null)?1:0)+" / "+e.toDisplayString(e.unref(V))+" "+e.toDisplayString(e.unref(r)("filter.selected")),1),e.withDirectives(e.createElementVNode("button",{class:"text-gray-600 hover:text-gray-800",onClick:A[6]||(A[6]=(...R)=>e.unref(m)&&e.unref(m)(...R))},e.toDisplayString(e.unref(r)("filter.clear")),513),[[e.vShow,e.unref(i)!==""&&e.unref(i)!==void 0||e.unref(i)]])])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],2)}}}),xw=["for","onClick"],ww=["id","name","value"],_w={class:"block"},Ew={key:0,class:"flex justify-between p-2 border-t bg-gray-50 text-xs text-gray-500"},Cw={key:1,class:"flex justify-between items-center text-xs text-gray-500 p-1 border-t"},Vw=e.defineComponent({__name:"tag-field",props:{id:{},name:{},title:{},type:{},label:{},width:{},options:{default:()=>[]},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean,default:!1},layout:{default:"inline"},cleanable:{type:Boolean},limit:{},multi:{type:Boolean},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{},ua:{}},emits:["update:modelValue","change","clear"],setup(l,{expose:t,emit:a}){const r=l,n=a,{innerValue:o,isSelected:s,selectItem:i,clear:c,labelKey:u,valueKey:d,allOptions:m}=r.multi?ms({...r,modelValue:r.modelValue??r.default??[]},n):us({...r,modelValue:r.modelValue!==void 0?r.modelValue:r.default??""},n);return t({clear:c}),e.watch(()=>r.modelValue,f=>{f===void 0&&(r.multi?o.value=[]:o.value=void 0)}),(f,p)=>{var y,h;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["grid grid-cols-3 gap-2 mx-[1px]",l.layout==="popover"?"m-1":"mb-1"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(m),g=>(e.openBlock(),e.createElementBlock("label",{key:`item-${g[e.unref(d)]}`,for:`item-${g[e.unref(d)]}`,onClick:e.withModifiers(b=>e.unref(i)(g),["stop","prevent"]),class:e.normalizeClass([e.unref(s)(g)?"ring-2 ring-indigo-600":"","p-2.5 group relative flex justify-center items-center gap-x-12 text-center text-xs bg-white text-gray-800 border border-gray-200 cursor-pointer rounded-lg dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-200 peer-checked:text-indigo-600 dark:has-checked:text-indigo-500 peer-checked:border-indigo-600 dark:has-checked:border-indigo-500 peer-checked:ring peer-checked:shadow focus:ring dark:has-checked:ring-indigo-500 has-disabled:pointer-events-none has-disabled:text-gray-200 dark:has-disabled:text-neutral-700 has-disabled:after:absolute has-disabled:after:inset-0 has-disabled:after:bg-[linear-gradient(to_right_bottom,transparent_calc(50%-1px),var(--color-gray-200)_calc(50%-1px),var(--color-gray-200)_50%,transparent_50%)] dark:has-disabled:after:bg-[linear-gradient(to_right_bottom,transparent_calc(50%-1px),var(--color-neutral-700)_calc(50%-1px),var(--color-neutral-700)_50%,transparent_50%)]"])},[e.createElementVNode("input",{type:"checkbox",id:`item-${g[e.unref(d)]}`,class:"hidden w4poy border-gray-200 g41z1 g22e3 axcnw dark:text-indigo-500 dark:border-neutral-700 dark:focus:ring-neutral-900",name:`item-${g[e.unref(d)]}`,value:g[e.unref(d)]},null,8,ww),e.createElementVNode("span",_w,e.toDisplayString(g[e.unref(u)]),1)],10,xw))),128))],2),l.cleanable?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[l.layout==="inline"?(e.openBlock(),e.createElementBlock("div",Ew,[e.createTextVNode(e.toDisplayString(l.multi&&Array.isArray(e.unref(o))?(y=e.unref(o))==null?void 0:y.length:e.unref(o)!==void 0&&(e.unref(o)||e.unref(o)===null)?1:0)+" з "+e.toDisplayString(e.unref(m).length)+" обрано ",1),e.withDirectives(e.createElementVNode("button",{class:"text-gray-600 hover:text-gray-800",onClick:p[0]||(p[0]=(...g)=>e.unref(c)&&e.unref(c)(...g))}," Очистити ",512),[[e.vShow,e.unref(o)!==""&&e.unref(o)!==void 0||e.unref(o)]])])):e.createCommentVNode("",!0),l.layout==="popover"?(e.openBlock(),e.createElementBlock("div",Cw,[e.createElementVNode("span",null,e.toDisplayString(l.multi&&Array.isArray(e.unref(o))?(h=e.unref(o))==null?void 0:h.length:e.unref(o)!==void 0&&(e.unref(o)||e.unref(o)===null)?1:0)+" з "+e.toDisplayString(e.unref(m).length)+" обрано",1),e.withDirectives(e.createElementVNode("button",{class:"text-gray-600 hover:text-gray-800",onClick:p[1]||(p[1]=(...g)=>e.unref(c)&&e.unref(c)(...g))}," Очистити ",512),[[e.vShow,e.unref(o)!==void 0&&e.unref(o)!==""||e.unref(o)]])])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64)}}}),Nw=["disabled","title"],vw={key:0,class:"absolute top-0 end-0 inline-flex min-h-[10px] min-w-[10px] z-10 items-center py-0.5 rounded-full text-xs font-medium transform -translate-y-1/2 translate-x-1/2 bg-blue-600 text-white px-1"},Bw={class:"w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg focus:outline-none focus:bg-stone-100 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full"},Sw={class:"w-[360px] max-h-[500px] overflow-auto [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-1 [&::-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 before:w-full p-2"},Rr=e.defineComponent({__name:"popover-field",props:{disabled:{type:Boolean,default:!1},label:{},en:{},ua:{},uk:{},fr:{},de:{},es:{},currentValue:{},fieldRef:{},width:{},mode:{},layout:{}},setup(l,{expose:t}){const a=l,r=e.computed(()=>ys(a.mode)),n=e.ref(!1),o=e.ref({top:0,left:0}),s=e.ref(null),i=e.ref(null),c=e.ref(null);function u(){const w=i.value,x=c.value;if(!w||!x)return;const k=w.getBoundingClientRect(),_=x.offsetWidth,N=window.innerWidth,V=k.bottom+8;let{left:P}=k;P+_>N&&(P=Math.max(N-_-10,10)),o.value={top:V,left:P}}function d(){console.log("~~~~~~~~~~"),console.log(n.value),n.value=!n.value,console.log(n.value),n.value&&e.nextTick(()=>{var w,x,k,_,N,V,P;u(),(w=a.fieldRef)!=null&&w.inputTextRef&&((_=(k=(x=a.fieldRef)==null?void 0:x.inputTextRef)==null?void 0:k.focus)==null||_.call(k)),(N=a.fieldRef)!=null&&N.loadData&&((P=(V=a.fieldRef)==null?void 0:V.loadData)==null||P.call(V))})}function m(w){var x,k,_;!((x=s.value)!=null&&x.contains(w.target))&&!((k=c.value)!=null&&k.contains(w.target))&&!((_=i.value)!=null&&_.contains(w.target))&&(n.value=!1)}function f(w){w.key==="Escape"&&(n.value=!1)}const p=e.ref(!1),y=e.ref("ua"),h=w=>{w.detail.key==="locale"&&(y.value=w.detail.newValue)};e.onMounted(()=>{p.value=!0,y.value=localStorage.locale,window.addEventListener("storage",h),document.addEventListener("click",m,!0),document.addEventListener("keydown",f),window.addEventListener("scroll",u,!0)}),e.onBeforeUnmount(()=>{window.removeEventListener("resize",h),document.removeEventListener("click",m,!0),document.removeEventListener("keydown",f),window.removeEventListener("scroll",u,!0)});function g(){n.value=!1}t({close:g});const b=e.computed(()=>{var x;const w=(x=a.fieldRef)==null?void 0:x.selectedLabels;return!w||["inline"].includes(a.layout||"")?a[y.value]||(a.label??""):Array.isArray(w)?w.length>0?w.join(", "):a.label??"":String(w)});return(w,x)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("button",{onClick:d,disabled:l.disabled,ref_key:"triggerRef",ref:i,title:l.label,class:e.normalizeClass(r.value+" "+(l.width?e.unref(Pr).getWidthClass(l.width):"w-full"))},[e.createElementVNode("span",{class:e.normalizeClass(["truncate text-ellipsis block",l.width?e.unref(Pr).getWidthClass(l.width-50):"w-full"])},e.toDisplayString(b.value),3),e.createVNode(Sa,{class:"h-4 w-4"}),(Array.isArray(l.currentValue)?l.currentValue===null||l.currentValue.length>0:l.currentValue===null||l.currentValue)&&l.layout==="inline"?(e.openBlock(),e.createElementBlock("span",vw)):e.createCommentVNode("",!0)],10,Nw),p.value?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:"body"},[e.withDirectives(e.createElementVNode("div",{ref_key:"popperRef",ref:c,class:"vsTailwind vs-popover__content bottom-right w-fit fixed z-[1000]",style:e.normalizeStyle({top:`${o.value.top}px`,left:`${o.value.left}px`}),"data-inside-popover":""},[e.createElementVNode("div",Bw,[e.createElementVNode("div",Sw,[e.renderSlot(w.$slots,"default")])])],4),[[e.vShow,n.value]])])):e.createCommentVNode("",!0)]))}}),Dw={},Aw={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",class:"text-blue-600 w-[16px] h-[16px]"};function Mw(l,t){return e.openBlock(),e.createElementBlock("svg",Aw,[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M20 6 9 17l-5-5"},null,-1)])])}const dl=Mt(Dw,[["render",Mw]]),Tw={},Lw={xmlns:"http://www.w3.org/2000/svg",width:"15px",height:"24",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 text-gray-800 rotate-[90deg]"};function $w(l,t){return e.openBlock(),e.createElementBlock("svg",Lw,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)])])}const Fw=Mt(Tw,[["render",$w]]),Iw={},Ow={xmlns:"http://www.w3.org/2000/svg",width:"15px",height:"24",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 text-gray-800 rotate-[270deg]"};function Pw(l,t){return e.openBlock(),e.createElementBlock("svg",Ow,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)])])}const Rw=Mt(Iw,[["render",Pw]]),Uw={class:"flex"},jw={class:"mb-1"},zw={class:"mb-1"},Hw={class:"inline-flex rounded-lg shrink-0 pl-1"},qw=["title"],Gw={class:"inline-flex rounded-lg shrink-0 pl-1"},Ww=["title"],Kw={key:1,class:"flex gap-1 !w-[75%] rounded-lg"},Yw=["max","disabled"],Xw=["min","disabled"],Zw=e.defineComponent({__name:"date-input-inline",props:{id:{},name:{},title:{},type:{},label:{},width:{},options:{},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean},layout:{default:"inline"},cleanable:{type:Boolean},limit:{},multi:{type:Boolean},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{},ua:{}},emits:["update:modelValue","change","clear"],setup(l,{expose:t,emit:a}){const r=vl(),n=l,o=a,s=e.ref(null),{activeMode:i,innerValue:c,onSelectChange:u,nextClick:d,prevClick:m,currentLabel:f,clear:p}=ks({...n,popoverRef:s},o);return e.watch(()=>n.modelValue,y=>{y!==void 0?(c.value=y,o("update:modelValue",y)):(i.value="",c.value=[])}),t({clear:p,popoverRef:s}),(y,h)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Uw,[e.createVNode(Rr,{ref_key:"popoverRef",ref:s,label:e.unref(f),"current-value":e.unref(c),mode:l.mode,onClear:e.unref(p),layout:l.layout},{default:e.withCtx(()=>[e.createElementVNode("div",null,[e.createElementVNode("button",{type:"button",onClick:h[0]||(h[0]=g=>e.unref(u)("range")),class:"flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"},[e.createTextVNode(e.toDisplayString(e.unref(r)("filter.period"))+" ",1),e.unref(i)==="range"?(e.openBlock(),e.createBlock(dl,{key:0})):e.createCommentVNode("",!0)])]),h[12]||(h[12]=e.createElementVNode("div",null,[e.createElementVNode("div",{class:"pt-1 mt-1 border-t"})],-1)),e.createElementVNode("div",null,[e.createElementVNode("button",{type:"button",onClick:h[1]||(h[1]=g=>e.unref(u)("today")),class:"flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"},[e.createTextVNode(e.toDisplayString(e.unref(r)("filter.today"))+" ",1),e.unref(i)==="today"?(e.openBlock(),e.createBlock(dl,{key:0})):e.createCommentVNode("",!0)])]),e.createElementVNode("div",null,[e.createElementVNode("button",{type:"button",onClick:h[2]||(h[2]=g=>e.unref(u)("week")),class:"flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"},[e.createTextVNode(e.toDisplayString(e.unref(r)("filter.week"))+" ",1),e.unref(i)==="week"?(e.openBlock(),e.createBlock(dl,{key:0})):e.createCommentVNode("",!0)])]),e.createElementVNode("div",null,[e.createElementVNode("button",{type:"button",onClick:h[3]||(h[3]=g=>e.unref(u)("month")),class:"flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"},[e.createTextVNode(e.toDisplayString(e.unref(r)("filter.month"))+" ",1),e.unref(i)==="month"?(e.openBlock(),e.createBlock(dl,{key:0})):e.createCommentVNode("",!0)])]),e.createElementVNode("div",null,[e.createElementVNode("button",{type:"button",onClick:h[4]||(h[4]=g=>e.unref(u)("quarter")),class:"flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"},[e.createTextVNode(e.toDisplayString(e.unref(r)("filter.quarter"))+" ",1),e.unref(i)==="quarter"?(e.openBlock(),e.createBlock(dl,{key:0})):e.createCommentVNode("",!0)])]),e.createElementVNode("div",jw,[e.createElementVNode("button",{type:"button",onClick:h[5]||(h[5]=g=>e.unref(u)("year")),class:"flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"},[e.createTextVNode(e.toDisplayString(e.unref(r)("filter.year"))+" ",1),e.unref(i)==="year"?(e.openBlock(),e.createBlock(dl,{key:0})):e.createCommentVNode("",!0)])]),e.createElementVNode("div",zw,[e.createElementVNode("button",{type:"button",onClick:h[6]||(h[6]=g=>e.unref(p)()),class:"flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"},[e.createTextVNode(e.toDisplayString(e.unref(r)("filter.alltime"))+" ",1),e.unref(c)[0]?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(dl,{key:0}))])])]),_:1},8,["label","current-value","mode","onClear","layout"]),e.unref(i)!==""&&e.unref(i)!=="range"&&e.unref(i)!=="last_7_days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",Hw,[e.createElementVNode("button",{type:"button",title:e.unref(r)("filter.prev"),class:"inline-flex h-[38px] items-center px-2 text-sm text-gray-800 bg-gray-100 gap-x-2 -ms-px first:rounded-s-lg first:ms-0 last:rounded-e-lg focus:z-10 hover:bg-gray-200 focus:bg-gray-200 duration-300",onClick:h[7]||(h[7]=(...g)=>e.unref(m)&&e.unref(m)(...g))},[e.createVNode(Fw)],8,qw)]),e.createElementVNode("div",Gw,[e.createElementVNode("button",{type:"button",title:e.unref(r)("filter.next"),class:"inline-flex h-[38px] items-center px-2 text-sm text-gray-800 gap-x-2 bg-gray-100 -ms-px first:rounded-s-lg first:ms-0 last:rounded-e-lg focus:z-10 hover:bg-gray-200 focus:bg-gray-200 duration-300",onClick:h[8]||(h[8]=(...g)=>e.unref(d)&&e.unref(d)(...g))},[e.createVNode(Rw)],8,Ww)])],64)):e.createCommentVNode("",!0),e.unref(i)!==""&&e.unref(i)==="range"?(e.openBlock(),e.createElementBlock("div",Kw,[e.withDirectives(e.createElementVNode("input",{type:"date",max:e.unref(c)[1],locale:"uk-UA","onUpdate:modelValue":h[9]||(h[9]=g=>e.unref(c)[0]=g),class:"px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-lg focus:outline-blue-600",disabled:l.disabled},null,8,Yw),[[e.vModelText,e.unref(c)[0]]]),e.withDirectives(e.createElementVNode("input",{type:"date",min:e.unref(c)[0],locale:"uk-UA","onUpdate:modelValue":h[10]||(h[10]=g=>e.unref(c)[1]=g),class:"px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-lg focus:outline-blue-600 appearance-auto",disabled:l.disabled},null,8,Xw),[[e.vModelText,e.unref(c)[1]]])])):e.createCommentVNode("",!0)]),(l.cleanable,e.createCommentVNode("",!0))],64))}}),xs={radio:Vx,checkbox:fs,check:fs,text:Ux,range:Xx,date:cw,select:kw,tag:Vw,"date:inline":Zw};function Ur(l,t){let a;switch(l.toLowerCase()){case"autocomplete":a="select";break;case"check":a="checkbox";break;default:a=l==null?void 0:l.toString().toLowerCase()}return a==="date"&&t&&t==="inline"&&(a="date:inline"),{component:xs[a]||xs.text,type:a}}const Qw={style:{display:"inline-flex",margin:"0px",width:"100%"}},Jw={class:"relative w-full mb-2 p-4 bg-white rounded-lg shadow-sm"},e2={class:"block mb-3 text-sm font-medium text-gray-800 dark:text-neutral-200"},t2={class:"flex items-center"},l2={class:"text-sm font-medium max-w-[80%] text-gray-800 flex items-center gap-x-1"},a2={class:"filter-layout__body"},r2=e.defineComponent({__name:"vertical-layout",props:{id:{},name:{},title:{},type:{},label:{},width:{},options:{},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean},layout:{},cleanable:{type:Boolean},limit:{},multi:{type:Boolean},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{},ua:{}},emits:["update:modelValue","change","clear"],setup(l,{expose:t,emit:a}){const r=l,n=a,o=e.ref(),s=Ur(r.type,r.layout),i=e.computed({get:()=>r.modelValue,set:m=>n("update:modelValue",m)});function c(m){n("clear",m)}function u(m,f){n("change",{name:m,value:f}),r.modelValue!==void 0&&n("update:modelValue",f)}function d(){o.value&&o.value.clear(),n("clear",r.name)}return e.watch(()=>r.default,m=>{i.value=m}),e.watch(()=>r.modelValue,m=>{i.value=m}),t({filterRef:o}),(m,f)=>{var p,y,h;return e.openBlock(),e.createElementBlock("div",Qw,[e.createElementVNode("div",Jw,[e.createElementVNode("div",e2,[e.createElementVNode("div",t2,[e.createElementVNode("span",l2,e.toDisplayString(l.label),1)]),typeof i.value=="string"&&i.value.trim()!==""||Array.isArray(i.value)&&i.value.length>0&&i.value.some(g=>g!==void 0)||i.value===null?(e.openBlock(),e.createBlock(rx,{key:0,onClick:d})):e.createCommentVNode("",!0)]),e.createElementVNode("div",a2,[((p=e.unref(s))==null?void 0:p.type)!=="select"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent((y=e.unref(s))==null?void 0:y.component),e.mergeProps({key:0},r,{type:(h=e.unref(s))==null?void 0:h.type,onChange:f[0]||(f[0]=g=>u(g.name,g.value)),onClear:f[1]||(f[1]=g=>c(g)),ref_key:"filterRef",ref:o}),null,16,["type"])):(e.openBlock(),e.createBlock(Rr,{key:1,"current-value":i.value,label:l.label,mode:l.mode,onClear:d,fieldRef:o.value,width:void 0,disabled:l.disabled,layout:"vertical"},{default:e.withCtx(()=>{var g,b;return[(e.openBlock(),e.createBlock(e.resolveDynamicComponent((g=e.unref(s))==null?void 0:g.component),e.mergeProps({ref_key:"filterRef",ref:o},r,{type:(b=e.unref(s))==null?void 0:b.type,onChange:f[2]||(f[2]=w=>u(w.name,w.value)),onClear:f[3]||(f[3]=w=>c(w))}),null,16,["type"]))]}),_:1},8,["current-value","label","mode","fieldRef","disabled"]))])])])}}}),ws=e.defineComponent({__name:"inline-layout",props:{id:{},name:{},title:{},type:{},label:{},width:{},options:{},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean},layout:{},cleanable:{type:Boolean},limit:{},multi:{type:Boolean},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{},ua:{}},emits:["update:modelValue","change","clear"],setup(l,{expose:t,emit:a}){const r=l,n=a,o=e.ref(),s=Ur(r.type,r.layout),i=e.computed({get:()=>r.modelValue,set:d=>n("update:modelValue",d)});function c(d=r.name){n("clear",d)}function u(d,m){n("change",{name:d,value:m}),r.modelValue!==void 0&&n("update:modelValue",m)}return e.watch(()=>r.default,d=>{i.value=d}),e.watch(()=>r.modelValue,d=>{i.value=d}),t({filterRef:o}),(d,m)=>{var f,p;return["text","date"].includes(l.type.toLocaleLowerCase())?(e.openBlock(),e.createBlock(e.resolveDynamicComponent((f=e.unref(s))==null?void 0:f.component),e.mergeProps({key:0},r,{type:(p=e.unref(s))==null?void 0:p.type,onChange:m[0]||(m[0]=y=>u(y.name,y.value)),onClear:m[1]||(m[1]=y=>c(y)),disabled:l.disabled,modelValue:i.value,"onUpdate:modelValue":m[2]||(m[2]=y=>i.value=y)}),null,16,["type","disabled","modelValue"])):(e.openBlock(),e.createBlock(Rr,{key:1,"current-value":i.value,label:l.label,mode:l.mode,onClear:c,fieldRef:o.value,width:r.width,disabled:l.disabled,layout:"inline"},{default:e.withCtx(()=>{var y,h;return[(e.openBlock(),e.createBlock(e.resolveDynamicComponent((y=e.unref(s))==null?void 0:y.component),e.mergeProps({ref_key:"filterRef",ref:o},r,{modelValue:i.value,"onUpdate:modelValue":m[3]||(m[3]=g=>i.value=g),type:(h=e.unref(s))==null?void 0:h.type,onChange:m[4]||(m[4]=g=>u(g.name,g.value)),onClear:m[5]||(m[5]=g=>c(g))}),null,16,["modelValue","type"]))]}),_:1},8,["current-value","label","mode","fieldRef","width","disabled"]))}}}),n2=e.defineComponent({__name:"popover-layout",props:{id:{},name:{},title:{},type:{},label:{},width:{},options:{},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean},layout:{},cleanable:{type:Boolean},limit:{},multi:{type:Boolean},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{},ua:{}},emits:["update:modelValue","change","clear"],setup(l,{expose:t,emit:a}){const r=l,n=a,o=e.ref(),s=e.ref(Ur(r.type,r.layout)),i=e.computed({get:()=>r.modelValue,set:d=>n("update:modelValue",d)});function c(d){n("clear",d)}function u(d,m){n("change",{name:d,value:m}),r.modelValue!==void 0&&n("update:modelValue",m)}return e.watch(()=>r.default,d=>{i.value=d}),e.watch(()=>r.modelValue,d=>{i.value=d}),e.watch(()=>r,d=>{i.value=d}),t({filterRef:o}),(d,m)=>{var f,p;return e.openBlock(),e.createBlock(e.resolveDynamicComponent((f=s.value)==null?void 0:f.component),e.mergeProps(r,{type:(p=s.value)==null?void 0:p.type,modelValue:i.value,"onUpdate:modelValue":m[0]||(m[0]=y=>i.value=y),onChange:m[1]||(m[1]=y=>u(y.name,y.value)),onClear:m[2]||(m[2]=y=>c(y)),ref_key:"filterRef",ref:o}),null,16,["type","modelValue"])}}}),ul=e.defineComponent({__name:"filter-field",props:{id:{},name:{},title:{},type:{},label:{},width:{},options:{default:()=>[]},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean,default:!1},layout:{default:"inline"},cleanable:{type:Boolean},limit:{default:10},multi:{type:Boolean,default:!0},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{default:"name"},ua:{}},emits:["update:modelValue","change","clear"],setup(l,{expose:t,emit:a}){const r=l,n=a,o=e.ref(),s=e.computed({get:()=>r.modelValue,set:d=>n("update:modelValue",d)});function i(d){n("clear",d)}function c(d,m){n("change",{name:d,value:m}),r.modelValue!==void 0&&n("update:modelValue",m)}e.watch(()=>r.default,d=>{s.value=d}),e.watch(()=>r.modelValue,d=>{s.value=d}),t({filterRef:o});function u(){switch(r.layout){case"inline":return ws;case"vertical":return r2;case"popover":return n2;default:return ws}}return(d,m)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(u()),e.mergeProps(r,{onChange:m[0]||(m[0]=f=>c(f.name,f.value)),onClear:m[1]||(m[1]=f=>i(f)),modelValue:s.value,"onUpdate:modelValue":m[2]||(m[2]=f=>s.value=f)}),null,16,["modelValue"]))}});function jr(l,t){const{slots:a}=l,r=e.ref(l.value??{}),n=e.computed(()=>{var g;return(e.toRaw((g=a==null?void 0:a.default)==null?void 0:g.call(a))??[]).flatMap(b=>Array.isArray(b.children)?b.children:[b])});function o(g){delete r.value[g],t("clear",{data:e.toRaw(r.value),name:g})}function s(g,b){b===void 0?o(g):r.value={...r.value,[g]:b},t("change",{data:e.toRaw(r.value),name:g,value:b})}const i=e.computed(()=>n.value.map(g=>{var w;const b=(w=g.props)==null?void 0:w.name;return e.cloneVNode(g,{...g.props,layout:l.view,showClean:!0,modelValue:r.value[b],"onUpdate:modelValue":x=>{s(b,x)},onClear:()=>o(b)})})),c=e.computed(()=>new Map(i.value.map(g=>{var w;const b=(w=g.props)==null?void 0:w.name;return b?[b,g]:null}).filter(g=>g!==null)));function u(g=!1){r.value={},g||t("clearAll",{data:e.toRaw(r.value),name:"ALL"})}const d=e.ref(""),m=e.computed(()=>{var g;return(g=l.schema)!=null&&g.value?Object.entries(r.value).filter(([b,w])=>l.schema&&!(b in l.schema.value)?!1:Array.isArray(w)?w.some(x=>x!==""&&x!==void 0):w!==""&&w!==void 0).length:0}),f=e.ref();e.watch(d,async()=>{var g,b;await e.nextTick(),(b=(g=f==null?void 0:f.value)==null?void 0:g.filterRef)!=null&&b.inputTextRef&&f.value.filterRef.inputTextRef.focus()});const p=e.computed(()=>{var g,b;return(g=l.schema)!=null&&g.value?Object.fromEntries(Object.entries((b=l.schema)==null?void 0:b.value).slice(0,l.limit)):{}}),y=e.computed(()=>{var b;if(i.value.length===0)return[];let g=0;if((b=l.schema)!=null&&b.value){const w=Object.entries(l.schema.value).length;l.limit&&w<l.limit?g=l.limit-w:g=0}return i.value.slice(0,g)}),h=e.computed(()=>i.value.length===0?[]:l.view!=="inline"?i.value:i.value.slice(y.value.length));return{activeFilter:r,activeFilterCount:m,onFilterChange:s,clearFilter:o,clearAllFilters:u,limitedSchema:p,filtersSlot:i,limitedFiltersSlot:y,popoverFiltersSlot:h,vnodeMap:c,selectedFilter:d,filterRef:f}}const o2=e.defineComponent({__name:"popover",emits:["open","close"],setup(l,{emit:t}){const a=e.ref(!1),r=e.ref(null),n=e.ref(null),o=e.ref(null),s=e.ref({top:"0px",left:"0px",position:"absolute"});function i(){a.value=!a.value}function c(){const p=o.value,y=r.value;if(!p||!y)return;const h=p.getBoundingClientRect(),g=y.offsetWidth,b=window.innerWidth-h.left;let w=h.left+window.scrollX;g>b&&(w=window.innerWidth-g-8,w<8&&(w=8)),s.value={position:"absolute",top:`${h.bottom+window.scrollY+8}px`,left:`${w}px`}}const u=e.computed(()=>Object.entries(s.value).map(p=>p.join(":")).join(";"));function d(p){var h,g;const y=p.target;!((h=o.value)!=null&&h.contains(p.target))&&!((g=r.value)!=null&&g.contains(p.target))&&!y.closest("[data-inside-popover]")&&(a.value=!1)}const m=e.ref(!1);e.onMounted(()=>{m.value=!0}),e.onMounted(()=>{var p,y;o.value=((p=n.value)==null?void 0:p.querySelector("[data-popover-trigger]"))||null,(y=o.value)==null||y.addEventListener("click",i),document.addEventListener("click",d),window.addEventListener("resize",c),window.addEventListener("scroll",c,!0)}),e.onBeforeUnmount(()=>{var p;(p=o.value)==null||p.removeEventListener("click",i),document.removeEventListener("click",d),window.removeEventListener("resize",c),window.removeEventListener("scroll",c,!0)});const f=t;return e.watch(a,async p=>{p?(f("open"),await e.nextTick(),c()):f("close")}),(p,y)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:n},[e.renderSlot(p.$slots,"trigger"),m.value?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:"body"},[e.withDirectives(e.createElementVNode("div",{ref_key:"popoverRef",ref:r,class:"absolute z-[50] w-[600px] rounded-md border bg-white shadow-md",style:e.normalizeStyle(u.value)},[e.renderSlot(p.$slots,"default")],4),[[e.vShow,a.value]])])):e.createCommentVNode("",!0)],512))}}),s2={},i2={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",class:"lucide lucide-filter h-4 w-4"};function c2(l,t){return e.openBlock(),e.createElementBlock("svg",i2,[...t[0]||(t[0]=[e.createElementVNode("polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"},null,-1)])])}const d2=Mt(s2,[["render",c2]]),u2={key:0,class:"inline-flex rounded-sm items-center border font-semibold border-transparent hover:bg-secondary/80 bg-blue-500 text-white text-xs px-1.5"},m2={class:"flex"},p2={class:"w-64 border-r border-gray-200"},f2={class:"p-2"},h2=["onClick"],g2={class:"flex items-center gap-2"},b2={class:"text-sm font-medium"},y2={key:0,class:"inline-flex items-center rounded-full border font-semibold transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent hover:bg-secondary/80 bg-blue-100 text-blue-700 text-xs p-2"},k2=["onClick"],x2={class:"flex items-center gap-2"},w2={class:"text-sm font-medium"},_2={key:0,class:"inline-flex items-center rounded-full border font-semibold transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent hover:bg-secondary/80 bg-blue-100 text-blue-700 text-xs p-2"},E2={key:0,class:"p-2 border-t"},C2={class:"flex-1 min-h-[300px] overflow-y-auto"},V2={key:0,class:"flex items-center justify-center h-full text-gray-500"},_s=e.defineComponent({__name:"popover-filter-layout",props:{schema:{},view:{},value:{},history:{type:Boolean},mode:{},limit:{default:3}},emits:["change","clear","clearAll"],setup(l,{expose:t,emit:a}){const r=l,n=ys(r.mode),o=e.useSlots(),s=a,i=e.ref({}),c=e.computed(()=>i!=null&&i.value?r.view!=="inline"?i==null?void 0:i.value:Object.fromEntries(Object.entries(i==null?void 0:i.value).slice(r.limit)):{}),{activeFilter:u,activeFilterCount:d,onFilterChange:m,clearFilter:f,clearAllFilters:p,popoverFiltersSlot:y,selectedFilter:h,filterRef:g}=jr({...r,schema:i.value,slots:o},s);function b(){if(c.value){const[w]=Object.keys(c.value);h.value=w}else y.value.length>0?h.value=y.value[0].props.name:h.value=""}return e.watch(()=>r.schema,w=>{i.value=w},{deep:!0,immediate:!0}),t({clearFilter:f,clearAllFilters:p}),(w,x)=>(e.openBlock(),e.createBlock(o2,{onOpen:b,onClose:x[5]||(x[5]=k=>h.value="")},{trigger:e.withCtx(()=>[e.createElementVNode("button",{"data-popover-trigger":"","aria-haspopup":"dialog","aria-expanded":"false",class:e.normalizeClass(e.unref(n)+(e.unref(d)>0?"bg-blue-50 border-blue-200 text-blue-700 hover:bg-blue-100":"text-gray-800 hover:bg-gray-200 focus:bg-gray-200")),type:"button"},[e.createVNode(d2),x[6]||(x[6]=e.createTextVNode(" Фільтр ",-1)),e.unref(d)>0?(e.openBlock(),e.createElementBlock("div",u2,e.toDisplayString(e.unref(d)),1)):e.createCommentVNode("",!0)],2)]),default:e.withCtx(()=>[e.createElementVNode("div",m2,[e.createElementVNode("div",p2,[x[7]||(x[7]=e.createElementVNode("div",{class:"p-4 border-b"},[e.createElementVNode("p",{class:"text-sm text-gray-600"},"Select a field to start creating a filter.")],-1)),e.createElementVNode("div",f2,[l.schema?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Object.entries(c.value),([k,_])=>{var N;return e.openBlock(),e.createElementBlock("button",{key:k,onClick:()=>{h.value=k},class:e.normalizeClass(["w-full flex items-center justify-between px-3 py-2 text-left hover:bg-gray-50 transition-colors",e.unref(h)===k?"bg-blue-50 text-blue-700 border-l-2 border-blue-500":"text-gray-700"])},[e.createElementVNode("div",g2,[e.createElementVNode("span",b2,e.toDisplayString(_.label),1)]),(Array.isArray(e.unref(u)[k])?((N=e.unref(u)[k])==null?void 0:N.length)>0:e.unref(u)[k]||e.unref(u)[k]===null)?(e.openBlock(),e.createElementBlock("div",y2)):e.createCommentVNode("",!0)],10,h2)}),128)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(y),(k,_)=>{var N;return e.openBlock(),e.createElementBlock("button",{key:"slot-"+_,onClick:V=>h.value=k.props.name,class:e.normalizeClass(["w-full flex items-center justify-between px-3 py-2 text-left hover:bg-gray-50 transition-colors",e.unref(h)===k.props.name?"bg-blue-50 text-blue-700 border-l-2 border-blue-500":""])},[e.createElementVNode("div",x2,[e.createElementVNode("span",w2,e.toDisplayString(k.props.label),1)]),((N=e.unref(u)[k.props.name])==null?void 0:N.length)>0?(e.openBlock(),e.createElementBlock("div",_2)):e.createCommentVNode("",!0)],10,k2)}),128))]),e.unref(d)>0?(e.openBlock(),e.createElementBlock("div",E2,[e.createElementVNode("button",{class:"w-full px-3 py-2 text-left text-sm text-gray-600 hover:bg-gray-50 transition-colors",onClick:x[0]||(x[0]=k=>e.unref(p)()),"data-inside-popover":""}," Очистити всі ")])):e.createCommentVNode("",!0)]),e.createElementVNode("div",C2,[e.unref(h)===""?(e.openBlock(),e.createElementBlock("div",V2,[...x[8]||(x[8]=[e.createElementVNode("p",{class:"text-sm"},"Select a field to start creating a filter.",-1)])])):e.createCommentVNode("",!0),e.unref(h)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[c.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Object.entries(c.value),([k,_])=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(h)===k?(e.openBlock(),e.createBlock(ul,e.mergeProps({key:k,layout:"popover",ref_for:!0,ref_key:"filterRef",ref:g},{ref_for:!0},_,{onChange:x[1]||(x[1]=N=>e.unref(m)(N.name,N.value)),onClear:x[2]||(x[2]=N=>{e.unref(f)(N),e.unref(m)(N,void 0)}),modelValue:e.unref(u)[k],"onUpdate:modelValue":N=>e.unref(u)[k]=N,cleanable:!0}),null,16,["modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0)],64))),256)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(y),(k,_)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"slot-"+_},[e.unref(h)===k.props.name?(e.openBlock(),e.createBlock(ul,e.mergeProps({key:0,layout:"popover"},{ref_for:!0},k.props,{ref_for:!0,ref_key:"filterRef",ref:g,onChange:x[3]||(x[3]=N=>e.unref(m)(N.name,N.value)),onClear:x[4]||(x[4]=N=>{e.unref(f)(N),e.unref(m)(N,void 0)}),modelValue:e.unref(u)[k.props.name],"onUpdate:modelValue":N=>e.unref(u)[k.props.name]=N,cleanable:!0}),null,16,["modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0)],64))),128))],64)):e.createCommentVNode("",!0)])])]),_:1}))}}),N2={class:"flex gap-1 items-center flex-wrap"},Es=e.defineComponent({__name:"inline-filter-layout",props:{schema:{},view:{},value:{},history:{type:Boolean},mode:{},limit:{default:3}},emits:["change","clear","clearAll"],setup(l,{expose:t,emit:a}){const r=vl(),n=l,o=a,s=e.useSlots(),i=e.ref({}),c=e.computed(()=>Object.keys(n.schema).length>n.limit),{activeFilter:u,activeFilterCount:d,onFilterChange:m,clearFilter:f,clearAllFilters:p,limitedSchema:y,filtersSlot:h,limitedFiltersSlot:g}=jr({...n,schema:i,slots:s},o),b=e.ref();function w(){b.value&&b.value.clearAllFilters(!0),p()}return e.watch(()=>n.schema,x=>{i.value=x},{deep:!0,immediate:!0}),t({clearFilter:f,clearAllFilters:p}),(x,k)=>(e.openBlock(),e.createElementBlock("div",N2,[l.schema?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Object.entries(e.unref(y)),([_,N])=>(e.openBlock(),e.createBlock(ul,e.mergeProps({key:_,mode:l.mode},{ref_for:!0},N,{onChange:k[0]||(k[0]=V=>e.unref(m)(V.name,V.value)),onClear:e.unref(f),layout:"inline",cleanable:!0,modelValue:e.unref(u)[_],"onUpdate:modelValue":V=>e.unref(u)[_]=V}),null,16,["mode","onClear","modelValue","onUpdate:modelValue"]))),128)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(g),(_,N)=>(e.openBlock(),e.createBlock(ul,e.mergeProps({key:"slot-"+N,layout:"inline"},{ref_for:!0},_.props,{onChange:k[1]||(k[1]=V=>e.unref(m)(V.name,V.value)),onClear:k[2]||(k[2]=V=>{e.unref(f)(V),e.unref(m)(V,void 0)}),cleanable:!0,modelValue:e.unref(u)[_.props.name],"onUpdate:modelValue":V=>e.unref(u)[_.props.name]=V}),null,16,["modelValue","onUpdate:modelValue"]))),128)),c.value?(e.openBlock(),e.createBlock(_s,e.mergeProps({key:1},n,{schema:l.schema,limit:l.limit,onChange:k[3]||(k[3]=_=>e.unref(m)(_.name,_.value)),onClearAll:k[4]||(k[4]=_=>e.unref(p)()),onClear:k[5]||(k[5]=_=>e.unref(f)(_.name)),mode:l.mode,ref_key:"popoverRef",ref:b,cleanable:!0}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(h),(_,N)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(_),e.mergeProps({key:"slot-"+N,layout:"popover"},{ref_for:!0},_.props,{cleanable:!0}),null,16))),128))]),_:1},16,["schema","limit","mode"])):e.createCommentVNode("",!0),e.unref(d)>0?(e.openBlock(),e.createElementBlock("button",{key:2,onClick:w,class:"relative py-2 px-3 inline-flex justify-center items-center gap-x-2 text-sm font-medium rounded-lg bg-gray-100 border border-transparent text-gray-800 hover:bg-gray-200 focus:bg-gray-200"},e.toDisplayString(e.unref(r)("filter.clear")),1)):e.createCommentVNode("",!0)]))}}),v2={key:0,class:"p-2 overflow-y-auto overflow-hidden [&::-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 dark:bg-neutral-800 max-h-[calc(100%-142px)] h-full bg-gray-100"},B2={class:"flex items-center vst-filters vsTailwind flex-col w-full"},S2=e.defineComponent({__name:"vertical-filter-layout",props:{schema:{},view:{},value:{},history:{type:Boolean},mode:{},limit:{default:3}},emits:["change","clear","clearAll"],setup(l,{expose:t,emit:a}){const r=l,n=a,o=e.useSlots(),{activeFilter:s,activeFilterCount:i,onFilterChange:c,clearFilter:u,clearAllFilters:d,filtersSlot:m}=jr({...r,slots:o},n);return t({clearFilter:u,clearAllFilters:d}),(f,p)=>l.view==="vertical"?(e.openBlock(),e.createElementBlock("div",v2,[e.createElementVNode("div",B2,[e.unref(i)>0?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:p[0]||(p[0]=y=>e.unref(d)()),"data-popover-trigger":"","aria-haspopup":"dialog","aria-expanded":"false",class:"w-full ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:text-accent-foreground border h-10 px-4 py-2 gap-2 m-2 bg-white text-gray-800 hover:bg-gray-200 focus:bg-gray-200",type:"button"}," Очистити ")):e.createCommentVNode("",!0),l.schema?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(Object.entries(l.schema),([y,h])=>(e.openBlock(),e.createBlock(ul,e.mergeProps({layout:"vertical"},{ref_for:!0},h,{onChange:p[1]||(p[1]=g=>e.unref(c)(g.name,g.value)),onClear:p[2]||(p[2]=g=>{e.unref(u)(g),e.unref(c)(g,void 0)}),modelValue:e.unref(s)[y],"onUpdate:modelValue":g=>e.unref(s)[y]=g,showClean:!0}),null,16,["modelValue","onUpdate:modelValue"]))),256)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(m),(y,h)=>(e.openBlock(),e.createBlock(ul,e.mergeProps({key:"slot-"+h,layout:"vertical"},{ref_for:!0},y.props,{onChange:p[3]||(p[3]=g=>e.unref(c)(g.name,g.value)),onClear:p[4]||(p[4]=g=>{e.unref(u)(g),e.unref(c)(g,void 0)}),modelValue:e.unref(s)[y.props.name],"onUpdate:modelValue":g=>e.unref(s)[y.props.name]=g,showClean:!0}),null,16,["modelValue","onUpdate:modelValue"]))),128))])])):e.createCommentVNode("",!0)}}),zr=e.defineComponent({__name:"filter",props:{schema:{},view:{default:"inline"},value:{},history:{type:Boolean},mode:{},limit:{default:3}},emits:["change","clear","clearAll"],setup(l,{expose:t,emit:a}){const r=l,n=e.ref(r.value??{}),o=a,s=e.ref();function i(h){if(Array.isArray(h))return h.map(g=>i(g));if(h!==null&&typeof h=="object"){const g=e.toRaw(h),b={};for(const w in g)b[w]=i(g[w]);return b}return h}function c(h,g){g!==void 0?n.value={...n.value,[h]:g}:delete n.value[h],o("change",{data:i(n.value),name:h,value:i(g)})}function u(h){delete n.value[h],o("clear",{data:i(n.value),name:h}),o("change",{data:i(n.value),name:h,value:null})}function d(){n.value={},o("clear",{data:i(n.value),name:"ALL"}),o("change",{data:i(n.value),name:"ALL",value:null})}const m=e.ref({});function f(){switch(r.view){case"inline":return Es;case"vertical":return S2;case"popover":return _s;default:return Es}}e.watch(()=>r.schema,h=>{if(!h){m.value={};return}if(Array.isArray(h)&&!h.length){m.value={};return}Array.isArray(h)?m.value=h.filter(g=>g.type).reduce((g,b)=>(Object.assign(b,{name:b.id||b.name,type:{datepicker:"date"}[b.type.toLowerCase()]||b.type.toLowerCase(),label:b.label||b.ua}),g[b.name]=b,b.data&&!b.api&&!b.options&&Object.assign(b,{api:`/api/suggest/${b.data}`}),g),{}):(Object.entries(h).forEach(([g,b])=>{Object.assign(b,{name:g||b.name||b.id,type:b.type.toLowerCase()})}),m.value={...h})},{immediate:!0,deep:!0});function p(h){s.value.clearFilter(h),u(h)}function y(){s.value.clearAllFilters(),d()}return e.watch(()=>n.value,h=>{if(r.history){const g=new URL(window.location.href),b=new URLSearchParams(window.location.search);Object.keys(h).length>0?b.set("filter",Object.entries(h).filter(([,w])=>w).map(([w,x])=>`${w}=${x}`).join("|")):b.delete("filter"),g.search=decodeURI(b.toString()),window.history.pushState({},"",g)}}),t({clearAllFilters:y,clearFilter:p}),(h,g)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f()),e.mergeProps(r,{schema:m.value,onChange:g[0]||(g[0]=b=>c(b.name,b.value)),onClear:g[1]||(g[1]=b=>u(b.name)),onClearAll:d,ref_key:"filterRef",ref:s}),{default:e.withCtx(()=>[e.renderSlot(h.$slots,"default")]),_:3},16,["schema"]))}});zr.install=function(l){l.component("Filter",zr),l.component("FilterField",ul)};const D2={class:"flex items-center space-x-1 mb-4"},A2=["onClick"],M2={key:1,class:"flex gap-x-1 items-center px-2 py-1 rounded text-sm font-medium text-slate-700 dark:text-slate-300"},Cs=e.defineComponent({__name:"CollectionsBreadcrumb",props:{items:{}},emits:["navigate"],setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",D2,[e.createElementVNode("button",{class:"flex gap-x-1 items-center px-2 py-1 rounded text-sm font-medium transition-all duration-200 text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20 hover:bg-blue-100 dark:hover:bg-blue-900/30",onClick:a[0]||(a[0]=r=>t.$emit("navigate","collections"))},[e.createVNode(e.unref(xl),{class:"w-3 h-3"}),e.createTextVNode(" "+e.toDisplayString(t.$t("cms.navigation.collections")),1)]),t.items.length>0?(e.openBlock(),e.createBlock(e.unref(bl),{key:0,class:"w-3 h-3 text-slate-400 dark:text-slate-500"})):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(r,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:n},[n<t.items.length-1?(e.openBlock(),e.createElementBlock("button",{key:0,class:"flex gap-x-1 items-center px-2 py-1 rounded text-sm font-medium transition-all duration-200 text-blue-700 dark:text-blue-300 bg-blue-50 dark:bg-blue-900/20 hover:bg-blue-100 dark:hover:bg-blue-900/30",onClick:o=>t.$emit("navigate",r.route)},e.toDisplayString(r.label),9,A2)):(e.openBlock(),e.createElementBlock("span",M2,e.toDisplayString(r.label),1)),n<t.items.length-1?(e.openBlock(),e.createBlock(e.unref(bl),{key:2,class:"w-3 h-3 text-slate-400 dark:text-slate-500"})):e.createCommentVNode("",!0)],64))),128))]))}}),T2={class:"space-y-6 max-w-7xl mx-auto"},L2={class:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between"},$2={class:"flex items-center gap-2"},F2={class:"text-3xl font-bold text-slate-800 dark:text-white mb-2"},I2=["href","title"],O2={key:0,class:"text-card-foreground shadow-lg border-0 bg-white/80 dark:bg-slate-800/80 backdrop-blur-sm"},P2={key:0,class:"p-2 border-b border-gray-200 sm:px-4 sm:py-2 dark:border-gray-700"},R2={class:"flex flex-col gap-4 sm:flex-row"},U2={class:"relative flex items-center gap-2 ml-auto"},j2={key:1,class:"absolute top-full right-1/2 translate-x-1/2 min-w-full p-4 z-10 bg-white border border-gray-300 rounded-md mt-2 dark:bg-slate-800 dark:border-slate-700"},z2={class:"max-h-60 overflow-y-auto overflow-x-hidden"},H2={key:1},Vs=e.defineComponent({__name:"ArticlesPage",setup(l){const t=rt.useRoute(),a=rt.useRouter(),r=e.ref(null),n=e.ref(""),{t:o,locale:s}=Fe(),i=e.ref([]),c=e.inject("cms.menu")||[],u=e.ref(""),d=e.ref(1),m=e.ref(!1),f=e.ref(["title","slug","author","publish_at","published_at","status"]),p=e.ref([]),y=e.ref([]),h=e.ref([]),g=e.ref({}),b=e.ref(0),w=e.ref(!1),x=()=>{var F;let I=(F=r.value)==null?void 0:F.columns.filter(D=>{var z;return(z=f==null?void 0:f.value)==null?void 0:z.includes(D.name)});p.value=I.map(D=>{switch(D.name){case"title":return{...D,title:D.name?D.name.charAt(0).toUpperCase()+D.name.slice(1):"--",icon:Il};case"slug":return{...D,title:D.name?D.name.charAt(0).toUpperCase()+D.name.slice(1):"-",icon:ji};case"author":return{...D,title:D.name?D.name.charAt(0).toUpperCase()+D.name.slice(1):"-",icon:Wi};case"publish_at":return{...D,title:D.name?D.name.charAt(0).toUpperCase()+D.name.slice(1):"-",icon:ua};case"published_at":return{...D,title:D.name?D.name.charAt(0).toUpperCase()+D.name.slice(1):"-",icon:ua};default:return{...D,title:D.name?D.name.charAt(0).toUpperCase()+D.name.slice(1):"-"}}}),m.value=!1},k=e.computed(()=>{var I,F;return(F=(I=c.value)==null?void 0:I.find(D=>D.id===t.params.id))==null?void 0:F.title}),_=e.computed(()=>[{label:k.value||t.params.id,route:`collections/${t.params.id}`}]),N=I=>{I==="collections"?a.push("/collections"):a.push(`/${I}`)},V=()=>{a.push(`/collections/${t.params.id}/create`)},P=async I=>{console.log("handleRemoveArticle"),Ca({title:o("cms.builder.deleteTitle"),message:o("cms.builder.deleteObject"),type:"error",onConfirm:async()=>{await fetch(`/api/cms/${t.params.id}/${I.id}`,{method:"DELETE"}),M()}})},$=I=>{a.push(`/collections/${t.params.id}/${I.id}`)},M=async()=>{if(!w.value){w.value=!0;try{const F=await(await fetch(`/api/cms/${t.params.id}?page=${d.value}&filter=${u.value}`)).json();i.value=F.rows||[],r.value=F;const D=(F.filters||[]).map(z=>{const{extra:ee,title:me,...Ne}=z;return Ne});h.value=D,t.params.id==="pages"&&f.value.push("type"),A(),x()}finally{w.value=!1}}},A=()=>{var F;if(!((F=r.value)!=null&&F.columns))return;const I=r.value.columns.map((D,z)=>({text:D.label,id:D.name}));y.value=[...f.value.map(D=>I.find(z=>z.id===D)).filter(Boolean),...I.filter(D=>!f.value.includes(D.id))]},q=(I,F)=>{if(!F)return!0;const D=F.toLowerCase();return p.value.some(z=>{const ee=I[z.name];return ee&&ee.toString().toLowerCase().includes(D)})},Q=I=>{const F=Object.entries(I==null?void 0:I.data).filter(([,z])=>z!=null).map(([z,ee])=>`${z}=${ee}`).join("|");u.value=F;const D={...t.query};F?D.filter=F:delete D.filter,a.replace({query:D})},R=()=>{if(t.query.filter){u.value=t.query.filter;const I=t.query.filter.split("cms.|"),F={};I.forEach(D=>{const[z,ee]=D.split("cms.=");z&&ee&&(F[z]=ee)}),g.value=F}else u.value="",g.value={},b.value++};return e.onMounted(()=>{R(),M()}),e.watch(()=>t.params.id,()=>{g.value={},u.value="",h.value=[];const I={...t.query};delete I.filter,a.replace({query:I}),b.value++,R(),M()}),e.watch(()=>t.query,async()=>{R(),await e.nextTick(),M()},{deep:!0}),e.watch(d,async()=>{t.query.filter||(u.value="",g.value={},b.value++),await e.nextTick(),M()}),(I,F)=>{var D,z,ee;return e.openBlock(),e.createElementBlock("div",T2,[e.createVNode(Cs,{items:_.value,onNavigate:N},null,8,["items"]),e.createElementVNode("div",L2,[e.createElementVNode("div",$2,[e.createElementVNode("h1",F2,e.toDisplayString(k.value),1),e.createElementVNode("a",{href:`https://cms.opengis.info/${e.unref(s)}/guides/content/`,target:"_blank",title:I.$t("cms.guide.content")},[e.createVNode(e.unref(kl),{class:"w-5 h-5"})],8,I2)]),i.value.length?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:V,class:"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium h-9 px-4 py-2 bg-blue-600 text-white shadow-md transition-all duration-200 transform hover:bg-blue-700 hover:shadow-lg hover:scale-105 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"},[e.createVNode(e.unref(rl),{class:"w-4 h-4 mr-2"}),e.createTextVNode(" "+e.toDisplayString(I.$t("cms.articles.createArticle")),1)])):e.createCommentVNode("",!0)]),i.value.length||u.value.length?(e.openBlock(),e.createElementBlock("div",O2,[(e.openBlock(),e.createElementBlock("div",P2,[e.createElementVNode("div",R2,[(e.openBlock(),e.createBlock(e.unref(zr),{key:b.value,schema:h.value,history:!0,value:g.value,view:"inline",onChange:Q},null,8,["schema","value"])),e.createElementVNode("div",U2,[y.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:"flex items-center gap-2 cursor-pointer text-sm border border-gray-300 rounded-md p-2 dark:text-white",onClick:F[0]||(F[0]=me=>m.value=!m.value)},[e.createElementVNode("p",null,e.toDisplayString(I.$t("cms.articles.showColumns")),1),e.createVNode(e.unref(En),{class:"w-4 h-4"})])):e.createCommentVNode("",!0),y.value.length>0&&m.value?(e.openBlock(),e.createElementBlock("div",j2,[e.createElementVNode("div",z2,[y.value.length>0&&m.value?(e.openBlock(),e.createBlock(e.unref(Jo),{key:0,options:y.value,modelValue:f.value,"onUpdate:modelValue":F[1]||(F[1]=me=>f.value=me)},null,8,["options","modelValue"])):e.createCommentVNode("",!0)]),e.createElementVNode("button",{class:"text-sm bg-blue-600 text-white rounded-md p-2 mt-4 w-full",onClick:x},e.toDisplayString(I.$t("cms.articles.update")),1)])):e.createCommentVNode("",!0)])])])),p.value.length>0?(e.openBlock(),e.createBlock(Wo,{key:1,class:"max-h-[calc(100vh-270px)] overflow-y-auto",rows:i.value,columns:p.value,query:n.value,filterFn:q,onDelete:P,onEdit:$},null,8,["rows","columns","query"])):e.createCommentVNode("",!0),((D=r.value)==null?void 0:D.total)>20?(e.openBlock(),e.createBlock(Ko,{key:2,total:(z=r.value)==null?void 0:z.filtered,count:(ee=r.value)==null?void 0:ee.count,page:d.value,"onUpdate:page":F[2]||(F[2]=me=>d.value=me),limit:20},null,8,["total","count","page"])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",H2,[e.createVNode(Go,{onAction:V})]))])}}}),q2={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"},G2={__name:"CreateForm",setup(l){const t=e.inject("cms.fetchContentTypes"),{t:a}=Fe(),r=rt.useRouter(),n=e.ref({}),o=e.ref(!1),s=e.ref({type:"collection"}),i={name:{type:"text",label:a("cms.builder.scheme.name.label"),required:!0,placeholder:a("cms.builder.scheme.name.placeholder"),validators:["required"]},title:{type:"text",label:a("cms.builder.scheme.title.label"),required:!0,placeholder:a("cms.builder.scheme.title.placeholder"),validators:["required"]},type:{type:"combobox",mode:"combo",label:a("cms.builder.scheme.type.label"),required:!0,placeholder:a("cms.builder.scheme.type.placeholder"),validators:["required"],options:[{text:a("cms.builder.scheme.type.options.collection"),id:"collection"},{text:a("cms.builder.scheme.type.options.single"),id:"single"}]},customTable:{type:"switcher",label:a("cms.builder.scheme.customTable.label")}},c=async()=>{if(await n.value.validate()){xe({type:"warning",title:a("cms.common.actions.warning"),message:a("cms.collections.collectionCreationFailed")});return}try{const m=await(await fetch("/api/cms-type",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s.value)})).json();r.push(`/settings/collections/edit/${m.id}`),t(),xe({type:"success",title:a("cms.common.actions.success"),message:a("cms.collections.collectionCreated")})}catch(d){xe({type:"error",title:a("cms.common.actions.error"),message:a("cms.collections.collectionCreationFailed")}),console.error(d)}};return(u,d)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("button",{onClick:d[0]||(d[0]=m=>o.value=!0),class:"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 h-9 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white shadow-md hover:shadow-lg transition-all duration-200 transform hover:scale-105"},[e.createVNode(e.unref(rl),{class:"w-4 h-4 mr-2"}),e.createTextVNode(" "+e.toDisplayString(u.$t("cms.collections.createCollection")),1)]),e.createVNode(e.unref(Zt),{teleport:"#modal",visible:o.value,title:u.$t("cms.collections.createCollection"),onClose:d[4]||(d[4]=m=>o.value=!1)},{footer:e.withCtx(()=>[e.createElementVNode("div",q2,[e.createElementVNode("button",{class:"inline-flex items-center px-3 py-2 text-sm text-black duration-300 border border-gray-200 rounded-lg gap-x-2 whitespace-nowrap hover:bg-gray-100",onClick:d[3]||(d[3]=m=>o.value=!1)},e.toDisplayString(u.$t("cms.common.actions.cancel")),1),e.createElementVNode("button",{onClick:c,class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"},e.toDisplayString(u.$t("cms.common.actions.save")),1)])]),default:e.withCtx(()=>[e.createVNode(e.unref(Xe),{form:n.value,"onUpdate:form":d[1]||(d[1]=m=>n.value=m),modelValue:s.value,"onUpdate:modelValue":d[2]||(d[2]=m=>s.value=m),schema:i},null,8,["form","modelValue"])]),_:1},8,["visible","title"])]))}};let W2;function K2(){return W2}e.version[0];function Y2(l){return typeof l=="function"?l():e.unref(l)}function Hr(l){if(l instanceof Promise||l instanceof Date||l instanceof RegExp)return l;const t=Y2(l);if(!l||!t)return t;if(Array.isArray(t))return t.map(a=>Hr(a));if(typeof t=="object"){const a={};for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(r==="titleTemplate"||r[0]==="o"&&r[1]==="n"){a[r]=e.unref(t[r]);continue}a[r]=Hr(t[r])}return a}return t}const X2="usehead",Ns=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},vs="__unhead_injection_handler__";function Z2(){if(vs in Ns)return Ns[vs]();const l=e.inject(X2);return!l&&process.env.NODE_ENV!=="production"&&console.warn("Unhead is missing Vue context, falling back to shared context. This may have unexpected results."),l||K2()}function Q2(l,t={}){const a=t.head||Z2();if(a)return a.ssr?a.push(l,t):J2(a,l,t)}function J2(l,t,a={}){const r=e.ref(!1),n=e.ref({});e.watchEffect(()=>{n.value=r.value?{}:Hr(t)});const o=l.push(n.value,a);return e.watch(n,i=>{o.patch(i)}),e.getCurrentInstance()&&(e.onBeforeUnmount(()=>{o.dispose()}),e.onDeactivated(()=>{r.value=!0}),e.onActivated(()=>{r.value=!1})),o}function e_(l,t=300){const a=e.ref(l.value);let r;return e.watch(l,n=>{clearTimeout(r),r=setTimeout(()=>{a.value=n},t)},{immediate:!0}),a}const Qt=(l,t)=>{const a=l.__vccOpts||l;for(const[r,n]of t)a[r]=n;return a},t_={},l_={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 a_(l,t){return e.openBlock(),e.createElementBlock("svg",l_,[...t[0]||(t[0]=[e.createStaticVNode('<line x1="8" x2="21" y1="6" y2="6"></line><line x1="8" x2="21" y1="12" y2="12"></line><line x1="8" x2="21" y1="18" y2="18"></line><line x1="3" x2="3.01" y1="6" y2="6"></line><line x1="3" x2="3.01" y1="12" y2="12"></line><line x1="3" x2="3.01" y1="18" y2="18"></line>',6)])])}const r_=Qt(t_,[["render",a_]]),n_={},o_={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 s_(l,t){return e.openBlock(),e.createElementBlock("svg",o_,[...t[0]||(t[0]=[e.createStaticVNode('<rect width="18" height="18" x="3" y="3" rx="2"></rect><path d="M3 9h18"></path><path d="M3 15h18"></path><path d="M9 3v18"></path><path d="M15 3v18"></path>',5)])])}const i_=Qt(n_,[["render",s_]]),c_={class:"grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-6 pb-6"},d_={class:"flex items-center gap-2 space-y-1.5 p-6 border-b border-slate-200 dark:border-slate-700 bg-gradient-to-r from-slate-50 dark:from-slate-800 to-white dark:to-slate-800"},u_={class:"line-clamp-1 tracking-tight text-lg font-semibold text-slate-800 dark:text-slate-100 vertical-center"},m_={class:"w-full flex flex-col gap-2 p-6"},p_=["title"],f_={class:"flex items-center justify-between gap-2"},h_={class:"text-sm text-slate-600 dark:text-slate-400"},g_={class:"font-semibold text-slate-800 dark:text-slate-100"},b_={class:"flex items-center justify-between gap-2"},y_={class:"text-sm text-slate-500 dark:text-slate-400"},k_={class:"font-semibold text-slate-800 dark:text-slate-100"},x_={class:"flex items-center justify-between gap-2"},w_={class:"text-sm text-slate-500 dark:text-slate-400"},__={class:"text-sm text-slate-600 dark:text-slate-300"},E_={class:"flex items-center justify-between gap-2 mt-6"},C_=["onClick"],V_={class:"text-slate-800 dark:text-slate-200 group-hover:text-green-600 dark:group-hover:text-blue-50"},N_=["onClick"],v_=["onClick"],B_=e.defineComponent({__name:"CollectionsGrid",props:{collections:{},onEdit:{type:Function},onView:{type:Function},onDelete:{type:Function}},emits:["edit","view","delete"],setup(l,{emit:t}){e.ref(!1),e.ref(null);const a=l,r=t,n=(i,c)=>{switch(i){case"edit":r("edit",c),a.onEdit&&a.onEdit(c);break;case"view":r("view",c),a.onView&&a.onView(c);break;case"delete":r("delete",c),a.onDelete&&a.onDelete(c);break}},o=i=>{const c=new Date,u=new Date(i),d=c.getTime()-u.getTime(),m=Math.floor(d/1e3),f=Math.floor(m/60),p=Math.floor(f/60),y=Math.floor(p/24),h=Math.floor(y/7);return h>=2?`${h} weeks ago`:h===1?"1 week ago":y>=2?`${y} days ago`:y===1?"1 day ago":p>=2?`${p} hours ago`:p===1?"1 hour ago":f>=2?`${f} minutes ago`:f===1?"1 minute ago":"just now"},s=i=>{switch(i){case"published":return{icon:wn,text:"Published",classes:"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-200 border-green-200 dark:border-green-700"};case"draft":return{icon:wl,text:"Draft",classes:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-200 border-yellow-200 dark:border-yellow-700"};case"archived":return{icon:Dn,text:"Archived",classes:"bg-gray-100 text-gray-800 dark:bg-gray-900/30 dark:text-gray-300 border-gray-200 dark:border-gray-700"};default:return{icon:kl,text:"--",classes:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-200 border-yellow-200 dark:border-yellow-700"}}};return(i,c)=>(e.openBlock(),e.createElementBlock("div",c_,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.collections,u=>{var d,m,f;return e.openBlock(),e.createElementBlock("div",{key:u.id,class:"rounded-xl text-card-foreground shadow-lg border-0 bg-white dark:bg-slate-800 backdrop-blur-sm hover:shadow-xl transition-all duration-200 transform hover:bg-slate-50"},[e.createElementVNode("div",d_,[u.type==="single"?(e.openBlock(),e.createBlock(e.unref(yl),{key:0,class:"shrink-0 lucide lucide-page w-5 h-5 text-blue-600"})):(e.openBlock(),e.createBlock(e.unref(xl),{key:1,class:"shrink-0 lucide lucide-layers w-5 h-5 text-blue-600"})),e.createElementVNode("p",u_,e.toDisplayString(u.title),1),s(u.status)?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["whitespace-nowrap rounded-md border ml-auto px-2.5 py-0.5 text-xs font-semibold transition-colors hover:bg-secondary/80 flex items-center w-fit bg-green-100 text-green-800 border-green-200 dark:bg-green-900/30 dark:text-green-300 dark:border-green-700",(d=s(u.status))==null?void 0:d.classes])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent((m=s(u.status))==null?void 0:m.icon),{class:"w-3 h-3 mr-1"})),e.createTextVNode(" "+e.toDisplayString((f=s(u.status))==null?void 0:f.text),1)],2)):e.createCommentVNode("",!0)]),e.createElementVNode("div",m_,[e.createElementVNode("p",{class:"text-slate-600 dark:text-slate-300 mb-4 line-clamp-2",title:u.description},e.toDisplayString(u.description!==null?u.description:"No description"),9,p_),e.createElementVNode("div",f_,[e.createElementVNode("p",h_,e.toDisplayString(i.$t("cms.collections.entries"))+":",1),e.createElementVNode("p",g_,e.toDisplayString(u.entries),1)]),e.createElementVNode("div",b_,[e.createElementVNode("p",y_,e.toDisplayString(i.$t("cms.collections.fields"))+":",1),e.createElementVNode("p",k_,e.toDisplayString(u.fields),1)]),e.createElementVNode("div",x_,[e.createElementVNode("p",w_,e.toDisplayString(i.$t("cms.collections.lastModified"))+":",1),e.createElementVNode("p",__,e.toDisplayString(o(u.last_edit)),1)]),e.createElementVNode("div",E_,[e.renderSlot(i.$slots,"actions",{collection:u,handleAction:n},()=>[e.createElementVNode("button",{class:"inline-flex gap-1 items-center justify-center whitespace-nowrap font-medium border rounded-md text-xs h-8 w-4/5 p-0 border-slate-300 bg-white transition-all duration-200 shadow-sm group dark:border-slate-600 dark:bg-slate-700 dark:hover:bg-slate-600 dark:hover:border-slate-500 dark:hover:text-slate-200 hover:bg-green-50 hover:border-green-300",onClick:e.withModifiers(p=>n("edit",u),["stop"])},[e.createVNode(e.unref(wl),{class:"text-slate-800 dark:text-slate-200 w-4 h-4 group-hover:text-green-600 dark:group-hover:text-blue-50"}),e.createElementVNode("span",V_,e.toDisplayString(i.$t("cms.common.actions.edit")),1)],8,C_),e.createElementVNode("button",{class:e.normalizeClass([u.id==="pages"?"disabled":"","inline-flex items-center justify-center whitespace-nowrap font-medium border rounded-md text-xs h-8 w-8 p-0 border-slate-300 bg-white transition-all duration-200 shadow-sm group dark:border-slate-600 dark:bg-slate-700 dark:hover:bg-slate-600 dark:hover:border-slate-500 dark:hover:text-slate-200 hover:bg-red-50 hover:border-red-300"]),onClick:e.withModifiers(p=>u.id==="pages"?null:n("delete",u),["stop"])},[e.createVNode(e.unref(Gt),{class:"text-slate-800 dark:text-slate-200 w-4 h-4 group-hover:text-red-600 dark:group-hover:text-blue-50"})],10,N_),e.createElementVNode("button",{class:e.normalizeClass([u.type==="single"?"disabled cursor-not-allowed":"","inline-flex items-center justify-center whitespace-nowrap font-medium border rounded-md text-xs h-8 w-8 p-0 border-slate-300 bg-white transition-all duration-200 shadow-sm group dark:border-slate-600 dark:bg-slate-700 dark:hover:bg-slate-600 dark:hover:border-slate-500 dark:hover:text-slate-200 hover:bg-blue-50 hover:border-blue-300"]),onClick:e.withModifiers(p=>u.type==="single"?null:n("view",u),["stop"])},[e.createVNode(e.unref(pa),{class:"text-slate-800 dark:text-slate-200 w-4 h-4 group-hover:text-blue-600 dark:group-hover:text-blue-50"})],10,v_)])])])])}),128))]))}}),qr=localStorage.getItem("collectionView"),Da=e.ref(qr==="list"||qr==="grid"?qr:"list");e.watch(Da,l=>{localStorage.setItem("collectionView",l)});function S_(){Da.value=Da.value==="grid"?"list":"grid"}function D_(){return{collectionView:Da,toggleCollectionView:S_}}const A_={class:"space-y-6 max-w-7xl mx-auto"},M_={class:"flex items-center justify-between mb-8"},T_={class:"flex gap-4"},L_={class:"text-3xl font-bold text-slate-800 dark:text-slate-100 mb-2"},$_={class:"text-slate-600 dark:text-slate-300"},F_=["href","title"],I_={class:"flex items-center gap-3"},O_={class:"relative"},P_={class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},R_=["placeholder"],U_={class:"flex items-center bg-white dark:bg-slate-700 border border-slate-200 dark:border-slate-600 rounded-lg p-1 max-w-[fit-content]"},j_=["onClick"],z_=e.defineComponent({__name:"BuilderPage",setup(l){const{t,locale:a}=Fe(),r=rt.useRouter(),n=[{name:"name",title:t("cms.builder.collectionName"),type:"text",icon:xl},{name:"title",title:t("cms.builder.title"),type:"text",icon:xl},{name:"description",title:t("cms.common.description"),type:"text"},{name:"entries",title:t("cms.builder.entries"),type:"number"},{name:"fields",title:t("cms.builder.fields"),type:"number"},{name:"status",title:t("cms.builder.status"),type:"text"},{name:"last_edit",title:t("cms.builder.lastModified"),type:"date"}],o=e.ref(""),s=e_(o,300);Q2({title:()=>t("cms.collections.title")+" | CMS"});const i=e.ref([]),c=e.inject("fetchContentTypes"),u=e.ref(1),d=e.ref(16),m=e.ref(null),{collectionView:f,toggleCollectionView:p}=D_();async function y(){try{const x=s.value?`&search=${encodeURIComponent(String(s.value))}`:"",k=`/api/cms-type?page=${u.value}&limit=${d.value}${x}`;console.log("Fetching collections with URL:",k);const _=await fetch(k);if(!_.ok)throw new Error("Failed to fetch collections");const N=await _.json();console.log("Collections fetched:",N),i.value=N.rows,m.value=N}catch(x){console.error("Error fetching collections:",x)}}e.onMounted(()=>{y()});const h=e.computed(()=>[...i.value].sort((k,_)=>k.id==="pages"?-1:_.id==="pages"?1:0)),g=async x=>{try{await fetch(`/api/cms-type/${x.id}`,{method:"DELETE"}),y(),c()}catch(k){console.error("Error deleting collection:",k)}},b=x=>{r.push(`/settings/collections/edit/${x.id||x.name}`)},w=x=>{x.type==="single"?r.push(`/collections/single/${x.name}`):r.push(`/collections/${x.name}`)};return e.watch(u,()=>{y()}),e.watch(s,x=>{console.log("Search query changed:",x),u.value=1,y()}),(x,k)=>{var _,N,V,P;return e.openBlock(),e.createElementBlock("div",A_,[e.createElementVNode("div",M_,[e.createElementVNode("div",T_,[e.createElementVNode("div",null,[e.createElementVNode("h1",L_,e.toDisplayString(x.$t("cms.builder.collections")),1),e.createElementVNode("p",$_,e.toDisplayString(x.$t("cms.builder.manageContentCollections")),1)]),e.createElementVNode("a",{href:`https://cms.opengis.info/${e.unref(a)}/guides/collections/`,target:"_blank",title:x.$t("cms.guide.collections"),class:"mt-2"},[e.createVNode(e.unref(kl),{class:"w-5 h-5"})],8,F_)]),e.createElementVNode("div",I_,[e.createElementVNode("div",O_,[e.createElementVNode("div",P_,[e.createVNode(e.unref(tr),{class:"w-5 h-5 text-gray-400"})]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"block w-full py-2 pl-10 pr-3 leading-5 text-gray-900 placeholder-gray-500 transition-colors bg-white border border-gray-300 rounded-md dark:border-gray-600 dark:bg-gray-700 dark:placeholder-gray-400 focus:outline-none focus:ring-sky-500 focus:border-sky-500 dark:text-white sm:text-sm",placeholder:x.$t("cms.builder.searchCollections"),"onUpdate:modelValue":k[0]||(k[0]=$=>o.value=$)},null,8,R_),[[e.vModelText,o.value]])]),e.createElementVNode("div",U_,[e.createElementVNode("button",{class:e.normalizeClass(["inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors rounded-md text-xs h-8 w-8 p-0 hover:bg-blue-700 hover:text-white cursor-pointer",{"bg-blue-600 text-white":e.unref(f)==="list"}]),onClick:k[1]||(k[1]=$=>f.value="list")},[e.createVNode(r_,{class:"dark:text-blue-50 w-4 h-4"})],2),e.createElementVNode("button",{class:e.normalizeClass(["inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors rounded-md text-xs h-8 w-8 p-0 hover:bg-blue-700 hover:text-white cursor-pointer",{"bg-blue-600 text-white":e.unref(f)==="grid"}]),onClick:k[2]||(k[2]=$=>f.value="grid")},[e.createVNode(i_,{class:"dark:text-blue-50 w-4 h-4"})],2)]),e.createVNode(G2)])]),e.createElementVNode("div",null,[e.unref(f)==="list"?(e.openBlock(),e.createBlock(Wo,{key:0,class:"max-h-[calc(100vh-270px)] overflow-y-auto overflow-x-hidden",columns:n,rows:h.value,onDelete:g,onEdit:b,onView:w},{actions:e.withCtx(({row:$})=>[e.createElementVNode("button",{class:"inline-flex items-center justify-center whitespace-nowrap font-medium border rounded-md text-xs h-8 w-8 p-0 border-slate-300 bg-white transition-all duration-200 shadow-sm group dark:border-slate-600 dark:bg-slate-700 dark:hover:bg-slate-600 dark:hover:border-slate-500 dark:hover:text-slate-200 hover:bg-blue-50 hover:border-blue-300 hover:text-blue-600",onClick:M=>w($)},[e.createVNode(e.unref(pa),{class:"text-slate-800 dark:text-slate-200 w-4 h-4 group-hover:text-blue-600 dark:group-hover:text-blue-50"})],8,j_)]),_:1},8,["rows"])):e.createCommentVNode("",!0),e.unref(f)==="grid"?(e.openBlock(),e.createBlock(B_,{key:1,collections:h.value,onEdit:b,onView:w,onDelete:g,class:"max-h-[calc(100vh-270px)] overflow-y-auto overflow-x-hidden"},null,8,["collections"])):e.createCommentVNode("",!0),((_=m.value)==null?void 0:_.total)>16?(e.openBlock(),e.createBlock(Ko,{key:2,total:(N=m.value)==null?void 0:N.filtered,count:((V=m.value)==null?void 0:V.count)||((P=m.value)==null?void 0:P.total),page:u.value,"onUpdate:page":k[3]||(k[3]=$=>u.value=$),limit:d.value},null,8,["total","count","page","limit"])):e.createCommentVNode("",!0)])])}}});async function H_(){if(window.monaco)return window.monaco;const l="https://cdn.jsdelivr.net/npm/monaco-editor@0.45.0/min";return window.require||(window.require={paths:{vs:`${l}/vs`}},await new Promise((t,a)=>{const r=document.createElement("script");r.src=`${l}/vs/loader.min.js`,r.onload=()=>t(),r.onerror=a,document.head.appendChild(r)})),new Promise(t=>{window.require(["vs/editor/editor.main"],()=>t(window.monaco))})}const q_=e.defineComponent({__name:"MonacoEditor",props:e.mergeModels({language:{default:"javascript"},theme:{default:"vs-dark"},width:{default:"100%"},height:{default:"100%"},options:{default:()=>({minimap:{enabled:!1}})}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,a=e.useModel(l,"modelValue"),r=e.ref(null);let n=null,o=null;return e.onMounted(async()=>{var s;if(r.value)try{o=await H_();const i=((s=a.value)==null?void 0:s.replace(/\\n/g,`
230
230
  `))||"";n=o.editor.create(r.value,{value:i,language:t.language,theme:t.theme,automaticLayout:!0,...t.options}),n.onDidChangeModelContent(()=>{const c=(n==null?void 0:n.getValue())||"";a.value=c})}catch(i){console.error("Failed to load Monaco Editor:",i)}}),e.watch(()=>a.value,s=>{if(n){const i=(s==null?void 0:s.replace(/\\n/g,`
231
231
  `))||"";i!==n.getValue()&&n.setValue(i)}},{immediate:!0}),e.watch(()=>t.language,s=>{n&&s&&o&&o.editor.setModelLanguage(n.getModel(),s)}),e.watch(()=>t.theme,s=>{n&&s&&o&&o.editor.setTheme(s)}),e.onBeforeUnmount(()=>{n&&(n.dispose(),n=null)}),(s,i)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"editorContainer",ref:r,style:e.normalizeStyle({width:s.width,height:s.height})},null,4))}}),G_={__name:"vs-builder-monaco",props:{yaml:{type:String,default:""},yamlModifiers:{}},emits:["update:yaml"],setup(l){const t=e.ref("");e.useModel(l,"yaml");const a=e.ref(null);return e.onMounted(()=>{a.value=Math.random().toString(36).substring(2,15)}),(r,n)=>a.value?(e.openBlock(),e.createElementBlock("div",{key:a.value},[e.createVNode(q_,{modelValue:t.value,"onUpdate:modelValue":n[0]||(n[0]=o=>t.value=o),language:"yaml",theme:"vs-light",height:"calc(100vh - 200px)",width:"100%",options:{minimap:{enabled:!1}}},null,8,["modelValue"])])):e.createCommentVNode("",!0)}},ml=(l=0,t)=>({name:{type:"text",label:t("cms.builder.fieldLabels.name"),required:!0,placeholder:t("cms.builder.fieldPlaceholders.name"),validators:["required"]},label:{type:"text",label:t("cms.builder.fieldLabels.label"),required:!0,placeholder:t("cms.builder.fieldPlaceholders.label"),validators:["required"]},placeholder:{type:"text",label:t("cms.builder.fieldLabels.placeholder"),required:!0,placeholder:t("cms.builder.fieldPlaceholders.placeholder")},help:{type:"text",label:t("cms.builder.fieldLabels.help"),placeholder:t("cms.builder.fieldPlaceholders.help")},type:{type:"combobox",mode:"combo",label:t("cms.builder.fieldLabels.type"),required:!0,maxHeight:"300",slots:{option:'<div class="flex items-center gap-2 p-2 py-1 rounded hover:bg-gray-100" :class="{ \'bg-gray-100\': selectedNavIndex === ind, \'bg-gray-100\': modelValue == ind }" ><div :class="`flex items-center gap-2 p-1 bg-${color }-100 rounded`"><component :is="`icon-${id}`" class="block" height="24" width="30" /></div><span class="text-sm text-gray-700">{{ text }}</span></div>'},options:[{text:t("cms.builder.fieldOptions.text"),id:"text",color:"blue"},{text:t("cms.builder.fieldOptions.number"),id:"number",color:"green"},{text:t("cms.builder.fieldOptions.date"),id:"date",color:"red"},{text:t("cms.builder.fieldOptions.datetime"),id:"datetime",color:"purple"},{text:t("cms.builder.fieldOptions.file"),id:"file",color:"yellow"},{text:t("cms.builder.fieldOptions.select"),id:"select",color:"yellow"},{text:t("cms.builder.fieldOptions.multiselect"),id:"multiselect",color:"blue"},{text:t("cms.builder.fieldOptions.mediaselect"),id:"mediaselect",color:"orange"},{text:t("cms.builder.fieldOptions.radio"),id:"radio",color:"blue"},{text:t("cms.builder.fieldOptions.boolean"),id:"boolean",color:"red"},{text:t("cms.builder.fieldOptions.datalist"),id:"datalist",color:"orange"},{text:t("cms.builder.fieldOptions.image"),id:"image",color:"blue"},{text:t("cms.builder.fieldOptions.slug"),id:"slug",color:"green"},{text:t("cms.builder.fieldOptions.richtext"),id:"richtext",color:"red"},{text:t("cms.builder.fieldOptions.reference"),id:"reference",color:"yellow"},{text:t("cms.builder.fieldOptions.relation"),id:"relation",color:"pink"},{text:t("cms.builder.fieldOptions.fileList"),id:"FileList",color:"orange"},{text:t("cms.builder.fieldOptions.tags"),id:"tags",color:"blue"}].filter(a=>l>1?a.id!=="datalist":!0),validators:["required"]},subtype:{type:"combobox",mode:"combo",label:t("cms.builder.fieldLabels.subtype"),placeholder:t("cms.builder.fieldPlaceholders.subtype"),options:[{text:t("cms.builder.fieldOptions.text"),id:"text"},{text:t("cms.builder.fieldOptions.number"),id:"number"},{text:t("cms.builder.fieldOptions.date"),id:"date"},{text:t("cms.builder.fieldOptions.datetime"),id:"datetime"}],conditions:["type","==","array"]},parent:{type:"text",label:t("cms.builder.fieldLabels.parent"),placeholder:t("cms.builder.fieldPlaceholders.parent"),conditions:["type","in",["slug","select","multiselect"]]},data:{type:"text",label:t("cms.builder.fieldLabels.data"),placeholder:t("cms.builder.fieldPlaceholders.data"),conditions:["type","in",["select","multiselect"]]},options:{type:"datalist",label:t("cms.builder.fieldLabels.options"),conditions:["type","in",["select","multiselect","radio"]],colModel:[{key:"id",ua:"ID",type:"text",validators:["required"],col:6},{key:"text",ua:"Text",type:"text",validators:["required"],col:6}]},colModel:l<=1?{type:"datalist",label:t("cms.builder.fieldLabels.colModel"),conditions:["type","==","datalist"],colModel:Object.entries(ml(l+1,t)).map(([a,r])=>({key:a,...r,ua:(r==null?void 0:r.label)||(r==null?void 0:r.ua)}))}:{type:"switcher",label:t("cms.builder.fieldLabels.required"),hidden:!0,required:!0},multiple:{type:"switcher",label:t("cms.builder.fieldLabels.multiple"),conditions:["type","==","file"]},relation:{type:"combobox",data:"collection",label:t("cms.builder.fieldLabels.relation"),conditions:["type","==","relation"]},required:{type:"switcher",label:t("cms.builder.fieldLabels.required"),required:!0},localization:{type:"switcher",label:t("cms.builder.fieldLabels.localization"),conditions:["type","in",["richtext","text","reference","multiselect","datalist"]],required:!0}}),W_={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"},K_={__name:"vs-builder-datatable-form",props:{modelValue:{type:Array,default:()=>[]},modelModifiers:{}},emits:["update:modelValue"],setup(l){const{t}=Fe();$e["vs-input-datalist"]=$e.VsInputDatatable;const a=e.useModel(l,"modelValue"),r=e.ref(!1),n=e.ref({}),o=e.ref({}),s=e.computed(()=>(o.value,ml(0,t))),i=async()=>{if(await n.value.validate()){xe({type:"warning",title:t("cms.common.actions.warning"),message:t("cms.builder.createFieldFailed")});return}try{a.value=[...a.value,o.value],o.value={},r.value=!1}catch(u){console.log(u)}};return(c,u)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("button",{onClick:u[0]||(u[0]=d=>r.value=!0),class:"inline-flex items-center justify-center h-10 gap-2 px-4 py-2 text-sm font-medium transition-colors border rounded-md hover hover:bg-gray-200 whitespace-nowrap ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring 0"},[e.createVNode(e.unref(rl),{class:"w-4 h-4 mr-2"}),e.createTextVNode(" "+e.toDisplayString(c.$t("cms.common.actions.addField")),1)]),e.createVNode(e.unref(Zt),{teleport:"#modal",title:c.$t("cms.builder.createField"),size:"small",visible:r.value,"onUpdate:visible":u[4]||(u[4]=d=>r.value=d),onClose:u[5]||(u[5]=d=>r.value=!1)},{footer:e.withCtx(()=>[e.createElementVNode("div",W_,[e.createElementVNode("button",{class:"inline-flex items-center px-3 py-2 text-sm text-black duration-300 border border-gray-200 rounded-lg gap-x-2 whitespace-nowrap hover:bg-gray-100",onClick:u[3]||(u[3]=d=>r.value=!1)},e.toDisplayString(c.$t("cms.common.actions.cancel")),1),e.createElementVNode("button",{onClick:i,class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"},e.toDisplayString(c.$t("cms.common.actions.save")),1)])]),default:e.withCtx(()=>[e.createVNode(e.unref(Xe),{modelValue:o.value,"onUpdate:modelValue":u[1]||(u[1]=d=>o.value=d),schema:s.value,form:n.value,"onUpdate:form":u[2]||(u[2]=d=>n.value=d)},null,8,["modelValue","schema","form"])]),_:1},8,["title","visible"])]))}},Y_={class:"flex items-center justify-end col-span-3 gap-2"},X_={key:2,class:"w-8 h-4"},Z_={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"},Q_={__name:"vs-builder-datatable-controls",props:e.mergeModels({index:{type:Number,required:!0},data:{type:Object,required:!0}},{columns:{type:Array,default:()=>[]},columnsModifiers:{}}),emits:["update:columns"],setup(l){const{t}=Fe(),a=l,r=e.useModel(l,"columns"),n=e.ref(!1),o=e.ref({}),s=e.ref({...a.data||{}}),i=e.ref({});e.onMounted(()=>{a.data.required?i.value={...ml(0,t),name:{...ml(0,t).name,disabled:!0},label:{...ml(0,t).label,disabled:!0},type:{...ml(0,t).type,disabled:!0}}:i.value=ml(0,t)});const c=()=>{Ca({title:t("cms.builder.deleteTitle"),message:t("cms.builder.deleteField"),type:"error",onConfirm:()=>{u()}})},u=()=>{r.value=r.value.filter((m,f)=>f!==a.index)},d=async()=>{if(await o.value.validate()){xe({type:"warning",title:t("cms.common.actions.warning"),message:t("cms.builder.editFieldFailed")});return}try{r.value[a.index]=s.value,n.value=!1}catch(f){console.log(f)}};return(m,f)=>(e.openBlock(),e.createElementBlock("div",Y_,[["status"].includes(l.data.name)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,onClick:f[0]||(f[0]=p=>n.value=!0),class:"inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:text-accent-foreground h-8 w-8 rounded-full hover:bg-gray-100"},[e.createVNode(e.unref(wl),{class:"w-4 h-4"})])),l.data.required?(e.openBlock(),e.createElementBlock("button",X_)):(e.openBlock(),e.createElementBlock("button",{key:1,onClick:c,class:"inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 h-8 w-8 rounded-full hover:bg-red-100 text-red-600 hover:text-red-700"},[e.createVNode(e.unref(Gi),{class:"w-4 h-4"})])),e.createVNode(e.unref(Zt),{teleport:"#modal",visible:n.value,title:m.$t("cms.builder.editField"),onClose:f[4]||(f[4]=p=>n.value=!1)},{footer:e.withCtx(()=>[e.createElementVNode("div",Z_,[e.createElementVNode("button",{class:"inline-flex items-center px-3 py-2 text-sm text-black duration-300 border border-gray-200 rounded-lg gap-x-2 whitespace-nowrap hover:bg-gray-100",onClick:f[3]||(f[3]=p=>n.value=!1)},e.toDisplayString(m.$t("cms.common.actions.cancel")),1),e.createElementVNode("button",{class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300",onClick:d},e.toDisplayString(m.$t("cms.common.actions.save")),1)])]),default:e.withCtx(()=>[e.createVNode(e.unref(Xe),{modelValue:s.value,"onUpdate:modelValue":f[1]||(f[1]=p=>s.value=p),schema:i.value,form:o.value,"onUpdate:form":f[2]||(f[2]=p=>o.value=p)},null,8,["modelValue","schema","form"])]),_:1},8,["visible","title"])]))}};/**!
232
232
  * Sortable 1.14.0
@@ -237,4 +237,4 @@ About how to use the Composition API mode, see https://vue-i18n.intlify.dev/guid
237
237
  <svg class="w-4 h-4 text-gray-400" fill="currentColor" viewBox="0 0 20 20">
238
238
  <path fill-rule="evenodd" d="M4 3a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V5a2 2 0 00-2-2H4zm12 12H4l4-8 3 6 2-4 3 6z" clip-rule="evenodd" />
239
239
  </svg>
240
- `,y.parentNode.appendChild(h)};return e.onMounted(()=>{var p,y;(y=(p=t.value)==null?void 0:p.filter(h=>typeof h=="object"))==null||y.forEach(h=>h.id?h.id:h.id=Math.random().toString(36).substring(2,15))}),(p,y)=>(e.openBlock(),e.createElementBlock("div",CC,[e.createElementVNode("div",VC,[e.createElementVNode("div",NC,[e.createElementVNode("table",vC,[e.createElementVNode("thead",BC,[e.createElementVNode("tr",SC,[y[4]||(y[4]=e.createElementVNode("th",{class:"h-10 px-2 align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] w-12 text-center"},null,-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.colModel,h=>(e.openBlock(),e.createElementBlock("th",{key:h.name,class:"h-10 px-2 text-left align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] font-semibold text-slate-700 dark:text-slate-300 min-w-[150px]"},e.toDisplayString(h.label||h.title||h.name),1))),128)),e.createElementVNode("th",DC,e.toDisplayString(p.$t("cms.table.actions")),1)])]),e.createElementVNode("tbody",AC,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,(h,g)=>(e.openBlock(),e.createElementBlock("tr",{key:h==null?void 0:h.id,class:e.normalizeClass(["border-b data-[state=selected]:bg-muted transition-all duration-200 hover:bg-slate-50/60 dark:hover:bg-slate-700/60 cursor-move",{"opacity-50":a.value===h}]),draggable:"true",onDragstart:b=>o(b,h,g),onDragover:b=>s(b),onDrop:b=>u(b,g),onDragenter:b=>i(b,g),onDragleave:y[2]||(y[2]=b=>c(b))},[e.createElementVNode("td",TC,[e.createElementVNode("div",LC,[e.createVNode(e.unref(Vn))])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.colModel,b=>(e.openBlock(),e.createElementBlock("td",{key:b.name,class:"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] text-slate-600 dark:text-slate-400 text-sm"},[b.type==="Texteditor"?(e.openBlock(),e.createElementBlock("span",{key:0,innerHTML:h[b.key]||"-"},null,8,$C)):b.type==="File"?(e.openBlock(),e.createElementBlock("div",FC,[Array.isArray(h[b.key])&&h[b.key].length>0?(e.openBlock(),e.createElementBlock("div",IC,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d(h[b.key]),(w,x)=>(e.openBlock(),e.createElementBlock("div",{key:x,class:"relative w-8 h-8 rounded overflow-hidden bg-gray-100 dark:bg-gray-700 flex-shrink-0"},[e.createElementVNode("img",{src:w,alt:`Image ${x+1}`,class:"w-full h-full object-cover",onError:y[0]||(y[0]=k=>f(k))},null,40,OC)]))),128)),m(h[b.key])>0?(e.openBlock(),e.createElementBlock("span",PC," +"+e.toDisplayString(m(h[b.key])),1)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",RC,[...y[5]||(y[5]=[e.createElementVNode("svg",{class:"w-4 h-4 text-gray-400",fill:"currentColor",viewBox:"0 0 20 20"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M4 3a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V5a2 2 0 00-2-2H4zm12 12H4l4-8 3 6 2-4 3 6z","clip-rule":"evenodd"})],-1)])]))])):(e.openBlock(),e.createElementBlock("span",UC,e.toDisplayString(h[b.key]||"-"),1))]))),128)),e.createElementVNode("td",jC,[e.createVNode(xC,{item:h,colModel:l.colModel,modelValue:t.value,"onUpdate:modelValue":y[1]||(y[1]=b=>t.value=b)},null,8,["item","colModel","modelValue"])])],42,MC))),128)),n.value?(e.openBlock(),e.createElementBlock("tr",zC)):e.createCommentVNode("",!0)])])])]),e.createVNode(EC,{colModel:l.colModel,modelValue:t.value,"onUpdate:modelValue":y[3]||(y[3]=h=>t.value=h)},null,8,["colModel","modelValue"])]))}},ci="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASIAAACbCAIAAABJbgHoAAAGfklEQVR4Ae3d7W6baBSF0d7/7Q6IDxkzmrHEQU2DHZudWH1XflRHcXNqVnka4tL01+qNAIGwwK/wfusJEFjPyexyuUzTNAxD3/dd1/3z/1vXdX3fD8MwTdPlcoFNoFmBlzJblmWapr7vb10d/9j3/TRNy7I0a+3AmxV4MrPr9TqO43FXnz06juP1em1W3IE3KPBMZvM8b1eGn7V0/P6u6+Z5bpDbIbcp8OXMnv4k9jG8cRzbRHfUrQl8LbNhGD7W8sp7hmFoTdzxNijwhcxOb+zWp9IaPO1aO+RHMzvxWvHjZz9Xj62ddq0d70OZzfP8sY1z3+MVkdbOvKaO935m1+v1xdcVHwmy6zqv8jd15jV1sPczi14u7gt06djUmdfUwd7JbFmWfQnp2T0iTZ187RzsncymaUqntd8/TVM79I60HYE7mT14v+I+lVfmvu+P6W93UQ7eCLyxwMd7d48yu1wurzTz3Mce3Mu/LMs4jt3/b88t91EE0gK383Mcx/1XQEeZffMV4+34D64bb42lmewn8LpA13X7l/SOMgvd9nF8DAc3hXzzFezx8/QogWOB/VdAR5n9yGm9f3K/fZ32DX99dwznUQKPC3Rdt53AR5n9yGm9f3Lbs7wNjx+hn0ngHQS2E/gos596otuT+234qefj1yXwnMB2AsvsOUAfReC+wEOZuWi8D+lnEPhc4KHM3u0lkM8PxyME3lHgocze7QX9d4T0nAh8LvBQZu/219M/8tn1c0OPEDgS2P/V1NFLIO92s9U0TT/y5eKRpccI/Emg67r9/UxHma3r+s2fQPZ/AGyfcLfhlW8O+ScK7yOQEvjtm5Heyeybrxv3fwBsde2HZVnmeZ68EXhjgXme9/cNr+u976Hvn3XuIzcTeE7gzmezdV19k4LnZH0UgU3gfma+5c6GZSDwnMD9zNZ19Q3knsP1UQRuAg9llr503P8DOL8xBP4+gUczW9c1dFPIwb/j/Pu4HVGbAl/ILFGaxto87Vo76q9ldu7Vo2vF1s62Zo/3y5ndXhF58aYn/41gsydcmwf+TGbrur5y39Nv96G06e6omxJ4MrObkf/ivalzxcE+LfBSZtuverlcpmkahqHv++16suu6vu+HYZim6eCbnG5LDAT+VoFzMvtbdRwXgVMEZHYKoyUEjgRkdqTjMQKnCMjsFEZLCBwJyOxIx2METhGQ2SmMlhA4EpDZkY7HCJwiILNTGC0hcCTwX2a3/1/QjwQInCuwlSezc2FtI1ACMisLE4GQgMxCsNYSKAGZlYWJQEhAZiFYawmUgMzKwkQgJCCzEKy1BEpAZmVhIhASkFkI1loCJSCzsjARCAnILARrLYESkFlZmAiEBGQWgrWWQAnIrCxMBEICMgvBWkugBGRWFiYCIQGZhWCtJVACMisLE4GQgMxCsNYSKAGZlYWJQEhAZiFYawmUgMzKwkQgJCCzEKy1BEpAZmVhIhASkFkI1loCJSCzsjARCAnILARrLYESkFlZmAiEBGQWgrWWQAnIrCxMBEICMgvBWkugBGRWFiYCIQGZhWCtJVACMisLE4GQgMxCsNYSKAGZlYWJQEhAZiFYawmUgMzKwkQgJCCzEKy1BEpAZmVhIhASkFkI1loCJSCzsjARCAnILARrLYESkFlZmAiEBGQWgrWWQAnIrCxMBEICMgvBWkugBGRWFiYCIQGZhWCtJVACMisLE4GQgMxCsNYSKAGZlYWJQEhAZiFYawmUgMzKwkQgJCCzEKy1BEpAZmVhIhASkFkI1loCJSCzsjARCAnILARrLYESkFlZmAiEBGQWgrWWQAnIrCxMBEICMgvBWkugBGRWFiYCIQGZhWCtJVACMisLE4GQgMxCsNYSKAGZlYWJQEhAZiFYawmUgMzKwkQgJCCzEKy1BEpAZmVhIhASkFkI1loCJSCzsjARCAnILARrLYESkFlZmAiEBGQWgrWWQAnIrCxMBEICMgvBWkugBGRWFiYCIQGZhWCtJVACMisLE4GQgMxCsNYSKAGZlYWJQEhAZiFYawmUgMzKwkQgJCCzEKy1BEpAZmVhIhASkFkI1loCJSCzsjARCAnILARrLYESkFlZmAiEBGQWgrWWQAnIrCxMBEICMgvBWkugBGRWFiYCIQGZhWCtJVACMisLE4GQgMxCsNYSKAGZlYWJQEhAZiFYawmUgMzKwkQgJCCzEKy1BEpAZmVhIhAS2DL7F8r/OP7dtZNpAAAAAElFTkSuQmCC",di={faq:{schema:{title:{type:"text",label:"Назва",placeholder:"Назва"},show_dots:{type:"switcher",label:"Показувати точки"},show_index:{type:"switcher",conditions:["show_dots","==","true"],label:"Показувати нумерацію"},index_type:{type:"combobox",conditions:["show_index","==","true"],label:"Тип нумерації",options:[{id:"decimal",text:"Десятковий"},{id:"upper-alpha",text:"Латинські великі букви"},{id:"lower-alpha",text:"Латинські маленькі букви"},{id:"upper-roman",text:"Римські великі цифри"},{id:"lower-roman",text:"Римські маленькі цифри"},{id:"upper-cyrillic",text:"Кириличні великі букви"},{id:"lower-cyrillic",text:"Кириличні маленькі букви"}]},openfirst:{type:"switcher",label:"Відкрити перший елемент?"},collapse_mode:{type:"switcher",label:"Не згортати попередній елемент?"},data:{type:"DataTable",colModel:[{key:"title",ua:"Назва",type:"text",required:!0,validators:["required"]},{key:"is_section",type:"Radio",label:"Заповнити секціями",options:[{id:"yes",text:"Так"},{id:"no",text:"Ні"}],required:!0,validators:["required"]},{key:"section",type:"reference",label:"Вкладений контент",placeholder:"Ваш контент",conditions:["is_section","==","yes"],required:!0,validators:["required"]},{key:"body",type:"tiptap-editor",label:"Тіло вкладки",placeholder:"Ваш контент",conditions:["is_section","==","no"],required:!0,validators:["required"]}]}}},banner:{schema:{title:{type:"text",label:"Назва",placeholder:"Назва"},image:{type:"file",label:"Зображення",placeholder:"Зображення"}}},photoGrid:{schema:{columns:{type:"number",label:"Кількість колонок",placeholder:"Кількість колонок",default:3},data:{type:"DataTable",colModel:[{key:"image",ua:"Зображення",type:"file"},{key:"caption",ua:"Заголовок",type:"text"}]}}},slider:{schema:{autoplay:{type:"switcher",label:"Автоматичне гортання?",default:!0},autoplaySpeed:{type:"number",label:"Швидкість автоматичного гортання(мс)",placeholder:"Швидкість автоматичного гортання(мс)",default:3e3},show_navigation:{type:"switcher",label:"Показувати кнопки навігації?"},data:{type:"DataTable",colModel:[{key:"title",ua:"Назва",type:"text"},{key:"link",ua:"Посилання",type:"text"},{key:"image",ua:"Зображення",type:"file"},{key:"image_width",ua:"Ширина зображення(px)",type:"number",placeholder:"Ширина зображення"},{key:"image_height",ua:"Висота зображення(px)",type:"number",placeholder:"Висота зображення"},{ua:"Розтягувати по ширині",key:"stretch",type:"switcher"},{key:"target_blank",ua:"Відкривати в новій вкладці?",type:"switcher"}]}}},video:{schema:{file:{type:"file",max_size:50,description:"Максимальний розмір файлу 50MB",label:"Завантажити відео",placeholder:"Завантажити відео"},hidden_gif:{type:"switcher",label:"Сховати GIF"},preview:{type:"file",label:"Прев'ю для відео"},link:{type:"text",label:"Посилання",placeholder:"Посилання"}}},about:{schema:{title:{type:"text",label:"Заголовок",placeholder:"Заголовок"},text:{type:"tiptap-editor",label:"Текст",placeholder:"Текст"},url:{type:"file",label:"Зображення / відео",placeholder:"Посилання"}}},cards:{schema:{title:{type:"text",label:"Заголовок",placeholder:"Заголовок"},data:{type:"DataTable",colModel:[{key:"title",ua:"Назва",type:"text"},{key:"img",ua:"Зображення",type:"file"},{key:"link",ua:"Посилання",type:"text"},{key:"description",ua:"Опис",type:"text"}]}}},usefulLinks:{schema:{title:{type:"text",label:"Заголовок",placeholder:"Заголовок"},data:{type:"DataTable",colModel:[{key:"text",ua:"Назва",type:"text"},{key:"url",ua:"Посилання",type:"text"},{key:"target_blank",ua:"Відкривати в новій вкладці?",type:"switcher"}]}}},team:{schema:{data:{type:"DataTable",colModel:[{key:"avatar",ua:"Аватар",type:"file"},{key:"title",ua:"Ім'я/ПІБ",type:"text"},{key:"description",ua:"Опис",type:"textarea",optional:!0},{key:"position",ua:"Посада",type:"text",tooltip:!0},{key:"email",ua:"Email",type:"text",optional:!0},{key:"tel",ua:"Телефон",type:"text",optional:!0},{key:"schedule",ua:"Графік прийому",type:"text",optional:!0},{key:"isinfo",type:"switcher",label:"Відображати кнопку 'Детальніше'"},{key:"slug",ua:"Slug",type:"text",label:"Унікальний ідентифікатор"}]}}},body:{schema:{background_color:{type:"switcher",label:"Додати білий фон?"},content:{type:"tiptap-editor",label:"Текст",placeholder:"Текст"}}},news:{schema:{title:{type:"text",label:"Заголовок",placeholder:"Заголовок"},buttonText:{type:"text",label:"Текст кнопки",placeholder:"Текст кнопки"},buttonLink:{type:"text",label:"Посилання кнопки",placeholder:"Посилання кнопки"},tag:{type:"select",label:"Тег",placeholder:"Тег",data:"tag_id"},news_list:{type:"select",label:"Список новин",multiple:!0,placeholder:"Список новин",parent:"tag",data:"news_tag_id"}}},form:{schema:{title:{type:"text",label:"Заголовок",placeholder:"Заголовок"},formUrl:{type:"text",label:"Посилання для відправки форми",placeholder:"Посилання"},schema:{label:"Схема форми",type:"DataTable",colModel:[{key:"name",ua:"Name",type:"text",placeholder:"Name"},{key:"label",ua:"Title",type:"text",placeholder:"Title"},{key:"type",ua:"Type",type:"combobox",options:[{text:"Text",id:"text"},{text:"Textarea",id:"textarea"},{text:"switcher",id:"switcher"},{text:"Email",id:"email"},{text:"Mask",id:"mask"},{text:"Number",id:"number"},{text:"Date",id:"date"},{text:"Datetime",id:"datetime"}]},{key:"mask",ua:"Маска",type:"text",conditions:["type","==","mask"],placeholder:"Маска"},{key:"placeholder",ua:"Плейсхолдер",type:"text",placeholder:"Placeholder"},{key:"required",ua:"Required",type:"switcher"}]}}},tabs:{schema:{title:{type:"text",label:"Заголовок",placeholder:"Заголовок"},description:{type:"textarea",label:"Опис",placeholder:"Опис"},history_mode:{type:"switcher",label:"Використовувати історію сторінки?"},data:{type:"DataTable",colModel:[{key:"slug",type:"slug",label:"Slug",parent:"title",placeholder:"Slug"},{key:"title",ua:"Назва",type:"text",required:!0,validators:["required"]},{key:"is_section",type:"Radio",label:"Заповнити секціями",options:[{id:"yes",text:"Так"},{id:"no",text:"Ні"}],required:!0,validators:["required"]},{key:"section",type:"reference",label:"Тіло вкладки",placeholder:"Ваш контент",conditions:["is_section","==","yes"],required:!0,validators:["required"]},{key:"body",type:"tiptap-editor",label:"Тіло вкладки",placeholder:"Ваш контент",conditions:["is_section","==","no"],required:!0,validators:["required"]}]}}},vertical_tabs:{schema:{title:{type:"text",label:"Заголовок",placeholder:"Заголовок"},history_mode:{type:"switcher",label:"Використовувати історію сторінки?"},data:{type:"DataTable",colModel:[{key:"slug",type:"slug",label:"Slug",parent:"title",placeholder:"Slug"},{key:"title",ua:"Назва",type:"text",required:!0,validators:["required"]},{key:"is_section",type:"Radio",label:"Заповнити секціями",options:[{id:"yes",text:"Так"},{id:"no",text:"Ні"},{id:"slug",text:"Привязати сторінку"}],required:!0,validators:["required"]},{key:"slug",type:"text",label:"Slug",placeholder:"Slug",conditions:["is_section","==","slug"]},{key:"section",type:"reference",label:"Тіло вкладки",placeholder:"Ваш контент",conditions:["is_section","==","yes"],required:!0,validators:["required"]},{key:"body",type:"tiptap-editor",label:"Тіло вкладки",placeholder:"Ваш контент",conditions:["is_section","==","no"],required:!0,validators:["required"]}]}}},documents:{schema:{title:{type:"text",label:"Заголовок",placeholder:"Заголовок"},icon:{type:"file",label:"Завантажити іконку",placeholder:"Завантажити іконку"},show_icon:{type:"switcher",label:"Показувати іконку?"},documents:{type:"DataTable",colModel:[{key:"title",ua:"Назва",type:"text"},{key:"file",info:"Прев'ю доступно тільки для документів у форматі pdf, html, txt. Інші формати одразу завантажуються.",ua:"Файл",type:"file"}]}}},infoLine:{schema:{divider:{type:"file",label:"Завантажити розподілювач"},speed:{type:"number",label:"Швидкість автоматичного гортання(с)",placeholder:"Швидкість автоматичного гортання(с)",default:20},data:{type:"DataTable",colModel:[{key:"title",ua:"Текст",type:"text"}]}}},interested:{schema:{title:{type:"text",label:"Заголовок",placeholder:"Заголовок"},data:{type:"DataTable",colModel:[{key:"title",ua:"Заголовок",type:"text"},{key:"link",ua:"Посилання",type:"text"},{key:"target_blank",ua:"Відкривати в новій вкладці?",type:"switcher"},{key:"color",ua:"Колір фону",type:"color"}]}}},contact:{schema:{title:{type:"text",label:"Заголовок",placeholder:"Заголовок"},data:{type:"DataTable",colModel:[{key:"type",ua:"Тип",type:"combobox",options:[{id:"email",text:"Email"},{id:"tel",text:"Телефон"},{id:"address",text:"Адреса"}]},{key:"title",ua:"Пошта",type:"text",conditions:["type","==","email"]},{key:"title",ua:"Телефон",type:"text",conditions:["type","==","tel"]},{key:"title",ua:"Адреса",type:"text",conditions:["type","==","address"]},{key:"description",ua:"Опис",type:"text"}]}}},iframe:{schema:{link:{type:"text",label:"Посилання",placeholder:"Посилання"},file:{type:"file",label:"Завантажити файл",placeholder:"Завантажити файл"},height:{type:"text",label:"Висота iframe(px)",placeholder:"Висота iframe(px)"}}}},Ga=[{text:"reference.faq",id:"faq"},{text:"reference.banner",id:"banner"},{text:"reference.slider",id:"slider"},{text:"reference.photoGrid",id:"photoGrid"},{text:"reference.video",id:"video"},{text:"reference.about",id:"about"},{text:"reference.cards",id:"cards"},{text:"reference.usefulLinks",id:"usefulLinks"},{text:"reference.team",id:"team"},{text:"reference.body",id:"body"},{text:"reference.news",id:"news"},{text:"reference.form",id:"form"},{text:"reference.tabs",id:"tabs"},{text:"reference.vertical_tabs",id:"vertical_tabs"},{text:"reference.documents",id:"documents"},{text:"reference.infoLine",id:"infoLine"},{text:"reference.interested",id:"interested"},{text:"reference.contact",id:"contact"},{text:"reference.iframe",id:"iframe"}],HC={class:"h-full w-full flex flex-col"},qC={class:"flex justify-between items-center mt-2 pt-2 border-t border-gray-300"},GC={class:"text-xs font-medium text-gray-600"},WC={key:0,class:"text-xs text-gray-500"},ui={__name:"cards-skeleton",props:{text:{type:String,required:!0},count:{type:Number,required:!0}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",HC,[a[0]||(a[0]=e.createStaticVNode('<div class="flex-1 grid grid-cols-3 gap-1.5"><div class="bg-gray-200 rounded p-1.5 flex flex-col"><div class="flex-1 bg-gray-300 rounded mb-1"></div><div class="h-1.5 bg-gray-400 rounded"></div></div><div class="bg-gray-200 rounded p-1.5 flex flex-col"><div class="flex-1 bg-gray-300 rounded mb-1"></div><div class="h-1.5 bg-gray-400 rounded"></div></div><div class="bg-gray-200 rounded p-1.5 flex flex-col"><div class="flex-1 bg-gray-300 rounded mb-1"></div><div class="h-1.5 bg-gray-400 rounded"></div></div><div class="bg-gray-200 rounded p-1.5 flex flex-col"><div class="flex-1 bg-gray-300 rounded mb-1"></div><div class="h-1.5 bg-gray-400 rounded"></div></div><div class="bg-gray-200 rounded p-1.5 flex flex-col"><div class="flex-1 bg-gray-300 rounded mb-1"></div><div class="h-1.5 bg-gray-400 rounded"></div></div><div class="bg-gray-200 rounded p-1.5 flex flex-col"><div class="flex-1 bg-gray-300 rounded mb-1"></div><div class="h-1.5 bg-gray-400 rounded"></div></div></div>',1)),e.createElementVNode("div",qC,[e.createElementVNode("div",GC,e.toDisplayString(t.$t(l.text)),1),l.count&&l.count>0?(e.openBlock(),e.createElementBlock("div",WC,e.toDisplayString(l.count),1)):e.createCommentVNode("",!0)])]))}},KC={class:"h-full w-full flex flex-col"},YC={class:"flex justify-between items-center mt-2 pt-2 border-t border-gray-300"},XC={class:"text-xs font-medium text-gray-600"},ZC={key:0,class:"text-xs text-gray-500"},QC={__name:"faq-skeleton",props:{text:{type:String,required:!0},count:{type:Number,required:!0}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",KC,[a[0]||(a[0]=e.createStaticVNode('<div class="h-3 bg-gray-500 rounded mb-2"></div><div class="space-y-1.5 flex-1"><div class="border border-gray-300 rounded p-1"><div class="flex items-center justify-between"><div class="h-1.5 bg-gray-300 rounded flex-1 mr-2"></div><svg 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" class="lucide lucide-chevron-down w-2.5 h-2.5 text-gray-400"><path d="m6 9 6 6 6-6"></path></svg></div></div><div class="border border-gray-300 rounded p-1"><div class="flex items-center justify-between"><div class="h-1.5 bg-gray-300 rounded flex-1 mr-2"></div><svg 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" class="lucide lucide-chevron-down w-2.5 h-2.5 text-gray-400"><path d="m6 9 6 6 6-6"></path></svg></div><div class="mt-1 pt-1 border-t border-gray-200"><div class="space-y-0.5"><div class="h-1 bg-gray-200 rounded"></div><div class="h-1 bg-gray-200 rounded w-5/6"></div><div class="h-1 bg-gray-200 rounded w-4/5"></div></div></div></div><div class="border border-gray-300 rounded p-1"><div class="flex items-center justify-between"><div class="h-1.5 bg-gray-300 rounded flex-1 mr-2"></div><svg 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" class="lucide lucide-chevron-down w-2.5 h-2.5 text-gray-400"><path d="m6 9 6 6 6-6"></path></svg></div></div><div class="border border-gray-300 rounded p-1"><div class="flex items-center justify-between"><div class="h-1.5 bg-gray-300 rounded flex-1 mr-2"></div><svg 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" class="lucide lucide-chevron-down w-2.5 h-2.5 text-gray-400"><path d="m6 9 6 6 6-6"></path></svg></div></div></div>',2)),e.createElementVNode("div",YC,[e.createElementVNode("div",XC,e.toDisplayString(t.$t(l.text)),1),l.count&&l.count>0?(e.openBlock(),e.createElementBlock("div",ZC,e.toDisplayString(l.count),1)):e.createCommentVNode("",!0)])]))}},JC={class:"h-full w-full flex flex-col"},eV={class:"flex justify-between items-center mt-2 pt-2 border-t border-gray-300"},tV={class:"text-xs font-medium text-gray-600"},lV={key:0,class:"text-xs text-gray-500"},mi={__name:"banner-skeleton",props:{text:{type:String,required:!0},count:{type:Number,required:!0}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",JC,[a[0]||(a[0]=e.createStaticVNode('<div class="flex-1 bg-gray-200 rounded relative"><div class="absolute inset-0 flex items-center justify-center"><div class="w-16 h-10 bg-gray-300 rounded"></div></div><div class="absolute bottom-2 left-2"><div class="h-3 bg-gray-400 rounded w-16"></div></div></div>',1)),e.createElementVNode("div",eV,[e.createElementVNode("div",tV,e.toDisplayString(t.$t(l.text)),1),l.count&&l.count>0?(e.openBlock(),e.createElementBlock("div",lV,e.toDisplayString(l.count),1)):e.createCommentVNode("",!0)])]))}},aV={class:"h-full w-full flex flex-col"},rV={class:"flex justify-between items-center mt-2 pt-2 border-t border-gray-300"},nV={class:"text-xs font-medium text-gray-600"},oV={key:0,class:"text-xs text-gray-500"},sV={__name:"form-skeleton",props:{text:{type:String,required:!0},count:{type:Number,required:!0}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",aV,[a[0]||(a[0]=e.createStaticVNode('<div class="h-3 bg-gray-500 rounded mb-2"></div><div class="space-y-1.5 flex-1"><div><div class="h-1.5 bg-gray-300 rounded mb-1 w-1/4"></div><div class="h-5 bg-gray-200 rounded border border-gray-300"></div></div><div><div class="h-1.5 bg-gray-300 rounded mb-1 w-1/3"></div><div class="h-5 bg-gray-200 rounded border border-gray-300"></div></div><div><div class="h-1.5 bg-gray-300 rounded mb-1 w-1/4"></div><div class="h-5 bg-gray-200 rounded border border-gray-300"></div></div><div><div class="h-1.5 bg-gray-300 rounded mb-1 w-1/3"></div><div class="h-8 bg-gray-200 rounded border border-gray-300"></div></div></div><div class="h-6 bg-gray-600 rounded mt-2"></div>',3)),e.createElementVNode("div",rV,[e.createElementVNode("div",nV,e.toDisplayString(t.$t(l.text)),1),l.count&&l.count>0?(e.openBlock(),e.createElementBlock("div",oV,e.toDisplayString(l.count),1)):e.createCommentVNode("",!0)])]))}},iV={class:"h-full w-full flex flex-col"},cV={class:"flex justify-between items-center mt-2 pt-2 border-t border-gray-300"},dV={class:"text-xs font-medium text-gray-600"},uV={key:0,class:"text-xs text-gray-500"},pi={__name:"news-skeleton",props:{text:{type:String,required:!0},count:{type:Number,required:!0}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",iV,[a[0]||(a[0]=e.createStaticVNode('<div class="h-4 bg-gray-400 rounded mb-2"></div><div class="flex gap-2 flex-1"><div class="flex-1 space-y-2"><div class="bg-gray-200 rounded p-1.5"><div class="h-8 bg-gray-300 rounded mb-1"></div><div class="h-1.5 bg-gray-400 rounded mb-1"></div><div class="h-1 bg-gray-300 rounded w-3/4"></div></div><div class="bg-gray-200 rounded p-1.5"><div class="h-8 bg-gray-300 rounded mb-1"></div><div class="h-1.5 bg-gray-400 rounded mb-1"></div><div class="h-1 bg-gray-300 rounded w-3/4"></div></div></div><div class="w-20 space-y-1"><div class="border-b border-gray-300 pb-1"><div class="h-1 bg-gray-300 rounded mb-1"></div><div class="h-1 bg-gray-300 rounded w-4/5"></div></div><div class="border-b border-gray-300 pb-1"><div class="h-1 bg-gray-300 rounded mb-1"></div><div class="h-1 bg-gray-300 rounded w-4/5"></div></div><div class="border-b border-gray-300 pb-1"><div class="h-1 bg-gray-300 rounded mb-1"></div><div class="h-1 bg-gray-300 rounded w-4/5"></div></div><div class="border-b border-gray-300 pb-1"><div class="h-1 bg-gray-300 rounded mb-1"></div><div class="h-1 bg-gray-300 rounded w-4/5"></div></div></div></div>',2)),e.createElementVNode("div",cV,[e.createElementVNode("div",dV,e.toDisplayString(t.$t(l.text)),1),l.count&&l.count>0?(e.openBlock(),e.createElementBlock("div",uV,e.toDisplayString(l.count),1)):e.createCommentVNode("",!0)])]))}},mV={class:"h-full w-full flex flex-col"},pV={class:"flex justify-between items-center mt-2 pt-2 border-t border-gray-300"},fV={class:"text-xs font-medium text-gray-600"},hV={key:0,class:"text-xs text-gray-500"},gV={__name:"team-skeleton",props:{text:{type:String,required:!0},count:{type:Number,required:!0}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",mV,[a[0]||(a[0]=e.createStaticVNode('<div class="space-y-2 flex-1"><div class="flex items-start gap-2"><div class="w-8 h-8 bg-gray-300 rounded flex-shrink-0"></div><div class="flex-1 min-w-0"><div class="h-2 bg-gray-400 rounded mb-1 w-2/3"></div><div class="h-1.5 bg-gray-300 rounded mb-1"></div><div class="flex gap-1"><svg 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" class="lucide lucide-phone w-2.5 h-2.5 text-gray-400"><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"></path></svg><svg 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" class="lucide lucide-mail w-2.5 h-2.5 text-gray-400"><rect width="20" height="16" x="2" y="4" rx="2"></rect><path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"></path></svg><svg 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" class="lucide lucide-clock w-2.5 h-2.5 text-gray-400"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg></div></div></div><div class="flex items-start gap-2"><div class="w-8 h-8 bg-gray-300 rounded flex-shrink-0"></div><div class="flex-1 min-w-0"><div class="h-2 bg-gray-400 rounded mb-1 w-2/3"></div><div class="h-1.5 bg-gray-300 rounded mb-1"></div><div class="flex gap-1"><svg 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" class="lucide lucide-phone w-2.5 h-2.5 text-gray-400"><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"></path></svg><svg 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" class="lucide lucide-mail w-2.5 h-2.5 text-gray-400"><rect width="20" height="16" x="2" y="4" rx="2"></rect><path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"></path></svg><svg 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" class="lucide lucide-clock w-2.5 h-2.5 text-gray-400"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg></div></div></div><div class="flex items-start gap-2"><div class="w-8 h-8 bg-gray-300 rounded flex-shrink-0"></div><div class="flex-1 min-w-0"><div class="h-2 bg-gray-400 rounded mb-1 w-2/3"></div><div class="h-1.5 bg-gray-300 rounded mb-1"></div><div class="flex gap-1"><svg 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" class="lucide lucide-phone w-2.5 h-2.5 text-gray-400"><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"></path></svg><svg 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" class="lucide lucide-mail w-2.5 h-2.5 text-gray-400"><rect width="20" height="16" x="2" y="4" rx="2"></rect><path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"></path></svg><svg 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" class="lucide lucide-clock w-2.5 h-2.5 text-gray-400"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg></div></div></div><div class="flex items-start gap-2"><div class="w-8 h-8 bg-gray-300 rounded flex-shrink-0"></div><div class="flex-1 min-w-0"><div class="h-2 bg-gray-400 rounded mb-1 w-2/3"></div><div class="h-1.5 bg-gray-300 rounded mb-1"></div><div class="flex gap-1"><svg 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" class="lucide lucide-phone w-2.5 h-2.5 text-gray-400"><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"></path></svg><svg 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" class="lucide lucide-mail w-2.5 h-2.5 text-gray-400"><rect width="20" height="16" x="2" y="4" rx="2"></rect><path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"></path></svg><svg 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" class="lucide lucide-clock w-2.5 h-2.5 text-gray-400"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg></div></div></div></div>',1)),e.createElementVNode("div",pV,[e.createElementVNode("div",fV,e.toDisplayString(t.$t(l.text)),1),l.count&&l.count>0?(e.openBlock(),e.createElementBlock("div",hV,e.toDisplayString(l.count),1)):e.createCommentVNode("",!0)])]))}},bV={class:"h-full w-full flex flex-col"},yV={class:"flex justify-between items-center mt-2 pt-2 border-t border-gray-300"},kV={class:"text-xs font-medium text-gray-600"},xV={key:0,class:"text-xs text-gray-500"},fi={__name:"usefulLinks-skeleton",props:{text:{type:String,required:!0},count:{type:Number,required:!0}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",bV,[a[0]||(a[0]=e.createStaticVNode('<div class="h-4 bg-gray-400 rounded mb-3"></div><div class="grid grid-cols-2 gap-2 flex-1"><div class="space-y-2"><div class="flex items-center justify-between p-1.5 border border-gray-300 rounded"><div class="h-1.5 bg-gray-300 rounded flex-1 mr-2"></div><div class="w-2 h-2 bg-gray-400 rounded-full"></div></div><div class="flex items-center justify-between p-1.5 border border-gray-300 rounded"><div class="h-1.5 bg-gray-300 rounded flex-1 mr-2"></div><div class="w-2 h-2 bg-gray-400 rounded-full"></div></div><div class="flex items-center justify-between p-1.5 border border-gray-300 rounded"><div class="h-1.5 bg-gray-300 rounded flex-1 mr-2"></div><div class="w-2 h-2 bg-gray-400 rounded-full"></div></div></div><div class="space-y-2"><div class="flex items-center justify-between p-1.5 border border-gray-300 rounded"><div class="h-1.5 bg-gray-300 rounded flex-1 mr-2"></div><div class="w-2 h-2 bg-gray-400 rounded-full"></div></div><div class="flex items-center justify-between p-1.5 border border-gray-300 rounded"><div class="h-1.5 bg-gray-300 rounded flex-1 mr-2"></div><div class="w-2 h-2 bg-gray-400 rounded-full"></div></div><div class="flex items-center justify-between p-1.5 border border-gray-300 rounded"><div class="h-1.5 bg-gray-300 rounded flex-1 mr-2"></div><div class="w-2 h-2 bg-gray-400 rounded-full"></div></div></div></div>',2)),e.createElementVNode("div",yV,[e.createElementVNode("div",kV,e.toDisplayString(t.$t(l.text)),1),l.count&&l.count>0?(e.openBlock(),e.createElementBlock("div",xV,e.toDisplayString(l.count),1)):e.createCommentVNode("",!0)])]))}},wV={class:"h-full w-full flex flex-col"},_V={class:"flex justify-between items-center mt-2 pt-2 border-t border-gray-300"},EV={class:"text-xs font-medium text-gray-600"},CV={key:0,class:"text-xs text-gray-500"},VV={__name:"video-skeleton",props:{text:{type:String,required:!0},count:{type:Number,required:!0}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",wV,[a[0]||(a[0]=e.createStaticVNode('<div class="flex-1 bg-gray-200 rounded relative"><div class="absolute inset-0 flex items-center justify-center"><div class="w-10 h-10 bg-gray-400 rounded-full flex items-center justify-center"><svg 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" class="lucide lucide-play w-5 h-5 text-white ml-0.5"><polygon points="6 3 20 12 6 21 6 3"></polygon></svg></div></div><div class="absolute bottom-1.5 left-1.5 right-1.5"><div class="h-2 bg-gray-400 rounded mb-1"></div><div class="h-2 bg-gray-400 rounded w-3/4"></div></div></div><div class="mt-2 flex items-center gap-2"><div class="w-5 h-5 bg-gray-300 rounded"></div><div class="h-2 bg-gray-300 rounded flex-1"></div></div>',2)),e.createElementVNode("div",_V,[e.createElementVNode("div",EV,e.toDisplayString(t.$t(l.text)),1),l.count&&l.count>0?(e.openBlock(),e.createElementBlock("div",CV,e.toDisplayString(l.count),1)):e.createCommentVNode("",!0)])]))}},NV={class:"h-full w-full flex flex-col"},vV={class:"flex justify-between items-center mt-2 pt-2 border-t border-gray-300"},BV={class:"text-xs font-medium text-gray-600"},SV={key:0,class:"text-xs text-gray-500"},DV={__name:"about-skeleton",props:{text:{type:String,required:!0},count:{type:Number,required:!0}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",NV,[a[0]||(a[0]=e.createStaticVNode('<div class="flex flex-1"><div class="flex-1 pr-2"><div class="h-4 bg-gray-400 rounded mb-2"></div><div class="space-y-1.5"><div class="h-2 bg-gray-300 rounded"></div><div class="h-2 bg-gray-300 rounded"></div><div class="h-2 bg-gray-300 rounded w-4/5"></div><div class="h-2 bg-gray-300 rounded"></div><div class="h-2 bg-gray-300 rounded w-3/4"></div><div class="h-2 bg-gray-300 rounded"></div></div></div><div class="w-16 h-20 bg-gray-200 rounded flex items-center justify-center"><div class="w-6 h-6 bg-gray-300 rounded-full"></div></div></div>',1)),e.createElementVNode("div",vV,[e.createElementVNode("div",BV,e.toDisplayString(t.$t(l.text)),1),l.count&&l.count>0?(e.openBlock(),e.createElementBlock("div",SV,e.toDisplayString(l.count),1)):e.createCommentVNode("",!0)])]))}},AV={class:"h-full w-full flex flex-col"},MV={class:"flex justify-between items-center mt-2 pt-2 border-t border-gray-300"},TV={class:"text-xs font-medium text-gray-600"},LV={key:0,class:"text-xs text-gray-500"},$V={__name:"slider-skeleton",props:{text:{type:String,required:!0},count:{type:Number,required:!0}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",AV,[a[0]||(a[0]=e.createStaticVNode('<div class="flex-1 bg-gray-200 rounded mb-2 relative"><div class="absolute inset-0 flex items-center justify-center"><div class="w-12 h-8 bg-gray-300 rounded"></div></div><div class="absolute left-1 top-1/2 transform -translate-y-1/2"><svg 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" class="lucide lucide-chevron-left w-4 h-4 text-gray-400"><path d="m15 18-6-6 6-6"></path></svg></div><div class="absolute right-1 top-1/2 transform -translate-y-1/2"><svg 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" class="lucide lucide-chevron-right w-4 h-4 text-gray-400"><path d="m9 18 6-6-6-6"></path></svg></div></div><div class="h-3 bg-gray-300 rounded mb-2"></div><div class="h-6 w-20 bg-gray-400 rounded"></div><div class="flex justify-center gap-1 mt-2"><div class="w-1.5 h-1.5 bg-gray-300 rounded-full"></div><div class="w-1.5 h-1.5 bg-gray-300 rounded-full"></div><div class="w-1.5 h-1.5 bg-gray-300 rounded-full"></div><div class="w-1.5 h-1.5 bg-gray-300 rounded-full"></div><div class="w-1.5 h-1.5 bg-gray-300 rounded-full"></div></div>',4)),e.createElementVNode("div",MV,[e.createElementVNode("div",TV,e.toDisplayString(t.$t(l.text)),1),l.count&&l.count>0?(e.openBlock(),e.createElementBlock("div",LV,e.toDisplayString(l.count),1)):e.createCommentVNode("",!0)])]))}},FV={class:"h-full flex flex-col"},IV={class:"flex justify-between items-center mt-2 pt-2 border-t border-gray-300"},OV={class:"text-xs font-medium text-gray-600"},PV={key:0,class:"text-xs text-gray-500"},RV={__name:"infoLine-skeleton",props:{text:{type:String,required:!0},count:{type:Number,required:!0}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",FV,[a[0]||(a[0]=e.createStaticVNode('<div class="flex-1 bg-gray-200 rounded relative overflow-hidden"><div class="absolute inset-0 flex items-center"><div class="flex gap-8 whitespace-nowrap animate-pulse"><div class="h-3 bg-gray-400 rounded w-32"></div><div class="h-3 bg-gray-300 rounded w-24"></div><div class="h-3 bg-gray-400 rounded w-40"></div><div class="h-3 bg-gray-300 rounded w-28"></div><div class="h-3 bg-gray-400 rounded w-36"></div><div class="h-3 bg-gray-300 rounded w-20"></div></div></div><div class="absolute top-2 left-2 right-2 flex justify-between items-center"><div class="w-2 h-2 bg-gray-500 rounded-full"></div><div class="w-2 h-2 bg-gray-500 rounded-full"></div></div></div>',1)),e.createElementVNode("div",IV,[e.createElementVNode("div",OV,e.toDisplayString(t.$t(l.text)),1),l.count&&l.count>0?(e.openBlock(),e.createElementBlock("div",PV,e.toDisplayString(l.count),1)):e.createCommentVNode("",!0)])]))}},UV={class:"h-full flex flex-col"},jV={class:"flex justify-between items-center mt-2 pt-2 border-t border-gray-300"},zV={class:"text-xs font-medium text-gray-600"},HV={key:0,class:"text-xs text-gray-500"},qV={__name:"tabs-skeleton",props:{text:{type:String,required:!0},count:{type:Number,required:!0}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",UV,[a[0]||(a[0]=e.createStaticVNode('<div class="h-2 bg-gray-300 rounded mb-2"></div><div class="flex gap-1 mb-3"><div class="h-4 w-16 bg-gray-400 rounded"></div><div class="h-4 w-16 bg-gray-200 rounded"></div></div><div class="space-y-2 flex-1"><div class="h-2 bg-gray-300 rounded w-5/6"></div><div class="h-2 bg-gray-300 rounded"></div><div class="space-y-1 mt-3"><div class="flex items-center gap-2"><div class="w-2 h-2 bg-gray-400 rounded-full"></div><div class="h-1.5 bg-gray-300 rounded w-20"></div></div><div class="flex items-center gap-2"><div class="w-2 h-2 bg-gray-400 rounded-full"></div><div class="h-1.5 bg-gray-300 rounded w-16"></div></div></div></div>',3)),e.createElementVNode("div",jV,[e.createElementVNode("div",zV,e.toDisplayString(t.$t(l.text)),1),l.count&&l.count>0?(e.openBlock(),e.createElementBlock("div",HV,e.toDisplayString(l.count),1)):e.createCommentVNode("",!0)])]))}},GV={class:"h-full flex flex-col"},WV={class:"flex justify-between items-center mt-2 pt-2 border-t border-gray-300"},KV={class:"text-xs font-medium text-gray-600"},YV={key:0,class:"text-xs text-gray-500"},hi={__name:"documents-skeleton",props:{text:{type:String,required:!0},count:{type:Number,required:!0}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",GV,[a[0]||(a[0]=e.createStaticVNode('<div class="h-4 bg-gray-400 rounded mb-2"></div><div class="space-y-1.5 flex-1"><div class="flex items-center justify-between p-1.5 border-b border-gray-200"><div class="flex items-center gap-2"><div class="w-3 h-3 bg-gray-400 rounded-full"></div><div class="h-2 bg-gray-300 rounded flex-1 w-28"></div></div><div class="flex gap-1.5"><div class="w-3 h-3 bg-gray-200 rounded"></div><div class="w-3 h-3 bg-gray-200 rounded"></div></div></div><div class="flex items-center justify-between p-1.5 border-b border-gray-200"><div class="flex items-center gap-2"><div class="w-3 h-3 bg-gray-400 rounded-full"></div><div class="h-2 bg-gray-300 rounded flex-1 w-28"></div></div><div class="flex gap-1.5"><div class="w-3 h-3 bg-gray-200 rounded"></div><div class="w-3 h-3 bg-gray-200 rounded"></div></div></div><div class="flex items-center justify-between p-1.5 border-b border-gray-200"><div class="flex items-center gap-2"><div class="w-3 h-3 bg-gray-400 rounded-full"></div><div class="h-2 bg-gray-300 rounded flex-1 w-28"></div></div><div class="flex gap-1.5"><div class="w-3 h-3 bg-gray-200 rounded"></div><div class="w-3 h-3 bg-gray-200 rounded"></div></div></div><div class="flex items-center justify-between p-1.5 border-b border-gray-200"><div class="flex items-center gap-2"><div class="w-3 h-3 bg-gray-400 rounded-full"></div><div class="h-2 bg-gray-300 rounded flex-1 w-28"></div></div><div class="flex gap-1.5"><div class="w-3 h-3 bg-gray-200 rounded"></div><div class="w-3 h-3 bg-gray-200 rounded"></div></div></div></div>',2)),e.createElementVNode("div",WV,[e.createElementVNode("div",KV,e.toDisplayString(t.$t(l.text)),1),l.count&&l.count>0?(e.openBlock(),e.createElementBlock("div",YV,e.toDisplayString(l.count),1)):e.createCommentVNode("",!0)])]))}},XV={class:"h-full flex flex-col"},ZV={class:"flex justify-between items-center mt-2 pt-2 border-t border-gray-300"},QV={class:"text-xs font-medium text-gray-600"},JV={key:0,class:"text-xs text-gray-500"},Wa={faq:QC,banner:mi,slider:$V,video:VV,about:DV,cards:ui,usefulLinks:fi,team:gV,news:pi,form:sV,tabs:qV,vertical_tabs:pi,documents:hi,infoLine:RV,body:{__name:"body-skeleton",props:{text:{type:String,required:!0},count:{type:Number,required:!0}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",XV,[a[0]||(a[0]=e.createStaticVNode('<div class="grid grid-cols-3 gap-2 flex-1"><div class="flex flex-col"><div class="h-3 bg-gray-400 rounded mb-2"></div><div class="space-y-1.5"><div class="h-4 bg-gray-200 rounded border border-gray-300 p-1.5"><div class="h-1.5 bg-gray-300 rounded w-3/4"></div></div><div class="h-4 bg-gray-200 rounded border border-gray-300 p-1.5"><div class="h-1.5 bg-gray-300 rounded w-3/4"></div></div></div></div><div class="flex flex-col"><div class="h-3 bg-gray-400 rounded mb-2"></div><div class="space-y-1.5"><div class="h-4 bg-gray-200 rounded border border-gray-300 p-1.5"><div class="h-1.5 bg-gray-300 rounded w-3/4"></div></div><div class="h-4 bg-gray-200 rounded border border-gray-300 p-1.5"><div class="h-1.5 bg-gray-300 rounded w-3/4"></div></div></div></div><div class="flex flex-col"><div class="h-3 bg-gray-400 rounded mb-2"></div><div class="space-y-1.5"><div class="h-4 bg-gray-200 rounded border border-gray-300 p-1.5"><div class="h-1.5 bg-gray-300 rounded w-3/4"></div></div><div class="h-4 bg-gray-200 rounded border border-gray-300 p-1.5"><div class="h-1.5 bg-gray-300 rounded w-3/4"></div></div></div></div></div>',1)),e.createElementVNode("div",ZV,[e.createElementVNode("div",QV,e.toDisplayString(t.$t(l.text)),1),l.count&&l.count>0?(e.openBlock(),e.createElementBlock("div",JV,e.toDisplayString(l.count),1)):e.createCommentVNode("",!0)])]))}},photoGrid:ui,interested:fi,contact:hi,iframe:mi},eN={class:"grid grid-cols-1 md:grid-cols-1 lg:grid-cols-2 2xl:grid-cols-3 gap-4"},tN=["onClick"],lN={class:"wireframe-block h-[240px] !p-4 border-2 border-dashed bg-white relative overflow-hidden transition-all rounded-lg shadow-sm border-gray-300 hover:border-gray-400 cursor-pointer"},aN=["src"],rN={__name:"vs-form-reference-choce",props:{modelValue:{type:String,required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(l){const t=e.useModel(l,"modelValue");return(a,r)=>(e.openBlock(),e.createElementBlock("div",eN,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(Ga),n=>(e.openBlock(),e.createElementBlock("div",{key:n.id,onClick:o=>t.value=n.id,class:"relative"},[e.createElementVNode("div",lN,[e.unref(Wa)[n.id]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(Wa)[n.id]),{key:0,text:n==null?void 0:n.text,count:(n==null?void 0:n.data)||0},null,8,["text","count"])):(e.openBlock(),e.createElementBlock("img",{key:1,src:e.unref(ci),alt:"Team collaboration",class:"w-full h-full object-cover"},null,8,aN))])],8,tN))),128))]))}},nN={};function oN(l,t,a,r,n,o){const s=e.resolveComponent("vs-richtext");return e.openBlock(),e.createBlock(s,{class:"w-full"})}const pn=Qt(nN,[["render",oN]]),sN={class:"flex gap-4"},iN={class:"text-sm text-gray-500 dark:text-gray-400 border flex items-center h-10 px-4 rounded-lg w-full"},cN={class:"flex items-center justify-between w-full p-4 border-t border-gray-200 dark:border-gray-700"},dN={__name:"vs-form-reference-add",props:e.mergeModels({title:{type:String,required:!0}},{modelValue:{type:Array,default:()=>[]},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const{t}=Fe();$e["vs-input-reference"]=fn,$e["vs-input-tiptap-editor"]=pn;const a=e.useModel(l,"modelValue"),r=e.ref(!1),n=e.ref({}),o=e.ref(null),s=e.ref({}),i=e.computed(()=>{var u;return((u=di[o.value])==null?void 0:u.schema)||null}),c=async()=>{if(await n.value.validate()){xe({type:"warning",title:t("cms.common.actions.warning"),message:t("cms.builder.editFieldFailed")});return}try{Object.keys(s.value).length!==0&&(a.value=[...a.value||[],{...s.value,id:Math.random().toString(36).substring(2,15),reference_type:o.value}]),r.value=!1,o.value=null,s.value={}}catch(d){console.log(d)}};return e.watch(r,()=>{r.value||(o.value=null,s.value={})}),(u,d)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("button",{type:"button",class:"inline-flex items-center px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm text-sm font-medium text-gray-700 dark:text-gray-200 bg-white dark:bg-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-sky-500",onClick:d[0]||(d[0]=m=>r.value=!r.value)},e.toDisplayString(u.$t("cms.builder.create")),1),e.createVNode(e.unref(Yo),{visible:r.value,"onUpdate:visible":d[6]||(d[6]=m=>r.value=m),position:"right",closeClickBackdrop:!1,onClose:d[7]||(d[7]=m=>r.value=!1),title:o.value?u.$t("cms.builder."+o.value):u.$t("cms.builder.selectType"),size:"50vw"},{footer:e.withCtx(()=>[e.createElementVNode("div",cN,[e.createElementVNode("button",{onClick:d[5]||(d[5]=m=>r.value=!1),class:"inline-flex items-center px-3 py-2 text-sm text-black duration-300 border border-gray-200 rounded-lg gap-x-2 whitespace-nowrap hover:bg-gray-100"},e.toDisplayString(u.$t("cms.builder.cancel")),1),e.createElementVNode("button",{onClick:c,class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"},e.toDisplayString(u.$t("cms.builder.create")),1)])]),default:e.withCtx(()=>{var m;return[o.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",sN,[e.createElementVNode("div",iN,[e.createElementVNode("span",null,e.toDisplayString((m=e.unref(Ga).find(f=>f.id===o.value))==null?void 0:m.text),1)]),e.createElementVNode("button",{class:"py-2.5 px-3 mb-4 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300",onClick:d[2]||(d[2]=f=>o.value=null)},e.toDisplayString(u.$t("cms.builder.changeType")),1)]),i.value?(e.openBlock(),e.createBlock(e.unref(Xe),{key:o.value,schema:i.value,modelValue:s.value,"onUpdate:modelValue":d[3]||(d[3]=f=>s.value=f),form:n.value,"onUpdate:form":d[4]||(d[4]=f=>n.value=f)},null,8,["schema","modelValue","form"])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createBlock(rN,{key:0,modelValue:o.value,"onUpdate:modelValue":d[1]||(d[1]=f=>o.value=f),options:e.unref(Ga)},null,8,["modelValue","options"]))]}),_:1},8,["visible","title"])]))}},uN={class:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity flex space-x-1 z-10"},mN={class:"flex items-center justify-between w-full p-4 border-t border-gray-200 dark:border-gray-700"},pN={__name:"vs-form-reference-controls",props:e.mergeModels({title:{type:String,required:!0}},{modelValue:{type:Object,default:()=>({})},modelModifiers:{},parent:{type:Array,default:()=>[]},parentModifiers:{}}),emits:["update:modelValue","update:parent"],setup(l){const{t}=Fe(),a=e.useModel(l,"modelValue"),r=e.useModel(l,"parent"),n=e.ref(!1),o=e.ref({}),s=e.ref({}),i=e.computed(()=>{var u;return((u=di[a.value.reference_type])==null?void 0:u.schema)||null});e.watch(n,u=>{u&&(o.value={...a.value})});const c=async()=>{try{if(await s.value.validate()){xe({type:"warning",title:t("cms.common.actions.warning"),message:t("cms.builder.editFieldFailed")});return}a.value={...o.value},n.value=!1}catch(u){console.log(u)}};return(u,d)=>(e.openBlock(),e.createElementBlock("div",uN,[e.createElementVNode("button",{onClick:d[0]||(d[0]=m=>n.value=!n.value),class:"p-1.5 bg-white dark:bg-gray-800 rounded shadow-sm hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors border border-gray-200 dark:border-gray-700"},[e.createVNode(e.unref(wl),{class:"h-4 w-4 text-gray-400"})]),e.createElementVNode("button",{onClick:d[1]||(d[1]=m=>r.value=r.value.filter(f=>f.id!==a.value.id)),class:"p-1.5 bg-white dark:bg-gray-800 rounded shadow-sm hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors border border-gray-200 dark:border-gray-700"},[e.createVNode(e.unref(Gt),{class:"h-4 w-4 text-red-500"})]),e.createVNode(e.unref(Yo),{visible:n.value,"onUpdate:visible":d[5]||(d[5]=m=>n.value=m),onClose:d[6]||(d[6]=m=>n.value=!1),title:l.title,width:"50vw"},{footer:e.withCtx(()=>[e.createElementVNode("div",mN,[e.createElementVNode("button",{class:"inline-flex items-center px-3 py-2 text-sm text-black duration-300 border border-gray-200 rounded-lg gap-x-2 whitespace-nowrap hover:bg-gray-100",onClick:d[4]||(d[4]=m=>n.value=!1)},e.toDisplayString(u.$t("cms.common.actions.cancel")),1),e.createElementVNode("button",{onClick:c,class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"},e.toDisplayString(u.$t("cms.common.actions.save")),1)])]),default:e.withCtx(()=>[i.value?(e.openBlock(),e.createBlock(e.unref(Xe),{key:0,form:s.value,"onUpdate:form":d[2]||(d[2]=m=>s.value=m),schema:i.value,modelValue:o.value,"onUpdate:modelValue":d[3]||(d[3]=m=>o.value=m),class:"-mr-[10px] ml-[10px] mt-[10px]"},null,8,["form","schema","modelValue"])):e.createCommentVNode("",!0)]),_:1},8,["visible","title"])]))}},fN={class:"w-full"},hN={key:0,class:"relative"},gN={class:"group wireframe-block h-[280px] !p-4 border-2 border-dashed bg-white relative overflow-hidden transition-all rounded-lg shadow-sm border-gray-00 hover:border-gray-400 cursor-grab"},bN=["src"],fn={__name:"vs-form-reference-list",props:e.mergeModels({reference_type:{type:String,required:!0},title:{type:String,required:!0}},{modelValue:{default:()=>[]},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=n=>{var o;return(o=Ga.find(s=>s.id===n))==null?void 0:o.text},a=e.useModel(l,"modelValue"),r=e.computed({get(){const n=a.value;return n==null?[]:Array.isArray(n)?n:[]},set(n){a.value=Array.isArray(n)?n:[]}});return e.watch(a,n=>{n!=null&&!Array.isArray(n)&&(a.value=[])},{immediate:!0}),(n,o)=>{var s;return e.openBlock(),e.createElementBlock("div",fN,[((s=r.value)==null?void 0:s.length)>0?(e.openBlock(),e.createBlock(e.unref(oi),{key:0,modelValue:r.value,"onUpdate:modelValue":o[1]||(o[1]=i=>r.value=i),"item-key":"id",handle:".drag-handle",class:"grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-4"},{item:e.withCtx(({element:i,index:c})=>[i!=null&&i.reference_type?(e.openBlock(),e.createElementBlock("div",hN,[e.createElementVNode("div",gN,[(e.openBlock(),e.createElementBlock("div",{key:i.id,class:"absolute top-2 left-2 opacity-0 group-hover:opacity-100 border border-gray-200 dark:border-gray-700 transition-opacity cursor-move z-10 bg-white dark:bg-gray-800 rounded p-1 shadow-sm drag-handle"},[e.createVNode(e.unref(Vn),{class:"h-4 w-4 text-gray-400"})])),e.createVNode(pN,{title:n.$t("cms.builder."+(i==null?void 0:i.reference_type)),modelValue:r.value[c],"onUpdate:modelValue":u=>r.value[c]=u,parent:r.value,"onUpdate:parent":o[0]||(o[0]=u=>r.value=u)},null,8,["title","modelValue","onUpdate:modelValue","parent"]),e.unref(Wa)[i==null?void 0:i.reference_type]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(Wa)[i==null?void 0:i.reference_type]),{key:0,index:c,text:t(i==null?void 0:i.reference_type),count:Array.isArray(i==null?void 0:i.data)?i.data.length:0},null,8,["index","text","count"])):(e.openBlock(),e.createElementBlock("img",{key:1,src:e.unref(ci),alt:"Team collaboration",class:"w-full h-full object-cover"},null,8,bN))])])):e.createCommentVNode("",!0)]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),e.createVNode(dN,{class:"mt-4",title:l.title,modelValue:r.value,"onUpdate:modelValue":o[2]||(o[2]=i=>r.value=i)},null,8,["title","modelValue"])])}}};function gi(l){if(l===0)return"0 Bytes";const t=1024,a=["Bytes","KB","MB","GB","TB"],r=Math.floor(Math.log(l)/Math.log(t));return Number.parseFloat((l/Math.pow(t,r)).toFixed(2))+" "+a[r]}function yN(l){const t=new Date(l);return isNaN(t.getTime())?"":t.toISOString().slice(0,10)}const kN={__name:"TypeTag",props:{type:{type:String,required:!0}},setup(l){const t=new Map([["document","bg-blue-100 text-blue-800 border-blue-200 dark:bg-blue-900/30 dark:text-blue-300 dark:border-blue-700"],["image","bg-green-100 text-green-800 border-green-200 dark:bg-green-900/30 dark:text-green-300 dark:border-green-700"],["video","bg-purple-100 text-purple-800 border-purple-200 dark:bg-purple-900/30 dark:text-purple-300 dark:border-purple-700"]]);return(a,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors shadow-lg backdrop-blur-sm",e.unref(t).get(l.type)])},e.toDisplayString(l.type),3))}},xN={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6 max-h-[calc(100%-130px)] overflow-y-auto px-2 pt-2 pb-5"},wN={key:0,class:"flex flex-col items-center justify-center h-64 text-muted-foreground col-span-full"},_N=["onClick"],EN=["onClick"],CN={class:"truncate font-medium text-slate-800 dark:text-slate-100 mb-2"},VN={class:"text-sm text-slate-500 dark:text-slate-400"},NN=["onClick"],vN={class:"p-0"},BN={class:"aspect-video bg-slate-100 dark:bg-slate-700 rounded-t-lg overflow-hidden relative"},SN={class:"w-full h-full flex items-center justify-center bg-gradient-to-br from-slate-100 to-slate-200 dark:from-slate-700 dark:to-slate-800"},DN={key:0,class:"relative w-full"},AN=["src","alt"],MN={class:"p-4"},TN={class:"flex items-center justify-between mb-2"},LN={class:"font-medium text-slate-800 dark:text-slate-100 truncate flex-1 mr-2"},$N={class:"space-y-1 text-sm text-slate-500 dark:text-slate-400"},FN={class:"flex justify-between"},IN={class:"flex justify-between"},ON={__name:"MediaGrid",props:{files:{type:Array,required:!0},selectedFile:{type:Object,default:null},selectedFiles:{type:Array,default:()=>[]},isDeleteButton:{type:Boolean,default:!1}},emits:["delete-file","file-click","delete-folder"],setup(l,{emit:t}){Fe();const a=l,r=e.ref([]),n=e.ref(null),o=i=>{if(!i)return"";const c=new Date(i);return isNaN(c.getTime())?"":c.toISOString().slice(0,10)},s=()=>{r.value=a.files.sort((i,c)=>i.type==="dir"&&c.type!=="dir"?-1:i.type!=="dir"&&c.type==="dir"?1:0)};return e.onMounted(()=>s()),e.onUpdated(()=>s()),(i,c)=>{var u;return e.openBlock(),e.createElementBlock("div",xN,[((u=l.files)==null?void 0:u.length)===0?(e.openBlock(),e.createElementBlock("div",wN,[e.createVNode(e.unref(yl),{class:"w-12 h-12 mb-2"}),e.createElementVNode("p",null,e.toDisplayString(i.$t("cms.noFilesInFolder")),1)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,d=>{var m;return e.openBlock(),e.createElementBlock(e.Fragment,{key:d==null?void 0:d.url},[(d==null?void 0:d.type)==="dir"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"p-6 text-center rounded-xl h-[fit-content] relative text-card-foreground shadow-lg border-0 bg-white dark:bg-slate-800 backdrop-blur-sm hover:shadow-xl transition-all duration-200 transform hover:scale-105 cursor-pointer",onClick:f=>i.$emit("cms.file-click",d)},[l.isDeleteButton?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:e.withModifiers(f=>{n.value=d},["stop"]),class:"absolute top-4 right-4 p-1 border border-gray-300 dark:border-slate-700 rounded-lg cursor-pointer hover:bg-gray-200 dark:hover:bg-slate-700 group"},[e.createVNode(e.unref(Gt),{class:"w-4 h-4 text-gray-500 group-hover:text-red-500"})],8,EN)):e.createCommentVNode("",!0),e.createVNode(e.unref(Cn),{class:"w-16 h-16 mx-auto mb-4 text-blue-600"}),e.createElementVNode("h3",CN,e.toDisplayString(d==null?void 0:d.name),1),e.createElementVNode("p",VN,e.toDisplayString(d==null?void 0:d.count)+" "+e.toDisplayString(i.$t("cms.media.files")),1)],8,_N)):(d==null?void 0:d.type)==="file"?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["h-[fit-content] rounded-xl text-card-foreground shadow-lg border-0 bg-white dark:bg-slate-800 backdrop-blur-sm hover:shadow-xl transition-all duration-200 transform hover:scale-105 group cursor-pointer",{"bg-accent text-accent-foreground ring-2 ring-primary":((m=l.selectedFile)==null?void 0:m.url)===(d==null?void 0:d.url)||l.selectedFiles&&l.selectedFiles.some(f=>f.id===d.id)}]),onClick:f=>i.$emit("cms.file-click",d)},[e.createElementVNode("div",vN,[e.createElementVNode("div",BN,[e.createElementVNode("div",SN,[(d==null?void 0:d.filetype)==="image"&&(d!=null&&d.filepath||d!=null&&d.url)?(e.openBlock(),e.createElementBlock("div",DN,[e.createElementVNode("img",{src:d==null?void 0:d.preview,alt:(d==null?void 0:d.alt)||(d==null?void 0:d.filename),class:"object-cover w-full h-full rounded text-xs"},null,8,AN)])):(e.openBlock(),e.createBlock(e.unref(Il),{key:1,class:"w-12 h-12 text-gray-500"}))])]),e.createElementVNode("div",MN,[e.createElementVNode("div",TN,[e.createElementVNode("h3",LN,e.toDisplayString(d.filename),1),e.createVNode(kN,{type:d==null?void 0:d.filetype},null,8,["type"])]),e.createElementVNode("div",$N,[e.createElementVNode("div",FN,[e.createElementVNode("span",null,e.toDisplayString(i.$t("cms.media.size"))+":",1),e.createElementVNode("span",null,e.toDisplayString(e.unref(gi)(d.filesize)),1)]),e.createElementVNode("div",IN,[e.createElementVNode("span",null,e.toDisplayString(i.$t("cms.media.uploaded"))+":",1),e.createElementVNode("span",null,e.toDisplayString(o(d.created_at)),1)])])])])],10,NN)):e.createCommentVNode("",!0)],64)}),128))])}}},PN={},RN={"aria-hidden":"true",focusable:"false",role:"img",viewBox:"0 0 16 16",width:"16",height:"16",fill:"currentColor"};function UN(l,t){return e.openBlock(),e.createElementBlock("svg",RN,[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M.513 1.513A1.75 1.75 0 0 1 1.75 1h3.5c.55 0 1.07.26 1.4.7l.9 1.2a.25.25 0 0 0 .2.1H 13a1 1 0 0 1 1 1v.5H2.75a.75.75 0 0 0 0 1.5h11.978a1 1 0 0 1 .994 1.117L15 13.25A1.75 1.75 0 0 1 13.25 15H1.75A1.75 1.75 0 0 1 0 13.25V2.75c0-.464.184-.91.513-1.237Z"},null,-1),e.createElementVNode("path",{d:"M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"},null,-1)])])}const jN=Qt(PN,[["render",UN]]),zN={},HN={"aria-hidden":"true",focusable:"false",role:"img",viewBox:"0 0 16 16",width:"16",height:"16",fill:"currentColor"};function qN(l,t){return e.openBlock(),e.createElementBlock("svg",HN,[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M.513 1.513A1.75 1.75 0 0 1 1.75 1h3.5c.55 0 1.07.26 1.4.7l.9 1.2a.25.25 0 0 0 .2.1H 13a1 1 0 0 1 1 1v.5H2.75a.75.75 0 0 0 0 1.5h11.978a1 1 0 0 1 .994 1.117L15 13.25A1.75 1.75 0 0 1 13.25 15H1.75A1.75 1.75 0 0 1 0 13.25V2.75c0-.464.184-.91.513-1.237Z"},null,-1),e.createElementVNode("path",{d:"M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"},null,-1)])])}const GN=Qt(zN,[["render",qN]]),WN={key:0,class:"flex flex-col items-center justify-center h-64 text-muted-foreground"},KN={key:1,class:"w-full text-sm caption-bottom"},YN={class:"[&_tr]:border-b"},XN={class:"border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted"},ZN={class:"h-12 px-4 text-left align-middle font-medium text-muted-foreground w-[300px]"},QN={class:"h-12 px-4 font-medium text-left align-middle text-muted-foreground"},JN={class:"h-12 px-4 font-medium text-left align-middle text-muted-foreground"},ev={class:"hidden h-12 px-4 font-medium text-left align-middle text-muted-foreground md:table-cell"},tv={class:"[&_tr:last-child]:border-0"},lv=["onClick"],av={class:"p-4 font-medium align-middle"},rv={class:"flex items-center gap-2"},nv={key:1,class:"relative w-8 h-8"},ov=["src","alt"],sv={class:"truncate max-w-[200px]"},iv={class:"p-4 align-middle"},cv={class:"p-4 align-middle"},dv={class:"hidden p-4 align-middle md:table-cell"},uv={key:0},mv={__name:"MediaList",props:{files:{type:Array,required:!0},selectedFile:{type:Object,default:null},selectedFiles:{type:Array,default:()=>[]}},emits:["file-click","delete-folder"],setup(l,{emit:t}){const{t:a}=Fe(),r=e.ref(null),n=t,o=()=>{Ca({title:a("cms.builder.deleteTitle"),message:a("cms.builder.deleteObject"),type:"error",onConfirm:()=>{s()}})},s=()=>{n("cms.delete-folder",r.value)};return(i,c)=>{const u=e.resolveComponent("File");return e.openBlock(),e.createElementBlock("div",null,[l.files.length===0?(e.openBlock(),e.createElementBlock("div",WN,[e.createVNode(u,{class:"w-12 h-12 mb-2"}),e.createElementVNode("p",null,e.toDisplayString(i.$t("cms.media.noFilesInFolder")),1)])):(e.openBlock(),e.createElementBlock("table",KN,[e.createElementVNode("thead",YN,[e.createElementVNode("tr",XN,[e.createElementVNode("th",ZN,e.toDisplayString(i.$t("cms.media.name")),1),e.createElementVNode("th",QN,e.toDisplayString(i.$t("cms.media.type")),1),e.createElementVNode("th",JN,e.toDisplayString(i.$t("cms.media.size")),1),e.createElementVNode("th",ev,e.toDisplayString(i.$t("cms.media.updatedAt")),1),c[0]||(c[0]=e.createElementVNode("th",null,null,-1))])]),e.createElementVNode("tbody",tv,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.files,d=>{var m,f,p,y,h;return e.openBlock(),e.createElementBlock("tr",{key:d.id,class:e.normalizeClass(["border-b transition-colors hover:bg-blue-200/50 data-[state=selected]:bg-muted cursor-pointer",{"bg-blue-200":((m=r.value)==null?void 0:m.id)===d.id&&((f=r.value)==null?void 0:f.type)===d.type||l.selectedFiles&&l.selectedFiles.some(g=>g.id===d.id&&g.type===d.type)}]),onClick:g=>i.$emit("cms.file-click",d)},[e.createElementVNode("td",av,[e.createElementVNode("div",rv,[d.type==="dir"?(e.openBlock(),e.createBlock(jN,{key:0,class:"w-5 h-5 text-blue-500"})):(d==null?void 0:d.filetype)==="image"&&(d!=null&&d.filepath)?(e.openBlock(),e.createElementBlock("div",nv,[e.createElementVNode("img",{src:d==null?void 0:d.preview,alt:(d==null?void 0:d.alt)||(d==null?void 0:d.filename),class:"object-cover w-full h-full rounded"},null,8,ov)])):(d==null?void 0:d.filetype)==="image"?(e.openBlock(),e.createBlock(GN,{key:2,class:"w-5 h-5 text-green-500"})):(e.openBlock(),e.createBlock(u,{key:3,class:"w-5 h-5 text-gray-500"})),e.createElementVNode("span",sv,e.toDisplayString((d==null?void 0:d.filename)||(d==null?void 0:d.name)),1)])]),e.createElementVNode("td",iv,e.toDisplayString((d==null?void 0:d.type)==="dir"?i.$t("cms.media.folder"):((y=(p=d==null?void 0:d.filetype)==null?void 0:p.charAt(0))==null?void 0:y.toUpperCase())+((h=d==null?void 0:d.filetype)==null?void 0:h.slice(1))),1),e.createElementVNode("td",cv,e.toDisplayString((d==null?void 0:d.type)==="dir"?"--":e.unref(gi)(d==null?void 0:d.filesize)),1),e.createElementVNode("td",dv,e.toDisplayString(d!=null&&d.updated_at?e.unref(yN)(d==null?void 0:d.updated_at):"--"),1),d.type==="dir"?(e.openBlock(),e.createElementBlock("td",uv,[e.createVNode(e.unref(Gt),{class:"w-4 h-4 text-red-500 cursor-pointer",onClick:e.withModifiers(o,["stop"])},null,8,["onClick"])])):e.createCommentVNode("",!0)],10,lv)}),128))])]))])}}},pv={},fv={xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function hv(l,t){return e.openBlock(),e.createElementBlock("svg",fv,[...t[0]||(t[0]=[e.createElementVNode("path",{d:"m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"},null,-1),e.createElementVNode("polyline",{points:"9 22 9 12 15 12 15 22"},null,-1)])])}const gv=Qt(pv,[["render",hv]]),bv={class:"flex items-center space-x-1"},yv=["onClick"],kv={__name:"MediaBreadcrumb",props:{currentPath:{type:Array,required:!0}},emits:["navigate"],setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",bv,[e.createElementVNode("button",{class:"flex gap-x-1 items-center px-2 py-1 rounded text-sm font-medium transition-all duration-200 text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20",onClick:a[0]||(a[0]=r=>t.$emit("navigate",[]))},[e.createVNode(gv,{class:"w-3 h-3"}),e.createTextVNode(" "+e.toDisplayString(t.$t("cms.media.mediaLibrary")),1)]),l.currentPath.length>0?(e.openBlock(),e.createBlock(e.unref(bl),{key:0,class:"w-3 h-3 text-slate-400 dark:text-slate-500"})):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.currentPath,(r,n)=>(e.openBlock(),e.createElementBlock("button",{key:n,class:"flex gap-x-1 items-center px-2 py-1 rounded text-sm font-medium transition-all duration-200 text-blue-700 dark:text-blue-300 bg-blue-50 dark:bg-blue-900/20",onClick:o=>t.$emit("navigate",l.currentPath.slice(0,n+1))},[e.createVNode(e.unref(Cn),{class:"w-3 h-3"}),e.createTextVNode(" "+e.toDisplayString(r)+" ",1),n<l.currentPath.length-1?(e.openBlock(),e.createBlock(e.unref(bl),{key:0,class:"w-3 h-3 text-slate-400 dark:text-slate-500"})):e.createCommentVNode("",!0)],8,yv))),128))]))}},xv=["src"],wv={class:"absolute inset-0 bg-black bg-opacity-50 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity rounded-lg gap-2"},_v=["onClick"],Ev=["onClick"],Cv=["title"],Vv={key:1,class:"relative group"},Nv=["src"],vv={class:"absolute inset-0 bg-black bg-opacity-50 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity rounded-lg gap-2"},Bv=["title"],Sv={key:2,class:"absolute inset-0 bg-white bg-opacity-75 flex items-center justify-center rounded-lg z-10"},Dv={class:"flex flex-col items-center gap-2"},Av={class:"text-xs text-gray-600"},Mv=["multiple","disabled"],Tv={class:"whitespace-nowrap text-sm"},Lv={class:"whitespace-nowrap text-sm"},$v={class:"flex items-center justify-between p-4 border-b"},Fv={class:"text-lg font-semibold"},Iv={class:"flex items-center justify-between gap-4 p-4 border-b"},Ov={class:"relative z-[1] rounded-xl text-card-foreground shadow-lg border-0 bg-white dark:bg-slate-800 backdrop-blur-sm mb-6 p-4 mx-4"},Pv={class:"flex items-center justify-between gap-4"},Rv={class:"flex items-center gap-4 flex-1"},Uv={class:"relative flex-1 max-w-md"},jv=["placeholder"],zv={class:"flex items-center gap-2 relative"},Hv={class:"text-xs font-bold"},qv={class:"text-xs font-bold"},Gv={key:0,class:"w-full absolute top-full left-1/2 transform -translate-x-1/2 mt-2 z-50 bg-white dark:bg-slate-700 flex flex-col items-start border border-slate-200 dark:border-slate-600 rounded-md shadow-lg"},Wv={class:"flex items-center gap-2"},Kv={class:"flex flex-col gap-4 overflow-y-auto p-4 flex-1"},Yv={class:"p-4 border-t flex items-center justify-between"},Xv={key:0,class:"text-sm text-gray-600 dark:text-gray-400"},Zv={key:1},Qv=["disabled"],Ll={__name:"vs-form-media-select",props:e.mergeModels({multiple:{type:Boolean,default:!1},multi:{type:Boolean,default:!1}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["change"],["update:modelValue"]),setup(l,{emit:t}){const{t:a}=Fe(),r=rt.useRoute(),n=rt.useRouter(),o=e.useModel(l,"modelValue"),s=t,i=l,c=e.computed(()=>i.multiple||i.multi),u=e.ref(null),d=e.computed(()=>o.value||u.value),m=e.computed(()=>{if(!c.value)return[];const U=d.value;return U?Array.isArray(U)?U:[U]:[]}),f=e.computed(()=>d.value?typeof d.value=="object"?d.value.filename||d.value.file_name||d.value.native_file_name||"File":typeof d.value=="string"?d.value.split("cms./").pop()||d.value:"File":""),p=e.ref(!1),y=e.ref(!1),h=e.ref("grid"),g=e.ref([]),b=e.ref([]),w=e.ref([]),x=e.ref(),k=e.ref([]),_=e.ref(null),N=e.ref(!1),V=e.ref(null),P=e.ref(null),$=e.ref({}),M=e.ref(""),A=e.ref(!1),q=e.ref("name"),Q=new Map([["name",a("cms.media.sortBy.name")],["filesize",a("cms.media.sortBy.filesize")]]),R=U=>typeof U=="string"?U:(U==null?void 0:U.filepath)||(U==null?void 0:U.file_path)||U,I=U=>U?typeof U=="string"?U.split("cms./").pop()||U:U.filename||U.file_name||U.native_file_name||"File":"",F=U=>typeof U=="string"?U:(U==null?void 0:U.preview)||`/file/resize?filepath=${R(U)}&h=137&quality=75`,D=()=>{_.value&&_.value.click()},z=()=>{p.value=!p.value,p.value&&ee()},ee=()=>{if(V.value){const U=V.value.getBoundingClientRect();$.value={top:`${U.bottom+10}px`,left:`${U.left+U.width/2}px`,transform:"translateX(-50%)",width:"200px"}}},me=U=>{var Y;if(U.type==="dir")Ye([...g.value,U.name]);else if(c.value){const le=k.value.findIndex(ae=>ae.id===U.id);le>=0?k.value.splice(le,1):k.value.push(U)}else x.value=U.id===((Y=x.value)==null?void 0:Y.id)?null:U},Ne=U=>{q.value=U,A.value=!1,b.value=b.value.sort((Y,le)=>{var ae;if((Y==null?void 0:Y.type)==="dir")return-1;if(U==="name")return(ae=Y==null?void 0:Y.name)==null?void 0:ae.localeCompare(le==null?void 0:le.name);if(U==="filesize")return(le==null?void 0:le.filesize)-(Y==null?void 0:Y.filesize)})},Ke=async()=>{try{const U=g.value.join("/"),le=await(await fetch(`/api/cms-media?subdir=${U}${M.value?"&search="+M.value:""}`,{method:"GET"})).json();le.data?(b.value=le.data.map(ae=>({...ae,id:ae.type==="dir"?`dir-${ae.name}`:ae.id,preview:`/file/resize?filepath=${ae.filepath}&h=137&quality=75`})),Ne(q.value)):b.value=[]}catch(U){console.error("Search error:",U),b.value=[]}},qt=()=>{if(c.value){if(k.value.length>0){const U=Array.isArray(o.value)?[...o.value]:o.value?[o.value]:[],Y=Array.isArray(u.value)?[...u.value]:u.value?[u.value]:[];k.value.forEach(le=>{const ae=le.filepath||le.file_path;U.some(de=>(typeof de=="string"?de:(de==null?void 0:de.filepath)||(de==null?void 0:de.file_path))===ae)||(U.push(ae),Y.push(le))}),o&&(o.value=U),u.value=Y,s("cms.change",U),k.value=[]}}else if(x.value){const U=x.value.filepath||x.value.file_path;o&&(o.value=U),u.value=x.value,s("cms.change",U),x.value=null}Re()},Re=()=>{y.value=!1},Ye=U=>{g.value=U,w.value=[...w.value,U],x.value=null,c.value&&(k.value=[]),yt()},vt=()=>{w.value.length>1&&(w.value.pop(),g.value=w.value[w.value.length-1],x.value=null,c.value&&(k.value=[]),yt())},yt=async()=>{try{const U=g.value.join("/"),le=await(await fetch(`/api/cms-media?subdir=${U}${M.value?"&search="+M.value:""}`,{method:"GET"})).json();le.data?(b.value=le.data.map(ae=>({...ae,id:ae.type==="dir"?`dir-${ae.name}`:ae.id,preview:`/file/resize?filepath=${ae.filepath}&h=137&quality=75`})),Ne(q.value)):b.value=[]}catch(U){console.error("Fetch error:",U),b.value=[]}},Et=async(U,Y)=>{try{const le=typeof U=="string"?U:R(U);if(await fetch(`/file/delete${le}`),c.value){const ae=Array.isArray(o.value)?[...o.value]:[],de=Array.isArray(u.value)?[...u.value]:[];if(Y!==void 0&&Y>=0)ae.splice(Y,1),de.splice(Y,1);else{const Ae=ae.findIndex(C=>(typeof C=="string"?C:(C==null?void 0:C.filepath)||(C==null?void 0:C.file_path))===le);Ae>=0&&(ae.splice(Ae,1),de.splice(Ae,1))}o&&(o.value=ae.length>0?ae:null),u.value=de.length>0?de:null,s("cms.change",ae.length>0?ae:null)}else o&&(o.value=null),u.value=null,s("cms.change",null);return!0}catch(le){return console.error(le),!1}},Pt=async U=>{try{const Y=await fetch(`/file/download/files/uploads${U}`),le=await Y.arrayBuffer(),ae=Y.headers["content-type"],de=new TextDecoder("utf-8").decode(le),Ae=new Blob([de],{type:ae}),C=document.createElement("cms.a");C.setAttribute("download",U),C.href=window.URL.createObjectURL(Ae),C.click()}catch(Y){console.error(Y.message)}},at=async U=>{if(!U.target.files||U.target.files.length===0)return;const Y=Array.from(U.target.files);console.log("Uploading files:",Y),N.value=!0;try{const le=[];for(const ae of Y){const de=new FormData;de.append("file",ae);const Ae=await fetch("/file/upload/uploads?id=1&form=form&table=table",{method:"POST",body:de});if(!Ae.ok)throw new Error(`Upload failed: ${Ae.status}`);const C=await Ae.json();console.log("Upload result:",C);const v=C.result,H={file_id:v.file_id,file_name:v.file_name,file_path:v.file_path,filepath:v.file_path,format:v.format,size:v.size,entity_id:v.entity_id,dir:v.dir,native_file_name:v.native_file_name,preview:`/file/resize?filepath=${v.file_path}&h=137&quality=75`};le.push(H)}if(c.value){const ae=Array.isArray(o.value)?[...o.value]:o.value?[o.value]:[],de=Array.isArray(u.value)?[...u.value]:u.value?[u.value]:[];le.forEach(Ae=>{ae.push(Ae.file_path),de.push(Ae)}),o&&(o.value=ae),u.value=de,s("cms.change",ae)}else{const ae=le[0];o&&(o.value=ae.file_path),u.value=ae,s("cms.change",ae.file_path)}p.value=!1}catch(le){console.error("Upload error:",le),alert("cms.Помилка завантаження файлу: "+le.message)}finally{N.value=!1}U.target.value=""};e.watch(y,U=>{U&&yt()}),e.watch(g,U=>{U.length>0?n.push({query:{path:U.join("/")}}):n.push({query:{path:void 0}})});let st;return e.watch(M,U=>{clearTimeout(st),st=setTimeout(()=>{Ke()},500)}),e.watch(o,U=>{var Y,le,ae,de;if(U&&typeof U=="object"){const Ae=((Y=x.value)==null?void 0:Y.filepath)||((le=x.value)==null?void 0:le.file_path);U.filepath!==Ae&&U.file_path!==Ae&&(x.value=null)}else if(U&&typeof U=="string"){const Ae=((ae=x.value)==null?void 0:ae.filepath)||((de=x.value)==null?void 0:de.file_path);U!==Ae&&(x.value=null)}}),e.onMounted(()=>{var Y,le;g.value=((le=(Y=r.query)==null?void 0:Y.path)==null?void 0:le.split("cms./"))||[],w.value=[[]],o.value||(x.value=null);const U=ae=>{var de;p.value&&!((de=V.value)!=null&&de.contains(ae.target))&&(p.value=!1),A.value&&P.value&&!P.value.contains(ae.target)&&(A.value=!1)};document.addEventListener("click",U)}),(U,Y)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",e.mergeProps(U.$attrs,{class:"flex gap-4 flex-wrap"}),[c.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(m.value,(le,ae)=>(e.openBlock(),e.createElementBlock("div",{key:ae,class:"relative group"},[e.createElementVNode("img",{src:F(le),alt:"Selected File",class:"w-32 h-32 object-cover rounded-lg"},null,8,xv),e.createElementVNode("div",wv,[e.createElementVNode("button",{type:"button",onClick:de=>Et(le,ae),class:"p-2 rounded-full bg-red-500 text-white hover:bg-red-600 transition-colors"},[e.createVNode(e.unref(Gt),{class:"w-4 h-4"})],8,_v),e.createElementVNode("button",{type:"button",onClick:de=>Pt(R(le)),class:"p-2 rounded-full bg-blue-500 text-white hover:bg-blue-600 transition-colors"},[e.createVNode(e.unref(Qa),{class:"w-4 h-4"})],8,Ev)]),e.createElementVNode("div",{class:"absolute bottom-full left-0 mb-2 px-3 py-1.5 bg-gray-900 text-white text-xs rounded-lg opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none whitespace-nowrap z-10 max-w-[200px] truncate",title:I(le)},[e.createTextVNode(e.toDisplayString(I(le))+" ",1),Y[12]||(Y[12]=e.createElementVNode("div",{class:"absolute top-full left-4 border-4 border-transparent border-t-gray-900"},null,-1))],8,Cv)]))),128)):d.value?(e.openBlock(),e.createElementBlock("div",Vv,[e.createElementVNode("img",{src:d.value.preview||d.value,alt:"Selected File",class:"w-32 h-32 object-cover rounded-lg"},null,8,Nv),e.createElementVNode("div",vv,[e.createElementVNode("button",{type:"button",onClick:Y[0]||(Y[0]=le=>{var ae,de;return Et(((ae=d.value)==null?void 0:ae.filepath)||((de=d.value)==null?void 0:de.file_path)||d.value)}),class:"p-2 rounded-full bg-red-500 text-white hover:bg-red-600 transition-colors"},[e.createVNode(e.unref(Gt),{class:"w-4 h-4"})]),e.createElementVNode("button",{type:"button",onClick:Y[1]||(Y[1]=le=>{var ae,de;return Pt(((ae=d.value)==null?void 0:ae.filepath)||((de=d.value)==null?void 0:de.file_path)||d.value)}),class:"p-2 rounded-full bg-blue-500 text-white hover:bg-blue-600 transition-colors"},[e.createVNode(e.unref(Qa),{class:"w-4 h-4"})])]),e.createElementVNode("div",{class:"absolute bottom-full left-0 mb-2 px-3 py-1.5 bg-gray-900 text-white text-xs rounded-lg opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none whitespace-nowrap z-10 max-w-[200px] truncate",title:f.value},[e.createTextVNode(e.toDisplayString(f.value)+" ",1),Y[13]||(Y[13]=e.createElementVNode("div",{class:"absolute top-full left-4 border-4 border-transparent border-t-gray-900"},null,-1))],8,Bv)])):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"triggerButton",ref:V,class:e.normalizeClass(["relative w-32 h-32 flex items-center justify-center border border-dotted border-gray-300 rounded-lg hover:border-blue-500 hover:bg-blue-500/10 hover:cursor-pointer transition-all",{"border-blue-500 bg-blue-500/10":p.value,"opacity-50 cursor-not-allowed":N.value}]),onClick:z},[N.value?(e.openBlock(),e.createBlock(e.unref(er),{key:0,class:"w-4 h-4 animate-spin text-blue-500"})):(e.openBlock(),e.createBlock(e.unref(rl),{key:1,class:"w-4 h-4"})),N.value?(e.openBlock(),e.createElementBlock("div",Sv,[e.createElementVNode("div",Dv,[e.createVNode(e.unref(er),{class:"w-6 h-6 animate-spin text-blue-500"}),e.createElementVNode("span",Av,e.toDisplayString(U.$t("cms.media.uploading")),1)])])):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed bg-white z-50 border border-gray-200 rounded-lg shadow-lg flex flex-col items-center justify-center",style:e.normalizeStyle($.value)},[e.createElementVNode("div",{class:e.normalizeClass(["relative overflow-hidden flex justify-start items-center w-full gap-2 p-4 hover:bg-blue-50 text-blue-700 border hover:border-blue-200 dark:bg-slate-700 dark:text-slate-100 hover:cursor-pointer",{"opacity-50 cursor-not-allowed":N.value}]),onClick:Y[3]||(Y[3]=le=>!N.value&&D())},[e.createElementVNode("input",{type:"file",ref_key:"fileInput",ref:_,class:"absolute justify-center bottom-0 left-0 w-full opacity-0",onChange:at,onClick:Y[2]||(Y[2]=e.withModifiers(()=>{},["stop"])),multiple:c.value,disabled:N.value},null,40,Mv),N.value?(e.openBlock(),e.createBlock(e.unref(er),{key:0,class:"w-4 h-4 animate-spin"})):(e.openBlock(),e.createBlock(e.unref(Qa),{key:1})),e.createElementVNode("span",Tv,e.toDisplayString(N.value?U.$t("cms.media.uploading"):U.$t("cms.media.upload")),1)],2),e.createElementVNode("div",{onClick:Y[4]||(Y[4]=le=>y.value=!0),class:"flex justify-start items-center w-full gap-2 p-4 hover:bg-blue-50 text-blue-700 border hover:border-blue-200 dark:bg-slate-700 dark:text-slate-100 hover:cursor-pointer"},[e.createVNode(e.unref(ma)),e.createElementVNode("span",Lv,e.toDisplayString(U.$t("cms.media.selectFromMedia")),1)])],4)):e.createCommentVNode("",!0)]))],2)],16),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[y.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-50",onClick:Re},[e.createElementVNode("div",{class:"bg-white rounded-lg shadow-xl max-w-4xl w-full mx-4 max-h-[90vh] flex flex-col",onClick:Y[11]||(Y[11]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",$v,[e.createElementVNode("h3",Fv,e.toDisplayString(U.$t("cms.media.selectFiles")),1),e.createElementVNode("button",{onClick:Re,class:"text-gray-400 hover:text-gray-600"},[...Y[14]||(Y[14]=[e.createElementVNode("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])]),e.createElementVNode("div",Iv,[e.createVNode(kv,{"current-path":g.value,onNavigate:Ye,onNavigateBack:vt},null,8,["current-path"])]),e.createElementVNode("div",Ov,[e.createElementVNode("div",Pv,[e.createElementVNode("div",Rv,[e.createElementVNode("div",Uv,[e.createVNode(e.unref(tr),{class:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-slate-400 dark:text-slate-500"}),e.withDirectives(e.createElementVNode("input",{type:"text",placeholder:U.$t("cms.media.search"),class:"w-full pl-10 pr-4 py-2 text-sm border border-slate-200 dark:border-slate-600 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent bg-white dark:bg-slate-700 text-slate-700 dark:text-slate-200 placeholder-slate-400 dark:placeholder-slate-500","onUpdate:modelValue":Y[5]||(Y[5]=le=>M.value=le)},null,8,jv),[[e.vModelText,M.value]])]),e.createElementVNode("div",zv,[e.createElementVNode("span",Hv,e.toDisplayString(U.$t("cms.media.sortBy.title")+": "),1),e.createElementVNode("button",{ref_key:"sortByButton",ref:P,class:"relative z-[1000] inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors border shadow-sm h-8 rounded-md px-3 text-xs bg-white border-slate-300 text-slate-700 disabled:pointer-events-none disabled:opacity-50 hover:text-accent-foreground hover:bg-slate-50 dark:bg-slate-700 dark:border-slate-600 dark:text-slate-300 dark:hover:bg-slate-600",onClick:Y[8]||(Y[8]=le=>A.value=!A.value)},[e.createVNode(e.unref(En),{class:"w-4 h-4"}),e.createElementVNode("span",qv,e.toDisplayString(e.unref(Q).get(q.value)),1),A.value?(e.openBlock(),e.createElementBlock("div",Gv,[e.createElementVNode("span",{class:"text-left text-xs font-bold w-full p-2 hover:bg-slate-100 dark:hover:bg-slate-600 border-b border-slate-200 dark:border-slate-600 cursor-pointer",onClick:Y[6]||(Y[6]=e.withModifiers(le=>Ne("name"),["stop"]))},e.toDisplayString(U.$t("cms.media.sortBy.name")),1),e.createElementVNode("span",{class:"text-left text-xs font-bold w-full p-2 hover:bg-slate-100 dark:hover:bg-slate-600 cursor-pointer",onClick:Y[7]||(Y[7]=e.withModifiers(le=>Ne("filesize"),["stop"]))},e.toDisplayString(U.$t("cms.media.sortBy.filesize")),1)])):e.createCommentVNode("",!0)],512)])]),e.createElementVNode("div",Wv,[e.createElementVNode("button",{class:e.normalizeClass(["inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 h-8 px-3 text-xs rounded-md",{"shadow bg-blue-600 hover:bg-blue-700 text-white":h.value==="grid","border shadow-sm hover:text-accent-foreground bg-white dark:bg-slate-700 border-slate-300 dark:border-slate-600 text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-600":h.value==="list"}]),onClick:Y[9]||(Y[9]=le=>h.value="grid")},[e.createVNode(e.unref(zi),{class:"w-4 h-4"})],2),e.createElementVNode("button",{class:e.normalizeClass(["inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 h-8 px-3 text-xs rounded-md",{"shadow bg-blue-600 hover:bg-blue-700 text-white":h.value==="list","border shadow-sm hover:text-accent-foreground bg-white dark:bg-slate-700 border-slate-300 dark:border-slate-600 text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-600":h.value==="grid"}]),onClick:Y[10]||(Y[10]=le=>h.value="list")},[e.createVNode(e.unref(pa),{class:"w-4 h-4"})],2)])])]),e.createElementVNode("div",Kv,[h.value==="grid"?(e.openBlock(),e.createBlock(ON,{key:0,files:b.value,"selected-file":c.value?null:x.value,"selected-files":c.value?k.value:[],onFileClick:me},null,8,["files","selected-file","selected-files"])):(e.openBlock(),e.createBlock(mv,{key:1,files:b.value,"selected-file":c.value?null:x.value,"selected-files":c.value?k.value:[],onFileClick:me},null,8,["files","selected-file","selected-files"]))]),e.createElementVNode("div",Yv,[c.value&&k.value.length>0?(e.openBlock(),e.createElementBlock("div",Xv,e.toDisplayString(U.$t("cms.media.selectedFiles",{count:k.value.length})),1)):(e.openBlock(),e.createElementBlock("div",Zv)),e.createElementVNode("button",{onClick:qt,disabled:c.value?k.value.length===0:!x.value,class:"flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium disabled:pointer-events-none disabled:opacity-50 h-9 px-4 py-2 ml-auto bg-blue-600 hover:bg-blue-700 text-white shadow-md hover:shadow-lg transition-all duration-200 transform hover:scale-105"},[e.createVNode(e.unref(rl),{class:"w-4 h-4 mr-2"}),e.createTextVNode(" "+e.toDisplayString(U.$t("cms.common.actions.add")),1)],8,Qv)])])])):e.createCommentVNode("",!0)]))],64))}},Jv={};function eB(l,t){const a=e.resolveComponent("vs-richtext-md",!0);return e.openBlock(),e.createBlock(a,{class:"w-full h-[300px]"})}const bi=Qt(Jv,[["render",eB]]),tB={props:{min:{type:Number},step:{type:Number,default:()=>1},max:{type:Number,default:()=>1/0},modelValue:{type:Number,default:()=>null},label:{type:String,default:()=>""},placeholder:{type:String,default:()=>"0"},disabled:{type:Boolean,default:()=>!1}},data(){return{id:`input-number-${Math.floor(Math.random()*1e3)}`,inputValue:this.modelValue}},watch:{modelValue(l){this.inputValue=l},inputValue(l){this.$emit("cms.update:modelValue",l)}},methods:{validateInput(l){(l.key==="+"||l.key===","||l.key==="."||l.key==="-"&&this.inputValue&&this.inputValue.toString().length>0)&&l.preventDefault()},handleBlur(){let l=parseFloat(this.inputValue);this.$emit("cms.blur"),isNaN(l)?l=this.min:l>this.max?l=this.max:l<this.min&&(l=this.min),this.inputValue=l,this.$emit("cms.update:modelValue",this.inputValue)}}},lB={class:"p-0"},aB=["step","min","max","id","placeholder","disabled"];function rB(l,t,a,r,n,o){return e.openBlock(),e.createElementBlock("div",lB,[e.renderSlot(l.$slots,"label",e.normalizeProps(e.guardReactiveProps({id:n.id}))),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":t[0]||(t[0]=s=>n.inputValue=s),type:"number",onKeydown:t[1]||(t[1]=(...s)=>o.validateInput&&o.validateInput(...s)),onBlur:t[2]||(t[2]=(...s)=>o.handleBlur&&o.handleBlur(...s)),step:a.step,min:a.min,max:a.max,id:n.id,"aria-describedby":"helper-text-explanation",class:e.normalizeClass(["vs-number__input py-2 px-3 block w-full h-[38px] border border-solid border-stone-200 rounded-lg text-sm text-stone-800 placeholder:text-stone-500 focus:z-10 focus:border-1 focus:outline-none focus:border-blue-600 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-200 dark:placeholder:text-neutral-500 dark:focus:outline-none dark:focus:ring-1 dark:focus:ring-neutral-600",{"cursor-not-allowed":a.disabled}]),placeholder:a.placeholder,disabled:a.disabled},null,42,aB),[[e.vModelText,n.inputValue]])])}const yi=Qt(tB,[["render",rB]]),ki={__name:"vs-form-reletion-link",props:e.mergeModels({relation:{type:String,required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=e.useModel(l,"modelValue"),a=l,r=e.ref([]),n=async()=>{const s=await(await fetch(`/api/cms-suggest/${a.relation}`)).json();r.value=s==null?void 0:s.data};return e.onMounted(n),(o,s)=>{var i;return(i=r.value)!=null&&i.length?(e.openBlock(),e.createBlock(e.unref(Lr),{key:0,mode:"combo",modelValue:t.value,"onUpdate:modelValue":s[0]||(s[0]=c=>t.value=c),options:r.value},null,8,["modelValue","options"])):e.createCommentVNode("",!0)}}},nB={monaco:G_,edit:bC,preview:{__name:"vs-builder-preview",props:{data:{},dataModifiers:{},form:{},formModifiers:{}},emits:["update:data","update:form"],setup(l){$e["vs-input-custom-datatable"]=ii,$e["vs-input-reference"]=fn,$e["vs-input-texteditor"]=pn,$e["vs-input-mediaselect"]=Ll,$e["vs-input-file"]=Ll,$e["vs-input-image"]=Ll,$e["vs-input-richtext-md"]=bi,$e["vs-input-integer"]=yi,$e["vs-input-relation-link"]=ki;const t=e.ref({}),a=e.useModel(l,"data"),r=e.useModel(l,"form"),n=e.computed(()=>{var o,s;return((s=(o=a.value)==null?void 0:o.columns)==null?void 0:s.map(mn))||[]});return(o,s)=>{var i;return e.openBlock(),e.createElementBlock("div",{ref_key:"form",ref:r},[((i=n.value)==null?void 0:i.length)>0?(e.openBlock(),e.createBlock(e.unref(Xe),{key:0,modelValue:t.value,"onUpdate:modelValue":s[0]||(s[0]=c=>t.value=c),schema:n.value},null,8,["modelValue","schema"])):e.createCommentVNode("",!0)],512)}}}},oB={class:"max-w-6xl mx-auto"},sB={class:"flex items-center justify-between mb-6"},iB={class:"mb-2 text-2xl font-semibold text-gray-900"},cB={class:"lowercase"},dB={class:"text-gray-600"},uB={class:"flex items-center gap-2"},mB={class:"w-full"},pB={class:"flex items-center w-full h-10 max-w-md grid-cols-3 p-1 mb-6 bg-white border border-gray-200 rounded-md text-muted-foreground"},fB=["onClick"],hB={key:0,class:"container mx-auto bg-white rounded-md py-4 px-2 bg-opacity-50"},gB={__name:"EditCollectionPage",setup(l){const{t}=Fe(),a=e.inject("cms.fetchContentTypes"),r=e.ref("edit"),n=e.ref({yaml:"",data:{columns:[],type:"collection"}}),o=e.ref({}),s=e.ref(""),i=rt.useRoute(),c=rt.useRouter(),u=e.ref(!1),d=e.computed(()=>[{name:t("cms.builder.edit"),id:"edit"},{name:t("cms.builder.preview"),id:"preview"}]),m=async()=>{var p;try{const h=await(await fetch(`/api/cms-type/${i.params.id}`)).json(),g={...h,columns:Array.isArray(h.columns)?h.columns:(p=Object.entries((h==null?void 0:h.columns)||{}))==null?void 0:p.map(([b,w])=>({...w,name:b}))};n.value={...n.value,data:g},s.value=g.title||g.name}catch(y){console.error(y)}finally{u.value=!0}},f=async()=>{var p,y;try{if(await o.value.validate()){xe({type:"warning",title:t("cms.common.actions.warning"),message:t("cms.builder.editFieldFailed")});return}const g=await fetch(`/api/cms-type/${i.params.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r.value==="monaco"?(p=n.value)==null?void 0:p.yaml:(y=n.value)==null?void 0:y.data)});c.push("/settings/collections"),a(),xe({type:"success",title:t("cms.common.actions.success"),message:t("cms.collections.collectionCreated")})}catch(h){console.error(h),xe({type:"error",title:t("cms.common.actions.error"),message:t("cms.collections.collectionCreationFailed")})}};return e.onMounted(()=>{m()}),(p,y)=>{const h=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("div",oB,[e.createElementVNode("div",sB,[e.createElementVNode("div",null,[e.createElementVNode("h1",iB,[e.createTextVNode(e.toDisplayString(p.$t("cms.builder.editCollection"))+" ",1),e.createElementVNode("span",cB,e.toDisplayString(s.value),1)]),e.createElementVNode("p",dB,e.toDisplayString(p.$t("cms.builder.editContentForYourSite")),1)]),e.createElementVNode("div",uB,[e.createVNode(h,{to:"/settings/collections",class:"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border bg-background hover:text-accent-foreground h-10 px-4 py-2 border-gray-300 text-gray-700 hover:bg-gray-50"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.$t("cms.common.actions.back")),1)]),_:1}),e.createElementVNode("button",{onClick:f,class:"inline-flex items-center justify-center gap-2 whitespace-nowrap text-white rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 text-primary-foreground h-10 px-4 py-2 bg-blue-600 hover:bg-blue-700"},e.toDisplayString(p.$t("cms.common.actions.save")),1)])]),e.createElementVNode("div",mB,[e.createElementVNode("div",pB,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,g=>(e.openBlock(),e.createElementBlock("button",{key:g.id,onClick:b=>r.value=g.id,class:e.normalizeClass(["inline-flex flex-1 items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm data-[state=active]:bg-blue-50 data-[state=active]:text-blue-700 data-[state=active]:border-blue-200",g.id===r.value?"bg-blue-50 text-blue-700 border-blue-200":""])},e.toDisplayString(g.name),11,fB))),128))])]),u.value?(e.openBlock(),e.createElementBlock("div",hB,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(nB)[r.value]),{yaml:n.value.yaml,"onUpdate:yaml":y[0]||(y[0]=g=>n.value.yaml=g),data:n.value.data,"onUpdate:data":y[1]||(y[1]=g=>n.value.data=g),form:o.value,"onUpdate:form":y[2]||(y[2]=g=>o.value=g)},null,40,["yaml","data","form"]))])):e.createCommentVNode("",!0)])}}},bB=[{key:"title",label:"common.title",localization:!0,type:"text"},{key:"description",label:"common.description",localization:!0,type:"text"},{key:"keywords",label:"common.keywords",localization:!0,type:"text"},{key:"meta",label:"common.meta",type:"key-value",ignore:["title","description","keywords"]}],yB={__name:"VsFormTags",props:{modelValue:{default:()=>[]},modelModifiers:{}},emits:["update:modelValue"],setup(l,{expose:t}){const{t:a}=Fe(),r=e.useModel(l,"modelValue"),n=e.ref({}),o=e.ref(!1);e.provide("metaParentValue",r);const s=m=>Array.isArray(m)?m.map(f=>typeof f=="object"&&f!==null&&f.id?f.id:f):[],i=async m=>{if(!Array.isArray(m)||m.length===0)return[];try{const p=await(await fetch("/api/tags")).json(),y=(p==null?void 0:p.rows)||[];return m.map(h=>{const g=y.find(b=>b.tag_id===h);return g?{id:g.tag_id,text:g.value,color:g.color}:{id:h,text:"",color:"#ababab"}})}catch(f){return console.error("Error fetching tags:",f),m.map(p=>({id:p,text:"",color:"#ababab"}))}};e.onMounted(async()=>{await e.nextTick(),await e.nextTick(),setTimeout(()=>{var m;if(Array.isArray((m=r.value)==null?void 0:m.tag_list)){const f=s(r.value.tag_list);JSON.stringify(f)!==JSON.stringify(r.value.tag_list)&&(r.value.tag_list=f)}},100)}),e.watch(()=>r.value.tag_list,m=>{if(Array.isArray(m)&&!o.value){const f=s(m);JSON.stringify(f)!==JSON.stringify(m)&&(r.value.tag_list=f)}},{deep:!0}),e.watch(()=>r.value,m=>{if(m&&Array.isArray(m.tag_list)&&!o.value){const f=s(m.tag_list);JSON.stringify(f)!==JSON.stringify(m.tag_list)&&(m.tag_list=f)}},{deep:!0,immediate:!0}),e.watch(()=>{var m;return(m=r.value)==null?void 0:m.tag_list},m=>{Array.isArray(m)&&n.value&&e.nextTick(()=>{n.value&&n.value.setValue&&n.value.setValue("tag_list",m)})},{deep:!0});const c=async m=>{if(m.tag_list&&(m.tag_list=s(m.tag_list),r.value.tag_list=m.tag_list),await n.value.validate()){xe({type:"warning",title:a("cms.common.actions.warning"),message:a("cms.builder.editFieldFailed")});return}};t({restoreTagsBeforeSubmit:async()=>{var m;if(o.value=!0,Array.isArray((m=r.value)==null?void 0:m.tag_list)){console.log("Before restore:",r.value.tag_list);const f=await i(r.value.tag_list);console.log("After restore:",f),r.value.tag_list=f}setTimeout(()=>{o.value=!1},2e3)}});const d=e.computed(()=>{var m;return[{key:"tag_list",type:"select",multiple:!0,searchable:!1,placeholder:a("cms.builder.tags"),data:"tag_id",value:((m=r.value)==null?void 0:m.tag_list)||[]}]});return(m,f)=>r.value?(e.openBlock(),e.createBlock(e.unref(Xe),{key:0,schema:d.value,modelValue:r.value,"onUpdate:modelValue":[f[0]||(f[0]=p=>r.value=p),c]},null,8,["schema","modelValue"])):e.createCommentVNode("",!0)}},kB={class:"flex justify-end mb-4"},xB=["href"],wB=["src"],_B=["src"],EB={key:2,class:"w-full h-[80vh] flex items-center justify-center text-gray-500"},CB={__name:"VsPreview",props:{preview_path:{type:String,default:""},slug:{type:String,default:""}},setup(l){const t=e.ref(""),a=e.ref(""),r=async()=>{var o,s;try{const c=await(await fetch("/api/settings")).json();t.value=((s=(o=c==null?void 0:c.settings)==null?void 0:o.site_info)==null?void 0:s.previewUrl)||"http://ip.local.softpro.ua"}catch(i){console.error("Failed to fetch settings:",i),t.value="http://ip.local.softpro.ua"}},n=async()=>{var o;try{const i=await(await fetch("/user")).json();a.value=(o=i==null?void 0:i.user)==null?void 0:o.draftKey}catch(s){console.error("Failed to fetch user:",s)}};return e.onMounted(()=>{r(),n()}),(o,s)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",kB,[e.createElementVNode("a",{href:`${t.value}/uk/${l.preview_path}${l.slug}${a.value?`?draftKey=${a.value}`:""}`,target:"_blank",class:"inline-flex items-center gap-2 px-3 py-1.5 text-black-600 bg-white border border-blue-200 rounded hover:border-blue-300 hover:bg-blue-50 transition-colors duration-200 font-normal cursor-pointer"},[s[0]||(s[0]=e.createTextVNode(" Переглянути на сайті ",-1)),e.createVNode(e.unref(Ui),{class:"w-4 h-4"})],8,xB)]),t.value&&l.preview_path?(e.openBlock(),e.createElementBlock("iframe",{key:0,src:`${t.value}/uk/${l.preview_path}${l.slug}?hideHeader=true&hideFooter=true`,class:"w-full h-[80vh]"},null,8,wB)):t.value?(e.openBlock(),e.createElementBlock("iframe",{key:1,src:`${t.value}/uk/${l.slug}?hideHeader=true&hideFooter=true`,class:"w-full h-[80vh]"},null,8,_B)):(e.openBlock(),e.createElementBlock("div",EB," Loading preview... "))]))}},VB={class:"space-y-6 max-w-6xl mx-auto relative bg-white"},NB={class:"p-4 sticky top-[-24px] z-10 bg-white dark:bg-slate-800"},vB={class:"flex items-center justify-between"},BB={class:"flex items-center gap-4"},SB={class:"text-2xl font-semibold text-gray-900 dark:text-white"},DB=["href","title"],AB={class:"flex items-center space-x-3"},MB={class:"w-full mt-6 flex items-center justify-between"},TB={class:"flex items-center w-full h-10 max-w-md grid-cols-3 p-1 bg-white border border-gray-200 rounded-md text-muted-foreground"},LB=["onClick"],$B={class:"flex items-center gap-2"},FB={for:"is_pin",class:"text-sm font-medium text-gray-700 dark:text-gray-300 cursor-pointer"},IB={class:"relative"},OB={key:0,class:"w-3 h-3 text-white",fill:"currentColor",viewBox:"0 0 20 20"},PB={class:"container mx-auto bg-white rounded-md pb-4 px-5"},RB={class:"container mx-auto bg-white rounded-md pb-4 px-2"},UB={key:0,class:"container mx-auto bg-white rounded-md pb-4 px-2"},jB={class:"container mx-auto bg-white rounded-md pb-4 px-2"},xi=e.defineComponent({__name:"contentForm",setup(l){$e["vs-input-custom-datatable"]=ii,$e["vs-input-reference"]=fn,$e["vs-input-texteditor"]=pn,$e["vs-input-mediaselect"]=Ll,$e["vs-input-file"]=Ll,$e["vs-input-image"]=Ll,$e["vs-input-richtext-md"]=bi,$e["vs-input-integer"]=yi,$e["vs-input-relation-link"]=ki;const{t,locale:a}=Fe(),r=rt.useRouter(),n=rt.useRoute(),o=e.inject("menu",e.ref([])),s=e.ref([]),i=e.ref({}),c=e.ref({}),u=e.ref({}),d=e.ref(""),m=$=>{const M=[];return $.forEach(A=>{if(M.push(A),A.localization){const q={...A,name:A.name+":en",label:A.label+" (en)"};M.push(q)}}),M},f=e.computed(()=>{var $;return($=s.value)==null?void 0:$.map(mn)}),p=e.computed(()=>(a.value,bB.flatMap($=>{const M={...$,label:t($.label)};if($.localization){const A={...$,key:`${$.key}:en`,label:t($.label)+" (en)"};return[M,A]}return[M]}))),y=e.ref({}),h=e.ref({title:"",status:"draft"}),g=e.computed(()=>{const $=[{id:"content",name:t("cms.builder.content")},{id:"seo",name:t("cms.builder.seo")},{id:"tags",name:t("cms.builder.tags")}];return d.value&&$.push({id:"preview",name:t("cms.builder.preview")}),$}),b=e.ref("content"),w=e.computed(()=>{var M,A,q,Q;const $=((M=n.params)==null?void 0:M.collection)||((A=n.params)==null?void 0:A.id);return((Q=(q=o.value)==null?void 0:q.find(R=>R.id===$))==null?void 0:Q.title)||$}),x=e.computed(()=>{var $,M;return(($=h.value)==null?void 0:$.title)||((M=n.params)!=null&&M.id?t("cms.builder.editCollection"):t("cms.articles.createArticle"))}),k=e.computed(()=>{var q,Q,R;const $=((q=n.params)==null?void 0:q.collection)||((Q=n.params)==null?void 0:Q.id),M=(R=n.params)==null?void 0:R.id,A=[{label:w.value,route:`collections/${$}`}];return M?A.push({label:x.value,route:`collections/${$}/${M}`}):A.push({label:t("cms.articles.createArticle"),route:`collections/${$}/create`}),A}),_=$=>{$==="collections"?r.push("/collections"):r.push(`/${$}`)};e.onMounted(async()=>{var Q,R,I;const $=(Q=n.params)==null?void 0:Q.collection,M=(R=n.params)==null?void 0:R.id,A=$||M,q=$&&M?M:void 0;if(!q){if(!A)return;const D=await(await fetch(`/api/cms/${A}/`)).json();s.value=m(D.columns)}try{if(!q||!A)return;const F=await fetch(`/api/cms/${A}/${q}`);if(!F.ok)throw new Error("Failed to fetch article");const D=await F.json();if(s.value=m(D==null?void 0:D.columns),D!=null&&D.preview_path&&(d.value=D==null?void 0:D.preview_path),D.rows){let z=D.rows;Array.isArray(z)||(z=[z]),h.value=z[0],await e.nextTick(),(I=z[0])!=null&&I.meta?y.value={...z[0].meta}:y.value={title:"",description:"",keywords:"",meta:{}},console.log("Initialized seoData from rows[0]:",y.value)}else h.value=D,await e.nextTick(),D!=null&&D.meta?(y.value={title:D.meta.title||"",description:D.meta.description||"",keywords:D.meta.keywords||"",meta:{...D.meta}},delete y.value.meta.title,delete y.value.meta.description,delete y.value.meta.keywords):y.value={title:"",description:"",keywords:"",meta:{}},console.log("Initialized seoData from data:",y.value)}catch(F){console.error("Error fetching article:",F)}});const N=e.computed({get:()=>{var $;return(($=h.value)==null?void 0:$.is_pin)||!1},set:$=>{h.value&&(h.value.is_pin=$)}}),V=()=>{h.value&&(h.value.is_pin=!h.value.is_pin)};e.watch(y,$=>{console.log("seoData changed:",$)},{deep:!0});const P=async $=>{var I,F,D,z;const M=(I=n.params)==null?void 0:I.collection,A=(F=n.params)==null?void 0:F.id,q=await i.value.validate();if(q){xe({title:t("cms.validation"),message:JSON.stringify(q),type:"warning"});return}(D=u.value)!=null&&D.restoreTagsBeforeSubmit&&await u.value.restoreTagsBeforeSubmit();const Q=y.value||{},R={...h.value,meta:{...Q,...Q.meta||{}}};console.log("Payload before submit:",R);try{const ee=await fetch(`/api/cms/${M}/${A||""}`,{method:A?"PUT":"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(R)});if(!ee.ok){let me;try{const Ne=await ee.json();me=JSON.stringify(Ne,null,2)}catch{me=await ee.text()}throw new Error(`HTTP ${ee.status}: ${me}`)}if(!A)try{const me=await ee.json(),Ne=me.id||((z=me.data)==null?void 0:z.id);Ne&&n.name==="createArticle"&&await r.push(`/collections/${M}/${Ne}`)}catch(me){console.warn("Could not parse response to get ID:",me)}xe({title:t("cms.common.success"),message:t("cms.common.successMessage"),type:"success"})}catch(ee){console.error("Submit error:",ee),xe({title:t("cms.common.error"),message:"Помилка збереження",type:"error"})}};return($,M)=>{var A,q,Q,R,I,F,D;return e.openBlock(),e.createElementBlock("div",VB,[e.createElementVNode("div",NB,[e.createVNode(Cs,{items:k.value,onNavigate:_},null,8,["items"]),e.createElementVNode("div",vB,[e.createElementVNode("div",BB,[e.createElementVNode("button",{onClick:M[0]||(M[0]=z=>e.unref(r).back()),class:"p-2 text-gray-500 rounded-full hover:text-gray-900 dark:text-gray-400 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-700"},[e.createVNode(e.unref(Oi),{class:"w-5 h-5"})]),e.createElementVNode("h1",SB,[e.createTextVNode(e.toDisplayString($.$t("cms.builder.editCollection"))+" ",1),e.createElementVNode("span",null,'"'+e.toDisplayString(((A=h.value)==null?void 0:A.type)==="single"?h.value.title:(Q=(q=e.unref(o).value)==null?void 0:q.find(z=>z.id===(e.unref(n).params.collection||e.unref(n).params.id)))==null?void 0:Q.title)+'"',1)]),e.createElementVNode("a",{href:`https://cms.opengis.info/${e.unref(a)}/guides/content/`,target:"_blank",title:$.$t("cms.guide.content")},[e.createVNode(e.unref(kl),{class:"w-5 h-5"})],8,DB)]),e.createElementVNode("div",AB,[e.createElementVNode("button",{onClick:P,type:"submit",class:"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium h-9 px-4 py-2 bg-blue-600 text-white shadow-md transition-all duration-200 transform hover:bg-blue-700 hover:shadow-lg hover:scale-105 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"},[e.createVNode(e.unref(qi),{class:"w-4 h-4 mr-2"}),e.createTextVNode(" "+e.toDisplayString($.$t("cms.builder.save")),1)])])]),e.createElementVNode("div",MB,[e.createElementVNode("div",TB,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,z=>(e.openBlock(),e.createElementBlock("button",{key:z.id,onClick:ee=>b.value=z.id,class:e.normalizeClass(["inline-flex flex-1 items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm data-[state=active]:bg-blue-50 data-[state=active]:text-blue-700 data-[state=active]:border-blue-200",z.id===b.value?"bg-blue-50 text-blue-700 border-blue-200":""])},e.toDisplayString(z.name),11,LB))),128))]),e.createElementVNode("div",$B,[e.createElementVNode("label",FB,e.toDisplayString($.$t("cms.collections.pinPublication")),1),e.createElementVNode("div",IB,[e.withDirectives(e.createElementVNode("input",{type:"checkbox",id:"is_pin","onUpdate:modelValue":M[1]||(M[1]=z=>N.value=z),class:"sr-only"},null,512),[[e.vModelCheckbox,N.value]]),e.createElementVNode("div",{class:e.normalizeClass(["w-5 h-5 border-2 rounded transition-all duration-200 cursor-pointer flex items-center justify-center",(R=h.value)!=null&&R.is_pin?"bg-sky-600 border-sky-600":"bg-white border-gray-300 hover:border-sky-400 dark:bg-gray-700 dark:border-gray-600 dark:hover:border-sky-400"]),onClick:V},[(I=h.value)!=null&&I.is_pin?(e.openBlock(),e.createElementBlock("svg",OB,[...M[7]||(M[7]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z","clip-rule":"evenodd"},null,-1)])])):e.createCommentVNode("",!0)],2)])])])]),e.withDirectives(e.createElementVNode("div",PB,[(F=s.value)!=null&&F.length?(e.openBlock(),e.createBlock(e.unref(Xe),{key:0,modelValue:h.value,"onUpdate:modelValue":M[2]||(M[2]=z=>h.value=z),schema:f.value,form:i.value,"onUpdate:form":M[3]||(M[3]=z=>i.value=z)},null,8,["modelValue","schema","form"])):e.createCommentVNode("",!0)],512),[[e.vShow,b.value==="content"]]),e.withDirectives(e.createElementVNode("div",RB,[e.createVNode(e.unref(Xe),{schema:p.value,values:y.value,"onUpdate:values":M[4]||(M[4]=z=>y.value=z),form:c.value,"onUpdate:form":M[5]||(M[5]=z=>c.value=z)},null,8,["schema","values","form"])],512),[[e.vShow,b.value==="seo"]]),b.value==="tags"?(e.openBlock(),e.createElementBlock("div",UB,[e.createVNode(yB,{ref_key:"tagsForm",ref:u,modelValue:h.value,"onUpdate:modelValue":M[6]||(M[6]=z=>h.value=z)},null,8,["modelValue"])])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("div",jB,[e.createVNode(CB,{slug:(D=h.value)==null?void 0:D.slug,preview_path:d.value},null,8,["slug","preview_path"])],512),[[e.vShow,b.value==="preview"]])])}}}),zB=(l,t)=>{const a=l==null?void 0:l.trim();return a?t?t==="create"?{type:"createArticle",collection:a}:{type:"editArticle",collection:a,id:t}:{type:"articles",collection:a}:{type:"collections"}},HB={key:1,class:"p-4 text-sm text-slate-600 dark:text-slate-300"},qB=e.defineComponent({__name:"CmsContentWrapper",setup(l){const t=rt.useRoute(),a=e.getCurrentInstance();if(!a)throw new Error("CmsContentWrapper must be used within a component instance");const r=e.computed(()=>{const y=a.appContext.config.globalProperties.$route;if(!y)throw new Error("Vue Router is not registered on the app instance");return y}),n=e.computed(()=>t??r.value),o=e.computed(()=>{var y;return((y=n.value)==null?void 0:y.params)??{}}),s=e.computed(()=>{var y,h;return((y=o.value)==null?void 0:y.collection)??((h=o.value)==null?void 0:h.type)}),i=e.computed(()=>{var y;return(y=o.value)==null?void 0:y.id}),c=e.computed(()=>zB(s.value,i.value)),u={collections:Mr,articles:Vs,createArticle:xi,editArticle:xi},d=e.computed(()=>u[c.value.type]??Mr),m=e.computed(()=>`${c.value.type}-${c.value.collection??""}-${c.value.id??""}`),f=e.computed(()=>{const{type:y,collection:h,id:g}=c.value,b={...o.value};return s.value?b.collection=s.value:delete b.collection,y==="articles"?b.id=h:y==="createArticle"?delete b.id:y==="editArticle"&&g?b.id=g:delete b.id,b}),p=new Proxy({},{get(y,h,g){const b=n.value;if(!b)return;if(h==="params")return f.value;const w=Reflect.get(b,h,g);return typeof w=="function"?w.bind(b):w},has(y,h){if(h==="params")return!0;const g=n.value;return g?Reflect.has(g,h):!1},ownKeys(){const y=n.value;return y?Reflect.ownKeys(y):["params"]},getOwnPropertyDescriptor(y,h){if(h==="params")return{configurable:!0,enumerable:!0,value:f.value};const g=n.value;if(!g)return;const b=Reflect.getOwnPropertyDescriptor(g,h);if(b)return{...b,configurable:!0}}});return e.provide(rt.routeLocationKey,p),(y,h)=>d.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d.value),{key:m.value})):(e.openBlock(),e.createElementBlock("div",HB,e.toDisplayString(y.$t("cms.navigation.collections")),1))}}),GB=(l,t)=>{const a=l[t];return a?typeof a=="function"?a():Promise.resolve(a):new Promise((r,n)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(n.bind(null,new Error("Unknown variable dynamic import: "+t)))})},WB=localStorage.locale||navigator.language.split("cms.-")[0]||"uk",$l=hu({legacy:!1,locale:WB,fallbackLocale:"en",datetimeFormats:{en:{short:{year:"numeric",month:"short",day:"numeric"},long:{dateStyle:"full",timeStyle:"short"},time:{hour:"2-digit",minute:"2-digit"}},uk:{short:{year:"numeric",month:"short",day:"numeric"},long:{dateStyle:"full",timeStyle:"short"},time:{hour:"2-digit",minute:"2-digit"}}},numberFormats:{en:{currency:{style:"currency",currency:"USD"},percent:{style:"percent",minimumFractionDigits:0},compact:{notation:"compact"}},uk:{currency:{style:"currency",currency:"UAH"},percent:{style:"percent",minimumFractionDigits:0},compact:{notation:"compact"}}},messages:{}}),hn="en";async function wi(l){return(await GB(Object.assign({"./locales/en.json":()=>Promise.resolve().then(()=>a4),"./locales/uk.json":()=>Promise.resolve().then(()=>r4)}),`./locales/${l}.json`)).default}async function gn(l){try{const t=await wi(l);return $l.global.setLocaleMessage(l,t),t}catch(t){if(console.error(`Failed to load locale ${l}:`,t),l!==hn)try{const a=await wi(hn);return $l.global.setLocaleMessage(l,a),a}catch(a){throw console.error(`Failed to load fallback locale ${hn}:`,a),a}throw t}}async function KB(l){await gn(l),$l.global.locale.value=l,localStorage.setItem("locale",l),document.documentElement.lang=l,window.dispatchEvent(new CustomEvent("cms.storage",{detail:{key:"locale",oldValue:null,newValue:l}}))}async function YB(){const l=$l.global.locale.value;await gn(l),$l.global.locale.value=l,localStorage.setItem("locale",l),document.documentElement.lang=l}async function XB(l){return await gn(l)}function ZB(l){l.component("Dashboard",Ar)}function ll(l){return typeof l=="string"||l instanceof String}function _i(l){var t;return typeof l=="object"&&l!=null&&(l==null||(t=l.constructor)==null?void 0:t.name)==="Object"}function Ei(l,t){return Array.isArray(t)?Ei(l,(a,r)=>t.includes(r)):Object.entries(l).reduce((a,r)=>{let[n,o]=r;return t(o,n)&&(a[n]=o),a},{})}const ne={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function Ci(l){switch(l){case ne.LEFT:return ne.FORCE_LEFT;case ne.RIGHT:return ne.FORCE_RIGHT;default:return l}}function bn(l){return l.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function Ka(l,t){if(t===l)return!0;const a=Array.isArray(t),r=Array.isArray(l);let n;if(a&&r){if(t.length!=l.length)return!1;for(n=0;n<t.length;n++)if(!Ka(t[n],l[n]))return!1;return!0}if(a!=r)return!1;if(t&&l&&typeof t=="object"&&typeof l=="object"){const o=t instanceof Date,s=l instanceof Date;if(o&&s)return t.getTime()==l.getTime();if(o!=s)return!1;const i=t instanceof RegExp,c=l instanceof RegExp;if(i&&c)return t.toString()==l.toString();if(i!=c)return!1;const u=Object.keys(t);for(n=0;n<u.length;n++)if(!Object.prototype.hasOwnProperty.call(l,u[n]))return!1;for(n=0;n<u.length;n++)if(!Ka(l[u[n]],t[u[n]]))return!1;return!0}else if(t&&l&&typeof t=="function"&&typeof l=="function")return t.toString()===l.toString();return!1}class QB{constructor(t){for(Object.assign(this,t);this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start;if(this.insertedCount)for(;this.value.slice(this.cursorPos)!==this.oldValue.slice(this.oldSelection.end);)this.value.length-this.cursorPos<this.oldValue.length-this.oldSelection.end?++this.oldSelection.end:++this.cursorPos}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){return!this.removedCount||this.insertedCount?ne.NONE:(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?ne.RIGHT:ne.LEFT}}function ue(l,t){return new ue.InputMask(l,t)}function Vi(l){if(l==null)throw new Error("mask property should be defined");return l instanceof RegExp?ue.MaskedRegExp:ll(l)?ue.MaskedPattern:l===Date?ue.MaskedDate:l===Number?ue.MaskedNumber:Array.isArray(l)||l===Array?ue.MaskedDynamic:ue.Masked&&l.prototype instanceof ue.Masked?l:ue.Masked&&l instanceof ue.Masked?l.constructor:l instanceof Function?ue.MaskedFunction:(console.warn("Mask not found for mask",l),ue.Masked)}function Fl(l){if(!l)throw new Error("Options in not defined");if(ue.Masked){if(l.prototype instanceof ue.Masked)return{mask:l};const{mask:t=void 0,...a}=l instanceof ue.Masked?{mask:l}:_i(l)&&l.mask instanceof ue.Masked?l:{};if(t){const r=t.mask;return{...Ei(t,(n,o)=>!o.startsWith("_")),mask:t.constructor,_mask:r,...a}}}return _i(l)?{...l}:{mask:l}}function Ft(l){if(ue.Masked&&l instanceof ue.Masked)return l;const t=Fl(l),a=Vi(t.mask);if(!a)throw new Error("Masked class is not found for provided mask "+t.mask+", appropriate module needs to be imported manually before creating mask.");return t.mask===a&&delete t.mask,t._mask&&(t.mask=t._mask,delete t._mask),new a(t)}ue.createMask=Ft;class Ya{get selectionStart(){let t;try{t=this._unsafeSelectionStart}catch{}return t??this.value.length}get selectionEnd(){let t;try{t=this._unsafeSelectionEnd}catch{}return t??this.value.length}select(t,a){if(!(t==null||a==null||t===this.selectionStart&&a===this.selectionEnd))try{this._unsafeSelect(t,a)}catch{}}get isActive(){return!1}}ue.MaskElement=Ya;const Ni=90,JB=89;class ra extends Ya{constructor(t){super(),this.input=t,this._onKeydown=this._onKeydown.bind(this),this._onInput=this._onInput.bind(this),this._onBeforeinput=this._onBeforeinput.bind(this),this._onCompositionEnd=this._onCompositionEnd.bind(this)}get rootElement(){var t,a,r;return(t=(a=(r=this.input).getRootNode)==null?void 0:a.call(r))!=null?t:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(t){this.input.addEventListener("keydown",this._onKeydown),this.input.addEventListener("input",this._onInput),this.input.addEventListener("beforeinput",this._onBeforeinput),this.input.addEventListener("compositionend",this._onCompositionEnd),this.input.addEventListener("drop",t.drop),this.input.addEventListener("click",t.click),this.input.addEventListener("focus",t.focus),this.input.addEventListener("blur",t.commit),this._handlers=t}_onKeydown(t){if(this._handlers.redo&&(t.keyCode===Ni&&t.shiftKey&&(t.metaKey||t.ctrlKey)||t.keyCode===JB&&t.ctrlKey))return t.preventDefault(),this._handlers.redo(t);if(this._handlers.undo&&t.keyCode===Ni&&(t.metaKey||t.ctrlKey))return t.preventDefault(),this._handlers.undo(t);t.isComposing||this._handlers.selectionChange(t)}_onBeforeinput(t){if(t.inputType==="historyUndo"&&this._handlers.undo)return t.preventDefault(),this._handlers.undo(t);if(t.inputType==="historyRedo"&&this._handlers.redo)return t.preventDefault(),this._handlers.redo(t)}_onCompositionEnd(t){this._handlers.input(t)}_onInput(t){t.isComposing||this._handlers.input(t)}unbindEvents(){this.input.removeEventListener("keydown",this._onKeydown),this.input.removeEventListener("input",this._onInput),this.input.removeEventListener("beforeinput",this._onBeforeinput),this.input.removeEventListener("compositionend",this._onCompositionEnd),this.input.removeEventListener("drop",this._handlers.drop),this.input.removeEventListener("click",this._handlers.click),this.input.removeEventListener("focus",this._handlers.focus),this.input.removeEventListener("blur",this._handlers.commit),this._handlers={}}}ue.HTMLMaskElement=ra;class vi extends ra{constructor(t){super(t),this.input=t}get _unsafeSelectionStart(){return this.input.selectionStart!=null?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(t,a){this.input.setSelectionRange(t,a)}get value(){return this.input.value}set value(t){this.input.value=t}}ue.HTMLMaskElement=ra;class yn extends ra{get _unsafeSelectionStart(){const t=this.rootElement,a=t.getSelection&&t.getSelection(),r=a&&a.anchorOffset,n=a&&a.focusOffset;return n==null||r==null||r<n?r:n}get _unsafeSelectionEnd(){const t=this.rootElement,a=t.getSelection&&t.getSelection(),r=a&&a.anchorOffset,n=a&&a.focusOffset;return n==null||r==null||r>n?r:n}_unsafeSelect(t,a){if(!this.rootElement.createRange)return;const r=this.rootElement.createRange();r.setStart(this.input.firstChild||this.input,t),r.setEnd(this.input.lastChild||this.input,a);const n=this.rootElement,o=n.getSelection&&n.getSelection();o&&(o.removeAllRanges(),o.addRange(r))}get value(){return this.input.textContent||""}set value(t){this.input.textContent=t}}ue.HTMLContenteditableMaskElement=yn;class Xa{constructor(){this.states=[],this.currentIndex=0}get currentState(){return this.states[this.currentIndex]}get isEmpty(){return this.states.length===0}push(t){this.currentIndex<this.states.length-1&&(this.states.length=this.currentIndex+1),this.states.push(t),this.states.length>Xa.MAX_LENGTH&&this.states.shift(),this.currentIndex=this.states.length-1}go(t){return this.currentIndex=Math.min(Math.max(this.currentIndex+t,0),this.states.length-1),this.currentState}undo(){return this.go(-1)}redo(){return this.go(1)}clear(){this.states.length=0,this.currentIndex=0}}Xa.MAX_LENGTH=100;class Bi{constructor(t,a){this.el=t instanceof Ya?t:t.isContentEditable&&t.tagName!=="INPUT"&&t.tagName!=="TEXTAREA"?new yn(t):new vi(t),this.masked=Ft(a),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new Xa,this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this._onUndo=this._onUndo.bind(this),this._onRedo=this._onRedo.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}maskEquals(t){var a;return t==null||((a=this.masked)==null?void 0:a.maskEquals(t))}get mask(){return this.masked.mask}set mask(t){if(this.maskEquals(t))return;if(!(t instanceof ue.Masked)&&this.masked.constructor===Vi(t)){this.masked.updateOptions({mask:t});return}const a=t instanceof ue.Masked?t:Ft({mask:t});a.unmaskedValue=this.masked.unmaskedValue,this.masked=a}get value(){return this._value}set value(t){this.value!==t&&(this.masked.value=t,this.updateControl("auto"))}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(t){this.unmaskedValue!==t&&(this.masked.unmaskedValue=t,this.updateControl("auto"))}get rawInputValue(){return this._rawInputValue}set rawInputValue(t){this.rawInputValue!==t&&(this.masked.rawInputValue=t,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(t){this.masked.typedValueEquals(t)||(this.masked.typedValue=t,this.updateControl("auto"))}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange,undo:this._onUndo,redo:this._onRedo})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(t,a){const r=this._listeners[t];r&&r.forEach(n=>n(a))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(t){!this.el||!this.el.isActive||(this.el.select(t,t),this._saveSelection())}_saveSelection(){this.displayValue!==this.el.value&&console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."),this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value,this._value=this.masked.value,this._unmaskedValue=this.masked.unmaskedValue,this._rawInputValue=this.masked.rawInputValue}updateControl(t){const a=this.masked.unmaskedValue,r=this.masked.value,n=this.masked.rawInputValue,o=this.displayValue,s=this.unmaskedValue!==a||this.value!==r||this._rawInputValue!==n;this._unmaskedValue=a,this._value=r,this._rawInputValue=n,this.el.value!==o&&(this.el.value=o),t==="auto"?this.alignCursor():t!=null&&(this.cursorPos=t),s&&this._fireChangeEvents(),!this._historyChanging&&(s||this.history.isEmpty)&&this.history.push({unmaskedValue:a,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(t){const{mask:a,...r}=t,n=!this.maskEquals(a),o=this.masked.optionsIsChanged(r);n&&(this.mask=a),o&&this.masked.updateOptions(r),(n||o)&&this.updateControl()}updateCursor(t){t!=null&&(this.cursorPos=t,this._delayUpdateCursor(t))}_delayUpdateCursor(t){this._abortUpdateCursor(),this._changingCursorPos=t,this._cursorChanging=setTimeout(()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())},10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,ne.LEFT))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(t,a){return this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push(a),this}off(t,a){if(!this._listeners[t])return this;if(!a)return delete this._listeners[t],this;const r=this._listeners[t].indexOf(a);return r>=0&&this._listeners[t].splice(r,1),this}_onInput(t){this._inputEvent=t,this._abortUpdateCursor();const a=new QB({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),r=this.masked.rawInputValue,n=this.masked.splice(a.startChangePos,a.removed.length,a.inserted,a.removeDirection,{input:!0,raw:!0}).offset,o=r===this.masked.rawInputValue?a.removeDirection:ne.NONE;let s=this.masked.nearestInputPos(a.startChangePos+n,o);o!==ne.NONE&&(s=this.masked.nearestInputPos(s,ne.NONE)),this.updateControl(s),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(t){t.preventDefault(),t.stopPropagation()}_onFocus(t){this.alignCursorFriendly()}_onClick(t){this.alignCursorFriendly()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(t){t&&(this._historyChanging=!0,this.unmaskedValue=t.unmaskedValue,this.el.select(t.selection.start,t.selection.end),this._saveSelection(),this._historyChanging=!1)}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}}ue.InputMask=Bi;class fe{static normalize(t){return Array.isArray(t)?t:[t,new fe]}constructor(t){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:!1},t)}aggregate(t){return this.inserted+=t.inserted,this.rawInserted+=t.rawInserted,this.tailShift+=t.tailShift,this.skip=this.skip||t.skip,this}get offset(){return this.tailShift+this.inserted.length}get consumed(){return!!this.rawInserted||this.skip}equals(t){return this.inserted===t.inserted&&this.tailShift===t.tailShift&&this.rawInserted===t.rawInserted&&this.skip===t.skip}}ue.ChangeDetails=fe;class It{constructor(t,a,r){t===void 0&&(t=""),a===void 0&&(a=0),this.value=t,this.from=a,this.stop=r}toString(){return this.value}extend(t){this.value+=String(t)}appendTo(t){return t.append(this.toString(),{tail:!0}).aggregate(t._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(t){Object.assign(this,t)}unshift(t){if(!this.value.length||t!=null&&this.from>=t)return"";const a=this.value[0];return this.value=this.value.slice(1),a}shift(){if(!this.value.length)return"";const t=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),t}}class Je{constructor(t){this._value="",this._update({...Je.DEFAULTS,...t}),this._initialized=!0}updateOptions(t){this.optionsIsChanged(t)&&this.withValueRefresh(this._update.bind(this,t))}_update(t){Object.assign(this,t)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value}reset(){this._value=""}get value(){return this._value}set value(t){this.resolve(t,{input:!0})}resolve(t,a){a===void 0&&(a={input:!0}),this.reset(),this.append(t,a,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(t){this.resolve(t,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(t){this.format?this.value=this.format(t,this):this.unmaskedValue=String(t)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(t){this.resolve(t,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(t,a){return t}totalInputPositions(t,a){return t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length),Math.min(this.displayValue.length,a-t)}extractInput(t,a,r){return t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length),this.displayValue.slice(t,a)}extractTail(t,a){return t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length),new It(this.extractInput(t,a),t)}appendTail(t){return ll(t)&&(t=new It(String(t))),t.appendTo(this)}_appendCharRaw(t,a){return t?(this._value+=t,new fe({inserted:t,rawInserted:t})):new fe}_appendChar(t,a,r){a===void 0&&(a={});const n=this.state;let o;if([t,o]=this.doPrepareChar(t,a),t&&(o=o.aggregate(this._appendCharRaw(t,a)),!o.rawInserted&&this.autofix==="pad")){const s=this.state;this.state=n;let i=this.pad(a);const c=this._appendCharRaw(t,a);i=i.aggregate(c),c.rawInserted||i.equals(o)?o=i:this.state=s}if(o.inserted){let s,i=this.doValidate(a)!==!1;if(i&&r!=null){const c=this.state;if(this.overwrite===!0){s=r.state;for(let d=0;d<o.rawInserted.length;++d)r.unshift(this.displayValue.length-o.tailShift)}let u=this.appendTail(r);if(i=u.rawInserted.length===r.toString().length,!(i&&u.inserted)&&this.overwrite==="shift"){this.state=c,s=r.state;for(let d=0;d<o.rawInserted.length;++d)r.shift();u=this.appendTail(r),i=u.rawInserted.length===r.toString().length}i&&u.inserted&&(this.state=c)}i||(o=new fe,this.state=n,r&&s&&(r.state=s))}return o}_appendPlaceholder(){return new fe}_appendEager(){return new fe}append(t,a,r){if(!ll(t))throw new Error("value should be string");const n=ll(r)?new It(String(r)):r;a!=null&&a.tail&&(a._beforeTailState=this.state);let o;[t,o]=this.doPrepare(t,a);for(let s=0;s<t.length;++s){const i=this._appendChar(t[s],a,n);if(!i.rawInserted&&!this.doSkipInvalid(t[s],a,n))break;o.aggregate(i)}return(this.eager===!0||this.eager==="append")&&a!=null&&a.input&&t&&o.aggregate(this._appendEager()),n!=null&&(o.tailShift+=this.appendTail(n).tailShift),o}remove(t,a){return t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length),this._value=this.displayValue.slice(0,t)+this.displayValue.slice(a),new fe}withValueRefresh(t){if(this._refreshing||!this._initialized)return t();this._refreshing=!0;const a=this.rawInputValue,r=this.value,n=t();return this.rawInputValue=a,this.value&&this.value!==r&&r.indexOf(this.value)===0&&(this.append(r.slice(this.displayValue.length),{},""),this.doCommit()),delete this._refreshing,n}runIsolated(t){if(this._isolated||!this._initialized)return t(this);this._isolated=!0;const a=this.state,r=t(this);return this.state=a,delete this._isolated,r}doSkipInvalid(t,a,r){return!!this.skipInvalid}doPrepare(t,a){return a===void 0&&(a={}),fe.normalize(this.prepare?this.prepare(t,this,a):t)}doPrepareChar(t,a){return a===void 0&&(a={}),fe.normalize(this.prepareChar?this.prepareChar(t,this,a):t)}doValidate(t){return(!this.validate||this.validate(this.value,this,t))&&(!this.parent||this.parent.doValidate(t))}doCommit(){this.commit&&this.commit(this.value,this)}splice(t,a,r,n,o){r===void 0&&(r=""),n===void 0&&(n=ne.NONE),o===void 0&&(o={input:!0});const s=t+a,i=this.extractTail(s),c=this.eager===!0||this.eager==="remove";let u;c&&(n=Ci(n),u=this.extractInput(0,s,{raw:!0}));let d=t;const m=new fe;if(n!==ne.NONE&&(d=this.nearestInputPos(t,a>1&&t!==0&&!c?ne.NONE:n),m.tailShift=d-t),m.aggregate(this.remove(d)),c&&n!==ne.NONE&&u===this.rawInputValue)if(n===ne.FORCE_LEFT){let f;for(;u===this.rawInputValue&&(f=this.displayValue.length);)m.aggregate(new fe({tailShift:-1})).aggregate(this.remove(f-1))}else n===ne.FORCE_RIGHT&&i.unshift();return m.aggregate(this.append(r,o,i))}maskEquals(t){return this.mask===t}optionsIsChanged(t){return!Ka(this,t)}typedValueEquals(t){const a=this.typedValue;return t===a||Je.EMPTY_VALUES.includes(t)&&Je.EMPTY_VALUES.includes(a)||(this.format?this.format(t,this)===this.format(this.typedValue,this):!1)}pad(t){return new fe}}Je.DEFAULTS={skipInvalid:!0},Je.EMPTY_VALUES=[void 0,null,""],ue.Masked=Je;class al{constructor(t,a){t===void 0&&(t=[]),a===void 0&&(a=0),this.chunks=t,this.from=a}toString(){return this.chunks.map(String).join("")}extend(t){if(!String(t))return;t=ll(t)?new It(String(t)):t;const a=this.chunks[this.chunks.length-1],r=a&&(a.stop===t.stop||t.stop==null)&&t.from===a.from+a.toString().length;if(t instanceof It)r?a.extend(t.toString()):this.chunks.push(t);else if(t instanceof al){if(t.stop==null){let n;for(;t.chunks.length&&t.chunks[0].stop==null;)n=t.chunks.shift(),n.from+=t.from,this.extend(n)}t.toString()&&(t.stop=t.blockIndex,this.chunks.push(t))}}appendTo(t){if(!(t instanceof ue.MaskedPattern))return new It(this.toString()).appendTo(t);const a=new fe;for(let r=0;r<this.chunks.length;++r){const n=this.chunks[r],o=t._mapPosToBlock(t.displayValue.length),s=n.stop;let i;if(s!=null&&(!o||o.index<=s)&&((n instanceof al||t._stops.indexOf(s)>=0)&&a.aggregate(t._appendPlaceholder(s)),i=n instanceof al&&t._blocks[s]),i){const c=i.appendTail(n);a.aggregate(c);const u=n.toString().slice(c.rawInserted.length);u&&a.aggregate(t.append(u,{tail:!0}))}else a.aggregate(t.append(n.toString(),{tail:!0}))}return a}get state(){return{chunks:this.chunks.map(t=>t.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(t){const{chunks:a,...r}=t;Object.assign(this,r),this.chunks=a.map(n=>{const o="chunks"in n?new al:new It;return o.state=n,o})}unshift(t){if(!this.chunks.length||t!=null&&this.from>=t)return"";const a=t!=null?t-this.from:t;let r=0;for(;r<this.chunks.length;){const n=this.chunks[r],o=n.unshift(a);if(n.toString()){if(!o)break;++r}else this.chunks.splice(r,1);if(o)return o}return""}shift(){if(!this.chunks.length)return"";let t=this.chunks.length-1;for(;0<=t;){const a=this.chunks[t],r=a.shift();if(a.toString()){if(!r)break;--t}else this.chunks.splice(t,1);if(r)return r}return""}}class e4{constructor(t,a){this.masked=t,this._log=[];const{offset:r,index:n}=t._mapPosToBlock(a)||(a<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=r,this.index=n,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(t){Object.assign(this,t)}pushState(){this._log.push(this.state)}popState(){const t=this._log.pop();return t&&(this.state=t),t}bindBlock(){this.block||(this.index<0&&(this.index=0,this.offset=0),this.index>=this.masked._blocks.length&&(this.index=this.masked._blocks.length-1,this.offset=this.block.displayValue.length))}_pushLeft(t){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=((a=this.block)==null?void 0:a.displayValue.length)||0){var a;if(t())return this.ok=!0}return this.ok=!1}_pushRight(t){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(t())return this.ok=!0;return this.ok=!1}pushLeftBeforeFilled(){return this._pushLeft(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,ne.FORCE_LEFT),this.offset!==0))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,ne.LEFT),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,ne.LEFT),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,ne.FORCE_RIGHT),this.offset!==this.block.value.length))return!0})}pushRightBeforeInput(){return this._pushRight(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,ne.NONE),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,ne.NONE),!0})}}class kn{constructor(t){Object.assign(this,t),this._value="",this.isFixed=!0}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get rawInputValue(){return this._isRawInput?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=!1,this._value=""}remove(t,a){return t===void 0&&(t=0),a===void 0&&(a=this._value.length),this._value=this._value.slice(0,t)+this._value.slice(a),this._value||(this._isRawInput=!1),new fe}nearestInputPos(t,a){a===void 0&&(a=ne.NONE);const r=0,n=this._value.length;switch(a){case ne.LEFT:case ne.FORCE_LEFT:return r;case ne.NONE:case ne.RIGHT:case ne.FORCE_RIGHT:default:return n}}totalInputPositions(t,a){return t===void 0&&(t=0),a===void 0&&(a=this._value.length),this._isRawInput?a-t:0}extractInput(t,a,r){return t===void 0&&(t=0),a===void 0&&(a=this._value.length),r===void 0&&(r={}),r.raw&&this._isRawInput&&this._value.slice(t,a)||""}get isComplete(){return!0}get isFilled(){return!!this._value}_appendChar(t,a){if(a===void 0&&(a={}),this.isFilled)return new fe;const r=this.eager===!0||this.eager==="append",n=this.char===t&&(this.isUnmasking||a.input||a.raw)&&(!a.raw||!r)&&!a.tail,o=new fe({inserted:this.char,rawInserted:n?this.char:""});return this._value=this.char,this._isRawInput=n&&(a.raw||a.input),o}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const t=new fe;return this.isFilled||(this._value=t.inserted=this.char),t}extractTail(){return new It("")}appendTail(t){return ll(t)&&(t=new It(String(t))),t.appendTo(this)}append(t,a,r){const n=this._appendChar(t[0],a);return r!=null&&(n.tailShift+=this.appendTail(r).tailShift),n}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value,this._isRawInput=!!t._rawInputValue}pad(t){return this._appendPlaceholder()}}class na{constructor(t){const{parent:a,isOptional:r,placeholderChar:n,displayChar:o,lazy:s,eager:i,...c}=t;this.masked=Ft(c),Object.assign(this,{parent:a,isOptional:r,placeholderChar:n,displayChar:o,lazy:s,eager:i})}reset(){this.isFilled=!1,this.masked.reset()}remove(t,a){return t===void 0&&(t=0),a===void 0&&(a=this.value.length),t===0&&a>=1?(this.isFilled=!1,this.masked.remove(t,a)):new fe}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get rawInputValue(){return this.masked.rawInputValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return!!this.masked.value||this.isOptional}_appendChar(t,a){if(a===void 0&&(a={}),this.isFilled)return new fe;const r=this.masked.state;let n=this.masked._appendChar(t,this.currentMaskFlags(a));return n.inserted&&this.doValidate(a)===!1&&(n=new fe,this.masked.state=r),!n.inserted&&!this.isOptional&&!this.lazy&&!a.input&&(n.inserted=this.placeholderChar),n.skip=!n.inserted&&!this.isOptional,this.isFilled=!!n.inserted,n}append(t,a,r){return this.masked.append(t,this.currentMaskFlags(a),r)}_appendPlaceholder(){return this.isFilled||this.isOptional?new fe:(this.isFilled=!0,new fe({inserted:this.placeholderChar}))}_appendEager(){return new fe}extractTail(t,a){return this.masked.extractTail(t,a)}appendTail(t){return this.masked.appendTail(t)}extractInput(t,a,r){return t===void 0&&(t=0),a===void 0&&(a=this.value.length),this.masked.extractInput(t,a,r)}nearestInputPos(t,a){a===void 0&&(a=ne.NONE);const r=0,n=this.value.length,o=Math.min(Math.max(t,r),n);switch(a){case ne.LEFT:case ne.FORCE_LEFT:return this.isComplete?o:r;case ne.RIGHT:case ne.FORCE_RIGHT:return this.isComplete?o:n;case ne.NONE:default:return o}}totalInputPositions(t,a){return t===void 0&&(t=0),a===void 0&&(a=this.value.length),this.value.slice(t,a).length}doValidate(t){return this.masked.doValidate(this.currentMaskFlags(t))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(t)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(t){this.masked.state=t.masked,this.isFilled=t.isFilled}currentMaskFlags(t){var a;return{...t,_beforeTailState:(t==null||(a=t._beforeTailState)==null?void 0:a.masked)||(t==null?void 0:t._beforeTailState)}}pad(t){return new fe}}na.DEFAULT_DEFINITIONS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./};class Si extends Je{updateOptions(t){super.updateOptions(t)}_update(t){const a=t.mask;a&&(t.validate=r=>r.search(a)>=0),super._update(t)}}ue.MaskedRegExp=Si;class et extends Je{constructor(t){super({...et.DEFAULTS,...t,definitions:Object.assign({},na.DEFAULT_DEFINITIONS,t==null?void 0:t.definitions)})}updateOptions(t){super.updateOptions(t)}_update(t){t.definitions=Object.assign({},this.definitions,t.definitions),super._update(t),this._rebuildMask()}_rebuildMask(){const t=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};const a=this.mask;if(!a||!t)return;let r=!1,n=!1;for(let o=0;o<a.length;++o){if(this.blocks){const u=a.slice(o),d=Object.keys(this.blocks).filter(f=>u.indexOf(f)===0);d.sort((f,p)=>p.length-f.length);const m=d[0];if(m){const{expose:f,repeat:p,...y}=Fl(this.blocks[m]),h={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...y,repeat:p,parent:this},g=p!=null?new ue.RepeatBlock(h):Ft(h);g&&(this._blocks.push(g),f&&(this.exposeBlock=g),this._maskedBlocks[m]||(this._maskedBlocks[m]=[]),this._maskedBlocks[m].push(this._blocks.length-1)),o+=m.length-1;continue}}let s=a[o],i=s in t;if(s===et.STOP_CHAR){this._stops.push(this._blocks.length);continue}if(s==="{"||s==="}"){r=!r;continue}if(s==="["||s==="]"){n=!n;continue}if(s===et.ESCAPE_CHAR){if(++o,s=a[o],!s)break;i=!1}const c=i?new na({isOptional:n,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...Fl(t[s]),parent:this}):new kn({char:s,eager:this.eager,isUnmasking:r});this._blocks.push(c)}}get state(){return{...super.state,_blocks:this._blocks.map(t=>t.state)}}set state(t){if(!t){this.reset();return}const{_blocks:a,...r}=t;this._blocks.forEach((n,o)=>n.state=a[o]),super.state=r}reset(){super.reset(),this._blocks.forEach(t=>t.reset())}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every(t=>t.isComplete)}get isFilled(){return this._blocks.every(t=>t.isFilled)}get isFixed(){return this._blocks.every(t=>t.isFixed)}get isOptional(){return this._blocks.every(t=>t.isOptional)}doCommit(){this._blocks.forEach(t=>t.doCommit()),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((t,a)=>t+=a.unmaskedValue,"")}set unmaskedValue(t){if(this.exposeBlock){const a=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=t,this.appendTail(a),this.doCommit()}else super.unmaskedValue=t}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((t,a)=>t+=a.value,"")}set value(t){if(this.exposeBlock){const a=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=t,this.appendTail(a),this.doCommit()}else super.value=t}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(t){if(this.exposeBlock){const a=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=t,this.appendTail(a),this.doCommit()}else super.typedValue=t}get displayValue(){return this._blocks.reduce((t,a)=>t+=a.displayValue,"")}appendTail(t){return super.appendTail(t).aggregate(this._appendPlaceholder())}_appendEager(){var t;const a=new fe;let r=(t=this._mapPosToBlock(this.displayValue.length))==null?void 0:t.index;if(r==null)return a;this._blocks[r].isFilled&&++r;for(let n=r;n<this._blocks.length;++n){const o=this._blocks[n]._appendEager();if(!o.inserted)break;a.aggregate(o)}return a}_appendCharRaw(t,a){a===void 0&&(a={});const r=this._mapPosToBlock(this.displayValue.length),n=new fe;if(!r)return n;for(let s=r.index,i;i=this._blocks[s];++s){var o;const c=i._appendChar(t,{...a,_beforeTailState:(o=a._beforeTailState)==null||(o=o._blocks)==null?void 0:o[s]});if(n.aggregate(c),c.consumed)break}return n}extractTail(t,a){t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length);const r=new al;return t===a||this._forEachBlocksInRange(t,a,(n,o,s,i)=>{const c=n.extractTail(s,i);c.stop=this._findStopBefore(o),c.from=this._blockStartPos(o),c instanceof al&&(c.blockIndex=o),r.extend(c)}),r}extractInput(t,a,r){if(t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length),r===void 0&&(r={}),t===a)return"";let n="";return this._forEachBlocksInRange(t,a,(o,s,i,c)=>{n+=o.extractInput(i,c,r)}),n}_findStopBefore(t){let a;for(let r=0;r<this._stops.length;++r){const n=this._stops[r];if(n<=t)a=n;else break}return a}_appendPlaceholder(t){const a=new fe;if(this.lazy&&t==null)return a;const r=this._mapPosToBlock(this.displayValue.length);if(!r)return a;const n=r.index,o=t??this._blocks.length;return this._blocks.slice(n,o).forEach(s=>{if(!s.lazy||t!=null){var i;a.aggregate(s._appendPlaceholder((i=s._blocks)==null?void 0:i.length))}}),a}_mapPosToBlock(t){let a="";for(let r=0;r<this._blocks.length;++r){const n=this._blocks[r],o=a.length;if(a+=n.displayValue,t<=a.length)return{index:r,offset:t-o}}}_blockStartPos(t){return this._blocks.slice(0,t).reduce((a,r)=>a+=r.displayValue.length,0)}_forEachBlocksInRange(t,a,r){a===void 0&&(a=this.displayValue.length);const n=this._mapPosToBlock(t);if(n){const o=this._mapPosToBlock(a),s=o&&n.index===o.index,i=n.offset,c=o&&s?o.offset:this._blocks[n.index].displayValue.length;if(r(this._blocks[n.index],n.index,i,c),o&&!s){for(let u=n.index+1;u<o.index;++u)r(this._blocks[u],u,0,this._blocks[u].displayValue.length);r(this._blocks[o.index],o.index,0,o.offset)}}}remove(t,a){t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length);const r=super.remove(t,a);return this._forEachBlocksInRange(t,a,(n,o,s,i)=>{r.aggregate(n.remove(s,i))}),r}nearestInputPos(t,a){if(a===void 0&&(a=ne.NONE),!this._blocks.length)return 0;const r=new e4(this,t);if(a===ne.NONE)return r.pushRightBeforeInput()||(r.popState(),r.pushLeftBeforeInput())?r.pos:this.displayValue.length;if(a===ne.LEFT||a===ne.FORCE_LEFT){if(a===ne.LEFT){if(r.pushRightBeforeFilled(),r.ok&&r.pos===t)return t;r.popState()}if(r.pushLeftBeforeInput(),r.pushLeftBeforeRequired(),r.pushLeftBeforeFilled(),a===ne.LEFT){if(r.pushRightBeforeInput(),r.pushRightBeforeRequired(),r.ok&&r.pos<=t||(r.popState(),r.ok&&r.pos<=t))return r.pos;r.popState()}return r.ok?r.pos:a===ne.FORCE_LEFT?0:(r.popState(),r.ok||(r.popState(),r.ok)?r.pos:0)}return a===ne.RIGHT||a===ne.FORCE_RIGHT?(r.pushRightBeforeInput(),r.pushRightBeforeRequired(),r.pushRightBeforeFilled()?r.pos:a===ne.FORCE_RIGHT?this.displayValue.length:(r.popState(),r.ok||(r.popState(),r.ok)?r.pos:this.nearestInputPos(t,ne.LEFT))):t}totalInputPositions(t,a){t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length);let r=0;return this._forEachBlocksInRange(t,a,(n,o,s,i)=>{r+=n.totalInputPositions(s,i)}),r}maskedBlock(t){return this.maskedBlocks(t)[0]}maskedBlocks(t){const a=this._maskedBlocks[t];return a?a.map(r=>this._blocks[r]):[]}pad(t){const a=new fe;return this._forEachBlocksInRange(0,this.displayValue.length,r=>a.aggregate(r.pad(t))),a}}et.DEFAULTS={...Je.DEFAULTS,lazy:!0,placeholderChar:"_"},et.STOP_CHAR="`",et.ESCAPE_CHAR="\\",et.InputDefinition=na,et.FixedDefinition=kn,ue.MaskedPattern=et;class oa extends et{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){const{to:a=this.to||0,from:r=this.from||0,maxLength:n=this.maxLength||0,autofix:o=this.autofix,...s}=t;this.to=a,this.from=r,this.maxLength=Math.max(String(a).length,n),this.autofix=o;const i=String(this.from).padStart(this.maxLength,"0"),c=String(this.to).padStart(this.maxLength,"0");let u=0;for(;u<c.length&&c[u]===i[u];)++u;s.mask=c.slice(0,u).replace(/0/g,"\\0")+"0".repeat(this.maxLength-u),super._update(s)}get isComplete(){return super.isComplete&&!!this.value}boundaries(t){let a="",r="";const[,n,o]=t.match(/^(\D*)(\d*)(\D*)/)||[];return o&&(a="0".repeat(n.length)+o,r="9".repeat(n.length)+o),a=a.padEnd(this.maxLength,"0"),r=r.padEnd(this.maxLength,"9"),[a,r]}doPrepareChar(t,a){a===void 0&&(a={});let r;return[t,r]=super.doPrepareChar(t.replace(/\D/g,""),a),t||(r.skip=!this.isComplete),[t,r]}_appendCharRaw(t,a){if(a===void 0&&(a={}),!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(t,a);const r=String(this.from).padStart(this.maxLength,"0"),n=String(this.to).padStart(this.maxLength,"0"),[o,s]=this.boundaries(this.value+t);return Number(s)<this.from?super._appendCharRaw(r[this.value.length],a):Number(o)>this.to?!a.tail&&this.autofix==="pad"&&this.value.length+1<this.maxLength?super._appendCharRaw(r[this.value.length],a).aggregate(this._appendCharRaw(t,a)):super._appendCharRaw(n[this.value.length],a):super._appendCharRaw(t,a)}doValidate(t){const a=this.value;if(a.search(/[^0]/)===-1&&a.length<=this._matchFrom)return!0;const[r,n]=this.boundaries(a);return this.from<=Number(n)&&Number(r)<=this.to&&super.doValidate(t)}pad(t){const a=new fe;if(this.value.length===this.maxLength)return a;const r=this.value,n=this.maxLength-this.value.length;if(n){this.reset();for(let o=0;o<n;++o)a.aggregate(super._appendCharRaw("0",t));r.split("").forEach(o=>this._appendCharRaw(o))}return a}}ue.MaskedRange=oa;const t4="d{.}`m{.}`Y";class Ot extends et{static extractPatternOptions(t){const{mask:a,pattern:r,...n}=t;return{...n,mask:ll(a)?a:r}}constructor(t){super(Ot.extractPatternOptions({...Ot.DEFAULTS,...t}))}updateOptions(t){super.updateOptions(t)}_update(t){const{mask:a,pattern:r,blocks:n,...o}={...Ot.DEFAULTS,...t},s=Object.assign({},Ot.GET_DEFAULT_BLOCKS());t.min&&(s.Y.from=t.min.getFullYear()),t.max&&(s.Y.to=t.max.getFullYear()),t.min&&t.max&&s.Y.from===s.Y.to&&(s.m.from=t.min.getMonth()+1,s.m.to=t.max.getMonth()+1,s.m.from===s.m.to&&(s.d.from=t.min.getDate(),s.d.to=t.max.getDate())),Object.assign(s,this.blocks,n),super._update({...o,mask:ll(a)?a:r,blocks:s})}doValidate(t){const a=this.date;return super.doValidate(t)&&(!this.isComplete||this.isDateExist(this.value)&&a!=null&&(this.min==null||this.min<=a)&&(this.max==null||a<=this.max))}isDateExist(t){return this.format(this.parse(t,this),this).indexOf(t)>=0}get date(){return this.typedValue}set date(t){this.typedValue=t}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(t){super.typedValue=t}maskEquals(t){return t===Date||super.maskEquals(t)}optionsIsChanged(t){return super.optionsIsChanged(Ot.extractPatternOptions(t))}}Ot.GET_DEFAULT_BLOCKS=()=>({d:{mask:oa,from:1,to:31,maxLength:2},m:{mask:oa,from:1,to:12,maxLength:2},Y:{mask:oa,from:1900,to:9999}}),Ot.DEFAULTS={...et.DEFAULTS,mask:Date,pattern:t4,format:(l,t)=>{if(!l)return"";const a=String(l.getDate()).padStart(2,"0"),r=String(l.getMonth()+1).padStart(2,"0"),n=l.getFullYear();return[a,r,n].join(".")},parse:(l,t)=>{const[a,r,n]=l.split(".").map(Number);return new Date(n,r-1,a)}},ue.MaskedDate=Ot;class sa extends Je{constructor(t){super({...sa.DEFAULTS,...t}),this.currentMask=void 0}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),"mask"in t&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(t.mask)?t.mask.map(a=>{const{expose:r,...n}=Fl(a),o=Ft({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...n});return r&&(this.exposeMask=o),o}):[])}_appendCharRaw(t,a){a===void 0&&(a={});const r=this._applyDispatch(t,a);return this.currentMask&&r.aggregate(this.currentMask._appendChar(t,this.currentMaskFlags(a))),r}_applyDispatch(t,a,r){t===void 0&&(t=""),a===void 0&&(a={}),r===void 0&&(r="");const n=a.tail&&a._beforeTailState!=null?a._beforeTailState._value:this.value,o=this.rawInputValue,s=a.tail&&a._beforeTailState!=null?a._beforeTailState._rawInputValue:o,i=o.slice(s.length),c=this.currentMask,u=new fe,d=c==null?void 0:c.state;return this.currentMask=this.doDispatch(t,{...a},r),this.currentMask&&(this.currentMask!==c?(this.currentMask.reset(),s&&(this.currentMask.append(s,{raw:!0}),u.tailShift=this.currentMask.value.length-n.length),i&&(u.tailShift+=this.currentMask.append(i,{raw:!0,tail:!0}).tailShift)):d&&(this.currentMask.state=d)),u}_appendPlaceholder(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendPlaceholder()),t}_appendEager(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendEager()),t}appendTail(t){const a=new fe;return t&&a.aggregate(this._applyDispatch("",{},t)),a.aggregate(this.currentMask?this.currentMask.appendTail(t):super.appendTail(t))}currentMaskFlags(t){var a,r;return{...t,_beforeTailState:((a=t._beforeTailState)==null?void 0:a.currentMaskRef)===this.currentMask&&((r=t._beforeTailState)==null?void 0:r.currentMask)||t._beforeTailState}}doDispatch(t,a,r){return a===void 0&&(a={}),r===void 0&&(r=""),this.dispatch(t,this,a,r)}doValidate(t){return super.doValidate(t)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(t)))}doPrepare(t,a){a===void 0&&(a={});let[r,n]=super.doPrepare(t,a);if(this.currentMask){let o;[r,o]=super.doPrepare(r,this.currentMaskFlags(a)),n=n.aggregate(o)}return[r,n]}doPrepareChar(t,a){a===void 0&&(a={});let[r,n]=super.doPrepareChar(t,a);if(this.currentMask){let o;[r,o]=super.doPrepareChar(r,this.currentMaskFlags(a)),n=n.aggregate(o)}return[r,n]}reset(){var t;(t=this.currentMask)==null||t.reset(),this.compiledMasks.forEach(a=>a.reset())}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(t){this.exposeMask?(this.exposeMask.value=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=t}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(t){this.exposeMask?(this.exposeMask.unmaskedValue=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=t}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(t){if(this.exposeMask){this.exposeMask.typedValue=t,this.currentMask=this.exposeMask,this._applyDispatch();return}let a=String(t);this.currentMask&&(this.currentMask.typedValue=t,a=this.currentMask.unmaskedValue),this.unmaskedValue=a}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var t;return!!((t=this.currentMask)!=null&&t.isComplete)}get isFilled(){var t;return!!((t=this.currentMask)!=null&&t.isFilled)}remove(t,a){const r=new fe;return this.currentMask&&r.aggregate(this.currentMask.remove(t,a)).aggregate(this._applyDispatch()),r}get state(){var t;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(a=>a.state),currentMaskRef:this.currentMask,currentMask:(t=this.currentMask)==null?void 0:t.state}}set state(t){const{compiledMasks:a,currentMaskRef:r,currentMask:n,...o}=t;a&&this.compiledMasks.forEach((s,i)=>s.state=a[i]),r!=null&&(this.currentMask=r,this.currentMask.state=n),super.state=o}extractInput(t,a,r){return this.currentMask?this.currentMask.extractInput(t,a,r):""}extractTail(t,a){return this.currentMask?this.currentMask.extractTail(t,a):super.extractTail(t,a)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(t,a){return this.currentMask?this.currentMask.nearestInputPos(t,a):super.nearestInputPos(t,a)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(t){this._overwrite=t}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(t){this._eager=t}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(t){this._skipInvalid=t}get autofix(){return this.currentMask?this.currentMask.autofix:this._autofix}set autofix(t){this._autofix=t}maskEquals(t){return Array.isArray(t)?this.compiledMasks.every((a,r)=>{if(!t[r])return;const{mask:n,...o}=t[r];return Ka(a,o)&&a.maskEquals(n)}):super.maskEquals(t)}typedValueEquals(t){var a;return!!((a=this.currentMask)!=null&&a.typedValueEquals(t))}}sa.DEFAULTS={...Je.DEFAULTS,dispatch:(l,t,a,r)=>{if(!t.compiledMasks.length)return;const n=t.rawInputValue,o=t.compiledMasks.map((s,i)=>{const c=t.currentMask===s,u=c?s.displayValue.length:s.nearestInputPos(s.displayValue.length,ne.FORCE_LEFT);return s.rawInputValue!==n?(s.reset(),s.append(n,{raw:!0})):c||s.remove(u),s.append(l,t.currentMaskFlags(a)),s.appendTail(r),{index:i,weight:s.rawInputValue.length,totalInputPositions:s.totalInputPositions(0,Math.max(u,s.nearestInputPos(s.displayValue.length,ne.FORCE_LEFT)))}});return o.sort((s,i)=>i.weight-s.weight||i.totalInputPositions-s.totalInputPositions),t.compiledMasks[o[0].index]}},ue.MaskedDynamic=sa;class ia extends et{constructor(t){super({...ia.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){const{enum:a,...r}=t;if(a){const n=a.map(i=>i.length),o=Math.min(...n),s=Math.max(...n)-o;r.mask="*".repeat(o),s&&(r.mask+="["+"*".repeat(s)+"]"),this.enum=a}super._update(r)}_appendCharRaw(t,a){a===void 0&&(a={});const r=Math.min(this.nearestInputPos(0,ne.FORCE_RIGHT),this.value.length),n=this.enum.filter(o=>this.matchValue(o,this.unmaskedValue+t,r));if(n.length){n.length===1&&this._forEachBlocksInRange(0,this.value.length,(s,i)=>{const c=n[0][i];i>=this.value.length||c===s.value||(s.reset(),s._appendChar(c,a))});const o=super._appendCharRaw(n[0][this.value.length],a);return n.length===1&&n[0].slice(this.unmaskedValue.length).split("").forEach(s=>o.aggregate(super._appendCharRaw(s))),o}return new fe({skip:!this.isComplete})}extractTail(t,a){return t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length),new It("",t)}remove(t,a){if(t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length),t===a)return new fe;const r=Math.min(super.nearestInputPos(0,ne.FORCE_RIGHT),this.value.length);let n;for(n=t;n>=0&&!(this.enum.filter(s=>this.matchValue(s,this.value.slice(r,n),r)).length>1);--n);const o=super.remove(n,a);return o.tailShift+=n-t,o}get isComplete(){return this.enum.indexOf(this.value)>=0}}ia.DEFAULTS={...et.DEFAULTS,matchValue:(l,t,a)=>l.indexOf(t,a)===a},ue.MaskedEnum=ia;class Di extends Je{updateOptions(t){super.updateOptions(t)}_update(t){super._update({...t,validate:t.mask})}}ue.MaskedFunction=Di;var Ai;class ut extends Je{constructor(t){super({...ut.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),this._updateRegExps()}_updateRegExps(){const t="^"+(this.allowNegative?"[+|\\-]?":""),a="\\d*",r=(this.scale?"("+bn(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(t+a+r),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(bn).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(bn(this.thousandsSeparator),"g")}_removeThousandsSeparators(t){return t.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(t){const a=t.split(this.radix);return a[0]=a[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),a.join(this.radix)}doPrepareChar(t,a){a===void 0&&(a={});const[r,n]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(a.input&&a.raw||!a.input&&!a.raw)?t.replace(this._mapToRadixRegExp,this.radix):t),a);return t&&!r&&(n.skip=!0),r&&!this.allowPositive&&!this.value&&r!=="-"&&n.aggregate(this._appendChar("-")),[r,n]}_separatorsCount(t,a){a===void 0&&(a=!1);let r=0;for(let n=0;n<t;++n)this._value.indexOf(this.thousandsSeparator,n)===n&&(++r,a&&(t+=this.thousandsSeparator.length));return r}_separatorsCountFromSlice(t){return t===void 0&&(t=this._value),this._separatorsCount(this._removeThousandsSeparators(t).length,!0)}extractInput(t,a,r){return t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length),[t,a]=this._adjustRangeWithSeparators(t,a),this._removeThousandsSeparators(super.extractInput(t,a,r))}_appendCharRaw(t,a){a===void 0&&(a={});const r=a.tail&&a._beforeTailState?a._beforeTailState._value:this._value,n=this._separatorsCountFromSlice(r);this._value=this._removeThousandsSeparators(this.value);const o=this._value;this._value+=t;const s=this.number;let i=!isNaN(s),c=!1;if(i){let f;this.min!=null&&this.min<0&&this.number<this.min&&(f=this.min),this.max!=null&&this.max>0&&this.number>this.max&&(f=this.max),f!=null&&(this.autofix?(this._value=this.format(f,this).replace(ut.UNMASKED_RADIX,this.radix),c||(c=o===this._value&&!a.tail)):i=!1),i&&(i=!!this._value.match(this._numberRegExp))}let u;i?u=new fe({inserted:this._value.slice(o.length),rawInserted:c?"":t,skip:c}):(this._value=o,u=new fe),this._value=this._insertThousandsSeparators(this._value);const d=a.tail&&a._beforeTailState?a._beforeTailState._value:this._value,m=this._separatorsCountFromSlice(d);return u.tailShift+=(m-n)*this.thousandsSeparator.length,u}_findSeparatorAround(t){if(this.thousandsSeparator){const a=t-this.thousandsSeparator.length+1,r=this.value.indexOf(this.thousandsSeparator,a);if(r<=t)return r}return-1}_adjustRangeWithSeparators(t,a){const r=this._findSeparatorAround(t);r>=0&&(t=r);const n=this._findSeparatorAround(a);return n>=0&&(a=n+this.thousandsSeparator.length),[t,a]}remove(t,a){t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length),[t,a]=this._adjustRangeWithSeparators(t,a);const r=this.value.slice(0,t),n=this.value.slice(a),o=this._separatorsCount(r.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(r+n));const s=this._separatorsCountFromSlice(r);return new fe({tailShift:(s-o)*this.thousandsSeparator.length})}nearestInputPos(t,a){if(!this.thousandsSeparator)return t;switch(a){case ne.NONE:case ne.LEFT:case ne.FORCE_LEFT:{const r=this._findSeparatorAround(t-1);if(r>=0){const n=r+this.thousandsSeparator.length;if(t<n||this.value.length<=n||a===ne.FORCE_LEFT)return r}break}case ne.RIGHT:case ne.FORCE_RIGHT:{const r=this._findSeparatorAround(t);if(r>=0)return r+this.thousandsSeparator.length}}return t}doCommit(){if(this.value){const t=this.number;let a=t;this.min!=null&&(a=Math.max(a,this.min)),this.max!=null&&(a=Math.min(a,this.max)),a!==t&&(this.unmaskedValue=this.format(a,this));let r=this.value;this.normalizeZeros&&(r=this._normalizeZeros(r)),this.padFractionalZeros&&this.scale>0&&(r=this._padFractionalZeros(r)),this._value=r}super.doCommit()}_normalizeZeros(t){const a=this._removeThousandsSeparators(t).split(this.radix);return a[0]=a[0].replace(/^(\D*)(0*)(\d*)/,(r,n,o,s)=>n+s),t.length&&!/\d$/.test(a[0])&&(a[0]=a[0]+"0"),a.length>1&&(a[1]=a[1].replace(/0*$/,""),a[1].length||(a.length=1)),this._insertThousandsSeparators(a.join(this.radix))}_padFractionalZeros(t){if(!t)return t;const a=t.split(this.radix);return a.length<2&&a.push(""),a[1]=a[1].padEnd(this.scale,"0"),a.join(this.radix)}doSkipInvalid(t,a,r){a===void 0&&(a={});const n=this.scale===0&&t!==this.thousandsSeparator&&(t===this.radix||t===ut.UNMASKED_RADIX||this.mapToRadix.includes(t));return super.doSkipInvalid(t,a,r)&&!n}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,ut.UNMASKED_RADIX)}set unmaskedValue(t){super.unmaskedValue=t}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(t){this.rawInputValue=this.format(t,this).replace(ut.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(t){this.typedValue=t}get allowNegative(){return this.min!=null&&this.min<0||this.max!=null&&this.max<0}get allowPositive(){return this.min!=null&&this.min>0||this.max!=null&&this.max>0}typedValueEquals(t){return(super.typedValueEquals(t)||ut.EMPTY_VALUES.includes(t)&&ut.EMPTY_VALUES.includes(this.typedValue))&&!(t===0&&this.value==="")}}Ai=ut,ut.UNMASKED_RADIX=".",ut.EMPTY_VALUES=[...Je.EMPTY_VALUES,0],ut.DEFAULTS={...Je.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[Ai.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:l=>l.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})},ue.MaskedNumber=ut;const Za={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function xn(l,t,a){t===void 0&&(t=Za.MASKED),a===void 0&&(a=Za.MASKED);const r=Ft(l);return n=>r.runIsolated(o=>(o[t]=n,o[a]))}function Mi(l,t,a,r){return xn(t,a,r)(l)}ue.PIPE_TYPE=Za,ue.createPipe=xn,ue.pipe=Mi;class Ti extends et{get repeatFrom(){var t;return(t=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===1/0?0:this.repeat)!=null?t:0}get repeatTo(){var t;return(t=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)!=null?t:1/0}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){var a,r,n;const{repeat:o,...s}=Fl(t);this._blockOpts=Object.assign({},this._blockOpts,s);const i=Ft(this._blockOpts);this.repeat=(a=(r=o??i.repeat)!=null?r:this.repeat)!=null?a:1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&((n=this._blocks)==null?void 0:n.length)||0,this.repeatFrom)),blocks:{m:i},eager:i.eager,overwrite:i.overwrite,skipInvalid:i.skipInvalid,lazy:i.lazy,placeholderChar:i.placeholderChar,displayChar:i.displayChar})}_allocateBlock(t){if(t<this._blocks.length)return this._blocks[t];if(this.repeatTo===1/0||this._blocks.length<this.repeatTo)return this._blocks.push(Ft(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]}_appendCharRaw(t,a){a===void 0&&(a={});const r=new fe;for(let c=(n=(o=this._mapPosToBlock(this.displayValue.length))==null?void 0:o.index)!=null?n:Math.max(this._blocks.length-1,0),u,d;u=(s=this._blocks[c])!=null?s:d=!d&&this._allocateBlock(c);++c){var n,o,s,i;const m=u._appendChar(t,{...a,_beforeTailState:(i=a._beforeTailState)==null||(i=i._blocks)==null?void 0:i[c]});if(m.skip&&d){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(r.aggregate(m),m.consumed)break}return r}_trimEmptyTail(t,a){var r,n;t===void 0&&(t=0);const o=Math.max(((r=this._mapPosToBlock(t))==null?void 0:r.index)||0,this.repeatFrom,0);let s;a!=null&&(s=(n=this._mapPosToBlock(a))==null?void 0:n.index),s==null&&(s=this._blocks.length-1);let i=0;for(let c=s;o<=c&&!this._blocks[c].unmaskedValue;--c,++i);i&&(this._blocks.splice(s-i+1,i),this.mask=this.mask.slice(i))}reset(){super.reset(),this._trimEmptyTail()}remove(t,a){t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length);const r=super.remove(t,a);return this._trimEmptyTail(t,a),r}totalInputPositions(t,a){return t===void 0&&(t=0),a==null&&this.repeatTo===1/0?1/0:super.totalInputPositions(t,a)}get state(){return super.state}set state(t){this._blocks.length=t._blocks.length,this.mask=this.mask.slice(0,this._blocks.length),super.state=t}}ue.RepeatBlock=Ti;try{globalThis.IMask=ue}catch{}const l4=Object.freeze(Object.defineProperty({__proto__:null,ChangeDetails:fe,ChunksTailDetails:al,DIRECTION:ne,HTMLContenteditableMaskElement:yn,HTMLInputMaskElement:vi,HTMLMaskElement:ra,InputMask:Bi,MaskElement:Ya,Masked:Je,MaskedDate:Ot,MaskedDynamic:sa,MaskedEnum:ia,MaskedFunction:Di,MaskedNumber:ut,MaskedPattern:et,MaskedRange:oa,MaskedRegExp:Si,PIPE_TYPE:Za,PatternFixedDefinition:kn,PatternInputDefinition:na,RepeatBlock:Ti,createMask:Ft,createPipe:xn,default:ue,forceDirection:Ci,normalizeOpts:Fl,pipe:Mi},Symbol.toStringTag,{value:"Module"})),Li={reference:{faq:"FAQ",banner:"Banner",slider:"Slider",video:"Video",about:"About",cards:"Cards",usefulLinks:"Useful Links",team:"Team",body:"Body",news:"News",form:"Form",tabs:"Tabs",vertical_tabs:"Vertical Tabs",documents:"Documents",infoLine:"Information Line",interested:"You may be interested",contact:"Contact"},navigation:{editMenu:"Edit Menu",dashboard:"Dashboard",collections:"Collections Structure",articles:"Articles",posts:"Posts",media:"Media",permissions:"Permissions",tags:"Tags",singletons:"Pages",feedback:"Feedback",email:"Пошти користувачів",singletonsMenu:"Menu",menuAdd:"Create Menu",builder:"Collections Structure",back:"Back",settings:"Settings",settingsDescription:"Manage your CMS configuration",singletonsMenuDescription:"Manage your menu.",users:"Users",general:"General",apiKeys:"API Keys",appearance:"Appearance",logs:"Logs"},dashboard:{title:"Dashboard",newCollection:"Create Collection",quickActions:"Quick Actions",views:"views",stats:{totalArticles:"Total Articles",totalMedia:"Total Media",activeUsers:"Active Users",apiRequests:"API Requests",fromLastMonth:"from last month"},collections:{title:"Collections",articles:"Articles",articlesDesc:"Description for articles",posts:"Posts",postsDesc:"Description for posts",products:"Products",productsDesc:"Description for products",categories:"Categories",categoriesDesc:"Description for categories",items:"items",new:"New Collection"},recentArticles:"Recent Articles",recentPosts:"Recent Posts",activeUsers:"Active Users",mediaFiles:"Media Files",createArticle:"Create Article",createPost:"Create Post",uploadMedia:"Upload Media",manageUsers:"Manage Users",feedback:"Feedback",createArticleDescription:"Create a new article for your site",uploadMediaDescription:"Upload media files for your site",manageUsersDescription:"Manage users for your site",viewFeedbackDescription:"View feedback for your site",activityFeed:"Activity Feed",viewAll:"View all",description:"Welcome to the CMS dashboard. You can create, edit, and manage your site's content.",newArticle:"Create Article",totalContent:"Total Content",articlesPostsPages:"Articles, Posts and Pages",monthlyActiveUsers:"Monthly Active Users",imagesVideosDocs:"Images, Videos and Docs",thisMonth:"This Month",newMediaFiles:"New Media Files",gettingStartedWithNextJs14:"Getting Started with Next.js 14",sarahJohnson:"Sarah Johnson",advancedReactPatterns:"Advanced React Patterns",uiUxDesignPrinciples:"UI/UX Design Principles",databaseOptimizationTips:"Database Optimization Tips",mikeChen:"Mike Chen",emmaWilson:"Emma Wilson",alexRodriguez:"Alex Rodriguez",recentContent:"Recent Content"},collections:{title:"Collections",selectCollection:"Select a collection to view its content",createCollection:"New Collection",searchCollections:"Search collections...",entries:"Entries",fields:"Fields",lastModified:"Last Modified",edit:"Edit",delete:"Delete",view:"View",form:{name:"Collection Name",slug:"Slug",description:"Description",fields:"Fields",addField:"Add Field"},dragToBuild:"Drag and drop content blocks here to build your collection structure",collectionCreated:"Collection created successfully",collectionCreationFailed:"Error creating collection",pinPublication:"Pin Publication"},articles:{title:"Articles",createArticle:"Create Article",searchArticles:"Search articles...",showColumns:"Show columns",update:"Update",create:"Create",form:{title:"Title",content:"Content",author:"Author",category:"Category",status:"Status"}},posts:{title:"Posts",createPost:"Create Post",searchPosts:"Search posts...",form:{title:"Title",content:"Content",author:"Author",category:"Category",status:"Status"}},singletons:{title:"Singletons",createSingleton:"Create Singleton",searchSingletons:"Search singletons...",form:{name:"Name",description:"Description",content:"Content",status:"Status"},search:"Search singletons..."},media:{title:"Media Library",description:"Manage your images, documents, and media files.",uploadMedia:"Upload Media",searchMedia:"Search files...",fileInfo:"File Information",preview:"Preview",newFolder:"New Folder",selectFile:"Select a file to view details",fileDetails:"File Details",name:"Name",size:"Size",dimensions:"Dimensions",uploadDate:"Upload Date",author:"Author",tags:"Tags",banner:"Banner",hero:"Hero",homepage:"Homepage",download:"Download",copyPath:"Copy path",copyPathFailed:"Failed to copy path",delete:"Delete",edit:"Edit",share:"Share",moreActions:"More actions",deleteFile:"Delete File",cancel:"Cancel",mediaLibrary:"Media Library",showColumns:"Show columns",update:"Update",create:"Create",createFolder:"Create Folder",files:"files",noFilesInFolder:"No files in this folder",deleteConfirmation:"Are you sure you want to delete this file?",uploaded:"Uploaded",filter:"Filter",search:"Search media files...",uploadingFiles:"Uploading files",uploading:"Uploading...",folder:"Folder",updatedAt:"Updated At",type:"Type",sortBy:{title:"Sort by",name:"File name",filesize:"File size"},upload:"Upload",selectFromMedia:"Select from media",selectedFiles:"Selected files: {count}",selectFiles:"Select files"},tags:{title:"Tags",description:"Manage your tags.",createTag:"Create Tag",editTag:"Edit Tag",searchTags:"Search tags...",form:{name:"Name",description:"Description",color:"Color",created_at:"Created At",count_data:"Count of Used",topic:"Topic"},emptyTitle:"No tags found",emptyDescription:"Create your first tag to get started.",emptyButton:"Create Tag"},feedback:{title:"Feedback",description:"View feedback",table:{number:"№",noFeedback:"No feedback",email:"Email",userName:"Full name",messageText:"Message text",feedbackType:"Type of appeal",phone:"Phone",resumeLink:"Resume link",linkedinLink:"Linkedin link",portfolioLink:"Portfolio link",telegramLink:"Telegram link"}},email:{title:"User mails",description:"View users awaiting feedback",table:{number:"№",date:"Date of shipment",email:"Email"}},emptyData:{title:"No data found",description:"Create your first item to get started.",buttonText:"Create Item"},form:{gen:"Generate",key:"Key",value:"Value",noDataToDisplay:"No data to display",add:"Add"},builder:{manageContentCollections:"Manage content collections",searchCollections:"Search collections...",collections:"Collections",collectionStructure:"Collection Structure",defineFields:"Define the fields and their types for this collection",name:"Name",edit:"Edit",preview:"Preview",type:"Type",content:"Content",seo:"SEO",tags:"Tags",save:"Save",cancel:"Cancel",create:"Create",localization:"Localization",actions:"Actions",noColumnsFound:"No columns found",collectionName:"Collection Name",title:"Title",entries:"Entries",fields:"Fields",status:"Status",lastModified:"Last Modified",editCollection:"Edit collection",editContentForYourSite:"Edit content for your site",deleteObject:"Are you sure you want to delete this object?",editField:"Edit field",deleteTitle:"Delete field",deleteField:"Are you sure you want to delete this field?",scheme:{name:{label:"Name",placeholder:"Name"},title:{label:"Title",placeholder:"Title"},type:{label:"Type",placeholder:"Type",options:{collection:"Collection",single:"Single"}},customTable:{label:"Custom Table"},status:{label:"Status",placeholder:"Status",options:{published:"Published",draft:"Draft",archived:"Archived"}},description:{label:"Description",placeholder:"Description"},preview_path:{label:"Preview path",placeholder:"Preview path",info:"Path to slug for preview"},include_search:{label:"Include in search?",placeholder:"Include in search?"}},required:"Required field",createField:"Create field",selectType:"Select type",createFolder:"Create folder",changeType:"Change type",fieldLabels:{name:"Name",label:"Label",placeholder:"Placeholder",help:"Help",type:"Type",subtype:"Subtype",parent:"Parent",options:"Options",colModel:"ColModel",multiple:"Multiple",api:"API",relation:"Relation",required:"Required",localization:"Localization"},fieldPlaceholders:{name:"Name",label:"Title",placeholder:"Placeholder",help:"Help",type:"Type",subtype:"Subtype",parent:"Parent",options:"Options",colModel:"ColModel",api:"API",relation:"Relation"},fieldOptions:{text:"Text",number:"Number",integer:"Integer",date:"Date",datetime:"Datetime",file:"File",select:"Select",multiselect:"MultiSelect",mediaselect:"MediaSelect",radio:"Radio",boolean:"Boolean",datalist:"Data list",image:"Image",slug:"Slug",richtext:"Rich Text",markdown:"Markdown",reference:"Reference",relation:"Relation",fileList:"Gallery",tags:"Tags"}},menu:{title:"Menu",description:"Manage your menu.",createMenu:"Create Menu",searchMenu:"Search menu...",menuAdd:"Add Menu",editMenu:"Edit Menu",textEditor:"Text Editor",listTree:"List Tree",filter:"Filter",search:"Search menu...",menuCreated:"Menu created",menuCreateError:"Error creating menu",menuUpdated:"Menu updated",menuUpdateError:"Error updating menu",menuDeleted:"Menu deleted",menuDeleteError:"Error deleting menu",form:{name:"Name",description:"Description",content:"Content",status:"Status",value:"Value",language:"Language"}},settings:{title:"Settings",description:"Configure your CMS settings and preferences.",systemStatus:"System Status",siteInformation:"Site Information",siteName:"Site Name",version:"Version",environment:"Environment",security:"Security",localization:"Localization",production:"Production",systemHealth:"System Health",database:"Database",connected:"Connected",cache:"Cache",active:"Active",storage:"Storage",used:"Used",configure:"Configure",successTitle:"Success",successMessage:"Settings saved successfully",errorTitle:"Error",errorMessage:"Error saving settings",generateNewKey:"Generate New Key",apiSecurity:"API Security",general:{general:"General Settings",generalDescription:"Manage your general settings.",url:"URL",language:"Language",languages:"Languages",contacts:"Contacts",showSocialsNumber:"Number of socials to display",mapCoords:"Map coordinates",socials:"Socials",saveChanges:"Save Changes",cancel:"Cancel",notifications:"Notifications",emailNotifications:"Email Notifications",emailNotificationsDescription:"Receive notifications by email",pushNotifications:"Browser Notifications",pushNotificationsDescription:"Browser notifications for important updates",smsNotifications:"SMS Notifications",smsNotificationsDescription:"SMS notifications for critical updates",desktopNotifications:"Desktop Notifications",desktopNotificationsDescription:"Desktop notifications",siteDescription:"Site Description",siteUrl:"Site URL",siteLanguage:"Site Language",siteEmail:"Site Email",sitePhone:"Site Phone",siteAddress:"Site Address",siteName:"Site Name",title:"Title",content:"Content",name:"Name",siteInformation:"Site Information",logoSite:"Site Logo",logoCms:"CMS Logo",imageLogin:"Login Image",logo:"Logo",siteInformationDescription:"Manage your site information."},users:{users:"User Management",usersDescription:"Manage your user management configuration.",userRegistration:"User Registration",allowRegistration:"Allow User Registration",allowRegistrationDescription:"Enable new users to register accounts",emailVerification:"Email Verification Required",emailVerificationDescription:"Require email verification for new accounts",autoApprove:"Auto-approve Users",autoApproveDescription:"Automatically approve new user registrations",defaultRole:"Default User Role"},"api-keys":{apiKeys:"API Keys",apiKeysDescription:"Manage your api keys configuration.",productionApiKey:"Production API Key",developmentApiKey:"Development API Key",generateNewKey:"Generate New Key",apiSecurity:"API Security",rateLimiting:"Rate Limiting",rateLimitingDescription:"Enable API rate limiting protection",corsProtection:"CORS Protection",corsProtectionDescription:"Cross-origin request security",apiLogging:"API Logging",apiLoggingDescription:"Log all API requests and responses"},appearance:{appearance:"Appearance",appearanceDescription:"Manage your appearance settings.",colorTheme:"Color Theme",darkMode:"Dark Mode",darkModeDescription:"Switch to dark theme",compactMode:"Compact Mode",compactModeDescription:"Reduce spacing and padding",animations:"Animations",animationsDescription:"Enable interface animations",themeBlue:"Blue",themeGreen:"Green",themePurple:"Purple"},logs:{title:"Logs",description:"View all your actions in the system",table:{objectId:"Object Identifier",dateTime:"Date and Time of Change",changeType:"Change Type",noLogs:"No user logs found",noLogsDescription:"No user logs found"}},permissions:{title:"Permissions",user:"User",role:"Role",lastActive:"Last Active",actions:"Actions",rolePermissions:"Role Permissions",rolePermissionsDescription:"Permissions assigned to each role in the system.",permission:"Permission",admin:"Admin",editor:"Editor",author:"Author",viewer:"Viewer",customizePermissions:"Customize Permissions",inviteUser:"Invite User",searchUsers:"Search users...",createContent:"Create Content",editContent:"Edit Content",deleteContent:"Delete Content",publishContent:"Publish Content",manageMedia:"Manage Media",manageUsers:"Manage Users",manageSettings:"Manage Settings",remove:"Remove",edit:"Edit",time:{hoursAgo:"{count} hours ago",hourAgo:"1 hour ago",daysAgo:"{count} days ago",dayAgo:"1 day ago",weeksAgo:"{count} weeks ago",weekAgo:"1 week ago",minutesAgo:"{count} minutes ago",minuteAgo:"1 minute ago",justNow:"just now"},roles:{admin:"Admin",editor:"Editor",author:"Author",viewer:"Viewer"}}},block:{type:{heading:"Heading",paragraph:"Paragraph"}},app:{name:"SOFTPRO software package: GIS MBK Kamyansk City TG",tagline:"Do more with less"},nav:{home:"Home",about:"About",profile:"Profile",settings:"Settings",logout:"Log out"},common:{ok:"OK",save:"Save",cancel:"Cancel",close:"Close",delete:"Delete",edit:"Edit",loading:"Loading…",retry:"Retry",title:"Title",description:"Description",keywords:"Keywords",successMessage:"Success",errorMessage:"Error",success:"Success",error:"Error",meta:"Meta",actions:{add:"Add",save:"Save",cancel:"Cancel",edit:"Edit",delete:"Delete",create:"Create",preview:"Preview",search:"Search",filter:"Filter",export:"Export",addField:"Add Field",success:"Success",error:"Error",back:"Back"},status:{published:"Published",draft:"Draft",archived:"Archived"},content:"Content",pagination:{showing:"Showing",to:"to",of:"of",results:"results",previous:"Previous",next:"Next"}},auth:{title:"Sign in",email:"Email",password:"Password",remember:"Remember me",submit:"Sign in",errors:{invalid:"Invalid email or password",required:"{field} is required"}},table:{choose:"Choose columns to display",columns:"Columns",actions:"Actions",search:"Search",export:"Export",exportTitle:"Export table",close:"Close",chooseColumns:"Select columns for export:",selectAll:"Select all",selectCurrent:"Select current",none:"None",chooseFormat:"Choose table format:",time:{weeksAgo:"{count} weeks ago",weekAgo:"1 week ago",daysAgo:"{count} days ago",dayAgo:"1 day ago",hoursAgo:"{count} hours ago",hourAgo:"1 hour ago",minutesAgo:"{count} minutes ago",minuteAgo:"1 minute ago",justNow:"just now"},format:{json:"JSON format",csv:"CSV format",xlsx:"XLSX format"},cancel:"Cancel",download:"Download table"},filter:{search:"Search",more:"Show more",less:"Show less",selected:"selected",clear:"Clear",apply:"Apply",from:"From",to:"To",notfound:"Nothing found",period:"Period",today:"Today",week:"Week",month:"Month",quarter:"Quarter",year:"Year",alltime:"All Time",prev:"Prev",next:"Next"},items:{title:"Items",add:"Add item",count:"No items | One item | {count} items",created:"Item “{name}” has been created",deleted:"Item deleted"},errors:{network:"Network error. Please try again.",notFound:"We couldn't find what you were looking for."},toast:{saved:"Changes saved",copied:"Copied to clipboard"},users:{title:"Users",description:"Manage your users.",createUser:"Create User",editUser:"Edit User",searchUsers:"Search users...",createUserFailed:"Create user failed",createUserSuccess:"User created successfully",editUserFailed:"Edit user failed",editUserSuccess:"User edited successfully",deleteUserSuccess:"User deleted successfully",deleteUserFailed:"User deleted failed",form:{name:"Name",description:"Description",color:"Color",created_at:"Created At",count_data:"Count of Used",topic:"Topic"},emptyTitle:"No users found",emptyDescription:"Create your first user to get started.",emptyButton:"Create User"},fetchContentTypes:"fetchContentTypes",action:"action",delete:"delete","create-folder":"create-folder",formValues:"formValues",metaParentValue:"metaParentValue",blur:"blur","-":"-",noFilesInFolder:"noFilesInFolder",guide:{menu:"Guide for menu",general:"Guide",media:"Guide for media",settings:"Guide for settings",users:"Guide for users",content:"Guide for content",appOverview:"Guide for app overview",collections:"Guide for collections",help:"Help"}},a4=Object.freeze(Object.defineProperty({__proto__:null,cms:Li,default:{cms:Li}},Symbol.toStringTag,{value:"Module"})),$i={reference:{faq:"Акордeон",photoGrid:"Фотогалерея",banner:"Банер",slider:"Слайдер",video:"Відео",about:"Про нас",cards:"Картки",usefulLinks:"Корисні посилання",team:"Команда",body:"Тіло",news:"Новини",form:"Форма",tabs:"Таби",vertical_tabs:"Вертикальні таби",documents:"Документи",infoLine:"Інформаційна лінія",iframe:"Iframe",interested:"Вас може зацікавити",contact:"Контакти"},navigation:{editMenu:"Редагувати меню",dashboard:"Панель керування",collections:"Керування контентом",articles:"Статті",posts:"Дописи",media:"Медіа",permissions:"Дозволи",tags:"Теги",singletons:"Сторінки",singletonsMenu:"Меню",feedback:"Зворотній зв'язок",email:"Пошти користувачів",menuAdd:"Створити меню",builder:"Структура колекцій",back:"Назад",settings:"Налаштування",settingsDescription:"Налаштування вашого сайту",singletonsMenuDescription:"Керування меню.",users:"Користувачі",general:"Основні",apiKeys:"API ключі",appearance:"Вигляд",logs:"Логи"},dashboard:{title:"Панель керування",description:"Вітаємо в панелі керування CMS. Ви можете створювати, редагувати та управляти контентом вашого сайту.",newCollection:"Створити колекцію",quickActions:"Швидкі дії",views:"переглядів",stats:{totalArticles:"Всього статей",totalMedia:"Всього медіа",activeUsers:"Активні користувачі",apiRequests:"API запити",fromLastMonth:"з минулого місяця"},collections:{title:"Колекції",articles:"Статті",articlesDesc:"Опис для статей",posts:"Дописи",postsDesc:"Опис для дописів",products:"Продукти",productsDesc:"Опис для продуктів",categories:"Категорії",categoriesDesc:"Опис для категорій",items:"шт.",new:"Нова колекція"},recentArticles:"Останні статті",recentPosts:"Останні дописи",recentContent:"Останній контент",activityFeed:"Стрічка активності",viewAll:"Показати все",totalContent:"Всього контенту",articlesPostsPages:"Статті, дописи та сторінки",monthlyActiveUsers:"Активних користувачів за місяць",imagesVideosDocs:"Зображення, відео та документи",thisMonth:"Цього місяця",activeUsers:"Активні користувачі",mediaFiles:"Файли медіа",createArticle:"Створити статтю",createPost:"Створити допис",uploadMedia:"Завантажити медіа",createArticleDescription:"Створіть статтю для вашого сайту",uploadMediaDescription:"Завантажте медіа файли для вашого сайту",manageUsersDescription:"Керуйте користувачами вашого сайту",viewFeedbackDescription:"Перегляд зворотнього зв'язку",manageUsers:"Керування користувачами",feedback:"Зворотній зв'язок",newMediaFiles:"Нових файлів медіа",gettingStartedWithNextJs14:"Початок роботи з Next.js 14",sarahJohnson:"Sarah Johnson",advancedReactPatterns:"Підвищені шаблони React",uiUxDesignPrinciples:"Принципи дизайну UI/UX",databaseOptimizationTips:"Поради з оптимізації бази даних",mikeChen:"Mike Chen",emmaWilson:"Emma Wilson",alexRodriguez:"Alex Rodriguez"},collections:{title:"Колекції",selectCollection:"Виберіть колекцію для перегляду її контенту",createCollection:"Створити колекцію",searchCollections:"Пошук колекцій...",entries:"Записи",fields:"Поля",lastModified:"Останнє редагування",edit:"Редагувати",delete:"Видалити",view:"Перегляд",form:{name:"Назва колекції",slug:"Слаг",description:"Опис",fields:"Поля",addField:"Додати поле"},dragToBuild:"Перетягніть блоки контенту сюди, щоб створити структуру колекції",collectionCreated:"Колекція успішно створена",collectionCreationFailed:"Помилка при створенні колекції",pinPublication:"Закріпити публікацію"},articles:{title:"Сторінки",createArticle:"Створити сторінку",searchArticles:"Пошук статей...",showColumns:"Показати колонки",update:"Оновити",create:"Створити",form:{title:"Заголовок",content:"Зміст",author:"Автор",category:"Категорія",status:"Статус"}},posts:{title:"Дописи",createPost:"Створити допис",searchPosts:"Пошук дописів...",form:{title:"Заголовок",content:"Зміст",author:"Автор",category:"Категорія",status:"Статус"}},singletons:{title:"Синглтони",createSingleton:"Створити синглтон",searchSingletons:"Пошук синглтонів...",form:{name:"Назва",description:"Опис",content:"Зміст",status:"Статус"},search:"Пошук синглтонів..."},media:{title:"Медіа бібліотека",description:"Керуйте своїми зображеннями, документами та медіа файлами.",uploadMedia:"Завантажити медіа",searchMedia:"Пошук файлів...",fileInfo:"Інформація про файл",preview:"Перегляд",newFolder:"Нова папка",selectFile:"Виберіть файл для перегляду деталей",fileDetails:"Інформація про файл",name:"Назва",size:"Розмір",dimensions:"Розміри",uploadDate:"Дата завантаження",author:"Автор",tags:"Теги",banner:"Банер",hero:"Герой",homepage:"Головна",download:"Завантажити",copyPath:"Копіювати шлях",copyPathFailed:"Не вдалося скопіювати шлях",delete:"Видалити",edit:"Редагувати",share:"Поділитися",moreActions:"Більше дій",deleteFile:"Ви впевнені, що хочете видалити цей файл?",createFolder:"Створити папку",cancel:"Скасувати",mediaLibrary:"Медіа бібліотека",files:"файлів",noFilesInFolder:"Немає файлів у цій папці",deleteConfirmation:"Ви впевнені, що хочете видалити цей файл?",uploaded:"Завантажено",filter:"Фільтр",search:"Пошук файлів...",uploadingFiles:"Завантаження файлів",uploading:"Завантаження...",folder:"Папка",type:"Тип",updatedAt:"Оновлено",sortBy:{title:"Сортувати за",name:"Назва файлу",filesize:"Розмір файлу"},upload:"Завантажити",selectFromMedia:"Вибрати з медіа",selectFiles:"Вибрати файли",selectedFiles:"Вибрано файлів: {count}"},tags:{title:"Теги",description:"Керування тегами.",createTag:"Створити тег",editTag:"Редагувати тег",searchTags:"Пошук тегів...",form:{name:"Назва",description:"Опис",color:"Колір",slug:"Slug",created_at:"Дата створення",count_data:"Кількість використань",topic:"Тема"},emptyTitle:"Теги не знайдені",emptyDescription:"Створіть свій перший тег, щоб почати.",emptyButton:"Створити тег"},feedback:{title:"Зворотній зв'язок",description:"Переглядайте зворотній зв'язок",table:{number:"№",noFeedback:"Фідбек відсутній",email:"Email",userName:"ПІБ",messageText:"Текст повідомлення",feedbackType:"Тип звернення",cdate:"Дата відгуку",phone:"Телефон",resumeLink:"Посилання на резюме",linkedinLink:"Посилання на лінкедин",portfolioLink:"Посилання на портфоліо",telegramLink:"Посилання на телеграм"}},email:{title:"Пошти користувачів",description:"Переглядайте користувачів, які очікують зворотнього зв'язку",table:{number:"№",date:"Дата відправки",email:"Email"}},emptyData:{title:"Немає даних",description:"Створіть свій перший елемент, щоб почати.",buttonText:"Створити елемент"},form:{gen:"Згенерувати",key:"Ключ",value:"Значення",noDataToDisplay:"Дані для відображення відсутні",add:"Додати"},builder:{faq:"Акордeон",photoGrid:"Фотогалерея",banner:"Банер",slider:"Слайдер",video:"Відео",about:"Про нас",cards:"Картки",usefulLinks:"Корисні посилання",team:"Команда",body:"Тіло",news:"Новини",form:"Форма",tabs:"Таби",vertical_tabs:"Вертикальні таби",documents:"Документи",infoLine:"Інформаційна лінія",iframe:"Iframe",manageContentCollections:"Керування колекціями контенту",searchCollections:"Пошук колекцій...",collections:"Структура колекцій",collectionStructure:"Структура колекції",defineFields:"Визначте поля та їх типи для цієї колекції",name:"Назва",changeType:"Змінити тип",type:"Тип",save:"Зберегти",edit:"Редагувати",content:"Контент",seo:"SEO",tags:"Теги",preview:"Перегляд",collectionName:"Назва колекції",title:"Заголовок",entries:"Записи",fields:"Поля",status:"Статус",lastModified:"Останнє редагування",cancel:"Скасувати",create:"Створити",localization:"Локалізація",actions:"Дії",noColumnsFound:"Немає колонок",editCollection:"Редагувати колекцію",editContentForYourSite:"Редагувати контент для вашого сайту",deleteObject:"Ви впевнені, що хочете видалити цей об'єкт?",editField:"Редагувати поле",deleteTitle:"Видалити поле",deleteField:"Ви впевнені, що хочете видалити це поле?",scheme:{name:{label:"Назва",placeholder:"Назва"},title:{label:"Заголовок",placeholder:"Заголовок"},type:{label:"Тип",placeholder:"Тип",options:{collection:"Колекція",single:"Сторінка"}},customTable:{label:"Власна таблиця"},status:{label:"Статус",placeholder:"Статус",options:{published:"Опубліковано",draft:"Чернетка",archived:"Архівовано"}},description:{label:"Опис",placeholder:"Опис"},preview_path:{label:"Шлях для прев'ю",placeholder:"Шлях для прев'ю",info:"Шлях до slug для прев'ю"},include_search:{label:"Включити в пошук?",placeholder:"Включити в пошук?"}},required:"Обов'язкове поле",createField:"Створити поле",selectType:"Оберіть тип",createFolder:"Створити папку",fieldLabels:{name:"Назва",label:"Мітка",placeholder:"Плейсхолдер",help:"Допомога",type:"Тип",subtype:"Підтип",parent:"Батьківський",data:"ID класифікатора",options:"Опції",colModel:"Модель колонок",multiple:"Множинний",api:"API",relation:"Зв'язок",required:"Обов'язковий",localization:"Локалізація"},fieldPlaceholders:{name:"Назва",label:"Заголовок",placeholder:"Плейсхолдер",help:"Допомога",type:"Тип",subtype:"Підтип",parent:"Батьківський",data:"ID класифікатора",options:"Опції",colModel:"Модель колонок",api:"API",relation:"Зв'язок"},fieldOptions:{text:"Текст",number:"Число",integer:"Ціле число",date:"Дата",datetime:"Дата і час",file:"Файл",select:"Селект",multiselect:"Мультиселект",mediaselect:"Вибір медіа",radio:"Радіо",boolean:"Булевий",datalist:"Дататейбл",image:"Зображення",slug:"Слаг",richtext:"Текстовий редактор",markdown:"Markdown",reference:"Секції",relation:"Зв'язок",fileList:"Мультифайл",tags:"Теги"}},menu:{title:"Меню",description:"Керування меню.",createMenu:"Створити меню",searchMenu:"Пошук меню...",menuAdd:"Додати меню",editMenu:"Редагувати меню",textEditor:"Текстовий редактор",menuCreated:"Меню створено",menuCreateError:"Помилка при створенні меню",menuUpdated:"Меню оновлено",menuUpdateError:"Помилка при оновленні меню",menuDeleted:"Меню видалено",menuDeleteError:"Помилка при видаленні меню",listTree:"Список дерева",filter:"Фільтр",search:"Пошук меню...",form:{name:"Назва",description:"Опис",content:"Зміст",status:"Статус",value:"Значення",language:"Мова"}},settings:{title:"Налаштування",description:"Налаштуйте ваші налаштування CMS та налаштування.",systemStatus:"Статус системи",siteInformation:"Інформація про сайт",logo:"Логотип",siteName:"Назва сайту",version:"Версія",environment:"Середовище",security:"Безпека",localization:"Локалізація",production:"Виробництво",systemHealth:"Здоров'я системи",database:"База даних",connected:"З'єднано",cache:"Кеш",active:"Активний",storage:"Хмарне сховище",used:"Використано",configure:"Налаштувати",successTitle:"Успішно",successMessage:"Налаштування успішно збережено",errorTitle:"Помилка",errorMessage:"Помилка при збереженні налаштувань",generateNewKey:"Згенерувати новий ключ",apiSecurity:"Безпека API",general:{general:"Основні налаштування",generalDescription:"Керуйте вашими загальними налаштуваннями.",url:"URL",language:"Мова",languages:"Мови",contacts:"Контакти",socials:"Соціальні мережі",showSocialsNumber:"Кількість соціальних мереж для відображення",mapCoords:"Координати для відображення на карті",saveChanges:"Зберегти зміни",cancel:"Скасувати",notifications:"Сповіщення",emailNotifications:"Сповіщення по email",emailNotificationsDescription:"Отримувати сповіщення по email",pushNotifications:"Сповіщення в браузері",pushNotificationsDescription:"Сповіщення в браузері для важливих оновлень",smsNotifications:"Сповіщення по SMS",smsNotificationsDescription:"Сповіщення по SMS для критичних оновлень",desktopNotifications:"Сповіщення на комп'ютері",desktopNotificationsDescription:"Сповіщення на комп'ютері",siteName:"Назва сайту",siteDescription:"Опис сайту",siteUrl:"URL сайту",previewUrl:"URL попереднього перегляду",logoSite:"Логотип сайту",logoCms:"Логотип CMS",imageLogin:"Зображення для входу",siteLanguage:"Мова сайту",siteEmail:"Email сайту",sitePhone:"Телефон сайту",siteAddress:"Адреса сайту",siteInformation:"Інформація про сайт",logo:"Логотип",siteInformationDescription:"Керуйте вашою інформацією про сайт.",title:"Заголовок",content:"Контент",name:"Назва соцмережі"},users:{users:"Керування користувачами",usersDescription:"Керуйте налаштуваннями керування користувачами.",userRegistration:"Реєстрація користувачів",allowRegistration:"Дозволити реєстрацію користувачів",allowRegistrationDescription:"Дозволити новим користувачам реєструвати акаунти",emailVerification:"Потрібна верифікація email",emailVerificationDescription:"Вимагати підтвердження email для нових акаунтів",autoApprove:"Автоматичне схвалення користувачів",autoApproveDescription:"Автоматично схвалювати нові реєстрації користувачів",defaultRole:"Роль за замовчуванням"},"api-keys":{apiKeys:"API ключі",apiKeysDescription:"Керуйте налаштуваннями API ключів.",productionApiKey:"Production API ключ",developmentApiKey:"Development API ключ",generateNewKey:"Згенерувати новий ключ",apiSecurity:"Безпека API",rateLimiting:"Обмеження швидкості",rateLimitingDescription:"Увімкнути захист обмеження швидкості API",corsProtection:"Захист CORS",corsProtectionDescription:"Безпека крос-доменних запитів",apiLogging:"Логування API",apiLoggingDescription:"Логувати всі API запити та відповіді"},appearance:{appearance:"Вигляд",appearanceDescription:"Керуйте вашим виглядом та налаштуваннями.",colorTheme:"Кольорова тема",darkMode:"Темний режим",darkModeDescription:"Перемкнути на темну тему",compactMode:"Компактний режим",compactModeDescription:"Зменшити відступи та поля",animations:"Анімації",animationsDescription:"Увімкнути анімації інтерфейсу",themeBlue:"Синя",themeGreen:"Зелена",themePurple:"Фіолетова"},logs:{title:"Логи",description:"Переглядай всі свої дії в системі",table:{number:"№",objectId:"Ідентифікатор об'єкта",dateTime:"Дата та час зміни",changeType:"Тип зміни",noLogs:"Логи користувача відсутні"}},permissions:{title:"Дозволи",user:"Користувач",role:"Роль",lastActive:"Остання активність",actions:"Дії",rolePermissions:"Дозволи ролі",rolePermissionsDescription:"Дозволи, призначені для кожної ролі в системі.",permission:"Дозвіл",admin:"Адміністратор",editor:"Редактор",author:"Автор",viewer:"Переглядач",customizePermissions:"Налаштувати дозволи",inviteUser:"Запросити користувача",searchUsers:"Пошук користувачів...",createContent:"Створити контент",editContent:"Редагувати контент",deleteContent:"Видалити контент",publishContent:"Опублікувати контент",manageMedia:"Керування медіа",manageUsers:"Керування користувачами",manageSettings:"Керування налаштуваннями",remove:"Вилучити",edit:"Редагувати",time:{hoursAgo:"{count} годин тому",hourAgo:"1 година тому",daysAgo:"{count} днів тому",dayAgo:"1 день тому",weeksAgo:"{count} тижнів тому",weekAgo:"1 тиждень тому",minutesAgo:"{count} хвилин тому",minuteAgo:"1 хвилина тому",justNow:"щойно"},roles:{admin:"Адміністратор",editor:"Редактор",author:"Автор",viewer:"Переглядач"}}},block:{type:{heading:"Заголовок",paragraph:"Параграф"}},app:{name:"Програмний комплекс SOFTPRO: ГІС МБК Кам'янської міської ТГ",tagline:"Зробіть більше з меншим"},nav:{home:"Домашній",about:"Про",profile:"Профіль",settings:"Налаштування",logout:"Вихід"},common:{ok:"Добре",save:"Зберегти",cancel:"Скасувати",close:"Закрити",delete:"Вилучити",edit:"Редагувати",loading:"Завантаження…",retry:"Повторити",title:"Назва",description:"Опис",keywords:"Ключові слова",success:"Успіх",error:"Помилка",successMessage:"Успішно",errorMessage:"Помилка",meta:"Мета",content:"Контент",actions:{add:"Додати",save:"Зберегти",cancel:"Скасувати",edit:"Редагувати",delete:"Видалити",create:"Створити",preview:"Перегляд",search:"Пошук",filter:"Фільтр",export:"Експорт",addField:"Додати поле",success:"Успіх",error:"Помилка",back:"Повернутися"},status:{published:"Опубліковано",draft:"Чернетка",archived:"Архівовано"},pagination:{showing:"Показано",to:"по",of:"з",results:"результатів",previous:"Попередня",next:"Наступна"}},auth:{title:"Увійти",email:"Електронна пошта",password:"Пароль",remember:"Пам'ятайте мене",submit:"Увійти",errors:{invalid:"Недійсний електронний лист або пароль",required:"{Поле} потрібно"}},table:{choose:"Оберіть колонки для відображення",columns:"Колонки",actions:"Дії",search:"Пошук",export:"Експорт",exportTitle:"Експорт таблиці",close:"Закрити",chooseColumns:"Виберіть стовпці таблиці для експорту:",selectAll:"Вибрати усі",selectCurrent:"Вибрати поточні",none:"Жодного",chooseFormat:"Виберіть формат таблиці:",cancel:"Скасувати",download:"Завантажити таблицю",time:{weeksAgo:"{count} тижнів тому",weekAgo:"1 тиждень тому",daysAgo:"{count} днів тому",dayAgo:"1 день тому",hoursAgo:"{count} годин тому",hourAgo:"1 година тому",minutesAgo:"{count} хвилин тому",minuteAgo:"1 хвилина тому",justNow:"щойно"},format:{json:"Формат json",csv:"Формат csv",xlsx:"Формат xlsx"}},filter:{search:"Пошук",more:"Показати більше",less:"Показати меньше",selected:"обрано",clear:"Очистити",apply:"Застосувати",from:"Від",period:"Період",today:"Сьогодні",week:"Тиждень",month:"Місяць",quarter:"Квартал",year:"Рік",alltime:"Весь час",prev:"Попередній період",next:"Настпуний період",to:"До",notfound:"Нічого не знайдено"},items:{title:"Предмети",add:"Додати елемент",count:"Немає предметів | ",created:`Елемент "{Ім'я}" створений`,deleted:"Елемент видалено"},errors:{network:"Помилка мережі. ",notFound:"Ми не змогли знайти те, що ви шукали."},toast:{saved:"Збережені зміни",copied:"Скопіювано в буфер обміну"},users:{title:"Користувачі",description:"Керування користувачами.",createUser:"Створити користувача",editUser:"Редагувати користувача",searchUsers:"Пошук користувачів...",createUserFailed:"Створити користувача не вдалося",createUserSuccess:"Користувача створено успішно",editUserFailed:"Редагувати користувача не вдалося",editUserSuccess:"Користувача редаговано успішно",deleteUserSuccess:"Користувача видалено успішно",deleteUserFailed:"Користувача видалено не вдалося",form:{name:"Назва",description:"Опис",color:"Колір",created_at:"Дата створення",count_data:"Кількість використань",topic:"Тема"}},fetchContentTypes:"fetchContentTypes",action:"action",delete:"delete","create-folder":"create-folder",formValues:"formValues",metaParentValue:"metaParentValue",blur:"blur","-":"-",noFilesInFolder:"noFilesInFolder",guide:{menu:"Посібник з меню",general:"Посібник",media:"Посібник з медіа",settings:"Посібник з налаштувань",users:"Посібник з користувачів",content:"Посібник з контенту",appOverview:"Посібник з огляду програми",collections:"Посібник з колекцій",help:"Допомога"}},r4=Object.freeze(Object.defineProperty({__proto__:null,cms:$i,default:{cms:$i}},Symbol.toStringTag,{value:"Module"}));qe.ArticlesPage=Vs,qe.BuilderPage=z_,qe.CmsContentWrapper=qB,qe.CollectionsPage=Mr,qe.Dashboard=Ar,qe.EditCollectionPage=gB,qe.default=Ar,qe.i18n=$l,qe.initI18n=YB,qe.install=ZB,qe.loadLocaleMessages=XB,qe.setLocale=KB,Object.defineProperties(qe,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
240
+ `,y.parentNode.appendChild(h)};return e.onMounted(()=>{var p,y;(y=(p=t.value)==null?void 0:p.filter(h=>typeof h=="object"))==null||y.forEach(h=>h.id?h.id:h.id=Math.random().toString(36).substring(2,15))}),(p,y)=>(e.openBlock(),e.createElementBlock("div",CC,[e.createElementVNode("div",VC,[e.createElementVNode("div",NC,[e.createElementVNode("table",vC,[e.createElementVNode("thead",BC,[e.createElementVNode("tr",SC,[y[4]||(y[4]=e.createElementVNode("th",{class:"h-10 px-2 align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] w-12 text-center"},null,-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.colModel,h=>(e.openBlock(),e.createElementBlock("th",{key:h.name,class:"h-10 px-2 text-left align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] font-semibold text-slate-700 dark:text-slate-300 min-w-[150px]"},e.toDisplayString(h.label||h.title||h.name),1))),128)),e.createElementVNode("th",DC,e.toDisplayString(p.$t("cms.table.actions")),1)])]),e.createElementVNode("tbody",AC,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,(h,g)=>(e.openBlock(),e.createElementBlock("tr",{key:h==null?void 0:h.id,class:e.normalizeClass(["border-b data-[state=selected]:bg-muted transition-all duration-200 hover:bg-slate-50/60 dark:hover:bg-slate-700/60 cursor-move",{"opacity-50":a.value===h}]),draggable:"true",onDragstart:b=>o(b,h,g),onDragover:b=>s(b),onDrop:b=>u(b,g),onDragenter:b=>i(b,g),onDragleave:y[2]||(y[2]=b=>c(b))},[e.createElementVNode("td",TC,[e.createElementVNode("div",LC,[e.createVNode(e.unref(Vn))])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.colModel,b=>(e.openBlock(),e.createElementBlock("td",{key:b.name,class:"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] text-slate-600 dark:text-slate-400 text-sm"},[b.type==="Texteditor"?(e.openBlock(),e.createElementBlock("span",{key:0,innerHTML:h[b.key]||"-"},null,8,$C)):b.type==="File"?(e.openBlock(),e.createElementBlock("div",FC,[Array.isArray(h[b.key])&&h[b.key].length>0?(e.openBlock(),e.createElementBlock("div",IC,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d(h[b.key]),(w,x)=>(e.openBlock(),e.createElementBlock("div",{key:x,class:"relative w-8 h-8 rounded overflow-hidden bg-gray-100 dark:bg-gray-700 flex-shrink-0"},[e.createElementVNode("img",{src:w,alt:`Image ${x+1}`,class:"w-full h-full object-cover",onError:y[0]||(y[0]=k=>f(k))},null,40,OC)]))),128)),m(h[b.key])>0?(e.openBlock(),e.createElementBlock("span",PC," +"+e.toDisplayString(m(h[b.key])),1)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",RC,[...y[5]||(y[5]=[e.createElementVNode("svg",{class:"w-4 h-4 text-gray-400",fill:"currentColor",viewBox:"0 0 20 20"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M4 3a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V5a2 2 0 00-2-2H4zm12 12H4l4-8 3 6 2-4 3 6z","clip-rule":"evenodd"})],-1)])]))])):(e.openBlock(),e.createElementBlock("span",UC,e.toDisplayString(h[b.key]||"-"),1))]))),128)),e.createElementVNode("td",jC,[e.createVNode(xC,{item:h,colModel:l.colModel,modelValue:t.value,"onUpdate:modelValue":y[1]||(y[1]=b=>t.value=b)},null,8,["item","colModel","modelValue"])])],42,MC))),128)),n.value?(e.openBlock(),e.createElementBlock("tr",zC)):e.createCommentVNode("",!0)])])])]),e.createVNode(EC,{colModel:l.colModel,modelValue:t.value,"onUpdate:modelValue":y[3]||(y[3]=h=>t.value=h)},null,8,["colModel","modelValue"])]))}},ci="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASIAAACbCAIAAABJbgHoAAAGfklEQVR4Ae3d7W6baBSF0d7/7Q6IDxkzmrHEQU2DHZudWH1XflRHcXNqVnka4tL01+qNAIGwwK/wfusJEFjPyexyuUzTNAxD3/dd1/3z/1vXdX3fD8MwTdPlcoFNoFmBlzJblmWapr7vb10d/9j3/TRNy7I0a+3AmxV4MrPr9TqO43FXnz06juP1em1W3IE3KPBMZvM8b1eGn7V0/P6u6+Z5bpDbIbcp8OXMnv4k9jG8cRzbRHfUrQl8LbNhGD7W8sp7hmFoTdzxNijwhcxOb+zWp9IaPO1aO+RHMzvxWvHjZz9Xj62ddq0d70OZzfP8sY1z3+MVkdbOvKaO935m1+v1xdcVHwmy6zqv8jd15jV1sPczi14u7gt06djUmdfUwd7JbFmWfQnp2T0iTZ187RzsncymaUqntd8/TVM79I60HYE7mT14v+I+lVfmvu+P6W93UQ7eCLyxwMd7d48yu1wurzTz3Mce3Mu/LMs4jt3/b88t91EE0gK383Mcx/1XQEeZffMV4+34D64bb42lmewn8LpA13X7l/SOMgvd9nF8DAc3hXzzFezx8/QogWOB/VdAR5n9yGm9f3K/fZ32DX99dwznUQKPC3Rdt53AR5n9yGm9f3Lbs7wNjx+hn0ngHQS2E/gos596otuT+234qefj1yXwnMB2AsvsOUAfReC+wEOZuWi8D+lnEPhc4KHM3u0lkM8PxyME3lHgocze7QX9d4T0nAh8LvBQZu/219M/8tn1c0OPEDgS2P/V1NFLIO92s9U0TT/y5eKRpccI/Emg67r9/UxHma3r+s2fQPZ/AGyfcLfhlW8O+ScK7yOQEvjtm5Heyeybrxv3fwBsde2HZVnmeZ68EXhjgXme9/cNr+u976Hvn3XuIzcTeE7gzmezdV19k4LnZH0UgU3gfma+5c6GZSDwnMD9zNZ19Q3knsP1UQRuAg9llr503P8DOL8xBP4+gUczW9c1dFPIwb/j/Pu4HVGbAl/ILFGaxto87Vo76q9ldu7Vo2vF1s62Zo/3y5ndXhF58aYn/41gsydcmwf+TGbrur5y39Nv96G06e6omxJ4MrObkf/ivalzxcE+LfBSZtuverlcpmkahqHv++16suu6vu+HYZim6eCbnG5LDAT+VoFzMvtbdRwXgVMEZHYKoyUEjgRkdqTjMQKnCMjsFEZLCBwJyOxIx2METhGQ2SmMlhA4EpDZkY7HCJwiILNTGC0hcCTwX2a3/1/QjwQInCuwlSezc2FtI1ACMisLE4GQgMxCsNYSKAGZlYWJQEhAZiFYawmUgMzKwkQgJCCzEKy1BEpAZmVhIhASkFkI1loCJSCzsjARCAnILARrLYESkFlZmAiEBGQWgrWWQAnIrCxMBEICMgvBWkugBGRWFiYCIQGZhWCtJVACMisLE4GQgMxCsNYSKAGZlYWJQEhAZiFYawmUgMzKwkQgJCCzEKy1BEpAZmVhIhASkFkI1loCJSCzsjARCAnILARrLYESkFlZmAiEBGQWgrWWQAnIrCxMBEICMgvBWkugBGRWFiYCIQGZhWCtJVACMisLE4GQgMxCsNYSKAGZlYWJQEhAZiFYawmUgMzKwkQgJCCzEKy1BEpAZmVhIhASkFkI1loCJSCzsjARCAnILARrLYESkFlZmAiEBGQWgrWWQAnIrCxMBEICMgvBWkugBGRWFiYCIQGZhWCtJVACMisLE4GQgMxCsNYSKAGZlYWJQEhAZiFYawmUgMzKwkQgJCCzEKy1BEpAZmVhIhASkFkI1loCJSCzsjARCAnILARrLYESkFlZmAiEBGQWgrWWQAnIrCxMBEICMgvBWkugBGRWFiYCIQGZhWCtJVACMisLE4GQgMxCsNYSKAGZlYWJQEhAZiFYawmUgMzKwkQgJCCzEKy1BEpAZmVhIhASkFkI1loCJSCzsjARCAnILARrLYESkFlZmAiEBGQWgrWWQAnIrCxMBEICMgvBWkugBGRWFiYCIQGZhWCtJVACMisLE4GQgMxCsNYSKAGZlYWJQEhAZiFYawmUgMzKwkQgJCCzEKy1BEpAZmVhIhASkFkI1loCJSCzsjARCAnILARrLYESkFlZmAiEBGQWgrWWQAnIrCxMBEICMgvBWkugBGRWFiYCIQGZhWCtJVACMisLE4GQgMxCsNYSKAGZlYWJQEhAZiFYawmUgMzKwkQgJCCzEKy1BEpAZmVhIhAS2DL7F8r/OP7dtZNpAAAAAElFTkSuQmCC",di={faq:{schema:{title:{type:"text",label:"Назва",placeholder:"Назва"},show_dots:{type:"switcher",label:"Показувати точки"},show_index:{type:"switcher",conditions:["show_dots","==","true"],label:"Показувати нумерацію"},index_type:{type:"combobox",conditions:["show_index","==","true"],label:"Тип нумерації",options:[{id:"decimal",text:"Десятковий"},{id:"upper-alpha",text:"Латинські великі букви"},{id:"lower-alpha",text:"Латинські маленькі букви"},{id:"upper-roman",text:"Римські великі цифри"},{id:"lower-roman",text:"Римські маленькі цифри"},{id:"upper-cyrillic",text:"Кириличні великі букви"},{id:"lower-cyrillic",text:"Кириличні маленькі букви"}]},openfirst:{type:"switcher",label:"Відкрити перший елемент?"},collapse_mode:{type:"switcher",label:"Не згортати попередній елемент?"},data:{type:"DataTable",colModel:[{key:"title",ua:"Назва",type:"text",required:!0,validators:["required"]},{key:"is_section",type:"Radio",label:"Заповнити секціями",options:[{id:"yes",text:"Так"},{id:"no",text:"Ні"}],required:!0,validators:["required"]},{key:"section",type:"reference",label:"Вкладений контент",placeholder:"Ваш контент",conditions:["is_section","==","yes"],required:!0,validators:["required"]},{key:"body",type:"tiptap-editor",label:"Тіло вкладки",placeholder:"Ваш контент",conditions:["is_section","==","no"],required:!0,validators:["required"]}]}}},banner:{schema:{title:{type:"text",label:"Назва",placeholder:"Назва"},image:{type:"file",label:"Зображення",placeholder:"Зображення"}}},photoGrid:{schema:{columns:{type:"number",label:"Кількість колонок",placeholder:"Кількість колонок",default:3},data:{type:"DataTable",colModel:[{key:"image",ua:"Зображення",type:"file"},{key:"caption",ua:"Заголовок",type:"text"}]}}},slider:{schema:{autoplay:{type:"switcher",label:"Автоматичне гортання?",default:!0},autoplaySpeed:{type:"number",label:"Швидкість автоматичного гортання(мс)",placeholder:"Швидкість автоматичного гортання(мс)",default:3e3},show_navigation:{type:"switcher",label:"Показувати кнопки навігації?"},data:{type:"DataTable",colModel:[{key:"title",ua:"Назва",type:"text"},{key:"link",ua:"Посилання",type:"text"},{key:"image",ua:"Зображення",type:"file"},{key:"image_width",ua:"Ширина зображення(px)",type:"number",placeholder:"Ширина зображення"},{key:"image_height",ua:"Висота зображення(px)",type:"number",placeholder:"Висота зображення"},{ua:"Розтягувати по ширині",key:"stretch",type:"switcher"},{key:"target_blank",ua:"Відкривати в новій вкладці?",type:"switcher"}]}}},video:{schema:{file:{type:"file",max_size:50,description:"Максимальний розмір файлу 50MB",label:"Завантажити відео",placeholder:"Завантажити відео"},hidden_gif:{type:"switcher",label:"Сховати GIF"},preview:{type:"file",label:"Прев'ю для відео"},link:{type:"text",label:"Посилання",placeholder:"Посилання"}}},about:{schema:{title:{type:"text",label:"Заголовок",placeholder:"Заголовок"},text:{type:"tiptap-editor",label:"Текст",placeholder:"Текст"},url:{type:"file",label:"Зображення / відео",placeholder:"Посилання"}}},cards:{schema:{title:{type:"text",label:"Заголовок",placeholder:"Заголовок"},data:{type:"DataTable",colModel:[{key:"title",ua:"Назва",type:"text"},{key:"img",ua:"Зображення",type:"file"},{key:"link",ua:"Посилання",type:"text"},{key:"description",ua:"Опис",type:"text"}]}}},usefulLinks:{schema:{title:{type:"text",label:"Заголовок",placeholder:"Заголовок"},data:{type:"DataTable",colModel:[{key:"text",ua:"Назва",type:"text"},{key:"url",ua:"Посилання",type:"text"},{key:"target_blank",ua:"Відкривати в новій вкладці?",type:"switcher"}]}}},team:{schema:{data:{type:"DataTable",colModel:[{key:"avatar",ua:"Аватар",type:"file"},{key:"title",ua:"Ім'я/ПІБ",type:"text"},{key:"description",ua:"Опис",type:"textarea",optional:!0},{key:"position",ua:"Посада",type:"text",tooltip:!0},{key:"email",ua:"Email",type:"text",optional:!0},{key:"tel",ua:"Телефон",type:"text",optional:!0},{key:"schedule",ua:"Графік прийому",type:"text",optional:!0},{key:"isinfo",type:"switcher",label:"Відображати кнопку 'Детальніше'"},{key:"slug",ua:"Slug",type:"text",label:"Унікальний ідентифікатор"}]}}},body:{schema:{background_color:{type:"switcher",label:"Додати білий фон?"},content:{type:"tiptap-editor",label:"Текст",placeholder:"Текст"}}},news:{schema:{title:{type:"text",label:"Заголовок",placeholder:"Заголовок"},buttonText:{type:"text",label:"Текст кнопки",placeholder:"Текст кнопки"},buttonLink:{type:"text",label:"Посилання кнопки",placeholder:"Посилання кнопки"},tag:{type:"select",label:"Тег",placeholder:"Тег",data:"tag_id"},news_list:{type:"select",label:"Список новин",multiple:!0,placeholder:"Список новин",parent:"tag",data:"news_tag_id"}}},form:{schema:{title:{type:"text",label:"Заголовок",placeholder:"Заголовок"},formUrl:{type:"text",label:"Посилання для відправки форми",placeholder:"Посилання"},schema:{label:"Схема форми",type:"DataTable",colModel:[{key:"name",ua:"Name",type:"text",placeholder:"Name"},{key:"label",ua:"Title",type:"text",placeholder:"Title"},{key:"type",ua:"Type",type:"combobox",options:[{text:"Text",id:"text"},{text:"Textarea",id:"textarea"},{text:"switcher",id:"switcher"},{text:"Email",id:"email"},{text:"Mask",id:"mask"},{text:"Number",id:"number"},{text:"Date",id:"date"},{text:"Datetime",id:"datetime"}]},{key:"mask",ua:"Маска",type:"text",conditions:["type","==","mask"],placeholder:"Маска"},{key:"placeholder",ua:"Плейсхолдер",type:"text",placeholder:"Placeholder"},{key:"required",ua:"Required",type:"switcher"}]}}},tabs:{schema:{title:{type:"text",label:"Заголовок",placeholder:"Заголовок"},description:{type:"textarea",label:"Опис",placeholder:"Опис"},history_mode:{type:"switcher",label:"Використовувати історію сторінки?"},data:{type:"DataTable",colModel:[{key:"slug",type:"slug",label:"Slug",parent:"title",placeholder:"Slug"},{key:"title",ua:"Назва",type:"text",required:!0,validators:["required"]},{key:"is_section",type:"Radio",label:"Заповнити секціями",options:[{id:"yes",text:"Так"},{id:"no",text:"Ні"}],required:!0,validators:["required"]},{key:"section",type:"reference",label:"Тіло вкладки",placeholder:"Ваш контент",conditions:["is_section","==","yes"],required:!0,validators:["required"]},{key:"body",type:"tiptap-editor",label:"Тіло вкладки",placeholder:"Ваш контент",conditions:["is_section","==","no"],required:!0,validators:["required"]}]}}},vertical_tabs:{schema:{title:{type:"text",label:"Заголовок",placeholder:"Заголовок"},history_mode:{type:"switcher",label:"Використовувати історію сторінки?"},data:{type:"DataTable",colModel:[{key:"slug",type:"slug",label:"Slug",parent:"title",placeholder:"Slug"},{key:"title",ua:"Назва",type:"text",required:!0,validators:["required"]},{key:"is_section",type:"Radio",label:"Заповнити секціями",options:[{id:"yes",text:"Так"},{id:"no",text:"Ні"},{id:"slug",text:"Привязати сторінку"}],required:!0,validators:["required"]},{key:"slug",type:"text",label:"Slug",placeholder:"Slug",conditions:["is_section","==","slug"]},{key:"section",type:"reference",label:"Тіло вкладки",placeholder:"Ваш контент",conditions:["is_section","==","yes"],required:!0,validators:["required"]},{key:"body",type:"tiptap-editor",label:"Тіло вкладки",placeholder:"Ваш контент",conditions:["is_section","==","no"],required:!0,validators:["required"]}]}}},documents:{schema:{title:{type:"text",label:"Заголовок",placeholder:"Заголовок"},icon:{type:"file",label:"Завантажити іконку",placeholder:"Завантажити іконку"},show_icon:{type:"switcher",label:"Показувати іконку?"},documents:{type:"DataTable",colModel:[{key:"title",ua:"Назва",type:"text"},{key:"file",info:"Прев'ю доступно тільки для документів у форматі pdf, html, txt. Інші формати одразу завантажуються.",ua:"Файл",type:"file"}]}}},infoLine:{schema:{divider:{type:"file",label:"Завантажити розподілювач"},speed:{type:"number",label:"Швидкість автоматичного гортання(с)",placeholder:"Швидкість автоматичного гортання(с)",default:20},data:{type:"DataTable",colModel:[{key:"title",ua:"Текст",type:"text"}]}}},interested:{schema:{title:{type:"text",label:"Заголовок",placeholder:"Заголовок"},data:{type:"DataTable",colModel:[{key:"title",ua:"Заголовок",type:"text"},{key:"link",ua:"Посилання",type:"text"},{key:"target_blank",ua:"Відкривати в новій вкладці?",type:"switcher"},{key:"color",ua:"Колір фону",type:"color"}]}}},contact:{schema:{title:{type:"text",label:"Заголовок",placeholder:"Заголовок"},data:{type:"DataTable",colModel:[{key:"type",ua:"Тип",type:"combobox",options:[{id:"email",text:"Email"},{id:"tel",text:"Телефон"},{id:"address",text:"Адреса"}]},{key:"title",ua:"Пошта",type:"text",conditions:["type","==","email"]},{key:"title",ua:"Телефон",type:"text",conditions:["type","==","tel"]},{key:"title",ua:"Адреса",type:"text",conditions:["type","==","address"]},{key:"description",ua:"Опис",type:"text"}]}}},iframe:{schema:{link:{type:"text",label:"Посилання",placeholder:"Посилання"},file:{type:"file",label:"Завантажити файл",placeholder:"Завантажити файл"},height:{type:"text",label:"Висота iframe(px)",placeholder:"Висота iframe(px)"}}}},Ga=[{text:"reference.faq",id:"faq"},{text:"reference.banner",id:"banner"},{text:"reference.slider",id:"slider"},{text:"reference.photoGrid",id:"photoGrid"},{text:"reference.video",id:"video"},{text:"reference.about",id:"about"},{text:"reference.cards",id:"cards"},{text:"reference.usefulLinks",id:"usefulLinks"},{text:"reference.team",id:"team"},{text:"reference.body",id:"body"},{text:"reference.news",id:"news"},{text:"reference.form",id:"form"},{text:"reference.tabs",id:"tabs"},{text:"reference.vertical_tabs",id:"vertical_tabs"},{text:"reference.documents",id:"documents"},{text:"reference.infoLine",id:"infoLine"},{text:"reference.interested",id:"interested"},{text:"reference.contact",id:"contact"},{text:"reference.iframe",id:"iframe"}],HC={class:"h-full w-full flex flex-col"},qC={class:"flex justify-between items-center mt-2 pt-2 border-t border-gray-300"},GC={class:"text-xs font-medium text-gray-600"},WC={key:0,class:"text-xs text-gray-500"},ui={__name:"cards-skeleton",props:{text:{type:String,required:!0},count:{type:Number,required:!0}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",HC,[a[0]||(a[0]=e.createStaticVNode('<div class="flex-1 grid grid-cols-3 gap-1.5"><div class="bg-gray-200 rounded p-1.5 flex flex-col"><div class="flex-1 bg-gray-300 rounded mb-1"></div><div class="h-1.5 bg-gray-400 rounded"></div></div><div class="bg-gray-200 rounded p-1.5 flex flex-col"><div class="flex-1 bg-gray-300 rounded mb-1"></div><div class="h-1.5 bg-gray-400 rounded"></div></div><div class="bg-gray-200 rounded p-1.5 flex flex-col"><div class="flex-1 bg-gray-300 rounded mb-1"></div><div class="h-1.5 bg-gray-400 rounded"></div></div><div class="bg-gray-200 rounded p-1.5 flex flex-col"><div class="flex-1 bg-gray-300 rounded mb-1"></div><div class="h-1.5 bg-gray-400 rounded"></div></div><div class="bg-gray-200 rounded p-1.5 flex flex-col"><div class="flex-1 bg-gray-300 rounded mb-1"></div><div class="h-1.5 bg-gray-400 rounded"></div></div><div class="bg-gray-200 rounded p-1.5 flex flex-col"><div class="flex-1 bg-gray-300 rounded mb-1"></div><div class="h-1.5 bg-gray-400 rounded"></div></div></div>',1)),e.createElementVNode("div",qC,[e.createElementVNode("div",GC,e.toDisplayString(t.$t(l.text)),1),l.count&&l.count>0?(e.openBlock(),e.createElementBlock("div",WC,e.toDisplayString(l.count),1)):e.createCommentVNode("",!0)])]))}},KC={class:"h-full w-full flex flex-col"},YC={class:"flex justify-between items-center mt-2 pt-2 border-t border-gray-300"},XC={class:"text-xs font-medium text-gray-600"},ZC={key:0,class:"text-xs text-gray-500"},QC={__name:"faq-skeleton",props:{text:{type:String,required:!0},count:{type:Number,required:!0}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",KC,[a[0]||(a[0]=e.createStaticVNode('<div class="h-3 bg-gray-500 rounded mb-2"></div><div class="space-y-1.5 flex-1"><div class="border border-gray-300 rounded p-1"><div class="flex items-center justify-between"><div class="h-1.5 bg-gray-300 rounded flex-1 mr-2"></div><svg 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" class="lucide lucide-chevron-down w-2.5 h-2.5 text-gray-400"><path d="m6 9 6 6 6-6"></path></svg></div></div><div class="border border-gray-300 rounded p-1"><div class="flex items-center justify-between"><div class="h-1.5 bg-gray-300 rounded flex-1 mr-2"></div><svg 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" class="lucide lucide-chevron-down w-2.5 h-2.5 text-gray-400"><path d="m6 9 6 6 6-6"></path></svg></div><div class="mt-1 pt-1 border-t border-gray-200"><div class="space-y-0.5"><div class="h-1 bg-gray-200 rounded"></div><div class="h-1 bg-gray-200 rounded w-5/6"></div><div class="h-1 bg-gray-200 rounded w-4/5"></div></div></div></div><div class="border border-gray-300 rounded p-1"><div class="flex items-center justify-between"><div class="h-1.5 bg-gray-300 rounded flex-1 mr-2"></div><svg 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" class="lucide lucide-chevron-down w-2.5 h-2.5 text-gray-400"><path d="m6 9 6 6 6-6"></path></svg></div></div><div class="border border-gray-300 rounded p-1"><div class="flex items-center justify-between"><div class="h-1.5 bg-gray-300 rounded flex-1 mr-2"></div><svg 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" class="lucide lucide-chevron-down w-2.5 h-2.5 text-gray-400"><path d="m6 9 6 6 6-6"></path></svg></div></div></div>',2)),e.createElementVNode("div",YC,[e.createElementVNode("div",XC,e.toDisplayString(t.$t(l.text)),1),l.count&&l.count>0?(e.openBlock(),e.createElementBlock("div",ZC,e.toDisplayString(l.count),1)):e.createCommentVNode("",!0)])]))}},JC={class:"h-full w-full flex flex-col"},eV={class:"flex justify-between items-center mt-2 pt-2 border-t border-gray-300"},tV={class:"text-xs font-medium text-gray-600"},lV={key:0,class:"text-xs text-gray-500"},mi={__name:"banner-skeleton",props:{text:{type:String,required:!0},count:{type:Number,required:!0}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",JC,[a[0]||(a[0]=e.createStaticVNode('<div class="flex-1 bg-gray-200 rounded relative"><div class="absolute inset-0 flex items-center justify-center"><div class="w-16 h-10 bg-gray-300 rounded"></div></div><div class="absolute bottom-2 left-2"><div class="h-3 bg-gray-400 rounded w-16"></div></div></div>',1)),e.createElementVNode("div",eV,[e.createElementVNode("div",tV,e.toDisplayString(t.$t(l.text)),1),l.count&&l.count>0?(e.openBlock(),e.createElementBlock("div",lV,e.toDisplayString(l.count),1)):e.createCommentVNode("",!0)])]))}},aV={class:"h-full w-full flex flex-col"},rV={class:"flex justify-between items-center mt-2 pt-2 border-t border-gray-300"},nV={class:"text-xs font-medium text-gray-600"},oV={key:0,class:"text-xs text-gray-500"},sV={__name:"form-skeleton",props:{text:{type:String,required:!0},count:{type:Number,required:!0}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",aV,[a[0]||(a[0]=e.createStaticVNode('<div class="h-3 bg-gray-500 rounded mb-2"></div><div class="space-y-1.5 flex-1"><div><div class="h-1.5 bg-gray-300 rounded mb-1 w-1/4"></div><div class="h-5 bg-gray-200 rounded border border-gray-300"></div></div><div><div class="h-1.5 bg-gray-300 rounded mb-1 w-1/3"></div><div class="h-5 bg-gray-200 rounded border border-gray-300"></div></div><div><div class="h-1.5 bg-gray-300 rounded mb-1 w-1/4"></div><div class="h-5 bg-gray-200 rounded border border-gray-300"></div></div><div><div class="h-1.5 bg-gray-300 rounded mb-1 w-1/3"></div><div class="h-8 bg-gray-200 rounded border border-gray-300"></div></div></div><div class="h-6 bg-gray-600 rounded mt-2"></div>',3)),e.createElementVNode("div",rV,[e.createElementVNode("div",nV,e.toDisplayString(t.$t(l.text)),1),l.count&&l.count>0?(e.openBlock(),e.createElementBlock("div",oV,e.toDisplayString(l.count),1)):e.createCommentVNode("",!0)])]))}},iV={class:"h-full w-full flex flex-col"},cV={class:"flex justify-between items-center mt-2 pt-2 border-t border-gray-300"},dV={class:"text-xs font-medium text-gray-600"},uV={key:0,class:"text-xs text-gray-500"},pi={__name:"news-skeleton",props:{text:{type:String,required:!0},count:{type:Number,required:!0}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",iV,[a[0]||(a[0]=e.createStaticVNode('<div class="h-4 bg-gray-400 rounded mb-2"></div><div class="flex gap-2 flex-1"><div class="flex-1 space-y-2"><div class="bg-gray-200 rounded p-1.5"><div class="h-8 bg-gray-300 rounded mb-1"></div><div class="h-1.5 bg-gray-400 rounded mb-1"></div><div class="h-1 bg-gray-300 rounded w-3/4"></div></div><div class="bg-gray-200 rounded p-1.5"><div class="h-8 bg-gray-300 rounded mb-1"></div><div class="h-1.5 bg-gray-400 rounded mb-1"></div><div class="h-1 bg-gray-300 rounded w-3/4"></div></div></div><div class="w-20 space-y-1"><div class="border-b border-gray-300 pb-1"><div class="h-1 bg-gray-300 rounded mb-1"></div><div class="h-1 bg-gray-300 rounded w-4/5"></div></div><div class="border-b border-gray-300 pb-1"><div class="h-1 bg-gray-300 rounded mb-1"></div><div class="h-1 bg-gray-300 rounded w-4/5"></div></div><div class="border-b border-gray-300 pb-1"><div class="h-1 bg-gray-300 rounded mb-1"></div><div class="h-1 bg-gray-300 rounded w-4/5"></div></div><div class="border-b border-gray-300 pb-1"><div class="h-1 bg-gray-300 rounded mb-1"></div><div class="h-1 bg-gray-300 rounded w-4/5"></div></div></div></div>',2)),e.createElementVNode("div",cV,[e.createElementVNode("div",dV,e.toDisplayString(t.$t(l.text)),1),l.count&&l.count>0?(e.openBlock(),e.createElementBlock("div",uV,e.toDisplayString(l.count),1)):e.createCommentVNode("",!0)])]))}},mV={class:"h-full w-full flex flex-col"},pV={class:"flex justify-between items-center mt-2 pt-2 border-t border-gray-300"},fV={class:"text-xs font-medium text-gray-600"},hV={key:0,class:"text-xs text-gray-500"},gV={__name:"team-skeleton",props:{text:{type:String,required:!0},count:{type:Number,required:!0}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",mV,[a[0]||(a[0]=e.createStaticVNode('<div class="space-y-2 flex-1"><div class="flex items-start gap-2"><div class="w-8 h-8 bg-gray-300 rounded flex-shrink-0"></div><div class="flex-1 min-w-0"><div class="h-2 bg-gray-400 rounded mb-1 w-2/3"></div><div class="h-1.5 bg-gray-300 rounded mb-1"></div><div class="flex gap-1"><svg 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" class="lucide lucide-phone w-2.5 h-2.5 text-gray-400"><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"></path></svg><svg 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" class="lucide lucide-mail w-2.5 h-2.5 text-gray-400"><rect width="20" height="16" x="2" y="4" rx="2"></rect><path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"></path></svg><svg 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" class="lucide lucide-clock w-2.5 h-2.5 text-gray-400"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg></div></div></div><div class="flex items-start gap-2"><div class="w-8 h-8 bg-gray-300 rounded flex-shrink-0"></div><div class="flex-1 min-w-0"><div class="h-2 bg-gray-400 rounded mb-1 w-2/3"></div><div class="h-1.5 bg-gray-300 rounded mb-1"></div><div class="flex gap-1"><svg 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" class="lucide lucide-phone w-2.5 h-2.5 text-gray-400"><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"></path></svg><svg 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" class="lucide lucide-mail w-2.5 h-2.5 text-gray-400"><rect width="20" height="16" x="2" y="4" rx="2"></rect><path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"></path></svg><svg 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" class="lucide lucide-clock w-2.5 h-2.5 text-gray-400"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg></div></div></div><div class="flex items-start gap-2"><div class="w-8 h-8 bg-gray-300 rounded flex-shrink-0"></div><div class="flex-1 min-w-0"><div class="h-2 bg-gray-400 rounded mb-1 w-2/3"></div><div class="h-1.5 bg-gray-300 rounded mb-1"></div><div class="flex gap-1"><svg 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" class="lucide lucide-phone w-2.5 h-2.5 text-gray-400"><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"></path></svg><svg 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" class="lucide lucide-mail w-2.5 h-2.5 text-gray-400"><rect width="20" height="16" x="2" y="4" rx="2"></rect><path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"></path></svg><svg 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" class="lucide lucide-clock w-2.5 h-2.5 text-gray-400"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg></div></div></div><div class="flex items-start gap-2"><div class="w-8 h-8 bg-gray-300 rounded flex-shrink-0"></div><div class="flex-1 min-w-0"><div class="h-2 bg-gray-400 rounded mb-1 w-2/3"></div><div class="h-1.5 bg-gray-300 rounded mb-1"></div><div class="flex gap-1"><svg 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" class="lucide lucide-phone w-2.5 h-2.5 text-gray-400"><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"></path></svg><svg 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" class="lucide lucide-mail w-2.5 h-2.5 text-gray-400"><rect width="20" height="16" x="2" y="4" rx="2"></rect><path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"></path></svg><svg 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" class="lucide lucide-clock w-2.5 h-2.5 text-gray-400"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg></div></div></div></div>',1)),e.createElementVNode("div",pV,[e.createElementVNode("div",fV,e.toDisplayString(t.$t(l.text)),1),l.count&&l.count>0?(e.openBlock(),e.createElementBlock("div",hV,e.toDisplayString(l.count),1)):e.createCommentVNode("",!0)])]))}},bV={class:"h-full w-full flex flex-col"},yV={class:"flex justify-between items-center mt-2 pt-2 border-t border-gray-300"},kV={class:"text-xs font-medium text-gray-600"},xV={key:0,class:"text-xs text-gray-500"},fi={__name:"usefulLinks-skeleton",props:{text:{type:String,required:!0},count:{type:Number,required:!0}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",bV,[a[0]||(a[0]=e.createStaticVNode('<div class="h-4 bg-gray-400 rounded mb-3"></div><div class="grid grid-cols-2 gap-2 flex-1"><div class="space-y-2"><div class="flex items-center justify-between p-1.5 border border-gray-300 rounded"><div class="h-1.5 bg-gray-300 rounded flex-1 mr-2"></div><div class="w-2 h-2 bg-gray-400 rounded-full"></div></div><div class="flex items-center justify-between p-1.5 border border-gray-300 rounded"><div class="h-1.5 bg-gray-300 rounded flex-1 mr-2"></div><div class="w-2 h-2 bg-gray-400 rounded-full"></div></div><div class="flex items-center justify-between p-1.5 border border-gray-300 rounded"><div class="h-1.5 bg-gray-300 rounded flex-1 mr-2"></div><div class="w-2 h-2 bg-gray-400 rounded-full"></div></div></div><div class="space-y-2"><div class="flex items-center justify-between p-1.5 border border-gray-300 rounded"><div class="h-1.5 bg-gray-300 rounded flex-1 mr-2"></div><div class="w-2 h-2 bg-gray-400 rounded-full"></div></div><div class="flex items-center justify-between p-1.5 border border-gray-300 rounded"><div class="h-1.5 bg-gray-300 rounded flex-1 mr-2"></div><div class="w-2 h-2 bg-gray-400 rounded-full"></div></div><div class="flex items-center justify-between p-1.5 border border-gray-300 rounded"><div class="h-1.5 bg-gray-300 rounded flex-1 mr-2"></div><div class="w-2 h-2 bg-gray-400 rounded-full"></div></div></div></div>',2)),e.createElementVNode("div",yV,[e.createElementVNode("div",kV,e.toDisplayString(t.$t(l.text)),1),l.count&&l.count>0?(e.openBlock(),e.createElementBlock("div",xV,e.toDisplayString(l.count),1)):e.createCommentVNode("",!0)])]))}},wV={class:"h-full w-full flex flex-col"},_V={class:"flex justify-between items-center mt-2 pt-2 border-t border-gray-300"},EV={class:"text-xs font-medium text-gray-600"},CV={key:0,class:"text-xs text-gray-500"},VV={__name:"video-skeleton",props:{text:{type:String,required:!0},count:{type:Number,required:!0}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",wV,[a[0]||(a[0]=e.createStaticVNode('<div class="flex-1 bg-gray-200 rounded relative"><div class="absolute inset-0 flex items-center justify-center"><div class="w-10 h-10 bg-gray-400 rounded-full flex items-center justify-center"><svg 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" class="lucide lucide-play w-5 h-5 text-white ml-0.5"><polygon points="6 3 20 12 6 21 6 3"></polygon></svg></div></div><div class="absolute bottom-1.5 left-1.5 right-1.5"><div class="h-2 bg-gray-400 rounded mb-1"></div><div class="h-2 bg-gray-400 rounded w-3/4"></div></div></div><div class="mt-2 flex items-center gap-2"><div class="w-5 h-5 bg-gray-300 rounded"></div><div class="h-2 bg-gray-300 rounded flex-1"></div></div>',2)),e.createElementVNode("div",_V,[e.createElementVNode("div",EV,e.toDisplayString(t.$t(l.text)),1),l.count&&l.count>0?(e.openBlock(),e.createElementBlock("div",CV,e.toDisplayString(l.count),1)):e.createCommentVNode("",!0)])]))}},NV={class:"h-full w-full flex flex-col"},vV={class:"flex justify-between items-center mt-2 pt-2 border-t border-gray-300"},BV={class:"text-xs font-medium text-gray-600"},SV={key:0,class:"text-xs text-gray-500"},DV={__name:"about-skeleton",props:{text:{type:String,required:!0},count:{type:Number,required:!0}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",NV,[a[0]||(a[0]=e.createStaticVNode('<div class="flex flex-1"><div class="flex-1 pr-2"><div class="h-4 bg-gray-400 rounded mb-2"></div><div class="space-y-1.5"><div class="h-2 bg-gray-300 rounded"></div><div class="h-2 bg-gray-300 rounded"></div><div class="h-2 bg-gray-300 rounded w-4/5"></div><div class="h-2 bg-gray-300 rounded"></div><div class="h-2 bg-gray-300 rounded w-3/4"></div><div class="h-2 bg-gray-300 rounded"></div></div></div><div class="w-16 h-20 bg-gray-200 rounded flex items-center justify-center"><div class="w-6 h-6 bg-gray-300 rounded-full"></div></div></div>',1)),e.createElementVNode("div",vV,[e.createElementVNode("div",BV,e.toDisplayString(t.$t(l.text)),1),l.count&&l.count>0?(e.openBlock(),e.createElementBlock("div",SV,e.toDisplayString(l.count),1)):e.createCommentVNode("",!0)])]))}},AV={class:"h-full w-full flex flex-col"},MV={class:"flex justify-between items-center mt-2 pt-2 border-t border-gray-300"},TV={class:"text-xs font-medium text-gray-600"},LV={key:0,class:"text-xs text-gray-500"},$V={__name:"slider-skeleton",props:{text:{type:String,required:!0},count:{type:Number,required:!0}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",AV,[a[0]||(a[0]=e.createStaticVNode('<div class="flex-1 bg-gray-200 rounded mb-2 relative"><div class="absolute inset-0 flex items-center justify-center"><div class="w-12 h-8 bg-gray-300 rounded"></div></div><div class="absolute left-1 top-1/2 transform -translate-y-1/2"><svg 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" class="lucide lucide-chevron-left w-4 h-4 text-gray-400"><path d="m15 18-6-6 6-6"></path></svg></div><div class="absolute right-1 top-1/2 transform -translate-y-1/2"><svg 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" class="lucide lucide-chevron-right w-4 h-4 text-gray-400"><path d="m9 18 6-6-6-6"></path></svg></div></div><div class="h-3 bg-gray-300 rounded mb-2"></div><div class="h-6 w-20 bg-gray-400 rounded"></div><div class="flex justify-center gap-1 mt-2"><div class="w-1.5 h-1.5 bg-gray-300 rounded-full"></div><div class="w-1.5 h-1.5 bg-gray-300 rounded-full"></div><div class="w-1.5 h-1.5 bg-gray-300 rounded-full"></div><div class="w-1.5 h-1.5 bg-gray-300 rounded-full"></div><div class="w-1.5 h-1.5 bg-gray-300 rounded-full"></div></div>',4)),e.createElementVNode("div",MV,[e.createElementVNode("div",TV,e.toDisplayString(t.$t(l.text)),1),l.count&&l.count>0?(e.openBlock(),e.createElementBlock("div",LV,e.toDisplayString(l.count),1)):e.createCommentVNode("",!0)])]))}},FV={class:"h-full flex flex-col"},IV={class:"flex justify-between items-center mt-2 pt-2 border-t border-gray-300"},OV={class:"text-xs font-medium text-gray-600"},PV={key:0,class:"text-xs text-gray-500"},RV={__name:"infoLine-skeleton",props:{text:{type:String,required:!0},count:{type:Number,required:!0}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",FV,[a[0]||(a[0]=e.createStaticVNode('<div class="flex-1 bg-gray-200 rounded relative overflow-hidden"><div class="absolute inset-0 flex items-center"><div class="flex gap-8 whitespace-nowrap animate-pulse"><div class="h-3 bg-gray-400 rounded w-32"></div><div class="h-3 bg-gray-300 rounded w-24"></div><div class="h-3 bg-gray-400 rounded w-40"></div><div class="h-3 bg-gray-300 rounded w-28"></div><div class="h-3 bg-gray-400 rounded w-36"></div><div class="h-3 bg-gray-300 rounded w-20"></div></div></div><div class="absolute top-2 left-2 right-2 flex justify-between items-center"><div class="w-2 h-2 bg-gray-500 rounded-full"></div><div class="w-2 h-2 bg-gray-500 rounded-full"></div></div></div>',1)),e.createElementVNode("div",IV,[e.createElementVNode("div",OV,e.toDisplayString(t.$t(l.text)),1),l.count&&l.count>0?(e.openBlock(),e.createElementBlock("div",PV,e.toDisplayString(l.count),1)):e.createCommentVNode("",!0)])]))}},UV={class:"h-full flex flex-col"},jV={class:"flex justify-between items-center mt-2 pt-2 border-t border-gray-300"},zV={class:"text-xs font-medium text-gray-600"},HV={key:0,class:"text-xs text-gray-500"},qV={__name:"tabs-skeleton",props:{text:{type:String,required:!0},count:{type:Number,required:!0}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",UV,[a[0]||(a[0]=e.createStaticVNode('<div class="h-2 bg-gray-300 rounded mb-2"></div><div class="flex gap-1 mb-3"><div class="h-4 w-16 bg-gray-400 rounded"></div><div class="h-4 w-16 bg-gray-200 rounded"></div></div><div class="space-y-2 flex-1"><div class="h-2 bg-gray-300 rounded w-5/6"></div><div class="h-2 bg-gray-300 rounded"></div><div class="space-y-1 mt-3"><div class="flex items-center gap-2"><div class="w-2 h-2 bg-gray-400 rounded-full"></div><div class="h-1.5 bg-gray-300 rounded w-20"></div></div><div class="flex items-center gap-2"><div class="w-2 h-2 bg-gray-400 rounded-full"></div><div class="h-1.5 bg-gray-300 rounded w-16"></div></div></div></div>',3)),e.createElementVNode("div",jV,[e.createElementVNode("div",zV,e.toDisplayString(t.$t(l.text)),1),l.count&&l.count>0?(e.openBlock(),e.createElementBlock("div",HV,e.toDisplayString(l.count),1)):e.createCommentVNode("",!0)])]))}},GV={class:"h-full flex flex-col"},WV={class:"flex justify-between items-center mt-2 pt-2 border-t border-gray-300"},KV={class:"text-xs font-medium text-gray-600"},YV={key:0,class:"text-xs text-gray-500"},hi={__name:"documents-skeleton",props:{text:{type:String,required:!0},count:{type:Number,required:!0}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",GV,[a[0]||(a[0]=e.createStaticVNode('<div class="h-4 bg-gray-400 rounded mb-2"></div><div class="space-y-1.5 flex-1"><div class="flex items-center justify-between p-1.5 border-b border-gray-200"><div class="flex items-center gap-2"><div class="w-3 h-3 bg-gray-400 rounded-full"></div><div class="h-2 bg-gray-300 rounded flex-1 w-28"></div></div><div class="flex gap-1.5"><div class="w-3 h-3 bg-gray-200 rounded"></div><div class="w-3 h-3 bg-gray-200 rounded"></div></div></div><div class="flex items-center justify-between p-1.5 border-b border-gray-200"><div class="flex items-center gap-2"><div class="w-3 h-3 bg-gray-400 rounded-full"></div><div class="h-2 bg-gray-300 rounded flex-1 w-28"></div></div><div class="flex gap-1.5"><div class="w-3 h-3 bg-gray-200 rounded"></div><div class="w-3 h-3 bg-gray-200 rounded"></div></div></div><div class="flex items-center justify-between p-1.5 border-b border-gray-200"><div class="flex items-center gap-2"><div class="w-3 h-3 bg-gray-400 rounded-full"></div><div class="h-2 bg-gray-300 rounded flex-1 w-28"></div></div><div class="flex gap-1.5"><div class="w-3 h-3 bg-gray-200 rounded"></div><div class="w-3 h-3 bg-gray-200 rounded"></div></div></div><div class="flex items-center justify-between p-1.5 border-b border-gray-200"><div class="flex items-center gap-2"><div class="w-3 h-3 bg-gray-400 rounded-full"></div><div class="h-2 bg-gray-300 rounded flex-1 w-28"></div></div><div class="flex gap-1.5"><div class="w-3 h-3 bg-gray-200 rounded"></div><div class="w-3 h-3 bg-gray-200 rounded"></div></div></div></div>',2)),e.createElementVNode("div",WV,[e.createElementVNode("div",KV,e.toDisplayString(t.$t(l.text)),1),l.count&&l.count>0?(e.openBlock(),e.createElementBlock("div",YV,e.toDisplayString(l.count),1)):e.createCommentVNode("",!0)])]))}},XV={class:"h-full flex flex-col"},ZV={class:"flex justify-between items-center mt-2 pt-2 border-t border-gray-300"},QV={class:"text-xs font-medium text-gray-600"},JV={key:0,class:"text-xs text-gray-500"},Wa={faq:QC,banner:mi,slider:$V,video:VV,about:DV,cards:ui,usefulLinks:fi,team:gV,news:pi,form:sV,tabs:qV,vertical_tabs:pi,documents:hi,infoLine:RV,body:{__name:"body-skeleton",props:{text:{type:String,required:!0},count:{type:Number,required:!0}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",XV,[a[0]||(a[0]=e.createStaticVNode('<div class="grid grid-cols-3 gap-2 flex-1"><div class="flex flex-col"><div class="h-3 bg-gray-400 rounded mb-2"></div><div class="space-y-1.5"><div class="h-4 bg-gray-200 rounded border border-gray-300 p-1.5"><div class="h-1.5 bg-gray-300 rounded w-3/4"></div></div><div class="h-4 bg-gray-200 rounded border border-gray-300 p-1.5"><div class="h-1.5 bg-gray-300 rounded w-3/4"></div></div></div></div><div class="flex flex-col"><div class="h-3 bg-gray-400 rounded mb-2"></div><div class="space-y-1.5"><div class="h-4 bg-gray-200 rounded border border-gray-300 p-1.5"><div class="h-1.5 bg-gray-300 rounded w-3/4"></div></div><div class="h-4 bg-gray-200 rounded border border-gray-300 p-1.5"><div class="h-1.5 bg-gray-300 rounded w-3/4"></div></div></div></div><div class="flex flex-col"><div class="h-3 bg-gray-400 rounded mb-2"></div><div class="space-y-1.5"><div class="h-4 bg-gray-200 rounded border border-gray-300 p-1.5"><div class="h-1.5 bg-gray-300 rounded w-3/4"></div></div><div class="h-4 bg-gray-200 rounded border border-gray-300 p-1.5"><div class="h-1.5 bg-gray-300 rounded w-3/4"></div></div></div></div></div>',1)),e.createElementVNode("div",ZV,[e.createElementVNode("div",QV,e.toDisplayString(t.$t(l.text)),1),l.count&&l.count>0?(e.openBlock(),e.createElementBlock("div",JV,e.toDisplayString(l.count),1)):e.createCommentVNode("",!0)])]))}},photoGrid:ui,interested:fi,contact:hi,iframe:mi},eN={class:"grid grid-cols-1 md:grid-cols-1 lg:grid-cols-2 2xl:grid-cols-3 gap-4"},tN=["onClick"],lN={class:"wireframe-block h-[240px] !p-4 border-2 border-dashed bg-white relative overflow-hidden transition-all rounded-lg shadow-sm border-gray-300 hover:border-gray-400 cursor-pointer"},aN=["src"],rN={__name:"vs-form-reference-choce",props:{modelValue:{type:String,required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(l){const t=e.useModel(l,"modelValue");return(a,r)=>(e.openBlock(),e.createElementBlock("div",eN,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(Ga),n=>(e.openBlock(),e.createElementBlock("div",{key:n.id,onClick:o=>t.value=n.id,class:"relative"},[e.createElementVNode("div",lN,[e.unref(Wa)[n.id]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(Wa)[n.id]),{key:0,text:n==null?void 0:n.text,count:(n==null?void 0:n.data)||0},null,8,["text","count"])):(e.openBlock(),e.createElementBlock("img",{key:1,src:e.unref(ci),alt:"Team collaboration",class:"w-full h-full object-cover"},null,8,aN))])],8,tN))),128))]))}},nN={};function oN(l,t,a,r,n,o){const s=e.resolveComponent("vs-richtext");return e.openBlock(),e.createBlock(s,{class:"w-full"})}const pn=Qt(nN,[["render",oN]]),sN={class:"flex gap-4"},iN={class:"text-sm text-gray-500 dark:text-gray-400 border flex items-center h-10 px-4 rounded-lg w-full"},cN={class:"flex items-center justify-between w-full p-4 border-t border-gray-200 dark:border-gray-700"},dN={__name:"vs-form-reference-add",props:e.mergeModels({title:{type:String,required:!0}},{modelValue:{type:Array,default:()=>[]},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const{t}=Fe();$e["vs-input-reference"]=fn,$e["vs-input-tiptap-editor"]=pn;const a=e.useModel(l,"modelValue"),r=e.ref(!1),n=e.ref({}),o=e.ref(null),s=e.ref({}),i=e.computed(()=>{var u;return((u=di[o.value])==null?void 0:u.schema)||null}),c=async()=>{if(await n.value.validate()){xe({type:"warning",title:t("cms.common.actions.warning"),message:t("cms.builder.editFieldFailed")});return}try{Object.keys(s.value).length!==0&&(a.value=[...a.value||[],{...s.value,id:Math.random().toString(36).substring(2,15),reference_type:o.value}]),r.value=!1,o.value=null,s.value={}}catch(d){console.log(d)}};return e.watch(r,()=>{r.value||(o.value=null,s.value={})}),(u,d)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("button",{type:"button",class:"inline-flex items-center px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm text-sm font-medium text-gray-700 dark:text-gray-200 bg-white dark:bg-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-sky-500",onClick:d[0]||(d[0]=m=>r.value=!r.value)},e.toDisplayString(u.$t("cms.builder.create")),1),e.createVNode(e.unref(Yo),{visible:r.value,"onUpdate:visible":d[6]||(d[6]=m=>r.value=m),position:"right",closeClickBackdrop:!1,onClose:d[7]||(d[7]=m=>r.value=!1),title:o.value?u.$t("cms.builder."+o.value):u.$t("cms.builder.selectType"),size:"50vw"},{footer:e.withCtx(()=>[e.createElementVNode("div",cN,[e.createElementVNode("button",{onClick:d[5]||(d[5]=m=>r.value=!1),class:"inline-flex items-center px-3 py-2 text-sm text-black duration-300 border border-gray-200 rounded-lg gap-x-2 whitespace-nowrap hover:bg-gray-100"},e.toDisplayString(u.$t("cms.builder.cancel")),1),e.createElementVNode("button",{onClick:c,class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"},e.toDisplayString(u.$t("cms.builder.create")),1)])]),default:e.withCtx(()=>{var m;return[o.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",sN,[e.createElementVNode("div",iN,[e.createElementVNode("span",null,e.toDisplayString((m=e.unref(Ga).find(f=>f.id===o.value))==null?void 0:m.text),1)]),e.createElementVNode("button",{class:"py-2.5 px-3 mb-4 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300",onClick:d[2]||(d[2]=f=>o.value=null)},e.toDisplayString(u.$t("cms.builder.changeType")),1)]),i.value?(e.openBlock(),e.createBlock(e.unref(Xe),{key:o.value,schema:i.value,modelValue:s.value,"onUpdate:modelValue":d[3]||(d[3]=f=>s.value=f),form:n.value,"onUpdate:form":d[4]||(d[4]=f=>n.value=f)},null,8,["schema","modelValue","form"])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createBlock(rN,{key:0,modelValue:o.value,"onUpdate:modelValue":d[1]||(d[1]=f=>o.value=f),options:e.unref(Ga)},null,8,["modelValue","options"]))]}),_:1},8,["visible","title"])]))}},uN={class:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity flex space-x-1 z-10"},mN={class:"flex items-center justify-between w-full p-4 border-t border-gray-200 dark:border-gray-700"},pN={__name:"vs-form-reference-controls",props:e.mergeModels({title:{type:String,required:!0}},{modelValue:{type:Object,default:()=>({})},modelModifiers:{},parent:{type:Array,default:()=>[]},parentModifiers:{}}),emits:["update:modelValue","update:parent"],setup(l){const{t}=Fe(),a=e.useModel(l,"modelValue"),r=e.useModel(l,"parent"),n=e.ref(!1),o=e.ref({}),s=e.ref({}),i=e.computed(()=>{var u;return((u=di[a.value.reference_type])==null?void 0:u.schema)||null});e.watch(n,u=>{u&&(o.value={...a.value})});const c=async()=>{try{if(await s.value.validate()){xe({type:"warning",title:t("cms.common.actions.warning"),message:t("cms.builder.editFieldFailed")});return}a.value={...o.value},n.value=!1}catch(u){console.log(u)}};return(u,d)=>(e.openBlock(),e.createElementBlock("div",uN,[e.createElementVNode("button",{onClick:d[0]||(d[0]=m=>n.value=!n.value),class:"p-1.5 bg-white dark:bg-gray-800 rounded shadow-sm hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors border border-gray-200 dark:border-gray-700"},[e.createVNode(e.unref(wl),{class:"h-4 w-4 text-gray-400"})]),e.createElementVNode("button",{onClick:d[1]||(d[1]=m=>r.value=r.value.filter(f=>f.id!==a.value.id)),class:"p-1.5 bg-white dark:bg-gray-800 rounded shadow-sm hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors border border-gray-200 dark:border-gray-700"},[e.createVNode(e.unref(Gt),{class:"h-4 w-4 text-red-500"})]),e.createVNode(e.unref(Yo),{visible:n.value,"onUpdate:visible":d[5]||(d[5]=m=>n.value=m),onClose:d[6]||(d[6]=m=>n.value=!1),title:l.title,width:"50vw"},{footer:e.withCtx(()=>[e.createElementVNode("div",mN,[e.createElementVNode("button",{class:"inline-flex items-center px-3 py-2 text-sm text-black duration-300 border border-gray-200 rounded-lg gap-x-2 whitespace-nowrap hover:bg-gray-100",onClick:d[4]||(d[4]=m=>n.value=!1)},e.toDisplayString(u.$t("cms.common.actions.cancel")),1),e.createElementVNode("button",{onClick:c,class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"},e.toDisplayString(u.$t("cms.common.actions.save")),1)])]),default:e.withCtx(()=>[i.value?(e.openBlock(),e.createBlock(e.unref(Xe),{key:0,form:s.value,"onUpdate:form":d[2]||(d[2]=m=>s.value=m),schema:i.value,modelValue:o.value,"onUpdate:modelValue":d[3]||(d[3]=m=>o.value=m),class:"-mr-[10px] ml-[10px] mt-[10px]"},null,8,["form","schema","modelValue"])):e.createCommentVNode("",!0)]),_:1},8,["visible","title"])]))}},fN={class:"w-full"},hN={key:0,class:"relative"},gN={class:"group wireframe-block h-[280px] !p-4 border-2 border-dashed bg-white relative overflow-hidden transition-all rounded-lg shadow-sm border-gray-00 hover:border-gray-400 cursor-grab"},bN=["src"],fn={__name:"vs-form-reference-list",props:e.mergeModels({reference_type:{type:String,required:!0},title:{type:String,required:!0}},{modelValue:{default:()=>[]},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=n=>{var o;return(o=Ga.find(s=>s.id===n))==null?void 0:o.text},a=e.useModel(l,"modelValue"),r=e.computed({get(){const n=a.value;return n==null?[]:Array.isArray(n)?n:[]},set(n){a.value=Array.isArray(n)?n:[]}});return e.watch(a,n=>{n!=null&&!Array.isArray(n)&&(a.value=[])},{immediate:!0}),(n,o)=>{var s;return e.openBlock(),e.createElementBlock("div",fN,[((s=r.value)==null?void 0:s.length)>0?(e.openBlock(),e.createBlock(e.unref(oi),{key:0,modelValue:r.value,"onUpdate:modelValue":o[1]||(o[1]=i=>r.value=i),"item-key":"id",handle:".drag-handle",class:"grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-4"},{item:e.withCtx(({element:i,index:c})=>[i!=null&&i.reference_type?(e.openBlock(),e.createElementBlock("div",hN,[e.createElementVNode("div",gN,[(e.openBlock(),e.createElementBlock("div",{key:i.id,class:"absolute top-2 left-2 opacity-0 group-hover:opacity-100 border border-gray-200 dark:border-gray-700 transition-opacity cursor-move z-10 bg-white dark:bg-gray-800 rounded p-1 shadow-sm drag-handle"},[e.createVNode(e.unref(Vn),{class:"h-4 w-4 text-gray-400"})])),e.createVNode(pN,{title:n.$t("cms.builder."+(i==null?void 0:i.reference_type)),modelValue:r.value[c],"onUpdate:modelValue":u=>r.value[c]=u,parent:r.value,"onUpdate:parent":o[0]||(o[0]=u=>r.value=u)},null,8,["title","modelValue","onUpdate:modelValue","parent"]),e.unref(Wa)[i==null?void 0:i.reference_type]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(Wa)[i==null?void 0:i.reference_type]),{key:0,index:c,text:t(i==null?void 0:i.reference_type),count:Array.isArray(i==null?void 0:i.data)?i.data.length:0},null,8,["index","text","count"])):(e.openBlock(),e.createElementBlock("img",{key:1,src:e.unref(ci),alt:"Team collaboration",class:"w-full h-full object-cover"},null,8,bN))])])):e.createCommentVNode("",!0)]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),e.createVNode(dN,{class:"mt-4",title:l.title,modelValue:r.value,"onUpdate:modelValue":o[2]||(o[2]=i=>r.value=i)},null,8,["title","modelValue"])])}}};function gi(l){if(l===0)return"0 Bytes";const t=1024,a=["Bytes","KB","MB","GB","TB"],r=Math.floor(Math.log(l)/Math.log(t));return Number.parseFloat((l/Math.pow(t,r)).toFixed(2))+" "+a[r]}function yN(l){const t=new Date(l);return isNaN(t.getTime())?"":t.toISOString().slice(0,10)}const kN={__name:"TypeTag",props:{type:{type:String,required:!0}},setup(l){const t=new Map([["document","bg-blue-100 text-blue-800 border-blue-200 dark:bg-blue-900/30 dark:text-blue-300 dark:border-blue-700"],["image","bg-green-100 text-green-800 border-green-200 dark:bg-green-900/30 dark:text-green-300 dark:border-green-700"],["video","bg-purple-100 text-purple-800 border-purple-200 dark:bg-purple-900/30 dark:text-purple-300 dark:border-purple-700"]]);return(a,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors shadow-lg backdrop-blur-sm",e.unref(t).get(l.type)])},e.toDisplayString(l.type),3))}},xN={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6 max-h-[calc(100%-130px)] overflow-y-auto px-2 pt-2 pb-5"},wN={key:0,class:"flex flex-col items-center justify-center h-64 text-muted-foreground col-span-full"},_N=["onClick"],EN=["onClick"],CN={class:"truncate font-medium text-slate-800 dark:text-slate-100 mb-2"},VN={class:"text-sm text-slate-500 dark:text-slate-400"},NN=["onClick"],vN={class:"p-0"},BN={class:"aspect-video bg-slate-100 dark:bg-slate-700 rounded-t-lg overflow-hidden relative"},SN={class:"w-full h-full flex items-center justify-center bg-gradient-to-br from-slate-100 to-slate-200 dark:from-slate-700 dark:to-slate-800"},DN={key:0,class:"relative w-full"},AN=["src","alt"],MN={class:"p-4"},TN={class:"flex items-center justify-between mb-2"},LN={class:"font-medium text-slate-800 dark:text-slate-100 truncate flex-1 mr-2"},$N={class:"space-y-1 text-sm text-slate-500 dark:text-slate-400"},FN={class:"flex justify-between"},IN={class:"flex justify-between"},ON={__name:"MediaGrid",props:{files:{type:Array,required:!0},selectedFile:{type:Object,default:null},selectedFiles:{type:Array,default:()=>[]},isDeleteButton:{type:Boolean,default:!1}},emits:["delete-file","file-click","delete-folder"],setup(l,{emit:t}){Fe();const a=l,r=e.ref([]),n=e.ref(null),o=i=>{if(!i)return"";const c=new Date(i);return isNaN(c.getTime())?"":c.toISOString().slice(0,10)},s=()=>{r.value=a.files.sort((i,c)=>i.type==="dir"&&c.type!=="dir"?-1:i.type!=="dir"&&c.type==="dir"?1:0)};return e.onMounted(()=>s()),e.onUpdated(()=>s()),(i,c)=>{var u;return e.openBlock(),e.createElementBlock("div",xN,[((u=l.files)==null?void 0:u.length)===0?(e.openBlock(),e.createElementBlock("div",wN,[e.createVNode(e.unref(yl),{class:"w-12 h-12 mb-2"}),e.createElementVNode("p",null,e.toDisplayString(i.$t("cms.noFilesInFolder")),1)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,d=>{var m;return e.openBlock(),e.createElementBlock(e.Fragment,{key:d==null?void 0:d.url},[(d==null?void 0:d.type)==="dir"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"p-6 text-center rounded-xl h-[fit-content] relative text-card-foreground shadow-lg border-0 bg-white dark:bg-slate-800 backdrop-blur-sm hover:shadow-xl transition-all duration-200 transform hover:scale-105 cursor-pointer",onClick:f=>i.$emit("file-click",d)},[l.isDeleteButton?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:e.withModifiers(f=>{n.value=d},["stop"]),class:"absolute top-4 right-4 p-1 border border-gray-300 dark:border-slate-700 rounded-lg cursor-pointer hover:bg-gray-200 dark:hover:bg-slate-700 group"},[e.createVNode(e.unref(Gt),{class:"w-4 h-4 text-gray-500 group-hover:text-red-500"})],8,EN)):e.createCommentVNode("",!0),e.createVNode(e.unref(Cn),{class:"w-16 h-16 mx-auto mb-4 text-blue-600"}),e.createElementVNode("h3",CN,e.toDisplayString(d==null?void 0:d.name),1),e.createElementVNode("p",VN,e.toDisplayString(d==null?void 0:d.count)+" "+e.toDisplayString(i.$t("cms.media.files")),1)],8,_N)):(d==null?void 0:d.type)==="file"?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["h-[fit-content] rounded-xl text-card-foreground shadow-lg border-0 bg-white dark:bg-slate-800 backdrop-blur-sm hover:shadow-xl transition-all duration-200 transform hover:scale-105 group cursor-pointer",{"bg-accent text-accent-foreground ring-2 ring-primary":((m=l.selectedFile)==null?void 0:m.url)===(d==null?void 0:d.url)||l.selectedFiles&&l.selectedFiles.some(f=>f.id===d.id)}]),onClick:f=>i.$emit("file-click",d)},[e.createElementVNode("div",vN,[e.createElementVNode("div",BN,[e.createElementVNode("div",SN,[(d==null?void 0:d.filetype)==="image"&&(d!=null&&d.filepath||d!=null&&d.url)?(e.openBlock(),e.createElementBlock("div",DN,[e.createElementVNode("img",{src:d==null?void 0:d.preview,alt:(d==null?void 0:d.alt)||(d==null?void 0:d.filename),class:"object-cover w-full h-full rounded text-xs"},null,8,AN)])):(e.openBlock(),e.createBlock(e.unref(Il),{key:1,class:"w-12 h-12 text-gray-500"}))])]),e.createElementVNode("div",MN,[e.createElementVNode("div",TN,[e.createElementVNode("h3",LN,e.toDisplayString(d.filename),1),e.createVNode(kN,{type:d==null?void 0:d.filetype},null,8,["type"])]),e.createElementVNode("div",$N,[e.createElementVNode("div",FN,[e.createElementVNode("span",null,e.toDisplayString(i.$t("cms.media.size"))+":",1),e.createElementVNode("span",null,e.toDisplayString(e.unref(gi)(d.filesize)),1)]),e.createElementVNode("div",IN,[e.createElementVNode("span",null,e.toDisplayString(i.$t("cms.media.uploaded"))+":",1),e.createElementVNode("span",null,e.toDisplayString(o(d.created_at)),1)])])])])],10,NN)):e.createCommentVNode("",!0)],64)}),128))])}}},PN={},RN={"aria-hidden":"true",focusable:"false",role:"img",viewBox:"0 0 16 16",width:"16",height:"16",fill:"currentColor"};function UN(l,t){return e.openBlock(),e.createElementBlock("svg",RN,[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M.513 1.513A1.75 1.75 0 0 1 1.75 1h3.5c.55 0 1.07.26 1.4.7l.9 1.2a.25.25 0 0 0 .2.1H 13a1 1 0 0 1 1 1v.5H2.75a.75.75 0 0 0 0 1.5h11.978a1 1 0 0 1 .994 1.117L15 13.25A1.75 1.75 0 0 1 13.25 15H1.75A1.75 1.75 0 0 1 0 13.25V2.75c0-.464.184-.91.513-1.237Z"},null,-1),e.createElementVNode("path",{d:"M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"},null,-1)])])}const jN=Qt(PN,[["render",UN]]),zN={},HN={"aria-hidden":"true",focusable:"false",role:"img",viewBox:"0 0 16 16",width:"16",height:"16",fill:"currentColor"};function qN(l,t){return e.openBlock(),e.createElementBlock("svg",HN,[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M.513 1.513A1.75 1.75 0 0 1 1.75 1h3.5c.55 0 1.07.26 1.4.7l.9 1.2a.25.25 0 0 0 .2.1H 13a1 1 0 0 1 1 1v.5H2.75a.75.75 0 0 0 0 1.5h11.978a1 1 0 0 1 .994 1.117L15 13.25A1.75 1.75 0 0 1 13.25 15H1.75A1.75 1.75 0 0 1 0 13.25V2.75c0-.464.184-.91.513-1.237Z"},null,-1),e.createElementVNode("path",{d:"M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"},null,-1)])])}const GN=Qt(zN,[["render",qN]]),WN={key:0,class:"flex flex-col items-center justify-center h-64 text-muted-foreground"},KN={key:1,class:"w-full text-sm caption-bottom"},YN={class:"[&_tr]:border-b"},XN={class:"border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted"},ZN={class:"h-12 px-4 text-left align-middle font-medium text-muted-foreground w-[300px]"},QN={class:"h-12 px-4 font-medium text-left align-middle text-muted-foreground"},JN={class:"h-12 px-4 font-medium text-left align-middle text-muted-foreground"},ev={class:"hidden h-12 px-4 font-medium text-left align-middle text-muted-foreground md:table-cell"},tv={class:"[&_tr:last-child]:border-0"},lv=["onClick"],av={class:"p-4 font-medium align-middle"},rv={class:"flex items-center gap-2"},nv={key:1,class:"relative w-8 h-8"},ov=["src","alt"],sv={class:"truncate max-w-[200px]"},iv={class:"p-4 align-middle"},cv={class:"p-4 align-middle"},dv={class:"hidden p-4 align-middle md:table-cell"},uv={key:0},mv={__name:"MediaList",props:{files:{type:Array,required:!0},selectedFile:{type:Object,default:null},selectedFiles:{type:Array,default:()=>[]}},emits:["file-click","delete-folder"],setup(l,{emit:t}){const{t:a}=Fe(),r=e.ref(null),n=t,o=()=>{Ca({title:a("cms.builder.deleteTitle"),message:a("cms.builder.deleteObject"),type:"error",onConfirm:()=>{s()}})},s=()=>{n("delete-folder",r.value)};return(i,c)=>{const u=e.resolveComponent("File");return e.openBlock(),e.createElementBlock("div",null,[l.files.length===0?(e.openBlock(),e.createElementBlock("div",WN,[e.createVNode(u,{class:"w-12 h-12 mb-2"}),e.createElementVNode("p",null,e.toDisplayString(i.$t("cms.media.noFilesInFolder")),1)])):(e.openBlock(),e.createElementBlock("table",KN,[e.createElementVNode("thead",YN,[e.createElementVNode("tr",XN,[e.createElementVNode("th",ZN,e.toDisplayString(i.$t("cms.media.name")),1),e.createElementVNode("th",QN,e.toDisplayString(i.$t("cms.media.type")),1),e.createElementVNode("th",JN,e.toDisplayString(i.$t("cms.media.size")),1),e.createElementVNode("th",ev,e.toDisplayString(i.$t("cms.media.updatedAt")),1),c[0]||(c[0]=e.createElementVNode("th",null,null,-1))])]),e.createElementVNode("tbody",tv,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.files,d=>{var m,f,p,y,h;return e.openBlock(),e.createElementBlock("tr",{key:d.id,class:e.normalizeClass(["border-b transition-colors hover:bg-blue-200/50 data-[state=selected]:bg-muted cursor-pointer",{"bg-blue-200":((m=r.value)==null?void 0:m.id)===d.id&&((f=r.value)==null?void 0:f.type)===d.type||l.selectedFiles&&l.selectedFiles.some(g=>g.id===d.id&&g.type===d.type)}]),onClick:g=>i.$emit("cms.file-click",d)},[e.createElementVNode("td",av,[e.createElementVNode("div",rv,[d.type==="dir"?(e.openBlock(),e.createBlock(jN,{key:0,class:"w-5 h-5 text-blue-500"})):(d==null?void 0:d.filetype)==="image"&&(d!=null&&d.filepath)?(e.openBlock(),e.createElementBlock("div",nv,[e.createElementVNode("img",{src:d==null?void 0:d.preview,alt:(d==null?void 0:d.alt)||(d==null?void 0:d.filename),class:"object-cover w-full h-full rounded"},null,8,ov)])):(d==null?void 0:d.filetype)==="image"?(e.openBlock(),e.createBlock(GN,{key:2,class:"w-5 h-5 text-green-500"})):(e.openBlock(),e.createBlock(u,{key:3,class:"w-5 h-5 text-gray-500"})),e.createElementVNode("span",sv,e.toDisplayString((d==null?void 0:d.filename)||(d==null?void 0:d.name)),1)])]),e.createElementVNode("td",iv,e.toDisplayString((d==null?void 0:d.type)==="dir"?i.$t("cms.media.folder"):((y=(p=d==null?void 0:d.filetype)==null?void 0:p.charAt(0))==null?void 0:y.toUpperCase())+((h=d==null?void 0:d.filetype)==null?void 0:h.slice(1))),1),e.createElementVNode("td",cv,e.toDisplayString((d==null?void 0:d.type)==="dir"?"--":e.unref(gi)(d==null?void 0:d.filesize)),1),e.createElementVNode("td",dv,e.toDisplayString(d!=null&&d.updated_at?e.unref(yN)(d==null?void 0:d.updated_at):"--"),1),d.type==="dir"?(e.openBlock(),e.createElementBlock("td",uv,[e.createVNode(e.unref(Gt),{class:"w-4 h-4 text-red-500 cursor-pointer",onClick:e.withModifiers(o,["stop"])},null,8,["onClick"])])):e.createCommentVNode("",!0)],10,lv)}),128))])]))])}}},pv={},fv={xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function hv(l,t){return e.openBlock(),e.createElementBlock("svg",fv,[...t[0]||(t[0]=[e.createElementVNode("path",{d:"m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"},null,-1),e.createElementVNode("polyline",{points:"9 22 9 12 15 12 15 22"},null,-1)])])}const gv=Qt(pv,[["render",hv]]),bv={class:"flex items-center space-x-1"},yv=["onClick"],kv={__name:"MediaBreadcrumb",props:{currentPath:{type:Array,required:!0}},emits:["navigate"],setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",bv,[e.createElementVNode("button",{class:"flex gap-x-1 items-center px-2 py-1 rounded text-sm font-medium transition-all duration-200 text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20",onClick:a[0]||(a[0]=r=>t.$emit("navigate",[]))},[e.createVNode(gv,{class:"w-3 h-3"}),e.createTextVNode(" "+e.toDisplayString(t.$t("cms.media.mediaLibrary")),1)]),l.currentPath.length>0?(e.openBlock(),e.createBlock(e.unref(bl),{key:0,class:"w-3 h-3 text-slate-400 dark:text-slate-500"})):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.currentPath,(r,n)=>(e.openBlock(),e.createElementBlock("button",{key:n,class:"flex gap-x-1 items-center px-2 py-1 rounded text-sm font-medium transition-all duration-200 text-blue-700 dark:text-blue-300 bg-blue-50 dark:bg-blue-900/20",onClick:o=>t.$emit("navigate",l.currentPath.slice(0,n+1))},[e.createVNode(e.unref(Cn),{class:"w-3 h-3"}),e.createTextVNode(" "+e.toDisplayString(r)+" ",1),n<l.currentPath.length-1?(e.openBlock(),e.createBlock(e.unref(bl),{key:0,class:"w-3 h-3 text-slate-400 dark:text-slate-500"})):e.createCommentVNode("",!0)],8,yv))),128))]))}},xv=["src"],wv={class:"absolute inset-0 bg-black bg-opacity-50 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity rounded-lg gap-2"},_v=["onClick"],Ev=["onClick"],Cv=["title"],Vv={key:1,class:"relative group"},Nv=["src"],vv={class:"absolute inset-0 bg-black bg-opacity-50 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity rounded-lg gap-2"},Bv=["title"],Sv={key:2,class:"absolute inset-0 bg-white bg-opacity-75 flex items-center justify-center rounded-lg z-10"},Dv={class:"flex flex-col items-center gap-2"},Av={class:"text-xs text-gray-600"},Mv=["multiple","disabled"],Tv={class:"whitespace-nowrap text-sm"},Lv={class:"whitespace-nowrap text-sm"},$v={class:"flex items-center justify-between p-4 border-b"},Fv={class:"text-lg font-semibold"},Iv={class:"flex items-center justify-between gap-4 p-4 border-b"},Ov={class:"relative z-[1] rounded-xl text-card-foreground shadow-lg border-0 bg-white dark:bg-slate-800 backdrop-blur-sm mb-6 p-4 mx-4"},Pv={class:"flex items-center justify-between gap-4"},Rv={class:"flex items-center gap-4 flex-1"},Uv={class:"relative flex-1 max-w-md"},jv=["placeholder"],zv={class:"flex items-center gap-2 relative"},Hv={class:"text-xs font-bold"},qv={class:"text-xs font-bold"},Gv={key:0,class:"w-full absolute top-full left-1/2 transform -translate-x-1/2 mt-2 z-50 bg-white dark:bg-slate-700 flex flex-col items-start border border-slate-200 dark:border-slate-600 rounded-md shadow-lg"},Wv={class:"flex items-center gap-2"},Kv={class:"flex flex-col gap-4 overflow-y-auto p-4 flex-1"},Yv={class:"p-4 border-t flex items-center justify-between"},Xv={key:0,class:"text-sm text-gray-600 dark:text-gray-400"},Zv={key:1},Qv=["disabled"],Ll={__name:"vs-form-media-select",props:e.mergeModels({multiple:{type:Boolean,default:!1},multi:{type:Boolean,default:!1}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["change"],["update:modelValue"]),setup(l,{emit:t}){const{t:a}=Fe(),r=rt.useRoute(),n=rt.useRouter(),o=e.useModel(l,"modelValue"),s=t,i=l,c=e.computed(()=>i.multiple||i.multi),u=e.ref(null),d=e.computed(()=>o.value||u.value),m=e.computed(()=>{if(!c.value)return[];const U=d.value;return U?Array.isArray(U)?U:[U]:[]}),f=e.computed(()=>d.value?typeof d.value=="object"?d.value.filename||d.value.file_name||d.value.native_file_name||"File":typeof d.value=="string"?d.value.split("cms./").pop()||d.value:"File":""),p=e.ref(!1),y=e.ref(!1),h=e.ref("grid"),g=e.ref([]),b=e.ref([]),w=e.ref([]),x=e.ref(),k=e.ref([]),_=e.ref(null),N=e.ref(!1),V=e.ref(null),P=e.ref(null),$=e.ref({}),M=e.ref(""),A=e.ref(!1),q=e.ref("name"),Q=new Map([["name",a("cms.media.sortBy.name")],["filesize",a("cms.media.sortBy.filesize")]]),R=U=>typeof U=="string"?U:(U==null?void 0:U.filepath)||(U==null?void 0:U.file_path)||U,I=U=>U?typeof U=="string"?U.split("cms./").pop()||U:U.filename||U.file_name||U.native_file_name||"File":"",F=U=>typeof U=="string"?U:(U==null?void 0:U.preview)||`/file/resize?filepath=${R(U)}&h=137&quality=75`,D=()=>{_.value&&_.value.click()},z=()=>{p.value=!p.value,p.value&&ee()},ee=()=>{if(V.value){const U=V.value.getBoundingClientRect();$.value={top:`${U.bottom+10}px`,left:`${U.left+U.width/2}px`,transform:"translateX(-50%)",width:"200px"}}},me=U=>{var Y;if(U.type==="dir")Ye([...g.value,U.name]);else if(c.value){const le=k.value.findIndex(ae=>ae.id===U.id);le>=0?k.value.splice(le,1):k.value.push(U)}else x.value=U.id===((Y=x.value)==null?void 0:Y.id)?null:U},Ne=U=>{q.value=U,A.value=!1,b.value=b.value.sort((Y,le)=>{var ae;if((Y==null?void 0:Y.type)==="dir")return-1;if(U==="name")return(ae=Y==null?void 0:Y.name)==null?void 0:ae.localeCompare(le==null?void 0:le.name);if(U==="filesize")return(le==null?void 0:le.filesize)-(Y==null?void 0:Y.filesize)})},Ke=async()=>{try{const U=g.value.join("/"),le=await(await fetch(`/api/cms-media?subdir=${U}${M.value?"&search="+M.value:""}`,{method:"GET"})).json();le.data?(b.value=le.data.map(ae=>({...ae,id:ae.type==="dir"?`dir-${ae.name}`:ae.id,preview:`/file/resize?filepath=${ae.filepath}&h=137&quality=75`})),Ne(q.value)):b.value=[]}catch(U){console.error("Search error:",U),b.value=[]}},qt=()=>{if(c.value){if(k.value.length>0){const U=Array.isArray(o.value)?[...o.value]:o.value?[o.value]:[],Y=Array.isArray(u.value)?[...u.value]:u.value?[u.value]:[];k.value.forEach(le=>{const ae=le.filepath||le.file_path;U.some(de=>(typeof de=="string"?de:(de==null?void 0:de.filepath)||(de==null?void 0:de.file_path))===ae)||(U.push(ae),Y.push(le))}),o&&(o.value=U),u.value=Y,s("cms.change",U),k.value=[]}}else if(x.value){const U=x.value.filepath||x.value.file_path;o&&(o.value=U),u.value=x.value,s("cms.change",U),x.value=null}Re()},Re=()=>{y.value=!1},Ye=U=>{g.value=U,w.value=[...w.value,U],x.value=null,c.value&&(k.value=[]),yt()},vt=()=>{w.value.length>1&&(w.value.pop(),g.value=w.value[w.value.length-1],x.value=null,c.value&&(k.value=[]),yt())},yt=async()=>{try{const U=g.value.join("/"),le=await(await fetch(`/api/cms-media?subdir=${U}${M.value?"&search="+M.value:""}`,{method:"GET"})).json();le.data?(b.value=le.data.map(ae=>({...ae,id:ae.type==="dir"?`dir-${ae.name}`:ae.id,preview:`/file/resize?filepath=${ae.filepath}&h=137&quality=75`})),Ne(q.value)):b.value=[]}catch(U){console.error("Fetch error:",U),b.value=[]}},Et=async(U,Y)=>{try{const le=typeof U=="string"?U:R(U);if(await fetch(`/file/delete${le}`),c.value){const ae=Array.isArray(o.value)?[...o.value]:[],de=Array.isArray(u.value)?[...u.value]:[];if(Y!==void 0&&Y>=0)ae.splice(Y,1),de.splice(Y,1);else{const Ae=ae.findIndex(C=>(typeof C=="string"?C:(C==null?void 0:C.filepath)||(C==null?void 0:C.file_path))===le);Ae>=0&&(ae.splice(Ae,1),de.splice(Ae,1))}o&&(o.value=ae.length>0?ae:null),u.value=de.length>0?de:null,s("cms.change",ae.length>0?ae:null)}else o&&(o.value=null),u.value=null,s("cms.change",null);return!0}catch(le){return console.error(le),!1}},Pt=async U=>{try{const Y=await fetch(`/file/download/files/uploads${U}`),le=await Y.arrayBuffer(),ae=Y.headers["content-type"],de=new TextDecoder("utf-8").decode(le),Ae=new Blob([de],{type:ae}),C=document.createElement("cms.a");C.setAttribute("download",U),C.href=window.URL.createObjectURL(Ae),C.click()}catch(Y){console.error(Y.message)}},at=async U=>{if(!U.target.files||U.target.files.length===0)return;const Y=Array.from(U.target.files);console.log("Uploading files:",Y),N.value=!0;try{const le=[];for(const ae of Y){const de=new FormData;de.append("file",ae);const Ae=await fetch("/file/upload/uploads?id=1&form=form&table=table",{method:"POST",body:de});if(!Ae.ok)throw new Error(`Upload failed: ${Ae.status}`);const C=await Ae.json();console.log("Upload result:",C);const v=C.result,H={file_id:v.file_id,file_name:v.file_name,file_path:v.file_path,filepath:v.file_path,format:v.format,size:v.size,entity_id:v.entity_id,dir:v.dir,native_file_name:v.native_file_name,preview:`/file/resize?filepath=${v.file_path}&h=137&quality=75`};le.push(H)}if(c.value){const ae=Array.isArray(o.value)?[...o.value]:o.value?[o.value]:[],de=Array.isArray(u.value)?[...u.value]:u.value?[u.value]:[];le.forEach(Ae=>{ae.push(Ae.file_path),de.push(Ae)}),o&&(o.value=ae),u.value=de,s("cms.change",ae)}else{const ae=le[0];o&&(o.value=ae.file_path),u.value=ae,s("cms.change",ae.file_path)}p.value=!1}catch(le){console.error("Upload error:",le),alert("cms.Помилка завантаження файлу: "+le.message)}finally{N.value=!1}U.target.value=""};e.watch(y,U=>{U&&yt()}),e.watch(g,U=>{U.length>0?n.push({query:{path:U.join("/")}}):n.push({query:{path:void 0}})});let st;return e.watch(M,U=>{clearTimeout(st),st=setTimeout(()=>{Ke()},500)}),e.watch(o,U=>{var Y,le,ae,de;if(U&&typeof U=="object"){const Ae=((Y=x.value)==null?void 0:Y.filepath)||((le=x.value)==null?void 0:le.file_path);U.filepath!==Ae&&U.file_path!==Ae&&(x.value=null)}else if(U&&typeof U=="string"){const Ae=((ae=x.value)==null?void 0:ae.filepath)||((de=x.value)==null?void 0:de.file_path);U!==Ae&&(x.value=null)}}),e.onMounted(()=>{var Y,le;g.value=((le=(Y=r.query)==null?void 0:Y.path)==null?void 0:le.split("cms./"))||[],w.value=[[]],o.value||(x.value=null);const U=ae=>{var de;p.value&&!((de=V.value)!=null&&de.contains(ae.target))&&(p.value=!1),A.value&&P.value&&!P.value.contains(ae.target)&&(A.value=!1)};document.addEventListener("click",U)}),(U,Y)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",e.mergeProps(U.$attrs,{class:"flex gap-4 flex-wrap"}),[c.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(m.value,(le,ae)=>(e.openBlock(),e.createElementBlock("div",{key:ae,class:"relative group"},[e.createElementVNode("img",{src:F(le),alt:"Selected File",class:"w-32 h-32 object-cover rounded-lg"},null,8,xv),e.createElementVNode("div",wv,[e.createElementVNode("button",{type:"button",onClick:de=>Et(le,ae),class:"p-2 rounded-full bg-red-500 text-white hover:bg-red-600 transition-colors"},[e.createVNode(e.unref(Gt),{class:"w-4 h-4"})],8,_v),e.createElementVNode("button",{type:"button",onClick:de=>Pt(R(le)),class:"p-2 rounded-full bg-blue-500 text-white hover:bg-blue-600 transition-colors"},[e.createVNode(e.unref(Qa),{class:"w-4 h-4"})],8,Ev)]),e.createElementVNode("div",{class:"absolute bottom-full left-0 mb-2 px-3 py-1.5 bg-gray-900 text-white text-xs rounded-lg opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none whitespace-nowrap z-10 max-w-[200px] truncate",title:I(le)},[e.createTextVNode(e.toDisplayString(I(le))+" ",1),Y[12]||(Y[12]=e.createElementVNode("div",{class:"absolute top-full left-4 border-4 border-transparent border-t-gray-900"},null,-1))],8,Cv)]))),128)):d.value?(e.openBlock(),e.createElementBlock("div",Vv,[e.createElementVNode("img",{src:d.value.preview||d.value,alt:"Selected File",class:"w-32 h-32 object-cover rounded-lg"},null,8,Nv),e.createElementVNode("div",vv,[e.createElementVNode("button",{type:"button",onClick:Y[0]||(Y[0]=le=>{var ae,de;return Et(((ae=d.value)==null?void 0:ae.filepath)||((de=d.value)==null?void 0:de.file_path)||d.value)}),class:"p-2 rounded-full bg-red-500 text-white hover:bg-red-600 transition-colors"},[e.createVNode(e.unref(Gt),{class:"w-4 h-4"})]),e.createElementVNode("button",{type:"button",onClick:Y[1]||(Y[1]=le=>{var ae,de;return Pt(((ae=d.value)==null?void 0:ae.filepath)||((de=d.value)==null?void 0:de.file_path)||d.value)}),class:"p-2 rounded-full bg-blue-500 text-white hover:bg-blue-600 transition-colors"},[e.createVNode(e.unref(Qa),{class:"w-4 h-4"})])]),e.createElementVNode("div",{class:"absolute bottom-full left-0 mb-2 px-3 py-1.5 bg-gray-900 text-white text-xs rounded-lg opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none whitespace-nowrap z-10 max-w-[200px] truncate",title:f.value},[e.createTextVNode(e.toDisplayString(f.value)+" ",1),Y[13]||(Y[13]=e.createElementVNode("div",{class:"absolute top-full left-4 border-4 border-transparent border-t-gray-900"},null,-1))],8,Bv)])):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"triggerButton",ref:V,class:e.normalizeClass(["relative w-32 h-32 flex items-center justify-center border border-dotted border-gray-300 rounded-lg hover:border-blue-500 hover:bg-blue-500/10 hover:cursor-pointer transition-all",{"border-blue-500 bg-blue-500/10":p.value,"opacity-50 cursor-not-allowed":N.value}]),onClick:z},[N.value?(e.openBlock(),e.createBlock(e.unref(er),{key:0,class:"w-4 h-4 animate-spin text-blue-500"})):(e.openBlock(),e.createBlock(e.unref(rl),{key:1,class:"w-4 h-4"})),N.value?(e.openBlock(),e.createElementBlock("div",Sv,[e.createElementVNode("div",Dv,[e.createVNode(e.unref(er),{class:"w-6 h-6 animate-spin text-blue-500"}),e.createElementVNode("span",Av,e.toDisplayString(U.$t("cms.media.uploading")),1)])])):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed bg-white z-50 border border-gray-200 rounded-lg shadow-lg flex flex-col items-center justify-center",style:e.normalizeStyle($.value)},[e.createElementVNode("div",{class:e.normalizeClass(["relative overflow-hidden flex justify-start items-center w-full gap-2 p-4 hover:bg-blue-50 text-blue-700 border hover:border-blue-200 dark:bg-slate-700 dark:text-slate-100 hover:cursor-pointer",{"opacity-50 cursor-not-allowed":N.value}]),onClick:Y[3]||(Y[3]=le=>!N.value&&D())},[e.createElementVNode("input",{type:"file",ref_key:"fileInput",ref:_,class:"absolute justify-center bottom-0 left-0 w-full opacity-0",onChange:at,onClick:Y[2]||(Y[2]=e.withModifiers(()=>{},["stop"])),multiple:c.value,disabled:N.value},null,40,Mv),N.value?(e.openBlock(),e.createBlock(e.unref(er),{key:0,class:"w-4 h-4 animate-spin"})):(e.openBlock(),e.createBlock(e.unref(Qa),{key:1})),e.createElementVNode("span",Tv,e.toDisplayString(N.value?U.$t("cms.media.uploading"):U.$t("cms.media.upload")),1)],2),e.createElementVNode("div",{onClick:Y[4]||(Y[4]=le=>y.value=!0),class:"flex justify-start items-center w-full gap-2 p-4 hover:bg-blue-50 text-blue-700 border hover:border-blue-200 dark:bg-slate-700 dark:text-slate-100 hover:cursor-pointer"},[e.createVNode(e.unref(ma)),e.createElementVNode("span",Lv,e.toDisplayString(U.$t("cms.media.selectFromMedia")),1)])],4)):e.createCommentVNode("",!0)]))],2)],16),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[y.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-50",onClick:Re},[e.createElementVNode("div",{class:"bg-white rounded-lg shadow-xl max-w-4xl w-full mx-4 max-h-[90vh] flex flex-col",onClick:Y[11]||(Y[11]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",$v,[e.createElementVNode("h3",Fv,e.toDisplayString(U.$t("cms.media.selectFiles")),1),e.createElementVNode("button",{onClick:Re,class:"text-gray-400 hover:text-gray-600"},[...Y[14]||(Y[14]=[e.createElementVNode("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])]),e.createElementVNode("div",Iv,[e.createVNode(kv,{"current-path":g.value,onNavigate:Ye,onNavigateBack:vt},null,8,["current-path"])]),e.createElementVNode("div",Ov,[e.createElementVNode("div",Pv,[e.createElementVNode("div",Rv,[e.createElementVNode("div",Uv,[e.createVNode(e.unref(tr),{class:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-slate-400 dark:text-slate-500"}),e.withDirectives(e.createElementVNode("input",{type:"text",placeholder:U.$t("cms.media.search"),class:"w-full pl-10 pr-4 py-2 text-sm border border-slate-200 dark:border-slate-600 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent bg-white dark:bg-slate-700 text-slate-700 dark:text-slate-200 placeholder-slate-400 dark:placeholder-slate-500","onUpdate:modelValue":Y[5]||(Y[5]=le=>M.value=le)},null,8,jv),[[e.vModelText,M.value]])]),e.createElementVNode("div",zv,[e.createElementVNode("span",Hv,e.toDisplayString(U.$t("cms.media.sortBy.title")+": "),1),e.createElementVNode("button",{ref_key:"sortByButton",ref:P,class:"relative z-[1000] inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors border shadow-sm h-8 rounded-md px-3 text-xs bg-white border-slate-300 text-slate-700 disabled:pointer-events-none disabled:opacity-50 hover:text-accent-foreground hover:bg-slate-50 dark:bg-slate-700 dark:border-slate-600 dark:text-slate-300 dark:hover:bg-slate-600",onClick:Y[8]||(Y[8]=le=>A.value=!A.value)},[e.createVNode(e.unref(En),{class:"w-4 h-4"}),e.createElementVNode("span",qv,e.toDisplayString(e.unref(Q).get(q.value)),1),A.value?(e.openBlock(),e.createElementBlock("div",Gv,[e.createElementVNode("span",{class:"text-left text-xs font-bold w-full p-2 hover:bg-slate-100 dark:hover:bg-slate-600 border-b border-slate-200 dark:border-slate-600 cursor-pointer",onClick:Y[6]||(Y[6]=e.withModifiers(le=>Ne("name"),["stop"]))},e.toDisplayString(U.$t("cms.media.sortBy.name")),1),e.createElementVNode("span",{class:"text-left text-xs font-bold w-full p-2 hover:bg-slate-100 dark:hover:bg-slate-600 cursor-pointer",onClick:Y[7]||(Y[7]=e.withModifiers(le=>Ne("filesize"),["stop"]))},e.toDisplayString(U.$t("cms.media.sortBy.filesize")),1)])):e.createCommentVNode("",!0)],512)])]),e.createElementVNode("div",Wv,[e.createElementVNode("button",{class:e.normalizeClass(["inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 h-8 px-3 text-xs rounded-md",{"shadow bg-blue-600 hover:bg-blue-700 text-white":h.value==="grid","border shadow-sm hover:text-accent-foreground bg-white dark:bg-slate-700 border-slate-300 dark:border-slate-600 text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-600":h.value==="list"}]),onClick:Y[9]||(Y[9]=le=>h.value="grid")},[e.createVNode(e.unref(zi),{class:"w-4 h-4"})],2),e.createElementVNode("button",{class:e.normalizeClass(["inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 h-8 px-3 text-xs rounded-md",{"shadow bg-blue-600 hover:bg-blue-700 text-white":h.value==="list","border shadow-sm hover:text-accent-foreground bg-white dark:bg-slate-700 border-slate-300 dark:border-slate-600 text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-600":h.value==="grid"}]),onClick:Y[10]||(Y[10]=le=>h.value="list")},[e.createVNode(e.unref(pa),{class:"w-4 h-4"})],2)])])]),e.createElementVNode("div",Kv,[h.value==="grid"?(e.openBlock(),e.createBlock(ON,{key:0,files:b.value,"selected-file":c.value?null:x.value,"selected-files":c.value?k.value:[],onFileClick:me},null,8,["files","selected-file","selected-files"])):(e.openBlock(),e.createBlock(mv,{key:1,files:b.value,"selected-file":c.value?null:x.value,"selected-files":c.value?k.value:[],onFileClick:me},null,8,["files","selected-file","selected-files"]))]),e.createElementVNode("div",Yv,[c.value&&k.value.length>0?(e.openBlock(),e.createElementBlock("div",Xv,e.toDisplayString(U.$t("cms.media.selectedFiles",{count:k.value.length})),1)):(e.openBlock(),e.createElementBlock("div",Zv)),e.createElementVNode("button",{onClick:qt,disabled:c.value?k.value.length===0:!x.value,class:"flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium disabled:pointer-events-none disabled:opacity-50 h-9 px-4 py-2 ml-auto bg-blue-600 hover:bg-blue-700 text-white shadow-md hover:shadow-lg transition-all duration-200 transform hover:scale-105"},[e.createVNode(e.unref(rl),{class:"w-4 h-4 mr-2"}),e.createTextVNode(" "+e.toDisplayString(U.$t("cms.common.actions.add")),1)],8,Qv)])])])):e.createCommentVNode("",!0)]))],64))}},Jv={};function eB(l,t){const a=e.resolveComponent("vs-richtext-md",!0);return e.openBlock(),e.createBlock(a,{class:"w-full h-[300px]"})}const bi=Qt(Jv,[["render",eB]]),tB={props:{min:{type:Number},step:{type:Number,default:()=>1},max:{type:Number,default:()=>1/0},modelValue:{type:Number,default:()=>null},label:{type:String,default:()=>""},placeholder:{type:String,default:()=>"0"},disabled:{type:Boolean,default:()=>!1}},data(){return{id:`input-number-${Math.floor(Math.random()*1e3)}`,inputValue:this.modelValue}},watch:{modelValue(l){this.inputValue=l},inputValue(l){this.$emit("update:modelValue",l)}},methods:{validateInput(l){(l.key==="+"||l.key===","||l.key==="."||l.key==="-"&&this.inputValue&&this.inputValue.toString().length>0)&&l.preventDefault()},handleBlur(){let l=parseFloat(this.inputValue);this.$emit("blur"),isNaN(l)?l=this.min:l>this.max?l=this.max:l<this.min&&(l=this.min),this.inputValue=l,this.$emit("update:modelValue",this.inputValue)}}},lB={class:"p-0"},aB=["step","min","max","id","placeholder","disabled"];function rB(l,t,a,r,n,o){return e.openBlock(),e.createElementBlock("div",lB,[e.renderSlot(l.$slots,"label",e.normalizeProps(e.guardReactiveProps({id:n.id}))),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":t[0]||(t[0]=s=>n.inputValue=s),type:"number",onKeydown:t[1]||(t[1]=(...s)=>o.validateInput&&o.validateInput(...s)),onBlur:t[2]||(t[2]=(...s)=>o.handleBlur&&o.handleBlur(...s)),step:a.step,min:a.min,max:a.max,id:n.id,"aria-describedby":"helper-text-explanation",class:e.normalizeClass(["vs-number__input py-2 px-3 block w-full h-[38px] border border-solid border-stone-200 rounded-lg text-sm text-stone-800 placeholder:text-stone-500 focus:z-10 focus:border-1 focus:outline-none focus:border-blue-600 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-200 dark:placeholder:text-neutral-500 dark:focus:outline-none dark:focus:ring-1 dark:focus:ring-neutral-600",{"cursor-not-allowed":a.disabled}]),placeholder:a.placeholder,disabled:a.disabled},null,42,aB),[[e.vModelText,n.inputValue]])])}const yi=Qt(tB,[["render",rB]]),ki={__name:"vs-form-reletion-link",props:e.mergeModels({relation:{type:String,required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=e.useModel(l,"modelValue"),a=l,r=e.ref([]),n=async()=>{const s=await(await fetch(`/api/cms-suggest/${a.relation}`)).json();r.value=s==null?void 0:s.data};return e.onMounted(n),(o,s)=>{var i;return(i=r.value)!=null&&i.length?(e.openBlock(),e.createBlock(e.unref(Lr),{key:0,mode:"combo",modelValue:t.value,"onUpdate:modelValue":s[0]||(s[0]=c=>t.value=c),options:r.value},null,8,["modelValue","options"])):e.createCommentVNode("",!0)}}},nB={monaco:G_,edit:bC,preview:{__name:"vs-builder-preview",props:{data:{},dataModifiers:{},form:{},formModifiers:{}},emits:["update:data","update:form"],setup(l){$e["vs-input-custom-datatable"]=ii,$e["vs-input-reference"]=fn,$e["vs-input-texteditor"]=pn,$e["vs-input-mediaselect"]=Ll,$e["vs-input-file"]=Ll,$e["vs-input-image"]=Ll,$e["vs-input-richtext-md"]=bi,$e["vs-input-integer"]=yi,$e["vs-input-relation-link"]=ki;const t=e.ref({}),a=e.useModel(l,"data"),r=e.useModel(l,"form"),n=e.computed(()=>{var o,s;return((s=(o=a.value)==null?void 0:o.columns)==null?void 0:s.map(mn))||[]});return(o,s)=>{var i;return e.openBlock(),e.createElementBlock("div",{ref_key:"form",ref:r},[((i=n.value)==null?void 0:i.length)>0?(e.openBlock(),e.createBlock(e.unref(Xe),{key:0,modelValue:t.value,"onUpdate:modelValue":s[0]||(s[0]=c=>t.value=c),schema:n.value},null,8,["modelValue","schema"])):e.createCommentVNode("",!0)],512)}}}},oB={class:"max-w-6xl mx-auto"},sB={class:"flex items-center justify-between mb-6"},iB={class:"mb-2 text-2xl font-semibold text-gray-900"},cB={class:"lowercase"},dB={class:"text-gray-600"},uB={class:"flex items-center gap-2"},mB={class:"w-full"},pB={class:"flex items-center w-full h-10 max-w-md grid-cols-3 p-1 mb-6 bg-white border border-gray-200 rounded-md text-muted-foreground"},fB=["onClick"],hB={key:0,class:"container mx-auto bg-white rounded-md py-4 px-2 bg-opacity-50"},gB={__name:"EditCollectionPage",setup(l){const{t}=Fe(),a=e.inject("cms.fetchContentTypes"),r=e.ref("edit"),n=e.ref({yaml:"",data:{columns:[],type:"collection"}}),o=e.ref({}),s=e.ref(""),i=rt.useRoute(),c=rt.useRouter(),u=e.ref(!1),d=e.computed(()=>[{name:t("cms.builder.edit"),id:"edit"},{name:t("cms.builder.preview"),id:"preview"}]),m=async()=>{var p;try{const h=await(await fetch(`/api/cms-type/${i.params.id}`)).json(),g={...h,columns:Array.isArray(h.columns)?h.columns:(p=Object.entries((h==null?void 0:h.columns)||{}))==null?void 0:p.map(([b,w])=>({...w,name:b}))};n.value={...n.value,data:g},s.value=g.title||g.name}catch(y){console.error(y)}finally{u.value=!0}},f=async()=>{var p,y;try{if(await o.value.validate()){xe({type:"warning",title:t("cms.common.actions.warning"),message:t("cms.builder.editFieldFailed")});return}const g=await fetch(`/api/cms-type/${i.params.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r.value==="monaco"?(p=n.value)==null?void 0:p.yaml:(y=n.value)==null?void 0:y.data)});c.push("/settings/collections"),a(),xe({type:"success",title:t("cms.common.actions.success"),message:t("cms.collections.collectionCreated")})}catch(h){console.error(h),xe({type:"error",title:t("cms.common.actions.error"),message:t("cms.collections.collectionCreationFailed")})}};return e.onMounted(()=>{m()}),(p,y)=>{const h=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("div",oB,[e.createElementVNode("div",sB,[e.createElementVNode("div",null,[e.createElementVNode("h1",iB,[e.createTextVNode(e.toDisplayString(p.$t("cms.builder.editCollection"))+" ",1),e.createElementVNode("span",cB,e.toDisplayString(s.value),1)]),e.createElementVNode("p",dB,e.toDisplayString(p.$t("cms.builder.editContentForYourSite")),1)]),e.createElementVNode("div",uB,[e.createVNode(h,{to:"/settings/collections",class:"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border bg-background hover:text-accent-foreground h-10 px-4 py-2 border-gray-300 text-gray-700 hover:bg-gray-50"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.$t("cms.common.actions.back")),1)]),_:1}),e.createElementVNode("button",{onClick:f,class:"inline-flex items-center justify-center gap-2 whitespace-nowrap text-white rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 text-primary-foreground h-10 px-4 py-2 bg-blue-600 hover:bg-blue-700"},e.toDisplayString(p.$t("cms.common.actions.save")),1)])]),e.createElementVNode("div",mB,[e.createElementVNode("div",pB,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,g=>(e.openBlock(),e.createElementBlock("button",{key:g.id,onClick:b=>r.value=g.id,class:e.normalizeClass(["inline-flex flex-1 items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm data-[state=active]:bg-blue-50 data-[state=active]:text-blue-700 data-[state=active]:border-blue-200",g.id===r.value?"bg-blue-50 text-blue-700 border-blue-200":""])},e.toDisplayString(g.name),11,fB))),128))])]),u.value?(e.openBlock(),e.createElementBlock("div",hB,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(nB)[r.value]),{yaml:n.value.yaml,"onUpdate:yaml":y[0]||(y[0]=g=>n.value.yaml=g),data:n.value.data,"onUpdate:data":y[1]||(y[1]=g=>n.value.data=g),form:o.value,"onUpdate:form":y[2]||(y[2]=g=>o.value=g)},null,40,["yaml","data","form"]))])):e.createCommentVNode("",!0)])}}},bB=[{key:"title",label:"common.title",localization:!0,type:"text"},{key:"description",label:"common.description",localization:!0,type:"text"},{key:"keywords",label:"common.keywords",localization:!0,type:"text"},{key:"meta",label:"common.meta",type:"key-value",ignore:["title","description","keywords"]}],yB={__name:"VsFormTags",props:{modelValue:{default:()=>[]},modelModifiers:{}},emits:["update:modelValue"],setup(l,{expose:t}){const{t:a}=Fe(),r=e.useModel(l,"modelValue"),n=e.ref({}),o=e.ref(!1);e.provide("metaParentValue",r);const s=m=>Array.isArray(m)?m.map(f=>typeof f=="object"&&f!==null&&f.id?f.id:f):[],i=async m=>{if(!Array.isArray(m)||m.length===0)return[];try{const p=await(await fetch("/api/tags")).json(),y=(p==null?void 0:p.rows)||[];return m.map(h=>{const g=y.find(b=>b.tag_id===h);return g?{id:g.tag_id,text:g.value,color:g.color}:{id:h,text:"",color:"#ababab"}})}catch(f){return console.error("Error fetching tags:",f),m.map(p=>({id:p,text:"",color:"#ababab"}))}};e.onMounted(async()=>{await e.nextTick(),await e.nextTick(),setTimeout(()=>{var m;if(Array.isArray((m=r.value)==null?void 0:m.tag_list)){const f=s(r.value.tag_list);JSON.stringify(f)!==JSON.stringify(r.value.tag_list)&&(r.value.tag_list=f)}},100)}),e.watch(()=>r.value.tag_list,m=>{if(Array.isArray(m)&&!o.value){const f=s(m);JSON.stringify(f)!==JSON.stringify(m)&&(r.value.tag_list=f)}},{deep:!0}),e.watch(()=>r.value,m=>{if(m&&Array.isArray(m.tag_list)&&!o.value){const f=s(m.tag_list);JSON.stringify(f)!==JSON.stringify(m.tag_list)&&(m.tag_list=f)}},{deep:!0,immediate:!0}),e.watch(()=>{var m;return(m=r.value)==null?void 0:m.tag_list},m=>{Array.isArray(m)&&n.value&&e.nextTick(()=>{n.value&&n.value.setValue&&n.value.setValue("tag_list",m)})},{deep:!0});const c=async m=>{if(m.tag_list&&(m.tag_list=s(m.tag_list),r.value.tag_list=m.tag_list),await n.value.validate()){xe({type:"warning",title:a("cms.common.actions.warning"),message:a("cms.builder.editFieldFailed")});return}};t({restoreTagsBeforeSubmit:async()=>{var m;if(o.value=!0,Array.isArray((m=r.value)==null?void 0:m.tag_list)){console.log("Before restore:",r.value.tag_list);const f=await i(r.value.tag_list);console.log("After restore:",f),r.value.tag_list=f}setTimeout(()=>{o.value=!1},2e3)}});const d=e.computed(()=>{var m;return[{key:"tag_list",type:"select",multiple:!0,searchable:!1,placeholder:a("cms.builder.tags"),data:"tag_id",value:((m=r.value)==null?void 0:m.tag_list)||[]}]});return(m,f)=>r.value?(e.openBlock(),e.createBlock(e.unref(Xe),{key:0,schema:d.value,modelValue:r.value,"onUpdate:modelValue":[f[0]||(f[0]=p=>r.value=p),c]},null,8,["schema","modelValue"])):e.createCommentVNode("",!0)}},kB={class:"flex justify-end mb-4"},xB=["href"],wB=["src"],_B=["src"],EB={key:2,class:"w-full h-[80vh] flex items-center justify-center text-gray-500"},CB={__name:"VsPreview",props:{preview_path:{type:String,default:""},slug:{type:String,default:""}},setup(l){const t=e.ref(""),a=e.ref(""),r=async()=>{var o,s;try{const c=await(await fetch("/api/settings")).json();t.value=((s=(o=c==null?void 0:c.settings)==null?void 0:o.site_info)==null?void 0:s.previewUrl)||"http://ip.local.softpro.ua"}catch(i){console.error("Failed to fetch settings:",i),t.value="http://ip.local.softpro.ua"}},n=async()=>{var o;try{const i=await(await fetch("/user")).json();a.value=(o=i==null?void 0:i.user)==null?void 0:o.draftKey}catch(s){console.error("Failed to fetch user:",s)}};return e.onMounted(()=>{r(),n()}),(o,s)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",kB,[e.createElementVNode("a",{href:`${t.value}/uk/${l.preview_path}${l.slug}${a.value?`?draftKey=${a.value}`:""}`,target:"_blank",class:"inline-flex items-center gap-2 px-3 py-1.5 text-black-600 bg-white border border-blue-200 rounded hover:border-blue-300 hover:bg-blue-50 transition-colors duration-200 font-normal cursor-pointer"},[s[0]||(s[0]=e.createTextVNode(" Переглянути на сайті ",-1)),e.createVNode(e.unref(Ui),{class:"w-4 h-4"})],8,xB)]),t.value&&l.preview_path?(e.openBlock(),e.createElementBlock("iframe",{key:0,src:`${t.value}/uk/${l.preview_path}${l.slug}?hideHeader=true&hideFooter=true`,class:"w-full h-[80vh]"},null,8,wB)):t.value?(e.openBlock(),e.createElementBlock("iframe",{key:1,src:`${t.value}/uk/${l.slug}?hideHeader=true&hideFooter=true`,class:"w-full h-[80vh]"},null,8,_B)):(e.openBlock(),e.createElementBlock("div",EB," Loading preview... "))]))}},VB={class:"space-y-6 max-w-6xl mx-auto relative bg-white"},NB={class:"p-4 sticky top-[-24px] z-10 bg-white dark:bg-slate-800"},vB={class:"flex items-center justify-between"},BB={class:"flex items-center gap-4"},SB={class:"text-2xl font-semibold text-gray-900 dark:text-white"},DB=["href","title"],AB={class:"flex items-center space-x-3"},MB={class:"w-full mt-6 flex items-center justify-between"},TB={class:"flex items-center w-full h-10 max-w-md grid-cols-3 p-1 bg-white border border-gray-200 rounded-md text-muted-foreground"},LB=["onClick"],$B={class:"flex items-center gap-2"},FB={for:"is_pin",class:"text-sm font-medium text-gray-700 dark:text-gray-300 cursor-pointer"},IB={class:"relative"},OB={key:0,class:"w-3 h-3 text-white",fill:"currentColor",viewBox:"0 0 20 20"},PB={class:"container mx-auto bg-white rounded-md pb-4 px-5"},RB={class:"container mx-auto bg-white rounded-md pb-4 px-2"},UB={key:0,class:"container mx-auto bg-white rounded-md pb-4 px-2"},jB={class:"container mx-auto bg-white rounded-md pb-4 px-2"},xi=e.defineComponent({__name:"contentForm",setup(l){$e["vs-input-custom-datatable"]=ii,$e["vs-input-reference"]=fn,$e["vs-input-texteditor"]=pn,$e["vs-input-mediaselect"]=Ll,$e["vs-input-file"]=Ll,$e["vs-input-image"]=Ll,$e["vs-input-richtext-md"]=bi,$e["vs-input-integer"]=yi,$e["vs-input-relation-link"]=ki;const{t,locale:a}=Fe(),r=rt.useRouter(),n=rt.useRoute(),o=e.inject("menu",e.ref([])),s=e.ref([]),i=e.ref({}),c=e.ref({}),u=e.ref({}),d=e.ref(""),m=$=>{const M=[];return $.forEach(A=>{if(M.push(A),A.localization){const q={...A,name:A.name+":en",label:A.label+" (en)"};M.push(q)}}),M},f=e.computed(()=>{var $;return($=s.value)==null?void 0:$.map(mn)}),p=e.computed(()=>(a.value,bB.flatMap($=>{const M={...$,label:t($.label)};if($.localization){const A={...$,key:`${$.key}:en`,label:t($.label)+" (en)"};return[M,A]}return[M]}))),y=e.ref({}),h=e.ref({title:"",status:"draft"}),g=e.computed(()=>{const $=[{id:"content",name:t("cms.builder.content")},{id:"seo",name:t("cms.builder.seo")},{id:"tags",name:t("cms.builder.tags")}];return d.value&&$.push({id:"preview",name:t("cms.builder.preview")}),$}),b=e.ref("content"),w=e.computed(()=>{var M,A,q,Q;const $=((M=n.params)==null?void 0:M.collection)||((A=n.params)==null?void 0:A.id);return((Q=(q=o.value)==null?void 0:q.find(R=>R.id===$))==null?void 0:Q.title)||$}),x=e.computed(()=>{var $,M;return(($=h.value)==null?void 0:$.title)||((M=n.params)!=null&&M.id?t("cms.builder.editCollection"):t("cms.articles.createArticle"))}),k=e.computed(()=>{var q,Q,R;const $=((q=n.params)==null?void 0:q.collection)||((Q=n.params)==null?void 0:Q.id),M=(R=n.params)==null?void 0:R.id,A=[{label:w.value,route:`collections/${$}`}];return M?A.push({label:x.value,route:`collections/${$}/${M}`}):A.push({label:t("cms.articles.createArticle"),route:`collections/${$}/create`}),A}),_=$=>{$==="collections"?r.push("/collections"):r.push(`/${$}`)};e.onMounted(async()=>{var Q,R,I;const $=(Q=n.params)==null?void 0:Q.collection,M=(R=n.params)==null?void 0:R.id,A=$||M,q=$&&M?M:void 0;if(!q){if(!A)return;const D=await(await fetch(`/api/cms/${A}/`)).json();s.value=m(D.columns)}try{if(!q||!A)return;const F=await fetch(`/api/cms/${A}/${q}`);if(!F.ok)throw new Error("Failed to fetch article");const D=await F.json();if(s.value=m(D==null?void 0:D.columns),D!=null&&D.preview_path&&(d.value=D==null?void 0:D.preview_path),D.rows){let z=D.rows;Array.isArray(z)||(z=[z]),h.value=z[0],await e.nextTick(),(I=z[0])!=null&&I.meta?y.value={...z[0].meta}:y.value={title:"",description:"",keywords:"",meta:{}},console.log("Initialized seoData from rows[0]:",y.value)}else h.value=D,await e.nextTick(),D!=null&&D.meta?(y.value={title:D.meta.title||"",description:D.meta.description||"",keywords:D.meta.keywords||"",meta:{...D.meta}},delete y.value.meta.title,delete y.value.meta.description,delete y.value.meta.keywords):y.value={title:"",description:"",keywords:"",meta:{}},console.log("Initialized seoData from data:",y.value)}catch(F){console.error("Error fetching article:",F)}});const N=e.computed({get:()=>{var $;return(($=h.value)==null?void 0:$.is_pin)||!1},set:$=>{h.value&&(h.value.is_pin=$)}}),V=()=>{h.value&&(h.value.is_pin=!h.value.is_pin)};e.watch(y,$=>{console.log("seoData changed:",$)},{deep:!0});const P=async $=>{var I,F,D,z;const M=(I=n.params)==null?void 0:I.collection,A=(F=n.params)==null?void 0:F.id,q=await i.value.validate();if(q){xe({title:t("cms.validation"),message:JSON.stringify(q),type:"warning"});return}(D=u.value)!=null&&D.restoreTagsBeforeSubmit&&await u.value.restoreTagsBeforeSubmit();const Q=y.value||{},R={...h.value,meta:{...Q,...Q.meta||{}}};console.log("Payload before submit:",R);try{const ee=await fetch(`/api/cms/${M}/${A||""}`,{method:A?"PUT":"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(R)});if(!ee.ok){let me;try{const Ne=await ee.json();me=JSON.stringify(Ne,null,2)}catch{me=await ee.text()}throw new Error(`HTTP ${ee.status}: ${me}`)}if(!A)try{const me=await ee.json(),Ne=me.id||((z=me.data)==null?void 0:z.id);Ne&&n.name==="createArticle"&&await r.push(`/collections/${M}/${Ne}`)}catch(me){console.warn("Could not parse response to get ID:",me)}xe({title:t("cms.common.success"),message:t("cms.common.successMessage"),type:"success"})}catch(ee){console.error("Submit error:",ee),xe({title:t("cms.common.error"),message:"Помилка збереження",type:"error"})}};return($,M)=>{var A,q,Q,R,I,F,D;return e.openBlock(),e.createElementBlock("div",VB,[e.createElementVNode("div",NB,[e.createVNode(Cs,{items:k.value,onNavigate:_},null,8,["items"]),e.createElementVNode("div",vB,[e.createElementVNode("div",BB,[e.createElementVNode("button",{onClick:M[0]||(M[0]=z=>e.unref(r).back()),class:"p-2 text-gray-500 rounded-full hover:text-gray-900 dark:text-gray-400 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-700"},[e.createVNode(e.unref(Oi),{class:"w-5 h-5"})]),e.createElementVNode("h1",SB,[e.createTextVNode(e.toDisplayString($.$t("cms.builder.editCollection"))+" ",1),e.createElementVNode("span",null,'"'+e.toDisplayString(((A=h.value)==null?void 0:A.type)==="single"?h.value.title:(Q=(q=e.unref(o).value)==null?void 0:q.find(z=>z.id===(e.unref(n).params.collection||e.unref(n).params.id)))==null?void 0:Q.title)+'"',1)]),e.createElementVNode("a",{href:`https://cms.opengis.info/${e.unref(a)}/guides/content/`,target:"_blank",title:$.$t("cms.guide.content")},[e.createVNode(e.unref(kl),{class:"w-5 h-5"})],8,DB)]),e.createElementVNode("div",AB,[e.createElementVNode("button",{onClick:P,type:"submit",class:"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium h-9 px-4 py-2 bg-blue-600 text-white shadow-md transition-all duration-200 transform hover:bg-blue-700 hover:shadow-lg hover:scale-105 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"},[e.createVNode(e.unref(qi),{class:"w-4 h-4 mr-2"}),e.createTextVNode(" "+e.toDisplayString($.$t("cms.builder.save")),1)])])]),e.createElementVNode("div",MB,[e.createElementVNode("div",TB,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,z=>(e.openBlock(),e.createElementBlock("button",{key:z.id,onClick:ee=>b.value=z.id,class:e.normalizeClass(["inline-flex flex-1 items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm data-[state=active]:bg-blue-50 data-[state=active]:text-blue-700 data-[state=active]:border-blue-200",z.id===b.value?"bg-blue-50 text-blue-700 border-blue-200":""])},e.toDisplayString(z.name),11,LB))),128))]),e.createElementVNode("div",$B,[e.createElementVNode("label",FB,e.toDisplayString($.$t("cms.collections.pinPublication")),1),e.createElementVNode("div",IB,[e.withDirectives(e.createElementVNode("input",{type:"checkbox",id:"is_pin","onUpdate:modelValue":M[1]||(M[1]=z=>N.value=z),class:"sr-only"},null,512),[[e.vModelCheckbox,N.value]]),e.createElementVNode("div",{class:e.normalizeClass(["w-5 h-5 border-2 rounded transition-all duration-200 cursor-pointer flex items-center justify-center",(R=h.value)!=null&&R.is_pin?"bg-sky-600 border-sky-600":"bg-white border-gray-300 hover:border-sky-400 dark:bg-gray-700 dark:border-gray-600 dark:hover:border-sky-400"]),onClick:V},[(I=h.value)!=null&&I.is_pin?(e.openBlock(),e.createElementBlock("svg",OB,[...M[7]||(M[7]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z","clip-rule":"evenodd"},null,-1)])])):e.createCommentVNode("",!0)],2)])])])]),e.withDirectives(e.createElementVNode("div",PB,[(F=s.value)!=null&&F.length?(e.openBlock(),e.createBlock(e.unref(Xe),{key:0,modelValue:h.value,"onUpdate:modelValue":M[2]||(M[2]=z=>h.value=z),schema:f.value,form:i.value,"onUpdate:form":M[3]||(M[3]=z=>i.value=z)},null,8,["modelValue","schema","form"])):e.createCommentVNode("",!0)],512),[[e.vShow,b.value==="content"]]),e.withDirectives(e.createElementVNode("div",RB,[e.createVNode(e.unref(Xe),{schema:p.value,values:y.value,"onUpdate:values":M[4]||(M[4]=z=>y.value=z),form:c.value,"onUpdate:form":M[5]||(M[5]=z=>c.value=z)},null,8,["schema","values","form"])],512),[[e.vShow,b.value==="seo"]]),b.value==="tags"?(e.openBlock(),e.createElementBlock("div",UB,[e.createVNode(yB,{ref_key:"tagsForm",ref:u,modelValue:h.value,"onUpdate:modelValue":M[6]||(M[6]=z=>h.value=z)},null,8,["modelValue"])])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("div",jB,[e.createVNode(CB,{slug:(D=h.value)==null?void 0:D.slug,preview_path:d.value},null,8,["slug","preview_path"])],512),[[e.vShow,b.value==="preview"]])])}}}),zB=(l,t)=>{const a=l==null?void 0:l.trim();return a?t?t==="create"?{type:"createArticle",collection:a}:{type:"editArticle",collection:a,id:t}:{type:"articles",collection:a}:{type:"collections"}},HB={key:1,class:"p-4 text-sm text-slate-600 dark:text-slate-300"},qB=e.defineComponent({__name:"CmsContentWrapper",setup(l){const t=rt.useRoute(),a=e.getCurrentInstance();if(!a)throw new Error("CmsContentWrapper must be used within a component instance");const r=e.computed(()=>{const y=a.appContext.config.globalProperties.$route;if(!y)throw new Error("Vue Router is not registered on the app instance");return y}),n=e.computed(()=>t??r.value),o=e.computed(()=>{var y;return((y=n.value)==null?void 0:y.params)??{}}),s=e.computed(()=>{var y,h;return((y=o.value)==null?void 0:y.collection)??((h=o.value)==null?void 0:h.type)}),i=e.computed(()=>{var y;return(y=o.value)==null?void 0:y.id}),c=e.computed(()=>zB(s.value,i.value)),u={collections:Mr,articles:Vs,createArticle:xi,editArticle:xi},d=e.computed(()=>u[c.value.type]??Mr),m=e.computed(()=>`${c.value.type}-${c.value.collection??""}-${c.value.id??""}`),f=e.computed(()=>{const{type:y,collection:h,id:g}=c.value,b={...o.value};return s.value?b.collection=s.value:delete b.collection,y==="articles"?b.id=h:y==="createArticle"?delete b.id:y==="editArticle"&&g?b.id=g:delete b.id,b}),p=new Proxy({},{get(y,h,g){const b=n.value;if(!b)return;if(h==="params")return f.value;const w=Reflect.get(b,h,g);return typeof w=="function"?w.bind(b):w},has(y,h){if(h==="params")return!0;const g=n.value;return g?Reflect.has(g,h):!1},ownKeys(){const y=n.value;return y?Reflect.ownKeys(y):["params"]},getOwnPropertyDescriptor(y,h){if(h==="params")return{configurable:!0,enumerable:!0,value:f.value};const g=n.value;if(!g)return;const b=Reflect.getOwnPropertyDescriptor(g,h);if(b)return{...b,configurable:!0}}});return e.provide(rt.routeLocationKey,p),(y,h)=>d.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d.value),{key:m.value})):(e.openBlock(),e.createElementBlock("div",HB,e.toDisplayString(y.$t("cms.navigation.collections")),1))}}),GB=(l,t)=>{const a=l[t];return a?typeof a=="function"?a():Promise.resolve(a):new Promise((r,n)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(n.bind(null,new Error("Unknown variable dynamic import: "+t)))})},WB=localStorage.locale||navigator.language.split("cms.-")[0]||"uk",$l=hu({legacy:!1,locale:WB,fallbackLocale:"en",datetimeFormats:{en:{short:{year:"numeric",month:"short",day:"numeric"},long:{dateStyle:"full",timeStyle:"short"},time:{hour:"2-digit",minute:"2-digit"}},uk:{short:{year:"numeric",month:"short",day:"numeric"},long:{dateStyle:"full",timeStyle:"short"},time:{hour:"2-digit",minute:"2-digit"}}},numberFormats:{en:{currency:{style:"currency",currency:"USD"},percent:{style:"percent",minimumFractionDigits:0},compact:{notation:"compact"}},uk:{currency:{style:"currency",currency:"UAH"},percent:{style:"percent",minimumFractionDigits:0},compact:{notation:"compact"}}},messages:{}}),hn="en";async function wi(l){return(await GB(Object.assign({"./locales/en.json":()=>Promise.resolve().then(()=>a4),"./locales/uk.json":()=>Promise.resolve().then(()=>r4)}),`./locales/${l}.json`)).default}async function gn(l){try{const t=await wi(l);return $l.global.setLocaleMessage(l,t),t}catch(t){if(console.error(`Failed to load locale ${l}:`,t),l!==hn)try{const a=await wi(hn);return $l.global.setLocaleMessage(l,a),a}catch(a){throw console.error(`Failed to load fallback locale ${hn}:`,a),a}throw t}}async function KB(l){await gn(l),$l.global.locale.value=l,localStorage.setItem("locale",l),document.documentElement.lang=l,window.dispatchEvent(new CustomEvent("cms.storage",{detail:{key:"locale",oldValue:null,newValue:l}}))}async function YB(){const l=$l.global.locale.value;await gn(l),$l.global.locale.value=l,localStorage.setItem("locale",l),document.documentElement.lang=l}async function XB(l){return await gn(l)}function ZB(l){l.component("Dashboard",Ar)}function ll(l){return typeof l=="string"||l instanceof String}function _i(l){var t;return typeof l=="object"&&l!=null&&(l==null||(t=l.constructor)==null?void 0:t.name)==="Object"}function Ei(l,t){return Array.isArray(t)?Ei(l,(a,r)=>t.includes(r)):Object.entries(l).reduce((a,r)=>{let[n,o]=r;return t(o,n)&&(a[n]=o),a},{})}const ne={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function Ci(l){switch(l){case ne.LEFT:return ne.FORCE_LEFT;case ne.RIGHT:return ne.FORCE_RIGHT;default:return l}}function bn(l){return l.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function Ka(l,t){if(t===l)return!0;const a=Array.isArray(t),r=Array.isArray(l);let n;if(a&&r){if(t.length!=l.length)return!1;for(n=0;n<t.length;n++)if(!Ka(t[n],l[n]))return!1;return!0}if(a!=r)return!1;if(t&&l&&typeof t=="object"&&typeof l=="object"){const o=t instanceof Date,s=l instanceof Date;if(o&&s)return t.getTime()==l.getTime();if(o!=s)return!1;const i=t instanceof RegExp,c=l instanceof RegExp;if(i&&c)return t.toString()==l.toString();if(i!=c)return!1;const u=Object.keys(t);for(n=0;n<u.length;n++)if(!Object.prototype.hasOwnProperty.call(l,u[n]))return!1;for(n=0;n<u.length;n++)if(!Ka(l[u[n]],t[u[n]]))return!1;return!0}else if(t&&l&&typeof t=="function"&&typeof l=="function")return t.toString()===l.toString();return!1}class QB{constructor(t){for(Object.assign(this,t);this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start;if(this.insertedCount)for(;this.value.slice(this.cursorPos)!==this.oldValue.slice(this.oldSelection.end);)this.value.length-this.cursorPos<this.oldValue.length-this.oldSelection.end?++this.oldSelection.end:++this.cursorPos}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){return!this.removedCount||this.insertedCount?ne.NONE:(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?ne.RIGHT:ne.LEFT}}function ue(l,t){return new ue.InputMask(l,t)}function Vi(l){if(l==null)throw new Error("mask property should be defined");return l instanceof RegExp?ue.MaskedRegExp:ll(l)?ue.MaskedPattern:l===Date?ue.MaskedDate:l===Number?ue.MaskedNumber:Array.isArray(l)||l===Array?ue.MaskedDynamic:ue.Masked&&l.prototype instanceof ue.Masked?l:ue.Masked&&l instanceof ue.Masked?l.constructor:l instanceof Function?ue.MaskedFunction:(console.warn("Mask not found for mask",l),ue.Masked)}function Fl(l){if(!l)throw new Error("Options in not defined");if(ue.Masked){if(l.prototype instanceof ue.Masked)return{mask:l};const{mask:t=void 0,...a}=l instanceof ue.Masked?{mask:l}:_i(l)&&l.mask instanceof ue.Masked?l:{};if(t){const r=t.mask;return{...Ei(t,(n,o)=>!o.startsWith("_")),mask:t.constructor,_mask:r,...a}}}return _i(l)?{...l}:{mask:l}}function Ft(l){if(ue.Masked&&l instanceof ue.Masked)return l;const t=Fl(l),a=Vi(t.mask);if(!a)throw new Error("Masked class is not found for provided mask "+t.mask+", appropriate module needs to be imported manually before creating mask.");return t.mask===a&&delete t.mask,t._mask&&(t.mask=t._mask,delete t._mask),new a(t)}ue.createMask=Ft;class Ya{get selectionStart(){let t;try{t=this._unsafeSelectionStart}catch{}return t??this.value.length}get selectionEnd(){let t;try{t=this._unsafeSelectionEnd}catch{}return t??this.value.length}select(t,a){if(!(t==null||a==null||t===this.selectionStart&&a===this.selectionEnd))try{this._unsafeSelect(t,a)}catch{}}get isActive(){return!1}}ue.MaskElement=Ya;const Ni=90,JB=89;class ra extends Ya{constructor(t){super(),this.input=t,this._onKeydown=this._onKeydown.bind(this),this._onInput=this._onInput.bind(this),this._onBeforeinput=this._onBeforeinput.bind(this),this._onCompositionEnd=this._onCompositionEnd.bind(this)}get rootElement(){var t,a,r;return(t=(a=(r=this.input).getRootNode)==null?void 0:a.call(r))!=null?t:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(t){this.input.addEventListener("keydown",this._onKeydown),this.input.addEventListener("input",this._onInput),this.input.addEventListener("beforeinput",this._onBeforeinput),this.input.addEventListener("compositionend",this._onCompositionEnd),this.input.addEventListener("drop",t.drop),this.input.addEventListener("click",t.click),this.input.addEventListener("focus",t.focus),this.input.addEventListener("blur",t.commit),this._handlers=t}_onKeydown(t){if(this._handlers.redo&&(t.keyCode===Ni&&t.shiftKey&&(t.metaKey||t.ctrlKey)||t.keyCode===JB&&t.ctrlKey))return t.preventDefault(),this._handlers.redo(t);if(this._handlers.undo&&t.keyCode===Ni&&(t.metaKey||t.ctrlKey))return t.preventDefault(),this._handlers.undo(t);t.isComposing||this._handlers.selectionChange(t)}_onBeforeinput(t){if(t.inputType==="historyUndo"&&this._handlers.undo)return t.preventDefault(),this._handlers.undo(t);if(t.inputType==="historyRedo"&&this._handlers.redo)return t.preventDefault(),this._handlers.redo(t)}_onCompositionEnd(t){this._handlers.input(t)}_onInput(t){t.isComposing||this._handlers.input(t)}unbindEvents(){this.input.removeEventListener("keydown",this._onKeydown),this.input.removeEventListener("input",this._onInput),this.input.removeEventListener("beforeinput",this._onBeforeinput),this.input.removeEventListener("compositionend",this._onCompositionEnd),this.input.removeEventListener("drop",this._handlers.drop),this.input.removeEventListener("click",this._handlers.click),this.input.removeEventListener("focus",this._handlers.focus),this.input.removeEventListener("blur",this._handlers.commit),this._handlers={}}}ue.HTMLMaskElement=ra;class vi extends ra{constructor(t){super(t),this.input=t}get _unsafeSelectionStart(){return this.input.selectionStart!=null?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(t,a){this.input.setSelectionRange(t,a)}get value(){return this.input.value}set value(t){this.input.value=t}}ue.HTMLMaskElement=ra;class yn extends ra{get _unsafeSelectionStart(){const t=this.rootElement,a=t.getSelection&&t.getSelection(),r=a&&a.anchorOffset,n=a&&a.focusOffset;return n==null||r==null||r<n?r:n}get _unsafeSelectionEnd(){const t=this.rootElement,a=t.getSelection&&t.getSelection(),r=a&&a.anchorOffset,n=a&&a.focusOffset;return n==null||r==null||r>n?r:n}_unsafeSelect(t,a){if(!this.rootElement.createRange)return;const r=this.rootElement.createRange();r.setStart(this.input.firstChild||this.input,t),r.setEnd(this.input.lastChild||this.input,a);const n=this.rootElement,o=n.getSelection&&n.getSelection();o&&(o.removeAllRanges(),o.addRange(r))}get value(){return this.input.textContent||""}set value(t){this.input.textContent=t}}ue.HTMLContenteditableMaskElement=yn;class Xa{constructor(){this.states=[],this.currentIndex=0}get currentState(){return this.states[this.currentIndex]}get isEmpty(){return this.states.length===0}push(t){this.currentIndex<this.states.length-1&&(this.states.length=this.currentIndex+1),this.states.push(t),this.states.length>Xa.MAX_LENGTH&&this.states.shift(),this.currentIndex=this.states.length-1}go(t){return this.currentIndex=Math.min(Math.max(this.currentIndex+t,0),this.states.length-1),this.currentState}undo(){return this.go(-1)}redo(){return this.go(1)}clear(){this.states.length=0,this.currentIndex=0}}Xa.MAX_LENGTH=100;class Bi{constructor(t,a){this.el=t instanceof Ya?t:t.isContentEditable&&t.tagName!=="INPUT"&&t.tagName!=="TEXTAREA"?new yn(t):new vi(t),this.masked=Ft(a),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new Xa,this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this._onUndo=this._onUndo.bind(this),this._onRedo=this._onRedo.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}maskEquals(t){var a;return t==null||((a=this.masked)==null?void 0:a.maskEquals(t))}get mask(){return this.masked.mask}set mask(t){if(this.maskEquals(t))return;if(!(t instanceof ue.Masked)&&this.masked.constructor===Vi(t)){this.masked.updateOptions({mask:t});return}const a=t instanceof ue.Masked?t:Ft({mask:t});a.unmaskedValue=this.masked.unmaskedValue,this.masked=a}get value(){return this._value}set value(t){this.value!==t&&(this.masked.value=t,this.updateControl("auto"))}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(t){this.unmaskedValue!==t&&(this.masked.unmaskedValue=t,this.updateControl("auto"))}get rawInputValue(){return this._rawInputValue}set rawInputValue(t){this.rawInputValue!==t&&(this.masked.rawInputValue=t,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(t){this.masked.typedValueEquals(t)||(this.masked.typedValue=t,this.updateControl("auto"))}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange,undo:this._onUndo,redo:this._onRedo})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(t,a){const r=this._listeners[t];r&&r.forEach(n=>n(a))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(t){!this.el||!this.el.isActive||(this.el.select(t,t),this._saveSelection())}_saveSelection(){this.displayValue!==this.el.value&&console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."),this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value,this._value=this.masked.value,this._unmaskedValue=this.masked.unmaskedValue,this._rawInputValue=this.masked.rawInputValue}updateControl(t){const a=this.masked.unmaskedValue,r=this.masked.value,n=this.masked.rawInputValue,o=this.displayValue,s=this.unmaskedValue!==a||this.value!==r||this._rawInputValue!==n;this._unmaskedValue=a,this._value=r,this._rawInputValue=n,this.el.value!==o&&(this.el.value=o),t==="auto"?this.alignCursor():t!=null&&(this.cursorPos=t),s&&this._fireChangeEvents(),!this._historyChanging&&(s||this.history.isEmpty)&&this.history.push({unmaskedValue:a,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(t){const{mask:a,...r}=t,n=!this.maskEquals(a),o=this.masked.optionsIsChanged(r);n&&(this.mask=a),o&&this.masked.updateOptions(r),(n||o)&&this.updateControl()}updateCursor(t){t!=null&&(this.cursorPos=t,this._delayUpdateCursor(t))}_delayUpdateCursor(t){this._abortUpdateCursor(),this._changingCursorPos=t,this._cursorChanging=setTimeout(()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())},10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,ne.LEFT))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(t,a){return this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push(a),this}off(t,a){if(!this._listeners[t])return this;if(!a)return delete this._listeners[t],this;const r=this._listeners[t].indexOf(a);return r>=0&&this._listeners[t].splice(r,1),this}_onInput(t){this._inputEvent=t,this._abortUpdateCursor();const a=new QB({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),r=this.masked.rawInputValue,n=this.masked.splice(a.startChangePos,a.removed.length,a.inserted,a.removeDirection,{input:!0,raw:!0}).offset,o=r===this.masked.rawInputValue?a.removeDirection:ne.NONE;let s=this.masked.nearestInputPos(a.startChangePos+n,o);o!==ne.NONE&&(s=this.masked.nearestInputPos(s,ne.NONE)),this.updateControl(s),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(t){t.preventDefault(),t.stopPropagation()}_onFocus(t){this.alignCursorFriendly()}_onClick(t){this.alignCursorFriendly()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(t){t&&(this._historyChanging=!0,this.unmaskedValue=t.unmaskedValue,this.el.select(t.selection.start,t.selection.end),this._saveSelection(),this._historyChanging=!1)}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}}ue.InputMask=Bi;class fe{static normalize(t){return Array.isArray(t)?t:[t,new fe]}constructor(t){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:!1},t)}aggregate(t){return this.inserted+=t.inserted,this.rawInserted+=t.rawInserted,this.tailShift+=t.tailShift,this.skip=this.skip||t.skip,this}get offset(){return this.tailShift+this.inserted.length}get consumed(){return!!this.rawInserted||this.skip}equals(t){return this.inserted===t.inserted&&this.tailShift===t.tailShift&&this.rawInserted===t.rawInserted&&this.skip===t.skip}}ue.ChangeDetails=fe;class It{constructor(t,a,r){t===void 0&&(t=""),a===void 0&&(a=0),this.value=t,this.from=a,this.stop=r}toString(){return this.value}extend(t){this.value+=String(t)}appendTo(t){return t.append(this.toString(),{tail:!0}).aggregate(t._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(t){Object.assign(this,t)}unshift(t){if(!this.value.length||t!=null&&this.from>=t)return"";const a=this.value[0];return this.value=this.value.slice(1),a}shift(){if(!this.value.length)return"";const t=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),t}}class Je{constructor(t){this._value="",this._update({...Je.DEFAULTS,...t}),this._initialized=!0}updateOptions(t){this.optionsIsChanged(t)&&this.withValueRefresh(this._update.bind(this,t))}_update(t){Object.assign(this,t)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value}reset(){this._value=""}get value(){return this._value}set value(t){this.resolve(t,{input:!0})}resolve(t,a){a===void 0&&(a={input:!0}),this.reset(),this.append(t,a,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(t){this.resolve(t,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(t){this.format?this.value=this.format(t,this):this.unmaskedValue=String(t)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(t){this.resolve(t,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(t,a){return t}totalInputPositions(t,a){return t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length),Math.min(this.displayValue.length,a-t)}extractInput(t,a,r){return t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length),this.displayValue.slice(t,a)}extractTail(t,a){return t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length),new It(this.extractInput(t,a),t)}appendTail(t){return ll(t)&&(t=new It(String(t))),t.appendTo(this)}_appendCharRaw(t,a){return t?(this._value+=t,new fe({inserted:t,rawInserted:t})):new fe}_appendChar(t,a,r){a===void 0&&(a={});const n=this.state;let o;if([t,o]=this.doPrepareChar(t,a),t&&(o=o.aggregate(this._appendCharRaw(t,a)),!o.rawInserted&&this.autofix==="pad")){const s=this.state;this.state=n;let i=this.pad(a);const c=this._appendCharRaw(t,a);i=i.aggregate(c),c.rawInserted||i.equals(o)?o=i:this.state=s}if(o.inserted){let s,i=this.doValidate(a)!==!1;if(i&&r!=null){const c=this.state;if(this.overwrite===!0){s=r.state;for(let d=0;d<o.rawInserted.length;++d)r.unshift(this.displayValue.length-o.tailShift)}let u=this.appendTail(r);if(i=u.rawInserted.length===r.toString().length,!(i&&u.inserted)&&this.overwrite==="shift"){this.state=c,s=r.state;for(let d=0;d<o.rawInserted.length;++d)r.shift();u=this.appendTail(r),i=u.rawInserted.length===r.toString().length}i&&u.inserted&&(this.state=c)}i||(o=new fe,this.state=n,r&&s&&(r.state=s))}return o}_appendPlaceholder(){return new fe}_appendEager(){return new fe}append(t,a,r){if(!ll(t))throw new Error("value should be string");const n=ll(r)?new It(String(r)):r;a!=null&&a.tail&&(a._beforeTailState=this.state);let o;[t,o]=this.doPrepare(t,a);for(let s=0;s<t.length;++s){const i=this._appendChar(t[s],a,n);if(!i.rawInserted&&!this.doSkipInvalid(t[s],a,n))break;o.aggregate(i)}return(this.eager===!0||this.eager==="append")&&a!=null&&a.input&&t&&o.aggregate(this._appendEager()),n!=null&&(o.tailShift+=this.appendTail(n).tailShift),o}remove(t,a){return t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length),this._value=this.displayValue.slice(0,t)+this.displayValue.slice(a),new fe}withValueRefresh(t){if(this._refreshing||!this._initialized)return t();this._refreshing=!0;const a=this.rawInputValue,r=this.value,n=t();return this.rawInputValue=a,this.value&&this.value!==r&&r.indexOf(this.value)===0&&(this.append(r.slice(this.displayValue.length),{},""),this.doCommit()),delete this._refreshing,n}runIsolated(t){if(this._isolated||!this._initialized)return t(this);this._isolated=!0;const a=this.state,r=t(this);return this.state=a,delete this._isolated,r}doSkipInvalid(t,a,r){return!!this.skipInvalid}doPrepare(t,a){return a===void 0&&(a={}),fe.normalize(this.prepare?this.prepare(t,this,a):t)}doPrepareChar(t,a){return a===void 0&&(a={}),fe.normalize(this.prepareChar?this.prepareChar(t,this,a):t)}doValidate(t){return(!this.validate||this.validate(this.value,this,t))&&(!this.parent||this.parent.doValidate(t))}doCommit(){this.commit&&this.commit(this.value,this)}splice(t,a,r,n,o){r===void 0&&(r=""),n===void 0&&(n=ne.NONE),o===void 0&&(o={input:!0});const s=t+a,i=this.extractTail(s),c=this.eager===!0||this.eager==="remove";let u;c&&(n=Ci(n),u=this.extractInput(0,s,{raw:!0}));let d=t;const m=new fe;if(n!==ne.NONE&&(d=this.nearestInputPos(t,a>1&&t!==0&&!c?ne.NONE:n),m.tailShift=d-t),m.aggregate(this.remove(d)),c&&n!==ne.NONE&&u===this.rawInputValue)if(n===ne.FORCE_LEFT){let f;for(;u===this.rawInputValue&&(f=this.displayValue.length);)m.aggregate(new fe({tailShift:-1})).aggregate(this.remove(f-1))}else n===ne.FORCE_RIGHT&&i.unshift();return m.aggregate(this.append(r,o,i))}maskEquals(t){return this.mask===t}optionsIsChanged(t){return!Ka(this,t)}typedValueEquals(t){const a=this.typedValue;return t===a||Je.EMPTY_VALUES.includes(t)&&Je.EMPTY_VALUES.includes(a)||(this.format?this.format(t,this)===this.format(this.typedValue,this):!1)}pad(t){return new fe}}Je.DEFAULTS={skipInvalid:!0},Je.EMPTY_VALUES=[void 0,null,""],ue.Masked=Je;class al{constructor(t,a){t===void 0&&(t=[]),a===void 0&&(a=0),this.chunks=t,this.from=a}toString(){return this.chunks.map(String).join("")}extend(t){if(!String(t))return;t=ll(t)?new It(String(t)):t;const a=this.chunks[this.chunks.length-1],r=a&&(a.stop===t.stop||t.stop==null)&&t.from===a.from+a.toString().length;if(t instanceof It)r?a.extend(t.toString()):this.chunks.push(t);else if(t instanceof al){if(t.stop==null){let n;for(;t.chunks.length&&t.chunks[0].stop==null;)n=t.chunks.shift(),n.from+=t.from,this.extend(n)}t.toString()&&(t.stop=t.blockIndex,this.chunks.push(t))}}appendTo(t){if(!(t instanceof ue.MaskedPattern))return new It(this.toString()).appendTo(t);const a=new fe;for(let r=0;r<this.chunks.length;++r){const n=this.chunks[r],o=t._mapPosToBlock(t.displayValue.length),s=n.stop;let i;if(s!=null&&(!o||o.index<=s)&&((n instanceof al||t._stops.indexOf(s)>=0)&&a.aggregate(t._appendPlaceholder(s)),i=n instanceof al&&t._blocks[s]),i){const c=i.appendTail(n);a.aggregate(c);const u=n.toString().slice(c.rawInserted.length);u&&a.aggregate(t.append(u,{tail:!0}))}else a.aggregate(t.append(n.toString(),{tail:!0}))}return a}get state(){return{chunks:this.chunks.map(t=>t.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(t){const{chunks:a,...r}=t;Object.assign(this,r),this.chunks=a.map(n=>{const o="chunks"in n?new al:new It;return o.state=n,o})}unshift(t){if(!this.chunks.length||t!=null&&this.from>=t)return"";const a=t!=null?t-this.from:t;let r=0;for(;r<this.chunks.length;){const n=this.chunks[r],o=n.unshift(a);if(n.toString()){if(!o)break;++r}else this.chunks.splice(r,1);if(o)return o}return""}shift(){if(!this.chunks.length)return"";let t=this.chunks.length-1;for(;0<=t;){const a=this.chunks[t],r=a.shift();if(a.toString()){if(!r)break;--t}else this.chunks.splice(t,1);if(r)return r}return""}}class e4{constructor(t,a){this.masked=t,this._log=[];const{offset:r,index:n}=t._mapPosToBlock(a)||(a<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=r,this.index=n,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(t){Object.assign(this,t)}pushState(){this._log.push(this.state)}popState(){const t=this._log.pop();return t&&(this.state=t),t}bindBlock(){this.block||(this.index<0&&(this.index=0,this.offset=0),this.index>=this.masked._blocks.length&&(this.index=this.masked._blocks.length-1,this.offset=this.block.displayValue.length))}_pushLeft(t){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=((a=this.block)==null?void 0:a.displayValue.length)||0){var a;if(t())return this.ok=!0}return this.ok=!1}_pushRight(t){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(t())return this.ok=!0;return this.ok=!1}pushLeftBeforeFilled(){return this._pushLeft(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,ne.FORCE_LEFT),this.offset!==0))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,ne.LEFT),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,ne.LEFT),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,ne.FORCE_RIGHT),this.offset!==this.block.value.length))return!0})}pushRightBeforeInput(){return this._pushRight(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,ne.NONE),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,ne.NONE),!0})}}class kn{constructor(t){Object.assign(this,t),this._value="",this.isFixed=!0}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get rawInputValue(){return this._isRawInput?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=!1,this._value=""}remove(t,a){return t===void 0&&(t=0),a===void 0&&(a=this._value.length),this._value=this._value.slice(0,t)+this._value.slice(a),this._value||(this._isRawInput=!1),new fe}nearestInputPos(t,a){a===void 0&&(a=ne.NONE);const r=0,n=this._value.length;switch(a){case ne.LEFT:case ne.FORCE_LEFT:return r;case ne.NONE:case ne.RIGHT:case ne.FORCE_RIGHT:default:return n}}totalInputPositions(t,a){return t===void 0&&(t=0),a===void 0&&(a=this._value.length),this._isRawInput?a-t:0}extractInput(t,a,r){return t===void 0&&(t=0),a===void 0&&(a=this._value.length),r===void 0&&(r={}),r.raw&&this._isRawInput&&this._value.slice(t,a)||""}get isComplete(){return!0}get isFilled(){return!!this._value}_appendChar(t,a){if(a===void 0&&(a={}),this.isFilled)return new fe;const r=this.eager===!0||this.eager==="append",n=this.char===t&&(this.isUnmasking||a.input||a.raw)&&(!a.raw||!r)&&!a.tail,o=new fe({inserted:this.char,rawInserted:n?this.char:""});return this._value=this.char,this._isRawInput=n&&(a.raw||a.input),o}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const t=new fe;return this.isFilled||(this._value=t.inserted=this.char),t}extractTail(){return new It("")}appendTail(t){return ll(t)&&(t=new It(String(t))),t.appendTo(this)}append(t,a,r){const n=this._appendChar(t[0],a);return r!=null&&(n.tailShift+=this.appendTail(r).tailShift),n}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value,this._isRawInput=!!t._rawInputValue}pad(t){return this._appendPlaceholder()}}class na{constructor(t){const{parent:a,isOptional:r,placeholderChar:n,displayChar:o,lazy:s,eager:i,...c}=t;this.masked=Ft(c),Object.assign(this,{parent:a,isOptional:r,placeholderChar:n,displayChar:o,lazy:s,eager:i})}reset(){this.isFilled=!1,this.masked.reset()}remove(t,a){return t===void 0&&(t=0),a===void 0&&(a=this.value.length),t===0&&a>=1?(this.isFilled=!1,this.masked.remove(t,a)):new fe}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get rawInputValue(){return this.masked.rawInputValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return!!this.masked.value||this.isOptional}_appendChar(t,a){if(a===void 0&&(a={}),this.isFilled)return new fe;const r=this.masked.state;let n=this.masked._appendChar(t,this.currentMaskFlags(a));return n.inserted&&this.doValidate(a)===!1&&(n=new fe,this.masked.state=r),!n.inserted&&!this.isOptional&&!this.lazy&&!a.input&&(n.inserted=this.placeholderChar),n.skip=!n.inserted&&!this.isOptional,this.isFilled=!!n.inserted,n}append(t,a,r){return this.masked.append(t,this.currentMaskFlags(a),r)}_appendPlaceholder(){return this.isFilled||this.isOptional?new fe:(this.isFilled=!0,new fe({inserted:this.placeholderChar}))}_appendEager(){return new fe}extractTail(t,a){return this.masked.extractTail(t,a)}appendTail(t){return this.masked.appendTail(t)}extractInput(t,a,r){return t===void 0&&(t=0),a===void 0&&(a=this.value.length),this.masked.extractInput(t,a,r)}nearestInputPos(t,a){a===void 0&&(a=ne.NONE);const r=0,n=this.value.length,o=Math.min(Math.max(t,r),n);switch(a){case ne.LEFT:case ne.FORCE_LEFT:return this.isComplete?o:r;case ne.RIGHT:case ne.FORCE_RIGHT:return this.isComplete?o:n;case ne.NONE:default:return o}}totalInputPositions(t,a){return t===void 0&&(t=0),a===void 0&&(a=this.value.length),this.value.slice(t,a).length}doValidate(t){return this.masked.doValidate(this.currentMaskFlags(t))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(t)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(t){this.masked.state=t.masked,this.isFilled=t.isFilled}currentMaskFlags(t){var a;return{...t,_beforeTailState:(t==null||(a=t._beforeTailState)==null?void 0:a.masked)||(t==null?void 0:t._beforeTailState)}}pad(t){return new fe}}na.DEFAULT_DEFINITIONS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./};class Si extends Je{updateOptions(t){super.updateOptions(t)}_update(t){const a=t.mask;a&&(t.validate=r=>r.search(a)>=0),super._update(t)}}ue.MaskedRegExp=Si;class et extends Je{constructor(t){super({...et.DEFAULTS,...t,definitions:Object.assign({},na.DEFAULT_DEFINITIONS,t==null?void 0:t.definitions)})}updateOptions(t){super.updateOptions(t)}_update(t){t.definitions=Object.assign({},this.definitions,t.definitions),super._update(t),this._rebuildMask()}_rebuildMask(){const t=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};const a=this.mask;if(!a||!t)return;let r=!1,n=!1;for(let o=0;o<a.length;++o){if(this.blocks){const u=a.slice(o),d=Object.keys(this.blocks).filter(f=>u.indexOf(f)===0);d.sort((f,p)=>p.length-f.length);const m=d[0];if(m){const{expose:f,repeat:p,...y}=Fl(this.blocks[m]),h={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...y,repeat:p,parent:this},g=p!=null?new ue.RepeatBlock(h):Ft(h);g&&(this._blocks.push(g),f&&(this.exposeBlock=g),this._maskedBlocks[m]||(this._maskedBlocks[m]=[]),this._maskedBlocks[m].push(this._blocks.length-1)),o+=m.length-1;continue}}let s=a[o],i=s in t;if(s===et.STOP_CHAR){this._stops.push(this._blocks.length);continue}if(s==="{"||s==="}"){r=!r;continue}if(s==="["||s==="]"){n=!n;continue}if(s===et.ESCAPE_CHAR){if(++o,s=a[o],!s)break;i=!1}const c=i?new na({isOptional:n,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...Fl(t[s]),parent:this}):new kn({char:s,eager:this.eager,isUnmasking:r});this._blocks.push(c)}}get state(){return{...super.state,_blocks:this._blocks.map(t=>t.state)}}set state(t){if(!t){this.reset();return}const{_blocks:a,...r}=t;this._blocks.forEach((n,o)=>n.state=a[o]),super.state=r}reset(){super.reset(),this._blocks.forEach(t=>t.reset())}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every(t=>t.isComplete)}get isFilled(){return this._blocks.every(t=>t.isFilled)}get isFixed(){return this._blocks.every(t=>t.isFixed)}get isOptional(){return this._blocks.every(t=>t.isOptional)}doCommit(){this._blocks.forEach(t=>t.doCommit()),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((t,a)=>t+=a.unmaskedValue,"")}set unmaskedValue(t){if(this.exposeBlock){const a=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=t,this.appendTail(a),this.doCommit()}else super.unmaskedValue=t}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((t,a)=>t+=a.value,"")}set value(t){if(this.exposeBlock){const a=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=t,this.appendTail(a),this.doCommit()}else super.value=t}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(t){if(this.exposeBlock){const a=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=t,this.appendTail(a),this.doCommit()}else super.typedValue=t}get displayValue(){return this._blocks.reduce((t,a)=>t+=a.displayValue,"")}appendTail(t){return super.appendTail(t).aggregate(this._appendPlaceholder())}_appendEager(){var t;const a=new fe;let r=(t=this._mapPosToBlock(this.displayValue.length))==null?void 0:t.index;if(r==null)return a;this._blocks[r].isFilled&&++r;for(let n=r;n<this._blocks.length;++n){const o=this._blocks[n]._appendEager();if(!o.inserted)break;a.aggregate(o)}return a}_appendCharRaw(t,a){a===void 0&&(a={});const r=this._mapPosToBlock(this.displayValue.length),n=new fe;if(!r)return n;for(let s=r.index,i;i=this._blocks[s];++s){var o;const c=i._appendChar(t,{...a,_beforeTailState:(o=a._beforeTailState)==null||(o=o._blocks)==null?void 0:o[s]});if(n.aggregate(c),c.consumed)break}return n}extractTail(t,a){t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length);const r=new al;return t===a||this._forEachBlocksInRange(t,a,(n,o,s,i)=>{const c=n.extractTail(s,i);c.stop=this._findStopBefore(o),c.from=this._blockStartPos(o),c instanceof al&&(c.blockIndex=o),r.extend(c)}),r}extractInput(t,a,r){if(t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length),r===void 0&&(r={}),t===a)return"";let n="";return this._forEachBlocksInRange(t,a,(o,s,i,c)=>{n+=o.extractInput(i,c,r)}),n}_findStopBefore(t){let a;for(let r=0;r<this._stops.length;++r){const n=this._stops[r];if(n<=t)a=n;else break}return a}_appendPlaceholder(t){const a=new fe;if(this.lazy&&t==null)return a;const r=this._mapPosToBlock(this.displayValue.length);if(!r)return a;const n=r.index,o=t??this._blocks.length;return this._blocks.slice(n,o).forEach(s=>{if(!s.lazy||t!=null){var i;a.aggregate(s._appendPlaceholder((i=s._blocks)==null?void 0:i.length))}}),a}_mapPosToBlock(t){let a="";for(let r=0;r<this._blocks.length;++r){const n=this._blocks[r],o=a.length;if(a+=n.displayValue,t<=a.length)return{index:r,offset:t-o}}}_blockStartPos(t){return this._blocks.slice(0,t).reduce((a,r)=>a+=r.displayValue.length,0)}_forEachBlocksInRange(t,a,r){a===void 0&&(a=this.displayValue.length);const n=this._mapPosToBlock(t);if(n){const o=this._mapPosToBlock(a),s=o&&n.index===o.index,i=n.offset,c=o&&s?o.offset:this._blocks[n.index].displayValue.length;if(r(this._blocks[n.index],n.index,i,c),o&&!s){for(let u=n.index+1;u<o.index;++u)r(this._blocks[u],u,0,this._blocks[u].displayValue.length);r(this._blocks[o.index],o.index,0,o.offset)}}}remove(t,a){t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length);const r=super.remove(t,a);return this._forEachBlocksInRange(t,a,(n,o,s,i)=>{r.aggregate(n.remove(s,i))}),r}nearestInputPos(t,a){if(a===void 0&&(a=ne.NONE),!this._blocks.length)return 0;const r=new e4(this,t);if(a===ne.NONE)return r.pushRightBeforeInput()||(r.popState(),r.pushLeftBeforeInput())?r.pos:this.displayValue.length;if(a===ne.LEFT||a===ne.FORCE_LEFT){if(a===ne.LEFT){if(r.pushRightBeforeFilled(),r.ok&&r.pos===t)return t;r.popState()}if(r.pushLeftBeforeInput(),r.pushLeftBeforeRequired(),r.pushLeftBeforeFilled(),a===ne.LEFT){if(r.pushRightBeforeInput(),r.pushRightBeforeRequired(),r.ok&&r.pos<=t||(r.popState(),r.ok&&r.pos<=t))return r.pos;r.popState()}return r.ok?r.pos:a===ne.FORCE_LEFT?0:(r.popState(),r.ok||(r.popState(),r.ok)?r.pos:0)}return a===ne.RIGHT||a===ne.FORCE_RIGHT?(r.pushRightBeforeInput(),r.pushRightBeforeRequired(),r.pushRightBeforeFilled()?r.pos:a===ne.FORCE_RIGHT?this.displayValue.length:(r.popState(),r.ok||(r.popState(),r.ok)?r.pos:this.nearestInputPos(t,ne.LEFT))):t}totalInputPositions(t,a){t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length);let r=0;return this._forEachBlocksInRange(t,a,(n,o,s,i)=>{r+=n.totalInputPositions(s,i)}),r}maskedBlock(t){return this.maskedBlocks(t)[0]}maskedBlocks(t){const a=this._maskedBlocks[t];return a?a.map(r=>this._blocks[r]):[]}pad(t){const a=new fe;return this._forEachBlocksInRange(0,this.displayValue.length,r=>a.aggregate(r.pad(t))),a}}et.DEFAULTS={...Je.DEFAULTS,lazy:!0,placeholderChar:"_"},et.STOP_CHAR="`",et.ESCAPE_CHAR="\\",et.InputDefinition=na,et.FixedDefinition=kn,ue.MaskedPattern=et;class oa extends et{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){const{to:a=this.to||0,from:r=this.from||0,maxLength:n=this.maxLength||0,autofix:o=this.autofix,...s}=t;this.to=a,this.from=r,this.maxLength=Math.max(String(a).length,n),this.autofix=o;const i=String(this.from).padStart(this.maxLength,"0"),c=String(this.to).padStart(this.maxLength,"0");let u=0;for(;u<c.length&&c[u]===i[u];)++u;s.mask=c.slice(0,u).replace(/0/g,"\\0")+"0".repeat(this.maxLength-u),super._update(s)}get isComplete(){return super.isComplete&&!!this.value}boundaries(t){let a="",r="";const[,n,o]=t.match(/^(\D*)(\d*)(\D*)/)||[];return o&&(a="0".repeat(n.length)+o,r="9".repeat(n.length)+o),a=a.padEnd(this.maxLength,"0"),r=r.padEnd(this.maxLength,"9"),[a,r]}doPrepareChar(t,a){a===void 0&&(a={});let r;return[t,r]=super.doPrepareChar(t.replace(/\D/g,""),a),t||(r.skip=!this.isComplete),[t,r]}_appendCharRaw(t,a){if(a===void 0&&(a={}),!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(t,a);const r=String(this.from).padStart(this.maxLength,"0"),n=String(this.to).padStart(this.maxLength,"0"),[o,s]=this.boundaries(this.value+t);return Number(s)<this.from?super._appendCharRaw(r[this.value.length],a):Number(o)>this.to?!a.tail&&this.autofix==="pad"&&this.value.length+1<this.maxLength?super._appendCharRaw(r[this.value.length],a).aggregate(this._appendCharRaw(t,a)):super._appendCharRaw(n[this.value.length],a):super._appendCharRaw(t,a)}doValidate(t){const a=this.value;if(a.search(/[^0]/)===-1&&a.length<=this._matchFrom)return!0;const[r,n]=this.boundaries(a);return this.from<=Number(n)&&Number(r)<=this.to&&super.doValidate(t)}pad(t){const a=new fe;if(this.value.length===this.maxLength)return a;const r=this.value,n=this.maxLength-this.value.length;if(n){this.reset();for(let o=0;o<n;++o)a.aggregate(super._appendCharRaw("0",t));r.split("").forEach(o=>this._appendCharRaw(o))}return a}}ue.MaskedRange=oa;const t4="d{.}`m{.}`Y";class Ot extends et{static extractPatternOptions(t){const{mask:a,pattern:r,...n}=t;return{...n,mask:ll(a)?a:r}}constructor(t){super(Ot.extractPatternOptions({...Ot.DEFAULTS,...t}))}updateOptions(t){super.updateOptions(t)}_update(t){const{mask:a,pattern:r,blocks:n,...o}={...Ot.DEFAULTS,...t},s=Object.assign({},Ot.GET_DEFAULT_BLOCKS());t.min&&(s.Y.from=t.min.getFullYear()),t.max&&(s.Y.to=t.max.getFullYear()),t.min&&t.max&&s.Y.from===s.Y.to&&(s.m.from=t.min.getMonth()+1,s.m.to=t.max.getMonth()+1,s.m.from===s.m.to&&(s.d.from=t.min.getDate(),s.d.to=t.max.getDate())),Object.assign(s,this.blocks,n),super._update({...o,mask:ll(a)?a:r,blocks:s})}doValidate(t){const a=this.date;return super.doValidate(t)&&(!this.isComplete||this.isDateExist(this.value)&&a!=null&&(this.min==null||this.min<=a)&&(this.max==null||a<=this.max))}isDateExist(t){return this.format(this.parse(t,this),this).indexOf(t)>=0}get date(){return this.typedValue}set date(t){this.typedValue=t}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(t){super.typedValue=t}maskEquals(t){return t===Date||super.maskEquals(t)}optionsIsChanged(t){return super.optionsIsChanged(Ot.extractPatternOptions(t))}}Ot.GET_DEFAULT_BLOCKS=()=>({d:{mask:oa,from:1,to:31,maxLength:2},m:{mask:oa,from:1,to:12,maxLength:2},Y:{mask:oa,from:1900,to:9999}}),Ot.DEFAULTS={...et.DEFAULTS,mask:Date,pattern:t4,format:(l,t)=>{if(!l)return"";const a=String(l.getDate()).padStart(2,"0"),r=String(l.getMonth()+1).padStart(2,"0"),n=l.getFullYear();return[a,r,n].join(".")},parse:(l,t)=>{const[a,r,n]=l.split(".").map(Number);return new Date(n,r-1,a)}},ue.MaskedDate=Ot;class sa extends Je{constructor(t){super({...sa.DEFAULTS,...t}),this.currentMask=void 0}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),"mask"in t&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(t.mask)?t.mask.map(a=>{const{expose:r,...n}=Fl(a),o=Ft({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...n});return r&&(this.exposeMask=o),o}):[])}_appendCharRaw(t,a){a===void 0&&(a={});const r=this._applyDispatch(t,a);return this.currentMask&&r.aggregate(this.currentMask._appendChar(t,this.currentMaskFlags(a))),r}_applyDispatch(t,a,r){t===void 0&&(t=""),a===void 0&&(a={}),r===void 0&&(r="");const n=a.tail&&a._beforeTailState!=null?a._beforeTailState._value:this.value,o=this.rawInputValue,s=a.tail&&a._beforeTailState!=null?a._beforeTailState._rawInputValue:o,i=o.slice(s.length),c=this.currentMask,u=new fe,d=c==null?void 0:c.state;return this.currentMask=this.doDispatch(t,{...a},r),this.currentMask&&(this.currentMask!==c?(this.currentMask.reset(),s&&(this.currentMask.append(s,{raw:!0}),u.tailShift=this.currentMask.value.length-n.length),i&&(u.tailShift+=this.currentMask.append(i,{raw:!0,tail:!0}).tailShift)):d&&(this.currentMask.state=d)),u}_appendPlaceholder(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendPlaceholder()),t}_appendEager(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendEager()),t}appendTail(t){const a=new fe;return t&&a.aggregate(this._applyDispatch("",{},t)),a.aggregate(this.currentMask?this.currentMask.appendTail(t):super.appendTail(t))}currentMaskFlags(t){var a,r;return{...t,_beforeTailState:((a=t._beforeTailState)==null?void 0:a.currentMaskRef)===this.currentMask&&((r=t._beforeTailState)==null?void 0:r.currentMask)||t._beforeTailState}}doDispatch(t,a,r){return a===void 0&&(a={}),r===void 0&&(r=""),this.dispatch(t,this,a,r)}doValidate(t){return super.doValidate(t)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(t)))}doPrepare(t,a){a===void 0&&(a={});let[r,n]=super.doPrepare(t,a);if(this.currentMask){let o;[r,o]=super.doPrepare(r,this.currentMaskFlags(a)),n=n.aggregate(o)}return[r,n]}doPrepareChar(t,a){a===void 0&&(a={});let[r,n]=super.doPrepareChar(t,a);if(this.currentMask){let o;[r,o]=super.doPrepareChar(r,this.currentMaskFlags(a)),n=n.aggregate(o)}return[r,n]}reset(){var t;(t=this.currentMask)==null||t.reset(),this.compiledMasks.forEach(a=>a.reset())}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(t){this.exposeMask?(this.exposeMask.value=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=t}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(t){this.exposeMask?(this.exposeMask.unmaskedValue=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=t}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(t){if(this.exposeMask){this.exposeMask.typedValue=t,this.currentMask=this.exposeMask,this._applyDispatch();return}let a=String(t);this.currentMask&&(this.currentMask.typedValue=t,a=this.currentMask.unmaskedValue),this.unmaskedValue=a}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var t;return!!((t=this.currentMask)!=null&&t.isComplete)}get isFilled(){var t;return!!((t=this.currentMask)!=null&&t.isFilled)}remove(t,a){const r=new fe;return this.currentMask&&r.aggregate(this.currentMask.remove(t,a)).aggregate(this._applyDispatch()),r}get state(){var t;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(a=>a.state),currentMaskRef:this.currentMask,currentMask:(t=this.currentMask)==null?void 0:t.state}}set state(t){const{compiledMasks:a,currentMaskRef:r,currentMask:n,...o}=t;a&&this.compiledMasks.forEach((s,i)=>s.state=a[i]),r!=null&&(this.currentMask=r,this.currentMask.state=n),super.state=o}extractInput(t,a,r){return this.currentMask?this.currentMask.extractInput(t,a,r):""}extractTail(t,a){return this.currentMask?this.currentMask.extractTail(t,a):super.extractTail(t,a)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(t,a){return this.currentMask?this.currentMask.nearestInputPos(t,a):super.nearestInputPos(t,a)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(t){this._overwrite=t}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(t){this._eager=t}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(t){this._skipInvalid=t}get autofix(){return this.currentMask?this.currentMask.autofix:this._autofix}set autofix(t){this._autofix=t}maskEquals(t){return Array.isArray(t)?this.compiledMasks.every((a,r)=>{if(!t[r])return;const{mask:n,...o}=t[r];return Ka(a,o)&&a.maskEquals(n)}):super.maskEquals(t)}typedValueEquals(t){var a;return!!((a=this.currentMask)!=null&&a.typedValueEquals(t))}}sa.DEFAULTS={...Je.DEFAULTS,dispatch:(l,t,a,r)=>{if(!t.compiledMasks.length)return;const n=t.rawInputValue,o=t.compiledMasks.map((s,i)=>{const c=t.currentMask===s,u=c?s.displayValue.length:s.nearestInputPos(s.displayValue.length,ne.FORCE_LEFT);return s.rawInputValue!==n?(s.reset(),s.append(n,{raw:!0})):c||s.remove(u),s.append(l,t.currentMaskFlags(a)),s.appendTail(r),{index:i,weight:s.rawInputValue.length,totalInputPositions:s.totalInputPositions(0,Math.max(u,s.nearestInputPos(s.displayValue.length,ne.FORCE_LEFT)))}});return o.sort((s,i)=>i.weight-s.weight||i.totalInputPositions-s.totalInputPositions),t.compiledMasks[o[0].index]}},ue.MaskedDynamic=sa;class ia extends et{constructor(t){super({...ia.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){const{enum:a,...r}=t;if(a){const n=a.map(i=>i.length),o=Math.min(...n),s=Math.max(...n)-o;r.mask="*".repeat(o),s&&(r.mask+="["+"*".repeat(s)+"]"),this.enum=a}super._update(r)}_appendCharRaw(t,a){a===void 0&&(a={});const r=Math.min(this.nearestInputPos(0,ne.FORCE_RIGHT),this.value.length),n=this.enum.filter(o=>this.matchValue(o,this.unmaskedValue+t,r));if(n.length){n.length===1&&this._forEachBlocksInRange(0,this.value.length,(s,i)=>{const c=n[0][i];i>=this.value.length||c===s.value||(s.reset(),s._appendChar(c,a))});const o=super._appendCharRaw(n[0][this.value.length],a);return n.length===1&&n[0].slice(this.unmaskedValue.length).split("").forEach(s=>o.aggregate(super._appendCharRaw(s))),o}return new fe({skip:!this.isComplete})}extractTail(t,a){return t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length),new It("",t)}remove(t,a){if(t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length),t===a)return new fe;const r=Math.min(super.nearestInputPos(0,ne.FORCE_RIGHT),this.value.length);let n;for(n=t;n>=0&&!(this.enum.filter(s=>this.matchValue(s,this.value.slice(r,n),r)).length>1);--n);const o=super.remove(n,a);return o.tailShift+=n-t,o}get isComplete(){return this.enum.indexOf(this.value)>=0}}ia.DEFAULTS={...et.DEFAULTS,matchValue:(l,t,a)=>l.indexOf(t,a)===a},ue.MaskedEnum=ia;class Di extends Je{updateOptions(t){super.updateOptions(t)}_update(t){super._update({...t,validate:t.mask})}}ue.MaskedFunction=Di;var Ai;class ut extends Je{constructor(t){super({...ut.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),this._updateRegExps()}_updateRegExps(){const t="^"+(this.allowNegative?"[+|\\-]?":""),a="\\d*",r=(this.scale?"("+bn(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(t+a+r),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(bn).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(bn(this.thousandsSeparator),"g")}_removeThousandsSeparators(t){return t.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(t){const a=t.split(this.radix);return a[0]=a[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),a.join(this.radix)}doPrepareChar(t,a){a===void 0&&(a={});const[r,n]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(a.input&&a.raw||!a.input&&!a.raw)?t.replace(this._mapToRadixRegExp,this.radix):t),a);return t&&!r&&(n.skip=!0),r&&!this.allowPositive&&!this.value&&r!=="-"&&n.aggregate(this._appendChar("-")),[r,n]}_separatorsCount(t,a){a===void 0&&(a=!1);let r=0;for(let n=0;n<t;++n)this._value.indexOf(this.thousandsSeparator,n)===n&&(++r,a&&(t+=this.thousandsSeparator.length));return r}_separatorsCountFromSlice(t){return t===void 0&&(t=this._value),this._separatorsCount(this._removeThousandsSeparators(t).length,!0)}extractInput(t,a,r){return t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length),[t,a]=this._adjustRangeWithSeparators(t,a),this._removeThousandsSeparators(super.extractInput(t,a,r))}_appendCharRaw(t,a){a===void 0&&(a={});const r=a.tail&&a._beforeTailState?a._beforeTailState._value:this._value,n=this._separatorsCountFromSlice(r);this._value=this._removeThousandsSeparators(this.value);const o=this._value;this._value+=t;const s=this.number;let i=!isNaN(s),c=!1;if(i){let f;this.min!=null&&this.min<0&&this.number<this.min&&(f=this.min),this.max!=null&&this.max>0&&this.number>this.max&&(f=this.max),f!=null&&(this.autofix?(this._value=this.format(f,this).replace(ut.UNMASKED_RADIX,this.radix),c||(c=o===this._value&&!a.tail)):i=!1),i&&(i=!!this._value.match(this._numberRegExp))}let u;i?u=new fe({inserted:this._value.slice(o.length),rawInserted:c?"":t,skip:c}):(this._value=o,u=new fe),this._value=this._insertThousandsSeparators(this._value);const d=a.tail&&a._beforeTailState?a._beforeTailState._value:this._value,m=this._separatorsCountFromSlice(d);return u.tailShift+=(m-n)*this.thousandsSeparator.length,u}_findSeparatorAround(t){if(this.thousandsSeparator){const a=t-this.thousandsSeparator.length+1,r=this.value.indexOf(this.thousandsSeparator,a);if(r<=t)return r}return-1}_adjustRangeWithSeparators(t,a){const r=this._findSeparatorAround(t);r>=0&&(t=r);const n=this._findSeparatorAround(a);return n>=0&&(a=n+this.thousandsSeparator.length),[t,a]}remove(t,a){t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length),[t,a]=this._adjustRangeWithSeparators(t,a);const r=this.value.slice(0,t),n=this.value.slice(a),o=this._separatorsCount(r.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(r+n));const s=this._separatorsCountFromSlice(r);return new fe({tailShift:(s-o)*this.thousandsSeparator.length})}nearestInputPos(t,a){if(!this.thousandsSeparator)return t;switch(a){case ne.NONE:case ne.LEFT:case ne.FORCE_LEFT:{const r=this._findSeparatorAround(t-1);if(r>=0){const n=r+this.thousandsSeparator.length;if(t<n||this.value.length<=n||a===ne.FORCE_LEFT)return r}break}case ne.RIGHT:case ne.FORCE_RIGHT:{const r=this._findSeparatorAround(t);if(r>=0)return r+this.thousandsSeparator.length}}return t}doCommit(){if(this.value){const t=this.number;let a=t;this.min!=null&&(a=Math.max(a,this.min)),this.max!=null&&(a=Math.min(a,this.max)),a!==t&&(this.unmaskedValue=this.format(a,this));let r=this.value;this.normalizeZeros&&(r=this._normalizeZeros(r)),this.padFractionalZeros&&this.scale>0&&(r=this._padFractionalZeros(r)),this._value=r}super.doCommit()}_normalizeZeros(t){const a=this._removeThousandsSeparators(t).split(this.radix);return a[0]=a[0].replace(/^(\D*)(0*)(\d*)/,(r,n,o,s)=>n+s),t.length&&!/\d$/.test(a[0])&&(a[0]=a[0]+"0"),a.length>1&&(a[1]=a[1].replace(/0*$/,""),a[1].length||(a.length=1)),this._insertThousandsSeparators(a.join(this.radix))}_padFractionalZeros(t){if(!t)return t;const a=t.split(this.radix);return a.length<2&&a.push(""),a[1]=a[1].padEnd(this.scale,"0"),a.join(this.radix)}doSkipInvalid(t,a,r){a===void 0&&(a={});const n=this.scale===0&&t!==this.thousandsSeparator&&(t===this.radix||t===ut.UNMASKED_RADIX||this.mapToRadix.includes(t));return super.doSkipInvalid(t,a,r)&&!n}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,ut.UNMASKED_RADIX)}set unmaskedValue(t){super.unmaskedValue=t}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(t){this.rawInputValue=this.format(t,this).replace(ut.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(t){this.typedValue=t}get allowNegative(){return this.min!=null&&this.min<0||this.max!=null&&this.max<0}get allowPositive(){return this.min!=null&&this.min>0||this.max!=null&&this.max>0}typedValueEquals(t){return(super.typedValueEquals(t)||ut.EMPTY_VALUES.includes(t)&&ut.EMPTY_VALUES.includes(this.typedValue))&&!(t===0&&this.value==="")}}Ai=ut,ut.UNMASKED_RADIX=".",ut.EMPTY_VALUES=[...Je.EMPTY_VALUES,0],ut.DEFAULTS={...Je.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[Ai.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:l=>l.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})},ue.MaskedNumber=ut;const Za={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function xn(l,t,a){t===void 0&&(t=Za.MASKED),a===void 0&&(a=Za.MASKED);const r=Ft(l);return n=>r.runIsolated(o=>(o[t]=n,o[a]))}function Mi(l,t,a,r){return xn(t,a,r)(l)}ue.PIPE_TYPE=Za,ue.createPipe=xn,ue.pipe=Mi;class Ti extends et{get repeatFrom(){var t;return(t=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===1/0?0:this.repeat)!=null?t:0}get repeatTo(){var t;return(t=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)!=null?t:1/0}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){var a,r,n;const{repeat:o,...s}=Fl(t);this._blockOpts=Object.assign({},this._blockOpts,s);const i=Ft(this._blockOpts);this.repeat=(a=(r=o??i.repeat)!=null?r:this.repeat)!=null?a:1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&((n=this._blocks)==null?void 0:n.length)||0,this.repeatFrom)),blocks:{m:i},eager:i.eager,overwrite:i.overwrite,skipInvalid:i.skipInvalid,lazy:i.lazy,placeholderChar:i.placeholderChar,displayChar:i.displayChar})}_allocateBlock(t){if(t<this._blocks.length)return this._blocks[t];if(this.repeatTo===1/0||this._blocks.length<this.repeatTo)return this._blocks.push(Ft(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]}_appendCharRaw(t,a){a===void 0&&(a={});const r=new fe;for(let c=(n=(o=this._mapPosToBlock(this.displayValue.length))==null?void 0:o.index)!=null?n:Math.max(this._blocks.length-1,0),u,d;u=(s=this._blocks[c])!=null?s:d=!d&&this._allocateBlock(c);++c){var n,o,s,i;const m=u._appendChar(t,{...a,_beforeTailState:(i=a._beforeTailState)==null||(i=i._blocks)==null?void 0:i[c]});if(m.skip&&d){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(r.aggregate(m),m.consumed)break}return r}_trimEmptyTail(t,a){var r,n;t===void 0&&(t=0);const o=Math.max(((r=this._mapPosToBlock(t))==null?void 0:r.index)||0,this.repeatFrom,0);let s;a!=null&&(s=(n=this._mapPosToBlock(a))==null?void 0:n.index),s==null&&(s=this._blocks.length-1);let i=0;for(let c=s;o<=c&&!this._blocks[c].unmaskedValue;--c,++i);i&&(this._blocks.splice(s-i+1,i),this.mask=this.mask.slice(i))}reset(){super.reset(),this._trimEmptyTail()}remove(t,a){t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length);const r=super.remove(t,a);return this._trimEmptyTail(t,a),r}totalInputPositions(t,a){return t===void 0&&(t=0),a==null&&this.repeatTo===1/0?1/0:super.totalInputPositions(t,a)}get state(){return super.state}set state(t){this._blocks.length=t._blocks.length,this.mask=this.mask.slice(0,this._blocks.length),super.state=t}}ue.RepeatBlock=Ti;try{globalThis.IMask=ue}catch{}const l4=Object.freeze(Object.defineProperty({__proto__:null,ChangeDetails:fe,ChunksTailDetails:al,DIRECTION:ne,HTMLContenteditableMaskElement:yn,HTMLInputMaskElement:vi,HTMLMaskElement:ra,InputMask:Bi,MaskElement:Ya,Masked:Je,MaskedDate:Ot,MaskedDynamic:sa,MaskedEnum:ia,MaskedFunction:Di,MaskedNumber:ut,MaskedPattern:et,MaskedRange:oa,MaskedRegExp:Si,PIPE_TYPE:Za,PatternFixedDefinition:kn,PatternInputDefinition:na,RepeatBlock:Ti,createMask:Ft,createPipe:xn,default:ue,forceDirection:Ci,normalizeOpts:Fl,pipe:Mi},Symbol.toStringTag,{value:"Module"})),Li={reference:{faq:"FAQ",banner:"Banner",slider:"Slider",video:"Video",about:"About",cards:"Cards",usefulLinks:"Useful Links",team:"Team",body:"Body",news:"News",form:"Form",tabs:"Tabs",vertical_tabs:"Vertical Tabs",documents:"Documents",infoLine:"Information Line",interested:"You may be interested",contact:"Contact"},navigation:{editMenu:"Edit Menu",dashboard:"Dashboard",collections:"Collections Structure",articles:"Articles",posts:"Posts",media:"Media",permissions:"Permissions",tags:"Tags",singletons:"Pages",feedback:"Feedback",email:"Пошти користувачів",singletonsMenu:"Menu",menuAdd:"Create Menu",builder:"Collections Structure",back:"Back",settings:"Settings",settingsDescription:"Manage your CMS configuration",singletonsMenuDescription:"Manage your menu.",users:"Users",general:"General",apiKeys:"API Keys",appearance:"Appearance",logs:"Logs"},dashboard:{title:"Dashboard",newCollection:"Create Collection",quickActions:"Quick Actions",views:"views",stats:{totalArticles:"Total Articles",totalMedia:"Total Media",activeUsers:"Active Users",apiRequests:"API Requests",fromLastMonth:"from last month"},collections:{title:"Collections",articles:"Articles",articlesDesc:"Description for articles",posts:"Posts",postsDesc:"Description for posts",products:"Products",productsDesc:"Description for products",categories:"Categories",categoriesDesc:"Description for categories",items:"items",new:"New Collection"},recentArticles:"Recent Articles",recentPosts:"Recent Posts",activeUsers:"Active Users",mediaFiles:"Media Files",createArticle:"Create Article",createPost:"Create Post",uploadMedia:"Upload Media",manageUsers:"Manage Users",feedback:"Feedback",createArticleDescription:"Create a new article for your site",uploadMediaDescription:"Upload media files for your site",manageUsersDescription:"Manage users for your site",viewFeedbackDescription:"View feedback for your site",activityFeed:"Activity Feed",viewAll:"View all",description:"Welcome to the CMS dashboard. You can create, edit, and manage your site's content.",newArticle:"Create Article",totalContent:"Total Content",articlesPostsPages:"Articles, Posts and Pages",monthlyActiveUsers:"Monthly Active Users",imagesVideosDocs:"Images, Videos and Docs",thisMonth:"This Month",newMediaFiles:"New Media Files",gettingStartedWithNextJs14:"Getting Started with Next.js 14",sarahJohnson:"Sarah Johnson",advancedReactPatterns:"Advanced React Patterns",uiUxDesignPrinciples:"UI/UX Design Principles",databaseOptimizationTips:"Database Optimization Tips",mikeChen:"Mike Chen",emmaWilson:"Emma Wilson",alexRodriguez:"Alex Rodriguez",recentContent:"Recent Content"},collections:{title:"Collections",selectCollection:"Select a collection to view its content",createCollection:"New Collection",searchCollections:"Search collections...",entries:"Entries",fields:"Fields",lastModified:"Last Modified",edit:"Edit",delete:"Delete",view:"View",form:{name:"Collection Name",slug:"Slug",description:"Description",fields:"Fields",addField:"Add Field"},dragToBuild:"Drag and drop content blocks here to build your collection structure",collectionCreated:"Collection created successfully",collectionCreationFailed:"Error creating collection",pinPublication:"Pin Publication"},articles:{title:"Articles",createArticle:"Create Article",searchArticles:"Search articles...",showColumns:"Show columns",update:"Update",create:"Create",form:{title:"Title",content:"Content",author:"Author",category:"Category",status:"Status"}},posts:{title:"Posts",createPost:"Create Post",searchPosts:"Search posts...",form:{title:"Title",content:"Content",author:"Author",category:"Category",status:"Status"}},singletons:{title:"Singletons",createSingleton:"Create Singleton",searchSingletons:"Search singletons...",form:{name:"Name",description:"Description",content:"Content",status:"Status"},search:"Search singletons..."},media:{title:"Media Library",description:"Manage your images, documents, and media files.",uploadMedia:"Upload Media",searchMedia:"Search files...",fileInfo:"File Information",preview:"Preview",newFolder:"New Folder",selectFile:"Select a file to view details",fileDetails:"File Details",name:"Name",size:"Size",dimensions:"Dimensions",uploadDate:"Upload Date",author:"Author",tags:"Tags",banner:"Banner",hero:"Hero",homepage:"Homepage",download:"Download",copyPath:"Copy path",copyPathFailed:"Failed to copy path",delete:"Delete",edit:"Edit",share:"Share",moreActions:"More actions",deleteFile:"Delete File",cancel:"Cancel",mediaLibrary:"Media Library",showColumns:"Show columns",update:"Update",create:"Create",createFolder:"Create Folder",files:"files",noFilesInFolder:"No files in this folder",deleteConfirmation:"Are you sure you want to delete this file?",uploaded:"Uploaded",filter:"Filter",search:"Search media files...",uploadingFiles:"Uploading files",uploading:"Uploading...",folder:"Folder",updatedAt:"Updated At",type:"Type",sortBy:{title:"Sort by",name:"File name",filesize:"File size"},upload:"Upload",selectFromMedia:"Select from media",selectedFiles:"Selected files: {count}",selectFiles:"Select files"},tags:{title:"Tags",description:"Manage your tags.",createTag:"Create Tag",editTag:"Edit Tag",searchTags:"Search tags...",form:{name:"Name",description:"Description",color:"Color",created_at:"Created At",count_data:"Count of Used",topic:"Topic"},emptyTitle:"No tags found",emptyDescription:"Create your first tag to get started.",emptyButton:"Create Tag"},feedback:{title:"Feedback",description:"View feedback",table:{number:"№",noFeedback:"No feedback",email:"Email",userName:"Full name",messageText:"Message text",feedbackType:"Type of appeal",phone:"Phone",resumeLink:"Resume link",linkedinLink:"Linkedin link",portfolioLink:"Portfolio link",telegramLink:"Telegram link"}},email:{title:"User mails",description:"View users awaiting feedback",table:{number:"№",date:"Date of shipment",email:"Email"}},emptyData:{title:"No data found",description:"Create your first item to get started.",buttonText:"Create Item"},form:{gen:"Generate",key:"Key",value:"Value",noDataToDisplay:"No data to display",add:"Add"},builder:{manageContentCollections:"Manage content collections",searchCollections:"Search collections...",collections:"Collections",collectionStructure:"Collection Structure",defineFields:"Define the fields and their types for this collection",name:"Name",edit:"Edit",preview:"Preview",type:"Type",content:"Content",seo:"SEO",tags:"Tags",save:"Save",cancel:"Cancel",create:"Create",localization:"Localization",actions:"Actions",noColumnsFound:"No columns found",collectionName:"Collection Name",title:"Title",entries:"Entries",fields:"Fields",status:"Status",lastModified:"Last Modified",editCollection:"Edit collection",editContentForYourSite:"Edit content for your site",deleteObject:"Are you sure you want to delete this object?",editField:"Edit field",deleteTitle:"Delete field",deleteField:"Are you sure you want to delete this field?",scheme:{name:{label:"Name",placeholder:"Name"},title:{label:"Title",placeholder:"Title"},type:{label:"Type",placeholder:"Type",options:{collection:"Collection",single:"Single"}},customTable:{label:"Custom Table"},status:{label:"Status",placeholder:"Status",options:{published:"Published",draft:"Draft",archived:"Archived"}},description:{label:"Description",placeholder:"Description"},preview_path:{label:"Preview path",placeholder:"Preview path",info:"Path to slug for preview"},include_search:{label:"Include in search?",placeholder:"Include in search?"}},required:"Required field",createField:"Create field",selectType:"Select type",createFolder:"Create folder",changeType:"Change type",fieldLabels:{name:"Name",label:"Label",placeholder:"Placeholder",help:"Help",type:"Type",subtype:"Subtype",parent:"Parent",options:"Options",colModel:"ColModel",multiple:"Multiple",api:"API",relation:"Relation",required:"Required",localization:"Localization"},fieldPlaceholders:{name:"Name",label:"Title",placeholder:"Placeholder",help:"Help",type:"Type",subtype:"Subtype",parent:"Parent",options:"Options",colModel:"ColModel",api:"API",relation:"Relation"},fieldOptions:{text:"Text",number:"Number",integer:"Integer",date:"Date",datetime:"Datetime",file:"File",select:"Select",multiselect:"MultiSelect",mediaselect:"MediaSelect",radio:"Radio",boolean:"Boolean",datalist:"Data list",image:"Image",slug:"Slug",richtext:"Rich Text",markdown:"Markdown",reference:"Reference",relation:"Relation",fileList:"Gallery",tags:"Tags"}},menu:{title:"Menu",description:"Manage your menu.",createMenu:"Create Menu",searchMenu:"Search menu...",menuAdd:"Add Menu",editMenu:"Edit Menu",textEditor:"Text Editor",listTree:"List Tree",filter:"Filter",search:"Search menu...",menuCreated:"Menu created",menuCreateError:"Error creating menu",menuUpdated:"Menu updated",menuUpdateError:"Error updating menu",menuDeleted:"Menu deleted",menuDeleteError:"Error deleting menu",form:{name:"Name",description:"Description",content:"Content",status:"Status",value:"Value",language:"Language"}},settings:{title:"Settings",description:"Configure your CMS settings and preferences.",systemStatus:"System Status",siteInformation:"Site Information",siteName:"Site Name",version:"Version",environment:"Environment",security:"Security",localization:"Localization",production:"Production",systemHealth:"System Health",database:"Database",connected:"Connected",cache:"Cache",active:"Active",storage:"Storage",used:"Used",configure:"Configure",successTitle:"Success",successMessage:"Settings saved successfully",errorTitle:"Error",errorMessage:"Error saving settings",generateNewKey:"Generate New Key",apiSecurity:"API Security",general:{general:"General Settings",generalDescription:"Manage your general settings.",url:"URL",language:"Language",languages:"Languages",contacts:"Contacts",showSocialsNumber:"Number of socials to display",mapCoords:"Map coordinates",socials:"Socials",saveChanges:"Save Changes",cancel:"Cancel",notifications:"Notifications",emailNotifications:"Email Notifications",emailNotificationsDescription:"Receive notifications by email",pushNotifications:"Browser Notifications",pushNotificationsDescription:"Browser notifications for important updates",smsNotifications:"SMS Notifications",smsNotificationsDescription:"SMS notifications for critical updates",desktopNotifications:"Desktop Notifications",desktopNotificationsDescription:"Desktop notifications",siteDescription:"Site Description",siteUrl:"Site URL",siteLanguage:"Site Language",siteEmail:"Site Email",sitePhone:"Site Phone",siteAddress:"Site Address",siteName:"Site Name",title:"Title",content:"Content",name:"Name",siteInformation:"Site Information",logoSite:"Site Logo",logoCms:"CMS Logo",imageLogin:"Login Image",logo:"Logo",siteInformationDescription:"Manage your site information."},users:{users:"User Management",usersDescription:"Manage your user management configuration.",userRegistration:"User Registration",allowRegistration:"Allow User Registration",allowRegistrationDescription:"Enable new users to register accounts",emailVerification:"Email Verification Required",emailVerificationDescription:"Require email verification for new accounts",autoApprove:"Auto-approve Users",autoApproveDescription:"Automatically approve new user registrations",defaultRole:"Default User Role"},"api-keys":{apiKeys:"API Keys",apiKeysDescription:"Manage your api keys configuration.",productionApiKey:"Production API Key",developmentApiKey:"Development API Key",generateNewKey:"Generate New Key",apiSecurity:"API Security",rateLimiting:"Rate Limiting",rateLimitingDescription:"Enable API rate limiting protection",corsProtection:"CORS Protection",corsProtectionDescription:"Cross-origin request security",apiLogging:"API Logging",apiLoggingDescription:"Log all API requests and responses"},appearance:{appearance:"Appearance",appearanceDescription:"Manage your appearance settings.",colorTheme:"Color Theme",darkMode:"Dark Mode",darkModeDescription:"Switch to dark theme",compactMode:"Compact Mode",compactModeDescription:"Reduce spacing and padding",animations:"Animations",animationsDescription:"Enable interface animations",themeBlue:"Blue",themeGreen:"Green",themePurple:"Purple"},logs:{title:"Logs",description:"View all your actions in the system",table:{objectId:"Object Identifier",dateTime:"Date and Time of Change",changeType:"Change Type",noLogs:"No user logs found",noLogsDescription:"No user logs found"}},permissions:{title:"Permissions",user:"User",role:"Role",lastActive:"Last Active",actions:"Actions",rolePermissions:"Role Permissions",rolePermissionsDescription:"Permissions assigned to each role in the system.",permission:"Permission",admin:"Admin",editor:"Editor",author:"Author",viewer:"Viewer",customizePermissions:"Customize Permissions",inviteUser:"Invite User",searchUsers:"Search users...",createContent:"Create Content",editContent:"Edit Content",deleteContent:"Delete Content",publishContent:"Publish Content",manageMedia:"Manage Media",manageUsers:"Manage Users",manageSettings:"Manage Settings",remove:"Remove",edit:"Edit",time:{hoursAgo:"{count} hours ago",hourAgo:"1 hour ago",daysAgo:"{count} days ago",dayAgo:"1 day ago",weeksAgo:"{count} weeks ago",weekAgo:"1 week ago",minutesAgo:"{count} minutes ago",minuteAgo:"1 minute ago",justNow:"just now"},roles:{admin:"Admin",editor:"Editor",author:"Author",viewer:"Viewer"}}},block:{type:{heading:"Heading",paragraph:"Paragraph"}},app:{name:"SOFTPRO software package: GIS MBK Kamyansk City TG",tagline:"Do more with less"},nav:{home:"Home",about:"About",profile:"Profile",settings:"Settings",logout:"Log out"},common:{ok:"OK",save:"Save",cancel:"Cancel",close:"Close",delete:"Delete",edit:"Edit",loading:"Loading…",retry:"Retry",title:"Title",description:"Description",keywords:"Keywords",successMessage:"Success",errorMessage:"Error",success:"Success",error:"Error",meta:"Meta",actions:{add:"Add",save:"Save",cancel:"Cancel",edit:"Edit",delete:"Delete",create:"Create",preview:"Preview",search:"Search",filter:"Filter",export:"Export",addField:"Add Field",success:"Success",error:"Error",back:"Back"},status:{published:"Published",draft:"Draft",archived:"Archived"},content:"Content",pagination:{showing:"Showing",to:"to",of:"of",results:"results",previous:"Previous",next:"Next"}},auth:{title:"Sign in",email:"Email",password:"Password",remember:"Remember me",submit:"Sign in",errors:{invalid:"Invalid email or password",required:"{field} is required"}},table:{choose:"Choose columns to display",columns:"Columns",actions:"Actions",search:"Search",export:"Export",exportTitle:"Export table",close:"Close",chooseColumns:"Select columns for export:",selectAll:"Select all",selectCurrent:"Select current",none:"None",chooseFormat:"Choose table format:",time:{weeksAgo:"{count} weeks ago",weekAgo:"1 week ago",daysAgo:"{count} days ago",dayAgo:"1 day ago",hoursAgo:"{count} hours ago",hourAgo:"1 hour ago",minutesAgo:"{count} minutes ago",minuteAgo:"1 minute ago",justNow:"just now"},format:{json:"JSON format",csv:"CSV format",xlsx:"XLSX format"},cancel:"Cancel",download:"Download table"},filter:{search:"Search",more:"Show more",less:"Show less",selected:"selected",clear:"Clear",apply:"Apply",from:"From",to:"To",notfound:"Nothing found",period:"Period",today:"Today",week:"Week",month:"Month",quarter:"Quarter",year:"Year",alltime:"All Time",prev:"Prev",next:"Next"},items:{title:"Items",add:"Add item",count:"No items | One item | {count} items",created:"Item “{name}” has been created",deleted:"Item deleted"},errors:{network:"Network error. Please try again.",notFound:"We couldn't find what you were looking for."},toast:{saved:"Changes saved",copied:"Copied to clipboard"},users:{title:"Users",description:"Manage your users.",createUser:"Create User",editUser:"Edit User",searchUsers:"Search users...",createUserFailed:"Create user failed",createUserSuccess:"User created successfully",editUserFailed:"Edit user failed",editUserSuccess:"User edited successfully",deleteUserSuccess:"User deleted successfully",deleteUserFailed:"User deleted failed",form:{name:"Name",description:"Description",color:"Color",created_at:"Created At",count_data:"Count of Used",topic:"Topic"},emptyTitle:"No users found",emptyDescription:"Create your first user to get started.",emptyButton:"Create User"},fetchContentTypes:"fetchContentTypes",action:"action",delete:"delete","create-folder":"create-folder",formValues:"formValues",metaParentValue:"metaParentValue",blur:"blur","-":"-",noFilesInFolder:"noFilesInFolder",guide:{menu:"Guide for menu",general:"Guide",media:"Guide for media",settings:"Guide for settings",users:"Guide for users",content:"Guide for content",appOverview:"Guide for app overview",collections:"Guide for collections",help:"Help"}},a4=Object.freeze(Object.defineProperty({__proto__:null,cms:Li,default:{cms:Li}},Symbol.toStringTag,{value:"Module"})),$i={reference:{faq:"Акордeон",photoGrid:"Фотогалерея",banner:"Банер",slider:"Слайдер",video:"Відео",about:"Про нас",cards:"Картки",usefulLinks:"Корисні посилання",team:"Команда",body:"Тіло",news:"Новини",form:"Форма",tabs:"Таби",vertical_tabs:"Вертикальні таби",documents:"Документи",infoLine:"Інформаційна лінія",iframe:"Iframe",interested:"Вас може зацікавити",contact:"Контакти"},navigation:{editMenu:"Редагувати меню",dashboard:"Панель керування",collections:"Керування контентом",articles:"Статті",posts:"Дописи",media:"Медіа",permissions:"Дозволи",tags:"Теги",singletons:"Сторінки",singletonsMenu:"Меню",feedback:"Зворотній зв'язок",email:"Пошти користувачів",menuAdd:"Створити меню",builder:"Структура колекцій",back:"Назад",settings:"Налаштування",settingsDescription:"Налаштування вашого сайту",singletonsMenuDescription:"Керування меню.",users:"Користувачі",general:"Основні",apiKeys:"API ключі",appearance:"Вигляд",logs:"Логи"},dashboard:{title:"Панель керування",description:"Вітаємо в панелі керування CMS. Ви можете створювати, редагувати та управляти контентом вашого сайту.",newCollection:"Створити колекцію",quickActions:"Швидкі дії",views:"переглядів",stats:{totalArticles:"Всього статей",totalMedia:"Всього медіа",activeUsers:"Активні користувачі",apiRequests:"API запити",fromLastMonth:"з минулого місяця"},collections:{title:"Колекції",articles:"Статті",articlesDesc:"Опис для статей",posts:"Дописи",postsDesc:"Опис для дописів",products:"Продукти",productsDesc:"Опис для продуктів",categories:"Категорії",categoriesDesc:"Опис для категорій",items:"шт.",new:"Нова колекція"},recentArticles:"Останні статті",recentPosts:"Останні дописи",recentContent:"Останній контент",activityFeed:"Стрічка активності",viewAll:"Показати все",totalContent:"Всього контенту",articlesPostsPages:"Статті, дописи та сторінки",monthlyActiveUsers:"Активних користувачів за місяць",imagesVideosDocs:"Зображення, відео та документи",thisMonth:"Цього місяця",activeUsers:"Активні користувачі",mediaFiles:"Файли медіа",createArticle:"Створити статтю",createPost:"Створити допис",uploadMedia:"Завантажити медіа",createArticleDescription:"Створіть статтю для вашого сайту",uploadMediaDescription:"Завантажте медіа файли для вашого сайту",manageUsersDescription:"Керуйте користувачами вашого сайту",viewFeedbackDescription:"Перегляд зворотнього зв'язку",manageUsers:"Керування користувачами",feedback:"Зворотній зв'язок",newMediaFiles:"Нових файлів медіа",gettingStartedWithNextJs14:"Початок роботи з Next.js 14",sarahJohnson:"Sarah Johnson",advancedReactPatterns:"Підвищені шаблони React",uiUxDesignPrinciples:"Принципи дизайну UI/UX",databaseOptimizationTips:"Поради з оптимізації бази даних",mikeChen:"Mike Chen",emmaWilson:"Emma Wilson",alexRodriguez:"Alex Rodriguez"},collections:{title:"Колекції",selectCollection:"Виберіть колекцію для перегляду її контенту",createCollection:"Створити колекцію",searchCollections:"Пошук колекцій...",entries:"Записи",fields:"Поля",lastModified:"Останнє редагування",edit:"Редагувати",delete:"Видалити",view:"Перегляд",form:{name:"Назва колекції",slug:"Слаг",description:"Опис",fields:"Поля",addField:"Додати поле"},dragToBuild:"Перетягніть блоки контенту сюди, щоб створити структуру колекції",collectionCreated:"Колекція успішно створена",collectionCreationFailed:"Помилка при створенні колекції",pinPublication:"Закріпити публікацію"},articles:{title:"Сторінки",createArticle:"Створити сторінку",searchArticles:"Пошук статей...",showColumns:"Показати колонки",update:"Оновити",create:"Створити",form:{title:"Заголовок",content:"Зміст",author:"Автор",category:"Категорія",status:"Статус"}},posts:{title:"Дописи",createPost:"Створити допис",searchPosts:"Пошук дописів...",form:{title:"Заголовок",content:"Зміст",author:"Автор",category:"Категорія",status:"Статус"}},singletons:{title:"Синглтони",createSingleton:"Створити синглтон",searchSingletons:"Пошук синглтонів...",form:{name:"Назва",description:"Опис",content:"Зміст",status:"Статус"},search:"Пошук синглтонів..."},media:{title:"Медіа бібліотека",description:"Керуйте своїми зображеннями, документами та медіа файлами.",uploadMedia:"Завантажити медіа",searchMedia:"Пошук файлів...",fileInfo:"Інформація про файл",preview:"Перегляд",newFolder:"Нова папка",selectFile:"Виберіть файл для перегляду деталей",fileDetails:"Інформація про файл",name:"Назва",size:"Розмір",dimensions:"Розміри",uploadDate:"Дата завантаження",author:"Автор",tags:"Теги",banner:"Банер",hero:"Герой",homepage:"Головна",download:"Завантажити",copyPath:"Копіювати шлях",copyPathFailed:"Не вдалося скопіювати шлях",delete:"Видалити",edit:"Редагувати",share:"Поділитися",moreActions:"Більше дій",deleteFile:"Ви впевнені, що хочете видалити цей файл?",createFolder:"Створити папку",cancel:"Скасувати",mediaLibrary:"Медіа бібліотека",files:"файлів",noFilesInFolder:"Немає файлів у цій папці",deleteConfirmation:"Ви впевнені, що хочете видалити цей файл?",uploaded:"Завантажено",filter:"Фільтр",search:"Пошук файлів...",uploadingFiles:"Завантаження файлів",uploading:"Завантаження...",folder:"Папка",type:"Тип",updatedAt:"Оновлено",sortBy:{title:"Сортувати за",name:"Назва файлу",filesize:"Розмір файлу"},upload:"Завантажити",selectFromMedia:"Вибрати з медіа",selectFiles:"Вибрати файли",selectedFiles:"Вибрано файлів: {count}"},tags:{title:"Теги",description:"Керування тегами.",createTag:"Створити тег",editTag:"Редагувати тег",searchTags:"Пошук тегів...",form:{name:"Назва",description:"Опис",color:"Колір",slug:"Slug",created_at:"Дата створення",count_data:"Кількість використань",topic:"Тема"},emptyTitle:"Теги не знайдені",emptyDescription:"Створіть свій перший тег, щоб почати.",emptyButton:"Створити тег"},feedback:{title:"Зворотній зв'язок",description:"Переглядайте зворотній зв'язок",table:{number:"№",noFeedback:"Фідбек відсутній",email:"Email",userName:"ПІБ",messageText:"Текст повідомлення",feedbackType:"Тип звернення",cdate:"Дата відгуку",phone:"Телефон",resumeLink:"Посилання на резюме",linkedinLink:"Посилання на лінкедин",portfolioLink:"Посилання на портфоліо",telegramLink:"Посилання на телеграм"}},email:{title:"Пошти користувачів",description:"Переглядайте користувачів, які очікують зворотнього зв'язку",table:{number:"№",date:"Дата відправки",email:"Email"}},emptyData:{title:"Немає даних",description:"Створіть свій перший елемент, щоб почати.",buttonText:"Створити елемент"},form:{gen:"Згенерувати",key:"Ключ",value:"Значення",noDataToDisplay:"Дані для відображення відсутні",add:"Додати"},builder:{faq:"Акордeон",photoGrid:"Фотогалерея",banner:"Банер",slider:"Слайдер",video:"Відео",about:"Про нас",cards:"Картки",usefulLinks:"Корисні посилання",team:"Команда",body:"Тіло",news:"Новини",form:"Форма",tabs:"Таби",vertical_tabs:"Вертикальні таби",documents:"Документи",infoLine:"Інформаційна лінія",iframe:"Iframe",manageContentCollections:"Керування колекціями контенту",searchCollections:"Пошук колекцій...",collections:"Структура колекцій",collectionStructure:"Структура колекції",defineFields:"Визначте поля та їх типи для цієї колекції",name:"Назва",changeType:"Змінити тип",type:"Тип",save:"Зберегти",edit:"Редагувати",content:"Контент",seo:"SEO",tags:"Теги",preview:"Перегляд",collectionName:"Назва колекції",title:"Заголовок",entries:"Записи",fields:"Поля",status:"Статус",lastModified:"Останнє редагування",cancel:"Скасувати",create:"Створити",localization:"Локалізація",actions:"Дії",noColumnsFound:"Немає колонок",editCollection:"Редагувати колекцію",editContentForYourSite:"Редагувати контент для вашого сайту",deleteObject:"Ви впевнені, що хочете видалити цей об'єкт?",editField:"Редагувати поле",deleteTitle:"Видалити поле",deleteField:"Ви впевнені, що хочете видалити це поле?",scheme:{name:{label:"Назва",placeholder:"Назва"},title:{label:"Заголовок",placeholder:"Заголовок"},type:{label:"Тип",placeholder:"Тип",options:{collection:"Колекція",single:"Сторінка"}},customTable:{label:"Власна таблиця"},status:{label:"Статус",placeholder:"Статус",options:{published:"Опубліковано",draft:"Чернетка",archived:"Архівовано"}},description:{label:"Опис",placeholder:"Опис"},preview_path:{label:"Шлях для прев'ю",placeholder:"Шлях для прев'ю",info:"Шлях до slug для прев'ю"},include_search:{label:"Включити в пошук?",placeholder:"Включити в пошук?"}},required:"Обов'язкове поле",createField:"Створити поле",selectType:"Оберіть тип",createFolder:"Створити папку",fieldLabels:{name:"Назва",label:"Мітка",placeholder:"Плейсхолдер",help:"Допомога",type:"Тип",subtype:"Підтип",parent:"Батьківський",data:"ID класифікатора",options:"Опції",colModel:"Модель колонок",multiple:"Множинний",api:"API",relation:"Зв'язок",required:"Обов'язковий",localization:"Локалізація"},fieldPlaceholders:{name:"Назва",label:"Заголовок",placeholder:"Плейсхолдер",help:"Допомога",type:"Тип",subtype:"Підтип",parent:"Батьківський",data:"ID класифікатора",options:"Опції",colModel:"Модель колонок",api:"API",relation:"Зв'язок"},fieldOptions:{text:"Текст",number:"Число",integer:"Ціле число",date:"Дата",datetime:"Дата і час",file:"Файл",select:"Селект",multiselect:"Мультиселект",mediaselect:"Вибір медіа",radio:"Радіо",boolean:"Булевий",datalist:"Дататейбл",image:"Зображення",slug:"Слаг",richtext:"Текстовий редактор",markdown:"Markdown",reference:"Секції",relation:"Зв'язок",fileList:"Мультифайл",tags:"Теги"}},menu:{title:"Меню",description:"Керування меню.",createMenu:"Створити меню",searchMenu:"Пошук меню...",menuAdd:"Додати меню",editMenu:"Редагувати меню",textEditor:"Текстовий редактор",menuCreated:"Меню створено",menuCreateError:"Помилка при створенні меню",menuUpdated:"Меню оновлено",menuUpdateError:"Помилка при оновленні меню",menuDeleted:"Меню видалено",menuDeleteError:"Помилка при видаленні меню",listTree:"Список дерева",filter:"Фільтр",search:"Пошук меню...",form:{name:"Назва",description:"Опис",content:"Зміст",status:"Статус",value:"Значення",language:"Мова"}},settings:{title:"Налаштування",description:"Налаштуйте ваші налаштування CMS та налаштування.",systemStatus:"Статус системи",siteInformation:"Інформація про сайт",logo:"Логотип",siteName:"Назва сайту",version:"Версія",environment:"Середовище",security:"Безпека",localization:"Локалізація",production:"Виробництво",systemHealth:"Здоров'я системи",database:"База даних",connected:"З'єднано",cache:"Кеш",active:"Активний",storage:"Хмарне сховище",used:"Використано",configure:"Налаштувати",successTitle:"Успішно",successMessage:"Налаштування успішно збережено",errorTitle:"Помилка",errorMessage:"Помилка при збереженні налаштувань",generateNewKey:"Згенерувати новий ключ",apiSecurity:"Безпека API",general:{general:"Основні налаштування",generalDescription:"Керуйте вашими загальними налаштуваннями.",url:"URL",language:"Мова",languages:"Мови",contacts:"Контакти",socials:"Соціальні мережі",showSocialsNumber:"Кількість соціальних мереж для відображення",mapCoords:"Координати для відображення на карті",saveChanges:"Зберегти зміни",cancel:"Скасувати",notifications:"Сповіщення",emailNotifications:"Сповіщення по email",emailNotificationsDescription:"Отримувати сповіщення по email",pushNotifications:"Сповіщення в браузері",pushNotificationsDescription:"Сповіщення в браузері для важливих оновлень",smsNotifications:"Сповіщення по SMS",smsNotificationsDescription:"Сповіщення по SMS для критичних оновлень",desktopNotifications:"Сповіщення на комп'ютері",desktopNotificationsDescription:"Сповіщення на комп'ютері",siteName:"Назва сайту",siteDescription:"Опис сайту",siteUrl:"URL сайту",previewUrl:"URL попереднього перегляду",logoSite:"Логотип сайту",logoCms:"Логотип CMS",imageLogin:"Зображення для входу",siteLanguage:"Мова сайту",siteEmail:"Email сайту",sitePhone:"Телефон сайту",siteAddress:"Адреса сайту",siteInformation:"Інформація про сайт",logo:"Логотип",siteInformationDescription:"Керуйте вашою інформацією про сайт.",title:"Заголовок",content:"Контент",name:"Назва соцмережі"},users:{users:"Керування користувачами",usersDescription:"Керуйте налаштуваннями керування користувачами.",userRegistration:"Реєстрація користувачів",allowRegistration:"Дозволити реєстрацію користувачів",allowRegistrationDescription:"Дозволити новим користувачам реєструвати акаунти",emailVerification:"Потрібна верифікація email",emailVerificationDescription:"Вимагати підтвердження email для нових акаунтів",autoApprove:"Автоматичне схвалення користувачів",autoApproveDescription:"Автоматично схвалювати нові реєстрації користувачів",defaultRole:"Роль за замовчуванням"},"api-keys":{apiKeys:"API ключі",apiKeysDescription:"Керуйте налаштуваннями API ключів.",productionApiKey:"Production API ключ",developmentApiKey:"Development API ключ",generateNewKey:"Згенерувати новий ключ",apiSecurity:"Безпека API",rateLimiting:"Обмеження швидкості",rateLimitingDescription:"Увімкнути захист обмеження швидкості API",corsProtection:"Захист CORS",corsProtectionDescription:"Безпека крос-доменних запитів",apiLogging:"Логування API",apiLoggingDescription:"Логувати всі API запити та відповіді"},appearance:{appearance:"Вигляд",appearanceDescription:"Керуйте вашим виглядом та налаштуваннями.",colorTheme:"Кольорова тема",darkMode:"Темний режим",darkModeDescription:"Перемкнути на темну тему",compactMode:"Компактний режим",compactModeDescription:"Зменшити відступи та поля",animations:"Анімації",animationsDescription:"Увімкнути анімації інтерфейсу",themeBlue:"Синя",themeGreen:"Зелена",themePurple:"Фіолетова"},logs:{title:"Логи",description:"Переглядай всі свої дії в системі",table:{number:"№",objectId:"Ідентифікатор об'єкта",dateTime:"Дата та час зміни",changeType:"Тип зміни",noLogs:"Логи користувача відсутні"}},permissions:{title:"Дозволи",user:"Користувач",role:"Роль",lastActive:"Остання активність",actions:"Дії",rolePermissions:"Дозволи ролі",rolePermissionsDescription:"Дозволи, призначені для кожної ролі в системі.",permission:"Дозвіл",admin:"Адміністратор",editor:"Редактор",author:"Автор",viewer:"Переглядач",customizePermissions:"Налаштувати дозволи",inviteUser:"Запросити користувача",searchUsers:"Пошук користувачів...",createContent:"Створити контент",editContent:"Редагувати контент",deleteContent:"Видалити контент",publishContent:"Опублікувати контент",manageMedia:"Керування медіа",manageUsers:"Керування користувачами",manageSettings:"Керування налаштуваннями",remove:"Вилучити",edit:"Редагувати",time:{hoursAgo:"{count} годин тому",hourAgo:"1 година тому",daysAgo:"{count} днів тому",dayAgo:"1 день тому",weeksAgo:"{count} тижнів тому",weekAgo:"1 тиждень тому",minutesAgo:"{count} хвилин тому",minuteAgo:"1 хвилина тому",justNow:"щойно"},roles:{admin:"Адміністратор",editor:"Редактор",author:"Автор",viewer:"Переглядач"}}},block:{type:{heading:"Заголовок",paragraph:"Параграф"}},app:{name:"Програмний комплекс SOFTPRO: ГІС МБК Кам'янської міської ТГ",tagline:"Зробіть більше з меншим"},nav:{home:"Домашній",about:"Про",profile:"Профіль",settings:"Налаштування",logout:"Вихід"},common:{ok:"Добре",save:"Зберегти",cancel:"Скасувати",close:"Закрити",delete:"Вилучити",edit:"Редагувати",loading:"Завантаження…",retry:"Повторити",title:"Назва",description:"Опис",keywords:"Ключові слова",success:"Успіх",error:"Помилка",successMessage:"Успішно",errorMessage:"Помилка",meta:"Мета",content:"Контент",actions:{add:"Додати",save:"Зберегти",cancel:"Скасувати",edit:"Редагувати",delete:"Видалити",create:"Створити",preview:"Перегляд",search:"Пошук",filter:"Фільтр",export:"Експорт",addField:"Додати поле",success:"Успіх",error:"Помилка",back:"Повернутися"},status:{published:"Опубліковано",draft:"Чернетка",archived:"Архівовано"},pagination:{showing:"Показано",to:"по",of:"з",results:"результатів",previous:"Попередня",next:"Наступна"}},auth:{title:"Увійти",email:"Електронна пошта",password:"Пароль",remember:"Пам'ятайте мене",submit:"Увійти",errors:{invalid:"Недійсний електронний лист або пароль",required:"{Поле} потрібно"}},table:{choose:"Оберіть колонки для відображення",columns:"Колонки",actions:"Дії",search:"Пошук",export:"Експорт",exportTitle:"Експорт таблиці",close:"Закрити",chooseColumns:"Виберіть стовпці таблиці для експорту:",selectAll:"Вибрати усі",selectCurrent:"Вибрати поточні",none:"Жодного",chooseFormat:"Виберіть формат таблиці:",cancel:"Скасувати",download:"Завантажити таблицю",time:{weeksAgo:"{count} тижнів тому",weekAgo:"1 тиждень тому",daysAgo:"{count} днів тому",dayAgo:"1 день тому",hoursAgo:"{count} годин тому",hourAgo:"1 година тому",minutesAgo:"{count} хвилин тому",minuteAgo:"1 хвилина тому",justNow:"щойно"},format:{json:"Формат json",csv:"Формат csv",xlsx:"Формат xlsx"}},filter:{search:"Пошук",more:"Показати більше",less:"Показати меньше",selected:"обрано",clear:"Очистити",apply:"Застосувати",from:"Від",period:"Період",today:"Сьогодні",week:"Тиждень",month:"Місяць",quarter:"Квартал",year:"Рік",alltime:"Весь час",prev:"Попередній період",next:"Настпуний період",to:"До",notfound:"Нічого не знайдено"},items:{title:"Предмети",add:"Додати елемент",count:"Немає предметів | ",created:`Елемент "{Ім'я}" створений`,deleted:"Елемент видалено"},errors:{network:"Помилка мережі. ",notFound:"Ми не змогли знайти те, що ви шукали."},toast:{saved:"Збережені зміни",copied:"Скопіювано в буфер обміну"},users:{title:"Користувачі",description:"Керування користувачами.",createUser:"Створити користувача",editUser:"Редагувати користувача",searchUsers:"Пошук користувачів...",createUserFailed:"Створити користувача не вдалося",createUserSuccess:"Користувача створено успішно",editUserFailed:"Редагувати користувача не вдалося",editUserSuccess:"Користувача редаговано успішно",deleteUserSuccess:"Користувача видалено успішно",deleteUserFailed:"Користувача видалено не вдалося",form:{name:"Назва",description:"Опис",color:"Колір",created_at:"Дата створення",count_data:"Кількість використань",topic:"Тема"}},fetchContentTypes:"fetchContentTypes",action:"action",delete:"delete","create-folder":"create-folder",formValues:"formValues",metaParentValue:"metaParentValue",blur:"blur","-":"-",noFilesInFolder:"noFilesInFolder",guide:{menu:"Посібник з меню",general:"Посібник",media:"Посібник з медіа",settings:"Посібник з налаштувань",users:"Посібник з користувачів",content:"Посібник з контенту",appOverview:"Посібник з огляду програми",collections:"Посібник з колекцій",help:"Допомога"}},r4=Object.freeze(Object.defineProperty({__proto__:null,cms:$i,default:{cms:$i}},Symbol.toStringTag,{value:"Module"}));qe.ArticlesPage=Vs,qe.BuilderPage=z_,qe.CmsContentWrapper=qB,qe.CollectionsPage=Mr,qe.Dashboard=Ar,qe.EditCollectionPage=gB,qe.default=Ar,qe.i18n=$l,qe.initI18n=YB,qe.install=ZB,qe.loadLocaleMessages=XB,qe.setLocale=KB,Object.defineProperties(qe,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});