vdc-editor 0.1.230 → 0.1.231
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.
- package/lib/{BulkSpellChecker-B4ZEj8Jb.mjs → BulkSpellChecker-Mgu-ubfm.mjs} +2 -2
- package/lib/{BulkSpellChecker-B4ZEj8Jb.mjs.map → BulkSpellChecker-Mgu-ubfm.mjs.map} +1 -1
- package/lib/{index-DzlnAZEP.mjs → index-u95GwyGE.mjs} +10 -8
- package/lib/{index-DzlnAZEP.mjs.map → index-u95GwyGE.mjs.map} +1 -1
- package/lib/style.css +1 -1
- package/lib/vdc-editor.mjs +1 -1
- package/lib/vdc-editor.umd.js +2 -2
- package/lib/vdc-editor.umd.js.map +1 -1
- package/package.json +1 -1
package/lib/vdc-editor.umd.js
CHANGED
|
@@ -327,7 +327,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`),te=D,J=j),Y===void 0&&
|
|
|
327
327
|
3. "-" cannot repeat`);qt.customSchemes.push([t,e])}function DW(){qt.scanner=AW(qt.customSchemes);for(let t=0;t<qt.tokenQueue.length;t++)qt.tokenQueue[t][1]({scanner:qt.scanner});qt.parser=BW(qt.scanner.tokens);for(let t=0;t<qt.pluginQueue.length;t++)qt.pluginQueue[t][1]({scanner:qt.scanner,parser:qt.parser});return qt.initialized=!0,qt}function $g(t){return qt.initialized||DW(),IW(qt.parser.start,t,C8(qt.scanner.start,t))}$g.scan=C8;function A8(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new Vg(n),i=$g(t),s=[];for(let a=0;a<i.length;a++){const l=i[a];l.isLink&&(!e||l.t===e)&&r.check(l)&&s.push(l.toFormattedObject(r))}return s}function VW(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function FW(t){return new tt({key:new kt("autolink"),appendTransaction:(e,n,r)=>{const i=e.some(c=>c.docChanged)&&!n.doc.eq(r.doc),s=e.some(c=>c.getMeta("preventAutolink"));if(!i||s)return;const{tr:a}=r,l=TM(n.doc,[...e]);if(BM(l).forEach(({newRange:c})=>{const f=d4(r.doc,c,g=>g.isTextblock);let p,m;if(f.length>1?(p=f[0],m=r.doc.textBetween(p.pos,p.pos+p.node.nodeSize,void 0," ")):f.length&&r.doc.textBetween(c.from,c.to," "," ").endsWith(" ")&&(p=f[0],m=r.doc.textBetween(p.pos,c.to,void 0," ")),p&&m){const g=m.split(" ").filter(C=>C!=="");if(g.length<=0)return!1;const b=g[g.length-1],v=p.pos+m.lastIndexOf(b);if(!b)return!1;const w=$g(b).map(C=>C.toObject(t.defaultProtocol));if(!VW(w))return!1;w.filter(C=>C.isLink).map(C=>({...C,from:v+C.start+1,to:v+C.end+1})).filter(C=>r.schema.marks.code?!r.doc.rangeHasMark(C.from,C.to,r.schema.marks.code):!0).filter(C=>t.validate(C.value)).filter(C=>t.shouldAutoLink(C.value)).forEach(C=>{n0(C.from,C.to,r.doc).some(E=>E.mark.type===t.type)||a.addMark(C.from,C.to,t.type.create({href:C.href}))})}}),!!a.steps.length)return a}})}function $W(t){return new tt({key:new kt("handleClickLink"),props:{handleClick:(e,n,r)=>{var i,s;if(r.button!==0||!e.editable)return!1;let a=r.target;const l=[];for(;a.nodeName!=="DIV";)l.push(a),a=a.parentNode;if(!l.find(m=>m.nodeName==="A"))return!1;const u=h4(e.state,t.type.name),c=r.target,f=(i=c==null?void 0:c.href)!==null&&i!==void 0?i:u.href,p=(s=c==null?void 0:c.target)!==null&&s!==void 0?s:u.target;return c&&f?(window.open(f,p),!0):!1}}})}function HW(t){return new tt({key:new kt("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{state:i}=e,{selection:s}=i,{empty:a}=s;if(a)return!1;let l="";r.content.forEach(c=>{l+=c.textContent});const u=A8(l,{defaultProtocol:t.defaultProtocol}).find(c=>c.isLink&&c.value===l);return!l||!u?!1:t.editor.commands.setMark(t.type,{href:u.href})}}})}const zW=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function aa(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const i=typeof r=="string"?r:r.scheme;i&&n.push(i)}),!t||t.replace(zW,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const UW=Dn.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){T8(t);return}T8(t.scheme,t.optionalSlashes)})},onDestroy(){PW()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!aa(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>!!t}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!aa(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!aa(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",vt(this.options.HTMLAttributes,t),0]:["a",vt(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!aa(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!aa(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Ui({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:r}=this.options,i=A8(t).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:a=>!!aa(a,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(s=>e.push({text:s.value,data:{href:s.href},index:s.start}))}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(FW({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!aa(i,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&t.push($W({type:this.type})),this.options.linkOnPaste&&t.push(HW({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}}),WW={class:"flex w-full max-w-sm items-center gap-1.5"},jW={class:"relative w-full max-w-sm items-center"},qW={class:"flex w-full max-w-sm items-center gap-1.5"},KW={class:"relative w-full max-w-sm items-center"},GW={class:"absolute start-0 inset-y-0 flex items-center justify-center px-2"},M8=o.defineComponent({__name:"LinkEditBlock",props:{editor:{}},emits:["onSetLink","onClickOutside"],setup(t,{emit:e}){const n=t,r=e,{t:i}=Ot();let s=o.reactive({text:"",link:""});const a=o.ref(null),{focused:l}=ct.useFocus(a),u=o.ref(!0),c=o.ref(null);ct.onClickOutside(c,m=>r("onClickOutside",m)),o.watchEffect(()=>{const{href:m,target:g}=n.editor.getAttributes("link"),{from:b,to:v}=n.editor.state.selection,w=n.editor.state.doc.textBetween(b,v," ");s={link:m,text:w}});function f(){const m=p(s.link);r("onSetLink",m,s.text,u.value)}function p(m){if(!m)return m;const g=m.trim();return/^https?:\/\//i.test(g)||/^[a-zA-Z][a-zA-Z0-9+.\-]*:/i.test(g)?g:"http://"+g}return o.onMounted(()=>{l.value=!0}),(m,g)=>(o.openBlock(),o.createElementBlock("div",{ref_key:"target",ref:c,class:"p-2 bg-white rounded-lg dark:bg-black shadow-sm border border-neutral-200 dark:border-neutral-800"},[o.createElementVNode("form",{class:"flex flex-col gap-2",onSubmit:o.withModifiers(f,["prevent"])},[o.createVNode(o.unref(Ef),null,{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(i)("editor.link.dialog.text")),1)]),_:1}),o.createElementVNode("div",WW,[o.createElementVNode("div",jW,[o.createVNode(o.unref(fl),{modelValue:o.unref(s).text,"onUpdate:modelValue":g[0]||(g[0]=b=>o.unref(s).text=b),type:"text",required:"",placeholder:"텍스트"},null,8,["modelValue"])])]),o.createVNode(o.unref(Ef),null,{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(i)("editor.link.dialog.link")),1)]),_:1}),o.createElementVNode("div",qW,[o.createElementVNode("div",KW,[o.createVNode(o.unref(fl),{ref_key:"inputRef",ref:a,modelValue:o.unref(s).link,"onUpdate:modelValue":g[1]||(g[1]=b=>o.unref(s).link=b),type:"text",required:"",class:"pl-10"},null,8,["modelValue"]),o.createElementVNode("span",GW,[o.createVNode(o.unref(Tt),{class:"size-5 text-ed-muted-foreground",name:"Link"})])])]),o.createVNode(o.unref(wn),{class:"mt-2 self-end"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(i)("editor.link.dialog.button.apply")),1)]),_:1})],32)],512))}}),XW=o.defineComponent({__name:"LinkEditPopover",props:{editor:{},icon:{default:void 0},title:{default:void 0},tooltip:{default:void 0},disabled:{type:Boolean,default:!1},shortcutKeys:{default:void 0},isActive:{type:Function,default:void 0},action:{type:Function,default:void 0}},setup(t){const e=t;function n(r,i,s){e.action&&e.action({link:r,text:i,openInNewTab:s})}return(r,i)=>(o.openBlock(),o.createBlock(o.unref(Ns),null,{default:o.withCtx(({open:s})=>[o.createVNode(o.unref(pl),{disabled:r.disabled},{default:o.withCtx(()=>[o.createVNode(Ke,{icon:r.icon,tooltip:r.tooltip,"is-active":r.isActive,"is-pressed":s,disabled:r.disabled},null,8,["icon","tooltip","is-active","is-pressed","disabled"])]),_:2},1032,["disabled"]),o.createVNode(o.unref(ea),{"as-child":"",class:"w-80",align:"start",side:"bottom"},{default:o.withCtx(()=>[o.createVNode(M8,{editor:r.editor,onOnSetLink:n},null,8,["editor"])]),_:1})]),_:1}))}}),Hg=UW.extend({inclusive:!1,parseHTML(){return[{tag:'a[href]:not([data-type="button"]):not([href *= "javascript:" i])'}]},renderHTML({HTMLAttributes:t}){return["a",vt(this.options.HTMLAttributes,t,{class:"link"}),0]},addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),openOnClick:!0,button:({editor:e,t:n})=>({component:XW,componentProps:{action:r=>{const{link:i,text:s,openInNewTab:a}=r;e.chain().extendMarkRange("link").insertContent({type:"text",text:s,marks:[{type:"link",attrs:{href:i,target:a?"_blank":""}}]}).setLink({href:i}).focus().run()},isActive:()=>e.isActive("link")||!1,disabled:!e.can().setLink({href:""}),icon:"Link",tooltip:n("editor.link.tooltip")}})}},addProseMirrorPlugins(){return[new tt({props:{handleClick:(t,e)=>{const{schema:n,doc:r,tr:i}=t.state,s=wd(r.resolve(e),n.marks.link);if(!s)return!1;const a=r.resolve(s.from),l=r.resolve(s.to),u=i.setSelection(new Ae(a,l));t.dispatch(u)}}})]}}),YW=It.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",vt(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{const{selection:n}=e,{$from:r,$to:i}=n,s=t();return r.parentOffset===0?s.insertContentAt({from:Math.max(r.pos-1,0),to:i.pos},{type:this.name}):m4(n)?s.insertContentAt(i.pos,{type:this.name}):s.insertContent({type:this.name}),s.command(({tr:a,dispatch:l})=>{var u;if(l){const{$to:c}=a.selection,f=c.end();if(c.nodeAfter)c.nodeAfter.isTextblock?a.setSelection(Ae.create(a.doc,c.pos+1)):c.nodeAfter.isBlock?a.setSelection(Pe.create(a.doc,c.pos)):a.setSelection(Ae.create(a.doc,c.pos));else{const p=(u=c.parent.type.contentMatch.defaultType)===null||u===void 0?void 0:u.create();p&&(a.insert(f,p),a.setSelection(Ae.create(a.doc,f+1)))}a.scrollIntoView()}return!0}).run()}}},addInputRules(){return[v4({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}).extend({renderHTML(){return["div",vt(this.options.HTMLAttributes,{"data-type":this.name}),["hr"]]},addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:n})=>({component:Ke,componentProps:{action:()=>e.commands.setHorizontalRule(),disabled:!e.can().setHorizontalRule(),icon:"Minus",shortcutKeys:["mod","alt","S"],tooltip:n("editor.horizontalrule.tooltip")}})}},addKeyboardShortcuts(){return{"Mod-Alt-s":()=>this.editor.commands.setHorizontalRule()}}});var gp=200,xn=function(){};xn.prototype.append=function(e){return e.length?(e=xn.from(e),!this.length&&e||e.length<gp&&this.leafAppend(e)||this.length<gp&&e.leafPrepend(this)||this.appendInner(e)):this},xn.prototype.prepend=function(e){return e.length?xn.from(e).append(this):this},xn.prototype.appendInner=function(e){return new JW(this,e)},xn.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?xn.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))},xn.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},xn.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)},xn.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(s,a){return i.push(e(s,a))},n,r),i},xn.from=function(e){return e instanceof xn?e:e&&e.length?new O8(e):xn.empty};var O8=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,s){return i==0&&s==this.length?this:new e(this.values.slice(i,s))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,s,a,l){for(var u=s;u<a;u++)if(i(this.values[u],l+u)===!1)return!1},e.prototype.forEachInvertedInner=function(i,s,a,l){for(var u=s-1;u>=a;u--)if(i(this.values[u],l+u)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=gp)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=gp)return new e(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(xn);xn.empty=new O8([]);var JW=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,s,a){var l=this.left.length;if(i<l&&this.left.forEachInner(r,i,Math.min(s,l),a)===!1||s>l&&this.right.forEachInner(r,Math.max(i-l,0),Math.min(this.length,s)-l,a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,s,a){var l=this.left.length;if(i>l&&this.right.forEachInvertedInner(r,i-l,Math.max(s,l)-l,a+l)===!1||s<l&&this.left.forEachInvertedInner(r,Math.min(i,l),s,a)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var s=this.left.length;return i<=s?this.left.slice(r,i):r>=s?this.right.slice(r-s,i-s):this.left.slice(r,s).append(this.right.slice(0,i-s))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(xn);const ZW=500;class co{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,s;n&&(i=this.remapping(r,this.items.length),s=i.maps.length);let a=e.tr,l,u,c=[],f=[];return this.items.forEach((p,m)=>{if(!p.step){i||(i=this.remapping(r,m+1),s=i.maps.length),s--,f.push(p);return}if(i){f.push(new Ho(p.map));let g=p.step.map(i.slice(s)),b;g&&a.maybeStep(g).doc&&(b=a.mapping.maps[a.mapping.maps.length-1],c.push(new Ho(b,void 0,void 0,c.length+f.length))),s--,b&&i.appendMap(b,s)}else a.maybeStep(p.step);if(p.selection)return l=i?p.selection.map(i.slice(s)):p.selection,u=new co(this.items.slice(0,r).append(f.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:u,transform:a,selection:l}}addTransform(e,n,r,i){let s=[],a=this.eventCount,l=this.items,u=!i&&l.length?l.get(l.length-1):null;for(let f=0;f<e.steps.length;f++){let p=e.steps[f].invert(e.docs[f]),m=new Ho(e.mapping.maps[f],p,n),g;(g=u&&u.merge(m))&&(m=g,f?s.pop():l=l.slice(0,l.length-1)),s.push(m),n&&(a++,n=void 0),i||(u=m)}let c=a-r.depth;return c>NW&&(l=QW(l,c),a-=c),new co(l.append(s),a)}remapping(e,n){let r=new eu;return this.items.forEach((i,s)=>{let a=i.mirrorOffset!=null&&s-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,a)},e,n),r}addMaps(e){return this.eventCount==0?this:new co(this.items.append(e.map(n=>new Ho(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),s=e.mapping,a=e.steps.length,l=this.eventCount;this.items.forEach(m=>{m.selection&&l--},i);let u=n;this.items.forEach(m=>{let g=s.getMirror(--u);if(g==null)return;a=Math.min(a,g);let b=s.maps[g];if(m.step){let v=e.steps[g].invert(e.docs[g]),w=m.selection&&m.selection.map(s.slice(u+1,g));w&&l++,r.push(new Ho(b,v,w))}else r.push(new Ho(b))},i);let c=[];for(let m=n;m<a;m++)c.push(new Ho(s.maps[m]));let f=this.items.slice(0,i).append(c).append(r),p=new co(f,l);return p.emptyItemCount()>ZW&&(p=p.compress(this.items.length-r.length)),p}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],s=0;return this.items.forEach((a,l)=>{if(l>=e)i.push(a),a.selection&&s++;else if(a.step){let u=a.step.map(n.slice(r)),c=u&&u.getMap();if(r--,c&&n.appendMap(c,r),u){let f=a.selection&&a.selection.map(n.slice(r));f&&s++;let p=new Ho(c.invert(),u,f),m,g=i.length-1;(m=i.length&&i[g].merge(p))?i[g]=m:i.push(p)}}else a.map&&r--},this.items.length,0),new co(xn.from(i.reverse()),s)}}co.empty=new co(xn.empty,0);function QW(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}class Ho{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new Ho(n.getMap().invert(),n,this.selection)}}}class ss{constructor(e,n,r,i,s){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=s}}const NW=20;function ej(t,e,n,r){let i=n.getMeta(la),s;if(i)return i.historyState;n.getMeta(rj)&&(t=new ss(t.done,t.undone,null,0,-1));let a=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(a&&a.getMeta(la))return a.getMeta(la).redo?new ss(t.done.addTransform(n,void 0,r,bp(e)),t.undone,B8(n.mapping.maps),t.prevTime,t.prevComposition):new ss(t.done,t.undone.addTransform(n,void 0,r,bp(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),u=t.prevTime==0||!a&&t.prevComposition!=l&&(t.prevTime<(n.time||0)-r.newGroupDelay||!tj(n,t.prevRanges)),c=a?zg(t.prevRanges,n.mapping):B8(n.mapping.maps);return new ss(t.done.addTransform(n,u?e.selection.getBookmark():void 0,r,bp(e)),co.empty,c,n.time,l??t.prevComposition)}else return(s=n.getMeta("rebased"))?new ss(t.done.rebased(n,s),t.undone.rebased(n,s),zg(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new ss(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),zg(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function tj(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let s=0;s<e.length;s+=2)r<=e[s+1]&&i>=e[s]&&(n=!0)}),n}function B8(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,i,s,a)=>e.push(s,a));return e}function zg(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let i=e.map(t[r],1),s=e.map(t[r+1],-1);i<=s&&n.push(i,s)}return n}function nj(t,e,n){let r=bp(e),i=la.get(e).spec.config,s=(n?t.undone:t.done).popEvent(e,r);if(!s)return null;let a=s.selection.resolve(s.transform.doc),l=(n?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),i,r),u=new ss(n?l:s.remaining,n?s.remaining:l,null,0,-1);return s.transform.setSelection(a).setMeta(la,{redo:n,historyState:u})}let Ug=!1,I8=null;function bp(t){let e=t.plugins;if(I8!=e){Ug=!1,I8=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Ug=!0;break}}return Ug}const la=new kt("history"),rj=new kt("closeHistory");function oj(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new tt({key:la,state:{init(){return new ss(co.empty,co.empty,null,0,-1)},apply(e,n,r){return ej(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,i=r=="historyUndo"?L8:r=="historyRedo"?P8:null;return i?(n.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function R8(t,e){return(n,r)=>{let i=la.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let s=nj(i,n,t);s&&r(e?s.scrollIntoView():s)}return!0}}const L8=R8(!1,!0),P8=R8(!0,!0),ij=Qe.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>L8(t,e),redo:()=>({state:t,dispatch:e})=>P8(t,e)}},addProseMirrorPlugins(){return[oj(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),D8={HISTORY_TRANSACTION:"history$",ADD_TO_HISTORY_TRANSACTION:"addToHistory"},Wg=ij.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),depth:10,button:({editor:e,t:n})=>["undo","redo"].map(i=>({component:Ke,componentProps:{action:()=>{i==="undo"&&e.commands.undo(),i==="redo"&&e.commands.redo()},shortcutKeys:i==="undo"?["mod","Z"]:["shift","mod","Z"],disabled:!e.can()[i](),icon:i==="undo"?"Undo2":"Redo2",tooltip:n(`editor.${i}.tooltip`)},buttonName:i}))}}}),{isFullscreen:jg,toggleFullscreen:qg}=Cn(),sj=Qe.create({name:"fullscreen",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,extension:n,t:r})=>({component:Ke,componentProps:{tooltip:jg.value?r("editor.fullscreen.tooltip.exit"):r("editor.fullscreen.tooltip.fullscreen"),action:()=>qg(),icon:jg.value?"Minimize":"Maximize",isActive:()=>jg.value}})}},addKeyboardShortcuts(){return{F11:()=>(qg(),!0),"Mod-F11":()=>(qg(),!0)}}}),aj=Qe.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc;if(((t==null?void 0:t.mode)||this.options.mode)==="textSize"){const r=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(r)}return e.nodeSize},this.storage.words=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc,n=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let t=!1;return[new tt({key:new kt("characterCount"),appendTransaction:(e,n,r)=>{if(t)return;const i=this.options.limit;if(i==null||i===0){t=!0;return}const s=this.storage.characters({node:r.doc});if(s>i){const a=s-i,l=0,u=a;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const c=r.tr.deleteRange(l,u);return t=!0,c}t=!0},filterTransaction:(e,n)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const i=this.storage.characters({node:n.doc}),s=this.storage.characters({node:e.doc});if(s<=r||i>r&&s>r&&s<=i)return!0;if(i>r&&s>r&&s>i||!e.getMeta("paste"))return!1;const l=e.selection.$head.pos,u=s-r,c=l-u,f=l;return e.deleteRange(c,f),!(this.storage.characters({node:e.doc})>r)}})]}});function lj(t={}){return new tt({view(e){return new uj(e,t)}})}class uj{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let s=a=>{this[i](a)};return e.dom.addEventListener(i,s),{name:i,handler:s}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r;if(n){let l=e.nodeBefore,u=e.nodeAfter;if(l||u){let c=this.editorView.nodeDOM(this.cursorPos-(l?l.nodeSize:0));if(c){let f=c.getBoundingClientRect(),p=l?f.bottom:f.top;l&&u&&(p=(p+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:f.left,right:f.right,top:p-this.width/2,bottom:p+this.width/2}}}}if(!r){let l=this.editorView.coordsAtPos(this.cursorPos);r={left:l.left-this.width/2,right:l.left+this.width/2,top:l.top,bottom:l.bottom}}let i=this.editorView.dom.offsetParent;this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let s,a;if(!i||i==document.body&&getComputedStyle(i).position=="static")s=-pageXOffset,a=-pageYOffset;else{let l=i.getBoundingClientRect();s=l.left-i.scrollLeft,a=l.top-i.scrollTop}this.element.style.left=r.left-s+"px",this.element.style.top=r.top-a+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,s=typeof i=="function"?i(this.editorView,n,e):i;if(n&&!s){let a=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=dy(this.editorView.state.doc,a,this.editorView.dragging.slice);l!=null&&(a=l)}this.setCursor(a),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const cj=Qe.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[lj(this.options)]}}),dj=Qe.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new tt({key:new kt("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:i}=e,s=[];if(!n||!r)return mt.create(t,[]);let a=0;this.options.mode==="deepest"&&t.descendants((u,c)=>{if(u.isText)return;if(!(i>=c&&i<=c+u.nodeSize-1))return!1;a+=1});let l=0;return t.descendants((u,c)=>{if(u.isText||!(i>=c&&i<=c+u.nodeSize-1))return!1;if(l+=1,this.options.mode==="deepest"&&a-l>0||this.options.mode==="shallowest"&&l>1)return this.options.mode==="deepest";s.push(jt.node(c,c+u.nodeSize,{class:this.options.className}))}),mt.create(t,s)}}})]}});class rn extends Ve{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return rn.valid(r)?new rn(r):Ve.near(r)}content(){return Ee.empty}eq(e){return e instanceof rn&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new rn(e.resolve(n.pos))}getBookmark(){return new Kg(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!fj(e)||!pj(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&rn.valid(e))return e;let i=e.pos,s=null;for(let a=e.depth;;a--){let l=e.node(a);if(n>0?e.indexAfter(a)<l.childCount:e.index(a)>0){s=l.child(n>0?e.indexAfter(a):e.index(a)-1);break}else if(a==0)return null;i+=n;let u=e.doc.resolve(i);if(rn.valid(u))return u}for(;;){let a=n>0?s.firstChild:s.lastChild;if(!a){if(s.isAtom&&!s.isText&&!Pe.isSelectable(s)){e=e.doc.resolve(i+s.nodeSize*n),r=!1;continue e}break}s=a,i+=n;let l=e.doc.resolve(i);if(rn.valid(l))return l}return null}}}rn.prototype.visible=!1,rn.findFrom=rn.findGapCursorFrom,Ve.jsonID("gapcursor",rn);class Kg{constructor(e){this.pos=e}map(e){return new Kg(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return rn.valid(n)?new rn(n):Ve.near(n)}}function fj(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function pj(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function hj(){return new tt({props:{decorations:vj,createSelectionBetween(t,e,n){return e.pos==n.pos&&rn.valid(n)?new rn(n):null},handleClick:gj,handleKeyDown:mj,handleDOMEvents:{beforeinput:bj}}})}const mj=Um({ArrowLeft:vp("horiz",-1),ArrowRight:vp("horiz",1),ArrowUp:vp("vert",-1),ArrowDown:vp("vert",1)});function vp(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,s){let a=r.selection,l=e>0?a.$to:a.$from,u=a.empty;if(a instanceof Ae){if(!s.endOfTextblock(n)||l.depth==0)return!1;u=!1,l=r.doc.resolve(e>0?l.after():l.before())}let c=rn.findGapCursorFrom(l,e,u);return c?(i&&i(r.tr.setSelection(new rn(c))),!0):!1}}function gj(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!rn.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&Pe.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new rn(r))),!0)}function bj(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof rn))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=fe.empty;for(let a=r.length-1;a>=0;a--)i=fe.from(r[a].createAndFill(null,i));let s=t.state.tr.replace(n.pos,n.pos,new Ee(i,0,0));return s.setSelection(Ae.near(s.doc.resolve(n.pos+1))),t.dispatch(s),!1}function vj(t){if(!(t.selection instanceof rn))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",mt.create(t.doc,[jt.widget(t.selection.head,e,{key:"gapcursor"})])}const yj=Qe.create({name:"gapCursor",addProseMirrorPlugins(){return[hj()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=dt(Le(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}}),V8=It.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",vt(this.options.HTMLAttributes,t)]},renderText(){return`
|
|
328
328
|
`},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:s}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:l}=r.extensionManager,u=s||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:f})=>{if(f&&u&&a){const p=u.filter(m=>l.includes(m.type.name));c.ensureMarks(p)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),wj=It.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",vt(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),F8=It.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",vt(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),$8=Qe.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new tt({key:new kt("placeholder"),props:{decorations:({doc:t,selection:e})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,i=[];if(!n)return null;const s=this.editor.isEmpty;return t.descendants((a,l)=>{const u=r>=l&&r<=l+a.nodeSize,c=!a.isLeaf&&_d(a);if((u||!this.options.showOnlyCurrent)&&c){const f=[this.options.emptyNodeClass];s&&f.push(this.options.emptyEditorClass);const p=jt.node(l,l+a.nodeSize,{class:f.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:a,pos:l,hasAnchor:u}):this.options.placeholder});i.push(p)}return this.options.includeChildren}),mt.create(t,i)}}})]}}),H8=It.create({name:"text",group:"inline"}),z8=It.create({name:"doc",topNode:!0,content:"block+"}),U8=z8.extend({content(){var e;return!!((e=this.editor)!=null&&e.options.extensions.find(n=>n.name==="columns"))?"(block|columns)+":"block+"}}),Cj=Qe.create({name:"selection",addProseMirrorPlugins(){const{editor:t}=this;return[new tt({key:new kt("selection"),props:{decorations(e){return e.selection.empty?null:mt.create(e.doc,[jt.inline(e.selection.from,e.selection.to,{class:"selection"})])}}})]}}),xj=t=>{const e=["size-small","size-medium","size-large"],n=["SizeS","SizeM","SizeL"];return e.map((r,i)=>({type:`video-${r}`,component:Ke,componentProps:{tooltip:`editor.${r.replace("-",".")}.tooltip`,icon:n[i],action:()=>t.commands.updateVideo({width:Vd[r]}),isActive:()=>t.isActive("video",{width:Vd[r]})}}))},Ej=t=>[...xj(t),{type:"remove",component:Ke,componentProps:{tooltip:"editor.remove",icon:"Trash2",action:()=>{const{state:e,dispatch:n}=t.view;hu(e,n)}}}],kj=(t,e,{editor:n,extension:r,t:i})=>{const{extensions:s=[]}=n.extensionManager,a={};for(const l of Object.keys(t)){const u=t[l];if(!u)continue;const c=[];for(const m of u){if(m==="divider"){const v=c[c.length-1];if((v==null?void 0:v.type)==="divider")continue;c.push({type:"divider",component:void 0,componentProps:{}});continue}const g=e.find(v=>v.type===m);if(g){c.push({...g,componentProps:{...g.componentProps,tooltip:g.componentProps.tooltip?i(g.componentProps.tooltip):void 0},componentSlots:g.componentSlots});continue}const b=s.find(v=>v.name===m);if(b){const{button:v}=b.options,w=v({editor:n,extension:b,t:i});c.push({type:m,component:w.component,componentProps:w.componentProps,componentSlots:w.componentSlots});continue}}const f=c[c.length-1],p=c[0];(f==null?void 0:f.type)==="divider"&&c.pop(),(p==null?void 0:p.type)==="divider"&&c.shift(),a[l]=c}return a},Sj=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(t=>t.charCodeAt(0))),_j=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(t=>t.charCodeAt(0)));var Gg;const Tj=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),Aj=(Gg=String.fromCodePoint)!==null&&Gg!==void 0?Gg:function(t){let e="";return t>65535&&(t-=65536,e+=String.fromCharCode(t>>>10&1023|55296),t=56320|t&1023),e+=String.fromCharCode(t),e};function Mj(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=Tj.get(t))!==null&&e!==void 0?e:t}var En;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(En||(En={}));const Oj=32;var as;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(as||(as={}));function Xg(t){return t>=En.ZERO&&t<=En.NINE}function Bj(t){return t>=En.UPPER_A&&t<=En.UPPER_F||t>=En.LOWER_A&&t<=En.LOWER_F}function Ij(t){return t>=En.UPPER_A&&t<=En.UPPER_Z||t>=En.LOWER_A&&t<=En.LOWER_Z||Xg(t)}function Rj(t){return t===En.EQUALS||Ij(t)}var kn;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(kn||(kn={}));var ls;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(ls||(ls={}));class Lj{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=kn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=ls.Strict}startEntity(e){this.decodeMode=e,this.state=kn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case kn.EntityStart:return e.charCodeAt(n)===En.NUM?(this.state=kn.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=kn.NamedEntity,this.stateNamedEntity(e,n));case kn.NumericStart:return this.stateNumericStart(e,n);case kn.NumericDecimal:return this.stateNumericDecimal(e,n);case kn.NumericHex:return this.stateNumericHex(e,n);case kn.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|Oj)===En.LOWER_X?(this.state=kn.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=kn.NumericDecimal,this.stateNumericDecimal(e,n))}addToNumericResult(e,n,r,i){if(n!==r){const s=r-n;this.result=this.result*Math.pow(i,s)+Number.parseInt(e.substr(n,s),i),this.consumed+=s}}stateNumericHex(e,n){const r=n;for(;n<e.length;){const i=e.charCodeAt(n);if(Xg(i)||Bj(i))n+=1;else return this.addToNumericResult(e,r,n,16),this.emitNumericEntity(i,3)}return this.addToNumericResult(e,r,n,16),-1}stateNumericDecimal(e,n){const r=n;for(;n<e.length;){const i=e.charCodeAt(n);if(Xg(i))n+=1;else return this.addToNumericResult(e,r,n,10),this.emitNumericEntity(i,2)}return this.addToNumericResult(e,r,n,10),-1}emitNumericEntity(e,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===En.SEMI)this.consumed+=1;else if(this.decodeMode===ls.Strict)return 0;return this.emitCodePoint(Mj(this.result),this.consumed),this.errors&&(e!==En.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,n){const{decodeTree:r}=this;let i=r[this.treeIndex],s=(i&as.VALUE_LENGTH)>>14;for(;n<e.length;n++,this.excess++){const a=e.charCodeAt(n);if(this.treeIndex=Pj(r,i,this.treeIndex+Math.max(1,s),a),this.treeIndex<0)return this.result===0||this.decodeMode===ls.Attribute&&(s===0||Rj(a))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],s=(i&as.VALUE_LENGTH)>>14,s!==0){if(a===En.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==ls.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:n,decodeTree:r}=this,i=(r[n]&as.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[e]&~as.VALUE_LENGTH:i[e+1],r),n===3&&this.emitCodePoint(i[e+2],r),r}end(){var e;switch(this.state){case kn.NamedEntity:return this.result!==0&&(this.decodeMode!==ls.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case kn.NumericDecimal:return this.emitNumericEntity(0,2);case kn.NumericHex:return this.emitNumericEntity(0,3);case kn.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case kn.EntityStart:return 0}}}function W8(t){let e="";const n=new Lj(t,r=>e+=Aj(r));return function(i,s){let a=0,l=0;for(;(l=i.indexOf("&",l))>=0;){e+=i.slice(a,l),n.startEntity(s);const c=n.write(i,l+1);if(c<0){a=l+n.end();break}a=l+c,l=c===0?a+1:a}const u=e+i.slice(a);return e="",u}}function Pj(t,e,n,r){const i=(e&as.BRANCH_LENGTH)>>7,s=e&as.JUMP_TABLE;if(i===0)return s!==0&&r===s?n:-1;if(s){const u=r-s;return u<0||u>=i?-1:t[n+u]-1}let a=n,l=a+i-1;for(;a<=l;){const u=a+l>>>1,c=t[u];if(c<r)a=u+1;else if(c>r)l=u-1;else return t[u+i]}return-1}const Dj=W8(Sj);W8(_j);function Vj(t,e=ls.Legacy){return Dj(t,e)}var en;(function(t){t.Attribute="attribute",t.Pseudo="pseudo",t.PseudoElement="pseudo-element",t.Tag="tag",t.Universal="universal",t.Adjacent="adjacent",t.Child="child",t.Descendant="descendant",t.Parent="parent",t.Sibling="sibling",t.ColumnCombinator="column-combinator"})(en||(en={}));var zr;(function(t){t.Any="any",t.Element="element",t.End="end",t.Equals="equals",t.Exists="exists",t.Hyphen="hyphen",t.Not="not",t.Start="start"})(zr||(zr={}));const j8=/^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/,Fj=/\\([\da-f]{1,6}\s?|(\s)|.)/gi,$j=new Map([[126,zr.Element],[94,zr.Start],[36,zr.End],[42,zr.Any],[33,zr.Not],[124,zr.Hyphen]]),Hj=new Set(["has","not","matches","is","where","host","host-context"]);function zj(t){switch(t.type){case en.Adjacent:case en.Child:case en.Descendant:case en.Parent:case en.Sibling:case en.ColumnCombinator:return!0;default:return!1}}const Uj=new Set(["contains","icontains"]);function Wj(t,e,n){const r=parseInt(e,16)-65536;return r!==r||n?e:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,r&1023|56320)}function dc(t){return t.replace(Fj,Wj)}function Yg(t){return t===39||t===34}function q8(t){return t===32||t===9||t===10||t===12||t===13}function jj(t){const e=[],n=K8(e,`${t}`,0);if(n<t.length)throw new Error(`Unmatched selector: ${t.slice(n)}`);return e}function K8(t,e,n){let r=[];function i(m){const g=e.slice(n+m).match(j8);if(!g)throw new Error(`Expected name, found ${e.slice(n)}`);const[b]=g;return n+=m+b.length,dc(b)}function s(m){for(n+=m;n<e.length&&q8(e.charCodeAt(n));)n++}function a(){n+=1;const m=n;let g=1;for(;g>0&&n<e.length;n++)e.charCodeAt(n)===40&&!l(n)?g++:e.charCodeAt(n)===41&&!l(n)&&g--;if(g)throw new Error("Parenthesis not matched");return dc(e.slice(m,n-1))}function l(m){let g=0;for(;e.charCodeAt(--m)===92;)g++;return(g&1)===1}function u(){if(r.length>0&&zj(r[r.length-1]))throw new Error("Did not expect successive traversals.")}function c(m){if(r.length>0&&r[r.length-1].type===en.Descendant){r[r.length-1].type=m;return}u(),r.push({type:m})}function f(m,g){r.push({type:en.Attribute,name:m,action:g,value:i(1),namespace:null,ignoreCase:"quirks"})}function p(){if(r.length&&r[r.length-1].type===en.Descendant&&r.pop(),r.length===0)throw new Error("Empty sub-selector");t.push(r)}if(s(0),e.length===n)return n;e:for(;n<e.length;){const m=e.charCodeAt(n);switch(m){case 32:case 9:case 10:case 12:case 13:{(r.length===0||r[0].type!==en.Descendant)&&(u(),r.push({type:en.Descendant})),s(1);break}case 62:{c(en.Child),s(1);break}case 60:{c(en.Parent),s(1);break}case 126:{c(en.Sibling),s(1);break}case 43:{c(en.Adjacent),s(1);break}case 46:{f("class",zr.Element);break}case 35:{f("id",zr.Equals);break}case 91:{s(1);let g,b=null;e.charCodeAt(n)===124?g=i(1):e.startsWith("*|",n)?(b="*",g=i(2)):(g=i(0),e.charCodeAt(n)===124&&e.charCodeAt(n+1)!==61&&(b=g,g=i(1))),s(0);let v=zr.Exists;const w=$j.get(e.charCodeAt(n));if(w){if(v=w,e.charCodeAt(n+1)!==61)throw new Error("Expected `=`");s(2)}else e.charCodeAt(n)===61&&(v=zr.Equals,s(1));let C="",E=null;if(v!=="exists"){if(Yg(e.charCodeAt(n))){const _=e.charCodeAt(n);let A=n+1;for(;A<e.length&&(e.charCodeAt(A)!==_||l(A));)A+=1;if(e.charCodeAt(A)!==_)throw new Error("Attribute value didn't end");C=dc(e.slice(n+1,A)),n=A+1}else{const _=n;for(;n<e.length&&(!q8(e.charCodeAt(n))&&e.charCodeAt(n)!==93||l(n));)n+=1;C=dc(e.slice(_,n))}s(0);const x=e.charCodeAt(n)|32;x===115?(E=!1,s(1)):x===105&&(E=!0,s(1))}if(e.charCodeAt(n)!==93)throw new Error("Attribute selector didn't terminate");n+=1;const k={type:en.Attribute,name:g,action:v,value:C,namespace:b,ignoreCase:E};r.push(k);break}case 58:{if(e.charCodeAt(n+1)===58){r.push({type:en.PseudoElement,name:i(2).toLowerCase(),data:e.charCodeAt(n)===40?a():null});continue}const g=i(1).toLowerCase();let b=null;if(e.charCodeAt(n)===40)if(Hj.has(g)){if(Yg(e.charCodeAt(n+1)))throw new Error(`Pseudo-selector ${g} cannot be quoted`);if(b=[],n=K8(b,e,n+1),e.charCodeAt(n)!==41)throw new Error(`Missing closing parenthesis in :${g} (${e})`);n+=1}else{if(b=a(),Uj.has(g)){const v=b.charCodeAt(0);v===b.charCodeAt(b.length-1)&&Yg(v)&&(b=b.slice(1,-1))}b=dc(b)}r.push({type:en.Pseudo,name:g,data:b});break}case 44:{p(),r=[],s(1);break}default:{if(e.startsWith("/*",n)){const v=e.indexOf("*/",n+2);if(v<0)throw new Error("Comment was not terminated");n=v+2,r.length===0&&s(0);break}let g=null,b;if(m===42)n+=1,b="*";else if(m===124){if(b="",e.charCodeAt(n+1)===124){c(en.ColumnCombinator),s(2);break}}else if(j8.test(e.slice(n)))b=i(0);else break e;e.charCodeAt(n)===124&&e.charCodeAt(n+1)!==124&&(g=b,e.charCodeAt(n+1)===42?(b="*",n+=2):b=i(1)),r.push(b==="*"?{type:en.Universal,namespace:g}:{type:en.Tag,name:b,namespace:g})}}}return p(),n}function Jg(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""").replace(/\xA0/g," ").replace(/\xAD/g,"­")}var G8=t=>Vj(t);function qj(t,e,n,r){if(typeof e=="function")return e({props:{...n,children:r},attrs:n,children:r,h:t.h,context:t});{let i=!0,s;if(e?e.toLowerCase()==="fragment"?(s=t.document.createDocumentFragment(),i=!1):s=t.document.createElement(e):s=t.document.createElement("div"),n&&i){const a=s;for(let[l,u]of Object.entries(n)){l=l.toString();const c=l.toLowerCase();c==="classname"?a.className=u:c==="on"?Object.entries(u).forEach(([f,p])=>{a.setAttribute(`on${f}`,String(p))}):u!==!1&&u!=null&&(u===!0?a.setAttribute(l,l):a.setAttribute(l,u.toString()))}}if(r)for(const a of r){const l=Array.isArray(a)?[...a]:[a];for(const u of l)u&&u!==!1&&u!=null&&(typeof u!="object"?s.appendChild(t.document.createTextNode(u.toString())):s.appendChild(u))}return s}}function X8(t,e,...n){return typeof t=="object"&&(t="fragment",n=t.children,e=t.attrs),Array.isArray(e)?(n=[e],e={}):e?e.attrs&&(e={...e.attrs,...e},delete e.attrs):e={},{tag:t,attrs:e,children:typeof n[0]=="string"?n:n.flat(Number.POSITIVE_INFINITY)}}function Kj(t){return t.h=function(n,r,...i){const{tag:s,attrs:a,children:l}=X8(n,r,i);return qj(t,s,a,l)},t.h}var Y8={};function Gj(t){let e=Y8[t];return e==null&&(e=jj(t),Y8[t]=e),e}function Xj(t,e,{debug:n=!1}={}){for(const r of Gj(t)){const i=(s,a)=>{var u,c,f,p;let l=!1;for(const m of a){const{type:g,name:b,action:v,value:w,_ignoreCase:C=!0,data:E}=m;if(g==="attribute")v==="equals"?l=s.getAttribute(b)===w:v==="start"?l=!!((u=s.getAttribute(b))!=null&&u.startsWith(w)):v==="end"?l=!!((c=s.getAttribute(b))!=null&&c.endsWith(w)):v==="element"?b==="class"?l=s.classList.contains(w):l=!!((f=s.getAttribute(b))!=null&&f.includes(w)):v==="exists"?l=s.hasAttribute(b):v==="any"?l=!!((p=s.getAttribute(b))!=null&&p.includes(w)):console.warn("Unknown CSS selector action",v);else if(g==="tag")l=s.tagName===b.toUpperCase();else if(g==="universal")l=!0;else if(g==="pseudo"){if(b==="not"){let k=!0;E.forEach(x=>{i(s,x)||(k=!1)}),l=!k}}else console.warn("Unknown CSS selector type",g,t,a);if(!l)break}return l};if(i(e,r))return!0}return!1}var Yj=Symbol.for("nodejs.util.inspect.custom"),J8={fontWeight:"bold"},Z8={fontStyle:"italic"},Q8={backgroundColor:"rgb(255, 250, 165)"},N8={textDecorations:"underline"},Zg={textDecorations:"line-through"},Jj={b:J8,strong:J8,em:Z8,i:Z8,mark:Q8,u:N8,a:N8,s:Zg,del:Zg,ins:Q8,strike:Zg};function e5(t){return t.toLowerCase().replace(/[^a-z0-9]+(.)/gi,(e,n)=>n.toUpperCase())}var hi=class Gh{constructor(){this.append=this.appendChild,this._parentNode=null,this._childNodes=[]}get nodeType(){return console.error("Subclasses should define nodeType!"),0}get nodeName(){return console.error("Subclasses should define nodeName!"),""}get nodeValue(){return null}cloneNode(e=!1){const n=new this.constructor;return e&&(n._childNodes=this._childNodes.map(r=>r.cloneNode(!0)),n._fixChildNodesParent()),n}_fixChildNodesParent(){this._childNodes.forEach(e=>e._parentNode=this)}insertBefore(e,n){if(e!==n){let r=n?this._childNodes.indexOf(n):0;r<0&&(r=0),this._childNodes.splice(r,0,e),this._fixChildNodesParent()}}appendChild(e){if(e!=null){if(e===this){console.warn("Cannot appendChild to self");return}if(e instanceof Ng&&console.warn("No defined how to append a document to a node!",e),e instanceof Qg)for(const n of[...e._childNodes])this.appendChild(n);else if(Array.isArray(e))for(const n of[...e])this.appendChild(n);else if(e instanceof Gh)e.remove(),this._childNodes.push(e);else try{const n=typeof e=="string"?e:JSON.stringify(e,null,2);this._childNodes.push(new El(n))}catch(n){console.error(`The data ${e} to be added to ${this.render()} is problematic: ${n}`)}this._fixChildNodesParent()}}removeChild(e){const n=this._childNodes.indexOf(e);n>=0&&(e._parentNode=null,this._childNodes.splice(n,1),this._fixChildNodesParent())}remove(){var e;return(e=this==null?void 0:this.parentNode)==null||e.removeChild(this),this}replaceChildren(...e){this._childNodes=e.map(n=>typeof n=="string"?new El(n):n.remove()),this._fixChildNodesParent()}replaceWith(...e){const n=this._parentNode;if(n){const r=this._indexInParent();r>=0&&(e=e.map(i=>typeof i=="string"?new El(i):i.remove()),n._childNodes.splice(r,1,...e),this._parentNode=null,n._fixChildNodesParent())}}_indexInParent(){return this._parentNode?this._parentNode.childNodes.indexOf(this):-1}get parentNode(){return this._parentNode}get childNodes(){return this._childNodes||[]}get children(){return this._childNodes||[]}get firstChild(){return this._childNodes[0]}get lastChild(){return this._childNodes[this._childNodes.length-1]}get nextSibling(){const e=this._indexInParent();return e!=null&&this.parentNode.childNodes[e+1]||null}get previousSibling(){const e=this._indexInParent();return e>0&&this.parentNode.childNodes[e-1]||null}flatten(){const e=[];this instanceof fo&&e.push(this);for(const n of this._childNodes)e.push(...n.flatten());return e}flattenNodes(){const e=[];e.push(this);for(const n of this._childNodes)e.push(...n.flattenNodes());return e}render(){return""}get textContent(){return this._childNodes.map(e=>e.textContent).join("")}set textContent(e){this._childNodes=[],e&&this.appendChild(new El(e.toString()))}contains(e){return e===this?!0:this._childNodes.some(n=>n.contains(e))}get ownerDocument(){var e;return this.nodeType===Gh.DOCUMENT_NODE||this.nodeType===Gh.DOCUMENT_FRAGMENT_NODE?this:(e=this==null?void 0:this._parentNode)==null?void 0:e.ownerDocument}toString(){return`${this.nodeName}`}[Yj](){return`${this.constructor.name} "${this.render()}"`}};hi.ELEMENT_NODE=1,hi.TEXT_NODE=3,hi.CDATA_SECTION_NODE=4,hi.PROCESSING_INSTRUCTION_NODE=7,hi.COMMENT_NODE=8,hi.DOCUMENT_NODE=9,hi.DOCUMENT_TYPE_NODE=10,hi.DOCUMENT_FRAGMENT_NODE=11;var us=hi,El=class extends us{get nodeType(){return us.TEXT_NODE}get nodeName(){return"#text"}get nodeValue(){return this._text||""}get textContent(){return this.nodeValue}constructor(t=""){super(),this._text=t}render(){var e;const t=(e=this.parentNode)==null?void 0:e.tagName;return t==="SCRIPT"||t==="STYLE"?this._text:Jg(this._text)}cloneNode(t=!1){const e=super.cloneNode(t);return e._text=this._text,e}},t5=class extends us{getElementById(t){return this.flatten().find(e=>e._attributes.id===t)}getElementsByClassName(t){return this.flatten().filter(e=>e.classList.contains(t))}matches(t){return Xj(t,this)}querySelectorAll(t){return this.flatten().filter(e=>e.matches(t))}querySelector(t){return this.flatten().find(e=>e.matches(t))}parent(t){var e;return this.matches(t)?this:this.parentNode==null?null:(e=this.parentNode)==null?void 0:e.parent(t)}handle(t,e){let n=0;for(const r of this.querySelectorAll(t))e(r,n++)}},fo=class extends t5{get nodeType(){return us.ELEMENT_NODE}get nodeName(){return this._nodeName}constructor(t="div",e={}){super(),this._originalTagName=t,this._nodeName=(t||"").toUpperCase(),this._attributes=e||{}}cloneNode(t=!1){const e=super.cloneNode(t);return e._originalTagName=this._originalTagName,e._nodeName=this._nodeName,e._attributes=Object.assign({},this._attributes),e}get attributes(){return Object.entries(this._attributes).map(([t,e])=>({name:t,value:e}))}get attributesObject(){return{...this._attributes}}_findAttributeName(t){const e=t.toLowerCase();return Object.keys(this._attributes).find(n=>e===n.toLowerCase())||null}setAttribute(t,e){this.removeAttribute(t),this._attributes[t]=e,this._styles=void 0,this._dataset=void 0}getAttribute(t){const e=this._findAttributeName(t),n=e?this._attributes[e]:null;return n==null?null:typeof n=="string"?n:""}removeAttribute(t){this._findAttributeName(String(t))&&delete this._attributes[t]}hasAttribute(t){const e=this._findAttributeName(t);return e?this._attributes[e]!=null:!1}get style(){if(this._styles==null){const t={};let e=0;const n=this.getAttribute("style");if(n){let r;const i=/\s*([\w-]+)\s*:\s*((url\(.*?\)[^;]*|[^;]+))/gi;for(;r=i.exec(n);){++e;const s=r[1],a=r[2].trim();t[s]=a,t[e5(s)]=a}}this._styles={get length(){return e},getPropertyValue(r){return t[r]},...Jj[this.tagName.toLowerCase()],...t}}return this._styles}get dataset(){if(this._dataset==null){const t={};for(const[e,n]of Object.entries(this._attributes))e.startsWith("data-")&&(t[e.slice(5)]=n,t[e5(e.slice(5))]=n);this._dataset=t}return this._dataset}get tagName(){return this._nodeName}setTagName(t){this._nodeName=t.toUpperCase()}get id(){return this._attributes.id||null}set id(t){t==null?delete this._attributes.id:this._attributes.id=t}get src(){return this._attributes.src}set src(t){t==null?delete this._attributes.src:this._attributes.src=t}getElementsByTagName(t){t=t.toUpperCase();const e=this.flatten();return t!=="*"?e.filter(n=>n.tagName===t):e}setInnerHTML(t){}get innerHTML(){return this._childNodes.map(t=>t.render(yp)).join("")}set innerHTML(t){this.setInnerHTML(t)}get outerHTML(){return this.render(wp)}get className(){return this._attributes.class||""}set className(t){Array.isArray(t)?t=t.filter(e=>!!e).join(" "):typeof t=="object"&&(t=Object.entries(t).filter(([e,n])=>!!n).map(([e,n])=>e).join(" ")),this._attributes.class=t}get classList(){const t=String(this.className??"").trim().split(/\s+/g)||[];return{contains(e){return t.includes(e)},add:e=>{t.includes(e)||(t.push(e),this.className=t)},remove:e=>{const n=t.indexOf(e);n>=0&&(t.splice(n,1),this.className=t)}}}render(t=wp){return t(this._originalTagName||this.tagName,this._attributes,this._childNodes.map(e=>e.render(t)).join(""))}},n5=class V_ extends us{get nodeName(){return super.nodeName}get nodeValue(){return super.nodeValue}get nodeType(){return V_.DOCUMENT_TYPE_NODE}render(){return"<!DOCTYPE html>"}},Qg=class F_ extends t5{get nodeType(){return us.DOCUMENT_FRAGMENT_NODE}get nodeName(){return"#document-fragment"}render(e=wp){return this._childNodes.map(n=>n.render(e)||[]).join("")}get innerHTML(){return this._childNodes.map(e=>e.render(yp)).join("")}createElement(e,n={}){return new fo(e,n)}createDocumentFragment(){return new F_}createTextNode(e){return new El(e)}},Ng=class extends Qg{get nodeType(){return us.DOCUMENT_NODE}get nodeName(){return"#document"}get documentElement(){return this.firstChild}render(t=wp){let e=super.render(t);return this.docType&&(e=this.docType.render()+e),e}},r5=class extends Ng{constructor(t=!1){if(super(),this.docType=new n5,!t){const e=new fo("html"),n=new fo("body"),r=new fo("head"),i=new fo("title");e.appendChild(r),r.appendChild(i),e.appendChild(n),this.appendChild(e)}}get body(){let t=this.querySelector("body");if(!t){let e=this.querySelector("html");e||(e=new fo("html"),this.appendChild(e)),t=new fo("body"),e.appendChild(e)}return t}get title(){var t;return((t=this.querySelector("title"))==null?void 0:t.textContent)||""}set title(t){const e=this.querySelector("title");e&&(e.textContent=t)}get head(){let t=this.querySelector("head");if(!t){let e=this.querySelector("html");e||(e=new fo("html"),this.appendChild(e)),t=new fo("head"),e.insertBefore(e)}return t}};function Zj(){return new Ng}function Qj(){return new r5}var o5=Zj();Kj({document:o5});var Nj={},eq=Nj.hasOwnProperty;function i5(t,e){return eq.call(t,e)}var s5=["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr","command"];function a5(t,e,n={},r){const i=!(typeof r=="string"&&r===""||Array.isArray(r)&&(r.length===0||r.length===1&&r[0]==="")||r==null),s=[];if(e=e.replace(/__/g,":"),e!=="noop"&&e!==""){e!=="cdata"?s.push(`<${e}`):s.push("<![CDATA[");for(let a in n)if(a&&i5(n,a)){const l=n[a];if(a==="html")continue;a.toLowerCase()==="classname"&&(a="class"),a=a.replace(/__/g,":"),l===!0?s.push(` ${a}`):a==="style"&&typeof l=="object"?s.push(` ${a}="${Object.keys(l).filter(u=>l[u]!=null).map(u=>{let c=l[u];return c=typeof c=="number"?`${c}px`:c,`${u.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}:${c}`}).join(";")}"`):l!==!1&&l!=null&&s.push(` ${a}="${Jg(l.toString())}"`)}if(e!=="cdata"){if(t&&!i)return s.push(" />"),s.join("");s.push(">")}if(!t&&s5.includes(e))return s.join("")}if(i){if(typeof r=="string")s.push(r);else if(r&&r.length>0){for(let a of r)if(a!=null&&a!==!1){Array.isArray(a)||(a=[a]);for(const l of a)l.startsWith("<")&&l.endsWith(">")||e==="script"||e==="style"?s.push(l):s.push(Jg(l.toString()))}}}return n.html&&s.push(n.html),e!=="noop"&&e!==""&&(e!=="cdata"?s.push(`</${e}>`):s.push("]]>")),s.join("")}function yp(t,e,...n){const{tag:r,attrs:i,children:s}=X8(t,e,n);return a5(!1,r,i,s)}var wp=a5.bind(null,!1);yp.firstLine="<!DOCTYPE html>",yp.html=!0;var tq=/([^=\s]+)(\s*=\s*(("([^"]*)")|('([^']*)')|[^>\s]+))?/g,nq=/^<\/([^>\s]+)[^>]*>/m,rq=/^<([^>\s/]+)((\s+[^=>\s]+(\s*=\s*(("[^"]*")|('[^']*')|[^>\s]+))?)*)\s*(?:\/\s*)?>/m,oq=/\s*\/\s*>\s*$/m,iq=class{constructor(t={}){this.attrRe=tq,this.endTagRe=nq,this.startTagRe=rq,this.defaults={ignoreWhitespaceText:!1},t.scanner&&(this.scanner=t.scanner),this.options=Object.assign({},this.defaults,t)}parse(t){let e=!1,n,r,i;for(;t.length;){if(t.substring(0,4)==="<!--")n=t.indexOf("-->"),n!==-1?(this.scanner.comment(t.substring(4,n)),t=t.substring(n+3),e=!1):e=!0;else if(t.substring(0,2)==="</")r=this.endTagRe.exec(t),r?(t=RegExp.rightContext,e=!1,this.parseEndTag(RegExp.lastMatch,r[1])):e=!0;else if(t.charAt(0)==="<")if(r=this.startTagRe.exec(t),r){t=RegExp.rightContext,e=!1;const s=this.parseStartTag(RegExp.lastMatch,r[1],r);(s==="script"||s==="style")&&(n=t.search(new RegExp(`</${s}`,"i")),n!==-1?(this.scanner.characters(t.substring(0,n)),t=t.substring(n),e=!1):e=!0)}else e=!0;if(e){n=t.indexOf("<");let s=n;n===0&&(n=t.substring(1).indexOf("<"),s=s+1),n===-1?(i=t,t=""):(i=t.substring(0,s),t=t.substring(s)),(!this.options.ignoreWhitespaceText||!/^\s*$/.test(i))&&this.scanner.characters(i)}e=!0,r=null}}parseStartTag(t,e,n){const r=oq.test(t);let i=n[2];r&&(i=i.replace(/\s*\/\s*$/,""));const s=this.parseAttributes(e,i);return this.scanner.startElement(e,s,r,n[0]),e.toLocaleLowerCase()}parseEndTag(t,e){this.scanner.endElement(e)}parseAttributes(t,e){const n={};return e.replace(this.attrRe,(...r)=>{const[i,s,a,l,u,c,f,p]=r;n[s]=p??c??l??!0}),n}};function sq(t){if(typeof t!="string")throw console.error("parseHTML requires string, found",t),new Error("parseHTML requires string");const e=t.indexOf("<!")===0?new r5(!0):new Qg,n=[e];return new iq({scanner:{startElement(i,s,a){if(i.toLowerCase()==="!doctype"){e.docType=new n5;return}for(const c in s)if(i5(s,c)){const f=s[c];typeof f=="string"&&(s[c]=G8(f))}const u=n[n.length-1];if(u){const c=o5.createElement(i,s);u.appendChild(c),s5.includes(i.toLowerCase())||a||n.push(c)}},endElement(i){n.pop()},characters(i){var a;i=G8(i);const s=n[n.length-1];((a=s==null?void 0:s.lastChild)==null?void 0:a.nodeType)===us.TEXT_NODE?s.lastChild._text+=i:s&&s.appendChild(new El(i))},comment(i){}}}).parse(t),e}fo.prototype.setInnerHTML=function(t){const e=sq(t);this._childNodes=e._childNodes,this._fixChildNodesParent()};function aq(t,e,n){return Nr.fromSchema(e).serializeFragment(t.content,{document:Qj()}).render()}function lq(t,e){const n=Qr.fromJSON(e,t);return aq(n,e)}function uq(t,e){const n=document.getElementById(t.attrs.id)??eb.getElementById(t.attrs.id);if(!n)return null;const r=l5(n),{lastChild:i}=t,{childCount:s}=t,a=t.content.content.slice(0,s);if(!i)return!1;i.isText&&a.push(e.text("gg"));const l=lq(cq(t.type.create(t.attrs,a,t.marks)),e);return fq(l,t.attrs.id,!1)>r}function cq(t){return{type:"doc",content:[t.toJSON()]}}let dq=null,eb=null;const tb=new Map;function fq(t,e,n=!0){if(n&&tb.has(t))return tb.get(t);const r=eb.getElementById("computeddiv");if(r){r.innerHTML=`<p> </p>${t}`;const i=eb.getElementById(e),{height:s}=l5(i);return r.innerHTML=" ",n&&tb.set(t,s),s}return 0}function l5(t){const e=window.getComputedStyle(t)||dq.contentWindow.getComputedStyle(t),n=e.getPropertyValue("margin-top"),r=e.getPropertyValue("margin-bottom"),i=parseFloat(n)+parseFloat(r),{height:s}=t.getBoundingClientRect();return{margin:i,height:i+t.offsetHeight+parseFloat(e.borderWidth)}}function nb(){return ui(10)}const Cp="paragraph",Ur="page",u5="Extend",kl="Node",pq=kl+u5,hq="CC",xp="heading",Ep="bulletList",rb="listItem",c5="taskList",mq="taskItem",kp="orderedList",cs="table",ob="tableHeader",ib="tableRow",gq="tableCell",sb="column",ua="columns",ab="textBox",ds="image",fs="imageUpload",bq="iframe",vq="file",lb="codeBlock",ub="blockquote",yq="audio",wq="toc",d5="video",Cq="horizontalrule",cb="pagination",xq=[cs,kp,Ep,c5],Eq=[d5,ds],fc="link",kq="placeholder",Sq="focus",_q="text",Tq="text-bubble",Aq="gapCursor",Mq="dropCursor",Oq="characterCount",Bq="hardBreak",Iq="textStyle",Rq="selection",db="superText",fb="configPlan",Lq="fontSize",Pq="fontFamily",Dq="bold",Vq="italic",Fq="underline",$q="strike",Hq="color",zq="highlight",Uq="moreMark",Wq="textAlign",jq="indent",qq="lineHeight",Kq="painter",Gq="clear",Sl="spellchecker",f5="fontSizeIncreaseDecrease",Sp="time-highlighter",Xq=Object.freeze(Object.defineProperty({__proto__:null,AUDIO:yq,BLOCKQUOTE:ub,BOLD:Dq,BULLETLIST:Ep,CASSIE_BLOCK:kl,CASSIE_BLOCK_EXTEND:pq,CC:hq,CHARACTER_COUNT:Oq,CLEAR:Gq,CODE_BLOCK:lb,COLOR:Hq,COLUMN:sb,COLUMNS:ua,CONFIG_PLAN:fb,DROP_CURSOR:Mq,EXTEND:u5,FILE:vq,FOCUS:Sq,FONTSIZEINCREASEDECREASE:f5,FONT_FAMILY:Pq,FONT_SIZE:Lq,GAP_CURSOR:Aq,HARD_BREAK:Bq,HEADING:xp,HIGHLIGHT:zq,HORIZONTALRULE:Cq,IFRAME:bq,IMAGE:ds,IMAGE_UPLOAD:fs,INDENT:jq,ITALIC:Vq,LINE_HEIGHT:qq,LINK:fc,LISTITEM:rb,LIST_MEDIA:Eq,LIST_TYPE:xq,MORE_MARK:Uq,ORDEREDLIST:kp,PAGE:Ur,PAGEBREAK:cb,PAINTER:Kq,PARAGRAPH:Cp,PLACEHOLDER:kq,SELECTION:Rq,SPELLCHECKER:Sl,STRIKE:$q,SUPER_TEXT:db,TABLE:cs,TABLEHEADER:ob,TABLE_CELL:gq,TABLE_ROW:ib,TASKITEM:mq,TASKLIST:c5,TEXT:_q,TEXT_ALIGN:Wq,TEXT_BOX:ab,TEXT_BUBBLE:Tq,TEXT_STYLE:Iq,TIME_HIGH_LIGHTER:Sp,TOC:wq,UNDERLINE:Fq,VIDEO:d5},Symbol.toStringTag,{value:"Module"})),pb=o.defineComponent({__name:"ContextMenu",props:{dir:{},modal:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const i=Rt(t,e);return(s,a)=>(o.openBlock(),o.createBlock(o.unref(GL),o.normalizeProps(o.guardReactiveProps(o.unref(i))),{default:o.withCtx(()=>[o.renderSlot(s.$slots,"default")]),_:3},16))}}),hb=o.defineComponent({__name:"ContextMenuContent",props:{forceMount:{type:Boolean},loop:{type:Boolean},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},sticky:{},hideWhenDetached:{type:Boolean},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","closeAutoFocus"],setup(t,{emit:e}){const n=t,r=e,i=o.computed(()=>{const{class:a,...l}=n;return l}),s=Rt(i,r);return(a,l)=>(o.openBlock(),o.createBlock(o.unref(YL),null,{default:o.withCtx(()=>[o.createVNode(o.unref(JL),o.mergeProps(o.unref(s),{class:o.unref(xe)("z-50 min-w-32 overflow-hidden rounded-md border bg-ed-popover p-1 text-ed-popover-foreground shadow-md animate-in fade-in-80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n.class)}),{default:o.withCtx(()=>[o.renderSlot(a.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),mb=o.defineComponent({__name:"ContextMenuItem",props:{disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{},inset:{type:Boolean}},emits:["select"],setup(t,{emit:e}){const n=t,r=e,i=o.computed(()=>{const{class:a,...l}=n;return l}),s=Rt(i,r);return(a,l)=>(o.openBlock(),o.createBlock(o.unref(ZL),o.mergeProps(o.unref(s),{class:o.unref(xe)("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-ed-accent focus:text-ed-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n.inset&&"pl-8",n.class)}),{default:o.withCtx(()=>[o.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),gb=o.defineComponent({__name:"ContextMenuTrigger",props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{}},setup(t){const n=Yn(t);return(r,i)=>(o.openBlock(),o.createBlock(o.unref(XL),o.normalizeProps(o.guardReactiveProps(o.unref(n))),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default")]),_:3},16))}}),_p=o.defineComponent({__name:"Dialog",props:{open:{type:Boolean},defaultOpen:{type:Boolean},modal:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const i=Rt(t,e);return(s,a)=>(o.openBlock(),o.createBlock(o.unref(VR),o.normalizeProps(o.guardReactiveProps(o.unref(i))),{default:o.withCtx(()=>[o.renderSlot(s.$slots,"default")]),_:3},16))}}),Tp=o.defineComponent({__name:"DialogContent",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{},class:{},isOverlayTransparent:{type:Boolean}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const n=t,r=e,i=o.computed(()=>{const{isOverlayTransparent:a,class:l,...u}=n;return u}),s=Rt(i,r);return(a,l)=>(o.openBlock(),o.createBlock(o.unref(e1),null,{default:o.withCtx(()=>[o.createVNode(o.unref(s1),{class:o.normalizeClass(o.unref(xe)("fixed inset-0 z-[60] bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a.isOverlayTransparent&&"bg-transparent"))},null,8,["class"]),o.createVNode(o.unref(sL),o.mergeProps(o.unref(s),{class:o.unref(xe)("fixed left-1/2 top-1/2 z-[60] grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-ed-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",n.class)}),{default:o.withCtx(()=>[o.renderSlot(a.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),bb=o.defineComponent({__name:"DialogFooter",props:{class:{}},setup(t){const e=t;return(n,r)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(xe)("flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-x-2",e.class))},[o.renderSlot(n.$slots,"default")],2))}}),Ap=o.defineComponent({__name:"DialogDescription",props:{asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,n=o.computed(()=>{const{class:i,...s}=e;return s}),r=Yn(n);return(i,s)=>(o.openBlock(),o.createBlock(o.unref(cL),o.mergeProps(o.unref(r),{class:o.unref(xe)("text-sm text-ed-muted-foreground",e.class)}),{default:o.withCtx(()=>[o.renderSlot(i.$slots,"default")]),_:3},16,["class"]))}}),Mp=o.defineComponent({__name:"DialogHeader",props:{class:{}},setup(t){const e=t;return(n,r)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(xe)("flex flex-col gap-y-1.5 text-center sm:text-left",e.class))},[o.renderSlot(n.$slots,"default")],2))}}),Op=o.defineComponent({__name:"DialogClose",props:{asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,r)=>(o.openBlock(),o.createBlock(o.unref(lL),o.normalizeProps(o.guardReactiveProps(e)),{default:o.withCtx(()=>[o.renderSlot(n.$slots,"default")]),_:3},16))}}),Bp=o.defineComponent({__name:"DialogTitle",props:{asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,n=o.computed(()=>{const{class:i,...s}=e;return s}),r=Yn(n);return(i,s)=>(o.openBlock(),o.createBlock(o.unref(uL),o.mergeProps(o.unref(r),{class:o.unref(xe)("text-lg font-semibold leading-none tracking-tight",e.class)}),{default:o.withCtx(()=>[o.renderSlot(i.$slots,"default")]),_:3},16,["class"]))}}),Yq={class:"sr-only"},Jq={class:"m-2.5 p-2.5 space-y-2.5 flex items-center gap-x-2"},Zq=o.defineComponent({__name:"SuperInputDialogAlert",props:{open:{type:Boolean},title:{default:"확인"},message:{default:""},confirmText:{default:"확인"},closeText:{default:"Close"},iconName:{default:void 0}},emits:["close"],setup(t,{emit:e}){const n=t,r=e,{t:i}=Ot(),s=Cn(),a=o.computed(()=>n.message||i(s.textAlert.value||"editor.alert")),l=o.reactive({x:0,y:0}),u=o.ref(!1),c={x:0,y:0},f=()=>{r("close")},p=b=>{u.value=!0,c.x=b.clientX-l.x,c.y=b.clientY-l.y,document.addEventListener("mousemove",m),document.addEventListener("mouseup",g)},m=b=>{u.value&&(l.x=b.clientX-c.x,l.y=b.clientY-c.y)},g=()=>{u.value=!1,document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",g)};return o.watch(()=>n.open,async b=>{if(b){await o.nextTick();const v=document.querySelector(".draggable-dialog");if(v){const{width:w,height:C}=v.getBoundingClientRect(),E=window.innerWidth,k=window.innerHeight;l.x=(E-w)/2+250,l.y=(k-C)/2-50}}},{immediate:!0}),o.onUnmounted(()=>{document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",g)}),(b,v)=>{const w=Bp,C=Op,E=Mp,k=Ap,x=bb,_=Tp,A=_p;return o.openBlock(),o.createBlock(A,{open:b.open},{default:o.withCtx(()=>[o.createVNode(o.unref(e1),null,{default:o.withCtx(()=>[o.createVNode(o.unref(s1),{class:"!pointer-events-none bg-black/30"}),o.createVNode(_,{"is-overlay-transparent":"",class:"p-0 gap-0 !animate-none !transition-none","as-child":"",onOpenAutoFocus:v[0]||(v[0]=T=>{T.preventDefault()})},{default:o.withCtx(()=>[o.createElementVNode("div",{class:"draggable-dialog fixed z-[70] pointer-events-auto",style:o.normalizeStyle({transform:`translate(${o.unref(l).x}px, ${o.unref(l).y}px)`,top:"0px",left:"0px"})},[o.createVNode(E,{class:"bg-blue-500 text-white p-2.5 rounded-t-[5px] cursor-move",onMousedown:o.withModifiers(p,["prevent"])},{default:o.withCtx(()=>[o.createVNode(w,null,{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(n.title),1)]),_:1}),o.createVNode(C,{class:"absolute right-3 top-3 text-white",onClick:f},{default:o.withCtx(()=>[o.createVNode(o.unref(Ff),{class:"w-5 h-5"}),o.createElementVNode("span",Yq,o.toDisplayString(n.closeText),1)]),_:1})]),_:1}),o.createVNode(k),o.createElementVNode("div",Jq,[b.iconName?(o.openBlock(),o.createBlock(o.unref(Tt),{key:0,name:b.iconName,class:"w-8 h-8 text-blue-500"},null,8,["name"])):o.createCommentVNode("",!0),o.createTextVNode(" "+o.toDisplayString(o.unref(a)),1)]),o.createVNode(x,{class:"sm:justify-center pb-3.5 pt-1"},{default:o.withCtx(()=>[o.createVNode(wn,{as:"button",variant:"default",class:"bg-blue-500 hover:bg-blue-500/90",onClick:f},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(n.confirmText),1)]),_:1})]),_:1})],4)]),_:1})]),_:1})]),_:1},8,["open"])}}}),p5=o.defineComponent({__name:"Checkbox",props:{defaultChecked:{type:Boolean},checked:{type:[Boolean,String]},disabled:{type:Boolean},required:{type:Boolean},name:{},value:{},id:{},asChild:{type:Boolean},as:{},class:{}},emits:["update:checked"],setup(t,{emit:e}){const n=t,r=e,i=o.computed(()=>{const{class:a,...l}=n;return l}),s=Rt(i,r);return(a,l)=>(o.openBlock(),o.createBlock(o.unref(hL),o.mergeProps(o.unref(s),{class:o.unref(xe)("peer h-5 w-5 shrink-0 rounded-sm border border-ed-border shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ed-ring disabled:cursor-not-allowed disabled:opacity-50 text-ed-blue",n.class)}),{default:o.withCtx(()=>[o.createVNode(o.unref(mL),{class:"flex h-full w-full items-center justify-center"},{default:o.withCtx(()=>[o.renderSlot(a.$slots,"default",{},()=>[o.createVNode(o.unref(ng),{icon:"fa-solid:check"})])]),_:3})]),_:3},16,["class"]))}}),h5=Qe.create({name:"invalidCharFocus",addOptions(){return{invalidChars:["{","}"]}},addCommands(){return{focusInvalidChar:()=>({state:t,dispatch:e,view:n})=>{let r=null;if(t.doc.descendants((s,a)=>{if(!s.isText)return!0;const l=s.text??"";for(let u=0;u<l.length;u++)if(this.options.invalidChars.includes(l[u])){const c=a+u+1;(r==null||c<r)&&(r=c)}return!0}),r==null)return!1;const i=t.tr.setSelection(Ae.create(t.doc,r));return e&&e(i.scrollIntoView()),n&&n.focus(),!0},hasInvalidChar:()=>({state:t})=>{let e=!1;return t.doc.descendants(n=>{if(!n.isText)return!0;const r=n.text??"";return this.options.invalidChars.some(i=>r.includes(i))?(e=!0,!1):!0}),e}}}}),vb=o.defineComponent({__name:"SimpleEditor",props:{modelValue:{default:""},parentEditor:{},isReadOnly:{type:Boolean},autofocus:{type:[String,Number,Boolean,null],default:"start"},spellcheckEnabled:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(t,{expose:e,emit:n}){const r=t,i=n,s=o.inject("isMobile",!1),a=o.inject("minCharSuperInput",0),l=[z8,F8,H8,V8,$8.configure({placeholder:"수퍼를 입력하세요"}),h5],u=o.ref(r.spellcheckEnabled),c=o.computed(()=>{var T;return(T=r.parentEditor)==null?void 0:T.extensionManager.extensions.find(B=>B.name==="spellchecker")}),f=o.computed(()=>{var T,B,L,I,F,U,ie;return uE.configure({proofreader:new KE({api:(B=(T=c.value)==null?void 0:T.options.proofreader)==null?void 0:B.api,limit:(I=(L=c.value)==null?void 0:L.options.proofreader)==null?void 0:I.limit,transfer:(U=(F=c.value)==null?void 0:F.options.proofreader)==null?void 0:U.transfer,enabled:u.value}),uiStrings:(ie=c.value)==null?void 0:ie.options.uiStrings})}),p=new So({enablePasteRules:!1,enableInputRules:!1,content:r.modelValue,extensions:l.concat(f.value),editable:!r.isReadOnly,autofocus:r.autofocus,onUpdate:({editor:T})=>{i("update:modelValue",T.getHTML())},parseOptions:{preserveWhitespace:"full"}});o.watch(()=>r.isReadOnly,T=>{var B;p.setEditable(!T),(B=p==null?void 0:p.commands)!=null&&B.setIsEnableSuggestion&&p.commands.setIsEnableSuggestion(!T)},{immediate:!0});function m(T){const{view:B}=p,{from:L}=B.state.selection;p.commands.insertContentAt(L,T),p.commands.focus()}function g(){var T;u.value=!u.value,p.commands.handleActiveSpellCheck(u.value),(T=p==null?void 0:p.commands)!=null&&T.setIsEnableSuggestion&&p.commands.setIsEnableSuggestion(u.value)}const{contentInner:b,measuredMinWidth:v,measure:w}=$d({minChars:a,fontSize:"",editor:p});o.watch(()=>r.modelValue,()=>{w(),p&&p.getHTML()!==r.modelValue&&p.commands.setContent(r.modelValue??"",!1)});const C=o.computed(()=>s?{}:{width:`${v.value}px`}),k=document.createElement("canvas").getContext("2d");function x(){if(!v.value||!(b.value instanceof Element)||!k)return;const T=p.getText({blockSeparator:`
|
|
329
329
|
`}),B=getComputedStyle(b.value);k.font=B.font;const L=20,I=()=>Math.max(0,(v.value||0)-L);function F(H,V){let D=1,j=H.length,Y=0;for(;D<=j;){const J=Math.floor((D+j)/2);k.measureText(H.slice(0,J)).width<=V?(Y=J,D=J+1):j=J-1}return Y}let U="";const ie=[];for(const H of T){if(H===`
|
|
330
|
-
`){ie.push(U),U="";continue}if(U+=H,k.measureText(U).width>I())for(;k.measureText(U).width>I();){const V=F(U,I());V<=0?(ie.push(U.charAt(0)),U=U.slice(1)):(ie.push(U.slice(0,V)),U=U.slice(V))}}return ie.push(U),ie.map(H=>`<p>${H}</p>`).join("")}const{isScrolling:_,handleScroll:A}=Ol();return e({insertSpecialCharater:m,isChecked:u,toggleSpellCheck:g,wrapText:x,editor:p}),(T,B)=>(o.openBlock(),o.createElementBlock("div",{ref_key:"contentInner",ref:b,style:o.normalizeStyle(o.unref(C)),onScroll:B[0]||(B[0]=(...L)=>o.unref(A)&&o.unref(A)(...L)),class:o.normalizeClass(o.unref(xe)("h-40 overflow-y-auto border focus-within:border-ed-input-focus rounded-[3px] p-2.5",T.isReadOnly&&"border-none",o.unref(s)&&"h-auto min-h-20 max-h-44 border-ed-gray rounded-md px-4 py-2.5",o.unref(s)&&!o.unref(_)&&"scrollbar-thumb-transparent"))},[o.createVNode(o.unref(Xn),{id:"editor-panel",editor:o.unref(p),class:o.normalizeClass(o.unref(xe)("vdc-editor relative h-full"))},null,8,["editor","class"])],38))}}),Qq={class:"sr-only"},Nq={class:"grid m-2.5 p-2.5 gap-y-2.5 rounded border border-gray-200"},eK={class:"grid grid-cols-[70px,1fr] gap-x-2"},tK={class:"flex gap-x-7"},nK={class:"flex items-center space-x-2 text-xs font-normal"},rK={for:"spellcheck",class:"select-none whitespace-nowrap"},oK={class:"flex gap-x-1"},iK={class:"grid grid-cols-[70px,1fr] gap-x-2"},sK={class:"text-right text-sm p-2"},aK={class:"grid grid-cols-[70px,1fr] gap-x-2"},pc=o.defineComponent({__name:"SuperInputDialog",props:{editor:{},open:{type:Boolean},superTextInit:{},superTextElementId:{}},emits:["close","save"],setup(t,{emit:e}){var U,ie;const n=e,r=t,{t:i}=Ot(),s=o.ref(""),a=o.ref(""),l=o.ref(null),u=o.ref(!1),c=o.reactive({x:0,y:0}),f=o.ref(!1),p={x:0,y:0},m=o.ref(!1),g=o.ref(!1),b=o.ref(!1),v=oe=>{f.value=!0,p.x=oe.clientX-c.x,p.y=oe.clientY-c.y,document.addEventListener("mousemove",w),document.addEventListener("mouseup",C)},w=oe=>{f.value&&(c.x=oe.clientX-p.x,c.y=oe.clientY-p.y)},C=()=>{f.value=!1,document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",C)};o.watch(()=>r.open,async oe=>{if(oe){g.value=!1,r.superTextInit&&(s.value=r.superTextInit,r.superTextElementId&&(a.value=r.superTextElementId)),await o.nextTick();const H=document.querySelector(".draggable-dialog");if(H){const{width:V,height:D}=H.getBoundingClientRect(),j=window.innerHeight;c.x=0,c.y=(j-D)/2}}},{immediate:!0});const E=()=>{n("close"),s.value="",a.value="",u.value=!1},k=()=>{var H;if((H=l.value)==null?void 0:H.editor.commands.hasInvalidChar()){b.value=!0;return}s.value=l.value.wrapText(),a.value="",g.value?m.value=!0:n("close"),n("save",s.value),s.value=""},x=()=>{m.value=!1,n("close")},_=(ie=(U=r.editor)==null?void 0:U.extensionManager.extensions.find(oe=>oe.name==="superText"))==null?void 0:ie.options.specialCharModal,A=ct.useLocalStorage("recentSpecialChars",[]),T=oe=>{if(!oe)return;const H=(A.value??[]).filter(V=>V!==oe);H.unshift(oe),A.value=H.slice(0,5)},B=oe=>{var H;(H=l.value)==null||H.insertSpecialCharater(oe)},L=(oe,H)=>{var V;H&&((V=l.value)==null||V.insertSpecialCharater(oe),T(oe))},I=o.computed(()=>{var oe;return(oe=l.value)==null?void 0:oe.isChecked}),F=()=>{var oe;(oe=l.value)==null||oe.toggleSpellCheck()};return o.onUnmounted(()=>{document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",C)}),o.watch(s,oe=>{!r.superTextElementId||r.superTextElementId===""||(g.value=oe!==(r.superTextInit??""))}),(oe,H)=>{const V=Bp,D=Op,j=Mp,Y=Ap,J=bb,te=Tp,we=_p,le=Zq;return o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createVNode(we,{open:oe.open},{default:o.withCtx(()=>[o.createVNode(o.unref(e1),null,{default:o.withCtx(()=>[o.createVNode(o.unref(s1),{class:"!pointer-events-none bg-black/30"}),o.createVNode(te,{"is-overlay-transparent":"",class:"p-0 gap-0 !animate-none !transition-none max-w-max","as-child":""},{default:o.withCtx(()=>{var $e,Oe,We;return[o.createElementVNode("div",{class:"draggable-dialog fixed z-[70] pointer-events-auto",style:o.normalizeStyle({transform:`translate(${c.x}px, ${c.y}px)`,top:"0px",left:"auto",right:"15px"})},[o.createVNode(j,{class:"bg-blue-500 text-white p-2.5 rounded-t-[5px] cursor-move",onMousedown:o.withModifiers(v,["prevent"])},{default:o.withCtx(()=>[o.createVNode(V,null,{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(i)("editor.superinput")),1)]),_:1}),o.createVNode(D,{class:"absolute right-3 top-3 text-white",onClick:E},{default:o.withCtx(()=>[o.createVNode(o.unref(Ff),{class:"w-5 h-5"}),o.createElementVNode("span",Qq,o.toDisplayString(oe.$t("editor.close")),1)]),_:1})]),_:1}),o.createVNode(Y),o.createElementVNode("div",Nq,[o.createElementVNode("div",eK,[H[5]||(H[5]=o.createElementVNode("label",null," ",-1)),o.createElementVNode("div",tK,[o.createVNode(wn,{class:"text-[#65558F] bg-[#ECE6F0] hover:bg-[#ECE6F0]/90 shadow text-xs rounded font-normal h-[25px] px-3",onClick:H[0]||(H[0]=X=>u.value=!0)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(i)("editor.insert.symbol")),1)]),_:1}),o.createElementVNode("div",nK,[o.createVNode(p5,{id:"spellcheck",checked:o.unref(I),"onUpdate:checked":F},null,8,["checked"]),o.createElementVNode("label",rK,o.toDisplayString(o.unref(i)("editor.menubar.menu.spellCheck")),1)]),o.createElementVNode("div",oK,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(o.unref(A),X=>(o.openBlock(),o.createBlock(wn,{key:X,variant:"outline",size:"xs",class:"h-[25px] w-[25px] p-0",onClick:N=>B(X)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(X),1)]),_:2},1032,["onClick"]))),128))])]),u.value?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(($e=o.unref(_))==null?void 0:$e.component),{key:0,"custom-class":"!z-[70] !pointer-events-auto",class:o.normalizeClass((We=(Oe=o.unref(_))==null?void 0:Oe.componentProps)==null?void 0:We.class),onSelectedChar:L,onClose:H[1]||(H[1]=X=>u.value=!1)},null,40,["class"])):o.createCommentVNode("",!0)]),o.createElementVNode("div",iK,[o.createElementVNode("label",sK,o.toDisplayString(o.unref(i)("editor.detail")),1),o.createVNode(vb,{ref_key:"simpleEditorRef",ref:l,modelValue:s.value,"onUpdate:modelValue":H[2]||(H[2]=X=>s.value=X),"parent-editor":oe.editor,class:""},null,8,["modelValue","parent-editor"])]),o.createElementVNode("div",aK,[H[6]||(H[6]=o.createElementVNode("label",{class:"text-right text-sm p-2"},"ID",-1)),o.createVNode(fl,{modelValue:a.value,"onUpdate:modelValue":H[3]||(H[3]=X=>a.value=X),class:"rounded-none","default-value":a.value,disabled:""},null,8,["modelValue","default-value"])])]),o.createVNode(J,{class:"sm:justify-center pb-3.5 pt-1"},{default:o.withCtx(()=>[o.createVNode(wn,{as:"button",variant:"default",class:"bg-blue-500 hover:bg-blue-500/90",onClick:k},{default:o.withCtx(()=>[o.createVNode(o.unref(fg),{class:"w-5 h-5 mr-2"}),o.createTextVNode(" "+o.toDisplayString(o.unref(i)("editor.check")),1)]),_:1}),o.createVNode(wn,{as:"button",variant:"destructive",onClick:E},{default:o.withCtx(()=>[o.createVNode(o.unref(Ff),{class:"w-5 h-5 mr-2"}),o.createTextVNode(" "+o.toDisplayString(oe.$t("editor.close")),1)]),_:1})]),_:1})],4)]}),_:1})]),_:1})]),_:1},8,["open"]),o.createVNode(le,{open:m.value,onClose:x},null,8,["open"]),o.createVNode(le,{title:"Information",message:"{ 과 } 는 입력이 제한된 문자열 입니다.",iconName:"MessageCircleWarning",confirmText:"Ok",open:b.value,onClose:H[4]||(H[4]=$e=>b.value=!1)},null,8,["open"])],64)}}}),yb=o.defineComponent({__name:"SelectContextMenu",props:{editor:{},mode:{},superTextStore:{},disabled:{type:Boolean},disableSuperInput:{type:Boolean}},setup(t,{expose:e}){const n=t,{t:r}=Ot(),i=o.ref(!1),s=o.reactive({from:0,to:0,text:""}),a=o.inject("isEditable",o.ref(!0)),l=o.inject("canEditSuper",o.ref(!0)),u=o.computed(()=>n.mode===Re.EDITOR||n.mode===Re.PLAIN_TEXT||!l.value||n.disableSuperInput);function c(){if(!n.editor)return"";const{from:E,to:k}=n.editor.state.selection,x=n.editor.state.doc.cut(E,k),A=Nr.fromSchema(n.editor.schema).serializeFragment(x.content),T=document.createElement("div");return T.appendChild(A),T.innerHTML}const f=()=>{const{view:E}=n.editor,{from:k,to:x}=E.state.selection,_=c();s.text=_,s.from=k,s.to=x},p=()=>i.value=!i.value,m=()=>{u.value||(i.value=!0,f())},g=()=>i.value=!1,b=E=>{const k=n==null?void 0:n.superTextStore.addMoreSuperText(E);n.editor&&n.editor.commands.insertContentAt(s.from,{type:"superText",attrs:{"data-id":k,"data-text":E}}),i.value=!1,requestAnimationFrame(()=>{n.editor.commands.setTextSelection(s.from+1),n.editor.view.focus()})},v=o.ref(!1),w=async E=>{var k,x;if(E){const _=await((x=(k=n.editor).hasClipboard)==null?void 0:x.call(k));v.value=!!_}},C=()=>{if(u.value||!n.editor)return;const{view:E,state:k}=n.editor,{from:x,to:_}=k.selection;s.from=x,s.to=_,s.text="",E.dom.blur(),i.value=!0};return e({toggleDialog:p,openDialog:m,closeDialog:g}),(E,k)=>{const x=pc,_=gb,A=mb,T=hb,B=pb;return o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createVNode(x,{open:i.value,editor:E.editor,"super-text-init":s.text,onClose:p,onSave:b},null,8,["open","editor","super-text-init"]),o.createVNode(B,{"onUpdate:open":w},{default:o.withCtx(()=>[o.createVNode(_,{as:"template",class:"relative",disabled:o.unref(u),onDblclick:o.withModifiers(C,["prevent","stop"])},{default:o.withCtx(()=>[o.renderSlot(E.$slots,"default")]),_:3},8,["disabled"]),o.createVNode(T,null,{default:o.withCtx(()=>[E.disableSuperInput?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(A,{key:0,onSelect:m},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(r)("editor.inputSuper")),1)]),_:1})),o.unref(a)?(o.openBlock(),o.createBlock(A,{key:1,onSelect:k[0]||(k[0]=L=>{var I;return(I=E.editor)==null?void 0:I.commands.cutContent()})},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(r)("editor.cut")),1)]),_:1})):o.createCommentVNode("",!0),o.unref(a)?(o.openBlock(),o.createBlock(A,{key:2,onSelect:k[1]||(k[1]=L=>{var I;return(I=E.editor)==null?void 0:I.commands.copyContent()})},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(r)("editor.copy")),1)]),_:1})):o.createCommentVNode("",!0),o.unref(a)?(o.openBlock(),o.createBlock(A,{key:3,disabled:!v.value,onSelect:k[2]||(k[2]=L=>{var I;return(I=E.editor)==null?void 0:I.commands.pasteContent()})},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(r)("editor.paste")),1)]),_:1},8,["disabled"])):o.createCommentVNode("",!0)]),_:1})]),_:3})],64)}}});var ar=(t=>(t.TOGGLE_SUPER_TEXT="toggle-super-text",t.SUPER_TEXT_UPDATE_POSITION="SUPER_TEXT_UPDATE_POSITION",t.RENDER_SUPER_TEXT="RENDER_SUPER_TEXT",t.SUPER_VIEW_PAGE="SUPER_VIEW_PAGE",t.INCREASE_DECREASE_FONTSIZE="increase-decrease-fontsize",t))(ar||{});const lK={id:"editor-panel",class:"flex relative w-full h-full"},uK=Ao(o.defineComponent({__name:"PageNode",props:zs,setup(t){const{state:e,page:n,superTextStore:r}=Cn(),{size:i,pagination:s,margin:a}=n.value,l=o.ref(null),u=o.ref(t.node.attrs.viewSuperTextArea),c=o.computed(()=>u.value&&t.editor.storage.page.mode!=="editor"),f=o.computed(()=>t.editor.storage.page.mode===Re.REPORT),{width:p,height:m}=i,g=o.computed(()=>s?`calc(${m} - ${(a==null?void 0:a.top)??0} - ${(a==null?void 0:a.bottom)??0}`:"max-content"),b=ct.useEventBus(ar.SUPER_VIEW_PAGE);return o.watch(()=>t.node.attrs,v=>{b.emit(v.pageNumber)},{immediate:!0}),(v,w)=>{var E,k,x,_;const C=yb;return o.openBlock(),o.createBlock(o.unref(Hs),{id:v.node.attrs.id,ref_key:"containerRef",ref:l,"page-number":v.node.attrs.pageNumber,class:"overflow-hidden umo-page-node-view w-full border rounded-[3px] border-[#999999]",style:o.normalizeStyle({"--umo-page-margin-top":((E=o.unref(a))==null?void 0:E.top)??"0","--umo-page-margin-bottom":((k=o.unref(a))==null?void 0:k.bottom)??"0","--umo-page-margin-left":((x=o.unref(a))==null?void 0:x.left)??"0","--umo-page-margin-right":((_=o.unref(a))==null?void 0:_.right)??"0","--umo-page-width":o.unref(p),"--umo-page-height":o.unref(m),"--empty-node-left":"0px",left:100,"min-height":typeof o.unref(m)=="number"?`${o.unref(m)}px`:o.unref(m),height:f.value?typeof o.unref(m)=="number"?`${o.unref(m)}px`:o.unref(m):"auto"})},{default:o.withCtx(()=>[o.createElementVNode("div",lK,[o.createVNode(C,{mode:c.value?o.unref(Re).REPORT:o.unref(Re).EDITOR,editor:v.editor,"super-text-store":o.unref(r)},{default:o.withCtx(()=>[o.createVNode(o.unref(u6),{class:"umo-page-node-content",style:o.normalizeStyle({height:g.value})},null,8,["style"])]),_:1},8,["mode","editor","super-text-store"])])]),_:1},8,["id","page-number","style"])}}}),[["__scopeId","data-v-7d55d7ea"]]);function m5(t,e){const n=t.storedMarks??(t.selection.$to.parentOffset&&t.selection.$from.marks());if(n){const r=n.filter(i=>e==null?void 0:e.includes(i.type.name));t.tr.ensureMarks(r)}}const cK=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{const{selection:s,doc:a}=e,{$from:l,$to:u}=s,c=i.extensionManager.attributes,f=Ip(c,l.node().type.name,l.node().attrs);if(f.id=nb(),f.extend&&(f.extend=!1),s instanceof Pe&&s.node.isBlock)return!l.parentOffset||!hr(a,l.pos)?!1:(r&&(t&&m5(n,i.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;if(r){const p=u.parentOffset===u.parent.content.size;s instanceof Ae&&e.deleteSelection();const m=l.depth===0?void 0:c4(l.node(-1).contentMatchAt(l.indexAfter(-1)));let g=p&&m?[{type:m,attrs:f}]:void 0,b=hr(e.doc,e.mapping.map(l.pos),1,g);if(!g&&!b&&hr(e.doc,e.mapping.map(l.pos),1,m?[{type:m}]:void 0)&&(b=!0,g=m?[{type:m,attrs:f}]:void 0),b&&(g||(g=[{type:l.node().type,attrs:f}]),e.split(e.mapping.map(l.pos),1,g),m&&!p&&!l.parentOffset&&l.parent.type!==m)){const v=e.mapping.map(l.before()),w=e.doc.resolve(v);l.node(-1).canReplaceWith(w.index(),w.index()+1,m)&&e.setNodeMarkup(e.mapping.map(l.before()),m)}t&&m5(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},dK=t=>({tr:e,state:n,dispatch:r,editor:i})=>{var v;const s=mn(t,n.schema),{$from:a,$to:l}=n.selection,u=n.selection instanceof Pe?n.selection.node:null;if(u!=null&&u.isBlock||a.depth<2||!a.sameParent(l))return!1;const c=a.node(-1);if(c.type!==s)return!1;const f=i.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==s||a.index(-2)!==a.node(-2).childCount-1)return!1;if(r){let w=fe.empty;const C=a.index(-1)?1:a.index(-2)?2:3;for(let T=a.depth-C;T>=a.depth-3;T-=1)w=fe.from(a.node(T).copy(w));const E=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,k=Ip(f,a.node().type.name,a.node().attrs),x=((v=s.contentMatch.defaultType)==null?void 0:v.createAndFill(k))??void 0;w=w.append(fe.from(s.createAndFill(null,x)??void 0));const _=a.before(a.depth-(C-1));e.replace(_,a.after(-E),new Ee(w,4-C,0));let A=-1;e.doc.nodesBetween(_,e.doc.content.size,(T,B)=>{if(A>-1)return!1;T.isTextblock&&T.content.size===0&&(A=B+1)}),A>-1&&e.setSelection(Ae.near(e.doc.resolve(A))),e.scrollIntoView()}return!0}const p=l.pos===a.end()?c.contentMatchAt(0).defaultType:null,m=Ip(f,c.type.name,c.attrs),g=Ip(f,a.node().type.name,a.node().attrs);m.id=nb(),g.id=nb(),e.delete(a.pos,l.pos);const b=p?[{type:s,attrs:m},{type:p,attrs:g}]:[{type:s,attrs:m}];if(!hr(e.doc,a.pos,2))return!1;if(r){const{selection:w,storedMarks:C}=n,{splittableMarks:E}=i.extensionManager,k=C??(w.$to.parentOffset&&w.$from.marks());if(e.split(a.pos,2,b).scrollIntoView(),!k||!r)return!0;const x=k.filter(_=>E.includes(_.type.name));e.ensureMarks(x)}return!0},fK=[xp,Cp,Ep,rb,kp,cs,ib,kl,ab,ub,sb,ua,ds,fs,lb,cb,ob,Ur],pK=It.create({priority:200,name:`${Ur}`,content:"block*",group:`${Ur}`,isolating:!0,selectable:!1,draggable:!1,isLeaf:!0,addOptions(){return{SystemAttributes:{},nodesComputed:{},View:Us(uK),types:[],slots:{}}},addAttributes(){return{HTMLAttributes:{},id:{default:ui(10)},pageNumber:{default:1},force:{default:!1},viewSuperTextArea:{default:!0},slots:{default:this.options.slots,renderHTML:()=>({})}}},parseHTML(){return[{tag:`div[data-type="${this.name}"]`}]},renderHTML({node:t,HTMLAttributes:e}){return["div",{...vt(e),"data-type":this.name},0]},addCommands(){return{splitBlock:cK,splitListItem:dK,autoPaging:(t=!0)=>({tr:e,state:n,dispatch:r,editor:i})=>(r&&e.setMeta("runState",t),!0),setPageBreak:()=>({tr:t,state:e,dispatch:n,editor:r})=>(n&&t.setMeta("splitPage",!0),!0),togglePagePlugin:t=>({tr:e,dispatch:n})=>(e.setMeta("disablePage",t),n&&n(e),!0)}},addGlobalAttributes(){return[{types:fK.concat(this.options.types||[]),attributes:{id:{default:null},extend:{default:!1}}}]},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.first(({commands:r})=>[()=>r.undoInputRule(),()=>r.command(({tr:i})=>{const{selection:s,doc:a}=i,{empty:l,$anchor:u}=s,{pos:c,parent:f}=u,p=Ve.atStart(a).from===c;return!l||!p||!f.type.isTextblock||f.textContent.length?!1:r.clearNodes()}),()=>g5(r),()=>r.joinBackward(),()=>r.selectNodeBackward(),()=>r.command(({editor:i,tr:s})=>{const{selection:a,doc:l}=s,{$anchor:u}=a,{pos:c}=u;if(l.childCount===1)return!1;if(Ve.atEnd(l).from===c&&!u.parentOffset)return r.deleteNode(Ur);const f=ei(p=>p.type.name===Ur)(a);if(f){if(!f.node.firstChild)return r.deleteNode(Ur);const p=f.node.firstChild.type;if(f.start+Ve.atStart(f.node).from===c){const g=Ae.create(l,f.start-2,f.start-2),b=ei(v=>v.type.name===Ur)(g);if(b){const v=Ve.atEnd(b.node).from+b.start,w=Ae.create(l,v,v);if(p===b.node.lastChild.type){const{parent:C}=w.$anchor;return uq(C,i.schema)?s.setSelection(w):s.step(new pn(v,c,Ee.empty)),!0}s.setSelection(w)}return!0}}return!1})]),Delete:()=>this.editor.commands.first(({commands:r})=>[()=>g5(r),()=>r.command(({tr:i})=>{const{selection:s,doc:a}=i,{$anchor:l}=s,u=l.node(),c=ei(f=>f.type.name===kl)(s);return c&&c.start+Ve.atStart(c.node).from===l.pos&&c.node.childCount===1&&u.content.size===0?!0:r.joinForward()}),()=>r.selectNodeForward(),()=>r.command(({tr:i})=>{const{selection:s,doc:a}=i,{$anchor:l}=s,{pos:u}=l;if(a.childCount===1)return!1;if(Ve.atEnd(a).from===u)return r.deleteNode(Ur);const c=ei(f=>f.type.name===Ur)(s);if(c&&c.start+Ve.atEnd(c.node).from===u){const p=Ae.create(a,u+2,u+2),m=ei(g=>g.type.name===Ur)(p);if(m){const g=Ve.atStart(m.node).from+m.start,b=Ae.create(a,g,g);if(ei(w=>w.attrs.extend)(b))return i.step(new pn(u,g,Ee.empty)),!0}}return!1})]),Tab:()=>this.editor.commands.first(({commands:r})=>[()=>!0]),"Mod-Enter":()=>this.editor.commands.setPageBreak()}},addNodeView(){return this.options.View}});function Ip(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=t.find(s=>s.type===e&&s.name===r);return i?i.attribute.keepOnSplit:!1}))}const g5=t=>t.command(({tr:e})=>{const{selection:n,doc:r}=e,i=d4(r,{from:n.from,to:n.to},s=>s.type.name===kl);for(const s of i){const a=s.pos+s.node.nodeSize;if(n.from<s.pos||n.to>a)return!0}return t.deleteSelection()}),hK=Qe.create({name:"fontFamily",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:t=>t.style.fontFamily,renderHTML:t=>t.fontFamily?{style:`font-family: ${t.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:t=>({chain:e})=>e().setMark("textStyle",{fontFamily:t}).run(),unsetFontFamily:()=>({chain:t})=>t().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}}}),mK=["data-font"],gK=o.defineComponent({__name:"FontFamilyMenuButton",props:{editor:{},disabled:{type:Boolean,default:!1},color:{default:void 0},shortcutKeys:{default:void 0},maxHeight:{default:void 0},tooltip:{default:""},items:{default:()=>[]},customClass:{default:""},showDefaultDivider:{type:Boolean,default:!1}},setup(t){const e=t,n=o.computed(()=>e.editor.extensionStorage["base-kit"].mode===Re.EDITOR),{t:r}=Ot(),i=[{label:r("editor.fontFamily.gulim"),value:"Gulim"},{label:r("editor.fontFamily.dotum"),value:"Dotum"},{label:r("editor.fontFamily.gungsuh"),value:"Gungsuh"}],s=o.inject("fontFamily"),a=o.computed(()=>{const p=e.editor.extensionManager.extensions.find(g=>g.name==="fontFamily").options;return nt.isEmpty(p.fontFamilyMap)&&(p.fontFamilyMap=i),[{label:r("editor.fontFamily.default"),value:r("editor.fontFamily.default")},...p.fontFamilyMap]}),l=o.computed(()=>{const p={label:r("editor.fontFamily.default"),value:r("editor.fontFamily.default")};return n.value?e0(e.editor.state,"textStyle").fontFamily||p.value:s.value||p.value}),u=ct.useEventBus("fontFamily");function c(p){p.value===l.value||p.value===r("editor.fontFamily.default")?(e.editor.commands.unsetFontFamily(),s.value=null):(s.value=p.value,e.editor.commands.setFontFamily(p.value),u.emit()),e.editor.commands.setForceCloseBubble(!0)}e.editor.on("selectionUpdate",({editor:p})=>{p.state.selection.empty&&e.editor.commands.resetForceCloseBubble()});const f=o.computed(()=>{var p;return(p=a.value.find(m=>m.value===l.value))==null?void 0:p.label});return(p,m)=>(o.openBlock(),o.createBlock(ia,{disabled:p.disabled,tooltip:p.tooltip,title:f.value,btn_class:`min-w-20 ${p.customClass}`},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.value,(g,b)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:b},[o.createVNode(o.unref(wl),{checked:l.value===g.value,onClick:v=>c(g)},{default:o.withCtx(()=>[o.createElementVNode("span",{class:"ml-1 h-full","data-font":g.label,style:o.normalizeStyle({fontFamily:g.value??void 0})},o.toDisplayString(g.label),13,mK)]),_:2},1032,["checked","onClick"]),g.label===o.unref(r)("editor.fontFamily.default")&&p.showDefaultDivider?(o.openBlock(),o.createBlock(o.unref(mg),{key:0})):o.createCommentVNode("",!0)],64))),128))]),_:1},8,["disabled","tooltip","title","btn_class"]))}}),b5=hK.extend({name:"fontFamily",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),types:["textStyle"],fontFamilyMap:[],button({editor:e,extension:n,t:r}){return{component:gK,componentProps:{editor:e,disabled:!e.can().setFontFamily(""),tooltip:r("editor.fontFamily.tooltip")}}}}},addGlobalAttributes(){return[{types:["paragraph","heading","textStyle"],attributes:{style:{default:null,parseHTML:t=>t.style.fontFamily||null,renderHTML:t=>t.style?{style:`font-family: ${t.style}`}:{}},fontFamily:{default:null,parseHTML:t=>t.style.fontFamily.replace(/['"]/g,""),renderHTML:t=>t.fontFamily?{style:`font-family: ${t.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:t=>({chain:e})=>e().setMark("textStyle",{fontFamily:t}).run(),unsetFontFamily:()=>({chain:t})=>t().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}},addStorage(){return{value:null}},onUpdate(){this.storage.value=this.editor.getAttributes("textStyle").fontFamily}}),bK={class:"flex gap-2"},vK=["disabled"],yK=Ao(o.defineComponent({__name:"FontSizeIncreaseDecrease",props:{editor:Object},setup(t){const e=o.inject("fontSize"),n=o.computed(()=>e.value?parseInt(e.value)===parseInt(T0[0])||parseInt(e.value)<parseInt(T0[0]):!1),r=ct.useEventBus(ar.INCREASE_DECREASE_FONTSIZE),i=s=>{r.emit(s)};return(s,a)=>{const l=ml,u=hl,c=gl;return o.openBlock(),o.createElementBlock("div",bK,[o.createVNode(c,null,{default:o.withCtx(()=>[o.createVNode(u,{"delay-duration":0},{default:o.withCtx(()=>[o.createVNode(l,null,{default:o.withCtx(()=>[o.createElementVNode("button",{class:"btn",onClick:a[0]||(a[0]=f=>i(!0))},[o.createVNode(o.unref(Tt),{name:"Plus",class:"w-6 h-6"})])]),_:1}),o.createVNode(o.unref(ta),null,{default:o.withCtx(()=>a[2]||(a[2]=[o.createTextVNode(" 글꼴 크기 크게 ")])),_:1})]),_:1})]),_:1}),o.createVNode(c,null,{default:o.withCtx(()=>[o.createVNode(u,{"delay-duration":0},{default:o.withCtx(()=>[o.createVNode(l,null,{default:o.withCtx(()=>[o.createElementVNode("button",{class:"btn",onClick:a[1]||(a[1]=f=>i(!1)),disabled:o.unref(n)},[o.createVNode(o.unref(Tt),{name:"Minus",class:"w-6 h-6"})],8,vK)]),_:1}),o.createVNode(o.unref(ta),null,{default:o.withCtx(()=>a[3]||(a[3]=[o.createTextVNode(" 글꼴 크기 작게 ")])),_:1})]),_:1})]),_:1})])}}}),[["__scopeId","data-v-250d04b3"]]),wK=Dn.create({name:"fontSizeIncreaseDecrease",addOptions(){return{defaultSize:"14px",button({editor:t}){return{component:yK,componentProps:{editor:t}}}}},addAttributes(){return{size:{default:this.options.defaultSize,parseHTML:t=>t.style.fontSize||this.options.defaultSize,renderHTML:t=>t.size?{style:`font-size: ${t.size}`}:{}}}},addCommands(){return{setFontSizeIncreaseDecrease:t=>({commands:e})=>e.setMark("textStyle",{fontSize:t})}}}),wb=Qe.create({name:"painter",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,extension:n,t:r})=>({component:Ke,componentProps:{action:()=>{e.commands.setPainter(e==null?void 0:e.state.selection.$head.marks())},icon:"PaintRoller",tooltip:r("editor.format")}})}},addCommands(){return{setPainter:t=>({view:{dispatch:e,state:{tr:n},dom:r}})=>{const a=`url("data:image/svg+xml;utf8,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="#000" d="M9 22v-6H4V7q0-1.65 1.175-2.825T8 3h12v13h-5v6zM6 10h12V5h-1v4h-2V5h-1v2h-2V5H8q-.825 0-1.412.588T6 7zm0 4h12v-2H6zm0 0v-2z"/></svg>')}"), auto`;return r.style.cursor=a,e(n.setMeta("painterAction",{type:"start",marks:t})),!0}}},addProseMirrorPlugins(){return[new tt({key:new kt("format-painter"),state:{init:()=>[],apply:(t,e)=>{const n=t.getMeta("painterAction");return n&&n.type==="start"?e=n.marks:n&&n.type==="end"&&(e=[]),e}},props:{handleDOMEvents:{mousedown(t,e){const n=this.getState(t.state);if(!n||n.length==0)return t.dom.style.cursor="",!1;const r=()=>{document.removeEventListener("mouseup",r);const{dispatch:i,state:{selection:s},dom:a}=t;let l=t.state.tr;a.style.cursor="",l=l.removeMark(s.from,s.to);for(const u of n)u.type.name!="link"&&(l=l.addMark(s.from,s.to,u));i(l.setMeta("painterAction",{type:"end"}))};return document.addEventListener("mouseup",r),!0}}}})]}}),Cb=()=>ui(10),v5=new kt("attrkey"),CK=t=>new tt({key:v5,state:{init:()=>!1,apply:n=>n.getMeta("initSplit")},appendTransaction(n,r,i){const{tr:s}=i;let a=!1;const l=v5.getState(i);if(n.some(c=>c.getMeta("composition")))return null;if(l||n.some(c=>c.docChanged)){const c=[];i.doc.descendants((f,p,m,g)=>{const{attrs:b}=f,v=c.includes(b.id)?Cb():b.id||Cb();t.includes(f.type.name)&&(s.setNodeMarkup(p,void 0,{...b,id:v,"number-line":g+1}),a=!0),c.push(v)})}return a?s:null}}),y5=[xp,Cp,Ep,rb,kp,cs,ib,kl,ab,ub,sb,ua,ds,fs,lb,cb,ob,Ur],xK=Qe.create({name:"autoId",addGlobalAttributes(){return[{types:y5.concat(this.options.types||[]),attributes:{id:{default:Cb()},extend:{default:!1},class:{default:null},"number-line":{default:null}}}]},addProseMirrorPlugins(){return[CK(y5.concat(this.options.types||[]))]}}),EK=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,kK=It.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",vt(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[v4({find:EK,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}}),SK=["src","alt"],_K={key:0,class:"image-resizer"},TK=["onMousedown","onTouchstart"],AK=o.defineComponent({__name:"ImageView",props:{...zs,selected:{type:Boolean,required:!0}},setup(t){const e=t,n={TOP_LEFT:"tl",TOP_RIGHT:"tr",BOTTOM_LEFT:"bl",BOTTOM_RIGHT:"br"},r=o.ref({width:d6,height:d6}),i=o.ref({width:0,height:0}),s=o.ref(!1),a=o.ref({x:0,y:0,w:0,h:0,dir:""}),l=o.computed(()=>{const{src:k,alt:x,width:_,height:A,flipX:T,flipY:B}=e.node.attrs,L=[];T&&L.push("rotateX(180deg)"),B&&L.push("rotateY(180deg)");const I=L.join(" ");return{src:k||void 0,alt:x||void 0,style:{width:A0(_)?`${_}px`:_,height:A0(A)?`${A}px`:A,transform:I||"none"}}});o.computed(()=>({width:o.unref(l).style.width==="100%"?"100%":void 0}));const u=o.ref(null),c=new ResizeObserver(k=>{for(const x of k){const{width:_,height:A}=x.contentRect;i.value={width:_,height:A},e.updateAttributes({originWidth:_,originHeight:A})}});function f(){const{editor:k,getPos:x}=e;k.commands.setNodeSelection(x())}const p=nt.throttle(()=>{const{editor:k}=e;r.value.width=parseInt(getComputedStyle(k.view.dom).width,10)},f6);function m(k,x){k.preventDefault(),k.stopPropagation();let _=0,A=0;const T=document.querySelector(".image-resizer");if(T&&(T.style.borderColor="#3b82f6"),"touches"in k&&k.touches.length>0)_=k.touches[0].clientX,A=k.touches[0].clientY;else if("clientX"in k)_=k.clientX,A=k.clientY;else return;const{width:B,height:L}=o.unref(i),I=B/L;let F=Number(e.node.attrs.width)||B,U=Number(e.node.attrs.height)||Math.round(F/I);const ie=o.unref(r).width;F=Math.min(F>ie?ie:F,ie),U=Math.round(F/I),Object.assign(a.value,{x:_,y:A,w:F,h:U,dir:x}),s.value=!0,v()}const g=nt.throttle(k=>{if(!o.unref(s))return;let x=0;if("touches"in k&&k.touches.length>0)x=k.touches[0].clientX;else if("clientX"in k)x=k.clientX;else return;const{x:_,w:A,dir:T}=o.unref(a),B=(x-_)*(/l/.test(T)?-1:1),L=XB(A+B,HB,o.unref(r).width);e.updateAttributes({width:L})},f6),b=k=>{k.preventDefault(),k.stopPropagation();const x=document.querySelector(".image-resizer");x&&(x.style.borderColor=""),o.unref(s)&&(s.value=!1,Object.assign(a.value,{x:0,y:0,w:0,h:0,dir:""}),w(),f())};function v(){document.addEventListener("mousemove",g,!0),document.addEventListener("mouseup",b,!0),document.addEventListener("touchmove",g,!0),document.addEventListener("touchend",b,!0)}function w(){document.removeEventListener("mousemove",g,!0),document.removeEventListener("mouseup",b,!0),document.removeEventListener("touchmove",g,!0),document.removeEventListener("touchend",b,!0)}const C=new ResizeObserver(p),E=o.computed(()=>{const{textAlign:k}=e.node.attrs;return{left:"margin-right: auto;",right:"margin-left: auto;",center:"margin-left: auto; margin-right: auto;"}[k]||""});return o.onMounted(()=>{u.value&&c.observe(u.value),C.observe(e.editor.view.dom)}),o.onBeforeUnmount(()=>{w(),c.disconnect(),C.disconnect()}),(k,x)=>(o.openBlock(),o.createBlock(o.unref(Hs),{class:"node-image"},{default:o.withCtx(()=>[o.createElementVNode("div",{class:"image-view",style:o.normalizeStyle([{width:l.value.style.width,height:l.value.style.height},E.value])},[o.createElementVNode("div",{draggable:"true","data-drag-handle":"",class:o.normalizeClass([{"image-view__body--focused":t.selected,"image-view__body--resizing":s.value},"image-view__body"])},[o.createElementVNode("img",{ref_key:"imageRef",ref:u,src:l.value.src,alt:l.value.alt,class:"block w-full image-view__body__image",style:o.normalizeStyle([{transform:l.value.style.transform}]),onClick:f},null,12,SK),k.editor.view.editable?o.withDirectives((o.openBlock(),o.createElementBlock("div",_K,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.values(n),_=>(o.openBlock(),o.createElementBlock("span",{key:_,class:o.normalizeClass([`image-resizer__handler--${_}`,"image-resizer__handler"]),onMousedown:A=>m(A,_),onTouchstart:o.withModifiers(A=>m(A,_),["prevent"])},null,42,TK))),128))],512)),[[o.vShow,t.selected||s.value]]):o.createCommentVNode("",!0)],2)],4)]),_:1}))}}),MK=Ao(AK,[["__scopeId","data-v-6435a6f3"]]),xb=kK.extend({group:"block",defining:!0,isolating:!0,addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),flipX:{default:!1},flipY:{default:!1},originWidth:{default:null},originHeight:{default:null},textAlign:{default:"left",parseHTML:e=>e.style.textAlign||e.getAttribute("textAlign")||null,renderHTML:e=>({textAlign:e.textAlign})},width:{default:"100%",parseHTML:e=>{const n=e.style.width||e.getAttribute("width")||null;return n&&n.endsWith("%")?n:n==null?null:parseInt(n,10)},renderHTML:e=>({width:e.width})},class:{default:"",parseHTML:e=>e.getAttribute("class")||"",renderHTML:e=>({class:e.class})},"data-memo":{default:"",parseHTML:e=>e.getAttribute("data-memo")||"",renderHTML:e=>({"data-memo":e["data-memo"]})}}},addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this)}},addNodeView(){return Us(MK)},addCommands(){var t;return{...(t=this.parent)==null?void 0:t.call(this),updateImage:e=>({commands:n,editor:r})=>n.updateAttributes(this.name,e)}},renderHTML({node:t,HTMLAttributes:e}){const{textAlign:n,flipX:r,flipY:i}=t.attrs,l=`${{left:"margin-right: auto;",right:"margin-left: auto;",center:"margin-left: auto; margin-right: auto;"}[n]||""} ${r||i?`transform: rotateX(${r?"180":"0"}deg) rotateY(${i?"180":"0"}deg);`:""}`;return["img",vt({height:"auto",style:l},this.options.HTMLAttributes,e)]},parseHTML(){return[{tag:"img[src]"}]},addProseMirrorPlugins(){return[new tt({props:{handleTextInput(t){const{selection:e}=t.state;return e instanceof Pe&&e.node.type.name==="image"},handlePaste(t){const{selection:e}=t.state;return e instanceof Pe&&e.node.type.name==="image"}}})]}}),OK=["paragraph","heading","list_item","todo_item"];function BK(t,e){const{selection:n,doc:r}=t;if(!n||!r||!(n instanceof Ae||n instanceof Rn))return t;const{from:i,to:s}=n,a=[],l=e&&e!==p6?e:null;return r.nodesBetween(i,s,(u,c)=>{const f=u.type;return OK.includes(f.name)?((u.attrs.lineHeight||null)!==l&&a.push({node:u,pos:c,nodeType:f}),f.name!=="list_item"&&f.name!=="todo_item"):!0}),a.length&&a.forEach(u=>{const{node:c,pos:f,nodeType:p}=u;let{attrs:m}=c;m={...m,lineHeight:l},t=t.setNodeMarkup(f,p,m,c.marks)}),t}function IK(t){return({state:e,dispatch:n})=>{const{selection:r}=e;let{tr:i}=e;return i=i.setSelection(r),i=BK(i,t),i.docChanged?(n&&n(i),!0):!1}}const RK=o.defineComponent({__name:"LineHeightDropdown",props:{editor:{},icon:{default:void 0},tooltip:{default:void 0},disabled:{type:Boolean,default:!1},action:{type:Function,default:void 0},isActive:{type:Function,default:void 0}},setup(t){const{t:e}=Ot();function n(l){return parseFloat(l.replace("%",""))/100}const r=o.computed(()=>{const c=s.editor.extensionManager.extensions.find(f=>f.name==="lineHeight").options.lineHeights.map(f=>({label:n(f),value:f}));return c.unshift({label:o.unref(e)("editor.default"),value:"default"}),c}),i=o.ref("default"),s=t;function a(l){l==="default"?s.editor.commands.unsetLineHeight():s.editor.commands.setLineHeight(l),i.value=l}return(l,u)=>(o.openBlock(),o.createBlock(ia,{icon:l.icon,tooltip:l.tooltip,disabled:l.disabled},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.value,(c,f)=>(o.openBlock(),o.createBlock(o.unref(wl),{key:f,checked:c.value===i.value,onClick:p=>a(c.value)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(c.label),1)]),_:2},1032,["checked","onClick"]))),128))]),_:1},8,["icon","tooltip","disabled"]))}}),w5=Qe.create({name:"lineHeight",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),types:["paragraph","heading","list_item","todo_item"],lineHeights:["100%","115%","150%","200%","250%","300%"],defaultHeight:p6,button({editor:e,t:n}){return{component:RK,componentProps:{editor:e,icon:"LineHeight",tooltip:n("editor.lineheight.tooltip")}}}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:t=>t.style.lineHeight||this.options.defaultHeight,renderHTML:t=>t.lineHeight===this.options.defaultHeight||!t.lineHeight?{}:{style:`line-height: ${t.lineHeight}`}}}}]},addCommands(){return{setLineHeight:t=>IK(t),unsetLineHeight:()=>({commands:t})=>this.options.types.every(e=>t.resetAttributes(e,"lineHeight"))}}}),LK=It.create({name:"column",content:"block+",isolating:!0,addAttributes(){return{position:{default:"",parseHTML:t=>t.getAttribute("data-position"),renderHTML:t=>({"data-position":t.position})}}},renderHTML({HTMLAttributes:t}){return["div",vt(t,{"data-type":"column"}),0]},parseHTML(){return[{tag:'div[data-type="column"]'}]}});var ca=(t=>(t.SidebarLeft="sidebar-left",t.SidebarRight="sidebar-right",t.TwoColumn="two-column",t))(ca||{});const Eb=It.create({name:"columns",group:"columns",content:"column+",defining:!0,isolating:!0,addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),layout:"two-column"}},addAttributes(){return{layout:{default:"two-column"}}},addCommands(){return{setColumns:()=>({commands:t})=>(t.insertContent('<div data-type="columns"><div data-type="column" data-position="left"><p></p></div><div data-type="column" data-position="right"><p></p></div></div>'),!0),setLayout:t=>({commands:e})=>e.updateAttributes("columns",{layout:t})}},renderHTML({HTMLAttributes:t}){return["div",{"data-type":"columns",class:`layout-${t.layout}`},0]},parseHTML(){return[{tag:'div[data-type="columns"]'}]},addExtensions(){return[LK.configure(this.options.columnOptions)]}});function PK(t){let e=t;for(;e&&e!==document.body;){if(e.nodeType===1){const n=e;if(n.id==="editor-panel")return n}e=e.parentNode}return null}const Rp=t=>{var n;if(!t)return!0;const e=document.createElement("div");return e.innerHTML=t,((n=e==null?void 0:e.textContent)==null?void 0:n.trim())===""},DK=t=>{if(!t)return"";const{from:e,to:n}=t.state.selection,r=t.state.doc.cut(e,n),s=Nr.fromSchema(t.schema).serializeFragment(r.content),a=document.createElement("div");return a.appendChild(s),a.innerHTML},C5=8;function VK(t,e){const n=o.ref(!1);let r=!1,i=null,s=null,a=null,l=null,u=0,c=0;function f(E){const k=E.cloneNode(!0);return k.style.position="fixed",k.style.pointerEvents="none",k.style.opacity="0.9",k.style.zIndex="9999",k.style.transform="translate(-50%, -50%)",k.style.left="0px",k.style.top="0px",document.body.appendChild(k),k}function p(){s&&s.parentElement&&s.parentElement.removeChild(s),s=null}function m(){try{if(typeof t.getPos=="function"){const E=t.getPos();if(typeof E=="number"&&E>=0)return E}}catch{}return null}function g(E,k){n.value||(l=m(),document.body.style.userSelect="none",document.body.style.touchAction="none",k&&(s=f(k),s.style.left=`${E.clientX}px`,s.style.top=`${E.clientY}px`),n.value=!0,r=!1,a=null)}function b(){i=null,l=null,a=null,r=!1,n.value=!1,p(),document.body.style.userSelect="",document.body.style.touchAction=""}function v(E){if(o.unref(e)||n.value)return;const k=E.changedTouches[0];i=k.identifier,u=k.clientX,c=k.clientY,r=!0,l=null,a=null}function w(E){var T;if(!r&&!n.value||i===null)return;const k=Array.from(E.changedTouches).find(B=>B.identifier===i);if(!k)return;const x=k.clientX-u,_=k.clientY-c,A=x*x+_*_;if(!n.value&&r&&A>=C5*C5){const B=E.currentTarget||E.target||null;g(k,B)}if(n.value){s&&(s.style.left=`${k.clientX}px`,s.style.top=`${k.clientY}px`);try{const B=(T=t.editor)==null?void 0:T.view;if(!B){a=null;return}const L=B.posAtCoords({left:k.clientX,top:k.clientY});L&&typeof L.pos=="number"?a=L.pos:a=null}catch{a=null}}}async function C(E){var k;if(n.value){if(document.body.style.userSelect="",document.body.style.touchAction="",p(),n.value=!1,l===null||a===null){b();return}const x=(k=t.editor)==null?void 0:k.view;if(!x){b();return}const _=x.state.doc.nodeAt(l);if(!_){b();return}const A=_.nodeSize,T=l,B=T+A,L=a;if(L>=T&&L<=B){b();return}let I=L;L>T&&(I=L-A);const F=x.state.doc.content.size;I<0&&(I=0),I>F&&(I=F);const U=_.type.create(_.attrs),ie=x.state.tr;ie.delete(T,B),ie.insert(I,U),x.dispatch(ie),b();return}if(r){b();return}}return{onTouchStart:v,onTouchMove:w,onTouchEnd:C}}function FK(...t){return _v(Yh(t))}const $K=["innerHTML"],HK=["book-mark-node-id","book-mark-content","node-id","element-id","line-id"],zK=o.defineComponent({__name:"SuperText",props:zs,setup(t){const e=t,n=o.ref(!1),r=o.inject("isMobile",!1),i=o.computed(()=>e.editor.storage.superText.enable),s=ct.useEventBus(ar.RENDER_SUPER_TEXT),{onTouchStart:a,onTouchMove:l,onTouchEnd:u}=VK(e,i),c=o.computed(()=>{const x=e.getPos(),_=e.editor.state.doc.resolve(x);for(let A=_.depth;A>0;A--){const T=_.node(A);if(T.type.name==="paragraph")return T}return null}),f=o.computed(()=>{var x;return((x=c.value)==null?void 0:x.attrs.id)||""}),p=o.inject("canEditSuper",o.ref(!0)),m=()=>{s.emit({action:"render"})};function g(x){var I,F;if(Rp(x)){w();return}const _=e.getPos(),A=(I=e.editor)==null?void 0:I.state.doc.nodeAt(_),T=x.trim(),{[Ne.ELEMENT_ID]:B,...L}=(A==null?void 0:A.attrs)||{};(F=e.editor)==null||F.view.dispatch(e.editor.state.tr.setNodeMarkup(_,void 0,{...L,[Ne.TEXT]:T})),requestAnimationFrame(()=>{e.editor.commands.setTextSelection(_+1),e.editor.view.focus()})}function b(x){const _=e.node.attrs[Ne.TEXT],A=e.node.attrs[Ne.ID],B={lineId:x.target.querySelector(`[node-id="${A}"]`).getAttribute("line-id"),dataId:A,text:_};s.emit({action:"hover",payload:B})}function v(x){const _=e.node.attrs[Ne.ID],T={lineId:x.target.querySelector(`[node-id="${_}"]`).getAttribute("line-id"),dataId:_,text:""};s.emit({action:"hover",payload:T})}function w(){const{getPos:x,node:_,editor:A}=e,T=x(),B=T+1;A.commands.deleteRange({from:T,to:B})}function C(){if(!p.value)return;const{attributes:x}=e.editor.options.editorProps;if(x&&x.id===or.COMMENT){const _=document.getElementById(or.COMMENT);if((_==null?void 0:_.getAttribute(or.DISABLE_SUPER_INPUT))==="true")return}e.editor.view.dom.blur(),n.value=!0}function E(){e.editor.commands.setSuperTextContent(e.node.attrs[Ne.TEXT],e.node.attrs[Ne.POSITION]),e.editor.commands.toggleSuperInputMoblie()}o.watch(i,x=>{e.editor.setEditable(!x),x?e.editor.view.dom.classList.add("super-text-view-mode"):e.editor.view.dom.classList.remove("super-text-view-mode")});const k=o.computed(()=>`{${e.node.attrs[Ne.TEXT].replace(/<\/p>\s*<p>/g,"<br/>").replace(/<\/?p[^>]*>/g,"").trim()}}`);return(x,_)=>{const A=wn,T=gb,B=mb,L=hb,I=pb,F=pc;return o.openBlock(),o.createBlock(o.unref(Hs),{as:"span",class:o.normalizeClass(o.unref(FK)("text-inherit super-text shrink-0 inline-flex items-center justify-center",o.unref(r)&&i.value&&"block")),"data-drag-handle":"",draggable:o.unref(p),onDragend:m,onPointerdown:_[2]||(_[2]=o.withModifiers(()=>{},["stop"])),onTouchstartPassive:o.unref(a),onTouchmovePassive:o.unref(l),onTouchendPassive:o.unref(u),onTouchcancelPassive:o.unref(u)},{default:o.withCtx(()=>[o.unref(r)&&!i.value?(o.openBlock(),o.createElementBlock("button",{key:0,onClick:o.withModifiers(E,["stop"]),class:"w-5 inline-flex justify-center rounded text-ed-red-500 active:bg-ed-accent"},[o.createVNode(o.unref(Tt),{name:"fileEdit2"})])):o.createCommentVNode("",!0),o.unref(r)&&i.value?(o.openBlock(),o.createElementBlock("div",{key:1,innerHTML:k.value,onClick:o.withModifiers(E,["stop"]),class:"super-text-view-mode-item"},null,8,$K)):o.createCommentVNode("",!0),o.unref(r)?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(I,{key:2},{default:o.withCtx(()=>[o.createVNode(T,{as:"template",class:"relative",disabled:!o.unref(p)},{default:o.withCtx(()=>[o.createVNode(A,{class:o.normalizeClass([{"pointer-events-none":!o.unref(p)},"!p-0 !m-0 !h-fit"]),variant:"ghost",onDblclick:o.withModifiers(C,["stop"]),onMouseenter:b,onMouseleave:v},{default:o.withCtx(()=>[o.createVNode(o.unref(Tt),{name:"fileEdit"}),o.createElementVNode("div",{ref:"bookMarkRef","book-mark-node-id":e.node.attrs[o.unref(Ne).ID],"book-mark-content":e.node.attrs[o.unref(Ne).TEXT],"node-id":e.node.attrs[o.unref(Ne).ID],"element-id":e.node.attrs[o.unref(Ne).ELEMENT_ID],"line-id":f.value},null,8,HK)]),_:1},8,["class"])]),_:1},8,["disabled"]),o.createVNode(L,null,{default:o.withCtx(()=>[o.createVNode(B,{onSelect:_[0]||(_[0]=U=>n.value=!0)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(x.$t("editor.super.edit")),1)]),_:1}),o.createVNode(B,{onSelect:w},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(x.$t("editor.super.delete")),1)]),_:1})]),_:1})]),_:1})),o.unref(r)?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(F,{key:3,open:n.value,editor:e.editor,"super-text-init":e.node.attrs[o.unref(Ne).TEXT],"super-text-element-id":e.node.attrs[o.unref(Ne).ELEMENT_ID],onClose:_[1]||(_[1]=U=>n.value=!1),onSave:g},null,8,["open","editor","super-text-init","super-text-element-id"]))]),_:1},8,["class","draggable","onTouchstartPassive","onTouchmovePassive","onTouchendPassive","onTouchcancelPassive"])}}}),UK=new tt({props:{handleKeyDown(t,e){var n;if(e.key==="Backspace"){const{state:r,dispatch:i}=t,{$from:s}=r.selection;if(s.parentOffset===1){const u=s.nodeAfter;if(u&&u.type.name==="superText"){const c=r.tr;c.delete(s.pos-1,s.pos);const f=r.schema.text("");return c.insert(s.pos-1,fe.from(f)),c.setSelection(Ae.create(c.doc,s.pos)),i(c),e.preventDefault(),!0}}const a=s.nodeBefore,l=s.nodeAfter;if(a&&a.isText&&((n=a.text)==null?void 0:n.length)===1&&l&&l.type.name==="superText"){const u=s.parent.childBefore(s.parentOffset-1).node;if(u&&u.type.name==="superText"){const c=r.tr;return c.delete(s.pos-1,s.pos),c.setSelection(Ae.create(c.doc,s.pos-1)),i(c),e.preventDefault(),!0}}}return!1}}}),WK=new tt({appendTransaction(t,e,n){const r=new Set;let i=n.tr,s=!1;return n.doc.descendants((a,l)=>{if(a.type.name===hc){const u=a.attrs[Ne.ID];if(!u||r.has(u)){const c=ui();i=i.setNodeMarkup(l,void 0,{...a.attrs,[Ne.ID]:c}),s=!0,r.add(c)}else r.add(u)}}),s?i:null}}),hc="superText",x5={UPDATE:"superTextUpdate"},E5=It.create({name:"superText",inline:!0,group:"inline",selectable:!1,defining:!0,draggable:!0,addStorage(){return{enable:!0,isShowSuperInputMoblie:!1,view:!0,items:[],toggleSuperViewMobileCallBack:this.options.toggleSuperViewMobileCallBack,bottomSheetComponent:this.options.bottomSheetComponent,addToast:this.options.addToast,superTextContent:"",superTextPosition:""}},addOptions(){return{specialCharModal:null,button:({editor:t,t:e,isMobile:n})=>n?[{component:Ke,componentProps:{action:()=>{t.commands.toggleSuperInputMoblie()},isActive:()=>{},icon:"fileEdit",title:e("editor.menubar.menu.insertSuper"),tooltip:e("editor.menubar.menu.insertSuper"),customClass:"whitespace-nowrap !bg-ed-blue active:!bg-ed-blue/90 !transition-none !text-white !font-normal rounded-[3px] h-[26px] ml-auto",customClassTooltip:"ml-auto"}}]:[{component:Ke,componentProps:{action:()=>t.commands.toggleSuperTextView(),isActive:()=>t.storage.superText.enable,title:e("editor.menubar.menu.superView"),customClass:`whitespace-nowrap !text-white !font-normal rounded-[3px] h-[26px]
|
|
330
|
+
`){ie.push(U),U="";continue}if(U+=H,k.measureText(U).width>I())for(;k.measureText(U).width>I();){const V=F(U,I());V<=0?(ie.push(U.charAt(0)),U=U.slice(1)):(ie.push(U.slice(0,V)),U=U.slice(V))}}return ie.push(U),ie.map(H=>`<p>${H}</p>`).join("")}const{isScrolling:_,handleScroll:A}=Ol();return e({insertSpecialCharater:m,isChecked:u,toggleSpellCheck:g,wrapText:x,editor:p}),(T,B)=>(o.openBlock(),o.createElementBlock("div",{ref_key:"contentInner",ref:b,style:o.normalizeStyle(o.unref(C)),onScroll:B[0]||(B[0]=(...L)=>o.unref(A)&&o.unref(A)(...L)),class:o.normalizeClass(o.unref(xe)("h-40 overflow-y-auto border focus-within:border-ed-input-focus rounded-[3px] p-2.5",T.isReadOnly&&"border-none",o.unref(s)&&"h-auto min-h-20 max-h-44 border-ed-gray rounded-md px-4 py-2.5",o.unref(s)&&!o.unref(_)&&"scrollbar-thumb-transparent"))},[o.createVNode(o.unref(Xn),{id:"editor-panel",editor:o.unref(p),class:o.normalizeClass(o.unref(xe)("vdc-editor relative h-full"))},null,8,["editor","class"])],38))}}),Qq={class:"sr-only"},Nq={class:"grid m-2.5 p-2.5 gap-y-2.5 rounded border border-gray-200"},eK={class:"grid grid-cols-[70px,1fr] gap-x-2"},tK={class:"flex gap-x-7"},nK={class:"flex items-center space-x-2 text-xs font-normal"},rK={for:"spellcheck",class:"select-none whitespace-nowrap"},oK={class:"flex gap-x-1"},iK={class:"grid grid-cols-[70px,1fr] gap-x-2"},sK={class:"text-right text-sm p-2"},aK={class:"grid grid-cols-[70px,1fr] gap-x-2"},pc=o.defineComponent({__name:"SuperInputDialog",props:{editor:{},open:{type:Boolean},superTextInit:{},superTextElementId:{}},emits:["close","save"],setup(t,{emit:e}){var U,ie;const n=e,r=t,{t:i}=Ot(),s=o.ref(""),a=o.ref(""),l=o.ref(null),u=o.ref(!1),c=o.reactive({x:0,y:0}),f=o.ref(!1),p={x:0,y:0},m=o.ref(!1),g=o.ref(!1),b=o.ref(!1),v=oe=>{f.value=!0,p.x=oe.clientX-c.x,p.y=oe.clientY-c.y,document.addEventListener("mousemove",w),document.addEventListener("mouseup",C)},w=oe=>{f.value&&(c.x=oe.clientX-p.x,c.y=oe.clientY-p.y)},C=()=>{f.value=!1,document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",C)};o.watch(()=>r.open,async oe=>{if(oe){g.value=!1,r.superTextInit&&(s.value=r.superTextInit,r.superTextElementId&&(a.value=r.superTextElementId)),await o.nextTick();const H=document.querySelector(".draggable-dialog");if(H){const{width:V,height:D}=H.getBoundingClientRect(),j=window.innerHeight;c.x=0,c.y=(j-D)/2}}},{immediate:!0});const E=()=>{n("close"),s.value="",a.value="",u.value=!1},k=()=>{var H;if((H=l.value)==null?void 0:H.editor.commands.hasInvalidChar()){b.value=!0;return}s.value=l.value.wrapText(),a.value="",g.value?m.value=!0:n("close"),n("save",s.value),s.value=""},x=()=>{m.value=!1,n("close")},_=(ie=(U=r.editor)==null?void 0:U.extensionManager.extensions.find(oe=>oe.name==="superText"))==null?void 0:ie.options.specialCharModal,A=ct.useLocalStorage("recentSpecialChars",[]),T=oe=>{if(!oe)return;const H=(A.value??[]).filter(V=>V!==oe);H.unshift(oe),A.value=H.slice(0,5)},B=oe=>{var H;(H=l.value)==null||H.insertSpecialCharater(oe)},L=(oe,H)=>{var V;H&&((V=l.value)==null||V.insertSpecialCharater(oe),T(oe))},I=o.computed(()=>{var oe;return(oe=l.value)==null?void 0:oe.isChecked}),F=()=>{var oe;(oe=l.value)==null||oe.toggleSpellCheck()};return o.onUnmounted(()=>{document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",C)}),o.watch(s,oe=>{!r.superTextElementId||r.superTextElementId===""||(g.value=oe!==(r.superTextInit??""))}),(oe,H)=>{const V=Bp,D=Op,j=Mp,Y=Ap,J=bb,te=Tp,we=_p,le=Zq;return o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createVNode(we,{open:oe.open},{default:o.withCtx(()=>[o.createVNode(o.unref(e1),null,{default:o.withCtx(()=>[o.createVNode(o.unref(s1),{class:"!pointer-events-none bg-black/30"}),o.createVNode(te,{"is-overlay-transparent":"",class:"p-0 gap-0 !animate-none !transition-none max-w-max","as-child":""},{default:o.withCtx(()=>{var $e,Oe,We;return[o.createElementVNode("div",{class:"draggable-dialog fixed z-[70] pointer-events-auto",style:o.normalizeStyle({transform:`translate(${c.x}px, ${c.y}px)`,top:"0px",left:"auto",right:"15px"})},[o.createVNode(j,{class:"bg-blue-500 text-white p-2.5 rounded-t-[5px] cursor-move",onMousedown:o.withModifiers(v,["prevent"])},{default:o.withCtx(()=>[o.createVNode(V,null,{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(i)("editor.superinput")),1)]),_:1}),o.createVNode(D,{class:"absolute right-3 top-3 text-white",onClick:E},{default:o.withCtx(()=>[o.createVNode(o.unref(Ff),{class:"w-5 h-5"}),o.createElementVNode("span",Qq,o.toDisplayString(oe.$t("editor.close")),1)]),_:1})]),_:1}),o.createVNode(Y),o.createElementVNode("div",Nq,[o.createElementVNode("div",eK,[H[5]||(H[5]=o.createElementVNode("label",null," ",-1)),o.createElementVNode("div",tK,[o.createVNode(wn,{class:"text-[#65558F] bg-[#ECE6F0] hover:bg-[#ECE6F0]/90 shadow text-xs rounded font-normal h-[25px] px-3",onClick:H[0]||(H[0]=X=>u.value=!0)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(i)("editor.insert.symbol")),1)]),_:1}),o.createElementVNode("div",nK,[o.createVNode(p5,{id:"spellcheck",checked:o.unref(I),"onUpdate:checked":F},null,8,["checked"]),o.createElementVNode("label",rK,o.toDisplayString(o.unref(i)("editor.menubar.menu.spellCheck")),1)]),o.createElementVNode("div",oK,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(o.unref(A),X=>(o.openBlock(),o.createBlock(wn,{key:X,variant:"outline",size:"xs",class:"h-[25px] w-[25px] p-0",onClick:N=>B(X)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(X),1)]),_:2},1032,["onClick"]))),128))])]),u.value?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(($e=o.unref(_))==null?void 0:$e.component),{key:0,"custom-class":"!z-[70] !pointer-events-auto",class:o.normalizeClass((We=(Oe=o.unref(_))==null?void 0:Oe.componentProps)==null?void 0:We.class),onSelectedChar:L,onClose:H[1]||(H[1]=X=>u.value=!1)},null,40,["class"])):o.createCommentVNode("",!0)]),o.createElementVNode("div",iK,[o.createElementVNode("label",sK,o.toDisplayString(o.unref(i)("editor.detail")),1),o.createVNode(vb,{ref_key:"simpleEditorRef",ref:l,modelValue:s.value,"onUpdate:modelValue":H[2]||(H[2]=X=>s.value=X),"parent-editor":oe.editor,class:""},null,8,["modelValue","parent-editor"])]),o.createElementVNode("div",aK,[H[6]||(H[6]=o.createElementVNode("label",{class:"text-right text-sm p-2"},"ID",-1)),o.createVNode(fl,{modelValue:a.value,"onUpdate:modelValue":H[3]||(H[3]=X=>a.value=X),class:"rounded-none","default-value":a.value,disabled:""},null,8,["modelValue","default-value"])])]),o.createVNode(J,{class:"sm:justify-center pb-3.5 pt-1"},{default:o.withCtx(()=>[o.createVNode(wn,{as:"button",variant:"default",class:"bg-blue-500 hover:bg-blue-500/90",onClick:k},{default:o.withCtx(()=>[o.createVNode(o.unref(fg),{class:"w-5 h-5 mr-2"}),o.createTextVNode(" "+o.toDisplayString(o.unref(i)("editor.check")),1)]),_:1}),o.createVNode(wn,{as:"button",variant:"destructive",onClick:E},{default:o.withCtx(()=>[o.createVNode(o.unref(Ff),{class:"w-5 h-5 mr-2"}),o.createTextVNode(" "+o.toDisplayString(oe.$t("editor.close")),1)]),_:1})]),_:1})],4)]}),_:1})]),_:1})]),_:1},8,["open"]),o.createVNode(le,{open:m.value,onClose:x},null,8,["open"]),o.createVNode(le,{title:"Information",message:"{ 과 } 는 입력이 제한된 문자열 입니다.",iconName:"MessageCircleWarning",confirmText:"Ok",open:b.value,onClose:H[4]||(H[4]=$e=>b.value=!1)},null,8,["open"])],64)}}}),yb=o.defineComponent({__name:"SelectContextMenu",props:{editor:{},mode:{},superTextStore:{},disabled:{type:Boolean},disableSuperInput:{type:Boolean}},setup(t,{expose:e}){const n=t,{t:r}=Ot(),i=o.ref(!1),s=o.reactive({from:0,to:0,text:""}),a=o.inject("isEditable",o.ref(!0)),l=o.inject("canEditSuper",o.ref(!0)),u=o.computed(()=>n.mode===Re.EDITOR||n.mode===Re.PLAIN_TEXT||!l.value||n.disableSuperInput);function c(){if(!n.editor)return"";const{from:E,to:k}=n.editor.state.selection,x=n.editor.state.doc.cut(E,k),A=Nr.fromSchema(n.editor.schema).serializeFragment(x.content),T=document.createElement("div");return T.appendChild(A),T.innerHTML}const f=()=>{const{view:E}=n.editor,{from:k,to:x}=E.state.selection,_=c();s.text=_,s.from=k,s.to=x},p=()=>i.value=!i.value,m=()=>{u.value||(i.value=!0,f())},g=()=>i.value=!1,b=E=>{const k=n==null?void 0:n.superTextStore.addMoreSuperText(E);n.editor&&n.editor.commands.insertContentAt(s.from,{type:"superText",attrs:{"data-id":k,"data-text":E}}),i.value=!1,requestAnimationFrame(()=>{n.editor.commands.setTextSelection(s.from+1),n.editor.view.focus()})},v=o.ref(!1),w=async E=>{var k,x;if(E){const _=await((x=(k=n.editor).hasClipboard)==null?void 0:x.call(k));v.value=!!_}},C=()=>{if(u.value||!n.editor)return;const{view:E,state:k}=n.editor,{from:x,to:_}=k.selection;s.from=x,s.to=_,s.text="",E.dom.blur(),i.value=!0};return e({toggleDialog:p,openDialog:m,closeDialog:g}),(E,k)=>{const x=pc,_=gb,A=mb,T=hb,B=pb;return o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createVNode(x,{open:i.value,editor:E.editor,"super-text-init":s.text,onClose:p,onSave:b},null,8,["open","editor","super-text-init"]),o.createVNode(B,{"onUpdate:open":w},{default:o.withCtx(()=>[o.createVNode(_,{as:"template",class:"relative",disabled:o.unref(u),onDblclick:o.withModifiers(C,["prevent","stop"])},{default:o.withCtx(()=>[o.renderSlot(E.$slots,"default")]),_:3},8,["disabled"]),o.createVNode(T,null,{default:o.withCtx(()=>[E.disableSuperInput?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(A,{key:0,onSelect:m},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(r)("editor.inputSuper")),1)]),_:1})),o.unref(a)?(o.openBlock(),o.createBlock(A,{key:1,onSelect:k[0]||(k[0]=L=>{var I;return(I=E.editor)==null?void 0:I.commands.cutContent()})},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(r)("editor.cut")),1)]),_:1})):o.createCommentVNode("",!0),o.unref(a)?(o.openBlock(),o.createBlock(A,{key:2,onSelect:k[1]||(k[1]=L=>{var I;return(I=E.editor)==null?void 0:I.commands.copyContent()})},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(r)("editor.copy")),1)]),_:1})):o.createCommentVNode("",!0),o.unref(a)?(o.openBlock(),o.createBlock(A,{key:3,disabled:!v.value,onSelect:k[2]||(k[2]=L=>{var I;return(I=E.editor)==null?void 0:I.commands.pasteContent()})},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(r)("editor.paste")),1)]),_:1},8,["disabled"])):o.createCommentVNode("",!0)]),_:1})]),_:3})],64)}}});var ar=(t=>(t.TOGGLE_SUPER_TEXT="toggle-super-text",t.SUPER_TEXT_UPDATE_POSITION="SUPER_TEXT_UPDATE_POSITION",t.RENDER_SUPER_TEXT="RENDER_SUPER_TEXT",t.SUPER_VIEW_PAGE="SUPER_VIEW_PAGE",t.INCREASE_DECREASE_FONTSIZE="increase-decrease-fontsize",t))(ar||{});const lK={id:"editor-panel",class:"flex relative w-full h-full"},uK=Ao(o.defineComponent({__name:"PageNode",props:zs,setup(t){const{state:e,page:n,superTextStore:r}=Cn(),{size:i,pagination:s,margin:a}=n.value,l=o.ref(null),u=o.ref(t.node.attrs.viewSuperTextArea),c=o.computed(()=>u.value&&t.editor.storage.page.mode!=="editor"),f=o.computed(()=>t.editor.storage.page.mode===Re.REPORT),{width:p,height:m}=i,g=o.computed(()=>s?`calc(${m} - ${(a==null?void 0:a.top)??0} - ${(a==null?void 0:a.bottom)??0}`:"max-content"),b=ct.useEventBus(ar.SUPER_VIEW_PAGE);return o.watch(()=>t.node.attrs,v=>{b.emit(v.pageNumber)},{immediate:!0}),(v,w)=>{var E,k,x,_;const C=yb;return o.openBlock(),o.createBlock(o.unref(Hs),{id:v.node.attrs.id,ref_key:"containerRef",ref:l,"page-number":v.node.attrs.pageNumber,class:"overflow-hidden umo-page-node-view w-full border rounded-[3px] border-[#999999]",style:o.normalizeStyle({"--umo-page-margin-top":((E=o.unref(a))==null?void 0:E.top)??"0","--umo-page-margin-bottom":((k=o.unref(a))==null?void 0:k.bottom)??"0","--umo-page-margin-left":((x=o.unref(a))==null?void 0:x.left)??"0","--umo-page-margin-right":((_=o.unref(a))==null?void 0:_.right)??"0","--umo-page-width":o.unref(p),"--umo-page-height":o.unref(m),"--empty-node-left":"0px",left:100,"min-height":typeof o.unref(m)=="number"?`${o.unref(m)}px`:o.unref(m),height:f.value?typeof o.unref(m)=="number"?`${o.unref(m)}px`:o.unref(m):"auto"})},{default:o.withCtx(()=>[o.createElementVNode("div",lK,[o.createVNode(C,{mode:c.value?o.unref(Re).REPORT:o.unref(Re).EDITOR,editor:v.editor,"super-text-store":o.unref(r)},{default:o.withCtx(()=>[o.createVNode(o.unref(u6),{class:"umo-page-node-content",style:o.normalizeStyle({height:g.value})},null,8,["style"])]),_:1},8,["mode","editor","super-text-store"])])]),_:1},8,["id","page-number","style"])}}}),[["__scopeId","data-v-7d55d7ea"]]);function m5(t,e){const n=t.storedMarks??(t.selection.$to.parentOffset&&t.selection.$from.marks());if(n){const r=n.filter(i=>e==null?void 0:e.includes(i.type.name));t.tr.ensureMarks(r)}}const cK=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{const{selection:s,doc:a}=e,{$from:l,$to:u}=s,c=i.extensionManager.attributes,f=Ip(c,l.node().type.name,l.node().attrs);if(f.id=nb(),f.extend&&(f.extend=!1),s instanceof Pe&&s.node.isBlock)return!l.parentOffset||!hr(a,l.pos)?!1:(r&&(t&&m5(n,i.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;if(r){const p=u.parentOffset===u.parent.content.size;s instanceof Ae&&e.deleteSelection();const m=l.depth===0?void 0:c4(l.node(-1).contentMatchAt(l.indexAfter(-1)));let g=p&&m?[{type:m,attrs:f}]:void 0,b=hr(e.doc,e.mapping.map(l.pos),1,g);if(!g&&!b&&hr(e.doc,e.mapping.map(l.pos),1,m?[{type:m}]:void 0)&&(b=!0,g=m?[{type:m,attrs:f}]:void 0),b&&(g||(g=[{type:l.node().type,attrs:f}]),e.split(e.mapping.map(l.pos),1,g),m&&!p&&!l.parentOffset&&l.parent.type!==m)){const v=e.mapping.map(l.before()),w=e.doc.resolve(v);l.node(-1).canReplaceWith(w.index(),w.index()+1,m)&&e.setNodeMarkup(e.mapping.map(l.before()),m)}t&&m5(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},dK=t=>({tr:e,state:n,dispatch:r,editor:i})=>{var v;const s=mn(t,n.schema),{$from:a,$to:l}=n.selection,u=n.selection instanceof Pe?n.selection.node:null;if(u!=null&&u.isBlock||a.depth<2||!a.sameParent(l))return!1;const c=a.node(-1);if(c.type!==s)return!1;const f=i.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==s||a.index(-2)!==a.node(-2).childCount-1)return!1;if(r){let w=fe.empty;const C=a.index(-1)?1:a.index(-2)?2:3;for(let T=a.depth-C;T>=a.depth-3;T-=1)w=fe.from(a.node(T).copy(w));const E=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,k=Ip(f,a.node().type.name,a.node().attrs),x=((v=s.contentMatch.defaultType)==null?void 0:v.createAndFill(k))??void 0;w=w.append(fe.from(s.createAndFill(null,x)??void 0));const _=a.before(a.depth-(C-1));e.replace(_,a.after(-E),new Ee(w,4-C,0));let A=-1;e.doc.nodesBetween(_,e.doc.content.size,(T,B)=>{if(A>-1)return!1;T.isTextblock&&T.content.size===0&&(A=B+1)}),A>-1&&e.setSelection(Ae.near(e.doc.resolve(A))),e.scrollIntoView()}return!0}const p=l.pos===a.end()?c.contentMatchAt(0).defaultType:null,m=Ip(f,c.type.name,c.attrs),g=Ip(f,a.node().type.name,a.node().attrs);m.id=nb(),g.id=nb(),e.delete(a.pos,l.pos);const b=p?[{type:s,attrs:m},{type:p,attrs:g}]:[{type:s,attrs:m}];if(!hr(e.doc,a.pos,2))return!1;if(r){const{selection:w,storedMarks:C}=n,{splittableMarks:E}=i.extensionManager,k=C??(w.$to.parentOffset&&w.$from.marks());if(e.split(a.pos,2,b).scrollIntoView(),!k||!r)return!0;const x=k.filter(_=>E.includes(_.type.name));e.ensureMarks(x)}return!0},fK=[xp,Cp,Ep,rb,kp,cs,ib,kl,ab,ub,sb,ua,ds,fs,lb,cb,ob,Ur],pK=It.create({priority:200,name:`${Ur}`,content:"block*",group:`${Ur}`,isolating:!0,selectable:!1,draggable:!1,isLeaf:!0,addOptions(){return{SystemAttributes:{},nodesComputed:{},View:Us(uK),types:[],slots:{}}},addAttributes(){return{HTMLAttributes:{},id:{default:ui(10)},pageNumber:{default:1},force:{default:!1},viewSuperTextArea:{default:!0},slots:{default:this.options.slots,renderHTML:()=>({})}}},parseHTML(){return[{tag:`div[data-type="${this.name}"]`}]},renderHTML({node:t,HTMLAttributes:e}){return["div",{...vt(e),"data-type":this.name},0]},addCommands(){return{splitBlock:cK,splitListItem:dK,autoPaging:(t=!0)=>({tr:e,state:n,dispatch:r,editor:i})=>(r&&e.setMeta("runState",t),!0),setPageBreak:()=>({tr:t,state:e,dispatch:n,editor:r})=>(n&&t.setMeta("splitPage",!0),!0),togglePagePlugin:t=>({tr:e,dispatch:n})=>(e.setMeta("disablePage",t),n&&n(e),!0)}},addGlobalAttributes(){return[{types:fK.concat(this.options.types||[]),attributes:{id:{default:null},extend:{default:!1}}}]},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.first(({commands:r})=>[()=>r.undoInputRule(),()=>r.command(({tr:i})=>{const{selection:s,doc:a}=i,{empty:l,$anchor:u}=s,{pos:c,parent:f}=u,p=Ve.atStart(a).from===c;return!l||!p||!f.type.isTextblock||f.textContent.length?!1:r.clearNodes()}),()=>g5(r),()=>r.joinBackward(),()=>r.selectNodeBackward(),()=>r.command(({editor:i,tr:s})=>{const{selection:a,doc:l}=s,{$anchor:u}=a,{pos:c}=u;if(l.childCount===1)return!1;if(Ve.atEnd(l).from===c&&!u.parentOffset)return r.deleteNode(Ur);const f=ei(p=>p.type.name===Ur)(a);if(f){if(!f.node.firstChild)return r.deleteNode(Ur);const p=f.node.firstChild.type;if(f.start+Ve.atStart(f.node).from===c){const g=Ae.create(l,f.start-2,f.start-2),b=ei(v=>v.type.name===Ur)(g);if(b){const v=Ve.atEnd(b.node).from+b.start,w=Ae.create(l,v,v);if(p===b.node.lastChild.type){const{parent:C}=w.$anchor;return uq(C,i.schema)?s.setSelection(w):s.step(new pn(v,c,Ee.empty)),!0}s.setSelection(w)}return!0}}return!1})]),Delete:()=>this.editor.commands.first(({commands:r})=>[()=>g5(r),()=>r.command(({tr:i})=>{const{selection:s,doc:a}=i,{$anchor:l}=s,u=l.node(),c=ei(f=>f.type.name===kl)(s);return c&&c.start+Ve.atStart(c.node).from===l.pos&&c.node.childCount===1&&u.content.size===0?!0:r.joinForward()}),()=>r.selectNodeForward(),()=>r.command(({tr:i})=>{const{selection:s,doc:a}=i,{$anchor:l}=s,{pos:u}=l;if(a.childCount===1)return!1;if(Ve.atEnd(a).from===u)return r.deleteNode(Ur);const c=ei(f=>f.type.name===Ur)(s);if(c&&c.start+Ve.atEnd(c.node).from===u){const p=Ae.create(a,u+2,u+2),m=ei(g=>g.type.name===Ur)(p);if(m){const g=Ve.atStart(m.node).from+m.start,b=Ae.create(a,g,g);if(ei(w=>w.attrs.extend)(b))return i.step(new pn(u,g,Ee.empty)),!0}}return!1})]),Tab:()=>this.editor.commands.first(({commands:r})=>[()=>!0]),"Mod-Enter":()=>this.editor.commands.setPageBreak()}},addNodeView(){return this.options.View}});function Ip(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=t.find(s=>s.type===e&&s.name===r);return i?i.attribute.keepOnSplit:!1}))}const g5=t=>t.command(({tr:e})=>{const{selection:n,doc:r}=e,i=d4(r,{from:n.from,to:n.to},s=>s.type.name===kl);for(const s of i){const a=s.pos+s.node.nodeSize;if(n.from<s.pos||n.to>a)return!0}return t.deleteSelection()}),hK=Qe.create({name:"fontFamily",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:t=>t.style.fontFamily,renderHTML:t=>t.fontFamily?{style:`font-family: ${t.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:t=>({chain:e})=>e().setMark("textStyle",{fontFamily:t}).run(),unsetFontFamily:()=>({chain:t})=>t().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}}}),mK=["data-font"],gK=o.defineComponent({__name:"FontFamilyMenuButton",props:{editor:{},disabled:{type:Boolean,default:!1},color:{default:void 0},shortcutKeys:{default:void 0},maxHeight:{default:void 0},tooltip:{default:""},items:{default:()=>[]},customClass:{default:""},showDefaultDivider:{type:Boolean,default:!1}},setup(t){const e=t,n=o.computed(()=>e.editor.extensionStorage["base-kit"].mode===Re.EDITOR),{t:r}=Ot(),i=[{label:r("editor.fontFamily.gulim"),value:"Gulim"},{label:r("editor.fontFamily.dotum"),value:"Dotum"},{label:r("editor.fontFamily.gungsuh"),value:"Gungsuh"}],s=o.inject("fontFamily"),a=o.computed(()=>{const p=e.editor.extensionManager.extensions.find(g=>g.name==="fontFamily").options;return nt.isEmpty(p.fontFamilyMap)&&(p.fontFamilyMap=i),[{label:r("editor.fontFamily.default"),value:r("editor.fontFamily.default")},...p.fontFamilyMap]}),l=o.computed(()=>{const p={label:r("editor.fontFamily.default"),value:r("editor.fontFamily.default")};return n.value?e0(e.editor.state,"textStyle").fontFamily||p.value:s.value||p.value}),u=ct.useEventBus("fontFamily");function c(p){p.value===l.value||p.value===r("editor.fontFamily.default")?(e.editor.commands.unsetFontFamily(),s.value=null):(s.value=p.value,e.editor.commands.setFontFamily(p.value),u.emit()),e.editor.commands.setForceCloseBubble(!0)}e.editor.on("selectionUpdate",({editor:p})=>{p.state.selection.empty&&e.editor.commands.resetForceCloseBubble()});const f=o.computed(()=>{var p;return(p=a.value.find(m=>m.value===l.value))==null?void 0:p.label});return(p,m)=>(o.openBlock(),o.createBlock(ia,{disabled:p.disabled,tooltip:p.tooltip,title:f.value,btn_class:`min-w-20 ${p.customClass}`},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.value,(g,b)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:b},[o.createVNode(o.unref(wl),{checked:l.value===g.value,onClick:v=>c(g)},{default:o.withCtx(()=>[o.createElementVNode("span",{class:"ml-1 h-full","data-font":g.label,style:o.normalizeStyle({fontFamily:g.value??void 0})},o.toDisplayString(g.label),13,mK)]),_:2},1032,["checked","onClick"]),g.label===o.unref(r)("editor.fontFamily.default")&&p.showDefaultDivider?(o.openBlock(),o.createBlock(o.unref(mg),{key:0})):o.createCommentVNode("",!0)],64))),128))]),_:1},8,["disabled","tooltip","title","btn_class"]))}}),b5=hK.extend({name:"fontFamily",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),types:["textStyle"],fontFamilyMap:[],button({editor:e,extension:n,t:r}){return{component:gK,componentProps:{editor:e,disabled:!e.can().setFontFamily(""),tooltip:r("editor.fontFamily.tooltip")}}}}},addGlobalAttributes(){return[{types:["paragraph","heading","textStyle"],attributes:{style:{default:null,parseHTML:t=>t.style.fontFamily||null,renderHTML:t=>t.style?{style:`font-family: ${t.style}`}:{}},fontFamily:{default:null,parseHTML:t=>t.style.fontFamily.replace(/['"]/g,""),renderHTML:t=>t.fontFamily?{style:`font-family: ${t.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:t=>({chain:e})=>e().setMark("textStyle",{fontFamily:t}).run(),unsetFontFamily:()=>({chain:t})=>t().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}},addStorage(){return{value:null}},onUpdate(){this.storage.value=this.editor.getAttributes("textStyle").fontFamily}}),bK={class:"flex gap-2"},vK=["disabled"],yK=Ao(o.defineComponent({__name:"FontSizeIncreaseDecrease",props:{editor:Object},setup(t){const e=o.inject("fontSize"),n=o.computed(()=>e.value?parseInt(e.value)===parseInt(T0[0])||parseInt(e.value)<parseInt(T0[0]):!1),r=ct.useEventBus(ar.INCREASE_DECREASE_FONTSIZE),i=s=>{r.emit(s)};return(s,a)=>{const l=ml,u=hl,c=gl;return o.openBlock(),o.createElementBlock("div",bK,[o.createVNode(c,null,{default:o.withCtx(()=>[o.createVNode(u,{"delay-duration":0},{default:o.withCtx(()=>[o.createVNode(l,null,{default:o.withCtx(()=>[o.createElementVNode("button",{class:"btn",onClick:a[0]||(a[0]=f=>i(!0))},[o.createVNode(o.unref(Tt),{name:"Plus",class:"w-6 h-6"})])]),_:1}),o.createVNode(o.unref(ta),null,{default:o.withCtx(()=>a[2]||(a[2]=[o.createTextVNode(" 글꼴 크기 크게 ")])),_:1})]),_:1})]),_:1}),o.createVNode(c,null,{default:o.withCtx(()=>[o.createVNode(u,{"delay-duration":0},{default:o.withCtx(()=>[o.createVNode(l,null,{default:o.withCtx(()=>[o.createElementVNode("button",{class:"btn",onClick:a[1]||(a[1]=f=>i(!1)),disabled:o.unref(n)},[o.createVNode(o.unref(Tt),{name:"Minus",class:"w-6 h-6"})],8,vK)]),_:1}),o.createVNode(o.unref(ta),null,{default:o.withCtx(()=>a[3]||(a[3]=[o.createTextVNode(" 글꼴 크기 작게 ")])),_:1})]),_:1})]),_:1})])}}}),[["__scopeId","data-v-250d04b3"]]),wK=Dn.create({name:"fontSizeIncreaseDecrease",addOptions(){return{defaultSize:"14px",button({editor:t}){return{component:yK,componentProps:{editor:t}}}}},addAttributes(){return{size:{default:this.options.defaultSize,parseHTML:t=>t.style.fontSize||this.options.defaultSize,renderHTML:t=>t.size?{style:`font-size: ${t.size}`}:{}}}},addCommands(){return{setFontSizeIncreaseDecrease:t=>({commands:e})=>e.setMark("textStyle",{fontSize:t})}}}),wb=Qe.create({name:"painter",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,extension:n,t:r})=>({component:Ke,componentProps:{action:()=>{e.commands.setPainter(e==null?void 0:e.state.selection.$head.marks())},icon:"PaintRoller",tooltip:r("editor.format")}})}},addCommands(){return{setPainter:t=>({view:{dispatch:e,state:{tr:n},dom:r}})=>{const a=`url("data:image/svg+xml;utf8,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="#000" d="M9 22v-6H4V7q0-1.65 1.175-2.825T8 3h12v13h-5v6zM6 10h12V5h-1v4h-2V5h-1v2h-2V5H8q-.825 0-1.412.588T6 7zm0 4h12v-2H6zm0 0v-2z"/></svg>')}"), auto`;return r.style.cursor=a,e(n.setMeta("painterAction",{type:"start",marks:t})),!0}}},addProseMirrorPlugins(){return[new tt({key:new kt("format-painter"),state:{init:()=>[],apply:(t,e)=>{const n=t.getMeta("painterAction");return n&&n.type==="start"?e=n.marks:n&&n.type==="end"&&(e=[]),e}},props:{handleDOMEvents:{mousedown(t,e){const n=this.getState(t.state);if(!n||n.length==0)return t.dom.style.cursor="",!1;const r=()=>{document.removeEventListener("mouseup",r);const{dispatch:i,state:{selection:s},dom:a}=t;let l=t.state.tr;a.style.cursor="",l=l.removeMark(s.from,s.to);for(const u of n)u.type.name!="link"&&(l=l.addMark(s.from,s.to,u));i(l.setMeta("painterAction",{type:"end"}))};return document.addEventListener("mouseup",r),!0}}}})]}}),Cb=()=>ui(10),v5=new kt("attrkey"),CK=t=>new tt({key:v5,state:{init:()=>!1,apply:n=>n.getMeta("initSplit")},appendTransaction(n,r,i){const{tr:s}=i;let a=!1;const l=v5.getState(i);if(n.some(c=>c.getMeta("composition")))return null;if(l||n.some(c=>c.docChanged)){const c=[];i.doc.descendants((f,p,m,g)=>{const{attrs:b}=f,v=c.includes(b.id)?Cb():b.id||Cb();t.includes(f.type.name)&&(s.setNodeMarkup(p,void 0,{...b,id:v,"number-line":g+1}),a=!0),c.push(v)})}return a?s:null}}),y5=[xp,Cp,Ep,rb,kp,cs,ib,kl,ab,ub,sb,ua,ds,fs,lb,cb,ob,Ur],xK=Qe.create({name:"autoId",addGlobalAttributes(){return[{types:y5.concat(this.options.types||[]),attributes:{id:{default:Cb()},extend:{default:!1},class:{default:null},"number-line":{default:null}}}]},addProseMirrorPlugins(){return[CK(y5.concat(this.options.types||[]))]}}),EK=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,kK=It.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",vt(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[v4({find:EK,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}}),SK=["src","alt"],_K={key:0,class:"image-resizer"},TK=["onMousedown","onTouchstart"],AK=o.defineComponent({__name:"ImageView",props:{...zs,selected:{type:Boolean,required:!0}},setup(t){const e=t,n={TOP_LEFT:"tl",TOP_RIGHT:"tr",BOTTOM_LEFT:"bl",BOTTOM_RIGHT:"br"},r=o.ref({width:d6,height:d6}),i=o.ref({width:0,height:0}),s=o.ref(!1),a=o.ref({x:0,y:0,w:0,h:0,dir:""}),l=o.computed(()=>{const{src:k,alt:x,width:_,height:A,flipX:T,flipY:B}=e.node.attrs,L=[];T&&L.push("rotateX(180deg)"),B&&L.push("rotateY(180deg)");const I=L.join(" ");return{src:k||void 0,alt:x||void 0,style:{width:A0(_)?`${_}px`:_,height:A0(A)?`${A}px`:A,transform:I||"none"}}});o.computed(()=>({width:o.unref(l).style.width==="100%"?"100%":void 0}));const u=o.ref(null),c=new ResizeObserver(k=>{for(const x of k){const{width:_,height:A}=x.contentRect;i.value={width:_,height:A},e.updateAttributes({originWidth:_,originHeight:A})}});function f(){const{editor:k,getPos:x}=e;k.commands.setNodeSelection(x())}const p=nt.throttle(()=>{const{editor:k}=e;r.value.width=parseInt(getComputedStyle(k.view.dom).width,10)},f6);function m(k,x){k.preventDefault(),k.stopPropagation();let _=0,A=0;const T=document.querySelector(".image-resizer");if(T&&(T.style.borderColor="#3b82f6"),"touches"in k&&k.touches.length>0)_=k.touches[0].clientX,A=k.touches[0].clientY;else if("clientX"in k)_=k.clientX,A=k.clientY;else return;const{width:B,height:L}=o.unref(i),I=B/L;let F=Number(e.node.attrs.width)||B,U=Number(e.node.attrs.height)||Math.round(F/I);const ie=o.unref(r).width;F=Math.min(F>ie?ie:F,ie),U=Math.round(F/I),Object.assign(a.value,{x:_,y:A,w:F,h:U,dir:x}),s.value=!0,v()}const g=nt.throttle(k=>{if(!o.unref(s))return;let x=0;if("touches"in k&&k.touches.length>0)x=k.touches[0].clientX;else if("clientX"in k)x=k.clientX;else return;const{x:_,w:A,dir:T}=o.unref(a),B=(x-_)*(/l/.test(T)?-1:1),L=XB(A+B,HB,o.unref(r).width);e.updateAttributes({width:L})},f6),b=k=>{k.preventDefault(),k.stopPropagation();const x=document.querySelector(".image-resizer");x&&(x.style.borderColor=""),o.unref(s)&&(s.value=!1,Object.assign(a.value,{x:0,y:0,w:0,h:0,dir:""}),w(),f())};function v(){document.addEventListener("mousemove",g,!0),document.addEventListener("mouseup",b,!0),document.addEventListener("touchmove",g,!0),document.addEventListener("touchend",b,!0)}function w(){document.removeEventListener("mousemove",g,!0),document.removeEventListener("mouseup",b,!0),document.removeEventListener("touchmove",g,!0),document.removeEventListener("touchend",b,!0)}const C=new ResizeObserver(p),E=o.computed(()=>{const{textAlign:k}=e.node.attrs;return{left:"margin-right: auto;",right:"margin-left: auto;",center:"margin-left: auto; margin-right: auto;"}[k]||""});return o.onMounted(()=>{u.value&&c.observe(u.value),C.observe(e.editor.view.dom)}),o.onBeforeUnmount(()=>{w(),c.disconnect(),C.disconnect()}),(k,x)=>(o.openBlock(),o.createBlock(o.unref(Hs),{class:"node-image"},{default:o.withCtx(()=>[o.createElementVNode("div",{class:"image-view",style:o.normalizeStyle([{width:l.value.style.width,height:l.value.style.height},E.value])},[o.createElementVNode("div",{draggable:"true","data-drag-handle":"",class:o.normalizeClass([{"image-view__body--focused":t.selected,"image-view__body--resizing":s.value},"image-view__body"])},[o.createElementVNode("img",{ref_key:"imageRef",ref:u,src:l.value.src,alt:l.value.alt,class:"block w-full image-view__body__image",style:o.normalizeStyle([{transform:l.value.style.transform}]),onClick:f},null,12,SK),k.editor.view.editable?o.withDirectives((o.openBlock(),o.createElementBlock("div",_K,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.values(n),_=>(o.openBlock(),o.createElementBlock("span",{key:_,class:o.normalizeClass([`image-resizer__handler--${_}`,"image-resizer__handler"]),onMousedown:A=>m(A,_),onTouchstart:o.withModifiers(A=>m(A,_),["prevent"])},null,42,TK))),128))],512)),[[o.vShow,t.selected||s.value]]):o.createCommentVNode("",!0)],2)],4)]),_:1}))}}),MK=Ao(AK,[["__scopeId","data-v-6435a6f3"]]),xb=kK.extend({group:"block",defining:!0,isolating:!0,addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),flipX:{default:!1},flipY:{default:!1},originWidth:{default:null},originHeight:{default:null},textAlign:{default:"left",parseHTML:e=>e.style.textAlign||e.getAttribute("textAlign")||null,renderHTML:e=>({textAlign:e.textAlign})},width:{default:"100%",parseHTML:e=>{const n=e.style.width||e.getAttribute("width")||null;return n&&n.endsWith("%")?n:n==null?null:parseInt(n,10)},renderHTML:e=>({width:e.width})},class:{default:"",parseHTML:e=>e.getAttribute("class")||"",renderHTML:e=>({class:e.class})},"data-memo":{default:"",parseHTML:e=>e.getAttribute("data-memo")||"",renderHTML:e=>({"data-memo":e["data-memo"]})}}},addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this)}},addNodeView(){return Us(MK)},addCommands(){var t;return{...(t=this.parent)==null?void 0:t.call(this),updateImage:e=>({commands:n,editor:r})=>n.updateAttributes(this.name,e)}},renderHTML({node:t,HTMLAttributes:e}){const{textAlign:n,flipX:r,flipY:i}=t.attrs,l=`${{left:"margin-right: auto;",right:"margin-left: auto;",center:"margin-left: auto; margin-right: auto;"}[n]||""} ${r||i?`transform: rotateX(${r?"180":"0"}deg) rotateY(${i?"180":"0"}deg);`:""}`;return["img",vt({height:"auto",style:l},this.options.HTMLAttributes,e)]},parseHTML(){return[{tag:"img[src]"}]},addProseMirrorPlugins(){return[new tt({props:{handleTextInput(t){const{selection:e}=t.state;return e instanceof Pe&&e.node.type.name==="image"},handlePaste(t){const{selection:e}=t.state;return e instanceof Pe&&e.node.type.name==="image"}}})]}}),OK=["paragraph","heading","list_item","todo_item"];function BK(t,e){const{selection:n,doc:r}=t;if(!n||!r||!(n instanceof Ae||n instanceof Rn))return t;const{from:i,to:s}=n,a=[],l=e&&e!==p6?e:null;return r.nodesBetween(i,s,(u,c)=>{const f=u.type;return OK.includes(f.name)?((u.attrs.lineHeight||null)!==l&&a.push({node:u,pos:c,nodeType:f}),f.name!=="list_item"&&f.name!=="todo_item"):!0}),a.length&&a.forEach(u=>{const{node:c,pos:f,nodeType:p}=u;let{attrs:m}=c;m={...m,lineHeight:l},t=t.setNodeMarkup(f,p,m,c.marks)}),t}function IK(t){return({state:e,dispatch:n})=>{const{selection:r}=e;let{tr:i}=e;return i=i.setSelection(r),i=BK(i,t),i.docChanged?(n&&n(i),!0):!1}}const RK=o.defineComponent({__name:"LineHeightDropdown",props:{editor:{},icon:{default:void 0},tooltip:{default:void 0},disabled:{type:Boolean,default:!1},action:{type:Function,default:void 0},isActive:{type:Function,default:void 0}},setup(t){const{t:e}=Ot();function n(l){return parseFloat(l.replace("%",""))/100}const r=o.computed(()=>{const c=s.editor.extensionManager.extensions.find(f=>f.name==="lineHeight").options.lineHeights.map(f=>({label:n(f),value:f}));return c.unshift({label:o.unref(e)("editor.default"),value:"default"}),c}),i=o.ref("default"),s=t;function a(l){l==="default"?s.editor.commands.unsetLineHeight():s.editor.commands.setLineHeight(l),i.value=l}return(l,u)=>(o.openBlock(),o.createBlock(ia,{icon:l.icon,tooltip:l.tooltip,disabled:l.disabled},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.value,(c,f)=>(o.openBlock(),o.createBlock(o.unref(wl),{key:f,checked:c.value===i.value,onClick:p=>a(c.value)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(c.label),1)]),_:2},1032,["checked","onClick"]))),128))]),_:1},8,["icon","tooltip","disabled"]))}}),w5=Qe.create({name:"lineHeight",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),types:["paragraph","heading","list_item","todo_item"],lineHeights:["100%","115%","150%","200%","250%","300%"],defaultHeight:p6,button({editor:e,t:n}){return{component:RK,componentProps:{editor:e,icon:"LineHeight",tooltip:n("editor.lineheight.tooltip")}}}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:t=>t.style.lineHeight||this.options.defaultHeight,renderHTML:t=>t.lineHeight===this.options.defaultHeight||!t.lineHeight?{}:{style:`line-height: ${t.lineHeight}`}}}}]},addCommands(){return{setLineHeight:t=>IK(t),unsetLineHeight:()=>({commands:t})=>this.options.types.every(e=>t.resetAttributes(e,"lineHeight"))}}}),LK=It.create({name:"column",content:"block+",isolating:!0,addAttributes(){return{position:{default:"",parseHTML:t=>t.getAttribute("data-position"),renderHTML:t=>({"data-position":t.position})}}},renderHTML({HTMLAttributes:t}){return["div",vt(t,{"data-type":"column"}),0]},parseHTML(){return[{tag:'div[data-type="column"]'}]}});var ca=(t=>(t.SidebarLeft="sidebar-left",t.SidebarRight="sidebar-right",t.TwoColumn="two-column",t))(ca||{});const Eb=It.create({name:"columns",group:"columns",content:"column+",defining:!0,isolating:!0,addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),layout:"two-column"}},addAttributes(){return{layout:{default:"two-column"}}},addCommands(){return{setColumns:()=>({commands:t})=>(t.insertContent('<div data-type="columns"><div data-type="column" data-position="left"><p></p></div><div data-type="column" data-position="right"><p></p></div></div>'),!0),setLayout:t=>({commands:e})=>e.updateAttributes("columns",{layout:t})}},renderHTML({HTMLAttributes:t}){return["div",{"data-type":"columns",class:`layout-${t.layout}`},0]},parseHTML(){return[{tag:'div[data-type="columns"]'}]},addExtensions(){return[LK.configure(this.options.columnOptions)]}});function PK(t){let e=t;for(;e&&e!==document.body;){if(e.nodeType===1){const n=e;if(n.id==="editor-panel")return n}e=e.parentNode}return null}const Rp=t=>{var n;if(!t)return!0;const e=document.createElement("div");return e.innerHTML=t,((n=e==null?void 0:e.textContent)==null?void 0:n.trim())===""},DK=t=>{if(!t)return"";const{from:e,to:n}=t.state.selection,r=t.state.doc.cut(e,n),s=Nr.fromSchema(t.schema).serializeFragment(r.content),a=document.createElement("div");return a.appendChild(s),a.innerHTML},C5=8;function VK(t,e){const n=o.ref(!1);let r=!1,i=null,s=null,a=null,l=null,u=0,c=0;function f(E){const k=E.cloneNode(!0);return k.style.position="fixed",k.style.pointerEvents="none",k.style.opacity="0.9",k.style.zIndex="9999",k.style.transform="translate(-50%, -50%)",k.style.left="0px",k.style.top="0px",document.body.appendChild(k),k}function p(){s&&s.parentElement&&s.parentElement.removeChild(s),s=null}function m(){try{if(typeof t.getPos=="function"){const E=t.getPos();if(typeof E=="number"&&E>=0)return E}}catch{}return null}function g(E,k){n.value||(l=m(),document.body.style.userSelect="none",document.body.style.touchAction="none",k&&(s=f(k),s.style.left=`${E.clientX}px`,s.style.top=`${E.clientY}px`),n.value=!0,r=!1,a=null)}function b(){i=null,l=null,a=null,r=!1,n.value=!1,p(),document.body.style.userSelect="",document.body.style.touchAction=""}function v(E){if(o.unref(e)||n.value)return;const k=E.changedTouches[0];i=k.identifier,u=k.clientX,c=k.clientY,r=!0,l=null,a=null}function w(E){var T;if(!r&&!n.value||i===null)return;const k=Array.from(E.changedTouches).find(B=>B.identifier===i);if(!k)return;const x=k.clientX-u,_=k.clientY-c,A=x*x+_*_;if(!n.value&&r&&A>=C5*C5){const B=E.currentTarget||E.target||null;g(k,B)}if(n.value){s&&(s.style.left=`${k.clientX}px`,s.style.top=`${k.clientY}px`);try{const B=(T=t.editor)==null?void 0:T.view;if(!B){a=null;return}const L=B.posAtCoords({left:k.clientX,top:k.clientY});L&&typeof L.pos=="number"?a=L.pos:a=null}catch{a=null}}}async function C(E){var k;if(n.value){if(document.body.style.userSelect="",document.body.style.touchAction="",p(),n.value=!1,l===null||a===null){b();return}const x=(k=t.editor)==null?void 0:k.view;if(!x){b();return}const _=x.state.doc.nodeAt(l);if(!_){b();return}const A=_.nodeSize,T=l,B=T+A,L=a;if(L>=T&&L<=B){b();return}let I=L;L>T&&(I=L-A);const F=x.state.doc.content.size;I<0&&(I=0),I>F&&(I=F);const U=_.type.create(_.attrs),ie=x.state.tr;ie.delete(T,B),ie.insert(I,U),x.dispatch(ie),b();return}if(r){b();return}}return{onTouchStart:v,onTouchMove:w,onTouchEnd:C}}function FK(...t){return _v(Yh(t))}const $K=["innerHTML"],HK=["book-mark-node-id","book-mark-content","node-id","element-id","line-id"],zK=o.defineComponent({__name:"SuperText",props:zs,setup(t){const e=t,n=o.ref(!1),r=o.inject("isMobile",!1),i=o.computed(()=>e.editor.storage.superText.enable),s=ct.useEventBus(ar.RENDER_SUPER_TEXT),{onTouchStart:a,onTouchMove:l,onTouchEnd:u}=VK(e,i),c=o.computed(()=>{const x=e.getPos(),_=e.editor.state.doc.resolve(x);for(let A=_.depth;A>0;A--){const T=_.node(A);if(T.type.name==="paragraph")return T}return null}),f=o.computed(()=>{var x;return((x=c.value)==null?void 0:x.attrs.id)||""}),p=o.inject("canEditSuper",o.ref(!0)),m=()=>{s.emit({action:"render"})};function g(x){var I,F;if(Rp(x)){w();return}const _=e.getPos(),A=(I=e.editor)==null?void 0:I.state.doc.nodeAt(_),T=x.trim(),{[Ne.ELEMENT_ID]:B,...L}=(A==null?void 0:A.attrs)||{};(F=e.editor)==null||F.view.dispatch(e.editor.state.tr.setNodeMarkup(_,void 0,{...L,[Ne.TEXT]:T})),requestAnimationFrame(()=>{e.editor.commands.setTextSelection(_+1),e.editor.view.focus()})}function b(x){const _=e.node.attrs[Ne.TEXT],A=e.node.attrs[Ne.ID],B={lineId:x.target.querySelector(`[node-id="${A}"]`).getAttribute("line-id"),dataId:A,text:_};s.emit({action:"hover",payload:B})}function v(x){const _=e.node.attrs[Ne.ID],T={lineId:x.target.querySelector(`[node-id="${_}"]`).getAttribute("line-id"),dataId:_,text:""};s.emit({action:"hover",payload:T})}function w(){const{getPos:x,node:_,editor:A}=e,T=x(),B=T+1;A.commands.deleteRange({from:T,to:B})}function C(){if(!p.value)return;const{attributes:x}=e.editor.options.editorProps;if(x&&x.id===or.COMMENT){const _=document.getElementById(or.COMMENT);if((_==null?void 0:_.getAttribute(or.DISABLE_SUPER_INPUT))==="true")return}e.editor.view.dom.blur(),n.value=!0}function E(){e.editor.commands.setSuperTextContent(e.node.attrs[Ne.TEXT],e.node.attrs[Ne.POSITION]),e.editor.commands.toggleSuperInputMoblie()}o.watch(i,x=>{e.editor.setEditable(!x),x?e.editor.view.dom.classList.add("super-text-view-mode"):e.editor.view.dom.classList.remove("super-text-view-mode")});const k=o.computed(()=>`{${e.node.attrs[Ne.TEXT].replace(/<\/p>\s*<p>/g,"<br/>").replace(/<\/?p[^>]*>/g,"").trim()}}`);return(x,_)=>{const A=wn,T=gb,B=mb,L=hb,I=pb,F=pc;return o.openBlock(),o.createBlock(o.unref(Hs),{as:"span",class:o.normalizeClass(o.unref(FK)("text-inherit super-text shrink-0 inline-flex items-center justify-center",o.unref(r)&&i.value&&"block")),"data-drag-handle":"",draggable:o.unref(p),onDragend:m,onPointerdown:_[2]||(_[2]=o.withModifiers(()=>{},["stop"])),onTouchstartPassive:o.unref(a),onTouchmovePassive:o.unref(l),onTouchendPassive:o.unref(u),onTouchcancelPassive:o.unref(u)},{default:o.withCtx(()=>[o.unref(r)&&!i.value?(o.openBlock(),o.createElementBlock("button",{key:0,onClick:o.withModifiers(E,["stop"]),class:"w-6 inline-flex justify-center rounded text-ed-red-500 active:bg-ed-accent"},[o.createVNode(o.unref(Tt),{name:"fileEdit2",class:"w-5 h-5"})])):o.createCommentVNode("",!0),o.unref(r)&&i.value?(o.openBlock(),o.createElementBlock("div",{key:1,innerHTML:k.value,onClick:o.withModifiers(E,["stop"]),class:"super-text-view-mode-item"},null,8,$K)):o.createCommentVNode("",!0),o.unref(r)?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(I,{key:2},{default:o.withCtx(()=>[o.createVNode(T,{as:"template",class:"relative",disabled:!o.unref(p)},{default:o.withCtx(()=>[o.createVNode(A,{class:o.normalizeClass([{"pointer-events-none":!o.unref(p)},"!p-0 !m-0 !h-fit"]),variant:"ghost",onDblclick:o.withModifiers(C,["stop"]),onMouseenter:b,onMouseleave:v},{default:o.withCtx(()=>[o.createVNode(o.unref(Tt),{name:"fileEdit"}),o.createElementVNode("div",{ref:"bookMarkRef","book-mark-node-id":e.node.attrs[o.unref(Ne).ID],"book-mark-content":e.node.attrs[o.unref(Ne).TEXT],"node-id":e.node.attrs[o.unref(Ne).ID],"element-id":e.node.attrs[o.unref(Ne).ELEMENT_ID],"line-id":f.value},null,8,HK)]),_:1},8,["class"])]),_:1},8,["disabled"]),o.createVNode(L,null,{default:o.withCtx(()=>[o.createVNode(B,{onSelect:_[0]||(_[0]=U=>n.value=!0)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(x.$t("editor.super.edit")),1)]),_:1}),o.createVNode(B,{onSelect:w},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(x.$t("editor.super.delete")),1)]),_:1})]),_:1})]),_:1})),o.unref(r)?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(F,{key:3,open:n.value,editor:e.editor,"super-text-init":e.node.attrs[o.unref(Ne).TEXT],"super-text-element-id":e.node.attrs[o.unref(Ne).ELEMENT_ID],onClose:_[1]||(_[1]=U=>n.value=!1),onSave:g},null,8,["open","editor","super-text-init","super-text-element-id"]))]),_:1},8,["class","draggable","onTouchstartPassive","onTouchmovePassive","onTouchendPassive","onTouchcancelPassive"])}}}),UK=new tt({props:{handleKeyDown(t,e){var n;if(e.key==="Backspace"){const{state:r,dispatch:i}=t,{$from:s}=r.selection;if(s.parentOffset===1){const u=s.nodeAfter;if(u&&u.type.name==="superText"){const c=r.tr;c.delete(s.pos-1,s.pos);const f=r.schema.text("");return c.insert(s.pos-1,fe.from(f)),c.setSelection(Ae.create(c.doc,s.pos)),i(c),e.preventDefault(),!0}}const a=s.nodeBefore,l=s.nodeAfter;if(a&&a.isText&&((n=a.text)==null?void 0:n.length)===1&&l&&l.type.name==="superText"){const u=s.parent.childBefore(s.parentOffset-1).node;if(u&&u.type.name==="superText"){const c=r.tr;return c.delete(s.pos-1,s.pos),c.setSelection(Ae.create(c.doc,s.pos-1)),i(c),e.preventDefault(),!0}}}return!1}}}),WK=new tt({appendTransaction(t,e,n){const r=new Set;let i=n.tr,s=!1;return n.doc.descendants((a,l)=>{if(a.type.name===hc){const u=a.attrs[Ne.ID];if(!u||r.has(u)){const c=ui();i=i.setNodeMarkup(l,void 0,{...a.attrs,[Ne.ID]:c}),s=!0,r.add(c)}else r.add(u)}}),s?i:null}}),hc="superText",x5={UPDATE:"superTextUpdate"},E5=It.create({name:"superText",inline:!0,group:"inline",selectable:!1,defining:!0,draggable:!0,addStorage(){return{enable:!0,isShowSuperInputMoblie:!1,view:!0,items:[],toggleSuperViewMobileCallBack:this.options.toggleSuperViewMobileCallBack,bottomSheetComponent:this.options.bottomSheetComponent,addToast:this.options.addToast,superTextContent:"",superTextPosition:""}},addOptions(){return{specialCharModal:null,button:({editor:t,t:e,isMobile:n})=>n?[{component:Ke,componentProps:{action:()=>{t.commands.toggleSuperInputMoblie()},isActive:()=>{},icon:"fileEdit",title:e("editor.menubar.menu.insertSuper"),tooltip:e("editor.menubar.menu.insertSuper"),customClass:"whitespace-nowrap !bg-ed-blue active:!bg-ed-blue/90 !transition-none !text-white !font-normal rounded-[3px] h-[26px] ml-auto",customClassTooltip:"ml-auto"}}]:[{component:Ke,componentProps:{action:()=>t.commands.toggleSuperTextView(),isActive:()=>t.storage.superText.enable,title:e("editor.menubar.menu.superView"),customClass:`whitespace-nowrap !text-white !font-normal rounded-[3px] h-[26px]
|
|
331
331
|
${t.storage.superText.enable?"!bg-blue-500":"!bg-gray-600"}
|
|
332
332
|
`,tooltip:"수퍼 보기"}}]}},addAttributes(){return{[Ne.ID]:{default:null},[Ne.TEXT]:{default:""},[Ne.POSITION]:{default:"0"},[Ne.ELEMENT_ID]:{default:""}}},addCommands(){return{toggleSuperTextView:()=>({editor:t})=>t.storage.superText.enable=!t.storage.superText.enable,toggleSuperInputMoblie:()=>({editor:t})=>t.storage.superText.bottomSheetComponent?t.storage.superText.isShowSuperInputMoblie=!t.storage.superText.isShowSuperInputMoblie:(console.error("Please configure bottomSheetComponent!"),!1),setSuperTextContent:(t,e)=>({editor:n})=>(n.storage.superText.superTextContent=t,n.storage.superText.superTextPosition=e,!!t)}},parseHTML(){return[{tag:"button.super-text"}]},renderHTML({HTMLAttributes:t}){return["button",vt(t,{class:"super-text"})]},addNodeView(){return Us(zK)},addProseMirrorPlugins(){return[new tt({appendTransaction(t,e,n){let r=n.tr,i=!1;return n.doc.descendants((s,a)=>{if(s.type.name==="superText"){const l=s.attrs[Ne.POSITION],u=String(a);l!==u&&(r=r.setNodeMarkup(a,void 0,{...s.attrs,[Ne.POSITION]:u}),i=!0)}}),i?r:null}}),new tt({filterTransaction(t,e){return t.steps.some(r=>{if(r.toJSON&&r.toJSON().stepType==="replace"){const i=r.toJSON();return i.slice&&i.slice.content&&i.slice.content.some(s=>s.type===hc)}return!1})&&t.setMeta(x5.UPDATE,!0),!0}}),UK,WK]}}),jK={class:"flex gap-x-2 items-center"},qK={class:"sr-only"},KK={class:"flex justify-end gap-x-2.5 flex-1"},GK=["disabled"],k5=Ao(o.defineComponent({__name:"SuperInputDialogMoblie",props:{editor:{},open:{type:Boolean},superTextInit:{},superTextId:{},superTextElementId:{},isViewMode:{type:Boolean},title:{}},emits:["close","save","delete"],setup(t,{emit:e}){const n=e,r=t,{t:i}=Ot(),s=o.ref(""),a=o.ref(!1),l=o.ref(r.isViewMode??!1),u=o.ref(!1);o.watch(()=>r.isViewMode,g=>{l.value=g,g||(s.value="")});const c=o.computed(()=>{var b;if(!s.value)return!0;const g=document.createElement("div");return g.innerHTML=s.value,((b=g==null?void 0:g.textContent)==null?void 0:b.trim())===""});o.watch(()=>r.open,()=>{r.open&&r.superTextInit&&(s.value=r.superTextInit)});const f=()=>{n("close"),a.value=!1,l.value=!0,u.value=!1},p=()=>{n("save",s.value),s.value="",l.value=!0,u.value=!1},m=()=>{u.value=!0,l.value=!1};return(g,b)=>{const v=Bp,w=Op,C=Mp,E=Ap,k=bb,x=Tp,_=_p;return o.openBlock(),o.createBlock(_,{open:g.open},{default:o.withCtx(()=>[o.createVNode(x,{isOverlayTransparent:"",class:"p-2.5 gap-0 gap-y-2.5 border-none w-[calc(100%-40px)] !shadow-ed rounded-[5px]"},{default:o.withCtx(()=>[o.createVNode(C,{class:"text-left flex-row justify-between"},{default:o.withCtx(()=>[o.createVNode(v,{class:"text-base font-normal"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(g.title?g.title:o.unref(i)("editor.superinput")),1)]),_:1}),o.createElementVNode("div",jK,[o.withDirectives(o.createElementVNode("button",{onClick:m},[o.createVNode(o.unref(ng),{icon:"lucide:edit-2"})],512),[[o.vShow,l.value]]),o.createVNode(w,{class:"outline-none",onClick:f},{default:o.withCtx(()=>[o.createVNode(o.unref(Ff),{class:"w-5 h-5"}),o.createElementVNode("span",qK,o.toDisplayString(o.unref(i)("editor.close")),1)]),_:1})])]),_:1}),o.createVNode(E,{class:"hidden"}),o.createVNode(vb,{isReadOnly:l.value,modelValue:s.value,"onUpdate:modelValue":b[0]||(b[0]=A=>s.value=A),"parent-editor":g.editor,"spellcheck-enabled":!1},null,8,["isReadOnly","modelValue","parent-editor"]),o.createVNode(k,{class:"flex-row justify-between"},{default:o.withCtx(()=>[o.withDirectives(o.createElementVNode("button",{onClick:b[1]||(b[1]=A=>n("delete"))},o.toDisplayString(o.unref(i)("editor.delete")),513),[[o.vShow,u.value]]),o.withDirectives(o.createElementVNode("div",KK,[o.createElementVNode("button",{onClick:f},o.toDisplayString(o.unref(i)("editor.menubar.menu.cancel")),1),o.createElementVNode("button",{onClick:p,disabled:o.unref(c),class:o.normalizeClass({"cursor-not-allowed":o.unref(c)})},o.toDisplayString(o.unref(i)("editor.menubar.menu.save")),11,GK)],512),[[o.vShow,u.value||!l.value]])]),_:1})]),_:1})]),_:1},8,["open"])}}}),[["__scopeId","data-v-2f4982a0"]]),XK=["innerHTML"],YK=["book-mark-node-id","page-id","page-number","book-mark-content","node-id","line-id"],JK=o.defineComponent({__name:"ConfigPlan",props:zs,setup(t){const e=t,n=o.ref(!1),r=o.ref(null),{selection:i,doc:s}=e.editor.state,a=o.inject("isMobile"),l=o.ref(!1),u=ct.useEventBus(ar.RENDER_SUPER_TEXT),c=o.computed(()=>{var _,A;const C=s.resolve(i.from),E=C==null?void 0:C.node(-1),k=(_=E==null?void 0:E.attrs)==null?void 0:_.id,x=(A=E==null?void 0:E.attrs)==null?void 0:A.pageNumber;return{pageId:k,pageNumber:x}}),f=o.computed(()=>{const C=e.getPos(),E=e.editor.state.doc.resolve(C);for(let k=E.depth;k>0;k--){const x=E.node(k);if(x.type.name==="paragraph")return x}return null}),p=o.computed(()=>{var C;return((C=f.value)==null?void 0:C.attrs.id)||""});function m(C){e.updateAttributes({"data-text":C}),n.value=!1}function g(C){const E=e.node.attrs[Ne.TEXT],k=e.node.attrs[Ne.ID],_={lineId:C.target.querySelector(`[node-id="${k}"]`).getAttribute("line-id"),text:E};u.emit({action:"hover",payload:_})}function b(C){const E=e.node.attrs[Ne.ID],x={lineId:C.target.querySelector(`[node-id="${E}"]`).getAttribute("line-id"),text:""};u.emit({action:"hover",payload:x})}function v(){const{getPos:C,node:E,editor:k}=e,x=C(),_=x+1;k.commands.deleteRange({from:x,to:_})}function w(){n.value=!0,a&&(l.value=!0)}return(C,E)=>{const k=wn,x=gb,_=mb,A=hb,T=pb,B=pc;return o.openBlock(),o.createBlock(o.unref(Hs),{as:"span",class:o.normalizeClass(["w-fit text-inherit super-text align-middle",{"!leading-[9px] [&_*]:!leading-[9px]":o.unref(a)}]),"data-drag-handle":"",draggable:"true",contenteditable:"false"},{default:o.withCtx(()=>[o.createVNode(T,null,{default:o.withCtx(()=>[o.createVNode(x,{as:"template",class:"relative"},{default:o.withCtx(()=>[o.createVNode(k,{variant:"ghost",class:"!p-0 !m-0 !h-fit font-normal !text-ed-blue",onClick:w,onMouseenter:g,onMouseleave:b},{default:o.withCtx(()=>[o.createVNode(o.unref(Tt),{name:"plan",class:o.normalizeClass({"w-[18px] h-auto pr-1":o.unref(a)})},null,8,["class"]),E[3]||(E[3]=o.createTextVNode(" [")),o.createElementVNode("span",{class:"[&_*]:inline",innerHTML:e.node.attrs[o.unref(Ne).TEXT]},null,8,XK),E[4]||(E[4]=o.createTextVNode("] ")),o.createElementVNode("div",{ref_key:"bookMarkRef",ref:r,"book-mark-node-id":e.node.attrs[o.unref(Ne).ID],"page-id":c.value.pageId,"page-number":c.value.pageNumber,"book-mark-content":e.node.attrs[o.unref(Ne).TEXT],"node-id":e.node.attrs[o.unref(Ne).ID],"line-id":p.value},null,8,YK)]),_:1})]),_:1}),o.createVNode(A,null,{default:o.withCtx(()=>[o.createVNode(_,{onSelect:E[0]||(E[0]=L=>n.value=!0)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(C.$t("editor.configPlan.edit")),1)]),_:1}),o.createVNode(_,{onSelect:v},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(C.$t("editor.configPlan.delete")),1)]),_:1})]),_:1})]),_:1}),o.unref(a)?(o.openBlock(),o.createBlock(k5,{key:1,title:C.$t("editor.configPlan"),open:n.value,"is-view-mode":l.value,editor:e.editor,"super-text-init":e.node.attrs[o.unref(Ne).TEXT],"super-text-id":e.node.attrs[o.unref(Ne).ID],onClose:E[2]||(E[2]=L=>n.value=!1),onSave:m,onDelete:v},null,8,["title","open","is-view-mode","editor","super-text-init","super-text-id"])):(o.openBlock(),o.createBlock(B,{key:0,open:n.value,editor:e.editor,"super-text-init":e.node.attrs[o.unref(Ne).TEXT],"super-text-element-id":e.node.attrs[o.unref(Ne).ELEMENT_ID],onClose:E[1]||(E[1]=L=>n.value=!1),onSave:m},null,8,["open","editor","super-text-init","super-text-element-id"]))]),_:1},8,["class"])}}}),S5=It.create({name:"configPlan",inline:!0,group:"inline",atom:!0,draggable:!0,addStorage(){return{isShowConfigPlanInput:!1}},addOptions(){return{specialCharModal:null,button:({editor:t,t:e,isMobile:n})=>[...n?[{component:Ke,componentProps:{action:()=>{t.commands.toggleConfigPlanInput()},isActive:()=>{},icon:"plan",title:e("editor.insertConfigPlan"),tooltip:e("editor.insertConfigPlan"),customClass:"whitespace-nowrap !bg-ed-blue !text-white !font-normal rounded-[3px] h-[26px] gap-x-1 ml-auto",customClassTooltip:"ml-auto"}}]:[]]}},addAttributes(){return{"data-id":{default:null},"data-text":{default:""},"data-position":{default:"0"}}},addCommands(){return{toggleConfigPlanInput:()=>({editor:t})=>t.storage.configPlan.isShowConfigPlanInput=!t.storage.configPlan.isShowConfigPlanInput}},parseHTML(){return[{tag:"button.config-plan"}]},renderHTML({HTMLAttributes:t}){return["button",vt(t,{class:"config-plan"})]},addNodeView(){return Us(JK)},addProseMirrorPlugins(){return[new tt({appendTransaction(t,e,n){let r=n.tr,i=!1;return n.doc.descendants((s,a)=>{if(s.type.name==="configPlan"){const l=s.attrs["data-position"],u=String(a);l!==u&&(r=r.setNodeMarkup(a,void 0,{...s.attrs,"data-position":u}),i=!0)}}),i?r:null}})]}});var kb,Sb;if(typeof WeakMap<"u"){let t=new WeakMap;kb=e=>t.get(e),Sb=(e,n)=>(t.set(e,n),n)}else{const t=[];let n=0;kb=r=>{for(let i=0;i<t.length;i+=2)if(t[i]==r)return t[i+1]},Sb=(r,i)=>(n==10&&(n=0),t[n++]=r,t[n++]=i)}var on=class{constructor(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r}findCell(t){for(let e=0;e<this.map.length;e++){const n=this.map[e];if(n!=t)continue;const r=e%this.width,i=e/this.width|0;let s=r+1,a=i+1;for(let l=1;s<this.width&&this.map[e+l]==n;l++)s++;for(let l=1;a<this.height&&this.map[e+this.width*l]==n;l++)a++;return{left:r,top:i,right:s,bottom:a}}throw new RangeError(`No cell with offset ${t} found`)}colCount(t){for(let e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw new RangeError(`No cell with offset ${t} found`)}nextCell(t,e,n){const{left:r,right:i,top:s,bottom:a}=this.findCell(t);return e=="horiz"?(n<0?r==0:i==this.width)?null:this.map[s*this.width+(n<0?r-1:i)]:(n<0?s==0:a==this.height)?null:this.map[r+this.width*(n<0?s-1:a)]}rectBetween(t,e){const{left:n,right:r,top:i,bottom:s}=this.findCell(t),{left:a,right:l,top:u,bottom:c}=this.findCell(e);return{left:Math.min(n,a),top:Math.min(i,u),right:Math.max(r,l),bottom:Math.max(s,c)}}cellsInRect(t){const e=[],n={};for(let r=t.top;r<t.bottom;r++)for(let i=t.left;i<t.right;i++){const s=r*this.width+i,a=this.map[s];n[a]||(n[a]=!0,!(i==t.left&&i&&this.map[s-1]==a||r==t.top&&r&&this.map[s-this.width]==a)&&e.push(a))}return e}positionAt(t,e,n){for(let r=0,i=0;;r++){const s=i+n.child(r).nodeSize;if(r==t){let a=e+t*this.width;const l=(t+1)*this.width;for(;a<l&&this.map[a]<i;)a++;return a==l?s-1:this.map[a]}i=s}}static get(t){return kb(t)||Sb(t,ZK(t))}};function ZK(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=QK(t),n=t.childCount,r=[];let i=0,s=null;const a=[];for(let c=0,f=e*n;c<f;c++)r[c]=0;for(let c=0,f=0;c<n;c++){const p=t.child(c);f++;for(let b=0;;b++){for(;i<r.length&&r[i]!=0;)i++;if(b==p.childCount)break;const v=p.child(b),{colspan:w,rowspan:C,colwidth:E}=v.attrs;for(let k=0;k<C;k++){if(k+c>=n){(s||(s=[])).push({type:"overlong_rowspan",pos:f,n:C-k});break}const x=i+k*e;for(let _=0;_<w;_++){r[x+_]==0?r[x+_]=f:(s||(s=[])).push({type:"collision",row:c,pos:f,n:w-_});const A=E&&E[_];if(A){const T=(x+_)%e*2,B=a[T];B==null||B!=A&&a[T+1]==1?(a[T]=A,a[T+1]=1):B==A&&a[T+1]++}}}i+=w,f+=v.nodeSize}const m=(c+1)*e;let g=0;for(;i<m;)r[i++]==0&&g++;g&&(s||(s=[])).push({type:"missing",row:c,n:g}),f++}(e===0||n===0)&&(s||(s=[])).push({type:"zero_sized"});const l=new on(e,n,r,s);let u=!1;for(let c=0;!u&&c<a.length;c+=2)a[c]!=null&&a[c+1]<n&&(u=!0);return u&&NK(l,a,t),l}function QK(t){let e=-1,n=!1;for(let r=0;r<t.childCount;r++){const i=t.child(r);let s=0;if(n)for(let a=0;a<r;a++){const l=t.child(a);for(let u=0;u<l.childCount;u++){const c=l.child(u);a+c.attrs.rowspan>r&&(s+=c.attrs.colspan)}}for(let a=0;a<i.childCount;a++){const l=i.child(a);s+=l.attrs.colspan,l.attrs.rowspan>1&&(n=!0)}e==-1?e=s:e!=s&&(e=Math.max(e,s))}return e}function NK(t,e,n){t.problems||(t.problems=[]);const r={};for(let i=0;i<t.map.length;i++){const s=t.map[i];if(r[s])continue;r[s]=!0;const a=n.nodeAt(s);if(!a)throw new RangeError(`No cell with offset ${s} found`);let l=null;const u=a.attrs;for(let c=0;c<u.colspan;c++){const f=(i+c)%t.width,p=e[f*2];p!=null&&(!u.colwidth||u.colwidth[c]!=p)&&((l||(l=eG(u)))[c]=p)}l&&t.problems.unshift({type:"colwidth mismatch",pos:s,colwidth:l})}}function eG(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function $n(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(const n in t.nodes){const r=t.nodes[n],i=r.spec.tableRole;i&&(e[i]=r)}}return e}var ps=new kt("selectingCells");function _l(t){for(let e=t.depth-1;e>0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function tG(t){for(let e=t.depth;e>0;e--){const n=t.node(e).type.spec.tableRole;if(n==="cell"||n==="header_cell")return t.node(e)}return null}function po(t){const e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return!0;return!1}function Lp(t){const e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const n=_l(e.$head)||nG(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function nG(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function _b(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function rG(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function Tb(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function _5(t,e,n){const r=t.node(-1),i=on.get(r),s=t.start(-1),a=i.nextCell(t.pos-s,e,n);return a==null?null:t.node(0).resolve(s+a)}function da(t,e,n=1){const r={...t,colspan:t.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some(i=>i>0)||(r.colwidth=null)),r}function T5(t,e,n=1){const r={...t,colspan:t.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let i=0;i<n;i++)r.colwidth.splice(e,0,0)}return r}function oG(t,e,n){const r=$n(e.type.schema).header_cell;for(let i=0;i<t.height;i++)if(e.nodeAt(t.map[n+i*t.width]).type!=r)return!1;return!0}var Ht=class Ti extends Ve{constructor(e,n=e){const r=e.node(-1),i=on.get(r),s=e.start(-1),a=i.rectBetween(e.pos-s,n.pos-s),l=e.node(0),u=i.cellsInRect(a).filter(f=>f!=n.pos-s);u.unshift(n.pos-s);const c=u.map(f=>{const p=r.nodeAt(f);if(!p)throw RangeError(`No cell with offset ${f} found`);const m=s+f+1;return new gy(l.resolve(m),l.resolve(m+p.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=n}map(e,n){const r=e.resolve(n.map(this.$anchorCell.pos)),i=e.resolve(n.map(this.$headCell.pos));if(_b(r)&&_b(i)&&Tb(r,i)){const s=this.$anchorCell.node(-1)!=r.node(-1);return s&&this.isRowSelection()?Ti.rowSelection(r,i):s&&this.isColSelection()?Ti.colSelection(r,i):new Ti(r,i)}return Ae.between(r,i)}content(){const e=this.$anchorCell.node(-1),n=on.get(e),r=this.$anchorCell.start(-1),i=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),s={},a=[];for(let u=i.top;u<i.bottom;u++){const c=[];for(let f=u*n.width+i.left,p=i.left;p<i.right;p++,f++){const m=n.map[f];if(s[m])continue;s[m]=!0;const g=n.findCell(m);let b=e.nodeAt(m);if(!b)throw RangeError(`No cell with offset ${m} found`);const v=i.left-g.left,w=g.right-i.right;if(v>0||w>0){let C=b.attrs;if(v>0&&(C=da(C,0,v)),w>0&&(C=da(C,C.colspan-w,w)),g.left<i.left){if(b=b.type.createAndFill(C),!b)throw RangeError(`Could not create cell with attrs ${JSON.stringify(C)}`)}else b=b.type.create(C,b.content)}if(g.top<i.top||g.bottom>i.bottom){const C={...b.attrs,rowspan:Math.min(g.bottom,i.bottom)-Math.max(g.top,i.top)};g.top<i.top?b=b.type.createAndFill(C):b=b.type.create(C,b.content)}c.push(b)}a.push(e.child(u).copy(fe.from(c)))}const l=this.isColSelection()&&this.isRowSelection()?e:a;return new Ee(fe.from(l),1,1)}replace(e,n=Ee.empty){const r=e.steps.length,i=this.ranges;for(let a=0;a<i.length;a++){const{$from:l,$to:u}=i[a],c=e.mapping.slice(r);e.replace(c.map(l.pos),c.map(u.pos),a?Ee.empty:n)}const s=Ve.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);s&&e.setSelection(s)}replaceWith(e,n){this.replace(e,new Ee(fe.from(n),0,0))}forEachCell(e){const n=this.$anchorCell.node(-1),r=on.get(n),i=this.$anchorCell.start(-1),s=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let a=0;a<s.length;a++)e(n.nodeAt(s[a]),i+s[a])}isColSelection(){const e=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(e,n)>0)return!1;const r=e+this.$anchorCell.nodeAfter.attrs.rowspan,i=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,i)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){const r=e.node(-1),i=on.get(r),s=e.start(-1),a=i.findCell(e.pos-s),l=i.findCell(n.pos-s),u=e.node(0);return a.top<=l.top?(a.top>0&&(e=u.resolve(s+i.map[a.left])),l.bottom<i.height&&(n=u.resolve(s+i.map[i.width*(i.height-1)+l.right-1]))):(l.top>0&&(n=u.resolve(s+i.map[l.left])),a.bottom<i.height&&(e=u.resolve(s+i.map[i.width*(i.height-1)+a.right-1]))),new Ti(e,n)}isRowSelection(){const e=this.$anchorCell.node(-1),n=on.get(e),r=this.$anchorCell.start(-1),i=n.colCount(this.$anchorCell.pos-r),s=n.colCount(this.$headCell.pos-r);if(Math.min(i,s)>0)return!1;const a=i+this.$anchorCell.nodeAfter.attrs.colspan,l=s+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,l)==n.width}eq(e){return e instanceof Ti&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){const r=e.node(-1),i=on.get(r),s=e.start(-1),a=i.findCell(e.pos-s),l=i.findCell(n.pos-s),u=e.node(0);return a.left<=l.left?(a.left>0&&(e=u.resolve(s+i.map[a.top*i.width])),l.right<i.width&&(n=u.resolve(s+i.map[i.width*(l.top+1)-1]))):(l.left>0&&(n=u.resolve(s+i.map[l.top*i.width])),a.right<i.width&&(e=u.resolve(s+i.map[i.width*(a.top+1)-1]))),new Ti(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new Ti(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){return new Ti(e.resolve(n),e.resolve(r))}getBookmark(){return new iG(this.$anchorCell.pos,this.$headCell.pos)}};Ht.prototype.visible=!1,Ve.jsonID("cell",Ht);var iG=class $_{constructor(e,n){this.anchor=e,this.head=n}map(e){return new $_(e.map(this.anchor),e.map(this.head))}resolve(e){const n=e.resolve(this.anchor),r=e.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&r.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&r.index()<r.parent.childCount&&Tb(n,r)?new Ht(n,r):Ve.near(r,1)}};function sG(t){if(!(t.selection instanceof Ht))return null;const e=[];return t.selection.forEachCell((n,r)=>{e.push(jt.node(r,r+n.nodeSize,{class:"selectedCell"}))}),mt.create(t.doc,e)}function aG({$from:t,$to:e}){if(t.pos==e.pos||t.pos<e.pos-6)return!1;let n=t.pos,r=e.pos,i=t.depth;for(;i>=0&&!(t.after(i+1)<t.end(i));i--,n++);for(let s=e.depth;s>=0&&!(e.before(s+1)>e.start(s));s--,r--);return n==r&&/row|table/.test(t.node(i).type.spec.tableRole)}function lG({$from:t,$to:e}){let n,r;for(let i=t.depth;i>0;i--){const s=t.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){n=s;break}}for(let i=e.depth;i>0;i--){const s=e.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){r=s;break}}return n!==r&&e.parentOffset===0}function uG(t,e,n){const r=(e||t).selection,i=(e||t).doc;let s,a;if(r instanceof Pe&&(a=r.node.type.spec.tableRole)){if(a=="cell"||a=="header_cell")s=Ht.create(i,r.from);else if(a=="row"){const l=i.resolve(r.from+1);s=Ht.rowSelection(l,l)}else if(!n){const l=on.get(r.node),u=r.from+1,c=u+l.map[l.width*l.height-1];s=Ht.create(i,u+1,c)}}else r instanceof Ae&&aG(r)?s=Ae.create(i,r.from):r instanceof Ae&&lG(r)&&(s=Ae.create(i,r.$from.start(),r.$from.end()));return s&&(e||(e=t.tr)).setSelection(s),e}var cG=new kt("fix-tables");function A5(t,e,n,r){const i=t.childCount,s=e.childCount;e:for(let a=0,l=0;a<s;a++){const u=e.child(a);for(let c=l,f=Math.min(i,a+3);c<f;c++)if(t.child(c)==u){l=c+1,n+=u.nodeSize;continue e}r(u,n),l<i&&t.child(l).sameMarkup(u)?A5(t.child(l),u,n+1,r):u.nodesBetween(0,u.content.size,r,n+1),n+=u.nodeSize}}function M5(t,e){let n;const r=(i,s)=>{i.type.spec.tableRole=="table"&&(n=dG(t,i,s,n))};return e?e.doc!=t.doc&&A5(e.doc,t.doc,0,r):t.doc.descendants(r),n}function dG(t,e,n,r){const i=on.get(e);if(!i.problems)return r;r||(r=t.tr);const s=[];for(let u=0;u<i.height;u++)s.push(0);for(let u=0;u<i.problems.length;u++){const c=i.problems[u];if(c.type=="collision"){const f=e.nodeAt(c.pos);if(!f)continue;const p=f.attrs;for(let m=0;m<p.rowspan;m++)s[c.row+m]+=c.n;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,da(p,p.colspan-c.n,c.n))}else if(c.type=="missing")s[c.row]+=c.n;else if(c.type=="overlong_rowspan"){const f=e.nodeAt(c.pos);if(!f)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...f.attrs,rowspan:f.attrs.rowspan-c.n})}else if(c.type=="colwidth mismatch"){const f=e.nodeAt(c.pos);if(!f)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...f.attrs,colwidth:c.colwidth})}else if(c.type=="zero_sized"){const f=r.mapping.map(n);r.delete(f,f+e.nodeSize)}}let a,l;for(let u=0;u<s.length;u++)s[u]&&(a==null&&(a=u),l=u);for(let u=0,c=n+1;u<i.height;u++){const f=e.child(u),p=c+f.nodeSize,m=s[u];if(m>0){let g="cell";f.firstChild&&(g=f.firstChild.type.spec.tableRole);const b=[];for(let w=0;w<m;w++){const C=$n(t.schema)[g].createAndFill();C&&b.push(C)}const v=(u==0||a==u-1)&&l==u?c+1:p-1;r.insert(r.mapping.map(v),b)}c=p}return r.setMeta(cG,{fixTables:!0})}function zo(t){const e=t.selection,n=Lp(t),r=n.node(-1),i=n.start(-1),s=on.get(r);return{...e instanceof Ht?s.rectBetween(e.$anchorCell.pos-i,e.$headCell.pos-i):s.findCell(n.pos-i),tableStart:i,map:s,table:r}}function O5(t,{map:e,tableStart:n,table:r},i){let s=i>0?-1:0;oG(e,r,i+s)&&(s=i==0||i==e.width?null:0);for(let a=0;a<e.height;a++){const l=a*e.width+i;if(i>0&&i<e.width&&e.map[l-1]==e.map[l]){const u=e.map[l],c=r.nodeAt(u);t.setNodeMarkup(t.mapping.map(n+u),null,T5(c.attrs,i-e.colCount(u))),a+=c.attrs.rowspan-1}else{const u=s==null?$n(r.type.schema).cell:r.nodeAt(e.map[l+s]).type,c=e.positionAt(a,i,r);t.insert(t.mapping.map(n+c),u.createAndFill())}}return t}function fG(t,e){if(!po(t))return!1;if(e){const n=zo(t);e(O5(t.tr,n,n.left))}return!0}function pG(t,e){if(!po(t))return!1;if(e){const n=zo(t);e(O5(t.tr,n,n.right))}return!0}function hG(t,{map:e,table:n,tableStart:r},i){const s=t.mapping.maps.length;for(let a=0;a<e.height;){const l=a*e.width+i,u=e.map[l],c=n.nodeAt(u),f=c.attrs;if(i>0&&e.map[l-1]==u||i<e.width-1&&e.map[l+1]==u)t.setNodeMarkup(t.mapping.slice(s).map(r+u),null,da(f,i-e.colCount(u)));else{const p=t.mapping.slice(s).map(r+u);t.delete(p,p+c.nodeSize)}a+=f.rowspan}}function mG(t,e){if(!po(t))return!1;if(e){const n=zo(t),r=t.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let i=n.right-1;hG(r,n,i),i!=n.left;i--){const s=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!s)throw RangeError("No table found");n.table=s,n.map=on.get(s)}e(r)}return!0}function gG(t,e,n){var r;const i=$n(e.type.schema).header_cell;for(let s=0;s<t.width;s++)if(((r=e.nodeAt(t.map[s+n*t.width]))==null?void 0:r.type)!=i)return!1;return!0}function B5(t,{map:e,tableStart:n,table:r},i){var s;let a=n;for(let c=0;c<i;c++)a+=r.child(c).nodeSize;const l=[];let u=i>0?-1:0;gG(e,r,i+u)&&(u=i==0||i==e.height?null:0);for(let c=0,f=e.width*i;c<e.width;c++,f++)if(i>0&&i<e.height&&e.map[f]==e.map[f-e.width]){const p=e.map[f],m=r.nodeAt(p).attrs;t.setNodeMarkup(n+p,null,{...m,rowspan:m.rowspan+1}),c+=m.colspan-1}else{const p=u==null?$n(r.type.schema).cell:(s=r.nodeAt(e.map[f+u*e.width]))==null?void 0:s.type,m=p==null?void 0:p.createAndFill();m&&l.push(m)}return t.insert(a,$n(r.type.schema).row.create(null,l)),t}function bG(t,e){if(!po(t))return!1;if(e){const n=zo(t);e(B5(t.tr,n,n.top))}return!0}function vG(t,e){if(!po(t))return!1;if(e){const n=zo(t);e(B5(t.tr,n,n.bottom))}return!0}function yG(t,{map:e,table:n,tableStart:r},i){let s=0;for(let c=0;c<i;c++)s+=n.child(c).nodeSize;const a=s+n.child(i).nodeSize,l=t.mapping.maps.length;t.delete(s+r,a+r);const u=new Set;for(let c=0,f=i*e.width;c<e.width;c++,f++){const p=e.map[f];if(!u.has(p)){if(u.add(p),i>0&&p==e.map[f-e.width]){const m=n.nodeAt(p).attrs;t.setNodeMarkup(t.mapping.slice(l).map(p+r),null,{...m,rowspan:m.rowspan-1}),c+=m.colspan-1}else if(i<e.height&&p==e.map[f+e.width]){const m=n.nodeAt(p),g=m.attrs,b=m.type.create({...g,rowspan:m.attrs.rowspan-1},m.content),v=e.positionAt(i+1,c,n);t.insert(t.mapping.slice(l).map(r+v),b),c+=g.colspan-1}}}}function wG(t,e){if(!po(t))return!1;if(e){const n=zo(t),r=t.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let i=n.bottom-1;yG(r,n,i),i!=n.top;i--){const s=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!s)throw RangeError("No table found");n.table=s,n.map=on.get(n.table)}e(r)}return!0}function I5(t){const e=t.content;return e.childCount==1&&e.child(0).isTextblock&&e.child(0).childCount==0}function CG({width:t,height:e,map:n},r){let i=r.top*t+r.left,s=i,a=(r.bottom-1)*t+r.left,l=i+(r.right-r.left-1);for(let u=r.top;u<r.bottom;u++){if(r.left>0&&n[s]==n[s-1]||r.right<t&&n[l]==n[l+1])return!0;s+=t,l+=t}for(let u=r.left;u<r.right;u++){if(r.top>0&&n[i]==n[i-t]||r.bottom<e&&n[a]==n[a+t])return!0;i++,a++}return!1}function R5(t,e){const n=t.selection;if(!(n instanceof Ht)||n.$anchorCell.pos==n.$headCell.pos)return!1;const r=zo(t),{map:i}=r;if(CG(i,r))return!1;if(e){const s=t.tr,a={};let l=fe.empty,u,c;for(let f=r.top;f<r.bottom;f++)for(let p=r.left;p<r.right;p++){const m=i.map[f*i.width+p],g=r.table.nodeAt(m);if(!(a[m]||!g))if(a[m]=!0,u==null)u=m,c=g;else{I5(g)||(l=l.append(g.content));const b=s.mapping.map(m+r.tableStart);s.delete(b,b+g.nodeSize)}}if(u==null||c==null)return!0;if(s.setNodeMarkup(u+r.tableStart,null,{...T5(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),l.size){const f=u+1+c.content.size,p=I5(c)?u+1:f;s.replaceWith(p+r.tableStart,f+r.tableStart,l)}s.setSelection(new Ht(s.doc.resolve(u+r.tableStart))),e(s)}return!0}function L5(t,e){const n=$n(t.schema);return xG(({node:r})=>n[r.type.spec.tableRole])(t,e)}function xG(t){return(e,n)=>{var r;const i=e.selection;let s,a;if(i instanceof Ht){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;s=i.$anchorCell.nodeAfter,a=i.$anchorCell.pos}else{if(s=tG(i.$from),!s)return!1;a=(r=_l(i.$from))==null?void 0:r.pos}if(s==null||a==null||s.attrs.colspan==1&&s.attrs.rowspan==1)return!1;if(n){let l=s.attrs;const u=[],c=l.colwidth;l.rowspan>1&&(l={...l,rowspan:1}),l.colspan>1&&(l={...l,colspan:1});const f=zo(e),p=e.tr;for(let g=0;g<f.right-f.left;g++)u.push(c?{...l,colwidth:c&&c[g]?[c[g]]:null}:l);let m;for(let g=f.top;g<f.bottom;g++){let b=f.map.positionAt(g,f.left,f.table);g==f.top&&(b+=s.nodeSize);for(let v=f.left,w=0;v<f.right;v++,w++)v==f.left&&g==f.top||p.insert(m=p.mapping.map(b+f.tableStart,1),t({node:s,row:g,col:v}).createAndFill(u[w]))}p.setNodeMarkup(a,t({node:s,row:f.top,col:f.left}),u[0]),i instanceof Ht&&p.setSelection(new Ht(p.doc.resolve(i.$anchorCell.pos),m?p.doc.resolve(m):void 0)),n(p)}return!0}}function EG(t,e){return function(n,r){if(!po(n))return!1;const i=Lp(n);if(i.nodeAfter.attrs[t]===e)return!1;if(r){const s=n.tr;n.selection instanceof Ht?n.selection.forEachCell((a,l)=>{a.attrs[t]!==e&&s.setNodeMarkup(l,null,{...a.attrs,[t]:e})}):s.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[t]:e}),r(s)}return!0}}function kG(t){return function(e,n){if(!po(e))return!1;if(n){const r=$n(e.schema),i=zo(e),s=e.tr,a=i.map.cellsInRect(t=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:t=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),l=a.map(u=>i.table.nodeAt(u));for(let u=0;u<a.length;u++)l[u].type==r.header_cell&&s.setNodeMarkup(i.tableStart+a[u],r.cell,l[u].attrs);if(s.steps.length==0)for(let u=0;u<a.length;u++)s.setNodeMarkup(i.tableStart+a[u],r.header_cell,l[u].attrs);n(s)}return!0}}function P5(t,e,n){const r=e.map.cellsInRect({left:0,top:0,right:t=="row"?e.map.width:1,bottom:t=="column"?e.map.height:1});for(let i=0;i<r.length;i++){const s=e.table.nodeAt(r[i]);if(s&&s.type!==n.header_cell)return!1}return!0}function mc(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?kG(t):function(n,r){if(!po(n))return!1;if(r){const i=$n(n.schema),s=zo(n),a=n.tr,l=P5("row",s,i),u=P5("column",s,i),f=(t==="column"?l:t==="row"?u:!1)?1:0,p=t=="column"?{left:0,top:f,right:1,bottom:s.map.height}:t=="row"?{left:f,top:0,right:s.map.width,bottom:1}:s,m=t=="column"?u?i.cell:i.header_cell:t=="row"?l?i.cell:i.header_cell:i.cell;s.map.cellsInRect(p).forEach(g=>{const b=g+s.tableStart,v=a.doc.nodeAt(b);v&&a.setNodeMarkup(b,m,v.attrs)}),r(a)}return!0}}mc("row",{useDeprecatedLogic:!0}),mc("column",{useDeprecatedLogic:!0});var SG=mc("cell",{useDeprecatedLogic:!0});function _G(t,e){if(e<0){const n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(let r=t.index(-1)-1,i=t.before();r>=0;r--){const s=t.node(-1).child(r),a=s.lastChild;if(a)return i-1-a.nodeSize;i-=s.nodeSize}}else{if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;const n=t.node(-1);for(let r=t.indexAfter(-1),i=t.after();r<n.childCount;r++){const s=n.child(r);if(s.childCount)return i+1;i+=s.nodeSize}}return null}function D5(t){return function(e,n){if(!po(e))return!1;const r=_G(Lp(e),t);if(r==null)return!1;if(n){const i=e.doc.resolve(r);n(e.tr.setSelection(Ae.between(i,rG(i))).scrollIntoView())}return!0}}function TG(t,e){const n=t.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole=="table")return e&&e(t.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function Pp(t,e){const n=t.selection;if(!(n instanceof Ht))return!1;if(e){const r=t.tr,i=$n(t.schema).cell.createAndFill().content;n.forEachCell((s,a)=>{s.content.eq(i)||r.replace(r.mapping.map(a+1),r.mapping.map(a+s.nodeSize-1),new Ee(i,0,0))}),r.docChanged&&e(r)}return!0}function AG(t){if(!t.size)return null;let{content:e,openStart:n,openEnd:r}=t;for(;e.childCount==1&&(n>0&&r>0||e.child(0).type.spec.tableRole=="table");)n--,r--,e=e.child(0).content;const i=e.child(0),s=i.type.spec.tableRole,a=i.type.schema,l=[];if(s=="row")for(let u=0;u<e.childCount;u++){let c=e.child(u).content;const f=u?0:Math.max(0,n-1),p=u<e.childCount-1?0:Math.max(0,r-1);(f||p)&&(c=Ab($n(a).row,new Ee(c,f,p)).content),l.push(c)}else if(s=="cell"||s=="header_cell")l.push(n||r?Ab($n(a).row,new Ee(e,n,r)).content:e);else return null;return MG(a,l)}function MG(t,e){const n=[];for(let i=0;i<e.length;i++){const s=e[i];for(let a=s.childCount-1;a>=0;a--){const{rowspan:l,colspan:u}=s.child(a).attrs;for(let c=i;c<i+l;c++)n[c]=(n[c]||0)+u}}let r=0;for(let i=0;i<n.length;i++)r=Math.max(r,n[i]);for(let i=0;i<n.length;i++)if(i>=e.length&&e.push(fe.empty),n[i]<r){const s=$n(t).cell.createAndFill(),a=[];for(let l=n[i];l<r;l++)a.push(s);e[i]=e[i].append(fe.from(a))}return{height:e.length,width:r,rows:e}}function Ab(t,e){const n=t.createAndFill();return new dm(n).replace(0,n.content.size,e).doc}function OG({width:t,height:e,rows:n},r,i){if(t!=r){const s=[],a=[];for(let l=0;l<n.length;l++){const u=n[l],c=[];for(let f=s[l]||0,p=0;f<r;p++){let m=u.child(p%u.childCount);f+m.attrs.colspan>r&&(m=m.type.createChecked(da(m.attrs,m.attrs.colspan,f+m.attrs.colspan-r),m.content)),c.push(m),f+=m.attrs.colspan;for(let g=1;g<m.attrs.rowspan;g++)s[l+g]=(s[l+g]||0)+m.attrs.colspan}a.push(fe.from(c))}n=a,t=r}if(e!=i){const s=[];for(let a=0,l=0;a<i;a++,l++){const u=[],c=n[l%e];for(let f=0;f<c.childCount;f++){let p=c.child(f);a+p.attrs.rowspan>i&&(p=p.type.create({...p.attrs,rowspan:Math.max(1,i-p.attrs.rowspan)},p.content)),u.push(p)}s.push(fe.from(u))}n=s,e=i}return{width:t,height:e,rows:n}}function BG(t,e,n,r,i,s,a){const l=t.doc.type.schema,u=$n(l);let c,f;if(i>e.width)for(let p=0,m=0;p<e.height;p++){const g=n.child(p);m+=g.nodeSize;const b=[];let v;g.lastChild==null||g.lastChild.type==u.cell?v=c||(c=u.cell.createAndFill()):v=f||(f=u.header_cell.createAndFill());for(let w=e.width;w<i;w++)b.push(v);t.insert(t.mapping.slice(a).map(m-1+r),b)}if(s>e.height){const p=[];for(let b=0,v=(e.height-1)*e.width;b<Math.max(e.width,i);b++){const w=b>=e.width?!1:n.nodeAt(e.map[v+b]).type==u.header_cell;p.push(w?f||(f=u.header_cell.createAndFill()):c||(c=u.cell.createAndFill()))}const m=u.row.create(null,fe.from(p)),g=[];for(let b=e.height;b<s;b++)g.push(m);t.insert(t.mapping.slice(a).map(r+n.nodeSize-2),g)}return!!(c||f)}function V5(t,e,n,r,i,s,a,l){if(a==0||a==e.height)return!1;let u=!1;for(let c=i;c<s;c++){const f=a*e.width+c,p=e.map[f];if(e.map[f-e.width]==p){u=!0;const m=n.nodeAt(p),{top:g,left:b}=e.findCell(p);t.setNodeMarkup(t.mapping.slice(l).map(p+r),null,{...m.attrs,rowspan:a-g}),t.insert(t.mapping.slice(l).map(e.positionAt(a,b,n)),m.type.createAndFill({...m.attrs,rowspan:g+m.attrs.rowspan-a})),c+=m.attrs.colspan-1}}return u}function F5(t,e,n,r,i,s,a,l){if(a==0||a==e.width)return!1;let u=!1;for(let c=i;c<s;c++){const f=c*e.width+a,p=e.map[f];if(e.map[f-1]==p){u=!0;const m=n.nodeAt(p),g=e.colCount(p),b=t.mapping.slice(l).map(p+r);t.setNodeMarkup(b,null,da(m.attrs,a-g,m.attrs.colspan-(a-g))),t.insert(b+m.nodeSize,m.type.createAndFill(da(m.attrs,0,a-g))),c+=m.attrs.rowspan-1}}return u}function $5(t,e,n,r,i){let s=n?t.doc.nodeAt(n-1):t.doc;if(!s)throw new Error("No table found");let a=on.get(s);const{top:l,left:u}=r,c=u+i.width,f=l+i.height,p=t.tr;let m=0;function g(){if(s=n?p.doc.nodeAt(n-1):p.doc,!s)throw new Error("No table found");a=on.get(s),m=p.mapping.maps.length}BG(p,a,s,n,c,f,m)&&g(),V5(p,a,s,n,u,c,l,m)&&g(),V5(p,a,s,n,u,c,f,m)&&g(),F5(p,a,s,n,l,f,u,m)&&g(),F5(p,a,s,n,l,f,c,m)&&g();for(let b=l;b<f;b++){const v=a.positionAt(b,u,s),w=a.positionAt(b,c,s);p.replace(p.mapping.slice(m).map(v+n),p.mapping.slice(m).map(w+n),new Ee(i.rows[b-l],0,0))}g(),p.setSelection(new Ht(p.doc.resolve(n+a.positionAt(l,u,s)),p.doc.resolve(n+a.positionAt(f-1,c-1,s)))),e(p)}var IG=Um({ArrowLeft:Vp("horiz",-1),ArrowRight:Vp("horiz",1),ArrowUp:Vp("vert",-1),ArrowDown:Vp("vert",1),"Shift-ArrowLeft":Fp("horiz",-1),"Shift-ArrowRight":Fp("horiz",1),"Shift-ArrowUp":Fp("vert",-1),"Shift-ArrowDown":Fp("vert",1),Backspace:Pp,"Mod-Backspace":Pp,Delete:Pp,"Mod-Delete":Pp});function Dp(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function Vp(t,e){return(n,r,i)=>{if(!i)return!1;const s=n.selection;if(s instanceof Ht)return Dp(n,r,Ve.near(s.$headCell,e));if(t!="horiz"&&!s.empty)return!1;const a=H5(i,t,e);if(a==null)return!1;if(t=="horiz")return Dp(n,r,Ve.near(n.doc.resolve(s.head+e),e));{const l=n.doc.resolve(a),u=_5(l,t,e);let c;return u?c=Ve.near(u,1):e<0?c=Ve.near(n.doc.resolve(l.before(-1)),-1):c=Ve.near(n.doc.resolve(l.after(-1)),1),Dp(n,r,c)}}}function Fp(t,e){return(n,r,i)=>{if(!i)return!1;const s=n.selection;let a;if(s instanceof Ht)a=s;else{const u=H5(i,t,e);if(u==null)return!1;a=new Ht(n.doc.resolve(u))}const l=_5(a.$headCell,t,e);return l?Dp(n,r,new Ht(a.$anchorCell,l)):!1}}function RG(t,e){const n=t.state.doc,r=_l(n.resolve(e));return r?(t.dispatch(t.state.tr.setSelection(new Ht(r))),!0):!1}function LG(t,e,n){if(!po(t.state))return!1;let r=AG(n);const i=t.state.selection;if(i instanceof Ht){r||(r={width:1,height:1,rows:[fe.from(Ab($n(t.state.schema).cell,n))]});const s=i.$anchorCell.node(-1),a=i.$anchorCell.start(-1),l=on.get(s).rectBetween(i.$anchorCell.pos-a,i.$headCell.pos-a);return r=OG(r,l.right-l.left,l.bottom-l.top),$5(t.state,t.dispatch,a,l,r),!0}else if(r){const s=Lp(t.state),a=s.start(-1);return $5(t.state,t.dispatch,a,on.get(s.node(-1)).findCell(s.pos-a),r),!0}else return!1}function PG(t,e){var n;if(e.ctrlKey||e.metaKey)return;const r=z5(t,e.target);let i;if(e.shiftKey&&t.state.selection instanceof Ht)s(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(i=_l(t.state.selection.$anchor))!=null&&((n=Mb(t,e))==null?void 0:n.pos)!=i.pos)s(i,e),e.preventDefault();else if(!r)return;function s(u,c){let f=Mb(t,c);const p=ps.getState(t.state)==null;if(!f||!Tb(u,f))if(p)f=u;else return;const m=new Ht(u,f);if(p||!t.state.selection.eq(m)){const g=t.state.tr.setSelection(m);p&&g.setMeta(ps,u.pos),t.dispatch(g)}}function a(){t.root.removeEventListener("mouseup",a),t.root.removeEventListener("dragstart",a),t.root.removeEventListener("mousemove",l),ps.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(ps,-1))}function l(u){const c=u,f=ps.getState(t.state);let p;if(f!=null)p=t.state.doc.resolve(f);else if(z5(t,c.target)!=r&&(p=Mb(t,e),!p))return a();p&&s(p,c)}t.root.addEventListener("mouseup",a),t.root.addEventListener("dragstart",a),t.root.addEventListener("mousemove",l)}function H5(t,e,n){if(!(t.state.selection instanceof Ae))return null;const{$head:r}=t.state.selection;for(let i=r.depth-1;i>=0;i--){const s=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:s.childCount))return null;if(s.type.spec.tableRole=="cell"||s.type.spec.tableRole=="header_cell"){const l=r.before(i),u=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(u)?l:null}}return null}function z5(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function Mb(t,e){const n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?_l(t.state.doc.resolve(n.pos)):null}var DG=class{constructor(e,n){this.node=e,this.defaultCellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${n}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Ob(e,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,Ob(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function Ob(t,e,n,r,i,s){var a;let l=0,u=!0,c=e.firstChild;const f=t.firstChild;if(f){for(let p=0,m=0;p<f.childCount;p++){const{colspan:g,colwidth:b}=f.child(p).attrs;for(let v=0;v<g;v++,m++){const w=i==m?s:b&&b[v],C=w?w+"px":"";if(l+=w||r,w||(u=!1),c)c.style.width!=C&&(c.style.width=C),c=c.nextSibling;else{const E=document.createElement("col");E.style.width=C,e.appendChild(E)}}}for(;c;){const p=c.nextSibling;(a=c.parentNode)==null||a.removeChild(c),c=p}u?(n.style.width=l+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=l+"px")}}var Cr=new kt("tableColumnResizing");function VG({handleWidth:t=5,cellMinWidth:e=25,defaultCellMinWidth:n=100,View:r=DG,lastColumnResizable:i=!0}={}){const s=new tt({key:Cr,state:{init(a,l){var u,c;const f=(c=(u=s.spec)==null?void 0:u.props)==null?void 0:c.nodeViews,p=$n(l.schema).table.name;return r&&f&&(f[p]=(m,g)=>new r(m,n,g)),new FG(-1,!1)},apply(a,l){return l.apply(a)}},props:{attributes:a=>{const l=Cr.getState(a);return l&&l.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(a,l)=>{$G(a,l,t,i)},mouseleave:a=>{HG(a)},mousedown:(a,l)=>{zG(a,l,e,n)}},decorations:a=>{const l=Cr.getState(a);if(l&&l.activeHandle>-1)return KG(a,l.activeHandle)},nodeViews:{}}});return s}var FG=class Xh{constructor(e,n){this.activeHandle=e,this.dragging=n}apply(e){const n=this,r=e.getMeta(Cr);if(r&&r.setHandle!=null)return new Xh(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new Xh(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&e.docChanged){let i=e.mapping.map(n.activeHandle,-1);return _b(e.doc.resolve(i))||(i=-1),new Xh(i,n.dragging)}return n}};function $G(t,e,n,r){if(!t.editable)return;const i=Cr.getState(t.state);if(i&&!i.dragging){const s=WG(e.target);let a=-1;if(s){const{left:l,right:u}=s.getBoundingClientRect();e.clientX-l<=n?a=U5(t,e,"left",n):u-e.clientX<=n&&(a=U5(t,e,"right",n))}if(a!=i.activeHandle){if(!r&&a!==-1){const l=t.state.doc.resolve(a),u=l.node(-1),c=on.get(u),f=l.start(-1);if(c.colCount(l.pos-f)+l.nodeAfter.attrs.colspan-1==c.width-1)return}j5(t,a)}}}function HG(t){if(!t.editable)return;const e=Cr.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&j5(t,-1)}function zG(t,e,n,r){var i;if(!t.editable)return!1;const s=(i=t.dom.ownerDocument.defaultView)!=null?i:window,a=Cr.getState(t.state);if(!a||a.activeHandle==-1||a.dragging)return!1;const l=t.state.doc.nodeAt(a.activeHandle),u=UG(t,a.activeHandle,l.attrs);t.dispatch(t.state.tr.setMeta(Cr,{setDragging:{startX:e.clientX,startWidth:u}}));function c(p){s.removeEventListener("mouseup",c),s.removeEventListener("mousemove",f);const m=Cr.getState(t.state);m!=null&&m.dragging&&(jG(t,m.activeHandle,W5(m.dragging,p,n)),t.dispatch(t.state.tr.setMeta(Cr,{setDragging:null})))}function f(p){if(!p.which)return c(p);const m=Cr.getState(t.state);if(m&&m.dragging){const g=W5(m.dragging,p,n);q5(t,m.activeHandle,g,r)}}return q5(t,a.activeHandle,u,r),s.addEventListener("mouseup",c),s.addEventListener("mousemove",f),e.preventDefault(),!0}function UG(t,e,{colspan:n,colwidth:r}){const i=r&&r[r.length-1];if(i)return i;const s=t.domAtPos(e);let l=s.node.childNodes[s.offset].offsetWidth,u=n;if(r)for(let c=0;c<n;c++)r[c]&&(l-=r[c],u--);return l/u}function WG(t){for(;t&&t.nodeName!="TD"&&t.nodeName!="TH";)t=t.classList&&t.classList.contains("ProseMirror")?null:t.parentNode;return t}function U5(t,e,n,r){const i=n=="right"?-r:r,s=t.posAtCoords({left:e.clientX+i,top:e.clientY});if(!s)return-1;const{pos:a}=s,l=_l(t.state.doc.resolve(a));if(!l)return-1;if(n=="right")return l.pos;const u=on.get(l.node(-1)),c=l.start(-1),f=u.map.indexOf(l.pos-c);return f%u.width==0?-1:c+u.map[f-1]}function W5(t,e,n){const r=e.clientX-t.startX;return Math.max(n,t.startWidth+r)}function j5(t,e){t.dispatch(t.state.tr.setMeta(Cr,{setHandle:e}))}function jG(t,e,n){const r=t.state.doc.resolve(e),i=r.node(-1),s=on.get(i),a=r.start(-1),l=s.colCount(r.pos-a)+r.nodeAfter.attrs.colspan-1,u=t.state.tr;for(let c=0;c<s.height;c++){const f=c*s.width+l;if(c&&s.map[f]==s.map[f-s.width])continue;const p=s.map[f],m=i.nodeAt(p).attrs,g=m.colspan==1?0:l-s.colCount(p);if(m.colwidth&&m.colwidth[g]==n)continue;const b=m.colwidth?m.colwidth.slice():qG(m.colspan);b[g]=n,u.setNodeMarkup(a+p,null,{...m,colwidth:b})}u.docChanged&&t.dispatch(u)}function q5(t,e,n,r){const i=t.state.doc.resolve(e),s=i.node(-1),a=i.start(-1),l=on.get(s).colCount(i.pos-a)+i.nodeAfter.attrs.colspan-1;let u=t.domAtPos(i.start(-1)).node;for(;u&&u.nodeName!="TABLE";)u=u.parentNode;u&&Ob(s,u.firstChild,u,r,l,n)}function qG(t){return Array(t).fill(0)}function KG(t,e){var n;const r=[],i=t.doc.resolve(e),s=i.node(-1);if(!s)return mt.empty;const a=on.get(s),l=i.start(-1),u=a.colCount(i.pos-l)+i.nodeAfter.attrs.colspan-1;for(let c=0;c<a.height;c++){const f=u+c*a.width;if((u==a.width-1||a.map[f]!=a.map[f+1])&&(c==0||a.map[f]!=a.map[f-a.width])){const p=a.map[f],m=l+p+s.nodeAt(p).nodeSize-1,g=document.createElement("div");g.className="column-resize-handle",(n=Cr.getState(t))!=null&&n.dragging&&r.push(jt.node(l+p,l+p+s.nodeAt(p).nodeSize,{class:"column-resize-dragging"})),r.push(jt.widget(m,g))}}return mt.create(t.doc,r)}function GG({allowTableNodeSelection:t=!1}={}){return new tt({key:ps,state:{init(){return null},apply(e,n){const r=e.getMeta(ps);if(r!=null)return r==-1?null:r;if(n==null||!e.docChanged)return n;const{deleted:i,pos:s}=e.mapping.mapResult(n);return i?null:s}},props:{decorations:sG,handleDOMEvents:{mousedown:PG},createSelectionBetween(e){return ps.getState(e.state)!=null?e.state.selection:null},handleTripleClick:RG,handleKeyDown:IG,handlePaste:LG},appendTransaction(e,n,r){return uG(r,M5(r,n),t)}})}const XG=(t,e,n)=>{if(!t.doc)return t;const r=t.doc.nodeAt(e);if(!r||n===r.attrs.backgroundColor)return t;const i={...r.attrs,backgroundColor:n};return t.setNodeMarkup(e,r.type,i,r.marks)},YG=(t,e,n)=>{const{doc:r,selection:i}=t;return!r||!i||!(i instanceof Ht)||i.forEachCell((s,a)=>{t=XG(t,a,n)}),t},K5=(t,e)=>({tr:n,state:r,dispatch:i})=>{const{selection:s}=r;return n=n.setSelection(s),n=YG(n,e,t),n.docChanged?(i==null||i(n),!0):!1},JG=Qe.create({name:"tableCellBackground",addOptions(){return{types:["tableCell"],HTMLAttributes:{}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{parseHTML:t=>t.style.backgroundColor||"",renderHTML:t=>!t.backgroundColor||t.backgroundColor===""?{}:{style:`background-color: ${t.backgroundColor}`}}}}]},addCommands(){return{setTableCellBackground:t=>K5(t,this.options),unsetTableCellBackground:()=>K5("",this.options)}}}),ZG=It.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",vt(this.options.HTMLAttributes,t),0]}}),QG=It.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",vt(this.options.HTMLAttributes,t),0]}}),NG=It.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",vt(this.options.HTMLAttributes,t),0]}});function Bb(t,e){return e?["width",`${Math.max(e,t)}px`]:["min-width",`${t}px`]}function G5(t,e,n,r,i,s){var a;let l=0,u=!0,c=e.firstChild;const f=t.firstChild;if(f!==null)for(let p=0,m=0;p<f.childCount;p+=1){const{colspan:g,colwidth:b}=f.child(p).attrs;for(let v=0;v<g;v+=1,m+=1){const w=i===m?s:b&&b[v],C=w?`${w}px`:"";if(l+=w||r,w||(u=!1),c){if(c.style.width!==C){const[E,k]=Bb(r,w);c.style.setProperty(E,k)}c=c.nextSibling}else{const E=document.createElement("col"),[k,x]=Bb(r,w);E.style.setProperty(k,x),e.appendChild(E)}}}for(;c;){const p=c.nextSibling;(a=c.parentNode)===null||a===void 0||a.removeChild(c),c=p}u?(n.style.width=`${l}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${l}px`)}class eX{constructor(e,n){this.node=e,this.cellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),G5(e,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!==this.node.type?!1:(this.node=e,G5(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return e.type==="attributes"&&(e.target===this.table||this.colgroup.contains(e.target))}}function tX(t,e,n,r){let i=0,s=!0;const a=[],l=t.firstChild;if(!l)return{};for(let p=0,m=0;p<l.childCount;p+=1){const{colspan:g,colwidth:b}=l.child(p).attrs;for(let v=0;v<g;v+=1,m+=1){const w=n===m?r:b&&b[v];i+=w||e,w||(s=!1);const[C,E]=Bb(e,w);a.push(["col",{style:`${C}: ${E}`}])}}const u=s?`${i}px`:"",c=s?"":`${i}px`;return{colgroup:["colgroup",{},...a],tableWidth:u,tableMinWidth:c}}function X5(t,e){return t.createAndFill()}function nX(t){if(t.cached.tableNodeTypes)return t.cached.tableNodeTypes;const e={};return Object.keys(t.nodes).forEach(n=>{const r=t.nodes[n];r.spec.tableRole&&(e[r.spec.tableRole]=r)}),t.cached.tableNodeTypes=e,e}function rX(t,e,n,r,i){const s=nX(t),a=[],l=[];for(let c=0;c<n;c+=1){const f=X5(s.cell);if(f&&l.push(f),r){const p=X5(s.header_cell);p&&a.push(p)}}const u=[];for(let c=0;c<e;c+=1)u.push(s.row.createChecked(null,r&&c===0?a:l));return s.table.createChecked(null,u)}function oX(t){return t instanceof Ht}const $p=({editor:t})=>{const{selection:e}=t.state;if(!oX(e))return!1;let n=0;const r=f4(e.ranges[0].$from,s=>s.type.name==="table");return r==null||r.node.descendants(s=>{if(s.type.name==="table")return!1;["tableCell","tableHeader"].includes(s.type.name)&&(n+=1)}),n===e.ranges.length?(t.commands.deleteTable(),!0):!1},iX=It.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:eX,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:t,HTMLAttributes:e}){const{colgroup:n,tableWidth:r,tableMinWidth:i}=tX(t,this.options.cellMinWidth);return["table",vt(this.options.HTMLAttributes,e,{style:r?`width: ${r}`:`min-width: ${i}`}),n,["tbody",0]]},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:s})=>{const a=rX(s.schema,t,e,n);if(i){const l=r.selection.from+1;r.replaceSelectionWith(a).scrollIntoView().setSelection(Ae.near(r.doc.resolve(l)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>fG(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>pG(t,e),deleteColumn:()=>({state:t,dispatch:e})=>mG(t,e),addRowBefore:()=>({state:t,dispatch:e})=>bG(t,e),addRowAfter:()=>({state:t,dispatch:e})=>vG(t,e),deleteRow:()=>({state:t,dispatch:e})=>wG(t,e),deleteTable:()=>({state:t,dispatch:e})=>TG(t,e),mergeCells:()=>({state:t,dispatch:e})=>R5(t,e),splitCell:()=>({state:t,dispatch:e})=>L5(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>mc("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>mc("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>SG(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>R5(t,e)?!0:L5(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:r})=>EG(t,e)(n,r),goToNextCell:()=>({state:t,dispatch:e})=>D5(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>D5(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&M5(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){const r=Ht.create(e.doc,t.anchorCell,t.headCell);e.setSelection(r)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:$p,"Mod-Backspace":$p,Delete:$p,"Mod-Delete":$p}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[VG({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],GG({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(t){const e={name:t.name,options:t.options,storage:t.storage};return{tableRole:dt(Le(t,"tableRole",e))}}}),sX=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,aX=/CrOS/,lX=/android|ipad|playbook|silk/i;function Y5(t={}){let e=t.ua||typeof navigator<"u"&&navigator.userAgent;return e&&typeof e=="object"&&e.headers&&typeof e.headers["user-agent"]=="string"&&(e=e.headers["user-agent"]),typeof e!="string"?!1:!!(sX.test(e)&&!aX.test(e)||t.tablet&&lX.test(e)||t.tablet&&t.featureDetect&&navigator&&navigator.maxTouchPoints>1&&e.includes("Macintosh")&&e.includes("Safari"))}const uX=["disabled"],cX={"content-class":"table-grid-size-editor","content-style":"padding:0"},dX={class:"flex flex-col flex-wrap gap-1 justify-between"},fX=["onMouseover","onMousedown"],pX={class:"text-center text-sm text-zinc-600 mt-2"},hX=o.defineComponent({__name:"CreateTablePopover",props:{disabled:{type:Boolean,default:!1}},emits:["create-table"],setup(t,{emit:e}){const n=e,r=o.ref(!1),i=o.ref(!0),s=o.reactive({rows:Y5()?Pd:Ld,cols:Y5()?Pd:Ld}),a=o.reactive({rows:Dd,cols:Dd});function l(f,p){f===s.rows&&(s.rows=Math.min(f+1,Pd)),p===s.cols&&(s.cols=Math.min(p+1,Pd)),a.rows=f,a.cols=p}function u(f,p){n("create-table",{rows:f,cols:p,withHeaderRow:o.unref(i)}),c()}function c(){r.value=!1,i.value=!1,s.rows=Ld,s.cols=Ld,a.rows=Dd,a.cols=Dd}return(f,p)=>(o.openBlock(),o.createBlock(o.unref(Ns),null,{default:o.withCtx(()=>[o.createVNode(o.unref(pl),{"as-child":""},{default:o.withCtx(()=>[o.createElementVNode("button",{disabled:t.disabled,class:"m-0 p-0"},[o.renderSlot(f.$slots,"trigger")],8,uX)]),_:3}),o.createVNode(o.unref(ea),{class:"w-full",align:"start",side:"bottom"},{default:o.withCtx(()=>[o.createElementVNode("div",cX,[o.createElementVNode("div",dX,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(s.rows,m=>(o.openBlock(),o.createElementBlock("div",{key:"r"+m,class:"flex gap-1"},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(s.cols,g=>(o.openBlock(),o.createElementBlock("div",{key:"c"+g,class:o.normalizeClass([[g<=a.cols&&m<=a.rows&&"bg-ed-foreground border-ed-border","cursor-pointer"],"pa-1"]),onMouseover:b=>l(m,g),onMousedown:b=>u(m,g)},p[0]||(p[0]=[o.createElementVNode("div",{class:"w-4 h-4 p-1 border box-border"},null,-1)]),42,fX))),128))]))),128))]),o.createElementVNode("div",pX,o.toDisplayString(a.rows)+" x "+o.toDisplayString(a.cols),1)])]),_:1})]),_:3}))}}),mX={style:{display:"flex"}},gX=o.defineComponent({__name:"TableActionButton",props:{editor:{},icon:{default:void 0},tooltip:{default:void 0},disabled:{type:Boolean,default:!1},color:{default:void 0},action:{type:Function,default:void 0},isActive:{type:Function,default:void 0}},setup(t){const e=t;function n(r){e.editor.isActive("table")||e.editor.chain().focus().insertTable({...r,withHeaderRow:!1}).run()}return(r,i)=>(o.openBlock(),o.createBlock(hX,{disabled:r.editor.isActive("table"),onCreateTable:n},{trigger:o.withCtx(()=>[o.createElementVNode("div",mX,[o.createVNode(Ke,{icon:r.icon,tooltip:r.tooltip,disabled:r.disabled,color:r.color,action:r.action,"is-active":r.isActive},null,8,["icon","tooltip","disabled","color","action","is-active"])])]),_:1},8,["disabled"]))}}),Ib=iX.extend({addStorage(){return{isTableMenuOpen:!1}},addCommands(){var t;return{...(t=this.parent)==null?void 0:t.call(this),toggleTableEditor:e=>({editor:n})=>n.storage.table?(n.storage.table.isTableEditorOpen=e,!0):!1}},addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),resizable:!0,lastColumnResizable:!0,allowTableNodeSelection:!1,button:({editor:e,t:n})=>({component:gX,componentProps:{icon:"Table",tooltip:n("editor.table.tooltip"),action:()=>{var i;const r=((i=e.storage.table)==null?void 0:i.isTableEditorOpen)??!1;e.commands.toggleTableEditor(!r)}}})}},addExtensions(){return[QG.configure(this.options.tableRow),ZG.configure(this.options.tableHeader),NG.configure(this.options.tableCell),JG.configure(this.options.tableCellBackground)]}}),bX={class:"flex items-center gap-2 px-2"},vX=o.defineComponent({__name:"TextDropdown",props:{editor:{},disabled:{type:Boolean,default:!1},color:{default:void 0},maxHeight:{default:void 0},icon:{default:void 0},tooltip:{default:""}},setup(t){const e=t,{t:n}=Ot(),r=o.computed(()=>[{name:"paragraph",label:n("editor.paragraph.tooltip"),iconName:"Paragraph",isActive:()=>e.editor.isActive("paragraph")&&!e.editor.isActive("orderedList")&&!e.editor.isActive("bulletList")&&!e.editor.isActive("taskList"),action:()=>e.editor.chain().focus().clearNodes().run()},{name:"heading1",label:n("editor.heading.h1.tooltip"),isActive:()=>e.editor.isActive("heading",{level:1}),iconName:"Heading1",action:()=>e.editor.chain().focus().clearNodes().toggleHeading({level:1}).run()},{name:"heading2",label:n("editor.heading.h2.tooltip"),isActive:()=>e.editor.isActive("heading",{level:2}),iconName:"Heading2",action:()=>e.editor.chain().focus().clearNodes().toggleHeading({level:2}).run()},{name:"heading3",label:n("editor.heading.h3.tooltip"),isActive:()=>e.editor.isActive("heading",{level:3}),iconName:"Heading3",action:()=>e.editor.chain().focus().clearNodes().toggleHeading({level:3}).run()},{name:"bulletList",label:n("editor.bulletlist.tooltip"),isActive:()=>e.editor.isActive("bulletList"),iconName:"List",action:()=>e.editor.chain().focus().clearNodes().toggleBulletList().run()},{name:"numberedList",label:n("editor.orderedlist.tooltip"),isActive:()=>e.editor.isActive("orderedList"),iconName:"ListOrdered",action:()=>e.editor.chain().focus().clearNodes().toggleOrderedList().run()},{name:"taskList",label:n("editor.tasklist.tooltip"),isActive:()=>e.editor.isActive("taskList"),iconName:"ListTodo",action:()=>e.editor.chain().focus().clearNodes().toggleTaskList().run()},{name:"blockquote",label:n("editor.blockquote.tooltip"),isActive:()=>e.editor.isActive("blockquote"),iconName:"TextQuote",action:()=>e.editor.chain().focus().clearNodes().toggleBlockquote().run()},{name:"codeBlock",label:n("editor.codeblock.tooltip"),isActive:()=>e.editor.isActive("codeBlock"),iconName:"Code2",action:()=>e.editor.chain().focus().clearNodes().toggleCodeBlock().run()}]),i=o.computed(()=>r.value.filter(s=>s.isActive()).pop()??{label:n("editor.modify")});return(s,a)=>{var l;return o.openBlock(),o.createBlock(ia,{title:(l=i.value)==null?void 0:l.label,"side-offset":5},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.value,(u,c)=>{var f;return o.openBlock(),o.createBlock(o.unref(wl),{key:c,class:"cursor-pointer",checked:((f=u.isActive)==null?void 0:f.call(u))||!1,onClick:u.action},{default:o.withCtx(()=>[o.createElementVNode("div",bX,[o.createVNode(o.unref(Tt),{name:u.iconName,class:"h3 w-3"},null,8,["name"]),o.createElementVNode("span",null,o.toDisplayString(u.label),1)])]),_:2},1032,["checked","onClick"])}),128))]),_:1},8,["title"])}}}),yX=Qe.create({name:"text-bubble",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),toolbar:!1,button:()=>({component:vX,componentProps:{}})}}}),wX=[{label:"복합 표현 - 요일과 시간대",examples:["다음 월요일 저녁","이번 토요일 오전"],pattern:"(이번|다음)?\\s?(월|화|수|목|금|토|일)요일(\\s?(오전|오후|저녁|밤|새벽))?"},{label:"시각 표현",examples:["오전 10시","오후 3시 30분","정오","자정","새벽 2시"],pattern:"((오전|오후|새벽|밤|저녁)\\s?\\d{1,2}(시(\\s?\\d{1,2}분)?)?|정오|자정)"},{label:"시간 표현 - 이른/늦은",examples:["이른 아침","늦은 밤"],pattern:"(이른\\s아침|늦은\\s밤)"},{label:"연도+월",examples:["2019년 6월","2025년12월","2024년 01월"],pattern:"\\d{4}년\\s?\\d{1,2}월"},{label:"오늘/내일/어제",examples:["오늘","내일","모레","어제","그제","그끄제"],pattern:"(오늘|내일|모레|어제|그제|그끄제)"},{label:"상대적 주 단위",examples:["이번 주","다음 주","지난 주"],pattern:"(이번|다음|지난)\\s?주"},{label:"상대적 월 단위",examples:["이번 달","다음 달","지난 달"],pattern:"(이번|다음|지난)\\s?달"},{label:"상대적 연도",examples:["올해","내년","작년","재작년","내후년"],pattern:"(올해|내년|작년|재작년|내후년)"},{label:"복합 표현 - 날짜와 시간대",examples:["1월 1일 오전","12월25일 저녁","다음 주 금요일 오전"],pattern:"(내년|올해|작년)?\\s?\\d{1,2}\\s?월\\s?\\d{1,2}\\s?일(\\s?(오전|오후|저녁|밤|새벽))?"},{label:"정확한 날짜",examples:["1월1일","1월 1일","12월 25일","01월 01일"],pattern:"\\d{1,2}\\s?월\\s?\\d{1,2}\\s?일"},{label:"요일",examples:["월요일","화요일","이번 금요일","다음 화요일"],pattern:"(이번|다음)?\\s?(월|화|수|목|금|토|일)요일"},{label:"시간대",examples:["오전","오후","저녁","밤","새벽"],pattern:"(오전|오후|저녁|밤|새벽)"},{label:"짧은 시간 표현",examples:["방금","조금 전","금방","곧","잠시 후"],pattern:"(방금|조금\\s전|금방|곧|잠시\\s후)"},{label:"연도",examples:["2015년","2024년","1998년"],pattern:"\\d{4}년"}],CX=t=>{const e=[...t||[],...wX.map(n=>n.pattern)].join("|");return new RegExp(e,"gu")},xX=Qe.create({name:Sp,addOptions(){return{additionalTimeWords:[],enabled:!0}},addStorage(){return{cachedRegex:null,cachedAdditionalWords:null,enabled:this.options.enabled}},addProseMirrorPlugins(){return[new tt({props:{decorations:t=>{if(!this.storage.enabled)return mt.empty;const e=[];return(this.storage.cachedAdditionalWords!==this.options.additionalTimeWords||!this.storage.cachedRegex)&&(this.storage.cachedAdditionalWords=this.options.additionalTimeWords,this.storage.cachedRegex=CX(this.options.additionalTimeWords)),t.doc.descendants((n,r)=>{if(!n.isText)return;let i;const s=this.storage.cachedRegex;for(;i=s.exec(n.text||"");){const a=r+i.index,l=a+i[0].length;e.push(jt.inline(a,l,{class:"time-highlight"}))}}),mt.create(t.doc,e)}}})]},addCommands(){return{toggleTimeHighlight:()=>({editor:t})=>{const e=t.storage[Sp];return e.enabled=!e.enabled,t.view.dispatch(t.state.tr),!0}}}});function Rb(t){const e=JSON.stringify(t),n=window.ReactNativeWebView;if(n){n.postMessage(e);return}console.warn("[clipboardBridge] no bridge found")}function EX(){return new Promise(t=>{const e=window.receiveDriverData;window.receiveDriverData=n=>{var i;e&&e(n);let r;try{r=typeof n=="string"?JSON.parse(n):n}catch{return}(r==null?void 0:r.type)==="CLIPBOARD_STATE"&&t(!!((i=r.data)!=null&&i.hasClipboard))},Rb({type:"REQUEST_CLIPBOARD_STATE"})})}function kX(){return new Promise(t=>{const e=window.receiveDriverData;window.receiveDriverData=n=>{var i;e&&e(n);let r;try{r=typeof n=="string"?JSON.parse(n):n}catch{return}(r==null?void 0:r.type)==="PASTE_RESULT"&&t(((i=r.data)==null?void 0:i.text)??null)},Rb({type:"PASTE"})})}function SX(t,e){Rb({type:"COPY",data:{html:t,text:e}})}async function _X(t,e){try{const n=new ClipboardItem({"text/html":new Blob([t],{type:"text/html"}),"text/plain":new Blob([e],{type:"text/plain"})});await navigator.clipboard.write([n])}catch(n){console.error("navigator clipboard write failed:",n)}}async function TX(){try{if("read"in navigator.clipboard){const t=await navigator.clipboard.read();for(const e of t){if(e.types.includes("text/html"))return await(await e.getType("text/html")).text();if(e.types.includes("text/plain"))return await(await e.getType("text/plain")).text()}}}catch(t){console.warn("navigator clipboard read failed:",t)}}const AX=Qe.create({name:"clipboard",addCommands(){return{copyContent:()=>({editor:t,state:e})=>{const{from:n,to:r}=e.selection;return n===r?!1:((async()=>{try{const i=e.doc.slice(n,r),a=Nr.fromSchema(t.schema).serializeFragment(i.content),l=document.createElement("div");l.appendChild(a);const u=l.innerHTML,c=e.doc.textBetween(n,r,`
|
|
333
333
|
`);t.storage.deviceEnv.isMobile?SX(u,c):await _X(u,c)}catch(i){console.warn("[clipboard] copy failed",i)}})(),!0)},cutContent:()=>({editor:t})=>((async()=>{try{await t.commands.copyContent(),t.chain().focus().deleteSelection().run()}catch(e){console.warn("[clipboard] cut failed",e)}})(),!0),pasteContent:()=>({editor:t})=>((async()=>{try{t.chain().focus().run();const e=t.storage.deviceEnv.isMobile?await kX():await TX();if(!e)return;const n=new DataTransfer;n.setData("text/html",e),n.setData("text/plain",e);const r=new ClipboardEvent("paste",{bubbles:!0,cancelable:!0});Object.defineProperty(r,"clipboardData",{value:n}),t.view.dom.dispatchEvent(r)}catch(e){console.warn("Clipboard paste failed:",e)}})(),!0)}},onCreate(){const t=this.editor;t.hasClipboard=async()=>{try{return!!(t.storage.deviceEnv.isMobile?await EX():await navigator.clipboard.readText())}catch(e){return console.warn("[clipboard] check failed",e),!1}}}}),MX=Qe.create({name:"deviceEnv",addOptions(){return{initial:!1,specialCharModal:void 0}},addStorage(){return{isMobile:this.options.initial,specialCharModal:this.options.specialCharModal,isForceCloseBubble:!1}},addCommands(){return{setIsMobile:t=>({editor:e})=>{var n;return e.storage.deviceEnv.isMobile=t,(n=e.storage.spellchecker)==null||n.spellchecker.setIsMobile(t),!0},setForceCloseBubble:t=>({editor:e})=>(e.storage.deviceEnv.isForceCloseBubble=t,!0),resetForceCloseBubble:()=>({editor:t})=>(t.storage.deviceEnv.isForceCloseBubble=!1,!0)}}}),Hp=o.defineComponent({__name:"TabsContent",props:{value:{},forceMount:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,n=o.computed(()=>{const{class:r,...i}=e;return i});return(r,i)=>(o.openBlock(),o.createBlock(o.unref(vD),o.mergeProps({class:o.unref(xe)("mt-2 ring-offset-ed-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ed-ring focus-visible:ring-offset-2",e.class)},n.value),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),OX={class:"flex items-center w-full p-3 my-3 hover:bg-ed-accent border border-ed-border text-ed-muted-foreground cursor-pointer rounded-sm transition-all"},BX={key:0,class:"flex justify-center items-center gap-3 text-s"},IX={key:1,class:"flex justify-between items-center w-full"},RX={class:"flex justify-center items-center gap-3"},LX={class:"text-sm"},PX={class:"flex items-center gap-2"},DX=o.defineComponent({__name:"VideoUploader",props:{...zs},setup(t){const e=t,n=o.ref(""),r=o.ref(!1),i=o.ref(),{t:s}=Ot();function a(f){var v;r.value=!0;const p=f.target,m=Array.from((p==null?void 0:p.files)||[]),g=(v=e.editor.extensionManager.extensions.find(w=>w.name==="videoUpload"))==null?void 0:v.options;if(!e.editor||e.editor.isDestroyed||m.length===0||typeof(g==null?void 0:g.upload)!="function")return;const b=m[0];g.upload(b).then(w=>{e.editor.chain().setVideo({src:w}).deleteRange({from:e.getPos(),to:e.getPos()}).insertContentAt(e.getPos()+1,{type:"paragraph"}).focus().run(),r.value=!1})}function l(){e.editor.chain().setVideo({src:n.value,width:640}).deleteRange({from:e.getPos(),to:e.getPos()}).insertContentAt(e.getPos()+1,{type:"paragraph"}).focus().run()}function u(){e.deleteNode()}function c(){var f;(f=i.value)==null||f.click()}return(f,p)=>(o.openBlock(),o.createBlock(o.unref(Hs),{as:"div","data-drag-handle":""},{default:o.withCtx(()=>[o.createVNode(o.unref(Ns),{"default-open":""},{default:o.withCtx(()=>[o.createVNode(o.unref(pl),{"as-child":""},{default:o.withCtx(()=>[o.createElementVNode("div",OX,[r.value?(o.openBlock(),o.createElementBlock("div",BX,[o.createVNode(o.unref(Tt),{class:"animate-spin w-6 h-6",name:"LoaderCircle"}),o.createElementVNode("span",null,o.toDisplayString(o.unref(s)("editor.video.dialog.uploading"))+"...",1)])):(o.openBlock(),o.createElementBlock("div",IX,[o.createElementVNode("div",RX,[o.createVNode(o.unref(Tt),{name:"Video",class:"w-6 h-6"}),o.createElementVNode("span",LX,o.toDisplayString(o.unref(s)("editor.video.dialog.title")),1)]),o.createVNode(o.unref(Tt),{name:"Trash2",class:"hover:text-ed-foreground",onClick:o.withModifiers(u,["stop"])})]))])]),_:1}),o.createVNode(o.unref(ea),{"trap-focus":"",class:"w-full","on-open-auto-focus":m=>m.preventDefault()},{default:o.withCtx(()=>[o.createVNode(o.unref(U1),{"default-value":"upload",class:"w-[300px] sm:w-[400px]","activation-mode":"manual"},{default:o.withCtx(()=>[o.createVNode(o.unref(W1),{class:"grid w-full grid-cols-2"},{default:o.withCtx(()=>[o.createVNode(o.unref(Uu),{value:"upload"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(s)("editor.video.dialog.tab.upload")),1)]),_:1}),o.createVNode(o.unref(Uu),{value:"link",disabled:r.value},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(s)("editor.video.dialog.link")),1)]),_:1},8,["disabled"])]),_:1}),o.createVNode(o.unref(Hp),{value:"upload"},{default:o.withCtx(()=>[o.createVNode(o.unref(wn),{class:"w-full mt-1",size:"sm",disabled:r.value,onClick:c},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(s)("editor.video.dialog.tab.upload")),1)]),_:1},8,["disabled"]),o.createElementVNode("input",{ref_key:"fileInput",ref:i,type:"file",accept:"video/*",hidden:"",onChange:a},null,544)]),_:1}),o.createVNode(o.unref(Hp),{value:"link"},{default:o.withCtx(()=>[o.createElementVNode("div",PX,[o.createVNode(o.unref(fl),{modelValue:n.value,"onUpdate:modelValue":p[0]||(p[0]=m=>n.value=m),type:"url",autofocus:"",required:"",placeholder:o.unref(s)("editor.video.dialog.placeholder")},null,8,["modelValue","placeholder"]),o.createVNode(o.unref(wn),{onClick:l},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(s)("editor.video.dialog.button.apply")),1)]),_:1})])]),_:1})]),_:1})]),_:1},8,["on-open-auto-focus"])]),_:1})]),_:1}))}}),J5=It.create({name:"videoUpload",isolating:!0,defining:!0,group:"block",draggable:!0,selectable:!1,inline:!1,parseHTML(){return[{tag:`div[data-type="${this.name}"]`}]},renderHTML(){return["div",{"data-type":this.name}]},addCommands(){return{setVideoUpload:()=>({commands:t})=>t.insertContent(`<div data-type="${this.name}"></div>`)}},addNodeView(){return Us(DX)},addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),upload:()=>Promise.reject("link video not found"),button:({editor:e,t:n})=>{var r,i;return{component:Ke,componentProps:{action:()=>e.commands.setVideoUpload(),isActive:()=>e.isActive("video")||!1,disabled:!((i=(r=e.can()).setVideo)!=null&&i.call(r,{})),icon:"Video",tooltip:n("editor.video.tooltip")}}}}}});function VX(t){return t=t.replace("https://youtu.be/","https://www.youtube.com/watch?v=").replace("watch?v=","embed/"),t=t.replace("https://vimeo.com/","https://player.vimeo.com/video/"),/^https?:\/\/www.bilibili.com\/video\/.*/i.test(t)&&(t=t.replace(/\?.*$/i,"").replace("https://www.bilibili.com/video/","https://player.bilibili.com/player.html?bvid=")),t.includes("drive.google.com")&&(t=t.replace("/view","/preview")),t}function FX(t){return t?t.includes("youtube.com/embed")||t.includes("player.vimeo.com")||t.includes("player.bilibili.com")||t.includes("drive.google.com"):!1}const Z5=It.create({name:"video",group:"block",atom:!0,draggable:!0,addOptions(){return{divider:!1,spacer:!1,allowFullscreen:!0,upload:void 0,width:Vd["size-medium"],controls:!0,autoplay:!1,HTMLAttributes:{class:"iframe-wrapper",style:"display: flex;justify-content: center;"}}},addAttributes(){return{src:{default:null,renderHTML:({src:t})=>({src:t?VX(t):null})},width:{default:this.options.width,renderHTML:({width:t})=>({width:ln(t)})},allowfullscreen:{default:this.options.allowFullscreen,parseHTML:()=>this.options.allowFullscreen},controls:{default:this.options.controls}}},parseHTML(){return[{tag:"video"},{tag:"iframe"}]},renderHTML({HTMLAttributes:t}){const{src:e,width:n,controls:r,allowfullscreen:i}=t??{},s=`max-width: ${ln(n)};`;return FX(e)?["iframe",{src:e,style:s,...i&&{allowfullscreen:i}}]:["video",{src:e?e.replace(/\\/g,"/"):"",style:s,...r&&{controls:r}}]},addCommands(){return{setVideo:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t}),updateVideo:t=>({commands:e})=>e.updateAttributes(this.name,t)}}}),Tl=new kt("upload-image"),$X=()=>new tt({key:Tl,state:{init(){return mt.empty},apply(t,e){e=e.map(t.mapping,t.doc);const n=t.getMeta(Tl);return n!=null&&n.add?n.add.forEach(({id:r,pos:i,src:s})=>{const a=HX(s),l=jt.widget(i,a,{id:r});e=e.add(t.doc,[l])}):n!=null&&n.remove&&n.remove.forEach(r=>{e=e.remove(e.find(void 0,void 0,i=>i.id===r))}),e}},props:{decorations(t){return this.getState(t)}}});function HX(t){const e=document.createElement("div"),n=document.createElement("img");return n.setAttribute("class","opacity-50"),n.src=t,n.onload=()=>{e.setAttribute("class","img-placeholder")},e.appendChild(n),e}function zX(t,e){var i;const r=Tl.getState(t).find(void 0,void 0,s=>s.id===e);return r.length?(i=r[0])==null?void 0:i.from:null}const Q5=({validateFn:t,onUpload:e})=>(n,r,i,s)=>{n.forEach(a=>{if(t&&!t(a))return;s||(s=ui(6));const l=r.state.tr;l.selection.empty||l.deleteSelection();let u=null;r.state.doc.descendants((p,m)=>{p.type.name===fs&&p.attrs.id===s&&(u=m)});const c=URL.createObjectURL(a);l.setMeta(Tl,{add:[{id:s,pos:i,src:c}]}),r.dispatch(l);const f=zX(r.state,s)||u;e(a).then(p=>{var E,k;const{schema:m}=r.state;if(f===null)throw new Error("Not found placeholderPos");const g=typeof p=="object"?c:p,b=(E=m.nodes.image)==null?void 0:E.create({src:g}),v=(k=m.nodes.paragraph)==null?void 0:k.create();if(!b||!v)return;const w=r.state.tr.replaceWith(f,f,b).insert(f+b.nodeSize,v).setMeta(Tl,{remove:[s]}),C=f+b.nodeSize+1;w.setSelection(Ae.create(w.doc,C)),r.dispatch(w),r.focus()},()=>{const p=r.state.tr.delete(i,i).setMeta(Tl,{remove:[s]});r.dispatch(p)})})},UX=(t,e,n)=>{var i;const r=Array.from(((i=e.clipboardData)==null?void 0:i.files)||[]);if(r.length){e.preventDefault();const s=t.state.selection.from;return n(r,t,s+1),!0}return!1},WX=(t,e,n,r)=>{var s;const i=Array.from(((s=e.dataTransfer)==null?void 0:s.files)||[]);if(!n&&i.length){e.preventDefault();const a=t.posAtCoords({left:e.clientX,top:e.clientY});if(a)return r(i,t,a.pos+1),!0}return!1},jX={class:"flex items-center w-full p-3 my-3 transition-all border rounded-sm cursor-pointer hover:bg-ed-accent border-ed-border text-ed-muted-foreground"},qX={class:"flex items-center justify-between w-full"},KX={class:"flex items-center justify-center gap-3"},GX={class:"text-sm"},XX={class:"flex items-center gap-2"},YX=o.defineComponent({__name:"ImageUploader",props:{...zs},setup(t){const e=t,n=o.ref(""),r=o.ref(),{t:i}=Ot(),s=o.inject("isEditable",o.ref(!0));function a(f){var v,w;const p=(v=f==null?void 0:f.target)==null?void 0:v.files;if(!e.editor||e.editor.isDestroyed||p.length===0)return;const m=p[0],g=(w=e.editor.extensionManager.extensions.find(C=>C.name==="imageUpload"))==null?void 0:w.options;Q5({validateFn:C=>!0,onUpload:g.upload})([m],e.editor.view,e.getPos(),e.node.attrs.id)}function l(){e.editor.chain().setImage({src:n.value}).deleteRange({from:e.getPos(),to:e.getPos()}).insertContentAt(e.getPos()+1,{type:"paragraph"}).focus().run()}function u(){s.value&&e.deleteNode()}function c(){var f;(f=r.value)==null||f.click()}return(f,p)=>(o.openBlock(),o.createBlock(o.unref(Hs),{id:f.node.attrs.id,class:"p-0 m-0","data-drag-handle":""},{default:o.withCtx(()=>[o.createVNode(o.unref(Ns),{"default-open":""},{default:o.withCtx(()=>[o.createVNode(o.unref(pl),{"as-child":""},{default:o.withCtx(()=>[o.createElementVNode("div",jX,[o.createElementVNode("div",qX,[o.createElementVNode("div",KX,[o.createVNode(o.unref(Tt),{name:"ImageUp",class:"w-6 h-6"}),o.createElementVNode("span",GX,o.toDisplayString(o.unref(i)("editor.image.dialog.title")),1)]),o.createVNode(o.unref(Tt),{name:"Trash2",class:"hover:text-ed-foreground",onClick:o.withModifiers(u,["stop"])})])])]),_:1}),o.unref(s)?(o.openBlock(),o.createBlock(o.unref(ea),{key:0,"trap-focus":"",class:"w-full","on-open-auto-focus":m=>m.preventDefault()},{default:o.withCtx(()=>[o.createVNode(o.unref(U1),{"default-value":"upload",class:"w-[300px] sm:w-[400px]","activation-mode":"manual"},{default:o.withCtx(()=>[o.createVNode(o.unref(W1),{class:"grid w-full grid-cols-2"},{default:o.withCtx(()=>[o.createVNode(o.unref(Uu),{value:"upload"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(i)("editor.image.dialog.tab.upload")),1)]),_:1}),o.createVNode(o.unref(Uu),{value:"link"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(i)("editor.image.dialog.tab.url")),1)]),_:1})]),_:1}),o.createVNode(o.unref(Hp),{value:"upload"},{default:o.withCtx(()=>[o.createVNode(o.unref(wn),{class:"w-full mt-1",size:"sm",onClick:c},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(i)("editor.image.dialog.tab.upload")),1)]),_:1}),o.createElementVNode("input",{ref_key:"fileInput",ref:r,type:"file",accept:"image/*",multiple:"",hidden:"",onChange:a},null,544)]),_:1}),o.createVNode(o.unref(Hp),{value:"link"},{default:o.withCtx(()=>[o.createElementVNode("div",XX,[o.createVNode(o.unref(fl),{modelValue:n.value,"onUpdate:modelValue":p[0]||(p[0]=m=>n.value=m),type:"url",autofocus:"",required:"",placeholder:o.unref(i)("editor.image.dialog.placeholder")},null,8,["modelValue","placeholder"]),o.createVNode(o.unref(wn),{onClick:l},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(i)("editor.image.dialog.button.apply")),1)]),_:1})])]),_:1})]),_:1})]),_:1},8,["on-open-auto-focus"])):o.createCommentVNode("",!0)]),_:1})]),_:1},8,["id"]))}}),JX=1,ZX=1e6,mi={ADD_TOAST:"ADD_TOAST",UPDATE_TOAST:"UPDATE_TOAST",DISMISS_TOAST:"DISMISS_TOAST",REMOVE_TOAST:"REMOVE_TOAST"};let Lb=0;function QX(){return Lb=(Lb+1)%Number.MAX_VALUE,Lb.toString()}const Pb=new Map;function N5(t){if(Pb.has(t))return;const e=setTimeout(()=>{Pb.delete(t),gc({type:mi.REMOVE_TOAST,toastId:t})},ZX);Pb.set(t,e)}const ho=o.ref({toasts:[]});function gc(t){switch(t.type){case mi.ADD_TOAST:ho.value.toasts=[t.toast,...ho.value.toasts].slice(0,JX);break;case mi.UPDATE_TOAST:ho.value.toasts=ho.value.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e);break;case mi.DISMISS_TOAST:{const{toastId:e}=t;e?N5(e):ho.value.toasts.forEach(n=>{N5(n.id)}),ho.value.toasts=ho.value.toasts.map(n=>n.id===e||e===void 0?{...n,open:!1}:n);break}case mi.REMOVE_TOAST:t.toastId===void 0?ho.value.toasts=[]:ho.value.toasts=ho.value.toasts.filter(e=>e.id!==t.toastId);break}}function Db(){return{toasts:o.computed(()=>ho.value.toasts),toast:NX,dismiss:t=>gc({type:mi.DISMISS_TOAST,toastId:t})}}function NX(t){const e=QX(),n=i=>gc({type:mi.UPDATE_TOAST,toast:{...i,id:e}}),r=()=>gc({type:mi.DISMISS_TOAST,toastId:e});return gc({type:mi.ADD_TOAST,toast:{...t,id:e,open:!0,onOpenChange:i=>{i||r()}}}),{id:e,dismiss:r,update:n}}const eY={acceptMimes:["image/jpeg","image/gif","image/png","image/jpg"],maxSize:1024*1024*5},tY=t=>`${(t/1024/1024).toFixed(2)}MB`,eE=It.create({name:"imageUpload",isolating:!0,defining:!0,group:"block",draggable:!1,selectable:!1,inline:!1,onCreate(){if(typeof this.options.upload!="function")throw new Error("Image upload function should be a function")},parseHTML(){return[{tag:`div[data-type="${this.name}"]`}]},renderHTML(){return["div",{"data-type":this.name}]},addAttributes(){return{id:{default:ui(6),parseHTML:t=>t.getAttribute("id"),renderHTML:t=>t.id?{id:t.id}:{}}}},addCommands(){return{setImageUpload:()=>({commands:t})=>t.insertContent(`<div data-type="${this.name}"></div>`)}},addNodeView(){return Us(YX)},addOptions(){var t;return{...eY,...(t=this.parent)==null?void 0:t.call(this),upload:()=>Promise.reject("Image Upload Function"),button:({editor:e,extension:n,t:r})=>{var i,s;return{component:Ke,componentProps:{action:()=>e.commands.setImageUpload(),disabled:!((s=(i=e.can()).setImage)!=null&&s.call(i,{})),icon:"ImageUp",tooltip:r("editor.image.tooltip")}}}}},addProseMirrorPlugins(){const{toast:t}=Db(),{t:e}=Ot(),r=Q5({validateFn:i=>this.options.acceptMimes.includes(i.type)?i.size>this.options.maxSize?(t({description:`${e("editor.imageUpload.fileSizeTooBig")} ${tY(this.options.maxSize)}.`,duration:2e3}),!1):!0:(t({description:e("editor.imageUpload.fileTypeNotSupported"),duration:2e3}),!1),onUpload:this.options.upload});return[new tt({props:{handlePaste:(i,s)=>!s.clipboardData||Array.from(s.clipboardData.items||[]).some(l=>l.type==="text/html")?!1:UX(i,s,r),handleDrop:(i,s,a,l)=>(!(s instanceof DragEvent)||!s.dataTransfer||WX(i,s,l,r),!1)}}),$X()]}}),nY=Qe.create({name:"searchHighlight",addGlobalAttributes(){return[{types:["textStyle"],attributes:{searchHighlight:{default:null,parseHTML:t=>{const e=t,n=e.style.color,r=e.style.backgroundColor;return!n||!r?null:{color:n,backgroundColor:r}},renderHTML:t=>{if(!t.searchHighlight)return{};const{color:e,backgroundColor:n}=t.searchHighlight;return{style:`color: ${e}; background-color: ${n}`}}}}}]}}),tE=Qe.create({name:"base-kit",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),timeHighlighter:{additionalTimeWords:[]},bubble:{list:WB,defaultBubbleList:Ej,button:({editor:e,extension:n,t:r})=>{var l;const{list:i={},defaultBubbleList:s}=((l=n.options)==null?void 0:l.bubble)??{},a=(s==null?void 0:s(e))??[];return kj(i,a,{editor:e,extension:n,t:r})}}}},addExtensions(){var n,r,i;const{t}=Ot(),e=[];this.options.placeholder!==!1&&e.push($8.configure({placeholder:({node:s,pos:a})=>{var u;const l=(u=s==null?void 0:s.type)==null?void 0:u.name;return l==="heading"?`${t(`editor.heading.h${s.attrs.level}.tooltip`)}`:l==="table"||l==="codeBlock"?"":a===0?t("editor.content"):""},...this.options.placeholder})),this.options.focus!==!1&&e.push(dj.configure({className:"focus",...this.options.focus})),this.options.document!==!1&&(this.options.page?(e.push(U8.configure().extend({content:"page+"})),e.push(pK.configure({types:((r=(n=this.options.page)==null?void 0:n.nodesComputedOption)==null?void 0:r.types)??[],slots:o.useSlots()}))):e.push(U8.configure())),this.options.dropcursor!==!1&&e.push(cj.configure({...this.options.dropcursor,width:2,class:"ProseMirror-dropcursor border-black"})),this.options.characterCount!==!1&&e.push(aj.configure(this.options.characterCount)),this.options.paragraph!==!1&&e.push(F8.configure(this.options.paragraph)),this.options.hardBreak!==!1&&e.push(V8.configure(this.options.hardBreak)),this.options.listItem!==!1&&e.push(wj.configure(this.options.listItem)),this.options.textStyle!==!1&&e.push(JU.configure(this.options.textStyle)),this.options.imageUpload!==!1&&e.push(eE.configure(this.options.imageUpload)),this.options.video!==!1&&e.push(Z5.configure(this.options.video)),this.options.videoUpload!==!1&&e.push(J5.configure(this.options.videoUpload)),this.options.history!==!1&&e.push(Wg.configure(this.options.history)),this.options.fontFamily!==!1&&e.push(b5.configure(this.options.fontFamily)),this.options.fontSize!==!1&&e.push(i8.configure(this.options.fontSize)),this.options.mode!==Re.EDITOR&&e.push(wK),this.options.superText!==!1&&this.options.mode!==Re.PLAIN_TEXT&&this.options.mode!==Re.EDITOR&&(typeof this.options.superText=="boolean"?e.push(E5.configure()):e.push(E5.configure(this.options.superText))),this.options.mode===Re.EDITOR&&(this.options.image!==!1&&e.push(xb.configure()),e.push(r8.configure({spacer:!0}),Tx,_x,Ax,Hg,Ib,Mx,s8.configure({spacer:!0}),o8.configure({types:["heading","paragraph"],spacer:!0}),w5)),this.options.mode!==Re.EDITOR&&this.options.configPlan!==!1&&this.options.mode!==Re.PLAIN_TEXT&&(typeof this.options.configPlan=="boolean"?e.push(S5.configure()):e.push(S5.configure({specialCharModal:(i=this.options.configPlan)==null?void 0:i.specialCharModal}))),this.options.mode!==Re.EDITOR&&this.options.mode!==Re.PLAIN_TEXT&&e.push(xK),(this.options.mode===Re.STRAIGHT||this.options.mode===Re.REPORT||this.options.mode===Re.EDITOR)&&this.options.timeHighlighter&&e.push(xX.configure(this.options.timeHighlighter)),this.options.invalidCharFocus!==!1&&e.push(h5.configure(this.options.invalidCharFocus)),this.options.disabled&&e.push(nY),e.push(Cj,H8.configure(),yX.configure(),yj.configure(),Eb,wb,gg,AX,MX.configure(this.options.deviceEnv),a8.configure({multicolor:!0}));for(const s in this.options.excludes)Object.prototype.hasOwnProperty.call(this.options.excludes,s)&&this.options.excludes[s]&&nt.remove(e,({name:l})=>l===s);return e},addStorage(){return{mode:this.options.mode}}}),nE=Dn.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(t){return t!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sub",vt(this.options.HTMLAttributes,t),0]},addCommands(){return{setSubscript:()=>({commands:t})=>t.setMark(this.name),toggleSubscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSubscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),rE=Dn.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(t){return t!=="super"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sup",vt(this.options.HTMLAttributes,t),0]},addCommands(){return{setSuperscript:()=>({commands:t})=>t.setMark(this.name),toggleSuperscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSuperscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),rY=Qe.create({name:"subAndSuperScript",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,extension:n,t:r})=>{const i=n.options.subscript,s=n.options.superscript,a={component:Ke,componentProps:{action:()=>e.commands.toggleSubscript(),isActive:()=>e.isActive("subscript")||!1,disabled:!e.can().toggleSubscript(),icon:"Subscript",tooltip:r("editor.subscript.tooltip")}},l={component:Ke,componentProps:{action:()=>e.commands.toggleSuperscript(),isActive:()=>e.isActive("superscript")||!1,disabled:!e.can().toggleSuperscript(),icon:"Superscript",tooltip:r("editor.superscript.tooltip")}},u=[];return i!==!1&&u.push(a),s!==!1&&u.push(l),u}}},addExtensions(){const t=[];return this.options.subscript!==!1&&t.push(nE.configure(this.options.subscript)),this.options.superscript!==!1&&t.push(rE.configure(this.options.superscript)),t}}),oY={class:"ml-1"},iY=o.defineComponent({__name:"ActionMoreButton",props:{editor:{},disabled:{type:Boolean,default:!1},color:{default:void 0},maxHeight:{default:void 0},icon:{default:void 0},tooltip:{default:""},items:{default:()=>[]}},setup(t){const e=t,n=o.computed(()=>{const r=e.items.find(s=>s.isActive());return r&&!r.default?{...r,icon:r.icon?r.icon:e.icon}:{title:e.tooltip,icon:e.icon,isActive:()=>!1}});return(r,i)=>(o.openBlock(),o.createBlock(ia,{icon:r.icon,tooltip:r.tooltip,disabled:r.disabled},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.items,(s,a)=>(o.openBlock(),o.createBlock(o.unref(wl),{key:a,checked:n.value.title===s.title,disabled:s.disabled,class:"flex gap-3 items-center",onClick:s.action},{default:o.withCtx(()=>[s.icon?(o.openBlock(),o.createBlock(o.unref(Tt),{key:0,name:s.icon},null,8,["name"])):o.createCommentVNode("",!0),o.createElementVNode("span",oY,o.toDisplayString(s.title),1),s.shortcutKeys?(o.openBlock(),o.createBlock(o.unref(n8),{key:1,class:"ml-auto"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(UC)(s.shortcutKeys)),1)]),_:2},1024)):o.createCommentVNode("",!0)]),_:2},1032,["checked","disabled","onClick"]))),128))]),_:1},8,["icon","tooltip","disabled"]))}}),sY=Qe.create({name:"moreMark",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button({editor:e,extension:n,t:r}){const i=n.options.subscript,s=n.options.superscript,a={action:()=>e.commands.toggleSubscript(),isActive:()=>e.isActive("subscript")||!1,disabled:!e.can().toggleSubscript(),icon:"Subscript",title:r("editor.subscript.tooltip"),shortcutKeys:["mod","."]},l={action:()=>e.commands.toggleSuperscript(),isActive:()=>e.isActive("superscript")||!1,disabled:!e.can().toggleSuperscript(),icon:"Superscript",title:r("editor.superscript.tooltip"),shortcutKeys:["mod",","]},u=O0(e,"code"),c=[];if(i!==!1&&c.push(a),s!==!1&&c.push(l),u){const f={action:()=>e.commands.toggleCode(),isActive:()=>e.isActive("code")||!1,disabled:!e.can().toggleCode(),icon:"Code",title:r("editor.code.tooltip"),shortcutKeys:["mod","E"]};u&&c.push(f)}return{component:iY,componentProps:{icon:"Type",tooltip:r("editor.moremark"),disabled:!e.isEditable||c.every(f=>f.disabled),items:c}}}}},addExtensions(){const t=[];return this.options.subscript!==!1&&t.push(nE.configure(this.options.subscript)),this.options.superscript!==!1&&t.push(rE.configure(this.options.superscript)),t}});var fa=(t=>(t[t.max=7]="max",t[t.min=0]="min",t[t.more=1]="more",t[t.less=-1]="less",t))(fa||{});function aY(t,e,n){return t<e?e:t>n?n:t}function lY(t,e,n,r){const{doc:i,selection:s}=t;if(!i||!s||!(s instanceof Ae||s instanceof Rn))return t;const{from:a,to:l}=s;return i.nodesBetween(a,l,(u,c)=>{const f=u.type;return n.includes(f.name)?(t=uY(t,c,e),!1):!i0(u.type.name,r.extensionManager.extensions)}),t}function uY(t,e,n){if(!t.doc)return t;const r=t.doc.nodeAt(e);if(!r)return t;const a=aY((r.attrs.indent||0)+n,0,7);if(a===r.attrs.indent)return t;const l={...r.attrs,indent:a};return t.setNodeMarkup(e,r.type,l,r.marks)}function oE({delta:t,types:e}){return({state:n,dispatch:r,editor:i})=>{const{selection:s}=n;let{tr:a}=n;return a=a.setSelection(s),a=lY(a,t,e,i),a.docChanged?(r&&r(a),!0):!1}}const cY=Qe.create({name:"indent",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),types:["paragraph","heading","blockquote"],minIndent:fa.min,maxIndent:fa.max,button({editor:e,t:n}){var s,a;const{selection:r}=e.state,i=r.$anchor.parent;return[{component:Ke,componentProps:{action:()=>{e.commands.indent()},disabled:((s=i==null?void 0:i.attrs)==null?void 0:s.indent)>=fa.max||!e.can().indent(),shortcutKeys:["Tab"],icon:"IndentIncrease",tooltip:n("editor.indent.tooltip")}},{component:Ke,componentProps:{action:()=>{e.commands.outdent()},shortcutKeys:["Shift","Tab"],disabled:((a=i==null?void 0:i.attrs)==null?void 0:a.indent)<=fa.min||!e.can().outdent(),icon:"IndentDecrease",tooltip:n("editor.outdent.tooltip")}}]}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{indent:{default:0,parseHTML:t=>{const e=t.getAttribute("data-indent");return(e?parseInt(e,10):0)||0},renderHTML:t=>t.indent?{"data-indent":t.indent}:{}}}}]},addCommands(){return{indent:()=>oE({delta:fa.more,types:this.options.types}),outdent:()=>oE({delta:fa.less,types:this.options.types})}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.indent(),"Shift-Tab":()=>this.editor.commands.outdent()}}});function dY(t){var e;const{char:n,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:s,startOfLine:a,$position:l}=t,u=r&&!i,c=NM(n),f=new RegExp(`\\s${c}$`),p=a?"^":"",m=i?"":c,g=u?new RegExp(`${p}${c}.*?(?=\\s${m}|$)`,"gm"):new RegExp(`${p}(?:^)?${c}[^\\s${m}]*`,"gm"),b=((e=l.nodeBefore)===null||e===void 0?void 0:e.isText)&&l.nodeBefore.text;if(!b)return null;const v=l.pos-b.length,w=Array.from(b.matchAll(g)).pop();if(!w||w.input===void 0||w.index===void 0)return null;const C=w.input.slice(Math.max(0,w.index-1),w.index),E=new RegExp(`^[${s==null?void 0:s.join("")}\0]?$`).test(C);if(s!==null&&!E)return null;const k=v+w.index;let x=k+w[0].length;return u&&f.test(b.slice(x-1,x+1))&&(w[0]+=" ",x+=1),k<l.pos&&x>=l.pos?{range:{from:k,to:x},query:w[0].slice(n.length),text:w[0]}:null}const fY=new kt("suggestion");function pY({pluginKey:t=fY,editor:e,char:n="@",allowSpaces:r=!1,allowToIncludeChar:i=!1,allowedPrefixes:s=[" "],startOfLine:a=!1,decorationTag:l="span",decorationClass:u="suggestion",command:c=()=>null,items:f=()=>[],render:p=()=>({}),allow:m=()=>!0,findSuggestionMatch:g=dY}){let b;const v=p==null?void 0:p(),w=new tt({key:t,view(){return{update:async(C,E)=>{var k,x,_,A,T,B,L;const I=(k=this.key)===null||k===void 0?void 0:k.getState(E),F=(x=this.key)===null||x===void 0?void 0:x.getState(C.state),U=I.active&&F.active&&I.range.from!==F.range.from,ie=!I.active&&F.active,oe=I.active&&!F.active,H=!ie&&!oe&&I.query!==F.query,V=ie||U&&H,D=H||U,j=oe||U&&H;if(!V&&!D&&!j)return;const Y=j&&!V?I:F,J=C.dom.querySelector(`[data-decoration-id="${Y.decorationId}"]`);b={editor:e,range:Y.range,query:Y.query,text:Y.text,items:[],command:te=>c({editor:e,range:Y.range,props:te}),decorationNode:J,clientRect:J?()=>{var te;const{decorationId:we}=(te=this.key)===null||te===void 0?void 0:te.getState(e.state),le=C.dom.querySelector(`[data-decoration-id="${we}"]`);return(le==null?void 0:le.getBoundingClientRect())||null}:null},V&&((_=v==null?void 0:v.onBeforeStart)===null||_===void 0||_.call(v,b)),D&&((A=v==null?void 0:v.onBeforeUpdate)===null||A===void 0||A.call(v,b)),(D||V)&&(b.items=await f({editor:e,query:Y.query})),j&&((T=v==null?void 0:v.onExit)===null||T===void 0||T.call(v,b)),D&&((B=v==null?void 0:v.onUpdate)===null||B===void 0||B.call(v,b)),V&&((L=v==null?void 0:v.onStart)===null||L===void 0||L.call(v,b))},destroy:()=>{var C;b&&((C=v==null?void 0:v.onExit)===null||C===void 0||C.call(v,b))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(C,E,k,x){const{isEditable:_}=e,{composing:A}=e.view,{selection:T}=C,{empty:B,from:L}=T,I={...E};if(I.composing=A,_&&(B||e.view.composing)){(L<E.range.from||L>E.range.to)&&!A&&!E.composing&&(I.active=!1);const F=g({char:n,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:s,startOfLine:a,$position:T.$from}),U=`id_${Math.floor(Math.random()*4294967295)}`;F&&m({editor:e,state:x,range:F.range,isActive:E.active})?(I.active=!0,I.decorationId=E.decorationId?E.decorationId:U,I.range=F.range,I.query=F.query,I.text=F.text):I.active=!1}else I.active=!1;return I.active||(I.decorationId=null,I.range={from:0,to:0},I.query=null,I.text=null),I}},props:{handleKeyDown(C,E){var k;const{active:x,range:_}=w.getState(C.state);return x&&((k=v==null?void 0:v.onKeyDown)===null||k===void 0?void 0:k.call(v,{view:C,event:E,range:_}))||!1},decorations(C){const{active:E,range:k,decorationId:x}=w.getState(C);return E?mt.create(C.doc,[jt.inline(k.from,k.to,{nodeName:l,class:u,"data-decoration-id":x})]):null}}});return w}const hY=[{label:"优酷",value:"youku",icon:"Youku"},{label:"哔哩哔哩",value:"bilibili",icon:"BiliBili"},{label:"腾讯视频",value:"qqvideo",icon:"QQVideo"}],mY=[{label:"高德地图",value:"amap",icon:"Gaode"},{label:"百度地图",value:"baidu_map",icon:"Baidu"}],gY=[{label:"墨刀",value:"modao",icon:"Modao"},{label:"蓝湖",value:"lanhu",icon:"Lanhu"},{label:"Figma",value:"figma",icon:"Figma"},{label:"Canva",value:"canva",icon:"Canva"},{label:"ProcessOn",value:"processon",icon:"Processon"}],bY=[{label:"CodePen",value:"codepen",icon:"Codepen"}],vY=[{label:"金数据",value:"jinshuju",icon:"Jinshuju"}],yY=[],wY=[...hY,...mY,...gY,...bY,...vY,...yY];function CY(t){const{t:e}=Ot(),n=[{name:"format",title:e("editor.slash.format"),commands:[{name:"paragraph",label:e("editor.paragraph.tooltip"),aliases:["paragraph","zw"],iconName:"Paragraph",action:({editor:i,range:s})=>{i.chain().focus().deleteRange(s).setHeading({level:1}).run()}},{name:"heading1",label:e("editor.heading.h1.tooltip"),aliases:["h1","bt","bt1"],iconName:"Heading1",action:({editor:i,range:s})=>{i.chain().focus().deleteRange(s).setHeading({level:1}).run()}},{name:"heading2",label:e("editor.heading.h2.tooltip"),aliases:["h2","bt","bt2"],iconName:"Heading2",action:({editor:i,range:s})=>{i.chain().focus().deleteRange(s).setNode("heading",{level:2}).run()}},{name:"heading3",label:e("editor.heading.h3.tooltip"),aliases:["h3","bt","bt3","heading3"],iconName:"Heading3",action:({editor:i,range:s})=>{i.chain().focus().deleteRange(s).setNode("heading",{level:3}).run()}},{name:"bulletList",label:e("editor.bulletlist.tooltip"),aliases:["ul","yxlb","bulletList"],iconName:"List",action:({editor:i,range:s})=>{i.chain().focus().deleteRange(s).toggleBulletList().run()}},{name:"numberedList",label:e("editor.orderedlist.tooltip"),aliases:["ol","yxlb"],iconName:"ListOrdered",action:({editor:i,range:s})=>{i.chain().focus().deleteRange(s).toggleOrderedList().run()}},{name:"codeBlock",label:e("editor.codeblock.tooltip"),iconName:"Code2",aliases:["codeBlock"],description:"Code block with syntax highlighting",shouldBeHidden:i=>i.isActive("columns"),action:({editor:i,range:s})=>{i.chain().focus().deleteRange(s).setCodeBlock().run()}},{name:"blockquote",label:e("editor.blockquote.tooltip"),description:"插入引入格式",aliases:["yr"],iconName:"TextQuote",action:({editor:i,range:s})=>{i.chain().focus().deleteRange(s).setBlockquote().run()}},{name:"horizontalrule",label:e("editor.horizontalrule.tooltip"),aliases:["fgx","horizontalRule"],iconName:"Minus",action:({editor:i,range:s})=>{i.chain().focus().deleteRange(s).setHorizontalRule().run()}},{name:"link",label:e("editor.link.tooltip"),aliases:["link","lianjie","lj"],iconName:"Link",action:({editor:i,range:s})=>{i.chain().deleteRange(s).extendMarkRange("link").insertContent({type:"text",text:"link",marks:[{type:"link",attrs:{href:"",target:"_blank"}}]}).setLink({href:""}).focus().run()}}]},{name:"insert",title:e("editor.slash.insert"),commands:[{name:"image",label:e("editor.image.tooltip"),iconName:"ImageUp",description:"Insert a image",aliases:["image","tp","tupian"],shouldBeHidden:i=>i.isActive("columns"),action:({editor:i,range:s})=>{i.chain().focus().deleteRange(s).setImageUpload().run()}},{name:"table",label:e("editor.table.tooltip"),iconName:"Table",description:"Insert a table",aliases:["table","bg","biaoge","biao"],shouldBeHidden:i=>i.isActive("columns"),action:({editor:i,range:s})=>{i.chain().focus().deleteRange(s).insertTable({rows:3,cols:3,withHeaderRow:!1}).run()}},{name:"video",label:e("editor.video.tooltip"),iconName:"Video",description:"Insert a video",aliases:["video","sp","shipin"],shouldBeHidden:i=>i.isActive("columns"),action:({editor:i,range:s})=>{i.chain().focus().deleteRange(s).setVideoUpload().run()}},{name:"taskList",label:e("editor.tasklist.tooltip"),iconName:"ListTodo",description:"Task list with todo items",aliases:["todo"],action:({editor:i,range:s})=>{i.chain().focus().deleteRange(s).toggleTaskList().run()}},{name:"columns",label:e("editor.columns.tooltip"),iconName:"Columns2",description:"Add two column content",aliases:["columns","cols","2cols"],shouldBeHidden:i=>i.isActive("columns"),action:({editor:i,range:s})=>{i.chain().deleteRange(s).setColumns().focus(i.state.selection.head-1).run()}}]}];if(O0(t,"iframes")){const i=wY;n.push({name:"others",title:e("editor.slash.embed"),commands:i.map(s=>({name:s.value,label:s.label,iconName:s.icon,aliases:[s.value,s.label],shouldBeHidden:a=>a.isActive("columns"),action:({editor:a,range:l})=>{a.chain().deleteRange(l).focus().setIframe({src:"",service:s.value}).run()}}))})}return n}const xY={key:0,class:"grid grid-cols-1 gap-0.5 min-w-48"},EY={className:"text-neutral-500 text-[0.65rem] col-[1/-1] mx-2 mt-2 font-semibold tracking-wider select-none uppercase first:mt-0.5"},kY=["onClick"],SY=["src"],_Y={key:1,class:"p-3"},TY={class:"text-xs text-gray-800 dark:text-gray-400"},AY=o.defineComponent({__name:"CommandsList",props:{editor:{},items:{default:void 0},command:{type:Function,default:void 0}},setup(t,{expose:e}){const n=o.ref(0),r=o.ref(0),i=o.ref(null),{t:s}=Ot(),a=o.ref([]),l=t;e({onKeyDown:u}),o.watch([()=>n.value,()=>r.value],async()=>{if(!i.value)return;await o.nextTick();const v=r.value*1e3+n.value,w=a.value[v];w&&w.scrollIntoView({behavior:"smooth",block:"nearest"})});function u({event:v}){return v.key==="ArrowUp"?(c(),!0):v.key==="ArrowDown"?(f(),!0):v.key==="Enter"?(p(),!0):!1}function c(){var C;if(!l.items.length)return!1;let v=n.value-1,w=r.value;v<0&&(w=r.value-1,v=((C=l.items[w])==null?void 0:C.commands.length)-1||0),w<0&&(w=l.items.length-1,v=l.items[w].commands.length-1),n.value=v,r.value=w}function f(){if(!l.items.length)return!1;const v=l.items[r.value].commands;let w=n.value+1,C=r.value;v.length-1<w&&(w=0,C=r.value+1),l.items.length-1<C&&(C=0),n.value=w,r.value=C}function p(){if(!l.items.length||r.value===-1||n.value===-1)return!1;m(r.value,n.value)}function m(v,w){const C=l.items[v].commands[w];l.command(C)}function g(v,w){m(v,w)}function b(v,w,C){a.value[v*1e3+w]=C}return(v,w)=>{var C;return o.openBlock(),o.createElementBlock("div",{ref_key:"scrollContainer",ref:i,class:"bg-white rounded-lg dark:bg-black shadow-sm border border-neutral-200 dark:border-neutral-800 text-black max-h-[min(80vh,24rem)] overflow-auto flex-wrap mb-8 p-1"},[(C=v.items)!=null&&C.length?(o.openBlock(),o.createElementBlock("div",xY,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(v.items,(E,k)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:E.title},[o.createElementVNode("div",EY,o.toDisplayString(E.title),1),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(E.commands,(x,_)=>(o.openBlock(),o.createElementBlock("button",{ref_for:!0,ref:A=>b(k,_,A),key:_,class:o.normalizeClass(["flex items-center gap-3 px-2 py-1.5 text-sm text-neutral-800 dark:text-neutral-200 text-left w-full rounded-sm outline-none transition-colors",[r.value===k&&n.value===_?"bg-ed-accent text-neutral-800 dark:bg-neutral-900 dark:text-neutral-200":"hover:bg-ed-accent hover:text-neutral-800 dark:hover:bg-neutral-900 dark:hover:text-neutral-200"]]),onClick:A=>g(k,_)},[x.iconUrl?(o.openBlock(),o.createElementBlock("img",{key:0,class:"w-6 h-6",src:x.iconUrl},null,8,SY)):o.createCommentVNode("",!0),x.iconName?(o.openBlock(),o.createBlock(o.unref(Tt),{key:1,name:x.iconName,class:"mr-1 text-lg"},null,8,["name"])):o.createCommentVNode("",!0),o.createTextVNode(" "+o.toDisplayString(x.label),1)],10,kY))),128))],64))),128))])):(o.openBlock(),o.createElementBlock("div",_Y,[o.createElementVNode("span",TY,o.toDisplayString(o.unref(s)("editor.slash.empty")),1)]))],512)}}}),pa="slashCommand";let Pt;const MY=Qe.create({name:pa,priority:200,onCreate(){Pt=$s("body",{interactive:!0,trigger:"manual",placement:"bottom-start",theme:"slash-command",maxWidth:"16rem",offset:[16,8],popperOptions:{strategy:"fixed",modifiers:[{name:"flip",enabled:!1}]}})},addProseMirrorPlugins(){return[pY({editor:this.editor,char:"/",allowSpaces:!0,startOfLine:!0,pluginKey:new kt(pa),allow:({state:t,range:e})=>{var c,f,p;const n=t.doc.resolve(e.from),r=n.depth===1,i=n.parent.type.name==="paragraph",s=((c=n.parent.textContent)==null?void 0:c.charAt(0))==="/",a=this.editor.isActive("column"),l=(p=n.parent.textContent)==null?void 0:p.substring((f=n.parent.textContent)==null?void 0:f.indexOf("/")),u=!(l!=null&&l.endsWith(" "));return(r&&i&&s||a&&i&&s)&&u},command:({editor:t,range:e,props:n})=>{const{view:r}=t;n.action({editor:t,range:e}),r.focus()},items:({query:t})=>CY(this.editor).map(s=>({...s,commands:s.commands.filter(a=>{const l=a.label.toLowerCase().trim(),u=t.toLowerCase().trim();if(a.aliases){const c=a.aliases.map(m=>m.toLowerCase().trim()),f=l.match(u),p=c.some(m=>m.match(u));return f||p}return l.match(u)}).filter(a=>a.shouldBeHidden?!a.shouldBeHidden(this.editor):!0)})).filter(s=>s.commands.length>0).map(s=>({...s,commands:s.commands.map(a=>({...a,isEnabled:!0}))})),render:()=>{let t,e=null;return{onStart:n=>{var s;t=new c6(AY,{props:n,editor:n.editor});const{view:r}=n.editor,i=()=>{if(!n.clientRect)return n.editor.storage[pa].rect;const a=n.clientRect();if(!a)return n.editor.storage[pa].rect;let l=a.y;if(t.element instanceof HTMLElement&&a.top+t.element.offsetHeight+40>window.innerHeight){const u=a.top+t.element.offsetHeight-window.innerHeight+40;l=a.y-u}return new DOMRect(a.x,l,a.width,a.height)};e=()=>{Pt==null||Pt[0].setProps({getReferenceClientRect:i})},(s=r.dom.parentElement)==null||s.addEventListener("scroll",e),t.element&&(Pt==null||Pt[0].setProps({getReferenceClientRect:i,appendTo:()=>document.body,content:t.element})),Pt==null||Pt[0].show()},onUpdate(n){var a;t.updateProps(n);const{view:r}=n.editor,i=()=>{if(!n.clientRect)return n.editor.storage[pa].rect;const l=n.clientRect();return l?new DOMRect(l.x,l.y,l.width,l.height):n.editor.storage[pa].rect},s=()=>{Pt==null||Pt[0].setProps({getReferenceClientRect:i})};(a=r.dom.parentElement)==null||a.addEventListener("scroll",s),n.editor.storage[pa].rect=n.clientRect?i():{width:0,height:0,left:0,top:0,right:0,bottom:0},Pt==null||Pt[0].setProps({getReferenceClientRect:i})},onKeyDown(n){var r;return n.event.key==="Escape"?(Pt==null||Pt[0].hide(),!0):(Pt!=null&&Pt[0].state.isShown||Pt==null||Pt[0].show(),(r=t.ref)==null?void 0:r.onKeyDown(n))},onExit(n){var r;if(Pt==null||Pt[0].hide(),e){const{view:i}=n.editor;(r=i.dom.parentElement)==null||r.removeEventListener("scroll",e)}t.destroy()}}}})]},addStorage(){return{rect:{width:0,height:0,left:0,top:0,right:0,bottom:0}}}}),OY=o.defineComponent({__name:"AIButton",props:{editor:{},icon:{default:void 0},title:{default:void 0},tooltip:{default:void 0},disabled:{type:Boolean,default:!1},shortcutKeys:{default:void 0},customClass:{default:""},loading:{type:Boolean,default:!1},tooltipOptions:{default:void 0},color:{default:void 0},action:{type:Function,default:void 0},isActive:{type:Function,default:void 0}},setup(t){const e=t,n=Cn(),{toast:r}=Db();function i(){var a,l,u;const s=(l=(a=e.editor.extensionManager.extensions.find(c=>c.name==="AI"))==null?void 0:a.options)==null?void 0:l.completions;if(typeof s!="function"){r({title:"AI completions method is not set or is not a valid function",variant:"destructive"});return}if(s.constructor.name!=="AsyncFunction"){r({title:"AI completions method must be an asynchronous function",variant:"destructive"});return}n.state.AIMenu=!0,(u=e.editor)==null||u.commands.focus()}return(s,a)=>(o.openBlock(),o.createBlock(Ke,{action:i,title:"AI",disabled:s.disabled,icon:s.icon,tooltip:s.tooltip},null,8,["disabled","icon","tooltip"]))}}),BY=It.create({name:"AI",group:"block",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),toolbar:!1,button:({editor:e,t:n})=>({component:OY,componentProps:{icon:"Sparkles",tooltip:n("editor.AI.ask")}})}}});function IY(t,e){const n=atob(t.split(",")[1]),r=new Array(n.length);for(let s=0;s<n.length;s++)r[s]=n.charCodeAt(s);const i=new Uint8Array(r);return new Blob([i],{type:e})}function RY(t,e){return new File([t],e,{type:t.type})}const LY=Qe.create({name:"importWord",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),upload:void 0,convert:void 0,limit:1024*1024*10,button:({editor:e,extension:n,t:r})=>({component:Ke,componentProps:{action:()=>{var i;return(i=e.commands)==null?void 0:i.toggleImportWord()},disabled:!e.can().setHorizontalRule(),icon:"Word",tooltip:r("editor.importWord.tooltip")}})}},addCommands(){return{toggleImportWord:()=>({chain:t,editor:e})=>{const{toast:n}=Db(),{t:r}=Ot();async function i(u){var g;const f=new DOMParser().parseFromString(u,"text/html"),p=f.querySelectorAll("img");if(!p.length)return f.body.innerHTML;if(O0(e,"image")){const b=(g=e.extensionManager.extensions.find(v=>v.name==="importWord"))==null?void 0:g.options;if(b&&typeof b.upload=="function"){const v=[];for(const C of p){const E=C.getAttribute("src"),k=IY(E,"image/jpeg"),x=RY(k,"image.jpeg");v.push(x)}const w=await b.upload(v);for(let C=0;C<p.length;C++){const E=p[C];E.setAttribute("src",w[C].src);const k=E.parentElement;(k==null?void 0:k.tagName)==="P"&&(k.insertAdjacentElement("beforebegin",E),!k.hasChildNodes()&&k.textContent===""&&k.remove())}return f.body.innerHTML}else return console.warn("Image Upload method found, skip image conversion"),f.body.innerHTML}else return console.error("Image extension not found, unable to convert image"),f.body.innerHTML}async function s(u){const c=await i(u);e.chain().setContent(c.toString(),!0).run(),n({title:r("editor.importWord.success")})}const{open:a,onChange:l}=ct.useFileDialog({accept:".docx",reset:!0,multiple:!1});return a(),l(async u=>{const[c]=Array.from(u??[]);if(c){if(c.size>this.options.limit){n({title:r("editor.importWord.fileTooLarge"),variant:"destructive"});return}if(this.options.convert){const f=await this.options.convert(c);s(f)}else{const f=new FormData,p=JSON.stringify({collaboration_features:{comments:!0,user_id:"e3",track_changes:!0},formatting:{resets:"none",defaults:"inline",styles:"inline",comments:"basic"}});f.append("config",p),f.append("file",c),fetch("https://docx-converter.cke-cs.com/v2/convert/docx-html",{method:"POST",body:f}).then(m=>m.json()).then(async m=>{s(m.html)}).catch(m=>{n({title:r("editor.importWord.error"),variant:"destructive"}),console.error("Error:",m)})}}}),!1}}}}),Vb=Cn(),PY=Qe.create({name:"preview",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({t:e})=>({component:Ke,componentProps:{icon:"Eye",action:()=>{Vb.togglePreview()},tooltip:e("editor.preview.tooltip"),isActive:()=>Vb.state.showPreview}})}},addCommands(){return{togglePreview:()=>()=>(Vb.togglePreview(),!0)}}}),iE=Cn(),DY=(t,e,n)=>RegExp(e?t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"):t,n?"gu":"gui");function VY(t,e,n,r){const i=[],s=[];let a=[],l=0;if(!e)return{decorationsToReturn:mt.empty,results:[]};t==null||t.descendants((u,c)=>{u.isText?a[l]?a[l]={text:a[l].text+u.text,pos:a[l].pos}:a[l]={text:`${u.text}`,pos:c}:l+=1}),a=a.filter(Boolean);for(const u of a){const{text:c,pos:f}=u,p=Array.from(c.matchAll(e)).filter(([m])=>m.trim());for(const m of p){if(m[0]==="")break;m.index!==void 0&&s.push({from:f+m.index,to:f+m.index+m[0].length})}}for(let u=0;u<s.length;u+=1){const c=s[u],f=u===r?`${n} ${n}-current`:n,p=jt.inline(c.from,c.to,{class:f});i.push(p)}return{decorationsToReturn:mt.create(t,i),results:s}}const FY=(t,e,{state:n,dispatch:r})=>{if(!e[0])return;const{from:s,to:a}=e[0];r&&r(n.tr.insertText(t,s,a))},$Y=(t,e,n,r)=>{const i=e+1;if(!r[i])return null;const{from:s,to:a}=r[e],l=a-s-t.length+n,{from:u,to:c}=r[i];return r[i]={to:c-l,from:u-l},[l,r]},HY=(t,e,{tr:n,dispatch:r})=>{let i=0,s=e.slice();if(s.length){for(let a=0;a<s.length;a+=1){const{from:l,to:u}=s[a];n.insertText(t,l,u);const c=$Y(t,a,i,s);c&&(i=c[0],s=c[1])}r&&r(n)}},zY=new kt("findAndReplacePlugin"),UY=Qe.create({name:"findAndReplace",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),searchResultClass:"vdc-editor-search-result",disableRegex:!0,button:({editor:e,extension:n,t:r})=>({component:Ke,componentProps:{icon:"DocSearch",tooltip:r("editor.findAndReplace.tooltip"),action:()=>{iE.toggleFindAndReplace()},isActive:()=>iE.state.findAndReplace}})}},addStorage(){return{searchTerm:"",replaceTerm:"",results:[],lastSearchTerm:"",caseSensitive:!1,lastCaseSensitive:!1,resultIndex:0,lastResultIndex:0}},addCommands(){return{setSearchTerm:t=>({editor:e})=>(e.storage.findAndReplace.searchTerm=t,!1),setReplaceTerm:t=>({editor:e})=>(e.storage.findAndReplace.replaceTerm=t,!1),setCaseSensitive:t=>({editor:e})=>(e.storage.findAndReplace.caseSensitive=t,!1),resetIndex:()=>({editor:t})=>(t.storage.findAndReplace.resultIndex=0,!1),nextSearchResult:()=>({editor:t})=>{const{results:e,resultIndex:n}=t.storage.findAndReplace,r=n+1;return e[r]?t.storage.findAndReplace.resultIndex=r:t.storage.findAndReplace.resultIndex=0,!1},previousSearchResult:()=>({editor:t})=>{const{results:e,resultIndex:n}=t.storage.findAndReplace,r=n-1;return e[r]?t.storage.findAndReplace.resultIndex=r:t.storage.findAndReplace.resultIndex=e.length-1,!1},replace:()=>({editor:t,state:e,dispatch:n})=>{const{replaceTerm:r,results:i}=t.storage.findAndReplace;return FY(r,i,{state:e,dispatch:n}),!1},replaceAll:()=>({editor:t,tr:e,dispatch:n})=>{const{replaceTerm:r,results:i}=t.storage.findAndReplace;return HY(r,i,{tr:e,dispatch:n}),!1}}},addProseMirrorPlugins(){const t=this.editor,{searchResultClass:e,disableRegex:n}=this.options,r=a=>t.storage.findAndReplace.lastSearchTerm=a,i=a=>t.storage.findAndReplace.lastCaseSensitive=a,s=a=>t.storage.findAndReplace.lastResultIndex=a;return[new tt({key:zY,state:{init:()=>mt.empty,apply({doc:a,docChanged:l},u){const{searchTerm:c,lastSearchTerm:f,caseSensitive:p,lastCaseSensitive:m,resultIndex:g,lastResultIndex:b}=t.storage.findAndReplace;if(!l&&f===c&&m===p&&b===g)return u;if(r(c),i(p),s(g),!c)return t.storage.findAndReplace.results=[],mt.empty;const{decorationsToReturn:v,results:w}=VY(a,DY(c,n,p),e,g);return t.storage.findAndReplace.results=w,v}},props:{decorations(a){return this.getState(a)}}})]}}),{togglePrinter:WY,state:jY}=Cn(),qY=Qe.create({name:"printer",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({t:e})=>({component:Ke,componentProps:{tooltip:e("editor.printer.tooltip"),action:()=>WY(),icon:"Printer",shortcutKeys:["mod","P"],isActive:()=>jY.printer}})}}}),Fb="spell-check";class KY{constructor(e,n,r,i=1e3){Yt(this,"debouncedGetMatchAndSetDecorations",nt.debounce(this.getMatchAndSetDecorations.bind(this),300));Yt(this,"debouncedGetMatchAndSetDecorationsList",nt.debounce(this.getMatchAndSetDecorationsList.bind(this),300));Yt(this,"debouncedClickEventsListener",nt.debounce(this.clickEventsListener.bind(this),0));Yt(this,"debouncedAcceptSuggestionEventsListener",nt.debounce(this.acceptSuggestionListener.bind(this),0));Yt(this,"debouncedProofreadChangedNodes",nt.debounce(this.proofreadChangedNodes.bind(this),300));Yt(this,"proofreader");Yt(this,"uiStrings");Yt(this,"showSuggestionsEvent");Yt(this,"decorationSet");Yt(this,"editorView");Yt(this,"isInitialProofreadingDone",!1);Yt(this,"lastOriginalFrom",0);Yt(this,"lastClickedDecoration",null);Yt(this,"suggestionBox");Yt(this,"isEnableSuggestion");Yt(this,"isMobile");Yt(this,"limit",1e3);Yt(this,"_debouncedProofreadDoc",nt.debounce((e,n)=>{this.proofreadDoc(e),n&&n()},500));Yt(this,"_debouncedHandleEnterKey",nt.debounce((e,n,r)=>{this.handleEnterKey(e,n),r&&r()},500));this.proofreader=e,this.uiStrings=n,this.showSuggestionsEvent=r,this.decorationSet=mt.empty,this.limit=i,this.suggestionBox=document.createElement("div"),this.suggestionBox.id="suggestions-box",this.suggestionBox.tabIndex=0,this.isEnableSuggestion=!0,this.isMobile=!1,this.hideSuggestionBox()}get completeProofreadingDone(){return this.isInitialProofreadingDone}getProofreader(){return this.proofreader}toggleIsEnabledSpellCheck(){this.proofreader.toggleIsEnabled()}setEnabledProofreadText(e){this.proofreader.setEnabled(e)}getIsEnabledSpellCheck(){return this.proofreader.getIsEnabled()}setDecorationSet(e){this.decorationSet=e}getDecorationSet(){return this.decorationSet}setEditorView(e){this.editorView=e}getEditorView(){return this.editorView}getSuggestionBox(){return this.suggestionBox}hideSuggestionBox(){this.suggestionBox.textContent="",this.suggestionBox.style.display="none"}setIsEnableSuggestion(e){if(this.isEnableSuggestion=e,this.isEnableSuggestion){this.addEventListenersToDecorations();return}this.hideSuggestionBox(),this.removeEventListenersFromDecorations()}setIsMobile(e){this.isMobile=e}getChangedNodesFromTransaction(e,n=!1,r=!1){const i=[],s=new Set;let a=!1;return e.steps.forEach(l=>{var p,m,g;const u=l;if(u.from===void 0||u.to===void 0||n&&u.structure)return;((m=(p=u.slice)==null?void 0:p.content[0])==null?void 0:m.type.name)===hc&&(a=!0);const c=u.from-(r?1:0);let f=Math.max(u.to,u.from+(((g=u.slice)==null?void 0:g.size)||0))-(r?1:0);f>e.doc.content.size&&(f=e.doc.content.size),e.doc.nodesBetween(c,f,(b,v)=>{b&&(b.isText&&!s.has(v)&&(i.push({node:b,pos:v}),s.add(v)),b.type.name===hc&&(a=!0))})}),{changedNodes:i,isChangedSuperText:a}}debouncedProofreadDoc(e,n){this._debouncedProofreadDoc(e,n)}isSuperTextAlone(e,n){let r=!1;return e.descendants((i,s,a)=>i===n?(a&&a.type.name==="paragraph"&&a.childCount===1&&a.firstChild===n&&(r=!0),!1):!0),r}proofreadDoc(e){let n=[],r=0;e==null||e.descendants((u,c)=>{if(u.isText){const f={text:u.text??"",from:c,to:c+u.nodeSize};return n[r]&&(f.text=n[r].text+f.text,f.from=n[r].from),n[r]=f,r+=1,!1}return u.type.name!==hc}),n=n.filter(Boolean);let i="",s=1;for(const{text:u,from:c,to:f}of n){const p=c-s;p>0&&(i+=Array(p+1).join(`
|
|
@@ -341,7 +341,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`),te=D,J=j),Y===void 0&&
|
|
|
341
341
|
`});switch(Ce){case"html":return ee.getHTML();case"json":return ee.getJSON();case"text":return ee.getText({blockSeparator:`
|
|
342
342
|
`});default:return""}}function J(ee){return ee.every(Ce=>F==null?void 0:F.extensionManager.extensions.find(He=>He.name===Ce))}o.watch(()=>v.languages,()=>{F.commands.checkSpelling()}),o.watch(()=>r.modelValue,ee=>{if(!F||nt.isEqual(Y(F,r.output),ee))return;const{from:Ce,to:He}=F.state.selection;F.commands.setTextSelection({from:Ce,to:He}),F.commands.setContent(hn(ee,r.disabled,r.mode),!1,{preserveWhitespace:"full"}),j()},{deep:!0}),o.watch(()=>E.value,ee=>{var Ce;F==null||F.setEditable(ee),(Ce=F==null?void 0:F.commands)!=null&&Ce.setIsEnableSuggestion&&F.commands.setIsEnableSuggestion(ee)},{immediate:!0}),o.watch(()=>m.value,()=>{m.value&&m.value.on("selectionUpdate",({editor:ee})=>{i("changed:selection",{editor:ee})})}),o.onUnmounted(()=>F==null?void 0:F.destroy()),Zu(Tu.SAVE,()=>{localStorage.setItem("content",Y(F,"html"))});const te=o.computed(()=>{var Je;if(!((Je=F==null?void 0:F.storage)!=null&&Je.superText))return!1;const{enable:ee}=F.storage.superText,Ce=[Re.EDITOR,Re.PLAIN_TEXT].includes(r.mode),He=r.disabled;return ee&&!Ce&&!He}),we=o.ref(null),le=o.computed(()=>r.mode),{commentHeight:$e,contentHeight:Oe,minHeight:We,minHeightComment:X}=XZ(we,le,r.autoHeight,typeof r.minHeight=="string"?parseInt(r.minHeight):r.minHeight),N=o.ref(null);function ce(ee){ee===Re.STRAIGHT&&w(N.value)}o.onMounted(()=>{ce(r.mode),C(F)}),o.watch(()=>r.mode,ee=>{ce(ee)});const ue=o.ref(null),me=()=>{var Ce;(Ce=ue.value)!=null&&Ce.editor.commands.focusInvalidChar()||F.commands.focusInvalidChar()};u.focusFirstInvalidChar.value=me,o.onActivated(()=>{u.focusFirstInvalidChar.value=me});const Se=o.computed(()=>{var Ce,He,Je;const ee=((Ce=r.fieldNameComment)==null?void 0:Ce.label)||((He=r.fieldNameCommentCuesheet)==null?void 0:He.label)||((Je=r.fieldNameContent)==null?void 0:Je.label);return r.disabled&&ee});return e({editor:F}),(ee,Ce)=>{var se;const He=eh,Je=Np,xt=Qp,z=Bf,O=m$,q=tI;return o.unref(F)?(o.openBlock(),o.createElementBlock("div",{key:0,id:"vdc-editor",class:o.normalizeClass(["vdc-editor w-full flex flex-col",[ee.editorClass,{"outline-ed-primary":o.unref(F).isFocused,"outline-ed-border":!o.unref(F).isFocused}]]),style:o.normalizeStyle(o.unref(I))},[!ee.hideBubble&&!ee.disabled&&o.unref(E)?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[J([o.unref(fc)])?(o.openBlock(),o.createBlock(He,{key:0,editor:o.unref(F)},null,8,["editor"])):o.createCommentVNode("",!0),J([o.unref(ua)])?(o.openBlock(),o.createBlock(Je,{key:1,editor:o.unref(F)},null,8,["editor"])):o.createCommentVNode("",!0),J([o.unref(cs)])?(o.openBlock(),o.createBlock(xt,{key:2,editor:o.unref(F)},null,8,["editor"])):o.createCommentVNode("",!0),J([o.unref(ds),o.unref(fs)])?(o.openBlock(),o.createBlock(z,{key:3,editor:o.unref(F)},null,8,["editor"])):o.createCommentVNode("",!0)],64)):o.createCommentVNode("",!0),ee.hideToolbar?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(O,{key:1,editor:o.unref(F),"editor-comment":(se=o.unref(ue))==null?void 0:se.editor,mode:ee.mode,class:"mb-2","custom-class-toolbar":ee.customClassToolbar},null,8,["editor","editor-comment","mode","custom-class-toolbar"])),o.createElementVNode("div",{ref_key:"editorWrapRef",ref:we,class:o.normalizeClass(["space-y-2 flex-1 flex flex-col break-keep",!o.unref(_)&&"[&_*]:!font-inherit [&_*]:!text-font-size-inherit",o.unref(T)&&!o.unref(_)?"[&_*]:!font-inherit":"",o.unref(A)&&!o.unref(_)?"[&_*]:!text-font-size-inherit":""]),style:o.normalizeStyle(o.unref(B))},[o.unref(Se)?(o.openBlock(),o.createBlock(q,{key:0,extensions:ee.extensions,mode:ee.mode,"hide-comment":ee.hideComment,"field-name-comment":ee.fieldNameComment,"field-name-comment-cuesheet":ee.fieldNameCommentCuesheet,"field-name-content":ee.fieldNameContent,comment:ee.comment,"comment-cuesheet":ee.commentCuesheet,content:ee.modelValue,"min-chars":ee.minChar.content,"font-size":o.unref(A)},null,8,["extensions","mode","hide-comment","field-name-comment","field-name-comment-cuesheet","field-name-content","comment","comment-cuesheet","content","min-chars","font-size"])):(o.openBlock(),o.createElementBlock("div",{key:1,class:"space-y-2 flex-1 flex flex-col",style:o.normalizeStyle({minWidth:`${o.unref(D)}px`})},[ee.mode===o.unref(Re).REPORT&&!ee.hideComment?(o.openBlock(),o.createBlock(GZ,{key:0,ref_key:"editorCommentRef",ref:ue,mode:o.unref(Re).REPORT,extensions:ee.extensions,"model-value":r.comment,disabled:r.disabled,"disable-super-input":ee.disableSuperInput,"is-open-super-view":o.unref(te),"super-preview-custom-class":ee.superPreviewCustomClass,"min-char":ee.minChar,"font-size":o.unref(A),style:o.normalizeStyle(r.autoHeight?{height:"auto",minHeight:o.unref(ln)(o.unref(X))}:{height:o.unref(ln)(o.unref($e)),minHeight:o.unref(ln)(o.unref(We))}),"editor-content-instance":o.unref(F),class:"relative overflow-y-auto","onUpdate:modelValue":Ce[0]||(Ce[0]=ke=>i("update:comment",ke))},null,8,["mode","extensions","model-value","disabled","disable-super-input","is-open-super-view","super-preview-custom-class","min-char","font-size","style","editor-content-instance"])):o.createCommentVNode("",!0),o.createElementVNode("div",{id:"editor-container",class:"relative overflow-y-auto flex flex-col",style:o.normalizeStyle(r.autoHeight?{height:"auto",minHeight:o.unref(ln)(o.unref(We))}:{height:o.unref(ln)(o.unref(Oe))})},[o.createElementVNode("div",YZ,[o.withDirectives(o.createVNode($Z,{ref_key:"superTextViewRef",ref:H,editor:o.unref(F),"super-preview-custom-class":ee.superPreviewCustomClass,"min-chars":ee.minChar.superPreview,"font-size":o.unref(A)},null,8,["editor","super-preview-custom-class","min-chars","font-size"]),[[o.vShow,o.unref(te)]]),o.createElementVNode("div",{id:"editor-panel",ref_key:"contentInner",ref:U,class:"flex-1 p-2.5 border border-ed-gray-400 rounded-[3px] focus-within:border-ed-input-focus"},[o.createVNode(yb,{ref_key:"selectContextMenuRef",ref:N,editor:o.unref(F),mode:ee.mode,"super-text-store":o.unref(b)},{default:o.withCtx(()=>[o.createVNode(o.unref(Xn),{editor:o.unref(F),spellcheck:"true",class:o.normalizeClass(o.unref(xe)("h-full break-all",ee.mode===o.unref(Re).PLAIN_TEXT&&"plain-text"))},null,8,["editor","class"])]),_:1},8,["editor","mode","super-text-store"])],512)])],4)],4))],6)],6)):o.createCommentVNode("",!0)}}}),JZ={class:"relative px-2.5"},ZZ={key:0,class:"w-[36px] rounded-tl-full rounded-bl-full pointer-events-none absolute inset-y-0 left-0 bg-white-fade-left z-10","aria-hidden":"true"},QZ={key:1,class:"w-[36px] rounded-tr-full rounded-br-full pointer-events-none absolute inset-y-0 right-0 bg-white-fade-right z-10","aria-hidden":"true"},NZ=o.defineComponent({__name:"ToolbarFormat",props:{editor:{},disabled:{type:Boolean,default:!1},mode:{},activeExtensions:{default:()=>[]},threshold:{default:20}},setup(t){const{t:e}=Ot(),n=t,r=[xp,db,Sl,f5],i=o.computed(()=>{const m=[...n.editor.extensionManager.extensions],g=GY(m,{history:0});let b=[];for(const v of g){const{button:w,divider:C=!1,spacer:E=!1,toolbar:k=!0}=v.options;if(!w||!M0(w)||!k)continue;const x=w({editor:n.editor,extension:v,t:o.unref(e),isMobile:!0});if(Array.isArray(x)){const _=x.map((A,T)=>({id:`${v.name}`,button:A,divider:T===x.length-1?C:!1,spacer:T===0?E:!1,buttonName:A.buttonName}));b=[...b,..._];continue}b.push({button:x,divider:C,spacer:E,id:`${v.name}`})}return n.activeExtensions.length?b.filter(v=>v.id&&n.activeExtensions.includes(v.id)):(r.length&&(b=b.filter(v=>v.id&&!r.includes(v.id))),b=b.map(v=>{const w=["videoUpload","heading","strike","color","fontSize","fontFamily"],C=["redo"],E=w.includes(v.id??"")||C.includes(v.buttonName??"");return{...v,separator:E}}),b)}),s=m=>m.id==="spellchecker"?"!text-ed-blue !bg-white !font-normal rounded [&>div>svg]:w-[19px] [&>div>svg]:h-[19px] h-[26px] gap-x-1 whitespace-nowrap":m.button.componentProps.customClass,a=m=>m.id==="spellchecker"?"Spellchecker":m.button.componentProps.icon,l=o.ref(null),u=o.ref(!1),c=o.ref(!1);function f(){const m=l.value;if(!m)return;const{scrollLeft:g,scrollWidth:b,clientWidth:v}=m;if(!(b>v+1)){u.value=!1,c.value=!1;return}const C=g<=n.threshold,E=g+v>=b-n.threshold;u.value=!C,c.value=!E}const p=ct.useThrottleFn(f,50);return ct.useEventListener(l,"scroll",p),ct.useResizeObserver(l,p),ct.useEventListener(window,"resize",p),(m,g)=>(o.openBlock(),o.createElementBlock("div",{id:"tool-bar-format",class:o.normalizeClass(o.unref(xe)("bg-white border border-gray-100 dark:bg-ed-gray-500 dark:border-ed-muted rounded-full shadow-elevation2",!i.value.length&&"hidden"))},[o.createElementVNode("div",JZ,[o.unref(u)?(o.openBlock(),o.createElementBlock("div",ZZ)):o.createCommentVNode("",!0),o.unref(c)?(o.openBlock(),o.createElementBlock("div",QZ)):o.createCommentVNode("",!0),o.createElementVNode("div",{ref_key:"scrollEl",ref:l,class:"text-ed-gray-700 flex gap-2 items-center overflow-x-auto overflow-y-hidden min-h-11 scrollbar-hide overflow-scrolling-touch relative"},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.value,(b,v)=>{var w;return o.openBlock(),o.createElementBlock(o.Fragment,{key:v},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(b.button.component),o.mergeProps({id:b.id,ref_for:!0},b.button.componentProps,{editor:m.editor,disabled:m.disabled||((w=b.button.componentProps)==null?void 0:w.disabled),"custom-class":s(b),icon:a(b)}),o.createSlots({_:2},[o.renderList(b.button.componentSlots,(C,E,k)=>({name:`${E}`,fn:o.withCtx(x=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(C),o.mergeProps({ref_for:!0},x==null?void 0:x.props,{id:b.id}),null,16,["id"]))])}))]),1040,["id","editor","disabled","custom-class","icon"])),b.separator?(o.openBlock(),o.createBlock(o.unref(Lo),{key:0,orientation:"vertical",class:"h-5"})):o.createCommentVNode("",!0)],64)}),128))],512)])],2))}}),eQ=o.defineComponent({__name:"Switch",props:{defaultChecked:{type:Boolean},checked:{type:Boolean},disabled:{type:Boolean},required:{type:Boolean},name:{},id:{},value:{},asChild:{type:Boolean},as:{},class:{},customClassThumb:{}},emits:["update:checked"],setup(t,{emit:e}){const n=t,r=e,i=o.computed(()=>{const{class:a,customClassThumb:l,...u}=n;return u}),s=Rt(i,r);return(a,l)=>(o.openBlock(),o.createBlock(o.unref(pD),o.mergeProps(o.unref(s),{class:o.unref(xe)("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ed-ring focus-visible:ring-offset-2 focus-visible:ring-offset-ed-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-ed-primary data-[state=unchecked]:bg-ed-input",n.class)}),{default:o.withCtx(()=>[o.createVNode(o.unref(hD),{class:o.normalizeClass(o.unref(xe)("pointer-events-none block h-4 w-4 rounded-full bg-ed-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0",n.customClassThumb))},null,8,["class"])]),_:1},16,["class"]))}}),tQ={class:"text-red-500 relative -top-1"},Cc=o.defineComponent({__name:"EditorFieldName",props:{fieldName:{},disabled:{type:Boolean,default:!1},isRequired:{type:Boolean,default:!1}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(xe)("label-large",e.fieldName.customClass))},[o.createElementVNode("span",null,o.toDisplayString(e.fieldName.label),1),o.withDirectives(o.createElementVNode("span",tQ," •",512),[[o.vShow,e.fieldName.isRequired]])],2))}}),rh={__name:"splitpanes",props:{horizontal:{type:Boolean,default:!1},pushOtherPanes:{type:Boolean,default:!0},maximizePanes:{type:Boolean,default:!0},rtl:{type:Boolean,default:!1},firstSplitter:{type:Boolean,default:!1}},emits:["ready","resize","resized","pane-click","pane-maximize","pane-add","pane-remove","splitter-click","splitter-dblclick"],setup(t,{emit:e}){const n=e,r=t,i=o.useSlots(),s=o.ref([]),a=o.computed(()=>s.value.reduce((X,N)=>(X[~~N.id]=N)&&X,{})),l=o.computed(()=>s.value.length),u=o.ref(null),c=o.ref(!1),f=o.ref({mouseDown:!1,dragging:!1,activeSplitter:null,cursorOffset:0}),p=o.ref({splitter:null,timeoutId:null}),m=o.computed(()=>({[`splitpanes splitpanes--${r.horizontal?"horizontal":"vertical"}`]:!0,"splitpanes--dragging":f.value.dragging})),g=()=>{document.addEventListener("mousemove",w,{passive:!1}),document.addEventListener("mouseup",C),"ontouchstart"in window&&(document.addEventListener("touchmove",w,{passive:!1}),document.addEventListener("touchend",C))},b=()=>{document.removeEventListener("mousemove",w,{passive:!1}),document.removeEventListener("mouseup",C),"ontouchstart"in window&&(document.removeEventListener("touchmove",w,{passive:!1}),document.removeEventListener("touchend",C))},v=(X,N)=>{const ce=X.target.closest(".splitpanes__splitter");if(ce){const{left:ue,top:me}=ce.getBoundingClientRect(),{clientX:Se,clientY:ee}="ontouchstart"in window&&X.touches?X.touches[0]:X;f.value.cursorOffset=r.horizontal?ee-me:Se-ue}g(),f.value.mouseDown=!0,f.value.activeSplitter=N},w=X=>{f.value.mouseDown&&(X.preventDefault(),f.value.dragging=!0,requestAnimationFrame(()=>{T(_(X)),Oe("resize",{event:X},!0)}))},C=X=>{f.value.dragging&&(window.getSelection().removeAllRanges(),Oe("resized",{event:X},!0)),f.value.mouseDown=!1,f.value.activeSplitter=null,setTimeout(()=>{f.value.dragging=!1,b()},100)},E=(X,N)=>{"ontouchstart"in window&&(X.preventDefault(),p.value.splitter===N?(clearTimeout(p.value.timeoutId),p.value.timeoutId=null,k(X,N),p.value.splitter=null):(p.value.splitter=N,p.value.timeoutId=setTimeout(()=>p.value.splitter=null,500))),f.value.dragging||Oe("splitter-click",{event:X,index:N},!0)},k=(X,N)=>{if(Oe("splitter-dblclick",{event:X,index:N},!0),r.maximizePanes){let ce=0;s.value=s.value.map((ue,me)=>(ue.size=me===N?ue.max:ue.min,me!==N&&(ce+=ue.min),ue)),s.value[N].size-=ce,Oe("pane-maximize",{event:X,index:N,pane:s.value[N]}),Oe("resized",{event:X,index:N},!0)}},x=(X,N)=>{Oe("pane-click",{event:X,index:a.value[N].index,pane:a.value[N]})},_=X=>{const N=u.value.getBoundingClientRect(),{clientX:ce,clientY:ue}="ontouchstart"in window&&X.touches?X.touches[0]:X;return{x:ce-(r.horizontal?0:f.value.cursorOffset)-N.left,y:ue-(r.horizontal?f.value.cursorOffset:0)-N.top}},A=X=>{X=X[r.horizontal?"y":"x"];const N=u.value[r.horizontal?"clientHeight":"clientWidth"];return r.rtl&&!r.horizontal&&(X=N-X),X*100/N},T=X=>{const N=f.value.activeSplitter;let ce={prevPanesSize:L(N),nextPanesSize:I(N),prevReachedMinPanes:0,nextReachedMinPanes:0};const ue=0+(r.pushOtherPanes?0:ce.prevPanesSize),me=100-(r.pushOtherPanes?0:ce.nextPanesSize),Se=Math.max(Math.min(A(X),me),ue);let ee=[N,N+1],Ce=s.value[ee[0]]||null,He=s.value[ee[1]]||null;const Je=Ce.max<100&&Se>=Ce.max+ce.prevPanesSize,xt=He.max<100&&Se<=100-(He.max+I(N+1));if(Je||xt){Je?(Ce.size=Ce.max,He.size=Math.max(100-Ce.max-ce.prevPanesSize-ce.nextPanesSize,0)):(Ce.size=Math.max(100-He.max-ce.prevPanesSize-I(N+1),0),He.size=He.max);return}if(r.pushOtherPanes){const z=B(ce,Se);if(!z)return;({sums:ce,panesToResize:ee}=z),Ce=s.value[ee[0]]||null,He=s.value[ee[1]]||null}Ce!==null&&(Ce.size=Math.min(Math.max(Se-ce.prevPanesSize-ce.prevReachedMinPanes,Ce.min),Ce.max)),He!==null&&(He.size=Math.min(Math.max(100-Se-ce.nextPanesSize-ce.nextReachedMinPanes,He.min),He.max))},B=(X,N)=>{const ce=f.value.activeSplitter,ue=[ce,ce+1];return N<X.prevPanesSize+s.value[ue[0]].min&&(ue[0]=F(ce).index,X.prevReachedMinPanes=0,ue[0]<ce&&s.value.forEach((me,Se)=>{Se>ue[0]&&Se<=ce&&(me.size=me.min,X.prevReachedMinPanes+=me.min)}),X.prevPanesSize=L(ue[0]),ue[0]===void 0)?(X.prevReachedMinPanes=0,s.value[0].size=s.value[0].min,s.value.forEach((me,Se)=>{Se>0&&Se<=ce&&(me.size=me.min,X.prevReachedMinPanes+=me.min)}),s.value[ue[1]].size=100-X.prevReachedMinPanes-s.value[0].min-X.prevPanesSize-X.nextPanesSize,null):N>100-X.nextPanesSize-s.value[ue[1]].min&&(ue[1]=U(ce).index,X.nextReachedMinPanes=0,ue[1]>ce+1&&s.value.forEach((me,Se)=>{Se>ce&&Se<ue[1]&&(me.size=me.min,X.nextReachedMinPanes+=me.min)}),X.nextPanesSize=I(ue[1]-1),ue[1]===void 0)?(X.nextReachedMinPanes=0,s.value.forEach((me,Se)=>{Se<l.value-1&&Se>=ce+1&&(me.size=me.min,X.nextReachedMinPanes+=me.min)}),s.value[ue[0]].size=100-X.prevPanesSize-I(ue[0]-1),null):{sums:X,panesToResize:ue}},L=X=>s.value.reduce((N,ce,ue)=>N+(ue<X?ce.size:0),0),I=X=>s.value.reduce((N,ce,ue)=>N+(ue>X+1?ce.size:0),0),F=X=>[...s.value].reverse().find(N=>N.index<X&&N.size>N.min)||{},U=X=>s.value.find(N=>N.index>X+1&&N.size>N.min)||{},ie=()=>{var X;const N=Array.from(((X=u.value)==null?void 0:X.children)||[]);for(const ce of N){const ue=ce.classList.contains("splitpanes__pane"),me=ce.classList.contains("splitpanes__splitter");!ue&&!me&&(ce.remove(),console.warn("Splitpanes: Only <pane> elements are allowed at the root of <splitpanes>. One of your DOM nodes was removed."))}},oe=(X,N,ce=!1)=>{const ue=X-1,me=document.createElement("div");me.classList.add("splitpanes__splitter"),ce||(me.onmousedown=Se=>v(Se,ue),typeof window<"u"&&"ontouchstart"in window&&(me.ontouchstart=Se=>v(Se,ue)),me.onclick=Se=>E(Se,ue+1)),me.ondblclick=Se=>k(Se,ue+1),N.parentNode.insertBefore(me,N)},H=X=>{X.onmousedown=void 0,X.onclick=void 0,X.ondblclick=void 0,X.remove()},V=()=>{var X;const N=Array.from(((X=u.value)==null?void 0:X.children)||[]);for(const ue of N)ue.className.includes("splitpanes__splitter")&&H(ue);let ce=0;for(const ue of N)ue.className.includes("splitpanes__pane")&&(!ce&&r.firstSplitter?oe(ce,ue,!0):ce&&oe(ce,ue),ce++)},D=({uid:X,...N})=>{const ce=a.value[X];for(const[ue,me]of Object.entries(N))ce[ue]=me},j=X=>{var N;let ce=-1;Array.from(((N=u.value)==null?void 0:N.children)||[]).some(ue=>(ue.className.includes("splitpanes__pane")&&ce++,ue.isSameNode(X.el))),s.value.splice(ce,0,{...X,index:ce}),s.value.forEach((ue,me)=>ue.index=me),c.value&&o.nextTick(()=>{V(),J({addedPane:s.value[ce]}),Oe("pane-add",{pane:s.value[ce]})})},Y=X=>{const N=s.value.findIndex(ue=>ue.id===X);s.value[N].el=null;const ce=s.value.splice(N,1)[0];s.value.forEach((ue,me)=>ue.index=me),o.nextTick(()=>{V(),Oe("pane-remove",{pane:ce}),J({removedPane:{...ce}})})},J=(X={})=>{!X.addedPane&&!X.removedPane?we():s.value.some(N=>N.givenSize!==null||N.min||N.max<100)?le(X):te(),c.value&&Oe("resized")},te=()=>{const X=100/l.value;let N=0;const ce=[],ue=[];for(const me of s.value)me.size=Math.max(Math.min(X,me.max),me.min),N-=me.size,me.size>=me.max&&ce.push(me.id),me.size<=me.min&&ue.push(me.id);N>.1&&$e(N,ce,ue)},we=()=>{let X=100;const N=[],ce=[];let ue=0;for(const Se of s.value)X-=Se.size,Se.givenSize!==null&&ue++,Se.size>=Se.max&&N.push(Se.id),Se.size<=Se.min&&ce.push(Se.id);let me=100;if(X>.1){for(const Se of s.value)Se.givenSize===null&&(Se.size=Math.max(Math.min(X/(l.value-ue),Se.max),Se.min)),me-=Se.size;me>.1&&$e(me,N,ce)}},le=({addedPane:X,removedPane:N}={})=>{let ce=100/l.value,ue=0;const me=[],Se=[];((X==null?void 0:X.givenSize)??null)!==null&&(ce=(100-X.givenSize)/(l.value-1));for(const ee of s.value)ue-=ee.size,ee.size>=ee.max&&me.push(ee.id),ee.size<=ee.min&&Se.push(ee.id);if(!(Math.abs(ue)<.1)){for(const ee of s.value)(X==null?void 0:X.givenSize)!==null&&(X==null?void 0:X.id)===ee.id||(ee.size=Math.max(Math.min(ce,ee.max),ee.min)),ue-=ee.size,ee.size>=ee.max&&me.push(ee.id),ee.size<=ee.min&&Se.push(ee.id);ue>.1&&$e(ue,me,Se)}},$e=(X,N,ce)=>{let ue;X>0?ue=X/(l.value-N.length):ue=X/(l.value-ce.length),s.value.forEach((me,Se)=>{if(X>0&&!N.includes(me.id)){const ee=Math.max(Math.min(me.size+ue,me.max),me.min),Ce=ee-me.size;X-=Ce,me.size=ee}else if(!ce.includes(me.id)){const ee=Math.max(Math.min(me.size+ue,me.max),me.min),Ce=ee-me.size;X-=Ce,me.size=ee}}),Math.abs(X)>.1&&o.nextTick(()=>{c.value&&console.warn("Splitpanes: Could not resize panes correctly due to their constraints.")})},Oe=(X,N=void 0,ce=!1)=>{const ue=(N==null?void 0:N.index)??f.value.activeSplitter??null;n(X,{...N,...ue!==null&&{index:ue},...ce&&ue!==null&&{prevPane:s.value[ue-(r.firstSplitter?1:0)],nextPane:s.value[ue+(r.firstSplitter?0:1)]},panes:s.value.map(me=>({min:me.min,max:me.max,size:me.size}))})};o.watch(()=>r.firstSplitter,()=>V()),o.onMounted(()=>{ie(),V(),J(),Oe("ready"),c.value=!0}),o.onBeforeUnmount(()=>c.value=!1);const We=()=>{var X;return o.h("div",{ref:u,class:m.value},(X=i.default)==null?void 0:X.call(i))};return o.provide("panes",s),o.provide("indexedPanes",a),o.provide("horizontal",o.computed(()=>r.horizontal)),o.provide("requestUpdate",D),o.provide("onPaneAdd",j),o.provide("onPaneRemove",Y),o.provide("onPaneClick",x),(X,N)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(We)))}},Wo={__name:"pane",props:{size:{type:[Number,String]},minSize:{type:[Number,String],default:0},maxSize:{type:[Number,String],default:100}},setup(t){var e;const n=t,r=o.inject("requestUpdate"),i=o.inject("onPaneAdd"),s=o.inject("horizontal"),a=o.inject("onPaneRemove"),l=o.inject("onPaneClick"),u=(e=o.getCurrentInstance())==null?void 0:e.uid,c=o.inject("indexedPanes"),f=o.computed(()=>c.value[u]),p=o.ref(null),m=o.computed(()=>{const w=isNaN(n.size)||n.size===void 0?0:parseFloat(n.size);return Math.max(Math.min(w,b.value),g.value)}),g=o.computed(()=>{const w=parseFloat(n.minSize);return isNaN(w)?0:w}),b=o.computed(()=>{const w=parseFloat(n.maxSize);return isNaN(w)?100:w}),v=o.computed(()=>{var w;return`${s.value?"height":"width"}: ${(w=f.value)==null?void 0:w.size}%`});return o.watch(()=>m.value,w=>r({uid:u,size:w})),o.watch(()=>g.value,w=>r({uid:u,min:w})),o.watch(()=>b.value,w=>r({uid:u,max:w})),o.onMounted(()=>{i({id:u,el:p.value,min:g.value,max:b.value,givenSize:n.size===void 0?null:m.value,size:m.value})}),o.onBeforeUnmount(()=>a(u)),(w,C)=>(o.openBlock(),o.createElementBlock("div",{ref_key:"paneEl",ref:p,class:"splitpanes__pane",onClick:C[0]||(C[0]=E=>o.unref(l)(E,w._.uid)),style:o.normalizeStyle(v.value)},[o.renderSlot(w.$slots,"default")],4))}},nQ={class:"px-5 py-2.5"},rQ={key:0,class:"px-5 py-2.5"},oQ={key:1,class:"px-5 py-2.5"},iQ={key:2,class:"px-5 py-2.5"},sQ={class:"px-5 py-2.5"},aQ=o.defineComponent({__name:"EditorViewMobile",props:{extensions:{},mode:{},hideComment:{type:Boolean},fieldNameComment:{},fieldNameCommentCuesheet:{},fieldNameContent:{},comment:{},commentCuesheet:{},content:{},isEditorViewSplitContent:{type:Boolean},contentTextStyle:{}},setup(t){const e=t,n=o.computed(()=>{var v;return(v=e.extensions)==null?void 0:v.filter(w=>w.name!=="spellchecker")}),r=o.ref(),i=o.ref(),s=o.ref();o.onBeforeUnmount(()=>{r.value&&r.value.destroy(),i.value&&i.value.destroy(),s.value&&s.value.destroy()});function a(v){return new So({extensions:n.value,content:v,editable:!1,parseOptions:{preserveWhitespace:"full"}})}r.value=a(hn(e.comment,!0,e.mode)),i.value=a(hn(e.commentCuesheet,!0,e.mode)),s.value=a(hn(e.content,!0,e.mode));function l(v,w){if(!v)return;const C=hn(w,!0,e.mode);nt.isEqual(v.getHTML(),C)||v.commands.setContent(C,!1,{preserveWhitespace:"full"})}o.watch(()=>e.comment,v=>{l(r.value,v)}),o.watch(()=>e.commentCuesheet,v=>{l(i.value,v)}),o.watch(()=>e.content,v=>{l(s.value,v)});const{isScrolling:u,handleScroll:c}=Ol(),{isScrolling:f,handleScroll:p}=Ol(),m=o.computed(()=>e.mode!==Re.EDITOR?!0:!e.hideComment),g=o.computed(()=>e.mode!==Re.REPORT?!0:e.mode===Re.REPORT&&!e.hideComment),b=o.computed(()=>e.mode===Re.STRAIGHT||e.mode===Re.PLAIN_TEXT||!m.value);return(v,w)=>{const C=Cc;return o.openBlock(),o.createBlock(o.unref(rh),{horizontal:"",class:o.normalizeClass(o.unref(xe)("flex-1",v.contentTextStyle))},{default:o.withCtx(()=>[o.unref(b)?(o.openBlock(),o.createBlock(o.unref(Wo),{key:0,class:o.normalizeClass(o.unref(xe)("!overflow-y-auto border border-ed-gray rounded-md",!v.isEditorViewSplitContent&&"border-none",!o.unref(f)&&"scrollbar-thumb-transparent")),onScroll:o.unref(p)},{default:o.withCtx(()=>[o.createElementVNode("div",nQ,[v.fieldNameContent?(o.openBlock(),o.createBlock(C,{key:0,"field-name":v.fieldNameContent,class:"leading-7 font-medium text-blue-500"},null,8,["field-name"])):o.createCommentVNode("",!0),o.createVNode(o.unref(Xn),{editor:o.unref(s)},null,8,["editor"])])]),_:1},8,["class","onScroll"])):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.unref(m)?(o.openBlock(),o.createBlock(o.unref(Wo),{key:0,class:o.normalizeClass(o.unref(xe)("!overflow-y-auto border border-ed-gray rounded-md",!v.isEditorViewSplitContent&&"border-none",!o.unref(u)&&"scrollbar-thumb-transparent")),onScroll:o.unref(c)},{default:o.withCtx(()=>[o.createElementVNode("div",{class:o.normalizeClass(o.unref(xe)("divide-y divide-ed-gray divide-dashed"))},[o.unref(g)?(o.openBlock(),o.createElementBlock("div",rQ,[v.fieldNameComment?(o.openBlock(),o.createBlock(C,{key:0,"field-name":v.fieldNameComment,class:"leading-7 font-medium text-blue-500"},null,8,["field-name"])):o.createCommentVNode("",!0),o.createVNode(o.unref(Xn),{editor:o.unref(r)},null,8,["editor"])])):o.createCommentVNode("",!0),v.mode===o.unref(Re).REPORT?(o.openBlock(),o.createElementBlock("div",oQ,[v.fieldNameCommentCuesheet?(o.openBlock(),o.createBlock(C,{key:0,"field-name":v.fieldNameCommentCuesheet,class:"leading-7 font-medium text-blue-500"},null,8,["field-name"])):o.createCommentVNode("",!0),o.createVNode(o.unref(Xn),{editor:o.unref(i)},null,8,["editor"])])):o.createCommentVNode("",!0),v.isEditorViewSplitContent?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",iQ,[v.fieldNameContent?(o.openBlock(),o.createBlock(C,{key:0,"field-name":v.fieldNameContent,class:"leading-7 font-medium text-blue-500"},null,8,["field-name"])):o.createCommentVNode("",!0),o.createVNode(o.unref(Xn),{editor:o.unref(s)},null,8,["editor"])]))],2)]),_:1},8,["class","onScroll"])):o.createCommentVNode("",!0),v.isEditorViewSplitContent?(o.openBlock(),o.createBlock(o.unref(Wo),{key:1,class:o.normalizeClass(o.unref(xe)("!overflow-y-auto border border-ed-gray rounded-md",!o.unref(f)&&"scrollbar-thumb-transparent")),onScroll:o.unref(p)},{default:o.withCtx(()=>[o.createElementVNode("div",sQ,[v.fieldNameContent?(o.openBlock(),o.createBlock(C,{key:0,"field-name":v.fieldNameContent,class:"leading-7 font-medium text-blue-500"},null,8,["field-name"])):o.createCommentVNode("",!0),o.createVNode(o.unref(Xn),{editor:o.unref(s)},null,8,["editor"])])]),_:1},8,["class","onScroll"])):o.createCommentVNode("",!0)],64))]),_:1},8,["class"])}}}),lQ={class:"flex gap-2 items-center overflow-x-auto"},JE=o.defineComponent({__name:"ToolbarMobile",props:{editor:{},disabled:{type:Boolean,default:!1},mode:{},activeExtensions:{default:()=>[db,Sl,fb]},customClassToolbar:{}},setup(t){const{t:e}=Ot(),n=t,r=o.inject("isEditable",o.ref(!0)),i=o.computed(()=>{const u=[...n.editor.extensionManager.extensions],c=u.find(m=>m.name===fb);let f=u.sort((m,g)=>m.name==="spellchecker"?-1:g.name==="spellchecker"||m.name==="superText"?1:g.name==="superText"?-1:0);c&&(f=u.sort((m,g)=>m.name==="configPlan"?1:g.name==="configPlan"?-1:0));let p=[];for(const m of f){const{button:g,divider:b=!1,spacer:v=!1,toolbar:w=!0}=m.options;if(!g||!M0(g)||!w)continue;const C=g({editor:n.editor,extension:m,t:o.unref(e),isMobile:!0});if(Array.isArray(C)){const E=C.map((k,x)=>({id:`${m.name}`,button:k,divider:x===C.length-1?b:!1,spacer:x===0?v:!1}));p=[...p,...E];continue}p.push({button:C,divider:b,spacer:v,id:`${m.name}`})}if(!r.value){const m=p.find(g=>g.id==="superText");m&&(m.button.componentProps.disabled=!0)}return n.activeExtensions.length?p.filter(m=>m.id&&n.activeExtensions.includes(m.id)):p}),s=u=>u.id==="spellchecker"?"!text-ed-blue data-[state=off]:bg-white dark:data-[state=off]:bg-ed-accent/40 !font-normal rounded [&>div>svg]:w-[19px] [&>div>svg]:h-[19px] h-[26px] gap-x-1 whitespace-nowrap":u.button.componentProps.customClass,a=u=>u.id==="spellchecker"?"Spellchecker":u.button.componentProps.icon,l=o.ref(!1);return(u,c)=>{const f=p5;return o.openBlock(),o.createElementBlock("div",{id:"tool-bar",class:o.normalizeClass(o.unref(xe)("z-10 border border-ed-input rounded-[5px] px-2.5 py-[5px] leading-none",!i.value.length&&"hidden",u.customClassToolbar))},[o.createElementVNode("div",lQ,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.value,(p,m)=>{var g,b,v;return o.openBlock(),o.createElementBlock(o.Fragment,{key:m},[p.spacer&&m!==0?(o.openBlock(),o.createBlock(o.unref(Lo),{key:0,orientation:"vertical",class:"h-[16px] mx-[10px]"})):o.createCommentVNode("",!0),(o.openBlock(),o.createBlock(o.resolveDynamicComponent(p.button.component),o.mergeProps({id:p.id,ref_for:!0},p.button.componentProps,{editor:u.editor,disabled:u.disabled||((g=p.button.componentProps)==null?void 0:g.disabled),"custom-class":s(p),icon:a(p)}),o.createSlots({_:2},[o.renderList(p.button.componentSlots,(w,C,E)=>({name:`${C}`,fn:o.withCtx(k=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(w),o.mergeProps({ref_for:!0},k==null?void 0:k.props,{id:p.id}),null,16,["id"]))])}))]),1040,["id","editor","disabled","custom-class","icon"])),p.id===Sl&&o.unref(l)?(o.openBlock(),o.createBlock(f,{key:1,class:"bg-white border-inherit w-[26px] h-[26px] shadow-none",checked:(v=(b=p.button.componentProps).isActive)==null?void 0:v.call(b),"onUpdate:checked":w=>{var C,E;return(E=(C=p.button.componentProps).action)==null?void 0:E.call(C)}},null,8,["checked","onUpdate:checked"])):o.createCommentVNode("",!0),p.divider?(o.openBlock(),o.createBlock(o.unref(Lo),{key:2,orientation:"vertical",class:"mx-2 h-auto"})):o.createCommentVNode("",!0)],64)}),128))])],2)}}}),uQ={class:"flex w-fit rounded-md bg-ed-gray-600 text-white text-sm max-w-full overflow-x-auto"},cQ=Ao(o.defineComponent({__name:"MainBubbleMenuList",props:{editor:{},mode:{},disableSuperInput:{type:Boolean},hasClipboard:{type:Boolean}},emits:["close-long-press-menu"],setup(t,{emit:e}){const n=t,r=e,{t:i}=Ot(),s=o.computed(()=>[...n.editor.extensionManager.extensions].find(p=>p.name==="superText")),a=o.ref(!1),l=o.computed(()=>n.editor.storage.deviceEnv.specialCharModal),u=f=>{const{state:p}=n.editor,{from:m}=p.selection;n.editor.commands.insertContentAt(m,f)},c=()=>{n.editor.chain().focus().toggleSuperInputMoblie().run(),r("close-long-press-menu");const f=DK(n.editor);n.editor.commands.setSuperTextContent(f)};return(f,p)=>{var m,g,b;return o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createElementVNode("div",uQ,[o.unref(s)&&!f.disableSuperInput&&f.mode!==o.unref(Re).EDITOR?(o.openBlock(),o.createElementBlock("button",{key:0,class:"bubble-menu-item",onClick:c},o.toDisplayString(o.unref(i)("editor.super")),1)):o.createCommentVNode("",!0),o.createElementVNode("button",{class:"bubble-menu-item",onClick:p[0]||(p[0]=v=>a.value=!0)},o.toDisplayString(o.unref(i)("editor.insertSpecial")),1),f.hasClipboard?(o.openBlock(),o.createElementBlock("button",{key:1,class:"bubble-menu-item",onClick:p[1]||(p[1]=v=>f.editor.chain().focus().pasteContent().run())},o.toDisplayString(o.unref(i)("editor.paste")),1)):o.createCommentVNode("",!0),o.createElementVNode("button",{class:"bubble-menu-item",onClick:p[2]||(p[2]=v=>f.editor.chain().focus().cutContent().run())},o.toDisplayString(o.unref(i)("editor.cut")),1),o.createElementVNode("button",{class:"bubble-menu-item",onClick:p[3]||(p[3]=()=>{f.editor.chain().focus().copyContent().setTextSelection(0).blur().run(),r("close-long-press-menu")})},o.toDisplayString(o.unref(i)("editor.copy")),1),o.createElementVNode("button",{class:"bubble-menu-item",onClick:p[4]||(p[4]=v=>f.editor.chain().focus().selectAll().run())},o.toDisplayString(o.unref(i)("editor.selectAll")),1)]),(o.openBlock(),o.createBlock(o.Teleport,{to:"body"},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent((m=o.unref(l))==null?void 0:m.component),{"is-open":o.unref(a),open:o.unref(a),class:o.normalizeClass((b=(g=o.unref(l))==null?void 0:g.componentProps)==null?void 0:b.class),onSelectedChar:u,onClose:p[5]||(p[5]=v=>a.value=!1)},null,40,["is-open","open","class"]))]))],64)}}}),[["__scopeId","data-v-25134992"]]);class ZE{isNativeWebViewAvailable(){return window.ReactNativeWebView!==void 0}getDevicePlatform(){var r;if(!this.isNativeWebViewAvailable())return;if(typeof window.webkit=="object"&&typeof((r=window.webkit)==null?void 0:r.messageHandlers)=="object")return _0.IOS;const n=navigator.userAgent.toLowerCase();if(n.includes("android"))return _0.ANDROID;if(n.includes("iphone")||n.includes("ipad")||n.includes("ipod"))return _0.IOS}sendToNative(e,n){if(window.ReactNativeWebView){const r={type:e,data:n};window.ReactNativeWebView.postMessage(JSON.stringify(r)),console.log(`Sent message to native: ${e}`)}else console.log("ReactNativeWebView not available")}receiveDataFromNative(e,n){const r=window.receiveDriverData;window.receiveDriverData=i=>{try{const s=JSON.parse(i);s.type===e&&(console.log(`Received data from native ${e}`),n(s.data)),r&&r(i)}catch(s){console.log("Error parsing data from native",s)}}}}const QE=o.defineComponent({__name:"MainBubbleMenu",props:{editor:{},mode:{},disableSuperInput:{type:Boolean}},setup(t){const e=t,n=new ZE,r=o.ref(!1),i=async()=>{var g,b;const m=await((b=(g=e.editor).hasClipboard)==null?void 0:b.call(g));r.value=!!m},s={duration:200,placement:"bottom",appendTo:()=>document.body.querySelector(".splitpanes__pane"),onShow:()=>{i(),n.sendToNative("hideIOSEditMenu")},getReferenceClientRect:()=>{if(e.editor&&!e.editor.isDestroyed){const{view:m,state:g}=e.editor,{from:b,to:v}=g.selection,w=m.dom.getBoundingClientRect(),C=m.coordsAtPos(b),E=m.coordsAtPos(v),k=Math.min(C.top,E.top),_=Math.max(C.bottom,E.bottom)-k;return new DOMRect(w.left,k,w.width,_)}return null}},a=o.ref(null),l=o.ref(!1),u=({editor:m,state:g})=>e.editor.storage.deviceEnv.isForceCloseBubble||["image","superText","link"].some(w=>m.isActive(w))?!1:!g.selection.empty||l.value;function c(m){return f(m)&&m.touches.length>0?{x:m.touches[0].clientX,y:m.touches[0].clientY}:f(m)&&m.changedTouches.length>0?{x:m.changedTouches[0].clientX,y:m.changedTouches[0].clientY}:m instanceof MouseEvent?{x:m.clientX,y:m.clientY}:window.PointerEvent&&m instanceof PointerEvent?{x:m.clientX,y:m.clientY}:null}function f(m){return"touches"in m}function p(m){if(!e.editor)return;const g=c(m);if(!g)return;const b=e.editor.view,v=b.state,w=b.posAtCoords({left:g.x,top:g.y});if(!w||w.inside===-1)return;const C=w.pos,E=v.doc.content.size,k=Math.min(C+1,E);let x=v.tr;x=x.setSelection(Ae.create(v.doc,C,k)),b.dispatch(x),requestAnimationFrame(()=>{const _=b.state.tr.setSelection(Ae.create(b.state.doc,C,C));b.dispatch(_),b.focus()})}return o.onMounted(()=>{const m=e.editor.view.dom;ct.onLongPress(o.ref(m),v=>{l.value=!0,p(v)},{delay:500,modifiers:{prevent:!1}});const g=()=>{e.editor.state.selection.empty&&(l.value=!1)};m.addEventListener("pointerdown",g);const b=({transaction:v})=>{l.value&&v.docChanged&&(l.value=!1,o.nextTick(()=>{var w;try{const C=(w=a.value)==null?void 0:w.$el;C&&C._tippy&&typeof C._tippy.hide=="function"&&C._tippy.hide()}catch{const E=e.editor.view,k=E.state,x=k.selection.from,_=k.doc.content.size,A=Math.min(x+1,_);E.dispatch(k.tr.setSelection(Ae.create(k.doc,x,A))),requestAnimationFrame(()=>{E.dispatch(E.state.tr.setSelection(Ae.create(E.state.doc,x,x)))})}}))};e.editor.on("transaction",b),o.onUnmounted(()=>{m.removeEventListener("pointerdown",g),e.editor.off("transaction",b)})}),(m,g)=>(o.openBlock(),o.createBlock(o.unref(_u),{ref_key:"bubbleMenuRef",ref:a,editor:m.editor,"tippy-options":s,"should-show":u},{default:o.withCtx(()=>[o.createVNode(cQ,{editor:m.editor,mode:m.mode,disableSuperInput:m.disableSuperInput,hasClipboard:o.unref(r),onCloseLongPressMenu:g[0]||(g[0]=b=>l.value=!1)},null,8,["editor","mode","disableSuperInput","hasClipboard"])]),_:1},8,["editor"]))}}),dQ={class:"flex items-center justify-between label-large mb-2"},fQ={class:"mb-5"},pQ={class:"flex gap-x-3"},hQ=o.defineComponent({__name:"SuperInputBottomSheet",props:{editor:{},open:{type:Boolean},bottomSheetComponent:{}},emits:["save","close"],setup(t,{emit:e}){const n=t,r=e,i=o.ref(""),s=o.ref(""),a=o.computed(()=>Rp(i.value)),l=()=>{i.value="",s.value="",n.editor.commands.setSuperTextContent(i.value,s.value)},u=()=>{l(),r("close")};o.watch(()=>n.open,()=>{n.open&&(i.value=n.editor.storage.superText.superTextContent,s.value=n.editor.storage.superText.superTextPosition)});const c=()=>{i.value=n.editor.storage.superText.superTextContent},f=()=>{r("save",i.value,s.value),l()};return(p,m)=>{var b;const g=Tt;return o.openBlock(),o.createBlock(o.resolveDynamicComponent((b=p.bottomSheetComponent)==null?void 0:b.component),{"is-open":p.open,type:"bottom",title:"수퍼 입력",onOnClose:u},{customContent:o.withCtx(()=>{var v;return[o.createElementVNode("div",dQ,[m[2]||(m[2]=o.createElementVNode("span",null,"내용",-1)),(o.openBlock(),o.createBlock(o.resolveDynamicComponent((v=p.bottomSheetComponent)==null?void 0:v.button),{class:"w-fit [&_svg]:size-6 text-blue",variant:"ghost",size:"icon",onClick:c},{default:o.withCtx(()=>[o.createVNode(g,{name:"reset",class:"h-5 w-5"}),m[1]||(m[1]=o.createElementVNode("span",null,"초기화",-1))]),_:1}))])]}),body:o.withCtx(()=>[o.createElementVNode("div",fQ,[o.createVNode(vb,{modelValue:o.unref(i),"onUpdate:modelValue":m[0]||(m[0]=v=>o.isRef(i)?i.value=v:null),"parent-editor":p.editor,"spellcheck-enabled":!1,autofocus:"end"},null,8,["modelValue","parent-editor"])])]),footer:o.withCtx(()=>{var v,w;return[o.createElementVNode("div",pQ,[(o.openBlock(),o.createBlock(o.resolveDynamicComponent((v=p.bottomSheetComponent)==null?void 0:v.button),{variant:"outline",onClick:u},{default:o.withCtx(()=>m[3]||(m[3]=[o.createTextVNode(" 취소 ")])),_:1})),(o.openBlock(),o.createBlock(o.resolveDynamicComponent((w=p.bottomSheetComponent)==null?void 0:w.button),{disabled:o.unref(a),variant:o.unref(a)?"disabled":"default",onClick:f},{default:o.withCtx(()=>m[4]||(m[4]=[o.createTextVNode(" 입력 ")])),_:1},8,["disabled","variant"]))])]}),_:1},40,["is-open"])}}}),NE=Dn.create({name:"diffDel",parseHTML(){return[{tag:"span.diff-del"}]},renderHTML({HTMLAttributes:t}){return["span",{class:"diff-del",...t},0]}}),mQ=o.defineComponent({__name:"EditorCommentMoblie",props:{isMobile:{type:Boolean},superTextArea:{default:{view:!0,button:!0}},mode:{},modelValue:{default:""},comment:{},commentCuesheet:{},hideComment:{type:Boolean},disableSuperInput:{type:Boolean,default:!1},fontSizeDefault:{},fontFamilyDefault:{},contentTextStyle:{},isOpenSuperView:{type:Boolean,default:!0},output:{default:"html"},dark:{type:Boolean,default:void 0},disabled:{type:Boolean,default:!1},hideToolbar:{type:Boolean,default:!1},isShowFormatControlBar:{type:Boolean},customClassFormatControlBar:{},titleBarComment:{},titleBarContent:{},fieldNameComment:{},fieldNameCommentCuesheet:{},fieldNameContent:{},fieldNameSuper:{},isScreenSplit:{},isShowLineNumber:{type:Boolean},hideMenubar:{type:Boolean},disableBubble:{type:Boolean,default:!1},hideBubble:{type:Boolean,default:!1},maxWidth:{default:void 0},minHeight:{default:600},maxHeight:{default:void 0},height:{},extensions:{default:()=>[]},editorClass:{default:void 0},contentClass:{default:void 0},isCompare:{type:Boolean},autoHeight:{type:Boolean},textAlert:{},customClassToolbar:{},readonly:{type:Boolean},canEditSuperReadOnly:{type:Boolean},autoFocus:{type:Boolean,default:!0},superPreviewCustomClass:{},minChar:{},isAccordion:{type:Boolean},contentAutoCopied:{},isEditorView:{type:Boolean},isEditorViewSplitContent:{type:Boolean},editorContentInstance:{}},emits:["enter","change","update:modelValue","update:comment","onFocusEditor","changed:selection","setEditorSelected","onBlurEditor","lineFocus","onFocus","onBlur"],setup(t,{expose:e,emit:n}){const r=t,i=n,s=o.useAttrs(),a=Cn(),{isReady:l,editor:u,updateEditorState:c,checkSpellStore:f}=a,p=o.inject("isEditable",o.ref(!0)),m=new So({enablePasteRules:!1,enableInputRules:!1,content:hn(r.modelValue,r.disabled),editorProps:{attributes:{id:or.COMMENT,[or.DISABLE_SUPER_INPUT]:`${r.disableSuperInput}`},handleKeyDown:nt.throttle((C,E)=>E.key==="Enter"&&s.enter&&!E.shiftKey?(i("enter"),!0):!1,To),transformPastedHTML:C=>(C=C.replace(/\s*style="[^"]*"/g,""),C)},onCreate:({editor:C})=>{c(C)},onUpdate:nt.throttle(({editor:C})=>{l.value=!0;const E=b(C,r.output);i("update:modelValue",E),i("change",{editor:C,output:E}),c(C)},To),extensions:[NE,...nt.uniqBy(nt.reverse(o.unref(r.extensions)),"name")],editable:p.value,onFocus:()=>{g()},onBlur:({editor:C,event:E})=>{i("onBlurEditor",E)}});function g(){i("setEditorSelected",m)}g();function b(C,E){if(!C)return"";if(C.isEmpty)return E==="json"?{}:"";switch(E){case"html":return C.getHTML();case"json":return C.getJSON();case"text":return C.getText();default:return""}}function v(C){return C.every(E=>m==null?void 0:m.extensionManager.extensions.find(k=>k.name===E))}o.watch(()=>f.languages,()=>{m.commands.checkSpelling()}),o.watch(()=>r.modelValue,C=>{if(!m||nt.isEqual(b(m,r.output),C))return;const{from:E,to:k}=m.state.selection;m.commands.setTextSelection({from:E,to:k}),m.commands.setContent(hn(C,r.disabled),!1)},{deep:!0}),o.watch(()=>u.value,()=>{u.value&&u.value.on("selectionUpdate",({editor:C})=>{i("changed:selection",{editor:C})})}),o.watch(()=>r.disableSuperInput,()=>{const C=document.getElementById(or.COMMENT);C==null||C.setAttribute(or.DISABLE_SUPER_INPUT,`${r.disableSuperInput}`)}),o.onUnmounted(()=>m==null?void 0:m.destroy()),Zu(Tu.SAVE,()=>{localStorage.setItem("comment",b(m,"html"))});function w(C){m.commands.focus("end"),g()}return th(m),o.onMounted(()=>{var C;r.autoFocus&&w(r.mode),(C=m==null?void 0:m.commands)!=null&&C.setIsMobile&&m.commands.setIsMobile(!0)}),o.watch(()=>r.mode,C=>{r.autoFocus&&w()}),o.watch(()=>p.value,C=>{var E;m==null||m.setEditable(C),(E=m==null?void 0:m.commands)!=null&&E.setIsEnableSuggestion&&m.commands.setIsEnableSuggestion(C)},{immediate:!0}),e({editor:m}),(C,E)=>{const k=QE,x=eh,_=Np,A=Qp,T=Bf;return o.openBlock(),o.createElementBlock(o.Fragment,null,[!C.hideBubble&&!C.disabled&&o.unref(p)?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createVNode(k,{editor:o.unref(m),mode:C.mode,"disable-super-input":C.disableSuperInput},null,8,["editor","mode","disable-super-input"]),v([o.unref(fc)])?(o.openBlock(),o.createBlock(x,{key:0,editor:o.unref(m)},null,8,["editor"])):o.createCommentVNode("",!0),v([o.unref(ua)])?(o.openBlock(),o.createBlock(_,{key:1,editor:o.unref(m)},null,8,["editor"])):o.createCommentVNode("",!0),v([o.unref(cs)])?(o.openBlock(),o.createBlock(A,{key:2,editor:o.unref(m)},null,8,["editor"])):o.createCommentVNode("",!0),v([o.unref(ds),o.unref(fs)])?(o.openBlock(),o.createBlock(T,{key:3,editor:o.unref(m)},null,8,["editor"])):o.createCommentVNode("",!0)],64)):o.createCommentVNode("",!0),o.createVNode(o.unref(Xn),{id:"editor-panel",editor:o.unref(m),spellcheck:"true",class:o.normalizeClass(["flex-1 flex-col relative"])},null,8,["editor"])],64)}}}),ek=o.defineComponent({__name:"ToolbarTitle",props:{titleBar:{},customClass:{}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("h3",{class:o.normalizeClass(o.unref(xe)("rounded-[5px] px-2.5 py-[5px] min-h-[32px] flex items-center bg-ed-gray-500",[e.customClass],[e.titleBar.bgClass]))},o.toDisplayString(e.titleBar.title),3))}});function tk(t=!1,e=10){const n=e,r=90,i=50,s=n+1,a=o.ref(!0),l=o.ref(!0),u=o.ref(i),c=o.ref(i);return{HEADER_ONLY_SIZE:n,FULL_SIZE:r,SPLIT_SIZE:i,pane1ContentVisible:a,pane2ContentVisible:l,pane1Size:u,pane2Size:c,togglePane:m=>{if(o.unref(t)){l.value?(l.value=!1,c.value=n):(l.value=!0,c.value=r+n);return}if(m==="pane1"){a.value&&l.value?(a.value=!1,u.value=n,c.value=r):a.value&&!l.value?(a.value=!1,l.value=!0,u.value=n,c.value=r):!a.value&&l.value?(a.value=!0,u.value=i,c.value=i):(a.value=!0,u.value=r,c.value=n);return}m==="pane2"&&(a.value&&l.value?(l.value=!1,u.value=r,c.value=n):l.value&&!a.value?(l.value=!1,a.value=!0,u.value=r,c.value=n):!l.value&&a.value?(l.value=!0,u.value=i,c.value=i):(l.value=!0,u.value=n,c.value=r))},handlePaneResize:m=>{const g=m.panes;if(g&&g.length>=2){const b=g[0].size,v=g[1].size;u.value=b,c.value=v,b>n&&!a.value&&(a.value=!0),v>n&&!l.value&&(l.value=!0),b<=s&&a.value&&(a.value=!1),v<=s&&l.value&&(l.value=!1)}}}}const gQ={class:"flex justify-between items-center relative"},xc=o.defineComponent({__name:"CoreEditorMoblie",props:{isMobile:{type:Boolean},superTextArea:{default:{view:!0,button:!0}},mode:{},modelValue:{default:""},comment:{default:""},commentCuesheet:{default:""},hideComment:{type:Boolean,default:!1},disableSuperInput:{type:Boolean,default:!1},fontSizeDefault:{default:""},fontFamilyDefault:{default:""},contentTextStyle:{default:"text-sm font-NanumGothicCoding"},isOpenSuperView:{type:Boolean},output:{default:"html"},dark:{type:Boolean,default:void 0},disabled:{type:Boolean,default:!1},hideToolbar:{type:Boolean,default:!1},isShowFormatControlBar:{type:Boolean},customClassFormatControlBar:{default:""},titleBarComment:{default:null},titleBarContent:{default:null},fieldNameComment:{default:null},fieldNameCommentCuesheet:{},fieldNameContent:{default:null},fieldNameSuper:{},isScreenSplit:{default:!1},isShowLineNumber:{type:Boolean,default:!1},hideMenubar:{type:Boolean},disableBubble:{type:Boolean,default:!1},hideBubble:{type:Boolean,default:!1},maxWidth:{default:void 0},minHeight:{default:200},maxHeight:{default:void 0},height:{default:void 0},extensions:{default:()=>[]},editorClass:{default:void 0},contentClass:{default:void 0},isCompare:{type:Boolean},autoHeight:{type:Boolean},textAlert:{},customClassToolbar:{default:""},readonly:{type:Boolean,default:!1},canEditSuperReadOnly:{type:Boolean},autoFocus:{type:Boolean,default:!0},superPreviewCustomClass:{},minChar:{},isAccordion:{type:Boolean},contentAutoCopied:{},isEditorView:{type:Boolean,default:!1},isEditorViewSplitContent:{type:Boolean,default:!1},editorContentInstance:{}},emits:["enter","change","update:modelValue","update:comment","onFocusEditor","changed:selection","setEditorSelected","onBlurEditor","lineFocus","onFocus","onBlur"],setup(t,{expose:e,emit:n}){var z;const r=t,i=n,s=new ZE;o.provide("isMobile",!0),ct.useEventBus(ar.INCREASE_DECREASE_FONTSIZE);const a=o.useAttrs(),l=Cn(),{state:u,isFullscreen:c,isReady:f,editor:p,updateEditorState:m,checkSpellStore:g,setImageAttachment:b,setEditorContentMobile:v,footerTargetRef:w}=l,{markAsFocused:C,insertHtml:E}=xZ(),k=o.ref(!r.disabled&&!r.readonly);o.provide("isEditable",k);const x=o.computed(()=>[...u.extensions,...nt.differenceBy(r.extensions,u.extensions,"name")].map((O,q)=>O.configure({sort:q}))),_=o.ref(r.fontSizeDefault),A=o.ref(r.fontFamilyDefault);o.provide("fontSize",_),o.provide("fontFamily",A);const T=o.computed(()=>({...o.unref(c)?{height:"100%"}:{minHeight:r.minHeight?ln(r.minHeight):void 0,maxHeight:r.maxHeight?ln(r.maxHeight):void 0,height:r.height?ln(r.height):void 0},maxWidth:ln(r.maxWidth),width:r.maxWidth?"100%":void 0,margin:r.maxWidth?"0 auto":void 0})),B=new So({enablePasteRules:!1,enableInputRules:!1,content:hn(r.modelValue,r.disabled,r.mode),editorProps:{handleKeyDown:nt.throttle((O,q)=>q.key==="Enter"&&a.enter&&!q.shiftKey?(i("enter"),!0):!1,To),transformPastedHTML:O=>(O=O.replace(/\s*style="[^"]*"/g,""),O),handlePaste(O,q){var Fe;if(r.mode!==Re.PLAIN_TEXT)return!1;q.preventDefault();const se=((Fe=q.clipboardData)==null?void 0:Fe.getData("text/plain"))||"",{tr:ke,selection:Ze}=O.state;return O.dispatch(ke.insertText(se,Ze.from)),!0}},onCreate:({editor:O})=>{m(O)},onUpdate:nt.throttle(({editor:O})=>{f.value=!0;const q=j(O,r.output);i("update:modelValue",q),i("change",{editor:O,output:q}),m(O),L(O)},To),extensions:nt.uniqBy(nt.reverse(o.unref(x)),"name"),editable:k.value,onFocus:O=>{V(),i("onFocus",O),C()},onBlur:O=>i("onBlur",O),parseOptions:{preserveWhitespace:"full"}});function L(O){const q=[];O.state.doc.descendants(se=>{se.type.name==="image"&&q.push({id:se.attrs.id,src:se.attrs.src})}),b(q)}const I=o.ref(),F=o.ref(!0),U=o.ref(!1);function ie(){s.isNativeWebViewAvailable()&&(s.receiveDataFromNative("keyboardDidShow",O=>{U.value=!0}),s.receiveDataFromNative("keyboardDidHide",O=>{U.value=!1}))}function oe(O){const q=document.querySelectorAll('[contenteditable="true"]:not(.tiptap), .simple-editor, input, textarea'),se=Array.from(q).some(ke=>ke.contains(O.target));if(O.type==="focusout"){F.value=!0;return}F.value=!se}ct.useEventListener(document,"focusin",oe),ct.useEventListener(document,"focusout",oe),o.onMounted(()=>{V(B),v(B),ie()});const H=o.computed(()=>r.isShowFormatControlBar&&r.mode===Re.EDITOR&&k&&!r.isEditorView);function V(O){I.value=O??B,l.setEditorSelectedMobile(I.value)}const D=o.computed(()=>B.storage.superText.isShowSuperInputMoblie);function j(O,q){if(!O)return"";if(O.isEmpty)return q==="json"?{}:"";if(r.mode===Re.PLAIN_TEXT)return O.getText({blockSeparator:`
|
|
343
343
|
`});switch(q){case"html":return O.getHTML();case"json":return O.getJSON();case"text":return O.getText({blockSeparator:`
|
|
344
|
-
`});default:return""}}function Y(O){return O.every(q=>B==null?void 0:B.extensionManager.extensions.find(se=>se.name===q))}o.watch(()=>g.languages,()=>{B.commands.checkSpelling()}),o.watch(()=>r.modelValue,O=>{if(!B||nt.isEqual(j(B,r.output),O))return;const{from:q,to:se}=B.state.selection;B.commands.setTextSelection({from:q,to:se}),B.commands.setContent(hn(O,r.disabled,r.mode),!1,{preserveWhitespace:"full"})},{deep:!0}),o.watch([()=>r.disabled,()=>r.readonly],()=>{k.value=!r.disabled&&!r.readonly},{immediate:!0}),o.watch(()=>k.value,O=>{var q;B==null||B.setEditable(O),(q=B==null?void 0:B.commands)!=null&&q.setIsEnableSuggestion&&B.commands.setIsEnableSuggestion(O)},{immediate:!0}),o.watch(()=>p.value,()=>{p.value&&p.value.on("selectionUpdate",({editor:O})=>{i("changed:selection",{editor:O})})}),o.onUnmounted(()=>{var O;B==null||B.destroy(),(O=I.value)==null||O.destroy()}),Zu(Tu.SAVE,()=>{localStorage.setItem("content",j(B,"html"))});const J=(O,q)=>{const se=B;if(se){if(q){const ke=se.state.doc.nodeAt(+q),{[Ne.ELEMENT_ID]:Ze,...Fe}=(ke==null?void 0:ke.attrs)||{};se.view.dispatch(se.state.tr.setNodeMarkup(+q,void 0,{...Fe,[Ne.TEXT]:O}))}else{const{from:ke}=se.view.state.selection;se.commands.insertContentAt(ke,{type:"superText",attrs:{"data-id":ui(6),"data-text":O}})}se.commands.toggleSuperInputMoblie(),se.storage.superText.addToast({type:"success",message:"수퍼가 수정되었습니다"})}},te=O=>{var se;const q=I.value??B;if(q){const{from:ke}=q.view.state.selection;q.commands.insertContentAt(ke,{type:"configPlan",attrs:{"data-id":ui(6),"data-text":O}})}(se=I.value)==null||se.commands.toggleConfigPlanInput()};function we(O){O===Re.STRAIGHT&&B.commands.focus("end"),O===Re.EDITOR&&B.commands.focus("end")}const le=o.computed(()=>k.value&&r.mode===Re.STRAIGHT||k.value&&r.mode===Re.REPORT);o.onMounted(()=>{var O,q;r.autoFocus&&we(r.mode),(O=B==null?void 0:B.commands)!=null&&O.setIsMobile&&B.commands.setIsMobile(!0),k.value&&((q=B.storage.superText)!=null&&q.enable)&&B.commands.toggleSuperTextView()}),o.watch(()=>r.mode,O=>{r.autoFocus&&we(O)});const $e=(z=B.extensionManager.extensions.find(O=>O.name==="superText"))==null?void 0:z.options.bottomSheetComponent,Oe=o.computed(()=>{const O=r.mode===Re.REPORT,q=r.mode===Re.EDITOR&&r.isScreenSplit,se=!r.hideComment;return(O||q)&&se}),We=o.computed(()=>!Oe.value),{HEADER_ONLY_SIZE:X,pane1ContentVisible:N,pane2ContentVisible:ce,pane1Size:ue,pane2Size:me,togglePane:Se,handlePaneResize:ee}=tk(We);function Ce(){if(!r.contentAutoCopied)return;const O=v9(r.contentAutoCopied,".super-text");E(B,O)}const{isScrolling:He,handleScroll:Je}=Ol(),xt=o.ref(null);return e({editor:B}),(O,q)=>{var Wr,re,Be,Ue;const se=QE,ke=eh,Ze=Np,Fe=Qp,Q=Bf,ge=JE,de=aQ,ye=Ef,ze=eQ,it=Tt,St=wn,Kt=NZ;return o.openBlock(),o.createElementBlock(o.Fragment,null,[o.unref(I)?(o.openBlock(),o.createElementBlock("div",{key:0,id:"vdc-editor",style:o.normalizeStyle(o.unref(T)),class:o.normalizeClass(o.unref(xe)("vdc-editor mobile relative w-full flex flex-col",!r.height&&"flex-1",O.editorClass,O.disabled&&"disabled",O.mode!==o.unref(Re).EDITOR&&O.isShowLineNumber&&"editor-line",O.isEditorView&&"overflow-y-auto"))},[!O.hideBubble&&!O.disabled&&o.unref(k)?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createVNode(se,{editor:o.unref(B),mode:O.mode},null,8,["editor","mode"]),Y([o.unref(fc)])?(o.openBlock(),o.createBlock(ke,{key:0,editor:o.unref(B)},null,8,["editor"])):o.createCommentVNode("",!0),Y([o.unref(ua)])?(o.openBlock(),o.createBlock(Ze,{key:1,editor:o.unref(B)},null,8,["editor"])):o.createCommentVNode("",!0),Y([o.unref(cs)])?(o.openBlock(),o.createBlock(Fe,{key:2,editor:o.unref(B)},null,8,["editor"])):o.createCommentVNode("",!0),Y([o.unref(ds),o.unref(fs)])?(o.openBlock(),o.createBlock(Q,{key:3,editor:o.unref(B)},null,8,["editor"])):o.createCommentVNode("",!0)],64)):o.createCommentVNode("",!0),!O.hideToolbar&&!r.isEditorView?(o.openBlock(),o.createBlock(ge,{key:1,editor:o.unref(B),mode:O.mode,disabled:O.disabled,class:"mb-[3px]","custom-class-toolbar":O.customClassToolbar,"active-extensions":O.mode===o.unref(Re).EDITOR?[Sl]:void 0},null,8,["editor","mode","disabled","custom-class-toolbar","active-extensions"])):o.createCommentVNode("",!0),r.isEditorView?(o.openBlock(),o.createBlock(de,{key:2,"is-editor-view-split-content":r.isEditorViewSplitContent,extensions:O.extensions,mode:O.mode,"hide-comment":O.hideComment,"field-name-comment":O.fieldNameComment,"field-name-comment-cuesheet":O.fieldNameCommentCuesheet,"field-name-content":O.fieldNameContent,comment:O.comment,"comment-cuesheet":O.commentCuesheet,content:O.modelValue,"content-text-style":O.contentTextStyle},null,8,["is-editor-view-split-content","extensions","mode","hide-comment","field-name-comment","field-name-comment-cuesheet","field-name-content","comment","comment-cuesheet","content","content-text-style"])):(o.openBlock(),o.createBlock(o.unref(rh),{key:3,class:o.normalizeClass(o.unref(xe)("flex-1 basis-0")),horizontal:"",onResize:o.unref(ee)},{default:o.withCtx(()=>[o.unref(Oe)?(o.openBlock(),o.createBlock(o.unref(Wo),{key:0,size:o.unref(ue),"min-size":o.unref(X),class:"flex flex-col min-h-8"},{default:o.withCtx(()=>{var at,lt;return[(at=O.titleBarComment)!=null&&at.title?(o.openBlock(),o.createBlock(ek,{key:0,"title-bar":O.titleBarComment,class:"mb-[3px]"},null,8,["title-bar"])):o.createCommentVNode("",!0),(lt=O.fieldNameComment)!=null&<.label?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(o.unref(xe)("flex justify-between items-center py-1.5 mb-1 active:bg-ed-accent",!O.isAccordion&&"pointer-events-none")),onClick:q[0]||(q[0]=Gt=>o.unref(Se)("pane1"))},[o.createVNode(Cc,{"field-name":O.fieldNameComment},null,8,["field-name"]),O.isAccordion?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(o.unref(N)?o.unref(pg):o.unref(ec)),{key:0,class:"h-5 w-5"})):o.createCommentVNode("",!0)],2)):o.createCommentVNode("",!0),o.withDirectives(o.createElementVNode("div",{class:o.normalizeClass(o.unref(xe)("flex-1 !overflow-y-auto overflow-x-hidden basis-0 flex h-full flex-col",!o.unref(He)&&"scrollbar-thumb-transparent",O.contentClass,O.contentTextStyle)),onScroll:q[2]||(q[2]=(...Gt)=>o.unref(Je)&&o.unref(Je)(...Gt))},[o.createVNode(mQ,{ref:"editorCommentRef",mode:O.mode,extensions:O.extensions,"model-value":r.comment,disabled:r.disabled,"disable-super-input":O.disableSuperInput,"field-name-comment":O.fieldNameComment,"is-show-format-control-bar":O.isShowFormatControlBar,"auto-focus":O.autoFocus,"onUpdate:modelValue":q[1]||(q[1]=Gt=>i("update:comment",Gt)),onSetEditorSelected:V},null,8,["mode","extensions","model-value","disabled","disable-super-input","field-name-comment","is-show-format-control-bar","auto-focus"]),o.unref(H)?(o.openBlock(),o.createElementBlock("div",{key:0,ref_key:"formatToolbarTargetRef",ref:xt,class:o.normalizeClass(o.unref(xe)("sticky bottom-0 z-[12] min-h-[58px]",o.unref(U)&&"fixed inset-x-2.5",o.unref(ce)&&"hidden"))},null,2)):o.createCommentVNode("",!0)],34),[[o.vShow,o.unref(N)]])]}),_:1},8,["size","min-size"])):o.createCommentVNode("",!0),o.createVNode(o.unref(Wo),{size:o.unref(me),"min-size":o.unref(X),class:o.normalizeClass(o.unref(xe)("flex flex-col min-h-8")),style:{overflow:"unset"}},{default:o.withCtx(()=>{var at,lt,Gt;return[(at=O.titleBarContent)!=null&&at.title?(o.openBlock(),o.createBlock(ek,{key:0,"title-bar":O.titleBarContent,class:"mb-[3px]"},null,8,["title-bar"])):o.createCommentVNode("",!0),o.createElementVNode("div",gQ,[(lt=O.fieldNameContent)!=null&<.label?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(o.unref(xe)("flex justify-between items-center py-1.5 mb-1 active:bg-ed-accent flex-1",!O.isAccordion&&"pointer-events-none")),onClick:q[3]||(q[3]=Un=>o.unref(Se)("pane2"))},[o.createVNode(Cc,{"field-name":O.fieldNameContent},null,8,["field-name"]),O.isAccordion?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(o.unref(ce)?o.unref(pg):o.unref(ec)),{key:0,class:"h-5 w-5"})):o.createCommentVNode("",!0)],2)):o.createCommentVNode("",!0),o.unref(le)?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(o.unref(xe)("flex items-center gap-x-2 absolute right-9 top-1.5 z-10",!O.isAccordion&&"right-0",!((Gt=O.fieldNameContent)!=null&&Gt.label)&&"static ml-auto"))},[o.createVNode(ye,{for:"superView",class:"body-medium"},{default:o.withCtx(()=>q[7]||(q[7]=[o.createTextVNode("수퍼")])),_:1}),o.createVNode(ze,{id:"superView",checked:o.unref(B).storage.superText.enable,class:"w-8 h-5 data-[state=checked]:bg-blue-500","custom-class-thumb":"w-4 h-4 data-[state=checked]:translate-x-3","onUpdate:checked":q[4]||(q[4]=Un=>o.unref(B).commands.toggleSuperTextView())},null,8,["checked"])],2)):o.createCommentVNode("",!0),O.contentAutoCopied?(o.openBlock(),o.createBlock(St,{key:2,disabled:o.unref(Rp)(O.contentAutoCopied),variant:"ghost",class:"w-fit h-fit p-0 gap-x-1 label-large text-blue-500",onClick:Ce},{default:o.withCtx(()=>[o.createVNode(it,{name:"autoCopy",class:"size-5"}),q[8]||(q[8]=o.createTextVNode("자동복사"))]),_:1},8,["disabled"])):o.createCommentVNode("",!0)]),o.withDirectives(o.createElementVNode("div",{class:o.normalizeClass(o.unref(xe)("flex-1 basis-0 flex flex-col relative",O.contentClass,O.contentTextStyle))},[o.createVNode(o.unref(Xn),{id:"editor-panel",editor:o.unref(B),class:o.normalizeClass(["flex-1 flex-col relative break-all",O.mode===o.unref(Re).PLAIN_TEXT&&"plain-text"])},null,8,["editor","class"])],2),[[o.vShow,o.unref(ce)]]),o.unref(H)?(o.openBlock(),o.createBlock(o.Teleport,{key:1,to:o.unref(xt),disabled:o.unref(ce)},[o.createElementVNode("div",{class:o.normalizeClass(o.unref(xe)("sticky pb-3.5 mx-1 bottom-0 z-[12] inset-x-0 min-h-11 box-content invisible pointer-events-none",o.unref(F)&&"visible pointer-events-auto",O.customClassFormatControlBar))},[o.unref(I)?(o.openBlock(),o.createBlock(Kt,{key:0,editor:o.unref(I),mode:O.mode,disabled:!o.unref(k)||O.disabled,class:"absolute inset-x-0"},null,8,["editor","mode","disabled"])):o.createCommentVNode("",!0)],2)],8,["to","disabled"])):o.createCommentVNode("",!0),o.createElementVNode("div",{ref_key:"footerTargetRef",ref:w,id:"vdc-editor-footer-target"},null,512)]}),_:1},8,["size","min-size","class"])]),_:1},8,["class","onResize"]))],6)):o.createCommentVNode("",!0),(Wr=o.unref(B))!=null&&Wr.storage.superText&&o.unref($e)?(o.openBlock(),o.createBlock(hQ,{key:1,open:o.unref(D),editor:o.unref(B),"bottom-sheet-component":o.unref($e),onClose:q[5]||(q[5]=at=>o.unref(B).commands.toggleSuperInputMoblie()),onSave:J},null,8,["open","editor","bottom-sheet-component"])):o.createCommentVNode("",!0),(re=o.unref(I))!=null&&re.storage.configPlan?(o.openBlock(),o.createBlock(k5,{key:2,open:(Be=o.unref(I))==null?void 0:Be.storage.configPlan.isShowConfigPlanInput,"is-view-mode":!((Ue=o.unref(I))!=null&&Ue.storage.configPlan.isShowConfigPlanInput),editor:o.unref(I),title:O.$t("editor.configPlan"),onClose:q[6]||(q[6]=at=>o.unref(I).commands.toggleConfigPlanInput()),onSave:te},null,8,["open","is-view-mode","editor","title"])):o.createCommentVNode("",!0)],64)}}}),bQ=o.defineComponent({__name:"ArticleEditor",props:{mode:{default:Re.STRAIGHT},isMobile:{type:Boolean},superTextArea:{},modelValue:{},comment:{},commentCuesheet:{},hideComment:{type:Boolean},disableSuperInput:{type:Boolean},fontSizeDefault:{},fontFamilyDefault:{},contentTextStyle:{},isOpenSuperView:{type:Boolean},output:{},dark:{type:Boolean},disabled:{type:Boolean},hideToolbar:{type:Boolean},isShowFormatControlBar:{type:Boolean},customClassFormatControlBar:{},titleBarComment:{},titleBarContent:{},fieldNameComment:{},fieldNameCommentCuesheet:{},fieldNameContent:{},fieldNameSuper:{},isScreenSplit:{},isShowLineNumber:{type:Boolean},hideMenubar:{type:Boolean},disableBubble:{type:Boolean},hideBubble:{type:Boolean},maxWidth:{},minHeight:{},maxHeight:{},height:{},extensions:{},editorClass:{},contentClass:{},isCompare:{type:Boolean},autoHeight:{type:Boolean},textAlert:{},customClassToolbar:{},readonly:{type:Boolean},canEditSuperReadOnly:{type:Boolean},autoFocus:{type:Boolean,default:!0},superPreviewCustomClass:{},minChar:{},isAccordion:{type:Boolean},contentAutoCopied:{},isEditorView:{type:Boolean},isEditorViewSplitContent:{type:Boolean},editorContentInstance:{}},setup(t){const e=t,n=Cn();return o.onMounted(()=>{n.setTextAlert(e.textAlert||"")}),(r,i)=>e.isMobile?(o.openBlock(),o.createBlock(xc,o.mergeProps({key:1},e,{"onUpdate:modelValue":i[2]||(i[2]=s=>r.$emit("update:modelValue",s)),"onUpdate:comment":i[3]||(i[3]=s=>r.$emit("update:comment",s))}),null,16)):(o.openBlock(),o.createBlock(nh,o.mergeProps({key:0},e,{"onUpdate:modelValue":i[0]||(i[0]=s=>r.$emit("update:modelValue",s)),"onUpdate:comment":i[1]||(i[1]=s=>r.$emit("update:comment",s))}),null,16))}}),vQ=o.defineComponent({__name:"DigitalNewsEditor",props:{mode:{default:Re.EDITOR},isMobile:{type:Boolean},superTextArea:{},modelValue:{},comment:{},commentCuesheet:{},hideComment:{type:Boolean},disableSuperInput:{type:Boolean},fontSizeDefault:{},fontFamilyDefault:{},contentTextStyle:{},isOpenSuperView:{type:Boolean},output:{},dark:{type:Boolean},disabled:{type:Boolean},hideToolbar:{type:Boolean},isShowFormatControlBar:{type:Boolean},customClassFormatControlBar:{},titleBarComment:{},titleBarContent:{},fieldNameComment:{},fieldNameCommentCuesheet:{},fieldNameContent:{},fieldNameSuper:{},isScreenSplit:{},isShowLineNumber:{type:Boolean},hideMenubar:{type:Boolean},disableBubble:{type:Boolean},hideBubble:{type:Boolean},maxWidth:{},minHeight:{},maxHeight:{},height:{},extensions:{},editorClass:{},contentClass:{},isCompare:{type:Boolean},autoHeight:{type:Boolean},textAlert:{},customClassToolbar:{},readonly:{type:Boolean},canEditSuperReadOnly:{type:Boolean},autoFocus:{type:Boolean,default:!0},superPreviewCustomClass:{},minChar:{},isAccordion:{type:Boolean},contentAutoCopied:{},isEditorView:{type:Boolean},isEditorViewSplitContent:{type:Boolean},editorContentInstance:{}},setup(t){const e=t;return(n,r)=>{const i=nh,s=xc;return e.isMobile?(o.openBlock(),o.createBlock(s,o.mergeProps({key:1},e,{"onUpdate:modelValue":r[1]||(r[1]=a=>n.$emit("update:modelValue",a)),"onUpdate:comment":r[2]||(r[2]=a=>n.$emit("update:comment",a))}),null,16)):(o.openBlock(),o.createBlock(i,o.mergeProps({key:0},e,{"onUpdate:modelValue":r[0]||(r[0]=a=>n.$emit("update:modelValue",a))}),null,16))}}});var nk={exports:{}};(function(t){(function(){function e(H){return H===">"}function n(H){return H==="<"}function r(H){return/^\s+$/.test(H)}function i(H){var V=H.match(/^\s*<([^!>][^>]*)>\s*$/);return!!V&&V[1].trim().split(" ")[0]}function s(H){return!i(H)}function a(H){return/^<!--/.test(H)}function l(H){return/--\>$/.test(H)}var u,c=new RegExp("^<(iframe|object|math|svg|script|video|head|style|a)");function f(H){var V=u.exec(H);return V&&V[1]}function p(H,V){return H.substring(H.length-V.length-2)==="</"+V}function m(H){return/^\s*<[^>]+\/>\s*$/.test(H)}function g(H){var V=/^<img[\s>]/.test(H);return V||s(H)||f(H)||m(H)}function b(H){return{string:H,key:C(H)}}function v(H,V,D,j){this.segment=j,this.length=D,this.startInBefore=H+j.beforeIndex,this.startInAfter=V+j.afterIndex,this.endInBefore=this.startInBefore+this.length-1,this.endInAfter=this.startInAfter+this.length-1,this.segmentStartInBefore=H,this.segmentStartInAfter=V,this.segmentEndInBefore=this.segmentStartInBefore+this.length-1,this.segmentEndInAfter=this.segmentStartInAfter+this.length-1}function w(H){for(var V="char",D="",j="",Y=[],J=0;J<H.length;J++){var te=H[J];switch(V){case"tag":var we=f(D);we?(V="atomic_tag",j=we,D+=te):a(D)?(V="html_comment",D+=te):e(te)?(D+=">",Y.push(b(D)),D="",r(te)?V="whitespace":V="char"):D+=te;break;case"atomic_tag":e(te)&&p(D,j)?(D+=">",Y.push(b(D)),D="",j="",V="char"):D+=te;break;case"html_comment":D+=te,l(D)&&(D="",V="char");break;case"char":n(te)?(D&&Y.push(b(D)),D="<",V="tag"):/\s/.test(te)?(D&&Y.push(b(D)),D=te,V="whitespace"):/[\w\d\#@]/.test(te)?D+=te:/&/.test(te)?(D&&Y.push(b(D)),D=te):(D+=te,Y.push(b(D)),D="");break;case"whitespace":n(te)?(D&&Y.push(b(D)),D="<",V="tag"):r(te)?D+=te:(D&&Y.push(b(D)),D=te,V="char");break;default:throw new Error("Unknown mode "+V)}}return D&&Y.push(b(D)),Y}function C(H){var V=/^<img.*src=['"]([^"']*)['"].*>$/.exec(H);if(V)return'<img src="'+V[1]+'">';var D=/^<a.*href=['"]([^"']*)['"]/.exec(H);if(D)return'<a href="'+D[1]+'"></a>';var j=/^<object.*data=['"]([^"']*)['"]/.exec(H);if(j)return'<object src="'+j[1]+'"></object>';if(/^<(svg|math|video)[\s>]/.test(H)){var Y=H.indexOf('data-uuid="');if(Y!==-1){var J=H.slice(0,Y),te=H.slice(Y+44);return J+te}else return H}var we=/^<iframe.*src=['"]([^"']*)['"].*>/.exec(H);if(we)return'<iframe src="'+we[1]+'"></iframe>';var le=/<([^\s>]+)[\s>]/.exec(H);return le?"<"+le[1].toLowerCase()+">":H&&H.replace(/(\s+| | )/g," ")}function E(H){return H.reduce(function(V,D,j){return V[D.key]?V[D.key].push(j):V[D.key]=[j],V},Object.create(null))}function k(H,V){return V.endInBefore<H.startInBefore&&V.endInAfter<H.startInAfter?-1:V.startInBefore>H.endInBefore&&V.startInAfter>H.endInAfter?1:0}function x(){this._root=null}x.prototype={add:function(H){var V={value:H,left:null,right:null},D=this._root;if(D)for(;;){var j=k(D.value,H);if(j===-1)if(D.left)D=D.left;else{D.left=V;break}else if(j===1)if(D.right)D=D.right;else{D.right=V;break}else break}else this._root=V},toArray:function(){function H(V,D){return V&&(H(V.left,D),D.push(V.value),H(V.right,D)),D}return H(this._root,[])}};function _(H){for(var V=H.beforeTokens,D=H.afterMap,j=null,Y=null,J=0;J<V.length;J++){var te=!1,we=V.length-J;if(Y&&we<Y.length)break;var le=V[J];if(le.key===" "){j=J;continue}j===J-1&&(te=!0);var $e=D[le.key];$e&&$e.forEach(function(Oe){var We=Y?Y.length:0,X=A(H,J,Oe,We,te);X&&X.length>We&&(Y=X)})}return Y}function A(H,V,D,j,Y){var J=H.beforeTokens,te=H.afterTokens,we=V+j,le=D+j;if(!(we>=J.length||le>=te.length)){if(j){var $e=J[we].key,Oe=te[le].key;if($e!==Oe)return}for(var We=!0,X=1,N=V+X,ce=D+X;We&&N<J.length&&ce<te.length;){var ue=J[N].key,me=te[ce].key;ue===me?(X++,N=V+X,ce=D+X):We=!1}if(Y&&V>0&&D>0){var Se=J[V-1].key,ee=te[D-1].key;Se===" "&&ee===" "&&(V--,D--,X++)}return new v(V,D,X,H)}}function T(H,V,D,j){return{beforeTokens:H,afterTokens:V,beforeMap:E(H),afterMap:E(V),beforeIndex:D,afterIndex:j}}function B(H){for(var V=new x,D,j=[H];j.length;)if(H=j.pop(),D=_(H),D&&D.length){if(D.segmentStartInBefore>0&&D.segmentStartInAfter>0){var Y=H.beforeTokens.slice(0,D.segmentStartInBefore),J=H.afterTokens.slice(0,D.segmentStartInAfter);j.push(T(Y,J,H.beforeIndex,H.afterIndex))}var te=H.beforeTokens.slice(D.segmentEndInBefore+1),we=H.afterTokens.slice(D.segmentEndInAfter+1),le=H.beforeIndex+D.segmentEndInBefore+1,$e=H.afterIndex+D.segmentEndInAfter+1;te.length&&we.length&&j.push(T(te,we,le,$e)),V.add(D)}return V.toArray()}function L(H,V){if(!H)throw new Error("Missing beforeTokens");if(!V)throw new Error("Missing afterTokens");var D=0,j=0,Y=[],J=T(H,V,0,0),te=B(J);te.push(new v(H.length,V.length,0,J));for(var we=0;we<te.length;we++){var le=te[we],$e="none";D===le.startInBefore?j!==le.startInAfter&&($e="insert"):($e="delete",j!==le.startInAfter&&($e="replace")),$e!=="none"&&Y.push({action:$e,startInBefore:D,endInBefore:$e!=="insert"?le.startInBefore-1:null,startInAfter:j,endInAfter:$e!=="delete"?le.startInAfter-1:null}),le.length!==0&&Y.push({action:"equal",startInBefore:le.startInBefore,endInBefore:le.endInBefore,startInAfter:le.startInAfter,endInAfter:le.endInAfter}),D=le.endInBefore+1,j=le.endInAfter+1}var Oe=[],We={action:"none"};function X(ue){return ue.action!=="equal"||ue.endInBefore-ue.startInBefore!==0?!1:/^\s$/.test(H.slice(ue.startInBefore,ue.endInBefore+1))}for(var N=0;N<Y.length;N++){var ce=Y[N];X(ce)&&We.action==="replace"||ce.action==="replace"&&We.action==="replace"?(We.endInBefore=ce.endInBefore,We.endInAfter=ce.endInAfter):(Oe.push(ce),We=ce)}return Oe}function I(H){this.tokens=H,this.notes=H.reduce(function(V,D,j){V.notes.push({isWrappable:g(D),insertedTag:!1});var Y=!m(D)&&i(D),J=V.tagStack[V.tagStack.length-1];return Y&&(J&&"/"+J.tag===Y?(V.notes[J.position].insertedTag=!0,V.tagStack.pop()):V.tagStack.push({tag:Y,position:j})),V},{notes:[],tagStack:[]}).notes}I.prototype.combine=function(H,V){var D=this.notes,j=this.tokens.slice(),Y=j.reduce(function(J,te,we){D[we].insertedTag&&(j[we]=V(j[we])),J.status===null&&(J.status=D[we].isWrappable);var le=D[we].isWrappable;return le!==J.status&&(J.list.push({isWrappable:J.status,tokens:j.slice(J.lastIndex,we)}),J.lastIndex=we,J.status=le),we===j.length-1&&J.list.push({isWrappable:J.status,tokens:j.slice(J.lastIndex,we+1)}),J},{list:[],status:null,lastIndex:0}).list;return Y.map(H).join("")};function F(H,V,D,j,Y){var J=new I(V);j=j?j+"-":"";var te=" data-"+j+'operation-index="'+D+'"';return Y&&(te+=' class="'+Y+'"'),J.combine(function(we){if(we.isWrappable){var le=we.tokens.join("");if(le.trim())return"<"+H+te+">"+le+"</"+H+">"}else return we.tokens.join("");return""},function(we){var le=' data-diff-node="'+H+'"';return le+=" data-"+j+'operation-index="'+D+'"',we.replace(/>\s*$/,le+"$&")})}var U={equal:function(H,V,D,j,Y,J){var te=D.slice(H.startInAfter,H.endInAfter+1);return te.reduce(function(we,le){return we+le.string},"")},insert:function(H,V,D,j,Y,J){var te=D.slice(H.startInAfter,H.endInAfter+1),we=te.map(function(le){return le.string});return F("ins",we,j,Y,J)},delete:function(H,V,D,j,Y,J){var te=V.slice(H.startInBefore,H.endInBefore+1),we=te.map(function(le){return le.string});return F("del",we,j,Y,J)},replace:function(){return U.delete.apply(null,arguments)+U.insert.apply(null,arguments)}};function ie(H,V,D,j,Y){return D.reduce(function(J,te,we){return J+U[te.action](te,H,V,we,j,Y)},"")}function oe(H,V,D,j,Y){if(H===V)return H;Y?u=new RegExp("^<("+Y.replace(/\s*/g,"").replace(/,/g,"|")+")"):u=c,H=w(H),V=w(V);var J=L(H,V);return ie(H,V,J,j,D)}oe.htmlToTokens=w,oe.findMatchingBlocks=B,B.findBestMatch=_,B.createMap=E,B.createToken=b,B.createSegment=T,B.getKeyForToken=C,oe.calculateOperations=L,oe.renderOperations=ie,t!==null?t.exports=oe:this.htmldiff=oe}).call(Ja)})(nk);var yQ=nk.exports;const wQ=GB(yQ),rk=(t,e,n)=>{let r="";{const i=hn(t,n),s=hn(e,n);r=wQ(i,s,null,null,"button")}return r=r.replace(/<del[^>]*>/g,'<span class="diff-del">').replace(/<\/del>/g,"</span>").replace(/<ins[^>]*>/g,'<mark style="background:#FEF3C7;">').replace(/<\/ins>/g,"</mark>"),r},CQ={key:0,class:"px-2 min-h-[24px] flex items-center justify-between gap-1 mb-1.5"},xQ={class:"flex items-center gap-2"},EQ={class:"body-small text-gray-600 px-[6px] py-[2px] shrink-0 rounded-[4px] bg-gray-100"},kQ={class:"label-large text-gray-800 line-clamp-1"},SQ={class:"flex items-center gap-1 shrink-0"},_Q={class:"mt-[2px]"},TQ={class:"body-small text-gray-400"},AQ={class:"border border-ed-gray rounded-[5px] p-2.5 my-2 h-full"},MQ={key:0,class:"px-2 min-h-[24px] flex items-center justify-between gap-1 mb-1.5"},OQ={class:"flex items-center gap-2"},BQ={class:"body-small text-blue-500 px-[6px] py-[2px] shrink-0 rounded-[4px] bg-blue-50"},IQ={class:"label-large text-gray-800 line-clamp-1"},RQ={class:"flex items-center gap-1 shrink-0"},LQ={class:"mt-[2px]"},PQ={class:"body-small text-gray-400"},DQ=Ao(o.defineComponent({__name:"ArticleCompareEditor",props:{originalData:{},changedData:{},extensions:{},editorClass:{},isCompare:{type:Boolean,default:!0},contentTextStyle:{default:"text-sm font-pretendard"}},setup(t){const e=t,n=o.computed(()=>[...e.extensions,NE]),r=o.ref(!1),i=o.computed(()=>!e.originalData||!e.changedData?{comment:"",content:""}:{comment:rk(e.originalData.comment,e.changedData.comment,!0),content:rk(e.originalData.content,e.changedData.content,!0)}),{HEADER_ONLY_SIZE:s,pane1ContentVisible:a,pane2ContentVisible:l,pane1Size:u,pane2Size:c,handlePaneResize:f}=tk(!1,6),{isScrolling:p,handleScroll:m}=Ol(),{isScrolling:g,handleScroll:b}=Ol();return(v,w)=>{const C=Tt;return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(xe)("h-full",v.editorClass))},[o.createVNode(o.unref(rh),{horizontal:"",onResize:o.unref(f)},{default:o.withCtx(()=>[o.createVNode(o.unref(Wo),{size:o.unref(u),"min-size":o.unref(s),class:"flex flex-col"},{default:o.withCtx(()=>{var E,k,x,_,A,T,B,L,I,F,U;return[(k=(E=v.originalData)==null?void 0:E.titleBar)!=null&&k.title?(o.openBlock(),o.createElementBlock("div",CQ,[o.createElementVNode("div",xQ,[o.createElementVNode("div",EQ,o.toDisplayString(v.$t("기준")),1),o.createElementVNode("h3",kQ,o.toDisplayString((_=(x=v.originalData)==null?void 0:x.titleBar)==null?void 0:_.title),1)]),o.createElementVNode("div",SQ,[o.createElementVNode("div",_Q,[o.createVNode(C,{name:"Clock",class:"w-[13px] h-[13px] text-gray-400"})]),o.createElementVNode("div",TQ,o.toDisplayString((T=(A=v.originalData)==null?void 0:A.titleBar)==null?void 0:T.time),1)])])):o.createCommentVNode("",!0),o.withDirectives(o.createElementVNode("div",{class:o.normalizeClass(o.unref(xe)("border border-gray-50 rounded-md py-[10px] px-4 flex-1 overflow-y-auto",!o.unref(p)&&"scrollbar-thumb-transparent")),onScroll:w[0]||(w[0]=(...ie)=>o.unref(m)&&o.unref(m)(...ie))},[o.createVNode(xc,{"editor-class":"h-full",mode:o.unref(Re).REPORT,disabled:"","hide-toolbar":"",extensions:o.unref(n),"field-name-comment":(B=v.originalData)==null?void 0:B.fieldNameComment,"field-name-content":(L=v.originalData)==null?void 0:L.fieldNameContent,comment:(I=v.originalData)==null?void 0:I.comment,"model-value":(F=v.originalData)==null?void 0:F.content,"hide-comment":(U=v.originalData)==null?void 0:U.hideComment,"is-compare":v.isCompare,"content-text-style":v.contentTextStyle},null,8,["mode","extensions","field-name-comment","field-name-content","comment","model-value","hide-comment","is-compare","content-text-style"])],34),[[o.vShow,o.unref(a)]])]}),_:1},8,["size","min-size"]),o.unref(r)?(o.openBlock(),o.createBlock(o.unref(Wo),{key:0},{default:o.withCtx(()=>{var E,k,x,_,A;return[o.createElementVNode("div",AQ,[o.createVNode(xc,{"editor-class":"h-full",mode:o.unref(Re).REPORT,disabled:"","hide-toolbar":"",extensions:o.unref(n),"field-name-comment":(E=v.changedData)==null?void 0:E.fieldNameComment,"field-name-content":(k=v.changedData)==null?void 0:k.fieldNameContent,comment:(x=v.changedData)==null?void 0:x.comment,"model-value":(_=v.changedData)==null?void 0:_.content,"hide-comment":(A=v.changedData)==null?void 0:A.hideComment,"is-compare":v.isCompare,"content-text-style":v.contentTextStyle},null,8,["mode","extensions","field-name-comment","field-name-content","comment","model-value","hide-comment","is-compare","content-text-style"])])]}),_:1})):o.createCommentVNode("",!0),o.createVNode(o.unref(Wo),{size:o.unref(c),"min-size":o.unref(s),class:"flex flex-col"},{default:o.withCtx(()=>{var E,k,x,_,A,T,B,L,I;return[(k=(E=v.changedData)==null?void 0:E.titleBar)!=null&&k.title?(o.openBlock(),o.createElementBlock("div",MQ,[o.createElementVNode("div",OQ,[o.createElementVNode("div",BQ,o.toDisplayString(v.$t("대상")),1),o.createElementVNode("h3",IQ,o.toDisplayString((_=(x=v.changedData)==null?void 0:x.titleBar)==null?void 0:_.title),1)]),o.createElementVNode("div",RQ,[o.createElementVNode("div",LQ,[o.createVNode(C,{name:"Clock",class:"w-[13px] h-[13px] text-gray-400"})]),o.createElementVNode("div",PQ,o.toDisplayString((T=(A=v.changedData)==null?void 0:A.titleBar)==null?void 0:T.time),1)])])):o.createCommentVNode("",!0),o.withDirectives(o.createElementVNode("div",{class:o.normalizeClass(o.unref(xe)("border border-gray-50 bg-dark-blue-600 rounded-md py-[10px] px-4 flex-1 overflow-y-auto",!o.unref(g)&&"scrollbar-thumb-transparent")),onScroll:w[1]||(w[1]=(...F)=>o.unref(b)&&o.unref(b)(...F))},[o.createVNode(xc,{"editor-class":"h-full",mode:o.unref(Re).REPORT,disabled:"","hide-toolbar":"",extensions:o.unref(n),"field-name-comment":(B=v.changedData)==null?void 0:B.fieldNameComment,"field-name-content":(L=v.changedData)==null?void 0:L.fieldNameContent,comment:o.unref(i).comment,"model-value":o.unref(i).content,"hide-comment":(I=v.changedData)==null?void 0:I.hideComment,"is-compare":v.isCompare,"content-text-style":v.contentTextStyle},null,8,["mode","extensions","field-name-comment","field-name-content","comment","model-value","hide-comment","is-compare","content-text-style"])],34),[[o.vShow,o.unref(l)]])]}),_:1},8,["size","min-size"])]),_:1},8,["onResize"])],2)}}}),[["__scopeId","data-v-6733022d"]]),VQ=o.defineComponent({__name:"SuperViewMobileSuperEditor",props:{isMobile:{type:Boolean},superTextArea:{},mode:{},modelValue:{default:""},comment:{},commentCuesheet:{},hideComment:{type:Boolean},disableSuperInput:{type:Boolean,default:!1},fontSizeDefault:{},fontFamilyDefault:{},contentTextStyle:{},isOpenSuperView:{type:Boolean},output:{default:"html"},dark:{type:Boolean,default:void 0},disabled:{type:Boolean},hideToolbar:{type:Boolean,default:!1},isShowFormatControlBar:{type:Boolean},customClassFormatControlBar:{},titleBarComment:{},titleBarContent:{},fieldNameComment:{},fieldNameCommentCuesheet:{},fieldNameContent:{},fieldNameSuper:{default:null},isScreenSplit:{},isShowLineNumber:{type:Boolean},hideMenubar:{type:Boolean},disableBubble:{type:Boolean,default:!1},hideBubble:{type:Boolean,default:!1},maxWidth:{default:void 0},minHeight:{default:600},maxHeight:{default:void 0},height:{},extensions:{default:()=>[]},editorClass:{},contentClass:{},isCompare:{type:Boolean},autoHeight:{type:Boolean},textAlert:{},customClassToolbar:{},readonly:{type:Boolean},canEditSuperReadOnly:{type:Boolean},autoFocus:{type:Boolean},superPreviewCustomClass:{},minChar:{},isAccordion:{type:Boolean},contentAutoCopied:{},isEditorView:{type:Boolean},isEditorViewSplitContent:{type:Boolean},editorContentInstance:{}},emits:["enter","change","update:modelValue","update:comment","onFocusEditor","changed:selection","setEditorSelected","onBlurEditor","lineFocus","onFocus","onBlur"],setup(t,{expose:e,emit:n}){const r=t,i=n;o.computed(()=>r.mode===Re.EDITOR);const s=ct.useEventBus(ar.RENDER_SUPER_TEXT),a=Cn(),{isReady:l,editor:u,updateEditorState:c,checkSpellStore:f}=a,p=o.ref(!1);o.provide("isEditable",p);const m=o.ref(m6(r.modelValue));function g(x){if(r.disabled||r.readonly)return;const _=sE(x);i("lineFocus",{lineIndex:_})}function b(){i("lineFocus",{lineIndex:void 0})}const v=new So({enablePasteRules:!1,enableInputRules:!1,content:m.value,onCreate:({editor:x})=>{c(x)},onUpdate:nt.throttle(({editor:x})=>{l.value=!0;const _=k(x,r.output);i("update:modelValue",_),i("change",{editor:x,output:_}),c(x)},To),extensions:nt.uniqBy(nt.reverse(o.unref(r.extensions)),"name"),editable:p.value,onFocus:()=>{C(),w.value=!0,g(v)},onBlur:()=>{w.value=!1,b()},onSelectionUpdate:()=>{g(v)}}),w=o.ref(!1);function C(){i("setEditorSelected",v)}function E(){s.emit({action:"render"})}function k(x,_){if(!x)return"";if(x.isEmpty)return _==="json"?{}:"";switch(_){case"html":return x.getHTML();case"json":return x.getJSON();case"text":return x.getText();default:return""}}return o.watch(()=>f.languages,()=>{v.commands.checkSpelling()}),o.watch(()=>r.modelValue,x=>{if(!v||nt.isEqual(k(v,r.output),x))return;const{from:_,to:A}=v.state.selection;v.commands.setTextSelection({from:_,to:A}),E(),m.value=m6(x)},{deep:!0}),o.watch(()=>u.value,()=>{u.value&&u.value.on("selectionUpdate",({editor:x})=>{i("changed:selection",{editor:x})})}),o.watch(()=>r.disableSuperInput,()=>{const x=document.getElementById(or.COMMENT);x==null||x.setAttribute(or.DISABLE_SUPER_INPUT,`${r.disableSuperInput}`)}),o.onUnmounted(()=>v==null?void 0:v.destroy()),th(v),o.onMounted(()=>{var x,_;(x=v==null?void 0:v.commands)!=null&&x.setIsEnableSuggestion&&v.commands.setIsEnableSuggestion(!1),(_=v==null?void 0:v.commands)!=null&&_.setIsMobile&&v.commands.setIsMobile(!0)}),e({editor:v}),(x,_)=>{var T;const A=Cc;return o.openBlock(),o.createElementBlock(o.Fragment,null,[(T=x.fieldNameSuper)!=null&&T.label?(o.openBlock(),o.createBlock(A,{key:0,"field-name":x.fieldNameSuper,mode:x.mode,disabled:x.disabled,class:"mb-1",intent:"secondary"},null,8,["field-name","mode","disabled"])):o.createCommentVNode("",!0),o.createVNode(o.unref(Xn),{editor:o.unref(v),spellcheck:"true",class:o.normalizeClass(["flex-1 flex-col"])},null,8,["editor"])],64)}}}),FQ=(t,e)=>{let n=null;return t.state.doc.descendants((r,i)=>{if(r.type.name==="paragraph"&&Number(r.attrs["number-line"])===e)return n={node:r,pos:i},!1}),n},ok="focused-line";async function ik({lineIndex:t,editor:e}){if(e.state.doc.descendants((l,u)=>{if(l.attrs.class===ok){const c=e.state.tr.setNodeMarkup(u,void 0,{...l.attrs,class:""});return e.view.dispatch(c),!1}}),await o.nextTick(),!t)return;const n=FQ(e,t);if(!n)return;const{node:r,pos:i}=n,s=e.state.tr.setNodeMarkup(i,void 0,{...r.attrs,class:ok});e.view.dispatch(s),await o.nextTick(),e.view.nodeDOM(i).scrollIntoView({behavior:"smooth"})}const $Q=o.defineComponent({__name:"SuperViewMobileEditor",props:{isMobile:{type:Boolean},superTextArea:{},mode:{},modelValue:{default:""},comment:{default:""},commentCuesheet:{},hideComment:{type:Boolean},disableSuperInput:{type:Boolean},fontSizeDefault:{default:"12px"},fontFamilyDefault:{default:""},contentTextStyle:{},isOpenSuperView:{type:Boolean},output:{default:"html"},dark:{type:Boolean},disabled:{type:Boolean,default:!1},hideToolbar:{type:Boolean,default:!1},isShowFormatControlBar:{type:Boolean},customClassFormatControlBar:{},titleBarComment:{},titleBarContent:{},fieldNameComment:{},fieldNameCommentCuesheet:{},fieldNameContent:{default:null},fieldNameSuper:{default:null},isScreenSplit:{},isShowLineNumber:{type:Boolean},hideMenubar:{type:Boolean},disableBubble:{type:Boolean},hideBubble:{type:Boolean,default:!1},maxWidth:{default:void 0},minHeight:{default:200},maxHeight:{default:void 0},height:{default:void 0},extensions:{default:()=>[]},editorClass:{default:void 0},contentClass:{default:void 0},isCompare:{type:Boolean},autoHeight:{type:Boolean},textAlert:{},customClassToolbar:{default:""},readonly:{type:Boolean,default:!1},canEditSuperReadOnly:{type:Boolean},autoFocus:{type:Boolean},superPreviewCustomClass:{},minChar:{},isAccordion:{type:Boolean},contentAutoCopied:{},isEditorView:{type:Boolean},isEditorViewSplitContent:{type:Boolean},editorContentInstance:{}},emits:["enter","change","update:modelValue","update:comment","onFocusEditor","changed:selection","setEditorSelected","onBlurEditor","lineFocus","onFocus","onBlur"],setup(t,{expose:e,emit:n}){const r=t,i=n;o.provide("isMobile",!0),o.computed(()=>r.mode===Re.EDITOR);const s=ct.useEventBus(ar.INCREASE_DECREASE_FONTSIZE);o.useAttrs();const a=Cn(),{state:l,isFullscreen:u,isReady:c,editor:f,updateEditorState:p,checkSpellStore:m}=a,g=o.ref(!1);o.provide("isEditable",g);const b=o.ref(void 0),v=o.ref(),w=o.computed(()=>[...l.extensions,...nt.differenceBy(r.extensions,l.extensions,"name")].map((V,D)=>V.configure({sort:D}))),C=o.ref(r.fontSizeDefault),E=o.ref(r.fontFamilyDefault);o.provide("fontSize",C),o.provide("fontFamily",E);const k=o.computed(()=>({fontFamily:E.value,fontSize:C.value})),x=o.ref(),_=V=>{const D=parseInt(C.value||"12px"),j=V?D+2:D-2;C.value=j+"px"};o.onBeforeMount(()=>{s.on(_)}),o.onBeforeUnmount(()=>{s.off(_)});const A=o.computed(()=>({...o.unref(u)?{height:"100%"}:{minHeight:r.minHeight?ln(r.minHeight):void 0,maxHeight:r.maxHeight?ln(r.maxHeight):void 0,height:r.height?ln(r.height):void 0},maxWidth:ln(r.maxWidth),width:r.maxWidth?"100%":void 0,margin:r.maxWidth?"0 auto":void 0}));function T(V){if(r.disabled||r.readonly)return;const D=sE(V);b.value=D}function B(){b.value=void 0}const L=new So({enablePasteRules:!1,enableInputRules:!1,content:hn(r.modelValue,r.disabled,r.mode),onCreate:({editor:V})=>{p(V)},onUpdate:nt.throttle(({editor:V})=>{c.value=!0;const D=oe(V,r.output);i("update:modelValue",D),i("change",{editor:V,output:D}),p(V)},To),extensions:nt.uniqBy(nt.reverse(o.unref(w)),"name"),editable:g.value,onFocus:()=>{ie(),I.value=!0,T(L)},onBlur:()=>{I.value=!1,B()},onSelectionUpdate:()=>{T(L)}}),I=o.ref(!1),F=o.ref();o.onMounted(()=>{F.value=L});const U=({lineIndex:V})=>{var j;L&&ik({lineIndex:V,editor:L});const D=(j=v.value)==null?void 0:j.editor;D&&ik({lineIndex:V,editor:D})};o.watch(()=>b.value,V=>{i("lineFocus",{lineIndex:V}),U({lineIndex:V})},{immediate:!0});function ie(V){F.value=L}function oe(V,D){if(!V)return"";if(V.isEmpty)return D==="json"?{}:"";switch(D){case"html":return V.getHTML();case"json":return V.getJSON();case"text":return V.getText({blockSeparator:`
|
|
344
|
+
`});default:return""}}function Y(O){return O.every(q=>B==null?void 0:B.extensionManager.extensions.find(se=>se.name===q))}o.watch(()=>g.languages,()=>{B.commands.checkSpelling()}),o.watch(()=>r.modelValue,O=>{if(!B||nt.isEqual(j(B,r.output),O))return;const{from:q,to:se}=B.state.selection;B.commands.setTextSelection({from:q,to:se}),B.commands.setContent(hn(O,r.disabled,r.mode),!1,{preserveWhitespace:"full"})},{deep:!0}),o.watch([()=>r.disabled,()=>r.readonly],()=>{k.value=!r.disabled&&!r.readonly},{immediate:!0}),o.watch(()=>k.value,O=>{var q;B==null||B.setEditable(O),(q=B==null?void 0:B.commands)!=null&&q.setIsEnableSuggestion&&B.commands.setIsEnableSuggestion(O)},{immediate:!0}),o.watch(()=>p.value,()=>{p.value&&p.value.on("selectionUpdate",({editor:O})=>{i("changed:selection",{editor:O})})}),o.onUnmounted(()=>{var O;B==null||B.destroy(),(O=I.value)==null||O.destroy()}),Zu(Tu.SAVE,()=>{localStorage.setItem("content",j(B,"html"))});const J=(O,q)=>{const se=B;if(se){if(q){const ke=se.state.doc.nodeAt(+q),{[Ne.ELEMENT_ID]:Ze,...Fe}=(ke==null?void 0:ke.attrs)||{};se.view.dispatch(se.state.tr.setNodeMarkup(+q,void 0,{...Fe,[Ne.TEXT]:O}))}else{const{from:ke}=se.view.state.selection;se.commands.insertContentAt(ke,{type:"superText",attrs:{"data-id":ui(6),"data-text":O}})}se.commands.toggleSuperInputMoblie(),se.storage.superText.addToast({type:"success",message:"수퍼가 수정되었습니다"})}},te=O=>{var se;const q=I.value??B;if(q){const{from:ke}=q.view.state.selection;q.commands.insertContentAt(ke,{type:"configPlan",attrs:{"data-id":ui(6),"data-text":O}})}(se=I.value)==null||se.commands.toggleConfigPlanInput()};function we(O){O===Re.STRAIGHT&&B.commands.focus("end"),O===Re.EDITOR&&B.commands.focus("end")}const le=o.computed(()=>k.value&&r.mode===Re.STRAIGHT||k.value&&r.mode===Re.REPORT);o.onMounted(()=>{var O,q;r.autoFocus&&we(r.mode),(O=B==null?void 0:B.commands)!=null&&O.setIsMobile&&B.commands.setIsMobile(!0),k.value&&((q=B.storage.superText)!=null&&q.enable)&&B.commands.toggleSuperTextView()}),o.watch(()=>r.mode,O=>{r.autoFocus&&we(O)});const $e=(z=B.extensionManager.extensions.find(O=>O.name==="superText"))==null?void 0:z.options.bottomSheetComponent,Oe=o.computed(()=>{const O=r.mode===Re.REPORT,q=r.mode===Re.EDITOR&&r.isScreenSplit,se=!r.hideComment;return(O||q)&&se}),We=o.computed(()=>!Oe.value),{HEADER_ONLY_SIZE:X,pane1ContentVisible:N,pane2ContentVisible:ce,pane1Size:ue,pane2Size:me,togglePane:Se,handlePaneResize:ee}=tk(We);function Ce(){if(!r.contentAutoCopied)return;const O=v9(r.contentAutoCopied,".super-text");E(B,O)}const{isScrolling:He,handleScroll:Je}=Ol(),xt=o.ref(null);return e({editor:B}),(O,q)=>{var Wr,re,Be,Ue;const se=QE,ke=eh,Ze=Np,Fe=Qp,Q=Bf,ge=JE,de=aQ,ye=Ef,ze=eQ,it=Tt,St=wn,Kt=NZ;return o.openBlock(),o.createElementBlock(o.Fragment,null,[o.unref(I)?(o.openBlock(),o.createElementBlock("div",{key:0,id:"vdc-editor",style:o.normalizeStyle(o.unref(T)),class:o.normalizeClass(o.unref(xe)("vdc-editor mobile relative w-full flex flex-col",!r.height&&"flex-1",O.editorClass,O.disabled&&"disabled",O.mode!==o.unref(Re).EDITOR&&O.isShowLineNumber&&"editor-line",O.isEditorView&&"overflow-y-auto"))},[!O.hideBubble&&!O.disabled&&o.unref(k)?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createVNode(se,{editor:o.unref(B),mode:O.mode},null,8,["editor","mode"]),Y([o.unref(fc)])?(o.openBlock(),o.createBlock(ke,{key:0,editor:o.unref(B)},null,8,["editor"])):o.createCommentVNode("",!0),Y([o.unref(ua)])?(o.openBlock(),o.createBlock(Ze,{key:1,editor:o.unref(B)},null,8,["editor"])):o.createCommentVNode("",!0),Y([o.unref(cs)])?(o.openBlock(),o.createBlock(Fe,{key:2,editor:o.unref(B)},null,8,["editor"])):o.createCommentVNode("",!0),Y([o.unref(ds),o.unref(fs)])?(o.openBlock(),o.createBlock(Q,{key:3,editor:o.unref(B)},null,8,["editor"])):o.createCommentVNode("",!0)],64)):o.createCommentVNode("",!0),!O.hideToolbar&&!r.isEditorView?(o.openBlock(),o.createBlock(ge,{key:1,editor:o.unref(B),mode:O.mode,disabled:O.disabled,class:"mb-[3px]","custom-class-toolbar":O.customClassToolbar,"active-extensions":O.mode===o.unref(Re).EDITOR?[Sl]:void 0},null,8,["editor","mode","disabled","custom-class-toolbar","active-extensions"])):o.createCommentVNode("",!0),r.isEditorView?(o.openBlock(),o.createBlock(de,{key:2,"is-editor-view-split-content":r.isEditorViewSplitContent,extensions:O.extensions,mode:O.mode,"hide-comment":O.hideComment,"field-name-comment":O.fieldNameComment,"field-name-comment-cuesheet":O.fieldNameCommentCuesheet,"field-name-content":O.fieldNameContent,comment:O.comment,"comment-cuesheet":O.commentCuesheet,content:O.modelValue,"content-text-style":O.contentTextStyle},null,8,["is-editor-view-split-content","extensions","mode","hide-comment","field-name-comment","field-name-comment-cuesheet","field-name-content","comment","comment-cuesheet","content","content-text-style"])):(o.openBlock(),o.createBlock(o.unref(rh),{key:3,class:o.normalizeClass(o.unref(xe)("flex-1 basis-0")),horizontal:"",onResize:o.unref(ee)},{default:o.withCtx(()=>[o.unref(Oe)?(o.openBlock(),o.createBlock(o.unref(Wo),{key:0,size:o.unref(ue),"min-size":o.unref(X),class:"flex flex-col min-h-8"},{default:o.withCtx(()=>{var at,lt;return[(at=O.titleBarComment)!=null&&at.title?(o.openBlock(),o.createBlock(ek,{key:0,"title-bar":O.titleBarComment,class:"mb-[3px]"},null,8,["title-bar"])):o.createCommentVNode("",!0),(lt=O.fieldNameComment)!=null&<.label?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(o.unref(xe)("flex justify-between items-center py-1.5 mb-1 active:bg-ed-accent",!O.isAccordion&&"pointer-events-none")),onClick:q[0]||(q[0]=Gt=>o.unref(Se)("pane1"))},[o.createVNode(Cc,{"field-name":O.fieldNameComment},null,8,["field-name"]),O.isAccordion?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(o.unref(N)?o.unref(pg):o.unref(ec)),{key:0,class:"h-5 w-5"})):o.createCommentVNode("",!0)],2)):o.createCommentVNode("",!0),o.withDirectives(o.createElementVNode("div",{class:o.normalizeClass(o.unref(xe)("flex-1 !overflow-y-auto overflow-x-hidden basis-0 flex h-full flex-col",!o.unref(He)&&"scrollbar-thumb-transparent",O.contentClass,O.contentTextStyle)),onScroll:q[2]||(q[2]=(...Gt)=>o.unref(Je)&&o.unref(Je)(...Gt))},[o.createVNode(mQ,{ref:"editorCommentRef",mode:O.mode,extensions:O.extensions,"model-value":r.comment,disabled:r.disabled,"disable-super-input":O.disableSuperInput,"field-name-comment":O.fieldNameComment,"is-show-format-control-bar":O.isShowFormatControlBar,"auto-focus":O.autoFocus,"onUpdate:modelValue":q[1]||(q[1]=Gt=>i("update:comment",Gt)),onSetEditorSelected:V},null,8,["mode","extensions","model-value","disabled","disable-super-input","field-name-comment","is-show-format-control-bar","auto-focus"]),o.unref(H)?(o.openBlock(),o.createElementBlock("div",{key:0,ref_key:"formatToolbarTargetRef",ref:xt,class:o.normalizeClass(o.unref(xe)("sticky bottom-0 z-[12] min-h-[58px]",o.unref(U)&&"fixed inset-x-2.5",o.unref(ce)&&"hidden"))},null,2)):o.createCommentVNode("",!0)],34),[[o.vShow,o.unref(N)]])]}),_:1},8,["size","min-size"])):o.createCommentVNode("",!0),o.createVNode(o.unref(Wo),{size:o.unref(me),"min-size":o.unref(X),class:o.normalizeClass(o.unref(xe)("flex flex-col min-h-8")),style:{overflow:"unset"}},{default:o.withCtx(()=>{var at,lt,Gt;return[(at=O.titleBarContent)!=null&&at.title?(o.openBlock(),o.createBlock(ek,{key:0,"title-bar":O.titleBarContent,class:"mb-[3px]"},null,8,["title-bar"])):o.createCommentVNode("",!0),o.createElementVNode("div",gQ,[(lt=O.fieldNameContent)!=null&<.label?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(o.unref(xe)("flex justify-between items-center py-1.5 mb-1 active:bg-ed-accent flex-1",!O.isAccordion&&"pointer-events-none")),onClick:q[3]||(q[3]=Un=>o.unref(Se)("pane2"))},[o.createVNode(Cc,{"field-name":O.fieldNameContent},null,8,["field-name"]),O.isAccordion?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(o.unref(ce)?o.unref(pg):o.unref(ec)),{key:0,class:"h-5 w-5"})):o.createCommentVNode("",!0)],2)):o.createCommentVNode("",!0),o.unref(le)?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(o.unref(xe)("flex items-center absolute right-9 top-1.5 z-10",!O.isAccordion&&"right-0",!((Gt=O.fieldNameContent)!=null&&Gt.label)&&"static ml-auto"))},[o.createVNode(ye,{for:"superView",class:"body-medium pr-2"},{default:o.withCtx(()=>q[7]||(q[7]=[o.createTextVNode("수퍼")])),_:1}),o.createVNode(ze,{id:"superView",checked:o.unref(B).storage.superText.enable,class:"data-[state=checked]:bg-blue-500","onUpdate:checked":q[4]||(q[4]=Un=>o.unref(B).commands.toggleSuperTextView())},null,8,["checked"])],2)):o.createCommentVNode("",!0),O.contentAutoCopied?(o.openBlock(),o.createBlock(St,{key:2,disabled:o.unref(Rp)(O.contentAutoCopied),variant:"ghost",class:"w-fit h-fit p-0 gap-x-1 label-large text-blue-500",onClick:Ce},{default:o.withCtx(()=>[o.createVNode(it,{name:"autoCopy",class:"size-5"}),q[8]||(q[8]=o.createTextVNode("자동복사"))]),_:1},8,["disabled"])):o.createCommentVNode("",!0)]),o.withDirectives(o.createElementVNode("div",{class:o.normalizeClass(o.unref(xe)("flex-1 basis-0 flex flex-col relative",O.contentClass,O.contentTextStyle))},[o.createVNode(o.unref(Xn),{id:"editor-panel",editor:o.unref(B),class:o.normalizeClass(["flex-1 flex-col relative break-all",O.mode===o.unref(Re).PLAIN_TEXT&&"plain-text"])},null,8,["editor","class"])],2),[[o.vShow,o.unref(ce)]]),o.unref(H)?(o.openBlock(),o.createBlock(o.Teleport,{key:1,to:o.unref(xt),disabled:o.unref(ce)},[o.createElementVNode("div",{class:o.normalizeClass(o.unref(xe)("sticky pb-3.5 mx-1 bottom-0 z-[12] inset-x-0 min-h-11 box-content invisible pointer-events-none",o.unref(F)&&"visible pointer-events-auto",O.customClassFormatControlBar))},[o.unref(I)?(o.openBlock(),o.createBlock(Kt,{key:0,editor:o.unref(I),mode:O.mode,disabled:!o.unref(k)||O.disabled,class:"absolute inset-x-0"},null,8,["editor","mode","disabled"])):o.createCommentVNode("",!0)],2)],8,["to","disabled"])):o.createCommentVNode("",!0),o.createElementVNode("div",{ref_key:"footerTargetRef",ref:w,id:"vdc-editor-footer-target"},null,512)]}),_:1},8,["size","min-size","class"])]),_:1},8,["class","onResize"]))],6)):o.createCommentVNode("",!0),(Wr=o.unref(B))!=null&&Wr.storage.superText&&o.unref($e)?(o.openBlock(),o.createBlock(hQ,{key:1,open:o.unref(D),editor:o.unref(B),"bottom-sheet-component":o.unref($e),onClose:q[5]||(q[5]=at=>o.unref(B).commands.toggleSuperInputMoblie()),onSave:J},null,8,["open","editor","bottom-sheet-component"])):o.createCommentVNode("",!0),(re=o.unref(I))!=null&&re.storage.configPlan?(o.openBlock(),o.createBlock(k5,{key:2,open:(Be=o.unref(I))==null?void 0:Be.storage.configPlan.isShowConfigPlanInput,"is-view-mode":!((Ue=o.unref(I))!=null&&Ue.storage.configPlan.isShowConfigPlanInput),editor:o.unref(I),title:O.$t("editor.configPlan"),onClose:q[6]||(q[6]=at=>o.unref(I).commands.toggleConfigPlanInput()),onSave:te},null,8,["open","is-view-mode","editor","title"])):o.createCommentVNode("",!0)],64)}}}),bQ=o.defineComponent({__name:"ArticleEditor",props:{mode:{default:Re.STRAIGHT},isMobile:{type:Boolean},superTextArea:{},modelValue:{},comment:{},commentCuesheet:{},hideComment:{type:Boolean},disableSuperInput:{type:Boolean},fontSizeDefault:{},fontFamilyDefault:{},contentTextStyle:{},isOpenSuperView:{type:Boolean},output:{},dark:{type:Boolean},disabled:{type:Boolean},hideToolbar:{type:Boolean},isShowFormatControlBar:{type:Boolean},customClassFormatControlBar:{},titleBarComment:{},titleBarContent:{},fieldNameComment:{},fieldNameCommentCuesheet:{},fieldNameContent:{},fieldNameSuper:{},isScreenSplit:{},isShowLineNumber:{type:Boolean},hideMenubar:{type:Boolean},disableBubble:{type:Boolean},hideBubble:{type:Boolean},maxWidth:{},minHeight:{},maxHeight:{},height:{},extensions:{},editorClass:{},contentClass:{},isCompare:{type:Boolean},autoHeight:{type:Boolean},textAlert:{},customClassToolbar:{},readonly:{type:Boolean},canEditSuperReadOnly:{type:Boolean},autoFocus:{type:Boolean,default:!0},superPreviewCustomClass:{},minChar:{},isAccordion:{type:Boolean},contentAutoCopied:{},isEditorView:{type:Boolean},isEditorViewSplitContent:{type:Boolean},editorContentInstance:{}},setup(t){const e=t,n=Cn();return o.onMounted(()=>{n.setTextAlert(e.textAlert||"")}),(r,i)=>e.isMobile?(o.openBlock(),o.createBlock(xc,o.mergeProps({key:1},e,{"onUpdate:modelValue":i[2]||(i[2]=s=>r.$emit("update:modelValue",s)),"onUpdate:comment":i[3]||(i[3]=s=>r.$emit("update:comment",s))}),null,16)):(o.openBlock(),o.createBlock(nh,o.mergeProps({key:0},e,{"onUpdate:modelValue":i[0]||(i[0]=s=>r.$emit("update:modelValue",s)),"onUpdate:comment":i[1]||(i[1]=s=>r.$emit("update:comment",s))}),null,16))}}),vQ=o.defineComponent({__name:"DigitalNewsEditor",props:{mode:{default:Re.EDITOR},isMobile:{type:Boolean},superTextArea:{},modelValue:{},comment:{},commentCuesheet:{},hideComment:{type:Boolean},disableSuperInput:{type:Boolean},fontSizeDefault:{},fontFamilyDefault:{},contentTextStyle:{},isOpenSuperView:{type:Boolean},output:{},dark:{type:Boolean},disabled:{type:Boolean},hideToolbar:{type:Boolean},isShowFormatControlBar:{type:Boolean},customClassFormatControlBar:{},titleBarComment:{},titleBarContent:{},fieldNameComment:{},fieldNameCommentCuesheet:{},fieldNameContent:{},fieldNameSuper:{},isScreenSplit:{},isShowLineNumber:{type:Boolean},hideMenubar:{type:Boolean},disableBubble:{type:Boolean},hideBubble:{type:Boolean},maxWidth:{},minHeight:{},maxHeight:{},height:{},extensions:{},editorClass:{},contentClass:{},isCompare:{type:Boolean},autoHeight:{type:Boolean},textAlert:{},customClassToolbar:{},readonly:{type:Boolean},canEditSuperReadOnly:{type:Boolean},autoFocus:{type:Boolean,default:!0},superPreviewCustomClass:{},minChar:{},isAccordion:{type:Boolean},contentAutoCopied:{},isEditorView:{type:Boolean},isEditorViewSplitContent:{type:Boolean},editorContentInstance:{}},setup(t){const e=t;return(n,r)=>{const i=nh,s=xc;return e.isMobile?(o.openBlock(),o.createBlock(s,o.mergeProps({key:1},e,{"onUpdate:modelValue":r[1]||(r[1]=a=>n.$emit("update:modelValue",a)),"onUpdate:comment":r[2]||(r[2]=a=>n.$emit("update:comment",a))}),null,16)):(o.openBlock(),o.createBlock(i,o.mergeProps({key:0},e,{"onUpdate:modelValue":r[0]||(r[0]=a=>n.$emit("update:modelValue",a))}),null,16))}}});var nk={exports:{}};(function(t){(function(){function e(H){return H===">"}function n(H){return H==="<"}function r(H){return/^\s+$/.test(H)}function i(H){var V=H.match(/^\s*<([^!>][^>]*)>\s*$/);return!!V&&V[1].trim().split(" ")[0]}function s(H){return!i(H)}function a(H){return/^<!--/.test(H)}function l(H){return/--\>$/.test(H)}var u,c=new RegExp("^<(iframe|object|math|svg|script|video|head|style|a)");function f(H){var V=u.exec(H);return V&&V[1]}function p(H,V){return H.substring(H.length-V.length-2)==="</"+V}function m(H){return/^\s*<[^>]+\/>\s*$/.test(H)}function g(H){var V=/^<img[\s>]/.test(H);return V||s(H)||f(H)||m(H)}function b(H){return{string:H,key:C(H)}}function v(H,V,D,j){this.segment=j,this.length=D,this.startInBefore=H+j.beforeIndex,this.startInAfter=V+j.afterIndex,this.endInBefore=this.startInBefore+this.length-1,this.endInAfter=this.startInAfter+this.length-1,this.segmentStartInBefore=H,this.segmentStartInAfter=V,this.segmentEndInBefore=this.segmentStartInBefore+this.length-1,this.segmentEndInAfter=this.segmentStartInAfter+this.length-1}function w(H){for(var V="char",D="",j="",Y=[],J=0;J<H.length;J++){var te=H[J];switch(V){case"tag":var we=f(D);we?(V="atomic_tag",j=we,D+=te):a(D)?(V="html_comment",D+=te):e(te)?(D+=">",Y.push(b(D)),D="",r(te)?V="whitespace":V="char"):D+=te;break;case"atomic_tag":e(te)&&p(D,j)?(D+=">",Y.push(b(D)),D="",j="",V="char"):D+=te;break;case"html_comment":D+=te,l(D)&&(D="",V="char");break;case"char":n(te)?(D&&Y.push(b(D)),D="<",V="tag"):/\s/.test(te)?(D&&Y.push(b(D)),D=te,V="whitespace"):/[\w\d\#@]/.test(te)?D+=te:/&/.test(te)?(D&&Y.push(b(D)),D=te):(D+=te,Y.push(b(D)),D="");break;case"whitespace":n(te)?(D&&Y.push(b(D)),D="<",V="tag"):r(te)?D+=te:(D&&Y.push(b(D)),D=te,V="char");break;default:throw new Error("Unknown mode "+V)}}return D&&Y.push(b(D)),Y}function C(H){var V=/^<img.*src=['"]([^"']*)['"].*>$/.exec(H);if(V)return'<img src="'+V[1]+'">';var D=/^<a.*href=['"]([^"']*)['"]/.exec(H);if(D)return'<a href="'+D[1]+'"></a>';var j=/^<object.*data=['"]([^"']*)['"]/.exec(H);if(j)return'<object src="'+j[1]+'"></object>';if(/^<(svg|math|video)[\s>]/.test(H)){var Y=H.indexOf('data-uuid="');if(Y!==-1){var J=H.slice(0,Y),te=H.slice(Y+44);return J+te}else return H}var we=/^<iframe.*src=['"]([^"']*)['"].*>/.exec(H);if(we)return'<iframe src="'+we[1]+'"></iframe>';var le=/<([^\s>]+)[\s>]/.exec(H);return le?"<"+le[1].toLowerCase()+">":H&&H.replace(/(\s+| | )/g," ")}function E(H){return H.reduce(function(V,D,j){return V[D.key]?V[D.key].push(j):V[D.key]=[j],V},Object.create(null))}function k(H,V){return V.endInBefore<H.startInBefore&&V.endInAfter<H.startInAfter?-1:V.startInBefore>H.endInBefore&&V.startInAfter>H.endInAfter?1:0}function x(){this._root=null}x.prototype={add:function(H){var V={value:H,left:null,right:null},D=this._root;if(D)for(;;){var j=k(D.value,H);if(j===-1)if(D.left)D=D.left;else{D.left=V;break}else if(j===1)if(D.right)D=D.right;else{D.right=V;break}else break}else this._root=V},toArray:function(){function H(V,D){return V&&(H(V.left,D),D.push(V.value),H(V.right,D)),D}return H(this._root,[])}};function _(H){for(var V=H.beforeTokens,D=H.afterMap,j=null,Y=null,J=0;J<V.length;J++){var te=!1,we=V.length-J;if(Y&&we<Y.length)break;var le=V[J];if(le.key===" "){j=J;continue}j===J-1&&(te=!0);var $e=D[le.key];$e&&$e.forEach(function(Oe){var We=Y?Y.length:0,X=A(H,J,Oe,We,te);X&&X.length>We&&(Y=X)})}return Y}function A(H,V,D,j,Y){var J=H.beforeTokens,te=H.afterTokens,we=V+j,le=D+j;if(!(we>=J.length||le>=te.length)){if(j){var $e=J[we].key,Oe=te[le].key;if($e!==Oe)return}for(var We=!0,X=1,N=V+X,ce=D+X;We&&N<J.length&&ce<te.length;){var ue=J[N].key,me=te[ce].key;ue===me?(X++,N=V+X,ce=D+X):We=!1}if(Y&&V>0&&D>0){var Se=J[V-1].key,ee=te[D-1].key;Se===" "&&ee===" "&&(V--,D--,X++)}return new v(V,D,X,H)}}function T(H,V,D,j){return{beforeTokens:H,afterTokens:V,beforeMap:E(H),afterMap:E(V),beforeIndex:D,afterIndex:j}}function B(H){for(var V=new x,D,j=[H];j.length;)if(H=j.pop(),D=_(H),D&&D.length){if(D.segmentStartInBefore>0&&D.segmentStartInAfter>0){var Y=H.beforeTokens.slice(0,D.segmentStartInBefore),J=H.afterTokens.slice(0,D.segmentStartInAfter);j.push(T(Y,J,H.beforeIndex,H.afterIndex))}var te=H.beforeTokens.slice(D.segmentEndInBefore+1),we=H.afterTokens.slice(D.segmentEndInAfter+1),le=H.beforeIndex+D.segmentEndInBefore+1,$e=H.afterIndex+D.segmentEndInAfter+1;te.length&&we.length&&j.push(T(te,we,le,$e)),V.add(D)}return V.toArray()}function L(H,V){if(!H)throw new Error("Missing beforeTokens");if(!V)throw new Error("Missing afterTokens");var D=0,j=0,Y=[],J=T(H,V,0,0),te=B(J);te.push(new v(H.length,V.length,0,J));for(var we=0;we<te.length;we++){var le=te[we],$e="none";D===le.startInBefore?j!==le.startInAfter&&($e="insert"):($e="delete",j!==le.startInAfter&&($e="replace")),$e!=="none"&&Y.push({action:$e,startInBefore:D,endInBefore:$e!=="insert"?le.startInBefore-1:null,startInAfter:j,endInAfter:$e!=="delete"?le.startInAfter-1:null}),le.length!==0&&Y.push({action:"equal",startInBefore:le.startInBefore,endInBefore:le.endInBefore,startInAfter:le.startInAfter,endInAfter:le.endInAfter}),D=le.endInBefore+1,j=le.endInAfter+1}var Oe=[],We={action:"none"};function X(ue){return ue.action!=="equal"||ue.endInBefore-ue.startInBefore!==0?!1:/^\s$/.test(H.slice(ue.startInBefore,ue.endInBefore+1))}for(var N=0;N<Y.length;N++){var ce=Y[N];X(ce)&&We.action==="replace"||ce.action==="replace"&&We.action==="replace"?(We.endInBefore=ce.endInBefore,We.endInAfter=ce.endInAfter):(Oe.push(ce),We=ce)}return Oe}function I(H){this.tokens=H,this.notes=H.reduce(function(V,D,j){V.notes.push({isWrappable:g(D),insertedTag:!1});var Y=!m(D)&&i(D),J=V.tagStack[V.tagStack.length-1];return Y&&(J&&"/"+J.tag===Y?(V.notes[J.position].insertedTag=!0,V.tagStack.pop()):V.tagStack.push({tag:Y,position:j})),V},{notes:[],tagStack:[]}).notes}I.prototype.combine=function(H,V){var D=this.notes,j=this.tokens.slice(),Y=j.reduce(function(J,te,we){D[we].insertedTag&&(j[we]=V(j[we])),J.status===null&&(J.status=D[we].isWrappable);var le=D[we].isWrappable;return le!==J.status&&(J.list.push({isWrappable:J.status,tokens:j.slice(J.lastIndex,we)}),J.lastIndex=we,J.status=le),we===j.length-1&&J.list.push({isWrappable:J.status,tokens:j.slice(J.lastIndex,we+1)}),J},{list:[],status:null,lastIndex:0}).list;return Y.map(H).join("")};function F(H,V,D,j,Y){var J=new I(V);j=j?j+"-":"";var te=" data-"+j+'operation-index="'+D+'"';return Y&&(te+=' class="'+Y+'"'),J.combine(function(we){if(we.isWrappable){var le=we.tokens.join("");if(le.trim())return"<"+H+te+">"+le+"</"+H+">"}else return we.tokens.join("");return""},function(we){var le=' data-diff-node="'+H+'"';return le+=" data-"+j+'operation-index="'+D+'"',we.replace(/>\s*$/,le+"$&")})}var U={equal:function(H,V,D,j,Y,J){var te=D.slice(H.startInAfter,H.endInAfter+1);return te.reduce(function(we,le){return we+le.string},"")},insert:function(H,V,D,j,Y,J){var te=D.slice(H.startInAfter,H.endInAfter+1),we=te.map(function(le){return le.string});return F("ins",we,j,Y,J)},delete:function(H,V,D,j,Y,J){var te=V.slice(H.startInBefore,H.endInBefore+1),we=te.map(function(le){return le.string});return F("del",we,j,Y,J)},replace:function(){return U.delete.apply(null,arguments)+U.insert.apply(null,arguments)}};function ie(H,V,D,j,Y){return D.reduce(function(J,te,we){return J+U[te.action](te,H,V,we,j,Y)},"")}function oe(H,V,D,j,Y){if(H===V)return H;Y?u=new RegExp("^<("+Y.replace(/\s*/g,"").replace(/,/g,"|")+")"):u=c,H=w(H),V=w(V);var J=L(H,V);return ie(H,V,J,j,D)}oe.htmlToTokens=w,oe.findMatchingBlocks=B,B.findBestMatch=_,B.createMap=E,B.createToken=b,B.createSegment=T,B.getKeyForToken=C,oe.calculateOperations=L,oe.renderOperations=ie,t!==null?t.exports=oe:this.htmldiff=oe}).call(Ja)})(nk);var yQ=nk.exports;const wQ=GB(yQ),rk=(t,e,n)=>{let r="";{const i=hn(t,n),s=hn(e,n);r=wQ(i,s,null,null,"button")}return r=r.replace(/<del[^>]*>/g,'<span class="diff-del">').replace(/<\/del>/g,"</span>").replace(/<ins[^>]*>/g,'<mark style="background:#FEF3C7;">').replace(/<\/ins>/g,"</mark>"),r},CQ={key:0,class:"px-2 min-h-[24px] flex items-center justify-between gap-1 mb-1.5"},xQ={class:"flex items-center gap-2"},EQ={class:"body-small text-gray-600 px-[6px] py-[2px] shrink-0 rounded-[4px] bg-gray-100"},kQ={class:"label-large text-gray-800 line-clamp-1"},SQ={class:"flex items-center gap-1 shrink-0"},_Q={class:"mt-[2px]"},TQ={class:"body-small text-gray-400"},AQ={class:"border border-ed-gray rounded-[5px] p-2.5 my-2 h-full"},MQ={key:0,class:"px-2 min-h-[24px] flex items-center justify-between gap-1 mb-1.5"},OQ={class:"flex items-center gap-2"},BQ={class:"body-small text-blue-500 px-[6px] py-[2px] shrink-0 rounded-[4px] bg-blue-50"},IQ={class:"label-large text-gray-800 line-clamp-1"},RQ={class:"flex items-center gap-1 shrink-0"},LQ={class:"mt-[2px]"},PQ={class:"body-small text-gray-400"},DQ=Ao(o.defineComponent({__name:"ArticleCompareEditor",props:{originalData:{},changedData:{},extensions:{},editorClass:{},isCompare:{type:Boolean,default:!0},contentTextStyle:{default:"text-sm font-pretendard"}},setup(t){const e=t,n=o.computed(()=>[...e.extensions,NE]),r=o.ref(!1),i=o.computed(()=>!e.originalData||!e.changedData?{comment:"",content:""}:{comment:rk(e.originalData.comment,e.changedData.comment,!0),content:rk(e.originalData.content,e.changedData.content,!0)}),{HEADER_ONLY_SIZE:s,pane1ContentVisible:a,pane2ContentVisible:l,pane1Size:u,pane2Size:c,handlePaneResize:f}=tk(!1,6),{isScrolling:p,handleScroll:m}=Ol(),{isScrolling:g,handleScroll:b}=Ol();return(v,w)=>{const C=Tt;return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(xe)("h-full",v.editorClass))},[o.createVNode(o.unref(rh),{horizontal:"",onResize:o.unref(f)},{default:o.withCtx(()=>[o.createVNode(o.unref(Wo),{size:o.unref(u),"min-size":o.unref(s),class:"flex flex-col"},{default:o.withCtx(()=>{var E,k,x,_,A,T,B,L,I,F,U;return[(k=(E=v.originalData)==null?void 0:E.titleBar)!=null&&k.title?(o.openBlock(),o.createElementBlock("div",CQ,[o.createElementVNode("div",xQ,[o.createElementVNode("div",EQ,o.toDisplayString(v.$t("기준")),1),o.createElementVNode("h3",kQ,o.toDisplayString((_=(x=v.originalData)==null?void 0:x.titleBar)==null?void 0:_.title),1)]),o.createElementVNode("div",SQ,[o.createElementVNode("div",_Q,[o.createVNode(C,{name:"Clock",class:"w-[13px] h-[13px] text-gray-400"})]),o.createElementVNode("div",TQ,o.toDisplayString((T=(A=v.originalData)==null?void 0:A.titleBar)==null?void 0:T.time),1)])])):o.createCommentVNode("",!0),o.withDirectives(o.createElementVNode("div",{class:o.normalizeClass(o.unref(xe)("border border-gray-50 rounded-md py-[10px] px-4 flex-1 overflow-y-auto",!o.unref(p)&&"scrollbar-thumb-transparent")),onScroll:w[0]||(w[0]=(...ie)=>o.unref(m)&&o.unref(m)(...ie))},[o.createVNode(xc,{"editor-class":"h-full",mode:o.unref(Re).REPORT,disabled:"","hide-toolbar":"",extensions:o.unref(n),"field-name-comment":(B=v.originalData)==null?void 0:B.fieldNameComment,"field-name-content":(L=v.originalData)==null?void 0:L.fieldNameContent,comment:(I=v.originalData)==null?void 0:I.comment,"model-value":(F=v.originalData)==null?void 0:F.content,"hide-comment":(U=v.originalData)==null?void 0:U.hideComment,"is-compare":v.isCompare,"content-text-style":v.contentTextStyle},null,8,["mode","extensions","field-name-comment","field-name-content","comment","model-value","hide-comment","is-compare","content-text-style"])],34),[[o.vShow,o.unref(a)]])]}),_:1},8,["size","min-size"]),o.unref(r)?(o.openBlock(),o.createBlock(o.unref(Wo),{key:0},{default:o.withCtx(()=>{var E,k,x,_,A;return[o.createElementVNode("div",AQ,[o.createVNode(xc,{"editor-class":"h-full",mode:o.unref(Re).REPORT,disabled:"","hide-toolbar":"",extensions:o.unref(n),"field-name-comment":(E=v.changedData)==null?void 0:E.fieldNameComment,"field-name-content":(k=v.changedData)==null?void 0:k.fieldNameContent,comment:(x=v.changedData)==null?void 0:x.comment,"model-value":(_=v.changedData)==null?void 0:_.content,"hide-comment":(A=v.changedData)==null?void 0:A.hideComment,"is-compare":v.isCompare,"content-text-style":v.contentTextStyle},null,8,["mode","extensions","field-name-comment","field-name-content","comment","model-value","hide-comment","is-compare","content-text-style"])])]}),_:1})):o.createCommentVNode("",!0),o.createVNode(o.unref(Wo),{size:o.unref(c),"min-size":o.unref(s),class:"flex flex-col"},{default:o.withCtx(()=>{var E,k,x,_,A,T,B,L,I;return[(k=(E=v.changedData)==null?void 0:E.titleBar)!=null&&k.title?(o.openBlock(),o.createElementBlock("div",MQ,[o.createElementVNode("div",OQ,[o.createElementVNode("div",BQ,o.toDisplayString(v.$t("대상")),1),o.createElementVNode("h3",IQ,o.toDisplayString((_=(x=v.changedData)==null?void 0:x.titleBar)==null?void 0:_.title),1)]),o.createElementVNode("div",RQ,[o.createElementVNode("div",LQ,[o.createVNode(C,{name:"Clock",class:"w-[13px] h-[13px] text-gray-400"})]),o.createElementVNode("div",PQ,o.toDisplayString((T=(A=v.changedData)==null?void 0:A.titleBar)==null?void 0:T.time),1)])])):o.createCommentVNode("",!0),o.withDirectives(o.createElementVNode("div",{class:o.normalizeClass(o.unref(xe)("border border-gray-50 bg-dark-blue-600 rounded-md py-[10px] px-4 flex-1 overflow-y-auto",!o.unref(g)&&"scrollbar-thumb-transparent")),onScroll:w[1]||(w[1]=(...F)=>o.unref(b)&&o.unref(b)(...F))},[o.createVNode(xc,{"editor-class":"h-full",mode:o.unref(Re).REPORT,disabled:"","hide-toolbar":"",extensions:o.unref(n),"field-name-comment":(B=v.changedData)==null?void 0:B.fieldNameComment,"field-name-content":(L=v.changedData)==null?void 0:L.fieldNameContent,comment:o.unref(i).comment,"model-value":o.unref(i).content,"hide-comment":(I=v.changedData)==null?void 0:I.hideComment,"is-compare":v.isCompare,"content-text-style":v.contentTextStyle},null,8,["mode","extensions","field-name-comment","field-name-content","comment","model-value","hide-comment","is-compare","content-text-style"])],34),[[o.vShow,o.unref(l)]])]}),_:1},8,["size","min-size"])]),_:1},8,["onResize"])],2)}}}),[["__scopeId","data-v-6733022d"]]),VQ=o.defineComponent({__name:"SuperViewMobileSuperEditor",props:{isMobile:{type:Boolean},superTextArea:{},mode:{},modelValue:{default:""},comment:{},commentCuesheet:{},hideComment:{type:Boolean},disableSuperInput:{type:Boolean,default:!1},fontSizeDefault:{},fontFamilyDefault:{},contentTextStyle:{},isOpenSuperView:{type:Boolean},output:{default:"html"},dark:{type:Boolean,default:void 0},disabled:{type:Boolean},hideToolbar:{type:Boolean,default:!1},isShowFormatControlBar:{type:Boolean},customClassFormatControlBar:{},titleBarComment:{},titleBarContent:{},fieldNameComment:{},fieldNameCommentCuesheet:{},fieldNameContent:{},fieldNameSuper:{default:null},isScreenSplit:{},isShowLineNumber:{type:Boolean},hideMenubar:{type:Boolean},disableBubble:{type:Boolean,default:!1},hideBubble:{type:Boolean,default:!1},maxWidth:{default:void 0},minHeight:{default:600},maxHeight:{default:void 0},height:{},extensions:{default:()=>[]},editorClass:{},contentClass:{},isCompare:{type:Boolean},autoHeight:{type:Boolean},textAlert:{},customClassToolbar:{},readonly:{type:Boolean},canEditSuperReadOnly:{type:Boolean},autoFocus:{type:Boolean},superPreviewCustomClass:{},minChar:{},isAccordion:{type:Boolean},contentAutoCopied:{},isEditorView:{type:Boolean},isEditorViewSplitContent:{type:Boolean},editorContentInstance:{}},emits:["enter","change","update:modelValue","update:comment","onFocusEditor","changed:selection","setEditorSelected","onBlurEditor","lineFocus","onFocus","onBlur"],setup(t,{expose:e,emit:n}){const r=t,i=n;o.computed(()=>r.mode===Re.EDITOR);const s=ct.useEventBus(ar.RENDER_SUPER_TEXT),a=Cn(),{isReady:l,editor:u,updateEditorState:c,checkSpellStore:f}=a,p=o.ref(!1);o.provide("isEditable",p);const m=o.ref(m6(r.modelValue));function g(x){if(r.disabled||r.readonly)return;const _=sE(x);i("lineFocus",{lineIndex:_})}function b(){i("lineFocus",{lineIndex:void 0})}const v=new So({enablePasteRules:!1,enableInputRules:!1,content:m.value,onCreate:({editor:x})=>{c(x)},onUpdate:nt.throttle(({editor:x})=>{l.value=!0;const _=k(x,r.output);i("update:modelValue",_),i("change",{editor:x,output:_}),c(x)},To),extensions:nt.uniqBy(nt.reverse(o.unref(r.extensions)),"name"),editable:p.value,onFocus:()=>{C(),w.value=!0,g(v)},onBlur:()=>{w.value=!1,b()},onSelectionUpdate:()=>{g(v)}}),w=o.ref(!1);function C(){i("setEditorSelected",v)}function E(){s.emit({action:"render"})}function k(x,_){if(!x)return"";if(x.isEmpty)return _==="json"?{}:"";switch(_){case"html":return x.getHTML();case"json":return x.getJSON();case"text":return x.getText();default:return""}}return o.watch(()=>f.languages,()=>{v.commands.checkSpelling()}),o.watch(()=>r.modelValue,x=>{if(!v||nt.isEqual(k(v,r.output),x))return;const{from:_,to:A}=v.state.selection;v.commands.setTextSelection({from:_,to:A}),E(),m.value=m6(x)},{deep:!0}),o.watch(()=>u.value,()=>{u.value&&u.value.on("selectionUpdate",({editor:x})=>{i("changed:selection",{editor:x})})}),o.watch(()=>r.disableSuperInput,()=>{const x=document.getElementById(or.COMMENT);x==null||x.setAttribute(or.DISABLE_SUPER_INPUT,`${r.disableSuperInput}`)}),o.onUnmounted(()=>v==null?void 0:v.destroy()),th(v),o.onMounted(()=>{var x,_;(x=v==null?void 0:v.commands)!=null&&x.setIsEnableSuggestion&&v.commands.setIsEnableSuggestion(!1),(_=v==null?void 0:v.commands)!=null&&_.setIsMobile&&v.commands.setIsMobile(!0)}),e({editor:v}),(x,_)=>{var T;const A=Cc;return o.openBlock(),o.createElementBlock(o.Fragment,null,[(T=x.fieldNameSuper)!=null&&T.label?(o.openBlock(),o.createBlock(A,{key:0,"field-name":x.fieldNameSuper,mode:x.mode,disabled:x.disabled,class:"mb-1",intent:"secondary"},null,8,["field-name","mode","disabled"])):o.createCommentVNode("",!0),o.createVNode(o.unref(Xn),{editor:o.unref(v),spellcheck:"true",class:o.normalizeClass(["flex-1 flex-col"])},null,8,["editor"])],64)}}}),FQ=(t,e)=>{let n=null;return t.state.doc.descendants((r,i)=>{if(r.type.name==="paragraph"&&Number(r.attrs["number-line"])===e)return n={node:r,pos:i},!1}),n},ok="focused-line";async function ik({lineIndex:t,editor:e}){if(e.state.doc.descendants((l,u)=>{if(l.attrs.class===ok){const c=e.state.tr.setNodeMarkup(u,void 0,{...l.attrs,class:""});return e.view.dispatch(c),!1}}),await o.nextTick(),!t)return;const n=FQ(e,t);if(!n)return;const{node:r,pos:i}=n,s=e.state.tr.setNodeMarkup(i,void 0,{...r.attrs,class:ok});e.view.dispatch(s),await o.nextTick(),e.view.nodeDOM(i).scrollIntoView({behavior:"smooth"})}const $Q=o.defineComponent({__name:"SuperViewMobileEditor",props:{isMobile:{type:Boolean},superTextArea:{},mode:{},modelValue:{default:""},comment:{default:""},commentCuesheet:{},hideComment:{type:Boolean},disableSuperInput:{type:Boolean},fontSizeDefault:{default:"12px"},fontFamilyDefault:{default:""},contentTextStyle:{},isOpenSuperView:{type:Boolean},output:{default:"html"},dark:{type:Boolean},disabled:{type:Boolean,default:!1},hideToolbar:{type:Boolean,default:!1},isShowFormatControlBar:{type:Boolean},customClassFormatControlBar:{},titleBarComment:{},titleBarContent:{},fieldNameComment:{},fieldNameCommentCuesheet:{},fieldNameContent:{default:null},fieldNameSuper:{default:null},isScreenSplit:{},isShowLineNumber:{type:Boolean},hideMenubar:{type:Boolean},disableBubble:{type:Boolean},hideBubble:{type:Boolean,default:!1},maxWidth:{default:void 0},minHeight:{default:200},maxHeight:{default:void 0},height:{default:void 0},extensions:{default:()=>[]},editorClass:{default:void 0},contentClass:{default:void 0},isCompare:{type:Boolean},autoHeight:{type:Boolean},textAlert:{},customClassToolbar:{default:""},readonly:{type:Boolean,default:!1},canEditSuperReadOnly:{type:Boolean},autoFocus:{type:Boolean},superPreviewCustomClass:{},minChar:{},isAccordion:{type:Boolean},contentAutoCopied:{},isEditorView:{type:Boolean},isEditorViewSplitContent:{type:Boolean},editorContentInstance:{}},emits:["enter","change","update:modelValue","update:comment","onFocusEditor","changed:selection","setEditorSelected","onBlurEditor","lineFocus","onFocus","onBlur"],setup(t,{expose:e,emit:n}){const r=t,i=n;o.provide("isMobile",!0),o.computed(()=>r.mode===Re.EDITOR);const s=ct.useEventBus(ar.INCREASE_DECREASE_FONTSIZE);o.useAttrs();const a=Cn(),{state:l,isFullscreen:u,isReady:c,editor:f,updateEditorState:p,checkSpellStore:m}=a,g=o.ref(!1);o.provide("isEditable",g);const b=o.ref(void 0),v=o.ref(),w=o.computed(()=>[...l.extensions,...nt.differenceBy(r.extensions,l.extensions,"name")].map((V,D)=>V.configure({sort:D}))),C=o.ref(r.fontSizeDefault),E=o.ref(r.fontFamilyDefault);o.provide("fontSize",C),o.provide("fontFamily",E);const k=o.computed(()=>({fontFamily:E.value,fontSize:C.value})),x=o.ref(),_=V=>{const D=parseInt(C.value||"12px"),j=V?D+2:D-2;C.value=j+"px"};o.onBeforeMount(()=>{s.on(_)}),o.onBeforeUnmount(()=>{s.off(_)});const A=o.computed(()=>({...o.unref(u)?{height:"100%"}:{minHeight:r.minHeight?ln(r.minHeight):void 0,maxHeight:r.maxHeight?ln(r.maxHeight):void 0,height:r.height?ln(r.height):void 0},maxWidth:ln(r.maxWidth),width:r.maxWidth?"100%":void 0,margin:r.maxWidth?"0 auto":void 0}));function T(V){if(r.disabled||r.readonly)return;const D=sE(V);b.value=D}function B(){b.value=void 0}const L=new So({enablePasteRules:!1,enableInputRules:!1,content:hn(r.modelValue,r.disabled,r.mode),onCreate:({editor:V})=>{p(V)},onUpdate:nt.throttle(({editor:V})=>{c.value=!0;const D=oe(V,r.output);i("update:modelValue",D),i("change",{editor:V,output:D}),p(V)},To),extensions:nt.uniqBy(nt.reverse(o.unref(w)),"name"),editable:g.value,onFocus:()=>{ie(),I.value=!0,T(L)},onBlur:()=>{I.value=!1,B()},onSelectionUpdate:()=>{T(L)}}),I=o.ref(!1),F=o.ref();o.onMounted(()=>{F.value=L});const U=({lineIndex:V})=>{var j;L&&ik({lineIndex:V,editor:L});const D=(j=v.value)==null?void 0:j.editor;D&&ik({lineIndex:V,editor:D})};o.watch(()=>b.value,V=>{i("lineFocus",{lineIndex:V}),U({lineIndex:V})},{immediate:!0});function ie(V){F.value=L}function oe(V,D){if(!V)return"";if(V.isEmpty)return D==="json"?{}:"";switch(D){case"html":return V.getHTML();case"json":return V.getJSON();case"text":return V.getText({blockSeparator:`
|
|
345
345
|
`});default:return""}}function H(V){return V.every(D=>L==null?void 0:L.extensionManager.extensions.find(j=>j.name===D))}return o.watch(()=>m.languages,()=>{L.commands.checkSpelling()}),o.watch(()=>r.modelValue,V=>{if(!L||nt.isEqual(oe(L,r.output),V))return;const{from:D,to:j}=L.state.selection;L.commands.setTextSelection({from:D,to:j}),L.commands.setContent(hn(V,r.disabled,r.mode),!1)},{deep:!0}),o.watch(()=>f.value,()=>{f.value&&f.value.on("selectionUpdate",({editor:V})=>{i("changed:selection",{editor:V})})}),o.onUnmounted(()=>{var V;L==null||L.destroy(),(V=F.value)==null||V.destroy()}),Zu(Tu.SAVE,()=>{localStorage.setItem("content",oe(L,"html"))}),o.onMounted(()=>{var V,D;(V=L==null?void 0:L.commands)!=null&&V.setIsEnableSuggestion&&L.commands.setIsEnableSuggestion(!1),(D=L==null?void 0:L.commands)!=null&&D.setIsMobile&&L.commands.setIsMobile(!0)}),th(L),e({editor:L}),(V,D)=>{const j=eh,Y=Np,J=Qp,te=Bf,we=JE,le=Cc;return F.value?(o.openBlock(),o.createElementBlock("div",{key:0,id:"vdc-editor",ref_key:"editorRef",ref:x,style:o.normalizeStyle(A.value),class:o.normalizeClass(o.unref(xe)("vdc-editor mobile relative w-full flex flex-col editor-line-number editor-line",!r.height&&"flex-1",V.editorClass))},[!V.hideBubble&&!V.disabled&&g.value?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[H([o.unref(fc)])?(o.openBlock(),o.createBlock(j,{key:0,editor:o.unref(L)},null,8,["editor"])):o.createCommentVNode("",!0),H([o.unref(ua)])?(o.openBlock(),o.createBlock(Y,{key:1,editor:o.unref(L)},null,8,["editor"])):o.createCommentVNode("",!0),H([o.unref(cs)])?(o.openBlock(),o.createBlock(J,{key:2,editor:o.unref(L)},null,8,["editor"])):o.createCommentVNode("",!0),H([o.unref(ds),o.unref(fs)])?(o.openBlock(),o.createBlock(te,{key:3,editor:o.unref(L)},null,8,["editor"])):o.createCommentVNode("",!0)],64)):o.createCommentVNode("",!0),V.hideToolbar?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(we,{key:1,editor:F.value,mode:V.mode,disabled:V.disabled,class:"mb-[3px]","custom-class-toolbar":V.customClassToolbar,"active-extensions":[Sl]},null,8,["editor","mode","disabled","custom-class-toolbar","active-extensions"])),o.createVNode(o.unref(rh),{class:o.normalizeClass(o.unref(xe)("flex flex-col")),style:o.normalizeStyle({...k.value}),horizontal:""},{default:o.withCtx(()=>[o.createVNode(o.unref(Wo),{size:50,class:"border-none p-0 flex flex-col bg-[#EEEEEE]"},{default:o.withCtx(()=>{var $e;return[o.createElementVNode("div",{class:o.normalizeClass(o.unref(xe)("flex-1 !overflow-y-auto scrollbar-hide basis-0 flex flex-col pt-1.5 p-2.5 border border-ed-gray rounded-[5px]",V.contentClass))},[($e=V.fieldNameContent)!=null&&$e.label?(o.openBlock(),o.createBlock(le,{key:0,"field-name":V.fieldNameContent,mode:V.mode,disabled:V.disabled,class:"mb-1"},null,8,["field-name","mode","disabled"])):o.createCommentVNode("",!0),o.createVNode(o.unref(Xn),{editor:o.unref(L),spellcheck:"true",class:o.normalizeClass(["flex-1 flex-col"])},null,8,["editor"])],2)]}),_:1}),o.createVNode(o.unref(Wo),{size:50,class:"border-none p-0 flex flex-col"},{default:o.withCtx(()=>[o.createElementVNode("div",{class:o.normalizeClass(o.unref(xe)("flex-1 overflow-y-auto scrollbar-hide flex flex-col pt-1.5 p-2.5 border border-ed-gray rounded-[5px]",I.value&&"border-ed-blue",V.disabled&&"border-transparent",V.contentClass))},[o.createVNode(VQ,{ref_key:"superEditorRef",ref:v,mode:V.mode,"field-name-super":V.fieldNameSuper,extensions:V.extensions,"model-value":V.modelValue,disabled:V.disabled,readonly:V.readonly,onLineFocus:U},null,8,["mode","field-name-super","extensions","model-value","disabled","readonly"])],2)]),_:1})]),_:1},8,["class","style"])],6)):o.createCommentVNode("",!0)}}}),sk={"editor.remove":"Remove","editor.copy":"Copy","editor.words":"WORDS","editor.characters":"CHARACTERS","editor.default":"Default","editor.recent":"Recently Used","editor.nofill":"Remove Color","editor.format":"Format Painter","editor.close":"Close","editor.modify":"Modify","editor.preview.tooltip":"Preview","editor.draghandle.tooltip":"Click And Drag","editor.copyToClipboard":"CopyToClipboard","editor.importWord.tooltip":"Import from Word","editor.importWord.success":"Import Success","editor.importWord.fileTooLarge":"File is Too large","editor.importWord.error":"Import Failed, File not supported","editor.slash":"Press '/' for commands","editor.slash.empty":"No Result","editor.slash.format":"Format","editor.slash.insert":"Insert","editor.slash.embed":"Embed Services","editor.content":"Please input content","editor.slash.hint":"Please input content","editor.moremark":"More Text Styles","editor.size.small.tooltip":"Small","editor.size.medium.tooltip":"Medium","editor.size.large.tooltip":"Cover","editor.bold.tooltip":"Bold","editor.italic.tooltip":"Italic","editor.underline.tooltip":"Underline","editor.strike.tooltip":"Strike","editor.color.tooltip":"Color","editor.color.more":"Color Picker","editor.highlight.tooltip":"Highlight","editor.lineheight.tooltip":"Line Height","editor.heading.tooltip":"Headings","editor.heading.h1.tooltip":"Heading 1","editor.heading.h2.tooltip":"Heading 2","editor.heading.h3.tooltip":"Heading 3","editor.heading.h4.tooltip":"Heading 4","editor.heading.h5.tooltip":"Heading 5","editor.heading.h6.tooltip":"Heading 6","editor.paragraph.tooltip":"Paragraph","editor.textalign.tooltip":"Align","editor.textalign.left.tooltip":"Left","editor.textalign.center.tooltip":"Center","editor.textalign.right.tooltip":"Right","editor.textalign.justify.tooltip":"Justify","editor.indent":"Indent","editor.indent.indent":"Increase Indent","editor.indent.outdent":"Decrease Indent","editor.fontFamily.tooltip":"Font family","editor.fontFamily.default":"Default","editor.fontFamily.gulim":"Gulim","editor.fontFamily.dotum":"Dotum","editor.fontFamily.gungsuh":"Gungsuh","editor.fontSize.tooltip":"Font size","editor.fontSize.default.tooltip":"Default","editor.superscript.tooltip":"Superscript","editor.subscript.tooltip":"Subscript","editor.bulletlist.tooltip":"Bullet List","editor.bulletlist.disc.tooltip":"Disc","editor.bulletlist.circle.tooltip":"Circle","editor.bulletlist.square.tooltip":"Square","editor.orderedlist.tooltip":"Ordered List","editor.orderedlist.decimal.tooltip":"Decimal","editor.orderedlist.decimalLeadingZero.tooltip":"Decimal with leading zero","editor.orderedlist.lowerRoman.tooltip":"Lower Roman","editor.orderedlist.upperRoman.tooltip":"Upper Roman","editor.orderedlist.lowerLatin.tooltip":"Lower Latin","editor.orderedlist.upperLatin.tooltip":"Upper Latin","editor.orderedlist.tradChineseInformal.tooltip":"Trad Chinese Informal","editor.orderedlist.simpChineseFormal.tooltip":"Simp Chinese Informal","editor.tasklist.tooltip":"Task List","editor.indent.tooltip":"Indent","editor.outdent.tooltip":"Outdent","editor.columns.tooltip":"Columns","editor.link.tooltip":"Link","editor.link.unlink.tooltip":"UnLink","editor.link.open.tooltip":"Open Link","editor.link.edit.tooltip":"Edit Link","editor.link.dialog.title":"Insert Link","editor.link.dialog.link":"Link","editor.link.dialog.text":"Text","editor.link.dialog.openInNewTab":"Open In New Tab","editor.link.dialog.link.placeholder":"Link Address","editor.link.dialog.text.placeholder":"Add Description","editor.link.dialog.button.apply":"Apply","editor.image.tooltip":"Image","editor.image.menu.flipX":"Flip vertical","editor.image.menu.flipY":"Flip horizontal","editor.image.menu.size":"Set Size","editor.image.menu.size.width":"Width","editor.image.menu.size.height":"Height","editor.image.dragger.tooltip":"Click or drag the image to the area to upload","editor.image.float.left.tooltip":"Float left","editor.image.float.none.tooltip":"Float none","editor.image.float.right.tooltip":"Float right","editor.image.dialog.title":"Add an image","editor.image.dialog.tab.url":"Url","editor.image.dialog.tab.upload":"Upload","editor.image.dialog.uploading":"Uploading","editor.image.dialog.form.link":"Link","editor.image.dialog.placeholder":"Link","editor.image.dialog.form.alt":"Alt","editor.image.dialog.form.aspectRatio":"Lock original aspect ratio","editor.image.dialog.form.file":"File","editor.image.dialog.button.apply":"apply","editor.video.tooltip":"Video","editor.video.dialog.tab.upload":"Upload","editor.video.dialog.uploading":"Uploading","editor.video.dialog.title":"Embed or upload a video","editor.video.dialog.link":"link","editor.video.dialog.placeholder":"Link","editor.video.dialog.button.apply":"apply","editor.table.tooltip":"Table","editor.table.menu.insert_table":"Insert Table","editor.table.menu.insert_table.with_header_row":"With header row","editor.table.menu.insertColumnBefore":"Insert Column Before","editor.table.menu.insertColumnAfter":"Insert Column After","editor.table.menu.deleteColumn":"Delete Column","editor.table.menu.insertRowAbove":"Insert Row Above","editor.table.menu.insertRowBelow":"Insert Row Below","editor.table.menu.deleteRow":"Delete Row","editor.table.menu.mergeCells":"Merge Cells","editor.table.menu.splitCells":"Split Cells","editor.table.menu.deleteTable":"Delete Table","editor.table.menu.setCellsBgColor":"Cell Background Color","editor.blockquote.tooltip":"Blockquote","editor.horizontalrule.tooltip":"Horizontal Rule","editor.code.tooltip":"Code","editor.codeblock.tooltip":"Code Block","editor.clear.tooltip":"Clear Format","editor.undo.tooltip":"Undo","editor.redo.tooltip":"Redo","editor.fullscreen.tooltip.fullscreen":"Fullscreen","editor.fullscreen.tooltip.exit":"Fullscreen Exit","editor.imageUpload.fileTypeNotSupported":"File type not supported","editor.imageUpload.fileSizeTooBig":"File size too big, Maximum size is","editor.AI.placeholder":"Ask AI ...","editor.AI.generating":"Generating","editor.AI.insert":"Insert below selection","editor.AI.replace":"Replace selected content","editor.AI.regenerate":"Regenerate","editor.AI.close":"Close","editor.AI.stop":"Stop","editor.AI.ask":"Ask AI","editor.menubar.file":"File","editor.menubar.edit":"Edit","editor.menubar.view":"View","editor.menubar.insert":"Insert","editor.menubar.format":"Format","editor.menubar.menu.newDoc":"New Document","editor.menubar.menu.restoreLastDraft":"Restore last draft","editor.menubar.menu.print":"Print","editor.menubar.menu.cut":"Cut","editor.menubar.menu.copy":"Copy","editor.menubar.menu.paste":"Paste","editor.menubar.menu.pasteAsText":"Paste as text","editor.menubar.menu.selectAll":"Select all","editor.menubar.menu.preview":"Preview","editor.menubar.menu.spellCheck":"Spell check","editor.menubar.menu.spelling":"spelling","editor.menubar.menu.superView":"Super view","editor.menubar.menu.insertSuper":"Insert super","editor.menubar.menu.articleContent":"Article content","editor.menubar.menu.articleComment":"Article comment","editor.menubar.menu.cancel":"Cancel","editor.menubar.menu.save":"Save","editor.findAndReplace.tooltip":"Find and replace","editor.findAndReplace.find":"Find","editor.findAndReplace.replace":"Replace","editor.findAndReplace.replaceAll":"Replace All","editor.findAndReplace.caseSensitive":"Case Sensitive","editor.printer.tooltip":"Print","editor.superinput":"Super input","editor.insert.symbol":"Insert symbol","editor.check":"Check","editor.detail":"Detail","editor.inputSuper":"Input Super","editor.insertSpecial":"Special characters","editor.cut":"Cut","editor.paste":"Paste","editor.selectAll":"SelectAll","editor.delete":"Delete","editor.super.edit":"Super edit","editor.super.delete":"Super delete","editor.configPlan.edit":"Config plan edit","editor.configPlan.delete":"Config plan delete","editor.super":"Super","editor.configPlan":"Config plan","editor.insertConfigPlan":"Insert config plan","editor.alert":"Super has been changed. Super ID will be deleted.","editor.alertConfirm":"Confirm","editor.alertYes":"OK"},ak={"editor.remove":"제거","editor.copy":"복사","editor.words":"낱말","editor.characters":"문자","editor.default":"기본값","editor.recent":"최근 사용됨","editor.nofill":"색상 제거","editor.format":"형식 페인터","editor.close":"닫기","editor.modify":"수정","editor.preview.tooltip":"미리보기","editor.draghandle.tooltip":"클릭하여 드래그","editor.copyToClipboard":"클립보드에 복사","editor.importWord.tooltip":"Word에서 가져오기","editor.importWord.success":"가져오기 성공","editor.importWord.fileTooLarge":"파일이 너무 큽니다","editor.importWord.error":"가져오기 실패, 파일이 지원되지 않음","editor.slash":"명령을 보려면 '/'를 누르세요.","editor.slash.empty":"결과 없음","editor.slash.format":"형식","editor.slash.insert":"삽입","editor.slash.embed":"서비스 삽입","editor.content":"내용을 입력해주세요","editor.slash.hint":"내용을 입력해주세요","editor.moremark":"추가 텍스트 스타일","editor.size.small.tooltip":"작음","editor.size.medium.tooltip":"중간","editor.size.large.tooltip":"표지","editor.bold.tooltip":"굵게","editor.italic.tooltip":"기울임꼴","editor.underline.tooltip":"밑줄","editor.strike.tooltip":"취소선","editor.color.tooltip":"색상","editor.color.more":"색상 선택기","editor.highlight.tooltip":"강조 표시","editor.lineheight.tooltip":"줄간격","editor.heading.tooltip":"제목","editor.heading.h1.tooltip":"제목 1","editor.heading.h2.tooltip":"제목 2","editor.heading.h3.tooltip":"제목 3","editor.heading.h4.tooltip":"제목 4","editor.heading.h5.tooltip":"제목 5","editor.heading.h6.tooltip":"제목 6","editor.paragraph.tooltip":"단락","editor.textalign.tooltip":"양쪽정렬","editor.textalign.left.tooltip":"왼쪽","editor.textalign.center.tooltip":"가운데","editor.textalign.right.tooltip":"오른쪽","editor.textalign.justify.tooltip":"양쪽정렬","editor.indent":"들여쓰기","editor.indent.indent":"들여쓰기","editor.indent.outdent":"들여쓰기 줄이기","editor.fontFamily.tooltip":"맑은고딕","editor.fontFamily.default":"맑은고딕","editor.fontFamily.gulim":"굴림","editor.fontFamily.dotum":"돋움","editor.fontFamily.gungsuh":"궁서","editor.fontSize.tooltip":"기본값","editor.fontSize.default.tooltip":"기본값","editor.superscript.tooltip":"위 첨자","editor.subscript.tooltip":"아래첨자","editor.bulletlist.tooltip":"글머리 기호 목록","editor.bulletlist.disc.tooltip":"디스크","editor.bulletlist.circle.tooltip":"원","editor.bulletlist.square.tooltip":"사각형","editor.orderedlist.tooltip":"순서가 지정된 목록","editor.orderedlist.decimal.tooltip":"십진수","editor.orderedlist.decimalLeadingZero.tooltip":"앞에 0이 있는 십진수","editor.orderedlist.lowerRoman.tooltip":"하위 로마자","editor.orderedlist.upperRoman.tooltip":"상위 로마자","editor.orderedlist.lowerLatin.tooltip":"하위 라틴어","editor.orderedlist.upperLatin.tooltip":"상위 라틴어","editor.orderedlist.tradChinaInformal.tooltip":"중국어 비공식","editor.orderedlist.simpChinaFormal.tooltip":"간체 중국어 비공식","editor.tasklist.tooltip":"작업 목록","editor.indent.tooltip":"들여쓰기","editor.outdent.tooltip":"내어쓰기","editor.columns.tooltip":"열","editor.link.tooltip":"링크","editor.link.unlink.tooltip":"링크 해제","editor.link.open.tooltip":"링크 열기","editor.link.edit.tooltip":"링크 편집","editor.link.dialog.title":"링크 삽입","editor.link.dialog.link":"링크","editor.link.dialog.text":"텍스트","editor.link.dialog.openInNewTab":"새 탭에서 열기","editor.link.dialog.link.placeholder":"링크 주소","editor.link.dialog.text.placeholder":"설명 추가","editor.link.dialog.button.apply":"적용","editor.image.tooltip":"이미지","editor.image.menu.flipX":"세로 뒤집기","editor.image.menu.flipY":"가로 뒤집기","editor.image.menu.size":"크기 설정","editor.image.menu.size.width":"너비","editor.image.menu.size.height":"높이","editor.image.dragger.tooltip":"업로드할 영역으로 이미지를 클릭하거나 드래그하세요.","editor.image.float.left.tooltip":"왼쪽으로 부동","editor.image.float.none.tooltip":"부동 없음","editor.image.float.right.tooltip":"오른쪽으로 부동","editor.image.dialog.title":"이미지 추가","editor.image.dialog.tab.url":"URL","editor.image.dialog.tab.upload":"업로드","editor.image.dialog.uploading":"업로드 중","editor.image.dialog.form.link":"링크","editor.image.dialog.placeholder":"링크","editor.image.dialog.form.alt":"Alt","editor.image.dialog.form.aspectRatio":"원본 가로 세로 비율 잠금","editor.image.dialog.form.file":"파일","editor.image.dialog.button.apply":"적용","editor.video.tooltip":"비디오","editor.video.dialog.tab.upload":"업로드","editor.video.dialog.uploading":"업로드 중","editor.video.dialog.title":"동영상 삽입 또는 업로드","editor.video.dialog.link":"링크","editor.video.dialog.placeholder":"링크","editor.video.dialog.button.apply":"적용","editor.table.tooltip":"표","editor.table.menu.insert_table":"테이블 삽입","editor.table.menu.insert_table.with_header_row":"머리글 행 포함","editor.table.menu.insertColumnBefore":"앞에 열 삽입","editor.table.menu.insertColumnAfter":"다음에 열 삽입","editor.table.menu.deleteColumn":"열 삭제","editor.table.menu.insertRowAbove":"위에 행 삽입","editor.table.menu.insertRowBelow":"아래에 행 삽입","editor.table.menu.deleteRow":"행 삭제","editor.table.menu.mergeCells":"셀 병합","editor.table.menu.splitCells":"셀 분할","editor.table.menu.deleteTable":"테이블 삭제","editor.table.menu.setCellsBgColor":"셀 배경색","editor.blockquote.tooltip":"블록인용","editor.horizontalrule.tooltip":"수평 규칙","editor.code.tooltip":"코드","editor.codeblock.tooltip":"코드 블록","editor.clear.tooltip":"형식 지우기","editor.undo.tooltip":"실행 취소","editor.redo.tooltip":"다시 실행","editor.fullscreen.tooltip.fullscreen":"전체 화면","editor.fullscreen.tooltip.exit":"전체 화면 종료","editor.imageUpload.fileTypeNotSupported":"지원되지 않는 파일 형식","editor.imageUpload.fileSizeTooBig":"파일 크기가 너무 큽니다. 최대 크기는 다음과 같습니다.","editor.AI.placeholder":"AI에게 물어보세요...","editor.AI.geneating":"생성","editor.AI.insert":"선택 항목 아래에 삽입","editor.AI.replace":"선택한 콘텐츠 교체","editor.AI.regenerate":"재생성","editor.AI.close":"닫기","editor.AI.stop":"중지","editor.AI.ask":"AI에게 물어보세요","editor.menubar.file":"파일","editor.menubar.edit":"편집","editor.menubar.view":"보기","editor.menubar.insert":"삽입","editor.menubar.format":"형식","editor.menubar.menu.newDoc":"새 문서","editor.menubar.menu.restoreLastDraft":"마지막 초안 복원","editor.menubar.menu.print":"인쇄","editor.menubar.menu.cut":"잘라내기","editor.menubar.menu.copy":"복사","editor.menubar.menu.paste":"붙여넣기","editor.menubar.menu.pasteAsText":"텍스트로 붙여넣기","editor.menubar.menu.selectAll":"모두 선택","editor.menubar.menu.preview":"미리보기","editor.menubar.menu.spellCheck":"맞춤법 검사","editor.menubar.menu.spelling":"맞춤법","editor.menubar.menu.superView":"수퍼보기","editor.menubar.menu.insertSuper":"수퍼 넣기","editor.menubar.menu.articleContent":"앵커멘트","editor.menubar.menu.articleComment":"상세 텍스트","editor.menubar.menu.cancel":"취소","editor.menubar.menu.save":"저장","editor.findAndReplace.tooltip":"찾기 및 바꾸기","editor.findAndReplace.find":"찾기","editor.findAndReplace.replace":"바꾸기","editor.findAndReplace.replaceAll":"모두 바꾸기","editor.findAndReplace.caseSensitive":"대소문자 구분","editor.printer.tooltip":"인쇄","editor.superinput":"수퍼입력","editor.insert.symbol":"기호삽입","editor.check":"확인","editor.detail":"내용","editor.inputSuper":"수퍼 작성","editor.insertSpecial":"특수문자","editor.cut":"잘라내기","editor.paste":"붙여넣기","editor.selectAll":"모두선택","editor.delete":"삭제","editor.super.edit":"수퍼 수정","editor.super.delete":"수퍼 삭제","editor.configPlan.edit":"구성안 수정","editor.configPlan.delete":"구성안 삭제","editor.super":"수퍼","editor.configPlan":"구성안","editor.insertConfigPlan":"구성안넣기","editor.alert":"수퍼가 변경되었습니다. 수퍼아이디를 삭제합니다.","editor.alertConfirm":"확인","editor.alertYes":"확인"},HQ=r$({legacy:!1,locale:"en",fallbackLocale:"en",messages:{en:sk,ko:ak}});gx();const lk={install(t){t.use(HQ),t.component("vdc-editor",nh)}},zQ=ct.useEventBus(ar.RENDER_SUPER_TEXT);function UQ(){zQ.emit({action:"render"})}const WQ={class:"min-h-[188px] flex flex-col items-center justify-center gap-y-2 text-sm"},jQ=o.defineComponent({__name:"BulkSpellCheckerFail",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("div",WQ,[o.createVNode(o.unref(SU),{class:"h-12 w-12 text-red-500"}),n[0]||(n[0]=o.createElementVNode("div",null,"맞춤법 검사에 실패했습니다",-1)),n[1]||(n[1]=o.createElementVNode("p",{class:"text-xs font-normal text-gray-600 dark:text-gray-400"},"다시 검사하기 버튼을 눌러 재시도 해주세요",-1))]))}}),qQ={class:"min-h-[188px] flex flex-col items-center justify-center gap-y-2 text-sm"},KQ=o.defineComponent({__name:"BulkSpellCheckerNotWrongWord",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("div",qQ,[o.createVNode(o.unref(_U),{class:"h-12 w-12 text-blue-500"}),n[0]||(n[0]=o.createElementVNode("div",null,"맞춤법 오류가 없습니다",-1))]))}}),GQ={class:"relative"},XQ=["innerHTML"],YQ={class:"border-b border-gray-500"},JQ=o.defineComponent({__name:"BulkSpellCheckerHelpText",props:{text:{}},setup(t){const e=o.ref(!1),n=o.ref(!1),r=o.ref(null);function i(){e.value=!e.value}return o.onMounted(async()=>{await o.nextTick(),r.value&&r.value.scrollHeight>32&&(n.value=!0)}),(s,a)=>(o.openBlock(),o.createElementBlock("div",GQ,[o.createElementVNode("div",{ref_key:"helpRef",ref:r,class:o.normalizeClass(["text-gray-700 dark:text-gray-400 transition-all",o.unref(e)?"max-h-none":"max-h-[32px] overflow-hidden"]),innerHTML:s.text},null,10,XQ),o.unref(n)?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["",o.unref(xe)("w-32 flex items-end justify-end bg-gradient-to-l from-white via-white to-transparent dark:from-ed-background dark:via-ed-background",o.unref(e)?"ml-auto opacity-60":"absolute bottom-0 right-0")])},[o.createElementVNode("button",{class:"flex items-center gap-1",onClick:o.withModifiers(i,["stop"])},[o.createElementVNode("span",YQ,o.toDisplayString(o.unref(e)?"접기":"자세히"),1),o.createVNode(o.unref(ec),{class:o.normalizeClass(["w-4 h-4 transition-transform",o.unref(e)?"rotate-180":""])},null,8,["class"])])],2)):o.createCommentVNode("",!0)]))}}),Qb=new kt("bulk-spellcheck-highlight");function ZQ(t,e,n=`
|
|
346
346
|
`){return new tt({key:Qb,props:{decorations(r){const i=[],s={[Rd.SPACING]:"bulk-highlight text-blue-500 border-b-2 border-blue-500",[Rd.SPELLING]:"bulk-highlight text-red-500 border-b-2 border-red-500"};return e.forEach(a=>{var g,b;const l=Bl(t,a.startIndex,n),u=Bl(t,a.endIndex-1,n)+1,c=(b=(g=a.errorHelpDtos)==null?void 0:g[0])==null?void 0:b.errorType,f=s[c??-1]||"bulk-highlight text-green-500 border-b-2 border-green-500",p=Math.max(0,Math.min(l,r.doc.content.size)),m=Math.max(0,Math.min(u,r.doc.content.size));p<m&&i.push(jt.inline(p,m,{class:f}))}),mt.create(r.doc,i)}}})}function Nb(t,e){if(t.unregisterPlugin(Qb),!e.length)return;const n=ZQ(t,e);t.registerPlugin(n)}function QQ(t){t&&t.unregisterPlugin(Qb)}function uk(t,e=`
|
|
347
347
|
`){const n=[];let r=0,i=!0;return t.state.doc.descendants((s,a)=>{if(s.isText&&s.text)for(let c=0;c<s.text.length;c++)n[r++]=a+c;const l=s.type&&s.type.name;if((l==="hardBreak"||l==="hard_break"||l==="br")&&e.length>0)for(let c=0;c<e.length;c++)n[r++]=a;if(s.isBlock){if(!i&&e.length>0)for(let c=0;c<e.length;c++)n[r++]=a;i=!1}return!0}),n}function Bl(t,e,n=`
|