mokelay-editor 0.0.1 → 0.0.2

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.
@@ -1 +1 @@
1
- import{d as m,r as l,o as g,c as p,a as k,w,b as a,t as c,u as x,e as y,f as C,_ as E}from"./index-C0VPLP4t.js";import{M as _,_ as N}from"./storage-tTDw43ui.js";import"./editorjs-hCuh8vdW.js";function S(r){const s=localStorage.getItem(_);if(!s)return[{type:"paragraph",data:{text:r("editor.defaultParagraph")}}];try{const t=JSON.parse(s);return Array.isArray(t.blocks)?t.blocks:[]}catch{return[{type:"paragraph",data:{text:r("editor.defaultParagraph")}}]}}const I={"data-testid":"editor-panel",class:"flex min-h-[520px] flex-1 flex-col rounded-xl border border-slate-200 bg-white p-4 shadow-sm dark:border-slate-700 dark:bg-slate-900"},O={"data-testid":"config-dialog",class:"w-full max-w-3xl rounded-xl bg-white p-4 shadow-2xl dark:bg-slate-900"},P={class:"mb-3 flex items-center justify-between"},B={"data-testid":"config-dialog-title",class:"text-base font-semibold text-slate-800 dark:text-slate-100"},A={"data-testid":"config-json",class:"max-h-[60vh] overflow-auto rounded bg-slate-100 p-3 text-xs text-slate-700 dark:bg-slate-950 dark:text-slate-300"},J=m({__name:"EditorPanel",setup(r,{expose:s}){const t=l(null),f=l(""),n=l(!1),{t:i}=C(),o=l(S(i));async function h(){var d;const e=await((d=t.value)==null?void 0:d.saveEditor())??{blocks:o.value};o.value=e.blocks,localStorage.setItem(_,JSON.stringify(e)),f.value=JSON.stringify(e,null,2),n.value=!0}function v(e){o.value=e}function b(){window.location.hash="/preview"}function u(){n.value=!1}return s({save:h,openPreview:b}),(e,d)=>(g(),p("section",I,[k(N,{ref_key:"pageRef",ref:t,edit:!0,value:o.value,onChange:v},null,8,["value"]),n.value?(g(),p("div",{key:0,"data-testid":"config-dialog-overlay",class:"fixed inset-0 z-50 flex items-center justify-center bg-slate-950/50 px-4",onClick:w(u,["self"])},[a("div",O,[a("div",P,[a("h3",B,c(x(i)("editor.configJson")),1),a("button",{"data-testid":"config-dialog-close",class:"rounded bg-slate-200 px-3 py-1 text-sm font-medium text-slate-700 hover:bg-slate-300 dark:bg-slate-700 dark:text-slate-100 dark:hover:bg-slate-600",onClick:u},c(x(i)("editor.close")),1)]),a("pre",A,c(f.value),1)])])):y("",!0)]))}}),R=E(J,[["__scopeId","data-v-4e7b6cf4"]]);export{R as default};
1
+ import{d as m,r as l,o as g,c as p,a as k,w,b as a,t as c,u as x,e as y,f as C,_ as E}from"./index-DP9Xxuqs.js";import{M as _,_ as N}from"./storage-DLZD2nc7.js";import"./editorjs-hCuh8vdW.js";function S(r){const s=localStorage.getItem(_);if(!s)return[{type:"paragraph",data:{text:r("editor.defaultParagraph")}}];try{const t=JSON.parse(s);return Array.isArray(t.blocks)?t.blocks:[]}catch{return[{type:"paragraph",data:{text:r("editor.defaultParagraph")}}]}}const I={"data-testid":"editor-panel",class:"flex min-h-[520px] flex-1 flex-col rounded-xl border border-slate-200 bg-white p-4 shadow-sm dark:border-slate-700 dark:bg-slate-900"},O={"data-testid":"config-dialog",class:"w-full max-w-3xl rounded-xl bg-white p-4 shadow-2xl dark:bg-slate-900"},P={class:"mb-3 flex items-center justify-between"},B={"data-testid":"config-dialog-title",class:"text-base font-semibold text-slate-800 dark:text-slate-100"},A={"data-testid":"config-json",class:"max-h-[60vh] overflow-auto rounded bg-slate-100 p-3 text-xs text-slate-700 dark:bg-slate-950 dark:text-slate-300"},J=m({__name:"EditorPanel",setup(r,{expose:s}){const t=l(null),f=l(""),n=l(!1),{t:i}=C(),o=l(S(i));async function h(){var d;const e=await((d=t.value)==null?void 0:d.saveEditor())??{blocks:o.value};o.value=e.blocks,localStorage.setItem(_,JSON.stringify(e)),f.value=JSON.stringify(e,null,2),n.value=!0}function v(e){o.value=e}function b(){window.location.hash="/preview"}function u(){n.value=!1}return s({save:h,openPreview:b}),(e,d)=>(g(),p("section",I,[k(N,{ref_key:"pageRef",ref:t,edit:!0,value:o.value,onChange:v},null,8,["value"]),n.value?(g(),p("div",{key:0,"data-testid":"config-dialog-overlay",class:"fixed inset-0 z-50 flex items-center justify-center bg-slate-950/50 px-4",onClick:w(u,["self"])},[a("div",O,[a("div",P,[a("h3",B,c(x(i)("editor.configJson")),1),a("button",{"data-testid":"config-dialog-close",class:"rounded bg-slate-200 px-3 py-1 text-sm font-medium text-slate-700 hover:bg-slate-300 dark:bg-slate-700 dark:text-slate-100 dark:hover:bg-slate-600",onClick:u},c(x(i)("editor.close")),1)]),a("pre",A,c(f.value),1)])])):y("",!0)]))}}),R=E(J,[["__scopeId","data-v-4e7b6cf4"]]);export{R as default};
@@ -1,4 +1,4 @@
1
- var me=Object.defineProperty;var ye=(p,u,g)=>u in p?me(p,u,{enumerable:!0,configurable:!0,writable:!0,value:g}):p[u]=g;var h=(p,u,g)=>ye(p,typeof u!="symbol"?u+"":u,g);import{d as he,i as fe,k as D,n as J,j as ge,o as T,c as I,b as ve,F as be,p as ke,g as _e,u as we,x as Te,f as Ee,r as Ce,h as Ie,a7 as Fe,M as Pe,E as S,B as Le,ah as Ae,_ as Me}from"./index-C0VPLP4t.js";import{A as xe}from"./editorjs-hCuh8vdW.js";import{n as B,c as $e,a as Z,b as G,d as De,g as Se,e as V,f as Be,h as N,s as Ve,m as Q}from"./storage-tTDw43ui.js";import{i as Ze}from"./storage-tTDw43ui.js";const Ne={key:0,class:"ce-form-tool__editor-shell","data-testid":"form-editor-shell"},Re={key:1,class:"ce-form-tool__preview","data-testid":"preview-form-items"},Oe=he({__name:"MForm",props:{edit:{type:Boolean,default:!1},items:{default:()=>[]},onChange:{},onToolChange:{}},emits:["change"],setup(p,{expose:u,emit:g}){const W=new Set(["MPage","MForm","MFormItem","MEditorSelector"]),R=new Map,s=p,X=g,{t:Y,localeValue:O}=Ee(),k=Ce(null),E=Ie(()=>B(s.items));let i=null,F=!1,P=!1,v=null,_=null,c=b(E.value);function ee(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID().slice(0,10):Math.random().toString(36).slice(2,12)}function d(t){return t.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function L(){return Object.keys(Se()).filter(t=>!W.has(t)&&!!V(t))}function A(t){return L().includes(t)}function te(){const t="MInput";return A(t)?t:L()[0]}function oe(t){var m;const r=V(t);if(!r)throw new Error(`MForm could not find a registered component for "${t}".`);const o=r.normalizeProps({...((m=r.createInitialProps)==null?void 0:m.call(r))??{},edit:!0});return{id:ee(),type:t,data:r.serialize(o)}}function re(t){const r=R.get(t);if(r)return r;const o=V(t);if(!o)throw new Error(`MForm could not create a form item tool for "${t}".`);class m{constructor({data:e,config:a}){h(this,"state");h(this,"wrapper",null);h(this,"contentRoot",null);h(this,"vueApp",null);h(this,"propertyDialog",null);h(this,"toolbarAlignTimer",null);h(this,"handleToolbarPointer",()=>{this.scheduleToolbarAlignment()});const n=typeof(a==null?void 0:a.edit)=="boolean"?a.edit:!0,l=Be(e==null?void 0:e.editor);this.state=Pe(N({...e??{},edit:n,editor:l??oe(t)}))}static get toolbox(){return o.toolbox}render(){const e=document.createElement("div");e.className="mokelay-form-item-tool",e.dataset.toolName=t,e.dataset.testid=`form-item-tool-${t}`;const a=document.createElement("div");return a.className="mokelay-form-item-tool__content",e.appendChild(a),this.wrapper=e,this.contentRoot=a,e.addEventListener("mouseenter",this.handleToolbarPointer),e.addEventListener("mousemove",this.handleToolbarPointer),this.createPropertyDialog(),this.mountVueApp(),e}destroy(){var e,a,n;this.clearToolbarAlignTimer(),(e=this.wrapper)==null||e.removeEventListener("mouseenter",this.handleToolbarPointer),(a=this.wrapper)==null||a.removeEventListener("mousemove",this.handleToolbarPointer),this.unmountVueApp(),(n=this.propertyDialog)==null||n.remove(),this.propertyDialog=null,this.contentRoot=null,this.wrapper=null}save(){return Ve(this.state)}renderSettings(){return this.getPropertyFields().length?{icon:'<svg width="17" height="17" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M19.14 12.94C19.18 12.63 19.2 12.32 19.2 12C19.2 11.68 19.18 11.36 19.13 11.06L21.11 9.51C21.29 9.37 21.34 9.11 21.23 8.9L19.35 5.64C19.24 5.43 18.99 5.35 18.77 5.42L16.44 6.17C15.96 5.8 15.44 5.48 14.87 5.23L14.51 2.75C14.48 2.52 14.28 2.35 14.04 2.35H10.28C10.04 2.35 9.84 2.52 9.81 2.75L9.45 5.23C8.88 5.48 8.36 5.81 7.88 6.17L5.55 5.42C5.33 5.35 5.08 5.43 4.97 5.64L3.09 8.9C2.98 9.11 3.03 9.37 3.21 9.51L5.19 11.06C5.14 11.36 5.12 11.68 5.12 12C5.12 12.32 5.14 12.64 5.19 12.94L3.21 14.49C3.03 14.63 2.98 14.89 3.09 15.1L4.97 18.36C5.08 18.57 5.33 18.65 5.55 18.58L7.88 17.83C8.36 18.2 8.88 18.52 9.45 18.77L9.81 21.25C9.84 21.48 10.04 21.65 10.28 21.65H14.04C14.28 21.65 14.48 21.48 14.51 21.25L14.87 18.77C15.44 18.52 15.96 18.19 16.44 17.83L18.77 18.58C18.99 18.65 19.24 18.57 19.35 18.36L21.23 15.1C21.34 14.89 21.29 14.63 21.11 14.49L19.14 12.94ZM12.16 15.6C10.17 15.6 8.56 13.99 8.56 12C8.56 10.01 10.17 8.4 12.16 8.4C14.15 8.4 15.76 10.01 15.76 12C15.76 13.99 14.15 15.6 12.16 15.6Z" fill="currentColor"/></svg>',title:S.t("editor.properties"),onActivate:()=>{this.openPropertyDialog()},closeOnActivate:!0}:[]}mountVueApp(){if(!this.contentRoot)return;const e=a=>{Object.assign(this.state,N(a,this.state.variableName))};this.unmountVueApp(),this.vueApp=Le({render:()=>Ae(Z,{...this.state,edit:!0,onToolChange:e,onChange:e})}),this.vueApp.mount(this.contentRoot)}unmountVueApp(){var e;(e=this.vueApp)==null||e.unmount(),this.vueApp=null}clearToolbarAlignTimer(){this.toolbarAlignTimer!==null&&(window.clearTimeout(this.toolbarAlignTimer),this.toolbarAlignTimer=null)}scheduleToolbarAlignment(){this.clearToolbarAlignTimer(),this.toolbarAlignTimer=window.setTimeout(()=>{this.alignToolbarToFormItem()},0)}alignToolbarToFormItem(){this.toolbarAlignTimer=null;const e=this.wrapper;if(!e)return;const a=e.closest(".ce-block"),n=e.closest(".codex-editor"),l=n==null?void 0:n.querySelector(":scope > .ce-toolbar"),y=l==null?void 0:l.querySelector(".ce-toolbar__plus");if(!a||!l||!y)return;const pe=a.getBoundingClientRect(),K=e.getBoundingClientRect(),ue=y.getBoundingClientRect().height||26,de=a.offsetTop+(K.top-pe.top)+(K.height-ue)/2;l.style.top=`${Math.max(0,Math.round(de))}px`}getPropertyFields(){var e;return((e=Q.propertyPanel)==null?void 0:e.fields)??[]}createPropertyDialog(){var l;if(!this.wrapper||!this.getPropertyFields().length)return;const e=document.createElement("dialog");e.className="mokelay-editor-tool__property-dialog",e.dataset.testid="tool-property-dialog",e.dataset.toolName="MFormItem";const a=((l=Q.propertyPanel)==null?void 0:l.title)||S.t("editor.propertyDialogTitle"),n=this.getPropertyFields().map(y=>this.renderPropertyField(y)).join("");e.innerHTML=`
1
+ var me=Object.defineProperty;var ye=(p,u,g)=>u in p?me(p,u,{enumerable:!0,configurable:!0,writable:!0,value:g}):p[u]=g;var h=(p,u,g)=>ye(p,typeof u!="symbol"?u+"":u,g);import{d as he,i as fe,k as D,n as J,j as ge,o as T,c as I,b as ve,F as be,p as ke,g as _e,u as we,x as Te,f as Ee,r as Ce,h as Ie,a7 as Fe,M as Pe,E as S,B as Le,ah as Ae,_ as Me}from"./index-DP9Xxuqs.js";import{A as xe}from"./editorjs-hCuh8vdW.js";import{n as B,c as $e,a as Z,b as G,d as De,g as Se,e as V,f as Be,h as N,s as Ve,m as Q}from"./storage-DLZD2nc7.js";import{i as Ze}from"./storage-DLZD2nc7.js";const Ne={key:0,class:"ce-form-tool__editor-shell","data-testid":"form-editor-shell"},Re={key:1,class:"ce-form-tool__preview","data-testid":"preview-form-items"},Oe=he({__name:"MForm",props:{edit:{type:Boolean,default:!1},items:{default:()=>[]},onChange:{},onToolChange:{}},emits:["change"],setup(p,{expose:u,emit:g}){const W=new Set(["MPage","MForm","MFormItem","MEditorSelector"]),R=new Map,s=p,X=g,{t:Y,localeValue:O}=Ee(),k=Ce(null),E=Ie(()=>B(s.items));let i=null,F=!1,P=!1,v=null,_=null,c=b(E.value);function ee(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID().slice(0,10):Math.random().toString(36).slice(2,12)}function d(t){return t.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function L(){return Object.keys(Se()).filter(t=>!W.has(t)&&!!V(t))}function A(t){return L().includes(t)}function te(){const t="MInput";return A(t)?t:L()[0]}function oe(t){var m;const r=V(t);if(!r)throw new Error(`MForm could not find a registered component for "${t}".`);const o=r.normalizeProps({...((m=r.createInitialProps)==null?void 0:m.call(r))??{},edit:!0});return{id:ee(),type:t,data:r.serialize(o)}}function re(t){const r=R.get(t);if(r)return r;const o=V(t);if(!o)throw new Error(`MForm could not create a form item tool for "${t}".`);class m{constructor({data:e,config:a}){h(this,"state");h(this,"wrapper",null);h(this,"contentRoot",null);h(this,"vueApp",null);h(this,"propertyDialog",null);h(this,"toolbarAlignTimer",null);h(this,"handleToolbarPointer",()=>{this.scheduleToolbarAlignment()});const n=typeof(a==null?void 0:a.edit)=="boolean"?a.edit:!0,l=Be(e==null?void 0:e.editor);this.state=Pe(N({...e??{},edit:n,editor:l??oe(t)}))}static get toolbox(){return o.toolbox}render(){const e=document.createElement("div");e.className="mokelay-form-item-tool",e.dataset.toolName=t,e.dataset.testid=`form-item-tool-${t}`;const a=document.createElement("div");return a.className="mokelay-form-item-tool__content",e.appendChild(a),this.wrapper=e,this.contentRoot=a,e.addEventListener("mouseenter",this.handleToolbarPointer),e.addEventListener("mousemove",this.handleToolbarPointer),this.createPropertyDialog(),this.mountVueApp(),e}destroy(){var e,a,n;this.clearToolbarAlignTimer(),(e=this.wrapper)==null||e.removeEventListener("mouseenter",this.handleToolbarPointer),(a=this.wrapper)==null||a.removeEventListener("mousemove",this.handleToolbarPointer),this.unmountVueApp(),(n=this.propertyDialog)==null||n.remove(),this.propertyDialog=null,this.contentRoot=null,this.wrapper=null}save(){return Ve(this.state)}renderSettings(){return this.getPropertyFields().length?{icon:'<svg width="17" height="17" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M19.14 12.94C19.18 12.63 19.2 12.32 19.2 12C19.2 11.68 19.18 11.36 19.13 11.06L21.11 9.51C21.29 9.37 21.34 9.11 21.23 8.9L19.35 5.64C19.24 5.43 18.99 5.35 18.77 5.42L16.44 6.17C15.96 5.8 15.44 5.48 14.87 5.23L14.51 2.75C14.48 2.52 14.28 2.35 14.04 2.35H10.28C10.04 2.35 9.84 2.52 9.81 2.75L9.45 5.23C8.88 5.48 8.36 5.81 7.88 6.17L5.55 5.42C5.33 5.35 5.08 5.43 4.97 5.64L3.09 8.9C2.98 9.11 3.03 9.37 3.21 9.51L5.19 11.06C5.14 11.36 5.12 11.68 5.12 12C5.12 12.32 5.14 12.64 5.19 12.94L3.21 14.49C3.03 14.63 2.98 14.89 3.09 15.1L4.97 18.36C5.08 18.57 5.33 18.65 5.55 18.58L7.88 17.83C8.36 18.2 8.88 18.52 9.45 18.77L9.81 21.25C9.84 21.48 10.04 21.65 10.28 21.65H14.04C14.28 21.65 14.48 21.48 14.51 21.25L14.87 18.77C15.44 18.52 15.96 18.19 16.44 17.83L18.77 18.58C18.99 18.65 19.24 18.57 19.35 18.36L21.23 15.1C21.34 14.89 21.29 14.63 21.11 14.49L19.14 12.94ZM12.16 15.6C10.17 15.6 8.56 13.99 8.56 12C8.56 10.01 10.17 8.4 12.16 8.4C14.15 8.4 15.76 10.01 15.76 12C15.76 13.99 14.15 15.6 12.16 15.6Z" fill="currentColor"/></svg>',title:S.t("editor.properties"),onActivate:()=>{this.openPropertyDialog()},closeOnActivate:!0}:[]}mountVueApp(){if(!this.contentRoot)return;const e=a=>{Object.assign(this.state,N(a,this.state.variableName))};this.unmountVueApp(),this.vueApp=Le({render:()=>Ae(Z,{...this.state,edit:!0,onToolChange:e,onChange:e})}),this.vueApp.mount(this.contentRoot)}unmountVueApp(){var e;(e=this.vueApp)==null||e.unmount(),this.vueApp=null}clearToolbarAlignTimer(){this.toolbarAlignTimer!==null&&(window.clearTimeout(this.toolbarAlignTimer),this.toolbarAlignTimer=null)}scheduleToolbarAlignment(){this.clearToolbarAlignTimer(),this.toolbarAlignTimer=window.setTimeout(()=>{this.alignToolbarToFormItem()},0)}alignToolbarToFormItem(){this.toolbarAlignTimer=null;const e=this.wrapper;if(!e)return;const a=e.closest(".ce-block"),n=e.closest(".codex-editor"),l=n==null?void 0:n.querySelector(":scope > .ce-toolbar"),y=l==null?void 0:l.querySelector(".ce-toolbar__plus");if(!a||!l||!y)return;const pe=a.getBoundingClientRect(),K=e.getBoundingClientRect(),ue=y.getBoundingClientRect().height||26,de=a.offsetTop+(K.top-pe.top)+(K.height-ue)/2;l.style.top=`${Math.max(0,Math.round(de))}px`}getPropertyFields(){var e;return((e=Q.propertyPanel)==null?void 0:e.fields)??[]}createPropertyDialog(){var l;if(!this.wrapper||!this.getPropertyFields().length)return;const e=document.createElement("dialog");e.className="mokelay-editor-tool__property-dialog",e.dataset.testid="tool-property-dialog",e.dataset.toolName="MFormItem";const a=((l=Q.propertyPanel)==null?void 0:l.title)||S.t("editor.propertyDialogTitle"),n=this.getPropertyFields().map(y=>this.renderPropertyField(y)).join("");e.innerHTML=`
2
2
  <form method="dialog" class="mokelay-editor-tool__property-panel" data-testid="tool-property-panel">
3
3
  <div class="mokelay-editor-tool__property-header">
4
4
  <h3 class="mokelay-editor-tool__property-title" data-testid="tool-property-title">${d(a)}</h3>
@@ -0,0 +1 @@
1
+ import{_ as o}from"./storage-DLZD2nc7.js";import"./editorjs-hCuh8vdW.js";import"./index-DP9Xxuqs.js";export{o as default};
@@ -1 +1 @@
1
- import{d as n,o as a,c as r,b as c,t as d,u as i,g as m,f as p,h as s}from"./index-C0VPLP4t.js";import{_ as u,M as _}from"./storage-tTDw43ui.js";import"./editorjs-hCuh8vdW.js";const b={"data-testid":"preview-panel",class:"flex min-h-[520px] flex-1 flex-col rounded-xl border border-slate-200 bg-white p-4 shadow-sm dark:border-slate-700 dark:bg-slate-900"},f={class:"flex-1 overflow-auto"},k={key:0,"data-testid":"preview-empty-state",class:"rounded border border-amber-300 bg-amber-50 p-3 text-amber-800 dark:border-amber-500/60 dark:bg-amber-900/30 dark:text-amber-100"},y=n({__name:"PreviewPanel",setup(v){const{t:o}=p(),t=s(()=>{const e=localStorage.getItem(_);if(!e)return null;try{return JSON.parse(e)}catch{return null}}),l=s(()=>{var e;return((e=t.value)==null?void 0:e.blocks)??[]});return(e,x)=>(a(),r("section",b,[c("div",f,[t.value?(a(),m(u,{key:1,edit:!1,value:l.value},null,8,["value"])):(a(),r("p",k,d(i(o)("preview.emptyState")),1))])]))}});export{y as default};
1
+ import{d as n,o as a,c as r,b as c,t as d,u as i,g as m,f as p,h as s}from"./index-DP9Xxuqs.js";import{_ as u,M as _}from"./storage-DLZD2nc7.js";import"./editorjs-hCuh8vdW.js";const b={"data-testid":"preview-panel",class:"flex min-h-[520px] flex-1 flex-col rounded-xl border border-slate-200 bg-white p-4 shadow-sm dark:border-slate-700 dark:bg-slate-900"},f={class:"flex-1 overflow-auto"},k={key:0,"data-testid":"preview-empty-state",class:"rounded border border-amber-300 bg-amber-50 p-3 text-amber-800 dark:border-amber-500/60 dark:bg-amber-900/30 dark:text-amber-100"},y=n({__name:"PreviewPanel",setup(v){const{t:o}=p(),t=s(()=>{const e=localStorage.getItem(_);if(!e)return null;try{return JSON.parse(e)}catch{return null}}),l=s(()=>{var e;return((e=t.value)==null?void 0:e.blocks)??[]});return(e,x)=>(a(),r("section",b,[c("div",f,[t.value?(a(),m(u,{key:1,edit:!1,value:l.value},null,8,["value"])):(a(),r("p",k,d(i(o)("preview.emptyState")),1))])]))}});export{y as default};
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/EditorPanel-B97wXLqG.js","assets/storage-tTDw43ui.js","assets/editorjs-hCuh8vdW.js","assets/storage-DdQoXp86.css","assets/EditorPanel-bZ_ztq4l.css","assets/PreviewPanel-65RZ8CEI.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/EditorPanel-s8UfMl2a.js","assets/storage-DLZD2nc7.js","assets/editorjs-hCuh8vdW.js","assets/storage-DdQoXp86.css","assets/EditorPanel-bZ_ztq4l.css","assets/PreviewPanel-Bs7PtelH.js"])))=>i.map(i=>d[i]);
2
2
  var cc=Object.defineProperty;var Di=e=>{throw TypeError(e)};var uc=(e,t,n)=>t in e?cc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Tr=(e,t,n)=>uc(e,typeof t!="symbol"?t+"":t,n),ps=(e,t,n)=>t.has(e)||Di("Cannot "+n);var _=(e,t,n)=>(ps(e,t,"read from private field"),n?n.call(e):t.get(e)),re=(e,t,n)=>t.has(e)?Di("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),G=(e,t,n,r)=>(ps(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),$e=(e,t,n)=>(ps(e,t,"access private method"),n);var Pr=(e,t,n,r)=>({set _(s){G(e,t,s,n)},get _(){return _(e,t,r)}});import{g as Pg}from"./editorjs-hCuh8vdW.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();/**
3
3
  * @vue/shared v3.5.33
4
4
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
@@ -15,4 +15,4 @@ var cc=Object.defineProperty;var Di=e=>{throw TypeError(e)};var uc=(e,t,n)=>t in
15
15
  * @vue/runtime-dom v3.5.33
16
16
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
17
17
  * @license MIT
18
- **/let js;const Xi=typeof window<"u"&&window.trustedTypes;if(Xi)try{js=Xi.createPolicy("vue",{createHTML:e=>e})}catch{}const _l=js?e=>js.createHTML(e):e=>e,pf="http://www.w3.org/2000/svg",gf="http://www.w3.org/1998/Math/MathML",At=typeof document<"u"?document:null,eo=At&&At.createElement("template"),mf={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const s=t==="svg"?At.createElementNS(pf,e):t==="mathml"?At.createElementNS(gf,e):n?At.createElement(e,{is:n}):At.createElement(e);return e==="select"&&r&&r.multiple!=null&&s.setAttribute("multiple",r.multiple),s},createText:e=>At.createTextNode(e),createComment:e=>At.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>At.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,s,i){const o=n?n.previousSibling:t.lastChild;if(s&&(s===i||s.nextSibling))for(;t.insertBefore(s.cloneNode(!0),n),!(s===i||!(s=s.nextSibling)););else{eo.innerHTML=_l(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const a=eo.content;if(r==="svg"||r==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}t.insertBefore(a,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Nt="transition",qn="animation",lr=Symbol("_vtc"),vl={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},yf=Oe({},ja,vl),_f=e=>(e.displayName="Transition",e.props=yf,e),vf=_f((e,{slots:t})=>ff(hu,bf(e),t)),Yt=(e,t=[])=>{q(e)?e.forEach(n=>n(...t)):e&&e(...t)},to=e=>e?q(e)?e.some(t=>t.length>1):e.length>1:!1;function bf(e){const t={};for(const R in e)R in vl||(t[R]=e[R]);if(e.css===!1)return t;const{name:n="v",type:r,duration:s,enterFromClass:i=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=i,appearActiveClass:u=o,appearToClass:c=a,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:m=`${n}-leave-active`,leaveToClass:v=`${n}-leave-to`}=e,x=wf(s),p=x&&x[0],b=x&&x[1],{onBeforeEnter:T,onEnter:L,onEnterCancelled:D,onLeave:g,onLeaveCancelled:M,onBeforeAppear:j=T,onAppear:ee=L,onAppearCancelled:ne=D}=t,B=(R,de,H,k)=>{R._enterCancelled=k,Zt(R,de?c:a),Zt(R,de?u:o),H&&H()},U=(R,de)=>{R._isLeaving=!1,Zt(R,d),Zt(R,v),Zt(R,m),de&&de()},z=R=>(de,H)=>{const k=R?ee:L,E=()=>B(de,R,H);Yt(k,[de,E]),no(()=>{Zt(de,R?l:i),Ot(de,R?c:a),to(k)||ro(de,r,p,E)})};return Oe(t,{onBeforeEnter(R){Yt(T,[R]),Ot(R,i),Ot(R,o)},onBeforeAppear(R){Yt(j,[R]),Ot(R,l),Ot(R,u)},onEnter:z(!1),onAppear:z(!0),onLeave(R,de){R._isLeaving=!0;const H=()=>U(R,de);Ot(R,d),R._enterCancelled?(Ot(R,m),oo(R)):(oo(R),Ot(R,m)),no(()=>{R._isLeaving&&(Zt(R,d),Ot(R,v),to(g)||ro(R,r,b,H))}),Yt(g,[R,H])},onEnterCancelled(R){B(R,!1,void 0,!0),Yt(D,[R])},onAppearCancelled(R){B(R,!0,void 0,!0),Yt(ne,[R])},onLeaveCancelled(R){U(R),Yt(M,[R])}})}function wf(e){if(e==null)return null;if(ce(e))return[Ts(e.enter),Ts(e.leave)];{const t=Ts(e);return[t,t]}}function Ts(e){return mc(e)}function Ot(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[lr]||(e[lr]=new Set)).add(t)}function Zt(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[lr];n&&(n.delete(t),n.size||(e[lr]=void 0))}function no(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let xf=0;function ro(e,t,n,r){const s=e._endId=++xf,i=()=>{s===e._endId&&r()};if(n!=null)return setTimeout(i,n);const{type:o,timeout:a,propCount:l}=Sf(e,t);if(!o)return r();const u=o+"end";let c=0;const d=()=>{e.removeEventListener(u,m),i()},m=v=>{v.target===e&&++c>=l&&d()};setTimeout(()=>{c<l&&d()},a+1),e.addEventListener(u,m)}function Sf(e,t){const n=window.getComputedStyle(e),r=x=>(n[x]||"").split(", "),s=r(`${Nt}Delay`),i=r(`${Nt}Duration`),o=so(s,i),a=r(`${qn}Delay`),l=r(`${qn}Duration`),u=so(a,l);let c=null,d=0,m=0;t===Nt?o>0&&(c=Nt,d=o,m=i.length):t===qn?u>0&&(c=qn,d=u,m=l.length):(d=Math.max(o,u),c=d>0?o>u?Nt:qn:null,m=c?c===Nt?i.length:l.length:0);const v=c===Nt&&/\b(?:transform|all)(?:,|$)/.test(r(`${Nt}Property`).toString());return{type:c,timeout:d,propCount:m,hasTransform:v}}function so(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>io(n)+io(e[r])))}function io(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function oo(e){return(e?e.ownerDocument:document).body.offsetHeight}function Cf(e,t,n){const r=e[lr];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const ao=Symbol("_vod"),Tf=Symbol("_vsh");const Pf=Symbol(""),Of=/(?:^|;)\s*display\s*:/;function Ef(e,t,n){const r=e.style,s=fe(n);let i=!1;if(n&&!s){if(t)if(fe(t))for(const o of t.split(";")){const a=o.slice(0,o.indexOf(":")).trim();n[a]==null&&Qn(r,a,"")}else for(const o in t)n[o]==null&&Qn(r,o,"");for(const o in n){o==="display"&&(i=!0);const a=n[o];a!=null?Mf(e,o,!fe(t)&&t?t[o]:void 0,a)||Qn(r,o,a):Qn(r,o,"")}}else if(s){if(t!==n){const o=r[Pf];o&&(n+=";"+o),r.cssText=n,i=Of.test(n)}}else t&&e.removeAttribute("style");ao in e&&(e[ao]=i?r.display:"",e[Tf]&&(r.display="none"))}const lo=/\s*!important$/;function Qn(e,t,n){if(q(n))n.forEach(r=>Qn(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=Af(e,t);lo.test(n)?e.setProperty(hn(r),n.replace(lo,""),"important"):e[r]=n}}const co=["Webkit","Moz","ms"],Ps={};function Af(e,t){const n=Ps[t];if(n)return n;let r=Ve(t);if(r!=="filter"&&r in e)return Ps[t]=r;r=ts(r);for(let s=0;s<co.length;s++){const i=co[s]+r;if(i in e)return Ps[t]=i}return t}function Mf(e,t,n,r){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&fe(r)&&n===r}const uo="http://www.w3.org/1999/xlink";function fo(e,t,n,r,s,i=xc(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(uo,t.slice(6,t.length)):e.setAttributeNS(uo,t,n):n==null||i&&!aa(n)?e.removeAttribute(t):e.setAttribute(t,i?"":Ge(n)?String(n):n)}function ho(e,t,n,r,s){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?_l(n):n);return}const i=e.tagName;if(t==="value"&&i!=="PROGRESS"&&!i.includes("-")){const a=i==="OPTION"?e.getAttribute("value")||"":e.value,l=n==null?e.type==="checkbox"?"on":"":String(n);(a!==l||!("_value"in e))&&(e.value=l),n==null&&e.removeAttribute(t),e._value=n;return}let o=!1;if(n===""||n==null){const a=typeof e[t];a==="boolean"?n=aa(n):n==null&&a==="string"?(n="",o=!0):a==="number"&&(n=0,o=!0)}try{e[t]=n}catch{}o&&e.removeAttribute(s||t)}function Df(e,t,n,r){e.addEventListener(t,n,r)}function $f(e,t,n,r){e.removeEventListener(t,n,r)}const po=Symbol("_vei");function Ff(e,t,n,r,s=null){const i=e[po]||(e[po]={}),o=i[t];if(r&&o)o.value=r;else{const[a,l]=kf(t);if(r){const u=i[t]=Nf(r,s);Df(e,a,u,l)}else o&&($f(e,a,o,l),i[t]=void 0)}}const go=/(?:Once|Passive|Capture)$/;function kf(e){let t;if(go.test(e)){t={};let r;for(;r=e.match(go);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):hn(e.slice(2)),t]}let Os=0;const Lf=Promise.resolve(),If=()=>Os||(Lf.then(()=>Os=0),Os=Date.now());function Nf(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;lt(Rf(r,n.value),t,5,[r])};return n.value=e,n.attached=If(),n}function Rf(e,t){if(q(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(r=>s=>!s._stopped&&r&&r(s))}else return t}const mo=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,jf=(e,t,n,r,s,i)=>{const o=s==="svg";t==="class"?Cf(e,r,o):t==="style"?Ef(e,n,r):Yr(t)?Zr(t)||Ff(e,t,n,r,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Hf(e,t,r,o))?(ho(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&fo(e,t,r,o,i,t!=="value")):e._isVueCE&&(Bf(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!fe(r)))?ho(e,Ve(t),r,i,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),fo(e,t,r,o))};function Hf(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&mo(t)&&Y(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const s=e.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return mo(t)&&fe(n)?!1:t in e}function Bf(e,t){const n=e._def.props;if(!n)return!1;const r=Ve(t);return Array.isArray(n)?n.some(s=>Ve(s)===r):Object.keys(n).some(s=>Ve(s)===r)}const zf=["ctrl","shift","alt","meta"],Vf={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>zf.some(n=>e[`${n}Key`]&&!t.includes(n))},yo=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=((s,...i)=>{for(let o=0;o<t.length;o++){const a=Vf[t[o]];if(a&&a(s,t))return}return e(s,...i)}))};const qf=Oe({patchProp:jf},mf);let _o;function Uf(){return _o||(_o=Ju(qf))}const bl=((...e)=>{const t=Uf().createApp(...e),{mount:n}=t;return t.mount=r=>{const s=Jf(r);if(!s)return;const i=t._component;!Y(i)&&!i.render&&!i.template&&(i.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const o=n(s,!1,Kf(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),o},t});function Kf(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Jf(e){return fe(e)?document.querySelector(e):e}var us=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},rn,Bt,Tn,Ko,Qf=(Ko=class extends us{constructor(){super();re(this,rn);re(this,Bt);re(this,Tn);G(this,Tn,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){_(this,Bt)||this.setEventListener(_(this,Tn))}onUnsubscribe(){var t;this.hasListeners()||((t=_(this,Bt))==null||t.call(this),G(this,Bt,void 0))}setEventListener(t){var n;G(this,Tn,t),(n=_(this,Bt))==null||n.call(this),G(this,Bt,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){_(this,rn)!==t&&(G(this,rn,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof _(this,rn)=="boolean"?_(this,rn):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},rn=new WeakMap,Bt=new WeakMap,Tn=new WeakMap,Ko),wl=new Qf,Wf={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},zt,Gs,Jo,Gf=(Jo=class{constructor(){re(this,zt,Wf);re(this,Gs,!1)}setTimeoutProvider(e){G(this,zt,e)}setTimeout(e,t){return _(this,zt).setTimeout(e,t)}clearTimeout(e){_(this,zt).clearTimeout(e)}setInterval(e,t){return _(this,zt).setInterval(e,t)}clearInterval(e){_(this,zt).clearInterval(e)}},zt=new WeakMap,Gs=new WeakMap,Jo),Hs=new Gf;function Yf(e){setTimeout(e,0)}var xl=typeof window>"u"||"Deno"in globalThis;function tt(){}function Zf(e,t){return typeof e=="function"?e(t):e}function Xf(e){return typeof e=="number"&&e>=0&&e!==1/0}function ed(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Bs(e,t){return typeof e=="function"?e(t):e}function td(e,t){return typeof e=="function"?e(t):e}function vo(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:o,stale:a}=e;if(o){if(r){if(t.queryHash!==hi(o,t.options))return!1}else if(!ur(t.queryKey,o))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||s&&s!==t.state.fetchStatus||i&&!i(t))}function bo(e,t){const{exact:n,status:r,predicate:s,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(cr(t.options.mutationKey)!==cr(i))return!1}else if(!ur(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function hi(e,t){return((t==null?void 0:t.queryKeyHashFn)||cr)(e)}function cr(e){return JSON.stringify(e,(t,n)=>zs(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function ur(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>ur(e[n],t[n])):!1}var nd=Object.prototype.hasOwnProperty;function Sl(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=wo(e)&&wo(t);if(!r&&!(zs(e)&&zs(t)))return t;const i=(r?e:Object.keys(e)).length,o=r?t:Object.keys(t),a=o.length,l=r?new Array(a):{};let u=0;for(let c=0;c<a;c++){const d=r?c:o[c],m=e[d],v=t[d];if(m===v){l[d]=m,(r?c<i:nd.call(e,d))&&u++;continue}if(m===null||v===null||typeof m!="object"||typeof v!="object"){l[d]=v;continue}const x=Sl(m,v,n+1);l[d]=x,x===m&&u++}return i===a&&u===i?e:l}function wo(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function zs(e){if(!xo(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!xo(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function xo(e){return Object.prototype.toString.call(e)==="[object Object]"}function rd(e){return new Promise(t=>{Hs.setTimeout(t,e)})}function sd(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Sl(e,t):t}function id(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function od(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var pi=Symbol();function Cl(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===pi?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ad(e,t,n){let r=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=t()),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),e}var Tl=(()=>{let e=()=>xl;return{isServer(){return e()},setIsServer(t){e=t}}})();function ld(){let e,t;const n=new Promise((s,i)=>{e=s,t=i});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}var cd=Yf;function ud(){let e=[],t=0,n=a=>{a()},r=a=>{a()},s=cd;const i=a=>{t?e.push(a):s(()=>{n(a)})},o=()=>{const a=e;e=[],a.length&&s(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||o()}return l},batchCalls:a=>(...l)=>{i(()=>{a(...l)})},schedule:i,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{s=a}}}var Be=ud(),Pn,Vt,On,Qo,fd=(Qo=class extends us{constructor(){super();re(this,Pn,!0);re(this,Vt);re(this,On);G(this,On,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){_(this,Vt)||this.setEventListener(_(this,On))}onUnsubscribe(){var t;this.hasListeners()||((t=_(this,Vt))==null||t.call(this),G(this,Vt,void 0))}setEventListener(t){var n;G(this,On,t),(n=_(this,Vt))==null||n.call(this),G(this,Vt,t(this.setOnline.bind(this)))}setOnline(t){_(this,Pn)!==t&&(G(this,Pn,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return _(this,Pn)}},Pn=new WeakMap,Vt=new WeakMap,On=new WeakMap,Qo),Qr=new fd;function dd(e){return Math.min(1e3*2**e,3e4)}function Pl(e){return(e??"online")==="online"?Qr.isOnline():!0}var Vs=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Ol(e){let t=!1,n=0,r;const s=ld(),i=()=>s.status!=="pending",o=p=>{var b;if(!i()){const T=new Vs(p);m(T),(b=e.onCancel)==null||b.call(e,T)}},a=()=>{t=!0},l=()=>{t=!1},u=()=>wl.isFocused()&&(e.networkMode==="always"||Qr.isOnline())&&e.canRun(),c=()=>Pl(e.networkMode)&&e.canRun(),d=p=>{i()||(r==null||r(),s.resolve(p))},m=p=>{i()||(r==null||r(),s.reject(p))},v=()=>new Promise(p=>{var b;r=T=>{(i()||u())&&p(T)},(b=e.onPause)==null||b.call(e)}).then(()=>{var p;r=void 0,i()||(p=e.onContinue)==null||p.call(e)}),x=()=>{if(i())return;let p;const b=n===0?e.initialPromise:void 0;try{p=b??e.fn()}catch(T){p=Promise.reject(T)}Promise.resolve(p).then(d).catch(T=>{var j;if(i())return;const L=e.retry??(Tl.isServer()?0:3),D=e.retryDelay??dd,g=typeof D=="function"?D(n,T):D,M=L===!0||typeof L=="number"&&n<L||typeof L=="function"&&L(n,T);if(t||!M){m(T);return}n++,(j=e.onFail)==null||j.call(e,n,T),rd(g).then(()=>u()?void 0:v()).then(()=>{t?m(T):x()})})};return{promise:s,status:()=>s.status,cancel:o,continue:()=>(r==null||r(),s),cancelRetry:a,continueRetry:l,canStart:c,start:()=>(c()?x():v().then(x),s)}}var sn,Wo,El=(Wo=class{constructor(){re(this,sn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Xf(this.gcTime)&&G(this,sn,Hs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Tl.isServer()?1/0:300*1e3))}clearGcTimeout(){_(this,sn)!==void 0&&(Hs.clearTimeout(_(this,sn)),G(this,sn,void 0))}},sn=new WeakMap,Wo),on,En,et,an,Ae,hr,ln,Je,Al,Et,Go,hd=(Go=class extends El{constructor(t){super();re(this,Je);re(this,on);re(this,En);re(this,et);re(this,an);re(this,Ae);re(this,hr);re(this,ln);G(this,ln,!1),G(this,hr,t.defaultOptions),this.setOptions(t.options),this.observers=[],G(this,an,t.client),G(this,et,_(this,an).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,G(this,on,Co(this.options)),this.state=t.state??_(this,on),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=_(this,Ae))==null?void 0:t.promise}setOptions(t){if(this.options={..._(this,hr),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=Co(this.options);n.data!==void 0&&(this.setState(So(n.data,n.dataUpdatedAt)),G(this,on,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&_(this,et).remove(this)}setData(t,n){const r=sd(this.state.data,t,this.options);return $e(this,Je,Et).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){$e(this,Je,Et).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,s;const n=(r=_(this,Ae))==null?void 0:r.promise;return(s=_(this,Ae))==null||s.cancel(t),n?n.then(tt).catch(tt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return _(this,on)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>td(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===pi||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Bs(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!ed(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=_(this,Ae))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=_(this,Ae))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),_(this,et).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(_(this,Ae)&&(_(this,ln)||$e(this,Je,Al).call(this)?_(this,Ae).cancel({revert:!0}):_(this,Ae).cancelRetry()),this.scheduleGc()),_(this,et).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||$e(this,Je,Et).call(this,{type:"invalidate"})}async fetch(t,n){var l,u,c,d,m,v,x,p,b,T,L,D;if(this.state.fetchStatus!=="idle"&&((l=_(this,Ae))==null?void 0:l.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(_(this,Ae))return _(this,Ae).continueRetry(),_(this,Ae).promise}if(t&&this.setOptions(t),!this.options.queryFn){const g=this.observers.find(M=>M.options.queryFn);g&&this.setOptions(g.options)}const r=new AbortController,s=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>(G(this,ln,!0),r.signal)})},i=()=>{const g=Cl(this.options,n),j=(()=>{const ee={client:_(this,an),queryKey:this.queryKey,meta:this.meta};return s(ee),ee})();return G(this,ln,!1),this.options.persister?this.options.persister(g,j,this):g(j)},a=(()=>{const g={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:_(this,an),state:this.state,fetchFn:i};return s(g),g})();(u=this.options.behavior)==null||u.onFetch(a,this),G(this,En,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=a.fetchOptions)==null?void 0:c.meta))&&$e(this,Je,Et).call(this,{type:"fetch",meta:(d=a.fetchOptions)==null?void 0:d.meta}),G(this,Ae,Ol({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,onCancel:g=>{g instanceof Vs&&g.revert&&this.setState({..._(this,En),fetchStatus:"idle"}),r.abort()},onFail:(g,M)=>{$e(this,Je,Et).call(this,{type:"failed",failureCount:g,error:M})},onPause:()=>{$e(this,Je,Et).call(this,{type:"pause"})},onContinue:()=>{$e(this,Je,Et).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const g=await _(this,Ae).start();if(g===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(g),(v=(m=_(this,et).config).onSuccess)==null||v.call(m,g,this),(p=(x=_(this,et).config).onSettled)==null||p.call(x,g,this.state.error,this),g}catch(g){if(g instanceof Vs){if(g.silent)return _(this,Ae).promise;if(g.revert){if(this.state.data===void 0)throw g;return this.state.data}}throw $e(this,Je,Et).call(this,{type:"error",error:g}),(T=(b=_(this,et).config).onError)==null||T.call(b,g,this),(D=(L=_(this,et).config).onSettled)==null||D.call(L,this.state.data,g,this),g}finally{this.scheduleGc()}}},on=new WeakMap,En=new WeakMap,et=new WeakMap,an=new WeakMap,Ae=new WeakMap,hr=new WeakMap,ln=new WeakMap,Je=new WeakSet,Al=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Et=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...pd(r.data,this.options),fetchMeta:t.meta??null};case"success":const s={...r,...So(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return G(this,En,t.manual?s:void 0),s;case"error":const i=t.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Be.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),_(this,et).notify({query:this,type:"updated",action:t})})},Go);function pd(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Pl(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function So(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Co(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}function To(e){return{onFetch:(t,n)=>{var c,d,m,v,x;const r=t.options,s=(m=(d=(c=t.fetchOptions)==null?void 0:c.meta)==null?void 0:d.fetchMore)==null?void 0:m.direction,i=((v=t.state.data)==null?void 0:v.pages)||[],o=((x=t.state.data)==null?void 0:x.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let p=!1;const b=D=>{ad(D,()=>t.signal,()=>p=!0)},T=Cl(t.options,t.fetchOptions),L=async(D,g,M)=>{if(p)return Promise.reject();if(g==null&&D.pages.length)return Promise.resolve(D);const ee=(()=>{const z={client:t.client,queryKey:t.queryKey,pageParam:g,direction:M?"backward":"forward",meta:t.options.meta};return b(z),z})(),ne=await T(ee),{maxPages:B}=t.options,U=M?od:id;return{pages:U(D.pages,ne,B),pageParams:U(D.pageParams,g,B)}};if(s&&i.length){const D=s==="backward",g=D?gd:Po,M={pages:i,pageParams:o},j=g(r,M);a=await L(M,j,D)}else{const D=e??i.length;do{const g=l===0?o[0]??r.initialPageParam:Po(r,a);if(l>0&&g==null)break;a=await L(a,g),l++}while(l<D)}return a};t.options.persister?t.fetchFn=()=>{var p,b;return(b=(p=t.options).persister)==null?void 0:b.call(p,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function Po(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function gd(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var pr,yt,Ie,cn,_t,Rt,Yo,md=(Yo=class extends El{constructor(t){super();re(this,_t);re(this,pr);re(this,yt);re(this,Ie);re(this,cn);G(this,pr,t.client),this.mutationId=t.mutationId,G(this,Ie,t.mutationCache),G(this,yt,[]),this.state=t.state||yd(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){_(this,yt).includes(t)||(_(this,yt).push(t),this.clearGcTimeout(),_(this,Ie).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){G(this,yt,_(this,yt).filter(n=>n!==t)),this.scheduleGc(),_(this,Ie).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){_(this,yt).length||(this.state.status==="pending"?this.scheduleGc():_(this,Ie).remove(this))}continue(){var t;return((t=_(this,cn))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,a,l,u,c,d,m,v,x,p,b,T,L,D,g,M,j,ee;const n=()=>{$e(this,_t,Rt).call(this,{type:"continue"})},r={client:_(this,pr),meta:this.options.meta,mutationKey:this.options.mutationKey};G(this,cn,Ol({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(ne,B)=>{$e(this,_t,Rt).call(this,{type:"failed",failureCount:ne,error:B})},onPause:()=>{$e(this,_t,Rt).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>_(this,Ie).canRun(this)}));const s=this.state.status==="pending",i=!_(this,cn).canStart();try{if(s)n();else{$e(this,_t,Rt).call(this,{type:"pending",variables:t,isPaused:i}),_(this,Ie).config.onMutate&&await _(this,Ie).config.onMutate(t,this,r);const B=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,t,r));B!==this.state.context&&$e(this,_t,Rt).call(this,{type:"pending",context:B,variables:t,isPaused:i})}const ne=await _(this,cn).start();return await((u=(l=_(this,Ie).config).onSuccess)==null?void 0:u.call(l,ne,t,this.state.context,this,r)),await((d=(c=this.options).onSuccess)==null?void 0:d.call(c,ne,t,this.state.context,r)),await((v=(m=_(this,Ie).config).onSettled)==null?void 0:v.call(m,ne,null,this.state.variables,this.state.context,this,r)),await((p=(x=this.options).onSettled)==null?void 0:p.call(x,ne,null,t,this.state.context,r)),$e(this,_t,Rt).call(this,{type:"success",data:ne}),ne}catch(ne){try{await((T=(b=_(this,Ie).config).onError)==null?void 0:T.call(b,ne,t,this.state.context,this,r))}catch(B){Promise.reject(B)}try{await((D=(L=this.options).onError)==null?void 0:D.call(L,ne,t,this.state.context,r))}catch(B){Promise.reject(B)}try{await((M=(g=_(this,Ie).config).onSettled)==null?void 0:M.call(g,void 0,ne,this.state.variables,this.state.context,this,r))}catch(B){Promise.reject(B)}try{await((ee=(j=this.options).onSettled)==null?void 0:ee.call(j,void 0,ne,t,this.state.context,r))}catch(B){Promise.reject(B)}throw $e(this,_t,Rt).call(this,{type:"error",error:ne}),ne}finally{_(this,Ie).runNext(this)}}},pr=new WeakMap,yt=new WeakMap,Ie=new WeakMap,cn=new WeakMap,_t=new WeakSet,Rt=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Be.batch(()=>{_(this,yt).forEach(r=>{r.onMutationUpdate(t)}),_(this,Ie).notify({mutation:this,type:"updated",action:t})})},Yo);function yd(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Dt,nt,gr,Zo,Ml=(Zo=class extends us{constructor(n={}){super();re(this,Dt);re(this,nt);re(this,gr);this.config=n,G(this,Dt,new Set),G(this,nt,new Map),G(this,gr,0)}build(n,r,s){const i=new md({client:n,mutationCache:this,mutationId:++Pr(this,gr)._,options:n.defaultMutationOptions(r),state:s});return this.add(i),i}add(n){_(this,Dt).add(n);const r=Dr(n);if(typeof r=="string"){const s=_(this,nt).get(r);s?s.push(n):_(this,nt).set(r,[n])}this.notify({type:"added",mutation:n})}remove(n){if(_(this,Dt).delete(n)){const r=Dr(n);if(typeof r=="string"){const s=_(this,nt).get(r);if(s)if(s.length>1){const i=s.indexOf(n);i!==-1&&s.splice(i,1)}else s[0]===n&&_(this,nt).delete(r)}}this.notify({type:"removed",mutation:n})}canRun(n){const r=Dr(n);if(typeof r=="string"){const s=_(this,nt).get(r),i=s==null?void 0:s.find(o=>o.state.status==="pending");return!i||i===n}else return!0}runNext(n){var s;const r=Dr(n);if(typeof r=="string"){const i=(s=_(this,nt).get(r))==null?void 0:s.find(o=>o!==n&&o.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Be.batch(()=>{_(this,Dt).forEach(n=>{this.notify({type:"removed",mutation:n})}),_(this,Dt).clear(),_(this,nt).clear()})}getAll(){return Array.from(_(this,Dt))}find(n){const r={exact:!0,...n};return this.getAll().find(s=>bo(r,s))}findAll(n={}){return this.getAll().filter(r=>bo(n,r))}notify(n){Be.batch(()=>{this.listeners.forEach(r=>{r(n)})})}resumePausedMutations(){const n=this.getAll().filter(r=>r.state.isPaused);return Be.batch(()=>Promise.all(n.map(r=>r.continue().catch(tt))))}},Dt=new WeakMap,nt=new WeakMap,gr=new WeakMap,Zo);function Dr(e){var t;return(t=e.options.scope)==null?void 0:t.id}var vt,Xo,Dl=(Xo=class extends us{constructor(n={}){super();re(this,vt);this.config=n,G(this,vt,new Map)}build(n,r,s){const i=r.queryKey,o=r.queryHash??hi(i,r);let a=this.get(o);return a||(a=new hd({client:n,queryKey:i,queryHash:o,options:n.defaultQueryOptions(r),state:s,defaultOptions:n.getQueryDefaults(i)}),this.add(a)),a}add(n){_(this,vt).has(n.queryHash)||(_(this,vt).set(n.queryHash,n),this.notify({type:"added",query:n}))}remove(n){const r=_(this,vt).get(n.queryHash);r&&(n.destroy(),r===n&&_(this,vt).delete(n.queryHash),this.notify({type:"removed",query:n}))}clear(){Be.batch(()=>{this.getAll().forEach(n=>{this.remove(n)})})}get(n){return _(this,vt).get(n)}getAll(){return[..._(this,vt).values()]}find(n){const r={exact:!0,...n};return this.getAll().find(s=>vo(r,s))}findAll(n={}){const r=this.getAll();return Object.keys(n).length>0?r.filter(s=>vo(n,s)):r}notify(n){Be.batch(()=>{this.listeners.forEach(r=>{r(n)})})}onFocus(){Be.batch(()=>{this.getAll().forEach(n=>{n.onFocus()})})}onOnline(){Be.batch(()=>{this.getAll().forEach(n=>{n.onOnline()})})}},vt=new WeakMap,Xo),be,qt,Ut,An,Mn,Kt,Dn,$n,ea,_d=(ea=class{constructor(t={}){re(this,be);re(this,qt);re(this,Ut);re(this,An);re(this,Mn);re(this,Kt);re(this,Dn);re(this,$n);G(this,be,t.queryCache||new Dl),G(this,qt,t.mutationCache||new Ml),G(this,Ut,t.defaultOptions||{}),G(this,An,new Map),G(this,Mn,new Map),G(this,Kt,0)}mount(){Pr(this,Kt)._++,_(this,Kt)===1&&(G(this,Dn,wl.subscribe(async t=>{t&&(await this.resumePausedMutations(),_(this,be).onFocus())})),G(this,$n,Qr.subscribe(async t=>{t&&(await this.resumePausedMutations(),_(this,be).onOnline())})))}unmount(){var t,n;Pr(this,Kt)._--,_(this,Kt)===0&&((t=_(this,Dn))==null||t.call(this),G(this,Dn,void 0),(n=_(this,$n))==null||n.call(this),G(this,$n,void 0))}isFetching(t){return _(this,be).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return _(this,qt).findAll({...t,status:"pending"}).length}getQueryData(t){var r;const n=this.defaultQueryOptions({queryKey:t});return(r=_(this,be).get(n.queryHash))==null?void 0:r.state.data}ensureQueryData(t){const n=this.defaultQueryOptions(t),r=_(this,be).build(this,n),s=r.state.data;return s===void 0?this.fetchQuery(t):(t.revalidateIfStale&&r.isStaleByTime(Bs(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(s))}getQueriesData(t){return _(this,be).findAll(t).map(({queryKey:n,state:r})=>{const s=r.data;return[n,s]})}setQueryData(t,n,r){const s=this.defaultQueryOptions({queryKey:t}),i=_(this,be).get(s.queryHash),o=i==null?void 0:i.state.data,a=Zf(n,o);if(a!==void 0)return _(this,be).build(this,s).setData(a,{...r,manual:!0})}setQueriesData(t,n,r){return Be.batch(()=>_(this,be).findAll(t).map(({queryKey:s})=>[s,this.setQueryData(s,n,r)]))}getQueryState(t){var r;const n=this.defaultQueryOptions({queryKey:t});return(r=_(this,be).get(n.queryHash))==null?void 0:r.state}removeQueries(t){const n=_(this,be);Be.batch(()=>{n.findAll(t).forEach(r=>{n.remove(r)})})}resetQueries(t,n){const r=_(this,be);return Be.batch(()=>(r.findAll(t).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...t},n)))}cancelQueries(t,n={}){const r={revert:!0,...n},s=Be.batch(()=>_(this,be).findAll(t).map(i=>i.cancel(r)));return Promise.all(s).then(tt).catch(tt)}invalidateQueries(t,n={}){return Be.batch(()=>(_(this,be).findAll(t).forEach(r=>{r.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},n)))}refetchQueries(t,n={}){const r={...n,cancelRefetch:n.cancelRefetch??!0},s=Be.batch(()=>_(this,be).findAll(t).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let o=i.fetch(void 0,r);return r.throwOnError||(o=o.catch(tt)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(s).then(tt)}fetchQuery(t){const n=this.defaultQueryOptions(t);n.retry===void 0&&(n.retry=!1);const r=_(this,be).build(this,n);return r.isStaleByTime(Bs(n.staleTime,r))?r.fetch(n):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(tt).catch(tt)}fetchInfiniteQuery(t){return t.behavior=To(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(tt).catch(tt)}ensureInfiniteQueryData(t){return t.behavior=To(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Qr.isOnline()?_(this,qt).resumePausedMutations():Promise.resolve()}getQueryCache(){return _(this,be)}getMutationCache(){return _(this,qt)}getDefaultOptions(){return _(this,Ut)}setDefaultOptions(t){G(this,Ut,t)}setQueryDefaults(t,n){_(this,An).set(cr(t),{queryKey:t,defaultOptions:n})}getQueryDefaults(t){const n=[..._(this,An).values()],r={};return n.forEach(s=>{ur(t,s.queryKey)&&Object.assign(r,s.defaultOptions)}),r}setMutationDefaults(t,n){_(this,Mn).set(cr(t),{mutationKey:t,defaultOptions:n})}getMutationDefaults(t){const n=[..._(this,Mn).values()],r={};return n.forEach(s=>{ur(t,s.mutationKey)&&Object.assign(r,s.defaultOptions)}),r}defaultQueryOptions(t){if(t._defaulted)return t;const n={..._(this,Ut).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return n.queryHash||(n.queryHash=hi(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===pi&&(n.enabled=!1),n}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{..._(this,Ut).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){_(this,be).clear(),_(this,qt).clear()}},be=new WeakMap,qt=new WeakMap,Ut=new WeakMap,An=new WeakMap,Mn=new WeakMap,Kt=new WeakMap,Dn=new WeakMap,$n=new WeakMap,ea),vd="VUE_QUERY_CLIENT";function bd(e){const t=e?`:${e}`:"";return`${vd}${t}`}function qs(e,t,n="",r=0){if(t){const s=t(e,n,r);if(s===void 0&&Ce(e)||s!==void 0)return s}if(Array.isArray(e))return e.map((s,i)=>qs(s,t,String(i),r+1));if(typeof e=="object"&&xd(e)){const s=Object.entries(e).map(([i,o])=>[i,qs(o,t,i,r+1)]);return Object.fromEntries(s)}return e}function wd(e,t){return qs(e,t)}function te(e,t=!1){return wd(e,(n,r,s)=>{if(s===1&&r==="queryKey")return te(n,!0);if(t&&Sd(n))return te(n(),t);if(Ce(n))return te(X(n),t)})}function xd(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function Sd(e){return typeof e=="function"}var Cd=class extends Dl{find(e){return super.find(te(e))}findAll(e={}){return super.findAll(te(e))}},Td=class extends Ml{find(e){return super.find(te(e))}findAll(e={}){return super.findAll(te(e))}},$l=class extends _d{constructor(e={}){const t={defaultOptions:e.defaultOptions,queryCache:e.queryCache||new Cd,mutationCache:e.mutationCache||new Td};super(t),this.isRestoring=we(!1)}isFetching(e={}){return super.isFetching(te(e))}isMutating(e={}){return super.isMutating(te(e))}getQueryData(e){return super.getQueryData(te(e))}ensureQueryData(e){return super.ensureQueryData(te(e))}getQueriesData(e){return super.getQueriesData(te(e))}setQueryData(e,t,n={}){return super.setQueryData(te(e),t,te(n))}setQueriesData(e,t,n={}){return super.setQueriesData(te(e),t,te(n))}getQueryState(e){return super.getQueryState(te(e))}removeQueries(e={}){return super.removeQueries(te(e))}resetQueries(e={},t={}){return super.resetQueries(te(e),te(t))}cancelQueries(e={},t={}){return super.cancelQueries(te(e),te(t))}invalidateQueries(e={},t={}){const n=te(e),r=te(t);if(super.invalidateQueries({...n,refetchType:"none"},r),n.refetchType==="none")return Promise.resolve();const s={...n,type:n.refetchType??n.type??"active"};return Ln().then(()=>super.refetchQueries(s,r))}refetchQueries(e={},t={}){return super.refetchQueries(te(e),te(t))}fetchQuery(e){return super.fetchQuery(te(e))}prefetchQuery(e){return super.prefetchQuery(te(e))}fetchInfiniteQuery(e){return super.fetchInfiniteQuery(te(e))}prefetchInfiniteQuery(e){return super.prefetchInfiniteQuery(te(e))}setDefaultOptions(e){super.setDefaultOptions(te(e))}setQueryDefaults(e,t){super.setQueryDefaults(te(e),te(t))}getQueryDefaults(e){return super.getQueryDefaults(te(e))}setMutationDefaults(e,t){super.setMutationDefaults(te(e),te(t))}getMutationDefaults(e){return super.getMutationDefaults(te(e))}},Pd={install:(e,t={})=>{const n=bd(t.queryClientKey);let r;if("queryClient"in t&&t.queryClient)r=t.queryClient;else{const o="queryClientConfig"in t?t.queryClientConfig:void 0;r=new $l(o)}xl||r.mount();let s=()=>{};if(t.clientPersister){r.isRestoring&&(r.isRestoring.value=!0);const[o,a]=t.clientPersister(r);s=o,a.then(()=>{var l;r.isRestoring&&(r.isRestoring.value=!1),(l=t.clientPersisterOnSuccess)==null||l.call(t,r)})}const i=()=>{r.unmount(),s()};if(e.onUnmount)e.onUnmount(i);else{const o=e.unmount;e.unmount=function(){i(),o()}}e.provide(n,r)}};const Od="modulepreload",Ed=function(e){return"/"+e},Oo={},Eo=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){let o=function(u){return Promise.all(u.map(c=>Promise.resolve(c).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));s=o(n.map(u=>{if(u=Ed(u),u in Oo)return;Oo[u]=!0;const c=u.endsWith(".css"),d=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${d}`))return;const m=document.createElement("link");if(m.rel=c?"stylesheet":Od,c||(m.as="script"),m.crossOrigin="",m.href=u,l&&m.setAttribute("nonce",l),document.head.appendChild(m),c)return new Promise((v,x)=>{m.addEventListener("load",v),m.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${u}`)))})}))}function i(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return s.then(o=>{for(const a of o||[])a.status==="rejected"&&i(a.reason);return t().catch(i)})};function Ad(e,t){const n=`${e}Context`,r=Symbol(n);return[o=>{const a=St(r,o);if(a||a===null)return a;throw new Error(`Injection \`${r.toString()}\` not found. Component must be used within ${Array.isArray(e)?`one of the following components: ${e.join(", ")}`:`\`${e}\``}`)},o=>(La(r,o),o)]}function Md(e,t){return ua()?(Tc(e,t),!0):!1}const Dd=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;function $d(e,t,n={}){const{immediate:r=!0,immediateCallback:s=!1}=n,i=Jc(!1);let o;function a(){o&&(clearTimeout(o),o=void 0)}function l(){i.value=!1,a()}function u(...c){s&&e(),a(),i.value=!0,o=setTimeout(()=>{i.value=!1,o=void 0,e(...c)},Ea(t))}return r&&(i.value=!0,Dd&&u()),Md(l),{isPending:Kc(i),start:u,stop:l}}function Fd(e){var t;const n=Ea(e);return(t=n==null?void 0:n.$el)!==null&&t!==void 0?t:n}function kd(){const e=xr(),t=we(),n=Se(()=>r());Ua(()=>{n.value!==r()&&Wc(t)});function r(){return t.value&&"$el"in t.value&&["#text","#comment"].includes(t.value.$el.nodeName)?t.value.$el.nextElementSibling:Fd(t)}const s=Object.assign({},e.exposed),i={};for(const a in e.props)Object.defineProperty(i,a,{enumerable:!0,configurable:!0,get:()=>e.props[a]});if(Object.keys(s).length>0)for(const a in s)Object.defineProperty(i,a,{enumerable:!0,configurable:!0,get:()=>s[a]});Object.defineProperty(i,"$el",{enumerable:!0,configurable:!0,get:()=>e.vnode.el}),e.exposed=i;function o(a){if(t.value=a,!!a&&(Object.defineProperty(i,"$el",{enumerable:!0,configurable:!0,get:()=>a instanceof Element?a:a.$el}),!(a instanceof Element)&&!Object.hasOwn(a,"$el"))){const l=a.$.exposed,u=Object.assign({},i);for(const c in l)Object.defineProperty(u,c,{enumerable:!0,configurable:!0,get:()=>l[c]});e.exposed=u}}return{forwardRef:o,currentRef:t,currentElement:n}}const[Dg,Ld]=Ad("TooltipProvider");var Id=ct({inheritAttrs:!1,__name:"TooltipProvider",props:{delayDuration:{type:Number,required:!1,default:700},skipDelayDuration:{type:Number,required:!1,default:300},disableHoverableContent:{type:Boolean,required:!1,default:!1},disableClosingTrigger:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:!1},content:{type:Object,required:!1}},setup(e){const t=e,{delayDuration:n,skipDelayDuration:r,disableHoverableContent:s,disableClosingTrigger:i,ignoreNonKeyboardFocus:o,disabled:a,content:l}=Yc(t);kd();const u=we(!0),c=we(!1),{start:d,stop:m}=$d(()=>{u.value=!0},r,{immediate:!1});return Ld({isOpenDelayed:u,delayDuration:n,onOpen(){m(),u.value=!1},onClose(){d()},isPointerInTransitRef:c,disableHoverableContent:s,disableClosingTrigger:i,disabled:a,ignoreNonKeyboardFocus:o,content:l}),(v,x)=>qr(v.$slots,"default")}}),Nd=Id;const Rd={app:{title:"Mokelay Editor",subtitle:"Mokelay page configurator",darkMode:"Dark mode",dark:"Dark",light:"Light",language:"Language",chinese:"中文",english:"English"},editor:{placeholder:"Start typing your content...",defaultParagraph:"Welcome to the Mokelay editor starter template.",fullscreenEdit:"Fullscreen",saveContent:"Save",previewPage:"Preview",properties:"Properties",propertyDialogTitle:"Property Settings",configJson:"Config JSON",close:"Close"},preview:{title:"Config Preview",backToEditor:"Back",emptyState:'No saved config found. Please click "Save" in the editor first.'},globalCalls:{ok:"OK",cancel:"Cancel",alertRoleLabel:"Alert",confirmRoleLabel:"Confirm",messageRoleLabel:"Message"},input:{toolboxTitle:"Input",defaultPlaceholder:"Please enter...",propertyPanelTitle:"Input Properties",properties:{placeholder:"Placeholder",value:"Default value",valuePlaceholder:"Please enter a default value"}},link:{toolboxTitle:"Link",defaultText:"Link",defaultUrl:"https://mokelay.com",propertyPanelTitle:"Link Properties",properties:{text:"Link text",url:"Link URL",open:"Open in new page"}},advanceInput:{toolboxTitle:"Advanced Input"},editorSelector:{toolboxTitle:"Component Selector",placeholder:"Select a component"},form:{toolboxTitle:"Form",placeholder:"Add a form item"},advanceTable:{toolboxTitle:"Advanced Table",propertyPanelTitle:"Advanced Table Properties",defaultColumnName:"Column",empty:"No data",selectAll:"Select all",selectRow:"Select row",properties:{index:"Show index column",selection:"Show selection column"},defaultColumns:{name:"Name",status:"Status",tag:"Tag",owner:"Owner",link:"Link"},defaultRows:{first:{name:"Mokelay Page",status:"Designing",tag:"Design",owner:"Product Team",linkText:"Website",linkUrl:"https://mokelay.com"},second:{name:"Advanced Table",status:"Previewable",tag:"Preview",owner:"Editor Team",linkText:"Docs",linkUrl:"https://editor.mokelay.com"}}},datasource:{toolboxTitle:"Datasource Editor",title:"Datasource",empty:"No items",emptySchema:'No field config yet. Click "Generate field config" first.',noListRecord:"This schema does not contain an array field for list data.",noFormFields:"This schema does not contain simple fields for a form.",fields:{type:"Datasource type",rawData:"JSON data",domain:"API domain",path:"API path",method:"Method",key:"Key",mock:"Mock data",jsonSchema:"JSON Schema",generatedFields:"Fields",searchFields:"Search fields or paths",recordPath:"List data path",rootRecordPath:"Root data",selectedFields:"Selected fields",required:"Required"},sections:{headers:"Header",queries:"Query",body:"Body",generateFields:"Generate field config",fieldSelection:"Field selection"},actions:{add:"Add",remove:"Remove",parseJsonSchema:"Parse JSON Schema",parsingJsonSchema:"Parsing...",generateFields:"Generate field config",generatingFields:"Generating..."},tabs:{list:"List fields",form:"Form fields",advanced:"Advanced Schema"},help:{generateFields:"Detect fields from JSON data or an API response, then prepare them for list and form components.",fieldSelection:"Choose the fields components should use, and rename them with business-friendly labels."},schemaTypes:{object:"Object",array:"List",string:"Text",number:"Number",boolean:"Switch",null:"Empty"},componentHints:{text:"Text",number:"Number",switch:"Switch",object:"Object",array:"List"},validation:{invalidJson:"Enter valid JSON.",invalidJsonSchema:"Enter a JSON Schema that matches the supported format.",invalidNumber:"Enter a valid number.",invalidObject:"Enter a valid JSON object.",invalidArray:"Enter a valid JSON array.",fixJsonBeforeSchema:"Fix JSON data before parsing JSON Schema.",fixBodyBeforeSchema:"Fix Body mock data before parsing JSON Schema.",nonJsonResponse:"The API response is not JSON.",invalidJsonResponse:"The API response is not valid JSON.",apiRequestFailed:"API request failed:",emptyArraySchema:"Cannot infer JSON Schema from an empty array.",mixedArraySchema:"The array contains incompatible types, so JSON Schema cannot be inferred."}},formItem:{toolboxTitle:"Form Item",defaultLabelName:"Field",propertyPanelTitle:"Form Item Properties",emptyEditor:"No editor selected",properties:{labelName:"Field label",variableName:"Variable name",editor:"Editor",layout:"Layout"},placeholders:{labelName:"Enter field label",variableName:"Enter variable name"},layouts:{vertical:"Vertical",horizontal:"Horizontal"}},tag:{toolboxTitle:"Tag",defaultTagName:"Tag",propertyPanelTitle:"Tag Properties",properties:{tagName:"Tag name",type:"Type",size:"Size",color:"Custom color",colorPlaceholder:"e.g. #409EFF",closable:"Closable"},types:{default:"Default",primary:"Primary",success:"Success",info:"Info",warning:"Warning",danger:"Danger"},sizes:{default:"Default",large:"Large",medium:"Medium",small:"Small"}},page:{toolboxTitle:"Page"}},jd={},Hd={app:{title:"Mokelay Editor",subtitle:"Mokelay页面配置器",darkMode:"深色模式",dark:"深色",light:"浅色",language:"语言",chinese:"中文",english:"English"},editor:{placeholder:"开始输入你的内容...",defaultParagraph:"欢迎使用 Mokelay 编辑器初始化模板。",fullscreenEdit:"全屏编辑",saveContent:"保存",previewPage:"预览",properties:"属性",propertyDialogTitle:"属性设置",configJson:"配置 JSON",close:"关闭"},preview:{title:"配置预览",backToEditor:"返回",emptyState:"未找到已保存配置,请先在编辑器点击“保存”。"},globalCalls:{ok:"确定",cancel:"取消",alertRoleLabel:"提示",confirmRoleLabel:"确认",messageRoleLabel:"消息"},input:{toolboxTitle:"输入框",defaultPlaceholder:"请输入.....",propertyPanelTitle:"输入框属性",properties:{placeholder:"占位提示",value:"默认值",valuePlaceholder:"请输入默认值"}},link:{toolboxTitle:"链接",defaultText:"链接",defaultUrl:"https://mokelay.com",propertyPanelTitle:"链接属性",properties:{text:"链接文本",url:"链接地址",open:"新页面打开"}},advanceInput:{toolboxTitle:"高级输入框"},editorSelector:{toolboxTitle:"组件选择器",placeholder:"选择组件"},form:{toolboxTitle:"表单",placeholder:"添加表单项"},advanceTable:{toolboxTitle:"高级表格",propertyPanelTitle:"高级表格属性",defaultColumnName:"列",empty:"暂无数据",selectAll:"全选",selectRow:"选择行",properties:{index:"显示序号列",selection:"显示多选列"},defaultColumns:{name:"名称",status:"状态",tag:"标签",owner:"负责人",link:"链接"},defaultRows:{first:{name:"Mokelay 页面",status:"设计中",tag:"设计",owner:"产品团队",linkText:"官网",linkUrl:"https://mokelay.com"},second:{name:"高级表格",status:"可预览",tag:"预览",owner:"编辑器团队",linkText:"文档",linkUrl:"https://editor.mokelay.com"}}},datasource:{toolboxTitle:"数据源编辑器",title:"数据源",empty:"暂无配置项",emptySchema:"还没有字段配置,请先点击“生成字段配置”。",noListRecord:"当前 Schema 中没有可作为列表数据的数组字段。",noFormFields:"当前 Schema 中没有可用于表单的普通字段。",fields:{type:"数据源类型",rawData:"JSON 数据",domain:"API 域名",path:"API Path",method:"调用方法",key:"Key",mock:"Mock 数据",jsonSchema:"JSON Schema",generatedFields:"字段数",searchFields:"搜索字段名称或路径",recordPath:"列表数据位置",rootRecordPath:"根数据",selectedFields:"已选择字段",required:"必填"},sections:{headers:"Header",queries:"Query",body:"Body",generateFields:"生成字段配置",fieldSelection:"字段选择"},actions:{add:"添加",remove:"删除",parseJsonSchema:"解析JSON Schema",parsingJsonSchema:"解析中...",generateFields:"生成字段配置",generatingFields:"生成中..."},tabs:{list:"列表字段",form:"表单字段",advanced:"高级 Schema"},help:{generateFields:"从 JSON 数据或 API 响应中识别字段,生成给列表和表单使用的配置。",fieldSelection:"勾选需要给组件使用的字段,可以直接改成业务同学看得懂的名称。"},schemaTypes:{object:"对象",array:"列表",string:"文本",number:"数字",boolean:"开关",null:"空值"},componentHints:{text:"文本",number:"数字",switch:"开关",object:"对象",array:"列表"},validation:{invalidJson:"请输入标准 JSON 结构。",invalidJsonSchema:"请输入符合数据格式的 JSON Schema。",invalidNumber:"请输入有效数字。",invalidObject:"请输入标准 JSON 对象。",invalidArray:"请输入标准 JSON 数组。",fixJsonBeforeSchema:"请先修正 JSON 数据。",fixBodyBeforeSchema:"请先修正 Body 中的 Mock 数据。",nonJsonResponse:"API 响应不是 JSON 数据。",invalidJsonResponse:"API 响应不是有效 JSON 数据。",apiRequestFailed:"API 请求失败:",emptyArraySchema:"空数组无法推断 JSON Schema。",mixedArraySchema:"数组中包含无法合并的类型,无法推断 JSON Schema。"}},formItem:{toolboxTitle:"表单项",defaultLabelName:"字段",propertyPanelTitle:"表单项属性",emptyEditor:"未选择编辑器",properties:{labelName:"字段文本",variableName:"变量名",editor:"编辑器",layout:"布局方式"},placeholders:{labelName:"请输入字段文本",variableName:"请输入变量名"},layouts:{vertical:"垂直",horizontal:"水平"}},tag:{toolboxTitle:"标签",defaultTagName:"标签",propertyPanelTitle:"标签属性",properties:{tagName:"标签内容",type:"标签类型",size:"标签尺寸",color:"自定义颜色",colorPlaceholder:"例如:#409EFF",closable:"可关闭"},types:{default:"默认",primary:"主要",success:"成功",info:"信息",warning:"警告",danger:"危险"},sizes:{default:"默认",large:"大",medium:"中",small:"小"}},page:{toolboxTitle:"页面"}},Bd={ui:{blockTunes:{toggler:{"Click to tune":"点击设置","or drag to move":"或拖拽移动"}},inlineToolbar:{converter:{"Convert to":"转换为"}},toolbar:{toolbox:{Add:"添加"}},popover:{Filter:"筛选","Nothing found":"未找到结果"}},blockTunes:{delete:{Delete:"删除"},moveUp:{"Move up":"上移"},moveDown:{"Move down":"下移"}},toolNames:{Text:"文本",Heading:"标题",List:"列表",Warning:"提示",Checklist:"清单",Quote:"引用",Delimiter:"分割线",Table:"表格",Link:"链接",Columns:"分栏"}},zd={zh:Hd,en:Rd},Vd={zh:Bd,en:jd},Fl="mokelay-editor-locale";function qd(e){const n=(document.cookie?document.cookie.split("; "):[]).find(r=>r.startsWith(`${e}=`));return n?decodeURIComponent(n.slice(e.length+1)):null}function Ud(e,t){document.cookie=`${e}=${encodeURIComponent(t)}; path=/; max-age=31536000; samesite=lax`}function Kd(){return navigator.language.toLowerCase().startsWith("zh")?"zh":"en"}function Jd(){const e=qd(Fl);return e==="zh"||e==="en"?e:Kd()}const fr=we(Jd());function kl(e){const t=e.split(".");let n=zd[fr.value];for(const r of t){if(typeof n=="object"&&n!==null&&r in n){n=n[r];continue}n=void 0;break}return typeof n=="string"?n:e}function Ll(e){fr.value=e,Ud(Fl,e)}function gi(){return{locale:jr(fr),t:kl,setLocale:Ll,localeValue:Se(()=>fr.value)}}function $g(e){return Vd[e]}const Z={t:kl,get locale(){return fr.value},setLocale:Ll},Qd={"data-testid":"app-root",class:"flex min-h-screen flex-col bg-slate-100 p-4 text-slate-900 transition-colors dark:bg-slate-950 dark:text-slate-100"},Wd={"data-testid":"app-header",class:"mb-4 flex flex-wrap items-center justify-between gap-3 rounded-xl border border-slate-200 bg-white px-4 py-3 shadow-sm dark:border-slate-700 dark:bg-slate-900"},Gd={"data-testid":"app-title",class:"text-xl font-semibold"},Yd={class:"flex flex-wrap items-center gap-3"},Zd={class:"flex items-center gap-2 text-sm"},Xd=["value"],eh={value:"dark"},th={value:"light"},nh={class:"flex items-center gap-2 text-sm"},rh=["value"],sh={value:"zh"},ih={value:"en"},oh=["disabled"],ah=["disabled"],Ao="mokelay-editor-theme-mode",lh=ct({__name:"App",setup(e){const t=Bi(()=>Eo(()=>import("./EditorPanel-B97wXLqG.js"),__vite__mapDeps([0,1,2,3,4]))),n=Bi(()=>Eo(()=>import("./PreviewPanel-65RZ8CEI.js"),__vite__mapDeps([5,1,2,3])));function r(g){const j=(document.cookie?document.cookie.split("; "):[]).find(ee=>ee.startsWith(`${g}=`));return j?decodeURIComponent(j.slice(g.length+1)):null}function s(g,M){document.cookie=`${g}=${encodeURIComponent(M)}; path=/; max-age=31536000; samesite=lax`}function i(){const g=r(Ao);return g==="dark"}const o=we(i()),a=we(window.location.hash||"#/"),{t:l,localeValue:u,setLocale:c}=gi(),d=we(null),m=Se(()=>a.value==="#/preview"),v=Se(()=>d.value!==null);function x(g){document.documentElement.classList.toggle("dark",g)}function p(){a.value=window.location.hash||"#/"}br(()=>{x(o.value),window.addEventListener("hashchange",p)}),ai(()=>{window.removeEventListener("hashchange",p)}),Lr(o,g=>{x(g),s(Ao,g?"dark":"light")});function b(g){o.value=g==="dark"}function T(){var g;(g=d.value)==null||g.save()}function L(){var g;(g=d.value)==null||g.openPreview()}function D(){window.location.hash="/"}return(g,M)=>(ue(),Jt(X(Nd),null,{default:wn(()=>[pe("main",Qd,[pe("header",Wd,[pe("h1",Gd,Fe(X(l)("app.title")),1),pe("div",Yd,[pe("label",Zd,[pe("select",{"data-testid":"theme-select",value:o.value?"dark":"light",class:"rounded-lg border border-slate-300 bg-white px-3 py-1.5 text-sm dark:border-slate-600 dark:bg-slate-800",onChange:M[0]||(M[0]=j=>b(j.target.value))},[pe("option",eh,Fe(X(l)("app.dark")),1),pe("option",th,Fe(X(l)("app.light")),1)],40,Xd)]),pe("label",nh,[pe("select",{"data-testid":"locale-select",value:X(u),class:"rounded-lg border border-slate-300 bg-white px-3 py-1.5 text-sm dark:border-slate-600 dark:bg-slate-800",onChange:M[1]||(M[1]=j=>X(c)(j.target.value))},[pe("option",sh,Fe(X(l)("app.chinese")),1),pe("option",ih,Fe(X(l)("app.english")),1)],40,rh)]),m.value?(ue(),ve("button",{key:1,"data-testid":"back-to-editor-button",class:"rounded-lg bg-slate-200 px-3 py-1.5 text-sm font-medium text-slate-800 hover:bg-slate-300 dark:bg-slate-700 dark:text-slate-100 dark:hover:bg-slate-600",onClick:D},Fe(X(l)("preview.backToEditor")),1)):(ue(),ve(ke,{key:0},[pe("button",{"data-testid":"save-button",class:"rounded-lg bg-indigo-500 px-3 py-1.5 text-sm font-medium text-white hover:bg-indigo-400 disabled:cursor-not-allowed disabled:opacity-50",disabled:!v.value,onClick:T},Fe(X(l)("editor.saveContent")),9,oh),pe("button",{"data-testid":"preview-button",class:"rounded-lg bg-emerald-500 px-3 py-1.5 text-sm font-medium text-white hover:bg-emerald-400 disabled:cursor-not-allowed disabled:opacity-50",disabled:!v.value,onClick:L},Fe(X(l)("editor.previewPage")),9,ah)],64))])]),m.value?(ue(),Jt(X(n),{key:0})):(ue(),Jt(X(t),{key:1,ref_key:"editorPanelRef",ref:d},null,512))])]),_:1}))}});function Fg(e){return e}const ch={class:"ce-input-tool","data-testid":"editor-input-tool"},uh=["placeholder","value"],fh={toolbox:{get title(){return Z.t("input.toolboxTitle")},icon:'<svg width="18" height="18" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><rect x="3" y="6" width="18" height="12" rx="2" ry="2" fill="none" stroke="currentColor" stroke-width="2"/><path d="M8 12h8" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>'},propertyPanel:{get title(){return Z.t("input.propertyPanelTitle")},get fields(){return[{key:"placeholder",label:Z.t("input.properties.placeholder"),placeholder:Z.t("input.defaultPlaceholder")},{key:"value",label:Z.t("input.properties.value"),placeholder:Z.t("input.properties.valuePlaceholder")}]}},createInitialProps:()=>({placeholder:Z.t("input.defaultPlaceholder"),value:""}),normalizeProps:e=>({edit:e.edit??!1,placeholder:e.placeholder??"",value:e.value??""}),serialize:e=>({placeholder:e.placeholder??"",value:e.value??""})},dh=ct({__name:"MInput",props:{edit:{type:Boolean},placeholder:{},value:{},onChange:{type:Function},onToolChange:{type:Function}},setup(e){const t=e;function n(r){var i,o;const s={edit:t.edit,placeholder:t.placeholder??"",value:t.value??"",...r};(i=t.onToolChange)==null||i.call(t,s),(o=t.onChange)==null||o.call(t,s)}return(r,s)=>(ue(),ve("div",ch,[pe("input",{"data-testid":"editor-input-control",class:"ce-input-tool__control",type:"text",placeholder:e.placeholder,value:e.value,onInput:s[0]||(s[0]=i=>n({value:i.target.value}))},null,40,uh)]))}}),Cr=(e,t)=>{const n=e.__vccOpts||e;for(const[r,s]of t)n[r]=s;return n},hh=Cr(dh,[["__scopeId","data-v-38751236"]]),ph=["href","target","rel"],gh={toolbox:{get title(){return Z.t("link.toolboxTitle")},icon:'<svg width="18" height="18" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M10.6 13.4a4 4 0 0 0 5.7 0l2.1-2.1a4 4 0 0 0-5.7-5.7l-1.2 1.2" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/><path d="M13.4 10.6a4 4 0 0 0-5.7 0l-2.1 2.1a4 4 0 0 0 5.7 5.7l1.2-1.2" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>'},propertyPanel:{get title(){return Z.t("link.propertyPanelTitle")},get fields(){return[{key:"text",label:Z.t("link.properties.text"),placeholder:Z.t("link.defaultText")},{key:"url",label:Z.t("link.properties.url"),placeholder:Z.t("link.defaultUrl")},{key:"open",label:Z.t("link.properties.open"),type:"checkbox"}]}},createInitialProps:()=>({text:Z.t("link.defaultText"),url:Z.t("link.defaultUrl"),open:!1}),normalizeProps:e=>{var t,n;return{edit:e.edit??!1,text:((t=e.text)==null?void 0:t.trim())||Z.t("link.defaultText"),url:((n=e.url)==null?void 0:n.trim())||Z.t("link.defaultUrl"),open:e.open===!0}},serialize:e=>{var t,n;return{text:((t=e.text)==null?void 0:t.trim())||Z.t("link.defaultText"),url:((n=e.url)==null?void 0:n.trim())||Z.t("link.defaultUrl"),open:e.open===!0}}},mh=ct({__name:"MLink",props:{edit:{type:Boolean},text:{},url:{},open:{type:Boolean},onChange:{type:Function},onToolChange:{type:Function}},setup(e){const t=e,{t:n}=gi(),r=we(null),s=Se(()=>{var p;return((p=t.text)==null?void 0:p.trim())||n("link.defaultText")}),i=Se(()=>m(t.url??"")),o=Se(()=>t.open?"_blank":void 0),a=Se(()=>t.open?"noopener noreferrer":void 0);let l=null;function u(){l!==null&&(window.clearTimeout(l),l=null)}function c(){var ee;const p=r.value;if(!p)return;const b=p.closest(".ce-block"),T=(ee=p.closest(".codex-editor"))==null?void 0:ee.querySelector(".ce-toolbar"),L=T==null?void 0:T.querySelector(".ce-toolbar__plus");if(!b||!T||!L)return;const D=b.getBoundingClientRect(),g=p.getBoundingClientRect(),M=L.getBoundingClientRect().height||26,j=b.offsetTop+(g.top-D.top)+(g.height-M)/2;T.style.top=`${Math.round(j)}px`}function d(){u(),l=window.setTimeout(()=>{c()},0)}function m(p){const b=p.trim();if(!b)return"#";if(b.startsWith("//"))return`https:${b}`;const T=b.match(/^([a-z][a-z\d+.-]*):/i);if(!T)return b;const L=T[1].toLowerCase();return["http","https","mailto","tel"].includes(L)?b:"#"}function v(p){var T,L;const b={edit:t.edit,text:t.text??"",url:t.url??"",open:t.open??!1,...p};(T=t.onToolChange)==null||T.call(t,b),(L=t.onChange)==null||L.call(t,b)}function x(p){(t.edit||i.value==="#")&&p.preventDefault(),v({text:s.value,url:t.url??"",open:t.open??!1})}return br(()=>{Ln(()=>{var p,b;(p=r.value)==null||p.addEventListener("mouseenter",d),(b=r.value)==null||b.addEventListener("mousemove",d)})}),wr(()=>{var p,b;u(),(p=r.value)==null||p.removeEventListener("mouseenter",d),(b=r.value)==null||b.removeEventListener("mousemove",d)}),(p,b)=>(ue(),ve("span",{ref_key:"rootRef",ref:r,class:"ce-link-tool","data-testid":"editor-link-tool"},[pe("a",{class:"ce-link-tool__anchor","data-testid":"editor-link-value",href:i.value,target:o.value,rel:a.value,onClick:x},Fe(s.value),9,ph)],512))}}),yh=Cr(mh,[["__scopeId","data-v-e56db1bc"]]),Il=["","default","small","large"];typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;var _h=typeof global=="object"&&global&&global.Object===Object&&global,vh=typeof self=="object"&&self&&self.Object===Object&&self,mi=_h||vh||Function("return this")(),Nn=mi.Symbol,Nl=Object.prototype,bh=Nl.hasOwnProperty,wh=Nl.toString,Un=Nn?Nn.toStringTag:void 0;function xh(e){var t=bh.call(e,Un),n=e[Un];try{e[Un]=void 0;var r=!0}catch{}var s=wh.call(e);return r&&(t?e[Un]=n:delete e[Un]),s}var Sh=Object.prototype,Ch=Sh.toString;function Th(e){return Ch.call(e)}var Ph="[object Null]",Oh="[object Undefined]",Mo=Nn?Nn.toStringTag:void 0;function yi(e){return e==null?e===void 0?Oh:Ph:Mo&&Mo in Object(e)?xh(e):Th(e)}function Rl(e){return e!=null&&typeof e=="object"}var Eh="[object Symbol]";function _i(e){return typeof e=="symbol"||Rl(e)&&yi(e)==Eh}function Ah(e,t){for(var n=-1,r=e==null?0:e.length,s=Array(r);++n<r;)s[n]=t(e[n],n,e);return s}var vi=Array.isArray,Do=Nn?Nn.prototype:void 0,$o=Do?Do.toString:void 0;function jl(e){if(typeof e=="string")return e;if(vi(e))return Ah(e,jl)+"";if(_i(e))return $o?$o.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Hl(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Mh="[object AsyncFunction]",Dh="[object Function]",$h="[object GeneratorFunction]",Fh="[object Proxy]";function kh(e){if(!Hl(e))return!1;var t=yi(e);return t==Dh||t==$h||t==Mh||t==Fh}var Es=mi["__core-js_shared__"],Fo=(function(){var e=/[^.]+$/.exec(Es&&Es.keys&&Es.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function Lh(e){return!!Fo&&Fo in e}var Ih=Function.prototype,Nh=Ih.toString;function Rh(e){if(e!=null){try{return Nh.call(e)}catch{}try{return e+""}catch{}}return""}var jh=/[\\^$.*+?()[\]{}|]/g,Hh=/^\[object .+?Constructor\]$/,Bh=Function.prototype,zh=Object.prototype,Vh=Bh.toString,qh=zh.hasOwnProperty,Uh=RegExp("^"+Vh.call(qh).replace(jh,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Kh(e){if(!Hl(e)||Lh(e))return!1;var t=kh(e)?Uh:Hh;return t.test(Rh(e))}function Jh(e,t){return e==null?void 0:e[t]}function bi(e,t){var n=Jh(e,t);return Kh(n)?n:void 0}var ko=(function(){try{var e=bi(Object,"defineProperty");return e({},"",{}),e}catch{}})();function Qh(e,t,n){t=="__proto__"&&ko?ko(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Wh(e,t){return e===t||e!==e&&t!==t}var Gh=Object.prototype,kg=Gh.hasOwnProperty;function Yh(e,t){return function(n){return e(t(n))}}var Zh=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Xh=/^\w*$/;function ep(e,t){if(vi(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||_i(e)?!0:Xh.test(e)||!Zh.test(e)||t!=null&&e in Object(t)}var dr=bi(Object,"create");function tp(){this.__data__=dr?dr(null):{},this.size=0}function np(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var rp="__lodash_hash_undefined__",sp=Object.prototype,ip=sp.hasOwnProperty;function op(e){var t=this.__data__;if(dr){var n=t[e];return n===rp?void 0:n}return ip.call(t,e)?t[e]:void 0}var ap=Object.prototype,lp=ap.hasOwnProperty;function cp(e){var t=this.__data__;return dr?t[e]!==void 0:lp.call(t,e)}var up="__lodash_hash_undefined__";function fp(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=dr&&t===void 0?up:t,this}function dn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}dn.prototype.clear=tp;dn.prototype.delete=np;dn.prototype.get=op;dn.prototype.has=cp;dn.prototype.set=fp;function dp(){this.__data__=[],this.size=0}function fs(e,t){for(var n=e.length;n--;)if(Wh(e[n][0],t))return n;return-1}var hp=Array.prototype,pp=hp.splice;function gp(e){var t=this.__data__,n=fs(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():pp.call(t,n,1),--this.size,!0}function mp(e){var t=this.__data__,n=fs(t,e);return n<0?void 0:t[n][1]}function yp(e){return fs(this.__data__,e)>-1}function _p(e,t){var n=this.__data__,r=fs(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Hn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Hn.prototype.clear=dp;Hn.prototype.delete=gp;Hn.prototype.get=mp;Hn.prototype.has=yp;Hn.prototype.set=_p;var vp=bi(mi,"Map");function bp(){this.size=0,this.__data__={hash:new dn,map:new(vp||Hn),string:new dn}}function wp(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ds(e,t){var n=e.__data__;return wp(t)?n[typeof t=="string"?"string":"hash"]:n.map}function xp(e){var t=ds(this,e).delete(e);return this.size-=t?1:0,t}function Sp(e){return ds(this,e).get(e)}function Cp(e){return ds(this,e).has(e)}function Tp(e,t){var n=ds(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function pn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}pn.prototype.clear=bp;pn.prototype.delete=xp;pn.prototype.get=Sp;pn.prototype.has=Cp;pn.prototype.set=Tp;var Pp="Expected a function";function wi(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Pp);var n=function(){var r=arguments,s=t?t.apply(this,r):r[0],i=n.cache;if(i.has(s))return i.get(s);var o=e.apply(this,r);return n.cache=i.set(s,o)||i,o};return n.cache=new(wi.Cache||pn),n}wi.Cache=pn;var Op=500;function Ep(e){var t=wi(e,function(r){return n.size===Op&&n.clear(),r}),n=t.cache;return t}var Ap=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Mp=/\\(\\)?/g,Dp=Ep(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Ap,function(n,r,s,i){t.push(s?i.replace(Mp,"$1"):r||n)}),t});function $p(e){return e==null?"":jl(e)}function Fp(e,t){return vi(e)?e:ep(e,t)?[e]:Dp($p(e))}function kp(e){if(typeof e=="string"||_i(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Lp(e,t){t=Fp(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[kp(t[n++])];return n&&n==r?e:void 0}function Ip(e,t,n){var r=e==null?void 0:Lp(e,t);return r===void 0?n:r}var Np=Yh(Object.getPrototypeOf,Object),Rp="[object Object]",jp=Function.prototype,Hp=Object.prototype,Bl=jp.toString,Bp=Hp.hasOwnProperty,zp=Bl.call(Object);function Vp(e){if(!Rl(e)||yi(e)!=Rp)return!1;var t=Np(e);if(t===null)return!0;var n=Bp.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Bl.call(n)==zp}function zl(e){for(var t=-1,n=e==null?0:e.length,r={};++t<n;){var s=e[t];Qh(r,s[0],s[1])}return r}const qp=e=>typeof e=="number";const Up=e=>fe(e)?!Number.isNaN(Number(e)):!1;const Vl="__epPropKey",Kp=e=>e,Jp=e=>ce(e)&&!!e[Vl],ql=(e,t)=>{if(!ce(e)||Jp(e))return e;const{values:n,required:r,default:s,type:i,validator:o}=e,a={type:i,required:!!r,validator:n||o?l=>{let u=!1,c=[];if(n&&(c=Array.from(n),ie(e,"default")&&c.push(s),u||(u=c.includes(l))),o&&(u||(u=o(l))),!u&&c.length>0){const d=[...new Set(c)].map(m=>JSON.stringify(m)).join(", ");hf(`Invalid prop: validation failed${t?` for prop "${t}"`:""}. Expected one of [${d}], got value ${JSON.stringify(l)}.`)}return u}:void 0,[Vl]:!0};return ie(e,"default")&&(a.default=s),a},Ul=e=>zl(Object.entries(e).map(([t,n])=>[t,ql(n,t)]));var Qp=class extends Error{constructor(e){super(e),this.name="ElementPlusError"}};function Wp(e,t){{const n=fe(e)?new Qp(`[${e}] ${t}`):e;console.warn(n)}}const Gp="utils/dom/style";function Yp(e,t="px"){if(!e&&e!==0)return"";if(qp(e)||Up(e))return`${e}${t}`;if(fe(e))return e;Wp(Gp,"binding value must be a string or number")}var Zp={name:"en",el:{breadcrumb:{label:"Breadcrumb"},colorpicker:{confirm:"OK",clear:"Clear",defaultLabel:"color picker",description:"current color is {color}. press enter to select a new color.",alphaLabel:"pick alpha value",alphaDescription:"alpha {alpha}, current color is {color}",hueLabel:"pick hue value",hueDescription:"hue {hue}, current color is {color}",svLabel:"pick saturation and brightness value",svDescription:"saturation {saturation}, brightness {brightness}, current color is {color}",predefineDescription:"select {value} as the color"},datepicker:{now:"Now",today:"Today",cancel:"Cancel",clear:"Clear",confirm:"OK",dateTablePrompt:"Use the arrow keys and enter to select the day of the month",monthTablePrompt:"Use the arrow keys and enter to select the month",yearTablePrompt:"Use the arrow keys and enter to select the year",selectedDate:"Selected date",selectDate:"Select date",selectTime:"Select time",startDate:"Start Date",startTime:"Start Time",endDate:"End Date",endTime:"End Time",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",year:"",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weeksFull:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"},months:{jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec"}},inputNumber:{decrease:"decrease number",increase:"increase number"},select:{loading:"Loading",noMatch:"No matching data",noData:"No data",placeholder:"Select"},mention:{loading:"Loading"},dropdown:{toggleDropdown:"Toggle Dropdown"},cascader:{noMatch:"No matching data",loading:"Loading",placeholder:"Select",noData:"No data"},pagination:{goto:"Go to",pagesize:"/page",total:"Total {total}",pageClassifier:"",page:"Page",prev:"Go to previous page",next:"Go to next page",currentPage:"page {pager}",prevPages:"Previous {pager} pages",nextPages:"Next {pager} pages",deprecationWarning:"Deprecated usages detected, please refer to the el-pagination documentation for more details"},dialog:{close:"Close this dialog"},drawer:{close:"Close this dialog"},messagebox:{title:"Message",confirm:"OK",cancel:"Cancel",error:"Illegal input",close:"Close this dialog"},upload:{deleteTip:"press delete to remove",delete:"Delete",preview:"Preview",continue:"Continue"},slider:{defaultLabel:"slider between {min} and {max}",defaultRangeStartLabel:"pick start value",defaultRangeEndLabel:"pick end value"},table:{emptyText:"No Data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum",selectAllLabel:"Select all rows",selectRowLabel:"Select this row",expandRowLabel:"Expand this row",collapseRowLabel:"Collapse this row",sortLabel:"Sort by {column}",filterLabel:"Filter by {column}"},tag:{close:"Close this tag"},tour:{next:"Next",previous:"Previous",finish:"Finish",close:"Close this dialog"},tree:{emptyText:"No Data"},transfer:{noMatch:"No matching data",noData:"No data",titles:["List 1","List 2"],filterPlaceholder:"Enter keyword",noCheckedFormat:"{total} items",hasCheckedFormat:"{checked}/{total} checked"},image:{error:"FAILED"},pageHeader:{title:"Back"},popconfirm:{confirmButtonText:"Yes",cancelButtonText:"No"},carousel:{leftArrow:"Carousel arrow left",rightArrow:"Carousel arrow right",indicator:"Carousel switch to index {index}"}}};const Xp=e=>(t,n)=>e0(t,n,X(e)),e0=(e,t,n)=>Ip(n,e,e).replace(/\{(\w+)\}/g,(r,s)=>`${(t==null?void 0:t[s])??`{${s}}`}`),t0=e=>({lang:Se(()=>X(e).name),locale:Ce(e)?e:we(e),t:Xp(e)}),n0=Symbol("localeContextKey"),r0=e=>{const t=e||St(n0,we());return t0(Se(()=>t.value||Zp))},As="el",s0="is-",Xt=(e,t,n,r,s)=>{let i=`${e}-${t}`;return n&&(i+=`-${n}`),r&&(i+=`__${r}`),s&&(i+=`--${s}`),i},i0=Symbol("namespaceContextKey"),o0=e=>{const t=e||(xr()?St(i0,we(As)):we(As));return Se(()=>X(t)||As)},Kl=(e,t)=>{const n=o0(t);return{namespace:n,b:(p="")=>Xt(n.value,e,p,"",""),e:p=>p?Xt(n.value,e,"",p,""):"",m:p=>p?Xt(n.value,e,"","",p):"",be:(p,b)=>p&&b?Xt(n.value,e,p,b,""):"",em:(p,b)=>p&&b?Xt(n.value,e,"",p,b):"",bm:(p,b)=>p&&b?Xt(n.value,e,p,"",b):"",bem:(p,b,T)=>p&&b&&T?Xt(n.value,e,p,b,T):"",is:(p,...b)=>{const T=b.length>=1?b[0]:!0;return p&&T?`${s0}${p}`:""},cssVar:p=>{const b={};for(const T in p)p[T]&&(b[`--${n.value}-${T}`]=p[T]);return b},cssVarName:p=>`--${n.value}-${p}`,cssVarBlock:p=>{const b={};for(const T in p)p[T]&&(b[`--${n.value}-${e}-${T}`]=p[T]);return b},cssVarBlockName:p=>`--${n.value}-${e}-${p}`}},a0=e=>{const t=xr();return Se(()=>{var n,r;return(r=(n=t==null?void 0:t.proxy)==null?void 0:n.$props)==null?void 0:r[e]})},Lg=ql({type:String,values:Il,required:!1}),l0=Symbol("size"),c0=()=>{const e=St(l0,{});return Se(()=>X(e.size)||"")},u0=e=>{const t=e.props,n=q(t)?zl(t.map(r=>[r,{}])):t;e.setPropsDefaults=r=>{if(n){for(const[s,i]of Object.entries(r)){const o=n[s];if(ie(n,s)){if(Vp(o)){n[s]={...o,default:i};continue}n[s]={type:o,default:i}}}e.props=n}}},Jl=(e,t)=>{if(e.install=n=>{for(const r of[e,...Object.values(t??{})])n.component(r.name,r)},t)for(const[n,r]of Object.entries(t))e[n]=r;return u0(e),e};/*! Element Plus Icons Vue v2.3.2 */var f0=ct({name:"Close",__name:"close",setup(e){return(t,n)=>(ue(),ve("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[pe("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}}),Lo=f0;const d0=Ul({size:{type:Kp([Number,String])},color:{type:String}});var h0=ct({name:"ElIcon",inheritAttrs:!1,__name:"icon",props:d0,setup(e){const t=e,n=Kl("icon"),r=Se(()=>{const{size:s,color:i}=t,o=Yp(s);return!o&&!i?{}:{fontSize:o,"--color":i}});return(s,i)=>(ue(),ve("i",fi({class:X(n).b(),style:r.value},s.$attrs),[qr(s.$slots,"default")],16))}}),p0=h0;const Io=Jl(p0),g0=Symbol("formContextKey"),m0=Symbol("formItemContextKey"),y0=(e,t={})=>{const n=we(void 0),r=t.prop?n:a0("size"),s=t.global?n:c0(),i=t.form?{size:void 0}:St(g0,void 0),o=t.formItem?{size:void 0}:St(m0,void 0);return Se(()=>r.value||X(e)||(o==null?void 0:o.size)||(i==null?void 0:i.size)||s.value||"")};var Nr={exports:{}},_0=Nr.exports,No;function v0(){return No||(No=1,(function(e,t){(function(n,r){e.exports=r()})(_0,(function(){var n=1e3,r=6e4,s=36e5,i="millisecond",o="second",a="minute",l="hour",u="day",c="week",d="month",m="quarter",v="year",x="date",p="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,T=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,L={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(H){var k=["th","st","nd","rd"],E=H%100;return"["+H+(k[(E-20)%10]||k[E]||k[0])+"]"}},D=function(H,k,E){var $=String(H);return!$||$.length>=k?H:""+Array(k+1-$.length).join(E)+H},g={s:D,z:function(H){var k=-H.utcOffset(),E=Math.abs(k),$=Math.floor(E/60),O=E%60;return(k<=0?"+":"-")+D($,2,"0")+":"+D(O,2,"0")},m:function H(k,E){if(k.date()<E.date())return-H(E,k);var $=12*(E.year()-k.year())+(E.month()-k.month()),O=k.clone().add($,d),J=E-O<0,Q=k.clone().add($+(J?-1:1),d);return+(-($+(E-O)/(J?O-Q:Q-O))||0)},a:function(H){return H<0?Math.ceil(H)||0:Math.floor(H)},p:function(H){return{M:d,y:v,w:c,d:u,D:x,h:l,m:a,s:o,ms:i,Q:m}[H]||String(H||"").toLowerCase().replace(/s$/,"")},u:function(H){return H===void 0}},M="en",j={};j[M]=L;var ee="$isDayjsObject",ne=function(H){return H instanceof R||!(!H||!H[ee])},B=function H(k,E,$){var O;if(!k)return M;if(typeof k=="string"){var J=k.toLowerCase();j[J]&&(O=J),E&&(j[J]=E,O=J);var Q=k.split("-");if(!O&&Q.length>1)return H(Q[0])}else{var se=k.name;j[se]=k,O=se}return!$&&O&&(M=O),O||!$&&M},U=function(H,k){if(ne(H))return H.clone();var E=typeof k=="object"?k:{};return E.date=H,E.args=arguments,new R(E)},z=g;z.l=B,z.i=ne,z.w=function(H,k){return U(H,{locale:k.$L,utc:k.$u,x:k.$x,$offset:k.$offset})};var R=(function(){function H(E){this.$L=B(E.locale,null,!0),this.parse(E),this.$x=this.$x||E.x||{},this[ee]=!0}var k=H.prototype;return k.parse=function(E){this.$d=(function($){var O=$.date,J=$.utc;if(O===null)return new Date(NaN);if(z.u(O))return new Date;if(O instanceof Date)return new Date(O);if(typeof O=="string"&&!/Z$/i.test(O)){var Q=O.match(b);if(Q){var se=Q[2]-1||0,oe=(Q[7]||"0").substring(0,3);return J?new Date(Date.UTC(Q[1],se,Q[3]||1,Q[4]||0,Q[5]||0,Q[6]||0,oe)):new Date(Q[1],se,Q[3]||1,Q[4]||0,Q[5]||0,Q[6]||0,oe)}}return new Date(O)})(E),this.init()},k.init=function(){var E=this.$d;this.$y=E.getFullYear(),this.$M=E.getMonth(),this.$D=E.getDate(),this.$W=E.getDay(),this.$H=E.getHours(),this.$m=E.getMinutes(),this.$s=E.getSeconds(),this.$ms=E.getMilliseconds()},k.$utils=function(){return z},k.isValid=function(){return this.$d.toString()!==p},k.isSame=function(E,$){var O=U(E);return this.startOf($)<=O&&O<=this.endOf($)},k.isAfter=function(E,$){return U(E)<this.startOf($)},k.isBefore=function(E,$){return this.endOf($)<U(E)},k.$g=function(E,$,O){return z.u(E)?this[$]:this.set(O,E)},k.unix=function(){return Math.floor(this.valueOf()/1e3)},k.valueOf=function(){return this.$d.getTime()},k.startOf=function(E,$){var O=this,J=!!z.u($)||$,Q=z.p(E),se=function(ut,Te){var Tt=z.w(O.$u?Date.UTC(O.$y,Te,ut):new Date(O.$y,Te,ut),O);return J?Tt:Tt.endOf(u)},oe=function(ut,Te){return z.w(O.toDate()[ut].apply(O.toDate("s"),(J?[0,0,0,0]:[23,59,59,999]).slice(Te)),O)},xe=this.$W,Ee=this.$M,qe=this.$D,Ye="set"+(this.$u?"UTC":"");switch(Q){case v:return J?se(1,0):se(31,11);case d:return J?se(1,Ee):se(0,Ee+1);case c:var Ze=this.$locale().weekStart||0,Ct=(xe<Ze?xe+7:xe)-Ze;return se(J?qe-Ct:qe+(6-Ct),Ee);case u:case x:return oe(Ye+"Hours",0);case l:return oe(Ye+"Minutes",1);case a:return oe(Ye+"Seconds",2);case o:return oe(Ye+"Milliseconds",3);default:return this.clone()}},k.endOf=function(E){return this.startOf(E,!1)},k.$set=function(E,$){var O,J=z.p(E),Q="set"+(this.$u?"UTC":""),se=(O={},O[u]=Q+"Date",O[x]=Q+"Date",O[d]=Q+"Month",O[v]=Q+"FullYear",O[l]=Q+"Hours",O[a]=Q+"Minutes",O[o]=Q+"Seconds",O[i]=Q+"Milliseconds",O)[J],oe=J===u?this.$D+($-this.$W):$;if(J===d||J===v){var xe=this.clone().set(x,1);xe.$d[se](oe),xe.init(),this.$d=xe.set(x,Math.min(this.$D,xe.daysInMonth())).$d}else se&&this.$d[se](oe);return this.init(),this},k.set=function(E,$){return this.clone().$set(E,$)},k.get=function(E){return this[z.p(E)]()},k.add=function(E,$){var O,J=this;E=Number(E);var Q=z.p($),se=function(Ee){var qe=U(J);return z.w(qe.date(qe.date()+Math.round(Ee*E)),J)};if(Q===d)return this.set(d,this.$M+E);if(Q===v)return this.set(v,this.$y+E);if(Q===u)return se(1);if(Q===c)return se(7);var oe=(O={},O[a]=r,O[l]=s,O[o]=n,O)[Q]||1,xe=this.$d.getTime()+E*oe;return z.w(xe,this)},k.subtract=function(E,$){return this.add(-1*E,$)},k.format=function(E){var $=this,O=this.$locale();if(!this.isValid())return O.invalidDate||p;var J=E||"YYYY-MM-DDTHH:mm:ssZ",Q=z.z(this),se=this.$H,oe=this.$m,xe=this.$M,Ee=O.weekdays,qe=O.months,Ye=O.meridiem,Ze=function(Te,Tt,f,h){return Te&&(Te[Tt]||Te($,J))||f[Tt].slice(0,h)},Ct=function(Te){return z.s(se%12||12,Te,"0")},ut=Ye||function(Te,Tt,f){var h=Te<12?"AM":"PM";return f?h.toLowerCase():h};return J.replace(T,(function(Te,Tt){return Tt||(function(f){switch(f){case"YY":return String($.$y).slice(-2);case"YYYY":return z.s($.$y,4,"0");case"M":return xe+1;case"MM":return z.s(xe+1,2,"0");case"MMM":return Ze(O.monthsShort,xe,qe,3);case"MMMM":return Ze(qe,xe);case"D":return $.$D;case"DD":return z.s($.$D,2,"0");case"d":return String($.$W);case"dd":return Ze(O.weekdaysMin,$.$W,Ee,2);case"ddd":return Ze(O.weekdaysShort,$.$W,Ee,3);case"dddd":return Ee[$.$W];case"H":return String(se);case"HH":return z.s(se,2,"0");case"h":return Ct(1);case"hh":return Ct(2);case"a":return ut(se,oe,!0);case"A":return ut(se,oe,!1);case"m":return String(oe);case"mm":return z.s(oe,2,"0");case"s":return String($.$s);case"ss":return z.s($.$s,2,"0");case"SSS":return z.s($.$ms,3,"0");case"Z":return Q}return null})(Te)||Q.replace(":","")}))},k.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},k.diff=function(E,$,O){var J,Q=this,se=z.p($),oe=U(E),xe=(oe.utcOffset()-this.utcOffset())*r,Ee=this-oe,qe=function(){return z.m(Q,oe)};switch(se){case v:J=qe()/12;break;case d:J=qe();break;case m:J=qe()/3;break;case c:J=(Ee-xe)/6048e5;break;case u:J=(Ee-xe)/864e5;break;case l:J=Ee/s;break;case a:J=Ee/r;break;case o:J=Ee/n;break;default:J=Ee}return O?J:z.a(J)},k.daysInMonth=function(){return this.endOf(d).$D},k.$locale=function(){return j[this.$L]},k.locale=function(E,$){if(!E)return this.$L;var O=this.clone(),J=B(E,$,!0);return J&&(O.$L=J),O},k.clone=function(){return z.w(this.$d,this)},k.toDate=function(){return new Date(this.valueOf())},k.toJSON=function(){return this.isValid()?this.toISOString():null},k.toISOString=function(){return this.$d.toISOString()},k.toString=function(){return this.$d.toUTCString()},H})(),de=R.prototype;return U.prototype=de,[["$ms",i],["$s",o],["$m",a],["$H",l],["$W",u],["$M",d],["$y",v],["$D",x]].forEach((function(H){de[H[1]]=function(k){return this.$g(k,H[0],H[1])}})),U.extend=function(H,k){return H.$i||(H(k,R,U),H.$i=!0),U},U.locale=B,U.isDayjs=ne,U.unix=function(H){return U(1e3*H)},U.en=j[M],U.Ls=j,U.p={},U}))})(Nr)),Nr.exports}var Ig=v0();const b0=Ul({type:{type:String,values:["primary","success","info","warning","danger"],default:"primary"},closable:Boolean,disableTransitions:Boolean,hit:Boolean,color:String,size:{type:String,values:Il},effect:{type:String,values:["dark","light","plain"],default:"light"},round:Boolean}),w0={close:e=>e instanceof MouseEvent,click:e=>e instanceof MouseEvent},x0=["aria-label"],S0=["aria-label"];var C0=ct({name:"ElTag",__name:"tag",props:b0,emits:w0,setup(e,{emit:t}){const n=e,r=t,s=y0(),{t:i}=r0(),o=Kl("tag"),a=Se(()=>{const{type:d,hit:m,effect:v,closable:x,round:p}=n;return[o.b(),o.is("closable",x),o.m(d||"primary"),o.m(s.value),o.m(v),o.is("hit",m),o.is("round",p)]}),l=d=>{r("close",d)},u=d=>{r("click",d)},c=d=>{var m,v,x;(x=(v=(m=d==null?void 0:d.component)==null?void 0:m.subTree)==null?void 0:v.component)!=null&&x.bum&&(d.component.subTree.component.bum=null)};return(d,m)=>e.disableTransitions?(ue(),ve("span",{key:0,class:rt(a.value),style:Fn({backgroundColor:e.color}),onClick:u},[pe("span",{class:rt(X(o).e("content"))},[qr(d.$slots,"default")],2),e.closable?(ue(),ve("button",{key:0,"aria-label":X(i)("el.tag.close"),class:rt(X(o).e("close")),type:"button",onClick:yo(l,["stop"])},[_e(X(Io),null,{default:wn(()=>[_e(X(Lo))]),_:1})],10,x0)):Cn("v-if",!0)],6)):(ue(),Jt(vf,{key:1,name:`${X(o).namespace.value}-zoom-in-center`,appear:"",onVnodeMounted:c},{default:wn(()=>[pe("span",{class:rt(a.value),style:Fn({backgroundColor:e.color}),onClick:u},[pe("span",{class:rt(X(o).e("content"))},[qr(d.$slots,"default")],2),e.closable?(ue(),ve("button",{key:0,"aria-label":X(i)("el.tag.close"),class:rt(X(o).e("close")),type:"button",onClick:yo(l,["stop"])},[_e(X(Io),null,{default:wn(()=>[_e(X(Lo))]),_:1})],10,S0)):Cn("v-if",!0)],6)]),_:3},8,["name"]))}}),T0=C0;const P0=Jl(T0),O0={toolbox:{get title(){return Z.t("tag.toolboxTitle")},icon:'<svg width="18" height="18" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><rect x="4" y="7" width="16" height="10" rx="5" ry="5" fill="none" stroke="currentColor" stroke-width="2"/><circle cx="8" cy="12" r="1.4" fill="currentColor"/></svg>'},propertyPanel:{get title(){return Z.t("tag.propertyPanelTitle")},get fields(){return[{key:"tagName",label:Z.t("tag.properties.tagName"),placeholder:Z.t("tag.defaultTagName")},{key:"type",label:Z.t("tag.properties.type"),type:"select",options:[{label:Z.t("tag.types.default"),value:""},{label:Z.t("tag.types.primary"),value:"primary"},{label:Z.t("tag.types.success"),value:"success"},{label:Z.t("tag.types.info"),value:"info"},{label:Z.t("tag.types.warning"),value:"warning"},{label:Z.t("tag.types.danger"),value:"danger"}]},{key:"size",label:Z.t("tag.properties.size"),type:"select",options:[{label:Z.t("tag.sizes.default"),value:""},{label:Z.t("tag.sizes.large"),value:"large"},{label:Z.t("tag.sizes.medium"),value:"default"},{label:Z.t("tag.sizes.small"),value:"small"}]},{key:"color",label:Z.t("tag.properties.color"),placeholder:Z.t("tag.properties.colorPlaceholder")},{key:"closable",label:Z.t("tag.properties.closable"),type:"checkbox"}]}},createInitialProps:()=>({tagName:Z.t("tag.defaultTagName"),closable:!1,size:"",color:"",type:"success"}),normalizeProps:e=>{var t;return{edit:e.edit??!1,tagName:((t=e.tagName)==null?void 0:t.trim())||Z.t("tag.defaultTagName"),closable:e.closable===!0,size:e.size??"",color:e.color??"",type:e.type??"success"}},serialize:e=>{var t;return{tagName:((t=e.tagName)==null?void 0:t.trim())||Z.t("tag.defaultTagName"),closable:e.closable??!1,size:e.size??"",color:e.color??"",type:e.type??""}}},E0=ct({__name:"MTag",props:{edit:{type:Boolean},tagName:{},closable:{type:Boolean},size:{},color:{},type:{},onChange:{type:Function},onToolChange:{type:Function}},setup(e){const t=e,n=we(null);let r=null;function s(u){var d,m;const c={edit:t.edit,tagName:t.tagName??"",closable:t.closable??!1,size:t.size??"",color:t.color??"",type:t.type??"",...u};(d=t.onToolChange)==null||d.call(t,c),(m=t.onChange)==null||m.call(t,c)}function i(){s({closable:t.closable??!1})}function o(){r!==null&&(window.clearTimeout(r),r=null)}function a(){var T;const u=n.value;if(!u)return;const c=u.closest(".ce-block"),d=(T=u.closest(".codex-editor"))==null?void 0:T.querySelector(".ce-toolbar"),m=d==null?void 0:d.querySelector(".ce-toolbar__plus");if(!c||!d||!m)return;const v=c.getBoundingClientRect(),x=u.getBoundingClientRect(),p=m.getBoundingClientRect().height||26,b=c.offsetTop+(x.top-v.top)+(x.height-p)/2;d.style.top=`${Math.round(b)}px`}function l(){o(),r=window.setTimeout(()=>{a()},0)}return br(()=>{Ln(()=>{var u,c;(u=n.value)==null||u.addEventListener("mouseenter",l),(c=n.value)==null||c.addEventListener("mousemove",l)})}),wr(()=>{var u,c;o(),(u=n.value)==null||u.removeEventListener("mouseenter",l),(c=n.value)==null||c.removeEventListener("mousemove",l)}),(u,c)=>(ue(),ve("div",{ref_key:"rootRef",ref:n,class:"ce-tag-tool","data-testid":"editor-tag-tool"},[_e(X(P0),{"data-testid":"editor-tag-value",closable:e.closable,size:e.size||void 0,color:e.color||void 0,type:e.type||void 0,onClose:i},{default:wn(()=>[gl(Fe(e.tagName),1)]),_:1},8,["closable","size","color","type"])],512))}}),A0=Cr(E0,[["__scopeId","data-v-f62600c2"]]),Ql={MInput:{component:kr(hh),...fh},MLink:{component:kr(yh),...gh},MTag:{component:kr(A0),...O0}};function Ng(){return Object.entries(Ql)}function Ro(e){return Ql[e]}function M0(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID().slice(0,10):Math.random().toString(36).slice(2,12)}function xi(e,t=M0()){return{id:t,type:"paragraph",data:{text:e}}}function tr(e){return typeof e.data.text=="string"?e.data.text:""}function Wl(){return[xi("")]}function D0(e){return JSON.parse(JSON.stringify(e))}function Gl(e){return typeof e!="object"||e===null||Array.isArray(e)?{}:D0(e)}function $0(e){return{id:e.id,type:e.type,data:Gl(e.data)}}function F0(e){const t=[];for(const n of e){if(n.type==="paragraph"){const r=t[t.length-1];(r==null?void 0:r.type)==="paragraph"?r.data.text=tr(r)+tr(n):t.push(xi(tr(n),n.id));continue}t.push($0(n))}return t.length?t:Wl()}function k0(e){if(!Array.isArray(e))return Wl();const t=[];return e.forEach(n=>{if(typeof n!="object"||n===null)return;const r=n;if(typeof r.id!="string"||typeof r.type!="string"||typeof r.data!="object"||r.data===null||Array.isArray(r.data))return;const s={id:r.id,type:r.type,data:Gl(r.data)};t.push(s.type==="paragraph"?xi(tr(s),s.id):s)}),F0(t)}const L0={class:"global-call-content","data-testid":"global-call-content"},I0={key:0,class:"global-call-content__text"},N0={key:0,class:"global-call-content__text"},R0={key:1,class:"global-call-content__token"},j0={key:2,class:"global-call-content__unknown"},H0=ct({__name:"GlobalCallContentRenderer",props:{content:{}},setup(e){const t=e,n=Se(()=>typeof t.content=="string"),r=Se(()=>typeof t.content=="string"?t.content:""),s=Se(()=>Array.isArray(t.content)?k0(t.content):[]);function i(l){var u;return((u=Ro(l))==null?void 0:u.component)??null}function o(l){return tr(l)}function a(l){var c;const u=Ro(l.type);return u?u.normalizeProps({...((c=u.createInitialProps)==null?void 0:c.call(u))??{},...l.data,edit:!1}):{edit:!1}}return(l,u)=>(ue(),ve("div",L0,[n.value?(ue(),ve("span",I0,Fe(r.value),1)):(ue(!0),ve(ke,{key:1},Qa(s.value,(c,d)=>(ue(),ve(ke,{key:`${c.id}-${c.type}-${d}`},[c.type==="paragraph"?(ue(),ve("span",N0,Fe(o(c)),1)):i(c.type)?(ue(),ve("span",R0,[(ue(),Jt(Cu(i(c.type)),fi({ref_for:!0},a(c)),null,16))])):(ue(),ve("span",j0,Fe(c.type),1))],64))),128))]))}}),jo=Cr(H0,[["__scopeId","data-v-66a3e1c9"]]),B0={class:"global-call-host","data-testid":"global-call-host"},z0={key:0,class:"global-call-dialog-overlay","data-testid":"global-call-dialog-overlay"},V0=["aria-label","aria-labelledby","data-testid"],q0=["id"],U0={class:"global-call-dialog__body","data-testid":"global-call-dialog-content"},K0={class:"global-call-dialog__actions"},J0=["aria-label"],Q0=["data-type"],W0=3e3,G0=ct({__name:"GlobalCallHost",setup(e,{expose:t}){const{t:n}=gi(),r=we(null),s=we([]),i=we(null),o=we([]),a=new Map;let l=0;const u=Se(()=>i.value?`global-call-dialog-title-${i.value.id}`:void 0);function c(g){return new Promise(M=>{s.value.push({id:v(),kind:"alert",title:g.title,content:g.content,resolve:M}),x()})}function d(g){return new Promise(M=>{s.value.push({id:v(),kind:"confirm",title:g.title,content:g.content,resolve:M}),x()})}function m(g){return new Promise(M=>{const j=v(),ee={id:j,type:g.type,content:g.content,resolve:M};o.value=[...o.value,ee],a.set(j,window.setTimeout(()=>{b(j)},W0))})}function v(){return l+=1,l}function x(){i.value||!s.value.length||(i.value=s.value.shift()??null,Ln(()=>{var g;(g=r.value)==null||g.focus()}))}function p(g){const M=i.value;M&&(i.value=null,M.kind==="confirm"?M.resolve(g):M.resolve(),Ln(()=>{x()}))}function b(g){const M=o.value.find(ee=>ee.id===g);if(!M)return;const j=a.get(g);j!==void 0&&(window.clearTimeout(j),a.delete(g)),o.value=o.value.filter(ee=>ee.id!==g),M.resolve()}function T(g){g.key==="Escape"&&(g.preventDefault(),p(!1))}function L(){var g;return((g=i.value)==null?void 0:g.kind)==="confirm"?n("globalCalls.confirmRoleLabel"):n("globalCalls.alertRoleLabel")}function D(g){return`global-call-message--${g}`}return wr(()=>{a.forEach(g=>{window.clearTimeout(g)}),a.clear()}),t({showAlert:c,showConfirm:d,showMessage:m}),(g,M)=>(ue(),ve("div",B0,[i.value?(ue(),ve("div",z0,[pe("section",{ref_key:"dialogPanelRef",ref:r,class:"global-call-dialog",role:"dialog","aria-modal":"true","aria-label":L(),"aria-labelledby":u.value,tabindex:"-1","data-testid":`global-call-${i.value.kind}`,onKeydown:T},[pe("h2",{id:u.value,class:"global-call-dialog__title","data-testid":"global-call-dialog-title"},Fe(i.value.title),9,q0),pe("div",U0,[_e(jo,{content:i.value.content},null,8,["content"])]),pe("div",K0,[i.value.kind==="confirm"?(ue(),ve("button",{key:0,type:"button",class:"global-call-dialog__button global-call-dialog__button--secondary","data-testid":"global-call-cancel",onClick:M[0]||(M[0]=j=>p(!1))},Fe(X(n)("globalCalls.cancel")),1)):Cn("",!0),pe("button",{type:"button",class:"global-call-dialog__button global-call-dialog__button--primary","data-testid":"global-call-ok",onClick:M[1]||(M[1]=j=>p(!0))},Fe(X(n)("globalCalls.ok")),1)])],40,V0)])):Cn("",!0),o.value.length?(ue(),ve("div",{key:1,class:"global-call-message-stack","data-testid":"global-call-message-stack","aria-label":X(n)("globalCalls.messageRoleLabel")},[(ue(!0),ve(ke,null,Qa(o.value,j=>(ue(),ve("div",{key:j.id,class:rt(["global-call-message",D(j.type)]),role:"status","data-type":j.type,"data-testid":"global-call-message"},[_e(jo,{content:j.content},null,8,["content"])],10,Q0))),128))],8,J0)):Cn("",!0)]))}}),Y0=Cr(G0,[["__scopeId","data-v-81ffa7d1"]]);function ot(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Rn(e){return e===null||typeof e=="string"||typeof e=="boolean"?!0:typeof e=="number"?Number.isFinite(e):Array.isArray(e)?e.every(t=>Rn(t)):ot(e)?Object.values(e).every(t=>Rn(t)):!1}function Z0(e){return ot(e)&&Rn(e)}function Wr(e){return JSON.parse(JSON.stringify(e))}function Ho(e){return JSON.parse(JSON.stringify(e))}function Yl(e){return JSON.parse(JSON.stringify(e))}function mn(e,t){return Object.keys(e).every(n=>t.includes(n))}function Kn(e,t){if(t===void 0)return e;if(typeof t=="string")return{...e,description:t}}function Us(e){if(!(!ot(e)||typeof e.type!="string")){if(e.type==="object"){if(!mn(e,["type","properties","required","description"])||!ot(e.properties))return;const t={};for(const[r,s]of Object.entries(e.properties)){const i=Us(s);if(!i)return;t[r]=i}const n={type:"object",properties:t};if(e.required!==void 0){if(!Array.isArray(e.required)||!e.required.every(r=>typeof r=="string"))return;n.required=[...e.required]}return Kn(n,e.description)}if(e.type==="array"){if(!mn(e,["type","items","description"]))return;const t=Us(e.items);return t?Kn({type:"array",items:t},e.description):void 0}if(e.type==="string"){if(!mn(e,["type","enum","description"]))return;const t={type:"string"};if(e.enum!==void 0){if(!Array.isArray(e.enum)||!e.enum.every(n=>typeof n=="string"))return;t.enum=[...e.enum]}return Kn(t,e.description)}if(e.type==="number"){if(!mn(e,["type","minimum","maximum","description"]))return;const t={type:"number"};if(e.minimum!==void 0){if(typeof e.minimum!="number"||!Number.isFinite(e.minimum))return;t.minimum=e.minimum}if(e.maximum!==void 0){if(typeof e.maximum!="number"||!Number.isFinite(e.maximum))return;t.maximum=e.maximum}return Kn(t,e.description)}if(e.type==="boolean")return mn(e,["type","description"])?Kn({type:"boolean"},e.description):void 0;if(e.type==="null"&&mn(e,["type"]))return{type:"null"}}}function Ks(e,t){if(e.type===t.type){if(e.type==="object"&&t.type==="object"){const n={},r=new Set([...Object.keys(e.properties),...Object.keys(t.properties)]);for(const s of r){const i=e.properties[s],o=t.properties[s];if(i&&o){const a=Ks(i,o);if(!a)return;n[s]=a;continue}n[s]=Ho(i??o)}return{type:"object",properties:n}}if(e.type==="array"&&t.type==="array"){const n=Ks(e.items,t.items);return n?{type:"array",items:n}:void 0}return Ho(e)}}function Js(e){if(e===null)return{ok:!0,schema:{type:"null"}};if(typeof e=="string")return{ok:!0,schema:{type:"string"}};if(typeof e=="number")return{ok:!0,schema:{type:"number"}};if(typeof e=="boolean")return{ok:!0,schema:{type:"boolean"}};if(Array.isArray(e)){if(!e.length)return{ok:!1,reason:"emptyArray"};let n;for(const r of e){const s=Js(r);if(!s.ok)return s;if(!n){n=s.schema;continue}const i=Ks(n,s.schema);if(!i)return{ok:!1,reason:"mixedArray"};n=i}return{ok:!0,schema:{type:"array",items:n}}}const t={};for(const[n,r]of Object.entries(e)){const s=Js(r);if(!s.ok)return s;t[n]=s.schema}return{ok:!0,schema:{type:"object",properties:t}}}function Si(e,t){return e?`${e}.${t}`:t}function Zl(e){return e?`${e}[]`:"[]"}function hs(e){return e.replace(/\[\]/g,"").split(".").filter(Boolean).pop()||e||"root"}function Ci(e){return e==="number"?"number":e==="boolean"?"switch":e==="object"?"object":e==="array"?"array":"text"}function Xl(e){return e==="string"||e==="number"||e==="boolean"||e==="null"}function ec(e,t,n=hs(e.path)){return{path:e.path,label:n,type:e.type,required:e.required,enabled:t,componentHint:e.componentHint}}function Qs(e,t="",n=0,r=!1){if(!e)return[];const s=t?hs(t):"root",i={path:t,displayPath:t||"root",name:s,type:e.type,required:r,selectable:Xl(e.type),componentHint:Ci(e.type),depth:n,children:[]};if(e.type==="object"){const o=new Set(e.required??[]);i.children=Object.entries(e.properties).flatMap(([a,l])=>Qs(l,Si(t,a),n+1,o.has(a)))}if(e.type==="array"){const o=Zl(t);i.children=Qs(e.items,o,n+1,r)}return[i]}function tc(e){return e.flatMap(t=>[t,...tc(t.children)])}function nc(e){if(!e)return[];const t=[];function n(r,s){if(r.type==="array"){t.push({path:s,label:s?`${s}[]`:"root[]"}),n(r.items,Zl(s));return}r.type==="object"&&Object.entries(r.properties).forEach(([i,o])=>{n(o,Si(s,i))})}return n(e,""),t}function X0(e,t){if(!e)return;if(!t)return e.type==="array"?e.items:void 0;const n=t.split(".").filter(Boolean);let r=e;for(const s of n){if(!r||r.type!=="object")return;r=r.properties[s]}return(r==null?void 0:r.type)==="array"?r.items:void 0}function eg(e,t="",n=!1){return tc(Qs(e,t)).filter(r=>(n||r.path!==t)&&r.selectable)}function tg(e,t){const n=X0(e,t),r=t?`${t}[]`:"[]";return eg(n,r,!0).map(s=>ec(s,!0))}function ng(e){const t=(e==null?void 0:e.type)==="array"?e.items:e;if((t==null?void 0:t.type)!=="object")return[];const n=[];function r(s,i,o){if(Xl(s.type)){n.push(ec({path:i,name:hs(i),type:s.type,required:o,componentHint:Ci(s.type)},!0));return}if(s.type!=="object")return;const a=new Set(s.required??[]);Object.entries(s.properties).forEach(([l,u])=>{r(u,Si(i,l),a.has(l))})}return Object.entries(t.properties).forEach(([s,i])=>{r(i,s,(t.required??[]).includes(s))}),n}function Ws(e,t){if(!ot(e))return t?Yl(t):void 0;const n=typeof e.path=="string"&&e.path?e.path:t==null?void 0:t.path;if(!n)return;const r=e.type==="object"||e.type==="array"||e.type==="string"||e.type==="number"||e.type==="boolean"||e.type==="null"?e.type:(t==null?void 0:t.type)??"string",s=typeof e.label=="string"&&e.label.trim()?e.label.trim():(t==null?void 0:t.label)??hs(n),i=typeof e.required=="boolean"?e.required:(t==null?void 0:t.required)??!1,o=typeof e.enabled=="boolean"?e.enabled:(t==null?void 0:t.enabled)??!0,a=e.componentHint==="text"||e.componentHint==="number"||e.componentHint==="switch"||e.componentHint==="object"||e.componentHint==="array"?e.componentHint:(t==null?void 0:t.componentHint)??Ci(r);return{path:n,label:s,type:r,required:i,enabled:o,componentHint:a}}function Bo(e,t){const n=new Map;return Array.isArray(t)&&t.forEach(r=>{const s=Ws(r);s&&n.set(s.path,s)}),e.map(r=>{const s=n.get(r.path);return s?{...r,label:s.label||r.label,enabled:s.enabled}:Yl(r)})}function rg(e){var n;const t=nc(e);return t.length===1?t[0].path:((n=t[0])==null?void 0:n.path)??""}function zo(e,t){var l,u,c;if(!e)return;const n=nc(e),r=((l=t==null?void 0:t.list)==null?void 0:l.recordPath)??"",s=n.some(d=>d.path===r)?r:rg(e),i=n.length?Bo(tg(e,s),(u=t==null?void 0:t.list)==null?void 0:u.fields):[],o=Bo(ng(e),(c=t==null?void 0:t.form)==null?void 0:c.fields),a={};return n.length&&(a.list={recordPath:s,fields:i}),o.length&&(a.form={fields:o}),a.list||a.form?a:void 0}function sg(e,t){if(!ot(e))return t?zo(t):void 0;const n={};return ot(e.list)&&(n.list={recordPath:typeof e.list.recordPath=="string"?e.list.recordPath:"",fields:Array.isArray(e.list.fields)?e.list.fields.map(r=>Ws(r)).filter(r=>r!==void 0):[]}),ot(e.form)&&(n.form={fields:Array.isArray(e.form.fields)?e.form.fields.map(r=>Ws(r)).filter(r=>r!==void 0):[]}),t?zo(t,n):n.list||n.form?n:void 0}class nn extends Error{constructor(n,r,s){super(r);Tr(this,"code");Tr(this,"status");Tr(this,"statusText");this.name="DatasourceError",this.code=n,this.status=s==null?void 0:s.status,this.statusText=s==null?void 0:s.statusText}}const ig=["string","number","boolean","null","object","array"];function jn(e){return typeof e=="string"?e:""}function og(e){return e==="POST"?"POST":"GET"}function ag(e){return ig.includes(e)?e:"string"}function lg(e,t={}){return Rn(e)?Wr(e):t}function Rg(e){return e==="number"?0:e==="boolean"?!1:e==="null"?null:e==="object"?{}:e==="array"?[]:""}function rc(e,t){return e==="string"?typeof t=="string"?t:jn(t):e==="number"?typeof t=="number"&&Number.isFinite(t)?t:0:e==="boolean"?typeof t=="boolean"?t:!1:e==="null"?null:e==="object"?Z0(t)?Wr(t):{}:Array.isArray(t)&&Rn(t)?Wr(t):[]}function Vo(e){return Array.isArray(e)?e.filter(t=>ot(t)).map(t=>({key:jn(t.key),mock:jn(t.mock)})):[]}function cg(e){return Array.isArray(e)?e.filter(t=>ot(t)).map(t=>{const n=ag(t.dataType);return{key:jn(t.key),dataType:n,mock:rc(n,t.mock)}}):[]}function jg(){return{type:"API",domain:"",path:"",method:"GET",headerData:[],bodyData:[],queryData:[]}}function ug(){return{type:"JSON",rawData:{}}}function fg(e){if(!ot(e))return ug();const t=Us(e.jsonSchema),n=sg(e.schemaSelections,t);if(e.type==="API"){const s={type:"API",domain:jn(e.domain),path:jn(e.path),method:og(e.method),headerData:Vo(e.headerData),bodyData:cg(e.bodyData),queryData:Vo(e.queryData)};return t&&(s.jsonSchema=t),n&&(s.schemaSelections=n),s}const r={type:"JSON",rawData:lg(e.rawData,{})};return t&&(r.jsonSchema=t),n&&(r.schemaSelections=n),r}function dg(e){const t=e.domain.trim(),n=e.path.trim(),r=/^[a-z][a-z\d+\-.]*:/i.test(n),s=t||(typeof window<"u"?window.location.origin:"");if(!s&&!r)throw new TypeError("API domain is required when calling a relative datasource path outside the browser.");const i=s?new URL(n||"/",s.endsWith("/")?s:`${s}/`):new URL(n||"/");return e.queryData.forEach(o=>{const a=o.key.trim();a&&i.searchParams.append(a,o.mock)}),i.toString()}function hg(e){const t=new Headers;return e.headerData.forEach(n=>{const r=n.key.trim();r&&t.set(r,n.mock)}),e.method==="POST"&&!t.has("Content-Type")&&t.set("Content-Type","application/json"),t}function pg(e){if(e.method!=="POST")return;const t=e.bodyData.reduce((n,r)=>{const s=r.key.trim();return s&&(n[s]=rc(r.dataType,r.mock)),n},{});return JSON.stringify(t)}async function gg(e){if(!(e.headers.get("content-type")??"").toLowerCase().includes("json"))throw new nn("nonJsonResponse","The API response is not JSON.");try{const n=await e.json();if(!Rn(n))throw new nn("invalidJsonResponse","The API response is not valid JSON.");return n}catch(n){throw n instanceof nn?n:new nn("invalidJsonResponse","The API response is not valid JSON.")}}const Ti=async e=>{const t=fg(e);if(t.type==="JSON")return Wr(t.rawData);const n=await fetch(dg(t),{method:t.method,headers:hg(t),body:pg(t)});if(!n.ok)throw new nn("apiRequestFailed",`API request failed: ${n.status} ${n.statusText}`.trim(),{status:n.status,statusText:n.statusText});return await gg(n)},sc=async e=>{const t=await Ti(e),n=Js(t);if(n.ok)return n.schema;throw n.reason==="emptyArray"?new nn("emptyArraySchema","Cannot infer JSON Schema from an empty array."):new nn("mixedArraySchema","The array contains incompatible types, so JSON Schema cannot be inferred.")},mg=new Set(["success","warning","info","error"]);let qo=null,$r=null,Fr=null;const ic=(function(t,n){return Pi(r=>r.showAlert(lc(t,n)))}),oc=(function(t,n){return Pi(r=>r.showConfirm(lc(t,n)))}),ac=(function(t,n){return Pi(r=>r.showMessage(wg(t,n)))});function yg(e){e.config.globalProperties.$alert=ic,e.config.globalProperties.$confirm=oc,e.config.globalProperties.$message=ac,e.config.globalProperties.$remote=Ti,e.config.globalProperties.$schema=sc,vg()}const _g={install:yg};function vg(){if(typeof window>"u")return;const e=window;e.$alert=ic,e.$confirm=oc,e.$message=ac,e.$remote=Ti,e.$schema=sc}function Pi(e){try{return e(bg())}catch(t){return Promise.reject(t)}}function bg(){if($r)return $r;if(typeof document>"u")throw new Error("Global call functions require a browser document.");return Fr=document.createElement("div"),Fr.setAttribute("data-testid","global-call-host-container"),document.body.appendChild(Fr),qo=bl(Y0),$r=qo.mount(Fr),$r}function lc(e,t){return typeof e=="object"&&e!==null?{title:String(e.title??""),content:Gr(e.content)}:{title:e,content:Gr(t)}}function wg(e,t){return typeof e=="object"&&e!==null?{type:Uo(e.type),content:Gr(e.content)}:{type:Uo(e),content:Gr(t)}}function Gr(e){return typeof e=="string"||Array.isArray(e)?e:""}function Uo(e){return mg.has(e)?e:"info"}const Oi=bl(lh),xg=new $l;Oi.use(Pd,{queryClient:xg});Oi.use(_g);Oi.mount("#app");function Sg(){if(!("serviceWorker"in navigator))return;const e=`/sw.js?v=${encodeURIComponent("2026-05-06T03:19:02.362Z")}`;let t=!1;const n=r=>{r.waiting&&r.waiting.postMessage({type:"SKIP_WAITING"})};navigator.serviceWorker.addEventListener("controllerchange",()=>{t||(t=!0,window.location.reload())}),window.addEventListener("load",async()=>{try{const r=await navigator.serviceWorker.register(e);n(r),r.addEventListener("updatefound",()=>{const s=r.installing;s&&s.addEventListener("statechange",()=>{s.state==="installed"&&navigator.serviceWorker.controller&&n(r)})}),window.setInterval(()=>{r.update().catch(()=>{})},60*1e3)}catch(r){console.error("Service worker registration failed:",r)}})}Sg();export{sc as $,Gl as A,bl as B,Fg as C,Wl as D,Z as E,ke as F,F0 as G,M0 as H,$0 as I,xi as J,fg as K,Jc as L,si as M,jg as N,rc as O,ig as P,tc as Q,nc as R,Rn as S,Wr as T,Us as U,zo as V,og as W,ag as X,Rg as Y,Z0 as Z,Cr as _,_e as a,ug as a0,Qs as a1,lg as a2,Ho as a3,sg as a4,nn as a5,Og as a6,$g as a7,O0 as a8,gh as a9,fh as aa,kr as ab,A0 as ac,yh as ad,hh as ae,Bi as af,Eo as ag,ff as ah,pe as b,ve as c,ct as d,Cn as e,gi as f,Jt as g,Se as h,br as i,wr as j,Lr as k,k0 as l,Fn as m,Ln as n,ue as o,Qa as p,Ng as q,we as r,fi as s,Fe as t,X as u,Cu as v,yo as w,rt as x,tr as y,Ro as z};
18
+ **/let js;const Xi=typeof window<"u"&&window.trustedTypes;if(Xi)try{js=Xi.createPolicy("vue",{createHTML:e=>e})}catch{}const _l=js?e=>js.createHTML(e):e=>e,pf="http://www.w3.org/2000/svg",gf="http://www.w3.org/1998/Math/MathML",At=typeof document<"u"?document:null,eo=At&&At.createElement("template"),mf={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const s=t==="svg"?At.createElementNS(pf,e):t==="mathml"?At.createElementNS(gf,e):n?At.createElement(e,{is:n}):At.createElement(e);return e==="select"&&r&&r.multiple!=null&&s.setAttribute("multiple",r.multiple),s},createText:e=>At.createTextNode(e),createComment:e=>At.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>At.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,s,i){const o=n?n.previousSibling:t.lastChild;if(s&&(s===i||s.nextSibling))for(;t.insertBefore(s.cloneNode(!0),n),!(s===i||!(s=s.nextSibling)););else{eo.innerHTML=_l(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const a=eo.content;if(r==="svg"||r==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}t.insertBefore(a,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Nt="transition",qn="animation",lr=Symbol("_vtc"),vl={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},yf=Oe({},ja,vl),_f=e=>(e.displayName="Transition",e.props=yf,e),vf=_f((e,{slots:t})=>ff(hu,bf(e),t)),Yt=(e,t=[])=>{q(e)?e.forEach(n=>n(...t)):e&&e(...t)},to=e=>e?q(e)?e.some(t=>t.length>1):e.length>1:!1;function bf(e){const t={};for(const R in e)R in vl||(t[R]=e[R]);if(e.css===!1)return t;const{name:n="v",type:r,duration:s,enterFromClass:i=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=i,appearActiveClass:u=o,appearToClass:c=a,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:m=`${n}-leave-active`,leaveToClass:v=`${n}-leave-to`}=e,x=wf(s),p=x&&x[0],b=x&&x[1],{onBeforeEnter:T,onEnter:L,onEnterCancelled:D,onLeave:g,onLeaveCancelled:M,onBeforeAppear:j=T,onAppear:ee=L,onAppearCancelled:ne=D}=t,B=(R,de,H,k)=>{R._enterCancelled=k,Zt(R,de?c:a),Zt(R,de?u:o),H&&H()},U=(R,de)=>{R._isLeaving=!1,Zt(R,d),Zt(R,v),Zt(R,m),de&&de()},z=R=>(de,H)=>{const k=R?ee:L,E=()=>B(de,R,H);Yt(k,[de,E]),no(()=>{Zt(de,R?l:i),Ot(de,R?c:a),to(k)||ro(de,r,p,E)})};return Oe(t,{onBeforeEnter(R){Yt(T,[R]),Ot(R,i),Ot(R,o)},onBeforeAppear(R){Yt(j,[R]),Ot(R,l),Ot(R,u)},onEnter:z(!1),onAppear:z(!0),onLeave(R,de){R._isLeaving=!0;const H=()=>U(R,de);Ot(R,d),R._enterCancelled?(Ot(R,m),oo(R)):(oo(R),Ot(R,m)),no(()=>{R._isLeaving&&(Zt(R,d),Ot(R,v),to(g)||ro(R,r,b,H))}),Yt(g,[R,H])},onEnterCancelled(R){B(R,!1,void 0,!0),Yt(D,[R])},onAppearCancelled(R){B(R,!0,void 0,!0),Yt(ne,[R])},onLeaveCancelled(R){U(R),Yt(M,[R])}})}function wf(e){if(e==null)return null;if(ce(e))return[Ts(e.enter),Ts(e.leave)];{const t=Ts(e);return[t,t]}}function Ts(e){return mc(e)}function Ot(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[lr]||(e[lr]=new Set)).add(t)}function Zt(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[lr];n&&(n.delete(t),n.size||(e[lr]=void 0))}function no(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let xf=0;function ro(e,t,n,r){const s=e._endId=++xf,i=()=>{s===e._endId&&r()};if(n!=null)return setTimeout(i,n);const{type:o,timeout:a,propCount:l}=Sf(e,t);if(!o)return r();const u=o+"end";let c=0;const d=()=>{e.removeEventListener(u,m),i()},m=v=>{v.target===e&&++c>=l&&d()};setTimeout(()=>{c<l&&d()},a+1),e.addEventListener(u,m)}function Sf(e,t){const n=window.getComputedStyle(e),r=x=>(n[x]||"").split(", "),s=r(`${Nt}Delay`),i=r(`${Nt}Duration`),o=so(s,i),a=r(`${qn}Delay`),l=r(`${qn}Duration`),u=so(a,l);let c=null,d=0,m=0;t===Nt?o>0&&(c=Nt,d=o,m=i.length):t===qn?u>0&&(c=qn,d=u,m=l.length):(d=Math.max(o,u),c=d>0?o>u?Nt:qn:null,m=c?c===Nt?i.length:l.length:0);const v=c===Nt&&/\b(?:transform|all)(?:,|$)/.test(r(`${Nt}Property`).toString());return{type:c,timeout:d,propCount:m,hasTransform:v}}function so(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>io(n)+io(e[r])))}function io(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function oo(e){return(e?e.ownerDocument:document).body.offsetHeight}function Cf(e,t,n){const r=e[lr];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const ao=Symbol("_vod"),Tf=Symbol("_vsh");const Pf=Symbol(""),Of=/(?:^|;)\s*display\s*:/;function Ef(e,t,n){const r=e.style,s=fe(n);let i=!1;if(n&&!s){if(t)if(fe(t))for(const o of t.split(";")){const a=o.slice(0,o.indexOf(":")).trim();n[a]==null&&Qn(r,a,"")}else for(const o in t)n[o]==null&&Qn(r,o,"");for(const o in n){o==="display"&&(i=!0);const a=n[o];a!=null?Mf(e,o,!fe(t)&&t?t[o]:void 0,a)||Qn(r,o,a):Qn(r,o,"")}}else if(s){if(t!==n){const o=r[Pf];o&&(n+=";"+o),r.cssText=n,i=Of.test(n)}}else t&&e.removeAttribute("style");ao in e&&(e[ao]=i?r.display:"",e[Tf]&&(r.display="none"))}const lo=/\s*!important$/;function Qn(e,t,n){if(q(n))n.forEach(r=>Qn(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=Af(e,t);lo.test(n)?e.setProperty(hn(r),n.replace(lo,""),"important"):e[r]=n}}const co=["Webkit","Moz","ms"],Ps={};function Af(e,t){const n=Ps[t];if(n)return n;let r=Ve(t);if(r!=="filter"&&r in e)return Ps[t]=r;r=ts(r);for(let s=0;s<co.length;s++){const i=co[s]+r;if(i in e)return Ps[t]=i}return t}function Mf(e,t,n,r){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&fe(r)&&n===r}const uo="http://www.w3.org/1999/xlink";function fo(e,t,n,r,s,i=xc(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(uo,t.slice(6,t.length)):e.setAttributeNS(uo,t,n):n==null||i&&!aa(n)?e.removeAttribute(t):e.setAttribute(t,i?"":Ge(n)?String(n):n)}function ho(e,t,n,r,s){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?_l(n):n);return}const i=e.tagName;if(t==="value"&&i!=="PROGRESS"&&!i.includes("-")){const a=i==="OPTION"?e.getAttribute("value")||"":e.value,l=n==null?e.type==="checkbox"?"on":"":String(n);(a!==l||!("_value"in e))&&(e.value=l),n==null&&e.removeAttribute(t),e._value=n;return}let o=!1;if(n===""||n==null){const a=typeof e[t];a==="boolean"?n=aa(n):n==null&&a==="string"?(n="",o=!0):a==="number"&&(n=0,o=!0)}try{e[t]=n}catch{}o&&e.removeAttribute(s||t)}function Df(e,t,n,r){e.addEventListener(t,n,r)}function $f(e,t,n,r){e.removeEventListener(t,n,r)}const po=Symbol("_vei");function Ff(e,t,n,r,s=null){const i=e[po]||(e[po]={}),o=i[t];if(r&&o)o.value=r;else{const[a,l]=kf(t);if(r){const u=i[t]=Nf(r,s);Df(e,a,u,l)}else o&&($f(e,a,o,l),i[t]=void 0)}}const go=/(?:Once|Passive|Capture)$/;function kf(e){let t;if(go.test(e)){t={};let r;for(;r=e.match(go);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):hn(e.slice(2)),t]}let Os=0;const Lf=Promise.resolve(),If=()=>Os||(Lf.then(()=>Os=0),Os=Date.now());function Nf(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;lt(Rf(r,n.value),t,5,[r])};return n.value=e,n.attached=If(),n}function Rf(e,t){if(q(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(r=>s=>!s._stopped&&r&&r(s))}else return t}const mo=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,jf=(e,t,n,r,s,i)=>{const o=s==="svg";t==="class"?Cf(e,r,o):t==="style"?Ef(e,n,r):Yr(t)?Zr(t)||Ff(e,t,n,r,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Hf(e,t,r,o))?(ho(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&fo(e,t,r,o,i,t!=="value")):e._isVueCE&&(Bf(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!fe(r)))?ho(e,Ve(t),r,i,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),fo(e,t,r,o))};function Hf(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&mo(t)&&Y(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const s=e.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return mo(t)&&fe(n)?!1:t in e}function Bf(e,t){const n=e._def.props;if(!n)return!1;const r=Ve(t);return Array.isArray(n)?n.some(s=>Ve(s)===r):Object.keys(n).some(s=>Ve(s)===r)}const zf=["ctrl","shift","alt","meta"],Vf={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>zf.some(n=>e[`${n}Key`]&&!t.includes(n))},yo=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=((s,...i)=>{for(let o=0;o<t.length;o++){const a=Vf[t[o]];if(a&&a(s,t))return}return e(s,...i)}))};const qf=Oe({patchProp:jf},mf);let _o;function Uf(){return _o||(_o=Ju(qf))}const bl=((...e)=>{const t=Uf().createApp(...e),{mount:n}=t;return t.mount=r=>{const s=Jf(r);if(!s)return;const i=t._component;!Y(i)&&!i.render&&!i.template&&(i.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const o=n(s,!1,Kf(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),o},t});function Kf(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Jf(e){return fe(e)?document.querySelector(e):e}var us=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},rn,Bt,Tn,Ko,Qf=(Ko=class extends us{constructor(){super();re(this,rn);re(this,Bt);re(this,Tn);G(this,Tn,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){_(this,Bt)||this.setEventListener(_(this,Tn))}onUnsubscribe(){var t;this.hasListeners()||((t=_(this,Bt))==null||t.call(this),G(this,Bt,void 0))}setEventListener(t){var n;G(this,Tn,t),(n=_(this,Bt))==null||n.call(this),G(this,Bt,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){_(this,rn)!==t&&(G(this,rn,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof _(this,rn)=="boolean"?_(this,rn):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},rn=new WeakMap,Bt=new WeakMap,Tn=new WeakMap,Ko),wl=new Qf,Wf={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},zt,Gs,Jo,Gf=(Jo=class{constructor(){re(this,zt,Wf);re(this,Gs,!1)}setTimeoutProvider(e){G(this,zt,e)}setTimeout(e,t){return _(this,zt).setTimeout(e,t)}clearTimeout(e){_(this,zt).clearTimeout(e)}setInterval(e,t){return _(this,zt).setInterval(e,t)}clearInterval(e){_(this,zt).clearInterval(e)}},zt=new WeakMap,Gs=new WeakMap,Jo),Hs=new Gf;function Yf(e){setTimeout(e,0)}var xl=typeof window>"u"||"Deno"in globalThis;function tt(){}function Zf(e,t){return typeof e=="function"?e(t):e}function Xf(e){return typeof e=="number"&&e>=0&&e!==1/0}function ed(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Bs(e,t){return typeof e=="function"?e(t):e}function td(e,t){return typeof e=="function"?e(t):e}function vo(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:o,stale:a}=e;if(o){if(r){if(t.queryHash!==hi(o,t.options))return!1}else if(!ur(t.queryKey,o))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||s&&s!==t.state.fetchStatus||i&&!i(t))}function bo(e,t){const{exact:n,status:r,predicate:s,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(cr(t.options.mutationKey)!==cr(i))return!1}else if(!ur(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function hi(e,t){return((t==null?void 0:t.queryKeyHashFn)||cr)(e)}function cr(e){return JSON.stringify(e,(t,n)=>zs(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function ur(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>ur(e[n],t[n])):!1}var nd=Object.prototype.hasOwnProperty;function Sl(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=wo(e)&&wo(t);if(!r&&!(zs(e)&&zs(t)))return t;const i=(r?e:Object.keys(e)).length,o=r?t:Object.keys(t),a=o.length,l=r?new Array(a):{};let u=0;for(let c=0;c<a;c++){const d=r?c:o[c],m=e[d],v=t[d];if(m===v){l[d]=m,(r?c<i:nd.call(e,d))&&u++;continue}if(m===null||v===null||typeof m!="object"||typeof v!="object"){l[d]=v;continue}const x=Sl(m,v,n+1);l[d]=x,x===m&&u++}return i===a&&u===i?e:l}function wo(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function zs(e){if(!xo(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!xo(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function xo(e){return Object.prototype.toString.call(e)==="[object Object]"}function rd(e){return new Promise(t=>{Hs.setTimeout(t,e)})}function sd(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Sl(e,t):t}function id(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function od(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var pi=Symbol();function Cl(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===pi?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ad(e,t,n){let r=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=t()),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),e}var Tl=(()=>{let e=()=>xl;return{isServer(){return e()},setIsServer(t){e=t}}})();function ld(){let e,t;const n=new Promise((s,i)=>{e=s,t=i});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}var cd=Yf;function ud(){let e=[],t=0,n=a=>{a()},r=a=>{a()},s=cd;const i=a=>{t?e.push(a):s(()=>{n(a)})},o=()=>{const a=e;e=[],a.length&&s(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||o()}return l},batchCalls:a=>(...l)=>{i(()=>{a(...l)})},schedule:i,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{s=a}}}var Be=ud(),Pn,Vt,On,Qo,fd=(Qo=class extends us{constructor(){super();re(this,Pn,!0);re(this,Vt);re(this,On);G(this,On,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){_(this,Vt)||this.setEventListener(_(this,On))}onUnsubscribe(){var t;this.hasListeners()||((t=_(this,Vt))==null||t.call(this),G(this,Vt,void 0))}setEventListener(t){var n;G(this,On,t),(n=_(this,Vt))==null||n.call(this),G(this,Vt,t(this.setOnline.bind(this)))}setOnline(t){_(this,Pn)!==t&&(G(this,Pn,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return _(this,Pn)}},Pn=new WeakMap,Vt=new WeakMap,On=new WeakMap,Qo),Qr=new fd;function dd(e){return Math.min(1e3*2**e,3e4)}function Pl(e){return(e??"online")==="online"?Qr.isOnline():!0}var Vs=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Ol(e){let t=!1,n=0,r;const s=ld(),i=()=>s.status!=="pending",o=p=>{var b;if(!i()){const T=new Vs(p);m(T),(b=e.onCancel)==null||b.call(e,T)}},a=()=>{t=!0},l=()=>{t=!1},u=()=>wl.isFocused()&&(e.networkMode==="always"||Qr.isOnline())&&e.canRun(),c=()=>Pl(e.networkMode)&&e.canRun(),d=p=>{i()||(r==null||r(),s.resolve(p))},m=p=>{i()||(r==null||r(),s.reject(p))},v=()=>new Promise(p=>{var b;r=T=>{(i()||u())&&p(T)},(b=e.onPause)==null||b.call(e)}).then(()=>{var p;r=void 0,i()||(p=e.onContinue)==null||p.call(e)}),x=()=>{if(i())return;let p;const b=n===0?e.initialPromise:void 0;try{p=b??e.fn()}catch(T){p=Promise.reject(T)}Promise.resolve(p).then(d).catch(T=>{var j;if(i())return;const L=e.retry??(Tl.isServer()?0:3),D=e.retryDelay??dd,g=typeof D=="function"?D(n,T):D,M=L===!0||typeof L=="number"&&n<L||typeof L=="function"&&L(n,T);if(t||!M){m(T);return}n++,(j=e.onFail)==null||j.call(e,n,T),rd(g).then(()=>u()?void 0:v()).then(()=>{t?m(T):x()})})};return{promise:s,status:()=>s.status,cancel:o,continue:()=>(r==null||r(),s),cancelRetry:a,continueRetry:l,canStart:c,start:()=>(c()?x():v().then(x),s)}}var sn,Wo,El=(Wo=class{constructor(){re(this,sn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Xf(this.gcTime)&&G(this,sn,Hs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Tl.isServer()?1/0:300*1e3))}clearGcTimeout(){_(this,sn)!==void 0&&(Hs.clearTimeout(_(this,sn)),G(this,sn,void 0))}},sn=new WeakMap,Wo),on,En,et,an,Ae,hr,ln,Je,Al,Et,Go,hd=(Go=class extends El{constructor(t){super();re(this,Je);re(this,on);re(this,En);re(this,et);re(this,an);re(this,Ae);re(this,hr);re(this,ln);G(this,ln,!1),G(this,hr,t.defaultOptions),this.setOptions(t.options),this.observers=[],G(this,an,t.client),G(this,et,_(this,an).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,G(this,on,Co(this.options)),this.state=t.state??_(this,on),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=_(this,Ae))==null?void 0:t.promise}setOptions(t){if(this.options={..._(this,hr),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=Co(this.options);n.data!==void 0&&(this.setState(So(n.data,n.dataUpdatedAt)),G(this,on,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&_(this,et).remove(this)}setData(t,n){const r=sd(this.state.data,t,this.options);return $e(this,Je,Et).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){$e(this,Je,Et).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,s;const n=(r=_(this,Ae))==null?void 0:r.promise;return(s=_(this,Ae))==null||s.cancel(t),n?n.then(tt).catch(tt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return _(this,on)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>td(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===pi||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Bs(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!ed(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=_(this,Ae))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=_(this,Ae))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),_(this,et).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(_(this,Ae)&&(_(this,ln)||$e(this,Je,Al).call(this)?_(this,Ae).cancel({revert:!0}):_(this,Ae).cancelRetry()),this.scheduleGc()),_(this,et).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||$e(this,Je,Et).call(this,{type:"invalidate"})}async fetch(t,n){var l,u,c,d,m,v,x,p,b,T,L,D;if(this.state.fetchStatus!=="idle"&&((l=_(this,Ae))==null?void 0:l.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(_(this,Ae))return _(this,Ae).continueRetry(),_(this,Ae).promise}if(t&&this.setOptions(t),!this.options.queryFn){const g=this.observers.find(M=>M.options.queryFn);g&&this.setOptions(g.options)}const r=new AbortController,s=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>(G(this,ln,!0),r.signal)})},i=()=>{const g=Cl(this.options,n),j=(()=>{const ee={client:_(this,an),queryKey:this.queryKey,meta:this.meta};return s(ee),ee})();return G(this,ln,!1),this.options.persister?this.options.persister(g,j,this):g(j)},a=(()=>{const g={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:_(this,an),state:this.state,fetchFn:i};return s(g),g})();(u=this.options.behavior)==null||u.onFetch(a,this),G(this,En,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=a.fetchOptions)==null?void 0:c.meta))&&$e(this,Je,Et).call(this,{type:"fetch",meta:(d=a.fetchOptions)==null?void 0:d.meta}),G(this,Ae,Ol({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,onCancel:g=>{g instanceof Vs&&g.revert&&this.setState({..._(this,En),fetchStatus:"idle"}),r.abort()},onFail:(g,M)=>{$e(this,Je,Et).call(this,{type:"failed",failureCount:g,error:M})},onPause:()=>{$e(this,Je,Et).call(this,{type:"pause"})},onContinue:()=>{$e(this,Je,Et).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const g=await _(this,Ae).start();if(g===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(g),(v=(m=_(this,et).config).onSuccess)==null||v.call(m,g,this),(p=(x=_(this,et).config).onSettled)==null||p.call(x,g,this.state.error,this),g}catch(g){if(g instanceof Vs){if(g.silent)return _(this,Ae).promise;if(g.revert){if(this.state.data===void 0)throw g;return this.state.data}}throw $e(this,Je,Et).call(this,{type:"error",error:g}),(T=(b=_(this,et).config).onError)==null||T.call(b,g,this),(D=(L=_(this,et).config).onSettled)==null||D.call(L,this.state.data,g,this),g}finally{this.scheduleGc()}}},on=new WeakMap,En=new WeakMap,et=new WeakMap,an=new WeakMap,Ae=new WeakMap,hr=new WeakMap,ln=new WeakMap,Je=new WeakSet,Al=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Et=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...pd(r.data,this.options),fetchMeta:t.meta??null};case"success":const s={...r,...So(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return G(this,En,t.manual?s:void 0),s;case"error":const i=t.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Be.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),_(this,et).notify({query:this,type:"updated",action:t})})},Go);function pd(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Pl(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function So(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Co(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}function To(e){return{onFetch:(t,n)=>{var c,d,m,v,x;const r=t.options,s=(m=(d=(c=t.fetchOptions)==null?void 0:c.meta)==null?void 0:d.fetchMore)==null?void 0:m.direction,i=((v=t.state.data)==null?void 0:v.pages)||[],o=((x=t.state.data)==null?void 0:x.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let p=!1;const b=D=>{ad(D,()=>t.signal,()=>p=!0)},T=Cl(t.options,t.fetchOptions),L=async(D,g,M)=>{if(p)return Promise.reject();if(g==null&&D.pages.length)return Promise.resolve(D);const ee=(()=>{const z={client:t.client,queryKey:t.queryKey,pageParam:g,direction:M?"backward":"forward",meta:t.options.meta};return b(z),z})(),ne=await T(ee),{maxPages:B}=t.options,U=M?od:id;return{pages:U(D.pages,ne,B),pageParams:U(D.pageParams,g,B)}};if(s&&i.length){const D=s==="backward",g=D?gd:Po,M={pages:i,pageParams:o},j=g(r,M);a=await L(M,j,D)}else{const D=e??i.length;do{const g=l===0?o[0]??r.initialPageParam:Po(r,a);if(l>0&&g==null)break;a=await L(a,g),l++}while(l<D)}return a};t.options.persister?t.fetchFn=()=>{var p,b;return(b=(p=t.options).persister)==null?void 0:b.call(p,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function Po(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function gd(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var pr,yt,Ie,cn,_t,Rt,Yo,md=(Yo=class extends El{constructor(t){super();re(this,_t);re(this,pr);re(this,yt);re(this,Ie);re(this,cn);G(this,pr,t.client),this.mutationId=t.mutationId,G(this,Ie,t.mutationCache),G(this,yt,[]),this.state=t.state||yd(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){_(this,yt).includes(t)||(_(this,yt).push(t),this.clearGcTimeout(),_(this,Ie).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){G(this,yt,_(this,yt).filter(n=>n!==t)),this.scheduleGc(),_(this,Ie).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){_(this,yt).length||(this.state.status==="pending"?this.scheduleGc():_(this,Ie).remove(this))}continue(){var t;return((t=_(this,cn))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,a,l,u,c,d,m,v,x,p,b,T,L,D,g,M,j,ee;const n=()=>{$e(this,_t,Rt).call(this,{type:"continue"})},r={client:_(this,pr),meta:this.options.meta,mutationKey:this.options.mutationKey};G(this,cn,Ol({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(ne,B)=>{$e(this,_t,Rt).call(this,{type:"failed",failureCount:ne,error:B})},onPause:()=>{$e(this,_t,Rt).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>_(this,Ie).canRun(this)}));const s=this.state.status==="pending",i=!_(this,cn).canStart();try{if(s)n();else{$e(this,_t,Rt).call(this,{type:"pending",variables:t,isPaused:i}),_(this,Ie).config.onMutate&&await _(this,Ie).config.onMutate(t,this,r);const B=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,t,r));B!==this.state.context&&$e(this,_t,Rt).call(this,{type:"pending",context:B,variables:t,isPaused:i})}const ne=await _(this,cn).start();return await((u=(l=_(this,Ie).config).onSuccess)==null?void 0:u.call(l,ne,t,this.state.context,this,r)),await((d=(c=this.options).onSuccess)==null?void 0:d.call(c,ne,t,this.state.context,r)),await((v=(m=_(this,Ie).config).onSettled)==null?void 0:v.call(m,ne,null,this.state.variables,this.state.context,this,r)),await((p=(x=this.options).onSettled)==null?void 0:p.call(x,ne,null,t,this.state.context,r)),$e(this,_t,Rt).call(this,{type:"success",data:ne}),ne}catch(ne){try{await((T=(b=_(this,Ie).config).onError)==null?void 0:T.call(b,ne,t,this.state.context,this,r))}catch(B){Promise.reject(B)}try{await((D=(L=this.options).onError)==null?void 0:D.call(L,ne,t,this.state.context,r))}catch(B){Promise.reject(B)}try{await((M=(g=_(this,Ie).config).onSettled)==null?void 0:M.call(g,void 0,ne,this.state.variables,this.state.context,this,r))}catch(B){Promise.reject(B)}try{await((ee=(j=this.options).onSettled)==null?void 0:ee.call(j,void 0,ne,t,this.state.context,r))}catch(B){Promise.reject(B)}throw $e(this,_t,Rt).call(this,{type:"error",error:ne}),ne}finally{_(this,Ie).runNext(this)}}},pr=new WeakMap,yt=new WeakMap,Ie=new WeakMap,cn=new WeakMap,_t=new WeakSet,Rt=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Be.batch(()=>{_(this,yt).forEach(r=>{r.onMutationUpdate(t)}),_(this,Ie).notify({mutation:this,type:"updated",action:t})})},Yo);function yd(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Dt,nt,gr,Zo,Ml=(Zo=class extends us{constructor(n={}){super();re(this,Dt);re(this,nt);re(this,gr);this.config=n,G(this,Dt,new Set),G(this,nt,new Map),G(this,gr,0)}build(n,r,s){const i=new md({client:n,mutationCache:this,mutationId:++Pr(this,gr)._,options:n.defaultMutationOptions(r),state:s});return this.add(i),i}add(n){_(this,Dt).add(n);const r=Dr(n);if(typeof r=="string"){const s=_(this,nt).get(r);s?s.push(n):_(this,nt).set(r,[n])}this.notify({type:"added",mutation:n})}remove(n){if(_(this,Dt).delete(n)){const r=Dr(n);if(typeof r=="string"){const s=_(this,nt).get(r);if(s)if(s.length>1){const i=s.indexOf(n);i!==-1&&s.splice(i,1)}else s[0]===n&&_(this,nt).delete(r)}}this.notify({type:"removed",mutation:n})}canRun(n){const r=Dr(n);if(typeof r=="string"){const s=_(this,nt).get(r),i=s==null?void 0:s.find(o=>o.state.status==="pending");return!i||i===n}else return!0}runNext(n){var s;const r=Dr(n);if(typeof r=="string"){const i=(s=_(this,nt).get(r))==null?void 0:s.find(o=>o!==n&&o.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Be.batch(()=>{_(this,Dt).forEach(n=>{this.notify({type:"removed",mutation:n})}),_(this,Dt).clear(),_(this,nt).clear()})}getAll(){return Array.from(_(this,Dt))}find(n){const r={exact:!0,...n};return this.getAll().find(s=>bo(r,s))}findAll(n={}){return this.getAll().filter(r=>bo(n,r))}notify(n){Be.batch(()=>{this.listeners.forEach(r=>{r(n)})})}resumePausedMutations(){const n=this.getAll().filter(r=>r.state.isPaused);return Be.batch(()=>Promise.all(n.map(r=>r.continue().catch(tt))))}},Dt=new WeakMap,nt=new WeakMap,gr=new WeakMap,Zo);function Dr(e){var t;return(t=e.options.scope)==null?void 0:t.id}var vt,Xo,Dl=(Xo=class extends us{constructor(n={}){super();re(this,vt);this.config=n,G(this,vt,new Map)}build(n,r,s){const i=r.queryKey,o=r.queryHash??hi(i,r);let a=this.get(o);return a||(a=new hd({client:n,queryKey:i,queryHash:o,options:n.defaultQueryOptions(r),state:s,defaultOptions:n.getQueryDefaults(i)}),this.add(a)),a}add(n){_(this,vt).has(n.queryHash)||(_(this,vt).set(n.queryHash,n),this.notify({type:"added",query:n}))}remove(n){const r=_(this,vt).get(n.queryHash);r&&(n.destroy(),r===n&&_(this,vt).delete(n.queryHash),this.notify({type:"removed",query:n}))}clear(){Be.batch(()=>{this.getAll().forEach(n=>{this.remove(n)})})}get(n){return _(this,vt).get(n)}getAll(){return[..._(this,vt).values()]}find(n){const r={exact:!0,...n};return this.getAll().find(s=>vo(r,s))}findAll(n={}){const r=this.getAll();return Object.keys(n).length>0?r.filter(s=>vo(n,s)):r}notify(n){Be.batch(()=>{this.listeners.forEach(r=>{r(n)})})}onFocus(){Be.batch(()=>{this.getAll().forEach(n=>{n.onFocus()})})}onOnline(){Be.batch(()=>{this.getAll().forEach(n=>{n.onOnline()})})}},vt=new WeakMap,Xo),be,qt,Ut,An,Mn,Kt,Dn,$n,ea,_d=(ea=class{constructor(t={}){re(this,be);re(this,qt);re(this,Ut);re(this,An);re(this,Mn);re(this,Kt);re(this,Dn);re(this,$n);G(this,be,t.queryCache||new Dl),G(this,qt,t.mutationCache||new Ml),G(this,Ut,t.defaultOptions||{}),G(this,An,new Map),G(this,Mn,new Map),G(this,Kt,0)}mount(){Pr(this,Kt)._++,_(this,Kt)===1&&(G(this,Dn,wl.subscribe(async t=>{t&&(await this.resumePausedMutations(),_(this,be).onFocus())})),G(this,$n,Qr.subscribe(async t=>{t&&(await this.resumePausedMutations(),_(this,be).onOnline())})))}unmount(){var t,n;Pr(this,Kt)._--,_(this,Kt)===0&&((t=_(this,Dn))==null||t.call(this),G(this,Dn,void 0),(n=_(this,$n))==null||n.call(this),G(this,$n,void 0))}isFetching(t){return _(this,be).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return _(this,qt).findAll({...t,status:"pending"}).length}getQueryData(t){var r;const n=this.defaultQueryOptions({queryKey:t});return(r=_(this,be).get(n.queryHash))==null?void 0:r.state.data}ensureQueryData(t){const n=this.defaultQueryOptions(t),r=_(this,be).build(this,n),s=r.state.data;return s===void 0?this.fetchQuery(t):(t.revalidateIfStale&&r.isStaleByTime(Bs(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(s))}getQueriesData(t){return _(this,be).findAll(t).map(({queryKey:n,state:r})=>{const s=r.data;return[n,s]})}setQueryData(t,n,r){const s=this.defaultQueryOptions({queryKey:t}),i=_(this,be).get(s.queryHash),o=i==null?void 0:i.state.data,a=Zf(n,o);if(a!==void 0)return _(this,be).build(this,s).setData(a,{...r,manual:!0})}setQueriesData(t,n,r){return Be.batch(()=>_(this,be).findAll(t).map(({queryKey:s})=>[s,this.setQueryData(s,n,r)]))}getQueryState(t){var r;const n=this.defaultQueryOptions({queryKey:t});return(r=_(this,be).get(n.queryHash))==null?void 0:r.state}removeQueries(t){const n=_(this,be);Be.batch(()=>{n.findAll(t).forEach(r=>{n.remove(r)})})}resetQueries(t,n){const r=_(this,be);return Be.batch(()=>(r.findAll(t).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...t},n)))}cancelQueries(t,n={}){const r={revert:!0,...n},s=Be.batch(()=>_(this,be).findAll(t).map(i=>i.cancel(r)));return Promise.all(s).then(tt).catch(tt)}invalidateQueries(t,n={}){return Be.batch(()=>(_(this,be).findAll(t).forEach(r=>{r.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},n)))}refetchQueries(t,n={}){const r={...n,cancelRefetch:n.cancelRefetch??!0},s=Be.batch(()=>_(this,be).findAll(t).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let o=i.fetch(void 0,r);return r.throwOnError||(o=o.catch(tt)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(s).then(tt)}fetchQuery(t){const n=this.defaultQueryOptions(t);n.retry===void 0&&(n.retry=!1);const r=_(this,be).build(this,n);return r.isStaleByTime(Bs(n.staleTime,r))?r.fetch(n):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(tt).catch(tt)}fetchInfiniteQuery(t){return t.behavior=To(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(tt).catch(tt)}ensureInfiniteQueryData(t){return t.behavior=To(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Qr.isOnline()?_(this,qt).resumePausedMutations():Promise.resolve()}getQueryCache(){return _(this,be)}getMutationCache(){return _(this,qt)}getDefaultOptions(){return _(this,Ut)}setDefaultOptions(t){G(this,Ut,t)}setQueryDefaults(t,n){_(this,An).set(cr(t),{queryKey:t,defaultOptions:n})}getQueryDefaults(t){const n=[..._(this,An).values()],r={};return n.forEach(s=>{ur(t,s.queryKey)&&Object.assign(r,s.defaultOptions)}),r}setMutationDefaults(t,n){_(this,Mn).set(cr(t),{mutationKey:t,defaultOptions:n})}getMutationDefaults(t){const n=[..._(this,Mn).values()],r={};return n.forEach(s=>{ur(t,s.mutationKey)&&Object.assign(r,s.defaultOptions)}),r}defaultQueryOptions(t){if(t._defaulted)return t;const n={..._(this,Ut).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return n.queryHash||(n.queryHash=hi(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===pi&&(n.enabled=!1),n}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{..._(this,Ut).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){_(this,be).clear(),_(this,qt).clear()}},be=new WeakMap,qt=new WeakMap,Ut=new WeakMap,An=new WeakMap,Mn=new WeakMap,Kt=new WeakMap,Dn=new WeakMap,$n=new WeakMap,ea),vd="VUE_QUERY_CLIENT";function bd(e){const t=e?`:${e}`:"";return`${vd}${t}`}function qs(e,t,n="",r=0){if(t){const s=t(e,n,r);if(s===void 0&&Ce(e)||s!==void 0)return s}if(Array.isArray(e))return e.map((s,i)=>qs(s,t,String(i),r+1));if(typeof e=="object"&&xd(e)){const s=Object.entries(e).map(([i,o])=>[i,qs(o,t,i,r+1)]);return Object.fromEntries(s)}return e}function wd(e,t){return qs(e,t)}function te(e,t=!1){return wd(e,(n,r,s)=>{if(s===1&&r==="queryKey")return te(n,!0);if(t&&Sd(n))return te(n(),t);if(Ce(n))return te(X(n),t)})}function xd(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function Sd(e){return typeof e=="function"}var Cd=class extends Dl{find(e){return super.find(te(e))}findAll(e={}){return super.findAll(te(e))}},Td=class extends Ml{find(e){return super.find(te(e))}findAll(e={}){return super.findAll(te(e))}},$l=class extends _d{constructor(e={}){const t={defaultOptions:e.defaultOptions,queryCache:e.queryCache||new Cd,mutationCache:e.mutationCache||new Td};super(t),this.isRestoring=we(!1)}isFetching(e={}){return super.isFetching(te(e))}isMutating(e={}){return super.isMutating(te(e))}getQueryData(e){return super.getQueryData(te(e))}ensureQueryData(e){return super.ensureQueryData(te(e))}getQueriesData(e){return super.getQueriesData(te(e))}setQueryData(e,t,n={}){return super.setQueryData(te(e),t,te(n))}setQueriesData(e,t,n={}){return super.setQueriesData(te(e),t,te(n))}getQueryState(e){return super.getQueryState(te(e))}removeQueries(e={}){return super.removeQueries(te(e))}resetQueries(e={},t={}){return super.resetQueries(te(e),te(t))}cancelQueries(e={},t={}){return super.cancelQueries(te(e),te(t))}invalidateQueries(e={},t={}){const n=te(e),r=te(t);if(super.invalidateQueries({...n,refetchType:"none"},r),n.refetchType==="none")return Promise.resolve();const s={...n,type:n.refetchType??n.type??"active"};return Ln().then(()=>super.refetchQueries(s,r))}refetchQueries(e={},t={}){return super.refetchQueries(te(e),te(t))}fetchQuery(e){return super.fetchQuery(te(e))}prefetchQuery(e){return super.prefetchQuery(te(e))}fetchInfiniteQuery(e){return super.fetchInfiniteQuery(te(e))}prefetchInfiniteQuery(e){return super.prefetchInfiniteQuery(te(e))}setDefaultOptions(e){super.setDefaultOptions(te(e))}setQueryDefaults(e,t){super.setQueryDefaults(te(e),te(t))}getQueryDefaults(e){return super.getQueryDefaults(te(e))}setMutationDefaults(e,t){super.setMutationDefaults(te(e),te(t))}getMutationDefaults(e){return super.getMutationDefaults(te(e))}},Pd={install:(e,t={})=>{const n=bd(t.queryClientKey);let r;if("queryClient"in t&&t.queryClient)r=t.queryClient;else{const o="queryClientConfig"in t?t.queryClientConfig:void 0;r=new $l(o)}xl||r.mount();let s=()=>{};if(t.clientPersister){r.isRestoring&&(r.isRestoring.value=!0);const[o,a]=t.clientPersister(r);s=o,a.then(()=>{var l;r.isRestoring&&(r.isRestoring.value=!1),(l=t.clientPersisterOnSuccess)==null||l.call(t,r)})}const i=()=>{r.unmount(),s()};if(e.onUnmount)e.onUnmount(i);else{const o=e.unmount;e.unmount=function(){i(),o()}}e.provide(n,r)}};const Od="modulepreload",Ed=function(e){return"/"+e},Oo={},Eo=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){let o=function(u){return Promise.all(u.map(c=>Promise.resolve(c).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));s=o(n.map(u=>{if(u=Ed(u),u in Oo)return;Oo[u]=!0;const c=u.endsWith(".css"),d=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${d}`))return;const m=document.createElement("link");if(m.rel=c?"stylesheet":Od,c||(m.as="script"),m.crossOrigin="",m.href=u,l&&m.setAttribute("nonce",l),document.head.appendChild(m),c)return new Promise((v,x)=>{m.addEventListener("load",v),m.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${u}`)))})}))}function i(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return s.then(o=>{for(const a of o||[])a.status==="rejected"&&i(a.reason);return t().catch(i)})};function Ad(e,t){const n=`${e}Context`,r=Symbol(n);return[o=>{const a=St(r,o);if(a||a===null)return a;throw new Error(`Injection \`${r.toString()}\` not found. Component must be used within ${Array.isArray(e)?`one of the following components: ${e.join(", ")}`:`\`${e}\``}`)},o=>(La(r,o),o)]}function Md(e,t){return ua()?(Tc(e,t),!0):!1}const Dd=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;function $d(e,t,n={}){const{immediate:r=!0,immediateCallback:s=!1}=n,i=Jc(!1);let o;function a(){o&&(clearTimeout(o),o=void 0)}function l(){i.value=!1,a()}function u(...c){s&&e(),a(),i.value=!0,o=setTimeout(()=>{i.value=!1,o=void 0,e(...c)},Ea(t))}return r&&(i.value=!0,Dd&&u()),Md(l),{isPending:Kc(i),start:u,stop:l}}function Fd(e){var t;const n=Ea(e);return(t=n==null?void 0:n.$el)!==null&&t!==void 0?t:n}function kd(){const e=xr(),t=we(),n=Se(()=>r());Ua(()=>{n.value!==r()&&Wc(t)});function r(){return t.value&&"$el"in t.value&&["#text","#comment"].includes(t.value.$el.nodeName)?t.value.$el.nextElementSibling:Fd(t)}const s=Object.assign({},e.exposed),i={};for(const a in e.props)Object.defineProperty(i,a,{enumerable:!0,configurable:!0,get:()=>e.props[a]});if(Object.keys(s).length>0)for(const a in s)Object.defineProperty(i,a,{enumerable:!0,configurable:!0,get:()=>s[a]});Object.defineProperty(i,"$el",{enumerable:!0,configurable:!0,get:()=>e.vnode.el}),e.exposed=i;function o(a){if(t.value=a,!!a&&(Object.defineProperty(i,"$el",{enumerable:!0,configurable:!0,get:()=>a instanceof Element?a:a.$el}),!(a instanceof Element)&&!Object.hasOwn(a,"$el"))){const l=a.$.exposed,u=Object.assign({},i);for(const c in l)Object.defineProperty(u,c,{enumerable:!0,configurable:!0,get:()=>l[c]});e.exposed=u}}return{forwardRef:o,currentRef:t,currentElement:n}}const[Dg,Ld]=Ad("TooltipProvider");var Id=ct({inheritAttrs:!1,__name:"TooltipProvider",props:{delayDuration:{type:Number,required:!1,default:700},skipDelayDuration:{type:Number,required:!1,default:300},disableHoverableContent:{type:Boolean,required:!1,default:!1},disableClosingTrigger:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:!1},content:{type:Object,required:!1}},setup(e){const t=e,{delayDuration:n,skipDelayDuration:r,disableHoverableContent:s,disableClosingTrigger:i,ignoreNonKeyboardFocus:o,disabled:a,content:l}=Yc(t);kd();const u=we(!0),c=we(!1),{start:d,stop:m}=$d(()=>{u.value=!0},r,{immediate:!1});return Ld({isOpenDelayed:u,delayDuration:n,onOpen(){m(),u.value=!1},onClose(){d()},isPointerInTransitRef:c,disableHoverableContent:s,disableClosingTrigger:i,disabled:a,ignoreNonKeyboardFocus:o,content:l}),(v,x)=>qr(v.$slots,"default")}}),Nd=Id;const Rd={app:{title:"Mokelay Editor",subtitle:"Mokelay page configurator",darkMode:"Dark mode",dark:"Dark",light:"Light",language:"Language",chinese:"中文",english:"English"},editor:{placeholder:"Start typing your content...",defaultParagraph:"Welcome to the Mokelay editor starter template.",fullscreenEdit:"Fullscreen",saveContent:"Save",previewPage:"Preview",properties:"Properties",propertyDialogTitle:"Property Settings",configJson:"Config JSON",close:"Close"},preview:{title:"Config Preview",backToEditor:"Back",emptyState:'No saved config found. Please click "Save" in the editor first.'},globalCalls:{ok:"OK",cancel:"Cancel",alertRoleLabel:"Alert",confirmRoleLabel:"Confirm",messageRoleLabel:"Message"},input:{toolboxTitle:"Input",defaultPlaceholder:"Please enter...",propertyPanelTitle:"Input Properties",properties:{placeholder:"Placeholder",value:"Default value",valuePlaceholder:"Please enter a default value"}},link:{toolboxTitle:"Link",defaultText:"Link",defaultUrl:"https://mokelay.com",propertyPanelTitle:"Link Properties",properties:{text:"Link text",url:"Link URL",open:"Open in new page"}},advanceInput:{toolboxTitle:"Advanced Input"},editorSelector:{toolboxTitle:"Component Selector",placeholder:"Select a component"},form:{toolboxTitle:"Form",placeholder:"Add a form item"},advanceTable:{toolboxTitle:"Advanced Table",propertyPanelTitle:"Advanced Table Properties",defaultColumnName:"Column",empty:"No data",selectAll:"Select all",selectRow:"Select row",properties:{index:"Show index column",selection:"Show selection column"},defaultColumns:{name:"Name",status:"Status",tag:"Tag",owner:"Owner",link:"Link"},defaultRows:{first:{name:"Mokelay Page",status:"Designing",tag:"Design",owner:"Product Team",linkText:"Website",linkUrl:"https://mokelay.com"},second:{name:"Advanced Table",status:"Previewable",tag:"Preview",owner:"Editor Team",linkText:"Docs",linkUrl:"https://editor.mokelay.com"}}},datasource:{toolboxTitle:"Datasource Editor",title:"Datasource",empty:"No items",emptySchema:'No field config yet. Click "Generate field config" first.',noListRecord:"This schema does not contain an array field for list data.",noFormFields:"This schema does not contain simple fields for a form.",fields:{type:"Datasource type",rawData:"JSON data",domain:"API domain",path:"API path",method:"Method",key:"Key",mock:"Mock data",jsonSchema:"JSON Schema",generatedFields:"Fields",searchFields:"Search fields or paths",recordPath:"List data path",rootRecordPath:"Root data",selectedFields:"Selected fields",required:"Required"},sections:{headers:"Header",queries:"Query",body:"Body",generateFields:"Generate field config",fieldSelection:"Field selection"},actions:{add:"Add",remove:"Remove",parseJsonSchema:"Parse JSON Schema",parsingJsonSchema:"Parsing...",generateFields:"Generate field config",generatingFields:"Generating..."},tabs:{list:"List fields",form:"Form fields",advanced:"Advanced Schema"},help:{generateFields:"Detect fields from JSON data or an API response, then prepare them for list and form components.",fieldSelection:"Choose the fields components should use, and rename them with business-friendly labels."},schemaTypes:{object:"Object",array:"List",string:"Text",number:"Number",boolean:"Switch",null:"Empty"},componentHints:{text:"Text",number:"Number",switch:"Switch",object:"Object",array:"List"},validation:{invalidJson:"Enter valid JSON.",invalidJsonSchema:"Enter a JSON Schema that matches the supported format.",invalidNumber:"Enter a valid number.",invalidObject:"Enter a valid JSON object.",invalidArray:"Enter a valid JSON array.",fixJsonBeforeSchema:"Fix JSON data before parsing JSON Schema.",fixBodyBeforeSchema:"Fix Body mock data before parsing JSON Schema.",nonJsonResponse:"The API response is not JSON.",invalidJsonResponse:"The API response is not valid JSON.",apiRequestFailed:"API request failed:",emptyArraySchema:"Cannot infer JSON Schema from an empty array.",mixedArraySchema:"The array contains incompatible types, so JSON Schema cannot be inferred."}},formItem:{toolboxTitle:"Form Item",defaultLabelName:"Field",propertyPanelTitle:"Form Item Properties",emptyEditor:"No editor selected",properties:{labelName:"Field label",variableName:"Variable name",editor:"Editor",layout:"Layout"},placeholders:{labelName:"Enter field label",variableName:"Enter variable name"},layouts:{vertical:"Vertical",horizontal:"Horizontal"}},tag:{toolboxTitle:"Tag",defaultTagName:"Tag",propertyPanelTitle:"Tag Properties",properties:{tagName:"Tag name",type:"Type",size:"Size",color:"Custom color",colorPlaceholder:"e.g. #409EFF",closable:"Closable"},types:{default:"Default",primary:"Primary",success:"Success",info:"Info",warning:"Warning",danger:"Danger"},sizes:{default:"Default",large:"Large",medium:"Medium",small:"Small"}},page:{toolboxTitle:"Page"}},jd={},Hd={app:{title:"Mokelay Editor",subtitle:"Mokelay页面配置器",darkMode:"深色模式",dark:"深色",light:"浅色",language:"语言",chinese:"中文",english:"English"},editor:{placeholder:"开始输入你的内容...",defaultParagraph:"欢迎使用 Mokelay 编辑器初始化模板。",fullscreenEdit:"全屏编辑",saveContent:"保存",previewPage:"预览",properties:"属性",propertyDialogTitle:"属性设置",configJson:"配置 JSON",close:"关闭"},preview:{title:"配置预览",backToEditor:"返回",emptyState:"未找到已保存配置,请先在编辑器点击“保存”。"},globalCalls:{ok:"确定",cancel:"取消",alertRoleLabel:"提示",confirmRoleLabel:"确认",messageRoleLabel:"消息"},input:{toolboxTitle:"输入框",defaultPlaceholder:"请输入.....",propertyPanelTitle:"输入框属性",properties:{placeholder:"占位提示",value:"默认值",valuePlaceholder:"请输入默认值"}},link:{toolboxTitle:"链接",defaultText:"链接",defaultUrl:"https://mokelay.com",propertyPanelTitle:"链接属性",properties:{text:"链接文本",url:"链接地址",open:"新页面打开"}},advanceInput:{toolboxTitle:"高级输入框"},editorSelector:{toolboxTitle:"组件选择器",placeholder:"选择组件"},form:{toolboxTitle:"表单",placeholder:"添加表单项"},advanceTable:{toolboxTitle:"高级表格",propertyPanelTitle:"高级表格属性",defaultColumnName:"列",empty:"暂无数据",selectAll:"全选",selectRow:"选择行",properties:{index:"显示序号列",selection:"显示多选列"},defaultColumns:{name:"名称",status:"状态",tag:"标签",owner:"负责人",link:"链接"},defaultRows:{first:{name:"Mokelay 页面",status:"设计中",tag:"设计",owner:"产品团队",linkText:"官网",linkUrl:"https://mokelay.com"},second:{name:"高级表格",status:"可预览",tag:"预览",owner:"编辑器团队",linkText:"文档",linkUrl:"https://editor.mokelay.com"}}},datasource:{toolboxTitle:"数据源编辑器",title:"数据源",empty:"暂无配置项",emptySchema:"还没有字段配置,请先点击“生成字段配置”。",noListRecord:"当前 Schema 中没有可作为列表数据的数组字段。",noFormFields:"当前 Schema 中没有可用于表单的普通字段。",fields:{type:"数据源类型",rawData:"JSON 数据",domain:"API 域名",path:"API Path",method:"调用方法",key:"Key",mock:"Mock 数据",jsonSchema:"JSON Schema",generatedFields:"字段数",searchFields:"搜索字段名称或路径",recordPath:"列表数据位置",rootRecordPath:"根数据",selectedFields:"已选择字段",required:"必填"},sections:{headers:"Header",queries:"Query",body:"Body",generateFields:"生成字段配置",fieldSelection:"字段选择"},actions:{add:"添加",remove:"删除",parseJsonSchema:"解析JSON Schema",parsingJsonSchema:"解析中...",generateFields:"生成字段配置",generatingFields:"生成中..."},tabs:{list:"列表字段",form:"表单字段",advanced:"高级 Schema"},help:{generateFields:"从 JSON 数据或 API 响应中识别字段,生成给列表和表单使用的配置。",fieldSelection:"勾选需要给组件使用的字段,可以直接改成业务同学看得懂的名称。"},schemaTypes:{object:"对象",array:"列表",string:"文本",number:"数字",boolean:"开关",null:"空值"},componentHints:{text:"文本",number:"数字",switch:"开关",object:"对象",array:"列表"},validation:{invalidJson:"请输入标准 JSON 结构。",invalidJsonSchema:"请输入符合数据格式的 JSON Schema。",invalidNumber:"请输入有效数字。",invalidObject:"请输入标准 JSON 对象。",invalidArray:"请输入标准 JSON 数组。",fixJsonBeforeSchema:"请先修正 JSON 数据。",fixBodyBeforeSchema:"请先修正 Body 中的 Mock 数据。",nonJsonResponse:"API 响应不是 JSON 数据。",invalidJsonResponse:"API 响应不是有效 JSON 数据。",apiRequestFailed:"API 请求失败:",emptyArraySchema:"空数组无法推断 JSON Schema。",mixedArraySchema:"数组中包含无法合并的类型,无法推断 JSON Schema。"}},formItem:{toolboxTitle:"表单项",defaultLabelName:"字段",propertyPanelTitle:"表单项属性",emptyEditor:"未选择编辑器",properties:{labelName:"字段文本",variableName:"变量名",editor:"编辑器",layout:"布局方式"},placeholders:{labelName:"请输入字段文本",variableName:"请输入变量名"},layouts:{vertical:"垂直",horizontal:"水平"}},tag:{toolboxTitle:"标签",defaultTagName:"标签",propertyPanelTitle:"标签属性",properties:{tagName:"标签内容",type:"标签类型",size:"标签尺寸",color:"自定义颜色",colorPlaceholder:"例如:#409EFF",closable:"可关闭"},types:{default:"默认",primary:"主要",success:"成功",info:"信息",warning:"警告",danger:"危险"},sizes:{default:"默认",large:"大",medium:"中",small:"小"}},page:{toolboxTitle:"页面"}},Bd={ui:{blockTunes:{toggler:{"Click to tune":"点击设置","or drag to move":"或拖拽移动"}},inlineToolbar:{converter:{"Convert to":"转换为"}},toolbar:{toolbox:{Add:"添加"}},popover:{Filter:"筛选","Nothing found":"未找到结果"}},blockTunes:{delete:{Delete:"删除"},moveUp:{"Move up":"上移"},moveDown:{"Move down":"下移"}},toolNames:{Text:"文本",Heading:"标题",List:"列表",Warning:"提示",Checklist:"清单",Quote:"引用",Delimiter:"分割线",Table:"表格",Link:"链接",Columns:"分栏"}},zd={zh:Hd,en:Rd},Vd={zh:Bd,en:jd},Fl="mokelay-editor-locale";function qd(e){const n=(document.cookie?document.cookie.split("; "):[]).find(r=>r.startsWith(`${e}=`));return n?decodeURIComponent(n.slice(e.length+1)):null}function Ud(e,t){document.cookie=`${e}=${encodeURIComponent(t)}; path=/; max-age=31536000; samesite=lax`}function Kd(){return navigator.language.toLowerCase().startsWith("zh")?"zh":"en"}function Jd(){const e=qd(Fl);return e==="zh"||e==="en"?e:Kd()}const fr=we(Jd());function kl(e){const t=e.split(".");let n=zd[fr.value];for(const r of t){if(typeof n=="object"&&n!==null&&r in n){n=n[r];continue}n=void 0;break}return typeof n=="string"?n:e}function Ll(e){fr.value=e,Ud(Fl,e)}function gi(){return{locale:jr(fr),t:kl,setLocale:Ll,localeValue:Se(()=>fr.value)}}function $g(e){return Vd[e]}const Z={t:kl,get locale(){return fr.value},setLocale:Ll},Qd={"data-testid":"app-root",class:"flex min-h-screen flex-col bg-slate-100 p-4 text-slate-900 transition-colors dark:bg-slate-950 dark:text-slate-100"},Wd={"data-testid":"app-header",class:"mb-4 flex flex-wrap items-center justify-between gap-3 rounded-xl border border-slate-200 bg-white px-4 py-3 shadow-sm dark:border-slate-700 dark:bg-slate-900"},Gd={"data-testid":"app-title",class:"text-xl font-semibold"},Yd={class:"flex flex-wrap items-center gap-3"},Zd={class:"flex items-center gap-2 text-sm"},Xd=["value"],eh={value:"dark"},th={value:"light"},nh={class:"flex items-center gap-2 text-sm"},rh=["value"],sh={value:"zh"},ih={value:"en"},oh=["disabled"],ah=["disabled"],Ao="mokelay-editor-theme-mode",lh=ct({__name:"App",setup(e){const t=Bi(()=>Eo(()=>import("./EditorPanel-s8UfMl2a.js"),__vite__mapDeps([0,1,2,3,4]))),n=Bi(()=>Eo(()=>import("./PreviewPanel-Bs7PtelH.js"),__vite__mapDeps([5,1,2,3])));function r(g){const j=(document.cookie?document.cookie.split("; "):[]).find(ee=>ee.startsWith(`${g}=`));return j?decodeURIComponent(j.slice(g.length+1)):null}function s(g,M){document.cookie=`${g}=${encodeURIComponent(M)}; path=/; max-age=31536000; samesite=lax`}function i(){const g=r(Ao);return g==="dark"}const o=we(i()),a=we(window.location.hash||"#/"),{t:l,localeValue:u,setLocale:c}=gi(),d=we(null),m=Se(()=>a.value==="#/preview"),v=Se(()=>d.value!==null);function x(g){document.documentElement.classList.toggle("dark",g)}function p(){a.value=window.location.hash||"#/"}br(()=>{x(o.value),window.addEventListener("hashchange",p)}),ai(()=>{window.removeEventListener("hashchange",p)}),Lr(o,g=>{x(g),s(Ao,g?"dark":"light")});function b(g){o.value=g==="dark"}function T(){var g;(g=d.value)==null||g.save()}function L(){var g;(g=d.value)==null||g.openPreview()}function D(){window.location.hash="/"}return(g,M)=>(ue(),Jt(X(Nd),null,{default:wn(()=>[pe("main",Qd,[pe("header",Wd,[pe("h1",Gd,Fe(X(l)("app.title")),1),pe("div",Yd,[pe("label",Zd,[pe("select",{"data-testid":"theme-select",value:o.value?"dark":"light",class:"rounded-lg border border-slate-300 bg-white px-3 py-1.5 text-sm dark:border-slate-600 dark:bg-slate-800",onChange:M[0]||(M[0]=j=>b(j.target.value))},[pe("option",eh,Fe(X(l)("app.dark")),1),pe("option",th,Fe(X(l)("app.light")),1)],40,Xd)]),pe("label",nh,[pe("select",{"data-testid":"locale-select",value:X(u),class:"rounded-lg border border-slate-300 bg-white px-3 py-1.5 text-sm dark:border-slate-600 dark:bg-slate-800",onChange:M[1]||(M[1]=j=>X(c)(j.target.value))},[pe("option",sh,Fe(X(l)("app.chinese")),1),pe("option",ih,Fe(X(l)("app.english")),1)],40,rh)]),m.value?(ue(),ve("button",{key:1,"data-testid":"back-to-editor-button",class:"rounded-lg bg-slate-200 px-3 py-1.5 text-sm font-medium text-slate-800 hover:bg-slate-300 dark:bg-slate-700 dark:text-slate-100 dark:hover:bg-slate-600",onClick:D},Fe(X(l)("preview.backToEditor")),1)):(ue(),ve(ke,{key:0},[pe("button",{"data-testid":"save-button",class:"rounded-lg bg-indigo-500 px-3 py-1.5 text-sm font-medium text-white hover:bg-indigo-400 disabled:cursor-not-allowed disabled:opacity-50",disabled:!v.value,onClick:T},Fe(X(l)("editor.saveContent")),9,oh),pe("button",{"data-testid":"preview-button",class:"rounded-lg bg-emerald-500 px-3 py-1.5 text-sm font-medium text-white hover:bg-emerald-400 disabled:cursor-not-allowed disabled:opacity-50",disabled:!v.value,onClick:L},Fe(X(l)("editor.previewPage")),9,ah)],64))])]),m.value?(ue(),Jt(X(n),{key:0})):(ue(),Jt(X(t),{key:1,ref_key:"editorPanelRef",ref:d},null,512))])]),_:1}))}});function Fg(e){return e}const ch={class:"ce-input-tool","data-testid":"editor-input-tool"},uh=["placeholder","value"],fh={toolbox:{get title(){return Z.t("input.toolboxTitle")},icon:'<svg width="18" height="18" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><rect x="3" y="6" width="18" height="12" rx="2" ry="2" fill="none" stroke="currentColor" stroke-width="2"/><path d="M8 12h8" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>'},propertyPanel:{get title(){return Z.t("input.propertyPanelTitle")},get fields(){return[{key:"placeholder",label:Z.t("input.properties.placeholder"),placeholder:Z.t("input.defaultPlaceholder")},{key:"value",label:Z.t("input.properties.value"),placeholder:Z.t("input.properties.valuePlaceholder")}]}},createInitialProps:()=>({placeholder:Z.t("input.defaultPlaceholder"),value:""}),normalizeProps:e=>({edit:e.edit??!1,placeholder:e.placeholder??"",value:e.value??""}),serialize:e=>({placeholder:e.placeholder??"",value:e.value??""})},dh=ct({__name:"MInput",props:{edit:{type:Boolean},placeholder:{},value:{},onChange:{type:Function},onToolChange:{type:Function}},setup(e){const t=e;function n(r){var i,o;const s={edit:t.edit,placeholder:t.placeholder??"",value:t.value??"",...r};(i=t.onToolChange)==null||i.call(t,s),(o=t.onChange)==null||o.call(t,s)}return(r,s)=>(ue(),ve("div",ch,[pe("input",{"data-testid":"editor-input-control",class:"ce-input-tool__control",type:"text",placeholder:e.placeholder,value:e.value,onInput:s[0]||(s[0]=i=>n({value:i.target.value}))},null,40,uh)]))}}),Cr=(e,t)=>{const n=e.__vccOpts||e;for(const[r,s]of t)n[r]=s;return n},hh=Cr(dh,[["__scopeId","data-v-38751236"]]),ph=["href","target","rel"],gh={toolbox:{get title(){return Z.t("link.toolboxTitle")},icon:'<svg width="18" height="18" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M10.6 13.4a4 4 0 0 0 5.7 0l2.1-2.1a4 4 0 0 0-5.7-5.7l-1.2 1.2" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/><path d="M13.4 10.6a4 4 0 0 0-5.7 0l-2.1 2.1a4 4 0 0 0 5.7 5.7l1.2-1.2" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>'},propertyPanel:{get title(){return Z.t("link.propertyPanelTitle")},get fields(){return[{key:"text",label:Z.t("link.properties.text"),placeholder:Z.t("link.defaultText")},{key:"url",label:Z.t("link.properties.url"),placeholder:Z.t("link.defaultUrl")},{key:"open",label:Z.t("link.properties.open"),type:"checkbox"}]}},createInitialProps:()=>({text:Z.t("link.defaultText"),url:Z.t("link.defaultUrl"),open:!1}),normalizeProps:e=>{var t,n;return{edit:e.edit??!1,text:((t=e.text)==null?void 0:t.trim())||Z.t("link.defaultText"),url:((n=e.url)==null?void 0:n.trim())||Z.t("link.defaultUrl"),open:e.open===!0}},serialize:e=>{var t,n;return{text:((t=e.text)==null?void 0:t.trim())||Z.t("link.defaultText"),url:((n=e.url)==null?void 0:n.trim())||Z.t("link.defaultUrl"),open:e.open===!0}}},mh=ct({__name:"MLink",props:{edit:{type:Boolean},text:{},url:{},open:{type:Boolean},onChange:{type:Function},onToolChange:{type:Function}},setup(e){const t=e,{t:n}=gi(),r=we(null),s=Se(()=>{var p;return((p=t.text)==null?void 0:p.trim())||n("link.defaultText")}),i=Se(()=>m(t.url??"")),o=Se(()=>t.open?"_blank":void 0),a=Se(()=>t.open?"noopener noreferrer":void 0);let l=null;function u(){l!==null&&(window.clearTimeout(l),l=null)}function c(){var ee;const p=r.value;if(!p)return;const b=p.closest(".ce-block"),T=(ee=p.closest(".codex-editor"))==null?void 0:ee.querySelector(".ce-toolbar"),L=T==null?void 0:T.querySelector(".ce-toolbar__plus");if(!b||!T||!L)return;const D=b.getBoundingClientRect(),g=p.getBoundingClientRect(),M=L.getBoundingClientRect().height||26,j=b.offsetTop+(g.top-D.top)+(g.height-M)/2;T.style.top=`${Math.round(j)}px`}function d(){u(),l=window.setTimeout(()=>{c()},0)}function m(p){const b=p.trim();if(!b)return"#";if(b.startsWith("//"))return`https:${b}`;const T=b.match(/^([a-z][a-z\d+.-]*):/i);if(!T)return b;const L=T[1].toLowerCase();return["http","https","mailto","tel"].includes(L)?b:"#"}function v(p){var T,L;const b={edit:t.edit,text:t.text??"",url:t.url??"",open:t.open??!1,...p};(T=t.onToolChange)==null||T.call(t,b),(L=t.onChange)==null||L.call(t,b)}function x(p){(t.edit||i.value==="#")&&p.preventDefault(),v({text:s.value,url:t.url??"",open:t.open??!1})}return br(()=>{Ln(()=>{var p,b;(p=r.value)==null||p.addEventListener("mouseenter",d),(b=r.value)==null||b.addEventListener("mousemove",d)})}),wr(()=>{var p,b;u(),(p=r.value)==null||p.removeEventListener("mouseenter",d),(b=r.value)==null||b.removeEventListener("mousemove",d)}),(p,b)=>(ue(),ve("span",{ref_key:"rootRef",ref:r,class:"ce-link-tool","data-testid":"editor-link-tool"},[pe("a",{class:"ce-link-tool__anchor","data-testid":"editor-link-value",href:i.value,target:o.value,rel:a.value,onClick:x},Fe(s.value),9,ph)],512))}}),yh=Cr(mh,[["__scopeId","data-v-e56db1bc"]]),Il=["","default","small","large"];typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;var _h=typeof global=="object"&&global&&global.Object===Object&&global,vh=typeof self=="object"&&self&&self.Object===Object&&self,mi=_h||vh||Function("return this")(),Nn=mi.Symbol,Nl=Object.prototype,bh=Nl.hasOwnProperty,wh=Nl.toString,Un=Nn?Nn.toStringTag:void 0;function xh(e){var t=bh.call(e,Un),n=e[Un];try{e[Un]=void 0;var r=!0}catch{}var s=wh.call(e);return r&&(t?e[Un]=n:delete e[Un]),s}var Sh=Object.prototype,Ch=Sh.toString;function Th(e){return Ch.call(e)}var Ph="[object Null]",Oh="[object Undefined]",Mo=Nn?Nn.toStringTag:void 0;function yi(e){return e==null?e===void 0?Oh:Ph:Mo&&Mo in Object(e)?xh(e):Th(e)}function Rl(e){return e!=null&&typeof e=="object"}var Eh="[object Symbol]";function _i(e){return typeof e=="symbol"||Rl(e)&&yi(e)==Eh}function Ah(e,t){for(var n=-1,r=e==null?0:e.length,s=Array(r);++n<r;)s[n]=t(e[n],n,e);return s}var vi=Array.isArray,Do=Nn?Nn.prototype:void 0,$o=Do?Do.toString:void 0;function jl(e){if(typeof e=="string")return e;if(vi(e))return Ah(e,jl)+"";if(_i(e))return $o?$o.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Hl(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Mh="[object AsyncFunction]",Dh="[object Function]",$h="[object GeneratorFunction]",Fh="[object Proxy]";function kh(e){if(!Hl(e))return!1;var t=yi(e);return t==Dh||t==$h||t==Mh||t==Fh}var Es=mi["__core-js_shared__"],Fo=(function(){var e=/[^.]+$/.exec(Es&&Es.keys&&Es.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function Lh(e){return!!Fo&&Fo in e}var Ih=Function.prototype,Nh=Ih.toString;function Rh(e){if(e!=null){try{return Nh.call(e)}catch{}try{return e+""}catch{}}return""}var jh=/[\\^$.*+?()[\]{}|]/g,Hh=/^\[object .+?Constructor\]$/,Bh=Function.prototype,zh=Object.prototype,Vh=Bh.toString,qh=zh.hasOwnProperty,Uh=RegExp("^"+Vh.call(qh).replace(jh,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Kh(e){if(!Hl(e)||Lh(e))return!1;var t=kh(e)?Uh:Hh;return t.test(Rh(e))}function Jh(e,t){return e==null?void 0:e[t]}function bi(e,t){var n=Jh(e,t);return Kh(n)?n:void 0}var ko=(function(){try{var e=bi(Object,"defineProperty");return e({},"",{}),e}catch{}})();function Qh(e,t,n){t=="__proto__"&&ko?ko(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Wh(e,t){return e===t||e!==e&&t!==t}var Gh=Object.prototype,kg=Gh.hasOwnProperty;function Yh(e,t){return function(n){return e(t(n))}}var Zh=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Xh=/^\w*$/;function ep(e,t){if(vi(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||_i(e)?!0:Xh.test(e)||!Zh.test(e)||t!=null&&e in Object(t)}var dr=bi(Object,"create");function tp(){this.__data__=dr?dr(null):{},this.size=0}function np(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var rp="__lodash_hash_undefined__",sp=Object.prototype,ip=sp.hasOwnProperty;function op(e){var t=this.__data__;if(dr){var n=t[e];return n===rp?void 0:n}return ip.call(t,e)?t[e]:void 0}var ap=Object.prototype,lp=ap.hasOwnProperty;function cp(e){var t=this.__data__;return dr?t[e]!==void 0:lp.call(t,e)}var up="__lodash_hash_undefined__";function fp(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=dr&&t===void 0?up:t,this}function dn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}dn.prototype.clear=tp;dn.prototype.delete=np;dn.prototype.get=op;dn.prototype.has=cp;dn.prototype.set=fp;function dp(){this.__data__=[],this.size=0}function fs(e,t){for(var n=e.length;n--;)if(Wh(e[n][0],t))return n;return-1}var hp=Array.prototype,pp=hp.splice;function gp(e){var t=this.__data__,n=fs(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():pp.call(t,n,1),--this.size,!0}function mp(e){var t=this.__data__,n=fs(t,e);return n<0?void 0:t[n][1]}function yp(e){return fs(this.__data__,e)>-1}function _p(e,t){var n=this.__data__,r=fs(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Hn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Hn.prototype.clear=dp;Hn.prototype.delete=gp;Hn.prototype.get=mp;Hn.prototype.has=yp;Hn.prototype.set=_p;var vp=bi(mi,"Map");function bp(){this.size=0,this.__data__={hash:new dn,map:new(vp||Hn),string:new dn}}function wp(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ds(e,t){var n=e.__data__;return wp(t)?n[typeof t=="string"?"string":"hash"]:n.map}function xp(e){var t=ds(this,e).delete(e);return this.size-=t?1:0,t}function Sp(e){return ds(this,e).get(e)}function Cp(e){return ds(this,e).has(e)}function Tp(e,t){var n=ds(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function pn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}pn.prototype.clear=bp;pn.prototype.delete=xp;pn.prototype.get=Sp;pn.prototype.has=Cp;pn.prototype.set=Tp;var Pp="Expected a function";function wi(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Pp);var n=function(){var r=arguments,s=t?t.apply(this,r):r[0],i=n.cache;if(i.has(s))return i.get(s);var o=e.apply(this,r);return n.cache=i.set(s,o)||i,o};return n.cache=new(wi.Cache||pn),n}wi.Cache=pn;var Op=500;function Ep(e){var t=wi(e,function(r){return n.size===Op&&n.clear(),r}),n=t.cache;return t}var Ap=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Mp=/\\(\\)?/g,Dp=Ep(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Ap,function(n,r,s,i){t.push(s?i.replace(Mp,"$1"):r||n)}),t});function $p(e){return e==null?"":jl(e)}function Fp(e,t){return vi(e)?e:ep(e,t)?[e]:Dp($p(e))}function kp(e){if(typeof e=="string"||_i(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Lp(e,t){t=Fp(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[kp(t[n++])];return n&&n==r?e:void 0}function Ip(e,t,n){var r=e==null?void 0:Lp(e,t);return r===void 0?n:r}var Np=Yh(Object.getPrototypeOf,Object),Rp="[object Object]",jp=Function.prototype,Hp=Object.prototype,Bl=jp.toString,Bp=Hp.hasOwnProperty,zp=Bl.call(Object);function Vp(e){if(!Rl(e)||yi(e)!=Rp)return!1;var t=Np(e);if(t===null)return!0;var n=Bp.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Bl.call(n)==zp}function zl(e){for(var t=-1,n=e==null?0:e.length,r={};++t<n;){var s=e[t];Qh(r,s[0],s[1])}return r}const qp=e=>typeof e=="number";const Up=e=>fe(e)?!Number.isNaN(Number(e)):!1;const Vl="__epPropKey",Kp=e=>e,Jp=e=>ce(e)&&!!e[Vl],ql=(e,t)=>{if(!ce(e)||Jp(e))return e;const{values:n,required:r,default:s,type:i,validator:o}=e,a={type:i,required:!!r,validator:n||o?l=>{let u=!1,c=[];if(n&&(c=Array.from(n),ie(e,"default")&&c.push(s),u||(u=c.includes(l))),o&&(u||(u=o(l))),!u&&c.length>0){const d=[...new Set(c)].map(m=>JSON.stringify(m)).join(", ");hf(`Invalid prop: validation failed${t?` for prop "${t}"`:""}. Expected one of [${d}], got value ${JSON.stringify(l)}.`)}return u}:void 0,[Vl]:!0};return ie(e,"default")&&(a.default=s),a},Ul=e=>zl(Object.entries(e).map(([t,n])=>[t,ql(n,t)]));var Qp=class extends Error{constructor(e){super(e),this.name="ElementPlusError"}};function Wp(e,t){{const n=fe(e)?new Qp(`[${e}] ${t}`):e;console.warn(n)}}const Gp="utils/dom/style";function Yp(e,t="px"){if(!e&&e!==0)return"";if(qp(e)||Up(e))return`${e}${t}`;if(fe(e))return e;Wp(Gp,"binding value must be a string or number")}var Zp={name:"en",el:{breadcrumb:{label:"Breadcrumb"},colorpicker:{confirm:"OK",clear:"Clear",defaultLabel:"color picker",description:"current color is {color}. press enter to select a new color.",alphaLabel:"pick alpha value",alphaDescription:"alpha {alpha}, current color is {color}",hueLabel:"pick hue value",hueDescription:"hue {hue}, current color is {color}",svLabel:"pick saturation and brightness value",svDescription:"saturation {saturation}, brightness {brightness}, current color is {color}",predefineDescription:"select {value} as the color"},datepicker:{now:"Now",today:"Today",cancel:"Cancel",clear:"Clear",confirm:"OK",dateTablePrompt:"Use the arrow keys and enter to select the day of the month",monthTablePrompt:"Use the arrow keys and enter to select the month",yearTablePrompt:"Use the arrow keys and enter to select the year",selectedDate:"Selected date",selectDate:"Select date",selectTime:"Select time",startDate:"Start Date",startTime:"Start Time",endDate:"End Date",endTime:"End Time",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",year:"",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weeksFull:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"},months:{jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec"}},inputNumber:{decrease:"decrease number",increase:"increase number"},select:{loading:"Loading",noMatch:"No matching data",noData:"No data",placeholder:"Select"},mention:{loading:"Loading"},dropdown:{toggleDropdown:"Toggle Dropdown"},cascader:{noMatch:"No matching data",loading:"Loading",placeholder:"Select",noData:"No data"},pagination:{goto:"Go to",pagesize:"/page",total:"Total {total}",pageClassifier:"",page:"Page",prev:"Go to previous page",next:"Go to next page",currentPage:"page {pager}",prevPages:"Previous {pager} pages",nextPages:"Next {pager} pages",deprecationWarning:"Deprecated usages detected, please refer to the el-pagination documentation for more details"},dialog:{close:"Close this dialog"},drawer:{close:"Close this dialog"},messagebox:{title:"Message",confirm:"OK",cancel:"Cancel",error:"Illegal input",close:"Close this dialog"},upload:{deleteTip:"press delete to remove",delete:"Delete",preview:"Preview",continue:"Continue"},slider:{defaultLabel:"slider between {min} and {max}",defaultRangeStartLabel:"pick start value",defaultRangeEndLabel:"pick end value"},table:{emptyText:"No Data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum",selectAllLabel:"Select all rows",selectRowLabel:"Select this row",expandRowLabel:"Expand this row",collapseRowLabel:"Collapse this row",sortLabel:"Sort by {column}",filterLabel:"Filter by {column}"},tag:{close:"Close this tag"},tour:{next:"Next",previous:"Previous",finish:"Finish",close:"Close this dialog"},tree:{emptyText:"No Data"},transfer:{noMatch:"No matching data",noData:"No data",titles:["List 1","List 2"],filterPlaceholder:"Enter keyword",noCheckedFormat:"{total} items",hasCheckedFormat:"{checked}/{total} checked"},image:{error:"FAILED"},pageHeader:{title:"Back"},popconfirm:{confirmButtonText:"Yes",cancelButtonText:"No"},carousel:{leftArrow:"Carousel arrow left",rightArrow:"Carousel arrow right",indicator:"Carousel switch to index {index}"}}};const Xp=e=>(t,n)=>e0(t,n,X(e)),e0=(e,t,n)=>Ip(n,e,e).replace(/\{(\w+)\}/g,(r,s)=>`${(t==null?void 0:t[s])??`{${s}}`}`),t0=e=>({lang:Se(()=>X(e).name),locale:Ce(e)?e:we(e),t:Xp(e)}),n0=Symbol("localeContextKey"),r0=e=>{const t=e||St(n0,we());return t0(Se(()=>t.value||Zp))},As="el",s0="is-",Xt=(e,t,n,r,s)=>{let i=`${e}-${t}`;return n&&(i+=`-${n}`),r&&(i+=`__${r}`),s&&(i+=`--${s}`),i},i0=Symbol("namespaceContextKey"),o0=e=>{const t=e||(xr()?St(i0,we(As)):we(As));return Se(()=>X(t)||As)},Kl=(e,t)=>{const n=o0(t);return{namespace:n,b:(p="")=>Xt(n.value,e,p,"",""),e:p=>p?Xt(n.value,e,"",p,""):"",m:p=>p?Xt(n.value,e,"","",p):"",be:(p,b)=>p&&b?Xt(n.value,e,p,b,""):"",em:(p,b)=>p&&b?Xt(n.value,e,"",p,b):"",bm:(p,b)=>p&&b?Xt(n.value,e,p,"",b):"",bem:(p,b,T)=>p&&b&&T?Xt(n.value,e,p,b,T):"",is:(p,...b)=>{const T=b.length>=1?b[0]:!0;return p&&T?`${s0}${p}`:""},cssVar:p=>{const b={};for(const T in p)p[T]&&(b[`--${n.value}-${T}`]=p[T]);return b},cssVarName:p=>`--${n.value}-${p}`,cssVarBlock:p=>{const b={};for(const T in p)p[T]&&(b[`--${n.value}-${e}-${T}`]=p[T]);return b},cssVarBlockName:p=>`--${n.value}-${e}-${p}`}},a0=e=>{const t=xr();return Se(()=>{var n,r;return(r=(n=t==null?void 0:t.proxy)==null?void 0:n.$props)==null?void 0:r[e]})},Lg=ql({type:String,values:Il,required:!1}),l0=Symbol("size"),c0=()=>{const e=St(l0,{});return Se(()=>X(e.size)||"")},u0=e=>{const t=e.props,n=q(t)?zl(t.map(r=>[r,{}])):t;e.setPropsDefaults=r=>{if(n){for(const[s,i]of Object.entries(r)){const o=n[s];if(ie(n,s)){if(Vp(o)){n[s]={...o,default:i};continue}n[s]={type:o,default:i}}}e.props=n}}},Jl=(e,t)=>{if(e.install=n=>{for(const r of[e,...Object.values(t??{})])n.component(r.name,r)},t)for(const[n,r]of Object.entries(t))e[n]=r;return u0(e),e};/*! Element Plus Icons Vue v2.3.2 */var f0=ct({name:"Close",__name:"close",setup(e){return(t,n)=>(ue(),ve("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[pe("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}}),Lo=f0;const d0=Ul({size:{type:Kp([Number,String])},color:{type:String}});var h0=ct({name:"ElIcon",inheritAttrs:!1,__name:"icon",props:d0,setup(e){const t=e,n=Kl("icon"),r=Se(()=>{const{size:s,color:i}=t,o=Yp(s);return!o&&!i?{}:{fontSize:o,"--color":i}});return(s,i)=>(ue(),ve("i",fi({class:X(n).b(),style:r.value},s.$attrs),[qr(s.$slots,"default")],16))}}),p0=h0;const Io=Jl(p0),g0=Symbol("formContextKey"),m0=Symbol("formItemContextKey"),y0=(e,t={})=>{const n=we(void 0),r=t.prop?n:a0("size"),s=t.global?n:c0(),i=t.form?{size:void 0}:St(g0,void 0),o=t.formItem?{size:void 0}:St(m0,void 0);return Se(()=>r.value||X(e)||(o==null?void 0:o.size)||(i==null?void 0:i.size)||s.value||"")};var Nr={exports:{}},_0=Nr.exports,No;function v0(){return No||(No=1,(function(e,t){(function(n,r){e.exports=r()})(_0,(function(){var n=1e3,r=6e4,s=36e5,i="millisecond",o="second",a="minute",l="hour",u="day",c="week",d="month",m="quarter",v="year",x="date",p="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,T=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,L={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(H){var k=["th","st","nd","rd"],E=H%100;return"["+H+(k[(E-20)%10]||k[E]||k[0])+"]"}},D=function(H,k,E){var $=String(H);return!$||$.length>=k?H:""+Array(k+1-$.length).join(E)+H},g={s:D,z:function(H){var k=-H.utcOffset(),E=Math.abs(k),$=Math.floor(E/60),O=E%60;return(k<=0?"+":"-")+D($,2,"0")+":"+D(O,2,"0")},m:function H(k,E){if(k.date()<E.date())return-H(E,k);var $=12*(E.year()-k.year())+(E.month()-k.month()),O=k.clone().add($,d),J=E-O<0,Q=k.clone().add($+(J?-1:1),d);return+(-($+(E-O)/(J?O-Q:Q-O))||0)},a:function(H){return H<0?Math.ceil(H)||0:Math.floor(H)},p:function(H){return{M:d,y:v,w:c,d:u,D:x,h:l,m:a,s:o,ms:i,Q:m}[H]||String(H||"").toLowerCase().replace(/s$/,"")},u:function(H){return H===void 0}},M="en",j={};j[M]=L;var ee="$isDayjsObject",ne=function(H){return H instanceof R||!(!H||!H[ee])},B=function H(k,E,$){var O;if(!k)return M;if(typeof k=="string"){var J=k.toLowerCase();j[J]&&(O=J),E&&(j[J]=E,O=J);var Q=k.split("-");if(!O&&Q.length>1)return H(Q[0])}else{var se=k.name;j[se]=k,O=se}return!$&&O&&(M=O),O||!$&&M},U=function(H,k){if(ne(H))return H.clone();var E=typeof k=="object"?k:{};return E.date=H,E.args=arguments,new R(E)},z=g;z.l=B,z.i=ne,z.w=function(H,k){return U(H,{locale:k.$L,utc:k.$u,x:k.$x,$offset:k.$offset})};var R=(function(){function H(E){this.$L=B(E.locale,null,!0),this.parse(E),this.$x=this.$x||E.x||{},this[ee]=!0}var k=H.prototype;return k.parse=function(E){this.$d=(function($){var O=$.date,J=$.utc;if(O===null)return new Date(NaN);if(z.u(O))return new Date;if(O instanceof Date)return new Date(O);if(typeof O=="string"&&!/Z$/i.test(O)){var Q=O.match(b);if(Q){var se=Q[2]-1||0,oe=(Q[7]||"0").substring(0,3);return J?new Date(Date.UTC(Q[1],se,Q[3]||1,Q[4]||0,Q[5]||0,Q[6]||0,oe)):new Date(Q[1],se,Q[3]||1,Q[4]||0,Q[5]||0,Q[6]||0,oe)}}return new Date(O)})(E),this.init()},k.init=function(){var E=this.$d;this.$y=E.getFullYear(),this.$M=E.getMonth(),this.$D=E.getDate(),this.$W=E.getDay(),this.$H=E.getHours(),this.$m=E.getMinutes(),this.$s=E.getSeconds(),this.$ms=E.getMilliseconds()},k.$utils=function(){return z},k.isValid=function(){return this.$d.toString()!==p},k.isSame=function(E,$){var O=U(E);return this.startOf($)<=O&&O<=this.endOf($)},k.isAfter=function(E,$){return U(E)<this.startOf($)},k.isBefore=function(E,$){return this.endOf($)<U(E)},k.$g=function(E,$,O){return z.u(E)?this[$]:this.set(O,E)},k.unix=function(){return Math.floor(this.valueOf()/1e3)},k.valueOf=function(){return this.$d.getTime()},k.startOf=function(E,$){var O=this,J=!!z.u($)||$,Q=z.p(E),se=function(ut,Te){var Tt=z.w(O.$u?Date.UTC(O.$y,Te,ut):new Date(O.$y,Te,ut),O);return J?Tt:Tt.endOf(u)},oe=function(ut,Te){return z.w(O.toDate()[ut].apply(O.toDate("s"),(J?[0,0,0,0]:[23,59,59,999]).slice(Te)),O)},xe=this.$W,Ee=this.$M,qe=this.$D,Ye="set"+(this.$u?"UTC":"");switch(Q){case v:return J?se(1,0):se(31,11);case d:return J?se(1,Ee):se(0,Ee+1);case c:var Ze=this.$locale().weekStart||0,Ct=(xe<Ze?xe+7:xe)-Ze;return se(J?qe-Ct:qe+(6-Ct),Ee);case u:case x:return oe(Ye+"Hours",0);case l:return oe(Ye+"Minutes",1);case a:return oe(Ye+"Seconds",2);case o:return oe(Ye+"Milliseconds",3);default:return this.clone()}},k.endOf=function(E){return this.startOf(E,!1)},k.$set=function(E,$){var O,J=z.p(E),Q="set"+(this.$u?"UTC":""),se=(O={},O[u]=Q+"Date",O[x]=Q+"Date",O[d]=Q+"Month",O[v]=Q+"FullYear",O[l]=Q+"Hours",O[a]=Q+"Minutes",O[o]=Q+"Seconds",O[i]=Q+"Milliseconds",O)[J],oe=J===u?this.$D+($-this.$W):$;if(J===d||J===v){var xe=this.clone().set(x,1);xe.$d[se](oe),xe.init(),this.$d=xe.set(x,Math.min(this.$D,xe.daysInMonth())).$d}else se&&this.$d[se](oe);return this.init(),this},k.set=function(E,$){return this.clone().$set(E,$)},k.get=function(E){return this[z.p(E)]()},k.add=function(E,$){var O,J=this;E=Number(E);var Q=z.p($),se=function(Ee){var qe=U(J);return z.w(qe.date(qe.date()+Math.round(Ee*E)),J)};if(Q===d)return this.set(d,this.$M+E);if(Q===v)return this.set(v,this.$y+E);if(Q===u)return se(1);if(Q===c)return se(7);var oe=(O={},O[a]=r,O[l]=s,O[o]=n,O)[Q]||1,xe=this.$d.getTime()+E*oe;return z.w(xe,this)},k.subtract=function(E,$){return this.add(-1*E,$)},k.format=function(E){var $=this,O=this.$locale();if(!this.isValid())return O.invalidDate||p;var J=E||"YYYY-MM-DDTHH:mm:ssZ",Q=z.z(this),se=this.$H,oe=this.$m,xe=this.$M,Ee=O.weekdays,qe=O.months,Ye=O.meridiem,Ze=function(Te,Tt,f,h){return Te&&(Te[Tt]||Te($,J))||f[Tt].slice(0,h)},Ct=function(Te){return z.s(se%12||12,Te,"0")},ut=Ye||function(Te,Tt,f){var h=Te<12?"AM":"PM";return f?h.toLowerCase():h};return J.replace(T,(function(Te,Tt){return Tt||(function(f){switch(f){case"YY":return String($.$y).slice(-2);case"YYYY":return z.s($.$y,4,"0");case"M":return xe+1;case"MM":return z.s(xe+1,2,"0");case"MMM":return Ze(O.monthsShort,xe,qe,3);case"MMMM":return Ze(qe,xe);case"D":return $.$D;case"DD":return z.s($.$D,2,"0");case"d":return String($.$W);case"dd":return Ze(O.weekdaysMin,$.$W,Ee,2);case"ddd":return Ze(O.weekdaysShort,$.$W,Ee,3);case"dddd":return Ee[$.$W];case"H":return String(se);case"HH":return z.s(se,2,"0");case"h":return Ct(1);case"hh":return Ct(2);case"a":return ut(se,oe,!0);case"A":return ut(se,oe,!1);case"m":return String(oe);case"mm":return z.s(oe,2,"0");case"s":return String($.$s);case"ss":return z.s($.$s,2,"0");case"SSS":return z.s($.$ms,3,"0");case"Z":return Q}return null})(Te)||Q.replace(":","")}))},k.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},k.diff=function(E,$,O){var J,Q=this,se=z.p($),oe=U(E),xe=(oe.utcOffset()-this.utcOffset())*r,Ee=this-oe,qe=function(){return z.m(Q,oe)};switch(se){case v:J=qe()/12;break;case d:J=qe();break;case m:J=qe()/3;break;case c:J=(Ee-xe)/6048e5;break;case u:J=(Ee-xe)/864e5;break;case l:J=Ee/s;break;case a:J=Ee/r;break;case o:J=Ee/n;break;default:J=Ee}return O?J:z.a(J)},k.daysInMonth=function(){return this.endOf(d).$D},k.$locale=function(){return j[this.$L]},k.locale=function(E,$){if(!E)return this.$L;var O=this.clone(),J=B(E,$,!0);return J&&(O.$L=J),O},k.clone=function(){return z.w(this.$d,this)},k.toDate=function(){return new Date(this.valueOf())},k.toJSON=function(){return this.isValid()?this.toISOString():null},k.toISOString=function(){return this.$d.toISOString()},k.toString=function(){return this.$d.toUTCString()},H})(),de=R.prototype;return U.prototype=de,[["$ms",i],["$s",o],["$m",a],["$H",l],["$W",u],["$M",d],["$y",v],["$D",x]].forEach((function(H){de[H[1]]=function(k){return this.$g(k,H[0],H[1])}})),U.extend=function(H,k){return H.$i||(H(k,R,U),H.$i=!0),U},U.locale=B,U.isDayjs=ne,U.unix=function(H){return U(1e3*H)},U.en=j[M],U.Ls=j,U.p={},U}))})(Nr)),Nr.exports}var Ig=v0();const b0=Ul({type:{type:String,values:["primary","success","info","warning","danger"],default:"primary"},closable:Boolean,disableTransitions:Boolean,hit:Boolean,color:String,size:{type:String,values:Il},effect:{type:String,values:["dark","light","plain"],default:"light"},round:Boolean}),w0={close:e=>e instanceof MouseEvent,click:e=>e instanceof MouseEvent},x0=["aria-label"],S0=["aria-label"];var C0=ct({name:"ElTag",__name:"tag",props:b0,emits:w0,setup(e,{emit:t}){const n=e,r=t,s=y0(),{t:i}=r0(),o=Kl("tag"),a=Se(()=>{const{type:d,hit:m,effect:v,closable:x,round:p}=n;return[o.b(),o.is("closable",x),o.m(d||"primary"),o.m(s.value),o.m(v),o.is("hit",m),o.is("round",p)]}),l=d=>{r("close",d)},u=d=>{r("click",d)},c=d=>{var m,v,x;(x=(v=(m=d==null?void 0:d.component)==null?void 0:m.subTree)==null?void 0:v.component)!=null&&x.bum&&(d.component.subTree.component.bum=null)};return(d,m)=>e.disableTransitions?(ue(),ve("span",{key:0,class:rt(a.value),style:Fn({backgroundColor:e.color}),onClick:u},[pe("span",{class:rt(X(o).e("content"))},[qr(d.$slots,"default")],2),e.closable?(ue(),ve("button",{key:0,"aria-label":X(i)("el.tag.close"),class:rt(X(o).e("close")),type:"button",onClick:yo(l,["stop"])},[_e(X(Io),null,{default:wn(()=>[_e(X(Lo))]),_:1})],10,x0)):Cn("v-if",!0)],6)):(ue(),Jt(vf,{key:1,name:`${X(o).namespace.value}-zoom-in-center`,appear:"",onVnodeMounted:c},{default:wn(()=>[pe("span",{class:rt(a.value),style:Fn({backgroundColor:e.color}),onClick:u},[pe("span",{class:rt(X(o).e("content"))},[qr(d.$slots,"default")],2),e.closable?(ue(),ve("button",{key:0,"aria-label":X(i)("el.tag.close"),class:rt(X(o).e("close")),type:"button",onClick:yo(l,["stop"])},[_e(X(Io),null,{default:wn(()=>[_e(X(Lo))]),_:1})],10,S0)):Cn("v-if",!0)],6)]),_:3},8,["name"]))}}),T0=C0;const P0=Jl(T0),O0={toolbox:{get title(){return Z.t("tag.toolboxTitle")},icon:'<svg width="18" height="18" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><rect x="4" y="7" width="16" height="10" rx="5" ry="5" fill="none" stroke="currentColor" stroke-width="2"/><circle cx="8" cy="12" r="1.4" fill="currentColor"/></svg>'},propertyPanel:{get title(){return Z.t("tag.propertyPanelTitle")},get fields(){return[{key:"tagName",label:Z.t("tag.properties.tagName"),placeholder:Z.t("tag.defaultTagName")},{key:"type",label:Z.t("tag.properties.type"),type:"select",options:[{label:Z.t("tag.types.default"),value:""},{label:Z.t("tag.types.primary"),value:"primary"},{label:Z.t("tag.types.success"),value:"success"},{label:Z.t("tag.types.info"),value:"info"},{label:Z.t("tag.types.warning"),value:"warning"},{label:Z.t("tag.types.danger"),value:"danger"}]},{key:"size",label:Z.t("tag.properties.size"),type:"select",options:[{label:Z.t("tag.sizes.default"),value:""},{label:Z.t("tag.sizes.large"),value:"large"},{label:Z.t("tag.sizes.medium"),value:"default"},{label:Z.t("tag.sizes.small"),value:"small"}]},{key:"color",label:Z.t("tag.properties.color"),placeholder:Z.t("tag.properties.colorPlaceholder")},{key:"closable",label:Z.t("tag.properties.closable"),type:"checkbox"}]}},createInitialProps:()=>({tagName:Z.t("tag.defaultTagName"),closable:!1,size:"",color:"",type:"success"}),normalizeProps:e=>{var t;return{edit:e.edit??!1,tagName:((t=e.tagName)==null?void 0:t.trim())||Z.t("tag.defaultTagName"),closable:e.closable===!0,size:e.size??"",color:e.color??"",type:e.type??"success"}},serialize:e=>{var t;return{tagName:((t=e.tagName)==null?void 0:t.trim())||Z.t("tag.defaultTagName"),closable:e.closable??!1,size:e.size??"",color:e.color??"",type:e.type??""}}},E0=ct({__name:"MTag",props:{edit:{type:Boolean},tagName:{},closable:{type:Boolean},size:{},color:{},type:{},onChange:{type:Function},onToolChange:{type:Function}},setup(e){const t=e,n=we(null);let r=null;function s(u){var d,m;const c={edit:t.edit,tagName:t.tagName??"",closable:t.closable??!1,size:t.size??"",color:t.color??"",type:t.type??"",...u};(d=t.onToolChange)==null||d.call(t,c),(m=t.onChange)==null||m.call(t,c)}function i(){s({closable:t.closable??!1})}function o(){r!==null&&(window.clearTimeout(r),r=null)}function a(){var T;const u=n.value;if(!u)return;const c=u.closest(".ce-block"),d=(T=u.closest(".codex-editor"))==null?void 0:T.querySelector(".ce-toolbar"),m=d==null?void 0:d.querySelector(".ce-toolbar__plus");if(!c||!d||!m)return;const v=c.getBoundingClientRect(),x=u.getBoundingClientRect(),p=m.getBoundingClientRect().height||26,b=c.offsetTop+(x.top-v.top)+(x.height-p)/2;d.style.top=`${Math.round(b)}px`}function l(){o(),r=window.setTimeout(()=>{a()},0)}return br(()=>{Ln(()=>{var u,c;(u=n.value)==null||u.addEventListener("mouseenter",l),(c=n.value)==null||c.addEventListener("mousemove",l)})}),wr(()=>{var u,c;o(),(u=n.value)==null||u.removeEventListener("mouseenter",l),(c=n.value)==null||c.removeEventListener("mousemove",l)}),(u,c)=>(ue(),ve("div",{ref_key:"rootRef",ref:n,class:"ce-tag-tool","data-testid":"editor-tag-tool"},[_e(X(P0),{"data-testid":"editor-tag-value",closable:e.closable,size:e.size||void 0,color:e.color||void 0,type:e.type||void 0,onClose:i},{default:wn(()=>[gl(Fe(e.tagName),1)]),_:1},8,["closable","size","color","type"])],512))}}),A0=Cr(E0,[["__scopeId","data-v-f62600c2"]]),Ql={MInput:{component:kr(hh),...fh},MLink:{component:kr(yh),...gh},MTag:{component:kr(A0),...O0}};function Ng(){return Object.entries(Ql)}function Ro(e){return Ql[e]}function M0(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID().slice(0,10):Math.random().toString(36).slice(2,12)}function xi(e,t=M0()){return{id:t,type:"paragraph",data:{text:e}}}function tr(e){return typeof e.data.text=="string"?e.data.text:""}function Wl(){return[xi("")]}function D0(e){return JSON.parse(JSON.stringify(e))}function Gl(e){return typeof e!="object"||e===null||Array.isArray(e)?{}:D0(e)}function $0(e){return{id:e.id,type:e.type,data:Gl(e.data)}}function F0(e){const t=[];for(const n of e){if(n.type==="paragraph"){const r=t[t.length-1];(r==null?void 0:r.type)==="paragraph"?r.data.text=tr(r)+tr(n):t.push(xi(tr(n),n.id));continue}t.push($0(n))}return t.length?t:Wl()}function k0(e){if(!Array.isArray(e))return Wl();const t=[];return e.forEach(n=>{if(typeof n!="object"||n===null)return;const r=n;if(typeof r.id!="string"||typeof r.type!="string"||typeof r.data!="object"||r.data===null||Array.isArray(r.data))return;const s={id:r.id,type:r.type,data:Gl(r.data)};t.push(s.type==="paragraph"?xi(tr(s),s.id):s)}),F0(t)}const L0={class:"global-call-content","data-testid":"global-call-content"},I0={key:0,class:"global-call-content__text"},N0={key:0,class:"global-call-content__text"},R0={key:1,class:"global-call-content__token"},j0={key:2,class:"global-call-content__unknown"},H0=ct({__name:"GlobalCallContentRenderer",props:{content:{}},setup(e){const t=e,n=Se(()=>typeof t.content=="string"),r=Se(()=>typeof t.content=="string"?t.content:""),s=Se(()=>Array.isArray(t.content)?k0(t.content):[]);function i(l){var u;return((u=Ro(l))==null?void 0:u.component)??null}function o(l){return tr(l)}function a(l){var c;const u=Ro(l.type);return u?u.normalizeProps({...((c=u.createInitialProps)==null?void 0:c.call(u))??{},...l.data,edit:!1}):{edit:!1}}return(l,u)=>(ue(),ve("div",L0,[n.value?(ue(),ve("span",I0,Fe(r.value),1)):(ue(!0),ve(ke,{key:1},Qa(s.value,(c,d)=>(ue(),ve(ke,{key:`${c.id}-${c.type}-${d}`},[c.type==="paragraph"?(ue(),ve("span",N0,Fe(o(c)),1)):i(c.type)?(ue(),ve("span",R0,[(ue(),Jt(Cu(i(c.type)),fi({ref_for:!0},a(c)),null,16))])):(ue(),ve("span",j0,Fe(c.type),1))],64))),128))]))}}),jo=Cr(H0,[["__scopeId","data-v-66a3e1c9"]]),B0={class:"global-call-host","data-testid":"global-call-host"},z0={key:0,class:"global-call-dialog-overlay","data-testid":"global-call-dialog-overlay"},V0=["aria-label","aria-labelledby","data-testid"],q0=["id"],U0={class:"global-call-dialog__body","data-testid":"global-call-dialog-content"},K0={class:"global-call-dialog__actions"},J0=["aria-label"],Q0=["data-type"],W0=3e3,G0=ct({__name:"GlobalCallHost",setup(e,{expose:t}){const{t:n}=gi(),r=we(null),s=we([]),i=we(null),o=we([]),a=new Map;let l=0;const u=Se(()=>i.value?`global-call-dialog-title-${i.value.id}`:void 0);function c(g){return new Promise(M=>{s.value.push({id:v(),kind:"alert",title:g.title,content:g.content,resolve:M}),x()})}function d(g){return new Promise(M=>{s.value.push({id:v(),kind:"confirm",title:g.title,content:g.content,resolve:M}),x()})}function m(g){return new Promise(M=>{const j=v(),ee={id:j,type:g.type,content:g.content,resolve:M};o.value=[...o.value,ee],a.set(j,window.setTimeout(()=>{b(j)},W0))})}function v(){return l+=1,l}function x(){i.value||!s.value.length||(i.value=s.value.shift()??null,Ln(()=>{var g;(g=r.value)==null||g.focus()}))}function p(g){const M=i.value;M&&(i.value=null,M.kind==="confirm"?M.resolve(g):M.resolve(),Ln(()=>{x()}))}function b(g){const M=o.value.find(ee=>ee.id===g);if(!M)return;const j=a.get(g);j!==void 0&&(window.clearTimeout(j),a.delete(g)),o.value=o.value.filter(ee=>ee.id!==g),M.resolve()}function T(g){g.key==="Escape"&&(g.preventDefault(),p(!1))}function L(){var g;return((g=i.value)==null?void 0:g.kind)==="confirm"?n("globalCalls.confirmRoleLabel"):n("globalCalls.alertRoleLabel")}function D(g){return`global-call-message--${g}`}return wr(()=>{a.forEach(g=>{window.clearTimeout(g)}),a.clear()}),t({showAlert:c,showConfirm:d,showMessage:m}),(g,M)=>(ue(),ve("div",B0,[i.value?(ue(),ve("div",z0,[pe("section",{ref_key:"dialogPanelRef",ref:r,class:"global-call-dialog",role:"dialog","aria-modal":"true","aria-label":L(),"aria-labelledby":u.value,tabindex:"-1","data-testid":`global-call-${i.value.kind}`,onKeydown:T},[pe("h2",{id:u.value,class:"global-call-dialog__title","data-testid":"global-call-dialog-title"},Fe(i.value.title),9,q0),pe("div",U0,[_e(jo,{content:i.value.content},null,8,["content"])]),pe("div",K0,[i.value.kind==="confirm"?(ue(),ve("button",{key:0,type:"button",class:"global-call-dialog__button global-call-dialog__button--secondary","data-testid":"global-call-cancel",onClick:M[0]||(M[0]=j=>p(!1))},Fe(X(n)("globalCalls.cancel")),1)):Cn("",!0),pe("button",{type:"button",class:"global-call-dialog__button global-call-dialog__button--primary","data-testid":"global-call-ok",onClick:M[1]||(M[1]=j=>p(!0))},Fe(X(n)("globalCalls.ok")),1)])],40,V0)])):Cn("",!0),o.value.length?(ue(),ve("div",{key:1,class:"global-call-message-stack","data-testid":"global-call-message-stack","aria-label":X(n)("globalCalls.messageRoleLabel")},[(ue(!0),ve(ke,null,Qa(o.value,j=>(ue(),ve("div",{key:j.id,class:rt(["global-call-message",D(j.type)]),role:"status","data-type":j.type,"data-testid":"global-call-message"},[_e(jo,{content:j.content},null,8,["content"])],10,Q0))),128))],8,J0)):Cn("",!0)]))}}),Y0=Cr(G0,[["__scopeId","data-v-81ffa7d1"]]);function ot(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Rn(e){return e===null||typeof e=="string"||typeof e=="boolean"?!0:typeof e=="number"?Number.isFinite(e):Array.isArray(e)?e.every(t=>Rn(t)):ot(e)?Object.values(e).every(t=>Rn(t)):!1}function Z0(e){return ot(e)&&Rn(e)}function Wr(e){return JSON.parse(JSON.stringify(e))}function Ho(e){return JSON.parse(JSON.stringify(e))}function Yl(e){return JSON.parse(JSON.stringify(e))}function mn(e,t){return Object.keys(e).every(n=>t.includes(n))}function Kn(e,t){if(t===void 0)return e;if(typeof t=="string")return{...e,description:t}}function Us(e){if(!(!ot(e)||typeof e.type!="string")){if(e.type==="object"){if(!mn(e,["type","properties","required","description"])||!ot(e.properties))return;const t={};for(const[r,s]of Object.entries(e.properties)){const i=Us(s);if(!i)return;t[r]=i}const n={type:"object",properties:t};if(e.required!==void 0){if(!Array.isArray(e.required)||!e.required.every(r=>typeof r=="string"))return;n.required=[...e.required]}return Kn(n,e.description)}if(e.type==="array"){if(!mn(e,["type","items","description"]))return;const t=Us(e.items);return t?Kn({type:"array",items:t},e.description):void 0}if(e.type==="string"){if(!mn(e,["type","enum","description"]))return;const t={type:"string"};if(e.enum!==void 0){if(!Array.isArray(e.enum)||!e.enum.every(n=>typeof n=="string"))return;t.enum=[...e.enum]}return Kn(t,e.description)}if(e.type==="number"){if(!mn(e,["type","minimum","maximum","description"]))return;const t={type:"number"};if(e.minimum!==void 0){if(typeof e.minimum!="number"||!Number.isFinite(e.minimum))return;t.minimum=e.minimum}if(e.maximum!==void 0){if(typeof e.maximum!="number"||!Number.isFinite(e.maximum))return;t.maximum=e.maximum}return Kn(t,e.description)}if(e.type==="boolean")return mn(e,["type","description"])?Kn({type:"boolean"},e.description):void 0;if(e.type==="null"&&mn(e,["type"]))return{type:"null"}}}function Ks(e,t){if(e.type===t.type){if(e.type==="object"&&t.type==="object"){const n={},r=new Set([...Object.keys(e.properties),...Object.keys(t.properties)]);for(const s of r){const i=e.properties[s],o=t.properties[s];if(i&&o){const a=Ks(i,o);if(!a)return;n[s]=a;continue}n[s]=Ho(i??o)}return{type:"object",properties:n}}if(e.type==="array"&&t.type==="array"){const n=Ks(e.items,t.items);return n?{type:"array",items:n}:void 0}return Ho(e)}}function Js(e){if(e===null)return{ok:!0,schema:{type:"null"}};if(typeof e=="string")return{ok:!0,schema:{type:"string"}};if(typeof e=="number")return{ok:!0,schema:{type:"number"}};if(typeof e=="boolean")return{ok:!0,schema:{type:"boolean"}};if(Array.isArray(e)){if(!e.length)return{ok:!1,reason:"emptyArray"};let n;for(const r of e){const s=Js(r);if(!s.ok)return s;if(!n){n=s.schema;continue}const i=Ks(n,s.schema);if(!i)return{ok:!1,reason:"mixedArray"};n=i}return{ok:!0,schema:{type:"array",items:n}}}const t={};for(const[n,r]of Object.entries(e)){const s=Js(r);if(!s.ok)return s;t[n]=s.schema}return{ok:!0,schema:{type:"object",properties:t}}}function Si(e,t){return e?`${e}.${t}`:t}function Zl(e){return e?`${e}[]`:"[]"}function hs(e){return e.replace(/\[\]/g,"").split(".").filter(Boolean).pop()||e||"root"}function Ci(e){return e==="number"?"number":e==="boolean"?"switch":e==="object"?"object":e==="array"?"array":"text"}function Xl(e){return e==="string"||e==="number"||e==="boolean"||e==="null"}function ec(e,t,n=hs(e.path)){return{path:e.path,label:n,type:e.type,required:e.required,enabled:t,componentHint:e.componentHint}}function Qs(e,t="",n=0,r=!1){if(!e)return[];const s=t?hs(t):"root",i={path:t,displayPath:t||"root",name:s,type:e.type,required:r,selectable:Xl(e.type),componentHint:Ci(e.type),depth:n,children:[]};if(e.type==="object"){const o=new Set(e.required??[]);i.children=Object.entries(e.properties).flatMap(([a,l])=>Qs(l,Si(t,a),n+1,o.has(a)))}if(e.type==="array"){const o=Zl(t);i.children=Qs(e.items,o,n+1,r)}return[i]}function tc(e){return e.flatMap(t=>[t,...tc(t.children)])}function nc(e){if(!e)return[];const t=[];function n(r,s){if(r.type==="array"){t.push({path:s,label:s?`${s}[]`:"root[]"}),n(r.items,Zl(s));return}r.type==="object"&&Object.entries(r.properties).forEach(([i,o])=>{n(o,Si(s,i))})}return n(e,""),t}function X0(e,t){if(!e)return;if(!t)return e.type==="array"?e.items:void 0;const n=t.split(".").filter(Boolean);let r=e;for(const s of n){if(!r||r.type!=="object")return;r=r.properties[s]}return(r==null?void 0:r.type)==="array"?r.items:void 0}function eg(e,t="",n=!1){return tc(Qs(e,t)).filter(r=>(n||r.path!==t)&&r.selectable)}function tg(e,t){const n=X0(e,t),r=t?`${t}[]`:"[]";return eg(n,r,!0).map(s=>ec(s,!0))}function ng(e){const t=(e==null?void 0:e.type)==="array"?e.items:e;if((t==null?void 0:t.type)!=="object")return[];const n=[];function r(s,i,o){if(Xl(s.type)){n.push(ec({path:i,name:hs(i),type:s.type,required:o,componentHint:Ci(s.type)},!0));return}if(s.type!=="object")return;const a=new Set(s.required??[]);Object.entries(s.properties).forEach(([l,u])=>{r(u,Si(i,l),a.has(l))})}return Object.entries(t.properties).forEach(([s,i])=>{r(i,s,(t.required??[]).includes(s))}),n}function Ws(e,t){if(!ot(e))return t?Yl(t):void 0;const n=typeof e.path=="string"&&e.path?e.path:t==null?void 0:t.path;if(!n)return;const r=e.type==="object"||e.type==="array"||e.type==="string"||e.type==="number"||e.type==="boolean"||e.type==="null"?e.type:(t==null?void 0:t.type)??"string",s=typeof e.label=="string"&&e.label.trim()?e.label.trim():(t==null?void 0:t.label)??hs(n),i=typeof e.required=="boolean"?e.required:(t==null?void 0:t.required)??!1,o=typeof e.enabled=="boolean"?e.enabled:(t==null?void 0:t.enabled)??!0,a=e.componentHint==="text"||e.componentHint==="number"||e.componentHint==="switch"||e.componentHint==="object"||e.componentHint==="array"?e.componentHint:(t==null?void 0:t.componentHint)??Ci(r);return{path:n,label:s,type:r,required:i,enabled:o,componentHint:a}}function Bo(e,t){const n=new Map;return Array.isArray(t)&&t.forEach(r=>{const s=Ws(r);s&&n.set(s.path,s)}),e.map(r=>{const s=n.get(r.path);return s?{...r,label:s.label||r.label,enabled:s.enabled}:Yl(r)})}function rg(e){var n;const t=nc(e);return t.length===1?t[0].path:((n=t[0])==null?void 0:n.path)??""}function zo(e,t){var l,u,c;if(!e)return;const n=nc(e),r=((l=t==null?void 0:t.list)==null?void 0:l.recordPath)??"",s=n.some(d=>d.path===r)?r:rg(e),i=n.length?Bo(tg(e,s),(u=t==null?void 0:t.list)==null?void 0:u.fields):[],o=Bo(ng(e),(c=t==null?void 0:t.form)==null?void 0:c.fields),a={};return n.length&&(a.list={recordPath:s,fields:i}),o.length&&(a.form={fields:o}),a.list||a.form?a:void 0}function sg(e,t){if(!ot(e))return t?zo(t):void 0;const n={};return ot(e.list)&&(n.list={recordPath:typeof e.list.recordPath=="string"?e.list.recordPath:"",fields:Array.isArray(e.list.fields)?e.list.fields.map(r=>Ws(r)).filter(r=>r!==void 0):[]}),ot(e.form)&&(n.form={fields:Array.isArray(e.form.fields)?e.form.fields.map(r=>Ws(r)).filter(r=>r!==void 0):[]}),t?zo(t,n):n.list||n.form?n:void 0}class nn extends Error{constructor(n,r,s){super(r);Tr(this,"code");Tr(this,"status");Tr(this,"statusText");this.name="DatasourceError",this.code=n,this.status=s==null?void 0:s.status,this.statusText=s==null?void 0:s.statusText}}const ig=["string","number","boolean","null","object","array"];function jn(e){return typeof e=="string"?e:""}function og(e){return e==="POST"?"POST":"GET"}function ag(e){return ig.includes(e)?e:"string"}function lg(e,t={}){return Rn(e)?Wr(e):t}function Rg(e){return e==="number"?0:e==="boolean"?!1:e==="null"?null:e==="object"?{}:e==="array"?[]:""}function rc(e,t){return e==="string"?typeof t=="string"?t:jn(t):e==="number"?typeof t=="number"&&Number.isFinite(t)?t:0:e==="boolean"?typeof t=="boolean"?t:!1:e==="null"?null:e==="object"?Z0(t)?Wr(t):{}:Array.isArray(t)&&Rn(t)?Wr(t):[]}function Vo(e){return Array.isArray(e)?e.filter(t=>ot(t)).map(t=>({key:jn(t.key),mock:jn(t.mock)})):[]}function cg(e){return Array.isArray(e)?e.filter(t=>ot(t)).map(t=>{const n=ag(t.dataType);return{key:jn(t.key),dataType:n,mock:rc(n,t.mock)}}):[]}function jg(){return{type:"API",domain:"",path:"",method:"GET",headerData:[],bodyData:[],queryData:[]}}function ug(){return{type:"JSON",rawData:{}}}function fg(e){if(!ot(e))return ug();const t=Us(e.jsonSchema),n=sg(e.schemaSelections,t);if(e.type==="API"){const s={type:"API",domain:jn(e.domain),path:jn(e.path),method:og(e.method),headerData:Vo(e.headerData),bodyData:cg(e.bodyData),queryData:Vo(e.queryData)};return t&&(s.jsonSchema=t),n&&(s.schemaSelections=n),s}const r={type:"JSON",rawData:lg(e.rawData,{})};return t&&(r.jsonSchema=t),n&&(r.schemaSelections=n),r}function dg(e){const t=e.domain.trim(),n=e.path.trim(),r=/^[a-z][a-z\d+\-.]*:/i.test(n),s=t||(typeof window<"u"?window.location.origin:"");if(!s&&!r)throw new TypeError("API domain is required when calling a relative datasource path outside the browser.");const i=s?new URL(n||"/",s.endsWith("/")?s:`${s}/`):new URL(n||"/");return e.queryData.forEach(o=>{const a=o.key.trim();a&&i.searchParams.append(a,o.mock)}),i.toString()}function hg(e){const t=new Headers;return e.headerData.forEach(n=>{const r=n.key.trim();r&&t.set(r,n.mock)}),e.method==="POST"&&!t.has("Content-Type")&&t.set("Content-Type","application/json"),t}function pg(e){if(e.method!=="POST")return;const t=e.bodyData.reduce((n,r)=>{const s=r.key.trim();return s&&(n[s]=rc(r.dataType,r.mock)),n},{});return JSON.stringify(t)}async function gg(e){if(!(e.headers.get("content-type")??"").toLowerCase().includes("json"))throw new nn("nonJsonResponse","The API response is not JSON.");try{const n=await e.json();if(!Rn(n))throw new nn("invalidJsonResponse","The API response is not valid JSON.");return n}catch(n){throw n instanceof nn?n:new nn("invalidJsonResponse","The API response is not valid JSON.")}}const Ti=async e=>{const t=fg(e);if(t.type==="JSON")return Wr(t.rawData);const n=await fetch(dg(t),{method:t.method,headers:hg(t),body:pg(t)});if(!n.ok)throw new nn("apiRequestFailed",`API request failed: ${n.status} ${n.statusText}`.trim(),{status:n.status,statusText:n.statusText});return await gg(n)},sc=async e=>{const t=await Ti(e),n=Js(t);if(n.ok)return n.schema;throw n.reason==="emptyArray"?new nn("emptyArraySchema","Cannot infer JSON Schema from an empty array."):new nn("mixedArraySchema","The array contains incompatible types, so JSON Schema cannot be inferred.")},mg=new Set(["success","warning","info","error"]);let qo=null,$r=null,Fr=null;const ic=(function(t,n){return Pi(r=>r.showAlert(lc(t,n)))}),oc=(function(t,n){return Pi(r=>r.showConfirm(lc(t,n)))}),ac=(function(t,n){return Pi(r=>r.showMessage(wg(t,n)))});function yg(e){e.config.globalProperties.$alert=ic,e.config.globalProperties.$confirm=oc,e.config.globalProperties.$message=ac,e.config.globalProperties.$remote=Ti,e.config.globalProperties.$schema=sc,vg()}const _g={install:yg};function vg(){if(typeof window>"u")return;const e=window;e.$alert=ic,e.$confirm=oc,e.$message=ac,e.$remote=Ti,e.$schema=sc}function Pi(e){try{return e(bg())}catch(t){return Promise.reject(t)}}function bg(){if($r)return $r;if(typeof document>"u")throw new Error("Global call functions require a browser document.");return Fr=document.createElement("div"),Fr.setAttribute("data-testid","global-call-host-container"),document.body.appendChild(Fr),qo=bl(Y0),$r=qo.mount(Fr),$r}function lc(e,t){return typeof e=="object"&&e!==null?{title:String(e.title??""),content:Gr(e.content)}:{title:e,content:Gr(t)}}function wg(e,t){return typeof e=="object"&&e!==null?{type:Uo(e.type),content:Gr(e.content)}:{type:Uo(e),content:Gr(t)}}function Gr(e){return typeof e=="string"||Array.isArray(e)?e:""}function Uo(e){return mg.has(e)?e:"info"}const Oi=bl(lh),xg=new $l;Oi.use(Pd,{queryClient:xg});Oi.use(_g);Oi.mount("#app");function Sg(){if(!("serviceWorker"in navigator))return;const e=`/sw.js?v=${encodeURIComponent("2026-05-06T03:56:55.025Z")}`;let t=!1;const n=r=>{r.waiting&&r.waiting.postMessage({type:"SKIP_WAITING"})};navigator.serviceWorker.addEventListener("controllerchange",()=>{t||(t=!0,window.location.reload())}),window.addEventListener("load",async()=>{try{const r=await navigator.serviceWorker.register(e);n(r),r.addEventListener("updatefound",()=>{const s=r.installing;s&&s.addEventListener("statechange",()=>{s.state==="installed"&&navigator.serviceWorker.controller&&n(r)})}),window.setInterval(()=>{r.update().catch(()=>{})},60*1e3)}catch(r){console.error("Service worker registration failed:",r)}})}Sg();export{sc as $,Gl as A,bl as B,Fg as C,Wl as D,Z as E,ke as F,F0 as G,M0 as H,$0 as I,xi as J,fg as K,Jc as L,si as M,jg as N,rc as O,ig as P,tc as Q,nc as R,Rn as S,Wr as T,Us as U,zo as V,og as W,ag as X,Rg as Y,Z0 as Z,Cr as _,_e as a,ug as a0,Qs as a1,lg as a2,Ho as a3,sg as a4,nn as a5,Og as a6,$g as a7,O0 as a8,gh as a9,fh as aa,kr as ab,A0 as ac,yh as ad,hh as ae,Bi as af,Eo as ag,ff as ah,pe as b,ve as c,ct as d,Cn as e,gi as f,Jt as g,Se as h,br as i,wr as j,Lr as k,k0 as l,Fn as m,Ln as n,ue as o,Qa as p,Ng as q,we as r,fi as s,Fe as t,X as u,Cu as v,yo as w,rt as x,tr as y,Ro as z};
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MPage-PbJKUfhk.js","assets/editorjs-hCuh8vdW.js","assets/index-C0VPLP4t.js","assets/index-qSOXU8wC.css","assets/MForm-Ct41vjbV.js","assets/MForm-DHyGtILs.css"])))=>i.map(i=>d[i]);
2
- var Qt=Object.defineProperty;var ea=(e,a,u)=>a in e?Qt(e,a,{enumerable:!0,configurable:!0,writable:!0,value:u}):e[a]=u;var Ce=(e,a,u)=>ea(e,typeof a!="symbol"?a+"":a,u);import{A as He,F as ta,E as aa}from"./editorjs-hCuh8vdW.js";import{d as ge,i as Ye,j as Ze,k as ie,n as ve,l as he,o as r,c,b as i,m as pe,F as V,p as W,w as Y,t as h,u as k,q as oa,e as L,g as be,s as Qe,v as Ie,x as te,f as xe,r as X,y as Ae,z as me,A as ut,B as qe,C as ke,D as $t,E as P,G as pt,H as la,I as Re,J as Ke,_ as Se,h as U,K as fe,L as Le,M as St,N as na,O as mt,P as sa,Q as ra,R as ca,S as yt,T as ze,U as ia,V as Fe,W as da,X as ua,Y as pa,$ as ma,Z as ya,a0 as fa,a1 as va,a2 as ha,a3 as ft,a4 as vt,a5 as _a,a6 as ba,a7 as Et,a as Nt,a8 as ga,a9 as ka,aa as wa,ab as de,ac as ht,ad as _t,ae as bt,af as Ve,ag as je}from"./index-C0VPLP4t.js";const Ca={class:"ce-advance-input-tool","data-testid":"editor-advance-input-tool"},Ta={key:0,class:"ce-advance-input-tool__editor-shell"},xa=["data-testid","onMousedown"],$a={key:1,class:"ce-advance-input-tool__preview","data-testid":"preview-advance-input-value"},Sa={key:0,class:"ce-advance-input-tool__preview-text"},Ea={key:1,class:"ce-advance-input-tool__preview-token"},Na={class:"ce-advance-input-tool__dialog-header"},Da={class:"ce-advance-input-tool__dialog-title","data-testid":"advance-input-embedded-property-title"},Pa={type:"submit",class:"ce-advance-input-tool__dialog-close","data-testid":"advance-input-embedded-property-close"},Ia={key:0,class:"ce-advance-input-tool__dialog-body"},Aa=["checked","data-testid","onChange"],Ma={class:"ce-advance-input-tool__dialog-label"},Oa={class:"ce-advance-input-tool__dialog-label"},Ba=["value","data-testid","onChange"],Ra=["value"],La={class:"ce-advance-input-tool__dialog-label"},za=["value","placeholder","data-testid","onInput"],Fa=ke({toolbox:{get title(){return P.t("advanceInput.toolboxTitle")},icon:'<svg width="18" height="18" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><rect x="3" y="5" width="18" height="14" rx="3" ry="3" fill="none" stroke="currentColor" stroke-width="2"/><path d="M7 10h5M7 14h3M14 10h3M14 14h3" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>'},createInitialProps:()=>({value:$t()}),normalizeProps:e=>({edit:e.edit??!1,value:he(e.value)}),serialize:e=>({value:he(e.value)})}),Va=ge({__name:"MAdvanceInput",props:{edit:{type:Boolean},value:{},onChange:{type:Function},onToolChange:{type:Function}},setup(e){const a=e,{t:u}=xe(),_=X(null),x=X(null),N=X(!1),O=X({left:0,top:0}),d=X(null),m=new Map;let v=!1,w="";function D(y){return pt(y)}function z(y){return JSON.stringify(D(y))}function B(y){var s;const p=me(y);if(!p)throw new Error(`Unknown inline component "${y}".`);const t=p.normalizeProps({...((s=p.createInitialProps)==null?void 0:s.call(p))??{},edit:!1});return{id:la(),type:y,data:ut(p.serialize(t))}}function j(){m.forEach(y=>{y.app.unmount()}),m.clear()}function K(y){var H;const p=Re(y),t=me(p.type);if(!t){const F=document.createElement("span");return F.className="ce-advance-input-tool__token ce-advance-input-tool__token--unknown",F.dataset.segmentType="component",F.dataset.blockId=p.id,F.dataset.block=JSON.stringify(p),F.textContent=p.type,F}const s=document.createElement("span");s.className="ce-advance-input-tool__token",s.dataset.segmentType="component",s.dataset.blockId=p.id,s.dataset.block=JSON.stringify(p),s.contentEditable="false",s.setAttribute("data-testid",`editor-advance-input-token-${p.type}`);const b=document.createElement("span");b.className="ce-advance-input-tool__token-mount",s.appendChild(b);const E=t.normalizeProps({...((H=t.createInitialProps)==null?void 0:H.call(t))??{},...p.data,edit:!1}),M=qe(t.component,E);return M.mount(b),s.addEventListener("click",F=>{F.preventDefault(),F.stopPropagation(),ue(p.id)}),m.set(p.id,{app:M,block:Re(p),mountPoint:b,wrapper:s}),s}function $(y,p=!1){const t=_.value;if(!t)return;v=!0,j(),t.innerHTML="";const s=he(y);for(const b of s){if(b.type==="paragraph"){t.appendChild(document.createTextNode(Ae(b)));continue}t.appendChild(K(b)),t.appendChild(document.createTextNode("​"))}t.childNodes.length||t.appendChild(document.createTextNode("")),w=z(s),v=!1,p&&ve(()=>{ae(t)})}function G(){const y=_.value;if(!y)return $t();const p=[];return y.childNodes.forEach(t=>{if(t.nodeType===Node.TEXT_NODE){const s=(t.textContent??"").replace(/\u200B/g,"");p.push(Ke(s));return}if(t instanceof HTMLElement){if(t.dataset.segmentType==="component"){const s=t.dataset.blockId??"",b=m.get(s),E=t.dataset.block?JSON.parse(t.dataset.block):null,M=(b==null?void 0:b.block)??E;M&&p.push(Re(M));return}p.push(Ke((t.textContent??"").replace(/\u200B/g,"")))}}),pt(p)}function Z(y){var t,s;w=z(y);const p={edit:a.edit,value:y};(t=a.onToolChange)==null||t.call(a,p),(s=a.onChange)==null||s.call(a,p)}function A(){if(v)return;const y=D(G());z(y)!==w&&Z(y)}function ae(y){const p=window.getSelection();if(!p)return;const t=document.createRange();t.selectNodeContents(y),t.collapse(!1),p.removeAllRanges(),p.addRange(t)}function oe(){const y=_.value;y&&y.focus()}function le(){const y=_.value,p=window.getSelection();if(!y||!p||p.rangeCount===0)return null;const t=p.getRangeAt(0);return y.contains(t.startContainer)?{root:y,selection:p,range:t}:null}function I(){const y=le();if(!y||!y.selection.isCollapsed){N.value=!1;return}const{range:p,root:t}=y;let s="";if(p.startContainer.nodeType===Node.TEXT_NODE){const M=p.startContainer.textContent??"";p.startOffset>0&&(s=M[p.startOffset-1]??"")}else if(p.startContainer instanceof HTMLElement&&p.startOffset>0){const M=p.startContainer.childNodes[p.startOffset-1];if((M==null?void 0:M.nodeType)===Node.TEXT_NODE){const H=M.textContent??"";s=H[H.length-1]??""}}if(s!=="/"){N.value=!1;return}const b=p.getBoundingClientRect(),E=t.getBoundingClientRect();O.value={left:Math.max(0,b.left-E.left),top:Math.max(E.height+8,b.bottom-E.top+8)},N.value=!0}function J(){A(),I()}function q(){I()}function ee(){window.setTimeout(()=>{N.value=!1},120)}function Q(y){var s,b;if(y.key==="Enter"){y.preventDefault();return}if(y.key!=="Backspace")return;const p=le();if(!p||!p.selection.isCollapsed)return;const{range:t}=p;if(t.startContainer.nodeType===Node.TEXT_NODE){const E=t.startContainer;if(t.startOffset<=0||E.data[t.startOffset-1]!=="​")return;const M=E.previousSibling;if(!(M instanceof HTMLElement)||M.dataset.segmentType!=="component")return;y.preventDefault();const H=M.dataset.blockId??"";(s=m.get(H))==null||s.app.unmount(),m.delete(H),M.remove(),E.deleteData(t.startOffset-1,1),A();return}if(t.startContainer instanceof HTMLElement&&t.startOffset>0){const E=t.startContainer.childNodes[t.startOffset-1];if(!(E instanceof HTMLElement)||E.dataset.segmentType!=="component")return;y.preventDefault();const M=E.dataset.blockId??"";(b=m.get(M))==null||b.app.unmount(),m.delete(M),E.remove(),A()}}function ce(y){var t;y.preventDefault();const p=((t=y.clipboardData)==null?void 0:t.getData("text/plain"))??"";document.execCommand("insertText",!1,p.replace(/\n/g," "))}function ne(y){const p=le();if(!p)return;const{selection:t,range:s}=p,b=B(y);if(s.startContainer.nodeType===Node.TEXT_NODE){const F=s.startContainer;s.startOffset>0&&F.data[s.startOffset-1]==="/"&&(F.deleteData(s.startOffset-1,1),s.setStart(F,s.startOffset-1),s.collapse(!0))}const E=K(b),M=document.createTextNode("​");s.insertNode(M),s.insertNode(E);const H=document.createRange();H.setStart(M,1),H.collapse(!0),t.removeAllRanges(),t.addRange(H),N.value=!1,A(),oe()}function ue(y){var E,M,H,F;const p=m.get(y);if(!p)return;const t=me(p.block.type),s=((E=t==null?void 0:t.propertyPanel)==null?void 0:E.fields)??[];if(!t||!s.length)return;const b=t.normalizeProps({...((M=t.createInitialProps)==null?void 0:M.call(t))??{},...p.block.data,edit:!1});d.value={blockId:y,title:((H=t.propertyPanel)==null?void 0:H.title)||u("editor.propertyDialogTitle"),type:p.block.type,fields:s,values:Object.fromEntries(s.map(Ee=>[Ee.key,b[Ee.key]??""]))},(F=x.value)==null||F.showModal()}function g(){var y;(y=x.value)==null||y.close(),d.value=null}function C(y,p){var H;const t=d.value;if(!t)return;t.values[y]=p,d.value={...t,values:{...t.values}};const s=m.get(t.blockId),b=me(t.type);if(!s||!b)return;const E=b.normalizeProps({...((H=b.createInitialProps)==null?void 0:H.call(b))??{},...t.values,edit:!1});s.block={...s.block,data:ut(b.serialize(E))},s.wrapper.dataset.block=JSON.stringify(s.block),s.app.unmount();const M=qe(b.component,E);M.mount(s.mountPoint),s.app=M,A()}function S(){return he(a.value)}function T(y){var p;return((p=me(y))==null?void 0:p.component)??null}function se(y){return Ae(y)}function re(y){var t;const p=me(y.type);return p?p.normalizeProps({...((t=p.createInitialProps)==null?void 0:t.call(p))??{},...y.data,edit:!1}):{edit:!1}}return Ye(()=>{a.edit&&$(a.value)}),Ze(()=>{j()}),ie(()=>a.edit,y=>{if(!y){N.value=!1;return}ve(()=>{$(a.value)})}),ie(()=>a.value,y=>{if(!a.edit)return;const p=he(y);z(p)!==w&&$(p)}),(y,p)=>{var t;return r(),c("div",Ca,[e.edit?(r(),c("div",Ta,[i("div",{ref_key:"editableRef",ref:_,class:"ce-advance-input-tool__editor","data-testid":"editor-advance-input-content",contenteditable:"true",spellcheck:"false",onInput:J,onClick:q,onKeyup:I,onKeydown:Q,onPaste:ce,onBlur:ee},null,544),N.value?(r(),c("div",{key:0,class:"ce-advance-input-tool__menu","data-testid":"editor-advance-input-menu",style:pe({left:`${O.value.left}px`,top:`${O.value.top}px`})},[(r(!0),c(V,null,W(k(oa)(),([s,b])=>(r(),c("button",{key:s,type:"button",class:"ce-advance-input-tool__menu-item","data-testid":`editor-advance-input-menu-item-${s}`,onMousedown:Y(E=>ne(s),["prevent"])},h(b.toolbox.title),41,xa))),128))],4)):L("",!0)])):(r(),c("div",$a,[(r(!0),c(V,null,W(S(),(s,b)=>(r(),c(V,{key:`${s.id}-${s.type}-${b}`},[s.type==="paragraph"?(r(),c("span",Sa,h(se(s)),1)):(r(),c("span",Ea,[(r(),be(Ie(T(s.type)),Qe({ref_for:!0},re(s)),null,16))]))],64))),128))])),i("dialog",{ref_key:"embeddedDialogRef",ref:x,class:"ce-advance-input-tool__dialog","data-testid":"advance-input-embedded-property-dialog",onClose:p[0]||(p[0]=s=>d.value=null)},[i("form",{method:"dialog",class:"ce-advance-input-tool__dialog-panel",onSubmit:Y(g,["prevent"])},[i("div",Na,[i("h3",Da,h((t=d.value)==null?void 0:t.title),1),i("button",Pa,h(k(u)("editor.close")),1)]),d.value?(r(),c("div",Ia,[(r(!0),c(V,null,W(d.value.fields,s=>(r(),c("label",{key:s.key,class:te(["ce-advance-input-tool__dialog-field",{"ce-advance-input-tool__dialog-field--checkbox":s.type==="checkbox"}])},[s.type==="checkbox"?(r(),c(V,{key:0},[i("input",{class:"ce-advance-input-tool__dialog-checkbox",type:"checkbox",checked:d.value.values[s.key]===!0,"data-testid":`advance-input-embedded-property-input-${s.key}`,onChange:b=>C(s.key,b.target.checked)},null,40,Aa),i("span",Ma,h(s.label),1)],64)):s.type==="select"?(r(),c(V,{key:1},[i("span",Oa,h(s.label),1),i("select",{class:"ce-advance-input-tool__dialog-input",value:String(d.value.values[s.key]??""),"data-testid":`advance-input-embedded-property-input-${s.key}`,onChange:b=>C(s.key,b.target.value)},[(r(!0),c(V,null,W(s.options??[],b=>(r(),c("option",{key:b.value,value:b.value},h(b.label),9,Ra))),128))],40,Ba)],64)):(r(),c(V,{key:2},[i("span",La,h(s.label),1),i("input",{class:"ce-advance-input-tool__dialog-input",type:"text",value:String(d.value.values[s.key]??""),placeholder:s.placeholder,"data-testid":`advance-input-embedded-property-input-${s.key}`,onInput:b=>C(s.key,b.target.value)},null,40,za)],64))],2))),128))])):L("",!0)],32)],544)])}}}),gt=Se(Va,[["__scopeId","data-v-5ab6cc48"]]),ja={class:"ce-advance-table-tool","data-testid":"editor-advance-table-tool"},Ja={class:"ce-advance-table-tool__scroller"},Ha={class:"ce-advance-table-tool__table","data-testid":"advance-table"},qa=["checked","aria-label"],Ka=["data-testid"],Ua=["data-testid"],Wa=["data-testid"],Ga=["checked","aria-label","onChange"],Xa=["data-testid"],Ya=["data-testid"],Za={key:0,class:"ce-advance-table-tool__cell-text"},Qa={key:1,class:"ce-advance-table-tool__cell-token"},eo={key:0},to=["colspan"];function Je(e,a){return[Ke(e,a)]}function ao(){return[{id:"advance-table-default-tag",type:"MTag",data:{tagName:"{{tag}}",type:"{{tagType}}",size:"small",color:"",closable:!1}}]}function oo(){return[{id:"advance-table-default-link",type:"MLink",data:{text:"{{linkText}}",url:"{{linkUrl}}",open:!1}}]}function Ue(){return[{columnName:P.t("advanceTable.defaultColumns.name"),columnContent:Je("{{name}}","advance-table-default-name"),width:180,fixed:"left"},{columnName:P.t("advanceTable.defaultColumns.status"),columnContent:Je("{{status}}","advance-table-default-status"),width:140,fixed:null},{columnName:P.t("advanceTable.defaultColumns.tag"),columnContent:ao(),width:120,fixed:null},{columnName:P.t("advanceTable.defaultColumns.owner"),columnContent:Je("{{owner}}","advance-table-default-owner"),width:160,fixed:null},{columnName:P.t("advanceTable.defaultColumns.link"),columnContent:oo(),width:180,fixed:null}]}function Dt(){return[{name:P.t("advanceTable.defaultRows.first.name"),status:P.t("advanceTable.defaultRows.first.status"),tag:P.t("advanceTable.defaultRows.first.tag"),tagType:"warning",owner:P.t("advanceTable.defaultRows.first.owner"),linkText:P.t("advanceTable.defaultRows.first.linkText"),linkUrl:P.t("advanceTable.defaultRows.first.linkUrl")},{name:P.t("advanceTable.defaultRows.second.name"),status:P.t("advanceTable.defaultRows.second.status"),tag:P.t("advanceTable.defaultRows.second.tag"),tagType:"success",owner:P.t("advanceTable.defaultRows.second.owner"),linkText:P.t("advanceTable.defaultRows.second.linkText"),linkUrl:P.t("advanceTable.defaultRows.second.linkUrl")}]}const lo=ke({toolbox:{get title(){return P.t("advanceTable.toolboxTitle")},icon:'<svg width="18" height="18" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><rect x="3" y="5" width="18" height="14" rx="2" fill="none" stroke="currentColor" stroke-width="2"/><path d="M3 10h18M8 5v14M16 5v14" stroke="currentColor" stroke-width="2"/></svg>'},propertyPanel:{get title(){return P.t("advanceTable.propertyPanelTitle")},get fields(){return[{key:"index",label:P.t("advanceTable.properties.index"),type:"checkbox"},{key:"selection",label:P.t("advanceTable.properties.selection"),type:"checkbox"}]}},createInitialProps:()=>({index:!1,selection:!1,columns:Ue(),data:Dt()}),normalizeProps:e=>({edit:e.edit??!1,index:e.index===!0,selection:e.selection===!0,columns:We(e.columns),data:Ge(e.data)}),serialize:e=>({index:e.index===!0,selection:e.selection===!0,columns:We(e.columns),data:Ge(e.data)})});function We(e){if(!Array.isArray(e)||!e.length)return Ue();const a=e.filter(u=>typeof u=="object"&&u!==null).map((u,_)=>{var x;return{columnName:((x=u.columnName)==null?void 0:x.trim())||`${P.t("advanceTable.defaultColumnName")}${_+1}`,columnContent:he(u.columnContent),width:no(u.width),fixed:so(u.fixed)}});return a.length?a:Ue()}function Ge(e){return Array.isArray(e)?e.filter(a=>typeof a=="object"&&a!==null&&!Array.isArray(a)):Dt()}function no(e){return typeof e!="number"||!Number.isFinite(e)||e<=0?null:Math.round(e)}function so(e){return e==="left"||e==="right"?e:null}const ro=ge({__name:"MAdvanceTable",props:{edit:{type:Boolean},index:{type:Boolean},selection:{type:Boolean},columns:{},data:{},onChange:{type:Function},onToolChange:{type:Function}},setup(e){const a=e,{t:u}=xe(),_=X(new Set),x=U(()=>We(a.columns)),N=U(()=>Ge(a.data)),O=U(()=>a.selection===!0),d=U(()=>a.index===!0),m=44,v=56,w=160;function D(g){if(g==null)return"";if(typeof g=="string")return g;if(typeof g=="number"||typeof g=="boolean")return String(g);try{return JSON.stringify(g)}catch{return String(g)}}function z(g,C){return g.replace(/\{\{\s*([\w.-]+)\s*\}\}/g,(S,T)=>D(B(C,T)))}function B(g,C){return C.split(".").reduce((S,T)=>typeof S!="object"||S===null||!(T in S)?"":S[T],g)}function j(g,C){return typeof g=="string"?z(g,C):Array.isArray(g)?g.map(S=>j(S,C)):typeof g=="object"&&g!==null?Object.fromEntries(Object.entries(g).map(([S,T])=>[S,j(T,C)])):g}function K(g,C){return he(C.columnContent).map(S=>S.type==="paragraph"?{...S,data:{text:z(Ae(S),g)}}:{...S,data:j(S.data,g)})}function $(g){var C;return((C=me(g))==null?void 0:C.component)??null}function G(g){var S;const C=me(g.type);return C?C.normalizeProps({...((S=C.createInitialProps)==null?void 0:S.call(C))??{},...g.data,edit:!1}):{edit:!1}}function Z(g){return Ae(g)}function A(g){return g.width??null}function ae(g){return A(g)??w}function oe(g){let C=0;O.value&&(C+=m),d.value&&(C+=v);for(let S=0;S<g;S+=1){const T=x.value[S];(T==null?void 0:T.fixed)==="left"&&(C+=ae(T))}return C}function le(g){let C=0;for(let S=x.value.length-1;S>g;S-=1){const T=x.value[S];(T==null?void 0:T.fixed)==="right"&&(C+=ae(T))}return C}function I(g,C){const S=A(g),T={};return S&&(T.width=`${S}px`,T.minWidth=`${S}px`),g.fixed==="left"&&(T.position="sticky",T.left=`${oe(C)}px`),g.fixed==="right"&&(T.position="sticky",T.right=`${le(C)}px`),T}function J(g){return{"ce-advance-table-tool__cell--fixed-left":g.fixed==="left","ce-advance-table-tool__cell--fixed-right":g.fixed==="right"}}function q(){return{width:`${m}px`,minWidth:`${m}px`,left:"0px"}}function ee(){return{width:`${v}px`,minWidth:`${v}px`,left:`${O.value?m:0}px`}}function Q(g){return _.value.has(g)}function ce(g){const C=new Set(_.value);C.has(g)?C.delete(g):C.add(g),_.value=C}function ne(){return N.value.length>0&&N.value.every((g,C)=>_.value.has(C))}function ue(){if(ne()){_.value=new Set;return}_.value=new Set(N.value.map((g,C)=>C))}return(g,C)=>(r(),c("div",ja,[i("div",Ja,[i("table",Ha,[i("thead",null,[i("tr",null,[e.selection?(r(),c("th",{key:0,class:"ce-advance-table-tool__cell ce-advance-table-tool__cell--header ce-advance-table-tool__cell--control ce-advance-table-tool__cell--fixed-left",style:pe(q()),"data-testid":"advance-table-selection-header"},[i("input",{class:"ce-advance-table-tool__checkbox",type:"checkbox",checked:ne(),"aria-label":k(u)("advanceTable.selectAll"),onChange:ue},null,40,qa)],4)):L("",!0),e.index?(r(),c("th",{key:1,class:"ce-advance-table-tool__cell ce-advance-table-tool__cell--header ce-advance-table-tool__cell--control ce-advance-table-tool__cell--fixed-left",style:pe(ee()),"data-testid":"advance-table-index-header"}," # ",4)):L("",!0),(r(!0),c(V,null,W(x.value,(S,T)=>(r(),c("th",{key:`header-${T}`,class:te(["ce-advance-table-tool__cell ce-advance-table-tool__cell--header",J(S)]),style:pe(I(S,T)),"data-testid":`advance-table-header-${T}`},h(S.columnName),15,Ka))),128))])]),i("tbody",null,[(r(!0),c(V,null,W(N.value,(S,T)=>(r(),c("tr",{key:`row-${T}`,class:te(["ce-advance-table-tool__row",{"ce-advance-table-tool__row--selected":Q(T)}]),"data-testid":`advance-table-row-${T}`},[e.selection?(r(),c("td",{key:0,class:"ce-advance-table-tool__cell ce-advance-table-tool__cell--control ce-advance-table-tool__cell--fixed-left",style:pe(q()),"data-testid":`advance-table-selection-cell-${T}`},[i("input",{class:"ce-advance-table-tool__checkbox",type:"checkbox",checked:Q(T),"aria-label":k(u)("advanceTable.selectRow"),onChange:se=>ce(T)},null,40,Ga)],12,Wa)):L("",!0),e.index?(r(),c("td",{key:1,class:"ce-advance-table-tool__cell ce-advance-table-tool__cell--control ce-advance-table-tool__cell--fixed-left",style:pe(ee()),"data-testid":`advance-table-index-cell-${T}`},h(T+1),13,Xa)):L("",!0),(r(!0),c(V,null,W(x.value,(se,re)=>(r(),c("td",{key:`cell-${T}-${re}`,class:te(["ce-advance-table-tool__cell",J(se)]),style:pe(I(se,re)),"data-testid":`advance-table-cell-${T}-${re}`},[(r(!0),c(V,null,W(K(S,se),(y,p)=>(r(),c(V,{key:`${T}-${re}-${y.id}-${y.type}-${p}`},[y.type==="paragraph"?(r(),c("span",Za,h(Z(y)),1)):(r(),c("span",Qa,[(r(),be(Ie($(y.type)),Qe({ref_for:!0},G(y)),null,16))]))],64))),128))],14,Ya))),128))],10,Ua))),128)),N.value.length?L("",!0):(r(),c("tr",eo,[i("td",{class:"ce-advance-table-tool__cell ce-advance-table-tool__empty",colspan:x.value.length+(e.selection?1:0)+(e.index?1:0)},h(k(u)("advanceTable.empty")),9,to)]))])])])]))}}),kt=Se(ro,[["__scopeId","data-v-6eb0809a"]]),co={class:"ce-datasource-tool","data-testid":"editor-datasource-tool"},io={class:"ce-datasource-tool__header"},uo={class:"ce-datasource-tool__title"},po=["aria-label"],mo=["disabled"],yo=["disabled"],fo={key:0,class:"ce-datasource-tool__panel","data-testid":"datasource-json-panel"},vo={class:"ce-datasource-tool__field"},ho={class:"ce-datasource-tool__label"},_o=["readonly","value"],bo={key:0,class:"ce-datasource-tool__error","data-testid":"datasource-json-error"},go={key:1,class:"ce-datasource-tool__panel","data-testid":"datasource-api-panel"},ko={class:"ce-datasource-tool__grid"},wo={class:"ce-datasource-tool__field"},Co={class:"ce-datasource-tool__label"},To=["readonly","value"],xo={class:"ce-datasource-tool__field"},$o={class:"ce-datasource-tool__label"},So=["readonly","value"],Eo={class:"ce-datasource-tool__field"},No={class:"ce-datasource-tool__label"},Do=["disabled","value"],Po={open:"",class:"ce-datasource-tool__list","data-testid":"datasource-header-list"},Io={class:"ce-datasource-tool__list-header"},Ao={class:"ce-datasource-tool__list-title"},Mo={key:0,class:"ce-datasource-tool__empty"},Oo=["data-testid","readonly","placeholder","value","onInput"],Bo=["data-testid","readonly","placeholder","value","onInput"],Ro=["data-testid","aria-label","onClick"],Lo={open:"",class:"ce-datasource-tool__list","data-testid":"datasource-query-list"},zo={class:"ce-datasource-tool__list-header"},Fo={class:"ce-datasource-tool__list-title"},Vo={key:0,class:"ce-datasource-tool__empty"},jo=["data-testid","readonly","placeholder","value","onInput"],Jo=["data-testid","readonly","placeholder","value","onInput"],Ho=["data-testid","aria-label","onClick"],qo={open:"",class:"ce-datasource-tool__list","data-testid":"datasource-body-list"},Ko={class:"ce-datasource-tool__list-header"},Uo={class:"ce-datasource-tool__list-title"},Wo={key:0,class:"ce-datasource-tool__empty"},Go=["data-testid","readonly","placeholder","value","onInput"],Xo=["data-testid","disabled","value","onChange"],Yo=["value"],Zo=["data-testid","disabled","value","onChange"],Qo=["data-testid"],el=["data-testid","readonly","value","onInput"],tl=["data-testid","type","readonly","placeholder","value","onInput"],al=["data-testid","aria-label","onClick"],ol=["data-testid"],ll={class:"ce-datasource-tool__generate-panel","data-testid":"datasource-schema-generate-panel"},nl={class:"ce-datasource-tool__section-title"},sl={class:"ce-datasource-tool__section-copy"},rl={class:"ce-datasource-tool__generate-actions"},cl=["disabled"],il={key:1,class:"ce-datasource-tool__schema-summary","data-testid":"datasource-schema-summary"},dl={key:0,class:"ce-datasource-tool__error","data-testid":"datasource-json-schema-error"},ul={class:"ce-datasource-tool__schema-panel","data-testid":"datasource-json-schema-panel"},pl={class:"ce-datasource-tool__schema-header"},ml={class:"ce-datasource-tool__section-title"},yl={class:"ce-datasource-tool__section-copy"},fl=["placeholder","value"],vl={class:"ce-datasource-tool__tabs","data-testid":"datasource-schema-tabs"},hl={key:0,class:"ce-datasource-tool__schema-tab-panel","data-testid":"datasource-list-schema-panel"},_l={key:0,class:"ce-datasource-tool__empty","data-testid":"datasource-schema-empty"},bl={key:1,class:"ce-datasource-tool__field"},gl={class:"ce-datasource-tool__label"},kl=["disabled","value"],wl=["value"],Cl={key:2,class:"ce-datasource-tool__empty","data-testid":"datasource-list-schema-empty"},Tl={key:3,class:"ce-datasource-tool__field-list","data-testid":"datasource-list-fields"},xl={class:"ce-datasource-tool__field-list-summary"},$l=["data-testid"],Sl=["disabled","checked","data-testid","onChange"],El={class:"ce-datasource-tool__schema-field-main"},Nl=["readonly","value","data-testid","onInput"],Dl={class:"ce-datasource-tool__schema-path"},Pl={class:"ce-datasource-tool__schema-badges"},Il={class:"ce-datasource-tool__schema-badge"},Al={class:"ce-datasource-tool__schema-badge"},Ml={key:0,class:"ce-datasource-tool__schema-badge ce-datasource-tool__schema-badge--required"},Ol={key:1,class:"ce-datasource-tool__schema-tab-panel","data-testid":"datasource-form-schema-panel"},Bl={key:0,class:"ce-datasource-tool__field-list","data-testid":"datasource-form-fields"},Rl={class:"ce-datasource-tool__field-list-summary"},Ll=["data-testid"],zl=["disabled","checked","data-testid","onChange"],Fl={class:"ce-datasource-tool__schema-field-main"},Vl=["readonly","value","data-testid","onInput"],jl={class:"ce-datasource-tool__schema-path"},Jl={class:"ce-datasource-tool__schema-badges"},Hl={class:"ce-datasource-tool__schema-badge"},ql={class:"ce-datasource-tool__schema-badge"},Kl={key:0,class:"ce-datasource-tool__schema-badge ce-datasource-tool__schema-badge--required"},Ul={key:1,class:"ce-datasource-tool__empty","data-testid":"datasource-form-schema-empty"},Wl={key:2,class:"ce-datasource-tool__schema-tab-panel","data-testid":"datasource-advanced-schema-panel"},Gl={key:0,class:"ce-datasource-tool__schema-tree","data-testid":"datasource-schema-tree"},Xl=["data-testid"],Yl={class:"ce-datasource-tool__schema-node-name"},Zl={class:"ce-datasource-tool__schema-path"},Ql={class:"ce-datasource-tool__schema-badge"},en={key:0,class:"ce-datasource-tool__schema-badge ce-datasource-tool__schema-badge--required"},tn={class:"ce-datasource-tool__field"},an={class:"ce-datasource-tool__label"},on=["readonly","value"],ln=ke({toolbox:{get title(){return P.t("datasource.toolboxTitle")},icon:'<svg width="18" height="18" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><ellipse cx="12" cy="6" rx="7" ry="3" fill="none" stroke="currentColor" stroke-width="2"/><path d="M5 6v6c0 1.7 3.1 3 7 3s7-1.3 7-3V6M5 12v6c0 1.7 3.1 3 7 3s7-1.3 7-3v-6" fill="none" stroke="currentColor" stroke-width="2"/><path d="M8 12c1.1.5 2.5.8 4 .8s2.9-.3 4-.8" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>'},createInitialProps:()=>({value:fa()}),normalizeProps:e=>({edit:e.edit??!1,value:fe(e.value)}),serialize:e=>({value:fe(e.value)})}),nn=ge({__name:"MDatasourceEditor",props:{edit:{type:Boolean},value:{},onChange:{type:Function},onToolChange:{type:Function}},setup(e){const a=e,{t:u}=xe(),_=fe(a.value),x=sa,N=X(_.type),O=Le(_.type==="JSON"?_.rawData:{}),d=X(g(O.value)),m=X(""),v=Le(_.jsonSchema),w=X(C(v.value)),D=X(""),z=X(!1),B=Le(_.schemaSelections),j=X("list"),K=X(""),$=St(_.type==="API"?_:na()),G=X($.bodyData.map(o=>we(o))),Z=X($.bodyData.map(()=>"")),A=U(()=>!a.edit),ae=U(()=>va(v.value)),oe=U(()=>ra(ae.value)),le=U(()=>ca(v.value)),I=U(()=>{var o,l;return((l=(o=B.value)==null?void 0:o.list)==null?void 0:l.fields)??[]}),J=U(()=>{var o,l;return((l=(o=B.value)==null?void 0:o.form)==null?void 0:l.fields)??[]}),q=U(()=>re(oe.value,K.value)),ee=U(()=>y(I.value,K.value)),Q=U(()=>y(J.value,K.value)),ce=U(()=>{var o,l;return((l=(o=B.value)==null?void 0:o.list)==null?void 0:l.recordPath)??""}),ne=U(()=>I.value.filter(o=>o.enabled).length),ue=U(()=>J.value.filter(o=>o.enabled).length);function g(o){return JSON.stringify(o,null,2)}function C(o){return o?JSON.stringify(o,null,2):""}function S(o){return u(`datasource.schemaTypes.${o}`)}function T(o){return u(`datasource.componentHints.${o}`)}function se(o){return o.trim().toLowerCase()}function re(o,l){const n=se(l);return n?o.filter(f=>f.name.toLowerCase().includes(n)||f.displayPath.toLowerCase().includes(n)):o}function y(o,l){const n=se(l);return n?o.filter(f=>f.label.toLowerCase().includes(n)||f.path.toLowerCase().includes(n)):o}function p(o){return o||"root"}function t(o){return o?`${o}[]`:u("datasource.fields.rootRecordPath")}function s(o){return{edit:a.edit,value:fe(o)}}function b(o){var n,f;if(!a.edit)return;const l=s(o);(n=a.onToolChange)==null||n.call(a,l),(f=a.onChange)==null||f.call(a,l)}function E(){return fe({type:"JSON",rawData:ha(O.value,{}),jsonSchema:v.value,schemaSelections:B.value})}function M(){return fe({type:"API",domain:$.domain,path:$.path,method:$.method,headerData:$.headerData,bodyData:$.bodyData,queryData:$.queryData,jsonSchema:v.value,schemaSelections:B.value})}function H(){b(N.value==="JSON"?E():M())}function F(){b(M())}function Ee(){G.value=$.bodyData.map(o=>we(o)),Z.value=$.bodyData.map(()=>"")}function Lt(o,l){v.value=o?ft(o):void 0,w.value=C(v.value),B.value=vt(l,v.value),D.value=""}function zt(o){Object.assign($,{type:"API",domain:o.domain,path:o.path,method:o.method,headerData:o.headerData.map(l=>({...l})),bodyData:o.bodyData.map(l=>({key:l.key,dataType:l.dataType,mock:mt(l.dataType,l.mock)})),queryData:o.queryData.map(l=>({...l}))}),Ee()}function Ft(o){const l=fe(o);if(N.value=l.type,Lt(l.jsonSchema,l.schemaSelections),l.type==="JSON"){O.value=l.rawData,d.value=g(l.rawData),m.value="";return}zt(l)}function tt(o){if(!(!a.edit||N.value===o)){if(N.value=o,o==="JSON"){b(E());return}F()}}function Vt(o){if(!a.edit)return;const l=o.target.value;d.value=l;try{const n=JSON.parse(l);if(!yt(n))throw new Error("Invalid JSON value.");O.value=ze(n),m.value="",b(E())}catch{m.value=u("datasource.validation.invalidJson")}}function jt(o){if(!a.edit)return;const l=o.target.value;if(w.value=l,!l.trim()){v.value=void 0,B.value=void 0,D.value="",H();return}try{const n=JSON.parse(l),f=ia(n);if(!f)throw new Error("Invalid JSON Schema.");v.value=f,B.value=Fe(f,B.value),D.value="",H()}catch{D.value=u("datasource.validation.invalidJsonSchema")}}function at(o,l){a.edit&&($[o]=l,F())}function Jt(o){a.edit&&($.method=da(o),F())}function Ne(o){return $[o]}function ot(o){a.edit&&($[o].push({key:"",mock:""}),F())}function De(o,l,n,f){if(!a.edit)return;const R=$[o][l];R&&(R[n]=f,F())}function lt(o,l){a.edit&&($[o].splice(l,1),F())}function Ht(){if(!a.edit)return;const o={key:"",dataType:"string",mock:""};$.bodyData.push(o),G.value.push(we(o)),Z.value.push(""),F()}function qt(o,l){if(!a.edit)return;const n=$.bodyData[o];n&&(n.key=l,F())}function Kt(o,l){if(!a.edit)return;const n=$.bodyData[o];n&&(n.dataType=ua(l),n.mock=pa(n.dataType),G.value[o]=we(n),Z.value[o]="",F())}function Be(o,l){if(!a.edit)return;const n=$.bodyData[o];if(!n)return;G.value[o]=l;const f=Zt(n.dataType,l);if(!f.ok){Z.value[o]=f.error;return}n.mock=f.value,Z.value[o]="",F()}function Ut(o){a.edit&&($.bodyData.splice(o,1),G.value.splice(o,1),Z.value.splice(o,1),F())}function Wt(o){return o instanceof _a?o.code==="apiRequestFailed"?`${u("datasource.validation.apiRequestFailed")} ${o.status??""} ${o.statusText??""}`.trim():u(`datasource.validation.${o.code}`):o instanceof Error?o.message:String(o)}function Gt(o){v.value=ft(o),w.value=C(v.value),B.value=Fe(v.value,B.value),D.value="",H()}function Xt(o){var l,n;!a.edit||!v.value||(B.value=Fe(v.value,{...B.value,list:{recordPath:o,fields:((n=(l=B.value)==null?void 0:l.list)==null?void 0:n.fields)??[]}}),H())}function nt(o,l,n){var it,dt;if(!a.edit)return;const f=vt(B.value,v.value),R=o==="list"?(it=f==null?void 0:f.list)==null?void 0:it.fields:(dt=f==null?void 0:f.form)==null?void 0:dt.fields;if(!R)return;const ct=R.map(Pe=>Pe.path===l?{...Pe,...n,label:n.label!==void 0?n.label:Pe.label}:Pe);B.value={...f,...o==="list"&&(f!=null&&f.list)?{list:{...f.list,fields:ct}}:{},...o==="form"?{form:{fields:ct}}:{}},H()}function st(o,l,n){nt(o,l,{label:n.trim()||l})}function rt(o,l,n){nt(o,l,{enabled:n})}async function Yt(){if(!(!a.edit||z.value)){if(D.value="",N.value==="JSON"){if(m.value){D.value=u("datasource.validation.fixJsonBeforeSchema");return}}else if(Z.value.findIndex(l=>!!l)>=0){D.value=u("datasource.validation.fixBodyBeforeSchema");return}z.value=!0;try{const o=await ma(N.value==="JSON"?E():M());Gt(o)}catch(o){D.value=Wt(o)}finally{z.value=!1}}}function Zt(o,l){if(o==="string")return{ok:!0,value:l};if(o==="number"){const n=l.trim(),f=Number(n);return!n||!Number.isFinite(f)?{ok:!1,error:u("datasource.validation.invalidNumber")}:{ok:!0,value:f}}if(o==="boolean")return{ok:!0,value:l==="true"};if(o==="null")return{ok:!0,value:null};try{const n=JSON.parse(l);return o==="object"?ya(n)?{ok:!0,value:ze(n)}:{ok:!1,error:u("datasource.validation.invalidObject")}:!Array.isArray(n)||!yt(n)?{ok:!1,error:u("datasource.validation.invalidArray")}:{ok:!0,value:ze(n)}}catch{return{ok:!1,error:u(o==="object"?"datasource.validation.invalidObject":"datasource.validation.invalidArray")}}}function we(o){const l=mt(o.dataType,o.mock);return o.dataType==="object"||o.dataType==="array"?g(l):o.dataType==="null"?"null":String(l)}return ie(()=>a.value,o=>{Ft(o)},{deep:!0}),(o,l)=>(r(),c("div",co,[i("div",io,[i("div",uo,h(k(u)("datasource.title")),1),i("div",{class:"ce-datasource-tool__type-switch","aria-label":k(u)("datasource.fields.type")},[i("button",{type:"button",class:te(["ce-datasource-tool__type-button",{"ce-datasource-tool__type-button--active":N.value==="JSON"}]),disabled:A.value,"data-testid":"datasource-type-json",onClick:l[0]||(l[0]=n=>tt("JSON"))}," JSON ",10,mo),i("button",{type:"button",class:te(["ce-datasource-tool__type-button",{"ce-datasource-tool__type-button--active":N.value==="API"}]),disabled:A.value,"data-testid":"datasource-type-api",onClick:l[1]||(l[1]=n=>tt("API"))}," API ",10,yo)],8,po)]),N.value==="JSON"?(r(),c("div",fo,[i("label",vo,[i("span",ho,h(k(u)("datasource.fields.rawData")),1),i("textarea",{class:"ce-datasource-tool__textarea ce-datasource-tool__textarea--json","data-testid":"datasource-raw-data",spellcheck:"false",readonly:A.value,value:d.value,onInput:Vt,onKeydown:l[2]||(l[2]=Y(()=>{},["stop"]))},null,40,_o)]),m.value?(r(),c("p",bo,h(m.value),1)):L("",!0)])):(r(),c("div",go,[i("div",ko,[i("label",wo,[i("span",Co,h(k(u)("datasource.fields.domain")),1),i("input",{class:"ce-datasource-tool__input","data-testid":"datasource-domain",type:"text",readonly:A.value,value:$.domain,onInput:l[3]||(l[3]=n=>at("domain",n.target.value)),onKeydown:l[4]||(l[4]=Y(()=>{},["stop"]))},null,40,To)]),i("label",xo,[i("span",$o,h(k(u)("datasource.fields.path")),1),i("input",{class:"ce-datasource-tool__input","data-testid":"datasource-path",type:"text",readonly:A.value,value:$.path,onInput:l[5]||(l[5]=n=>at("path",n.target.value)),onKeydown:l[6]||(l[6]=Y(()=>{},["stop"]))},null,40,So)]),i("label",Eo,[i("span",No,h(k(u)("datasource.fields.method")),1),i("select",{class:"ce-datasource-tool__input","data-testid":"datasource-method",disabled:A.value,value:$.method,onChange:l[7]||(l[7]=n=>Jt(n.target.value))},[...l[26]||(l[26]=[i("option",{value:"GET"},"GET",-1),i("option",{value:"POST"},"POST",-1)])],40,Do)])]),i("details",Po,[i("summary",Io,[i("span",Ao,h(k(u)("datasource.sections.headers")),1),e.edit?(r(),c("button",{key:0,class:"ce-datasource-tool__action",type:"button","data-testid":"datasource-header-add",onClick:l[8]||(l[8]=Y(n=>ot("headerData"),["stop","prevent"]))},h(k(u)("datasource.actions.add")),1)):L("",!0)]),Ne("headerData").length?L("",!0):(r(),c("p",Mo,h(k(u)("datasource.empty")),1)),(r(!0),c(V,null,W(Ne("headerData"),(n,f)=>(r(),c("div",{key:`header-${f}`,class:"ce-datasource-tool__row"},[i("input",{class:"ce-datasource-tool__input","data-testid":`datasource-header-key-${f}`,type:"text",readonly:A.value,placeholder:k(u)("datasource.fields.key"),value:n.key,onInput:R=>De("headerData",f,"key",R.target.value),onKeydown:l[9]||(l[9]=Y(()=>{},["stop"]))},null,40,Oo),i("input",{class:"ce-datasource-tool__input","data-testid":`datasource-header-mock-${f}`,type:"text",readonly:A.value,placeholder:k(u)("datasource.fields.mock"),value:n.mock,onInput:R=>De("headerData",f,"mock",R.target.value),onKeydown:l[10]||(l[10]=Y(()=>{},["stop"]))},null,40,Bo),e.edit?(r(),c("button",{key:0,class:"ce-datasource-tool__remove",type:"button","data-testid":`datasource-header-remove-${f}`,"aria-label":k(u)("datasource.actions.remove"),onClick:R=>lt("headerData",f)},h(k(u)("datasource.actions.remove")),9,Ro)):L("",!0)]))),128))]),i("details",Lo,[i("summary",zo,[i("span",Fo,h(k(u)("datasource.sections.queries")),1),e.edit?(r(),c("button",{key:0,class:"ce-datasource-tool__action",type:"button","data-testid":"datasource-query-add",onClick:l[11]||(l[11]=Y(n=>ot("queryData"),["stop","prevent"]))},h(k(u)("datasource.actions.add")),1)):L("",!0)]),Ne("queryData").length?L("",!0):(r(),c("p",Vo,h(k(u)("datasource.empty")),1)),(r(!0),c(V,null,W(Ne("queryData"),(n,f)=>(r(),c("div",{key:`query-${f}`,class:"ce-datasource-tool__row"},[i("input",{class:"ce-datasource-tool__input","data-testid":`datasource-query-key-${f}`,type:"text",readonly:A.value,placeholder:k(u)("datasource.fields.key"),value:n.key,onInput:R=>De("queryData",f,"key",R.target.value),onKeydown:l[12]||(l[12]=Y(()=>{},["stop"]))},null,40,jo),i("input",{class:"ce-datasource-tool__input","data-testid":`datasource-query-mock-${f}`,type:"text",readonly:A.value,placeholder:k(u)("datasource.fields.mock"),value:n.mock,onInput:R=>De("queryData",f,"mock",R.target.value),onKeydown:l[13]||(l[13]=Y(()=>{},["stop"]))},null,40,Jo),e.edit?(r(),c("button",{key:0,class:"ce-datasource-tool__remove",type:"button","data-testid":`datasource-query-remove-${f}`,"aria-label":k(u)("datasource.actions.remove"),onClick:R=>lt("queryData",f)},h(k(u)("datasource.actions.remove")),9,Ho)):L("",!0)]))),128))]),i("details",qo,[i("summary",Ko,[i("span",Uo,h(k(u)("datasource.sections.body")),1),e.edit?(r(),c("button",{key:0,class:"ce-datasource-tool__action",type:"button","data-testid":"datasource-body-add",onClick:Y(Ht,["stop","prevent"])},h(k(u)("datasource.actions.add")),1)):L("",!0)]),$.bodyData.length?L("",!0):(r(),c("p",Wo,h(k(u)("datasource.empty")),1)),(r(!0),c(V,null,W($.bodyData,(n,f)=>(r(),c("div",{key:`body-${f}`,class:"ce-datasource-tool__body-row"},[i("input",{class:"ce-datasource-tool__input","data-testid":`datasource-body-key-${f}`,type:"text",readonly:A.value,placeholder:k(u)("datasource.fields.key"),value:n.key,onInput:R=>qt(f,R.target.value),onKeydown:l[14]||(l[14]=Y(()=>{},["stop"]))},null,40,Go),i("select",{class:"ce-datasource-tool__input","data-testid":`datasource-body-type-${f}`,disabled:A.value,value:n.dataType,onChange:R=>Kt(f,R.target.value)},[(r(!0),c(V,null,W(k(x),R=>(r(),c("option",{key:R,value:R},h(R),9,Yo))),128))],40,Xo),n.dataType==="boolean"?(r(),c("select",{key:0,class:"ce-datasource-tool__input","data-testid":`datasource-body-mock-${f}`,disabled:A.value,value:String(n.mock===!0),onChange:R=>Be(f,R.target.value)},[...l[27]||(l[27]=[i("option",{value:"false"},"false",-1),i("option",{value:"true"},"true",-1)])],40,Zo)):n.dataType==="null"?(r(),c("input",{key:1,class:"ce-datasource-tool__input","data-testid":`datasource-body-mock-${f}`,type:"text",readonly:"",value:"null"},null,8,Qo)):n.dataType==="object"||n.dataType==="array"?(r(),c("textarea",{key:2,class:"ce-datasource-tool__textarea ce-datasource-tool__textarea--mock","data-testid":`datasource-body-mock-${f}`,spellcheck:"false",readonly:A.value,value:G.value[f]??we(n),onInput:R=>Be(f,R.target.value),onKeydown:l[15]||(l[15]=Y(()=>{},["stop"]))},null,40,el)):(r(),c("input",{key:3,class:"ce-datasource-tool__input","data-testid":`datasource-body-mock-${f}`,type:n.dataType==="number"?"number":"text",readonly:A.value,placeholder:k(u)("datasource.fields.mock"),value:G.value[f]??we(n),onInput:R=>Be(f,R.target.value),onKeydown:l[16]||(l[16]=Y(()=>{},["stop"]))},null,40,tl)),e.edit?(r(),c("button",{key:4,class:"ce-datasource-tool__remove",type:"button","data-testid":`datasource-body-remove-${f}`,"aria-label":k(u)("datasource.actions.remove"),onClick:R=>Ut(f)},h(k(u)("datasource.actions.remove")),9,al)):L("",!0),Z.value[f]?(r(),c("p",{key:5,class:"ce-datasource-tool__body-error","data-testid":`datasource-body-error-${f}`},h(Z.value[f]),9,ol)):L("",!0)]))),128))])])),i("div",ll,[i("div",null,[i("div",nl,h(k(u)("datasource.sections.generateFields")),1),i("p",sl,h(k(u)("datasource.help.generateFields")),1)]),i("div",rl,[e.edit?(r(),c("button",{key:0,class:"ce-datasource-tool__schema-button",type:"button","data-testid":"datasource-json-schema-parse-button",disabled:z.value,onClick:Yt},h(z.value?k(u)("datasource.actions.generatingFields"):k(u)("datasource.actions.generateFields")),9,cl)):L("",!0),v.value?(r(),c("span",il,h(k(u)("datasource.fields.generatedFields"))+": "+h(oe.value.length),1)):L("",!0)]),D.value?(r(),c("p",dl,h(D.value),1)):L("",!0)]),i("div",ul,[i("div",pl,[i("div",null,[i("div",ml,h(k(u)("datasource.sections.fieldSelection")),1),i("p",yl,h(k(u)("datasource.help.fieldSelection")),1)]),v.value?(r(),c("input",{key:0,class:"ce-datasource-tool__input ce-datasource-tool__schema-search","data-testid":"datasource-schema-search",type:"search",placeholder:k(u)("datasource.fields.searchFields"),value:K.value,onInput:l[17]||(l[17]=n=>K.value=n.target.value),onKeydown:l[18]||(l[18]=Y(()=>{},["stop"]))},null,40,fl)):L("",!0)]),i("div",vl,[i("button",{type:"button",class:te(["ce-datasource-tool__tab",{"ce-datasource-tool__tab--active":j.value==="list"}]),"data-testid":"datasource-schema-tab-list",onClick:l[19]||(l[19]=n=>j.value="list")},h(k(u)("datasource.tabs.list")),3),i("button",{type:"button",class:te(["ce-datasource-tool__tab",{"ce-datasource-tool__tab--active":j.value==="form"}]),"data-testid":"datasource-schema-tab-form",onClick:l[20]||(l[20]=n=>j.value="form")},h(k(u)("datasource.tabs.form")),3),i("button",{type:"button",class:te(["ce-datasource-tool__tab",{"ce-datasource-tool__tab--active":j.value==="advanced"}]),"data-testid":"datasource-schema-tab-advanced",onClick:l[21]||(l[21]=n=>j.value="advanced")},h(k(u)("datasource.tabs.advanced")),3)]),j.value==="list"?(r(),c("div",hl,[v.value?le.value.length?(r(),c("label",bl,[i("span",gl,h(k(u)("datasource.fields.recordPath")),1),i("select",{class:"ce-datasource-tool__input","data-testid":"datasource-list-record-path",disabled:A.value,value:ce.value,onChange:l[22]||(l[22]=n=>Xt(n.target.value))},[(r(!0),c(V,null,W(le.value,n=>(r(),c("option",{key:n.path||"root",value:n.path},h(t(n.path)),9,wl))),128))],40,kl)])):(r(),c("p",Cl,h(k(u)("datasource.noListRecord")),1)):(r(),c("p",_l,h(k(u)("datasource.emptySchema")),1)),ee.value.length?(r(),c("div",Tl,[i("div",xl,h(k(u)("datasource.fields.selectedFields"))+": "+h(ne.value),1),(r(!0),c(V,null,W(ee.value,n=>(r(),c("label",{key:n.path,class:"ce-datasource-tool__schema-field","data-testid":`datasource-list-field-${n.path}`},[i("input",{class:"ce-datasource-tool__checkbox",type:"checkbox",disabled:A.value,checked:n.enabled,"data-testid":`datasource-list-field-enabled-${n.path}`,onChange:f=>rt("list",n.path,f.target.checked)},null,40,Sl),i("span",El,[i("input",{class:"ce-datasource-tool__input ce-datasource-tool__field-label-input",type:"text",readonly:A.value,value:n.label,"data-testid":`datasource-list-field-label-${n.path}`,onInput:f=>st("list",n.path,f.target.value),onKeydown:l[23]||(l[23]=Y(()=>{},["stop"]))},null,40,Nl),i("span",Dl,h(n.path),1)]),i("span",Pl,[i("span",Il,h(S(n.type)),1),i("span",Al,h(T(n.componentHint)),1),n.required?(r(),c("span",Ml,h(k(u)("datasource.fields.required")),1)):L("",!0)])],8,$l))),128))])):L("",!0)])):j.value==="form"?(r(),c("div",Ol,[Q.value.length?(r(),c("div",Bl,[i("div",Rl,h(k(u)("datasource.fields.selectedFields"))+": "+h(ue.value),1),(r(!0),c(V,null,W(Q.value,n=>(r(),c("label",{key:n.path,class:"ce-datasource-tool__schema-field","data-testid":`datasource-form-field-${n.path}`},[i("input",{class:"ce-datasource-tool__checkbox",type:"checkbox",disabled:A.value,checked:n.enabled,"data-testid":`datasource-form-field-enabled-${n.path}`,onChange:f=>rt("form",n.path,f.target.checked)},null,40,zl),i("span",Fl,[i("input",{class:"ce-datasource-tool__input ce-datasource-tool__field-label-input",type:"text",readonly:A.value,value:n.label,"data-testid":`datasource-form-field-label-${n.path}`,onInput:f=>st("form",n.path,f.target.value),onKeydown:l[24]||(l[24]=Y(()=>{},["stop"]))},null,40,Vl),i("span",jl,h(n.path),1)]),i("span",Jl,[i("span",Hl,h(S(n.type)),1),i("span",ql,h(T(n.componentHint)),1),n.required?(r(),c("span",Kl,h(k(u)("datasource.fields.required")),1)):L("",!0)])],8,Ll))),128))])):(r(),c("p",Ul,h(k(u)("datasource.noFormFields")),1))])):(r(),c("div",Wl,[v.value?(r(),c("div",Gl,[(r(!0),c(V,null,W(q.value,n=>(r(),c("div",{key:n.path||"root",class:"ce-datasource-tool__schema-node",style:pe({paddingLeft:`${n.depth*18}px`}),"data-testid":`datasource-schema-node-${p(n.path)}`},[i("span",Yl,h(n.name),1),i("span",Zl,h(n.displayPath),1),i("span",Ql,h(S(n.type)),1),n.required?(r(),c("span",en,h(k(u)("datasource.fields.required")),1)):L("",!0)],12,Xl))),128))])):L("",!0),i("label",tn,[i("span",an,h(k(u)("datasource.fields.jsonSchema")),1),i("textarea",{class:"ce-datasource-tool__textarea ce-datasource-tool__textarea--schema","data-testid":"datasource-json-schema",spellcheck:"false",readonly:A.value,value:w.value,onInput:jt,onKeydown:l[25]||(l[25]=Y(()=>{},["stop"]))},null,40,on)])]))])]))}}),wt=Se(nn,[["__scopeId","data-v-b51983e4"]]);function sn(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID().slice(0,10):Math.random().toString(36).slice(2,12)}function rn(e){return JSON.parse(JSON.stringify(e))}function Pt(e){return typeof e!="object"||e===null||Array.isArray(e)?{}:rn(e)}function _e(e){if(typeof e!="object"||e===null||Array.isArray(e))return;const a=e;if(!(typeof a.type!="string"||typeof a.data!="object"||a.data===null||Array.isArray(a.data)))return{id:typeof a.id=="string"&&a.id?a.id:sn(),type:a.type,data:Pt(a.data)}}function Te(e){return{id:e.id,type:e.type,data:Pt(e.data)}}const It=ke({toolbox:{get title(){return P.t("editorSelector.toolboxTitle")},icon:'<svg width="18" height="18" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><rect x="4" y="5" width="16" height="14" rx="2" fill="none" stroke="currentColor" stroke-width="2"/><path d="M8 9h8M8 13h5" stroke="currentColor" stroke-width="2" stroke-linecap="round"/><path d="M16 15l2 2 3-4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>'},createInitialProps:()=>({value:void 0}),normalizeProps:e=>({edit:e.edit??!1,value:_e(e.value),excludeToolNames:Array.isArray(e.excludeToolNames)?e.excludeToolNames.filter(a=>typeof a=="string"):[]}),serialize:e=>{const a=_e(e.value);return a?{value:a}:{}}}),cn=["innerHTML"],dn={key:1,class:"overflow-auto"},un={key:3,class:"overflow-auto rounded bg-slate-100 p-2 text-xs dark:bg-slate-800"},Me=ge({__name:"EditorPreviewBlock",props:{block:{},compactTable:{type:Boolean,default:!1}},setup(e){const a=e,u=U(()=>a.compactTable?"min-w-full border-collapse text-xs":"min-w-full border-collapse text-sm"),_=U(()=>a.compactTable?"border border-slate-200 px-2 py-1 text-left align-top dark:border-slate-700":"border border-slate-200 px-3 py-2 text-left align-top dark:border-slate-700");function x(v){const w=v.data.content;return Array.isArray(w)?w.filter(D=>Array.isArray(D)):[]}function N(v,w){const D=v.data.withHeadings;return w===0&&D===!0}function O(v){return An(v)}function d(v){const w=Oe(v);return(w==null?void 0:w.component)??null}function m(v){var D;const w=Oe(v.type);return w?{...w.normalizeProps({...((D=w.createInitialProps)==null?void 0:D.call(w))??{},...v.data,edit:!1})}:{edit:!1,...v.data}}return(v,w)=>e.block.type==="paragraph"?(r(),c("p",{key:0,class:"text-sm leading-6",innerHTML:e.block.data.text},null,8,cn)):e.block.type==="table"?(r(),c("div",dn,[i("table",{class:te(u.value)},[i("tbody",null,[(r(!0),c(V,null,W(x(e.block),(D,z)=>(r(),c("tr",{key:`table-${z}`,class:"border-b border-slate-200 dark:border-slate-700"},[(r(!0),c(V,null,W(D,(B,j)=>(r(),be(Ie(N(e.block,z)?"th":"td"),{key:`table-${z}-${j}`,class:te(_.value),innerHTML:B},null,8,["class","innerHTML"]))),128))]))),128))])],2)])):O(e.block.type)?(r(),be(Ie(d(e.block.type)),ba(Qe({key:2},m(e.block))),null,16)):(r(),c("pre",un,h(e.block),1))}}),pn={key:1,class:"ce-editor-selector-tool__preview","data-testid":"preview-editor-selector-value"},mn=ge({__name:"MEditorSelector",props:{edit:{type:Boolean,default:!1},value:{default:void 0},excludeToolNames:{},onChange:{},onToolChange:{}},setup(e){const a="MEditorSelector",u=new Set(["paragraph","table","columns"]),_=e,{t:x,localeValue:N}=xe(),O=X(null),d=X(null),m=X(_e(_.value)),v=U(()=>m.value!==void 0);let w=null,D=!1,z=null,B=null,j=null,K=$(m.value);function $(t){return{blocks:t?[Te(t)]:[]}}function G(t){return t?JSON.stringify(t):""}function Z(){const t=new Set([a]);return(_.excludeToolNames??[]).forEach(s=>{t.add(s)}),t}function A(t){return!Z().has(t)&&!u.has(t)&&!!Oe(t)}function ae(t){if(A(t.type))return _e(t)}function oe(t){const b=(Array.isArray(t.blocks)?t.blocks:[]).map(E=>ae(E)).filter(E=>E!==void 0);return b[b.length-1]}function le(t,s){const b=Array.isArray(t.blocks)?t.blocks:[];return s?b.length!==1?!0:G(ae(b[0]))!==G(s):b.some(E=>A(E.type))}function I(t){var b,E;const s={edit:_.edit,value:t?Te(t):void 0};(b=_.onToolChange)==null||b.call(_,s),(E=_.onChange)==null||E.call(_,s)}async function J(t){const s=w;if(s){D=!0,K=$(t);try{await s.blocks.render(K)}finally{await ve(),D=!1}}}async function q(t){if(D)return;const s=oe(t),b=G(m.value),E=G(s);m.value=s?Te(s):void 0,K=$(m.value),b!==E&&I(m.value),le(t,m.value)&&await J(m.value)}function ee(){B!==null&&(window.clearTimeout(B),B=null)}function Q(){!w||D||(ee(),B=window.setTimeout(async()=>{if(B=null,!(!w||D))try{const t=await w.save();await q(t)}catch{}},0))}function ce(){const t=d.value;t&&(ne(),z=new MutationObserver(()=>{Q()}),z.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),t.addEventListener("input",Q),t.addEventListener("change",Q),t.addEventListener("click",Q))}function ne(){const t=d.value;z==null||z.disconnect(),z=null,ee(),t==null||t.removeEventListener("input",Q),t==null||t.removeEventListener("change",Q),t==null||t.removeEventListener("click",Q)}function ue(t){return t.querySelector(".codex-editor > .ce-toolbar")}function g(t){return t.closest('[data-testid="editor-form-tool"]')??t.closest('[data-testid="editor-panel"]')??document}function C(){const t=O.value;t&&g(t).querySelectorAll(".ce-editor-selector-tool").forEach(s=>{if(s===t)return;const b=ue(s);b==null||b.classList.remove("ce-toolbar--opened")})}function S(){O.value&&C()}function T(){j!==null&&(window.clearTimeout(j),j=null)}function se(){T(),j=window.setTimeout(()=>{j=null,S()},0)}async function re(){if(!_.edit||!d.value||w)return;K=$(m.value);const t=Rt({edit:!0},{exclude:Z()});w=new He({holder:d.value,placeholder:x("editorSelector.placeholder"),tools:t,data:K,minHeight:0,i18n:{messages:Et(N.value)},onChange:async()=>{if(!w)return;const s=await w.save();await q(s)}}),ce()}async function y(){const t=w;if(t){w=null,ne();try{const s=await t.save();m.value=oe(s),K=$(m.value)}catch{K=$(m.value)}t.destroy()}}async function p(){await y(),await ve(),await re()}return Ye(async()=>{await re()}),ie(()=>_.value,async t=>{const s=_e(t);G(s)!==G(m.value)&&(m.value=s,K=$(s),w&&await J(s))},{deep:!0}),ie(()=>_.edit,async t=>{if(t){await ve(),await re();return}await y()}),ie(N,async()=>{w&&await p()}),ie(()=>_.excludeToolNames,async()=>{w&&await p()},{deep:!0}),Ze(async()=>{T(),await y()}),(t,s)=>(r(),c("div",{ref_key:"rootRef",ref:O,class:te(["ce-editor-selector-tool",{"ce-editor-selector-tool--filled":v.value}]),"data-testid":"editor-selector-tool",onMouseenter:se,onMousemove:se},[e.edit?(r(),c("div",{key:0,class:te(["ce-editor-selector-tool__editor-shell",{"ce-editor-selector-tool__editor-shell--filled":v.value}]),"data-testid":"editor-selector-shell"},[i("div",{ref_key:"holderRef",ref:d,class:"ce-editor-selector-tool__editor","data-testid":"editor-selector-surface"},null,512)],2)):(r(),c("div",pn,[m.value?(r(),be(Me,{key:0,block:m.value},null,8,["block"])):L("",!0)]))],34))}}),At=Se(mn,[["__scopeId","data-v-865609b6"]]),yn=Object.freeze(Object.defineProperty({__proto__:null,default:At,mEditorSelectorEditorTool:It},Symbol.toStringTag,{value:"Module"})),fn={key:0,class:"ce-form-item-tool__edit-shell","data-testid":"form-item-edit-shell"},vn={class:"ce-form-item-tool__body"},hn={class:"ce-form-item-tool__label","data-testid":"form-item-label-preview"},_n={class:"ce-form-item-tool__editor","data-testid":"form-item-editor-field"},bn={key:1,class:"ce-form-item-tool__body"},gn={class:"ce-form-item-tool__label","data-testid":"preview-form-item-label"},kn={class:"ce-form-item-tool__editor","data-testid":"preview-form-item-editor"},wn={key:1,class:"ce-form-item-tool__empty"};function Mt(){return`field_${typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID().slice(0,8):Math.random().toString(36).slice(2,10)}`}function Ot(){return P.t("formItem.defaultLabelName")}function Xe(e){return e==="Horizontal"?"Horizontal":"Vertical"}function Cn(e){return typeof e=="string"&&e.trim()?e:Ot()}function Tn(e,a){return typeof e=="string"&&e.trim()?e.trim():a||Mt()}function xn(e){return e?Te(e):void 0}function $e(e,a){return{edit:e.edit??!1,labelName:Cn(e.labelName),variableName:Tn(e.variableName,a),editor:_e(e.editor),layout:Xe(e.layout)}}function $n(e){const a=$e(e);return{labelName:a.labelName,variableName:a.variableName,...a.editor?{editor:Te(a.editor)}:{},layout:a.layout}}const Sn=ke({toolbox:{get title(){return P.t("formItem.toolboxTitle")},icon:'<svg width="18" height="18" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><rect x="4" y="5" width="16" height="14" rx="2" fill="none" stroke="currentColor" stroke-width="2"/><path d="M8 9h8M8 13h3" stroke="currentColor" stroke-width="2" stroke-linecap="round"/><circle cx="16" cy="13" r="2" fill="none" stroke="currentColor" stroke-width="2"/></svg>'},propertyPanel:{get title(){return P.t("formItem.propertyPanelTitle")},get fields(){return[{key:"labelName",label:P.t("formItem.properties.labelName"),placeholder:P.t("formItem.placeholders.labelName")},{key:"variableName",label:P.t("formItem.properties.variableName"),placeholder:P.t("formItem.placeholders.variableName")},{key:"layout",label:P.t("formItem.properties.layout"),type:"select",options:[{label:P.t("formItem.layouts.vertical"),value:"Vertical"},{label:P.t("formItem.layouts.horizontal"),value:"Horizontal"}]}]}},createInitialProps:()=>({labelName:Ot(),variableName:Mt(),editor:void 0,layout:"Vertical"}),normalizeProps:e=>$e(e),serialize:$n}),En=ge({__name:"MFormItem",props:{edit:{type:Boolean,default:!1},labelName:{},variableName:{},editor:{default:void 0},layout:{default:"Vertical"},onChange:{},onToolChange:{}},setup(e){const a=e,{t:u}=xe(),_=["MFormItem","MForm"],x=St($e(a));function N(){var v,w;const m={edit:a.edit,labelName:x.labelName,variableName:x.variableName,editor:xn(x.editor),layout:Xe(x.layout)};(v=a.onToolChange)==null||v.call(a,m),(w=a.onChange)==null||w.call(a,m)}function O(m){m.labelName!==void 0&&(x.labelName=m.labelName),m.variableName!==void 0&&(x.variableName=m.variableName),"editor"in m&&(x.editor=_e(m.editor)),m.layout!==void 0&&(x.layout=Xe(m.layout)),N()}function d(m){O({editor:m.value})}return ie(()=>({labelName:a.labelName,variableName:a.variableName,editor:a.editor,layout:a.layout,edit:a.edit}),m=>{Object.assign(x,$e(m,x.variableName))},{deep:!0}),(m,v)=>(r(),c("div",{class:te(["ce-form-item-tool",{"ce-form-item-tool--edit":e.edit,"ce-form-item-tool--horizontal":x.layout==="Horizontal"}]),"data-testid":"editor-form-item-tool"},[e.edit?(r(),c("div",fn,[i("div",vn,[i("div",hn,h(x.labelName),1),i("div",_n,[Nt(At,{edit:!0,value:x.editor,"exclude-tool-names":_,"on-change":d},null,8,["value"])])])])):(r(),c("div",bn,[i("div",gn,h(x.labelName),1),i("div",kn,[x.editor?(r(),be(Me,{key:0,block:x.editor},null,8,["block"])):(r(),c("span",wn,h(k(u)("formItem.emptyEditor")),1))])]))],2))}}),Ct=Se(En,[["__scopeId","data-v-e6b491c3"]]);function Nn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Bt(e){const a=$e({...e,edit:!1});return{labelName:a.labelName,variableName:a.variableName,...a.editor?{editor:Te(a.editor)}:{},layout:a.layout}}function Dn(e){if(Nn(e))return Bt(e)}function Tt(e){return Array.isArray(e)?e.map(a=>Dn(a)).filter(a=>a!==void 0):[]}const Pn=ke({toolbox:{get title(){return P.t("form.toolboxTitle")},icon:'<svg width="18" height="18" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><rect x="4" y="4" width="16" height="16" rx="2" fill="none" stroke="currentColor" stroke-width="2"/><path d="M8 8h8M8 12h8M8 16h4" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>'},createInitialProps:()=>({items:[]}),normalizeProps:e=>({edit:e.edit??!1,items:Tt(e.items)}),serialize:e=>({items:Tt(e.items).map(a=>Bt(a))})}),In=ke({toolbox:{get title(){return P.t("page.toolboxTitle")},icon:'<svg width="18" height="18" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><rect x="4" y="3" width="16" height="18" rx="2" ry="2" fill="none" stroke="currentColor" stroke-width="2"/><path d="M8 8h8M8 12h8M8 16h5" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>'},createInitialProps:()=>({edit:!1,value:[]}),normalizeProps:e=>({edit:e.edit??!1,value:Array.isArray(e.value)?e.value:[]}),serialize:e=>({value:e.value})});function ye(e){const a=e.name||e.__name;if(!a)throw new Error("Editor component is missing both name and __name.");return a}const et={MPage:{component:de(Ve(()=>je(()=>import("./MPage-PbJKUfhk.js"),__vite__mapDeps([0,1,2,3])))),...In},MEditorSelector:{component:de(Ve(()=>je(()=>Promise.resolve().then(()=>yn),void 0))),...It},MForm:{component:de(Ve(()=>je(()=>import("./MForm-Ct41vjbV.js"),__vite__mapDeps([4,2,1,3,5])))),...Pn},[ye(bt)]:{component:de(bt),...wa},[ye(_t)]:{component:de(_t),...ka},[ye(gt)]:{component:de(gt),...Fa},[ye(kt)]:{component:de(kt),...lo},[ye(wt)]:{component:de(wt),...ln},[ye(Ct)]:{component:de(Ct),...Sn},[ye(ht)]:{component:de(ht),...ga}};function Oe(e){return et[e]}function An(e){return e in et}function Mn(){return et}const xt=new Map;class On{static create(a){const u=xt.get(a);if(u)return u;const _=Oe(a);if(!_)throw new Error(`EditorToolFactory could not find a registered component for "${a}".`);class x{constructor({data:d,config:m}){Ce(this,"state");Ce(this,"wrapper",null);Ce(this,"contentRoot",null);Ce(this,"vueApp",null);Ce(this,"propertyDialog",null);const v={...m??{},...d??{}};if(typeof v.edit!="boolean")throw new Error(`EditorToolFactory requires config.edit to be explicitly set for "${a}".`);this.state=_.normalizeProps({...v})}static get toolbox(){return _.toolbox}render(){const d=document.createElement("div");d.className="mokelay-editor-tool",d.dataset.toolName=a,d.dataset.testid=`editor-tool-${a}`;const m=document.createElement("div");return m.className="mokelay-editor-tool__content",m.dataset.testid=`editor-tool-content-${a}`,d.appendChild(m),this.wrapper=d,this.contentRoot=m,this.createPropertyDialog(),this.mountVueApp(),d}destroy(){var d;this.unmountVueApp(),(d=this.propertyDialog)==null||d.remove(),this.propertyDialog=null,this.contentRoot=null,this.wrapper=null}save(){return _.serialize(this.state)}renderSettings(){var d;return(d=_.propertyPanel)!=null&&d.fields.length?{icon:'<svg width="17" height="17" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M19.14 12.94C19.18 12.63 19.2 12.32 19.2 12C19.2 11.68 19.18 11.36 19.13 11.06L21.11 9.51C21.29 9.37 21.34 9.11 21.23 8.9L19.35 5.64C19.24 5.43 18.99 5.35 18.77 5.42L16.44 6.17C15.96 5.8 15.44 5.48 14.87 5.23L14.51 2.75C14.48 2.52 14.28 2.35 14.04 2.35H10.28C10.04 2.35 9.84 2.52 9.81 2.75L9.45 5.23C8.88 5.48 8.36 5.81 7.88 6.17L5.55 5.42C5.33 5.35 5.08 5.43 4.97 5.64L3.09 8.9C2.98 9.11 3.03 9.37 3.21 9.51L5.19 11.06C5.14 11.36 5.12 11.68 5.12 12C5.12 12.32 5.14 12.64 5.19 12.94L3.21 14.49C3.03 14.63 2.98 14.89 3.09 15.1L4.97 18.36C5.08 18.57 5.33 18.65 5.55 18.58L7.88 17.83C8.36 18.2 8.88 18.52 9.45 18.77L9.81 21.25C9.84 21.48 10.04 21.65 10.28 21.65H14.04C14.28 21.65 14.48 21.48 14.51 21.25L14.87 18.77C15.44 18.52 15.96 18.19 16.44 17.83L18.77 18.58C18.99 18.65 19.24 18.57 19.35 18.36L21.23 15.1C21.34 14.89 21.29 14.63 21.11 14.49L19.14 12.94ZM12.16 15.6C10.17 15.6 8.56 13.99 8.56 12C8.56 10.01 10.17 8.4 12.16 8.4C14.15 8.4 15.76 10.01 15.76 12C15.76 13.99 14.15 15.6 12.16 15.6Z" fill="currentColor"/></svg>',title:P.t("editor.properties"),onActivate:()=>{this.openPropertyDialog()},closeOnActivate:!0}:[]}mountVueApp(){this.contentRoot&&(this.unmountVueApp(),this.vueApp=qe(_.component,{...this.state,onToolChange:d=>{Object.assign(this.state,d)},onChange:d=>{Object.assign(this.state,d)}}),this.vueApp.mount(this.contentRoot))}unmountVueApp(){var d;(d=this.vueApp)==null||d.unmount(),this.vueApp=null}createPropertyDialog(){var w;if(!this.wrapper||!((w=_.propertyPanel)!=null&&w.fields.length))return;const d=document.createElement("dialog");d.className="mokelay-editor-tool__property-dialog",d.dataset.testid="tool-property-dialog",d.dataset.toolName=a;const m=_.propertyPanel.title||P.t("editor.propertyDialogTitle"),v=_.propertyPanel.fields.map(D=>this.renderPropertyField(D)).join("");d.innerHTML=`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MPage-BkuklFgX.js","assets/editorjs-hCuh8vdW.js","assets/index-DP9Xxuqs.js","assets/index-qSOXU8wC.css","assets/MForm-icLQ2kKk.js","assets/MForm-DHyGtILs.css"])))=>i.map(i=>d[i]);
2
+ var Qt=Object.defineProperty;var ea=(e,a,u)=>a in e?Qt(e,a,{enumerable:!0,configurable:!0,writable:!0,value:u}):e[a]=u;var Ce=(e,a,u)=>ea(e,typeof a!="symbol"?a+"":a,u);import{A as He,F as ta,E as aa}from"./editorjs-hCuh8vdW.js";import{d as ge,i as Ye,j as Ze,k as ie,n as ve,l as he,o as r,c,b as i,m as pe,F as V,p as W,w as Y,t as h,u as k,q as oa,e as L,g as be,s as Qe,v as Ie,x as te,f as xe,r as X,y as Ae,z as me,A as ut,B as qe,C as ke,D as $t,E as P,G as pt,H as la,I as Re,J as Ke,_ as Se,h as U,K as fe,L as Le,M as St,N as na,O as mt,P as sa,Q as ra,R as ca,S as yt,T as ze,U as ia,V as Fe,W as da,X as ua,Y as pa,$ as ma,Z as ya,a0 as fa,a1 as va,a2 as ha,a3 as ft,a4 as vt,a5 as _a,a6 as ba,a7 as Et,a as Nt,a8 as ga,a9 as ka,aa as wa,ab as de,ac as ht,ad as _t,ae as bt,af as Ve,ag as je}from"./index-DP9Xxuqs.js";const Ca={class:"ce-advance-input-tool","data-testid":"editor-advance-input-tool"},Ta={key:0,class:"ce-advance-input-tool__editor-shell"},xa=["data-testid","onMousedown"],$a={key:1,class:"ce-advance-input-tool__preview","data-testid":"preview-advance-input-value"},Sa={key:0,class:"ce-advance-input-tool__preview-text"},Ea={key:1,class:"ce-advance-input-tool__preview-token"},Na={class:"ce-advance-input-tool__dialog-header"},Da={class:"ce-advance-input-tool__dialog-title","data-testid":"advance-input-embedded-property-title"},Pa={type:"submit",class:"ce-advance-input-tool__dialog-close","data-testid":"advance-input-embedded-property-close"},Ia={key:0,class:"ce-advance-input-tool__dialog-body"},Aa=["checked","data-testid","onChange"],Ma={class:"ce-advance-input-tool__dialog-label"},Oa={class:"ce-advance-input-tool__dialog-label"},Ba=["value","data-testid","onChange"],Ra=["value"],La={class:"ce-advance-input-tool__dialog-label"},za=["value","placeholder","data-testid","onInput"],Fa=ke({toolbox:{get title(){return P.t("advanceInput.toolboxTitle")},icon:'<svg width="18" height="18" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><rect x="3" y="5" width="18" height="14" rx="3" ry="3" fill="none" stroke="currentColor" stroke-width="2"/><path d="M7 10h5M7 14h3M14 10h3M14 14h3" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>'},createInitialProps:()=>({value:$t()}),normalizeProps:e=>({edit:e.edit??!1,value:he(e.value)}),serialize:e=>({value:he(e.value)})}),Va=ge({__name:"MAdvanceInput",props:{edit:{type:Boolean},value:{},onChange:{type:Function},onToolChange:{type:Function}},setup(e){const a=e,{t:u}=xe(),_=X(null),x=X(null),N=X(!1),O=X({left:0,top:0}),d=X(null),m=new Map;let v=!1,w="";function D(y){return pt(y)}function z(y){return JSON.stringify(D(y))}function B(y){var s;const p=me(y);if(!p)throw new Error(`Unknown inline component "${y}".`);const t=p.normalizeProps({...((s=p.createInitialProps)==null?void 0:s.call(p))??{},edit:!1});return{id:la(),type:y,data:ut(p.serialize(t))}}function j(){m.forEach(y=>{y.app.unmount()}),m.clear()}function K(y){var H;const p=Re(y),t=me(p.type);if(!t){const F=document.createElement("span");return F.className="ce-advance-input-tool__token ce-advance-input-tool__token--unknown",F.dataset.segmentType="component",F.dataset.blockId=p.id,F.dataset.block=JSON.stringify(p),F.textContent=p.type,F}const s=document.createElement("span");s.className="ce-advance-input-tool__token",s.dataset.segmentType="component",s.dataset.blockId=p.id,s.dataset.block=JSON.stringify(p),s.contentEditable="false",s.setAttribute("data-testid",`editor-advance-input-token-${p.type}`);const b=document.createElement("span");b.className="ce-advance-input-tool__token-mount",s.appendChild(b);const E=t.normalizeProps({...((H=t.createInitialProps)==null?void 0:H.call(t))??{},...p.data,edit:!1}),M=qe(t.component,E);return M.mount(b),s.addEventListener("click",F=>{F.preventDefault(),F.stopPropagation(),ue(p.id)}),m.set(p.id,{app:M,block:Re(p),mountPoint:b,wrapper:s}),s}function $(y,p=!1){const t=_.value;if(!t)return;v=!0,j(),t.innerHTML="";const s=he(y);for(const b of s){if(b.type==="paragraph"){t.appendChild(document.createTextNode(Ae(b)));continue}t.appendChild(K(b)),t.appendChild(document.createTextNode("​"))}t.childNodes.length||t.appendChild(document.createTextNode("")),w=z(s),v=!1,p&&ve(()=>{ae(t)})}function G(){const y=_.value;if(!y)return $t();const p=[];return y.childNodes.forEach(t=>{if(t.nodeType===Node.TEXT_NODE){const s=(t.textContent??"").replace(/\u200B/g,"");p.push(Ke(s));return}if(t instanceof HTMLElement){if(t.dataset.segmentType==="component"){const s=t.dataset.blockId??"",b=m.get(s),E=t.dataset.block?JSON.parse(t.dataset.block):null,M=(b==null?void 0:b.block)??E;M&&p.push(Re(M));return}p.push(Ke((t.textContent??"").replace(/\u200B/g,"")))}}),pt(p)}function Z(y){var t,s;w=z(y);const p={edit:a.edit,value:y};(t=a.onToolChange)==null||t.call(a,p),(s=a.onChange)==null||s.call(a,p)}function A(){if(v)return;const y=D(G());z(y)!==w&&Z(y)}function ae(y){const p=window.getSelection();if(!p)return;const t=document.createRange();t.selectNodeContents(y),t.collapse(!1),p.removeAllRanges(),p.addRange(t)}function oe(){const y=_.value;y&&y.focus()}function le(){const y=_.value,p=window.getSelection();if(!y||!p||p.rangeCount===0)return null;const t=p.getRangeAt(0);return y.contains(t.startContainer)?{root:y,selection:p,range:t}:null}function I(){const y=le();if(!y||!y.selection.isCollapsed){N.value=!1;return}const{range:p,root:t}=y;let s="";if(p.startContainer.nodeType===Node.TEXT_NODE){const M=p.startContainer.textContent??"";p.startOffset>0&&(s=M[p.startOffset-1]??"")}else if(p.startContainer instanceof HTMLElement&&p.startOffset>0){const M=p.startContainer.childNodes[p.startOffset-1];if((M==null?void 0:M.nodeType)===Node.TEXT_NODE){const H=M.textContent??"";s=H[H.length-1]??""}}if(s!=="/"){N.value=!1;return}const b=p.getBoundingClientRect(),E=t.getBoundingClientRect();O.value={left:Math.max(0,b.left-E.left),top:Math.max(E.height+8,b.bottom-E.top+8)},N.value=!0}function J(){A(),I()}function q(){I()}function ee(){window.setTimeout(()=>{N.value=!1},120)}function Q(y){var s,b;if(y.key==="Enter"){y.preventDefault();return}if(y.key!=="Backspace")return;const p=le();if(!p||!p.selection.isCollapsed)return;const{range:t}=p;if(t.startContainer.nodeType===Node.TEXT_NODE){const E=t.startContainer;if(t.startOffset<=0||E.data[t.startOffset-1]!=="​")return;const M=E.previousSibling;if(!(M instanceof HTMLElement)||M.dataset.segmentType!=="component")return;y.preventDefault();const H=M.dataset.blockId??"";(s=m.get(H))==null||s.app.unmount(),m.delete(H),M.remove(),E.deleteData(t.startOffset-1,1),A();return}if(t.startContainer instanceof HTMLElement&&t.startOffset>0){const E=t.startContainer.childNodes[t.startOffset-1];if(!(E instanceof HTMLElement)||E.dataset.segmentType!=="component")return;y.preventDefault();const M=E.dataset.blockId??"";(b=m.get(M))==null||b.app.unmount(),m.delete(M),E.remove(),A()}}function ce(y){var t;y.preventDefault();const p=((t=y.clipboardData)==null?void 0:t.getData("text/plain"))??"";document.execCommand("insertText",!1,p.replace(/\n/g," "))}function ne(y){const p=le();if(!p)return;const{selection:t,range:s}=p,b=B(y);if(s.startContainer.nodeType===Node.TEXT_NODE){const F=s.startContainer;s.startOffset>0&&F.data[s.startOffset-1]==="/"&&(F.deleteData(s.startOffset-1,1),s.setStart(F,s.startOffset-1),s.collapse(!0))}const E=K(b),M=document.createTextNode("​");s.insertNode(M),s.insertNode(E);const H=document.createRange();H.setStart(M,1),H.collapse(!0),t.removeAllRanges(),t.addRange(H),N.value=!1,A(),oe()}function ue(y){var E,M,H,F;const p=m.get(y);if(!p)return;const t=me(p.block.type),s=((E=t==null?void 0:t.propertyPanel)==null?void 0:E.fields)??[];if(!t||!s.length)return;const b=t.normalizeProps({...((M=t.createInitialProps)==null?void 0:M.call(t))??{},...p.block.data,edit:!1});d.value={blockId:y,title:((H=t.propertyPanel)==null?void 0:H.title)||u("editor.propertyDialogTitle"),type:p.block.type,fields:s,values:Object.fromEntries(s.map(Ee=>[Ee.key,b[Ee.key]??""]))},(F=x.value)==null||F.showModal()}function g(){var y;(y=x.value)==null||y.close(),d.value=null}function C(y,p){var H;const t=d.value;if(!t)return;t.values[y]=p,d.value={...t,values:{...t.values}};const s=m.get(t.blockId),b=me(t.type);if(!s||!b)return;const E=b.normalizeProps({...((H=b.createInitialProps)==null?void 0:H.call(b))??{},...t.values,edit:!1});s.block={...s.block,data:ut(b.serialize(E))},s.wrapper.dataset.block=JSON.stringify(s.block),s.app.unmount();const M=qe(b.component,E);M.mount(s.mountPoint),s.app=M,A()}function S(){return he(a.value)}function T(y){var p;return((p=me(y))==null?void 0:p.component)??null}function se(y){return Ae(y)}function re(y){var t;const p=me(y.type);return p?p.normalizeProps({...((t=p.createInitialProps)==null?void 0:t.call(p))??{},...y.data,edit:!1}):{edit:!1}}return Ye(()=>{a.edit&&$(a.value)}),Ze(()=>{j()}),ie(()=>a.edit,y=>{if(!y){N.value=!1;return}ve(()=>{$(a.value)})}),ie(()=>a.value,y=>{if(!a.edit)return;const p=he(y);z(p)!==w&&$(p)}),(y,p)=>{var t;return r(),c("div",Ca,[e.edit?(r(),c("div",Ta,[i("div",{ref_key:"editableRef",ref:_,class:"ce-advance-input-tool__editor","data-testid":"editor-advance-input-content",contenteditable:"true",spellcheck:"false",onInput:J,onClick:q,onKeyup:I,onKeydown:Q,onPaste:ce,onBlur:ee},null,544),N.value?(r(),c("div",{key:0,class:"ce-advance-input-tool__menu","data-testid":"editor-advance-input-menu",style:pe({left:`${O.value.left}px`,top:`${O.value.top}px`})},[(r(!0),c(V,null,W(k(oa)(),([s,b])=>(r(),c("button",{key:s,type:"button",class:"ce-advance-input-tool__menu-item","data-testid":`editor-advance-input-menu-item-${s}`,onMousedown:Y(E=>ne(s),["prevent"])},h(b.toolbox.title),41,xa))),128))],4)):L("",!0)])):(r(),c("div",$a,[(r(!0),c(V,null,W(S(),(s,b)=>(r(),c(V,{key:`${s.id}-${s.type}-${b}`},[s.type==="paragraph"?(r(),c("span",Sa,h(se(s)),1)):(r(),c("span",Ea,[(r(),be(Ie(T(s.type)),Qe({ref_for:!0},re(s)),null,16))]))],64))),128))])),i("dialog",{ref_key:"embeddedDialogRef",ref:x,class:"ce-advance-input-tool__dialog","data-testid":"advance-input-embedded-property-dialog",onClose:p[0]||(p[0]=s=>d.value=null)},[i("form",{method:"dialog",class:"ce-advance-input-tool__dialog-panel",onSubmit:Y(g,["prevent"])},[i("div",Na,[i("h3",Da,h((t=d.value)==null?void 0:t.title),1),i("button",Pa,h(k(u)("editor.close")),1)]),d.value?(r(),c("div",Ia,[(r(!0),c(V,null,W(d.value.fields,s=>(r(),c("label",{key:s.key,class:te(["ce-advance-input-tool__dialog-field",{"ce-advance-input-tool__dialog-field--checkbox":s.type==="checkbox"}])},[s.type==="checkbox"?(r(),c(V,{key:0},[i("input",{class:"ce-advance-input-tool__dialog-checkbox",type:"checkbox",checked:d.value.values[s.key]===!0,"data-testid":`advance-input-embedded-property-input-${s.key}`,onChange:b=>C(s.key,b.target.checked)},null,40,Aa),i("span",Ma,h(s.label),1)],64)):s.type==="select"?(r(),c(V,{key:1},[i("span",Oa,h(s.label),1),i("select",{class:"ce-advance-input-tool__dialog-input",value:String(d.value.values[s.key]??""),"data-testid":`advance-input-embedded-property-input-${s.key}`,onChange:b=>C(s.key,b.target.value)},[(r(!0),c(V,null,W(s.options??[],b=>(r(),c("option",{key:b.value,value:b.value},h(b.label),9,Ra))),128))],40,Ba)],64)):(r(),c(V,{key:2},[i("span",La,h(s.label),1),i("input",{class:"ce-advance-input-tool__dialog-input",type:"text",value:String(d.value.values[s.key]??""),placeholder:s.placeholder,"data-testid":`advance-input-embedded-property-input-${s.key}`,onInput:b=>C(s.key,b.target.value)},null,40,za)],64))],2))),128))])):L("",!0)],32)],544)])}}}),gt=Se(Va,[["__scopeId","data-v-5ab6cc48"]]),ja={class:"ce-advance-table-tool","data-testid":"editor-advance-table-tool"},Ja={class:"ce-advance-table-tool__scroller"},Ha={class:"ce-advance-table-tool__table","data-testid":"advance-table"},qa=["checked","aria-label"],Ka=["data-testid"],Ua=["data-testid"],Wa=["data-testid"],Ga=["checked","aria-label","onChange"],Xa=["data-testid"],Ya=["data-testid"],Za={key:0,class:"ce-advance-table-tool__cell-text"},Qa={key:1,class:"ce-advance-table-tool__cell-token"},eo={key:0},to=["colspan"];function Je(e,a){return[Ke(e,a)]}function ao(){return[{id:"advance-table-default-tag",type:"MTag",data:{tagName:"{{tag}}",type:"{{tagType}}",size:"small",color:"",closable:!1}}]}function oo(){return[{id:"advance-table-default-link",type:"MLink",data:{text:"{{linkText}}",url:"{{linkUrl}}",open:!1}}]}function Ue(){return[{columnName:P.t("advanceTable.defaultColumns.name"),columnContent:Je("{{name}}","advance-table-default-name"),width:180,fixed:"left"},{columnName:P.t("advanceTable.defaultColumns.status"),columnContent:Je("{{status}}","advance-table-default-status"),width:140,fixed:null},{columnName:P.t("advanceTable.defaultColumns.tag"),columnContent:ao(),width:120,fixed:null},{columnName:P.t("advanceTable.defaultColumns.owner"),columnContent:Je("{{owner}}","advance-table-default-owner"),width:160,fixed:null},{columnName:P.t("advanceTable.defaultColumns.link"),columnContent:oo(),width:180,fixed:null}]}function Dt(){return[{name:P.t("advanceTable.defaultRows.first.name"),status:P.t("advanceTable.defaultRows.first.status"),tag:P.t("advanceTable.defaultRows.first.tag"),tagType:"warning",owner:P.t("advanceTable.defaultRows.first.owner"),linkText:P.t("advanceTable.defaultRows.first.linkText"),linkUrl:P.t("advanceTable.defaultRows.first.linkUrl")},{name:P.t("advanceTable.defaultRows.second.name"),status:P.t("advanceTable.defaultRows.second.status"),tag:P.t("advanceTable.defaultRows.second.tag"),tagType:"success",owner:P.t("advanceTable.defaultRows.second.owner"),linkText:P.t("advanceTable.defaultRows.second.linkText"),linkUrl:P.t("advanceTable.defaultRows.second.linkUrl")}]}const lo=ke({toolbox:{get title(){return P.t("advanceTable.toolboxTitle")},icon:'<svg width="18" height="18" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><rect x="3" y="5" width="18" height="14" rx="2" fill="none" stroke="currentColor" stroke-width="2"/><path d="M3 10h18M8 5v14M16 5v14" stroke="currentColor" stroke-width="2"/></svg>'},propertyPanel:{get title(){return P.t("advanceTable.propertyPanelTitle")},get fields(){return[{key:"index",label:P.t("advanceTable.properties.index"),type:"checkbox"},{key:"selection",label:P.t("advanceTable.properties.selection"),type:"checkbox"}]}},createInitialProps:()=>({index:!1,selection:!1,columns:Ue(),data:Dt()}),normalizeProps:e=>({edit:e.edit??!1,index:e.index===!0,selection:e.selection===!0,columns:We(e.columns),data:Ge(e.data)}),serialize:e=>({index:e.index===!0,selection:e.selection===!0,columns:We(e.columns),data:Ge(e.data)})});function We(e){if(!Array.isArray(e)||!e.length)return Ue();const a=e.filter(u=>typeof u=="object"&&u!==null).map((u,_)=>{var x;return{columnName:((x=u.columnName)==null?void 0:x.trim())||`${P.t("advanceTable.defaultColumnName")}${_+1}`,columnContent:he(u.columnContent),width:no(u.width),fixed:so(u.fixed)}});return a.length?a:Ue()}function Ge(e){return Array.isArray(e)?e.filter(a=>typeof a=="object"&&a!==null&&!Array.isArray(a)):Dt()}function no(e){return typeof e!="number"||!Number.isFinite(e)||e<=0?null:Math.round(e)}function so(e){return e==="left"||e==="right"?e:null}const ro=ge({__name:"MAdvanceTable",props:{edit:{type:Boolean},index:{type:Boolean},selection:{type:Boolean},columns:{},data:{},onChange:{type:Function},onToolChange:{type:Function}},setup(e){const a=e,{t:u}=xe(),_=X(new Set),x=U(()=>We(a.columns)),N=U(()=>Ge(a.data)),O=U(()=>a.selection===!0),d=U(()=>a.index===!0),m=44,v=56,w=160;function D(g){if(g==null)return"";if(typeof g=="string")return g;if(typeof g=="number"||typeof g=="boolean")return String(g);try{return JSON.stringify(g)}catch{return String(g)}}function z(g,C){return g.replace(/\{\{\s*([\w.-]+)\s*\}\}/g,(S,T)=>D(B(C,T)))}function B(g,C){return C.split(".").reduce((S,T)=>typeof S!="object"||S===null||!(T in S)?"":S[T],g)}function j(g,C){return typeof g=="string"?z(g,C):Array.isArray(g)?g.map(S=>j(S,C)):typeof g=="object"&&g!==null?Object.fromEntries(Object.entries(g).map(([S,T])=>[S,j(T,C)])):g}function K(g,C){return he(C.columnContent).map(S=>S.type==="paragraph"?{...S,data:{text:z(Ae(S),g)}}:{...S,data:j(S.data,g)})}function $(g){var C;return((C=me(g))==null?void 0:C.component)??null}function G(g){var S;const C=me(g.type);return C?C.normalizeProps({...((S=C.createInitialProps)==null?void 0:S.call(C))??{},...g.data,edit:!1}):{edit:!1}}function Z(g){return Ae(g)}function A(g){return g.width??null}function ae(g){return A(g)??w}function oe(g){let C=0;O.value&&(C+=m),d.value&&(C+=v);for(let S=0;S<g;S+=1){const T=x.value[S];(T==null?void 0:T.fixed)==="left"&&(C+=ae(T))}return C}function le(g){let C=0;for(let S=x.value.length-1;S>g;S-=1){const T=x.value[S];(T==null?void 0:T.fixed)==="right"&&(C+=ae(T))}return C}function I(g,C){const S=A(g),T={};return S&&(T.width=`${S}px`,T.minWidth=`${S}px`),g.fixed==="left"&&(T.position="sticky",T.left=`${oe(C)}px`),g.fixed==="right"&&(T.position="sticky",T.right=`${le(C)}px`),T}function J(g){return{"ce-advance-table-tool__cell--fixed-left":g.fixed==="left","ce-advance-table-tool__cell--fixed-right":g.fixed==="right"}}function q(){return{width:`${m}px`,minWidth:`${m}px`,left:"0px"}}function ee(){return{width:`${v}px`,minWidth:`${v}px`,left:`${O.value?m:0}px`}}function Q(g){return _.value.has(g)}function ce(g){const C=new Set(_.value);C.has(g)?C.delete(g):C.add(g),_.value=C}function ne(){return N.value.length>0&&N.value.every((g,C)=>_.value.has(C))}function ue(){if(ne()){_.value=new Set;return}_.value=new Set(N.value.map((g,C)=>C))}return(g,C)=>(r(),c("div",ja,[i("div",Ja,[i("table",Ha,[i("thead",null,[i("tr",null,[e.selection?(r(),c("th",{key:0,class:"ce-advance-table-tool__cell ce-advance-table-tool__cell--header ce-advance-table-tool__cell--control ce-advance-table-tool__cell--fixed-left",style:pe(q()),"data-testid":"advance-table-selection-header"},[i("input",{class:"ce-advance-table-tool__checkbox",type:"checkbox",checked:ne(),"aria-label":k(u)("advanceTable.selectAll"),onChange:ue},null,40,qa)],4)):L("",!0),e.index?(r(),c("th",{key:1,class:"ce-advance-table-tool__cell ce-advance-table-tool__cell--header ce-advance-table-tool__cell--control ce-advance-table-tool__cell--fixed-left",style:pe(ee()),"data-testid":"advance-table-index-header"}," # ",4)):L("",!0),(r(!0),c(V,null,W(x.value,(S,T)=>(r(),c("th",{key:`header-${T}`,class:te(["ce-advance-table-tool__cell ce-advance-table-tool__cell--header",J(S)]),style:pe(I(S,T)),"data-testid":`advance-table-header-${T}`},h(S.columnName),15,Ka))),128))])]),i("tbody",null,[(r(!0),c(V,null,W(N.value,(S,T)=>(r(),c("tr",{key:`row-${T}`,class:te(["ce-advance-table-tool__row",{"ce-advance-table-tool__row--selected":Q(T)}]),"data-testid":`advance-table-row-${T}`},[e.selection?(r(),c("td",{key:0,class:"ce-advance-table-tool__cell ce-advance-table-tool__cell--control ce-advance-table-tool__cell--fixed-left",style:pe(q()),"data-testid":`advance-table-selection-cell-${T}`},[i("input",{class:"ce-advance-table-tool__checkbox",type:"checkbox",checked:Q(T),"aria-label":k(u)("advanceTable.selectRow"),onChange:se=>ce(T)},null,40,Ga)],12,Wa)):L("",!0),e.index?(r(),c("td",{key:1,class:"ce-advance-table-tool__cell ce-advance-table-tool__cell--control ce-advance-table-tool__cell--fixed-left",style:pe(ee()),"data-testid":`advance-table-index-cell-${T}`},h(T+1),13,Xa)):L("",!0),(r(!0),c(V,null,W(x.value,(se,re)=>(r(),c("td",{key:`cell-${T}-${re}`,class:te(["ce-advance-table-tool__cell",J(se)]),style:pe(I(se,re)),"data-testid":`advance-table-cell-${T}-${re}`},[(r(!0),c(V,null,W(K(S,se),(y,p)=>(r(),c(V,{key:`${T}-${re}-${y.id}-${y.type}-${p}`},[y.type==="paragraph"?(r(),c("span",Za,h(Z(y)),1)):(r(),c("span",Qa,[(r(),be(Ie($(y.type)),Qe({ref_for:!0},G(y)),null,16))]))],64))),128))],14,Ya))),128))],10,Ua))),128)),N.value.length?L("",!0):(r(),c("tr",eo,[i("td",{class:"ce-advance-table-tool__cell ce-advance-table-tool__empty",colspan:x.value.length+(e.selection?1:0)+(e.index?1:0)},h(k(u)("advanceTable.empty")),9,to)]))])])])]))}}),kt=Se(ro,[["__scopeId","data-v-6eb0809a"]]),co={class:"ce-datasource-tool","data-testid":"editor-datasource-tool"},io={class:"ce-datasource-tool__header"},uo={class:"ce-datasource-tool__title"},po=["aria-label"],mo=["disabled"],yo=["disabled"],fo={key:0,class:"ce-datasource-tool__panel","data-testid":"datasource-json-panel"},vo={class:"ce-datasource-tool__field"},ho={class:"ce-datasource-tool__label"},_o=["readonly","value"],bo={key:0,class:"ce-datasource-tool__error","data-testid":"datasource-json-error"},go={key:1,class:"ce-datasource-tool__panel","data-testid":"datasource-api-panel"},ko={class:"ce-datasource-tool__grid"},wo={class:"ce-datasource-tool__field"},Co={class:"ce-datasource-tool__label"},To=["readonly","value"],xo={class:"ce-datasource-tool__field"},$o={class:"ce-datasource-tool__label"},So=["readonly","value"],Eo={class:"ce-datasource-tool__field"},No={class:"ce-datasource-tool__label"},Do=["disabled","value"],Po={open:"",class:"ce-datasource-tool__list","data-testid":"datasource-header-list"},Io={class:"ce-datasource-tool__list-header"},Ao={class:"ce-datasource-tool__list-title"},Mo={key:0,class:"ce-datasource-tool__empty"},Oo=["data-testid","readonly","placeholder","value","onInput"],Bo=["data-testid","readonly","placeholder","value","onInput"],Ro=["data-testid","aria-label","onClick"],Lo={open:"",class:"ce-datasource-tool__list","data-testid":"datasource-query-list"},zo={class:"ce-datasource-tool__list-header"},Fo={class:"ce-datasource-tool__list-title"},Vo={key:0,class:"ce-datasource-tool__empty"},jo=["data-testid","readonly","placeholder","value","onInput"],Jo=["data-testid","readonly","placeholder","value","onInput"],Ho=["data-testid","aria-label","onClick"],qo={open:"",class:"ce-datasource-tool__list","data-testid":"datasource-body-list"},Ko={class:"ce-datasource-tool__list-header"},Uo={class:"ce-datasource-tool__list-title"},Wo={key:0,class:"ce-datasource-tool__empty"},Go=["data-testid","readonly","placeholder","value","onInput"],Xo=["data-testid","disabled","value","onChange"],Yo=["value"],Zo=["data-testid","disabled","value","onChange"],Qo=["data-testid"],el=["data-testid","readonly","value","onInput"],tl=["data-testid","type","readonly","placeholder","value","onInput"],al=["data-testid","aria-label","onClick"],ol=["data-testid"],ll={class:"ce-datasource-tool__generate-panel","data-testid":"datasource-schema-generate-panel"},nl={class:"ce-datasource-tool__section-title"},sl={class:"ce-datasource-tool__section-copy"},rl={class:"ce-datasource-tool__generate-actions"},cl=["disabled"],il={key:1,class:"ce-datasource-tool__schema-summary","data-testid":"datasource-schema-summary"},dl={key:0,class:"ce-datasource-tool__error","data-testid":"datasource-json-schema-error"},ul={class:"ce-datasource-tool__schema-panel","data-testid":"datasource-json-schema-panel"},pl={class:"ce-datasource-tool__schema-header"},ml={class:"ce-datasource-tool__section-title"},yl={class:"ce-datasource-tool__section-copy"},fl=["placeholder","value"],vl={class:"ce-datasource-tool__tabs","data-testid":"datasource-schema-tabs"},hl={key:0,class:"ce-datasource-tool__schema-tab-panel","data-testid":"datasource-list-schema-panel"},_l={key:0,class:"ce-datasource-tool__empty","data-testid":"datasource-schema-empty"},bl={key:1,class:"ce-datasource-tool__field"},gl={class:"ce-datasource-tool__label"},kl=["disabled","value"],wl=["value"],Cl={key:2,class:"ce-datasource-tool__empty","data-testid":"datasource-list-schema-empty"},Tl={key:3,class:"ce-datasource-tool__field-list","data-testid":"datasource-list-fields"},xl={class:"ce-datasource-tool__field-list-summary"},$l=["data-testid"],Sl=["disabled","checked","data-testid","onChange"],El={class:"ce-datasource-tool__schema-field-main"},Nl=["readonly","value","data-testid","onInput"],Dl={class:"ce-datasource-tool__schema-path"},Pl={class:"ce-datasource-tool__schema-badges"},Il={class:"ce-datasource-tool__schema-badge"},Al={class:"ce-datasource-tool__schema-badge"},Ml={key:0,class:"ce-datasource-tool__schema-badge ce-datasource-tool__schema-badge--required"},Ol={key:1,class:"ce-datasource-tool__schema-tab-panel","data-testid":"datasource-form-schema-panel"},Bl={key:0,class:"ce-datasource-tool__field-list","data-testid":"datasource-form-fields"},Rl={class:"ce-datasource-tool__field-list-summary"},Ll=["data-testid"],zl=["disabled","checked","data-testid","onChange"],Fl={class:"ce-datasource-tool__schema-field-main"},Vl=["readonly","value","data-testid","onInput"],jl={class:"ce-datasource-tool__schema-path"},Jl={class:"ce-datasource-tool__schema-badges"},Hl={class:"ce-datasource-tool__schema-badge"},ql={class:"ce-datasource-tool__schema-badge"},Kl={key:0,class:"ce-datasource-tool__schema-badge ce-datasource-tool__schema-badge--required"},Ul={key:1,class:"ce-datasource-tool__empty","data-testid":"datasource-form-schema-empty"},Wl={key:2,class:"ce-datasource-tool__schema-tab-panel","data-testid":"datasource-advanced-schema-panel"},Gl={key:0,class:"ce-datasource-tool__schema-tree","data-testid":"datasource-schema-tree"},Xl=["data-testid"],Yl={class:"ce-datasource-tool__schema-node-name"},Zl={class:"ce-datasource-tool__schema-path"},Ql={class:"ce-datasource-tool__schema-badge"},en={key:0,class:"ce-datasource-tool__schema-badge ce-datasource-tool__schema-badge--required"},tn={class:"ce-datasource-tool__field"},an={class:"ce-datasource-tool__label"},on=["readonly","value"],ln=ke({toolbox:{get title(){return P.t("datasource.toolboxTitle")},icon:'<svg width="18" height="18" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><ellipse cx="12" cy="6" rx="7" ry="3" fill="none" stroke="currentColor" stroke-width="2"/><path d="M5 6v6c0 1.7 3.1 3 7 3s7-1.3 7-3V6M5 12v6c0 1.7 3.1 3 7 3s7-1.3 7-3v-6" fill="none" stroke="currentColor" stroke-width="2"/><path d="M8 12c1.1.5 2.5.8 4 .8s2.9-.3 4-.8" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>'},createInitialProps:()=>({value:fa()}),normalizeProps:e=>({edit:e.edit??!1,value:fe(e.value)}),serialize:e=>({value:fe(e.value)})}),nn=ge({__name:"MDatasourceEditor",props:{edit:{type:Boolean},value:{},onChange:{type:Function},onToolChange:{type:Function}},setup(e){const a=e,{t:u}=xe(),_=fe(a.value),x=sa,N=X(_.type),O=Le(_.type==="JSON"?_.rawData:{}),d=X(g(O.value)),m=X(""),v=Le(_.jsonSchema),w=X(C(v.value)),D=X(""),z=X(!1),B=Le(_.schemaSelections),j=X("list"),K=X(""),$=St(_.type==="API"?_:na()),G=X($.bodyData.map(o=>we(o))),Z=X($.bodyData.map(()=>"")),A=U(()=>!a.edit),ae=U(()=>va(v.value)),oe=U(()=>ra(ae.value)),le=U(()=>ca(v.value)),I=U(()=>{var o,l;return((l=(o=B.value)==null?void 0:o.list)==null?void 0:l.fields)??[]}),J=U(()=>{var o,l;return((l=(o=B.value)==null?void 0:o.form)==null?void 0:l.fields)??[]}),q=U(()=>re(oe.value,K.value)),ee=U(()=>y(I.value,K.value)),Q=U(()=>y(J.value,K.value)),ce=U(()=>{var o,l;return((l=(o=B.value)==null?void 0:o.list)==null?void 0:l.recordPath)??""}),ne=U(()=>I.value.filter(o=>o.enabled).length),ue=U(()=>J.value.filter(o=>o.enabled).length);function g(o){return JSON.stringify(o,null,2)}function C(o){return o?JSON.stringify(o,null,2):""}function S(o){return u(`datasource.schemaTypes.${o}`)}function T(o){return u(`datasource.componentHints.${o}`)}function se(o){return o.trim().toLowerCase()}function re(o,l){const n=se(l);return n?o.filter(f=>f.name.toLowerCase().includes(n)||f.displayPath.toLowerCase().includes(n)):o}function y(o,l){const n=se(l);return n?o.filter(f=>f.label.toLowerCase().includes(n)||f.path.toLowerCase().includes(n)):o}function p(o){return o||"root"}function t(o){return o?`${o}[]`:u("datasource.fields.rootRecordPath")}function s(o){return{edit:a.edit,value:fe(o)}}function b(o){var n,f;if(!a.edit)return;const l=s(o);(n=a.onToolChange)==null||n.call(a,l),(f=a.onChange)==null||f.call(a,l)}function E(){return fe({type:"JSON",rawData:ha(O.value,{}),jsonSchema:v.value,schemaSelections:B.value})}function M(){return fe({type:"API",domain:$.domain,path:$.path,method:$.method,headerData:$.headerData,bodyData:$.bodyData,queryData:$.queryData,jsonSchema:v.value,schemaSelections:B.value})}function H(){b(N.value==="JSON"?E():M())}function F(){b(M())}function Ee(){G.value=$.bodyData.map(o=>we(o)),Z.value=$.bodyData.map(()=>"")}function Lt(o,l){v.value=o?ft(o):void 0,w.value=C(v.value),B.value=vt(l,v.value),D.value=""}function zt(o){Object.assign($,{type:"API",domain:o.domain,path:o.path,method:o.method,headerData:o.headerData.map(l=>({...l})),bodyData:o.bodyData.map(l=>({key:l.key,dataType:l.dataType,mock:mt(l.dataType,l.mock)})),queryData:o.queryData.map(l=>({...l}))}),Ee()}function Ft(o){const l=fe(o);if(N.value=l.type,Lt(l.jsonSchema,l.schemaSelections),l.type==="JSON"){O.value=l.rawData,d.value=g(l.rawData),m.value="";return}zt(l)}function tt(o){if(!(!a.edit||N.value===o)){if(N.value=o,o==="JSON"){b(E());return}F()}}function Vt(o){if(!a.edit)return;const l=o.target.value;d.value=l;try{const n=JSON.parse(l);if(!yt(n))throw new Error("Invalid JSON value.");O.value=ze(n),m.value="",b(E())}catch{m.value=u("datasource.validation.invalidJson")}}function jt(o){if(!a.edit)return;const l=o.target.value;if(w.value=l,!l.trim()){v.value=void 0,B.value=void 0,D.value="",H();return}try{const n=JSON.parse(l),f=ia(n);if(!f)throw new Error("Invalid JSON Schema.");v.value=f,B.value=Fe(f,B.value),D.value="",H()}catch{D.value=u("datasource.validation.invalidJsonSchema")}}function at(o,l){a.edit&&($[o]=l,F())}function Jt(o){a.edit&&($.method=da(o),F())}function Ne(o){return $[o]}function ot(o){a.edit&&($[o].push({key:"",mock:""}),F())}function De(o,l,n,f){if(!a.edit)return;const R=$[o][l];R&&(R[n]=f,F())}function lt(o,l){a.edit&&($[o].splice(l,1),F())}function Ht(){if(!a.edit)return;const o={key:"",dataType:"string",mock:""};$.bodyData.push(o),G.value.push(we(o)),Z.value.push(""),F()}function qt(o,l){if(!a.edit)return;const n=$.bodyData[o];n&&(n.key=l,F())}function Kt(o,l){if(!a.edit)return;const n=$.bodyData[o];n&&(n.dataType=ua(l),n.mock=pa(n.dataType),G.value[o]=we(n),Z.value[o]="",F())}function Be(o,l){if(!a.edit)return;const n=$.bodyData[o];if(!n)return;G.value[o]=l;const f=Zt(n.dataType,l);if(!f.ok){Z.value[o]=f.error;return}n.mock=f.value,Z.value[o]="",F()}function Ut(o){a.edit&&($.bodyData.splice(o,1),G.value.splice(o,1),Z.value.splice(o,1),F())}function Wt(o){return o instanceof _a?o.code==="apiRequestFailed"?`${u("datasource.validation.apiRequestFailed")} ${o.status??""} ${o.statusText??""}`.trim():u(`datasource.validation.${o.code}`):o instanceof Error?o.message:String(o)}function Gt(o){v.value=ft(o),w.value=C(v.value),B.value=Fe(v.value,B.value),D.value="",H()}function Xt(o){var l,n;!a.edit||!v.value||(B.value=Fe(v.value,{...B.value,list:{recordPath:o,fields:((n=(l=B.value)==null?void 0:l.list)==null?void 0:n.fields)??[]}}),H())}function nt(o,l,n){var it,dt;if(!a.edit)return;const f=vt(B.value,v.value),R=o==="list"?(it=f==null?void 0:f.list)==null?void 0:it.fields:(dt=f==null?void 0:f.form)==null?void 0:dt.fields;if(!R)return;const ct=R.map(Pe=>Pe.path===l?{...Pe,...n,label:n.label!==void 0?n.label:Pe.label}:Pe);B.value={...f,...o==="list"&&(f!=null&&f.list)?{list:{...f.list,fields:ct}}:{},...o==="form"?{form:{fields:ct}}:{}},H()}function st(o,l,n){nt(o,l,{label:n.trim()||l})}function rt(o,l,n){nt(o,l,{enabled:n})}async function Yt(){if(!(!a.edit||z.value)){if(D.value="",N.value==="JSON"){if(m.value){D.value=u("datasource.validation.fixJsonBeforeSchema");return}}else if(Z.value.findIndex(l=>!!l)>=0){D.value=u("datasource.validation.fixBodyBeforeSchema");return}z.value=!0;try{const o=await ma(N.value==="JSON"?E():M());Gt(o)}catch(o){D.value=Wt(o)}finally{z.value=!1}}}function Zt(o,l){if(o==="string")return{ok:!0,value:l};if(o==="number"){const n=l.trim(),f=Number(n);return!n||!Number.isFinite(f)?{ok:!1,error:u("datasource.validation.invalidNumber")}:{ok:!0,value:f}}if(o==="boolean")return{ok:!0,value:l==="true"};if(o==="null")return{ok:!0,value:null};try{const n=JSON.parse(l);return o==="object"?ya(n)?{ok:!0,value:ze(n)}:{ok:!1,error:u("datasource.validation.invalidObject")}:!Array.isArray(n)||!yt(n)?{ok:!1,error:u("datasource.validation.invalidArray")}:{ok:!0,value:ze(n)}}catch{return{ok:!1,error:u(o==="object"?"datasource.validation.invalidObject":"datasource.validation.invalidArray")}}}function we(o){const l=mt(o.dataType,o.mock);return o.dataType==="object"||o.dataType==="array"?g(l):o.dataType==="null"?"null":String(l)}return ie(()=>a.value,o=>{Ft(o)},{deep:!0}),(o,l)=>(r(),c("div",co,[i("div",io,[i("div",uo,h(k(u)("datasource.title")),1),i("div",{class:"ce-datasource-tool__type-switch","aria-label":k(u)("datasource.fields.type")},[i("button",{type:"button",class:te(["ce-datasource-tool__type-button",{"ce-datasource-tool__type-button--active":N.value==="JSON"}]),disabled:A.value,"data-testid":"datasource-type-json",onClick:l[0]||(l[0]=n=>tt("JSON"))}," JSON ",10,mo),i("button",{type:"button",class:te(["ce-datasource-tool__type-button",{"ce-datasource-tool__type-button--active":N.value==="API"}]),disabled:A.value,"data-testid":"datasource-type-api",onClick:l[1]||(l[1]=n=>tt("API"))}," API ",10,yo)],8,po)]),N.value==="JSON"?(r(),c("div",fo,[i("label",vo,[i("span",ho,h(k(u)("datasource.fields.rawData")),1),i("textarea",{class:"ce-datasource-tool__textarea ce-datasource-tool__textarea--json","data-testid":"datasource-raw-data",spellcheck:"false",readonly:A.value,value:d.value,onInput:Vt,onKeydown:l[2]||(l[2]=Y(()=>{},["stop"]))},null,40,_o)]),m.value?(r(),c("p",bo,h(m.value),1)):L("",!0)])):(r(),c("div",go,[i("div",ko,[i("label",wo,[i("span",Co,h(k(u)("datasource.fields.domain")),1),i("input",{class:"ce-datasource-tool__input","data-testid":"datasource-domain",type:"text",readonly:A.value,value:$.domain,onInput:l[3]||(l[3]=n=>at("domain",n.target.value)),onKeydown:l[4]||(l[4]=Y(()=>{},["stop"]))},null,40,To)]),i("label",xo,[i("span",$o,h(k(u)("datasource.fields.path")),1),i("input",{class:"ce-datasource-tool__input","data-testid":"datasource-path",type:"text",readonly:A.value,value:$.path,onInput:l[5]||(l[5]=n=>at("path",n.target.value)),onKeydown:l[6]||(l[6]=Y(()=>{},["stop"]))},null,40,So)]),i("label",Eo,[i("span",No,h(k(u)("datasource.fields.method")),1),i("select",{class:"ce-datasource-tool__input","data-testid":"datasource-method",disabled:A.value,value:$.method,onChange:l[7]||(l[7]=n=>Jt(n.target.value))},[...l[26]||(l[26]=[i("option",{value:"GET"},"GET",-1),i("option",{value:"POST"},"POST",-1)])],40,Do)])]),i("details",Po,[i("summary",Io,[i("span",Ao,h(k(u)("datasource.sections.headers")),1),e.edit?(r(),c("button",{key:0,class:"ce-datasource-tool__action",type:"button","data-testid":"datasource-header-add",onClick:l[8]||(l[8]=Y(n=>ot("headerData"),["stop","prevent"]))},h(k(u)("datasource.actions.add")),1)):L("",!0)]),Ne("headerData").length?L("",!0):(r(),c("p",Mo,h(k(u)("datasource.empty")),1)),(r(!0),c(V,null,W(Ne("headerData"),(n,f)=>(r(),c("div",{key:`header-${f}`,class:"ce-datasource-tool__row"},[i("input",{class:"ce-datasource-tool__input","data-testid":`datasource-header-key-${f}`,type:"text",readonly:A.value,placeholder:k(u)("datasource.fields.key"),value:n.key,onInput:R=>De("headerData",f,"key",R.target.value),onKeydown:l[9]||(l[9]=Y(()=>{},["stop"]))},null,40,Oo),i("input",{class:"ce-datasource-tool__input","data-testid":`datasource-header-mock-${f}`,type:"text",readonly:A.value,placeholder:k(u)("datasource.fields.mock"),value:n.mock,onInput:R=>De("headerData",f,"mock",R.target.value),onKeydown:l[10]||(l[10]=Y(()=>{},["stop"]))},null,40,Bo),e.edit?(r(),c("button",{key:0,class:"ce-datasource-tool__remove",type:"button","data-testid":`datasource-header-remove-${f}`,"aria-label":k(u)("datasource.actions.remove"),onClick:R=>lt("headerData",f)},h(k(u)("datasource.actions.remove")),9,Ro)):L("",!0)]))),128))]),i("details",Lo,[i("summary",zo,[i("span",Fo,h(k(u)("datasource.sections.queries")),1),e.edit?(r(),c("button",{key:0,class:"ce-datasource-tool__action",type:"button","data-testid":"datasource-query-add",onClick:l[11]||(l[11]=Y(n=>ot("queryData"),["stop","prevent"]))},h(k(u)("datasource.actions.add")),1)):L("",!0)]),Ne("queryData").length?L("",!0):(r(),c("p",Vo,h(k(u)("datasource.empty")),1)),(r(!0),c(V,null,W(Ne("queryData"),(n,f)=>(r(),c("div",{key:`query-${f}`,class:"ce-datasource-tool__row"},[i("input",{class:"ce-datasource-tool__input","data-testid":`datasource-query-key-${f}`,type:"text",readonly:A.value,placeholder:k(u)("datasource.fields.key"),value:n.key,onInput:R=>De("queryData",f,"key",R.target.value),onKeydown:l[12]||(l[12]=Y(()=>{},["stop"]))},null,40,jo),i("input",{class:"ce-datasource-tool__input","data-testid":`datasource-query-mock-${f}`,type:"text",readonly:A.value,placeholder:k(u)("datasource.fields.mock"),value:n.mock,onInput:R=>De("queryData",f,"mock",R.target.value),onKeydown:l[13]||(l[13]=Y(()=>{},["stop"]))},null,40,Jo),e.edit?(r(),c("button",{key:0,class:"ce-datasource-tool__remove",type:"button","data-testid":`datasource-query-remove-${f}`,"aria-label":k(u)("datasource.actions.remove"),onClick:R=>lt("queryData",f)},h(k(u)("datasource.actions.remove")),9,Ho)):L("",!0)]))),128))]),i("details",qo,[i("summary",Ko,[i("span",Uo,h(k(u)("datasource.sections.body")),1),e.edit?(r(),c("button",{key:0,class:"ce-datasource-tool__action",type:"button","data-testid":"datasource-body-add",onClick:Y(Ht,["stop","prevent"])},h(k(u)("datasource.actions.add")),1)):L("",!0)]),$.bodyData.length?L("",!0):(r(),c("p",Wo,h(k(u)("datasource.empty")),1)),(r(!0),c(V,null,W($.bodyData,(n,f)=>(r(),c("div",{key:`body-${f}`,class:"ce-datasource-tool__body-row"},[i("input",{class:"ce-datasource-tool__input","data-testid":`datasource-body-key-${f}`,type:"text",readonly:A.value,placeholder:k(u)("datasource.fields.key"),value:n.key,onInput:R=>qt(f,R.target.value),onKeydown:l[14]||(l[14]=Y(()=>{},["stop"]))},null,40,Go),i("select",{class:"ce-datasource-tool__input","data-testid":`datasource-body-type-${f}`,disabled:A.value,value:n.dataType,onChange:R=>Kt(f,R.target.value)},[(r(!0),c(V,null,W(k(x),R=>(r(),c("option",{key:R,value:R},h(R),9,Yo))),128))],40,Xo),n.dataType==="boolean"?(r(),c("select",{key:0,class:"ce-datasource-tool__input","data-testid":`datasource-body-mock-${f}`,disabled:A.value,value:String(n.mock===!0),onChange:R=>Be(f,R.target.value)},[...l[27]||(l[27]=[i("option",{value:"false"},"false",-1),i("option",{value:"true"},"true",-1)])],40,Zo)):n.dataType==="null"?(r(),c("input",{key:1,class:"ce-datasource-tool__input","data-testid":`datasource-body-mock-${f}`,type:"text",readonly:"",value:"null"},null,8,Qo)):n.dataType==="object"||n.dataType==="array"?(r(),c("textarea",{key:2,class:"ce-datasource-tool__textarea ce-datasource-tool__textarea--mock","data-testid":`datasource-body-mock-${f}`,spellcheck:"false",readonly:A.value,value:G.value[f]??we(n),onInput:R=>Be(f,R.target.value),onKeydown:l[15]||(l[15]=Y(()=>{},["stop"]))},null,40,el)):(r(),c("input",{key:3,class:"ce-datasource-tool__input","data-testid":`datasource-body-mock-${f}`,type:n.dataType==="number"?"number":"text",readonly:A.value,placeholder:k(u)("datasource.fields.mock"),value:G.value[f]??we(n),onInput:R=>Be(f,R.target.value),onKeydown:l[16]||(l[16]=Y(()=>{},["stop"]))},null,40,tl)),e.edit?(r(),c("button",{key:4,class:"ce-datasource-tool__remove",type:"button","data-testid":`datasource-body-remove-${f}`,"aria-label":k(u)("datasource.actions.remove"),onClick:R=>Ut(f)},h(k(u)("datasource.actions.remove")),9,al)):L("",!0),Z.value[f]?(r(),c("p",{key:5,class:"ce-datasource-tool__body-error","data-testid":`datasource-body-error-${f}`},h(Z.value[f]),9,ol)):L("",!0)]))),128))])])),i("div",ll,[i("div",null,[i("div",nl,h(k(u)("datasource.sections.generateFields")),1),i("p",sl,h(k(u)("datasource.help.generateFields")),1)]),i("div",rl,[e.edit?(r(),c("button",{key:0,class:"ce-datasource-tool__schema-button",type:"button","data-testid":"datasource-json-schema-parse-button",disabled:z.value,onClick:Yt},h(z.value?k(u)("datasource.actions.generatingFields"):k(u)("datasource.actions.generateFields")),9,cl)):L("",!0),v.value?(r(),c("span",il,h(k(u)("datasource.fields.generatedFields"))+": "+h(oe.value.length),1)):L("",!0)]),D.value?(r(),c("p",dl,h(D.value),1)):L("",!0)]),i("div",ul,[i("div",pl,[i("div",null,[i("div",ml,h(k(u)("datasource.sections.fieldSelection")),1),i("p",yl,h(k(u)("datasource.help.fieldSelection")),1)]),v.value?(r(),c("input",{key:0,class:"ce-datasource-tool__input ce-datasource-tool__schema-search","data-testid":"datasource-schema-search",type:"search",placeholder:k(u)("datasource.fields.searchFields"),value:K.value,onInput:l[17]||(l[17]=n=>K.value=n.target.value),onKeydown:l[18]||(l[18]=Y(()=>{},["stop"]))},null,40,fl)):L("",!0)]),i("div",vl,[i("button",{type:"button",class:te(["ce-datasource-tool__tab",{"ce-datasource-tool__tab--active":j.value==="list"}]),"data-testid":"datasource-schema-tab-list",onClick:l[19]||(l[19]=n=>j.value="list")},h(k(u)("datasource.tabs.list")),3),i("button",{type:"button",class:te(["ce-datasource-tool__tab",{"ce-datasource-tool__tab--active":j.value==="form"}]),"data-testid":"datasource-schema-tab-form",onClick:l[20]||(l[20]=n=>j.value="form")},h(k(u)("datasource.tabs.form")),3),i("button",{type:"button",class:te(["ce-datasource-tool__tab",{"ce-datasource-tool__tab--active":j.value==="advanced"}]),"data-testid":"datasource-schema-tab-advanced",onClick:l[21]||(l[21]=n=>j.value="advanced")},h(k(u)("datasource.tabs.advanced")),3)]),j.value==="list"?(r(),c("div",hl,[v.value?le.value.length?(r(),c("label",bl,[i("span",gl,h(k(u)("datasource.fields.recordPath")),1),i("select",{class:"ce-datasource-tool__input","data-testid":"datasource-list-record-path",disabled:A.value,value:ce.value,onChange:l[22]||(l[22]=n=>Xt(n.target.value))},[(r(!0),c(V,null,W(le.value,n=>(r(),c("option",{key:n.path||"root",value:n.path},h(t(n.path)),9,wl))),128))],40,kl)])):(r(),c("p",Cl,h(k(u)("datasource.noListRecord")),1)):(r(),c("p",_l,h(k(u)("datasource.emptySchema")),1)),ee.value.length?(r(),c("div",Tl,[i("div",xl,h(k(u)("datasource.fields.selectedFields"))+": "+h(ne.value),1),(r(!0),c(V,null,W(ee.value,n=>(r(),c("label",{key:n.path,class:"ce-datasource-tool__schema-field","data-testid":`datasource-list-field-${n.path}`},[i("input",{class:"ce-datasource-tool__checkbox",type:"checkbox",disabled:A.value,checked:n.enabled,"data-testid":`datasource-list-field-enabled-${n.path}`,onChange:f=>rt("list",n.path,f.target.checked)},null,40,Sl),i("span",El,[i("input",{class:"ce-datasource-tool__input ce-datasource-tool__field-label-input",type:"text",readonly:A.value,value:n.label,"data-testid":`datasource-list-field-label-${n.path}`,onInput:f=>st("list",n.path,f.target.value),onKeydown:l[23]||(l[23]=Y(()=>{},["stop"]))},null,40,Nl),i("span",Dl,h(n.path),1)]),i("span",Pl,[i("span",Il,h(S(n.type)),1),i("span",Al,h(T(n.componentHint)),1),n.required?(r(),c("span",Ml,h(k(u)("datasource.fields.required")),1)):L("",!0)])],8,$l))),128))])):L("",!0)])):j.value==="form"?(r(),c("div",Ol,[Q.value.length?(r(),c("div",Bl,[i("div",Rl,h(k(u)("datasource.fields.selectedFields"))+": "+h(ue.value),1),(r(!0),c(V,null,W(Q.value,n=>(r(),c("label",{key:n.path,class:"ce-datasource-tool__schema-field","data-testid":`datasource-form-field-${n.path}`},[i("input",{class:"ce-datasource-tool__checkbox",type:"checkbox",disabled:A.value,checked:n.enabled,"data-testid":`datasource-form-field-enabled-${n.path}`,onChange:f=>rt("form",n.path,f.target.checked)},null,40,zl),i("span",Fl,[i("input",{class:"ce-datasource-tool__input ce-datasource-tool__field-label-input",type:"text",readonly:A.value,value:n.label,"data-testid":`datasource-form-field-label-${n.path}`,onInput:f=>st("form",n.path,f.target.value),onKeydown:l[24]||(l[24]=Y(()=>{},["stop"]))},null,40,Vl),i("span",jl,h(n.path),1)]),i("span",Jl,[i("span",Hl,h(S(n.type)),1),i("span",ql,h(T(n.componentHint)),1),n.required?(r(),c("span",Kl,h(k(u)("datasource.fields.required")),1)):L("",!0)])],8,Ll))),128))])):(r(),c("p",Ul,h(k(u)("datasource.noFormFields")),1))])):(r(),c("div",Wl,[v.value?(r(),c("div",Gl,[(r(!0),c(V,null,W(q.value,n=>(r(),c("div",{key:n.path||"root",class:"ce-datasource-tool__schema-node",style:pe({paddingLeft:`${n.depth*18}px`}),"data-testid":`datasource-schema-node-${p(n.path)}`},[i("span",Yl,h(n.name),1),i("span",Zl,h(n.displayPath),1),i("span",Ql,h(S(n.type)),1),n.required?(r(),c("span",en,h(k(u)("datasource.fields.required")),1)):L("",!0)],12,Xl))),128))])):L("",!0),i("label",tn,[i("span",an,h(k(u)("datasource.fields.jsonSchema")),1),i("textarea",{class:"ce-datasource-tool__textarea ce-datasource-tool__textarea--schema","data-testid":"datasource-json-schema",spellcheck:"false",readonly:A.value,value:w.value,onInput:jt,onKeydown:l[25]||(l[25]=Y(()=>{},["stop"]))},null,40,on)])]))])]))}}),wt=Se(nn,[["__scopeId","data-v-b51983e4"]]);function sn(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID().slice(0,10):Math.random().toString(36).slice(2,12)}function rn(e){return JSON.parse(JSON.stringify(e))}function Pt(e){return typeof e!="object"||e===null||Array.isArray(e)?{}:rn(e)}function _e(e){if(typeof e!="object"||e===null||Array.isArray(e))return;const a=e;if(!(typeof a.type!="string"||typeof a.data!="object"||a.data===null||Array.isArray(a.data)))return{id:typeof a.id=="string"&&a.id?a.id:sn(),type:a.type,data:Pt(a.data)}}function Te(e){return{id:e.id,type:e.type,data:Pt(e.data)}}const It=ke({toolbox:{get title(){return P.t("editorSelector.toolboxTitle")},icon:'<svg width="18" height="18" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><rect x="4" y="5" width="16" height="14" rx="2" fill="none" stroke="currentColor" stroke-width="2"/><path d="M8 9h8M8 13h5" stroke="currentColor" stroke-width="2" stroke-linecap="round"/><path d="M16 15l2 2 3-4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>'},createInitialProps:()=>({value:void 0}),normalizeProps:e=>({edit:e.edit??!1,value:_e(e.value),excludeToolNames:Array.isArray(e.excludeToolNames)?e.excludeToolNames.filter(a=>typeof a=="string"):[]}),serialize:e=>{const a=_e(e.value);return a?{value:a}:{}}}),cn=["innerHTML"],dn={key:1,class:"overflow-auto"},un={key:3,class:"overflow-auto rounded bg-slate-100 p-2 text-xs dark:bg-slate-800"},Me=ge({__name:"EditorPreviewBlock",props:{block:{},compactTable:{type:Boolean,default:!1}},setup(e){const a=e,u=U(()=>a.compactTable?"min-w-full border-collapse text-xs":"min-w-full border-collapse text-sm"),_=U(()=>a.compactTable?"border border-slate-200 px-2 py-1 text-left align-top dark:border-slate-700":"border border-slate-200 px-3 py-2 text-left align-top dark:border-slate-700");function x(v){const w=v.data.content;return Array.isArray(w)?w.filter(D=>Array.isArray(D)):[]}function N(v,w){const D=v.data.withHeadings;return w===0&&D===!0}function O(v){return An(v)}function d(v){const w=Oe(v);return(w==null?void 0:w.component)??null}function m(v){var D;const w=Oe(v.type);return w?{...w.normalizeProps({...((D=w.createInitialProps)==null?void 0:D.call(w))??{},...v.data,edit:!1})}:{edit:!1,...v.data}}return(v,w)=>e.block.type==="paragraph"?(r(),c("p",{key:0,class:"text-sm leading-6",innerHTML:e.block.data.text},null,8,cn)):e.block.type==="table"?(r(),c("div",dn,[i("table",{class:te(u.value)},[i("tbody",null,[(r(!0),c(V,null,W(x(e.block),(D,z)=>(r(),c("tr",{key:`table-${z}`,class:"border-b border-slate-200 dark:border-slate-700"},[(r(!0),c(V,null,W(D,(B,j)=>(r(),be(Ie(N(e.block,z)?"th":"td"),{key:`table-${z}-${j}`,class:te(_.value),innerHTML:B},null,8,["class","innerHTML"]))),128))]))),128))])],2)])):O(e.block.type)?(r(),be(Ie(d(e.block.type)),ba(Qe({key:2},m(e.block))),null,16)):(r(),c("pre",un,h(e.block),1))}}),pn={key:1,class:"ce-editor-selector-tool__preview","data-testid":"preview-editor-selector-value"},mn=ge({__name:"MEditorSelector",props:{edit:{type:Boolean,default:!1},value:{default:void 0},excludeToolNames:{},onChange:{},onToolChange:{}},setup(e){const a="MEditorSelector",u=new Set(["paragraph","table","columns"]),_=e,{t:x,localeValue:N}=xe(),O=X(null),d=X(null),m=X(_e(_.value)),v=U(()=>m.value!==void 0);let w=null,D=!1,z=null,B=null,j=null,K=$(m.value);function $(t){return{blocks:t?[Te(t)]:[]}}function G(t){return t?JSON.stringify(t):""}function Z(){const t=new Set([a]);return(_.excludeToolNames??[]).forEach(s=>{t.add(s)}),t}function A(t){return!Z().has(t)&&!u.has(t)&&!!Oe(t)}function ae(t){if(A(t.type))return _e(t)}function oe(t){const b=(Array.isArray(t.blocks)?t.blocks:[]).map(E=>ae(E)).filter(E=>E!==void 0);return b[b.length-1]}function le(t,s){const b=Array.isArray(t.blocks)?t.blocks:[];return s?b.length!==1?!0:G(ae(b[0]))!==G(s):b.some(E=>A(E.type))}function I(t){var b,E;const s={edit:_.edit,value:t?Te(t):void 0};(b=_.onToolChange)==null||b.call(_,s),(E=_.onChange)==null||E.call(_,s)}async function J(t){const s=w;if(s){D=!0,K=$(t);try{await s.blocks.render(K)}finally{await ve(),D=!1}}}async function q(t){if(D)return;const s=oe(t),b=G(m.value),E=G(s);m.value=s?Te(s):void 0,K=$(m.value),b!==E&&I(m.value),le(t,m.value)&&await J(m.value)}function ee(){B!==null&&(window.clearTimeout(B),B=null)}function Q(){!w||D||(ee(),B=window.setTimeout(async()=>{if(B=null,!(!w||D))try{const t=await w.save();await q(t)}catch{}},0))}function ce(){const t=d.value;t&&(ne(),z=new MutationObserver(()=>{Q()}),z.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),t.addEventListener("input",Q),t.addEventListener("change",Q),t.addEventListener("click",Q))}function ne(){const t=d.value;z==null||z.disconnect(),z=null,ee(),t==null||t.removeEventListener("input",Q),t==null||t.removeEventListener("change",Q),t==null||t.removeEventListener("click",Q)}function ue(t){return t.querySelector(".codex-editor > .ce-toolbar")}function g(t){return t.closest('[data-testid="editor-form-tool"]')??t.closest('[data-testid="editor-panel"]')??document}function C(){const t=O.value;t&&g(t).querySelectorAll(".ce-editor-selector-tool").forEach(s=>{if(s===t)return;const b=ue(s);b==null||b.classList.remove("ce-toolbar--opened")})}function S(){O.value&&C()}function T(){j!==null&&(window.clearTimeout(j),j=null)}function se(){T(),j=window.setTimeout(()=>{j=null,S()},0)}async function re(){if(!_.edit||!d.value||w)return;K=$(m.value);const t=Rt({edit:!0},{exclude:Z()});w=new He({holder:d.value,placeholder:x("editorSelector.placeholder"),tools:t,data:K,minHeight:0,i18n:{messages:Et(N.value)},onChange:async()=>{if(!w)return;const s=await w.save();await q(s)}}),ce()}async function y(){const t=w;if(t){w=null,ne();try{const s=await t.save();m.value=oe(s),K=$(m.value)}catch{K=$(m.value)}t.destroy()}}async function p(){await y(),await ve(),await re()}return Ye(async()=>{await re()}),ie(()=>_.value,async t=>{const s=_e(t);G(s)!==G(m.value)&&(m.value=s,K=$(s),w&&await J(s))},{deep:!0}),ie(()=>_.edit,async t=>{if(t){await ve(),await re();return}await y()}),ie(N,async()=>{w&&await p()}),ie(()=>_.excludeToolNames,async()=>{w&&await p()},{deep:!0}),Ze(async()=>{T(),await y()}),(t,s)=>(r(),c("div",{ref_key:"rootRef",ref:O,class:te(["ce-editor-selector-tool",{"ce-editor-selector-tool--filled":v.value}]),"data-testid":"editor-selector-tool",onMouseenter:se,onMousemove:se},[e.edit?(r(),c("div",{key:0,class:te(["ce-editor-selector-tool__editor-shell",{"ce-editor-selector-tool__editor-shell--filled":v.value}]),"data-testid":"editor-selector-shell"},[i("div",{ref_key:"holderRef",ref:d,class:"ce-editor-selector-tool__editor","data-testid":"editor-selector-surface"},null,512)],2)):(r(),c("div",pn,[m.value?(r(),be(Me,{key:0,block:m.value},null,8,["block"])):L("",!0)]))],34))}}),At=Se(mn,[["__scopeId","data-v-865609b6"]]),yn=Object.freeze(Object.defineProperty({__proto__:null,default:At,mEditorSelectorEditorTool:It},Symbol.toStringTag,{value:"Module"})),fn={key:0,class:"ce-form-item-tool__edit-shell","data-testid":"form-item-edit-shell"},vn={class:"ce-form-item-tool__body"},hn={class:"ce-form-item-tool__label","data-testid":"form-item-label-preview"},_n={class:"ce-form-item-tool__editor","data-testid":"form-item-editor-field"},bn={key:1,class:"ce-form-item-tool__body"},gn={class:"ce-form-item-tool__label","data-testid":"preview-form-item-label"},kn={class:"ce-form-item-tool__editor","data-testid":"preview-form-item-editor"},wn={key:1,class:"ce-form-item-tool__empty"};function Mt(){return`field_${typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID().slice(0,8):Math.random().toString(36).slice(2,10)}`}function Ot(){return P.t("formItem.defaultLabelName")}function Xe(e){return e==="Horizontal"?"Horizontal":"Vertical"}function Cn(e){return typeof e=="string"&&e.trim()?e:Ot()}function Tn(e,a){return typeof e=="string"&&e.trim()?e.trim():a||Mt()}function xn(e){return e?Te(e):void 0}function $e(e,a){return{edit:e.edit??!1,labelName:Cn(e.labelName),variableName:Tn(e.variableName,a),editor:_e(e.editor),layout:Xe(e.layout)}}function $n(e){const a=$e(e);return{labelName:a.labelName,variableName:a.variableName,...a.editor?{editor:Te(a.editor)}:{},layout:a.layout}}const Sn=ke({toolbox:{get title(){return P.t("formItem.toolboxTitle")},icon:'<svg width="18" height="18" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><rect x="4" y="5" width="16" height="14" rx="2" fill="none" stroke="currentColor" stroke-width="2"/><path d="M8 9h8M8 13h3" stroke="currentColor" stroke-width="2" stroke-linecap="round"/><circle cx="16" cy="13" r="2" fill="none" stroke="currentColor" stroke-width="2"/></svg>'},propertyPanel:{get title(){return P.t("formItem.propertyPanelTitle")},get fields(){return[{key:"labelName",label:P.t("formItem.properties.labelName"),placeholder:P.t("formItem.placeholders.labelName")},{key:"variableName",label:P.t("formItem.properties.variableName"),placeholder:P.t("formItem.placeholders.variableName")},{key:"layout",label:P.t("formItem.properties.layout"),type:"select",options:[{label:P.t("formItem.layouts.vertical"),value:"Vertical"},{label:P.t("formItem.layouts.horizontal"),value:"Horizontal"}]}]}},createInitialProps:()=>({labelName:Ot(),variableName:Mt(),editor:void 0,layout:"Vertical"}),normalizeProps:e=>$e(e),serialize:$n}),En=ge({__name:"MFormItem",props:{edit:{type:Boolean,default:!1},labelName:{},variableName:{},editor:{default:void 0},layout:{default:"Vertical"},onChange:{},onToolChange:{}},setup(e){const a=e,{t:u}=xe(),_=["MFormItem","MForm"],x=St($e(a));function N(){var v,w;const m={edit:a.edit,labelName:x.labelName,variableName:x.variableName,editor:xn(x.editor),layout:Xe(x.layout)};(v=a.onToolChange)==null||v.call(a,m),(w=a.onChange)==null||w.call(a,m)}function O(m){m.labelName!==void 0&&(x.labelName=m.labelName),m.variableName!==void 0&&(x.variableName=m.variableName),"editor"in m&&(x.editor=_e(m.editor)),m.layout!==void 0&&(x.layout=Xe(m.layout)),N()}function d(m){O({editor:m.value})}return ie(()=>({labelName:a.labelName,variableName:a.variableName,editor:a.editor,layout:a.layout,edit:a.edit}),m=>{Object.assign(x,$e(m,x.variableName))},{deep:!0}),(m,v)=>(r(),c("div",{class:te(["ce-form-item-tool",{"ce-form-item-tool--edit":e.edit,"ce-form-item-tool--horizontal":x.layout==="Horizontal"}]),"data-testid":"editor-form-item-tool"},[e.edit?(r(),c("div",fn,[i("div",vn,[i("div",hn,h(x.labelName),1),i("div",_n,[Nt(At,{edit:!0,value:x.editor,"exclude-tool-names":_,"on-change":d},null,8,["value"])])])])):(r(),c("div",bn,[i("div",gn,h(x.labelName),1),i("div",kn,[x.editor?(r(),be(Me,{key:0,block:x.editor},null,8,["block"])):(r(),c("span",wn,h(k(u)("formItem.emptyEditor")),1))])]))],2))}}),Ct=Se(En,[["__scopeId","data-v-e6b491c3"]]);function Nn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Bt(e){const a=$e({...e,edit:!1});return{labelName:a.labelName,variableName:a.variableName,...a.editor?{editor:Te(a.editor)}:{},layout:a.layout}}function Dn(e){if(Nn(e))return Bt(e)}function Tt(e){return Array.isArray(e)?e.map(a=>Dn(a)).filter(a=>a!==void 0):[]}const Pn=ke({toolbox:{get title(){return P.t("form.toolboxTitle")},icon:'<svg width="18" height="18" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><rect x="4" y="4" width="16" height="16" rx="2" fill="none" stroke="currentColor" stroke-width="2"/><path d="M8 8h8M8 12h8M8 16h4" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>'},createInitialProps:()=>({items:[]}),normalizeProps:e=>({edit:e.edit??!1,items:Tt(e.items)}),serialize:e=>({items:Tt(e.items).map(a=>Bt(a))})}),In=ke({toolbox:{get title(){return P.t("page.toolboxTitle")},icon:'<svg width="18" height="18" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><rect x="4" y="3" width="16" height="18" rx="2" ry="2" fill="none" stroke="currentColor" stroke-width="2"/><path d="M8 8h8M8 12h8M8 16h5" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>'},createInitialProps:()=>({edit:!1,value:[]}),normalizeProps:e=>({edit:e.edit??!1,value:Array.isArray(e.value)?e.value:[]}),serialize:e=>({value:e.value})});function ye(e){const a=e.name||e.__name;if(!a)throw new Error("Editor component is missing both name and __name.");return a}const et={MPage:{component:de(Ve(()=>je(()=>import("./MPage-BkuklFgX.js"),__vite__mapDeps([0,1,2,3])))),...In},MEditorSelector:{component:de(Ve(()=>je(()=>Promise.resolve().then(()=>yn),void 0))),...It},MForm:{component:de(Ve(()=>je(()=>import("./MForm-icLQ2kKk.js"),__vite__mapDeps([4,2,1,3,5])))),...Pn},[ye(bt)]:{component:de(bt),...wa},[ye(_t)]:{component:de(_t),...ka},[ye(gt)]:{component:de(gt),...Fa},[ye(kt)]:{component:de(kt),...lo},[ye(wt)]:{component:de(wt),...ln},[ye(Ct)]:{component:de(Ct),...Sn},[ye(ht)]:{component:de(ht),...ga}};function Oe(e){return et[e]}function An(e){return e in et}function Mn(){return et}const xt=new Map;class On{static create(a){const u=xt.get(a);if(u)return u;const _=Oe(a);if(!_)throw new Error(`EditorToolFactory could not find a registered component for "${a}".`);class x{constructor({data:d,config:m}){Ce(this,"state");Ce(this,"wrapper",null);Ce(this,"contentRoot",null);Ce(this,"vueApp",null);Ce(this,"propertyDialog",null);const v={...m??{},...d??{}};if(typeof v.edit!="boolean")throw new Error(`EditorToolFactory requires config.edit to be explicitly set for "${a}".`);this.state=_.normalizeProps({...v})}static get toolbox(){return _.toolbox}render(){const d=document.createElement("div");d.className="mokelay-editor-tool",d.dataset.toolName=a,d.dataset.testid=`editor-tool-${a}`;const m=document.createElement("div");return m.className="mokelay-editor-tool__content",m.dataset.testid=`editor-tool-content-${a}`,d.appendChild(m),this.wrapper=d,this.contentRoot=m,this.createPropertyDialog(),this.mountVueApp(),d}destroy(){var d;this.unmountVueApp(),(d=this.propertyDialog)==null||d.remove(),this.propertyDialog=null,this.contentRoot=null,this.wrapper=null}save(){return _.serialize(this.state)}renderSettings(){var d;return(d=_.propertyPanel)!=null&&d.fields.length?{icon:'<svg width="17" height="17" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M19.14 12.94C19.18 12.63 19.2 12.32 19.2 12C19.2 11.68 19.18 11.36 19.13 11.06L21.11 9.51C21.29 9.37 21.34 9.11 21.23 8.9L19.35 5.64C19.24 5.43 18.99 5.35 18.77 5.42L16.44 6.17C15.96 5.8 15.44 5.48 14.87 5.23L14.51 2.75C14.48 2.52 14.28 2.35 14.04 2.35H10.28C10.04 2.35 9.84 2.52 9.81 2.75L9.45 5.23C8.88 5.48 8.36 5.81 7.88 6.17L5.55 5.42C5.33 5.35 5.08 5.43 4.97 5.64L3.09 8.9C2.98 9.11 3.03 9.37 3.21 9.51L5.19 11.06C5.14 11.36 5.12 11.68 5.12 12C5.12 12.32 5.14 12.64 5.19 12.94L3.21 14.49C3.03 14.63 2.98 14.89 3.09 15.1L4.97 18.36C5.08 18.57 5.33 18.65 5.55 18.58L7.88 17.83C8.36 18.2 8.88 18.52 9.45 18.77L9.81 21.25C9.84 21.48 10.04 21.65 10.28 21.65H14.04C14.28 21.65 14.48 21.48 14.51 21.25L14.87 18.77C15.44 18.52 15.96 18.19 16.44 17.83L18.77 18.58C18.99 18.65 19.24 18.57 19.35 18.36L21.23 15.1C21.34 14.89 21.29 14.63 21.11 14.49L19.14 12.94ZM12.16 15.6C10.17 15.6 8.56 13.99 8.56 12C8.56 10.01 10.17 8.4 12.16 8.4C14.15 8.4 15.76 10.01 15.76 12C15.76 13.99 14.15 15.6 12.16 15.6Z" fill="currentColor"/></svg>',title:P.t("editor.properties"),onActivate:()=>{this.openPropertyDialog()},closeOnActivate:!0}:[]}mountVueApp(){this.contentRoot&&(this.unmountVueApp(),this.vueApp=qe(_.component,{...this.state,onToolChange:d=>{Object.assign(this.state,d)},onChange:d=>{Object.assign(this.state,d)}}),this.vueApp.mount(this.contentRoot))}unmountVueApp(){var d;(d=this.vueApp)==null||d.unmount(),this.vueApp=null}createPropertyDialog(){var w;if(!this.wrapper||!((w=_.propertyPanel)!=null&&w.fields.length))return;const d=document.createElement("dialog");d.className="mokelay-editor-tool__property-dialog",d.dataset.testid="tool-property-dialog",d.dataset.toolName=a;const m=_.propertyPanel.title||P.t("editor.propertyDialogTitle"),v=_.propertyPanel.fields.map(D=>this.renderPropertyField(D)).join("");d.innerHTML=`
3
3
  <form method="dialog" class="mokelay-editor-tool__property-panel" data-testid="tool-property-panel">
4
4
  <div class="mokelay-editor-tool__property-header">
5
5
  <h3 class="mokelay-editor-tool__property-title" data-testid="tool-property-title">${this.escapeHtml(m)}</h3>
package/index.html CHANGED
@@ -8,7 +8,7 @@
8
8
  <link rel="icon" href="/icons/icon-192.svg" type="image/svg+xml" />
9
9
  <link rel="apple-touch-icon" href="/icons/icon-192.svg" />
10
10
  <title>Mokelay Editor</title>
11
- <script type="module" crossorigin src="/assets/index-C0VPLP4t.js"></script>
11
+ <script type="module" crossorigin src="/assets/index-DP9Xxuqs.js"></script>
12
12
  <link rel="modulepreload" crossorigin href="/assets/editorjs-hCuh8vdW.js">
13
13
  <link rel="stylesheet" crossorigin href="/assets/index-qSOXU8wC.css">
14
14
  </head>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mokelay-editor",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "type": "module",
5
5
  "private": false
6
6
  }
@@ -1 +0,0 @@
1
- import{_ as o}from"./storage-tTDw43ui.js";import"./editorjs-hCuh8vdW.js";import"./index-C0VPLP4t.js";export{o as default};