vdc-editor 0.1.301 → 0.1.302
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-BnwdFb8U.mjs +5 -0
- package/lib/BulkSpellChecker-BnwdFb8U.mjs.map +1 -0
- package/lib/{index-ikFXqB8H.mjs → index-wX5lAeL3.mjs} +3964 -3961
- package/lib/{index-ikFXqB8H.mjs.map → index-wX5lAeL3.mjs.map} +1 -1
- package/lib/style.css +1 -1
- package/lib/vdc-editor.mjs +1 -1
- package/lib/vdc-editor.umd.js +20 -20
- package/lib/vdc-editor.umd.js.map +1 -1
- package/package.json +1 -1
- package/lib/BulkSpellChecker-Bq_z3EM4.mjs +0 -5
- package/lib/BulkSpellChecker-Bq_z3EM4.mjs.map +0 -1
package/lib/vdc-editor.umd.js
CHANGED
|
@@ -86,7 +86,7 @@ img.ProseMirror-separator {
|
|
|
86
86
|
opacity: 0
|
|
87
87
|
}`;function bB(t,e,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute("data-tiptap-style",""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}let u4=class extends jM{constructor(e={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n},onPaste:()=>null,onDrop:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:n,slice:r,moved:i})=>this.options.onDrop(n,r,i)),this.on("paste",({event:n,slice:r})=>this.options.onPaste(n,r)),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=bB(vB,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,n=!0){this.setOptions({editable:e}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,n){const r=Ww(n)?n(e,[...this.state.plugins]):[...this.state.plugins,e],i=this.state.reconfigure({plugins:r});return this.view.updateState(i),i}unregisterPlugin(e){if(this.isDestroyed)return;const n=this.state.plugins;let r=n;if([].concat(e).forEach(s=>{const a=typeof s=="string"?`${s}$`:s.key;r=n.filter(l=>!l.key.startsWith(a))}),n.length===r.length)return;const i=this.state.reconfigure({plugins:r});return this.view.updateState(i),i}createExtensionManager(){var e,n;const i=[...this.options.enableCoreExtensions?[fB,iO.configure({blockSeparator:(n=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),cB,pB,hB,gB,dB,mB].filter(s=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[s.name]!==!1:!0):[],...this.options.extensions].filter(s=>["extension","node","mark"].includes(s?.type));this.extensionManager=new sl(i,this)}createCommandManager(){this.commandManager=new Vd({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){var e;let n;try{n=R0(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(a){if(!(a instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(a.message))throw a;this.emit("contentError",{editor:this,error:a,disableCollaboration:()=>{this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(l=>l.name!=="collaboration"),this.createExtensionManager()}}),n=R0(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const r=Jw(n,this.options.autofocus);this.view=new pM(this.options.element,{...this.options.editorProps,attributes:{role:"textbox",...(e=this.options.editorProps)===null||e===void 0?void 0:e.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:Za.create({doc:n,selection:r||void 0})});const i=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(i),this.createNodeViews(),this.prependClass();const s=this.view.dom;s.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(a=>{var l;return(l=this.capturedTransaction)===null||l===void 0?void 0:l.step(a)});return}const n=this.state.apply(e),r=!this.state.selection.eq(n.selection);this.emit("beforeTransaction",{editor:this,transaction:e,nextState:n}),this.view.updateState(n),this.emit("transaction",{editor:this,transaction:e}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const i=e.getMeta("focus"),s=e.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:e}),s&&this.emit("blur",{editor:this,event:s.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return i4(this.state,e)}isActive(e,n){const r=typeof e=="string"?e:null,i=typeof e=="string"?n:e;return $0(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return B0(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:n=`
|
|
88
88
|
|
|
89
|
-
`,textSerializers:r={}}=e||{};return o4(this.state.doc,{blockSeparator:n,textSerializers:{...L0(this.schema),...r}})}get isEmpty(){return Qd(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){if(this.emit("destroy"),this.view){const e=this.view.dom;e&&e.editor&&delete e.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}$node(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(e,n))||null}$nodes(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(e,n))||null}$pos(e){const n=this.state.doc.resolve(e);return new Xs(n,this)}get $doc(){return this.$pos(0)}};function Ys(t){return new $d({find:t.find,handler:({state:e,range:n,match:r})=>{const i=pt(t.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:s}=e,a=r[r.length-1],l=r[0];if(a){const u=l.search(/\S/),c=n.from+l.indexOf(a),f=c+a.length;if(V0(n.from,n.to,e.doc).filter(g=>g.mark.type.excluded.find(b=>b===t.type&&b!==g.mark.type)).filter(g=>g.to>c).length)return null;f<n.to&&s.delete(f,n.to),c>n.from&&s.delete(n.from+u,c);const m=n.from+u+a.length;s.addMark(n.from+u,m,t.type.create(i||{})),s.removeStoredMark(t.type)}}})}function c4(t){return new $d({find:t.find,handler:({state:e,range:n,match:r})=>{const i=pt(t.getAttributes,void 0,r)||{},{tr:s}=e,a=n.from;let l=n.to;const u=t.type.create(i);if(r[1]){const c=r[0].lastIndexOf(r[1]);let f=a+c;f>l?f=l:l=f+r[1].length;const p=r[0][r[0].length-1];s.insertText(p,a+r[0].length-1),s.replaceWith(f,l,u)}else if(r[0]){const c=t.type.isInline?a:a-1;s.insert(c,t.type.create(i)).delete(s.mapping.map(a),s.mapping.map(l))}s.scrollIntoView()}})}function W0(t){return new $d({find:t.find,handler:({state:e,range:n,match:r})=>{const i=e.doc.resolve(n.from),s=pt(t.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,s)}})}function al(t){return new $d({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{const s=pt(t.getAttributes,void 0,r)||{},a=e.tr.delete(n.from,n.to),u=a.doc.resolve(n.from).blockRange(),c=u&&jm(u,t.type,s);if(!c)return null;if(a.wrap(u,c),t.keepMarks&&t.editor){const{selection:p,storedMarks:m}=e,{splittableMarks:g}=t.editor.extensionManager,v=m||p.$to.parentOffset&&p.$from.marks();if(v){const b=v.filter(w=>g.includes(w.type.name));a.ensureMarks(b)}}if(t.keepAttributes){const p=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(p,s).run()}const f=a.doc.resolve(n.from-1).nodeBefore;f&&f.type===t.type&&$i(a.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,f))&&a.join(n.from-1)}})}let Lt=class ay{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=pt(Fe(this,"addOptions",{name:this.name}))),this.storage=pt(Fe(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new ay(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Ud(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new ay(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=pt(Fe(n,"addOptions",{name:n.name})),n.storage=pt(Fe(n,"addStorage",{name:n.name,options:n.options})),n}};class yB{constructor(e,n,r){this.isDragging=!1,this.component=e,this.editor=n.editor,this.options={stopEvent:null,ignoreMutation:null,...r},this.extension=n.extension,this.node=n.node,this.decorations=n.decorations,this.innerDecorations=n.innerDecorations,this.view=n.view,this.HTMLAttributes=n.HTMLAttributes,this.getPos=n.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var n,r,i,s,a,l,u;const{view:c}=this.editor,f=e.target,p=f.nodeType===3?(n=f.parentElement)===null||n===void 0?void 0:n.closest("[data-drag-handle]"):f.closest("[data-drag-handle]");if(!this.dom||!((r=this.contentDOM)===null||r===void 0)&&r.contains(f)||!p)return;let m=0,g=0;if(this.dom!==p){const x=this.dom.getBoundingClientRect(),C=p.getBoundingClientRect(),E=(i=e.offsetX)!==null&&i!==void 0?i:(s=e.nativeEvent)===null||s===void 0?void 0:s.offsetX,k=(a=e.offsetY)!==null&&a!==void 0?a:(l=e.nativeEvent)===null||l===void 0?void 0:l.offsetY;m=C.x-x.x+E,g=C.y-x.y+k}(u=e.dataTransfer)===null||u===void 0||u.setDragImage(this.dom,m,g);const v=this.getPos();if(typeof v!="number")return;const b=Re.create(c.state.doc,v),w=c.state.tr.setSelection(b);c.dispatch(w)}stopEvent(e){var n;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:e});const r=e.target;if(!(this.dom.contains(r)&&!(!((n=this.contentDOM)===null||n===void 0)&&n.contains(r))))return!1;const s=e.type.startsWith("drag"),a=e.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(r.tagName)||r.isContentEditable)&&!a&&!s)return!0;const{isEditable:u}=this.editor,{isDragging:c}=this,f=!!this.node.type.spec.draggable,p=Re.isSelectable(this.node),m=e.type==="copy",g=e.type==="paste",v=e.type==="cut",b=e.type==="mousedown";if(!f&&p&&s&&e.target===this.dom&&e.preventDefault(),f&&s&&!c&&e.target===this.dom)return e.preventDefault(),!1;if(f&&u&&!c&&b){const w=r.closest("[data-drag-handle]");w&&(this.dom===w||this.dom.contains(w))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(c||a||m||g||v||b&&p)}ignoreMutation(e){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:e}):this.node.isLeaf||this.node.isAtom?!0:e.type==="selection"||this.dom.contains(e.target)&&e.type==="childList"&&(Gd()||Zw())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(r=>r.isContentEditable)?!1:this.contentDOM===e.target&&e.type==="attributes"?!0:!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command(({tr:n})=>{const r=this.getPos();return typeof r!="number"?!1:(n.setNodeMarkup(r,void 0,{...this.node.attrs,...e}),!0)})}deleteNode(){const e=this.getPos();if(typeof e!="number")return;const n=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:n})}}function Ji(t){return new NM({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{const s=pt(t.getAttributes,void 0,r,i);if(s===!1||s===null)return null;const{tr:a}=e,l=r[r.length-1],u=r[0];let c=n.to;if(l){const f=u.search(/\S/),p=n.from+u.indexOf(l),m=p+l.length;if(V0(n.from,n.to,e.doc).filter(v=>v.mark.type.excluded.find(w=>w===t.type&&w!==v.mark.type)).filter(v=>v.to>p).length)return null;m<n.to&&a.delete(m,n.to),p>n.from&&a.delete(n.from+f,p),c=n.from+f+l.length,a.addMark(n.from+f,c,t.type.create(s||{})),a.removeStoredMark(t.type)}}})}function wB(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}var rr="top",Pr="bottom",Vr="right",or="left",j0="auto",Lu=[rr,Pr,Vr,or],ll="start",Ru="end",xB="clippingParents",d4="viewport",Du="popper",CB="reference",f4=Lu.reduce(function(t,e){return t.concat([e+"-"+ll,e+"-"+Ru])},[]),p4=[].concat(Lu,[j0]).reduce(function(t,e){return t.concat([e,e+"-"+ll,e+"-"+Ru])},[]),kB="beforeRead",EB="read",SB="afterRead",_B="beforeMain",TB="main",AB="afterMain",MB="beforeWrite",OB="write",BB="afterWrite",IB=[kB,EB,SB,_B,TB,AB,MB,OB,BB];function To(t){return t?(t.nodeName||"").toLowerCase():null}function gr(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Js(t){var e=gr(t).Element;return t instanceof e||t instanceof Element}function Fr(t){var e=gr(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function q0(t){if(typeof ShadowRoot>"u")return!1;var e=gr(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function LB(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},s=e.elements[n];!Fr(s)||!To(s)||(Object.assign(s.style,r),Object.keys(i).forEach(function(a){var l=i[a];l===!1?s.removeAttribute(a):s.setAttribute(a,l===!0?"":l)}))})}function RB(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],s=e.attributes[r]||{},a=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),l=a.reduce(function(u,c){return u[c]="",u},{});!Fr(i)||!To(i)||(Object.assign(i.style,l),Object.keys(s).forEach(function(u){i.removeAttribute(u)}))})}}const h4={name:"applyStyles",enabled:!0,phase:"write",fn:LB,effect:RB,requires:["computeStyles"]};function Ao(t){return t.split("-")[0]}var Zs=Math.max,Nd=Math.min,ul=Math.round;function K0(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function m4(){return!/^((?!chrome|android).)*safari/i.test(K0())}function cl(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,s=1;e&&Fr(t)&&(i=t.offsetWidth>0&&ul(r.width)/t.offsetWidth||1,s=t.offsetHeight>0&&ul(r.height)/t.offsetHeight||1);var a=Js(t)?gr(t):window,l=a.visualViewport,u=!m4()&&n,c=(r.left+(u&&l?l.offsetLeft:0))/i,f=(r.top+(u&&l?l.offsetTop:0))/s,p=r.width/i,m=r.height/s;return{width:p,height:m,top:f,right:c+p,bottom:f+m,left:c,x:c,y:f}}function G0(t){var e=cl(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function g4(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&q0(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function li(t){return gr(t).getComputedStyle(t)}function DB(t){return["table","td","th"].indexOf(To(t))>=0}function Zi(t){return((Js(t)?t.ownerDocument:t.document)||window.document).documentElement}function ef(t){return To(t)==="html"?t:t.assignedSlot||t.parentNode||(q0(t)?t.host:null)||Zi(t)}function v4(t){return!Fr(t)||li(t).position==="fixed"?null:t.offsetParent}function PB(t){var e=/firefox/i.test(K0()),n=/Trident/i.test(K0());if(n&&Fr(t)){var r=li(t);if(r.position==="fixed")return null}var i=ef(t);for(q0(i)&&(i=i.host);Fr(i)&&["html","body"].indexOf(To(i))<0;){var s=li(i);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return i;i=i.parentNode}return null}function Pu(t){for(var e=gr(t),n=v4(t);n&&DB(n)&&li(n).position==="static";)n=v4(n);return n&&(To(n)==="html"||To(n)==="body"&&li(n).position==="static")?e:n||PB(t)||e}function X0(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Vu(t,e,n){return Zs(t,Nd(e,n))}function VB(t,e,n){var r=Vu(t,e,n);return r>n?n:r}function b4(){return{top:0,right:0,bottom:0,left:0}}function y4(t){return Object.assign({},b4(),t)}function w4(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var FB=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,y4(typeof e!="number"?e:w4(e,Lu))};function $B(t){var e,n=t.state,r=t.name,i=t.options,s=n.elements.arrow,a=n.modifiersData.popperOffsets,l=Ao(n.placement),u=X0(l),c=[or,Vr].indexOf(l)>=0,f=c?"height":"width";if(!(!s||!a)){var p=FB(i.padding,n),m=G0(s),g=u==="y"?rr:or,v=u==="y"?Pr:Vr,b=n.rects.reference[f]+n.rects.reference[u]-a[u]-n.rects.popper[f],w=a[u]-n.rects.reference[u],x=Pu(s),C=x?u==="y"?x.clientHeight||0:x.clientWidth||0:0,E=b/2-w/2,k=p[g],T=C-m[f]-p[v],_=C/2-m[f]/2+E,A=Vu(k,_,T),V=u;n.modifiersData[r]=(e={},e[V]=A,e.centerOffset=A-_,e)}}function HB(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||g4(e.elements.popper,i)&&(e.elements.arrow=i))}const zB={name:"arrow",enabled:!0,phase:"main",fn:$B,effect:HB,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function dl(t){return t.split("-")[1]}var UB={top:"auto",right:"auto",bottom:"auto",left:"auto"};function WB(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:ul(n*i)/i||0,y:ul(r*i)/i||0}}function x4(t){var e,n=t.popper,r=t.popperRect,i=t.placement,s=t.variation,a=t.offsets,l=t.position,u=t.gpuAcceleration,c=t.adaptive,f=t.roundOffsets,p=t.isFixed,m=a.x,g=m===void 0?0:m,v=a.y,b=v===void 0?0:v,w=typeof f=="function"?f({x:g,y:b}):{x:g,y:b};g=w.x,b=w.y;var x=a.hasOwnProperty("x"),C=a.hasOwnProperty("y"),E=or,k=rr,T=window;if(c){var _=Pu(n),A="clientHeight",V="clientWidth";if(_===gr(n)&&(_=Zi(n),li(_).position!=="static"&&l==="absolute"&&(A="scrollHeight",V="scrollWidth")),_=_,i===rr||(i===or||i===Vr)&&s===Ru){k=Pr;var O=p&&_===T&&T.visualViewport?T.visualViewport.height:_[A];b-=O-r.height,b*=u?1:-1}if(i===or||(i===rr||i===Pr)&&s===Ru){E=Vr;var B=p&&_===T&&T.visualViewport?T.visualViewport.width:_[V];g-=B-r.width,g*=u?1:-1}}var H=Object.assign({position:l},c&&UB),j=f===!0?WB({x:g,y:b},gr(n)):{x:g,y:b};if(g=j.x,b=j.y,u){var Y;return Object.assign({},H,(Y={},Y[k]=C?"0":"",Y[E]=x?"0":"",Y.transform=(T.devicePixelRatio||1)<=1?"translate("+g+"px, "+b+"px)":"translate3d("+g+"px, "+b+"px, 0)",Y))}return Object.assign({},H,(e={},e[k]=C?b+"px":"",e[E]=x?g+"px":"",e.transform="",e))}function jB(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,s=n.adaptive,a=s===void 0?!0:s,l=n.roundOffsets,u=l===void 0?!0:l,c={placement:Ao(e.placement),variation:dl(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,x4(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:u})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,x4(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const qB={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:jB,data:{}};var tf={passive:!0};function KB(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,s=i===void 0?!0:i,a=r.resize,l=a===void 0?!0:a,u=gr(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&c.forEach(function(f){f.addEventListener("scroll",n.update,tf)}),l&&u.addEventListener("resize",n.update,tf),function(){s&&c.forEach(function(f){f.removeEventListener("scroll",n.update,tf)}),l&&u.removeEventListener("resize",n.update,tf)}}const GB={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:KB,data:{}};var XB={left:"right",right:"left",bottom:"top",top:"bottom"};function nf(t){return t.replace(/left|right|bottom|top/g,function(e){return XB[e]})}var YB={start:"end",end:"start"};function C4(t){return t.replace(/start|end/g,function(e){return YB[e]})}function Y0(t){var e=gr(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function J0(t){return cl(Zi(t)).left+Y0(t).scrollLeft}function JB(t,e){var n=gr(t),r=Zi(t),i=n.visualViewport,s=r.clientWidth,a=r.clientHeight,l=0,u=0;if(i){s=i.width,a=i.height;var c=m4();(c||!c&&e==="fixed")&&(l=i.offsetLeft,u=i.offsetTop)}return{width:s,height:a,x:l+J0(t),y:u}}function ZB(t){var e,n=Zi(t),r=Y0(t),i=(e=t.ownerDocument)==null?void 0:e.body,s=Zs(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=Zs(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),l=-r.scrollLeft+J0(t),u=-r.scrollTop;return li(i||n).direction==="rtl"&&(l+=Zs(n.clientWidth,i?i.clientWidth:0)-s),{width:s,height:a,x:l,y:u}}function Z0(t){var e=li(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function k4(t){return["html","body","#document"].indexOf(To(t))>=0?t.ownerDocument.body:Fr(t)&&Z0(t)?t:k4(ef(t))}function Fu(t,e){var n;e===void 0&&(e=[]);var r=k4(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),s=gr(r),a=i?[s].concat(s.visualViewport||[],Z0(r)?r:[]):r,l=e.concat(a);return i?l:l.concat(Fu(ef(a)))}function Q0(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function QB(t,e){var n=cl(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function E4(t,e,n){return e===d4?Q0(JB(t,n)):Js(e)?QB(e,n):Q0(ZB(Zi(t)))}function NB(t){var e=Fu(ef(t)),n=["absolute","fixed"].indexOf(li(t).position)>=0,r=n&&Fr(t)?Pu(t):t;return Js(r)?e.filter(function(i){return Js(i)&&g4(i,r)&&To(i)!=="body"}):[]}function eI(t,e,n,r){var i=e==="clippingParents"?NB(t):[].concat(e),s=[].concat(i,[n]),a=s[0],l=s.reduce(function(u,c){var f=E4(t,c,r);return u.top=Zs(f.top,u.top),u.right=Nd(f.right,u.right),u.bottom=Nd(f.bottom,u.bottom),u.left=Zs(f.left,u.left),u},E4(t,a,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function S4(t){var e=t.reference,n=t.element,r=t.placement,i=r?Ao(r):null,s=r?dl(r):null,a=e.x+e.width/2-n.width/2,l=e.y+e.height/2-n.height/2,u;switch(i){case rr:u={x:a,y:e.y-n.height};break;case Pr:u={x:a,y:e.y+e.height};break;case Vr:u={x:e.x+e.width,y:l};break;case or:u={x:e.x-n.width,y:l};break;default:u={x:e.x,y:e.y}}var c=i?X0(i):null;if(c!=null){var f=c==="y"?"height":"width";switch(s){case ll:u[c]=u[c]-(e[f]/2-n[f]/2);break;case Ru:u[c]=u[c]+(e[f]/2-n[f]/2);break}}return u}function $u(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,s=n.strategy,a=s===void 0?t.strategy:s,l=n.boundary,u=l===void 0?xB:l,c=n.rootBoundary,f=c===void 0?d4:c,p=n.elementContext,m=p===void 0?Du:p,g=n.altBoundary,v=g===void 0?!1:g,b=n.padding,w=b===void 0?0:b,x=y4(typeof w!="number"?w:w4(w,Lu)),C=m===Du?CB:Du,E=t.rects.popper,k=t.elements[v?C:m],T=eI(Js(k)?k:k.contextElement||Zi(t.elements.popper),u,f,a),_=cl(t.elements.reference),A=S4({reference:_,element:E,placement:i}),V=Q0(Object.assign({},E,A)),O=m===Du?V:_,B={top:T.top-O.top+x.top,bottom:O.bottom-T.bottom+x.bottom,left:T.left-O.left+x.left,right:O.right-T.right+x.right},H=t.modifiersData.offset;if(m===Du&&H){var j=H[i];Object.keys(B).forEach(function(Y){var N=[Vr,Pr].indexOf(Y)>=0?1:-1,U=[rr,Pr].indexOf(Y)>=0?"y":"x";B[Y]+=j[U]*N})}return B}function tI(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,s=n.rootBoundary,a=n.padding,l=n.flipVariations,u=n.allowedAutoPlacements,c=u===void 0?p4:u,f=dl(r),p=f?l?f4:f4.filter(function(v){return dl(v)===f}):Lu,m=p.filter(function(v){return c.indexOf(v)>=0});m.length===0&&(m=p);var g=m.reduce(function(v,b){return v[b]=$u(t,{placement:b,boundary:i,rootBoundary:s,padding:a})[Ao(b)],v},{});return Object.keys(g).sort(function(v,b){return g[v]-g[b]})}function nI(t){if(Ao(t)===j0)return[];var e=nf(t);return[C4(t),e,C4(e)]}function rI(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,s=i===void 0?!0:i,a=n.altAxis,l=a===void 0?!0:a,u=n.fallbackPlacements,c=n.padding,f=n.boundary,p=n.rootBoundary,m=n.altBoundary,g=n.flipVariations,v=g===void 0?!0:g,b=n.allowedAutoPlacements,w=e.options.placement,x=Ao(w),C=x===w,E=u||(C||!v?[nf(w)]:nI(w)),k=[w].concat(E).reduce(function(Ee,ie){return Ee.concat(Ao(ie)===j0?tI(e,{placement:ie,boundary:f,rootBoundary:p,padding:c,flipVariations:v,allowedAutoPlacements:b}):ie)},[]),T=e.rects.reference,_=e.rects.popper,A=new Map,V=!0,O=k[0],B=0;B<k.length;B++){var H=k[B],j=Ao(H),Y=dl(H)===ll,N=[rr,Pr].indexOf(j)>=0,U=N?"width":"height",P=$u(e,{placement:H,boundary:f,rootBoundary:p,altBoundary:m,padding:c}),L=N?Y?Vr:or:Y?Pr:rr;T[U]>_[U]&&(L=nf(L));var F=nf(L),R=[];if(s&&R.push(P[j]<=0),l&&R.push(P[L]<=0,P[F]<=0),R.every(function(Ee){return Ee})){O=H,V=!1;break}A.set(H,R)}if(V)for(var K=v?3:1,X=function(ie){var me=k.find(function(J){var ee=A.get(J);if(ee)return ee.slice(0,ie).every(function(te){return te})});if(me)return O=me,"break"},ae=K;ae>0;ae--){var de=X(ae);if(de==="break")break}e.placement!==O&&(e.modifiersData[r]._skip=!0,e.placement=O,e.reset=!0)}}const oI={name:"flip",enabled:!0,phase:"main",fn:rI,requiresIfExists:["offset"],data:{_skip:!1}};function _4(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function T4(t){return[rr,Vr,Pr,or].some(function(e){return t[e]>=0})}function iI(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,s=e.modifiersData.preventOverflow,a=$u(e,{elementContext:"reference"}),l=$u(e,{altBoundary:!0}),u=_4(a,r),c=_4(l,i,s),f=T4(u),p=T4(c);e.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:c,isReferenceHidden:f,hasPopperEscaped:p},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":p})}const sI={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:iI};function aI(t,e,n){var r=Ao(t),i=[or,rr].indexOf(r)>=0?-1:1,s=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,a=s[0],l=s[1];return a=a||0,l=(l||0)*i,[or,Vr].indexOf(r)>=0?{x:l,y:a}:{x:a,y:l}}function lI(t){var e=t.state,n=t.options,r=t.name,i=n.offset,s=i===void 0?[0,0]:i,a=p4.reduce(function(f,p){return f[p]=aI(p,e.rects,s),f},{}),l=a[e.placement],u=l.x,c=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=u,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=a}const uI={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:lI};function cI(t){var e=t.state,n=t.name;e.modifiersData[n]=S4({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}const dI={name:"popperOffsets",enabled:!0,phase:"read",fn:cI,data:{}};function fI(t){return t==="x"?"y":"x"}function pI(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,s=i===void 0?!0:i,a=n.altAxis,l=a===void 0?!1:a,u=n.boundary,c=n.rootBoundary,f=n.altBoundary,p=n.padding,m=n.tether,g=m===void 0?!0:m,v=n.tetherOffset,b=v===void 0?0:v,w=$u(e,{boundary:u,rootBoundary:c,padding:p,altBoundary:f}),x=Ao(e.placement),C=dl(e.placement),E=!C,k=X0(x),T=fI(k),_=e.modifiersData.popperOffsets,A=e.rects.reference,V=e.rects.popper,O=typeof b=="function"?b(Object.assign({},e.rects,{placement:e.placement})):b,B=typeof O=="number"?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),H=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,j={x:0,y:0};if(_){if(s){var Y,N=k==="y"?rr:or,U=k==="y"?Pr:Vr,P=k==="y"?"height":"width",L=_[k],F=L+w[N],R=L-w[U],K=g?-V[P]/2:0,X=C===ll?A[P]:V[P],ae=C===ll?-V[P]:-A[P],de=e.elements.arrow,Ee=g&&de?G0(de):{width:0,height:0},ie=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:b4(),me=ie[N],J=ie[U],ee=Vu(0,A[P],Ee[P]),te=E?A[P]/2-K-ee-me-B.mainAxis:X-ee-me-B.mainAxis,se=E?-A[P]/2+K+ee+J+B.mainAxis:ae+ee+J+B.mainAxis,pe=e.elements.arrow&&Pu(e.elements.arrow),_e=pe?k==="y"?pe.clientTop||0:pe.clientLeft||0:0,Ae=(Y=H?.[k])!=null?Y:0,Ue=L+te-Ae-_e,We=L+se-Ae,qe=Vu(g?Nd(F,Ue):F,L,g?Zs(R,We):R);_[k]=qe,j[k]=qe-L}if(l){var At,q=k==="x"?rr:or,z=k==="x"?Pr:Vr,he=_[T],xe=T==="y"?"height":"width",Pe=he+w[q],nt=he-w[z],Ke=[rr,or].indexOf(x)!==-1,$=(At=H?.[T])!=null?At:0,ne=Ke?Pe:he-A[xe]-V[xe]-$+B.altAxis,oe=Ke?he+A[xe]+V[xe]-$-B.altAxis:nt,we=g&&Ke?VB(ne,he,oe):Vu(g?ne:Pe,he,g?oe:nt);_[T]=we,j[T]=we-he}e.modifiersData[r]=j}}const hI={name:"preventOverflow",enabled:!0,phase:"main",fn:pI,requiresIfExists:["offset"]};function mI(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function gI(t){return t===gr(t)||!Fr(t)?Y0(t):mI(t)}function vI(t){var e=t.getBoundingClientRect(),n=ul(e.width)/t.offsetWidth||1,r=ul(e.height)/t.offsetHeight||1;return n!==1||r!==1}function bI(t,e,n){n===void 0&&(n=!1);var r=Fr(e),i=Fr(e)&&vI(e),s=Zi(e),a=cl(t,i,n),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&((To(e)!=="body"||Z0(s))&&(l=gI(e)),Fr(e)?(u=cl(e,!0),u.x+=e.clientLeft,u.y+=e.clientTop):s&&(u.x=J0(s))),{x:a.left+l.scrollLeft-u.x,y:a.top+l.scrollTop-u.y,width:a.width,height:a.height}}function yI(t){var e=new Map,n=new Set,r=[];t.forEach(function(s){e.set(s.name,s)});function i(s){n.add(s.name);var a=[].concat(s.requires||[],s.requiresIfExists||[]);a.forEach(function(l){if(!n.has(l)){var u=e.get(l);u&&i(u)}}),r.push(s)}return t.forEach(function(s){n.has(s.name)||i(s)}),r}function wI(t){var e=yI(t);return IB.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function xI(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function CI(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var A4={placement:"bottom",modifiers:[],strategy:"absolute"};function M4(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function kI(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,i=e.defaultOptions,s=i===void 0?A4:i;return function(l,u,c){c===void 0&&(c=s);var f={placement:"bottom",orderedModifiers:[],options:Object.assign({},A4,s),modifiersData:{},elements:{reference:l,popper:u},attributes:{},styles:{}},p=[],m=!1,g={state:f,setOptions:function(x){var C=typeof x=="function"?x(f.options):x;b(),f.options=Object.assign({},s,f.options,C),f.scrollParents={reference:Js(l)?Fu(l):l.contextElement?Fu(l.contextElement):[],popper:Fu(u)};var E=wI(CI([].concat(r,f.options.modifiers)));return f.orderedModifiers=E.filter(function(k){return k.enabled}),v(),g.update()},forceUpdate:function(){if(!m){var x=f.elements,C=x.reference,E=x.popper;if(M4(C,E)){f.rects={reference:bI(C,Pu(E),f.options.strategy==="fixed"),popper:G0(E)},f.reset=!1,f.placement=f.options.placement,f.orderedModifiers.forEach(function(B){return f.modifiersData[B.name]=Object.assign({},B.data)});for(var k=0;k<f.orderedModifiers.length;k++){if(f.reset===!0){f.reset=!1,k=-1;continue}var T=f.orderedModifiers[k],_=T.fn,A=T.options,V=A===void 0?{}:A,O=T.name;typeof _=="function"&&(f=_({state:f,options:V,name:O,instance:g})||f)}}}},update:xI(function(){return new Promise(function(w){g.forceUpdate(),w(f)})}),destroy:function(){b(),m=!0}};if(!M4(l,u))return g;g.setOptions(c).then(function(w){!m&&c.onFirstUpdate&&c.onFirstUpdate(w)});function v(){f.orderedModifiers.forEach(function(w){var x=w.name,C=w.options,E=C===void 0?{}:C,k=w.effect;if(typeof k=="function"){var T=k({state:f,name:x,instance:g,options:E}),_=function(){};p.push(T||_)}})}function b(){p.forEach(function(w){return w()}),p=[]}return g}}var EI=[GB,dI,qB,h4,uI,oI,hI,zB,sI],SI=kI({defaultModifiers:EI}),_I="tippy-box",O4="tippy-content",TI="tippy-backdrop",B4="tippy-arrow",I4="tippy-svg-arrow",Qs={passive:!0,capture:!0},L4=function(){return document.body};function AI(t,e){return{}.hasOwnProperty.call(t,e)}function N0(t,e,n){if(Array.isArray(t)){var r=t[e];return r??(Array.isArray(n)?n[e]:n)}return t}function eg(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function R4(t,e){return typeof t=="function"?t.apply(void 0,e):t}function D4(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function MI(t,e){var n=Object.assign({},t);return e.forEach(function(r){delete n[r]}),n}function OI(t){return t.split(/\s+/).filter(Boolean)}function fl(t){return[].concat(t)}function P4(t,e){t.indexOf(e)===-1&&t.push(e)}function BI(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function II(t){return t.split("-")[0]}function rf(t){return[].slice.call(t)}function V4(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function Hu(){return document.createElement("div")}function zu(t){return["Element","Fragment"].some(function(e){return eg(t,e)})}function LI(t){return eg(t,"NodeList")}function RI(t){return eg(t,"MouseEvent")}function DI(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function PI(t){return zu(t)?[t]:LI(t)?rf(t):Array.isArray(t)?t:rf(document.querySelectorAll(t))}function tg(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function F4(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function VI(t){var e,n=fl(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function FI(t,e){var n=e.clientX,r=e.clientY;return t.every(function(i){var s=i.popperRect,a=i.popperState,l=i.props,u=l.interactiveBorder,c=II(a.placement),f=a.modifiersData.offset;if(!f)return!0;var p=c==="bottom"?f.top.y:0,m=c==="top"?f.bottom.y:0,g=c==="right"?f.left.x:0,v=c==="left"?f.right.x:0,b=s.top-r+p>u,w=r-s.bottom-m>u,x=s.left-n+g>u,C=n-s.right-v>u;return b||w||x||C})}function ng(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){t[r](i,n)})}function $4(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var Mo={isTouch:!1},H4=0;function $I(){Mo.isTouch||(Mo.isTouch=!0,window.performance&&document.addEventListener("mousemove",z4))}function z4(){var t=performance.now();t-H4<20&&(Mo.isTouch=!1,document.removeEventListener("mousemove",z4)),H4=t}function HI(){var t=document.activeElement;if(DI(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function zI(){document.addEventListener("touchstart",$I,Qs),window.addEventListener("blur",HI)}var UI=typeof window<"u"&&typeof document<"u",WI=UI?!!window.msCrypto:!1;function pl(t){var e=t==="destroy"?"n already-":" ";return[t+"() was called on a"+e+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function U4(t){var e=/[ \t]{2,}/g,n=/^[ \t]*/gm;return t.replace(e," ").replace(n,"").trim()}function jI(t){return U4(`
|
|
89
|
+
`,textSerializers:r={}}=e||{};return o4(this.state.doc,{blockSeparator:n,textSerializers:{...L0(this.schema),...r}})}get isEmpty(){return Qd(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){if(this.emit("destroy"),this.view){const e=this.view.dom;e&&e.editor&&delete e.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}$node(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(e,n))||null}$nodes(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(e,n))||null}$pos(e){const n=this.state.doc.resolve(e);return new Xs(n,this)}get $doc(){return this.$pos(0)}};function Ys(t){return new $d({find:t.find,handler:({state:e,range:n,match:r})=>{const i=pt(t.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:s}=e,a=r[r.length-1],l=r[0];if(a){const u=l.search(/\S/),c=n.from+l.indexOf(a),f=c+a.length;if(V0(n.from,n.to,e.doc).filter(g=>g.mark.type.excluded.find(b=>b===t.type&&b!==g.mark.type)).filter(g=>g.to>c).length)return null;f<n.to&&s.delete(f,n.to),c>n.from&&s.delete(n.from+u,c);const m=n.from+u+a.length;s.addMark(n.from+u,m,t.type.create(i||{})),s.removeStoredMark(t.type)}}})}function c4(t){return new $d({find:t.find,handler:({state:e,range:n,match:r})=>{const i=pt(t.getAttributes,void 0,r)||{},{tr:s}=e,a=n.from;let l=n.to;const u=t.type.create(i);if(r[1]){const c=r[0].lastIndexOf(r[1]);let f=a+c;f>l?f=l:l=f+r[1].length;const p=r[0][r[0].length-1];s.insertText(p,a+r[0].length-1),s.replaceWith(f,l,u)}else if(r[0]){const c=t.type.isInline?a:a-1;s.insert(c,t.type.create(i)).delete(s.mapping.map(a),s.mapping.map(l))}s.scrollIntoView()}})}function W0(t){return new $d({find:t.find,handler:({state:e,range:n,match:r})=>{const i=e.doc.resolve(n.from),s=pt(t.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,s)}})}function al(t){return new $d({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{const s=pt(t.getAttributes,void 0,r)||{},a=e.tr.delete(n.from,n.to),u=a.doc.resolve(n.from).blockRange(),c=u&&jm(u,t.type,s);if(!c)return null;if(a.wrap(u,c),t.keepMarks&&t.editor){const{selection:p,storedMarks:m}=e,{splittableMarks:g}=t.editor.extensionManager,v=m||p.$to.parentOffset&&p.$from.marks();if(v){const b=v.filter(w=>g.includes(w.type.name));a.ensureMarks(b)}}if(t.keepAttributes){const p=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(p,s).run()}const f=a.doc.resolve(n.from-1).nodeBefore;f&&f.type===t.type&&$i(a.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,f))&&a.join(n.from-1)}})}let Lt=class ay{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=pt(Fe(this,"addOptions",{name:this.name}))),this.storage=pt(Fe(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new ay(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Ud(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new ay(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=pt(Fe(n,"addOptions",{name:n.name})),n.storage=pt(Fe(n,"addStorage",{name:n.name,options:n.options})),n}};class yB{constructor(e,n,r){this.isDragging=!1,this.component=e,this.editor=n.editor,this.options={stopEvent:null,ignoreMutation:null,...r},this.extension=n.extension,this.node=n.node,this.decorations=n.decorations,this.innerDecorations=n.innerDecorations,this.view=n.view,this.HTMLAttributes=n.HTMLAttributes,this.getPos=n.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var n,r,i,s,a,l,u;const{view:c}=this.editor,f=e.target,p=f.nodeType===3?(n=f.parentElement)===null||n===void 0?void 0:n.closest("[data-drag-handle]"):f.closest("[data-drag-handle]");if(!this.dom||!((r=this.contentDOM)===null||r===void 0)&&r.contains(f)||!p)return;let m=0,g=0;if(this.dom!==p){const x=this.dom.getBoundingClientRect(),C=p.getBoundingClientRect(),E=(i=e.offsetX)!==null&&i!==void 0?i:(s=e.nativeEvent)===null||s===void 0?void 0:s.offsetX,k=(a=e.offsetY)!==null&&a!==void 0?a:(l=e.nativeEvent)===null||l===void 0?void 0:l.offsetY;m=C.x-x.x+E,g=C.y-x.y+k}(u=e.dataTransfer)===null||u===void 0||u.setDragImage(this.dom,m,g);const v=this.getPos();if(typeof v!="number")return;const b=Re.create(c.state.doc,v),w=c.state.tr.setSelection(b);c.dispatch(w)}stopEvent(e){var n;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:e});const r=e.target;if(!(this.dom.contains(r)&&!(!((n=this.contentDOM)===null||n===void 0)&&n.contains(r))))return!1;const s=e.type.startsWith("drag"),a=e.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(r.tagName)||r.isContentEditable)&&!a&&!s)return!0;const{isEditable:u}=this.editor,{isDragging:c}=this,f=!!this.node.type.spec.draggable,p=Re.isSelectable(this.node),m=e.type==="copy",g=e.type==="paste",v=e.type==="cut",b=e.type==="mousedown";if(!f&&p&&s&&e.target===this.dom&&e.preventDefault(),f&&s&&!c&&e.target===this.dom)return e.preventDefault(),!1;if(f&&u&&!c&&b){const w=r.closest("[data-drag-handle]");w&&(this.dom===w||this.dom.contains(w))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(c||a||m||g||v||b&&p)}ignoreMutation(e){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:e}):this.node.isLeaf||this.node.isAtom?!0:e.type==="selection"||this.dom.contains(e.target)&&e.type==="childList"&&(Gd()||Zw())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(r=>r.isContentEditable)?!1:this.contentDOM===e.target&&e.type==="attributes"?!0:!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command(({tr:n})=>{const r=this.getPos();return typeof r!="number"?!1:(n.setNodeMarkup(r,void 0,{...this.node.attrs,...e}),!0)})}deleteNode(){const e=this.getPos();if(typeof e!="number")return;const n=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:n})}}function Ji(t){return new NM({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{const s=pt(t.getAttributes,void 0,r,i);if(s===!1||s===null)return null;const{tr:a}=e,l=r[r.length-1],u=r[0];let c=n.to;if(l){const f=u.search(/\S/),p=n.from+u.indexOf(l),m=p+l.length;if(V0(n.from,n.to,e.doc).filter(v=>v.mark.type.excluded.find(w=>w===t.type&&w!==v.mark.type)).filter(v=>v.to>p).length)return null;m<n.to&&a.delete(m,n.to),p>n.from&&a.delete(n.from+f,p),c=n.from+f+l.length,a.addMark(n.from+f,c,t.type.create(s||{})),a.removeStoredMark(t.type)}}})}function wB(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}var rr="top",Pr="bottom",Vr="right",or="left",j0="auto",Lu=[rr,Pr,Vr,or],ll="start",Ru="end",xB="clippingParents",d4="viewport",Du="popper",CB="reference",f4=Lu.reduce(function(t,e){return t.concat([e+"-"+ll,e+"-"+Ru])},[]),p4=[].concat(Lu,[j0]).reduce(function(t,e){return t.concat([e,e+"-"+ll,e+"-"+Ru])},[]),kB="beforeRead",EB="read",SB="afterRead",_B="beforeMain",TB="main",AB="afterMain",MB="beforeWrite",OB="write",BB="afterWrite",IB=[kB,EB,SB,_B,TB,AB,MB,OB,BB];function To(t){return t?(t.nodeName||"").toLowerCase():null}function gr(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Js(t){var e=gr(t).Element;return t instanceof e||t instanceof Element}function Fr(t){var e=gr(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function q0(t){if(typeof ShadowRoot>"u")return!1;var e=gr(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function LB(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},s=e.elements[n];!Fr(s)||!To(s)||(Object.assign(s.style,r),Object.keys(i).forEach(function(a){var l=i[a];l===!1?s.removeAttribute(a):s.setAttribute(a,l===!0?"":l)}))})}function RB(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],s=e.attributes[r]||{},a=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),l=a.reduce(function(u,c){return u[c]="",u},{});!Fr(i)||!To(i)||(Object.assign(i.style,l),Object.keys(s).forEach(function(u){i.removeAttribute(u)}))})}}const h4={name:"applyStyles",enabled:!0,phase:"write",fn:LB,effect:RB,requires:["computeStyles"]};function Ao(t){return t.split("-")[0]}var Zs=Math.max,Nd=Math.min,ul=Math.round;function K0(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function m4(){return!/^((?!chrome|android).)*safari/i.test(K0())}function cl(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,s=1;e&&Fr(t)&&(i=t.offsetWidth>0&&ul(r.width)/t.offsetWidth||1,s=t.offsetHeight>0&&ul(r.height)/t.offsetHeight||1);var a=Js(t)?gr(t):window,l=a.visualViewport,u=!m4()&&n,c=(r.left+(u&&l?l.offsetLeft:0))/i,f=(r.top+(u&&l?l.offsetTop:0))/s,p=r.width/i,m=r.height/s;return{width:p,height:m,top:f,right:c+p,bottom:f+m,left:c,x:c,y:f}}function G0(t){var e=cl(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function g4(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&q0(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function li(t){return gr(t).getComputedStyle(t)}function DB(t){return["table","td","th"].indexOf(To(t))>=0}function Zi(t){return((Js(t)?t.ownerDocument:t.document)||window.document).documentElement}function ef(t){return To(t)==="html"?t:t.assignedSlot||t.parentNode||(q0(t)?t.host:null)||Zi(t)}function v4(t){return!Fr(t)||li(t).position==="fixed"?null:t.offsetParent}function PB(t){var e=/firefox/i.test(K0()),n=/Trident/i.test(K0());if(n&&Fr(t)){var r=li(t);if(r.position==="fixed")return null}var i=ef(t);for(q0(i)&&(i=i.host);Fr(i)&&["html","body"].indexOf(To(i))<0;){var s=li(i);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return i;i=i.parentNode}return null}function Pu(t){for(var e=gr(t),n=v4(t);n&&DB(n)&&li(n).position==="static";)n=v4(n);return n&&(To(n)==="html"||To(n)==="body"&&li(n).position==="static")?e:n||PB(t)||e}function X0(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Vu(t,e,n){return Zs(t,Nd(e,n))}function VB(t,e,n){var r=Vu(t,e,n);return r>n?n:r}function b4(){return{top:0,right:0,bottom:0,left:0}}function y4(t){return Object.assign({},b4(),t)}function w4(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var FB=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,y4(typeof e!="number"?e:w4(e,Lu))};function $B(t){var e,n=t.state,r=t.name,i=t.options,s=n.elements.arrow,a=n.modifiersData.popperOffsets,l=Ao(n.placement),u=X0(l),c=[or,Vr].indexOf(l)>=0,f=c?"height":"width";if(!(!s||!a)){var p=FB(i.padding,n),m=G0(s),g=u==="y"?rr:or,v=u==="y"?Pr:Vr,b=n.rects.reference[f]+n.rects.reference[u]-a[u]-n.rects.popper[f],w=a[u]-n.rects.reference[u],x=Pu(s),C=x?u==="y"?x.clientHeight||0:x.clientWidth||0:0,E=b/2-w/2,k=p[g],T=C-m[f]-p[v],_=C/2-m[f]/2+E,A=Vu(k,_,T),V=u;n.modifiersData[r]=(e={},e[V]=A,e.centerOffset=A-_,e)}}function HB(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||g4(e.elements.popper,i)&&(e.elements.arrow=i))}const zB={name:"arrow",enabled:!0,phase:"main",fn:$B,effect:HB,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function dl(t){return t.split("-")[1]}var UB={top:"auto",right:"auto",bottom:"auto",left:"auto"};function WB(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:ul(n*i)/i||0,y:ul(r*i)/i||0}}function x4(t){var e,n=t.popper,r=t.popperRect,i=t.placement,s=t.variation,a=t.offsets,l=t.position,u=t.gpuAcceleration,c=t.adaptive,f=t.roundOffsets,p=t.isFixed,m=a.x,g=m===void 0?0:m,v=a.y,b=v===void 0?0:v,w=typeof f=="function"?f({x:g,y:b}):{x:g,y:b};g=w.x,b=w.y;var x=a.hasOwnProperty("x"),C=a.hasOwnProperty("y"),E=or,k=rr,T=window;if(c){var _=Pu(n),A="clientHeight",V="clientWidth";if(_===gr(n)&&(_=Zi(n),li(_).position!=="static"&&l==="absolute"&&(A="scrollHeight",V="scrollWidth")),_=_,i===rr||(i===or||i===Vr)&&s===Ru){k=Pr;var O=p&&_===T&&T.visualViewport?T.visualViewport.height:_[A];b-=O-r.height,b*=u?1:-1}if(i===or||(i===rr||i===Pr)&&s===Ru){E=Vr;var B=p&&_===T&&T.visualViewport?T.visualViewport.width:_[V];g-=B-r.width,g*=u?1:-1}}var H=Object.assign({position:l},c&&UB),j=f===!0?WB({x:g,y:b},gr(n)):{x:g,y:b};if(g=j.x,b=j.y,u){var Y;return Object.assign({},H,(Y={},Y[k]=C?"0":"",Y[E]=x?"0":"",Y.transform=(T.devicePixelRatio||1)<=1?"translate("+g+"px, "+b+"px)":"translate3d("+g+"px, "+b+"px, 0)",Y))}return Object.assign({},H,(e={},e[k]=C?b+"px":"",e[E]=x?g+"px":"",e.transform="",e))}function jB(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,s=n.adaptive,a=s===void 0?!0:s,l=n.roundOffsets,u=l===void 0?!0:l,c={placement:Ao(e.placement),variation:dl(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,x4(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:u})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,x4(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const qB={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:jB,data:{}};var tf={passive:!0};function KB(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,s=i===void 0?!0:i,a=r.resize,l=a===void 0?!0:a,u=gr(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&c.forEach(function(f){f.addEventListener("scroll",n.update,tf)}),l&&u.addEventListener("resize",n.update,tf),function(){s&&c.forEach(function(f){f.removeEventListener("scroll",n.update,tf)}),l&&u.removeEventListener("resize",n.update,tf)}}const GB={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:KB,data:{}};var XB={left:"right",right:"left",bottom:"top",top:"bottom"};function nf(t){return t.replace(/left|right|bottom|top/g,function(e){return XB[e]})}var YB={start:"end",end:"start"};function C4(t){return t.replace(/start|end/g,function(e){return YB[e]})}function Y0(t){var e=gr(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function J0(t){return cl(Zi(t)).left+Y0(t).scrollLeft}function JB(t,e){var n=gr(t),r=Zi(t),i=n.visualViewport,s=r.clientWidth,a=r.clientHeight,l=0,u=0;if(i){s=i.width,a=i.height;var c=m4();(c||!c&&e==="fixed")&&(l=i.offsetLeft,u=i.offsetTop)}return{width:s,height:a,x:l+J0(t),y:u}}function ZB(t){var e,n=Zi(t),r=Y0(t),i=(e=t.ownerDocument)==null?void 0:e.body,s=Zs(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=Zs(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),l=-r.scrollLeft+J0(t),u=-r.scrollTop;return li(i||n).direction==="rtl"&&(l+=Zs(n.clientWidth,i?i.clientWidth:0)-s),{width:s,height:a,x:l,y:u}}function Z0(t){var e=li(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function k4(t){return["html","body","#document"].indexOf(To(t))>=0?t.ownerDocument.body:Fr(t)&&Z0(t)?t:k4(ef(t))}function Fu(t,e){var n;e===void 0&&(e=[]);var r=k4(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),s=gr(r),a=i?[s].concat(s.visualViewport||[],Z0(r)?r:[]):r,l=e.concat(a);return i?l:l.concat(Fu(ef(a)))}function Q0(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function QB(t,e){var n=cl(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function E4(t,e,n){return e===d4?Q0(JB(t,n)):Js(e)?QB(e,n):Q0(ZB(Zi(t)))}function NB(t){var e=Fu(ef(t)),n=["absolute","fixed"].indexOf(li(t).position)>=0,r=n&&Fr(t)?Pu(t):t;return Js(r)?e.filter(function(i){return Js(i)&&g4(i,r)&&To(i)!=="body"}):[]}function eI(t,e,n,r){var i=e==="clippingParents"?NB(t):[].concat(e),s=[].concat(i,[n]),a=s[0],l=s.reduce(function(u,c){var f=E4(t,c,r);return u.top=Zs(f.top,u.top),u.right=Nd(f.right,u.right),u.bottom=Nd(f.bottom,u.bottom),u.left=Zs(f.left,u.left),u},E4(t,a,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function S4(t){var e=t.reference,n=t.element,r=t.placement,i=r?Ao(r):null,s=r?dl(r):null,a=e.x+e.width/2-n.width/2,l=e.y+e.height/2-n.height/2,u;switch(i){case rr:u={x:a,y:e.y-n.height};break;case Pr:u={x:a,y:e.y+e.height};break;case Vr:u={x:e.x+e.width,y:l};break;case or:u={x:e.x-n.width,y:l};break;default:u={x:e.x,y:e.y}}var c=i?X0(i):null;if(c!=null){var f=c==="y"?"height":"width";switch(s){case ll:u[c]=u[c]-(e[f]/2-n[f]/2);break;case Ru:u[c]=u[c]+(e[f]/2-n[f]/2);break}}return u}function $u(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,s=n.strategy,a=s===void 0?t.strategy:s,l=n.boundary,u=l===void 0?xB:l,c=n.rootBoundary,f=c===void 0?d4:c,p=n.elementContext,m=p===void 0?Du:p,g=n.altBoundary,v=g===void 0?!1:g,b=n.padding,w=b===void 0?0:b,x=y4(typeof w!="number"?w:w4(w,Lu)),C=m===Du?CB:Du,E=t.rects.popper,k=t.elements[v?C:m],T=eI(Js(k)?k:k.contextElement||Zi(t.elements.popper),u,f,a),_=cl(t.elements.reference),A=S4({reference:_,element:E,placement:i}),V=Q0(Object.assign({},E,A)),O=m===Du?V:_,B={top:T.top-O.top+x.top,bottom:O.bottom-T.bottom+x.bottom,left:T.left-O.left+x.left,right:O.right-T.right+x.right},H=t.modifiersData.offset;if(m===Du&&H){var j=H[i];Object.keys(B).forEach(function(Y){var N=[Vr,Pr].indexOf(Y)>=0?1:-1,U=[rr,Pr].indexOf(Y)>=0?"y":"x";B[Y]+=j[U]*N})}return B}function tI(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,s=n.rootBoundary,a=n.padding,l=n.flipVariations,u=n.allowedAutoPlacements,c=u===void 0?p4:u,f=dl(r),p=f?l?f4:f4.filter(function(v){return dl(v)===f}):Lu,m=p.filter(function(v){return c.indexOf(v)>=0});m.length===0&&(m=p);var g=m.reduce(function(v,b){return v[b]=$u(t,{placement:b,boundary:i,rootBoundary:s,padding:a})[Ao(b)],v},{});return Object.keys(g).sort(function(v,b){return g[v]-g[b]})}function nI(t){if(Ao(t)===j0)return[];var e=nf(t);return[C4(t),e,C4(e)]}function rI(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,s=i===void 0?!0:i,a=n.altAxis,l=a===void 0?!0:a,u=n.fallbackPlacements,c=n.padding,f=n.boundary,p=n.rootBoundary,m=n.altBoundary,g=n.flipVariations,v=g===void 0?!0:g,b=n.allowedAutoPlacements,w=e.options.placement,x=Ao(w),C=x===w,E=u||(C||!v?[nf(w)]:nI(w)),k=[w].concat(E).reduce(function(Ee,ie){return Ee.concat(Ao(ie)===j0?tI(e,{placement:ie,boundary:f,rootBoundary:p,padding:c,flipVariations:v,allowedAutoPlacements:b}):ie)},[]),T=e.rects.reference,_=e.rects.popper,A=new Map,V=!0,O=k[0],B=0;B<k.length;B++){var H=k[B],j=Ao(H),Y=dl(H)===ll,N=[rr,Pr].indexOf(j)>=0,U=N?"width":"height",P=$u(e,{placement:H,boundary:f,rootBoundary:p,altBoundary:m,padding:c}),L=N?Y?Vr:or:Y?Pr:rr;T[U]>_[U]&&(L=nf(L));var F=nf(L),R=[];if(s&&R.push(P[j]<=0),l&&R.push(P[L]<=0,P[F]<=0),R.every(function(Ee){return Ee})){O=H,V=!1;break}A.set(H,R)}if(V)for(var K=v?3:1,X=function(ie){var me=k.find(function(J){var ee=A.get(J);if(ee)return ee.slice(0,ie).every(function(te){return te})});if(me)return O=me,"break"},ae=K;ae>0;ae--){var de=X(ae);if(de==="break")break}e.placement!==O&&(e.modifiersData[r]._skip=!0,e.placement=O,e.reset=!0)}}const oI={name:"flip",enabled:!0,phase:"main",fn:rI,requiresIfExists:["offset"],data:{_skip:!1}};function _4(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function T4(t){return[rr,Vr,Pr,or].some(function(e){return t[e]>=0})}function iI(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,s=e.modifiersData.preventOverflow,a=$u(e,{elementContext:"reference"}),l=$u(e,{altBoundary:!0}),u=_4(a,r),c=_4(l,i,s),f=T4(u),p=T4(c);e.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:c,isReferenceHidden:f,hasPopperEscaped:p},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":p})}const sI={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:iI};function aI(t,e,n){var r=Ao(t),i=[or,rr].indexOf(r)>=0?-1:1,s=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,a=s[0],l=s[1];return a=a||0,l=(l||0)*i,[or,Vr].indexOf(r)>=0?{x:l,y:a}:{x:a,y:l}}function lI(t){var e=t.state,n=t.options,r=t.name,i=n.offset,s=i===void 0?[0,0]:i,a=p4.reduce(function(f,p){return f[p]=aI(p,e.rects,s),f},{}),l=a[e.placement],u=l.x,c=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=u,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=a}const uI={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:lI};function cI(t){var e=t.state,n=t.name;e.modifiersData[n]=S4({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}const dI={name:"popperOffsets",enabled:!0,phase:"read",fn:cI,data:{}};function fI(t){return t==="x"?"y":"x"}function pI(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,s=i===void 0?!0:i,a=n.altAxis,l=a===void 0?!1:a,u=n.boundary,c=n.rootBoundary,f=n.altBoundary,p=n.padding,m=n.tether,g=m===void 0?!0:m,v=n.tetherOffset,b=v===void 0?0:v,w=$u(e,{boundary:u,rootBoundary:c,padding:p,altBoundary:f}),x=Ao(e.placement),C=dl(e.placement),E=!C,k=X0(x),T=fI(k),_=e.modifiersData.popperOffsets,A=e.rects.reference,V=e.rects.popper,O=typeof b=="function"?b(Object.assign({},e.rects,{placement:e.placement})):b,B=typeof O=="number"?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),H=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,j={x:0,y:0};if(_){if(s){var Y,N=k==="y"?rr:or,U=k==="y"?Pr:Vr,P=k==="y"?"height":"width",L=_[k],F=L+w[N],R=L-w[U],K=g?-V[P]/2:0,X=C===ll?A[P]:V[P],ae=C===ll?-V[P]:-A[P],de=e.elements.arrow,Ee=g&&de?G0(de):{width:0,height:0},ie=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:b4(),me=ie[N],J=ie[U],ee=Vu(0,A[P],Ee[P]),te=E?A[P]/2-K-ee-me-B.mainAxis:X-ee-me-B.mainAxis,se=E?-A[P]/2+K+ee+J+B.mainAxis:ae+ee+J+B.mainAxis,pe=e.elements.arrow&&Pu(e.elements.arrow),_e=pe?k==="y"?pe.clientTop||0:pe.clientLeft||0:0,Ae=(Y=H?.[k])!=null?Y:0,Ue=L+te-Ae-_e,We=L+se-Ae,qe=Vu(g?Nd(F,Ue):F,L,g?Zs(R,We):R);_[k]=qe,j[k]=qe-L}if(l){var At,q=k==="x"?rr:or,z=k==="x"?Pr:Vr,he=_[T],xe=T==="y"?"height":"width",Pe=he+w[q],rt=he-w[z],Ke=[rr,or].indexOf(x)!==-1,$=(At=H?.[T])!=null?At:0,ne=Ke?Pe:he-A[xe]-V[xe]-$+B.altAxis,oe=Ke?he+A[xe]+V[xe]-$-B.altAxis:rt,we=g&&Ke?VB(ne,he,oe):Vu(g?ne:Pe,he,g?oe:rt);_[T]=we,j[T]=we-he}e.modifiersData[r]=j}}const hI={name:"preventOverflow",enabled:!0,phase:"main",fn:pI,requiresIfExists:["offset"]};function mI(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function gI(t){return t===gr(t)||!Fr(t)?Y0(t):mI(t)}function vI(t){var e=t.getBoundingClientRect(),n=ul(e.width)/t.offsetWidth||1,r=ul(e.height)/t.offsetHeight||1;return n!==1||r!==1}function bI(t,e,n){n===void 0&&(n=!1);var r=Fr(e),i=Fr(e)&&vI(e),s=Zi(e),a=cl(t,i,n),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&((To(e)!=="body"||Z0(s))&&(l=gI(e)),Fr(e)?(u=cl(e,!0),u.x+=e.clientLeft,u.y+=e.clientTop):s&&(u.x=J0(s))),{x:a.left+l.scrollLeft-u.x,y:a.top+l.scrollTop-u.y,width:a.width,height:a.height}}function yI(t){var e=new Map,n=new Set,r=[];t.forEach(function(s){e.set(s.name,s)});function i(s){n.add(s.name);var a=[].concat(s.requires||[],s.requiresIfExists||[]);a.forEach(function(l){if(!n.has(l)){var u=e.get(l);u&&i(u)}}),r.push(s)}return t.forEach(function(s){n.has(s.name)||i(s)}),r}function wI(t){var e=yI(t);return IB.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function xI(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function CI(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var A4={placement:"bottom",modifiers:[],strategy:"absolute"};function M4(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function kI(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,i=e.defaultOptions,s=i===void 0?A4:i;return function(l,u,c){c===void 0&&(c=s);var f={placement:"bottom",orderedModifiers:[],options:Object.assign({},A4,s),modifiersData:{},elements:{reference:l,popper:u},attributes:{},styles:{}},p=[],m=!1,g={state:f,setOptions:function(x){var C=typeof x=="function"?x(f.options):x;b(),f.options=Object.assign({},s,f.options,C),f.scrollParents={reference:Js(l)?Fu(l):l.contextElement?Fu(l.contextElement):[],popper:Fu(u)};var E=wI(CI([].concat(r,f.options.modifiers)));return f.orderedModifiers=E.filter(function(k){return k.enabled}),v(),g.update()},forceUpdate:function(){if(!m){var x=f.elements,C=x.reference,E=x.popper;if(M4(C,E)){f.rects={reference:bI(C,Pu(E),f.options.strategy==="fixed"),popper:G0(E)},f.reset=!1,f.placement=f.options.placement,f.orderedModifiers.forEach(function(B){return f.modifiersData[B.name]=Object.assign({},B.data)});for(var k=0;k<f.orderedModifiers.length;k++){if(f.reset===!0){f.reset=!1,k=-1;continue}var T=f.orderedModifiers[k],_=T.fn,A=T.options,V=A===void 0?{}:A,O=T.name;typeof _=="function"&&(f=_({state:f,options:V,name:O,instance:g})||f)}}}},update:xI(function(){return new Promise(function(w){g.forceUpdate(),w(f)})}),destroy:function(){b(),m=!0}};if(!M4(l,u))return g;g.setOptions(c).then(function(w){!m&&c.onFirstUpdate&&c.onFirstUpdate(w)});function v(){f.orderedModifiers.forEach(function(w){var x=w.name,C=w.options,E=C===void 0?{}:C,k=w.effect;if(typeof k=="function"){var T=k({state:f,name:x,instance:g,options:E}),_=function(){};p.push(T||_)}})}function b(){p.forEach(function(w){return w()}),p=[]}return g}}var EI=[GB,dI,qB,h4,uI,oI,hI,zB,sI],SI=kI({defaultModifiers:EI}),_I="tippy-box",O4="tippy-content",TI="tippy-backdrop",B4="tippy-arrow",I4="tippy-svg-arrow",Qs={passive:!0,capture:!0},L4=function(){return document.body};function AI(t,e){return{}.hasOwnProperty.call(t,e)}function N0(t,e,n){if(Array.isArray(t)){var r=t[e];return r??(Array.isArray(n)?n[e]:n)}return t}function eg(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function R4(t,e){return typeof t=="function"?t.apply(void 0,e):t}function D4(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function MI(t,e){var n=Object.assign({},t);return e.forEach(function(r){delete n[r]}),n}function OI(t){return t.split(/\s+/).filter(Boolean)}function fl(t){return[].concat(t)}function P4(t,e){t.indexOf(e)===-1&&t.push(e)}function BI(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function II(t){return t.split("-")[0]}function rf(t){return[].slice.call(t)}function V4(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function Hu(){return document.createElement("div")}function zu(t){return["Element","Fragment"].some(function(e){return eg(t,e)})}function LI(t){return eg(t,"NodeList")}function RI(t){return eg(t,"MouseEvent")}function DI(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function PI(t){return zu(t)?[t]:LI(t)?rf(t):Array.isArray(t)?t:rf(document.querySelectorAll(t))}function tg(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function F4(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function VI(t){var e,n=fl(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function FI(t,e){var n=e.clientX,r=e.clientY;return t.every(function(i){var s=i.popperRect,a=i.popperState,l=i.props,u=l.interactiveBorder,c=II(a.placement),f=a.modifiersData.offset;if(!f)return!0;var p=c==="bottom"?f.top.y:0,m=c==="top"?f.bottom.y:0,g=c==="right"?f.left.x:0,v=c==="left"?f.right.x:0,b=s.top-r+p>u,w=r-s.bottom-m>u,x=s.left-n+g>u,C=n-s.right-v>u;return b||w||x||C})}function ng(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){t[r](i,n)})}function $4(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var Mo={isTouch:!1},H4=0;function $I(){Mo.isTouch||(Mo.isTouch=!0,window.performance&&document.addEventListener("mousemove",z4))}function z4(){var t=performance.now();t-H4<20&&(Mo.isTouch=!1,document.removeEventListener("mousemove",z4)),H4=t}function HI(){var t=document.activeElement;if(DI(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function zI(){document.addEventListener("touchstart",$I,Qs),window.addEventListener("blur",HI)}var UI=typeof window<"u"&&typeof document<"u",WI=UI?!!window.msCrypto:!1;function pl(t){var e=t==="destroy"?"n already-":" ";return[t+"() was called on a"+e+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function U4(t){var e=/[ \t]{2,}/g,n=/^[ \t]*/gm;return t.replace(e," ").replace(n,"").trim()}function jI(t){return U4(`
|
|
90
90
|
%ctippy.js
|
|
91
91
|
|
|
92
92
|
%c`+U4(t)+`
|
|
@@ -95,27 +95,27 @@ img.ProseMirror-separator {
|
|
|
95
95
|
`)}function W4(t){return[jI(t),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var Uu;process.env.NODE_ENV!=="production"&&qI();function qI(){Uu=new Set}function ui(t,e){if(t&&!Uu.has(e)){var n;Uu.add(e),(n=console).warn.apply(n,W4(e))}}function rg(t,e){if(t&&!Uu.has(e)){var n;Uu.add(e),(n=console).error.apply(n,W4(e))}}function KI(t){var e=!t,n=Object.prototype.toString.call(t)==="[object Object]"&&!t.addEventListener;rg(e,["tippy() was passed","`"+String(t)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),rg(n,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var j4={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},GI={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},vr=Object.assign({appendTo:L4,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},j4,GI),XI=Object.keys(vr),YI=function(e){process.env.NODE_ENV!=="production"&&G4(e,[]);var n=Object.keys(e);n.forEach(function(r){vr[r]=e[r]})};function q4(t){var e=t.plugins||[],n=e.reduce(function(r,i){var s=i.name,a=i.defaultValue;if(s){var l;r[s]=t[s]!==void 0?t[s]:(l=vr[s])!=null?l:a}return r},{});return Object.assign({},t,n)}function JI(t,e){var n=e?Object.keys(q4(Object.assign({},vr,{plugins:e}))):XI,r=n.reduce(function(i,s){var a=(t.getAttribute("data-tippy-"+s)||"").trim();if(!a)return i;if(s==="content")i[s]=a;else try{i[s]=JSON.parse(a)}catch{i[s]=a}return i},{});return r}function K4(t,e){var n=Object.assign({},e,{content:R4(e.content,[t])},e.ignoreAttributes?{}:JI(t,e.plugins));return n.aria=Object.assign({},vr.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?e.interactive:n.aria.expanded,content:n.aria.content==="auto"?e.interactive?null:"describedby":n.aria.content},n}function G4(t,e){t===void 0&&(t={}),e===void 0&&(e=[]);var n=Object.keys(t);n.forEach(function(r){var i=MI(vr,Object.keys(j4)),s=!AI(i,r);s&&(s=e.filter(function(a){return a.name===r}).length===0),ui(s,["`"+r+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.",`
|
|
96
96
|
|
|
97
97
|
`,`All props: https://atomiks.github.io/tippyjs/v6/all-props/
|
|
98
|
-
`,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var ZI=function(){return"innerHTML"};function og(t,e){t[ZI()]=e}function X4(t){var e=Hu();return t===!0?e.className=B4:(e.className=I4,zu(t)?e.appendChild(t):og(e,t)),e}function Y4(t,e){zu(e.content)?(og(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?og(t,e.content):t.textContent=e.content)}function ig(t){var e=t.firstElementChild,n=rf(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(O4)}),arrow:n.find(function(r){return r.classList.contains(B4)||r.classList.contains(I4)}),backdrop:n.find(function(r){return r.classList.contains(TI)})}}function J4(t){var e=Hu(),n=Hu();n.className=_I,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Hu();r.className=O4,r.setAttribute("data-state","hidden"),Y4(r,t.props),e.appendChild(n),n.appendChild(r),i(t.props,t.props);function i(s,a){var l=ig(e),u=l.box,c=l.content,f=l.arrow;a.theme?u.setAttribute("data-theme",a.theme):u.removeAttribute("data-theme"),typeof a.animation=="string"?u.setAttribute("data-animation",a.animation):u.removeAttribute("data-animation"),a.inertia?u.setAttribute("data-inertia",""):u.removeAttribute("data-inertia"),u.style.maxWidth=typeof a.maxWidth=="number"?a.maxWidth+"px":a.maxWidth,a.role?u.setAttribute("role",a.role):u.removeAttribute("role"),(s.content!==a.content||s.allowHTML!==a.allowHTML)&&Y4(c,t.props),a.arrow?f?s.arrow!==a.arrow&&(u.removeChild(f),u.appendChild(X4(a.arrow))):u.appendChild(X4(a.arrow)):f&&u.removeChild(f)}return{popper:e,onUpdate:i}}J4.$$tippy=!0;var QI=1,of=[],sg=[];function NI(t,e){var n=K4(t,Object.assign({},vr,q4(V4(e)))),r,i,s,a=!1,l=!1,u=!1,c=!1,f,p,m,g=[],v=D4(Ue,n.interactiveDebounce),b,w=QI++,x=null,C=BI(n.plugins),E={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},k={id:w,reference:t,popper:Hu(),popperInstance:x,props:n,state:E,plugins:C,clearDelayTimeouts:ne,setProps:oe,setContent:we,show:$e,hide:
|
|
98
|
+
`,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var ZI=function(){return"innerHTML"};function og(t,e){t[ZI()]=e}function X4(t){var e=Hu();return t===!0?e.className=B4:(e.className=I4,zu(t)?e.appendChild(t):og(e,t)),e}function Y4(t,e){zu(e.content)?(og(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?og(t,e.content):t.textContent=e.content)}function ig(t){var e=t.firstElementChild,n=rf(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(O4)}),arrow:n.find(function(r){return r.classList.contains(B4)||r.classList.contains(I4)}),backdrop:n.find(function(r){return r.classList.contains(TI)})}}function J4(t){var e=Hu(),n=Hu();n.className=_I,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Hu();r.className=O4,r.setAttribute("data-state","hidden"),Y4(r,t.props),e.appendChild(n),n.appendChild(r),i(t.props,t.props);function i(s,a){var l=ig(e),u=l.box,c=l.content,f=l.arrow;a.theme?u.setAttribute("data-theme",a.theme):u.removeAttribute("data-theme"),typeof a.animation=="string"?u.setAttribute("data-animation",a.animation):u.removeAttribute("data-animation"),a.inertia?u.setAttribute("data-inertia",""):u.removeAttribute("data-inertia"),u.style.maxWidth=typeof a.maxWidth=="number"?a.maxWidth+"px":a.maxWidth,a.role?u.setAttribute("role",a.role):u.removeAttribute("role"),(s.content!==a.content||s.allowHTML!==a.allowHTML)&&Y4(c,t.props),a.arrow?f?s.arrow!==a.arrow&&(u.removeChild(f),u.appendChild(X4(a.arrow))):u.appendChild(X4(a.arrow)):f&&u.removeChild(f)}return{popper:e,onUpdate:i}}J4.$$tippy=!0;var QI=1,of=[],sg=[];function NI(t,e){var n=K4(t,Object.assign({},vr,q4(V4(e)))),r,i,s,a=!1,l=!1,u=!1,c=!1,f,p,m,g=[],v=D4(Ue,n.interactiveDebounce),b,w=QI++,x=null,C=BI(n.plugins),E={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},k={id:w,reference:t,popper:Hu(),popperInstance:x,props:n,state:E,plugins:C,clearDelayTimeouts:ne,setProps:oe,setContent:we,show:$e,hide:tt,hideWithInteractivity:Tt,enable:Ke,disable:$,unmount:ue,destroy:je};if(!n.render)return process.env.NODE_ENV!=="production"&&rg(!0,"render() function has not been supplied."),k;var T=n.render(k),_=T.popper,A=T.onUpdate;_.setAttribute("data-tippy-root",""),_.id="tippy-"+k.id,k.popper=_,t._tippy=k,_._tippy=k;var V=C.map(function(re){return re.fn(k)}),O=t.hasAttribute("aria-expanded");return pe(),K(),L(),F("onCreate",[k]),n.showOnCreate&&Pe(),_.addEventListener("mouseenter",function(){k.props.interactive&&k.state.isVisible&&k.clearDelayTimeouts()}),_.addEventListener("mouseleave",function(){k.props.interactive&&k.props.trigger.indexOf("mouseenter")>=0&&N().addEventListener("mousemove",v)}),k;function B(){var re=k.props.touch;return Array.isArray(re)?re:[re,0]}function H(){return B()[0]==="hold"}function j(){var re;return!!((re=k.props.render)!=null&&re.$$tippy)}function Y(){return b||t}function N(){var re=Y().parentNode;return re?VI(re):document}function U(){return ig(_)}function P(re){return k.state.isMounted&&!k.state.isVisible||Mo.isTouch||f&&f.type==="focus"?0:N0(k.props.delay,re?0:1,vr.delay)}function L(re){re===void 0&&(re=!1),_.style.pointerEvents=k.props.interactive&&!re?"":"none",_.style.zIndex=""+k.props.zIndex}function F(re,Me,Ve){if(Ve===void 0&&(Ve=!0),V.forEach(function(nt){nt[re]&&nt[re].apply(nt,Me)}),Ve){var it;(it=k.props)[re].apply(it,Me)}}function R(){var re=k.props.aria;if(re.content){var Me="aria-"+re.content,Ve=_.id,it=fl(k.props.triggerTarget||t);it.forEach(function(nt){var bt=nt.getAttribute(Me);if(k.state.isVisible)nt.setAttribute(Me,bt?bt+" "+Ve:Ve);else{var Zt=bt&&bt.replace(Ve,"").trim();Zt?nt.setAttribute(Me,Zt):nt.removeAttribute(Me)}})}}function K(){if(!(O||!k.props.aria.expanded)){var re=fl(k.props.triggerTarget||t);re.forEach(function(Me){k.props.interactive?Me.setAttribute("aria-expanded",k.state.isVisible&&Me===Y()?"true":"false"):Me.removeAttribute("aria-expanded")})}}function X(){N().removeEventListener("mousemove",v),of=of.filter(function(re){return re!==v})}function ae(re){if(!(Mo.isTouch&&(u||re.type==="mousedown"))){var Me=re.composedPath&&re.composedPath()[0]||re.target;if(!(k.props.interactive&&$4(_,Me))){if(fl(k.props.triggerTarget||t).some(function(Ve){return $4(Ve,Me)})){if(Mo.isTouch||k.state.isVisible&&k.props.trigger.indexOf("click")>=0)return}else F("onClickOutside",[k,re]);k.props.hideOnClick===!0&&(k.clearDelayTimeouts(),k.hide(),l=!0,setTimeout(function(){l=!1}),k.state.isMounted||me())}}}function de(){u=!0}function Ee(){u=!1}function ie(){var re=N();re.addEventListener("mousedown",ae,!0),re.addEventListener("touchend",ae,Qs),re.addEventListener("touchstart",Ee,Qs),re.addEventListener("touchmove",de,Qs)}function me(){var re=N();re.removeEventListener("mousedown",ae,!0),re.removeEventListener("touchend",ae,Qs),re.removeEventListener("touchstart",Ee,Qs),re.removeEventListener("touchmove",de,Qs)}function J(re,Me){te(re,function(){!k.state.isVisible&&_.parentNode&&_.parentNode.contains(_)&&Me()})}function ee(re,Me){te(re,Me)}function te(re,Me){var Ve=U().box;function it(nt){nt.target===Ve&&(ng(Ve,"remove",it),Me())}if(re===0)return Me();ng(Ve,"remove",p),ng(Ve,"add",it),p=it}function se(re,Me,Ve){Ve===void 0&&(Ve=!1);var it=fl(k.props.triggerTarget||t);it.forEach(function(nt){nt.addEventListener(re,Me,Ve),g.push({node:nt,eventType:re,handler:Me,options:Ve})})}function pe(){H()&&(se("touchstart",Ae,{passive:!0}),se("touchend",We,{passive:!0})),OI(k.props.trigger).forEach(function(re){if(re!=="manual")switch(se(re,Ae),re){case"mouseenter":se("mouseleave",We);break;case"focus":se(WI?"focusout":"blur",qe);break;case"focusin":se("focusout",qe);break}})}function _e(){g.forEach(function(re){var Me=re.node,Ve=re.eventType,it=re.handler,nt=re.options;Me.removeEventListener(Ve,it,nt)}),g=[]}function Ae(re){var Me,Ve=!1;if(!(!k.state.isEnabled||At(re)||l)){var it=((Me=f)==null?void 0:Me.type)==="focus";f=re,b=re.currentTarget,K(),!k.state.isVisible&&RI(re)&&of.forEach(function(nt){return nt(re)}),re.type==="click"&&(k.props.trigger.indexOf("mouseenter")<0||a)&&k.props.hideOnClick!==!1&&k.state.isVisible?Ve=!0:Pe(re),re.type==="click"&&(a=!Ve),Ve&&!it&&rt(re)}}function Ue(re){var Me=re.target,Ve=Y().contains(Me)||_.contains(Me);if(!(re.type==="mousemove"&&Ve)){var it=xe().concat(_).map(function(nt){var bt,Zt=nt._tippy,gn=(bt=Zt.popperInstance)==null?void 0:bt.state;return gn?{popperRect:nt.getBoundingClientRect(),popperState:gn,props:n}:null}).filter(Boolean);FI(it,re)&&(X(),rt(re))}}function We(re){var Me=At(re)||k.props.trigger.indexOf("click")>=0&&a;if(!Me){if(k.props.interactive){k.hideWithInteractivity(re);return}rt(re)}}function qe(re){k.props.trigger.indexOf("focusin")<0&&re.target!==Y()||k.props.interactive&&re.relatedTarget&&_.contains(re.relatedTarget)||rt(re)}function At(re){return Mo.isTouch?H()!==re.type.indexOf("touch")>=0:!1}function q(){z();var re=k.props,Me=re.popperOptions,Ve=re.placement,it=re.offset,nt=re.getReferenceClientRect,bt=re.moveTransition,Zt=j()?ig(_).arrow:null,gn=nt?{getBoundingClientRect:nt,contextElement:nt.contextElement||Y()}:t,Si={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(As){var Jo=As.state;if(j()){var Hh=U(),Jc=Hh.box;["placement","reference-hidden","escaped"].forEach(function(Zl){Zl==="placement"?Jc.setAttribute("data-placement",Jo.placement):Jo.attributes.popper["data-popper-"+Zl]?Jc.setAttribute("data-"+Zl,""):Jc.removeAttribute("data-"+Zl)}),Jo.attributes.popper={}}}},Yo=[{name:"offset",options:{offset:it}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!bt}},Si];j()&&Zt&&Yo.push({name:"arrow",options:{element:Zt,padding:3}}),Yo.push.apply(Yo,Me?.modifiers||[]),k.popperInstance=SI(gn,_,Object.assign({},Me,{placement:Ve,onFirstUpdate:m,modifiers:Yo}))}function z(){k.popperInstance&&(k.popperInstance.destroy(),k.popperInstance=null)}function he(){var re=k.props.appendTo,Me,Ve=Y();k.props.interactive&&re===L4||re==="parent"?Me=Ve.parentNode:Me=R4(re,[Ve]),Me.contains(_)||Me.appendChild(_),k.state.isMounted=!0,q(),process.env.NODE_ENV!=="production"&&ui(k.props.interactive&&re===vr.appendTo&&Ve.nextElementSibling!==_,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",`
|
|
99
99
|
|
|
100
100
|
`,"Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.",`
|
|
101
101
|
|
|
102
102
|
`,"Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.",`
|
|
103
103
|
|
|
104
|
-
`,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function xe(){return rf(_.querySelectorAll("[data-tippy-root]"))}function Pe(re){k.clearDelayTimeouts(),re&&F("onTrigger",[k,re]),ie();var Me=P(!0),Ve=B(),it=Ve[0],
|
|
104
|
+
`,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function xe(){return rf(_.querySelectorAll("[data-tippy-root]"))}function Pe(re){k.clearDelayTimeouts(),re&&F("onTrigger",[k,re]),ie();var Me=P(!0),Ve=B(),it=Ve[0],nt=Ve[1];Mo.isTouch&&it==="hold"&&nt&&(Me=nt),Me?r=setTimeout(function(){k.show()},Me):k.show()}function rt(re){if(k.clearDelayTimeouts(),F("onUntrigger",[k,re]),!k.state.isVisible){me();return}if(!(k.props.trigger.indexOf("mouseenter")>=0&&k.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(re.type)>=0&&a)){var Me=P(!1);Me?i=setTimeout(function(){k.state.isVisible&&k.hide()},Me):s=requestAnimationFrame(function(){k.hide()})}}function Ke(){k.state.isEnabled=!0}function $(){k.hide(),k.state.isEnabled=!1}function ne(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(s)}function oe(re){if(process.env.NODE_ENV!=="production"&&ui(k.state.isDestroyed,pl("setProps")),!k.state.isDestroyed){F("onBeforeUpdate",[k,re]),_e();var Me=k.props,Ve=K4(t,Object.assign({},Me,V4(re),{ignoreAttributes:!0}));k.props=Ve,pe(),Me.interactiveDebounce!==Ve.interactiveDebounce&&(X(),v=D4(Ue,Ve.interactiveDebounce)),Me.triggerTarget&&!Ve.triggerTarget?fl(Me.triggerTarget).forEach(function(it){it.removeAttribute("aria-expanded")}):Ve.triggerTarget&&t.removeAttribute("aria-expanded"),K(),L(),A&&A(Me,Ve),k.popperInstance&&(q(),xe().forEach(function(it){requestAnimationFrame(it._tippy.popperInstance.forceUpdate)})),F("onAfterUpdate",[k,re])}}function we(re){k.setProps({content:re})}function $e(){process.env.NODE_ENV!=="production"&&ui(k.state.isDestroyed,pl("show"));var re=k.state.isVisible,Me=k.state.isDestroyed,Ve=!k.state.isEnabled,it=Mo.isTouch&&!k.props.touch,nt=N0(k.props.duration,0,vr.duration);if(!(re||Me||Ve||it)&&!Y().hasAttribute("disabled")&&(F("onShow",[k],!1),k.props.onShow(k)!==!1)){if(k.state.isVisible=!0,j()&&(_.style.visibility="visible"),L(),ie(),k.state.isMounted||(_.style.transition="none"),j()){var bt=U(),Zt=bt.box,gn=bt.content;tg([Zt,gn],0)}m=function(){var Yo;if(!(!k.state.isVisible||c)){if(c=!0,_.offsetHeight,_.style.transition=k.props.moveTransition,j()&&k.props.animation){var Ts=U(),As=Ts.box,Jo=Ts.content;tg([As,Jo],nt),F4([As,Jo],"visible")}R(),K(),P4(sg,k),(Yo=k.popperInstance)==null||Yo.forceUpdate(),F("onMount",[k]),k.props.animation&&j()&&ee(nt,function(){k.state.isShown=!0,F("onShown",[k])})}},he()}}function tt(){process.env.NODE_ENV!=="production"&&ui(k.state.isDestroyed,pl("hide"));var re=!k.state.isVisible,Me=k.state.isDestroyed,Ve=!k.state.isEnabled,it=N0(k.props.duration,1,vr.duration);if(!(re||Me||Ve)&&(F("onHide",[k],!1),k.props.onHide(k)!==!1)){if(k.state.isVisible=!1,k.state.isShown=!1,c=!1,a=!1,j()&&(_.style.visibility="hidden"),X(),me(),L(!0),j()){var nt=U(),bt=nt.box,Zt=nt.content;k.props.animation&&(tg([bt,Zt],it),F4([bt,Zt],"hidden"))}R(),K(),k.props.animation?j()&&J(it,k.unmount):k.unmount()}}function Tt(re){process.env.NODE_ENV!=="production"&&ui(k.state.isDestroyed,pl("hideWithInteractivity")),N().addEventListener("mousemove",v),P4(of,v),v(re)}function ue(){process.env.NODE_ENV!=="production"&&ui(k.state.isDestroyed,pl("unmount")),k.state.isVisible&&k.hide(),k.state.isMounted&&(z(),xe().forEach(function(re){re._tippy.unmount()}),_.parentNode&&_.parentNode.removeChild(_),sg=sg.filter(function(re){return re!==k}),k.state.isMounted=!1,F("onHidden",[k]))}function je(){process.env.NODE_ENV!=="production"&&ui(k.state.isDestroyed,pl("destroy")),!k.state.isDestroyed&&(k.clearDelayTimeouts(),k.unmount(),_e(),delete t._tippy,k.state.isDestroyed=!0,F("onDestroy",[k]))}}function Ns(t,e){e===void 0&&(e={});var n=vr.plugins.concat(e.plugins||[]);process.env.NODE_ENV!=="production"&&(KI(t),G4(e,n)),zI();var r=Object.assign({},e,{plugins:n}),i=PI(t);if(process.env.NODE_ENV!=="production"){var s=zu(r.content),a=i.length>1;ui(s&&a,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",`
|
|
105
105
|
|
|
106
106
|
`,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
|
|
107
107
|
|
|
108
108
|
`,`1) content: element.innerHTML
|
|
109
|
-
`,"2) content: () => element.cloneNode(true)"].join(" "))}var l=i.reduce(function(u,c){var f=c&&NI(c,r);return f&&u.push(f),u},[]);return zu(t)?l[0]:l}Ns.defaultProps=vr,Ns.setDefaultProps=YI,Ns.currentInput=Mo,Object.assign({},h4,{effect:function(e){var n=e.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}});var eL={name:"sticky",defaultValue:!1,fn:function(e){var n=e.reference,r=e.popper;function i(){return e.popperInstance?e.popperInstance.state.elements.reference:n}function s(c){return e.props.sticky===!0||e.props.sticky===c}var a=null,l=null;function u(){var c=s("reference")?i().getBoundingClientRect():null,f=s("popper")?r.getBoundingClientRect():null;(c&&Z4(a,c)||f&&Z4(l,f))&&e.popperInstance&&e.popperInstance.update(),a=c,l=f,e.state.isMounted&&requestAnimationFrame(u)}return{onMount:function(){e.props.sticky&&u()}}}};function Z4(t,e){return t&&e?t.top!==e.top||t.right!==e.right||t.bottom!==e.bottom||t.left!==e.left:!0}Ns.setDefaultProps({render:J4});class tL{constructor({editor:e,element:n,view:r,tippyOptions:i={},updateDelay:s=250,shouldShow:a}){this.preventHide=!1,this.shouldShow=({view:l,state:u,from:c,to:f})=>{const{doc:p,selection:m}=u,{empty:g}=m,v=!p.textBetween(c,f).length&&Kd(u.selection),b=this.element.contains(document.activeElement);return!(!(l.hasFocus()||b)||g||v||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:l})=>{var u;if(this.preventHide){this.preventHide=!1;return}l?.relatedTarget&&(!((u=this.element.parentNode)===null||u===void 0)&&u.contains(l.relatedTarget))||l?.relatedTarget!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=l=>{this.blurHandler({event:l})},this.handleDebouncedUpdate=(l,u)=>{const c=!u?.selection.eq(l.state.selection),f=!u?.doc.eq(l.state.doc);!c&&!f||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(l,c,f,u)},this.updateDelay))},this.updateHandler=(l,u,c,f)=>{var p,m,g;const{state:v,composing:b}=l,{selection:w}=v;if(b||!u&&!c)return;this.createTooltip();const{ranges:C}=w,E=Math.min(...C.map(_=>_.$from.pos)),k=Math.max(...C.map(_=>_.$to.pos));if(!((p=this.shouldShow)===null||p===void 0?void 0:p.call(this,{editor:this.editor,element:this.element,view:l,state:v,oldState:f,from:E,to:k}))){this.hide();return}(m=this.tippy)===null||m===void 0||m.setProps({getReferenceClientRect:((g=this.tippyOptions)===null||g===void 0?void 0:g.getReferenceClientRect)||(()=>{if(s4(v.selection)){let _=l.nodeDOM(E);if(_){const A=_.dataset.nodeViewWrapper?_:_.querySelector("[data-node-view-wrapper]");if(A&&(_=A.firstChild),_)return _.getBoundingClientRect()}}return a4(l,E,k)})}),this.show()},this.editor=e,this.element=n,this.view=r,this.updateDelay=s,a&&(this.shouldShow=a),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=Ns(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){const{state:r}=e,i=r.selection.from!==r.selection.to;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(e,n);return}const s=!n?.selection.eq(e.state.selection),a=!n?.doc.eq(e.state.doc);this.updateHandler(e,s,a,n)}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const Q4=t=>new ot({key:typeof t.pluginKey=="string"?new Et(t.pluginKey):t.pluginKey,view:e=>new tL({view:e,...t})});Qe.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Q4({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});class nL{getTextContent(e){return o4(e,{textSerializers:L0(this.editor.schema)})}constructor({editor:e,element:n,view:r,tippyOptions:i={},shouldShow:s}){this.preventHide=!1,this.shouldShow=({view:a,state:l})=>{const{selection:u}=l,{$anchor:c,empty:f}=u,p=c.depth===1,m=c.parent.isTextblock&&!c.parent.type.spec.code&&!c.parent.textContent&&c.parent.childCount===0&&!this.getTextContent(c.parent);return!(!a.hasFocus()||!f||!p||!m||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:a})=>{var l;if(this.preventHide){this.preventHide=!1;return}a?.relatedTarget&&(!((l=this.element.parentNode)===null||l===void 0)&&l.contains(a.relatedTarget))||a?.relatedTarget!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=a=>{this.blurHandler({event:a})},this.editor=e,this.element=n,this.view=r,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=Ns(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){var r,i,s;const{state:a}=e,{doc:l,selection:u}=a,{from:c,to:f}=u;if(n&&n.doc.eq(l)&&n.selection.eq(u))return;if(this.createTooltip(),!((r=this.shouldShow)===null||r===void 0?void 0:r.call(this,{editor:this.editor,view:e,state:a,oldState:n}))){this.hide();return}(i=this.tippy)===null||i===void 0||i.setProps({getReferenceClientRect:((s=this.tippyOptions)===null||s===void 0?void 0:s.getReferenceClientRect)||(()=>a4(e,c,f))}),this.show()}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const N4=t=>new ot({key:typeof t.pluginKey=="string"?new Et(t.pluginKey):t.pluginKey,view:e=>new nL({view:e,...t})});Qe.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[N4({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});const Wu=o.defineComponent({name:"BubbleMenu",props:{pluginKey:{type:[String,Object],default:"bubbleMenu"},editor:{type:Object,required:!0},updateDelay:{type:Number,default:void 0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(t,{slots:e}){const n=o.ref(null);return o.onMounted(()=>{const{updateDelay:r,editor:i,pluginKey:s,shouldShow:a,tippyOptions:l}=t;i.registerPlugin(Q4({updateDelay:r,editor:i,element:n.value,pluginKey:s,shouldShow:a,tippyOptions:l}))}),o.onBeforeUnmount(()=>{const{pluginKey:r,editor:i}=t;i.unregisterPlugin(r)}),()=>{var r;return o.h("div",{ref:n},(r=e.default)===null||r===void 0?void 0:r.call(e))}}});function ex(t){return o.customRef((e,n)=>({get(){return e(),t},set(r){t=r,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}class Oo extends u4{constructor(e={}){return super(e),this.contentComponent=null,this.appContext=null,this.reactiveState=ex(this.view.state),this.reactiveExtensionStorage=ex(this.extensionStorage),this.on("beforeTransaction",({nextState:n})=>{this.reactiveState.value=n,this.reactiveExtensionStorage.value=this.extensionStorage}),o.markRaw(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,n){const r=super.registerPlugin(e,n);return this.reactiveState&&(this.reactiveState.value=r),r}unregisterPlugin(e){const n=super.unregisterPlugin(e);return this.reactiveState&&n&&(this.reactiveState.value=n),n}}const Yn=o.defineComponent({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(t){const e=o.ref(),n=o.getCurrentInstance();return o.watchEffect(()=>{const r=t.editor;r&&r.options.element&&e.value&&o.nextTick(()=>{if(!e.value||!r.options.element.firstChild)return;const i=o.unref(e.value);e.value.append(...r.options.element.childNodes),r.contentComponent=n.ctx._,n&&(r.appContext={...n.appContext,provides:n.provides}),r.setOptions({element:i}),r.createNodeViews()})}),o.onBeforeUnmount(()=>{const r=t.editor;r&&(r.contentComponent=null,r.appContext=null)}),{rootEl:e}},render(){return o.h("div",{ref:t=>{this.rootEl=t}})}});o.defineComponent({name:"FloatingMenu",props:{pluginKey:{type:null,default:"floatingMenu"},editor:{type:Object,required:!0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(t,{slots:e}){const n=o.ref(null);return o.onMounted(()=>{const{pluginKey:r,editor:i,tippyOptions:s,shouldShow:a}=t;i.registerPlugin(N4({pluginKey:r,editor:i,element:n.value,tippyOptions:s,shouldShow:a}))}),o.onBeforeUnmount(()=>{const{pluginKey:r,editor:i}=t;i.unregisterPlugin(r)}),()=>{var r;return o.h("div",{ref:n},(r=e.default)===null||r===void 0?void 0:r.call(e))}}});const tx=o.defineComponent({name:"NodeViewContent",props:{as:{type:String,default:"div"}},render(){return o.h(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}}),ea=o.defineComponent({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var t,e;return o.h(this.as,{class:this.decorationClasses,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragstart:this.onDragStart},(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t))}}),rL=(t={})=>{const e=o.shallowRef();return o.onMounted(()=>{e.value=new Oo(t)}),o.onBeforeUnmount(()=>{var n,r,i;const s=(n=e.value)===null||n===void 0?void 0:n.options.element,a=s?.cloneNode(!0);(r=s?.parentNode)===null||r===void 0||r.replaceChild(a,s),(i=e.value)===null||i===void 0||i.destroy()}),e};class nx{constructor(e,{props:n={},editor:r}){this.editor=r,this.component=o.markRaw(e),this.el=document.createElement("div"),this.props=o.reactive(n),this.renderedComponent=this.renderComponent()}get element(){return this.renderedComponent.el}get ref(){var e,n,r,i;return!((n=(e=this.renderedComponent.vNode)===null||e===void 0?void 0:e.component)===null||n===void 0)&&n.exposed?this.renderedComponent.vNode.component.exposed:(i=(r=this.renderedComponent.vNode)===null||r===void 0?void 0:r.component)===null||i===void 0?void 0:i.proxy}renderComponent(){let e=o.h(this.component,this.props);return this.editor.appContext&&(e.appContext=this.editor.appContext),typeof document<"u"&&this.el&&o.render(e,this.el),{vNode:e,destroy:()=>{this.el&&o.render(null,this.el),this.el=null,e=null},el:this.el?this.el.firstElementChild:null}}updateProps(e={}){Object.entries(e).forEach(([n,r])=>{this.props[n]=r}),this.renderComponent()}destroy(){this.renderedComponent.destroy()}}const ta={editor:{type:Object,required:!0},node:{type:Object,required:!0},decorations:{type:Object,required:!0},selected:{type:Boolean,required:!0},extension:{type:Object,required:!0},getPos:{type:Function,required:!0},updateAttributes:{type:Function,required:!0},deleteNode:{type:Function,required:!0},view:{type:Object,required:!0},innerDecorations:{type:Object,required:!0},HTMLAttributes:{type:Object,required:!0}};class oL extends yB{mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extension,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(i={})=>this.updateAttributes(i),deleteNode:()=>this.deleteNode()},n=this.onDragStart.bind(this);this.decorationClasses=o.ref(this.getDecorationClasses());const r=o.defineComponent({extends:{...this.component},props:Object.keys(e),template:this.component.template,setup:i=>{var s,a;return o.provide("onDragStart",n),o.provide("decorationClasses",this.decorationClasses),(a=(s=this.component).setup)===null||a===void 0?void 0:a.call(s,i,{expose:()=>{}})},__scopeId:this.component.__scopeId,__cssModules:this.component.__cssModules,__name:this.component.__name,__file:this.component.__file});this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.renderer=new nx(r,{editor:this.editor,props:e})}get dom(){if(!this.renderer.element||!this.renderer.element.hasAttribute("data-node-view-wrapper"))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.dom.querySelector("[data-node-view-content]")}handleSelectionUpdate(){const{from:e,to:n}=this.editor.state.selection,r=this.getPos();if(typeof r=="number")if(e<=r&&n>=r+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}}update(e,n,r){const i=s=>{this.decorationClasses.value=this.getDecorationClasses(),this.renderer.updateProps(s)};if(typeof this.options.update=="function"){const s=this.node,a=this.decorations,l=this.innerDecorations;return this.node=e,this.decorations=n,this.innerDecorations=r,this.options.update({oldNode:s,oldDecorations:a,newNode:e,newDecorations:n,oldInnerDecorations:l,innerDecorations:r,updateProps:()=>i({node:e,decorations:n,innerDecorations:r})})}return e.type!==this.node.type?!1:(e===this.node&&this.decorations===n&&this.innerDecorations===r||(this.node=e,this.decorations=n,this.innerDecorations=r,i({node:e,decorations:n,innerDecorations:r})),!0)}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element&&this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element&&this.renderer.element.classList.remove("ProseMirror-selectednode")}getDecorationClasses(){return this.decorations.map(e=>e.type.attrs.class).flat().join(" ")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate)}}function na(t,e){return n=>{if(!n.editor.contentComponent)return{};const r=typeof t=="function"&&"__vccOpts"in t?t.__vccOpts:t;return new oL(r,n,e)}}const iL={NOTHING_TO_CHANGE:"NOTHING_TO_CHANGE"},io={LOADING:"loading",HAS_ERROR:"hasError",NO_ERROR:"noError",FAIL:"fail"},Bo={EDITOR_COMMENT:"editorComment",EDITOR_CONTENT:"editorContent"},ag={KEYBOARD_DID_SHOW:"keyboardDidShow",KEYBOARD_DID_HIDE:"keyboardDidHide",KEYBOARD_DISMISS:"keyboardDismiss"},lg={ANDROID:"android",IOS:"ios"},sf={SPACING:1,SPELLING:2},Io={SINGLE:"single",ERROR_TYPE:"error_type"},Qi="#ff4d4f",rx={[sf.SPACING]:"text-blue-500 border-b-2 border-blue-500",[sf.SPELLING]:"text-red-500 border-b-2 border-red-500"},ox="text-green-500 border-b-2 border-green-500",sL="ko",Lo=200,aL=20,ix=1e5,sx=16,af=10,lf=10,uf=2,lL="#262626",uL=["#000000","#262626","#595959","#8C8C8C","#BFBFBF","#D9D9D9","#E9E9E9","#F5F5F5","#FAFAFA","#FFFFFF","#F5222D","#FA541C","#FA8C16","#FADB14","#52C41A","#13C2C2","#1890FF","#2F54EB","#722ED1","#EB2F96","#FFE8E6","#FFECE0","#FFEFD1","#FCFCCA","#E4F7D2","#D3F5F0","#D4EEFC","#DEE8FC","#EFE1FA","#FAE1EB","#FFA39E","#FFBB96","#FFD591","#FFFB8F","#B7EB8F","#87E8DE","#91D5FF","#ADC6FF","#D3ADF7","#FFADD2","#FF4D4F","#FF7A45","#FFA940","#FFEC3D","#73D13D","#36CFC9","#40A9FF","#597EF7","#9254DE","#F759AB","#CF1322","#D4380D","#D46B08","#D4B106","#389E0D","#08979C","#096DD9","#1D39C4","#531DAB","#C41D7F","#820014","#871400","#873800","#614700","#135200","#00474F","#003A8C","#061178","#22075E","#780650"],ug=["10px","11px","12px","14px","16px","18px","20px","22px","24px","26px","28px","36px","48px","72px"],hl="defaut";var cf=(t=>(t[t["size-small"]=480]="size-small",t[t["size-medium"]=640]="size-medium",t["size-large"]="100%",t))(cf||{});const ax="1",cL={image:["divider","image-size-small","image-size-medium","image-size-large","divider","image-left","image-center","image-right","divider","image-aspect-ratio","remove"],text:["Ai","divider","text-bubble","divider","bold","italic","underline","strike","code","link","divider","color","highlight","textAlign"],video:["video-size-small","video-size-medium","video-size-large","divider","remove"]},ju={SAVE:"ctrl+s,command+s"};var Te=(t=>(t.COMPARE="compare",t.EDITOR="editor",t.STRAIGHT="straight",t.REPORT="report",t.PLAIN_TEXT="plainText",t.SUPER_VIEW_MOBILE="superViewMobile",t))(Te||{}),ir=(t=>(t.COMMENT="editor-comment-section",t.DISABLE_SUPER_INPUT="data-disable-super-input",t))(ir||{});const dL=["a","abbr","acronym","address","applet","area","article","aside","audio","b","base","basefont","bdi","bdo","bgsound","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","command","content","data","datalist","dd","del","details","dfn","dialog","dir","div","dl","dt","element","em","embed","fieldset","figcaption","figure","font","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","image","img","input","ins","isindex","kbd","keygen","label","legend","li","link","listing","main","map","mark","marquee","math","menu","menuitem","meta","meter","multicol","nav","nextid","nobr","noembed","noframes","noscript","object","ol","optgroup","option","output","p","param","picture","plaintext","pre","progress","q","rb","rbc","rp","rt","rtc","ruby","s","samp","script","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","tt","u","ul","var","video","wbr","xmp"],rt={ID:"data-id",TEXT:"data-text",POSITION:"data-position",ELEMENT_ID:"data-element-id"},fL=dL;function lx(t){return t.replace(/<\/?([a-zA-Z0-9-]+)([^>]*)>/g,(e,n)=>fL.includes(n.toLowerCase())?e:e.replace(/</g,"<").replace(/>/g,">"))}function pL(t){if(!t.includes("urn:schemas-microsoft-com:office:excel")&&!t.includes("mso-"))return t;const n=new DOMParser().parseFromString(t,"text/html"),r=n.querySelectorAll("style"),i={};return r.forEach(s=>{const l=(s.textContent||"").match(/\.([a-zA-Z0-9_-]+)\s*\{([^}]+)\}/g);l&&l.forEach(u=>{const c=u.match(/\.([a-zA-Z0-9_-]+)\s*\{([^}]+)\}/);if(c){const f=c[1];let p=c[2].trim();p=p.replace(/mso-[^;:"]*:[^;"]*;?/gi,""),i[f]=p}})}),n.querySelectorAll("[class]").forEach(s=>{const a=s.getAttribute("class")?.split(/\s+/)||[];let l=s.getAttribute("style")||"";l&&!l.endsWith(";")&&(l+=";"),a.forEach(u=>{i[u]&&(l+=i[u],l.endsWith(";")||(l+=";"))}),l&&s.setAttribute("style",l)}),n.querySelectorAll('[style*="background:"]').forEach(s=>{const a=s,l=a.getAttribute("style")||"",u=l.match(/background:\s*([^;]+)/i);u&&!l.includes("background-color:")&&(a.style.backgroundColor=u[1])}),n.querySelectorAll("td, th").forEach(s=>{const a=s,l=a.style.textAlign,u=a.style.color;if(l){const c=a.querySelectorAll("p");if(c.length>0)c.forEach(f=>{f.style.textAlign||(f.style.textAlign=l)});else{const f=a.innerHTML.trim();f&&!f.startsWith("<p")&&(a.innerHTML=`<p style="text-align: ${l}">${f}</p>`)}}if(u){const c=a.querySelectorAll("p");if(c.length>0)c.forEach(f=>{const p=f.innerHTML.trim();p&&!p.includes("color:")&&(f.innerHTML=`<span style="color: ${u}">${p}</span>`)});else{const f=a.innerHTML.trim();f&&!f.includes("color:")&&(a.innerHTML=`<span style="color: ${u}">${f}</span>`)}}}),n.documentElement.innerHTML}function ra(t){return typeof t=="string"&&/<html[\s>]/i.test(t)}function cg(t){const e=t.match(/<body[^>]*>([\s\S]*?)<\/body>/i);return e?e[1]:t}function hL(t){return t=t.replace(/\r/g,""),t=cg(t),t=t.replace(/<\/?o:[^>]*>/gi,""),t=t.replace(/\s+v:shapes="[^"]*"/gi,""),t=t.replace(/\s+lang=[A-Z-]*/gi,""),t=t.replace(/mso-[^;:"]*:[^;"]*;?/gi,""),t=t.replace(/\s+style="\s*"/gi,""),t=t.replace(/<p[^>]*>\s*(<img\b[^>]*>)\s*<\/p>/gi,"$1"),t=t.replace(/<p[^>]*>\s*(<table\b[\s\S]*?<\/table>)\s*<\/p>/gi,"$1"),t=cx(t),t.trim()}function ux(t){const e=parseFloat(t);return isNaN(e)?0:t.includes("pt")?e*1.333:t.includes("cm")?e*37.8:t.includes("mm")?e*3.78:t.includes("in")?e*96:e}function cx(t){const e=document.createElement("div");e.innerHTML=t;const n=e.querySelectorAll("col");return n.length>0&&n.forEach(r=>{const i=r,s=i.style.width||i.getAttribute("width");if(s){const a=ux(s);a>0&&(i.style.width=`${Math.round(a)}px`)}}),e.querySelectorAll("td, th").forEach(r=>{const i=r,s=i.style.width,a=i.getAttribute("width"),l=s||a;if(!l)return;const u=Math.round(ux(l));if(u>0){const c=parseInt(i.getAttribute("colspan")||"1");if(c>1){const f=Math.round(u/c),p=Array(c).fill(f).join(",");i.setAttribute("colwidth",p)}else i.setAttribute("colwidth",String(u));i.style.width=""}}),e.innerHTML}function dx(t){t=pL(t),t=t.replace(/mso-[^;:"]*:[^;"]*;?/gi,""),t=t.replace(/<\/?o:[^>]*>/gi,""),t=t.replace(/\s+v:shapes="[^"]*"/gi,""),t=t.replace(/\s+lang=(?:"[^"]*"|'[^']*'|[A-Z0-9-]*)/gi,""),t=t.replace(/<div[^>]*\bhwp_editor_board_content\b[^>]*>[\s\S]*?<\/div>/gi,""),t=t.replace(/\s+style="\s*"/gi,""),t=t.replace(/<iframe\b[\s\S]*?<\/iframe\s*>/gi,""),t=cx(t);const e=t.match(/<!--StartFragment-->([\s\S]*?)<!--EndFragment-->/);let n=e?e[1]:t;if(/<tr[\s>]/.test(n)&&!/<table[\s>]/.test(n)){const r=t.match(/<table[^>]*>/i);r&&(n=`${r[0]}<tbody>${n}</tbody></table>`)}return n}const un=(t,e,n)=>{if(typeof t=="object")return t;if(typeof t=="string"&&(ra(t)&&(t=hL(t)),t=lx(t),n===Te.PLAIN_TEXT&&!e))return t.replace(/\r?\n/g,"<br>");if(!e||n===Te.PLAIN_TEXT||n===Te.EDITOR)return t;const r=document.createElement("div");return r.innerHTML=t,mL(r),r.innerHTML};function mL(t){t.querySelectorAll("p").forEach(e=>{const n=Array.from(e.querySelectorAll("button.super-text"));if(n.length>0){const r=n.map(s=>`{${(s.getAttribute(rt.TEXT)||"").replace(/<\/p>\s*<p>/g,"<br/>").replace(/<\/?p[^>]*>/g,"").trim()}}`),i=document.createElement("p");i.classList.add("text-red-500","super-text"),i.innerHTML=`${r.join("<br/>")}`,e.before(i),n.forEach(s=>s.remove())}e.innerHTML=e.innerHTML.trim()})}const fx=t=>{if(typeof t=="string"&&(t=lx(t)),typeof t=="object")return t;const e=document.createElement("div");return e.innerHTML=t,e.querySelectorAll("p").forEach(n=>{const r=n.querySelectorAll("button.super-text");if(r.length>0){const i=Array.from(r).map(s=>{const a=s.getAttribute(rt.TEXT)||"";return String(a).replace(/<\/p>\s*<p>/g,"<br/>").replace(/<\/?p>/g,"")});n.innerHTML=i.join("<br/>")}else n.innerHTML=""}),e.innerHTML};class dg{isNativeWebViewAvailable(){return window.ReactNativeWebView!==void 0}getDevicePlatform(){if(!this.isNativeWebViewAvailable())return;if(typeof window.webkit=="object"&&typeof window.webkit?.messageHandlers=="object")return lg.IOS;const n=navigator.userAgent.toLowerCase();if(n.includes("android"))return lg.ANDROID;if(n.includes("iphone")||n.includes("ipad")||n.includes("ipod"))return lg.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)}}}}var ml=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function gL(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var df={exports:{}};/**
|
|
109
|
+
`,"2) content: () => element.cloneNode(true)"].join(" "))}var l=i.reduce(function(u,c){var f=c&&NI(c,r);return f&&u.push(f),u},[]);return zu(t)?l[0]:l}Ns.defaultProps=vr,Ns.setDefaultProps=YI,Ns.currentInput=Mo,Object.assign({},h4,{effect:function(e){var n=e.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}});var eL={name:"sticky",defaultValue:!1,fn:function(e){var n=e.reference,r=e.popper;function i(){return e.popperInstance?e.popperInstance.state.elements.reference:n}function s(c){return e.props.sticky===!0||e.props.sticky===c}var a=null,l=null;function u(){var c=s("reference")?i().getBoundingClientRect():null,f=s("popper")?r.getBoundingClientRect():null;(c&&Z4(a,c)||f&&Z4(l,f))&&e.popperInstance&&e.popperInstance.update(),a=c,l=f,e.state.isMounted&&requestAnimationFrame(u)}return{onMount:function(){e.props.sticky&&u()}}}};function Z4(t,e){return t&&e?t.top!==e.top||t.right!==e.right||t.bottom!==e.bottom||t.left!==e.left:!0}Ns.setDefaultProps({render:J4});class tL{constructor({editor:e,element:n,view:r,tippyOptions:i={},updateDelay:s=250,shouldShow:a}){this.preventHide=!1,this.shouldShow=({view:l,state:u,from:c,to:f})=>{const{doc:p,selection:m}=u,{empty:g}=m,v=!p.textBetween(c,f).length&&Kd(u.selection),b=this.element.contains(document.activeElement);return!(!(l.hasFocus()||b)||g||v||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:l})=>{var u;if(this.preventHide){this.preventHide=!1;return}l?.relatedTarget&&(!((u=this.element.parentNode)===null||u===void 0)&&u.contains(l.relatedTarget))||l?.relatedTarget!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=l=>{this.blurHandler({event:l})},this.handleDebouncedUpdate=(l,u)=>{const c=!u?.selection.eq(l.state.selection),f=!u?.doc.eq(l.state.doc);!c&&!f||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(l,c,f,u)},this.updateDelay))},this.updateHandler=(l,u,c,f)=>{var p,m,g;const{state:v,composing:b}=l,{selection:w}=v;if(b||!u&&!c)return;this.createTooltip();const{ranges:C}=w,E=Math.min(...C.map(_=>_.$from.pos)),k=Math.max(...C.map(_=>_.$to.pos));if(!((p=this.shouldShow)===null||p===void 0?void 0:p.call(this,{editor:this.editor,element:this.element,view:l,state:v,oldState:f,from:E,to:k}))){this.hide();return}(m=this.tippy)===null||m===void 0||m.setProps({getReferenceClientRect:((g=this.tippyOptions)===null||g===void 0?void 0:g.getReferenceClientRect)||(()=>{if(s4(v.selection)){let _=l.nodeDOM(E);if(_){const A=_.dataset.nodeViewWrapper?_:_.querySelector("[data-node-view-wrapper]");if(A&&(_=A.firstChild),_)return _.getBoundingClientRect()}}return a4(l,E,k)})}),this.show()},this.editor=e,this.element=n,this.view=r,this.updateDelay=s,a&&(this.shouldShow=a),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=Ns(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){const{state:r}=e,i=r.selection.from!==r.selection.to;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(e,n);return}const s=!n?.selection.eq(e.state.selection),a=!n?.doc.eq(e.state.doc);this.updateHandler(e,s,a,n)}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const Q4=t=>new ot({key:typeof t.pluginKey=="string"?new Et(t.pluginKey):t.pluginKey,view:e=>new tL({view:e,...t})});Qe.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Q4({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});class nL{getTextContent(e){return o4(e,{textSerializers:L0(this.editor.schema)})}constructor({editor:e,element:n,view:r,tippyOptions:i={},shouldShow:s}){this.preventHide=!1,this.shouldShow=({view:a,state:l})=>{const{selection:u}=l,{$anchor:c,empty:f}=u,p=c.depth===1,m=c.parent.isTextblock&&!c.parent.type.spec.code&&!c.parent.textContent&&c.parent.childCount===0&&!this.getTextContent(c.parent);return!(!a.hasFocus()||!f||!p||!m||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:a})=>{var l;if(this.preventHide){this.preventHide=!1;return}a?.relatedTarget&&(!((l=this.element.parentNode)===null||l===void 0)&&l.contains(a.relatedTarget))||a?.relatedTarget!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=a=>{this.blurHandler({event:a})},this.editor=e,this.element=n,this.view=r,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=Ns(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){var r,i,s;const{state:a}=e,{doc:l,selection:u}=a,{from:c,to:f}=u;if(n&&n.doc.eq(l)&&n.selection.eq(u))return;if(this.createTooltip(),!((r=this.shouldShow)===null||r===void 0?void 0:r.call(this,{editor:this.editor,view:e,state:a,oldState:n}))){this.hide();return}(i=this.tippy)===null||i===void 0||i.setProps({getReferenceClientRect:((s=this.tippyOptions)===null||s===void 0?void 0:s.getReferenceClientRect)||(()=>a4(e,c,f))}),this.show()}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const N4=t=>new ot({key:typeof t.pluginKey=="string"?new Et(t.pluginKey):t.pluginKey,view:e=>new nL({view:e,...t})});Qe.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[N4({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});const Wu=o.defineComponent({name:"BubbleMenu",props:{pluginKey:{type:[String,Object],default:"bubbleMenu"},editor:{type:Object,required:!0},updateDelay:{type:Number,default:void 0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(t,{slots:e}){const n=o.ref(null);return o.onMounted(()=>{const{updateDelay:r,editor:i,pluginKey:s,shouldShow:a,tippyOptions:l}=t;i.registerPlugin(Q4({updateDelay:r,editor:i,element:n.value,pluginKey:s,shouldShow:a,tippyOptions:l}))}),o.onBeforeUnmount(()=>{const{pluginKey:r,editor:i}=t;i.unregisterPlugin(r)}),()=>{var r;return o.h("div",{ref:n},(r=e.default)===null||r===void 0?void 0:r.call(e))}}});function ex(t){return o.customRef((e,n)=>({get(){return e(),t},set(r){t=r,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}class Oo extends u4{constructor(e={}){return super(e),this.contentComponent=null,this.appContext=null,this.reactiveState=ex(this.view.state),this.reactiveExtensionStorage=ex(this.extensionStorage),this.on("beforeTransaction",({nextState:n})=>{this.reactiveState.value=n,this.reactiveExtensionStorage.value=this.extensionStorage}),o.markRaw(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,n){const r=super.registerPlugin(e,n);return this.reactiveState&&(this.reactiveState.value=r),r}unregisterPlugin(e){const n=super.unregisterPlugin(e);return this.reactiveState&&n&&(this.reactiveState.value=n),n}}const Yn=o.defineComponent({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(t){const e=o.ref(),n=o.getCurrentInstance();return o.watchEffect(()=>{const r=t.editor;r&&r.options.element&&e.value&&o.nextTick(()=>{if(!e.value||!r.options.element.firstChild)return;const i=o.unref(e.value);e.value.append(...r.options.element.childNodes),r.contentComponent=n.ctx._,n&&(r.appContext={...n.appContext,provides:n.provides}),r.setOptions({element:i}),r.createNodeViews()})}),o.onBeforeUnmount(()=>{const r=t.editor;r&&(r.contentComponent=null,r.appContext=null)}),{rootEl:e}},render(){return o.h("div",{ref:t=>{this.rootEl=t}})}});o.defineComponent({name:"FloatingMenu",props:{pluginKey:{type:null,default:"floatingMenu"},editor:{type:Object,required:!0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(t,{slots:e}){const n=o.ref(null);return o.onMounted(()=>{const{pluginKey:r,editor:i,tippyOptions:s,shouldShow:a}=t;i.registerPlugin(N4({pluginKey:r,editor:i,element:n.value,tippyOptions:s,shouldShow:a}))}),o.onBeforeUnmount(()=>{const{pluginKey:r,editor:i}=t;i.unregisterPlugin(r)}),()=>{var r;return o.h("div",{ref:n},(r=e.default)===null||r===void 0?void 0:r.call(e))}}});const tx=o.defineComponent({name:"NodeViewContent",props:{as:{type:String,default:"div"}},render(){return o.h(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}}),ea=o.defineComponent({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var t,e;return o.h(this.as,{class:this.decorationClasses,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragstart:this.onDragStart},(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t))}}),rL=(t={})=>{const e=o.shallowRef();return o.onMounted(()=>{e.value=new Oo(t)}),o.onBeforeUnmount(()=>{var n,r,i;const s=(n=e.value)===null||n===void 0?void 0:n.options.element,a=s?.cloneNode(!0);(r=s?.parentNode)===null||r===void 0||r.replaceChild(a,s),(i=e.value)===null||i===void 0||i.destroy()}),e};class nx{constructor(e,{props:n={},editor:r}){this.editor=r,this.component=o.markRaw(e),this.el=document.createElement("div"),this.props=o.reactive(n),this.renderedComponent=this.renderComponent()}get element(){return this.renderedComponent.el}get ref(){var e,n,r,i;return!((n=(e=this.renderedComponent.vNode)===null||e===void 0?void 0:e.component)===null||n===void 0)&&n.exposed?this.renderedComponent.vNode.component.exposed:(i=(r=this.renderedComponent.vNode)===null||r===void 0?void 0:r.component)===null||i===void 0?void 0:i.proxy}renderComponent(){let e=o.h(this.component,this.props);return this.editor.appContext&&(e.appContext=this.editor.appContext),typeof document<"u"&&this.el&&o.render(e,this.el),{vNode:e,destroy:()=>{this.el&&o.render(null,this.el),this.el=null,e=null},el:this.el?this.el.firstElementChild:null}}updateProps(e={}){Object.entries(e).forEach(([n,r])=>{this.props[n]=r}),this.renderComponent()}destroy(){this.renderedComponent.destroy()}}const ta={editor:{type:Object,required:!0},node:{type:Object,required:!0},decorations:{type:Object,required:!0},selected:{type:Boolean,required:!0},extension:{type:Object,required:!0},getPos:{type:Function,required:!0},updateAttributes:{type:Function,required:!0},deleteNode:{type:Function,required:!0},view:{type:Object,required:!0},innerDecorations:{type:Object,required:!0},HTMLAttributes:{type:Object,required:!0}};class oL extends yB{mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extension,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(i={})=>this.updateAttributes(i),deleteNode:()=>this.deleteNode()},n=this.onDragStart.bind(this);this.decorationClasses=o.ref(this.getDecorationClasses());const r=o.defineComponent({extends:{...this.component},props:Object.keys(e),template:this.component.template,setup:i=>{var s,a;return o.provide("onDragStart",n),o.provide("decorationClasses",this.decorationClasses),(a=(s=this.component).setup)===null||a===void 0?void 0:a.call(s,i,{expose:()=>{}})},__scopeId:this.component.__scopeId,__cssModules:this.component.__cssModules,__name:this.component.__name,__file:this.component.__file});this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.renderer=new nx(r,{editor:this.editor,props:e})}get dom(){if(!this.renderer.element||!this.renderer.element.hasAttribute("data-node-view-wrapper"))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.dom.querySelector("[data-node-view-content]")}handleSelectionUpdate(){const{from:e,to:n}=this.editor.state.selection,r=this.getPos();if(typeof r=="number")if(e<=r&&n>=r+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}}update(e,n,r){const i=s=>{this.decorationClasses.value=this.getDecorationClasses(),this.renderer.updateProps(s)};if(typeof this.options.update=="function"){const s=this.node,a=this.decorations,l=this.innerDecorations;return this.node=e,this.decorations=n,this.innerDecorations=r,this.options.update({oldNode:s,oldDecorations:a,newNode:e,newDecorations:n,oldInnerDecorations:l,innerDecorations:r,updateProps:()=>i({node:e,decorations:n,innerDecorations:r})})}return e.type!==this.node.type?!1:(e===this.node&&this.decorations===n&&this.innerDecorations===r||(this.node=e,this.decorations=n,this.innerDecorations=r,i({node:e,decorations:n,innerDecorations:r})),!0)}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element&&this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element&&this.renderer.element.classList.remove("ProseMirror-selectednode")}getDecorationClasses(){return this.decorations.map(e=>e.type.attrs.class).flat().join(" ")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate)}}function na(t,e){return n=>{if(!n.editor.contentComponent)return{};const r=typeof t=="function"&&"__vccOpts"in t?t.__vccOpts:t;return new oL(r,n,e)}}const iL={NOTHING_TO_CHANGE:"NOTHING_TO_CHANGE"},io={LOADING:"loading",HAS_ERROR:"hasError",NO_ERROR:"noError",FAIL:"fail"},Bo={EDITOR_COMMENT:"editorComment",EDITOR_CONTENT:"editorContent"},ag={KEYBOARD_DID_SHOW:"keyboardDidShow",KEYBOARD_DID_HIDE:"keyboardDidHide",KEYBOARD_DISMISS:"keyboardDismiss"},lg={ANDROID:"android",IOS:"ios"},sf={SPACING:1,SPELLING:2},Io={SINGLE:"single",ERROR_TYPE:"error_type"},Qi="#ff4d4f",rx={[sf.SPACING]:"text-blue-500 border-b-2 border-blue-500",[sf.SPELLING]:"text-red-500 border-b-2 border-red-500"},ox="text-green-500 border-b-2 border-green-500",sL="ko",Lo=200,aL=20,ix=1e5,sx=16,af=10,lf=10,uf=2,lL="#262626",uL=["#000000","#262626","#595959","#8C8C8C","#BFBFBF","#D9D9D9","#E9E9E9","#F5F5F5","#FAFAFA","#FFFFFF","#F5222D","#FA541C","#FA8C16","#FADB14","#52C41A","#13C2C2","#1890FF","#2F54EB","#722ED1","#EB2F96","#FFE8E6","#FFECE0","#FFEFD1","#FCFCCA","#E4F7D2","#D3F5F0","#D4EEFC","#DEE8FC","#EFE1FA","#FAE1EB","#FFA39E","#FFBB96","#FFD591","#FFFB8F","#B7EB8F","#87E8DE","#91D5FF","#ADC6FF","#D3ADF7","#FFADD2","#FF4D4F","#FF7A45","#FFA940","#FFEC3D","#73D13D","#36CFC9","#40A9FF","#597EF7","#9254DE","#F759AB","#CF1322","#D4380D","#D46B08","#D4B106","#389E0D","#08979C","#096DD9","#1D39C4","#531DAB","#C41D7F","#820014","#871400","#873800","#614700","#135200","#00474F","#003A8C","#061178","#22075E","#780650"],ug=["10px","11px","12px","14px","16px","18px","20px","22px","24px","26px","28px","36px","48px","72px"],hl="defaut";var cf=(t=>(t[t["size-small"]=480]="size-small",t[t["size-medium"]=640]="size-medium",t["size-large"]="100%",t))(cf||{});const ax="1",cL={image:["divider","image-size-small","image-size-medium","image-size-large","divider","image-left","image-center","image-right","divider","image-aspect-ratio","remove"],text:["Ai","divider","text-bubble","divider","bold","italic","underline","strike","code","link","divider","color","highlight","textAlign"],video:["video-size-small","video-size-medium","video-size-large","divider","remove"]},ju={SAVE:"ctrl+s,command+s"};var Te=(t=>(t.COMPARE="compare",t.EDITOR="editor",t.STRAIGHT="straight",t.REPORT="report",t.PLAIN_TEXT="plainText",t.SUPER_VIEW_MOBILE="superViewMobile",t))(Te||{}),ir=(t=>(t.COMMENT="editor-comment-section",t.DISABLE_SUPER_INPUT="data-disable-super-input",t))(ir||{});const dL=["a","abbr","acronym","address","applet","area","article","aside","audio","b","base","basefont","bdi","bdo","bgsound","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","command","content","data","datalist","dd","del","details","dfn","dialog","dir","div","dl","dt","element","em","embed","fieldset","figcaption","figure","font","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","image","img","input","ins","isindex","kbd","keygen","label","legend","li","link","listing","main","map","mark","marquee","math","menu","menuitem","meta","meter","multicol","nav","nextid","nobr","noembed","noframes","noscript","object","ol","optgroup","option","output","p","param","picture","plaintext","pre","progress","q","rb","rbc","rp","rt","rtc","ruby","s","samp","script","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","tt","u","ul","var","video","wbr","xmp"],Ne={ID:"data-id",TEXT:"data-text",POSITION:"data-position",ELEMENT_ID:"data-element-id"},fL=dL;function lx(t){return t.replace(/<\/?([a-zA-Z0-9-]+)([^>]*)>/g,(e,n)=>fL.includes(n.toLowerCase())?e:e.replace(/</g,"<").replace(/>/g,">"))}function pL(t){if(!t.includes("urn:schemas-microsoft-com:office:excel")&&!t.includes("mso-"))return t;const n=new DOMParser().parseFromString(t,"text/html"),r=n.querySelectorAll("style"),i={};return r.forEach(s=>{const l=(s.textContent||"").match(/\.([a-zA-Z0-9_-]+)\s*\{([^}]+)\}/g);l&&l.forEach(u=>{const c=u.match(/\.([a-zA-Z0-9_-]+)\s*\{([^}]+)\}/);if(c){const f=c[1];let p=c[2].trim();p=p.replace(/mso-[^;:"]*:[^;"]*;?/gi,""),i[f]=p}})}),n.querySelectorAll("[class]").forEach(s=>{const a=s.getAttribute("class")?.split(/\s+/)||[];let l=s.getAttribute("style")||"";l&&!l.endsWith(";")&&(l+=";"),a.forEach(u=>{i[u]&&(l+=i[u],l.endsWith(";")||(l+=";"))}),l&&s.setAttribute("style",l)}),n.querySelectorAll('[style*="background:"]').forEach(s=>{const a=s,l=a.getAttribute("style")||"",u=l.match(/background:\s*([^;]+)/i);u&&!l.includes("background-color:")&&(a.style.backgroundColor=u[1])}),n.querySelectorAll("td, th").forEach(s=>{const a=s,l=a.style.textAlign,u=a.style.color;if(l){const c=a.querySelectorAll("p");if(c.length>0)c.forEach(f=>{f.style.textAlign||(f.style.textAlign=l)});else{const f=a.innerHTML.trim();f&&!f.startsWith("<p")&&(a.innerHTML=`<p style="text-align: ${l}">${f}</p>`)}}if(u){const c=a.querySelectorAll("p");if(c.length>0)c.forEach(f=>{const p=f.innerHTML.trim();p&&!p.includes("color:")&&(f.innerHTML=`<span style="color: ${u}">${p}</span>`)});else{const f=a.innerHTML.trim();f&&!f.includes("color:")&&(a.innerHTML=`<span style="color: ${u}">${f}</span>`)}}}),n.documentElement.innerHTML}function ra(t){return typeof t=="string"&&/<html[\s>]/i.test(t)}function cg(t){const e=t.match(/<body[^>]*>([\s\S]*?)<\/body>/i);return e?e[1]:t}function hL(t){return t=t.replace(/\r/g,""),t=cg(t),t=t.replace(/<\/?o:[^>]*>/gi,""),t=t.replace(/\s+v:shapes="[^"]*"/gi,""),t=t.replace(/\s+lang=[A-Z-]*/gi,""),t=t.replace(/mso-[^;:"]*:[^;"]*;?/gi,""),t=t.replace(/\s+style="\s*"/gi,""),t=t.replace(/<p[^>]*>\s*(<img\b[^>]*>)\s*<\/p>/gi,"$1"),t=t.replace(/<p[^>]*>\s*(<table\b[\s\S]*?<\/table>)\s*<\/p>/gi,"$1"),t=cx(t),t.trim()}function ux(t){const e=parseFloat(t);return isNaN(e)?0:t.includes("pt")?e*1.333:t.includes("cm")?e*37.8:t.includes("mm")?e*3.78:t.includes("in")?e*96:e}function cx(t){const e=document.createElement("div");e.innerHTML=t;const n=e.querySelectorAll("col");return n.length>0&&n.forEach(r=>{const i=r,s=i.style.width||i.getAttribute("width");if(s){const a=ux(s);a>0&&(i.style.width=`${Math.round(a)}px`)}}),e.querySelectorAll("td, th").forEach(r=>{const i=r,s=i.style.width,a=i.getAttribute("width"),l=s||a;if(!l)return;const u=Math.round(ux(l));if(u>0){const c=parseInt(i.getAttribute("colspan")||"1");if(c>1){const f=Math.round(u/c),p=Array(c).fill(f).join(",");i.setAttribute("colwidth",p)}else i.setAttribute("colwidth",String(u));i.style.width=""}}),e.innerHTML}function dx(t){t=pL(t),t=t.replace(/mso-[^;:"]*:[^;"]*;?/gi,""),t=t.replace(/<\/?o:[^>]*>/gi,""),t=t.replace(/\s+v:shapes="[^"]*"/gi,""),t=t.replace(/\s+lang=(?:"[^"]*"|'[^']*'|[A-Z0-9-]*)/gi,""),t=t.replace(/<div[^>]*\bhwp_editor_board_content\b[^>]*>[\s\S]*?<\/div>/gi,""),t=t.replace(/\s+style="\s*"/gi,""),t=t.replace(/<iframe\b[\s\S]*?<\/iframe\s*>/gi,""),t=cx(t);const e=t.match(/<!--StartFragment-->([\s\S]*?)<!--EndFragment-->/);let n=e?e[1]:t;if(/<tr[\s>]/.test(n)&&!/<table[\s>]/.test(n)){const r=t.match(/<table[^>]*>/i);r&&(n=`${r[0]}<tbody>${n}</tbody></table>`)}return n}const un=(t,e,n)=>{if(typeof t=="object")return t;if(typeof t=="string"&&(ra(t)&&(t=hL(t)),t=lx(t),n===Te.PLAIN_TEXT&&!e))return t.replace(/\r?\n/g,"<br>");if(!e||n===Te.PLAIN_TEXT||n===Te.EDITOR)return t;const r=document.createElement("div");return r.innerHTML=t,mL(r),r.innerHTML};function mL(t){t.querySelectorAll("p").forEach(e=>{const n=Array.from(e.querySelectorAll("button.super-text"));if(n.length>0){const r=n.map(s=>`{${(s.getAttribute(Ne.TEXT)||"").replace(/<\/p>\s*<p>/g,"<br/>").replace(/<\/?p[^>]*>/g,"").trim()}}`),i=document.createElement("p");i.classList.add("text-red-500","super-text"),i.innerHTML=`${r.join("<br/>")}`,e.before(i),n.forEach(s=>s.remove())}e.innerHTML=e.innerHTML.trim()})}const fx=t=>{if(typeof t=="string"&&(t=lx(t)),typeof t=="object")return t;const e=document.createElement("div");return e.innerHTML=t,e.querySelectorAll("p").forEach(n=>{const r=n.querySelectorAll("button.super-text");if(r.length>0){const i=Array.from(r).map(s=>{const a=s.getAttribute(Ne.TEXT)||"";return String(a).replace(/<\/p>\s*<p>/g,"<br/>").replace(/<\/?p>/g,"")});n.innerHTML=i.join("<br/>")}else n.innerHTML=""}),e.innerHTML};class dg{isNativeWebViewAvailable(){return window.ReactNativeWebView!==void 0}getDevicePlatform(){if(!this.isNativeWebViewAvailable())return;if(typeof window.webkit=="object"&&typeof window.webkit?.messageHandlers=="object")return lg.IOS;const n=navigator.userAgent.toLowerCase();if(n.includes("android"))return lg.ANDROID;if(n.includes("iphone")||n.includes("ipad")||n.includes("ipod"))return lg.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)}}}}var ml=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function gL(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var df={exports:{}};/**
|
|
110
110
|
* @license
|
|
111
111
|
* Lodash <https://lodash.com/>
|
|
112
112
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
113
113
|
* Released under MIT license <https://lodash.com/license>
|
|
114
114
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
115
115
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
116
|
-
*/df.exports,function(t,e){(function(){var n,r="4.17.21",i=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",l="Invalid `variable` option passed into `_.template`",u="__lodash_hash_undefined__",c=500,f="__lodash_placeholder__",p=1,m=2,g=4,v=1,b=2,w=1,x=2,C=4,E=8,k=16,T=32,_=64,A=128,V=256,O=512,B=30,H="...",j=800,Y=16,N=1,U=2,P=3,L=1/0,F=9007199254740991,R=17976931348623157e292,K=NaN,X=4294967295,ae=X-1,de=X>>>1,Ee=[["ary",A],["bind",w],["bindKey",x],["curry",E],["curryRight",k],["flip",O],["partial",T],["partialRight",_],["rearg",V]],ie="[object Arguments]",me="[object Array]",J="[object AsyncFunction]",ee="[object Boolean]",te="[object Date]",se="[object DOMException]",pe="[object Error]",_e="[object Function]",Ae="[object GeneratorFunction]",Ue="[object Map]",We="[object Number]",qe="[object Null]",At="[object Object]",q="[object Promise]",z="[object Proxy]",he="[object RegExp]",xe="[object Set]",Pe="[object String]",nt="[object Symbol]",Ke="[object Undefined]",$="[object WeakMap]",ne="[object WeakSet]",oe="[object ArrayBuffer]",we="[object DataView]",$e="[object Float32Array]",et="[object Float64Array]",Tt="[object Int8Array]",ue="[object Int16Array]",je="[object Int32Array]",re="[object Uint8Array]",Me="[object Uint8ClampedArray]",Ve="[object Uint16Array]",it="[object Uint32Array]",tt=/\b__p \+= '';/g,bt=/\b(__p \+=) '' \+/g,Zt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,gn=/&(?:amp|lt|gt|quot|#39);/g,Si=/[&<>"']/g,Yo=RegExp(gn.source),Ts=RegExp(Si.source),As=/<%-([\s\S]+?)%>/g,Jo=/<%([\s\S]+?)%>/g,Hh=/<%=([\s\S]+?)%>/g,Jc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Zl=/^\w*$/,rre=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Kb=/[\\^$.*+?()[\]{}|]/g,ore=RegExp(Kb.source),Gb=/^\s+/,ire=/\s/,sre=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,are=/\{\n\/\* \[wrapped with (.+)\] \*/,lre=/,? & /,ure=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,cre=/[()=,{}\[\]\/\s]/,dre=/\\(\\)?/g,fre=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,IS=/\w*$/,pre=/^[-+]0x[0-9a-f]+$/i,hre=/^0b[01]+$/i,mre=/^\[object .+?Constructor\]$/,gre=/^0o[0-7]+$/i,vre=/^(?:0|[1-9]\d*)$/,bre=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,zh=/($^)/,yre=/['\n\r\u2028\u2029\\]/g,Uh="\\ud800-\\udfff",wre="\\u0300-\\u036f",xre="\\ufe20-\\ufe2f",Cre="\\u20d0-\\u20ff",LS=wre+xre+Cre,RS="\\u2700-\\u27bf",DS="a-z\\xdf-\\xf6\\xf8-\\xff",kre="\\xac\\xb1\\xd7\\xf7",Ere="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Sre="\\u2000-\\u206f",_re=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",PS="A-Z\\xc0-\\xd6\\xd8-\\xde",VS="\\ufe0e\\ufe0f",FS=kre+Ere+Sre+_re,Xb="['’]",Tre="["+Uh+"]",$S="["+FS+"]",Wh="["+LS+"]",HS="\\d+",Are="["+RS+"]",zS="["+DS+"]",US="[^"+Uh+FS+HS+RS+DS+PS+"]",Yb="\\ud83c[\\udffb-\\udfff]",Mre="(?:"+Wh+"|"+Yb+")",WS="[^"+Uh+"]",Jb="(?:\\ud83c[\\udde6-\\uddff]){2}",Zb="[\\ud800-\\udbff][\\udc00-\\udfff]",Ql="["+PS+"]",jS="\\u200d",qS="(?:"+zS+"|"+US+")",Ore="(?:"+Ql+"|"+US+")",KS="(?:"+Xb+"(?:d|ll|m|re|s|t|ve))?",GS="(?:"+Xb+"(?:D|LL|M|RE|S|T|VE))?",XS=Mre+"?",YS="["+VS+"]?",Bre="(?:"+jS+"(?:"+[WS,Jb,Zb].join("|")+")"+YS+XS+")*",Ire="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Lre="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",JS=YS+XS+Bre,Rre="(?:"+[Are,Jb,Zb].join("|")+")"+JS,Dre="(?:"+[WS+Wh+"?",Wh,Jb,Zb,Tre].join("|")+")",Pre=RegExp(Xb,"g"),Vre=RegExp(Wh,"g"),Qb=RegExp(Yb+"(?="+Yb+")|"+Dre+JS,"g"),Fre=RegExp([Ql+"?"+zS+"+"+KS+"(?="+[$S,Ql,"$"].join("|")+")",Ore+"+"+GS+"(?="+[$S,Ql+qS,"$"].join("|")+")",Ql+"?"+qS+"+"+KS,Ql+"+"+GS,Lre,Ire,HS,Rre].join("|"),"g"),$re=RegExp("["+jS+Uh+LS+VS+"]"),Hre=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,zre=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ure=-1,Xt={};Xt[$e]=Xt[et]=Xt[Tt]=Xt[ue]=Xt[je]=Xt[re]=Xt[Me]=Xt[Ve]=Xt[it]=!0,Xt[ie]=Xt[me]=Xt[oe]=Xt[ee]=Xt[we]=Xt[te]=Xt[pe]=Xt[_e]=Xt[Ue]=Xt[We]=Xt[At]=Xt[he]=Xt[xe]=Xt[Pe]=Xt[$]=!1;var qt={};qt[ie]=qt[me]=qt[oe]=qt[we]=qt[ee]=qt[te]=qt[$e]=qt[et]=qt[Tt]=qt[ue]=qt[je]=qt[Ue]=qt[We]=qt[At]=qt[he]=qt[xe]=qt[Pe]=qt[nt]=qt[re]=qt[Me]=qt[Ve]=qt[it]=!0,qt[pe]=qt[_e]=qt[$]=!1;var Wre={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},jre={"&":"&","<":"<",">":">",'"':""","'":"'"},qre={"&":"&","<":"<",">":">",""":'"',"'":"'"},Kre={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Gre=parseFloat,Xre=parseInt,ZS=typeof ml=="object"&&ml&&ml.Object===Object&&ml,Yre=typeof self=="object"&&self&&self.Object===Object&&self,Ln=ZS||Yre||Function("return this")(),Nb=e&&!e.nodeType&&e,Da=Nb&&!0&&t&&!t.nodeType&&t,QS=Da&&Da.exports===Nb,e2=QS&&ZS.process,Yr=function(){try{var Z=Da&&Da.require&&Da.require("util").types;return Z||e2&&e2.binding&&e2.binding("util")}catch{}}(),NS=Yr&&Yr.isArrayBuffer,e_=Yr&&Yr.isDate,t_=Yr&&Yr.isMap,n_=Yr&&Yr.isRegExp,r_=Yr&&Yr.isSet,o_=Yr&&Yr.isTypedArray;function Sr(Z,fe,le){switch(le.length){case 0:return Z.call(fe);case 1:return Z.call(fe,le[0]);case 2:return Z.call(fe,le[0],le[1]);case 3:return Z.call(fe,le[0],le[1],le[2])}return Z.apply(fe,le)}function Jre(Z,fe,le,De){for(var st=-1,Mt=Z==null?0:Z.length;++st<Mt;){var wn=Z[st];fe(De,wn,le(wn),Z)}return De}function Jr(Z,fe){for(var le=-1,De=Z==null?0:Z.length;++le<De&&fe(Z[le],le,Z)!==!1;);return Z}function Zre(Z,fe){for(var le=Z==null?0:Z.length;le--&&fe(Z[le],le,Z)!==!1;);return Z}function i_(Z,fe){for(var le=-1,De=Z==null?0:Z.length;++le<De;)if(!fe(Z[le],le,Z))return!1;return!0}function Ms(Z,fe){for(var le=-1,De=Z==null?0:Z.length,st=0,Mt=[];++le<De;){var wn=Z[le];fe(wn,le,Z)&&(Mt[st++]=wn)}return Mt}function jh(Z,fe){var le=Z==null?0:Z.length;return!!le&&Nl(Z,fe,0)>-1}function t2(Z,fe,le){for(var De=-1,st=Z==null?0:Z.length;++De<st;)if(le(fe,Z[De]))return!0;return!1}function Qt(Z,fe){for(var le=-1,De=Z==null?0:Z.length,st=Array(De);++le<De;)st[le]=fe(Z[le],le,Z);return st}function Os(Z,fe){for(var le=-1,De=fe.length,st=Z.length;++le<De;)Z[st+le]=fe[le];return Z}function n2(Z,fe,le,De){var st=-1,Mt=Z==null?0:Z.length;for(De&&Mt&&(le=Z[++st]);++st<Mt;)le=fe(le,Z[st],st,Z);return le}function Qre(Z,fe,le,De){var st=Z==null?0:Z.length;for(De&&st&&(le=Z[--st]);st--;)le=fe(le,Z[st],st,Z);return le}function r2(Z,fe){for(var le=-1,De=Z==null?0:Z.length;++le<De;)if(fe(Z[le],le,Z))return!0;return!1}var Nre=o2("length");function eoe(Z){return Z.split("")}function toe(Z){return Z.match(ure)||[]}function s_(Z,fe,le){var De;return le(Z,function(st,Mt,wn){if(fe(st,Mt,wn))return De=Mt,!1}),De}function qh(Z,fe,le,De){for(var st=Z.length,Mt=le+(De?1:-1);De?Mt--:++Mt<st;)if(fe(Z[Mt],Mt,Z))return Mt;return-1}function Nl(Z,fe,le){return fe===fe?poe(Z,fe,le):qh(Z,a_,le)}function noe(Z,fe,le,De){for(var st=le-1,Mt=Z.length;++st<Mt;)if(De(Z[st],fe))return st;return-1}function a_(Z){return Z!==Z}function l_(Z,fe){var le=Z==null?0:Z.length;return le?s2(Z,fe)/le:K}function o2(Z){return function(fe){return fe==null?n:fe[Z]}}function i2(Z){return function(fe){return Z==null?n:Z[fe]}}function u_(Z,fe,le,De,st){return st(Z,function(Mt,wn,Ut){le=De?(De=!1,Mt):fe(le,Mt,wn,Ut)}),le}function roe(Z,fe){var le=Z.length;for(Z.sort(fe);le--;)Z[le]=Z[le].value;return Z}function s2(Z,fe){for(var le,De=-1,st=Z.length;++De<st;){var Mt=fe(Z[De]);Mt!==n&&(le=le===n?Mt:le+Mt)}return le}function a2(Z,fe){for(var le=-1,De=Array(Z);++le<Z;)De[le]=fe(le);return De}function ooe(Z,fe){return Qt(fe,function(le){return[le,Z[le]]})}function c_(Z){return Z&&Z.slice(0,h_(Z)+1).replace(Gb,"")}function _r(Z){return function(fe){return Z(fe)}}function l2(Z,fe){return Qt(fe,function(le){return Z[le]})}function Zc(Z,fe){return Z.has(fe)}function d_(Z,fe){for(var le=-1,De=Z.length;++le<De&&Nl(fe,Z[le],0)>-1;);return le}function f_(Z,fe){for(var le=Z.length;le--&&Nl(fe,Z[le],0)>-1;);return le}function ioe(Z,fe){for(var le=Z.length,De=0;le--;)Z[le]===fe&&++De;return De}var soe=i2(Wre),aoe=i2(jre);function loe(Z){return"\\"+Kre[Z]}function uoe(Z,fe){return Z==null?n:Z[fe]}function eu(Z){return $re.test(Z)}function coe(Z){return Hre.test(Z)}function doe(Z){for(var fe,le=[];!(fe=Z.next()).done;)le.push(fe.value);return le}function u2(Z){var fe=-1,le=Array(Z.size);return Z.forEach(function(De,st){le[++fe]=[st,De]}),le}function p_(Z,fe){return function(le){return Z(fe(le))}}function Bs(Z,fe){for(var le=-1,De=Z.length,st=0,Mt=[];++le<De;){var wn=Z[le];(wn===fe||wn===f)&&(Z[le]=f,Mt[st++]=le)}return Mt}function Kh(Z){var fe=-1,le=Array(Z.size);return Z.forEach(function(De){le[++fe]=De}),le}function foe(Z){var fe=-1,le=Array(Z.size);return Z.forEach(function(De){le[++fe]=[De,De]}),le}function poe(Z,fe,le){for(var De=le-1,st=Z.length;++De<st;)if(Z[De]===fe)return De;return-1}function hoe(Z,fe,le){for(var De=le+1;De--;)if(Z[De]===fe)return De;return De}function tu(Z){return eu(Z)?goe(Z):Nre(Z)}function xo(Z){return eu(Z)?voe(Z):eoe(Z)}function h_(Z){for(var fe=Z.length;fe--&&ire.test(Z.charAt(fe)););return fe}var moe=i2(qre);function goe(Z){for(var fe=Qb.lastIndex=0;Qb.test(Z);)++fe;return fe}function voe(Z){return Z.match(Qb)||[]}function boe(Z){return Z.match(Fre)||[]}var yoe=function Z(fe){fe=fe==null?Ln:nu.defaults(Ln.Object(),fe,nu.pick(Ln,zre));var le=fe.Array,De=fe.Date,st=fe.Error,Mt=fe.Function,wn=fe.Math,Ut=fe.Object,c2=fe.RegExp,woe=fe.String,Zr=fe.TypeError,Gh=le.prototype,xoe=Mt.prototype,ru=Ut.prototype,Xh=fe["__core-js_shared__"],Yh=xoe.toString,It=ru.hasOwnProperty,Coe=0,m_=function(){var d=/[^.]+$/.exec(Xh&&Xh.keys&&Xh.keys.IE_PROTO||"");return d?"Symbol(src)_1."+d:""}(),Jh=ru.toString,koe=Yh.call(Ut),Eoe=Ln._,Soe=c2("^"+Yh.call(It).replace(Kb,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Zh=QS?fe.Buffer:n,Is=fe.Symbol,Qh=fe.Uint8Array,g_=Zh?Zh.allocUnsafe:n,Nh=p_(Ut.getPrototypeOf,Ut),v_=Ut.create,b_=ru.propertyIsEnumerable,em=Gh.splice,y_=Is?Is.isConcatSpreadable:n,Qc=Is?Is.iterator:n,Pa=Is?Is.toStringTag:n,tm=function(){try{var d=za(Ut,"defineProperty");return d({},"",{}),d}catch{}}(),_oe=fe.clearTimeout!==Ln.clearTimeout&&fe.clearTimeout,Toe=De&&De.now!==Ln.Date.now&&De.now,Aoe=fe.setTimeout!==Ln.setTimeout&&fe.setTimeout,nm=wn.ceil,rm=wn.floor,d2=Ut.getOwnPropertySymbols,Moe=Zh?Zh.isBuffer:n,w_=fe.isFinite,Ooe=Gh.join,Boe=p_(Ut.keys,Ut),xn=wn.max,jn=wn.min,Ioe=De.now,Loe=fe.parseInt,x_=wn.random,Roe=Gh.reverse,f2=za(fe,"DataView"),Nc=za(fe,"Map"),p2=za(fe,"Promise"),ou=za(fe,"Set"),ed=za(fe,"WeakMap"),td=za(Ut,"create"),om=ed&&new ed,iu={},Doe=Ua(f2),Poe=Ua(Nc),Voe=Ua(p2),Foe=Ua(ou),$oe=Ua(ed),im=Is?Is.prototype:n,nd=im?im.valueOf:n,C_=im?im.toString:n;function I(d){if(ln(d)&&!at(d)&&!(d instanceof xt)){if(d instanceof Qr)return d;if(It.call(d,"__wrapped__"))return k9(d)}return new Qr(d)}var su=function(){function d(){}return function(h){if(!nn(h))return{};if(v_)return v_(h);d.prototype=h;var y=new d;return d.prototype=n,y}}();function sm(){}function Qr(d,h){this.__wrapped__=d,this.__actions__=[],this.__chain__=!!h,this.__index__=0,this.__values__=n}I.templateSettings={escape:As,evaluate:Jo,interpolate:Hh,variable:"",imports:{_:I}},I.prototype=sm.prototype,I.prototype.constructor=I,Qr.prototype=su(sm.prototype),Qr.prototype.constructor=Qr;function xt(d){this.__wrapped__=d,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=X,this.__views__=[]}function Hoe(){var d=new xt(this.__wrapped__);return d.__actions__=cr(this.__actions__),d.__dir__=this.__dir__,d.__filtered__=this.__filtered__,d.__iteratees__=cr(this.__iteratees__),d.__takeCount__=this.__takeCount__,d.__views__=cr(this.__views__),d}function zoe(){if(this.__filtered__){var d=new xt(this);d.__dir__=-1,d.__filtered__=!0}else d=this.clone(),d.__dir__*=-1;return d}function Uoe(){var d=this.__wrapped__.value(),h=this.__dir__,y=at(d),S=h<0,M=y?d.length:0,D=ese(0,M,this.__views__),W=D.start,G=D.end,Q=G-W,ve=S?G:W-1,be=this.__iteratees__,ye=be.length,Be=0,He=jn(Q,this.__takeCount__);if(!y||!S&&M==Q&&He==Q)return K_(d,this.__actions__);var Je=[];e:for(;Q--&&Be<He;){ve+=h;for(var gt=-1,Ze=d[ve];++gt<ye;){var yt=be[gt],Ct=yt.iteratee,Mr=yt.type,tr=Ct(Ze);if(Mr==U)Ze=tr;else if(!tr){if(Mr==N)continue e;break e}}Je[Be++]=Ze}return Je}xt.prototype=su(sm.prototype),xt.prototype.constructor=xt;function Va(d){var h=-1,y=d==null?0:d.length;for(this.clear();++h<y;){var S=d[h];this.set(S[0],S[1])}}function Woe(){this.__data__=td?td(null):{},this.size=0}function joe(d){var h=this.has(d)&&delete this.__data__[d];return this.size-=h?1:0,h}function qoe(d){var h=this.__data__;if(td){var y=h[d];return y===u?n:y}return It.call(h,d)?h[d]:n}function Koe(d){var h=this.__data__;return td?h[d]!==n:It.call(h,d)}function Goe(d,h){var y=this.__data__;return this.size+=this.has(d)?0:1,y[d]=td&&h===n?u:h,this}Va.prototype.clear=Woe,Va.prototype.delete=joe,Va.prototype.get=qoe,Va.prototype.has=Koe,Va.prototype.set=Goe;function _i(d){var h=-1,y=d==null?0:d.length;for(this.clear();++h<y;){var S=d[h];this.set(S[0],S[1])}}function Xoe(){this.__data__=[],this.size=0}function Yoe(d){var h=this.__data__,y=am(h,d);if(y<0)return!1;var S=h.length-1;return y==S?h.pop():em.call(h,y,1),--this.size,!0}function Joe(d){var h=this.__data__,y=am(h,d);return y<0?n:h[y][1]}function Zoe(d){return am(this.__data__,d)>-1}function Qoe(d,h){var y=this.__data__,S=am(y,d);return S<0?(++this.size,y.push([d,h])):y[S][1]=h,this}_i.prototype.clear=Xoe,_i.prototype.delete=Yoe,_i.prototype.get=Joe,_i.prototype.has=Zoe,_i.prototype.set=Qoe;function Ti(d){var h=-1,y=d==null?0:d.length;for(this.clear();++h<y;){var S=d[h];this.set(S[0],S[1])}}function Noe(){this.size=0,this.__data__={hash:new Va,map:new(Nc||_i),string:new Va}}function eie(d){var h=ym(this,d).delete(d);return this.size-=h?1:0,h}function tie(d){return ym(this,d).get(d)}function nie(d){return ym(this,d).has(d)}function rie(d,h){var y=ym(this,d),S=y.size;return y.set(d,h),this.size+=y.size==S?0:1,this}Ti.prototype.clear=Noe,Ti.prototype.delete=eie,Ti.prototype.get=tie,Ti.prototype.has=nie,Ti.prototype.set=rie;function Fa(d){var h=-1,y=d==null?0:d.length;for(this.__data__=new Ti;++h<y;)this.add(d[h])}function oie(d){return this.__data__.set(d,u),this}function iie(d){return this.__data__.has(d)}Fa.prototype.add=Fa.prototype.push=oie,Fa.prototype.has=iie;function Co(d){var h=this.__data__=new _i(d);this.size=h.size}function sie(){this.__data__=new _i,this.size=0}function aie(d){var h=this.__data__,y=h.delete(d);return this.size=h.size,y}function lie(d){return this.__data__.get(d)}function uie(d){return this.__data__.has(d)}function cie(d,h){var y=this.__data__;if(y instanceof _i){var S=y.__data__;if(!Nc||S.length<i-1)return S.push([d,h]),this.size=++y.size,this;y=this.__data__=new Ti(S)}return y.set(d,h),this.size=y.size,this}Co.prototype.clear=sie,Co.prototype.delete=aie,Co.prototype.get=lie,Co.prototype.has=uie,Co.prototype.set=cie;function k_(d,h){var y=at(d),S=!y&&Wa(d),M=!y&&!S&&Vs(d),D=!y&&!S&&!M&&cu(d),W=y||S||M||D,G=W?a2(d.length,woe):[],Q=G.length;for(var ve in d)(h||It.call(d,ve))&&!(W&&(ve=="length"||M&&(ve=="offset"||ve=="parent")||D&&(ve=="buffer"||ve=="byteLength"||ve=="byteOffset")||Bi(ve,Q)))&&G.push(ve);return G}function E_(d){var h=d.length;return h?d[E2(0,h-1)]:n}function die(d,h){return wm(cr(d),$a(h,0,d.length))}function fie(d){return wm(cr(d))}function h2(d,h,y){(y!==n&&!ko(d[h],y)||y===n&&!(h in d))&&Ai(d,h,y)}function rd(d,h,y){var S=d[h];(!(It.call(d,h)&&ko(S,y))||y===n&&!(h in d))&&Ai(d,h,y)}function am(d,h){for(var y=d.length;y--;)if(ko(d[y][0],h))return y;return-1}function pie(d,h,y,S){return Ls(d,function(M,D,W){h(S,M,y(M),W)}),S}function S_(d,h){return d&&Qo(h,_n(h),d)}function hie(d,h){return d&&Qo(h,fr(h),d)}function Ai(d,h,y){h=="__proto__"&&tm?tm(d,h,{configurable:!0,enumerable:!0,value:y,writable:!0}):d[h]=y}function m2(d,h){for(var y=-1,S=h.length,M=le(S),D=d==null;++y<S;)M[y]=D?n:Y2(d,h[y]);return M}function $a(d,h,y){return d===d&&(y!==n&&(d=d<=y?d:y),h!==n&&(d=d>=h?d:h)),d}function Nr(d,h,y,S,M,D){var W,G=h&p,Q=h&m,ve=h&g;if(y&&(W=M?y(d,S,M,D):y(d)),W!==n)return W;if(!nn(d))return d;var be=at(d);if(be){if(W=nse(d),!G)return cr(d,W)}else{var ye=qn(d),Be=ye==_e||ye==Ae;if(Vs(d))return Y_(d,G);if(ye==At||ye==ie||Be&&!M){if(W=Q||Be?{}:h9(d),!G)return Q?qie(d,hie(W,d)):jie(d,S_(W,d))}else{if(!qt[ye])return M?d:{};W=rse(d,ye,G)}}D||(D=new Co);var He=D.get(d);if(He)return He;D.set(d,W),W9(d)?d.forEach(function(Ze){W.add(Nr(Ze,h,y,Ze,d,D))}):z9(d)&&d.forEach(function(Ze,yt){W.set(yt,Nr(Ze,h,y,yt,d,D))});var Je=ve?Q?D2:R2:Q?fr:_n,gt=be?n:Je(d);return Jr(gt||d,function(Ze,yt){gt&&(yt=Ze,Ze=d[yt]),rd(W,yt,Nr(Ze,h,y,yt,d,D))}),W}function mie(d){var h=_n(d);return function(y){return __(y,d,h)}}function __(d,h,y){var S=y.length;if(d==null)return!S;for(d=Ut(d);S--;){var M=y[S],D=h[M],W=d[M];if(W===n&&!(M in d)||!D(W))return!1}return!0}function T_(d,h,y){if(typeof d!="function")throw new Zr(a);return cd(function(){d.apply(n,y)},h)}function od(d,h,y,S){var M=-1,D=jh,W=!0,G=d.length,Q=[],ve=h.length;if(!G)return Q;y&&(h=Qt(h,_r(y))),S?(D=t2,W=!1):h.length>=i&&(D=Zc,W=!1,h=new Fa(h));e:for(;++M<G;){var be=d[M],ye=y==null?be:y(be);if(be=S||be!==0?be:0,W&&ye===ye){for(var Be=ve;Be--;)if(h[Be]===ye)continue e;Q.push(be)}else D(h,ye,S)||Q.push(be)}return Q}var Ls=e9(Zo),A_=e9(v2,!0);function gie(d,h){var y=!0;return Ls(d,function(S,M,D){return y=!!h(S,M,D),y}),y}function lm(d,h,y){for(var S=-1,M=d.length;++S<M;){var D=d[S],W=h(D);if(W!=null&&(G===n?W===W&&!Ar(W):y(W,G)))var G=W,Q=D}return Q}function vie(d,h,y,S){var M=d.length;for(y=ft(y),y<0&&(y=-y>M?0:M+y),S=S===n||S>M?M:ft(S),S<0&&(S+=M),S=y>S?0:q9(S);y<S;)d[y++]=h;return d}function M_(d,h){var y=[];return Ls(d,function(S,M,D){h(S,M,D)&&y.push(S)}),y}function Rn(d,h,y,S,M){var D=-1,W=d.length;for(y||(y=ise),M||(M=[]);++D<W;){var G=d[D];h>0&&y(G)?h>1?Rn(G,h-1,y,S,M):Os(M,G):S||(M[M.length]=G)}return M}var g2=t9(),O_=t9(!0);function Zo(d,h){return d&&g2(d,h,_n)}function v2(d,h){return d&&O_(d,h,_n)}function um(d,h){return Ms(h,function(y){return Ii(d[y])})}function Ha(d,h){h=Ds(h,d);for(var y=0,S=h.length;d!=null&&y<S;)d=d[No(h[y++])];return y&&y==S?d:n}function B_(d,h,y){var S=h(d);return at(d)?S:Os(S,y(d))}function Nn(d){return d==null?d===n?Ke:qe:Pa&&Pa in Ut(d)?Nie(d):fse(d)}function b2(d,h){return d>h}function bie(d,h){return d!=null&&It.call(d,h)}function yie(d,h){return d!=null&&h in Ut(d)}function wie(d,h,y){return d>=jn(h,y)&&d<xn(h,y)}function y2(d,h,y){for(var S=y?t2:jh,M=d[0].length,D=d.length,W=D,G=le(D),Q=1/0,ve=[];W--;){var be=d[W];W&&h&&(be=Qt(be,_r(h))),Q=jn(be.length,Q),G[W]=!y&&(h||M>=120&&be.length>=120)?new Fa(W&&be):n}be=d[0];var ye=-1,Be=G[0];e:for(;++ye<M&&ve.length<Q;){var He=be[ye],Je=h?h(He):He;if(He=y||He!==0?He:0,!(Be?Zc(Be,Je):S(ve,Je,y))){for(W=D;--W;){var gt=G[W];if(!(gt?Zc(gt,Je):S(d[W],Je,y)))continue e}Be&&Be.push(Je),ve.push(He)}}return ve}function xie(d,h,y,S){return Zo(d,function(M,D,W){h(S,y(M),D,W)}),S}function id(d,h,y){h=Ds(h,d),d=b9(d,h);var S=d==null?d:d[No(to(h))];return S==null?n:Sr(S,d,y)}function I_(d){return ln(d)&&Nn(d)==ie}function Cie(d){return ln(d)&&Nn(d)==oe}function kie(d){return ln(d)&&Nn(d)==te}function sd(d,h,y,S,M){return d===h?!0:d==null||h==null||!ln(d)&&!ln(h)?d!==d&&h!==h:Eie(d,h,y,S,sd,M)}function Eie(d,h,y,S,M,D){var W=at(d),G=at(h),Q=W?me:qn(d),ve=G?me:qn(h);Q=Q==ie?At:Q,ve=ve==ie?At:ve;var be=Q==At,ye=ve==At,Be=Q==ve;if(Be&&Vs(d)){if(!Vs(h))return!1;W=!0,be=!1}if(Be&&!be)return D||(D=new Co),W||cu(d)?d9(d,h,y,S,M,D):Zie(d,h,Q,y,S,M,D);if(!(y&v)){var He=be&&It.call(d,"__wrapped__"),Je=ye&&It.call(h,"__wrapped__");if(He||Je){var gt=He?d.value():d,Ze=Je?h.value():h;return D||(D=new Co),M(gt,Ze,y,S,D)}}return Be?(D||(D=new Co),Qie(d,h,y,S,M,D)):!1}function Sie(d){return ln(d)&&qn(d)==Ue}function w2(d,h,y,S){var M=y.length,D=M,W=!S;if(d==null)return!D;for(d=Ut(d);M--;){var G=y[M];if(W&&G[2]?G[1]!==d[G[0]]:!(G[0]in d))return!1}for(;++M<D;){G=y[M];var Q=G[0],ve=d[Q],be=G[1];if(W&&G[2]){if(ve===n&&!(Q in d))return!1}else{var ye=new Co;if(S)var Be=S(ve,be,Q,d,h,ye);if(!(Be===n?sd(be,ve,v|b,S,ye):Be))return!1}}return!0}function L_(d){if(!nn(d)||ase(d))return!1;var h=Ii(d)?Soe:mre;return h.test(Ua(d))}function _ie(d){return ln(d)&&Nn(d)==he}function Tie(d){return ln(d)&&qn(d)==xe}function Aie(d){return ln(d)&&_m(d.length)&&!!Xt[Nn(d)]}function R_(d){return typeof d=="function"?d:d==null?pr:typeof d=="object"?at(d)?V_(d[0],d[1]):P_(d):nT(d)}function x2(d){if(!ud(d))return Boe(d);var h=[];for(var y in Ut(d))It.call(d,y)&&y!="constructor"&&h.push(y);return h}function Mie(d){if(!nn(d))return dse(d);var h=ud(d),y=[];for(var S in d)S=="constructor"&&(h||!It.call(d,S))||y.push(S);return y}function C2(d,h){return d<h}function D_(d,h){var y=-1,S=dr(d)?le(d.length):[];return Ls(d,function(M,D,W){S[++y]=h(M,D,W)}),S}function P_(d){var h=V2(d);return h.length==1&&h[0][2]?g9(h[0][0],h[0][1]):function(y){return y===d||w2(y,d,h)}}function V_(d,h){return $2(d)&&m9(h)?g9(No(d),h):function(y){var S=Y2(y,d);return S===n&&S===h?J2(y,d):sd(h,S,v|b)}}function cm(d,h,y,S,M){d!==h&&g2(h,function(D,W){if(M||(M=new Co),nn(D))Oie(d,h,W,y,cm,S,M);else{var G=S?S(z2(d,W),D,W+"",d,h,M):n;G===n&&(G=D),h2(d,W,G)}},fr)}function Oie(d,h,y,S,M,D,W){var G=z2(d,y),Q=z2(h,y),ve=W.get(Q);if(ve){h2(d,y,ve);return}var be=D?D(G,Q,y+"",d,h,W):n,ye=be===n;if(ye){var Be=at(Q),He=!Be&&Vs(Q),Je=!Be&&!He&&cu(Q);be=Q,Be||He||Je?at(G)?be=G:dn(G)?be=cr(G):He?(ye=!1,be=Y_(Q,!0)):Je?(ye=!1,be=J_(Q,!0)):be=[]:dd(Q)||Wa(Q)?(be=G,Wa(G)?be=K9(G):(!nn(G)||Ii(G))&&(be=h9(Q))):ye=!1}ye&&(W.set(Q,be),M(be,Q,S,D,W),W.delete(Q)),h2(d,y,be)}function F_(d,h){var y=d.length;if(y)return h+=h<0?y:0,Bi(h,y)?d[h]:n}function $_(d,h,y){h.length?h=Qt(h,function(D){return at(D)?function(W){return Ha(W,D.length===1?D[0]:D)}:D}):h=[pr];var S=-1;h=Qt(h,_r(Xe()));var M=D_(d,function(D,W,G){var Q=Qt(h,function(ve){return ve(D)});return{criteria:Q,index:++S,value:D}});return roe(M,function(D,W){return Wie(D,W,y)})}function Bie(d,h){return H_(d,h,function(y,S){return J2(d,S)})}function H_(d,h,y){for(var S=-1,M=h.length,D={};++S<M;){var W=h[S],G=Ha(d,W);y(G,W)&&ad(D,Ds(W,d),G)}return D}function Iie(d){return function(h){return Ha(h,d)}}function k2(d,h,y,S){var M=S?noe:Nl,D=-1,W=h.length,G=d;for(d===h&&(h=cr(h)),y&&(G=Qt(d,_r(y)));++D<W;)for(var Q=0,ve=h[D],be=y?y(ve):ve;(Q=M(G,be,Q,S))>-1;)G!==d&&em.call(G,Q,1),em.call(d,Q,1);return d}function z_(d,h){for(var y=d?h.length:0,S=y-1;y--;){var M=h[y];if(y==S||M!==D){var D=M;Bi(M)?em.call(d,M,1):T2(d,M)}}return d}function E2(d,h){return d+rm(x_()*(h-d+1))}function Lie(d,h,y,S){for(var M=-1,D=xn(nm((h-d)/(y||1)),0),W=le(D);D--;)W[S?D:++M]=d,d+=y;return W}function S2(d,h){var y="";if(!d||h<1||h>F)return y;do h%2&&(y+=d),h=rm(h/2),h&&(d+=d);while(h);return y}function vt(d,h){return U2(v9(d,h,pr),d+"")}function Rie(d){return E_(du(d))}function Die(d,h){var y=du(d);return wm(y,$a(h,0,y.length))}function ad(d,h,y,S){if(!nn(d))return d;h=Ds(h,d);for(var M=-1,D=h.length,W=D-1,G=d;G!=null&&++M<D;){var Q=No(h[M]),ve=y;if(Q==="__proto__"||Q==="constructor"||Q==="prototype")return d;if(M!=W){var be=G[Q];ve=S?S(be,Q,G):n,ve===n&&(ve=nn(be)?be:Bi(h[M+1])?[]:{})}rd(G,Q,ve),G=G[Q]}return d}var U_=om?function(d,h){return om.set(d,h),d}:pr,Pie=tm?function(d,h){return tm(d,"toString",{configurable:!0,enumerable:!1,value:Q2(h),writable:!0})}:pr;function Vie(d){return wm(du(d))}function eo(d,h,y){var S=-1,M=d.length;h<0&&(h=-h>M?0:M+h),y=y>M?M:y,y<0&&(y+=M),M=h>y?0:y-h>>>0,h>>>=0;for(var D=le(M);++S<M;)D[S]=d[S+h];return D}function Fie(d,h){var y;return Ls(d,function(S,M,D){return y=h(S,M,D),!y}),!!y}function dm(d,h,y){var S=0,M=d==null?S:d.length;if(typeof h=="number"&&h===h&&M<=de){for(;S<M;){var D=S+M>>>1,W=d[D];W!==null&&!Ar(W)&&(y?W<=h:W<h)?S=D+1:M=D}return M}return _2(d,h,pr,y)}function _2(d,h,y,S){var M=0,D=d==null?0:d.length;if(D===0)return 0;h=y(h);for(var W=h!==h,G=h===null,Q=Ar(h),ve=h===n;M<D;){var be=rm((M+D)/2),ye=y(d[be]),Be=ye!==n,He=ye===null,Je=ye===ye,gt=Ar(ye);if(W)var Ze=S||Je;else ve?Ze=Je&&(S||Be):G?Ze=Je&&Be&&(S||!He):Q?Ze=Je&&Be&&!He&&(S||!gt):He||gt?Ze=!1:Ze=S?ye<=h:ye<h;Ze?M=be+1:D=be}return jn(D,ae)}function W_(d,h){for(var y=-1,S=d.length,M=0,D=[];++y<S;){var W=d[y],G=h?h(W):W;if(!y||!ko(G,Q)){var Q=G;D[M++]=W===0?0:W}}return D}function j_(d){return typeof d=="number"?d:Ar(d)?K:+d}function Tr(d){if(typeof d=="string")return d;if(at(d))return Qt(d,Tr)+"";if(Ar(d))return C_?C_.call(d):"";var h=d+"";return h=="0"&&1/d==-1/0?"-0":h}function Rs(d,h,y){var S=-1,M=jh,D=d.length,W=!0,G=[],Q=G;if(y)W=!1,M=t2;else if(D>=i){var ve=h?null:Yie(d);if(ve)return Kh(ve);W=!1,M=Zc,Q=new Fa}else Q=h?[]:G;e:for(;++S<D;){var be=d[S],ye=h?h(be):be;if(be=y||be!==0?be:0,W&&ye===ye){for(var Be=Q.length;Be--;)if(Q[Be]===ye)continue e;h&&Q.push(ye),G.push(be)}else M(Q,ye,y)||(Q!==G&&Q.push(ye),G.push(be))}return G}function T2(d,h){return h=Ds(h,d),d=b9(d,h),d==null||delete d[No(to(h))]}function q_(d,h,y,S){return ad(d,h,y(Ha(d,h)),S)}function fm(d,h,y,S){for(var M=d.length,D=S?M:-1;(S?D--:++D<M)&&h(d[D],D,d););return y?eo(d,S?0:D,S?D+1:M):eo(d,S?D+1:0,S?M:D)}function K_(d,h){var y=d;return y instanceof xt&&(y=y.value()),n2(h,function(S,M){return M.func.apply(M.thisArg,Os([S],M.args))},y)}function A2(d,h,y){var S=d.length;if(S<2)return S?Rs(d[0]):[];for(var M=-1,D=le(S);++M<S;)for(var W=d[M],G=-1;++G<S;)G!=M&&(D[M]=od(D[M]||W,d[G],h,y));return Rs(Rn(D,1),h,y)}function G_(d,h,y){for(var S=-1,M=d.length,D=h.length,W={};++S<M;){var G=S<D?h[S]:n;y(W,d[S],G)}return W}function M2(d){return dn(d)?d:[]}function O2(d){return typeof d=="function"?d:pr}function Ds(d,h){return at(d)?d:$2(d,h)?[d]:C9(Bt(d))}var $ie=vt;function Ps(d,h,y){var S=d.length;return y=y===n?S:y,!h&&y>=S?d:eo(d,h,y)}var X_=_oe||function(d){return Ln.clearTimeout(d)};function Y_(d,h){if(h)return d.slice();var y=d.length,S=g_?g_(y):new d.constructor(y);return d.copy(S),S}function B2(d){var h=new d.constructor(d.byteLength);return new Qh(h).set(new Qh(d)),h}function Hie(d,h){var y=h?B2(d.buffer):d.buffer;return new d.constructor(y,d.byteOffset,d.byteLength)}function zie(d){var h=new d.constructor(d.source,IS.exec(d));return h.lastIndex=d.lastIndex,h}function Uie(d){return nd?Ut(nd.call(d)):{}}function J_(d,h){var y=h?B2(d.buffer):d.buffer;return new d.constructor(y,d.byteOffset,d.length)}function Z_(d,h){if(d!==h){var y=d!==n,S=d===null,M=d===d,D=Ar(d),W=h!==n,G=h===null,Q=h===h,ve=Ar(h);if(!G&&!ve&&!D&&d>h||D&&W&&Q&&!G&&!ve||S&&W&&Q||!y&&Q||!M)return 1;if(!S&&!D&&!ve&&d<h||ve&&y&&M&&!S&&!D||G&&y&&M||!W&&M||!Q)return-1}return 0}function Wie(d,h,y){for(var S=-1,M=d.criteria,D=h.criteria,W=M.length,G=y.length;++S<W;){var Q=Z_(M[S],D[S]);if(Q){if(S>=G)return Q;var ve=y[S];return Q*(ve=="desc"?-1:1)}}return d.index-h.index}function Q_(d,h,y,S){for(var M=-1,D=d.length,W=y.length,G=-1,Q=h.length,ve=xn(D-W,0),be=le(Q+ve),ye=!S;++G<Q;)be[G]=h[G];for(;++M<W;)(ye||M<D)&&(be[y[M]]=d[M]);for(;ve--;)be[G++]=d[M++];return be}function N_(d,h,y,S){for(var M=-1,D=d.length,W=-1,G=y.length,Q=-1,ve=h.length,be=xn(D-G,0),ye=le(be+ve),Be=!S;++M<be;)ye[M]=d[M];for(var He=M;++Q<ve;)ye[He+Q]=h[Q];for(;++W<G;)(Be||M<D)&&(ye[He+y[W]]=d[M++]);return ye}function cr(d,h){var y=-1,S=d.length;for(h||(h=le(S));++y<S;)h[y]=d[y];return h}function Qo(d,h,y,S){var M=!y;y||(y={});for(var D=-1,W=h.length;++D<W;){var G=h[D],Q=S?S(y[G],d[G],G,y,d):n;Q===n&&(Q=d[G]),M?Ai(y,G,Q):rd(y,G,Q)}return y}function jie(d,h){return Qo(d,F2(d),h)}function qie(d,h){return Qo(d,f9(d),h)}function pm(d,h){return function(y,S){var M=at(y)?Jre:pie,D=h?h():{};return M(y,d,Xe(S,2),D)}}function au(d){return vt(function(h,y){var S=-1,M=y.length,D=M>1?y[M-1]:n,W=M>2?y[2]:n;for(D=d.length>3&&typeof D=="function"?(M--,D):n,W&&er(y[0],y[1],W)&&(D=M<3?n:D,M=1),h=Ut(h);++S<M;){var G=y[S];G&&d(h,G,S,D)}return h})}function e9(d,h){return function(y,S){if(y==null)return y;if(!dr(y))return d(y,S);for(var M=y.length,D=h?M:-1,W=Ut(y);(h?D--:++D<M)&&S(W[D],D,W)!==!1;);return y}}function t9(d){return function(h,y,S){for(var M=-1,D=Ut(h),W=S(h),G=W.length;G--;){var Q=W[d?G:++M];if(y(D[Q],Q,D)===!1)break}return h}}function Kie(d,h,y){var S=h&w,M=ld(d);function D(){var W=this&&this!==Ln&&this instanceof D?M:d;return W.apply(S?y:this,arguments)}return D}function n9(d){return function(h){h=Bt(h);var y=eu(h)?xo(h):n,S=y?y[0]:h.charAt(0),M=y?Ps(y,1).join(""):h.slice(1);return S[d]()+M}}function lu(d){return function(h){return n2(eT(N9(h).replace(Pre,"")),d,"")}}function ld(d){return function(){var h=arguments;switch(h.length){case 0:return new d;case 1:return new d(h[0]);case 2:return new d(h[0],h[1]);case 3:return new d(h[0],h[1],h[2]);case 4:return new d(h[0],h[1],h[2],h[3]);case 5:return new d(h[0],h[1],h[2],h[3],h[4]);case 6:return new d(h[0],h[1],h[2],h[3],h[4],h[5]);case 7:return new d(h[0],h[1],h[2],h[3],h[4],h[5],h[6])}var y=su(d.prototype),S=d.apply(y,h);return nn(S)?S:y}}function Gie(d,h,y){var S=ld(d);function M(){for(var D=arguments.length,W=le(D),G=D,Q=uu(M);G--;)W[G]=arguments[G];var ve=D<3&&W[0]!==Q&&W[D-1]!==Q?[]:Bs(W,Q);if(D-=ve.length,D<y)return a9(d,h,hm,M.placeholder,n,W,ve,n,n,y-D);var be=this&&this!==Ln&&this instanceof M?S:d;return Sr(be,this,W)}return M}function r9(d){return function(h,y,S){var M=Ut(h);if(!dr(h)){var D=Xe(y,3);h=_n(h),y=function(G){return D(M[G],G,M)}}var W=d(h,y,S);return W>-1?M[D?h[W]:W]:n}}function o9(d){return Oi(function(h){var y=h.length,S=y,M=Qr.prototype.thru;for(d&&h.reverse();S--;){var D=h[S];if(typeof D!="function")throw new Zr(a);if(M&&!W&&bm(D)=="wrapper")var W=new Qr([],!0)}for(S=W?S:y;++S<y;){D=h[S];var G=bm(D),Q=G=="wrapper"?P2(D):n;Q&&H2(Q[0])&&Q[1]==(A|E|T|V)&&!Q[4].length&&Q[9]==1?W=W[bm(Q[0])].apply(W,Q[3]):W=D.length==1&&H2(D)?W[G]():W.thru(D)}return function(){var ve=arguments,be=ve[0];if(W&&ve.length==1&&at(be))return W.plant(be).value();for(var ye=0,Be=y?h[ye].apply(this,ve):be;++ye<y;)Be=h[ye].call(this,Be);return Be}})}function hm(d,h,y,S,M,D,W,G,Q,ve){var be=h&A,ye=h&w,Be=h&x,He=h&(E|k),Je=h&O,gt=Be?n:ld(d);function Ze(){for(var yt=arguments.length,Ct=le(yt),Mr=yt;Mr--;)Ct[Mr]=arguments[Mr];if(He)var tr=uu(Ze),Or=ioe(Ct,tr);if(S&&(Ct=Q_(Ct,S,M,He)),D&&(Ct=N_(Ct,D,W,He)),yt-=Or,He&&yt<ve){var fn=Bs(Ct,tr);return a9(d,h,hm,Ze.placeholder,y,Ct,fn,G,Q,ve-yt)}var Eo=ye?y:this,Ri=Be?Eo[d]:d;return yt=Ct.length,G?Ct=pse(Ct,G):Je&&yt>1&&Ct.reverse(),be&&Q<yt&&(Ct.length=Q),this&&this!==Ln&&this instanceof Ze&&(Ri=gt||ld(Ri)),Ri.apply(Eo,Ct)}return Ze}function i9(d,h){return function(y,S){return xie(y,d,h(S),{})}}function mm(d,h){return function(y,S){var M;if(y===n&&S===n)return h;if(y!==n&&(M=y),S!==n){if(M===n)return S;typeof y=="string"||typeof S=="string"?(y=Tr(y),S=Tr(S)):(y=j_(y),S=j_(S)),M=d(y,S)}return M}}function I2(d){return Oi(function(h){return h=Qt(h,_r(Xe())),vt(function(y){var S=this;return d(h,function(M){return Sr(M,S,y)})})})}function gm(d,h){h=h===n?" ":Tr(h);var y=h.length;if(y<2)return y?S2(h,d):h;var S=S2(h,nm(d/tu(h)));return eu(h)?Ps(xo(S),0,d).join(""):S.slice(0,d)}function Xie(d,h,y,S){var M=h&w,D=ld(d);function W(){for(var G=-1,Q=arguments.length,ve=-1,be=S.length,ye=le(be+Q),Be=this&&this!==Ln&&this instanceof W?D:d;++ve<be;)ye[ve]=S[ve];for(;Q--;)ye[ve++]=arguments[++G];return Sr(Be,M?y:this,ye)}return W}function s9(d){return function(h,y,S){return S&&typeof S!="number"&&er(h,y,S)&&(y=S=n),h=Li(h),y===n?(y=h,h=0):y=Li(y),S=S===n?h<y?1:-1:Li(S),Lie(h,y,S,d)}}function vm(d){return function(h,y){return typeof h=="string"&&typeof y=="string"||(h=no(h),y=no(y)),d(h,y)}}function a9(d,h,y,S,M,D,W,G,Q,ve){var be=h&E,ye=be?W:n,Be=be?n:W,He=be?D:n,Je=be?n:D;h|=be?T:_,h&=~(be?_:T),h&C||(h&=-4);var gt=[d,h,M,He,ye,Je,Be,G,Q,ve],Ze=y.apply(n,gt);return H2(d)&&y9(Ze,gt),Ze.placeholder=S,w9(Ze,d,h)}function L2(d){var h=wn[d];return function(y,S){if(y=no(y),S=S==null?0:jn(ft(S),292),S&&w_(y)){var M=(Bt(y)+"e").split("e"),D=h(M[0]+"e"+(+M[1]+S));return M=(Bt(D)+"e").split("e"),+(M[0]+"e"+(+M[1]-S))}return h(y)}}var Yie=ou&&1/Kh(new ou([,-0]))[1]==L?function(d){return new ou(d)}:ty;function l9(d){return function(h){var y=qn(h);return y==Ue?u2(h):y==xe?foe(h):ooe(h,d(h))}}function Mi(d,h,y,S,M,D,W,G){var Q=h&x;if(!Q&&typeof d!="function")throw new Zr(a);var ve=S?S.length:0;if(ve||(h&=-97,S=M=n),W=W===n?W:xn(ft(W),0),G=G===n?G:ft(G),ve-=M?M.length:0,h&_){var be=S,ye=M;S=M=n}var Be=Q?n:P2(d),He=[d,h,y,S,M,be,ye,D,W,G];if(Be&&cse(He,Be),d=He[0],h=He[1],y=He[2],S=He[3],M=He[4],G=He[9]=He[9]===n?Q?0:d.length:xn(He[9]-ve,0),!G&&h&(E|k)&&(h&=-25),!h||h==w)var Je=Kie(d,h,y);else h==E||h==k?Je=Gie(d,h,G):(h==T||h==(w|T))&&!M.length?Je=Xie(d,h,y,S):Je=hm.apply(n,He);var gt=Be?U_:y9;return w9(gt(Je,He),d,h)}function u9(d,h,y,S){return d===n||ko(d,ru[y])&&!It.call(S,y)?h:d}function c9(d,h,y,S,M,D){return nn(d)&&nn(h)&&(D.set(h,d),cm(d,h,n,c9,D),D.delete(h)),d}function Jie(d){return dd(d)?n:d}function d9(d,h,y,S,M,D){var W=y&v,G=d.length,Q=h.length;if(G!=Q&&!(W&&Q>G))return!1;var ve=D.get(d),be=D.get(h);if(ve&&be)return ve==h&&be==d;var ye=-1,Be=!0,He=y&b?new Fa:n;for(D.set(d,h),D.set(h,d);++ye<G;){var Je=d[ye],gt=h[ye];if(S)var Ze=W?S(gt,Je,ye,h,d,D):S(Je,gt,ye,d,h,D);if(Ze!==n){if(Ze)continue;Be=!1;break}if(He){if(!r2(h,function(yt,Ct){if(!Zc(He,Ct)&&(Je===yt||M(Je,yt,y,S,D)))return He.push(Ct)})){Be=!1;break}}else if(!(Je===gt||M(Je,gt,y,S,D))){Be=!1;break}}return D.delete(d),D.delete(h),Be}function Zie(d,h,y,S,M,D,W){switch(y){case we:if(d.byteLength!=h.byteLength||d.byteOffset!=h.byteOffset)return!1;d=d.buffer,h=h.buffer;case oe:return!(d.byteLength!=h.byteLength||!D(new Qh(d),new Qh(h)));case ee:case te:case We:return ko(+d,+h);case pe:return d.name==h.name&&d.message==h.message;case he:case Pe:return d==h+"";case Ue:var G=u2;case xe:var Q=S&v;if(G||(G=Kh),d.size!=h.size&&!Q)return!1;var ve=W.get(d);if(ve)return ve==h;S|=b,W.set(d,h);var be=d9(G(d),G(h),S,M,D,W);return W.delete(d),be;case nt:if(nd)return nd.call(d)==nd.call(h)}return!1}function Qie(d,h,y,S,M,D){var W=y&v,G=R2(d),Q=G.length,ve=R2(h),be=ve.length;if(Q!=be&&!W)return!1;for(var ye=Q;ye--;){var Be=G[ye];if(!(W?Be in h:It.call(h,Be)))return!1}var He=D.get(d),Je=D.get(h);if(He&&Je)return He==h&&Je==d;var gt=!0;D.set(d,h),D.set(h,d);for(var Ze=W;++ye<Q;){Be=G[ye];var yt=d[Be],Ct=h[Be];if(S)var Mr=W?S(Ct,yt,Be,h,d,D):S(yt,Ct,Be,d,h,D);if(!(Mr===n?yt===Ct||M(yt,Ct,y,S,D):Mr)){gt=!1;break}Ze||(Ze=Be=="constructor")}if(gt&&!Ze){var tr=d.constructor,Or=h.constructor;tr!=Or&&"constructor"in d&&"constructor"in h&&!(typeof tr=="function"&&tr instanceof tr&&typeof Or=="function"&&Or instanceof Or)&&(gt=!1)}return D.delete(d),D.delete(h),gt}function Oi(d){return U2(v9(d,n,_9),d+"")}function R2(d){return B_(d,_n,F2)}function D2(d){return B_(d,fr,f9)}var P2=om?function(d){return om.get(d)}:ty;function bm(d){for(var h=d.name+"",y=iu[h],S=It.call(iu,h)?y.length:0;S--;){var M=y[S],D=M.func;if(D==null||D==d)return M.name}return h}function uu(d){var h=It.call(I,"placeholder")?I:d;return h.placeholder}function Xe(){var d=I.iteratee||N2;return d=d===N2?R_:d,arguments.length?d(arguments[0],arguments[1]):d}function ym(d,h){var y=d.__data__;return sse(h)?y[typeof h=="string"?"string":"hash"]:y.map}function V2(d){for(var h=_n(d),y=h.length;y--;){var S=h[y],M=d[S];h[y]=[S,M,m9(M)]}return h}function za(d,h){var y=uoe(d,h);return L_(y)?y:n}function Nie(d){var h=It.call(d,Pa),y=d[Pa];try{d[Pa]=n;var S=!0}catch{}var M=Jh.call(d);return S&&(h?d[Pa]=y:delete d[Pa]),M}var F2=d2?function(d){return d==null?[]:(d=Ut(d),Ms(d2(d),function(h){return b_.call(d,h)}))}:ny,f9=d2?function(d){for(var h=[];d;)Os(h,F2(d)),d=Nh(d);return h}:ny,qn=Nn;(f2&&qn(new f2(new ArrayBuffer(1)))!=we||Nc&&qn(new Nc)!=Ue||p2&&qn(p2.resolve())!=q||ou&&qn(new ou)!=xe||ed&&qn(new ed)!=$)&&(qn=function(d){var h=Nn(d),y=h==At?d.constructor:n,S=y?Ua(y):"";if(S)switch(S){case Doe:return we;case Poe:return Ue;case Voe:return q;case Foe:return xe;case $oe:return $}return h});function ese(d,h,y){for(var S=-1,M=y.length;++S<M;){var D=y[S],W=D.size;switch(D.type){case"drop":d+=W;break;case"dropRight":h-=W;break;case"take":h=jn(h,d+W);break;case"takeRight":d=xn(d,h-W);break}}return{start:d,end:h}}function tse(d){var h=d.match(are);return h?h[1].split(lre):[]}function p9(d,h,y){h=Ds(h,d);for(var S=-1,M=h.length,D=!1;++S<M;){var W=No(h[S]);if(!(D=d!=null&&y(d,W)))break;d=d[W]}return D||++S!=M?D:(M=d==null?0:d.length,!!M&&_m(M)&&Bi(W,M)&&(at(d)||Wa(d)))}function nse(d){var h=d.length,y=new d.constructor(h);return h&&typeof d[0]=="string"&&It.call(d,"index")&&(y.index=d.index,y.input=d.input),y}function h9(d){return typeof d.constructor=="function"&&!ud(d)?su(Nh(d)):{}}function rse(d,h,y){var S=d.constructor;switch(h){case oe:return B2(d);case ee:case te:return new S(+d);case we:return Hie(d,y);case $e:case et:case Tt:case ue:case je:case re:case Me:case Ve:case it:return J_(d,y);case Ue:return new S;case We:case Pe:return new S(d);case he:return zie(d);case xe:return new S;case nt:return Uie(d)}}function ose(d,h){var y=h.length;if(!y)return d;var S=y-1;return h[S]=(y>1?"& ":"")+h[S],h=h.join(y>2?", ":" "),d.replace(sre,`{
|
|
116
|
+
*/df.exports,function(t,e){(function(){var n,r="4.17.21",i=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",l="Invalid `variable` option passed into `_.template`",u="__lodash_hash_undefined__",c=500,f="__lodash_placeholder__",p=1,m=2,g=4,v=1,b=2,w=1,x=2,C=4,E=8,k=16,T=32,_=64,A=128,V=256,O=512,B=30,H="...",j=800,Y=16,N=1,U=2,P=3,L=1/0,F=9007199254740991,R=17976931348623157e292,K=NaN,X=4294967295,ae=X-1,de=X>>>1,Ee=[["ary",A],["bind",w],["bindKey",x],["curry",E],["curryRight",k],["flip",O],["partial",T],["partialRight",_],["rearg",V]],ie="[object Arguments]",me="[object Array]",J="[object AsyncFunction]",ee="[object Boolean]",te="[object Date]",se="[object DOMException]",pe="[object Error]",_e="[object Function]",Ae="[object GeneratorFunction]",Ue="[object Map]",We="[object Number]",qe="[object Null]",At="[object Object]",q="[object Promise]",z="[object Proxy]",he="[object RegExp]",xe="[object Set]",Pe="[object String]",rt="[object Symbol]",Ke="[object Undefined]",$="[object WeakMap]",ne="[object WeakSet]",oe="[object ArrayBuffer]",we="[object DataView]",$e="[object Float32Array]",tt="[object Float64Array]",Tt="[object Int8Array]",ue="[object Int16Array]",je="[object Int32Array]",re="[object Uint8Array]",Me="[object Uint8ClampedArray]",Ve="[object Uint16Array]",it="[object Uint32Array]",nt=/\b__p \+= '';/g,bt=/\b(__p \+=) '' \+/g,Zt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,gn=/&(?:amp|lt|gt|quot|#39);/g,Si=/[&<>"']/g,Yo=RegExp(gn.source),Ts=RegExp(Si.source),As=/<%-([\s\S]+?)%>/g,Jo=/<%([\s\S]+?)%>/g,Hh=/<%=([\s\S]+?)%>/g,Jc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Zl=/^\w*$/,rre=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Kb=/[\\^$.*+?()[\]{}|]/g,ore=RegExp(Kb.source),Gb=/^\s+/,ire=/\s/,sre=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,are=/\{\n\/\* \[wrapped with (.+)\] \*/,lre=/,? & /,ure=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,cre=/[()=,{}\[\]\/\s]/,dre=/\\(\\)?/g,fre=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,IS=/\w*$/,pre=/^[-+]0x[0-9a-f]+$/i,hre=/^0b[01]+$/i,mre=/^\[object .+?Constructor\]$/,gre=/^0o[0-7]+$/i,vre=/^(?:0|[1-9]\d*)$/,bre=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,zh=/($^)/,yre=/['\n\r\u2028\u2029\\]/g,Uh="\\ud800-\\udfff",wre="\\u0300-\\u036f",xre="\\ufe20-\\ufe2f",Cre="\\u20d0-\\u20ff",LS=wre+xre+Cre,RS="\\u2700-\\u27bf",DS="a-z\\xdf-\\xf6\\xf8-\\xff",kre="\\xac\\xb1\\xd7\\xf7",Ere="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Sre="\\u2000-\\u206f",_re=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",PS="A-Z\\xc0-\\xd6\\xd8-\\xde",VS="\\ufe0e\\ufe0f",FS=kre+Ere+Sre+_re,Xb="['’]",Tre="["+Uh+"]",$S="["+FS+"]",Wh="["+LS+"]",HS="\\d+",Are="["+RS+"]",zS="["+DS+"]",US="[^"+Uh+FS+HS+RS+DS+PS+"]",Yb="\\ud83c[\\udffb-\\udfff]",Mre="(?:"+Wh+"|"+Yb+")",WS="[^"+Uh+"]",Jb="(?:\\ud83c[\\udde6-\\uddff]){2}",Zb="[\\ud800-\\udbff][\\udc00-\\udfff]",Ql="["+PS+"]",jS="\\u200d",qS="(?:"+zS+"|"+US+")",Ore="(?:"+Ql+"|"+US+")",KS="(?:"+Xb+"(?:d|ll|m|re|s|t|ve))?",GS="(?:"+Xb+"(?:D|LL|M|RE|S|T|VE))?",XS=Mre+"?",YS="["+VS+"]?",Bre="(?:"+jS+"(?:"+[WS,Jb,Zb].join("|")+")"+YS+XS+")*",Ire="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Lre="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",JS=YS+XS+Bre,Rre="(?:"+[Are,Jb,Zb].join("|")+")"+JS,Dre="(?:"+[WS+Wh+"?",Wh,Jb,Zb,Tre].join("|")+")",Pre=RegExp(Xb,"g"),Vre=RegExp(Wh,"g"),Qb=RegExp(Yb+"(?="+Yb+")|"+Dre+JS,"g"),Fre=RegExp([Ql+"?"+zS+"+"+KS+"(?="+[$S,Ql,"$"].join("|")+")",Ore+"+"+GS+"(?="+[$S,Ql+qS,"$"].join("|")+")",Ql+"?"+qS+"+"+KS,Ql+"+"+GS,Lre,Ire,HS,Rre].join("|"),"g"),$re=RegExp("["+jS+Uh+LS+VS+"]"),Hre=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,zre=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ure=-1,Xt={};Xt[$e]=Xt[tt]=Xt[Tt]=Xt[ue]=Xt[je]=Xt[re]=Xt[Me]=Xt[Ve]=Xt[it]=!0,Xt[ie]=Xt[me]=Xt[oe]=Xt[ee]=Xt[we]=Xt[te]=Xt[pe]=Xt[_e]=Xt[Ue]=Xt[We]=Xt[At]=Xt[he]=Xt[xe]=Xt[Pe]=Xt[$]=!1;var qt={};qt[ie]=qt[me]=qt[oe]=qt[we]=qt[ee]=qt[te]=qt[$e]=qt[tt]=qt[Tt]=qt[ue]=qt[je]=qt[Ue]=qt[We]=qt[At]=qt[he]=qt[xe]=qt[Pe]=qt[rt]=qt[re]=qt[Me]=qt[Ve]=qt[it]=!0,qt[pe]=qt[_e]=qt[$]=!1;var Wre={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},jre={"&":"&","<":"<",">":">",'"':""","'":"'"},qre={"&":"&","<":"<",">":">",""":'"',"'":"'"},Kre={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Gre=parseFloat,Xre=parseInt,ZS=typeof ml=="object"&&ml&&ml.Object===Object&&ml,Yre=typeof self=="object"&&self&&self.Object===Object&&self,Ln=ZS||Yre||Function("return this")(),Nb=e&&!e.nodeType&&e,Da=Nb&&!0&&t&&!t.nodeType&&t,QS=Da&&Da.exports===Nb,e2=QS&&ZS.process,Yr=function(){try{var Z=Da&&Da.require&&Da.require("util").types;return Z||e2&&e2.binding&&e2.binding("util")}catch{}}(),NS=Yr&&Yr.isArrayBuffer,e_=Yr&&Yr.isDate,t_=Yr&&Yr.isMap,n_=Yr&&Yr.isRegExp,r_=Yr&&Yr.isSet,o_=Yr&&Yr.isTypedArray;function Sr(Z,fe,le){switch(le.length){case 0:return Z.call(fe);case 1:return Z.call(fe,le[0]);case 2:return Z.call(fe,le[0],le[1]);case 3:return Z.call(fe,le[0],le[1],le[2])}return Z.apply(fe,le)}function Jre(Z,fe,le,De){for(var st=-1,Mt=Z==null?0:Z.length;++st<Mt;){var wn=Z[st];fe(De,wn,le(wn),Z)}return De}function Jr(Z,fe){for(var le=-1,De=Z==null?0:Z.length;++le<De&&fe(Z[le],le,Z)!==!1;);return Z}function Zre(Z,fe){for(var le=Z==null?0:Z.length;le--&&fe(Z[le],le,Z)!==!1;);return Z}function i_(Z,fe){for(var le=-1,De=Z==null?0:Z.length;++le<De;)if(!fe(Z[le],le,Z))return!1;return!0}function Ms(Z,fe){for(var le=-1,De=Z==null?0:Z.length,st=0,Mt=[];++le<De;){var wn=Z[le];fe(wn,le,Z)&&(Mt[st++]=wn)}return Mt}function jh(Z,fe){var le=Z==null?0:Z.length;return!!le&&Nl(Z,fe,0)>-1}function t2(Z,fe,le){for(var De=-1,st=Z==null?0:Z.length;++De<st;)if(le(fe,Z[De]))return!0;return!1}function Qt(Z,fe){for(var le=-1,De=Z==null?0:Z.length,st=Array(De);++le<De;)st[le]=fe(Z[le],le,Z);return st}function Os(Z,fe){for(var le=-1,De=fe.length,st=Z.length;++le<De;)Z[st+le]=fe[le];return Z}function n2(Z,fe,le,De){var st=-1,Mt=Z==null?0:Z.length;for(De&&Mt&&(le=Z[++st]);++st<Mt;)le=fe(le,Z[st],st,Z);return le}function Qre(Z,fe,le,De){var st=Z==null?0:Z.length;for(De&&st&&(le=Z[--st]);st--;)le=fe(le,Z[st],st,Z);return le}function r2(Z,fe){for(var le=-1,De=Z==null?0:Z.length;++le<De;)if(fe(Z[le],le,Z))return!0;return!1}var Nre=o2("length");function eoe(Z){return Z.split("")}function toe(Z){return Z.match(ure)||[]}function s_(Z,fe,le){var De;return le(Z,function(st,Mt,wn){if(fe(st,Mt,wn))return De=Mt,!1}),De}function qh(Z,fe,le,De){for(var st=Z.length,Mt=le+(De?1:-1);De?Mt--:++Mt<st;)if(fe(Z[Mt],Mt,Z))return Mt;return-1}function Nl(Z,fe,le){return fe===fe?poe(Z,fe,le):qh(Z,a_,le)}function noe(Z,fe,le,De){for(var st=le-1,Mt=Z.length;++st<Mt;)if(De(Z[st],fe))return st;return-1}function a_(Z){return Z!==Z}function l_(Z,fe){var le=Z==null?0:Z.length;return le?s2(Z,fe)/le:K}function o2(Z){return function(fe){return fe==null?n:fe[Z]}}function i2(Z){return function(fe){return Z==null?n:Z[fe]}}function u_(Z,fe,le,De,st){return st(Z,function(Mt,wn,Ut){le=De?(De=!1,Mt):fe(le,Mt,wn,Ut)}),le}function roe(Z,fe){var le=Z.length;for(Z.sort(fe);le--;)Z[le]=Z[le].value;return Z}function s2(Z,fe){for(var le,De=-1,st=Z.length;++De<st;){var Mt=fe(Z[De]);Mt!==n&&(le=le===n?Mt:le+Mt)}return le}function a2(Z,fe){for(var le=-1,De=Array(Z);++le<Z;)De[le]=fe(le);return De}function ooe(Z,fe){return Qt(fe,function(le){return[le,Z[le]]})}function c_(Z){return Z&&Z.slice(0,h_(Z)+1).replace(Gb,"")}function _r(Z){return function(fe){return Z(fe)}}function l2(Z,fe){return Qt(fe,function(le){return Z[le]})}function Zc(Z,fe){return Z.has(fe)}function d_(Z,fe){for(var le=-1,De=Z.length;++le<De&&Nl(fe,Z[le],0)>-1;);return le}function f_(Z,fe){for(var le=Z.length;le--&&Nl(fe,Z[le],0)>-1;);return le}function ioe(Z,fe){for(var le=Z.length,De=0;le--;)Z[le]===fe&&++De;return De}var soe=i2(Wre),aoe=i2(jre);function loe(Z){return"\\"+Kre[Z]}function uoe(Z,fe){return Z==null?n:Z[fe]}function eu(Z){return $re.test(Z)}function coe(Z){return Hre.test(Z)}function doe(Z){for(var fe,le=[];!(fe=Z.next()).done;)le.push(fe.value);return le}function u2(Z){var fe=-1,le=Array(Z.size);return Z.forEach(function(De,st){le[++fe]=[st,De]}),le}function p_(Z,fe){return function(le){return Z(fe(le))}}function Bs(Z,fe){for(var le=-1,De=Z.length,st=0,Mt=[];++le<De;){var wn=Z[le];(wn===fe||wn===f)&&(Z[le]=f,Mt[st++]=le)}return Mt}function Kh(Z){var fe=-1,le=Array(Z.size);return Z.forEach(function(De){le[++fe]=De}),le}function foe(Z){var fe=-1,le=Array(Z.size);return Z.forEach(function(De){le[++fe]=[De,De]}),le}function poe(Z,fe,le){for(var De=le-1,st=Z.length;++De<st;)if(Z[De]===fe)return De;return-1}function hoe(Z,fe,le){for(var De=le+1;De--;)if(Z[De]===fe)return De;return De}function tu(Z){return eu(Z)?goe(Z):Nre(Z)}function xo(Z){return eu(Z)?voe(Z):eoe(Z)}function h_(Z){for(var fe=Z.length;fe--&&ire.test(Z.charAt(fe)););return fe}var moe=i2(qre);function goe(Z){for(var fe=Qb.lastIndex=0;Qb.test(Z);)++fe;return fe}function voe(Z){return Z.match(Qb)||[]}function boe(Z){return Z.match(Fre)||[]}var yoe=function Z(fe){fe=fe==null?Ln:nu.defaults(Ln.Object(),fe,nu.pick(Ln,zre));var le=fe.Array,De=fe.Date,st=fe.Error,Mt=fe.Function,wn=fe.Math,Ut=fe.Object,c2=fe.RegExp,woe=fe.String,Zr=fe.TypeError,Gh=le.prototype,xoe=Mt.prototype,ru=Ut.prototype,Xh=fe["__core-js_shared__"],Yh=xoe.toString,It=ru.hasOwnProperty,Coe=0,m_=function(){var d=/[^.]+$/.exec(Xh&&Xh.keys&&Xh.keys.IE_PROTO||"");return d?"Symbol(src)_1."+d:""}(),Jh=ru.toString,koe=Yh.call(Ut),Eoe=Ln._,Soe=c2("^"+Yh.call(It).replace(Kb,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Zh=QS?fe.Buffer:n,Is=fe.Symbol,Qh=fe.Uint8Array,g_=Zh?Zh.allocUnsafe:n,Nh=p_(Ut.getPrototypeOf,Ut),v_=Ut.create,b_=ru.propertyIsEnumerable,em=Gh.splice,y_=Is?Is.isConcatSpreadable:n,Qc=Is?Is.iterator:n,Pa=Is?Is.toStringTag:n,tm=function(){try{var d=za(Ut,"defineProperty");return d({},"",{}),d}catch{}}(),_oe=fe.clearTimeout!==Ln.clearTimeout&&fe.clearTimeout,Toe=De&&De.now!==Ln.Date.now&&De.now,Aoe=fe.setTimeout!==Ln.setTimeout&&fe.setTimeout,nm=wn.ceil,rm=wn.floor,d2=Ut.getOwnPropertySymbols,Moe=Zh?Zh.isBuffer:n,w_=fe.isFinite,Ooe=Gh.join,Boe=p_(Ut.keys,Ut),xn=wn.max,jn=wn.min,Ioe=De.now,Loe=fe.parseInt,x_=wn.random,Roe=Gh.reverse,f2=za(fe,"DataView"),Nc=za(fe,"Map"),p2=za(fe,"Promise"),ou=za(fe,"Set"),ed=za(fe,"WeakMap"),td=za(Ut,"create"),om=ed&&new ed,iu={},Doe=Ua(f2),Poe=Ua(Nc),Voe=Ua(p2),Foe=Ua(ou),$oe=Ua(ed),im=Is?Is.prototype:n,nd=im?im.valueOf:n,C_=im?im.toString:n;function I(d){if(ln(d)&&!at(d)&&!(d instanceof xt)){if(d instanceof Qr)return d;if(It.call(d,"__wrapped__"))return k9(d)}return new Qr(d)}var su=function(){function d(){}return function(h){if(!nn(h))return{};if(v_)return v_(h);d.prototype=h;var y=new d;return d.prototype=n,y}}();function sm(){}function Qr(d,h){this.__wrapped__=d,this.__actions__=[],this.__chain__=!!h,this.__index__=0,this.__values__=n}I.templateSettings={escape:As,evaluate:Jo,interpolate:Hh,variable:"",imports:{_:I}},I.prototype=sm.prototype,I.prototype.constructor=I,Qr.prototype=su(sm.prototype),Qr.prototype.constructor=Qr;function xt(d){this.__wrapped__=d,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=X,this.__views__=[]}function Hoe(){var d=new xt(this.__wrapped__);return d.__actions__=cr(this.__actions__),d.__dir__=this.__dir__,d.__filtered__=this.__filtered__,d.__iteratees__=cr(this.__iteratees__),d.__takeCount__=this.__takeCount__,d.__views__=cr(this.__views__),d}function zoe(){if(this.__filtered__){var d=new xt(this);d.__dir__=-1,d.__filtered__=!0}else d=this.clone(),d.__dir__*=-1;return d}function Uoe(){var d=this.__wrapped__.value(),h=this.__dir__,y=at(d),S=h<0,M=y?d.length:0,D=ese(0,M,this.__views__),W=D.start,G=D.end,Q=G-W,ve=S?G:W-1,be=this.__iteratees__,ye=be.length,Be=0,He=jn(Q,this.__takeCount__);if(!y||!S&&M==Q&&He==Q)return K_(d,this.__actions__);var Je=[];e:for(;Q--&&Be<He;){ve+=h;for(var gt=-1,Ze=d[ve];++gt<ye;){var yt=be[gt],Ct=yt.iteratee,Mr=yt.type,tr=Ct(Ze);if(Mr==U)Ze=tr;else if(!tr){if(Mr==N)continue e;break e}}Je[Be++]=Ze}return Je}xt.prototype=su(sm.prototype),xt.prototype.constructor=xt;function Va(d){var h=-1,y=d==null?0:d.length;for(this.clear();++h<y;){var S=d[h];this.set(S[0],S[1])}}function Woe(){this.__data__=td?td(null):{},this.size=0}function joe(d){var h=this.has(d)&&delete this.__data__[d];return this.size-=h?1:0,h}function qoe(d){var h=this.__data__;if(td){var y=h[d];return y===u?n:y}return It.call(h,d)?h[d]:n}function Koe(d){var h=this.__data__;return td?h[d]!==n:It.call(h,d)}function Goe(d,h){var y=this.__data__;return this.size+=this.has(d)?0:1,y[d]=td&&h===n?u:h,this}Va.prototype.clear=Woe,Va.prototype.delete=joe,Va.prototype.get=qoe,Va.prototype.has=Koe,Va.prototype.set=Goe;function _i(d){var h=-1,y=d==null?0:d.length;for(this.clear();++h<y;){var S=d[h];this.set(S[0],S[1])}}function Xoe(){this.__data__=[],this.size=0}function Yoe(d){var h=this.__data__,y=am(h,d);if(y<0)return!1;var S=h.length-1;return y==S?h.pop():em.call(h,y,1),--this.size,!0}function Joe(d){var h=this.__data__,y=am(h,d);return y<0?n:h[y][1]}function Zoe(d){return am(this.__data__,d)>-1}function Qoe(d,h){var y=this.__data__,S=am(y,d);return S<0?(++this.size,y.push([d,h])):y[S][1]=h,this}_i.prototype.clear=Xoe,_i.prototype.delete=Yoe,_i.prototype.get=Joe,_i.prototype.has=Zoe,_i.prototype.set=Qoe;function Ti(d){var h=-1,y=d==null?0:d.length;for(this.clear();++h<y;){var S=d[h];this.set(S[0],S[1])}}function Noe(){this.size=0,this.__data__={hash:new Va,map:new(Nc||_i),string:new Va}}function eie(d){var h=ym(this,d).delete(d);return this.size-=h?1:0,h}function tie(d){return ym(this,d).get(d)}function nie(d){return ym(this,d).has(d)}function rie(d,h){var y=ym(this,d),S=y.size;return y.set(d,h),this.size+=y.size==S?0:1,this}Ti.prototype.clear=Noe,Ti.prototype.delete=eie,Ti.prototype.get=tie,Ti.prototype.has=nie,Ti.prototype.set=rie;function Fa(d){var h=-1,y=d==null?0:d.length;for(this.__data__=new Ti;++h<y;)this.add(d[h])}function oie(d){return this.__data__.set(d,u),this}function iie(d){return this.__data__.has(d)}Fa.prototype.add=Fa.prototype.push=oie,Fa.prototype.has=iie;function Co(d){var h=this.__data__=new _i(d);this.size=h.size}function sie(){this.__data__=new _i,this.size=0}function aie(d){var h=this.__data__,y=h.delete(d);return this.size=h.size,y}function lie(d){return this.__data__.get(d)}function uie(d){return this.__data__.has(d)}function cie(d,h){var y=this.__data__;if(y instanceof _i){var S=y.__data__;if(!Nc||S.length<i-1)return S.push([d,h]),this.size=++y.size,this;y=this.__data__=new Ti(S)}return y.set(d,h),this.size=y.size,this}Co.prototype.clear=sie,Co.prototype.delete=aie,Co.prototype.get=lie,Co.prototype.has=uie,Co.prototype.set=cie;function k_(d,h){var y=at(d),S=!y&&Wa(d),M=!y&&!S&&Vs(d),D=!y&&!S&&!M&&cu(d),W=y||S||M||D,G=W?a2(d.length,woe):[],Q=G.length;for(var ve in d)(h||It.call(d,ve))&&!(W&&(ve=="length"||M&&(ve=="offset"||ve=="parent")||D&&(ve=="buffer"||ve=="byteLength"||ve=="byteOffset")||Bi(ve,Q)))&&G.push(ve);return G}function E_(d){var h=d.length;return h?d[E2(0,h-1)]:n}function die(d,h){return wm(cr(d),$a(h,0,d.length))}function fie(d){return wm(cr(d))}function h2(d,h,y){(y!==n&&!ko(d[h],y)||y===n&&!(h in d))&&Ai(d,h,y)}function rd(d,h,y){var S=d[h];(!(It.call(d,h)&&ko(S,y))||y===n&&!(h in d))&&Ai(d,h,y)}function am(d,h){for(var y=d.length;y--;)if(ko(d[y][0],h))return y;return-1}function pie(d,h,y,S){return Ls(d,function(M,D,W){h(S,M,y(M),W)}),S}function S_(d,h){return d&&Qo(h,_n(h),d)}function hie(d,h){return d&&Qo(h,fr(h),d)}function Ai(d,h,y){h=="__proto__"&&tm?tm(d,h,{configurable:!0,enumerable:!0,value:y,writable:!0}):d[h]=y}function m2(d,h){for(var y=-1,S=h.length,M=le(S),D=d==null;++y<S;)M[y]=D?n:Y2(d,h[y]);return M}function $a(d,h,y){return d===d&&(y!==n&&(d=d<=y?d:y),h!==n&&(d=d>=h?d:h)),d}function Nr(d,h,y,S,M,D){var W,G=h&p,Q=h&m,ve=h&g;if(y&&(W=M?y(d,S,M,D):y(d)),W!==n)return W;if(!nn(d))return d;var be=at(d);if(be){if(W=nse(d),!G)return cr(d,W)}else{var ye=qn(d),Be=ye==_e||ye==Ae;if(Vs(d))return Y_(d,G);if(ye==At||ye==ie||Be&&!M){if(W=Q||Be?{}:h9(d),!G)return Q?qie(d,hie(W,d)):jie(d,S_(W,d))}else{if(!qt[ye])return M?d:{};W=rse(d,ye,G)}}D||(D=new Co);var He=D.get(d);if(He)return He;D.set(d,W),W9(d)?d.forEach(function(Ze){W.add(Nr(Ze,h,y,Ze,d,D))}):z9(d)&&d.forEach(function(Ze,yt){W.set(yt,Nr(Ze,h,y,yt,d,D))});var Je=ve?Q?D2:R2:Q?fr:_n,gt=be?n:Je(d);return Jr(gt||d,function(Ze,yt){gt&&(yt=Ze,Ze=d[yt]),rd(W,yt,Nr(Ze,h,y,yt,d,D))}),W}function mie(d){var h=_n(d);return function(y){return __(y,d,h)}}function __(d,h,y){var S=y.length;if(d==null)return!S;for(d=Ut(d);S--;){var M=y[S],D=h[M],W=d[M];if(W===n&&!(M in d)||!D(W))return!1}return!0}function T_(d,h,y){if(typeof d!="function")throw new Zr(a);return cd(function(){d.apply(n,y)},h)}function od(d,h,y,S){var M=-1,D=jh,W=!0,G=d.length,Q=[],ve=h.length;if(!G)return Q;y&&(h=Qt(h,_r(y))),S?(D=t2,W=!1):h.length>=i&&(D=Zc,W=!1,h=new Fa(h));e:for(;++M<G;){var be=d[M],ye=y==null?be:y(be);if(be=S||be!==0?be:0,W&&ye===ye){for(var Be=ve;Be--;)if(h[Be]===ye)continue e;Q.push(be)}else D(h,ye,S)||Q.push(be)}return Q}var Ls=e9(Zo),A_=e9(v2,!0);function gie(d,h){var y=!0;return Ls(d,function(S,M,D){return y=!!h(S,M,D),y}),y}function lm(d,h,y){for(var S=-1,M=d.length;++S<M;){var D=d[S],W=h(D);if(W!=null&&(G===n?W===W&&!Ar(W):y(W,G)))var G=W,Q=D}return Q}function vie(d,h,y,S){var M=d.length;for(y=ft(y),y<0&&(y=-y>M?0:M+y),S=S===n||S>M?M:ft(S),S<0&&(S+=M),S=y>S?0:q9(S);y<S;)d[y++]=h;return d}function M_(d,h){var y=[];return Ls(d,function(S,M,D){h(S,M,D)&&y.push(S)}),y}function Rn(d,h,y,S,M){var D=-1,W=d.length;for(y||(y=ise),M||(M=[]);++D<W;){var G=d[D];h>0&&y(G)?h>1?Rn(G,h-1,y,S,M):Os(M,G):S||(M[M.length]=G)}return M}var g2=t9(),O_=t9(!0);function Zo(d,h){return d&&g2(d,h,_n)}function v2(d,h){return d&&O_(d,h,_n)}function um(d,h){return Ms(h,function(y){return Ii(d[y])})}function Ha(d,h){h=Ds(h,d);for(var y=0,S=h.length;d!=null&&y<S;)d=d[No(h[y++])];return y&&y==S?d:n}function B_(d,h,y){var S=h(d);return at(d)?S:Os(S,y(d))}function Nn(d){return d==null?d===n?Ke:qe:Pa&&Pa in Ut(d)?Nie(d):fse(d)}function b2(d,h){return d>h}function bie(d,h){return d!=null&&It.call(d,h)}function yie(d,h){return d!=null&&h in Ut(d)}function wie(d,h,y){return d>=jn(h,y)&&d<xn(h,y)}function y2(d,h,y){for(var S=y?t2:jh,M=d[0].length,D=d.length,W=D,G=le(D),Q=1/0,ve=[];W--;){var be=d[W];W&&h&&(be=Qt(be,_r(h))),Q=jn(be.length,Q),G[W]=!y&&(h||M>=120&&be.length>=120)?new Fa(W&&be):n}be=d[0];var ye=-1,Be=G[0];e:for(;++ye<M&&ve.length<Q;){var He=be[ye],Je=h?h(He):He;if(He=y||He!==0?He:0,!(Be?Zc(Be,Je):S(ve,Je,y))){for(W=D;--W;){var gt=G[W];if(!(gt?Zc(gt,Je):S(d[W],Je,y)))continue e}Be&&Be.push(Je),ve.push(He)}}return ve}function xie(d,h,y,S){return Zo(d,function(M,D,W){h(S,y(M),D,W)}),S}function id(d,h,y){h=Ds(h,d),d=b9(d,h);var S=d==null?d:d[No(to(h))];return S==null?n:Sr(S,d,y)}function I_(d){return ln(d)&&Nn(d)==ie}function Cie(d){return ln(d)&&Nn(d)==oe}function kie(d){return ln(d)&&Nn(d)==te}function sd(d,h,y,S,M){return d===h?!0:d==null||h==null||!ln(d)&&!ln(h)?d!==d&&h!==h:Eie(d,h,y,S,sd,M)}function Eie(d,h,y,S,M,D){var W=at(d),G=at(h),Q=W?me:qn(d),ve=G?me:qn(h);Q=Q==ie?At:Q,ve=ve==ie?At:ve;var be=Q==At,ye=ve==At,Be=Q==ve;if(Be&&Vs(d)){if(!Vs(h))return!1;W=!0,be=!1}if(Be&&!be)return D||(D=new Co),W||cu(d)?d9(d,h,y,S,M,D):Zie(d,h,Q,y,S,M,D);if(!(y&v)){var He=be&&It.call(d,"__wrapped__"),Je=ye&&It.call(h,"__wrapped__");if(He||Je){var gt=He?d.value():d,Ze=Je?h.value():h;return D||(D=new Co),M(gt,Ze,y,S,D)}}return Be?(D||(D=new Co),Qie(d,h,y,S,M,D)):!1}function Sie(d){return ln(d)&&qn(d)==Ue}function w2(d,h,y,S){var M=y.length,D=M,W=!S;if(d==null)return!D;for(d=Ut(d);M--;){var G=y[M];if(W&&G[2]?G[1]!==d[G[0]]:!(G[0]in d))return!1}for(;++M<D;){G=y[M];var Q=G[0],ve=d[Q],be=G[1];if(W&&G[2]){if(ve===n&&!(Q in d))return!1}else{var ye=new Co;if(S)var Be=S(ve,be,Q,d,h,ye);if(!(Be===n?sd(be,ve,v|b,S,ye):Be))return!1}}return!0}function L_(d){if(!nn(d)||ase(d))return!1;var h=Ii(d)?Soe:mre;return h.test(Ua(d))}function _ie(d){return ln(d)&&Nn(d)==he}function Tie(d){return ln(d)&&qn(d)==xe}function Aie(d){return ln(d)&&_m(d.length)&&!!Xt[Nn(d)]}function R_(d){return typeof d=="function"?d:d==null?pr:typeof d=="object"?at(d)?V_(d[0],d[1]):P_(d):nT(d)}function x2(d){if(!ud(d))return Boe(d);var h=[];for(var y in Ut(d))It.call(d,y)&&y!="constructor"&&h.push(y);return h}function Mie(d){if(!nn(d))return dse(d);var h=ud(d),y=[];for(var S in d)S=="constructor"&&(h||!It.call(d,S))||y.push(S);return y}function C2(d,h){return d<h}function D_(d,h){var y=-1,S=dr(d)?le(d.length):[];return Ls(d,function(M,D,W){S[++y]=h(M,D,W)}),S}function P_(d){var h=V2(d);return h.length==1&&h[0][2]?g9(h[0][0],h[0][1]):function(y){return y===d||w2(y,d,h)}}function V_(d,h){return $2(d)&&m9(h)?g9(No(d),h):function(y){var S=Y2(y,d);return S===n&&S===h?J2(y,d):sd(h,S,v|b)}}function cm(d,h,y,S,M){d!==h&&g2(h,function(D,W){if(M||(M=new Co),nn(D))Oie(d,h,W,y,cm,S,M);else{var G=S?S(z2(d,W),D,W+"",d,h,M):n;G===n&&(G=D),h2(d,W,G)}},fr)}function Oie(d,h,y,S,M,D,W){var G=z2(d,y),Q=z2(h,y),ve=W.get(Q);if(ve){h2(d,y,ve);return}var be=D?D(G,Q,y+"",d,h,W):n,ye=be===n;if(ye){var Be=at(Q),He=!Be&&Vs(Q),Je=!Be&&!He&&cu(Q);be=Q,Be||He||Je?at(G)?be=G:dn(G)?be=cr(G):He?(ye=!1,be=Y_(Q,!0)):Je?(ye=!1,be=J_(Q,!0)):be=[]:dd(Q)||Wa(Q)?(be=G,Wa(G)?be=K9(G):(!nn(G)||Ii(G))&&(be=h9(Q))):ye=!1}ye&&(W.set(Q,be),M(be,Q,S,D,W),W.delete(Q)),h2(d,y,be)}function F_(d,h){var y=d.length;if(y)return h+=h<0?y:0,Bi(h,y)?d[h]:n}function $_(d,h,y){h.length?h=Qt(h,function(D){return at(D)?function(W){return Ha(W,D.length===1?D[0]:D)}:D}):h=[pr];var S=-1;h=Qt(h,_r(Xe()));var M=D_(d,function(D,W,G){var Q=Qt(h,function(ve){return ve(D)});return{criteria:Q,index:++S,value:D}});return roe(M,function(D,W){return Wie(D,W,y)})}function Bie(d,h){return H_(d,h,function(y,S){return J2(d,S)})}function H_(d,h,y){for(var S=-1,M=h.length,D={};++S<M;){var W=h[S],G=Ha(d,W);y(G,W)&&ad(D,Ds(W,d),G)}return D}function Iie(d){return function(h){return Ha(h,d)}}function k2(d,h,y,S){var M=S?noe:Nl,D=-1,W=h.length,G=d;for(d===h&&(h=cr(h)),y&&(G=Qt(d,_r(y)));++D<W;)for(var Q=0,ve=h[D],be=y?y(ve):ve;(Q=M(G,be,Q,S))>-1;)G!==d&&em.call(G,Q,1),em.call(d,Q,1);return d}function z_(d,h){for(var y=d?h.length:0,S=y-1;y--;){var M=h[y];if(y==S||M!==D){var D=M;Bi(M)?em.call(d,M,1):T2(d,M)}}return d}function E2(d,h){return d+rm(x_()*(h-d+1))}function Lie(d,h,y,S){for(var M=-1,D=xn(nm((h-d)/(y||1)),0),W=le(D);D--;)W[S?D:++M]=d,d+=y;return W}function S2(d,h){var y="";if(!d||h<1||h>F)return y;do h%2&&(y+=d),h=rm(h/2),h&&(d+=d);while(h);return y}function vt(d,h){return U2(v9(d,h,pr),d+"")}function Rie(d){return E_(du(d))}function Die(d,h){var y=du(d);return wm(y,$a(h,0,y.length))}function ad(d,h,y,S){if(!nn(d))return d;h=Ds(h,d);for(var M=-1,D=h.length,W=D-1,G=d;G!=null&&++M<D;){var Q=No(h[M]),ve=y;if(Q==="__proto__"||Q==="constructor"||Q==="prototype")return d;if(M!=W){var be=G[Q];ve=S?S(be,Q,G):n,ve===n&&(ve=nn(be)?be:Bi(h[M+1])?[]:{})}rd(G,Q,ve),G=G[Q]}return d}var U_=om?function(d,h){return om.set(d,h),d}:pr,Pie=tm?function(d,h){return tm(d,"toString",{configurable:!0,enumerable:!1,value:Q2(h),writable:!0})}:pr;function Vie(d){return wm(du(d))}function eo(d,h,y){var S=-1,M=d.length;h<0&&(h=-h>M?0:M+h),y=y>M?M:y,y<0&&(y+=M),M=h>y?0:y-h>>>0,h>>>=0;for(var D=le(M);++S<M;)D[S]=d[S+h];return D}function Fie(d,h){var y;return Ls(d,function(S,M,D){return y=h(S,M,D),!y}),!!y}function dm(d,h,y){var S=0,M=d==null?S:d.length;if(typeof h=="number"&&h===h&&M<=de){for(;S<M;){var D=S+M>>>1,W=d[D];W!==null&&!Ar(W)&&(y?W<=h:W<h)?S=D+1:M=D}return M}return _2(d,h,pr,y)}function _2(d,h,y,S){var M=0,D=d==null?0:d.length;if(D===0)return 0;h=y(h);for(var W=h!==h,G=h===null,Q=Ar(h),ve=h===n;M<D;){var be=rm((M+D)/2),ye=y(d[be]),Be=ye!==n,He=ye===null,Je=ye===ye,gt=Ar(ye);if(W)var Ze=S||Je;else ve?Ze=Je&&(S||Be):G?Ze=Je&&Be&&(S||!He):Q?Ze=Je&&Be&&!He&&(S||!gt):He||gt?Ze=!1:Ze=S?ye<=h:ye<h;Ze?M=be+1:D=be}return jn(D,ae)}function W_(d,h){for(var y=-1,S=d.length,M=0,D=[];++y<S;){var W=d[y],G=h?h(W):W;if(!y||!ko(G,Q)){var Q=G;D[M++]=W===0?0:W}}return D}function j_(d){return typeof d=="number"?d:Ar(d)?K:+d}function Tr(d){if(typeof d=="string")return d;if(at(d))return Qt(d,Tr)+"";if(Ar(d))return C_?C_.call(d):"";var h=d+"";return h=="0"&&1/d==-1/0?"-0":h}function Rs(d,h,y){var S=-1,M=jh,D=d.length,W=!0,G=[],Q=G;if(y)W=!1,M=t2;else if(D>=i){var ve=h?null:Yie(d);if(ve)return Kh(ve);W=!1,M=Zc,Q=new Fa}else Q=h?[]:G;e:for(;++S<D;){var be=d[S],ye=h?h(be):be;if(be=y||be!==0?be:0,W&&ye===ye){for(var Be=Q.length;Be--;)if(Q[Be]===ye)continue e;h&&Q.push(ye),G.push(be)}else M(Q,ye,y)||(Q!==G&&Q.push(ye),G.push(be))}return G}function T2(d,h){return h=Ds(h,d),d=b9(d,h),d==null||delete d[No(to(h))]}function q_(d,h,y,S){return ad(d,h,y(Ha(d,h)),S)}function fm(d,h,y,S){for(var M=d.length,D=S?M:-1;(S?D--:++D<M)&&h(d[D],D,d););return y?eo(d,S?0:D,S?D+1:M):eo(d,S?D+1:0,S?M:D)}function K_(d,h){var y=d;return y instanceof xt&&(y=y.value()),n2(h,function(S,M){return M.func.apply(M.thisArg,Os([S],M.args))},y)}function A2(d,h,y){var S=d.length;if(S<2)return S?Rs(d[0]):[];for(var M=-1,D=le(S);++M<S;)for(var W=d[M],G=-1;++G<S;)G!=M&&(D[M]=od(D[M]||W,d[G],h,y));return Rs(Rn(D,1),h,y)}function G_(d,h,y){for(var S=-1,M=d.length,D=h.length,W={};++S<M;){var G=S<D?h[S]:n;y(W,d[S],G)}return W}function M2(d){return dn(d)?d:[]}function O2(d){return typeof d=="function"?d:pr}function Ds(d,h){return at(d)?d:$2(d,h)?[d]:C9(Bt(d))}var $ie=vt;function Ps(d,h,y){var S=d.length;return y=y===n?S:y,!h&&y>=S?d:eo(d,h,y)}var X_=_oe||function(d){return Ln.clearTimeout(d)};function Y_(d,h){if(h)return d.slice();var y=d.length,S=g_?g_(y):new d.constructor(y);return d.copy(S),S}function B2(d){var h=new d.constructor(d.byteLength);return new Qh(h).set(new Qh(d)),h}function Hie(d,h){var y=h?B2(d.buffer):d.buffer;return new d.constructor(y,d.byteOffset,d.byteLength)}function zie(d){var h=new d.constructor(d.source,IS.exec(d));return h.lastIndex=d.lastIndex,h}function Uie(d){return nd?Ut(nd.call(d)):{}}function J_(d,h){var y=h?B2(d.buffer):d.buffer;return new d.constructor(y,d.byteOffset,d.length)}function Z_(d,h){if(d!==h){var y=d!==n,S=d===null,M=d===d,D=Ar(d),W=h!==n,G=h===null,Q=h===h,ve=Ar(h);if(!G&&!ve&&!D&&d>h||D&&W&&Q&&!G&&!ve||S&&W&&Q||!y&&Q||!M)return 1;if(!S&&!D&&!ve&&d<h||ve&&y&&M&&!S&&!D||G&&y&&M||!W&&M||!Q)return-1}return 0}function Wie(d,h,y){for(var S=-1,M=d.criteria,D=h.criteria,W=M.length,G=y.length;++S<W;){var Q=Z_(M[S],D[S]);if(Q){if(S>=G)return Q;var ve=y[S];return Q*(ve=="desc"?-1:1)}}return d.index-h.index}function Q_(d,h,y,S){for(var M=-1,D=d.length,W=y.length,G=-1,Q=h.length,ve=xn(D-W,0),be=le(Q+ve),ye=!S;++G<Q;)be[G]=h[G];for(;++M<W;)(ye||M<D)&&(be[y[M]]=d[M]);for(;ve--;)be[G++]=d[M++];return be}function N_(d,h,y,S){for(var M=-1,D=d.length,W=-1,G=y.length,Q=-1,ve=h.length,be=xn(D-G,0),ye=le(be+ve),Be=!S;++M<be;)ye[M]=d[M];for(var He=M;++Q<ve;)ye[He+Q]=h[Q];for(;++W<G;)(Be||M<D)&&(ye[He+y[W]]=d[M++]);return ye}function cr(d,h){var y=-1,S=d.length;for(h||(h=le(S));++y<S;)h[y]=d[y];return h}function Qo(d,h,y,S){var M=!y;y||(y={});for(var D=-1,W=h.length;++D<W;){var G=h[D],Q=S?S(y[G],d[G],G,y,d):n;Q===n&&(Q=d[G]),M?Ai(y,G,Q):rd(y,G,Q)}return y}function jie(d,h){return Qo(d,F2(d),h)}function qie(d,h){return Qo(d,f9(d),h)}function pm(d,h){return function(y,S){var M=at(y)?Jre:pie,D=h?h():{};return M(y,d,Xe(S,2),D)}}function au(d){return vt(function(h,y){var S=-1,M=y.length,D=M>1?y[M-1]:n,W=M>2?y[2]:n;for(D=d.length>3&&typeof D=="function"?(M--,D):n,W&&er(y[0],y[1],W)&&(D=M<3?n:D,M=1),h=Ut(h);++S<M;){var G=y[S];G&&d(h,G,S,D)}return h})}function e9(d,h){return function(y,S){if(y==null)return y;if(!dr(y))return d(y,S);for(var M=y.length,D=h?M:-1,W=Ut(y);(h?D--:++D<M)&&S(W[D],D,W)!==!1;);return y}}function t9(d){return function(h,y,S){for(var M=-1,D=Ut(h),W=S(h),G=W.length;G--;){var Q=W[d?G:++M];if(y(D[Q],Q,D)===!1)break}return h}}function Kie(d,h,y){var S=h&w,M=ld(d);function D(){var W=this&&this!==Ln&&this instanceof D?M:d;return W.apply(S?y:this,arguments)}return D}function n9(d){return function(h){h=Bt(h);var y=eu(h)?xo(h):n,S=y?y[0]:h.charAt(0),M=y?Ps(y,1).join(""):h.slice(1);return S[d]()+M}}function lu(d){return function(h){return n2(eT(N9(h).replace(Pre,"")),d,"")}}function ld(d){return function(){var h=arguments;switch(h.length){case 0:return new d;case 1:return new d(h[0]);case 2:return new d(h[0],h[1]);case 3:return new d(h[0],h[1],h[2]);case 4:return new d(h[0],h[1],h[2],h[3]);case 5:return new d(h[0],h[1],h[2],h[3],h[4]);case 6:return new d(h[0],h[1],h[2],h[3],h[4],h[5]);case 7:return new d(h[0],h[1],h[2],h[3],h[4],h[5],h[6])}var y=su(d.prototype),S=d.apply(y,h);return nn(S)?S:y}}function Gie(d,h,y){var S=ld(d);function M(){for(var D=arguments.length,W=le(D),G=D,Q=uu(M);G--;)W[G]=arguments[G];var ve=D<3&&W[0]!==Q&&W[D-1]!==Q?[]:Bs(W,Q);if(D-=ve.length,D<y)return a9(d,h,hm,M.placeholder,n,W,ve,n,n,y-D);var be=this&&this!==Ln&&this instanceof M?S:d;return Sr(be,this,W)}return M}function r9(d){return function(h,y,S){var M=Ut(h);if(!dr(h)){var D=Xe(y,3);h=_n(h),y=function(G){return D(M[G],G,M)}}var W=d(h,y,S);return W>-1?M[D?h[W]:W]:n}}function o9(d){return Oi(function(h){var y=h.length,S=y,M=Qr.prototype.thru;for(d&&h.reverse();S--;){var D=h[S];if(typeof D!="function")throw new Zr(a);if(M&&!W&&bm(D)=="wrapper")var W=new Qr([],!0)}for(S=W?S:y;++S<y;){D=h[S];var G=bm(D),Q=G=="wrapper"?P2(D):n;Q&&H2(Q[0])&&Q[1]==(A|E|T|V)&&!Q[4].length&&Q[9]==1?W=W[bm(Q[0])].apply(W,Q[3]):W=D.length==1&&H2(D)?W[G]():W.thru(D)}return function(){var ve=arguments,be=ve[0];if(W&&ve.length==1&&at(be))return W.plant(be).value();for(var ye=0,Be=y?h[ye].apply(this,ve):be;++ye<y;)Be=h[ye].call(this,Be);return Be}})}function hm(d,h,y,S,M,D,W,G,Q,ve){var be=h&A,ye=h&w,Be=h&x,He=h&(E|k),Je=h&O,gt=Be?n:ld(d);function Ze(){for(var yt=arguments.length,Ct=le(yt),Mr=yt;Mr--;)Ct[Mr]=arguments[Mr];if(He)var tr=uu(Ze),Or=ioe(Ct,tr);if(S&&(Ct=Q_(Ct,S,M,He)),D&&(Ct=N_(Ct,D,W,He)),yt-=Or,He&&yt<ve){var fn=Bs(Ct,tr);return a9(d,h,hm,Ze.placeholder,y,Ct,fn,G,Q,ve-yt)}var Eo=ye?y:this,Ri=Be?Eo[d]:d;return yt=Ct.length,G?Ct=pse(Ct,G):Je&&yt>1&&Ct.reverse(),be&&Q<yt&&(Ct.length=Q),this&&this!==Ln&&this instanceof Ze&&(Ri=gt||ld(Ri)),Ri.apply(Eo,Ct)}return Ze}function i9(d,h){return function(y,S){return xie(y,d,h(S),{})}}function mm(d,h){return function(y,S){var M;if(y===n&&S===n)return h;if(y!==n&&(M=y),S!==n){if(M===n)return S;typeof y=="string"||typeof S=="string"?(y=Tr(y),S=Tr(S)):(y=j_(y),S=j_(S)),M=d(y,S)}return M}}function I2(d){return Oi(function(h){return h=Qt(h,_r(Xe())),vt(function(y){var S=this;return d(h,function(M){return Sr(M,S,y)})})})}function gm(d,h){h=h===n?" ":Tr(h);var y=h.length;if(y<2)return y?S2(h,d):h;var S=S2(h,nm(d/tu(h)));return eu(h)?Ps(xo(S),0,d).join(""):S.slice(0,d)}function Xie(d,h,y,S){var M=h&w,D=ld(d);function W(){for(var G=-1,Q=arguments.length,ve=-1,be=S.length,ye=le(be+Q),Be=this&&this!==Ln&&this instanceof W?D:d;++ve<be;)ye[ve]=S[ve];for(;Q--;)ye[ve++]=arguments[++G];return Sr(Be,M?y:this,ye)}return W}function s9(d){return function(h,y,S){return S&&typeof S!="number"&&er(h,y,S)&&(y=S=n),h=Li(h),y===n?(y=h,h=0):y=Li(y),S=S===n?h<y?1:-1:Li(S),Lie(h,y,S,d)}}function vm(d){return function(h,y){return typeof h=="string"&&typeof y=="string"||(h=no(h),y=no(y)),d(h,y)}}function a9(d,h,y,S,M,D,W,G,Q,ve){var be=h&E,ye=be?W:n,Be=be?n:W,He=be?D:n,Je=be?n:D;h|=be?T:_,h&=~(be?_:T),h&C||(h&=-4);var gt=[d,h,M,He,ye,Je,Be,G,Q,ve],Ze=y.apply(n,gt);return H2(d)&&y9(Ze,gt),Ze.placeholder=S,w9(Ze,d,h)}function L2(d){var h=wn[d];return function(y,S){if(y=no(y),S=S==null?0:jn(ft(S),292),S&&w_(y)){var M=(Bt(y)+"e").split("e"),D=h(M[0]+"e"+(+M[1]+S));return M=(Bt(D)+"e").split("e"),+(M[0]+"e"+(+M[1]-S))}return h(y)}}var Yie=ou&&1/Kh(new ou([,-0]))[1]==L?function(d){return new ou(d)}:ty;function l9(d){return function(h){var y=qn(h);return y==Ue?u2(h):y==xe?foe(h):ooe(h,d(h))}}function Mi(d,h,y,S,M,D,W,G){var Q=h&x;if(!Q&&typeof d!="function")throw new Zr(a);var ve=S?S.length:0;if(ve||(h&=-97,S=M=n),W=W===n?W:xn(ft(W),0),G=G===n?G:ft(G),ve-=M?M.length:0,h&_){var be=S,ye=M;S=M=n}var Be=Q?n:P2(d),He=[d,h,y,S,M,be,ye,D,W,G];if(Be&&cse(He,Be),d=He[0],h=He[1],y=He[2],S=He[3],M=He[4],G=He[9]=He[9]===n?Q?0:d.length:xn(He[9]-ve,0),!G&&h&(E|k)&&(h&=-25),!h||h==w)var Je=Kie(d,h,y);else h==E||h==k?Je=Gie(d,h,G):(h==T||h==(w|T))&&!M.length?Je=Xie(d,h,y,S):Je=hm.apply(n,He);var gt=Be?U_:y9;return w9(gt(Je,He),d,h)}function u9(d,h,y,S){return d===n||ko(d,ru[y])&&!It.call(S,y)?h:d}function c9(d,h,y,S,M,D){return nn(d)&&nn(h)&&(D.set(h,d),cm(d,h,n,c9,D),D.delete(h)),d}function Jie(d){return dd(d)?n:d}function d9(d,h,y,S,M,D){var W=y&v,G=d.length,Q=h.length;if(G!=Q&&!(W&&Q>G))return!1;var ve=D.get(d),be=D.get(h);if(ve&&be)return ve==h&&be==d;var ye=-1,Be=!0,He=y&b?new Fa:n;for(D.set(d,h),D.set(h,d);++ye<G;){var Je=d[ye],gt=h[ye];if(S)var Ze=W?S(gt,Je,ye,h,d,D):S(Je,gt,ye,d,h,D);if(Ze!==n){if(Ze)continue;Be=!1;break}if(He){if(!r2(h,function(yt,Ct){if(!Zc(He,Ct)&&(Je===yt||M(Je,yt,y,S,D)))return He.push(Ct)})){Be=!1;break}}else if(!(Je===gt||M(Je,gt,y,S,D))){Be=!1;break}}return D.delete(d),D.delete(h),Be}function Zie(d,h,y,S,M,D,W){switch(y){case we:if(d.byteLength!=h.byteLength||d.byteOffset!=h.byteOffset)return!1;d=d.buffer,h=h.buffer;case oe:return!(d.byteLength!=h.byteLength||!D(new Qh(d),new Qh(h)));case ee:case te:case We:return ko(+d,+h);case pe:return d.name==h.name&&d.message==h.message;case he:case Pe:return d==h+"";case Ue:var G=u2;case xe:var Q=S&v;if(G||(G=Kh),d.size!=h.size&&!Q)return!1;var ve=W.get(d);if(ve)return ve==h;S|=b,W.set(d,h);var be=d9(G(d),G(h),S,M,D,W);return W.delete(d),be;case rt:if(nd)return nd.call(d)==nd.call(h)}return!1}function Qie(d,h,y,S,M,D){var W=y&v,G=R2(d),Q=G.length,ve=R2(h),be=ve.length;if(Q!=be&&!W)return!1;for(var ye=Q;ye--;){var Be=G[ye];if(!(W?Be in h:It.call(h,Be)))return!1}var He=D.get(d),Je=D.get(h);if(He&&Je)return He==h&&Je==d;var gt=!0;D.set(d,h),D.set(h,d);for(var Ze=W;++ye<Q;){Be=G[ye];var yt=d[Be],Ct=h[Be];if(S)var Mr=W?S(Ct,yt,Be,h,d,D):S(yt,Ct,Be,d,h,D);if(!(Mr===n?yt===Ct||M(yt,Ct,y,S,D):Mr)){gt=!1;break}Ze||(Ze=Be=="constructor")}if(gt&&!Ze){var tr=d.constructor,Or=h.constructor;tr!=Or&&"constructor"in d&&"constructor"in h&&!(typeof tr=="function"&&tr instanceof tr&&typeof Or=="function"&&Or instanceof Or)&&(gt=!1)}return D.delete(d),D.delete(h),gt}function Oi(d){return U2(v9(d,n,_9),d+"")}function R2(d){return B_(d,_n,F2)}function D2(d){return B_(d,fr,f9)}var P2=om?function(d){return om.get(d)}:ty;function bm(d){for(var h=d.name+"",y=iu[h],S=It.call(iu,h)?y.length:0;S--;){var M=y[S],D=M.func;if(D==null||D==d)return M.name}return h}function uu(d){var h=It.call(I,"placeholder")?I:d;return h.placeholder}function Xe(){var d=I.iteratee||N2;return d=d===N2?R_:d,arguments.length?d(arguments[0],arguments[1]):d}function ym(d,h){var y=d.__data__;return sse(h)?y[typeof h=="string"?"string":"hash"]:y.map}function V2(d){for(var h=_n(d),y=h.length;y--;){var S=h[y],M=d[S];h[y]=[S,M,m9(M)]}return h}function za(d,h){var y=uoe(d,h);return L_(y)?y:n}function Nie(d){var h=It.call(d,Pa),y=d[Pa];try{d[Pa]=n;var S=!0}catch{}var M=Jh.call(d);return S&&(h?d[Pa]=y:delete d[Pa]),M}var F2=d2?function(d){return d==null?[]:(d=Ut(d),Ms(d2(d),function(h){return b_.call(d,h)}))}:ny,f9=d2?function(d){for(var h=[];d;)Os(h,F2(d)),d=Nh(d);return h}:ny,qn=Nn;(f2&&qn(new f2(new ArrayBuffer(1)))!=we||Nc&&qn(new Nc)!=Ue||p2&&qn(p2.resolve())!=q||ou&&qn(new ou)!=xe||ed&&qn(new ed)!=$)&&(qn=function(d){var h=Nn(d),y=h==At?d.constructor:n,S=y?Ua(y):"";if(S)switch(S){case Doe:return we;case Poe:return Ue;case Voe:return q;case Foe:return xe;case $oe:return $}return h});function ese(d,h,y){for(var S=-1,M=y.length;++S<M;){var D=y[S],W=D.size;switch(D.type){case"drop":d+=W;break;case"dropRight":h-=W;break;case"take":h=jn(h,d+W);break;case"takeRight":d=xn(d,h-W);break}}return{start:d,end:h}}function tse(d){var h=d.match(are);return h?h[1].split(lre):[]}function p9(d,h,y){h=Ds(h,d);for(var S=-1,M=h.length,D=!1;++S<M;){var W=No(h[S]);if(!(D=d!=null&&y(d,W)))break;d=d[W]}return D||++S!=M?D:(M=d==null?0:d.length,!!M&&_m(M)&&Bi(W,M)&&(at(d)||Wa(d)))}function nse(d){var h=d.length,y=new d.constructor(h);return h&&typeof d[0]=="string"&&It.call(d,"index")&&(y.index=d.index,y.input=d.input),y}function h9(d){return typeof d.constructor=="function"&&!ud(d)?su(Nh(d)):{}}function rse(d,h,y){var S=d.constructor;switch(h){case oe:return B2(d);case ee:case te:return new S(+d);case we:return Hie(d,y);case $e:case tt:case Tt:case ue:case je:case re:case Me:case Ve:case it:return J_(d,y);case Ue:return new S;case We:case Pe:return new S(d);case he:return zie(d);case xe:return new S;case rt:return Uie(d)}}function ose(d,h){var y=h.length;if(!y)return d;var S=y-1;return h[S]=(y>1?"& ":"")+h[S],h=h.join(y>2?", ":" "),d.replace(sre,`{
|
|
117
117
|
/* [wrapped with `+h+`] */
|
|
118
|
-
`)}function ise(d){return at(d)||Wa(d)||!!(y_&&d&&d[y_])}function Bi(d,h){var y=typeof d;return h=h??F,!!h&&(y=="number"||y!="symbol"&&vre.test(d))&&d>-1&&d%1==0&&d<h}function er(d,h,y){if(!nn(y))return!1;var S=typeof h;return(S=="number"?dr(y)&&Bi(h,y.length):S=="string"&&h in y)?ko(y[h],d):!1}function $2(d,h){if(at(d))return!1;var y=typeof d;return y=="number"||y=="symbol"||y=="boolean"||d==null||Ar(d)?!0:Zl.test(d)||!Jc.test(d)||h!=null&&d in Ut(h)}function sse(d){var h=typeof d;return h=="string"||h=="number"||h=="symbol"||h=="boolean"?d!=="__proto__":d===null}function H2(d){var h=bm(d),y=I[h];if(typeof y!="function"||!(h in xt.prototype))return!1;if(d===y)return!0;var S=P2(y);return!!S&&d===S[0]}function ase(d){return!!m_&&m_ in d}var lse=Xh?Ii:ry;function ud(d){var h=d&&d.constructor,y=typeof h=="function"&&h.prototype||ru;return d===y}function m9(d){return d===d&&!nn(d)}function g9(d,h){return function(y){return y==null?!1:y[d]===h&&(h!==n||d in Ut(y))}}function use(d){var h=Em(d,function(S){return y.size===c&&y.clear(),S}),y=h.cache;return h}function cse(d,h){var y=d[1],S=h[1],M=y|S,D=M<(w|x|A),W=S==A&&y==E||S==A&&y==V&&d[7].length<=h[8]||S==(A|V)&&h[7].length<=h[8]&&y==E;if(!(D||W))return d;S&w&&(d[2]=h[2],M|=y&w?0:C);var G=h[3];if(G){var Q=d[3];d[3]=Q?Q_(Q,G,h[4]):G,d[4]=Q?Bs(d[3],f):h[4]}return G=h[5],G&&(Q=d[5],d[5]=Q?N_(Q,G,h[6]):G,d[6]=Q?Bs(d[5],f):h[6]),G=h[7],G&&(d[7]=G),S&A&&(d[8]=d[8]==null?h[8]:jn(d[8],h[8])),d[9]==null&&(d[9]=h[9]),d[0]=h[0],d[1]=M,d}function dse(d){var h=[];if(d!=null)for(var y in Ut(d))h.push(y);return h}function fse(d){return Jh.call(d)}function v9(d,h,y){return h=xn(h===n?d.length-1:h,0),function(){for(var S=arguments,M=-1,D=xn(S.length-h,0),W=le(D);++M<D;)W[M]=S[h+M];M=-1;for(var G=le(h+1);++M<h;)G[M]=S[M];return G[h]=y(W),Sr(d,this,G)}}function b9(d,h){return h.length<2?d:Ha(d,eo(h,0,-1))}function pse(d,h){for(var y=d.length,S=jn(h.length,y),M=cr(d);S--;){var D=h[S];d[S]=Bi(D,y)?M[D]:n}return d}function z2(d,h){if(!(h==="constructor"&&typeof d[h]=="function")&&h!="__proto__")return d[h]}var y9=x9(U_),cd=Aoe||function(d,h){return Ln.setTimeout(d,h)},U2=x9(Pie);function w9(d,h,y){var S=h+"";return U2(d,ose(S,hse(tse(S),y)))}function x9(d){var h=0,y=0;return function(){var S=Ioe(),M=Y-(S-y);if(y=S,M>0){if(++h>=j)return arguments[0]}else h=0;return d.apply(n,arguments)}}function wm(d,h){var y=-1,S=d.length,M=S-1;for(h=h===n?S:h;++y<h;){var D=E2(y,M),W=d[D];d[D]=d[y],d[y]=W}return d.length=h,d}var C9=use(function(d){var h=[];return d.charCodeAt(0)===46&&h.push(""),d.replace(rre,function(y,S,M,D){h.push(M?D.replace(dre,"$1"):S||y)}),h});function No(d){if(typeof d=="string"||Ar(d))return d;var h=d+"";return h=="0"&&1/d==-1/0?"-0":h}function Ua(d){if(d!=null){try{return Yh.call(d)}catch{}try{return d+""}catch{}}return""}function hse(d,h){return Jr(Ee,function(y){var S="_."+y[0];h&y[1]&&!jh(d,S)&&d.push(S)}),d.sort()}function k9(d){if(d instanceof xt)return d.clone();var h=new Qr(d.__wrapped__,d.__chain__);return h.__actions__=cr(d.__actions__),h.__index__=d.__index__,h.__values__=d.__values__,h}function mse(d,h,y){(y?er(d,h,y):h===n)?h=1:h=xn(ft(h),0);var S=d==null?0:d.length;if(!S||h<1)return[];for(var M=0,D=0,W=le(nm(S/h));M<S;)W[D++]=eo(d,M,M+=h);return W}function gse(d){for(var h=-1,y=d==null?0:d.length,S=0,M=[];++h<y;){var D=d[h];D&&(M[S++]=D)}return M}function vse(){var d=arguments.length;if(!d)return[];for(var h=le(d-1),y=arguments[0],S=d;S--;)h[S-1]=arguments[S];return Os(at(y)?cr(y):[y],Rn(h,1))}var bse=vt(function(d,h){return dn(d)?od(d,Rn(h,1,dn,!0)):[]}),yse=vt(function(d,h){var y=to(h);return dn(y)&&(y=n),dn(d)?od(d,Rn(h,1,dn,!0),Xe(y,2)):[]}),wse=vt(function(d,h){var y=to(h);return dn(y)&&(y=n),dn(d)?od(d,Rn(h,1,dn,!0),n,y):[]});function xse(d,h,y){var S=d==null?0:d.length;return S?(h=y||h===n?1:ft(h),eo(d,h<0?0:h,S)):[]}function Cse(d,h,y){var S=d==null?0:d.length;return S?(h=y||h===n?1:ft(h),h=S-h,eo(d,0,h<0?0:h)):[]}function kse(d,h){return d&&d.length?fm(d,Xe(h,3),!0,!0):[]}function Ese(d,h){return d&&d.length?fm(d,Xe(h,3),!0):[]}function Sse(d,h,y,S){var M=d==null?0:d.length;return M?(y&&typeof y!="number"&&er(d,h,y)&&(y=0,S=M),vie(d,h,y,S)):[]}function E9(d,h,y){var S=d==null?0:d.length;if(!S)return-1;var M=y==null?0:ft(y);return M<0&&(M=xn(S+M,0)),qh(d,Xe(h,3),M)}function S9(d,h,y){var S=d==null?0:d.length;if(!S)return-1;var M=S-1;return y!==n&&(M=ft(y),M=y<0?xn(S+M,0):jn(M,S-1)),qh(d,Xe(h,3),M,!0)}function _9(d){var h=d==null?0:d.length;return h?Rn(d,1):[]}function _se(d){var h=d==null?0:d.length;return h?Rn(d,L):[]}function Tse(d,h){var y=d==null?0:d.length;return y?(h=h===n?1:ft(h),Rn(d,h)):[]}function Ase(d){for(var h=-1,y=d==null?0:d.length,S={};++h<y;){var M=d[h];S[M[0]]=M[1]}return S}function T9(d){return d&&d.length?d[0]:n}function Mse(d,h,y){var S=d==null?0:d.length;if(!S)return-1;var M=y==null?0:ft(y);return M<0&&(M=xn(S+M,0)),Nl(d,h,M)}function Ose(d){var h=d==null?0:d.length;return h?eo(d,0,-1):[]}var Bse=vt(function(d){var h=Qt(d,M2);return h.length&&h[0]===d[0]?y2(h):[]}),Ise=vt(function(d){var h=to(d),y=Qt(d,M2);return h===to(y)?h=n:y.pop(),y.length&&y[0]===d[0]?y2(y,Xe(h,2)):[]}),Lse=vt(function(d){var h=to(d),y=Qt(d,M2);return h=typeof h=="function"?h:n,h&&y.pop(),y.length&&y[0]===d[0]?y2(y,n,h):[]});function Rse(d,h){return d==null?"":Ooe.call(d,h)}function to(d){var h=d==null?0:d.length;return h?d[h-1]:n}function Dse(d,h,y){var S=d==null?0:d.length;if(!S)return-1;var M=S;return y!==n&&(M=ft(y),M=M<0?xn(S+M,0):jn(M,S-1)),h===h?hoe(d,h,M):qh(d,a_,M,!0)}function Pse(d,h){return d&&d.length?F_(d,ft(h)):n}var Vse=vt(A9);function A9(d,h){return d&&d.length&&h&&h.length?k2(d,h):d}function Fse(d,h,y){return d&&d.length&&h&&h.length?k2(d,h,Xe(y,2)):d}function $se(d,h,y){return d&&d.length&&h&&h.length?k2(d,h,n,y):d}var Hse=Oi(function(d,h){var y=d==null?0:d.length,S=m2(d,h);return z_(d,Qt(h,function(M){return Bi(M,y)?+M:M}).sort(Z_)),S});function zse(d,h){var y=[];if(!(d&&d.length))return y;var S=-1,M=[],D=d.length;for(h=Xe(h,3);++S<D;){var W=d[S];h(W,S,d)&&(y.push(W),M.push(S))}return z_(d,M),y}function W2(d){return d==null?d:Roe.call(d)}function Use(d,h,y){var S=d==null?0:d.length;return S?(y&&typeof y!="number"&&er(d,h,y)?(h=0,y=S):(h=h==null?0:ft(h),y=y===n?S:ft(y)),eo(d,h,y)):[]}function Wse(d,h){return dm(d,h)}function jse(d,h,y){return _2(d,h,Xe(y,2))}function qse(d,h){var y=d==null?0:d.length;if(y){var S=dm(d,h);if(S<y&&ko(d[S],h))return S}return-1}function Kse(d,h){return dm(d,h,!0)}function Gse(d,h,y){return _2(d,h,Xe(y,2),!0)}function Xse(d,h){var y=d==null?0:d.length;if(y){var S=dm(d,h,!0)-1;if(ko(d[S],h))return S}return-1}function Yse(d){return d&&d.length?W_(d):[]}function Jse(d,h){return d&&d.length?W_(d,Xe(h,2)):[]}function Zse(d){var h=d==null?0:d.length;return h?eo(d,1,h):[]}function Qse(d,h,y){return d&&d.length?(h=y||h===n?1:ft(h),eo(d,0,h<0?0:h)):[]}function Nse(d,h,y){var S=d==null?0:d.length;return S?(h=y||h===n?1:ft(h),h=S-h,eo(d,h<0?0:h,S)):[]}function eae(d,h){return d&&d.length?fm(d,Xe(h,3),!1,!0):[]}function tae(d,h){return d&&d.length?fm(d,Xe(h,3)):[]}var nae=vt(function(d){return Rs(Rn(d,1,dn,!0))}),rae=vt(function(d){var h=to(d);return dn(h)&&(h=n),Rs(Rn(d,1,dn,!0),Xe(h,2))}),oae=vt(function(d){var h=to(d);return h=typeof h=="function"?h:n,Rs(Rn(d,1,dn,!0),n,h)});function iae(d){return d&&d.length?Rs(d):[]}function sae(d,h){return d&&d.length?Rs(d,Xe(h,2)):[]}function aae(d,h){return h=typeof h=="function"?h:n,d&&d.length?Rs(d,n,h):[]}function j2(d){if(!(d&&d.length))return[];var h=0;return d=Ms(d,function(y){if(dn(y))return h=xn(y.length,h),!0}),a2(h,function(y){return Qt(d,o2(y))})}function M9(d,h){if(!(d&&d.length))return[];var y=j2(d);return h==null?y:Qt(y,function(S){return Sr(h,n,S)})}var lae=vt(function(d,h){return dn(d)?od(d,h):[]}),uae=vt(function(d){return A2(Ms(d,dn))}),cae=vt(function(d){var h=to(d);return dn(h)&&(h=n),A2(Ms(d,dn),Xe(h,2))}),dae=vt(function(d){var h=to(d);return h=typeof h=="function"?h:n,A2(Ms(d,dn),n,h)}),fae=vt(j2);function pae(d,h){return G_(d||[],h||[],rd)}function hae(d,h){return G_(d||[],h||[],ad)}var mae=vt(function(d){var h=d.length,y=h>1?d[h-1]:n;return y=typeof y=="function"?(d.pop(),y):n,M9(d,y)});function O9(d){var h=I(d);return h.__chain__=!0,h}function gae(d,h){return h(d),d}function xm(d,h){return h(d)}var vae=Oi(function(d){var h=d.length,y=h?d[0]:0,S=this.__wrapped__,M=function(D){return m2(D,d)};return h>1||this.__actions__.length||!(S instanceof xt)||!Bi(y)?this.thru(M):(S=S.slice(y,+y+(h?1:0)),S.__actions__.push({func:xm,args:[M],thisArg:n}),new Qr(S,this.__chain__).thru(function(D){return h&&!D.length&&D.push(n),D}))});function bae(){return O9(this)}function yae(){return new Qr(this.value(),this.__chain__)}function wae(){this.__values__===n&&(this.__values__=j9(this.value()));var d=this.__index__>=this.__values__.length,h=d?n:this.__values__[this.__index__++];return{done:d,value:h}}function xae(){return this}function Cae(d){for(var h,y=this;y instanceof sm;){var S=k9(y);S.__index__=0,S.__values__=n,h?M.__wrapped__=S:h=S;var M=S;y=y.__wrapped__}return M.__wrapped__=d,h}function kae(){var d=this.__wrapped__;if(d instanceof xt){var h=d;return this.__actions__.length&&(h=new xt(this)),h=h.reverse(),h.__actions__.push({func:xm,args:[W2],thisArg:n}),new Qr(h,this.__chain__)}return this.thru(W2)}function Eae(){return K_(this.__wrapped__,this.__actions__)}var Sae=pm(function(d,h,y){It.call(d,y)?++d[y]:Ai(d,y,1)});function _ae(d,h,y){var S=at(d)?i_:gie;return y&&er(d,h,y)&&(h=n),S(d,Xe(h,3))}function Tae(d,h){var y=at(d)?Ms:M_;return y(d,Xe(h,3))}var Aae=r9(E9),Mae=r9(S9);function Oae(d,h){return Rn(Cm(d,h),1)}function Bae(d,h){return Rn(Cm(d,h),L)}function Iae(d,h,y){return y=y===n?1:ft(y),Rn(Cm(d,h),y)}function B9(d,h){var y=at(d)?Jr:Ls;return y(d,Xe(h,3))}function I9(d,h){var y=at(d)?Zre:A_;return y(d,Xe(h,3))}var Lae=pm(function(d,h,y){It.call(d,y)?d[y].push(h):Ai(d,y,[h])});function Rae(d,h,y,S){d=dr(d)?d:du(d),y=y&&!S?ft(y):0;var M=d.length;return y<0&&(y=xn(M+y,0)),Tm(d)?y<=M&&d.indexOf(h,y)>-1:!!M&&Nl(d,h,y)>-1}var Dae=vt(function(d,h,y){var S=-1,M=typeof h=="function",D=dr(d)?le(d.length):[];return Ls(d,function(W){D[++S]=M?Sr(h,W,y):id(W,h,y)}),D}),Pae=pm(function(d,h,y){Ai(d,y,h)});function Cm(d,h){var y=at(d)?Qt:D_;return y(d,Xe(h,3))}function Vae(d,h,y,S){return d==null?[]:(at(h)||(h=h==null?[]:[h]),y=S?n:y,at(y)||(y=y==null?[]:[y]),$_(d,h,y))}var Fae=pm(function(d,h,y){d[y?0:1].push(h)},function(){return[[],[]]});function $ae(d,h,y){var S=at(d)?n2:u_,M=arguments.length<3;return S(d,Xe(h,4),y,M,Ls)}function Hae(d,h,y){var S=at(d)?Qre:u_,M=arguments.length<3;return S(d,Xe(h,4),y,M,A_)}function zae(d,h){var y=at(d)?Ms:M_;return y(d,Sm(Xe(h,3)))}function Uae(d){var h=at(d)?E_:Rie;return h(d)}function Wae(d,h,y){(y?er(d,h,y):h===n)?h=1:h=ft(h);var S=at(d)?die:Die;return S(d,h)}function jae(d){var h=at(d)?fie:Vie;return h(d)}function qae(d){if(d==null)return 0;if(dr(d))return Tm(d)?tu(d):d.length;var h=qn(d);return h==Ue||h==xe?d.size:x2(d).length}function Kae(d,h,y){var S=at(d)?r2:Fie;return y&&er(d,h,y)&&(h=n),S(d,Xe(h,3))}var Gae=vt(function(d,h){if(d==null)return[];var y=h.length;return y>1&&er(d,h[0],h[1])?h=[]:y>2&&er(h[0],h[1],h[2])&&(h=[h[0]]),$_(d,Rn(h,1),[])}),km=Toe||function(){return Ln.Date.now()};function Xae(d,h){if(typeof h!="function")throw new Zr(a);return d=ft(d),function(){if(--d<1)return h.apply(this,arguments)}}function L9(d,h,y){return h=y?n:h,h=d&&h==null?d.length:h,Mi(d,A,n,n,n,n,h)}function R9(d,h){var y;if(typeof h!="function")throw new Zr(a);return d=ft(d),function(){return--d>0&&(y=h.apply(this,arguments)),d<=1&&(h=n),y}}var q2=vt(function(d,h,y){var S=w;if(y.length){var M=Bs(y,uu(q2));S|=T}return Mi(d,S,h,y,M)}),D9=vt(function(d,h,y){var S=w|x;if(y.length){var M=Bs(y,uu(D9));S|=T}return Mi(h,S,d,y,M)});function P9(d,h,y){h=y?n:h;var S=Mi(d,E,n,n,n,n,n,h);return S.placeholder=P9.placeholder,S}function V9(d,h,y){h=y?n:h;var S=Mi(d,k,n,n,n,n,n,h);return S.placeholder=V9.placeholder,S}function F9(d,h,y){var S,M,D,W,G,Q,ve=0,be=!1,ye=!1,Be=!0;if(typeof d!="function")throw new Zr(a);h=no(h)||0,nn(y)&&(be=!!y.leading,ye="maxWait"in y,D=ye?xn(no(y.maxWait)||0,h):D,Be="trailing"in y?!!y.trailing:Be);function He(fn){var Eo=S,Ri=M;return S=M=n,ve=fn,W=d.apply(Ri,Eo),W}function Je(fn){return ve=fn,G=cd(yt,h),be?He(fn):W}function gt(fn){var Eo=fn-Q,Ri=fn-ve,rT=h-Eo;return ye?jn(rT,D-Ri):rT}function Ze(fn){var Eo=fn-Q,Ri=fn-ve;return Q===n||Eo>=h||Eo<0||ye&&Ri>=D}function yt(){var fn=km();if(Ze(fn))return Ct(fn);G=cd(yt,gt(fn))}function Ct(fn){return G=n,Be&&S?He(fn):(S=M=n,W)}function Mr(){G!==n&&X_(G),ve=0,S=Q=M=G=n}function tr(){return G===n?W:Ct(km())}function Or(){var fn=km(),Eo=Ze(fn);if(S=arguments,M=this,Q=fn,Eo){if(G===n)return Je(Q);if(ye)return X_(G),G=cd(yt,h),He(Q)}return G===n&&(G=cd(yt,h)),W}return Or.cancel=Mr,Or.flush=tr,Or}var Yae=vt(function(d,h){return T_(d,1,h)}),Jae=vt(function(d,h,y){return T_(d,no(h)||0,y)});function Zae(d){return Mi(d,O)}function Em(d,h){if(typeof d!="function"||h!=null&&typeof h!="function")throw new Zr(a);var y=function(){var S=arguments,M=h?h.apply(this,S):S[0],D=y.cache;if(D.has(M))return D.get(M);var W=d.apply(this,S);return y.cache=D.set(M,W)||D,W};return y.cache=new(Em.Cache||Ti),y}Em.Cache=Ti;function Sm(d){if(typeof d!="function")throw new Zr(a);return function(){var h=arguments;switch(h.length){case 0:return!d.call(this);case 1:return!d.call(this,h[0]);case 2:return!d.call(this,h[0],h[1]);case 3:return!d.call(this,h[0],h[1],h[2])}return!d.apply(this,h)}}function Qae(d){return R9(2,d)}var Nae=$ie(function(d,h){h=h.length==1&&at(h[0])?Qt(h[0],_r(Xe())):Qt(Rn(h,1),_r(Xe()));var y=h.length;return vt(function(S){for(var M=-1,D=jn(S.length,y);++M<D;)S[M]=h[M].call(this,S[M]);return Sr(d,this,S)})}),K2=vt(function(d,h){var y=Bs(h,uu(K2));return Mi(d,T,n,h,y)}),$9=vt(function(d,h){var y=Bs(h,uu($9));return Mi(d,_,n,h,y)}),ele=Oi(function(d,h){return Mi(d,V,n,n,n,h)});function tle(d,h){if(typeof d!="function")throw new Zr(a);return h=h===n?h:ft(h),vt(d,h)}function nle(d,h){if(typeof d!="function")throw new Zr(a);return h=h==null?0:xn(ft(h),0),vt(function(y){var S=y[h],M=Ps(y,0,h);return S&&Os(M,S),Sr(d,this,M)})}function rle(d,h,y){var S=!0,M=!0;if(typeof d!="function")throw new Zr(a);return nn(y)&&(S="leading"in y?!!y.leading:S,M="trailing"in y?!!y.trailing:M),F9(d,h,{leading:S,maxWait:h,trailing:M})}function ole(d){return L9(d,1)}function ile(d,h){return K2(O2(h),d)}function sle(){if(!arguments.length)return[];var d=arguments[0];return at(d)?d:[d]}function ale(d){return Nr(d,g)}function lle(d,h){return h=typeof h=="function"?h:n,Nr(d,g,h)}function ule(d){return Nr(d,p|g)}function cle(d,h){return h=typeof h=="function"?h:n,Nr(d,p|g,h)}function dle(d,h){return h==null||__(d,h,_n(h))}function ko(d,h){return d===h||d!==d&&h!==h}var fle=vm(b2),ple=vm(function(d,h){return d>=h}),Wa=I_(function(){return arguments}())?I_:function(d){return ln(d)&&It.call(d,"callee")&&!b_.call(d,"callee")},at=le.isArray,hle=NS?_r(NS):Cie;function dr(d){return d!=null&&_m(d.length)&&!Ii(d)}function dn(d){return ln(d)&&dr(d)}function mle(d){return d===!0||d===!1||ln(d)&&Nn(d)==ee}var Vs=Moe||ry,gle=e_?_r(e_):kie;function vle(d){return ln(d)&&d.nodeType===1&&!dd(d)}function ble(d){if(d==null)return!0;if(dr(d)&&(at(d)||typeof d=="string"||typeof d.splice=="function"||Vs(d)||cu(d)||Wa(d)))return!d.length;var h=qn(d);if(h==Ue||h==xe)return!d.size;if(ud(d))return!x2(d).length;for(var y in d)if(It.call(d,y))return!1;return!0}function yle(d,h){return sd(d,h)}function wle(d,h,y){y=typeof y=="function"?y:n;var S=y?y(d,h):n;return S===n?sd(d,h,n,y):!!S}function G2(d){if(!ln(d))return!1;var h=Nn(d);return h==pe||h==se||typeof d.message=="string"&&typeof d.name=="string"&&!dd(d)}function xle(d){return typeof d=="number"&&w_(d)}function Ii(d){if(!nn(d))return!1;var h=Nn(d);return h==_e||h==Ae||h==J||h==z}function H9(d){return typeof d=="number"&&d==ft(d)}function _m(d){return typeof d=="number"&&d>-1&&d%1==0&&d<=F}function nn(d){var h=typeof d;return d!=null&&(h=="object"||h=="function")}function ln(d){return d!=null&&typeof d=="object"}var z9=t_?_r(t_):Sie;function Cle(d,h){return d===h||w2(d,h,V2(h))}function kle(d,h,y){return y=typeof y=="function"?y:n,w2(d,h,V2(h),y)}function Ele(d){return U9(d)&&d!=+d}function Sle(d){if(lse(d))throw new st(s);return L_(d)}function _le(d){return d===null}function Tle(d){return d==null}function U9(d){return typeof d=="number"||ln(d)&&Nn(d)==We}function dd(d){if(!ln(d)||Nn(d)!=At)return!1;var h=Nh(d);if(h===null)return!0;var y=It.call(h,"constructor")&&h.constructor;return typeof y=="function"&&y instanceof y&&Yh.call(y)==koe}var X2=n_?_r(n_):_ie;function Ale(d){return H9(d)&&d>=-9007199254740991&&d<=F}var W9=r_?_r(r_):Tie;function Tm(d){return typeof d=="string"||!at(d)&&ln(d)&&Nn(d)==Pe}function Ar(d){return typeof d=="symbol"||ln(d)&&Nn(d)==nt}var cu=o_?_r(o_):Aie;function Mle(d){return d===n}function Ole(d){return ln(d)&&qn(d)==$}function Ble(d){return ln(d)&&Nn(d)==ne}var Ile=vm(C2),Lle=vm(function(d,h){return d<=h});function j9(d){if(!d)return[];if(dr(d))return Tm(d)?xo(d):cr(d);if(Qc&&d[Qc])return doe(d[Qc]());var h=qn(d),y=h==Ue?u2:h==xe?Kh:du;return y(d)}function Li(d){if(!d)return d===0?d:0;if(d=no(d),d===L||d===-1/0){var h=d<0?-1:1;return h*R}return d===d?d:0}function ft(d){var h=Li(d),y=h%1;return h===h?y?h-y:h:0}function q9(d){return d?$a(ft(d),0,X):0}function no(d){if(typeof d=="number")return d;if(Ar(d))return K;if(nn(d)){var h=typeof d.valueOf=="function"?d.valueOf():d;d=nn(h)?h+"":h}if(typeof d!="string")return d===0?d:+d;d=c_(d);var y=hre.test(d);return y||gre.test(d)?Xre(d.slice(2),y?2:8):pre.test(d)?K:+d}function K9(d){return Qo(d,fr(d))}function Rle(d){return d?$a(ft(d),-9007199254740991,F):d===0?d:0}function Bt(d){return d==null?"":Tr(d)}var Dle=au(function(d,h){if(ud(h)||dr(h)){Qo(h,_n(h),d);return}for(var y in h)It.call(h,y)&&rd(d,y,h[y])}),G9=au(function(d,h){Qo(h,fr(h),d)}),Am=au(function(d,h,y,S){Qo(h,fr(h),d,S)}),Ple=au(function(d,h,y,S){Qo(h,_n(h),d,S)}),Vle=Oi(m2);function Fle(d,h){var y=su(d);return h==null?y:S_(y,h)}var $le=vt(function(d,h){d=Ut(d);var y=-1,S=h.length,M=S>2?h[2]:n;for(M&&er(h[0],h[1],M)&&(S=1);++y<S;)for(var D=h[y],W=fr(D),G=-1,Q=W.length;++G<Q;){var ve=W[G],be=d[ve];(be===n||ko(be,ru[ve])&&!It.call(d,ve))&&(d[ve]=D[ve])}return d}),Hle=vt(function(d){return d.push(n,c9),Sr(X9,n,d)});function zle(d,h){return s_(d,Xe(h,3),Zo)}function Ule(d,h){return s_(d,Xe(h,3),v2)}function Wle(d,h){return d==null?d:g2(d,Xe(h,3),fr)}function jle(d,h){return d==null?d:O_(d,Xe(h,3),fr)}function qle(d,h){return d&&Zo(d,Xe(h,3))}function Kle(d,h){return d&&v2(d,Xe(h,3))}function Gle(d){return d==null?[]:um(d,_n(d))}function Xle(d){return d==null?[]:um(d,fr(d))}function Y2(d,h,y){var S=d==null?n:Ha(d,h);return S===n?y:S}function Yle(d,h){return d!=null&&p9(d,h,bie)}function J2(d,h){return d!=null&&p9(d,h,yie)}var Jle=i9(function(d,h,y){h!=null&&typeof h.toString!="function"&&(h=Jh.call(h)),d[h]=y},Q2(pr)),Zle=i9(function(d,h,y){h!=null&&typeof h.toString!="function"&&(h=Jh.call(h)),It.call(d,h)?d[h].push(y):d[h]=[y]},Xe),Qle=vt(id);function _n(d){return dr(d)?k_(d):x2(d)}function fr(d){return dr(d)?k_(d,!0):Mie(d)}function Nle(d,h){var y={};return h=Xe(h,3),Zo(d,function(S,M,D){Ai(y,h(S,M,D),S)}),y}function eue(d,h){var y={};return h=Xe(h,3),Zo(d,function(S,M,D){Ai(y,M,h(S,M,D))}),y}var tue=au(function(d,h,y){cm(d,h,y)}),X9=au(function(d,h,y,S){cm(d,h,y,S)}),nue=Oi(function(d,h){var y={};if(d==null)return y;var S=!1;h=Qt(h,function(D){return D=Ds(D,d),S||(S=D.length>1),D}),Qo(d,D2(d),y),S&&(y=Nr(y,p|m|g,Jie));for(var M=h.length;M--;)T2(y,h[M]);return y});function rue(d,h){return Y9(d,Sm(Xe(h)))}var oue=Oi(function(d,h){return d==null?{}:Bie(d,h)});function Y9(d,h){if(d==null)return{};var y=Qt(D2(d),function(S){return[S]});return h=Xe(h),H_(d,y,function(S,M){return h(S,M[0])})}function iue(d,h,y){h=Ds(h,d);var S=-1,M=h.length;for(M||(M=1,d=n);++S<M;){var D=d==null?n:d[No(h[S])];D===n&&(S=M,D=y),d=Ii(D)?D.call(d):D}return d}function sue(d,h,y){return d==null?d:ad(d,h,y)}function aue(d,h,y,S){return S=typeof S=="function"?S:n,d==null?d:ad(d,h,y,S)}var J9=l9(_n),Z9=l9(fr);function lue(d,h,y){var S=at(d),M=S||Vs(d)||cu(d);if(h=Xe(h,4),y==null){var D=d&&d.constructor;M?y=S?new D:[]:nn(d)?y=Ii(D)?su(Nh(d)):{}:y={}}return(M?Jr:Zo)(d,function(W,G,Q){return h(y,W,G,Q)}),y}function uue(d,h){return d==null?!0:T2(d,h)}function cue(d,h,y){return d==null?d:q_(d,h,O2(y))}function due(d,h,y,S){return S=typeof S=="function"?S:n,d==null?d:q_(d,h,O2(y),S)}function du(d){return d==null?[]:l2(d,_n(d))}function fue(d){return d==null?[]:l2(d,fr(d))}function pue(d,h,y){return y===n&&(y=h,h=n),y!==n&&(y=no(y),y=y===y?y:0),h!==n&&(h=no(h),h=h===h?h:0),$a(no(d),h,y)}function hue(d,h,y){return h=Li(h),y===n?(y=h,h=0):y=Li(y),d=no(d),wie(d,h,y)}function mue(d,h,y){if(y&&typeof y!="boolean"&&er(d,h,y)&&(h=y=n),y===n&&(typeof h=="boolean"?(y=h,h=n):typeof d=="boolean"&&(y=d,d=n)),d===n&&h===n?(d=0,h=1):(d=Li(d),h===n?(h=d,d=0):h=Li(h)),d>h){var S=d;d=h,h=S}if(y||d%1||h%1){var M=x_();return jn(d+M*(h-d+Gre("1e-"+((M+"").length-1))),h)}return E2(d,h)}var gue=lu(function(d,h,y){return h=h.toLowerCase(),d+(y?Q9(h):h)});function Q9(d){return Z2(Bt(d).toLowerCase())}function N9(d){return d=Bt(d),d&&d.replace(bre,soe).replace(Vre,"")}function vue(d,h,y){d=Bt(d),h=Tr(h);var S=d.length;y=y===n?S:$a(ft(y),0,S);var M=y;return y-=h.length,y>=0&&d.slice(y,M)==h}function bue(d){return d=Bt(d),d&&Ts.test(d)?d.replace(Si,aoe):d}function yue(d){return d=Bt(d),d&&ore.test(d)?d.replace(Kb,"\\$&"):d}var wue=lu(function(d,h,y){return d+(y?"-":"")+h.toLowerCase()}),xue=lu(function(d,h,y){return d+(y?" ":"")+h.toLowerCase()}),Cue=n9("toLowerCase");function kue(d,h,y){d=Bt(d),h=ft(h);var S=h?tu(d):0;if(!h||S>=h)return d;var M=(h-S)/2;return gm(rm(M),y)+d+gm(nm(M),y)}function Eue(d,h,y){d=Bt(d),h=ft(h);var S=h?tu(d):0;return h&&S<h?d+gm(h-S,y):d}function Sue(d,h,y){d=Bt(d),h=ft(h);var S=h?tu(d):0;return h&&S<h?gm(h-S,y)+d:d}function _ue(d,h,y){return y||h==null?h=0:h&&(h=+h),Loe(Bt(d).replace(Gb,""),h||0)}function Tue(d,h,y){return(y?er(d,h,y):h===n)?h=1:h=ft(h),S2(Bt(d),h)}function Aue(){var d=arguments,h=Bt(d[0]);return d.length<3?h:h.replace(d[1],d[2])}var Mue=lu(function(d,h,y){return d+(y?"_":"")+h.toLowerCase()});function Oue(d,h,y){return y&&typeof y!="number"&&er(d,h,y)&&(h=y=n),y=y===n?X:y>>>0,y?(d=Bt(d),d&&(typeof h=="string"||h!=null&&!X2(h))&&(h=Tr(h),!h&&eu(d))?Ps(xo(d),0,y):d.split(h,y)):[]}var Bue=lu(function(d,h,y){return d+(y?" ":"")+Z2(h)});function Iue(d,h,y){return d=Bt(d),y=y==null?0:$a(ft(y),0,d.length),h=Tr(h),d.slice(y,y+h.length)==h}function Lue(d,h,y){var S=I.templateSettings;y&&er(d,h,y)&&(h=n),d=Bt(d),h=Am({},h,S,u9);var M=Am({},h.imports,S.imports,u9),D=_n(M),W=l2(M,D),G,Q,ve=0,be=h.interpolate||zh,ye="__p += '",Be=c2((h.escape||zh).source+"|"+be.source+"|"+(be===Hh?fre:zh).source+"|"+(h.evaluate||zh).source+"|$","g"),He="//# sourceURL="+(It.call(h,"sourceURL")?(h.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ure+"]")+`
|
|
118
|
+
`)}function ise(d){return at(d)||Wa(d)||!!(y_&&d&&d[y_])}function Bi(d,h){var y=typeof d;return h=h??F,!!h&&(y=="number"||y!="symbol"&&vre.test(d))&&d>-1&&d%1==0&&d<h}function er(d,h,y){if(!nn(y))return!1;var S=typeof h;return(S=="number"?dr(y)&&Bi(h,y.length):S=="string"&&h in y)?ko(y[h],d):!1}function $2(d,h){if(at(d))return!1;var y=typeof d;return y=="number"||y=="symbol"||y=="boolean"||d==null||Ar(d)?!0:Zl.test(d)||!Jc.test(d)||h!=null&&d in Ut(h)}function sse(d){var h=typeof d;return h=="string"||h=="number"||h=="symbol"||h=="boolean"?d!=="__proto__":d===null}function H2(d){var h=bm(d),y=I[h];if(typeof y!="function"||!(h in xt.prototype))return!1;if(d===y)return!0;var S=P2(y);return!!S&&d===S[0]}function ase(d){return!!m_&&m_ in d}var lse=Xh?Ii:ry;function ud(d){var h=d&&d.constructor,y=typeof h=="function"&&h.prototype||ru;return d===y}function m9(d){return d===d&&!nn(d)}function g9(d,h){return function(y){return y==null?!1:y[d]===h&&(h!==n||d in Ut(y))}}function use(d){var h=Em(d,function(S){return y.size===c&&y.clear(),S}),y=h.cache;return h}function cse(d,h){var y=d[1],S=h[1],M=y|S,D=M<(w|x|A),W=S==A&&y==E||S==A&&y==V&&d[7].length<=h[8]||S==(A|V)&&h[7].length<=h[8]&&y==E;if(!(D||W))return d;S&w&&(d[2]=h[2],M|=y&w?0:C);var G=h[3];if(G){var Q=d[3];d[3]=Q?Q_(Q,G,h[4]):G,d[4]=Q?Bs(d[3],f):h[4]}return G=h[5],G&&(Q=d[5],d[5]=Q?N_(Q,G,h[6]):G,d[6]=Q?Bs(d[5],f):h[6]),G=h[7],G&&(d[7]=G),S&A&&(d[8]=d[8]==null?h[8]:jn(d[8],h[8])),d[9]==null&&(d[9]=h[9]),d[0]=h[0],d[1]=M,d}function dse(d){var h=[];if(d!=null)for(var y in Ut(d))h.push(y);return h}function fse(d){return Jh.call(d)}function v9(d,h,y){return h=xn(h===n?d.length-1:h,0),function(){for(var S=arguments,M=-1,D=xn(S.length-h,0),W=le(D);++M<D;)W[M]=S[h+M];M=-1;for(var G=le(h+1);++M<h;)G[M]=S[M];return G[h]=y(W),Sr(d,this,G)}}function b9(d,h){return h.length<2?d:Ha(d,eo(h,0,-1))}function pse(d,h){for(var y=d.length,S=jn(h.length,y),M=cr(d);S--;){var D=h[S];d[S]=Bi(D,y)?M[D]:n}return d}function z2(d,h){if(!(h==="constructor"&&typeof d[h]=="function")&&h!="__proto__")return d[h]}var y9=x9(U_),cd=Aoe||function(d,h){return Ln.setTimeout(d,h)},U2=x9(Pie);function w9(d,h,y){var S=h+"";return U2(d,ose(S,hse(tse(S),y)))}function x9(d){var h=0,y=0;return function(){var S=Ioe(),M=Y-(S-y);if(y=S,M>0){if(++h>=j)return arguments[0]}else h=0;return d.apply(n,arguments)}}function wm(d,h){var y=-1,S=d.length,M=S-1;for(h=h===n?S:h;++y<h;){var D=E2(y,M),W=d[D];d[D]=d[y],d[y]=W}return d.length=h,d}var C9=use(function(d){var h=[];return d.charCodeAt(0)===46&&h.push(""),d.replace(rre,function(y,S,M,D){h.push(M?D.replace(dre,"$1"):S||y)}),h});function No(d){if(typeof d=="string"||Ar(d))return d;var h=d+"";return h=="0"&&1/d==-1/0?"-0":h}function Ua(d){if(d!=null){try{return Yh.call(d)}catch{}try{return d+""}catch{}}return""}function hse(d,h){return Jr(Ee,function(y){var S="_."+y[0];h&y[1]&&!jh(d,S)&&d.push(S)}),d.sort()}function k9(d){if(d instanceof xt)return d.clone();var h=new Qr(d.__wrapped__,d.__chain__);return h.__actions__=cr(d.__actions__),h.__index__=d.__index__,h.__values__=d.__values__,h}function mse(d,h,y){(y?er(d,h,y):h===n)?h=1:h=xn(ft(h),0);var S=d==null?0:d.length;if(!S||h<1)return[];for(var M=0,D=0,W=le(nm(S/h));M<S;)W[D++]=eo(d,M,M+=h);return W}function gse(d){for(var h=-1,y=d==null?0:d.length,S=0,M=[];++h<y;){var D=d[h];D&&(M[S++]=D)}return M}function vse(){var d=arguments.length;if(!d)return[];for(var h=le(d-1),y=arguments[0],S=d;S--;)h[S-1]=arguments[S];return Os(at(y)?cr(y):[y],Rn(h,1))}var bse=vt(function(d,h){return dn(d)?od(d,Rn(h,1,dn,!0)):[]}),yse=vt(function(d,h){var y=to(h);return dn(y)&&(y=n),dn(d)?od(d,Rn(h,1,dn,!0),Xe(y,2)):[]}),wse=vt(function(d,h){var y=to(h);return dn(y)&&(y=n),dn(d)?od(d,Rn(h,1,dn,!0),n,y):[]});function xse(d,h,y){var S=d==null?0:d.length;return S?(h=y||h===n?1:ft(h),eo(d,h<0?0:h,S)):[]}function Cse(d,h,y){var S=d==null?0:d.length;return S?(h=y||h===n?1:ft(h),h=S-h,eo(d,0,h<0?0:h)):[]}function kse(d,h){return d&&d.length?fm(d,Xe(h,3),!0,!0):[]}function Ese(d,h){return d&&d.length?fm(d,Xe(h,3),!0):[]}function Sse(d,h,y,S){var M=d==null?0:d.length;return M?(y&&typeof y!="number"&&er(d,h,y)&&(y=0,S=M),vie(d,h,y,S)):[]}function E9(d,h,y){var S=d==null?0:d.length;if(!S)return-1;var M=y==null?0:ft(y);return M<0&&(M=xn(S+M,0)),qh(d,Xe(h,3),M)}function S9(d,h,y){var S=d==null?0:d.length;if(!S)return-1;var M=S-1;return y!==n&&(M=ft(y),M=y<0?xn(S+M,0):jn(M,S-1)),qh(d,Xe(h,3),M,!0)}function _9(d){var h=d==null?0:d.length;return h?Rn(d,1):[]}function _se(d){var h=d==null?0:d.length;return h?Rn(d,L):[]}function Tse(d,h){var y=d==null?0:d.length;return y?(h=h===n?1:ft(h),Rn(d,h)):[]}function Ase(d){for(var h=-1,y=d==null?0:d.length,S={};++h<y;){var M=d[h];S[M[0]]=M[1]}return S}function T9(d){return d&&d.length?d[0]:n}function Mse(d,h,y){var S=d==null?0:d.length;if(!S)return-1;var M=y==null?0:ft(y);return M<0&&(M=xn(S+M,0)),Nl(d,h,M)}function Ose(d){var h=d==null?0:d.length;return h?eo(d,0,-1):[]}var Bse=vt(function(d){var h=Qt(d,M2);return h.length&&h[0]===d[0]?y2(h):[]}),Ise=vt(function(d){var h=to(d),y=Qt(d,M2);return h===to(y)?h=n:y.pop(),y.length&&y[0]===d[0]?y2(y,Xe(h,2)):[]}),Lse=vt(function(d){var h=to(d),y=Qt(d,M2);return h=typeof h=="function"?h:n,h&&y.pop(),y.length&&y[0]===d[0]?y2(y,n,h):[]});function Rse(d,h){return d==null?"":Ooe.call(d,h)}function to(d){var h=d==null?0:d.length;return h?d[h-1]:n}function Dse(d,h,y){var S=d==null?0:d.length;if(!S)return-1;var M=S;return y!==n&&(M=ft(y),M=M<0?xn(S+M,0):jn(M,S-1)),h===h?hoe(d,h,M):qh(d,a_,M,!0)}function Pse(d,h){return d&&d.length?F_(d,ft(h)):n}var Vse=vt(A9);function A9(d,h){return d&&d.length&&h&&h.length?k2(d,h):d}function Fse(d,h,y){return d&&d.length&&h&&h.length?k2(d,h,Xe(y,2)):d}function $se(d,h,y){return d&&d.length&&h&&h.length?k2(d,h,n,y):d}var Hse=Oi(function(d,h){var y=d==null?0:d.length,S=m2(d,h);return z_(d,Qt(h,function(M){return Bi(M,y)?+M:M}).sort(Z_)),S});function zse(d,h){var y=[];if(!(d&&d.length))return y;var S=-1,M=[],D=d.length;for(h=Xe(h,3);++S<D;){var W=d[S];h(W,S,d)&&(y.push(W),M.push(S))}return z_(d,M),y}function W2(d){return d==null?d:Roe.call(d)}function Use(d,h,y){var S=d==null?0:d.length;return S?(y&&typeof y!="number"&&er(d,h,y)?(h=0,y=S):(h=h==null?0:ft(h),y=y===n?S:ft(y)),eo(d,h,y)):[]}function Wse(d,h){return dm(d,h)}function jse(d,h,y){return _2(d,h,Xe(y,2))}function qse(d,h){var y=d==null?0:d.length;if(y){var S=dm(d,h);if(S<y&&ko(d[S],h))return S}return-1}function Kse(d,h){return dm(d,h,!0)}function Gse(d,h,y){return _2(d,h,Xe(y,2),!0)}function Xse(d,h){var y=d==null?0:d.length;if(y){var S=dm(d,h,!0)-1;if(ko(d[S],h))return S}return-1}function Yse(d){return d&&d.length?W_(d):[]}function Jse(d,h){return d&&d.length?W_(d,Xe(h,2)):[]}function Zse(d){var h=d==null?0:d.length;return h?eo(d,1,h):[]}function Qse(d,h,y){return d&&d.length?(h=y||h===n?1:ft(h),eo(d,0,h<0?0:h)):[]}function Nse(d,h,y){var S=d==null?0:d.length;return S?(h=y||h===n?1:ft(h),h=S-h,eo(d,h<0?0:h,S)):[]}function eae(d,h){return d&&d.length?fm(d,Xe(h,3),!1,!0):[]}function tae(d,h){return d&&d.length?fm(d,Xe(h,3)):[]}var nae=vt(function(d){return Rs(Rn(d,1,dn,!0))}),rae=vt(function(d){var h=to(d);return dn(h)&&(h=n),Rs(Rn(d,1,dn,!0),Xe(h,2))}),oae=vt(function(d){var h=to(d);return h=typeof h=="function"?h:n,Rs(Rn(d,1,dn,!0),n,h)});function iae(d){return d&&d.length?Rs(d):[]}function sae(d,h){return d&&d.length?Rs(d,Xe(h,2)):[]}function aae(d,h){return h=typeof h=="function"?h:n,d&&d.length?Rs(d,n,h):[]}function j2(d){if(!(d&&d.length))return[];var h=0;return d=Ms(d,function(y){if(dn(y))return h=xn(y.length,h),!0}),a2(h,function(y){return Qt(d,o2(y))})}function M9(d,h){if(!(d&&d.length))return[];var y=j2(d);return h==null?y:Qt(y,function(S){return Sr(h,n,S)})}var lae=vt(function(d,h){return dn(d)?od(d,h):[]}),uae=vt(function(d){return A2(Ms(d,dn))}),cae=vt(function(d){var h=to(d);return dn(h)&&(h=n),A2(Ms(d,dn),Xe(h,2))}),dae=vt(function(d){var h=to(d);return h=typeof h=="function"?h:n,A2(Ms(d,dn),n,h)}),fae=vt(j2);function pae(d,h){return G_(d||[],h||[],rd)}function hae(d,h){return G_(d||[],h||[],ad)}var mae=vt(function(d){var h=d.length,y=h>1?d[h-1]:n;return y=typeof y=="function"?(d.pop(),y):n,M9(d,y)});function O9(d){var h=I(d);return h.__chain__=!0,h}function gae(d,h){return h(d),d}function xm(d,h){return h(d)}var vae=Oi(function(d){var h=d.length,y=h?d[0]:0,S=this.__wrapped__,M=function(D){return m2(D,d)};return h>1||this.__actions__.length||!(S instanceof xt)||!Bi(y)?this.thru(M):(S=S.slice(y,+y+(h?1:0)),S.__actions__.push({func:xm,args:[M],thisArg:n}),new Qr(S,this.__chain__).thru(function(D){return h&&!D.length&&D.push(n),D}))});function bae(){return O9(this)}function yae(){return new Qr(this.value(),this.__chain__)}function wae(){this.__values__===n&&(this.__values__=j9(this.value()));var d=this.__index__>=this.__values__.length,h=d?n:this.__values__[this.__index__++];return{done:d,value:h}}function xae(){return this}function Cae(d){for(var h,y=this;y instanceof sm;){var S=k9(y);S.__index__=0,S.__values__=n,h?M.__wrapped__=S:h=S;var M=S;y=y.__wrapped__}return M.__wrapped__=d,h}function kae(){var d=this.__wrapped__;if(d instanceof xt){var h=d;return this.__actions__.length&&(h=new xt(this)),h=h.reverse(),h.__actions__.push({func:xm,args:[W2],thisArg:n}),new Qr(h,this.__chain__)}return this.thru(W2)}function Eae(){return K_(this.__wrapped__,this.__actions__)}var Sae=pm(function(d,h,y){It.call(d,y)?++d[y]:Ai(d,y,1)});function _ae(d,h,y){var S=at(d)?i_:gie;return y&&er(d,h,y)&&(h=n),S(d,Xe(h,3))}function Tae(d,h){var y=at(d)?Ms:M_;return y(d,Xe(h,3))}var Aae=r9(E9),Mae=r9(S9);function Oae(d,h){return Rn(Cm(d,h),1)}function Bae(d,h){return Rn(Cm(d,h),L)}function Iae(d,h,y){return y=y===n?1:ft(y),Rn(Cm(d,h),y)}function B9(d,h){var y=at(d)?Jr:Ls;return y(d,Xe(h,3))}function I9(d,h){var y=at(d)?Zre:A_;return y(d,Xe(h,3))}var Lae=pm(function(d,h,y){It.call(d,y)?d[y].push(h):Ai(d,y,[h])});function Rae(d,h,y,S){d=dr(d)?d:du(d),y=y&&!S?ft(y):0;var M=d.length;return y<0&&(y=xn(M+y,0)),Tm(d)?y<=M&&d.indexOf(h,y)>-1:!!M&&Nl(d,h,y)>-1}var Dae=vt(function(d,h,y){var S=-1,M=typeof h=="function",D=dr(d)?le(d.length):[];return Ls(d,function(W){D[++S]=M?Sr(h,W,y):id(W,h,y)}),D}),Pae=pm(function(d,h,y){Ai(d,y,h)});function Cm(d,h){var y=at(d)?Qt:D_;return y(d,Xe(h,3))}function Vae(d,h,y,S){return d==null?[]:(at(h)||(h=h==null?[]:[h]),y=S?n:y,at(y)||(y=y==null?[]:[y]),$_(d,h,y))}var Fae=pm(function(d,h,y){d[y?0:1].push(h)},function(){return[[],[]]});function $ae(d,h,y){var S=at(d)?n2:u_,M=arguments.length<3;return S(d,Xe(h,4),y,M,Ls)}function Hae(d,h,y){var S=at(d)?Qre:u_,M=arguments.length<3;return S(d,Xe(h,4),y,M,A_)}function zae(d,h){var y=at(d)?Ms:M_;return y(d,Sm(Xe(h,3)))}function Uae(d){var h=at(d)?E_:Rie;return h(d)}function Wae(d,h,y){(y?er(d,h,y):h===n)?h=1:h=ft(h);var S=at(d)?die:Die;return S(d,h)}function jae(d){var h=at(d)?fie:Vie;return h(d)}function qae(d){if(d==null)return 0;if(dr(d))return Tm(d)?tu(d):d.length;var h=qn(d);return h==Ue||h==xe?d.size:x2(d).length}function Kae(d,h,y){var S=at(d)?r2:Fie;return y&&er(d,h,y)&&(h=n),S(d,Xe(h,3))}var Gae=vt(function(d,h){if(d==null)return[];var y=h.length;return y>1&&er(d,h[0],h[1])?h=[]:y>2&&er(h[0],h[1],h[2])&&(h=[h[0]]),$_(d,Rn(h,1),[])}),km=Toe||function(){return Ln.Date.now()};function Xae(d,h){if(typeof h!="function")throw new Zr(a);return d=ft(d),function(){if(--d<1)return h.apply(this,arguments)}}function L9(d,h,y){return h=y?n:h,h=d&&h==null?d.length:h,Mi(d,A,n,n,n,n,h)}function R9(d,h){var y;if(typeof h!="function")throw new Zr(a);return d=ft(d),function(){return--d>0&&(y=h.apply(this,arguments)),d<=1&&(h=n),y}}var q2=vt(function(d,h,y){var S=w;if(y.length){var M=Bs(y,uu(q2));S|=T}return Mi(d,S,h,y,M)}),D9=vt(function(d,h,y){var S=w|x;if(y.length){var M=Bs(y,uu(D9));S|=T}return Mi(h,S,d,y,M)});function P9(d,h,y){h=y?n:h;var S=Mi(d,E,n,n,n,n,n,h);return S.placeholder=P9.placeholder,S}function V9(d,h,y){h=y?n:h;var S=Mi(d,k,n,n,n,n,n,h);return S.placeholder=V9.placeholder,S}function F9(d,h,y){var S,M,D,W,G,Q,ve=0,be=!1,ye=!1,Be=!0;if(typeof d!="function")throw new Zr(a);h=no(h)||0,nn(y)&&(be=!!y.leading,ye="maxWait"in y,D=ye?xn(no(y.maxWait)||0,h):D,Be="trailing"in y?!!y.trailing:Be);function He(fn){var Eo=S,Ri=M;return S=M=n,ve=fn,W=d.apply(Ri,Eo),W}function Je(fn){return ve=fn,G=cd(yt,h),be?He(fn):W}function gt(fn){var Eo=fn-Q,Ri=fn-ve,rT=h-Eo;return ye?jn(rT,D-Ri):rT}function Ze(fn){var Eo=fn-Q,Ri=fn-ve;return Q===n||Eo>=h||Eo<0||ye&&Ri>=D}function yt(){var fn=km();if(Ze(fn))return Ct(fn);G=cd(yt,gt(fn))}function Ct(fn){return G=n,Be&&S?He(fn):(S=M=n,W)}function Mr(){G!==n&&X_(G),ve=0,S=Q=M=G=n}function tr(){return G===n?W:Ct(km())}function Or(){var fn=km(),Eo=Ze(fn);if(S=arguments,M=this,Q=fn,Eo){if(G===n)return Je(Q);if(ye)return X_(G),G=cd(yt,h),He(Q)}return G===n&&(G=cd(yt,h)),W}return Or.cancel=Mr,Or.flush=tr,Or}var Yae=vt(function(d,h){return T_(d,1,h)}),Jae=vt(function(d,h,y){return T_(d,no(h)||0,y)});function Zae(d){return Mi(d,O)}function Em(d,h){if(typeof d!="function"||h!=null&&typeof h!="function")throw new Zr(a);var y=function(){var S=arguments,M=h?h.apply(this,S):S[0],D=y.cache;if(D.has(M))return D.get(M);var W=d.apply(this,S);return y.cache=D.set(M,W)||D,W};return y.cache=new(Em.Cache||Ti),y}Em.Cache=Ti;function Sm(d){if(typeof d!="function")throw new Zr(a);return function(){var h=arguments;switch(h.length){case 0:return!d.call(this);case 1:return!d.call(this,h[0]);case 2:return!d.call(this,h[0],h[1]);case 3:return!d.call(this,h[0],h[1],h[2])}return!d.apply(this,h)}}function Qae(d){return R9(2,d)}var Nae=$ie(function(d,h){h=h.length==1&&at(h[0])?Qt(h[0],_r(Xe())):Qt(Rn(h,1),_r(Xe()));var y=h.length;return vt(function(S){for(var M=-1,D=jn(S.length,y);++M<D;)S[M]=h[M].call(this,S[M]);return Sr(d,this,S)})}),K2=vt(function(d,h){var y=Bs(h,uu(K2));return Mi(d,T,n,h,y)}),$9=vt(function(d,h){var y=Bs(h,uu($9));return Mi(d,_,n,h,y)}),ele=Oi(function(d,h){return Mi(d,V,n,n,n,h)});function tle(d,h){if(typeof d!="function")throw new Zr(a);return h=h===n?h:ft(h),vt(d,h)}function nle(d,h){if(typeof d!="function")throw new Zr(a);return h=h==null?0:xn(ft(h),0),vt(function(y){var S=y[h],M=Ps(y,0,h);return S&&Os(M,S),Sr(d,this,M)})}function rle(d,h,y){var S=!0,M=!0;if(typeof d!="function")throw new Zr(a);return nn(y)&&(S="leading"in y?!!y.leading:S,M="trailing"in y?!!y.trailing:M),F9(d,h,{leading:S,maxWait:h,trailing:M})}function ole(d){return L9(d,1)}function ile(d,h){return K2(O2(h),d)}function sle(){if(!arguments.length)return[];var d=arguments[0];return at(d)?d:[d]}function ale(d){return Nr(d,g)}function lle(d,h){return h=typeof h=="function"?h:n,Nr(d,g,h)}function ule(d){return Nr(d,p|g)}function cle(d,h){return h=typeof h=="function"?h:n,Nr(d,p|g,h)}function dle(d,h){return h==null||__(d,h,_n(h))}function ko(d,h){return d===h||d!==d&&h!==h}var fle=vm(b2),ple=vm(function(d,h){return d>=h}),Wa=I_(function(){return arguments}())?I_:function(d){return ln(d)&&It.call(d,"callee")&&!b_.call(d,"callee")},at=le.isArray,hle=NS?_r(NS):Cie;function dr(d){return d!=null&&_m(d.length)&&!Ii(d)}function dn(d){return ln(d)&&dr(d)}function mle(d){return d===!0||d===!1||ln(d)&&Nn(d)==ee}var Vs=Moe||ry,gle=e_?_r(e_):kie;function vle(d){return ln(d)&&d.nodeType===1&&!dd(d)}function ble(d){if(d==null)return!0;if(dr(d)&&(at(d)||typeof d=="string"||typeof d.splice=="function"||Vs(d)||cu(d)||Wa(d)))return!d.length;var h=qn(d);if(h==Ue||h==xe)return!d.size;if(ud(d))return!x2(d).length;for(var y in d)if(It.call(d,y))return!1;return!0}function yle(d,h){return sd(d,h)}function wle(d,h,y){y=typeof y=="function"?y:n;var S=y?y(d,h):n;return S===n?sd(d,h,n,y):!!S}function G2(d){if(!ln(d))return!1;var h=Nn(d);return h==pe||h==se||typeof d.message=="string"&&typeof d.name=="string"&&!dd(d)}function xle(d){return typeof d=="number"&&w_(d)}function Ii(d){if(!nn(d))return!1;var h=Nn(d);return h==_e||h==Ae||h==J||h==z}function H9(d){return typeof d=="number"&&d==ft(d)}function _m(d){return typeof d=="number"&&d>-1&&d%1==0&&d<=F}function nn(d){var h=typeof d;return d!=null&&(h=="object"||h=="function")}function ln(d){return d!=null&&typeof d=="object"}var z9=t_?_r(t_):Sie;function Cle(d,h){return d===h||w2(d,h,V2(h))}function kle(d,h,y){return y=typeof y=="function"?y:n,w2(d,h,V2(h),y)}function Ele(d){return U9(d)&&d!=+d}function Sle(d){if(lse(d))throw new st(s);return L_(d)}function _le(d){return d===null}function Tle(d){return d==null}function U9(d){return typeof d=="number"||ln(d)&&Nn(d)==We}function dd(d){if(!ln(d)||Nn(d)!=At)return!1;var h=Nh(d);if(h===null)return!0;var y=It.call(h,"constructor")&&h.constructor;return typeof y=="function"&&y instanceof y&&Yh.call(y)==koe}var X2=n_?_r(n_):_ie;function Ale(d){return H9(d)&&d>=-9007199254740991&&d<=F}var W9=r_?_r(r_):Tie;function Tm(d){return typeof d=="string"||!at(d)&&ln(d)&&Nn(d)==Pe}function Ar(d){return typeof d=="symbol"||ln(d)&&Nn(d)==rt}var cu=o_?_r(o_):Aie;function Mle(d){return d===n}function Ole(d){return ln(d)&&qn(d)==$}function Ble(d){return ln(d)&&Nn(d)==ne}var Ile=vm(C2),Lle=vm(function(d,h){return d<=h});function j9(d){if(!d)return[];if(dr(d))return Tm(d)?xo(d):cr(d);if(Qc&&d[Qc])return doe(d[Qc]());var h=qn(d),y=h==Ue?u2:h==xe?Kh:du;return y(d)}function Li(d){if(!d)return d===0?d:0;if(d=no(d),d===L||d===-1/0){var h=d<0?-1:1;return h*R}return d===d?d:0}function ft(d){var h=Li(d),y=h%1;return h===h?y?h-y:h:0}function q9(d){return d?$a(ft(d),0,X):0}function no(d){if(typeof d=="number")return d;if(Ar(d))return K;if(nn(d)){var h=typeof d.valueOf=="function"?d.valueOf():d;d=nn(h)?h+"":h}if(typeof d!="string")return d===0?d:+d;d=c_(d);var y=hre.test(d);return y||gre.test(d)?Xre(d.slice(2),y?2:8):pre.test(d)?K:+d}function K9(d){return Qo(d,fr(d))}function Rle(d){return d?$a(ft(d),-9007199254740991,F):d===0?d:0}function Bt(d){return d==null?"":Tr(d)}var Dle=au(function(d,h){if(ud(h)||dr(h)){Qo(h,_n(h),d);return}for(var y in h)It.call(h,y)&&rd(d,y,h[y])}),G9=au(function(d,h){Qo(h,fr(h),d)}),Am=au(function(d,h,y,S){Qo(h,fr(h),d,S)}),Ple=au(function(d,h,y,S){Qo(h,_n(h),d,S)}),Vle=Oi(m2);function Fle(d,h){var y=su(d);return h==null?y:S_(y,h)}var $le=vt(function(d,h){d=Ut(d);var y=-1,S=h.length,M=S>2?h[2]:n;for(M&&er(h[0],h[1],M)&&(S=1);++y<S;)for(var D=h[y],W=fr(D),G=-1,Q=W.length;++G<Q;){var ve=W[G],be=d[ve];(be===n||ko(be,ru[ve])&&!It.call(d,ve))&&(d[ve]=D[ve])}return d}),Hle=vt(function(d){return d.push(n,c9),Sr(X9,n,d)});function zle(d,h){return s_(d,Xe(h,3),Zo)}function Ule(d,h){return s_(d,Xe(h,3),v2)}function Wle(d,h){return d==null?d:g2(d,Xe(h,3),fr)}function jle(d,h){return d==null?d:O_(d,Xe(h,3),fr)}function qle(d,h){return d&&Zo(d,Xe(h,3))}function Kle(d,h){return d&&v2(d,Xe(h,3))}function Gle(d){return d==null?[]:um(d,_n(d))}function Xle(d){return d==null?[]:um(d,fr(d))}function Y2(d,h,y){var S=d==null?n:Ha(d,h);return S===n?y:S}function Yle(d,h){return d!=null&&p9(d,h,bie)}function J2(d,h){return d!=null&&p9(d,h,yie)}var Jle=i9(function(d,h,y){h!=null&&typeof h.toString!="function"&&(h=Jh.call(h)),d[h]=y},Q2(pr)),Zle=i9(function(d,h,y){h!=null&&typeof h.toString!="function"&&(h=Jh.call(h)),It.call(d,h)?d[h].push(y):d[h]=[y]},Xe),Qle=vt(id);function _n(d){return dr(d)?k_(d):x2(d)}function fr(d){return dr(d)?k_(d,!0):Mie(d)}function Nle(d,h){var y={};return h=Xe(h,3),Zo(d,function(S,M,D){Ai(y,h(S,M,D),S)}),y}function eue(d,h){var y={};return h=Xe(h,3),Zo(d,function(S,M,D){Ai(y,M,h(S,M,D))}),y}var tue=au(function(d,h,y){cm(d,h,y)}),X9=au(function(d,h,y,S){cm(d,h,y,S)}),nue=Oi(function(d,h){var y={};if(d==null)return y;var S=!1;h=Qt(h,function(D){return D=Ds(D,d),S||(S=D.length>1),D}),Qo(d,D2(d),y),S&&(y=Nr(y,p|m|g,Jie));for(var M=h.length;M--;)T2(y,h[M]);return y});function rue(d,h){return Y9(d,Sm(Xe(h)))}var oue=Oi(function(d,h){return d==null?{}:Bie(d,h)});function Y9(d,h){if(d==null)return{};var y=Qt(D2(d),function(S){return[S]});return h=Xe(h),H_(d,y,function(S,M){return h(S,M[0])})}function iue(d,h,y){h=Ds(h,d);var S=-1,M=h.length;for(M||(M=1,d=n);++S<M;){var D=d==null?n:d[No(h[S])];D===n&&(S=M,D=y),d=Ii(D)?D.call(d):D}return d}function sue(d,h,y){return d==null?d:ad(d,h,y)}function aue(d,h,y,S){return S=typeof S=="function"?S:n,d==null?d:ad(d,h,y,S)}var J9=l9(_n),Z9=l9(fr);function lue(d,h,y){var S=at(d),M=S||Vs(d)||cu(d);if(h=Xe(h,4),y==null){var D=d&&d.constructor;M?y=S?new D:[]:nn(d)?y=Ii(D)?su(Nh(d)):{}:y={}}return(M?Jr:Zo)(d,function(W,G,Q){return h(y,W,G,Q)}),y}function uue(d,h){return d==null?!0:T2(d,h)}function cue(d,h,y){return d==null?d:q_(d,h,O2(y))}function due(d,h,y,S){return S=typeof S=="function"?S:n,d==null?d:q_(d,h,O2(y),S)}function du(d){return d==null?[]:l2(d,_n(d))}function fue(d){return d==null?[]:l2(d,fr(d))}function pue(d,h,y){return y===n&&(y=h,h=n),y!==n&&(y=no(y),y=y===y?y:0),h!==n&&(h=no(h),h=h===h?h:0),$a(no(d),h,y)}function hue(d,h,y){return h=Li(h),y===n?(y=h,h=0):y=Li(y),d=no(d),wie(d,h,y)}function mue(d,h,y){if(y&&typeof y!="boolean"&&er(d,h,y)&&(h=y=n),y===n&&(typeof h=="boolean"?(y=h,h=n):typeof d=="boolean"&&(y=d,d=n)),d===n&&h===n?(d=0,h=1):(d=Li(d),h===n?(h=d,d=0):h=Li(h)),d>h){var S=d;d=h,h=S}if(y||d%1||h%1){var M=x_();return jn(d+M*(h-d+Gre("1e-"+((M+"").length-1))),h)}return E2(d,h)}var gue=lu(function(d,h,y){return h=h.toLowerCase(),d+(y?Q9(h):h)});function Q9(d){return Z2(Bt(d).toLowerCase())}function N9(d){return d=Bt(d),d&&d.replace(bre,soe).replace(Vre,"")}function vue(d,h,y){d=Bt(d),h=Tr(h);var S=d.length;y=y===n?S:$a(ft(y),0,S);var M=y;return y-=h.length,y>=0&&d.slice(y,M)==h}function bue(d){return d=Bt(d),d&&Ts.test(d)?d.replace(Si,aoe):d}function yue(d){return d=Bt(d),d&&ore.test(d)?d.replace(Kb,"\\$&"):d}var wue=lu(function(d,h,y){return d+(y?"-":"")+h.toLowerCase()}),xue=lu(function(d,h,y){return d+(y?" ":"")+h.toLowerCase()}),Cue=n9("toLowerCase");function kue(d,h,y){d=Bt(d),h=ft(h);var S=h?tu(d):0;if(!h||S>=h)return d;var M=(h-S)/2;return gm(rm(M),y)+d+gm(nm(M),y)}function Eue(d,h,y){d=Bt(d),h=ft(h);var S=h?tu(d):0;return h&&S<h?d+gm(h-S,y):d}function Sue(d,h,y){d=Bt(d),h=ft(h);var S=h?tu(d):0;return h&&S<h?gm(h-S,y)+d:d}function _ue(d,h,y){return y||h==null?h=0:h&&(h=+h),Loe(Bt(d).replace(Gb,""),h||0)}function Tue(d,h,y){return(y?er(d,h,y):h===n)?h=1:h=ft(h),S2(Bt(d),h)}function Aue(){var d=arguments,h=Bt(d[0]);return d.length<3?h:h.replace(d[1],d[2])}var Mue=lu(function(d,h,y){return d+(y?"_":"")+h.toLowerCase()});function Oue(d,h,y){return y&&typeof y!="number"&&er(d,h,y)&&(h=y=n),y=y===n?X:y>>>0,y?(d=Bt(d),d&&(typeof h=="string"||h!=null&&!X2(h))&&(h=Tr(h),!h&&eu(d))?Ps(xo(d),0,y):d.split(h,y)):[]}var Bue=lu(function(d,h,y){return d+(y?" ":"")+Z2(h)});function Iue(d,h,y){return d=Bt(d),y=y==null?0:$a(ft(y),0,d.length),h=Tr(h),d.slice(y,y+h.length)==h}function Lue(d,h,y){var S=I.templateSettings;y&&er(d,h,y)&&(h=n),d=Bt(d),h=Am({},h,S,u9);var M=Am({},h.imports,S.imports,u9),D=_n(M),W=l2(M,D),G,Q,ve=0,be=h.interpolate||zh,ye="__p += '",Be=c2((h.escape||zh).source+"|"+be.source+"|"+(be===Hh?fre:zh).source+"|"+(h.evaluate||zh).source+"|$","g"),He="//# sourceURL="+(It.call(h,"sourceURL")?(h.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ure+"]")+`
|
|
119
119
|
`;d.replace(Be,function(Ze,yt,Ct,Mr,tr,Or){return Ct||(Ct=Mr),ye+=d.slice(ve,Or).replace(yre,loe),yt&&(G=!0,ye+=`' +
|
|
120
120
|
__e(`+yt+`) +
|
|
121
121
|
'`),tr&&(Q=!0,ye+=`';
|
|
@@ -126,13 +126,13 @@ __p += '`),Ct&&(ye+=`' +
|
|
|
126
126
|
`;var Je=It.call(h,"variable")&&h.variable;if(!Je)ye=`with (obj) {
|
|
127
127
|
`+ye+`
|
|
128
128
|
}
|
|
129
|
-
`;else if(cre.test(Je))throw new st(l);ye=(Q?ye.replace(
|
|
129
|
+
`;else if(cre.test(Je))throw new st(l);ye=(Q?ye.replace(nt,""):ye).replace(bt,"$1").replace(Zt,"$1;"),ye="function("+(Je||"obj")+`) {
|
|
130
130
|
`+(Je?"":`obj || (obj = {});
|
|
131
131
|
`)+"var __t, __p = ''"+(G?", __e = _.escape":"")+(Q?`, __j = Array.prototype.join;
|
|
132
132
|
function print() { __p += __j.call(arguments, '') }
|
|
133
133
|
`:`;
|
|
134
134
|
`)+ye+`return __p
|
|
135
|
-
}`;var gt=tT(function(){return Mt(D,He+"return "+ye).apply(n,W)});if(gt.source=ye,G2(gt))throw gt;return gt}function Rue(d){return Bt(d).toLowerCase()}function Due(d){return Bt(d).toUpperCase()}function Pue(d,h,y){if(d=Bt(d),d&&(y||h===n))return c_(d);if(!d||!(h=Tr(h)))return d;var S=xo(d),M=xo(h),D=d_(S,M),W=f_(S,M)+1;return Ps(S,D,W).join("")}function Vue(d,h,y){if(d=Bt(d),d&&(y||h===n))return d.slice(0,h_(d)+1);if(!d||!(h=Tr(h)))return d;var S=xo(d),M=f_(S,xo(h))+1;return Ps(S,0,M).join("")}function Fue(d,h,y){if(d=Bt(d),d&&(y||h===n))return d.replace(Gb,"");if(!d||!(h=Tr(h)))return d;var S=xo(d),M=d_(S,xo(h));return Ps(S,M).join("")}function $ue(d,h){var y=B,S=H;if(nn(h)){var M="separator"in h?h.separator:M;y="length"in h?ft(h.length):y,S="omission"in h?Tr(h.omission):S}d=Bt(d);var D=d.length;if(eu(d)){var W=xo(d);D=W.length}if(y>=D)return d;var G=y-tu(S);if(G<1)return S;var Q=W?Ps(W,0,G).join(""):d.slice(0,G);if(M===n)return Q+S;if(W&&(G+=Q.length-G),X2(M)){if(d.slice(G).search(M)){var ve,be=Q;for(M.global||(M=c2(M.source,Bt(IS.exec(M))+"g")),M.lastIndex=0;ve=M.exec(be);)var ye=ve.index;Q=Q.slice(0,ye===n?G:ye)}}else if(d.indexOf(Tr(M),G)!=G){var Be=Q.lastIndexOf(M);Be>-1&&(Q=Q.slice(0,Be))}return Q+S}function Hue(d){return d=Bt(d),d&&Yo.test(d)?d.replace(gn,moe):d}var zue=lu(function(d,h,y){return d+(y?" ":"")+h.toUpperCase()}),Z2=n9("toUpperCase");function eT(d,h,y){return d=Bt(d),h=y?n:h,h===n?coe(d)?boe(d):toe(d):d.match(h)||[]}var tT=vt(function(d,h){try{return Sr(d,n,h)}catch(y){return G2(y)?y:new st(y)}}),Uue=Oi(function(d,h){return Jr(h,function(y){y=No(y),Ai(d,y,q2(d[y],d))}),d});function Wue(d){var h=d==null?0:d.length,y=Xe();return d=h?Qt(d,function(S){if(typeof S[1]!="function")throw new Zr(a);return[y(S[0]),S[1]]}):[],vt(function(S){for(var M=-1;++M<h;){var D=d[M];if(Sr(D[0],this,S))return Sr(D[1],this,S)}})}function jue(d){return mie(Nr(d,p))}function Q2(d){return function(){return d}}function que(d,h){return d==null||d!==d?h:d}var Kue=o9(),Gue=o9(!0);function pr(d){return d}function N2(d){return R_(typeof d=="function"?d:Nr(d,p))}function Xue(d){return P_(Nr(d,p))}function Yue(d,h){return V_(d,Nr(h,p))}var Jue=vt(function(d,h){return function(y){return id(y,d,h)}}),Zue=vt(function(d,h){return function(y){return id(d,y,h)}});function ey(d,h,y){var S=_n(h),M=um(h,S);y==null&&!(nn(h)&&(M.length||!S.length))&&(y=h,h=d,d=this,M=um(h,_n(h)));var D=!(nn(y)&&"chain"in y)||!!y.chain,W=Ii(d);return Jr(M,function(G){var Q=h[G];d[G]=Q,W&&(d.prototype[G]=function(){var ve=this.__chain__;if(D||ve){var be=d(this.__wrapped__),ye=be.__actions__=cr(this.__actions__);return ye.push({func:Q,args:arguments,thisArg:d}),be.__chain__=ve,be}return Q.apply(d,Os([this.value()],arguments))})}),d}function Que(){return Ln._===this&&(Ln._=Eoe),this}function ty(){}function Nue(d){return d=ft(d),vt(function(h){return F_(h,d)})}var ece=I2(Qt),tce=I2(i_),nce=I2(r2);function nT(d){return $2(d)?o2(No(d)):Iie(d)}function rce(d){return function(h){return d==null?n:Ha(d,h)}}var oce=s9(),ice=s9(!0);function ny(){return[]}function ry(){return!1}function sce(){return{}}function ace(){return""}function lce(){return!0}function uce(d,h){if(d=ft(d),d<1||d>F)return[];var y=X,S=jn(d,X);h=Xe(h),d-=X;for(var M=a2(S,h);++y<d;)h(y);return M}function cce(d){return at(d)?Qt(d,No):Ar(d)?[d]:cr(C9(Bt(d)))}function dce(d){var h=++Coe;return Bt(d)+h}var fce=mm(function(d,h){return d+h},0),pce=L2("ceil"),hce=mm(function(d,h){return d/h},1),mce=L2("floor");function gce(d){return d&&d.length?lm(d,pr,b2):n}function vce(d,h){return d&&d.length?lm(d,Xe(h,2),b2):n}function bce(d){return l_(d,pr)}function yce(d,h){return l_(d,Xe(h,2))}function wce(d){return d&&d.length?lm(d,pr,C2):n}function xce(d,h){return d&&d.length?lm(d,Xe(h,2),C2):n}var Cce=mm(function(d,h){return d*h},1),kce=L2("round"),Ece=mm(function(d,h){return d-h},0);function Sce(d){return d&&d.length?s2(d,pr):0}function _ce(d,h){return d&&d.length?s2(d,Xe(h,2)):0}return I.after=Xae,I.ary=L9,I.assign=Dle,I.assignIn=G9,I.assignInWith=Am,I.assignWith=Ple,I.at=Vle,I.before=R9,I.bind=q2,I.bindAll=Uue,I.bindKey=D9,I.castArray=sle,I.chain=O9,I.chunk=mse,I.compact=gse,I.concat=vse,I.cond=Wue,I.conforms=jue,I.constant=Q2,I.countBy=Sae,I.create=Fle,I.curry=P9,I.curryRight=V9,I.debounce=F9,I.defaults=$le,I.defaultsDeep=Hle,I.defer=Yae,I.delay=Jae,I.difference=bse,I.differenceBy=yse,I.differenceWith=wse,I.drop=xse,I.dropRight=Cse,I.dropRightWhile=kse,I.dropWhile=Ese,I.fill=Sse,I.filter=Tae,I.flatMap=Oae,I.flatMapDeep=Bae,I.flatMapDepth=Iae,I.flatten=_9,I.flattenDeep=_se,I.flattenDepth=Tse,I.flip=Zae,I.flow=Kue,I.flowRight=Gue,I.fromPairs=Ase,I.functions=Gle,I.functionsIn=Xle,I.groupBy=Lae,I.initial=Ose,I.intersection=Bse,I.intersectionBy=Ise,I.intersectionWith=Lse,I.invert=Jle,I.invertBy=Zle,I.invokeMap=Dae,I.iteratee=N2,I.keyBy=Pae,I.keys=_n,I.keysIn=fr,I.map=Cm,I.mapKeys=Nle,I.mapValues=eue,I.matches=Xue,I.matchesProperty=Yue,I.memoize=Em,I.merge=tue,I.mergeWith=X9,I.method=Jue,I.methodOf=Zue,I.mixin=ey,I.negate=Sm,I.nthArg=Nue,I.omit=nue,I.omitBy=rue,I.once=Qae,I.orderBy=Vae,I.over=ece,I.overArgs=Nae,I.overEvery=tce,I.overSome=nce,I.partial=K2,I.partialRight=$9,I.partition=Fae,I.pick=oue,I.pickBy=Y9,I.property=nT,I.propertyOf=rce,I.pull=Vse,I.pullAll=A9,I.pullAllBy=Fse,I.pullAllWith=$se,I.pullAt=Hse,I.range=oce,I.rangeRight=ice,I.rearg=ele,I.reject=zae,I.remove=zse,I.rest=tle,I.reverse=W2,I.sampleSize=Wae,I.set=sue,I.setWith=aue,I.shuffle=jae,I.slice=Use,I.sortBy=Gae,I.sortedUniq=Yse,I.sortedUniqBy=Jse,I.split=Oue,I.spread=nle,I.tail=Zse,I.take=Qse,I.takeRight=Nse,I.takeRightWhile=eae,I.takeWhile=tae,I.tap=gae,I.throttle=rle,I.thru=xm,I.toArray=j9,I.toPairs=J9,I.toPairsIn=Z9,I.toPath=cce,I.toPlainObject=K9,I.transform=lue,I.unary=ole,I.union=nae,I.unionBy=rae,I.unionWith=oae,I.uniq=iae,I.uniqBy=sae,I.uniqWith=aae,I.unset=uue,I.unzip=j2,I.unzipWith=M9,I.update=cue,I.updateWith=due,I.values=du,I.valuesIn=fue,I.without=lae,I.words=eT,I.wrap=ile,I.xor=uae,I.xorBy=cae,I.xorWith=dae,I.zip=fae,I.zipObject=pae,I.zipObjectDeep=hae,I.zipWith=mae,I.entries=J9,I.entriesIn=Z9,I.extend=G9,I.extendWith=Am,ey(I,I),I.add=fce,I.attempt=tT,I.camelCase=gue,I.capitalize=Q9,I.ceil=pce,I.clamp=pue,I.clone=ale,I.cloneDeep=ule,I.cloneDeepWith=cle,I.cloneWith=lle,I.conformsTo=dle,I.deburr=N9,I.defaultTo=que,I.divide=hce,I.endsWith=vue,I.eq=ko,I.escape=bue,I.escapeRegExp=yue,I.every=_ae,I.find=Aae,I.findIndex=E9,I.findKey=zle,I.findLast=Mae,I.findLastIndex=S9,I.findLastKey=Ule,I.floor=mce,I.forEach=B9,I.forEachRight=I9,I.forIn=Wle,I.forInRight=jle,I.forOwn=qle,I.forOwnRight=Kle,I.get=Y2,I.gt=fle,I.gte=ple,I.has=Yle,I.hasIn=J2,I.head=T9,I.identity=pr,I.includes=Rae,I.indexOf=Mse,I.inRange=hue,I.invoke=Qle,I.isArguments=Wa,I.isArray=at,I.isArrayBuffer=hle,I.isArrayLike=dr,I.isArrayLikeObject=dn,I.isBoolean=mle,I.isBuffer=Vs,I.isDate=gle,I.isElement=vle,I.isEmpty=ble,I.isEqual=yle,I.isEqualWith=wle,I.isError=G2,I.isFinite=xle,I.isFunction=Ii,I.isInteger=H9,I.isLength=_m,I.isMap=z9,I.isMatch=Cle,I.isMatchWith=kle,I.isNaN=Ele,I.isNative=Sle,I.isNil=Tle,I.isNull=_le,I.isNumber=U9,I.isObject=nn,I.isObjectLike=ln,I.isPlainObject=dd,I.isRegExp=X2,I.isSafeInteger=Ale,I.isSet=W9,I.isString=Tm,I.isSymbol=Ar,I.isTypedArray=cu,I.isUndefined=Mle,I.isWeakMap=Ole,I.isWeakSet=Ble,I.join=Rse,I.kebabCase=wue,I.last=to,I.lastIndexOf=Dse,I.lowerCase=xue,I.lowerFirst=Cue,I.lt=Ile,I.lte=Lle,I.max=gce,I.maxBy=vce,I.mean=bce,I.meanBy=yce,I.min=wce,I.minBy=xce,I.stubArray=ny,I.stubFalse=ry,I.stubObject=sce,I.stubString=ace,I.stubTrue=lce,I.multiply=Cce,I.nth=Pse,I.noConflict=Que,I.noop=ty,I.now=km,I.pad=kue,I.padEnd=Eue,I.padStart=Sue,I.parseInt=_ue,I.random=mue,I.reduce=$ae,I.reduceRight=Hae,I.repeat=Tue,I.replace=Aue,I.result=iue,I.round=kce,I.runInContext=Z,I.sample=Uae,I.size=qae,I.snakeCase=Mue,I.some=Kae,I.sortedIndex=Wse,I.sortedIndexBy=jse,I.sortedIndexOf=qse,I.sortedLastIndex=Kse,I.sortedLastIndexBy=Gse,I.sortedLastIndexOf=Xse,I.startCase=Bue,I.startsWith=Iue,I.subtract=Ece,I.sum=Sce,I.sumBy=_ce,I.template=Lue,I.times=uce,I.toFinite=Li,I.toInteger=ft,I.toLength=q9,I.toLower=Rue,I.toNumber=no,I.toSafeInteger=Rle,I.toString=Bt,I.toUpper=Due,I.trim=Pue,I.trimEnd=Vue,I.trimStart=Fue,I.truncate=$ue,I.unescape=Hue,I.uniqueId=dce,I.upperCase=zue,I.upperFirst=Z2,I.each=B9,I.eachRight=I9,I.first=T9,ey(I,function(){var d={};return Zo(I,function(h,y){It.call(I.prototype,y)||(d[y]=h)}),d}(),{chain:!1}),I.VERSION=r,Jr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(d){I[d].placeholder=I}),Jr(["drop","take"],function(d,h){xt.prototype[d]=function(y){y=y===n?1:xn(ft(y),0);var S=this.__filtered__&&!h?new xt(this):this.clone();return S.__filtered__?S.__takeCount__=jn(y,S.__takeCount__):S.__views__.push({size:jn(y,X),type:d+(S.__dir__<0?"Right":"")}),S},xt.prototype[d+"Right"]=function(y){return this.reverse()[d](y).reverse()}}),Jr(["filter","map","takeWhile"],function(d,h){var y=h+1,S=y==N||y==P;xt.prototype[d]=function(M){var D=this.clone();return D.__iteratees__.push({iteratee:Xe(M,3),type:y}),D.__filtered__=D.__filtered__||S,D}}),Jr(["head","last"],function(d,h){var y="take"+(h?"Right":"");xt.prototype[d]=function(){return this[y](1).value()[0]}}),Jr(["initial","tail"],function(d,h){var y="drop"+(h?"":"Right");xt.prototype[d]=function(){return this.__filtered__?new xt(this):this[y](1)}}),xt.prototype.compact=function(){return this.filter(pr)},xt.prototype.find=function(d){return this.filter(d).head()},xt.prototype.findLast=function(d){return this.reverse().find(d)},xt.prototype.invokeMap=vt(function(d,h){return typeof d=="function"?new xt(this):this.map(function(y){return id(y,d,h)})}),xt.prototype.reject=function(d){return this.filter(Sm(Xe(d)))},xt.prototype.slice=function(d,h){d=ft(d);var y=this;return y.__filtered__&&(d>0||h<0)?new xt(y):(d<0?y=y.takeRight(-d):d&&(y=y.drop(d)),h!==n&&(h=ft(h),y=h<0?y.dropRight(-h):y.take(h-d)),y)},xt.prototype.takeRightWhile=function(d){return this.reverse().takeWhile(d).reverse()},xt.prototype.toArray=function(){return this.take(X)},Zo(xt.prototype,function(d,h){var y=/^(?:filter|find|map|reject)|While$/.test(h),S=/^(?:head|last)$/.test(h),M=I[S?"take"+(h=="last"?"Right":""):h],D=S||/^find/.test(h);M&&(I.prototype[h]=function(){var W=this.__wrapped__,G=S?[1]:arguments,Q=W instanceof xt,ve=G[0],be=Q||at(W),ye=function(yt){var Ct=M.apply(I,Os([yt],G));return S&&Be?Ct[0]:Ct};be&&y&&typeof ve=="function"&&ve.length!=1&&(Q=be=!1);var Be=this.__chain__,He=!!this.__actions__.length,Je=D&&!Be,gt=Q&&!He;if(!D&&be){W=gt?W:new xt(this);var Ze=d.apply(W,G);return Ze.__actions__.push({func:xm,args:[ye],thisArg:n}),new Qr(Ze,Be)}return Je&>?d.apply(this,G):(Ze=this.thru(ye),Je?S?Ze.value()[0]:Ze.value():Ze)})}),Jr(["pop","push","shift","sort","splice","unshift"],function(d){var h=Gh[d],y=/^(?:push|sort|unshift)$/.test(d)?"tap":"thru",S=/^(?:pop|shift)$/.test(d);I.prototype[d]=function(){var M=arguments;if(S&&!this.__chain__){var D=this.value();return h.apply(at(D)?D:[],M)}return this[y](function(W){return h.apply(at(W)?W:[],M)})}}),Zo(xt.prototype,function(d,h){var y=I[h];if(y){var S=y.name+"";It.call(iu,S)||(iu[S]=[]),iu[S].push({name:h,func:y})}}),iu[hm(n,x).name]=[{name:"wrapper",func:n}],xt.prototype.clone=Hoe,xt.prototype.reverse=zoe,xt.prototype.value=Uoe,I.prototype.at=vae,I.prototype.chain=bae,I.prototype.commit=yae,I.prototype.next=wae,I.prototype.plant=Cae,I.prototype.reverse=kae,I.prototype.toJSON=I.prototype.valueOf=I.prototype.value=Eae,I.prototype.first=I.prototype.head,Qc&&(I.prototype[Qc]=xae),I},nu=yoe();Da?((Da.exports=nu)._=nu,Nb._=nu):Ln._=nu}).call(ml)}(df,df.exports);var St=df.exports;const Yt=(t,e="px")=>{if(!t)return t;const n=fg(t)?String(t):t,r=parseFloat(n),i=n.match(/[a-zA-Z%]+$/),s=i?i[0]:e;return isNaN(r)?t:r+s};function vL(t,e,n){return t<e?e:t>n?n:t}const fg=t=>typeof t=="number",pg=t=>typeof t=="function";function hg(t,e){const{extensions:n=[]}=t.extensionManager??{};return!!n.find(i=>i.name===e)}function px(t){return/\s/.test(t)}function hx(t,e){const n=[];let r=0;for(;r<t.length;){if(t.length-r<=e){n.push({text:t.substring(r),offset:r});break}let i=-1;for(let a=r+e;a>r;a--)if(px(t[a])){i=a;break}let s;if(i>r)for(n.push({text:t.substring(r,i),offset:r}),s=i;s<t.length&&px(t[s]);)s++;else s=r+e,n.push({text:t.substring(r,s),offset:r});r=s}return n.filter(i=>i.text.length>0)}const bL=t=>t?t.split(/\r?\n/).map(e=>`<p>${e.replace(/</g,"<").replace(/>/g,">")}</p>`).join(""):"";function mg(t,e={}){const{removeNodes:n=[]}=e,r=t.getJSON();function i(f=[]){const p=[];for(const m of f){if(n.includes(m.type))continue;const g={...m};m.content&&(g.content=i(m.content)),p.push(g)}return p}const s={...r,content:i(r.content)},a=t.schema.nodeFromJSON(s),u=Ir.fromSchema(t.schema).serializeFragment(a.content),c=document.createElement("div");return c.appendChild(u),c.innerHTML}function ff(){const t=new dg;t.isNativeWebViewAvailable()&&t.sendToNative(ag.KEYBOARD_DISMISS)}let Ni=null;function yL(){if(Ni)return Ni;if(typeof document>"u")return null;const t=document.createElement("span");return t.style.position="absolute",t.style.left="-9999px",t.style.top="-9999px",t.style.whiteSpace="nowrap",t.style.visibility="hidden",document.body.appendChild(t),Ni=t,t}function pf(t){const e=o.ref(null),n=o.ref(null),r=()=>{const l=t?.minChars??0;return typeof l=="number"?l:o.unref(l)??0},i=()=>{const l=t?.fontSize??"";return typeof l=="string"?l:o.unref(l)??""},s=()=>{const l=t?.fixed??!1;return typeof l=="boolean"?l:o.unref(l)??!1};function a(){s()&&n.value!==null||o.nextTick(()=>{const l=e.value;if(!l||typeof window>"u"||!(l instanceof Element))return;const u=yL();if(!u)return;const c=getComputedStyle(l);u.style.fontFamily=c.fontFamily||"",u.style.fontSize=i()||c.fontSize||"",u.style.fontWeight=c.fontWeight||"",u.style.letterSpacing=c.letterSpacing||"";const f=Math.max(1,r());u.textContent="가".repeat(f);const p=Math.ceil(u.getBoundingClientRect().width),m=E=>parseFloat(E)||0,g=m(c.paddingLeft),v=m(c.paddingRight),b=m(c.borderLeftWidth),w=m(c.borderRightWidth),x=g+v+b+w,C=l.offsetWidth-l.clientWidth-(b+w);n.value=p+x+C+4})}return o.onMounted(()=>{a(),typeof window<"u"&&window.addEventListener("resize",a)}),t?.minChars&&typeof t.minChars.value<"u"&&o.watch(t.minChars,()=>{a()}),t?.fontSize&&typeof t.fontSize.value<"u"&&o.watch(t.fontSize,()=>{a()}),t?.editor?.on("transaction",()=>{setTimeout(a,150)}),o.onBeforeUnmount(()=>{typeof window<"u"&&window.removeEventListener("resize",a),Ni&&Ni.parentNode&&(Ni.parentNode.removeChild(Ni),Ni=null)}),{contentInner:e,measuredMinWidth:n,measure:a}}const wL=o.reactive({extensions:[]});function xL(){return{state:wL}}const CL=()=>{const t=o.reactive({code:"ko",limit:1e3});function e(n){t.code=n.code??t.code,t.limit=n.limit??t.limit}return{languages:t.code,update:e,limit:t.limit}},kL="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let $r=(t=21)=>{let e="",n=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=kL[n[t]&63];return e};const EL=()=>{const t=o.reactive([]),e=ct.createEventHook(),n=ct.createEventHook();function r(u){t.push(u)}function i(u){const c=t.find(f=>f.id===u.id);c&&(c.text=u.text)}function s(u){const c=t.findIndex(p=>p.id===u.id);if(c===-1)return;const f=t[c];f.position?.top!==u.position?.top&&t.splice(c,1,{...f,pageId:u.pageId??f.pageId,position:u.position})}function a(u){const c=t.findIndex(f=>f.id===u.id);t.splice(c,1)}function l(u,c){const f=$r(6);return t.push({id:f,text:u,position:c}),f}return{removeSuperText:a,superText:t,updateSuperText:i,updatePositionSuperText:s,addMoreSuperText:l,addSuperText:r,onUpdatePositionEvent:e.on,onUpdatePositionTrigger:e.trigger,onHoverEvent:n.on,onHoverEventTrigger:n.trigger}},SL={defaultMargin:{left:"3.18cm",right:"3.18cm",top:"2.54cm",bottom:"2.54cm"},margin:{left:"20px",right:"20px",top:"20px",bottom:"20px"},defaultOrientation:"portrait",defaultBackground:"#fff",watermark:{type:"compact",alpha:.2,fontColor:"#000",fontSize:16,fontFamily:"SimSun",fontWeight:"normal",text:""},nodesComputedOption:{types:[],nodesComputed:{}},size:{label:"default",width:"100%",height:"100%",default:!0},header:!0,footer:!0,showLineNumber:!1,showToc:!1,pagination:!0,zoomLevel:100,autoWidth:!1,preview:{enabled:!1,laserPointer:!0}},bn=ct.createGlobalState(()=>{const{state:t}=xL(),e=o.ref(SL),n=o.ref(),r=o.ref(!1),{isFullscreen:i,toggle:s}=ct.useFullscreen(document.getElementById("vdc-editor")),a=o.reactive({extensions:t.extensions??[],defaultLang:sL,color:void 0,highlight:void 0,showPreview:!1,spellCheck:!1,findAndReplace:!1,printer:!1,fontFamily:"",fontSize:"",fontWeight:"",viewSuperText:!1,zoom:o.ref([100]),editor:{text:"",html:"",json:{}},AIMenu:!1}),l=EL(),u=CL(),c=o.ref(null);function f(me){n.value=me}function p(me){a.zoom=[me]}function m(me){a.fontSize=me}function g(me){a.fontFamily=me}function v(me){a.fontWeight=me}function b(me){n.value=me,a.editor.html=me.getHTML(),a.editor.json=me.getJSON(),a.editor.text=me.getText()}function w(me){e.value={...e.value,...me}}function x(){a.viewSuperText=!a.viewSuperText}function C(me){a.viewSuperText=me}function E(){a.showPreview=!a.showPreview}function k(){a.spellCheck=!a.spellCheck}function T(me){a.spellCheck=me}function _(){a.findAndReplace=!a.findAndReplace}function A(){a.printer=!a.printer}o.watchEffect(()=>{a.extensions=t.extensions,a.defaultLang=t.defaultLang});const V=o.ref();function O(me){V.value=me}function B(){V.value?.openDialog()}function H(){V.value?.closeDialog()}const j=o.ref([]);function Y(me){j.value=me}function N(me,J,ee=!0){const se=new DOMParser().parseFromString(J,"text/html");return me.forEach(({loc:pe,elementId:_e,content:Ae})=>{const Ue=`button.super-text[${rt.POSITION}="${pe}"]`,We=se.querySelector(Ue);We&&(We.setAttribute(rt.ELEMENT_ID,_e||""),We.setAttribute(rt.TEXT,ee?bL(Ae):Ae))}),se.body.innerHTML}const U=me=>c.value=me,P=o.ref(null),L=o.ref();function F(me){L.value=me}const R=o.ref();function K(me){R.value=me}const X=o.ref(null),ae=o.ref();function de(me){ae.value=me}const Ee=o.ref();function ie(me){Ee.value=me}return{state:a,page:e,isFullscreen:i,toggleFullscreen:s,updateEditorState:b,setEditor:f,isReady:r,container:"#vdc-editor",editor:n,changeZoom:p,changePageOption:w,changeFontFamily:g,changeFontSize:m,changeFontWeight:v,toggleSuperText:x,superTextStore:l,checkSpellStore:u,viewSuperText:C,toggleFindAndReplace:_,togglePreview:E,toggleSpellCheck:k,setSpellCheck:T,togglePrinter:A,setEditorContextMenuRef:O,openSuperInput:B,closeSuperInput:H,imageAttachments:j,setImageAttachment:Y,getUpdatedContentBySuperText:N,textAlert:c,setTextAlert:U,focusFirstInvalidChar:P,editorSelectedMobile:L,setEditorSelectedMobile:F,editorContentMobile:R,setEditorContentMobile:K,footerTargetRef:X,editorContentInstance:ae,setEditorContentInstance:de,editorFocusedInstance:Ee,setEditorFocusedInstance:ie}}),gg=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function vg(t,e,n,r){t.addEventListener?t.addEventListener(e,n,r):t.attachEvent&&t.attachEvent("on".concat(e),n)}function qu(t,e,n,r){t.removeEventListener?t.removeEventListener(e,n,r):t.detachEvent&&t.detachEvent("on".concat(e),n)}function mx(t,e){const n=e.slice(0,e.length-1);for(let r=0;r<n.length;r++)n[r]=t[n[r].toLowerCase()];return n}function gx(t){typeof t!="string"&&(t=""),t=t.replace(/\s/g,"");const e=t.split(",");let n=e.lastIndexOf("");for(;n>=0;)e[n-1]+=",",e.splice(n,1),n=e.lastIndexOf("");return e}function _L(t,e){const n=t.length>=e.length?t:e,r=t.length>=e.length?e:t;let i=!0;for(let s=0;s<n.length;s++)r.indexOf(n[s])===-1&&(i=!1);return i}const Ku={backspace:8,"⌫":8,tab:9,clear:12,enter:13,"↩":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":gg?173:189,"=":gg?61:187,";":gg?59:186,"'":222,"[":219,"]":221,"\\":220},Ro={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},hf={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},Bn={16:!1,18:!1,17:!1,91:!1},Nt={};for(let t=1;t<20;t++)Ku["f".concat(t)]=111+t;let Jt=[],Gu=null,vx="all";const ci=new Map,Xu=t=>Ku[t.toLowerCase()]||Ro[t.toLowerCase()]||t.toUpperCase().charCodeAt(0),TL=t=>Object.keys(Ku).find(e=>Ku[e]===t),AL=t=>Object.keys(Ro).find(e=>Ro[e]===t);function bx(t){vx=t||"all"}function Yu(){return vx||"all"}function ML(){return Jt.slice(0)}function OL(){return Jt.map(t=>TL(t)||AL(t)||String.fromCharCode(t))}function BL(){const t=[];return Object.keys(Nt).forEach(e=>{Nt[e].forEach(n=>{let{key:r,scope:i,mods:s,shortcut:a}=n;t.push({scope:i,shortcut:a,mods:s,keys:r.split("+").map(l=>Xu(l))})})}),t}function IL(t){const e=t.target||t.srcElement,{tagName:n}=e;let r=!0;const i=n==="INPUT"&&!["checkbox","radio","range","button","file","reset","submit","color"].includes(e.type);return(e.isContentEditable||(i||n==="TEXTAREA"||n==="SELECT")&&!e.readOnly)&&(r=!1),r}function LL(t){return typeof t=="string"&&(t=Xu(t)),Jt.indexOf(t)!==-1}function RL(t,e){let n,r;t||(t=Yu());for(const i in Nt)if(Object.prototype.hasOwnProperty.call(Nt,i))for(n=Nt[i],r=0;r<n.length;)n[r].scope===t?n.splice(r,1).forEach(a=>{let{element:l}=a;return bg(l)}):r++;Yu()===t&&bx(e||"all")}function DL(t){let e=t.keyCode||t.which||t.charCode;const n=Jt.indexOf(e);if(n>=0&&Jt.splice(n,1),t.key&&t.key.toLowerCase()==="meta"&&Jt.splice(0,Jt.length),(e===93||e===224)&&(e=91),e in Bn){Bn[e]=!1;for(const r in Ro)Ro[r]===e&&(so[r]=!1)}}function yx(t){if(typeof t>"u")Object.keys(Nt).forEach(i=>{Array.isArray(Nt[i])&&Nt[i].forEach(s=>mf(s)),delete Nt[i]}),bg(null);else if(Array.isArray(t))t.forEach(i=>{i.key&&mf(i)});else if(typeof t=="object")t.key&&mf(t);else if(typeof t=="string"){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];let[i,s]=n;typeof i=="function"&&(s=i,i=""),mf({key:t,scope:i,method:s,splitKey:"+"})}}const mf=t=>{let{key:e,scope:n,method:r,splitKey:i="+"}=t;gx(e).forEach(a=>{const l=a.split(i),u=l.length,c=l[u-1],f=c==="*"?"*":Xu(c);if(!Nt[f])return;n||(n=Yu());const p=u>1?mx(Ro,l):[],m=[];Nt[f]=Nt[f].filter(g=>{const b=(r?g.method===r:!0)&&g.scope===n&&_L(g.mods,p);return b&&m.push(g.element),!b}),m.forEach(g=>bg(g))})};function wx(t,e,n,r){if(e.element!==r)return;let i;if(e.scope===n||e.scope==="all"){i=e.mods.length>0;for(const s in Bn)Object.prototype.hasOwnProperty.call(Bn,s)&&(!Bn[s]&&e.mods.indexOf(+s)>-1||Bn[s]&&e.mods.indexOf(+s)===-1)&&(i=!1);(e.mods.length===0&&!Bn[16]&&!Bn[18]&&!Bn[17]&&!Bn[91]||i||e.shortcut==="*")&&(e.keys=[],e.keys=e.keys.concat(Jt),e.method(t,e)===!1&&(t.preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation&&t.stopPropagation(),t.cancelBubble&&(t.cancelBubble=!0)))}}function xx(t,e){const n=Nt["*"];let r=t.keyCode||t.which||t.charCode;if(!so.filter.call(this,t))return;if((r===93||r===224)&&(r=91),Jt.indexOf(r)===-1&&r!==229&&Jt.push(r),["metaKey","ctrlKey","altKey","shiftKey"].forEach(l=>{const u=hf[l];t[l]&&Jt.indexOf(u)===-1?Jt.push(u):!t[l]&&Jt.indexOf(u)>-1?Jt.splice(Jt.indexOf(u),1):l==="metaKey"&&t[l]&&(Jt=Jt.filter(c=>c in hf||c===r))}),r in Bn){Bn[r]=!0;for(const l in Ro)Ro[l]===r&&(so[l]=!0);if(!n)return}for(const l in Bn)Object.prototype.hasOwnProperty.call(Bn,l)&&(Bn[l]=t[hf[l]]);t.getModifierState&&!(t.altKey&&!t.ctrlKey)&&t.getModifierState("AltGraph")&&(Jt.indexOf(17)===-1&&Jt.push(17),Jt.indexOf(18)===-1&&Jt.push(18),Bn[17]=!0,Bn[18]=!0);const i=Yu();if(n)for(let l=0;l<n.length;l++)n[l].scope===i&&(t.type==="keydown"&&n[l].keydown||t.type==="keyup"&&n[l].keyup)&&wx(t,n[l],i,e);if(!(r in Nt))return;const s=Nt[r],a=s.length;for(let l=0;l<a;l++)if((t.type==="keydown"&&s[l].keydown||t.type==="keyup"&&s[l].keyup)&&s[l].key){const u=s[l],{splitKey:c}=u,f=u.key.split(c),p=[];for(let m=0;m<f.length;m++)p.push(Xu(f[m]));p.sort().join("")===Jt.sort().join("")&&wx(t,u,i,e)}}function so(t,e,n){Jt=[];const r=gx(t);let i=[],s="all",a=document,l=0,u=!1,c=!0,f="+",p=!1,m=!1;for(n===void 0&&typeof e=="function"&&(n=e),Object.prototype.toString.call(e)==="[object Object]"&&(e.scope&&(s=e.scope),e.element&&(a=e.element),e.keyup&&(u=e.keyup),e.keydown!==void 0&&(c=e.keydown),e.capture!==void 0&&(p=e.capture),typeof e.splitKey=="string"&&(f=e.splitKey),e.single===!0&&(m=!0)),typeof e=="string"&&(s=e),m&&yx(t,s);l<r.length;l++)t=r[l].split(f),i=[],t.length>1&&(i=mx(Ro,t)),t=t[t.length-1],t=t==="*"?"*":Xu(t),t in Nt||(Nt[t]=[]),Nt[t].push({keyup:u,keydown:c,scope:s,mods:i,shortcut:r[l],method:n,key:r[l],splitKey:f,element:a});if(typeof a<"u"&&window){if(!ci.has(a)){const g=function(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;return xx(b,a)},v=function(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;xx(b,a),DL(b)};ci.set(a,{keydownListener:g,keyupListenr:v,capture:p}),vg(a,"keydown",g,p),vg(a,"keyup",v,p)}if(!Gu){const g=()=>{Jt=[]};Gu={listener:g,capture:p},vg(window,"focus",g,p)}}}function PL(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(Nt).forEach(n=>{Nt[n].filter(i=>i.scope===e&&i.shortcut===t).forEach(i=>{i&&i.method&&i.method()})})}function bg(t){const e=Object.values(Nt).flat();if(e.findIndex(r=>{let{element:i}=r;return i===t})<0){const{keydownListener:r,keyupListenr:i,capture:s}=ci.get(t)||{};r&&i&&(qu(t,"keyup",i,s),qu(t,"keydown",r,s),ci.delete(t))}if((e.length<=0||ci.size<=0)&&(Object.keys(ci).forEach(i=>{const{keydownListener:s,keyupListenr:a,capture:l}=ci.get(i)||{};s&&a&&(qu(i,"keyup",a,l),qu(i,"keydown",s,l),ci.delete(i))}),ci.clear(),Object.keys(Nt).forEach(i=>delete Nt[i]),Gu)){const{listener:i,capture:s}=Gu;qu(window,"focus",i,s),Gu=null}}const yg={getPressedKeyString:OL,setScope:bx,getScope:Yu,deleteScope:RL,getPressedKeyCodes:ML,getAllKeyCodes:BL,isPressed:LL,filter:IL,trigger:PL,unbind:yx,keyMap:Ku,modifier:Ro,modifierMap:hf};for(const t in yg)Object.prototype.hasOwnProperty.call(yg,t)&&(so[t]=yg[t]);if(typeof window<"u"){const t=window.hotkeys;so.noConflict=e=>(e&&window.hotkeys===so&&(window.hotkeys=t),so),window.hotkeys=so}const Ju=(t,e)=>{so.filter=()=>!0;const n=()=>{so(t,i=>(i.preventDefault(),e(),!1))},r=()=>{so.unbind(t)};return o.onBeforeUnmount(()=>{r()}),{bind:n,unbind:r}},VL=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,FL=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,$L=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,HL=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,zL=Fn.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",wt(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Ys({find:VL,type:this.type}),Ys({find:$L,type:this.type})]},addPasteRules(){return[Ji({find:FL,type:this.type}),Ji({find:HL,type:this.type})]}});let wg;function xg(){return wg===void 0&&(wg=navigator.platform.includes("Mac")),wg}function gf(t){return t.toLowerCase()==="mod"?xg()?"⌘":"Ctrl":t.toLowerCase()==="alt"?xg()?"⌥":"Alt":t.toLowerCase()==="shift"?xg()?"⇧":"Shift":t}function Cx(t){return t.map(gf).join(" ")}const kx=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,Ex=Bm,Cg=(t,e)=>n=>{var r;if(e?.variants==null)return Ex(t,n?.class,n?.className);const{variants:i,defaultVariants:s}=e,a=Object.keys(i).map(c=>{const f=n?.[c],p=s?.[c];if(f===null)return null;const m=kx(f)||kx(p);return i[c][m]}),l=n&&Object.entries(n).reduce((c,f)=>{let[p,m]=f;return m===void 0||(c[p]=m),c},{}),u=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((c,f)=>{let{class:p,className:m,...g}=f;return Object.entries(g).every(v=>{let[b,w]=v;return Array.isArray(w)?w.includes({...s,...l}[b]):{...s,...l}[b]===w})?[...c,p,m]:c},[]);return Ex(t,a,u,n?.class,n?.className)},UL=["top","right","bottom","left"],es=Math.min,br=Math.max,vf=Math.round,bf=Math.floor,Do=t=>({x:t,y:t}),WL={left:"right",right:"left",bottom:"top",top:"bottom"},jL={start:"end",end:"start"};function kg(t,e,n){return br(t,es(e,n))}function di(t,e){return typeof t=="function"?t(e):t}function fi(t){return t.split("-")[0]}function gl(t){return t.split("-")[1]}function Eg(t){return t==="x"?"y":"x"}function Sg(t){return t==="y"?"height":"width"}function ts(t){return["top","bottom"].includes(fi(t))?"y":"x"}function _g(t){return Eg(ts(t))}function qL(t,e,n){n===void 0&&(n=!1);const r=gl(t),i=_g(t),s=Sg(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(a=yf(a)),[a,yf(a)]}function KL(t){const e=yf(t);return[Tg(t),e,Tg(e)]}function Tg(t){return t.replace(/start|end/g,e=>jL[e])}function GL(t,e,n){const r=["left","right"],i=["right","left"],s=["top","bottom"],a=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:r:e?r:i;case"left":case"right":return e?s:a;default:return[]}}function XL(t,e,n,r){const i=gl(t);let s=GL(fi(t),n==="start",r);return i&&(s=s.map(a=>a+"-"+i),e&&(s=s.concat(s.map(Tg)))),s}function yf(t){return t.replace(/left|right|bottom|top/g,e=>WL[e])}function YL(t){return{top:0,right:0,bottom:0,left:0,...t}}function Sx(t){return typeof t!="number"?YL(t):{top:t,right:t,bottom:t,left:t}}function wf(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function _x(t,e,n){let{reference:r,floating:i}=t;const s=ts(e),a=_g(e),l=Sg(a),u=fi(e),c=s==="y",f=r.x+r.width/2-i.width/2,p=r.y+r.height/2-i.height/2,m=r[l]/2-i[l]/2;let g;switch(u){case"top":g={x:f,y:r.y-i.height};break;case"bottom":g={x:f,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:p};break;case"left":g={x:r.x-i.width,y:p};break;default:g={x:r.x,y:r.y}}switch(gl(e)){case"start":g[a]-=m*(n&&c?-1:1);break;case"end":g[a]+=m*(n&&c?-1:1);break}return g}const JL=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:a}=n,l=s.filter(Boolean),u=await(a.isRTL==null?void 0:a.isRTL(e));let c=await a.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:p}=_x(c,r,u),m=r,g={},v=0;for(let b=0;b<l.length;b++){const{name:w,fn:x}=l[b],{x:C,y:E,data:k,reset:T}=await x({x:f,y:p,initialPlacement:r,placement:m,strategy:i,middlewareData:g,rects:c,platform:a,elements:{reference:t,floating:e}});f=C??f,p=E??p,g={...g,[w]:{...g[w],...k}},T&&v<=50&&(v++,typeof T=="object"&&(T.placement&&(m=T.placement),T.rects&&(c=T.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:i}):T.rects),{x:f,y:p}=_x(c,m,u)),b=-1)}return{x:f,y:p,placement:m,strategy:i,middlewareData:g}};async function Zu(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:s,rects:a,elements:l,strategy:u}=t,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:p="floating",altBoundary:m=!1,padding:g=0}=di(e,t),v=Sx(g),w=l[m?p==="floating"?"reference":"floating":p],x=wf(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:c,rootBoundary:f,strategy:u})),C=p==="floating"?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),k=await(s.isElement==null?void 0:s.isElement(E))?await(s.getScale==null?void 0:s.getScale(E))||{x:1,y:1}:{x:1,y:1},T=wf(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:C,offsetParent:E,strategy:u}):C);return{top:(x.top-T.top+v.top)/k.y,bottom:(T.bottom-x.bottom+v.bottom)/k.y,left:(x.left-T.left+v.left)/k.x,right:(T.right-x.right+v.right)/k.x}}const ZL=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:s,platform:a,elements:l,middlewareData:u}=e,{element:c,padding:f=0}=di(t,e)||{};if(c==null)return{};const p=Sx(f),m={x:n,y:r},g=_g(i),v=Sg(g),b=await a.getDimensions(c),w=g==="y",x=w?"top":"left",C=w?"bottom":"right",E=w?"clientHeight":"clientWidth",k=s.reference[v]+s.reference[g]-m[g]-s.floating[v],T=m[g]-s.reference[g],_=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c));let A=_?_[E]:0;(!A||!await(a.isElement==null?void 0:a.isElement(_)))&&(A=l.floating[E]||s.floating[v]);const V=k/2-T/2,O=A/2-b[v]/2-1,B=es(p[x],O),H=es(p[C],O),j=B,Y=A-b[v]-H,N=A/2-b[v]/2+V,U=kg(j,N,Y),P=!u.arrow&&gl(i)!=null&&N!==U&&s.reference[v]/2-(N<j?B:H)-b[v]/2<0,L=P?N<j?N-j:N-Y:0;return{[g]:m[g]+L,data:{[g]:U,centerOffset:N-U-L,...P&&{alignmentOffset:L}},reset:P}}}),QL=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:s,rects:a,initialPlacement:l,platform:u,elements:c}=e,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:b=!0,...w}=di(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const x=fi(i),C=ts(l),E=fi(l)===l,k=await(u.isRTL==null?void 0:u.isRTL(c.floating)),T=m||(E||!b?[yf(l)]:KL(l)),_=v!=="none";!m&&_&&T.push(...XL(l,b,v,k));const A=[l,...T],V=await Zu(e,w),O=[];let B=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&O.push(V[x]),p){const N=qL(i,a,k);O.push(V[N[0]],V[N[1]])}if(B=[...B,{placement:i,overflows:O}],!O.every(N=>N<=0)){var H,j;const N=(((H=s.flip)==null?void 0:H.index)||0)+1,U=A[N];if(U)return{data:{index:N,overflows:B},reset:{placement:U}};let P=(j=B.filter(L=>L.overflows[0]<=0).sort((L,F)=>L.overflows[1]-F.overflows[1])[0])==null?void 0:j.placement;if(!P)switch(g){case"bestFit":{var Y;const L=(Y=B.filter(F=>{if(_){const R=ts(F.placement);return R===C||R==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(R=>R>0).reduce((R,K)=>R+K,0)]).sort((F,R)=>F[1]-R[1])[0])==null?void 0:Y[0];L&&(P=L);break}case"initialPlacement":P=l;break}if(i!==P)return{reset:{placement:P}}}return{}}}};function Tx(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Ax(t){return UL.some(e=>t[e]>=0)}const NL=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...i}=di(t,e);switch(r){case"referenceHidden":{const s=await Zu(e,{...i,elementContext:"reference"}),a=Tx(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Ax(a)}}}case"escaped":{const s=await Zu(e,{...i,altBoundary:!0}),a=Tx(s,n.floating);return{data:{escapedOffsets:a,escaped:Ax(a)}}}default:return{}}}}};async function eR(t,e){const{placement:n,platform:r,elements:i}=t,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=fi(n),l=gl(n),u=ts(n)==="y",c=["left","top"].includes(a)?-1:1,f=s&&u?-1:1,p=di(e,t);let{mainAxis:m,crossAxis:g,alignmentAxis:v}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof v=="number"&&(g=l==="end"?v*-1:v),u?{x:g*f,y:m*c}:{x:m*c,y:g*f}}const tR=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:s,placement:a,middlewareData:l}=e,u=await eR(e,t);return a===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:i+u.x,y:s+u.y,data:{...u,placement:a}}}}},nR=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:w=>{let{x,y:C}=w;return{x,y:C}}},...u}=di(t,e),c={x:n,y:r},f=await Zu(e,u),p=ts(fi(i)),m=Eg(p);let g=c[m],v=c[p];if(s){const w=m==="y"?"top":"left",x=m==="y"?"bottom":"right",C=g+f[w],E=g-f[x];g=kg(C,g,E)}if(a){const w=p==="y"?"top":"left",x=p==="y"?"bottom":"right",C=v+f[w],E=v-f[x];v=kg(C,v,E)}const b=l.fn({...e,[m]:g,[p]:v});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[m]:s,[p]:a}}}}}},rR=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:s,middlewareData:a}=e,{offset:l=0,mainAxis:u=!0,crossAxis:c=!0}=di(t,e),f={x:n,y:r},p=ts(i),m=Eg(p);let g=f[m],v=f[p];const b=di(l,e),w=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(u){const E=m==="y"?"height":"width",k=s.reference[m]-s.floating[E]+w.mainAxis,T=s.reference[m]+s.reference[E]-w.mainAxis;g<k?g=k:g>T&&(g=T)}if(c){var x,C;const E=m==="y"?"width":"height",k=["top","left"].includes(fi(i)),T=s.reference[p]-s.floating[E]+(k&&((x=a.offset)==null?void 0:x[p])||0)+(k?0:w.crossAxis),_=s.reference[p]+s.reference[E]+(k?0:((C=a.offset)==null?void 0:C[p])||0)-(k?w.crossAxis:0);v<T?v=T:v>_&&(v=_)}return{[m]:g,[p]:v}}}},oR=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:s,platform:a,elements:l}=e,{apply:u=()=>{},...c}=di(t,e),f=await Zu(e,c),p=fi(i),m=gl(i),g=ts(i)==="y",{width:v,height:b}=s.floating;let w,x;p==="top"||p==="bottom"?(w=p,x=m===(await(a.isRTL==null?void 0:a.isRTL(l.floating))?"start":"end")?"left":"right"):(x=p,w=m==="end"?"top":"bottom");const C=b-f.top-f.bottom,E=v-f.left-f.right,k=es(b-f[w],C),T=es(v-f[x],E),_=!e.middlewareData.shift;let A=k,V=T;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(V=E),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(A=C),_&&!m){const B=br(f.left,0),H=br(f.right,0),j=br(f.top,0),Y=br(f.bottom,0);g?V=v-2*(B!==0||H!==0?B+H:br(f.left,f.right)):A=b-2*(j!==0||Y!==0?j+Y:br(f.top,f.bottom))}await u({...e,availableWidth:V,availableHeight:A});const O=await a.getDimensions(l.floating);return v!==O.width||b!==O.height?{reset:{rects:!0}}:{}}}};function xf(){return typeof window<"u"}function oa(t){return Ag(t)?(t.nodeName||"").toLowerCase():"#document"}function yr(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Po(t){var e;return(e=(Ag(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Ag(t){return xf()?t instanceof Node||t instanceof yr(t).Node:!1}function ao(t){return xf()?t instanceof Element||t instanceof yr(t).Element:!1}function Vo(t){return xf()?t instanceof HTMLElement||t instanceof yr(t).HTMLElement:!1}function Mx(t){return!xf()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof yr(t).ShadowRoot}function Qu(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=lo(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function iR(t){return["table","td","th"].includes(oa(t))}function Cf(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function Mg(t){const e=Og(),n=ao(t)?lo(t):t;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function sR(t){let e=ns(t);for(;Vo(e)&&!vl(e);){if(Mg(e))return e;if(Cf(e))return null;e=ns(e)}return null}function Og(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function vl(t){return["html","body","#document"].includes(oa(t))}function lo(t){return yr(t).getComputedStyle(t)}function kf(t){return ao(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ns(t){if(oa(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Mx(t)&&t.host||Po(t);return Mx(e)?e.host:e}function Ox(t){const e=ns(t);return vl(e)?t.ownerDocument?t.ownerDocument.body:t.body:Vo(e)&&Qu(e)?e:Ox(e)}function Nu(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Ox(t),s=i===((r=t.ownerDocument)==null?void 0:r.body),a=yr(i);if(s){const l=Bg(a);return e.concat(a,a.visualViewport||[],Qu(i)?i:[],l&&n?Nu(l):[])}return e.concat(i,Nu(i,[],n))}function Bg(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Bx(t){const e=lo(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=Vo(t),s=i?t.offsetWidth:n,a=i?t.offsetHeight:r,l=vf(n)!==s||vf(r)!==a;return l&&(n=s,r=a),{width:n,height:r,$:l}}function Ig(t){return ao(t)?t:t.contextElement}function bl(t){const e=Ig(t);if(!Vo(e))return Do(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:s}=Bx(e);let a=(s?vf(n.width):n.width)/r,l=(s?vf(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const aR=Do(0);function Ix(t){const e=yr(t);return!Og()||!e.visualViewport?aR:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function lR(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==yr(t)?!1:e}function ia(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=Ig(t);let a=Do(1);e&&(r?ao(r)&&(a=bl(r)):a=bl(t));const l=lR(s,n,r)?Ix(s):Do(0);let u=(i.left+l.x)/a.x,c=(i.top+l.y)/a.y,f=i.width/a.x,p=i.height/a.y;if(s){const m=yr(s),g=r&&ao(r)?yr(r):r;let v=m,b=Bg(v);for(;b&&r&&g!==v;){const w=bl(b),x=b.getBoundingClientRect(),C=lo(b),E=x.left+(b.clientLeft+parseFloat(C.paddingLeft))*w.x,k=x.top+(b.clientTop+parseFloat(C.paddingTop))*w.y;u*=w.x,c*=w.y,f*=w.x,p*=w.y,u+=E,c+=k,v=yr(b),b=Bg(v)}}return wf({width:f,height:p,x:u,y:c})}function Lg(t,e){const n=kf(t).scrollLeft;return e?e.left+n:ia(Po(t)).left+n}function Lx(t,e,n){n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=r.left+e.scrollLeft-(n?0:Lg(t,r)),s=r.top+e.scrollTop;return{x:i,y:s}}function uR(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const s=i==="fixed",a=Po(r),l=e?Cf(e.floating):!1;if(r===a||l&&s)return n;let u={scrollLeft:0,scrollTop:0},c=Do(1);const f=Do(0),p=Vo(r);if((p||!p&&!s)&&((oa(r)!=="body"||Qu(a))&&(u=kf(r)),Vo(r))){const g=ia(r);c=bl(r),f.x=g.x+r.clientLeft,f.y=g.y+r.clientTop}const m=a&&!p&&!s?Lx(a,u,!0):Do(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-u.scrollLeft*c.x+f.x+m.x,y:n.y*c.y-u.scrollTop*c.y+f.y+m.y}}function cR(t){return Array.from(t.getClientRects())}function dR(t){const e=Po(t),n=kf(t),r=t.ownerDocument.body,i=br(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=br(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Lg(t);const l=-n.scrollTop;return lo(r).direction==="rtl"&&(a+=br(e.clientWidth,r.clientWidth)-i),{width:i,height:s,x:a,y:l}}function fR(t,e){const n=yr(t),r=Po(t),i=n.visualViewport;let s=r.clientWidth,a=r.clientHeight,l=0,u=0;if(i){s=i.width,a=i.height;const c=Og();(!c||c&&e==="fixed")&&(l=i.offsetLeft,u=i.offsetTop)}return{width:s,height:a,x:l,y:u}}function pR(t,e){const n=ia(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,s=Vo(t)?bl(t):Do(1),a=t.clientWidth*s.x,l=t.clientHeight*s.y,u=i*s.x,c=r*s.y;return{width:a,height:l,x:u,y:c}}function Rx(t,e,n){let r;if(e==="viewport")r=fR(t,n);else if(e==="document")r=dR(Po(t));else if(ao(e))r=pR(e,n);else{const i=Ix(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return wf(r)}function Dx(t,e){const n=ns(t);return n===e||!ao(n)||vl(n)?!1:lo(n).position==="fixed"||Dx(n,e)}function hR(t,e){const n=e.get(t);if(n)return n;let r=Nu(t,[],!1).filter(l=>ao(l)&&oa(l)!=="body"),i=null;const s=lo(t).position==="fixed";let a=s?ns(t):t;for(;ao(a)&&!vl(a);){const l=lo(a),u=Mg(a);!u&&l.position==="fixed"&&(i=null),(s?!u&&!i:!u&&l.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Qu(a)&&!u&&Dx(t,a))?r=r.filter(f=>f!==a):i=l,a=ns(a)}return e.set(t,r),r}function mR(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const a=[...n==="clippingAncestors"?Cf(e)?[]:hR(e,this._c):[].concat(n),r],l=a[0],u=a.reduce((c,f)=>{const p=Rx(e,f,i);return c.top=br(p.top,c.top),c.right=es(p.right,c.right),c.bottom=es(p.bottom,c.bottom),c.left=br(p.left,c.left),c},Rx(e,l,i));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function gR(t){const{width:e,height:n}=Bx(t);return{width:e,height:n}}function vR(t,e,n){const r=Vo(e),i=Po(e),s=n==="fixed",a=ia(t,!0,s,e);let l={scrollLeft:0,scrollTop:0};const u=Do(0);if(r||!r&&!s)if((oa(e)!=="body"||Qu(i))&&(l=kf(e)),r){const m=ia(e,!0,s,e);u.x=m.x+e.clientLeft,u.y=m.y+e.clientTop}else i&&(u.x=Lg(i));const c=i&&!r&&!s?Lx(i,l):Do(0),f=a.left+l.scrollLeft-u.x-c.x,p=a.top+l.scrollTop-u.y-c.y;return{x:f,y:p,width:a.width,height:a.height}}function Rg(t){return lo(t).position==="static"}function Px(t,e){if(!Vo(t)||lo(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Po(t)===n&&(n=n.ownerDocument.body),n}function Vx(t,e){const n=yr(t);if(Cf(t))return n;if(!Vo(t)){let i=ns(t);for(;i&&!vl(i);){if(ao(i)&&!Rg(i))return i;i=ns(i)}return n}let r=Px(t,e);for(;r&&iR(r)&&Rg(r);)r=Px(r,e);return r&&vl(r)&&Rg(r)&&!Mg(r)?n:r||sR(t)||n}const bR=async function(t){const e=this.getOffsetParent||Vx,n=this.getDimensions,r=await n(t.floating);return{reference:vR(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function yR(t){return lo(t).direction==="rtl"}const wR={convertOffsetParentRelativeRectToViewportRelativeRect:uR,getDocumentElement:Po,getClippingRect:mR,getOffsetParent:Vx,getElementRects:bR,getClientRects:cR,getDimensions:gR,getScale:bl,isElement:ao,isRTL:yR};function Fx(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function xR(t,e){let n=null,r;const i=Po(t);function s(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function a(l,u){l===void 0&&(l=!1),u===void 0&&(u=1),s();const c=t.getBoundingClientRect(),{left:f,top:p,width:m,height:g}=c;if(l||e(),!m||!g)return;const v=bf(p),b=bf(i.clientWidth-(f+m)),w=bf(i.clientHeight-(p+g)),x=bf(f),E={rootMargin:-v+"px "+-b+"px "+-w+"px "+-x+"px",threshold:br(0,es(1,u))||1};let k=!0;function T(_){const A=_[0].intersectionRatio;if(A!==u){if(!k)return a();A?a(!1,A):r=setTimeout(()=>{a(!1,1e-7)},1e3)}A===1&&!Fx(c,t.getBoundingClientRect())&&a(),k=!1}try{n=new IntersectionObserver(T,{...E,root:i.ownerDocument})}catch{n=new IntersectionObserver(T,E)}n.observe(t)}return a(!0),s}function CR(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,c=Ig(t),f=i||s?[...c?Nu(c):[],...Nu(e)]:[];f.forEach(x=>{i&&x.addEventListener("scroll",n,{passive:!0}),s&&x.addEventListener("resize",n)});const p=c&&l?xR(c,n):null;let m=-1,g=null;a&&(g=new ResizeObserver(x=>{let[C]=x;C&&C.target===c&&g&&(g.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var E;(E=g)==null||E.observe(e)})),n()}),c&&!u&&g.observe(c),g.observe(e));let v,b=u?ia(t):null;u&&w();function w(){const x=ia(t);b&&!Fx(b,x)&&n(),b=x,v=requestAnimationFrame(w)}return n(),()=>{var x;f.forEach(C=>{i&&C.removeEventListener("scroll",n),s&&C.removeEventListener("resize",n)}),p?.(),(x=g)==null||x.disconnect(),g=null,u&&cancelAnimationFrame(v)}}const kR=tR,ER=nR,$x=QL,SR=oR,_R=NL,TR=ZL,AR=rR,MR=(t,e,n)=>{const r=new Map,i={platform:wR,...n},s={...i.platform,_c:r};return JL(t,e,{...i,platform:s})};function OR(t){return t!=null&&typeof t=="object"&&"$el"in t}function Dg(t){if(OR(t)){const e=t.$el;return Ag(e)&&oa(e)==="#comment"?null:e}return t}function yl(t){return typeof t=="function"?t():o.unref(t)}function BR(t){return{name:"arrow",options:t,fn(e){const n=Dg(yl(t.element));return n==null?{}:TR({element:n,padding:t.padding}).fn(e)}}}function Hx(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function zx(t,e){const n=Hx(t);return Math.round(e*n)/n}function IR(t,e,n){n===void 0&&(n={});const r=n.whileElementsMounted,i=o.computed(()=>{var A;return(A=yl(n.open))!=null?A:!0}),s=o.computed(()=>yl(n.middleware)),a=o.computed(()=>{var A;return(A=yl(n.placement))!=null?A:"bottom"}),l=o.computed(()=>{var A;return(A=yl(n.strategy))!=null?A:"absolute"}),u=o.computed(()=>{var A;return(A=yl(n.transform))!=null?A:!0}),c=o.computed(()=>Dg(t.value)),f=o.computed(()=>Dg(e.value)),p=o.ref(0),m=o.ref(0),g=o.ref(l.value),v=o.ref(a.value),b=o.shallowRef({}),w=o.ref(!1),x=o.computed(()=>{const A={position:g.value,left:"0",top:"0"};if(!f.value)return A;const V=zx(f.value,p.value),O=zx(f.value,m.value);return u.value?{...A,transform:"translate("+V+"px, "+O+"px)",...Hx(f.value)>=1.5&&{willChange:"transform"}}:{position:g.value,left:V+"px",top:O+"px"}});let C;function E(){if(c.value==null||f.value==null)return;const A=i.value;MR(c.value,f.value,{middleware:s.value,placement:a.value,strategy:l.value}).then(V=>{p.value=V.x,m.value=V.y,g.value=V.strategy,v.value=V.placement,b.value=V.middlewareData,w.value=A!==!1})}function k(){typeof C=="function"&&(C(),C=void 0)}function T(){if(k(),r===void 0){E();return}if(c.value!=null&&f.value!=null){C=r(c.value,f.value,E);return}}function _(){i.value||(w.value=!1)}return o.watch([s,a,l,i],E,{flush:"sync"}),o.watch([c,f],T,{flush:"sync"}),o.watch(i,_,{flush:"sync"}),o.getCurrentScope()&&o.onScopeDispose(k),{x:o.shallowReadonly(p),y:o.shallowReadonly(m),strategy:o.shallowReadonly(g),placement:o.shallowReadonly(v),middlewareData:o.shallowReadonly(b),isPositioned:o.shallowReadonly(w),floatingStyles:x,update:E}}function Ft(t,e){const n=typeof t=="string"&&!e?`${t}Context`:e,r=Symbol(n);return[i=>{const s=o.inject(r,i);if(s||s===null)return s;throw new Error(`Injection \`${r.toString()}\` not found. Component must be used within ${Array.isArray(t)?`one of the following components: ${t.join(", ")}`:`\`${t}\``}`)},i=>(o.provide(r,i),i)]}function Ux(t,e,n){const r=n.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&r.addEventListener(t,e,{once:!0}),r.dispatchEvent(i)}function Pg(t,e=Number.NEGATIVE_INFINITY,n=Number.POSITIVE_INFINITY){return Math.min(n,Math.max(e,t))}function LR(t){return t==null}function RR(t,e){var n;const r=o.shallowRef();return o.watchEffect(()=>{r.value=t()},{...e,flush:(n=void 0)!=null?n:"sync"}),o.readonly(r)}function wl(t){return o.getCurrentScope()?(o.onScopeDispose(t),!0):!1}function DR(){const t=new Set,e=n=>{t.delete(n)};return{on:n=>{t.add(n);const r=()=>e(n);return wl(r),{off:r}},off:e,trigger:(...n)=>Promise.all(Array.from(t).map(r=>r(...n)))}}function PR(t){let e=!1,n;const r=o.effectScope(!0);return(...i)=>(e||(n=r.run(()=>t(...i)),e=!0),n)}function Wx(t){let e=0,n,r;const i=()=>{e-=1,r&&e<=0&&(r.stop(),n=void 0,r=void 0)};return(...s)=>(e+=1,n||(r=o.effectScope(!0),n=r.run(()=>t(...s))),wl(i),n)}function Fo(t){return typeof t=="function"?t():o.unref(t)}const pi=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const VR=t=>typeof t<"u",FR=Object.prototype.toString,$R=t=>FR.call(t)==="[object Object]",Vg=()=>{},jx=HR();function HR(){var t,e;return pi&&((t=window?.navigator)==null?void 0:t.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((e=window?.navigator)==null?void 0:e.maxTouchPoints)>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function zR(t,e){function n(...r){return new Promise((i,s)=>{Promise.resolve(t(()=>e.apply(this,r),{fn:e,thisArg:this,args:r})).then(i).catch(s)})}return n}function UR(t,e={}){let n,r,i=Vg;const s=a=>{clearTimeout(a),i(),i=Vg};return a=>{const l=Fo(t),u=Fo(e.maxWait);return n&&s(n),l<=0||u!==void 0&&u<=0?(r&&(s(r),r=null),Promise.resolve(a())):new Promise((c,f)=>{i=e.rejectOnCancel?f:c,u&&!r&&(r=setTimeout(()=>{n&&s(n),r=null,c(a())},u)),n=setTimeout(()=>{r&&s(r),r=null,c(a())},l)})}}function WR(t){return o.getCurrentInstance()}function qx(t,e=1e4){return o.customRef((n,r)=>{let i=Fo(t),s;const a=()=>setTimeout(()=>{i=Fo(t),r()},Fo(e));return wl(()=>{clearTimeout(s)}),{get(){return n(),i},set(l){i=l,r(),clearTimeout(s),s=a()}}})}function Kx(t,e=200,n={}){return zR(UR(e,n),t)}function jR(t,e){WR()&&o.onBeforeUnmount(t,e)}function Gx(t,e,n={}){const{immediate:r=!0}=n,i=o.ref(!1);let s=null;function a(){s&&(clearTimeout(s),s=null)}function l(){i.value=!1,a()}function u(...c){a(),i.value=!0,s=setTimeout(()=>{i.value=!1,s=null,t(...c)},Fo(e))}return r&&(i.value=!0,pi&&u()),wl(l),{isPending:o.readonly(i),start:u,stop:l}}function qR(t,e,n){const r=o.watch(t,(...i)=>(o.nextTick(()=>r()),e(...i)),n);return r}function uo(t){var e;const n=Fo(t);return(e=n?.$el)!=null?e:n}const Ef=pi?window:void 0;function xl(...t){let e,n,r,i;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,r,i]=t,e=Ef):[e,n,r,i]=t,!e)return Vg;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const s=[],a=()=>{s.forEach(f=>f()),s.length=0},l=(f,p,m,g)=>(f.addEventListener(p,m,g),()=>f.removeEventListener(p,m,g)),u=o.watch(()=>[uo(e),Fo(i)],([f,p])=>{if(a(),!f)return;const m=$R(p)?{...p}:p;s.push(...n.flatMap(g=>r.map(v=>l(f,g,v,m))))},{immediate:!0,flush:"post"}),c=()=>{u(),a()};return wl(c),c}function KR(t){return typeof t=="function"?t:typeof t=="string"?e=>e.key===t:Array.isArray(t)?e=>t.includes(e.key):()=>!0}function GR(...t){let e,n,r={};t.length===3?(e=t[0],n=t[1],r=t[2]):t.length===2?typeof t[1]=="object"?(e=!0,n=t[0],r=t[1]):(e=t[0],n=t[1]):(e=!0,n=t[0]);const{target:i=Ef,eventName:s="keydown",passive:a=!1,dedupe:l=!1}=r,u=KR(e);return xl(i,s,c=>{c.repeat&&Fo(l)||u(c)&&n(c)},a)}function Xx(){const t=o.ref(!1),e=o.getCurrentInstance();return e&&o.onMounted(()=>{t.value=!0},e),t}function XR(t){const e=Xx();return o.computed(()=>(e.value,!!t()))}function YR(t){return JSON.parse(JSON.stringify(t))}function Cl(t,e,n={}){const{window:r=Ef,...i}=n;let s;const a=XR(()=>r&&"ResizeObserver"in r),l=()=>{s&&(s.disconnect(),s=void 0)},u=o.computed(()=>Array.isArray(t)?t.map(p=>uo(p)):[uo(t)]),c=o.watch(u,p=>{if(l(),a.value&&r){s=new ResizeObserver(e);for(const m of p)m&&s.observe(m,i)}},{immediate:!0,flush:"post"}),f=()=>{l(),c()};return wl(f),{isSupported:a,stop:f}}function wr(t,e,n,r={}){var i,s,a;const{clone:l=!1,passive:u=!1,eventName:c,deep:f=!1,defaultValue:p,shouldEmit:m}=r,g=o.getCurrentInstance(),v=n||g?.emit||((i=g?.$emit)==null?void 0:i.bind(g))||((a=(s=g?.proxy)==null?void 0:s.$emit)==null?void 0:a.bind(g?.proxy));let b=c;e||(e="modelValue"),b=b||`update:${e.toString()}`;const w=E=>l?typeof l=="function"?l(E):YR(E):E,x=()=>VR(t[e])?w(t[e]):p,C=E=>{m?m(E)&&v(b,E):v(b,E)};if(u){const E=x(),k=o.ref(E);let T=!1;return o.watch(()=>t[e],_=>{T||(T=!0,k.value=w(_),o.nextTick(()=>T=!1))}),o.watch(k,_=>{!T&&(_!==t[e]||f)&&C(_)},{deep:f}),k}else return o.computed({get(){return x()},set(E){C(E)}})}function Sf(t){return t?t.flatMap(e=>e.type===o.Fragment?Sf(e.children):[e]):[]}function $n(){let t=document.activeElement;if(t==null)return null;for(;t!=null&&t.shadowRoot!=null&&t.shadowRoot.activeElement!=null;)t=t.shadowRoot.activeElement;return t}const JR=["INPUT","TEXTAREA"];function ZR(t,e,n,r={}){if(!e||r.enableIgnoredElement&&JR.includes(e.nodeName))return null;const{arrowKeyOptions:i="both",attributeName:s="[data-radix-vue-collection-item]",itemsArray:a=[],loop:l=!0,dir:u="ltr",preventScroll:c=!0,focus:f=!1}=r,[p,m,g,v,b,w]=[t.key==="ArrowRight",t.key==="ArrowLeft",t.key==="ArrowUp",t.key==="ArrowDown",t.key==="Home",t.key==="End"],x=g||v,C=p||m;if(!b&&!w&&(!x&&!C||i==="vertical"&&C||i==="horizontal"&&x))return null;const E=n?Array.from(n.querySelectorAll(s)):a;if(!E.length)return null;c&&t.preventDefault();let k=null;return C||x?k=Yx(E,e,{goForward:x?v:u==="ltr"?p:m,loop:l}):b?k=E.at(0)||null:w&&(k=E.at(-1)||null),f&&k?.focus(),k}function Yx(t,e,n,r=t.length){if(--r===0)return null;const i=t.indexOf(e),s=n.goForward?i+1:i-1;if(!n.loop&&(s<0||s>=t.length))return null;const a=(s+t.length)%t.length,l=t[a];return l?l.hasAttribute("disabled")&&l.getAttribute("disabled")!=="false"?Yx(t,l,n,r):l:null}function Fg(t){if(t===null||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null||Symbol.iterator in t?!1:Symbol.toStringTag in t?Object.prototype.toString.call(t)==="[object Module]":!0}function $g(t,e,n=".",r){if(!Fg(e))return $g(t,{},n);const i=Object.assign({},e);for(const s in t){if(s==="__proto__"||s==="constructor")continue;const a=t[s];a!=null&&(Array.isArray(a)&&Array.isArray(i[s])?i[s]=[...a,...i[s]]:Fg(a)&&Fg(i[s])?i[s]=$g(a,i[s],(n?`${n}.`:"")+s.toString()):i[s]=a)}return i}function QR(t){return(...e)=>e.reduce((n,r)=>$g(n,r,""),{})}const NR=QR(),[_f,Fce]=Ft("ConfigProvider");let eD="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",tD=(t=21)=>{let e="",n=t;for(;n--;)e+=eD[Math.random()*64|0];return e};const nD=Wx(()=>{const t=o.ref(new Map),e=o.ref(),n=o.computed(()=>{for(const a of t.value.values())if(a)return!0;return!1}),r=_f({scrollBody:o.ref(!0)});let i=null;const s=()=>{document.body.style.paddingRight="",document.body.style.marginRight="",document.body.style.pointerEvents="",document.body.style.removeProperty("--scrollbar-width"),document.body.style.overflow=e.value??"",jx&&i?.(),e.value=void 0};return o.watch(n,(a,l)=>{var u;if(!pi)return;if(!a){l&&s();return}e.value===void 0&&(e.value=document.body.style.overflow);const c=window.innerWidth-document.documentElement.clientWidth,f={padding:c,margin:0},p=(u=r.scrollBody)!=null&&u.value?typeof r.scrollBody.value=="object"?NR({padding:r.scrollBody.value.padding===!0?c:r.scrollBody.value.padding,margin:r.scrollBody.value.margin===!0?c:r.scrollBody.value.margin},f):f:{padding:0,margin:0};c>0&&(document.body.style.paddingRight=typeof p.padding=="number"?`${p.padding}px`:String(p.padding),document.body.style.marginRight=typeof p.margin=="number"?`${p.margin}px`:String(p.margin),document.body.style.setProperty("--scrollbar-width",`${c}px`),document.body.style.overflow="hidden"),jx&&(i=xl(document,"touchmove",m=>rD(m),{passive:!1})),o.nextTick(()=>{document.body.style.pointerEvents="none",document.body.style.overflow="hidden"})},{immediate:!0,flush:"sync"}),t});function Tf(t){const e=tD(6),n=nD();n.value.set(e,t??!1);const r=o.computed({get:()=>n.value.get(e)??!1,set:i=>n.value.set(e,i)});return jR(()=>{n.value.delete(e)}),r}function Jx(t){const e=window.getComputedStyle(t);if(e.overflowX==="scroll"||e.overflowY==="scroll"||e.overflowX==="auto"&&t.clientWidth<t.scrollWidth||e.overflowY==="auto"&&t.clientHeight<t.scrollHeight)return!0;{const n=t.parentNode;return!(n instanceof Element)||n.tagName==="BODY"?!1:Jx(n)}}function rD(t){const e=t||window.event,n=e.target;return n instanceof Element&&Jx(n)?!1:e.touches.length>1?!0:(e.preventDefault&&e.cancelable&&e.preventDefault(),!1)}const oD="data-radix-vue-collection-item";function ec(t,e=oD){const n=Symbol();return{createCollection:r=>{const i=o.ref([]);function s(){const a=uo(r);return a?i.value=Array.from(a.querySelectorAll(`[${e}]:not([data-disabled])`)):i.value=[]}return o.onBeforeUpdate(()=>{i.value=[]}),o.onMounted(s),o.onUpdated(s),o.watch(()=>r?.value,s,{immediate:!0}),o.provide(n,i),i},injectCollection:()=>o.inject(n,o.ref([]))}}function sa(t){const e=_f({dir:o.ref("ltr")});return o.computed(()=>{var n;return t?.value||((n=e.dir)==null?void 0:n.value)||"ltr"})}function aa(t){const e=o.getCurrentInstance(),n=e?.type.emits,r={};return n!=null&&n.length||console.warn(`No emitted event found. Please check component: ${e?.type.__name}`),n?.forEach(i=>{r[o.toHandlerKey(o.camelize(i))]=(...s)=>t(i,...s)}),r}let Hg=0;function zg(){o.watchEffect(t=>{if(!pi)return;const e=document.querySelectorAll("[data-radix-focus-guard]");document.body.insertAdjacentElement("afterbegin",e[0]??Zx()),document.body.insertAdjacentElement("beforeend",e[1]??Zx()),Hg++,t(()=>{Hg===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(n=>n.remove()),Hg--})})}function Zx(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}function Ug(t){return o.computed(()=>{var e;return Fo(t)?!!((e=uo(t))!=null&&e.closest("form")):!0})}function Jn(t){const e=o.getCurrentInstance(),n=Object.keys(e?.type.props??{}).reduce((i,s)=>{const a=(e?.type.props[s]).default;return a!==void 0&&(i[s]=a),i},{}),r=o.toRef(t);return o.computed(()=>{const i={},s=e?.vnode.props??{};return Object.keys(s).forEach(a=>{i[o.camelize(a)]=s[a]}),Object.keys({...n,...i}).reduce((a,l)=>(r.value[l]!==void 0&&(a[l]=r.value[l]),a),{})})}function Rt(t,e){const n=Jn(t),r=e?aa(e):{};return o.computed(()=>({...n.value,...r}))}function Le(){const t=o.getCurrentInstance(),e=o.ref(),n=o.computed(()=>{var a,l;return["#text","#comment"].includes((a=e.value)==null?void 0:a.$el.nodeName)?(l=e.value)==null?void 0:l.$el.nextElementSibling:uo(e)}),r=Object.assign({},t.exposed),i={};for(const a in t.props)Object.defineProperty(i,a,{enumerable:!0,configurable:!0,get:()=>t.props[a]});if(Object.keys(r).length>0)for(const a in r)Object.defineProperty(i,a,{enumerable:!0,configurable:!0,get:()=>r[a]});Object.defineProperty(i,"$el",{enumerable:!0,configurable:!0,get:()=>t.vnode.el}),t.exposed=i;function s(a){e.value=a,a&&(Object.defineProperty(i,"$el",{enumerable:!0,configurable:!0,get:()=>a instanceof Element?a:a.$el}),t.exposed=i)}return{forwardRef:s,currentRef:e,currentElement:n}}function iD(t,e){const n=qx(!1,300),r=o.ref(null),i=DR();function s(){r.value=null,n.value=!1}function a(l,u){const c=l.currentTarget,f={x:l.clientX,y:l.clientY},p=sD(f,c.getBoundingClientRect()),m=aD(f,p),g=lD(u.getBoundingClientRect()),v=cD([...m,...g]);r.value=v,n.value=!0}return o.watchEffect(l=>{if(t.value&&e.value){const u=f=>a(f,e.value),c=f=>a(f,t.value);t.value.addEventListener("pointerleave",u),e.value.addEventListener("pointerleave",c),l(()=>{var f,p;(f=t.value)==null||f.removeEventListener("pointerleave",u),(p=e.value)==null||p.removeEventListener("pointerleave",c)})}}),o.watchEffect(l=>{var u;if(r.value){const c=f=>{var p,m;if(!r.value)return;const g=f.target,v={x:f.clientX,y:f.clientY},b=((p=t.value)==null?void 0:p.contains(g))||((m=e.value)==null?void 0:m.contains(g)),w=!uD(v,r.value),x=!!g.closest("[data-grace-area-trigger]");b?s():(w||x)&&(s(),i.trigger())};(u=t.value)==null||u.ownerDocument.addEventListener("pointermove",c),l(()=>{var f;return(f=t.value)==null?void 0:f.ownerDocument.removeEventListener("pointermove",c)})}}),{isPointerInTransit:n,onPointerExit:i.on}}function sD(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),i=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(n,r,i,s)){case s:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function aD(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function lD(t){const{top:e,right:n,bottom:r,left:i}=t;return[{x:i,y:e},{x:n,y:e},{x:n,y:r},{x:i,y:r}]}function uD(t,e){const{x:n,y:r}=t;let i=!1;for(let s=0,a=e.length-1;s<e.length;a=s++){const l=e[s].x,u=e[s].y,c=e[a].x,f=e[a].y;u>r!=f>r&&n<(c-l)*(r-u)/(f-u)+l&&(i=!i)}return i}function cD(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),dD(e)}function dD(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const i=t[r];for(;e.length>=2;){const s=e[e.length-1],a=e[e.length-2];if((s.x-a.x)*(i.y-a.y)>=(s.y-a.y)*(i.x-a.x))e.pop();else break}e.push(i)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const i=t[r];for(;n.length>=2;){const s=n[n.length-1],a=n[n.length-2];if((s.x-a.x)*(i.y-a.y)>=(s.y-a.y)*(i.x-a.x))n.pop();else break}n.push(i)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var fD=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},kl=new WeakMap,Af=new WeakMap,Mf={},Wg=0,Qx=function(t){return t&&(t.host||Qx(t.parentNode))},pD=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=Qx(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},hD=function(t,e,n,r){var i=pD(e,Array.isArray(t)?t:[t]);Mf[n]||(Mf[n]=new WeakMap);var s=Mf[n],a=[],l=new Set,u=new Set(i),c=function(p){!p||l.has(p)||(l.add(p),c(p.parentNode))};i.forEach(c);var f=function(p){!p||u.has(p)||Array.prototype.forEach.call(p.children,function(m){if(l.has(m))f(m);else try{var g=m.getAttribute(r),v=g!==null&&g!=="false",b=(kl.get(m)||0)+1,w=(s.get(m)||0)+1;kl.set(m,b),s.set(m,w),a.push(m),b===1&&v&&Af.set(m,!0),w===1&&m.setAttribute(n,"true"),v||m.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",m,x)}})};return f(e),l.clear(),Wg++,function(){a.forEach(function(p){var m=kl.get(p)-1,g=s.get(p)-1;kl.set(p,m),s.set(p,g),m||(Af.has(p)||p.removeAttribute(r),Af.delete(p)),g||p.removeAttribute(n)}),Wg--,Wg||(kl=new WeakMap,kl=new WeakMap,Af=new WeakMap,Mf={})}},mD=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),i=fD(t);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),hD(r,i,n,"aria-hidden")):function(){return null}};function Of(t){let e;o.watch(()=>uo(t),n=>{n?e=mD(n):e&&e()}),o.onUnmounted(()=>{e&&e()})}let gD=0;function Hr(t,e="radix"){const n=_f({useId:void 0});return ly.useId?`${e}-${ly.useId()}`:n.useId?`${e}-${n.useId()}`:`${e}-${++gD}`}function vD(t){const e=o.ref(),n=o.computed(()=>{var i;return((i=e.value)==null?void 0:i.width)??0}),r=o.computed(()=>{var i;return((i=e.value)==null?void 0:i.height)??0});return o.onMounted(()=>{const i=uo(t);if(i){e.value={width:i.offsetWidth,height:i.offsetHeight};const s=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const l=a[0];let u,c;if("borderBoxSize"in l){const f=l.borderBoxSize,p=Array.isArray(f)?f[0]:f;u=p.inlineSize,c=p.blockSize}else u=i.offsetWidth,c=i.offsetHeight;e.value={width:u,height:c}});return s.observe(i,{box:"border-box"}),()=>s.unobserve(i)}else e.value=void 0}),{width:n,height:r}}function Nx(t,e){const n=o.ref(t);function r(i){return e[n.value][i]??n.value}return{state:n,dispatch:i=>{n.value=r(i)}}}const bD="data-item-text";function jg(t){const e=qx("",1e3);return{search:e,handleTypeaheadSearch:(n,r)=>{if(!(t!=null&&t.value)&&!r)return;e.value=e.value+n;const i=t?.value??r,s=$n(),a=i.map(p=>{var m;return{ref:p,textValue:((m=(p.querySelector(`[${bD}]`)??p).textContent)==null?void 0:m.trim())??""}}),l=a.find(p=>p.ref===s),u=a.map(p=>p.textValue),c=wD(u,e.value,l?.textValue),f=a.find(p=>p.textValue===c);return f&&f.ref.focus(),f?.ref},resetTypeahead:()=>{e.value=""}}}function yD(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function wD(t,e,n){const r=e.length>1&&Array.from(e).every(l=>l===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let s=yD(t,Math.max(i,0));r.length===1&&(s=s.filter(l=>l!==n));const a=s.find(l=>l.toLowerCase().startsWith(r.toLowerCase()));return a!==n?a:void 0}const qg=o.defineComponent({name:"PrimitiveSlot",inheritAttrs:!1,setup(t,{attrs:e,slots:n}){return()=>{var r,i;if(!n.default)return null;const s=Sf(n.default()),a=s.findIndex(f=>f.type!==o.Comment);if(a===-1)return s;const l=s[a];(r=l.props)==null||delete r.ref;const u=l.props?o.mergeProps(e,l.props):e;e.class&&(i=l.props)!=null&&i.class&&delete l.props.class;const c=o.cloneVNode(l,u);for(const f in u)f.startsWith("on")&&(c.props||(c.props={}),c.props[f]=u[f]);return s.length===1?c:(s[a]=c,s)}}}),Ye=o.defineComponent({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(t,{attrs:e,slots:n}){const r=t.asChild?"template":t.as;return typeof r=="string"&&["area","img","input"].includes(r)?()=>o.h(r,e):r!=="template"?()=>o.h(t.as,e,{default:n.default}):()=>o.h(qg,e,{default:n.default})}});function eC(){const t=o.ref(),e=o.computed(()=>{var n,r;return["#text","#comment"].includes((n=t.value)==null?void 0:n.$el.nodeName)?(r=t.value)==null?void 0:r.$el.nextElementSibling:uo(t)});return{primitiveElement:t,currentElement:e}}function xD(t,e){var n;const r=o.ref({}),i=o.ref("none"),s=o.ref(t),a=t.value?"mounted":"unmounted";let l;const u=((n=e.value)==null?void 0:n.ownerDocument.defaultView)??Ef,{state:c,dispatch:f}=Nx(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}}),p=w=>{var x;if(pi){const C=new CustomEvent(w,{bubbles:!1,cancelable:!1});(x=e.value)==null||x.dispatchEvent(C)}};o.watch(t,async(w,x)=>{var C;const E=x!==w;if(await o.nextTick(),E){const k=i.value,T=Bf(e.value);w?(f("MOUNT"),p("enter"),T==="none"&&p("after-enter")):T==="none"||((C=r.value)==null?void 0:C.display)==="none"?(f("UNMOUNT"),p("leave"),p("after-leave")):x&&k!==T?(f("ANIMATION_OUT"),p("leave")):(f("UNMOUNT"),p("after-leave"))}},{immediate:!0});const m=w=>{const x=Bf(e.value),C=x.includes(w.animationName),E=c.value==="mounted"?"enter":"leave";if(w.target===e.value&&C&&(p(`after-${E}`),f("ANIMATION_END"),!s.value)){const k=e.value.style.animationFillMode;e.value.style.animationFillMode="forwards",l=u?.setTimeout(()=>{var T;((T=e.value)==null?void 0:T.style.animationFillMode)==="forwards"&&(e.value.style.animationFillMode=k)})}w.target===e.value&&x==="none"&&f("ANIMATION_END")},g=w=>{w.target===e.value&&(i.value=Bf(e.value))},v=o.watch(e,(w,x)=>{w?(r.value=getComputedStyle(w),w.addEventListener("animationstart",g),w.addEventListener("animationcancel",m),w.addEventListener("animationend",m)):(f("ANIMATION_END"),l!==void 0&&u?.clearTimeout(l),x?.removeEventListener("animationstart",g),x?.removeEventListener("animationcancel",m),x?.removeEventListener("animationend",m))},{immediate:!0}),b=o.watch(c,()=>{const w=Bf(e.value);i.value=c.value==="mounted"?w:"none"});return o.onUnmounted(()=>{v(),b()}),{isPresent:o.computed(()=>["mounted","unmountSuspended"].includes(c.value))}}function Bf(t){return t&&getComputedStyle(t).animationName||"none"}const zr=o.defineComponent({name:"Presence",props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(t,{slots:e,expose:n}){var r;const{present:i,forceMount:s}=o.toRefs(t),a=o.ref(),{isPresent:l}=xD(i,a);n({present:l});let u=e.default({present:l});u=Sf(u||[]);const c=o.getCurrentInstance();if(u&&u?.length>1){const f=(r=c?.parent)!=null&&r.type.name?`<${c.parent.type.name} />`:"component";throw new Error([`Detected an invalid children for \`${f}\` for \`Presence\` component.`,"","Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.","You can apply a few solutions:",["Provide a single child element so that `presence` directive attach correctly.","Ensure the first child is an actual element instead of a raw text node or comment node."].map(p=>` - ${p}`).join(`
|
|
135
|
+
}`;var gt=tT(function(){return Mt(D,He+"return "+ye).apply(n,W)});if(gt.source=ye,G2(gt))throw gt;return gt}function Rue(d){return Bt(d).toLowerCase()}function Due(d){return Bt(d).toUpperCase()}function Pue(d,h,y){if(d=Bt(d),d&&(y||h===n))return c_(d);if(!d||!(h=Tr(h)))return d;var S=xo(d),M=xo(h),D=d_(S,M),W=f_(S,M)+1;return Ps(S,D,W).join("")}function Vue(d,h,y){if(d=Bt(d),d&&(y||h===n))return d.slice(0,h_(d)+1);if(!d||!(h=Tr(h)))return d;var S=xo(d),M=f_(S,xo(h))+1;return Ps(S,0,M).join("")}function Fue(d,h,y){if(d=Bt(d),d&&(y||h===n))return d.replace(Gb,"");if(!d||!(h=Tr(h)))return d;var S=xo(d),M=d_(S,xo(h));return Ps(S,M).join("")}function $ue(d,h){var y=B,S=H;if(nn(h)){var M="separator"in h?h.separator:M;y="length"in h?ft(h.length):y,S="omission"in h?Tr(h.omission):S}d=Bt(d);var D=d.length;if(eu(d)){var W=xo(d);D=W.length}if(y>=D)return d;var G=y-tu(S);if(G<1)return S;var Q=W?Ps(W,0,G).join(""):d.slice(0,G);if(M===n)return Q+S;if(W&&(G+=Q.length-G),X2(M)){if(d.slice(G).search(M)){var ve,be=Q;for(M.global||(M=c2(M.source,Bt(IS.exec(M))+"g")),M.lastIndex=0;ve=M.exec(be);)var ye=ve.index;Q=Q.slice(0,ye===n?G:ye)}}else if(d.indexOf(Tr(M),G)!=G){var Be=Q.lastIndexOf(M);Be>-1&&(Q=Q.slice(0,Be))}return Q+S}function Hue(d){return d=Bt(d),d&&Yo.test(d)?d.replace(gn,moe):d}var zue=lu(function(d,h,y){return d+(y?" ":"")+h.toUpperCase()}),Z2=n9("toUpperCase");function eT(d,h,y){return d=Bt(d),h=y?n:h,h===n?coe(d)?boe(d):toe(d):d.match(h)||[]}var tT=vt(function(d,h){try{return Sr(d,n,h)}catch(y){return G2(y)?y:new st(y)}}),Uue=Oi(function(d,h){return Jr(h,function(y){y=No(y),Ai(d,y,q2(d[y],d))}),d});function Wue(d){var h=d==null?0:d.length,y=Xe();return d=h?Qt(d,function(S){if(typeof S[1]!="function")throw new Zr(a);return[y(S[0]),S[1]]}):[],vt(function(S){for(var M=-1;++M<h;){var D=d[M];if(Sr(D[0],this,S))return Sr(D[1],this,S)}})}function jue(d){return mie(Nr(d,p))}function Q2(d){return function(){return d}}function que(d,h){return d==null||d!==d?h:d}var Kue=o9(),Gue=o9(!0);function pr(d){return d}function N2(d){return R_(typeof d=="function"?d:Nr(d,p))}function Xue(d){return P_(Nr(d,p))}function Yue(d,h){return V_(d,Nr(h,p))}var Jue=vt(function(d,h){return function(y){return id(y,d,h)}}),Zue=vt(function(d,h){return function(y){return id(d,y,h)}});function ey(d,h,y){var S=_n(h),M=um(h,S);y==null&&!(nn(h)&&(M.length||!S.length))&&(y=h,h=d,d=this,M=um(h,_n(h)));var D=!(nn(y)&&"chain"in y)||!!y.chain,W=Ii(d);return Jr(M,function(G){var Q=h[G];d[G]=Q,W&&(d.prototype[G]=function(){var ve=this.__chain__;if(D||ve){var be=d(this.__wrapped__),ye=be.__actions__=cr(this.__actions__);return ye.push({func:Q,args:arguments,thisArg:d}),be.__chain__=ve,be}return Q.apply(d,Os([this.value()],arguments))})}),d}function Que(){return Ln._===this&&(Ln._=Eoe),this}function ty(){}function Nue(d){return d=ft(d),vt(function(h){return F_(h,d)})}var ece=I2(Qt),tce=I2(i_),nce=I2(r2);function nT(d){return $2(d)?o2(No(d)):Iie(d)}function rce(d){return function(h){return d==null?n:Ha(d,h)}}var oce=s9(),ice=s9(!0);function ny(){return[]}function ry(){return!1}function sce(){return{}}function ace(){return""}function lce(){return!0}function uce(d,h){if(d=ft(d),d<1||d>F)return[];var y=X,S=jn(d,X);h=Xe(h),d-=X;for(var M=a2(S,h);++y<d;)h(y);return M}function cce(d){return at(d)?Qt(d,No):Ar(d)?[d]:cr(C9(Bt(d)))}function dce(d){var h=++Coe;return Bt(d)+h}var fce=mm(function(d,h){return d+h},0),pce=L2("ceil"),hce=mm(function(d,h){return d/h},1),mce=L2("floor");function gce(d){return d&&d.length?lm(d,pr,b2):n}function vce(d,h){return d&&d.length?lm(d,Xe(h,2),b2):n}function bce(d){return l_(d,pr)}function yce(d,h){return l_(d,Xe(h,2))}function wce(d){return d&&d.length?lm(d,pr,C2):n}function xce(d,h){return d&&d.length?lm(d,Xe(h,2),C2):n}var Cce=mm(function(d,h){return d*h},1),kce=L2("round"),Ece=mm(function(d,h){return d-h},0);function Sce(d){return d&&d.length?s2(d,pr):0}function _ce(d,h){return d&&d.length?s2(d,Xe(h,2)):0}return I.after=Xae,I.ary=L9,I.assign=Dle,I.assignIn=G9,I.assignInWith=Am,I.assignWith=Ple,I.at=Vle,I.before=R9,I.bind=q2,I.bindAll=Uue,I.bindKey=D9,I.castArray=sle,I.chain=O9,I.chunk=mse,I.compact=gse,I.concat=vse,I.cond=Wue,I.conforms=jue,I.constant=Q2,I.countBy=Sae,I.create=Fle,I.curry=P9,I.curryRight=V9,I.debounce=F9,I.defaults=$le,I.defaultsDeep=Hle,I.defer=Yae,I.delay=Jae,I.difference=bse,I.differenceBy=yse,I.differenceWith=wse,I.drop=xse,I.dropRight=Cse,I.dropRightWhile=kse,I.dropWhile=Ese,I.fill=Sse,I.filter=Tae,I.flatMap=Oae,I.flatMapDeep=Bae,I.flatMapDepth=Iae,I.flatten=_9,I.flattenDeep=_se,I.flattenDepth=Tse,I.flip=Zae,I.flow=Kue,I.flowRight=Gue,I.fromPairs=Ase,I.functions=Gle,I.functionsIn=Xle,I.groupBy=Lae,I.initial=Ose,I.intersection=Bse,I.intersectionBy=Ise,I.intersectionWith=Lse,I.invert=Jle,I.invertBy=Zle,I.invokeMap=Dae,I.iteratee=N2,I.keyBy=Pae,I.keys=_n,I.keysIn=fr,I.map=Cm,I.mapKeys=Nle,I.mapValues=eue,I.matches=Xue,I.matchesProperty=Yue,I.memoize=Em,I.merge=tue,I.mergeWith=X9,I.method=Jue,I.methodOf=Zue,I.mixin=ey,I.negate=Sm,I.nthArg=Nue,I.omit=nue,I.omitBy=rue,I.once=Qae,I.orderBy=Vae,I.over=ece,I.overArgs=Nae,I.overEvery=tce,I.overSome=nce,I.partial=K2,I.partialRight=$9,I.partition=Fae,I.pick=oue,I.pickBy=Y9,I.property=nT,I.propertyOf=rce,I.pull=Vse,I.pullAll=A9,I.pullAllBy=Fse,I.pullAllWith=$se,I.pullAt=Hse,I.range=oce,I.rangeRight=ice,I.rearg=ele,I.reject=zae,I.remove=zse,I.rest=tle,I.reverse=W2,I.sampleSize=Wae,I.set=sue,I.setWith=aue,I.shuffle=jae,I.slice=Use,I.sortBy=Gae,I.sortedUniq=Yse,I.sortedUniqBy=Jse,I.split=Oue,I.spread=nle,I.tail=Zse,I.take=Qse,I.takeRight=Nse,I.takeRightWhile=eae,I.takeWhile=tae,I.tap=gae,I.throttle=rle,I.thru=xm,I.toArray=j9,I.toPairs=J9,I.toPairsIn=Z9,I.toPath=cce,I.toPlainObject=K9,I.transform=lue,I.unary=ole,I.union=nae,I.unionBy=rae,I.unionWith=oae,I.uniq=iae,I.uniqBy=sae,I.uniqWith=aae,I.unset=uue,I.unzip=j2,I.unzipWith=M9,I.update=cue,I.updateWith=due,I.values=du,I.valuesIn=fue,I.without=lae,I.words=eT,I.wrap=ile,I.xor=uae,I.xorBy=cae,I.xorWith=dae,I.zip=fae,I.zipObject=pae,I.zipObjectDeep=hae,I.zipWith=mae,I.entries=J9,I.entriesIn=Z9,I.extend=G9,I.extendWith=Am,ey(I,I),I.add=fce,I.attempt=tT,I.camelCase=gue,I.capitalize=Q9,I.ceil=pce,I.clamp=pue,I.clone=ale,I.cloneDeep=ule,I.cloneDeepWith=cle,I.cloneWith=lle,I.conformsTo=dle,I.deburr=N9,I.defaultTo=que,I.divide=hce,I.endsWith=vue,I.eq=ko,I.escape=bue,I.escapeRegExp=yue,I.every=_ae,I.find=Aae,I.findIndex=E9,I.findKey=zle,I.findLast=Mae,I.findLastIndex=S9,I.findLastKey=Ule,I.floor=mce,I.forEach=B9,I.forEachRight=I9,I.forIn=Wle,I.forInRight=jle,I.forOwn=qle,I.forOwnRight=Kle,I.get=Y2,I.gt=fle,I.gte=ple,I.has=Yle,I.hasIn=J2,I.head=T9,I.identity=pr,I.includes=Rae,I.indexOf=Mse,I.inRange=hue,I.invoke=Qle,I.isArguments=Wa,I.isArray=at,I.isArrayBuffer=hle,I.isArrayLike=dr,I.isArrayLikeObject=dn,I.isBoolean=mle,I.isBuffer=Vs,I.isDate=gle,I.isElement=vle,I.isEmpty=ble,I.isEqual=yle,I.isEqualWith=wle,I.isError=G2,I.isFinite=xle,I.isFunction=Ii,I.isInteger=H9,I.isLength=_m,I.isMap=z9,I.isMatch=Cle,I.isMatchWith=kle,I.isNaN=Ele,I.isNative=Sle,I.isNil=Tle,I.isNull=_le,I.isNumber=U9,I.isObject=nn,I.isObjectLike=ln,I.isPlainObject=dd,I.isRegExp=X2,I.isSafeInteger=Ale,I.isSet=W9,I.isString=Tm,I.isSymbol=Ar,I.isTypedArray=cu,I.isUndefined=Mle,I.isWeakMap=Ole,I.isWeakSet=Ble,I.join=Rse,I.kebabCase=wue,I.last=to,I.lastIndexOf=Dse,I.lowerCase=xue,I.lowerFirst=Cue,I.lt=Ile,I.lte=Lle,I.max=gce,I.maxBy=vce,I.mean=bce,I.meanBy=yce,I.min=wce,I.minBy=xce,I.stubArray=ny,I.stubFalse=ry,I.stubObject=sce,I.stubString=ace,I.stubTrue=lce,I.multiply=Cce,I.nth=Pse,I.noConflict=Que,I.noop=ty,I.now=km,I.pad=kue,I.padEnd=Eue,I.padStart=Sue,I.parseInt=_ue,I.random=mue,I.reduce=$ae,I.reduceRight=Hae,I.repeat=Tue,I.replace=Aue,I.result=iue,I.round=kce,I.runInContext=Z,I.sample=Uae,I.size=qae,I.snakeCase=Mue,I.some=Kae,I.sortedIndex=Wse,I.sortedIndexBy=jse,I.sortedIndexOf=qse,I.sortedLastIndex=Kse,I.sortedLastIndexBy=Gse,I.sortedLastIndexOf=Xse,I.startCase=Bue,I.startsWith=Iue,I.subtract=Ece,I.sum=Sce,I.sumBy=_ce,I.template=Lue,I.times=uce,I.toFinite=Li,I.toInteger=ft,I.toLength=q9,I.toLower=Rue,I.toNumber=no,I.toSafeInteger=Rle,I.toString=Bt,I.toUpper=Due,I.trim=Pue,I.trimEnd=Vue,I.trimStart=Fue,I.truncate=$ue,I.unescape=Hue,I.uniqueId=dce,I.upperCase=zue,I.upperFirst=Z2,I.each=B9,I.eachRight=I9,I.first=T9,ey(I,function(){var d={};return Zo(I,function(h,y){It.call(I.prototype,y)||(d[y]=h)}),d}(),{chain:!1}),I.VERSION=r,Jr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(d){I[d].placeholder=I}),Jr(["drop","take"],function(d,h){xt.prototype[d]=function(y){y=y===n?1:xn(ft(y),0);var S=this.__filtered__&&!h?new xt(this):this.clone();return S.__filtered__?S.__takeCount__=jn(y,S.__takeCount__):S.__views__.push({size:jn(y,X),type:d+(S.__dir__<0?"Right":"")}),S},xt.prototype[d+"Right"]=function(y){return this.reverse()[d](y).reverse()}}),Jr(["filter","map","takeWhile"],function(d,h){var y=h+1,S=y==N||y==P;xt.prototype[d]=function(M){var D=this.clone();return D.__iteratees__.push({iteratee:Xe(M,3),type:y}),D.__filtered__=D.__filtered__||S,D}}),Jr(["head","last"],function(d,h){var y="take"+(h?"Right":"");xt.prototype[d]=function(){return this[y](1).value()[0]}}),Jr(["initial","tail"],function(d,h){var y="drop"+(h?"":"Right");xt.prototype[d]=function(){return this.__filtered__?new xt(this):this[y](1)}}),xt.prototype.compact=function(){return this.filter(pr)},xt.prototype.find=function(d){return this.filter(d).head()},xt.prototype.findLast=function(d){return this.reverse().find(d)},xt.prototype.invokeMap=vt(function(d,h){return typeof d=="function"?new xt(this):this.map(function(y){return id(y,d,h)})}),xt.prototype.reject=function(d){return this.filter(Sm(Xe(d)))},xt.prototype.slice=function(d,h){d=ft(d);var y=this;return y.__filtered__&&(d>0||h<0)?new xt(y):(d<0?y=y.takeRight(-d):d&&(y=y.drop(d)),h!==n&&(h=ft(h),y=h<0?y.dropRight(-h):y.take(h-d)),y)},xt.prototype.takeRightWhile=function(d){return this.reverse().takeWhile(d).reverse()},xt.prototype.toArray=function(){return this.take(X)},Zo(xt.prototype,function(d,h){var y=/^(?:filter|find|map|reject)|While$/.test(h),S=/^(?:head|last)$/.test(h),M=I[S?"take"+(h=="last"?"Right":""):h],D=S||/^find/.test(h);M&&(I.prototype[h]=function(){var W=this.__wrapped__,G=S?[1]:arguments,Q=W instanceof xt,ve=G[0],be=Q||at(W),ye=function(yt){var Ct=M.apply(I,Os([yt],G));return S&&Be?Ct[0]:Ct};be&&y&&typeof ve=="function"&&ve.length!=1&&(Q=be=!1);var Be=this.__chain__,He=!!this.__actions__.length,Je=D&&!Be,gt=Q&&!He;if(!D&&be){W=gt?W:new xt(this);var Ze=d.apply(W,G);return Ze.__actions__.push({func:xm,args:[ye],thisArg:n}),new Qr(Ze,Be)}return Je&>?d.apply(this,G):(Ze=this.thru(ye),Je?S?Ze.value()[0]:Ze.value():Ze)})}),Jr(["pop","push","shift","sort","splice","unshift"],function(d){var h=Gh[d],y=/^(?:push|sort|unshift)$/.test(d)?"tap":"thru",S=/^(?:pop|shift)$/.test(d);I.prototype[d]=function(){var M=arguments;if(S&&!this.__chain__){var D=this.value();return h.apply(at(D)?D:[],M)}return this[y](function(W){return h.apply(at(W)?W:[],M)})}}),Zo(xt.prototype,function(d,h){var y=I[h];if(y){var S=y.name+"";It.call(iu,S)||(iu[S]=[]),iu[S].push({name:h,func:y})}}),iu[hm(n,x).name]=[{name:"wrapper",func:n}],xt.prototype.clone=Hoe,xt.prototype.reverse=zoe,xt.prototype.value=Uoe,I.prototype.at=vae,I.prototype.chain=bae,I.prototype.commit=yae,I.prototype.next=wae,I.prototype.plant=Cae,I.prototype.reverse=kae,I.prototype.toJSON=I.prototype.valueOf=I.prototype.value=Eae,I.prototype.first=I.prototype.head,Qc&&(I.prototype[Qc]=xae),I},nu=yoe();Da?((Da.exports=nu)._=nu,Nb._=nu):Ln._=nu}).call(ml)}(df,df.exports);var St=df.exports;const Yt=(t,e="px")=>{if(!t)return t;const n=fg(t)?String(t):t,r=parseFloat(n),i=n.match(/[a-zA-Z%]+$/),s=i?i[0]:e;return isNaN(r)?t:r+s};function vL(t,e,n){return t<e?e:t>n?n:t}const fg=t=>typeof t=="number",pg=t=>typeof t=="function";function hg(t,e){const{extensions:n=[]}=t.extensionManager??{};return!!n.find(i=>i.name===e)}function px(t){return/\s/.test(t)}function hx(t,e){const n=[];let r=0;for(;r<t.length;){if(t.length-r<=e){n.push({text:t.substring(r),offset:r});break}let i=-1;for(let a=r+e;a>r;a--)if(px(t[a])){i=a;break}let s;if(i>r)for(n.push({text:t.substring(r,i),offset:r}),s=i;s<t.length&&px(t[s]);)s++;else s=r+e,n.push({text:t.substring(r,s),offset:r});r=s}return n.filter(i=>i.text.length>0)}const bL=t=>t?t.split(/\r?\n/).map(e=>`<p>${e.replace(/</g,"<").replace(/>/g,">")}</p>`).join(""):"";function mg(t,e={}){const{removeNodes:n=[]}=e,r=t.getJSON();function i(f=[]){const p=[];for(const m of f){if(n.includes(m.type))continue;const g={...m};m.content&&(g.content=i(m.content)),p.push(g)}return p}const s={...r,content:i(r.content)},a=t.schema.nodeFromJSON(s),u=Ir.fromSchema(t.schema).serializeFragment(a.content),c=document.createElement("div");return c.appendChild(u),c.innerHTML}function ff(){const t=new dg;t.isNativeWebViewAvailable()&&t.sendToNative(ag.KEYBOARD_DISMISS)}let Ni=null;function yL(){if(Ni)return Ni;if(typeof document>"u")return null;const t=document.createElement("span");return t.style.position="absolute",t.style.left="-9999px",t.style.top="-9999px",t.style.whiteSpace="nowrap",t.style.visibility="hidden",document.body.appendChild(t),Ni=t,t}function pf(t){const e=o.ref(null),n=o.ref(null),r=()=>{const l=t?.minChars??0;return typeof l=="number"?l:o.unref(l)??0},i=()=>{const l=t?.fontSize??"";return typeof l=="string"?l:o.unref(l)??""},s=()=>{const l=t?.fixed??!1;return typeof l=="boolean"?l:o.unref(l)??!1};function a(){s()&&n.value!==null||o.nextTick(()=>{const l=e.value;if(!l||typeof window>"u"||!(l instanceof Element))return;const u=yL();if(!u)return;const c=getComputedStyle(l);u.style.fontFamily=c.fontFamily||"",u.style.fontSize=i()||c.fontSize||"",u.style.fontWeight=c.fontWeight||"",u.style.letterSpacing=c.letterSpacing||"";const f=Math.max(1,r());u.textContent="가".repeat(f);const p=Math.ceil(u.getBoundingClientRect().width),m=E=>parseFloat(E)||0,g=m(c.paddingLeft),v=m(c.paddingRight),b=m(c.borderLeftWidth),w=m(c.borderRightWidth),x=g+v+b+w,C=l.offsetWidth-l.clientWidth-(b+w);n.value=p+x+C+4})}return o.onMounted(()=>{a(),typeof window<"u"&&window.addEventListener("resize",a)}),t?.minChars&&typeof t.minChars.value<"u"&&o.watch(t.minChars,()=>{a()}),t?.fontSize&&typeof t.fontSize.value<"u"&&o.watch(t.fontSize,()=>{a()}),t?.editor?.on("transaction",()=>{setTimeout(a,150)}),o.onBeforeUnmount(()=>{typeof window<"u"&&window.removeEventListener("resize",a),Ni&&Ni.parentNode&&(Ni.parentNode.removeChild(Ni),Ni=null)}),{contentInner:e,measuredMinWidth:n,measure:a}}const wL=o.reactive({extensions:[]});function xL(){return{state:wL}}const CL=()=>{const t=o.reactive({code:"ko",limit:1e3});function e(n){t.code=n.code??t.code,t.limit=n.limit??t.limit}return{languages:t.code,update:e,limit:t.limit}},kL="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let $r=(t=21)=>{let e="",n=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=kL[n[t]&63];return e};const EL=()=>{const t=o.reactive([]),e=ct.createEventHook(),n=ct.createEventHook();function r(u){t.push(u)}function i(u){const c=t.find(f=>f.id===u.id);c&&(c.text=u.text)}function s(u){const c=t.findIndex(p=>p.id===u.id);if(c===-1)return;const f=t[c];f.position?.top!==u.position?.top&&t.splice(c,1,{...f,pageId:u.pageId??f.pageId,position:u.position})}function a(u){const c=t.findIndex(f=>f.id===u.id);t.splice(c,1)}function l(u,c){const f=$r(6);return t.push({id:f,text:u,position:c}),f}return{removeSuperText:a,superText:t,updateSuperText:i,updatePositionSuperText:s,addMoreSuperText:l,addSuperText:r,onUpdatePositionEvent:e.on,onUpdatePositionTrigger:e.trigger,onHoverEvent:n.on,onHoverEventTrigger:n.trigger}},SL={defaultMargin:{left:"3.18cm",right:"3.18cm",top:"2.54cm",bottom:"2.54cm"},margin:{left:"20px",right:"20px",top:"20px",bottom:"20px"},defaultOrientation:"portrait",defaultBackground:"#fff",watermark:{type:"compact",alpha:.2,fontColor:"#000",fontSize:16,fontFamily:"SimSun",fontWeight:"normal",text:""},nodesComputedOption:{types:[],nodesComputed:{}},size:{label:"default",width:"100%",height:"100%",default:!0},header:!0,footer:!0,showLineNumber:!1,showToc:!1,pagination:!0,zoomLevel:100,autoWidth:!1,preview:{enabled:!1,laserPointer:!0}},bn=ct.createGlobalState(()=>{const{state:t}=xL(),e=o.ref(SL),n=o.ref(),r=o.ref(!1),{isFullscreen:i,toggle:s}=ct.useFullscreen(document.getElementById("vdc-editor")),a=o.reactive({extensions:t.extensions??[],defaultLang:sL,color:void 0,highlight:void 0,showPreview:!1,spellCheck:!1,findAndReplace:!1,printer:!1,fontFamily:"",fontSize:"",fontWeight:"",viewSuperText:!1,zoom:o.ref([100]),editor:{text:"",html:"",json:{}},AIMenu:!1}),l=EL(),u=CL(),c=o.ref(null);function f(me){n.value=me}function p(me){a.zoom=[me]}function m(me){a.fontSize=me}function g(me){a.fontFamily=me}function v(me){a.fontWeight=me}function b(me){n.value=me,a.editor.html=me.getHTML(),a.editor.json=me.getJSON(),a.editor.text=me.getText()}function w(me){e.value={...e.value,...me}}function x(){a.viewSuperText=!a.viewSuperText}function C(me){a.viewSuperText=me}function E(){a.showPreview=!a.showPreview}function k(){a.spellCheck=!a.spellCheck}function T(me){a.spellCheck=me}function _(){a.findAndReplace=!a.findAndReplace}function A(){a.printer=!a.printer}o.watchEffect(()=>{a.extensions=t.extensions,a.defaultLang=t.defaultLang});const V=o.ref();function O(me){V.value=me}function B(){V.value?.openDialog()}function H(){V.value?.closeDialog()}const j=o.ref([]);function Y(me){j.value=me}function N(me,J,ee=!0){const se=new DOMParser().parseFromString(J,"text/html");return me.forEach(({loc:pe,elementId:_e,content:Ae})=>{const Ue=`button.super-text[${Ne.POSITION}="${pe}"]`,We=se.querySelector(Ue);We&&(We.setAttribute(Ne.ELEMENT_ID,_e||""),We.setAttribute(Ne.TEXT,ee?bL(Ae):Ae))}),se.body.innerHTML}const U=me=>c.value=me,P=o.ref(null),L=o.ref();function F(me){L.value=me}const R=o.ref();function K(me){R.value=me}const X=o.ref(null),ae=o.ref();function de(me){ae.value=me}const Ee=o.ref();function ie(me){Ee.value=me}return{state:a,page:e,isFullscreen:i,toggleFullscreen:s,updateEditorState:b,setEditor:f,isReady:r,container:"#vdc-editor",editor:n,changeZoom:p,changePageOption:w,changeFontFamily:g,changeFontSize:m,changeFontWeight:v,toggleSuperText:x,superTextStore:l,checkSpellStore:u,viewSuperText:C,toggleFindAndReplace:_,togglePreview:E,toggleSpellCheck:k,setSpellCheck:T,togglePrinter:A,setEditorContextMenuRef:O,openSuperInput:B,closeSuperInput:H,imageAttachments:j,setImageAttachment:Y,getUpdatedContentBySuperText:N,textAlert:c,setTextAlert:U,focusFirstInvalidChar:P,editorSelectedMobile:L,setEditorSelectedMobile:F,editorContentMobile:R,setEditorContentMobile:K,footerTargetRef:X,editorContentInstance:ae,setEditorContentInstance:de,editorFocusedInstance:Ee,setEditorFocusedInstance:ie}}),gg=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function vg(t,e,n,r){t.addEventListener?t.addEventListener(e,n,r):t.attachEvent&&t.attachEvent("on".concat(e),n)}function qu(t,e,n,r){t.removeEventListener?t.removeEventListener(e,n,r):t.detachEvent&&t.detachEvent("on".concat(e),n)}function mx(t,e){const n=e.slice(0,e.length-1);for(let r=0;r<n.length;r++)n[r]=t[n[r].toLowerCase()];return n}function gx(t){typeof t!="string"&&(t=""),t=t.replace(/\s/g,"");const e=t.split(",");let n=e.lastIndexOf("");for(;n>=0;)e[n-1]+=",",e.splice(n,1),n=e.lastIndexOf("");return e}function _L(t,e){const n=t.length>=e.length?t:e,r=t.length>=e.length?e:t;let i=!0;for(let s=0;s<n.length;s++)r.indexOf(n[s])===-1&&(i=!1);return i}const Ku={backspace:8,"⌫":8,tab:9,clear:12,enter:13,"↩":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":gg?173:189,"=":gg?61:187,";":gg?59:186,"'":222,"[":219,"]":221,"\\":220},Ro={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},hf={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},Bn={16:!1,18:!1,17:!1,91:!1},Nt={};for(let t=1;t<20;t++)Ku["f".concat(t)]=111+t;let Jt=[],Gu=null,vx="all";const ci=new Map,Xu=t=>Ku[t.toLowerCase()]||Ro[t.toLowerCase()]||t.toUpperCase().charCodeAt(0),TL=t=>Object.keys(Ku).find(e=>Ku[e]===t),AL=t=>Object.keys(Ro).find(e=>Ro[e]===t);function bx(t){vx=t||"all"}function Yu(){return vx||"all"}function ML(){return Jt.slice(0)}function OL(){return Jt.map(t=>TL(t)||AL(t)||String.fromCharCode(t))}function BL(){const t=[];return Object.keys(Nt).forEach(e=>{Nt[e].forEach(n=>{let{key:r,scope:i,mods:s,shortcut:a}=n;t.push({scope:i,shortcut:a,mods:s,keys:r.split("+").map(l=>Xu(l))})})}),t}function IL(t){const e=t.target||t.srcElement,{tagName:n}=e;let r=!0;const i=n==="INPUT"&&!["checkbox","radio","range","button","file","reset","submit","color"].includes(e.type);return(e.isContentEditable||(i||n==="TEXTAREA"||n==="SELECT")&&!e.readOnly)&&(r=!1),r}function LL(t){return typeof t=="string"&&(t=Xu(t)),Jt.indexOf(t)!==-1}function RL(t,e){let n,r;t||(t=Yu());for(const i in Nt)if(Object.prototype.hasOwnProperty.call(Nt,i))for(n=Nt[i],r=0;r<n.length;)n[r].scope===t?n.splice(r,1).forEach(a=>{let{element:l}=a;return bg(l)}):r++;Yu()===t&&bx(e||"all")}function DL(t){let e=t.keyCode||t.which||t.charCode;const n=Jt.indexOf(e);if(n>=0&&Jt.splice(n,1),t.key&&t.key.toLowerCase()==="meta"&&Jt.splice(0,Jt.length),(e===93||e===224)&&(e=91),e in Bn){Bn[e]=!1;for(const r in Ro)Ro[r]===e&&(so[r]=!1)}}function yx(t){if(typeof t>"u")Object.keys(Nt).forEach(i=>{Array.isArray(Nt[i])&&Nt[i].forEach(s=>mf(s)),delete Nt[i]}),bg(null);else if(Array.isArray(t))t.forEach(i=>{i.key&&mf(i)});else if(typeof t=="object")t.key&&mf(t);else if(typeof t=="string"){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];let[i,s]=n;typeof i=="function"&&(s=i,i=""),mf({key:t,scope:i,method:s,splitKey:"+"})}}const mf=t=>{let{key:e,scope:n,method:r,splitKey:i="+"}=t;gx(e).forEach(a=>{const l=a.split(i),u=l.length,c=l[u-1],f=c==="*"?"*":Xu(c);if(!Nt[f])return;n||(n=Yu());const p=u>1?mx(Ro,l):[],m=[];Nt[f]=Nt[f].filter(g=>{const b=(r?g.method===r:!0)&&g.scope===n&&_L(g.mods,p);return b&&m.push(g.element),!b}),m.forEach(g=>bg(g))})};function wx(t,e,n,r){if(e.element!==r)return;let i;if(e.scope===n||e.scope==="all"){i=e.mods.length>0;for(const s in Bn)Object.prototype.hasOwnProperty.call(Bn,s)&&(!Bn[s]&&e.mods.indexOf(+s)>-1||Bn[s]&&e.mods.indexOf(+s)===-1)&&(i=!1);(e.mods.length===0&&!Bn[16]&&!Bn[18]&&!Bn[17]&&!Bn[91]||i||e.shortcut==="*")&&(e.keys=[],e.keys=e.keys.concat(Jt),e.method(t,e)===!1&&(t.preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation&&t.stopPropagation(),t.cancelBubble&&(t.cancelBubble=!0)))}}function xx(t,e){const n=Nt["*"];let r=t.keyCode||t.which||t.charCode;if(!so.filter.call(this,t))return;if((r===93||r===224)&&(r=91),Jt.indexOf(r)===-1&&r!==229&&Jt.push(r),["metaKey","ctrlKey","altKey","shiftKey"].forEach(l=>{const u=hf[l];t[l]&&Jt.indexOf(u)===-1?Jt.push(u):!t[l]&&Jt.indexOf(u)>-1?Jt.splice(Jt.indexOf(u),1):l==="metaKey"&&t[l]&&(Jt=Jt.filter(c=>c in hf||c===r))}),r in Bn){Bn[r]=!0;for(const l in Ro)Ro[l]===r&&(so[l]=!0);if(!n)return}for(const l in Bn)Object.prototype.hasOwnProperty.call(Bn,l)&&(Bn[l]=t[hf[l]]);t.getModifierState&&!(t.altKey&&!t.ctrlKey)&&t.getModifierState("AltGraph")&&(Jt.indexOf(17)===-1&&Jt.push(17),Jt.indexOf(18)===-1&&Jt.push(18),Bn[17]=!0,Bn[18]=!0);const i=Yu();if(n)for(let l=0;l<n.length;l++)n[l].scope===i&&(t.type==="keydown"&&n[l].keydown||t.type==="keyup"&&n[l].keyup)&&wx(t,n[l],i,e);if(!(r in Nt))return;const s=Nt[r],a=s.length;for(let l=0;l<a;l++)if((t.type==="keydown"&&s[l].keydown||t.type==="keyup"&&s[l].keyup)&&s[l].key){const u=s[l],{splitKey:c}=u,f=u.key.split(c),p=[];for(let m=0;m<f.length;m++)p.push(Xu(f[m]));p.sort().join("")===Jt.sort().join("")&&wx(t,u,i,e)}}function so(t,e,n){Jt=[];const r=gx(t);let i=[],s="all",a=document,l=0,u=!1,c=!0,f="+",p=!1,m=!1;for(n===void 0&&typeof e=="function"&&(n=e),Object.prototype.toString.call(e)==="[object Object]"&&(e.scope&&(s=e.scope),e.element&&(a=e.element),e.keyup&&(u=e.keyup),e.keydown!==void 0&&(c=e.keydown),e.capture!==void 0&&(p=e.capture),typeof e.splitKey=="string"&&(f=e.splitKey),e.single===!0&&(m=!0)),typeof e=="string"&&(s=e),m&&yx(t,s);l<r.length;l++)t=r[l].split(f),i=[],t.length>1&&(i=mx(Ro,t)),t=t[t.length-1],t=t==="*"?"*":Xu(t),t in Nt||(Nt[t]=[]),Nt[t].push({keyup:u,keydown:c,scope:s,mods:i,shortcut:r[l],method:n,key:r[l],splitKey:f,element:a});if(typeof a<"u"&&window){if(!ci.has(a)){const g=function(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;return xx(b,a)},v=function(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;xx(b,a),DL(b)};ci.set(a,{keydownListener:g,keyupListenr:v,capture:p}),vg(a,"keydown",g,p),vg(a,"keyup",v,p)}if(!Gu){const g=()=>{Jt=[]};Gu={listener:g,capture:p},vg(window,"focus",g,p)}}}function PL(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(Nt).forEach(n=>{Nt[n].filter(i=>i.scope===e&&i.shortcut===t).forEach(i=>{i&&i.method&&i.method()})})}function bg(t){const e=Object.values(Nt).flat();if(e.findIndex(r=>{let{element:i}=r;return i===t})<0){const{keydownListener:r,keyupListenr:i,capture:s}=ci.get(t)||{};r&&i&&(qu(t,"keyup",i,s),qu(t,"keydown",r,s),ci.delete(t))}if((e.length<=0||ci.size<=0)&&(Object.keys(ci).forEach(i=>{const{keydownListener:s,keyupListenr:a,capture:l}=ci.get(i)||{};s&&a&&(qu(i,"keyup",a,l),qu(i,"keydown",s,l),ci.delete(i))}),ci.clear(),Object.keys(Nt).forEach(i=>delete Nt[i]),Gu)){const{listener:i,capture:s}=Gu;qu(window,"focus",i,s),Gu=null}}const yg={getPressedKeyString:OL,setScope:bx,getScope:Yu,deleteScope:RL,getPressedKeyCodes:ML,getAllKeyCodes:BL,isPressed:LL,filter:IL,trigger:PL,unbind:yx,keyMap:Ku,modifier:Ro,modifierMap:hf};for(const t in yg)Object.prototype.hasOwnProperty.call(yg,t)&&(so[t]=yg[t]);if(typeof window<"u"){const t=window.hotkeys;so.noConflict=e=>(e&&window.hotkeys===so&&(window.hotkeys=t),so),window.hotkeys=so}const Ju=(t,e)=>{so.filter=()=>!0;const n=()=>{so(t,i=>(i.preventDefault(),e(),!1))},r=()=>{so.unbind(t)};return o.onBeforeUnmount(()=>{r()}),{bind:n,unbind:r}},VL=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,FL=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,$L=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,HL=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,zL=Fn.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",wt(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Ys({find:VL,type:this.type}),Ys({find:$L,type:this.type})]},addPasteRules(){return[Ji({find:FL,type:this.type}),Ji({find:HL,type:this.type})]}});let wg;function xg(){return wg===void 0&&(wg=navigator.platform.includes("Mac")),wg}function gf(t){return t.toLowerCase()==="mod"?xg()?"⌘":"Ctrl":t.toLowerCase()==="alt"?xg()?"⌥":"Alt":t.toLowerCase()==="shift"?xg()?"⇧":"Shift":t}function Cx(t){return t.map(gf).join(" ")}const kx=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,Ex=Bm,Cg=(t,e)=>n=>{var r;if(e?.variants==null)return Ex(t,n?.class,n?.className);const{variants:i,defaultVariants:s}=e,a=Object.keys(i).map(c=>{const f=n?.[c],p=s?.[c];if(f===null)return null;const m=kx(f)||kx(p);return i[c][m]}),l=n&&Object.entries(n).reduce((c,f)=>{let[p,m]=f;return m===void 0||(c[p]=m),c},{}),u=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((c,f)=>{let{class:p,className:m,...g}=f;return Object.entries(g).every(v=>{let[b,w]=v;return Array.isArray(w)?w.includes({...s,...l}[b]):{...s,...l}[b]===w})?[...c,p,m]:c},[]);return Ex(t,a,u,n?.class,n?.className)},UL=["top","right","bottom","left"],es=Math.min,br=Math.max,vf=Math.round,bf=Math.floor,Do=t=>({x:t,y:t}),WL={left:"right",right:"left",bottom:"top",top:"bottom"},jL={start:"end",end:"start"};function kg(t,e,n){return br(t,es(e,n))}function di(t,e){return typeof t=="function"?t(e):t}function fi(t){return t.split("-")[0]}function gl(t){return t.split("-")[1]}function Eg(t){return t==="x"?"y":"x"}function Sg(t){return t==="y"?"height":"width"}function ts(t){return["top","bottom"].includes(fi(t))?"y":"x"}function _g(t){return Eg(ts(t))}function qL(t,e,n){n===void 0&&(n=!1);const r=gl(t),i=_g(t),s=Sg(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(a=yf(a)),[a,yf(a)]}function KL(t){const e=yf(t);return[Tg(t),e,Tg(e)]}function Tg(t){return t.replace(/start|end/g,e=>jL[e])}function GL(t,e,n){const r=["left","right"],i=["right","left"],s=["top","bottom"],a=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:r:e?r:i;case"left":case"right":return e?s:a;default:return[]}}function XL(t,e,n,r){const i=gl(t);let s=GL(fi(t),n==="start",r);return i&&(s=s.map(a=>a+"-"+i),e&&(s=s.concat(s.map(Tg)))),s}function yf(t){return t.replace(/left|right|bottom|top/g,e=>WL[e])}function YL(t){return{top:0,right:0,bottom:0,left:0,...t}}function Sx(t){return typeof t!="number"?YL(t):{top:t,right:t,bottom:t,left:t}}function wf(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function _x(t,e,n){let{reference:r,floating:i}=t;const s=ts(e),a=_g(e),l=Sg(a),u=fi(e),c=s==="y",f=r.x+r.width/2-i.width/2,p=r.y+r.height/2-i.height/2,m=r[l]/2-i[l]/2;let g;switch(u){case"top":g={x:f,y:r.y-i.height};break;case"bottom":g={x:f,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:p};break;case"left":g={x:r.x-i.width,y:p};break;default:g={x:r.x,y:r.y}}switch(gl(e)){case"start":g[a]-=m*(n&&c?-1:1);break;case"end":g[a]+=m*(n&&c?-1:1);break}return g}const JL=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:a}=n,l=s.filter(Boolean),u=await(a.isRTL==null?void 0:a.isRTL(e));let c=await a.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:p}=_x(c,r,u),m=r,g={},v=0;for(let b=0;b<l.length;b++){const{name:w,fn:x}=l[b],{x:C,y:E,data:k,reset:T}=await x({x:f,y:p,initialPlacement:r,placement:m,strategy:i,middlewareData:g,rects:c,platform:a,elements:{reference:t,floating:e}});f=C??f,p=E??p,g={...g,[w]:{...g[w],...k}},T&&v<=50&&(v++,typeof T=="object"&&(T.placement&&(m=T.placement),T.rects&&(c=T.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:i}):T.rects),{x:f,y:p}=_x(c,m,u)),b=-1)}return{x:f,y:p,placement:m,strategy:i,middlewareData:g}};async function Zu(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:s,rects:a,elements:l,strategy:u}=t,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:p="floating",altBoundary:m=!1,padding:g=0}=di(e,t),v=Sx(g),w=l[m?p==="floating"?"reference":"floating":p],x=wf(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:c,rootBoundary:f,strategy:u})),C=p==="floating"?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),k=await(s.isElement==null?void 0:s.isElement(E))?await(s.getScale==null?void 0:s.getScale(E))||{x:1,y:1}:{x:1,y:1},T=wf(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:C,offsetParent:E,strategy:u}):C);return{top:(x.top-T.top+v.top)/k.y,bottom:(T.bottom-x.bottom+v.bottom)/k.y,left:(x.left-T.left+v.left)/k.x,right:(T.right-x.right+v.right)/k.x}}const ZL=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:s,platform:a,elements:l,middlewareData:u}=e,{element:c,padding:f=0}=di(t,e)||{};if(c==null)return{};const p=Sx(f),m={x:n,y:r},g=_g(i),v=Sg(g),b=await a.getDimensions(c),w=g==="y",x=w?"top":"left",C=w?"bottom":"right",E=w?"clientHeight":"clientWidth",k=s.reference[v]+s.reference[g]-m[g]-s.floating[v],T=m[g]-s.reference[g],_=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c));let A=_?_[E]:0;(!A||!await(a.isElement==null?void 0:a.isElement(_)))&&(A=l.floating[E]||s.floating[v]);const V=k/2-T/2,O=A/2-b[v]/2-1,B=es(p[x],O),H=es(p[C],O),j=B,Y=A-b[v]-H,N=A/2-b[v]/2+V,U=kg(j,N,Y),P=!u.arrow&&gl(i)!=null&&N!==U&&s.reference[v]/2-(N<j?B:H)-b[v]/2<0,L=P?N<j?N-j:N-Y:0;return{[g]:m[g]+L,data:{[g]:U,centerOffset:N-U-L,...P&&{alignmentOffset:L}},reset:P}}}),QL=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:s,rects:a,initialPlacement:l,platform:u,elements:c}=e,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:b=!0,...w}=di(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const x=fi(i),C=ts(l),E=fi(l)===l,k=await(u.isRTL==null?void 0:u.isRTL(c.floating)),T=m||(E||!b?[yf(l)]:KL(l)),_=v!=="none";!m&&_&&T.push(...XL(l,b,v,k));const A=[l,...T],V=await Zu(e,w),O=[];let B=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&O.push(V[x]),p){const N=qL(i,a,k);O.push(V[N[0]],V[N[1]])}if(B=[...B,{placement:i,overflows:O}],!O.every(N=>N<=0)){var H,j;const N=(((H=s.flip)==null?void 0:H.index)||0)+1,U=A[N];if(U)return{data:{index:N,overflows:B},reset:{placement:U}};let P=(j=B.filter(L=>L.overflows[0]<=0).sort((L,F)=>L.overflows[1]-F.overflows[1])[0])==null?void 0:j.placement;if(!P)switch(g){case"bestFit":{var Y;const L=(Y=B.filter(F=>{if(_){const R=ts(F.placement);return R===C||R==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(R=>R>0).reduce((R,K)=>R+K,0)]).sort((F,R)=>F[1]-R[1])[0])==null?void 0:Y[0];L&&(P=L);break}case"initialPlacement":P=l;break}if(i!==P)return{reset:{placement:P}}}return{}}}};function Tx(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Ax(t){return UL.some(e=>t[e]>=0)}const NL=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...i}=di(t,e);switch(r){case"referenceHidden":{const s=await Zu(e,{...i,elementContext:"reference"}),a=Tx(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Ax(a)}}}case"escaped":{const s=await Zu(e,{...i,altBoundary:!0}),a=Tx(s,n.floating);return{data:{escapedOffsets:a,escaped:Ax(a)}}}default:return{}}}}};async function eR(t,e){const{placement:n,platform:r,elements:i}=t,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=fi(n),l=gl(n),u=ts(n)==="y",c=["left","top"].includes(a)?-1:1,f=s&&u?-1:1,p=di(e,t);let{mainAxis:m,crossAxis:g,alignmentAxis:v}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof v=="number"&&(g=l==="end"?v*-1:v),u?{x:g*f,y:m*c}:{x:m*c,y:g*f}}const tR=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:s,placement:a,middlewareData:l}=e,u=await eR(e,t);return a===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:i+u.x,y:s+u.y,data:{...u,placement:a}}}}},nR=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:w=>{let{x,y:C}=w;return{x,y:C}}},...u}=di(t,e),c={x:n,y:r},f=await Zu(e,u),p=ts(fi(i)),m=Eg(p);let g=c[m],v=c[p];if(s){const w=m==="y"?"top":"left",x=m==="y"?"bottom":"right",C=g+f[w],E=g-f[x];g=kg(C,g,E)}if(a){const w=p==="y"?"top":"left",x=p==="y"?"bottom":"right",C=v+f[w],E=v-f[x];v=kg(C,v,E)}const b=l.fn({...e,[m]:g,[p]:v});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[m]:s,[p]:a}}}}}},rR=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:s,middlewareData:a}=e,{offset:l=0,mainAxis:u=!0,crossAxis:c=!0}=di(t,e),f={x:n,y:r},p=ts(i),m=Eg(p);let g=f[m],v=f[p];const b=di(l,e),w=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(u){const E=m==="y"?"height":"width",k=s.reference[m]-s.floating[E]+w.mainAxis,T=s.reference[m]+s.reference[E]-w.mainAxis;g<k?g=k:g>T&&(g=T)}if(c){var x,C;const E=m==="y"?"width":"height",k=["top","left"].includes(fi(i)),T=s.reference[p]-s.floating[E]+(k&&((x=a.offset)==null?void 0:x[p])||0)+(k?0:w.crossAxis),_=s.reference[p]+s.reference[E]+(k?0:((C=a.offset)==null?void 0:C[p])||0)-(k?w.crossAxis:0);v<T?v=T:v>_&&(v=_)}return{[m]:g,[p]:v}}}},oR=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:s,platform:a,elements:l}=e,{apply:u=()=>{},...c}=di(t,e),f=await Zu(e,c),p=fi(i),m=gl(i),g=ts(i)==="y",{width:v,height:b}=s.floating;let w,x;p==="top"||p==="bottom"?(w=p,x=m===(await(a.isRTL==null?void 0:a.isRTL(l.floating))?"start":"end")?"left":"right"):(x=p,w=m==="end"?"top":"bottom");const C=b-f.top-f.bottom,E=v-f.left-f.right,k=es(b-f[w],C),T=es(v-f[x],E),_=!e.middlewareData.shift;let A=k,V=T;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(V=E),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(A=C),_&&!m){const B=br(f.left,0),H=br(f.right,0),j=br(f.top,0),Y=br(f.bottom,0);g?V=v-2*(B!==0||H!==0?B+H:br(f.left,f.right)):A=b-2*(j!==0||Y!==0?j+Y:br(f.top,f.bottom))}await u({...e,availableWidth:V,availableHeight:A});const O=await a.getDimensions(l.floating);return v!==O.width||b!==O.height?{reset:{rects:!0}}:{}}}};function xf(){return typeof window<"u"}function oa(t){return Ag(t)?(t.nodeName||"").toLowerCase():"#document"}function yr(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Po(t){var e;return(e=(Ag(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Ag(t){return xf()?t instanceof Node||t instanceof yr(t).Node:!1}function ao(t){return xf()?t instanceof Element||t instanceof yr(t).Element:!1}function Vo(t){return xf()?t instanceof HTMLElement||t instanceof yr(t).HTMLElement:!1}function Mx(t){return!xf()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof yr(t).ShadowRoot}function Qu(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=lo(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function iR(t){return["table","td","th"].includes(oa(t))}function Cf(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function Mg(t){const e=Og(),n=ao(t)?lo(t):t;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function sR(t){let e=ns(t);for(;Vo(e)&&!vl(e);){if(Mg(e))return e;if(Cf(e))return null;e=ns(e)}return null}function Og(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function vl(t){return["html","body","#document"].includes(oa(t))}function lo(t){return yr(t).getComputedStyle(t)}function kf(t){return ao(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ns(t){if(oa(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Mx(t)&&t.host||Po(t);return Mx(e)?e.host:e}function Ox(t){const e=ns(t);return vl(e)?t.ownerDocument?t.ownerDocument.body:t.body:Vo(e)&&Qu(e)?e:Ox(e)}function Nu(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Ox(t),s=i===((r=t.ownerDocument)==null?void 0:r.body),a=yr(i);if(s){const l=Bg(a);return e.concat(a,a.visualViewport||[],Qu(i)?i:[],l&&n?Nu(l):[])}return e.concat(i,Nu(i,[],n))}function Bg(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Bx(t){const e=lo(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=Vo(t),s=i?t.offsetWidth:n,a=i?t.offsetHeight:r,l=vf(n)!==s||vf(r)!==a;return l&&(n=s,r=a),{width:n,height:r,$:l}}function Ig(t){return ao(t)?t:t.contextElement}function bl(t){const e=Ig(t);if(!Vo(e))return Do(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:s}=Bx(e);let a=(s?vf(n.width):n.width)/r,l=(s?vf(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const aR=Do(0);function Ix(t){const e=yr(t);return!Og()||!e.visualViewport?aR:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function lR(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==yr(t)?!1:e}function ia(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=Ig(t);let a=Do(1);e&&(r?ao(r)&&(a=bl(r)):a=bl(t));const l=lR(s,n,r)?Ix(s):Do(0);let u=(i.left+l.x)/a.x,c=(i.top+l.y)/a.y,f=i.width/a.x,p=i.height/a.y;if(s){const m=yr(s),g=r&&ao(r)?yr(r):r;let v=m,b=Bg(v);for(;b&&r&&g!==v;){const w=bl(b),x=b.getBoundingClientRect(),C=lo(b),E=x.left+(b.clientLeft+parseFloat(C.paddingLeft))*w.x,k=x.top+(b.clientTop+parseFloat(C.paddingTop))*w.y;u*=w.x,c*=w.y,f*=w.x,p*=w.y,u+=E,c+=k,v=yr(b),b=Bg(v)}}return wf({width:f,height:p,x:u,y:c})}function Lg(t,e){const n=kf(t).scrollLeft;return e?e.left+n:ia(Po(t)).left+n}function Lx(t,e,n){n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=r.left+e.scrollLeft-(n?0:Lg(t,r)),s=r.top+e.scrollTop;return{x:i,y:s}}function uR(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const s=i==="fixed",a=Po(r),l=e?Cf(e.floating):!1;if(r===a||l&&s)return n;let u={scrollLeft:0,scrollTop:0},c=Do(1);const f=Do(0),p=Vo(r);if((p||!p&&!s)&&((oa(r)!=="body"||Qu(a))&&(u=kf(r)),Vo(r))){const g=ia(r);c=bl(r),f.x=g.x+r.clientLeft,f.y=g.y+r.clientTop}const m=a&&!p&&!s?Lx(a,u,!0):Do(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-u.scrollLeft*c.x+f.x+m.x,y:n.y*c.y-u.scrollTop*c.y+f.y+m.y}}function cR(t){return Array.from(t.getClientRects())}function dR(t){const e=Po(t),n=kf(t),r=t.ownerDocument.body,i=br(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=br(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Lg(t);const l=-n.scrollTop;return lo(r).direction==="rtl"&&(a+=br(e.clientWidth,r.clientWidth)-i),{width:i,height:s,x:a,y:l}}function fR(t,e){const n=yr(t),r=Po(t),i=n.visualViewport;let s=r.clientWidth,a=r.clientHeight,l=0,u=0;if(i){s=i.width,a=i.height;const c=Og();(!c||c&&e==="fixed")&&(l=i.offsetLeft,u=i.offsetTop)}return{width:s,height:a,x:l,y:u}}function pR(t,e){const n=ia(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,s=Vo(t)?bl(t):Do(1),a=t.clientWidth*s.x,l=t.clientHeight*s.y,u=i*s.x,c=r*s.y;return{width:a,height:l,x:u,y:c}}function Rx(t,e,n){let r;if(e==="viewport")r=fR(t,n);else if(e==="document")r=dR(Po(t));else if(ao(e))r=pR(e,n);else{const i=Ix(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return wf(r)}function Dx(t,e){const n=ns(t);return n===e||!ao(n)||vl(n)?!1:lo(n).position==="fixed"||Dx(n,e)}function hR(t,e){const n=e.get(t);if(n)return n;let r=Nu(t,[],!1).filter(l=>ao(l)&&oa(l)!=="body"),i=null;const s=lo(t).position==="fixed";let a=s?ns(t):t;for(;ao(a)&&!vl(a);){const l=lo(a),u=Mg(a);!u&&l.position==="fixed"&&(i=null),(s?!u&&!i:!u&&l.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Qu(a)&&!u&&Dx(t,a))?r=r.filter(f=>f!==a):i=l,a=ns(a)}return e.set(t,r),r}function mR(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const a=[...n==="clippingAncestors"?Cf(e)?[]:hR(e,this._c):[].concat(n),r],l=a[0],u=a.reduce((c,f)=>{const p=Rx(e,f,i);return c.top=br(p.top,c.top),c.right=es(p.right,c.right),c.bottom=es(p.bottom,c.bottom),c.left=br(p.left,c.left),c},Rx(e,l,i));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function gR(t){const{width:e,height:n}=Bx(t);return{width:e,height:n}}function vR(t,e,n){const r=Vo(e),i=Po(e),s=n==="fixed",a=ia(t,!0,s,e);let l={scrollLeft:0,scrollTop:0};const u=Do(0);if(r||!r&&!s)if((oa(e)!=="body"||Qu(i))&&(l=kf(e)),r){const m=ia(e,!0,s,e);u.x=m.x+e.clientLeft,u.y=m.y+e.clientTop}else i&&(u.x=Lg(i));const c=i&&!r&&!s?Lx(i,l):Do(0),f=a.left+l.scrollLeft-u.x-c.x,p=a.top+l.scrollTop-u.y-c.y;return{x:f,y:p,width:a.width,height:a.height}}function Rg(t){return lo(t).position==="static"}function Px(t,e){if(!Vo(t)||lo(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Po(t)===n&&(n=n.ownerDocument.body),n}function Vx(t,e){const n=yr(t);if(Cf(t))return n;if(!Vo(t)){let i=ns(t);for(;i&&!vl(i);){if(ao(i)&&!Rg(i))return i;i=ns(i)}return n}let r=Px(t,e);for(;r&&iR(r)&&Rg(r);)r=Px(r,e);return r&&vl(r)&&Rg(r)&&!Mg(r)?n:r||sR(t)||n}const bR=async function(t){const e=this.getOffsetParent||Vx,n=this.getDimensions,r=await n(t.floating);return{reference:vR(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function yR(t){return lo(t).direction==="rtl"}const wR={convertOffsetParentRelativeRectToViewportRelativeRect:uR,getDocumentElement:Po,getClippingRect:mR,getOffsetParent:Vx,getElementRects:bR,getClientRects:cR,getDimensions:gR,getScale:bl,isElement:ao,isRTL:yR};function Fx(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function xR(t,e){let n=null,r;const i=Po(t);function s(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function a(l,u){l===void 0&&(l=!1),u===void 0&&(u=1),s();const c=t.getBoundingClientRect(),{left:f,top:p,width:m,height:g}=c;if(l||e(),!m||!g)return;const v=bf(p),b=bf(i.clientWidth-(f+m)),w=bf(i.clientHeight-(p+g)),x=bf(f),E={rootMargin:-v+"px "+-b+"px "+-w+"px "+-x+"px",threshold:br(0,es(1,u))||1};let k=!0;function T(_){const A=_[0].intersectionRatio;if(A!==u){if(!k)return a();A?a(!1,A):r=setTimeout(()=>{a(!1,1e-7)},1e3)}A===1&&!Fx(c,t.getBoundingClientRect())&&a(),k=!1}try{n=new IntersectionObserver(T,{...E,root:i.ownerDocument})}catch{n=new IntersectionObserver(T,E)}n.observe(t)}return a(!0),s}function CR(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,c=Ig(t),f=i||s?[...c?Nu(c):[],...Nu(e)]:[];f.forEach(x=>{i&&x.addEventListener("scroll",n,{passive:!0}),s&&x.addEventListener("resize",n)});const p=c&&l?xR(c,n):null;let m=-1,g=null;a&&(g=new ResizeObserver(x=>{let[C]=x;C&&C.target===c&&g&&(g.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var E;(E=g)==null||E.observe(e)})),n()}),c&&!u&&g.observe(c),g.observe(e));let v,b=u?ia(t):null;u&&w();function w(){const x=ia(t);b&&!Fx(b,x)&&n(),b=x,v=requestAnimationFrame(w)}return n(),()=>{var x;f.forEach(C=>{i&&C.removeEventListener("scroll",n),s&&C.removeEventListener("resize",n)}),p?.(),(x=g)==null||x.disconnect(),g=null,u&&cancelAnimationFrame(v)}}const kR=tR,ER=nR,$x=QL,SR=oR,_R=NL,TR=ZL,AR=rR,MR=(t,e,n)=>{const r=new Map,i={platform:wR,...n},s={...i.platform,_c:r};return JL(t,e,{...i,platform:s})};function OR(t){return t!=null&&typeof t=="object"&&"$el"in t}function Dg(t){if(OR(t)){const e=t.$el;return Ag(e)&&oa(e)==="#comment"?null:e}return t}function yl(t){return typeof t=="function"?t():o.unref(t)}function BR(t){return{name:"arrow",options:t,fn(e){const n=Dg(yl(t.element));return n==null?{}:TR({element:n,padding:t.padding}).fn(e)}}}function Hx(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function zx(t,e){const n=Hx(t);return Math.round(e*n)/n}function IR(t,e,n){n===void 0&&(n={});const r=n.whileElementsMounted,i=o.computed(()=>{var A;return(A=yl(n.open))!=null?A:!0}),s=o.computed(()=>yl(n.middleware)),a=o.computed(()=>{var A;return(A=yl(n.placement))!=null?A:"bottom"}),l=o.computed(()=>{var A;return(A=yl(n.strategy))!=null?A:"absolute"}),u=o.computed(()=>{var A;return(A=yl(n.transform))!=null?A:!0}),c=o.computed(()=>Dg(t.value)),f=o.computed(()=>Dg(e.value)),p=o.ref(0),m=o.ref(0),g=o.ref(l.value),v=o.ref(a.value),b=o.shallowRef({}),w=o.ref(!1),x=o.computed(()=>{const A={position:g.value,left:"0",top:"0"};if(!f.value)return A;const V=zx(f.value,p.value),O=zx(f.value,m.value);return u.value?{...A,transform:"translate("+V+"px, "+O+"px)",...Hx(f.value)>=1.5&&{willChange:"transform"}}:{position:g.value,left:V+"px",top:O+"px"}});let C;function E(){if(c.value==null||f.value==null)return;const A=i.value;MR(c.value,f.value,{middleware:s.value,placement:a.value,strategy:l.value}).then(V=>{p.value=V.x,m.value=V.y,g.value=V.strategy,v.value=V.placement,b.value=V.middlewareData,w.value=A!==!1})}function k(){typeof C=="function"&&(C(),C=void 0)}function T(){if(k(),r===void 0){E();return}if(c.value!=null&&f.value!=null){C=r(c.value,f.value,E);return}}function _(){i.value||(w.value=!1)}return o.watch([s,a,l,i],E,{flush:"sync"}),o.watch([c,f],T,{flush:"sync"}),o.watch(i,_,{flush:"sync"}),o.getCurrentScope()&&o.onScopeDispose(k),{x:o.shallowReadonly(p),y:o.shallowReadonly(m),strategy:o.shallowReadonly(g),placement:o.shallowReadonly(v),middlewareData:o.shallowReadonly(b),isPositioned:o.shallowReadonly(w),floatingStyles:x,update:E}}function Ft(t,e){const n=typeof t=="string"&&!e?`${t}Context`:e,r=Symbol(n);return[i=>{const s=o.inject(r,i);if(s||s===null)return s;throw new Error(`Injection \`${r.toString()}\` not found. Component must be used within ${Array.isArray(t)?`one of the following components: ${t.join(", ")}`:`\`${t}\``}`)},i=>(o.provide(r,i),i)]}function Ux(t,e,n){const r=n.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&r.addEventListener(t,e,{once:!0}),r.dispatchEvent(i)}function Pg(t,e=Number.NEGATIVE_INFINITY,n=Number.POSITIVE_INFINITY){return Math.min(n,Math.max(e,t))}function LR(t){return t==null}function RR(t,e){var n;const r=o.shallowRef();return o.watchEffect(()=>{r.value=t()},{...e,flush:(n=void 0)!=null?n:"sync"}),o.readonly(r)}function wl(t){return o.getCurrentScope()?(o.onScopeDispose(t),!0):!1}function DR(){const t=new Set,e=n=>{t.delete(n)};return{on:n=>{t.add(n);const r=()=>e(n);return wl(r),{off:r}},off:e,trigger:(...n)=>Promise.all(Array.from(t).map(r=>r(...n)))}}function PR(t){let e=!1,n;const r=o.effectScope(!0);return(...i)=>(e||(n=r.run(()=>t(...i)),e=!0),n)}function Wx(t){let e=0,n,r;const i=()=>{e-=1,r&&e<=0&&(r.stop(),n=void 0,r=void 0)};return(...s)=>(e+=1,n||(r=o.effectScope(!0),n=r.run(()=>t(...s))),wl(i),n)}function Fo(t){return typeof t=="function"?t():o.unref(t)}const pi=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const VR=t=>typeof t<"u",FR=Object.prototype.toString,$R=t=>FR.call(t)==="[object Object]",Vg=()=>{},jx=HR();function HR(){var t,e;return pi&&((t=window?.navigator)==null?void 0:t.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((e=window?.navigator)==null?void 0:e.maxTouchPoints)>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function zR(t,e){function n(...r){return new Promise((i,s)=>{Promise.resolve(t(()=>e.apply(this,r),{fn:e,thisArg:this,args:r})).then(i).catch(s)})}return n}function UR(t,e={}){let n,r,i=Vg;const s=a=>{clearTimeout(a),i(),i=Vg};return a=>{const l=Fo(t),u=Fo(e.maxWait);return n&&s(n),l<=0||u!==void 0&&u<=0?(r&&(s(r),r=null),Promise.resolve(a())):new Promise((c,f)=>{i=e.rejectOnCancel?f:c,u&&!r&&(r=setTimeout(()=>{n&&s(n),r=null,c(a())},u)),n=setTimeout(()=>{r&&s(r),r=null,c(a())},l)})}}function WR(t){return o.getCurrentInstance()}function qx(t,e=1e4){return o.customRef((n,r)=>{let i=Fo(t),s;const a=()=>setTimeout(()=>{i=Fo(t),r()},Fo(e));return wl(()=>{clearTimeout(s)}),{get(){return n(),i},set(l){i=l,r(),clearTimeout(s),s=a()}}})}function Kx(t,e=200,n={}){return zR(UR(e,n),t)}function jR(t,e){WR()&&o.onBeforeUnmount(t,e)}function Gx(t,e,n={}){const{immediate:r=!0}=n,i=o.ref(!1);let s=null;function a(){s&&(clearTimeout(s),s=null)}function l(){i.value=!1,a()}function u(...c){a(),i.value=!0,s=setTimeout(()=>{i.value=!1,s=null,t(...c)},Fo(e))}return r&&(i.value=!0,pi&&u()),wl(l),{isPending:o.readonly(i),start:u,stop:l}}function qR(t,e,n){const r=o.watch(t,(...i)=>(o.nextTick(()=>r()),e(...i)),n);return r}function uo(t){var e;const n=Fo(t);return(e=n?.$el)!=null?e:n}const Ef=pi?window:void 0;function xl(...t){let e,n,r,i;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,r,i]=t,e=Ef):[e,n,r,i]=t,!e)return Vg;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const s=[],a=()=>{s.forEach(f=>f()),s.length=0},l=(f,p,m,g)=>(f.addEventListener(p,m,g),()=>f.removeEventListener(p,m,g)),u=o.watch(()=>[uo(e),Fo(i)],([f,p])=>{if(a(),!f)return;const m=$R(p)?{...p}:p;s.push(...n.flatMap(g=>r.map(v=>l(f,g,v,m))))},{immediate:!0,flush:"post"}),c=()=>{u(),a()};return wl(c),c}function KR(t){return typeof t=="function"?t:typeof t=="string"?e=>e.key===t:Array.isArray(t)?e=>t.includes(e.key):()=>!0}function GR(...t){let e,n,r={};t.length===3?(e=t[0],n=t[1],r=t[2]):t.length===2?typeof t[1]=="object"?(e=!0,n=t[0],r=t[1]):(e=t[0],n=t[1]):(e=!0,n=t[0]);const{target:i=Ef,eventName:s="keydown",passive:a=!1,dedupe:l=!1}=r,u=KR(e);return xl(i,s,c=>{c.repeat&&Fo(l)||u(c)&&n(c)},a)}function Xx(){const t=o.ref(!1),e=o.getCurrentInstance();return e&&o.onMounted(()=>{t.value=!0},e),t}function XR(t){const e=Xx();return o.computed(()=>(e.value,!!t()))}function YR(t){return JSON.parse(JSON.stringify(t))}function Cl(t,e,n={}){const{window:r=Ef,...i}=n;let s;const a=XR(()=>r&&"ResizeObserver"in r),l=()=>{s&&(s.disconnect(),s=void 0)},u=o.computed(()=>Array.isArray(t)?t.map(p=>uo(p)):[uo(t)]),c=o.watch(u,p=>{if(l(),a.value&&r){s=new ResizeObserver(e);for(const m of p)m&&s.observe(m,i)}},{immediate:!0,flush:"post"}),f=()=>{l(),c()};return wl(f),{isSupported:a,stop:f}}function wr(t,e,n,r={}){var i,s,a;const{clone:l=!1,passive:u=!1,eventName:c,deep:f=!1,defaultValue:p,shouldEmit:m}=r,g=o.getCurrentInstance(),v=n||g?.emit||((i=g?.$emit)==null?void 0:i.bind(g))||((a=(s=g?.proxy)==null?void 0:s.$emit)==null?void 0:a.bind(g?.proxy));let b=c;e||(e="modelValue"),b=b||`update:${e.toString()}`;const w=E=>l?typeof l=="function"?l(E):YR(E):E,x=()=>VR(t[e])?w(t[e]):p,C=E=>{m?m(E)&&v(b,E):v(b,E)};if(u){const E=x(),k=o.ref(E);let T=!1;return o.watch(()=>t[e],_=>{T||(T=!0,k.value=w(_),o.nextTick(()=>T=!1))}),o.watch(k,_=>{!T&&(_!==t[e]||f)&&C(_)},{deep:f}),k}else return o.computed({get(){return x()},set(E){C(E)}})}function Sf(t){return t?t.flatMap(e=>e.type===o.Fragment?Sf(e.children):[e]):[]}function $n(){let t=document.activeElement;if(t==null)return null;for(;t!=null&&t.shadowRoot!=null&&t.shadowRoot.activeElement!=null;)t=t.shadowRoot.activeElement;return t}const JR=["INPUT","TEXTAREA"];function ZR(t,e,n,r={}){if(!e||r.enableIgnoredElement&&JR.includes(e.nodeName))return null;const{arrowKeyOptions:i="both",attributeName:s="[data-radix-vue-collection-item]",itemsArray:a=[],loop:l=!0,dir:u="ltr",preventScroll:c=!0,focus:f=!1}=r,[p,m,g,v,b,w]=[t.key==="ArrowRight",t.key==="ArrowLeft",t.key==="ArrowUp",t.key==="ArrowDown",t.key==="Home",t.key==="End"],x=g||v,C=p||m;if(!b&&!w&&(!x&&!C||i==="vertical"&&C||i==="horizontal"&&x))return null;const E=n?Array.from(n.querySelectorAll(s)):a;if(!E.length)return null;c&&t.preventDefault();let k=null;return C||x?k=Yx(E,e,{goForward:x?v:u==="ltr"?p:m,loop:l}):b?k=E.at(0)||null:w&&(k=E.at(-1)||null),f&&k?.focus(),k}function Yx(t,e,n,r=t.length){if(--r===0)return null;const i=t.indexOf(e),s=n.goForward?i+1:i-1;if(!n.loop&&(s<0||s>=t.length))return null;const a=(s+t.length)%t.length,l=t[a];return l?l.hasAttribute("disabled")&&l.getAttribute("disabled")!=="false"?Yx(t,l,n,r):l:null}function Fg(t){if(t===null||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null||Symbol.iterator in t?!1:Symbol.toStringTag in t?Object.prototype.toString.call(t)==="[object Module]":!0}function $g(t,e,n=".",r){if(!Fg(e))return $g(t,{},n);const i=Object.assign({},e);for(const s in t){if(s==="__proto__"||s==="constructor")continue;const a=t[s];a!=null&&(Array.isArray(a)&&Array.isArray(i[s])?i[s]=[...a,...i[s]]:Fg(a)&&Fg(i[s])?i[s]=$g(a,i[s],(n?`${n}.`:"")+s.toString()):i[s]=a)}return i}function QR(t){return(...e)=>e.reduce((n,r)=>$g(n,r,""),{})}const NR=QR(),[_f,Fce]=Ft("ConfigProvider");let eD="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",tD=(t=21)=>{let e="",n=t;for(;n--;)e+=eD[Math.random()*64|0];return e};const nD=Wx(()=>{const t=o.ref(new Map),e=o.ref(),n=o.computed(()=>{for(const a of t.value.values())if(a)return!0;return!1}),r=_f({scrollBody:o.ref(!0)});let i=null;const s=()=>{document.body.style.paddingRight="",document.body.style.marginRight="",document.body.style.pointerEvents="",document.body.style.removeProperty("--scrollbar-width"),document.body.style.overflow=e.value??"",jx&&i?.(),e.value=void 0};return o.watch(n,(a,l)=>{var u;if(!pi)return;if(!a){l&&s();return}e.value===void 0&&(e.value=document.body.style.overflow);const c=window.innerWidth-document.documentElement.clientWidth,f={padding:c,margin:0},p=(u=r.scrollBody)!=null&&u.value?typeof r.scrollBody.value=="object"?NR({padding:r.scrollBody.value.padding===!0?c:r.scrollBody.value.padding,margin:r.scrollBody.value.margin===!0?c:r.scrollBody.value.margin},f):f:{padding:0,margin:0};c>0&&(document.body.style.paddingRight=typeof p.padding=="number"?`${p.padding}px`:String(p.padding),document.body.style.marginRight=typeof p.margin=="number"?`${p.margin}px`:String(p.margin),document.body.style.setProperty("--scrollbar-width",`${c}px`),document.body.style.overflow="hidden"),jx&&(i=xl(document,"touchmove",m=>rD(m),{passive:!1})),o.nextTick(()=>{document.body.style.pointerEvents="none",document.body.style.overflow="hidden"})},{immediate:!0,flush:"sync"}),t});function Tf(t){const e=tD(6),n=nD();n.value.set(e,t??!1);const r=o.computed({get:()=>n.value.get(e)??!1,set:i=>n.value.set(e,i)});return jR(()=>{n.value.delete(e)}),r}function Jx(t){const e=window.getComputedStyle(t);if(e.overflowX==="scroll"||e.overflowY==="scroll"||e.overflowX==="auto"&&t.clientWidth<t.scrollWidth||e.overflowY==="auto"&&t.clientHeight<t.scrollHeight)return!0;{const n=t.parentNode;return!(n instanceof Element)||n.tagName==="BODY"?!1:Jx(n)}}function rD(t){const e=t||window.event,n=e.target;return n instanceof Element&&Jx(n)?!1:e.touches.length>1?!0:(e.preventDefault&&e.cancelable&&e.preventDefault(),!1)}const oD="data-radix-vue-collection-item";function ec(t,e=oD){const n=Symbol();return{createCollection:r=>{const i=o.ref([]);function s(){const a=uo(r);return a?i.value=Array.from(a.querySelectorAll(`[${e}]:not([data-disabled])`)):i.value=[]}return o.onBeforeUpdate(()=>{i.value=[]}),o.onMounted(s),o.onUpdated(s),o.watch(()=>r?.value,s,{immediate:!0}),o.provide(n,i),i},injectCollection:()=>o.inject(n,o.ref([]))}}function sa(t){const e=_f({dir:o.ref("ltr")});return o.computed(()=>{var n;return t?.value||((n=e.dir)==null?void 0:n.value)||"ltr"})}function aa(t){const e=o.getCurrentInstance(),n=e?.type.emits,r={};return n!=null&&n.length||console.warn(`No emitted event found. Please check component: ${e?.type.__name}`),n?.forEach(i=>{r[o.toHandlerKey(o.camelize(i))]=(...s)=>t(i,...s)}),r}let Hg=0;function zg(){o.watchEffect(t=>{if(!pi)return;const e=document.querySelectorAll("[data-radix-focus-guard]");document.body.insertAdjacentElement("afterbegin",e[0]??Zx()),document.body.insertAdjacentElement("beforeend",e[1]??Zx()),Hg++,t(()=>{Hg===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(n=>n.remove()),Hg--})})}function Zx(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}function Ug(t){return o.computed(()=>{var e;return Fo(t)?!!((e=uo(t))!=null&&e.closest("form")):!0})}function Jn(t){const e=o.getCurrentInstance(),n=Object.keys(e?.type.props??{}).reduce((i,s)=>{const a=(e?.type.props[s]).default;return a!==void 0&&(i[s]=a),i},{}),r=o.toRef(t);return o.computed(()=>{const i={},s=e?.vnode.props??{};return Object.keys(s).forEach(a=>{i[o.camelize(a)]=s[a]}),Object.keys({...n,...i}).reduce((a,l)=>(r.value[l]!==void 0&&(a[l]=r.value[l]),a),{})})}function Rt(t,e){const n=Jn(t),r=e?aa(e):{};return o.computed(()=>({...n.value,...r}))}function Le(){const t=o.getCurrentInstance(),e=o.ref(),n=o.computed(()=>{var a,l;return["#text","#comment"].includes((a=e.value)==null?void 0:a.$el.nodeName)?(l=e.value)==null?void 0:l.$el.nextElementSibling:uo(e)}),r=Object.assign({},t.exposed),i={};for(const a in t.props)Object.defineProperty(i,a,{enumerable:!0,configurable:!0,get:()=>t.props[a]});if(Object.keys(r).length>0)for(const a in r)Object.defineProperty(i,a,{enumerable:!0,configurable:!0,get:()=>r[a]});Object.defineProperty(i,"$el",{enumerable:!0,configurable:!0,get:()=>t.vnode.el}),t.exposed=i;function s(a){e.value=a,a&&(Object.defineProperty(i,"$el",{enumerable:!0,configurable:!0,get:()=>a instanceof Element?a:a.$el}),t.exposed=i)}return{forwardRef:s,currentRef:e,currentElement:n}}function iD(t,e){const n=qx(!1,300),r=o.ref(null),i=DR();function s(){r.value=null,n.value=!1}function a(l,u){const c=l.currentTarget,f={x:l.clientX,y:l.clientY},p=sD(f,c.getBoundingClientRect()),m=aD(f,p),g=lD(u.getBoundingClientRect()),v=cD([...m,...g]);r.value=v,n.value=!0}return o.watchEffect(l=>{if(t.value&&e.value){const u=f=>a(f,e.value),c=f=>a(f,t.value);t.value.addEventListener("pointerleave",u),e.value.addEventListener("pointerleave",c),l(()=>{var f,p;(f=t.value)==null||f.removeEventListener("pointerleave",u),(p=e.value)==null||p.removeEventListener("pointerleave",c)})}}),o.watchEffect(l=>{var u;if(r.value){const c=f=>{var p,m;if(!r.value)return;const g=f.target,v={x:f.clientX,y:f.clientY},b=((p=t.value)==null?void 0:p.contains(g))||((m=e.value)==null?void 0:m.contains(g)),w=!uD(v,r.value),x=!!g.closest("[data-grace-area-trigger]");b?s():(w||x)&&(s(),i.trigger())};(u=t.value)==null||u.ownerDocument.addEventListener("pointermove",c),l(()=>{var f;return(f=t.value)==null?void 0:f.ownerDocument.removeEventListener("pointermove",c)})}}),{isPointerInTransit:n,onPointerExit:i.on}}function sD(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),i=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(n,r,i,s)){case s:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function aD(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function lD(t){const{top:e,right:n,bottom:r,left:i}=t;return[{x:i,y:e},{x:n,y:e},{x:n,y:r},{x:i,y:r}]}function uD(t,e){const{x:n,y:r}=t;let i=!1;for(let s=0,a=e.length-1;s<e.length;a=s++){const l=e[s].x,u=e[s].y,c=e[a].x,f=e[a].y;u>r!=f>r&&n<(c-l)*(r-u)/(f-u)+l&&(i=!i)}return i}function cD(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),dD(e)}function dD(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const i=t[r];for(;e.length>=2;){const s=e[e.length-1],a=e[e.length-2];if((s.x-a.x)*(i.y-a.y)>=(s.y-a.y)*(i.x-a.x))e.pop();else break}e.push(i)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const i=t[r];for(;n.length>=2;){const s=n[n.length-1],a=n[n.length-2];if((s.x-a.x)*(i.y-a.y)>=(s.y-a.y)*(i.x-a.x))n.pop();else break}n.push(i)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var fD=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},kl=new WeakMap,Af=new WeakMap,Mf={},Wg=0,Qx=function(t){return t&&(t.host||Qx(t.parentNode))},pD=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=Qx(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},hD=function(t,e,n,r){var i=pD(e,Array.isArray(t)?t:[t]);Mf[n]||(Mf[n]=new WeakMap);var s=Mf[n],a=[],l=new Set,u=new Set(i),c=function(p){!p||l.has(p)||(l.add(p),c(p.parentNode))};i.forEach(c);var f=function(p){!p||u.has(p)||Array.prototype.forEach.call(p.children,function(m){if(l.has(m))f(m);else try{var g=m.getAttribute(r),v=g!==null&&g!=="false",b=(kl.get(m)||0)+1,w=(s.get(m)||0)+1;kl.set(m,b),s.set(m,w),a.push(m),b===1&&v&&Af.set(m,!0),w===1&&m.setAttribute(n,"true"),v||m.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",m,x)}})};return f(e),l.clear(),Wg++,function(){a.forEach(function(p){var m=kl.get(p)-1,g=s.get(p)-1;kl.set(p,m),s.set(p,g),m||(Af.has(p)||p.removeAttribute(r),Af.delete(p)),g||p.removeAttribute(n)}),Wg--,Wg||(kl=new WeakMap,kl=new WeakMap,Af=new WeakMap,Mf={})}},mD=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),i=fD(t);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),hD(r,i,n,"aria-hidden")):function(){return null}};function Of(t){let e;o.watch(()=>uo(t),n=>{n?e=mD(n):e&&e()}),o.onUnmounted(()=>{e&&e()})}let gD=0;function Hr(t,e="radix"){const n=_f({useId:void 0});return ly.useId?`${e}-${ly.useId()}`:n.useId?`${e}-${n.useId()}`:`${e}-${++gD}`}function vD(t){const e=o.ref(),n=o.computed(()=>{var i;return((i=e.value)==null?void 0:i.width)??0}),r=o.computed(()=>{var i;return((i=e.value)==null?void 0:i.height)??0});return o.onMounted(()=>{const i=uo(t);if(i){e.value={width:i.offsetWidth,height:i.offsetHeight};const s=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const l=a[0];let u,c;if("borderBoxSize"in l){const f=l.borderBoxSize,p=Array.isArray(f)?f[0]:f;u=p.inlineSize,c=p.blockSize}else u=i.offsetWidth,c=i.offsetHeight;e.value={width:u,height:c}});return s.observe(i,{box:"border-box"}),()=>s.unobserve(i)}else e.value=void 0}),{width:n,height:r}}function Nx(t,e){const n=o.ref(t);function r(i){return e[n.value][i]??n.value}return{state:n,dispatch:i=>{n.value=r(i)}}}const bD="data-item-text";function jg(t){const e=qx("",1e3);return{search:e,handleTypeaheadSearch:(n,r)=>{if(!(t!=null&&t.value)&&!r)return;e.value=e.value+n;const i=t?.value??r,s=$n(),a=i.map(p=>{var m;return{ref:p,textValue:((m=(p.querySelector(`[${bD}]`)??p).textContent)==null?void 0:m.trim())??""}}),l=a.find(p=>p.ref===s),u=a.map(p=>p.textValue),c=wD(u,e.value,l?.textValue),f=a.find(p=>p.textValue===c);return f&&f.ref.focus(),f?.ref},resetTypeahead:()=>{e.value=""}}}function yD(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function wD(t,e,n){const r=e.length>1&&Array.from(e).every(l=>l===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let s=yD(t,Math.max(i,0));r.length===1&&(s=s.filter(l=>l!==n));const a=s.find(l=>l.toLowerCase().startsWith(r.toLowerCase()));return a!==n?a:void 0}const qg=o.defineComponent({name:"PrimitiveSlot",inheritAttrs:!1,setup(t,{attrs:e,slots:n}){return()=>{var r,i;if(!n.default)return null;const s=Sf(n.default()),a=s.findIndex(f=>f.type!==o.Comment);if(a===-1)return s;const l=s[a];(r=l.props)==null||delete r.ref;const u=l.props?o.mergeProps(e,l.props):e;e.class&&(i=l.props)!=null&&i.class&&delete l.props.class;const c=o.cloneVNode(l,u);for(const f in u)f.startsWith("on")&&(c.props||(c.props={}),c.props[f]=u[f]);return s.length===1?c:(s[a]=c,s)}}}),Ye=o.defineComponent({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(t,{attrs:e,slots:n}){const r=t.asChild?"template":t.as;return typeof r=="string"&&["area","img","input"].includes(r)?()=>o.h(r,e):r!=="template"?()=>o.h(t.as,e,{default:n.default}):()=>o.h(qg,e,{default:n.default})}});function eC(){const t=o.ref(),e=o.computed(()=>{var n,r;return["#text","#comment"].includes((n=t.value)==null?void 0:n.$el.nodeName)?(r=t.value)==null?void 0:r.$el.nextElementSibling:uo(t)});return{primitiveElement:t,currentElement:e}}function xD(t,e){var n;const r=o.ref({}),i=o.ref("none"),s=o.ref(t),a=t.value?"mounted":"unmounted";let l;const u=((n=e.value)==null?void 0:n.ownerDocument.defaultView)??Ef,{state:c,dispatch:f}=Nx(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}}),p=w=>{var x;if(pi){const C=new CustomEvent(w,{bubbles:!1,cancelable:!1});(x=e.value)==null||x.dispatchEvent(C)}};o.watch(t,async(w,x)=>{var C;const E=x!==w;if(await o.nextTick(),E){const k=i.value,T=Bf(e.value);w?(f("MOUNT"),p("enter"),T==="none"&&p("after-enter")):T==="none"||((C=r.value)==null?void 0:C.display)==="none"?(f("UNMOUNT"),p("leave"),p("after-leave")):x&&k!==T?(f("ANIMATION_OUT"),p("leave")):(f("UNMOUNT"),p("after-leave"))}},{immediate:!0});const m=w=>{const x=Bf(e.value),C=x.includes(w.animationName),E=c.value==="mounted"?"enter":"leave";if(w.target===e.value&&C&&(p(`after-${E}`),f("ANIMATION_END"),!s.value)){const k=e.value.style.animationFillMode;e.value.style.animationFillMode="forwards",l=u?.setTimeout(()=>{var T;((T=e.value)==null?void 0:T.style.animationFillMode)==="forwards"&&(e.value.style.animationFillMode=k)})}w.target===e.value&&x==="none"&&f("ANIMATION_END")},g=w=>{w.target===e.value&&(i.value=Bf(e.value))},v=o.watch(e,(w,x)=>{w?(r.value=getComputedStyle(w),w.addEventListener("animationstart",g),w.addEventListener("animationcancel",m),w.addEventListener("animationend",m)):(f("ANIMATION_END"),l!==void 0&&u?.clearTimeout(l),x?.removeEventListener("animationstart",g),x?.removeEventListener("animationcancel",m),x?.removeEventListener("animationend",m))},{immediate:!0}),b=o.watch(c,()=>{const w=Bf(e.value);i.value=c.value==="mounted"?w:"none"});return o.onUnmounted(()=>{v(),b()}),{isPresent:o.computed(()=>["mounted","unmountSuspended"].includes(c.value))}}function Bf(t){return t&&getComputedStyle(t).animationName||"none"}const zr=o.defineComponent({name:"Presence",props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(t,{slots:e,expose:n}){var r;const{present:i,forceMount:s}=o.toRefs(t),a=o.ref(),{isPresent:l}=xD(i,a);n({present:l});let u=e.default({present:l});u=Sf(u||[]);const c=o.getCurrentInstance();if(u&&u?.length>1){const f=(r=c?.parent)!=null&&r.type.name?`<${c.parent.type.name} />`:"component";throw new Error([`Detected an invalid children for \`${f}\` for \`Presence\` component.`,"","Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.","You can apply a few solutions:",["Provide a single child element so that `presence` directive attach correctly.","Ensure the first child is an actual element instead of a raw text node or comment node."].map(p=>` - ${p}`).join(`
|
|
136
136
|
`)].join(`
|
|
137
137
|
`))}return()=>s.value||i.value||l.value?o.h(e.default({present:l})[0],{ref:f=>{const p=uo(f);return typeof p?.hasAttribute>"u"||(p!=null&&p.hasAttribute("data-radix-popper-content-wrapper")?a.value=p.firstElementChild:a.value=p),p}}):null}}),[$o,CD]=Ft("DialogRoot"),kD=o.defineComponent({inheritAttrs:!1,__name:"DialogRoot",props:{open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean,default:!1},modal:{type:Boolean,default:!0}},emits:["update:open"],setup(t,{emit:e}){const n=t,r=wr(n,"open",e,{defaultValue:n.defaultOpen,passive:n.open===void 0}),i=o.ref(),s=o.ref(),{modal:a}=o.toRefs(n);return CD({open:r,modal:a,openModal:()=>{r.value=!0},onOpenChange:l=>{r.value=l},onOpenToggle:()=>{r.value=!r.value},contentId:"",titleId:"",descriptionId:"",triggerElement:i,contentElement:s}),(l,u)=>o.renderSlot(l.$slots,"default",{open:o.unref(r)})}}),ED=o.defineComponent({__name:"DialogTrigger",props:{asChild:{type:Boolean},as:{default:"button"}},setup(t){const e=t,n=$o(),{forwardRef:r,currentElement:i}=Le();return n.contentId||(n.contentId=Hr(void 0,"radix-vue-dialog-content")),o.onMounted(()=>{n.triggerElement.value=i.value}),(s,a)=>(o.openBlock(),o.createBlock(o.unref(Ye),o.mergeProps(e,{ref:o.unref(r),type:s.as==="button"?"button":void 0,"aria-haspopup":"dialog","aria-expanded":o.unref(n).open.value||!1,"aria-controls":o.unref(n).open.value?o.unref(n).contentId:void 0,"data-state":o.unref(n).open.value?"open":"closed",onClick:o.unref(n).onOpenToggle}),{default:o.withCtx(()=>[o.renderSlot(s.$slots,"default")]),_:3},16,["type","aria-expanded","aria-controls","data-state","onClick"]))}}),tc=o.defineComponent({__name:"Teleport",props:{to:{default:"body"},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(t){const e=Xx();return(n,r)=>o.unref(e)||n.forceMount?(o.openBlock(),o.createBlock(o.Teleport,{key:0,to:n.to,disabled:n.disabled},[o.renderSlot(n.$slots,"default")],8,["to","disabled"])):o.createCommentVNode("",!0)}}),Kg=o.defineComponent({__name:"DialogPortal",props:{to:{},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(t){const e=t;return(n,r)=>(o.openBlock(),o.createBlock(o.unref(tc),o.normalizeProps(o.guardReactiveProps(e)),{default:o.withCtx(()=>[o.renderSlot(n.$slots,"default")]),_:3},16))}}),SD="dismissableLayer.pointerDownOutside",_D="dismissableLayer.focusOutside";function tC(t,e){const n=e.closest("[data-dismissable-layer]"),r=t.dataset.dismissableLayer===""?t:t.querySelector("[data-dismissable-layer]"),i=Array.from(t.ownerDocument.querySelectorAll("[data-dismissable-layer]"));return!!(n&&r===n||i.indexOf(r)<i.indexOf(n))}function TD(t,e){var n;const r=((n=e?.value)==null?void 0:n.ownerDocument)??globalThis?.document,i=o.ref(!1),s=o.ref(()=>{});return o.watchEffect(a=>{if(!pi)return;const l=async c=>{const f=c.target;if(e!=null&&e.value){if(tC(e.value,f)){i.value=!1;return}if(c.target&&!i.value){let p=function(){Ux(SD,t,m)};const m={originalEvent:c};c.pointerType==="touch"?(r.removeEventListener("click",s.value),s.value=p,r.addEventListener("click",s.value,{once:!0})):p()}else r.removeEventListener("click",s.value);i.value=!1}},u=window.setTimeout(()=>{r.addEventListener("pointerdown",l)},0);a(()=>{window.clearTimeout(u),r.removeEventListener("pointerdown",l),r.removeEventListener("click",s.value)})}),{onPointerDownCapture:()=>i.value=!0}}function AD(t,e){var n;const r=((n=e?.value)==null?void 0:n.ownerDocument)??globalThis?.document,i=o.ref(!1);return o.watchEffect(s=>{if(!pi)return;const a=async l=>{e!=null&&e.value&&(await o.nextTick(),!(!e.value||tC(e.value,l.target))&&l.target&&!i.value&&Ux(_D,t,{originalEvent:l}))};r.addEventListener("focusin",a),s(()=>r.removeEventListener("focusin",a))}),{onFocusCapture:()=>i.value=!0,onBlurCapture:()=>i.value=!1}}const hi=o.reactive({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),nc=o.defineComponent({__name:"DismissableLayer",props:{disableOutsidePointerEvents:{type:Boolean,default:!1},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","dismiss"],setup(t,{emit:e}){const n=t,r=e,{forwardRef:i,currentElement:s}=Le(),a=o.computed(()=>{var v;return((v=s.value)==null?void 0:v.ownerDocument)??globalThis.document}),l=o.computed(()=>hi.layersRoot),u=o.computed(()=>s.value?Array.from(l.value).indexOf(s.value):-1),c=o.computed(()=>hi.layersWithOutsidePointerEventsDisabled.size>0),f=o.computed(()=>{const v=Array.from(l.value),[b]=[...hi.layersWithOutsidePointerEventsDisabled].slice(-1),w=v.indexOf(b);return u.value>=w}),p=TD(async v=>{const b=[...hi.branches].some(w=>w?.contains(v.target));!f.value||b||(r("pointerDownOutside",v),r("interactOutside",v),await o.nextTick(),v.defaultPrevented||r("dismiss"))},s),m=AD(v=>{[...hi.branches].some(b=>b?.contains(v.target))||(r("focusOutside",v),r("interactOutside",v),v.defaultPrevented||r("dismiss"))},s);GR("Escape",v=>{u.value===l.value.size-1&&(r("escapeKeyDown",v),v.defaultPrevented||r("dismiss"))});let g;return o.watchEffect(v=>{s.value&&(n.disableOutsidePointerEvents&&(hi.layersWithOutsidePointerEventsDisabled.size===0&&(g=a.value.body.style.pointerEvents,a.value.body.style.pointerEvents="none"),hi.layersWithOutsidePointerEventsDisabled.add(s.value)),l.value.add(s.value),v(()=>{n.disableOutsidePointerEvents&&hi.layersWithOutsidePointerEventsDisabled.size===1&&(a.value.body.style.pointerEvents=g)}))}),o.watchEffect(v=>{v(()=>{s.value&&(l.value.delete(s.value),hi.layersWithOutsidePointerEventsDisabled.delete(s.value))})}),(v,b)=>(o.openBlock(),o.createBlock(o.unref(Ye),{ref:o.unref(i),"as-child":v.asChild,as:v.as,"data-dismissable-layer":"",style:o.normalizeStyle({pointerEvents:c.value?f.value?"auto":"none":void 0}),onFocusCapture:o.unref(m).onFocusCapture,onBlurCapture:o.unref(m).onBlurCapture,onPointerdownCapture:o.unref(p).onPointerDownCapture},{default:o.withCtx(()=>[o.renderSlot(v.$slots,"default")]),_:3},8,["as-child","as","style","onFocusCapture","onBlurCapture","onPointerdownCapture"]))}}),Gg="focusScope.autoFocusOnMount",Xg="focusScope.autoFocusOnUnmount",nC={bubbles:!1,cancelable:!0};function MD(t,{select:e=!1}={}){const n=$n();for(const r of t)if(rs(r,{select:e}),$n()!==n)return!0}function OD(t){const e=rC(t),n=oC(e,t),r=oC(e.reverse(),t);return[n,r]}function rC(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function oC(t,e){for(const n of t)if(!BD(n,{upTo:e}))return n}function BD(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function ID(t){return t instanceof HTMLInputElement&&"select"in t}function rs(t,{select:e=!1}={}){if(t&&t.focus){const n=$n();t.focus({preventScroll:!0}),t!==n&&ID(t)&&e&&t.select()}}const LD=PR(()=>o.ref([]));function RD(){const t=LD();return{add(e){const n=t.value[0];e!==n&&n?.pause(),t.value=iC(t.value,e),t.value.unshift(e)},remove(e){var n;t.value=iC(t.value,e),(n=t.value[0])==null||n.resume()}}}function iC(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function DD(t){return t.filter(e=>e.tagName!=="A")}const If=o.defineComponent({__name:"FocusScope",props:{loop:{type:Boolean,default:!1},trapped:{type:Boolean,default:!1},asChild:{type:Boolean},as:{}},emits:["mountAutoFocus","unmountAutoFocus"],setup(t,{emit:e}){const n=t,r=e,{currentRef:i,currentElement:s}=Le(),a=o.ref(null),l=RD(),u=o.reactive({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}});o.watchEffect(f=>{if(!pi)return;const p=s.value;if(!n.trapped)return;function m(w){if(u.paused||!p)return;const x=w.target;p.contains(x)?a.value=x:rs(a.value,{select:!0})}function g(w){if(u.paused||!p)return;const x=w.relatedTarget;x!==null&&(p.contains(x)||rs(a.value,{select:!0}))}function v(w){p.contains(a.value)||rs(p)}document.addEventListener("focusin",m),document.addEventListener("focusout",g);const b=new MutationObserver(v);p&&b.observe(p,{childList:!0,subtree:!0}),f(()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",g),b.disconnect()})}),o.watchEffect(async f=>{const p=s.value;if(await o.nextTick(),!p)return;l.add(u);const m=$n();if(!p.contains(m)){const g=new CustomEvent(Gg,nC);p.addEventListener(Gg,v=>r("mountAutoFocus",v)),p.dispatchEvent(g),g.defaultPrevented||(MD(DD(rC(p)),{select:!0}),$n()===m&&rs(p))}f(()=>{p.removeEventListener(Gg,b=>r("mountAutoFocus",b));const g=new CustomEvent(Xg,nC),v=b=>{r("unmountAutoFocus",b)};p.addEventListener(Xg,v),p.dispatchEvent(g),setTimeout(()=>{g.defaultPrevented||rs(m??document.body,{select:!0}),p.removeEventListener(Xg,v),l.remove(u)},0)})});function c(f){if(!n.loop&&!n.trapped||u.paused)return;const p=f.key==="Tab"&&!f.altKey&&!f.ctrlKey&&!f.metaKey,m=$n();if(p&&m){const g=f.currentTarget,[v,b]=OD(g);v&&b?!f.shiftKey&&m===b?(f.preventDefault(),n.loop&&rs(v,{select:!0})):f.shiftKey&&m===v&&(f.preventDefault(),n.loop&&rs(b,{select:!0})):m===g&&f.preventDefault()}}return(f,p)=>(o.openBlock(),o.createBlock(o.unref(Ye),{ref_key:"currentRef",ref:i,tabindex:"-1","as-child":f.asChild,as:f.as,onKeydown:c},{default:o.withCtx(()=>[o.renderSlot(f.$slots,"default")]),_:3},8,["as-child","as"]))}}),PD="menu.itemSelect",Yg=["Enter"," "],VD=["ArrowDown","PageUp","Home"],sC=["ArrowUp","PageDown","End"],FD=[...VD,...sC];[...Yg],[...Yg];function aC(t){return t?"open":"closed"}function Lf(t){return t==="indeterminate"}function lC(t){return Lf(t)?"indeterminate":t?"checked":"unchecked"}function Jg(t){const e=$n();for(const n of t)if(n===e||(n.focus(),$n()!==e))return}function $D(t,e){const{x:n,y:r}=t;let i=!1;for(let s=0,a=e.length-1;s<e.length;a=s++){const l=e[s].x,u=e[s].y,c=e[a].x,f=e[a].y;u>r!=f>r&&n<(c-l)*(r-u)/(f-u)+l&&(i=!i)}return i}function HD(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return $D(n,e)}function Zg(t){return t.pointerType==="mouse"}const zD="DialogTitle",UD="DialogContent";function WD({titleName:t=zD,contentName:e=UD,componentLink:n="dialog.html#title",titleId:r,descriptionId:i,contentElement:s}){const a=`Warning: \`${e}\` requires a \`${t}\` for the component to be accessible for screen reader users.
|
|
138
138
|
|
|
@@ -245,7 +245,7 @@ For more information, see https://www.radix-vue.com/components/${n}`,l=`Warning:
|
|
|
245
245
|
|
|
246
246
|
`);return!s||!a?!1:t.chain().command(({tr:l})=>(l.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:i,empty:s}=n;if(!s||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const l=i.after();return l===void 0?!1:r.nodeAt(l)?t.commands.command(({tr:c})=>(c.setSelection(ze.near(r.resolve(l))),!0)):t.commands.exitCode()}}},addInputRules(){return[W0({find:T$,type:this.type,getAttributes:t=>({language:t[1]})}),W0({find:A$,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new ot({key:new Et("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,s=i?.mode;if(!n||!s)return!1;const{tr:a,schema:l}=t.state,u=l.text(n.replace(/\r\n?/g,`
|
|
247
247
|
`));return a.replaceSelectionWith(this.type.create({language:s},u)),a.selection.$from.parent.type!==this.type&&a.setSelection(Ie.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta("paste",!0),t.dispatch(a),!0}}})]}});function O$(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function y6(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(e=>{const n=t[e],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&y6(n)}),t}let w6=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function x6(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function ss(t,...e){const n=Object.create(null);for(const r in t)n[r]=t[r];return e.forEach(function(r){for(const i in r)n[i]=r[i]}),n}const B$="</span>",C6=t=>!!t.scope,I$=(t,{prefix:e})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){const n=t.split(".");return[`${e}${n.shift()}`,...n.map((r,i)=>`${r}${"_".repeat(i+1)}`)].join(" ")}return`${e}${t}`};class L${constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=x6(e)}openNode(e){if(!C6(e))return;const n=I$(e.scope,{prefix:this.classPrefix});this.span(n)}closeNode(e){C6(e)&&(this.buffer+=B$)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}const k6=(t={})=>{const e={children:[]};return Object.assign(e,t),e};class v1{constructor(){this.rootNode=k6(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const n=k6({scope:e});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return typeof n=="string"?e.addText(n):n.children&&(e.openNode(n),n.children.forEach(r=>this._walk(e,r)),e.closeNode(n)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every(n=>typeof n=="string")?e.children=[e.children.join("")]:e.children.forEach(n=>{v1._collapse(n)}))}}class R$ extends v1{constructor(e){super(),this.options=e}addText(e){e!==""&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,n){const r=e.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new L$(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function ac(t){return t?typeof t=="string"?t:t.source:null}function E6(t){return pa("(?=",t,")")}function D$(t){return pa("(?:",t,")*")}function P$(t){return pa("(?:",t,")?")}function pa(...t){return t.map(n=>ac(n)).join("")}function V$(t){const e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function b1(...t){return"("+(V$(t).capture?"":"?:")+t.map(r=>ac(r)).join("|")+")"}function S6(t){return new RegExp(t.toString()+"|").exec("").length-1}function F$(t,e){const n=t&&t.exec(e);return n&&n.index===0}const $$=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function y1(t,{joinWith:e}){let n=0;return t.map(r=>{n+=1;const i=n;let s=ac(r),a="";for(;s.length>0;){const l=$$.exec(s);if(!l){a+=s;break}a+=s.substring(0,l.index),s=s.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?a+="\\"+String(Number(l[1])+i):(a+=l[0],l[0]==="("&&n++)}return a}).map(r=>`(${r})`).join(e)}const H$=/\b\B/,_6="[a-zA-Z]\\w*",w1="[a-zA-Z_]\\w*",T6="\\b\\d+(\\.\\d+)?",A6="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",M6="\\b(0b[01]+)",z$="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",U$=(t={})=>{const e=/^#![ ]*\//;return t.binary&&(t.begin=pa(e,/.*\b/,t.binary,/\b.*/)),ss({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},t)},lc={begin:"\\\\[\\s\\S]",relevance:0},W$={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[lc]},j$={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[lc]},q$={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Yf=function(t,e,n={}){const r=ss({scope:"comment",begin:t,end:e,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const i=b1("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:pa(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},K$=Yf("//","$"),G$=Yf("/\\*","\\*/"),X$=Yf("#","$"),Y$={scope:"number",begin:T6,relevance:0},J$={scope:"number",begin:A6,relevance:0},Z$={scope:"number",begin:M6,relevance:0},Q$={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[lc,{begin:/\[/,end:/\]/,relevance:0,contains:[lc]}]},N$={scope:"title",begin:_6,relevance:0},eH={scope:"title",begin:w1,relevance:0},tH={begin:"\\.\\s*"+w1,relevance:0};var Jf=Object.freeze({__proto__:null,APOS_STRING_MODE:W$,BACKSLASH_ESCAPE:lc,BINARY_NUMBER_MODE:Z$,BINARY_NUMBER_RE:M6,COMMENT:Yf,C_BLOCK_COMMENT_MODE:G$,C_LINE_COMMENT_MODE:K$,C_NUMBER_MODE:J$,C_NUMBER_RE:A6,END_SAME_AS_BEGIN:function(t){return Object.assign(t,{"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{n.data._beginMatch!==e[1]&&n.ignoreMatch()}})},HASH_COMMENT_MODE:X$,IDENT_RE:_6,MATCH_NOTHING_RE:H$,METHOD_GUARD:tH,NUMBER_MODE:Y$,NUMBER_RE:T6,PHRASAL_WORDS_MODE:q$,QUOTE_STRING_MODE:j$,REGEXP_MODE:Q$,RE_STARTERS_RE:z$,SHEBANG:U$,TITLE_MODE:N$,UNDERSCORE_IDENT_RE:w1,UNDERSCORE_TITLE_MODE:eH});function nH(t,e){t.input[t.index-1]==="."&&e.ignoreMatch()}function rH(t,e){t.className!==void 0&&(t.scope=t.className,delete t.className)}function oH(t,e){e&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=nH,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function iH(t,e){Array.isArray(t.illegal)&&(t.illegal=b1(...t.illegal))}function sH(t,e){if(t.match){if(t.begin||t.end)throw new Error("begin & end are not supported with match");t.begin=t.match,delete t.match}}function aH(t,e){t.relevance===void 0&&(t.relevance=1)}const lH=(t,e)=>{if(!t.beforeMatch)return;if(t.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},t);Object.keys(t).forEach(r=>{delete t[r]}),t.keywords=n.keywords,t.begin=pa(n.beforeMatch,E6(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},uH=["of","and","for","in","not","or","if","then","parent","list","value"],cH="keyword";function O6(t,e,n=cH){const r=Object.create(null);return typeof t=="string"?i(n,t.split(" ")):Array.isArray(t)?i(n,t):Object.keys(t).forEach(function(s){Object.assign(r,O6(t[s],e,s))}),r;function i(s,a){e&&(a=a.map(l=>l.toLowerCase())),a.forEach(function(l){const u=l.split("|");r[u[0]]=[s,dH(u[0],u[1])]})}}function dH(t,e){return e?Number(e):fH(t)?0:1}function fH(t){return uH.includes(t.toLowerCase())}const B6={},ha=t=>{console.error(t)},I6=(t,...e)=>{console.log(`WARN: ${t}`,...e)},Tl=(t,e)=>{B6[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),B6[`${t}/${e}`]=!0)},Zf=new Error;function L6(t,e,{key:n}){let r=0;const i=t[n],s={},a={};for(let l=1;l<=e.length;l++)a[l+r]=i[l],s[l+r]=!0,r+=S6(e[l-1]);t[n]=a,t[n]._emit=s,t[n]._multi=!0}function pH(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw ha("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Zf;if(typeof t.beginScope!="object"||t.beginScope===null)throw ha("beginScope must be object"),Zf;L6(t,t.begin,{key:"beginScope"}),t.begin=y1(t.begin,{joinWith:""})}}function hH(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw ha("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Zf;if(typeof t.endScope!="object"||t.endScope===null)throw ha("endScope must be object"),Zf;L6(t,t.end,{key:"endScope"}),t.end=y1(t.end,{joinWith:""})}}function mH(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function gH(t){mH(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),pH(t),hH(t)}function vH(t){function e(a,l){return new RegExp(ac(a),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(l?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,u){u.position=this.position++,this.matchIndexes[this.matchAt]=u,this.regexes.push([u,l]),this.matchAt+=S6(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(u=>u[1]);this.matcherRe=e(y1(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;const u=this.matcherRe.exec(l);if(!u)return null;const c=u.findIndex((p,m)=>m>0&&p!==void 0),f=this.matchIndexes[c];return u.splice(0,c),Object.assign(u,f)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(l){if(this.multiRegexes[l])return this.multiRegexes[l];const u=new n;return this.rules.slice(l).forEach(([c,f])=>u.addRule(c,f)),u.compile(),this.multiRegexes[l]=u,u}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,u){this.rules.push([l,u]),u.type==="begin"&&this.count++}exec(l){const u=this.getMatcher(this.regexIndex);u.lastIndex=this.lastIndex;let c=u.exec(l);if(this.resumingScanAtSamePosition()&&!(c&&c.index===this.lastIndex)){const f=this.getMatcher(0);f.lastIndex=this.lastIndex+1,c=f.exec(l)}return c&&(this.regexIndex+=c.position+1,this.regexIndex===this.count&&this.considerAll()),c}}function i(a){const l=new r;return a.contains.forEach(u=>l.addRule(u.begin,{rule:u,type:"begin"})),a.terminatorEnd&&l.addRule(a.terminatorEnd,{type:"end"}),a.illegal&&l.addRule(a.illegal,{type:"illegal"}),l}function s(a,l){const u=a;if(a.isCompiled)return u;[rH,sH,gH,lH].forEach(f=>f(a,l)),t.compilerExtensions.forEach(f=>f(a,l)),a.__beforeBegin=null,[oH,iH,aH].forEach(f=>f(a,l)),a.isCompiled=!0;let c=null;return typeof a.keywords=="object"&&a.keywords.$pattern&&(a.keywords=Object.assign({},a.keywords),c=a.keywords.$pattern,delete a.keywords.$pattern),c=c||/\w+/,a.keywords&&(a.keywords=O6(a.keywords,t.case_insensitive)),u.keywordPatternRe=e(c,!0),l&&(a.begin||(a.begin=/\B|\b/),u.beginRe=e(u.begin),!a.end&&!a.endsWithParent&&(a.end=/\B|\b/),a.end&&(u.endRe=e(u.end)),u.terminatorEnd=ac(u.end)||"",a.endsWithParent&&l.terminatorEnd&&(u.terminatorEnd+=(a.end?"|":"")+l.terminatorEnd)),a.illegal&&(u.illegalRe=e(a.illegal)),a.contains||(a.contains=[]),a.contains=[].concat(...a.contains.map(function(f){return bH(f==="self"?a:f)})),a.contains.forEach(function(f){s(f,u)}),a.starts&&s(a.starts,l),u.matcher=i(u),u}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=ss(t.classNameAliases||{}),s(t)}function R6(t){return t?t.endsWithParent||R6(t.starts):!1}function bH(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return ss(t,{variants:null},e)})),t.cachedVariants?t.cachedVariants:R6(t)?ss(t,{starts:t.starts?ss(t.starts):null}):Object.isFrozen(t)?ss(t):t}var yH="11.10.0";class wH extends Error{constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}}const x1=x6,D6=ss,P6=Symbol("nomatch"),xH=7,V6=function(t){const e=Object.create(null),n=Object.create(null),r=[];let i=!0;const s="Could not find the language '{}', did you forget to load/include a language module?",a={disableAutodetect:!0,name:"Plain text",contains:[]};let l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:R$};function u(L){return l.noHighlightRe.test(L)}function c(L){let F=L.className+" ";F+=L.parentNode?L.parentNode.className:"";const R=l.languageDetectRe.exec(F);if(R){const K=O(R[1]);return K||(I6(s.replace("{}",R[1])),I6("Falling back to no-highlight mode for this block.",L)),K?R[1]:"no-highlight"}return F.split(/\s+/).find(K=>u(K)||O(K))}function f(L,F,R){let K="",X="";typeof F=="object"?(K=L,R=F.ignoreIllegals,X=F.language):(Tl("10.7.0","highlight(lang, code, ...args) has been deprecated."),Tl("10.7.0",`Please use highlight(code, options) instead.
|
|
248
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),X=L,K=F),R===void 0&&(R=!0);const ae={code:K,language:X};U("before:highlight",ae);const de=ae.result?ae.result:p(ae.language,ae.code,R);return de.code=ae.code,U("after:highlight",de),de}function p(L,F,R,K){const X=Object.create(null);function ae(oe,we){return oe.keywords[we]}function de(){if(!z.keywords){xe.addText(Pe);return}let oe=0;z.keywordPatternRe.lastIndex=0;let we=z.keywordPatternRe.exec(Pe),$e="";for(;we;){$e+=Pe.substring(oe,we.index);const et=qe.case_insensitive?we[0].toLowerCase():we[0],Tt=ae(z,et);if(Tt){const[ue,je]=Tt;if(xe.addText($e),$e="",X[et]=(X[et]||0)+1,X[et]<=xH&&(nt+=je),ue.startsWith("_"))$e+=we[0];else{const re=qe.classNameAliases[ue]||ue;me(we[0],re)}}else $e+=we[0];oe=z.keywordPatternRe.lastIndex,we=z.keywordPatternRe.exec(Pe)}$e+=Pe.substring(oe),xe.addText($e)}function Ee(){if(Pe==="")return;let oe=null;if(typeof z.subLanguage=="string"){if(!e[z.subLanguage]){xe.addText(Pe);return}oe=p(z.subLanguage,Pe,!0,he[z.subLanguage]),he[z.subLanguage]=oe._top}else oe=g(Pe,z.subLanguage.length?z.subLanguage:null);z.relevance>0&&(nt+=oe.relevance),xe.__addSublanguage(oe._emitter,oe.language)}function ie(){z.subLanguage!=null?Ee():de(),Pe=""}function me(oe,we){oe!==""&&(xe.startScope(we),xe.addText(oe),xe.endScope())}function J(oe,we){let $e=1;const et=we.length-1;for(;$e<=et;){if(!oe._emit[$e]){$e++;continue}const Tt=qe.classNameAliases[oe[$e]]||oe[$e],ue=we[$e];Tt?me(ue,Tt):(Pe=ue,de(),Pe=""),$e++}}function ee(oe,we){return oe.scope&&typeof oe.scope=="string"&&xe.openNode(qe.classNameAliases[oe.scope]||oe.scope),oe.beginScope&&(oe.beginScope._wrap?(me(Pe,qe.classNameAliases[oe.beginScope._wrap]||oe.beginScope._wrap),Pe=""):oe.beginScope._multi&&(J(oe.beginScope,we),Pe="")),z=Object.create(oe,{parent:{value:z}}),z}function te(oe,we,$e){let et=F$(oe.endRe,$e);if(et){if(oe["on:end"]){const Tt=new w6(oe);oe["on:end"](we,Tt),Tt.isMatchIgnored&&(et=!1)}if(et){for(;oe.endsParent&&oe.parent;)oe=oe.parent;return oe}}if(oe.endsWithParent)return te(oe.parent,we,$e)}function se(oe){return z.matcher.regexIndex===0?(Pe+=oe[0],1):(ne=!0,0)}function pe(oe){const we=oe[0],$e=oe.rule,et=new w6($e),Tt=[$e.__beforeBegin,$e["on:begin"]];for(const ue of Tt)if(ue&&(ue(oe,et),et.isMatchIgnored))return se(we);return $e.skip?Pe+=we:($e.excludeBegin&&(Pe+=we),ie(),!$e.returnBegin&&!$e.excludeBegin&&(Pe=we)),ee($e,oe),$e.returnBegin?0:we.length}function _e(oe){const we=oe[0],$e=F.substring(oe.index),et=te(z,oe,$e);if(!et)return P6;const Tt=z;z.endScope&&z.endScope._wrap?(ie(),me(we,z.endScope._wrap)):z.endScope&&z.endScope._multi?(ie(),J(z.endScope,oe)):Tt.skip?Pe+=we:(Tt.returnEnd||Tt.excludeEnd||(Pe+=we),ie(),Tt.excludeEnd&&(Pe=we));do z.scope&&xe.closeNode(),!z.skip&&!z.subLanguage&&(nt+=z.relevance),z=z.parent;while(z!==et.parent);return et.starts&&ee(et.starts,oe),Tt.returnEnd?0:we.length}function Ae(){const oe=[];for(let we=z;we!==qe;we=we.parent)we.scope&&oe.unshift(we.scope);oe.forEach(we=>xe.openNode(we))}let Ue={};function We(oe,we){const $e=we&&we[0];if(Pe+=oe,$e==null)return ie(),0;if(Ue.type==="begin"&&we.type==="end"&&Ue.index===we.index&&$e===""){if(Pe+=F.slice(we.index,we.index+1),!i){const et=new Error(`0 width match regex (${L})`);throw et.languageName=L,et.badRule=Ue.rule,et}return 1}if(Ue=we,we.type==="begin")return pe(we);if(we.type==="illegal"&&!R){const et=new Error('Illegal lexeme "'+$e+'" for mode "'+(z.scope||"<unnamed>")+'"');throw et.mode=z,et}else if(we.type==="end"){const et=_e(we);if(et!==P6)return et}if(we.type==="illegal"&&$e==="")return 1;if($>1e5&&$>we.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Pe+=$e,$e.length}const qe=O(L);if(!qe)throw ha(s.replace("{}",L)),new Error('Unknown language: "'+L+'"');const At=vH(qe);let q="",z=K||At;const he={},xe=new l.__emitter(l);Ae();let Pe="",nt=0,Ke=0,$=0,ne=!1;try{if(qe.__emitTokens)qe.__emitTokens(F,xe);else{for(z.matcher.considerAll();;){$++,ne?ne=!1:z.matcher.considerAll(),z.matcher.lastIndex=Ke;const oe=z.matcher.exec(F);if(!oe)break;const we=F.substring(Ke,oe.index),$e=We(we,oe);Ke=oe.index+$e}We(F.substring(Ke))}return xe.finalize(),q=xe.toHTML(),{language:L,value:q,relevance:nt,illegal:!1,_emitter:xe,_top:z}}catch(oe){if(oe.message&&oe.message.includes("Illegal"))return{language:L,value:x1(F),illegal:!0,relevance:0,_illegalBy:{message:oe.message,index:Ke,context:F.slice(Ke-100,Ke+100),mode:oe.mode,resultSoFar:q},_emitter:xe};if(i)return{language:L,value:x1(F),illegal:!1,relevance:0,errorRaised:oe,_emitter:xe,_top:z};throw oe}}function m(L){const F={value:x1(L),illegal:!1,relevance:0,_top:a,_emitter:new l.__emitter(l)};return F._emitter.addText(L),F}function g(L,F){F=F||l.languages||Object.keys(e);const R=m(L),K=F.filter(O).filter(H).map(ie=>p(ie,L,!1));K.unshift(R);const X=K.sort((ie,me)=>{if(ie.relevance!==me.relevance)return me.relevance-ie.relevance;if(ie.language&&me.language){if(O(ie.language).supersetOf===me.language)return 1;if(O(me.language).supersetOf===ie.language)return-1}return 0}),[ae,de]=X,Ee=ae;return Ee.secondBest=de,Ee}function v(L,F,R){const K=F&&n[F]||R;L.classList.add("hljs"),L.classList.add(`language-${K}`)}function b(L){let F=null;const R=c(L);if(u(R))return;if(U("before:highlightElement",{el:L,language:R}),L.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",L);return}if(L.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(L)),l.throwUnescapedHTML))throw new wH("One of your code blocks includes unescaped HTML.",L.innerHTML);F=L;const K=F.textContent,X=R?f(K,{language:R,ignoreIllegals:!0}):g(K);L.innerHTML=X.value,L.dataset.highlighted="yes",v(L,R,X.language),L.result={language:X.language,re:X.relevance,relevance:X.relevance},X.secondBest&&(L.secondBest={language:X.secondBest.language,relevance:X.secondBest.relevance}),U("after:highlightElement",{el:L,result:X,text:K})}function w(L){l=D6(l,L)}const x=()=>{k(),Tl("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function C(){k(),Tl("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let E=!1;function k(){if(document.readyState==="loading"){E=!0;return}document.querySelectorAll(l.cssSelector).forEach(b)}function T(){E&&k()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",T,!1);function _(L,F){let R=null;try{R=F(t)}catch(K){if(ha("Language definition for '{}' could not be registered.".replace("{}",L)),i)ha(K);else throw K;R=a}R.name||(R.name=L),e[L]=R,R.rawDefinition=F.bind(null,t),R.aliases&&B(R.aliases,{languageName:L})}function A(L){delete e[L];for(const F of Object.keys(n))n[F]===L&&delete n[F]}function V(){return Object.keys(e)}function O(L){return L=(L||"").toLowerCase(),e[L]||e[n[L]]}function B(L,{languageName:F}){typeof L=="string"&&(L=[L]),L.forEach(R=>{n[R.toLowerCase()]=F})}function H(L){const F=O(L);return F&&!F.disableAutodetect}function j(L){L["before:highlightBlock"]&&!L["before:highlightElement"]&&(L["before:highlightElement"]=F=>{L["before:highlightBlock"](Object.assign({block:F.el},F))}),L["after:highlightBlock"]&&!L["after:highlightElement"]&&(L["after:highlightElement"]=F=>{L["after:highlightBlock"](Object.assign({block:F.el},F))})}function Y(L){j(L),r.push(L)}function N(L){const F=r.indexOf(L);F!==-1&&r.splice(F,1)}function U(L,F){const R=L;r.forEach(function(K){K[R]&&K[R](F)})}function P(L){return Tl("10.7.0","highlightBlock will be removed entirely in v12.0"),Tl("10.7.0","Please use highlightElement now."),b(L)}Object.assign(t,{highlight:f,highlightAuto:g,highlightAll:k,highlightElement:b,highlightBlock:P,configure:w,initHighlighting:x,initHighlightingOnLoad:C,registerLanguage:_,unregisterLanguage:A,listLanguages:V,getLanguage:O,registerAliases:B,autoDetection:H,inherit:D6,addPlugin:Y,removePlugin:N}),t.debugMode=function(){i=!1},t.safeMode=function(){i=!0},t.versionString=yH,t.regex={concat:pa,lookahead:E6,either:b1,optional:P$,anyNumberOfTimes:D$};for(const L in Jf)typeof Jf[L]=="object"&&y6(Jf[L]);return Object.assign(t,Jf),t},Al=V6({});Al.newInstance=()=>V6({});var CH=Al;Al.HighlightJS=Al,Al.default=Al;var kH=O$(CH);function F6(t,e=[]){return t.map(n=>{const r=[...e,...n.properties?n.properties.className:[]];return n.children?F6(n.children,r):{text:n.value,classes:r}}).flat()}function $6(t){return t.value||t.children||[]}function EH(t){return!!kH.getLanguage(t)}function H6({doc:t,name:e,lowlight:n,defaultLanguage:r}){const i=[];return P0(t,s=>s.type.name===e).forEach(s=>{var a;let l=s.pos+1;const u=s.node.attrs.language||r,c=n.listLanguages(),f=u&&(c.includes(u)||EH(u)||!((a=n.registered)===null||a===void 0)&&a.call(n,u))?$6(n.highlight(u,s.node.textContent)):$6(n.highlightAuto(s.node.textContent));F6(f).forEach(p=>{const m=l+p.text.length;if(p.classes.length){const g=jt.inline(l,m,{class:p.classes.join(" ")});i.push(g)}l=m})}),lt.create(t,i)}function SH(t){return typeof t=="function"}function _H({name:t,lowlight:e,defaultLanguage:n}){if(!["highlight","highlightAuto","listLanguages"].every(i=>SH(e[i])))throw Error("You should provide an instance of lowlight to use the code-block-lowlight extension");const r=new ot({key:new Et("lowlight"),state:{init:(i,{doc:s})=>H6({doc:s,name:t,lowlight:e,defaultLanguage:n}),apply:(i,s,a,l)=>{const u=a.selection.$head.parent.type.name,c=l.selection.$head.parent.type.name,f=P0(a.doc,m=>m.type.name===t),p=P0(l.doc,m=>m.type.name===t);return i.docChanged&&([u,c].includes(t)||p.length!==f.length||i.steps.some(m=>m.from!==void 0&&m.to!==void 0&&f.some(g=>g.pos>=m.from&&g.pos+g.node.nodeSize<=m.to)))?H6({doc:i.doc,name:t,lowlight:e,defaultLanguage:n}):s.map(i.mapping,i.doc)}},props:{decorations(i){return r.getState(i)}}});return r}const TH=M$.extend({addOptions(){var t;return{...(t=this.parent)===null||t===void 0?void 0:t.call(this),lowlight:{},languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},addProseMirrorPlugins(){var t;return[...((t=this.parent)===null||t===void 0?void 0:t.call(this))||[],_H({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}}),AH=o.defineComponent({__name:"SelectSeparator",props:{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(DV),o.mergeProps(n.value,{class:o.unref(ke)("-mx-1 my-1 h-px bg-ed-muted",e.class)}),null,16,["class"]))}}),MH=o.defineComponent({__name:"Select",props:{open:{type:Boolean},defaultOpen:{type:Boolean},defaultValue:{},modelValue:{},dir:{},name:{},autocomplete:{},disabled:{type:Boolean},required:{type:Boolean}},emits:["update:modelValue","update:open"],setup(t,{emit:e}){const i=Rt(t,e);return(s,a)=>(o.openBlock(),o.createBlock(o.unref(CV),o.normalizeProps(o.guardReactiveProps(o.unref(i))),{default:o.withCtx(()=>[o.renderSlot(s.$slots,"default")]),_:3},16))}}),OH=o.defineComponent({__name:"SelectValue",props:{placeholder:{},asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,r)=>(o.openBlock(),o.createBlock(o.unref(qV),o.normalizeProps(o.guardReactiveProps(e)),{default:o.withCtx(()=>[o.renderSlot(n.$slots,"default")]),_:3},16))}});/**
|
|
248
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),X=L,K=F),R===void 0&&(R=!0);const ae={code:K,language:X};U("before:highlight",ae);const de=ae.result?ae.result:p(ae.language,ae.code,R);return de.code=ae.code,U("after:highlight",de),de}function p(L,F,R,K){const X=Object.create(null);function ae(oe,we){return oe.keywords[we]}function de(){if(!z.keywords){xe.addText(Pe);return}let oe=0;z.keywordPatternRe.lastIndex=0;let we=z.keywordPatternRe.exec(Pe),$e="";for(;we;){$e+=Pe.substring(oe,we.index);const tt=qe.case_insensitive?we[0].toLowerCase():we[0],Tt=ae(z,tt);if(Tt){const[ue,je]=Tt;if(xe.addText($e),$e="",X[tt]=(X[tt]||0)+1,X[tt]<=xH&&(rt+=je),ue.startsWith("_"))$e+=we[0];else{const re=qe.classNameAliases[ue]||ue;me(we[0],re)}}else $e+=we[0];oe=z.keywordPatternRe.lastIndex,we=z.keywordPatternRe.exec(Pe)}$e+=Pe.substring(oe),xe.addText($e)}function Ee(){if(Pe==="")return;let oe=null;if(typeof z.subLanguage=="string"){if(!e[z.subLanguage]){xe.addText(Pe);return}oe=p(z.subLanguage,Pe,!0,he[z.subLanguage]),he[z.subLanguage]=oe._top}else oe=g(Pe,z.subLanguage.length?z.subLanguage:null);z.relevance>0&&(rt+=oe.relevance),xe.__addSublanguage(oe._emitter,oe.language)}function ie(){z.subLanguage!=null?Ee():de(),Pe=""}function me(oe,we){oe!==""&&(xe.startScope(we),xe.addText(oe),xe.endScope())}function J(oe,we){let $e=1;const tt=we.length-1;for(;$e<=tt;){if(!oe._emit[$e]){$e++;continue}const Tt=qe.classNameAliases[oe[$e]]||oe[$e],ue=we[$e];Tt?me(ue,Tt):(Pe=ue,de(),Pe=""),$e++}}function ee(oe,we){return oe.scope&&typeof oe.scope=="string"&&xe.openNode(qe.classNameAliases[oe.scope]||oe.scope),oe.beginScope&&(oe.beginScope._wrap?(me(Pe,qe.classNameAliases[oe.beginScope._wrap]||oe.beginScope._wrap),Pe=""):oe.beginScope._multi&&(J(oe.beginScope,we),Pe="")),z=Object.create(oe,{parent:{value:z}}),z}function te(oe,we,$e){let tt=F$(oe.endRe,$e);if(tt){if(oe["on:end"]){const Tt=new w6(oe);oe["on:end"](we,Tt),Tt.isMatchIgnored&&(tt=!1)}if(tt){for(;oe.endsParent&&oe.parent;)oe=oe.parent;return oe}}if(oe.endsWithParent)return te(oe.parent,we,$e)}function se(oe){return z.matcher.regexIndex===0?(Pe+=oe[0],1):(ne=!0,0)}function pe(oe){const we=oe[0],$e=oe.rule,tt=new w6($e),Tt=[$e.__beforeBegin,$e["on:begin"]];for(const ue of Tt)if(ue&&(ue(oe,tt),tt.isMatchIgnored))return se(we);return $e.skip?Pe+=we:($e.excludeBegin&&(Pe+=we),ie(),!$e.returnBegin&&!$e.excludeBegin&&(Pe=we)),ee($e,oe),$e.returnBegin?0:we.length}function _e(oe){const we=oe[0],$e=F.substring(oe.index),tt=te(z,oe,$e);if(!tt)return P6;const Tt=z;z.endScope&&z.endScope._wrap?(ie(),me(we,z.endScope._wrap)):z.endScope&&z.endScope._multi?(ie(),J(z.endScope,oe)):Tt.skip?Pe+=we:(Tt.returnEnd||Tt.excludeEnd||(Pe+=we),ie(),Tt.excludeEnd&&(Pe=we));do z.scope&&xe.closeNode(),!z.skip&&!z.subLanguage&&(rt+=z.relevance),z=z.parent;while(z!==tt.parent);return tt.starts&&ee(tt.starts,oe),Tt.returnEnd?0:we.length}function Ae(){const oe=[];for(let we=z;we!==qe;we=we.parent)we.scope&&oe.unshift(we.scope);oe.forEach(we=>xe.openNode(we))}let Ue={};function We(oe,we){const $e=we&&we[0];if(Pe+=oe,$e==null)return ie(),0;if(Ue.type==="begin"&&we.type==="end"&&Ue.index===we.index&&$e===""){if(Pe+=F.slice(we.index,we.index+1),!i){const tt=new Error(`0 width match regex (${L})`);throw tt.languageName=L,tt.badRule=Ue.rule,tt}return 1}if(Ue=we,we.type==="begin")return pe(we);if(we.type==="illegal"&&!R){const tt=new Error('Illegal lexeme "'+$e+'" for mode "'+(z.scope||"<unnamed>")+'"');throw tt.mode=z,tt}else if(we.type==="end"){const tt=_e(we);if(tt!==P6)return tt}if(we.type==="illegal"&&$e==="")return 1;if($>1e5&&$>we.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Pe+=$e,$e.length}const qe=O(L);if(!qe)throw ha(s.replace("{}",L)),new Error('Unknown language: "'+L+'"');const At=vH(qe);let q="",z=K||At;const he={},xe=new l.__emitter(l);Ae();let Pe="",rt=0,Ke=0,$=0,ne=!1;try{if(qe.__emitTokens)qe.__emitTokens(F,xe);else{for(z.matcher.considerAll();;){$++,ne?ne=!1:z.matcher.considerAll(),z.matcher.lastIndex=Ke;const oe=z.matcher.exec(F);if(!oe)break;const we=F.substring(Ke,oe.index),$e=We(we,oe);Ke=oe.index+$e}We(F.substring(Ke))}return xe.finalize(),q=xe.toHTML(),{language:L,value:q,relevance:rt,illegal:!1,_emitter:xe,_top:z}}catch(oe){if(oe.message&&oe.message.includes("Illegal"))return{language:L,value:x1(F),illegal:!0,relevance:0,_illegalBy:{message:oe.message,index:Ke,context:F.slice(Ke-100,Ke+100),mode:oe.mode,resultSoFar:q},_emitter:xe};if(i)return{language:L,value:x1(F),illegal:!1,relevance:0,errorRaised:oe,_emitter:xe,_top:z};throw oe}}function m(L){const F={value:x1(L),illegal:!1,relevance:0,_top:a,_emitter:new l.__emitter(l)};return F._emitter.addText(L),F}function g(L,F){F=F||l.languages||Object.keys(e);const R=m(L),K=F.filter(O).filter(H).map(ie=>p(ie,L,!1));K.unshift(R);const X=K.sort((ie,me)=>{if(ie.relevance!==me.relevance)return me.relevance-ie.relevance;if(ie.language&&me.language){if(O(ie.language).supersetOf===me.language)return 1;if(O(me.language).supersetOf===ie.language)return-1}return 0}),[ae,de]=X,Ee=ae;return Ee.secondBest=de,Ee}function v(L,F,R){const K=F&&n[F]||R;L.classList.add("hljs"),L.classList.add(`language-${K}`)}function b(L){let F=null;const R=c(L);if(u(R))return;if(U("before:highlightElement",{el:L,language:R}),L.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",L);return}if(L.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(L)),l.throwUnescapedHTML))throw new wH("One of your code blocks includes unescaped HTML.",L.innerHTML);F=L;const K=F.textContent,X=R?f(K,{language:R,ignoreIllegals:!0}):g(K);L.innerHTML=X.value,L.dataset.highlighted="yes",v(L,R,X.language),L.result={language:X.language,re:X.relevance,relevance:X.relevance},X.secondBest&&(L.secondBest={language:X.secondBest.language,relevance:X.secondBest.relevance}),U("after:highlightElement",{el:L,result:X,text:K})}function w(L){l=D6(l,L)}const x=()=>{k(),Tl("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function C(){k(),Tl("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let E=!1;function k(){if(document.readyState==="loading"){E=!0;return}document.querySelectorAll(l.cssSelector).forEach(b)}function T(){E&&k()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",T,!1);function _(L,F){let R=null;try{R=F(t)}catch(K){if(ha("Language definition for '{}' could not be registered.".replace("{}",L)),i)ha(K);else throw K;R=a}R.name||(R.name=L),e[L]=R,R.rawDefinition=F.bind(null,t),R.aliases&&B(R.aliases,{languageName:L})}function A(L){delete e[L];for(const F of Object.keys(n))n[F]===L&&delete n[F]}function V(){return Object.keys(e)}function O(L){return L=(L||"").toLowerCase(),e[L]||e[n[L]]}function B(L,{languageName:F}){typeof L=="string"&&(L=[L]),L.forEach(R=>{n[R.toLowerCase()]=F})}function H(L){const F=O(L);return F&&!F.disableAutodetect}function j(L){L["before:highlightBlock"]&&!L["before:highlightElement"]&&(L["before:highlightElement"]=F=>{L["before:highlightBlock"](Object.assign({block:F.el},F))}),L["after:highlightBlock"]&&!L["after:highlightElement"]&&(L["after:highlightElement"]=F=>{L["after:highlightBlock"](Object.assign({block:F.el},F))})}function Y(L){j(L),r.push(L)}function N(L){const F=r.indexOf(L);F!==-1&&r.splice(F,1)}function U(L,F){const R=L;r.forEach(function(K){K[R]&&K[R](F)})}function P(L){return Tl("10.7.0","highlightBlock will be removed entirely in v12.0"),Tl("10.7.0","Please use highlightElement now."),b(L)}Object.assign(t,{highlight:f,highlightAuto:g,highlightAll:k,highlightElement:b,highlightBlock:P,configure:w,initHighlighting:x,initHighlightingOnLoad:C,registerLanguage:_,unregisterLanguage:A,listLanguages:V,getLanguage:O,registerAliases:B,autoDetection:H,inherit:D6,addPlugin:Y,removePlugin:N}),t.debugMode=function(){i=!1},t.safeMode=function(){i=!0},t.versionString=yH,t.regex={concat:pa,lookahead:E6,either:b1,optional:P$,anyNumberOfTimes:D$};for(const L in Jf)typeof Jf[L]=="object"&&y6(Jf[L]);return Object.assign(t,Jf),t},Al=V6({});Al.newInstance=()=>V6({});var CH=Al;Al.HighlightJS=Al,Al.default=Al;var kH=O$(CH);function F6(t,e=[]){return t.map(n=>{const r=[...e,...n.properties?n.properties.className:[]];return n.children?F6(n.children,r):{text:n.value,classes:r}}).flat()}function $6(t){return t.value||t.children||[]}function EH(t){return!!kH.getLanguage(t)}function H6({doc:t,name:e,lowlight:n,defaultLanguage:r}){const i=[];return P0(t,s=>s.type.name===e).forEach(s=>{var a;let l=s.pos+1;const u=s.node.attrs.language||r,c=n.listLanguages(),f=u&&(c.includes(u)||EH(u)||!((a=n.registered)===null||a===void 0)&&a.call(n,u))?$6(n.highlight(u,s.node.textContent)):$6(n.highlightAuto(s.node.textContent));F6(f).forEach(p=>{const m=l+p.text.length;if(p.classes.length){const g=jt.inline(l,m,{class:p.classes.join(" ")});i.push(g)}l=m})}),lt.create(t,i)}function SH(t){return typeof t=="function"}function _H({name:t,lowlight:e,defaultLanguage:n}){if(!["highlight","highlightAuto","listLanguages"].every(i=>SH(e[i])))throw Error("You should provide an instance of lowlight to use the code-block-lowlight extension");const r=new ot({key:new Et("lowlight"),state:{init:(i,{doc:s})=>H6({doc:s,name:t,lowlight:e,defaultLanguage:n}),apply:(i,s,a,l)=>{const u=a.selection.$head.parent.type.name,c=l.selection.$head.parent.type.name,f=P0(a.doc,m=>m.type.name===t),p=P0(l.doc,m=>m.type.name===t);return i.docChanged&&([u,c].includes(t)||p.length!==f.length||i.steps.some(m=>m.from!==void 0&&m.to!==void 0&&f.some(g=>g.pos>=m.from&&g.pos+g.node.nodeSize<=m.to)))?H6({doc:i.doc,name:t,lowlight:e,defaultLanguage:n}):s.map(i.mapping,i.doc)}},props:{decorations(i){return r.getState(i)}}});return r}const TH=M$.extend({addOptions(){var t;return{...(t=this.parent)===null||t===void 0?void 0:t.call(this),lowlight:{},languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},addProseMirrorPlugins(){var t;return[...((t=this.parent)===null||t===void 0?void 0:t.call(this))||[],_H({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}}),AH=o.defineComponent({__name:"SelectSeparator",props:{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(DV),o.mergeProps(n.value,{class:o.unref(ke)("-mx-1 my-1 h-px bg-ed-muted",e.class)}),null,16,["class"]))}}),MH=o.defineComponent({__name:"Select",props:{open:{type:Boolean},defaultOpen:{type:Boolean},defaultValue:{},modelValue:{},dir:{},name:{},autocomplete:{},disabled:{type:Boolean},required:{type:Boolean}},emits:["update:modelValue","update:open"],setup(t,{emit:e}){const i=Rt(t,e);return(s,a)=>(o.openBlock(),o.createBlock(o.unref(CV),o.normalizeProps(o.guardReactiveProps(o.unref(i))),{default:o.withCtx(()=>[o.renderSlot(s.$slots,"default")]),_:3},16))}}),OH=o.defineComponent({__name:"SelectValue",props:{placeholder:{},asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,r)=>(o.openBlock(),o.createBlock(o.unref(qV),o.normalizeProps(o.guardReactiveProps(e)),{default:o.withCtx(()=>[o.renderSlot(n.$slots,"default")]),_:3},16))}});/**
|
|
249
249
|
* @license lucide-vue-next v0.439.0 - ISC
|
|
250
250
|
*
|
|
251
251
|
* This source code is licensed under the ISC license.
|
|
@@ -309,8 +309,8 @@ https://github.com/highlightjs/highlight.js/issues/2277`),X=L,K=F),R===void 0&&(
|
|
|
309
309
|
* message-compiler v10.0.6
|
|
310
310
|
* (c) 2025 kazuya kawaguchi
|
|
311
311
|
* Released under the MIT License.
|
|
312
|
-
*/function fz(t,e,n){return{line:t,column:e,offset:n}}function M1(t,e,n){return{start:t,end:e}}const
|
|
313
|
-
`,yz="\u2028",wz="\u2029";function xz(t){const e=t;let n=0,r=1,i=1,s=0;const a=A=>e[A]===bz&&e[A+1]===Zn,l=A=>e[A]===Zn,u=A=>e[A]===wz,c=A=>e[A]===yz,f=A=>a(A)||l(A)||u(A)||c(A),p=()=>n,m=()=>r,g=()=>i,v=()=>s,b=A=>a(A)||u(A)||c(A)?Zn:e[A],w=()=>b(n),x=()=>b(n+s);function C(){return s=0,f(n)&&(r++,i=0),a(n)&&n++,n++,i++,e[n]}function E(){return a(n+s)&&s++,s++,e[n+s]}function k(){n=0,r=1,i=1,s=0}function T(A=0){s=A}function _(){const A=n+s;for(;A!==n;)C();s=0}return{index:p,line:m,column:g,peekOffset:v,charAt:b,currentChar:w,currentPeek:x,next:C,peek:E,reset:k,resetPeek:T,skipToPeek:_}}const ls=void 0,Cz=".",t8="'",kz="tokenizer";function Ez(t,e={}){const n=e.location!==!1,r=xz(t),i=()=>r.index(),s=()=>fz(r.line(),r.column(),r.index()),a=s(),l=i(),u={currentType:13,offset:l,startLoc:a,endLoc:a,lastType:13,lastOffset:l,lastStartLoc:a,lastEndLoc:a,braceNest:0,inLinked:!1,text:""},c=()=>u,{onError:f}=e;function p(q,z,he,...xe){const Pe=c();if(z.column+=he,z.offset+=he,f){const nt=n?M1(Pe.startLoc,z):null,Ke=Bl(q,nt,{domain:kz,args:xe});f(Ke)}}function m(q,z,he){q.endLoc=s(),q.currentType=z;const xe={type:z};return n&&(xe.loc=M1(q.startLoc,q.endLoc)),he!=null&&(xe.value=he),xe}const g=q=>m(q,13);function v(q,z){return q.currentChar()===z?(q.next(),z):(p(Ne.EXPECTED_TOKEN,s(),0,z),"")}function b(q){let z="";for(;q.currentPeek()===mi||q.currentPeek()===Zn;)z+=q.currentPeek(),q.peek();return z}function w(q){const z=b(q);return q.skipToPeek(),z}function x(q){if(q===ls)return!1;const z=q.charCodeAt(0);return z>=97&&z<=122||z>=65&&z<=90||z===95}function C(q){if(q===ls)return!1;const z=q.charCodeAt(0);return z>=48&&z<=57}function E(q,z){const{currentType:he}=z;if(he!==2)return!1;b(q);const xe=x(q.currentPeek());return q.resetPeek(),xe}function k(q,z){const{currentType:he}=z;if(he!==2)return!1;b(q);const xe=q.currentPeek()==="-"?q.peek():q.currentPeek(),Pe=C(xe);return q.resetPeek(),Pe}function T(q,z){const{currentType:he}=z;if(he!==2)return!1;b(q);const xe=q.currentPeek()===t8;return q.resetPeek(),xe}function _(q,z){const{currentType:he}=z;if(he!==7)return!1;b(q);const xe=q.currentPeek()===".";return q.resetPeek(),xe}function A(q,z){const{currentType:he}=z;if(he!==8)return!1;b(q);const xe=x(q.currentPeek());return q.resetPeek(),xe}function V(q,z){const{currentType:he}=z;if(!(he===7||he===11))return!1;b(q);const xe=q.currentPeek()===":";return q.resetPeek(),xe}function O(q,z){const{currentType:he}=z;if(he!==9)return!1;const xe=()=>{const nt=q.currentPeek();return nt==="{"?x(q.peek()):nt==="@"||nt==="|"||nt===":"||nt==="."||nt===mi||!nt?!1:nt===Zn?(q.peek(),xe()):H(q,!1)},Pe=xe();return q.resetPeek(),Pe}function B(q){b(q);const z=q.currentPeek()==="|";return q.resetPeek(),z}function H(q,z=!0){const he=(Pe=!1,nt="")=>{const Ke=q.currentPeek();return Ke==="{"||Ke==="@"||!Ke?Pe:Ke==="|"?!(nt===mi||nt===Zn):Ke===mi?(q.peek(),he(!0,mi)):Ke===Zn?(q.peek(),he(!0,Zn)):!0},xe=he();return z&&q.resetPeek(),xe}function j(q,z){const he=q.currentChar();return he===ls?ls:z(he)?(q.next(),he):null}function Y(q){const z=q.charCodeAt(0);return z>=97&&z<=122||z>=65&&z<=90||z>=48&&z<=57||z===95||z===36}function N(q){return j(q,Y)}function U(q){const z=q.charCodeAt(0);return z>=97&&z<=122||z>=65&&z<=90||z>=48&&z<=57||z===95||z===36||z===45}function P(q){return j(q,U)}function L(q){const z=q.charCodeAt(0);return z>=48&&z<=57}function F(q){return j(q,L)}function R(q){const z=q.charCodeAt(0);return z>=48&&z<=57||z>=65&&z<=70||z>=97&&z<=102}function K(q){return j(q,R)}function X(q){let z="",he="";for(;z=F(q);)he+=z;return he}function ae(q){let z="";for(;;){const he=q.currentChar();if(he==="{"||he==="}"||he==="@"||he==="|"||!he)break;if(he===mi||he===Zn)if(H(q))z+=he,q.next();else{if(B(q))break;z+=he,q.next()}else z+=he,q.next()}return z}function de(q){w(q);let z="",he="";for(;z=P(q);)he+=z;return q.currentChar()===ls&&p(Ne.UNTERMINATED_CLOSING_BRACE,s(),0),he}function Ee(q){w(q);let z="";return q.currentChar()==="-"?(q.next(),z+=`-${X(q)}`):z+=X(q),q.currentChar()===ls&&p(Ne.UNTERMINATED_CLOSING_BRACE,s(),0),z}function ie(q){return q!==t8&&q!==Zn}function me(q){w(q),v(q,"'");let z="",he="";for(;z=j(q,ie);)z==="\\"?he+=J(q):he+=z;const xe=q.currentChar();return xe===Zn||xe===ls?(p(Ne.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,s(),0),xe===Zn&&(q.next(),v(q,"'")),he):(v(q,"'"),he)}function J(q){const z=q.currentChar();switch(z){case"\\":case"'":return q.next(),`\\${z}`;case"u":return ee(q,z,4);case"U":return ee(q,z,6);default:return p(Ne.UNKNOWN_ESCAPE_SEQUENCE,s(),0,z),""}}function ee(q,z,he){v(q,z);let xe="";for(let Pe=0;Pe<he;Pe++){const nt=K(q);if(!nt){p(Ne.INVALID_UNICODE_ESCAPE_SEQUENCE,s(),0,`\\${z}${xe}${q.currentChar()}`);break}xe+=nt}return`\\${z}${xe}`}function te(q){return q!=="{"&&q!=="}"&&q!==mi&&q!==Zn}function se(q){w(q);let z="",he="";for(;z=j(q,te);)he+=z;return he}function pe(q){let z="",he="";for(;z=N(q);)he+=z;return he}function _e(q){const z=he=>{const xe=q.currentChar();return xe==="{"||xe==="@"||xe==="|"||xe==="("||xe===")"||!xe||xe===mi?he:(he+=xe,q.next(),z(he))};return z("")}function Ae(q){w(q);const z=v(q,"|");return w(q),z}function Ue(q,z){let he=null;switch(q.currentChar()){case"{":return z.braceNest>=1&&p(Ne.NOT_ALLOW_NEST_PLACEHOLDER,s(),0),q.next(),he=m(z,2,"{"),w(q),z.braceNest++,he;case"}":return z.braceNest>0&&z.currentType===2&&p(Ne.EMPTY_PLACEHOLDER,s(),0),q.next(),he=m(z,3,"}"),z.braceNest--,z.braceNest>0&&w(q),z.inLinked&&z.braceNest===0&&(z.inLinked=!1),he;case"@":return z.braceNest>0&&p(Ne.UNTERMINATED_CLOSING_BRACE,s(),0),he=We(q,z)||g(z),z.braceNest=0,he;default:{let Pe=!0,nt=!0,Ke=!0;if(B(q))return z.braceNest>0&&p(Ne.UNTERMINATED_CLOSING_BRACE,s(),0),he=m(z,1,Ae(q)),z.braceNest=0,z.inLinked=!1,he;if(z.braceNest>0&&(z.currentType===4||z.currentType===5||z.currentType===6))return p(Ne.UNTERMINATED_CLOSING_BRACE,s(),0),z.braceNest=0,qe(q,z);if(Pe=E(q,z))return he=m(z,4,de(q)),w(q),he;if(nt=k(q,z))return he=m(z,5,Ee(q)),w(q),he;if(Ke=T(q,z))return he=m(z,6,me(q)),w(q),he;if(!Pe&&!nt&&!Ke)return he=m(z,12,se(q)),p(Ne.INVALID_TOKEN_IN_PLACEHOLDER,s(),0,he.value),w(q),he;break}}return he}function We(q,z){const{currentType:he}=z;let xe=null;const Pe=q.currentChar();switch((he===7||he===8||he===11||he===9)&&(Pe===Zn||Pe===mi)&&p(Ne.INVALID_LINKED_FORMAT,s(),0),Pe){case"@":return q.next(),xe=m(z,7,"@"),z.inLinked=!0,xe;case".":return w(q),q.next(),m(z,8,".");case":":return w(q),q.next(),m(z,9,":");default:return B(q)?(xe=m(z,1,Ae(q)),z.braceNest=0,z.inLinked=!1,xe):_(q,z)||V(q,z)?(w(q),We(q,z)):A(q,z)?(w(q),m(z,11,pe(q))):O(q,z)?(w(q),Pe==="{"?Ue(q,z)||xe:m(z,10,_e(q))):(he===7&&p(Ne.INVALID_LINKED_FORMAT,s(),0),z.braceNest=0,z.inLinked=!1,qe(q,z))}}function qe(q,z){let he={type:13};if(z.braceNest>0)return Ue(q,z)||g(z);if(z.inLinked)return We(q,z)||g(z);switch(q.currentChar()){case"{":return Ue(q,z)||g(z);case"}":return p(Ne.UNBALANCED_CLOSING_BRACE,s(),0),q.next(),m(z,3,"}");case"@":return We(q,z)||g(z);default:{if(B(q))return he=m(z,1,Ae(q)),z.braceNest=0,z.inLinked=!1,he;if(H(q))return m(z,0,ae(q));break}}return he}function At(){const{currentType:q,offset:z,startLoc:he,endLoc:xe}=u;return u.lastType=q,u.lastOffset=z,u.lastStartLoc=he,u.lastEndLoc=xe,u.offset=i(),u.startLoc=s(),r.currentChar()===ls?m(u,13):qe(r,u)}return{nextToken:At,currentOffset:i,currentPosition:s,context:c}}const Sz="parser",_z=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function Tz(t,e,n){switch(t){case"\\\\":return"\\";case"\\'":return"'";default:{const r=parseInt(e||n,16);return r<=55295||r>=57344?String.fromCodePoint(r):"�"}}}function Az(t={}){const e=t.location!==!1,{onError:n}=t;function r(x,C,E,k,...T){const _=x.currentPosition();if(_.offset+=k,_.column+=k,n){const A=e?M1(E,_):null,V=Bl(C,A,{domain:Sz,args:T});n(V)}}function i(x,C,E){const k={type:x};return e&&(k.start=C,k.end=C,k.loc={start:E,end:E}),k}function s(x,C,E,k){e&&(x.end=C,x.loc&&(x.loc.end=E))}function a(x,C){const E=x.context(),k=i(3,E.offset,E.startLoc);return k.value=C,s(k,x.currentOffset(),x.currentPosition()),k}function l(x,C){const E=x.context(),{lastOffset:k,lastStartLoc:T}=E,_=i(5,k,T);return _.index=parseInt(C,10),x.nextToken(),s(_,x.currentOffset(),x.currentPosition()),_}function u(x,C){const E=x.context(),{lastOffset:k,lastStartLoc:T}=E,_=i(4,k,T);return _.key=C,x.nextToken(),s(_,x.currentOffset(),x.currentPosition()),_}function c(x,C){const E=x.context(),{lastOffset:k,lastStartLoc:T}=E,_=i(9,k,T);return _.value=C.replace(_z,Tz),x.nextToken(),s(_,x.currentOffset(),x.currentPosition()),_}function f(x){const C=x.nextToken(),E=x.context(),{lastOffset:k,lastStartLoc:T}=E,_=i(8,k,T);return C.type!==11?(r(x,Ne.UNEXPECTED_EMPTY_LINKED_MODIFIER,E.lastStartLoc,0),_.value="",s(_,k,T),{nextConsumeToken:C,node:_}):(C.value==null&&r(x,Ne.UNEXPECTED_LEXICAL_ANALYSIS,E.lastStartLoc,0,zo(C)),_.value=C.value||"",s(_,x.currentOffset(),x.currentPosition()),{node:_})}function p(x,C){const E=x.context(),k=i(7,E.offset,E.startLoc);return k.value=C,s(k,x.currentOffset(),x.currentPosition()),k}function m(x){const C=x.context(),E=i(6,C.offset,C.startLoc);let k=x.nextToken();if(k.type===8){const T=f(x);E.modifier=T.node,k=T.nextConsumeToken||x.nextToken()}switch(k.type!==9&&r(x,Ne.UNEXPECTED_LEXICAL_ANALYSIS,C.lastStartLoc,0,zo(k)),k=x.nextToken(),k.type===2&&(k=x.nextToken()),k.type){case 10:k.value==null&&r(x,Ne.UNEXPECTED_LEXICAL_ANALYSIS,C.lastStartLoc,0,zo(k)),E.key=p(x,k.value||"");break;case 4:k.value==null&&r(x,Ne.UNEXPECTED_LEXICAL_ANALYSIS,C.lastStartLoc,0,zo(k)),E.key=u(x,k.value||"");break;case 5:k.value==null&&r(x,Ne.UNEXPECTED_LEXICAL_ANALYSIS,C.lastStartLoc,0,zo(k)),E.key=l(x,k.value||"");break;case 6:k.value==null&&r(x,Ne.UNEXPECTED_LEXICAL_ANALYSIS,C.lastStartLoc,0,zo(k)),E.key=c(x,k.value||"");break;default:{r(x,Ne.UNEXPECTED_EMPTY_LINKED_KEY,C.lastStartLoc,0);const T=x.context(),_=i(7,T.offset,T.startLoc);return _.value="",s(_,T.offset,T.startLoc),E.key=_,s(E,T.offset,T.startLoc),{nextConsumeToken:k,node:E}}}return s(E,x.currentOffset(),x.currentPosition()),{node:E}}function g(x){const C=x.context(),E=C.currentType===1?x.currentOffset():C.offset,k=C.currentType===1?C.endLoc:C.startLoc,T=i(2,E,k);T.items=[];let _=null;do{const O=_||x.nextToken();switch(_=null,O.type){case 0:O.value==null&&r(x,Ne.UNEXPECTED_LEXICAL_ANALYSIS,C.lastStartLoc,0,zo(O)),T.items.push(a(x,O.value||""));break;case 5:O.value==null&&r(x,Ne.UNEXPECTED_LEXICAL_ANALYSIS,C.lastStartLoc,0,zo(O)),T.items.push(l(x,O.value||""));break;case 4:O.value==null&&r(x,Ne.UNEXPECTED_LEXICAL_ANALYSIS,C.lastStartLoc,0,zo(O)),T.items.push(u(x,O.value||""));break;case 6:O.value==null&&r(x,Ne.UNEXPECTED_LEXICAL_ANALYSIS,C.lastStartLoc,0,zo(O)),T.items.push(c(x,O.value||""));break;case 7:{const B=m(x);T.items.push(B.node),_=B.nextConsumeToken||null;break}}}while(C.currentType!==13&&C.currentType!==1);const A=C.currentType===1?C.lastOffset:x.currentOffset(),V=C.currentType===1?C.lastEndLoc:x.currentPosition();return s(T,A,V),T}function v(x,C,E,k){const T=x.context();let _=k.items.length===0;const A=i(1,C,E);A.cases=[],A.cases.push(k);do{const V=g(x);_||(_=V.items.length===0),A.cases.push(V)}while(T.currentType!==13);return _&&r(x,Ne.MUST_HAVE_MESSAGES_IN_PLURAL,E,0),s(A,x.currentOffset(),x.currentPosition()),A}function b(x){const C=x.context(),{offset:E,startLoc:k}=C,T=g(x);return C.currentType===13?T:v(x,E,k,T)}function w(x){const C=Ez(x,yn({},t)),E=C.context(),k=i(0,E.offset,E.startLoc);return e&&k.loc&&(k.loc.source=x),k.body=b(C),t.onCacheKey&&(k.cacheKey=t.onCacheKey(x)),E.currentType!==13&&r(C,Ne.UNEXPECTED_LEXICAL_ANALYSIS,E.lastStartLoc,0,x[E.offset]||""),s(k,C.currentOffset(),C.currentPosition()),k}return{parse:w}}function zo(t){if(t.type===13)return"EOF";const e=(t.value||"").replace(/\r?\n/gu,"\\n");return e.length>10?e.slice(0,9)+"…":e}function Mz(t,e={}){const n={ast:t,helpers:new Set};return{context:()=>n,helper:s=>(n.helpers.add(s),s)}}function n8(t,e){for(let n=0;n<t.length;n++)O1(t[n],e)}function O1(t,e){switch(t.type){case 1:n8(t.cases,e),e.helper("plural");break;case 2:n8(t.items,e);break;case 6:{O1(t.key,e),e.helper("linked"),e.helper("type");break}case 5:e.helper("interpolate"),e.helper("list");break;case 4:e.helper("interpolate"),e.helper("named");break}}function Oz(t,e={}){const n=Mz(t);n.helper("normalize"),t.body&&O1(t.body,n);const r=n.context();t.helpers=Array.from(r.helpers)}function Bz(t){const e=t.body;return e.type===2?r8(e):e.cases.forEach(n=>r8(n)),t}function r8(t){if(t.items.length===1){const e=t.items[0];(e.type===3||e.type===9)&&(t.static=e.value,delete e.value)}else{const e=[];for(let n=0;n<t.items.length;n++){const r=t.items[n];if(!(r.type===3||r.type===9)||r.value==null)break;e.push(r.value)}if(e.length===t.items.length){t.static=T1(e);for(let n=0;n<t.items.length;n++){const r=t.items[n];(r.type===3||r.type===9)&&delete r.value}}}}const Iz="minifier";function Il(t){switch(t.t=t.type,t.type){case 0:{const e=t;Il(e.body),e.b=e.body,delete e.body;break}case 1:{const e=t,n=e.cases;for(let r=0;r<n.length;r++)Il(n[r]);e.c=n,delete e.cases;break}case 2:{const e=t,n=e.items;for(let r=0;r<n.length;r++)Il(n[r]);e.i=n,delete e.items,e.static&&(e.s=e.static,delete e.static);break}case 3:case 9:case 8:case 7:{const e=t;e.value&&(e.v=e.value,delete e.value);break}case 6:{const e=t;Il(e.key),e.k=e.key,delete e.key,e.modifier&&(Il(e.modifier),e.m=e.modifier,delete e.modifier);break}case 5:{const e=t;e.i=e.index,delete e.index;break}case 4:{const e=t;e.k=e.key,delete e.key;break}default:if(process.env.NODE_ENV!=="production")throw Bl(Ne.UNHANDLED_MINIFIER_NODE_TYPE,null,{domain:Iz,args:[t.type]})}delete t.type}const Lz="parser";function Rz(t,e){const{filename:n,breakLineCode:r,needIndent:i}=e,s=e.location!==!1,a={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:r,needIndent:i,indentLevel:0};s&&t.loc&&(a.source=t.loc.source);const l=()=>a;function u(b,w){a.code+=b}function c(b,w=!0){const x=w?r:"";u(i?x+" ".repeat(b):x)}function f(b=!0){const w=++a.indentLevel;b&&c(w)}function p(b=!0){const w=--a.indentLevel;b&&c(w)}function m(){c(a.indentLevel)}return{context:l,push:u,indent:f,deindent:p,newline:m,helper:b=>`_${b}`,needIndent:()=>a.needIndent}}function Dz(t,e){const{helper:n}=t;t.push(`${n("linked")}(`),Ll(t,e.key),e.modifier?(t.push(", "),Ll(t,e.modifier),t.push(", _type")):t.push(", undefined, _type"),t.push(")")}function Pz(t,e){const{helper:n,needIndent:r}=t;t.push(`${n("normalize")}([`),t.indent(r());const i=e.items.length;for(let s=0;s<i&&(Ll(t,e.items[s]),s!==i-1);s++)t.push(", ");t.deindent(r()),t.push("])")}function Vz(t,e){const{helper:n,needIndent:r}=t;if(e.cases.length>1){t.push(`${n("plural")}([`),t.indent(r());const i=e.cases.length;for(let s=0;s<i&&(Ll(t,e.cases[s]),s!==i-1);s++)t.push(", ");t.deindent(r()),t.push("])")}}function Fz(t,e){e.body?Ll(t,e.body):t.push("null")}function Ll(t,e){const{helper:n}=t;switch(e.type){case 0:Fz(t,e);break;case 1:Vz(t,e);break;case 2:Pz(t,e);break;case 6:Dz(t,e);break;case 8:t.push(JSON.stringify(e.value),e);break;case 7:t.push(JSON.stringify(e.value),e);break;case 5:t.push(`${n("interpolate")}(${n("list")}(${e.index}))`,e);break;case 4:t.push(`${n("interpolate")}(${n("named")}(${JSON.stringify(e.key)}))`,e);break;case 9:t.push(JSON.stringify(e.value),e);break;case 3:t.push(JSON.stringify(e.value),e);break;default:if(process.env.NODE_ENV!=="production")throw Bl(Ne.UNHANDLED_CODEGEN_NODE_TYPE,null,{domain:Lz,args:[e.type]})}}const $z=(t,e={})=>{const n=Oe(e.mode)?e.mode:"normal",r=Oe(e.filename)?e.filename:"message.intl";e.sourceMap;const i=e.breakLineCode!=null?e.breakLineCode:n==="arrow"?";":`
|
|
312
|
+
*/function fz(t,e,n){return{line:t,column:e,offset:n}}function M1(t,e,n){return{start:t,end:e}}const et={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16},pz=17,hz={[et.EXPECTED_TOKEN]:"Expected token: '{0}'",[et.INVALID_TOKEN_IN_PLACEHOLDER]:"Invalid token in placeholder: '{0}'",[et.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER]:"Unterminated single quote in placeholder",[et.UNKNOWN_ESCAPE_SEQUENCE]:"Unknown escape sequence: \\{0}",[et.INVALID_UNICODE_ESCAPE_SEQUENCE]:"Invalid unicode escape sequence: {0}",[et.UNBALANCED_CLOSING_BRACE]:"Unbalanced closing brace",[et.UNTERMINATED_CLOSING_BRACE]:"Unterminated closing brace",[et.EMPTY_PLACEHOLDER]:"Empty placeholder",[et.NOT_ALLOW_NEST_PLACEHOLDER]:"Not allowed nest placeholder",[et.INVALID_LINKED_FORMAT]:"Invalid linked format",[et.MUST_HAVE_MESSAGES_IN_PLURAL]:"Plural must have messages",[et.UNEXPECTED_EMPTY_LINKED_MODIFIER]:"Unexpected empty linked modifier",[et.UNEXPECTED_EMPTY_LINKED_KEY]:"Unexpected empty linked key",[et.UNEXPECTED_LEXICAL_ANALYSIS]:"Unexpected lexical analysis in token: '{0}'",[et.UNHANDLED_CODEGEN_NODE_TYPE]:"unhandled codegen node type: '{0}'",[et.UNHANDLED_MINIFIER_NODE_TYPE]:"unhandled mimifier node type: '{0}'"};function Bl(t,e,n={}){const{domain:r,messages:i,args:s}=n,a=process.env.NODE_ENV!=="production"?ep((i||hz)[t]||"",...s||[]):t,l=new SyntaxError(String(a));return l.code=t,e&&(l.location=e),l.domain=r,l}function mz(t){throw t}const gz=/<\/?[\w\s="/.':;#-\/]+>/,vz=t=>gz.test(t),mi=" ",bz="\r",Zn=`
|
|
313
|
+
`,yz="\u2028",wz="\u2029";function xz(t){const e=t;let n=0,r=1,i=1,s=0;const a=A=>e[A]===bz&&e[A+1]===Zn,l=A=>e[A]===Zn,u=A=>e[A]===wz,c=A=>e[A]===yz,f=A=>a(A)||l(A)||u(A)||c(A),p=()=>n,m=()=>r,g=()=>i,v=()=>s,b=A=>a(A)||u(A)||c(A)?Zn:e[A],w=()=>b(n),x=()=>b(n+s);function C(){return s=0,f(n)&&(r++,i=0),a(n)&&n++,n++,i++,e[n]}function E(){return a(n+s)&&s++,s++,e[n+s]}function k(){n=0,r=1,i=1,s=0}function T(A=0){s=A}function _(){const A=n+s;for(;A!==n;)C();s=0}return{index:p,line:m,column:g,peekOffset:v,charAt:b,currentChar:w,currentPeek:x,next:C,peek:E,reset:k,resetPeek:T,skipToPeek:_}}const ls=void 0,Cz=".",t8="'",kz="tokenizer";function Ez(t,e={}){const n=e.location!==!1,r=xz(t),i=()=>r.index(),s=()=>fz(r.line(),r.column(),r.index()),a=s(),l=i(),u={currentType:13,offset:l,startLoc:a,endLoc:a,lastType:13,lastOffset:l,lastStartLoc:a,lastEndLoc:a,braceNest:0,inLinked:!1,text:""},c=()=>u,{onError:f}=e;function p(q,z,he,...xe){const Pe=c();if(z.column+=he,z.offset+=he,f){const rt=n?M1(Pe.startLoc,z):null,Ke=Bl(q,rt,{domain:kz,args:xe});f(Ke)}}function m(q,z,he){q.endLoc=s(),q.currentType=z;const xe={type:z};return n&&(xe.loc=M1(q.startLoc,q.endLoc)),he!=null&&(xe.value=he),xe}const g=q=>m(q,13);function v(q,z){return q.currentChar()===z?(q.next(),z):(p(et.EXPECTED_TOKEN,s(),0,z),"")}function b(q){let z="";for(;q.currentPeek()===mi||q.currentPeek()===Zn;)z+=q.currentPeek(),q.peek();return z}function w(q){const z=b(q);return q.skipToPeek(),z}function x(q){if(q===ls)return!1;const z=q.charCodeAt(0);return z>=97&&z<=122||z>=65&&z<=90||z===95}function C(q){if(q===ls)return!1;const z=q.charCodeAt(0);return z>=48&&z<=57}function E(q,z){const{currentType:he}=z;if(he!==2)return!1;b(q);const xe=x(q.currentPeek());return q.resetPeek(),xe}function k(q,z){const{currentType:he}=z;if(he!==2)return!1;b(q);const xe=q.currentPeek()==="-"?q.peek():q.currentPeek(),Pe=C(xe);return q.resetPeek(),Pe}function T(q,z){const{currentType:he}=z;if(he!==2)return!1;b(q);const xe=q.currentPeek()===t8;return q.resetPeek(),xe}function _(q,z){const{currentType:he}=z;if(he!==7)return!1;b(q);const xe=q.currentPeek()===".";return q.resetPeek(),xe}function A(q,z){const{currentType:he}=z;if(he!==8)return!1;b(q);const xe=x(q.currentPeek());return q.resetPeek(),xe}function V(q,z){const{currentType:he}=z;if(!(he===7||he===11))return!1;b(q);const xe=q.currentPeek()===":";return q.resetPeek(),xe}function O(q,z){const{currentType:he}=z;if(he!==9)return!1;const xe=()=>{const rt=q.currentPeek();return rt==="{"?x(q.peek()):rt==="@"||rt==="|"||rt===":"||rt==="."||rt===mi||!rt?!1:rt===Zn?(q.peek(),xe()):H(q,!1)},Pe=xe();return q.resetPeek(),Pe}function B(q){b(q);const z=q.currentPeek()==="|";return q.resetPeek(),z}function H(q,z=!0){const he=(Pe=!1,rt="")=>{const Ke=q.currentPeek();return Ke==="{"||Ke==="@"||!Ke?Pe:Ke==="|"?!(rt===mi||rt===Zn):Ke===mi?(q.peek(),he(!0,mi)):Ke===Zn?(q.peek(),he(!0,Zn)):!0},xe=he();return z&&q.resetPeek(),xe}function j(q,z){const he=q.currentChar();return he===ls?ls:z(he)?(q.next(),he):null}function Y(q){const z=q.charCodeAt(0);return z>=97&&z<=122||z>=65&&z<=90||z>=48&&z<=57||z===95||z===36}function N(q){return j(q,Y)}function U(q){const z=q.charCodeAt(0);return z>=97&&z<=122||z>=65&&z<=90||z>=48&&z<=57||z===95||z===36||z===45}function P(q){return j(q,U)}function L(q){const z=q.charCodeAt(0);return z>=48&&z<=57}function F(q){return j(q,L)}function R(q){const z=q.charCodeAt(0);return z>=48&&z<=57||z>=65&&z<=70||z>=97&&z<=102}function K(q){return j(q,R)}function X(q){let z="",he="";for(;z=F(q);)he+=z;return he}function ae(q){let z="";for(;;){const he=q.currentChar();if(he==="{"||he==="}"||he==="@"||he==="|"||!he)break;if(he===mi||he===Zn)if(H(q))z+=he,q.next();else{if(B(q))break;z+=he,q.next()}else z+=he,q.next()}return z}function de(q){w(q);let z="",he="";for(;z=P(q);)he+=z;return q.currentChar()===ls&&p(et.UNTERMINATED_CLOSING_BRACE,s(),0),he}function Ee(q){w(q);let z="";return q.currentChar()==="-"?(q.next(),z+=`-${X(q)}`):z+=X(q),q.currentChar()===ls&&p(et.UNTERMINATED_CLOSING_BRACE,s(),0),z}function ie(q){return q!==t8&&q!==Zn}function me(q){w(q),v(q,"'");let z="",he="";for(;z=j(q,ie);)z==="\\"?he+=J(q):he+=z;const xe=q.currentChar();return xe===Zn||xe===ls?(p(et.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,s(),0),xe===Zn&&(q.next(),v(q,"'")),he):(v(q,"'"),he)}function J(q){const z=q.currentChar();switch(z){case"\\":case"'":return q.next(),`\\${z}`;case"u":return ee(q,z,4);case"U":return ee(q,z,6);default:return p(et.UNKNOWN_ESCAPE_SEQUENCE,s(),0,z),""}}function ee(q,z,he){v(q,z);let xe="";for(let Pe=0;Pe<he;Pe++){const rt=K(q);if(!rt){p(et.INVALID_UNICODE_ESCAPE_SEQUENCE,s(),0,`\\${z}${xe}${q.currentChar()}`);break}xe+=rt}return`\\${z}${xe}`}function te(q){return q!=="{"&&q!=="}"&&q!==mi&&q!==Zn}function se(q){w(q);let z="",he="";for(;z=j(q,te);)he+=z;return he}function pe(q){let z="",he="";for(;z=N(q);)he+=z;return he}function _e(q){const z=he=>{const xe=q.currentChar();return xe==="{"||xe==="@"||xe==="|"||xe==="("||xe===")"||!xe||xe===mi?he:(he+=xe,q.next(),z(he))};return z("")}function Ae(q){w(q);const z=v(q,"|");return w(q),z}function Ue(q,z){let he=null;switch(q.currentChar()){case"{":return z.braceNest>=1&&p(et.NOT_ALLOW_NEST_PLACEHOLDER,s(),0),q.next(),he=m(z,2,"{"),w(q),z.braceNest++,he;case"}":return z.braceNest>0&&z.currentType===2&&p(et.EMPTY_PLACEHOLDER,s(),0),q.next(),he=m(z,3,"}"),z.braceNest--,z.braceNest>0&&w(q),z.inLinked&&z.braceNest===0&&(z.inLinked=!1),he;case"@":return z.braceNest>0&&p(et.UNTERMINATED_CLOSING_BRACE,s(),0),he=We(q,z)||g(z),z.braceNest=0,he;default:{let Pe=!0,rt=!0,Ke=!0;if(B(q))return z.braceNest>0&&p(et.UNTERMINATED_CLOSING_BRACE,s(),0),he=m(z,1,Ae(q)),z.braceNest=0,z.inLinked=!1,he;if(z.braceNest>0&&(z.currentType===4||z.currentType===5||z.currentType===6))return p(et.UNTERMINATED_CLOSING_BRACE,s(),0),z.braceNest=0,qe(q,z);if(Pe=E(q,z))return he=m(z,4,de(q)),w(q),he;if(rt=k(q,z))return he=m(z,5,Ee(q)),w(q),he;if(Ke=T(q,z))return he=m(z,6,me(q)),w(q),he;if(!Pe&&!rt&&!Ke)return he=m(z,12,se(q)),p(et.INVALID_TOKEN_IN_PLACEHOLDER,s(),0,he.value),w(q),he;break}}return he}function We(q,z){const{currentType:he}=z;let xe=null;const Pe=q.currentChar();switch((he===7||he===8||he===11||he===9)&&(Pe===Zn||Pe===mi)&&p(et.INVALID_LINKED_FORMAT,s(),0),Pe){case"@":return q.next(),xe=m(z,7,"@"),z.inLinked=!0,xe;case".":return w(q),q.next(),m(z,8,".");case":":return w(q),q.next(),m(z,9,":");default:return B(q)?(xe=m(z,1,Ae(q)),z.braceNest=0,z.inLinked=!1,xe):_(q,z)||V(q,z)?(w(q),We(q,z)):A(q,z)?(w(q),m(z,11,pe(q))):O(q,z)?(w(q),Pe==="{"?Ue(q,z)||xe:m(z,10,_e(q))):(he===7&&p(et.INVALID_LINKED_FORMAT,s(),0),z.braceNest=0,z.inLinked=!1,qe(q,z))}}function qe(q,z){let he={type:13};if(z.braceNest>0)return Ue(q,z)||g(z);if(z.inLinked)return We(q,z)||g(z);switch(q.currentChar()){case"{":return Ue(q,z)||g(z);case"}":return p(et.UNBALANCED_CLOSING_BRACE,s(),0),q.next(),m(z,3,"}");case"@":return We(q,z)||g(z);default:{if(B(q))return he=m(z,1,Ae(q)),z.braceNest=0,z.inLinked=!1,he;if(H(q))return m(z,0,ae(q));break}}return he}function At(){const{currentType:q,offset:z,startLoc:he,endLoc:xe}=u;return u.lastType=q,u.lastOffset=z,u.lastStartLoc=he,u.lastEndLoc=xe,u.offset=i(),u.startLoc=s(),r.currentChar()===ls?m(u,13):qe(r,u)}return{nextToken:At,currentOffset:i,currentPosition:s,context:c}}const Sz="parser",_z=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function Tz(t,e,n){switch(t){case"\\\\":return"\\";case"\\'":return"'";default:{const r=parseInt(e||n,16);return r<=55295||r>=57344?String.fromCodePoint(r):"�"}}}function Az(t={}){const e=t.location!==!1,{onError:n}=t;function r(x,C,E,k,...T){const _=x.currentPosition();if(_.offset+=k,_.column+=k,n){const A=e?M1(E,_):null,V=Bl(C,A,{domain:Sz,args:T});n(V)}}function i(x,C,E){const k={type:x};return e&&(k.start=C,k.end=C,k.loc={start:E,end:E}),k}function s(x,C,E,k){e&&(x.end=C,x.loc&&(x.loc.end=E))}function a(x,C){const E=x.context(),k=i(3,E.offset,E.startLoc);return k.value=C,s(k,x.currentOffset(),x.currentPosition()),k}function l(x,C){const E=x.context(),{lastOffset:k,lastStartLoc:T}=E,_=i(5,k,T);return _.index=parseInt(C,10),x.nextToken(),s(_,x.currentOffset(),x.currentPosition()),_}function u(x,C){const E=x.context(),{lastOffset:k,lastStartLoc:T}=E,_=i(4,k,T);return _.key=C,x.nextToken(),s(_,x.currentOffset(),x.currentPosition()),_}function c(x,C){const E=x.context(),{lastOffset:k,lastStartLoc:T}=E,_=i(9,k,T);return _.value=C.replace(_z,Tz),x.nextToken(),s(_,x.currentOffset(),x.currentPosition()),_}function f(x){const C=x.nextToken(),E=x.context(),{lastOffset:k,lastStartLoc:T}=E,_=i(8,k,T);return C.type!==11?(r(x,et.UNEXPECTED_EMPTY_LINKED_MODIFIER,E.lastStartLoc,0),_.value="",s(_,k,T),{nextConsumeToken:C,node:_}):(C.value==null&&r(x,et.UNEXPECTED_LEXICAL_ANALYSIS,E.lastStartLoc,0,zo(C)),_.value=C.value||"",s(_,x.currentOffset(),x.currentPosition()),{node:_})}function p(x,C){const E=x.context(),k=i(7,E.offset,E.startLoc);return k.value=C,s(k,x.currentOffset(),x.currentPosition()),k}function m(x){const C=x.context(),E=i(6,C.offset,C.startLoc);let k=x.nextToken();if(k.type===8){const T=f(x);E.modifier=T.node,k=T.nextConsumeToken||x.nextToken()}switch(k.type!==9&&r(x,et.UNEXPECTED_LEXICAL_ANALYSIS,C.lastStartLoc,0,zo(k)),k=x.nextToken(),k.type===2&&(k=x.nextToken()),k.type){case 10:k.value==null&&r(x,et.UNEXPECTED_LEXICAL_ANALYSIS,C.lastStartLoc,0,zo(k)),E.key=p(x,k.value||"");break;case 4:k.value==null&&r(x,et.UNEXPECTED_LEXICAL_ANALYSIS,C.lastStartLoc,0,zo(k)),E.key=u(x,k.value||"");break;case 5:k.value==null&&r(x,et.UNEXPECTED_LEXICAL_ANALYSIS,C.lastStartLoc,0,zo(k)),E.key=l(x,k.value||"");break;case 6:k.value==null&&r(x,et.UNEXPECTED_LEXICAL_ANALYSIS,C.lastStartLoc,0,zo(k)),E.key=c(x,k.value||"");break;default:{r(x,et.UNEXPECTED_EMPTY_LINKED_KEY,C.lastStartLoc,0);const T=x.context(),_=i(7,T.offset,T.startLoc);return _.value="",s(_,T.offset,T.startLoc),E.key=_,s(E,T.offset,T.startLoc),{nextConsumeToken:k,node:E}}}return s(E,x.currentOffset(),x.currentPosition()),{node:E}}function g(x){const C=x.context(),E=C.currentType===1?x.currentOffset():C.offset,k=C.currentType===1?C.endLoc:C.startLoc,T=i(2,E,k);T.items=[];let _=null;do{const O=_||x.nextToken();switch(_=null,O.type){case 0:O.value==null&&r(x,et.UNEXPECTED_LEXICAL_ANALYSIS,C.lastStartLoc,0,zo(O)),T.items.push(a(x,O.value||""));break;case 5:O.value==null&&r(x,et.UNEXPECTED_LEXICAL_ANALYSIS,C.lastStartLoc,0,zo(O)),T.items.push(l(x,O.value||""));break;case 4:O.value==null&&r(x,et.UNEXPECTED_LEXICAL_ANALYSIS,C.lastStartLoc,0,zo(O)),T.items.push(u(x,O.value||""));break;case 6:O.value==null&&r(x,et.UNEXPECTED_LEXICAL_ANALYSIS,C.lastStartLoc,0,zo(O)),T.items.push(c(x,O.value||""));break;case 7:{const B=m(x);T.items.push(B.node),_=B.nextConsumeToken||null;break}}}while(C.currentType!==13&&C.currentType!==1);const A=C.currentType===1?C.lastOffset:x.currentOffset(),V=C.currentType===1?C.lastEndLoc:x.currentPosition();return s(T,A,V),T}function v(x,C,E,k){const T=x.context();let _=k.items.length===0;const A=i(1,C,E);A.cases=[],A.cases.push(k);do{const V=g(x);_||(_=V.items.length===0),A.cases.push(V)}while(T.currentType!==13);return _&&r(x,et.MUST_HAVE_MESSAGES_IN_PLURAL,E,0),s(A,x.currentOffset(),x.currentPosition()),A}function b(x){const C=x.context(),{offset:E,startLoc:k}=C,T=g(x);return C.currentType===13?T:v(x,E,k,T)}function w(x){const C=Ez(x,yn({},t)),E=C.context(),k=i(0,E.offset,E.startLoc);return e&&k.loc&&(k.loc.source=x),k.body=b(C),t.onCacheKey&&(k.cacheKey=t.onCacheKey(x)),E.currentType!==13&&r(C,et.UNEXPECTED_LEXICAL_ANALYSIS,E.lastStartLoc,0,x[E.offset]||""),s(k,C.currentOffset(),C.currentPosition()),k}return{parse:w}}function zo(t){if(t.type===13)return"EOF";const e=(t.value||"").replace(/\r?\n/gu,"\\n");return e.length>10?e.slice(0,9)+"…":e}function Mz(t,e={}){const n={ast:t,helpers:new Set};return{context:()=>n,helper:s=>(n.helpers.add(s),s)}}function n8(t,e){for(let n=0;n<t.length;n++)O1(t[n],e)}function O1(t,e){switch(t.type){case 1:n8(t.cases,e),e.helper("plural");break;case 2:n8(t.items,e);break;case 6:{O1(t.key,e),e.helper("linked"),e.helper("type");break}case 5:e.helper("interpolate"),e.helper("list");break;case 4:e.helper("interpolate"),e.helper("named");break}}function Oz(t,e={}){const n=Mz(t);n.helper("normalize"),t.body&&O1(t.body,n);const r=n.context();t.helpers=Array.from(r.helpers)}function Bz(t){const e=t.body;return e.type===2?r8(e):e.cases.forEach(n=>r8(n)),t}function r8(t){if(t.items.length===1){const e=t.items[0];(e.type===3||e.type===9)&&(t.static=e.value,delete e.value)}else{const e=[];for(let n=0;n<t.items.length;n++){const r=t.items[n];if(!(r.type===3||r.type===9)||r.value==null)break;e.push(r.value)}if(e.length===t.items.length){t.static=T1(e);for(let n=0;n<t.items.length;n++){const r=t.items[n];(r.type===3||r.type===9)&&delete r.value}}}}const Iz="minifier";function Il(t){switch(t.t=t.type,t.type){case 0:{const e=t;Il(e.body),e.b=e.body,delete e.body;break}case 1:{const e=t,n=e.cases;for(let r=0;r<n.length;r++)Il(n[r]);e.c=n,delete e.cases;break}case 2:{const e=t,n=e.items;for(let r=0;r<n.length;r++)Il(n[r]);e.i=n,delete e.items,e.static&&(e.s=e.static,delete e.static);break}case 3:case 9:case 8:case 7:{const e=t;e.value&&(e.v=e.value,delete e.value);break}case 6:{const e=t;Il(e.key),e.k=e.key,delete e.key,e.modifier&&(Il(e.modifier),e.m=e.modifier,delete e.modifier);break}case 5:{const e=t;e.i=e.index,delete e.index;break}case 4:{const e=t;e.k=e.key,delete e.key;break}default:if(process.env.NODE_ENV!=="production")throw Bl(et.UNHANDLED_MINIFIER_NODE_TYPE,null,{domain:Iz,args:[t.type]})}delete t.type}const Lz="parser";function Rz(t,e){const{filename:n,breakLineCode:r,needIndent:i}=e,s=e.location!==!1,a={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:r,needIndent:i,indentLevel:0};s&&t.loc&&(a.source=t.loc.source);const l=()=>a;function u(b,w){a.code+=b}function c(b,w=!0){const x=w?r:"";u(i?x+" ".repeat(b):x)}function f(b=!0){const w=++a.indentLevel;b&&c(w)}function p(b=!0){const w=--a.indentLevel;b&&c(w)}function m(){c(a.indentLevel)}return{context:l,push:u,indent:f,deindent:p,newline:m,helper:b=>`_${b}`,needIndent:()=>a.needIndent}}function Dz(t,e){const{helper:n}=t;t.push(`${n("linked")}(`),Ll(t,e.key),e.modifier?(t.push(", "),Ll(t,e.modifier),t.push(", _type")):t.push(", undefined, _type"),t.push(")")}function Pz(t,e){const{helper:n,needIndent:r}=t;t.push(`${n("normalize")}([`),t.indent(r());const i=e.items.length;for(let s=0;s<i&&(Ll(t,e.items[s]),s!==i-1);s++)t.push(", ");t.deindent(r()),t.push("])")}function Vz(t,e){const{helper:n,needIndent:r}=t;if(e.cases.length>1){t.push(`${n("plural")}([`),t.indent(r());const i=e.cases.length;for(let s=0;s<i&&(Ll(t,e.cases[s]),s!==i-1);s++)t.push(", ");t.deindent(r()),t.push("])")}}function Fz(t,e){e.body?Ll(t,e.body):t.push("null")}function Ll(t,e){const{helper:n}=t;switch(e.type){case 0:Fz(t,e);break;case 1:Vz(t,e);break;case 2:Pz(t,e);break;case 6:Dz(t,e);break;case 8:t.push(JSON.stringify(e.value),e);break;case 7:t.push(JSON.stringify(e.value),e);break;case 5:t.push(`${n("interpolate")}(${n("list")}(${e.index}))`,e);break;case 4:t.push(`${n("interpolate")}(${n("named")}(${JSON.stringify(e.key)}))`,e);break;case 9:t.push(JSON.stringify(e.value),e);break;case 3:t.push(JSON.stringify(e.value),e);break;default:if(process.env.NODE_ENV!=="production")throw Bl(et.UNHANDLED_CODEGEN_NODE_TYPE,null,{domain:Lz,args:[e.type]})}}const $z=(t,e={})=>{const n=Oe(e.mode)?e.mode:"normal",r=Oe(e.filename)?e.filename:"message.intl";e.sourceMap;const i=e.breakLineCode!=null?e.breakLineCode:n==="arrow"?";":`
|
|
314
314
|
`,s=e.needIndent?e.needIndent:n!=="arrow",a=t.helpers||[],l=Rz(t,{filename:r,breakLineCode:i,needIndent:s});l.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(s),a.length>0&&(l.push(`const { ${T1(a.map(f=>`${f}: _${f}`),", ")} } = ctx`),l.newline()),l.push("return "),Ll(l,t),l.deindent(s),l.push("}"),delete t.helpers;const{code:u,map:c}=l.context();return{ast:t,code:u,map:c?c.toJSON():void 0}};function Hz(t,e={}){const n=yn({},e),r=!!n.jit,i=!!n.minify,s=n.optimize==null?!0:n.optimize,l=Az(n).parse(t);return r?(s&&Bz(l),i&&Il(l),{ast:l,code:""}):(Oz(l,n),$z(l,n))}/*!
|
|
315
315
|
* core-base v10.0.6
|
|
316
316
|
* (c) 2025 kazuya kawaguchi
|
|
@@ -320,7 +320,7 @@ ${c}`:u)}else throw a},onCacheKey:a=>oz(e,n,a)}}function XU(t){if(Oe(t))return t
|
|
|
320
320
|
* vue-i18n v10.0.6
|
|
321
321
|
* (c) 2025 kazuya kawaguchi
|
|
322
322
|
* Released under the MIT License.
|
|
323
|
-
*/const oW="10.0.6";function iW(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(ba().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(ba().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(ba().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(ba().__INTLIFY_PROD_DEVTOOLS__=!1)}const fs={FALLBACK_TO_ROOT:SU,NOT_FOUND_PARENT_SCOPE:9,IGNORE_OBJ_FLATTEN:10,DEPRECATE_TC:11},sW={[fs.FALLBACK_TO_ROOT]:"Fall back to {type} '{key}' with root locale.",[fs.NOT_FOUND_PARENT_SCOPE]:"Not found parent scope. use the global scope.",[fs.IGNORE_OBJ_FLATTEN]:"Ignore object flatten: '{key}' key has an string value",[fs.DEPRECATE_TC]:"'tc' and '$tc' has been deprecated in v10. Use 't' or '$t' instead. 'tc' and '$tc’ are going to remove in v11."};function up(t,...e){return ep(sW[t],...e)}const Ht={UNEXPECTED_RETURN_TYPE:fU,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:30,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32,NOT_COMPATIBLE_LEGACY_VUE_I18N:33,NOT_AVAILABLE_COMPOSITION_IN_LEGACY:34};function Qn(t,...e){return Bl(t,null,process.env.NODE_ENV!=="production"?{messages:aW,args:e}:void 0)}const aW={[Ht.UNEXPECTED_RETURN_TYPE]:"Unexpected return type in composer",[Ht.INVALID_ARGUMENT]:"Invalid argument",[Ht.MUST_BE_CALL_SETUP_TOP]:"Must be called at the top of a `setup` function",[Ht.NOT_INSTALLED]:"Need to install with `app.use` function",[Ht.UNEXPECTED_ERROR]:"Unexpected error",[Ht.REQUIRED_VALUE]:"Required in value: {0}",[Ht.INVALID_VALUE]:"Invalid value",[Ht.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN]:"Cannot setup vue-devtools plugin",[Ht.NOT_INSTALLED_WITH_PROVIDE]:"Need to install with `provide` function",[Ht.NOT_COMPATIBLE_LEGACY_VUE_I18N]:"Not compatible legacy VueI18n.",[Ht.NOT_AVAILABLE_COMPOSITION_IN_LEGACY]:"Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly"},U1=Ho("__translateVNode"),W1=Ho("__datetimeParts"),j1=Ho("__numberParts"),wa=Ho("__enableEmitter"),mc=Ho("__disableEmitter"),L8=Ho("__setPluralRules"),R8=Ho("__injectWithOption"),q1=Ho("__dispose");function gc(t){if(!kt(t))return t;for(const e in t)if(po(t,e))if(!e.includes("."))kt(t[e])&&gc(t[e]);else{const n=e.split("."),r=n.length-1;let i=t,s=!1;for(let a=0;a<r;a++){if(n[a]==="__proto__")throw new Error(`unsafe key: ${n[a]}`);if(n[a]in i||(i[n[a]]=Dt()),!kt(i[n[a]])){process.env.NODE_ENV!=="production"&&as(up(fs.IGNORE_OBJ_FLATTEN,{key:n[a]})),s=!0;break}i=i[n[a]]}s||(i[n[r]]=t[e],delete t[e]),kt(i[n[r]])&&gc(i[n[r]])}return t}function K1(t,e){const{messages:n,__i18n:r,messageResolver:i,flatJson:s}=e,a=ht(n)?n:en(r)?Dt():{[t]:Dt()};if(en(r)&&r.forEach(l=>{if("locale"in l&&"resource"in l){const{locale:u,resource:c}=l;u?(a[u]=a[u]||Dt(),rp(c,a[u])):rp(c,a)}else Oe(l)&&rp(JSON.parse(l),a)}),i==null&&s)for(const l in a)po(a,l)&&gc(a[l]);return a}function D8(t){return t.type}function P8(t,e,n){let r=kt(e.messages)?e.messages:Dt();"__i18nGlobal"in n&&(r=K1(t.locale.value,{messages:r,__i18n:n.__i18nGlobal}));const i=Object.keys(r);i.length&&i.forEach(s=>{t.mergeLocaleMessage(s,r[s])});{if(kt(e.datetimeFormats)){const s=Object.keys(e.datetimeFormats);s.length&&s.forEach(a=>{t.mergeDateTimeFormat(a,e.datetimeFormats[a])})}if(kt(e.numberFormats)){const s=Object.keys(e.numberFormats);s.length&&s.forEach(a=>{t.mergeNumberFormat(a,e.numberFormats[a])})}}}function V8(t){return o.createVNode(o.Text,null,t,0)}const F8="__INTLIFY_META__",$8=()=>[],lW=()=>!1;let H8=0;function z8(t){return(e,n,r,i)=>t(n,r,o.getCurrentInstance()||void 0,i)}const uW=()=>{const t=o.getCurrentInstance();let e=null;return t&&(e=D8(t)[F8])?{[F8]:e}:null};function G1(t={}){const{__root:e,__injectWithOption:n}=t,r=e===void 0,i=t.flatJson,s=fo?o.ref:o.shallowRef;let a=_t(t.inheritLocale)?t.inheritLocale:!0;const l=s(e&&a?e.locale.value:Oe(t.locale)?t.locale:pc),u=s(e&&a?e.fallbackLocale.value:Oe(t.fallbackLocale)||en(t.fallbackLocale)||ht(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:l.value),c=s(K1(l.value,t)),f=s(ht(t.datetimeFormats)?t.datetimeFormats:{[l.value]:{}}),p=s(ht(t.numberFormats)?t.numberFormats:{[l.value]:{}});let m=e?e.missingWarn:_t(t.missingWarn)||Ol(t.missingWarn)?t.missingWarn:!0,g=e?e.fallbackWarn:_t(t.fallbackWarn)||Ol(t.fallbackWarn)?t.fallbackWarn:!0,v=e?e.fallbackRoot:_t(t.fallbackRoot)?t.fallbackRoot:!0,b=!!t.fallbackFormat,w=$t(t.missing)?t.missing:null,x=$t(t.missing)?z8(t.missing):null,C=$t(t.postTranslation)?t.postTranslation:null,E=e?e.warnHtmlMessage:_t(t.warnHtmlMessage)?t.warnHtmlMessage:!0,k=!!t.escapeParameter;const T=e?e.modifiers:ht(t.modifiers)?t.modifiers:{};let _=t.pluralRules||e&&e.pluralRules,A;A=(()=>{r&&m8(null);const $={version:oW,locale:l.value,fallbackLocale:u.value,messages:c.value,modifiers:T,pluralRules:_,missing:x===null?void 0:x,missingWarn:m,fallbackWarn:g,fallbackFormat:b,unresolving:!0,postTranslation:C===null?void 0:C,warnHtmlMessage:E,escapeParameter:k,messageResolver:t.messageResolver,messageCompiler:t.messageCompiler,__meta:{framework:"vue"}};$.datetimeFormats=f.value,$.numberFormats=p.value,$.__datetimeFormatters=ht(A)?A.__datetimeFormatters:void 0,$.__numberFormatters=ht(A)?A.__numberFormatters:void 0,process.env.NODE_ENV!=="production"&&($.__v_emitter=ht(A)?A.__v_emitter:void 0);const ne=DU($);return r&&m8(ne),ne})(),hc(A,l.value,u.value);function O(){return[l.value,u.value,c.value,f.value,p.value]}const B=o.computed({get:()=>l.value,set:$=>{l.value=$,A.locale=l.value}}),H=o.computed({get:()=>u.value,set:$=>{u.value=$,A.fallbackLocale=u.value,hc(A,l.value,$)}}),j=o.computed(()=>c.value),Y=o.computed(()=>f.value),N=o.computed(()=>p.value);function U(){return $t(C)?C:null}function P($){C=$,A.postTranslation=$}function L(){return w}function F($){$!==null&&(x=z8($)),w=$,A.missing=x}function R($,ne){return $!=="translate"||!ne.resolvedMessage}const K=($,ne,oe,we,$e,et)=>{O();let Tt;try{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,r||(A.fallbackContext=e?RU():void 0),Tt=$(A)}finally{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,r||(A.fallbackContext=void 0)}if(oe!=="translate exists"&&cn(Tt)&&Tt===sp||oe==="translate exists"&&!Tt){const[ue,je]=ne();if(process.env.NODE_ENV!=="production"&&e&&Oe(ue)&&R(oe,je)&&(v&&(lp(g,ue)||v8(m,ue))&&as(up(fs.FALLBACK_TO_ROOT,{key:ue,type:oe})),process.env.NODE_ENV!=="production")){const{__v_emitter:re}=A;re&&v&&re.emit("fallback",{type:oe,key:ue,to:"global",groupId:`${oe}:${ue}`})}return e&&v?we(e):$e(ue)}else{if(et(Tt))return Tt;throw Qn(Ht.UNEXPECTED_RETURN_TYPE)}};function X(...$){return K(ne=>Reflect.apply(M8,null,[ne,...$]),()=>H1(...$),"translate",ne=>Reflect.apply(ne.t,ne,[...$]),ne=>ne,ne=>Oe(ne))}function ae(...$){const[ne,oe,we]=$;if(we&&!kt(we))throw Qn(Ht.INVALID_ARGUMENT);return X(ne,oe,yn({resolvedMessage:!0},we||{}))}function de(...$){return K(ne=>Reflect.apply(x8,null,[ne,...$]),()=>F1(...$),"datetime format",ne=>Reflect.apply(ne.d,ne,[...$]),()=>ap,ne=>Oe(ne))}function Ee(...$){return K(ne=>Reflect.apply(E8,null,[ne,...$]),()=>$1(...$),"number format",ne=>Reflect.apply(ne.n,ne,[...$]),()=>ap,ne=>Oe(ne))}function ie($){return $.map(ne=>Oe(ne)||cn(ne)||_t(ne)?V8(String(ne)):ne)}const J={normalize:ie,interpolate:$=>$,type:"vnode"};function ee(...$){return K(ne=>{let oe;const we=ne;try{we.processor=J,oe=Reflect.apply(M8,null,[we,...$])}finally{we.processor=null}return oe},()=>H1(...$),"translate",ne=>ne[U1](...$),ne=>[V8(ne)],ne=>en(ne))}function te(...$){return K(ne=>Reflect.apply(E8,null,[ne,...$]),()=>$1(...$),"number format",ne=>ne[j1](...$),$8,ne=>Oe(ne)||en(ne))}function se(...$){return K(ne=>Reflect.apply(x8,null,[ne,...$]),()=>F1(...$),"datetime format",ne=>ne[W1](...$),$8,ne=>Oe(ne)||en(ne))}function pe($){_=$,A.pluralRules=_}function _e($,ne){return K(()=>{if(!$)return!1;const oe=Oe(ne)?ne:l.value,we=We(oe),$e=A.messageResolver(we,$);return cs($e)||Wr($e)||Oe($e)},()=>[$],"translate exists",oe=>Reflect.apply(oe.te,oe,[$,ne]),lW,oe=>_t(oe))}function Ae($){let ne=null;const oe=s8(A,u.value,l.value);for(let we=0;we<oe.length;we++){const $e=c.value[oe[we]]||{},et=A.messageResolver($e,$);if(et!=null){ne=et;break}}return ne}function Ue($){const ne=Ae($);return ne??(e?e.tm($)||{}:{})}function We($){return c.value[$]||{}}function qe($,ne){if(i){const oe={[$]:ne};for(const we in oe)po(oe,we)&&gc(oe[we]);ne=oe[$]}c.value[$]=ne,A.messages=c.value}function At($,ne){c.value[$]=c.value[$]||{};const oe={[$]:ne};if(i)for(const we in oe)po(oe,we)&&gc(oe[we]);ne=oe[$],rp(ne,c.value[$]),A.messages=c.value}function q($){return f.value[$]||{}}function z($,ne){f.value[$]=ne,A.datetimeFormats=f.value,k8(A,$,ne)}function he($,ne){f.value[$]=yn(f.value[$]||{},ne),A.datetimeFormats=f.value,k8(A,$,ne)}function xe($){return p.value[$]||{}}function Pe($,ne){p.value[$]=ne,A.numberFormats=p.value,_8(A,$,ne)}function nt($,ne){p.value[$]=yn(p.value[$]||{},ne),A.numberFormats=p.value,_8(A,$,ne)}H8++,e&&fo&&(o.watch(e.locale,$=>{a&&(l.value=$,A.locale=$,hc(A,l.value,u.value))}),o.watch(e.fallbackLocale,$=>{a&&(u.value=$,A.fallbackLocale=$,hc(A,l.value,u.value))}));const Ke={id:H8,locale:B,fallbackLocale:H,get inheritLocale(){return a},set inheritLocale($){a=$,$&&e&&(l.value=e.locale.value,u.value=e.fallbackLocale.value,hc(A,l.value,u.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:j,get modifiers(){return T},get pluralRules(){return _||{}},get isGlobal(){return r},get missingWarn(){return m},set missingWarn($){m=$,A.missingWarn=m},get fallbackWarn(){return g},set fallbackWarn($){g=$,A.fallbackWarn=g},get fallbackRoot(){return v},set fallbackRoot($){v=$},get fallbackFormat(){return b},set fallbackFormat($){b=$,A.fallbackFormat=b},get warnHtmlMessage(){return E},set warnHtmlMessage($){E=$,A.warnHtmlMessage=$},get escapeParameter(){return k},set escapeParameter($){k=$,A.escapeParameter=$},t:X,getLocaleMessage:We,setLocaleMessage:qe,mergeLocaleMessage:At,getPostTranslationHandler:U,setPostTranslationHandler:P,getMissingHandler:L,setMissingHandler:F,[L8]:pe};return Ke.datetimeFormats=Y,Ke.numberFormats=N,Ke.rt=ae,Ke.te=_e,Ke.tm=Ue,Ke.d=de,Ke.n=Ee,Ke.getDateTimeFormat=q,Ke.setDateTimeFormat=z,Ke.mergeDateTimeFormat=he,Ke.getNumberFormat=xe,Ke.setNumberFormat=Pe,Ke.mergeNumberFormat=nt,Ke[R8]=n,Ke[U1]=ee,Ke[W1]=se,Ke[j1]=te,process.env.NODE_ENV!=="production"&&(Ke[wa]=$=>{A.__v_emitter=$},Ke[mc]=()=>{A.__v_emitter=void 0}),Ke}const U8="vue-i18n: composer properties",X1={"vue-devtools-plugin-vue-i18n":"Vue I18n DevTools","vue-i18n-resource-inspector":"Vue I18n DevTools","vue-i18n-timeline":"Vue I18n"},cW={"vue-i18n-resource-inspector":"Search for scopes ..."},dW={"vue-i18n-timeline":16764185};let Y1;async function fW(t,e){return new Promise((n,r)=>{try{rW({id:"vue-devtools-plugin-vue-i18n",label:X1["vue-devtools-plugin-vue-i18n"],packageName:"vue-i18n",homepage:"https://vue-i18n.intlify.dev",logo:"https://vue-i18n.intlify.dev/vue-i18n-devtools-logo.png",componentStateTypes:[U8],app:t},i=>{Y1=i,i.on.visitComponentTree(({componentInstance:a,treeNode:l})=>{pW(a,l,e)}),i.on.inspectComponent(({componentInstance:a,instanceData:l})=>{a.vnode.el&&a.vnode.el.__VUE_I18N__&&l&&(e.mode==="legacy"?a.vnode.el.__VUE_I18N__!==e.global.__composer&&j8(l,a.vnode.el.__VUE_I18N__):j8(l,a.vnode.el.__VUE_I18N__))}),i.addInspector({id:"vue-i18n-resource-inspector",label:X1["vue-i18n-resource-inspector"],icon:"language",treeFilterPlaceholder:cW["vue-i18n-resource-inspector"]}),i.on.getInspectorTree(a=>{a.app===t&&a.inspectorId==="vue-i18n-resource-inspector"&&bW(a,e)});const s=new Map;i.on.getInspectorState(async a=>{if(a.app===t&&a.inspectorId==="vue-i18n-resource-inspector")if(i.unhighlightElement(),wW(a,e),a.nodeId==="global"){if(!s.has(a.app)){const[l]=await i.getComponentInstances(a.app);s.set(a.app,l)}i.highlightElement(s.get(a.app))}else{const l=yW(a.nodeId,e);l&&i.highlightElement(l)}}),i.on.editInspectorState(a=>{a.app===t&&a.inspectorId==="vue-i18n-resource-inspector"&&CW(a,e)}),i.addTimelineLayer({id:"vue-i18n-timeline",label:X1["vue-i18n-timeline"],color:dW["vue-i18n-timeline"]}),n(!0)})}catch(i){console.error(i),r(!1)}})}function W8(t){return t.type.name||t.type.displayName||t.type.__file||"Anonymous"}function pW(t,e,n){const r=n.mode==="composition"?n.global:n.global.__composer;if(t&&t.vnode.el&&t.vnode.el.__VUE_I18N__&&t.vnode.el.__VUE_I18N__!==r){const i={label:`i18n (${W8(t)} Scope)`,textColor:0,backgroundColor:16764185};e.tags.push(i)}}function j8(t,e){const n=U8;t.state.push({type:n,key:"locale",editable:!0,value:e.locale.value}),t.state.push({type:n,key:"availableLocales",editable:!1,value:e.availableLocales}),t.state.push({type:n,key:"fallbackLocale",editable:!0,value:e.fallbackLocale.value}),t.state.push({type:n,key:"inheritLocale",editable:!0,value:e.inheritLocale}),t.state.push({type:n,key:"messages",editable:!1,value:J1(e.messages.value)}),t.state.push({type:n,key:"datetimeFormats",editable:!1,value:e.datetimeFormats.value}),t.state.push({type:n,key:"numberFormats",editable:!1,value:e.numberFormats.value})}function J1(t){const e={};return Object.keys(t).forEach(n=>{const r=t[n];$t(r)&&"source"in r?e[n]=vW(r):cs(r)&&r.loc&&r.loc.source?e[n]=r.loc.source:kt(r)?e[n]=J1(r):e[n]=r}),e}const hW={"<":"<",">":">",'"':""","&":"&"};function mW(t){return t.replace(/[<>"&]/g,gW)}function gW(t){return hW[t]||t}function vW(t){return{_custom:{type:"function",display:`<span>ƒ</span> ${t.source?`("${mW(t.source)}")`:"(?)"}`}}}function bW(t,e){t.rootNodes.push({id:"global",label:"Global Scope"});const n=e.mode==="composition"?e.global:e.global.__composer;for(const[r,i]of e.__instances){const s=e.mode==="composition"?i:i.__composer;n!==s&&t.rootNodes.push({id:s.id.toString(),label:`${W8(r)} Scope`})}}function yW(t,e){let n=null;if(t!=="global"){for(const[r,i]of e.__instances.entries())if(i.id.toString()===t){n=r;break}}return n}function q8(t,e){if(t==="global")return e.mode==="composition"?e.global:e.global.__composer;{const n=Array.from(e.__instances.values()).find(r=>r.id.toString()===t);return n?e.mode==="composition"?n:n.__composer:null}}function wW(t,e){const n=q8(t.nodeId,e);return n&&(t.state=xW(n)),null}function xW(t){const e={},n="Locale related info",r=[{type:n,key:"locale",editable:!0,value:t.locale.value},{type:n,key:"fallbackLocale",editable:!0,value:t.fallbackLocale.value},{type:n,key:"availableLocales",editable:!1,value:t.availableLocales},{type:n,key:"inheritLocale",editable:!0,value:t.inheritLocale}];e[n]=r;const i="Locale messages info",s=[{type:i,key:"messages",editable:!1,value:J1(t.messages.value)}];e[i]=s;{const a="Datetime formats info",l=[{type:a,key:"datetimeFormats",editable:!1,value:t.datetimeFormats.value}];e[a]=l;const u="Datetime formats info",c=[{type:u,key:"numberFormats",editable:!1,value:t.numberFormats.value}];e[u]=c}return e}function vc(t,e){if(Y1){let n;e&&"groupId"in e&&(n=e.groupId,delete e.groupId),Y1.addTimelineEvent({layerId:"vue-i18n-timeline",event:{title:t,groupId:n,time:Date.now(),meta:{},data:e||{},logType:t==="compile-error"?"error":t==="fallback"||t==="missing"?"warning":"default"}})}}function CW(t,e){const n=q8(t.nodeId,e);if(n){const[r]=t.path;r==="locale"&&Oe(t.state.value)?n.locale.value=t.state.value:r==="fallbackLocale"&&(Oe(t.state.value)||en(t.state.value)||kt(t.state.value))?n.fallbackLocale.value=t.state.value:r==="inheritLocale"&&_t(t.state.value)&&(n.inheritLocale=t.state.value)}}function kW(t){const e=Oe(t.locale)?t.locale:pc,n=Oe(t.fallbackLocale)||en(t.fallbackLocale)||ht(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:e,r=$t(t.missing)?t.missing:void 0,i=_t(t.silentTranslationWarn)||Ol(t.silentTranslationWarn)?!t.silentTranslationWarn:!0,s=_t(t.silentFallbackWarn)||Ol(t.silentFallbackWarn)?!t.silentFallbackWarn:!0,a=_t(t.fallbackRoot)?t.fallbackRoot:!0,l=!!t.formatFallbackMessages,u=ht(t.modifiers)?t.modifiers:{},c=t.pluralizationRules,f=$t(t.postTranslation)?t.postTranslation:void 0,p=Oe(t.warnHtmlInMessage)?t.warnHtmlInMessage!=="off":!0,m=!!t.escapeParameterHtml,g=_t(t.sync)?t.sync:!0;let v=t.messages;if(ht(t.sharedMessages)){const T=t.sharedMessages;v=Object.keys(T).reduce((A,V)=>{const O=A[V]||(A[V]={});return yn(O,T[V]),A},v||{})}const{__i18n:b,__root:w,__injectWithOption:x}=t,C=t.datetimeFormats,E=t.numberFormats,k=t.flatJson;return{locale:e,fallbackLocale:n,messages:v,flatJson:k,datetimeFormats:C,numberFormats:E,missing:r,missingWarn:i,fallbackWarn:s,fallbackRoot:a,fallbackFormat:l,modifiers:u,pluralRules:c,postTranslation:f,warnHtmlMessage:p,escapeParameter:m,messageResolver:t.messageResolver,inheritLocale:g,__i18n:b,__root:w,__injectWithOption:x}}function Z1(t={}){const e=G1(kW(t)),{__extender:n}=t,r={id:e.id,get locale(){return e.locale.value},set locale(i){e.locale.value=i},get fallbackLocale(){return e.fallbackLocale.value},set fallbackLocale(i){e.fallbackLocale.value=i},get messages(){return e.messages.value},get datetimeFormats(){return e.datetimeFormats.value},get numberFormats(){return e.numberFormats.value},get availableLocales(){return e.availableLocales},get missing(){return e.getMissingHandler()},set missing(i){e.setMissingHandler(i)},get silentTranslationWarn(){return _t(e.missingWarn)?!e.missingWarn:e.missingWarn},set silentTranslationWarn(i){e.missingWarn=_t(i)?!i:i},get silentFallbackWarn(){return _t(e.fallbackWarn)?!e.fallbackWarn:e.fallbackWarn},set silentFallbackWarn(i){e.fallbackWarn=_t(i)?!i:i},get modifiers(){return e.modifiers},get formatFallbackMessages(){return e.fallbackFormat},set formatFallbackMessages(i){e.fallbackFormat=i},get postTranslation(){return e.getPostTranslationHandler()},set postTranslation(i){e.setPostTranslationHandler(i)},get sync(){return e.inheritLocale},set sync(i){e.inheritLocale=i},get warnHtmlInMessage(){return e.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(i){e.warnHtmlMessage=i!=="off"},get escapeParameterHtml(){return e.escapeParameter},set escapeParameterHtml(i){e.escapeParameter=i},get pluralizationRules(){return e.pluralRules||{}},__composer:e,t(...i){return Reflect.apply(e.t,e,[...i])},rt(...i){return Reflect.apply(e.rt,e,[...i])},tc(...i){const[s,a,l]=i,u={plural:1};let c=null,f=null;if(process.env.NODE_ENV!=="production"&&e8(up(fs.DEPRECATE_TC)),!Oe(s))throw Qn(Ht.INVALID_ARGUMENT);const p=s;return Oe(a)?u.locale=a:cn(a)?u.plural=a:en(a)?c=a:ht(a)&&(f=a),Oe(l)?u.locale=l:en(l)?c=l:ht(l)&&(f=l),Reflect.apply(e.t,e,[p,c||f||{},u])},te(i,s){return e.te(i,s)},tm(i){return e.tm(i)},getLocaleMessage(i){return e.getLocaleMessage(i)},setLocaleMessage(i,s){e.setLocaleMessage(i,s)},mergeLocaleMessage(i,s){e.mergeLocaleMessage(i,s)},d(...i){return Reflect.apply(e.d,e,[...i])},getDateTimeFormat(i){return e.getDateTimeFormat(i)},setDateTimeFormat(i,s){e.setDateTimeFormat(i,s)},mergeDateTimeFormat(i,s){e.mergeDateTimeFormat(i,s)},n(...i){return Reflect.apply(e.n,e,[...i])},getNumberFormat(i){return e.getNumberFormat(i)},setNumberFormat(i,s){e.setNumberFormat(i,s)},mergeNumberFormat(i,s){e.mergeNumberFormat(i,s)}};return r.__extender=n,process.env.NODE_ENV!=="production"&&(r.__enableEmitter=i=>{const s=e;s[wa]&&s[wa](i)},r.__disableEmitter=()=>{const i=e;i[mc]&&i[mc]()}),r}function EW(t,e,n){return{beforeCreate(){const r=o.getCurrentInstance();if(!r)throw Qn(Ht.UNEXPECTED_ERROR);const i=this.$options;if(i.i18n){const s=i.i18n;if(i.__i18n&&(s.__i18n=i.__i18n),s.__root=e,this===this.$root)this.$i18n=K8(t,s);else{s.__injectWithOption=!0,s.__extender=n.__vueI18nExtend,this.$i18n=Z1(s);const a=this.$i18n;a.__extender&&(a.__disposer=a.__extender(this.$i18n))}}else if(i.__i18n)if(this===this.$root)this.$i18n=K8(t,i);else{this.$i18n=Z1({__i18n:i.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:e});const s=this.$i18n;s.__extender&&(s.__disposer=s.__extender(this.$i18n))}else this.$i18n=t;i.__i18nGlobal&&P8(e,i,i),this.$t=(...s)=>this.$i18n.t(...s),this.$rt=(...s)=>this.$i18n.rt(...s),this.$tc=(...s)=>this.$i18n.tc(...s),this.$te=(s,a)=>this.$i18n.te(s,a),this.$d=(...s)=>this.$i18n.d(...s),this.$n=(...s)=>this.$i18n.n(...s),this.$tm=s=>this.$i18n.tm(s),n.__setInstance(r,this.$i18n)},mounted(){if(process.env.NODE_ENV!=="production"&&this.$el&&this.$i18n){const r=this.$i18n;this.$el.__VUE_I18N__=r.__composer;const i=this.__v_emitter=A1();r.__enableEmitter&&r.__enableEmitter(i),i.on("*",vc)}},unmounted(){const r=o.getCurrentInstance();if(!r)throw Qn(Ht.UNEXPECTED_ERROR);const i=this.$i18n;process.env.NODE_ENV!=="production"&&this.$el&&this.$el.__VUE_I18N__&&(this.__v_emitter&&(this.__v_emitter.off("*",vc),delete this.__v_emitter),this.$i18n&&(i.__disableEmitter&&i.__disableEmitter(),delete this.$el.__VUE_I18N__)),delete this.$t,delete this.$rt,delete this.$tc,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,i.__disposer&&(i.__disposer(),delete i.__disposer,delete i.__extender),n.__deleteInstance(r),delete this.$i18n}}}function K8(t,e){t.locale=e.locale||t.locale,t.fallbackLocale=e.fallbackLocale||t.fallbackLocale,t.missing=e.missing||t.missing,t.silentTranslationWarn=e.silentTranslationWarn||t.silentFallbackWarn,t.silentFallbackWarn=e.silentFallbackWarn||t.silentFallbackWarn,t.formatFallbackMessages=e.formatFallbackMessages||t.formatFallbackMessages,t.postTranslation=e.postTranslation||t.postTranslation,t.warnHtmlInMessage=e.warnHtmlInMessage||t.warnHtmlInMessage,t.escapeParameterHtml=e.escapeParameterHtml||t.escapeParameterHtml,t.sync=e.sync||t.sync,t.__composer[L8](e.pluralizationRules||t.pluralizationRules);const n=K1(t.locale,{messages:e.messages,__i18n:e.__i18n});return Object.keys(n).forEach(r=>t.mergeLocaleMessage(r,n[r])),e.datetimeFormats&&Object.keys(e.datetimeFormats).forEach(r=>t.mergeDateTimeFormat(r,e.datetimeFormats[r])),e.numberFormats&&Object.keys(e.numberFormats).forEach(r=>t.mergeNumberFormat(r,e.numberFormats[r])),t}const Q1={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:t=>t==="parent"||t==="global",default:"parent"},i18n:{type:Object}};function SW({slots:t},e){return e.length===1&&e[0]==="default"?(t.default?t.default():[]).reduce((r,i)=>[...r,...i.type===o.Fragment?i.children:[i]],[]):e.reduce((n,r)=>{const i=t[r];return i&&(n[r]=i()),n},Dt())}function G8(){return o.Fragment}const X8=o.defineComponent({name:"i18n-t",props:yn({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:t=>cn(t)||!isNaN(t)}},Q1),setup(t,e){const{slots:n,attrs:r}=e,i=t.i18n||Pt({useScope:t.scope,__useComponent:!0});return()=>{const s=Object.keys(n).filter(p=>p!=="_"),a=Dt();t.locale&&(a.locale=t.locale),t.plural!==void 0&&(a.plural=Oe(t.plural)?+t.plural:t.plural);const l=SW(e,s),u=i[U1](t.keypath,l,a),c=yn(Dt(),r),f=Oe(t.tag)||kt(t.tag)?t.tag:G8();return o.h(f,c,u)}}});function _W(t){return en(t)&&!Oe(t[0])}function Y8(t,e,n,r){const{slots:i,attrs:s}=e;return()=>{const a={part:!0};let l=Dt();t.locale&&(a.locale=t.locale),Oe(t.format)?a.key=t.format:kt(t.format)&&(Oe(t.format.key)&&(a.key=t.format.key),l=Object.keys(t.format).reduce((m,g)=>n.includes(g)?yn(Dt(),m,{[g]:t.format[g]}):m,Dt()));const u=r(t.value,a,l);let c=[a.key];en(u)?c=u.map((m,g)=>{const v=i[m.type],b=v?v({[m.type]:m.value,index:g,parts:u}):[m.value];return _W(b)&&(b[0].key=`${m.type}-${g}`),b}):Oe(u)&&(c=[u]);const f=yn(Dt(),s),p=Oe(t.tag)||kt(t.tag)?t.tag:G8();return o.h(p,f,c)}}const J8=o.defineComponent({name:"i18n-n",props:yn({value:{type:Number,required:!0},format:{type:[String,Object]}},Q1),setup(t,e){const n=t.i18n||Pt({useScope:t.scope,__useComponent:!0});return Y8(t,e,S8,(...r)=>n[j1](...r))}}),Z8=o.defineComponent({name:"i18n-d",props:yn({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},Q1),setup(t,e){const n=t.i18n||Pt({useScope:t.scope,__useComponent:!0});return Y8(t,e,C8,(...r)=>n[W1](...r))}});function TW(t,e){const n=t;if(t.mode==="composition")return n.__getInstance(e)||t.global;{const r=n.__getInstance(e);return r!=null?r.__composer:t.global.__composer}}function AW(t){const e=a=>{const{instance:l,value:u}=a;if(!l||!l.$)throw Qn(Ht.UNEXPECTED_ERROR);const c=TW(t,l.$),f=Q8(u);return[Reflect.apply(c.t,c,[...N8(f)]),c]};return{created:(a,l)=>{const[u,c]=e(l);fo&&t.global===c&&(a.__i18nWatcher=o.watch(c.locale,()=>{l.instance&&l.instance.$forceUpdate()})),a.__composer=c,a.textContent=u},unmounted:a=>{fo&&a.__i18nWatcher&&(a.__i18nWatcher(),a.__i18nWatcher=void 0,delete a.__i18nWatcher),a.__composer&&(a.__composer=void 0,delete a.__composer)},beforeUpdate:(a,{value:l})=>{if(a.__composer){const u=a.__composer,c=Q8(l);a.textContent=Reflect.apply(u.t,u,[...N8(c)])}},getSSRProps:a=>{const[l]=e(a);return{textContent:l}}}}function Q8(t){if(Oe(t))return{path:t};if(ht(t)){if(!("path"in t))throw Qn(Ht.REQUIRED_VALUE,"path");return t}else throw Qn(Ht.INVALID_VALUE)}function N8(t){const{path:e,locale:n,args:r,choice:i,plural:s}=t,a={},l=r||{};return Oe(n)&&(a.locale=n),cn(i)&&(a.plural=i),cn(s)&&(a.plural=s),[e,l,a]}function MW(t,e,...n){const r=ht(n[0])?n[0]:{};(_t(r.globalInstall)?r.globalInstall:!0)&&([X8.name,"I18nT"].forEach(s=>t.component(s,X8)),[J8.name,"I18nN"].forEach(s=>t.component(s,J8)),[Z8.name,"I18nD"].forEach(s=>t.component(s,Z8))),t.directive("t",AW(e))}const OW=Ho("global-vue-i18n");function BW(t={},e){const n=__VUE_I18N_LEGACY_API__&&_t(t.legacy)?t.legacy:__VUE_I18N_LEGACY_API__,r=_t(t.globalInjection)?t.globalInjection:!0,i=new Map,[s,a]=IW(t,n),l=Ho(process.env.NODE_ENV!=="production"?"vue-i18n":"");function u(m){return i.get(m)||null}function c(m,g){i.set(m,g)}function f(m){i.delete(m)}const p={get mode(){return __VUE_I18N_LEGACY_API__&&n?"legacy":"composition"},async install(m,...g){if(process.env.NODE_ENV!=="production"&&(m.__VUE_I18N__=p),m.__VUE_I18N_SYMBOL__=l,m.provide(m.__VUE_I18N_SYMBOL__,p),ht(g[0])){const w=g[0];p.__composerExtend=w.__composerExtend,p.__vueI18nExtend=w.__vueI18nExtend}let v=null;!n&&r&&(v=HW(m,p.global)),__VUE_I18N_FULL_INSTALL__&&MW(m,p,...g),__VUE_I18N_LEGACY_API__&&n&&m.mixin(EW(a,a.__composer,p));const b=m.unmount;if(m.unmount=()=>{v&&v(),p.dispose(),b()},process.env.NODE_ENV!=="production"){if(!await fW(m,p))throw Qn(Ht.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN);const x=A1();if(n){const C=a;C.__enableEmitter&&C.__enableEmitter(x)}else{const C=a;C[wa]&&C[wa](x)}x.on("*",vc)}},get global(){return a},dispose(){s.stop()},__instances:i,__getInstance:u,__setInstance:c,__deleteInstance:f};return p}function Pt(t={}){const e=o.getCurrentInstance();if(e==null)throw Qn(Ht.MUST_BE_CALL_SETUP_TOP);if(!e.isCE&&e.appContext.app!=null&&!e.appContext.app.__VUE_I18N_SYMBOL__)throw Qn(Ht.NOT_INSTALLED);const n=LW(e),r=DW(n),i=D8(e),s=RW(t,i);if(s==="global")return P8(r,t,i),r;if(s==="parent"){let u=PW(n,e,t.__useComponent);return u==null&&(process.env.NODE_ENV!=="production"&&as(up(fs.NOT_FOUND_PARENT_SCOPE)),u=r),u}const a=n;let l=a.__getInstance(e);if(l==null){const u=yn({},t);"__i18n"in i&&(u.__i18n=i.__i18n),r&&(u.__root=r),l=G1(u),a.__composerExtend&&(l[q1]=a.__composerExtend(l)),FW(a,e,l),a.__setInstance(e,l)}return l}function IW(t,e,n){const r=o.effectScope(),i=__VUE_I18N_LEGACY_API__&&e?r.run(()=>Z1(t)):r.run(()=>G1(t));if(i==null)throw Qn(Ht.UNEXPECTED_ERROR);return[r,i]}function LW(t){const e=o.inject(t.isCE?OW:t.appContext.app.__VUE_I18N_SYMBOL__);if(!e)throw Qn(t.isCE?Ht.NOT_INSTALLED_WITH_PROVIDE:Ht.UNEXPECTED_ERROR);return e}function RW(t,e){return tp(t)?"__i18n"in e?"local":"global":t.useScope?t.useScope:"local"}function DW(t){return t.mode==="composition"?t.global:t.global.__composer}function PW(t,e,n=!1){let r=null;const i=e.root;let s=VW(e,n);for(;s!=null;){const a=t;if(t.mode==="composition")r=a.__getInstance(s);else if(__VUE_I18N_LEGACY_API__){const l=a.__getInstance(s);l!=null&&(r=l.__composer,n&&r&&!r[R8]&&(r=null))}if(r!=null||i===s)break;s=s.parent}return r}function VW(t,e=!1){return t==null?null:e&&t.vnode.ctx||t.parent}function FW(t,e,n){let r=null;o.onMounted(()=>{if(process.env.NODE_ENV!=="production"&&e.vnode.el){e.vnode.el.__VUE_I18N__=n,r=A1();const i=n;i[wa]&&i[wa](r),r.on("*",vc)}},e),o.onUnmounted(()=>{const i=n;process.env.NODE_ENV!=="production"&&e.vnode.el&&e.vnode.el.__VUE_I18N__&&(r&&r.off("*",vc),i[mc]&&i[mc](),delete e.vnode.el.__VUE_I18N__),t.__deleteInstance(e);const s=i[q1];s&&(s(),delete i[q1])},e)}const $W=["locale","fallbackLocale","availableLocales"],e5=["t","rt","d","n","tm","te"];function HW(t,e){const n=Object.create(null);return $W.forEach(i=>{const s=Object.getOwnPropertyDescriptor(e,i);if(!s)throw Qn(Ht.UNEXPECTED_ERROR);const a=o.isRef(s.value)?{get(){return s.value.value},set(l){s.value.value=l}}:{get(){return s.get&&s.get()}};Object.defineProperty(n,i,a)}),t.config.globalProperties.$i18n=n,e5.forEach(i=>{const s=Object.getOwnPropertyDescriptor(e,i);if(!s||!s.value)throw Qn(Ht.UNEXPECTED_ERROR);Object.defineProperty(t.config.globalProperties,`$${i}`,s)}),()=>{delete t.config.globalProperties.$i18n,e5.forEach(i=>{delete t.config.globalProperties[`$${i}`]})}}if(iW(),MU(aU),OU(EU),BU(s8),process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__){const t=ba();t.__INTLIFY__=!0,lU(t.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}process.env.NODE_ENV;const zW={class:"ml-1 h-full"},UW=o.defineComponent({__name:"FontSizeMenuButton",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,{t:n}=Pt(),r=o.computed(()=>e.editor.extensionStorage["base-kit"].mode===Te.EDITOR),i=o.inject("fontSize"),s=o.computed(()=>{const u={title:n("editor.fontSize.default.tooltip"),isActive:()=>!1};if(r.value)return e.items.find(p=>p.isActive()&&p.title)||u;const c=e.items.find(f=>f.title===i.value);return c||(i.value?{title:i.value}:u)}),a=(u,c)=>{u===n("editor.fontSize.default.tooltip")?(e.editor.commands.unsetFontSize(),i.value=null):(i.value=u,e.editor.commands.setFontSize(u)),c(),e.editor.commands.setForceCloseBubble(!0)};e.editor.on("selectionUpdate",({editor:u})=>{u.state.selection.empty&&e.editor.commands.resetForceCloseBubble()});const l=u=>u===n("editor.fontSize.default.tooltip")?u:u.replace("px","");return(u,c)=>{const f=S1;return o.openBlock(),o.createBlock(ga,{disabled:u.disabled,tooltip:u.tooltip,title:s.value.title,btn_class:`min-w-20 ${u.customClass}`,class:"inside-toolbar"},{default:o.withCtx(()=>[o.createVNode(o.unref(nz),{class:"h-72"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.items,(p,m)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:m},[o.createVNode(o.unref(Ml),{checked:s.value.title===p.title,onClick:()=>a(p.title,p.action)},{default:o.withCtx(()=>[o.createElementVNode("div",zW,o.toDisplayString(l(p.title)),1)]),_:2},1032,["checked","onClick"]),p.title===o.unref(n)("editor.fontSize.default.tooltip")&&u.showDefaultDivider?(o.openBlock(),o.createBlock(f,{key:0})):o.createCommentVNode("",!0)],64))),128))]),_:1})]),_:1},8,["disabled","tooltip","title","btn_class"])}}}),WW=["paragraph","heading"],jW=["paragraph","heading"];function t5(t,e,n,r){const{selection:i,doc:s}=t;if(!i||!s||!(i instanceof Ie||i instanceof An))return t;const{from:a,to:l}=i,u=[];return s.nodesBetween(a,l,(c,f)=>{const p=c.type;return r.includes(p.name)&&c.attrs[e]!==n&&u.push({node:c,pos:f,nodeType:p}),!0}),u.length&&u.forEach(c=>{const{node:f,pos:p,nodeType:m}=c,g={...f.attrs,[e]:n};t.setNodeMarkup(p,m,g,f.marks)}),t}function n5(t,e){return t5(t,"fontSize",e,WW)}function r5(t,e){return t5(t,"fontFamily",e,jW)}const o5=Qe.create({name:"fontSize",addOptions(){return{...this.parent?.(),types:["textStyle"],fontSizes:[...ug],button({editor:t,extension:e,t:n}){const r=e.options?.fontSizes||[],i=[hl,...r].map(a=>({title:a===hl?n("editor.fontSize.default.tooltip"):String(a),isActive:()=>{const u=t.getAttributes("textStyle").fontSize??t.getAttributes("paragraph").fontSize??t.getAttributes("heading").fontSize;return a===hl&&!u?!0:String(a)===String(u)},action:()=>{if(a===hl){t.chain().focus().unsetFontSize().run();return}t.chain().focus().setFontSize(String(a)).run()},disabled:!t.can().setFontSize(String(a)),divider:a===hl||!1,default:a===hl||!1})),s=i.filter(a=>a.disabled).length===i.length;return{component:UW,componentProps:{editor:t,tooltip:n("editor.fontSize.tooltip"),disabled:s,items:i}}}}},addGlobalAttributes(){return[{types:["paragraph","heading","textStyle"],attributes:{fontSize:{default:null,parseHTML:t=>t.style.fontSize.replace(/['"]+/g,""),renderHTML:t=>t.fontSize?{style:`font-size: ${t.fontSize}`}:{}}}}]},addCommands(){return{setFontSize:t=>({chain:e})=>e().setMark("textStyle",{fontSize:t}).command(({tr:n})=>(n5(n,t),!0)).run(),unsetFontSize:()=>({chain:t})=>t().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().command(({tr:e})=>(n5(e,null),!0)).run()}},addStorage(){return{value:null}},onUpdate(){this.storage.value=this.editor.getAttributes("textStyle").fontSize??this.editor.getAttributes("paragraph").fontSize??this.editor.getAttributes("heading").fontSize},onSelectionUpdate(){this.storage.value=this.editor.getAttributes("textStyle").fontSize??this.editor.getAttributes("paragraph").fontSize??this.editor.getAttributes("heading").fontSize}}),qW=t=>{if(!t.children.length)return;const e=t.querySelectorAll("span");e&&e.forEach(n=>{var r,i;const s=n.getAttribute("style"),a=(i=(r=n.parentElement)===null||r===void 0?void 0:r.closest("span"))===null||i===void 0?void 0:i.getAttribute("style");n.setAttribute("style",`${a};${s}`)})},KW=Fn.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!1}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&qW(t),{}):!1}]},renderHTML({HTMLAttributes:t}){return["span",wt(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({tr:t})=>{const{selection:e}=t;return t.doc.nodesBetween(e.from,e.to,(n,r)=>{if(n.isTextblock)return!0;n.marks.filter(i=>i.type===this.type).some(i=>Object.values(i.attrs).some(s=>!!s))||t.removeMark(r,r+n.nodeSize,this.type)}),!0}}}}),GW=Qe.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;return(e=t.style.color)===null||e===void 0?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),XW="";function Dl(t,e){e===void 0&&(e={});var n=e.insertAt;if(!(!t||typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",n==="top"&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}const Pl=function(t,e){const{componentPrefix:n=XW}=e||{};t.component(`${n}${this.name}`,this)},N1={};var bc={name:"Checkboard",props:{size:{type:[Number,String],default:8},white:{type:String,default:"#fff"},grey:{type:String,default:"#e6e6e6"}},computed:{bgStyle(){return{"background-image":`url(${JW(this.white,this.grey,this.size)})`}}}};function YW(t,e,n){if(typeof document>"u")return null;const r=document.createElement("canvas");r.width=r.height=n*2;const i=r.getContext("2d");return i?(i.fillStyle=t,i.fillRect(0,0,r.width,r.height),i.fillStyle=e,i.fillRect(0,0,n,n),i.translate(n,n),i.fillRect(0,0,n,n),r.toDataURL()):null}function JW(t,e,n){const r=`${t},${e},${n}`;if(N1[r])return N1[r];const i=YW(t,e,n);return N1[r]=i,i}function ZW(t,e,n,r,i,s){return o.openBlock(),o.createElementBlock("div",{class:"vc-checkerboard",style:o.normalizeStyle(s.bgStyle)},null,4)}var QW=".vc-checkerboard{background-size:contain;bottom:0;left:0;position:absolute;right:0;top:0}";Dl(QW),bc.render=ZW,bc.__file="src/components/checkboard/checkboard.vue",bc.install=Pl;var cp={name:"Alpha",components:{Checkboard:bc},props:{value:Object,onChange:Function},computed:{colors(){return this.value},gradientColor(){const{rgba:t}=this.colors,e=[t.r,t.g,t.b].join(",");return`linear-gradient(to right, rgba(${e}, 0) 0%, rgba(${e}, 1) 100%)`}},methods:{handleChange(t,e){!e&&t.preventDefault();const{container:n}=this.$refs;if(!n)return;const r=n.clientWidth,i=n.getBoundingClientRect().left+window.pageXOffset,a=(t.pageX||(t.touches?t.touches[0].pageX:0))-i;let l;a<0?l=0:a>r?l=1:l=Math.round(a*100/r)/100,this.colors.a!==l&&this.$emit("change",{h:this.colors.hsl.h,s:this.colors.hsl.s,l:this.colors.hsl.l,a:l,source:"rgba"})},handleMouseDown(t){this.handleChange(t,!0),window.addEventListener("mousemove",this.handleChange),window.addEventListener("mouseup",this.handleMouseUp)},handleMouseUp(){this.unbindEventListeners()},unbindEventListeners(){window.removeEventListener("mousemove",this.handleChange),window.removeEventListener("mouseup",this.handleMouseUp)}}};const NW={class:"vc-alpha"},ej={class:"vc-alpha-checkboard-wrap"},tj=[o.createElementVNode("div",{class:"vc-alpha-picker"},null,-1)];function nj(t,e,n,r,i,s){const a=o.resolveComponent("Checkboard");return o.openBlock(),o.createElementBlock("div",NW,[o.createElementVNode("div",ej,[o.createVNode(a)]),o.createElementVNode("div",{class:"vc-alpha-gradient",style:o.normalizeStyle({background:s.gradientColor})},null,4),o.createElementVNode("div",{ref:"container",class:"vc-alpha-container",onMousedown:e[0]||(e[0]=(...l)=>s.handleMouseDown&&s.handleMouseDown(...l)),onTouchmove:e[1]||(e[1]=(...l)=>s.handleChange&&s.handleChange(...l)),onTouchstart:e[2]||(e[2]=(...l)=>s.handleChange&&s.handleChange(...l))},[o.createElementVNode("div",{class:"vc-alpha-pointer",style:o.normalizeStyle({left:`${s.colors.a*100}%`})},tj,4)],544)])}var rj=".vc-alpha,.vc-alpha-checkboard-wrap{bottom:0;left:0;position:absolute;right:0;top:0}.vc-alpha-checkboard-wrap{overflow:hidden}.vc-alpha-gradient{bottom:0;left:0;position:absolute;right:0;top:0}.vc-alpha-container{cursor:pointer;height:100%;margin:0 3px;position:relative;z-index:2}.vc-alpha-pointer{position:absolute;z-index:2}.vc-alpha-picker{background:#fff;border-radius:1px;box-shadow:0 0 2px rgba(0,0,0,.6);cursor:pointer;height:8px;margin-top:1px;transform:translateX(-2px);width:4px}";Dl(rj),cp.render=nj,cp.__file="src/components/alpha/alpha.vue",cp.install=Pl;function In(t,e){oj(t)&&(t="100%");var n=ij(t);return t=e===360?t:Math.min(e,Math.max(0,parseFloat(t))),n&&(t=parseInt(String(t*e),10)/100),Math.abs(t-e)<1e-6?1:(e===360?t=(t<0?t%e+e:t%e)/parseFloat(String(e)):t=t%e/parseFloat(String(e)),t)}function dp(t){return Math.min(1,Math.max(0,t))}function oj(t){return typeof t=="string"&&t.indexOf(".")!==-1&&parseFloat(t)===1}function ij(t){return typeof t=="string"&&t.indexOf("%")!==-1}function i5(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function fp(t){return t<=1?"".concat(Number(t)*100,"%"):t}function xa(t){return t.length===1?"0"+t:String(t)}function sj(t,e,n){return{r:In(t,255)*255,g:In(e,255)*255,b:In(n,255)*255}}function s5(t,e,n){t=In(t,255),e=In(e,255),n=In(n,255);var r=Math.max(t,e,n),i=Math.min(t,e,n),s=0,a=0,l=(r+i)/2;if(r===i)a=0,s=0;else{var u=r-i;switch(a=l>.5?u/(2-r-i):u/(r+i),r){case t:s=(e-n)/u+(e<n?6:0);break;case e:s=(n-t)/u+2;break;case n:s=(t-e)/u+4;break}s/=6}return{h:s,s:a,l}}function ev(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*(6*n):n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function aj(t,e,n){var r,i,s;if(t=In(t,360),e=In(e,100),n=In(n,100),e===0)i=n,s=n,r=n;else{var a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;r=ev(l,a,t+1/3),i=ev(l,a,t),s=ev(l,a,t-1/3)}return{r:r*255,g:i*255,b:s*255}}function a5(t,e,n){t=In(t,255),e=In(e,255),n=In(n,255);var r=Math.max(t,e,n),i=Math.min(t,e,n),s=0,a=r,l=r-i,u=r===0?0:l/r;if(r===i)s=0;else{switch(r){case t:s=(e-n)/l+(e<n?6:0);break;case e:s=(n-t)/l+2;break;case n:s=(t-e)/l+4;break}s/=6}return{h:s,s:u,v:a}}function lj(t,e,n){t=In(t,360)*6,e=In(e,100),n=In(n,100);var r=Math.floor(t),i=t-r,s=n*(1-e),a=n*(1-i*e),l=n*(1-(1-i)*e),u=r%6,c=[n,a,s,s,l,n][u],f=[l,n,n,a,s,s][u],p=[s,s,l,n,n,a][u];return{r:c*255,g:f*255,b:p*255}}function l5(t,e,n,r){var i=[xa(Math.round(t).toString(16)),xa(Math.round(e).toString(16)),xa(Math.round(n).toString(16))];return r&&i[0].startsWith(i[0].charAt(1))&&i[1].startsWith(i[1].charAt(1))&&i[2].startsWith(i[2].charAt(1))?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function uj(t,e,n,r,i){var s=[xa(Math.round(t).toString(16)),xa(Math.round(e).toString(16)),xa(Math.round(n).toString(16)),xa(cj(r))];return i&&s[0].startsWith(s[0].charAt(1))&&s[1].startsWith(s[1].charAt(1))&&s[2].startsWith(s[2].charAt(1))&&s[3].startsWith(s[3].charAt(1))?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}function cj(t){return Math.round(parseFloat(t)*255).toString(16)}function u5(t){return Cr(t)/255}function Cr(t){return parseInt(t,16)}function dj(t){return{r:t>>16,g:(t&65280)>>8,b:t&255}}var tv={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function fj(t){var e={r:0,g:0,b:0},n=1,r=null,i=null,s=null,a=!1,l=!1;return typeof t=="string"&&(t=mj(t)),typeof t=="object"&&(vi(t.r)&&vi(t.g)&&vi(t.b)?(e=sj(t.r,t.g,t.b),a=!0,l=String(t.r).substr(-1)==="%"?"prgb":"rgb"):vi(t.h)&&vi(t.s)&&vi(t.v)?(r=fp(t.s),i=fp(t.v),e=lj(t.h,r,i),a=!0,l="hsv"):vi(t.h)&&vi(t.s)&&vi(t.l)&&(r=fp(t.s),s=fp(t.l),e=aj(t.h,r,s),a=!0,l="hsl"),Object.prototype.hasOwnProperty.call(t,"a")&&(n=t.a)),n=i5(n),{ok:a,format:t.format||l,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:n}}var pj="[-\\+]?\\d+%?",hj="[-\\+]?\\d*\\.\\d+%?",ps="(?:".concat(hj,")|(?:").concat(pj,")"),nv="[\\s|\\(]+(".concat(ps,")[,|\\s]+(").concat(ps,")[,|\\s]+(").concat(ps,")\\s*\\)?"),rv="[\\s|\\(]+(".concat(ps,")[,|\\s]+(").concat(ps,")[,|\\s]+(").concat(ps,")[,|\\s]+(").concat(ps,")\\s*\\)?"),ho={CSS_UNIT:new RegExp(ps),rgb:new RegExp("rgb"+nv),rgba:new RegExp("rgba"+rv),hsl:new RegExp("hsl"+nv),hsla:new RegExp("hsla"+rv),hsv:new RegExp("hsv"+nv),hsva:new RegExp("hsva"+rv),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function mj(t){if(t=t.trim().toLowerCase(),t.length===0)return!1;var e=!1;if(tv[t])t=tv[t],e=!0;else if(t==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n=ho.rgb.exec(t);return n?{r:n[1],g:n[2],b:n[3]}:(n=ho.rgba.exec(t),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=ho.hsl.exec(t),n?{h:n[1],s:n[2],l:n[3]}:(n=ho.hsla.exec(t),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=ho.hsv.exec(t),n?{h:n[1],s:n[2],v:n[3]}:(n=ho.hsva.exec(t),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=ho.hex8.exec(t),n?{r:Cr(n[1]),g:Cr(n[2]),b:Cr(n[3]),a:u5(n[4]),format:e?"name":"hex8"}:(n=ho.hex6.exec(t),n?{r:Cr(n[1]),g:Cr(n[2]),b:Cr(n[3]),format:e?"name":"hex"}:(n=ho.hex4.exec(t),n?{r:Cr(n[1]+n[1]),g:Cr(n[2]+n[2]),b:Cr(n[3]+n[3]),a:u5(n[4]+n[4]),format:e?"name":"hex8"}:(n=ho.hex3.exec(t),n?{r:Cr(n[1]+n[1]),g:Cr(n[2]+n[2]),b:Cr(n[3]+n[3]),format:e?"name":"hex"}:!1)))))))))}function vi(t){return!!ho.CSS_UNIT.exec(String(t))}var gj=function(){function t(e,n){e===void 0&&(e=""),n===void 0&&(n={});var r;if(e instanceof t)return e;typeof e=="number"&&(e=dj(e)),this.originalInput=e;var i=fj(e);this.originalInput=e,this.r=i.r,this.g=i.g,this.b=i.b,this.a=i.a,this.roundA=Math.round(100*this.a)/100,this.format=(r=n.format)!==null&&r!==void 0?r:i.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=i.ok}return t.prototype.isDark=function(){return this.getBrightness()<128},t.prototype.isLight=function(){return!this.isDark()},t.prototype.getBrightness=function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},t.prototype.getLuminance=function(){var e=this.toRgb(),n,r,i,s=e.r/255,a=e.g/255,l=e.b/255;return s<=.03928?n=s/12.92:n=Math.pow((s+.055)/1.055,2.4),a<=.03928?r=a/12.92:r=Math.pow((a+.055)/1.055,2.4),l<=.03928?i=l/12.92:i=Math.pow((l+.055)/1.055,2.4),.2126*n+.7152*r+.0722*i},t.prototype.getAlpha=function(){return this.a},t.prototype.setAlpha=function(e){return this.a=i5(e),this.roundA=Math.round(100*this.a)/100,this},t.prototype.isMonochrome=function(){var e=this.toHsl().s;return e===0},t.prototype.toHsv=function(){var e=a5(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}},t.prototype.toHsvString=function(){var e=a5(this.r,this.g,this.b),n=Math.round(e.h*360),r=Math.round(e.s*100),i=Math.round(e.v*100);return this.a===1?"hsv(".concat(n,", ").concat(r,"%, ").concat(i,"%)"):"hsva(".concat(n,", ").concat(r,"%, ").concat(i,"%, ").concat(this.roundA,")")},t.prototype.toHsl=function(){var e=s5(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}},t.prototype.toHslString=function(){var e=s5(this.r,this.g,this.b),n=Math.round(e.h*360),r=Math.round(e.s*100),i=Math.round(e.l*100);return this.a===1?"hsl(".concat(n,", ").concat(r,"%, ").concat(i,"%)"):"hsla(".concat(n,", ").concat(r,"%, ").concat(i,"%, ").concat(this.roundA,")")},t.prototype.toHex=function(e){return e===void 0&&(e=!1),l5(this.r,this.g,this.b,e)},t.prototype.toHexString=function(e){return e===void 0&&(e=!1),"#"+this.toHex(e)},t.prototype.toHex8=function(e){return e===void 0&&(e=!1),uj(this.r,this.g,this.b,this.a,e)},t.prototype.toHex8String=function(e){return e===void 0&&(e=!1),"#"+this.toHex8(e)},t.prototype.toHexShortString=function(e){return e===void 0&&(e=!1),this.a===1?this.toHexString(e):this.toHex8String(e)},t.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},t.prototype.toRgbString=function(){var e=Math.round(this.r),n=Math.round(this.g),r=Math.round(this.b);return this.a===1?"rgb(".concat(e,", ").concat(n,", ").concat(r,")"):"rgba(".concat(e,", ").concat(n,", ").concat(r,", ").concat(this.roundA,")")},t.prototype.toPercentageRgb=function(){var e=function(n){return"".concat(Math.round(In(n,255)*100),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},t.prototype.toPercentageRgbString=function(){var e=function(n){return Math.round(In(n,255)*100)};return this.a===1?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},t.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var e="#"+l5(this.r,this.g,this.b,!1),n=0,r=Object.entries(tv);n<r.length;n++){var i=r[n],s=i[0],a=i[1];if(e===a)return s}return!1},t.prototype.toString=function(e){var n=!!e;e=e??this.format;var r=!1,i=this.a<1&&this.a>=0,s=!n&&i&&(e.startsWith("hex")||e==="name");return s?e==="name"&&this.a===0?this.toName():this.toRgbString():(e==="rgb"&&(r=this.toRgbString()),e==="prgb"&&(r=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(r=this.toHexString()),e==="hex3"&&(r=this.toHexString(!0)),e==="hex4"&&(r=this.toHex8String(!0)),e==="hex8"&&(r=this.toHex8String()),e==="name"&&(r=this.toName()),e==="hsl"&&(r=this.toHslString()),e==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},t.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},t.prototype.clone=function(){return new t(this.toString())},t.prototype.lighten=function(e){e===void 0&&(e=10);var n=this.toHsl();return n.l+=e/100,n.l=dp(n.l),new t(n)},t.prototype.brighten=function(e){e===void 0&&(e=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(e/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(e/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(e/100)))),new t(n)},t.prototype.darken=function(e){e===void 0&&(e=10);var n=this.toHsl();return n.l-=e/100,n.l=dp(n.l),new t(n)},t.prototype.tint=function(e){return e===void 0&&(e=10),this.mix("white",e)},t.prototype.shade=function(e){return e===void 0&&(e=10),this.mix("black",e)},t.prototype.desaturate=function(e){e===void 0&&(e=10);var n=this.toHsl();return n.s-=e/100,n.s=dp(n.s),new t(n)},t.prototype.saturate=function(e){e===void 0&&(e=10);var n=this.toHsl();return n.s+=e/100,n.s=dp(n.s),new t(n)},t.prototype.greyscale=function(){return this.desaturate(100)},t.prototype.spin=function(e){var n=this.toHsl(),r=(n.h+e)%360;return n.h=r<0?360+r:r,new t(n)},t.prototype.mix=function(e,n){n===void 0&&(n=50);var r=this.toRgb(),i=new t(e).toRgb(),s=n/100,a={r:(i.r-r.r)*s+r.r,g:(i.g-r.g)*s+r.g,b:(i.b-r.b)*s+r.b,a:(i.a-r.a)*s+r.a};return new t(a)},t.prototype.analogous=function(e,n){e===void 0&&(e=6),n===void 0&&(n=30);var r=this.toHsl(),i=360/n,s=[this];for(r.h=(r.h-(i*e>>1)+720)%360;--e;)r.h=(r.h+i)%360,s.push(new t(r));return s},t.prototype.complement=function(){var e=this.toHsl();return e.h=(e.h+180)%360,new t(e)},t.prototype.monochromatic=function(e){e===void 0&&(e=6);for(var n=this.toHsv(),r=n.h,i=n.s,s=n.v,a=[],l=1/e;e--;)a.push(new t({h:r,s:i,v:s})),s=(s+l)%1;return a},t.prototype.splitcomplement=function(){var e=this.toHsl(),n=e.h;return[this,new t({h:(n+72)%360,s:e.s,l:e.l}),new t({h:(n+216)%360,s:e.s,l:e.l})]},t.prototype.onBackground=function(e){var n=this.toRgb(),r=new t(e).toRgb(),i=n.a+r.a*(1-n.a);return new t({r:(n.r*n.a+r.r*r.a*(1-n.a))/i,g:(n.g*n.a+r.g*r.a*(1-n.a))/i,b:(n.b*n.a+r.b*r.a*(1-n.a))/i,a:i})},t.prototype.triad=function(){return this.polyad(3)},t.prototype.tetrad=function(){return this.polyad(4)},t.prototype.polyad=function(e){for(var n=this.toHsl(),r=n.h,i=[this],s=360/e,a=1;a<e;a++)i.push(new t({h:(r+a*s)%360,s:n.s,l:n.l}));return i},t.prototype.equals=function(e){return this.toRgbString()===new t(e).toRgbString()},t}();function hs(...t){return new gj(...t)}function ov(t,e){const n=t&&t.a;let r;t&&t.hsl?r=hs(t.hsl):t&&t.hex&&t.hex.length>0?r=hs(t.hex):t&&t.hsv?r=hs(t.hsv):t&&t.rgba?r=hs(t.rgba):t&&t.rgb?r=hs(t.rgb):r=hs(t),r&&(r._a===void 0||r._a===null)&&r.setAlpha(n||r.getAlpha());const i=r.toHsl(),s=r.toHsv();return i.s===0&&(s.h=i.h=t.h||t.hsl&&t.hsl.h||e||0),s.v<.0164&&(s.h=t.h||t.hsv&&t.hsv.h||0,s.s=t.s||t.hsv&&t.hsv.s||0),i.l<.01&&(i.h=t.h||t.hsl&&t.hsl.h||0,i.s=t.s||t.hsl&&t.hsl.s||0),{hsl:i,hex:r.toHexString().toUpperCase(),hex8:r.toHex8String().toUpperCase(),rgba:r.toRgb(),hsv:s,oldHue:t.h||e||i.h,source:t.source,a:r.getAlpha()}}var vj={model:{prop:"modelValue",event:"update:modelValue"},props:["modelValue"],data(){return{val:ov(this.modelValue)}},computed:{colors:{get(){return this.val},set(t){this.val=t,this.$emit("update:modelValue",t)}}},watch:{modelValue(t){this.val=ov(t)}},methods:{colorChange(t,e){this.oldHue=this.colors.hsl.h,this.colors=ov(t,e||this.oldHue)},isValidHex(t){return hs(t).isValid},simpleCheckForValidColor(t){const e=["r","g","b","a","h","s","l","v"];let n=0,r=0;for(let i=0;i<e.length;i++){const s=e[i];t[s]&&(n++,isNaN(t[s])||r++)}if(n===r)return t},paletteUpperCase(t){return t.map(e=>e.toUpperCase())},isTransparent(t){return hs(t).getAlpha()===0}}},pp={name:"EditableInput",props:{label:String,labelText:String,desc:String,value:[String,Number],max:Number,min:Number,arrowOffset:{type:Number,default:1}},computed:{val:{get(){return this.value},set(t){if(this.max!==void 0&&+t>this.max)this.$refs.input.value=this.max;else return t}},labelId(){return`input__label__${this.label}__${Math.random().toString().slice(2,5)}`},labelSpanText(){return this.labelText||this.label}},methods:{update(t){this.handleChange(t.target.value)},handleChange(t){const e={};e[this.label]=t,e.hex===void 0&&e["#"]===void 0?this.$emit("change",e):t.length>5&&this.$emit("change",e)},handleKeyDown(t){let{val:e}=this;const n=Number(e);if(n){const r=this.arrowOffset||1;t.keyCode===38&&(e=n+r,this.handleChange(e),t.preventDefault()),t.keyCode===40&&(e=n-r,this.handleChange(e),t.preventDefault())}}}};const bj={class:"vc-editable-input"},yj=["aria-labelledby"],wj=["id","for"],xj={class:"vc-input__desc"};function Cj(t,e,n,r,i,s){return o.openBlock(),o.createElementBlock("div",bj,[o.withDirectives(o.createElementVNode("input",{ref:"input","onUpdate:modelValue":e[0]||(e[0]=a=>s.val=a),"aria-labelledby":s.labelId,class:"vc-input__input",onKeydown:e[1]||(e[1]=(...a)=>s.handleKeyDown&&s.handleKeyDown(...a)),onInput:e[2]||(e[2]=(...a)=>s.update&&s.update(...a))},null,40,yj),[[o.vModelText,s.val]]),o.createElementVNode("span",{id:s.labelId,for:n.label,class:"vc-input__label"},o.toDisplayString(s.labelSpanText),9,wj),o.createElementVNode("span",xj,o.toDisplayString(n.desc),1)])}var kj=".vc-editable-input{position:relative}.vc-input__input{border:0;outline:none;padding:0}.vc-input__label{text-transform:capitalize}";Dl(kj),pp.render=Cj,pp.__file="src/components/editable-input/editable-input.vue",pp.install=Pl;function iv(t,e,n){return e<n?t<e?e:t>n?n:t:t<n?n:t>e?e:t}var hp={name:"Saturation",props:{value:Object},computed:{colors(){return this.value},bgColor(){return`hsl(${this.colors.hsv.h}, 100%, 50%)`},pointerTop(){return`${-(this.colors.hsv.v*100)+1+100}%`},pointerLeft(){return`${this.colors.hsv.s*100}%`}},methods:{handleChange(t,e){!e&&t.preventDefault();const{container:n}=this.$refs;if(!n)return;const r=n.clientWidth,i=n.clientHeight,s=n.getBoundingClientRect().left+window.pageXOffset,a=n.getBoundingClientRect().top+window.pageYOffset,l=t.pageX||(t.touches?t.touches[0].pageX:0),u=t.pageY||(t.touches?t.touches[0].pageY:0),c=iv(l-s,0,r),f=iv(u-a,0,i),p=c/r,m=iv(-(f/i)+1,0,1);this.onChange({h:this.colors.hsv.h,s:p,v:m,a:this.colors.hsv.a,source:"hsva"})},onChange(t){this.$emit("change",t)},handleMouseDown(t){window.addEventListener("mousemove",this.handleChange),window.addEventListener("mouseup",this.handleChange),window.addEventListener("mouseup",this.handleMouseUp)},handleMouseUp(t){this.unbindEventListeners()},unbindEventListeners(){window.removeEventListener("mousemove",this.handleChange),window.removeEventListener("mouseup",this.handleChange),window.removeEventListener("mouseup",this.handleMouseUp)}}};const Ej=o.createElementVNode("div",{class:"vc-saturation--white"},null,-1),Sj=o.createElementVNode("div",{class:"vc-saturation--black"},null,-1),_j=[o.createElementVNode("div",{class:"vc-saturation-circle"},null,-1)];function Tj(t,e,n,r,i,s){return o.openBlock(),o.createElementBlock("div",{ref:"container",class:"vc-saturation",style:o.normalizeStyle({background:s.bgColor}),onMousedown:e[0]||(e[0]=(...a)=>s.handleMouseDown&&s.handleMouseDown(...a)),onTouchmove:e[1]||(e[1]=(...a)=>s.handleChange&&s.handleChange(...a)),onTouchstart:e[2]||(e[2]=(...a)=>s.handleChange&&s.handleChange(...a))},[Ej,Sj,o.createElementVNode("div",{class:"vc-saturation-pointer",style:o.normalizeStyle({top:s.pointerTop,left:s.pointerLeft})},_j,4)],36)}var Aj=".vc-saturation,.vc-saturation--black,.vc-saturation--white{bottom:0;cursor:pointer;left:0;position:absolute;right:0;top:0}.vc-saturation--white{background:linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.vc-saturation--black{background:linear-gradient(0deg,#000,transparent)}.vc-saturation-pointer{cursor:pointer;position:absolute}.vc-saturation-circle{border-radius:50%;box-shadow:0 0 0 1.5px #fff,inset 0 0 1px 1px rgba(0,0,0,.3),0 0 1px 2px rgba(0,0,0,.4);cursor:head;height:4px;transform:translate(-2px,-2px);width:4px}";Dl(Aj),hp.render=Tj,hp.__file="src/components/saturation/saturation.vue",hp.install=Pl;var mp={name:"Hue",props:{value:Object,direction:{type:String,default:"horizontal"}},data(){return{oldHue:0,pullDirection:""}},computed:{colors(){return this.value},directionClass(){return{"vc-hue--horizontal":this.direction==="horizontal","vc-hue--vertical":this.direction==="vertical"}},pointerTop(){return this.direction==="vertical"?this.colors.hsl.h===0&&this.pullDirection==="right"?0:`${-(this.colors.hsl.h*100/360)+100}%`:0},pointerLeft(){return this.direction==="vertical"?0:this.colors.hsl.h===0&&this.pullDirection==="right"?"100%":`${this.colors.hsl.h*100/360}%`}},watch:{value:{handler(t,e){const{h:n}=t.hsl;n!==0&&n-this.oldHue>0&&(this.pullDirection="right"),n!==0&&n-this.oldHue<0&&(this.pullDirection="left"),this.oldHue=n},deep:!0,immediate:!0}},methods:{handleChange(t,e){!e&&t.preventDefault();const{container:n}=this.$refs;if(!n)return;const r=n.clientWidth,i=n.clientHeight,s=n.getBoundingClientRect().left+window.pageXOffset,a=n.getBoundingClientRect().top+window.pageYOffset,l=t.pageX||(t.touches?t.touches[0].pageX:0),u=t.pageY||(t.touches?t.touches[0].pageY:0),c=l-s,f=u-a;let p,m;this.direction==="vertical"?(f<0?p=360:f>i?p=0:(m=-(f*100/i)+100,p=360*m/100),this.colors.hsl.h!==p&&this.$emit("change",{h:p,s:this.colors.hsl.s,l:this.colors.hsl.l,a:this.colors.hsl.a,source:"hsl"})):(c<0?p=0:c>r?p=360:(m=c*100/r,p=360*m/100),this.colors.hsl.h!==p&&this.$emit("change",{h:p,s:this.colors.hsl.s,l:this.colors.hsl.l,a:this.colors.hsl.a,source:"hsl"}))},handleMouseDown(t){this.handleChange(t,!0),window.addEventListener("mousemove",this.handleChange),window.addEventListener("mouseup",this.handleChange),window.addEventListener("mouseup",this.handleMouseUp)},handleMouseUp(t){this.unbindEventListeners()},unbindEventListeners(){window.removeEventListener("mousemove",this.handleChange),window.removeEventListener("mouseup",this.handleChange),window.removeEventListener("mouseup",this.handleMouseUp)}}};const Mj=["aria-valuenow"],Oj=[o.createElementVNode("div",{class:"vc-hue-picker"},null,-1)];function Bj(t,e,n,r,i,s){return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["vc-hue",[s.directionClass]])},[o.createElementVNode("div",{ref:"container",class:"vc-hue-container",role:"slider","aria-valuenow":s.colors.hsl.h,"aria-valuemin":"0","aria-valuemax":"360",onMousedown:e[0]||(e[0]=(...a)=>s.handleMouseDown&&s.handleMouseDown(...a)),onTouchmove:e[1]||(e[1]=(...a)=>s.handleChange&&s.handleChange(...a)),onTouchstart:e[2]||(e[2]=(...a)=>s.handleChange&&s.handleChange(...a))},[o.createElementVNode("div",{class:"vc-hue-pointer",style:o.normalizeStyle({top:s.pointerTop,left:s.pointerLeft}),role:"presentation"},Oj,4)],40,Mj)],2)}var Ij=".vc-hue{border-radius:2px;bottom:0;left:0;position:absolute;right:0;top:0}.vc-hue--horizontal{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.vc-hue--vertical{background:linear-gradient(0deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.vc-hue-container{cursor:pointer;height:100%;margin:0 2px;position:relative}.vc-hue-pointer{position:absolute;z-index:2}.vc-hue-picker{background:#fff;border-radius:1px;box-shadow:0 0 2px rgba(0,0,0,.6);cursor:pointer;height:8px;margin-top:1px;transform:translateX(-2px);width:4px}";Dl(Ij),mp.render=Bj,mp.__file="src/components/hue/hue.vue",mp.install=Pl;var gp={name:"Chrome",components:{Saturation:hp,Hue:mp,Alpha:cp,EdIn:pp,Checkboard:bc},mixins:[vj],props:{disableAlpha:{type:Boolean,default:!1},disableFields:{type:Boolean,default:!1},format:{type:String,default:"hex"}},data(){return{fieldsIndex:"hex",highlight:!1}},computed:{hsl(){const{h:t,s:e,l:n}=this.colors.hsl;return{h:t.toFixed(),s:`${(e*100).toFixed()}%`,l:`${(n*100).toFixed()}%`}},activeColor(){const{rgba:t}=this.colors;return`rgba(${[t.r,t.g,t.b,t.a].join(",")})`},hasAlpha(){return this.colors.a<1}},watch:{format:{handler(t){this.fieldsIndex=t},immediate:!0}},methods:{childChange(t){this.colorChange(t)},inputChange(t){if(t){if(t.hex)this.isValidHex(t.hex)&&this.colorChange({hex:t.hex,source:"hex"});else if(t.r||t.g||t.b||t.a)this.colorChange({r:t.r||this.colors.rgba.r,g:t.g||this.colors.rgba.g,b:t.b||this.colors.rgba.b,a:t.a||this.colors.rgba.a,source:"rgba"});else if(t.h||t.s||t.l){const e=t.s?t.s.replace("%","")/100:this.colors.hsl.s,n=t.l?t.l.replace("%","")/100:this.colors.hsl.l;this.colorChange({h:t.h||this.colors.hsl.h,s:e,l:n,source:"hsl"})}}},toggleViews(){switch(this.fieldsIndex){case"hex":this.fieldsIndex=`rgb${this.disableAlpha?"":"a"}`;break;case"rgb":case"rgba":this.fieldsIndex=`hsl${this.disableAlpha?"":"a"}`;break;default:this.fieldsIndex="hex";break}this.$emit("update:format",this.fieldsIndex)},showHighlight(){this.highlight=!0},hideHighlight(){this.highlight=!1}}};const Lj={class:"vc-chrome-saturation-wrap"},Rj={class:"vc-chrome-body"},Dj={class:"vc-chrome-controls"},Pj={class:"vc-chrome-color-wrap"},Vj=["aria-label"],Fj={class:"vc-chrome-sliders"},$j={class:"vc-chrome-hue-wrap"},Hj={key:0,class:"vc-chrome-alpha-wrap"},zj={key:0,class:"vc-chrome-fields-wrap"},Uj={class:"vc-chrome-fields"},Wj={class:"vc-chrome-field"},jj={class:"vc-chrome-fields"},qj={class:"vc-chrome-field"},Kj={class:"vc-chrome-field"},Gj={class:"vc-chrome-field"},Xj={key:0,class:"vc-chrome-field"},Yj={class:"vc-chrome-fields"},Jj={class:"vc-chrome-field"},Zj={class:"vc-chrome-field"},Qj={class:"vc-chrome-field"},Nj={key:0,class:"vc-chrome-field"},eq={class:"vc-chrome-toggle-icon"},tq=[o.createElementVNode("path",{fill:"#333",d:"M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z"},null,-1)],nq={class:"vc-chrome-toggle-icon-highlight"};function rq(t,e,n,r,i,s){const a=o.resolveComponent("Saturation"),l=o.resolveComponent("Checkboard"),u=o.resolveComponent("Hue"),c=o.resolveComponent("Alpha"),f=o.resolveComponent("EdIn");return o.openBlock(),o.createElementBlock("div",{role:"application","aria-label":"Chrome color picker",class:o.normalizeClass(["vc-chrome",[n.disableAlpha?"vc-chrome__disable-alpha":""]])},[o.createElementVNode("div",Lj,[o.createVNode(a,{value:t.colors,onChange:s.childChange},null,8,["value","onChange"])]),o.createElementVNode("div",Rj,[o.createElementVNode("div",Dj,[o.createElementVNode("div",Pj,[o.createElementVNode("div",{"aria-label":`current color is ${t.colors.hex}`,class:"vc-chrome-active-color",style:o.normalizeStyle({background:s.activeColor})},null,12,Vj),n.disableAlpha?o.createCommentVNode("v-if",!0):(o.openBlock(),o.createBlock(l,{key:0}))]),o.createElementVNode("div",Fj,[o.createElementVNode("div",$j,[o.createVNode(u,{value:t.colors,onChange:s.childChange},null,8,["value","onChange"])]),n.disableAlpha?o.createCommentVNode("v-if",!0):(o.openBlock(),o.createElementBlock("div",Hj,[o.createVNode(c,{value:t.colors,onChange:s.childChange},null,8,["value","onChange"])]))])]),n.disableFields?o.createCommentVNode("v-if",!0):(o.openBlock(),o.createElementBlock("div",zj,[o.withDirectives(o.createElementVNode("div",Uj,[o.createCommentVNode(" hex "),o.createElementVNode("div",Wj,[s.hasAlpha?o.createCommentVNode("v-if",!0):(o.openBlock(),o.createBlock(f,{key:0,label:"hex",value:t.colors.hex,onChange:s.inputChange},null,8,["value","onChange"])),s.hasAlpha?(o.openBlock(),o.createBlock(f,{key:1,label:"hex",value:t.colors.hex8,onChange:s.inputChange},null,8,["value","onChange"])):o.createCommentVNode("v-if",!0)])],512),[[o.vShow,i.fieldsIndex==="hex"]]),o.withDirectives(o.createElementVNode("div",jj,[o.createCommentVNode(" rgba "),o.createElementVNode("div",qj,[o.createVNode(f,{label:"r",value:t.colors.rgba.r,onChange:s.inputChange},null,8,["value","onChange"])]),o.createElementVNode("div",Kj,[o.createVNode(f,{label:"g",value:t.colors.rgba.g,onChange:s.inputChange},null,8,["value","onChange"])]),o.createElementVNode("div",Gj,[o.createVNode(f,{label:"b",value:t.colors.rgba.b,onChange:s.inputChange},null,8,["value","onChange"])]),n.disableAlpha?o.createCommentVNode("v-if",!0):(o.openBlock(),o.createElementBlock("div",Xj,[o.createVNode(f,{label:"a",value:t.colors.a,"arrow-offset":.01,max:1,onChange:s.inputChange},null,8,["value","arrow-offset","onChange"])]))],512),[[o.vShow,["rgb","rgba"].includes(i.fieldsIndex)]]),o.withDirectives(o.createElementVNode("div",Yj,[o.createCommentVNode(" hsla "),o.createElementVNode("div",Jj,[o.createVNode(f,{label:"h",value:s.hsl.h,onChange:s.inputChange},null,8,["value","onChange"])]),o.createElementVNode("div",Zj,[o.createVNode(f,{label:"s",value:s.hsl.s,onChange:s.inputChange},null,8,["value","onChange"])]),o.createElementVNode("div",Qj,[o.createVNode(f,{label:"l",value:s.hsl.l,onChange:s.inputChange},null,8,["value","onChange"])]),n.disableAlpha?o.createCommentVNode("v-if",!0):(o.openBlock(),o.createElementBlock("div",Nj,[o.createVNode(f,{label:"a",value:t.colors.a,"arrow-offset":.01,max:1,onChange:s.inputChange},null,8,["value","arrow-offset","onChange"])]))],512),[[o.vShow,["hsl","hsla"].includes(i.fieldsIndex)]]),o.createCommentVNode(" btn "),o.createElementVNode("div",{class:"vc-chrome-toggle-btn",role:"button","aria-label":"Change another color definition",onClick:e[3]||(e[3]=(...p)=>s.toggleViews&&s.toggleViews(...p))},[o.createElementVNode("div",eq,[(o.openBlock(),o.createElementBlock("svg",{style:{width:"24px",height:"24px"},viewBox:"0 0 24 24",onMouseover:e[0]||(e[0]=(...p)=>s.showHighlight&&s.showHighlight(...p)),onMouseenter:e[1]||(e[1]=(...p)=>s.showHighlight&&s.showHighlight(...p)),onMouseout:e[2]||(e[2]=(...p)=>s.hideHighlight&&s.hideHighlight(...p))},tq,32))]),o.withDirectives(o.createElementVNode("div",nq,null,512),[[o.vShow,i.highlight]])]),o.createCommentVNode(" btn ")]))])],2)}var oq=".vc-chrome{background:#fff;background-color:#fff;border-radius:2px;box-shadow:0 0 2px rgba(0,0,0,.3),0 4px 8px rgba(0,0,0,.3);box-sizing:initial;font-family:Menlo;width:225px}.vc-chrome-controls{display:flex}.vc-chrome-color-wrap{position:relative;width:36px}.vc-chrome-active-color{border-radius:15px;height:30px;overflow:hidden;position:relative;width:30px;z-index:1}.vc-chrome-color-wrap .vc-checkerboard{background-size:auto;border-radius:15px;height:30px;width:30px}.vc-chrome-sliders{flex:1}.vc-chrome-fields-wrap{display:flex;padding-top:16px}.vc-chrome-fields{display:flex;flex:1;margin-left:-6px}.vc-chrome-field{padding-left:6px;width:100%}.vc-chrome-toggle-btn{position:relative;text-align:right;width:32px}.vc-chrome-toggle-icon{cursor:pointer;margin-right:-4px;margin-top:12px;position:relative;z-index:2}.vc-chrome-toggle-icon-highlight{background:#eee;border-radius:4px;height:28px;left:12px;position:absolute;top:10px;width:24px}.vc-chrome-hue-wrap{margin-bottom:8px}.vc-chrome-alpha-wrap,.vc-chrome-hue-wrap{height:10px;position:relative}.vc-chrome-alpha-wrap .vc-alpha-gradient,.vc-chrome-hue-wrap .vc-hue{border-radius:2px}.vc-chrome-alpha-wrap .vc-alpha-picker,.vc-chrome-hue-wrap .vc-hue-picker{background-color:#f8f8f8;border-radius:6px;box-shadow:0 1px 4px 0 rgba(0,0,0,.37);height:12px;transform:translate(-6px,-2px);width:12px}.vc-chrome-body{background-color:#fff;padding:16px 16px 12px}.vc-chrome-saturation-wrap{border-radius:2px 2px 0 0;overflow:hidden;padding-bottom:55%;position:relative;width:100%}.vc-chrome-saturation-wrap .vc-saturation-circle{height:12px;width:12px}.vc-chrome-fields .vc-input__input{border:none;border-radius:2px;box-shadow:inset 0 0 0 1px #dadada;color:#333;font-size:11px;height:21px;text-align:center;width:100%}.vc-chrome-fields .vc-input__label{color:#969696;display:block;font-size:11px;line-height:11px;margin-top:12px;text-align:center;text-transform:uppercase}.vc-chrome__disable-alpha .vc-chrome-active-color{height:18px;width:18px}.vc-chrome__disable-alpha .vc-chrome-color-wrap{width:30px}.vc-chrome__disable-alpha .vc-chrome-hue-wrap{margin-bottom:4px;margin-top:4px}";Dl(oq),gp.render=rq,gp.__file="src/components/chrome/chrome.vue",gp.install=Pl;const ms=o.defineComponent({__name:"Popover",props:{defaultOpen:{type:Boolean},open:{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(YP),o.normalizeProps(o.guardReactiveProps(o.unref(i))),{default:o.withCtx(({open:l})=>[o.renderSlot(s.$slots,"default",{open:l})]),_:3},16))}}),Ca=o.defineComponent({__name:"PopoverTrigger",props:{asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,r)=>(o.openBlock(),o.createBlock(o.unref(JP),o.normalizeProps(o.guardReactiveProps(e)),{default:o.withCtx(()=>[o.renderSlot(n.$slots,"default")]),_:3},16))}}),gs=o.defineComponent({inheritAttrs:!1,__name:"PopoverContent",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},side:{},sideOffset:{default:4},align:{default:"center"},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},updatePositionStrategy:{},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{},disableOutsidePointerEvents:{type:Boolean},class:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","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(ZP),null,{default:o.withCtx(()=>[o.createVNode(o.unref(eV),o.mergeProps({...o.unref(s),...a.$attrs},{class:o.unref(ke)("z-50 w-72 rounded-md border bg-ed-popover p-4 text-ed-popover-foreground shadow-md outline-none 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}))}}),iq={class:"flex flex-col"},sq={class:"w-6 h-6 p-0.5 inline-block rounded-sm border cursor-pointer hover:border-ed-border hover:shadow-sm relative after:border-b-2 after:border-b-red-500 after:top-[10px] after:h-0 after:left-0 after:w-6 after:absolute after:block after:rotate-[45deg]"},aq={style:{"background-color":"transparent"}},lq={viewBox:"0 0 18 18",style:{fill:"rgba(0, 0, 0, 0.4)",display:"none"}},uq={class:"ml-1 text-sm"},cq={class:"w-6 h-6 p-0.5 inline-block rounded-sm border border-transparent cursor-pointer"},dq={viewBox:"0 0 18 18",style:{fill:"rgb(255, 255, 255)",display:"none"}},fq={class:"ml-1 text-sm"},pq=["onClick"],hq={key:0,viewBox:"0 0 18 18",style:{fill:"rgb(255, 255, 255)",display:"none"}},mq={key:1,class:"absolute top-[-1px] left-[1px] w-3 h-3",viewBox:"0 0 18 18",style:{fill:"rgb(255, 255, 255)",display:"block"}},gq={class:"my-3.5"},vq={class:"text-sm"},bq={class:"relative flex w-full h-auto"},yq=["onClick"],wq={viewBox:"0 0 18 18",style:{fill:"rgb(255, 255, 255)",display:"none"}},c5=o.defineComponent({__name:"ColorPicker",props:{modelValue:{default:""},highlight:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:e}){const{t:n}=Pt(),r=uL.reduce((k,T,_)=>{const A=Math.floor(_/10);return k[A]||(k[A]=[]),k[A].push(T),k},[]),i=t,s=o.ref(!1),a=o.ref(i.modelValue),l=o.ref(!1);o.watch(()=>i.modelValue,k=>{l.value||(a.value=k??"")});function u(k){a.value=k.a<1?k.hex8:k.hex}function c(){l.value=!0}function f(){l.value&&(l.value=!1,b(a.value),s.value=!1)}o.onMounted(()=>window.addEventListener("pointerup",f)),o.onBeforeUnmount(()=>window.removeEventListener("pointerup",f));const p=ct.useLocalStorage(i.highlight?"recentColorsHighlight":"recentColors",[]),m=e;function g(k){const T=p.value.indexOf(k);T!==-1&&p.value.splice(T,1),p.value.unshift(k),p.value.length>10&&p.value.pop()}const v=o.computed(()=>p.value.slice(0,10));function b(k){if(k===void 0){m("update:modelValue",k),m("change",k);return}/^#(?:[0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$/i.test(k)&&(m("update:modelValue",k),m("change",k),g(k))}const w=o.inject("isMobile",!1),x=`dropdown-trigger-${$r(10)}`,{isOpen:C}=Nf({scrollEl:"tool-bar-format-scroll",ignoreSelector:`[data-radix-popper-content-wrapper], .${x}`}),E=o.computed(()=>w?{modal:!1,open:C.value,"onUpdate:open":k=>C.value=k}:{});return(k,T)=>{const _=Ot;return o.openBlock(),o.createBlock(o.unref(ms),o.normalizeProps(o.guardReactiveProps(E.value)),{default:o.withCtx(()=>[o.createVNode(o.unref(Ca),{disabled:k.disabled,class:o.normalizeClass(x)},{default:o.withCtx(()=>[o.renderSlot(k.$slots,"default")]),_:3},8,["disabled"]),o.createVNode(o.unref(gs),{"hide-when-detached":"",class:"w-full h-full px-[18px] py-[15px] shadow-elevation1 inside-toolbar",align:"start",side:"bottom"},{default:o.withCtx(()=>[o.createElementVNode("div",iq,[k.highlight?(o.openBlock(),o.createElementBlock("div",{key:0,class:"flex items-center py-1.5 gap-2 cursor-pointer hover:bg-ed-accent",onClick:T[0]||(T[0]=A=>b(void 0))},[o.createElementVNode("span",sq,[o.createElementVNode("span",aq,[(o.openBlock(),o.createElementBlock("svg",lq,T[5]||(T[5]=[o.createElementVNode("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"},null,-1)])))])]),o.createElementVNode("span",uq,o.toDisplayString(o.unref(n)("editor.nofill")),1)])):(o.openBlock(),o.createElementBlock("div",{key:1,class:"flex items-center cursor-pointer hover:bg-ed-accent mb-3",onClick:T[1]||(T[1]=A=>b(void 0))},[o.createElementVNode("span",cq,[o.createElementVNode("span",{style:o.normalizeStyle({backgroundColor:o.unref(lL)}),class:"relative w-[18px] h-[18px] block rounded border-transparent"},[(o.openBlock(),o.createElementBlock("svg",dq,T[6]||(T[6]=[o.createElementVNode("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"},null,-1)])))],4)]),o.createElementVNode("span",fq,o.toDisplayString(o.unref(n)("editor.default")),1)])),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(o.unref(r),(A,V)=>(o.openBlock(),o.createElementBlock("span",{key:V,class:"relative flex w-full h-auto p-0 last:pb-2"},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(A,(O,B)=>(o.openBlock(),o.createElementBlock("span",{key:B,class:"w-6 h-6 p-0.5 inline-block rounded-sm border border-transparent flex-[0 0 auto] cursor-pointer hover:border-ed-border hover:shadow-sm",onClick:H=>b(O)},[o.createElementVNode("span",{style:o.normalizeStyle({backgroundColor:O}),class:"relative w-[18px] h-[18px] block rounded border-transparent"},[O!==k.modelValue?(o.openBlock(),o.createElementBlock("svg",hq,T[7]||(T[7]=[o.createElementVNode("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"},null,-1)]))):(o.openBlock(),o.createElementBlock("svg",mq,T[8]||(T[8]=[o.createElementVNode("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"},null,-1)])))],4)],8,pq))),128))]))),128)),o.withDirectives(o.createElementVNode("div",gq,[o.createElementVNode("div",vq,o.toDisplayString(o.unref(n)("editor.recent")),1),o.createElementVNode("span",bq,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(v.value,(A,V)=>(o.openBlock(),o.createElementBlock("span",{key:V,class:"w-6 h-6 p-0.5 inline-block rounded-sm border border-transparent flex-[0 0 auto] cursor-pointer hover:border-ed-border hover:shadow-sm",onClick:O=>b(A)},[o.createElementVNode("span",{class:"relative w-[18px] h-[18px] block rounded-[2px] border-transparent",style:o.normalizeStyle({backgroundColor:A})},[(o.openBlock(),o.createElementBlock("svg",wq,T[9]||(T[9]=[o.createElementVNode("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"},null,-1)])))],4)],8,yq))),128))])],512),[[o.vShow,v.value.length]]),o.createElementVNode("div",{class:"text-sm md:hover:cursor-pointer md:hover:bg-ed-accent active:bg-ed-accent flex items-center gap-1.5",onClick:T[2]||(T[2]=A=>s.value=!0)},[o.createVNode(_,{name:"PenColor",class:"w-5 h-5"}),o.createElementVNode("span",null,o.toDisplayString(o.unref(n)("editor.color.more")),1)]),s.value?(o.openBlock(),o.createElementBlock("div",{key:2,class:"fixed inset-0 flex justify-center items-center z-50",onClick:T[4]||(T[4]=A=>s.value=!1)},[o.createElementVNode("div",{class:"bg-white p-3 rounded-lg shadow-md",onClick:T[3]||(T[3]=o.withModifiers(()=>{},["stop"])),onPointerdown:c},[o.createVNode(o.unref(gp),{"model-value":a.value,"onUpdate:modelValue":u},null,8,["model-value"])],32)])):o.createCommentVNode("",!0)])]),_:1})]),_:3},16)}}}),xq={class:"flex items-center h-[32px] hover:bg-ed-muted rounded-md"},Cq={class:"flex items-center justify-center text-sm"},kq={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Eq=["fill"],Sq=o.defineComponent({__name:"ColorActionButton",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 e=t,n=o.ref(void 0);function r(s){e.action?.(s)}function i(s){e.action?.(n.value)}return(s,a)=>(o.openBlock(),o.createElementBlock("div",xq,[o.createVNode(Ge,{id:"color",tooltip:s.tooltip,disabled:s.disabled,action:i},{icon:o.withCtx(()=>[o.createElementVNode("span",Cq,[(o.openBlock(),o.createElementBlock("svg",kq,[a[1]||(a[1]=o.createElementVNode("path",{d:"M7.25033 8.93724H12.7503M5.41699 12.5L9.33272 4.12953C9.54481 3.67616 9.65086 3.44947 9.79781 3.37915C9.9255 3.31804 10.0752 3.31804 10.2028 3.37915C10.3498 3.44947 10.4558 3.67616 10.6679 4.12953L14.5837 12.5",stroke:"currentColor","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)),o.createElementVNode("path",{d:"M3.33301 15H16.6663V16.6667H3.33301V15Z",fill:n.value||"hsl(var(--ed-foreground))"},null,8,Eq)]))])]),_:1},8,["tooltip","disabled"]),o.createVNode(c5,{modelValue:n.value,"onUpdate:modelValue":a[0]||(a[0]=l=>n.value=l),disabled:s.disabled,onChange:r},{default:o.withCtx(()=>[o.createVNode(o.unref(mn),{variant:"ghost",size:"icon",class:"h-[32px] w-3 rounded-l-none hover:bg-ed-muted-foreground/20",disabled:s.disabled},{default:o.withCtx(()=>[o.createVNode(o.unref(Ot),{class:"flex-shrink-0 w-1.5 h-1.5",name:"ChevronDown"})]),_:1},8,["disabled"])]),_:1},8,["modelValue","disabled"])]))}}),d5=GW.extend({addOptions(){return{...this.parent?.(),button({editor:t,t:e}){return{component:Sq,componentProps:{action:n=>{typeof n>"u"&&t.chain().focus().unsetColor().run(),typeof n=="string"&&t.chain().focus().setColor(n).run()},isActive:()=>{const{color:n}=t.getAttributes("textStyle");return n&&t.isActive({color:n})||!1},editor:t,disabled:!t.can().setColor(""),tooltip:e("editor.color.tooltip")}}}}}}),_q=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,Tq=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,f5=Fn.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",wt(this.options.HTMLAttributes,t),0]},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Ys({find:_q,type:this.type})]},addPasteRules(){return[Ji({find:Tq,type:this.type})]}}),Aq={class:"flex items-center h-[32px] hover:bg-ed-muted rounded-md"},Mq={class:"text-sm flex items-center justify-center"},Oq={width:"18px",height:"18px",viewBox:"0 0 256 256",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},Bq={id:"icon/填充色",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},Iq={id:"icon/背景颜色"},Lq=["fill"],p5=o.defineComponent({__name:"HighlightActionButton",props:{editor:{},tooltip:{default:void 0},disabled:{type:Boolean,default:!1},action:{type:Function,default:void 0},isActive:{type:Function,default:void 0},tooltipOptions:{default:void 0}},setup(t){const e=t,n=o.ref(void 0),{state:r}=bn();function i(a){e.action?.(a)}function s(a){e.action?.(n.value)}return o.watchEffect(()=>{const{color:a}=e.editor.getAttributes("highlight");r.highlight=a}),(a,l)=>(o.openBlock(),o.createElementBlock("div",Aq,[o.createVNode(Ge,{id:"highlight",tooltip:a.tooltip,disabled:a.disabled,action:s,"tooltip-options":a.tooltipOptions},{icon:o.withCtx(()=>[o.createElementVNode("span",Mq,[(o.openBlock(),o.createElementBlock("svg",Oq,[o.createElementVNode("g",Bq,[o.createElementVNode("g",Iq,[l[1]||(l[1]=o.createElementVNode("g",{id:"编组",fill:"currentColor"},[o.createElementVNode("g",{id:"矩形",transform:"translate(119.502295, 137.878331) rotate(-135.000000) translate(-119.502295, -137.878331) translate(48.002295, 31.757731)"},[o.createElementVNode("path",{d:"M100.946943,60.8084699 L43.7469427,60.8084699 C37.2852111,60.8084699 32.0469427,66.0467383 32.0469427,72.5084699 L32.0469427,118.70847 C32.0469427,125.170201 37.2852111,130.40847 43.7469427,130.40847 L100.946943,130.40847 C107.408674,130.40847 112.646943,125.170201 112.646943,118.70847 L112.646943,72.5084699 C112.646943,66.0467383 107.408674,60.8084699 100.946943,60.8084699 Z M93.646,79.808 L93.646,111.408 L51.046,111.408 L51.046,79.808 L93.646,79.808 Z","fill-rule":"nonzero"}),o.createElementVNode("path",{d:"M87.9366521,16.90916 L87.9194966,68.2000001 C87.9183543,69.4147389 86.9334998,70.399264 85.7187607,70.4 L56.9423078,70.4 C55.7272813,70.4 54.7423078,69.4150264 54.7423078,68.2 L54.7423078,39.4621057 C54.7423078,37.2523513 55.5736632,35.1234748 57.0711706,33.4985176 L76.4832996,12.4342613 C78.9534987,9.75382857 83.1289108,9.5834005 85.8093436,12.0535996 C87.1658473,13.303709 87.9372691,15.0644715 87.9366521,16.90916 Z","fill-rule":"evenodd"}),o.createElementVNode("path",{d:"M131.3,111.241199 L11.7,111.241199 C5.23826843,111.241199 0,116.479467 0,122.941199 L0,200.541199 C0,207.002931 5.23826843,212.241199 11.7,212.241199 L131.3,212.241199 C137.761732,212.241199 143,207.002931 143,200.541199 L143,122.941199 C143,116.479467 137.761732,111.241199 131.3,111.241199 Z M124,130.241 L124,193.241 L19,193.241 L19,130.241 L124,130.241 Z","fill-rule":"nonzero"})])],-1)),o.createElementVNode("path",{id:"矩形",d:"M51,218 L205,218 C211.075132,218 216,222.924868 216,229 C216,235.075132 211.075132,240 205,240 L51,240 C44.9248678,240 40,235.075132 40,229 C40,222.924868 44.9248678,218 51,218 Z",fill:n.value||"#FBDE28"},null,8,Lq)])])]))])]),_:1},8,["tooltip","disabled","tooltip-options"]),o.createVNode(c5,{modelValue:n.value,"onUpdate:modelValue":l[0]||(l[0]=u=>n.value=u),highlight:"",disabled:a.disabled,onChange:i},{default:o.withCtx(()=>[o.createVNode(o.unref(mn),{variant:"ghost",size:"icon",class:"w-3 h-[32px] rounded-l-none hover:bg-ed-muted-foreground/20",disabled:a.disabled},{default:o.withCtx(()=>[o.createVNode(o.unref(Ot),{class:"w-3 h-3 text-zinc-500",name:"MenuDown"})]),_:1},8,["disabled"])]),_:1},8,["modelValue","disabled"])]))}}),Rq=f5.extend({addOptions(){return{...this.parent?.(),multicolor:!0,button:({editor:t,t:e})=>({component:p5,componentProps:{action:n=>{typeof n=="string"&&t.chain().focus().setHighlight({color:n}).run(),typeof n>"u"&&t.chain().focus().unsetHighlight().run()},editor:t,isActive:()=>t.isActive("highlight")||!1,disabled:!t.can().setHighlight(),shortcutKeys:["⇧","mod","H"],tooltip:e("editor.highlight.tooltip")}})}}}),Dq="listItem",h5="textStyle",m5=/^\s*([-+*])\s$/,Pq=Lt.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",wt(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Dq,this.editor.getAttributes(h5)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=al({find:m5,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=al({find:m5,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(h5),editor:this.editor})),[t]}}),Vq=["id"],g5=o.defineComponent({__name:"ActionDropdownButtonSplit",props:{icon:{default:void 0},title:{default:void 0},tooltip:{default:void 0},disabled:{type:Boolean,default:!1},class:{default:""},shortcutKeys:{default:void 0},btnClass:{default:""},action:{type:Function,default:void 0},isActive:{type:Function,default:void 0},id:{default:""}},setup(t){const e=t;return(n,r)=>(o.openBlock(),o.createElementBlock("div",{id:`dropdown-btn-${n.id}`,class:o.normalizeClass(["flex items-center h-[32px] hover:bg-ed-muted rounded-md",[n.isActive?.()&&"bg-ed-muted"]])},[o.createVNode(Ge,{class:o.normalizeClass(n.btnClass),action:n.action,title:n.title,icon:n.icon,tooltip:n.tooltip,disabled:n.disabled,"shortcut-keys":n.shortcutKeys},null,8,["class","action","title","icon","tooltip","disabled","shortcut-keys"]),o.createVNode(o.unref(U6),null,{default:o.withCtx(()=>[o.createVNode(o.unref(W6),{disabled:n.disabled},{default:o.withCtx(()=>[o.createVNode(mn,{variant:"ghost",size:"icon",class:"h-[32px] w-3 rounded-l-none hover:bg-ed-muted-foreground/20",disabled:n.disabled},{default:o.withCtx(()=>[o.createVNode(o.unref(Ot),{class:"w-3 h-3 text-zinc-500",name:"MenuDown"})]),_:1},8,["disabled"])]),_:1},8,["disabled"]),o.createVNode(o.unref(j6),o.mergeProps({class:o.unref(ke)("min-w-24",e.class),align:"start",side:"bottom"},n.$attrs),{default:o.withCtx(()=>[o.renderSlot(n.$slots,"default")]),_:3},16,["class"])]),_:3})],10,Vq))}}),Fq=o.defineComponent({__name:"BulletListMenuButton",props:{editor:{},disabled:{type:Boolean,default:!1},tooltip:{default:""}},setup(t){const e=t,{t:n}=Pt(),r=[{label:"editor.bulletlist.disc.tooltip",value:"disc"},{label:"editor.bulletlist.circle.tooltip",value:"circle"},{label:"editor.bulletlist.square.tooltip",value:"square"}],i=o.computed(()=>e.editor?.isActive("bulletList")?e.editor.getAttributes("bulletList").listStyleType:"disc");function s(a){e.editor.isActive("bulletList")?e.editor.getAttributes("bulletList").listStyleType===a.value?e.editor.chain().focus().toggleBulletList().run():e.editor.chain().focus().updateAttributes("bulletList",{listStyleType:a.value}).run():e.editor.chain().focus().toggleBulletList().updateAttributes("bulletList",{listStyleType:a.value}).run()}return(a,l)=>(o.openBlock(),o.createBlock(g5,{id:"bullet-list",action:()=>s,disabled:a.disabled,tooltip:a.tooltip,class:"grid w-full grid-cols-3 gap-1 min-w-4"},{default:o.withCtx(()=>[o.createVNode(o.unref(fa),null,{default:o.withCtx(()=>[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(r,u=>o.createVNode(o.unref(ca),{key:u.value,"delay-duration":0},{default:o.withCtx(()=>[o.createVNode(o.unref(da),null,{default:o.withCtx(()=>[o.createVNode(o.unref(E1),{class:"p-0",onClick:c=>s(u)},{default:o.withCtx(()=>[o.createElementVNode("div",{class:o.normalizeClass([[i.value===u.value?"bg-ed-accent border border-ed-accent-foreground":""],"h-[48px] flex flex-col w-[48px] box-border rounded-sm border"])},[o.createElementVNode("ol",{style:o.normalizeStyle({listStyleType:u.value,lineHeight:1}),class:"text-[10px] pl-3 flex-1 list-outside flex flex-col items-center justify-center"},[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(3,c=>o.createElementVNode("li",{key:c},l[0]||(l[0]=[o.createElementVNode("hr",{class:"border-0 bg-gray-200 h-[3px] w-6 my-1"},null,-1)]))),64))],4)],2)]),_:2},1032,["onClick"])]),_:2},1024),o.createVNode(o.unref(is),{side:"bottom"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)(u.label)),1)]),_:2},1024)]),_:2},1024)),64))]),_:1})]),_:1},8,["action","disabled","tooltip"]))}}),$q=Pq.extend({addAttributes(){return{...this.parent?.(),listStyleType:{default:"disc",parseHTML:t=>({listStyleType:t.style["list-style-type"]??"disc"}),renderHTML:({listStyleType:t})=>({style:`list-style-type: ${t?.listStyleType||t}`})}}},addOptions(){return{...this.parent?.(),button:({editor:t,t:e})=>({component:Fq,componentProps:{action:()=>t.commands.toggleBulletList(),isActive:()=>t.isActive("bulletList")||!1,disabled:!t.can().toggleBulletList(),shortcutKeys:["shift","mod","8"],icon:"List",tooltip:e("editor.bulletlist.tooltip")}})}}}),sv=Lt.create({name:"clear",addOptions(){return{...this.parent?.(),button:({editor:t,t:e})=>({component:Ge,componentProps:{action:()=>t.chain().focus().clearNodes().unsetAllMarks().run(),disabled:!t.can().chain().focus().clearNodes().unsetAllMarks().run(),icon:"Eraser",tooltip:e("editor.clear.tooltip")}})}}}),Hq="listItem",v5="textStyle",b5=/^(\d+)\.\s$/,zq=Lt.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:void 0,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",wt(this.options.HTMLAttributes,n),0]:["ol",wt(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Hq,this.editor.getAttributes(v5)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=al({find:b5,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=al({find:b5,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(v5)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),Uq=o.defineComponent({__name:"OrderedListMenuButton",props:{editor:{},disabled:{type:Boolean,default:!1},tooltip:{default:""},shortcutKeys:{default:void 0},isActive:{type:Function,default:void 0}},setup(t){const e=t,{t:n}=Pt(),r=[{label:"editor.orderedlist.decimal.tooltip",value:"decimal"},{label:"editor.orderedlist.decimalLeadingZero.tooltip",value:"decimal-leading-zero"},{label:"editor.orderedlist.lowerRoman.tooltip",value:"lower-roman"},{label:"editor.orderedlist.upperRoman.tooltip",value:"upper-roman"},{label:"editor.orderedlist.lowerLatin.tooltip",value:"lower-latin"},{label:"editor.orderedlist.upperLatin.tooltip",value:"upper-latin"},{label:"editor.orderedlist.tradChineseInformal.tooltip",value:"trad-chinese-informal"},{label:"editor.orderedlist.simpChineseFormal.tooltip",value:"simp-chinese-formal"}],i=o.computed(()=>e.editor?.isActive("orderedList")?e.editor.getAttributes("orderedList").listType:"decimal");function s(a){e.editor.isActive("orderedList")?e.editor.getAttributes("orderedList").listType===a.value?e.editor.chain()?.toggleOrderedList().run():e.editor.chain()?.updateAttributes("orderedList",{listType:a.value}).run():e.editor.chain().focus().toggleOrderedList().updateAttributes("orderedList",{listType:a.value}).run()}return(a,l)=>(o.openBlock(),o.createBlock(g5,{action:()=>s,disabled:a.disabled,tooltip:a.tooltip,"is-active":a.isActive,"shortcut-keys":a.shortcutKeys,class:"min-w-4 w-full grid grid-cols-3 gap-1"},{default:o.withCtx(()=>[o.createVNode(o.unref(fa),null,{default:o.withCtx(()=>[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(r,u=>o.createVNode(o.unref(ca),{key:u.value,"delay-duration":0},{default:o.withCtx(()=>[o.createVNode(o.unref(da),{"as-child":""},{default:o.withCtx(()=>[o.createVNode(o.unref(E1),{class:"p-0",onClick:c=>s(u)},{default:o.withCtx(()=>[o.createElementVNode("div",{class:o.normalizeClass([[i.value===u.value?"bg-ed-accent border border-ed-accent-foreground":""],"h-[72px] flex flex-col w-[72px] box-border rounded-sm border"])},[o.createElementVNode("ol",{style:o.normalizeStyle({listStyleType:u.value,lineHeight:1}),class:"text-[12px] pl-3 flex-1 list-outside flex flex-col items-center justify-center"},[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(3,c=>o.createElementVNode("li",{key:c},l[0]||(l[0]=[o.createElementVNode("hr",{class:"border-0 bg-gray-200 h-[3px] w-6 my-1"},null,-1)]))),64))],4)],2)]),_:2},1032,["onClick"])]),_:2},1024),o.createVNode(o.unref(is),{side:"bottom"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)(u.label)),1)]),_:2},1024)]),_:2},1024)),64))]),_:1})]),_:1},8,["action","disabled","tooltip","is-active","shortcut-keys"]))}}),Wq=zq.extend({addAttributes(){return{...this.parent?.(),listType:{default:"decimal",parseHTML:t=>{t.style.getPropertyValue("list-style-type")},renderHTML:({listType:t})=>({style:`list-style-type: ${t}`})}}},addOptions(){return{...this.parent?.(),button:({editor:t,t:e})=>({component:Uq,componentProps:{action:()=>t.commands.toggleOrderedList(),isActive:()=>t.isActive("orderedList")||!1,disabled:!t.can().toggleOrderedList(),icon:"ListOrdered",shortcutKeys:["mod","shift","7"],tooltip:e("editor.orderedlist.tooltip")}})}}}),jq=/^\s*(\[([( |x])?\])\s$/,qq=Lt.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList"}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{const e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:e}){return["li",wt(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:n,editor:r})=>{const i=document.createElement("li"),s=document.createElement("label"),a=document.createElement("span"),l=document.createElement("input"),u=document.createElement("div");return s.contentEditable="false",l.type="checkbox",l.addEventListener("mousedown",c=>c.preventDefault()),l.addEventListener("change",c=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){l.checked=!l.checked;return}const{checked:f}=c.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:p})=>{const m=n();if(typeof m!="number")return!1;const g=p.doc.nodeAt(m);return p.setNodeMarkup(m,void 0,{...g?.attrs,checked:f}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,f)||(l.checked=!l.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([c,f])=>{i.setAttribute(c,f)}),i.dataset.checked=t.attrs.checked,l.checked=t.attrs.checked,s.append(l,a),i.append(s,u),Object.entries(e).forEach(([c,f])=>{i.setAttribute(c,f)}),{dom:i,contentDOM:u,update:c=>c.type!==this.type?!1:(i.dataset.checked=c.attrs.checked,l.checked=c.attrs.checked,!0)}}},addInputRules(){return[al({find:jq,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),Kq=Lt.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",wt(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}).extend({addOptions(){return{...this.parent?.(),HTMLAttributes:{class:"task-list"},taskItem:{HTMLAttributes:{class:"task-list-item"}},button:({editor:t,t:e})=>({component:Ge,componentProps:{action:()=>t.commands.toggleTaskList(),isActive:()=>t.isActive("taskList")||!1,disabled:!t.can().toggleTaskList(),icon:"ListTodo",shortcutKeys:["shift","mod","9"],tooltip:e("editor.tasklist.tooltip")}})}},addExtensions(){return[qq.configure(this.options.taskItem)]}}),Gq=/^\s*>\s$/,Xq=Lt.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",wt(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[al({find:Gq,type:this.type})]}}).extend({addOptions(){return{...this.parent?.(),HTMLAttributes:{class:"blockquote"},button:({editor:t,t:e})=>({component:Ge,componentProps:{action:()=>t.commands.toggleBlockquote(),isActive:()=>t.isActive("blockquote")||!1,disabled:!t.can().toggleBlockquote(),icon:"TextQuote",shortcutKeys:["shift","mod","B"],tooltip:e("editor.blockquote.tooltip")}})}}}),Yq="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",Jq="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Vl=(t,e)=>{for(const n in e)t[n]=e[n];return t},av="numeric",lv="ascii",uv="alpha",yc="asciinumeric",wc="alphanumeric",cv="domain",y5="emoji",Zq="scheme",Qq="slashscheme",dv="whitespace";function Nq(t,e){return t in e||(e[t]=[]),e[t]}function ka(t,e,n){e[av]&&(e[yc]=!0,e[wc]=!0),e[lv]&&(e[yc]=!0,e[uv]=!0),e[yc]&&(e[wc]=!0),e[uv]&&(e[wc]=!0),e[wc]&&(e[cv]=!0),e[y5]&&(e[cv]=!0);for(const r in e){const i=Nq(r,n);i.indexOf(t)<0&&i.push(t)}}function eK(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function ar(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}ar.groups={},ar.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let r=0;r<e.jr.length;r++){const i=e.jr[r][0],s=e.jr[r][1];if(s&&i.test(t))return s}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,n,r){for(let i=0;i<t.length;i++)this.tt(t[i],e,n,r)},tr(t,e,n,r){r=r||ar.groups;let i;return e&&e.j?i=e:(i=new ar(e),n&&r&&ka(e,n,r)),this.jr.push([t,i]),i},ts(t,e,n,r){let i=this;const s=t.length;if(!s)return i;for(let a=0;a<s-1;a++)i=i.tt(t[a]);return i.tt(t[s-1],e,n,r)},tt(t,e,n,r){r=r||ar.groups;const i=this;if(e&&e.j)return i.j[t]=e,e;const s=e;let a,l=i.go(t);if(l?(a=new ar,Vl(a.j,l.j),a.jr.push.apply(a.jr,l.jr),a.jd=l.jd,a.t=l.t):a=new ar,s){if(r)if(a.t&&typeof a.t=="string"){const u=Vl(eK(a.t,r),n);ka(s,u,r)}else n&&ka(s,n,r);a.t=s}return i.j[t]=a,a}};const mt=(t,e,n,r,i)=>t.ta(e,n,r,i),rn=(t,e,n,r,i)=>t.tr(e,n,r,i),w5=(t,e,n,r,i)=>t.ts(e,n,r,i),Ce=(t,e,n,r,i)=>t.tt(e,n,r,i),bi="WORD",fv="UWORD",x5="ASCIINUMERICAL",C5="ALPHANUMERICAL",xc="LOCALHOST",pv="TLD",hv="UTLD",vp="SCHEME",Fl="SLASH_SCHEME",mv="NUM",gv="WS",vv="NL",Cc="OPENBRACE",kc="CLOSEBRACE",bp="OPENBRACKET",yp="CLOSEBRACKET",wp="OPENPAREN",xp="CLOSEPAREN",Cp="OPENANGLEBRACKET",kp="CLOSEANGLEBRACKET",Ep="FULLWIDTHLEFTPAREN",Sp="FULLWIDTHRIGHTPAREN",_p="LEFTCORNERBRACKET",Tp="RIGHTCORNERBRACKET",Ap="LEFTWHITECORNERBRACKET",Mp="RIGHTWHITECORNERBRACKET",Op="FULLWIDTHLESSTHAN",Bp="FULLWIDTHGREATERTHAN",Ip="AMPERSAND",bv="APOSTROPHE",Lp="ASTERISK",vs="AT",Rp="BACKSLASH",Dp="BACKTICK",Pp="CARET",bs="COLON",yv="COMMA",Vp="DOLLAR",Uo="DOT",Fp="EQUALS",wv="EXCLAMATION",jr="HYPHEN",Ec="PERCENT",$p="PIPE",Hp="PLUS",zp="POUND",Sc="QUERY",xv="QUOTE",k5="FULLWIDTHMIDDLEDOT",Cv="SEMI",Wo="SLASH",_c="TILDE",Up="UNDERSCORE",E5="EMOJI",Wp="SYM";var S5=Object.freeze({__proto__:null,WORD:bi,UWORD:fv,ASCIINUMERICAL:x5,ALPHANUMERICAL:C5,LOCALHOST:xc,TLD:pv,UTLD:hv,SCHEME:vp,SLASH_SCHEME:Fl,NUM:mv,WS:gv,NL:vv,OPENBRACE:Cc,CLOSEBRACE:kc,OPENBRACKET:bp,CLOSEBRACKET:yp,OPENPAREN:wp,CLOSEPAREN:xp,OPENANGLEBRACKET:Cp,CLOSEANGLEBRACKET:kp,FULLWIDTHLEFTPAREN:Ep,FULLWIDTHRIGHTPAREN:Sp,LEFTCORNERBRACKET:_p,RIGHTCORNERBRACKET:Tp,LEFTWHITECORNERBRACKET:Ap,RIGHTWHITECORNERBRACKET:Mp,FULLWIDTHLESSTHAN:Op,FULLWIDTHGREATERTHAN:Bp,AMPERSAND:Ip,APOSTROPHE:bv,ASTERISK:Lp,AT:vs,BACKSLASH:Rp,BACKTICK:Dp,CARET:Pp,COLON:bs,COMMA:yv,DOLLAR:Vp,DOT:Uo,EQUALS:Fp,EXCLAMATION:wv,HYPHEN:jr,PERCENT:Ec,PIPE:$p,PLUS:Hp,POUND:zp,QUERY:Sc,QUOTE:xv,FULLWIDTHMIDDLEDOT:k5,SEMI:Cv,SLASH:Wo,TILDE:_c,UNDERSCORE:Up,EMOJI:E5,SYM:Wp});const yi=/[a-z]/,Tc=new RegExp("\\p{L}","u"),kv=new RegExp("\\p{Emoji}","u"),wi=/\d/,Ev=/\s/,_5="\r",Sv=`
|
|
323
|
+
*/const oW="10.0.6";function iW(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(ba().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(ba().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(ba().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(ba().__INTLIFY_PROD_DEVTOOLS__=!1)}const fs={FALLBACK_TO_ROOT:SU,NOT_FOUND_PARENT_SCOPE:9,IGNORE_OBJ_FLATTEN:10,DEPRECATE_TC:11},sW={[fs.FALLBACK_TO_ROOT]:"Fall back to {type} '{key}' with root locale.",[fs.NOT_FOUND_PARENT_SCOPE]:"Not found parent scope. use the global scope.",[fs.IGNORE_OBJ_FLATTEN]:"Ignore object flatten: '{key}' key has an string value",[fs.DEPRECATE_TC]:"'tc' and '$tc' has been deprecated in v10. Use 't' or '$t' instead. 'tc' and '$tc’ are going to remove in v11."};function up(t,...e){return ep(sW[t],...e)}const Ht={UNEXPECTED_RETURN_TYPE:fU,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:30,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32,NOT_COMPATIBLE_LEGACY_VUE_I18N:33,NOT_AVAILABLE_COMPOSITION_IN_LEGACY:34};function Qn(t,...e){return Bl(t,null,process.env.NODE_ENV!=="production"?{messages:aW,args:e}:void 0)}const aW={[Ht.UNEXPECTED_RETURN_TYPE]:"Unexpected return type in composer",[Ht.INVALID_ARGUMENT]:"Invalid argument",[Ht.MUST_BE_CALL_SETUP_TOP]:"Must be called at the top of a `setup` function",[Ht.NOT_INSTALLED]:"Need to install with `app.use` function",[Ht.UNEXPECTED_ERROR]:"Unexpected error",[Ht.REQUIRED_VALUE]:"Required in value: {0}",[Ht.INVALID_VALUE]:"Invalid value",[Ht.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN]:"Cannot setup vue-devtools plugin",[Ht.NOT_INSTALLED_WITH_PROVIDE]:"Need to install with `provide` function",[Ht.NOT_COMPATIBLE_LEGACY_VUE_I18N]:"Not compatible legacy VueI18n.",[Ht.NOT_AVAILABLE_COMPOSITION_IN_LEGACY]:"Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly"},U1=Ho("__translateVNode"),W1=Ho("__datetimeParts"),j1=Ho("__numberParts"),wa=Ho("__enableEmitter"),mc=Ho("__disableEmitter"),L8=Ho("__setPluralRules"),R8=Ho("__injectWithOption"),q1=Ho("__dispose");function gc(t){if(!kt(t))return t;for(const e in t)if(po(t,e))if(!e.includes("."))kt(t[e])&&gc(t[e]);else{const n=e.split("."),r=n.length-1;let i=t,s=!1;for(let a=0;a<r;a++){if(n[a]==="__proto__")throw new Error(`unsafe key: ${n[a]}`);if(n[a]in i||(i[n[a]]=Dt()),!kt(i[n[a]])){process.env.NODE_ENV!=="production"&&as(up(fs.IGNORE_OBJ_FLATTEN,{key:n[a]})),s=!0;break}i=i[n[a]]}s||(i[n[r]]=t[e],delete t[e]),kt(i[n[r]])&&gc(i[n[r]])}return t}function K1(t,e){const{messages:n,__i18n:r,messageResolver:i,flatJson:s}=e,a=ht(n)?n:en(r)?Dt():{[t]:Dt()};if(en(r)&&r.forEach(l=>{if("locale"in l&&"resource"in l){const{locale:u,resource:c}=l;u?(a[u]=a[u]||Dt(),rp(c,a[u])):rp(c,a)}else Oe(l)&&rp(JSON.parse(l),a)}),i==null&&s)for(const l in a)po(a,l)&&gc(a[l]);return a}function D8(t){return t.type}function P8(t,e,n){let r=kt(e.messages)?e.messages:Dt();"__i18nGlobal"in n&&(r=K1(t.locale.value,{messages:r,__i18n:n.__i18nGlobal}));const i=Object.keys(r);i.length&&i.forEach(s=>{t.mergeLocaleMessage(s,r[s])});{if(kt(e.datetimeFormats)){const s=Object.keys(e.datetimeFormats);s.length&&s.forEach(a=>{t.mergeDateTimeFormat(a,e.datetimeFormats[a])})}if(kt(e.numberFormats)){const s=Object.keys(e.numberFormats);s.length&&s.forEach(a=>{t.mergeNumberFormat(a,e.numberFormats[a])})}}}function V8(t){return o.createVNode(o.Text,null,t,0)}const F8="__INTLIFY_META__",$8=()=>[],lW=()=>!1;let H8=0;function z8(t){return(e,n,r,i)=>t(n,r,o.getCurrentInstance()||void 0,i)}const uW=()=>{const t=o.getCurrentInstance();let e=null;return t&&(e=D8(t)[F8])?{[F8]:e}:null};function G1(t={}){const{__root:e,__injectWithOption:n}=t,r=e===void 0,i=t.flatJson,s=fo?o.ref:o.shallowRef;let a=_t(t.inheritLocale)?t.inheritLocale:!0;const l=s(e&&a?e.locale.value:Oe(t.locale)?t.locale:pc),u=s(e&&a?e.fallbackLocale.value:Oe(t.fallbackLocale)||en(t.fallbackLocale)||ht(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:l.value),c=s(K1(l.value,t)),f=s(ht(t.datetimeFormats)?t.datetimeFormats:{[l.value]:{}}),p=s(ht(t.numberFormats)?t.numberFormats:{[l.value]:{}});let m=e?e.missingWarn:_t(t.missingWarn)||Ol(t.missingWarn)?t.missingWarn:!0,g=e?e.fallbackWarn:_t(t.fallbackWarn)||Ol(t.fallbackWarn)?t.fallbackWarn:!0,v=e?e.fallbackRoot:_t(t.fallbackRoot)?t.fallbackRoot:!0,b=!!t.fallbackFormat,w=$t(t.missing)?t.missing:null,x=$t(t.missing)?z8(t.missing):null,C=$t(t.postTranslation)?t.postTranslation:null,E=e?e.warnHtmlMessage:_t(t.warnHtmlMessage)?t.warnHtmlMessage:!0,k=!!t.escapeParameter;const T=e?e.modifiers:ht(t.modifiers)?t.modifiers:{};let _=t.pluralRules||e&&e.pluralRules,A;A=(()=>{r&&m8(null);const $={version:oW,locale:l.value,fallbackLocale:u.value,messages:c.value,modifiers:T,pluralRules:_,missing:x===null?void 0:x,missingWarn:m,fallbackWarn:g,fallbackFormat:b,unresolving:!0,postTranslation:C===null?void 0:C,warnHtmlMessage:E,escapeParameter:k,messageResolver:t.messageResolver,messageCompiler:t.messageCompiler,__meta:{framework:"vue"}};$.datetimeFormats=f.value,$.numberFormats=p.value,$.__datetimeFormatters=ht(A)?A.__datetimeFormatters:void 0,$.__numberFormatters=ht(A)?A.__numberFormatters:void 0,process.env.NODE_ENV!=="production"&&($.__v_emitter=ht(A)?A.__v_emitter:void 0);const ne=DU($);return r&&m8(ne),ne})(),hc(A,l.value,u.value);function O(){return[l.value,u.value,c.value,f.value,p.value]}const B=o.computed({get:()=>l.value,set:$=>{l.value=$,A.locale=l.value}}),H=o.computed({get:()=>u.value,set:$=>{u.value=$,A.fallbackLocale=u.value,hc(A,l.value,$)}}),j=o.computed(()=>c.value),Y=o.computed(()=>f.value),N=o.computed(()=>p.value);function U(){return $t(C)?C:null}function P($){C=$,A.postTranslation=$}function L(){return w}function F($){$!==null&&(x=z8($)),w=$,A.missing=x}function R($,ne){return $!=="translate"||!ne.resolvedMessage}const K=($,ne,oe,we,$e,tt)=>{O();let Tt;try{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,r||(A.fallbackContext=e?RU():void 0),Tt=$(A)}finally{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,r||(A.fallbackContext=void 0)}if(oe!=="translate exists"&&cn(Tt)&&Tt===sp||oe==="translate exists"&&!Tt){const[ue,je]=ne();if(process.env.NODE_ENV!=="production"&&e&&Oe(ue)&&R(oe,je)&&(v&&(lp(g,ue)||v8(m,ue))&&as(up(fs.FALLBACK_TO_ROOT,{key:ue,type:oe})),process.env.NODE_ENV!=="production")){const{__v_emitter:re}=A;re&&v&&re.emit("fallback",{type:oe,key:ue,to:"global",groupId:`${oe}:${ue}`})}return e&&v?we(e):$e(ue)}else{if(tt(Tt))return Tt;throw Qn(Ht.UNEXPECTED_RETURN_TYPE)}};function X(...$){return K(ne=>Reflect.apply(M8,null,[ne,...$]),()=>H1(...$),"translate",ne=>Reflect.apply(ne.t,ne,[...$]),ne=>ne,ne=>Oe(ne))}function ae(...$){const[ne,oe,we]=$;if(we&&!kt(we))throw Qn(Ht.INVALID_ARGUMENT);return X(ne,oe,yn({resolvedMessage:!0},we||{}))}function de(...$){return K(ne=>Reflect.apply(x8,null,[ne,...$]),()=>F1(...$),"datetime format",ne=>Reflect.apply(ne.d,ne,[...$]),()=>ap,ne=>Oe(ne))}function Ee(...$){return K(ne=>Reflect.apply(E8,null,[ne,...$]),()=>$1(...$),"number format",ne=>Reflect.apply(ne.n,ne,[...$]),()=>ap,ne=>Oe(ne))}function ie($){return $.map(ne=>Oe(ne)||cn(ne)||_t(ne)?V8(String(ne)):ne)}const J={normalize:ie,interpolate:$=>$,type:"vnode"};function ee(...$){return K(ne=>{let oe;const we=ne;try{we.processor=J,oe=Reflect.apply(M8,null,[we,...$])}finally{we.processor=null}return oe},()=>H1(...$),"translate",ne=>ne[U1](...$),ne=>[V8(ne)],ne=>en(ne))}function te(...$){return K(ne=>Reflect.apply(E8,null,[ne,...$]),()=>$1(...$),"number format",ne=>ne[j1](...$),$8,ne=>Oe(ne)||en(ne))}function se(...$){return K(ne=>Reflect.apply(x8,null,[ne,...$]),()=>F1(...$),"datetime format",ne=>ne[W1](...$),$8,ne=>Oe(ne)||en(ne))}function pe($){_=$,A.pluralRules=_}function _e($,ne){return K(()=>{if(!$)return!1;const oe=Oe(ne)?ne:l.value,we=We(oe),$e=A.messageResolver(we,$);return cs($e)||Wr($e)||Oe($e)},()=>[$],"translate exists",oe=>Reflect.apply(oe.te,oe,[$,ne]),lW,oe=>_t(oe))}function Ae($){let ne=null;const oe=s8(A,u.value,l.value);for(let we=0;we<oe.length;we++){const $e=c.value[oe[we]]||{},tt=A.messageResolver($e,$);if(tt!=null){ne=tt;break}}return ne}function Ue($){const ne=Ae($);return ne??(e?e.tm($)||{}:{})}function We($){return c.value[$]||{}}function qe($,ne){if(i){const oe={[$]:ne};for(const we in oe)po(oe,we)&&gc(oe[we]);ne=oe[$]}c.value[$]=ne,A.messages=c.value}function At($,ne){c.value[$]=c.value[$]||{};const oe={[$]:ne};if(i)for(const we in oe)po(oe,we)&&gc(oe[we]);ne=oe[$],rp(ne,c.value[$]),A.messages=c.value}function q($){return f.value[$]||{}}function z($,ne){f.value[$]=ne,A.datetimeFormats=f.value,k8(A,$,ne)}function he($,ne){f.value[$]=yn(f.value[$]||{},ne),A.datetimeFormats=f.value,k8(A,$,ne)}function xe($){return p.value[$]||{}}function Pe($,ne){p.value[$]=ne,A.numberFormats=p.value,_8(A,$,ne)}function rt($,ne){p.value[$]=yn(p.value[$]||{},ne),A.numberFormats=p.value,_8(A,$,ne)}H8++,e&&fo&&(o.watch(e.locale,$=>{a&&(l.value=$,A.locale=$,hc(A,l.value,u.value))}),o.watch(e.fallbackLocale,$=>{a&&(u.value=$,A.fallbackLocale=$,hc(A,l.value,u.value))}));const Ke={id:H8,locale:B,fallbackLocale:H,get inheritLocale(){return a},set inheritLocale($){a=$,$&&e&&(l.value=e.locale.value,u.value=e.fallbackLocale.value,hc(A,l.value,u.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:j,get modifiers(){return T},get pluralRules(){return _||{}},get isGlobal(){return r},get missingWarn(){return m},set missingWarn($){m=$,A.missingWarn=m},get fallbackWarn(){return g},set fallbackWarn($){g=$,A.fallbackWarn=g},get fallbackRoot(){return v},set fallbackRoot($){v=$},get fallbackFormat(){return b},set fallbackFormat($){b=$,A.fallbackFormat=b},get warnHtmlMessage(){return E},set warnHtmlMessage($){E=$,A.warnHtmlMessage=$},get escapeParameter(){return k},set escapeParameter($){k=$,A.escapeParameter=$},t:X,getLocaleMessage:We,setLocaleMessage:qe,mergeLocaleMessage:At,getPostTranslationHandler:U,setPostTranslationHandler:P,getMissingHandler:L,setMissingHandler:F,[L8]:pe};return Ke.datetimeFormats=Y,Ke.numberFormats=N,Ke.rt=ae,Ke.te=_e,Ke.tm=Ue,Ke.d=de,Ke.n=Ee,Ke.getDateTimeFormat=q,Ke.setDateTimeFormat=z,Ke.mergeDateTimeFormat=he,Ke.getNumberFormat=xe,Ke.setNumberFormat=Pe,Ke.mergeNumberFormat=rt,Ke[R8]=n,Ke[U1]=ee,Ke[W1]=se,Ke[j1]=te,process.env.NODE_ENV!=="production"&&(Ke[wa]=$=>{A.__v_emitter=$},Ke[mc]=()=>{A.__v_emitter=void 0}),Ke}const U8="vue-i18n: composer properties",X1={"vue-devtools-plugin-vue-i18n":"Vue I18n DevTools","vue-i18n-resource-inspector":"Vue I18n DevTools","vue-i18n-timeline":"Vue I18n"},cW={"vue-i18n-resource-inspector":"Search for scopes ..."},dW={"vue-i18n-timeline":16764185};let Y1;async function fW(t,e){return new Promise((n,r)=>{try{rW({id:"vue-devtools-plugin-vue-i18n",label:X1["vue-devtools-plugin-vue-i18n"],packageName:"vue-i18n",homepage:"https://vue-i18n.intlify.dev",logo:"https://vue-i18n.intlify.dev/vue-i18n-devtools-logo.png",componentStateTypes:[U8],app:t},i=>{Y1=i,i.on.visitComponentTree(({componentInstance:a,treeNode:l})=>{pW(a,l,e)}),i.on.inspectComponent(({componentInstance:a,instanceData:l})=>{a.vnode.el&&a.vnode.el.__VUE_I18N__&&l&&(e.mode==="legacy"?a.vnode.el.__VUE_I18N__!==e.global.__composer&&j8(l,a.vnode.el.__VUE_I18N__):j8(l,a.vnode.el.__VUE_I18N__))}),i.addInspector({id:"vue-i18n-resource-inspector",label:X1["vue-i18n-resource-inspector"],icon:"language",treeFilterPlaceholder:cW["vue-i18n-resource-inspector"]}),i.on.getInspectorTree(a=>{a.app===t&&a.inspectorId==="vue-i18n-resource-inspector"&&bW(a,e)});const s=new Map;i.on.getInspectorState(async a=>{if(a.app===t&&a.inspectorId==="vue-i18n-resource-inspector")if(i.unhighlightElement(),wW(a,e),a.nodeId==="global"){if(!s.has(a.app)){const[l]=await i.getComponentInstances(a.app);s.set(a.app,l)}i.highlightElement(s.get(a.app))}else{const l=yW(a.nodeId,e);l&&i.highlightElement(l)}}),i.on.editInspectorState(a=>{a.app===t&&a.inspectorId==="vue-i18n-resource-inspector"&&CW(a,e)}),i.addTimelineLayer({id:"vue-i18n-timeline",label:X1["vue-i18n-timeline"],color:dW["vue-i18n-timeline"]}),n(!0)})}catch(i){console.error(i),r(!1)}})}function W8(t){return t.type.name||t.type.displayName||t.type.__file||"Anonymous"}function pW(t,e,n){const r=n.mode==="composition"?n.global:n.global.__composer;if(t&&t.vnode.el&&t.vnode.el.__VUE_I18N__&&t.vnode.el.__VUE_I18N__!==r){const i={label:`i18n (${W8(t)} Scope)`,textColor:0,backgroundColor:16764185};e.tags.push(i)}}function j8(t,e){const n=U8;t.state.push({type:n,key:"locale",editable:!0,value:e.locale.value}),t.state.push({type:n,key:"availableLocales",editable:!1,value:e.availableLocales}),t.state.push({type:n,key:"fallbackLocale",editable:!0,value:e.fallbackLocale.value}),t.state.push({type:n,key:"inheritLocale",editable:!0,value:e.inheritLocale}),t.state.push({type:n,key:"messages",editable:!1,value:J1(e.messages.value)}),t.state.push({type:n,key:"datetimeFormats",editable:!1,value:e.datetimeFormats.value}),t.state.push({type:n,key:"numberFormats",editable:!1,value:e.numberFormats.value})}function J1(t){const e={};return Object.keys(t).forEach(n=>{const r=t[n];$t(r)&&"source"in r?e[n]=vW(r):cs(r)&&r.loc&&r.loc.source?e[n]=r.loc.source:kt(r)?e[n]=J1(r):e[n]=r}),e}const hW={"<":"<",">":">",'"':""","&":"&"};function mW(t){return t.replace(/[<>"&]/g,gW)}function gW(t){return hW[t]||t}function vW(t){return{_custom:{type:"function",display:`<span>ƒ</span> ${t.source?`("${mW(t.source)}")`:"(?)"}`}}}function bW(t,e){t.rootNodes.push({id:"global",label:"Global Scope"});const n=e.mode==="composition"?e.global:e.global.__composer;for(const[r,i]of e.__instances){const s=e.mode==="composition"?i:i.__composer;n!==s&&t.rootNodes.push({id:s.id.toString(),label:`${W8(r)} Scope`})}}function yW(t,e){let n=null;if(t!=="global"){for(const[r,i]of e.__instances.entries())if(i.id.toString()===t){n=r;break}}return n}function q8(t,e){if(t==="global")return e.mode==="composition"?e.global:e.global.__composer;{const n=Array.from(e.__instances.values()).find(r=>r.id.toString()===t);return n?e.mode==="composition"?n:n.__composer:null}}function wW(t,e){const n=q8(t.nodeId,e);return n&&(t.state=xW(n)),null}function xW(t){const e={},n="Locale related info",r=[{type:n,key:"locale",editable:!0,value:t.locale.value},{type:n,key:"fallbackLocale",editable:!0,value:t.fallbackLocale.value},{type:n,key:"availableLocales",editable:!1,value:t.availableLocales},{type:n,key:"inheritLocale",editable:!0,value:t.inheritLocale}];e[n]=r;const i="Locale messages info",s=[{type:i,key:"messages",editable:!1,value:J1(t.messages.value)}];e[i]=s;{const a="Datetime formats info",l=[{type:a,key:"datetimeFormats",editable:!1,value:t.datetimeFormats.value}];e[a]=l;const u="Datetime formats info",c=[{type:u,key:"numberFormats",editable:!1,value:t.numberFormats.value}];e[u]=c}return e}function vc(t,e){if(Y1){let n;e&&"groupId"in e&&(n=e.groupId,delete e.groupId),Y1.addTimelineEvent({layerId:"vue-i18n-timeline",event:{title:t,groupId:n,time:Date.now(),meta:{},data:e||{},logType:t==="compile-error"?"error":t==="fallback"||t==="missing"?"warning":"default"}})}}function CW(t,e){const n=q8(t.nodeId,e);if(n){const[r]=t.path;r==="locale"&&Oe(t.state.value)?n.locale.value=t.state.value:r==="fallbackLocale"&&(Oe(t.state.value)||en(t.state.value)||kt(t.state.value))?n.fallbackLocale.value=t.state.value:r==="inheritLocale"&&_t(t.state.value)&&(n.inheritLocale=t.state.value)}}function kW(t){const e=Oe(t.locale)?t.locale:pc,n=Oe(t.fallbackLocale)||en(t.fallbackLocale)||ht(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:e,r=$t(t.missing)?t.missing:void 0,i=_t(t.silentTranslationWarn)||Ol(t.silentTranslationWarn)?!t.silentTranslationWarn:!0,s=_t(t.silentFallbackWarn)||Ol(t.silentFallbackWarn)?!t.silentFallbackWarn:!0,a=_t(t.fallbackRoot)?t.fallbackRoot:!0,l=!!t.formatFallbackMessages,u=ht(t.modifiers)?t.modifiers:{},c=t.pluralizationRules,f=$t(t.postTranslation)?t.postTranslation:void 0,p=Oe(t.warnHtmlInMessage)?t.warnHtmlInMessage!=="off":!0,m=!!t.escapeParameterHtml,g=_t(t.sync)?t.sync:!0;let v=t.messages;if(ht(t.sharedMessages)){const T=t.sharedMessages;v=Object.keys(T).reduce((A,V)=>{const O=A[V]||(A[V]={});return yn(O,T[V]),A},v||{})}const{__i18n:b,__root:w,__injectWithOption:x}=t,C=t.datetimeFormats,E=t.numberFormats,k=t.flatJson;return{locale:e,fallbackLocale:n,messages:v,flatJson:k,datetimeFormats:C,numberFormats:E,missing:r,missingWarn:i,fallbackWarn:s,fallbackRoot:a,fallbackFormat:l,modifiers:u,pluralRules:c,postTranslation:f,warnHtmlMessage:p,escapeParameter:m,messageResolver:t.messageResolver,inheritLocale:g,__i18n:b,__root:w,__injectWithOption:x}}function Z1(t={}){const e=G1(kW(t)),{__extender:n}=t,r={id:e.id,get locale(){return e.locale.value},set locale(i){e.locale.value=i},get fallbackLocale(){return e.fallbackLocale.value},set fallbackLocale(i){e.fallbackLocale.value=i},get messages(){return e.messages.value},get datetimeFormats(){return e.datetimeFormats.value},get numberFormats(){return e.numberFormats.value},get availableLocales(){return e.availableLocales},get missing(){return e.getMissingHandler()},set missing(i){e.setMissingHandler(i)},get silentTranslationWarn(){return _t(e.missingWarn)?!e.missingWarn:e.missingWarn},set silentTranslationWarn(i){e.missingWarn=_t(i)?!i:i},get silentFallbackWarn(){return _t(e.fallbackWarn)?!e.fallbackWarn:e.fallbackWarn},set silentFallbackWarn(i){e.fallbackWarn=_t(i)?!i:i},get modifiers(){return e.modifiers},get formatFallbackMessages(){return e.fallbackFormat},set formatFallbackMessages(i){e.fallbackFormat=i},get postTranslation(){return e.getPostTranslationHandler()},set postTranslation(i){e.setPostTranslationHandler(i)},get sync(){return e.inheritLocale},set sync(i){e.inheritLocale=i},get warnHtmlInMessage(){return e.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(i){e.warnHtmlMessage=i!=="off"},get escapeParameterHtml(){return e.escapeParameter},set escapeParameterHtml(i){e.escapeParameter=i},get pluralizationRules(){return e.pluralRules||{}},__composer:e,t(...i){return Reflect.apply(e.t,e,[...i])},rt(...i){return Reflect.apply(e.rt,e,[...i])},tc(...i){const[s,a,l]=i,u={plural:1};let c=null,f=null;if(process.env.NODE_ENV!=="production"&&e8(up(fs.DEPRECATE_TC)),!Oe(s))throw Qn(Ht.INVALID_ARGUMENT);const p=s;return Oe(a)?u.locale=a:cn(a)?u.plural=a:en(a)?c=a:ht(a)&&(f=a),Oe(l)?u.locale=l:en(l)?c=l:ht(l)&&(f=l),Reflect.apply(e.t,e,[p,c||f||{},u])},te(i,s){return e.te(i,s)},tm(i){return e.tm(i)},getLocaleMessage(i){return e.getLocaleMessage(i)},setLocaleMessage(i,s){e.setLocaleMessage(i,s)},mergeLocaleMessage(i,s){e.mergeLocaleMessage(i,s)},d(...i){return Reflect.apply(e.d,e,[...i])},getDateTimeFormat(i){return e.getDateTimeFormat(i)},setDateTimeFormat(i,s){e.setDateTimeFormat(i,s)},mergeDateTimeFormat(i,s){e.mergeDateTimeFormat(i,s)},n(...i){return Reflect.apply(e.n,e,[...i])},getNumberFormat(i){return e.getNumberFormat(i)},setNumberFormat(i,s){e.setNumberFormat(i,s)},mergeNumberFormat(i,s){e.mergeNumberFormat(i,s)}};return r.__extender=n,process.env.NODE_ENV!=="production"&&(r.__enableEmitter=i=>{const s=e;s[wa]&&s[wa](i)},r.__disableEmitter=()=>{const i=e;i[mc]&&i[mc]()}),r}function EW(t,e,n){return{beforeCreate(){const r=o.getCurrentInstance();if(!r)throw Qn(Ht.UNEXPECTED_ERROR);const i=this.$options;if(i.i18n){const s=i.i18n;if(i.__i18n&&(s.__i18n=i.__i18n),s.__root=e,this===this.$root)this.$i18n=K8(t,s);else{s.__injectWithOption=!0,s.__extender=n.__vueI18nExtend,this.$i18n=Z1(s);const a=this.$i18n;a.__extender&&(a.__disposer=a.__extender(this.$i18n))}}else if(i.__i18n)if(this===this.$root)this.$i18n=K8(t,i);else{this.$i18n=Z1({__i18n:i.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:e});const s=this.$i18n;s.__extender&&(s.__disposer=s.__extender(this.$i18n))}else this.$i18n=t;i.__i18nGlobal&&P8(e,i,i),this.$t=(...s)=>this.$i18n.t(...s),this.$rt=(...s)=>this.$i18n.rt(...s),this.$tc=(...s)=>this.$i18n.tc(...s),this.$te=(s,a)=>this.$i18n.te(s,a),this.$d=(...s)=>this.$i18n.d(...s),this.$n=(...s)=>this.$i18n.n(...s),this.$tm=s=>this.$i18n.tm(s),n.__setInstance(r,this.$i18n)},mounted(){if(process.env.NODE_ENV!=="production"&&this.$el&&this.$i18n){const r=this.$i18n;this.$el.__VUE_I18N__=r.__composer;const i=this.__v_emitter=A1();r.__enableEmitter&&r.__enableEmitter(i),i.on("*",vc)}},unmounted(){const r=o.getCurrentInstance();if(!r)throw Qn(Ht.UNEXPECTED_ERROR);const i=this.$i18n;process.env.NODE_ENV!=="production"&&this.$el&&this.$el.__VUE_I18N__&&(this.__v_emitter&&(this.__v_emitter.off("*",vc),delete this.__v_emitter),this.$i18n&&(i.__disableEmitter&&i.__disableEmitter(),delete this.$el.__VUE_I18N__)),delete this.$t,delete this.$rt,delete this.$tc,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,i.__disposer&&(i.__disposer(),delete i.__disposer,delete i.__extender),n.__deleteInstance(r),delete this.$i18n}}}function K8(t,e){t.locale=e.locale||t.locale,t.fallbackLocale=e.fallbackLocale||t.fallbackLocale,t.missing=e.missing||t.missing,t.silentTranslationWarn=e.silentTranslationWarn||t.silentFallbackWarn,t.silentFallbackWarn=e.silentFallbackWarn||t.silentFallbackWarn,t.formatFallbackMessages=e.formatFallbackMessages||t.formatFallbackMessages,t.postTranslation=e.postTranslation||t.postTranslation,t.warnHtmlInMessage=e.warnHtmlInMessage||t.warnHtmlInMessage,t.escapeParameterHtml=e.escapeParameterHtml||t.escapeParameterHtml,t.sync=e.sync||t.sync,t.__composer[L8](e.pluralizationRules||t.pluralizationRules);const n=K1(t.locale,{messages:e.messages,__i18n:e.__i18n});return Object.keys(n).forEach(r=>t.mergeLocaleMessage(r,n[r])),e.datetimeFormats&&Object.keys(e.datetimeFormats).forEach(r=>t.mergeDateTimeFormat(r,e.datetimeFormats[r])),e.numberFormats&&Object.keys(e.numberFormats).forEach(r=>t.mergeNumberFormat(r,e.numberFormats[r])),t}const Q1={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:t=>t==="parent"||t==="global",default:"parent"},i18n:{type:Object}};function SW({slots:t},e){return e.length===1&&e[0]==="default"?(t.default?t.default():[]).reduce((r,i)=>[...r,...i.type===o.Fragment?i.children:[i]],[]):e.reduce((n,r)=>{const i=t[r];return i&&(n[r]=i()),n},Dt())}function G8(){return o.Fragment}const X8=o.defineComponent({name:"i18n-t",props:yn({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:t=>cn(t)||!isNaN(t)}},Q1),setup(t,e){const{slots:n,attrs:r}=e,i=t.i18n||Pt({useScope:t.scope,__useComponent:!0});return()=>{const s=Object.keys(n).filter(p=>p!=="_"),a=Dt();t.locale&&(a.locale=t.locale),t.plural!==void 0&&(a.plural=Oe(t.plural)?+t.plural:t.plural);const l=SW(e,s),u=i[U1](t.keypath,l,a),c=yn(Dt(),r),f=Oe(t.tag)||kt(t.tag)?t.tag:G8();return o.h(f,c,u)}}});function _W(t){return en(t)&&!Oe(t[0])}function Y8(t,e,n,r){const{slots:i,attrs:s}=e;return()=>{const a={part:!0};let l=Dt();t.locale&&(a.locale=t.locale),Oe(t.format)?a.key=t.format:kt(t.format)&&(Oe(t.format.key)&&(a.key=t.format.key),l=Object.keys(t.format).reduce((m,g)=>n.includes(g)?yn(Dt(),m,{[g]:t.format[g]}):m,Dt()));const u=r(t.value,a,l);let c=[a.key];en(u)?c=u.map((m,g)=>{const v=i[m.type],b=v?v({[m.type]:m.value,index:g,parts:u}):[m.value];return _W(b)&&(b[0].key=`${m.type}-${g}`),b}):Oe(u)&&(c=[u]);const f=yn(Dt(),s),p=Oe(t.tag)||kt(t.tag)?t.tag:G8();return o.h(p,f,c)}}const J8=o.defineComponent({name:"i18n-n",props:yn({value:{type:Number,required:!0},format:{type:[String,Object]}},Q1),setup(t,e){const n=t.i18n||Pt({useScope:t.scope,__useComponent:!0});return Y8(t,e,S8,(...r)=>n[j1](...r))}}),Z8=o.defineComponent({name:"i18n-d",props:yn({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},Q1),setup(t,e){const n=t.i18n||Pt({useScope:t.scope,__useComponent:!0});return Y8(t,e,C8,(...r)=>n[W1](...r))}});function TW(t,e){const n=t;if(t.mode==="composition")return n.__getInstance(e)||t.global;{const r=n.__getInstance(e);return r!=null?r.__composer:t.global.__composer}}function AW(t){const e=a=>{const{instance:l,value:u}=a;if(!l||!l.$)throw Qn(Ht.UNEXPECTED_ERROR);const c=TW(t,l.$),f=Q8(u);return[Reflect.apply(c.t,c,[...N8(f)]),c]};return{created:(a,l)=>{const[u,c]=e(l);fo&&t.global===c&&(a.__i18nWatcher=o.watch(c.locale,()=>{l.instance&&l.instance.$forceUpdate()})),a.__composer=c,a.textContent=u},unmounted:a=>{fo&&a.__i18nWatcher&&(a.__i18nWatcher(),a.__i18nWatcher=void 0,delete a.__i18nWatcher),a.__composer&&(a.__composer=void 0,delete a.__composer)},beforeUpdate:(a,{value:l})=>{if(a.__composer){const u=a.__composer,c=Q8(l);a.textContent=Reflect.apply(u.t,u,[...N8(c)])}},getSSRProps:a=>{const[l]=e(a);return{textContent:l}}}}function Q8(t){if(Oe(t))return{path:t};if(ht(t)){if(!("path"in t))throw Qn(Ht.REQUIRED_VALUE,"path");return t}else throw Qn(Ht.INVALID_VALUE)}function N8(t){const{path:e,locale:n,args:r,choice:i,plural:s}=t,a={},l=r||{};return Oe(n)&&(a.locale=n),cn(i)&&(a.plural=i),cn(s)&&(a.plural=s),[e,l,a]}function MW(t,e,...n){const r=ht(n[0])?n[0]:{};(_t(r.globalInstall)?r.globalInstall:!0)&&([X8.name,"I18nT"].forEach(s=>t.component(s,X8)),[J8.name,"I18nN"].forEach(s=>t.component(s,J8)),[Z8.name,"I18nD"].forEach(s=>t.component(s,Z8))),t.directive("t",AW(e))}const OW=Ho("global-vue-i18n");function BW(t={},e){const n=__VUE_I18N_LEGACY_API__&&_t(t.legacy)?t.legacy:__VUE_I18N_LEGACY_API__,r=_t(t.globalInjection)?t.globalInjection:!0,i=new Map,[s,a]=IW(t,n),l=Ho(process.env.NODE_ENV!=="production"?"vue-i18n":"");function u(m){return i.get(m)||null}function c(m,g){i.set(m,g)}function f(m){i.delete(m)}const p={get mode(){return __VUE_I18N_LEGACY_API__&&n?"legacy":"composition"},async install(m,...g){if(process.env.NODE_ENV!=="production"&&(m.__VUE_I18N__=p),m.__VUE_I18N_SYMBOL__=l,m.provide(m.__VUE_I18N_SYMBOL__,p),ht(g[0])){const w=g[0];p.__composerExtend=w.__composerExtend,p.__vueI18nExtend=w.__vueI18nExtend}let v=null;!n&&r&&(v=HW(m,p.global)),__VUE_I18N_FULL_INSTALL__&&MW(m,p,...g),__VUE_I18N_LEGACY_API__&&n&&m.mixin(EW(a,a.__composer,p));const b=m.unmount;if(m.unmount=()=>{v&&v(),p.dispose(),b()},process.env.NODE_ENV!=="production"){if(!await fW(m,p))throw Qn(Ht.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN);const x=A1();if(n){const C=a;C.__enableEmitter&&C.__enableEmitter(x)}else{const C=a;C[wa]&&C[wa](x)}x.on("*",vc)}},get global(){return a},dispose(){s.stop()},__instances:i,__getInstance:u,__setInstance:c,__deleteInstance:f};return p}function Pt(t={}){const e=o.getCurrentInstance();if(e==null)throw Qn(Ht.MUST_BE_CALL_SETUP_TOP);if(!e.isCE&&e.appContext.app!=null&&!e.appContext.app.__VUE_I18N_SYMBOL__)throw Qn(Ht.NOT_INSTALLED);const n=LW(e),r=DW(n),i=D8(e),s=RW(t,i);if(s==="global")return P8(r,t,i),r;if(s==="parent"){let u=PW(n,e,t.__useComponent);return u==null&&(process.env.NODE_ENV!=="production"&&as(up(fs.NOT_FOUND_PARENT_SCOPE)),u=r),u}const a=n;let l=a.__getInstance(e);if(l==null){const u=yn({},t);"__i18n"in i&&(u.__i18n=i.__i18n),r&&(u.__root=r),l=G1(u),a.__composerExtend&&(l[q1]=a.__composerExtend(l)),FW(a,e,l),a.__setInstance(e,l)}return l}function IW(t,e,n){const r=o.effectScope(),i=__VUE_I18N_LEGACY_API__&&e?r.run(()=>Z1(t)):r.run(()=>G1(t));if(i==null)throw Qn(Ht.UNEXPECTED_ERROR);return[r,i]}function LW(t){const e=o.inject(t.isCE?OW:t.appContext.app.__VUE_I18N_SYMBOL__);if(!e)throw Qn(t.isCE?Ht.NOT_INSTALLED_WITH_PROVIDE:Ht.UNEXPECTED_ERROR);return e}function RW(t,e){return tp(t)?"__i18n"in e?"local":"global":t.useScope?t.useScope:"local"}function DW(t){return t.mode==="composition"?t.global:t.global.__composer}function PW(t,e,n=!1){let r=null;const i=e.root;let s=VW(e,n);for(;s!=null;){const a=t;if(t.mode==="composition")r=a.__getInstance(s);else if(__VUE_I18N_LEGACY_API__){const l=a.__getInstance(s);l!=null&&(r=l.__composer,n&&r&&!r[R8]&&(r=null))}if(r!=null||i===s)break;s=s.parent}return r}function VW(t,e=!1){return t==null?null:e&&t.vnode.ctx||t.parent}function FW(t,e,n){let r=null;o.onMounted(()=>{if(process.env.NODE_ENV!=="production"&&e.vnode.el){e.vnode.el.__VUE_I18N__=n,r=A1();const i=n;i[wa]&&i[wa](r),r.on("*",vc)}},e),o.onUnmounted(()=>{const i=n;process.env.NODE_ENV!=="production"&&e.vnode.el&&e.vnode.el.__VUE_I18N__&&(r&&r.off("*",vc),i[mc]&&i[mc](),delete e.vnode.el.__VUE_I18N__),t.__deleteInstance(e);const s=i[q1];s&&(s(),delete i[q1])},e)}const $W=["locale","fallbackLocale","availableLocales"],e5=["t","rt","d","n","tm","te"];function HW(t,e){const n=Object.create(null);return $W.forEach(i=>{const s=Object.getOwnPropertyDescriptor(e,i);if(!s)throw Qn(Ht.UNEXPECTED_ERROR);const a=o.isRef(s.value)?{get(){return s.value.value},set(l){s.value.value=l}}:{get(){return s.get&&s.get()}};Object.defineProperty(n,i,a)}),t.config.globalProperties.$i18n=n,e5.forEach(i=>{const s=Object.getOwnPropertyDescriptor(e,i);if(!s||!s.value)throw Qn(Ht.UNEXPECTED_ERROR);Object.defineProperty(t.config.globalProperties,`$${i}`,s)}),()=>{delete t.config.globalProperties.$i18n,e5.forEach(i=>{delete t.config.globalProperties[`$${i}`]})}}if(iW(),MU(aU),OU(EU),BU(s8),process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__){const t=ba();t.__INTLIFY__=!0,lU(t.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}process.env.NODE_ENV;const zW={class:"ml-1 h-full"},UW=o.defineComponent({__name:"FontSizeMenuButton",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,{t:n}=Pt(),r=o.computed(()=>e.editor.extensionStorage["base-kit"].mode===Te.EDITOR),i=o.inject("fontSize"),s=o.computed(()=>{const u={title:n("editor.fontSize.default.tooltip"),isActive:()=>!1};if(r.value)return e.items.find(p=>p.isActive()&&p.title)||u;const c=e.items.find(f=>f.title===i.value);return c||(i.value?{title:i.value}:u)}),a=(u,c)=>{u===n("editor.fontSize.default.tooltip")?(e.editor.commands.unsetFontSize(),i.value=null):(i.value=u,e.editor.commands.setFontSize(u)),c(),e.editor.commands.setForceCloseBubble(!0)};e.editor.on("selectionUpdate",({editor:u})=>{u.state.selection.empty&&e.editor.commands.resetForceCloseBubble()});const l=u=>u===n("editor.fontSize.default.tooltip")?u:u.replace("px","");return(u,c)=>{const f=S1;return o.openBlock(),o.createBlock(ga,{disabled:u.disabled,tooltip:u.tooltip,title:s.value.title,btn_class:`min-w-20 ${u.customClass}`,class:"inside-toolbar"},{default:o.withCtx(()=>[o.createVNode(o.unref(nz),{class:"h-72"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.items,(p,m)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:m},[o.createVNode(o.unref(Ml),{checked:s.value.title===p.title,onClick:()=>a(p.title,p.action)},{default:o.withCtx(()=>[o.createElementVNode("div",zW,o.toDisplayString(l(p.title)),1)]),_:2},1032,["checked","onClick"]),p.title===o.unref(n)("editor.fontSize.default.tooltip")&&u.showDefaultDivider?(o.openBlock(),o.createBlock(f,{key:0})):o.createCommentVNode("",!0)],64))),128))]),_:1})]),_:1},8,["disabled","tooltip","title","btn_class"])}}}),WW=["paragraph","heading"],jW=["paragraph","heading"];function t5(t,e,n,r){const{selection:i,doc:s}=t;if(!i||!s||!(i instanceof Ie||i instanceof An))return t;const{from:a,to:l}=i,u=[];return s.nodesBetween(a,l,(c,f)=>{const p=c.type;return r.includes(p.name)&&c.attrs[e]!==n&&u.push({node:c,pos:f,nodeType:p}),!0}),u.length&&u.forEach(c=>{const{node:f,pos:p,nodeType:m}=c,g={...f.attrs,[e]:n};t.setNodeMarkup(p,m,g,f.marks)}),t}function n5(t,e){return t5(t,"fontSize",e,WW)}function r5(t,e){return t5(t,"fontFamily",e,jW)}const o5=Qe.create({name:"fontSize",addOptions(){return{...this.parent?.(),types:["textStyle"],fontSizes:[...ug],button({editor:t,extension:e,t:n}){const r=e.options?.fontSizes||[],i=[hl,...r].map(a=>({title:a===hl?n("editor.fontSize.default.tooltip"):String(a),isActive:()=>{const u=t.getAttributes("textStyle").fontSize??t.getAttributes("paragraph").fontSize??t.getAttributes("heading").fontSize;return a===hl&&!u?!0:String(a)===String(u)},action:()=>{if(a===hl){t.chain().focus().unsetFontSize().run();return}t.chain().focus().setFontSize(String(a)).run()},disabled:!t.can().setFontSize(String(a)),divider:a===hl||!1,default:a===hl||!1})),s=i.filter(a=>a.disabled).length===i.length;return{component:UW,componentProps:{editor:t,tooltip:n("editor.fontSize.tooltip"),disabled:s,items:i}}}}},addGlobalAttributes(){return[{types:["paragraph","heading","textStyle"],attributes:{fontSize:{default:null,parseHTML:t=>t.style.fontSize.replace(/['"]+/g,""),renderHTML:t=>t.fontSize?{style:`font-size: ${t.fontSize}`}:{}}}}]},addCommands(){return{setFontSize:t=>({chain:e})=>e().setMark("textStyle",{fontSize:t}).command(({tr:n})=>(n5(n,t),!0)).run(),unsetFontSize:()=>({chain:t})=>t().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().command(({tr:e})=>(n5(e,null),!0)).run()}},addStorage(){return{value:null}},onUpdate(){this.storage.value=this.editor.getAttributes("textStyle").fontSize??this.editor.getAttributes("paragraph").fontSize??this.editor.getAttributes("heading").fontSize},onSelectionUpdate(){this.storage.value=this.editor.getAttributes("textStyle").fontSize??this.editor.getAttributes("paragraph").fontSize??this.editor.getAttributes("heading").fontSize}}),qW=t=>{if(!t.children.length)return;const e=t.querySelectorAll("span");e&&e.forEach(n=>{var r,i;const s=n.getAttribute("style"),a=(i=(r=n.parentElement)===null||r===void 0?void 0:r.closest("span"))===null||i===void 0?void 0:i.getAttribute("style");n.setAttribute("style",`${a};${s}`)})},KW=Fn.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!1}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&qW(t),{}):!1}]},renderHTML({HTMLAttributes:t}){return["span",wt(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({tr:t})=>{const{selection:e}=t;return t.doc.nodesBetween(e.from,e.to,(n,r)=>{if(n.isTextblock)return!0;n.marks.filter(i=>i.type===this.type).some(i=>Object.values(i.attrs).some(s=>!!s))||t.removeMark(r,r+n.nodeSize,this.type)}),!0}}}}),GW=Qe.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;return(e=t.style.color)===null||e===void 0?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),XW="";function Dl(t,e){e===void 0&&(e={});var n=e.insertAt;if(!(!t||typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",n==="top"&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}const Pl=function(t,e){const{componentPrefix:n=XW}=e||{};t.component(`${n}${this.name}`,this)},N1={};var bc={name:"Checkboard",props:{size:{type:[Number,String],default:8},white:{type:String,default:"#fff"},grey:{type:String,default:"#e6e6e6"}},computed:{bgStyle(){return{"background-image":`url(${JW(this.white,this.grey,this.size)})`}}}};function YW(t,e,n){if(typeof document>"u")return null;const r=document.createElement("canvas");r.width=r.height=n*2;const i=r.getContext("2d");return i?(i.fillStyle=t,i.fillRect(0,0,r.width,r.height),i.fillStyle=e,i.fillRect(0,0,n,n),i.translate(n,n),i.fillRect(0,0,n,n),r.toDataURL()):null}function JW(t,e,n){const r=`${t},${e},${n}`;if(N1[r])return N1[r];const i=YW(t,e,n);return N1[r]=i,i}function ZW(t,e,n,r,i,s){return o.openBlock(),o.createElementBlock("div",{class:"vc-checkerboard",style:o.normalizeStyle(s.bgStyle)},null,4)}var QW=".vc-checkerboard{background-size:contain;bottom:0;left:0;position:absolute;right:0;top:0}";Dl(QW),bc.render=ZW,bc.__file="src/components/checkboard/checkboard.vue",bc.install=Pl;var cp={name:"Alpha",components:{Checkboard:bc},props:{value:Object,onChange:Function},computed:{colors(){return this.value},gradientColor(){const{rgba:t}=this.colors,e=[t.r,t.g,t.b].join(",");return`linear-gradient(to right, rgba(${e}, 0) 0%, rgba(${e}, 1) 100%)`}},methods:{handleChange(t,e){!e&&t.preventDefault();const{container:n}=this.$refs;if(!n)return;const r=n.clientWidth,i=n.getBoundingClientRect().left+window.pageXOffset,a=(t.pageX||(t.touches?t.touches[0].pageX:0))-i;let l;a<0?l=0:a>r?l=1:l=Math.round(a*100/r)/100,this.colors.a!==l&&this.$emit("change",{h:this.colors.hsl.h,s:this.colors.hsl.s,l:this.colors.hsl.l,a:l,source:"rgba"})},handleMouseDown(t){this.handleChange(t,!0),window.addEventListener("mousemove",this.handleChange),window.addEventListener("mouseup",this.handleMouseUp)},handleMouseUp(){this.unbindEventListeners()},unbindEventListeners(){window.removeEventListener("mousemove",this.handleChange),window.removeEventListener("mouseup",this.handleMouseUp)}}};const NW={class:"vc-alpha"},ej={class:"vc-alpha-checkboard-wrap"},tj=[o.createElementVNode("div",{class:"vc-alpha-picker"},null,-1)];function nj(t,e,n,r,i,s){const a=o.resolveComponent("Checkboard");return o.openBlock(),o.createElementBlock("div",NW,[o.createElementVNode("div",ej,[o.createVNode(a)]),o.createElementVNode("div",{class:"vc-alpha-gradient",style:o.normalizeStyle({background:s.gradientColor})},null,4),o.createElementVNode("div",{ref:"container",class:"vc-alpha-container",onMousedown:e[0]||(e[0]=(...l)=>s.handleMouseDown&&s.handleMouseDown(...l)),onTouchmove:e[1]||(e[1]=(...l)=>s.handleChange&&s.handleChange(...l)),onTouchstart:e[2]||(e[2]=(...l)=>s.handleChange&&s.handleChange(...l))},[o.createElementVNode("div",{class:"vc-alpha-pointer",style:o.normalizeStyle({left:`${s.colors.a*100}%`})},tj,4)],544)])}var rj=".vc-alpha,.vc-alpha-checkboard-wrap{bottom:0;left:0;position:absolute;right:0;top:0}.vc-alpha-checkboard-wrap{overflow:hidden}.vc-alpha-gradient{bottom:0;left:0;position:absolute;right:0;top:0}.vc-alpha-container{cursor:pointer;height:100%;margin:0 3px;position:relative;z-index:2}.vc-alpha-pointer{position:absolute;z-index:2}.vc-alpha-picker{background:#fff;border-radius:1px;box-shadow:0 0 2px rgba(0,0,0,.6);cursor:pointer;height:8px;margin-top:1px;transform:translateX(-2px);width:4px}";Dl(rj),cp.render=nj,cp.__file="src/components/alpha/alpha.vue",cp.install=Pl;function In(t,e){oj(t)&&(t="100%");var n=ij(t);return t=e===360?t:Math.min(e,Math.max(0,parseFloat(t))),n&&(t=parseInt(String(t*e),10)/100),Math.abs(t-e)<1e-6?1:(e===360?t=(t<0?t%e+e:t%e)/parseFloat(String(e)):t=t%e/parseFloat(String(e)),t)}function dp(t){return Math.min(1,Math.max(0,t))}function oj(t){return typeof t=="string"&&t.indexOf(".")!==-1&&parseFloat(t)===1}function ij(t){return typeof t=="string"&&t.indexOf("%")!==-1}function i5(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function fp(t){return t<=1?"".concat(Number(t)*100,"%"):t}function xa(t){return t.length===1?"0"+t:String(t)}function sj(t,e,n){return{r:In(t,255)*255,g:In(e,255)*255,b:In(n,255)*255}}function s5(t,e,n){t=In(t,255),e=In(e,255),n=In(n,255);var r=Math.max(t,e,n),i=Math.min(t,e,n),s=0,a=0,l=(r+i)/2;if(r===i)a=0,s=0;else{var u=r-i;switch(a=l>.5?u/(2-r-i):u/(r+i),r){case t:s=(e-n)/u+(e<n?6:0);break;case e:s=(n-t)/u+2;break;case n:s=(t-e)/u+4;break}s/=6}return{h:s,s:a,l}}function ev(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*(6*n):n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function aj(t,e,n){var r,i,s;if(t=In(t,360),e=In(e,100),n=In(n,100),e===0)i=n,s=n,r=n;else{var a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;r=ev(l,a,t+1/3),i=ev(l,a,t),s=ev(l,a,t-1/3)}return{r:r*255,g:i*255,b:s*255}}function a5(t,e,n){t=In(t,255),e=In(e,255),n=In(n,255);var r=Math.max(t,e,n),i=Math.min(t,e,n),s=0,a=r,l=r-i,u=r===0?0:l/r;if(r===i)s=0;else{switch(r){case t:s=(e-n)/l+(e<n?6:0);break;case e:s=(n-t)/l+2;break;case n:s=(t-e)/l+4;break}s/=6}return{h:s,s:u,v:a}}function lj(t,e,n){t=In(t,360)*6,e=In(e,100),n=In(n,100);var r=Math.floor(t),i=t-r,s=n*(1-e),a=n*(1-i*e),l=n*(1-(1-i)*e),u=r%6,c=[n,a,s,s,l,n][u],f=[l,n,n,a,s,s][u],p=[s,s,l,n,n,a][u];return{r:c*255,g:f*255,b:p*255}}function l5(t,e,n,r){var i=[xa(Math.round(t).toString(16)),xa(Math.round(e).toString(16)),xa(Math.round(n).toString(16))];return r&&i[0].startsWith(i[0].charAt(1))&&i[1].startsWith(i[1].charAt(1))&&i[2].startsWith(i[2].charAt(1))?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function uj(t,e,n,r,i){var s=[xa(Math.round(t).toString(16)),xa(Math.round(e).toString(16)),xa(Math.round(n).toString(16)),xa(cj(r))];return i&&s[0].startsWith(s[0].charAt(1))&&s[1].startsWith(s[1].charAt(1))&&s[2].startsWith(s[2].charAt(1))&&s[3].startsWith(s[3].charAt(1))?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}function cj(t){return Math.round(parseFloat(t)*255).toString(16)}function u5(t){return Cr(t)/255}function Cr(t){return parseInt(t,16)}function dj(t){return{r:t>>16,g:(t&65280)>>8,b:t&255}}var tv={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function fj(t){var e={r:0,g:0,b:0},n=1,r=null,i=null,s=null,a=!1,l=!1;return typeof t=="string"&&(t=mj(t)),typeof t=="object"&&(vi(t.r)&&vi(t.g)&&vi(t.b)?(e=sj(t.r,t.g,t.b),a=!0,l=String(t.r).substr(-1)==="%"?"prgb":"rgb"):vi(t.h)&&vi(t.s)&&vi(t.v)?(r=fp(t.s),i=fp(t.v),e=lj(t.h,r,i),a=!0,l="hsv"):vi(t.h)&&vi(t.s)&&vi(t.l)&&(r=fp(t.s),s=fp(t.l),e=aj(t.h,r,s),a=!0,l="hsl"),Object.prototype.hasOwnProperty.call(t,"a")&&(n=t.a)),n=i5(n),{ok:a,format:t.format||l,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:n}}var pj="[-\\+]?\\d+%?",hj="[-\\+]?\\d*\\.\\d+%?",ps="(?:".concat(hj,")|(?:").concat(pj,")"),nv="[\\s|\\(]+(".concat(ps,")[,|\\s]+(").concat(ps,")[,|\\s]+(").concat(ps,")\\s*\\)?"),rv="[\\s|\\(]+(".concat(ps,")[,|\\s]+(").concat(ps,")[,|\\s]+(").concat(ps,")[,|\\s]+(").concat(ps,")\\s*\\)?"),ho={CSS_UNIT:new RegExp(ps),rgb:new RegExp("rgb"+nv),rgba:new RegExp("rgba"+rv),hsl:new RegExp("hsl"+nv),hsla:new RegExp("hsla"+rv),hsv:new RegExp("hsv"+nv),hsva:new RegExp("hsva"+rv),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function mj(t){if(t=t.trim().toLowerCase(),t.length===0)return!1;var e=!1;if(tv[t])t=tv[t],e=!0;else if(t==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n=ho.rgb.exec(t);return n?{r:n[1],g:n[2],b:n[3]}:(n=ho.rgba.exec(t),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=ho.hsl.exec(t),n?{h:n[1],s:n[2],l:n[3]}:(n=ho.hsla.exec(t),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=ho.hsv.exec(t),n?{h:n[1],s:n[2],v:n[3]}:(n=ho.hsva.exec(t),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=ho.hex8.exec(t),n?{r:Cr(n[1]),g:Cr(n[2]),b:Cr(n[3]),a:u5(n[4]),format:e?"name":"hex8"}:(n=ho.hex6.exec(t),n?{r:Cr(n[1]),g:Cr(n[2]),b:Cr(n[3]),format:e?"name":"hex"}:(n=ho.hex4.exec(t),n?{r:Cr(n[1]+n[1]),g:Cr(n[2]+n[2]),b:Cr(n[3]+n[3]),a:u5(n[4]+n[4]),format:e?"name":"hex8"}:(n=ho.hex3.exec(t),n?{r:Cr(n[1]+n[1]),g:Cr(n[2]+n[2]),b:Cr(n[3]+n[3]),format:e?"name":"hex"}:!1)))))))))}function vi(t){return!!ho.CSS_UNIT.exec(String(t))}var gj=function(){function t(e,n){e===void 0&&(e=""),n===void 0&&(n={});var r;if(e instanceof t)return e;typeof e=="number"&&(e=dj(e)),this.originalInput=e;var i=fj(e);this.originalInput=e,this.r=i.r,this.g=i.g,this.b=i.b,this.a=i.a,this.roundA=Math.round(100*this.a)/100,this.format=(r=n.format)!==null&&r!==void 0?r:i.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=i.ok}return t.prototype.isDark=function(){return this.getBrightness()<128},t.prototype.isLight=function(){return!this.isDark()},t.prototype.getBrightness=function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},t.prototype.getLuminance=function(){var e=this.toRgb(),n,r,i,s=e.r/255,a=e.g/255,l=e.b/255;return s<=.03928?n=s/12.92:n=Math.pow((s+.055)/1.055,2.4),a<=.03928?r=a/12.92:r=Math.pow((a+.055)/1.055,2.4),l<=.03928?i=l/12.92:i=Math.pow((l+.055)/1.055,2.4),.2126*n+.7152*r+.0722*i},t.prototype.getAlpha=function(){return this.a},t.prototype.setAlpha=function(e){return this.a=i5(e),this.roundA=Math.round(100*this.a)/100,this},t.prototype.isMonochrome=function(){var e=this.toHsl().s;return e===0},t.prototype.toHsv=function(){var e=a5(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}},t.prototype.toHsvString=function(){var e=a5(this.r,this.g,this.b),n=Math.round(e.h*360),r=Math.round(e.s*100),i=Math.round(e.v*100);return this.a===1?"hsv(".concat(n,", ").concat(r,"%, ").concat(i,"%)"):"hsva(".concat(n,", ").concat(r,"%, ").concat(i,"%, ").concat(this.roundA,")")},t.prototype.toHsl=function(){var e=s5(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}},t.prototype.toHslString=function(){var e=s5(this.r,this.g,this.b),n=Math.round(e.h*360),r=Math.round(e.s*100),i=Math.round(e.l*100);return this.a===1?"hsl(".concat(n,", ").concat(r,"%, ").concat(i,"%)"):"hsla(".concat(n,", ").concat(r,"%, ").concat(i,"%, ").concat(this.roundA,")")},t.prototype.toHex=function(e){return e===void 0&&(e=!1),l5(this.r,this.g,this.b,e)},t.prototype.toHexString=function(e){return e===void 0&&(e=!1),"#"+this.toHex(e)},t.prototype.toHex8=function(e){return e===void 0&&(e=!1),uj(this.r,this.g,this.b,this.a,e)},t.prototype.toHex8String=function(e){return e===void 0&&(e=!1),"#"+this.toHex8(e)},t.prototype.toHexShortString=function(e){return e===void 0&&(e=!1),this.a===1?this.toHexString(e):this.toHex8String(e)},t.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},t.prototype.toRgbString=function(){var e=Math.round(this.r),n=Math.round(this.g),r=Math.round(this.b);return this.a===1?"rgb(".concat(e,", ").concat(n,", ").concat(r,")"):"rgba(".concat(e,", ").concat(n,", ").concat(r,", ").concat(this.roundA,")")},t.prototype.toPercentageRgb=function(){var e=function(n){return"".concat(Math.round(In(n,255)*100),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},t.prototype.toPercentageRgbString=function(){var e=function(n){return Math.round(In(n,255)*100)};return this.a===1?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},t.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var e="#"+l5(this.r,this.g,this.b,!1),n=0,r=Object.entries(tv);n<r.length;n++){var i=r[n],s=i[0],a=i[1];if(e===a)return s}return!1},t.prototype.toString=function(e){var n=!!e;e=e??this.format;var r=!1,i=this.a<1&&this.a>=0,s=!n&&i&&(e.startsWith("hex")||e==="name");return s?e==="name"&&this.a===0?this.toName():this.toRgbString():(e==="rgb"&&(r=this.toRgbString()),e==="prgb"&&(r=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(r=this.toHexString()),e==="hex3"&&(r=this.toHexString(!0)),e==="hex4"&&(r=this.toHex8String(!0)),e==="hex8"&&(r=this.toHex8String()),e==="name"&&(r=this.toName()),e==="hsl"&&(r=this.toHslString()),e==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},t.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},t.prototype.clone=function(){return new t(this.toString())},t.prototype.lighten=function(e){e===void 0&&(e=10);var n=this.toHsl();return n.l+=e/100,n.l=dp(n.l),new t(n)},t.prototype.brighten=function(e){e===void 0&&(e=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(e/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(e/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(e/100)))),new t(n)},t.prototype.darken=function(e){e===void 0&&(e=10);var n=this.toHsl();return n.l-=e/100,n.l=dp(n.l),new t(n)},t.prototype.tint=function(e){return e===void 0&&(e=10),this.mix("white",e)},t.prototype.shade=function(e){return e===void 0&&(e=10),this.mix("black",e)},t.prototype.desaturate=function(e){e===void 0&&(e=10);var n=this.toHsl();return n.s-=e/100,n.s=dp(n.s),new t(n)},t.prototype.saturate=function(e){e===void 0&&(e=10);var n=this.toHsl();return n.s+=e/100,n.s=dp(n.s),new t(n)},t.prototype.greyscale=function(){return this.desaturate(100)},t.prototype.spin=function(e){var n=this.toHsl(),r=(n.h+e)%360;return n.h=r<0?360+r:r,new t(n)},t.prototype.mix=function(e,n){n===void 0&&(n=50);var r=this.toRgb(),i=new t(e).toRgb(),s=n/100,a={r:(i.r-r.r)*s+r.r,g:(i.g-r.g)*s+r.g,b:(i.b-r.b)*s+r.b,a:(i.a-r.a)*s+r.a};return new t(a)},t.prototype.analogous=function(e,n){e===void 0&&(e=6),n===void 0&&(n=30);var r=this.toHsl(),i=360/n,s=[this];for(r.h=(r.h-(i*e>>1)+720)%360;--e;)r.h=(r.h+i)%360,s.push(new t(r));return s},t.prototype.complement=function(){var e=this.toHsl();return e.h=(e.h+180)%360,new t(e)},t.prototype.monochromatic=function(e){e===void 0&&(e=6);for(var n=this.toHsv(),r=n.h,i=n.s,s=n.v,a=[],l=1/e;e--;)a.push(new t({h:r,s:i,v:s})),s=(s+l)%1;return a},t.prototype.splitcomplement=function(){var e=this.toHsl(),n=e.h;return[this,new t({h:(n+72)%360,s:e.s,l:e.l}),new t({h:(n+216)%360,s:e.s,l:e.l})]},t.prototype.onBackground=function(e){var n=this.toRgb(),r=new t(e).toRgb(),i=n.a+r.a*(1-n.a);return new t({r:(n.r*n.a+r.r*r.a*(1-n.a))/i,g:(n.g*n.a+r.g*r.a*(1-n.a))/i,b:(n.b*n.a+r.b*r.a*(1-n.a))/i,a:i})},t.prototype.triad=function(){return this.polyad(3)},t.prototype.tetrad=function(){return this.polyad(4)},t.prototype.polyad=function(e){for(var n=this.toHsl(),r=n.h,i=[this],s=360/e,a=1;a<e;a++)i.push(new t({h:(r+a*s)%360,s:n.s,l:n.l}));return i},t.prototype.equals=function(e){return this.toRgbString()===new t(e).toRgbString()},t}();function hs(...t){return new gj(...t)}function ov(t,e){const n=t&&t.a;let r;t&&t.hsl?r=hs(t.hsl):t&&t.hex&&t.hex.length>0?r=hs(t.hex):t&&t.hsv?r=hs(t.hsv):t&&t.rgba?r=hs(t.rgba):t&&t.rgb?r=hs(t.rgb):r=hs(t),r&&(r._a===void 0||r._a===null)&&r.setAlpha(n||r.getAlpha());const i=r.toHsl(),s=r.toHsv();return i.s===0&&(s.h=i.h=t.h||t.hsl&&t.hsl.h||e||0),s.v<.0164&&(s.h=t.h||t.hsv&&t.hsv.h||0,s.s=t.s||t.hsv&&t.hsv.s||0),i.l<.01&&(i.h=t.h||t.hsl&&t.hsl.h||0,i.s=t.s||t.hsl&&t.hsl.s||0),{hsl:i,hex:r.toHexString().toUpperCase(),hex8:r.toHex8String().toUpperCase(),rgba:r.toRgb(),hsv:s,oldHue:t.h||e||i.h,source:t.source,a:r.getAlpha()}}var vj={model:{prop:"modelValue",event:"update:modelValue"},props:["modelValue"],data(){return{val:ov(this.modelValue)}},computed:{colors:{get(){return this.val},set(t){this.val=t,this.$emit("update:modelValue",t)}}},watch:{modelValue(t){this.val=ov(t)}},methods:{colorChange(t,e){this.oldHue=this.colors.hsl.h,this.colors=ov(t,e||this.oldHue)},isValidHex(t){return hs(t).isValid},simpleCheckForValidColor(t){const e=["r","g","b","a","h","s","l","v"];let n=0,r=0;for(let i=0;i<e.length;i++){const s=e[i];t[s]&&(n++,isNaN(t[s])||r++)}if(n===r)return t},paletteUpperCase(t){return t.map(e=>e.toUpperCase())},isTransparent(t){return hs(t).getAlpha()===0}}},pp={name:"EditableInput",props:{label:String,labelText:String,desc:String,value:[String,Number],max:Number,min:Number,arrowOffset:{type:Number,default:1}},computed:{val:{get(){return this.value},set(t){if(this.max!==void 0&&+t>this.max)this.$refs.input.value=this.max;else return t}},labelId(){return`input__label__${this.label}__${Math.random().toString().slice(2,5)}`},labelSpanText(){return this.labelText||this.label}},methods:{update(t){this.handleChange(t.target.value)},handleChange(t){const e={};e[this.label]=t,e.hex===void 0&&e["#"]===void 0?this.$emit("change",e):t.length>5&&this.$emit("change",e)},handleKeyDown(t){let{val:e}=this;const n=Number(e);if(n){const r=this.arrowOffset||1;t.keyCode===38&&(e=n+r,this.handleChange(e),t.preventDefault()),t.keyCode===40&&(e=n-r,this.handleChange(e),t.preventDefault())}}}};const bj={class:"vc-editable-input"},yj=["aria-labelledby"],wj=["id","for"],xj={class:"vc-input__desc"};function Cj(t,e,n,r,i,s){return o.openBlock(),o.createElementBlock("div",bj,[o.withDirectives(o.createElementVNode("input",{ref:"input","onUpdate:modelValue":e[0]||(e[0]=a=>s.val=a),"aria-labelledby":s.labelId,class:"vc-input__input",onKeydown:e[1]||(e[1]=(...a)=>s.handleKeyDown&&s.handleKeyDown(...a)),onInput:e[2]||(e[2]=(...a)=>s.update&&s.update(...a))},null,40,yj),[[o.vModelText,s.val]]),o.createElementVNode("span",{id:s.labelId,for:n.label,class:"vc-input__label"},o.toDisplayString(s.labelSpanText),9,wj),o.createElementVNode("span",xj,o.toDisplayString(n.desc),1)])}var kj=".vc-editable-input{position:relative}.vc-input__input{border:0;outline:none;padding:0}.vc-input__label{text-transform:capitalize}";Dl(kj),pp.render=Cj,pp.__file="src/components/editable-input/editable-input.vue",pp.install=Pl;function iv(t,e,n){return e<n?t<e?e:t>n?n:t:t<n?n:t>e?e:t}var hp={name:"Saturation",props:{value:Object},computed:{colors(){return this.value},bgColor(){return`hsl(${this.colors.hsv.h}, 100%, 50%)`},pointerTop(){return`${-(this.colors.hsv.v*100)+1+100}%`},pointerLeft(){return`${this.colors.hsv.s*100}%`}},methods:{handleChange(t,e){!e&&t.preventDefault();const{container:n}=this.$refs;if(!n)return;const r=n.clientWidth,i=n.clientHeight,s=n.getBoundingClientRect().left+window.pageXOffset,a=n.getBoundingClientRect().top+window.pageYOffset,l=t.pageX||(t.touches?t.touches[0].pageX:0),u=t.pageY||(t.touches?t.touches[0].pageY:0),c=iv(l-s,0,r),f=iv(u-a,0,i),p=c/r,m=iv(-(f/i)+1,0,1);this.onChange({h:this.colors.hsv.h,s:p,v:m,a:this.colors.hsv.a,source:"hsva"})},onChange(t){this.$emit("change",t)},handleMouseDown(t){window.addEventListener("mousemove",this.handleChange),window.addEventListener("mouseup",this.handleChange),window.addEventListener("mouseup",this.handleMouseUp)},handleMouseUp(t){this.unbindEventListeners()},unbindEventListeners(){window.removeEventListener("mousemove",this.handleChange),window.removeEventListener("mouseup",this.handleChange),window.removeEventListener("mouseup",this.handleMouseUp)}}};const Ej=o.createElementVNode("div",{class:"vc-saturation--white"},null,-1),Sj=o.createElementVNode("div",{class:"vc-saturation--black"},null,-1),_j=[o.createElementVNode("div",{class:"vc-saturation-circle"},null,-1)];function Tj(t,e,n,r,i,s){return o.openBlock(),o.createElementBlock("div",{ref:"container",class:"vc-saturation",style:o.normalizeStyle({background:s.bgColor}),onMousedown:e[0]||(e[0]=(...a)=>s.handleMouseDown&&s.handleMouseDown(...a)),onTouchmove:e[1]||(e[1]=(...a)=>s.handleChange&&s.handleChange(...a)),onTouchstart:e[2]||(e[2]=(...a)=>s.handleChange&&s.handleChange(...a))},[Ej,Sj,o.createElementVNode("div",{class:"vc-saturation-pointer",style:o.normalizeStyle({top:s.pointerTop,left:s.pointerLeft})},_j,4)],36)}var Aj=".vc-saturation,.vc-saturation--black,.vc-saturation--white{bottom:0;cursor:pointer;left:0;position:absolute;right:0;top:0}.vc-saturation--white{background:linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.vc-saturation--black{background:linear-gradient(0deg,#000,transparent)}.vc-saturation-pointer{cursor:pointer;position:absolute}.vc-saturation-circle{border-radius:50%;box-shadow:0 0 0 1.5px #fff,inset 0 0 1px 1px rgba(0,0,0,.3),0 0 1px 2px rgba(0,0,0,.4);cursor:head;height:4px;transform:translate(-2px,-2px);width:4px}";Dl(Aj),hp.render=Tj,hp.__file="src/components/saturation/saturation.vue",hp.install=Pl;var mp={name:"Hue",props:{value:Object,direction:{type:String,default:"horizontal"}},data(){return{oldHue:0,pullDirection:""}},computed:{colors(){return this.value},directionClass(){return{"vc-hue--horizontal":this.direction==="horizontal","vc-hue--vertical":this.direction==="vertical"}},pointerTop(){return this.direction==="vertical"?this.colors.hsl.h===0&&this.pullDirection==="right"?0:`${-(this.colors.hsl.h*100/360)+100}%`:0},pointerLeft(){return this.direction==="vertical"?0:this.colors.hsl.h===0&&this.pullDirection==="right"?"100%":`${this.colors.hsl.h*100/360}%`}},watch:{value:{handler(t,e){const{h:n}=t.hsl;n!==0&&n-this.oldHue>0&&(this.pullDirection="right"),n!==0&&n-this.oldHue<0&&(this.pullDirection="left"),this.oldHue=n},deep:!0,immediate:!0}},methods:{handleChange(t,e){!e&&t.preventDefault();const{container:n}=this.$refs;if(!n)return;const r=n.clientWidth,i=n.clientHeight,s=n.getBoundingClientRect().left+window.pageXOffset,a=n.getBoundingClientRect().top+window.pageYOffset,l=t.pageX||(t.touches?t.touches[0].pageX:0),u=t.pageY||(t.touches?t.touches[0].pageY:0),c=l-s,f=u-a;let p,m;this.direction==="vertical"?(f<0?p=360:f>i?p=0:(m=-(f*100/i)+100,p=360*m/100),this.colors.hsl.h!==p&&this.$emit("change",{h:p,s:this.colors.hsl.s,l:this.colors.hsl.l,a:this.colors.hsl.a,source:"hsl"})):(c<0?p=0:c>r?p=360:(m=c*100/r,p=360*m/100),this.colors.hsl.h!==p&&this.$emit("change",{h:p,s:this.colors.hsl.s,l:this.colors.hsl.l,a:this.colors.hsl.a,source:"hsl"}))},handleMouseDown(t){this.handleChange(t,!0),window.addEventListener("mousemove",this.handleChange),window.addEventListener("mouseup",this.handleChange),window.addEventListener("mouseup",this.handleMouseUp)},handleMouseUp(t){this.unbindEventListeners()},unbindEventListeners(){window.removeEventListener("mousemove",this.handleChange),window.removeEventListener("mouseup",this.handleChange),window.removeEventListener("mouseup",this.handleMouseUp)}}};const Mj=["aria-valuenow"],Oj=[o.createElementVNode("div",{class:"vc-hue-picker"},null,-1)];function Bj(t,e,n,r,i,s){return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["vc-hue",[s.directionClass]])},[o.createElementVNode("div",{ref:"container",class:"vc-hue-container",role:"slider","aria-valuenow":s.colors.hsl.h,"aria-valuemin":"0","aria-valuemax":"360",onMousedown:e[0]||(e[0]=(...a)=>s.handleMouseDown&&s.handleMouseDown(...a)),onTouchmove:e[1]||(e[1]=(...a)=>s.handleChange&&s.handleChange(...a)),onTouchstart:e[2]||(e[2]=(...a)=>s.handleChange&&s.handleChange(...a))},[o.createElementVNode("div",{class:"vc-hue-pointer",style:o.normalizeStyle({top:s.pointerTop,left:s.pointerLeft}),role:"presentation"},Oj,4)],40,Mj)],2)}var Ij=".vc-hue{border-radius:2px;bottom:0;left:0;position:absolute;right:0;top:0}.vc-hue--horizontal{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.vc-hue--vertical{background:linear-gradient(0deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.vc-hue-container{cursor:pointer;height:100%;margin:0 2px;position:relative}.vc-hue-pointer{position:absolute;z-index:2}.vc-hue-picker{background:#fff;border-radius:1px;box-shadow:0 0 2px rgba(0,0,0,.6);cursor:pointer;height:8px;margin-top:1px;transform:translateX(-2px);width:4px}";Dl(Ij),mp.render=Bj,mp.__file="src/components/hue/hue.vue",mp.install=Pl;var gp={name:"Chrome",components:{Saturation:hp,Hue:mp,Alpha:cp,EdIn:pp,Checkboard:bc},mixins:[vj],props:{disableAlpha:{type:Boolean,default:!1},disableFields:{type:Boolean,default:!1},format:{type:String,default:"hex"}},data(){return{fieldsIndex:"hex",highlight:!1}},computed:{hsl(){const{h:t,s:e,l:n}=this.colors.hsl;return{h:t.toFixed(),s:`${(e*100).toFixed()}%`,l:`${(n*100).toFixed()}%`}},activeColor(){const{rgba:t}=this.colors;return`rgba(${[t.r,t.g,t.b,t.a].join(",")})`},hasAlpha(){return this.colors.a<1}},watch:{format:{handler(t){this.fieldsIndex=t},immediate:!0}},methods:{childChange(t){this.colorChange(t)},inputChange(t){if(t){if(t.hex)this.isValidHex(t.hex)&&this.colorChange({hex:t.hex,source:"hex"});else if(t.r||t.g||t.b||t.a)this.colorChange({r:t.r||this.colors.rgba.r,g:t.g||this.colors.rgba.g,b:t.b||this.colors.rgba.b,a:t.a||this.colors.rgba.a,source:"rgba"});else if(t.h||t.s||t.l){const e=t.s?t.s.replace("%","")/100:this.colors.hsl.s,n=t.l?t.l.replace("%","")/100:this.colors.hsl.l;this.colorChange({h:t.h||this.colors.hsl.h,s:e,l:n,source:"hsl"})}}},toggleViews(){switch(this.fieldsIndex){case"hex":this.fieldsIndex=`rgb${this.disableAlpha?"":"a"}`;break;case"rgb":case"rgba":this.fieldsIndex=`hsl${this.disableAlpha?"":"a"}`;break;default:this.fieldsIndex="hex";break}this.$emit("update:format",this.fieldsIndex)},showHighlight(){this.highlight=!0},hideHighlight(){this.highlight=!1}}};const Lj={class:"vc-chrome-saturation-wrap"},Rj={class:"vc-chrome-body"},Dj={class:"vc-chrome-controls"},Pj={class:"vc-chrome-color-wrap"},Vj=["aria-label"],Fj={class:"vc-chrome-sliders"},$j={class:"vc-chrome-hue-wrap"},Hj={key:0,class:"vc-chrome-alpha-wrap"},zj={key:0,class:"vc-chrome-fields-wrap"},Uj={class:"vc-chrome-fields"},Wj={class:"vc-chrome-field"},jj={class:"vc-chrome-fields"},qj={class:"vc-chrome-field"},Kj={class:"vc-chrome-field"},Gj={class:"vc-chrome-field"},Xj={key:0,class:"vc-chrome-field"},Yj={class:"vc-chrome-fields"},Jj={class:"vc-chrome-field"},Zj={class:"vc-chrome-field"},Qj={class:"vc-chrome-field"},Nj={key:0,class:"vc-chrome-field"},eq={class:"vc-chrome-toggle-icon"},tq=[o.createElementVNode("path",{fill:"#333",d:"M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z"},null,-1)],nq={class:"vc-chrome-toggle-icon-highlight"};function rq(t,e,n,r,i,s){const a=o.resolveComponent("Saturation"),l=o.resolveComponent("Checkboard"),u=o.resolveComponent("Hue"),c=o.resolveComponent("Alpha"),f=o.resolveComponent("EdIn");return o.openBlock(),o.createElementBlock("div",{role:"application","aria-label":"Chrome color picker",class:o.normalizeClass(["vc-chrome",[n.disableAlpha?"vc-chrome__disable-alpha":""]])},[o.createElementVNode("div",Lj,[o.createVNode(a,{value:t.colors,onChange:s.childChange},null,8,["value","onChange"])]),o.createElementVNode("div",Rj,[o.createElementVNode("div",Dj,[o.createElementVNode("div",Pj,[o.createElementVNode("div",{"aria-label":`current color is ${t.colors.hex}`,class:"vc-chrome-active-color",style:o.normalizeStyle({background:s.activeColor})},null,12,Vj),n.disableAlpha?o.createCommentVNode("v-if",!0):(o.openBlock(),o.createBlock(l,{key:0}))]),o.createElementVNode("div",Fj,[o.createElementVNode("div",$j,[o.createVNode(u,{value:t.colors,onChange:s.childChange},null,8,["value","onChange"])]),n.disableAlpha?o.createCommentVNode("v-if",!0):(o.openBlock(),o.createElementBlock("div",Hj,[o.createVNode(c,{value:t.colors,onChange:s.childChange},null,8,["value","onChange"])]))])]),n.disableFields?o.createCommentVNode("v-if",!0):(o.openBlock(),o.createElementBlock("div",zj,[o.withDirectives(o.createElementVNode("div",Uj,[o.createCommentVNode(" hex "),o.createElementVNode("div",Wj,[s.hasAlpha?o.createCommentVNode("v-if",!0):(o.openBlock(),o.createBlock(f,{key:0,label:"hex",value:t.colors.hex,onChange:s.inputChange},null,8,["value","onChange"])),s.hasAlpha?(o.openBlock(),o.createBlock(f,{key:1,label:"hex",value:t.colors.hex8,onChange:s.inputChange},null,8,["value","onChange"])):o.createCommentVNode("v-if",!0)])],512),[[o.vShow,i.fieldsIndex==="hex"]]),o.withDirectives(o.createElementVNode("div",jj,[o.createCommentVNode(" rgba "),o.createElementVNode("div",qj,[o.createVNode(f,{label:"r",value:t.colors.rgba.r,onChange:s.inputChange},null,8,["value","onChange"])]),o.createElementVNode("div",Kj,[o.createVNode(f,{label:"g",value:t.colors.rgba.g,onChange:s.inputChange},null,8,["value","onChange"])]),o.createElementVNode("div",Gj,[o.createVNode(f,{label:"b",value:t.colors.rgba.b,onChange:s.inputChange},null,8,["value","onChange"])]),n.disableAlpha?o.createCommentVNode("v-if",!0):(o.openBlock(),o.createElementBlock("div",Xj,[o.createVNode(f,{label:"a",value:t.colors.a,"arrow-offset":.01,max:1,onChange:s.inputChange},null,8,["value","arrow-offset","onChange"])]))],512),[[o.vShow,["rgb","rgba"].includes(i.fieldsIndex)]]),o.withDirectives(o.createElementVNode("div",Yj,[o.createCommentVNode(" hsla "),o.createElementVNode("div",Jj,[o.createVNode(f,{label:"h",value:s.hsl.h,onChange:s.inputChange},null,8,["value","onChange"])]),o.createElementVNode("div",Zj,[o.createVNode(f,{label:"s",value:s.hsl.s,onChange:s.inputChange},null,8,["value","onChange"])]),o.createElementVNode("div",Qj,[o.createVNode(f,{label:"l",value:s.hsl.l,onChange:s.inputChange},null,8,["value","onChange"])]),n.disableAlpha?o.createCommentVNode("v-if",!0):(o.openBlock(),o.createElementBlock("div",Nj,[o.createVNode(f,{label:"a",value:t.colors.a,"arrow-offset":.01,max:1,onChange:s.inputChange},null,8,["value","arrow-offset","onChange"])]))],512),[[o.vShow,["hsl","hsla"].includes(i.fieldsIndex)]]),o.createCommentVNode(" btn "),o.createElementVNode("div",{class:"vc-chrome-toggle-btn",role:"button","aria-label":"Change another color definition",onClick:e[3]||(e[3]=(...p)=>s.toggleViews&&s.toggleViews(...p))},[o.createElementVNode("div",eq,[(o.openBlock(),o.createElementBlock("svg",{style:{width:"24px",height:"24px"},viewBox:"0 0 24 24",onMouseover:e[0]||(e[0]=(...p)=>s.showHighlight&&s.showHighlight(...p)),onMouseenter:e[1]||(e[1]=(...p)=>s.showHighlight&&s.showHighlight(...p)),onMouseout:e[2]||(e[2]=(...p)=>s.hideHighlight&&s.hideHighlight(...p))},tq,32))]),o.withDirectives(o.createElementVNode("div",nq,null,512),[[o.vShow,i.highlight]])]),o.createCommentVNode(" btn ")]))])],2)}var oq=".vc-chrome{background:#fff;background-color:#fff;border-radius:2px;box-shadow:0 0 2px rgba(0,0,0,.3),0 4px 8px rgba(0,0,0,.3);box-sizing:initial;font-family:Menlo;width:225px}.vc-chrome-controls{display:flex}.vc-chrome-color-wrap{position:relative;width:36px}.vc-chrome-active-color{border-radius:15px;height:30px;overflow:hidden;position:relative;width:30px;z-index:1}.vc-chrome-color-wrap .vc-checkerboard{background-size:auto;border-radius:15px;height:30px;width:30px}.vc-chrome-sliders{flex:1}.vc-chrome-fields-wrap{display:flex;padding-top:16px}.vc-chrome-fields{display:flex;flex:1;margin-left:-6px}.vc-chrome-field{padding-left:6px;width:100%}.vc-chrome-toggle-btn{position:relative;text-align:right;width:32px}.vc-chrome-toggle-icon{cursor:pointer;margin-right:-4px;margin-top:12px;position:relative;z-index:2}.vc-chrome-toggle-icon-highlight{background:#eee;border-radius:4px;height:28px;left:12px;position:absolute;top:10px;width:24px}.vc-chrome-hue-wrap{margin-bottom:8px}.vc-chrome-alpha-wrap,.vc-chrome-hue-wrap{height:10px;position:relative}.vc-chrome-alpha-wrap .vc-alpha-gradient,.vc-chrome-hue-wrap .vc-hue{border-radius:2px}.vc-chrome-alpha-wrap .vc-alpha-picker,.vc-chrome-hue-wrap .vc-hue-picker{background-color:#f8f8f8;border-radius:6px;box-shadow:0 1px 4px 0 rgba(0,0,0,.37);height:12px;transform:translate(-6px,-2px);width:12px}.vc-chrome-body{background-color:#fff;padding:16px 16px 12px}.vc-chrome-saturation-wrap{border-radius:2px 2px 0 0;overflow:hidden;padding-bottom:55%;position:relative;width:100%}.vc-chrome-saturation-wrap .vc-saturation-circle{height:12px;width:12px}.vc-chrome-fields .vc-input__input{border:none;border-radius:2px;box-shadow:inset 0 0 0 1px #dadada;color:#333;font-size:11px;height:21px;text-align:center;width:100%}.vc-chrome-fields .vc-input__label{color:#969696;display:block;font-size:11px;line-height:11px;margin-top:12px;text-align:center;text-transform:uppercase}.vc-chrome__disable-alpha .vc-chrome-active-color{height:18px;width:18px}.vc-chrome__disable-alpha .vc-chrome-color-wrap{width:30px}.vc-chrome__disable-alpha .vc-chrome-hue-wrap{margin-bottom:4px;margin-top:4px}";Dl(oq),gp.render=rq,gp.__file="src/components/chrome/chrome.vue",gp.install=Pl;const ms=o.defineComponent({__name:"Popover",props:{defaultOpen:{type:Boolean},open:{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(YP),o.normalizeProps(o.guardReactiveProps(o.unref(i))),{default:o.withCtx(({open:l})=>[o.renderSlot(s.$slots,"default",{open:l})]),_:3},16))}}),Ca=o.defineComponent({__name:"PopoverTrigger",props:{asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,r)=>(o.openBlock(),o.createBlock(o.unref(JP),o.normalizeProps(o.guardReactiveProps(e)),{default:o.withCtx(()=>[o.renderSlot(n.$slots,"default")]),_:3},16))}}),gs=o.defineComponent({inheritAttrs:!1,__name:"PopoverContent",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},side:{},sideOffset:{default:4},align:{default:"center"},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},updatePositionStrategy:{},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{},disableOutsidePointerEvents:{type:Boolean},class:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","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(ZP),null,{default:o.withCtx(()=>[o.createVNode(o.unref(eV),o.mergeProps({...o.unref(s),...a.$attrs},{class:o.unref(ke)("z-50 w-72 rounded-md border bg-ed-popover p-4 text-ed-popover-foreground shadow-md outline-none 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}))}}),iq={class:"flex flex-col"},sq={class:"w-6 h-6 p-0.5 inline-block rounded-sm border cursor-pointer hover:border-ed-border hover:shadow-sm relative after:border-b-2 after:border-b-red-500 after:top-[10px] after:h-0 after:left-0 after:w-6 after:absolute after:block after:rotate-[45deg]"},aq={style:{"background-color":"transparent"}},lq={viewBox:"0 0 18 18",style:{fill:"rgba(0, 0, 0, 0.4)",display:"none"}},uq={class:"ml-1 text-sm"},cq={class:"w-6 h-6 p-0.5 inline-block rounded-sm border border-transparent cursor-pointer"},dq={viewBox:"0 0 18 18",style:{fill:"rgb(255, 255, 255)",display:"none"}},fq={class:"ml-1 text-sm"},pq=["onClick"],hq={key:0,viewBox:"0 0 18 18",style:{fill:"rgb(255, 255, 255)",display:"none"}},mq={key:1,class:"absolute top-[-1px] left-[1px] w-3 h-3",viewBox:"0 0 18 18",style:{fill:"rgb(255, 255, 255)",display:"block"}},gq={class:"my-3.5"},vq={class:"text-sm"},bq={class:"relative flex w-full h-auto"},yq=["onClick"],wq={viewBox:"0 0 18 18",style:{fill:"rgb(255, 255, 255)",display:"none"}},c5=o.defineComponent({__name:"ColorPicker",props:{modelValue:{default:""},highlight:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:e}){const{t:n}=Pt(),r=uL.reduce((k,T,_)=>{const A=Math.floor(_/10);return k[A]||(k[A]=[]),k[A].push(T),k},[]),i=t,s=o.ref(!1),a=o.ref(i.modelValue),l=o.ref(!1);o.watch(()=>i.modelValue,k=>{l.value||(a.value=k??"")});function u(k){a.value=k.a<1?k.hex8:k.hex}function c(){l.value=!0}function f(){l.value&&(l.value=!1,b(a.value),s.value=!1)}o.onMounted(()=>window.addEventListener("pointerup",f)),o.onBeforeUnmount(()=>window.removeEventListener("pointerup",f));const p=ct.useLocalStorage(i.highlight?"recentColorsHighlight":"recentColors",[]),m=e;function g(k){const T=p.value.indexOf(k);T!==-1&&p.value.splice(T,1),p.value.unshift(k),p.value.length>10&&p.value.pop()}const v=o.computed(()=>p.value.slice(0,10));function b(k){if(k===void 0){m("update:modelValue",k),m("change",k);return}/^#(?:[0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$/i.test(k)&&(m("update:modelValue",k),m("change",k),g(k))}const w=o.inject("isMobile",!1),x=`dropdown-trigger-${$r(10)}`,{isOpen:C}=Nf({scrollEl:"tool-bar-format-scroll",ignoreSelector:`[data-radix-popper-content-wrapper], .${x}`}),E=o.computed(()=>w?{modal:!1,open:C.value,"onUpdate:open":k=>C.value=k}:{});return(k,T)=>{const _=Ot;return o.openBlock(),o.createBlock(o.unref(ms),o.normalizeProps(o.guardReactiveProps(E.value)),{default:o.withCtx(()=>[o.createVNode(o.unref(Ca),{disabled:k.disabled,class:o.normalizeClass(x)},{default:o.withCtx(()=>[o.renderSlot(k.$slots,"default")]),_:3},8,["disabled"]),o.createVNode(o.unref(gs),{"hide-when-detached":"",class:"w-full h-full px-[18px] py-[15px] shadow-elevation1 inside-toolbar",align:"start",side:"bottom"},{default:o.withCtx(()=>[o.createElementVNode("div",iq,[k.highlight?(o.openBlock(),o.createElementBlock("div",{key:0,class:"flex items-center py-1.5 gap-2 cursor-pointer hover:bg-ed-accent",onClick:T[0]||(T[0]=A=>b(void 0))},[o.createElementVNode("span",sq,[o.createElementVNode("span",aq,[(o.openBlock(),o.createElementBlock("svg",lq,T[5]||(T[5]=[o.createElementVNode("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"},null,-1)])))])]),o.createElementVNode("span",uq,o.toDisplayString(o.unref(n)("editor.nofill")),1)])):(o.openBlock(),o.createElementBlock("div",{key:1,class:"flex items-center cursor-pointer hover:bg-ed-accent mb-3",onClick:T[1]||(T[1]=A=>b(void 0))},[o.createElementVNode("span",cq,[o.createElementVNode("span",{style:o.normalizeStyle({backgroundColor:o.unref(lL)}),class:"relative w-[18px] h-[18px] block rounded border-transparent"},[(o.openBlock(),o.createElementBlock("svg",dq,T[6]||(T[6]=[o.createElementVNode("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"},null,-1)])))],4)]),o.createElementVNode("span",fq,o.toDisplayString(o.unref(n)("editor.default")),1)])),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(o.unref(r),(A,V)=>(o.openBlock(),o.createElementBlock("span",{key:V,class:"relative flex w-full h-auto p-0 last:pb-2"},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(A,(O,B)=>(o.openBlock(),o.createElementBlock("span",{key:B,class:"w-6 h-6 p-0.5 inline-block rounded-sm border border-transparent flex-[0 0 auto] cursor-pointer hover:border-ed-border hover:shadow-sm",onClick:H=>b(O)},[o.createElementVNode("span",{style:o.normalizeStyle({backgroundColor:O}),class:"relative w-[18px] h-[18px] block rounded border-transparent"},[O!==k.modelValue?(o.openBlock(),o.createElementBlock("svg",hq,T[7]||(T[7]=[o.createElementVNode("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"},null,-1)]))):(o.openBlock(),o.createElementBlock("svg",mq,T[8]||(T[8]=[o.createElementVNode("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"},null,-1)])))],4)],8,pq))),128))]))),128)),o.withDirectives(o.createElementVNode("div",gq,[o.createElementVNode("div",vq,o.toDisplayString(o.unref(n)("editor.recent")),1),o.createElementVNode("span",bq,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(v.value,(A,V)=>(o.openBlock(),o.createElementBlock("span",{key:V,class:"w-6 h-6 p-0.5 inline-block rounded-sm border border-transparent flex-[0 0 auto] cursor-pointer hover:border-ed-border hover:shadow-sm",onClick:O=>b(A)},[o.createElementVNode("span",{class:"relative w-[18px] h-[18px] block rounded-[2px] border-transparent",style:o.normalizeStyle({backgroundColor:A})},[(o.openBlock(),o.createElementBlock("svg",wq,T[9]||(T[9]=[o.createElementVNode("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"},null,-1)])))],4)],8,yq))),128))])],512),[[o.vShow,v.value.length]]),o.createElementVNode("div",{class:"text-sm md:hover:cursor-pointer md:hover:bg-ed-accent active:bg-ed-accent flex items-center gap-1.5",onClick:T[2]||(T[2]=A=>s.value=!0)},[o.createVNode(_,{name:"PenColor",class:"w-5 h-5"}),o.createElementVNode("span",null,o.toDisplayString(o.unref(n)("editor.color.more")),1)]),s.value?(o.openBlock(),o.createElementBlock("div",{key:2,class:"fixed inset-0 flex justify-center items-center z-50",onClick:T[4]||(T[4]=A=>s.value=!1)},[o.createElementVNode("div",{class:"bg-white p-3 rounded-lg shadow-md",onClick:T[3]||(T[3]=o.withModifiers(()=>{},["stop"])),onPointerdown:c},[o.createVNode(o.unref(gp),{"model-value":a.value,"onUpdate:modelValue":u},null,8,["model-value"])],32)])):o.createCommentVNode("",!0)])]),_:1})]),_:3},16)}}}),xq={class:"flex items-center h-[32px] hover:bg-ed-muted rounded-md"},Cq={class:"flex items-center justify-center text-sm"},kq={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Eq=["fill"],Sq=o.defineComponent({__name:"ColorActionButton",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 e=t,n=o.ref(void 0);function r(s){e.action?.(s)}function i(s){e.action?.(n.value)}return(s,a)=>(o.openBlock(),o.createElementBlock("div",xq,[o.createVNode(Ge,{id:"color",tooltip:s.tooltip,disabled:s.disabled,action:i},{icon:o.withCtx(()=>[o.createElementVNode("span",Cq,[(o.openBlock(),o.createElementBlock("svg",kq,[a[1]||(a[1]=o.createElementVNode("path",{d:"M7.25033 8.93724H12.7503M5.41699 12.5L9.33272 4.12953C9.54481 3.67616 9.65086 3.44947 9.79781 3.37915C9.9255 3.31804 10.0752 3.31804 10.2028 3.37915C10.3498 3.44947 10.4558 3.67616 10.6679 4.12953L14.5837 12.5",stroke:"currentColor","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)),o.createElementVNode("path",{d:"M3.33301 15H16.6663V16.6667H3.33301V15Z",fill:n.value||"hsl(var(--ed-foreground))"},null,8,Eq)]))])]),_:1},8,["tooltip","disabled"]),o.createVNode(c5,{modelValue:n.value,"onUpdate:modelValue":a[0]||(a[0]=l=>n.value=l),disabled:s.disabled,onChange:r},{default:o.withCtx(()=>[o.createVNode(o.unref(mn),{variant:"ghost",size:"icon",class:"h-[32px] w-3 rounded-l-none hover:bg-ed-muted-foreground/20",disabled:s.disabled},{default:o.withCtx(()=>[o.createVNode(o.unref(Ot),{class:"flex-shrink-0 w-1.5 h-1.5",name:"ChevronDown"})]),_:1},8,["disabled"])]),_:1},8,["modelValue","disabled"])]))}}),d5=GW.extend({addOptions(){return{...this.parent?.(),button({editor:t,t:e}){return{component:Sq,componentProps:{action:n=>{typeof n>"u"&&t.chain().focus().unsetColor().run(),typeof n=="string"&&t.chain().focus().setColor(n).run()},isActive:()=>{const{color:n}=t.getAttributes("textStyle");return n&&t.isActive({color:n})||!1},editor:t,disabled:!t.can().setColor(""),tooltip:e("editor.color.tooltip")}}}}}}),_q=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,Tq=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,f5=Fn.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",wt(this.options.HTMLAttributes,t),0]},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Ys({find:_q,type:this.type})]},addPasteRules(){return[Ji({find:Tq,type:this.type})]}}),Aq={class:"flex items-center h-[32px] hover:bg-ed-muted rounded-md"},Mq={class:"text-sm flex items-center justify-center"},Oq={width:"18px",height:"18px",viewBox:"0 0 256 256",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},Bq={id:"icon/填充色",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},Iq={id:"icon/背景颜色"},Lq=["fill"],p5=o.defineComponent({__name:"HighlightActionButton",props:{editor:{},tooltip:{default:void 0},disabled:{type:Boolean,default:!1},action:{type:Function,default:void 0},isActive:{type:Function,default:void 0},tooltipOptions:{default:void 0}},setup(t){const e=t,n=o.ref(void 0),{state:r}=bn();function i(a){e.action?.(a)}function s(a){e.action?.(n.value)}return o.watchEffect(()=>{const{color:a}=e.editor.getAttributes("highlight");r.highlight=a}),(a,l)=>(o.openBlock(),o.createElementBlock("div",Aq,[o.createVNode(Ge,{id:"highlight",tooltip:a.tooltip,disabled:a.disabled,action:s,"tooltip-options":a.tooltipOptions},{icon:o.withCtx(()=>[o.createElementVNode("span",Mq,[(o.openBlock(),o.createElementBlock("svg",Oq,[o.createElementVNode("g",Bq,[o.createElementVNode("g",Iq,[l[1]||(l[1]=o.createElementVNode("g",{id:"编组",fill:"currentColor"},[o.createElementVNode("g",{id:"矩形",transform:"translate(119.502295, 137.878331) rotate(-135.000000) translate(-119.502295, -137.878331) translate(48.002295, 31.757731)"},[o.createElementVNode("path",{d:"M100.946943,60.8084699 L43.7469427,60.8084699 C37.2852111,60.8084699 32.0469427,66.0467383 32.0469427,72.5084699 L32.0469427,118.70847 C32.0469427,125.170201 37.2852111,130.40847 43.7469427,130.40847 L100.946943,130.40847 C107.408674,130.40847 112.646943,125.170201 112.646943,118.70847 L112.646943,72.5084699 C112.646943,66.0467383 107.408674,60.8084699 100.946943,60.8084699 Z M93.646,79.808 L93.646,111.408 L51.046,111.408 L51.046,79.808 L93.646,79.808 Z","fill-rule":"nonzero"}),o.createElementVNode("path",{d:"M87.9366521,16.90916 L87.9194966,68.2000001 C87.9183543,69.4147389 86.9334998,70.399264 85.7187607,70.4 L56.9423078,70.4 C55.7272813,70.4 54.7423078,69.4150264 54.7423078,68.2 L54.7423078,39.4621057 C54.7423078,37.2523513 55.5736632,35.1234748 57.0711706,33.4985176 L76.4832996,12.4342613 C78.9534987,9.75382857 83.1289108,9.5834005 85.8093436,12.0535996 C87.1658473,13.303709 87.9372691,15.0644715 87.9366521,16.90916 Z","fill-rule":"evenodd"}),o.createElementVNode("path",{d:"M131.3,111.241199 L11.7,111.241199 C5.23826843,111.241199 0,116.479467 0,122.941199 L0,200.541199 C0,207.002931 5.23826843,212.241199 11.7,212.241199 L131.3,212.241199 C137.761732,212.241199 143,207.002931 143,200.541199 L143,122.941199 C143,116.479467 137.761732,111.241199 131.3,111.241199 Z M124,130.241 L124,193.241 L19,193.241 L19,130.241 L124,130.241 Z","fill-rule":"nonzero"})])],-1)),o.createElementVNode("path",{id:"矩形",d:"M51,218 L205,218 C211.075132,218 216,222.924868 216,229 C216,235.075132 211.075132,240 205,240 L51,240 C44.9248678,240 40,235.075132 40,229 C40,222.924868 44.9248678,218 51,218 Z",fill:n.value||"#FBDE28"},null,8,Lq)])])]))])]),_:1},8,["tooltip","disabled","tooltip-options"]),o.createVNode(c5,{modelValue:n.value,"onUpdate:modelValue":l[0]||(l[0]=u=>n.value=u),highlight:"",disabled:a.disabled,onChange:i},{default:o.withCtx(()=>[o.createVNode(o.unref(mn),{variant:"ghost",size:"icon",class:"w-3 h-[32px] rounded-l-none hover:bg-ed-muted-foreground/20",disabled:a.disabled},{default:o.withCtx(()=>[o.createVNode(o.unref(Ot),{class:"w-3 h-3 text-zinc-500",name:"MenuDown"})]),_:1},8,["disabled"])]),_:1},8,["modelValue","disabled"])]))}}),Rq=f5.extend({addOptions(){return{...this.parent?.(),multicolor:!0,button:({editor:t,t:e})=>({component:p5,componentProps:{action:n=>{typeof n=="string"&&t.chain().focus().setHighlight({color:n}).run(),typeof n>"u"&&t.chain().focus().unsetHighlight().run()},editor:t,isActive:()=>t.isActive("highlight")||!1,disabled:!t.can().setHighlight(),shortcutKeys:["⇧","mod","H"],tooltip:e("editor.highlight.tooltip")}})}}}),Dq="listItem",h5="textStyle",m5=/^\s*([-+*])\s$/,Pq=Lt.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",wt(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Dq,this.editor.getAttributes(h5)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=al({find:m5,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=al({find:m5,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(h5),editor:this.editor})),[t]}}),Vq=["id"],g5=o.defineComponent({__name:"ActionDropdownButtonSplit",props:{icon:{default:void 0},title:{default:void 0},tooltip:{default:void 0},disabled:{type:Boolean,default:!1},class:{default:""},shortcutKeys:{default:void 0},btnClass:{default:""},action:{type:Function,default:void 0},isActive:{type:Function,default:void 0},id:{default:""}},setup(t){const e=t;return(n,r)=>(o.openBlock(),o.createElementBlock("div",{id:`dropdown-btn-${n.id}`,class:o.normalizeClass(["flex items-center h-[32px] hover:bg-ed-muted rounded-md",[n.isActive?.()&&"bg-ed-muted"]])},[o.createVNode(Ge,{class:o.normalizeClass(n.btnClass),action:n.action,title:n.title,icon:n.icon,tooltip:n.tooltip,disabled:n.disabled,"shortcut-keys":n.shortcutKeys},null,8,["class","action","title","icon","tooltip","disabled","shortcut-keys"]),o.createVNode(o.unref(U6),null,{default:o.withCtx(()=>[o.createVNode(o.unref(W6),{disabled:n.disabled},{default:o.withCtx(()=>[o.createVNode(mn,{variant:"ghost",size:"icon",class:"h-[32px] w-3 rounded-l-none hover:bg-ed-muted-foreground/20",disabled:n.disabled},{default:o.withCtx(()=>[o.createVNode(o.unref(Ot),{class:"w-3 h-3 text-zinc-500",name:"MenuDown"})]),_:1},8,["disabled"])]),_:1},8,["disabled"]),o.createVNode(o.unref(j6),o.mergeProps({class:o.unref(ke)("min-w-24",e.class),align:"start",side:"bottom"},n.$attrs),{default:o.withCtx(()=>[o.renderSlot(n.$slots,"default")]),_:3},16,["class"])]),_:3})],10,Vq))}}),Fq=o.defineComponent({__name:"BulletListMenuButton",props:{editor:{},disabled:{type:Boolean,default:!1},tooltip:{default:""}},setup(t){const e=t,{t:n}=Pt(),r=[{label:"editor.bulletlist.disc.tooltip",value:"disc"},{label:"editor.bulletlist.circle.tooltip",value:"circle"},{label:"editor.bulletlist.square.tooltip",value:"square"}],i=o.computed(()=>e.editor?.isActive("bulletList")?e.editor.getAttributes("bulletList").listStyleType:"disc");function s(a){e.editor.isActive("bulletList")?e.editor.getAttributes("bulletList").listStyleType===a.value?e.editor.chain().focus().toggleBulletList().run():e.editor.chain().focus().updateAttributes("bulletList",{listStyleType:a.value}).run():e.editor.chain().focus().toggleBulletList().updateAttributes("bulletList",{listStyleType:a.value}).run()}return(a,l)=>(o.openBlock(),o.createBlock(g5,{id:"bullet-list",action:()=>s,disabled:a.disabled,tooltip:a.tooltip,class:"grid w-full grid-cols-3 gap-1 min-w-4"},{default:o.withCtx(()=>[o.createVNode(o.unref(fa),null,{default:o.withCtx(()=>[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(r,u=>o.createVNode(o.unref(ca),{key:u.value,"delay-duration":0},{default:o.withCtx(()=>[o.createVNode(o.unref(da),null,{default:o.withCtx(()=>[o.createVNode(o.unref(E1),{class:"p-0",onClick:c=>s(u)},{default:o.withCtx(()=>[o.createElementVNode("div",{class:o.normalizeClass([[i.value===u.value?"bg-ed-accent border border-ed-accent-foreground":""],"h-[48px] flex flex-col w-[48px] box-border rounded-sm border"])},[o.createElementVNode("ol",{style:o.normalizeStyle({listStyleType:u.value,lineHeight:1}),class:"text-[10px] pl-3 flex-1 list-outside flex flex-col items-center justify-center"},[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(3,c=>o.createElementVNode("li",{key:c},l[0]||(l[0]=[o.createElementVNode("hr",{class:"border-0 bg-gray-200 h-[3px] w-6 my-1"},null,-1)]))),64))],4)],2)]),_:2},1032,["onClick"])]),_:2},1024),o.createVNode(o.unref(is),{side:"bottom"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)(u.label)),1)]),_:2},1024)]),_:2},1024)),64))]),_:1})]),_:1},8,["action","disabled","tooltip"]))}}),$q=Pq.extend({addAttributes(){return{...this.parent?.(),listStyleType:{default:"disc",parseHTML:t=>({listStyleType:t.style["list-style-type"]??"disc"}),renderHTML:({listStyleType:t})=>({style:`list-style-type: ${t?.listStyleType||t}`})}}},addOptions(){return{...this.parent?.(),button:({editor:t,t:e})=>({component:Fq,componentProps:{action:()=>t.commands.toggleBulletList(),isActive:()=>t.isActive("bulletList")||!1,disabled:!t.can().toggleBulletList(),shortcutKeys:["shift","mod","8"],icon:"List",tooltip:e("editor.bulletlist.tooltip")}})}}}),sv=Lt.create({name:"clear",addOptions(){return{...this.parent?.(),button:({editor:t,t:e})=>({component:Ge,componentProps:{action:()=>t.chain().focus().clearNodes().unsetAllMarks().run(),disabled:!t.can().chain().focus().clearNodes().unsetAllMarks().run(),icon:"Eraser",tooltip:e("editor.clear.tooltip")}})}}}),Hq="listItem",v5="textStyle",b5=/^(\d+)\.\s$/,zq=Lt.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:void 0,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",wt(this.options.HTMLAttributes,n),0]:["ol",wt(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Hq,this.editor.getAttributes(v5)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=al({find:b5,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=al({find:b5,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(v5)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),Uq=o.defineComponent({__name:"OrderedListMenuButton",props:{editor:{},disabled:{type:Boolean,default:!1},tooltip:{default:""},shortcutKeys:{default:void 0},isActive:{type:Function,default:void 0}},setup(t){const e=t,{t:n}=Pt(),r=[{label:"editor.orderedlist.decimal.tooltip",value:"decimal"},{label:"editor.orderedlist.decimalLeadingZero.tooltip",value:"decimal-leading-zero"},{label:"editor.orderedlist.lowerRoman.tooltip",value:"lower-roman"},{label:"editor.orderedlist.upperRoman.tooltip",value:"upper-roman"},{label:"editor.orderedlist.lowerLatin.tooltip",value:"lower-latin"},{label:"editor.orderedlist.upperLatin.tooltip",value:"upper-latin"},{label:"editor.orderedlist.tradChineseInformal.tooltip",value:"trad-chinese-informal"},{label:"editor.orderedlist.simpChineseFormal.tooltip",value:"simp-chinese-formal"}],i=o.computed(()=>e.editor?.isActive("orderedList")?e.editor.getAttributes("orderedList").listType:"decimal");function s(a){e.editor.isActive("orderedList")?e.editor.getAttributes("orderedList").listType===a.value?e.editor.chain()?.toggleOrderedList().run():e.editor.chain()?.updateAttributes("orderedList",{listType:a.value}).run():e.editor.chain().focus().toggleOrderedList().updateAttributes("orderedList",{listType:a.value}).run()}return(a,l)=>(o.openBlock(),o.createBlock(g5,{action:()=>s,disabled:a.disabled,tooltip:a.tooltip,"is-active":a.isActive,"shortcut-keys":a.shortcutKeys,class:"min-w-4 w-full grid grid-cols-3 gap-1"},{default:o.withCtx(()=>[o.createVNode(o.unref(fa),null,{default:o.withCtx(()=>[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(r,u=>o.createVNode(o.unref(ca),{key:u.value,"delay-duration":0},{default:o.withCtx(()=>[o.createVNode(o.unref(da),{"as-child":""},{default:o.withCtx(()=>[o.createVNode(o.unref(E1),{class:"p-0",onClick:c=>s(u)},{default:o.withCtx(()=>[o.createElementVNode("div",{class:o.normalizeClass([[i.value===u.value?"bg-ed-accent border border-ed-accent-foreground":""],"h-[72px] flex flex-col w-[72px] box-border rounded-sm border"])},[o.createElementVNode("ol",{style:o.normalizeStyle({listStyleType:u.value,lineHeight:1}),class:"text-[12px] pl-3 flex-1 list-outside flex flex-col items-center justify-center"},[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(3,c=>o.createElementVNode("li",{key:c},l[0]||(l[0]=[o.createElementVNode("hr",{class:"border-0 bg-gray-200 h-[3px] w-6 my-1"},null,-1)]))),64))],4)],2)]),_:2},1032,["onClick"])]),_:2},1024),o.createVNode(o.unref(is),{side:"bottom"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)(u.label)),1)]),_:2},1024)]),_:2},1024)),64))]),_:1})]),_:1},8,["action","disabled","tooltip","is-active","shortcut-keys"]))}}),Wq=zq.extend({addAttributes(){return{...this.parent?.(),listType:{default:"decimal",parseHTML:t=>{t.style.getPropertyValue("list-style-type")},renderHTML:({listType:t})=>({style:`list-style-type: ${t}`})}}},addOptions(){return{...this.parent?.(),button:({editor:t,t:e})=>({component:Uq,componentProps:{action:()=>t.commands.toggleOrderedList(),isActive:()=>t.isActive("orderedList")||!1,disabled:!t.can().toggleOrderedList(),icon:"ListOrdered",shortcutKeys:["mod","shift","7"],tooltip:e("editor.orderedlist.tooltip")}})}}}),jq=/^\s*(\[([( |x])?\])\s$/,qq=Lt.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList"}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{const e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:e}){return["li",wt(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:n,editor:r})=>{const i=document.createElement("li"),s=document.createElement("label"),a=document.createElement("span"),l=document.createElement("input"),u=document.createElement("div");return s.contentEditable="false",l.type="checkbox",l.addEventListener("mousedown",c=>c.preventDefault()),l.addEventListener("change",c=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){l.checked=!l.checked;return}const{checked:f}=c.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:p})=>{const m=n();if(typeof m!="number")return!1;const g=p.doc.nodeAt(m);return p.setNodeMarkup(m,void 0,{...g?.attrs,checked:f}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,f)||(l.checked=!l.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([c,f])=>{i.setAttribute(c,f)}),i.dataset.checked=t.attrs.checked,l.checked=t.attrs.checked,s.append(l,a),i.append(s,u),Object.entries(e).forEach(([c,f])=>{i.setAttribute(c,f)}),{dom:i,contentDOM:u,update:c=>c.type!==this.type?!1:(i.dataset.checked=c.attrs.checked,l.checked=c.attrs.checked,!0)}}},addInputRules(){return[al({find:jq,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),Kq=Lt.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",wt(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}).extend({addOptions(){return{...this.parent?.(),HTMLAttributes:{class:"task-list"},taskItem:{HTMLAttributes:{class:"task-list-item"}},button:({editor:t,t:e})=>({component:Ge,componentProps:{action:()=>t.commands.toggleTaskList(),isActive:()=>t.isActive("taskList")||!1,disabled:!t.can().toggleTaskList(),icon:"ListTodo",shortcutKeys:["shift","mod","9"],tooltip:e("editor.tasklist.tooltip")}})}},addExtensions(){return[qq.configure(this.options.taskItem)]}}),Gq=/^\s*>\s$/,Xq=Lt.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",wt(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[al({find:Gq,type:this.type})]}}).extend({addOptions(){return{...this.parent?.(),HTMLAttributes:{class:"blockquote"},button:({editor:t,t:e})=>({component:Ge,componentProps:{action:()=>t.commands.toggleBlockquote(),isActive:()=>t.isActive("blockquote")||!1,disabled:!t.can().toggleBlockquote(),icon:"TextQuote",shortcutKeys:["shift","mod","B"],tooltip:e("editor.blockquote.tooltip")}})}}}),Yq="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",Jq="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Vl=(t,e)=>{for(const n in e)t[n]=e[n];return t},av="numeric",lv="ascii",uv="alpha",yc="asciinumeric",wc="alphanumeric",cv="domain",y5="emoji",Zq="scheme",Qq="slashscheme",dv="whitespace";function Nq(t,e){return t in e||(e[t]=[]),e[t]}function ka(t,e,n){e[av]&&(e[yc]=!0,e[wc]=!0),e[lv]&&(e[yc]=!0,e[uv]=!0),e[yc]&&(e[wc]=!0),e[uv]&&(e[wc]=!0),e[wc]&&(e[cv]=!0),e[y5]&&(e[cv]=!0);for(const r in e){const i=Nq(r,n);i.indexOf(t)<0&&i.push(t)}}function eK(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function ar(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}ar.groups={},ar.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let r=0;r<e.jr.length;r++){const i=e.jr[r][0],s=e.jr[r][1];if(s&&i.test(t))return s}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,n,r){for(let i=0;i<t.length;i++)this.tt(t[i],e,n,r)},tr(t,e,n,r){r=r||ar.groups;let i;return e&&e.j?i=e:(i=new ar(e),n&&r&&ka(e,n,r)),this.jr.push([t,i]),i},ts(t,e,n,r){let i=this;const s=t.length;if(!s)return i;for(let a=0;a<s-1;a++)i=i.tt(t[a]);return i.tt(t[s-1],e,n,r)},tt(t,e,n,r){r=r||ar.groups;const i=this;if(e&&e.j)return i.j[t]=e,e;const s=e;let a,l=i.go(t);if(l?(a=new ar,Vl(a.j,l.j),a.jr.push.apply(a.jr,l.jr),a.jd=l.jd,a.t=l.t):a=new ar,s){if(r)if(a.t&&typeof a.t=="string"){const u=Vl(eK(a.t,r),n);ka(s,u,r)}else n&&ka(s,n,r);a.t=s}return i.j[t]=a,a}};const mt=(t,e,n,r,i)=>t.ta(e,n,r,i),rn=(t,e,n,r,i)=>t.tr(e,n,r,i),w5=(t,e,n,r,i)=>t.ts(e,n,r,i),Ce=(t,e,n,r,i)=>t.tt(e,n,r,i),bi="WORD",fv="UWORD",x5="ASCIINUMERICAL",C5="ALPHANUMERICAL",xc="LOCALHOST",pv="TLD",hv="UTLD",vp="SCHEME",Fl="SLASH_SCHEME",mv="NUM",gv="WS",vv="NL",Cc="OPENBRACE",kc="CLOSEBRACE",bp="OPENBRACKET",yp="CLOSEBRACKET",wp="OPENPAREN",xp="CLOSEPAREN",Cp="OPENANGLEBRACKET",kp="CLOSEANGLEBRACKET",Ep="FULLWIDTHLEFTPAREN",Sp="FULLWIDTHRIGHTPAREN",_p="LEFTCORNERBRACKET",Tp="RIGHTCORNERBRACKET",Ap="LEFTWHITECORNERBRACKET",Mp="RIGHTWHITECORNERBRACKET",Op="FULLWIDTHLESSTHAN",Bp="FULLWIDTHGREATERTHAN",Ip="AMPERSAND",bv="APOSTROPHE",Lp="ASTERISK",vs="AT",Rp="BACKSLASH",Dp="BACKTICK",Pp="CARET",bs="COLON",yv="COMMA",Vp="DOLLAR",Uo="DOT",Fp="EQUALS",wv="EXCLAMATION",jr="HYPHEN",Ec="PERCENT",$p="PIPE",Hp="PLUS",zp="POUND",Sc="QUERY",xv="QUOTE",k5="FULLWIDTHMIDDLEDOT",Cv="SEMI",Wo="SLASH",_c="TILDE",Up="UNDERSCORE",E5="EMOJI",Wp="SYM";var S5=Object.freeze({__proto__:null,WORD:bi,UWORD:fv,ASCIINUMERICAL:x5,ALPHANUMERICAL:C5,LOCALHOST:xc,TLD:pv,UTLD:hv,SCHEME:vp,SLASH_SCHEME:Fl,NUM:mv,WS:gv,NL:vv,OPENBRACE:Cc,CLOSEBRACE:kc,OPENBRACKET:bp,CLOSEBRACKET:yp,OPENPAREN:wp,CLOSEPAREN:xp,OPENANGLEBRACKET:Cp,CLOSEANGLEBRACKET:kp,FULLWIDTHLEFTPAREN:Ep,FULLWIDTHRIGHTPAREN:Sp,LEFTCORNERBRACKET:_p,RIGHTCORNERBRACKET:Tp,LEFTWHITECORNERBRACKET:Ap,RIGHTWHITECORNERBRACKET:Mp,FULLWIDTHLESSTHAN:Op,FULLWIDTHGREATERTHAN:Bp,AMPERSAND:Ip,APOSTROPHE:bv,ASTERISK:Lp,AT:vs,BACKSLASH:Rp,BACKTICK:Dp,CARET:Pp,COLON:bs,COMMA:yv,DOLLAR:Vp,DOT:Uo,EQUALS:Fp,EXCLAMATION:wv,HYPHEN:jr,PERCENT:Ec,PIPE:$p,PLUS:Hp,POUND:zp,QUERY:Sc,QUOTE:xv,FULLWIDTHMIDDLEDOT:k5,SEMI:Cv,SLASH:Wo,TILDE:_c,UNDERSCORE:Up,EMOJI:E5,SYM:Wp});const yi=/[a-z]/,Tc=new RegExp("\\p{L}","u"),kv=new RegExp("\\p{Emoji}","u"),wi=/\d/,Ev=/\s/,_5="\r",Sv=`
|
|
324
324
|
`,tK="️",nK="",_v="";let jp=null,qp=null;function rK(t=[]){const e={};ar.groups=e;const n=new ar;jp==null&&(jp=A5(Yq)),qp==null&&(qp=A5(Jq)),Ce(n,"'",bv),Ce(n,"{",Cc),Ce(n,"}",kc),Ce(n,"[",bp),Ce(n,"]",yp),Ce(n,"(",wp),Ce(n,")",xp),Ce(n,"<",Cp),Ce(n,">",kp),Ce(n,"(",Ep),Ce(n,")",Sp),Ce(n,"「",_p),Ce(n,"」",Tp),Ce(n,"『",Ap),Ce(n,"』",Mp),Ce(n,"<",Op),Ce(n,">",Bp),Ce(n,"&",Ip),Ce(n,"*",Lp),Ce(n,"@",vs),Ce(n,"`",Dp),Ce(n,"^",Pp),Ce(n,":",bs),Ce(n,",",yv),Ce(n,"$",Vp),Ce(n,".",Uo),Ce(n,"=",Fp),Ce(n,"!",wv),Ce(n,"-",jr),Ce(n,"%",Ec),Ce(n,"|",$p),Ce(n,"+",Hp),Ce(n,"#",zp),Ce(n,"?",Sc),Ce(n,'"',xv),Ce(n,"/",Wo),Ce(n,";",Cv),Ce(n,"~",_c),Ce(n,"_",Up),Ce(n,"\\",Rp),Ce(n,"・",k5);const r=rn(n,wi,mv,{[av]:!0});rn(r,wi,r);const i=rn(r,yi,x5,{[yc]:!0}),s=rn(r,Tc,C5,{[wc]:!0}),a=rn(n,yi,bi,{[lv]:!0});rn(a,wi,i),rn(a,yi,a),rn(i,wi,i),rn(i,yi,i);const l=rn(n,Tc,fv,{[uv]:!0});rn(l,yi),rn(l,wi,s),rn(l,Tc,l),rn(s,wi,s),rn(s,yi),rn(s,Tc,s);const u=Ce(n,Sv,vv,{[dv]:!0}),c=Ce(n,_5,gv,{[dv]:!0}),f=rn(n,Ev,gv,{[dv]:!0});Ce(n,_v,f),Ce(c,Sv,u),Ce(c,_v,f),rn(c,Ev,f),Ce(f,_5),Ce(f,Sv),rn(f,Ev,f),Ce(f,_v,f);const p=rn(n,kv,E5,{[y5]:!0});Ce(p,"#"),rn(p,kv,p),Ce(p,tK,p);const m=Ce(p,nK);Ce(m,"#"),rn(m,kv,p);const g=[[yi,a],[wi,i]],v=[[yi,null],[Tc,l],[wi,s]];for(let b=0;b<jp.length;b++)ys(n,jp[b],pv,bi,g);for(let b=0;b<qp.length;b++)ys(n,qp[b],hv,fv,v);ka(pv,{tld:!0,ascii:!0},e),ka(hv,{utld:!0,alpha:!0},e),ys(n,"file",vp,bi,g),ys(n,"mailto",vp,bi,g),ys(n,"http",Fl,bi,g),ys(n,"https",Fl,bi,g),ys(n,"ftp",Fl,bi,g),ys(n,"ftps",Fl,bi,g),ka(vp,{scheme:!0,ascii:!0},e),ka(Fl,{slashscheme:!0,ascii:!0},e),t=t.sort((b,w)=>b[0]>w[0]?1:-1);for(let b=0;b<t.length;b++){const w=t[b][0],C=t[b][1]?{[Zq]:!0}:{[Qq]:!0};w.indexOf("-")>=0?C[cv]=!0:yi.test(w)?wi.test(w)?C[yc]=!0:C[lv]=!0:C[av]=!0,w5(n,w,w,C)}return w5(n,"localhost",xc,{ascii:!0}),n.jd=new ar(Wp),{start:n,tokens:Vl({groups:e},S5)}}function T5(t,e){const n=oK(e.replace(/[A-Z]/g,l=>l.toLowerCase())),r=n.length,i=[];let s=0,a=0;for(;a<r;){let l=t,u=null,c=0,f=null,p=-1,m=-1;for(;a<r&&(u=l.go(n[a]));)l=u,l.accepts()?(p=0,m=0,f=l):p>=0&&(p+=n[a].length,m++),c+=n[a].length,s+=n[a].length,a++;s-=p,a-=m,c-=p,i.push({t:f.t,v:e.slice(s-c,s),s:s-c,e:s})}return i}function oK(t){const e=[],n=t.length;let r=0;for(;r<n;){let i=t.charCodeAt(r),s,a=i<55296||i>56319||r+1===n||(s=t.charCodeAt(r+1))<56320||s>57343?t[r]:t.slice(r,r+2);e.push(a),r+=a.length}return e}function ys(t,e,n,r,i){let s;const a=e.length;for(let l=0;l<a-1;l++){const u=e[l];t.j[u]?s=t.j[u]:(s=new ar(r),s.jr=i.slice(),t.j[u]=s),t=s}return s=new ar(n),s.jr=i.slice(),t.j[e[a-1]]=s,s}function A5(t){const e=[],n=[];let r=0,i="0123456789";for(;r<t.length;){let s=0;for(;i.indexOf(t[r+s])>=0;)s++;if(s>0){e.push(n.join(""));for(let a=parseInt(t.substring(r,r+s),10);a>0;a--)n.pop();r+=s}else n.push(t[r]),r++}return e}const Ac={defaultProtocol:"http",events:null,format:M5,formatHref:M5,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Tv(t,e=null){let n=Vl({},Ac);t&&(n=Vl(n,t instanceof Tv?t.o:t));const r=n.ignoreTags,i=[];for(let s=0;s<r.length;s++)i.push(r[s].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=i}Tv.prototype={o:Ac,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=e!=null;let i=this.o[t];return i&&(typeof i=="object"?(i=n.t in i?i[n.t]:Ac[t],typeof i=="function"&&r&&(i=i(e,n))):typeof i=="function"&&r&&(i=i(e,n.t,n)),i)},getObj(t,e,n){let r=this.o[t];return typeof r=="function"&&e!=null&&(r=r(e,n.t,n)),r},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function M5(t){return t}function O5(t,e){this.t="token",this.v=t,this.tk=e}O5.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=Ac.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),i=t.get("tagName",n,e),s=this.toFormattedString(t),a={},l=t.get("className",n,e),u=t.get("target",n,e),c=t.get("rel",n,e),f=t.getObj("attributes",n,e),p=t.getObj("events",n,e);return a.href=r,l&&(a.class=l),u&&(a.target=u),c&&(a.rel=c),f&&Vl(a,f),{tagName:i,attributes:a,content:s,eventListeners:p}}};function Kp(t,e){class n extends O5{constructor(i,s){super(i,s),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const B5=Kp("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),I5=Kp("text"),iK=Kp("nl"),Gp=Kp("url",{isLink:!0,toHref(t=Ac.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==xc&&t[1].t===bs}}),qr=t=>new ar(t);function sK({groups:t}){const e=t.domain.concat([Ip,Lp,vs,Rp,Dp,Pp,Vp,Fp,jr,mv,Ec,$p,Hp,zp,Wo,Wp,_c,Up]),n=[bs,yv,Uo,wv,Ec,Sc,xv,Cv,Cp,kp,Cc,kc,yp,bp,wp,xp,Ep,Sp,_p,Tp,Ap,Mp,Op,Bp],r=[Ip,bv,Lp,Rp,Dp,Pp,Vp,Fp,jr,Cc,kc,Ec,$p,Hp,zp,Sc,Wo,Wp,_c,Up],i=qr(),s=Ce(i,_c);mt(s,r,s),mt(s,t.domain,s);const a=qr(),l=qr(),u=qr();mt(i,t.domain,a),mt(i,t.scheme,l),mt(i,t.slashscheme,u),mt(a,r,s),mt(a,t.domain,a);const c=Ce(a,vs);Ce(s,vs,c),Ce(l,vs,c),Ce(u,vs,c);const f=Ce(s,Uo);mt(f,r,s),mt(f,t.domain,s);const p=qr();mt(c,t.domain,p),mt(p,t.domain,p);const m=Ce(p,Uo);mt(m,t.domain,p);const g=qr(B5);mt(m,t.tld,g),mt(m,t.utld,g),Ce(c,xc,g);const v=Ce(p,jr);Ce(v,jr,v),mt(v,t.domain,p),mt(g,t.domain,p),Ce(g,Uo,m),Ce(g,jr,v);const b=Ce(g,bs);mt(b,t.numeric,B5);const w=Ce(a,jr),x=Ce(a,Uo);Ce(w,jr,w),mt(w,t.domain,a),mt(x,r,s),mt(x,t.domain,a);const C=qr(Gp);mt(x,t.tld,C),mt(x,t.utld,C),mt(C,t.domain,a),mt(C,r,s),Ce(C,Uo,x),Ce(C,jr,w),Ce(C,vs,c);const E=Ce(C,bs),k=qr(Gp);mt(E,t.numeric,k);const T=qr(Gp),_=qr();mt(T,e,T),mt(T,n,_),mt(_,e,T),mt(_,n,_),Ce(C,Wo,T),Ce(k,Wo,T);const A=Ce(l,bs),V=Ce(u,bs),O=Ce(V,Wo),B=Ce(O,Wo);mt(l,t.domain,a),Ce(l,Uo,x),Ce(l,jr,w),mt(u,t.domain,a),Ce(u,Uo,x),Ce(u,jr,w),mt(A,t.domain,T),Ce(A,Wo,T),Ce(A,Sc,T),mt(B,t.domain,T),mt(B,e,T),Ce(B,Wo,T);const H=[[Cc,kc],[bp,yp],[wp,xp],[Cp,kp],[Ep,Sp],[_p,Tp],[Ap,Mp],[Op,Bp]];for(let j=0;j<H.length;j++){const[Y,N]=H[j],U=Ce(T,Y);Ce(_,Y,U),Ce(U,N,T);const P=qr(Gp);mt(U,e,P);const L=qr();mt(U,n),mt(P,e,P),mt(P,n,L),mt(L,e,P),mt(L,n,L),Ce(P,N,T),Ce(L,N,T)}return Ce(i,xc,C),Ce(i,vv,iK),{start:i,tokens:S5}}function aK(t,e,n){let r=n.length,i=0,s=[],a=[];for(;i<r;){let l=t,u=null,c=null,f=0,p=null,m=-1;for(;i<r&&!(u=l.go(n[i].t));)a.push(n[i++]);for(;i<r&&(c=u||l.go(n[i].t));)u=null,l=c,l.accepts()?(m=0,p=l):m>=0&&m++,i++,f++;if(m<0)i-=f,i<r&&(a.push(n[i]),i++);else{a.length>0&&(s.push(Av(I5,e,a)),a=[]),i-=m,f-=m;const g=p.t,v=n.slice(i-f,i);s.push(Av(g,e,v))}}return a.length>0&&s.push(Av(I5,e,a)),s}function Av(t,e,n){const r=n[0].s,i=n[n.length-1].e,s=e.slice(r,i);return new t(s,n)}const lK=typeof console<"u"&&console&&console.warn||(()=>{}),uK="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Gt={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function cK(){return ar.groups={},Gt.scanner=null,Gt.parser=null,Gt.tokenQueue=[],Gt.pluginQueue=[],Gt.customSchemes=[],Gt.initialized=!1,Gt}function L5(t,e=!1){if(Gt.initialized&&lK(`linkifyjs: already initialized - will not register custom scheme "${t}" ${uK}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
|
|
325
325
|
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
326
326
|
2. Cannot start or end with "-"
|
|
@@ -333,30 +333,30 @@ ${c}`:u)}else throw a},onCacheKey:a=>oz(e,n,a)}}function XU(t){if(Oe(t))return t
|
|
|
333
333
|
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(i=>r.set(i)),r}static accessor(e){const r=(this[Hk]=this[Hk]={accessors:{}}).accessors,i=this.prototype;function s(a){const l=Hc(a);r[l]||(aJ(i,a),r[l]=!0)}return ce.isArray(e)?e.forEach(s):s(e),this}};lr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),ce.reduceDescriptors(lr.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}}),ce.freezeMethods(lr);function bb(t,e){const n=this||$c,r=e||n,i=lr.from(r.headers);let s=r.data;return ce.forEach(t,function(l){s=l.call(n,s,i.normalize(),e?e.status:void 0)}),i.normalize(),s}function zk(t){return!!(t&&t.__CANCEL__)}function jl(t,e,n){ut.call(this,t??"canceled",ut.ERR_CANCELED,e,n),this.name="CanceledError"}ce.inherits(jl,ut,{__CANCEL__:!0});function Uk(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new ut("Request failed with status code "+n.status,[ut.ERR_BAD_REQUEST,ut.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function lJ(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function uJ(t,e){t=t||10;const n=new Array(t),r=new Array(t);let i=0,s=0,a;return e=e!==void 0?e:1e3,function(u){const c=Date.now(),f=r[s];a||(a=c),n[i]=u,r[i]=c;let p=s,m=0;for(;p!==i;)m+=n[p++],p=p%t;if(i=(i+1)%t,i===s&&(s=(s+1)%t),c-a<e)return;const g=f&&c-f;return g?Math.round(m*1e3/g):void 0}}function cJ(t,e){let n=0,r=1e3/e,i,s;const a=(c,f=Date.now())=>{n=f,i=null,s&&(clearTimeout(s),s=null),t.apply(null,c)};return[(...c)=>{const f=Date.now(),p=f-n;p>=r?a(c,f):(i=c,s||(s=setTimeout(()=>{s=null,a(i)},r-p)))},()=>i&&a(i)]}const vh=(t,e,n=3)=>{let r=0;const i=uJ(50,250);return cJ(s=>{const a=s.loaded,l=s.lengthComputable?s.total:void 0,u=a-r,c=i(u),f=a<=l;r=a;const p={loaded:a,total:l,progress:l?a/l:void 0,bytes:u,rate:c||void 0,estimated:c&&l&&f?(l-a)/c:void 0,event:s,lengthComputable:l!=null,[e?"download":"upload"]:!0};t(p)},n)},Wk=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},jk=t=>(...e)=>ce.asap(()=>t(...e)),dJ=zn.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,zn.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(zn.origin),zn.navigator&&/(msie|trident)/i.test(zn.navigator.userAgent)):()=>!0,fJ=zn.hasStandardBrowserEnv?{write(t,e,n,r,i,s){const a=[t+"="+encodeURIComponent(e)];ce.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),ce.isString(r)&&a.push("path="+r),ce.isString(i)&&a.push("domain="+i),s===!0&&a.push("secure"),document.cookie=a.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function pJ(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function hJ(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function qk(t,e,n){let r=!pJ(e);return t&&(r||n==!1)?hJ(t,e):e}const Kk=t=>t instanceof lr?{...t}:t;function Aa(t,e){e=e||{};const n={};function r(c,f,p,m){return ce.isPlainObject(c)&&ce.isPlainObject(f)?ce.merge.call({caseless:m},c,f):ce.isPlainObject(f)?ce.merge({},f):ce.isArray(f)?f.slice():f}function i(c,f,p,m){if(ce.isUndefined(f)){if(!ce.isUndefined(c))return r(void 0,c,p,m)}else return r(c,f,p,m)}function s(c,f){if(!ce.isUndefined(f))return r(void 0,f)}function a(c,f){if(ce.isUndefined(f)){if(!ce.isUndefined(c))return r(void 0,c)}else return r(void 0,f)}function l(c,f,p){if(p in e)return r(c,f);if(p in t)return r(void 0,c)}const u={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:l,headers:(c,f,p)=>i(Kk(c),Kk(f),p,!0)};return ce.forEach(Object.keys(Object.assign({},t,e)),function(f){const p=u[f]||i,m=p(t[f],e[f],f);ce.isUndefined(m)&&p!==l||(n[f]=m)}),n}const Gk=t=>{const e=Aa({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:s,headers:a,auth:l}=e;e.headers=a=lr.from(a),e.url=Pk(qk(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let u;if(ce.isFormData(n)){if(zn.hasStandardBrowserEnv||zn.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((u=a.getContentType())!==!1){const[c,...f]=u?u.split(";").map(p=>p.trim()).filter(Boolean):[];a.setContentType([c||"multipart/form-data",...f].join("; "))}}if(zn.hasStandardBrowserEnv&&(r&&ce.isFunction(r)&&(r=r(e)),r||r!==!1&&dJ(e.url))){const c=i&&s&&fJ.read(s);c&&a.set(i,c)}return e},mJ=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,r){const i=Gk(t);let s=i.data;const a=lr.from(i.headers).normalize();let{responseType:l,onUploadProgress:u,onDownloadProgress:c}=i,f,p,m,g,v;function b(){g&&g(),v&&v(),i.cancelToken&&i.cancelToken.unsubscribe(f),i.signal&&i.signal.removeEventListener("abort",f)}let w=new XMLHttpRequest;w.open(i.method.toUpperCase(),i.url,!0),w.timeout=i.timeout;function x(){if(!w)return;const E=lr.from("getAllResponseHeaders"in w&&w.getAllResponseHeaders()),T={data:!l||l==="text"||l==="json"?w.responseText:w.response,status:w.status,statusText:w.statusText,headers:E,config:t,request:w};Uk(function(A){n(A),b()},function(A){r(A),b()},T),w=null}"onloadend"in w?w.onloadend=x:w.onreadystatechange=function(){!w||w.readyState!==4||w.status===0&&!(w.responseURL&&w.responseURL.indexOf("file:")===0)||setTimeout(x)},w.onabort=function(){w&&(r(new ut("Request aborted",ut.ECONNABORTED,t,w)),w=null)},w.onerror=function(){r(new ut("Network Error",ut.ERR_NETWORK,t,w)),w=null},w.ontimeout=function(){let k=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const T=i.transitional||Fk;i.timeoutErrorMessage&&(k=i.timeoutErrorMessage),r(new ut(k,T.clarifyTimeoutError?ut.ETIMEDOUT:ut.ECONNABORTED,t,w)),w=null},s===void 0&&a.setContentType(null),"setRequestHeader"in w&&ce.forEach(a.toJSON(),function(k,T){w.setRequestHeader(T,k)}),ce.isUndefined(i.withCredentials)||(w.withCredentials=!!i.withCredentials),l&&l!=="json"&&(w.responseType=i.responseType),c&&([m,v]=vh(c,!0),w.addEventListener("progress",m)),u&&w.upload&&([p,g]=vh(u),w.upload.addEventListener("progress",p),w.upload.addEventListener("loadend",g)),(i.cancelToken||i.signal)&&(f=E=>{w&&(r(!E||E.type?new jl(null,t,w):E),w.abort(),w=null)},i.cancelToken&&i.cancelToken.subscribe(f),i.signal&&(i.signal.aborted?f():i.signal.addEventListener("abort",f)));const C=lJ(i.url);if(C&&zn.protocols.indexOf(C)===-1){r(new ut("Unsupported protocol "+C+":",ut.ERR_BAD_REQUEST,t));return}w.send(s||null)})},gJ=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let r=new AbortController,i;const s=function(c){if(!i){i=!0,l();const f=c instanceof Error?c:this.reason;r.abort(f instanceof ut?f:new jl(f instanceof Error?f.message:f))}};let a=e&&setTimeout(()=>{a=null,s(new ut(`timeout ${e} of ms exceeded`,ut.ETIMEDOUT))},e);const l=()=>{t&&(a&&clearTimeout(a),a=null,t.forEach(c=>{c.unsubscribe?c.unsubscribe(s):c.removeEventListener("abort",s)}),t=null)};t.forEach(c=>c.addEventListener("abort",s));const{signal:u}=r;return u.unsubscribe=()=>ce.asap(l),u}},vJ=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let r=0,i;for(;r<n;)i=r+e,yield t.slice(r,i),r=i},bJ=async function*(t,e){for await(const n of yJ(t))yield*vJ(n,e)},yJ=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:r}=await e.read();if(n)break;yield r}}finally{await e.cancel()}},Xk=(t,e,n,r)=>{const i=bJ(t,e);let s=0,a,l=u=>{a||(a=!0,r&&r(u))};return new ReadableStream({async pull(u){try{const{done:c,value:f}=await i.next();if(c){l(),u.close();return}let p=f.byteLength;if(n){let m=s+=p;n(m)}u.enqueue(new Uint8Array(f))}catch(c){throw l(c),c}},cancel(u){return l(u),i.return()}},{highWaterMark:2})},bh=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Yk=bh&&typeof ReadableStream=="function",wJ=bh&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),Jk=(t,...e)=>{try{return!!t(...e)}catch{return!1}},xJ=Yk&&Jk(()=>{let t=!1;const e=new Request(zn.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),Zk=64*1024,yb=Yk&&Jk(()=>ce.isReadableStream(new Response("").body)),yh={stream:yb&&(t=>t.body)};bh&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!yh[e]&&(yh[e]=ce.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new ut(`Response type '${e}' is not supported`,ut.ERR_NOT_SUPPORT,r)})})})(new Response);const CJ=async t=>{if(t==null)return 0;if(ce.isBlob(t))return t.size;if(ce.isSpecCompliantForm(t))return(await new Request(zn.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(ce.isArrayBufferView(t)||ce.isArrayBuffer(t))return t.byteLength;if(ce.isURLSearchParams(t)&&(t=t+""),ce.isString(t))return(await wJ(t)).byteLength},kJ=async(t,e)=>{const n=ce.toFiniteNumber(t.getContentLength());return n??CJ(e)},wb={http:jY,xhr:mJ,fetch:bh&&(async t=>{let{url:e,method:n,data:r,signal:i,cancelToken:s,timeout:a,onDownloadProgress:l,onUploadProgress:u,responseType:c,headers:f,withCredentials:p="same-origin",fetchOptions:m}=Gk(t);c=c?(c+"").toLowerCase():"text";let g=gJ([i,s&&s.toAbortSignal()],a),v;const b=g&&g.unsubscribe&&(()=>{g.unsubscribe()});let w;try{if(u&&xJ&&n!=="get"&&n!=="head"&&(w=await kJ(f,r))!==0){let T=new Request(e,{method:"POST",body:r,duplex:"half"}),_;if(ce.isFormData(r)&&(_=T.headers.get("content-type"))&&f.setContentType(_),T.body){const[A,V]=Wk(w,vh(jk(u)));r=Xk(T.body,Zk,A,V)}}ce.isString(p)||(p=p?"include":"omit");const x="credentials"in Request.prototype;v=new Request(e,{...m,signal:g,method:n.toUpperCase(),headers:f.normalize().toJSON(),body:r,duplex:"half",credentials:x?p:void 0});let C=await fetch(v);const E=yb&&(c==="stream"||c==="response");if(yb&&(l||E&&b)){const T={};["status","statusText","headers"].forEach(O=>{T[O]=C[O]});const _=ce.toFiniteNumber(C.headers.get("content-length")),[A,V]=l&&Wk(_,vh(jk(l),!0))||[];C=new Response(Xk(C.body,Zk,A,()=>{V&&V(),b&&b()}),T)}c=c||"text";let k=await yh[ce.findKey(yh,c)||"text"](C,t);return!E&&b&&b(),await new Promise((T,_)=>{Uk(T,_,{data:k,headers:lr.from(C.headers),status:C.status,statusText:C.statusText,config:t,request:v})})}catch(x){throw b&&b(),x&&x.name==="TypeError"&&/fetch/i.test(x.message)?Object.assign(new ut("Network Error",ut.ERR_NETWORK,t,v),{cause:x.cause||x}):ut.from(x,x&&x.code,t,v)}})};ce.forEach(wb,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Qk=t=>`- ${t}`,EJ=t=>ce.isFunction(t)||t===null||t===!1,Nk={getAdapter:t=>{t=ce.isArray(t)?t:[t];const{length:e}=t;let n,r;const i={};for(let s=0;s<e;s++){n=t[s];let a;if(r=n,!EJ(n)&&(r=wb[(a=String(n)).toLowerCase()],r===void 0))throw new ut(`Unknown adapter '${a}'`);if(r)break;i[a||"#"+s]=r}if(!r){const s=Object.entries(i).map(([l,u])=>`adapter ${l} `+(u===!1?"is not supported by the environment":"is not available in the build"));let a=e?s.length>1?`since :
|
|
334
334
|
`+s.map(Qk).join(`
|
|
335
335
|
`):" "+Qk(s[0]):"as no adapter specified";throw new ut("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r},adapters:wb};function xb(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new jl(null,t)}function eE(t){return xb(t),t.headers=lr.from(t.headers),t.data=bb.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Nk.getAdapter(t.adapter||$c.adapter)(t).then(function(r){return xb(t),r.data=bb.call(t,t.transformResponse,r),r.headers=lr.from(r.headers),r},function(r){return zk(r)||(xb(t),r&&r.response&&(r.response.data=bb.call(t,t.transformResponse,r.response),r.response.headers=lr.from(r.response.headers))),Promise.reject(r)})}const tE="1.8.4",wh={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{wh[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const nE={};wh.transitional=function(e,n,r){function i(s,a){return"[Axios v"+tE+"] Transitional option '"+s+"'"+a+(r?". "+r:"")}return(s,a,l)=>{if(e===!1)throw new ut(i(a," has been removed"+(n?" in "+n:"")),ut.ERR_DEPRECATED);return n&&!nE[a]&&(nE[a]=!0,console.warn(i(a," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(s,a,l):!0}},wh.spelling=function(e){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function SJ(t,e,n){if(typeof t!="object")throw new ut("options must be an object",ut.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let i=r.length;for(;i-- >0;){const s=r[i],a=e[s];if(a){const l=t[s],u=l===void 0||a(l,s,t);if(u!==!0)throw new ut("option "+s+" must be "+u,ut.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ut("Unknown option "+s,ut.ERR_BAD_OPTION)}}const xh={assertOptions:SJ,validators:wh},qo=xh.validators;let Ma=class{constructor(e){this.defaults=e,this.interceptors={request:new Vk,response:new Vk}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const s=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
336
|
-
`+s):r.stack=s}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=Aa(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&xh.assertOptions(r,{silentJSONParsing:qo.transitional(qo.boolean),forcedJSONParsing:qo.transitional(qo.boolean),clarifyTimeoutError:qo.transitional(qo.boolean)},!1),i!=null&&(ce.isFunction(i)?n.paramsSerializer={serialize:i}:xh.assertOptions(i,{encode:qo.function,serialize:qo.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),xh.assertOptions(n,{baseUrl:qo.spelling("baseURL"),withXsrfToken:qo.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=s&&ce.merge(s.common,s[n.method]);s&&ce.forEach(["delete","get","head","post","put","patch","common"],v=>{delete s[v]}),n.headers=lr.concat(a,s);const l=[];let u=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(n)===!1||(u=u&&b.synchronous,l.unshift(b.fulfilled,b.rejected))});const c=[];this.interceptors.response.forEach(function(b){c.push(b.fulfilled,b.rejected)});let f,p=0,m;if(!u){const v=[eE.bind(this),void 0];for(v.unshift.apply(v,l),v.push.apply(v,c),m=v.length,f=Promise.resolve(n);p<m;)f=f.then(v[p++],v[p++]);return f}m=l.length;let g=n;for(p=0;p<m;){const v=l[p++],b=l[p++];try{g=v(g)}catch(w){b.call(this,w);break}}try{f=eE.call(this,g)}catch(v){return Promise.reject(v)}for(p=0,m=c.length;p<m;)f=f.then(c[p++],c[p++]);return f}getUri(e){e=Aa(this.defaults,e);const n=qk(e.baseURL,e.url,e.allowAbsoluteUrls);return Pk(n,e.params,e.paramsSerializer)}};ce.forEach(["delete","get","head","options"],function(e){Ma.prototype[e]=function(n,r){return this.request(Aa(r||{},{method:e,url:n,data:(r||{}).data}))}}),ce.forEach(["post","put","patch"],function(e){function n(r){return function(s,a,l){return this.request(Aa(l||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}Ma.prototype[e]=n(),Ma.prototype[e+"Form"]=n(!0)});let _J=class aT{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(i=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](i);r._listeners=null}),this.promise.then=i=>{let s;const a=new Promise(l=>{r.subscribe(l),s=l}).then(i);return a.cancel=function(){r.unsubscribe(s)},a},e(function(s,a,l){r.reason||(r.reason=new jl(s,a,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new aT(function(i){e=i}),cancel:e}}};function TJ(t){return function(n){return t.apply(null,n)}}function AJ(t){return ce.isObject(t)&&t.isAxiosError===!0}const Cb={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Cb).forEach(([t,e])=>{Cb[e]=t});function rE(t){const e=new Ma(t),n=Ck(Ma.prototype.request,e);return ce.extend(n,Ma.prototype,e,{allOwnKeys:!0}),ce.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return rE(Aa(t,i))},n}const sn=rE($c);sn.Axios=Ma,sn.CanceledError=jl,sn.CancelToken=_J,sn.isCancel=zk,sn.VERSION=tE,sn.toFormData=mh,sn.AxiosError=ut,sn.Cancel=sn.CanceledError,sn.all=function(e){return Promise.all(e)},sn.spread=TJ,sn.isAxiosError=AJ,sn.mergeConfig=Aa,sn.AxiosHeaders=lr,sn.formToJSON=t=>$k(ce.isHTMLForm(t)?new FormData(t):t),sn.getAdapter=Nk.getAdapter,sn.HttpStatusCode=Cb,sn.default=sn;const{Axios:cde,AxiosError:dde,CanceledError:fde,isCancel:pde,CancelToken:hde,VERSION:mde,all:gde,Cancel:vde,isAxiosError:bde,spread:yde,toFormData:wde,AxiosHeaders:xde,HttpStatusCode:Cde,formToJSON:kde,getAdapter:Ede,mergeConfig:Sde}=sn;function MJ(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 zc=t=>{if(!t)return!0;const e=document.createElement("div");return e.innerHTML=t,e?.textContent?.trim()===""},OJ=t=>{if(!t)return"";const{from:e,to:n}=t.state.selection,r=t.state.doc.cut(e,n),s=Ir.fromSchema(t.schema).serializeFragment(r.content),a=document.createElement("div");return a.appendChild(s),a.innerHTML},BJ=t=>/<\/?[a-z][\s\S]*>/i.test(t);var ur=(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))(ur||{});const oE=8;function IJ(t,e){const n=o.ref(!1);let r=!1,i=null,s=null,a=null,l=null,u=0,c=0;function f(C){const E=C.cloneNode(!0);return E.style.position="fixed",E.style.pointerEvents="none",E.style.opacity="0.9",E.style.zIndex="9999",E.style.transform="translate(-50%, -50%)",E.style.left="0px",E.style.top="0px",document.body.appendChild(E),E}function p(){s&&s.parentElement&&s.parentElement.removeChild(s),s=null}function m(){try{if(typeof t.getPos=="function"){const C=t.getPos();if(typeof C=="number"&&C>=0)return C}}catch{}return null}function g(C,E){n.value||(l=m(),document.body.style.userSelect="none",document.body.style.touchAction="none",E&&(s=f(E),s.style.left=`${C.clientX}px`,s.style.top=`${C.clientY}px`),n.value=!0,r=!1,a=null)}function v(){i=null,l=null,a=null,r=!1,n.value=!1,p(),document.body.style.userSelect="",document.body.style.touchAction=""}function b(C){if(o.unref(e)||n.value)return;const E=C.changedTouches[0];i=E.identifier,u=E.clientX,c=E.clientY,r=!0,l=null,a=null}function w(C){if(!r&&!n.value||i===null)return;const E=Array.from(C.changedTouches).find(A=>A.identifier===i);if(!E)return;const k=E.clientX-u,T=E.clientY-c,_=k*k+T*T;if(!n.value&&r&&_>=oE*oE){const A=C.currentTarget||C.target||null;g(E,A)}if(n.value){s&&(s.style.left=`${E.clientX}px`,s.style.top=`${E.clientY}px`);try{const A=t.editor?.view;if(!A){a=null;return}const V=A.posAtCoords({left:E.clientX,top:E.clientY});V&&typeof V.pos=="number"?a=V.pos:a=null}catch{a=null}}}async function x(C){if(n.value){if(document.body.style.userSelect="",document.body.style.touchAction="",p(),n.value=!1,l===null||a===null){v();return}const E=t.editor?.view;if(!E){v();return}const k=E.state.doc.nodeAt(l);if(!k){v();return}const T=k.nodeSize,_=l,A=_+T,V=a;if(V>=_&&V<=A){v();return}let O=V;V>_&&(O=V-T);const B=E.state.doc.content.size;O<0&&(O=0),O>B&&(O=B);const H=k.type.create(k.attrs),j=E.state.tr;j.delete(_,A),j.insert(O,H),E.dispatch(j),v();return}if(r){v();return}}return{onTouchStart:b,onTouchMove:w,onTouchEnd:x}}function LJ(...t){return vy(Bm(t))}const RJ=["innerHTML"],DJ=["book-mark-node-id","book-mark-content","node-id","element-id","line-id"],PJ=o.defineComponent({__name:"SuperText",props:ta,setup(t){const e=t,n=o.ref(!1),r=o.inject("isMobile",!1),i=o.inject("showSuperElementIdColor",!1),s=o.computed(()=>!!e.node.attrs[rt.ELEMENT_ID]),a=o.computed(()=>o.unref(i)?s.value?"":"text-red-500":""),l=o.computed(()=>e.editor.storage.superText.enable),u=ct.useEventBus(ur.RENDER_SUPER_TEXT),{onTouchStart:c,onTouchMove:f,onTouchEnd:p}=IJ(e,l),m=o.ref(null),g=o.ref(!1),v=()=>{g.value=!0},b=()=>{g.value=!1};o.watch(g,()=>{g.value&&V(m.value)});const w={mouseenter:A,mouseleave:V,dragstart:v,dragend:b},x={touchstart:c,touchmove:f,touchend:p,touchcancel:p},C=o.computed(()=>r?x:w),E=o.computed(()=>{const Y=e.getPos(),N=e.editor.state.doc.resolve(Y);for(let U=N.depth;U>0;U--){const P=N.node(U);if(P.type.name==="paragraph")return P}return null}),k=o.computed(()=>E.value?.attrs.id||""),T=o.inject("canEditSuper",o.ref(!0));function _(Y){if(zc(Y)){O();return}const N=e.getPos(),U=e.editor?.state.doc.nodeAt(N),P=Y.trim(),{[rt.ELEMENT_ID]:L,...F}=U?.attrs||{};e.editor?.view.dispatch(e.editor.state.tr.setNodeMarkup(N,void 0,{...F,[rt.TEXT]:P})),requestAnimationFrame(()=>{e.editor.commands.setTextSelection(N+1),e.editor.view.focus()})}function A(Y){m.value=Y;const N=e.node.attrs[rt.TEXT],U=e.node.attrs[rt.ID],L={lineId:Y.target.querySelector(`[node-id="${U}"]`).getAttribute("line-id"),dataId:U,text:N};u.emit({action:"hover",payload:L})}function V(Y){const N=e.node.attrs[rt.ID],P={lineId:Y?.target.querySelector(`[node-id="${N}"]`).getAttribute("line-id"),dataId:N,text:""};u.emit({action:"hover",payload:P}),m.value=null}function O(){const{getPos:Y,node:N,editor:U}=e,P=Y(),L=P+1;U.commands.deleteRange({from:P,to:L})}function B(){if(!T.value)return;const{attributes:Y}=e.editor.options.editorProps;Y&&Y.id===ir.COMMENT&&document.getElementById(ir.COMMENT)?.getAttribute(ir.DISABLE_SUPER_INPUT)==="true"||(e.editor.view.dom.blur(),n.value=!0)}function H(){e.editor.commands.setSuperTextContent(e.node.attrs[rt.TEXT],e.node.attrs[rt.POSITION]),e.editor.commands.toggleSuperInputMoblie()}o.watch(l,Y=>{r&&(e.editor.setEditable(!Y),Y?e.editor.view.dom.classList.add("super-text-view-mode"):e.editor.view.dom.classList.remove("super-text-view-mode"))});const j=o.computed(()=>e.node.attrs[rt.TEXT].replace(/<p><\/p>\s*$/,"<p> </p>"));return(Y,N)=>{const U=mn,P=ib,L=ob,F=rb,R=nb,K=Wc;return o.openBlock(),o.createBlock(o.unref(ea),o.mergeProps({as:"span",class:o.unref(LJ)("text-inherit super-text shrink-0 inline-flex items-center justify-center",o.unref(r)&&l.value&&"block"),"data-drag-handle":"",draggable:o.unref(T)},o.toHandlers(C.value)),{default:o.withCtx(()=>[o.unref(r)&&!l.value?(o.openBlock(),o.createElementBlock("button",{key:0,class:"w-6 inline-flex justify-center rounded text-ed-red-500 active:bg-ed-accent",onClick:o.withModifiers(H,["stop"])},[o.createVNode(o.unref(Ot),{name:"fileEdit2",class:"w-5 h-5"})])):o.createCommentVNode("",!0),o.unref(r)&&l.value?(o.openBlock(),o.createElementBlock("div",{key:1,class:"super-text-view-mode-item whitespace-break-spaces wrap-anywhere",onClick:o.withModifiers(H,["stop"]),innerHTML:j.value},null,8,RJ)):o.createCommentVNode("",!0),o.unref(r)?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(R,{key:2},{default:o.withCtx(()=>[o.createVNode(P,{as:"template",class:"relative",disabled:!o.unref(T)},{default:o.withCtx(()=>[o.createVNode(U,{class:o.normalizeClass([{"pointer-events-none":!o.unref(T)},"!p-0 !m-0 !h-fit"]),variant:"ghost",onDblclick:o.withModifiers(B,["stop"])},{default:o.withCtx(()=>[o.createVNode(o.unref(Ot),{name:"fileEdit",class:o.normalizeClass(a.value)},null,8,["class"]),o.createElementVNode("div",{ref:"bookMarkRef","book-mark-node-id":e.node.attrs[o.unref(rt).ID],"book-mark-content":e.node.attrs[o.unref(rt).TEXT],"node-id":e.node.attrs[o.unref(rt).ID],"element-id":e.node.attrs[o.unref(rt).ELEMENT_ID],"line-id":k.value},null,8,DJ)]),_:1},8,["class"])]),_:1},8,["disabled"]),o.createVNode(F,null,{default:o.withCtx(()=>[o.createVNode(L,{onSelect:N[0]||(N[0]=X=>n.value=!0)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(Y.$t("editor.super.edit")),1)]),_:1}),o.createVNode(L,{onSelect:O},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(Y.$t("editor.super.delete")),1)]),_:1})]),_:1})]),_:1})),o.unref(r)?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(K,{key:3,open:n.value,editor:e.editor,"super-text-init":e.node.attrs[o.unref(rt).TEXT],"super-text-element-id":e.node.attrs[o.unref(rt).ELEMENT_ID],onClose:N[1]||(N[1]=X=>n.value=!1),onSave:_},null,8,["open","editor","super-text-init","super-text-element-id"]))]),_:1},16,["class","draggable"])}}}),VJ=new ot({props:{handleKeyDown(t,e){if(e.key==="Backspace"){const{state:n,dispatch:r}=t,{$from:i}=n.selection;if(i.parentOffset===1){const l=i.nodeAfter;if(l&&l.type.name==="superText"){const u=n.tr;return u.delete(i.pos-1,i.pos),u.setSelection(Ie.create(u.doc,i.pos-1)),r(u),e.preventDefault(),!0}}const s=i.nodeBefore,a=i.nodeAfter;if(s&&s.isText&&s.text?.length===1&&a&&a.type.name==="superText"){const l=i.parent.childBefore(i.parentOffset-1).node;if(l&&l.type.name==="superText"){const u=n.tr;return u.delete(i.pos-1,i.pos),u.setSelection(Ie.create(u.doc,i.pos-1)),r(u),e.preventDefault(),!0}}}return!1}}}),FJ=new ot({appendTransaction(t,e,n){const r=new Set;let i=n.tr,s=!1;return n.doc.descendants((a,l)=>{if(a.type.name===Uc){const u=a.attrs[rt.ID];if(!u||r.has(u)){const c=$r();i=i.setNodeMarkup(l,void 0,{...a.attrs,[rt.ID]:c}),s=!0,r.add(c)}else r.add(u)}}),s?i:null}}),Uc="superText",iE={UPDATE:"superTextUpdate"},sE=Lt.create({name:"superText",inline:!0,group:"inline",selectable:!1,defining:!0,draggable:!0,addStorage(){return{enable:!0,isShowSuperInputMoblie:!1,view:!0,items:[],superInputModal:this.options.superInputModal,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:Ge,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:Ge,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]
|
|
336
|
+
`+s):r.stack=s}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=Aa(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&xh.assertOptions(r,{silentJSONParsing:qo.transitional(qo.boolean),forcedJSONParsing:qo.transitional(qo.boolean),clarifyTimeoutError:qo.transitional(qo.boolean)},!1),i!=null&&(ce.isFunction(i)?n.paramsSerializer={serialize:i}:xh.assertOptions(i,{encode:qo.function,serialize:qo.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),xh.assertOptions(n,{baseUrl:qo.spelling("baseURL"),withXsrfToken:qo.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=s&&ce.merge(s.common,s[n.method]);s&&ce.forEach(["delete","get","head","post","put","patch","common"],v=>{delete s[v]}),n.headers=lr.concat(a,s);const l=[];let u=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(n)===!1||(u=u&&b.synchronous,l.unshift(b.fulfilled,b.rejected))});const c=[];this.interceptors.response.forEach(function(b){c.push(b.fulfilled,b.rejected)});let f,p=0,m;if(!u){const v=[eE.bind(this),void 0];for(v.unshift.apply(v,l),v.push.apply(v,c),m=v.length,f=Promise.resolve(n);p<m;)f=f.then(v[p++],v[p++]);return f}m=l.length;let g=n;for(p=0;p<m;){const v=l[p++],b=l[p++];try{g=v(g)}catch(w){b.call(this,w);break}}try{f=eE.call(this,g)}catch(v){return Promise.reject(v)}for(p=0,m=c.length;p<m;)f=f.then(c[p++],c[p++]);return f}getUri(e){e=Aa(this.defaults,e);const n=qk(e.baseURL,e.url,e.allowAbsoluteUrls);return Pk(n,e.params,e.paramsSerializer)}};ce.forEach(["delete","get","head","options"],function(e){Ma.prototype[e]=function(n,r){return this.request(Aa(r||{},{method:e,url:n,data:(r||{}).data}))}}),ce.forEach(["post","put","patch"],function(e){function n(r){return function(s,a,l){return this.request(Aa(l||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}Ma.prototype[e]=n(),Ma.prototype[e+"Form"]=n(!0)});let _J=class aT{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(i=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](i);r._listeners=null}),this.promise.then=i=>{let s;const a=new Promise(l=>{r.subscribe(l),s=l}).then(i);return a.cancel=function(){r.unsubscribe(s)},a},e(function(s,a,l){r.reason||(r.reason=new jl(s,a,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new aT(function(i){e=i}),cancel:e}}};function TJ(t){return function(n){return t.apply(null,n)}}function AJ(t){return ce.isObject(t)&&t.isAxiosError===!0}const Cb={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Cb).forEach(([t,e])=>{Cb[e]=t});function rE(t){const e=new Ma(t),n=Ck(Ma.prototype.request,e);return ce.extend(n,Ma.prototype,e,{allOwnKeys:!0}),ce.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return rE(Aa(t,i))},n}const sn=rE($c);sn.Axios=Ma,sn.CanceledError=jl,sn.CancelToken=_J,sn.isCancel=zk,sn.VERSION=tE,sn.toFormData=mh,sn.AxiosError=ut,sn.Cancel=sn.CanceledError,sn.all=function(e){return Promise.all(e)},sn.spread=TJ,sn.isAxiosError=AJ,sn.mergeConfig=Aa,sn.AxiosHeaders=lr,sn.formToJSON=t=>$k(ce.isHTMLForm(t)?new FormData(t):t),sn.getAdapter=Nk.getAdapter,sn.HttpStatusCode=Cb,sn.default=sn;const{Axios:cde,AxiosError:dde,CanceledError:fde,isCancel:pde,CancelToken:hde,VERSION:mde,all:gde,Cancel:vde,isAxiosError:bde,spread:yde,toFormData:wde,AxiosHeaders:xde,HttpStatusCode:Cde,formToJSON:kde,getAdapter:Ede,mergeConfig:Sde}=sn;function MJ(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 zc=t=>{if(!t)return!0;const e=document.createElement("div");return e.innerHTML=t,e?.textContent?.trim()===""},OJ=t=>{if(!t)return"";const{from:e,to:n}=t.state.selection,r=t.state.doc.cut(e,n),s=Ir.fromSchema(t.schema).serializeFragment(r.content),a=document.createElement("div");return a.appendChild(s),a.innerHTML},BJ=t=>/<\/?[a-z][\s\S]*>/i.test(t);var ur=(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))(ur||{});const oE=8;function IJ(t,e){const n=o.ref(!1);let r=!1,i=null,s=null,a=null,l=null,u=0,c=0;function f(C){const E=C.cloneNode(!0);return E.style.position="fixed",E.style.pointerEvents="none",E.style.opacity="0.9",E.style.zIndex="9999",E.style.transform="translate(-50%, -50%)",E.style.left="0px",E.style.top="0px",document.body.appendChild(E),E}function p(){s&&s.parentElement&&s.parentElement.removeChild(s),s=null}function m(){try{if(typeof t.getPos=="function"){const C=t.getPos();if(typeof C=="number"&&C>=0)return C}}catch{}return null}function g(C,E){n.value||(l=m(),document.body.style.userSelect="none",document.body.style.touchAction="none",E&&(s=f(E),s.style.left=`${C.clientX}px`,s.style.top=`${C.clientY}px`),n.value=!0,r=!1,a=null)}function v(){i=null,l=null,a=null,r=!1,n.value=!1,p(),document.body.style.userSelect="",document.body.style.touchAction=""}function b(C){if(o.unref(e)||n.value)return;const E=C.changedTouches[0];i=E.identifier,u=E.clientX,c=E.clientY,r=!0,l=null,a=null}function w(C){if(!r&&!n.value||i===null)return;const E=Array.from(C.changedTouches).find(A=>A.identifier===i);if(!E)return;const k=E.clientX-u,T=E.clientY-c,_=k*k+T*T;if(!n.value&&r&&_>=oE*oE){const A=C.currentTarget||C.target||null;g(E,A)}if(n.value){s&&(s.style.left=`${E.clientX}px`,s.style.top=`${E.clientY}px`);try{const A=t.editor?.view;if(!A){a=null;return}const V=A.posAtCoords({left:E.clientX,top:E.clientY});V&&typeof V.pos=="number"?a=V.pos:a=null}catch{a=null}}}async function x(C){if(n.value){if(document.body.style.userSelect="",document.body.style.touchAction="",p(),n.value=!1,l===null||a===null){v();return}const E=t.editor?.view;if(!E){v();return}const k=E.state.doc.nodeAt(l);if(!k){v();return}const T=k.nodeSize,_=l,A=_+T,V=a;if(V>=_&&V<=A){v();return}let O=V;V>_&&(O=V-T);const B=E.state.doc.content.size;O<0&&(O=0),O>B&&(O=B);const H=k.type.create(k.attrs),j=E.state.tr;j.delete(_,A),j.insert(O,H),E.dispatch(j),v();return}if(r){v();return}}return{onTouchStart:b,onTouchMove:w,onTouchEnd:x}}function LJ(...t){return vy(Bm(t))}const RJ=["innerHTML"],DJ=["book-mark-node-id","book-mark-content","node-id","element-id","line-id"],PJ=o.defineComponent({__name:"SuperText",props:ta,setup(t){const e=t,n=o.ref(!1),r=o.inject("isMobile",!1),i=o.inject("showSuperElementIdColor",!1),s=o.computed(()=>!!e.node.attrs[Ne.ELEMENT_ID]),a=o.computed(()=>o.unref(i)?s.value?"":"text-red-500":""),l=o.computed(()=>e.editor.storage.superText.enable),u=ct.useEventBus(ur.RENDER_SUPER_TEXT),{onTouchStart:c,onTouchMove:f,onTouchEnd:p}=IJ(e,l),m=o.ref(null),g=o.ref(!1),v=()=>{g.value=!0},b=()=>{g.value=!1};o.watch(g,()=>{g.value&&V(m.value)});const w={mouseenter:A,mouseleave:V,dragstart:v,dragend:b},x={touchstart:c,touchmove:f,touchend:p,touchcancel:p},C=o.computed(()=>r?x:w),E=o.computed(()=>{const Y=e.getPos(),N=e.editor.state.doc.resolve(Y);for(let U=N.depth;U>0;U--){const P=N.node(U);if(P.type.name==="paragraph")return P}return null}),k=o.computed(()=>E.value?.attrs.id||""),T=o.inject("canEditSuper",o.ref(!0));function _(Y){if(zc(Y)){O();return}const N=e.getPos(),U=e.editor?.state.doc.nodeAt(N),P=Y.trim(),{[Ne.ELEMENT_ID]:L,...F}=U?.attrs||{};e.editor?.view.dispatch(e.editor.state.tr.setNodeMarkup(N,void 0,{...F,[Ne.TEXT]:P})),requestAnimationFrame(()=>{e.editor.commands.setTextSelection(N+1),e.editor.view.focus()})}function A(Y){m.value=Y;const N=e.node.attrs[Ne.TEXT],U=e.node.attrs[Ne.ID],P=e.node.attrs[Ne.ELEMENT_ID]??null,F={lineId:Y.target.querySelector(`[node-id="${U}"]`).getAttribute("line-id"),dataId:U,text:N,elementId:P};u.emit({action:"hover",payload:F})}function V(Y){const N=e.node.attrs[Ne.ID],U=e.node.attrs[Ne.ELEMENT_ID]??null,L={lineId:Y?.target.querySelector(`[node-id="${N}"]`).getAttribute("line-id"),dataId:N,text:"",elementId:U};u.emit({action:"hover",payload:L}),m.value=null}function O(){const{getPos:Y,node:N,editor:U}=e,P=Y(),L=P+1;U.commands.deleteRange({from:P,to:L})}function B(){if(!T.value)return;const{attributes:Y}=e.editor.options.editorProps;Y&&Y.id===ir.COMMENT&&document.getElementById(ir.COMMENT)?.getAttribute(ir.DISABLE_SUPER_INPUT)==="true"||(e.editor.view.dom.blur(),n.value=!0)}function H(){e.editor.commands.setSuperTextContent(e.node.attrs[Ne.TEXT],e.node.attrs[Ne.POSITION]),e.editor.commands.toggleSuperInputMoblie()}o.watch(l,Y=>{r&&(e.editor.setEditable(!Y),Y?e.editor.view.dom.classList.add("super-text-view-mode"):e.editor.view.dom.classList.remove("super-text-view-mode"))});const j=o.computed(()=>e.node.attrs[Ne.TEXT].replace(/<p><\/p>\s*$/,"<p> </p>"));return(Y,N)=>{const U=mn,P=ib,L=ob,F=rb,R=nb,K=Wc;return o.openBlock(),o.createBlock(o.unref(ea),o.mergeProps({as:"span",class:o.unref(LJ)("text-inherit super-text shrink-0 inline-flex items-center justify-center",o.unref(r)&&l.value&&"block"),"data-drag-handle":"",draggable:o.unref(T)},o.toHandlers(C.value)),{default:o.withCtx(()=>[o.unref(r)&&!l.value?(o.openBlock(),o.createElementBlock("button",{key:0,class:"w-6 inline-flex justify-center rounded text-ed-red-500 active:bg-ed-accent",onClick:o.withModifiers(H,["stop"])},[o.createVNode(o.unref(Ot),{name:"fileEdit2",class:"w-5 h-5"})])):o.createCommentVNode("",!0),o.unref(r)&&l.value?(o.openBlock(),o.createElementBlock("div",{key:1,class:"super-text-view-mode-item whitespace-break-spaces wrap-anywhere",onClick:o.withModifiers(H,["stop"]),innerHTML:j.value},null,8,RJ)):o.createCommentVNode("",!0),o.unref(r)?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(R,{key:2},{default:o.withCtx(()=>[o.createVNode(P,{as:"template",class:"relative",disabled:!o.unref(T)},{default:o.withCtx(()=>[o.createVNode(U,{class:o.normalizeClass([{"pointer-events-none":!o.unref(T)},"!p-0 !m-0 !h-fit"]),variant:"ghost",onDblclick:o.withModifiers(B,["stop"])},{default:o.withCtx(()=>[o.createVNode(o.unref(Ot),{name:"fileEdit",class:o.normalizeClass(a.value)},null,8,["class"]),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":k.value},null,8,DJ)]),_:1},8,["class"])]),_:1},8,["disabled"]),o.createVNode(F,null,{default:o.withCtx(()=>[o.createVNode(L,{onSelect:N[0]||(N[0]=X=>n.value=!0)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(Y.$t("editor.super.edit")),1)]),_:1}),o.createVNode(L,{onSelect:O},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(Y.$t("editor.super.delete")),1)]),_:1})]),_:1})]),_:1})),o.unref(r)?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(K,{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:N[1]||(N[1]=X=>n.value=!1),onSave:_},null,8,["open","editor","super-text-init","super-text-element-id"]))]),_:1},16,["class","draggable"])}}}),VJ=new ot({props:{handleKeyDown(t,e){if(e.key==="Backspace"){const{state:n,dispatch:r}=t,{$from:i}=n.selection;if(i.parentOffset===1){const l=i.nodeAfter;if(l&&l.type.name==="superText"){const u=n.tr;return u.delete(i.pos-1,i.pos),u.setSelection(Ie.create(u.doc,i.pos-1)),r(u),e.preventDefault(),!0}}const s=i.nodeBefore,a=i.nodeAfter;if(s&&s.isText&&s.text?.length===1&&a&&a.type.name==="superText"){const l=i.parent.childBefore(i.parentOffset-1).node;if(l&&l.type.name==="superText"){const u=n.tr;return u.delete(i.pos-1,i.pos),u.setSelection(Ie.create(u.doc,i.pos-1)),r(u),e.preventDefault(),!0}}}return!1}}}),FJ=new ot({appendTransaction(t,e,n){const r=new Set;let i=n.tr,s=!1;return n.doc.descendants((a,l)=>{if(a.type.name===Uc){const u=a.attrs[Ne.ID];if(!u||r.has(u)){const c=$r();i=i.setNodeMarkup(l,void 0,{...a.attrs,[Ne.ID]:c}),s=!0,r.add(c)}else r.add(u)}}),s?i:null}}),Uc="superText",iE={UPDATE:"superTextUpdate"},sE=Lt.create({name:"superText",inline:!0,group:"inline",selectable:!1,defining:!0,draggable:!0,addStorage(){return{enable:!0,isShowSuperInputMoblie:!1,view:!0,items:[],superInputModal:this.options.superInputModal,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:Ge,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:Ge,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]
|
|
337
337
|
${t.storage.superText.enable?"!bg-blue-500":"!bg-gray-600"}
|
|
338
|
-
`,tooltip:"수퍼 보기",customClassTooltip:"flex items-center justify-center"}}]}},addAttributes(){return{[
|
|
338
|
+
`,tooltip:"수퍼 보기",customClassTooltip:"flex items-center justify-center"}}]}},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",wt(t,{class:"super-text"})]},addNodeView(){return na(PJ)},addProseMirrorPlugins(){return[new ot({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 ot({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===Uc)}return!1})&&t.setMeta(iE.UPDATE,!0),!0}}),VJ,FJ]}}),kb="spell-check";class $J{get completeProofreadingDone(){return this.isInitialProofreadingDone}debouncedGetMatchAndSetDecorations=St.debounce(this.getMatchAndSetDecorations.bind(this),300);debouncedGetMatchAndSetDecorationsList=St.debounce(this.getMatchAndSetDecorationsList.bind(this),300);debouncedClickEventsListener=this.clickEventsListener.bind(this);debouncedAcceptSuggestionEventsListener=this.acceptSuggestionListener.bind(this);debouncedProofreadChangedNodes=St.debounce(this.proofreadChangedNodes.bind(this),300);proofreader;uiStrings;showSuggestionsEvent;decorationSet;editorView;isInitialProofreadingDone=!1;lastOriginalFrom=0;lastClickedDecoration=null;suggestionBox;isEnableSuggestion;isMobile;limit=1e3;docLimit;spellcheckHighlightMode;spellcheckHighlightColor;_debouncedProofreadDoc=St.debounce((e,n)=>{this.proofreadDoc(e),n&&n()},500);_debouncedHandleEnterKey=St.debounce((e,n,r)=>{this.handleEnterKey(e,n),r&&r()},500);constructor(e,n,r,i=1e3,s=Io.ERROR_TYPE,a=Qi,l){this.proofreader=e,this.uiStrings=n,this.showSuggestionsEvent=r,this.decorationSet=lt.empty,this.limit=i,this.docLimit=l,this.spellcheckHighlightMode=s,this.spellcheckHighlightColor=a,this.suggestionBox=document.createElement("div"),this.suggestionBox.id="suggestions-box",this.suggestionBox.tabIndex=0,this.isEnableSuggestion=!0,this.isMobile=!1,this.hideSuggestionBox()}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=>{const u=l;if(u.from===void 0||u.to===void 0||n&&u.structure)return;u.slice?.content[0]?.type.name===Uc&&(a=!0);const c=u.from-(r?1:0);let f=Math.max(u.to,u.from+(u.slice?.size||0))-(r?1:0);f>e.doc.content.size&&(f=e.doc.content.size),e.doc.nodesBetween(c,f,(p,m)=>{p&&(p.isText&&!s.has(m)&&(i.push({node:p,pos:m}),s.add(m)),p.type.name===Uc&&(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}isDocExceedLimit(e){return!!(this.docLimit&&e.textContent.length>this.docLimit)}proofreadDoc(e){if(this.isDocExceedLimit(e))return;let n=[],r=0;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!==Uc}),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(`
|
|
339
339
|
`)),s=f,i+=u}const a=hx(i,this.limit),l=this.getMatchAndSetDecorationsList(a.map(u=>({text:u.text,originalFrom:u.offset+1})));this.editorView&&this.dispatch(this.editorView.state.tr.setMeta(Un.LOADING_TRANSACTION,!0)),l.then(()=>{this.editorView&&this.dispatch(this.editorView.state.tr.setMeta(Un.LOADING_TRANSACTION,!1))}),this.isInitialProofreadingDone=!0}async proofreadChangedNodes(e){if(this.editorView&&this.isDocExceedLimit(this.editorView.state.doc))return;const n=this.isMobile?1:2,i=e.reduce((s,a)=>{if(s.length===0)return s.push({changedNode:a,time:1}),s;const l=s[s.length-1];return a.pos===l.changedNode.pos+l.changedNode.node.nodeSize+n*(l.time-1)?(l.changedNode.node.text+=a.node.text,l.time+=1):s.push({changedNode:a,time:1}),s},[]).map(({changedNode:s})=>{const a=s.node?.textContent||"",l=s.pos;return hx(a,this.limit).map(c=>({text:c.text,originalFrom:l+c.offset}))});this.debouncedGetMatchAndSetDecorationsList(i.flat())}async getMatchAndSetDecorationsList(e){const n=e.map(r=>this.getMatchAndSetDecorations(r.text,r.originalFrom));await Promise.all(n)}async getMatchAndSetDecorations(e,n){const r=await this.proofreader.proofreadText(this.proofreader.normalizeTextForLanguage(e)),i=[];for(const l of r){const u=l.startIndex+n,c=u+l.length,f=await this.proofreader.getSuggestions(l.wrongWord),p={length:l.length,wrongWord:l.wrongWord,suggestions:f};let m="spell-error",g="";this.spellcheckHighlightMode===Io.SINGLE?g=`border-bottom: 2px solid ${this.spellcheckHighlightColor};`:m=`spell-error ${rx[l.errorType??-1]??ox}`,i.push(jt.inline(u,c,{class:m,nodeName:"span",style:g,[kb]:JSON.stringify(p)}))}const s=this.decorationSet.find(n,n+e.length);let a=this.decorationSet.remove(s);this.editorView&&(a=a.add(this.editorView.state.doc,i)),this.setDecorationSet(a),this.editorView&&this.dispatch(this.editorView.state.tr.setMeta(Un.SPELLCHECKER_TRANSACTION,!0)),this.addEventListenersToDecorations()}removeEventListenersFromDecorations(){const n=this.editorView?.domAtPos(this.lastOriginalFrom).node?.querySelectorAll("span.spell-error")||[];n.length&&n.forEach(r=>{r.removeEventListener("click",this.debouncedClickEventsListener)})}addEventListenersToDecorations(){if(this.isEnableSuggestion)try{const n=this.editorView?.domAtPos(this.lastOriginalFrom).node?.querySelectorAll("span.spell-error")||[];if(!n.length)return;n.forEach(r=>{r.addEventListener("click",this.debouncedClickEventsListener)})}catch{}}addEventListenersToSuggestionBox(){const e=this.suggestionBox.querySelectorAll("li");e.length&&e.forEach(n=>{n.addEventListener("mousedown",this.debouncedAcceptSuggestionEventsListener)})}dispatch(e){this.editorView&&this.editorView.dispatch(e)}findChangedTextNodes(e,n,r,i){if(!e.isBlock)return!1;if(!e.isTextblock)return e.descendants((u,c)=>{this.findChangedTextNodes(u,c,r,i)}),!1;const[s,a]=[n,n+e.nodeSize];if(!(s<=r&&i<=a))return;const l={node:e,pos:n};this.onNodeChanged(l.node.textContent,l.pos+1)}onNodeChanged(e,n){n!==this.lastOriginalFrom?this.getMatchAndSetDecorations(e,n):this.debouncedGetMatchAndSetDecorations(e,n),this.lastOriginalFrom=n}async clickEventsListener(e){if(!e.target)return;let n=e.target;for(;n&&!n.classList.contains("spell-error");)n=n.parentElement;if(!n||!n.classList.contains("spell-error"))return;this.lastClickedDecoration=n;const r=n.getAttribute(kb)?.trim();if(!r){console.error("No match string provided",{spellCheckerAttributes:r});return}const{length:i,wrongWord:s,suggestions:a}=JSON.parse(r),l=this.editorView?.posAtDOM(n,0)??0,u=l+i;if(this.editorView){this.addSuggestionsList(a,l,u),this.suggestionBox.style.display="";const c=MJ(n);if(!c)return;const f=n.getBoundingClientRect(),p=c.getBoundingClientRect(),m=window.getComputedStyle(c).padding,g=f.left-p.left+3-parseInt(m);let v=f.top-p.top+30-parseInt(m);this.suggestionBox.style.left=g+"px",this.suggestionBox.style.top=v+"px";const b=this.suggestionBox.getBoundingClientRect();b.bottom>p.bottom&&(v=f.top-p.top-b.height-7-parseInt(m),this.suggestionBox.style.top=v+"px"),this.showSuggestionsEvent&&this.showSuggestionsEvent(this.proofreader.normalizeTextForLanguage(s)),setTimeout(()=>{n.scrollIntoView({behavior:"smooth",block:"center"})},100)}return this.addEventListenersToSuggestionBox(),!1}acceptSuggestionListener(e){if(!e||!e.target)return;e.preventDefault(),e.stopPropagation();const n=e.target;let r=0,i=0;if(this.lastClickedDecoration&&this.editorView){const s=this.lastClickedDecoration.getAttribute(kb)?.trim();if(s){const{length:a}=JSON.parse(s);r=this.editorView.posAtDOM(this.lastClickedDecoration,0),i=r+a}}if(this.editorView&&r>=0&&i>r){this.dispatch(this.editorView.state.tr.setMeta(Un.ACCEPT_SUGGESTION,!0));const s=n.textContent||"",a=this.editorView.state.tr.insertText(s,r,i),l=r+s.length,u=Ie.create(a.doc,l);a.setSelection(u),this.dispatch(a),this.editorView.focus()}this.hideSuggestionBox(),this.lastClickedDecoration&&(this.lastClickedDecoration.removeEventListener("click",this.debouncedClickEventsListener),this.lastClickedDecoration=null)}addSuggestionsList(e,n,r){if(this.suggestionBox.textContent="",e.length>0){const i=document.createElement("ul");i.className="suggestion-list",e.forEach(s=>{const a=document.createElement("li");a.innerText=s,a.dataset.from=n+"",a.dataset.to=r+"",i.appendChild(a)}),this.suggestionBox.appendChild(i)}if(e.length===0){const i=document.createElement("b"),s=this.uiStrings&&this.uiStrings.noSuggestions?this.uiStrings.noSuggestions:"No suggestions found";i.textContent=s,this.suggestionBox.appendChild(i)}}isUndoRedo(e,n){return e.getMeta(U5.ADD_TO_HISTORY_TRANSACTION)===!1||e.getMeta(Un.APPENDED)===!0||n.isUndoRedoOperation}handleUndoRedo(e,n){const r=e.getMeta(U5.HISTORY_TRANSACTION)?.redo;if(n.isUndoRedoOperation=!1,r)return this.debouncedProofreadDoc(e.doc),this.getDecorationSet();const{changedNodes:i}=this.getChangedNodesFromTransaction(e,!0);return i.length===0?this.getDecorationSet():i.length===1?(this.debouncedProofreadChangedNodes(i),this.getDecorationSet()):(this.debouncedProofreadDoc(e.doc),this.getDecorationSet())}isTextContentChangedOrDeleted(e){let n=!1;return{isTextContentChanged:e.steps.some(i=>{const s=i.toJSON?.();return s?.stepType==="replace"&&s?.slice?.content?s.slice.content.some(a=>a.type==="paragraph"&&a.content&&a.content.length>0):s?.stepType==="replace"&&(!s.slice||!s.slice.content||s.slice.content.length===0)?(n=!0,s.from!==s.to):!1}),isDeleteAction:n}}handleEnterKey(e,n){if(n)return this.debouncedProofreadDoc(e.doc),this.getDecorationSet();const r=e.getMeta(Un.APPENDED_TRANSACTION);if(!r)return this.getDecorationSet();const s=r.steps[0].to,a=r.before.nodeAt(s-1);if(!a?.isText)return this.getDecorationSet();let l=0;return r.before.descendants((c,f)=>{c.textContent===a?.textContent&&(l=f)}),l+(a?.nodeSize||0)===s?this.getDecorationSet():(this.debouncedProofreadDoc(e.doc),this.getDecorationSet())}handleEnterKeyDebounced(e,n,r){this._debouncedHandleEnterKey(e,n,r)}}const aE=t=>{if(!t)return-1;const{from:e}=t.state.selection;let n=0;return t.state.doc.descendants((r,i)=>{r.type.name===Np&&i<e&&n++}),n},lE=t=>{const e=t.view?.dom;if(!e)return!1;const n=window.getSelection?.();if(n&&n.rangeCount){const r=n.anchorNode;if(r&&e.contains(r))return!0}return!1},uE=(t,e)=>t.map((r,i)=>({ext:r,name:r.name,originalIndex:i,order:e[r.name]})).sort((r,i)=>{const s=r.order===-1,a=i.order===-1;if(s&&!a)return 1;if(!s&&a)return-1;if(s&&a)return r.originalIndex-i.originalIndex;const l=typeof r.order=="number",u=typeof i.order=="number";return l&&u?r.order-i.order:l?-1:u?1:r.originalIndex-i.originalIndex}).map(r=>r.ext),Ch=(t,e)=>t?!!t.extensionManager.extensions.find(n=>n.name===e):!1;function cE(t,e){return e.characterCountLimit===void 0?t:t.map(n=>n.name==="base-kit"?n.configure({...n.options,characterCount:{...n.options.characterCount,limit:e.characterCountLimit}}):n)}const dE=bn(),Un={SPELLCHECKER_TRANSACTION:"spellcheckerTransaction",IS_ACTIVE_SPELLCHECK:"isActiveSpellCheck",LOADING_TRANSACTION:"loading",PREVENT_UPDATE:"preventUpdate",APPENDED:"appended",APPENDED_TRANSACTION:"appendedTransaction",ACCEPT_SUGGESTION:"acceptSuggestion",SKIP_SPELLCHECK:"skipSpellcheck",UI_EVENT:"uiEvent"},HJ={DROP:"drop"},fE=Qe.create({name:"spellchecker",addOptions(){return{proofreader:void 0,uiStrings:{noSuggestions:""},spellcheckHighlightMode:Io.ERROR_TYPE,spellcheckHighlightColor:Qi,button:({editor:t,t:e,isMobile:n})=>({component:Ge,componentProps:{action:()=>t.commands.handleActiveSpellCheck(),isActive:()=>t?.extensionStorage?.spellchecker?.spellchecker?.proofreader?.enabled||!1,icon:"SpellCheck",tooltip:"맞춤법 검사",title:n?e("editor.menubar.menu.spelling"):"",customClassTooltip:"flex items-center justify-center"}})}},addStorage(){return{didPaste:!1,spellchecker:void 0,isUndoRedoOperation:!1,pendingSpellCheck:!1,enterKeyPressed:!1}},addCommands(){return{checkSpelling:()=>({tr:t})=>(this.storage.spellchecker.proofreadDoc(t.doc),!0),selectAll:()=>({state:t,dispatch:e})=>(IM(t,e),!0),copy:()=>()=>(document.execCommand("copy"),!0),handleActiveSpellCheck:(t=!0)=>({editor:e})=>{const n=e.extensionStorage.spellchecker.spellchecker;return n.toggleIsEnabledSpellCheck(),e.view.dispatch(e.state.tr.setMeta(Un.IS_ACTIVE_SPELLCHECK,n.getIsEnabledSpellCheck())),t&&dE.setSpellCheck(n.getIsEnabledSpellCheck()),n.hideSuggestionBox(),lE(e)&&e.commands.focus(),!0},setIsEnableSuggestion:t=>()=>(this.storage.spellchecker.setIsEnableSuggestion(t),!0)}},addProseMirrorPlugins(){return[new ot({key:new Et("skipMarkPlugin"),view:e=>{const n=e.dispatch;return e.dispatch=r=>(r.steps.some(s=>s instanceof ti||s instanceof ro)&&r.setMeta(Un.SKIP_SPELLCHECK,!0),n.call(e,r)),{}}}),new ot({key:new Et("spellcheckerPlugin"),props:{decorations(e){return this.getState(e)},handlePaste:()=>{this.storage.didPaste=!0},handleClick:()=>{this.storage.spellchecker.hideSuggestionBox()},handleKeyDown:(e,n)=>((n.ctrlKey||n.metaKey)&&(n.key==="z"||n.key==="y")&&(this.storage.isUndoRedoOperation=!0,this.storage.pendingSpellCheck=!0),this.storage.enterKeyPressed&&(this.storage.pendingSpellCheck=!0),n.key==="Enter"&&(this.storage.enterKeyPressed=!0),!1)},state:{init:(e,n)=>{const r=new $J(this.options.proofreader,this.options.uiStrings,this.options.onShowSuggestionsEvent,this.options.proofreader?.limit,this.options.spellcheckHighlightMode??Io.ERROR_TYPE,this.options.spellcheckHighlightColor??Qi,this.options.docLimit);return this.storage.spellchecker=r,r.setDecorationSet(lt.create(n.doc,[])),dE.setSpellCheck(r.getIsEnabledSpellCheck()),this.options.proofreader?.enabled&&r.proofreadDoc(n.doc),r.getDecorationSet()},apply:(e,n)=>{if(e.getMeta(Un.SKIP_SPELLCHECK))return n;const r=this.storage.spellchecker,i=e.getMeta(Un.IS_ACTIVE_SPELLCHECK);if(i!==void 0)return i?r.proofreadDoc(e.doc):r.setDecorationSet(lt.empty),r.getDecorationSet();if(e.getMeta(Un.SPELLCHECKER_TRANSACTION))return r.getDecorationSet();if(e.docChanged&&e.doc.nodeSize){const a=r.getDecorationSet().map(e.mapping,e.doc);if(r.setDecorationSet(a),e.getMeta(Un.UI_EVENT)===HJ.DROP)return r.debouncedProofreadDoc(e.doc),r.getDecorationSet();if(r.isUndoRedo(e,this.storage))return r.handleUndoRedo(e,this.storage);const{isTextContentChanged:l,isDeleteAction:u}=r.isTextContentChangedOrDeleted(e);if(u){const{changedNodes:m}=r.getChangedNodesFromTransaction(e,!1,!0);return m.length>0&&r.debouncedProofreadChangedNodes([m[0]]),r.getDecorationSet()}if(this.storage.enterKeyPressed)return r.handleEnterKeyDebounced(e,this.storage.pendingSpellCheck,()=>{this.storage.enterKeyPressed=!1,this.storage.pendingSpellCheck=!1}),r.getDecorationSet();if(this.storage.pendingSpellCheck||l)return r.debouncedProofreadDoc(e.doc,()=>{this.storage.pendingSpellCheck=!1}),r.getDecorationSet();if(e.getMeta(iE.UPDATE)||e.updated===0&&e.steps[0]?.structure===!0)return r.getDecorationSet();if(e.getMeta(Un.PREVENT_UPDATE)===!0&&e.before.textContent.length===0)return r.debouncedProofreadDoc(e.doc),r.getDecorationSet();this.storage.didPaste&&(this.storage.didPaste=!1);const{changedNodes:f,isChangedSuperText:p}=r.getChangedNodesFromTransaction(e);if(p)return r.debouncedProofreadDoc(e.doc),r.getDecorationSet();f.length>0&&r.debouncedProofreadChangedNodes(f)}return r.getDecorationSet()}},view:()=>({update:e=>{const n=this.storage.spellchecker;n.setEditorView(e),e?.dom?.parentNode?.appendChild(n.getSuggestionBox())}})})]}}),zJ=()=>{const t=o.reactive({[Bo.EDITOR_COMMENT]:{editor:null,wrongWords:[]},[Bo.EDITOR_CONTENT]:{editor:null,wrongWords:[]}});function e(x,C){t[x].editor=C}const n=o.ref(io.NO_ERROR);function r(){Object.values(t).forEach(x=>{x.wrongWords=[]})}function i(x,C){return x?io.FAIL:C?io.HAS_ERROR:io.NO_ERROR}async function s(){n.value=io.LOADING;let x=!1,C=!1;for(const[E,{editor:k}]of Object.entries(t)){if(!k)continue;const T=k?.extensionManager.extensions.find(A=>A.name==="spellchecker")?.options.proofreader.api,_=k.getText({blockSeparator:`
|
|
340
340
|
`});if(!(!T||!_))try{const{data:A}=await sn.post(T,{value:_});if(!A.success&&A.code!==iL.NOTHING_TO_CHANGE){C=!0,t[E].wrongWords=[];continue}if(A.data?.wrongWordResponseDto){x=!0,t[E].wrongWords=A.data.wrongWordResponseDto;continue}t[E].wrongWords=[]}catch(A){console.error("handleRunSpellCheck error: ",A),C=!0}}n.value=i(C,x)}const a=o.computed(()=>Object.values(t).reduce((x,{wrongWords:C})=>x+C.length,0));o.watch(a,x=>{x===0&&(n.value=i(!1,!1))});const l=o.computed(()=>{const x=Object.values(t).flatMap(C=>C.wrongWords);return x.length===0?!1:x.every(C=>!Array.isArray(C.correctWord)||C.correctWord.length===0)});function u(x){const C=x.extensionManager.extensions.find(E=>E.name==="spellchecker")?.options;return{mode:C?.spellcheckHighlightMode??Io.ERROR_TYPE,color:C?.spellcheckHighlightColor??Qi}}function c(){for(const[x,{editor:C,wrongWords:E}]of Object.entries(t)){if(!C)continue;const{mode:k,color:T}=u(C);lb(C,E,k,T)}}function f(){for(const[x,{editor:C}]of Object.entries(t))C&&DX(C)}async function p(){await s(),c()}let m=!0;function g(x){if(m=x,!!x)for(const[C,{editor:E}]of Object.entries(t))E&&(E.extensionStorage.spellchecker.spellchecker.setEnabledProofreadText(!1),E.view.dispatch(E.state.tr.setMeta(Un.IS_ACTIVE_SPELLCHECK,!1)))}function v(){if(m)for(const[x,{editor:C}]of Object.entries(t))C&&(C.extensionStorage.spellchecker.spellchecker.setEnabledProofreadText(!0),C.view.dispatch(C.state.tr.setMeta(Un.IS_ACTIVE_SPELLCHECK,!0)))}function b(x,C,E=`
|
|
341
341
|
`){if(!x||!C.length)return;const k=xk(x,E);function T(H){if(H<0&&(H=0),H>=k.length)return x.state.doc.content.size;if(k[H]!=null)return k[H];for(let j=H;j<k.length;j++)if(k[j]!=null)return k[j];for(let j=H-1;j>=0;j--)if(k[j]!=null)return k[j];return x.state.doc.content.size}const A=C.map(H=>{const j=T(H.startIndex),Y=T(Math.max(0,H.endIndex-1))+1,N=H.correctWord?.[0]??H.wrongWord;return{item:H,from:j,to:Y,replacement:N}}).filter(H=>typeof H.from=="number"&&typeof H.to=="number"&&H.from<H.to);if(!A.length)return;A.sort((H,j)=>j.from-H.from);const V=x.state.tr;let O=Number.POSITIVE_INFINITY;const B=new Set;for(const H of A)H.to>O||(V.insertText(H.replacement,H.from,H.to),B.add(H.item),O=H.from);B.size>0&&(x.view.dispatch(V),x.view.focus()),B.size>0&&(C=C.filter(H=>![...B].some(j=>j===H))),lb(x,C)}function w(){for(const[x,{editor:C,wrongWords:E}]of Object.entries(t))C&&b(C,E)}return{editorsState:t,spellCheckStatus:n,countTotalWrongWords:a,allWrongWordsMissSuggestions:l,setEditor:e,resetAllEditorWrongWords:r,disableSpellCheckRealTime:g,resetEnableSpellCheckRealTime:v,applyAllEditorHighlightErrors:c,clearAllEditorHighlightErrors:f,reRunSpellCheckAndHighlight:p,handleRunSpellCheck:s,replaceAllEditorErrors:w}},UJ=o.defineComponent({__name:"DialogTrigger",props:{asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,r)=>(o.openBlock(),o.createBlock(o.unref(ED),o.normalizeProps(o.guardReactiveProps(e)),{default:o.withCtx(()=>[o.renderSlot(n.$slots,"default")]),_:3},16))}}),WJ={key:0,class:"border-blue-500 text-white text-xs text-nowrap px-3 py-2 h-auto bg-blue-500 hover:bg-blue-500/80 flex items-center rounded"},pE=o.defineComponent({__name:"BulkSpellChecker",props:{editor:{},editorComment:{},isEnableSpellCheckRealTime:{type:Boolean},align:{default:"right"}},setup(t){const e=t,{editorsState:n,countTotalWrongWords:r,spellCheckStatus:i,allWrongWordsMissSuggestions:s,setEditor:a,disableSpellCheckRealTime:l,resetEnableSpellCheckRealTime:u,handleRunSpellCheck:c,resetAllEditorWrongWords:f,applyAllEditorHighlightErrors:p,clearAllEditorHighlightErrors:m,reRunSpellCheckAndHighlight:g,replaceAllEditorErrors:v}=zJ(),b=o.ref(!1),w=o.reactive({x:0,y:0}),x=o.ref(!1),C={x:0,y:0},E=B=>{x.value=!0,C.x=B.clientX-w.x,C.y=B.clientY-w.y,document.addEventListener("mousemove",k),document.addEventListener("mouseup",T)},k=B=>{x.value&&(w.x=B.clientX-C.x,w.y=B.clientY-C.y)},T=()=>{x.value=!1,document.removeEventListener("mousemove",k),document.removeEventListener("mouseup",T)};o.onUnmounted(()=>{document.removeEventListener("mousemove",k),document.removeEventListener("mouseup",T)});const _=o.ref(null),A=o.ref({top:0,right:0,left:0}),V=()=>{if(_.value){const B=_.value.$el.getBoundingClientRect();A.value={top:B.bottom+window.scrollY+5,right:window.innerWidth-B.right-window.scrollX,left:B.left+window.scrollX},w.x=0,w.y=0}};o.onMounted(async()=>{e.editorComment&&a(Bo.EDITOR_COMMENT,e.editorComment),a(Bo.EDITOR_CONTENT,e.editor)}),o.onUnmounted(()=>{a(Bo.EDITOR_COMMENT,null),a(Bo.EDITOR_CONTENT,null)}),o.watch(b,async B=>{B?(await o.nextTick(),V(),l(e.isEnableSpellCheckRealTime),await c(),p()):(f(),u(),m())});const O=e.editor?.extensionManager.extensions.find(B=>B.name==="spellchecker")?.options.bulkSpellCheckerButton;return(B,H)=>{const j=Ot,Y=cb,N=ch,U=uh,P=lh,L=ah,F=oY,R=Pc,K=Dc;return o.openBlock(),o.createBlock(K,{open:o.unref(b)},{default:o.withCtx(()=>[o.createVNode(o.unref(UJ),{"as-child":"",ref_key:"triggerRef",ref:_,onClick:H[0]||(H[0]=X=>b.value=!o.unref(b))},{default:o.withCtx(()=>[o.unref(O)?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(o.unref(O).component),{key:1,buttonName:o.unref(O).props.buttonName,icon:o.unref(O).props.icon,type:o.unref(O).props.type,disabled:o.unref(O).props.disabled,iconPosition:o.unref(O).props.iconPosition,buttonSize:o.unref(O).props.buttonSize,iconClass:o.unref(O).props.iconClass},null,8,["buttonName","icon","type","disabled","iconPosition","buttonSize","iconClass"])):(o.openBlock(),o.createElementBlock("button",WJ,[o.createVNode(j,{name:"checkUnderline"}),H[4]||(H[4]=o.createTextVNode("맞춤법 일괄 교정 "))]))]),_:1},512),o.createVNode(R,{"is-overlay-transparent":"",class:"p-0 gap-0 !animate-none !transition-none dark:border-ed-muted","as-child":""},{default:o.withCtx(()=>[o.createElementVNode("div",{class:"z-[70]",style:o.normalizeStyle({transform:`translate(${o.unref(w).x}px, ${o.unref(w).y}px)`,top:`${o.unref(A).top}px`,right:B.align==="left"?"auto":`${o.unref(A).right}px`,left:B.align==="left"?`${o.unref(A).left}px`:"auto"})},[o.createVNode(P,{class:"bg-ed-blue-light py-3.5 px-6 rounded-t-[5px] cursor-move text-blue-500 dark:text-dark-blue-100 flex-row items-center justify-between",onMousedown:o.withModifiers(E,["prevent"])},{default:o.withCtx(()=>[o.createVNode(N,{class:"text-base space-x-2"},{default:o.withCtx(()=>[H[5]||(H[5]=o.createElementVNode("span",null,"맞춤법/문법 오류",-1)),o.createVNode(Y,{class:"text-sm bg-blue-500 hover:bg-blue-500 dark:bg-dark-blue-100 px-2"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(r))+"개",1)]),_:1})]),_:1}),o.createVNode(U,{onClick:H[1]||(H[1]=X=>b.value=!1),class:"text-xs flex items-center gap-x-1"},{default:o.withCtx(()=>[o.createVNode(j,{name:"Close",class:"w-4 h-4"}),o.createTextVNode(o.toDisplayString(B.$t("editor.close")),1)]),_:1})]),_:1}),o.createVNode(L),o.createVNode(F,{editorsState:o.unref(n),spellCheckStatus:o.unref(i),allWrongWordsMissSuggestions:o.unref(s),onCloseModal:H[2]||(H[2]=X=>b.value=!1),onRunSpellcheck:o.unref(g),onReplaceAllEditorErrors:H[3]||(H[3]=X=>(o.unref(v)(),b.value=!1))},null,8,["editorsState","spellCheckStatus","allWrongWordsMissSuggestions","onRunSpellcheck"])],4)]),_:1})]),_:1},8,["open"])}}}),jJ=Object.freeze(Object.defineProperty({__proto__:null,default:pE},Symbol.toStringTag,{value:"Module"})),hE=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(Ie.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}}}}),Eb=o.defineComponent({__name:"SimpleEditor",props:{modelValue:{default:""},parentEditor:{default:null},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=[G5,j5,K5,W5,q5.configure({placeholder:"수퍼를 입력하세요"}),hE,Y5],u=o.ref(r.spellcheckEnabled),c=o.computed(()=>r.parentEditor?.extensionManager.extensions.find(Y=>Y.name==="spellchecker")),f=o.computed(()=>fE.configure({proofreader:new aS({api:c.value?.options.proofreader?.api,limit:c.value?.options.proofreader?.limit,transfer:c.value?.options.proofreader?.transfer,enabled:u.value}),uiStrings:c.value?.options.uiStrings,bulkSpellCheckerButton:c.value?.options.bulkSpellCheckerButton,spellcheckHighlightMode:c.value?.options.spellcheckHighlightMode,spellcheckHighlightColor:c.value?.options.spellcheckHighlightColor})),p=new Oo({enablePasteRules:!1,enableInputRules:!1,content:r.modelValue,extensions:l.concat(f.value),editable:!r.isReadOnly,autofocus:r.autofocus,onUpdate:({editor:Y})=>{i("update:modelValue",Y.getHTML())},parseOptions:{preserveWhitespace:"full"}});o.watch(()=>r.isReadOnly,Y=>{p.setEditable(!Y),p?.commands?.setIsEnableSuggestion&&p.commands.setIsEnableSuggestion(!Y)},{immediate:!0});function m(Y){const{view:N}=p,{from:U}=N.state.selection;p.commands.insertContentAt(U,Y),p.commands.focus()}function g(){u.value=!u.value,p.commands.handleActiveSpellCheck(u.value),p?.commands?.setIsEnableSuggestion&&p.commands.setIsEnableSuggestion(u.value)}const{contentInner:v,measuredMinWidth:b,measure:w}=pf({minChars:a,fontSize:"",editor:p});o.watch(()=>r.modelValue,()=>{w(),p&&p.getHTML()!==r.modelValue&&p.commands.setContent(r.modelValue??"",!1,{preserveWhitespace:"full"})});const x=o.inject("fontSize",""),C=o.inject("fontFamily",""),E=o.inject("fontWeight",""),k=o.inject("letterSpacing",""),T=o.computed(()=>s?{fontSize:o.unref(x),fontFamily:o.unref(C),fontWeight:o.unref(E),letterSpacing:o.unref(k)}:{}),_=o.computed(()=>s?{paddingLeft:"7px",paddingRight:"7px"}:{width:`${b.value}px`}),V=document.createElement("canvas").getContext("2d");function O(){if(!b.value||!(v.value instanceof Element)||!V)return;const Y=p.getText({blockSeparator:`
|
|
342
342
|
`}),N=getComputedStyle(v.value);V.font=N.font;const U=20,P=()=>Math.max(0,(b.value||0)-U);function L(X,ae){let de=1,Ee=X.length,ie=0;for(;de<=Ee;){const me=Math.floor((de+Ee)/2);V.measureText(X.slice(0,me)).width<=ae?(ie=me,de=me+1):Ee=me-1}return ie}let F="";const R=[];for(const X of Y){if(X===`
|
|
343
|
-
`){R.push(F),F="";continue}if(F+=X,V.measureText(F).width>P())for(;V.measureText(F).width>P();){const ae=L(F,P());ae<=0?(R.push(F.charAt(0)),F=F.slice(1)):(R.push(F.slice(0,ae)),F=F.slice(ae))}}return R.push(F),R.map(X=>`<p>${X}</p>`).join("")}const B=o.computed(()=>{const Y=r.parentEditor?.storage.superText.superInputModal?.props?.guidelineLeftOffset;return s.value||!Y?{}:{backgroundImage:"linear-gradient(to right, #d1d5db 1px, transparent 1px)",backgroundSize:"1px 100%",backgroundRepeat:"no-repeat",backgroundPosition:Yt(Y)}}),{isScrolling:H,handleScroll:j}=Xl();return e({insertSpecialCharater:m,isChecked:u,toggleSpellCheck:g,wrapText:O,editor:p}),(Y,N)=>(o.openBlock(),o.createElementBlock("div",{ref_key:"contentInner",ref:v,class:o.normalizeClass(o.unref(ke)("h-40 overflow-y-auto border focus-within:border-ed-input-focus rounded-[3px] p-2.5 relative",Y.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(H)&&"scrollbar-thumb-transparent")),style:o.normalizeStyle([o.unref(_),o.unref(B),o.unref(T)]),onScroll:N[0]||(N[0]=(...U)=>o.unref(j)&&o.unref(j)(...U))},[o.createVNode(o.unref(Yn),{id:"editor-panel",editor:o.unref(p),class:o.normalizeClass(o.unref(ke)("vdc-editor relative h-full"))},null,8,["editor","class"])],38))}}),qJ={class:"sr-only"},KJ={class:"grid m-2.5 p-2.5 gap-y-2.5 rounded border border-gray-200"},GJ={class:"grid grid-cols-[60px,1fr] gap-x-2"},XJ={class:"flex items-center space-x-2 text-xs font-normal [&>input[type='checkbox']]:h-[20px] [&>input[type='checkbox']]:w-[20px] [&>input[type='checkbox']]:!border-ed-border [&>input[type='checkbox']]:shadow"},YJ=["checked"],JJ={for:"spellcheck",class:"select-none whitespace-nowrap"},ZJ={class:"flex gap-x-1"},QJ={class:"ml-auto"},NJ={class:"grid grid-cols-[60px,1fr] gap-x-2"},eZ={class:"text-right text-sm p-2"},tZ={class:"grid grid-cols-[60px,1fr] gap-x-2"},mE=5,Wc=o.defineComponent({__name:"SuperInputDialog",props:{editor:{},open:{type:Boolean},superTextInit:{},superTextElementId:{}},emits:["close","save"],setup(t,{emit:e}){const n=e,r=t,{t:i}=Pt(),s=o.ref(""),a=o.ref(""),l=o.ref(null),u=o.ref(!1),c=ct.useLocalStorage("superInputModalPosition",null),f=o.reactive({x:0,y:0}),p=o.ref(!1),m={x:0,y:0},g=o.ref(!1),v=o.ref(!1),b=o.ref(!1),w=F=>{p.value=!0;const R=F.currentTarget.closest(".draggable-dialog").getBoundingClientRect();m.x=F.clientX-R.left,m.y=F.clientY-R.top,document.addEventListener("mousemove",x),document.addEventListener("mouseup",C)},x=F=>{p.value&&(f.x=F.clientX-m.x,f.y=F.clientY-m.y)},C=()=>{p.value=!1,c.value={x:f.x,y:f.y},document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",C)};o.watch(()=>r.open,async F=>{if(!F)return;v.value=!1,r.superTextInit&&(s.value=r.superTextInit,r.superTextElementId&&(a.value=r.superTextElementId)),await o.nextTick();const R=document.querySelector(".draggable-dialog");if(!R)return;R.getBoundingClientRect();const K=window.innerWidth,X=window.innerHeight;c.value&&c.value.x!==void 0&&c.value.y!==void 0?(f.x=c.value.x,f.y=c.value.y):(f.x=Math.max((K-R.offsetWidth)/2,0),f.y=Math.max((X-R.offsetHeight)/2,0))},{immediate:!0});const E=()=>{n("close"),s.value="",a.value="",u.value=!1},k=()=>{if(l.value?.editor.commands.hasInvalidChar()){b.value=!0;return}s.value=l.value.wrapText(),a.value="",v.value?g.value=!0:n("close"),n("save",s.value),s.value=""},T=()=>{g.value=!1,n("close")},_=r.editor?.extensionManager.extensions.find(F=>F.name==="superText")?.options.specialCharModal,A=o.inject("fontFamily",""),V=o.computed(()=>Ch(r.editor,Rc)&&o.unref(A)?o.unref(A):r.editor?.storage.superText.superInputModal?.props?.fontFamily),O=o.inject("fontWeight",o.ref("")),B=o.computed(()=>o.unref(O)||void 0),H=ct.useLocalStorage("recentSpecialChars",[]),j=F=>{if(!F)return;const R=(H.value??[]).filter(K=>K!==F);R.unshift(F),H.value=R.slice(0,mE)},Y=F=>{l.value?.insertSpecialCharater(F)},N=(F,R)=>{R&&(l.value?.insertSpecialCharater(F),j(F))},U=o.computed(()=>l.value?.isChecked),P=()=>{l.value?.toggleSpellCheck()};o.onUnmounted(()=>{document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",C)}),o.watch(s,F=>{!r.superTextElementId||r.superTextElementId===""||(v.value=F!==(r.superTextInit??""))});const L=o.computed(()=>l.value?.editor);return(F,R)=>{const K=ch,X=uh,ae=lh,de=ah,Ee=pE,ie=sb,me=Pc,J=Dc,ee=EX;return o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createVNode(J,{open:F.open},{default:o.withCtx(()=>[o.createVNode(o.unref(Kg),null,{default:o.withCtx(()=>[o.createVNode(o.unref(Qg),{class:"!pointer-events-none bg-black/30"}),o.createVNode(me,{"is-overlay-transparent":"",class:"p-0 gap-0 !animate-none !transition-none max-w-max","as-child":""},{default:o.withCtx(()=>[o.createElementVNode("div",{class:"draggable-dialog fixed z-[70] pointer-events-auto",style:o.normalizeStyle({top:"0px",left:"0px",transform:`translate(${f.x}px, ${f.y}px)`,fontFamily:o.unref(V),fontWeight:o.unref(B)})},[o.createVNode(ae,{class:"bg-blue-500 text-white p-2.5 rounded-t-[5px] cursor-move",onMousedown:o.withModifiers(w,["prevent"])},{default:o.withCtx(()=>[o.createVNode(K,null,{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(i)("editor.superinput")),1)]),_:1}),o.createVNode(X,{class:"absolute right-3 top-3 text-white",onClick:E},{default:o.withCtx(()=>[o.createVNode(o.unref(cc),{class:"w-5 h-5"}),o.createElementVNode("span",qJ,o.toDisplayString(F.$t("editor.close")),1)]),_:1})]),_:1}),o.createVNode(de),o.createElementVNode("div",KJ,[o.createElementVNode("div",GJ,[R[5]||(R[5]=o.createElementVNode("label",null," ",-1)),o.createElementVNode("div",{class:o.normalizeClass(o.unref(ke)("flex gap-x-6",o.unref(H).length===mE&&"gap-x-4"))},[o.createVNode(mn,{class:"text-[#65558F] bg-[#ECE6F0] hover:bg-[#ECE6F0]/90 shadow text-xs rounded font-normal h-[25px] px-3",onClick:R[0]||(R[0]=te=>u.value=!0)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(i)("editor.insert.symbol")),1)]),_:1}),o.createElementVNode("div",XJ,[o.createElementVNode("input",{id:"spellcheck",type:"checkbox",class:"shrink-0",checked:o.unref(U),onChange:P},null,40,YJ),o.createElementVNode("label",JJ,o.toDisplayString(o.unref(i)("editor.menubar.menu.spellCheck")),1)]),o.createElementVNode("div",ZJ,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(o.unref(H),te=>(o.openBlock(),o.createBlock(mn,{key:te,variant:"outline",size:"xs",class:"h-[25px] w-[25px] p-0",onClick:se=>Y(te)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(te),1)]),_:2},1032,["onClick"]))),128))]),o.createElementVNode("div",QJ,[o.unref(L)?(o.openBlock(),o.createBlock(Ee,{key:0,editor:o.unref(L),"is-enable-spell-check-real-time":o.unref(L)?.extensionStorage.spellchecker.spellchecker.proofreader.enabled,align:"left"},null,8,["editor","is-enable-spell-check-real-time"])):o.createCommentVNode("",!0)])],2),u.value?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(o.unref(_)?.component),o.mergeProps({key:0,"custom-class":"!z-[70] !pointer-events-auto","font-family":o.unref(V)},o.unref(_).props,{onSelectedChar:N,onClose:R[1]||(R[1]=te=>u.value=!1)}),null,16,["font-family"])):o.createCommentVNode("",!0)]),o.createElementVNode("div",NJ,[o.createElementVNode("label",eZ,o.toDisplayString(o.unref(i)("editor.detail")),1),o.createVNode(Eb,{ref_key:"simpleEditorRef",ref:l,modelValue:s.value,"onUpdate:modelValue":R[2]||(R[2]=te=>s.value=te),"parent-editor":F.editor,class:""},null,8,["modelValue","parent-editor"])]),o.createElementVNode("div",tZ,[R[6]||(R[6]=o.createElementVNode("label",{class:"text-right text-sm p-2"},"ID",-1)),o.createVNode(ws,{modelValue:a.value,"onUpdate:modelValue":R[3]||(R[3]=te=>a.value=te),class:"rounded-none","default-value":a.value,disabled:""},null,8,["modelValue","default-value"])])]),o.createVNode(ie,{class:"sm:justify-center pb-3.5 pt-1"},{default:o.withCtx(()=>[o.createVNode(mn,{as:"button",variant:"default",class:"bg-blue-500 hover:bg-blue-500/90",onClick:k},{default:o.withCtx(()=>[o.createVNode(o.unref(C1),{class:"w-5 h-5 mr-2"}),o.createTextVNode(" "+o.toDisplayString(o.unref(i)("editor.check")),1)]),_:1}),o.createVNode(mn,{as:"button",variant:"destructive",onClick:E},{default:o.withCtx(()=>[o.createVNode(o.unref(cc),{class:"w-5 h-5 mr-2"}),o.createTextVNode(" "+o.toDisplayString(F.$t("editor.close")),1)]),_:1})]),_:1})],4)]),_:1})]),_:1})]),_:1},8,["open"]),o.createVNode(ee,{open:g.value,onClose:T},null,8,["open"]),o.createVNode(ee,{title:"Information",message:"{ 과 } 는 입력이 제한된 문자열 입니다.",iconName:"MessageCircleWarning",confirmText:"Ok",open:b.value,onClose:R[4]||(R[4]=te=>b.value=!1)},null,8,["open"])],64)}}}),Sb=o.defineComponent({__name:"SelectContextMenu",props:{editor:{},mode:{},superTextStore:{},disabled:{type:Boolean},disableSuperInput:{type:Boolean}},setup(t,{expose:e}){const n=t,{t:r}=Pt(),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===Te.EDITOR||n.mode===Te.PLAIN_TEXT||!l.value||n.disableSuperInput);function c(){if(!n.editor)return"";const{from:C,to:E}=n.editor.state.selection,k=n.editor.state.doc.cut(C,E),_=Ir.fromSchema(n.editor.schema).serializeFragment(k.content),A=document.createElement("div");return A.appendChild(_),A.innerHTML}const f=()=>{const{view:C}=n.editor,{from:E,to:k}=C.state.selection,T=c();s.text=T,s.from=E,s.to=k},p=()=>i.value=!i.value,m=()=>{u.value||(i.value=!0,f())},g=()=>i.value=!1,v=C=>{if(zc(C.trim())){i.value=!1;return}const E=n?.superTextStore.addMoreSuperText(C);n.editor&&n.editor.commands.insertContentAt(s.from,{type:"superText",attrs:{"data-id":E,"data-text":C}}),i.value=!1,requestAnimationFrame(()=>{n.editor.commands.setTextSelection(s.from+1),n.editor.view.focus()})},b=o.ref(!1),w=async C=>{if(C){const E=await n.editor.hasClipboard?.();b.value=!!E}},x=()=>{if(u.value||!n.editor)return;const{view:C,state:E}=n.editor,{from:k,to:T}=E.selection;s.from=k,s.to=T,s.text="",C.dom.blur(),i.value=!0};return e({toggleDialog:p,openDialog:m,closeDialog:g}),(C,E)=>{const k=Wc,T=ib,_=ob,A=rb,V=nb;return C.disabled?o.renderSlot(C.$slots,"default",{key:0}):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createVNode(k,{open:i.value,editor:C.editor,"super-text-init":s.text,onClose:p,onSave:v},null,8,["open","editor","super-text-init"]),o.createVNode(V,{"onUpdate:open":w},{default:o.withCtx(()=>[o.createVNode(T,{as:"template",class:"relative",disabled:o.unref(u),onDblclick:o.withModifiers(x,["prevent","stop"])},{default:o.withCtx(()=>[o.renderSlot(C.$slots,"default")]),_:3},8,["disabled"]),o.createVNode(A,null,{default:o.withCtx(()=>[C.disableSuperInput?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(_,{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(_,{key:1,onSelect:E[0]||(E[0]=O=>C.editor?.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(_,{key:2,onSelect:E[1]||(E[1]=O=>C.editor?.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(_,{key:3,disabled:!b.value,onSelect:E[2]||(E[2]=O=>C.editor?.commands.pasteContent())},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(r)("editor.paste")),1)]),_:1},8,["disabled"])):o.createCommentVNode("",!0)]),_:1})]),_:3})],64))}}}),nZ={id:"editor-panel",class:"flex relative w-full h-full"},rZ=Xr(o.defineComponent({__name:"PageNode",props:ta,setup(t){const{state:e,page:n,superTextStore:r}=bn(),{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===Te.REPORT),{width:p,height:m}=i,g=o.computed(()=>s?`calc(${m} - ${a?.top??0} - ${a?.bottom??0}`:"max-content"),v=ct.useEventBus(ur.SUPER_VIEW_PAGE);return o.watch(()=>t.node.attrs,b=>{v.emit(b.pageNumber)},{immediate:!0}),(b,w)=>{const x=Sb;return o.openBlock(),o.createBlock(o.unref(ea),{id:b.node.attrs.id,ref_key:"containerRef",ref:l,"page-number":b.node.attrs.pageNumber,class:"overflow-hidden umo-page-node-view w-full border rounded-[3px] border-[#999999]",style:o.normalizeStyle({"--umo-page-margin-top":o.unref(a)?.top??"0","--umo-page-margin-bottom":o.unref(a)?.bottom??"0","--umo-page-margin-left":o.unref(a)?.left??"0","--umo-page-margin-right":o.unref(a)?.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",nZ,[o.createVNode(x,{mode:c.value?o.unref(Te).REPORT:o.unref(Te).EDITOR,editor:b.editor,"super-text-store":o.unref(r)},{default:o.withCtx(()=>[o.createVNode(o.unref(tx),{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 gE(t,e){const n=t.storedMarks??(t.selection.$to.parentOffset&&t.selection.$from.marks());if(n){const r=n.filter(i=>e?.includes(i.type.name));t.tr.ensureMarks(r)}}const oZ=({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=kh(c,l.node().type.name,l.node().attrs);if(f.id=Kv(),f.extend&&(f.extend=!1),s instanceof Re&&s.node.isBlock)return!l.parentOffset||!mr(a,l.pos)?!1:(r&&(t&&gE(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 Ie&&e.deleteSelection();const m=l.depth===0?void 0:t4(l.node(-1).contentMatchAt(l.indexAfter(-1)));let g=p&&m?[{type:m,attrs:f}]:void 0,v=mr(e.doc,e.mapping.map(l.pos),1,g);if(!g&&!v&&mr(e.doc,e.mapping.map(l.pos),1,m?[{type:m}]:void 0)&&(v=!0,g=m?[{type:m,attrs:f}]:void 0),v&&(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 b=e.mapping.map(l.before()),w=e.doc.resolve(b);l.node(-1).canReplaceWith(w.index(),w.index()+1,m)&&e.setNodeMarkup(e.mapping.map(l.before()),m)}t&&gE(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},iZ=t=>({tr:e,state:n,dispatch:r,editor:i})=>{const s=vn(t,n.schema),{$from:a,$to:l}=n.selection;if((n.selection instanceof Re?n.selection.node:null)?.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 b=ge.empty;const w=a.index(-1)?1:a.index(-2)?2:3;for(let _=a.depth-w;_>=a.depth-3;_-=1)b=ge.from(a.node(_).copy(b));const x=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,C=kh(f,a.node().type.name,a.node().attrs),E=s.contentMatch.defaultType?.createAndFill(C)??void 0;b=b.append(ge.from(s.createAndFill(null,E)??void 0));const k=a.before(a.depth-(w-1));e.replace(k,a.after(-x),new Se(b,4-w,0));let T=-1;e.doc.nodesBetween(k,e.doc.content.size,(_,A)=>{if(T>-1)return!1;_.isTextblock&&_.content.size===0&&(T=A+1)}),T>-1&&e.setSelection(Ie.near(e.doc.resolve(T))),e.scrollIntoView()}return!0}const p=l.pos===a.end()?c.contentMatchAt(0).defaultType:null,m=kh(f,c.type.name,c.attrs),g=kh(f,a.node().type.name,a.node().attrs);m.id=Kv(),g.id=Kv(),e.delete(a.pos,l.pos);const v=p?[{type:s,attrs:m},{type:p,attrs:g}]:[{type:s,attrs:m}];if(!mr(e.doc,a.pos,2))return!1;if(r){const{selection:b,storedMarks:w}=n,{splittableMarks:x}=i.extensionManager,C=w??(b.$to.parentOffset&&b.$from.marks());if(e.split(a.pos,2,v).scrollIntoView(),!C||!r)return!0;const E=C.filter(k=>x.includes(k.type.name));e.ensureMarks(E)}return!0},sZ=[eh,Np,th,Gv,nh,Ss,Yv,Hl,Zv,Nv,Jv,_a,zl,Ci,Qv,eb,Xv,Gr],aZ=Lt.create({priority:200,name:`${Gr}`,content:"block*",group:`${Gr}`,isolating:!0,selectable:!1,draggable:!1,isLeaf:!0,addOptions(){return{SystemAttributes:{},nodesComputed:{},View:na(rZ),types:[],slots:{}}},addAttributes(){return{HTMLAttributes:{},id:{default:$r(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",{...wt(e),"data-type":this.name},0]},addCommands(){return{splitBlock:oZ,splitListItem:iZ,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:sZ.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=ze.atStart(a).from===c;return!l||!p||!f.type.isTextblock||f.textContent.length?!1:r.clearNodes()}),()=>vE(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(ze.atEnd(l).from===c&&!u.parentOffset)return r.deleteNode(Gr);const f=ai(p=>p.type.name===Gr)(a);if(f){if(!f.node.firstChild)return r.deleteNode(Gr);const p=f.node.firstChild.type;if(f.start+ze.atStart(f.node).from===c){const g=Ie.create(l,f.start-2,f.start-2),v=ai(b=>b.type.name===Gr)(g);if(v){const b=ze.atEnd(v.node).from+v.start,w=Ie.create(l,b,b);if(p===v.node.lastChild.type){const{parent:x}=w.$anchor;return FG(x,i.schema)?s.setSelection(w):s.step(new hn(b,c,Se.empty)),!0}s.setSelection(w)}return!0}}return!1})]),Delete:()=>this.editor.commands.first(({commands:r})=>[()=>vE(r),()=>r.command(({tr:i})=>{const{selection:s,doc:a}=i,{$anchor:l}=s,u=l.node(),c=ai(f=>f.type.name===Hl)(s);return c&&c.start+ze.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(ze.atEnd(a).from===u)return r.deleteNode(Gr);const c=ai(f=>f.type.name===Gr)(s);if(c&&c.start+ze.atEnd(c.node).from===u){const p=Ie.create(a,u+2,u+2),m=ai(g=>g.type.name===Gr)(p);if(m){const g=ze.atStart(m.node).from+m.start,v=Ie.create(a,g,g);if(ai(w=>w.attrs.extend)(v))return i.step(new hn(u,g,Se.empty)),!0}}return!1})]),Tab:()=>this.editor.commands.first(({commands:r})=>[()=>!this.editor.isActive("table")]),"Mod-Enter":()=>this.editor.commands.setPageBreak()}},addNodeView(){return this.options.View}});function kh(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 vE=t=>t.command(({tr:e})=>{const{selection:n,doc:r}=e,i=n4(r,{from:n.from,to:n.to},s=>s.type.name===Hl);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()}),bE={"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.moveUp":"Move up","editor.image.menu.moveDown":"Move down","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"},yE={"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.moveUp":"위로 이동","editor.image.menu.moveDown":"아래로 이동","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":"확인"},Oa=BW({legacy:!1,locale:"en",fallbackLocale:"en",messages:{en:bE,ko:yE}}),lZ=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()}}}),uZ=["data-font"],cZ=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===Te.EDITOR),{t:r}=Pt(),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 f=e.editor.extensionManager.extensions.find(m=>m.name==="fontFamily").options;let p=[];return St.isEmpty(f.fontFamilyList)?p=i:p=f.fontFamilyList.filter(m=>m.enabled!==!1).map(m=>({label:m.label,value:m.value})),[{label:r("editor.fontFamily.default"),value:r("editor.fontFamily.default")},...p]}),l=o.computed(()=>{const f={label:r("editor.fontFamily.default"),value:r("editor.fontFamily.default")};return n.value?(D0(e.editor.state,"textStyle").fontFamily??e.editor.getAttributes("paragraph").fontFamily??e.editor.getAttributes("heading").fontFamily)||f.value:s.value||f.value});function u(f){f.value===l.value||f.value===r("editor.fontFamily.default")?(e.editor.chain().focus().unsetFontFamily().run(),s.value=null):(s.value=f.value,e.editor.chain().focus().setFontFamily(f.value).run()),e.editor.commands.setForceCloseBubble(!0)}e.editor.on("selectionUpdate",({editor:f})=>{f.state.selection.empty&&e.editor.commands.resetForceCloseBubble()});const c=o.computed(()=>{const f=a.value[0]?.label||r("editor.fontFamily.default");return a.value.find(p=>p.value===l.value)?.label||f});return(f,p)=>(o.openBlock(),o.createBlock(ga,{disabled:f.disabled,tooltip:f.tooltip,title:c.value,btn_class:`min-w-20 ${f.customClass}`,class:"inside-toolbar"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.value,(m,g)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:g},[o.createVNode(o.unref(Ml),{checked:l.value===m.value,onClick:v=>u(m)},{default:o.withCtx(()=>[o.createElementVNode("span",{class:"ml-1 h-full","data-font":m.label,style:o.normalizeStyle({fontFamily:m.value??void 0})},o.toDisplayString(m.label),13,uZ)]),_:2},1032,["checked","onClick"]),m.label===o.unref(r)("editor.fontFamily.default")&&f.showDefaultDivider?(o.openBlock(),o.createBlock(o.unref(S1),{key:0})):o.createCommentVNode("",!0)],64))),128))]),_:1},8,["disabled","tooltip","title","btn_class"]))}}),wE=lZ.extend({name:"fontFamily",addOptions(){return{...this.parent?.(),types:["textStyle"],fontFamilyList:[],button({editor:t,extension:e,t:n}){return{component:cZ,componentProps:{editor:t,disabled:!t.can().setFontFamily(""),tooltip:n("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}).command(({tr:n})=>(r5(n,t),!0)).run(),unsetFontFamily:()=>({chain:t})=>t().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().command(({tr:e})=>(r5(e,null),!0)).run()}},addStorage(){return{value:null}},onUpdate(){this.storage.value=this.editor.getAttributes("textStyle").fontFamily??this.editor.getAttributes("paragraph").fontFamily??this.editor.getAttributes("heading").fontFamily},onSelectionUpdate(){this.storage.value=this.editor.getAttributes("textStyle").fontFamily??this.editor.getAttributes("paragraph").fontFamily??this.editor.getAttributes("heading").fontFamily}}),dZ=Qe.create({name:"fontWeight",addOptions(){return{...this.parent?.(),types:["textStyle"]}},addGlobalAttributes(){return[{types:["paragraph","textStyle"],attributes:{fontWeight:{default:null,parseHTML:t=>t.style.fontWeight||null,renderHTML:t=>t.fontWeight?{style:`font-weight: ${t.fontWeight}`}:{}}}}]},addCommands(){return{setFontWeight:t=>({chain:e})=>e().setMark("textStyle",{fontWeight:t}).run(),unsetFontWeight:()=>({chain:t})=>t().setMark("textStyle",{fontWeight:null}).removeEmptyTextStyle().run()}},addStorage(){return{value:null}},onUpdate(){this.storage.value=this.editor.getAttributes("textStyle").fontWeight}}),fZ={class:"flex gap-2"},pZ=["disabled"],hZ=Xr(o.defineComponent({__name:"FontSizeIncreaseDecrease",props:{editor:Object},setup(t){const e=o.inject("fontSize"),n=o.computed(()=>e.value?parseInt(e.value)===parseInt(ug[0])||parseInt(e.value)<parseInt(ug[0]):!1),r=ct.useEventBus(ur.INCREASE_DECREASE_FONTSIZE),i=s=>{r.emit(s)};return(s,a)=>{const l=da,u=ca,c=fa;return o.openBlock(),o.createElementBlock("div",fZ,[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(Ot),{name:"Plus",class:"w-6 h-6"})])]),_:1}),o.createVNode(o.unref(is),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(Ot),{name:"Minus",class:"w-6 h-6"})],8,pZ)]),_:1}),o.createVNode(o.unref(is),null,{default:o.withCtx(()=>a[3]||(a[3]=[o.createTextVNode(" 글꼴 크기 작게 ")])),_:1})]),_:1})]),_:1})])}}}),[["__scopeId","data-v-250d04b3"]]),mZ=Fn.create({name:"fontSizeIncreaseDecrease",addOptions(){return{defaultSize:"14px",button({editor:t}){return{component:hZ,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})}}}),_b=Qe.create({name:"painter",addOptions(){return{...this.parent?.(),button:({editor:t,extension:e,t:n})=>({component:Ge,componentProps:{action:()=>{t.commands.setPainter(t?.state.selection.$head.marks())},icon:"PaintRoller",tooltip:n("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 ot({key:new Et("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}}}})]}}),Tb=()=>$r(10),xE=new Et("attrkey"),gZ=t=>new ot({key:xE,state:{init:()=>!1,apply:n=>n.getMeta("initSplit")},appendTransaction(n,r,i){const{tr:s}=i;let a=!1;const l=xE.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:v}=f,b=c.includes(v.id)?Tb():v.id||Tb();t.includes(f.type.name)&&(s.setNodeMarkup(p,void 0,{...v,id:b,"number-line":g+1}),a=!0),c.push(b)})}return a?s:null}}),CE=[eh,Np,th,Gv,nh,Ss,Yv,Hl,Zv,Nv,Jv,_a,zl,Ci,Qv,eb,Xv,Gr],vZ=Qe.create({name:"autoId",addGlobalAttributes(){return[{types:CE.concat(this.options.types||[]),attributes:{id:{default:Tb()},extend:{default:!1},class:{default:null},"number-line":{default:null}}}]},addProseMirrorPlugins(){return[gZ(CE.concat(this.options.types||[]))]}}),bZ=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,yZ=Lt.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",wt(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[c4({find:bZ,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}}),wZ=["src","alt"],xZ={key:0,class:"image-resizer"},CZ=["onMousedown","onTouchstart"],kZ=o.defineComponent({__name:"ImageView",props:{...ta,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.inject("isMobile",!1),i=o.ref({width:ix,height:ix}),s=o.ref({width:0,height:0}),a=o.ref(!1),l=o.ref({x:0,y:0,w:0,h:0,dir:""}),u=o.computed(()=>{const{src:k,alt:T,width:_,height:A,flipX:V,flipY:O}=e.node.attrs,B=[];V&&B.push("rotateX(180deg)"),O&&B.push("rotateY(180deg)");const H=B.join(" ");return{src:k||void 0,alt:T||void 0,style:{width:fg(_)?`${_}px`:_,height:fg(A)?`${A}px`:A,transform:H||"none"}}});o.computed(()=>({width:o.unref(u).style.width==="100%"?"100%":void 0}));const c=o.ref(null),f=new ResizeObserver(k=>{for(const T of k){const{width:_,height:A}=T.contentRect;s.value={width:_,height:A},e.updateAttributes({originWidth:_,originHeight:A})}});function p(){const{editor:k,getPos:T}=e;k.commands.setNodeSelection(T())}const m=St.throttle(()=>{const{editor:k}=e;i.value.width=parseInt(getComputedStyle(k.view.dom).width,10)},sx);function g(k,T){k.preventDefault(),k.stopPropagation();let _=0,A=0;const V=document.querySelector(".image-resizer");if(V&&(V.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:O,height:B}=o.unref(s),H=O/B;let j=Number(e.node.attrs.width)||O,Y=Number(e.node.attrs.height)||Math.round(j/H);const N=o.unref(i).width;j=Math.min(j>N?N:j,N),Y=Math.round(j/H),Object.assign(l.value,{x:_,y:A,w:j,h:Y,dir:T}),a.value=!0,w()}const v=St.throttle(k=>{if(!o.unref(a))return;let T=0;if("touches"in k&&k.touches.length>0)T=k.touches[0].clientX;else if("clientX"in k)T=k.clientX;else return;const{x:_,w:A,dir:V}=o.unref(l),O=(T-_)*(/l/.test(V)?-1:1),B=vL(A+O,aL,o.unref(i).width);e.updateAttributes({width:B})},sx),b=k=>{k.preventDefault(),k.stopPropagation();const T=document.querySelector(".image-resizer");T&&(T.style.borderColor=""),o.unref(a)&&(a.value=!1,Object.assign(l.value,{x:0,y:0,w:0,h:0,dir:""}),x(),p())};function w(){document.addEventListener("mousemove",v,!0),document.addEventListener("mouseup",b,!0),document.addEventListener("touchmove",v,!0),document.addEventListener("touchend",b,!0)}function x(){document.removeEventListener("mousemove",v,!0),document.removeEventListener("mouseup",b,!0),document.removeEventListener("touchmove",v,!0),document.removeEventListener("touchend",b,!0)}const C=new ResizeObserver(m),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(()=>{c.value&&f.observe(c.value),C.observe(e.editor.view.dom)}),o.onBeforeUnmount(()=>{x(),f.disconnect(),C.disconnect()}),(k,T)=>(o.openBlock(),o.createBlock(o.unref(ea),{class:"node-image",style:o.normalizeStyle({"pointer-events":o.unref(r)&&t.selected?"none":"auto"})},{default:o.withCtx(()=>[o.createElementVNode("div",{class:"image-view",style:o.normalizeStyle([{width:u.value.style.width,height:u.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":a.value},"image-view__body"])},[o.createElementVNode("img",{ref_key:"imageRef",ref:c,src:u.value.src,alt:u.value.alt,class:"block w-full image-view__body__image",style:o.normalizeStyle([{transform:u.value.style.transform}]),onClick:p,onMousedown:T[0]||(T[0]=(..._)=>o.unref(ff)&&o.unref(ff)(..._))},null,44,wZ),k.editor.view.editable?o.withDirectives((o.openBlock(),o.createElementBlock("div",xZ,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.values(n),_=>(o.openBlock(),o.createElementBlock("span",{key:_,class:o.normalizeClass(o.unref(ke)(`image-resizer__handler--${_}`,"image-resizer__handler",o.unref(r)&&t.selected&&"pointer-events-auto")),onMousedown:A=>g(A,_),onTouchstart:o.withModifiers(A=>g(A,_),["prevent"])},null,42,CZ))),128))],512)),[[o.vShow,t.selected||a.value]]):o.createCommentVNode("",!0)],2)],4)]),_:1},8,["style"]))}}),EZ=Xr(kZ,[["__scopeId","data-v-db9342d0"]]),jc=yZ.extend({group:"block",defining:!0,isolating:!0,addAttributes(){return{...this.parent?.(),src:{default:null,parseHTML:t=>(t.tagName==="P"?t.querySelector("img"):t)?.getAttribute("src")},flipX:{default:!1},flipY:{default:!1},originWidth:{default:null},originHeight:{default:null},textAlign:{default:"left",parseHTML:t=>t.style.textAlign||t.getAttribute("textAlign")||null,renderHTML:t=>({textAlign:t.textAlign})},width:{default:"100%",parseHTML:t=>{const e=t.tagName==="P"?t.querySelector("img"):t,n=e&&(e.style.width||e.getAttribute("width"))||null;return n&&n.endsWith("%")?n:n==null?null:parseInt(n,10)},renderHTML:t=>({width:t.width})},height:{default:"auto",parseHTML:t=>{const e=t.style.height||t.getAttribute("height")||null;return e==null||e==="auto"?null:parseInt(e,10)},renderHTML:t=>({height:t.height})},class:{default:"",parseHTML:t=>t.getAttribute("class")||"",renderHTML:t=>({class:t.class})},"data-memo":{default:"",parseHTML:t=>t.getAttribute("data-memo")||"",renderHTML:t=>({"data-memo":t["data-memo"]})}}},addOptions(){return{...this.parent?.()}},addNodeView(){return na(EZ)},addCommands(){return{...this.parent?.(),updateImage:t=>({commands:e,editor:n})=>e.updateAttributes(this.name,t)}},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",wt(this.options.HTMLAttributes,e,{style:l})]},parseHTML(){return[{tag:"img[src]"},{tag:"p",priority:1001,getAttrs:t=>{const e=t;return e.children.length===1&&e.firstElementChild?.tagName==="IMG"&&!!!e.textContent?.trim()&&e.firstElementChild.hasAttribute("src")?null:!1}}]},addProseMirrorPlugins(){return[new ot({props:{handleTextInput(t){const{selection:e}=t.state;return e instanceof Re&&e.node.type.name==="image"},handlePaste(t){const{selection:e}=t.state;return e instanceof Re&&e.node.type.name==="image"}}})]}}),SZ=["paragraph","heading","list_item","todo_item"];function _Z(t,e){const{selection:n,doc:r}=t;if(!n||!r||!(n instanceof Ie||n instanceof An))return t;const{from:i,to:s}=n,a=[],l=e&&e!==ax?e:null;return r.nodesBetween(i,s,(u,c)=>{const f=u.type;return SZ.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 TZ(t){return({state:e,dispatch:n})=>{const{selection:r}=e;let{tr:i}=e;return i=i.setSelection(r),i=_Z(i,t),i.docChanged?(n&&n(i),!0):!1}}const AZ=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}=Pt();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.chain().focus().unsetLineHeight().run():s.editor.chain().focus().setLineHeight(l).run(),i.value=l}return(l,u)=>(o.openBlock(),o.createBlock(ga,{icon:l.icon,tooltip:l.tooltip,disabled:l.disabled,class:"inside-toolbar"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.value,(c,f)=>(o.openBlock(),o.createBlock(o.unref(Ml),{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"]))}}),kE=Qe.create({name:"lineHeight",addOptions(){return{...this.parent?.(),types:["paragraph","heading","list_item","todo_item"],lineHeights:["100%","115%","150%","200%","250%","300%"],defaultHeight:ax,button({editor:t,t:e}){return{component:AZ,componentProps:{editor:t,icon:"LineHeight",tooltip:e("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=>TZ(t),unsetLineHeight:()=>({commands:t})=>this.options.types.every(e=>t.resetAttributes(e,"lineHeight"))}}}),MZ=Lt.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",wt(t,{"data-type":"column"}),0]},parseHTML(){return[{tag:'div[data-type="column"]'}]}});var Ba=(t=>(t.SidebarLeft="sidebar-left",t.SidebarRight="sidebar-right",t.TwoColumn="two-column",t))(Ba||{});const Ab=Lt.create({name:"columns",group:"columns",content:"column+",defining:!0,isolating:!0,addOptions(){return{...this.parent?.(),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[MZ.configure(this.options.columnOptions)]}}),OZ={class:"flex gap-x-2 items-center"},BZ={class:"sr-only"},IZ={class:"flex justify-end gap-x-2.5 flex-1"},LZ=["disabled"],EE=Xr(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}=Pt(),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(()=>{if(!s.value)return!0;const g=document.createElement("div");return g.innerHTML=s.value,g?.textContent?.trim()===""});o.watch(()=>r.open,()=>{r.open&&r.superTextInit&&(s.value=r.superTextInit)},{immediate:!0});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,v)=>{const b=ch,w=uh,x=lh,C=ah,E=sb,k=Pc,T=Dc;return o.openBlock(),o.createBlock(T,{open:g.open},{default:o.withCtx(()=>[o.createVNode(k,{"is-overlay-transparent":"",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(x,{class:"text-left flex-row justify-between"},{default:o.withCtx(()=>[o.createVNode(b,{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",OZ,[o.withDirectives(o.createElementVNode("button",{onClick:m},[o.createVNode(o.unref(g1),{icon:"lucide:edit-2"})],512),[[o.vShow,l.value]]),o.createVNode(w,{class:"outline-none",onClick:f},{default:o.withCtx(()=>[o.createVNode(o.unref(cc),{class:"w-5 h-5"}),o.createElementVNode("span",BZ,o.toDisplayString(o.unref(i)("editor.close")),1)]),_:1})])]),_:1}),o.createVNode(C,{class:"hidden"}),o.createVNode(Eb,{modelValue:s.value,"onUpdate:modelValue":v[0]||(v[0]=_=>s.value=_),"is-read-only":l.value,"parent-editor":g.editor,"spellcheck-enabled":!1},null,8,["modelValue","is-read-only","parent-editor"]),o.createVNode(E,{class:"flex-row justify-between"},{default:o.withCtx(()=>[o.withDirectives(o.createElementVNode("button",{onClick:v[1]||(v[1]=_=>n("delete"))},o.toDisplayString(o.unref(i)("editor.delete")),513),[[o.vShow,u.value]]),o.withDirectives(o.createElementVNode("div",IZ,[o.createElementVNode("button",{onClick:f},o.toDisplayString(o.unref(i)("editor.menubar.menu.cancel")),1),o.createElementVNode("button",{disabled:o.unref(c),class:o.normalizeClass({"cursor-not-allowed":o.unref(c)}),onClick:p},o.toDisplayString(o.unref(i)("editor.menubar.menu.save")),11,LZ)],512),[[o.vShow,u.value||!l.value]])]),_:1})]),_:1})]),_:1},8,["open"])}}}),[["__scopeId","data-v-c6e8813c"]]),RZ=["innerHTML"],DZ=["book-mark-node-id","page-id","page-number","book-mark-content","node-id","line-id"],PZ=o.defineComponent({__name:"ConfigPlan",props:ta,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(ur.RENDER_SUPER_TEXT),c=o.computed(()=>{const C=s.resolve(i.from)?.node(-1),E=C?.attrs?.id,k=C?.attrs?.pageNumber;return{pageId:E,pageNumber:k}}),f=o.computed(()=>{const x=e.getPos(),C=e.editor.state.doc.resolve(x);for(let E=C.depth;E>0;E--){const k=C.node(E);if(k.type.name==="paragraph")return k}return null}),p=o.computed(()=>f.value?.attrs.id||"");function m(x){e.updateAttributes({"data-text":x}),n.value=!1}function g(x){const C=e.node.attrs[rt.TEXT],E=e.node.attrs[rt.ID],T={lineId:x.target.querySelector(`[node-id="${E}"]`).getAttribute("line-id"),text:C};u.emit({action:"hover",payload:T})}function v(x){const C=e.node.attrs[rt.ID],k={lineId:x.target.querySelector(`[node-id="${C}"]`).getAttribute("line-id"),text:""};u.emit({action:"hover",payload:k})}function b(){const{getPos:x,node:C,editor:E}=e,k=x(),T=k+1;E.commands.deleteRange({from:k,to:T})}function w(){n.value=!0,a&&(l.value=!0)}return(x,C)=>{const E=mn,k=ib,T=ob,_=rb,A=nb,V=Wc;return o.openBlock(),o.createBlock(o.unref(ea),{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(A,null,{default:o.withCtx(()=>[o.createVNode(k,{as:"template",class:"relative"},{default:o.withCtx(()=>[o.createVNode(E,{variant:"ghost",class:"!p-0 !m-0 !h-fit font-normal !text-ed-blue",onClick:w,onMouseenter:g,onMouseleave:v},{default:o.withCtx(()=>[o.createVNode(o.unref(Ot),{name:"plan",class:o.normalizeClass({"w-[18px] h-auto pr-1":o.unref(a)})},null,8,["class"]),C[3]||(C[3]=o.createTextVNode(" [")),o.createElementVNode("span",{class:"[&_*]:inline",innerHTML:e.node.attrs[o.unref(rt).TEXT]},null,8,RZ),C[4]||(C[4]=o.createTextVNode("] ")),o.createElementVNode("div",{ref_key:"bookMarkRef",ref:r,"book-mark-node-id":e.node.attrs[o.unref(rt).ID],"page-id":c.value.pageId,"page-number":c.value.pageNumber,"book-mark-content":e.node.attrs[o.unref(rt).TEXT],"node-id":e.node.attrs[o.unref(rt).ID],"line-id":p.value},null,8,DZ)]),_:1})]),_:1}),o.createVNode(_,null,{default:o.withCtx(()=>[o.createVNode(T,{onSelect:C[0]||(C[0]=O=>n.value=!0)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(x.$t("editor.configPlan.edit")),1)]),_:1}),o.createVNode(T,{onSelect:b},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(x.$t("editor.configPlan.delete")),1)]),_:1})]),_:1})]),_:1}),o.unref(a)?(o.openBlock(),o.createBlock(EE,{key:1,title:x.$t("editor.configPlan"),open:n.value,"is-view-mode":l.value,editor:e.editor,"super-text-init":e.node.attrs[o.unref(rt).TEXT],"super-text-id":e.node.attrs[o.unref(rt).ID],onClose:C[2]||(C[2]=O=>n.value=!1),onSave:m,onDelete:b},null,8,["title","open","is-view-mode","editor","super-text-init","super-text-id"])):(o.openBlock(),o.createBlock(V,{key:0,open:n.value,editor:e.editor,"super-text-init":e.node.attrs[o.unref(rt).TEXT],"super-text-element-id":e.node.attrs[o.unref(rt).ELEMENT_ID],onClose:C[1]||(C[1]=O=>n.value=!1),onSave:m},null,8,["open","editor","super-text-init","super-text-element-id"]))]),_:1},8,["class"])}}}),SE=Lt.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:Ge,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",wt(t,{class:"config-plan"})]},addNodeView(){return na(PZ)},addProseMirrorPlugins(){return[new ot({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 Mb,Ob;if(typeof WeakMap<"u"){let t=new WeakMap;Mb=e=>t.get(e),Ob=(e,n)=>(t.set(e,n),n)}else{const t=[];let n=0;Mb=r=>{for(let i=0;i<t.length;i+=2)if(t[i]==r)return t[i+1]},Ob=(r,i)=>(n==10&&(n=0),t[n++]=r,t[n++]=i)}var an=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 Mb(t)||Ob(t,VZ(t))}};function VZ(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=FZ(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 v=0;;v++){for(;i<r.length&&r[i]!=0;)i++;if(v==p.childCount)break;const b=p.child(v),{colspan:w,rowspan:x,colwidth:C}=b.attrs;for(let E=0;E<x;E++){if(E+c>=n){(s||(s=[])).push({type:"overlong_rowspan",pos:f,n:x-E});break}const k=i+E*e;for(let T=0;T<w;T++){r[k+T]==0?r[k+T]=f:(s||(s=[])).push({type:"collision",row:c,pos:f,n:w-T});const _=C&&C[T];if(_){const A=(k+T)%e*2,V=a[A];V==null||V!=_&&a[A+1]==1?(a[A]=_,a[A+1]=1):V==_&&a[A+1]++}}}i+=w,f+=b.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 an(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&&$Z(l,a,t),l}function FZ(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 $Z(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=HZ(u)))[c]=p)}l&&t.problems.unshift({type:"colwidth mismatch",pos:s,colwidth:l})}}function HZ(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function Wn(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 _s=new Et("selectingCells");function ql(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 zZ(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 bo(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 Eh(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=ql(e.$head)||UZ(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function UZ(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 Bb(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function WZ(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function Ib(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function _E(t,e,n){const r=t.node(-1),i=an.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 Ia(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 TE(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 jZ(t,e,n){const r=Wn(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 zt=class Di extends ze{constructor(e,n=e){const r=e.node(-1),i=an.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 a3(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(Bb(r)&&Bb(i)&&Ib(r,i)){const s=this.$anchorCell.node(-1)!=r.node(-1);return s&&this.isRowSelection()?Di.rowSelection(r,i):s&&this.isColSelection()?Di.colSelection(r,i):new Di(r,i)}return Ie.between(r,i)}content(){const e=this.$anchorCell.node(-1),n=an.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 v=e.nodeAt(m);if(!v)throw RangeError(`No cell with offset ${m} found`);const b=i.left-g.left,w=g.right-i.right;if(b>0||w>0){let x=v.attrs;if(b>0&&(x=Ia(x,0,b)),w>0&&(x=Ia(x,x.colspan-w,w)),g.left<i.left){if(v=v.type.createAndFill(x),!v)throw RangeError(`Could not create cell with attrs ${JSON.stringify(x)}`)}else v=v.type.create(x,v.content)}if(g.top<i.top||g.bottom>i.bottom){const x={...v.attrs,rowspan:Math.min(g.bottom,i.bottom)-Math.max(g.top,i.top)};g.top<i.top?v=v.type.createAndFill(x):v=v.type.create(x,v.content)}c.push(v)}a.push(e.child(u).copy(ge.from(c)))}const l=this.isColSelection()&&this.isRowSelection()?e:a;return new Se(ge.from(l),1,1)}replace(e,n=Se.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?Se.empty:n)}const s=ze.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);s&&e.setSelection(s)}replaceWith(e,n){this.replace(e,new Se(ge.from(n),0,0))}forEachCell(e){const n=this.$anchorCell.node(-1),r=an.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=an.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 Di(e,n)}isRowSelection(){const e=this.$anchorCell.node(-1),n=an.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 Di&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){const r=e.node(-1),i=an.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 Di(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new Di(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){return new Di(e.resolve(n),e.resolve(r))}getBookmark(){return new qZ(this.$anchorCell.pos,this.$headCell.pos)}};zt.prototype.visible=!1,ze.jsonID("cell",zt);var qZ=class lT{constructor(e,n){this.anchor=e,this.head=n}map(e){return new lT(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&&Ib(n,r)?new zt(n,r):ze.near(r,1)}};function KZ(t){if(!(t.selection instanceof zt))return null;const e=[];return t.selection.forEachCell((n,r)=>{e.push(jt.node(r,r+n.nodeSize,{class:"selectedCell"}))}),lt.create(t.doc,e)}function GZ({$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 XZ({$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 YZ(t,e,n){const r=(e||t).selection,i=(e||t).doc;let s,a;if(r instanceof Re&&(a=r.node.type.spec.tableRole)){if(a=="cell"||a=="header_cell")s=zt.create(i,r.from);else if(a=="row"){const l=i.resolve(r.from+1);s=zt.rowSelection(l,l)}else if(!n){const l=an.get(r.node),u=r.from+1,c=u+l.map[l.width*l.height-1];s=zt.create(i,u+1,c)}}else r instanceof Ie&&GZ(r)?s=Ie.create(i,r.from):r instanceof Ie&&XZ(r)&&(s=Ie.create(i,r.$from.start(),r.$from.end()));return s&&(e||(e=t.tr)).setSelection(s),e}var JZ=new Et("fix-tables");function AE(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)?AE(t.child(l),u,n+1,r):u.nodesBetween(0,u.content.size,r,n+1),n+=u.nodeSize}}function ME(t,e){let n;const r=(i,s)=>{i.type.spec.tableRole=="table"&&(n=ZZ(t,i,s,n))};return e?e.doc!=t.doc&&AE(e.doc,t.doc,0,r):t.doc.descendants(r),n}function ZZ(t,e,n,r){const i=an.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,Ia(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 v=[];for(let w=0;w<m;w++){const x=Wn(t.schema)[g].createAndFill();x&&v.push(x)}const b=(u==0||a==u-1)&&l==u?c+1:p-1;r.insert(r.mapping.map(b),v)}c=p}return r.setMeta(JZ,{fixTables:!0})}function Ko(t){const e=t.selection,n=Eh(t),r=n.node(-1),i=n.start(-1),s=an.get(r);return{...e instanceof zt?s.rectBetween(e.$anchorCell.pos-i,e.$headCell.pos-i):s.findCell(n.pos-i),tableStart:i,map:s,table:r}}function OE(t,{map:e,tableStart:n,table:r},i){let s=i>0?-1:0;jZ(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,TE(c.attrs,i-e.colCount(u))),a+=c.attrs.rowspan-1}else{const u=s==null?Wn(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 QZ(t,e){if(!bo(t))return!1;if(e){const n=Ko(t);e(OE(t.tr,n,n.left))}return!0}function NZ(t,e){if(!bo(t))return!1;if(e){const n=Ko(t);e(OE(t.tr,n,n.right))}return!0}function eQ(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,Ia(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 tQ(t,e){if(!bo(t))return!1;if(e){const n=Ko(t),r=t.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let i=n.right-1;eQ(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=an.get(s)}e(r)}return!0}function nQ(t,e,n){var r;const i=Wn(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 BE(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;nQ(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?Wn(r.type.schema).cell:(s=r.nodeAt(e.map[f+u*e.width]))==null?void 0:s.type,m=p?.createAndFill();m&&l.push(m)}return t.insert(a,Wn(r.type.schema).row.create(null,l)),t}function rQ(t,e){if(!bo(t))return!1;if(e){const n=Ko(t);e(BE(t.tr,n,n.top))}return!0}function oQ(t,e){if(!bo(t))return!1;if(e){const n=Ko(t);e(BE(t.tr,n,n.bottom))}return!0}function iQ(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,v=m.type.create({...g,rowspan:m.attrs.rowspan-1},m.content),b=e.positionAt(i+1,c,n);t.insert(t.mapping.slice(l).map(r+b),v),c+=g.colspan-1}}}}function sQ(t,e){if(!bo(t))return!1;if(e){const n=Ko(t),r=t.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let i=n.bottom-1;iQ(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=an.get(n.table)}e(r)}return!0}function IE(t){const e=t.content;return e.childCount==1&&e.child(0).isTextblock&&e.child(0).childCount==0}function aQ({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 LE(t,e){const n=t.selection;if(!(n instanceof zt)||n.$anchorCell.pos==n.$headCell.pos)return!1;const r=Ko(t),{map:i}=r;if(aQ(i,r))return!1;if(e){const s=t.tr,a={};let l=ge.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{IE(g)||(l=l.append(g.content));const v=s.mapping.map(m+r.tableStart);s.delete(v,v+g.nodeSize)}}if(u==null||c==null)return!0;if(s.setNodeMarkup(u+r.tableStart,null,{...TE(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=IE(c)?u+1:f;s.replaceWith(p+r.tableStart,f+r.tableStart,l)}s.setSelection(new zt(s.doc.resolve(u+r.tableStart))),e(s)}return!0}function RE(t,e){const n=Wn(t.schema);return lQ(({node:r})=>n[r.type.spec.tableRole])(t,e)}function lQ(t){return(e,n)=>{var r;const i=e.selection;let s,a;if(i instanceof zt){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;s=i.$anchorCell.nodeAfter,a=i.$anchorCell.pos}else{if(s=zZ(i.$from),!s)return!1;a=(r=ql(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=Ko(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 v=f.map.positionAt(g,f.left,f.table);g==f.top&&(v+=s.nodeSize);for(let b=f.left,w=0;b<f.right;b++,w++)b==f.left&&g==f.top||p.insert(m=p.mapping.map(v+f.tableStart,1),t({node:s,row:g,col:b}).createAndFill(u[w]))}p.setNodeMarkup(a,t({node:s,row:f.top,col:f.left}),u[0]),i instanceof zt&&p.setSelection(new zt(p.doc.resolve(i.$anchorCell.pos),m?p.doc.resolve(m):void 0)),n(p)}return!0}}function uQ(t,e){return function(n,r){if(!bo(n))return!1;const i=Eh(n);if(i.nodeAfter.attrs[t]===e)return!1;if(r){const s=n.tr;n.selection instanceof zt?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 cQ(t){return function(e,n){if(!bo(e))return!1;if(n){const r=Wn(e.schema),i=Ko(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 DE(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 qc(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?cQ(t):function(n,r){if(!bo(n))return!1;if(r){const i=Wn(n.schema),s=Ko(n),a=n.tr,l=DE("row",s,i),u=DE("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 v=g+s.tableStart,b=a.doc.nodeAt(v);b&&a.setNodeMarkup(v,m,b.attrs)}),r(a)}return!0}}qc("row",{useDeprecatedLogic:!0}),qc("column",{useDeprecatedLogic:!0});var dQ=qc("cell",{useDeprecatedLogic:!0});function fQ(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 PE(t){return function(e,n){if(!bo(e))return!1;const r=fQ(Eh(e),t);if(r==null)return!1;if(n){const i=e.doc.resolve(r);n(e.tr.setSelection(Ie.between(i,WZ(i))).scrollIntoView())}return!0}}function pQ(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 Sh(t,e){const n=t.selection;if(!(n instanceof zt))return!1;if(e){const r=t.tr,i=Wn(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 Se(i,0,0))}),r.docChanged&&e(r)}return!0}function hQ(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=Lb(Wn(a).row,new Se(c,f,p)).content),l.push(c)}else if(s=="cell"||s=="header_cell")l.push(n||r?Lb(Wn(a).row,new Se(e,n,r)).content:e);else return null;return mQ(a,l)}function mQ(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(ge.empty),n[i]<r){const s=Wn(t).cell.createAndFill(),a=[];for(let l=n[i];l<r;l++)a.push(s);e[i]=e[i].append(ge.from(a))}return{height:e.length,width:r,rows:e}}function Lb(t,e){const n=t.createAndFill();return new Gm(n).replace(0,n.content.size,e).doc}function gQ({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(Ia(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(ge.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(ge.from(u))}n=s,e=i}return{width:t,height:e,rows:n}}function vQ(t,e,n,r,i,s,a){const l=t.doc.type.schema,u=Wn(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 v=[];let b;g.lastChild==null||g.lastChild.type==u.cell?b=c||(c=u.cell.createAndFill()):b=f||(f=u.header_cell.createAndFill());for(let w=e.width;w<i;w++)v.push(b);t.insert(t.mapping.slice(a).map(m-1+r),v)}if(s>e.height){const p=[];for(let v=0,b=(e.height-1)*e.width;v<Math.max(e.width,i);v++){const w=v>=e.width?!1:n.nodeAt(e.map[b+v]).type==u.header_cell;p.push(w?f||(f=u.header_cell.createAndFill()):c||(c=u.cell.createAndFill()))}const m=u.row.create(null,ge.from(p)),g=[];for(let v=e.height;v<s;v++)g.push(m);t.insert(t.mapping.slice(a).map(r+n.nodeSize-2),g)}return!!(c||f)}function VE(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:v}=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,v,n)),m.type.createAndFill({...m.attrs,rowspan:g+m.attrs.rowspan-a})),c+=m.attrs.colspan-1}}return u}function FE(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),v=t.mapping.slice(l).map(p+r);t.setNodeMarkup(v,null,Ia(m.attrs,a-g,m.attrs.colspan-(a-g))),t.insert(v+m.nodeSize,m.type.createAndFill(Ia(m.attrs,0,a-g))),c+=m.attrs.rowspan-1}}return u}function $E(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=an.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=an.get(s),m=p.mapping.maps.length}vQ(p,a,s,n,c,f,m)&&g(),VE(p,a,s,n,u,c,l,m)&&g(),VE(p,a,s,n,u,c,f,m)&&g(),FE(p,a,s,n,l,f,u,m)&&g(),FE(p,a,s,n,l,f,c,m)&&g();for(let v=l;v<f;v++){const b=a.positionAt(v,u,s),w=a.positionAt(v,c,s);p.replace(p.mapping.slice(m).map(b+n),p.mapping.slice(m).map(w+n),new Se(i.rows[v-l],0,0))}g(),p.setSelection(new zt(p.doc.resolve(n+a.positionAt(l,u,s)),p.doc.resolve(n+a.positionAt(f-1,c-1,s)))),e(p)}var bQ=E0({ArrowLeft:Th("horiz",-1),ArrowRight:Th("horiz",1),ArrowUp:Th("vert",-1),ArrowDown:Th("vert",1),"Shift-ArrowLeft":Ah("horiz",-1),"Shift-ArrowRight":Ah("horiz",1),"Shift-ArrowUp":Ah("vert",-1),"Shift-ArrowDown":Ah("vert",1),Backspace:Sh,"Mod-Backspace":Sh,Delete:Sh,"Mod-Delete":Sh});function _h(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function Th(t,e){return(n,r,i)=>{if(!i)return!1;const s=n.selection;if(s instanceof zt)return _h(n,r,ze.near(s.$headCell,e));if(t!="horiz"&&!s.empty)return!1;const a=HE(i,t,e);if(a==null)return!1;if(t=="horiz")return _h(n,r,ze.near(n.doc.resolve(s.head+e),e));{const l=n.doc.resolve(a),u=_E(l,t,e);let c;return u?c=ze.near(u,1):e<0?c=ze.near(n.doc.resolve(l.before(-1)),-1):c=ze.near(n.doc.resolve(l.after(-1)),1),_h(n,r,c)}}}function Ah(t,e){return(n,r,i)=>{if(!i)return!1;const s=n.selection;let a;if(s instanceof zt)a=s;else{const u=HE(i,t,e);if(u==null)return!1;a=new zt(n.doc.resolve(u))}const l=_E(a.$headCell,t,e);return l?_h(n,r,new zt(a.$anchorCell,l)):!1}}function yQ(t,e){const n=t.state.doc,r=ql(n.resolve(e));return r?(t.dispatch(t.state.tr.setSelection(new zt(r))),!0):!1}function wQ(t,e,n){if(!bo(t.state))return!1;let r=hQ(n);const i=t.state.selection;if(i instanceof zt){r||(r={width:1,height:1,rows:[ge.from(Lb(Wn(t.state.schema).cell,n))]});const s=i.$anchorCell.node(-1),a=i.$anchorCell.start(-1),l=an.get(s).rectBetween(i.$anchorCell.pos-a,i.$headCell.pos-a);return r=gQ(r,l.right-l.left,l.bottom-l.top),$E(t.state,t.dispatch,a,l,r),!0}else if(r){const s=Eh(t.state),a=s.start(-1);return $E(t.state,t.dispatch,a,an.get(s.node(-1)).findCell(s.pos-a),r),!0}else return!1}function xQ(t,e){var n;if(e.ctrlKey||e.metaKey)return;const r=zE(t,e.target);let i;if(e.shiftKey&&t.state.selection instanceof zt)s(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(i=ql(t.state.selection.$anchor))!=null&&((n=Rb(t,e))==null?void 0:n.pos)!=i.pos)s(i,e),e.preventDefault();else if(!r)return;function s(u,c){let f=Rb(t,c);const p=_s.getState(t.state)==null;if(!f||!Ib(u,f))if(p)f=u;else return;const m=new zt(u,f);if(p||!t.state.selection.eq(m)){const g=t.state.tr.setSelection(m);p&&g.setMeta(_s,u.pos),t.dispatch(g)}}function a(){t.root.removeEventListener("mouseup",a),t.root.removeEventListener("dragstart",a),t.root.removeEventListener("mousemove",l),_s.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(_s,-1))}function l(u){const c=u,f=_s.getState(t.state);let p;if(f!=null)p=t.state.doc.resolve(f);else if(zE(t,c.target)!=r&&(p=Rb(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 HE(t,e,n){if(!(t.state.selection instanceof Ie))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 zE(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function Rb(t,e){const n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?ql(t.state.doc.resolve(n.pos)):null}var CQ=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")),Db(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,Db(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function Db(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:v}=f.child(p).attrs;for(let b=0;b<g;b++,m++){const w=i==m?s:v&&v[b],x=w?w+"px":"";if(l+=w||r,w||(u=!1),c)c.style.width!=x&&(c.style.width=x),c=c.nextSibling;else{const C=document.createElement("col");C.style.width=x,e.appendChild(C)}}}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 Er=new Et("tableColumnResizing");function kQ({handleWidth:t=5,cellMinWidth:e=25,defaultCellMinWidth:n=100,View:r=CQ,lastColumnResizable:i=!0}={}){const s=new ot({key:Er,state:{init(a,l){var u,c;const f=(c=(u=s.spec)==null?void 0:u.props)==null?void 0:c.nodeViews,p=Wn(l.schema).table.name;return r&&f&&(f[p]=(m,g)=>new r(m,n,g)),new EQ(-1,!1)},apply(a,l){return l.apply(a)}},props:{attributes:a=>{const l=Er.getState(a);return l&&l.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(a,l)=>{SQ(a,l,t,i)},mouseleave:a=>{_Q(a)},mousedown:(a,l)=>{TQ(a,l,e,n)}},decorations:a=>{const l=Er.getState(a);if(l&&l.activeHandle>-1)return IQ(a,l.activeHandle)},nodeViews:{}}});return s}var EQ=class Om{constructor(e,n){this.activeHandle=e,this.dragging=n}apply(e){const n=this,r=e.getMeta(Er);if(r&&r.setHandle!=null)return new Om(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new Om(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&e.docChanged){let i=e.mapping.map(n.activeHandle,-1);return Bb(e.doc.resolve(i))||(i=-1),new Om(i,n.dragging)}return n}};function SQ(t,e,n,r){if(!t.editable)return;const i=Er.getState(t.state);if(i&&!i.dragging){const s=MQ(e.target);let a=-1;if(s){const{left:l,right:u}=s.getBoundingClientRect();e.clientX-l<=n?a=UE(t,e,"left",n):u-e.clientX<=n&&(a=UE(t,e,"right",n))}if(a!=i.activeHandle){if(!r&&a!==-1){const l=t.state.doc.resolve(a),u=l.node(-1),c=an.get(u),f=l.start(-1);if(c.colCount(l.pos-f)+l.nodeAfter.attrs.colspan-1==c.width-1)return}jE(t,a)}}}function _Q(t){if(!t.editable)return;const e=Er.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&jE(t,-1)}function TQ(t,e,n,r){var i;if(!t.editable)return!1;const s=(i=t.dom.ownerDocument.defaultView)!=null?i:window,a=Er.getState(t.state);if(!a||a.activeHandle==-1||a.dragging)return!1;const l=t.state.doc.nodeAt(a.activeHandle),u=AQ(t,a.activeHandle,l.attrs);t.dispatch(t.state.tr.setMeta(Er,{setDragging:{startX:e.clientX,startWidth:u}}));function c(p){s.removeEventListener("mouseup",c),s.removeEventListener("mousemove",f);const m=Er.getState(t.state);m?.dragging&&(OQ(t,m.activeHandle,WE(m.dragging,p,n)),t.dispatch(t.state.tr.setMeta(Er,{setDragging:null})))}function f(p){if(!p.which)return c(p);const m=Er.getState(t.state);if(m&&m.dragging){const g=WE(m.dragging,p,n);qE(t,m.activeHandle,g,r)}}return qE(t,a.activeHandle,u,r),s.addEventListener("mouseup",c),s.addEventListener("mousemove",f),e.preventDefault(),!0}function AQ(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 MQ(t){for(;t&&t.nodeName!="TD"&&t.nodeName!="TH";)t=t.classList&&t.classList.contains("ProseMirror")?null:t.parentNode;return t}function UE(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=ql(t.state.doc.resolve(a));if(!l)return-1;if(n=="right")return l.pos;const u=an.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 WE(t,e,n){const r=e.clientX-t.startX;return Math.max(n,t.startWidth+r)}function jE(t,e){t.dispatch(t.state.tr.setMeta(Er,{setHandle:e}))}function OQ(t,e,n){const r=t.state.doc.resolve(e),i=r.node(-1),s=an.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 v=m.colwidth?m.colwidth.slice():BQ(m.colspan);v[g]=n,u.setNodeMarkup(a+p,null,{...m,colwidth:v})}u.docChanged&&t.dispatch(u)}function qE(t,e,n,r){const i=t.state.doc.resolve(e),s=i.node(-1),a=i.start(-1),l=an.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&&Db(s,u.firstChild,u,r,l,n)}function BQ(t){return Array(t).fill(0)}function IQ(t,e){var n;const r=[],i=t.doc.resolve(e),s=i.node(-1);if(!s)return lt.empty;const a=an.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=Er.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 lt.create(t.doc,r)}function LQ({allowTableNodeSelection:t=!1}={}){return new ot({key:_s,state:{init(){return null},apply(e,n){const r=e.getMeta(_s);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:KZ,handleDOMEvents:{mousedown:xQ},createSelectionBetween(e){return _s.getState(e.state)!=null?e.state.selection:null},handleTripleClick:yQ,handleKeyDown:bQ,handlePaste:wQ},appendTransaction(e,n,r){return YZ(r,ME(r,n),t)}})}const RQ=(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)},DQ=(t,e,n)=>{const{doc:r,selection:i}=t;return!r||!i||!(i instanceof zt)||i.forEachCell((s,a)=>{t=RQ(t,a,n)}),t},KE=(t,e)=>({tr:n,state:r,dispatch:i})=>{const{selection:s}=r;return n=n.setSelection(s),n=DQ(n,e,t),n.docChanged?(i?.(n),!0):!1},PQ=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=>KE(t,this.options),unsetTableCellBackground:()=>KE("",this.options)}}}),VQ=Lt.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",wt(this.options.HTMLAttributes,t),0]}}),FQ=Lt.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",wt(this.options.HTMLAttributes,t),0]}}),$Q=Lt.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",wt(this.options.HTMLAttributes,t),0]}});function Pb(t,e){return e?["width",`${Math.max(e,t)}px`]:["min-width",`${t}px`]}function GE(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:v}=f.child(p).attrs;for(let b=0;b<g;b+=1,m+=1){const w=i===m?s:v&&v[b],x=w?`${w}px`:"";if(l+=w||r,w||(u=!1),c){if(c.style.width!==x){const[C,E]=Pb(r,w);c.style.setProperty(C,E)}c=c.nextSibling}else{const C=document.createElement("col"),[E,k]=Pb(r,w);C.style.setProperty(E,k),e.appendChild(C)}}}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 HQ{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")),GE(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,GE(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return e.type==="attributes"&&(e.target===this.table||this.colgroup.contains(e.target))}}function zQ(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:v}=l.child(p).attrs;for(let b=0;b<g;b+=1,m+=1){const w=n===m?r:v&&v[b];i+=w||e,w||(s=!1);const[x,C]=Pb(e,w);a.push(["col",{style:`${x}: ${C}`}])}}const u=s?`${i}px`:"",c=s?"":`${i}px`;return{colgroup:["colgroup",{},...a],tableWidth:u,tableMinWidth:c}}function XE(t,e){return t.createAndFill()}function UQ(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 WQ(t,e,n,r,i){const s=UQ(t),a=[],l=[];for(let c=0;c<n;c+=1){const f=XE(s.cell);if(f&&l.push(f),r){const p=XE(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 jQ(t){return t instanceof zt}const Mh=({editor:t})=>{const{selection:e}=t.state;if(!jQ(e))return!1;let n=0;const r=r4(e.ranges[0].$from,s=>s.type.name==="table");return 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},qQ=Lt.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:HQ,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}=zQ(t,this.options.cellMinWidth);return["table",wt(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=WQ(s.schema,t,e,n);if(i){const l=r.selection.from+1;r.replaceSelectionWith(a).scrollIntoView().setSelection(Ie.near(r.doc.resolve(l)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>QZ(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>NZ(t,e),deleteColumn:()=>({state:t,dispatch:e})=>tQ(t,e),addRowBefore:()=>({state:t,dispatch:e})=>rQ(t,e),addRowAfter:()=>({state:t,dispatch:e})=>oQ(t,e),deleteRow:()=>({state:t,dispatch:e})=>sQ(t,e),deleteTable:()=>({state:t,dispatch:e})=>pQ(t,e),mergeCells:()=>({state:t,dispatch:e})=>LE(t,e),splitCell:()=>({state:t,dispatch:e})=>RE(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>qc("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>qc("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>dQ(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>LE(t,e)?!0:RE(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:r})=>uQ(t,e)(n,r),goToNextCell:()=>({state:t,dispatch:e})=>PE(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>PE(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&ME(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){const r=zt.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:Mh,"Mod-Backspace":Mh,Delete:Mh,"Mod-Delete":Mh}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[kQ({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],LQ({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(t){const e={name:t.name,options:t.options,storage:t.storage};return{tableRole:pt(Fe(t,"tableRole",e))}}}),KQ=/(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,GQ=/CrOS/,XQ=/android|ipad|playbook|silk/i;function YE(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:!!(KQ.test(e)&&!GQ.test(e)||t.tablet&&XQ.test(e)||t.tablet&&t.featureDetect&&navigator&&navigator.maxTouchPoints>1&&e.includes("Macintosh")&&e.includes("Safari"))}const YQ=["disabled"],JQ={"content-class":"table-grid-size-editor","content-style":"padding:0"},ZQ={class:"flex flex-col flex-wrap gap-1 justify-between"},QQ=["onMouseover","onMousedown"],NQ={class:"text-center text-sm text-zinc-600 mt-2"},eN=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:YE()?lf:af,cols:YE()?lf:af}),a=o.reactive({rows:uf,cols:uf});function l(g,v){g===s.rows&&(s.rows=Math.min(g+1,lf)),v===s.cols&&(s.cols=Math.min(v+1,lf)),a.rows=g,a.cols=v}function u(g,v){n("create-table",{rows:g,cols:v,withHeaderRow:o.unref(i)}),c()}function c(){r.value=!1,i.value=!1,s.rows=af,s.cols=af,a.rows=uf,a.cols=uf}const f=o.inject("isMobile",!1),{isOpen:p}=Nf({scrollEl:"tool-bar-format-scroll",ignoreSelector:"[data-radix-popper-content-wrapper]"}),m=o.computed(()=>f?{modal:!1,open:p.value,"onUpdate:open":g=>p.value=g}:{});return(g,v)=>(o.openBlock(),o.createBlock(o.unref(ms),o.normalizeProps(o.guardReactiveProps(o.unref(m))),{default:o.withCtx(()=>[o.createVNode(o.unref(Ca),{"as-child":""},{default:o.withCtx(()=>[o.createElementVNode("button",{disabled:t.disabled,class:"m-0 p-0"},[o.renderSlot(g.$slots,"trigger")],8,YQ)]),_:3}),o.createVNode(o.unref(gs),{class:"w-full",align:"start",side:"bottom"},{default:o.withCtx(()=>[o.createElementVNode("div",JQ,[o.createElementVNode("div",ZQ,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(s.rows,b=>(o.openBlock(),o.createElementBlock("div",{key:"r"+b,class:"flex gap-1"},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(s.cols,w=>(o.openBlock(),o.createElementBlock("div",{key:"c"+w,class:o.normalizeClass([[w<=a.cols&&b<=a.rows&&"bg-ed-foreground border-ed-border","cursor-pointer"],"pa-1"]),onMouseover:x=>l(b,w),onMousedown:x=>u(b,w)},v[0]||(v[0]=[o.createElementVNode("div",{class:"w-4 h-4 p-1 border box-border"},null,-1)]),42,QQ))),128))]))),128))]),o.createElementVNode("div",NQ,o.toDisplayString(a.rows)+" x "+o.toDisplayString(a.cols),1)])]),_:1})]),_:3},16))}}),tN={style:{display:"flex"}},nN=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(eN,{disabled:r.editor.isActive("table"),onCreateTable:n},{trigger:o.withCtx(()=>[o.createElementVNode("div",tN,[o.createVNode(Ge,{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"]))}}),Vb=qQ.extend({addStorage(){return{isTableMenuOpen:!1}},addCommands(){return{...this.parent?.(),toggleTableEditor:t=>({editor:e})=>e.storage.table?(e.storage.table.isTableEditorOpen=t,!0):!1}},addOptions(){return{...this.parent?.(),resizable:!0,lastColumnResizable:!0,allowTableNodeSelection:!1,button:({editor:t,t:e})=>({component:nN,componentProps:{icon:"Table",tooltip:e("editor.table.tooltip"),action:()=>{const n=t.storage.table?.isTableEditorOpen??!1;t.commands.toggleTableEditor(!n)}}})}},addExtensions(){return[FQ.configure(this.options.tableRow),VQ.configure(this.options.tableHeader),$Q.configure(this.options.tableCell),PQ.configure(this.options.tableCellBackground)]}}),rN={class:"flex items-center gap-2 px-2"},oN=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}=Pt(),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)=>(o.openBlock(),o.createBlock(ga,{title:i.value?.label,"side-offset":5},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.value,(l,u)=>(o.openBlock(),o.createBlock(o.unref(Ml),{key:u,class:"cursor-pointer",checked:l.isActive?.()||!1,onClick:l.action},{default:o.withCtx(()=>[o.createElementVNode("div",rN,[o.createVNode(o.unref(Ot),{name:l.iconName,class:"h3 w-3"},null,8,["name"]),o.createElementVNode("span",null,o.toDisplayString(l.label),1)])]),_:2},1032,["checked","onClick"]))),128))]),_:1},8,["title"]))}}),iN=Qe.create({name:"text-bubble",addOptions(){return{...this.parent?.(),toolbar:!1,button:()=>({component:oN,componentProps:{}})}}}),sN=[{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}년"}],JE=t=>{const e=[...t||[],...sN.map(n=>n.pattern)].join("|");return new RegExp(e,"gu")},aN=Qe.create({name:ih,addOptions(){return{additionalTimeWords:[],enabled:!0}},addStorage(){return{cachedRegex:null,cachedAdditionalWords:null,enabled:this.options.enabled}},addProseMirrorPlugins(){return[new ot({props:{decorations:t=>{if(!this.storage.enabled)return lt.empty;const e=[];return(this.storage.cachedAdditionalWords!==this.options.additionalTimeWords||!this.storage.cachedRegex)&&(this.storage.cachedAdditionalWords=this.options.additionalTimeWords,this.storage.cachedRegex=JE(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"}))}}),lt.create(t.doc,e)}}})]},addCommands(){return{toggleTimeHighlight:()=>({editor:t})=>{const e=t.storage[ih];return e.enabled=!e.enabled,t.view.dispatch(t.state.tr),!0}}}});function Fb(t){const e=JSON.stringify(t),n=window.ReactNativeWebView;if(n){n.postMessage(e);return}console.warn("[clipboardBridge] no bridge found")}function lN(){return new Promise(t=>{const e=window.receiveDriverData;window.receiveDriverData=n=>{e&&e(n);let r;try{r=typeof n=="string"?JSON.parse(n):n}catch{return}r?.type==="CLIPBOARD_STATE"&&t(!!r.data?.hasClipboard)},Fb({type:"REQUEST_CLIPBOARD_STATE"})})}function uN(){return new Promise(t=>{const e=window.receiveDriverData;window.receiveDriverData=n=>{e&&e(n);let r;try{r=typeof n=="string"?JSON.parse(n):n}catch{return}r?.type==="PASTE_RESULT"&&t(r.data?.text??null)},Fb({type:"PASTE"})})}function cN(t,e){Fb({type:"COPY",data:{html:t,text:e}})}async function dN(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 fN(){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 pN=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=Ir.fromSchema(t.schema).serializeFragment(i.content),l=document.createElement("div");l.appendChild(a);const u=l.innerHTML,c=e.doc.textBetween(n,r,`
|
|
344
|
-
`);t.storage.deviceEnv.isMobile?cN(u,c):await dN(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 uN():await fN();if(!e)return;const n=new DataTransfer;if(BJ(e)){n.setData("text/html",e);const i=document.createElement("div");i.innerHTML=e,n.setData("text/plain",i.innerText)}else 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 lN():await navigator.clipboard.readText())}catch(e){return console.warn("[clipboard] check failed",e),!1}}}}),hN=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})=>(e.storage.deviceEnv.isMobile=t,e.storage.spellchecker?.spellchecker.setIsMobile(t),!0),setForceCloseBubble:t=>({editor:e})=>(e.storage.deviceEnv.isForceCloseBubble=t,!0),resetForceCloseBubble:()=>({editor:t})=>(t.storage.deviceEnv.isForceCloseBubble=!1,!0)}}}),Oh=o.defineComponent({__name:"Tabs",props:{defaultValue:{},orientation:{},dir:{},activationMode:{},modelValue:{},asChild:{type:Boolean},as:{}},emits:["update:modelValue"],setup(t,{emit:e}){const i=Rt(t,e);return(s,a)=>(o.openBlock(),o.createBlock(o.unref(nF),o.normalizeProps(o.guardReactiveProps(o.unref(i))),{default:o.withCtx(()=>[o.renderSlot(s.$slots,"default")]),_:3},16))}}),mN={class:"truncate"},Kl=o.defineComponent({__name:"TabsTrigger",props:{value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,n=o.computed(()=>{const{class:i,...s}=e;return s}),r=Jn(n);return(i,s)=>(o.openBlock(),o.createBlock(o.unref(iF),o.mergeProps(o.unref(r),{class:o.unref(ke)("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-ed-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ed-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-ed-background data-[state=active]:text-ed-foreground data-[state=active]:shadow-sm",e.class)}),{default:o.withCtx(()=>[o.createElementVNode("span",mN,[o.renderSlot(i.$slots,"default")])]),_:3},16,["class"]))}}),Bh=o.defineComponent({__name:"TabsList",props:{loop:{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(rF),o.mergeProps(n.value,{class:o.unref(ke)("inline-flex items-center justify-center rounded-md bg-ed-muted p-1 text-ed-muted-foreground",e.class)}),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),Ih=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(oF),o.mergeProps({class:o.unref(ke)("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"]))}}),gN={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"},vN={key:0,class:"flex justify-center items-center gap-3 text-s"},bN={key:1,class:"flex justify-between items-center w-full"},yN={class:"flex justify-center items-center gap-3"},wN={class:"text-sm"},xN={class:"flex items-center gap-2"},CN=o.defineComponent({__name:"VideoUploader",props:{...ta},setup(t){const e=t,n=o.inject("isEditable",o.ref(!0)),r=o.ref(""),i=o.ref(!1),s=o.ref(),{t:a}=Pt();function l(p){i.value=!0;const m=p.target,g=Array.from(m?.files||[]),v=e.editor.extensionManager.extensions.find(w=>w.name==="videoUpload")?.options;if(!e.editor||e.editor.isDestroyed||g.length===0||typeof v?.upload!="function")return;const b=g[0];v.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(),i.value=!1})}function u(){e.editor.chain().setVideo({src:r.value,width:640}).deleteRange({from:e.getPos(),to:e.getPos()}).insertContentAt(e.getPos()+1,{type:"paragraph"}).focus().run()}function c(){e.deleteNode()}function f(){s.value?.click()}return(p,m)=>(o.openBlock(),o.createBlock(o.unref(ea),{as:"div","data-drag-handle":"",class:o.normalizeClass(o.unref(ke)(!o.unref(n)&&"pointer-events-none"))},{default:o.withCtx(()=>[o.createVNode(o.unref(ms),{"default-open":o.unref(n)},{default:o.withCtx(()=>[o.createVNode(o.unref(Ca),{"as-child":""},{default:o.withCtx(()=>[o.createElementVNode("div",gN,[i.value?(o.openBlock(),o.createElementBlock("div",vN,[o.createVNode(o.unref(Ot),{class:"animate-spin w-6 h-6",name:"LoaderCircle"}),o.createElementVNode("span",null,o.toDisplayString(o.unref(a)("editor.video.dialog.uploading"))+"...",1)])):(o.openBlock(),o.createElementBlock("div",bN,[o.createElementVNode("div",yN,[o.createVNode(o.unref(Ot),{name:"Video",class:"w-6 h-6"}),o.createElementVNode("span",wN,o.toDisplayString(o.unref(a)("editor.video.dialog.title")),1)]),o.createVNode(o.unref(Ot),{name:"Trash2",class:"hover:text-ed-foreground",onClick:o.withModifiers(c,["stop"])})]))])]),_:1}),o.createVNode(o.unref(gs),{"trap-focus":"",class:"w-full","on-open-auto-focus":g=>g.preventDefault()},{default:o.withCtx(()=>[o.createVNode(o.unref(Oh),{"default-value":"upload",class:"w-[300px] sm:w-[400px]","activation-mode":"manual"},{default:o.withCtx(()=>[o.createVNode(o.unref(Bh),{class:"grid w-full grid-cols-2"},{default:o.withCtx(()=>[o.createVNode(o.unref(Kl),{value:"upload"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(a)("editor.video.dialog.tab.upload")),1)]),_:1}),o.createVNode(o.unref(Kl),{value:"link",disabled:i.value},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(a)("editor.video.dialog.link")),1)]),_:1},8,["disabled"])]),_:1}),o.createVNode(o.unref(Ih),{value:"upload"},{default:o.withCtx(()=>[o.createVNode(o.unref(mn),{class:"w-full mt-1",size:"sm",disabled:i.value,onClick:f},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(a)("editor.video.dialog.tab.upload")),1)]),_:1},8,["disabled"]),o.createElementVNode("input",{ref_key:"fileInput",ref:s,type:"file",accept:"video/*",hidden:"",onChange:l},null,544)]),_:1}),o.createVNode(o.unref(Ih),{value:"link"},{default:o.withCtx(()=>[o.createElementVNode("div",xN,[o.createVNode(o.unref(ws),{modelValue:r.value,"onUpdate:modelValue":m[0]||(m[0]=g=>r.value=g),type:"url",autofocus:"",required:"",placeholder:o.unref(a)("editor.video.dialog.placeholder")},null,8,["modelValue","placeholder"]),o.createVNode(o.unref(mn),{onClick:u},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(a)("editor.video.dialog.button.apply")),1)]),_:1})])]),_:1})]),_:1})]),_:1},8,["on-open-auto-focus"])]),_:1},8,["default-open"])]),_:1},8,["class"]))}}),ZE=Lt.create({name:Bc,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 na(CN)},addOptions(){return{...this.parent?.(),upload:()=>Promise.reject("link video not found"),button:({editor:t,t:e})=>({component:Ge,componentProps:{action:()=>t.commands.setVideoUpload(),isActive:()=>t.isActive("video")||!1,disabled:!t.can().setVideo?.({}),icon:"Video",tooltip:e("editor.video.tooltip")}})}}});function kN(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 EN(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 QE=Lt.create({name:"video",group:"block",atom:!0,draggable:!0,addOptions(){return{divider:!1,spacer:!1,allowFullscreen:!0,upload:void 0,width:cf["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?kN(t):null})},width:{default:this.options.width,renderHTML:({width:t})=>({width:Yt(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: ${Yt(n)};`;return EN(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)}}}),Gl=new Et("upload-image"),SN=()=>new ot({key:Gl,state:{init(){return lt.empty},apply(t,e){e=e.map(t.mapping,t.doc);const n=t.getMeta(Gl);if(n?.add){const r=n.add.map(({id:i,pos:s,src:a})=>{const l=_N(a);return jt.widget(s,l,{id:i,side:-1})});e=e.add(t.doc,r)}return 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 _N(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 TN(t,e){const r=Gl.getState(t).find(void 0,void 0,i=>i.id===e);return r.length?r[0]?.from:null}const NE=({validateFn:t,onUpload:e})=>async(n,r,i)=>{const s=[];for(const a of n){if(t&&!t(a))continue;const l=$r(6),u=URL.createObjectURL(a);s.push({file:a,id:l,preview:u})}s.length!==0&&(r.dispatch(r.state.tr.setMeta(Gl,{add:s.map(({id:a,preview:l})=>({id:a,pos:i,src:l}))})),await Promise.all(s.map(async({file:a,id:l,preview:u})=>{try{const c=await e(a),f=TN(r.state,l);if(f===null)return;const{schema:p}=r.state,m=typeof c=="object"?u:c,g=p.nodes.image?.create({src:m}),v=p.nodes.paragraph?.create();if(!g||!v)return;r.dispatch(r.state.tr.replaceWith(f,f,g).insert(f+g.nodeSize,v).setMeta(Gl,{remove:[l]}))}catch{r.dispatch(r.state.tr.setMeta(Gl,{remove:[l]}))}})))},AN=(t,e,n)=>{const r=Array.from(e.clipboardData?.files||[]);if(r.length){e.preventDefault();const i=t.state.selection.from;return n(r,t,i+1),!0}return!1},MN=(t,e,n,r)=>{const i=Array.from(e.dataTransfer?.files||[]);if(!n&&i.length){e.preventDefault();const s=t.posAtCoords({left:e.clientX,top:e.clientY});if(s)return r(i,t,s.pos+1),!0}return!1},ON={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"},BN={class:"flex items-center justify-between w-full"},IN={class:"flex items-center justify-center gap-3"},LN={class:"text-sm"},RN={class:"flex items-center gap-2"},DN=o.defineComponent({__name:"ImageUploader",props:{...ta},setup(t){const e=t,n=o.ref(""),r=o.ref(),{t:i}=Pt(),s=o.inject("isEditable",o.ref(!0));function a(f){const p=f?.target?.files;if(!e.editor||e.editor.isDestroyed||p.length===0)return;const m=Array.from(p),g=e.editor.extensionManager.extensions.find(b=>b.name==="imageUpload")?.options;NE({validateFn:b=>!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(){e.deleteNode()}function c(){r.value?.click()}return(f,p)=>(o.openBlock(),o.createBlock(o.unref(ea),{id:f.node.attrs.id,"data-drag-handle":"",class:o.normalizeClass(o.unref(ke)(!o.unref(s)&&"pointer-events-none"))},{default:o.withCtx(()=>[o.createVNode(o.unref(ms),{"default-open":o.unref(s)},{default:o.withCtx(()=>[o.createVNode(o.unref(Ca),{"as-child":""},{default:o.withCtx(()=>[o.createElementVNode("div",ON,[o.createElementVNode("div",BN,[o.createElementVNode("div",IN,[o.createVNode(o.unref(Ot),{name:"ImageUp",class:"w-6 h-6"}),o.createElementVNode("span",LN,o.toDisplayString(o.unref(i)("editor.image.dialog.title")),1)]),o.createVNode(o.unref(Ot),{name:"Trash2",class:"hover:text-ed-foreground",onClick:o.withModifiers(u,["stop"])})])])]),_:1}),o.createVNode(o.unref(gs),{"trap-focus":"",class:"w-full","on-open-auto-focus":m=>m.preventDefault()},{default:o.withCtx(()=>[o.createVNode(o.unref(Oh),{"default-value":"upload",class:"w-[300px] sm:w-[400px]","activation-mode":"manual"},{default:o.withCtx(()=>[o.createVNode(o.unref(Bh),{class:"grid w-full grid-cols-2"},{default:o.withCtx(()=>[o.createVNode(o.unref(Kl),{value:"upload"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(i)("editor.image.dialog.tab.upload")),1)]),_:1}),o.createVNode(o.unref(Kl),{value:"link"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(i)("editor.image.dialog.tab.url")),1)]),_:1})]),_:1}),o.createVNode(o.unref(Ih),{value:"upload"},{default:o.withCtx(()=>[o.createVNode(o.unref(mn),{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(Ih),{value:"link"},{default:o.withCtx(()=>[o.createElementVNode("div",RN,[o.createVNode(o.unref(ws),{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(mn),{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"])]),_:1},8,["default-open"])]),_:1},8,["id","class"]))}}),PN=1,VN=1e6,Ei={ADD_TOAST:"ADD_TOAST",UPDATE_TOAST:"UPDATE_TOAST",DISMISS_TOAST:"DISMISS_TOAST",REMOVE_TOAST:"REMOVE_TOAST"};let $b=0;function FN(){return $b=($b+1)%Number.MAX_VALUE,$b.toString()}const Hb=new Map;function eS(t){if(Hb.has(t))return;const e=setTimeout(()=>{Hb.delete(t),Kc({type:Ei.REMOVE_TOAST,toastId:t})},VN);Hb.set(t,e)}const yo=o.ref({toasts:[]});function Kc(t){switch(t.type){case Ei.ADD_TOAST:yo.value.toasts=[t.toast,...yo.value.toasts].slice(0,PN);break;case Ei.UPDATE_TOAST:yo.value.toasts=yo.value.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e);break;case Ei.DISMISS_TOAST:{const{toastId:e}=t;e?eS(e):yo.value.toasts.forEach(n=>{eS(n.id)}),yo.value.toasts=yo.value.toasts.map(n=>n.id===e||e===void 0?{...n,open:!1}:n);break}case Ei.REMOVE_TOAST:t.toastId===void 0?yo.value.toasts=[]:yo.value.toasts=yo.value.toasts.filter(e=>e.id!==t.toastId);break}}function zb(){return{toasts:o.computed(()=>yo.value.toasts),toast:$N,dismiss:t=>Kc({type:Ei.DISMISS_TOAST,toastId:t})}}function $N(t){const e=FN(),n=i=>Kc({type:Ei.UPDATE_TOAST,toast:{...i,id:e}}),r=()=>Kc({type:Ei.DISMISS_TOAST,toastId:e});return Kc({type:Ei.ADD_TOAST,toast:{...t,id:e,open:!0,onOpenChange:i=>{i||r()}}}),{id:e,dismiss:r,update:n}}const HN={acceptMimes:["image/jpeg","image/gif","image/png","image/jpg"],maxSize:1024*1024*5},zN=t=>`${(t/1024/1024).toFixed(2)}MB`,tS=Lt.create({name:Ci,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:$r(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 na(DN)},addOptions(){return{...HN,...this.parent?.(),upload:()=>Promise.reject("Image Upload Function"),button:({editor:t,extension:e,t:n})=>({component:Ge,componentProps:{action:()=>t.commands.setImageUpload(),disabled:!t.can().setImage?.({}),icon:"ImageUp",tooltip:n("editor.image.tooltip")}})}},addProseMirrorPlugins(){const{toast:t}=zb(),e=Oa.global.t,r=NE({validateFn:i=>this.options.acceptMimes.includes(i.type)?i.size>this.options.maxSize?(t({description:`${e("editor.imageUpload.fileSizeTooBig")} ${zN(this.options.maxSize)}.`,duration:2e3}),!1):!0:(t({description:e("editor.imageUpload.fileTypeNotSupported"),duration:2e3}),!1),onUpload:this.options.upload});return[new ot({props:{handlePaste:(i,s)=>!s.clipboardData||Array.from(s.clipboardData.items||[]).some(l=>l.type==="text/html")?!1:AN(i,s,r),handleDrop:(i,s,a,l)=>!(s instanceof DragEvent)||!s.dataTransfer||!Array.from(s.dataTransfer.files||[]).some(f=>this.options.acceptMimes.includes(f.type))?!1:MN(i,s,l,r)}}),SN()]}}),UN=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}`}}}}}]}}),WN=o.defineComponent({__name:"SpecialCharacterButton",props:{editor:u4},setup(t){const e=t,{t:n}=Pt(),r=bn(),i=o.computed(()=>e.editor?.storage.specialCharacter.specialCharModal),s=o.ref(!1);let a=null;function l(){const p=document.activeElement;if(p instanceof HTMLInputElement){a={type:"input",el:p};return}r.editorFocusedInstance.value&&(a={type:"editor"})}const u=()=>{if(!i.value||!i.value.component){console.error("Please configure specialCharModal!");return}s.value=!s.value};document.addEventListener("focusin",p=>{if(!s.value)return;const m=p.target;if(m instanceof HTMLInputElement){a={type:"input",el:m};return}r.editorFocusedInstance.value?.view?.dom?.contains(m)&&(a={type:"editor"})});function c(p,m){const g=p.selectionStart??p.value.length,v=p.selectionEnd??p.value.length;p.value=p.value.slice(0,g)+m+p.value.slice(v);const b=g+m.length;p.setSelectionRange(b,b),p.dispatchEvent(new Event("input",{bubbles:!0})),p.focus()}const f=(p,m)=>{if(m){if(a?.type==="input"){c(a.el,p);return}if(a?.type==="editor"){const g=r.editorFocusedInstance.value;if(!g)return;const{view:v}=g,{from:b}=v.state.selection;g.commands.insertContentAt(b,p),g.commands.focus()}}};return(p,m)=>{const g=da,v=is,b=ca,w=fa;return o.openBlock(),o.createBlock(w,null,{default:o.withCtx(()=>[o.createVNode(b,{"delay-duration":0},{default:o.withCtx(()=>[o.createVNode(g,null,{default:o.withCtx(()=>[o.createVNode(mn,{class:"text-[#65558F] hover:bg-[#ECE6F0]/90 text-xs rounded-none font-normal h-[26px] px-3 border border-gray-300 bg-ed-gray-50 dark:bg-black dark:text-white dark:hover:bg-gray-700 transition-all",onPointerdown:l,onClick:u},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("editor.insert.symbol")),1)]),_:1})]),_:1}),o.createVNode(v,null,{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("editor.insert.symbol")),1)]),_:1})]),_:1}),(o.openBlock(),o.createBlock(o.Teleport,{to:"body"},[o.unref(s)?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(o.unref(i).component),o.mergeProps({key:0},o.unref(i).props,{"custom-class":"!z-[70] !pointer-events-auto",onClose:m[0]||(m[0]=x=>s.value=!1),onSelectedChar:f}),null,16)):o.createCommentVNode("",!0)]))]),_:1})}}}),jN=Qe.create({name:sh,addOptions(){return{button:({editor:t})=>({component:WN,componentProps:{editor:t}}),specialCharModal:void 0}},addStorage(){return{specialCharModal:this.options.specialCharModal}}}),nS=Qe.create({name:"base-kit",addOptions(){return{...this.parent?.(),timeHighlighter:{additionalTimeWords:[]},bubble:{list:cL,defaultBubbleList:QK,button:({editor:t,extension:e,t:n})=>{const{list:r={},defaultBubbleList:i}=e.options?.bubble??{},s=i?.(t)??[];return NK(r,s,{editor:t,extension:e,t:n})}}}},addExtensions(){const t=Oa.global.t,e=[];this.options.placeholder!==!1&&e.push(q5.configure({placeholder:({node:n,pos:r})=>{const i=n?.type?.name;return i==="heading"?`${t(`editor.heading.h${n.attrs.level}.tooltip`)}`:i==="table"||i==="codeBlock"?"":r===0?t("editor.content"):""},...this.options.placeholder})),this.options.focus!==!1&&e.push(HK.configure({className:"focus",...this.options.focus})),this.options.document!==!1&&(this.options.page?(e.push(X5.configure().extend({content:"page+"})),e.push(aZ.configure({types:this.options.page?.nodesComputedOption?.types??[],slots:o.useSlots()}))):e.push(X5.configure())),this.options.dropcursor!==!1&&e.push($K.configure({...this.options.dropcursor,width:2,class:"ProseMirror-dropcursor border-black"})),this.options.characterCount!==!1&&e.push(PK.configure(this.options.characterCount)),this.options.paragraph!==!1&&e.push(j5.configure(this.options.paragraph)),this.options.hardBreak!==!1&&e.push(W5.configure(this.options.hardBreak)),this.options.listItem!==!1&&e.push(YK.configure(this.options.listItem)),this.options.textStyle!==!1&&e.push(JK.configure(this.options.textStyle)),this.options.imageUpload!==!1&&e.push(tS.configure(this.options.imageUpload)),this.options.video!==!1&&e.push(QE.configure(this.options.video)),this.options.videoUpload!==!1&&e.push(ZE.configure(this.options.videoUpload)),this.options.history!==!1&&e.push(Lv.configure(this.options.history)),this.options.fontFamily!==!1&&e.push(wE.configure(this.options.fontFamily)),this.options.fontSize!==!1&&e.push(o5.configure(this.options.fontSize)),this.options.fontWeight!==!1&&e.push(dZ.configure(this.options.fontWeight)),this.options.mode!==Te.EDITOR&&e.push(jN.configure(this.options.specialCharacter)),this.options.mode!==Te.EDITOR&&e.push(mZ),this.options.superText!==!1&&this.options.mode!==Te.PLAIN_TEXT&&this.options.mode!==Te.EDITOR&&(typeof this.options.superText=="boolean"?e.push(sE.configure()):e.push(sE.configure(this.options.superText))),this.options.mode===Te.EDITOR&&(this.options.image!==!1&&e.push(jc.configure()),e.push(G6.configure({spacer:!0}),g6,m6,v6,Ov,Vb,b6,d5.configure({spacer:!0}),X6.configure({types:["heading","paragraph","tableCell","tableHeader"],spacer:!0}),kE)),this.options.mode!==Te.EDITOR&&this.options.configPlan!==!1&&this.options.mode!==Te.PLAIN_TEXT&&(typeof this.options.configPlan=="boolean"?e.push(SE.configure()):e.push(SE.configure({specialCharModal:this.options.configPlan?.specialCharModal}))),this.options.mode!==Te.EDITOR&&this.options.mode!==Te.PLAIN_TEXT&&e.push(vZ),(this.options.mode===Te.STRAIGHT||this.options.mode===Te.REPORT||this.options.mode===Te.EDITOR)&&this.options.timeHighlighter&&e.push(aN.configure(this.options.timeHighlighter)),this.options.invalidCharFocus!==!1&&e.push(hE.configure(this.options.invalidCharFocus)),this.options.disabled&&e.push(UN),e.push(Y5,K5.configure(),iN.configure(),XK.configure(),Ab,_b,sv,pN,hN.configure(this.options.deviceEnv),f5.configure({multicolor:!0}));for(const n in this.options.excludes)Object.prototype.hasOwnProperty.call(this.options.excludes,n)&&this.options.excludes[n]&&St.remove(e,({name:i})=>i===n);return e},addStorage(){return{mode:this.options.mode}}}),rS=Fn.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",wt(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()}}}),oS=Fn.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",wt(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()}}}),qN=Qe.create({name:"subAndSuperScript",addOptions(){return{...this.parent?.(),button:({editor:t,extension:e,t:n})=>{const r=e.options.subscript,i=e.options.superscript,s={component:Ge,componentProps:{action:()=>t.commands.toggleSubscript(),isActive:()=>t.isActive("subscript")||!1,disabled:!t.can().toggleSubscript(),icon:"Subscript",tooltip:n("editor.subscript.tooltip")}},a={component:Ge,componentProps:{action:()=>t.commands.toggleSuperscript(),isActive:()=>t.isActive("superscript")||!1,disabled:!t.can().toggleSuperscript(),icon:"Superscript",tooltip:n("editor.superscript.tooltip")}},l=[];return r!==!1&&l.push(s),i!==!1&&l.push(a),l}}},addExtensions(){const t=[];return this.options.subscript!==!1&&t.push(rS.configure(this.options.subscript)),this.options.superscript!==!1&&t.push(oS.configure(this.options.superscript)),t}}),KN={class:"ml-1"},GN=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(ga,{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(Ml),{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(Ot),{key:0,name:s.icon},null,8,["name"])):o.createCommentVNode("",!0),o.createElementVNode("span",KN,o.toDisplayString(s.title),1),s.shortcutKeys?(o.openBlock(),o.createBlock(o.unref(q6),{key:1,class:"ml-auto"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(Cx)(s.shortcutKeys)),1)]),_:2},1024)):o.createCommentVNode("",!0)]),_:2},1032,["checked","disabled","onClick"]))),128))]),_:1},8,["icon","tooltip","disabled"]))}}),XN=Qe.create({name:"moreMark",addOptions(){return{...this.parent?.(),button({editor:t,extension:e,t:n}){const r=e.options.subscript,i=e.options.superscript,s={action:()=>t.commands.toggleSubscript(),isActive:()=>t.isActive("subscript")||!1,disabled:!t.can().toggleSubscript(),icon:"Subscript",title:n("editor.subscript.tooltip"),shortcutKeys:["mod","."]},a={action:()=>t.commands.toggleSuperscript(),isActive:()=>t.isActive("superscript")||!1,disabled:!t.can().toggleSuperscript(),icon:"Superscript",title:n("editor.superscript.tooltip"),shortcutKeys:["mod",","]},l=hg(t,"code"),u=[];if(r!==!1&&u.push(s),i!==!1&&u.push(a),l){const c={action:()=>t.commands.toggleCode(),isActive:()=>t.isActive("code")||!1,disabled:!t.can().toggleCode(),icon:"Code",title:n("editor.code.tooltip"),shortcutKeys:["mod","E"]};l&&u.push(c)}return{component:GN,componentProps:{icon:"Type",tooltip:n("editor.moremark"),disabled:!t.isEditable||u.every(c=>c.disabled),items:u}}}}},addExtensions(){const t=[];return this.options.subscript!==!1&&t.push(rS.configure(this.options.subscript)),this.options.superscript!==!1&&t.push(oS.configure(this.options.superscript)),t}});var La=(t=>(t[t.max=7]="max",t[t.min=0]="min",t[t.more=1]="more",t[t.less=-1]="less",t))(La||{});function YN(t,e,n){return t<e?e:t>n?n:t}function JN(t,e,n,r){const{doc:i,selection:s}=t;if(!i||!s||!(s instanceof Ie||s instanceof An))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=ZN(t,c,e),!1):!H0(u.type.name,r.extensionManager.extensions)}),t}function ZN(t,e,n){if(!t.doc)return t;const r=t.doc.nodeAt(e);if(!r)return t;const a=YN((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 iS({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=JN(a,t,e,i),a.docChanged?(r&&r(a),!0):!1}}const QN=Qe.create({name:"indent",addOptions(){return{...this.parent?.(),types:["paragraph","heading","blockquote"],minIndent:La.min,maxIndent:La.max,button({editor:t,t:e}){const{selection:n}=t.state,r=n.$anchor.parent;return[{component:Ge,componentProps:{action:()=>{t.commands.indent()},disabled:r?.attrs?.indent>=La.max||!t.can().indent(),shortcutKeys:["Tab"],icon:"IndentIncrease",tooltip:e("editor.indent.tooltip")}},{component:Ge,componentProps:{action:()=>{t.commands.outdent()},shortcutKeys:["Shift","Tab"],disabled:r?.attrs?.indent<=La.min||!t.can().outdent(),icon:"IndentDecrease",tooltip:e("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:()=>iS({delta:La.more,types:this.options.types}),outdent:()=>iS({delta:La.less,types:this.options.types})}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.indent(),"Shift-Tab":()=>this.editor.commands.outdent()}}});function NN(t){var e;const{char:n,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:s,startOfLine:a,$position:l}=t,u=r&&!i,c=wB(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"),v=((e=l.nodeBefore)===null||e===void 0?void 0:e.isText)&&l.nodeBefore.text;if(!v)return null;const b=l.pos-v.length,w=Array.from(v.matchAll(g)).pop();if(!w||w.input===void 0||w.index===void 0)return null;const x=w.input.slice(Math.max(0,w.index-1),w.index),C=new RegExp(`^[${s?.join("")}\0]?$`).test(x);if(s!==null&&!C)return null;const E=b+w.index;let k=E+w[0].length;return u&&f.test(v.slice(k-1,k+1))&&(w[0]+=" ",k+=1),E<l.pos&&k>=l.pos?{range:{from:E,to:k},query:w[0].slice(n.length),text:w[0]}:null}const eee=new Et("suggestion");function tee({pluginKey:t=eee,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=NN}){let v;const b=p?.(),w=new ot({key:t,view(){return{update:async(x,C)=>{var E,k,T,_,A,V,O;const B=(E=this.key)===null||E===void 0?void 0:E.getState(C),H=(k=this.key)===null||k===void 0?void 0:k.getState(x.state),j=B.active&&H.active&&B.range.from!==H.range.from,Y=!B.active&&H.active,N=B.active&&!H.active,U=!Y&&!N&&B.query!==H.query,P=Y||j&&U,L=U||j,F=N||j&&U;if(!P&&!L&&!F)return;const R=F&&!P?B:H,K=x.dom.querySelector(`[data-decoration-id="${R.decorationId}"]`);v={editor:e,range:R.range,query:R.query,text:R.text,items:[],command:X=>c({editor:e,range:R.range,props:X}),decorationNode:K,clientRect:K?()=>{var X;const{decorationId:ae}=(X=this.key)===null||X===void 0?void 0:X.getState(e.state),de=x.dom.querySelector(`[data-decoration-id="${ae}"]`);return de?.getBoundingClientRect()||null}:null},P&&((T=b?.onBeforeStart)===null||T===void 0||T.call(b,v)),L&&((_=b?.onBeforeUpdate)===null||_===void 0||_.call(b,v)),(L||P)&&(v.items=await f({editor:e,query:R.query})),F&&((A=b?.onExit)===null||A===void 0||A.call(b,v)),L&&((V=b?.onUpdate)===null||V===void 0||V.call(b,v)),P&&((O=b?.onStart)===null||O===void 0||O.call(b,v))},destroy:()=>{var x;v&&((x=b?.onExit)===null||x===void 0||x.call(b,v))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(x,C,E,k){const{isEditable:T}=e,{composing:_}=e.view,{selection:A}=x,{empty:V,from:O}=A,B={...C};if(B.composing=_,T&&(V||e.view.composing)){(O<C.range.from||O>C.range.to)&&!_&&!C.composing&&(B.active=!1);const H=g({char:n,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:s,startOfLine:a,$position:A.$from}),j=`id_${Math.floor(Math.random()*4294967295)}`;H&&m({editor:e,state:k,range:H.range,isActive:C.active})?(B.active=!0,B.decorationId=C.decorationId?C.decorationId:j,B.range=H.range,B.query=H.query,B.text=H.text):B.active=!1}else B.active=!1;return B.active||(B.decorationId=null,B.range={from:0,to:0},B.query=null,B.text=null),B}},props:{handleKeyDown(x,C){var E;const{active:k,range:T}=w.getState(x.state);return k&&((E=b?.onKeyDown)===null||E===void 0?void 0:E.call(b,{view:x,event:C,range:T}))||!1},decorations(x){const{active:C,range:E,decorationId:k}=w.getState(x);return C?lt.create(x.doc,[jt.inline(E.from,E.to,{nodeName:l,class:u,"data-decoration-id":k})]):null}}});return w}const nee=[{label:"优酷",value:"youku",icon:"Youku"},{label:"哔哩哔哩",value:"bilibili",icon:"BiliBili"},{label:"腾讯视频",value:"qqvideo",icon:"QQVideo"}],ree=[{label:"高德地图",value:"amap",icon:"Gaode"},{label:"百度地图",value:"baidu_map",icon:"Baidu"}],oee=[{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"}],iee=[{label:"CodePen",value:"codepen",icon:"Codepen"}],see=[{label:"金数据",value:"jinshuju",icon:"Jinshuju"}],aee=[],lee=[...nee,...ree,...oee,...iee,...see,...aee];function uee(t){const e=Oa.global.t,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(hg(t,"iframes")){const i=lee;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 cee={key:0,class:"grid grid-cols-1 gap-0.5 min-w-48"},dee={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"},fee=["onClick"],pee=["src"],hee={key:1,class:"p-3"},mee={class:"text-xs text-gray-800 dark:text-gray-400"},gee=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}=Pt(),a=o.ref([]),l=t;e({onKeyDown:u}),o.watch([()=>n.value,()=>r.value],async()=>{if(!i.value)return;await o.nextTick();const b=r.value*1e3+n.value,w=a.value[b];w&&w.scrollIntoView({behavior:"smooth",block:"nearest"})});function u({event:b}){return b.key==="ArrowUp"?(c(),!0):b.key==="ArrowDown"?(f(),!0):b.key==="Enter"?(p(),!0):!1}function c(){if(!l.items.length)return!1;let b=n.value-1,w=r.value;b<0&&(w=r.value-1,b=l.items[w]?.commands.length-1||0),w<0&&(w=l.items.length-1,b=l.items[w].commands.length-1),n.value=b,r.value=w}function f(){if(!l.items.length)return!1;const b=l.items[r.value].commands;let w=n.value+1,x=r.value;b.length-1<w&&(w=0,x=r.value+1),l.items.length-1<x&&(x=0),n.value=w,r.value=x}function p(){if(!l.items.length||r.value===-1||n.value===-1)return!1;m(r.value,n.value)}function m(b,w){const x=l.items[b].commands[w];l.command(x)}function g(b,w){m(b,w)}function v(b,w,x){a.value[b*1e3+w]=x}return(b,w)=>(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"},[b.items?.length?(o.openBlock(),o.createElementBlock("div",cee,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(b.items,(x,C)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:x.title},[o.createElementVNode("div",dee,o.toDisplayString(x.title),1),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(x.commands,(E,k)=>(o.openBlock(),o.createElementBlock("button",{ref_for:!0,ref:T=>v(C,k,T),key:k,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===C&&n.value===k?"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:T=>g(C,k)},[E.iconUrl?(o.openBlock(),o.createElementBlock("img",{key:0,class:"w-6 h-6",src:E.iconUrl},null,8,pee)):o.createCommentVNode("",!0),E.iconName?(o.openBlock(),o.createBlock(o.unref(Ot),{key:1,name:E.iconName,class:"mr-1 text-lg"},null,8,["name"])):o.createCommentVNode("",!0),o.createTextVNode(" "+o.toDisplayString(E.label),1)],10,fee))),128))],64))),128))])):(o.openBlock(),o.createElementBlock("div",hee,[o.createElementVNode("span",mee,o.toDisplayString(o.unref(s)("editor.slash.empty")),1)]))],512))}}),Ra="slashCommand";let Go;const vee=Qe.create({name:Ra,priority:200,onCreate(){Go=Ns("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[tee({editor:this.editor,char:"/",allowSpaces:!0,startOfLine:!0,pluginKey:new Et(Ra),allow:({state:t,range:e})=>{const n=t.doc.resolve(e.from),r=n.depth===1,i=n.parent.type.name==="paragraph",s=n.parent.textContent?.charAt(0)==="/",a=this.editor.isActive("column"),u=!n.parent.textContent?.substring(n.parent.textContent?.indexOf("/"))?.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})=>uee(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=>{t=new nx(gee,{props:n,editor:n.editor});const{view:r}=n.editor,i=()=>{if(!n.clientRect)return n.editor.storage[Ra].rect;const s=n.clientRect();if(!s)return n.editor.storage[Ra].rect;let a=s.y;if(t.element instanceof HTMLElement&&s.top+t.element.offsetHeight+40>window.innerHeight){const l=s.top+t.element.offsetHeight-window.innerHeight+40;a=s.y-l}return new DOMRect(s.x,a,s.width,s.height)};e=()=>{Go?.[0].setProps({getReferenceClientRect:i})},r.dom.parentElement?.addEventListener("scroll",e),t.element&&Go?.[0].setProps({getReferenceClientRect:i,appendTo:()=>document.body,content:t.element}),Go?.[0].show()},onUpdate(n){t.updateProps(n);const{view:r}=n.editor,i=()=>{if(!n.clientRect)return n.editor.storage[Ra].rect;const a=n.clientRect();return a?new DOMRect(a.x,a.y,a.width,a.height):n.editor.storage[Ra].rect},s=()=>{Go?.[0].setProps({getReferenceClientRect:i})};r.dom.parentElement?.addEventListener("scroll",s),n.editor.storage[Ra].rect=n.clientRect?i():{width:0,height:0,left:0,top:0,right:0,bottom:0},Go?.[0].setProps({getReferenceClientRect:i})},onKeyDown(n){return n.event.key==="Escape"?(Go?.[0].hide(),!0):(Go?.[0].state.isShown||Go?.[0].show(),t.ref?.onKeyDown(n))},onExit(n){if(Go?.[0].hide(),e){const{view:r}=n.editor;r.dom.parentElement?.removeEventListener("scroll",e)}t.destroy()}}}})]},addStorage(){return{rect:{width:0,height:0,left:0,top:0,right:0,bottom:0}}}}),bee=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=bn(),{toast:r}=zb();function i(){const s=e.editor.extensionManager.extensions.find(a=>a.name==="AI")?.options?.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,e.editor?.commands.focus()}return(s,a)=>(o.openBlock(),o.createBlock(Ge,{action:i,title:"AI",disabled:s.disabled,icon:s.icon,tooltip:s.tooltip},null,8,["disabled","icon","tooltip"]))}}),yee=Lt.create({name:"AI",group:"block",addOptions(){return{...this.parent?.(),toolbar:!1,button:({editor:t,t:e})=>({component:bee,componentProps:{icon:"Sparkles",tooltip:e("editor.AI.ask")}})}}});function wee(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 xee(t,e){return new File([t],e,{type:t.type})}const Cee=Qe.create({name:"importWord",addOptions(){return{...this.parent?.(),upload:void 0,convert:void 0,limit:1024*1024*10,button:({editor:t,extension:e,t:n})=>({component:Ge,componentProps:{action:()=>t.commands?.toggleImportWord(),disabled:!t.can().setHorizontalRule(),icon:"Word",tooltip:n("editor.importWord.tooltip")}})}},addCommands(){return{toggleImportWord:()=>({chain:t,editor:e})=>{const{toast:n}=zb(),r=Oa.global.t;async function i(u){const f=new DOMParser().parseFromString(u,"text/html"),p=f.querySelectorAll("img");if(!p.length)return f.body.innerHTML;if(hg(e,"image")){const g=e.extensionManager.extensions.find(v=>v.name==="importWord")?.options;if(g&&typeof g.upload=="function"){const v=[];for(const w of p){const x=w.getAttribute("src"),C=wee(x,"image/jpeg"),E=xee(C,"image.jpeg");v.push(E)}const b=await g.upload(v);for(let w=0;w<p.length;w++){const x=p[w];x.setAttribute("src",b[w].src);const C=x.parentElement;C?.tagName==="P"&&(C.insertAdjacentElement("beforebegin",x),!C.hasChildNodes()&&C.textContent===""&&C.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}}}}),Ub=bn(),kee=Qe.create({name:"preview",addOptions(){return{...this.parent?.(),button:({t})=>({component:Ge,componentProps:{icon:"Eye",action:()=>{Ub.togglePreview()},tooltip:t("editor.preview.tooltip"),isActive:()=>Ub.state.showPreview}})}},addCommands(){return{togglePreview:()=>()=>(Ub.togglePreview(),!0)}}}),sS=bn(),Eee=(t,e,n)=>RegExp(e?t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"):t,n?"gu":"gui");function See(t,e,n,r){const i=[],s=[];let a=[],l=0;if(!e)return{decorationsToReturn:lt.empty,results:[]};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:lt.create(t,i),results:s}}const _ee=(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))},Tee=(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]},Aee=(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=Tee(t,a,i,s);c&&(i=c[0],s=c[1])}r&&r(n)}},Mee=new Et("findAndReplacePlugin"),Oee=Qe.create({name:"findAndReplace",addOptions(){return{...this.parent?.(),searchResultClass:"vdc-editor-search-result",disableRegex:!0,button:({editor:t,extension:e,t:n})=>({component:Ge,componentProps:{icon:"DocSearch",tooltip:n("editor.findAndReplace.tooltip"),action:()=>{sS.toggleFindAndReplace()},isActive:()=>sS.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 _ee(r,i,{state:e,dispatch:n}),!1},replaceAll:()=>({editor:t,tr:e,dispatch:n})=>{const{replaceTerm:r,results:i}=t.storage.findAndReplace;return Aee(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 ot({key:Mee,state:{init:()=>lt.empty,apply({doc:a,docChanged:l},u){const{searchTerm:c,lastSearchTerm:f,caseSensitive:p,lastCaseSensitive:m,resultIndex:g,lastResultIndex:v}=t.storage.findAndReplace;if(!l&&f===c&&m===p&&v===g)return u;if(r(c),i(p),s(g),!c)return t.storage.findAndReplace.results=[],lt.empty;const{decorationsToReturn:b,results:w}=See(a,Eee(c,n,p),e,g);return t.storage.findAndReplace.results=w,b}},props:{decorations(a){return this.getState(a)}}})]}}),{togglePrinter:Bee,state:Iee}=bn(),Lee=Qe.create({name:"printer",addOptions(){return{...this.parent?.(),button:({t})=>({component:Ge,componentProps:{tooltip:t("editor.printer.tooltip"),action:()=>Bee(),icon:"Printer",shortcutKeys:["mod","P"],isActive:()=>Iee.printer}})}}}),Ree=async function(t){let e=[];try{if(this.enabled===!1||t.length===0||t.trim()==="")return e;if(this.limit&&t.length>this.limit)throw new Error("Text is too long");const n=await sn.post(this.getApi(),{value:t}),r=this.transfer(n.data);e=r?.map(i=>i.errorText)||[],this?.setSuggestions&&this.setSuggestions(r)}catch(n){console.error(n)}return e};class aS{suggestions=[];api="";enabled=!0;limit;transfer;constructor({api:e,limit:n,transfer:r,enabled:i}){this.suggestions=[],this.api=e,this.limit=n,this.transfer=r,this.enabled=i??!0}setSuggestions(e){this.suggestions=e}getSuggestions(e){return Promise.resolve(this.suggestions.find(n=>n.errorText.wrongWord===e)?.spellData.correctWord??[])}getApi(){return this.api}normalizeTextForLanguage(e){return e}proofreadText(e){return Promise.resolve(Ree.call(this,e))}toggleIsEnabled(){this.enabled=!this.enabled}setEnabled(e){this.enabled=e}getIsEnabled(){return this.enabled}}const Dee=Object.freeze(Object.defineProperty({__proto__:null,AI:yee,BaseKit:nS,Blockquote:Xq,Bold:m6,BulletList:$q,Clear:sv,Code:_$,CodeBlock:WH,Color:d5,Columns:Ab,FindAndReplace:Oee,FontFamily:wE,FontSize:o5,FormatPainter:_b,Fullscreen:DK,Heading:G6,Highlight:Rq,History:Lv,HorizontalRule:EK,Image:jc,ImageUpload:tS,ImportWord:Cee,Indent:QN,Italic:g6,LineHeight:kE,Link:Ov,MoreMark:XN,OrderedList:Wq,Preview:kee,Printer:Lee,Proofreader:aS,SlashCommand:vee,SpellcheckerExtension:fE,Strike:b6,SubAndSuperScript:qN,Table:Vb,TaskList:Kq,TextAlign:X6,Underline:v6,Video:QE,VideoUpload:ZE},Symbol.toStringTag,{value:"Module"})),Pee='<page id="ft6nbbxs" extend="false" pagenumber="1" force="false"><h1 id="tk6n64mj" extend=""false""><strong>Introduction(English)</strong></h1><p id="s864ng1o" extend=""false"">MyMy Editor is open-source document editor based on Vue3 and Tiptap. MyMy Editor provides comprehensive document editing capabilities, supports pagination, supports Markdown syntax, offers basic rich text editing functions, allows for the insertion of various node types in multiple formats, provides a variety of practical tools, and supports setting page styles. It also supports exporting in various formats, printing and print preview, block-level document editing, adding custom extensions, multi-language settings, and a dark theme.</p><h1 id="jm9johtz" extend=""false""><strong>소개(국문)</strong></h1><p id="0qei01hl" extend=""false"">마이마이 에디터는 Vue3과 Tiptap을 기반으로 한 오픈소스 문서 편집기입니다. 마이마이 에디터는 포괄적인 문서 편집 기능을 제공하며, 페이지네이션, 마크다운 구문 지원, 기본적인 리치 텍스트 편집 기능, 다양한 형식의 다양한 노드 유형 삽입, 다양한 실용적인 도구 제공, 페이지 스타일 설정 지원 등을 제공합니다. 또한 다양한 형식으로 내보내기, 인쇄 및 인쇄 미리보기, 블록 수준의 문서 편집, 사용자 지정 확장 추가, 다국어 설정 및 다크 테마를 지원합니다.마이마이 에디터는 Vue3과 Tiptap을 기반으로 한 오픈소스 문서 편집기입니다. 마이마이 에디터는 포괄적인 문서 편집 기능을 제공하며, 페이지네이션, 마크다운 구문 지원, 기본적인 리치 텍스트 편집 기능, 다양한 형식의 다양한 노드 유형 삽입, 다양한 실용적인 도구 제공, 페이지 스타일 설정 지원 등을 제공합니다. 또한 다양한 형식으로 내보내기, 인쇄 및 인쇄 미리보기, 블록 수준의 문서 편집, 사용자 지정 확장 추가, 다국어 설정 및 다크 테마를 지원합니다.</p><blockquote class="blockquote"><p id="nekf7yi0" extend="false"><span style="color: rgb(115, 209, 61)"><strong><em>Make by VDC</em></strong></span></p></blockquote></page>';function Vee(){const t=window.localStorage.getItem("content"),e=o.ref(t||Pee),n=o.computed(()=>[nS.configure({placeholder:{showOnlyCurrent:!0},characterCount:{limit:1e5},excludes:{}}),Lv,Ab,_b,sv,Ov,jc,Vb]),r=ct.useEventBus(ur.RENDER_SUPER_TEXT);function i(s,a){const l={action:"status",payload:{id:s,status:a}};r.emit(l)}return{defaultExtensions:n,content:e,dispatchUpdateStatusSuperText:i}}function Fee(){const t=o.ref(!1);return{hasEverFocused:t,markAsFocused:()=>{t.value=!0},insertHtml:(r,i)=>{const{state:s}=r,{doc:a,selection:l}=s,u=l.$from,c=a.firstChild,f=r.isEmpty;if(!t.value){if(f&&c){r.chain().insertContentAt({from:0,to:c.nodeSize},i).focus().run();return}const m=a.content.size;r.chain().insertContentAt(m,i).focus().run();return}const p=u.parent;if(p.type.name==="paragraph"&&p.textContent.trim().length===0){const m=u.before();r.chain().insertContentAt({from:m,to:m+p.nodeSize},i).focus().run();return}if(u.parentOffset===0&&p.type.name==="paragraph"&&p.content.size>0){const m=u.before();r.chain().insertContentAt(m,i).focus().run();return}r.chain().insertContentAt(r.state.selection,i).focus().run()}}}function Xl(t=250){const e=o.ref(!1);let n=null;const r=()=>{e.value=!0,n&&clearTimeout(n),n=setTimeout(()=>{e.value=!1},t)};return o.onUnmounted(()=>{n&&clearTimeout(n)}),{isScrolling:e,handleScroll:r}}function $ee(){const t=o.ref(!1);let e=!1;function n(){const l=Array.from(document.querySelectorAll(".inside-toolbar")),u=document.querySelector("#tool-bar-format"),c=document.querySelector("#tool-bar-image"),f=Array.from(document.querySelectorAll('[contenteditable="true"].tiptap:not(.simple-editor)'));return{popupInsideToolbars:l,toolBarFormat:u,toolBarImage:c,tiptapEditors:f}}function r(l){if(!l)return!1;const{popupInsideToolbars:u,toolBarFormat:c,toolBarImage:f,tiptapEditors:p}=n();return u.some(m=>m.contains(l))||(c?.contains(l)??!1)||(f?.contains(l)??!1)||p.some(m=>m.contains(l))}function i(l){e=r(l.target)}function s(l){const u=l.target;u&&r(u)&&(t.value=!0)}function a(l){const u=l.relatedTarget;r(u)||e&&u===null||(t.value=!1)}return ct.useEventListener(document,"mousedown",i,{capture:!0}),ct.useEventListener(document,"touchstart",i,{capture:!0}),ct.useEventListener(document,"focusin",s),ct.useEventListener(document,"focusout",a),{isShowToolBarBaseOnEditor:t}}function Gc(){try{const{locale:t}=Pt();o.watch(t,e=>{const n=String(e);n&&Oa.global.locale.value!==n&&(Oa.global.locale.value=n)},{immediate:!0})}catch{}}const Hee={key:0,class:"p-2.5 space-y-1.5"},zee=["innerHTML"],Uee={key:1,class:"p-2.5 space-y-1.5"},Wee=["innerHTML"],jee={key:2,class:"p-2.5 space-y-1.5"},qee=["innerHTML"],Kee=Xr(o.defineComponent({__name:"ArticleFullViewer",props:{extensions:{},mode:{},hideComment:{type:Boolean},fieldNameComment:{},fieldNameCommentCuesheet:{},fieldNameContent:{},comment:{},commentCuesheet:{},content:{},minChars:{},fontSize:{}},setup(t){const e=t;Gc();const n=o.computed(()=>{const C=e.extensions?.filter(E=>E.name!=="spellchecker")||[];return C.some(E=>E.name==="image")||C.push(jc.configure()),C}),r=o.computed(()=>ra(e.comment)),i=o.computed(()=>ra(e.commentCuesheet)),s=o.computed(()=>ra(e.content));function a(C){return cg(C).replace(/<script\b[\s\S]*?<\/script\s*>/gi,"")}const l=o.computed(()=>r.value?a(e.comment):""),u=o.computed(()=>i.value?a(e.commentCuesheet):""),c=o.computed(()=>s.value?a(e.content):""),f=o.ref(),p=o.ref(),m=o.ref();o.onBeforeUnmount(()=>{f.value&&f.value.destroy(),p.value&&p.value.destroy(),m.value&&m.value.destroy()});function g(C){return new Oo({extensions:n.value,content:C,editable:!1,parseOptions:{preserveWhitespace:"full"}})}o.onMounted(async()=>{!r.value&&e.comment&&(f.value=g(un(e.comment,!0,e.mode)),await o.nextTick()),!i.value&&e.commentCuesheet&&(p.value=g(un(e.commentCuesheet,!0,e.mode)),await o.nextTick()),!s.value&&e.content&&(m.value=g(un(e.content,!0,e.mode)))});function v(C,E){if(!C)return;const k=un(E,!0,e.mode);St.isEqual(C.getHTML(),k)||C.commands.setContent(k,!1,{preserveWhitespace:"full"})}o.watch(()=>e.comment,C=>{r.value||v(f.value,C)}),o.watch(()=>e.commentCuesheet,C=>{i.value||v(p.value,C)}),o.watch(()=>e.content,C=>{s.value||v(m.value,C)});const b=o.computed(()=>e.fontSize??""),{contentInner:w,measuredMinWidth:x}=pf({minChars:e.minChars,fontSize:b});return(C,E)=>{const k=zT;return o.openBlock(),o.createElementBlock("div",{ref_key:"contentInner",ref:w,style:o.normalizeStyle({minWidth:`${Number(o.unref(x))+23}px`}),class:"flex-1 border border-[#999] rounded-[3px] divide-y divide-[#999] divide-dashed overflow-y-auto"},[C.comment&&!C.hideComment?(o.openBlock(),o.createElementBlock("div",Hee,[C.fieldNameComment?.label?(o.openBlock(),o.createBlock(k,{key:0,label:C.fieldNameComment.label,"custom-class":C.fieldNameComment.customClass},null,8,["label","custom-class"])):o.createCommentVNode("",!0),o.unref(r)?(o.openBlock(),o.createElementBlock("div",{key:1,class:"ProseMirror",innerHTML:o.unref(l)},null,8,zee)):o.unref(f)?(o.openBlock(),o.createBlock(o.unref(Yn),{key:2,editor:o.unref(f)},null,8,["editor"])):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0),C.commentCuesheet&&!C.hideComment?(o.openBlock(),o.createElementBlock("div",Uee,[C.fieldNameCommentCuesheet?.label?(o.openBlock(),o.createBlock(k,{key:0,label:C.fieldNameCommentCuesheet.label,"custom-class":C.fieldNameCommentCuesheet.customClass},null,8,["label","custom-class"])):o.createCommentVNode("",!0),o.unref(i)?(o.openBlock(),o.createElementBlock("div",{key:1,class:"ProseMirror",innerHTML:o.unref(u)},null,8,Wee)):o.unref(p)?(o.openBlock(),o.createBlock(o.unref(Yn),{key:2,editor:o.unref(p)},null,8,["editor"])):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0),C.content?(o.openBlock(),o.createElementBlock("div",jee,[C.fieldNameContent?.label?(o.openBlock(),o.createBlock(k,{key:0,label:C.fieldNameContent.label,"custom-class":C.fieldNameContent.customClass},null,8,["label","custom-class"])):o.createCommentVNode("",!0),o.unref(s)?(o.openBlock(),o.createElementBlock("div",{key:1,class:"ProseMirror",innerHTML:o.unref(c)},null,8,qee)):o.unref(m)?(o.openBlock(),o.createBlock(o.unref(Yn),{key:2,editor:o.unref(m)},null,8,["editor"])):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0)],4)}}}),[["__scopeId","data-v-3357e31b"]]),wo=o.defineComponent({__name:"Separator",props:{orientation:{},decorative:{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(XV),o.mergeProps(n.value,{class:o.unref(ke)("shrink-0 bg-ed-separator",e.orientation==="vertical"?"w-px h-full":"h-px w-full",e.class)}),null,16,["class"]))}}),Gee={class:"flex gap-2 items-center overflow-x-auto overflow-y-hidden [&::-webkit-scrollbar]:h-1.5"},Xee={class:"flex-1 flex justify-end items-center gap-x-3"},Yee=o.defineComponent({__name:"Toolbar",props:{editor:{},editorComment:{},disabled:{type:Boolean,default:!1},mode:{},class:{},customClassToolbar:{},toolbarExtensionOrder:{}},setup(t){const e=o.defineAsyncComponent(()=>Promise.resolve().then(()=>jJ)),{t:n}=Pt(),r=t,i=o.inject("isEditable",o.ref(!0)),s=[rh,Rc,sh,oh,ki,Lc],a=o.computed(()=>{const f=[...r.editor.extensionManager.extensions],p={[ki]:-1},m={[rh]:1,[Rc]:2,[sh]:3,[oh]:4,[ki]:5,[Lc]:6},g=r.toolbarExtensionOrder??(r.mode===Te.EDITOR?p:m),v=uE(f,g);let b=[];for(const w of v){const{button:x,divider:C=!1,spacer:E=!1,toolbar:k=!0}=w.options;if(!x||!pg(x)||!k)continue;const T=x({editor:r.editor,extension:w,t:o.unref(n)});if(Array.isArray(T)){const _=T.map((A,V)=>({id:`${w.name}`,button:A,divider:V===T.length-1?C:!1,spacer:V===0?E:!1}));b=[...b,..._];continue}b.push({button:T,divider:C,spacer:E,id:`${w.name}`})}if(r.mode!==Te.EDITOR)return b.filter(w=>w.id&&s.includes(w.id));if(b=b.filter(w=>w.id!=="superText"),!i.value){b=b.map(x=>(x.button.componentProps.disabled=!0,x));const w=b.find(x=>x.id==="spellchecker");w&&(w.button.componentProps.disabled=!1)}return b}),l=f=>f.id==="spellchecker"?"!text-[#2977D9] border border-gray-300 dark:!text-white hover:!bg-gray-200 dark:hover:!bg-gray-700 rounded-none [&>div>svg]:w-[19px] [&>div>svg]:h-[19px] p-0 w-[26px] h-[26px]":f.button.componentProps.customClass,u=f=>f.id==="spellchecker"?"Spellchecker":f.button.componentProps.icon,c=o.computed(()=>r.editor?.extensionManager.extensions.find(f=>f.name==="spellchecker"));return(f,p)=>(o.openBlock(),o.createElementBlock("div",{id:"tool-bar",class:o.normalizeClass(o.unref(ke)(r.class,f.customClassToolbar))},[o.createElementVNode("div",Gee,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.value,(m,g)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:g},[m.spacer&&g!==0?(o.openBlock(),o.createBlock(o.unref(wo),{key:0,orientation:"vertical",class:"h-[16px] mx-[10px]"})):o.createCommentVNode("",!0),(o.openBlock(),o.createBlock(o.resolveDynamicComponent(m.button.component),o.mergeProps({id:m.id,ref_for:!0},m.button.componentProps,{editor:f.editor,disabled:f.disabled||m.button.componentProps?.disabled,"custom-class":l(m),icon:u(m)}),o.createSlots({_:2},[o.renderList(m.button.componentSlots,(v,b,w)=>({name:`${b}`,fn:o.withCtx(x=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(v),o.mergeProps({ref_for:!0},x?.props,{id:m.id}),null,16,["id"]))])}))]),1040,["id","editor","disabled","custom-class","icon"])),m.divider?(o.openBlock(),o.createBlock(o.unref(wo),{key:1,orientation:"vertical",class:"mx-2 h-auto"})):o.createCommentVNode("",!0)],64))),128)),o.createElementVNode("div",Xee,[p[0]||(p[0]=o.createElementVNode("div",{id:"tool-bar-auto-save"},null,-1)),c.value?(o.openBlock(),o.createBlock(o.unref(e),{key:0,editor:f.editor,"editor-comment":f.editorComment,isEnableSpellCheckRealTime:f.editor?.extensionStorage.spellchecker.spellchecker.proofreader.enabled},null,8,["editor","editor-comment","isEnableSpellCheckRealTime"])):o.createCommentVNode("",!0)])])],2))}}),lS=(t,e)=>{const{view:n,state:{selection:{from:r}}}=t,i=document.querySelectorAll(".focus"),s=i.length,l=i[s-1];if(l&&l.getAttribute("data-type")&&l.getAttribute("data-type")===e||l&&l.classList&&l.classList.contains(e))return l;const u=n.domAtPos(r).node;let c=u;for(c.tagName||(c=u.parentElement);c&&!(c.getAttribute("data-type")&&c.getAttribute("data-type")===e)&&!c.classList.contains(e);)c=c.parentElement;return c},Jee={class:"w-max px-3 py-2 transition-all border rounded-sm shadow-sm pointer-events-auto select-none border-neutral-200 dark:border-neutral-800 bg-ed-background"},Zee={class:"flex items-center flex-nowrap whitespace-nowrap h-[26px] justify-start relative gap-0.5"},Qee={class:"flex items-center gap-2"},Nee={class:"mt-3"},uS=o.defineComponent({__name:"ImageBubbleMenu",props:{editor:{},disabled:{type:Boolean,default:!1}},setup(t){const e=t,{t:n}=Pt(),r=o.ref("100"),i=o.ref(),s=o.ref(),a=o.ref(),l=["left","center","right"],u={left:"AlignLeft",center:"AlignCenter",right:"AlignRight"},c=()=>document.body;function f(O){O?.preventDefault(),e.editor.getAttributes("image").src&&e.editor.chain().focus(void 0,{scrollIntoView:!1}).updateImage({width:i.value?`${i.value}px`:null}).run()}function p(O){const B=Math.max(0,Math.min(100,parseInt(r.value)));e.editor.chain().focus(void 0,{scrollIntoView:!1}).updateImage({width:`${B}%`}).run()}const m=o.ref(!1),g=o.ref(null),v=({editor:O})=>$0(O.view.state,"image")||m.value;function b(){const O=lS(e.editor,"node-image");return O?(g.value=O,O.getBoundingClientRect()):m.value&&g.value?g.value.getBoundingClientRect():new DOMRect(-1e3,-1e3,0,0)}function w(O){e.editor.commands.updateAttributes("image",{textAlign:O})}o.watch(r,()=>{r.value&&p()}),o.watch(()=>e.editor.getAttributes("image"),O=>{O&&(i.value=Math.round(parseFloat(O.originWidth)),s.value=Math.round(parseFloat(O.originHeight)),a.value=O.originWidth/O.originHeight)});function x(){s.value&&a.value?i.value=Math.max(30,Math.round(s.value*a.value)):i.value=null}function C(){i.value&&a.value?s.value=Math.max(20,Math.round(i.value/a.value)):s.value=null}function E(O){w(O)}function k(){const O=e.editor.getAttributes("image"),{flipX:B}=O;e.editor.chain().focus(void 0,{scrollIntoView:!1}).updateImage({flipX:!B}).run()}function T(){const O=e.editor.getAttributes("image"),{flipY:B}=O;e.editor.chain().focus(void 0,{scrollIntoView:!1}).updateImage({flipY:!B}).run()}function _(){const{state:O,dispatch:B}=e.editor.view;ol(O,B)}function A(){const{state:O,dispatch:B}=e.editor.view,{tr:H,selection:j}=O;if(!(j instanceof Re))return;const Y=j.from,N=O.doc.nodeAt(Y);if(!N)return;const P=O.doc.resolve(Y).nodeBefore;if(!P)return;const L=Y-P.nodeSize,F=H.delete(Y,Y+N.nodeSize).insert(L,N).setSelection(Re.create(H.doc,L));B(F),e.editor.commands.focus()}function V(){const{state:O,dispatch:B}=e.editor.view,{tr:H,doc:j,selection:Y}=O;if(!(Y instanceof Re))return;const N=Y.from,U=j.nodeAt(N);if(!U)return;const P=N+U.nodeSize;if(P>=j.content.size)return;const L=j.nodeAt(P);if(!L)return;const F=P+L.nodeSize-U.nodeSize,R=N+L.nodeSize,K=H.delete(N,N+U.nodeSize).insert(F,U).setSelection(Re.create(H.doc,R));B(K),e.editor.commands.focus()}return(O,B)=>{const H=Ge,j=wo,Y=Ca,N=Mc,U=ws,P=Kl,L=Bh,F=Oh,R=gs,K=ms;return o.openBlock(),o.createBlock(o.unref(Wu),{editor:O.editor,"plugin-key":"image-menus-123","should-show":v,"update-delay":0,"tippy-options":{zIndex:9999,appendTo:c,getReferenceClientRect:()=>b()}},{default:o.withCtx(()=>[o.createElementVNode("div",Jee,[o.createElementVNode("div",Zee,[o.createVNode(H,{tooltip:o.unref(n)("editor.image.menu.flipX"),icon:"FlipVertical",action:k},null,8,["tooltip"]),o.createVNode(H,{tooltip:o.unref(n)("editor.image.menu.flipY"),icon:"FlipHorizontal",action:T},null,8,["tooltip"]),o.createVNode(j,{orientation:"vertical",class:"mx-1 me-2 h-[16px]"}),o.createVNode(H,{tooltip:o.unref(n)("editor.image.menu.moveUp"),icon:"MoveUp",action:A,disabled:!O.editor.isEditable},null,8,["tooltip","disabled"]),o.createVNode(H,{tooltip:o.unref(n)("editor.image.menu.moveDown"),icon:"MoveDown",action:V,disabled:!O.editor.isEditable},null,8,["tooltip","disabled"]),o.createVNode(j,{orientation:"vertical",class:"mx-1 me-2 h-[16px]"}),o.createVNode(K,{open:m.value,"onUpdate:open":B[4]||(B[4]=X=>m.value=X)},{default:o.withCtx(()=>[o.createVNode(Y,null,{default:o.withCtx(()=>[o.createVNode(H,{title:o.unref(n)("editor.image.menu.size"),icon:"ImageSize"},null,8,["title"])]),_:1}),o.createVNode(R,{class:"w-84"},{default:o.withCtx(()=>[o.createElementVNode("div",Qee,[o.createVNode(N,{for:"maxWidth",class:"whitespace-nowrap"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("editor.image.menu.size.width")),1)]),_:1}),o.createVNode(U,{id:"maxWidth",modelValue:i.value,"onUpdate:modelValue":B[0]||(B[0]=X=>i.value=X),type:"number",class:"w-20 h-8 [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",onInput:C,onKeyup:o.withKeys(f,["enter"])},null,8,["modelValue"]),o.createVNode(N,{for:"maxWidth",class:"whitespace-nowrap"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("editor.image.menu.size.height")),1)]),_:1}),o.createVNode(U,{id:"maxWidth",modelValue:s.value,"onUpdate:modelValue":B[1]||(B[1]=X=>s.value=X),type:"number",class:"w-20 h-8 [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",onInput:x,onKeyup:o.withKeys(f,["enter"])},null,8,["modelValue"])]),o.createElementVNode("div",Nee,[o.createVNode(F,{"model-value":r.value,"onUpdate:modelValue":[B[2]||(B[2]=X=>r.value=X),B[3]||(B[3]=X=>{r.value=X})]},{default:o.withCtx(()=>[o.createVNode(L,null,{default:o.withCtx(()=>[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(["25","50","75","100"],X=>o.createVNode(P,{key:X,value:X},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(X)+"% ",1)]),_:2},1032,["value"])),64))]),_:1})]),_:1},8,["model-value"])])]),_:1})]),_:1},8,["open"]),o.createVNode(j,{orientation:"vertical",class:"mx-1 me-2 h-[16px]"}),(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(l,(X,ae)=>o.createVNode(H,{key:ae,tooltip:o.unref(n)(`editor.textalign.${X}.tooltip`),icon:u[X],action:()=>E(X),disabled:!O.editor.can().setTextAlign(X),"is-active":()=>O.editor.isActive({textAlign:X})||!1},null,8,["tooltip","icon","action","disabled","is-active"])),64)),o.createVNode(j,{orientation:"vertical",class:"mx-1 me-2 h-[16px]"}),o.createVNode(H,{tooltip:o.unref(n)("editor.remove"),icon:"Trash2",action:_,disabled:!O.editor.isEditable},null,8,["tooltip","disabled"])])])]),_:1},8,["editor","tippy-options"])}}}),ete={class:"h-full w-fit min-w-32 flex items-center leading-none gap-0.5 p-2 bg-ed-background rounded-lg shadow-sm border border-ed-border"},Lh=o.defineComponent({__name:"TableBubbleMenu",props:{editor:{}},setup(t){const e=t,n=()=>document.body,r=({editor:w})=>w.isActive("table")&&(w.storage.table?.isTableEditorOpen??!1),{t:i}=Pt();function s(){e.editor.chain().focus().addColumnBefore().run()}function a(){e.editor.chain().focus().addColumnAfter().run()}function l(){e.editor.chain().focus().deleteColumn().run()}function u(){e.editor.chain().focus().addRowBefore().run()}function c(){e.editor.chain().focus().addRowAfter().run()}function f(){e.editor.chain().focus().deleteRow().run()}function p(){e.editor.chain().focus().mergeCells().run()}function m(){e.editor?.chain().focus().splitCell().run()}function g(){e.editor.chain().focus().deleteTable().run()}function v(w){e.editor.chain().focus().setTableCellBackground(w).run()}const b=()=>{const w=document.querySelector(".vdc-editor");if(!w)return new DOMRect(-1e3,-1e3,0,0);const x=w.getBoundingClientRect();return new DOMRect(x.left,x.top+10,x.width,0)};return(w,x)=>(o.openBlock(),o.createBlock(o.unref(Wu),{editor:w.editor,"plugin-key":"table","update-delay":0,"should-show":r,"tippy-options":{zIndex:9999,maxWidth:"auto",getReferenceClientRect:b,appendTo:n}},{default:o.withCtx(()=>[o.createElementVNode("div",ete,[o.createVNode(Ge,{icon:"TablerColumnInsertLeft","icon-class":"w-5 h-5",tooltip:o.unref(i)("editor.table.menu.insertColumnBefore"),action:s,"tooltip-options":{sideOffset:15},disabled:!w.editor?.can().addColumnBefore()},null,8,["tooltip","disabled"]),o.createVNode(Ge,{icon:"TablerColumnInsertRight",tooltip:o.unref(i)("editor.table.menu.insertColumnAfter"),"icon-class":"w-5 h-5",action:a,"tooltip-options":{sideOffset:15},disabled:!w.editor?.can().addColumnAfter()},null,8,["tooltip","disabled"]),o.createVNode(Ge,{icon:"TablerColumnRemove",action:l,"icon-class":"w-5 h-5",tooltip:o.unref(i)("editor.table.menu.deleteColumn"),"tooltip-options":{sideOffset:15},disabled:!w.editor?.can().deleteColumn()},null,8,["tooltip","disabled"]),o.createVNode(o.unref(wo),{orientation:"vertical",class:"mx-1 me-2 h-[16px]"}),o.createVNode(Ge,{icon:"TablerRowInsertTop",action:u,"icon-class":"w-5 h-5",tooltip:o.unref(i)("editor.table.menu.insertRowAbove"),"tooltip-options":{sideOffset:15},disabled:!w.editor?.can().addRowBefore()},null,8,["tooltip","disabled"]),o.createVNode(Ge,{icon:"TablerRowInsertBottom",action:c,"icon-class":"w-5 h-5",tooltip:o.unref(i)("editor.table.menu.insertRowBelow"),"tooltip-options":{sideOffset:15},disabled:!w.editor?.can().addRowAfter()},null,8,["tooltip","disabled"]),o.createVNode(Ge,{icon:"TablerRowRemove",action:f,"icon-class":"w-5 h-5",tooltip:o.unref(i)("editor.table.menu.deleteRow"),"tooltip-options":{sideOffset:15},disabled:!w.editor?.can().deleteRow()},null,8,["tooltip","disabled"]),o.createVNode(o.unref(wo),{orientation:"vertical",class:"mx-1 me-2 h-[16px]"}),o.createVNode(Ge,{icon:"TableCellsMerge",action:p,"icon-class":"w-5 h-5",tooltip:o.unref(i)("editor.table.menu.mergeCells"),"tooltip-options":{sideOffset:15},disabled:!w.editor?.can().mergeCells()},null,8,["tooltip","disabled"]),o.createVNode(Ge,{icon:"TableCellsSplit",action:m,"icon-class":"w-5 h-5",tooltip:o.unref(i)("editor.table.menu.splitCells"),"tooltip-options":{sideOffset:15},disabled:!w.editor?.can().splitCell()},null,8,["tooltip","disabled"]),o.createVNode(o.unref(wo),{orientation:"vertical",class:"mx-1 me-2 h-[16px]"}),o.createVNode(p5,{editor:w.editor,tooltip:o.unref(i)("editor.table.menu.setCellsBgColor"),action:v,"tooltip-options":{sideOffset:15}},null,8,["editor","tooltip"]),o.createVNode(Ge,{icon:"Trash2",tooltip:o.unref(i)("editor.table.menu.deleteTable"),"icon-class":"w-5 h-5",action:g,"tooltip-options":{sideOffset:15},disabled:!w.editor?.can().deleteTable()},null,8,["tooltip","disabled"])])]),_:1},8,["editor","tippy-options"]))}}),tte={class:"p-2 bg-white border rounded-lg shadow-sm dark:bg-black border-neutral-200 dark:border-neutral-800"},nte={class:"flex items-center gap-1"},Rh=o.defineComponent({__name:"ColumnsBubbleMenu",props:{editor:{},disabled:{type:Boolean,default:!1}},setup(t){const e=t,n=({editor:l})=>$0(l.view.state,"columns"),r=()=>lS(e.editor,"columns")?.getBoundingClientRect()||new DOMRect(-1e3,-1e3,0,0),i=()=>{e.editor.chain().focus().setLayout(Ba.SidebarLeft).run()},s=()=>{e.editor.chain().focus().setLayout(Ba.SidebarRight).run()},a=()=>{e.editor.chain().focus().setLayout(Ba.TwoColumn).run()};return(l,u)=>(o.openBlock(),o.createBlock(o.unref(Wu),{editor:l.editor,"plugin-key":"columns","should-show":n,"update-delay":0,"tippy-options":{offset:[0,8],popperOptions:{modifiers:[{name:"flip",enabled:!1}]},getReferenceClientRect:r,plugins:[o.unref(eL)],sticky:"popper"}},{default:o.withCtx(()=>[o.createElementVNode("div",tte,[o.createElementVNode("div",nte,[o.createVNode(Ge,{id:"panel-left",title:"ok",icon:"PanelLeft",tooltip:"tooltip",action:i,"is-active":()=>l.editor.isActive("columns",{layout:o.unref(Ba).SidebarLeft}),"tooltip-options":{sideOffset:15}},null,8,["is-active"]),o.createVNode(Ge,{id:"columns",title:"ok",icon:"Columns",tooltip:"tooltip",action:a,"is-active":()=>l.editor.isActive("columns",{layout:o.unref(Ba).TwoColumn}),"tooltip-options":{sideOffset:15}},null,8,["is-active"]),o.createVNode(Ge,{id:"panel-right",title:"ok",icon:"PanelRight",tooltip:"tooltip",action:s,"is-active":()=>l.editor.isActive("columns",{layout:o.unref(Ba).SidebarRight}),"tooltip-options":{sideOffset:15}},null,8,["is-active"])])])]),_:1},8,["editor","tippy-options"]))}}),rte={class:"flex items-center gap-2 p-2 bg-white border rounded-lg shadow-sm dark:bg-black border-neutral-200 dark:border-neutral-800"},ote=["href"],ite={class:"flex flex-nowrap"},ste=o.defineComponent({__name:"LinkViewBlock",props:{editor:{},link:{default:void 0}},emits:["clear","edit"],setup(t,{emit:e}){const{t:n}=Pt(),r=e;function i(){r("clear")}function s(){r("edit")}return(a,l)=>(o.openBlock(),o.createElementBlock("div",rte,[o.createElementVNode("a",{href:a.link,target:"_blank",rel:"noopener noreferrer",class:"text-sm underline break-all"},o.toDisplayString(o.unref(St.truncate)(a.link,{length:50,omission:"…"})),9,ote),a.link?(o.openBlock(),o.createBlock(o.unref(wo),{key:0,orientation:"vertical",class:"h-4"})):o.createCommentVNode("",!0),o.createElementVNode("div",ite,[o.createVNode(Ge,{icon:"Pencil",tooltip:o.unref(n)("editor.link.edit.tooltip"),action:s,"tooltip-options":{sideOffset:15}},null,8,["tooltip"]),o.createVNode(Ge,{icon:"Unlink",tooltip:o.unref(n)("editor.link.unlink.tooltip"),action:i,"tooltip-options":{sideOffset:15}},null,8,["tooltip"])])]))}}),Dh=o.defineComponent({__name:"LinkBubbleMenu",props:{editor:{},disabled:{type:Boolean,default:!1}},setup(t){const e=t,n=o.ref(!1),r=o.computed(()=>{const{href:l}=e.editor.getAttributes("link");return l}),i=o.computed(()=>e.editor.isActive("link"));function s(l,u,c){e.editor.chain().extendMarkRange("link").insertContent({type:"text",text:u,marks:[{type:"link",attrs:{href:l,target:c?"_blank":""}}]}).setLink({href:l}).focus().run(),n.value=!1}function a(){e.editor.chain().extendMarkRange("link").unsetLink().focus().run(),n.value=!1}return(l,u)=>o.withDirectives((o.openBlock(),o.createBlock(o.unref(Wu),{editor:l.editor,"update-delay":0,"tippy-options":{popperOptions:{modifiers:[{name:"flip",enabled:!0}]},appendTo:"parent",placement:"bottom-start",offset:[-2,16],zIndex:9999,onHidden:()=>{n.value=!1}}},{default:o.withCtx(()=>[o.createVNode(o.unref(ms),{open:n.value,"onUpdate:open":u[1]||(u[1]=c=>n.value=c)},{default:o.withCtx(()=>[o.createVNode(o.unref(tV),null,{default:o.withCtx(()=>[n.value?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(ste,{key:0,editor:l.editor,link:r.value,onClear:a,onEdit:u[0]||(u[0]=c=>n.value=!0)},null,8,["editor","link"]))]),_:1}),o.createVNode(o.unref(gs),{class:"p-0 border-0 w-fit shadow-none",align:"start",side:"bottom"},{default:o.withCtx(()=>[o.createVNode(D5,{class:"p-4",editor:l.editor,onOnSetLink:s},null,8,["editor"])]),_:1})]),_:1},8,["open"])]),_:1},8,["editor","tippy-options"])),[[o.vShow,i.value]])}}),cS=(t,e,n,r,i)=>{const s=o.ref(0),a=ct.useEventBus(ur.RENDER_SUPER_TEXT),l=T=>{if(!e.value||!t)return;const _=e.value.index,A=e.value.id,{state:V}=t,{tr:O}=V;let B=!1;V.doc.descendants((H,j)=>{if(H.attrs?.[rt.ID]===A){H.attrs[rt.TEXT]?.trim();const Y=T.trim();if(zc(Y))return O.delete(j,j+1),B=!0,!1;const{[rt.ELEMENT_ID]:N,...U}=H.attrs;return O.setNodeMarkup(j,void 0,{...U,[rt.TEXT]:Y}),B=!0,!1}return!0}),B&&t&&t.view.dispatch(O),_!==-1&&(n.value[_].text=T,n.value[_].textOriginal=T)},u=o.ref(new Map),c=()=>{if(!t?.view.dom)return[];const T=[],_=t?.view.dom.querySelectorAll("[node-id]"),A=new Map;return u.value.clear(),_.forEach(V=>{const O=V.getBoundingClientRect().top;A.has(O)||A.set(O,V),u.value.set(V.getAttribute("node-id")||"unknown",0)}),T.push(...A.values()),T},f=T=>{const _=T.closest(`#${r}`);if(!_)return;const A=_.getBoundingClientRect().top,V=_?.scrollTop;return T.getBoundingClientRect().top-(A-V)},p=(T,_)=>{const A=n.value.findIndex(V=>V.id===T);A>-1&&(n.value[A].status=_)},m=T=>T.replace(/<p><\/p>/g,"<p> </p>"),g=()=>{if(!n.value||n.value.length===0){s.value=0,u.value.clear();return}if(!i.value||i.value.length===0)return;const T=i.value,_=new Set(n.value.map(O=>O.id)),A=T.map(O=>({isHidden:O.classList.contains("hidden"),isTruncated:O.classList.contains("super-text-truncate")}));T.forEach(O=>{O.classList.remove("hidden"),O.classList.remove("super-text-truncate")});for(const O of u.value.keys())_.has(O)||u.value.delete(O);T.forEach(O=>{const B=O.getAttribute("book-mark-id");if(!B)return;const H=O.offsetTop+O.offsetHeight,j=u.value.get(B)||0;u.value.set(B,Math.max(H,j))}),T.forEach((O,B)=>{A[B].isHidden&&O.classList.add("hidden"),A[B].isTruncated&&O.classList.add("super-text-truncate")});let V=0;for(const O of u.value.values())O>V&&(V=O);s.value=V},v=async()=>{await o.nextTick();const _=c().map(A=>{const V=A.getAttribute("node-id"),O=A.getAttribute("book-mark-content"),B=A.getAttribute("page-id"),H=A.getAttribute("page-number"),j=A.getBoundingClientRect(),Y=A.getAttribute("line-id"),N=A.getAttribute("element-id");return{position:j,text:m(O),id:V,pageId:B,pageNumber:H,visiblePosition:f(A),status:0,lineId:Y,elementId:N,textOriginal:m(O)}});n.value=_},b=(T,_)=>{const A=T.bottom<=_.top,V=T.top>=_.bottom;return!(A||V)};async function w(){const T=i.value;if(!T||T.length===0){g();return}T.sort((_,A)=>{const V=Number(_.getAttribute("index")),O=Number(A.getAttribute("index"));return V-O}),T.forEach(_=>_.classList.remove("super-text-truncate")),T.forEach((_,A)=>{const V=_.getBoundingClientRect();T.slice(A+1).forEach(O=>{const B=O.getBoundingClientRect();b(V,B)&&_.classList.add("super-text-truncate")})}),g()}const x=async T=>{await o.nextTick();const _=t?.view.dom.querySelector(`[node-id='${T.dataId}']`),A=i.value.find(B=>{const H=B.getBoundingClientRect().top,j=_?.getBoundingClientRect().top;if(j==null)return!1;const Y=j-H;return Math.abs(Y-9)<=2});if(!A)return;const V=Number(A.getAttribute("index"));if(!T.text){A.querySelector(".super-text-lines").innerHTML=n.value[V].textOriginal,i.value.forEach(B=>B.classList.remove("hidden")),w();return}A.querySelector(".super-text-lines").innerHTML=m(T.text),A.classList.remove("super-text-truncate");const O=A.getBoundingClientRect();i.value.forEach((B,H)=>{if(H!==V){const j=B.getBoundingClientRect();b(O,j)&&B.classList.add("hidden")}}),g()},C=T=>{switch(T.action){case"hover":x(T.payload);break;case"status":p(T.payload.id,T.payload.status);break;case"render":v();break;default:console.log("There is no action")}},E=(T,_)=>{const A=T.currentTarget;A.classList.remove("super-text-truncate");const V=A.getBoundingClientRect();i.value.forEach((O,B)=>{if(B!==_){const H=O.getBoundingClientRect();b(V,H)&&O.classList.add("hidden")}}),g()},k=()=>{i.value.forEach(T=>T.classList.remove("hidden")),w()};return o.onBeforeMount(()=>{a.on(C),window.addEventListener("resize",v)}),o.onBeforeUnmount(()=>{a.off(C),window.removeEventListener("resize",v)}),o.watch(()=>n,async()=>{await o.nextTick(),w()},{deep:!0}),{onUpdate:l,hanldeTruncateSuperTexts:w,eventListener:C,handleMouseOver:E,handleMouseLeave:k,wrapperMinHeight:s}},ate=["index","book-mark-id","line-id","onMouseover"],lte=["innerHTML"],ute=Xr(o.defineComponent({__name:"SuperTextView",props:{editor:{},superPreviewCustomClass:{},minChars:{},fontSize:{},fixedWidth:{type:Boolean}},setup(t,{expose:e}){const n=t,r=o.ref([]),i=o.ref([]),s=o.ref(!1),a=o.ref(!1),l=o.ref(null),u=o.inject("isMobile",!1),c=o.inject("fontWeight",o.ref("")),f=o.computed(()=>o.unref(c)||"normal"),p=o.inject("canEditSuper",o.ref(!0)),{onUpdate:m,handleMouseOver:g,handleMouseLeave:v,wrapperMinHeight:b}=cS(n.editor,l,i,"editor-container",r),w=(_,A)=>{p.value&&(l.value={id:_.id,text:_.text,elementId:_.elementId,index:A},s.value=!0,u&&(a.value=!0))},x=_=>fd(_?n.superPreviewCustomClass?.completedSuper??"bg-black":n.superPreviewCustomClass?.unproducedSuper??"bg-red-500"),C=o.computed(()=>n.fontSize??""),E=o.computed(()=>n.fixedWidth??!1),{contentInner:k,measuredMinWidth:T}=pf({minChars:n.minChars,fontSize:C,fixed:E});return e({measuredMinWidthComment:T}),(_,A)=>{const V=Ot;return o.openBlock(),o.createElementBlock("div",{id:"super-text-view-wrapper",ref_key:"contentInner",ref:k,style:o.normalizeStyle({width:`${Number(o.unref(T))+25}px`,minHeight:`${o.unref(b)}px`}),class:o.normalizeClass(o.unref(ke)("relative border border-ed-gray-400 dark:bg-black rounded-[3px] mr-2.5",_.fixedWidth&&"overflow-hidden",_.superPreviewCustomClass?.overall??"bg-ed-gray-50"))},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.value,(O,B)=>(o.openBlock(),o.createElementBlock("div",{key:O.id,ref_for:!0,ref_key:"superTextRefs",ref:r,index:B,"book-mark-id":O.id,"line-id":O.lineId,class:o.normalizeClass(o.unref(ke)("super-text-view","absolute w-full px-2 translate-y-[-10px] group",{})),style:o.normalizeStyle({top:`${O.visiblePosition||O.position?.top}px`}),onMouseover:H=>o.unref(g)(H,B),onMouseleave:A[0]||(A[0]=(...H)=>o.unref(v)&&o.unref(v)(...H))},[o.createVNode(o.unref(cb),{role:"text",variant:"outline",class:o.normalizeClass(o.unref(ke)("w-full px-1 pt-0 m-0 !leading-tight rounded-sm text-white border-transparent cursor-pointer",_.fixedWidth?"whitespace-nowrap overflow-hidden":"wrap-anywhere whitespace-break-spaces",O.elementId?_.superPreviewCustomClass?.completedSuper??"bg-black":_.superPreviewCustomClass?.unproducedSuper??"bg-red-500",{"cursor-default":!o.unref(p)})),onDblclick:H=>w(O,B)},{default:o.withCtx(()=>[o.createElementVNode("div",{class:"super-text-lines",style:o.normalizeStyle({fontWeight:f.value}),innerHTML:O.text},null,12,lte),o.createVNode(V,{name:"triangle",class:o.normalizeClass(["absolute top-[0.4em] rotate-90 w-3 h-3 right-0",x(O.elementId)])},null,8,["class"])]),_:2},1032,["class","onDblclick"])],46,ate))),128)),!o.unref(u)&&l.value?(o.openBlock(),o.createBlock(Wc,{key:0,open:s.value,editor:n.editor,"super-text-init":l.value.text,"super-text-element-id":l.value.elementId,onClose:A[1]||(A[1]=O=>s.value=!1),onSave:o.unref(m)},null,8,["open","editor","super-text-init","super-text-element-id","onSave"])):o.createCommentVNode("",!0)],6)}}}),[["__scopeId","data-v-485b25ac"]]),cte=["index","book-mark-id","line-id","onMouseover"],dte=["innerHTML"],fte=Xr(o.defineComponent({__name:"SuperTextViewComment",props:{editor:{},disableSuperInput:{type:Boolean},superPreviewCustomClass:{},fixedWidth:{type:Boolean}},setup(t){const e=t,n=o.ref([]),r=o.ref([]),i=o.ref(!1),s=o.ref(!1),a=o.ref(null),l=o.inject("isMobile",!1),u=o.inject("fontWeight",o.ref("")),c=o.computed(()=>o.unref(u)||"normal"),f=o.inject("isEditable",o.ref(!0)),{onUpdate:p,handleMouseOver:m,handleMouseLeave:g,wrapperMinHeight:v}=cS(e.editor,a,r,"editor-container-comment",n),b=(C,E)=>{f.value&&(a.value={id:C.id,text:C.text,elementId:C.elementId,index:E},e.disableSuperInput||(i.value=!0),l&&(s.value=!0))},w=C=>fd(C?e.superPreviewCustomClass?.completedSuper??"bg-black":e.superPreviewCustomClass?.unproducedSuper??"bg-red-500"),x=o.inject("measuredMinWidthComment",0);return(C,E)=>{const k=Ot;return o.openBlock(),o.createElementBlock("div",{id:"super-text-view-wrapper",style:o.normalizeStyle({width:`${Number(o.unref(x))+25}px`,minHeight:`${o.unref(v)}px`}),class:o.normalizeClass(o.unref(ke)("relative border border-ed-gray-400 dark:bg-black rounded-[3px] mr-2.5",C.fixedWidth&&"overflow-hidden",C.superPreviewCustomClass?.overall??"bg-ed-gray-50"))},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.value,(T,_)=>(o.openBlock(),o.createElementBlock("div",{key:T.id,ref_for:!0,ref_key:"superTextRefs",ref:n,index:_,"book-mark-id":T.id,"line-id":T.lineId,class:o.normalizeClass(o.unref(ke)("super-text-view","absolute w-full px-2 translate-y-[-10px] group",{})),style:o.normalizeStyle({top:`${T.visiblePosition||T.position?.top}px`}),onMouseover:A=>o.unref(m)(A,_),onMouseleave:E[0]||(E[0]=(...A)=>o.unref(g)&&o.unref(g)(...A))},[o.createVNode(o.unref(cb),{role:"text",variant:"outline",class:o.normalizeClass(o.unref(ke)("w-full px-1 pt-0 m-0 !leading-tight rounded-sm text-white border-transparent cursor-pointer",C.fixedWidth?"whitespace-nowrap overflow-hidden":"wrap-anywhere whitespace-break-spaces",T.elementId?C.superPreviewCustomClass?.completedSuper??"bg-black":C.superPreviewCustomClass?.unproducedSuper??"bg-red-500",{"cursor-default":!o.unref(f)})),onDblclick:A=>b(T,_)},{default:o.withCtx(()=>[o.createElementVNode("div",{class:"super-text-lines",style:o.normalizeStyle({fontWeight:c.value}),innerHTML:T.text},null,12,dte),o.createVNode(k,{name:"triangle",class:o.normalizeClass(["absolute top-[0.4em] rotate-90 w-3 h-3 right-0",w(T.elementId)])},null,8,["class"])]),_:2},1032,["class","onDblclick"])],46,cte))),128)),!o.unref(l)&&a.value&&!C.disableSuperInput?(o.openBlock(),o.createBlock(Wc,{key:0,open:i.value,editor:e.editor,"super-text-init":a.value.text,"super-text-element-id":a.value.elementId,onClose:E[1]||(E[1]=T=>i.value=!1),onSave:o.unref(p)},null,8,["open","editor","super-text-init","super-text-element-id","onSave"])):o.createCommentVNode("",!0)],6)}}}),[["__scopeId","data-v-3487c7fb"]]),dS=t=>{console.log(t),t=t.replace(/\s*style="[^"]*"/g,""),t=t.replace(/<iframe\b[\s\S]*?<\/iframe\s*>/gi,"");const e=t.match(/<!--StartFragment-->([\s\S]*?)<!--EndFragment-->/),r=(e?e[1]:t).replace(/<br\s*\/?>/gi,`
|
|
343
|
+
`){R.push(F),F="";continue}if(F+=X,V.measureText(F).width>P())for(;V.measureText(F).width>P();){const ae=L(F,P());ae<=0?(R.push(F.charAt(0)),F=F.slice(1)):(R.push(F.slice(0,ae)),F=F.slice(ae))}}return R.push(F),R.map(X=>`<p>${X}</p>`).join("")}const B=o.computed(()=>{const Y=r.parentEditor?.storage.superText.superInputModal?.props?.guidelineLeftOffset;return s.value||!Y?{}:{backgroundImage:"linear-gradient(to right, #d1d5db 1px, transparent 1px)",backgroundSize:"1px 100%",backgroundRepeat:"no-repeat",backgroundPosition:Yt(Y)}}),{isScrolling:H,handleScroll:j}=Xl();return e({insertSpecialCharater:m,isChecked:u,toggleSpellCheck:g,wrapText:O,editor:p}),(Y,N)=>(o.openBlock(),o.createElementBlock("div",{ref_key:"contentInner",ref:v,class:o.normalizeClass(o.unref(ke)("h-40 overflow-y-auto border focus-within:border-ed-input-focus rounded-[3px] p-2.5 relative",Y.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(H)&&"scrollbar-thumb-transparent")),style:o.normalizeStyle([o.unref(_),o.unref(B),o.unref(T)]),onScroll:N[0]||(N[0]=(...U)=>o.unref(j)&&o.unref(j)(...U))},[o.createVNode(o.unref(Yn),{id:"editor-panel",editor:o.unref(p),class:o.normalizeClass(o.unref(ke)("vdc-editor relative h-full"))},null,8,["editor","class"])],38))}}),qJ={class:"sr-only"},KJ={class:"grid m-2.5 p-2.5 gap-y-2.5 rounded border border-gray-200"},GJ={class:"grid grid-cols-[60px,1fr] gap-x-2"},XJ={class:"flex items-center space-x-2 text-xs font-normal [&>input[type='checkbox']]:h-[20px] [&>input[type='checkbox']]:w-[20px] [&>input[type='checkbox']]:!border-ed-border [&>input[type='checkbox']]:shadow"},YJ=["checked"],JJ={for:"spellcheck",class:"select-none whitespace-nowrap"},ZJ={class:"flex gap-x-1"},QJ={class:"ml-auto"},NJ={class:"grid grid-cols-[60px,1fr] gap-x-2"},eZ={class:"text-right text-sm p-2"},tZ={class:"grid grid-cols-[60px,1fr] gap-x-2"},mE=5,Wc=o.defineComponent({__name:"SuperInputDialog",props:{editor:{},open:{type:Boolean},superTextInit:{},superTextElementId:{}},emits:["close","save"],setup(t,{emit:e}){const n=e,r=t,{t:i}=Pt(),s=o.ref(""),a=o.ref(""),l=o.ref(null),u=o.ref(!1),c=ct.useLocalStorage("superInputModalPosition",null),f=o.reactive({x:0,y:0}),p=o.ref(!1),m={x:0,y:0},g=o.ref(!1),v=o.ref(!1),b=o.ref(!1),w=F=>{p.value=!0;const R=F.currentTarget.closest(".draggable-dialog").getBoundingClientRect();m.x=F.clientX-R.left,m.y=F.clientY-R.top,document.addEventListener("mousemove",x),document.addEventListener("mouseup",C)},x=F=>{p.value&&(f.x=F.clientX-m.x,f.y=F.clientY-m.y)},C=()=>{p.value=!1,c.value={x:f.x,y:f.y},document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",C)};o.watch(()=>r.open,async F=>{if(!F)return;v.value=!1,r.superTextInit&&(s.value=r.superTextInit,r.superTextElementId&&(a.value=r.superTextElementId)),await o.nextTick();const R=document.querySelector(".draggable-dialog");if(!R)return;R.getBoundingClientRect();const K=window.innerWidth,X=window.innerHeight;c.value&&c.value.x!==void 0&&c.value.y!==void 0?(f.x=c.value.x,f.y=c.value.y):(f.x=Math.max((K-R.offsetWidth)/2,0),f.y=Math.max((X-R.offsetHeight)/2,0))},{immediate:!0});const E=()=>{n("close"),s.value="",a.value="",u.value=!1},k=()=>{if(l.value?.editor.commands.hasInvalidChar()){b.value=!0;return}s.value=l.value.wrapText(),a.value="",v.value?g.value=!0:n("close"),n("save",s.value),s.value=""},T=()=>{g.value=!1,n("close")},_=r.editor?.extensionManager.extensions.find(F=>F.name==="superText")?.options.specialCharModal,A=o.inject("fontFamily",""),V=o.computed(()=>Ch(r.editor,Rc)&&o.unref(A)?o.unref(A):r.editor?.storage.superText.superInputModal?.props?.fontFamily),O=o.inject("fontWeight",o.ref("")),B=o.computed(()=>o.unref(O)||void 0),H=ct.useLocalStorage("recentSpecialChars",[]),j=F=>{if(!F)return;const R=(H.value??[]).filter(K=>K!==F);R.unshift(F),H.value=R.slice(0,mE)},Y=F=>{l.value?.insertSpecialCharater(F)},N=(F,R)=>{R&&(l.value?.insertSpecialCharater(F),j(F))},U=o.computed(()=>l.value?.isChecked),P=()=>{l.value?.toggleSpellCheck()};o.onUnmounted(()=>{document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",C)}),o.watch(s,F=>{!r.superTextElementId||r.superTextElementId===""||(v.value=F!==(r.superTextInit??""))});const L=o.computed(()=>l.value?.editor);return(F,R)=>{const K=ch,X=uh,ae=lh,de=ah,Ee=pE,ie=sb,me=Pc,J=Dc,ee=EX;return o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createVNode(J,{open:F.open},{default:o.withCtx(()=>[o.createVNode(o.unref(Kg),null,{default:o.withCtx(()=>[o.createVNode(o.unref(Qg),{class:"!pointer-events-none bg-black/30"}),o.createVNode(me,{"is-overlay-transparent":"",class:"p-0 gap-0 !animate-none !transition-none max-w-max","as-child":""},{default:o.withCtx(()=>[o.createElementVNode("div",{class:"draggable-dialog fixed z-[70] pointer-events-auto",style:o.normalizeStyle({top:"0px",left:"0px",transform:`translate(${f.x}px, ${f.y}px)`,fontFamily:o.unref(V),fontWeight:o.unref(B)})},[o.createVNode(ae,{class:"bg-blue-500 text-white p-2.5 rounded-t-[5px] cursor-move",onMousedown:o.withModifiers(w,["prevent"])},{default:o.withCtx(()=>[o.createVNode(K,null,{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(i)("editor.superinput")),1)]),_:1}),o.createVNode(X,{class:"absolute right-3 top-3 text-white",onClick:E},{default:o.withCtx(()=>[o.createVNode(o.unref(cc),{class:"w-5 h-5"}),o.createElementVNode("span",qJ,o.toDisplayString(F.$t("editor.close")),1)]),_:1})]),_:1}),o.createVNode(de),o.createElementVNode("div",KJ,[o.createElementVNode("div",GJ,[R[5]||(R[5]=o.createElementVNode("label",null," ",-1)),o.createElementVNode("div",{class:o.normalizeClass(o.unref(ke)("flex gap-x-6",o.unref(H).length===mE&&"gap-x-4"))},[o.createVNode(mn,{class:"text-[#65558F] bg-[#ECE6F0] hover:bg-[#ECE6F0]/90 shadow text-xs rounded font-normal h-[25px] px-3",onClick:R[0]||(R[0]=te=>u.value=!0)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(i)("editor.insert.symbol")),1)]),_:1}),o.createElementVNode("div",XJ,[o.createElementVNode("input",{id:"spellcheck",type:"checkbox",class:"shrink-0",checked:o.unref(U),onChange:P},null,40,YJ),o.createElementVNode("label",JJ,o.toDisplayString(o.unref(i)("editor.menubar.menu.spellCheck")),1)]),o.createElementVNode("div",ZJ,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(o.unref(H),te=>(o.openBlock(),o.createBlock(mn,{key:te,variant:"outline",size:"xs",class:"h-[25px] w-[25px] p-0",onClick:se=>Y(te)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(te),1)]),_:2},1032,["onClick"]))),128))]),o.createElementVNode("div",QJ,[o.unref(L)?(o.openBlock(),o.createBlock(Ee,{key:0,editor:o.unref(L),"is-enable-spell-check-real-time":o.unref(L)?.extensionStorage.spellchecker.spellchecker.proofreader.enabled,align:"left"},null,8,["editor","is-enable-spell-check-real-time"])):o.createCommentVNode("",!0)])],2),u.value?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(o.unref(_)?.component),o.mergeProps({key:0,"custom-class":"!z-[70] !pointer-events-auto","font-family":o.unref(V)},o.unref(_).props,{onSelectedChar:N,onClose:R[1]||(R[1]=te=>u.value=!1)}),null,16,["font-family"])):o.createCommentVNode("",!0)]),o.createElementVNode("div",NJ,[o.createElementVNode("label",eZ,o.toDisplayString(o.unref(i)("editor.detail")),1),o.createVNode(Eb,{ref_key:"simpleEditorRef",ref:l,modelValue:s.value,"onUpdate:modelValue":R[2]||(R[2]=te=>s.value=te),"parent-editor":F.editor,class:""},null,8,["modelValue","parent-editor"])]),o.createElementVNode("div",tZ,[R[6]||(R[6]=o.createElementVNode("label",{class:"text-right text-sm p-2"},"ID",-1)),o.createVNode(ws,{modelValue:a.value,"onUpdate:modelValue":R[3]||(R[3]=te=>a.value=te),class:"rounded-none","default-value":a.value,disabled:""},null,8,["modelValue","default-value"])])]),o.createVNode(ie,{class:"sm:justify-center pb-3.5 pt-1"},{default:o.withCtx(()=>[o.createVNode(mn,{as:"button",variant:"default",class:"bg-blue-500 hover:bg-blue-500/90",onClick:k},{default:o.withCtx(()=>[o.createVNode(o.unref(C1),{class:"w-5 h-5 mr-2"}),o.createTextVNode(" "+o.toDisplayString(o.unref(i)("editor.check")),1)]),_:1}),o.createVNode(mn,{as:"button",variant:"destructive",onClick:E},{default:o.withCtx(()=>[o.createVNode(o.unref(cc),{class:"w-5 h-5 mr-2"}),o.createTextVNode(" "+o.toDisplayString(F.$t("editor.close")),1)]),_:1})]),_:1})],4)]),_:1})]),_:1})]),_:1},8,["open"]),o.createVNode(ee,{open:g.value,onClose:T},null,8,["open"]),o.createVNode(ee,{title:"Information",message:"{ 과 } 는 입력이 제한된 문자열 입니다.",iconName:"MessageCircleWarning",confirmText:"Ok",open:b.value,onClose:R[4]||(R[4]=te=>b.value=!1)},null,8,["open"])],64)}}}),Sb=o.defineComponent({__name:"SelectContextMenu",props:{editor:{},mode:{},superTextStore:{},disabled:{type:Boolean},disableSuperInput:{type:Boolean}},setup(t,{expose:e}){const n=t,{t:r}=Pt(),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===Te.EDITOR||n.mode===Te.PLAIN_TEXT||!l.value||n.disableSuperInput);function c(){if(!n.editor)return"";const{from:C,to:E}=n.editor.state.selection,k=n.editor.state.doc.cut(C,E),_=Ir.fromSchema(n.editor.schema).serializeFragment(k.content),A=document.createElement("div");return A.appendChild(_),A.innerHTML}const f=()=>{const{view:C}=n.editor,{from:E,to:k}=C.state.selection,T=c();s.text=T,s.from=E,s.to=k},p=()=>i.value=!i.value,m=()=>{u.value||(i.value=!0,f())},g=()=>i.value=!1,v=C=>{if(zc(C.trim())){i.value=!1;return}const E=n?.superTextStore.addMoreSuperText(C);n.editor&&n.editor.commands.insertContentAt(s.from,{type:"superText",attrs:{"data-id":E,"data-text":C}}),i.value=!1,requestAnimationFrame(()=>{n.editor.commands.setTextSelection(s.from+1),n.editor.view.focus()})},b=o.ref(!1),w=async C=>{if(C){const E=await n.editor.hasClipboard?.();b.value=!!E}},x=()=>{if(u.value||!n.editor)return;const{view:C,state:E}=n.editor,{from:k,to:T}=E.selection;s.from=k,s.to=T,s.text="",C.dom.blur(),i.value=!0};return e({toggleDialog:p,openDialog:m,closeDialog:g}),(C,E)=>{const k=Wc,T=ib,_=ob,A=rb,V=nb;return C.disabled?o.renderSlot(C.$slots,"default",{key:0}):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createVNode(k,{open:i.value,editor:C.editor,"super-text-init":s.text,onClose:p,onSave:v},null,8,["open","editor","super-text-init"]),o.createVNode(V,{"onUpdate:open":w},{default:o.withCtx(()=>[o.createVNode(T,{as:"template",class:"relative",disabled:o.unref(u),onDblclick:o.withModifiers(x,["prevent","stop"])},{default:o.withCtx(()=>[o.renderSlot(C.$slots,"default")]),_:3},8,["disabled"]),o.createVNode(A,null,{default:o.withCtx(()=>[C.disableSuperInput?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(_,{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(_,{key:1,onSelect:E[0]||(E[0]=O=>C.editor?.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(_,{key:2,onSelect:E[1]||(E[1]=O=>C.editor?.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(_,{key:3,disabled:!b.value,onSelect:E[2]||(E[2]=O=>C.editor?.commands.pasteContent())},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(r)("editor.paste")),1)]),_:1},8,["disabled"])):o.createCommentVNode("",!0)]),_:1})]),_:3})],64))}}}),nZ={id:"editor-panel",class:"flex relative w-full h-full"},rZ=Xr(o.defineComponent({__name:"PageNode",props:ta,setup(t){const{state:e,page:n,superTextStore:r}=bn(),{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===Te.REPORT),{width:p,height:m}=i,g=o.computed(()=>s?`calc(${m} - ${a?.top??0} - ${a?.bottom??0}`:"max-content"),v=ct.useEventBus(ur.SUPER_VIEW_PAGE);return o.watch(()=>t.node.attrs,b=>{v.emit(b.pageNumber)},{immediate:!0}),(b,w)=>{const x=Sb;return o.openBlock(),o.createBlock(o.unref(ea),{id:b.node.attrs.id,ref_key:"containerRef",ref:l,"page-number":b.node.attrs.pageNumber,class:"overflow-hidden umo-page-node-view w-full border rounded-[3px] border-[#999999]",style:o.normalizeStyle({"--umo-page-margin-top":o.unref(a)?.top??"0","--umo-page-margin-bottom":o.unref(a)?.bottom??"0","--umo-page-margin-left":o.unref(a)?.left??"0","--umo-page-margin-right":o.unref(a)?.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",nZ,[o.createVNode(x,{mode:c.value?o.unref(Te).REPORT:o.unref(Te).EDITOR,editor:b.editor,"super-text-store":o.unref(r)},{default:o.withCtx(()=>[o.createVNode(o.unref(tx),{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 gE(t,e){const n=t.storedMarks??(t.selection.$to.parentOffset&&t.selection.$from.marks());if(n){const r=n.filter(i=>e?.includes(i.type.name));t.tr.ensureMarks(r)}}const oZ=({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=kh(c,l.node().type.name,l.node().attrs);if(f.id=Kv(),f.extend&&(f.extend=!1),s instanceof Re&&s.node.isBlock)return!l.parentOffset||!mr(a,l.pos)?!1:(r&&(t&&gE(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 Ie&&e.deleteSelection();const m=l.depth===0?void 0:t4(l.node(-1).contentMatchAt(l.indexAfter(-1)));let g=p&&m?[{type:m,attrs:f}]:void 0,v=mr(e.doc,e.mapping.map(l.pos),1,g);if(!g&&!v&&mr(e.doc,e.mapping.map(l.pos),1,m?[{type:m}]:void 0)&&(v=!0,g=m?[{type:m,attrs:f}]:void 0),v&&(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 b=e.mapping.map(l.before()),w=e.doc.resolve(b);l.node(-1).canReplaceWith(w.index(),w.index()+1,m)&&e.setNodeMarkup(e.mapping.map(l.before()),m)}t&&gE(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},iZ=t=>({tr:e,state:n,dispatch:r,editor:i})=>{const s=vn(t,n.schema),{$from:a,$to:l}=n.selection;if((n.selection instanceof Re?n.selection.node:null)?.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 b=ge.empty;const w=a.index(-1)?1:a.index(-2)?2:3;for(let _=a.depth-w;_>=a.depth-3;_-=1)b=ge.from(a.node(_).copy(b));const x=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,C=kh(f,a.node().type.name,a.node().attrs),E=s.contentMatch.defaultType?.createAndFill(C)??void 0;b=b.append(ge.from(s.createAndFill(null,E)??void 0));const k=a.before(a.depth-(w-1));e.replace(k,a.after(-x),new Se(b,4-w,0));let T=-1;e.doc.nodesBetween(k,e.doc.content.size,(_,A)=>{if(T>-1)return!1;_.isTextblock&&_.content.size===0&&(T=A+1)}),T>-1&&e.setSelection(Ie.near(e.doc.resolve(T))),e.scrollIntoView()}return!0}const p=l.pos===a.end()?c.contentMatchAt(0).defaultType:null,m=kh(f,c.type.name,c.attrs),g=kh(f,a.node().type.name,a.node().attrs);m.id=Kv(),g.id=Kv(),e.delete(a.pos,l.pos);const v=p?[{type:s,attrs:m},{type:p,attrs:g}]:[{type:s,attrs:m}];if(!mr(e.doc,a.pos,2))return!1;if(r){const{selection:b,storedMarks:w}=n,{splittableMarks:x}=i.extensionManager,C=w??(b.$to.parentOffset&&b.$from.marks());if(e.split(a.pos,2,v).scrollIntoView(),!C||!r)return!0;const E=C.filter(k=>x.includes(k.type.name));e.ensureMarks(E)}return!0},sZ=[eh,Np,th,Gv,nh,Ss,Yv,Hl,Zv,Nv,Jv,_a,zl,Ci,Qv,eb,Xv,Gr],aZ=Lt.create({priority:200,name:`${Gr}`,content:"block*",group:`${Gr}`,isolating:!0,selectable:!1,draggable:!1,isLeaf:!0,addOptions(){return{SystemAttributes:{},nodesComputed:{},View:na(rZ),types:[],slots:{}}},addAttributes(){return{HTMLAttributes:{},id:{default:$r(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",{...wt(e),"data-type":this.name},0]},addCommands(){return{splitBlock:oZ,splitListItem:iZ,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:sZ.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=ze.atStart(a).from===c;return!l||!p||!f.type.isTextblock||f.textContent.length?!1:r.clearNodes()}),()=>vE(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(ze.atEnd(l).from===c&&!u.parentOffset)return r.deleteNode(Gr);const f=ai(p=>p.type.name===Gr)(a);if(f){if(!f.node.firstChild)return r.deleteNode(Gr);const p=f.node.firstChild.type;if(f.start+ze.atStart(f.node).from===c){const g=Ie.create(l,f.start-2,f.start-2),v=ai(b=>b.type.name===Gr)(g);if(v){const b=ze.atEnd(v.node).from+v.start,w=Ie.create(l,b,b);if(p===v.node.lastChild.type){const{parent:x}=w.$anchor;return FG(x,i.schema)?s.setSelection(w):s.step(new hn(b,c,Se.empty)),!0}s.setSelection(w)}return!0}}return!1})]),Delete:()=>this.editor.commands.first(({commands:r})=>[()=>vE(r),()=>r.command(({tr:i})=>{const{selection:s,doc:a}=i,{$anchor:l}=s,u=l.node(),c=ai(f=>f.type.name===Hl)(s);return c&&c.start+ze.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(ze.atEnd(a).from===u)return r.deleteNode(Gr);const c=ai(f=>f.type.name===Gr)(s);if(c&&c.start+ze.atEnd(c.node).from===u){const p=Ie.create(a,u+2,u+2),m=ai(g=>g.type.name===Gr)(p);if(m){const g=ze.atStart(m.node).from+m.start,v=Ie.create(a,g,g);if(ai(w=>w.attrs.extend)(v))return i.step(new hn(u,g,Se.empty)),!0}}return!1})]),Tab:()=>this.editor.commands.first(({commands:r})=>[()=>!this.editor.isActive("table")]),"Mod-Enter":()=>this.editor.commands.setPageBreak()}},addNodeView(){return this.options.View}});function kh(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 vE=t=>t.command(({tr:e})=>{const{selection:n,doc:r}=e,i=n4(r,{from:n.from,to:n.to},s=>s.type.name===Hl);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()}),bE={"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.moveUp":"Move up","editor.image.menu.moveDown":"Move down","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"},yE={"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.moveUp":"위로 이동","editor.image.menu.moveDown":"아래로 이동","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":"확인"},Oa=BW({legacy:!1,locale:"en",fallbackLocale:"en",messages:{en:bE,ko:yE}}),lZ=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()}}}),uZ=["data-font"],cZ=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===Te.EDITOR),{t:r}=Pt(),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 f=e.editor.extensionManager.extensions.find(m=>m.name==="fontFamily").options;let p=[];return St.isEmpty(f.fontFamilyList)?p=i:p=f.fontFamilyList.filter(m=>m.enabled!==!1).map(m=>({label:m.label,value:m.value})),[{label:r("editor.fontFamily.default"),value:r("editor.fontFamily.default")},...p]}),l=o.computed(()=>{const f={label:r("editor.fontFamily.default"),value:r("editor.fontFamily.default")};return n.value?(D0(e.editor.state,"textStyle").fontFamily??e.editor.getAttributes("paragraph").fontFamily??e.editor.getAttributes("heading").fontFamily)||f.value:s.value||f.value});function u(f){f.value===l.value||f.value===r("editor.fontFamily.default")?(e.editor.chain().focus().unsetFontFamily().run(),s.value=null):(s.value=f.value,e.editor.chain().focus().setFontFamily(f.value).run()),e.editor.commands.setForceCloseBubble(!0)}e.editor.on("selectionUpdate",({editor:f})=>{f.state.selection.empty&&e.editor.commands.resetForceCloseBubble()});const c=o.computed(()=>{const f=a.value[0]?.label||r("editor.fontFamily.default");return a.value.find(p=>p.value===l.value)?.label||f});return(f,p)=>(o.openBlock(),o.createBlock(ga,{disabled:f.disabled,tooltip:f.tooltip,title:c.value,btn_class:`min-w-20 ${f.customClass}`,class:"inside-toolbar"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.value,(m,g)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:g},[o.createVNode(o.unref(Ml),{checked:l.value===m.value,onClick:v=>u(m)},{default:o.withCtx(()=>[o.createElementVNode("span",{class:"ml-1 h-full","data-font":m.label,style:o.normalizeStyle({fontFamily:m.value??void 0})},o.toDisplayString(m.label),13,uZ)]),_:2},1032,["checked","onClick"]),m.label===o.unref(r)("editor.fontFamily.default")&&f.showDefaultDivider?(o.openBlock(),o.createBlock(o.unref(S1),{key:0})):o.createCommentVNode("",!0)],64))),128))]),_:1},8,["disabled","tooltip","title","btn_class"]))}}),wE=lZ.extend({name:"fontFamily",addOptions(){return{...this.parent?.(),types:["textStyle"],fontFamilyList:[],button({editor:t,extension:e,t:n}){return{component:cZ,componentProps:{editor:t,disabled:!t.can().setFontFamily(""),tooltip:n("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}).command(({tr:n})=>(r5(n,t),!0)).run(),unsetFontFamily:()=>({chain:t})=>t().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().command(({tr:e})=>(r5(e,null),!0)).run()}},addStorage(){return{value:null}},onUpdate(){this.storage.value=this.editor.getAttributes("textStyle").fontFamily??this.editor.getAttributes("paragraph").fontFamily??this.editor.getAttributes("heading").fontFamily},onSelectionUpdate(){this.storage.value=this.editor.getAttributes("textStyle").fontFamily??this.editor.getAttributes("paragraph").fontFamily??this.editor.getAttributes("heading").fontFamily}}),dZ=Qe.create({name:"fontWeight",addOptions(){return{...this.parent?.(),types:["textStyle"]}},addGlobalAttributes(){return[{types:["paragraph","textStyle"],attributes:{fontWeight:{default:null,parseHTML:t=>t.style.fontWeight||null,renderHTML:t=>t.fontWeight?{style:`font-weight: ${t.fontWeight}`}:{}}}}]},addCommands(){return{setFontWeight:t=>({chain:e})=>e().setMark("textStyle",{fontWeight:t}).run(),unsetFontWeight:()=>({chain:t})=>t().setMark("textStyle",{fontWeight:null}).removeEmptyTextStyle().run()}},addStorage(){return{value:null}},onUpdate(){this.storage.value=this.editor.getAttributes("textStyle").fontWeight}}),fZ={class:"flex gap-2"},pZ=["disabled"],hZ=Xr(o.defineComponent({__name:"FontSizeIncreaseDecrease",props:{editor:Object},setup(t){const e=o.inject("fontSize"),n=o.computed(()=>e.value?parseInt(e.value)===parseInt(ug[0])||parseInt(e.value)<parseInt(ug[0]):!1),r=ct.useEventBus(ur.INCREASE_DECREASE_FONTSIZE),i=s=>{r.emit(s)};return(s,a)=>{const l=da,u=ca,c=fa;return o.openBlock(),o.createElementBlock("div",fZ,[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(Ot),{name:"Plus",class:"w-6 h-6"})])]),_:1}),o.createVNode(o.unref(is),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(Ot),{name:"Minus",class:"w-6 h-6"})],8,pZ)]),_:1}),o.createVNode(o.unref(is),null,{default:o.withCtx(()=>a[3]||(a[3]=[o.createTextVNode(" 글꼴 크기 작게 ")])),_:1})]),_:1})]),_:1})])}}}),[["__scopeId","data-v-250d04b3"]]),mZ=Fn.create({name:"fontSizeIncreaseDecrease",addOptions(){return{defaultSize:"14px",button({editor:t}){return{component:hZ,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})}}}),_b=Qe.create({name:"painter",addOptions(){return{...this.parent?.(),button:({editor:t,extension:e,t:n})=>({component:Ge,componentProps:{action:()=>{t.commands.setPainter(t?.state.selection.$head.marks())},icon:"PaintRoller",tooltip:n("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 ot({key:new Et("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}}}})]}}),Tb=()=>$r(10),xE=new Et("attrkey"),gZ=t=>new ot({key:xE,state:{init:()=>!1,apply:n=>n.getMeta("initSplit")},appendTransaction(n,r,i){const{tr:s}=i;let a=!1;const l=xE.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:v}=f,b=c.includes(v.id)?Tb():v.id||Tb();t.includes(f.type.name)&&(s.setNodeMarkup(p,void 0,{...v,id:b,"number-line":g+1}),a=!0),c.push(b)})}return a?s:null}}),CE=[eh,Np,th,Gv,nh,Ss,Yv,Hl,Zv,Nv,Jv,_a,zl,Ci,Qv,eb,Xv,Gr],vZ=Qe.create({name:"autoId",addGlobalAttributes(){return[{types:CE.concat(this.options.types||[]),attributes:{id:{default:Tb()},extend:{default:!1},class:{default:null},"number-line":{default:null}}}]},addProseMirrorPlugins(){return[gZ(CE.concat(this.options.types||[]))]}}),bZ=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,yZ=Lt.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",wt(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[c4({find:bZ,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}}),wZ=["src","alt"],xZ={key:0,class:"image-resizer"},CZ=["onMousedown","onTouchstart"],kZ=o.defineComponent({__name:"ImageView",props:{...ta,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.inject("isMobile",!1),i=o.ref({width:ix,height:ix}),s=o.ref({width:0,height:0}),a=o.ref(!1),l=o.ref({x:0,y:0,w:0,h:0,dir:""}),u=o.computed(()=>{const{src:k,alt:T,width:_,height:A,flipX:V,flipY:O}=e.node.attrs,B=[];V&&B.push("rotateX(180deg)"),O&&B.push("rotateY(180deg)");const H=B.join(" ");return{src:k||void 0,alt:T||void 0,style:{width:fg(_)?`${_}px`:_,height:fg(A)?`${A}px`:A,transform:H||"none"}}});o.computed(()=>({width:o.unref(u).style.width==="100%"?"100%":void 0}));const c=o.ref(null),f=new ResizeObserver(k=>{for(const T of k){const{width:_,height:A}=T.contentRect;s.value={width:_,height:A},e.updateAttributes({originWidth:_,originHeight:A})}});function p(){const{editor:k,getPos:T}=e;k.commands.setNodeSelection(T())}const m=St.throttle(()=>{const{editor:k}=e;i.value.width=parseInt(getComputedStyle(k.view.dom).width,10)},sx);function g(k,T){k.preventDefault(),k.stopPropagation();let _=0,A=0;const V=document.querySelector(".image-resizer");if(V&&(V.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:O,height:B}=o.unref(s),H=O/B;let j=Number(e.node.attrs.width)||O,Y=Number(e.node.attrs.height)||Math.round(j/H);const N=o.unref(i).width;j=Math.min(j>N?N:j,N),Y=Math.round(j/H),Object.assign(l.value,{x:_,y:A,w:j,h:Y,dir:T}),a.value=!0,w()}const v=St.throttle(k=>{if(!o.unref(a))return;let T=0;if("touches"in k&&k.touches.length>0)T=k.touches[0].clientX;else if("clientX"in k)T=k.clientX;else return;const{x:_,w:A,dir:V}=o.unref(l),O=(T-_)*(/l/.test(V)?-1:1),B=vL(A+O,aL,o.unref(i).width);e.updateAttributes({width:B})},sx),b=k=>{k.preventDefault(),k.stopPropagation();const T=document.querySelector(".image-resizer");T&&(T.style.borderColor=""),o.unref(a)&&(a.value=!1,Object.assign(l.value,{x:0,y:0,w:0,h:0,dir:""}),x(),p())};function w(){document.addEventListener("mousemove",v,!0),document.addEventListener("mouseup",b,!0),document.addEventListener("touchmove",v,!0),document.addEventListener("touchend",b,!0)}function x(){document.removeEventListener("mousemove",v,!0),document.removeEventListener("mouseup",b,!0),document.removeEventListener("touchmove",v,!0),document.removeEventListener("touchend",b,!0)}const C=new ResizeObserver(m),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(()=>{c.value&&f.observe(c.value),C.observe(e.editor.view.dom)}),o.onBeforeUnmount(()=>{x(),f.disconnect(),C.disconnect()}),(k,T)=>(o.openBlock(),o.createBlock(o.unref(ea),{class:"node-image",style:o.normalizeStyle({"pointer-events":o.unref(r)&&t.selected?"none":"auto"})},{default:o.withCtx(()=>[o.createElementVNode("div",{class:"image-view",style:o.normalizeStyle([{width:u.value.style.width,height:u.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":a.value},"image-view__body"])},[o.createElementVNode("img",{ref_key:"imageRef",ref:c,src:u.value.src,alt:u.value.alt,class:"block w-full image-view__body__image",style:o.normalizeStyle([{transform:u.value.style.transform}]),onClick:p,onMousedown:T[0]||(T[0]=(..._)=>o.unref(ff)&&o.unref(ff)(..._))},null,44,wZ),k.editor.view.editable?o.withDirectives((o.openBlock(),o.createElementBlock("div",xZ,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.values(n),_=>(o.openBlock(),o.createElementBlock("span",{key:_,class:o.normalizeClass(o.unref(ke)(`image-resizer__handler--${_}`,"image-resizer__handler",o.unref(r)&&t.selected&&"pointer-events-auto")),onMousedown:A=>g(A,_),onTouchstart:o.withModifiers(A=>g(A,_),["prevent"])},null,42,CZ))),128))],512)),[[o.vShow,t.selected||a.value]]):o.createCommentVNode("",!0)],2)],4)]),_:1},8,["style"]))}}),EZ=Xr(kZ,[["__scopeId","data-v-db9342d0"]]),jc=yZ.extend({group:"block",defining:!0,isolating:!0,addAttributes(){return{...this.parent?.(),src:{default:null,parseHTML:t=>(t.tagName==="P"?t.querySelector("img"):t)?.getAttribute("src")},flipX:{default:!1},flipY:{default:!1},originWidth:{default:null},originHeight:{default:null},textAlign:{default:"left",parseHTML:t=>t.style.textAlign||t.getAttribute("textAlign")||null,renderHTML:t=>({textAlign:t.textAlign})},width:{default:"100%",parseHTML:t=>{const e=t.tagName==="P"?t.querySelector("img"):t,n=e&&(e.style.width||e.getAttribute("width"))||null;return n&&n.endsWith("%")?n:n==null?null:parseInt(n,10)},renderHTML:t=>({width:t.width})},height:{default:"auto",parseHTML:t=>{const e=t.style.height||t.getAttribute("height")||null;return e==null||e==="auto"?null:parseInt(e,10)},renderHTML:t=>({height:t.height})},class:{default:"",parseHTML:t=>t.getAttribute("class")||"",renderHTML:t=>({class:t.class})},"data-memo":{default:"",parseHTML:t=>t.getAttribute("data-memo")||"",renderHTML:t=>({"data-memo":t["data-memo"]})}}},addOptions(){return{...this.parent?.()}},addNodeView(){return na(EZ)},addCommands(){return{...this.parent?.(),updateImage:t=>({commands:e,editor:n})=>e.updateAttributes(this.name,t)}},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",wt(this.options.HTMLAttributes,e,{style:l})]},parseHTML(){return[{tag:"img[src]"},{tag:"p",priority:1001,getAttrs:t=>{const e=t;return e.children.length===1&&e.firstElementChild?.tagName==="IMG"&&!!!e.textContent?.trim()&&e.firstElementChild.hasAttribute("src")?null:!1}}]},addProseMirrorPlugins(){return[new ot({props:{handleTextInput(t){const{selection:e}=t.state;return e instanceof Re&&e.node.type.name==="image"},handlePaste(t){const{selection:e}=t.state;return e instanceof Re&&e.node.type.name==="image"}}})]}}),SZ=["paragraph","heading","list_item","todo_item"];function _Z(t,e){const{selection:n,doc:r}=t;if(!n||!r||!(n instanceof Ie||n instanceof An))return t;const{from:i,to:s}=n,a=[],l=e&&e!==ax?e:null;return r.nodesBetween(i,s,(u,c)=>{const f=u.type;return SZ.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 TZ(t){return({state:e,dispatch:n})=>{const{selection:r}=e;let{tr:i}=e;return i=i.setSelection(r),i=_Z(i,t),i.docChanged?(n&&n(i),!0):!1}}const AZ=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}=Pt();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.chain().focus().unsetLineHeight().run():s.editor.chain().focus().setLineHeight(l).run(),i.value=l}return(l,u)=>(o.openBlock(),o.createBlock(ga,{icon:l.icon,tooltip:l.tooltip,disabled:l.disabled,class:"inside-toolbar"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.value,(c,f)=>(o.openBlock(),o.createBlock(o.unref(Ml),{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"]))}}),kE=Qe.create({name:"lineHeight",addOptions(){return{...this.parent?.(),types:["paragraph","heading","list_item","todo_item"],lineHeights:["100%","115%","150%","200%","250%","300%"],defaultHeight:ax,button({editor:t,t:e}){return{component:AZ,componentProps:{editor:t,icon:"LineHeight",tooltip:e("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=>TZ(t),unsetLineHeight:()=>({commands:t})=>this.options.types.every(e=>t.resetAttributes(e,"lineHeight"))}}}),MZ=Lt.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",wt(t,{"data-type":"column"}),0]},parseHTML(){return[{tag:'div[data-type="column"]'}]}});var Ba=(t=>(t.SidebarLeft="sidebar-left",t.SidebarRight="sidebar-right",t.TwoColumn="two-column",t))(Ba||{});const Ab=Lt.create({name:"columns",group:"columns",content:"column+",defining:!0,isolating:!0,addOptions(){return{...this.parent?.(),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[MZ.configure(this.options.columnOptions)]}}),OZ={class:"flex gap-x-2 items-center"},BZ={class:"sr-only"},IZ={class:"flex justify-end gap-x-2.5 flex-1"},LZ=["disabled"],EE=Xr(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}=Pt(),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(()=>{if(!s.value)return!0;const g=document.createElement("div");return g.innerHTML=s.value,g?.textContent?.trim()===""});o.watch(()=>r.open,()=>{r.open&&r.superTextInit&&(s.value=r.superTextInit)},{immediate:!0});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,v)=>{const b=ch,w=uh,x=lh,C=ah,E=sb,k=Pc,T=Dc;return o.openBlock(),o.createBlock(T,{open:g.open},{default:o.withCtx(()=>[o.createVNode(k,{"is-overlay-transparent":"",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(x,{class:"text-left flex-row justify-between"},{default:o.withCtx(()=>[o.createVNode(b,{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",OZ,[o.withDirectives(o.createElementVNode("button",{onClick:m},[o.createVNode(o.unref(g1),{icon:"lucide:edit-2"})],512),[[o.vShow,l.value]]),o.createVNode(w,{class:"outline-none",onClick:f},{default:o.withCtx(()=>[o.createVNode(o.unref(cc),{class:"w-5 h-5"}),o.createElementVNode("span",BZ,o.toDisplayString(o.unref(i)("editor.close")),1)]),_:1})])]),_:1}),o.createVNode(C,{class:"hidden"}),o.createVNode(Eb,{modelValue:s.value,"onUpdate:modelValue":v[0]||(v[0]=_=>s.value=_),"is-read-only":l.value,"parent-editor":g.editor,"spellcheck-enabled":!1},null,8,["modelValue","is-read-only","parent-editor"]),o.createVNode(E,{class:"flex-row justify-between"},{default:o.withCtx(()=>[o.withDirectives(o.createElementVNode("button",{onClick:v[1]||(v[1]=_=>n("delete"))},o.toDisplayString(o.unref(i)("editor.delete")),513),[[o.vShow,u.value]]),o.withDirectives(o.createElementVNode("div",IZ,[o.createElementVNode("button",{onClick:f},o.toDisplayString(o.unref(i)("editor.menubar.menu.cancel")),1),o.createElementVNode("button",{disabled:o.unref(c),class:o.normalizeClass({"cursor-not-allowed":o.unref(c)}),onClick:p},o.toDisplayString(o.unref(i)("editor.menubar.menu.save")),11,LZ)],512),[[o.vShow,u.value||!l.value]])]),_:1})]),_:1})]),_:1},8,["open"])}}}),[["__scopeId","data-v-c6e8813c"]]),RZ=["innerHTML"],DZ=["book-mark-node-id","page-id","page-number","book-mark-content","node-id","line-id"],PZ=o.defineComponent({__name:"ConfigPlan",props:ta,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(ur.RENDER_SUPER_TEXT),c=o.computed(()=>{const C=s.resolve(i.from)?.node(-1),E=C?.attrs?.id,k=C?.attrs?.pageNumber;return{pageId:E,pageNumber:k}}),f=o.computed(()=>{const x=e.getPos(),C=e.editor.state.doc.resolve(x);for(let E=C.depth;E>0;E--){const k=C.node(E);if(k.type.name==="paragraph")return k}return null}),p=o.computed(()=>f.value?.attrs.id||"");function m(x){e.updateAttributes({"data-text":x}),n.value=!1}function g(x){const C=e.node.attrs[Ne.TEXT],E=e.node.attrs[Ne.ID],T={lineId:x.target.querySelector(`[node-id="${E}"]`).getAttribute("line-id"),text:C};u.emit({action:"hover",payload:T})}function v(x){const C=e.node.attrs[Ne.ID],k={lineId:x.target.querySelector(`[node-id="${C}"]`).getAttribute("line-id"),text:""};u.emit({action:"hover",payload:k})}function b(){const{getPos:x,node:C,editor:E}=e,k=x(),T=k+1;E.commands.deleteRange({from:k,to:T})}function w(){n.value=!0,a&&(l.value=!0)}return(x,C)=>{const E=mn,k=ib,T=ob,_=rb,A=nb,V=Wc;return o.openBlock(),o.createBlock(o.unref(ea),{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(A,null,{default:o.withCtx(()=>[o.createVNode(k,{as:"template",class:"relative"},{default:o.withCtx(()=>[o.createVNode(E,{variant:"ghost",class:"!p-0 !m-0 !h-fit font-normal !text-ed-blue",onClick:w,onMouseenter:g,onMouseleave:v},{default:o.withCtx(()=>[o.createVNode(o.unref(Ot),{name:"plan",class:o.normalizeClass({"w-[18px] h-auto pr-1":o.unref(a)})},null,8,["class"]),C[3]||(C[3]=o.createTextVNode(" [")),o.createElementVNode("span",{class:"[&_*]:inline",innerHTML:e.node.attrs[o.unref(Ne).TEXT]},null,8,RZ),C[4]||(C[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,DZ)]),_:1})]),_:1}),o.createVNode(_,null,{default:o.withCtx(()=>[o.createVNode(T,{onSelect:C[0]||(C[0]=O=>n.value=!0)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(x.$t("editor.configPlan.edit")),1)]),_:1}),o.createVNode(T,{onSelect:b},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(x.$t("editor.configPlan.delete")),1)]),_:1})]),_:1})]),_:1}),o.unref(a)?(o.openBlock(),o.createBlock(EE,{key:1,title:x.$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:C[2]||(C[2]=O=>n.value=!1),onSave:m,onDelete:b},null,8,["title","open","is-view-mode","editor","super-text-init","super-text-id"])):(o.openBlock(),o.createBlock(V,{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:C[1]||(C[1]=O=>n.value=!1),onSave:m},null,8,["open","editor","super-text-init","super-text-element-id"]))]),_:1},8,["class"])}}}),SE=Lt.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:Ge,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",wt(t,{class:"config-plan"})]},addNodeView(){return na(PZ)},addProseMirrorPlugins(){return[new ot({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 Mb,Ob;if(typeof WeakMap<"u"){let t=new WeakMap;Mb=e=>t.get(e),Ob=(e,n)=>(t.set(e,n),n)}else{const t=[];let n=0;Mb=r=>{for(let i=0;i<t.length;i+=2)if(t[i]==r)return t[i+1]},Ob=(r,i)=>(n==10&&(n=0),t[n++]=r,t[n++]=i)}var an=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 Mb(t)||Ob(t,VZ(t))}};function VZ(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=FZ(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 v=0;;v++){for(;i<r.length&&r[i]!=0;)i++;if(v==p.childCount)break;const b=p.child(v),{colspan:w,rowspan:x,colwidth:C}=b.attrs;for(let E=0;E<x;E++){if(E+c>=n){(s||(s=[])).push({type:"overlong_rowspan",pos:f,n:x-E});break}const k=i+E*e;for(let T=0;T<w;T++){r[k+T]==0?r[k+T]=f:(s||(s=[])).push({type:"collision",row:c,pos:f,n:w-T});const _=C&&C[T];if(_){const A=(k+T)%e*2,V=a[A];V==null||V!=_&&a[A+1]==1?(a[A]=_,a[A+1]=1):V==_&&a[A+1]++}}}i+=w,f+=b.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 an(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&&$Z(l,a,t),l}function FZ(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 $Z(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=HZ(u)))[c]=p)}l&&t.problems.unshift({type:"colwidth mismatch",pos:s,colwidth:l})}}function HZ(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function Wn(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 _s=new Et("selectingCells");function ql(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 zZ(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 bo(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 Eh(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=ql(e.$head)||UZ(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function UZ(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 Bb(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function WZ(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function Ib(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function _E(t,e,n){const r=t.node(-1),i=an.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 Ia(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 TE(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 jZ(t,e,n){const r=Wn(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 zt=class Di extends ze{constructor(e,n=e){const r=e.node(-1),i=an.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 a3(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(Bb(r)&&Bb(i)&&Ib(r,i)){const s=this.$anchorCell.node(-1)!=r.node(-1);return s&&this.isRowSelection()?Di.rowSelection(r,i):s&&this.isColSelection()?Di.colSelection(r,i):new Di(r,i)}return Ie.between(r,i)}content(){const e=this.$anchorCell.node(-1),n=an.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 v=e.nodeAt(m);if(!v)throw RangeError(`No cell with offset ${m} found`);const b=i.left-g.left,w=g.right-i.right;if(b>0||w>0){let x=v.attrs;if(b>0&&(x=Ia(x,0,b)),w>0&&(x=Ia(x,x.colspan-w,w)),g.left<i.left){if(v=v.type.createAndFill(x),!v)throw RangeError(`Could not create cell with attrs ${JSON.stringify(x)}`)}else v=v.type.create(x,v.content)}if(g.top<i.top||g.bottom>i.bottom){const x={...v.attrs,rowspan:Math.min(g.bottom,i.bottom)-Math.max(g.top,i.top)};g.top<i.top?v=v.type.createAndFill(x):v=v.type.create(x,v.content)}c.push(v)}a.push(e.child(u).copy(ge.from(c)))}const l=this.isColSelection()&&this.isRowSelection()?e:a;return new Se(ge.from(l),1,1)}replace(e,n=Se.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?Se.empty:n)}const s=ze.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);s&&e.setSelection(s)}replaceWith(e,n){this.replace(e,new Se(ge.from(n),0,0))}forEachCell(e){const n=this.$anchorCell.node(-1),r=an.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=an.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 Di(e,n)}isRowSelection(){const e=this.$anchorCell.node(-1),n=an.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 Di&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){const r=e.node(-1),i=an.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 Di(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new Di(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){return new Di(e.resolve(n),e.resolve(r))}getBookmark(){return new qZ(this.$anchorCell.pos,this.$headCell.pos)}};zt.prototype.visible=!1,ze.jsonID("cell",zt);var qZ=class lT{constructor(e,n){this.anchor=e,this.head=n}map(e){return new lT(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&&Ib(n,r)?new zt(n,r):ze.near(r,1)}};function KZ(t){if(!(t.selection instanceof zt))return null;const e=[];return t.selection.forEachCell((n,r)=>{e.push(jt.node(r,r+n.nodeSize,{class:"selectedCell"}))}),lt.create(t.doc,e)}function GZ({$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 XZ({$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 YZ(t,e,n){const r=(e||t).selection,i=(e||t).doc;let s,a;if(r instanceof Re&&(a=r.node.type.spec.tableRole)){if(a=="cell"||a=="header_cell")s=zt.create(i,r.from);else if(a=="row"){const l=i.resolve(r.from+1);s=zt.rowSelection(l,l)}else if(!n){const l=an.get(r.node),u=r.from+1,c=u+l.map[l.width*l.height-1];s=zt.create(i,u+1,c)}}else r instanceof Ie&&GZ(r)?s=Ie.create(i,r.from):r instanceof Ie&&XZ(r)&&(s=Ie.create(i,r.$from.start(),r.$from.end()));return s&&(e||(e=t.tr)).setSelection(s),e}var JZ=new Et("fix-tables");function AE(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)?AE(t.child(l),u,n+1,r):u.nodesBetween(0,u.content.size,r,n+1),n+=u.nodeSize}}function ME(t,e){let n;const r=(i,s)=>{i.type.spec.tableRole=="table"&&(n=ZZ(t,i,s,n))};return e?e.doc!=t.doc&&AE(e.doc,t.doc,0,r):t.doc.descendants(r),n}function ZZ(t,e,n,r){const i=an.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,Ia(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 v=[];for(let w=0;w<m;w++){const x=Wn(t.schema)[g].createAndFill();x&&v.push(x)}const b=(u==0||a==u-1)&&l==u?c+1:p-1;r.insert(r.mapping.map(b),v)}c=p}return r.setMeta(JZ,{fixTables:!0})}function Ko(t){const e=t.selection,n=Eh(t),r=n.node(-1),i=n.start(-1),s=an.get(r);return{...e instanceof zt?s.rectBetween(e.$anchorCell.pos-i,e.$headCell.pos-i):s.findCell(n.pos-i),tableStart:i,map:s,table:r}}function OE(t,{map:e,tableStart:n,table:r},i){let s=i>0?-1:0;jZ(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,TE(c.attrs,i-e.colCount(u))),a+=c.attrs.rowspan-1}else{const u=s==null?Wn(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 QZ(t,e){if(!bo(t))return!1;if(e){const n=Ko(t);e(OE(t.tr,n,n.left))}return!0}function NZ(t,e){if(!bo(t))return!1;if(e){const n=Ko(t);e(OE(t.tr,n,n.right))}return!0}function eQ(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,Ia(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 tQ(t,e){if(!bo(t))return!1;if(e){const n=Ko(t),r=t.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let i=n.right-1;eQ(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=an.get(s)}e(r)}return!0}function nQ(t,e,n){var r;const i=Wn(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 BE(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;nQ(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?Wn(r.type.schema).cell:(s=r.nodeAt(e.map[f+u*e.width]))==null?void 0:s.type,m=p?.createAndFill();m&&l.push(m)}return t.insert(a,Wn(r.type.schema).row.create(null,l)),t}function rQ(t,e){if(!bo(t))return!1;if(e){const n=Ko(t);e(BE(t.tr,n,n.top))}return!0}function oQ(t,e){if(!bo(t))return!1;if(e){const n=Ko(t);e(BE(t.tr,n,n.bottom))}return!0}function iQ(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,v=m.type.create({...g,rowspan:m.attrs.rowspan-1},m.content),b=e.positionAt(i+1,c,n);t.insert(t.mapping.slice(l).map(r+b),v),c+=g.colspan-1}}}}function sQ(t,e){if(!bo(t))return!1;if(e){const n=Ko(t),r=t.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let i=n.bottom-1;iQ(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=an.get(n.table)}e(r)}return!0}function IE(t){const e=t.content;return e.childCount==1&&e.child(0).isTextblock&&e.child(0).childCount==0}function aQ({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 LE(t,e){const n=t.selection;if(!(n instanceof zt)||n.$anchorCell.pos==n.$headCell.pos)return!1;const r=Ko(t),{map:i}=r;if(aQ(i,r))return!1;if(e){const s=t.tr,a={};let l=ge.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{IE(g)||(l=l.append(g.content));const v=s.mapping.map(m+r.tableStart);s.delete(v,v+g.nodeSize)}}if(u==null||c==null)return!0;if(s.setNodeMarkup(u+r.tableStart,null,{...TE(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=IE(c)?u+1:f;s.replaceWith(p+r.tableStart,f+r.tableStart,l)}s.setSelection(new zt(s.doc.resolve(u+r.tableStart))),e(s)}return!0}function RE(t,e){const n=Wn(t.schema);return lQ(({node:r})=>n[r.type.spec.tableRole])(t,e)}function lQ(t){return(e,n)=>{var r;const i=e.selection;let s,a;if(i instanceof zt){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;s=i.$anchorCell.nodeAfter,a=i.$anchorCell.pos}else{if(s=zZ(i.$from),!s)return!1;a=(r=ql(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=Ko(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 v=f.map.positionAt(g,f.left,f.table);g==f.top&&(v+=s.nodeSize);for(let b=f.left,w=0;b<f.right;b++,w++)b==f.left&&g==f.top||p.insert(m=p.mapping.map(v+f.tableStart,1),t({node:s,row:g,col:b}).createAndFill(u[w]))}p.setNodeMarkup(a,t({node:s,row:f.top,col:f.left}),u[0]),i instanceof zt&&p.setSelection(new zt(p.doc.resolve(i.$anchorCell.pos),m?p.doc.resolve(m):void 0)),n(p)}return!0}}function uQ(t,e){return function(n,r){if(!bo(n))return!1;const i=Eh(n);if(i.nodeAfter.attrs[t]===e)return!1;if(r){const s=n.tr;n.selection instanceof zt?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 cQ(t){return function(e,n){if(!bo(e))return!1;if(n){const r=Wn(e.schema),i=Ko(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 DE(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 qc(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?cQ(t):function(n,r){if(!bo(n))return!1;if(r){const i=Wn(n.schema),s=Ko(n),a=n.tr,l=DE("row",s,i),u=DE("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 v=g+s.tableStart,b=a.doc.nodeAt(v);b&&a.setNodeMarkup(v,m,b.attrs)}),r(a)}return!0}}qc("row",{useDeprecatedLogic:!0}),qc("column",{useDeprecatedLogic:!0});var dQ=qc("cell",{useDeprecatedLogic:!0});function fQ(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 PE(t){return function(e,n){if(!bo(e))return!1;const r=fQ(Eh(e),t);if(r==null)return!1;if(n){const i=e.doc.resolve(r);n(e.tr.setSelection(Ie.between(i,WZ(i))).scrollIntoView())}return!0}}function pQ(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 Sh(t,e){const n=t.selection;if(!(n instanceof zt))return!1;if(e){const r=t.tr,i=Wn(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 Se(i,0,0))}),r.docChanged&&e(r)}return!0}function hQ(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=Lb(Wn(a).row,new Se(c,f,p)).content),l.push(c)}else if(s=="cell"||s=="header_cell")l.push(n||r?Lb(Wn(a).row,new Se(e,n,r)).content:e);else return null;return mQ(a,l)}function mQ(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(ge.empty),n[i]<r){const s=Wn(t).cell.createAndFill(),a=[];for(let l=n[i];l<r;l++)a.push(s);e[i]=e[i].append(ge.from(a))}return{height:e.length,width:r,rows:e}}function Lb(t,e){const n=t.createAndFill();return new Gm(n).replace(0,n.content.size,e).doc}function gQ({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(Ia(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(ge.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(ge.from(u))}n=s,e=i}return{width:t,height:e,rows:n}}function vQ(t,e,n,r,i,s,a){const l=t.doc.type.schema,u=Wn(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 v=[];let b;g.lastChild==null||g.lastChild.type==u.cell?b=c||(c=u.cell.createAndFill()):b=f||(f=u.header_cell.createAndFill());for(let w=e.width;w<i;w++)v.push(b);t.insert(t.mapping.slice(a).map(m-1+r),v)}if(s>e.height){const p=[];for(let v=0,b=(e.height-1)*e.width;v<Math.max(e.width,i);v++){const w=v>=e.width?!1:n.nodeAt(e.map[b+v]).type==u.header_cell;p.push(w?f||(f=u.header_cell.createAndFill()):c||(c=u.cell.createAndFill()))}const m=u.row.create(null,ge.from(p)),g=[];for(let v=e.height;v<s;v++)g.push(m);t.insert(t.mapping.slice(a).map(r+n.nodeSize-2),g)}return!!(c||f)}function VE(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:v}=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,v,n)),m.type.createAndFill({...m.attrs,rowspan:g+m.attrs.rowspan-a})),c+=m.attrs.colspan-1}}return u}function FE(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),v=t.mapping.slice(l).map(p+r);t.setNodeMarkup(v,null,Ia(m.attrs,a-g,m.attrs.colspan-(a-g))),t.insert(v+m.nodeSize,m.type.createAndFill(Ia(m.attrs,0,a-g))),c+=m.attrs.rowspan-1}}return u}function $E(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=an.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=an.get(s),m=p.mapping.maps.length}vQ(p,a,s,n,c,f,m)&&g(),VE(p,a,s,n,u,c,l,m)&&g(),VE(p,a,s,n,u,c,f,m)&&g(),FE(p,a,s,n,l,f,u,m)&&g(),FE(p,a,s,n,l,f,c,m)&&g();for(let v=l;v<f;v++){const b=a.positionAt(v,u,s),w=a.positionAt(v,c,s);p.replace(p.mapping.slice(m).map(b+n),p.mapping.slice(m).map(w+n),new Se(i.rows[v-l],0,0))}g(),p.setSelection(new zt(p.doc.resolve(n+a.positionAt(l,u,s)),p.doc.resolve(n+a.positionAt(f-1,c-1,s)))),e(p)}var bQ=E0({ArrowLeft:Th("horiz",-1),ArrowRight:Th("horiz",1),ArrowUp:Th("vert",-1),ArrowDown:Th("vert",1),"Shift-ArrowLeft":Ah("horiz",-1),"Shift-ArrowRight":Ah("horiz",1),"Shift-ArrowUp":Ah("vert",-1),"Shift-ArrowDown":Ah("vert",1),Backspace:Sh,"Mod-Backspace":Sh,Delete:Sh,"Mod-Delete":Sh});function _h(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function Th(t,e){return(n,r,i)=>{if(!i)return!1;const s=n.selection;if(s instanceof zt)return _h(n,r,ze.near(s.$headCell,e));if(t!="horiz"&&!s.empty)return!1;const a=HE(i,t,e);if(a==null)return!1;if(t=="horiz")return _h(n,r,ze.near(n.doc.resolve(s.head+e),e));{const l=n.doc.resolve(a),u=_E(l,t,e);let c;return u?c=ze.near(u,1):e<0?c=ze.near(n.doc.resolve(l.before(-1)),-1):c=ze.near(n.doc.resolve(l.after(-1)),1),_h(n,r,c)}}}function Ah(t,e){return(n,r,i)=>{if(!i)return!1;const s=n.selection;let a;if(s instanceof zt)a=s;else{const u=HE(i,t,e);if(u==null)return!1;a=new zt(n.doc.resolve(u))}const l=_E(a.$headCell,t,e);return l?_h(n,r,new zt(a.$anchorCell,l)):!1}}function yQ(t,e){const n=t.state.doc,r=ql(n.resolve(e));return r?(t.dispatch(t.state.tr.setSelection(new zt(r))),!0):!1}function wQ(t,e,n){if(!bo(t.state))return!1;let r=hQ(n);const i=t.state.selection;if(i instanceof zt){r||(r={width:1,height:1,rows:[ge.from(Lb(Wn(t.state.schema).cell,n))]});const s=i.$anchorCell.node(-1),a=i.$anchorCell.start(-1),l=an.get(s).rectBetween(i.$anchorCell.pos-a,i.$headCell.pos-a);return r=gQ(r,l.right-l.left,l.bottom-l.top),$E(t.state,t.dispatch,a,l,r),!0}else if(r){const s=Eh(t.state),a=s.start(-1);return $E(t.state,t.dispatch,a,an.get(s.node(-1)).findCell(s.pos-a),r),!0}else return!1}function xQ(t,e){var n;if(e.ctrlKey||e.metaKey)return;const r=zE(t,e.target);let i;if(e.shiftKey&&t.state.selection instanceof zt)s(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(i=ql(t.state.selection.$anchor))!=null&&((n=Rb(t,e))==null?void 0:n.pos)!=i.pos)s(i,e),e.preventDefault();else if(!r)return;function s(u,c){let f=Rb(t,c);const p=_s.getState(t.state)==null;if(!f||!Ib(u,f))if(p)f=u;else return;const m=new zt(u,f);if(p||!t.state.selection.eq(m)){const g=t.state.tr.setSelection(m);p&&g.setMeta(_s,u.pos),t.dispatch(g)}}function a(){t.root.removeEventListener("mouseup",a),t.root.removeEventListener("dragstart",a),t.root.removeEventListener("mousemove",l),_s.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(_s,-1))}function l(u){const c=u,f=_s.getState(t.state);let p;if(f!=null)p=t.state.doc.resolve(f);else if(zE(t,c.target)!=r&&(p=Rb(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 HE(t,e,n){if(!(t.state.selection instanceof Ie))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 zE(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function Rb(t,e){const n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?ql(t.state.doc.resolve(n.pos)):null}var CQ=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")),Db(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,Db(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function Db(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:v}=f.child(p).attrs;for(let b=0;b<g;b++,m++){const w=i==m?s:v&&v[b],x=w?w+"px":"";if(l+=w||r,w||(u=!1),c)c.style.width!=x&&(c.style.width=x),c=c.nextSibling;else{const C=document.createElement("col");C.style.width=x,e.appendChild(C)}}}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 Er=new Et("tableColumnResizing");function kQ({handleWidth:t=5,cellMinWidth:e=25,defaultCellMinWidth:n=100,View:r=CQ,lastColumnResizable:i=!0}={}){const s=new ot({key:Er,state:{init(a,l){var u,c;const f=(c=(u=s.spec)==null?void 0:u.props)==null?void 0:c.nodeViews,p=Wn(l.schema).table.name;return r&&f&&(f[p]=(m,g)=>new r(m,n,g)),new EQ(-1,!1)},apply(a,l){return l.apply(a)}},props:{attributes:a=>{const l=Er.getState(a);return l&&l.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(a,l)=>{SQ(a,l,t,i)},mouseleave:a=>{_Q(a)},mousedown:(a,l)=>{TQ(a,l,e,n)}},decorations:a=>{const l=Er.getState(a);if(l&&l.activeHandle>-1)return IQ(a,l.activeHandle)},nodeViews:{}}});return s}var EQ=class Om{constructor(e,n){this.activeHandle=e,this.dragging=n}apply(e){const n=this,r=e.getMeta(Er);if(r&&r.setHandle!=null)return new Om(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new Om(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&e.docChanged){let i=e.mapping.map(n.activeHandle,-1);return Bb(e.doc.resolve(i))||(i=-1),new Om(i,n.dragging)}return n}};function SQ(t,e,n,r){if(!t.editable)return;const i=Er.getState(t.state);if(i&&!i.dragging){const s=MQ(e.target);let a=-1;if(s){const{left:l,right:u}=s.getBoundingClientRect();e.clientX-l<=n?a=UE(t,e,"left",n):u-e.clientX<=n&&(a=UE(t,e,"right",n))}if(a!=i.activeHandle){if(!r&&a!==-1){const l=t.state.doc.resolve(a),u=l.node(-1),c=an.get(u),f=l.start(-1);if(c.colCount(l.pos-f)+l.nodeAfter.attrs.colspan-1==c.width-1)return}jE(t,a)}}}function _Q(t){if(!t.editable)return;const e=Er.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&jE(t,-1)}function TQ(t,e,n,r){var i;if(!t.editable)return!1;const s=(i=t.dom.ownerDocument.defaultView)!=null?i:window,a=Er.getState(t.state);if(!a||a.activeHandle==-1||a.dragging)return!1;const l=t.state.doc.nodeAt(a.activeHandle),u=AQ(t,a.activeHandle,l.attrs);t.dispatch(t.state.tr.setMeta(Er,{setDragging:{startX:e.clientX,startWidth:u}}));function c(p){s.removeEventListener("mouseup",c),s.removeEventListener("mousemove",f);const m=Er.getState(t.state);m?.dragging&&(OQ(t,m.activeHandle,WE(m.dragging,p,n)),t.dispatch(t.state.tr.setMeta(Er,{setDragging:null})))}function f(p){if(!p.which)return c(p);const m=Er.getState(t.state);if(m&&m.dragging){const g=WE(m.dragging,p,n);qE(t,m.activeHandle,g,r)}}return qE(t,a.activeHandle,u,r),s.addEventListener("mouseup",c),s.addEventListener("mousemove",f),e.preventDefault(),!0}function AQ(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 MQ(t){for(;t&&t.nodeName!="TD"&&t.nodeName!="TH";)t=t.classList&&t.classList.contains("ProseMirror")?null:t.parentNode;return t}function UE(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=ql(t.state.doc.resolve(a));if(!l)return-1;if(n=="right")return l.pos;const u=an.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 WE(t,e,n){const r=e.clientX-t.startX;return Math.max(n,t.startWidth+r)}function jE(t,e){t.dispatch(t.state.tr.setMeta(Er,{setHandle:e}))}function OQ(t,e,n){const r=t.state.doc.resolve(e),i=r.node(-1),s=an.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 v=m.colwidth?m.colwidth.slice():BQ(m.colspan);v[g]=n,u.setNodeMarkup(a+p,null,{...m,colwidth:v})}u.docChanged&&t.dispatch(u)}function qE(t,e,n,r){const i=t.state.doc.resolve(e),s=i.node(-1),a=i.start(-1),l=an.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&&Db(s,u.firstChild,u,r,l,n)}function BQ(t){return Array(t).fill(0)}function IQ(t,e){var n;const r=[],i=t.doc.resolve(e),s=i.node(-1);if(!s)return lt.empty;const a=an.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=Er.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 lt.create(t.doc,r)}function LQ({allowTableNodeSelection:t=!1}={}){return new ot({key:_s,state:{init(){return null},apply(e,n){const r=e.getMeta(_s);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:KZ,handleDOMEvents:{mousedown:xQ},createSelectionBetween(e){return _s.getState(e.state)!=null?e.state.selection:null},handleTripleClick:yQ,handleKeyDown:bQ,handlePaste:wQ},appendTransaction(e,n,r){return YZ(r,ME(r,n),t)}})}const RQ=(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)},DQ=(t,e,n)=>{const{doc:r,selection:i}=t;return!r||!i||!(i instanceof zt)||i.forEachCell((s,a)=>{t=RQ(t,a,n)}),t},KE=(t,e)=>({tr:n,state:r,dispatch:i})=>{const{selection:s}=r;return n=n.setSelection(s),n=DQ(n,e,t),n.docChanged?(i?.(n),!0):!1},PQ=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=>KE(t,this.options),unsetTableCellBackground:()=>KE("",this.options)}}}),VQ=Lt.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",wt(this.options.HTMLAttributes,t),0]}}),FQ=Lt.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",wt(this.options.HTMLAttributes,t),0]}}),$Q=Lt.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",wt(this.options.HTMLAttributes,t),0]}});function Pb(t,e){return e?["width",`${Math.max(e,t)}px`]:["min-width",`${t}px`]}function GE(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:v}=f.child(p).attrs;for(let b=0;b<g;b+=1,m+=1){const w=i===m?s:v&&v[b],x=w?`${w}px`:"";if(l+=w||r,w||(u=!1),c){if(c.style.width!==x){const[C,E]=Pb(r,w);c.style.setProperty(C,E)}c=c.nextSibling}else{const C=document.createElement("col"),[E,k]=Pb(r,w);C.style.setProperty(E,k),e.appendChild(C)}}}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 HQ{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")),GE(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,GE(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return e.type==="attributes"&&(e.target===this.table||this.colgroup.contains(e.target))}}function zQ(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:v}=l.child(p).attrs;for(let b=0;b<g;b+=1,m+=1){const w=n===m?r:v&&v[b];i+=w||e,w||(s=!1);const[x,C]=Pb(e,w);a.push(["col",{style:`${x}: ${C}`}])}}const u=s?`${i}px`:"",c=s?"":`${i}px`;return{colgroup:["colgroup",{},...a],tableWidth:u,tableMinWidth:c}}function XE(t,e){return t.createAndFill()}function UQ(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 WQ(t,e,n,r,i){const s=UQ(t),a=[],l=[];for(let c=0;c<n;c+=1){const f=XE(s.cell);if(f&&l.push(f),r){const p=XE(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 jQ(t){return t instanceof zt}const Mh=({editor:t})=>{const{selection:e}=t.state;if(!jQ(e))return!1;let n=0;const r=r4(e.ranges[0].$from,s=>s.type.name==="table");return 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},qQ=Lt.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:HQ,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}=zQ(t,this.options.cellMinWidth);return["table",wt(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=WQ(s.schema,t,e,n);if(i){const l=r.selection.from+1;r.replaceSelectionWith(a).scrollIntoView().setSelection(Ie.near(r.doc.resolve(l)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>QZ(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>NZ(t,e),deleteColumn:()=>({state:t,dispatch:e})=>tQ(t,e),addRowBefore:()=>({state:t,dispatch:e})=>rQ(t,e),addRowAfter:()=>({state:t,dispatch:e})=>oQ(t,e),deleteRow:()=>({state:t,dispatch:e})=>sQ(t,e),deleteTable:()=>({state:t,dispatch:e})=>pQ(t,e),mergeCells:()=>({state:t,dispatch:e})=>LE(t,e),splitCell:()=>({state:t,dispatch:e})=>RE(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>qc("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>qc("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>dQ(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>LE(t,e)?!0:RE(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:r})=>uQ(t,e)(n,r),goToNextCell:()=>({state:t,dispatch:e})=>PE(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>PE(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&ME(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){const r=zt.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:Mh,"Mod-Backspace":Mh,Delete:Mh,"Mod-Delete":Mh}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[kQ({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],LQ({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(t){const e={name:t.name,options:t.options,storage:t.storage};return{tableRole:pt(Fe(t,"tableRole",e))}}}),KQ=/(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,GQ=/CrOS/,XQ=/android|ipad|playbook|silk/i;function YE(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:!!(KQ.test(e)&&!GQ.test(e)||t.tablet&&XQ.test(e)||t.tablet&&t.featureDetect&&navigator&&navigator.maxTouchPoints>1&&e.includes("Macintosh")&&e.includes("Safari"))}const YQ=["disabled"],JQ={"content-class":"table-grid-size-editor","content-style":"padding:0"},ZQ={class:"flex flex-col flex-wrap gap-1 justify-between"},QQ=["onMouseover","onMousedown"],NQ={class:"text-center text-sm text-zinc-600 mt-2"},eN=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:YE()?lf:af,cols:YE()?lf:af}),a=o.reactive({rows:uf,cols:uf});function l(g,v){g===s.rows&&(s.rows=Math.min(g+1,lf)),v===s.cols&&(s.cols=Math.min(v+1,lf)),a.rows=g,a.cols=v}function u(g,v){n("create-table",{rows:g,cols:v,withHeaderRow:o.unref(i)}),c()}function c(){r.value=!1,i.value=!1,s.rows=af,s.cols=af,a.rows=uf,a.cols=uf}const f=o.inject("isMobile",!1),{isOpen:p}=Nf({scrollEl:"tool-bar-format-scroll",ignoreSelector:"[data-radix-popper-content-wrapper]"}),m=o.computed(()=>f?{modal:!1,open:p.value,"onUpdate:open":g=>p.value=g}:{});return(g,v)=>(o.openBlock(),o.createBlock(o.unref(ms),o.normalizeProps(o.guardReactiveProps(o.unref(m))),{default:o.withCtx(()=>[o.createVNode(o.unref(Ca),{"as-child":""},{default:o.withCtx(()=>[o.createElementVNode("button",{disabled:t.disabled,class:"m-0 p-0"},[o.renderSlot(g.$slots,"trigger")],8,YQ)]),_:3}),o.createVNode(o.unref(gs),{class:"w-full",align:"start",side:"bottom"},{default:o.withCtx(()=>[o.createElementVNode("div",JQ,[o.createElementVNode("div",ZQ,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(s.rows,b=>(o.openBlock(),o.createElementBlock("div",{key:"r"+b,class:"flex gap-1"},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(s.cols,w=>(o.openBlock(),o.createElementBlock("div",{key:"c"+w,class:o.normalizeClass([[w<=a.cols&&b<=a.rows&&"bg-ed-foreground border-ed-border","cursor-pointer"],"pa-1"]),onMouseover:x=>l(b,w),onMousedown:x=>u(b,w)},v[0]||(v[0]=[o.createElementVNode("div",{class:"w-4 h-4 p-1 border box-border"},null,-1)]),42,QQ))),128))]))),128))]),o.createElementVNode("div",NQ,o.toDisplayString(a.rows)+" x "+o.toDisplayString(a.cols),1)])]),_:1})]),_:3},16))}}),tN={style:{display:"flex"}},nN=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(eN,{disabled:r.editor.isActive("table"),onCreateTable:n},{trigger:o.withCtx(()=>[o.createElementVNode("div",tN,[o.createVNode(Ge,{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"]))}}),Vb=qQ.extend({addStorage(){return{isTableMenuOpen:!1}},addCommands(){return{...this.parent?.(),toggleTableEditor:t=>({editor:e})=>e.storage.table?(e.storage.table.isTableEditorOpen=t,!0):!1}},addOptions(){return{...this.parent?.(),resizable:!0,lastColumnResizable:!0,allowTableNodeSelection:!1,button:({editor:t,t:e})=>({component:nN,componentProps:{icon:"Table",tooltip:e("editor.table.tooltip"),action:()=>{const n=t.storage.table?.isTableEditorOpen??!1;t.commands.toggleTableEditor(!n)}}})}},addExtensions(){return[FQ.configure(this.options.tableRow),VQ.configure(this.options.tableHeader),$Q.configure(this.options.tableCell),PQ.configure(this.options.tableCellBackground)]}}),rN={class:"flex items-center gap-2 px-2"},oN=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}=Pt(),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)=>(o.openBlock(),o.createBlock(ga,{title:i.value?.label,"side-offset":5},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.value,(l,u)=>(o.openBlock(),o.createBlock(o.unref(Ml),{key:u,class:"cursor-pointer",checked:l.isActive?.()||!1,onClick:l.action},{default:o.withCtx(()=>[o.createElementVNode("div",rN,[o.createVNode(o.unref(Ot),{name:l.iconName,class:"h3 w-3"},null,8,["name"]),o.createElementVNode("span",null,o.toDisplayString(l.label),1)])]),_:2},1032,["checked","onClick"]))),128))]),_:1},8,["title"]))}}),iN=Qe.create({name:"text-bubble",addOptions(){return{...this.parent?.(),toolbar:!1,button:()=>({component:oN,componentProps:{}})}}}),sN=[{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}년"}],JE=t=>{const e=[...t||[],...sN.map(n=>n.pattern)].join("|");return new RegExp(e,"gu")},aN=Qe.create({name:ih,addOptions(){return{additionalTimeWords:[],enabled:!0}},addStorage(){return{cachedRegex:null,cachedAdditionalWords:null,enabled:this.options.enabled}},addProseMirrorPlugins(){return[new ot({props:{decorations:t=>{if(!this.storage.enabled)return lt.empty;const e=[];return(this.storage.cachedAdditionalWords!==this.options.additionalTimeWords||!this.storage.cachedRegex)&&(this.storage.cachedAdditionalWords=this.options.additionalTimeWords,this.storage.cachedRegex=JE(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"}))}}),lt.create(t.doc,e)}}})]},addCommands(){return{toggleTimeHighlight:()=>({editor:t})=>{const e=t.storage[ih];return e.enabled=!e.enabled,t.view.dispatch(t.state.tr),!0}}}});function Fb(t){const e=JSON.stringify(t),n=window.ReactNativeWebView;if(n){n.postMessage(e);return}console.warn("[clipboardBridge] no bridge found")}function lN(){return new Promise(t=>{const e=window.receiveDriverData;window.receiveDriverData=n=>{e&&e(n);let r;try{r=typeof n=="string"?JSON.parse(n):n}catch{return}r?.type==="CLIPBOARD_STATE"&&t(!!r.data?.hasClipboard)},Fb({type:"REQUEST_CLIPBOARD_STATE"})})}function uN(){return new Promise(t=>{const e=window.receiveDriverData;window.receiveDriverData=n=>{e&&e(n);let r;try{r=typeof n=="string"?JSON.parse(n):n}catch{return}r?.type==="PASTE_RESULT"&&t(r.data?.text??null)},Fb({type:"PASTE"})})}function cN(t,e){Fb({type:"COPY",data:{html:t,text:e}})}async function dN(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 fN(){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 pN=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=Ir.fromSchema(t.schema).serializeFragment(i.content),l=document.createElement("div");l.appendChild(a);const u=l.innerHTML,c=e.doc.textBetween(n,r,`
|
|
344
|
+
`);t.storage.deviceEnv.isMobile?cN(u,c):await dN(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 uN():await fN();if(!e)return;const n=new DataTransfer;if(BJ(e)){n.setData("text/html",e);const i=document.createElement("div");i.innerHTML=e,n.setData("text/plain",i.innerText)}else 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 lN():await navigator.clipboard.readText())}catch(e){return console.warn("[clipboard] check failed",e),!1}}}}),hN=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})=>(e.storage.deviceEnv.isMobile=t,e.storage.spellchecker?.spellchecker.setIsMobile(t),!0),setForceCloseBubble:t=>({editor:e})=>(e.storage.deviceEnv.isForceCloseBubble=t,!0),resetForceCloseBubble:()=>({editor:t})=>(t.storage.deviceEnv.isForceCloseBubble=!1,!0)}}}),Oh=o.defineComponent({__name:"Tabs",props:{defaultValue:{},orientation:{},dir:{},activationMode:{},modelValue:{},asChild:{type:Boolean},as:{}},emits:["update:modelValue"],setup(t,{emit:e}){const i=Rt(t,e);return(s,a)=>(o.openBlock(),o.createBlock(o.unref(nF),o.normalizeProps(o.guardReactiveProps(o.unref(i))),{default:o.withCtx(()=>[o.renderSlot(s.$slots,"default")]),_:3},16))}}),mN={class:"truncate"},Kl=o.defineComponent({__name:"TabsTrigger",props:{value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,n=o.computed(()=>{const{class:i,...s}=e;return s}),r=Jn(n);return(i,s)=>(o.openBlock(),o.createBlock(o.unref(iF),o.mergeProps(o.unref(r),{class:o.unref(ke)("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-ed-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ed-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-ed-background data-[state=active]:text-ed-foreground data-[state=active]:shadow-sm",e.class)}),{default:o.withCtx(()=>[o.createElementVNode("span",mN,[o.renderSlot(i.$slots,"default")])]),_:3},16,["class"]))}}),Bh=o.defineComponent({__name:"TabsList",props:{loop:{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(rF),o.mergeProps(n.value,{class:o.unref(ke)("inline-flex items-center justify-center rounded-md bg-ed-muted p-1 text-ed-muted-foreground",e.class)}),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),Ih=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(oF),o.mergeProps({class:o.unref(ke)("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"]))}}),gN={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"},vN={key:0,class:"flex justify-center items-center gap-3 text-s"},bN={key:1,class:"flex justify-between items-center w-full"},yN={class:"flex justify-center items-center gap-3"},wN={class:"text-sm"},xN={class:"flex items-center gap-2"},CN=o.defineComponent({__name:"VideoUploader",props:{...ta},setup(t){const e=t,n=o.inject("isEditable",o.ref(!0)),r=o.ref(""),i=o.ref(!1),s=o.ref(),{t:a}=Pt();function l(p){i.value=!0;const m=p.target,g=Array.from(m?.files||[]),v=e.editor.extensionManager.extensions.find(w=>w.name==="videoUpload")?.options;if(!e.editor||e.editor.isDestroyed||g.length===0||typeof v?.upload!="function")return;const b=g[0];v.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(),i.value=!1})}function u(){e.editor.chain().setVideo({src:r.value,width:640}).deleteRange({from:e.getPos(),to:e.getPos()}).insertContentAt(e.getPos()+1,{type:"paragraph"}).focus().run()}function c(){e.deleteNode()}function f(){s.value?.click()}return(p,m)=>(o.openBlock(),o.createBlock(o.unref(ea),{as:"div","data-drag-handle":"",class:o.normalizeClass(o.unref(ke)(!o.unref(n)&&"pointer-events-none"))},{default:o.withCtx(()=>[o.createVNode(o.unref(ms),{"default-open":o.unref(n)},{default:o.withCtx(()=>[o.createVNode(o.unref(Ca),{"as-child":""},{default:o.withCtx(()=>[o.createElementVNode("div",gN,[i.value?(o.openBlock(),o.createElementBlock("div",vN,[o.createVNode(o.unref(Ot),{class:"animate-spin w-6 h-6",name:"LoaderCircle"}),o.createElementVNode("span",null,o.toDisplayString(o.unref(a)("editor.video.dialog.uploading"))+"...",1)])):(o.openBlock(),o.createElementBlock("div",bN,[o.createElementVNode("div",yN,[o.createVNode(o.unref(Ot),{name:"Video",class:"w-6 h-6"}),o.createElementVNode("span",wN,o.toDisplayString(o.unref(a)("editor.video.dialog.title")),1)]),o.createVNode(o.unref(Ot),{name:"Trash2",class:"hover:text-ed-foreground",onClick:o.withModifiers(c,["stop"])})]))])]),_:1}),o.createVNode(o.unref(gs),{"trap-focus":"",class:"w-full","on-open-auto-focus":g=>g.preventDefault()},{default:o.withCtx(()=>[o.createVNode(o.unref(Oh),{"default-value":"upload",class:"w-[300px] sm:w-[400px]","activation-mode":"manual"},{default:o.withCtx(()=>[o.createVNode(o.unref(Bh),{class:"grid w-full grid-cols-2"},{default:o.withCtx(()=>[o.createVNode(o.unref(Kl),{value:"upload"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(a)("editor.video.dialog.tab.upload")),1)]),_:1}),o.createVNode(o.unref(Kl),{value:"link",disabled:i.value},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(a)("editor.video.dialog.link")),1)]),_:1},8,["disabled"])]),_:1}),o.createVNode(o.unref(Ih),{value:"upload"},{default:o.withCtx(()=>[o.createVNode(o.unref(mn),{class:"w-full mt-1",size:"sm",disabled:i.value,onClick:f},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(a)("editor.video.dialog.tab.upload")),1)]),_:1},8,["disabled"]),o.createElementVNode("input",{ref_key:"fileInput",ref:s,type:"file",accept:"video/*",hidden:"",onChange:l},null,544)]),_:1}),o.createVNode(o.unref(Ih),{value:"link"},{default:o.withCtx(()=>[o.createElementVNode("div",xN,[o.createVNode(o.unref(ws),{modelValue:r.value,"onUpdate:modelValue":m[0]||(m[0]=g=>r.value=g),type:"url",autofocus:"",required:"",placeholder:o.unref(a)("editor.video.dialog.placeholder")},null,8,["modelValue","placeholder"]),o.createVNode(o.unref(mn),{onClick:u},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(a)("editor.video.dialog.button.apply")),1)]),_:1})])]),_:1})]),_:1})]),_:1},8,["on-open-auto-focus"])]),_:1},8,["default-open"])]),_:1},8,["class"]))}}),ZE=Lt.create({name:Bc,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 na(CN)},addOptions(){return{...this.parent?.(),upload:()=>Promise.reject("link video not found"),button:({editor:t,t:e})=>({component:Ge,componentProps:{action:()=>t.commands.setVideoUpload(),isActive:()=>t.isActive("video")||!1,disabled:!t.can().setVideo?.({}),icon:"Video",tooltip:e("editor.video.tooltip")}})}}});function kN(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 EN(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 QE=Lt.create({name:"video",group:"block",atom:!0,draggable:!0,addOptions(){return{divider:!1,spacer:!1,allowFullscreen:!0,upload:void 0,width:cf["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?kN(t):null})},width:{default:this.options.width,renderHTML:({width:t})=>({width:Yt(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: ${Yt(n)};`;return EN(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)}}}),Gl=new Et("upload-image"),SN=()=>new ot({key:Gl,state:{init(){return lt.empty},apply(t,e){e=e.map(t.mapping,t.doc);const n=t.getMeta(Gl);if(n?.add){const r=n.add.map(({id:i,pos:s,src:a})=>{const l=_N(a);return jt.widget(s,l,{id:i,side:-1})});e=e.add(t.doc,r)}return 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 _N(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 TN(t,e){const r=Gl.getState(t).find(void 0,void 0,i=>i.id===e);return r.length?r[0]?.from:null}const NE=({validateFn:t,onUpload:e})=>async(n,r,i)=>{const s=[];for(const a of n){if(t&&!t(a))continue;const l=$r(6),u=URL.createObjectURL(a);s.push({file:a,id:l,preview:u})}s.length!==0&&(r.dispatch(r.state.tr.setMeta(Gl,{add:s.map(({id:a,preview:l})=>({id:a,pos:i,src:l}))})),await Promise.all(s.map(async({file:a,id:l,preview:u})=>{try{const c=await e(a),f=TN(r.state,l);if(f===null)return;const{schema:p}=r.state,m=typeof c=="object"?u:c,g=p.nodes.image?.create({src:m}),v=p.nodes.paragraph?.create();if(!g||!v)return;r.dispatch(r.state.tr.replaceWith(f,f,g).insert(f+g.nodeSize,v).setMeta(Gl,{remove:[l]}))}catch{r.dispatch(r.state.tr.setMeta(Gl,{remove:[l]}))}})))},AN=(t,e,n)=>{const r=Array.from(e.clipboardData?.files||[]);if(r.length){e.preventDefault();const i=t.state.selection.from;return n(r,t,i+1),!0}return!1},MN=(t,e,n,r)=>{const i=Array.from(e.dataTransfer?.files||[]);if(!n&&i.length){e.preventDefault();const s=t.posAtCoords({left:e.clientX,top:e.clientY});if(s)return r(i,t,s.pos+1),!0}return!1},ON={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"},BN={class:"flex items-center justify-between w-full"},IN={class:"flex items-center justify-center gap-3"},LN={class:"text-sm"},RN={class:"flex items-center gap-2"},DN=o.defineComponent({__name:"ImageUploader",props:{...ta},setup(t){const e=t,n=o.ref(""),r=o.ref(),{t:i}=Pt(),s=o.inject("isEditable",o.ref(!0));function a(f){const p=f?.target?.files;if(!e.editor||e.editor.isDestroyed||p.length===0)return;const m=Array.from(p),g=e.editor.extensionManager.extensions.find(b=>b.name==="imageUpload")?.options;NE({validateFn:b=>!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(){e.deleteNode()}function c(){r.value?.click()}return(f,p)=>(o.openBlock(),o.createBlock(o.unref(ea),{id:f.node.attrs.id,"data-drag-handle":"",class:o.normalizeClass(o.unref(ke)(!o.unref(s)&&"pointer-events-none"))},{default:o.withCtx(()=>[o.createVNode(o.unref(ms),{"default-open":o.unref(s)},{default:o.withCtx(()=>[o.createVNode(o.unref(Ca),{"as-child":""},{default:o.withCtx(()=>[o.createElementVNode("div",ON,[o.createElementVNode("div",BN,[o.createElementVNode("div",IN,[o.createVNode(o.unref(Ot),{name:"ImageUp",class:"w-6 h-6"}),o.createElementVNode("span",LN,o.toDisplayString(o.unref(i)("editor.image.dialog.title")),1)]),o.createVNode(o.unref(Ot),{name:"Trash2",class:"hover:text-ed-foreground",onClick:o.withModifiers(u,["stop"])})])])]),_:1}),o.createVNode(o.unref(gs),{"trap-focus":"",class:"w-full","on-open-auto-focus":m=>m.preventDefault()},{default:o.withCtx(()=>[o.createVNode(o.unref(Oh),{"default-value":"upload",class:"w-[300px] sm:w-[400px]","activation-mode":"manual"},{default:o.withCtx(()=>[o.createVNode(o.unref(Bh),{class:"grid w-full grid-cols-2"},{default:o.withCtx(()=>[o.createVNode(o.unref(Kl),{value:"upload"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(i)("editor.image.dialog.tab.upload")),1)]),_:1}),o.createVNode(o.unref(Kl),{value:"link"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(i)("editor.image.dialog.tab.url")),1)]),_:1})]),_:1}),o.createVNode(o.unref(Ih),{value:"upload"},{default:o.withCtx(()=>[o.createVNode(o.unref(mn),{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(Ih),{value:"link"},{default:o.withCtx(()=>[o.createElementVNode("div",RN,[o.createVNode(o.unref(ws),{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(mn),{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"])]),_:1},8,["default-open"])]),_:1},8,["id","class"]))}}),PN=1,VN=1e6,Ei={ADD_TOAST:"ADD_TOAST",UPDATE_TOAST:"UPDATE_TOAST",DISMISS_TOAST:"DISMISS_TOAST",REMOVE_TOAST:"REMOVE_TOAST"};let $b=0;function FN(){return $b=($b+1)%Number.MAX_VALUE,$b.toString()}const Hb=new Map;function eS(t){if(Hb.has(t))return;const e=setTimeout(()=>{Hb.delete(t),Kc({type:Ei.REMOVE_TOAST,toastId:t})},VN);Hb.set(t,e)}const yo=o.ref({toasts:[]});function Kc(t){switch(t.type){case Ei.ADD_TOAST:yo.value.toasts=[t.toast,...yo.value.toasts].slice(0,PN);break;case Ei.UPDATE_TOAST:yo.value.toasts=yo.value.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e);break;case Ei.DISMISS_TOAST:{const{toastId:e}=t;e?eS(e):yo.value.toasts.forEach(n=>{eS(n.id)}),yo.value.toasts=yo.value.toasts.map(n=>n.id===e||e===void 0?{...n,open:!1}:n);break}case Ei.REMOVE_TOAST:t.toastId===void 0?yo.value.toasts=[]:yo.value.toasts=yo.value.toasts.filter(e=>e.id!==t.toastId);break}}function zb(){return{toasts:o.computed(()=>yo.value.toasts),toast:$N,dismiss:t=>Kc({type:Ei.DISMISS_TOAST,toastId:t})}}function $N(t){const e=FN(),n=i=>Kc({type:Ei.UPDATE_TOAST,toast:{...i,id:e}}),r=()=>Kc({type:Ei.DISMISS_TOAST,toastId:e});return Kc({type:Ei.ADD_TOAST,toast:{...t,id:e,open:!0,onOpenChange:i=>{i||r()}}}),{id:e,dismiss:r,update:n}}const HN={acceptMimes:["image/jpeg","image/gif","image/png","image/jpg"],maxSize:1024*1024*5},zN=t=>`${(t/1024/1024).toFixed(2)}MB`,tS=Lt.create({name:Ci,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:$r(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 na(DN)},addOptions(){return{...HN,...this.parent?.(),upload:()=>Promise.reject("Image Upload Function"),button:({editor:t,extension:e,t:n})=>({component:Ge,componentProps:{action:()=>t.commands.setImageUpload(),disabled:!t.can().setImage?.({}),icon:"ImageUp",tooltip:n("editor.image.tooltip")}})}},addProseMirrorPlugins(){const{toast:t}=zb(),e=Oa.global.t,r=NE({validateFn:i=>this.options.acceptMimes.includes(i.type)?i.size>this.options.maxSize?(t({description:`${e("editor.imageUpload.fileSizeTooBig")} ${zN(this.options.maxSize)}.`,duration:2e3}),!1):!0:(t({description:e("editor.imageUpload.fileTypeNotSupported"),duration:2e3}),!1),onUpload:this.options.upload});return[new ot({props:{handlePaste:(i,s)=>!s.clipboardData||Array.from(s.clipboardData.items||[]).some(l=>l.type==="text/html")?!1:AN(i,s,r),handleDrop:(i,s,a,l)=>!(s instanceof DragEvent)||!s.dataTransfer||!Array.from(s.dataTransfer.files||[]).some(f=>this.options.acceptMimes.includes(f.type))?!1:MN(i,s,l,r)}}),SN()]}}),UN=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}`}}}}}]}}),WN=o.defineComponent({__name:"SpecialCharacterButton",props:{editor:u4},setup(t){const e=t,{t:n}=Pt(),r=bn(),i=o.computed(()=>e.editor?.storage.specialCharacter.specialCharModal),s=o.ref(!1);let a=null;function l(){const p=document.activeElement;if(p instanceof HTMLInputElement){a={type:"input",el:p};return}r.editorFocusedInstance.value&&(a={type:"editor"})}const u=()=>{if(!i.value||!i.value.component){console.error("Please configure specialCharModal!");return}s.value=!s.value};document.addEventListener("focusin",p=>{if(!s.value)return;const m=p.target;if(m instanceof HTMLInputElement){a={type:"input",el:m};return}r.editorFocusedInstance.value?.view?.dom?.contains(m)&&(a={type:"editor"})});function c(p,m){const g=p.selectionStart??p.value.length,v=p.selectionEnd??p.value.length;p.value=p.value.slice(0,g)+m+p.value.slice(v);const b=g+m.length;p.setSelectionRange(b,b),p.dispatchEvent(new Event("input",{bubbles:!0})),p.focus()}const f=(p,m)=>{if(m){if(a?.type==="input"){c(a.el,p);return}if(a?.type==="editor"){const g=r.editorFocusedInstance.value;if(!g)return;const{view:v}=g,{from:b}=v.state.selection;g.commands.insertContentAt(b,p),g.commands.focus()}}};return(p,m)=>{const g=da,v=is,b=ca,w=fa;return o.openBlock(),o.createBlock(w,null,{default:o.withCtx(()=>[o.createVNode(b,{"delay-duration":0},{default:o.withCtx(()=>[o.createVNode(g,null,{default:o.withCtx(()=>[o.createVNode(mn,{class:"text-[#65558F] hover:bg-[#ECE6F0]/90 text-xs rounded-none font-normal h-[26px] px-3 border border-gray-300 bg-ed-gray-50 dark:bg-black dark:text-white dark:hover:bg-gray-700 transition-all",onPointerdown:l,onClick:u},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("editor.insert.symbol")),1)]),_:1})]),_:1}),o.createVNode(v,null,{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("editor.insert.symbol")),1)]),_:1})]),_:1}),(o.openBlock(),o.createBlock(o.Teleport,{to:"body"},[o.unref(s)?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(o.unref(i).component),o.mergeProps({key:0},o.unref(i).props,{"custom-class":"!z-[70] !pointer-events-auto",onClose:m[0]||(m[0]=x=>s.value=!1),onSelectedChar:f}),null,16)):o.createCommentVNode("",!0)]))]),_:1})}}}),jN=Qe.create({name:sh,addOptions(){return{button:({editor:t})=>({component:WN,componentProps:{editor:t}}),specialCharModal:void 0}},addStorage(){return{specialCharModal:this.options.specialCharModal}}}),nS=Qe.create({name:"base-kit",addOptions(){return{...this.parent?.(),timeHighlighter:{additionalTimeWords:[]},bubble:{list:cL,defaultBubbleList:QK,button:({editor:t,extension:e,t:n})=>{const{list:r={},defaultBubbleList:i}=e.options?.bubble??{},s=i?.(t)??[];return NK(r,s,{editor:t,extension:e,t:n})}}}},addExtensions(){const t=Oa.global.t,e=[];this.options.placeholder!==!1&&e.push(q5.configure({placeholder:({node:n,pos:r})=>{const i=n?.type?.name;return i==="heading"?`${t(`editor.heading.h${n.attrs.level}.tooltip`)}`:i==="table"||i==="codeBlock"?"":r===0?t("editor.content"):""},...this.options.placeholder})),this.options.focus!==!1&&e.push(HK.configure({className:"focus",...this.options.focus})),this.options.document!==!1&&(this.options.page?(e.push(X5.configure().extend({content:"page+"})),e.push(aZ.configure({types:this.options.page?.nodesComputedOption?.types??[],slots:o.useSlots()}))):e.push(X5.configure())),this.options.dropcursor!==!1&&e.push($K.configure({...this.options.dropcursor,width:2,class:"ProseMirror-dropcursor border-black"})),this.options.characterCount!==!1&&e.push(PK.configure(this.options.characterCount)),this.options.paragraph!==!1&&e.push(j5.configure(this.options.paragraph)),this.options.hardBreak!==!1&&e.push(W5.configure(this.options.hardBreak)),this.options.listItem!==!1&&e.push(YK.configure(this.options.listItem)),this.options.textStyle!==!1&&e.push(JK.configure(this.options.textStyle)),this.options.imageUpload!==!1&&e.push(tS.configure(this.options.imageUpload)),this.options.video!==!1&&e.push(QE.configure(this.options.video)),this.options.videoUpload!==!1&&e.push(ZE.configure(this.options.videoUpload)),this.options.history!==!1&&e.push(Lv.configure(this.options.history)),this.options.fontFamily!==!1&&e.push(wE.configure(this.options.fontFamily)),this.options.fontSize!==!1&&e.push(o5.configure(this.options.fontSize)),this.options.fontWeight!==!1&&e.push(dZ.configure(this.options.fontWeight)),this.options.mode!==Te.EDITOR&&e.push(jN.configure(this.options.specialCharacter)),this.options.mode!==Te.EDITOR&&e.push(mZ),this.options.superText!==!1&&this.options.mode!==Te.PLAIN_TEXT&&this.options.mode!==Te.EDITOR&&(typeof this.options.superText=="boolean"?e.push(sE.configure()):e.push(sE.configure(this.options.superText))),this.options.mode===Te.EDITOR&&(this.options.image!==!1&&e.push(jc.configure()),e.push(G6.configure({spacer:!0}),g6,m6,v6,Ov,Vb,b6,d5.configure({spacer:!0}),X6.configure({types:["heading","paragraph","tableCell","tableHeader"],spacer:!0}),kE)),this.options.mode!==Te.EDITOR&&this.options.configPlan!==!1&&this.options.mode!==Te.PLAIN_TEXT&&(typeof this.options.configPlan=="boolean"?e.push(SE.configure()):e.push(SE.configure({specialCharModal:this.options.configPlan?.specialCharModal}))),this.options.mode!==Te.EDITOR&&this.options.mode!==Te.PLAIN_TEXT&&e.push(vZ),(this.options.mode===Te.STRAIGHT||this.options.mode===Te.REPORT||this.options.mode===Te.EDITOR)&&this.options.timeHighlighter&&e.push(aN.configure(this.options.timeHighlighter)),this.options.invalidCharFocus!==!1&&e.push(hE.configure(this.options.invalidCharFocus)),this.options.disabled&&e.push(UN),e.push(Y5,K5.configure(),iN.configure(),XK.configure(),Ab,_b,sv,pN,hN.configure(this.options.deviceEnv),f5.configure({multicolor:!0}));for(const n in this.options.excludes)Object.prototype.hasOwnProperty.call(this.options.excludes,n)&&this.options.excludes[n]&&St.remove(e,({name:i})=>i===n);return e},addStorage(){return{mode:this.options.mode}}}),rS=Fn.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",wt(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()}}}),oS=Fn.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",wt(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()}}}),qN=Qe.create({name:"subAndSuperScript",addOptions(){return{...this.parent?.(),button:({editor:t,extension:e,t:n})=>{const r=e.options.subscript,i=e.options.superscript,s={component:Ge,componentProps:{action:()=>t.commands.toggleSubscript(),isActive:()=>t.isActive("subscript")||!1,disabled:!t.can().toggleSubscript(),icon:"Subscript",tooltip:n("editor.subscript.tooltip")}},a={component:Ge,componentProps:{action:()=>t.commands.toggleSuperscript(),isActive:()=>t.isActive("superscript")||!1,disabled:!t.can().toggleSuperscript(),icon:"Superscript",tooltip:n("editor.superscript.tooltip")}},l=[];return r!==!1&&l.push(s),i!==!1&&l.push(a),l}}},addExtensions(){const t=[];return this.options.subscript!==!1&&t.push(rS.configure(this.options.subscript)),this.options.superscript!==!1&&t.push(oS.configure(this.options.superscript)),t}}),KN={class:"ml-1"},GN=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(ga,{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(Ml),{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(Ot),{key:0,name:s.icon},null,8,["name"])):o.createCommentVNode("",!0),o.createElementVNode("span",KN,o.toDisplayString(s.title),1),s.shortcutKeys?(o.openBlock(),o.createBlock(o.unref(q6),{key:1,class:"ml-auto"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(Cx)(s.shortcutKeys)),1)]),_:2},1024)):o.createCommentVNode("",!0)]),_:2},1032,["checked","disabled","onClick"]))),128))]),_:1},8,["icon","tooltip","disabled"]))}}),XN=Qe.create({name:"moreMark",addOptions(){return{...this.parent?.(),button({editor:t,extension:e,t:n}){const r=e.options.subscript,i=e.options.superscript,s={action:()=>t.commands.toggleSubscript(),isActive:()=>t.isActive("subscript")||!1,disabled:!t.can().toggleSubscript(),icon:"Subscript",title:n("editor.subscript.tooltip"),shortcutKeys:["mod","."]},a={action:()=>t.commands.toggleSuperscript(),isActive:()=>t.isActive("superscript")||!1,disabled:!t.can().toggleSuperscript(),icon:"Superscript",title:n("editor.superscript.tooltip"),shortcutKeys:["mod",","]},l=hg(t,"code"),u=[];if(r!==!1&&u.push(s),i!==!1&&u.push(a),l){const c={action:()=>t.commands.toggleCode(),isActive:()=>t.isActive("code")||!1,disabled:!t.can().toggleCode(),icon:"Code",title:n("editor.code.tooltip"),shortcutKeys:["mod","E"]};l&&u.push(c)}return{component:GN,componentProps:{icon:"Type",tooltip:n("editor.moremark"),disabled:!t.isEditable||u.every(c=>c.disabled),items:u}}}}},addExtensions(){const t=[];return this.options.subscript!==!1&&t.push(rS.configure(this.options.subscript)),this.options.superscript!==!1&&t.push(oS.configure(this.options.superscript)),t}});var La=(t=>(t[t.max=7]="max",t[t.min=0]="min",t[t.more=1]="more",t[t.less=-1]="less",t))(La||{});function YN(t,e,n){return t<e?e:t>n?n:t}function JN(t,e,n,r){const{doc:i,selection:s}=t;if(!i||!s||!(s instanceof Ie||s instanceof An))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=ZN(t,c,e),!1):!H0(u.type.name,r.extensionManager.extensions)}),t}function ZN(t,e,n){if(!t.doc)return t;const r=t.doc.nodeAt(e);if(!r)return t;const a=YN((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 iS({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=JN(a,t,e,i),a.docChanged?(r&&r(a),!0):!1}}const QN=Qe.create({name:"indent",addOptions(){return{...this.parent?.(),types:["paragraph","heading","blockquote"],minIndent:La.min,maxIndent:La.max,button({editor:t,t:e}){const{selection:n}=t.state,r=n.$anchor.parent;return[{component:Ge,componentProps:{action:()=>{t.commands.indent()},disabled:r?.attrs?.indent>=La.max||!t.can().indent(),shortcutKeys:["Tab"],icon:"IndentIncrease",tooltip:e("editor.indent.tooltip")}},{component:Ge,componentProps:{action:()=>{t.commands.outdent()},shortcutKeys:["Shift","Tab"],disabled:r?.attrs?.indent<=La.min||!t.can().outdent(),icon:"IndentDecrease",tooltip:e("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:()=>iS({delta:La.more,types:this.options.types}),outdent:()=>iS({delta:La.less,types:this.options.types})}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.indent(),"Shift-Tab":()=>this.editor.commands.outdent()}}});function NN(t){var e;const{char:n,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:s,startOfLine:a,$position:l}=t,u=r&&!i,c=wB(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"),v=((e=l.nodeBefore)===null||e===void 0?void 0:e.isText)&&l.nodeBefore.text;if(!v)return null;const b=l.pos-v.length,w=Array.from(v.matchAll(g)).pop();if(!w||w.input===void 0||w.index===void 0)return null;const x=w.input.slice(Math.max(0,w.index-1),w.index),C=new RegExp(`^[${s?.join("")}\0]?$`).test(x);if(s!==null&&!C)return null;const E=b+w.index;let k=E+w[0].length;return u&&f.test(v.slice(k-1,k+1))&&(w[0]+=" ",k+=1),E<l.pos&&k>=l.pos?{range:{from:E,to:k},query:w[0].slice(n.length),text:w[0]}:null}const eee=new Et("suggestion");function tee({pluginKey:t=eee,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=NN}){let v;const b=p?.(),w=new ot({key:t,view(){return{update:async(x,C)=>{var E,k,T,_,A,V,O;const B=(E=this.key)===null||E===void 0?void 0:E.getState(C),H=(k=this.key)===null||k===void 0?void 0:k.getState(x.state),j=B.active&&H.active&&B.range.from!==H.range.from,Y=!B.active&&H.active,N=B.active&&!H.active,U=!Y&&!N&&B.query!==H.query,P=Y||j&&U,L=U||j,F=N||j&&U;if(!P&&!L&&!F)return;const R=F&&!P?B:H,K=x.dom.querySelector(`[data-decoration-id="${R.decorationId}"]`);v={editor:e,range:R.range,query:R.query,text:R.text,items:[],command:X=>c({editor:e,range:R.range,props:X}),decorationNode:K,clientRect:K?()=>{var X;const{decorationId:ae}=(X=this.key)===null||X===void 0?void 0:X.getState(e.state),de=x.dom.querySelector(`[data-decoration-id="${ae}"]`);return de?.getBoundingClientRect()||null}:null},P&&((T=b?.onBeforeStart)===null||T===void 0||T.call(b,v)),L&&((_=b?.onBeforeUpdate)===null||_===void 0||_.call(b,v)),(L||P)&&(v.items=await f({editor:e,query:R.query})),F&&((A=b?.onExit)===null||A===void 0||A.call(b,v)),L&&((V=b?.onUpdate)===null||V===void 0||V.call(b,v)),P&&((O=b?.onStart)===null||O===void 0||O.call(b,v))},destroy:()=>{var x;v&&((x=b?.onExit)===null||x===void 0||x.call(b,v))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(x,C,E,k){const{isEditable:T}=e,{composing:_}=e.view,{selection:A}=x,{empty:V,from:O}=A,B={...C};if(B.composing=_,T&&(V||e.view.composing)){(O<C.range.from||O>C.range.to)&&!_&&!C.composing&&(B.active=!1);const H=g({char:n,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:s,startOfLine:a,$position:A.$from}),j=`id_${Math.floor(Math.random()*4294967295)}`;H&&m({editor:e,state:k,range:H.range,isActive:C.active})?(B.active=!0,B.decorationId=C.decorationId?C.decorationId:j,B.range=H.range,B.query=H.query,B.text=H.text):B.active=!1}else B.active=!1;return B.active||(B.decorationId=null,B.range={from:0,to:0},B.query=null,B.text=null),B}},props:{handleKeyDown(x,C){var E;const{active:k,range:T}=w.getState(x.state);return k&&((E=b?.onKeyDown)===null||E===void 0?void 0:E.call(b,{view:x,event:C,range:T}))||!1},decorations(x){const{active:C,range:E,decorationId:k}=w.getState(x);return C?lt.create(x.doc,[jt.inline(E.from,E.to,{nodeName:l,class:u,"data-decoration-id":k})]):null}}});return w}const nee=[{label:"优酷",value:"youku",icon:"Youku"},{label:"哔哩哔哩",value:"bilibili",icon:"BiliBili"},{label:"腾讯视频",value:"qqvideo",icon:"QQVideo"}],ree=[{label:"高德地图",value:"amap",icon:"Gaode"},{label:"百度地图",value:"baidu_map",icon:"Baidu"}],oee=[{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"}],iee=[{label:"CodePen",value:"codepen",icon:"Codepen"}],see=[{label:"金数据",value:"jinshuju",icon:"Jinshuju"}],aee=[],lee=[...nee,...ree,...oee,...iee,...see,...aee];function uee(t){const e=Oa.global.t,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(hg(t,"iframes")){const i=lee;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 cee={key:0,class:"grid grid-cols-1 gap-0.5 min-w-48"},dee={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"},fee=["onClick"],pee=["src"],hee={key:1,class:"p-3"},mee={class:"text-xs text-gray-800 dark:text-gray-400"},gee=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}=Pt(),a=o.ref([]),l=t;e({onKeyDown:u}),o.watch([()=>n.value,()=>r.value],async()=>{if(!i.value)return;await o.nextTick();const b=r.value*1e3+n.value,w=a.value[b];w&&w.scrollIntoView({behavior:"smooth",block:"nearest"})});function u({event:b}){return b.key==="ArrowUp"?(c(),!0):b.key==="ArrowDown"?(f(),!0):b.key==="Enter"?(p(),!0):!1}function c(){if(!l.items.length)return!1;let b=n.value-1,w=r.value;b<0&&(w=r.value-1,b=l.items[w]?.commands.length-1||0),w<0&&(w=l.items.length-1,b=l.items[w].commands.length-1),n.value=b,r.value=w}function f(){if(!l.items.length)return!1;const b=l.items[r.value].commands;let w=n.value+1,x=r.value;b.length-1<w&&(w=0,x=r.value+1),l.items.length-1<x&&(x=0),n.value=w,r.value=x}function p(){if(!l.items.length||r.value===-1||n.value===-1)return!1;m(r.value,n.value)}function m(b,w){const x=l.items[b].commands[w];l.command(x)}function g(b,w){m(b,w)}function v(b,w,x){a.value[b*1e3+w]=x}return(b,w)=>(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"},[b.items?.length?(o.openBlock(),o.createElementBlock("div",cee,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(b.items,(x,C)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:x.title},[o.createElementVNode("div",dee,o.toDisplayString(x.title),1),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(x.commands,(E,k)=>(o.openBlock(),o.createElementBlock("button",{ref_for:!0,ref:T=>v(C,k,T),key:k,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===C&&n.value===k?"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:T=>g(C,k)},[E.iconUrl?(o.openBlock(),o.createElementBlock("img",{key:0,class:"w-6 h-6",src:E.iconUrl},null,8,pee)):o.createCommentVNode("",!0),E.iconName?(o.openBlock(),o.createBlock(o.unref(Ot),{key:1,name:E.iconName,class:"mr-1 text-lg"},null,8,["name"])):o.createCommentVNode("",!0),o.createTextVNode(" "+o.toDisplayString(E.label),1)],10,fee))),128))],64))),128))])):(o.openBlock(),o.createElementBlock("div",hee,[o.createElementVNode("span",mee,o.toDisplayString(o.unref(s)("editor.slash.empty")),1)]))],512))}}),Ra="slashCommand";let Go;const vee=Qe.create({name:Ra,priority:200,onCreate(){Go=Ns("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[tee({editor:this.editor,char:"/",allowSpaces:!0,startOfLine:!0,pluginKey:new Et(Ra),allow:({state:t,range:e})=>{const n=t.doc.resolve(e.from),r=n.depth===1,i=n.parent.type.name==="paragraph",s=n.parent.textContent?.charAt(0)==="/",a=this.editor.isActive("column"),u=!n.parent.textContent?.substring(n.parent.textContent?.indexOf("/"))?.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})=>uee(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=>{t=new nx(gee,{props:n,editor:n.editor});const{view:r}=n.editor,i=()=>{if(!n.clientRect)return n.editor.storage[Ra].rect;const s=n.clientRect();if(!s)return n.editor.storage[Ra].rect;let a=s.y;if(t.element instanceof HTMLElement&&s.top+t.element.offsetHeight+40>window.innerHeight){const l=s.top+t.element.offsetHeight-window.innerHeight+40;a=s.y-l}return new DOMRect(s.x,a,s.width,s.height)};e=()=>{Go?.[0].setProps({getReferenceClientRect:i})},r.dom.parentElement?.addEventListener("scroll",e),t.element&&Go?.[0].setProps({getReferenceClientRect:i,appendTo:()=>document.body,content:t.element}),Go?.[0].show()},onUpdate(n){t.updateProps(n);const{view:r}=n.editor,i=()=>{if(!n.clientRect)return n.editor.storage[Ra].rect;const a=n.clientRect();return a?new DOMRect(a.x,a.y,a.width,a.height):n.editor.storage[Ra].rect},s=()=>{Go?.[0].setProps({getReferenceClientRect:i})};r.dom.parentElement?.addEventListener("scroll",s),n.editor.storage[Ra].rect=n.clientRect?i():{width:0,height:0,left:0,top:0,right:0,bottom:0},Go?.[0].setProps({getReferenceClientRect:i})},onKeyDown(n){return n.event.key==="Escape"?(Go?.[0].hide(),!0):(Go?.[0].state.isShown||Go?.[0].show(),t.ref?.onKeyDown(n))},onExit(n){if(Go?.[0].hide(),e){const{view:r}=n.editor;r.dom.parentElement?.removeEventListener("scroll",e)}t.destroy()}}}})]},addStorage(){return{rect:{width:0,height:0,left:0,top:0,right:0,bottom:0}}}}),bee=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=bn(),{toast:r}=zb();function i(){const s=e.editor.extensionManager.extensions.find(a=>a.name==="AI")?.options?.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,e.editor?.commands.focus()}return(s,a)=>(o.openBlock(),o.createBlock(Ge,{action:i,title:"AI",disabled:s.disabled,icon:s.icon,tooltip:s.tooltip},null,8,["disabled","icon","tooltip"]))}}),yee=Lt.create({name:"AI",group:"block",addOptions(){return{...this.parent?.(),toolbar:!1,button:({editor:t,t:e})=>({component:bee,componentProps:{icon:"Sparkles",tooltip:e("editor.AI.ask")}})}}});function wee(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 xee(t,e){return new File([t],e,{type:t.type})}const Cee=Qe.create({name:"importWord",addOptions(){return{...this.parent?.(),upload:void 0,convert:void 0,limit:1024*1024*10,button:({editor:t,extension:e,t:n})=>({component:Ge,componentProps:{action:()=>t.commands?.toggleImportWord(),disabled:!t.can().setHorizontalRule(),icon:"Word",tooltip:n("editor.importWord.tooltip")}})}},addCommands(){return{toggleImportWord:()=>({chain:t,editor:e})=>{const{toast:n}=zb(),r=Oa.global.t;async function i(u){const f=new DOMParser().parseFromString(u,"text/html"),p=f.querySelectorAll("img");if(!p.length)return f.body.innerHTML;if(hg(e,"image")){const g=e.extensionManager.extensions.find(v=>v.name==="importWord")?.options;if(g&&typeof g.upload=="function"){const v=[];for(const w of p){const x=w.getAttribute("src"),C=wee(x,"image/jpeg"),E=xee(C,"image.jpeg");v.push(E)}const b=await g.upload(v);for(let w=0;w<p.length;w++){const x=p[w];x.setAttribute("src",b[w].src);const C=x.parentElement;C?.tagName==="P"&&(C.insertAdjacentElement("beforebegin",x),!C.hasChildNodes()&&C.textContent===""&&C.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}}}}),Ub=bn(),kee=Qe.create({name:"preview",addOptions(){return{...this.parent?.(),button:({t})=>({component:Ge,componentProps:{icon:"Eye",action:()=>{Ub.togglePreview()},tooltip:t("editor.preview.tooltip"),isActive:()=>Ub.state.showPreview}})}},addCommands(){return{togglePreview:()=>()=>(Ub.togglePreview(),!0)}}}),sS=bn(),Eee=(t,e,n)=>RegExp(e?t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"):t,n?"gu":"gui");function See(t,e,n,r){const i=[],s=[];let a=[],l=0;if(!e)return{decorationsToReturn:lt.empty,results:[]};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:lt.create(t,i),results:s}}const _ee=(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))},Tee=(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]},Aee=(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=Tee(t,a,i,s);c&&(i=c[0],s=c[1])}r&&r(n)}},Mee=new Et("findAndReplacePlugin"),Oee=Qe.create({name:"findAndReplace",addOptions(){return{...this.parent?.(),searchResultClass:"vdc-editor-search-result",disableRegex:!0,button:({editor:t,extension:e,t:n})=>({component:Ge,componentProps:{icon:"DocSearch",tooltip:n("editor.findAndReplace.tooltip"),action:()=>{sS.toggleFindAndReplace()},isActive:()=>sS.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 _ee(r,i,{state:e,dispatch:n}),!1},replaceAll:()=>({editor:t,tr:e,dispatch:n})=>{const{replaceTerm:r,results:i}=t.storage.findAndReplace;return Aee(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 ot({key:Mee,state:{init:()=>lt.empty,apply({doc:a,docChanged:l},u){const{searchTerm:c,lastSearchTerm:f,caseSensitive:p,lastCaseSensitive:m,resultIndex:g,lastResultIndex:v}=t.storage.findAndReplace;if(!l&&f===c&&m===p&&v===g)return u;if(r(c),i(p),s(g),!c)return t.storage.findAndReplace.results=[],lt.empty;const{decorationsToReturn:b,results:w}=See(a,Eee(c,n,p),e,g);return t.storage.findAndReplace.results=w,b}},props:{decorations(a){return this.getState(a)}}})]}}),{togglePrinter:Bee,state:Iee}=bn(),Lee=Qe.create({name:"printer",addOptions(){return{...this.parent?.(),button:({t})=>({component:Ge,componentProps:{tooltip:t("editor.printer.tooltip"),action:()=>Bee(),icon:"Printer",shortcutKeys:["mod","P"],isActive:()=>Iee.printer}})}}}),Ree=async function(t){let e=[];try{if(this.enabled===!1||t.length===0||t.trim()==="")return e;if(this.limit&&t.length>this.limit)throw new Error("Text is too long");const n=await sn.post(this.getApi(),{value:t}),r=this.transfer(n.data);e=r?.map(i=>i.errorText)||[],this?.setSuggestions&&this.setSuggestions(r)}catch(n){console.error(n)}return e};class aS{suggestions=[];api="";enabled=!0;limit;transfer;constructor({api:e,limit:n,transfer:r,enabled:i}){this.suggestions=[],this.api=e,this.limit=n,this.transfer=r,this.enabled=i??!0}setSuggestions(e){this.suggestions=e}getSuggestions(e){return Promise.resolve(this.suggestions.find(n=>n.errorText.wrongWord===e)?.spellData.correctWord??[])}getApi(){return this.api}normalizeTextForLanguage(e){return e}proofreadText(e){return Promise.resolve(Ree.call(this,e))}toggleIsEnabled(){this.enabled=!this.enabled}setEnabled(e){this.enabled=e}getIsEnabled(){return this.enabled}}const Dee=Object.freeze(Object.defineProperty({__proto__:null,AI:yee,BaseKit:nS,Blockquote:Xq,Bold:m6,BulletList:$q,Clear:sv,Code:_$,CodeBlock:WH,Color:d5,Columns:Ab,FindAndReplace:Oee,FontFamily:wE,FontSize:o5,FormatPainter:_b,Fullscreen:DK,Heading:G6,Highlight:Rq,History:Lv,HorizontalRule:EK,Image:jc,ImageUpload:tS,ImportWord:Cee,Indent:QN,Italic:g6,LineHeight:kE,Link:Ov,MoreMark:XN,OrderedList:Wq,Preview:kee,Printer:Lee,Proofreader:aS,SlashCommand:vee,SpellcheckerExtension:fE,Strike:b6,SubAndSuperScript:qN,Table:Vb,TaskList:Kq,TextAlign:X6,Underline:v6,Video:QE,VideoUpload:ZE},Symbol.toStringTag,{value:"Module"})),Pee='<page id="ft6nbbxs" extend="false" pagenumber="1" force="false"><h1 id="tk6n64mj" extend=""false""><strong>Introduction(English)</strong></h1><p id="s864ng1o" extend=""false"">MyMy Editor is open-source document editor based on Vue3 and Tiptap. MyMy Editor provides comprehensive document editing capabilities, supports pagination, supports Markdown syntax, offers basic rich text editing functions, allows for the insertion of various node types in multiple formats, provides a variety of practical tools, and supports setting page styles. It also supports exporting in various formats, printing and print preview, block-level document editing, adding custom extensions, multi-language settings, and a dark theme.</p><h1 id="jm9johtz" extend=""false""><strong>소개(국문)</strong></h1><p id="0qei01hl" extend=""false"">마이마이 에디터는 Vue3과 Tiptap을 기반으로 한 오픈소스 문서 편집기입니다. 마이마이 에디터는 포괄적인 문서 편집 기능을 제공하며, 페이지네이션, 마크다운 구문 지원, 기본적인 리치 텍스트 편집 기능, 다양한 형식의 다양한 노드 유형 삽입, 다양한 실용적인 도구 제공, 페이지 스타일 설정 지원 등을 제공합니다. 또한 다양한 형식으로 내보내기, 인쇄 및 인쇄 미리보기, 블록 수준의 문서 편집, 사용자 지정 확장 추가, 다국어 설정 및 다크 테마를 지원합니다.마이마이 에디터는 Vue3과 Tiptap을 기반으로 한 오픈소스 문서 편집기입니다. 마이마이 에디터는 포괄적인 문서 편집 기능을 제공하며, 페이지네이션, 마크다운 구문 지원, 기본적인 리치 텍스트 편집 기능, 다양한 형식의 다양한 노드 유형 삽입, 다양한 실용적인 도구 제공, 페이지 스타일 설정 지원 등을 제공합니다. 또한 다양한 형식으로 내보내기, 인쇄 및 인쇄 미리보기, 블록 수준의 문서 편집, 사용자 지정 확장 추가, 다국어 설정 및 다크 테마를 지원합니다.</p><blockquote class="blockquote"><p id="nekf7yi0" extend="false"><span style="color: rgb(115, 209, 61)"><strong><em>Make by VDC</em></strong></span></p></blockquote></page>';function Vee(){const t=window.localStorage.getItem("content"),e=o.ref(t||Pee),n=o.computed(()=>[nS.configure({placeholder:{showOnlyCurrent:!0},characterCount:{limit:1e5},excludes:{}}),Lv,Ab,_b,sv,Ov,jc,Vb]),r=ct.useEventBus(ur.RENDER_SUPER_TEXT);function i(s,a){const l={action:"status",payload:{id:s,status:a}};r.emit(l)}return{defaultExtensions:n,content:e,dispatchUpdateStatusSuperText:i}}function Fee(){const t=o.ref(!1);return{hasEverFocused:t,markAsFocused:()=>{t.value=!0},insertHtml:(r,i)=>{const{state:s}=r,{doc:a,selection:l}=s,u=l.$from,c=a.firstChild,f=r.isEmpty;if(!t.value){if(f&&c){r.chain().insertContentAt({from:0,to:c.nodeSize},i).focus().run();return}const m=a.content.size;r.chain().insertContentAt(m,i).focus().run();return}const p=u.parent;if(p.type.name==="paragraph"&&p.textContent.trim().length===0){const m=u.before();r.chain().insertContentAt({from:m,to:m+p.nodeSize},i).focus().run();return}if(u.parentOffset===0&&p.type.name==="paragraph"&&p.content.size>0){const m=u.before();r.chain().insertContentAt(m,i).focus().run();return}r.chain().insertContentAt(r.state.selection,i).focus().run()}}}function Xl(t=250){const e=o.ref(!1);let n=null;const r=()=>{e.value=!0,n&&clearTimeout(n),n=setTimeout(()=>{e.value=!1},t)};return o.onUnmounted(()=>{n&&clearTimeout(n)}),{isScrolling:e,handleScroll:r}}function $ee(){const t=o.ref(!1);let e=!1;function n(){const l=Array.from(document.querySelectorAll(".inside-toolbar")),u=document.querySelector("#tool-bar-format"),c=document.querySelector("#tool-bar-image"),f=Array.from(document.querySelectorAll('[contenteditable="true"].tiptap:not(.simple-editor)'));return{popupInsideToolbars:l,toolBarFormat:u,toolBarImage:c,tiptapEditors:f}}function r(l){if(!l)return!1;const{popupInsideToolbars:u,toolBarFormat:c,toolBarImage:f,tiptapEditors:p}=n();return u.some(m=>m.contains(l))||(c?.contains(l)??!1)||(f?.contains(l)??!1)||p.some(m=>m.contains(l))}function i(l){e=r(l.target)}function s(l){const u=l.target;u&&r(u)&&(t.value=!0)}function a(l){const u=l.relatedTarget;r(u)||e&&u===null||(t.value=!1)}return ct.useEventListener(document,"mousedown",i,{capture:!0}),ct.useEventListener(document,"touchstart",i,{capture:!0}),ct.useEventListener(document,"focusin",s),ct.useEventListener(document,"focusout",a),{isShowToolBarBaseOnEditor:t}}function Gc(){try{const{locale:t}=Pt();o.watch(t,e=>{const n=String(e);n&&Oa.global.locale.value!==n&&(Oa.global.locale.value=n)},{immediate:!0})}catch{}}const Hee={key:0,class:"p-2.5 space-y-1.5"},zee=["innerHTML"],Uee={key:1,class:"p-2.5 space-y-1.5"},Wee=["innerHTML"],jee={key:2,class:"p-2.5 space-y-1.5"},qee=["innerHTML"],Kee=Xr(o.defineComponent({__name:"ArticleFullViewer",props:{extensions:{},mode:{},hideComment:{type:Boolean},fieldNameComment:{},fieldNameCommentCuesheet:{},fieldNameContent:{},comment:{},commentCuesheet:{},content:{},minChars:{},fontSize:{}},setup(t){const e=t;Gc();const n=o.computed(()=>{const C=e.extensions?.filter(E=>E.name!=="spellchecker")||[];return C.some(E=>E.name==="image")||C.push(jc.configure()),C}),r=o.computed(()=>ra(e.comment)),i=o.computed(()=>ra(e.commentCuesheet)),s=o.computed(()=>ra(e.content));function a(C){return cg(C).replace(/<script\b[\s\S]*?<\/script\s*>/gi,"")}const l=o.computed(()=>r.value?a(e.comment):""),u=o.computed(()=>i.value?a(e.commentCuesheet):""),c=o.computed(()=>s.value?a(e.content):""),f=o.ref(),p=o.ref(),m=o.ref();o.onBeforeUnmount(()=>{f.value&&f.value.destroy(),p.value&&p.value.destroy(),m.value&&m.value.destroy()});function g(C){return new Oo({extensions:n.value,content:C,editable:!1,parseOptions:{preserveWhitespace:"full"}})}o.onMounted(async()=>{!r.value&&e.comment&&(f.value=g(un(e.comment,!0,e.mode)),await o.nextTick()),!i.value&&e.commentCuesheet&&(p.value=g(un(e.commentCuesheet,!0,e.mode)),await o.nextTick()),!s.value&&e.content&&(m.value=g(un(e.content,!0,e.mode)))});function v(C,E){if(!C)return;const k=un(E,!0,e.mode);St.isEqual(C.getHTML(),k)||C.commands.setContent(k,!1,{preserveWhitespace:"full"})}o.watch(()=>e.comment,C=>{r.value||v(f.value,C)}),o.watch(()=>e.commentCuesheet,C=>{i.value||v(p.value,C)}),o.watch(()=>e.content,C=>{s.value||v(m.value,C)});const b=o.computed(()=>e.fontSize??""),{contentInner:w,measuredMinWidth:x}=pf({minChars:e.minChars,fontSize:b});return(C,E)=>{const k=zT;return o.openBlock(),o.createElementBlock("div",{ref_key:"contentInner",ref:w,style:o.normalizeStyle({minWidth:`${Number(o.unref(x))+23}px`}),class:"flex-1 border border-[#999] rounded-[3px] divide-y divide-[#999] divide-dashed overflow-y-auto"},[C.comment&&!C.hideComment?(o.openBlock(),o.createElementBlock("div",Hee,[C.fieldNameComment?.label?(o.openBlock(),o.createBlock(k,{key:0,label:C.fieldNameComment.label,"custom-class":C.fieldNameComment.customClass},null,8,["label","custom-class"])):o.createCommentVNode("",!0),o.unref(r)?(o.openBlock(),o.createElementBlock("div",{key:1,class:"ProseMirror",innerHTML:o.unref(l)},null,8,zee)):o.unref(f)?(o.openBlock(),o.createBlock(o.unref(Yn),{key:2,editor:o.unref(f)},null,8,["editor"])):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0),C.commentCuesheet&&!C.hideComment?(o.openBlock(),o.createElementBlock("div",Uee,[C.fieldNameCommentCuesheet?.label?(o.openBlock(),o.createBlock(k,{key:0,label:C.fieldNameCommentCuesheet.label,"custom-class":C.fieldNameCommentCuesheet.customClass},null,8,["label","custom-class"])):o.createCommentVNode("",!0),o.unref(i)?(o.openBlock(),o.createElementBlock("div",{key:1,class:"ProseMirror",innerHTML:o.unref(u)},null,8,Wee)):o.unref(p)?(o.openBlock(),o.createBlock(o.unref(Yn),{key:2,editor:o.unref(p)},null,8,["editor"])):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0),C.content?(o.openBlock(),o.createElementBlock("div",jee,[C.fieldNameContent?.label?(o.openBlock(),o.createBlock(k,{key:0,label:C.fieldNameContent.label,"custom-class":C.fieldNameContent.customClass},null,8,["label","custom-class"])):o.createCommentVNode("",!0),o.unref(s)?(o.openBlock(),o.createElementBlock("div",{key:1,class:"ProseMirror",innerHTML:o.unref(c)},null,8,qee)):o.unref(m)?(o.openBlock(),o.createBlock(o.unref(Yn),{key:2,editor:o.unref(m)},null,8,["editor"])):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0)],4)}}}),[["__scopeId","data-v-3357e31b"]]),wo=o.defineComponent({__name:"Separator",props:{orientation:{},decorative:{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(XV),o.mergeProps(n.value,{class:o.unref(ke)("shrink-0 bg-ed-separator",e.orientation==="vertical"?"w-px h-full":"h-px w-full",e.class)}),null,16,["class"]))}}),Gee={class:"flex gap-2 items-center overflow-x-auto overflow-y-hidden [&::-webkit-scrollbar]:h-1.5"},Xee={class:"flex-1 flex justify-end items-center gap-x-3"},Yee=o.defineComponent({__name:"Toolbar",props:{editor:{},editorComment:{},disabled:{type:Boolean,default:!1},mode:{},class:{},customClassToolbar:{},toolbarExtensionOrder:{}},setup(t){const e=o.defineAsyncComponent(()=>Promise.resolve().then(()=>jJ)),{t:n}=Pt(),r=t,i=o.inject("isEditable",o.ref(!0)),s=[rh,Rc,sh,oh,ki,Lc],a=o.computed(()=>{const f=[...r.editor.extensionManager.extensions],p={[ki]:-1},m={[rh]:1,[Rc]:2,[sh]:3,[oh]:4,[ki]:5,[Lc]:6},g=r.toolbarExtensionOrder??(r.mode===Te.EDITOR?p:m),v=uE(f,g);let b=[];for(const w of v){const{button:x,divider:C=!1,spacer:E=!1,toolbar:k=!0}=w.options;if(!x||!pg(x)||!k)continue;const T=x({editor:r.editor,extension:w,t:o.unref(n)});if(Array.isArray(T)){const _=T.map((A,V)=>({id:`${w.name}`,button:A,divider:V===T.length-1?C:!1,spacer:V===0?E:!1}));b=[...b,..._];continue}b.push({button:T,divider:C,spacer:E,id:`${w.name}`})}if(r.mode!==Te.EDITOR)return b.filter(w=>w.id&&s.includes(w.id));if(b=b.filter(w=>w.id!=="superText"),!i.value){b=b.map(x=>(x.button.componentProps.disabled=!0,x));const w=b.find(x=>x.id==="spellchecker");w&&(w.button.componentProps.disabled=!1)}return b}),l=f=>f.id==="spellchecker"?"!text-[#2977D9] border border-gray-300 dark:!text-white hover:!bg-gray-200 dark:hover:!bg-gray-700 rounded-none [&>div>svg]:w-[19px] [&>div>svg]:h-[19px] p-0 w-[26px] h-[26px]":f.button.componentProps.customClass,u=f=>f.id==="spellchecker"?"Spellchecker":f.button.componentProps.icon,c=o.computed(()=>r.editor?.extensionManager.extensions.find(f=>f.name==="spellchecker"));return(f,p)=>(o.openBlock(),o.createElementBlock("div",{id:"tool-bar",class:o.normalizeClass(o.unref(ke)(r.class,f.customClassToolbar))},[o.createElementVNode("div",Gee,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.value,(m,g)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:g},[m.spacer&&g!==0?(o.openBlock(),o.createBlock(o.unref(wo),{key:0,orientation:"vertical",class:"h-[16px] mx-[10px]"})):o.createCommentVNode("",!0),(o.openBlock(),o.createBlock(o.resolveDynamicComponent(m.button.component),o.mergeProps({id:m.id,ref_for:!0},m.button.componentProps,{editor:f.editor,disabled:f.disabled||m.button.componentProps?.disabled,"custom-class":l(m),icon:u(m)}),o.createSlots({_:2},[o.renderList(m.button.componentSlots,(v,b,w)=>({name:`${b}`,fn:o.withCtx(x=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(v),o.mergeProps({ref_for:!0},x?.props,{id:m.id}),null,16,["id"]))])}))]),1040,["id","editor","disabled","custom-class","icon"])),m.divider?(o.openBlock(),o.createBlock(o.unref(wo),{key:1,orientation:"vertical",class:"mx-2 h-auto"})):o.createCommentVNode("",!0)],64))),128)),o.createElementVNode("div",Xee,[p[0]||(p[0]=o.createElementVNode("div",{id:"tool-bar-auto-save"},null,-1)),c.value?(o.openBlock(),o.createBlock(o.unref(e),{key:0,editor:f.editor,"editor-comment":f.editorComment,isEnableSpellCheckRealTime:f.editor?.extensionStorage.spellchecker.spellchecker.proofreader.enabled},null,8,["editor","editor-comment","isEnableSpellCheckRealTime"])):o.createCommentVNode("",!0)])])],2))}}),lS=(t,e)=>{const{view:n,state:{selection:{from:r}}}=t,i=document.querySelectorAll(".focus"),s=i.length,l=i[s-1];if(l&&l.getAttribute("data-type")&&l.getAttribute("data-type")===e||l&&l.classList&&l.classList.contains(e))return l;const u=n.domAtPos(r).node;let c=u;for(c.tagName||(c=u.parentElement);c&&!(c.getAttribute("data-type")&&c.getAttribute("data-type")===e)&&!c.classList.contains(e);)c=c.parentElement;return c},Jee={class:"w-max px-3 py-2 transition-all border rounded-sm shadow-sm pointer-events-auto select-none border-neutral-200 dark:border-neutral-800 bg-ed-background"},Zee={class:"flex items-center flex-nowrap whitespace-nowrap h-[26px] justify-start relative gap-0.5"},Qee={class:"flex items-center gap-2"},Nee={class:"mt-3"},uS=o.defineComponent({__name:"ImageBubbleMenu",props:{editor:{},disabled:{type:Boolean,default:!1}},setup(t){const e=t,{t:n}=Pt(),r=o.ref("100"),i=o.ref(),s=o.ref(),a=o.ref(),l=["left","center","right"],u={left:"AlignLeft",center:"AlignCenter",right:"AlignRight"},c=()=>document.body;function f(O){O?.preventDefault(),e.editor.getAttributes("image").src&&e.editor.chain().focus(void 0,{scrollIntoView:!1}).updateImage({width:i.value?`${i.value}px`:null}).run()}function p(O){const B=Math.max(0,Math.min(100,parseInt(r.value)));e.editor.chain().focus(void 0,{scrollIntoView:!1}).updateImage({width:`${B}%`}).run()}const m=o.ref(!1),g=o.ref(null),v=({editor:O})=>$0(O.view.state,"image")||m.value;function b(){const O=lS(e.editor,"node-image");return O?(g.value=O,O.getBoundingClientRect()):m.value&&g.value?g.value.getBoundingClientRect():new DOMRect(-1e3,-1e3,0,0)}function w(O){e.editor.commands.updateAttributes("image",{textAlign:O})}o.watch(r,()=>{r.value&&p()}),o.watch(()=>e.editor.getAttributes("image"),O=>{O&&(i.value=Math.round(parseFloat(O.originWidth)),s.value=Math.round(parseFloat(O.originHeight)),a.value=O.originWidth/O.originHeight)});function x(){s.value&&a.value?i.value=Math.max(30,Math.round(s.value*a.value)):i.value=null}function C(){i.value&&a.value?s.value=Math.max(20,Math.round(i.value/a.value)):s.value=null}function E(O){w(O)}function k(){const O=e.editor.getAttributes("image"),{flipX:B}=O;e.editor.chain().focus(void 0,{scrollIntoView:!1}).updateImage({flipX:!B}).run()}function T(){const O=e.editor.getAttributes("image"),{flipY:B}=O;e.editor.chain().focus(void 0,{scrollIntoView:!1}).updateImage({flipY:!B}).run()}function _(){const{state:O,dispatch:B}=e.editor.view;ol(O,B)}function A(){const{state:O,dispatch:B}=e.editor.view,{tr:H,selection:j}=O;if(!(j instanceof Re))return;const Y=j.from,N=O.doc.nodeAt(Y);if(!N)return;const P=O.doc.resolve(Y).nodeBefore;if(!P)return;const L=Y-P.nodeSize,F=H.delete(Y,Y+N.nodeSize).insert(L,N).setSelection(Re.create(H.doc,L));B(F),e.editor.commands.focus()}function V(){const{state:O,dispatch:B}=e.editor.view,{tr:H,doc:j,selection:Y}=O;if(!(Y instanceof Re))return;const N=Y.from,U=j.nodeAt(N);if(!U)return;const P=N+U.nodeSize;if(P>=j.content.size)return;const L=j.nodeAt(P);if(!L)return;const F=P+L.nodeSize-U.nodeSize,R=N+L.nodeSize,K=H.delete(N,N+U.nodeSize).insert(F,U).setSelection(Re.create(H.doc,R));B(K),e.editor.commands.focus()}return(O,B)=>{const H=Ge,j=wo,Y=Ca,N=Mc,U=ws,P=Kl,L=Bh,F=Oh,R=gs,K=ms;return o.openBlock(),o.createBlock(o.unref(Wu),{editor:O.editor,"plugin-key":"image-menus-123","should-show":v,"update-delay":0,"tippy-options":{zIndex:9999,appendTo:c,getReferenceClientRect:()=>b()}},{default:o.withCtx(()=>[o.createElementVNode("div",Jee,[o.createElementVNode("div",Zee,[o.createVNode(H,{tooltip:o.unref(n)("editor.image.menu.flipX"),icon:"FlipVertical",action:k},null,8,["tooltip"]),o.createVNode(H,{tooltip:o.unref(n)("editor.image.menu.flipY"),icon:"FlipHorizontal",action:T},null,8,["tooltip"]),o.createVNode(j,{orientation:"vertical",class:"mx-1 me-2 h-[16px]"}),o.createVNode(H,{tooltip:o.unref(n)("editor.image.menu.moveUp"),icon:"MoveUp",action:A,disabled:!O.editor.isEditable},null,8,["tooltip","disabled"]),o.createVNode(H,{tooltip:o.unref(n)("editor.image.menu.moveDown"),icon:"MoveDown",action:V,disabled:!O.editor.isEditable},null,8,["tooltip","disabled"]),o.createVNode(j,{orientation:"vertical",class:"mx-1 me-2 h-[16px]"}),o.createVNode(K,{open:m.value,"onUpdate:open":B[4]||(B[4]=X=>m.value=X)},{default:o.withCtx(()=>[o.createVNode(Y,null,{default:o.withCtx(()=>[o.createVNode(H,{title:o.unref(n)("editor.image.menu.size"),icon:"ImageSize"},null,8,["title"])]),_:1}),o.createVNode(R,{class:"w-84"},{default:o.withCtx(()=>[o.createElementVNode("div",Qee,[o.createVNode(N,{for:"maxWidth",class:"whitespace-nowrap"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("editor.image.menu.size.width")),1)]),_:1}),o.createVNode(U,{id:"maxWidth",modelValue:i.value,"onUpdate:modelValue":B[0]||(B[0]=X=>i.value=X),type:"number",class:"w-20 h-8 [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",onInput:C,onKeyup:o.withKeys(f,["enter"])},null,8,["modelValue"]),o.createVNode(N,{for:"maxWidth",class:"whitespace-nowrap"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("editor.image.menu.size.height")),1)]),_:1}),o.createVNode(U,{id:"maxWidth",modelValue:s.value,"onUpdate:modelValue":B[1]||(B[1]=X=>s.value=X),type:"number",class:"w-20 h-8 [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",onInput:x,onKeyup:o.withKeys(f,["enter"])},null,8,["modelValue"])]),o.createElementVNode("div",Nee,[o.createVNode(F,{"model-value":r.value,"onUpdate:modelValue":[B[2]||(B[2]=X=>r.value=X),B[3]||(B[3]=X=>{r.value=X})]},{default:o.withCtx(()=>[o.createVNode(L,null,{default:o.withCtx(()=>[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(["25","50","75","100"],X=>o.createVNode(P,{key:X,value:X},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(X)+"% ",1)]),_:2},1032,["value"])),64))]),_:1})]),_:1},8,["model-value"])])]),_:1})]),_:1},8,["open"]),o.createVNode(j,{orientation:"vertical",class:"mx-1 me-2 h-[16px]"}),(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(l,(X,ae)=>o.createVNode(H,{key:ae,tooltip:o.unref(n)(`editor.textalign.${X}.tooltip`),icon:u[X],action:()=>E(X),disabled:!O.editor.can().setTextAlign(X),"is-active":()=>O.editor.isActive({textAlign:X})||!1},null,8,["tooltip","icon","action","disabled","is-active"])),64)),o.createVNode(j,{orientation:"vertical",class:"mx-1 me-2 h-[16px]"}),o.createVNode(H,{tooltip:o.unref(n)("editor.remove"),icon:"Trash2",action:_,disabled:!O.editor.isEditable},null,8,["tooltip","disabled"])])])]),_:1},8,["editor","tippy-options"])}}}),ete={class:"h-full w-fit min-w-32 flex items-center leading-none gap-0.5 p-2 bg-ed-background rounded-lg shadow-sm border border-ed-border"},Lh=o.defineComponent({__name:"TableBubbleMenu",props:{editor:{}},setup(t){const e=t,n=()=>document.body,r=({editor:w})=>w.isActive("table")&&(w.storage.table?.isTableEditorOpen??!1),{t:i}=Pt();function s(){e.editor.chain().focus().addColumnBefore().run()}function a(){e.editor.chain().focus().addColumnAfter().run()}function l(){e.editor.chain().focus().deleteColumn().run()}function u(){e.editor.chain().focus().addRowBefore().run()}function c(){e.editor.chain().focus().addRowAfter().run()}function f(){e.editor.chain().focus().deleteRow().run()}function p(){e.editor.chain().focus().mergeCells().run()}function m(){e.editor?.chain().focus().splitCell().run()}function g(){e.editor.chain().focus().deleteTable().run()}function v(w){e.editor.chain().focus().setTableCellBackground(w).run()}const b=()=>{const w=document.querySelector(".vdc-editor");if(!w)return new DOMRect(-1e3,-1e3,0,0);const x=w.getBoundingClientRect();return new DOMRect(x.left,x.top+10,x.width,0)};return(w,x)=>(o.openBlock(),o.createBlock(o.unref(Wu),{editor:w.editor,"plugin-key":"table","update-delay":0,"should-show":r,"tippy-options":{zIndex:9999,maxWidth:"auto",getReferenceClientRect:b,appendTo:n}},{default:o.withCtx(()=>[o.createElementVNode("div",ete,[o.createVNode(Ge,{icon:"TablerColumnInsertLeft","icon-class":"w-5 h-5",tooltip:o.unref(i)("editor.table.menu.insertColumnBefore"),action:s,"tooltip-options":{sideOffset:15},disabled:!w.editor?.can().addColumnBefore()},null,8,["tooltip","disabled"]),o.createVNode(Ge,{icon:"TablerColumnInsertRight",tooltip:o.unref(i)("editor.table.menu.insertColumnAfter"),"icon-class":"w-5 h-5",action:a,"tooltip-options":{sideOffset:15},disabled:!w.editor?.can().addColumnAfter()},null,8,["tooltip","disabled"]),o.createVNode(Ge,{icon:"TablerColumnRemove",action:l,"icon-class":"w-5 h-5",tooltip:o.unref(i)("editor.table.menu.deleteColumn"),"tooltip-options":{sideOffset:15},disabled:!w.editor?.can().deleteColumn()},null,8,["tooltip","disabled"]),o.createVNode(o.unref(wo),{orientation:"vertical",class:"mx-1 me-2 h-[16px]"}),o.createVNode(Ge,{icon:"TablerRowInsertTop",action:u,"icon-class":"w-5 h-5",tooltip:o.unref(i)("editor.table.menu.insertRowAbove"),"tooltip-options":{sideOffset:15},disabled:!w.editor?.can().addRowBefore()},null,8,["tooltip","disabled"]),o.createVNode(Ge,{icon:"TablerRowInsertBottom",action:c,"icon-class":"w-5 h-5",tooltip:o.unref(i)("editor.table.menu.insertRowBelow"),"tooltip-options":{sideOffset:15},disabled:!w.editor?.can().addRowAfter()},null,8,["tooltip","disabled"]),o.createVNode(Ge,{icon:"TablerRowRemove",action:f,"icon-class":"w-5 h-5",tooltip:o.unref(i)("editor.table.menu.deleteRow"),"tooltip-options":{sideOffset:15},disabled:!w.editor?.can().deleteRow()},null,8,["tooltip","disabled"]),o.createVNode(o.unref(wo),{orientation:"vertical",class:"mx-1 me-2 h-[16px]"}),o.createVNode(Ge,{icon:"TableCellsMerge",action:p,"icon-class":"w-5 h-5",tooltip:o.unref(i)("editor.table.menu.mergeCells"),"tooltip-options":{sideOffset:15},disabled:!w.editor?.can().mergeCells()},null,8,["tooltip","disabled"]),o.createVNode(Ge,{icon:"TableCellsSplit",action:m,"icon-class":"w-5 h-5",tooltip:o.unref(i)("editor.table.menu.splitCells"),"tooltip-options":{sideOffset:15},disabled:!w.editor?.can().splitCell()},null,8,["tooltip","disabled"]),o.createVNode(o.unref(wo),{orientation:"vertical",class:"mx-1 me-2 h-[16px]"}),o.createVNode(p5,{editor:w.editor,tooltip:o.unref(i)("editor.table.menu.setCellsBgColor"),action:v,"tooltip-options":{sideOffset:15}},null,8,["editor","tooltip"]),o.createVNode(Ge,{icon:"Trash2",tooltip:o.unref(i)("editor.table.menu.deleteTable"),"icon-class":"w-5 h-5",action:g,"tooltip-options":{sideOffset:15},disabled:!w.editor?.can().deleteTable()},null,8,["tooltip","disabled"])])]),_:1},8,["editor","tippy-options"]))}}),tte={class:"p-2 bg-white border rounded-lg shadow-sm dark:bg-black border-neutral-200 dark:border-neutral-800"},nte={class:"flex items-center gap-1"},Rh=o.defineComponent({__name:"ColumnsBubbleMenu",props:{editor:{},disabled:{type:Boolean,default:!1}},setup(t){const e=t,n=({editor:l})=>$0(l.view.state,"columns"),r=()=>lS(e.editor,"columns")?.getBoundingClientRect()||new DOMRect(-1e3,-1e3,0,0),i=()=>{e.editor.chain().focus().setLayout(Ba.SidebarLeft).run()},s=()=>{e.editor.chain().focus().setLayout(Ba.SidebarRight).run()},a=()=>{e.editor.chain().focus().setLayout(Ba.TwoColumn).run()};return(l,u)=>(o.openBlock(),o.createBlock(o.unref(Wu),{editor:l.editor,"plugin-key":"columns","should-show":n,"update-delay":0,"tippy-options":{offset:[0,8],popperOptions:{modifiers:[{name:"flip",enabled:!1}]},getReferenceClientRect:r,plugins:[o.unref(eL)],sticky:"popper"}},{default:o.withCtx(()=>[o.createElementVNode("div",tte,[o.createElementVNode("div",nte,[o.createVNode(Ge,{id:"panel-left",title:"ok",icon:"PanelLeft",tooltip:"tooltip",action:i,"is-active":()=>l.editor.isActive("columns",{layout:o.unref(Ba).SidebarLeft}),"tooltip-options":{sideOffset:15}},null,8,["is-active"]),o.createVNode(Ge,{id:"columns",title:"ok",icon:"Columns",tooltip:"tooltip",action:a,"is-active":()=>l.editor.isActive("columns",{layout:o.unref(Ba).TwoColumn}),"tooltip-options":{sideOffset:15}},null,8,["is-active"]),o.createVNode(Ge,{id:"panel-right",title:"ok",icon:"PanelRight",tooltip:"tooltip",action:s,"is-active":()=>l.editor.isActive("columns",{layout:o.unref(Ba).SidebarRight}),"tooltip-options":{sideOffset:15}},null,8,["is-active"])])])]),_:1},8,["editor","tippy-options"]))}}),rte={class:"flex items-center gap-2 p-2 bg-white border rounded-lg shadow-sm dark:bg-black border-neutral-200 dark:border-neutral-800"},ote=["href"],ite={class:"flex flex-nowrap"},ste=o.defineComponent({__name:"LinkViewBlock",props:{editor:{},link:{default:void 0}},emits:["clear","edit"],setup(t,{emit:e}){const{t:n}=Pt(),r=e;function i(){r("clear")}function s(){r("edit")}return(a,l)=>(o.openBlock(),o.createElementBlock("div",rte,[o.createElementVNode("a",{href:a.link,target:"_blank",rel:"noopener noreferrer",class:"text-sm underline break-all"},o.toDisplayString(o.unref(St.truncate)(a.link,{length:50,omission:"…"})),9,ote),a.link?(o.openBlock(),o.createBlock(o.unref(wo),{key:0,orientation:"vertical",class:"h-4"})):o.createCommentVNode("",!0),o.createElementVNode("div",ite,[o.createVNode(Ge,{icon:"Pencil",tooltip:o.unref(n)("editor.link.edit.tooltip"),action:s,"tooltip-options":{sideOffset:15}},null,8,["tooltip"]),o.createVNode(Ge,{icon:"Unlink",tooltip:o.unref(n)("editor.link.unlink.tooltip"),action:i,"tooltip-options":{sideOffset:15}},null,8,["tooltip"])])]))}}),Dh=o.defineComponent({__name:"LinkBubbleMenu",props:{editor:{},disabled:{type:Boolean,default:!1}},setup(t){const e=t,n=o.ref(!1),r=o.computed(()=>{const{href:l}=e.editor.getAttributes("link");return l}),i=o.computed(()=>e.editor.isActive("link"));function s(l,u,c){e.editor.chain().extendMarkRange("link").insertContent({type:"text",text:u,marks:[{type:"link",attrs:{href:l,target:c?"_blank":""}}]}).setLink({href:l}).focus().run(),n.value=!1}function a(){e.editor.chain().extendMarkRange("link").unsetLink().focus().run(),n.value=!1}return(l,u)=>o.withDirectives((o.openBlock(),o.createBlock(o.unref(Wu),{editor:l.editor,"update-delay":0,"tippy-options":{popperOptions:{modifiers:[{name:"flip",enabled:!0}]},appendTo:"parent",placement:"bottom-start",offset:[-2,16],zIndex:9999,onHidden:()=>{n.value=!1}}},{default:o.withCtx(()=>[o.createVNode(o.unref(ms),{open:n.value,"onUpdate:open":u[1]||(u[1]=c=>n.value=c)},{default:o.withCtx(()=>[o.createVNode(o.unref(tV),null,{default:o.withCtx(()=>[n.value?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(ste,{key:0,editor:l.editor,link:r.value,onClear:a,onEdit:u[0]||(u[0]=c=>n.value=!0)},null,8,["editor","link"]))]),_:1}),o.createVNode(o.unref(gs),{class:"p-0 border-0 w-fit shadow-none",align:"start",side:"bottom"},{default:o.withCtx(()=>[o.createVNode(D5,{class:"p-4",editor:l.editor,onOnSetLink:s},null,8,["editor"])]),_:1})]),_:1},8,["open"])]),_:1},8,["editor","tippy-options"])),[[o.vShow,i.value]])}}),cS=(t,e,n,r,i)=>{const s=o.ref(0),a=ct.useEventBus(ur.RENDER_SUPER_TEXT),l=T=>{if(!e.value||!t)return;const _=e.value.index,A=e.value.id,{state:V}=t,{tr:O}=V;let B=!1;V.doc.descendants((H,j)=>{if(H.attrs?.[Ne.ID]===A){H.attrs[Ne.TEXT]?.trim();const Y=T.trim();if(zc(Y))return O.delete(j,j+1),B=!0,!1;const{[Ne.ELEMENT_ID]:N,...U}=H.attrs;return O.setNodeMarkup(j,void 0,{...U,[Ne.TEXT]:Y}),B=!0,!1}return!0}),B&&t&&t.view.dispatch(O),_!==-1&&(n.value[_].text=T,n.value[_].textOriginal=T,n.value[_].hoverElementId=null)},u=o.ref(new Map),c=()=>{if(!t?.view.dom)return[];const T=[],_=t?.view.dom.querySelectorAll("[node-id]"),A=new Map;return u.value.clear(),_.forEach(V=>{const O=V.getBoundingClientRect().top;A.has(O)||A.set(O,V),u.value.set(V.getAttribute("node-id")||"unknown",0)}),T.push(...A.values()),T},f=T=>{const _=T.closest(`#${r}`);if(!_)return;const A=_.getBoundingClientRect().top,V=_?.scrollTop;return T.getBoundingClientRect().top-(A-V)},p=(T,_)=>{const A=n.value.findIndex(V=>V.id===T);A>-1&&(n.value[A].status=_)},m=T=>T.replace(/<p><\/p>/g,"<p> </p>"),g=()=>{if(!n.value||n.value.length===0){s.value=0,u.value.clear();return}if(!i.value||i.value.length===0)return;const T=i.value,_=new Set(n.value.map(O=>O.id)),A=T.map(O=>({isHidden:O.classList.contains("hidden"),isTruncated:O.classList.contains("super-text-truncate")}));T.forEach(O=>{O.classList.remove("hidden"),O.classList.remove("super-text-truncate")});for(const O of u.value.keys())_.has(O)||u.value.delete(O);T.forEach(O=>{const B=O.getAttribute("book-mark-id");if(!B)return;const H=O.offsetTop+O.offsetHeight,j=u.value.get(B)||0;u.value.set(B,Math.max(H,j))}),T.forEach((O,B)=>{A[B].isHidden&&O.classList.add("hidden"),A[B].isTruncated&&O.classList.add("super-text-truncate")});let V=0;for(const O of u.value.values())O>V&&(V=O);s.value=V},v=async()=>{await o.nextTick();const _=c().map(A=>{const V=A.getAttribute("node-id"),O=A.getAttribute("book-mark-content"),B=A.getAttribute("page-id"),H=A.getAttribute("page-number"),j=A.getBoundingClientRect(),Y=A.getAttribute("line-id"),N=A.getAttribute("element-id");return{position:j,text:m(O),id:V,pageId:B,pageNumber:H,visiblePosition:f(A),status:0,lineId:Y,elementId:N,hoverElementId:null,textOriginal:m(O)}});n.value=_},b=(T,_)=>{const A=T.bottom<=_.top,V=T.top>=_.bottom;return!(A||V)};async function w(){const T=i.value;if(!T||T.length===0){g();return}T.sort((_,A)=>{const V=Number(_.getAttribute("index")),O=Number(A.getAttribute("index"));return V-O}),T.forEach(_=>_.classList.remove("super-text-truncate")),T.forEach((_,A)=>{const V=_.getBoundingClientRect();T.slice(A+1).forEach(O=>{const B=O.getBoundingClientRect();b(V,B)&&_.classList.add("super-text-truncate")})}),g()}const x=async T=>{await o.nextTick();const _=t?.view.dom.querySelector(`[node-id='${T.dataId}']`),A=i.value.find(B=>{const H=B.getBoundingClientRect().top,j=_?.getBoundingClientRect().top;if(j==null)return!1;const Y=j-H;return Math.abs(Y-9)<=2});if(!A)return;const V=Number(A.getAttribute("index"));if(!T.text){A.querySelector(".super-text-lines").innerHTML=n.value[V].textOriginal,n.value[V].hoverElementId=null,i.value.forEach(B=>B.classList.remove("hidden")),w();return}n.value[V].hoverElementId=T.elementId??null,A.querySelector(".super-text-lines").innerHTML=m(T.text),A.classList.remove("super-text-truncate");const O=A.getBoundingClientRect();i.value.forEach((B,H)=>{if(H!==V){const j=B.getBoundingClientRect();b(O,j)&&B.classList.add("hidden")}}),g()},C=T=>{switch(T.action){case"hover":x(T.payload);break;case"status":p(T.payload.id,T.payload.status);break;case"render":v();break;default:console.log("There is no action")}},E=(T,_)=>{const A=T.currentTarget;A.classList.remove("super-text-truncate");const V=A.getBoundingClientRect();i.value.forEach((O,B)=>{if(B!==_){const H=O.getBoundingClientRect();b(V,H)&&O.classList.add("hidden")}}),g()},k=()=>{i.value.forEach(T=>T.classList.remove("hidden")),w()};return o.onBeforeMount(()=>{a.on(C),window.addEventListener("resize",v)}),o.onBeforeUnmount(()=>{a.off(C),window.removeEventListener("resize",v)}),o.watch(()=>n,async()=>{await o.nextTick(),w()},{deep:!0}),{onUpdate:l,hanldeTruncateSuperTexts:w,eventListener:C,handleMouseOver:E,handleMouseLeave:k,wrapperMinHeight:s}},ate=["index","book-mark-id","line-id","onMouseover"],lte=["innerHTML"],ute=Xr(o.defineComponent({__name:"SuperTextView",props:{editor:{},superPreviewCustomClass:{},minChars:{},fontSize:{},fixedWidth:{type:Boolean}},setup(t,{expose:e}){const n=t,r=o.ref([]),i=o.ref([]),s=o.ref(!1),a=o.ref(!1),l=o.ref(null),u=o.inject("isMobile",!1),c=o.inject("fontWeight",o.ref("")),f=o.computed(()=>o.unref(c)||"normal"),p=o.inject("canEditSuper",o.ref(!0)),{onUpdate:m,handleMouseOver:g,handleMouseLeave:v,wrapperMinHeight:b}=cS(n.editor,l,i,"editor-container",r),w=(_,A)=>{p.value&&(l.value={id:_.id,text:_.text,elementId:_.elementId,index:A},s.value=!0,u&&(a.value=!0))},x=_=>fd(_?n.superPreviewCustomClass?.completedSuper??"bg-black":n.superPreviewCustomClass?.unproducedSuper??"bg-red-500"),C=o.computed(()=>n.fontSize??""),E=o.computed(()=>n.fixedWidth??!1),{contentInner:k,measuredMinWidth:T}=pf({minChars:n.minChars,fontSize:C,fixed:E});return e({measuredMinWidthComment:T}),(_,A)=>{const V=Ot;return o.openBlock(),o.createElementBlock("div",{id:"super-text-view-wrapper",ref_key:"contentInner",ref:k,style:o.normalizeStyle({width:`${Number(o.unref(T))+25}px`,minHeight:`${o.unref(b)}px`}),class:o.normalizeClass(o.unref(ke)("relative border border-ed-gray-400 dark:bg-black rounded-[3px] mr-2.5",_.fixedWidth&&"overflow-hidden",_.superPreviewCustomClass?.overall??"bg-ed-gray-50"))},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.value,(O,B)=>(o.openBlock(),o.createElementBlock("div",{key:O.id,ref_for:!0,ref_key:"superTextRefs",ref:r,index:B,"book-mark-id":O.id,"line-id":O.lineId,class:o.normalizeClass(o.unref(ke)("super-text-view","absolute w-full px-2 translate-y-[-10px] group",{})),style:o.normalizeStyle({top:`${O.visiblePosition||O.position?.top}px`}),onMouseover:H=>o.unref(g)(H,B),onMouseleave:A[0]||(A[0]=(...H)=>o.unref(v)&&o.unref(v)(...H))},[o.createVNode(o.unref(cb),{role:"text",variant:"outline",class:o.normalizeClass(o.unref(ke)("w-full px-1 pt-0 m-0 !leading-tight rounded-sm text-white border-transparent cursor-pointer",_.fixedWidth?"whitespace-nowrap overflow-hidden":"wrap-anywhere whitespace-break-spaces",O.hoverElementId??O.elementId?_.superPreviewCustomClass?.completedSuper??"bg-black":_.superPreviewCustomClass?.unproducedSuper??"bg-red-500",{"cursor-default":!o.unref(p)})),onDblclick:H=>w(O,B)},{default:o.withCtx(()=>[o.createElementVNode("div",{class:"super-text-lines",style:o.normalizeStyle({fontWeight:f.value}),innerHTML:O.text},null,12,lte),o.createVNode(V,{name:"triangle",class:o.normalizeClass(["absolute top-[0.4em] rotate-90 w-3 h-3 right-0",x(O.hoverElementId??O.elementId)])},null,8,["class"])]),_:2},1032,["class","onDblclick"])],46,ate))),128)),!o.unref(u)&&l.value?(o.openBlock(),o.createBlock(Wc,{key:0,open:s.value,editor:n.editor,"super-text-init":l.value.text,"super-text-element-id":l.value.elementId,onClose:A[1]||(A[1]=O=>s.value=!1),onSave:o.unref(m)},null,8,["open","editor","super-text-init","super-text-element-id","onSave"])):o.createCommentVNode("",!0)],6)}}}),[["__scopeId","data-v-f296506b"]]),cte=["index","book-mark-id","line-id","onMouseover"],dte=["innerHTML"],fte=Xr(o.defineComponent({__name:"SuperTextViewComment",props:{editor:{},disableSuperInput:{type:Boolean},superPreviewCustomClass:{},fixedWidth:{type:Boolean}},setup(t){const e=t,n=o.ref([]),r=o.ref([]),i=o.ref(!1),s=o.ref(!1),a=o.ref(null),l=o.inject("isMobile",!1),u=o.inject("fontWeight",o.ref("")),c=o.computed(()=>o.unref(u)||"normal"),f=o.inject("isEditable",o.ref(!0)),{onUpdate:p,handleMouseOver:m,handleMouseLeave:g,wrapperMinHeight:v}=cS(e.editor,a,r,"editor-container-comment",n),b=(C,E)=>{f.value&&(a.value={id:C.id,text:C.text,elementId:C.elementId,index:E},e.disableSuperInput||(i.value=!0),l&&(s.value=!0))},w=C=>fd(C?e.superPreviewCustomClass?.completedSuper??"bg-black":e.superPreviewCustomClass?.unproducedSuper??"bg-red-500"),x=o.inject("measuredMinWidthComment",0);return(C,E)=>{const k=Ot;return o.openBlock(),o.createElementBlock("div",{id:"super-text-view-wrapper",style:o.normalizeStyle({width:`${Number(o.unref(x))+25}px`,minHeight:`${o.unref(v)}px`}),class:o.normalizeClass(o.unref(ke)("relative border border-ed-gray-400 dark:bg-black rounded-[3px] mr-2.5",C.fixedWidth&&"overflow-hidden",C.superPreviewCustomClass?.overall??"bg-ed-gray-50"))},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.value,(T,_)=>(o.openBlock(),o.createElementBlock("div",{key:T.id,ref_for:!0,ref_key:"superTextRefs",ref:n,index:_,"book-mark-id":T.id,"line-id":T.lineId,class:o.normalizeClass(o.unref(ke)("super-text-view","absolute w-full px-2 translate-y-[-10px] group",{})),style:o.normalizeStyle({top:`${T.visiblePosition||T.position?.top}px`}),onMouseover:A=>o.unref(m)(A,_),onMouseleave:E[0]||(E[0]=(...A)=>o.unref(g)&&o.unref(g)(...A))},[o.createVNode(o.unref(cb),{role:"text",variant:"outline",class:o.normalizeClass(o.unref(ke)("w-full px-1 pt-0 m-0 !leading-tight rounded-sm text-white border-transparent cursor-pointer",C.fixedWidth?"whitespace-nowrap overflow-hidden":"wrap-anywhere whitespace-break-spaces",T.elementId?C.superPreviewCustomClass?.completedSuper??"bg-black":C.superPreviewCustomClass?.unproducedSuper??"bg-red-500",{"cursor-default":!o.unref(f)})),onDblclick:A=>b(T,_)},{default:o.withCtx(()=>[o.createElementVNode("div",{class:"super-text-lines",style:o.normalizeStyle({fontWeight:c.value}),innerHTML:T.text},null,12,dte),o.createVNode(k,{name:"triangle",class:o.normalizeClass(["absolute top-[0.4em] rotate-90 w-3 h-3 right-0",w(T.elementId)])},null,8,["class"])]),_:2},1032,["class","onDblclick"])],46,cte))),128)),!o.unref(l)&&a.value&&!C.disableSuperInput?(o.openBlock(),o.createBlock(Wc,{key:0,open:i.value,editor:e.editor,"super-text-init":a.value.text,"super-text-element-id":a.value.elementId,onClose:E[1]||(E[1]=T=>i.value=!1),onSave:o.unref(p)},null,8,["open","editor","super-text-init","super-text-element-id","onSave"])):o.createCommentVNode("",!0)],6)}}}),[["__scopeId","data-v-3487c7fb"]]),dS=t=>{console.log(t),t=t.replace(/\s*style="[^"]*"/g,""),t=t.replace(/<iframe\b[\s\S]*?<\/iframe\s*>/gi,"");const e=t.match(/<!--StartFragment-->([\s\S]*?)<!--EndFragment-->/),r=(e?e[1]:t).replace(/<br\s*\/?>/gi,`
|
|
345
345
|
`).split(/\r?\n/),i=[];for(const a of r){const l=a.trim();if(l==="")i.push("<p></p>");else if(/^<br\s*\/?>/i.test(l)){const u=l.replace(/^<br\s*\/?>/i,"").trim();i.push(`<p>${u}</p>`)}else if(/^<\/BR>/i.test(l)){const u=l.replace(/^<\/BR>/i,"").trim();i.push(`<p>${u}</p>`)}else/^<p\b/i.test(l)?i.push(l):i.push(`<p>${l}</p>`)}let s=i.join("");return s=s.replace(/<p\b[^>]*>/gi,"<p>"),s},Wb=t=>/^https?:\/\/[^\s]+$/i.test(t.trim()),jb=(t,e)=>{const{tr:n,selection:r,schema:i}=t.state,s=i.marks.link.create({href:e});return r.empty?(t.dispatch(n.insertText(e,r.from).addMark(r.from,r.from+e.length,s)),!0):(t.dispatch(n.addMark(r.from,r.to,s)),!0)},pte=(t,e)=>{const{tr:n,schema:r}=t.state,i=e.split(/(?:\r\n?|\n)/),s=[];if(i.forEach(u=>{let c={type:"paragraph"};u.length>0&&(c.content=[{type:"text",text:u}]);let f=Br.fromJSON(r,c);s.push(f)}),s.length===0)return!1;const a=ge.fromArray(s),l=Se.maxOpen(a);return t.dispatch(n.replaceSelection(l)),!0},hte=bn(),Ph=t=>{const e=o.computed(()=>hte.state.spellCheck);o.watch(()=>e.value,n=>{t.view.dispatch(t.state.tr.setMeta(Un.IS_ACTIVE_SPELLCHECK,n)),t.extensionStorage.spellchecker.spellchecker.hideSuggestionBox(),lE(t)&&t.commands.focus()},{immediate:!0})},mte={id:"editor-container-comment",class:"flex flex-col"},gte={class:"flex flex-1"},vte={id:"editor-panel",class:"flex-1 p-2.5 border border-ed-gray-400 rounded-[3px] focus-within:border-ed-input-focus"},bte=o.defineComponent({__name:"EditorComment",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:{},fontWeightDefault:{},showSuperElementIdColor:{type:Boolean},letterSpacingDefault:{},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,default:!1},canEditSuperReadOnly:{type:Boolean},autoFocus:{type:Boolean},superPreviewCustomClass:{default:void 0},minChar:{},isAccordion:{type:Boolean},contentAutoCopied:{},isEditorView:{type:Boolean},isEditorViewSplitContent:{type:Boolean},editorContentInstance:{},toolbarExtensionOrder:{},watermarkOverlay:{},bottomOffset:{},characterCountLimit:{},blockSeparatorPolicy:{},fixedSuperPreviewWidth:{type:Boolean}},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=ct.useEventBus(ur.RENDER_SUPER_TEXT),a=o.useAttrs(),l=bn(),{isReady:u,editor:c,updateEditorState:f,superTextStore:p,checkSpellStore:m,setEditorContextMenuRef:g,setEditorFocusedInstance:v}=l,b=o.inject("isEditable",o.ref(!0)),w=new Oo({enablePasteRules:!1,enableInputRules:!1,content:un(r.modelValue,r.disabled),editorProps:{attributes:{id:ir.COMMENT,[ir.DISABLE_SUPER_INPUT]:`${r.disableSuperInput}`},handleKeyDown:St.throttle((_,A)=>A.key==="Enter"&&a.enter&&!A.shiftKey?(i("enter"),!0):!1,Lo),transformPastedHTML:_=>dS(_),handlePaste:(_,A)=>{const V=A.clipboardData;if(!V)return!1;const O=r.mode,B=V.getData("text/plain")||"",H=Array.from(V.items).some(j=>j.type.startsWith("image/"));return(O===Te.STRAIGHT||O===Te.REPORT)&&H?(A.preventDefault(),!0):O===Te.PLAIN_TEXT?(A.preventDefault(),_.dispatch(_.state.tr.insertText(B,_.state.selection.from)),!0):!1},clipboardTextParser:(_,A)=>{const V=_.split(/(?:\r\n?|\n)/),O=[];V.forEach(H=>{let j={type:"paragraph"};H.length>0&&(j.content=[{type:"text",text:H}]);let Y=Br.fromJSON(A.doc.type.schema,j);O.push(Y)});const B=ge.fromArray(O);return Se.maxOpen(B)}},onCreate:({editor:_})=>{f(_)},onUpdate:St.throttle(({editor:_})=>{u.value=!0;const A=C(_,r.output);i("update:modelValue",A),i("change",{editor:_,output:A}),f(_),x()},Lo),extensions:r.extensions,editable:b.value,onFocus:_=>{g(E.value),v(_.editor)}});async function x(){await o.nextTick(),s.emit({action:"render"})}function C(_,A){if(!_)return"";if(_.isEmpty)return A==="json"?{}:"";switch(A){case"html":return _.getHTML();case"json":return _.getJSON();case"text":return _.getText();default:return""}}o.watch(()=>r.disableSuperInput,()=>{document.getElementById(ir.COMMENT)?.setAttribute(ir.DISABLE_SUPER_INPUT,`${r.disableSuperInput}`)}),o.watch(()=>m.languages,()=>{w.commands.checkSpelling()}),o.watch(()=>r.modelValue,_=>{if(!w||St.isEqual(C(w,r.output),_))return;const{from:A,to:V}=w.state.selection;w.commands.setTextSelection({from:A,to:V}),w.commands.setContent(un(_,r.disabled),!1),x()},{deep:!0}),o.watch(()=>b.value,_=>{w?.setEditable(_),w?.commands?.setIsEnableSuggestion&&w.commands.setIsEnableSuggestion(_)},{immediate:!0}),o.watch(()=>c.value,()=>{c.value&&c.value.on("selectionUpdate",({editor:_})=>{i("changed:selection",{editor:_})})}),o.onUnmounted(()=>w?.destroy()),Ju(ju.SAVE,()=>{localStorage.setItem("comment",C(w,"html"))});const E=o.ref(null);function k(_){_===Te.REPORT&&g(E.value)}function T(_){_===Te.REPORT&&v(w)}return o.onMounted(()=>{k(r.mode),T(r.mode)}),o.watch(()=>r.mode,_=>{k(_),T(_)}),o.watch(()=>r.editorContentInstance?.storage[ih]?.enabled,()=>{w.commands.toggleTimeHighlight()}),Ph(w),e({editor:w}),(_,A)=>(o.openBlock(),o.createElementBlock("div",mte,[o.createElementVNode("div",gte,[_.isOpenSuperView?(o.openBlock(),o.createBlock(fte,{key:0,"disable-super-input":_.disableSuperInput,editor:o.unref(w),"super-preview-custom-class":_.superPreviewCustomClass,"fixed-width":_.fixedSuperPreviewWidth},null,8,["disable-super-input","editor","super-preview-custom-class","fixed-width"])):o.createCommentVNode("",!0),o.createElementVNode("div",vte,[o.createVNode(Sb,{ref_key:"selectContextMenuRef",ref:E,"disable-super-input":_.disableSuperInput,editor:o.unref(w),mode:_.mode,"super-text-store":o.unref(p)},{default:o.withCtx(()=>[o.createVNode(o.unref(Yn),{editor:o.unref(w),spellcheck:"true",class:"h-full break-all"},null,8,["editor"])]),_:1},8,["disable-super-input","editor","mode","super-text-store"])])])]))}});function yte(t,e,n=!1,r=200){const{height:i}=ct.useElementSize(t),s=o.ref(0),a=o.ref(0),l=o.ref(r),u=o.ref(0),c=async()=>{await o.nextTick();const f=i.value-8;e.value===Te.REPORT?(s.value=f/3,a.value=n?"auto":f-s.value,l.value=r/3*2,u.value=r/3):(s.value=0,a.value=n?"auto":i.value)};return n||o.watch(()=>i.value,c),o.onMounted(()=>{c()}),{commentHeight:s,contentHeight:a,minHeight:l,minHeightComment:u}}var wte={exports:{}};(function(t){(function(){var e=["ㄱ","ㄲ","ㄴ","ㄷ","ㄸ","ㄹ","ㅁ","ㅂ","ㅃ","ㅅ","ㅆ","ㅇ","ㅈ","ㅉ","ㅊ","ㅋ","ㅌ","ㅍ","ㅎ"],n=["ㅏ","ㅐ","ㅑ","ㅒ","ㅓ","ㅔ","ㅕ","ㅖ","ㅗ",["ㅗ","ㅏ"],["ㅗ","ㅐ"],["ㅗ","ㅣ"],"ㅛ","ㅜ",["ㅜ","ㅓ"],["ㅜ","ㅔ"],["ㅜ","ㅣ"],"ㅠ","ㅡ",["ㅡ","ㅣ"],"ㅣ"],r=["","ㄱ","ㄲ",["ㄱ","ㅅ"],"ㄴ",["ㄴ","ㅈ"],["ㄴ","ㅎ"],"ㄷ","ㄹ",["ㄹ","ㄱ"],["ㄹ","ㅁ"],["ㄹ","ㅂ"],["ㄹ","ㅅ"],["ㄹ","ㅌ"],["ㄹ","ㅍ"],["ㄹ","ㅎ"],"ㅁ","ㅂ",["ㅂ","ㅅ"],"ㅅ","ㅆ","ㅇ","ㅈ","ㅊ","ㅋ","ㅌ","ㅍ","ㅎ"],i=44032,s=["ㄱ","ㄲ","ㄳ","ㄴ","ㄵ","ㄶ","ㄷ","ㄸ","ㄹ","ㄺ","ㄻ","ㄼ","ㄽ","ㄾ","ㄿ","ㅀ","ㅁ","ㅂ","ㅃ","ㅄ","ㅅ","ㅆ","ㅇ","ㅈ","ㅉ","ㅊ","ㅋ","ㅌ","ㅍ","ㅎ"],a=["ㄱ","ㄲ","ㄴ","ㄷ","ㄸ","ㄹ","ㅁ","ㅂ","ㅃ","ㅅ","ㅆ","ㅇ","ㅈ","ㅉ","ㅊ","ㅋ","ㅌ","ㅍ","ㅎ"],l=["ㅏ","ㅐ","ㅑ","ㅒ","ㅓ","ㅔ","ㅕ","ㅖ","ㅗ","ㅘ","ㅙ","ㅚ","ㅛ","ㅜ","ㅝ","ㅞ","ㅟ","ㅠ","ㅡ","ㅢ","ㅣ"],u=["","ㄱ","ㄲ","ㄳ","ㄴ","ㄵ","ㄶ","ㄷ","ㄹ","ㄺ","ㄻ","ㄼ","ㄽ","ㄾ","ㄿ","ㅀ","ㅁ","ㅂ","ㅄ","ㅅ","ㅆ","ㅇ","ㅈ","ㅊ","ㅋ","ㅌ","ㅍ","ㅎ"],c=[["ㄱ","ㅅ","ㄳ"],["ㄴ","ㅈ","ㄵ"],["ㄴ","ㅎ","ㄶ"],["ㄹ","ㄱ","ㄺ"],["ㄹ","ㅁ","ㄻ"],["ㄹ","ㅂ","ㄼ"],["ㄹ","ㅅ","ㄽ"],["ㄹ","ㅌ","ㄾ"],["ㄹ","ㅍ","ㄿ"],["ㄹ","ㅎ","ㅀ"],["ㅂ","ㅅ","ㅄ"]],f=[["ㅗ","ㅏ","ㅘ"],["ㅗ","ㅐ","ㅙ"],["ㅗ","ㅣ","ㅚ"],["ㅜ","ㅓ","ㅝ"],["ㅜ","ㅔ","ㅞ"],["ㅜ","ㅣ","ㅟ"],["ㅡ","ㅣ","ㅢ"]],p,m,g,v,b,w;function x(R){for(var K=R.length,X={0:0},ae=0;ae<K;ae++)R[ae]&&(X[R[ae].charCodeAt(0)]=ae);return X}p=x(s),m=x(a),g=x(l),v=x(u);function C(R){for(var K=R.length,X={},ae,de,Ee=0;Ee<K;Ee++)ae=R[Ee][0].charCodeAt(0),de=R[Ee][1].charCodeAt(0),typeof X[ae]>"u"&&(X[ae]={}),X[ae][de]=R[Ee][2].charCodeAt(0);return X}b=C(c),w=C(f);function E(R){return typeof p[R]<"u"}function k(R){return typeof m[R]<"u"}function T(R){return typeof g[R]<"u"}function _(R){return typeof v[R]<"u"}function A(R){return 44032<=R&&R<=55203}function V(R,K){return w[R]&&w[R][K]?w[R][K]:!1}function O(R,K){return b[R]&&b[R][K]?b[R][K]:!1}var B=function(R,K){if(R===null)throw new Error("Arguments cannot be null");typeof R=="object"&&(R=R.join(""));for(var X=[],ae=R.length,de,Ee,ie,me,J,ee=0;ee<ae;ee++){var te=[];me=R.charCodeAt(ee),A(me)?(me-=i,ie=me%28,Ee=(me-ie)/28%21,de=parseInt((me-ie)/28/21),te.push(e[de]),typeof n[Ee]=="object"?te=te.concat(n[Ee]):te.push(n[Ee]),ie>0&&(typeof r[ie]=="object"?te=te.concat(r[ie]):te.push(r[ie]))):E(me)?(k(me)?J=e[m[me]]:J=r[v[me]],typeof J=="string"?te.push(J):te=te.concat(J)):T(me)?(J=n[g[me]],typeof J=="string"?te.push(J):te=te.concat(J)):te.push(R.charAt(ee)),K?X.push(te):X=X.concat(te)}return X},H=function(R){return typeof R!="string"?"":(R=B(R),R.join(""))},j=function(R){typeof R=="string"&&(R=B(R));var K=[],X=R.length,ae,de=0,Ee=-1,ie,me=!1;function J(te){var se,pe,_e,Ae=0,Ue,We="";if(me=!1,!(Ee+1>te))for(var qe=1;;qe++){if(qe===1){if(se=R[Ee+qe].charCodeAt(0),T(se))if(Ee+qe+1<=te&&T(pe=R[Ee+qe+1].charCodeAt(0))){K.push(String.fromCharCode(V(se,pe))),Ee=te;return}else{K.push(R[Ee+qe]),Ee=te;return}else if(!k(se)){K.push(R[Ee+qe]),Ee=te;return}We=R[Ee+qe]}else if(qe===2)if(pe=R[Ee+qe].charCodeAt(0),k(pe)){se=O(se,pe),We=String.fromCharCode(se),K.push(We),Ee=te;return}else We=String.fromCharCode((m[se]*21+g[pe])*28+i);else qe===3?(_e=R[Ee+qe].charCodeAt(0),V(pe,_e)?pe=V(pe,_e):Ae=_e,We=String.fromCharCode((m[se]*21+g[pe])*28+v[Ae]+i)):qe===4?(Ue=R[Ee+qe].charCodeAt(0),O(Ae,Ue)?Ae=O(Ae,Ue):Ae=Ue,We=String.fromCharCode((m[se]*21+g[pe])*28+v[Ae]+i)):qe===5&&(Ue=R[Ee+qe].charCodeAt(0),Ae=O(Ae,Ue),We=String.fromCharCode((m[se]*21+g[pe])*28+v[Ae]+i));if(Ee+qe>=te){K.push(We),Ee=te;return}}}for(var ee=0;ee<X;ee++){if(ae=R[ee].charCodeAt(0),!k(ae)&&!T(ae)&&!_(ae)){J(ee-1),J(ee),de=0;continue}de===0?k(ae)?de=1:T(ae)&&(de=4):de==1?T(ae)?de=2:O(ie,ae)?de=5:J(ee-1):de==2?_(ae)?de=3:T(ae)?V(ie,ae)||(J(ee-1),de=4):(J(ee-1),de=1):de==3?_(ae)?!me&&O(ie,ae)?me=!0:(J(ee-1),de=1):k(ae)?(J(ee-1),de=1):T(ae)&&(J(ee-2),de=2):de==4?T(ae)?V(ie,ae)?(J(ee),de=0):J(ee-1):(J(ee-1),de=1):de==5&&(T(ae)?(J(ee-2),de=2):(J(ee-1),de=1)),ie=ae}return J(ee-1),K.join("")},Y=function(R,K){var X=B(R).join(""),ae=B(K).join("");return X.indexOf(ae)},N=function(R,K){var X=B(R).join(""),ae=B(K).join(""),de=B(R,!0),Ee=new RegExp(ae,"gi"),ie=[],me;if(!K.length)return[];for(;me=Ee.exec(X);)ie.push(me.index);function J(te){for(var se=0,pe=0;se<de.length;++se)if(pe+=de[se].length,te<pe)return se}function ee(te){for(var se=0,pe=0;se<de.length;++se)if(pe+=de[se].length,te+ae.length<=pe)return se}return ie.map(function(te){return[J(te),ee(te)]})};function U(R){this.string=R,this.disassembled=B(R).join("")}U.prototype.search=function(R){return B(R).join("").indexOf(this.disassembled)};var P=function(R){typeof R=="object"&&(R=R.join(""));var K=R.charCodeAt(R.length-1);if(A(K)){K-=i;var X=K%28;if(X>0)return!0}else if(E(K))return!0;return!1},L=function(R,K){return B(R).pop()===K},F={disassemble:B,d:B,disassembleToString:H,ds:H,assemble:j,a:j,search:Y,rangeSearch:N,Searcher:U,endsWithConsonant:P,endsWith:L,isHangul:function(R){return typeof R=="string"&&(R=R.charCodeAt(0)),A(R)},isComplete:function(R){return typeof R=="string"&&(R=R.charCodeAt(0)),A(R)},isConsonant:function(R){return typeof R=="string"&&(R=R.charCodeAt(0)),E(R)},isVowel:function(R){return typeof R=="string"&&(R=R.charCodeAt(0)),T(R)},isCho:function(R){return typeof R=="string"&&(R=R.charCodeAt(0)),k(R)},isJong:function(R){return typeof R=="string"&&(R=R.charCodeAt(0)),_(R)},isHangulAll:function(R){if(typeof R!="string")return!1;for(var K=0;K<R.length;K++)if(!A(R.charCodeAt(K)))return!1;return!0},isCompleteAll:function(R){if(typeof R!="string")return!1;for(var K=0;K<R.length;K++)if(!A(R.charCodeAt(K)))return!1;return!0},isConsonantAll:function(R){if(typeof R!="string")return!1;for(var K=0;K<R.length;K++)if(!E(R.charCodeAt(K)))return!1;return!0},isVowelAll:function(R){if(typeof R!="string")return!1;for(var K=0;K<R.length;K++)if(!T(R.charCodeAt(K)))return!1;return!0},isChoAll:function(R){if(typeof R!="string")return!1;for(var K=0;K<R.length;K++)if(!k(R.charCodeAt(K)))return!1;return!0},isJongAll:function(R){if(typeof R!="string")return!1;for(var K=0;K<R.length;K++)if(!_(R.charCodeAt(K)))return!1;return!0}};t.exports=F})()})(wte);const Yl=new Et("searchHighlight");function Vh(t,e,n){const r=[];if(!e)return r;const i=n.caseSensitive?e.normalize("NFC"):e.normalize("NFC").toLowerCase(),{doc:s}=t.state,a=l=>/[0-9A-Za-z가-힣_]/.test(l);return s.descendants((l,u)=>{if(!l.isText||!l.text)return;let c=l.text.normalize("NFC");n.caseSensitive||(c=c.toLowerCase());let f=0,p=c.indexOf(i,f);for(;p!==-1;){const m=p,g=p+i.length-1;if(n.wholeWord){const v=m>0?c[m-1]:"",b=g+1<c.length?c[g+1]:"";if(v&&a(v)||b&&a(b)){f=p+1,p=c.indexOf(i,f);continue}}r.push({from:u+m,to:u+g+1}),f=p+i.length,p=c.indexOf(i,f)}}),r}function qb(t){return t.state.selection.from}function fS(t){if(t.state.plugins.find(r=>r.spec.key===Yl))return;const n=new ot({key:Yl,state:{init(){return lt.empty},apply(r,i){const s=r.getMeta(Yl);return s!==void 0?s:i.map(r.mapping,r.doc)}},props:{decorations(r){return Yl.getState(r)}}});t.registerPlugin(n)}function pS(t,e,n){fS(t);const r=e.map((a,l)=>jt.inline(a.from,a.to,{class:l===n?"search-match-active":"search-match"})),i=lt.create(t.state.doc,r),s=t.state.tr.setMeta(Yl,i);t.view.dispatch(s)}function Jl(t){fS(t);const e=t.state.tr.setMeta(Yl,lt.empty);t.view.dispatch(e)}function xte(t){const e=o.ref(-1),n=o.ref([]),r=o.computed(()=>n.value.length);function i(p){const m=t.value;if(!m||n.value.length===0)return;const g=n.value.length;e.value=(p%g+g)%g,pS(m,n.value,e.value);const v=n.value[e.value];m.view.domAtPos(v.from).node?.scrollIntoView?.({block:"nearest",behavior:"smooth"}),m.chain().setTextSelection({from:v.from,to:v.to}).scrollIntoView().run()}function s(p){const m=t.value;if(!m)return;if(n.value=Vh(m,p.find,p),n.value.length===0){e.value=-1,Jl(m);return}const g=qb(m),v=n.value.findIndex(b=>b.from>g);i(v===-1?0:v)}function a(p){const m=t.value;if(!m)return;if(n.value=Vh(m,p.find,p),n.value.length===0){e.value=-1,Jl(m);return}const g=qb(m);let v=-1;for(let b=n.value.length-1;b>=0;b--)if(n.value[b].to<g){v=b;break}i(v===-1?n.value.length-1:v)}function l(p){const m=t.value;if(!m||e.value===-1||n.value.length===0)return;const g=n.value[e.value],{state:v}=m,b=v.doc.textBetween(g.from,g.to);if(!(p.caseSensitive?b===p.find:b.toLowerCase()===p.find.toLowerCase())){s(p);return}m.chain().focus().setTextSelection({from:g.from,to:g.to}).insertContent(p.replace).run(),s(p)}function u(p){const m=t.value;if(!m)return;const g=Vh(m,p.find,p);if(g.length===0)return;const v=m.chain().focus();[...g].reverse().forEach(b=>{v.setTextSelection({from:b.from,to:b.to}).insertContent(p.replace)}),v.run(),n.value=[],e.value=-1,Jl(m)}function c(p){const m=t.value;if(!m)return;if(!p.find){n.value=[],e.value=-1,Jl(m);return}if(n.value=Vh(m,p.find,p),n.value.length===0){e.value=-1,Jl(m);return}const g=qb(m),v=n.value.findIndex(w=>w.from>=g),b=v===-1?0:v;e.value=b,i(b),pS(m,n.value,b)}function f(){const p=t.value;p&&(n.value=[],e.value=-1,Jl(p))}return{searchUp:a,searchDown:s,replaceCurrent:l,replaceAll:u,totalMatches:r,currentMatchIndex:o.readonly(e),refreshMatches:c,clearSearch:f}}const hS={black:[0,0,0],navy:[0,0,128],darkblue:[0,0,139],mediumblue:[0,0,205],darkgreen:[0,100,0],darkcyan:[0,139,139],darkred:[139,0,0],maroon:[128,0,0],purple:[128,0,128],olive:[128,128,0],darkmagenta:[139,0,139],darkviolet:[148,0,211],indigo:[75,0,130],midnightblue:[25,25,112],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkolivegreen:[85,107,47],dimgray:[105,105,105],dimgrey:[105,105,105],saddlebrown:[139,69,19],sienna:[160,82,45],brown:[165,42,42],teal:[0,128,128]},mS=.4;function gS(t){if(!t)return null;const e=t.trim().toLowerCase();if(hS[e]){const[i,s,a]=hS[e];return{r:i,g:s,b:a}}const n=e.match(/^#([0-9a-f]{3,8})$/);if(n){const i=n[1];if(i.length===3)return{r:parseInt(i[0]+i[0],16),g:parseInt(i[1]+i[1],16),b:parseInt(i[2]+i[2],16)};if(i.length>=6)return{r:parseInt(i.slice(0,2),16),g:parseInt(i.slice(2,4),16),b:parseInt(i.slice(4,6),16)}}const r=e.match(/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);return r?{r:parseInt(r[1],10),g:parseInt(r[2],10),b:parseInt(r[3],10)}:null}function vS(t,e,n){const[r,i,s]=[t/255,e/255,n/255].map(a=>a<=.04045?a/12.92:Math.pow((a+.055)/1.055,2.4));return .2126*r+.7152*i+.0722*s}function bS(t,e=mS){const n=gS(t);return n?vS(n.r,n.g,n.b)<e:!1}function Cte(t,e,n){const r=t/255,i=e/255,s=n/255,a=Math.max(r,i,s),l=Math.min(r,i,s),u=(a+l)/2;if(a===l)return[0,0,u];const c=a-l,f=u>.5?c/(2-a-l):c/(a+l);let p=0;return a===r?p=((i-s)/c+(i<s?6:0))/6:a===i?p=((s-r)/c+2)/6:p=((r-i)/c+4)/6,[p,f,u]}function kte(t,e,n){if(e===0){const a=Math.round(n*255);return[a,a,a]}const r=(a,l,u)=>(u<0&&(u+=1),u>1&&(u-=1),u<1/6?a+(l-a)*6*u:u<1/2?l:u<2/3?a+(l-a)*(2/3-u)*6:a),i=n<.5?n*(1+e):n+e-n*e,s=2*n-i;return[Math.round(r(s,i,t+1/3)*255),Math.round(r(s,i,t)*255),Math.round(r(s,i,t-1/3)*255)]}function yS(t){const e=gS(t);if(!e||vS(e.r,e.g,e.b)>=mS)return t;const[r,i,s]=Cte(e.r,e.g,e.b),a=s<.5?1-s:s,[l,u,c]=kte(r,i,a);return`rgb(${l}, ${u}, ${c})`}function Ete(t){if(!t)return t;const e=document.createElement("div");return e.innerHTML=t,e.querySelectorAll("[style]").forEach(r=>{const i=r.style.color;i&&bS(i)&&(r.style.color=yS(i))}),e.innerHTML}function Ste(t,e,n,r){let i=null;const s=`dco-${Math.random().toString(36).slice(2,8)}`;let a=null,l=null;const u=o.ref(!1);function c(){return!!(e.value||r.value?.closest(".dark")||document.documentElement.classList.contains("dark"))}function f(){u.value=c()}function p(){const b=new Set;return t?.state?.doc&&t.state.doc.descendants(w=>{w.marks.forEach(x=>{x.type.name==="textStyle"&&x.attrs.color&&b.add(x.attrs.color)})}),b}function m(){if(!u.value||n.value)return"";const b=p(),w=[];return b.forEach(x=>{if(bS(x)){const C=yS(x),E=x.replace(/"/g,'\\"');w.push(`[data-dark-scope="${s}"] span[style*="color: ${E}"] { color: ${C} !important; }`)}}),w.join(`
|
|
346
346
|
`)}function g(){i&&(f(),i.textContent=m())}function v(){a&&clearTimeout(a),a=setTimeout(g,150)}o.onMounted(()=>{i=document.createElement("style"),i.setAttribute("data-dark-color-override",s),document.head.appendChild(i),r.value&&r.value.setAttribute("data-dark-scope",s),l=new MutationObserver(()=>{const b=u.value;f(),b!==u.value&&g()}),l.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),t.on("transaction",v),g()}),o.watch(e,g),o.watch(n,g),o.watch(r,b=>{b&&b.setAttribute("data-dark-scope",s)}),o.onBeforeUnmount(()=>{t.off("transaction",v),l?.disconnect(),l=null,a&&clearTimeout(a),i&&i.parentNode&&(i.parentNode.removeChild(i),i=null),r.value&&r.value.removeAttribute("data-dark-scope")})}const wS=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(eP),o.mergeProps(o.unref(s),{class:o.unref(ke)("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(tP),{class:"flex h-full w-full items-center justify-center"},{default:o.withCtx(()=>[o.renderSlot(a.$slots,"default",{},()=>[o.createVNode(o.unref(g1),{icon:"fa-solid:check"})])]),_:3})]),_:3},16,["class"]))}}),_te={class:"flex items-center justify-between px-5 pt-4 pb-2 cursor-move bg-[#F6FAFE]"},Tte={class:"text-base font-semibold text-gray-800"},Ate={class:"px-5 pt-[20px] pb-4 flex flex-col gap-y-3 bg-white"},Mte={class:"grid grid-cols-[60px,1fr] gap-x-3 items-center"},Ote={class:"text-right text-sm text-gray-600"},Bte={class:"relative"},Ite={key:0,class:"absolute right-3 top-1/2 -translate-y-1/2 text-xs text-gray-400 pointer-events-none"},Lte={class:"grid grid-cols-[60px,1fr] gap-x-3 items-center"},Rte={class:"text-right text-sm text-gray-600"},Dte={class:"grid grid-cols-[60px,1fr] gap-x-3"},Pte={class:"flex gap-x-5"},Vte={class:"flex items-center space-x-2 text-sm"},Fte={for:"caseSensitive",class:"select-none text-gray-700"},$te={class:"grid grid-cols-[60px,1fr] gap-x-3"},Hte={class:"flex gap-x-2"},zte=Xr(o.defineComponent({__name:"BatchReplaceDialog",props:{modelValue:{type:Boolean},totalMatches:{default:0},currentMatchIndex:{default:-1}},emits:["update:modelValue","search-down","search-up","replace","replace-all","refresh"],setup(t,{emit:e}){const n=t,r=e;function i(){return{find:s.value,replace:a.value,caseSensitive:u.value,wholeWord:c.value}}const s=o.ref(""),a=o.ref(""),l=o.ref(null),u=o.ref(!1),c=o.ref(!1),f=o.computed(()=>s.value?n.totalMatches===0?"No matches":`${n.currentMatchIndex+1} / ${n.totalMatches}`:""),p=ct.useLocalStorage("findReplaceDialogPosition",null),m=o.reactive({x:0,y:0}),g=o.ref(!1),v={x:0,y:0},b=O=>{const B=O.target;if(B.closest("input")||B.closest("button")||B.closest("label")||B.closest(".content-area"))return;g.value=!0;const H=document.querySelector(".find-replace-dialog");if(!H)return;const j=H.getBoundingClientRect();v.x=O.clientX-j.left,v.y=O.clientY-j.top,document.addEventListener("mousemove",w),document.addEventListener("mouseup",x)},w=O=>{g.value&&(m.x=O.clientX-v.x,m.y=O.clientY-v.y)},x=()=>{g.value=!1,p.value={x:m.x,y:m.y},document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",x)};o.onUnmounted(()=>{document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",x)}),o.watch(()=>n.modelValue,async O=>{if(!O)return;await o.nextTick();const B=document.querySelector(".find-replace-dialog");if(!B)return;const H=window.innerWidth,j=window.innerHeight;p.value&&p.value.x!==void 0&&p.value.y!==void 0?(m.x=p.value.x,m.y=p.value.y):(m.x=Math.max((H-B.offsetWidth)/2,0),m.y=Math.max((j-B.offsetHeight)/2,0)),s.value&&r("refresh",i()),await o.nextTick(),l.value?.$el?.focus()});const C=()=>{r("update:modelValue",!1)},E=()=>{s.value&&r("search-down",i())},k=()=>{s.value&&r("search-up",i())},T=()=>{r("replace",{find:s.value,replace:a.value,caseSensitive:u.value,wholeWord:c.value})},_=()=>{r("replace-all",{find:s.value,replace:a.value,caseSensitive:u.value,wholeWord:c.value})};function A(O){const B=O.target.value;s.value=B,r("refresh",i())}function V(O){const H=O.target.value+(O.data??"");r("refresh",{find:H,replace:a.value,caseSensitive:u.value,wholeWord:c.value})}return(O,B)=>{const H=ws,j=wS,Y=mn,N=Pc,U=Dc;return o.openBlock(),o.createBlock(U,{open:O.modelValue},{default:o.withCtx(()=>[o.createVNode(N,{"is-overlay-transparent":"",class:"p-0 gap-0 !animate-none !transition-none max-w-max","as-child":""},{default:o.withCtx(()=>[o.createElementVNode("div",{class:"find-replace-dialog fixed z-[70] pointer-events-auto w-[460px] rounded-[10px] overflow-hidden bg-white shadow-xl",style:o.normalizeStyle({top:"0px",left:"0px",transform:`translate(${m.x}px, ${m.y}px)`}),onMousedown:b},[o.createElementVNode("div",_te,[o.createElementVNode("span",Tte,o.toDisplayString(O.$t("찾기 및 바꾸기")),1),o.createElementVNode("button",{class:"bg-transparent text-gray-400 hover:text-gray-600 transition-colors p-1",onClick:C},[o.createVNode(o.unref(cc),{class:"w-5 h-5"})])]),o.createElementVNode("div",Ate,[o.createElementVNode("div",Mte,[o.createElementVNode("label",Ote,o.toDisplayString(O.$t("검색")),1),o.createElementVNode("div",Bte,[o.createVNode(H,{ref_key:"findInputRef",ref:l,modelValue:s.value,"onUpdate:modelValue":B[0]||(B[0]=P=>s.value=P),class:"rounded-md h-[36px] text-sm pr-[90px] !border-gray-300 focus:!border-blue-500 focus:!ring-0 outline-none",onInput:A,onCompositionupdate:V,onKeydown:o.withKeys(o.withModifiers(E,["prevent"]),["enter"])},null,8,["modelValue","onKeydown"]),o.unref(f)?(o.openBlock(),o.createElementBlock("span",Ite,o.toDisplayString(o.unref(f)),1)):o.createCommentVNode("",!0)])]),o.createElementVNode("div",Lte,[o.createElementVNode("label",Rte,o.toDisplayString(O.$t("바꾸기")),1),o.createVNode(H,{modelValue:a.value,"onUpdate:modelValue":B[1]||(B[1]=P=>a.value=P),class:"rounded-md h-[36px] text-sm !border-gray-300 focus:!border-blue-500 focus:!ring-0 outline-none"},null,8,["modelValue"])]),o.createElementVNode("div",Dte,[B[3]||(B[3]=o.createElementVNode("div",null,null,-1)),o.createElementVNode("div",Pte,[o.createElementVNode("div",Vte,[o.createVNode(j,{id:"caseSensitive",checked:u.value,"onUpdate:checked":B[2]||(B[2]=P=>{u.value=!!P})},null,8,["checked"]),o.createElementVNode("label",Fte,o.toDisplayString(O.$t("대소문자 일치")),1)])])]),o.createElementVNode("div",$te,[B[4]||(B[4]=o.createElementVNode("div",null,null,-1)),o.createElementVNode("div",Hte,[o.createVNode(Y,{variant:"outline",class:"h-[36px] text-sm flex-1 rounded-md border-blue-500 text-blue-600 hover:bg-blue-50",onClick:T},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(O.$t("바꾸기")),1)]),_:1}),o.createVNode(Y,{variant:"outline",class:"h-[36px] text-sm flex-1 rounded-md border-blue-500 text-blue-600 hover:bg-blue-50",onClick:_},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(O.$t("모두 바꾸기")),1)]),_:1}),o.createVNode(Y,{class:"h-[36px] text-sm flex-1 rounded-md bg-blue-500 hover:bg-blue-600",disabled:!s.value,onClick:k},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(O.$t("이전")),1)]),_:1},8,["disabled"]),o.createVNode(Y,{class:"h-[36px] text-sm flex-1 rounded-md bg-blue-500 hover:bg-blue-600",disabled:!s.value,onClick:E},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(O.$t("다음")),1)]),_:1},8,["disabled"])])])])],36)]),_:1})]),_:1},8,["open"])}}}),[["__scopeId","data-v-5ec84714"]]),Ute={class:"flex flex-1"},Fh=o.defineComponent({__name:"CoreEditorV2",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:"14px"},fontFamilyDefault:{default:"NanumGothicCoding"},fontWeightDefault:{default:void 0},showSuperElementIdColor:{type:Boolean},letterSpacingDefault:{},contentTextStyle:{},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:{},titleBarComment:{},titleBarContent:{},fieldNameComment:{default:null},fieldNameCommentCuesheet:{default:null},fieldNameContent:{default:null},fieldNameSuper:{},isScreenSplit:{},isShowLineNumber:{type:Boolean},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,default:!1},textAlert:{},customClassToolbar:{default:""},readonly:{type:Boolean,default:!1},canEditSuperReadOnly:{type:Boolean,default:!1},autoFocus:{type:Boolean},superPreviewCustomClass:{default:()=>({overall:"bg-ed-gray-50",unproducedSuper:"bg-red-500",completedSuper:"bg-black"})},minChar:{default:()=>({superPreview:29,content:26})},isAccordion:{type:Boolean},contentAutoCopied:{},isEditorView:{type:Boolean},isEditorViewSplitContent:{type:Boolean},editorContentInstance:{},toolbarExtensionOrder:{default:void 0},watermarkOverlay:{},bottomOffset:{},characterCountLimit:{},blockSeparatorPolicy:{default:"paragraph"},fixedSuperPreviewWidth:{type:Boolean,default:!1}},emits:["enter","change","update:modelValue","update:comment","onFocusEditor","changed:selection","setEditorSelected","onBlurEditor","lineFocus","onFocus","onBlur","open-batch-replace"],setup(t,{expose:e,emit:n}){const r=t,i=n;Gc();const s=ct.useEventBus(ur.RENDER_SUPER_TEXT),a=ct.useEventBus(ur.INCREASE_DECREASE_FONTSIZE),l=o.useAttrs(),u=bn(),{isFullscreen:c,isReady:f,editor:p,updateEditorState:m,superTextStore:g,checkSpellStore:v,setEditorContextMenuRef:b,setEditorContentInstance:w,setEditorFocusedInstance:x}=u,C=o.computed(()=>!(r.disabled||r.readonly));o.provide("isEditable",C);const E=o.computed(()=>C.value?!0:r.canEditSuperReadOnly);o.provide("canEditSuper",E),o.provide("showSuperElementIdColor",o.computed(()=>r.showSuperElementIdColor??!1));const k=o.computed(()=>r.mode===Te.EDITOR),T=o.ref(r.fontSizeDefault),_=o.ref(r.fontFamilyDefault),A=o.ref(r.fontWeightDefault);o.provide("fontSize",T),o.provide("fontFamily",_),o.provide("fontWeight",A),o.watch(()=>r.fontFamilyDefault,ue=>{_.value=ue}),o.watch(()=>r.fontWeightDefault,ue=>{A.value=ue});const V=ue=>{!C.value||!((ue.ctrlKey||ue.metaKey)&&ue.key.toLowerCase()==="h")||(ue.preventDefault(),ue.stopPropagation(),ue.stopImmediatePropagation(),H.value=!0)};o.onMounted(()=>{We(),window.addEventListener("keydown",V,!0)}),o.onUnmounted(()=>{window.removeEventListener("keydown",V,!0)}),o.onActivated(()=>{window.addEventListener("keydown",V,!0)}),o.onDeactivated(()=>{window.removeEventListener("keydown",V,!0)});const O=ue=>{const je=parseInt(T.value||"16px"),re=ue?je+2:je-2;T.value=re+"px"};o.onBeforeMount(()=>{r.disabled||a.on(O)}),o.onBeforeUnmount(()=>{r.disabled||a.off(O)});const B=o.computed(()=>({...o.unref(c)?{height:"100%"}:{minHeight:r.minHeight?Yt(r.minHeight):void 0,maxHeight:r.maxHeight?Yt(r.maxHeight):void 0,height:r.height?Yt(r.height):void 0},maxWidth:Yt(r.maxWidth),width:r.maxWidth?"100%":void 0,margin:r.maxWidth?"0 auto":void 0})),H=o.ref(!1),{searchUp:j,searchDown:Y,replaceCurrent:N,replaceAll:U,totalMatches:P,currentMatchIndex:L,refreshMatches:F,clearSearch:R}=xte(p);o.watch(H,ue=>{ue||R()});const K=ue=>{F(ue)},X=ue=>{Y(ue)},ae=ue=>{j(ue)},de=ue=>{N(ue)},Ee=ue=>{U(ue)},ie=new Oo({coreExtensionOptions:{clipboardTextSerializer:{blockSeparator:r.blockSeparatorPolicy==="line"?`
|
|
347
347
|
`:`
|
|
348
348
|
|
|
349
|
-
`}},enablePasteRules:!1,enableInputRules:!1,content:un(r.modelValue,r.disabled,r.mode),editorProps:{handleKeyDown:St.throttle((ue,je)=>je.key==="Enter"&&l.enter&&!je.shiftKey?(i("enter"),!0):!1,Lo),transformPastedHTML:ue=>r.mode===Te.EDITOR?dx(ue):dS(ue),handlePaste:(ue,je)=>{const re=je.clipboardData;if(!re)return!1;const Me=r.mode,Ve=Array.from(re.items),it=Ve.some(gn=>gn.type.startsWith("image/")),
|
|
349
|
+
`}},enablePasteRules:!1,enableInputRules:!1,content:un(r.modelValue,r.disabled,r.mode),editorProps:{handleKeyDown:St.throttle((ue,je)=>je.key==="Enter"&&l.enter&&!je.shiftKey?(i("enter"),!0):!1,Lo),transformPastedHTML:ue=>r.mode===Te.EDITOR?dx(ue):dS(ue),handlePaste:(ue,je)=>{const re=je.clipboardData;if(!re)return!1;const Me=r.mode,Ve=Array.from(re.items),it=Ve.some(gn=>gn.type.startsWith("image/")),nt=Ve.some(gn=>gn.type.startsWith("video/"));if((Me===Te.STRAIGHT||Me===Te.REPORT)&&(it||nt))return je.preventDefault(),!0;if(nt)return je.preventDefault(),At(["video"])&&Ve.forEach(async gn=>{if(!gn.type.startsWith("video/"))return;const Si=gn.getAsFile();if(!Si)return;const Ts=ie.extensionManager.extensions.find(Jo=>Jo.name==="video")?.options?.upload,As=Ts?await Ts(Si):URL.createObjectURL(Si);ie.commands.focus(),ie.commands.setVideo({src:As})}),!0;const bt=je.clipboardData?.getData("text/plain")||"";if(r.mode===Te.EDITOR&&Wb(bt))return je.preventDefault(),jb(ue,bt.trim());const Zt=re.getData("text/html");if(Zt&&bt&&/hwpEditorBoardContent|data-hwpjson/i.test(Zt)){je.preventDefault();const gn=dx(Zt).normalize("NFC");return setTimeout(()=>{ie.chain().focus().insertContent(gn,{parseOptions:{preserveWhitespace:!1}}).run()},0),!0}return!1},clipboardTextParser:(ue,je)=>{const re=ue.split(/(?:\r\n?|\n)/),Me=[];re.forEach(it=>{let nt={type:"paragraph"};it.length>0&&(nt.content=[{type:"text",text:it}]);let bt=Br.fromJSON(je.doc.type.schema,nt);Me.push(bt)});const Ve=ge.fromArray(Me);return Se.maxOpen(Ve)}},onCreate:({editor:ue})=>{m(ue)},onUpdate:St.throttle(({editor:ue})=>{f.value=!0;const je=qe(ue,r.output);i("update:modelValue",je),i("change",{editor:ue,output:je}),m(ue),o.nextTick(()=>{We()}),pe()},Lo),extensions:St.uniqBy(cE(r.extensions,r),"name"),editable:C.value,onFocus:ue=>{b($.value),x(ue.editor),i("onFocus",ue)},onBlur:ue=>i("onBlur",ue),parseOptions:{preserveWhitespace:"full"}}),me=o.computed(()=>r.mode===Te.REPORT||r.mode===Te.STRAIGHT||r.mode===Te.PLAIN_TEXT),J=o.computed(()=>r.dark===!0),ee=o.computed(()=>{const ue={height:"auto",minHeight:r.minHeight?Yt(r.minHeight):void 0,maxHeight:r.maxHeight?Yt(r.maxHeight):void 0,overflowY:"auto"},je={fontFamily:Ch(ie,Rc)&&_.value||r.fontFamilyDefault,fontSize:Ch(ie,rh)&&T.value||r.fontSizeDefault,...Ch(ie,yk)&&(A.value||r.fontWeightDefault)?{fontWeight:A.value||r.fontWeightDefault}:{}};return k.value&&!r.autoHeight?{}:k.value&&r.autoHeight?ue:!k.value&&r.autoHeight?{...ue,...je}:je});o.watch(()=>[ee.value,r.disabled],async()=>{We()}),o.provide("minCharSuperInput",r.minChar.superPreview);const{contentInner:te,measuredMinWidth:se,measure:pe}=pf({minChars:r.minChar.content,fontSize:T,editor:ie}),_e=o.ref(null),Ae=o.computed(()=>_e.value?.measuredMinWidthComment);o.provide("measuredMinWidthComment",Ae);const Ue=o.computed(()=>k.value?0:q.value?Number(se?.value)+Number(Ae?.value)+30:Number(se?.value));async function We(){await o.nextTick(),s.emit({action:"render"})}function qe(ue,je){if(!ue)return"";if(ue.isEmpty)return je==="json"?{}:"";if(r.mode===Te.PLAIN_TEXT)return ue.getText({blockSeparator:`
|
|
350
350
|
`});switch(je){case"html":return mg(ue,{removeNodes:[Bc,Ci]});case"json":return ue.getJSON();case"text":return ue.getText({blockSeparator:`
|
|
351
|
-
`});default:return""}}function At(ue){return ue.every(je=>ie?.extensionManager.extensions.find(re=>re.name===je))}o.watch(()=>v.languages,()=>{ie.commands.checkSpelling()}),o.watch(()=>r.modelValue,ue=>{if(!ie||St.isEqual(qe(ie,r.output),ue))return;const{from:je,to:re}=ie.state.selection;ie.commands.setTextSelection({from:je,to:re}),ie.commands.setContent(un(ue,r.disabled,r.mode),!1,{preserveWhitespace:"full"}),We()},{deep:!0}),o.watch(()=>C.value,ue=>{ie?.setEditable(ue),ie?.commands?.setIsEnableSuggestion&&ie.commands.setIsEnableSuggestion(ue)},{immediate:!0}),o.watch(()=>p.value,()=>{p.value&&p.value.on("selectionUpdate",({editor:ue})=>{i("changed:selection",{editor:ue})})}),o.onUnmounted(()=>ie?.destroy()),Ju(ju.SAVE,()=>{localStorage.setItem("content",qe(ie,"html"))});const q=o.computed(()=>{if(!ie?.storage?.superText)return!1;const{enable:ue}=ie.storage.superText,je=[Te.EDITOR,Te.PLAIN_TEXT].includes(r.mode),re=r.disabled;return ue&&!je&&!re}),z=o.ref(null);Ste(ie,J,me,z);const he=o.computed(()=>r.mode),{commentHeight:xe,contentHeight:Pe,minHeight:
|
|
351
|
+
`});default:return""}}function At(ue){return ue.every(je=>ie?.extensionManager.extensions.find(re=>re.name===je))}o.watch(()=>v.languages,()=>{ie.commands.checkSpelling()}),o.watch(()=>r.modelValue,ue=>{if(!ie||St.isEqual(qe(ie,r.output),ue))return;const{from:je,to:re}=ie.state.selection;ie.commands.setTextSelection({from:je,to:re}),ie.commands.setContent(un(ue,r.disabled,r.mode),!1,{preserveWhitespace:"full"}),We()},{deep:!0}),o.watch(()=>C.value,ue=>{ie?.setEditable(ue),ie?.commands?.setIsEnableSuggestion&&ie.commands.setIsEnableSuggestion(ue)},{immediate:!0}),o.watch(()=>p.value,()=>{p.value&&p.value.on("selectionUpdate",({editor:ue})=>{i("changed:selection",{editor:ue})})}),o.onUnmounted(()=>ie?.destroy()),Ju(ju.SAVE,()=>{localStorage.setItem("content",qe(ie,"html"))});const q=o.computed(()=>{if(!ie?.storage?.superText)return!1;const{enable:ue}=ie.storage.superText,je=[Te.EDITOR,Te.PLAIN_TEXT].includes(r.mode),re=r.disabled;return ue&&!je&&!re}),z=o.ref(null);Ste(ie,J,me,z);const he=o.computed(()=>r.mode),{commentHeight:xe,contentHeight:Pe,minHeight:rt,minHeightComment:Ke}=yte(z,he,r.autoHeight,typeof r.minHeight=="string"?parseInt(r.minHeight):r.minHeight),$=o.ref(null);function ne(ue){ue===Te.STRAIGHT&&b($.value)}function oe(ue){ue!==Te.REPORT&&x(ie)}const we=ue=>{const je=document.getSelection();if(!(!je||je.isCollapsed||je.rangeCount===0)&&!(!z.value||!z.value.contains(je.anchorNode)))try{const Me=je.getRangeAt(0).cloneContents(),Ve=document.createElement("div");Ve.appendChild(Me);const it=Ve.innerHTML,nt=r.blockSeparatorPolicy==="line"?`
|
|
352
352
|
`:`
|
|
353
353
|
|
|
354
|
-
`,bt=Ve.querySelectorAll("p"),Zt=bt.length>0?Array.from(bt).map(gn=>gn.textContent||"").join(tt):Ve.textContent||"";ue.clipboardData?.clearData(),ue.clipboardData?.setData("text/html",it),ue.clipboardData?.setData("text/plain",Zt),ue.preventDefault()}catch{}};o.onMounted(()=>{ne(r.mode),oe(r.mode),w(ie),C.value||document.addEventListener("copy",we,!0)}),o.onBeforeUnmount(()=>{document.removeEventListener("copy",we,!0)}),o.watch(()=>r.mode,ue=>{ne(ue),oe(ue)});const $e=o.ref(null),et=()=>{$e.value?.editor.commands.focusInvalidChar()||ie.commands.focusInvalidChar()};u.focusFirstInvalidChar.value=et,o.onActivated(()=>{u.focusFirstInvalidChar.value=et});const Tt=o.computed(()=>{const ue=r.fieldNameComment?.label||r.fieldNameCommentCuesheet?.label||r.fieldNameContent?.label;return r.disabled&&ue});return e({editor:ie}),(ue,je)=>{const re=Dh,Me=Rh,Ve=Lh,it=uS,tt=Yee,bt=Kee;return o.unref(ie)?(o.openBlock(),o.createElementBlock("div",{key:0,id:"vdc-editor",class:o.normalizeClass(["vdc-editor w-full flex flex-col",[ue.editorClass,{"outline-ed-primary":o.unref(ie).isFocused,"outline-ed-border":!o.unref(ie).isFocused}]]),style:o.normalizeStyle(o.unref(B))},[!ue.hideBubble&&!ue.disabled&&o.unref(C)?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[At([o.unref(Ic)])?(o.openBlock(),o.createBlock(re,{key:0,editor:o.unref(ie)},null,8,["editor"])):o.createCommentVNode("",!0),At([o.unref(_a)])?(o.openBlock(),o.createBlock(Me,{key:1,editor:o.unref(ie)},null,8,["editor"])):o.createCommentVNode("",!0),At([o.unref(Ss)])?(o.openBlock(),o.createBlock(Ve,{key:2,editor:o.unref(ie)},null,8,["editor"])):o.createCommentVNode("",!0),At([o.unref(zl),o.unref(Ci)])?(o.openBlock(),o.createBlock(it,{key:3,editor:o.unref(ie)},null,8,["editor"])):o.createCommentVNode("",!0)],64)):o.createCommentVNode("",!0),ue.hideToolbar?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(tt,{key:1,editor:o.unref(ie),"editor-comment":o.unref($e)?.editor,mode:ue.mode,class:"mb-2","custom-class-toolbar":ue.customClassToolbar,"toolbar-extension-order":ue.toolbarExtensionOrder},null,8,["editor","editor-comment","mode","custom-class-toolbar","toolbar-extension-order"])),o.createElementVNode("div",{ref_key:"editorWrapRef",ref:z,class:o.normalizeClass(o.unref(ke)("space-y-2 flex-1 flex flex-col break-keep",o.unref(me)&&"[&_*]:!font-inherit",o.unref(me)&&"[&_*]:!text-font-size-inherit")),style:o.normalizeStyle(o.unref(ee))},[o.unref(Tt)?(o.openBlock(),o.createBlock(bt,{key:0,extensions:ue.extensions,mode:ue.mode,"hide-comment":ue.hideComment,"field-name-comment":ue.fieldNameComment,"field-name-comment-cuesheet":ue.fieldNameCommentCuesheet,"field-name-content":ue.fieldNameContent,comment:ue.comment,"comment-cuesheet":ue.commentCuesheet,content:ue.modelValue,"min-chars":ue.minChar.content,"font-size":o.unref(T)},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(Ue)}px`})},[ue.mode===o.unref(Te).REPORT&&!ue.hideComment?(o.openBlock(),o.createBlock(bte,{key:0,ref_key:"editorCommentRef",ref:$e,mode:o.unref(Te).REPORT,extensions:ue.extensions,"model-value":r.comment,disabled:r.disabled,"disable-super-input":ue.disableSuperInput,"is-open-super-view":o.unref(q),"super-preview-custom-class":ue.superPreviewCustomClass,"fixed-super-preview-width":ue.fixedSuperPreviewWidth,"min-char":ue.minChar,"font-size":o.unref(T),style:o.normalizeStyle(r.autoHeight?{height:"auto",minHeight:o.unref(Yt)(o.unref(Ke))}:{height:o.unref(Yt)(o.unref(xe)),minHeight:o.unref(Yt)(o.unref(nt))}),"editor-content-instance":o.unref(ie),class:"relative overflow-y-auto","onUpdate:modelValue":je[0]||(je[0]=Zt=>i("update:comment",Zt))},null,8,["mode","extensions","model-value","disabled","disable-super-input","is-open-super-view","super-preview-custom-class","fixed-super-preview-width","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(Yt)(o.unref(nt))}:{height:o.unref(Yt)(o.unref(Pe))})},[o.createElementVNode("div",Ute,[o.unref(q)?(o.openBlock(),o.createBlock(ute,{key:0,ref_key:"superTextViewRef",ref:_e,editor:o.unref(ie),"super-preview-custom-class":ue.superPreviewCustomClass,"min-chars":ue.minChar.superPreview,"font-size":o.unref(T),"fixed-width":ue.fixedSuperPreviewWidth},null,8,["editor","super-preview-custom-class","min-chars","font-size","fixed-width"])):o.createCommentVNode("",!0),o.createElementVNode("div",{id:"editor-panel",ref_key:"contentInner",ref:te,class:"flex-1 p-2.5 border border-ed-gray-400 rounded-[3px] focus-within:border-ed-input-focus"},[o.createVNode(Sb,{ref_key:"selectContextMenuRef",ref:$,editor:o.unref(ie),mode:ue.mode,"super-text-store":o.unref(g),disabled:r.disabled},{default:o.withCtx(()=>[o.createVNode(o.unref(Yn),{editor:o.unref(ie),spellcheck:"true",class:o.normalizeClass(o.unref(ke)("h-full break-all",ue.mode===o.unref(Te).PLAIN_TEXT&&"plain-text"))},null,8,["editor","class"])]),_:1},8,["editor","mode","super-text-store","disabled"])],512)])],4)],4))],6),o.createVNode(zte,{modelValue:o.unref(H),"onUpdate:modelValue":je[1]||(je[1]=Zt=>o.isRef(H)?H.value=Zt:null),"total-matches":o.unref(P),"current-match-index":o.unref(L),onSearchDown:X,onSearchUp:ae,onReplace:de,onReplaceAll:Ee,onRefresh:K},null,8,["modelValue","total-matches","current-match-index"])],6)):o.createCommentVNode("",!0)}}}),Wte={class:"relative px-2.5"},jte={key:0,class:"w-12 rounded-tl-full rounded-bl-full pointer-events-none absolute inset-y-0 left-0 bg-white-fade-left z-10","aria-hidden":"true"},qte={key:1,class:"w-12 rounded-tr-full rounded-br-full pointer-events-none absolute inset-y-0 right-0 bg-white-fade-right z-10","aria-hidden":"true"},Kte=o.defineComponent({__name:"ToolbarFormat",props:{editor:{},disabled:{type:Boolean,default:!1},mode:{},activeExtensions:{default:()=>[]},threshold:{default:5}},setup(t){const{t:e}=Pt(),n=t,r=[eh,Lc,ki,oh],i=o.computed(()=>{const m=[...n.editor.extensionManager.extensions],g=uE(m,{[wk]:0});let v=[];for(const b of g){const{button:w,divider:x=!1,spacer:C=!1,toolbar:E=!0}=b.options;if(!w||!pg(w)||!E)continue;const k=w({editor:n.editor,extension:b,t:o.unref(e),isMobile:!0});if(Array.isArray(k)){const T=k.map((_,A)=>({id:`${b.name}`,button:_,divider:A===k.length-1?x:!1,spacer:A===0?C:!1,buttonName:_.buttonName}));v=[...v,...T];continue}v.push({button:k,divider:x,spacer:C,id:`${b.name}`})}return n.activeExtensions.length?v.filter(b=>b.id&&n.activeExtensions.includes(b.id)):(r.length&&(v=v.filter(b=>b.id&&!r.includes(b.id))),v=v.map(b=>{const w=["videoUpload","heading","strike","color","fontSize","fontFamily"],x=["redo"],C=v.some(T=>T.id==="imageUpload"),E=v.some(T=>T.id==="videoUpload");E||w.push("imageUpload"),!C&&!E&&w.push("link");const k=w.includes(b.id??"")||x.includes(b.buttonName??"");return{...b,separator:k}}),v)}),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:v,clientWidth:b}=m;if(!(v>b+1)){u.value=!1,c.value=!1;return}const x=g<=n.threshold,C=g+b>=v-n.threshold;u.value=!x,c.value=!C}const p=ct.useThrottleFn(f,10);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(ke)("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",Wte,[o.unref(u)?(o.openBlock(),o.createElementBlock("div",jte)):o.createCommentVNode("",!0),o.unref(c)?(o.openBlock(),o.createElementBlock("div",qte)):o.createCommentVNode("",!0),o.createElementVNode("div",{ref_key:"scrollEl",ref:l,id:"tool-bar-format-scroll",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,(v,b)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:b},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(v.button.component),o.mergeProps({id:v.id,ref_for:!0},v.button.componentProps,{editor:m.editor,disabled:m.disabled||v.button.componentProps?.disabled,"custom-class":s(v),icon:a(v)}),o.createSlots({_:2},[o.renderList(v.button.componentSlots,(w,x,C)=>({name:`${x}`,fn:o.withCtx(E=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(w),o.mergeProps({ref_for:!0},E?.props,{id:v.id}),null,16,["id"]))])}))]),1040,["id","editor","disabled","custom-class","icon"])),v.separator?(o.openBlock(),o.createBlock(o.unref(wo),{key:0,orientation:"vertical",class:"h-5"})):o.createCommentVNode("",!0)],64))),128))],512)])],2))}}),Gte={class:"relative px-2.5"},Xte={key:0,class:"w-12 rounded-tl-full rounded-bl-full pointer-events-none absolute inset-y-0 left-0 bg-white-fade-left z-10","aria-hidden":"true"},Yte={key:1,class:"w-12 rounded-tr-full rounded-br-full pointer-events-none absolute inset-y-0 right-0 bg-white-fade-right z-10","aria-hidden":"true"},Jte={class:"flex items-center gap-2"},Zte={class:"mt-3"},Qte=o.defineComponent({__name:"ToolbarImage",props:{editor:{},disabled:{type:Boolean,default:!1},threshold:{default:10}},setup(t){const e=t,{t:n}=Pt(),r=o.ref("100"),i=o.ref(),s=o.ref(),a=o.ref(),l=["left","center","right"],u={left:"AlignLeft",center:"AlignCenter",right:"AlignRight"};function c(Y){Y?.preventDefault(),e.editor.getAttributes("image").src&&(e.editor.commands.updateImage({width:i.value?`${i.value}px`:null}),ff())}function f(Y){const N=Math.max(0,Math.min(100,parseInt(r.value)));e.editor.commands.updateImage({width:`${N}%`}),ff()}function p(Y){e.editor.commands.updateAttributes("image",{textAlign:Y})}o.watch(r,()=>{r.value&&f()}),o.watch(()=>e.editor.getAttributes("image"),Y=>{Y&&(i.value=Math.round(parseFloat(Y.originWidth)),s.value=Math.round(parseFloat(Y.originHeight)),a.value=Y.originWidth/Y.originHeight)});function m(){s.value&&a.value?i.value=Math.max(30,Math.round(s.value*a.value)):i.value=null}function g(){i.value&&a.value?s.value=Math.max(20,Math.round(i.value/a.value)):s.value=null}function v(Y){p(Y)}function b(){const Y=e.editor.getAttributes("image"),{flipX:N}=Y;e.editor.commands.updateImage({flipX:!N})}function w(){const Y=e.editor.getAttributes("image"),{flipY:N}=Y;e.editor.commands.updateImage({flipY:!N})}function x(){const{state:Y,dispatch:N}=e.editor.view;ol(Y,N)}function C(){const{state:Y,dispatch:N}=e.editor.view,{tr:U,selection:P}=Y;if(!(P instanceof Re))return;const L=P.from,F=Y.doc.nodeAt(L);if(!F)return;const K=Y.doc.resolve(L).nodeBefore;if(!K)return;const X=L-K.nodeSize,ae=U.delete(L,L+F.nodeSize).insert(X,F).setSelection(Re.create(U.doc,X));N(ae)}function E(){const{state:Y,dispatch:N}=e.editor.view,{tr:U,doc:P,selection:L}=Y;if(!(L instanceof Re))return;const F=L.from,R=P.nodeAt(F);if(!R)return;const K=F+R.nodeSize;if(K>=P.content.size)return;const X=P.nodeAt(K);if(!X)return;const ae=K+X.nodeSize-R.nodeSize,de=F+X.nodeSize,Ee=U.delete(F,F+R.nodeSize).insert(ae,R).setSelection(Re.create(U.doc,de));N(Ee)}const k=o.ref(null),T=o.ref(!1),_=o.ref(!1);function A(){const Y=k.value;if(!Y)return;const{scrollLeft:N,scrollWidth:U,clientWidth:P}=Y;if(!(U>P+1)){T.value=!1,_.value=!1;return}const F=N<=e.threshold,R=N+P>=U-e.threshold;T.value=!F,_.value=!R}const V=ct.useThrottleFn(A,10);ct.useEventListener(k,"scroll",V),ct.useResizeObserver(k,V),ct.useEventListener(window,"resize",V);const O=o.inject("isMobile",!1),B=`dropdown-trigger-${$r(10)}`,{isOpen:H}=Nf({scrollEl:"tool-bar-image-scroll",ignoreSelector:`[data-radix-popper-content-wrapper], .${B}`}),j=o.computed(()=>O?{modal:!1,open:H.value,"onUpdate:open":Y=>H.value=Y}:{});return(Y,N)=>{const U=Ge,P=wo,L=Ca,F=Mc,R=ws,K=Kl,X=Bh,ae=Oh,de=gs,Ee=ms;return o.openBlock(),o.createElementBlock("div",{id:"tool-bar-image",class:o.normalizeClass(o.unref(ke)("bg-white border border-gray-100 dark:bg-ed-gray-500 dark:border-ed-muted rounded-full shadow-elevation2"))},[o.createElementVNode("div",Gte,[T.value?(o.openBlock(),o.createElementBlock("div",Xte)):o.createCommentVNode("",!0),_.value?(o.openBlock(),o.createElementBlock("div",Yte)):o.createCommentVNode("",!0),o.createElementVNode("div",{ref_key:"scrollEl",ref:k,id:"tool-bar-image-scroll",class:"text-ed-gray-700 flex gap-1.5 items-center overflow-x-auto overflow-y-hidden min-h-11 scrollbar-hide overflow-scrolling-touch relative whitespace-nowrap"},[o.createVNode(U,{tooltip:o.unref(n)("editor.image.menu.flipX"),icon:"FlipVertical",action:b},null,8,["tooltip"]),o.createVNode(U,{tooltip:o.unref(n)("editor.image.menu.flipY"),icon:"FlipHorizontal",action:w},null,8,["tooltip"]),o.createVNode(P,{orientation:"vertical",class:"h-5"}),o.createVNode(U,{tooltip:o.unref(n)("editor.image.menu.moveUp"),icon:"MoveUp",action:C,disabled:!Y.editor.isEditable},null,8,["tooltip","disabled"]),o.createVNode(U,{tooltip:o.unref(n)("editor.image.menu.moveDown"),icon:"MoveDown",action:E,disabled:!Y.editor.isEditable},null,8,["tooltip","disabled"]),o.createVNode(P,{orientation:"vertical",class:"h-5"}),o.createVNode(Ee,o.normalizeProps(o.guardReactiveProps(o.unref(j))),{default:o.withCtx(()=>[o.createVNode(L,{class:o.normalizeClass(B)},{default:o.withCtx(()=>[o.createVNode(U,{title:o.unref(n)("editor.image.menu.size"),icon:"ImageSize"},null,8,["title"])]),_:1}),o.createVNode(de,{class:"w-84 inside-toolbar"},{default:o.withCtx(()=>[o.createElementVNode("div",Jte,[o.createVNode(F,{for:"maxWidth",class:"whitespace-nowrap"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("editor.image.menu.size.width")),1)]),_:1}),o.createVNode(R,{id:"maxWidth",modelValue:i.value,"onUpdate:modelValue":N[0]||(N[0]=ie=>i.value=ie),type:"number",class:"w-20 h-8 [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",onInput:g,onKeyup:o.withKeys(c,["enter"])},null,8,["modelValue"]),o.createVNode(F,{for:"maxWidth",class:"whitespace-nowrap"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("editor.image.menu.size.height")),1)]),_:1}),o.createVNode(R,{id:"maxWidth",modelValue:s.value,"onUpdate:modelValue":N[1]||(N[1]=ie=>s.value=ie),type:"number",class:"w-20 h-8 [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",onInput:m,onKeyup:o.withKeys(c,["enter"])},null,8,["modelValue"])]),o.createElementVNode("div",Zte,[o.createVNode(ae,{"model-value":r.value,"onUpdate:modelValue":[N[2]||(N[2]=ie=>r.value=ie),N[3]||(N[3]=ie=>{r.value=ie})]},{default:o.withCtx(()=>[o.createVNode(X,null,{default:o.withCtx(()=>[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(["25","50","75","100"],ie=>o.createVNode(K,{key:ie,value:ie},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(ie)+"% ",1)]),_:2},1032,["value"])),64))]),_:1})]),_:1},8,["model-value"])])]),_:1})]),_:1},16),o.createVNode(P,{orientation:"vertical",class:"h-5"}),(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(l,(ie,me)=>o.createVNode(U,{key:me,tooltip:o.unref(n)(`editor.textalign.${ie}.tooltip`),icon:u[ie],action:()=>v(ie),disabled:!Y.editor.can().setTextAlign(ie),"is-active":()=>Y.editor.isActive({textAlign:ie})||!1},null,8,["tooltip","icon","action","disabled","is-active"])),64)),o.createVNode(P,{orientation:"vertical",class:"h-5"}),o.createVNode(U,{tooltip:o.unref(n)("editor.remove"),icon:"Trash2",action:x,disabled:!Y.editor.isEditable},null,8,["tooltip","disabled"])],512)])],2)}}}),Nte=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(NV),o.mergeProps(o.unref(s),{class:o.unref(ke)("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(eF),{class:o.normalizeClass(o.unref(ke)("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"]))}}),ene={class:"text-red-500 relative -top-1"},Xc=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(ke)("label-large",e.fieldName.customClass))},[o.createElementVNode("span",null,o.toDisplayString(e.fieldName.label),1),o.withDirectives(o.createElementVNode("span",ene," •",512),[[o.vShow,e.fieldName.isRequired]])],2))}}),$h={__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((J,ee)=>(J[~~ee.id]=ee)&&J,{})),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",x),"ontouchstart"in window&&(document.addEventListener("touchmove",w,{passive:!1}),document.addEventListener("touchend",x))},v=()=>{document.removeEventListener("mousemove",w,{passive:!1}),document.removeEventListener("mouseup",x),"ontouchstart"in window&&(document.removeEventListener("touchmove",w,{passive:!1}),document.removeEventListener("touchend",x))},b=(J,ee)=>{const te=J.target.closest(".splitpanes__splitter");if(te){const{left:se,top:pe}=te.getBoundingClientRect(),{clientX:_e,clientY:Ae}="ontouchstart"in window&&J.touches?J.touches[0]:J;f.value.cursorOffset=r.horizontal?Ae-pe:_e-se}g(),f.value.mouseDown=!0,f.value.activeSplitter=ee},w=J=>{f.value.mouseDown&&(J.preventDefault(),f.value.dragging=!0,requestAnimationFrame(()=>{A(T(J)),ie("resize",{event:J},!0)}))},x=J=>{f.value.dragging&&(window.getSelection().removeAllRanges(),ie("resized",{event:J},!0)),f.value.mouseDown=!1,f.value.activeSplitter=null,setTimeout(()=>{f.value.dragging=!1,v()},100)},C=(J,ee)=>{"ontouchstart"in window&&(J.preventDefault(),p.value.splitter===ee?(clearTimeout(p.value.timeoutId),p.value.timeoutId=null,E(J,ee),p.value.splitter=null):(p.value.splitter=ee,p.value.timeoutId=setTimeout(()=>p.value.splitter=null,500))),f.value.dragging||ie("splitter-click",{event:J,index:ee},!0)},E=(J,ee)=>{if(ie("splitter-dblclick",{event:J,index:ee},!0),r.maximizePanes){let te=0;s.value=s.value.map((se,pe)=>(se.size=pe===ee?se.max:se.min,pe!==ee&&(te+=se.min),se)),s.value[ee].size-=te,ie("pane-maximize",{event:J,index:ee,pane:s.value[ee]}),ie("resized",{event:J,index:ee},!0)}},k=(J,ee)=>{ie("pane-click",{event:J,index:a.value[ee].index,pane:a.value[ee]})},T=J=>{const ee=u.value.getBoundingClientRect(),{clientX:te,clientY:se}="ontouchstart"in window&&J.touches?J.touches[0]:J;return{x:te-(r.horizontal?0:f.value.cursorOffset)-ee.left,y:se-(r.horizontal?f.value.cursorOffset:0)-ee.top}},_=J=>{J=J[r.horizontal?"y":"x"];const ee=u.value[r.horizontal?"clientHeight":"clientWidth"];return r.rtl&&!r.horizontal&&(J=ee-J),J*100/ee},A=J=>{const ee=f.value.activeSplitter;let te={prevPanesSize:O(ee),nextPanesSize:B(ee),prevReachedMinPanes:0,nextReachedMinPanes:0};const se=0+(r.pushOtherPanes?0:te.prevPanesSize),pe=100-(r.pushOtherPanes?0:te.nextPanesSize),_e=Math.max(Math.min(_(J),pe),se);let Ae=[ee,ee+1],Ue=s.value[Ae[0]]||null,We=s.value[Ae[1]]||null;const qe=Ue.max<100&&_e>=Ue.max+te.prevPanesSize,At=We.max<100&&_e<=100-(We.max+B(ee+1));if(qe||At){qe?(Ue.size=Ue.max,We.size=Math.max(100-Ue.max-te.prevPanesSize-te.nextPanesSize,0)):(Ue.size=Math.max(100-We.max-te.prevPanesSize-B(ee+1),0),We.size=We.max);return}if(r.pushOtherPanes){const q=V(te,_e);if(!q)return;({sums:te,panesToResize:Ae}=q),Ue=s.value[Ae[0]]||null,We=s.value[Ae[1]]||null}Ue!==null&&(Ue.size=Math.min(Math.max(_e-te.prevPanesSize-te.prevReachedMinPanes,Ue.min),Ue.max)),We!==null&&(We.size=Math.min(Math.max(100-_e-te.nextPanesSize-te.nextReachedMinPanes,We.min),We.max))},V=(J,ee)=>{const te=f.value.activeSplitter,se=[te,te+1];return ee<J.prevPanesSize+s.value[se[0]].min&&(se[0]=H(te).index,J.prevReachedMinPanes=0,se[0]<te&&s.value.forEach((pe,_e)=>{_e>se[0]&&_e<=te&&(pe.size=pe.min,J.prevReachedMinPanes+=pe.min)}),J.prevPanesSize=O(se[0]),se[0]===void 0)?(J.prevReachedMinPanes=0,s.value[0].size=s.value[0].min,s.value.forEach((pe,_e)=>{_e>0&&_e<=te&&(pe.size=pe.min,J.prevReachedMinPanes+=pe.min)}),s.value[se[1]].size=100-J.prevReachedMinPanes-s.value[0].min-J.prevPanesSize-J.nextPanesSize,null):ee>100-J.nextPanesSize-s.value[se[1]].min&&(se[1]=j(te).index,J.nextReachedMinPanes=0,se[1]>te+1&&s.value.forEach((pe,_e)=>{_e>te&&_e<se[1]&&(pe.size=pe.min,J.nextReachedMinPanes+=pe.min)}),J.nextPanesSize=B(se[1]-1),se[1]===void 0)?(J.nextReachedMinPanes=0,s.value.forEach((pe,_e)=>{_e<l.value-1&&_e>=te+1&&(pe.size=pe.min,J.nextReachedMinPanes+=pe.min)}),s.value[se[0]].size=100-J.prevPanesSize-B(se[0]-1),null):{sums:J,panesToResize:se}},O=J=>s.value.reduce((ee,te,se)=>ee+(se<J?te.size:0),0),B=J=>s.value.reduce((ee,te,se)=>ee+(se>J+1?te.size:0),0),H=J=>[...s.value].reverse().find(ee=>ee.index<J&&ee.size>ee.min)||{},j=J=>s.value.find(ee=>ee.index>J+1&&ee.size>ee.min)||{},Y=()=>{var J;const ee=Array.from(((J=u.value)==null?void 0:J.children)||[]);for(const te of ee){const se=te.classList.contains("splitpanes__pane"),pe=te.classList.contains("splitpanes__splitter");!se&&!pe&&(te.remove(),console.warn("Splitpanes: Only <pane> elements are allowed at the root of <splitpanes>. One of your DOM nodes was removed."))}},N=(J,ee,te=!1)=>{const se=J-1,pe=document.createElement("div");pe.classList.add("splitpanes__splitter"),te||(pe.onmousedown=_e=>b(_e,se),typeof window<"u"&&"ontouchstart"in window&&(pe.ontouchstart=_e=>b(_e,se)),pe.onclick=_e=>C(_e,se+1)),pe.ondblclick=_e=>E(_e,se+1),ee.parentNode.insertBefore(pe,ee)},U=J=>{J.onmousedown=void 0,J.onclick=void 0,J.ondblclick=void 0,J.remove()},P=()=>{var J;const ee=Array.from(((J=u.value)==null?void 0:J.children)||[]);for(const se of ee)se.className.includes("splitpanes__splitter")&&U(se);let te=0;for(const se of ee)se.className.includes("splitpanes__pane")&&(!te&&r.firstSplitter?N(te,se,!0):te&&N(te,se),te++)},L=({uid:J,...ee})=>{const te=a.value[J];for(const[se,pe]of Object.entries(ee))te[se]=pe},F=J=>{var ee;let te=-1;Array.from(((ee=u.value)==null?void 0:ee.children)||[]).some(se=>(se.className.includes("splitpanes__pane")&&te++,se.isSameNode(J.el))),s.value.splice(te,0,{...J,index:te}),s.value.forEach((se,pe)=>se.index=pe),c.value&&o.nextTick(()=>{P(),K({addedPane:s.value[te]}),ie("pane-add",{pane:s.value[te]})})},R=J=>{const ee=s.value.findIndex(se=>se.id===J);s.value[ee].el=null;const te=s.value.splice(ee,1)[0];s.value.forEach((se,pe)=>se.index=pe),o.nextTick(()=>{P(),ie("pane-remove",{pane:te}),K({removedPane:{...te}})})},K=(J={})=>{!J.addedPane&&!J.removedPane?ae():s.value.some(ee=>ee.givenSize!==null||ee.min||ee.max<100)?de(J):X(),c.value&&ie("resized")},X=()=>{const J=100/l.value;let ee=0;const te=[],se=[];for(const pe of s.value)pe.size=Math.max(Math.min(J,pe.max),pe.min),ee-=pe.size,pe.size>=pe.max&&te.push(pe.id),pe.size<=pe.min&&se.push(pe.id);ee>.1&&Ee(ee,te,se)},ae=()=>{let J=100;const ee=[],te=[];let se=0;for(const _e of s.value)J-=_e.size,_e.givenSize!==null&&se++,_e.size>=_e.max&&ee.push(_e.id),_e.size<=_e.min&&te.push(_e.id);let pe=100;if(J>.1){for(const _e of s.value)_e.givenSize===null&&(_e.size=Math.max(Math.min(J/(l.value-se),_e.max),_e.min)),pe-=_e.size;pe>.1&&Ee(pe,ee,te)}},de=({addedPane:J,removedPane:ee}={})=>{let te=100/l.value,se=0;const pe=[],_e=[];(J?.givenSize??null)!==null&&(te=(100-J.givenSize)/(l.value-1));for(const Ae of s.value)se-=Ae.size,Ae.size>=Ae.max&&pe.push(Ae.id),Ae.size<=Ae.min&&_e.push(Ae.id);if(!(Math.abs(se)<.1)){for(const Ae of s.value)J?.givenSize!==null&&J?.id===Ae.id||(Ae.size=Math.max(Math.min(te,Ae.max),Ae.min)),se-=Ae.size,Ae.size>=Ae.max&&pe.push(Ae.id),Ae.size<=Ae.min&&_e.push(Ae.id);se>.1&&Ee(se,pe,_e)}},Ee=(J,ee,te)=>{let se;J>0?se=J/(l.value-ee.length):se=J/(l.value-te.length),s.value.forEach((pe,_e)=>{if(J>0&&!ee.includes(pe.id)){const Ae=Math.max(Math.min(pe.size+se,pe.max),pe.min),Ue=Ae-pe.size;J-=Ue,pe.size=Ae}else if(!te.includes(pe.id)){const Ae=Math.max(Math.min(pe.size+se,pe.max),pe.min),Ue=Ae-pe.size;J-=Ue,pe.size=Ae}}),Math.abs(J)>.1&&o.nextTick(()=>{c.value&&console.warn("Splitpanes: Could not resize panes correctly due to their constraints.")})},ie=(J,ee=void 0,te=!1)=>{const se=ee?.index??f.value.activeSplitter??null;n(J,{...ee,...se!==null&&{index:se},...te&&se!==null&&{prevPane:s.value[se-(r.firstSplitter?1:0)],nextPane:s.value[se+(r.firstSplitter?0:1)]},panes:s.value.map(pe=>({min:pe.min,max:pe.max,size:pe.size}))})};o.watch(()=>r.firstSplitter,()=>P()),o.onMounted(()=>{Y(),P(),K(),ie("ready"),c.value=!0}),o.onBeforeUnmount(()=>c.value=!1);const me=()=>{var J;return o.h("div",{ref:u,class:m.value},(J=i.default)==null?void 0:J.call(i))};return o.provide("panes",s),o.provide("indexedPanes",a),o.provide("horizontal",o.computed(()=>r.horizontal)),o.provide("requestUpdate",L),o.provide("onPaneAdd",F),o.provide("onPaneRemove",R),o.provide("onPaneClick",k),(J,ee)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(me)))}},Xo={__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,v.value),g.value)}),g=o.computed(()=>{const w=parseFloat(n.minSize);return isNaN(w)?0:w}),v=o.computed(()=>{const w=parseFloat(n.maxSize);return isNaN(w)?100:w}),b=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(()=>v.value,w=>r({uid:u,max:w})),o.onMounted(()=>{i({id:u,el:p.value,min:g.value,max:v.value,givenSize:n.size===void 0?null:m.value,size:m.value})}),o.onBeforeUnmount(()=>a(u)),(w,x)=>(o.openBlock(),o.createElementBlock("div",{ref_key:"paneEl",ref:p,class:"splitpanes__pane",onClick:x[0]||(x[0]=C=>o.unref(l)(C,w._.uid)),style:o.normalizeStyle(b.value)},[o.renderSlot(w.$slots,"default")],4))}},tne={class:"px-5 py-2.5 flex flex-col h-full"},nne=["innerHTML"],rne={key:0,class:"px-5 py-2.5"},one=["innerHTML"],ine={key:1,class:"px-5 py-2.5"},sne=["innerHTML"],ane={key:2,class:"px-5 py-2.5 flex flex-col flex-1"},lne=["innerHTML"],une={class:"px-5 py-2.5 flex flex-col h-full"},cne=["innerHTML"],dne=o.defineComponent({__name:"EditorViewMobile",props:{extensions:{},mode:{},hideComment:{type:Boolean},fieldNameComment:{},fieldNameCommentCuesheet:{},fieldNameContent:{},comment:{},commentCuesheet:{},content:{},isEditorViewSplitContent:{type:Boolean},contentTextStyle:{},watermarkOverlayComponent:{default:"div"},vbindWatermarkOverlay:{default:()=>({})}},setup(t){const e=t;Gc();const n=o.computed(()=>{const _=e.extensions?.filter(A=>A.name!=="spellchecker")||[];return _.some(A=>A.name==="image")||_.push(jc.configure()),_}),r=o.computed(()=>ra(e.comment)),i=o.computed(()=>ra(e.commentCuesheet)),s=o.computed(()=>ra(e.content));function a(_){return cg(_).replace(/<script\b[\s\S]*?<\/script\s*>/gi,"")}const l=o.computed(()=>r.value?a(e.comment):""),u=o.computed(()=>i.value?a(e.commentCuesheet):""),c=o.computed(()=>s.value?a(e.content):""),f=o.ref(),p=o.ref(),m=o.ref();o.onBeforeUnmount(()=>{f.value&&f.value.destroy(),p.value&&p.value.destroy(),m.value&&m.value.destroy()});function g(_){return new Oo({extensions:n.value,content:_,editable:!1,parseOptions:{preserveWhitespace:"full"}})}r.value||(f.value=g(un(e.comment,!0,e.mode))),i.value||(p.value=g(un(e.commentCuesheet,!0,e.mode))),s.value||(m.value=g(un(e.content,!0,e.mode)));function v(_,A){if(!_)return;const V=un(A,!0,e.mode);St.isEqual(_.getHTML(),V)||_.commands.setContent(V,!1,{preserveWhitespace:"full"})}o.watch(()=>e.comment,_=>{r.value||v(f.value,_)}),o.watch(()=>e.commentCuesheet,_=>{i.value||v(p.value,_)}),o.watch(()=>e.content,_=>{s.value||v(m.value,_)});const{isScrolling:b,handleScroll:w}=Xl(),{isScrolling:x,handleScroll:C}=Xl(),E=o.computed(()=>e.mode!==Te.EDITOR?!0:!e.hideComment),k=o.computed(()=>e.mode!==Te.REPORT?!0:e.mode===Te.REPORT&&!e.hideComment),T=o.computed(()=>e.mode===Te.STRAIGHT||e.mode===Te.PLAIN_TEXT||!E.value);return(_,A)=>{const V=Xc;return o.openBlock(),o.createBlock(o.unref($h),{horizontal:"",class:o.normalizeClass(o.unref(ke)("flex-1 text-sm",_.contentTextStyle))},{default:o.withCtx(()=>[o.unref(T)?(o.openBlock(),o.createBlock(o.unref(Xo),{key:0,class:o.normalizeClass(o.unref(ke)("!overflow-y-auto border border-ed-gray rounded-md",!_.isEditorViewSplitContent&&"border-none",!o.unref(x)&&"scrollbar-thumb-transparent")),onScroll:o.unref(C)},{default:o.withCtx(()=>[o.createElementVNode("div",tne,[_.fieldNameContent?(o.openBlock(),o.createBlock(V,{key:0,"field-name":_.fieldNameContent,class:"leading-7 font-medium text-blue-500"},null,8,["field-name"])):o.createCommentVNode("",!0),(o.openBlock(),o.createBlock(o.resolveDynamicComponent(_.watermarkOverlayComponent),o.normalizeProps(o.guardReactiveProps(_.vbindWatermarkOverlay)),{default:o.withCtx(()=>[o.unref(s)?(o.openBlock(),o.createElementBlock("div",{key:0,class:"ProseMirror",innerHTML:o.unref(c)},null,8,nne)):(o.openBlock(),o.createBlock(o.unref(Yn),{key:1,editor:o.unref(m)},null,8,["editor"]))]),_:1},16))])]),_:1},8,["class","onScroll"])):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.unref(E)?(o.openBlock(),o.createBlock(o.unref(Xo),{key:0,class:o.normalizeClass(o.unref(ke)("!overflow-y-auto border border-ed-gray rounded-md",!_.isEditorViewSplitContent&&"border-none",!o.unref(b)&&"scrollbar-thumb-transparent")),onScroll:o.unref(w)},{default:o.withCtx(()=>[o.createElementVNode("div",{class:o.normalizeClass(o.unref(ke)("divide-y divide-ed-gray divide-dashed flex flex-col h-full"))},[o.unref(k)?(o.openBlock(),o.createElementBlock("div",rne,[_.fieldNameComment?(o.openBlock(),o.createBlock(V,{key:0,"field-name":_.fieldNameComment,class:"leading-7 font-medium text-blue-500"},null,8,["field-name"])):o.createCommentVNode("",!0),(o.openBlock(),o.createBlock(o.resolveDynamicComponent(_.watermarkOverlayComponent),o.normalizeProps(o.guardReactiveProps(_.vbindWatermarkOverlay)),{default:o.withCtx(()=>[o.unref(r)?(o.openBlock(),o.createElementBlock("div",{key:0,class:"ProseMirror",innerHTML:o.unref(l)},null,8,one)):(o.openBlock(),o.createBlock(o.unref(Yn),{key:1,editor:o.unref(f)},null,8,["editor"]))]),_:1},16))])):o.createCommentVNode("",!0),_.mode===o.unref(Te).REPORT?(o.openBlock(),o.createElementBlock("div",ine,[_.fieldNameCommentCuesheet?(o.openBlock(),o.createBlock(V,{key:0,"field-name":_.fieldNameCommentCuesheet,class:"leading-7 font-medium text-blue-500"},null,8,["field-name"])):o.createCommentVNode("",!0),(o.openBlock(),o.createBlock(o.resolveDynamicComponent(_.watermarkOverlayComponent),o.normalizeProps(o.guardReactiveProps(_.vbindWatermarkOverlay)),{default:o.withCtx(()=>[o.unref(i)?(o.openBlock(),o.createElementBlock("div",{key:0,class:"ProseMirror",innerHTML:o.unref(u)},null,8,sne)):(o.openBlock(),o.createBlock(o.unref(Yn),{key:1,editor:o.unref(p)},null,8,["editor"]))]),_:1},16))])):o.createCommentVNode("",!0),_.isEditorViewSplitContent?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",ane,[_.fieldNameContent?(o.openBlock(),o.createBlock(V,{key:0,"field-name":_.fieldNameContent,class:"leading-7 font-medium text-blue-500"},null,8,["field-name"])):o.createCommentVNode("",!0),(o.openBlock(),o.createBlock(o.resolveDynamicComponent(_.watermarkOverlayComponent),o.normalizeProps(o.guardReactiveProps(_.vbindWatermarkOverlay)),{default:o.withCtx(()=>[o.unref(s)?(o.openBlock(),o.createElementBlock("div",{key:0,class:"ProseMirror",innerHTML:o.unref(c)},null,8,lne)):(o.openBlock(),o.createBlock(o.unref(Yn),{key:1,editor:o.unref(m)},null,8,["editor"]))]),_:1},16))]))],2)]),_:1},8,["class","onScroll"])):o.createCommentVNode("",!0),_.isEditorViewSplitContent?(o.openBlock(),o.createBlock(o.unref(Xo),{key:1,class:o.normalizeClass(o.unref(ke)("!overflow-y-auto border border-ed-gray rounded-md",!o.unref(x)&&"scrollbar-thumb-transparent")),onScroll:o.unref(C)},{default:o.withCtx(()=>[o.createElementVNode("div",une,[_.fieldNameContent?(o.openBlock(),o.createBlock(V,{key:0,"field-name":_.fieldNameContent,class:"leading-7 font-medium text-blue-500"},null,8,["field-name"])):o.createCommentVNode("",!0),(o.openBlock(),o.createBlock(o.resolveDynamicComponent(_.watermarkOverlayComponent),o.normalizeProps(o.guardReactiveProps(_.vbindWatermarkOverlay)),{default:o.withCtx(()=>[o.unref(s)?(o.openBlock(),o.createElementBlock("div",{key:0,class:"ProseMirror",innerHTML:o.unref(c)},null,8,cne)):(o.openBlock(),o.createBlock(o.unref(Yn),{key:1,editor:o.unref(m)},null,8,["editor"]))]),_:1},16))])]),_:1},8,["class","onScroll"])):o.createCommentVNode("",!0)],64))]),_:1},8,["class"])}}}),fne={class:"flex gap-2 items-center overflow-x-auto"},xS=o.defineComponent({__name:"ToolbarMobile",props:{editor:{},disabled:{type:Boolean,default:!1},mode:{},activeExtensions:{default:()=>[Lc,ki,tb]},customClassToolbar:{}},setup(t){const{t:e}=Pt(),n=t,r=o.inject("isEditable",o.ref(!0)),i=o.computed(()=>{const u=[...n.editor.extensionManager.extensions],c=u.find(m=>m.name===tb);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:v=!1,spacer:b=!1,toolbar:w=!0}=m.options;if(!g||!pg(g)||!w)continue;const x=g({editor:n.editor,extension:m,t:o.unref(e),isMobile:!0});if(Array.isArray(x)){const C=x.map((E,k)=>({id:`${m.name}`,button:E,divider:k===x.length-1?v:!1,spacer:k===0?b:!1}));p=[...p,...C];continue}p.push({button:x,divider:v,spacer:b,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=wS;return o.openBlock(),o.createElementBlock("div",{id:"tool-bar",class:o.normalizeClass(o.unref(ke)("z-10 border border-ed-input rounded-[5px] px-2.5 py-[5px] leading-none",!i.value.length&&"hidden",u.customClassToolbar))},[o.createElementVNode("div",fne,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.value,(p,m)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:m},[p.spacer&&m!==0?(o.openBlock(),o.createBlock(o.unref(wo),{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||p.button.componentProps?.disabled,"custom-class":s(p),icon:a(p)}),o.createSlots({_:2},[o.renderList(p.button.componentSlots,(g,v,b)=>({name:`${v}`,fn:o.withCtx(w=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(g),o.mergeProps({ref_for:!0},w?.props,{id:p.id}),null,16,["id"]))])}))]),1040,["id","editor","disabled","custom-class","icon"])),p.id===ki&&o.unref(l)?(o.openBlock(),o.createBlock(f,{key:1,class:"bg-white border-inherit w-[26px] h-[26px] shadow-none",checked:p.button.componentProps.isActive?.(),"onUpdate:checked":g=>p.button.componentProps.action?.()},null,8,["checked","onUpdate:checked"])):o.createCommentVNode("",!0),p.divider?(o.openBlock(),o.createBlock(o.unref(wo),{key:2,orientation:"vertical",class:"mx-2 h-auto"})):o.createCommentVNode("",!0)],64))),128))])],2)}}}),pne={class:"flex w-fit rounded-md bg-ed-gray-600 text-white text-sm max-w-full overflow-x-auto"},hne=Xr(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}=Pt(),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=OJ(n.editor);n.editor.commands.setSuperTextContent(f)};return(f,p)=>(o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createElementVNode("div",pne,[o.unref(s)&&!f.disableSuperInput&&f.mode!==o.unref(Te).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]=m=>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]=m=>(f.editor.chain().focus().pasteContent().run(),r("close-long-press-menu")))},o.toDisplayString(o.unref(i)("editor.paste")),1)):o.createCommentVNode("",!0),o.createElementVNode("button",{class:"bubble-menu-item",onClick:p[2]||(p[2]=m=>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]=m=>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(o.unref(l)?.component),{"is-open":o.unref(a),open:o.unref(a),class:o.normalizeClass(o.unref(l)?.componentProps?.class),onSelectedChar:u,onClose:p[5]||(p[5]=m=>a.value=!1)},null,40,["is-open","open","class"]))]))],64))}}),[["__scopeId","data-v-b4e2ce28"]]),CS=o.defineComponent({__name:"MainBubbleMenu",props:{editor:{},mode:{},disableSuperInput:{type:Boolean}},setup(t){const e=t,n=new dg,r=o.ref(!1),i=async()=>{const m=await e.editor.hasClipboard?.();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:v,to:b}=g.selection,w=m.dom.getBoundingClientRect(),x=m.coordsAtPos(v),C=m.coordsAtPos(b),E=Math.min(x.top,C.top),T=Math.max(x.bottom,C.bottom)-E;return new DOMRect(w.left,E,w.width,T)}return null}},a=o.ref(null),l=o.ref(!1),u=({editor:m,state:g})=>{if(e.editor.storage.deviceEnv.isForceCloseBubble||e.editor.isActive("link"))return!1;const{selection:v}=g,b=!v.empty&&Kd(v)||l.value;return b&&m.extensionStorage.spellchecker.spellchecker.hideSuggestionBox(),b};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 v=e.editor.view,b=v.state,w=v.posAtCoords({left:g.x,top:g.y});if(!w||w.inside===-1)return;const x=w.pos,C=b.doc.content.size,E=Math.min(x+1,C);let k=b.tr;k=k.setSelection(Ie.create(b.doc,x,E)),v.dispatch(k),requestAnimationFrame(()=>{const T=v.state.tr.setSelection(Ie.create(v.state.doc,x,x));v.dispatch(T),v.focus()})}return o.onMounted(()=>{const m=e.editor.view.dom;ct.onLongPress(o.ref(m),b=>{l.value=!0,p(b)},{delay:500,modifiers:{prevent:!1}});const g=()=>{e.editor.state.selection.empty&&(l.value=!1)};m.addEventListener("pointerdown",g);const v=({transaction:b})=>{l.value&&b.docChanged&&(l.value=!1,o.nextTick(()=>{try{const w=a.value?.$el;w&&w._tippy&&typeof w._tippy.hide=="function"&&w._tippy.hide()}catch{const x=e.editor.view,C=x.state,E=C.selection.from,k=C.doc.content.size,T=Math.min(E+1,k);x.dispatch(C.tr.setSelection(Ie.create(C.doc,E,T))),requestAnimationFrame(()=>{x.dispatch(x.state.tr.setSelection(Ie.create(x.state.doc,E,E)))})}}))};e.editor.on("transaction",v),o.onUnmounted(()=>{m.removeEventListener("pointerdown",g),e.editor.off("transaction",v)})}),(m,g)=>(o.openBlock(),o.createBlock(o.unref(Wu),{ref_key:"bubbleMenuRef",ref:a,editor:m.editor,"tippy-options":s,"should-show":u},{default:o.withCtx(()=>[o.createVNode(hne,{editor:m.editor,mode:m.mode,disableSuperInput:m.disableSuperInput,hasClipboard:o.unref(r),onCloseLongPressMenu:g[0]||(g[0]=v=>l.value=!1)},null,8,["editor","mode","disableSuperInput","hasClipboard"])]),_:1},8,["editor"]))}}),mne={class:"flex items-center justify-between label-large mb-2"},gne={class:"mb-5"},vne={class:"flex gap-x-3"},bne=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(()=>zc(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)=>{const g=Ot;return o.openBlock(),o.createBlock(o.resolveDynamicComponent(p.bottomSheetComponent?.component),{"is-open":p.open,type:"bottom",title:"수퍼 입력","custom-class-content":"px-[12px]",onOnClose:u},{customContent:o.withCtx(()=>[o.createElementVNode("div",mne,[m[2]||(m[2]=o.createElementVNode("span",null,"내용",-1)),(o.openBlock(),o.createBlock(o.resolveDynamicComponent(p.bottomSheetComponent?.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",gne,[o.createVNode(Eb,{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(()=>[o.createElementVNode("div",vne,[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(p.bottomSheetComponent?.button),{variant:"outline",onClick:u},{default:o.withCtx(()=>m[3]||(m[3]=[o.createTextVNode(" 취소 ")])),_:1})),(o.openBlock(),o.createBlock(o.resolveDynamicComponent(p.bottomSheetComponent?.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"])}}}),kS=Fn.create({name:"diffDel",parseHTML(){return[{tag:"span.diff-del"}]},renderHTML({HTMLAttributes:t}){return["span",{class:"diff-del",...t},0]}});function ES(t=100){let e=null,n=0;function r(l){n=l}function i(l){let u=l?.parentElement;for(;u;){if(u.id==="comment-wrap-scroll"){u=u.parentElement;continue}const f=getComputedStyle(u).overflowY;if(f==="auto"||f==="scroll")return u;u=u.parentElement}return window}function s(l){e&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{const{view:u,state:c}=l,{from:f}=c.selection,p=u.coordsAtPos(f),m=i(u.dom),g=o.unref(t);if(m===window){const k=window.innerHeight-g,T=p.top-k;T>0&&window.scrollBy({top:T,behavior:"smooth"});return}const v=m,b=v.getBoundingClientRect(),w=p.top-b.top,x=v.clientHeight-g,C=w-x;C>0&&v.scrollBy({top:C,behavior:"smooth"})})}function a(l){requestAnimationFrame(()=>{const{view:u,state:c}=l,{from:f}=c.selection,p=u.coordsAtPos(f),m=i(u.dom),g=o.unref(t);if(m===window){const _=window.innerHeight,A=_-n-g;if(!(p.top>A))return;const O=_-g,B=p.top-O;B>0&&window.scrollBy({top:B,behavior:"smooth"});return}const v=m,b=v.getBoundingClientRect(),w=p.top-b.top,x=v.clientHeight,C=x-n-g;if(!(w>C))return;const k=x-g,T=w-k;T>0&&v.scrollBy({top:T,behavior:"smooth"})})}return{onTypingScrollCaretNearBottom:s,onKeyboardShowScrollNearBottom:a,setKeyboardHeight:r}}const yne=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:{},fontWeightDefault:{},showSuperElementIdColor:{type:Boolean},letterSpacingDefault:{},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:{},toolbarExtensionOrder:{},watermarkOverlay:{},bottomOffset:{},characterCountLimit:{},blockSeparatorPolicy:{},fixedSuperPreviewWidth:{type:Boolean}},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=bn(),{isReady:l,editor:u,updateEditorState:c,checkSpellStore:f}=a,{onTypingScrollCaretNearBottom:p}=ES(r.bottomOffset),m=o.inject("isEditable",o.ref(!0)),g=new Oo({enablePasteRules:!1,enableInputRules:!1,content:un(r.modelValue,r.disabled),editorProps:{attributes:{id:ir.COMMENT,[ir.DISABLE_SUPER_INPUT]:`${r.disableSuperInput}`},handleKeyDown:St.throttle((C,E)=>E.key==="Enter"&&s.enter&&!E.shiftKey?(i("enter"),!0):!1,Lo),transformPastedHTML:C=>(C=C.replace(/\s*style="[^"]*"/g,""),C),handlePaste(C,E){const k=E.clipboardData?.getData("text/plain")||"";return r.mode===Te.EDITOR&&Wb(k)?(E.preventDefault(),jb(C,k.trim())):!1}},onCreate:({editor:C})=>{c(C)},onUpdate:St.throttle(({editor:C})=>{l.value=!0;const E=b(C,r.output);i("update:modelValue",E),i("change",{editor:C,output:E}),c(C)},Lo),extensions:[kS,...St.uniqBy(r.extensions,"name")],editable:m.value,onFocus:()=>{v()},onBlur:({editor:C,event:E})=>{i("onBlurEditor",E)},onSelectionUpdate:({editor:C})=>{C.isFocused&&p(C)}});function v(){i("setEditorSelected",g)}v();function b(C,E){if(!C)return"";if(C.isEmpty)return E==="json"?{}:"";switch(E){case"html":return mg(C,{removeNodes:[Bc,Ci]});case"json":return C.getJSON();case"text":return C.getText();default:return""}}function w(C){return C.every(E=>g?.extensionManager.extensions.find(k=>k.name===E))}o.watch(()=>f.languages,()=>{g.commands.checkSpelling()}),o.watch(()=>r.modelValue,C=>{if(!g||St.isEqual(b(g,r.output),C))return;const{from:E,to:k}=g.state.selection;g.commands.setTextSelection({from:E,to:k}),g.commands.setContent(un(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,()=>{document.getElementById(ir.COMMENT)?.setAttribute(ir.DISABLE_SUPER_INPUT,`${r.disableSuperInput}`)}),o.onUnmounted(()=>g?.destroy()),Ju(ju.SAVE,()=>{localStorage.setItem("comment",b(g,"html"))});function x(C){g.commands.focus("end"),v()}return Ph(g),o.onMounted(()=>{r.autoFocus&&x(r.mode),g?.commands?.setIsMobile&&g.commands.setIsMobile(!0)}),o.watch(()=>r.mode,C=>{r.autoFocus&&x()}),o.watch(()=>m.value,C=>{g?.setEditable(C),g?.commands?.setIsEnableSuggestion&&g.commands.setIsEnableSuggestion(C)},{immediate:!0}),e({editor:g}),(C,E)=>{const k=CS,T=Dh,_=Rh,A=Lh;return o.openBlock(),o.createElementBlock(o.Fragment,null,[!C.hideBubble&&!C.disabled&&o.unref(m)?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createVNode(k,{editor:o.unref(g),mode:C.mode,"disable-super-input":C.disableSuperInput},null,8,["editor","mode","disable-super-input"]),w([o.unref(Ic)])?(o.openBlock(),o.createBlock(T,{key:0,editor:o.unref(g)},null,8,["editor"])):o.createCommentVNode("",!0),w([o.unref(_a)])?(o.openBlock(),o.createBlock(_,{key:1,editor:o.unref(g)},null,8,["editor"])):o.createCommentVNode("",!0),w([o.unref(Ss)])?(o.openBlock(),o.createBlock(A,{key:2,editor:o.unref(g)},null,8,["editor"])):o.createCommentVNode("",!0)],64)):o.createCommentVNode("",!0),o.createVNode(o.unref(Yn),{id:"editor-panel",editor:o.unref(g),spellcheck:"true",class:"flex-1 relative"},null,8,["editor"])],64)}}}),SS=o.defineComponent({__name:"ToolbarTitle",props:{titleBar:{},customClass:{}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("h3",{class:o.normalizeClass(o.unref(ke)("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 _S(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 v=g[0].size,b=g[1].size;u.value=v,c.value=b,v>n&&!a.value&&(a.value=!0),b>n&&!l.value&&(l.value=!0),v<=s&&a.value&&(a.value=!1),b<=s&&l.value&&(l.value=!1)}}}}const wne={class:"flex justify-between items-center relative gap-x-3"},xne={class:"flex items-center gap-x-4"},Yc=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:""},fontWeightDefault:{default:void 0},showSuperElementIdColor:{type:Boolean},letterSpacingDefault:{default:""},contentTextStyle:{default:""},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:{},toolbarExtensionOrder:{},watermarkOverlay:{},bottomOffset:{},characterCountLimit:{},blockSeparatorPolicy:{},fixedSuperPreviewWidth:{type:Boolean}},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;Gc();const s=new dg;o.provide("isMobile",!0),ct.useEventBus(ur.INCREASE_DECREASE_FONTSIZE);const a=o.useAttrs(),l=bn(),{state:u,isFullscreen:c,isReady:f,editor:p,updateEditorState:m,checkSpellStore:g,setImageAttachment:v,setEditorContentMobile:b,footerTargetRef:w}=l,{markAsFocused:x,insertHtml:C}=Fee(),E=o.computed(()=>r.isShowFormatControlBar&&r.mode===Te.EDITOR&&B&&!r.isEditorView),k=o.computed(()=>E.value?100:40),T=o.ref(!1),{onTypingScrollCaretNearBottom:_,onKeyboardShowScrollNearBottom:A,setKeyboardHeight:V}=ES(k);function O(){s.isNativeWebViewAvailable()&&(s.receiveDataFromNative(ag.KEYBOARD_DID_SHOW,$=>{T.value=!0,V($.height),setTimeout(()=>{F.value?.isFocused&&A(F.value)},50)}),s.receiveDataFromNative(ag.KEYBOARD_DID_HIDE,()=>{T.value=!1}))}const B=o.ref(!r.disabled&&!r.readonly);o.provide("isEditable",B);const H=o.ref(r.fontSizeDefault),j=o.ref(r.fontFamilyDefault),Y=o.ref(r.fontWeightDefault),N=o.ref(r.letterSpacingDefault);o.provide("fontSize",H),o.provide("fontFamily",j),o.provide("fontWeight",Y),o.provide("letterSpacing",N),o.provide("showSuperElementIdColor",o.computed(()=>r.showSuperElementIdColor??!1));const U=o.computed(()=>({...o.unref(c)?{height:"100%"}:{minHeight:r.minHeight?Yt(r.minHeight):void 0,maxHeight:r.maxHeight?Yt(r.maxHeight):void 0,height:r.height?Yt(r.height):void 0},maxWidth:Yt(r.maxWidth),width:r.maxWidth?"100%":void 0,margin:r.maxWidth?"0 auto":void 0})),P=new Oo({coreExtensionOptions:{clipboardTextSerializer:{blockSeparator:r.blockSeparatorPolicy==="line"?`
|
|
354
|
+
`,bt=Ve.querySelectorAll("p"),Zt=bt.length>0?Array.from(bt).map(gn=>gn.textContent||"").join(nt):Ve.textContent||"";ue.clipboardData?.clearData(),ue.clipboardData?.setData("text/html",it),ue.clipboardData?.setData("text/plain",Zt),ue.preventDefault()}catch{}};o.onMounted(()=>{ne(r.mode),oe(r.mode),w(ie),C.value||document.addEventListener("copy",we,!0)}),o.onBeforeUnmount(()=>{document.removeEventListener("copy",we,!0)}),o.watch(()=>r.mode,ue=>{ne(ue),oe(ue)});const $e=o.ref(null),tt=()=>{$e.value?.editor.commands.focusInvalidChar()||ie.commands.focusInvalidChar()};u.focusFirstInvalidChar.value=tt,o.onActivated(()=>{u.focusFirstInvalidChar.value=tt});const Tt=o.computed(()=>{const ue=r.fieldNameComment?.label||r.fieldNameCommentCuesheet?.label||r.fieldNameContent?.label;return r.disabled&&ue});return e({editor:ie}),(ue,je)=>{const re=Dh,Me=Rh,Ve=Lh,it=uS,nt=Yee,bt=Kee;return o.unref(ie)?(o.openBlock(),o.createElementBlock("div",{key:0,id:"vdc-editor",class:o.normalizeClass(["vdc-editor w-full flex flex-col",[ue.editorClass,{"outline-ed-primary":o.unref(ie).isFocused,"outline-ed-border":!o.unref(ie).isFocused}]]),style:o.normalizeStyle(o.unref(B))},[!ue.hideBubble&&!ue.disabled&&o.unref(C)?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[At([o.unref(Ic)])?(o.openBlock(),o.createBlock(re,{key:0,editor:o.unref(ie)},null,8,["editor"])):o.createCommentVNode("",!0),At([o.unref(_a)])?(o.openBlock(),o.createBlock(Me,{key:1,editor:o.unref(ie)},null,8,["editor"])):o.createCommentVNode("",!0),At([o.unref(Ss)])?(o.openBlock(),o.createBlock(Ve,{key:2,editor:o.unref(ie)},null,8,["editor"])):o.createCommentVNode("",!0),At([o.unref(zl),o.unref(Ci)])?(o.openBlock(),o.createBlock(it,{key:3,editor:o.unref(ie)},null,8,["editor"])):o.createCommentVNode("",!0)],64)):o.createCommentVNode("",!0),ue.hideToolbar?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(nt,{key:1,editor:o.unref(ie),"editor-comment":o.unref($e)?.editor,mode:ue.mode,class:"mb-2","custom-class-toolbar":ue.customClassToolbar,"toolbar-extension-order":ue.toolbarExtensionOrder},null,8,["editor","editor-comment","mode","custom-class-toolbar","toolbar-extension-order"])),o.createElementVNode("div",{ref_key:"editorWrapRef",ref:z,class:o.normalizeClass(o.unref(ke)("space-y-2 flex-1 flex flex-col break-keep",o.unref(me)&&"[&_*]:!font-inherit",o.unref(me)&&"[&_*]:!text-font-size-inherit")),style:o.normalizeStyle(o.unref(ee))},[o.unref(Tt)?(o.openBlock(),o.createBlock(bt,{key:0,extensions:ue.extensions,mode:ue.mode,"hide-comment":ue.hideComment,"field-name-comment":ue.fieldNameComment,"field-name-comment-cuesheet":ue.fieldNameCommentCuesheet,"field-name-content":ue.fieldNameContent,comment:ue.comment,"comment-cuesheet":ue.commentCuesheet,content:ue.modelValue,"min-chars":ue.minChar.content,"font-size":o.unref(T)},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(Ue)}px`})},[ue.mode===o.unref(Te).REPORT&&!ue.hideComment?(o.openBlock(),o.createBlock(bte,{key:0,ref_key:"editorCommentRef",ref:$e,mode:o.unref(Te).REPORT,extensions:ue.extensions,"model-value":r.comment,disabled:r.disabled,"disable-super-input":ue.disableSuperInput,"is-open-super-view":o.unref(q),"super-preview-custom-class":ue.superPreviewCustomClass,"fixed-super-preview-width":ue.fixedSuperPreviewWidth,"min-char":ue.minChar,"font-size":o.unref(T),style:o.normalizeStyle(r.autoHeight?{height:"auto",minHeight:o.unref(Yt)(o.unref(Ke))}:{height:o.unref(Yt)(o.unref(xe)),minHeight:o.unref(Yt)(o.unref(rt))}),"editor-content-instance":o.unref(ie),class:"relative overflow-y-auto","onUpdate:modelValue":je[0]||(je[0]=Zt=>i("update:comment",Zt))},null,8,["mode","extensions","model-value","disabled","disable-super-input","is-open-super-view","super-preview-custom-class","fixed-super-preview-width","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(Yt)(o.unref(rt))}:{height:o.unref(Yt)(o.unref(Pe))})},[o.createElementVNode("div",Ute,[o.unref(q)?(o.openBlock(),o.createBlock(ute,{key:0,ref_key:"superTextViewRef",ref:_e,editor:o.unref(ie),"super-preview-custom-class":ue.superPreviewCustomClass,"min-chars":ue.minChar.superPreview,"font-size":o.unref(T),"fixed-width":ue.fixedSuperPreviewWidth},null,8,["editor","super-preview-custom-class","min-chars","font-size","fixed-width"])):o.createCommentVNode("",!0),o.createElementVNode("div",{id:"editor-panel",ref_key:"contentInner",ref:te,class:"flex-1 p-2.5 border border-ed-gray-400 rounded-[3px] focus-within:border-ed-input-focus"},[o.createVNode(Sb,{ref_key:"selectContextMenuRef",ref:$,editor:o.unref(ie),mode:ue.mode,"super-text-store":o.unref(g),disabled:r.disabled},{default:o.withCtx(()=>[o.createVNode(o.unref(Yn),{editor:o.unref(ie),spellcheck:"true",class:o.normalizeClass(o.unref(ke)("h-full break-all",ue.mode===o.unref(Te).PLAIN_TEXT&&"plain-text"))},null,8,["editor","class"])]),_:1},8,["editor","mode","super-text-store","disabled"])],512)])],4)],4))],6),o.createVNode(zte,{modelValue:o.unref(H),"onUpdate:modelValue":je[1]||(je[1]=Zt=>o.isRef(H)?H.value=Zt:null),"total-matches":o.unref(P),"current-match-index":o.unref(L),onSearchDown:X,onSearchUp:ae,onReplace:de,onReplaceAll:Ee,onRefresh:K},null,8,["modelValue","total-matches","current-match-index"])],6)):o.createCommentVNode("",!0)}}}),Wte={class:"relative px-2.5"},jte={key:0,class:"w-12 rounded-tl-full rounded-bl-full pointer-events-none absolute inset-y-0 left-0 bg-white-fade-left z-10","aria-hidden":"true"},qte={key:1,class:"w-12 rounded-tr-full rounded-br-full pointer-events-none absolute inset-y-0 right-0 bg-white-fade-right z-10","aria-hidden":"true"},Kte=o.defineComponent({__name:"ToolbarFormat",props:{editor:{},disabled:{type:Boolean,default:!1},mode:{},activeExtensions:{default:()=>[]},threshold:{default:5}},setup(t){const{t:e}=Pt(),n=t,r=[eh,Lc,ki,oh],i=o.computed(()=>{const m=[...n.editor.extensionManager.extensions],g=uE(m,{[wk]:0});let v=[];for(const b of g){const{button:w,divider:x=!1,spacer:C=!1,toolbar:E=!0}=b.options;if(!w||!pg(w)||!E)continue;const k=w({editor:n.editor,extension:b,t:o.unref(e),isMobile:!0});if(Array.isArray(k)){const T=k.map((_,A)=>({id:`${b.name}`,button:_,divider:A===k.length-1?x:!1,spacer:A===0?C:!1,buttonName:_.buttonName}));v=[...v,...T];continue}v.push({button:k,divider:x,spacer:C,id:`${b.name}`})}return n.activeExtensions.length?v.filter(b=>b.id&&n.activeExtensions.includes(b.id)):(r.length&&(v=v.filter(b=>b.id&&!r.includes(b.id))),v=v.map(b=>{const w=["videoUpload","heading","strike","color","fontSize","fontFamily"],x=["redo"],C=v.some(T=>T.id==="imageUpload"),E=v.some(T=>T.id==="videoUpload");E||w.push("imageUpload"),!C&&!E&&w.push("link");const k=w.includes(b.id??"")||x.includes(b.buttonName??"");return{...b,separator:k}}),v)}),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:v,clientWidth:b}=m;if(!(v>b+1)){u.value=!1,c.value=!1;return}const x=g<=n.threshold,C=g+b>=v-n.threshold;u.value=!x,c.value=!C}const p=ct.useThrottleFn(f,10);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(ke)("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",Wte,[o.unref(u)?(o.openBlock(),o.createElementBlock("div",jte)):o.createCommentVNode("",!0),o.unref(c)?(o.openBlock(),o.createElementBlock("div",qte)):o.createCommentVNode("",!0),o.createElementVNode("div",{ref_key:"scrollEl",ref:l,id:"tool-bar-format-scroll",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,(v,b)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:b},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(v.button.component),o.mergeProps({id:v.id,ref_for:!0},v.button.componentProps,{editor:m.editor,disabled:m.disabled||v.button.componentProps?.disabled,"custom-class":s(v),icon:a(v)}),o.createSlots({_:2},[o.renderList(v.button.componentSlots,(w,x,C)=>({name:`${x}`,fn:o.withCtx(E=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(w),o.mergeProps({ref_for:!0},E?.props,{id:v.id}),null,16,["id"]))])}))]),1040,["id","editor","disabled","custom-class","icon"])),v.separator?(o.openBlock(),o.createBlock(o.unref(wo),{key:0,orientation:"vertical",class:"h-5"})):o.createCommentVNode("",!0)],64))),128))],512)])],2))}}),Gte={class:"relative px-2.5"},Xte={key:0,class:"w-12 rounded-tl-full rounded-bl-full pointer-events-none absolute inset-y-0 left-0 bg-white-fade-left z-10","aria-hidden":"true"},Yte={key:1,class:"w-12 rounded-tr-full rounded-br-full pointer-events-none absolute inset-y-0 right-0 bg-white-fade-right z-10","aria-hidden":"true"},Jte={class:"flex items-center gap-2"},Zte={class:"mt-3"},Qte=o.defineComponent({__name:"ToolbarImage",props:{editor:{},disabled:{type:Boolean,default:!1},threshold:{default:10}},setup(t){const e=t,{t:n}=Pt(),r=o.ref("100"),i=o.ref(),s=o.ref(),a=o.ref(),l=["left","center","right"],u={left:"AlignLeft",center:"AlignCenter",right:"AlignRight"};function c(Y){Y?.preventDefault(),e.editor.getAttributes("image").src&&(e.editor.commands.updateImage({width:i.value?`${i.value}px`:null}),ff())}function f(Y){const N=Math.max(0,Math.min(100,parseInt(r.value)));e.editor.commands.updateImage({width:`${N}%`}),ff()}function p(Y){e.editor.commands.updateAttributes("image",{textAlign:Y})}o.watch(r,()=>{r.value&&f()}),o.watch(()=>e.editor.getAttributes("image"),Y=>{Y&&(i.value=Math.round(parseFloat(Y.originWidth)),s.value=Math.round(parseFloat(Y.originHeight)),a.value=Y.originWidth/Y.originHeight)});function m(){s.value&&a.value?i.value=Math.max(30,Math.round(s.value*a.value)):i.value=null}function g(){i.value&&a.value?s.value=Math.max(20,Math.round(i.value/a.value)):s.value=null}function v(Y){p(Y)}function b(){const Y=e.editor.getAttributes("image"),{flipX:N}=Y;e.editor.commands.updateImage({flipX:!N})}function w(){const Y=e.editor.getAttributes("image"),{flipY:N}=Y;e.editor.commands.updateImage({flipY:!N})}function x(){const{state:Y,dispatch:N}=e.editor.view;ol(Y,N)}function C(){const{state:Y,dispatch:N}=e.editor.view,{tr:U,selection:P}=Y;if(!(P instanceof Re))return;const L=P.from,F=Y.doc.nodeAt(L);if(!F)return;const K=Y.doc.resolve(L).nodeBefore;if(!K)return;const X=L-K.nodeSize,ae=U.delete(L,L+F.nodeSize).insert(X,F).setSelection(Re.create(U.doc,X));N(ae)}function E(){const{state:Y,dispatch:N}=e.editor.view,{tr:U,doc:P,selection:L}=Y;if(!(L instanceof Re))return;const F=L.from,R=P.nodeAt(F);if(!R)return;const K=F+R.nodeSize;if(K>=P.content.size)return;const X=P.nodeAt(K);if(!X)return;const ae=K+X.nodeSize-R.nodeSize,de=F+X.nodeSize,Ee=U.delete(F,F+R.nodeSize).insert(ae,R).setSelection(Re.create(U.doc,de));N(Ee)}const k=o.ref(null),T=o.ref(!1),_=o.ref(!1);function A(){const Y=k.value;if(!Y)return;const{scrollLeft:N,scrollWidth:U,clientWidth:P}=Y;if(!(U>P+1)){T.value=!1,_.value=!1;return}const F=N<=e.threshold,R=N+P>=U-e.threshold;T.value=!F,_.value=!R}const V=ct.useThrottleFn(A,10);ct.useEventListener(k,"scroll",V),ct.useResizeObserver(k,V),ct.useEventListener(window,"resize",V);const O=o.inject("isMobile",!1),B=`dropdown-trigger-${$r(10)}`,{isOpen:H}=Nf({scrollEl:"tool-bar-image-scroll",ignoreSelector:`[data-radix-popper-content-wrapper], .${B}`}),j=o.computed(()=>O?{modal:!1,open:H.value,"onUpdate:open":Y=>H.value=Y}:{});return(Y,N)=>{const U=Ge,P=wo,L=Ca,F=Mc,R=ws,K=Kl,X=Bh,ae=Oh,de=gs,Ee=ms;return o.openBlock(),o.createElementBlock("div",{id:"tool-bar-image",class:o.normalizeClass(o.unref(ke)("bg-white border border-gray-100 dark:bg-ed-gray-500 dark:border-ed-muted rounded-full shadow-elevation2"))},[o.createElementVNode("div",Gte,[T.value?(o.openBlock(),o.createElementBlock("div",Xte)):o.createCommentVNode("",!0),_.value?(o.openBlock(),o.createElementBlock("div",Yte)):o.createCommentVNode("",!0),o.createElementVNode("div",{ref_key:"scrollEl",ref:k,id:"tool-bar-image-scroll",class:"text-ed-gray-700 flex gap-1.5 items-center overflow-x-auto overflow-y-hidden min-h-11 scrollbar-hide overflow-scrolling-touch relative whitespace-nowrap"},[o.createVNode(U,{tooltip:o.unref(n)("editor.image.menu.flipX"),icon:"FlipVertical",action:b},null,8,["tooltip"]),o.createVNode(U,{tooltip:o.unref(n)("editor.image.menu.flipY"),icon:"FlipHorizontal",action:w},null,8,["tooltip"]),o.createVNode(P,{orientation:"vertical",class:"h-5"}),o.createVNode(U,{tooltip:o.unref(n)("editor.image.menu.moveUp"),icon:"MoveUp",action:C,disabled:!Y.editor.isEditable},null,8,["tooltip","disabled"]),o.createVNode(U,{tooltip:o.unref(n)("editor.image.menu.moveDown"),icon:"MoveDown",action:E,disabled:!Y.editor.isEditable},null,8,["tooltip","disabled"]),o.createVNode(P,{orientation:"vertical",class:"h-5"}),o.createVNode(Ee,o.normalizeProps(o.guardReactiveProps(o.unref(j))),{default:o.withCtx(()=>[o.createVNode(L,{class:o.normalizeClass(B)},{default:o.withCtx(()=>[o.createVNode(U,{title:o.unref(n)("editor.image.menu.size"),icon:"ImageSize"},null,8,["title"])]),_:1}),o.createVNode(de,{class:"w-84 inside-toolbar"},{default:o.withCtx(()=>[o.createElementVNode("div",Jte,[o.createVNode(F,{for:"maxWidth",class:"whitespace-nowrap"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("editor.image.menu.size.width")),1)]),_:1}),o.createVNode(R,{id:"maxWidth",modelValue:i.value,"onUpdate:modelValue":N[0]||(N[0]=ie=>i.value=ie),type:"number",class:"w-20 h-8 [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",onInput:g,onKeyup:o.withKeys(c,["enter"])},null,8,["modelValue"]),o.createVNode(F,{for:"maxWidth",class:"whitespace-nowrap"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("editor.image.menu.size.height")),1)]),_:1}),o.createVNode(R,{id:"maxWidth",modelValue:s.value,"onUpdate:modelValue":N[1]||(N[1]=ie=>s.value=ie),type:"number",class:"w-20 h-8 [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",onInput:m,onKeyup:o.withKeys(c,["enter"])},null,8,["modelValue"])]),o.createElementVNode("div",Zte,[o.createVNode(ae,{"model-value":r.value,"onUpdate:modelValue":[N[2]||(N[2]=ie=>r.value=ie),N[3]||(N[3]=ie=>{r.value=ie})]},{default:o.withCtx(()=>[o.createVNode(X,null,{default:o.withCtx(()=>[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(["25","50","75","100"],ie=>o.createVNode(K,{key:ie,value:ie},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(ie)+"% ",1)]),_:2},1032,["value"])),64))]),_:1})]),_:1},8,["model-value"])])]),_:1})]),_:1},16),o.createVNode(P,{orientation:"vertical",class:"h-5"}),(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(l,(ie,me)=>o.createVNode(U,{key:me,tooltip:o.unref(n)(`editor.textalign.${ie}.tooltip`),icon:u[ie],action:()=>v(ie),disabled:!Y.editor.can().setTextAlign(ie),"is-active":()=>Y.editor.isActive({textAlign:ie})||!1},null,8,["tooltip","icon","action","disabled","is-active"])),64)),o.createVNode(P,{orientation:"vertical",class:"h-5"}),o.createVNode(U,{tooltip:o.unref(n)("editor.remove"),icon:"Trash2",action:x,disabled:!Y.editor.isEditable},null,8,["tooltip","disabled"])],512)])],2)}}}),Nte=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(NV),o.mergeProps(o.unref(s),{class:o.unref(ke)("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(eF),{class:o.normalizeClass(o.unref(ke)("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"]))}}),ene={class:"text-red-500 relative -top-1"},Xc=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(ke)("label-large",e.fieldName.customClass))},[o.createElementVNode("span",null,o.toDisplayString(e.fieldName.label),1),o.withDirectives(o.createElementVNode("span",ene," •",512),[[o.vShow,e.fieldName.isRequired]])],2))}}),$h={__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((J,ee)=>(J[~~ee.id]=ee)&&J,{})),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",x),"ontouchstart"in window&&(document.addEventListener("touchmove",w,{passive:!1}),document.addEventListener("touchend",x))},v=()=>{document.removeEventListener("mousemove",w,{passive:!1}),document.removeEventListener("mouseup",x),"ontouchstart"in window&&(document.removeEventListener("touchmove",w,{passive:!1}),document.removeEventListener("touchend",x))},b=(J,ee)=>{const te=J.target.closest(".splitpanes__splitter");if(te){const{left:se,top:pe}=te.getBoundingClientRect(),{clientX:_e,clientY:Ae}="ontouchstart"in window&&J.touches?J.touches[0]:J;f.value.cursorOffset=r.horizontal?Ae-pe:_e-se}g(),f.value.mouseDown=!0,f.value.activeSplitter=ee},w=J=>{f.value.mouseDown&&(J.preventDefault(),f.value.dragging=!0,requestAnimationFrame(()=>{A(T(J)),ie("resize",{event:J},!0)}))},x=J=>{f.value.dragging&&(window.getSelection().removeAllRanges(),ie("resized",{event:J},!0)),f.value.mouseDown=!1,f.value.activeSplitter=null,setTimeout(()=>{f.value.dragging=!1,v()},100)},C=(J,ee)=>{"ontouchstart"in window&&(J.preventDefault(),p.value.splitter===ee?(clearTimeout(p.value.timeoutId),p.value.timeoutId=null,E(J,ee),p.value.splitter=null):(p.value.splitter=ee,p.value.timeoutId=setTimeout(()=>p.value.splitter=null,500))),f.value.dragging||ie("splitter-click",{event:J,index:ee},!0)},E=(J,ee)=>{if(ie("splitter-dblclick",{event:J,index:ee},!0),r.maximizePanes){let te=0;s.value=s.value.map((se,pe)=>(se.size=pe===ee?se.max:se.min,pe!==ee&&(te+=se.min),se)),s.value[ee].size-=te,ie("pane-maximize",{event:J,index:ee,pane:s.value[ee]}),ie("resized",{event:J,index:ee},!0)}},k=(J,ee)=>{ie("pane-click",{event:J,index:a.value[ee].index,pane:a.value[ee]})},T=J=>{const ee=u.value.getBoundingClientRect(),{clientX:te,clientY:se}="ontouchstart"in window&&J.touches?J.touches[0]:J;return{x:te-(r.horizontal?0:f.value.cursorOffset)-ee.left,y:se-(r.horizontal?f.value.cursorOffset:0)-ee.top}},_=J=>{J=J[r.horizontal?"y":"x"];const ee=u.value[r.horizontal?"clientHeight":"clientWidth"];return r.rtl&&!r.horizontal&&(J=ee-J),J*100/ee},A=J=>{const ee=f.value.activeSplitter;let te={prevPanesSize:O(ee),nextPanesSize:B(ee),prevReachedMinPanes:0,nextReachedMinPanes:0};const se=0+(r.pushOtherPanes?0:te.prevPanesSize),pe=100-(r.pushOtherPanes?0:te.nextPanesSize),_e=Math.max(Math.min(_(J),pe),se);let Ae=[ee,ee+1],Ue=s.value[Ae[0]]||null,We=s.value[Ae[1]]||null;const qe=Ue.max<100&&_e>=Ue.max+te.prevPanesSize,At=We.max<100&&_e<=100-(We.max+B(ee+1));if(qe||At){qe?(Ue.size=Ue.max,We.size=Math.max(100-Ue.max-te.prevPanesSize-te.nextPanesSize,0)):(Ue.size=Math.max(100-We.max-te.prevPanesSize-B(ee+1),0),We.size=We.max);return}if(r.pushOtherPanes){const q=V(te,_e);if(!q)return;({sums:te,panesToResize:Ae}=q),Ue=s.value[Ae[0]]||null,We=s.value[Ae[1]]||null}Ue!==null&&(Ue.size=Math.min(Math.max(_e-te.prevPanesSize-te.prevReachedMinPanes,Ue.min),Ue.max)),We!==null&&(We.size=Math.min(Math.max(100-_e-te.nextPanesSize-te.nextReachedMinPanes,We.min),We.max))},V=(J,ee)=>{const te=f.value.activeSplitter,se=[te,te+1];return ee<J.prevPanesSize+s.value[se[0]].min&&(se[0]=H(te).index,J.prevReachedMinPanes=0,se[0]<te&&s.value.forEach((pe,_e)=>{_e>se[0]&&_e<=te&&(pe.size=pe.min,J.prevReachedMinPanes+=pe.min)}),J.prevPanesSize=O(se[0]),se[0]===void 0)?(J.prevReachedMinPanes=0,s.value[0].size=s.value[0].min,s.value.forEach((pe,_e)=>{_e>0&&_e<=te&&(pe.size=pe.min,J.prevReachedMinPanes+=pe.min)}),s.value[se[1]].size=100-J.prevReachedMinPanes-s.value[0].min-J.prevPanesSize-J.nextPanesSize,null):ee>100-J.nextPanesSize-s.value[se[1]].min&&(se[1]=j(te).index,J.nextReachedMinPanes=0,se[1]>te+1&&s.value.forEach((pe,_e)=>{_e>te&&_e<se[1]&&(pe.size=pe.min,J.nextReachedMinPanes+=pe.min)}),J.nextPanesSize=B(se[1]-1),se[1]===void 0)?(J.nextReachedMinPanes=0,s.value.forEach((pe,_e)=>{_e<l.value-1&&_e>=te+1&&(pe.size=pe.min,J.nextReachedMinPanes+=pe.min)}),s.value[se[0]].size=100-J.prevPanesSize-B(se[0]-1),null):{sums:J,panesToResize:se}},O=J=>s.value.reduce((ee,te,se)=>ee+(se<J?te.size:0),0),B=J=>s.value.reduce((ee,te,se)=>ee+(se>J+1?te.size:0),0),H=J=>[...s.value].reverse().find(ee=>ee.index<J&&ee.size>ee.min)||{},j=J=>s.value.find(ee=>ee.index>J+1&&ee.size>ee.min)||{},Y=()=>{var J;const ee=Array.from(((J=u.value)==null?void 0:J.children)||[]);for(const te of ee){const se=te.classList.contains("splitpanes__pane"),pe=te.classList.contains("splitpanes__splitter");!se&&!pe&&(te.remove(),console.warn("Splitpanes: Only <pane> elements are allowed at the root of <splitpanes>. One of your DOM nodes was removed."))}},N=(J,ee,te=!1)=>{const se=J-1,pe=document.createElement("div");pe.classList.add("splitpanes__splitter"),te||(pe.onmousedown=_e=>b(_e,se),typeof window<"u"&&"ontouchstart"in window&&(pe.ontouchstart=_e=>b(_e,se)),pe.onclick=_e=>C(_e,se+1)),pe.ondblclick=_e=>E(_e,se+1),ee.parentNode.insertBefore(pe,ee)},U=J=>{J.onmousedown=void 0,J.onclick=void 0,J.ondblclick=void 0,J.remove()},P=()=>{var J;const ee=Array.from(((J=u.value)==null?void 0:J.children)||[]);for(const se of ee)se.className.includes("splitpanes__splitter")&&U(se);let te=0;for(const se of ee)se.className.includes("splitpanes__pane")&&(!te&&r.firstSplitter?N(te,se,!0):te&&N(te,se),te++)},L=({uid:J,...ee})=>{const te=a.value[J];for(const[se,pe]of Object.entries(ee))te[se]=pe},F=J=>{var ee;let te=-1;Array.from(((ee=u.value)==null?void 0:ee.children)||[]).some(se=>(se.className.includes("splitpanes__pane")&&te++,se.isSameNode(J.el))),s.value.splice(te,0,{...J,index:te}),s.value.forEach((se,pe)=>se.index=pe),c.value&&o.nextTick(()=>{P(),K({addedPane:s.value[te]}),ie("pane-add",{pane:s.value[te]})})},R=J=>{const ee=s.value.findIndex(se=>se.id===J);s.value[ee].el=null;const te=s.value.splice(ee,1)[0];s.value.forEach((se,pe)=>se.index=pe),o.nextTick(()=>{P(),ie("pane-remove",{pane:te}),K({removedPane:{...te}})})},K=(J={})=>{!J.addedPane&&!J.removedPane?ae():s.value.some(ee=>ee.givenSize!==null||ee.min||ee.max<100)?de(J):X(),c.value&&ie("resized")},X=()=>{const J=100/l.value;let ee=0;const te=[],se=[];for(const pe of s.value)pe.size=Math.max(Math.min(J,pe.max),pe.min),ee-=pe.size,pe.size>=pe.max&&te.push(pe.id),pe.size<=pe.min&&se.push(pe.id);ee>.1&&Ee(ee,te,se)},ae=()=>{let J=100;const ee=[],te=[];let se=0;for(const _e of s.value)J-=_e.size,_e.givenSize!==null&&se++,_e.size>=_e.max&&ee.push(_e.id),_e.size<=_e.min&&te.push(_e.id);let pe=100;if(J>.1){for(const _e of s.value)_e.givenSize===null&&(_e.size=Math.max(Math.min(J/(l.value-se),_e.max),_e.min)),pe-=_e.size;pe>.1&&Ee(pe,ee,te)}},de=({addedPane:J,removedPane:ee}={})=>{let te=100/l.value,se=0;const pe=[],_e=[];(J?.givenSize??null)!==null&&(te=(100-J.givenSize)/(l.value-1));for(const Ae of s.value)se-=Ae.size,Ae.size>=Ae.max&&pe.push(Ae.id),Ae.size<=Ae.min&&_e.push(Ae.id);if(!(Math.abs(se)<.1)){for(const Ae of s.value)J?.givenSize!==null&&J?.id===Ae.id||(Ae.size=Math.max(Math.min(te,Ae.max),Ae.min)),se-=Ae.size,Ae.size>=Ae.max&&pe.push(Ae.id),Ae.size<=Ae.min&&_e.push(Ae.id);se>.1&&Ee(se,pe,_e)}},Ee=(J,ee,te)=>{let se;J>0?se=J/(l.value-ee.length):se=J/(l.value-te.length),s.value.forEach((pe,_e)=>{if(J>0&&!ee.includes(pe.id)){const Ae=Math.max(Math.min(pe.size+se,pe.max),pe.min),Ue=Ae-pe.size;J-=Ue,pe.size=Ae}else if(!te.includes(pe.id)){const Ae=Math.max(Math.min(pe.size+se,pe.max),pe.min),Ue=Ae-pe.size;J-=Ue,pe.size=Ae}}),Math.abs(J)>.1&&o.nextTick(()=>{c.value&&console.warn("Splitpanes: Could not resize panes correctly due to their constraints.")})},ie=(J,ee=void 0,te=!1)=>{const se=ee?.index??f.value.activeSplitter??null;n(J,{...ee,...se!==null&&{index:se},...te&&se!==null&&{prevPane:s.value[se-(r.firstSplitter?1:0)],nextPane:s.value[se+(r.firstSplitter?0:1)]},panes:s.value.map(pe=>({min:pe.min,max:pe.max,size:pe.size}))})};o.watch(()=>r.firstSplitter,()=>P()),o.onMounted(()=>{Y(),P(),K(),ie("ready"),c.value=!0}),o.onBeforeUnmount(()=>c.value=!1);const me=()=>{var J;return o.h("div",{ref:u,class:m.value},(J=i.default)==null?void 0:J.call(i))};return o.provide("panes",s),o.provide("indexedPanes",a),o.provide("horizontal",o.computed(()=>r.horizontal)),o.provide("requestUpdate",L),o.provide("onPaneAdd",F),o.provide("onPaneRemove",R),o.provide("onPaneClick",k),(J,ee)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(me)))}},Xo={__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,v.value),g.value)}),g=o.computed(()=>{const w=parseFloat(n.minSize);return isNaN(w)?0:w}),v=o.computed(()=>{const w=parseFloat(n.maxSize);return isNaN(w)?100:w}),b=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(()=>v.value,w=>r({uid:u,max:w})),o.onMounted(()=>{i({id:u,el:p.value,min:g.value,max:v.value,givenSize:n.size===void 0?null:m.value,size:m.value})}),o.onBeforeUnmount(()=>a(u)),(w,x)=>(o.openBlock(),o.createElementBlock("div",{ref_key:"paneEl",ref:p,class:"splitpanes__pane",onClick:x[0]||(x[0]=C=>o.unref(l)(C,w._.uid)),style:o.normalizeStyle(b.value)},[o.renderSlot(w.$slots,"default")],4))}},tne={class:"px-5 py-2.5 flex flex-col h-full"},nne=["innerHTML"],rne={key:0,class:"px-5 py-2.5"},one=["innerHTML"],ine={key:1,class:"px-5 py-2.5"},sne=["innerHTML"],ane={key:2,class:"px-5 py-2.5 flex flex-col flex-1"},lne=["innerHTML"],une={class:"px-5 py-2.5 flex flex-col h-full"},cne=["innerHTML"],dne=o.defineComponent({__name:"EditorViewMobile",props:{extensions:{},mode:{},hideComment:{type:Boolean},fieldNameComment:{},fieldNameCommentCuesheet:{},fieldNameContent:{},comment:{},commentCuesheet:{},content:{},isEditorViewSplitContent:{type:Boolean},contentTextStyle:{},watermarkOverlayComponent:{default:"div"},vbindWatermarkOverlay:{default:()=>({})}},setup(t){const e=t;Gc();const n=o.computed(()=>{const _=e.extensions?.filter(A=>A.name!=="spellchecker")||[];return _.some(A=>A.name==="image")||_.push(jc.configure()),_}),r=o.computed(()=>ra(e.comment)),i=o.computed(()=>ra(e.commentCuesheet)),s=o.computed(()=>ra(e.content));function a(_){return cg(_).replace(/<script\b[\s\S]*?<\/script\s*>/gi,"")}const l=o.computed(()=>r.value?a(e.comment):""),u=o.computed(()=>i.value?a(e.commentCuesheet):""),c=o.computed(()=>s.value?a(e.content):""),f=o.ref(),p=o.ref(),m=o.ref();o.onBeforeUnmount(()=>{f.value&&f.value.destroy(),p.value&&p.value.destroy(),m.value&&m.value.destroy()});function g(_){return new Oo({extensions:n.value,content:_,editable:!1,parseOptions:{preserveWhitespace:"full"}})}r.value||(f.value=g(un(e.comment,!0,e.mode))),i.value||(p.value=g(un(e.commentCuesheet,!0,e.mode))),s.value||(m.value=g(un(e.content,!0,e.mode)));function v(_,A){if(!_)return;const V=un(A,!0,e.mode);St.isEqual(_.getHTML(),V)||_.commands.setContent(V,!1,{preserveWhitespace:"full"})}o.watch(()=>e.comment,_=>{r.value||v(f.value,_)}),o.watch(()=>e.commentCuesheet,_=>{i.value||v(p.value,_)}),o.watch(()=>e.content,_=>{s.value||v(m.value,_)});const{isScrolling:b,handleScroll:w}=Xl(),{isScrolling:x,handleScroll:C}=Xl(),E=o.computed(()=>e.mode!==Te.EDITOR?!0:!e.hideComment),k=o.computed(()=>e.mode!==Te.REPORT?!0:e.mode===Te.REPORT&&!e.hideComment),T=o.computed(()=>e.mode===Te.STRAIGHT||e.mode===Te.PLAIN_TEXT||!E.value);return(_,A)=>{const V=Xc;return o.openBlock(),o.createBlock(o.unref($h),{horizontal:"",class:o.normalizeClass(o.unref(ke)("flex-1 text-sm",_.contentTextStyle))},{default:o.withCtx(()=>[o.unref(T)?(o.openBlock(),o.createBlock(o.unref(Xo),{key:0,class:o.normalizeClass(o.unref(ke)("!overflow-y-auto border border-ed-gray rounded-md",!_.isEditorViewSplitContent&&"border-none",!o.unref(x)&&"scrollbar-thumb-transparent")),onScroll:o.unref(C)},{default:o.withCtx(()=>[o.createElementVNode("div",tne,[_.fieldNameContent?(o.openBlock(),o.createBlock(V,{key:0,"field-name":_.fieldNameContent,class:"leading-7 font-medium text-blue-500"},null,8,["field-name"])):o.createCommentVNode("",!0),(o.openBlock(),o.createBlock(o.resolveDynamicComponent(_.watermarkOverlayComponent),o.normalizeProps(o.guardReactiveProps(_.vbindWatermarkOverlay)),{default:o.withCtx(()=>[o.unref(s)?(o.openBlock(),o.createElementBlock("div",{key:0,class:"ProseMirror",innerHTML:o.unref(c)},null,8,nne)):(o.openBlock(),o.createBlock(o.unref(Yn),{key:1,editor:o.unref(m)},null,8,["editor"]))]),_:1},16))])]),_:1},8,["class","onScroll"])):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.unref(E)?(o.openBlock(),o.createBlock(o.unref(Xo),{key:0,class:o.normalizeClass(o.unref(ke)("!overflow-y-auto border border-ed-gray rounded-md",!_.isEditorViewSplitContent&&"border-none",!o.unref(b)&&"scrollbar-thumb-transparent")),onScroll:o.unref(w)},{default:o.withCtx(()=>[o.createElementVNode("div",{class:o.normalizeClass(o.unref(ke)("divide-y divide-ed-gray divide-dashed flex flex-col h-full"))},[o.unref(k)?(o.openBlock(),o.createElementBlock("div",rne,[_.fieldNameComment?(o.openBlock(),o.createBlock(V,{key:0,"field-name":_.fieldNameComment,class:"leading-7 font-medium text-blue-500"},null,8,["field-name"])):o.createCommentVNode("",!0),(o.openBlock(),o.createBlock(o.resolveDynamicComponent(_.watermarkOverlayComponent),o.normalizeProps(o.guardReactiveProps(_.vbindWatermarkOverlay)),{default:o.withCtx(()=>[o.unref(r)?(o.openBlock(),o.createElementBlock("div",{key:0,class:"ProseMirror",innerHTML:o.unref(l)},null,8,one)):(o.openBlock(),o.createBlock(o.unref(Yn),{key:1,editor:o.unref(f)},null,8,["editor"]))]),_:1},16))])):o.createCommentVNode("",!0),_.mode===o.unref(Te).REPORT?(o.openBlock(),o.createElementBlock("div",ine,[_.fieldNameCommentCuesheet?(o.openBlock(),o.createBlock(V,{key:0,"field-name":_.fieldNameCommentCuesheet,class:"leading-7 font-medium text-blue-500"},null,8,["field-name"])):o.createCommentVNode("",!0),(o.openBlock(),o.createBlock(o.resolveDynamicComponent(_.watermarkOverlayComponent),o.normalizeProps(o.guardReactiveProps(_.vbindWatermarkOverlay)),{default:o.withCtx(()=>[o.unref(i)?(o.openBlock(),o.createElementBlock("div",{key:0,class:"ProseMirror",innerHTML:o.unref(u)},null,8,sne)):(o.openBlock(),o.createBlock(o.unref(Yn),{key:1,editor:o.unref(p)},null,8,["editor"]))]),_:1},16))])):o.createCommentVNode("",!0),_.isEditorViewSplitContent?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",ane,[_.fieldNameContent?(o.openBlock(),o.createBlock(V,{key:0,"field-name":_.fieldNameContent,class:"leading-7 font-medium text-blue-500"},null,8,["field-name"])):o.createCommentVNode("",!0),(o.openBlock(),o.createBlock(o.resolveDynamicComponent(_.watermarkOverlayComponent),o.normalizeProps(o.guardReactiveProps(_.vbindWatermarkOverlay)),{default:o.withCtx(()=>[o.unref(s)?(o.openBlock(),o.createElementBlock("div",{key:0,class:"ProseMirror",innerHTML:o.unref(c)},null,8,lne)):(o.openBlock(),o.createBlock(o.unref(Yn),{key:1,editor:o.unref(m)},null,8,["editor"]))]),_:1},16))]))],2)]),_:1},8,["class","onScroll"])):o.createCommentVNode("",!0),_.isEditorViewSplitContent?(o.openBlock(),o.createBlock(o.unref(Xo),{key:1,class:o.normalizeClass(o.unref(ke)("!overflow-y-auto border border-ed-gray rounded-md",!o.unref(x)&&"scrollbar-thumb-transparent")),onScroll:o.unref(C)},{default:o.withCtx(()=>[o.createElementVNode("div",une,[_.fieldNameContent?(o.openBlock(),o.createBlock(V,{key:0,"field-name":_.fieldNameContent,class:"leading-7 font-medium text-blue-500"},null,8,["field-name"])):o.createCommentVNode("",!0),(o.openBlock(),o.createBlock(o.resolveDynamicComponent(_.watermarkOverlayComponent),o.normalizeProps(o.guardReactiveProps(_.vbindWatermarkOverlay)),{default:o.withCtx(()=>[o.unref(s)?(o.openBlock(),o.createElementBlock("div",{key:0,class:"ProseMirror",innerHTML:o.unref(c)},null,8,cne)):(o.openBlock(),o.createBlock(o.unref(Yn),{key:1,editor:o.unref(m)},null,8,["editor"]))]),_:1},16))])]),_:1},8,["class","onScroll"])):o.createCommentVNode("",!0)],64))]),_:1},8,["class"])}}}),fne={class:"flex gap-2 items-center overflow-x-auto"},xS=o.defineComponent({__name:"ToolbarMobile",props:{editor:{},disabled:{type:Boolean,default:!1},mode:{},activeExtensions:{default:()=>[Lc,ki,tb]},customClassToolbar:{}},setup(t){const{t:e}=Pt(),n=t,r=o.inject("isEditable",o.ref(!0)),i=o.computed(()=>{const u=[...n.editor.extensionManager.extensions],c=u.find(m=>m.name===tb);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:v=!1,spacer:b=!1,toolbar:w=!0}=m.options;if(!g||!pg(g)||!w)continue;const x=g({editor:n.editor,extension:m,t:o.unref(e),isMobile:!0});if(Array.isArray(x)){const C=x.map((E,k)=>({id:`${m.name}`,button:E,divider:k===x.length-1?v:!1,spacer:k===0?b:!1}));p=[...p,...C];continue}p.push({button:x,divider:v,spacer:b,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=wS;return o.openBlock(),o.createElementBlock("div",{id:"tool-bar",class:o.normalizeClass(o.unref(ke)("z-10 border border-ed-input rounded-[5px] px-2.5 py-[5px] leading-none",!i.value.length&&"hidden",u.customClassToolbar))},[o.createElementVNode("div",fne,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.value,(p,m)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:m},[p.spacer&&m!==0?(o.openBlock(),o.createBlock(o.unref(wo),{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||p.button.componentProps?.disabled,"custom-class":s(p),icon:a(p)}),o.createSlots({_:2},[o.renderList(p.button.componentSlots,(g,v,b)=>({name:`${v}`,fn:o.withCtx(w=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(g),o.mergeProps({ref_for:!0},w?.props,{id:p.id}),null,16,["id"]))])}))]),1040,["id","editor","disabled","custom-class","icon"])),p.id===ki&&o.unref(l)?(o.openBlock(),o.createBlock(f,{key:1,class:"bg-white border-inherit w-[26px] h-[26px] shadow-none",checked:p.button.componentProps.isActive?.(),"onUpdate:checked":g=>p.button.componentProps.action?.()},null,8,["checked","onUpdate:checked"])):o.createCommentVNode("",!0),p.divider?(o.openBlock(),o.createBlock(o.unref(wo),{key:2,orientation:"vertical",class:"mx-2 h-auto"})):o.createCommentVNode("",!0)],64))),128))])],2)}}}),pne={class:"flex w-fit rounded-md bg-ed-gray-600 text-white text-sm max-w-full overflow-x-auto"},hne=Xr(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}=Pt(),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=OJ(n.editor);n.editor.commands.setSuperTextContent(f)};return(f,p)=>(o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createElementVNode("div",pne,[o.unref(s)&&!f.disableSuperInput&&f.mode!==o.unref(Te).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]=m=>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]=m=>(f.editor.chain().focus().pasteContent().run(),r("close-long-press-menu")))},o.toDisplayString(o.unref(i)("editor.paste")),1)):o.createCommentVNode("",!0),o.createElementVNode("button",{class:"bubble-menu-item",onClick:p[2]||(p[2]=m=>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]=m=>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(o.unref(l)?.component),{"is-open":o.unref(a),open:o.unref(a),class:o.normalizeClass(o.unref(l)?.componentProps?.class),onSelectedChar:u,onClose:p[5]||(p[5]=m=>a.value=!1)},null,40,["is-open","open","class"]))]))],64))}}),[["__scopeId","data-v-b4e2ce28"]]),CS=o.defineComponent({__name:"MainBubbleMenu",props:{editor:{},mode:{},disableSuperInput:{type:Boolean}},setup(t){const e=t,n=new dg,r=o.ref(!1),i=async()=>{const m=await e.editor.hasClipboard?.();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:v,to:b}=g.selection,w=m.dom.getBoundingClientRect(),x=m.coordsAtPos(v),C=m.coordsAtPos(b),E=Math.min(x.top,C.top),T=Math.max(x.bottom,C.bottom)-E;return new DOMRect(w.left,E,w.width,T)}return null}},a=o.ref(null),l=o.ref(!1),u=({editor:m,state:g})=>{if(e.editor.storage.deviceEnv.isForceCloseBubble||e.editor.isActive("link"))return!1;const{selection:v}=g,b=!v.empty&&Kd(v)||l.value;return b&&m.extensionStorage.spellchecker.spellchecker.hideSuggestionBox(),b};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 v=e.editor.view,b=v.state,w=v.posAtCoords({left:g.x,top:g.y});if(!w||w.inside===-1)return;const x=w.pos,C=b.doc.content.size,E=Math.min(x+1,C);let k=b.tr;k=k.setSelection(Ie.create(b.doc,x,E)),v.dispatch(k),requestAnimationFrame(()=>{const T=v.state.tr.setSelection(Ie.create(v.state.doc,x,x));v.dispatch(T),v.focus()})}return o.onMounted(()=>{const m=e.editor.view.dom;ct.onLongPress(o.ref(m),b=>{l.value=!0,p(b)},{delay:500,modifiers:{prevent:!1}});const g=()=>{e.editor.state.selection.empty&&(l.value=!1)};m.addEventListener("pointerdown",g);const v=({transaction:b})=>{l.value&&b.docChanged&&(l.value=!1,o.nextTick(()=>{try{const w=a.value?.$el;w&&w._tippy&&typeof w._tippy.hide=="function"&&w._tippy.hide()}catch{const x=e.editor.view,C=x.state,E=C.selection.from,k=C.doc.content.size,T=Math.min(E+1,k);x.dispatch(C.tr.setSelection(Ie.create(C.doc,E,T))),requestAnimationFrame(()=>{x.dispatch(x.state.tr.setSelection(Ie.create(x.state.doc,E,E)))})}}))};e.editor.on("transaction",v),o.onUnmounted(()=>{m.removeEventListener("pointerdown",g),e.editor.off("transaction",v)})}),(m,g)=>(o.openBlock(),o.createBlock(o.unref(Wu),{ref_key:"bubbleMenuRef",ref:a,editor:m.editor,"tippy-options":s,"should-show":u},{default:o.withCtx(()=>[o.createVNode(hne,{editor:m.editor,mode:m.mode,disableSuperInput:m.disableSuperInput,hasClipboard:o.unref(r),onCloseLongPressMenu:g[0]||(g[0]=v=>l.value=!1)},null,8,["editor","mode","disableSuperInput","hasClipboard"])]),_:1},8,["editor"]))}}),mne={class:"flex items-center justify-between label-large mb-2"},gne={class:"mb-5"},vne={class:"flex gap-x-3"},bne=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(()=>zc(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)=>{const g=Ot;return o.openBlock(),o.createBlock(o.resolveDynamicComponent(p.bottomSheetComponent?.component),{"is-open":p.open,type:"bottom",title:"수퍼 입력","custom-class-content":"px-[12px]",onOnClose:u},{customContent:o.withCtx(()=>[o.createElementVNode("div",mne,[m[2]||(m[2]=o.createElementVNode("span",null,"내용",-1)),(o.openBlock(),o.createBlock(o.resolveDynamicComponent(p.bottomSheetComponent?.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",gne,[o.createVNode(Eb,{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(()=>[o.createElementVNode("div",vne,[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(p.bottomSheetComponent?.button),{variant:"outline",onClick:u},{default:o.withCtx(()=>m[3]||(m[3]=[o.createTextVNode(" 취소 ")])),_:1})),(o.openBlock(),o.createBlock(o.resolveDynamicComponent(p.bottomSheetComponent?.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"])}}}),kS=Fn.create({name:"diffDel",parseHTML(){return[{tag:"span.diff-del"}]},renderHTML({HTMLAttributes:t}){return["span",{class:"diff-del",...t},0]}});function ES(t=100){let e=null,n=0;function r(l){n=l}function i(l){let u=l?.parentElement;for(;u;){if(u.id==="comment-wrap-scroll"){u=u.parentElement;continue}const f=getComputedStyle(u).overflowY;if(f==="auto"||f==="scroll")return u;u=u.parentElement}return window}function s(l){e&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{const{view:u,state:c}=l,{from:f}=c.selection,p=u.coordsAtPos(f),m=i(u.dom),g=o.unref(t);if(m===window){const k=window.innerHeight-g,T=p.top-k;T>0&&window.scrollBy({top:T,behavior:"smooth"});return}const v=m,b=v.getBoundingClientRect(),w=p.top-b.top,x=v.clientHeight-g,C=w-x;C>0&&v.scrollBy({top:C,behavior:"smooth"})})}function a(l){requestAnimationFrame(()=>{const{view:u,state:c}=l,{from:f}=c.selection,p=u.coordsAtPos(f),m=i(u.dom),g=o.unref(t);if(m===window){const _=window.innerHeight,A=_-n-g;if(!(p.top>A))return;const O=_-g,B=p.top-O;B>0&&window.scrollBy({top:B,behavior:"smooth"});return}const v=m,b=v.getBoundingClientRect(),w=p.top-b.top,x=v.clientHeight,C=x-n-g;if(!(w>C))return;const k=x-g,T=w-k;T>0&&v.scrollBy({top:T,behavior:"smooth"})})}return{onTypingScrollCaretNearBottom:s,onKeyboardShowScrollNearBottom:a,setKeyboardHeight:r}}const yne=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:{},fontWeightDefault:{},showSuperElementIdColor:{type:Boolean},letterSpacingDefault:{},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:{},toolbarExtensionOrder:{},watermarkOverlay:{},bottomOffset:{},characterCountLimit:{},blockSeparatorPolicy:{},fixedSuperPreviewWidth:{type:Boolean}},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=bn(),{isReady:l,editor:u,updateEditorState:c,checkSpellStore:f}=a,{onTypingScrollCaretNearBottom:p}=ES(r.bottomOffset),m=o.inject("isEditable",o.ref(!0)),g=new Oo({enablePasteRules:!1,enableInputRules:!1,content:un(r.modelValue,r.disabled),editorProps:{attributes:{id:ir.COMMENT,[ir.DISABLE_SUPER_INPUT]:`${r.disableSuperInput}`},handleKeyDown:St.throttle((C,E)=>E.key==="Enter"&&s.enter&&!E.shiftKey?(i("enter"),!0):!1,Lo),transformPastedHTML:C=>(C=C.replace(/\s*style="[^"]*"/g,""),C),handlePaste(C,E){const k=E.clipboardData?.getData("text/plain")||"";return r.mode===Te.EDITOR&&Wb(k)?(E.preventDefault(),jb(C,k.trim())):!1}},onCreate:({editor:C})=>{c(C)},onUpdate:St.throttle(({editor:C})=>{l.value=!0;const E=b(C,r.output);i("update:modelValue",E),i("change",{editor:C,output:E}),c(C)},Lo),extensions:[kS,...St.uniqBy(r.extensions,"name")],editable:m.value,onFocus:()=>{v()},onBlur:({editor:C,event:E})=>{i("onBlurEditor",E)},onSelectionUpdate:({editor:C})=>{C.isFocused&&p(C)}});function v(){i("setEditorSelected",g)}v();function b(C,E){if(!C)return"";if(C.isEmpty)return E==="json"?{}:"";switch(E){case"html":return mg(C,{removeNodes:[Bc,Ci]});case"json":return C.getJSON();case"text":return C.getText();default:return""}}function w(C){return C.every(E=>g?.extensionManager.extensions.find(k=>k.name===E))}o.watch(()=>f.languages,()=>{g.commands.checkSpelling()}),o.watch(()=>r.modelValue,C=>{if(!g||St.isEqual(b(g,r.output),C))return;const{from:E,to:k}=g.state.selection;g.commands.setTextSelection({from:E,to:k}),g.commands.setContent(un(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,()=>{document.getElementById(ir.COMMENT)?.setAttribute(ir.DISABLE_SUPER_INPUT,`${r.disableSuperInput}`)}),o.onUnmounted(()=>g?.destroy()),Ju(ju.SAVE,()=>{localStorage.setItem("comment",b(g,"html"))});function x(C){g.commands.focus("end"),v()}return Ph(g),o.onMounted(()=>{r.autoFocus&&x(r.mode),g?.commands?.setIsMobile&&g.commands.setIsMobile(!0)}),o.watch(()=>r.mode,C=>{r.autoFocus&&x()}),o.watch(()=>m.value,C=>{g?.setEditable(C),g?.commands?.setIsEnableSuggestion&&g.commands.setIsEnableSuggestion(C)},{immediate:!0}),e({editor:g}),(C,E)=>{const k=CS,T=Dh,_=Rh,A=Lh;return o.openBlock(),o.createElementBlock(o.Fragment,null,[!C.hideBubble&&!C.disabled&&o.unref(m)?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createVNode(k,{editor:o.unref(g),mode:C.mode,"disable-super-input":C.disableSuperInput},null,8,["editor","mode","disable-super-input"]),w([o.unref(Ic)])?(o.openBlock(),o.createBlock(T,{key:0,editor:o.unref(g)},null,8,["editor"])):o.createCommentVNode("",!0),w([o.unref(_a)])?(o.openBlock(),o.createBlock(_,{key:1,editor:o.unref(g)},null,8,["editor"])):o.createCommentVNode("",!0),w([o.unref(Ss)])?(o.openBlock(),o.createBlock(A,{key:2,editor:o.unref(g)},null,8,["editor"])):o.createCommentVNode("",!0)],64)):o.createCommentVNode("",!0),o.createVNode(o.unref(Yn),{id:"editor-panel",editor:o.unref(g),spellcheck:"true",class:"flex-1 relative"},null,8,["editor"])],64)}}}),SS=o.defineComponent({__name:"ToolbarTitle",props:{titleBar:{},customClass:{}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("h3",{class:o.normalizeClass(o.unref(ke)("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 _S(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 v=g[0].size,b=g[1].size;u.value=v,c.value=b,v>n&&!a.value&&(a.value=!0),b>n&&!l.value&&(l.value=!0),v<=s&&a.value&&(a.value=!1),b<=s&&l.value&&(l.value=!1)}}}}const wne={class:"flex justify-between items-center relative gap-x-3"},xne={class:"flex items-center gap-x-4"},Yc=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:""},fontWeightDefault:{default:void 0},showSuperElementIdColor:{type:Boolean},letterSpacingDefault:{default:""},contentTextStyle:{default:""},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:{},toolbarExtensionOrder:{},watermarkOverlay:{},bottomOffset:{},characterCountLimit:{},blockSeparatorPolicy:{},fixedSuperPreviewWidth:{type:Boolean}},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;Gc();const s=new dg;o.provide("isMobile",!0),ct.useEventBus(ur.INCREASE_DECREASE_FONTSIZE);const a=o.useAttrs(),l=bn(),{state:u,isFullscreen:c,isReady:f,editor:p,updateEditorState:m,checkSpellStore:g,setImageAttachment:v,setEditorContentMobile:b,footerTargetRef:w}=l,{markAsFocused:x,insertHtml:C}=Fee(),E=o.computed(()=>r.isShowFormatControlBar&&r.mode===Te.EDITOR&&B&&!r.isEditorView),k=o.computed(()=>E.value?100:40),T=o.ref(!1),{onTypingScrollCaretNearBottom:_,onKeyboardShowScrollNearBottom:A,setKeyboardHeight:V}=ES(k);function O(){s.isNativeWebViewAvailable()&&(s.receiveDataFromNative(ag.KEYBOARD_DID_SHOW,$=>{T.value=!0,V($.height),setTimeout(()=>{F.value?.isFocused&&A(F.value)},50)}),s.receiveDataFromNative(ag.KEYBOARD_DID_HIDE,()=>{T.value=!1}))}const B=o.ref(!r.disabled&&!r.readonly);o.provide("isEditable",B);const H=o.ref(r.fontSizeDefault),j=o.ref(r.fontFamilyDefault),Y=o.ref(r.fontWeightDefault),N=o.ref(r.letterSpacingDefault);o.provide("fontSize",H),o.provide("fontFamily",j),o.provide("fontWeight",Y),o.provide("letterSpacing",N),o.provide("showSuperElementIdColor",o.computed(()=>r.showSuperElementIdColor??!1));const U=o.computed(()=>({...o.unref(c)?{height:"100%"}:{minHeight:r.minHeight?Yt(r.minHeight):void 0,maxHeight:r.maxHeight?Yt(r.maxHeight):void 0,height:r.height?Yt(r.height):void 0},maxWidth:Yt(r.maxWidth),width:r.maxWidth?"100%":void 0,margin:r.maxWidth?"0 auto":void 0})),P=new Oo({coreExtensionOptions:{clipboardTextSerializer:{blockSeparator:r.blockSeparatorPolicy==="line"?`
|
|
355
355
|
`:`
|
|
356
356
|
|
|
357
357
|
`}},enablePasteRules:!1,enableInputRules:!1,content:un(r.modelValue,r.disabled,r.mode),editorProps:{handleKeyDown:St.throttle(($,ne)=>ne.key==="Enter"&&a.enter&&!ne.shiftKey?(i("enter"),!0):!1,Lo),transformPastedHTML:$=>($=$.replace(/\s*style="[^"]*"/g,""),$),handlePaste($,ne){const oe=ne.clipboardData?.getData("text/plain")||"";return r.mode===Te.EDITOR&&Wb(oe)?(ne.preventDefault(),jb($,oe.trim())):r.mode===Te.PLAIN_TEXT?(ne.preventDefault(),pte($,oe)):!1}},onCreate:({editor:$})=>{m($)},onUpdate:St.throttle(({editor:$})=>{f.value=!0;const ne=ae($,r.output);i("update:modelValue",ne),i("change",{editor:$,output:ne}),m($),L($)},Lo),extensions:St.uniqBy(cE(r.extensions,r),"name"),editable:B.value,onFocus:$=>{K(),i("onFocus",$),x()},onBlur:$=>i("onBlur",$),parseOptions:{preserveWhitespace:"full"},onSelectionUpdate:({editor:$})=>{$.isFocused&&_($)}});function L($){const ne=[];$.state.doc.descendants(oe=>{oe.type.name==="image"&&ne.push({id:oe.attrs.id,src:oe.attrs.src})}),v(ne)}const F=o.ref(),{isShowToolBarBaseOnEditor:R}=$ee();o.onMounted(()=>{K(P),b(P),O()});function K($){F.value=$??P,l.setEditorSelectedMobile(F.value)}const X=o.computed(()=>P.storage.superText.isShowSuperInputMoblie);function ae($,ne){if(!$)return"";if($.isEmpty)return ne==="json"?{}:"";if(r.mode===Te.PLAIN_TEXT)return $.getText({blockSeparator:`
|
|
358
358
|
`});switch(ne){case"html":return mg($,{removeNodes:[Bc,Ci]});case"json":return $.getJSON();case"text":return $.getText({blockSeparator:`
|
|
359
|
-
`});default:return""}}function de($){return $.every(ne=>P?.extensionManager.extensions.find(oe=>oe.name===ne))}o.watch(()=>g.languages,()=>{P.commands.checkSpelling()}),o.watch(()=>r.modelValue,$=>{if(!P||St.isEqual(ae(P,r.output),$))return;const{from:ne,to:oe}=P.state.selection;P.commands.setTextSelection({from:ne,to:oe}),P.commands.setContent(un($,r.disabled,r.mode),!1,{preserveWhitespace:"full"})},{deep:!0}),o.watch([()=>r.disabled,()=>r.readonly],()=>{B.value=!r.disabled&&!r.readonly},{immediate:!0}),o.watch(()=>B.value,$=>{P?.setEditable($),P?.commands?.setIsEnableSuggestion&&P.commands.setIsEnableSuggestion($)},{immediate:!0}),o.watch(()=>p.value,()=>{p.value&&p.value.on("selectionUpdate",({editor:$})=>{i("changed:selection",{editor:$})})}),o.onUnmounted(()=>{P?.destroy(),F.value?.destroy()}),Ju(ju.SAVE,()=>{localStorage.setItem("content",ae(P,"html"))});const Ee=($,ne)=>{const oe=P;if(oe){if(ne){const we=oe.state.doc.nodeAt(+ne),{[rt.ELEMENT_ID]:$e,...et}=we?.attrs||{};oe.view.dispatch(oe.state.tr.setNodeMarkup(+ne,void 0,{...et,[rt.TEXT]:$}))}else{const{from:we}=oe.view.state.selection;oe.commands.insertContentAt(we,{type:"superText",attrs:{"data-id":$r(6),"data-text":$}})}oe.commands.toggleSuperInputMoblie(),oe.storage.superText.addToast({type:"success",message:"수퍼가 수정되었습니다"})}},ie=$=>{const ne=F.value??P;if(ne){const{from:oe}=ne.view.state.selection;ne.commands.insertContentAt(oe,{type:"configPlan",attrs:{"data-id":$r(6),"data-text":$}})}F.value?.commands.toggleConfigPlanInput()};function me($){$===Te.STRAIGHT&&P.commands.focus("end"),$===Te.EDITOR&&P.commands.focus("end")}const J=o.computed(()=>B.value&&r.mode===Te.STRAIGHT||B.value&&r.mode===Te.REPORT);o.onMounted(()=>{r.autoFocus&&me(r.mode),P?.commands?.setIsMobile&&P.commands.setIsMobile(!0),B.value&&P.storage.superText?.enable&&P.commands.toggleSuperTextView()}),o.watch(()=>r.mode,$=>{r.autoFocus&&me($)});const ee=P.extensionManager.extensions.find($=>$.name==="superText")?.options.bottomSheetComponent,te=o.computed(()=>{const $=r.mode===Te.REPORT,ne=r.mode===Te.EDITOR&&r.isScreenSplit,oe=!r.hideComment;return($||ne)&&oe}),se=o.computed(()=>!te.value),{HEADER_ONLY_SIZE:pe,pane1ContentVisible:_e,pane2ContentVisible:Ae,pane1Size:Ue,pane2Size:We,togglePane:qe,handlePaneResize:At}=_S(se);function q(){if(!r.contentAutoCopied)return;const $=HT(r.contentAutoCopied,".super-text");C(P,$)}const{isScrolling:z,handleScroll:he}=Xl(),xe=o.ref(null);e({editor:P});const Pe=o.computed(()=>r.watermarkOverlay?.component||"div"),nt=o.computed(()=>{const $=!!r.watermarkOverlay?.props?.text,ne=Pe.value==="div";return{...r.watermarkOverlay?.props,...($||ne)&&{class:"flex-1 flex flex-col"}}}),Ke=o.computed(()=>{const{selection:$}=F.value?.state;return $ instanceof Re&&$.node.type.name==="image"});return($,ne)=>{const oe=CS,we=Dh,$e=Rh,et=Lh,Tt=xS,ue=dne,je=Mc,re=Nte,Me=Ot,Ve=mn,it=Qte,tt=Kte;return o.openBlock(),o.createElementBlock(o.Fragment,null,[o.unref(F)?(o.openBlock(),o.createElementBlock("div",{key:0,id:"vdc-editor",style:o.normalizeStyle(o.unref(U)),class:o.normalizeClass(o.unref(ke)("vdc-editor mobile relative w-full flex flex-col",!r.height&&"flex-1",$.editorClass,$.disabled&&"disabled",$.mode!==o.unref(Te).EDITOR&&$.isShowLineNumber&&"editor-line",$.isEditorView&&"overflow-y-auto"))},[!$.hideBubble&&!$.disabled&&o.unref(B)?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createVNode(oe,{editor:o.unref(P),mode:$.mode},null,8,["editor","mode"]),de([o.unref(Ic)])?(o.openBlock(),o.createBlock(we,{key:0,editor:o.unref(P)},null,8,["editor"])):o.createCommentVNode("",!0),de([o.unref(_a)])?(o.openBlock(),o.createBlock($e,{key:1,editor:o.unref(P)},null,8,["editor"])):o.createCommentVNode("",!0),de([o.unref(Ss)])?(o.openBlock(),o.createBlock(et,{key:2,editor:o.unref(P)},null,8,["editor"])):o.createCommentVNode("",!0)],64)):o.createCommentVNode("",!0),!$.hideToolbar&&!r.isEditorView?(o.openBlock(),o.createBlock(Tt,{key:1,editor:o.unref(P),mode:$.mode,disabled:$.disabled,class:"mb-[3px]","custom-class-toolbar":$.customClassToolbar,"active-extensions":$.mode===o.unref(Te).EDITOR?[ki]:void 0},null,8,["editor","mode","disabled","custom-class-toolbar","active-extensions"])):o.createCommentVNode("",!0),r.isEditorView?(o.openBlock(),o.createBlock(ue,{key:2,"is-editor-view-split-content":r.isEditorViewSplitContent,extensions:$.extensions,mode:$.mode,"hide-comment":$.hideComment,"field-name-comment":$.fieldNameComment,"field-name-comment-cuesheet":$.fieldNameCommentCuesheet,"field-name-content":$.fieldNameContent,comment:$.comment,"comment-cuesheet":$.commentCuesheet,content:$.modelValue,"content-text-style":$.contentTextStyle,"watermark-overlay-component":o.unref(Pe),"vbind-watermark-overlay":o.unref(nt)},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","watermark-overlay-component","vbind-watermark-overlay"])):(o.openBlock(),o.createBlock(o.unref($h),{key:3,class:o.normalizeClass(o.unref(ke)("flex-1 basis-0")),horizontal:"",onResize:o.unref(At)},{default:o.withCtx(()=>[o.unref(te)?(o.openBlock(),o.createBlock(o.unref(Xo),{key:0,size:o.unref(Ue),"min-size":o.unref(pe),class:"flex flex-col min-h-8"},{default:o.withCtx(()=>[$.titleBarComment?.title?(o.openBlock(),o.createBlock(SS,{key:0,"title-bar":$.titleBarComment,class:"mb-[3px]"},null,8,["title-bar"])):o.createCommentVNode("",!0),$.fieldNameComment?.label?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(o.unref(ke)("flex justify-between items-center mb-1"))},[o.createVNode(Xc,{"field-name":$.fieldNameComment,class:"py-1.5"},null,8,["field-name"]),$.isAccordion?(o.openBlock(),o.createElementBlock("button",{key:0,onClick:ne[0]||(ne[0]=bt=>o.unref(qe)("pane1")),class:"p-1.5 active:bg-ed-accent"},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(o.unref(_e)?o.unref(k1):o.unref(uc)),{class:"h-5 w-5"}))])):o.createCommentVNode("",!0)],2)):o.createCommentVNode("",!0),o.withDirectives(o.createElementVNode("div",{id:"comment-wrap-scroll",class:o.normalizeClass(o.unref(ke)("flex-1 !overflow-y-auto overflow-x-hidden basis-0 flex h-full flex-col text-sm",!o.unref(z)&&"scrollbar-thumb-transparent",$.contentClass,$.contentTextStyle)),onScroll:ne[2]||(ne[2]=(...bt)=>o.unref(he)&&o.unref(he)(...bt))},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(o.unref(Pe)),o.normalizeProps(o.guardReactiveProps(o.unref(nt))),{default:o.withCtx(()=>[o.createVNode(yne,{ref:"editorCommentRef",mode:$.mode,extensions:$.extensions,"model-value":r.comment,disabled:r.disabled,"disable-super-input":$.disableSuperInput,"field-name-comment":$.fieldNameComment,"is-show-format-control-bar":$.isShowFormatControlBar,"auto-focus":$.autoFocus,"bottom-offset":o.unref(k),"onUpdate:modelValue":ne[1]||(ne[1]=bt=>i("update:comment",bt)),onSetEditorSelected:K},null,8,["mode","extensions","model-value","disabled","disable-super-input","field-name-comment","is-show-format-control-bar","auto-focus","bottom-offset"])]),_:1},16)),o.unref(E)?(o.openBlock(),o.createElementBlock("div",{key:0,ref_key:"formatToolbarTargetRef",ref:xe,class:o.normalizeClass(o.unref(ke)("sticky bottom-0 z-[12] min-h-[58px]",o.unref(T)&&"fixed inset-x-2.5",o.unref(Ae)&&"hidden"))},null,2)):o.createCommentVNode("",!0)],34),[[o.vShow,o.unref(_e)]])]),_:1},8,["size","min-size"])):o.createCommentVNode("",!0),o.createVNode(o.unref(Xo),{size:o.unref(We),"min-size":o.unref(pe),class:o.normalizeClass(o.unref(ke)("flex flex-col min-h-8")),style:{overflow:"unset"}},{default:o.withCtx(()=>[$.titleBarContent?.title?(o.openBlock(),o.createBlock(SS,{key:0,"title-bar":$.titleBarContent,class:"mb-[3px]"},null,8,["title-bar"])):o.createCommentVNode("",!0),o.createElementVNode("div",wne,[$.fieldNameContent?.label?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(o.unref(ke)("flex justify-between items-center mb-1 flex-1"))},[o.createVNode(Xc,{"field-name":$.fieldNameContent,class:"py-1.5"},null,8,["field-name"]),o.createElementVNode("div",xne,[o.unref(J)?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(o.unref(ke)("flex items-center"))},[o.createVNode(je,{for:"superView",class:"body-medium p-2"},{default:o.withCtx(()=>ne[7]||(ne[7]=[o.createTextVNode("수퍼")])),_:1}),o.createVNode(re,{id:"superView",checked:o.unref(P).storage.superText.enable,class:"data-[state=checked]:bg-blue-500","onUpdate:checked":ne[3]||(ne[3]=bt=>o.unref(P).commands.toggleSuperTextView())},null,8,["checked"])],2)):o.createCommentVNode("",!0),$.isAccordion?(o.openBlock(),o.createElementBlock("button",{key:1,onClick:ne[4]||(ne[4]=bt=>o.unref(qe)("pane2")),class:"p-1.5 active:bg-ed-accent"},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(o.unref(Ae)?o.unref(k1):o.unref(uc)),{class:"h-5 w-5"}))])):o.createCommentVNode("",!0)])],2)):o.createCommentVNode("",!0),$.contentAutoCopied?(o.openBlock(),o.createBlock(Ve,{key:1,disabled:o.unref(zc)($.contentAutoCopied),variant:"ghost",class:"w-fit h-fit p-0 gap-x-1 label-large text-blue-500 py-1.5",onClick:q},{default:o.withCtx(()=>[o.createVNode(Me,{name:"autoCopy",class:"size-5"}),ne[8]||(ne[8]=o.createTextVNode("자동복사"))]),_:1},8,["disabled"])):o.createCommentVNode("",!0)]),o.withDirectives(o.createElementVNode("div",{class:o.normalizeClass(o.unref(ke)("flex-1 basis-0 flex flex-col relative text-sm mb-4",$.contentClass,$.contentTextStyle))},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(o.unref(Pe)),o.normalizeProps(o.guardReactiveProps(o.unref(nt))),{default:o.withCtx(()=>[o.createVNode(o.unref(Yn),{id:"editor-panel",editor:o.unref(P),class:o.normalizeClass(["flex-1 relative break-all",$.mode===o.unref(Te).PLAIN_TEXT&&"plain-text"])},null,8,["editor","class"])]),_:1},16))],2),[[o.vShow,o.unref(Ae)]]),o.unref(E)?(o.openBlock(),o.createBlock(o.Teleport,{key:1,to:o.unref(xe),disabled:o.unref(Ae)},[o.createElementVNode("div",{class:o.normalizeClass(o.unref(ke)("sticky pb-3.5 mx-1 bottom-0 z-[12] inset-x-0 min-h-11 box-content invisible pointer-events-none",o.unref(R)&&"visible pointer-events-auto",$.customClassFormatControlBar))},[o.unref(Ke)?(o.openBlock(),o.createBlock(it,{key:0,editor:o.unref(F),class:"absolute inset-x-0"},null,8,["editor"])):(o.openBlock(),o.createBlock(tt,{key:1,editor:o.unref(F),mode:$.mode,disabled:!o.unref(B)||$.disabled,class:"absolute inset-x-0"},null,8,["editor","mode","disabled"]))],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),o.unref(P)?.storage.superText&&o.unref(ee)?(o.openBlock(),o.createBlock(bne,{key:1,open:o.unref(X),editor:o.unref(P),"bottom-sheet-component":o.unref(ee),onClose:ne[5]||(ne[5]=bt=>o.unref(P).commands.toggleSuperInputMoblie()),onSave:Ee},null,8,["open","editor","bottom-sheet-component"])):o.createCommentVNode("",!0),o.unref(F)?.storage.configPlan?(o.openBlock(),o.createBlock(EE,{key:2,open:o.unref(F)?.storage.configPlan.isShowConfigPlanInput,"is-view-mode":!o.unref(F)?.storage.configPlan.isShowConfigPlanInput,editor:o.unref(F),title:$.$t("editor.configPlan"),onClose:ne[6]||(ne[6]=bt=>o.unref(F).commands.toggleConfigPlanInput()),onSave:ie},null,8,["open","is-view-mode","editor","title"])):o.createCommentVNode("",!0)],64)}}}),Cne=o.defineComponent({__name:"ArticleEditor",props:{mode:{default:Te.STRAIGHT},isMobile:{type:Boolean},superTextArea:{},modelValue:{},comment:{},commentCuesheet:{},hideComment:{type:Boolean},disableSuperInput:{type:Boolean},fontSizeDefault:{},fontFamilyDefault:{},fontWeightDefault:{},showSuperElementIdColor:{type:Boolean},letterSpacingDefault:{},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:{},toolbarExtensionOrder:{},watermarkOverlay:{},bottomOffset:{},characterCountLimit:{},blockSeparatorPolicy:{},fixedSuperPreviewWidth:{type:Boolean}},emits:["update:modelValue","update:comment"],setup(t,{emit:e}){const n=t,r=bn();return o.onMounted(()=>{r.setTextAlert(n.textAlert||"")}),(i,s)=>n.isMobile?(o.openBlock(),o.createBlock(Yc,o.mergeProps({key:1},n,{"onUpdate:modelValue":s[2]||(s[2]=a=>i.$emit("update:modelValue",a)),"onUpdate:comment":s[3]||(s[3]=a=>i.$emit("update:comment",a))}),null,16)):(o.openBlock(),o.createBlock(Fh,o.mergeProps({key:0,ref:"coreEditorRef"},n,{"onUpdate:modelValue":s[0]||(s[0]=a=>i.$emit("update:modelValue",a)),"onUpdate:comment":s[1]||(s[1]=a=>i.$emit("update:comment",a))}),null,16))}}),kne=o.defineComponent({__name:"DigitalNewsEditor",props:{mode:{default:Te.EDITOR},isMobile:{type:Boolean},superTextArea:{},modelValue:{},comment:{},commentCuesheet:{},hideComment:{type:Boolean},disableSuperInput:{type:Boolean},fontSizeDefault:{},fontFamilyDefault:{},fontWeightDefault:{},showSuperElementIdColor:{type:Boolean},letterSpacingDefault:{},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:{},toolbarExtensionOrder:{},watermarkOverlay:{},bottomOffset:{},characterCountLimit:{},blockSeparatorPolicy:{},fixedSuperPreviewWidth:{type:Boolean}},setup(t){const e=t;return(n,r)=>{const i=Fh,s=Yc;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 TS={exports:{}};(function(t){(function(){function e(U){return U===">"}function n(U){return U==="<"}function r(U){return/^\s+$/.test(U)}function i(U){var P=U.match(/^\s*<([^!>][^>]*)>\s*$/);return!!P&&P[1].trim().split(" ")[0]}function s(U){return!i(U)}function a(U){return/^<!--/.test(U)}function l(U){return/--\>$/.test(U)}var u,c=new RegExp("^<(iframe|object|math|svg|script|video|head|style|a)");function f(U){var P=u.exec(U);return P&&P[1]}function p(U,P){return U.substring(U.length-P.length-2)==="</"+P}function m(U){return/^\s*<[^>]+\/>\s*$/.test(U)}function g(U){var P=/^<img[\s>]/.test(U);return P||s(U)||f(U)||m(U)}function v(U){return{string:U,key:x(U)}}function b(U,P,L,F){this.segment=F,this.length=L,this.startInBefore=U+F.beforeIndex,this.startInAfter=P+F.afterIndex,this.endInBefore=this.startInBefore+this.length-1,this.endInAfter=this.startInAfter+this.length-1,this.segmentStartInBefore=U,this.segmentStartInAfter=P,this.segmentEndInBefore=this.segmentStartInBefore+this.length-1,this.segmentEndInAfter=this.segmentStartInAfter+this.length-1}function w(U){for(var P="char",L="",F="",R=[],K=0;K<U.length;K++){var X=U[K];switch(P){case"tag":var ae=f(L);ae?(P="atomic_tag",F=ae,L+=X):a(L)?(P="html_comment",L+=X):e(X)?(L+=">",R.push(v(L)),L="",r(X)?P="whitespace":P="char"):L+=X;break;case"atomic_tag":e(X)&&p(L,F)?(L+=">",R.push(v(L)),L="",F="",P="char"):L+=X;break;case"html_comment":L+=X,l(L)&&(L="",P="char");break;case"char":n(X)?(L&&R.push(v(L)),L="<",P="tag"):/\s/.test(X)?(L&&R.push(v(L)),L=X,P="whitespace"):/[\w\d\#@]/.test(X)?L+=X:/&/.test(X)?(L&&R.push(v(L)),L=X):(L+=X,R.push(v(L)),L="");break;case"whitespace":n(X)?(L&&R.push(v(L)),L="<",P="tag"):r(X)?L+=X:(L&&R.push(v(L)),L=X,P="char");break;default:throw new Error("Unknown mode "+P)}}return L&&R.push(v(L)),R}function x(U){var P=/^<img.*src=['"]([^"']*)['"].*>$/.exec(U);if(P)return'<img src="'+P[1]+'">';var L=/^<a.*href=['"]([^"']*)['"]/.exec(U);if(L)return'<a href="'+L[1]+'"></a>';var F=/^<object.*data=['"]([^"']*)['"]/.exec(U);if(F)return'<object src="'+F[1]+'"></object>';if(/^<(svg|math|video)[\s>]/.test(U)){var R=U.indexOf('data-uuid="');if(R!==-1){var K=U.slice(0,R),X=U.slice(R+44);return K+X}else return U}var ae=/^<iframe.*src=['"]([^"']*)['"].*>/.exec(U);if(ae)return'<iframe src="'+ae[1]+'"></iframe>';var de=/<([^\s>]+)[\s>]/.exec(U);return de?"<"+de[1].toLowerCase()+">":U&&U.replace(/(\s+| | )/g," ")}function C(U){return U.reduce(function(P,L,F){return P[L.key]?P[L.key].push(F):P[L.key]=[F],P},Object.create(null))}function E(U,P){return P.endInBefore<U.startInBefore&&P.endInAfter<U.startInAfter?-1:P.startInBefore>U.endInBefore&&P.startInAfter>U.endInAfter?1:0}function k(){this._root=null}k.prototype={add:function(U){var P={value:U,left:null,right:null},L=this._root;if(L)for(;;){var F=E(L.value,U);if(F===-1)if(L.left)L=L.left;else{L.left=P;break}else if(F===1)if(L.right)L=L.right;else{L.right=P;break}else break}else this._root=P},toArray:function(){function U(P,L){return P&&(U(P.left,L),L.push(P.value),U(P.right,L)),L}return U(this._root,[])}};function T(U){for(var P=U.beforeTokens,L=U.afterMap,F=null,R=null,K=0;K<P.length;K++){var X=!1,ae=P.length-K;if(R&&ae<R.length)break;var de=P[K];if(de.key===" "){F=K;continue}F===K-1&&(X=!0);var Ee=L[de.key];Ee&&Ee.forEach(function(ie){var me=R?R.length:0,J=_(U,K,ie,me,X);J&&J.length>me&&(R=J)})}return R}function _(U,P,L,F,R){var K=U.beforeTokens,X=U.afterTokens,ae=P+F,de=L+F;if(!(ae>=K.length||de>=X.length)){if(F){var Ee=K[ae].key,ie=X[de].key;if(Ee!==ie)return}for(var me=!0,J=1,ee=P+J,te=L+J;me&&ee<K.length&&te<X.length;){var se=K[ee].key,pe=X[te].key;se===pe?(J++,ee=P+J,te=L+J):me=!1}if(R&&P>0&&L>0){var _e=K[P-1].key,Ae=X[L-1].key;_e===" "&&Ae===" "&&(P--,L--,J++)}return new b(P,L,J,U)}}function A(U,P,L,F){return{beforeTokens:U,afterTokens:P,beforeMap:C(U),afterMap:C(P),beforeIndex:L,afterIndex:F}}function V(U){for(var P=new k,L,F=[U];F.length;)if(U=F.pop(),L=T(U),L&&L.length){if(L.segmentStartInBefore>0&&L.segmentStartInAfter>0){var R=U.beforeTokens.slice(0,L.segmentStartInBefore),K=U.afterTokens.slice(0,L.segmentStartInAfter);F.push(A(R,K,U.beforeIndex,U.afterIndex))}var X=U.beforeTokens.slice(L.segmentEndInBefore+1),ae=U.afterTokens.slice(L.segmentEndInAfter+1),de=U.beforeIndex+L.segmentEndInBefore+1,Ee=U.afterIndex+L.segmentEndInAfter+1;X.length&&ae.length&&F.push(A(X,ae,de,Ee)),P.add(L)}return P.toArray()}function O(U,P){if(!U)throw new Error("Missing beforeTokens");if(!P)throw new Error("Missing afterTokens");var L=0,F=0,R=[],K=A(U,P,0,0),X=V(K);X.push(new b(U.length,P.length,0,K));for(var ae=0;ae<X.length;ae++){var de=X[ae],Ee="none";L===de.startInBefore?F!==de.startInAfter&&(Ee="insert"):(Ee="delete",F!==de.startInAfter&&(Ee="replace")),Ee!=="none"&&R.push({action:Ee,startInBefore:L,endInBefore:Ee!=="insert"?de.startInBefore-1:null,startInAfter:F,endInAfter:Ee!=="delete"?de.startInAfter-1:null}),de.length!==0&&R.push({action:"equal",startInBefore:de.startInBefore,endInBefore:de.endInBefore,startInAfter:de.startInAfter,endInAfter:de.endInAfter}),L=de.endInBefore+1,F=de.endInAfter+1}var ie=[],me={action:"none"};function J(se){return se.action!=="equal"||se.endInBefore-se.startInBefore!==0?!1:/^\s$/.test(U.slice(se.startInBefore,se.endInBefore+1))}for(var ee=0;ee<R.length;ee++){var te=R[ee];J(te)&&me.action==="replace"||te.action==="replace"&&me.action==="replace"?(me.endInBefore=te.endInBefore,me.endInAfter=te.endInAfter):(ie.push(te),me=te)}return ie}function B(U){this.tokens=U,this.notes=U.reduce(function(P,L,F){P.notes.push({isWrappable:g(L),insertedTag:!1});var R=!m(L)&&i(L),K=P.tagStack[P.tagStack.length-1];return R&&(K&&"/"+K.tag===R?(P.notes[K.position].insertedTag=!0,P.tagStack.pop()):P.tagStack.push({tag:R,position:F})),P},{notes:[],tagStack:[]}).notes}B.prototype.combine=function(U,P){var L=this.notes,F=this.tokens.slice(),R=F.reduce(function(K,X,ae){L[ae].insertedTag&&(F[ae]=P(F[ae])),K.status===null&&(K.status=L[ae].isWrappable);var de=L[ae].isWrappable;return de!==K.status&&(K.list.push({isWrappable:K.status,tokens:F.slice(K.lastIndex,ae)}),K.lastIndex=ae,K.status=de),ae===F.length-1&&K.list.push({isWrappable:K.status,tokens:F.slice(K.lastIndex,ae+1)}),K},{list:[],status:null,lastIndex:0}).list;return R.map(U).join("")};function H(U,P,L,F,R){var K=new B(P);F=F?F+"-":"";var X=" data-"+F+'operation-index="'+L+'"';return R&&(X+=' class="'+R+'"'),K.combine(function(ae){if(ae.isWrappable){var de=ae.tokens.join("");if(de.trim())return"<"+U+X+">"+de+"</"+U+">"}else return ae.tokens.join("");return""},function(ae){var de=' data-diff-node="'+U+'"';return de+=" data-"+F+'operation-index="'+L+'"',ae.replace(/>\s*$/,de+"$&")})}var j={equal:function(U,P,L,F,R,K){var X=L.slice(U.startInAfter,U.endInAfter+1);return X.reduce(function(ae,de){return ae+de.string},"")},insert:function(U,P,L,F,R,K){var X=L.slice(U.startInAfter,U.endInAfter+1),ae=X.map(function(de){return de.string});return H("ins",ae,F,R,K)},delete:function(U,P,L,F,R,K){var X=P.slice(U.startInBefore,U.endInBefore+1),ae=X.map(function(de){return de.string});return H("del",ae,F,R,K)},replace:function(){return j.delete.apply(null,arguments)+j.insert.apply(null,arguments)}};function Y(U,P,L,F,R){return L.reduce(function(K,X,ae){return K+j[X.action](X,U,P,ae,F,R)},"")}function N(U,P,L,F,R){if(U===P)return U;R?u=new RegExp("^<("+R.replace(/\s*/g,"").replace(/,/g,"|")+")"):u=c,U=w(U),P=w(P);var K=O(U,P);return Y(U,P,K,F,L)}N.htmlToTokens=w,N.findMatchingBlocks=V,V.findBestMatch=T,V.createMap=C,V.createToken=v,V.createSegment=A,V.getKeyForToken=x,N.calculateOperations=O,N.renderOperations=Y,t!==null?t.exports=N:this.htmldiff=N}).call(ml)})(TS);var Ene=TS.exports;const Sne=gL(Ene),AS=(t,e,n)=>{let r="";{const i=un(t,n),s=un(e,n);r=Sne(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},_ne={key:0,class:"px-2 min-h-[24px] flex items-center justify-between gap-1 mb-1.5"},Tne={class:"flex items-center gap-2"},Ane={class:"body-small text-gray-600 px-[6px] py-[2px] shrink-0 rounded-[4px] bg-gray-100"},Mne={class:"label-large text-gray-800 line-clamp-1"},One={class:"flex items-center gap-1 shrink-0"},Bne={class:"mt-[2px]"},Ine={class:"body-small text-gray-400"},Lne={class:"border border-ed-gray rounded-[5px] p-2.5 my-2 h-full"},Rne={key:0,class:"px-2 min-h-[24px] flex items-center justify-between gap-1 mb-1.5"},Dne={class:"flex items-center gap-2"},Pne={class:"body-small text-blue-500 px-[6px] py-[2px] shrink-0 rounded-[4px] bg-blue-50"},Vne={class:"label-large text-gray-800 line-clamp-1"},Fne={class:"flex items-center gap-1 shrink-0"},$ne={class:"mt-[2px]"},Hne={class:"body-small text-gray-400"},zne=Xr(o.defineComponent({__name:"ArticleCompareEditor",props:{originalData:{},changedData:{},extensions:{},editorClass:{},isCompare:{type:Boolean,default:!0},contentTextStyle:{}},setup(t){const e=t,n=o.computed(()=>[...e.extensions,kS]),r=o.ref(!1),i=o.computed(()=>!e.originalData||!e.changedData?{comment:"",content:""}:{comment:AS(e.originalData.comment,e.changedData.comment,!0),content:AS(e.originalData.content,e.changedData.content,!0)}),{HEADER_ONLY_SIZE:s,pane1ContentVisible:a,pane2ContentVisible:l,pane1Size:u,pane2Size:c,handlePaneResize:f}=_S(!1,6),{isScrolling:p,handleScroll:m}=Xl(),{isScrolling:g,handleScroll:v}=Xl();return(b,w)=>{const x=Ot;return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(ke)("h-full",b.editorClass))},[o.createVNode(o.unref($h),{horizontal:"",onResize:o.unref(f)},{default:o.withCtx(()=>[o.createVNode(o.unref(Xo),{size:o.unref(u),"min-size":o.unref(s),class:"flex flex-col"},{default:o.withCtx(()=>[b.originalData?.titleBar?.title?(o.openBlock(),o.createElementBlock("div",_ne,[o.createElementVNode("div",Tne,[o.createElementVNode("div",Ane,o.toDisplayString(b.$t("기준")),1),o.createElementVNode("h3",Mne,o.toDisplayString(b.originalData?.titleBar?.title),1)]),o.createElementVNode("div",One,[o.createElementVNode("div",Bne,[o.createVNode(x,{name:"Clock",class:"w-[13px] h-[13px] text-gray-400"})]),o.createElementVNode("div",Ine,o.toDisplayString(b.originalData?.titleBar?.time),1)])])):o.createCommentVNode("",!0),o.withDirectives(o.createElementVNode("div",{class:o.normalizeClass(o.unref(ke)("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]=(...C)=>o.unref(m)&&o.unref(m)(...C))},[o.createVNode(Yc,{"editor-class":"h-full",mode:o.unref(Te).REPORT,disabled:"","hide-toolbar":"",extensions:o.unref(n),"field-name-comment":b.originalData?.fieldNameComment,"field-name-content":b.originalData?.fieldNameContent,comment:b.originalData?.comment,"model-value":b.originalData?.content,"hide-comment":b.originalData?.hideComment,"is-compare":b.isCompare,"content-text-style":b.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(Xo),{key:0},{default:o.withCtx(()=>[o.createElementVNode("div",Lne,[o.createVNode(Yc,{"editor-class":"h-full",mode:o.unref(Te).REPORT,disabled:"","hide-toolbar":"",extensions:o.unref(n),"field-name-comment":b.changedData?.fieldNameComment,"field-name-content":b.changedData?.fieldNameContent,comment:b.changedData?.comment,"model-value":b.changedData?.content,"hide-comment":b.changedData?.hideComment,"is-compare":b.isCompare,"content-text-style":b.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(Xo),{size:o.unref(c),"min-size":o.unref(s),class:"flex flex-col"},{default:o.withCtx(()=>[b.changedData?.titleBar?.title?(o.openBlock(),o.createElementBlock("div",Rne,[o.createElementVNode("div",Dne,[o.createElementVNode("div",Pne,o.toDisplayString(b.$t("대상")),1),o.createElementVNode("h3",Vne,o.toDisplayString(b.changedData?.titleBar?.title),1)]),o.createElementVNode("div",Fne,[o.createElementVNode("div",$ne,[o.createVNode(x,{name:"Clock",class:"w-[13px] h-[13px] text-gray-400"})]),o.createElementVNode("div",Hne,o.toDisplayString(b.changedData?.titleBar?.time),1)])])):o.createCommentVNode("",!0),o.withDirectives(o.createElementVNode("div",{class:o.normalizeClass(o.unref(ke)("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]=(...C)=>o.unref(v)&&o.unref(v)(...C))},[o.createVNode(Yc,{"editor-class":"h-full",mode:o.unref(Te).REPORT,disabled:"","hide-toolbar":"",extensions:o.unref(n),"field-name-comment":b.changedData?.fieldNameComment,"field-name-content":b.changedData?.fieldNameContent,comment:o.unref(i).comment,"model-value":o.unref(i).content,"hide-comment":b.changedData?.hideComment,"is-compare":b.isCompare,"content-text-style":b.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-4bdb50a2"]]),Une=o.defineComponent({__name:"SuperViewMobileSuperEditor",props:{isMobile:{type:Boolean},superTextArea:{},mode:{},modelValue:{default:""},comment:{},commentCuesheet:{},hideComment:{type:Boolean},disableSuperInput:{type:Boolean,default:!1},fontSizeDefault:{},fontFamilyDefault:{},fontWeightDefault:{},showSuperElementIdColor:{type:Boolean},letterSpacingDefault:{},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:{},toolbarExtensionOrder:{},watermarkOverlay:{},bottomOffset:{},characterCountLimit:{},blockSeparatorPolicy:{},fixedSuperPreviewWidth:{type:Boolean}},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===Te.EDITOR);const s=ct.useEventBus(ur.RENDER_SUPER_TEXT),a=bn(),{isReady:l,editor:u,updateEditorState:c,checkSpellStore:f}=a,p=o.ref(!1);o.provide("isEditable",p);const m=o.ref(fx(r.modelValue));function g(k){if(r.disabled||r.readonly)return;const T=aE(k);i("lineFocus",{lineIndex:T})}function v(){i("lineFocus",{lineIndex:void 0})}const b=new Oo({enablePasteRules:!1,enableInputRules:!1,content:m.value,onCreate:({editor:k})=>{c(k)},onUpdate:St.throttle(({editor:k})=>{l.value=!0;const T=E(k,r.output);i("update:modelValue",T),i("change",{editor:k,output:T}),c(k)},Lo),extensions:St.uniqBy(r.extensions,"name"),editable:p.value,onFocus:()=>{x(),w.value=!0,g(b)},onBlur:()=>{w.value=!1,v()},onSelectionUpdate:()=>{g(b)}}),w=o.ref(!1);function x(){i("setEditorSelected",b)}function C(){s.emit({action:"render"})}function E(k,T){if(!k)return"";if(k.isEmpty)return T==="json"?{}:"";switch(T){case"html":return k.getHTML();case"json":return k.getJSON();case"text":return k.getText();default:return""}}return o.watch(()=>f.languages,()=>{b.commands.checkSpelling()}),o.watch(()=>r.modelValue,k=>{if(!b||St.isEqual(E(b,r.output),k))return;const{from:T,to:_}=b.state.selection;b.commands.setTextSelection({from:T,to:_}),C(),m.value=fx(k)},{deep:!0}),o.watch(()=>u.value,()=>{u.value&&u.value.on("selectionUpdate",({editor:k})=>{i("changed:selection",{editor:k})})}),o.watch(()=>r.disableSuperInput,()=>{document.getElementById(ir.COMMENT)?.setAttribute(ir.DISABLE_SUPER_INPUT,`${r.disableSuperInput}`)}),o.onUnmounted(()=>b?.destroy()),Ph(b),o.onMounted(()=>{b?.commands?.setIsEnableSuggestion&&b.commands.setIsEnableSuggestion(!1),b?.commands?.setIsMobile&&b.commands.setIsMobile(!0)}),e({editor:b}),(k,T)=>{const _=Xc;return o.openBlock(),o.createElementBlock(o.Fragment,null,[k.fieldNameSuper?.label?(o.openBlock(),o.createBlock(_,{key:0,"field-name":k.fieldNameSuper,mode:k.mode,disabled:k.disabled,class:"mb-1",intent:"secondary"},null,8,["field-name","mode","disabled"])):o.createCommentVNode("",!0),o.createVNode(o.unref(Yn),{editor:o.unref(b),spellcheck:"true",class:o.normalizeClass(["flex-1 flex-col"])},null,8,["editor"])],64)}}}),Wne=(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},MS="focused-line";async function OS({lineIndex:t,editor:e}){if(e.state.doc.descendants((l,u)=>{if(l.attrs.class===MS){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=Wne(e,t);if(!n)return;const{node:r,pos:i}=n,s=e.state.tr.setNodeMarkup(i,void 0,{...r.attrs,class:MS});e.view.dispatch(s),await o.nextTick(),e.view.nodeDOM(i).scrollIntoView({behavior:"smooth"})}const jne=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:""},fontWeightDefault:{default:void 0},showSuperElementIdColor:{type:Boolean},letterSpacingDefault:{},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:{},toolbarExtensionOrder:{},watermarkOverlay:{},bottomOffset:{},characterCountLimit:{},blockSeparatorPolicy:{},fixedSuperPreviewWidth:{type:Boolean}},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;Gc(),o.provide("isMobile",!0),o.computed(()=>r.mode===Te.EDITOR);const s=ct.useEventBus(ur.INCREASE_DECREASE_FONTSIZE);o.useAttrs();const a=bn(),{state:l,isFullscreen:u,isReady:c,editor:f,updateEditorState:p,checkSpellStore:m}=a,g=o.ref(!1);o.provide("isEditable",g);const v=o.ref(void 0),b=o.ref(),w=o.ref(r.fontSizeDefault),x=o.ref(r.fontFamilyDefault),C=o.ref(r.fontWeightDefault);o.provide("fontSize",w),o.provide("fontFamily",x),o.provide("fontWeight",C);const E=o.computed(()=>({fontFamily:x.value,fontSize:w.value,...C.value?{fontWeight:C.value}:{}})),k=o.ref(),T=P=>{const L=parseInt(w.value||"12px"),F=P?L+2:L-2;w.value=F+"px"};o.onBeforeMount(()=>{s.on(T)}),o.onBeforeUnmount(()=>{s.off(T)});const _=o.computed(()=>({...o.unref(u)?{height:"100%"}:{minHeight:r.minHeight?Yt(r.minHeight):void 0,maxHeight:r.maxHeight?Yt(r.maxHeight):void 0,height:r.height?Yt(r.height):void 0},maxWidth:Yt(r.maxWidth),width:r.maxWidth?"100%":void 0,margin:r.maxWidth?"0 auto":void 0}));function A(P){if(r.disabled||r.readonly)return;const L=aE(P);v.value=L}function V(){v.value=void 0}const O=new Oo({enablePasteRules:!1,enableInputRules:!1,content:un(r.modelValue,r.disabled,r.mode),onCreate:({editor:P})=>{p(P)},onUpdate:St.throttle(({editor:P})=>{c.value=!0;const L=N(P,r.output);i("update:modelValue",L),i("change",{editor:P,output:L}),p(P)},Lo),extensions:St.uniqBy(r.extensions,"name"),editable:g.value,onFocus:()=>{Y(),B.value=!0,A(O)},onBlur:()=>{B.value=!1,V()},onSelectionUpdate:()=>{A(O)}}),B=o.ref(!1),H=o.ref();o.onMounted(()=>{H.value=O});const j=({lineIndex:P})=>{O&&OS({lineIndex:P,editor:O});const L=b.value?.editor;L&&OS({lineIndex:P,editor:L})};o.watch(()=>v.value,P=>{i("lineFocus",{lineIndex:P}),j({lineIndex:P})},{immediate:!0});function Y(P){H.value=O}function N(P,L){if(!P)return"";if(P.isEmpty)return L==="json"?{}:"";switch(L){case"html":return P.getHTML();case"json":return P.getJSON();case"text":return P.getText({blockSeparator:`
|
|
359
|
+
`});default:return""}}function de($){return $.every(ne=>P?.extensionManager.extensions.find(oe=>oe.name===ne))}o.watch(()=>g.languages,()=>{P.commands.checkSpelling()}),o.watch(()=>r.modelValue,$=>{if(!P||St.isEqual(ae(P,r.output),$))return;const{from:ne,to:oe}=P.state.selection;P.commands.setTextSelection({from:ne,to:oe}),P.commands.setContent(un($,r.disabled,r.mode),!1,{preserveWhitespace:"full"})},{deep:!0}),o.watch([()=>r.disabled,()=>r.readonly],()=>{B.value=!r.disabled&&!r.readonly},{immediate:!0}),o.watch(()=>B.value,$=>{P?.setEditable($),P?.commands?.setIsEnableSuggestion&&P.commands.setIsEnableSuggestion($)},{immediate:!0}),o.watch(()=>p.value,()=>{p.value&&p.value.on("selectionUpdate",({editor:$})=>{i("changed:selection",{editor:$})})}),o.onUnmounted(()=>{P?.destroy(),F.value?.destroy()}),Ju(ju.SAVE,()=>{localStorage.setItem("content",ae(P,"html"))});const Ee=($,ne)=>{const oe=P;if(oe){if(ne){const we=oe.state.doc.nodeAt(+ne),{[Ne.ELEMENT_ID]:$e,...tt}=we?.attrs||{};oe.view.dispatch(oe.state.tr.setNodeMarkup(+ne,void 0,{...tt,[Ne.TEXT]:$}))}else{const{from:we}=oe.view.state.selection;oe.commands.insertContentAt(we,{type:"superText",attrs:{"data-id":$r(6),"data-text":$}})}oe.commands.toggleSuperInputMoblie(),oe.storage.superText.addToast({type:"success",message:"수퍼가 수정되었습니다"})}},ie=$=>{const ne=F.value??P;if(ne){const{from:oe}=ne.view.state.selection;ne.commands.insertContentAt(oe,{type:"configPlan",attrs:{"data-id":$r(6),"data-text":$}})}F.value?.commands.toggleConfigPlanInput()};function me($){$===Te.STRAIGHT&&P.commands.focus("end"),$===Te.EDITOR&&P.commands.focus("end")}const J=o.computed(()=>B.value&&r.mode===Te.STRAIGHT||B.value&&r.mode===Te.REPORT);o.onMounted(()=>{r.autoFocus&&me(r.mode),P?.commands?.setIsMobile&&P.commands.setIsMobile(!0),B.value&&P.storage.superText?.enable&&P.commands.toggleSuperTextView()}),o.watch(()=>r.mode,$=>{r.autoFocus&&me($)});const ee=P.extensionManager.extensions.find($=>$.name==="superText")?.options.bottomSheetComponent,te=o.computed(()=>{const $=r.mode===Te.REPORT,ne=r.mode===Te.EDITOR&&r.isScreenSplit,oe=!r.hideComment;return($||ne)&&oe}),se=o.computed(()=>!te.value),{HEADER_ONLY_SIZE:pe,pane1ContentVisible:_e,pane2ContentVisible:Ae,pane1Size:Ue,pane2Size:We,togglePane:qe,handlePaneResize:At}=_S(se);function q(){if(!r.contentAutoCopied)return;const $=HT(r.contentAutoCopied,".super-text");C(P,$)}const{isScrolling:z,handleScroll:he}=Xl(),xe=o.ref(null);e({editor:P});const Pe=o.computed(()=>r.watermarkOverlay?.component||"div"),rt=o.computed(()=>{const $=!!r.watermarkOverlay?.props?.text,ne=Pe.value==="div";return{...r.watermarkOverlay?.props,...($||ne)&&{class:"flex-1 flex flex-col"}}}),Ke=o.computed(()=>{const{selection:$}=F.value?.state;return $ instanceof Re&&$.node.type.name==="image"});return($,ne)=>{const oe=CS,we=Dh,$e=Rh,tt=Lh,Tt=xS,ue=dne,je=Mc,re=Nte,Me=Ot,Ve=mn,it=Qte,nt=Kte;return o.openBlock(),o.createElementBlock(o.Fragment,null,[o.unref(F)?(o.openBlock(),o.createElementBlock("div",{key:0,id:"vdc-editor",style:o.normalizeStyle(o.unref(U)),class:o.normalizeClass(o.unref(ke)("vdc-editor mobile relative w-full flex flex-col",!r.height&&"flex-1",$.editorClass,$.disabled&&"disabled",$.mode!==o.unref(Te).EDITOR&&$.isShowLineNumber&&"editor-line",$.isEditorView&&"overflow-y-auto"))},[!$.hideBubble&&!$.disabled&&o.unref(B)?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createVNode(oe,{editor:o.unref(P),mode:$.mode},null,8,["editor","mode"]),de([o.unref(Ic)])?(o.openBlock(),o.createBlock(we,{key:0,editor:o.unref(P)},null,8,["editor"])):o.createCommentVNode("",!0),de([o.unref(_a)])?(o.openBlock(),o.createBlock($e,{key:1,editor:o.unref(P)},null,8,["editor"])):o.createCommentVNode("",!0),de([o.unref(Ss)])?(o.openBlock(),o.createBlock(tt,{key:2,editor:o.unref(P)},null,8,["editor"])):o.createCommentVNode("",!0)],64)):o.createCommentVNode("",!0),!$.hideToolbar&&!r.isEditorView?(o.openBlock(),o.createBlock(Tt,{key:1,editor:o.unref(P),mode:$.mode,disabled:$.disabled,class:"mb-[3px]","custom-class-toolbar":$.customClassToolbar,"active-extensions":$.mode===o.unref(Te).EDITOR?[ki]:void 0},null,8,["editor","mode","disabled","custom-class-toolbar","active-extensions"])):o.createCommentVNode("",!0),r.isEditorView?(o.openBlock(),o.createBlock(ue,{key:2,"is-editor-view-split-content":r.isEditorViewSplitContent,extensions:$.extensions,mode:$.mode,"hide-comment":$.hideComment,"field-name-comment":$.fieldNameComment,"field-name-comment-cuesheet":$.fieldNameCommentCuesheet,"field-name-content":$.fieldNameContent,comment:$.comment,"comment-cuesheet":$.commentCuesheet,content:$.modelValue,"content-text-style":$.contentTextStyle,"watermark-overlay-component":o.unref(Pe),"vbind-watermark-overlay":o.unref(rt)},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","watermark-overlay-component","vbind-watermark-overlay"])):(o.openBlock(),o.createBlock(o.unref($h),{key:3,class:o.normalizeClass(o.unref(ke)("flex-1 basis-0")),horizontal:"",onResize:o.unref(At)},{default:o.withCtx(()=>[o.unref(te)?(o.openBlock(),o.createBlock(o.unref(Xo),{key:0,size:o.unref(Ue),"min-size":o.unref(pe),class:"flex flex-col min-h-8"},{default:o.withCtx(()=>[$.titleBarComment?.title?(o.openBlock(),o.createBlock(SS,{key:0,"title-bar":$.titleBarComment,class:"mb-[3px]"},null,8,["title-bar"])):o.createCommentVNode("",!0),$.fieldNameComment?.label?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(o.unref(ke)("flex justify-between items-center mb-1"))},[o.createVNode(Xc,{"field-name":$.fieldNameComment,class:"py-1.5"},null,8,["field-name"]),$.isAccordion?(o.openBlock(),o.createElementBlock("button",{key:0,onClick:ne[0]||(ne[0]=bt=>o.unref(qe)("pane1")),class:"p-1.5 active:bg-ed-accent"},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(o.unref(_e)?o.unref(k1):o.unref(uc)),{class:"h-5 w-5"}))])):o.createCommentVNode("",!0)],2)):o.createCommentVNode("",!0),o.withDirectives(o.createElementVNode("div",{id:"comment-wrap-scroll",class:o.normalizeClass(o.unref(ke)("flex-1 !overflow-y-auto overflow-x-hidden basis-0 flex h-full flex-col text-sm",!o.unref(z)&&"scrollbar-thumb-transparent",$.contentClass,$.contentTextStyle)),onScroll:ne[2]||(ne[2]=(...bt)=>o.unref(he)&&o.unref(he)(...bt))},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(o.unref(Pe)),o.normalizeProps(o.guardReactiveProps(o.unref(rt))),{default:o.withCtx(()=>[o.createVNode(yne,{ref:"editorCommentRef",mode:$.mode,extensions:$.extensions,"model-value":r.comment,disabled:r.disabled,"disable-super-input":$.disableSuperInput,"field-name-comment":$.fieldNameComment,"is-show-format-control-bar":$.isShowFormatControlBar,"auto-focus":$.autoFocus,"bottom-offset":o.unref(k),"onUpdate:modelValue":ne[1]||(ne[1]=bt=>i("update:comment",bt)),onSetEditorSelected:K},null,8,["mode","extensions","model-value","disabled","disable-super-input","field-name-comment","is-show-format-control-bar","auto-focus","bottom-offset"])]),_:1},16)),o.unref(E)?(o.openBlock(),o.createElementBlock("div",{key:0,ref_key:"formatToolbarTargetRef",ref:xe,class:o.normalizeClass(o.unref(ke)("sticky bottom-0 z-[12] min-h-[58px]",o.unref(T)&&"fixed inset-x-2.5",o.unref(Ae)&&"hidden"))},null,2)):o.createCommentVNode("",!0)],34),[[o.vShow,o.unref(_e)]])]),_:1},8,["size","min-size"])):o.createCommentVNode("",!0),o.createVNode(o.unref(Xo),{size:o.unref(We),"min-size":o.unref(pe),class:o.normalizeClass(o.unref(ke)("flex flex-col min-h-8")),style:{overflow:"unset"}},{default:o.withCtx(()=>[$.titleBarContent?.title?(o.openBlock(),o.createBlock(SS,{key:0,"title-bar":$.titleBarContent,class:"mb-[3px]"},null,8,["title-bar"])):o.createCommentVNode("",!0),o.createElementVNode("div",wne,[$.fieldNameContent?.label?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(o.unref(ke)("flex justify-between items-center mb-1 flex-1"))},[o.createVNode(Xc,{"field-name":$.fieldNameContent,class:"py-1.5"},null,8,["field-name"]),o.createElementVNode("div",xne,[o.unref(J)?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(o.unref(ke)("flex items-center"))},[o.createVNode(je,{for:"superView",class:"body-medium p-2"},{default:o.withCtx(()=>ne[7]||(ne[7]=[o.createTextVNode("수퍼")])),_:1}),o.createVNode(re,{id:"superView",checked:o.unref(P).storage.superText.enable,class:"data-[state=checked]:bg-blue-500","onUpdate:checked":ne[3]||(ne[3]=bt=>o.unref(P).commands.toggleSuperTextView())},null,8,["checked"])],2)):o.createCommentVNode("",!0),$.isAccordion?(o.openBlock(),o.createElementBlock("button",{key:1,onClick:ne[4]||(ne[4]=bt=>o.unref(qe)("pane2")),class:"p-1.5 active:bg-ed-accent"},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(o.unref(Ae)?o.unref(k1):o.unref(uc)),{class:"h-5 w-5"}))])):o.createCommentVNode("",!0)])],2)):o.createCommentVNode("",!0),$.contentAutoCopied?(o.openBlock(),o.createBlock(Ve,{key:1,disabled:o.unref(zc)($.contentAutoCopied),variant:"ghost",class:"w-fit h-fit p-0 gap-x-1 label-large text-blue-500 py-1.5",onClick:q},{default:o.withCtx(()=>[o.createVNode(Me,{name:"autoCopy",class:"size-5"}),ne[8]||(ne[8]=o.createTextVNode("자동복사"))]),_:1},8,["disabled"])):o.createCommentVNode("",!0)]),o.withDirectives(o.createElementVNode("div",{class:o.normalizeClass(o.unref(ke)("flex-1 basis-0 flex flex-col relative text-sm mb-4",$.contentClass,$.contentTextStyle))},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(o.unref(Pe)),o.normalizeProps(o.guardReactiveProps(o.unref(rt))),{default:o.withCtx(()=>[o.createVNode(o.unref(Yn),{id:"editor-panel",editor:o.unref(P),class:o.normalizeClass(["flex-1 relative break-all",$.mode===o.unref(Te).PLAIN_TEXT&&"plain-text"])},null,8,["editor","class"])]),_:1},16))],2),[[o.vShow,o.unref(Ae)]]),o.unref(E)?(o.openBlock(),o.createBlock(o.Teleport,{key:1,to:o.unref(xe),disabled:o.unref(Ae)},[o.createElementVNode("div",{class:o.normalizeClass(o.unref(ke)("sticky pb-3.5 mx-1 bottom-0 z-[12] inset-x-0 min-h-11 box-content invisible pointer-events-none",o.unref(R)&&"visible pointer-events-auto",$.customClassFormatControlBar))},[o.unref(Ke)?(o.openBlock(),o.createBlock(it,{key:0,editor:o.unref(F),class:"absolute inset-x-0"},null,8,["editor"])):(o.openBlock(),o.createBlock(nt,{key:1,editor:o.unref(F),mode:$.mode,disabled:!o.unref(B)||$.disabled,class:"absolute inset-x-0"},null,8,["editor","mode","disabled"]))],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),o.unref(P)?.storage.superText&&o.unref(ee)?(o.openBlock(),o.createBlock(bne,{key:1,open:o.unref(X),editor:o.unref(P),"bottom-sheet-component":o.unref(ee),onClose:ne[5]||(ne[5]=bt=>o.unref(P).commands.toggleSuperInputMoblie()),onSave:Ee},null,8,["open","editor","bottom-sheet-component"])):o.createCommentVNode("",!0),o.unref(F)?.storage.configPlan?(o.openBlock(),o.createBlock(EE,{key:2,open:o.unref(F)?.storage.configPlan.isShowConfigPlanInput,"is-view-mode":!o.unref(F)?.storage.configPlan.isShowConfigPlanInput,editor:o.unref(F),title:$.$t("editor.configPlan"),onClose:ne[6]||(ne[6]=bt=>o.unref(F).commands.toggleConfigPlanInput()),onSave:ie},null,8,["open","is-view-mode","editor","title"])):o.createCommentVNode("",!0)],64)}}}),Cne=o.defineComponent({__name:"ArticleEditor",props:{mode:{default:Te.STRAIGHT},isMobile:{type:Boolean},superTextArea:{},modelValue:{},comment:{},commentCuesheet:{},hideComment:{type:Boolean},disableSuperInput:{type:Boolean},fontSizeDefault:{},fontFamilyDefault:{},fontWeightDefault:{},showSuperElementIdColor:{type:Boolean},letterSpacingDefault:{},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:{},toolbarExtensionOrder:{},watermarkOverlay:{},bottomOffset:{},characterCountLimit:{},blockSeparatorPolicy:{},fixedSuperPreviewWidth:{type:Boolean}},emits:["update:modelValue","update:comment"],setup(t,{emit:e}){const n=t,r=bn();return o.onMounted(()=>{r.setTextAlert(n.textAlert||"")}),(i,s)=>n.isMobile?(o.openBlock(),o.createBlock(Yc,o.mergeProps({key:1},n,{"onUpdate:modelValue":s[2]||(s[2]=a=>i.$emit("update:modelValue",a)),"onUpdate:comment":s[3]||(s[3]=a=>i.$emit("update:comment",a))}),null,16)):(o.openBlock(),o.createBlock(Fh,o.mergeProps({key:0,ref:"coreEditorRef"},n,{"onUpdate:modelValue":s[0]||(s[0]=a=>i.$emit("update:modelValue",a)),"onUpdate:comment":s[1]||(s[1]=a=>i.$emit("update:comment",a))}),null,16))}}),kne=o.defineComponent({__name:"DigitalNewsEditor",props:{mode:{default:Te.EDITOR},isMobile:{type:Boolean},superTextArea:{},modelValue:{},comment:{},commentCuesheet:{},hideComment:{type:Boolean},disableSuperInput:{type:Boolean},fontSizeDefault:{},fontFamilyDefault:{},fontWeightDefault:{},showSuperElementIdColor:{type:Boolean},letterSpacingDefault:{},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:{},toolbarExtensionOrder:{},watermarkOverlay:{},bottomOffset:{},characterCountLimit:{},blockSeparatorPolicy:{},fixedSuperPreviewWidth:{type:Boolean}},setup(t){const e=t;return(n,r)=>{const i=Fh,s=Yc;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 TS={exports:{}};(function(t){(function(){function e(U){return U===">"}function n(U){return U==="<"}function r(U){return/^\s+$/.test(U)}function i(U){var P=U.match(/^\s*<([^!>][^>]*)>\s*$/);return!!P&&P[1].trim().split(" ")[0]}function s(U){return!i(U)}function a(U){return/^<!--/.test(U)}function l(U){return/--\>$/.test(U)}var u,c=new RegExp("^<(iframe|object|math|svg|script|video|head|style|a)");function f(U){var P=u.exec(U);return P&&P[1]}function p(U,P){return U.substring(U.length-P.length-2)==="</"+P}function m(U){return/^\s*<[^>]+\/>\s*$/.test(U)}function g(U){var P=/^<img[\s>]/.test(U);return P||s(U)||f(U)||m(U)}function v(U){return{string:U,key:x(U)}}function b(U,P,L,F){this.segment=F,this.length=L,this.startInBefore=U+F.beforeIndex,this.startInAfter=P+F.afterIndex,this.endInBefore=this.startInBefore+this.length-1,this.endInAfter=this.startInAfter+this.length-1,this.segmentStartInBefore=U,this.segmentStartInAfter=P,this.segmentEndInBefore=this.segmentStartInBefore+this.length-1,this.segmentEndInAfter=this.segmentStartInAfter+this.length-1}function w(U){for(var P="char",L="",F="",R=[],K=0;K<U.length;K++){var X=U[K];switch(P){case"tag":var ae=f(L);ae?(P="atomic_tag",F=ae,L+=X):a(L)?(P="html_comment",L+=X):e(X)?(L+=">",R.push(v(L)),L="",r(X)?P="whitespace":P="char"):L+=X;break;case"atomic_tag":e(X)&&p(L,F)?(L+=">",R.push(v(L)),L="",F="",P="char"):L+=X;break;case"html_comment":L+=X,l(L)&&(L="",P="char");break;case"char":n(X)?(L&&R.push(v(L)),L="<",P="tag"):/\s/.test(X)?(L&&R.push(v(L)),L=X,P="whitespace"):/[\w\d\#@]/.test(X)?L+=X:/&/.test(X)?(L&&R.push(v(L)),L=X):(L+=X,R.push(v(L)),L="");break;case"whitespace":n(X)?(L&&R.push(v(L)),L="<",P="tag"):r(X)?L+=X:(L&&R.push(v(L)),L=X,P="char");break;default:throw new Error("Unknown mode "+P)}}return L&&R.push(v(L)),R}function x(U){var P=/^<img.*src=['"]([^"']*)['"].*>$/.exec(U);if(P)return'<img src="'+P[1]+'">';var L=/^<a.*href=['"]([^"']*)['"]/.exec(U);if(L)return'<a href="'+L[1]+'"></a>';var F=/^<object.*data=['"]([^"']*)['"]/.exec(U);if(F)return'<object src="'+F[1]+'"></object>';if(/^<(svg|math|video)[\s>]/.test(U)){var R=U.indexOf('data-uuid="');if(R!==-1){var K=U.slice(0,R),X=U.slice(R+44);return K+X}else return U}var ae=/^<iframe.*src=['"]([^"']*)['"].*>/.exec(U);if(ae)return'<iframe src="'+ae[1]+'"></iframe>';var de=/<([^\s>]+)[\s>]/.exec(U);return de?"<"+de[1].toLowerCase()+">":U&&U.replace(/(\s+| | )/g," ")}function C(U){return U.reduce(function(P,L,F){return P[L.key]?P[L.key].push(F):P[L.key]=[F],P},Object.create(null))}function E(U,P){return P.endInBefore<U.startInBefore&&P.endInAfter<U.startInAfter?-1:P.startInBefore>U.endInBefore&&P.startInAfter>U.endInAfter?1:0}function k(){this._root=null}k.prototype={add:function(U){var P={value:U,left:null,right:null},L=this._root;if(L)for(;;){var F=E(L.value,U);if(F===-1)if(L.left)L=L.left;else{L.left=P;break}else if(F===1)if(L.right)L=L.right;else{L.right=P;break}else break}else this._root=P},toArray:function(){function U(P,L){return P&&(U(P.left,L),L.push(P.value),U(P.right,L)),L}return U(this._root,[])}};function T(U){for(var P=U.beforeTokens,L=U.afterMap,F=null,R=null,K=0;K<P.length;K++){var X=!1,ae=P.length-K;if(R&&ae<R.length)break;var de=P[K];if(de.key===" "){F=K;continue}F===K-1&&(X=!0);var Ee=L[de.key];Ee&&Ee.forEach(function(ie){var me=R?R.length:0,J=_(U,K,ie,me,X);J&&J.length>me&&(R=J)})}return R}function _(U,P,L,F,R){var K=U.beforeTokens,X=U.afterTokens,ae=P+F,de=L+F;if(!(ae>=K.length||de>=X.length)){if(F){var Ee=K[ae].key,ie=X[de].key;if(Ee!==ie)return}for(var me=!0,J=1,ee=P+J,te=L+J;me&&ee<K.length&&te<X.length;){var se=K[ee].key,pe=X[te].key;se===pe?(J++,ee=P+J,te=L+J):me=!1}if(R&&P>0&&L>0){var _e=K[P-1].key,Ae=X[L-1].key;_e===" "&&Ae===" "&&(P--,L--,J++)}return new b(P,L,J,U)}}function A(U,P,L,F){return{beforeTokens:U,afterTokens:P,beforeMap:C(U),afterMap:C(P),beforeIndex:L,afterIndex:F}}function V(U){for(var P=new k,L,F=[U];F.length;)if(U=F.pop(),L=T(U),L&&L.length){if(L.segmentStartInBefore>0&&L.segmentStartInAfter>0){var R=U.beforeTokens.slice(0,L.segmentStartInBefore),K=U.afterTokens.slice(0,L.segmentStartInAfter);F.push(A(R,K,U.beforeIndex,U.afterIndex))}var X=U.beforeTokens.slice(L.segmentEndInBefore+1),ae=U.afterTokens.slice(L.segmentEndInAfter+1),de=U.beforeIndex+L.segmentEndInBefore+1,Ee=U.afterIndex+L.segmentEndInAfter+1;X.length&&ae.length&&F.push(A(X,ae,de,Ee)),P.add(L)}return P.toArray()}function O(U,P){if(!U)throw new Error("Missing beforeTokens");if(!P)throw new Error("Missing afterTokens");var L=0,F=0,R=[],K=A(U,P,0,0),X=V(K);X.push(new b(U.length,P.length,0,K));for(var ae=0;ae<X.length;ae++){var de=X[ae],Ee="none";L===de.startInBefore?F!==de.startInAfter&&(Ee="insert"):(Ee="delete",F!==de.startInAfter&&(Ee="replace")),Ee!=="none"&&R.push({action:Ee,startInBefore:L,endInBefore:Ee!=="insert"?de.startInBefore-1:null,startInAfter:F,endInAfter:Ee!=="delete"?de.startInAfter-1:null}),de.length!==0&&R.push({action:"equal",startInBefore:de.startInBefore,endInBefore:de.endInBefore,startInAfter:de.startInAfter,endInAfter:de.endInAfter}),L=de.endInBefore+1,F=de.endInAfter+1}var ie=[],me={action:"none"};function J(se){return se.action!=="equal"||se.endInBefore-se.startInBefore!==0?!1:/^\s$/.test(U.slice(se.startInBefore,se.endInBefore+1))}for(var ee=0;ee<R.length;ee++){var te=R[ee];J(te)&&me.action==="replace"||te.action==="replace"&&me.action==="replace"?(me.endInBefore=te.endInBefore,me.endInAfter=te.endInAfter):(ie.push(te),me=te)}return ie}function B(U){this.tokens=U,this.notes=U.reduce(function(P,L,F){P.notes.push({isWrappable:g(L),insertedTag:!1});var R=!m(L)&&i(L),K=P.tagStack[P.tagStack.length-1];return R&&(K&&"/"+K.tag===R?(P.notes[K.position].insertedTag=!0,P.tagStack.pop()):P.tagStack.push({tag:R,position:F})),P},{notes:[],tagStack:[]}).notes}B.prototype.combine=function(U,P){var L=this.notes,F=this.tokens.slice(),R=F.reduce(function(K,X,ae){L[ae].insertedTag&&(F[ae]=P(F[ae])),K.status===null&&(K.status=L[ae].isWrappable);var de=L[ae].isWrappable;return de!==K.status&&(K.list.push({isWrappable:K.status,tokens:F.slice(K.lastIndex,ae)}),K.lastIndex=ae,K.status=de),ae===F.length-1&&K.list.push({isWrappable:K.status,tokens:F.slice(K.lastIndex,ae+1)}),K},{list:[],status:null,lastIndex:0}).list;return R.map(U).join("")};function H(U,P,L,F,R){var K=new B(P);F=F?F+"-":"";var X=" data-"+F+'operation-index="'+L+'"';return R&&(X+=' class="'+R+'"'),K.combine(function(ae){if(ae.isWrappable){var de=ae.tokens.join("");if(de.trim())return"<"+U+X+">"+de+"</"+U+">"}else return ae.tokens.join("");return""},function(ae){var de=' data-diff-node="'+U+'"';return de+=" data-"+F+'operation-index="'+L+'"',ae.replace(/>\s*$/,de+"$&")})}var j={equal:function(U,P,L,F,R,K){var X=L.slice(U.startInAfter,U.endInAfter+1);return X.reduce(function(ae,de){return ae+de.string},"")},insert:function(U,P,L,F,R,K){var X=L.slice(U.startInAfter,U.endInAfter+1),ae=X.map(function(de){return de.string});return H("ins",ae,F,R,K)},delete:function(U,P,L,F,R,K){var X=P.slice(U.startInBefore,U.endInBefore+1),ae=X.map(function(de){return de.string});return H("del",ae,F,R,K)},replace:function(){return j.delete.apply(null,arguments)+j.insert.apply(null,arguments)}};function Y(U,P,L,F,R){return L.reduce(function(K,X,ae){return K+j[X.action](X,U,P,ae,F,R)},"")}function N(U,P,L,F,R){if(U===P)return U;R?u=new RegExp("^<("+R.replace(/\s*/g,"").replace(/,/g,"|")+")"):u=c,U=w(U),P=w(P);var K=O(U,P);return Y(U,P,K,F,L)}N.htmlToTokens=w,N.findMatchingBlocks=V,V.findBestMatch=T,V.createMap=C,V.createToken=v,V.createSegment=A,V.getKeyForToken=x,N.calculateOperations=O,N.renderOperations=Y,t!==null?t.exports=N:this.htmldiff=N}).call(ml)})(TS);var Ene=TS.exports;const Sne=gL(Ene),AS=(t,e,n)=>{let r="";{const i=un(t,n),s=un(e,n);r=Sne(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},_ne={key:0,class:"px-2 min-h-[24px] flex items-center justify-between gap-1 mb-1.5"},Tne={class:"flex items-center gap-2"},Ane={class:"body-small text-gray-600 px-[6px] py-[2px] shrink-0 rounded-[4px] bg-gray-100"},Mne={class:"label-large text-gray-800 line-clamp-1"},One={class:"flex items-center gap-1 shrink-0"},Bne={class:"mt-[2px]"},Ine={class:"body-small text-gray-400"},Lne={class:"border border-ed-gray rounded-[5px] p-2.5 my-2 h-full"},Rne={key:0,class:"px-2 min-h-[24px] flex items-center justify-between gap-1 mb-1.5"},Dne={class:"flex items-center gap-2"},Pne={class:"body-small text-blue-500 px-[6px] py-[2px] shrink-0 rounded-[4px] bg-blue-50"},Vne={class:"label-large text-gray-800 line-clamp-1"},Fne={class:"flex items-center gap-1 shrink-0"},$ne={class:"mt-[2px]"},Hne={class:"body-small text-gray-400"},zne=Xr(o.defineComponent({__name:"ArticleCompareEditor",props:{originalData:{},changedData:{},extensions:{},editorClass:{},isCompare:{type:Boolean,default:!0},contentTextStyle:{}},setup(t){const e=t,n=o.computed(()=>[...e.extensions,kS]),r=o.ref(!1),i=o.computed(()=>!e.originalData||!e.changedData?{comment:"",content:""}:{comment:AS(e.originalData.comment,e.changedData.comment,!0),content:AS(e.originalData.content,e.changedData.content,!0)}),{HEADER_ONLY_SIZE:s,pane1ContentVisible:a,pane2ContentVisible:l,pane1Size:u,pane2Size:c,handlePaneResize:f}=_S(!1,6),{isScrolling:p,handleScroll:m}=Xl(),{isScrolling:g,handleScroll:v}=Xl();return(b,w)=>{const x=Ot;return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(ke)("h-full",b.editorClass))},[o.createVNode(o.unref($h),{horizontal:"",onResize:o.unref(f)},{default:o.withCtx(()=>[o.createVNode(o.unref(Xo),{size:o.unref(u),"min-size":o.unref(s),class:"flex flex-col"},{default:o.withCtx(()=>[b.originalData?.titleBar?.title?(o.openBlock(),o.createElementBlock("div",_ne,[o.createElementVNode("div",Tne,[o.createElementVNode("div",Ane,o.toDisplayString(b.$t("기준")),1),o.createElementVNode("h3",Mne,o.toDisplayString(b.originalData?.titleBar?.title),1)]),o.createElementVNode("div",One,[o.createElementVNode("div",Bne,[o.createVNode(x,{name:"Clock",class:"w-[13px] h-[13px] text-gray-400"})]),o.createElementVNode("div",Ine,o.toDisplayString(b.originalData?.titleBar?.time),1)])])):o.createCommentVNode("",!0),o.withDirectives(o.createElementVNode("div",{class:o.normalizeClass(o.unref(ke)("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]=(...C)=>o.unref(m)&&o.unref(m)(...C))},[o.createVNode(Yc,{"editor-class":"h-full",mode:o.unref(Te).REPORT,disabled:"","hide-toolbar":"",extensions:o.unref(n),"field-name-comment":b.originalData?.fieldNameComment,"field-name-content":b.originalData?.fieldNameContent,comment:b.originalData?.comment,"model-value":b.originalData?.content,"hide-comment":b.originalData?.hideComment,"is-compare":b.isCompare,"content-text-style":b.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(Xo),{key:0},{default:o.withCtx(()=>[o.createElementVNode("div",Lne,[o.createVNode(Yc,{"editor-class":"h-full",mode:o.unref(Te).REPORT,disabled:"","hide-toolbar":"",extensions:o.unref(n),"field-name-comment":b.changedData?.fieldNameComment,"field-name-content":b.changedData?.fieldNameContent,comment:b.changedData?.comment,"model-value":b.changedData?.content,"hide-comment":b.changedData?.hideComment,"is-compare":b.isCompare,"content-text-style":b.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(Xo),{size:o.unref(c),"min-size":o.unref(s),class:"flex flex-col"},{default:o.withCtx(()=>[b.changedData?.titleBar?.title?(o.openBlock(),o.createElementBlock("div",Rne,[o.createElementVNode("div",Dne,[o.createElementVNode("div",Pne,o.toDisplayString(b.$t("대상")),1),o.createElementVNode("h3",Vne,o.toDisplayString(b.changedData?.titleBar?.title),1)]),o.createElementVNode("div",Fne,[o.createElementVNode("div",$ne,[o.createVNode(x,{name:"Clock",class:"w-[13px] h-[13px] text-gray-400"})]),o.createElementVNode("div",Hne,o.toDisplayString(b.changedData?.titleBar?.time),1)])])):o.createCommentVNode("",!0),o.withDirectives(o.createElementVNode("div",{class:o.normalizeClass(o.unref(ke)("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]=(...C)=>o.unref(v)&&o.unref(v)(...C))},[o.createVNode(Yc,{"editor-class":"h-full",mode:o.unref(Te).REPORT,disabled:"","hide-toolbar":"",extensions:o.unref(n),"field-name-comment":b.changedData?.fieldNameComment,"field-name-content":b.changedData?.fieldNameContent,comment:o.unref(i).comment,"model-value":o.unref(i).content,"hide-comment":b.changedData?.hideComment,"is-compare":b.isCompare,"content-text-style":b.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-4bdb50a2"]]),Une=o.defineComponent({__name:"SuperViewMobileSuperEditor",props:{isMobile:{type:Boolean},superTextArea:{},mode:{},modelValue:{default:""},comment:{},commentCuesheet:{},hideComment:{type:Boolean},disableSuperInput:{type:Boolean,default:!1},fontSizeDefault:{},fontFamilyDefault:{},fontWeightDefault:{},showSuperElementIdColor:{type:Boolean},letterSpacingDefault:{},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:{},toolbarExtensionOrder:{},watermarkOverlay:{},bottomOffset:{},characterCountLimit:{},blockSeparatorPolicy:{},fixedSuperPreviewWidth:{type:Boolean}},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===Te.EDITOR);const s=ct.useEventBus(ur.RENDER_SUPER_TEXT),a=bn(),{isReady:l,editor:u,updateEditorState:c,checkSpellStore:f}=a,p=o.ref(!1);o.provide("isEditable",p);const m=o.ref(fx(r.modelValue));function g(k){if(r.disabled||r.readonly)return;const T=aE(k);i("lineFocus",{lineIndex:T})}function v(){i("lineFocus",{lineIndex:void 0})}const b=new Oo({enablePasteRules:!1,enableInputRules:!1,content:m.value,onCreate:({editor:k})=>{c(k)},onUpdate:St.throttle(({editor:k})=>{l.value=!0;const T=E(k,r.output);i("update:modelValue",T),i("change",{editor:k,output:T}),c(k)},Lo),extensions:St.uniqBy(r.extensions,"name"),editable:p.value,onFocus:()=>{x(),w.value=!0,g(b)},onBlur:()=>{w.value=!1,v()},onSelectionUpdate:()=>{g(b)}}),w=o.ref(!1);function x(){i("setEditorSelected",b)}function C(){s.emit({action:"render"})}function E(k,T){if(!k)return"";if(k.isEmpty)return T==="json"?{}:"";switch(T){case"html":return k.getHTML();case"json":return k.getJSON();case"text":return k.getText();default:return""}}return o.watch(()=>f.languages,()=>{b.commands.checkSpelling()}),o.watch(()=>r.modelValue,k=>{if(!b||St.isEqual(E(b,r.output),k))return;const{from:T,to:_}=b.state.selection;b.commands.setTextSelection({from:T,to:_}),C(),m.value=fx(k)},{deep:!0}),o.watch(()=>u.value,()=>{u.value&&u.value.on("selectionUpdate",({editor:k})=>{i("changed:selection",{editor:k})})}),o.watch(()=>r.disableSuperInput,()=>{document.getElementById(ir.COMMENT)?.setAttribute(ir.DISABLE_SUPER_INPUT,`${r.disableSuperInput}`)}),o.onUnmounted(()=>b?.destroy()),Ph(b),o.onMounted(()=>{b?.commands?.setIsEnableSuggestion&&b.commands.setIsEnableSuggestion(!1),b?.commands?.setIsMobile&&b.commands.setIsMobile(!0)}),e({editor:b}),(k,T)=>{const _=Xc;return o.openBlock(),o.createElementBlock(o.Fragment,null,[k.fieldNameSuper?.label?(o.openBlock(),o.createBlock(_,{key:0,"field-name":k.fieldNameSuper,mode:k.mode,disabled:k.disabled,class:"mb-1",intent:"secondary"},null,8,["field-name","mode","disabled"])):o.createCommentVNode("",!0),o.createVNode(o.unref(Yn),{editor:o.unref(b),spellcheck:"true",class:o.normalizeClass(["flex-1 flex-col"])},null,8,["editor"])],64)}}}),Wne=(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},MS="focused-line";async function OS({lineIndex:t,editor:e}){if(e.state.doc.descendants((l,u)=>{if(l.attrs.class===MS){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=Wne(e,t);if(!n)return;const{node:r,pos:i}=n,s=e.state.tr.setNodeMarkup(i,void 0,{...r.attrs,class:MS});e.view.dispatch(s),await o.nextTick(),e.view.nodeDOM(i).scrollIntoView({behavior:"smooth"})}const jne=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:""},fontWeightDefault:{default:void 0},showSuperElementIdColor:{type:Boolean},letterSpacingDefault:{},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:{},toolbarExtensionOrder:{},watermarkOverlay:{},bottomOffset:{},characterCountLimit:{},blockSeparatorPolicy:{},fixedSuperPreviewWidth:{type:Boolean}},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;Gc(),o.provide("isMobile",!0),o.computed(()=>r.mode===Te.EDITOR);const s=ct.useEventBus(ur.INCREASE_DECREASE_FONTSIZE);o.useAttrs();const a=bn(),{state:l,isFullscreen:u,isReady:c,editor:f,updateEditorState:p,checkSpellStore:m}=a,g=o.ref(!1);o.provide("isEditable",g);const v=o.ref(void 0),b=o.ref(),w=o.ref(r.fontSizeDefault),x=o.ref(r.fontFamilyDefault),C=o.ref(r.fontWeightDefault);o.provide("fontSize",w),o.provide("fontFamily",x),o.provide("fontWeight",C);const E=o.computed(()=>({fontFamily:x.value,fontSize:w.value,...C.value?{fontWeight:C.value}:{}})),k=o.ref(),T=P=>{const L=parseInt(w.value||"12px"),F=P?L+2:L-2;w.value=F+"px"};o.onBeforeMount(()=>{s.on(T)}),o.onBeforeUnmount(()=>{s.off(T)});const _=o.computed(()=>({...o.unref(u)?{height:"100%"}:{minHeight:r.minHeight?Yt(r.minHeight):void 0,maxHeight:r.maxHeight?Yt(r.maxHeight):void 0,height:r.height?Yt(r.height):void 0},maxWidth:Yt(r.maxWidth),width:r.maxWidth?"100%":void 0,margin:r.maxWidth?"0 auto":void 0}));function A(P){if(r.disabled||r.readonly)return;const L=aE(P);v.value=L}function V(){v.value=void 0}const O=new Oo({enablePasteRules:!1,enableInputRules:!1,content:un(r.modelValue,r.disabled,r.mode),onCreate:({editor:P})=>{p(P)},onUpdate:St.throttle(({editor:P})=>{c.value=!0;const L=N(P,r.output);i("update:modelValue",L),i("change",{editor:P,output:L}),p(P)},Lo),extensions:St.uniqBy(r.extensions,"name"),editable:g.value,onFocus:()=>{Y(),B.value=!0,A(O)},onBlur:()=>{B.value=!1,V()},onSelectionUpdate:()=>{A(O)}}),B=o.ref(!1),H=o.ref();o.onMounted(()=>{H.value=O});const j=({lineIndex:P})=>{O&&OS({lineIndex:P,editor:O});const L=b.value?.editor;L&&OS({lineIndex:P,editor:L})};o.watch(()=>v.value,P=>{i("lineFocus",{lineIndex:P}),j({lineIndex:P})},{immediate:!0});function Y(P){H.value=O}function N(P,L){if(!P)return"";if(P.isEmpty)return L==="json"?{}:"";switch(L){case"html":return P.getHTML();case"json":return P.getJSON();case"text":return P.getText({blockSeparator:`
|
|
360
360
|
`});default:return""}}function U(P){return P.every(L=>O?.extensionManager.extensions.find(F=>F.name===L))}return o.watch(()=>m.languages,()=>{O.commands.checkSpelling()}),o.watch(()=>r.modelValue,P=>{if(!O||St.isEqual(N(O,r.output),P))return;const{from:L,to:F}=O.state.selection;O.commands.setTextSelection({from:L,to:F}),O.commands.setContent(un(P,r.disabled,r.mode),!1)},{deep:!0}),o.watch(()=>f.value,()=>{f.value&&f.value.on("selectionUpdate",({editor:P})=>{i("changed:selection",{editor:P})})}),o.onUnmounted(()=>{O?.destroy(),H.value?.destroy()}),Ju(ju.SAVE,()=>{localStorage.setItem("content",N(O,"html"))}),o.onMounted(()=>{O?.commands?.setIsEnableSuggestion&&O.commands.setIsEnableSuggestion(!1),O?.commands?.setIsMobile&&O.commands.setIsMobile(!0)}),Ph(O),e({editor:O}),(P,L)=>{const F=Dh,R=Rh,K=Lh,X=uS,ae=xS,de=Xc;return H.value?(o.openBlock(),o.createElementBlock("div",{key:0,id:"vdc-editor",ref_key:"editorRef",ref:k,style:o.normalizeStyle(_.value),class:o.normalizeClass(o.unref(ke)("vdc-editor mobile relative w-full flex flex-col editor-line-number editor-line",!r.height&&"flex-1",P.editorClass))},[!P.hideBubble&&!P.disabled&&g.value?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[U([o.unref(Ic)])?(o.openBlock(),o.createBlock(F,{key:0,editor:o.unref(O)},null,8,["editor"])):o.createCommentVNode("",!0),U([o.unref(_a)])?(o.openBlock(),o.createBlock(R,{key:1,editor:o.unref(O)},null,8,["editor"])):o.createCommentVNode("",!0),U([o.unref(Ss)])?(o.openBlock(),o.createBlock(K,{key:2,editor:o.unref(O)},null,8,["editor"])):o.createCommentVNode("",!0),U([o.unref(zl),o.unref(Ci)])?(o.openBlock(),o.createBlock(X,{key:3,editor:o.unref(O)},null,8,["editor"])):o.createCommentVNode("",!0)],64)):o.createCommentVNode("",!0),P.hideToolbar?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(ae,{key:1,editor:H.value,mode:P.mode,disabled:P.disabled,class:"mb-[3px]","custom-class-toolbar":P.customClassToolbar,"active-extensions":[ki]},null,8,["editor","mode","disabled","custom-class-toolbar","active-extensions"])),o.createVNode(o.unref($h),{class:o.normalizeClass(o.unref(ke)("flex flex-col")),style:o.normalizeStyle({...E.value}),horizontal:""},{default:o.withCtx(()=>[o.createVNode(o.unref(Xo),{size:50,class:"border-none p-0 flex flex-col bg-[#EEEEEE]"},{default:o.withCtx(()=>[o.createElementVNode("div",{class:o.normalizeClass(o.unref(ke)("flex-1 !overflow-y-auto scrollbar-hide basis-0 flex flex-col pt-1.5 p-2.5 border border-ed-gray rounded-[5px]",P.contentClass))},[P.fieldNameContent?.label?(o.openBlock(),o.createBlock(de,{key:0,"field-name":P.fieldNameContent,mode:P.mode,disabled:P.disabled,class:"mb-1"},null,8,["field-name","mode","disabled"])):o.createCommentVNode("",!0),o.createVNode(o.unref(Yn),{editor:o.unref(O),spellcheck:"true",class:o.normalizeClass(["flex-1 flex-col"])},null,8,["editor"])],2)]),_:1}),o.createVNode(o.unref(Xo),{size:50,class:"border-none p-0 flex flex-col"},{default:o.withCtx(()=>[o.createElementVNode("div",{class:o.normalizeClass(o.unref(ke)("flex-1 overflow-y-auto scrollbar-hide flex flex-col pt-1.5 p-2.5 border border-ed-gray rounded-[5px]",B.value&&"border-ed-blue",P.disabled&&"border-transparent",P.contentClass))},[o.createVNode(Une,{ref_key:"superEditorRef",ref:b,mode:P.mode,"field-name-super":P.fieldNameSuper,extensions:P.extensions,"model-value":P.modelValue,disabled:P.disabled,readonly:P.readonly,onLineFocus:j},null,8,["mode","field-name-super","extensions","model-value","disabled","readonly"])],2)]),_:1})]),_:1},8,["class","style"])],6)):o.createCommentVNode("",!0)}}});function qne(t,e){if(!t)return t;const n=document.createElement("div");n.innerHTML=t;const r=JE(e),i=document.createTreeWalker(n,NodeFilter.SHOW_TEXT),s=[];for(;i.nextNode();)s.push(i.currentNode);for(const a of s.reverse()){if(a.parentElement?.classList.contains("time-highlight")||a.parentElement?.closest("code, pre"))continue;const l=a.textContent||"";if(!l.trim())continue;let u=0;const c=[];let f;for(r.lastIndex=0;(f=r.exec(l))!==null;){f.index>u&&c.push(l.slice(u,f.index));const p=document.createElement("span");p.className="time-highlight",p.textContent=f[0],c.push(p),u=r.lastIndex}if(c.length>0){u<l.length&&c.push(l.slice(u));const p=a.parentNode;for(const m of c)typeof m=="string"?p.insertBefore(document.createTextNode(m),a):p.insertBefore(m,a);p.removeChild(a)}}return n.innerHTML}const Kne={key:0,class:"readonly-viewer-section"},Gne=["innerHTML"],Xne={key:1,class:"readonly-viewer-section"},Yne=["innerHTML"],Jne={key:2,class:"readonly-viewer-section"},Zne=["innerHTML"],Qne=["innerHTML"],Nne=o.defineComponent({__name:"ReadonlyViewer",props:{content:{},comment:{default:""},commentCuesheet:{default:""},mode:{default:Te.STRAIGHT},dark:{type:Boolean,default:void 0},fontSizeDefault:{default:"14px"},fontFamilyDefault:{default:"NanumGothicCoding"},fontWeightDefault:{default:void 0},blockSeparatorPolicy:{default:"paragraph"},timeHighlight:{type:Boolean,default:!1},additionalTimeWords:{default:()=>[]},contentClass:{default:void 0},editorClass:{default:void 0},minHeight:{default:void 0},maxHeight:{default:void 0},autoHeight:{type:Boolean,default:!0},preventCopy:{type:Boolean,default:!1},hideComment:{type:Boolean,default:!1},fieldNameComment:{default:null},fieldNameCommentCuesheet:{default:null},fieldNameContent:{default:null}},emits:["on-change-selection"],setup(t,{expose:e,emit:n}){const r=t,i=n,s=o.ref(null),a=o.computed(()=>r.mode===Te.REPORT||r.mode===Te.STRAIGHT||r.mode===Te.PLAIN_TEXT),l=o.ref(!1);function u(){l.value=!!s.value?.closest(".dark")||document.documentElement.classList.contains("dark")}const c=o.computed(()=>r.dark===!0||l.value);o.onMounted(()=>{u();const _=new MutationObserver(u);_.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),o.onBeforeUnmount(()=>_.disconnect())});function f(_){let A=un(_,!0,r.mode);return typeof A!="string"?"":(r.timeHighlight&&(A=qne(A,r.additionalTimeWords)),c.value&&!a.value&&(A=Ete(A)),A)}const p=o.computed(()=>f(r.content)),m=o.computed(()=>r.comment?f(r.comment):""),g=o.computed(()=>r.commentCuesheet?f(r.commentCuesheet):""),v=o.computed(()=>!r.hideComment&&(r.fieldNameComment?.label||r.fieldNameCommentCuesheet?.label||r.fieldNameContent?.label)),b=o.computed(()=>({fontFamily:r.fontFamilyDefault,fontSize:r.fontSizeDefault,...r.fontWeightDefault?{fontWeight:r.fontWeightDefault}:{},minHeight:r.minHeight?Yt(r.minHeight):void 0,maxHeight:r.maxHeight?Yt(r.maxHeight):void 0,overflowY:r.maxHeight?"auto":void 0})),w=_=>{if(r.preventCopy){_.preventDefault(),_.stopPropagation();return}const A=document.getSelection();if(!(!A||A.isCollapsed||A.rangeCount===0)&&!(!s.value||!s.value.contains(A.anchorNode)))try{const O=A.getRangeAt(0).cloneContents(),B=document.createElement("div");B.appendChild(O);const H=B.innerHTML,j=r.blockSeparatorPolicy==="line"?`
|
|
361
361
|
`:`
|
|
362
362
|
|