@white-give/editor-vue 1.0.5 → 1.0.6

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/dist/lib/index.js CHANGED
@@ -271,7 +271,7 @@ echarts.use([`+F+"]);":"Unknown series "+V))}return}if(f==="tooltip"){if(_){proc
271
271
  1. Must only contain digits, lowercase ASCII letters or "-"
272
272
  2. Cannot start or end with "-"
273
273
  3. "-" cannot repeat`);Cr.customSchemes.push([n,e])}function MLe(){Cr.scanner=xLe(Cr.customSchemes);for(let n=0;n<Cr.tokenQueue.length;n++)Cr.tokenQueue[n][1]({scanner:Cr.scanner});Cr.parser=wLe(Cr.scanner.tokens);for(let n=0;n<Cr.pluginQueue.length;n++)Cr.pluginQueue[n][1]({scanner:Cr.scanner,parser:Cr.parser});return Cr.initialized=!0,Cr}function LO(n){return Cr.initialized||MLe(),kLe(Cr.parser.start,n,TY(Cr.scanner.start,n))}LO.scan=TY;function EY(n,e=null,t=null){if(e&&typeof e=="object"){if(t)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);t=e,e=null}const r=new RO(t),i=LO(n),a=[];for(let o=0;o<i.length;o++){const s=i[o];s.isLink&&(!e||s.t===e)&&r.check(s)&&a.push(s.toFormattedObject(r))}return a}function ALe(n){return n.length===1?n[0].isLink:n.length===3&&n[1].isLink?["()","[]"].includes(n[0].value+n[2].value):!1}function NLe(n){return new $n({key:new Wn("autolink"),appendTransaction:(e,t,r)=>{const i=e.some(u=>u.docChanged)&&!t.doc.eq(r.doc),a=e.some(u=>u.getMeta("preventAutolink"));if(!i||a)return;const{tr:o}=r,s=rre(t.doc,[...e]);if(ure(s).forEach(({newRange:u})=>{const c=are(r.doc,u,h=>h.isTextblock);let f,d;if(c.length>1?(f=c[0],d=r.doc.textBetween(f.pos,f.pos+f.node.nodeSize,void 0," ")):c.length&&r.doc.textBetween(u.from,u.to," "," ").endsWith(" ")&&(f=c[0],d=r.doc.textBetween(f.pos,u.to,void 0," ")),f&&d){const h=d.split(" ").filter(y=>y!=="");if(h.length<=0)return!1;const p=h[h.length-1],v=f.pos+d.lastIndexOf(p);if(!p)return!1;const g=LO(p).map(y=>y.toObject(n.defaultProtocol));if(!ALe(g))return!1;g.filter(y=>y.isLink).map(y=>({...y,from:v+y.start+1,to:v+y.end+1})).filter(y=>r.schema.marks.code?!r.doc.rangeHasMark(y.from,y.to,r.schema.marks.code):!0).filter(y=>n.validate(y.value)).filter(y=>n.shouldAutoLink(y.value)).forEach(y=>{VA(y.from,y.to,r.doc).some(b=>b.mark.type===n.type)||o.addMark(y.from,y.to,n.type.create({href:y.href}))})}}),!!o.steps.length)return o}})}function DLe(n){return new $n({key:new Wn("handleClickLink"),props:{handleClick:(e,t,r)=>{var i,a;if(r.button!==0||!e.editable)return!1;let o=r.target;const s=[];for(;o.nodeName!=="DIV";)s.push(o),o=o.parentNode;if(!s.find(d=>d.nodeName==="A"))return!1;const l=aF(e.state,n.type.name),u=r.target,c=(i=u?.href)!==null&&i!==void 0?i:l.href,f=(a=u?.target)!==null&&a!==void 0?a:l.target;return u&&c?(window.open(c,f),!0):!1}}})}function OLe(n){return new $n({key:new Wn("handlePasteLink"),props:{handlePaste:(e,t,r)=>{const{state:i}=e,{selection:a}=i,{empty:o}=a;if(o)return!1;let s="";r.content.forEach(u=>{s+=u.textContent});const l=EY(s,{defaultProtocol:n.defaultProtocol}).find(u=>u.isLink&&u.value===s);return!s||!l?!1:n.editor.commands.setMark(n.type,{href:l.href})}}})}const ILe=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function uf(n,e){const t=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const i=typeof r=="string"?r:r.scheme;i&&t.push(i)}),!n||n.replace(ILe,"").match(new RegExp(`^(?:(?:${t.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const RLe=yc.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(n=>{if(typeof n=="string"){QV(n);return}QV(n.scheme,n.optionalSlashes)})},onDestroy(){ELe()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(n,e)=>!!uf(n,e.protocols),validate:n=>!!n,shouldAutoLink:n=>!!n}},addAttributes(){return{href:{default:null,parseHTML(n){return n.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:n=>{const e=n.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:t=>!!uf(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:n}){return this.options.isAllowedUri(n.href,{defaultValidate:e=>!!uf(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Jn(this.options.HTMLAttributes,n),0]:["a",Jn(this.options.HTMLAttributes,{...n,href:""}),0]},addCommands(){return{setLink:n=>({chain:e})=>{const{href:t}=n;return this.options.isAllowedUri(t,{defaultValidate:r=>!!uf(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,n).setMeta("preventAutolink",!0).run():!1},toggleLink:n=>({chain:e})=>{const{href:t}=n;return this.options.isAllowedUri(t,{defaultValidate:r=>!!uf(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().toggleMark(this.name,n,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:n})=>n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[tb({find:n=>{const e=[];if(n){const{protocols:t,defaultProtocol:r}=this.options,i=EY(n).filter(a=>a.isLink&&this.options.isAllowedUri(a.value,{defaultValidate:o=>!!uf(o,t),protocols:t,defaultProtocol:r}));i.length&&i.forEach(a=>e.push({text:a.value,data:{href:a.href},index:a.start}))}return e},type:this.type,getAttributes:n=>{var e;return{href:(e=n.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const n=[],{protocols:e,defaultProtocol:t}=this.options;return this.options.autolink&&n.push(NLe({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!uf(i,e),protocols:e,defaultProtocol:t}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&n.push(DLe({type:this.type})),this.options.linkOnPaste&&n.push(OLe({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),n}}),MY=RLe.extend({addStorage(){return{edit:!1,meta:{}}},addProseMirrorPlugins(){return[new $n({props:{handleClick(n,e,t){const r=t.target;if(r.tagName==="A"){const i=r.getAttribute("href");return n.dispatch(n.state.tr.setMeta("link-click",{target:r,href:i,pos:e})),!0}return!1}}})]},onTransaction({transaction:n}){const e=n.getMeta("link-click");e&&(this.storage.edit=!0,this.storage.meta=e)}});MY.configure({openOnClick:n=>!n.editor.isEditable});const LLe=fr.create({name:"margin",addOptions(){return{types:["heading","paragraph","audio","codeBlock","file","iframe","image","toc","video","horizontalRule","table","bulletList","orderedList","taskList","echarts"],margin:{top:0,bottom:0}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{margin:{default:{},parseHTML:n=>{const{marginTop:e,marginBottom:t}=n.style;if(e===""&&t===""||e==="0px"&&t==="0px")return{};const r={top:"0px",bottom:"0px"};return e&&e!=="0px"&&(r.top=e.replace(/px/g,"")),t&&t!=="0px"&&(r.bottom=t.replace(/px/g,"")),r},renderHTML:({margin:n})=>{if(!Object.keys(n).length)return{};const{top:e,bottom:t}=n;let r="";return e&&e!==""&&(r+=`margin-top: ${e}px;`),t&&t!==""&&(r+=`margin-bottom: ${t}px;`),{style:r}}}}}]},addCommands(){return{setMargin:n=>({editor:e,commands:t})=>this.options.types.every(r=>{const{margin:i}=e.getAttributes(r);return t.updateAttributes(r,{margin:Object.assign({},i,n)})}),unsetMargin:()=>({commands:n})=>this.options.types.every(e=>n.resetAttributes(e,"margin"))}}});function PLe(n){var e;const{char:t,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:a,startOfLine:o,$position:s}=n,l=r&&!i,u=Hre(t),c=new RegExp(`\\s${u}$`),f=o?"^":"",d=i?"":u,h=l?new RegExp(`${f}${u}.*?(?=\\s${d}|$)`,"gm"):new RegExp(`${f}(?:^)?${u}[^\\s${d}]*`,"gm"),p=((e=s.nodeBefore)===null||e===void 0?void 0:e.isText)&&s.nodeBefore.text;if(!p)return null;const v=s.pos-p.length,g=Array.from(p.matchAll(h)).pop();if(!g||g.input===void 0||g.index===void 0)return null;const y=g.input.slice(Math.max(0,g.index-1),g.index),b=new RegExp(`^[${a?.join("")}\0]?$`).test(y);if(a!==null&&!b)return null;const _=v+g.index;let x=_+g[0].length;return l&&c.test(p.slice(x-1,x+1))&&(g[0]+=" ",x+=1),_<s.pos&&x>=s.pos?{range:{from:_,to:x},query:g[0].slice(t.length),text:g[0]}:null}const BLe=new Wn("suggestion");function VLe({pluginKey:n=BLe,editor:e,char:t="@",allowSpaces:r=!1,allowToIncludeChar:i=!1,allowedPrefixes:a=[" "],startOfLine:o=!1,decorationTag:s="span",decorationClass:l="suggestion",command:u=()=>null,items:c=()=>[],render:f=()=>({}),allow:d=()=>!0,findSuggestionMatch:h=PLe}){let p;const v=f?.(),g=new $n({key:n,view(){return{update:async(y,b)=>{var _,x,T,k,C,D,O;const R=(_=this.key)===null||_===void 0?void 0:_.getState(b),V=(x=this.key)===null||x===void 0?void 0:x.getState(y.state),F=R.active&&V.active&&R.range.from!==V.range.from,$=!R.active&&V.active,J=R.active&&!V.active,te=!$&&!J&&R.query!==V.query,Q=$||F&&te,ne=te||F,ee=J||F&&te;if(!Q&&!ne&&!ee)return;const de=ee&&!Q?R:V,ke=y.dom.querySelector(`[data-decoration-id="${de.decorationId}"]`);p={editor:e,range:de.range,query:de.query,text:de.text,items:[],command:Ee=>u({editor:e,range:de.range,props:Ee}),decorationNode:ke,clientRect:ke?()=>{var Ee;const{decorationId:xe}=(Ee=this.key)===null||Ee===void 0?void 0:Ee.getState(e.state),De=y.dom.querySelector(`[data-decoration-id="${xe}"]`);return De?.getBoundingClientRect()||null}:null},Q&&((T=v?.onBeforeStart)===null||T===void 0||T.call(v,p)),ne&&((k=v?.onBeforeUpdate)===null||k===void 0||k.call(v,p)),(ne||Q)&&(p.items=await c({editor:e,query:de.query})),ee&&((C=v?.onExit)===null||C===void 0||C.call(v,p)),ne&&((D=v?.onUpdate)===null||D===void 0||D.call(v,p)),Q&&((O=v?.onStart)===null||O===void 0||O.call(v,p))},destroy:()=>{var y;p&&((y=v?.onExit)===null||y===void 0||y.call(v,p))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(y,b,_,x){const{isEditable:T}=e,{composing:k}=e.view,{selection:C}=y,{empty:D,from:O}=C,R={...b};if(R.composing=k,T&&(D||e.view.composing)){(O<b.range.from||O>b.range.to)&&!k&&!b.composing&&(R.active=!1);const V=h({char:t,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:a,startOfLine:o,$position:C.$from}),F=`id_${Math.floor(Math.random()*4294967295)}`;V&&d({editor:e,state:x,range:V.range,isActive:b.active})?(R.active=!0,R.decorationId=b.decorationId?b.decorationId:F,R.range=V.range,R.query=V.query,R.text=V.text):R.active=!1}else R.active=!1;return R.active||(R.decorationId=null,R.range={from:0,to:0},R.query=null,R.text=null),R}},props:{handleKeyDown(y,b){var _;const{active:x,range:T}=g.getState(y.state);return x&&((_=v?.onKeyDown)===null||_===void 0?void 0:_.call(v,{view:y,event:b,range:T}))||!1},decorations(y){const{active:b,range:_,decorationId:x}=g.getState(y);return b?hr.create(y.doc,[ii.inline(_.from,_.to,{nodeName:s,class:l,"data-decoration-id":x})]):null}}});return g}const zLe=new Wn("mention"),FLe=yi.create({name:"mention",priority:101,addOptions(){return{HTMLAttributes:{},renderText({options:n,node:e}){var t;return`${n.suggestion.char}${(t=e.attrs.label)!==null&&t!==void 0?t:e.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:n,node:e}){var t;return["span",Jn(this.HTMLAttributes,n.HTMLAttributes),`${n.suggestion.char}${(t=e.attrs.label)!==null&&t!==void 0?t:e.attrs.id}`]},suggestion:{char:"@",pluginKey:zLe,command:({editor:n,range:e,props:t})=>{var r,i,a;const o=n.view.state.selection.$to.nodeAfter;((r=o?.text)===null||r===void 0?void 0:r.startsWith(" "))&&(e.to+=1),n.chain().focus().insertContentAt(e,[{type:this.name,attrs:t},{type:"text",text:" "}]).run(),(a=(i=n.view.dom.ownerDocument.defaultView)===null||i===void 0?void 0:i.getSelection())===null||a===void 0||a.collapseToEnd()},allow:({state:n,range:e})=>{const t=n.doc.resolve(e.from),r=n.schema.nodes[this.name];return!!t.parent.type.contentMatch.matchType(r)}}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:n=>n.getAttribute("data-id"),renderHTML:n=>n.id?{"data-id":n.id}:{}},label:{default:null,parseHTML:n=>n.getAttribute("data-label"),renderHTML:n=>n.label?{"data-label":n.label}:{}}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:n,HTMLAttributes:e}){if(this.options.renderLabel!==void 0)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",Jn({"data-type":this.name},this.options.HTMLAttributes,e),this.options.renderLabel({options:this.options,node:n})];const t={...this.options};t.HTMLAttributes=Jn({"data-type":this.name},this.options.HTMLAttributes,e);const r=this.options.renderHTML({options:t,node:n});return typeof r=="string"?["span",Jn({"data-type":this.name},this.options.HTMLAttributes,e),r]:r},renderText({node:n}){return this.options.renderLabel!==void 0?(console.warn("renderLabel is deprecated use renderText and renderHTML instead"),this.options.renderLabel({options:this.options,node:n})):this.options.renderText({options:this.options,node:n})},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:n,state:e})=>{let t=!1;const{selection:r}=e,{empty:i,anchor:a}=r;return i?(e.doc.nodesBetween(a-1,a,(o,s)=>{if(o.type.name===this.name)return t=!0,n.insertText(this.options.deleteTriggerWithBackspace?"":this.options.suggestion.char||"",s,s+o.nodeSize),!1}),t):!1})}},addProseMirrorPlugins(){return[VLe({editor:this.editor,...this.options.suggestion})]}}),$Le=FLe.extend({addAttributes(){return{id:{default:null},label:{default:null}}},addCommands(){return{insertMention:()=>({commands:n})=>n.insertContent(` ${this.options?.suggestion?.char??"@"}`)}}}),HLe=$Le.configure({HTMLAttributes:{class:"white-node-mention"}}),GLe={key:0,class:"list-none text-[#333] text-[14px]"},ULe={class:"bg-white border rounded-md shadow-md p-2 max-h-[300px] overflow-y-auto"},WLe=["onClick"],jLe=m.defineComponent({__name:"mentions",props:{items:{type:Array,required:!0},command:{type:Function,required:!0}},setup(n,{expose:e}){const t=n,r=m.ref(0);m.watch(()=>t.items,()=>{r.value=0});const i=({event:u})=>u.key==="ArrowUp"?(a(),!0):u.key==="ArrowDown"?(o(),!0):u.key==="Enter"?t.items.length===0?!1:(s(),!0):!1,a=()=>{r.value=(r.value+t.items.length-1)%t.items.length},o=()=>{r.value=(r.value+1)%t.items.length},s=()=>{l(r.value)},l=u=>{const c=t.items[u];c&&t.command(c)};return e({onKeyDown:i}),(u,c)=>n.items.length>0?(m.openBlock(),m.createElementBlock("div",GLe,[m.createElementVNode("ul",ULe,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(n.items,(f,d)=>(m.openBlock(),m.createElementBlock("li",{key:d,class:m.normalizeClass(["!px-2 cursor-pointer h-[30px] flex items-center rounded-md hover:bg-[#f5f5f5]",{"bg-[#007bff] text-white hover:!bg-[#007bff] hover:text-white":d===r.value}]),onClick:h=>l(d)},m.toDisplayString(f.label),11,WLe))),128))])])):m.createCommentVNode("",!0)}}),qLe=(n,e)=>({items:({query:t})=>n.filter(r=>r.label.includes(t)).slice(0,10),command:({editor:t,range:r,props:i})=>{console.log(i),t.chain().focus().deleteRange(r).insertContent({type:"mention",attrs:{id:i.id,label:i.label}}).run()},render:()=>{let t,r;return{onStart:i=>{t=new DF(jLe,{props:i,editor:i.editor}),i.clientRect&&(r=Zl("body",{getReferenceClientRect:i.clientRect,appendTo:document.querySelector(`#${e}`),content:t.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"}))},onUpdate(i){t.updateProps(i),i.clientRect&&r[0].setProps({getReferenceClientRect:i.clientRect})},onKeyDown(i){return i.event.key==="Escape"?(r[0].hide(),!0):t.ref?.onKeyDown(i)},onExit(){r[0].destroy(),t.destroy()}}}}),KLe=fr.create({name:"nodeAlign",addOptions(){return{defaultAlignment:"center",alignments:["flex-start","center","flex-end"],types:["image","video","audio","iframe","file","echarts"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{nodeAlign:{default:this.options.defaultAlignment,parseHTML:n=>n.style.justifyContent||this.options.defaultAlignment,renderHTML:n=>n.nodeAlign===this.options.defaultAlignment?{}:{style:`justify-content: ${n.nodeAlign}`}}}}]},addCommands(){return{setNodeAlign:n=>({state:e,dispatch:t,tr:r})=>{if(!this.options.alignments.includes(n))return!1;const{selection:i}=e;let a=!1;return e.doc.nodesBetween(i.from,i.to,(o,s)=>{if(this.options.types.includes(o.type.name))return r.setNodeMarkup(s,void 0,{...o.attrs,nodeAlign:n}),a=!0,!1}),a&&t&&t(r),a},unsetNodeAlign:()=>({state:n,dispatch:e,tr:t})=>{const{selection:r}=n;let i=!1;return n.doc.nodesBetween(r.from,r.to,(a,o)=>{if(this.options.types.includes(a.type.name))return t.setNodeMarkup(o,void 0,{...a.attrs,nodeAlign:this.options.defaultAlignment}),i=!0,!1}),i&&e&&e(t),i}}}}),YLe="listItem",ez="textStyle",tz=/^(\d+)\.\s$/,XLe=yi.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:n=>n.hasAttribute("start")?parseInt(n.getAttribute("start")||"",10):1},type:{default:void 0,parseHTML:n=>n.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:n}){const{start:e,...t}=n;return e===1?["ol",Jn(this.options.HTMLAttributes,t),0]:["ol",Jn(this.options.HTMLAttributes,n),0]},addCommands(){return{toggleOrderedList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(YLe,this.editor.getAttributes(ez)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let n=Jg({find:tz,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(n=Jg({find:tz,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(ez)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[n]}}),ZLe=XLe.extend({content:"listItem*",addAttributes(){return{...this.parent?.(),listType:{default:"decimal",parseHTML:n=>n.style.getPropertyValue("list-style-type")||"decimal",renderHTML:({listType:n})=>({style:`list-style-type: ${n}`,type:n})}}}}),JLe=fr.create({name:"selection",addProseMirrorPlugins(){const{editor:n}=this;return[new $n({key:new Wn("selection"),props:{decorations(e){return e.selection.empty||n.isFocused?null:hr.create(e.doc,[ii.inline(e.selection.from,e.selection.to,{class:"white-selection"})])}}})]},addCommands(){return{setCurrentNodeSelection:()=>({editor:n,chain:e})=>{n.commands.selectParentNode();const{$anchor:t}=n.state.selection;return e().setNodeSelection(t.pos-t.depth).run()},deleteSelectionNode:()=>({editor:n,commands:e})=>{const t=Fl(n);return t?e.deleteSelection()?!0:e.deleteNode(t.type.name):!1}}}});function Fl(n){const{$anchor:e,node:t}=n.state.selection;return t?.type?.isAtom?t:(n.commands.selectParentNode(),e.node(1)||t)}function QLe(n){const{from:e,to:t,empty:r}=n.state.selection;return r?"":n.state.doc.textBetween(e,t,"")}var zM,FM;if(typeof WeakMap<"u"){let n=new WeakMap;zM=e=>n.get(e),FM=(e,t)=>(n.set(e,t),t)}else{const n=[];let t=0;zM=r=>{for(let i=0;i<n.length;i+=2)if(n[i]==r)return n[i+1]},FM=(r,i)=>(t==10&&(t=0),n[t++]=r,n[t++]=i)}var Br=class{constructor(n,e,t,r){this.width=n,this.height=e,this.map=t,this.problems=r}findCell(n){for(let e=0;e<this.map.length;e++){const t=this.map[e];if(t!=n)continue;const r=e%this.width,i=e/this.width|0;let a=r+1,o=i+1;for(let s=1;a<this.width&&this.map[e+s]==t;s++)a++;for(let s=1;o<this.height&&this.map[e+this.width*s]==t;s++)o++;return{left:r,top:i,right:a,bottom:o}}throw new RangeError(`No cell with offset ${n} found`)}colCount(n){for(let e=0;e<this.map.length;e++)if(this.map[e]==n)return e%this.width;throw new RangeError(`No cell with offset ${n} found`)}nextCell(n,e,t){const{left:r,right:i,top:a,bottom:o}=this.findCell(n);return e=="horiz"?(t<0?r==0:i==this.width)?null:this.map[a*this.width+(t<0?r-1:i)]:(t<0?a==0:o==this.height)?null:this.map[r+this.width*(t<0?a-1:o)]}rectBetween(n,e){const{left:t,right:r,top:i,bottom:a}=this.findCell(n),{left:o,right:s,top:l,bottom:u}=this.findCell(e);return{left:Math.min(t,o),top:Math.min(i,l),right:Math.max(r,s),bottom:Math.max(a,u)}}cellsInRect(n){const e=[],t={};for(let r=n.top;r<n.bottom;r++)for(let i=n.left;i<n.right;i++){const a=r*this.width+i,o=this.map[a];t[o]||(t[o]=!0,!(i==n.left&&i&&this.map[a-1]==o||r==n.top&&r&&this.map[a-this.width]==o)&&e.push(o))}return e}positionAt(n,e,t){for(let r=0,i=0;;r++){const a=i+t.child(r).nodeSize;if(r==n){let o=e+n*this.width;const s=(n+1)*this.width;for(;o<s&&this.map[o]<i;)o++;return o==s?a-1:this.map[o]}i=a}}static get(n){return zM(n)||FM(n,e3e(n))}};function e3e(n){if(n.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+n.type.name);const e=t3e(n),t=n.childCount,r=[];let i=0,a=null;const o=[];for(let u=0,c=e*t;u<c;u++)r[u]=0;for(let u=0,c=0;u<t;u++){const f=n.child(u);c++;for(let p=0;;p++){for(;i<r.length&&r[i]!=0;)i++;if(p==f.childCount)break;const v=f.child(p),{colspan:g,rowspan:y,colwidth:b}=v.attrs;for(let _=0;_<y;_++){if(_+u>=t){(a||(a=[])).push({type:"overlong_rowspan",pos:c,n:y-_});break}const x=i+_*e;for(let T=0;T<g;T++){r[x+T]==0?r[x+T]=c:(a||(a=[])).push({type:"collision",row:u,pos:c,n:g-T});const k=b&&b[T];if(k){const C=(x+T)%e*2,D=o[C];D==null||D!=k&&o[C+1]==1?(o[C]=k,o[C+1]=1):D==k&&o[C+1]++}}}i+=g,c+=v.nodeSize}const d=(u+1)*e;let h=0;for(;i<d;)r[i++]==0&&h++;h&&(a||(a=[])).push({type:"missing",row:u,n:h}),c++}(e===0||t===0)&&(a||(a=[])).push({type:"zero_sized"});const s=new Br(e,t,r,a);let l=!1;for(let u=0;!l&&u<o.length;u+=2)o[u]!=null&&o[u+1]<t&&(l=!0);return l&&n3e(s,o,n),s}function t3e(n){let e=-1,t=!1;for(let r=0;r<n.childCount;r++){const i=n.child(r);let a=0;if(t)for(let o=0;o<r;o++){const s=n.child(o);for(let l=0;l<s.childCount;l++){const u=s.child(l);o+u.attrs.rowspan>r&&(a+=u.attrs.colspan)}}for(let o=0;o<i.childCount;o++){const s=i.child(o);a+=s.attrs.colspan,s.attrs.rowspan>1&&(t=!0)}e==-1?e=a:e!=a&&(e=Math.max(e,a))}return e}function n3e(n,e,t){n.problems||(n.problems=[]);const r={};for(let i=0;i<n.map.length;i++){const a=n.map[i];if(r[a])continue;r[a]=!0;const o=t.nodeAt(a);if(!o)throw new RangeError(`No cell with offset ${a} found`);let s=null;const l=o.attrs;for(let u=0;u<l.colspan;u++){const c=(i+u)%n.width,f=e[c*2];f!=null&&(!l.colwidth||l.colwidth[u]!=f)&&((s||(s=r3e(l)))[u]=f)}s&&n.problems.unshift({type:"colwidth mismatch",pos:a,colwidth:s})}}function r3e(n){if(n.colwidth)return n.colwidth.slice();const e=[];for(let t=0;t<n.colspan;t++)e.push(0);return e}function ea(n){let e=n.cached.tableNodeTypes;if(!e){e=n.cached.tableNodeTypes={};for(const t in n.nodes){const r=n.nodes[t],i=r.spec.tableRole;i&&(e[i]=r)}}return e}var Bu=new Wn("selectingCells");function qp(n){for(let e=n.depth-1;e>0;e--)if(n.node(e).type.spec.tableRole=="row")return n.node(0).resolve(n.before(e+1));return null}function i3e(n){for(let e=n.depth;e>0;e--){const t=n.node(e).type.spec.tableRole;if(t==="cell"||t==="header_cell")return n.node(e)}return null}function is(n){const e=n.selection.$head;for(let t=e.depth;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return!0;return!1}function bS(n){const e=n.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 t=qp(e.$head)||a3e(e.$head);if(t)return t;throw new RangeError(`No cell found around position ${e.head}`)}function a3e(n){for(let e=n.nodeAfter,t=n.pos;e;e=e.firstChild,t++){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return n.doc.resolve(t)}for(let e=n.nodeBefore,t=n.pos;e;e=e.lastChild,t--){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return n.doc.resolve(t-e.nodeSize)}}function $M(n){return n.parent.type.spec.tableRole=="row"&&!!n.nodeAfter}function o3e(n){return n.node(0).resolve(n.pos+n.nodeAfter.nodeSize)}function PO(n,e){return n.depth==e.depth&&n.pos>=e.start(-1)&&n.pos<=e.end(-1)}function AY(n,e,t){const r=n.node(-1),i=Br.get(r),a=n.start(-1),o=i.nextCell(n.pos-a,e,t);return o==null?null:n.node(0).resolve(a+o)}function gd(n,e,t=1){const r={...n,colspan:n.colspan-t};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,t),r.colwidth.some(i=>i>0)||(r.colwidth=null)),r}function NY(n,e,t=1){const r={...n,colspan:n.colspan+t};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let i=0;i<t;i++)r.colwidth.splice(e,0,0)}return r}function s3e(n,e,t){const r=ea(e.type.schema).header_cell;for(let i=0;i<n.height;i++)if(e.nodeAt(n.map[t+i*n.width]).type!=r)return!1;return!0}var wr=class bl extends fn{constructor(e,t=e){const r=e.node(-1),i=Br.get(r),a=e.start(-1),o=i.rectBetween(e.pos-a,t.pos-a),s=e.node(0),l=i.cellsInRect(o).filter(c=>c!=t.pos-a);l.unshift(t.pos-a);const u=l.map(c=>{const f=r.nodeAt(c);if(!f)throw RangeError(`No cell with offset ${c} found`);const d=a+c+1;return new j9(s.resolve(d),s.resolve(d+f.content.size))});super(u[0].$from,u[0].$to,u),this.$anchorCell=e,this.$headCell=t}map(e,t){const r=e.resolve(t.map(this.$anchorCell.pos)),i=e.resolve(t.map(this.$headCell.pos));if($M(r)&&$M(i)&&PO(r,i)){const a=this.$anchorCell.node(-1)!=r.node(-1);return a&&this.isRowSelection()?bl.rowSelection(r,i):a&&this.isColSelection()?bl.colSelection(r,i):new bl(r,i)}return Ut.between(r,i)}content(){const e=this.$anchorCell.node(-1),t=Br.get(e),r=this.$anchorCell.start(-1),i=t.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),a={},o=[];for(let l=i.top;l<i.bottom;l++){const u=[];for(let c=l*t.width+i.left,f=i.left;f<i.right;f++,c++){const d=t.map[c];if(a[d])continue;a[d]=!0;const h=t.findCell(d);let p=e.nodeAt(d);if(!p)throw RangeError(`No cell with offset ${d} found`);const v=i.left-h.left,g=h.right-i.right;if(v>0||g>0){let y=p.attrs;if(v>0&&(y=gd(y,0,v)),g>0&&(y=gd(y,y.colspan-g,g)),h.left<i.left){if(p=p.type.createAndFill(y),!p)throw RangeError(`Could not create cell with attrs ${JSON.stringify(y)}`)}else p=p.type.create(y,p.content)}if(h.top<i.top||h.bottom>i.bottom){const y={...p.attrs,rowspan:Math.min(h.bottom,i.bottom)-Math.max(h.top,i.top)};h.top<i.top?p=p.type.createAndFill(y):p=p.type.create(y,p.content)}u.push(p)}o.push(e.child(l).copy(ut.from(u)))}const s=this.isColSelection()&&this.isRowSelection()?e:o;return new Lt(ut.from(s),1,1)}replace(e,t=Lt.empty){const r=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){const{$from:s,$to:l}=i[o],u=e.mapping.slice(r);e.replace(u.map(s.pos),u.map(l.pos),o?Lt.empty:t)}const a=fn.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);a&&e.setSelection(a)}replaceWith(e,t){this.replace(e,new Lt(ut.from(t),0,0))}forEachCell(e){const t=this.$anchorCell.node(-1),r=Br.get(t),i=this.$anchorCell.start(-1),a=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let o=0;o<a.length;o++)e(t.nodeAt(a[o]),i+a[o])}isColSelection(){const e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;const r=e+this.$anchorCell.nodeAfter.attrs.rowspan,i=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,i)==this.$headCell.node(-1).childCount}static colSelection(e,t=e){const r=e.node(-1),i=Br.get(r),a=e.start(-1),o=i.findCell(e.pos-a),s=i.findCell(t.pos-a),l=e.node(0);return o.top<=s.top?(o.top>0&&(e=l.resolve(a+i.map[o.left])),s.bottom<i.height&&(t=l.resolve(a+i.map[i.width*(i.height-1)+s.right-1]))):(s.top>0&&(t=l.resolve(a+i.map[s.left])),o.bottom<i.height&&(e=l.resolve(a+i.map[i.width*(i.height-1)+o.right-1]))),new bl(e,t)}isRowSelection(){const e=this.$anchorCell.node(-1),t=Br.get(e),r=this.$anchorCell.start(-1),i=t.colCount(this.$anchorCell.pos-r),a=t.colCount(this.$headCell.pos-r);if(Math.min(i,a)>0)return!1;const o=i+this.$anchorCell.nodeAfter.attrs.colspan,s=a+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,s)==t.width}eq(e){return e instanceof bl&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,t=e){const r=e.node(-1),i=Br.get(r),a=e.start(-1),o=i.findCell(e.pos-a),s=i.findCell(t.pos-a),l=e.node(0);return o.left<=s.left?(o.left>0&&(e=l.resolve(a+i.map[o.top*i.width])),s.right<i.width&&(t=l.resolve(a+i.map[i.width*(s.top+1)-1]))):(s.left>0&&(t=l.resolve(a+i.map[s.top*i.width])),o.right<i.width&&(e=l.resolve(a+i.map[i.width*(o.top+1)-1]))),new bl(e,t)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,t){return new bl(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){return new bl(e.resolve(t),e.resolve(r))}getBookmark(){return new l3e(this.$anchorCell.pos,this.$headCell.pos)}};wr.prototype.visible=!1;fn.jsonID("cell",wr);var l3e=class DY{constructor(e,t){this.anchor=e,this.head=t}map(e){return new DY(e.map(this.anchor),e.map(this.head))}resolve(e){const t=e.resolve(this.anchor),r=e.resolve(this.head);return t.parent.type.spec.tableRole=="row"&&r.parent.type.spec.tableRole=="row"&&t.index()<t.parent.childCount&&r.index()<r.parent.childCount&&PO(t,r)?new wr(t,r):fn.near(r,1)}};function u3e(n){if(!(n.selection instanceof wr))return null;const e=[];return n.selection.forEachCell((t,r)=>{e.push(ii.node(r,r+t.nodeSize,{class:"selectedCell"}))}),hr.create(n.doc,e)}function c3e({$from:n,$to:e}){if(n.pos==e.pos||n.pos<e.pos-6)return!1;let t=n.pos,r=e.pos,i=n.depth;for(;i>=0&&!(n.after(i+1)<n.end(i));i--,t++);for(let a=e.depth;a>=0&&!(e.before(a+1)>e.start(a));a--,r--);return t==r&&/row|table/.test(n.node(i).type.spec.tableRole)}function f3e({$from:n,$to:e}){let t,r;for(let i=n.depth;i>0;i--){const a=n.node(i);if(a.type.spec.tableRole==="cell"||a.type.spec.tableRole==="header_cell"){t=a;break}}for(let i=e.depth;i>0;i--){const a=e.node(i);if(a.type.spec.tableRole==="cell"||a.type.spec.tableRole==="header_cell"){r=a;break}}return t!==r&&e.parentOffset===0}function d3e(n,e,t){const r=(e||n).selection,i=(e||n).doc;let a,o;if(r instanceof rn&&(o=r.node.type.spec.tableRole)){if(o=="cell"||o=="header_cell")a=wr.create(i,r.from);else if(o=="row"){const s=i.resolve(r.from+1);a=wr.rowSelection(s,s)}else if(!t){const s=Br.get(r.node),l=r.from+1,u=l+s.map[s.width*s.height-1];a=wr.create(i,l+1,u)}}else r instanceof Ut&&c3e(r)?a=Ut.create(i,r.from):r instanceof Ut&&f3e(r)&&(a=Ut.create(i,r.$from.start(),r.$from.end()));return a&&(e||(e=n.tr)).setSelection(a),e}var h3e=new Wn("fix-tables");function OY(n,e,t,r){const i=n.childCount,a=e.childCount;e:for(let o=0,s=0;o<a;o++){const l=e.child(o);for(let u=s,c=Math.min(i,o+3);u<c;u++)if(n.child(u)==l){s=u+1,t+=l.nodeSize;continue e}r(l,t),s<i&&n.child(s).sameMarkup(l)?OY(n.child(s),l,t+1,r):l.nodesBetween(0,l.content.size,r,t+1),t+=l.nodeSize}}function IY(n,e){let t;const r=(i,a)=>{i.type.spec.tableRole=="table"&&(t=p3e(n,i,a,t))};return e?e.doc!=n.doc&&OY(e.doc,n.doc,0,r):n.doc.descendants(r),t}function p3e(n,e,t,r){const i=Br.get(e);if(!i.problems)return r;r||(r=n.tr);const a=[];for(let l=0;l<i.height;l++)a.push(0);for(let l=0;l<i.problems.length;l++){const u=i.problems[l];if(u.type=="collision"){const c=e.nodeAt(u.pos);if(!c)continue;const f=c.attrs;for(let d=0;d<f.rowspan;d++)a[u.row+d]+=u.n;r.setNodeMarkup(r.mapping.map(t+1+u.pos),null,gd(f,f.colspan-u.n,u.n))}else if(u.type=="missing")a[u.row]+=u.n;else if(u.type=="overlong_rowspan"){const c=e.nodeAt(u.pos);if(!c)continue;r.setNodeMarkup(r.mapping.map(t+1+u.pos),null,{...c.attrs,rowspan:c.attrs.rowspan-u.n})}else if(u.type=="colwidth mismatch"){const c=e.nodeAt(u.pos);if(!c)continue;r.setNodeMarkup(r.mapping.map(t+1+u.pos),null,{...c.attrs,colwidth:u.colwidth})}else if(u.type=="zero_sized"){const c=r.mapping.map(t);r.delete(c,c+e.nodeSize)}}let o,s;for(let l=0;l<a.length;l++)a[l]&&(o==null&&(o=l),s=l);for(let l=0,u=t+1;l<i.height;l++){const c=e.child(l),f=u+c.nodeSize,d=a[l];if(d>0){let h="cell";c.firstChild&&(h=c.firstChild.type.spec.tableRole);const p=[];for(let g=0;g<d;g++){const y=ea(n.schema)[h].createAndFill();y&&p.push(y)}const v=(l==0||o==l-1)&&s==l?u+1:f-1;r.insert(r.mapping.map(v),p)}u=f}return r.setMeta(h3e,{fixTables:!0})}function rl(n){const e=n.selection,t=bS(n),r=t.node(-1),i=t.start(-1),a=Br.get(r);return{...e instanceof wr?a.rectBetween(e.$anchorCell.pos-i,e.$headCell.pos-i):a.findCell(t.pos-i),tableStart:i,map:a,table:r}}function RY(n,{map:e,tableStart:t,table:r},i){let a=i>0?-1:0;s3e(e,r,i+a)&&(a=i==0||i==e.width?null:0);for(let o=0;o<e.height;o++){const s=o*e.width+i;if(i>0&&i<e.width&&e.map[s-1]==e.map[s]){const l=e.map[s],u=r.nodeAt(l);n.setNodeMarkup(n.mapping.map(t+l),null,NY(u.attrs,i-e.colCount(l))),o+=u.attrs.rowspan-1}else{const l=a==null?ea(r.type.schema).cell:r.nodeAt(e.map[s+a]).type,u=e.positionAt(o,i,r);n.insert(n.mapping.map(t+u),l.createAndFill())}}return n}function v3e(n,e){if(!is(n))return!1;if(e){const t=rl(n);e(RY(n.tr,t,t.left))}return!0}function g3e(n,e){if(!is(n))return!1;if(e){const t=rl(n);e(RY(n.tr,t,t.right))}return!0}function m3e(n,{map:e,table:t,tableStart:r},i){const a=n.mapping.maps.length;for(let o=0;o<e.height;){const s=o*e.width+i,l=e.map[s],u=t.nodeAt(l),c=u.attrs;if(i>0&&e.map[s-1]==l||i<e.width-1&&e.map[s+1]==l)n.setNodeMarkup(n.mapping.slice(a).map(r+l),null,gd(c,i-e.colCount(l)));else{const f=n.mapping.slice(a).map(r+l);n.delete(f,f+u.nodeSize)}o+=c.rowspan}}function y3e(n,e){if(!is(n))return!1;if(e){const t=rl(n),r=n.tr;if(t.left==0&&t.right==t.map.width)return!1;for(let i=t.right-1;m3e(r,t,i),i!=t.left;i--){const a=t.tableStart?r.doc.nodeAt(t.tableStart-1):r.doc;if(!a)throw RangeError("No table found");t.table=a,t.map=Br.get(a)}e(r)}return!0}function b3e(n,e,t){var r;const i=ea(e.type.schema).header_cell;for(let a=0;a<n.width;a++)if(((r=e.nodeAt(n.map[a+t*n.width]))==null?void 0:r.type)!=i)return!1;return!0}function LY(n,{map:e,tableStart:t,table:r},i){var a;let o=t;for(let u=0;u<i;u++)o+=r.child(u).nodeSize;const s=[];let l=i>0?-1:0;b3e(e,r,i+l)&&(l=i==0||i==e.height?null:0);for(let u=0,c=e.width*i;u<e.width;u++,c++)if(i>0&&i<e.height&&e.map[c]==e.map[c-e.width]){const f=e.map[c],d=r.nodeAt(f).attrs;n.setNodeMarkup(t+f,null,{...d,rowspan:d.rowspan+1}),u+=d.colspan-1}else{const f=l==null?ea(r.type.schema).cell:(a=r.nodeAt(e.map[c+l*e.width]))==null?void 0:a.type,d=f?.createAndFill();d&&s.push(d)}return n.insert(o,ea(r.type.schema).row.create(null,s)),n}function x3e(n,e){if(!is(n))return!1;if(e){const t=rl(n);e(LY(n.tr,t,t.top))}return!0}function _3e(n,e){if(!is(n))return!1;if(e){const t=rl(n);e(LY(n.tr,t,t.bottom))}return!0}function S3e(n,{map:e,table:t,tableStart:r},i){let a=0;for(let u=0;u<i;u++)a+=t.child(u).nodeSize;const o=a+t.child(i).nodeSize,s=n.mapping.maps.length;n.delete(a+r,o+r);const l=new Set;for(let u=0,c=i*e.width;u<e.width;u++,c++){const f=e.map[c];if(!l.has(f)){if(l.add(f),i>0&&f==e.map[c-e.width]){const d=t.nodeAt(f).attrs;n.setNodeMarkup(n.mapping.slice(s).map(f+r),null,{...d,rowspan:d.rowspan-1}),u+=d.colspan-1}else if(i<e.height&&f==e.map[c+e.width]){const d=t.nodeAt(f),h=d.attrs,p=d.type.create({...h,rowspan:d.attrs.rowspan-1},d.content),v=e.positionAt(i+1,u,t);n.insert(n.mapping.slice(s).map(r+v),p),u+=h.colspan-1}}}}function w3e(n,e){if(!is(n))return!1;if(e){const t=rl(n),r=n.tr;if(t.top==0&&t.bottom==t.map.height)return!1;for(let i=t.bottom-1;S3e(r,t,i),i!=t.top;i--){const a=t.tableStart?r.doc.nodeAt(t.tableStart-1):r.doc;if(!a)throw RangeError("No table found");t.table=a,t.map=Br.get(t.table)}e(r)}return!0}function nz(n){const e=n.content;return e.childCount==1&&e.child(0).isTextblock&&e.child(0).childCount==0}function k3e({width:n,height:e,map:t},r){let i=r.top*n+r.left,a=i,o=(r.bottom-1)*n+r.left,s=i+(r.right-r.left-1);for(let l=r.top;l<r.bottom;l++){if(r.left>0&&t[a]==t[a-1]||r.right<n&&t[s]==t[s+1])return!0;a+=n,s+=n}for(let l=r.left;l<r.right;l++){if(r.top>0&&t[i]==t[i-n]||r.bottom<e&&t[o]==t[o+n])return!0;i++,o++}return!1}function rz(n,e){const t=n.selection;if(!(t instanceof wr)||t.$anchorCell.pos==t.$headCell.pos)return!1;const r=rl(n),{map:i}=r;if(k3e(i,r))return!1;if(e){const a=n.tr,o={};let s=ut.empty,l,u;for(let c=r.top;c<r.bottom;c++)for(let f=r.left;f<r.right;f++){const d=i.map[c*i.width+f],h=r.table.nodeAt(d);if(!(o[d]||!h))if(o[d]=!0,l==null)l=d,u=h;else{nz(h)||(s=s.append(h.content));const p=a.mapping.map(d+r.tableStart);a.delete(p,p+h.nodeSize)}}if(l==null||u==null)return!0;if(a.setNodeMarkup(l+r.tableStart,null,{...NY(u.attrs,u.attrs.colspan,r.right-r.left-u.attrs.colspan),rowspan:r.bottom-r.top}),s.size){const c=l+1+u.content.size,f=nz(u)?l+1:c;a.replaceWith(f+r.tableStart,c+r.tableStart,s)}a.setSelection(new wr(a.doc.resolve(l+r.tableStart))),e(a)}return!0}function iz(n,e){const t=ea(n.schema);return T3e(({node:r})=>t[r.type.spec.tableRole])(n,e)}function T3e(n){return(e,t)=>{var r;const i=e.selection;let a,o;if(i instanceof wr){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;a=i.$anchorCell.nodeAfter,o=i.$anchorCell.pos}else{if(a=i3e(i.$from),!a)return!1;o=(r=qp(i.$from))==null?void 0:r.pos}if(a==null||o==null||a.attrs.colspan==1&&a.attrs.rowspan==1)return!1;if(t){let s=a.attrs;const l=[],u=s.colwidth;s.rowspan>1&&(s={...s,rowspan:1}),s.colspan>1&&(s={...s,colspan:1});const c=rl(e),f=e.tr;for(let h=0;h<c.right-c.left;h++)l.push(u?{...s,colwidth:u&&u[h]?[u[h]]:null}:s);let d;for(let h=c.top;h<c.bottom;h++){let p=c.map.positionAt(h,c.left,c.table);h==c.top&&(p+=a.nodeSize);for(let v=c.left,g=0;v<c.right;v++,g++)v==c.left&&h==c.top||f.insert(d=f.mapping.map(p+c.tableStart,1),n({node:a,row:h,col:v}).createAndFill(l[g]))}f.setNodeMarkup(o,n({node:a,row:c.top,col:c.left}),l[0]),i instanceof wr&&f.setSelection(new wr(f.doc.resolve(i.$anchorCell.pos),d?f.doc.resolve(d):void 0)),t(f)}return!0}}function C3e(n,e){return function(t,r){if(!is(t))return!1;const i=bS(t);if(i.nodeAfter.attrs[n]===e)return!1;if(r){const a=t.tr;t.selection instanceof wr?t.selection.forEachCell((o,s)=>{o.attrs[n]!==e&&a.setNodeMarkup(s,null,{...o.attrs,[n]:e})}):a.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[n]:e}),r(a)}return!0}}function E3e(n){return function(e,t){if(!is(e))return!1;if(t){const r=ea(e.schema),i=rl(e),a=e.tr,o=i.map.cellsInRect(n=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:n=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),s=o.map(l=>i.table.nodeAt(l));for(let l=0;l<o.length;l++)s[l].type==r.header_cell&&a.setNodeMarkup(i.tableStart+o[l],r.cell,s[l].attrs);if(a.steps.length==0)for(let l=0;l<o.length;l++)a.setNodeMarkup(i.tableStart+o[l],r.header_cell,s[l].attrs);t(a)}return!0}}function az(n,e,t){const r=e.map.cellsInRect({left:0,top:0,right:n=="row"?e.map.width:1,bottom:n=="column"?e.map.height:1});for(let i=0;i<r.length;i++){const a=e.table.nodeAt(r[i]);if(a&&a.type!==t.header_cell)return!1}return!0}function zm(n,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?E3e(n):function(t,r){if(!is(t))return!1;if(r){const i=ea(t.schema),a=rl(t),o=t.tr,s=az("row",a,i),l=az("column",a,i),c=(n==="column"?s:n==="row"?l:!1)?1:0,f=n=="column"?{left:0,top:c,right:1,bottom:a.map.height}:n=="row"?{left:c,top:0,right:a.map.width,bottom:1}:a,d=n=="column"?l?i.cell:i.header_cell:n=="row"?s?i.cell:i.header_cell:i.cell;a.map.cellsInRect(f).forEach(h=>{const p=h+a.tableStart,v=o.doc.nodeAt(p);v&&o.setNodeMarkup(p,d,v.attrs)}),r(o)}return!0}}zm("row",{useDeprecatedLogic:!0});zm("column",{useDeprecatedLogic:!0});var M3e=zm("cell",{useDeprecatedLogic:!0});function A3e(n,e){if(e<0){const t=n.nodeBefore;if(t)return n.pos-t.nodeSize;for(let r=n.index(-1)-1,i=n.before();r>=0;r--){const a=n.node(-1).child(r),o=a.lastChild;if(o)return i-1-o.nodeSize;i-=a.nodeSize}}else{if(n.index()<n.parent.childCount-1)return n.pos+n.nodeAfter.nodeSize;const t=n.node(-1);for(let r=n.indexAfter(-1),i=n.after();r<t.childCount;r++){const a=t.child(r);if(a.childCount)return i+1;i+=a.nodeSize}}return null}function oz(n){return function(e,t){if(!is(e))return!1;const r=A3e(bS(e),n);if(r==null)return!1;if(t){const i=e.doc.resolve(r);t(e.tr.setSelection(Ut.between(i,o3e(i))).scrollIntoView())}return!0}}function N3e(n,e){const t=n.selection.$anchor;for(let r=t.depth;r>0;r--)if(t.node(r).type.spec.tableRole=="table")return e&&e(n.tr.delete(t.before(r),t.after(r)).scrollIntoView()),!0;return!1}function n1(n,e){const t=n.selection;if(!(t instanceof wr))return!1;if(e){const r=n.tr,i=ea(n.schema).cell.createAndFill().content;t.forEachCell((a,o)=>{a.content.eq(i)||r.replace(r.mapping.map(o+1),r.mapping.map(o+a.nodeSize-1),new Lt(i,0,0))}),r.docChanged&&e(r)}return!0}function D3e(n){if(!n.size)return null;let{content:e,openStart:t,openEnd:r}=n;for(;e.childCount==1&&(t>0&&r>0||e.child(0).type.spec.tableRole=="table");)t--,r--,e=e.child(0).content;const i=e.child(0),a=i.type.spec.tableRole,o=i.type.schema,s=[];if(a=="row")for(let l=0;l<e.childCount;l++){let u=e.child(l).content;const c=l?0:Math.max(0,t-1),f=l<e.childCount-1?0:Math.max(0,r-1);(c||f)&&(u=HM(ea(o).row,new Lt(u,c,f)).content),s.push(u)}else if(a=="cell"||a=="header_cell")s.push(t||r?HM(ea(o).row,new Lt(e,t,r)).content:e);else return null;return O3e(o,s)}function O3e(n,e){const t=[];for(let i=0;i<e.length;i++){const a=e[i];for(let o=a.childCount-1;o>=0;o--){const{rowspan:s,colspan:l}=a.child(o).attrs;for(let u=i;u<i+s;u++)t[u]=(t[u]||0)+l}}let r=0;for(let i=0;i<t.length;i++)r=Math.max(r,t[i]);for(let i=0;i<t.length;i++)if(i>=e.length&&e.push(ut.empty),t[i]<r){const a=ea(n).cell.createAndFill(),o=[];for(let s=t[i];s<r;s++)o.push(a);e[i]=e[i].append(ut.from(o))}return{height:e.length,width:r,rows:e}}function HM(n,e){const t=n.createAndFill();return new uA(t).replace(0,t.content.size,e).doc}function I3e({width:n,height:e,rows:t},r,i){if(n!=r){const a=[],o=[];for(let s=0;s<t.length;s++){const l=t[s],u=[];for(let c=a[s]||0,f=0;c<r;f++){let d=l.child(f%l.childCount);c+d.attrs.colspan>r&&(d=d.type.createChecked(gd(d.attrs,d.attrs.colspan,c+d.attrs.colspan-r),d.content)),u.push(d),c+=d.attrs.colspan;for(let h=1;h<d.attrs.rowspan;h++)a[s+h]=(a[s+h]||0)+d.attrs.colspan}o.push(ut.from(u))}t=o,n=r}if(e!=i){const a=[];for(let o=0,s=0;o<i;o++,s++){const l=[],u=t[s%e];for(let c=0;c<u.childCount;c++){let f=u.child(c);o+f.attrs.rowspan>i&&(f=f.type.create({...f.attrs,rowspan:Math.max(1,i-f.attrs.rowspan)},f.content)),l.push(f)}a.push(ut.from(l))}t=a,e=i}return{width:n,height:e,rows:t}}function R3e(n,e,t,r,i,a,o){const s=n.doc.type.schema,l=ea(s);let u,c;if(i>e.width)for(let f=0,d=0;f<e.height;f++){const h=t.child(f);d+=h.nodeSize;const p=[];let v;h.lastChild==null||h.lastChild.type==l.cell?v=u||(u=l.cell.createAndFill()):v=c||(c=l.header_cell.createAndFill());for(let g=e.width;g<i;g++)p.push(v);n.insert(n.mapping.slice(o).map(d-1+r),p)}if(a>e.height){const f=[];for(let p=0,v=(e.height-1)*e.width;p<Math.max(e.width,i);p++){const g=p>=e.width?!1:t.nodeAt(e.map[v+p]).type==l.header_cell;f.push(g?c||(c=l.header_cell.createAndFill()):u||(u=l.cell.createAndFill()))}const d=l.row.create(null,ut.from(f)),h=[];for(let p=e.height;p<a;p++)h.push(d);n.insert(n.mapping.slice(o).map(r+t.nodeSize-2),h)}return!!(u||c)}function sz(n,e,t,r,i,a,o,s){if(o==0||o==e.height)return!1;let l=!1;for(let u=i;u<a;u++){const c=o*e.width+u,f=e.map[c];if(e.map[c-e.width]==f){l=!0;const d=t.nodeAt(f),{top:h,left:p}=e.findCell(f);n.setNodeMarkup(n.mapping.slice(s).map(f+r),null,{...d.attrs,rowspan:o-h}),n.insert(n.mapping.slice(s).map(e.positionAt(o,p,t)),d.type.createAndFill({...d.attrs,rowspan:h+d.attrs.rowspan-o})),u+=d.attrs.colspan-1}}return l}function lz(n,e,t,r,i,a,o,s){if(o==0||o==e.width)return!1;let l=!1;for(let u=i;u<a;u++){const c=u*e.width+o,f=e.map[c];if(e.map[c-1]==f){l=!0;const d=t.nodeAt(f),h=e.colCount(f),p=n.mapping.slice(s).map(f+r);n.setNodeMarkup(p,null,gd(d.attrs,o-h,d.attrs.colspan-(o-h))),n.insert(p+d.nodeSize,d.type.createAndFill(gd(d.attrs,0,o-h))),u+=d.attrs.rowspan-1}}return l}function uz(n,e,t,r,i){let a=t?n.doc.nodeAt(t-1):n.doc;if(!a)throw new Error("No table found");let o=Br.get(a);const{top:s,left:l}=r,u=l+i.width,c=s+i.height,f=n.tr;let d=0;function h(){if(a=t?f.doc.nodeAt(t-1):f.doc,!a)throw new Error("No table found");o=Br.get(a),d=f.mapping.maps.length}R3e(f,o,a,t,u,c,d)&&h(),sz(f,o,a,t,l,u,s,d)&&h(),sz(f,o,a,t,l,u,c,d)&&h(),lz(f,o,a,t,s,c,l,d)&&h(),lz(f,o,a,t,s,c,u,d)&&h();for(let p=s;p<c;p++){const v=o.positionAt(p,l,a),g=o.positionAt(p,u,a);f.replace(f.mapping.slice(d).map(v+t),f.mapping.slice(d).map(g+t),new Lt(i.rows[p-s],0,0))}h(),f.setSelection(new wr(f.doc.resolve(t+o.positionAt(s,l,a)),f.doc.resolve(t+o.positionAt(c-1,u-1,a)))),e(f)}var L3e=xA({ArrowLeft:r1("horiz",-1),ArrowRight:r1("horiz",1),ArrowUp:r1("vert",-1),ArrowDown:r1("vert",1),"Shift-ArrowLeft":i1("horiz",-1),"Shift-ArrowRight":i1("horiz",1),"Shift-ArrowUp":i1("vert",-1),"Shift-ArrowDown":i1("vert",1),Backspace:n1,"Mod-Backspace":n1,Delete:n1,"Mod-Delete":n1});function P1(n,e,t){return t.eq(n.selection)?!1:(e&&e(n.tr.setSelection(t).scrollIntoView()),!0)}function r1(n,e){return(t,r,i)=>{if(!i)return!1;const a=t.selection;if(a instanceof wr)return P1(t,r,fn.near(a.$headCell,e));if(n!="horiz"&&!a.empty)return!1;const o=PY(i,n,e);if(o==null)return!1;if(n=="horiz")return P1(t,r,fn.near(t.doc.resolve(a.head+e),e));{const s=t.doc.resolve(o),l=AY(s,n,e);let u;return l?u=fn.near(l,1):e<0?u=fn.near(t.doc.resolve(s.before(-1)),-1):u=fn.near(t.doc.resolve(s.after(-1)),1),P1(t,r,u)}}}function i1(n,e){return(t,r,i)=>{if(!i)return!1;const a=t.selection;let o;if(a instanceof wr)o=a;else{const l=PY(i,n,e);if(l==null)return!1;o=new wr(t.doc.resolve(l))}const s=AY(o.$headCell,n,e);return s?P1(t,r,new wr(o.$anchorCell,s)):!1}}function P3e(n,e){const t=n.state.doc,r=qp(t.resolve(e));return r?(n.dispatch(n.state.tr.setSelection(new wr(r))),!0):!1}function B3e(n,e,t){if(!is(n.state))return!1;let r=D3e(t);const i=n.state.selection;if(i instanceof wr){r||(r={width:1,height:1,rows:[ut.from(HM(ea(n.state.schema).cell,t))]});const a=i.$anchorCell.node(-1),o=i.$anchorCell.start(-1),s=Br.get(a).rectBetween(i.$anchorCell.pos-o,i.$headCell.pos-o);return r=I3e(r,s.right-s.left,s.bottom-s.top),uz(n.state,n.dispatch,o,s,r),!0}else if(r){const a=bS(n.state),o=a.start(-1);return uz(n.state,n.dispatch,o,Br.get(a.node(-1)).findCell(a.pos-o),r),!0}else return!1}function V3e(n,e){var t;if(e.ctrlKey||e.metaKey)return;const r=cz(n,e.target);let i;if(e.shiftKey&&n.state.selection instanceof wr)a(n.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(i=qp(n.state.selection.$anchor))!=null&&((t=CT(n,e))==null?void 0:t.pos)!=i.pos)a(i,e),e.preventDefault();else if(!r)return;function a(l,u){let c=CT(n,u);const f=Bu.getState(n.state)==null;if(!c||!PO(l,c))if(f)c=l;else return;const d=new wr(l,c);if(f||!n.state.selection.eq(d)){const h=n.state.tr.setSelection(d);f&&h.setMeta(Bu,l.pos),n.dispatch(h)}}function o(){n.root.removeEventListener("mouseup",o),n.root.removeEventListener("dragstart",o),n.root.removeEventListener("mousemove",s),Bu.getState(n.state)!=null&&n.dispatch(n.state.tr.setMeta(Bu,-1))}function s(l){const u=l,c=Bu.getState(n.state);let f;if(c!=null)f=n.state.doc.resolve(c);else if(cz(n,u.target)!=r&&(f=CT(n,e),!f))return o();f&&a(f,u)}n.root.addEventListener("mouseup",o),n.root.addEventListener("dragstart",o),n.root.addEventListener("mousemove",s)}function PY(n,e,t){if(!(n.state.selection instanceof Ut))return null;const{$head:r}=n.state.selection;for(let i=r.depth-1;i>=0;i--){const a=r.node(i);if((t<0?r.index(i):r.indexAfter(i))!=(t<0?0:a.childCount))return null;if(a.type.spec.tableRole=="cell"||a.type.spec.tableRole=="header_cell"){const s=r.before(i),l=e=="vert"?t>0?"down":"up":t>0?"right":"left";return n.endOfTextblock(l)?s:null}}return null}function cz(n,e){for(;e&&e!=n.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function CT(n,e){const t=n.posAtCoords({left:e.clientX,top:e.clientY});return t&&t?qp(n.state.doc.resolve(t.pos)):null}var z3e=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,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",`${t}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),GM(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,GM(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function GM(n,e,t,r,i,a){var o;let s=0,l=!0,u=e.firstChild;const c=n.firstChild;if(c){for(let f=0,d=0;f<c.childCount;f++){const{colspan:h,colwidth:p}=c.child(f).attrs;for(let v=0;v<h;v++,d++){const g=i==d?a:p&&p[v],y=g?g+"px":"";if(s+=g||r,g||(l=!1),u)u.style.width!=y&&(u.style.width=y),u=u.nextSibling;else{const b=document.createElement("col");b.style.width=y,e.appendChild(b)}}}for(;u;){const f=u.nextSibling;(o=u.parentNode)==null||o.removeChild(u),u=f}l?(t.style.width=s+"px",t.style.minWidth=""):(t.style.width="",t.style.minWidth=s+"px")}}var qa=new Wn("tableColumnResizing");function F3e({handleWidth:n=5,cellMinWidth:e=25,defaultCellMinWidth:t=100,View:r=z3e,lastColumnResizable:i=!0}={}){const a=new $n({key:qa,state:{init(o,s){var l,u;const c=(u=(l=a.spec)==null?void 0:l.props)==null?void 0:u.nodeViews,f=ea(s.schema).table.name;return r&&c&&(c[f]=(d,h)=>new r(d,t,h)),new $3e(-1,!1)},apply(o,s){return s.apply(o)}},props:{attributes:o=>{const s=qa.getState(o);return s&&s.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(o,s)=>{H3e(o,s,n,i)},mouseleave:o=>{G3e(o)},mousedown:(o,s)=>{U3e(o,s,e,t)}},decorations:o=>{const s=qa.getState(o);if(s&&s.activeHandle>-1)return Y3e(o,s.activeHandle)},nodeViews:{}}});return a}var $3e=class B1{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(e){const t=this,r=e.getMeta(qa);if(r&&r.setHandle!=null)return new B1(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new B1(t.activeHandle,r.setDragging);if(t.activeHandle>-1&&e.docChanged){let i=e.mapping.map(t.activeHandle,-1);return $M(e.doc.resolve(i))||(i=-1),new B1(i,t.dragging)}return t}};function H3e(n,e,t,r){if(!n.editable)return;const i=qa.getState(n.state);if(i&&!i.dragging){const a=j3e(e.target);let o=-1;if(a){const{left:s,right:l}=a.getBoundingClientRect();e.clientX-s<=t?o=fz(n,e,"left",t):l-e.clientX<=t&&(o=fz(n,e,"right",t))}if(o!=i.activeHandle){if(!r&&o!==-1){const s=n.state.doc.resolve(o),l=s.node(-1),u=Br.get(l),c=s.start(-1);if(u.colCount(s.pos-c)+s.nodeAfter.attrs.colspan-1==u.width-1)return}BY(n,o)}}}function G3e(n){if(!n.editable)return;const e=qa.getState(n.state);e&&e.activeHandle>-1&&!e.dragging&&BY(n,-1)}function U3e(n,e,t,r){var i;if(!n.editable)return!1;const a=(i=n.dom.ownerDocument.defaultView)!=null?i:window,o=qa.getState(n.state);if(!o||o.activeHandle==-1||o.dragging)return!1;const s=n.state.doc.nodeAt(o.activeHandle),l=W3e(n,o.activeHandle,s.attrs);n.dispatch(n.state.tr.setMeta(qa,{setDragging:{startX:e.clientX,startWidth:l}}));function u(f){a.removeEventListener("mouseup",u),a.removeEventListener("mousemove",c);const d=qa.getState(n.state);d?.dragging&&(q3e(n,d.activeHandle,dz(d.dragging,f,t)),n.dispatch(n.state.tr.setMeta(qa,{setDragging:null})))}function c(f){if(!f.which)return u(f);const d=qa.getState(n.state);if(d&&d.dragging){const h=dz(d.dragging,f,t);hz(n,d.activeHandle,h,r)}}return hz(n,o.activeHandle,l,r),a.addEventListener("mouseup",u),a.addEventListener("mousemove",c),e.preventDefault(),!0}function W3e(n,e,{colspan:t,colwidth:r}){const i=r&&r[r.length-1];if(i)return i;const a=n.domAtPos(e);let s=a.node.childNodes[a.offset].offsetWidth,l=t;if(r)for(let u=0;u<t;u++)r[u]&&(s-=r[u],l--);return s/l}function j3e(n){for(;n&&n.nodeName!="TD"&&n.nodeName!="TH";)n=n.classList&&n.classList.contains("ProseMirror")?null:n.parentNode;return n}function fz(n,e,t,r){const i=t=="right"?-r:r,a=n.posAtCoords({left:e.clientX+i,top:e.clientY});if(!a)return-1;const{pos:o}=a,s=qp(n.state.doc.resolve(o));if(!s)return-1;if(t=="right")return s.pos;const l=Br.get(s.node(-1)),u=s.start(-1),c=l.map.indexOf(s.pos-u);return c%l.width==0?-1:u+l.map[c-1]}function dz(n,e,t){const r=e.clientX-n.startX;return Math.max(t,n.startWidth+r)}function BY(n,e){n.dispatch(n.state.tr.setMeta(qa,{setHandle:e}))}function q3e(n,e,t){const r=n.state.doc.resolve(e),i=r.node(-1),a=Br.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1,l=n.state.tr;for(let u=0;u<a.height;u++){const c=u*a.width+s;if(u&&a.map[c]==a.map[c-a.width])continue;const f=a.map[c],d=i.nodeAt(f).attrs,h=d.colspan==1?0:s-a.colCount(f);if(d.colwidth&&d.colwidth[h]==t)continue;const p=d.colwidth?d.colwidth.slice():K3e(d.colspan);p[h]=t,l.setNodeMarkup(o+f,null,{...d,colwidth:p})}l.docChanged&&n.dispatch(l)}function hz(n,e,t,r){const i=n.state.doc.resolve(e),a=i.node(-1),o=i.start(-1),s=Br.get(a).colCount(i.pos-o)+i.nodeAfter.attrs.colspan-1;let l=n.domAtPos(i.start(-1)).node;for(;l&&l.nodeName!="TABLE";)l=l.parentNode;l&&GM(a,l.firstChild,l,r,s,t)}function K3e(n){return Array(n).fill(0)}function Y3e(n,e){var t;const r=[],i=n.doc.resolve(e),a=i.node(-1);if(!a)return hr.empty;const o=Br.get(a),s=i.start(-1),l=o.colCount(i.pos-s)+i.nodeAfter.attrs.colspan-1;for(let u=0;u<o.height;u++){const c=l+u*o.width;if((l==o.width-1||o.map[c]!=o.map[c+1])&&(u==0||o.map[c]!=o.map[c-o.width])){const f=o.map[c],d=s+f+a.nodeAt(f).nodeSize-1,h=document.createElement("div");h.className="column-resize-handle",(t=qa.getState(n))!=null&&t.dragging&&r.push(ii.node(s+f,s+f+a.nodeAt(f).nodeSize,{class:"column-resize-dragging"})),r.push(ii.widget(d,h))}}return hr.create(n.doc,r)}function X3e({allowTableNodeSelection:n=!1}={}){return new $n({key:Bu,state:{init(){return null},apply(e,t){const r=e.getMeta(Bu);if(r!=null)return r==-1?null:r;if(t==null||!e.docChanged)return t;const{deleted:i,pos:a}=e.mapping.mapResult(t);return i?null:a}},props:{decorations:u3e,handleDOMEvents:{mousedown:V3e},createSelectionBetween(e){return Bu.getState(e.state)!=null?e.state.selection:null},handleTripleClick:P3e,handleKeyDown:L3e,handlePaste:B3e},appendTransaction(e,t,r){return d3e(r,IY(r,t),n)}})}function UM(n,e){return e?["width",`${Math.max(e,n)}px`]:["min-width",`${n}px`]}function pz(n,e,t,r,i,a){var o;let s=0,l=!0,u=e.firstChild;const c=n.firstChild;if(c!==null)for(let f=0,d=0;f<c.childCount;f+=1){const{colspan:h,colwidth:p}=c.child(f).attrs;for(let v=0;v<h;v+=1,d+=1){const g=i===d?a:p&&p[v],y=g?`${g}px`:"";if(s+=g||r,g||(l=!1),u){if(u.style.width!==y){const[b,_]=UM(r,g);u.style.setProperty(b,_)}u=u.nextSibling}else{const b=document.createElement("col"),[_,x]=UM(r,g);b.style.setProperty(_,x),e.appendChild(b)}}}for(;u;){const f=u.nextSibling;(o=u.parentNode)===null||o===void 0||o.removeChild(u),u=f}l?(t.style.width=`${s}px`,t.style.minWidth=""):(t.style.width="",t.style.minWidth=`${s}px`)}class Z3e{constructor(e,t){this.node=e,this.cellMinWidth=t,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")),pz(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!==this.node.type?!1:(this.node=e,pz(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return e.type==="attributes"&&(e.target===this.table||this.colgroup.contains(e.target))}}function J3e(n,e,t,r){let i=0,a=!0;const o=[],s=n.firstChild;if(!s)return{};for(let f=0,d=0;f<s.childCount;f+=1){const{colspan:h,colwidth:p}=s.child(f).attrs;for(let v=0;v<h;v+=1,d+=1){const g=t===d?r:p&&p[v];i+=g||e,g||(a=!1);const[y,b]=UM(e,g);o.push(["col",{style:`${y}: ${b}`}])}}const l=a?`${i}px`:"",u=a?"":`${i}px`;return{colgroup:["colgroup",{},...o],tableWidth:l,tableMinWidth:u}}function vz(n,e){return n.createAndFill()}function Q3e(n){if(n.cached.tableNodeTypes)return n.cached.tableNodeTypes;const e={};return Object.keys(n.nodes).forEach(t=>{const r=n.nodes[t];r.spec.tableRole&&(e[r.spec.tableRole]=r)}),n.cached.tableNodeTypes=e,e}function ePe(n,e,t,r,i){const a=Q3e(n),o=[],s=[];for(let u=0;u<t;u+=1){const c=vz(a.cell);if(c&&s.push(c),r){const f=vz(a.header_cell);f&&o.push(f)}}const l=[];for(let u=0;u<e;u+=1)l.push(a.row.createChecked(null,r&&u===0?o:s));return a.table.createChecked(null,l)}function tPe(n){return n instanceof wr}const a1=({editor:n})=>{const{selection:e}=n.state;if(!tPe(e))return!1;let t=0;const r=rF(e.ranges[0].$from,a=>a.type.name==="table");return r?.node.descendants(a=>{if(a.type.name==="table")return!1;["tableCell","tableHeader"].includes(a.type.name)&&(t+=1)}),t===e.ranges.length?(n.commands.deleteTable(),!0):!1},nPe=yi.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:Z3e,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:n,HTMLAttributes:e}){const{colgroup:t,tableWidth:r,tableMinWidth:i}=J3e(n,this.options.cellMinWidth);return["table",Jn(this.options.HTMLAttributes,e,{style:r?`width: ${r}`:`min-width: ${i}`}),t,["tbody",0]]},addCommands(){return{insertTable:({rows:n=3,cols:e=3,withHeaderRow:t=!0}={})=>({tr:r,dispatch:i,editor:a})=>{const o=ePe(a.schema,n,e,t);if(i){const s=r.selection.from+1;r.replaceSelectionWith(o).scrollIntoView().setSelection(Ut.near(r.doc.resolve(s)))}return!0},addColumnBefore:()=>({state:n,dispatch:e})=>v3e(n,e),addColumnAfter:()=>({state:n,dispatch:e})=>g3e(n,e),deleteColumn:()=>({state:n,dispatch:e})=>y3e(n,e),addRowBefore:()=>({state:n,dispatch:e})=>x3e(n,e),addRowAfter:()=>({state:n,dispatch:e})=>_3e(n,e),deleteRow:()=>({state:n,dispatch:e})=>w3e(n,e),deleteTable:()=>({state:n,dispatch:e})=>N3e(n,e),mergeCells:()=>({state:n,dispatch:e})=>rz(n,e),splitCell:()=>({state:n,dispatch:e})=>iz(n,e),toggleHeaderColumn:()=>({state:n,dispatch:e})=>zm("column")(n,e),toggleHeaderRow:()=>({state:n,dispatch:e})=>zm("row")(n,e),toggleHeaderCell:()=>({state:n,dispatch:e})=>M3e(n,e),mergeOrSplit:()=>({state:n,dispatch:e})=>rz(n,e)?!0:iz(n,e),setCellAttribute:(n,e)=>({state:t,dispatch:r})=>C3e(n,e)(t,r),goToNextCell:()=>({state:n,dispatch:e})=>oz(1)(n,e),goToPreviousCell:()=>({state:n,dispatch:e})=>oz(-1)(n,e),fixTables:()=>({state:n,dispatch:e})=>(e&&IY(n),!0),setCellSelection:n=>({tr:e,dispatch:t})=>{if(t){const r=wr.create(e.doc,n.anchorCell,n.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:a1,"Mod-Backspace":a1,Delete:a1,"Mod-Delete":a1}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[F3e({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],X3e({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(n){const e={name:n.name,options:n.options,storage:n.storage};return{tableRole:Bn(tn(n,"tableRole",e))}}}),rPe=n=>{const e={};return n.split(";").map(r=>r.trim()).filter(Boolean).forEach(r=>{const[i,a]=r.split(":").map(o=>o.trim());i&&a&&(e[i]=a)}),e},iPe=n=>{const e=/\.(\w+)\s*\{([^}]+)\}/g;let t;const r={};for(;(t=e.exec(n))!==null;){const[,i,a]=t,o=rPe(a);r[i]=o}return r},aPe=nPe.extend({addProseMirrorPlugins(){return[...this.parent?.()??[],new $n({key:new Wn("handleExcelPaste"),props:{handlePaste(n,e){const{clipboardData:t}=e;if(!t)return!1;const r=t.getData("text/html");if(!r)return!1;const a=new DOMParser().parseFromString(r,"text/html");if(!a?.querySelector("html")?.getAttribute("xmlns:x")?.includes("office:excel"))return!1;const s=a.querySelector("table");if(!s)return!1;const l=Array.from(a.head.querySelectorAll("style")).map(h=>h.textContent).join(`
274
- `),u=iPe(l);s.querySelectorAll("td, th").forEach(h=>{const p=u[h.getAttribute("class")];p?.background&&(h.style.background=p.background),p?.color&&(h.style.color=p.color),p?.["text-align"]&&h.setAttribute("align",p["text-align"])});const{schema:c}=n.state,f=Ol.fromSchema(c).parse(s),d=n.state.tr.replaceSelectionWith(f);return n.dispatch(d),!0}}})]}}),oPe=aPe.configure({allowTableNodeSelection:!0,resizable:!0}),sPe=yi.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:n=>{const e=n.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:n}){return["td",Jn(this.options.HTMLAttributes,n),0]}}),VY={addAttributes(){return{...this.parent?.(),align:{default:null,parseHTML:n=>n.getAttribute("align")??null,renderHTML:({align:n})=>({align:n})},background:{default:null,parseHTML:n=>{const t=(n.getAttribute("style")??"").match(/background(?:-color)?:\s*([^;]+)/i);return t?t[1].trim():null},renderHTML:({background:n})=>n?{style:`background-color: ${n}`}:{}},color:{default:null,parseHTML:n=>{const e=n.getAttribute("style")??"",t=e.match(new RegExp("(?<!background-)color:\\s*([^;]+)","i"));return e.includes("background-color")?null:t?t[1].trim():null},renderHTML:({color:n})=>n?{style:`color: ${n}`}:{}}}}},lPe=sPe.extend(VY),uPe=yi.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:n=>{const e=n.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:n}){return["th",Jn(this.options.HTMLAttributes,n),0]}}),cPe=uPe.extend(VY),fPe=["textContent"],dPe=m.defineComponent({__name:"node-view",props:Ql,setup(n){const e=m.inject("options"),t=m.inject("editor");return(r,i)=>(m.openBlock(),m.createBlock(m.unref(Jl),{as:"span",class:"inline-block mx-[0.3rem] !bg-transparent"},{default:m.withCtx(()=>[m.createElementVNode("span",{class:"rounded-[0.2em] px-[0.4em] py-[0.15em] inline-block mx-[0.2em] text-sm font-[500] border-[#0000000d] box-border",style:m.normalizeStyle({color:r.node.attrs.color,backgroundColor:r.node.attrs.backgroundColor,cursor:!m.unref(e).document?.readOnly||m.unref(t).isEditable?"pointer":"default"}),textContent:m.toDisplayString(r.node.attrs.text)},null,12,fPe)]),_:1}))}}),hPe=yi.create({name:"tag",group:"inline",inline:!0,atom:!0,addAttributes(){return{type:{default:"default"},text:{default:"默认标签"},color:{default:"#999"},backgroundColor:{default:"rgba(0, 0, 0, 0.05)"}}},parseHTML(){return[{tag:'span[data-type="tag"]'}]},renderHTML({HTMLAttributes:n}){return["span",Jn(n,{"data-type":"tag"}),n.text]},addNodeView(){return tl(dPe)},addCommands(){return{insertTag:n=>({chain:e})=>e().insertContent({type:this.name,attrs:n}).run()}}}),pPe=fr.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:n=>{const e=n.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:n=>n.textAlign?{style:`text-align: ${n.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:n=>({commands:e})=>this.options.alignments.includes(n)?this.options.types.map(t=>e.updateAttributes(t,{textAlign:n})).every(t=>t):!1,unsetTextAlign:()=>({commands:n})=>this.options.types.map(e=>n.resetAttributes(e,"textAlign")).every(e=>e)}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),vPe=pPe.extend({addOptions(){return{...this.parent?.(),types:["heading","paragraph"],alignments:["left","center","right","justify","distributed"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:n=>n.style.textAlignLast?"distributed":n.style.textAlign||this.options.defaultAlignment,renderHTML:n=>n.textAlign===this.options.defaultAlignment?{}:n.textAlign==="distributed"?{style:"text-align-last: justify"}:{style:`text-align: ${n.textAlign}`}}}}]},addKeyboardShortcuts(){return{...this.parent?.(),"Mod-Shift-d":()=>this.editor.commands.setTextAlign("distributed")}}}),sa=m.ref({isRunning:!1,currentParagraph:0,currentTextNode:0,currentChar:0});let cf=null,jv={totalChars:0,typedChars:0};function gPe(n){return n.reduce((e,t)=>t.type==="paragraph"&&t.content?t.content.reduce((r,i)=>r+(i.type==="text"?i.text?.length??0:0),e):e,0)}const mPe=fr.create({name:"typewriter",addCommands(){return{startTypewriter:(n,e)=>({editor:t})=>((async()=>{try{cf&&(clearTimeout(cf),cf=null),sa.value={isRunning:!0,currentParagraph:0,currentTextNode:0,currentChar:0},jv={totalChars:gPe(n?.content??[]),typedChars:0};const r=e?.focus===null?null:e?.focus??"end",i=async u=>{await new Promise(c=>{setTimeout(()=>{try{t.chain().insertContent(u).focus(r).run()}catch(f){console.error("插入内容时出错:",f)}c()},0)})},a=Math.max(e?.speed??1,0),o=u=>u?.type==="paragraph"&&(!u.content||u.content.length===0||u.content.length===1&&u.content[0].type==="text"&&!u.content[0].text),s=async(u,c,f,d=!1)=>{let h=0;if(u.type==="paragraph")if(o(u)){const p=[u];for(let v=c+1;v<f.length&&o(f[v]);v++)p.push(f[v]),h++,sa.value.currentParagraph++;await i(p),sa.value.currentParagraph++}else{if(await i([{type:"paragraph",attrs:u.attrs}]),u.content&&u.content.length>0)for(let p=0;p<u.content.length;p++){sa.value.currentTextNode=p;const v=u.content[p],g=await s(v,p,u.content,!1);p=p+(g??0)}else t.commands.enter();sa.value.currentParagraph++}else if(u.type==="text"){const p=u.text??"",v=u.marks??[],g=e?.step??1;for(let y=0;y<p.length;y+=g){if(!sa.value.isRunning)return;const b=Math.min(y+g,p.length),_=p.slice(y,b);await new Promise(x=>{cf=setTimeout(async()=>{await i([{type:"text",text:_,marks:v}]),sa.value.currentChar=y+_.length-1,jv.typedChars+=_.length,e?.onProgress&&jv.totalChars>0&&e.onProgress(jv.typedChars/jv.totalChars),x()},a)})}}else if(u.type==="table"){const p=[u];for(let v=c+1;v<f.length&&o(f[v]);v++)p.push(f[v]),h++;p.length===1&&p.push({type:"paragraph"}),await i(p),t.commands.enter()}else d?await i([u,{type:"paragraph"}]):await i([u]);return h},l=n?.content??[];for(let u=0;u<l.length&&sa.value.isRunning;u++){const c=await s(l[u],u,l,!0);u=u+(c??0)}sa.value.isRunning&&e?.onComplete&&e.onComplete(),sa.value.isRunning=!1}catch(r){console.error("类型写入器出错:",r)}})(),!0),stopTypewriter:()=>()=>(sa.value.isRunning=!1,cf&&(clearTimeout(cf),cf=null),!0),getTypewriterState:()=>({isRunning:sa.value.isRunning,currentParagraph:sa.value.currentParagraph,currentTextNode:sa.value.currentTextNode,currentChar:sa.value.currentChar})}}}),yPe={class:"max-w-full node-view-video white-view-node"},bPe=["src"],xPe={key:0,class:"uploading absolute top-0 right-0 left-0 h-[2px] bg-[#007bff]"},_Pe=m.defineComponent({__name:"node-view",props:Ql,setup(n){const e=m.inject("options"),t=m.inject("editor"),r=m.inject("uploadFileMap"),i=m.ref(null),a=m.ref(!1),o=m.ref(null),s=m.ref(0),l=m.ref(0),u=m.computed(()=>{const{nodeAlign:h,margin:p}=n.node.attrs,v=p?.top&&p?.top!==""?`${p.top}px`:void 0,g=p?.bottom&&p?.bottom!==""?`${p.bottom}px`:void 0;return{"justify-content":h,marginTop:v,marginBottom:g}}),c=()=>{t.value?.chain().focus().setNodeSelection(n.getPos()).run(),a.value=!0};m.onMounted(async()=>{if(await m.nextTick(),!(n.node.attrs.uploaded||!n.node.attrs.id)&&r.value.has(n.node.attrs.id))try{const h=r.value.get(n.node.attrs.id),{id:p,url:v}=await e.value?.onFileUpload?.(h)??{};i.value&&Ef(t.value,{id:p,src:v,uploaded:!0},n.getPos()),r.value.delete(n.node.attrs.id)}catch(h){console.error(h)}});const f=()=>{if(n.node.attrs.width===null){const{clientWidth:h=0,clientHeight:p=0}=o.value??{};s.value=i.value?.$el.clientWidth??0;const v=h/p;l.value=i.value?.$el.clientWidth/v,n.updateAttributes({width:(200*v).toFixed(2)}),setTimeout(()=>{n.updateAttributes({height:i.value?.$el.clientHeight})},200)}},d=({width:h,height:p})=>{n.updateAttributes({width:h,height:p})};return T_(i,()=>{a.value=!1}),(h,p)=>(m.openBlock(),m.createBlock(m.unref(Jl),{id:h.node.attrs.id,ref_key:"containerRef",ref:i,class:"white-video-wrapper flex max-h-full relative",style:m.normalizeStyle(u.value)},{default:m.withCtx(()=>[m.createElementVNode("div",yPe,[m.createVNode(m.unref(Ap),{selected:a.value,rotatable:!1,boundary:!1,width:Number(h.node.attrs.width),height:Number(h.node.attrs.height),"min-width":300,"min-height":200,"max-width":s.value,"max-height":l.value,"equal-proportion":!0,disabled:m.unref(e).editor?.readOnly,onResize:d,onFocus:c},{default:m.withCtx(()=>[m.createElementVNode("video",{ref_key:"videoRef",ref:o,src:h.node.attrs.src,preload:"metadata",crossorigin:"anonymous",controls:"",onCanplay:f,onClick:c},null,40,bPe),!h.node.attrs.uploaded&&h.node.attrs.id!==null?(m.openBlock(),m.createElementBlock("div",xPe)):m.createCommentVNode("",!0)]),_:1},8,["selected","width","height","max-width","max-height","disabled"])])]),_:1},8,["id","style"]))}}),SPe=yi.create({name:"video",group:"block",atom:!0,addAttributes(){return{vnode:{default:!0},file:{default:null},id:{default:null},name:{default:null},size:{default:null},src:{default:null},width:{default:null},height:{default:200},draggable:{default:!1},uploaded:{default:!1},previewType:{default:"video"}}},parseHTML(){return[{tag:"video"}]},renderHTML({HTMLAttributes:n}){return["video",Jn(n)]},addNodeView(){return tl(_Pe)},addCommands(){return{setVideo:n=>({commands:e,editor:t})=>e.insertContentAt(t.state.selection.anchor,{type:this.name,attrs:n})}}}),wPe=({container:n,options:e,uploadFileMap:t})=>{const{document:r,users:i,file:a,disableExtensions:o}=e.value,s={highlight:Wae.configure({multicolor:!0}),"ordered-list":ZLe,"bullet-list":Ice,"line-height":fLe.configure({types:["heading","paragraph"],defaultLineHeight:1.7}),margin:LLe,link:MY,image:yY,inlineImage:uLe,video:SPe,audio:oce,"code-block":The,tag:hPe,columns:Nce,mention:HLe.configure({suggestion:qLe(i??[],n.value)}),"date-time":Mhe,hr:KRe,"web-page":QRe,TaskList:Moe.configure({HTMLAttributes:{class:"white-task-list"}}),TaskItem:Noe.configure({nested:!0})},l=[qle.configure({bold:!1,bulletList:!1,orderedList:!1,codeBlock:!1,horizontalRule:!1,dropcursor:!1,history:!1}),toe.configure({placeholder:()=>"输入内容..."}),eoe.extend({addKeyboardShortcuts(){return{}}}),$ae.configure({className:"white-node-focused",mode:"all"}),jRe,Hae,WRe,Rae.extend({renderHTML:({HTMLAttributes:u})=>["b",u,0]}),Eoe,noe,roe,Vae,Bae,cLe,vPe,KLe,tce,oPe,ioe,cPe,lPe,HRe,JLe,nue.configure({scrollParent:()=>document.getElementById(`${n.value}`),getId:()=>ip()}),PF.configure(r?.typographyRules),Lae.configure({limit:r?.characterLimit!==0?r?.characterLimit:void 0}),URe.configure({allowedMimeTypes:a?.allowedMimeTypes,onPaste:async(u,c)=>{for(const f of c){const d=await vue(f);u.commands.insertFile({file:f,uploadFileMap:t.value,autoType:!0,fileDim:d})}},onDrop:(u,c,f)=>{for(const d of c)u.commands.insertFile({file:d,uploadFileMap:t.value,autoType:!0,pos:f})}}),Fae.configure({color:"#007bff"}),mPe];return Object.values(s).forEach(u=>{if(!o?.includes(u.name)){if(Array.isArray(u)){l.push(...u);return}l.push(u)}}),l},gz=n=>{let e=!0;return n.value.editor?.enableMarkdown||(e=[PF,yY]),e},kPe=m.defineComponent({__name:"ScrollAble",setup(n,{expose:e}){const t=m.ref(null),r=m.ref(null),i=m.ref(!0),a=m.ref(!0),o=()=>{const{scrollLeft:c=0,scrollWidth:f=0,clientWidth:d=0}=r.value??{};i.value=c===0,a.value=c+d+10>=f},s=()=>{(r.value?.scrollLeft||r.value?.scrollLeft===0)&&(r.value.scrollLeft-=r.value.offsetWidth-10||100)},l=()=>{(r.value?.scrollLeft||r.value?.scrollLeft===0)&&(r.value.scrollLeft+=r.value.offsetWidth-10||100)};return que(t,()=>{o()}),m.onMounted(()=>{r.value?.addEventListener("scroll",o)}),e({update:()=>{r.value&&(r.value.scrollLeft=0),a.value=!0,o()}}),(c,f)=>(m.openBlock(),m.createElementBlock("div",{ref_key:"wraperRef",ref:t,class:m.normalizeClass(["white-scrollable-container flex items-center",{"!pl-[36px]":!i.value,"!pr-[36px]":!a.value}])},[i.value?m.createCommentVNode("",!0):(m.openBlock(),m.createElementBlock("div",{key:0,class:"w-scrollable-control scrollable-left",onClick:s},[...f[0]||(f[0]=[m.createElementVNode("i",{class:"w-iconfont icon-left"},null,-1)])])),m.createElementVNode("div",{ref_key:"contentRef",ref:r,class:"w-scrollable-content text-center flex items-center"},[m.renderSlot(c.$slots,"default")],512),a.value?m.createCommentVNode("",!0):(m.openBlock(),m.createElementBlock("div",{key:1,class:"w-scrollable-control scrollable-right",onClick:l},[...f[1]||(f[1]=[m.createElementVNode("i",{class:"w-iconfont icon-right"},null,-1)])]))],2))}}),TPe={class:"w-[28px] h-[28px] cursor-pointer flex items-center justify-center gap-[0.4rem] text-[12px] rounded-[4px] hover:text-[#007aff] hover:bg-[#edeef2]"},CPe=m.defineComponent({__name:"tool-column",setup(n){const e=m.inject("page"),t=m.ref(!1),r=i=>{e.value.toolbar=i,t.value=!1};return(i,a)=>(m.openBlock(),m.createBlock(js,{trigger:"click",placement:"bottom",value:t.value,"onUpdate:value":a[2]||(a[2]=o=>t.value=o),contentStyle:{padding:"6px 0",boxShadow:"0 6px 16px 0 rgba(0, 0, 0, 0.08)"}},{content:m.withCtx(()=>[m.createElementVNode("div",{class:m.normalizeClass(["px-[12px] py-[5px] flex items-center gap-[0.4rem] cursor-pointer hover:bg-[rgb(242,243,245)]",m.unref(e).toolbar==="single"?"text-[#007aff]":""]),onClick:a[0]||(a[0]=o=>r("single"))},[...a[3]||(a[3]=[m.createElementVNode("i",{class:"w-iconfont icon-single"},null,-1),m.createTextVNode(" 单行工具栏 ",-1)])],2),m.createElementVNode("div",{class:m.normalizeClass(["px-[12px] py-[5px] flex items-center gap-[0.4rem] cursor-pointer hover:bg-[rgb(242,243,245)]",m.unref(e).toolbar==="double"?"text-[#007aff]":""]),onClick:a[1]||(a[1]=o=>r("double"))},[...a[4]||(a[4]=[m.createElementVNode("i",{class:"w-iconfont icon-double"},null,-1),m.createTextVNode(" 双行工具栏 ",-1)])],2)]),default:m.withCtx(()=>[m.createElementVNode("span",TPe,[m.createElementVNode("i",{class:m.normalizeClass(["w-iconfont icon-bottom !text-[13px] transition-transform duration-200",t.value?"rotate-180":""])},null,2)])]),_:1},8,["value"]))}}),EPe=["disabled"],MPe={key:0,class:"text-[12px] mt-2"},An=m.defineComponent({__name:"MenusButton",props:{ico:{default:""},text:{default:""},hideText:{type:Boolean,default:!1},forceEnabled:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},shortcut:{default:void 0},shortcutText:{default:void 0},menuActive:{type:Boolean,default:!1}},setup(n){const e=m.useAttrs(),t=m.inject("editor"),r=(...i)=>{e.onMenuClickThrough?e.onMenuClickThrough(...i):e.onMenuClick&&e.onMenuClick(...i)};return(i,a)=>{const o=m.resolveDirective("tooltip");return m.withDirectives((m.openBlock(),m.createElementBlock("button",m.mergeProps({class:["white-editor-tool-item",{"is-show-text":!n.hideText,"is-active":n.menuActive&&m.unref(t)?.isEditable!==!1,"is-disabled":!n.forceEnabled&&(n.disabled||m.unref(t)?.isEditable===!1)}],disabled:!n.forceEnabled&&(n.disabled||m.unref(t)?.isEditable===!1)},m.unref(e),{onClick:r}),[m.createElementVNode("i",{class:m.normalizeClass(["w-iconfont w-icon",`icon-${n.ico}`])},null,2),n.hideText?m.createCommentVNode("",!0):(m.openBlock(),m.createElementBlock("p",MPe,m.toDisplayString(n.text),1))],16,EPe)),[[o,`${n.text}`]])}}}),WM=m.defineComponent({__name:"bold",setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createBlock(An,{ico:"bold",text:"加粗",shortcut:"Ctrl+B","hide-text":"","menu-active":m.unref(e)?.isActive("bold"),disabled:!m.unref(e)?.can().chain().focus().toggleBold().run(),onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.chain().focus().toggleBold().run())},null,8,["menu-active","disabled"]))}}),jM=m.defineComponent({__name:"underline",setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createBlock(An,{ico:"underline",text:"下划线",shortcut:"Ctrl+U","hide-text":"","menu-active":m.unref(e)?.isActive("underline"),disabled:!m.unref(e)?.can().chain().focus().toggleUnderline().run(),onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.chain().focus().toggleUnderline().run())},null,8,["menu-active","disabled"]))}}),qM=m.defineComponent({__name:"decoration",setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createBlock(An,{ico:"decoration",text:"删除线",shortcut:"Ctrl+Shift+X","hide-text":"","menu-active":m.unref(e)?.isActive("strike"),disabled:!m.unref(e)?.can().chain().focus().toggleStrike().run(),onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.chain().focus().toggleStrike().run())},null,8,["menu-active","disabled"]))}}),KM=m.defineComponent({__name:"italic",setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createBlock(An,{ico:"italic",text:"斜体",shortcut:"Ctrl+I","hide-text":"","menu-active":m.unref(e)?.isActive("italic"),disabled:!m.unref(e)?.can().chain().focus().toggleItalic().run(),onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.chain().focus().toggleItalic().run())},null,8,["menu-active","disabled"]))}}),APe=["disabled"],NPe={key:0,class:"text-[13px] text-[#333639] ml-[3px]"},DPe={class:"flex items-center justify-center w-full h-full"},OPe=["disabled"],IPe={class:"h-full gap-[5px]"},RPe={key:0,class:"text-[12px] mt-2"},il=m.defineComponent({__name:"MenusPopup",props:{ico:{default:""},icoSize:{default:14},text:{default:""},hideText:{type:Boolean,default:!1},popupVisible:{type:Boolean,default:!1},forceEnabled:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},shortcut:{default:void 0},shortcutText:{default:void 0},menuActive:{type:Boolean,default:!1},popupType:{default:"arrow"},placement:{default:"bottom"},trigger:{default:"click"}},emits:["update:popupVisible"],setup(n,{emit:e}){const t=m.useAttrs(),r=m.inject("editor"),i=n,a=e,o=m.computed({get:()=>i.popupVisible,set:l=>a("update:popupVisible",l)}),s=(...l)=>{t.onMenuClickThrough?t.onMenuClickThrough(...l):t.onMenuClick&&t.onMenuClick(...l)};return(l,u)=>{const c=m.resolveDirective("tooltip");return m.openBlock(),m.createElementBlock(m.Fragment,null,[n.popupType==="arrow"?m.withDirectives((m.openBlock(),m.createElementBlock("button",m.mergeProps({key:0,class:["white-editor-tool-item white-editor-tool-pop-item flex items-center justify-center",{"is-show-text":!n.hideText,"is-active":n.menuActive&&m.unref(r)?.isEditable!==!1,"is-disabled":!n.forceEnabled&&(n.disabled||m.unref(r)?.isEditable===!1)}],disabled:!n.forceEnabled&&(n.disabled||m.unref(r)?.isEditable===!1)},m.unref(t)),[m.createElementVNode("div",{class:"flex items-center h-full",onClick:s},[m.createElementVNode("div",null,[m.createElementVNode("i",{class:m.normalizeClass(["w-iconfont w-icon",`icon-${n.ico}`]),style:m.normalizeStyle(n.hideText?`font-size: ${n.icoSize}px`:"")},null,6),m.renderSlot(l.$slots,"default")]),n.hideText?m.createCommentVNode("",!0):(m.openBlock(),m.createElementBlock("p",NPe,m.toDisplayString(n.text),1))]),m.createVNode(js,{trigger:n.trigger,value:o.value,"onUpdate:value":u[0]||(u[0]=f=>o.value=f),placement:n.placement,disabled:!n.forceEnabled&&(n.disabled||m.unref(r)?.isEditable===!1),hasClass:"flex items-center justify-center w-[13px] h-full hover:bg-[#d7d3d3] mr-[-6px] ml-[4px] w-arrow"},{content:m.withCtx(()=>[m.renderSlot(l.$slots,"content")]),default:m.withCtx(()=>[m.createElementVNode("span",DPe,[m.createElementVNode("i",{class:m.normalizeClass(["w-iconfont icon-bottom !text-[8px] transition-transform duration-200",o.value?"rotate-180":""])},null,2)])]),_:3},8,["trigger","value","placement","disabled"])],16,APe)),[[c,`${n.text}`]]):m.createCommentVNode("",!0),n.popupType==="select"?(m.openBlock(),m.createBlock(js,{key:1,trigger:n.trigger,value:o.value,"onUpdate:value":u[1]||(u[1]=f=>o.value=f),placement:n.placement},{content:m.withCtx(()=>[m.renderSlot(l.$slots,"content")]),default:m.withCtx(()=>[m.renderSlot(l.$slots,"default",{},()=>[m.withDirectives((m.openBlock(),m.createElementBlock("button",m.mergeProps({class:["white-editor-tool-item white-editor-tool-pop-item flex items-center justify-center",{"is-show-text":!n.hideText,"is-active":n.menuActive&&m.unref(r)?.isEditable!==!1,"is-disabled":!n.forceEnabled&&(n.disabled||m.unref(r)?.isEditable===!1)}],disabled:!n.forceEnabled&&(n.disabled||m.unref(r)?.isEditable===!1)},m.unref(t)),[m.createElementVNode("div",IPe,[m.createElementVNode("i",{class:m.normalizeClass(["w-iconfont w-icon",`icon-${n.ico}`]),style:m.normalizeStyle(n.hideText?`font-size: ${n.icoSize}px`:"")},null,6),n.hideText?m.createCommentVNode("",!0):(m.openBlock(),m.createElementBlock("p",RPe,m.toDisplayString(n.text),1))])],16,OPe)),[[c,`${n.text}`]])])]),_:3},8,["trigger","value","placement"])):m.createCommentVNode("",!0)],64)}}});function t_(n){"@babel/helpers - typeof";return t_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t_(n)}var LPe=/^\s+/,PPe=/\s+$/;function Qt(n,e){if(n=n||"",e=e||{},n instanceof Qt)return n;if(!(this instanceof Qt))return new Qt(n,e);var t=BPe(n);this._originalInput=n,this._r=t.r,this._g=t.g,this._b=t.b,this._a=t.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||t.format,this._gradientType=e.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._ok=t.ok}Qt.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var n=this.toRgb();return(n.r*299+n.g*587+n.b*114)/1e3},getLuminance:function(){var n=this.toRgb(),e,t,r,i,a,o;return e=n.r/255,t=n.g/255,r=n.b/255,e<=.03928?i=e/12.92:i=Math.pow((e+.055)/1.055,2.4),t<=.03928?a=t/12.92:a=Math.pow((t+.055)/1.055,2.4),r<=.03928?o=r/12.92:o=Math.pow((r+.055)/1.055,2.4),.2126*i+.7152*a+.0722*o},setAlpha:function(n){return this._a=zY(n),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var n=yz(this._r,this._g,this._b);return{h:n.h*360,s:n.s,v:n.v,a:this._a}},toHsvString:function(){var n=yz(this._r,this._g,this._b),e=Math.round(n.h*360),t=Math.round(n.s*100),r=Math.round(n.v*100);return this._a==1?"hsv("+e+", "+t+"%, "+r+"%)":"hsva("+e+", "+t+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var n=mz(this._r,this._g,this._b);return{h:n.h*360,s:n.s,l:n.l,a:this._a}},toHslString:function(){var n=mz(this._r,this._g,this._b),e=Math.round(n.h*360),t=Math.round(n.s*100),r=Math.round(n.l*100);return this._a==1?"hsl("+e+", "+t+"%, "+r+"%)":"hsla("+e+", "+t+"%, "+r+"%, "+this._roundA+")"},toHex:function(n){return bz(this._r,this._g,this._b,n)},toHexString:function(n){return"#"+this.toHex(n)},toHex8:function(n){return $Pe(this._r,this._g,this._b,this._a,n)},toHex8String:function(n){return"#"+this.toHex8(n)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(Ar(this._r,255)*100)+"%",g:Math.round(Ar(this._g,255)*100)+"%",b:Math.round(Ar(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(Ar(this._r,255)*100)+"%, "+Math.round(Ar(this._g,255)*100)+"%, "+Math.round(Ar(this._b,255)*100)+"%)":"rgba("+Math.round(Ar(this._r,255)*100)+"%, "+Math.round(Ar(this._g,255)*100)+"%, "+Math.round(Ar(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:QPe[bz(this._r,this._g,this._b,!0)]||!1},toFilter:function(n){var e="#"+xz(this._r,this._g,this._b,this._a),t=e,r=this._gradientType?"GradientType = 1, ":"";if(n){var i=Qt(n);t="#"+xz(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+e+",endColorstr="+t+")"},toString:function(n){var e=!!n;n=n||this._format;var t=!1,r=this._a<1&&this._a>=0,i=!e&&r&&(n==="hex"||n==="hex6"||n==="hex3"||n==="hex4"||n==="hex8"||n==="name");return i?n==="name"&&this._a===0?this.toName():this.toRgbString():(n==="rgb"&&(t=this.toRgbString()),n==="prgb"&&(t=this.toPercentageRgbString()),(n==="hex"||n==="hex6")&&(t=this.toHexString()),n==="hex3"&&(t=this.toHexString(!0)),n==="hex4"&&(t=this.toHex8String(!0)),n==="hex8"&&(t=this.toHex8String()),n==="name"&&(t=this.toName()),n==="hsl"&&(t=this.toHslString()),n==="hsv"&&(t=this.toHsvString()),t||this.toHexString())},clone:function(){return Qt(this.toString())},_applyModification:function(n,e){var t=n.apply(null,[this].concat([].slice.call(e)));return this._r=t._r,this._g=t._g,this._b=t._b,this.setAlpha(t._a),this},lighten:function(){return this._applyModification(WPe,arguments)},brighten:function(){return this._applyModification(jPe,arguments)},darken:function(){return this._applyModification(qPe,arguments)},desaturate:function(){return this._applyModification(HPe,arguments)},saturate:function(){return this._applyModification(GPe,arguments)},greyscale:function(){return this._applyModification(UPe,arguments)},spin:function(){return this._applyModification(KPe,arguments)},_applyCombination:function(n,e){return n.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(ZPe,arguments)},complement:function(){return this._applyCombination(YPe,arguments)},monochromatic:function(){return this._applyCombination(JPe,arguments)},splitcomplement:function(){return this._applyCombination(XPe,arguments)},triad:function(){return this._applyCombination(_z,[3])},tetrad:function(){return this._applyCombination(_z,[4])}};Qt.fromRatio=function(n,e){if(t_(n)=="object"){var t={};for(var r in n)n.hasOwnProperty(r)&&(r==="a"?t[r]=n[r]:t[r]=hg(n[r]));n=t}return Qt(n,e)};function BPe(n){var e={r:0,g:0,b:0},t=1,r=null,i=null,a=null,o=!1,s=!1;return typeof n=="string"&&(n=r4e(n)),t_(n)=="object"&&(ml(n.r)&&ml(n.g)&&ml(n.b)?(e=VPe(n.r,n.g,n.b),o=!0,s=String(n.r).substr(-1)==="%"?"prgb":"rgb"):ml(n.h)&&ml(n.s)&&ml(n.v)?(r=hg(n.s),i=hg(n.v),e=FPe(n.h,r,i),o=!0,s="hsv"):ml(n.h)&&ml(n.s)&&ml(n.l)&&(r=hg(n.s),a=hg(n.l),e=zPe(n.h,r,a),o=!0,s="hsl"),n.hasOwnProperty("a")&&(t=n.a)),t=zY(t),{ok:o,format:n.format||s,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:t}}function VPe(n,e,t){return{r:Ar(n,255)*255,g:Ar(e,255)*255,b:Ar(t,255)*255}}function mz(n,e,t){n=Ar(n,255),e=Ar(e,255),t=Ar(t,255);var r=Math.max(n,e,t),i=Math.min(n,e,t),a,o,s=(r+i)/2;if(r==i)a=o=0;else{var l=r-i;switch(o=s>.5?l/(2-r-i):l/(r+i),r){case n:a=(e-t)/l+(e<t?6:0);break;case e:a=(t-n)/l+2;break;case t:a=(n-e)/l+4;break}a/=6}return{h:a,s:o,l:s}}function zPe(n,e,t){var r,i,a;n=Ar(n,360),e=Ar(e,100),t=Ar(t,100);function o(u,c,f){return f<0&&(f+=1),f>1&&(f-=1),f<1/6?u+(c-u)*6*f:f<1/2?c:f<2/3?u+(c-u)*(2/3-f)*6:u}if(e===0)r=i=a=t;else{var s=t<.5?t*(1+e):t+e-t*e,l=2*t-s;r=o(l,s,n+1/3),i=o(l,s,n),a=o(l,s,n-1/3)}return{r:r*255,g:i*255,b:a*255}}function yz(n,e,t){n=Ar(n,255),e=Ar(e,255),t=Ar(t,255);var r=Math.max(n,e,t),i=Math.min(n,e,t),a,o,s=r,l=r-i;if(o=r===0?0:l/r,r==i)a=0;else{switch(r){case n:a=(e-t)/l+(e<t?6:0);break;case e:a=(t-n)/l+2;break;case t:a=(n-e)/l+4;break}a/=6}return{h:a,s:o,v:s}}function FPe(n,e,t){n=Ar(n,360)*6,e=Ar(e,100),t=Ar(t,100);var r=Math.floor(n),i=n-r,a=t*(1-e),o=t*(1-i*e),s=t*(1-(1-i)*e),l=r%6,u=[t,o,a,a,s,t][l],c=[s,t,t,o,a,a][l],f=[a,a,s,t,t,o][l];return{r:u*255,g:c*255,b:f*255}}function bz(n,e,t,r){var i=[Uo(Math.round(n).toString(16)),Uo(Math.round(e).toString(16)),Uo(Math.round(t).toString(16))];return r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function $Pe(n,e,t,r,i){var a=[Uo(Math.round(n).toString(16)),Uo(Math.round(e).toString(16)),Uo(Math.round(t).toString(16)),Uo(FY(r))];return i&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}function xz(n,e,t,r){var i=[Uo(FY(r)),Uo(Math.round(n).toString(16)),Uo(Math.round(e).toString(16)),Uo(Math.round(t).toString(16))];return i.join("")}Qt.equals=function(n,e){return!n||!e?!1:Qt(n).toRgbString()==Qt(e).toRgbString()};Qt.random=function(){return Qt.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function HPe(n,e){e=e===0?0:e||10;var t=Qt(n).toHsl();return t.s-=e/100,t.s=xS(t.s),Qt(t)}function GPe(n,e){e=e===0?0:e||10;var t=Qt(n).toHsl();return t.s+=e/100,t.s=xS(t.s),Qt(t)}function UPe(n){return Qt(n).desaturate(100)}function WPe(n,e){e=e===0?0:e||10;var t=Qt(n).toHsl();return t.l+=e/100,t.l=xS(t.l),Qt(t)}function jPe(n,e){e=e===0?0:e||10;var t=Qt(n).toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(255*-(e/100)))),t.g=Math.max(0,Math.min(255,t.g-Math.round(255*-(e/100)))),t.b=Math.max(0,Math.min(255,t.b-Math.round(255*-(e/100)))),Qt(t)}function qPe(n,e){e=e===0?0:e||10;var t=Qt(n).toHsl();return t.l-=e/100,t.l=xS(t.l),Qt(t)}function KPe(n,e){var t=Qt(n).toHsl(),r=(t.h+e)%360;return t.h=r<0?360+r:r,Qt(t)}function YPe(n){var e=Qt(n).toHsl();return e.h=(e.h+180)%360,Qt(e)}function _z(n,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var t=Qt(n).toHsl(),r=[Qt(n)],i=360/e,a=1;a<e;a++)r.push(Qt({h:(t.h+a*i)%360,s:t.s,l:t.l}));return r}function XPe(n){var e=Qt(n).toHsl(),t=e.h;return[Qt(n),Qt({h:(t+72)%360,s:e.s,l:e.l}),Qt({h:(t+216)%360,s:e.s,l:e.l})]}function ZPe(n,e,t){e=e||6,t=t||30;var r=Qt(n).toHsl(),i=360/t,a=[Qt(n)];for(r.h=(r.h-(i*e>>1)+720)%360;--e;)r.h=(r.h+i)%360,a.push(Qt(r));return a}function JPe(n,e){e=e||6;for(var t=Qt(n).toHsv(),r=t.h,i=t.s,a=t.v,o=[],s=1/e;e--;)o.push(Qt({h:r,s:i,v:a})),a=(a+s)%1;return o}Qt.mix=function(n,e,t){t=t===0?0:t||50;var r=Qt(n).toRgb(),i=Qt(e).toRgb(),a=t/100,o={r:(i.r-r.r)*a+r.r,g:(i.g-r.g)*a+r.g,b:(i.b-r.b)*a+r.b,a:(i.a-r.a)*a+r.a};return Qt(o)};Qt.readability=function(n,e){var t=Qt(n),r=Qt(e);return(Math.max(t.getLuminance(),r.getLuminance())+.05)/(Math.min(t.getLuminance(),r.getLuminance())+.05)};Qt.isReadable=function(n,e,t){var r=Qt.readability(n,e),i,a;switch(a=!1,i=i4e(t),i.level+i.size){case"AAsmall":case"AAAlarge":a=r>=4.5;break;case"AAlarge":a=r>=3;break;case"AAAsmall":a=r>=7;break}return a};Qt.mostReadable=function(n,e,t){var r=null,i=0,a,o,s,l;t=t||{},o=t.includeFallbackColors,s=t.level,l=t.size;for(var u=0;u<e.length;u++)a=Qt.readability(n,e[u]),a>i&&(i=a,r=Qt(e[u]));return Qt.isReadable(n,r,{level:s,size:l})||!o?r:(t.includeFallbackColors=!1,Qt.mostReadable(n,["#fff","#000"],t))};var YM=Qt.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",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:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",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:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",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:"f00",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:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},QPe=Qt.hexNames=e4e(YM);function e4e(n){var e={};for(var t in n)n.hasOwnProperty(t)&&(e[n[t]]=t);return e}function zY(n){return n=parseFloat(n),(isNaN(n)||n<0||n>1)&&(n=1),n}function Ar(n,e){t4e(n)&&(n="100%");var t=n4e(n);return n=Math.min(e,Math.max(0,parseFloat(n))),t&&(n=parseInt(n*e,10)/100),Math.abs(n-e)<1e-6?1:n%e/parseFloat(e)}function xS(n){return Math.min(1,Math.max(0,n))}function $a(n){return parseInt(n,16)}function t4e(n){return typeof n=="string"&&n.indexOf(".")!=-1&&parseFloat(n)===1}function n4e(n){return typeof n=="string"&&n.indexOf("%")!=-1}function Uo(n){return n.length==1?"0"+n:""+n}function hg(n){return n<=1&&(n=n*100+"%"),n}function FY(n){return Math.round(parseFloat(n)*255).toString(16)}function Sz(n){return $a(n)/255}var Bo=(function(){var n="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",t="(?:"+e+")|(?:"+n+")",r="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",i="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?";return{CSS_UNIT:new RegExp(t),rgb:new RegExp("rgb"+r),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+r),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+r),hsva:new RegExp("hsva"+i),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 ml(n){return!!Bo.CSS_UNIT.exec(n)}function r4e(n){n=n.replace(LPe,"").replace(PPe,"").toLowerCase();var e=!1;if(YM[n])n=YM[n],e=!0;else if(n=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t;return(t=Bo.rgb.exec(n))?{r:t[1],g:t[2],b:t[3]}:(t=Bo.rgba.exec(n))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=Bo.hsl.exec(n))?{h:t[1],s:t[2],l:t[3]}:(t=Bo.hsla.exec(n))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=Bo.hsv.exec(n))?{h:t[1],s:t[2],v:t[3]}:(t=Bo.hsva.exec(n))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=Bo.hex8.exec(n))?{r:$a(t[1]),g:$a(t[2]),b:$a(t[3]),a:Sz(t[4]),format:e?"name":"hex8"}:(t=Bo.hex6.exec(n))?{r:$a(t[1]),g:$a(t[2]),b:$a(t[3]),format:e?"name":"hex"}:(t=Bo.hex4.exec(n))?{r:$a(t[1]+""+t[1]),g:$a(t[2]+""+t[2]),b:$a(t[3]+""+t[3]),a:Sz(t[4]+""+t[4]),format:e?"name":"hex8"}:(t=Bo.hex3.exec(n))?{r:$a(t[1]+""+t[1]),g:$a(t[2]+""+t[2]),b:$a(t[3]+""+t[3]),format:e?"name":"hex"}:!1}function i4e(n){var e,t;return n=n||{level:"AA",size:"small"},e=(n.level||"AA").toUpperCase(),t=(n.size||"small").toLowerCase(),e!=="AA"&&e!=="AAA"&&(e="AA"),t!=="small"&&t!=="large"&&(t="small"),{level:e,size:t}}const wz=(n,e,t=!1)=>{if(t)switch(e){case"rgb":return n.toRgb();case"prgb":return n.toPercentageRgb();case"hsl":return n.toHsl();case"hsv":return n.toHsv();default:return null}else{let r=e;e==="hex"&&n.getAlpha()<1&&(r="hex8");let i=n.toString(r);try{i=JSON.parse(i)}catch{}return i}},ET=(n,e)=>!!(Object.prototype.hasOwnProperty.call(n,e)&&typeof n[e]<"u"),o1=n=>typeof n>"u",_S=["update:tinyColor","update:modelValue","input"];function SS(n,e,t){let r,i;const a=m.computed({get:()=>{const{modelValue:s,tinyColor:l,value:u}=n,c=l??s??u;return o1(i)&&(o1(u)||(i=Qt(u).getFormat()),o1(s)||(i=Qt(s).getFormat())),o1(r)&&(typeof u=="object"&&!(u instanceof Qt)&&(r=!0),typeof s=="object"&&(r=!0)),Qt(c)},set:s=>{o(s)}}),o=s=>{const l=Qt(s);if(ET(n,"tinyColor")&&e("update:tinyColor",l),ET(n,"modelValue")){const u=wz(l,i,r);e("update:modelValue",u)}if(ET(n,"value")){const u=wz(l,i,r);e("input",u)}};return a}const $Y=n=>{const e={x:0,y:0};return n instanceof MouseEvent&&(e.x=n.pageX,e.y=n.pageY),typeof TouchEvent<"u"&&n instanceof TouchEvent&&(e.x=n.touches?.[0]?n.touches[0].pageX:n.changedTouches?.[0]?n.changedTouches[0].pageX:0,e.y=n.touches?.[0]?n.touches[0].pageY:n.changedTouches?.[0]?n.changedTouches[0].pageY:0),e},a4e=()=>{const n=window.scrollX||window.pageXOffset||document.documentElement.scrollLeft||0,e=window.scrollY||window.pageYOffset||document.documentElement.scrollTop||0;return{x:n,y:e}},HY=n=>{const{x:e,y:t}=a4e(),r=n.getBoundingClientRect();return{x:r.left+e,y:r.top+t}},BO=n=>n.code==="ArrowUp"||n.keyCode===38?"up":n.code==="ArrowDown"||n.keyCode===40?"down":n.code==="ArrowLeft"||n.keyCode===37?"left":n.code==="ArrowRight"||n.keyCode===39?"right":null;function o4e(n){const e=n.toString();return e.indexOf(".")!==-1?e.split(".")[1].length:0}function MT(n,e,t){return Math.min(Math.max(n,e),t)}const GY=(n,e=20)=>{let t,r,i;return(...a)=>{t?(clearTimeout(r),r=setTimeout(()=>{Date.now()-i>=e&&(n(...a),i=Date.now())},Math.max(e-(Date.now()-i),0))):(n(...a),i=Date.now(),t=!0)}},s4e=["aria-valuetext"],l4e=m.defineComponent({__name:"SaturationSlider",props:{hue:{},tinyColor:{},modelValue:{},value:{}},emits:["change"].concat(_S),setup(n,{emit:e}){const t=e,r=n,i=m.ref(0),a=SS(r,t),o=m.computed(()=>a.value.toHsv()),s=m.computed(()=>r.hue??o.value.h),l=m.computed(()=>`hsl(${s.value}, 100%, 50%)`),u=m.computed(()=>-(o.value.v*100)+1+100+"%"),c=m.computed(()=>o.value.v<=.01?i.value*100+"%":o.value.s*100+"%"),f=m.ref(null);function d(_){const x=f.value;if(!x)return;const T=x.clientWidth,k=x.clientHeight,{x:C,y:D}=HY(x),{x:O,y:R}=$Y(_),V=MT(O-C,0,T),F=MT(R-D,0,k),$=V/T,J=MT(1-F/k,0,1);i.value=$;let te=Math.round($*100),Q=Math.round(J*100);te===1&&(te=.01),Q===1&&(Q=.01),h({h:s.value,s:te,v:Q,a:o.value.a})}function h(_){a.value=_}const p=GY(d,20);function v(_){_.preventDefault(),_.type.startsWith("mouse")?(window.addEventListener("mousemove",p),window.addEventListener("mouseup",p),window.addEventListener("mouseup",g)):_.type.startsWith("touch")&&(window.addEventListener("touchmove",p),window.addEventListener("touchend",p),window.addEventListener("touchend",g))}function g(){y()}function y(){window.removeEventListener("mousemove",p),window.removeEventListener("mouseup",p),window.removeEventListener("mouseup",g),window.removeEventListener("touchmove",p),window.removeEventListener("touchend",p),window.removeEventListener("touchend",g)}function b(_){switch(_.preventDefault(),BO(_)){case"left":{const x=o.value.s-.01;h({...o.value,s:x>=0?x:0});break}case"right":{const x=o.value.s+.01;h({...o.value,s:x>1?1:x});break}case"up":{const x=o.value.v+.01;h({...o.value,v:x>1?1:x});break}case"down":{const x=o.value.v-.01;h({...o.value,v:x<0?0:x});break}}}return m.onUnmounted(()=>{y()}),(_,x)=>(m.openBlock(),m.createElementBlock("div",{class:"vc-saturation-slider bg",style:m.normalizeStyle({background:l.value}),ref_key:"containerRef",ref:f,onMousedown:v,onTouchstart:v,role:"application","aria-label":"Saturation and brightness picker"},[x[1]||(x[1]=m.createElementVNode("div",{class:"bg white"},null,-1)),x[2]||(x[2]=m.createElementVNode("div",{class:"bg black"},null,-1)),m.createElementVNode("div",{class:"picker-wrap",style:m.normalizeStyle({top:u.value,left:c.value}),role:"slider",tabindex:"0","aria-valuemin":"0","aria-valuemax":"1","aria-label":"press arrow to change saturation or brightness","aria-valuenow":"?","aria-valuetext":`saturation: ${o.value.s.toFixed(0)}%, brightness: ${o.value.v.toFixed(0)}%`,onKeydown:b},x[0]||(x[0]=[m.createElementVNode("div",{class:"picker"},null,-1)]),44,s4e)],36))}}),Id=(n,e)=>{const t=n.__vccOpts||n;for(const[r,i]of e)t[r]=i;return t},UY=Id(l4e,[["__scopeId","data-v-4d048d6e"]]),XM=n=>typeof n<"u",u4e={class:"vc-base-slider"},c4e={key:0,class:"background"},f4e=["aria-label","aria-valuemax","aria-valuenow"],d4e=m.defineComponent({__name:"BaseSlider",props:{direction:{default:"horizontal"},modelValue:{default:0},value:{default:0},max:{default:100},step:{},ariaLabel:{default:"slider"}},emits:["input","update:modelValue"],setup(n,{emit:e}){const t=n,r=e,i=m.computed(()=>t.modelValue??t.value),a=m.computed(()=>{let p=i.value/t.max;return t.direction==="vertical"&&(p=1-p),100*p+"%"}),o=m.ref(null);function s(p){XM(p)&&(r("input",p),r("update:modelValue",p))}function l(p){const{direction:v,max:g}=t,y=o.value;if(!y)return;const b=y.clientWidth,_=y.clientHeight,{x,y:T}=HY(y),{x:k,y:C}=$Y(p),D=k-x,O=C-T;let R;v==="vertical"?O<0?R=g:O>_?R=0:R=(1-O/_)*g:D<0?R=0:D>b?R=g:R=D/b*g,s(R)}const u=GY(l);function c(p){l(p),p.type.startsWith("mouse")?(window.addEventListener("mousemove",u),window.addEventListener("mouseup",f)):(window.addEventListener("touchmove",u),window.addEventListener("touchend",f))}function f(){d()}function d(){window.removeEventListener("mousemove",u),window.removeEventListener("mouseup",f),window.removeEventListener("touchmove",u),window.removeEventListener("touchend",f)}function h(p){p.preventDefault();const{direction:v,max:g}=t,y=BO(p),b=t.step??g/100,_=i.value;let x;switch(y){case"left":{if(v!=="horizontal")return;x=_-b<0?0:_-b;break}case"right":{if(v!=="horizontal")return;x=_+b>g?g:_+b;break}case"down":{if(v!=="vertical")return;x=_-b<0?0:_-b;break}case"up":{if(v!=="vertical")return;x=_+b>g?g:_+b;break}}s(x)}return m.onUnmounted(()=>{d()}),(p,v)=>(m.openBlock(),m.createElementBlock("div",u4e,[p.$slots.background?(m.openBlock(),m.createElementBlock("div",c4e,[m.renderSlot(p.$slots,"background",{},void 0,!0)])):m.createCommentVNode("",!0),m.createElementVNode("div",{class:m.normalizeClass({slider:!0,horizontal:p.direction==="horizontal",vertical:p.direction==="vertical"}),ref_key:"containerRef",ref:o,onMousedown:c,onTouchstart:c,role:"slider","aria-label":p.ariaLabel,"aria-valuemax":p.max,"aria-valuemin":"0","aria-valuenow":i.value.toFixed(1),tabindex:"0",onKeydown:h},[m.createElementVNode("div",{class:"picker-wrap",style:m.normalizeStyle({left:p.direction==="horizontal"?a.value:0,top:p.direction==="vertical"?a.value:0}),role:"presentation"},[m.renderSlot(p.$slots,"picker",{},()=>[v[0]||(v[0]=m.createElementVNode("div",{class:"picker"},null,-1))],!0)],4)],42,f4e)]))}}),WY=Id(d4e,[["__scopeId","data-v-972b0fad"]]),h4e=m.defineComponent({__name:"HueSlider",props:{direction:{default:"horizontal"},modelValue:{default:0}},emits:["update:modelValue"],setup(n,{emit:e}){m.useCssVars(c=>({"2f44f39d":i.value}));const t=n,r=e,i=m.computed(()=>`linear-gradient(to ${t.direction==="horizontal"?"right":"top"}, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%)`),a=m.computed(()=>{const c=Number(t.modelValue);return Number.isNaN(c)?0:c}),o=m.ref();m.watch(a,(c,f)=>{c!==0&&c-f>0&&(o.value="right"),c!==0&&c-f<0&&(o.value="left")});const s=m.computed(()=>t.direction==="vertical"?a.value===0&&o.value==="right"?0:a.value:t.direction==="horizontal"?a.value===0&&o.value==="right"?360:a.value:0);function l(c){u(Math.round(c))}function u(c){r("update:modelValue",c)}return(c,f)=>(m.openBlock(),m.createBlock(WY,{class:"vc-hue-slider",max:360,step:1,modelValue:s.value,direction:c.direction,"onUpdate:modelValue":l,"aria-label":"Hue"},{background:m.withCtx(()=>f[0]||(f[0]=[m.createElementVNode("div",{class:"gradient"},null,-1)])),picker:m.withCtx(()=>[m.renderSlot(c.$slots,"default",{},void 0,!0)]),_:3},8,["modelValue","direction"]))}}),jY=Id(h4e,[["__scopeId","data-v-5367c985"]]),p4e=m.defineComponent({__name:"CheckerboardBG",props:{size:{default:8},white:{default:"#fff"},grey:{default:"#e6e6e6"}},setup(n){const e=n;function t(a,o,s){if(typeof document>"u")return null;var l=document.createElement("canvas");l.width=l.height=s*2;var u=l.getContext("2d");return u?(u.fillStyle=a,u.fillRect(0,0,l.width,l.height),u.fillStyle=o,u.fillRect(0,0,s,s),u.translate(s,s),u.fillRect(0,0,s,s),l.toDataURL()):null}function r(a,o,s){return t(a,o,s)}const i=m.computed(()=>`url(${r(e.white,e.grey,e.size)})`);return(a,o)=>(m.openBlock(),m.createElementBlock("div",{class:"vc-checkerboard",style:m.normalizeStyle({backgroundImage:i.value})},null,4))}}),ZM=Id(p4e,[["__scopeId","data-v-37d61ccd"]]),v4e=m.defineComponent({__name:"AlphaSlider",props:{tinyColor:{},modelValue:{},value:{}},emits:_S,setup(n,{emit:e}){const t=SS(n,e),r=m.computed(()=>{const o=t.value.toRgb(),s=[o.r,o.g,o.b].join(",");return"linear-gradient(to right, rgba("+s+", 0) 0%, rgba("+s+", 1) 100%)"}),i=m.computed(()=>t.value.getAlpha());function a(o){t.value=t.value.setAlpha(o).clone()}return(o,s)=>(m.openBlock(),m.createBlock(WY,{class:"vc-alpha-slider",modelValue:i.value,max:1,"aria-label":"Transparency","onUpdate:modelValue":a},{background:m.withCtx(()=>[m.createVNode(ZM),m.createElementVNode("div",{class:"gradient",style:m.normalizeStyle({background:r.value})},null,4)]),_:1},8,["modelValue"]))}}),g4e=Id(v4e,[["__scopeId","data-v-07dd346b"]]),m4e={class:"vc-editable-input"},y4e=["value","aria-label"],b4e={key:0,class:"vc-input-desc","aria-hidden":"true"},x4e=m.defineComponent({__name:"EditableInput",props:{value:{},label:{},desc:{},max:{},min:{},step:{default:1},a11y:{}},emits:["change","blur"],setup(n,{emit:e}){const t=n,r=e,i=t.a11y?.label??t.label,a=`input__label__${i}__${Math.random().toString().slice(2,5)}`;function o(c){const{min:f,max:d}=t;if(XM(d)&&+c>d){r("change",d);return}if(XM(f)&&+c<f){r("change",f);return}r("change",c)}function s(c){o(c.target?.value)}function l(c){r("blur",c)}function u(c){let f=Number(t.value);if(!isNaN(f)){let d=t.step;const h=o4e(d),p=BO(c);p==="up"&&(o((f+d).toFixed(h)),c.preventDefault()),p==="down"&&(o((f-d).toFixed(h)),c.preventDefault())}}return(c,f)=>(m.openBlock(),m.createElementBlock("div",m4e,[m.createElementVNode("input",{class:"vc-input-input",value:t.value,onKeydown:u,onInput:s,onBlur:l,"aria-label":m.unref(i),id:a},null,40,y4e),m.createElementVNode("label",{for:a,class:"vc-input-label","aria-hidden":"true"},m.toDisplayString(t.label),1),c.desc?(m.openBlock(),m.createElementBlock("span",b4e,m.toDisplayString(c.desc),1)):m.createCommentVNode("",!0)]))}}),$o=Id(x4e,[["__scopeId","data-v-9c267b2b"]]),kz=n=>Qt(n).isValid(),_4e=n=>Qt(n).getAlpha()===0,qY=m.defineComponent({__name:"HexInput",props:{value:{},label:{},desc:{},a11y:{},type:{default:"hex"},withHash:{type:Boolean,default:!1}},emits:["change"],setup(n,{emit:e}){const t=n,r=e,i={label:t.type==="hex"?"Hex":"Hex with transparency",...t.a11y},a=(u,c="hex")=>{let f="";return c==="hex"&&(f=Qt(u).toHexString()),c==="hex8"&&(f=Qt(u).toHex8String()),t.withHash!==!0&&(f=f.replace("#","")),f},o=m.ref(a(t.value,t.type));m.watch(()=>t.value,u=>{Qt.equals(u,o.value)||(o.value=a(u,t.type))});const s=u=>{if(!u)return;o.value=u;let c=u.length;u[0]==="#"&&(c=c-1),!(t.type==="hex"&&c%3!==0&&c!==8)&&(t.type==="hex8"&&c!==8||kz(u)&&r("change",u))},l=()=>{let u=o.value.length;o.value[0]==="#"&&(u=u-1),!(kz(o.value)&&(t.type==="hex"&&u===6||t.type==="hex8"&&u===8))&&(o.value=a(t.value,t.type))};return(u,c)=>(m.openBlock(),m.createBlock($o,{label:t.label,a11y:i,value:o.value,onChange:s,onBlur:l},null,8,["label","value"]))}});function S4e(){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";return n.charAt(Math.floor(Math.random()*n.length))+n.charAt(Math.floor(Math.random()*n.length))}const KY=n=>{const e=m.ref(0),t=`__from__vc__hue__${S4e()}`;return m.watch(n,r=>{if(r[t])return;const i=r.toHsl().h;i===0&&e.value!==0||(e.value=i)},{immediate:!0}),{hueRef:e,updateHueRef:r=>{const i=Qt({...n.value.toHsl(),h:r});i[t]=!0,n.value=i,e.value=r}}},w4e={class:"title","aria-hidden":"true"},k4e={class:"body"},T4e={class:"saturation"},C4e={class:"hue"},E4e={class:"preview"},M4e={class:"preview-label","aria-hidden":"true"},A4e={class:"preview-swatches"},N4e=["aria-label"],D4e=["aria-label"],O4e={class:"preview-label","aria-hidden":"true"},I4e={key:0,class:"actions"},R4e=["aria-label"],L4e={class:"fields"},P4e=["aria-label"];_S.concat(["ok","cancel","reset"]);const B4e={class:"saturation"},V4e={class:"controls"},z4e={class:"sliders"},F4e={class:"hue"},$4e={key:0,class:"alpha"},H4e={class:"color"},G4e=["aria-label"],U4e={key:0,class:"field"},W4e={class:"field_double"},j4e={class:"field_single"},q4e={class:"field_single"},K4e={class:"field_single"},Y4e={key:0,class:"field_single"},X4e={class:"presets",role:"listbox","aria-label":"A color preset, pick one to set as current color"},Z4e=["onClick","title","aria-label","aria-selected","onKeydown"],J4e=["onClick","aria-selected","title","onKeydown"],Q4e=["#D0021B","#F5A623","#F8E71C","#8B572A","#7ED321","#417505","#BD10E0","#9013FE","#4A90E2","#50E3C2","#B8E986","#000000","#4A4A4A","#9B9B9B","#FFFFFF","rgba(0,0,0,0)"],e5e=m.defineComponent({__name:"SketchPicker",props:{presetColors:{default:()=>Q4e},disableAlpha:{type:Boolean,default:!1},disableFields:{type:Boolean,default:!1},tinyColor:{},modelValue:{},value:{}},emits:["change"].concat(_S),setup(n,{emit:e}){const t=n,r=SS(t,e),{hueRef:i,updateHueRef:a}=KY(r),o=m.computed(()=>Number(r.value.getAlpha().toFixed(2))),s=m.computed(()=>{let h;return o.value<1?h=r.value.toHex8String():h=r.value.toHexString(),h.replace("#","")}),l=m.computed(()=>r.value.toRgb()),u=h=>{r.value=h},c=(h,p)=>{if(!p||isNaN(Number(p)))return;const v={[h]:p};r.value={...l.value,...v}},f=h=>{!h||isNaN(Number(h))||(r.value=r.value.setAlpha(h).clone())},d=h=>{r.value=h};return(h,p)=>(m.openBlock(),m.createElementBlock("div",{role:"application","aria-label":"Sketch color picker",class:m.normalizeClass(["vc-sketch-picker",h.disableAlpha?"alpha-disabled":""])},[m.createElementVNode("div",B4e,[m.createVNode(UY,{hue:m.unref(i),tinyColor:m.unref(r),"onUpdate:tinyColor":p[0]||(p[0]=v=>m.isRef(r)?r.value=v:null)},null,8,["hue","tinyColor"])]),m.createElementVNode("div",V4e,[m.createElementVNode("div",z4e,[m.createElementVNode("div",F4e,[m.createVNode(jY,{modelValue:m.unref(i),"onUpdate:modelValue":m.unref(a)},null,8,["modelValue","onUpdate:modelValue"])]),h.disableAlpha?m.createCommentVNode("",!0):(m.openBlock(),m.createElementBlock("div",$4e,[m.createVNode(g4e,{tinyColor:m.unref(r),"onUpdate:tinyColor":p[1]||(p[1]=v=>m.isRef(r)?r.value=v:null)},null,8,["tinyColor"])]))]),m.createElementVNode("div",H4e,[m.createElementVNode("div",{"aria-label":`Current color is ${m.unref(r).toRgbString()}`,class:"active-color",style:m.normalizeStyle({background:m.unref(r).toRgbString()})},null,12,G4e),m.createVNode(ZM)])]),h.disableFields?m.createCommentVNode("",!0):(m.openBlock(),m.createElementBlock("div",U4e,[m.createElementVNode("div",W4e,[m.createVNode(qY,{label:"hex",value:s.value,onChange:u,type:o.value<1?"hex8":"hex"},null,8,["value","type"])]),m.createElementVNode("div",j4e,[m.createVNode($o,{label:"r",value:l.value.r,onChange:p[2]||(p[2]=v=>c("r",v)),a11y:{label:"Red"}},null,8,["value"])]),m.createElementVNode("div",q4e,[m.createVNode($o,{label:"g",value:l.value.g,onChange:p[3]||(p[3]=v=>c("g",v)),a11y:{label:"Green"}},null,8,["value"])]),m.createElementVNode("div",K4e,[m.createVNode($o,{label:"b",value:l.value.b,onChange:p[4]||(p[4]=v=>c("b",v)),a11y:{label:"Blue"}},null,8,["value"])]),h.disableAlpha?m.createCommentVNode("",!0):(m.openBlock(),m.createElementBlock("div",Y4e,[m.createVNode($o,{label:"a",value:o.value,step:.01,max:1,onChange:f,a11y:{label:"Transparency"}},null,8,["value"])]))])),m.createElementVNode("div",X4e,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(t.presetColors,v=>(m.openBlock(),m.createElementBlock(m.Fragment,null,[m.unref(_4e)(v)?(m.openBlock(),m.createElementBlock("div",{key:v,class:"preset-color",onClick:g=>d(v),"aria-label":"Color: transparency","aria-selected":o.value===0,role:"option",tabindex:"0",title:v,onKeydown:m.withKeys(g=>d(v),["space"])},[m.createVNode(ZM)],40,J4e)):(m.openBlock(),m.createElementBlock("div",{class:"preset-color",key:v+"-color",style:m.normalizeStyle({background:v}),onClick:g=>d(v),title:v,"aria-label":"Color:"+v,"aria-selected":`#${s.value.toLowerCase()}`===v.toLowerCase(),role:"option",tabindex:"0",onKeydown:m.withKeys(g=>d(v),["space"])},null,44,Z4e))],64))),256))])],2))}}),VO=Id(e5e,[["__scopeId","data-v-fdb7d989"]]),Tz=m.defineComponent({__name:"color",props:{text:{type:String,default:""},defaultColor:{type:String,default:"#000"}},setup(n){const e=n,t=m.inject("editor"),r=m.ref(!1),i=m.ref(e.defaultColor),a=s=>{i.value=s,r.value=!1,s===""?t.value?.chain().focus().unsetColor().run():t.value?.chain().focus().setColor(s).run()},o=aA(s=>{i.value=s,s===""?t.value?.chain().focus().unsetColor().run():t.value?.chain().focus().setColor(s).run()},200);return m.watch(()=>i.value,s=>{o(s)}),(s,l)=>(m.openBlock(),m.createBlock(il,{ico:"text-editor",text:"文字颜色","hide-text":"","popup-visible":r.value,"onUpdate:popupVisible":l[1]||(l[1]=u=>r.value=u),"popup-type":"arrow",onMenuClick:l[2]||(l[2]=u=>m.unref(t)?.isEditable===!1?()=>{}:a(i.value))},{content:m.withCtx(()=>[m.createVNode(m.unref(VO),{modelValue:i.value,"onUpdate:modelValue":l[0]||(l[0]=u=>i.value=u)},null,8,["modelValue"])]),default:m.withCtx(()=>[m.createElementVNode("div",{class:"w-[14px] h-[2px] mx-auto",style:m.normalizeStyle({backgroundColor:i.value})},null,4)]),_:1},8,["popup-visible"]))}}),Cz=m.defineComponent({__name:"background-color",props:{text:{type:String,default:""},defaultColor:{type:String,default:"#007bff"}},setup(n){const e=n,t=m.inject("editor"),r=m.ref(!1),i=m.ref(e.defaultColor),a=s=>{i.value=s,r.value=!1,s===""?t.value?.chain().focus().unsetHighlight().run():t.value?.chain().focus().setHighlight({color:s}).run()},o=aA(s=>{i.value=s,s===""?t.value?.chain().focus().unsetHighlight().run():t.value?.chain().focus().setHighlight({color:s}).run()},200);return m.watch(()=>i.value,s=>{o(s)}),(s,l)=>(m.openBlock(),m.createBlock(il,{ico:"fill",text:"背景颜色","hide-text":"","popup-visible":r.value,"onUpdate:popupVisible":l[1]||(l[1]=u=>r.value=u),"popup-type":"arrow",onMenuClick:l[2]||(l[2]=u=>m.unref(t)?.isEditable===!1?()=>{}:a(i.value))},{content:m.withCtx(()=>[m.createVNode(m.unref(VO),{modelValue:i.value,"onUpdate:modelValue":l[0]||(l[0]=u=>i.value=u)},null,8,["modelValue"])]),default:m.withCtx(()=>[m.createElementVNode("div",{class:"w-[14px] h-[2px] mx-auto",style:m.normalizeStyle({backgroundColor:m.unref(t)?.getAttributes("highlight")?.color||i.value})},null,4)]),_:1},8,["popup-visible"]))}});var YY=(n=>(n.C="C",n.X="X",n.Z="Z",n.Y="Y",n.A="A",n.G="G",n.L="L",n.F="F",n.D="D",n.B="B",n.P="P",n.O="O",n.R="R",n.T="T",n.MINUS="-",n.EQUAL="=",n.DIGIT_0="0",n.DELETE="DELETE",n.UP="ARROWUP",n.DOWN="ARROWDOWN",n.LEFT="ARROWLEFT",n.RIGHT="ARROWRIGHT",n.ENTER="ENTER",n.SPACE=" ",n.TAB="TAB",n.BACKSPACE="BACKSPACE",n.ESC="ESCAPE",n.PAGEUP="PAGEUP",n.PAGEDOWN="PAGEDOWN",n.F5="F5",n))(YY||{});const Fm=[{label:"默认",value:"14px",order:4},{label:"初号",value:"42pt",order:20},{label:"小初",value:"36pt",order:19},{label:"一号",value:"26pt",order:16},{label:"小一",value:"24pt",order:15},{label:"二号",value:"22pt",order:14},{label:"小二",value:"18pt",order:11},{label:"三号",value:"16pt",order:10},{label:"小三",value:"15pt",order:9},{label:"四号",value:"14pt",order:7},{label:"小四",value:"12pt",order:4},{label:"五号",value:"10.5pt",order:1},{label:"小五",value:"9pt",order:1},{label:"六号",value:"8pt",order:1},{label:"小六",value:"7.5pt",order:1},{label:"10",value:"10px",order:1},{label:"11",value:"11px",order:2},{label:"12",value:"12px",order:3},{label:"16",value:"16px",order:5},{label:"18",value:"18px",order:6},{label:"20",value:"20px",order:8},{label:"22",value:"22px",order:10},{label:"24",value:"24px",order:11},{label:"26",value:"26px",order:12},{label:"28",value:"28px",order:13},{label:"32",value:"32px",order:15},{label:"36",value:"36px",order:17},{label:"42",value:"42px",order:18},{label:"48",value:"48px",order:19},{label:"72",value:"72px",order:21},{label:"96",value:"96px",order:22}],JM=[{label:"正文",value:"paragraph",element:"p"},{label:"标题1",value:"1",element:"h1"},{label:"标题2",value:"2",element:"h2"},{label:"标题3",value:"3",element:"h3"},{label:"标题4",value:"4",element:"h4"},{label:"标题5",value:"5",element:"h5"},{label:"标题6",value:"6",element:"h6"}],Ez={bar:{labels:["类别1","类别2","类别3","类别4","类别5"],legends:["系列1","系列2"],series:[[12,19,5,2,18],[7,11,13,21,9]]},column:{labels:["类别1","类别2","类别3","类别4","类别5"],legends:["系列1","系列2"],series:[[12,19,5,2,18],[7,11,13,21,9]]},line:{labels:["类别1","类别2","类别3","类别4","类别5"],legends:["系列1","系列2"],series:[[12,19,5,2,18],[7,11,13,21,9]]},smooth:{labels:["类别1","类别2","类别3","类别4","类别5"],legends:["系列1","系列2"],series:[[12,19,5,2,18],[7,11,13,21,9]]},pie:{labels:["类别1","类别2","类别3","类别4","类别5"],legends:["值"],series:[[12,19,5,2,18]]},ring:{labels:["类别1","类别2","类别3","类别4","类别5"],legends:["值"],series:[[12,19,5,2,18]]},area:{labels:["类别1","类别2","类别3","类别4","类别5"],legends:["系列1","系列2"],series:[[12,19,5,2,18],[7,11,13,21,9]]},radar:{labels:["类别1","类别2","类别3","类别4","类别5"],legends:["系列1","系列2"],series:[[12,19,5,2,18],[7,11,13,21,9]]},scatter:{labels:["坐标1","坐标2","坐标3","坐标4","坐标5"],legends:["X","Y"],series:[[12,19,5,2,18],[7,11,13,21,9]]}},t5e=[{label:"网页",layout:"web"},{label:"A4",width:21,height:29.7,default:!0,layout:"page"},{label:"A3",width:29.7,height:42,layout:"page"},{label:"A5",width:14.8,height:21,layout:"page"},{label:"B5",width:17.6,height:25,layout:"page"},{label:"5号信纸",width:10.9,height:12.9,layout:"page"},{label:"6号信纸",width:11.9,height:22.9,layout:"page"},{label:"7号信纸",width:16.1,height:22.8,layout:"page"},{label:"9号信纸",width:22.8,height:32.3,layout:"page"},{label:"法律用纸",width:21.5,height:33.5,layout:"page"}],Mz=[{label:"默认",value:"decimal",code:`<path d="M35 29a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17z" fill-opacity=".163"></path>
274
+ `),u=iPe(l);s.querySelectorAll("td, th").forEach(h=>{const p=u[h.getAttribute("class")];p?.background&&(h.style.background=p.background),p?.color&&(h.style.color=p.color),p?.["text-align"]&&h.setAttribute("align",p["text-align"])});const{schema:c}=n.state,f=Ol.fromSchema(c).parse(s),d=n.state.tr.replaceSelectionWith(f);return n.dispatch(d),!0}}})]}}),oPe=aPe.configure({allowTableNodeSelection:!0,resizable:!0}),sPe=yi.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:n=>{const e=n.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:n}){return["td",Jn(this.options.HTMLAttributes,n),0]}}),VY={addAttributes(){return{...this.parent?.(),align:{default:null,parseHTML:n=>n.getAttribute("align")??null,renderHTML:({align:n})=>({align:n})},background:{default:null,parseHTML:n=>{const t=(n.getAttribute("style")??"").match(/background(?:-color)?:\s*([^;]+)/i);return t?t[1].trim():null},renderHTML:({background:n})=>n?{style:`background-color: ${n}`}:{}},color:{default:null,parseHTML:n=>{const e=n.getAttribute("style")??"",t=e.match(new RegExp("(?<!background-)color:\\s*([^;]+)","i"));return e.includes("background-color")?null:t?t[1].trim():null},renderHTML:({color:n})=>n?{style:`color: ${n}`}:{}}}}},lPe=sPe.extend(VY),uPe=yi.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:n=>{const e=n.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:n}){return["th",Jn(this.options.HTMLAttributes,n),0]}}),cPe=uPe.extend(VY),fPe=["textContent"],dPe=m.defineComponent({__name:"node-view",props:Ql,setup(n){const e=m.inject("options"),t=m.inject("editor");return(r,i)=>(m.openBlock(),m.createBlock(m.unref(Jl),{as:"span",class:"inline-block mx-[0.3rem] !bg-transparent"},{default:m.withCtx(()=>[m.createElementVNode("span",{class:"rounded-[0.2em] px-[0.4em] py-[0.15em] inline-block mx-[0.2em] text-sm font-[500] border-[#0000000d] box-border",style:m.normalizeStyle({color:r.node.attrs.color,backgroundColor:r.node.attrs.backgroundColor,cursor:!m.unref(e).document?.readOnly||m.unref(t).isEditable?"pointer":"default"}),textContent:m.toDisplayString(r.node.attrs.text)},null,12,fPe)]),_:1}))}}),hPe=yi.create({name:"tag",group:"inline",inline:!0,atom:!0,addAttributes(){return{type:{default:"default"},text:{default:"默认标签"},color:{default:"#999"},backgroundColor:{default:"rgba(0, 0, 0, 0.05)"}}},parseHTML(){return[{tag:'span[data-type="tag"]'}]},renderHTML({HTMLAttributes:n}){return["span",Jn(n,{"data-type":"tag"}),n.text]},addNodeView(){return tl(dPe)},addCommands(){return{insertTag:n=>({chain:e})=>e().insertContent({type:this.name,attrs:n}).run()}}}),pPe=fr.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:n=>{const e=n.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:n=>n.textAlign?{style:`text-align: ${n.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:n=>({commands:e})=>this.options.alignments.includes(n)?this.options.types.map(t=>e.updateAttributes(t,{textAlign:n})).every(t=>t):!1,unsetTextAlign:()=>({commands:n})=>this.options.types.map(e=>n.resetAttributes(e,"textAlign")).every(e=>e)}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),vPe=pPe.extend({addOptions(){return{...this.parent?.(),types:["heading","paragraph"],alignments:["left","center","right","justify","distributed"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:n=>n.style.textAlignLast?"distributed":n.style.textAlign||this.options.defaultAlignment,renderHTML:n=>n.textAlign===this.options.defaultAlignment?{}:n.textAlign==="distributed"?{style:"text-align-last: justify"}:{style:`text-align: ${n.textAlign}`}}}}]},addKeyboardShortcuts(){return{...this.parent?.(),"Mod-Shift-d":()=>this.editor.commands.setTextAlign("distributed")}}}),sa=m.ref({isRunning:!1,currentParagraph:0,currentTextNode:0,currentChar:0});let cf=null,jv={totalChars:0,typedChars:0};function gPe(n){return n.reduce((e,t)=>t.type==="paragraph"&&t.content?t.content.reduce((r,i)=>r+(i.type==="text"?i.text?.length??0:0),e):e,0)}const mPe=fr.create({name:"typewriter",addCommands(){return{startTypewriter:(n,e)=>({editor:t})=>((async()=>{try{cf&&(clearTimeout(cf),cf=null),sa.value={isRunning:!0,currentParagraph:0,currentTextNode:0,currentChar:0},jv={totalChars:gPe(n?.content??[]),typedChars:0};const r=e?.focus===null?null:e?.focus??"end",i=async u=>{await new Promise(c=>{setTimeout(()=>{try{t.chain().insertContent(u).focus(r).run()}catch(f){console.error("插入内容时出错:",f)}c()},0)})},a=Math.max(e?.speed??1,0),o=u=>u?.type==="paragraph"&&(!u.content||u.content.length===0||u.content.length===1&&u.content[0].type==="text"&&!u.content[0].text),s=async(u,c,f,d=!1)=>{let h=0;if(u.type==="paragraph")if(o(u)){const p=[u];for(let v=c+1;v<f.length&&o(f[v]);v++)p.push(f[v]),h++,sa.value.currentParagraph++;await i(p),sa.value.currentParagraph++}else{if(await i([{type:"paragraph",attrs:u.attrs}]),u.content&&u.content.length>0)for(let p=0;p<u.content.length;p++){sa.value.currentTextNode=p;const v=u.content[p],g=await s(v,p,u.content,!1);p=p+(g??0)}else t.commands.enter();sa.value.currentParagraph++}else if(u.type==="text"){const p=u.text??"",v=u.marks??[],g=e?.step??1;for(let y=0;y<p.length;y+=g){if(!sa.value.isRunning)return;const b=Math.min(y+g,p.length),_=p.slice(y,b);await new Promise(x=>{cf=setTimeout(async()=>{await i([{type:"text",text:_,marks:v}]),sa.value.currentChar=y+_.length-1,jv.typedChars+=_.length,e?.onProgress&&jv.totalChars>0&&e.onProgress(jv.typedChars/jv.totalChars),x()},a)})}}else if(u.type==="table"){const p=[u];for(let v=c+1;v<f.length&&o(f[v]);v++)p.push(f[v]),h++;p.length===1&&p.push({type:"paragraph"}),await i(p),t.commands.enter()}else d?await i([u,{type:"paragraph"}]):await i([u]);return h},l=n?.content??[];for(let u=0;u<l.length&&sa.value.isRunning;u++){const c=await s(l[u],u,l,!0);u=u+(c??0)}sa.value.isRunning&&e?.onComplete&&e.onComplete(),sa.value.isRunning=!1}catch(r){console.error("类型写入器出错:",r)}})(),!0),stopTypewriter:()=>()=>(sa.value.isRunning=!1,cf&&(clearTimeout(cf),cf=null),!0),getTypewriterState:()=>({isRunning:sa.value.isRunning,currentParagraph:sa.value.currentParagraph,currentTextNode:sa.value.currentTextNode,currentChar:sa.value.currentChar})}}}),yPe={class:"max-w-full node-view-video white-view-node"},bPe=["src"],xPe={key:0,class:"uploading absolute top-0 right-0 left-0 h-[2px] bg-[#007bff]"},_Pe=m.defineComponent({__name:"node-view",props:Ql,setup(n){const e=m.inject("options"),t=m.inject("editor"),r=m.inject("uploadFileMap"),i=m.ref(null),a=m.ref(!1),o=m.ref(null),s=m.ref(0),l=m.ref(0),u=m.computed(()=>{const{nodeAlign:h,margin:p}=n.node.attrs,v=p?.top&&p?.top!==""?`${p.top}px`:void 0,g=p?.bottom&&p?.bottom!==""?`${p.bottom}px`:void 0;return{"justify-content":h,marginTop:v,marginBottom:g}}),c=()=>{t.value?.chain().focus().setNodeSelection(n.getPos()).run(),a.value=!0};m.onMounted(async()=>{if(await m.nextTick(),!(n.node.attrs.uploaded||!n.node.attrs.id)&&r.value.has(n.node.attrs.id))try{const h=r.value.get(n.node.attrs.id),{id:p,url:v}=await e.value?.onFileUpload?.(h)??{};i.value&&Ef(t.value,{id:p,src:v,uploaded:!0},n.getPos()),r.value.delete(n.node.attrs.id)}catch(h){console.error(h)}});const f=()=>{if(n.node.attrs.width===null){const{clientWidth:h=0,clientHeight:p=0}=o.value??{};s.value=i.value?.$el.clientWidth??0;const v=h/p;l.value=i.value?.$el.clientWidth/v,n.updateAttributes({width:(200*v).toFixed(2)}),setTimeout(()=>{n.updateAttributes({height:i.value?.$el.clientHeight})},200)}},d=({width:h,height:p})=>{n.updateAttributes({width:h,height:p})};return T_(i,()=>{a.value=!1}),(h,p)=>(m.openBlock(),m.createBlock(m.unref(Jl),{id:h.node.attrs.id,ref_key:"containerRef",ref:i,class:"white-video-wrapper flex max-h-full relative",style:m.normalizeStyle(u.value)},{default:m.withCtx(()=>[m.createElementVNode("div",yPe,[m.createVNode(m.unref(Ap),{selected:a.value,rotatable:!1,boundary:!1,width:Number(h.node.attrs.width),height:Number(h.node.attrs.height),"min-width":300,"min-height":200,"max-width":s.value,"max-height":l.value,"equal-proportion":!0,disabled:m.unref(e).editor?.readOnly,onResize:d,onFocus:c},{default:m.withCtx(()=>[m.createElementVNode("video",{ref_key:"videoRef",ref:o,src:h.node.attrs.src,preload:"metadata",crossorigin:"anonymous",controls:"",onCanplay:f,onClick:c},null,40,bPe),!h.node.attrs.uploaded&&h.node.attrs.id!==null?(m.openBlock(),m.createElementBlock("div",xPe)):m.createCommentVNode("",!0)]),_:1},8,["selected","width","height","max-width","max-height","disabled"])])]),_:1},8,["id","style"]))}}),SPe=yi.create({name:"video",group:"block",atom:!0,addAttributes(){return{vnode:{default:!0},file:{default:null},id:{default:null},name:{default:null},size:{default:null},src:{default:null},width:{default:null},height:{default:200},draggable:{default:!1},uploaded:{default:!1},previewType:{default:"video"}}},parseHTML(){return[{tag:"video"}]},renderHTML({HTMLAttributes:n}){return["video",Jn(n)]},addNodeView(){return tl(_Pe)},addCommands(){return{setVideo:n=>({commands:e,editor:t})=>e.insertContentAt(t.state.selection.anchor,{type:this.name,attrs:n})}}}),wPe=({container:n,options:e,uploadFileMap:t})=>{const{document:r,users:i,file:a,disableExtensions:o}=e.value,s={highlight:Wae.configure({multicolor:!0}),"ordered-list":ZLe,"bullet-list":Ice,"line-height":fLe.configure({types:["heading","paragraph"],defaultLineHeight:1.7}),margin:LLe,link:MY,image:yY,inlineImage:uLe,video:SPe,audio:oce,"code-block":The,tag:hPe,columns:Nce,mention:HLe.configure({suggestion:qLe(i??[],n.value)}),"date-time":Mhe,hr:KRe,"web-page":QRe,TaskList:Moe.configure({HTMLAttributes:{class:"white-task-list"}}),TaskItem:Noe.configure({nested:!0})},l=[qle.configure({bold:!1,bulletList:!1,orderedList:!1,codeBlock:!1,horizontalRule:!1,dropcursor:!1,history:!1}),toe.configure({placeholder:()=>"输入内容..."}),eoe.extend({addKeyboardShortcuts(){return{}}}),$ae.configure({className:"white-node-focused",mode:"all"}),jRe,Hae,WRe,Rae.extend({renderHTML:({HTMLAttributes:u})=>["b",u,0]}),Eoe,noe,roe,Vae,Bae,cLe,vPe,KLe,tce,oPe,ioe,cPe,lPe,HRe,JLe,nue.configure({scrollParent:()=>document.getElementById(`${n.value}`),getId:()=>ip()}),PF.configure(r?.typographyRules),Lae.configure({limit:r?.characterLimit!==0?r?.characterLimit:void 0}),URe.configure({allowedMimeTypes:a?.allowedMimeTypes,onPaste:async(u,c)=>{for(const f of c){const d=await vue(f);u.commands.insertFile({file:f,uploadFileMap:t.value,autoType:!0,fileDim:d})}},onDrop:(u,c,f)=>{for(const d of c)u.commands.insertFile({file:d,uploadFileMap:t.value,autoType:!0,pos:f})}}),Fae.configure({color:"#007bff"}),mPe];return Object.values(s).forEach(u=>{if(!o?.includes(u.name)){if(Array.isArray(u)){l.push(...u);return}l.push(u)}}),l},gz=n=>{let e=!0;return n.value.editor?.enableMarkdown||(e=[PF,yY]),e},kPe=m.defineComponent({__name:"ScrollAble",setup(n,{expose:e}){const t=m.ref(null),r=m.ref(null),i=m.ref(!0),a=m.ref(!0),o=()=>{const{scrollLeft:c=0,scrollWidth:f=0,clientWidth:d=0}=r.value??{};i.value=c===0,a.value=c+d+10>=f},s=()=>{(r.value?.scrollLeft||r.value?.scrollLeft===0)&&(r.value.scrollLeft-=r.value.offsetWidth-10||100)},l=()=>{(r.value?.scrollLeft||r.value?.scrollLeft===0)&&(r.value.scrollLeft+=r.value.offsetWidth-10||100)};return que(t,()=>{o()}),m.onMounted(()=>{r.value?.addEventListener("scroll",o)}),e({update:()=>{r.value&&(r.value.scrollLeft=0),a.value=!0,o()}}),(c,f)=>(m.openBlock(),m.createElementBlock("div",{ref_key:"wraperRef",ref:t,class:m.normalizeClass(["white-scrollable-container flex items-center",{"!pl-[36px]":!i.value,"!pr-[36px]":!a.value}])},[i.value?m.createCommentVNode("",!0):(m.openBlock(),m.createElementBlock("div",{key:0,class:"w-scrollable-control scrollable-left",onClick:s},[...f[0]||(f[0]=[m.createElementVNode("i",{class:"w-iconfont icon-left"},null,-1)])])),m.createElementVNode("div",{ref_key:"contentRef",ref:r,class:"w-scrollable-content text-center flex items-center"},[m.renderSlot(c.$slots,"default")],512),a.value?m.createCommentVNode("",!0):(m.openBlock(),m.createElementBlock("div",{key:1,class:"w-scrollable-control scrollable-right",onClick:l},[...f[1]||(f[1]=[m.createElementVNode("i",{class:"w-iconfont icon-right"},null,-1)])]))],2))}}),TPe={class:"w-[28px] h-[28px] cursor-pointer flex items-center justify-center gap-[0.4rem] text-[12px] rounded-[4px] hover:text-[#007aff] hover:bg-[#edeef2]"},CPe=m.defineComponent({__name:"tool-column",setup(n){const e=m.inject("page"),t=m.ref(!1),r=i=>{e.value.toolbar=i,t.value=!1};return(i,a)=>(m.openBlock(),m.createBlock(js,{trigger:"click",placement:"bottom",value:t.value,"onUpdate:value":a[2]||(a[2]=o=>t.value=o),contentStyle:{padding:"6px 0",boxShadow:"0 6px 16px 0 rgba(0, 0, 0, 0.08)"}},{content:m.withCtx(()=>[m.createElementVNode("div",{class:m.normalizeClass(["px-[12px] py-[5px] flex items-center gap-[0.4rem] cursor-pointer hover:bg-[rgb(242,243,245)]",m.unref(e).toolbar==="single"?"text-[#007aff]":""]),onClick:a[0]||(a[0]=o=>r("single"))},[...a[3]||(a[3]=[m.createElementVNode("i",{class:"w-iconfont icon-single"},null,-1),m.createTextVNode(" 单行工具栏 ",-1)])],2),m.createElementVNode("div",{class:m.normalizeClass(["px-[12px] py-[5px] flex items-center gap-[0.4rem] cursor-pointer hover:bg-[rgb(242,243,245)]",m.unref(e).toolbar==="double"?"text-[#007aff]":""]),onClick:a[1]||(a[1]=o=>r("double"))},[...a[4]||(a[4]=[m.createElementVNode("i",{class:"w-iconfont icon-double"},null,-1),m.createTextVNode(" 双行工具栏 ",-1)])],2)]),default:m.withCtx(()=>[m.createElementVNode("span",TPe,[m.createElementVNode("i",{class:m.normalizeClass(["w-iconfont icon-bottom !text-[13px] transition-transform duration-200",t.value?"rotate-180":""])},null,2)])]),_:1},8,["value"]))}}),EPe=["disabled"],MPe={key:0,class:"text-[12px] mt-2"},An=m.defineComponent({__name:"MenusButton",props:{ico:{default:""},text:{default:""},hideText:{type:Boolean,default:!1},forceEnabled:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},shortcut:{default:void 0},shortcutText:{default:void 0},menuActive:{type:Boolean,default:!1}},setup(n){const e=m.useAttrs(),t=m.inject("editor"),r=(...i)=>{e.onMenuClickThrough?e.onMenuClickThrough(...i):e.onMenuClick&&e.onMenuClick(...i)};return(i,a)=>{const o=m.resolveDirective("tooltip");return m.withDirectives((m.openBlock(),m.createElementBlock("button",m.mergeProps({class:["white-editor-tool-item",{"is-show-text":!n.hideText,"is-active":n.menuActive&&m.unref(t)?.isEditable!==!1,"is-disabled":!n.forceEnabled&&(n.disabled||m.unref(t)?.isEditable===!1)}],disabled:!n.forceEnabled&&(n.disabled||m.unref(t)?.isEditable===!1)},m.unref(e),{onClick:r}),[m.createElementVNode("i",{class:m.normalizeClass(["w-iconfont w-icon",`icon-${n.ico}`])},null,2),n.hideText?m.createCommentVNode("",!0):(m.openBlock(),m.createElementBlock("p",MPe,m.toDisplayString(n.text),1))],16,EPe)),[[o,`${n.text}`]])}}}),WM=m.defineComponent({__name:"bold",setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createBlock(An,{ico:"bold",text:"加粗",shortcut:"Ctrl+B","hide-text":"","menu-active":m.unref(e)?.isActive("bold"),disabled:!m.unref(e)?.can().chain().focus().toggleBold().run(),onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.chain().focus().toggleBold().run())},null,8,["menu-active","disabled"]))}}),jM=m.defineComponent({__name:"underline",setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createBlock(An,{ico:"underline",text:"下划线",shortcut:"Ctrl+U","hide-text":"","menu-active":m.unref(e)?.isActive("underline"),disabled:!m.unref(e)?.can().chain().focus().toggleUnderline().run(),onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.chain().focus().toggleUnderline().run())},null,8,["menu-active","disabled"]))}}),qM=m.defineComponent({__name:"decoration",setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createBlock(An,{ico:"decoration",text:"删除线",shortcut:"Ctrl+Shift+X","hide-text":"","menu-active":m.unref(e)?.isActive("strike"),disabled:!m.unref(e)?.can().chain().focus().toggleStrike().run(),onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.chain().focus().toggleStrike().run())},null,8,["menu-active","disabled"]))}}),KM=m.defineComponent({__name:"italic",setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createBlock(An,{ico:"italic",text:"斜体",shortcut:"Ctrl+I","hide-text":"","menu-active":m.unref(e)?.isActive("italic"),disabled:!m.unref(e)?.can().chain().focus().toggleItalic().run(),onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.chain().focus().toggleItalic().run())},null,8,["menu-active","disabled"]))}}),APe=["disabled"],NPe={key:0,class:"text-[13px] text-[#333639] ml-[3px]"},DPe={class:"flex items-center justify-center w-full h-full"},OPe=["disabled"],IPe={class:"h-full gap-[5px]"},RPe={key:0,class:"text-[12px] mt-2"},il=m.defineComponent({__name:"MenusPopup",props:{ico:{default:""},icoSize:{default:14},text:{default:""},hideText:{type:Boolean,default:!1},popupVisible:{type:Boolean,default:!1},forceEnabled:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},shortcut:{default:void 0},shortcutText:{default:void 0},menuActive:{type:Boolean,default:!1},popupType:{default:"arrow"},placement:{default:"bottom"},trigger:{default:"click"}},emits:["update:popupVisible"],setup(n,{emit:e}){const t=m.useAttrs(),r=m.inject("editor"),i=n,a=e,o=m.computed({get:()=>i.popupVisible,set:l=>a("update:popupVisible",l)}),s=(...l)=>{t.onMenuClickThrough?t.onMenuClickThrough(...l):t.onMenuClick&&t.onMenuClick(...l)};return(l,u)=>{const c=m.resolveDirective("tooltip");return m.openBlock(),m.createElementBlock(m.Fragment,null,[n.popupType==="arrow"?m.withDirectives((m.openBlock(),m.createElementBlock("button",m.mergeProps({key:0,class:["white-editor-tool-item white-editor-tool-pop-item flex items-center justify-center",{"is-show-text":!n.hideText,"is-active":n.menuActive&&m.unref(r)?.isEditable!==!1,"is-disabled":!n.forceEnabled&&(n.disabled||m.unref(r)?.isEditable===!1)}],disabled:!n.forceEnabled&&(n.disabled||m.unref(r)?.isEditable===!1)},m.unref(t)),[m.createElementVNode("div",{class:"flex items-center h-full",onClick:s},[m.createElementVNode("div",null,[m.createElementVNode("i",{class:m.normalizeClass(["w-iconfont w-icon",`icon-${n.ico}`]),style:m.normalizeStyle(n.hideText?`font-size: ${n.icoSize}px`:"")},null,6),m.renderSlot(l.$slots,"default")]),n.hideText?m.createCommentVNode("",!0):(m.openBlock(),m.createElementBlock("p",NPe,m.toDisplayString(n.text),1))]),m.createVNode(js,{trigger:n.trigger,value:o.value,"onUpdate:value":u[0]||(u[0]=f=>o.value=f),placement:n.placement,disabled:!n.forceEnabled&&(n.disabled||m.unref(r)?.isEditable===!1),hasClass:"flex items-center justify-center w-[13px] h-full hover:bg-[#d7d3d3] mr-[-6px] ml-[4px] w-arrow"},{content:m.withCtx(()=>[m.renderSlot(l.$slots,"content")]),default:m.withCtx(()=>[m.createElementVNode("span",DPe,[m.createElementVNode("i",{class:m.normalizeClass(["w-iconfont icon-bottom !text-[8px] transition-transform duration-200",o.value?"rotate-180":""])},null,2)])]),_:3},8,["trigger","value","placement","disabled"])],16,APe)),[[c,`${n.text}`]]):m.createCommentVNode("",!0),n.popupType==="select"?(m.openBlock(),m.createBlock(js,{key:1,trigger:n.trigger,value:o.value,"onUpdate:value":u[1]||(u[1]=f=>o.value=f),placement:n.placement},{content:m.withCtx(()=>[m.renderSlot(l.$slots,"content")]),default:m.withCtx(()=>[m.renderSlot(l.$slots,"default",{},()=>[m.withDirectives((m.openBlock(),m.createElementBlock("button",m.mergeProps({class:["white-editor-tool-item white-editor-tool-pop-item flex items-center justify-center",{"is-show-text":!n.hideText,"is-active":n.menuActive&&m.unref(r)?.isEditable!==!1,"is-disabled":!n.forceEnabled&&(n.disabled||m.unref(r)?.isEditable===!1)}],disabled:!n.forceEnabled&&(n.disabled||m.unref(r)?.isEditable===!1)},m.unref(t)),[m.createElementVNode("div",IPe,[m.createElementVNode("i",{class:m.normalizeClass(["w-iconfont w-icon",`icon-${n.ico}`]),style:m.normalizeStyle(n.hideText?`font-size: ${n.icoSize}px`:"")},null,6),n.hideText?m.createCommentVNode("",!0):(m.openBlock(),m.createElementBlock("p",RPe,m.toDisplayString(n.text),1))])],16,OPe)),[[c,`${n.text}`]])])]),_:3},8,["trigger","value","placement"])):m.createCommentVNode("",!0)],64)}}});function t_(n){"@babel/helpers - typeof";return t_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t_(n)}var LPe=/^\s+/,PPe=/\s+$/;function Qt(n,e){if(n=n||"",e=e||{},n instanceof Qt)return n;if(!(this instanceof Qt))return new Qt(n,e);var t=BPe(n);this._originalInput=n,this._r=t.r,this._g=t.g,this._b=t.b,this._a=t.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||t.format,this._gradientType=e.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._ok=t.ok}Qt.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var n=this.toRgb();return(n.r*299+n.g*587+n.b*114)/1e3},getLuminance:function(){var n=this.toRgb(),e,t,r,i,a,o;return e=n.r/255,t=n.g/255,r=n.b/255,e<=.03928?i=e/12.92:i=Math.pow((e+.055)/1.055,2.4),t<=.03928?a=t/12.92:a=Math.pow((t+.055)/1.055,2.4),r<=.03928?o=r/12.92:o=Math.pow((r+.055)/1.055,2.4),.2126*i+.7152*a+.0722*o},setAlpha:function(n){return this._a=zY(n),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var n=yz(this._r,this._g,this._b);return{h:n.h*360,s:n.s,v:n.v,a:this._a}},toHsvString:function(){var n=yz(this._r,this._g,this._b),e=Math.round(n.h*360),t=Math.round(n.s*100),r=Math.round(n.v*100);return this._a==1?"hsv("+e+", "+t+"%, "+r+"%)":"hsva("+e+", "+t+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var n=mz(this._r,this._g,this._b);return{h:n.h*360,s:n.s,l:n.l,a:this._a}},toHslString:function(){var n=mz(this._r,this._g,this._b),e=Math.round(n.h*360),t=Math.round(n.s*100),r=Math.round(n.l*100);return this._a==1?"hsl("+e+", "+t+"%, "+r+"%)":"hsla("+e+", "+t+"%, "+r+"%, "+this._roundA+")"},toHex:function(n){return bz(this._r,this._g,this._b,n)},toHexString:function(n){return"#"+this.toHex(n)},toHex8:function(n){return $Pe(this._r,this._g,this._b,this._a,n)},toHex8String:function(n){return"#"+this.toHex8(n)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(Ar(this._r,255)*100)+"%",g:Math.round(Ar(this._g,255)*100)+"%",b:Math.round(Ar(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(Ar(this._r,255)*100)+"%, "+Math.round(Ar(this._g,255)*100)+"%, "+Math.round(Ar(this._b,255)*100)+"%)":"rgba("+Math.round(Ar(this._r,255)*100)+"%, "+Math.round(Ar(this._g,255)*100)+"%, "+Math.round(Ar(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:QPe[bz(this._r,this._g,this._b,!0)]||!1},toFilter:function(n){var e="#"+xz(this._r,this._g,this._b,this._a),t=e,r=this._gradientType?"GradientType = 1, ":"";if(n){var i=Qt(n);t="#"+xz(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+e+",endColorstr="+t+")"},toString:function(n){var e=!!n;n=n||this._format;var t=!1,r=this._a<1&&this._a>=0,i=!e&&r&&(n==="hex"||n==="hex6"||n==="hex3"||n==="hex4"||n==="hex8"||n==="name");return i?n==="name"&&this._a===0?this.toName():this.toRgbString():(n==="rgb"&&(t=this.toRgbString()),n==="prgb"&&(t=this.toPercentageRgbString()),(n==="hex"||n==="hex6")&&(t=this.toHexString()),n==="hex3"&&(t=this.toHexString(!0)),n==="hex4"&&(t=this.toHex8String(!0)),n==="hex8"&&(t=this.toHex8String()),n==="name"&&(t=this.toName()),n==="hsl"&&(t=this.toHslString()),n==="hsv"&&(t=this.toHsvString()),t||this.toHexString())},clone:function(){return Qt(this.toString())},_applyModification:function(n,e){var t=n.apply(null,[this].concat([].slice.call(e)));return this._r=t._r,this._g=t._g,this._b=t._b,this.setAlpha(t._a),this},lighten:function(){return this._applyModification(WPe,arguments)},brighten:function(){return this._applyModification(jPe,arguments)},darken:function(){return this._applyModification(qPe,arguments)},desaturate:function(){return this._applyModification(HPe,arguments)},saturate:function(){return this._applyModification(GPe,arguments)},greyscale:function(){return this._applyModification(UPe,arguments)},spin:function(){return this._applyModification(KPe,arguments)},_applyCombination:function(n,e){return n.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(ZPe,arguments)},complement:function(){return this._applyCombination(YPe,arguments)},monochromatic:function(){return this._applyCombination(JPe,arguments)},splitcomplement:function(){return this._applyCombination(XPe,arguments)},triad:function(){return this._applyCombination(_z,[3])},tetrad:function(){return this._applyCombination(_z,[4])}};Qt.fromRatio=function(n,e){if(t_(n)=="object"){var t={};for(var r in n)n.hasOwnProperty(r)&&(r==="a"?t[r]=n[r]:t[r]=hg(n[r]));n=t}return Qt(n,e)};function BPe(n){var e={r:0,g:0,b:0},t=1,r=null,i=null,a=null,o=!1,s=!1;return typeof n=="string"&&(n=r4e(n)),t_(n)=="object"&&(ml(n.r)&&ml(n.g)&&ml(n.b)?(e=VPe(n.r,n.g,n.b),o=!0,s=String(n.r).substr(-1)==="%"?"prgb":"rgb"):ml(n.h)&&ml(n.s)&&ml(n.v)?(r=hg(n.s),i=hg(n.v),e=FPe(n.h,r,i),o=!0,s="hsv"):ml(n.h)&&ml(n.s)&&ml(n.l)&&(r=hg(n.s),a=hg(n.l),e=zPe(n.h,r,a),o=!0,s="hsl"),n.hasOwnProperty("a")&&(t=n.a)),t=zY(t),{ok:o,format:n.format||s,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:t}}function VPe(n,e,t){return{r:Ar(n,255)*255,g:Ar(e,255)*255,b:Ar(t,255)*255}}function mz(n,e,t){n=Ar(n,255),e=Ar(e,255),t=Ar(t,255);var r=Math.max(n,e,t),i=Math.min(n,e,t),a,o,s=(r+i)/2;if(r==i)a=o=0;else{var l=r-i;switch(o=s>.5?l/(2-r-i):l/(r+i),r){case n:a=(e-t)/l+(e<t?6:0);break;case e:a=(t-n)/l+2;break;case t:a=(n-e)/l+4;break}a/=6}return{h:a,s:o,l:s}}function zPe(n,e,t){var r,i,a;n=Ar(n,360),e=Ar(e,100),t=Ar(t,100);function o(u,c,f){return f<0&&(f+=1),f>1&&(f-=1),f<1/6?u+(c-u)*6*f:f<1/2?c:f<2/3?u+(c-u)*(2/3-f)*6:u}if(e===0)r=i=a=t;else{var s=t<.5?t*(1+e):t+e-t*e,l=2*t-s;r=o(l,s,n+1/3),i=o(l,s,n),a=o(l,s,n-1/3)}return{r:r*255,g:i*255,b:a*255}}function yz(n,e,t){n=Ar(n,255),e=Ar(e,255),t=Ar(t,255);var r=Math.max(n,e,t),i=Math.min(n,e,t),a,o,s=r,l=r-i;if(o=r===0?0:l/r,r==i)a=0;else{switch(r){case n:a=(e-t)/l+(e<t?6:0);break;case e:a=(t-n)/l+2;break;case t:a=(n-e)/l+4;break}a/=6}return{h:a,s:o,v:s}}function FPe(n,e,t){n=Ar(n,360)*6,e=Ar(e,100),t=Ar(t,100);var r=Math.floor(n),i=n-r,a=t*(1-e),o=t*(1-i*e),s=t*(1-(1-i)*e),l=r%6,u=[t,o,a,a,s,t][l],c=[s,t,t,o,a,a][l],f=[a,a,s,t,t,o][l];return{r:u*255,g:c*255,b:f*255}}function bz(n,e,t,r){var i=[Uo(Math.round(n).toString(16)),Uo(Math.round(e).toString(16)),Uo(Math.round(t).toString(16))];return r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function $Pe(n,e,t,r,i){var a=[Uo(Math.round(n).toString(16)),Uo(Math.round(e).toString(16)),Uo(Math.round(t).toString(16)),Uo(FY(r))];return i&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}function xz(n,e,t,r){var i=[Uo(FY(r)),Uo(Math.round(n).toString(16)),Uo(Math.round(e).toString(16)),Uo(Math.round(t).toString(16))];return i.join("")}Qt.equals=function(n,e){return!n||!e?!1:Qt(n).toRgbString()==Qt(e).toRgbString()};Qt.random=function(){return Qt.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function HPe(n,e){e=e===0?0:e||10;var t=Qt(n).toHsl();return t.s-=e/100,t.s=xS(t.s),Qt(t)}function GPe(n,e){e=e===0?0:e||10;var t=Qt(n).toHsl();return t.s+=e/100,t.s=xS(t.s),Qt(t)}function UPe(n){return Qt(n).desaturate(100)}function WPe(n,e){e=e===0?0:e||10;var t=Qt(n).toHsl();return t.l+=e/100,t.l=xS(t.l),Qt(t)}function jPe(n,e){e=e===0?0:e||10;var t=Qt(n).toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(255*-(e/100)))),t.g=Math.max(0,Math.min(255,t.g-Math.round(255*-(e/100)))),t.b=Math.max(0,Math.min(255,t.b-Math.round(255*-(e/100)))),Qt(t)}function qPe(n,e){e=e===0?0:e||10;var t=Qt(n).toHsl();return t.l-=e/100,t.l=xS(t.l),Qt(t)}function KPe(n,e){var t=Qt(n).toHsl(),r=(t.h+e)%360;return t.h=r<0?360+r:r,Qt(t)}function YPe(n){var e=Qt(n).toHsl();return e.h=(e.h+180)%360,Qt(e)}function _z(n,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var t=Qt(n).toHsl(),r=[Qt(n)],i=360/e,a=1;a<e;a++)r.push(Qt({h:(t.h+a*i)%360,s:t.s,l:t.l}));return r}function XPe(n){var e=Qt(n).toHsl(),t=e.h;return[Qt(n),Qt({h:(t+72)%360,s:e.s,l:e.l}),Qt({h:(t+216)%360,s:e.s,l:e.l})]}function ZPe(n,e,t){e=e||6,t=t||30;var r=Qt(n).toHsl(),i=360/t,a=[Qt(n)];for(r.h=(r.h-(i*e>>1)+720)%360;--e;)r.h=(r.h+i)%360,a.push(Qt(r));return a}function JPe(n,e){e=e||6;for(var t=Qt(n).toHsv(),r=t.h,i=t.s,a=t.v,o=[],s=1/e;e--;)o.push(Qt({h:r,s:i,v:a})),a=(a+s)%1;return o}Qt.mix=function(n,e,t){t=t===0?0:t||50;var r=Qt(n).toRgb(),i=Qt(e).toRgb(),a=t/100,o={r:(i.r-r.r)*a+r.r,g:(i.g-r.g)*a+r.g,b:(i.b-r.b)*a+r.b,a:(i.a-r.a)*a+r.a};return Qt(o)};Qt.readability=function(n,e){var t=Qt(n),r=Qt(e);return(Math.max(t.getLuminance(),r.getLuminance())+.05)/(Math.min(t.getLuminance(),r.getLuminance())+.05)};Qt.isReadable=function(n,e,t){var r=Qt.readability(n,e),i,a;switch(a=!1,i=i4e(t),i.level+i.size){case"AAsmall":case"AAAlarge":a=r>=4.5;break;case"AAlarge":a=r>=3;break;case"AAAsmall":a=r>=7;break}return a};Qt.mostReadable=function(n,e,t){var r=null,i=0,a,o,s,l;t=t||{},o=t.includeFallbackColors,s=t.level,l=t.size;for(var u=0;u<e.length;u++)a=Qt.readability(n,e[u]),a>i&&(i=a,r=Qt(e[u]));return Qt.isReadable(n,r,{level:s,size:l})||!o?r:(t.includeFallbackColors=!1,Qt.mostReadable(n,["#fff","#000"],t))};var YM=Qt.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",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:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",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:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",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:"f00",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:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},QPe=Qt.hexNames=e4e(YM);function e4e(n){var e={};for(var t in n)n.hasOwnProperty(t)&&(e[n[t]]=t);return e}function zY(n){return n=parseFloat(n),(isNaN(n)||n<0||n>1)&&(n=1),n}function Ar(n,e){t4e(n)&&(n="100%");var t=n4e(n);return n=Math.min(e,Math.max(0,parseFloat(n))),t&&(n=parseInt(n*e,10)/100),Math.abs(n-e)<1e-6?1:n%e/parseFloat(e)}function xS(n){return Math.min(1,Math.max(0,n))}function $a(n){return parseInt(n,16)}function t4e(n){return typeof n=="string"&&n.indexOf(".")!=-1&&parseFloat(n)===1}function n4e(n){return typeof n=="string"&&n.indexOf("%")!=-1}function Uo(n){return n.length==1?"0"+n:""+n}function hg(n){return n<=1&&(n=n*100+"%"),n}function FY(n){return Math.round(parseFloat(n)*255).toString(16)}function Sz(n){return $a(n)/255}var Bo=(function(){var n="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",t="(?:"+e+")|(?:"+n+")",r="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",i="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?";return{CSS_UNIT:new RegExp(t),rgb:new RegExp("rgb"+r),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+r),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+r),hsva:new RegExp("hsva"+i),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 ml(n){return!!Bo.CSS_UNIT.exec(n)}function r4e(n){n=n.replace(LPe,"").replace(PPe,"").toLowerCase();var e=!1;if(YM[n])n=YM[n],e=!0;else if(n=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t;return(t=Bo.rgb.exec(n))?{r:t[1],g:t[2],b:t[3]}:(t=Bo.rgba.exec(n))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=Bo.hsl.exec(n))?{h:t[1],s:t[2],l:t[3]}:(t=Bo.hsla.exec(n))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=Bo.hsv.exec(n))?{h:t[1],s:t[2],v:t[3]}:(t=Bo.hsva.exec(n))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=Bo.hex8.exec(n))?{r:$a(t[1]),g:$a(t[2]),b:$a(t[3]),a:Sz(t[4]),format:e?"name":"hex8"}:(t=Bo.hex6.exec(n))?{r:$a(t[1]),g:$a(t[2]),b:$a(t[3]),format:e?"name":"hex"}:(t=Bo.hex4.exec(n))?{r:$a(t[1]+""+t[1]),g:$a(t[2]+""+t[2]),b:$a(t[3]+""+t[3]),a:Sz(t[4]+""+t[4]),format:e?"name":"hex8"}:(t=Bo.hex3.exec(n))?{r:$a(t[1]+""+t[1]),g:$a(t[2]+""+t[2]),b:$a(t[3]+""+t[3]),format:e?"name":"hex"}:!1}function i4e(n){var e,t;return n=n||{level:"AA",size:"small"},e=(n.level||"AA").toUpperCase(),t=(n.size||"small").toLowerCase(),e!=="AA"&&e!=="AAA"&&(e="AA"),t!=="small"&&t!=="large"&&(t="small"),{level:e,size:t}}const wz=(n,e,t=!1)=>{if(t)switch(e){case"rgb":return n.toRgb();case"prgb":return n.toPercentageRgb();case"hsl":return n.toHsl();case"hsv":return n.toHsv();default:return null}else{let r=e;e==="hex"&&n.getAlpha()<1&&(r="hex8");let i=n.toString(r);try{i=JSON.parse(i)}catch{}return i}},ET=(n,e)=>!!(Object.prototype.hasOwnProperty.call(n,e)&&typeof n[e]<"u"),o1=n=>typeof n>"u",_S=["update:tinyColor","update:modelValue","input"];function SS(n,e,t){let r,i;const a=m.computed({get:()=>{const{modelValue:s,tinyColor:l,value:u}=n,c=l??s??u;return o1(i)&&(o1(u)||(i=Qt(u).getFormat()),o1(s)||(i=Qt(s).getFormat())),o1(r)&&(typeof u=="object"&&!(u instanceof Qt)&&(r=!0),typeof s=="object"&&(r=!0)),Qt(c)},set:s=>{o(s)}}),o=s=>{const l=Qt(s);if(ET(n,"tinyColor")&&e("update:tinyColor",l),ET(n,"modelValue")){const u=wz(l,i,r);e("update:modelValue",u)}if(ET(n,"value")){const u=wz(l,i,r);e("input",u)}};return a}const $Y=n=>{const e={x:0,y:0};return n instanceof MouseEvent&&(e.x=n.pageX,e.y=n.pageY),typeof TouchEvent<"u"&&n instanceof TouchEvent&&(e.x=n.touches?.[0]?n.touches[0].pageX:n.changedTouches?.[0]?n.changedTouches[0].pageX:0,e.y=n.touches?.[0]?n.touches[0].pageY:n.changedTouches?.[0]?n.changedTouches[0].pageY:0),e},a4e=()=>{const n=window.scrollX||window.pageXOffset||document.documentElement.scrollLeft||0,e=window.scrollY||window.pageYOffset||document.documentElement.scrollTop||0;return{x:n,y:e}},HY=n=>{const{x:e,y:t}=a4e(),r=n.getBoundingClientRect();return{x:r.left+e,y:r.top+t}},BO=n=>n.code==="ArrowUp"||n.keyCode===38?"up":n.code==="ArrowDown"||n.keyCode===40?"down":n.code==="ArrowLeft"||n.keyCode===37?"left":n.code==="ArrowRight"||n.keyCode===39?"right":null;function o4e(n){const e=n.toString();return e.indexOf(".")!==-1?e.split(".")[1].length:0}function MT(n,e,t){return Math.min(Math.max(n,e),t)}const GY=(n,e=20)=>{let t,r,i;return(...a)=>{t?(clearTimeout(r),r=setTimeout(()=>{Date.now()-i>=e&&(n(...a),i=Date.now())},Math.max(e-(Date.now()-i),0))):(n(...a),i=Date.now(),t=!0)}},s4e=["aria-valuetext"],l4e=m.defineComponent({__name:"SaturationSlider",props:{hue:{},tinyColor:{},modelValue:{},value:{}},emits:["change"].concat(_S),setup(n,{emit:e}){const t=e,r=n,i=m.ref(0),a=SS(r,t),o=m.computed(()=>a.value.toHsv()),s=m.computed(()=>r.hue??o.value.h),l=m.computed(()=>`hsl(${s.value}, 100%, 50%)`),u=m.computed(()=>-(o.value.v*100)+1+100+"%"),c=m.computed(()=>o.value.v<=.01?i.value*100+"%":o.value.s*100+"%"),f=m.ref(null);function d(_){const x=f.value;if(!x)return;const T=x.clientWidth,k=x.clientHeight,{x:C,y:D}=HY(x),{x:O,y:R}=$Y(_),V=MT(O-C,0,T),F=MT(R-D,0,k),$=V/T,J=MT(1-F/k,0,1);i.value=$;let te=Math.round($*100),Q=Math.round(J*100);te===1&&(te=.01),Q===1&&(Q=.01),h({h:s.value,s:te,v:Q,a:o.value.a})}function h(_){a.value=_}const p=GY(d,20);function v(_){_.preventDefault(),_.type.startsWith("mouse")?(window.addEventListener("mousemove",p),window.addEventListener("mouseup",p),window.addEventListener("mouseup",g)):_.type.startsWith("touch")&&(window.addEventListener("touchmove",p),window.addEventListener("touchend",p),window.addEventListener("touchend",g))}function g(){y()}function y(){window.removeEventListener("mousemove",p),window.removeEventListener("mouseup",p),window.removeEventListener("mouseup",g),window.removeEventListener("touchmove",p),window.removeEventListener("touchend",p),window.removeEventListener("touchend",g)}function b(_){switch(_.preventDefault(),BO(_)){case"left":{const x=o.value.s-.01;h({...o.value,s:x>=0?x:0});break}case"right":{const x=o.value.s+.01;h({...o.value,s:x>1?1:x});break}case"up":{const x=o.value.v+.01;h({...o.value,v:x>1?1:x});break}case"down":{const x=o.value.v-.01;h({...o.value,v:x<0?0:x});break}}}return m.onUnmounted(()=>{y()}),(_,x)=>(m.openBlock(),m.createElementBlock("div",{class:"vc-saturation-slider bg",style:m.normalizeStyle({background:l.value}),ref_key:"containerRef",ref:f,onMousedown:v,onTouchstart:v,role:"application","aria-label":"Saturation and brightness picker"},[x[1]||(x[1]=m.createElementVNode("div",{class:"bg white"},null,-1)),x[2]||(x[2]=m.createElementVNode("div",{class:"bg black"},null,-1)),m.createElementVNode("div",{class:"picker-wrap",style:m.normalizeStyle({top:u.value,left:c.value}),role:"slider",tabindex:"0","aria-valuemin":"0","aria-valuemax":"1","aria-label":"press arrow to change saturation or brightness","aria-valuenow":"?","aria-valuetext":`saturation: ${o.value.s.toFixed(0)}%, brightness: ${o.value.v.toFixed(0)}%`,onKeydown:b},x[0]||(x[0]=[m.createElementVNode("div",{class:"picker"},null,-1)]),44,s4e)],36))}}),Id=(n,e)=>{const t=n.__vccOpts||n;for(const[r,i]of e)t[r]=i;return t},UY=Id(l4e,[["__scopeId","data-v-4d048d6e"]]),XM=n=>typeof n<"u",u4e={class:"vc-base-slider"},c4e={key:0,class:"background"},f4e=["aria-label","aria-valuemax","aria-valuenow"],d4e=m.defineComponent({__name:"BaseSlider",props:{direction:{default:"horizontal"},modelValue:{default:0},value:{default:0},max:{default:100},step:{},ariaLabel:{default:"slider"}},emits:["input","update:modelValue"],setup(n,{emit:e}){const t=n,r=e,i=m.computed(()=>t.modelValue??t.value),a=m.computed(()=>{let p=i.value/t.max;return t.direction==="vertical"&&(p=1-p),100*p+"%"}),o=m.ref(null);function s(p){XM(p)&&(r("input",p),r("update:modelValue",p))}function l(p){const{direction:v,max:g}=t,y=o.value;if(!y)return;const b=y.clientWidth,_=y.clientHeight,{x,y:T}=HY(y),{x:k,y:C}=$Y(p),D=k-x,O=C-T;let R;v==="vertical"?O<0?R=g:O>_?R=0:R=(1-O/_)*g:D<0?R=0:D>b?R=g:R=D/b*g,s(R)}const u=GY(l);function c(p){l(p),p.type.startsWith("mouse")?(window.addEventListener("mousemove",u),window.addEventListener("mouseup",f)):(window.addEventListener("touchmove",u),window.addEventListener("touchend",f))}function f(){d()}function d(){window.removeEventListener("mousemove",u),window.removeEventListener("mouseup",f),window.removeEventListener("touchmove",u),window.removeEventListener("touchend",f)}function h(p){p.preventDefault();const{direction:v,max:g}=t,y=BO(p),b=t.step??g/100,_=i.value;let x;switch(y){case"left":{if(v!=="horizontal")return;x=_-b<0?0:_-b;break}case"right":{if(v!=="horizontal")return;x=_+b>g?g:_+b;break}case"down":{if(v!=="vertical")return;x=_-b<0?0:_-b;break}case"up":{if(v!=="vertical")return;x=_+b>g?g:_+b;break}}s(x)}return m.onUnmounted(()=>{d()}),(p,v)=>(m.openBlock(),m.createElementBlock("div",u4e,[p.$slots.background?(m.openBlock(),m.createElementBlock("div",c4e,[m.renderSlot(p.$slots,"background",{},void 0,!0)])):m.createCommentVNode("",!0),m.createElementVNode("div",{class:m.normalizeClass({slider:!0,horizontal:p.direction==="horizontal",vertical:p.direction==="vertical"}),ref_key:"containerRef",ref:o,onMousedown:c,onTouchstart:c,role:"slider","aria-label":p.ariaLabel,"aria-valuemax":p.max,"aria-valuemin":"0","aria-valuenow":i.value.toFixed(1),tabindex:"0",onKeydown:h},[m.createElementVNode("div",{class:"picker-wrap",style:m.normalizeStyle({left:p.direction==="horizontal"?a.value:0,top:p.direction==="vertical"?a.value:0}),role:"presentation"},[m.renderSlot(p.$slots,"picker",{},()=>[v[0]||(v[0]=m.createElementVNode("div",{class:"picker"},null,-1))],!0)],4)],42,f4e)]))}}),WY=Id(d4e,[["__scopeId","data-v-972b0fad"]]),h4e=m.defineComponent({__name:"HueSlider",props:{direction:{default:"horizontal"},modelValue:{default:0}},emits:["update:modelValue"],setup(n,{emit:e}){m.useCssVars(c=>({"2f44f39d":i.value}));const t=n,r=e,i=m.computed(()=>`linear-gradient(to ${t.direction==="horizontal"?"right":"top"}, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%)`),a=m.computed(()=>{const c=Number(t.modelValue);return Number.isNaN(c)?0:c}),o=m.ref();m.watch(a,(c,f)=>{c!==0&&c-f>0&&(o.value="right"),c!==0&&c-f<0&&(o.value="left")});const s=m.computed(()=>t.direction==="vertical"?a.value===0&&o.value==="right"?0:a.value:t.direction==="horizontal"?a.value===0&&o.value==="right"?360:a.value:0);function l(c){u(Math.round(c))}function u(c){r("update:modelValue",c)}return(c,f)=>(m.openBlock(),m.createBlock(WY,{class:"vc-hue-slider",max:360,step:1,modelValue:s.value,direction:c.direction,"onUpdate:modelValue":l,"aria-label":"Hue"},{background:m.withCtx(()=>f[0]||(f[0]=[m.createElementVNode("div",{class:"gradient"},null,-1)])),picker:m.withCtx(()=>[m.renderSlot(c.$slots,"default",{},void 0,!0)]),_:3},8,["modelValue","direction"]))}}),jY=Id(h4e,[["__scopeId","data-v-5367c985"]]),p4e=m.defineComponent({__name:"CheckerboardBG",props:{size:{default:8},white:{default:"#fff"},grey:{default:"#e6e6e6"}},setup(n){const e=n;function t(a,o,s){if(typeof document>"u")return null;var l=document.createElement("canvas");l.width=l.height=s*2;var u=l.getContext("2d");return u?(u.fillStyle=a,u.fillRect(0,0,l.width,l.height),u.fillStyle=o,u.fillRect(0,0,s,s),u.translate(s,s),u.fillRect(0,0,s,s),l.toDataURL()):null}function r(a,o,s){return t(a,o,s)}const i=m.computed(()=>`url(${r(e.white,e.grey,e.size)})`);return(a,o)=>(m.openBlock(),m.createElementBlock("div",{class:"vc-checkerboard",style:m.normalizeStyle({backgroundImage:i.value})},null,4))}}),ZM=Id(p4e,[["__scopeId","data-v-37d61ccd"]]),v4e=m.defineComponent({__name:"AlphaSlider",props:{tinyColor:{},modelValue:{},value:{}},emits:_S,setup(n,{emit:e}){const t=SS(n,e),r=m.computed(()=>{const o=t.value.toRgb(),s=[o.r,o.g,o.b].join(",");return"linear-gradient(to right, rgba("+s+", 0) 0%, rgba("+s+", 1) 100%)"}),i=m.computed(()=>t.value.getAlpha());function a(o){t.value=t.value.setAlpha(o).clone()}return(o,s)=>(m.openBlock(),m.createBlock(WY,{class:"vc-alpha-slider",modelValue:i.value,max:1,"aria-label":"Transparency","onUpdate:modelValue":a},{background:m.withCtx(()=>[m.createVNode(ZM),m.createElementVNode("div",{class:"gradient",style:m.normalizeStyle({background:r.value})},null,4)]),_:1},8,["modelValue"]))}}),g4e=Id(v4e,[["__scopeId","data-v-07dd346b"]]),m4e={class:"vc-editable-input"},y4e=["value","aria-label"],b4e={key:0,class:"vc-input-desc","aria-hidden":"true"},x4e=m.defineComponent({__name:"EditableInput",props:{value:{},label:{},desc:{},max:{},min:{},step:{default:1},a11y:{}},emits:["change","blur"],setup(n,{emit:e}){const t=n,r=e,i=t.a11y?.label??t.label,a=`input__label__${i}__${Math.random().toString().slice(2,5)}`;function o(c){const{min:f,max:d}=t;if(XM(d)&&+c>d){r("change",d);return}if(XM(f)&&+c<f){r("change",f);return}r("change",c)}function s(c){o(c.target?.value)}function l(c){r("blur",c)}function u(c){let f=Number(t.value);if(!isNaN(f)){let d=t.step;const h=o4e(d),p=BO(c);p==="up"&&(o((f+d).toFixed(h)),c.preventDefault()),p==="down"&&(o((f-d).toFixed(h)),c.preventDefault())}}return(c,f)=>(m.openBlock(),m.createElementBlock("div",m4e,[m.createElementVNode("input",{class:"vc-input-input",value:t.value,onKeydown:u,onInput:s,onBlur:l,"aria-label":m.unref(i),id:a},null,40,y4e),m.createElementVNode("label",{for:a,class:"vc-input-label","aria-hidden":"true"},m.toDisplayString(t.label),1),c.desc?(m.openBlock(),m.createElementBlock("span",b4e,m.toDisplayString(c.desc),1)):m.createCommentVNode("",!0)]))}}),$o=Id(x4e,[["__scopeId","data-v-9c267b2b"]]),kz=n=>Qt(n).isValid(),_4e=n=>Qt(n).getAlpha()===0,qY=m.defineComponent({__name:"HexInput",props:{value:{},label:{},desc:{},a11y:{},type:{default:"hex"},withHash:{type:Boolean,default:!1}},emits:["change"],setup(n,{emit:e}){const t=n,r=e,i={label:t.type==="hex"?"Hex":"Hex with transparency",...t.a11y},a=(u,c="hex")=>{let f="";return c==="hex"&&(f=Qt(u).toHexString()),c==="hex8"&&(f=Qt(u).toHex8String()),t.withHash!==!0&&(f=f.replace("#","")),f},o=m.ref(a(t.value,t.type));m.watch(()=>t.value,u=>{Qt.equals(u,o.value)||(o.value=a(u,t.type))});const s=u=>{if(!u)return;o.value=u;let c=u.length;u[0]==="#"&&(c=c-1),!(t.type==="hex"&&c%3!==0&&c!==8)&&(t.type==="hex8"&&c!==8||kz(u)&&r("change",u))},l=()=>{let u=o.value.length;o.value[0]==="#"&&(u=u-1),!(kz(o.value)&&(t.type==="hex"&&u===6||t.type==="hex8"&&u===8))&&(o.value=a(t.value,t.type))};return(u,c)=>(m.openBlock(),m.createBlock($o,{label:t.label,a11y:i,value:o.value,onChange:s,onBlur:l},null,8,["label","value"]))}});function S4e(){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";return n.charAt(Math.floor(Math.random()*n.length))+n.charAt(Math.floor(Math.random()*n.length))}const KY=n=>{const e=m.ref(0),t=`__from__vc__hue__${S4e()}`;return m.watch(n,r=>{if(r[t])return;const i=r.toHsl().h;i===0&&e.value!==0||(e.value=i)},{immediate:!0}),{hueRef:e,updateHueRef:r=>{const i=Qt({...n.value.toHsl(),h:r});i[t]=!0,n.value=i,e.value=r}}},w4e={class:"title","aria-hidden":"true"},k4e={class:"body"},T4e={class:"saturation"},C4e={class:"hue"},E4e={class:"preview"},M4e={class:"preview-label","aria-hidden":"true"},A4e={class:"preview-swatches"},N4e=["aria-label"],D4e=["aria-label"],O4e={class:"preview-label","aria-hidden":"true"},I4e={key:0,class:"actions"},R4e=["aria-label"],L4e={class:"fields"},P4e=["aria-label"];_S.concat(["ok","cancel","reset"]);const B4e={class:"saturation"},V4e={class:"controls"},z4e={class:"sliders"},F4e={class:"hue"},$4e={key:0,class:"alpha"},H4e={class:"color"},G4e=["aria-label"],U4e={key:0,class:"field"},W4e={class:"field_double"},j4e={class:"field_single"},q4e={class:"field_single"},K4e={class:"field_single"},Y4e={key:0,class:"field_single"},X4e={class:"presets",role:"listbox","aria-label":"A color preset, pick one to set as current color"},Z4e=["onClick","title","aria-label","aria-selected","onKeydown"],J4e=["onClick","aria-selected","title","onKeydown"],Q4e=["#D0021B","#F5A623","#F8E71C","#8B572A","#7ED321","#417505","#BD10E0","#9013FE","#4A90E2","#50E3C2","#B8E986","#000000","#4A4A4A","#9B9B9B","#FFFFFF","rgba(0,0,0,0)"],e5e=m.defineComponent({__name:"SketchPicker",props:{presetColors:{default:()=>Q4e},disableAlpha:{type:Boolean,default:!1},disableFields:{type:Boolean,default:!1},tinyColor:{},modelValue:{},value:{}},emits:["change"].concat(_S),setup(n,{emit:e}){const t=n,r=SS(t,e),{hueRef:i,updateHueRef:a}=KY(r),o=m.computed(()=>Number(r.value.getAlpha().toFixed(2))),s=m.computed(()=>{let h;return o.value<1?h=r.value.toHex8String():h=r.value.toHexString(),h.replace("#","")}),l=m.computed(()=>r.value.toRgb()),u=h=>{r.value=h},c=(h,p)=>{if(!p||isNaN(Number(p)))return;const v={[h]:p};r.value={...l.value,...v}},f=h=>{!h||isNaN(Number(h))||(r.value=r.value.setAlpha(h).clone())},d=h=>{r.value=h};return(h,p)=>(m.openBlock(),m.createElementBlock("div",{role:"application","aria-label":"Sketch color picker",class:m.normalizeClass(["vc-sketch-picker",h.disableAlpha?"alpha-disabled":""])},[m.createElementVNode("div",B4e,[m.createVNode(UY,{hue:m.unref(i),tinyColor:m.unref(r),"onUpdate:tinyColor":p[0]||(p[0]=v=>m.isRef(r)?r.value=v:null)},null,8,["hue","tinyColor"])]),m.createElementVNode("div",V4e,[m.createElementVNode("div",z4e,[m.createElementVNode("div",F4e,[m.createVNode(jY,{modelValue:m.unref(i),"onUpdate:modelValue":m.unref(a)},null,8,["modelValue","onUpdate:modelValue"])]),h.disableAlpha?m.createCommentVNode("",!0):(m.openBlock(),m.createElementBlock("div",$4e,[m.createVNode(g4e,{tinyColor:m.unref(r),"onUpdate:tinyColor":p[1]||(p[1]=v=>m.isRef(r)?r.value=v:null)},null,8,["tinyColor"])]))]),m.createElementVNode("div",H4e,[m.createElementVNode("div",{"aria-label":`Current color is ${m.unref(r).toRgbString()}`,class:"active-color",style:m.normalizeStyle({background:m.unref(r).toRgbString()})},null,12,G4e),m.createVNode(ZM)])]),h.disableFields?m.createCommentVNode("",!0):(m.openBlock(),m.createElementBlock("div",U4e,[m.createElementVNode("div",W4e,[m.createVNode(qY,{label:"hex",value:s.value,onChange:u,type:o.value<1?"hex8":"hex"},null,8,["value","type"])]),m.createElementVNode("div",j4e,[m.createVNode($o,{label:"r",value:l.value.r,onChange:p[2]||(p[2]=v=>c("r",v)),a11y:{label:"Red"}},null,8,["value"])]),m.createElementVNode("div",q4e,[m.createVNode($o,{label:"g",value:l.value.g,onChange:p[3]||(p[3]=v=>c("g",v)),a11y:{label:"Green"}},null,8,["value"])]),m.createElementVNode("div",K4e,[m.createVNode($o,{label:"b",value:l.value.b,onChange:p[4]||(p[4]=v=>c("b",v)),a11y:{label:"Blue"}},null,8,["value"])]),h.disableAlpha?m.createCommentVNode("",!0):(m.openBlock(),m.createElementBlock("div",Y4e,[m.createVNode($o,{label:"a",value:o.value,step:.01,max:1,onChange:f,a11y:{label:"Transparency"}},null,8,["value"])]))])),m.createElementVNode("div",X4e,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(t.presetColors,v=>(m.openBlock(),m.createElementBlock(m.Fragment,null,[m.unref(_4e)(v)?(m.openBlock(),m.createElementBlock("div",{key:v,class:"preset-color",onClick:g=>d(v),"aria-label":"Color: transparency","aria-selected":o.value===0,role:"option",tabindex:"0",title:v,onKeydown:m.withKeys(g=>d(v),["space"])},[m.createVNode(ZM)],40,J4e)):(m.openBlock(),m.createElementBlock("div",{class:"preset-color",key:v+"-color",style:m.normalizeStyle({background:v}),onClick:g=>d(v),title:v,"aria-label":"Color:"+v,"aria-selected":`#${s.value.toLowerCase()}`===v.toLowerCase(),role:"option",tabindex:"0",onKeydown:m.withKeys(g=>d(v),["space"])},null,44,Z4e))],64))),256))])],2))}}),VO=Id(e5e,[["__scopeId","data-v-fdb7d989"]]),Tz=m.defineComponent({__name:"color",props:{text:{type:String,default:""},defaultColor:{type:String,default:"#000"}},setup(n){const e=n,t=m.inject("editor"),r=m.ref(!1),i=m.ref(e.defaultColor),a=s=>{i.value=s,r.value=!1,s===""?t.value?.chain().focus().unsetColor().run():t.value?.chain().focus().setColor(s).run()},o=aA(s=>{i.value=s,s===""?t.value?.chain().focus().unsetColor().run():t.value?.chain().focus().setColor(s).run()},200);return m.watch(()=>i.value,s=>{o(s)}),(s,l)=>(m.openBlock(),m.createBlock(il,{ico:"text-editor",text:"文字颜色","hide-text":"","popup-visible":r.value,"onUpdate:popupVisible":l[1]||(l[1]=u=>r.value=u),"popup-type":"arrow",onMenuClick:l[2]||(l[2]=u=>m.unref(t)?.isEditable===!1?()=>{}:a(i.value))},{content:m.withCtx(()=>[m.createVNode(m.unref(VO),{modelValue:i.value,"onUpdate:modelValue":l[0]||(l[0]=u=>i.value=u)},null,8,["modelValue"])]),default:m.withCtx(()=>[m.createElementVNode("div",{class:"w-[14px] h-[2px] mx-auto",style:m.normalizeStyle({backgroundColor:i.value})},null,4)]),_:1},8,["popup-visible"]))}}),Cz=m.defineComponent({__name:"background-color",props:{text:{type:String,default:""},defaultColor:{type:String,default:"#007bff"}},setup(n){const e=n,t=m.inject("editor"),r=m.ref(!1),i=m.ref(e.defaultColor),a=s=>{i.value=s,r.value=!1,s===""?t.value?.chain().focus().unsetHighlight().run():t.value?.chain().focus().setHighlight({color:s}).run()},o=aA(s=>{i.value=s,s===""?t.value?.chain().focus().unsetHighlight().run():t.value?.chain().focus().setHighlight({color:s}).run()},200);return m.watch(()=>i.value,s=>{o(s)}),(s,l)=>(m.openBlock(),m.createBlock(il,{ico:"fill",text:"背景颜色","hide-text":"","popup-visible":r.value,"onUpdate:popupVisible":l[1]||(l[1]=u=>r.value=u),"popup-type":"arrow",onMenuClick:l[2]||(l[2]=u=>m.unref(t)?.isEditable===!1?()=>{}:a(i.value))},{content:m.withCtx(()=>[m.createVNode(m.unref(VO),{modelValue:i.value,"onUpdate:modelValue":l[0]||(l[0]=u=>i.value=u)},null,8,["modelValue"])]),default:m.withCtx(()=>[m.createElementVNode("div",{class:"w-[14px] h-[2px] mx-auto",style:m.normalizeStyle({backgroundColor:m.unref(t)?.getAttributes("highlight")?.color||i.value})},null,4)]),_:1},8,["popup-visible"]))}});var YY=(n=>(n.C="C",n.X="X",n.Z="Z",n.Y="Y",n.A="A",n.G="G",n.L="L",n.F="F",n.D="D",n.B="B",n.P="P",n.O="O",n.R="R",n.T="T",n.MINUS="-",n.EQUAL="=",n.DIGIT_0="0",n.DELETE="DELETE",n.UP="ARROWUP",n.DOWN="ARROWDOWN",n.LEFT="ARROWLEFT",n.RIGHT="ARROWRIGHT",n.ENTER="ENTER",n.SPACE=" ",n.TAB="TAB",n.BACKSPACE="BACKSPACE",n.ESC="ESCAPE",n.PAGEUP="PAGEUP",n.PAGEDOWN="PAGEDOWN",n.F5="F5",n))(YY||{});const Fm=[{label:"默认",value:"14px",order:4},{label:"初号",value:"42pt",order:20},{label:"小初",value:"36pt",order:19},{label:"一号",value:"26pt",order:16},{label:"小一",value:"24pt",order:15},{label:"二号",value:"22pt",order:14},{label:"小二",value:"18pt",order:11},{label:"三号",value:"16pt",order:10},{label:"小三",value:"15pt",order:9},{label:"四号",value:"14pt",order:7},{label:"小四",value:"12pt",order:4},{label:"五号",value:"10.5pt",order:1},{label:"小五",value:"9pt",order:1},{label:"六号",value:"8pt",order:1},{label:"小六",value:"7.5pt",order:1},{label:"10",value:"10px",order:1},{label:"11",value:"11px",order:2},{label:"12",value:"12px",order:3},{label:"16",value:"16px",order:5},{label:"18",value:"18px",order:6},{label:"20",value:"20px",order:8},{label:"22",value:"22px",order:10},{label:"24",value:"24px",order:11},{label:"26",value:"26px",order:12},{label:"28",value:"28px",order:13},{label:"32",value:"32px",order:15},{label:"36",value:"36px",order:17},{label:"42",value:"42px",order:18},{label:"48",value:"48px",order:19},{label:"72",value:"72px",order:21},{label:"96",value:"96px",order:22}],JM=[{label:"正文",value:"paragraph",element:"p"},{label:"标题1",value:"1",element:"h1"},{label:"标题2",value:"2",element:"h2"},{label:"标题3",value:"3",element:"h3"},{label:"标题4",value:"4",element:"h4"},{label:"标题5",value:"5",element:"h5"},{label:"标题6",value:"6",element:"h6"}],Ez={bar:{labels:["类别1","类别2","类别3","类别4","类别5"],legends:["系列1","系列2"],series:[[12,19,5,2,18],[7,11,13,21,9]]},column:{labels:["类别1","类别2","类别3","类别4","类别5"],legends:["系列1","系列2"],series:[[12,19,5,2,18],[7,11,13,21,9]]},line:{labels:["类别1","类别2","类别3","类别4","类别5"],legends:["系列1","系列2"],series:[[12,19,5,2,18],[7,11,13,21,9]]},smooth:{labels:["类别1","类别2","类别3","类别4","类别5"],legends:["系列1","系列2"],series:[[12,19,5,2,18],[7,11,13,21,9]]},pie:{labels:["类别1","类别2","类别3","类别4","类别5"],legends:["值"],series:[[12,19,5,2,18]]},ring:{labels:["类别1","类别2","类别3","类别4","类别5"],legends:["值"],series:[[12,19,5,2,18]]},area:{labels:["类别1","类别2","类别3","类别4","类别5"],legends:["系列1","系列2"],series:[[12,19,5,2,18],[7,11,13,21,9]]},radar:{labels:["类别1","类别2","类别3","类别4","类别5"],legends:["系列1","系列2"],series:[[12,19,5,2,18],[7,11,13,21,9]]},scatter:{labels:["坐标1","坐标2","坐标3","坐标4","坐标5"],legends:["X","Y"],series:[[12,19,5,2,18],[7,11,13,21,9]]}},Mz=[{label:"默认",value:"decimal",code:`<path d="M35 29a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17z" fill-opacity=".163"></path>
275
275
  <path d="M10.29 15V8.531H9.286c-.14.393-.4.736-.778 1.03-.378.295-.728.495-1.05.6v1.121a4.257 4.257 0 0 0 1.595-.936V15h1.235zm3.343 0v-1.235h-1.235V15h1.235zM11.3 24v-1.147H8.848c.064-.111.148-.226.252-.343.104-.117.351-.354.74-.712.39-.357.66-.631.81-.821.225-.288.39-.562.494-.824.104-.263.156-.539.156-.829 0-.51-.182-.936-.545-1.279-.363-.342-.863-.514-1.499-.514-.58 0-1.063.148-1.45.444-.387.296-.617.784-.69 1.463l1.23.124c.024-.36.112-.619.264-.774.153-.155.358-.233.616-.233.26 0 .465.074.613.222.148.148.222.36.222.635 0 .25-.085.501-.255.756-.126.185-.468.536-1.024 1.055-.692.641-1.155 1.156-1.389 1.544-.234.389-.375.8-.422 1.233H11.3zm2.333 0v-1.235h-1.235V24h1.235zM9.204 34.11c.615 0 1.129-.2 1.542-.598.413-.398.62-.88.62-1.446 0-.39-.11-.722-.332-.997a1.5 1.5 0 0 0-.886-.532c.619-.337.928-.788.928-1.353 0-.399-.151-.756-.453-1.073-.366-.386-.852-.58-1.459-.58a2.25 2.25 0 0 0-.96.2 1.617 1.617 0 0 0-.668.55c-.16.232-.28.544-.358.933l1.138.194c.032-.282.123-.495.272-.642.15-.146.33-.22.54-.22.215 0 .386.065.515.194s.193.302.193.518c0 .255-.087.46-.263.613-.176.154-.43.227-.765.218l-.136 1.006c.22-.061.409-.092.567-.092.24 0 .444.09.61.272.168.182.251.428.251.739 0 .328-.087.589-.261.782a.833.833 0 0 1-.644.29.841.841 0 0 1-.607-.242c-.167-.16-.27-.394-.307-.698l-1.196.145c.062.542.285.98.668 1.316.384.335.868.503 1.45.503zm4.43-.11v-1.235h-1.236V34h1.235z"></path>
276
276
  `},{label:"以0开头的数字",value:"decimal-leading-zero",code:`<path
277
277
  d="M35 29a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17z"
@@ -310,7 +310,7 @@ echarts.use([`+F+"]);":"Unknown series "+V))}return}if(f==="tooltip"){if(_){proc
310
310
  </g>`}],Az=[{label:"默认",value:"disc",code:`<path d="M35 29a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17z" fill-opacity=".163"></path>
311
311
  <path d="M11 27a3 3 0 1 1 0 6 3 3 0 0 1 0-6zm0-9a3 3 0 1 1 0 6 3 3 0 0 1 0-6zm0-9a3 3 0 1 1 0 6 3 3 0 0 1 0-6z"></path>`},{label:"空心圆",value:"circle",code:`<path d="M35 29a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17z" fill-opacity=".163"></path>
312
312
  <path d="M11 27a3 3 0 1 1 0 6 3 3 0 0 1 0-6zm0 1a2 2 0 1 0 0 4 2 2 0 0 0 0-4zm0-10a3 3 0 1 1 0 6 3 3 0 0 1 0-6zm0 1a2 2 0 1 0 0 4 2 2 0 0 0 0-4zm0-10a3 3 0 1 1 0 6 3 3 0 0 1 0-6zm0 1a2 2 0 1 0 0 4 2 2 0 0 0 0-4z"></path>`},{label:"实心方块",value:"square",code:`<path d="M35 29a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17z" fill-opacity=".163"></path>
313
- <path d="M14 27v6H8v-6h6zm0-9v6H8v-6h6zm0-9v6H8V9h6z"></path>`}],n5e=[{label:"表情与角色",items:"😀 😃 😄 😁 😆 😅 🤣 😂 🙂 🙃 😉 😊 😇 🥰 😍 🤩 😘 😗 😚 😙 😋 😛 😜 🤪 😝 🤑 🤗 🤭 🤫 🤔 🤐 🤨 😐 😑 😶 😶‍ 😏 😒 🙄 😬 😮‍ 🤥 😌 😔 😪 🤤 😴 😷 🤒 🤕 🤢 🤮 🤧 🥵 🥶 🥴 😵 😵‍💫 🤯 🤠 🥳 😎 🤓 🧐 😕 😟 🙁 ☹️ 😮 😯 😲 😳 🥺 😦 😧 😨 😰 😥 😢 😭 😱 😖 😣 😞 😓 😩 😫 🥱 😤 😡 😠 🤬 😈 👿 💀 ☠️ 💩 🤡 👹 👺 👻 👽 👾 🤖 👋 🤚 🖐️ ✋ 🖖 👌 🤏 ✌️ 🤞 🤟 🤘 🤙 👈 👉 👆 🖕 👇 ☝️ 👍 👎 ✊ 👊 🤛 🤜 👏 🙌 👐 🤲 🤝 🙏 ✍️ 💅 🤳 💪 🦾 🦿 🦵 🦶 👂 🦻"},{label:"动物与自然",items:"🐵 🐒 🦍 🦧 🐶 🐕 🦮 🐕‍🦺 🐩 🐺 🦊 🦝 🐱 🐈 🐈‍⬛ 🦁 🐯 🐅 🐆 🐴 🐎 🦄 🦓 🦌 🐮 🐂 🐃 🐄 🐷 🐖 🐗 🐽 🐏 🐑 🐐 🐪 🐫 🦙 🦒 🐘 🦏 🦛 🐭 🐁 🐀 🐹 🐰 🐇 🐿️ 🦔 🦇 🐻 🐻‍❄️ 🐨 🐼 🦥 🦦 🦨 🦘 🦡 🐾 🦃 🐔 🐓 🐣 🐤 🐥 🐦 🐧 🕊️ 🦅 🦆 🦢 🦉 🦩 🦚 🦜 🐸 🐊 🐢 🦎 🐍 🐲 🐉 🦕 🦖 🐳 🐋 🐬 🦭 🐟 🐠 🐡 🦈 🐙 🐚 🐌 🦋 🐛 🐜 🐝 🐞 🦗 🕷️ 🕸️ 🦂 🦟 🦠 💐 🌸 💮 🏵️ 🌹 🥀 🌺 🌻 🌼 🌷 🌱 🌲 🌳 🌴 🌵 🌾 🌿 ☘️ 🍀 🍁 🍂 🍃 🌒 🌓 🌔 🌕 🌖 🌗 🌘 🌙 🌚 🌛 🌜 ☀️ 🌝 🌞 🪐 🌟 🌠 🌌 ☁️ ⛅ ⛈️ 🌤️ 🌥️ 🌦️ 🌧️ 🌨️ 🌩️ 🌪️ 🌫️ 🌬️ 🌀 🌈 🌂 ☂️ ☔ ⛱️ ⚡ ❄️ ☃️ ⛄ ☄️ 🔥 💧 🌊"},{label:"食物与食品",items:"🍇 🍉 🍊 🍋 🍌 🍍 🥭 🍎 🍏 🍐 🍑 🍒 🍓 🥝 🍅 🥥 🥑 🍆 🥔 🥕 🌽 🌶️ 🥬 🥦 🧄 🧅 🍄 🥜 🌰 🍞 🥐 🥖 🥨 🥯 🥞 🧇 🧀 🍖 🍗 🥩 🥓 🍔 🍟 🍕 🌭 🥪 🌮 🌯 🥙 🧆 🥚 🍳 🥘 🍲 🥣 🥗 🍿 🧈 🧂 🥫 🍱 🍘 🍙 🍚 🍛 🍜 🍝 🍠 🍢 🍣 🍤 🍥 🥮 🍡 🥟 🥠 🥡 🦀 🦞 🦐 🦑 🦪 🍦 🍧 🍨 🍩 🍪 🎂 🍰 🧁 🥧 🍫 🍬 🍭 🍮 🍯 🍼 🥛 ☕ 🍵 🍶 🍾 🍷 🍸 🍹 🍺 🍻 🥂 🥃 🥤 🧃 🧉 🧊 🥢 🍽️ 🍴 🥄 🔪 🏺"},{label:"活动",items:"🧧 🎁 🎄 🧨 ✨ 🎈 🎉 🏮 🎗️ 🎟️ 🎫 🎖️ 🏆 🏅 🥇 🥈 🥉 ⚽ ⚾ 🥎 🏀 🏐 🏈 🏉 🎾 🥏 🎳 🏏 🏑 🏒 🥍 🏓 🏸 🥊 🥋 🥅 ⛳ ⛸️ 🎣 🤿 🎽 🎿 🛷 🥌 🎯 🪀 🪁 🎱 🔮 🧿 🎮 🕹️ 🎰 🎲 🧩 🧸 ♟️ 🃏 🀄 🎴 🎭 🖼️ 🎨 🧵 🧶"},{label:"旅行与景点",items:"🚈 🚉 🚊 🚝 🚞 🚋 🚌 🚍 🚎 🚐 🚑 🚒 🚓 🚔 🚕 🚖 🚗 🚘 🚙 🚚 🚛 🚜 🏎️ 🏍️ 🛵 🦽 🦼 🛺 🚲 🛴 🛹 🚏 🛣️ 🛤️ 🛢️ ⛽ 🚨 🚥 🚦 🛑 🚧 ⚓ ⛵ 🛶 🚤 🛳️ ⛴️ 🛥️ 🚢 ✈️ 🛩️ 🛫 🛬 🪂 💺 🚁 🚟 🚠 🚡 🛰️ 🚀 🛸 🛎️ 🧳 🧭 ⌚ ⏰ ⏱️ ⏲️ 🕰️ 🕛 🕧 🕐 🕜 🕑 🕝 🕒 🕞 🕓 🕟 🕔 🕠 🕕 🕡 🕖 🕢 🕗 🕣 🕘 🕤 🕙 🕥 🕚 🕦"},{label:"物品",items:"📔 📕 📖 📗 📘 📙 📚 📒 📃 📜 📄 📰 🗞️ 📑 🔖 🏷️ 💰 🔍 🔎 💴 💵 💶 💷 💸 💳 🧾 💹 ✉️ 📧 📨 📩 📤 📥 📦 📫 📪 📬 📭 📮 🗳️ ✏️ ✒️ 🖋️ 🖊️ 🖌️ 🖍️ 📝 💼 📁 📂 🗂️ 📅 📆 🗒️ 🗓️ 📇 📈 📉 📊 📋 📌 📍 📎 🖇️ 📏 📐 ✂️ 🗃️ 🗄️ 🗑️ 🔒 🔓 🔏 🔐 🔑 🗝️ 🔨 🪓 ⛏️ ⚒️ 🛠️ 🗡️ ⚔️ 🔫 🏹 🛡️ 🔧 🔩 ⚙️ 🗜️ ⚖️ 🦯 🔗 ⛓️ 🧰 🧲 ⚗️ 🧪 🧫 🧬 🔬 🔭 📡 💉 🩸 💊 🩹 🩺 🚪 🛏️ 🛋️ 🪑 🚽 🚿 🛁 🪒 🧴 🧷 🧹 🧺 🧻 🧼 🧽 🧯 🛒 🚬 ⚰️ ⚱️ 💎 🔇 🔈 🔉 🔊 🔔 🔕 🔋 🔌 💻 🖥️ 🖨️ ⌨️ 🖱️ 🖲️ 📷 🧱"},{label:"符号",items:"💡 ✅ ☑️ ✔️ ❌ ❎ ❓ ❗ ❔ ❕ ⌛ ⏳ 💰 🆒 🆕 🆖 🅾️ 🆗 🆘 🈲 🉑 🈸 ⛔ 🚫 📵 ✳️ ✴️ ❇️ 🔟 🔠 🔡 🔢 🔣 🔤 🅰️ 🆎 🅱️ 🆑 🆒 🆓 ℹ️ 🆔 🆕 🆖 🅾️ 🆗 🅿️ 🆘 🆙 🆚 🈁 🈂️ 🔴 🟠 🟡 🟢 🔵 🟣 🟤 ⚫ ⚪ 🟥 🟧 🟨 🟩 🟦 🟪 🟫 🔶 🔷 🔸 🔹 🔺 🔻 💠 🔘 🔳 🔲 💌 💘 💝 💖 💗 💓 💞 💕 💟 ❣️ 💔 🤍 💯 💢 💥 💬 💤 ➰ ➿ 🔅 📴 ➡️ 🔃 🔄 🔙 🔚 🔛 🔝 🔀 🔁 🔂"}],qv=[{label:"网页",value:"web",icon:'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M867.62382187 81.79484409c53.52106667 0 96.93866667 43.37208853 96.93866666 96.89315627v664.0071104a102.4 102.4 0 0 1-102.4 102.4H161.83751147a102.4 102.4 0 0 1-102.4-102.4V178.64248889c0-53.52106667 43.37208853-96.93866667 96.8931552-96.93866667z m28.6264896 319.2604448H127.74968853v441.59431147c0 17.29422187 12.83413333 31.58471147 29.4912 33.8147552l4.64213334 0.31857813h700.23395626a34.13333333 34.13333333 0 0 0 34.13333334-34.13333333V401.05528889z m-34.13333334-250.99377813H161.88302187a34.13333333 34.13333333 0 0 0-34.13333334 34.13333333V332.74311076h768.50062294V184.19484409a34.13333333 34.13333333 0 0 0-34.13333334-34.13333333zM216.9059552 195.93671076a45.51111147 45.51111147 0 1 1 0 91.02222293 45.51111147 45.51111147 0 0 1 0-91.02222293z m136.53333333 0a45.51111147 45.51111147 0 1 1 0 91.02222293 45.51111147 45.51111147 0 0 1 0-91.02222293z" fill="#515151" p-id="6081"></path></svg>',validate:n=>n.startsWith("http://")||n.startsWith("https://")},{label:"哔哩哔哩",value:"bilibili",icon:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11.39 3.714h.5c.88.032 1.614.337 2.2.918.586.58.889 1.312.91 2.194v4.293c-.021.88-.324 1.615-.91 2.201-.586.586-1.32.889-2.2.91H4.11c-.88-.021-1.614-.324-2.2-.91-.586-.586-.889-1.32-.91-2.2V6.825c.021-.882.324-1.613.91-2.194.586-.58 1.32-.886 2.2-.918h.452l-.684-.653a.72.72 0 0 1-.218-.529.72.72 0 0 1 .218-.529l.015-.015a.763.763 0 0 1 .537-.218c.202 0 .38.072.537.218L6.63 3.59c.041.041.078.083.109.124h2.49a.487.487 0 0 1 .092-.124l1.665-1.602a.763.763 0 0 1 .536-.218c.203 0 .386.088.542.233a.691.691 0 0 1 .228.53.72.72 0 0 1-.217.528l-.685.653zm-7.28 1.51c-.434.01-.8.16-1.096.45-.295.29-.448.66-.458 1.105v4.387c.01.445.163.813.458 1.104.296.29.662.441 1.097.45h7.778c.435-.009.801-.16 1.097-.45.295-.29.448-.659.458-1.104V6.779c-.01-.446-.163-.814-.458-1.105a1.563 1.563 0 0 0-1.097-.45H4.111zm1.557 2.255c.217 0 .399.072.544.218a.809.809 0 0 1 .233.56v.684a.809.809 0 0 1-.233.56.736.736 0 0 1-.544.218.739.739 0 0 1-.545-.218.809.809 0 0 1-.233-.56v-.684c0-.218.075-.402.225-.553a.753.753 0 0 1 .553-.225zm4.666 0c.218 0 .4.072.545.218a.809.809 0 0 1 .233.56v.684a.809.809 0 0 1-.233.56.737.737 0 0 1-.545.218.739.739 0 0 1-.544-.218.809.809 0 0 1-.233-.56v-.684a.809.809 0 0 1 .233-.56.738.738 0 0 1 .544-.218z" fill="#07A3D7"/></svg>',validate(n){return/^https?:\/\/(www\.)?bilibili\.com\/video\/[a-zA-Z0-9]+/.test(n)},transformURL(n){const e=n.match(/\/video\/([a-zA-Z0-9]+)/)?.[1];return e?`https://player.bilibili.com/player.html?bvid=${e}`:""}},{label:"优酷",value:"youku",icon:'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M270.528 902.592c-82.688-45.952-104.576-161.984-43.072-232 26.688-30.208 214.592-142.784 229.632-137.344 17.088 5.504 7.488-.64-112.768-71.36-105.92-62.464-129.152-83.776-144.896-129.792-34.816-105.664 58.112-218.944 166.08-202.496 24.576 4.096 102.528 42.56 175.616 87.168 13.696 8.32 70.4 41.216 125.76 73.472 119.616 69.376 153.792 97.472 178.368 148.288 20.48 41.856 24.576 100.928 10.24 151.68-8.896 32.32-41.664 78.976-71.04 100.992l-19.2 14.4-33.408-19.2c-19.2-11.008-34.176-17.92-34.176-15.808 0 1.344 12.288 10.24 27.328 18.56 15.04 8.896 27.328 17.152 27.328 19.2 0 4.8-281.6 168.832-334.208 194.24-51.904 26.112-100.48 26.112-147.584 0z" fill="#018EFF"/><path d="M665.984 654.4c0-1.088-6.912-5.888-15.936-10.624-20.16-10.112-21.248-5.888-1.088 4.736 16.512 9.024 17.024 9.6 17.024 5.888zm-50.56 5.952c-8.448-7.424-55.744-33.408-55.744-30.72 0 2.56 53.632 35.008 58.432 35.52 1.024 0 0-2.112-2.688-4.8z" fill="#018EFF"/><path d="M673.472 653.44a4171.008 4171.008 0 0 0-126.336-72.768c-43.712-24.064-92.224-52.864-233.6-137.344C238.4 398.72 213.76 374.016 199.424 332.16c-34.816-105.664 58.048-218.944 166.016-202.496 24.576 4.096 102.4 42.56 175.552 87.168 13.632 8.32 70.336 41.216 125.632 73.472 114.112 65.92 146.88 92.032 170.752 133.184 47.872 81.728 29.44 195.008-40.96 257.472-13.632 11.648-27.968 21.248-32.768 21.248-4.8-.64-45.12-21.952-90.176-48.704z" fill="#FF396E"/><path d="M270.464 902.592A152.32 152.32 0 0 1 193.28 781.76c-6.144-76.8 21.184-115.328 130.496-179.84l75.136-44.608L568.96 630.08c93.568 39.808 172.8 72.064 176.256 72.064 4.096 0 6.784 2.048 6.784 5.504 0 5.504-273.216 165.44-334.016 194.944-51.84 26.112-100.352 26.112-147.52 0z" fill="#00BEFF"/></svg>',validate(n){return/^https?:\/\/v\.youku\.com\/v_show\/id_[a-zA-Z0-9]+/.test(n)},transformURL(n){const e=n.match(/\/id_([a-zA-Z0-9]+)/)?.[1];return e?`https://player.youku.com/embed/${e}`:""}},{label:"Figma",value:"figma",icon:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.324 8c0-1.475 1.2-2.675 2.675-2.675 1.475 0 2.675 1.2 2.675 2.675 0 1.475-1.2 2.675-2.675 2.675A2.678 2.678 0 0 1 8.324 8z" fill="#1ABCFE"/><path d="M3 13.325c0-1.475 1.2-2.675 2.675-2.675h2.65v2.675C8.325 14.8 7.125 16 5.65 16 4.175 16 3 14.8 3 13.325z" fill="#0ACF83"/><path d="M8.324 0v5.325H11c1.475 0 2.675-1.2 2.675-2.675C13.674 1.175 12.474 0 11 0H8.324z" fill="#FF7262"/><path d="M3 2.675C3 4.15 4.2 5.35 5.675 5.35h2.65V0H5.65C4.175 0 3 1.2 3 2.675z" fill="#F24E1E"/><path d="M3 8c0 1.475 1.2 2.675 2.675 2.675h2.65v-5.35H5.65C4.175 5.325 3 6.525 3 8z" fill="#A259FF"/></svg>',validate(n){return/^https?:\/\/www\.figma\.com\/file\/[a-zA-Z0-9]+/.test(n)},transformURL(n){const e=n.match(/\/file\/([a-zA-Z0-9]+)/)?.[1];return e?`https://www.figma.com/embed?embed_host=share&url=https://www.figma.com/file/${e}`:""}},{label:"墨刀",value:"mado",icon:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M2 3h2.715v4.752H2V3zm6.958 0H6.242v4.752h2.716V3zm4.582 0h-2.716v4.752h2.716V3zM9.107 14l-1.096-2.5a3.905 3.905 0 0 0 2.812-3.748h2.716A6.621 6.621 0 0 1 9.107 14z" fill="#F33"/></svg>',validate(n){return/^https?:\/\/modao\.cc\/app\/[a-zA-Z0-9]+/.test(n)},transformURL(n){return n}},{label:"腾讯视频",value:"tencent_video",icon:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5.314 14.541c-1.416-.025-1.71-1.416-1.964-3.16-.155-1.06-.182-2.155-.182-3.23 0-1.074.027-2.169.182-3.23.31-2.14.685-3.75 3.123-2.95 2.336.768 4.586 2.126 6.56 3.67.1.085.209.177.324.272.705.59 1.62 1.355 1.642 2.239-.021.882-.936 1.647-1.641 2.237-.115.096-.225.187-.324.274-1.975 1.543-4.225 2.901-6.561 3.67-.418.136-.774.203-1.08.208h-.08z" fill="#4396F7"/><path d="M2.98 13.143c-1.202-.029-1.527-.954-1.755-2.162l-.02-.1-.036-.206C1.025 9.847 1 8.991 1 8.152c0-.84.025-1.694.17-2.523l.036-.205.019-.1c.267-1.418.668-2.447 2.464-2.094-.151.487-.247 1.067-.339 1.692-.154 1.061-.181 2.156-.181 3.23 0 1.074.027 2.169.181 3.23.092.624.188 1.204.34 1.692a3.501 3.501 0 0 1-.592.07H2.98z" fill="#EF8E34"/><path fill-rule="evenodd" clip-rule="evenodd" d="M3.689 3.229c.125.025.256.055.395.094 2.181.6 4.28 1.66 6.124 2.866.66.483 1.812 1.16 1.834 1.962-.023.803-1.175 1.48-1.834 1.963-1.843 1.205-3.943 2.266-6.124 2.866-.139.038-.27.069-.395.094-.151-.488-.248-1.068-.338-1.693-.155-1.06-.182-2.156-.182-3.23 0-1.074.027-2.169.182-3.23.09-.62.185-1.197.335-1.683l.003-.009z" fill="#78E445"/><path d="M4.845 8.156c0-1.82.13-2.04.13-2.04.053-.234.18-.298.378-.241 0 0 .587.124 2.006.87 1.435.754 1.875 1.168 1.875 1.168.217.188.172.305 0 .483 0 0-.269.308-1.875 1.14-1.606.83-2.006.894-2.006.894-.239.056-.332-.015-.377-.24 0 0-.13-.21-.13-2.034z" fill="#fff"/></svg>',validate(n){return n.startsWith("https://modao.cc/proto/")},transformURL(n){const e=n.match(/\/cover\/[a-zA-Z0-9]+\/([a-zA-Z0-9]+)/)?.[1];return e?`https://v.qq.com/iframe/player.html?vid=${e}`:""}}],r5e={class:"w-[170px] flex flex-wrap gap-[10px]"},i5e=["onClick"],a5e=["innerHTML"],Nz=m.defineComponent({__name:"ordered-list",setup(n){const e=m.inject("editor"),t=m.ref(!1),r=m.ref("");m.watch(()=>t.value,a=>{if(a&&e.value){const{listType:o}=e.value.getAttributes("orderedList");r.value=o}});const i=a=>{const o=e.value?.chain().focus();e.value?.isActive("orderedList")?e.value.getAttributes("orderedList").listType===a?o?.toggleOrderedList().run():o?.updateAttributes("orderedList",{listType:a}).run():(o?.toggleOrderedList().run(),e.value?.chain().updateAttributes("orderedList",{listType:a}).run()),r.value=a,t.value=!1};return(a,o)=>(m.openBlock(),m.createBlock(il,{ico:"ordered-list",icoSize:16,text:"有序列表","hide-text":"",shortcut:"Ctrl+Shift+7","popup-visible":t.value,"onUpdate:popupVisible":o[0]||(o[0]=s=>t.value=s),"popup-type":"arrow",onMenuClick:o[1]||(o[1]=s=>m.unref(e)?.isEditable===!1?()=>{}:i(m.unref(Mz)[0].value))},{content:m.withCtx(()=>[m.createElementVNode("div",r5e,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(m.unref(Mz),(s,l)=>(m.openBlock(),m.createElementBlock("div",{key:l,class:m.normalizeClass(["w-[50px] h-[50px] cursor-pointer rounded-[3px] flex items-center justify-center border hover:bg-[#F5F5F5] overflow-hidden",{"border-[#333639]":r.value===s.value}]),onClick:u=>i(s.value)},[(m.openBlock(),m.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 44 44",innerHTML:s.code},null,8,a5e))],10,i5e))),128))])]),_:1},8,["popup-visible"]))}}),o5e={class:"w-[170px] flex flex-wrap gap-[10px]"},s5e=["onClick"],l5e=["innerHTML"],Dz=m.defineComponent({__name:"bullet-list",setup(n){const e=m.inject("editor"),t=m.ref(!1),r=m.ref("");m.watch(()=>t.value,a=>{if(a&&e.value){const{listType:o}=e.value.getAttributes("bulletList");r.value=o}});const i=a=>{const o=e.value?.chain().focus();e.value?.isActive("bulletList")?e.value.getAttributes("bulletList").listType===a?o?.toggleBulletList().run():o?.updateAttributes("bulletList",{listType:a}).run():(o?.toggleBulletList().run(),e.value?.chain().updateAttributes("bulletList",{listType:a}).run()),r.value=a,t.value=!1};return(a,o)=>(m.openBlock(),m.createBlock(il,{ico:"bullet-list",icoSize:16,text:"无序列表","hide-text":"",shortcut:"Ctrl+Shift+7","popup-visible":t.value,"onUpdate:popupVisible":o[0]||(o[0]=s=>t.value=s),"popup-type":"arrow",onMenuClick:o[1]||(o[1]=s=>m.unref(e)?.isEditable===!1?()=>{}:i(m.unref(Az)[0].value))},{content:m.withCtx(()=>[m.createElementVNode("div",o5e,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(m.unref(Az),(s,l)=>(m.openBlock(),m.createElementBlock("div",{key:l,class:m.normalizeClass(["w-[50px] h-[50px] cursor-pointer rounded-[3px] flex items-center justify-center border hover:bg-[#F5F5F5]",{"border-[#333639]":r.value===s.value}]),onClick:u=>i(s.value)},[(m.openBlock(),m.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 44 44",innerHTML:s.code},null,8,l5e))],10,s5e))),128))])]),_:1},8,["popup-visible"]))}}),Oz=m.defineComponent({__name:"text-indent",setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createBlock(An,{ico:"indent-right",text:"增加缩进",shortcut:"Tab","hide-text":"",onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.chain().focus().indent().run())}))}}),u5e=["disabled"],c5e={key:0,class:"text-[13px] text-[#333639] ml-[3px]"},f5e={class:"flex items-center justify-center w-full h-full"},d5e=["disabled"],h5e={class:"flex items-center gap-[4px] h-full"},p5e={key:0,class:"text-[13px] text-[#333639]"},wS=m.defineComponent({__name:"MenusDropdown",props:{ico:{default:""},icoSize:{default:16},text:{default:""},hideText:{type:Boolean,default:!1},forceEnabled:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},menuActive:{type:Boolean,default:!1},dropType:{default:"dropdown"},popupVisible:{type:Boolean,default:!1},maxHeight:{type:Boolean,default:!0}},emits:["update:popupVisible"],setup(n,{emit:e}){const t=m.useAttrs(),r=m.inject("editor"),i=n,a=e,o=m.computed({get:()=>i.popupVisible,set:l=>a("update:popupVisible",l)}),s=(...l)=>{t.onMenuClickThrough?t.onMenuClickThrough(...l):t.onMenuClick&&t.onMenuClick(...l)};return(l,u)=>{const c=m.resolveDirective("tooltip");return m.openBlock(),m.createElementBlock(m.Fragment,null,[n.dropType==="dropdown"?m.withDirectives((m.openBlock(),m.createElementBlock("button",m.mergeProps({key:0,class:["white-editor-tool-item white-editor-tool-drop-item flex items-center justify-center",{"is-show-text":!n.hideText,"is-active":n.menuActive&&m.unref(r)?.isEditable!==!1,"is-disabled":!n.forceEnabled&&(n.disabled||m.unref(r)?.isEditable===!1)}],disabled:!n.forceEnabled&&(n.disabled||m.unref(r)?.isEditable===!1)},m.unref(t)),[m.createElementVNode("div",{class:"flex items-center h-full",onClick:s},[m.createElementVNode("i",{class:m.normalizeClass(["w-iconfont",`icon-${n.ico}`]),style:m.normalizeStyle(`font-size: ${n.icoSize}px`)},null,6),n.hideText?m.createCommentVNode("",!0):(m.openBlock(),m.createElementBlock("p",c5e,m.toDisplayString(n.text),1))]),m.createVNode(js,{trigger:"click",value:o.value,"onUpdate:value":u[0]||(u[0]=f=>o.value=f),placement:"bottom",contentStyle:{padding:"6px 0",boxShadow:"0 6px 16px 0 rgba(0, 0, 0, 0.08)"},disabled:!n.forceEnabled&&(n.disabled||m.unref(r)?.isEditable===!1),hasClass:"flex items-center justify-center w-[13px] h-full hover:bg-[#d7d3d3] mr-[-6px] ml-[4px] w-arrow"},{content:m.withCtx(()=>[m.renderSlot(l.$slots,"content")]),default:m.withCtx(()=>[m.createElementVNode("span",f5e,[m.createElementVNode("i",{class:m.normalizeClass(["w-iconfont icon-bottom !text-[8px] transition-transform duration-200",o.value?"rotate-180":""])},null,2)])]),_:3},8,["value","disabled"])],16,u5e)),[[c,`${n.text}`]]):m.createCommentVNode("",!0),n.dropType==="select"?(m.openBlock(),m.createBlock(js,{key:1,trigger:"click",value:o.value,"onUpdate:value":u[1]||(u[1]=f=>o.value=f),placement:"bottom",contentStyle:{padding:"6px 0",boxShadow:"0 6px 16px 0 rgba(0, 0, 0, 0.08)"}},{content:m.withCtx(()=>[m.renderSlot(l.$slots,"content")]),default:m.withCtx(()=>[m.withDirectives((m.openBlock(),m.createElementBlock("button",m.mergeProps({class:["white-editor-tool-item white-editor-tool-drop-item flex items-center justify-center",{"is-show-text":!n.hideText,"is-active":n.menuActive&&m.unref(r)?.isEditable!==!1,"is-disabled":!n.forceEnabled&&(n.disabled||m.unref(r)?.isEditable===!1)}],disabled:!n.forceEnabled&&(n.disabled||m.unref(r)?.isEditable===!1)},m.unref(t)),[m.createElementVNode("div",h5e,[m.createElementVNode("i",{class:m.normalizeClass(["w-iconfont",`icon-${n.ico}`]),style:m.normalizeStyle(`font-size: ${n.icoSize}px`)},null,6),n.hideText?m.createCommentVNode("",!0):(m.openBlock(),m.createElementBlock("p",p5e,m.toDisplayString(n.text),1)),m.createElementVNode("i",{class:m.normalizeClass(["w-iconfont icon-bottom !text-[8px] transition-transform duration-200",o.value?"rotate-180":""])},null,2)])],16,d5e)),[[c,`${n.text}`]])]),_:3},8,["value"])):m.createCommentVNode("",!0)],64)}}}),v5e=["disabled"],g5e=["disabled"],m5e=["disabled"],y5e=["disabled"],b5e=["disabled"],XY=m.defineComponent({__name:"text-align",setup(n){const e=m.inject("editor"),t=m.ref(!1),r=m.computed(()=>!e.value||e.value.isActive({textAlign:"left"})?"left":e.value.isActive({textAlign:"center"})?"center":e.value.isActive({textAlign:"right"})?"right":e.value.isActive({textAlign:"justify"})?"justify":e.value.isActive({textAlign:"distributed"})?"distributed":"left"),i=a=>{switch(a){case"left":e.value?.can().chain().focus().setTextAlign("left").run()&&e.value.chain().focus().setTextAlign("left").run(),e.value?.can().chain().focus().setNodeAlign("flex-start").run()&&e.value.chain().focus().setNodeAlign("flex-start").run();break;case"center":e.value?.can().chain().focus().setTextAlign("center").run()&&e.value.chain().focus().setTextAlign("center").run(),e.value?.can().chain().focus().setNodeAlign("center").run()&&e.value.chain().focus().setNodeAlign("center").run();break;case"right":e.value?.can().chain().focus().setTextAlign("right").run()&&e.value.chain().focus().setTextAlign("right").run(),e.value?.can().chain().focus().setNodeAlign("flex-end").run()&&e.value.chain().focus().setNodeAlign("flex-end").run();break;case"justify":e.value?.can().chain().focus().setTextAlign("justify").run()&&e.value.chain().focus().setTextAlign("justify").run();break;case"distributed":e.value?.can().chain().focus().setTextAlign("distributed").run()&&e.value.chain().focus().setTextAlign("distributed").run();break}t.value=!1};return(a,o)=>(m.openBlock(),m.createBlock(wS,{ico:`align-${r.value}`,text:"对齐方式","hide-text":"",onMenuClick:o[5]||(o[5]=s=>m.unref(e)?.isEditable===!1?()=>{}:i(r.value)),"popup-visible":t.value,"onUpdate:popupVisible":o[6]||(o[6]=s=>t.value=s)},{content:m.withCtx(()=>[m.createElementVNode("div",{class:"px-[12px] py-[5px] flex items-center gap-2 text-[14px] hover:bg-[rgb(242,243,245)] cursor-pointer",onClick:o[0]||(o[0]=s=>i("left")),disabled:!m.unref(e)?.can().chain().focus().setTextAlign("left").run()&&!m.unref(e)?.can().chain().focus().setNodeAlign("left").run()},[...o[7]||(o[7]=[m.createElementVNode("i",{class:"w-iconfont icon-align-left"},null,-1),m.createTextVNode(" 左对齐 ",-1)])],8,v5e),m.createElementVNode("div",{class:"px-[12px] py-[5px] flex items-center gap-2 text-[14px] hover:bg-[rgb(242,243,245)] cursor-pointer",onClick:o[1]||(o[1]=s=>i("center")),disabled:!m.unref(e)?.can().chain().focus().setTextAlign("center").run()&&!m.unref(e)?.can().chain().focus().setNodeAlign("center").run()},[...o[8]||(o[8]=[m.createElementVNode("i",{class:"w-iconfont icon-align-center"},null,-1),m.createTextVNode(" 居中对齐 ",-1)])],8,g5e),m.createElementVNode("div",{class:"px-[12px] py-[5px] flex items-center gap-2 text-[14px] hover:bg-[rgb(242,243,245)] cursor-pointer",onClick:o[2]||(o[2]=s=>i("right")),disabled:!m.unref(e)?.can().chain().focus().setTextAlign("right").run()&&!m.unref(e)?.can().chain().focus().setNodeAlign("flex-end").run()},[...o[9]||(o[9]=[m.createElementVNode("i",{class:"w-iconfont icon-align-right"},null,-1),m.createTextVNode(" 右对齐 ",-1)])],8,m5e),m.createElementVNode("div",{class:"px-[12px] py-[5px] flex items-center gap-2 text-[14px] hover:bg-[rgb(242,243,245)] cursor-pointer",onClick:o[3]||(o[3]=s=>i("justify")),disabled:!m.unref(e)?.can().chain().focus().setTextAlign("justify").run()&&!m.unref(e)?.can().chain().focus().setNodeAlign("justify").run()},[...o[10]||(o[10]=[m.createElementVNode("i",{class:"w-iconfont icon-align-justify"},null,-1),m.createTextVNode(" 两端对齐 ",-1)])],8,y5e),m.createElementVNode("div",{class:"px-[12px] py-[5px] flex items-center gap-2 text-[14px] hover:bg-[rgb(242,243,245)] cursor-pointer",onClick:o[4]||(o[4]=s=>i("distributed")),disabled:!m.unref(e)?.can().chain().focus().setTextAlign("distributed").run()&&!m.unref(e)?.can().chain().focus().setNodeAlign("distributed").run()},[...o[11]||(o[11]=[m.createElementVNode("i",{class:"w-iconfont icon-align-distributed"},null,-1),m.createTextVNode(" 分散对齐 ",-1)])],8,b5e)]),_:1},8,["ico","popup-visible"]))}}),Iz=m.defineComponent({__name:"sub-script",setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createBlock(An,{ico:"sub-script",text:"下标",shortcut:"Ctrl+,","hide-text":"","menu-active":m.unref(e)?.isActive("subscript"),disabled:!m.unref(e)?.can().chain().focus().toggleSubscript().run(),onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.commands.toggleSubscript())},null,8,["menu-active","disabled"]))}}),Rz=m.defineComponent({__name:"sup-script",setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createBlock(An,{ico:"sup-script",text:"上标",shortcut:"Ctrl+.","hide-text":"","menu-active":m.unref(e)?.isActive("superscript"),disabled:!m.unref(e)?.can().chain().focus().toggleSuperscript().run(),onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.commands.toggleSuperscript())},null,8,["menu-active","disabled"]))}}),Lz=m.defineComponent({__name:"quote",setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createBlock(An,{ico:"quote",text:"引用",shortcut:"Ctrl+Shift+B","hide-text":"","menu-active":m.unref(e)?.isActive("blockquote"),disabled:!m.unref(e)?.can().chain().focus().toggleBlockquote().run(),onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.chain().focus().toggleBlockquote().run())},null,8,["menu-active","disabled"]))}}),Pz=m.defineComponent({__name:"code",setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createBlock(An,{ico:"code",text:"代码",shortcut:"Ctrl+E","hide-text":"","menu-active":m.unref(e)?.isActive("code"),disabled:!m.unref(e)?.can().chain().focus().toggleCode().run(),onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.chain().focus().toggleCode().run())},null,8,["menu-active","disabled"]))}}),x5e=["onClick"],Bz=m.defineComponent({__name:"line-height",setup(n){const e=m.inject("editor"),t=m.inject("options"),r=m.ref(!1),i=m.computed(()=>t.value.dicts?.lineHeights.map(o=>({label:o.label,value:o.value,active:e.value?.isActive({lineHeight:o.value})}))),a=({content:o,value:s})=>{o&&(e.value?.chain().focus().setLineHeight(s).run(),r.value=!1)};return(o,s)=>(m.openBlock(),m.createBlock(wS,{"drop-type":"select",ico:"line-height",text:"行高","hide-text":"","popup-visible":r.value,"onUpdate:popupVisible":s[0]||(s[0]=l=>r.value=l)},{content:m.withCtx(()=>[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(i.value,l=>(m.openBlock(),m.createElementBlock("div",{key:l.value,class:m.normalizeClass(["px-[12px] py-[5px] flex items-center gap-[4px] text-[14px] hover:bg-[rgb(242,243,245)] cursor-pointer",l.active?"!text-[#007bff] font-[500]":""]),onClick:u=>a({content:l.label,value:l.value})},m.toDisplayString(l.label),11,x5e))),128))]),_:1},8,["popup-visible"]))}}),Vz=m.defineComponent({__name:"undo",setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createBlock(An,{ico:"unde",text:"撤销",shortcut:"Ctrl+Z","hide-text":"",disabled:!m.unref(e)?.can().chain().focus().undo().run(),onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.chain().focus().undo().run())},null,8,["disabled"]))}}),zz=m.defineComponent({__name:"redo",setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createBlock(An,{ico:"redo",text:"重做",shortcut:"Ctrl+Y","hide-text":"",disabled:!m.unref(e)?.can().chain().focus().redo().run(),onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.chain().focus().redo().run())},null,8,["disabled"]))}}),Fz=m.defineComponent({__name:"format-painter",setup(n){const e=m.inject("editor"),t=r=>{if(e.value?.view?.painter?.enabled){e.value?.commands.unsetFormatPainter();return}e.value?.chain().focus().setFormatPainter(r).run()};return(r,i)=>(m.openBlock(),m.createBlock(An,{ico:"format-painter",text:"格式刷","menu-active":m.unref(e)?.view?.painter?.enabled,disabled:m.unref(e)?.state?.selection?.empty,"hide-text":"",onMenuClick:i[0]||(i[0]=a=>t(!0)),onDblclick:i[1]||(i[1]=a=>t(!1))},null,8,["menu-active","disabled"]))}}),$z=m.defineComponent({__name:"clear-format",setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createBlock(An,{ico:"clear-format",text:"清除格式","hide-text":"",onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.chain().focus().unsetAllMarks().run())}))}}),Hz=m.defineComponent({__name:"hard-break",setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createBlock(An,{ico:"hard-break",text:"换行","hide-text":"",shortcut:"Shift+Enter",onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.chain().focus().setHardBreak().run())}))}}),_5e=["checked"],S5e={class:"checkbox-label"},ZY=m.defineComponent({__name:"Checkbox",props:{value:{type:Boolean},disabled:{type:Boolean,default:!1}},emits:["update:value"],setup(n,{emit:e}){const t=n,r=e,i=a=>{t.disabled||r("update:value",a.target.checked)};return(a,o)=>(m.openBlock(),m.createElementBlock("label",{class:m.normalizeClass(["white-checkbox",{checked:n.value,disabled:n.disabled}]),onChange:o[0]||(o[0]=s=>i(s))},[o[1]||(o[1]=m.createElementVNode("span",{class:"checkbox-input"},null,-1)),m.createElementVNode("input",{class:"checkbox-original",type:"checkbox",checked:n.value},null,8,_5e),m.createElementVNode("span",S5e,[m.renderSlot(a.$slots,"default")])],34))}}),w5e={class:"w-full white-table-generator-content"},k5e={class:"text-[14px] font-[600] mb-[5px] user-select-none flex items-center justify-between"},T5e=["onMouseenter"],C5e=m.defineComponent({__name:"TableGenerator",emits:["insert","close"],setup(n,{emit:e}){const t=e,r=m.ref(!0),i=m.ref([]),a=()=>{if(!i.value.length)return;const[o,s]=i.value;t("insert",{row:o,col:s,checked:r.value})};return(o,s)=>(m.openBlock(),m.createElementBlock("div",w5e,[m.createElementVNode("div",k5e,[m.createElementVNode("span",null,"表格 "+m.toDisplayString(`${i.value[0]||0} * ${i.value[1]||0}`),1),m.createVNode(ZY,{value:r.value,"onUpdate:value":s[0]||(s[0]=l=>r.value=l)},{default:m.withCtx(()=>[...s[3]||(s[3]=[m.createTextVNode("包含表头",-1)])]),_:1},8,["value"])]),m.createElementVNode("table",{onMouseleave:s[1]||(s[1]=l=>i.value=[]),onClick:s[2]||(s[2]=l=>a())},[m.createElementVNode("tbody",null,[(m.openBlock(),m.createElementBlock(m.Fragment,null,m.renderList(10,l=>m.createElementVNode("tr",{key:l},[(m.openBlock(),m.createElementBlock(m.Fragment,null,m.renderList(10,u=>m.createElementVNode("td",{onMouseenter:c=>i.value=[l,u],key:u},[m.createElementVNode("div",{class:m.normalizeClass(["cell cursor-pointer",{active:i.value.length&&i.value[0]&&i.value[1]&&l<=i.value[0]&&u<=i.value[1]}])},null,2)],40,T5e)),64))])),64))])],32)]))}}),Gz=m.defineComponent({__name:"table",props:{hideText:{type:Boolean,default:!0}},setup(n){const e=m.inject("editor"),t=m.ref(!1),r=i=>{const{row:a,col:o,checked:s}=i;e.value?.chain().focus().insertTable({rows:a,cols:o,withHeaderRow:s}).run(),t.value=!1};return(i,a)=>(m.openBlock(),m.createBlock(il,{ico:"edit-table",icoSize:16,text:"插入表格","hide-text":n.hideText,"popup-visible":t.value,"onUpdate:popupVisible":a[0]||(a[0]=o=>t.value=o),"popup-type":"select"},{content:m.withCtx(()=>[m.createVNode(C5e,{onInsert:r})]),_:1},8,["hide-text","popup-visible"]))}}),Wo=m.defineComponent({__name:"Button",props:{checked:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},type:{default:"default"},size:{default:"normal"},first:{type:Boolean,default:!1},last:{type:Boolean,default:!1}},emits:["click"],setup(n,{emit:e}){const t=n,r=e,i=()=>{t.disabled||r("click")};return(a,o)=>(m.openBlock(),m.createElementBlock("button",{class:m.normalizeClass(["white-button",{disabled:n.disabled,checked:!n.disabled&&n.checked,default:!n.disabled&&n.type==="default",primary:!n.disabled&&n.type==="primary",checkbox:!n.disabled&&n.type==="checkbox",radio:!n.disabled&&n.type==="radio",small:n.size==="small",first:n.first,last:n.last}]),onClick:o[0]||(o[0]=s=>i())},[m.renderSlot(a.$slots,"default")],2))}}),E5e={class:"w-[250px]"},M5e={class:"flex justify-end mt-[10px] gap-[10px]"},Uz=m.defineComponent({__name:"link",props:{hideText:{type:Boolean,default:!0}},setup(n){const e=m.ref(""),t=m.ref(""),r=m.inject("editor"),i=m.ref(!1),a=()=>{r.value?.commands.setLink({href:e.value,target:"_blank"}),r.value?.chain().focus().insertContent(t.value).run(),i.value=!1},o=()=>{e.value="",t.value="",i.value=!1};return(s,l)=>(m.openBlock(),m.createBlock(il,{ico:"link",icoSize:16,text:"插入链接","hide-text":n.hideText,"popup-visible":i.value,"onUpdate:popupVisible":l[4]||(l[4]=u=>i.value=u),"popup-type":"select"},{content:m.withCtx(()=>[m.createElementVNode("div",E5e,[l[7]||(l[7]=m.createElementVNode("div",{class:"font-[500] text-[14px] mb-[5px]"},"链接到",-1)),m.createVNode(lm,{placeholder:"请输入网址",value:e.value,"onUpdate:value":l[0]||(l[0]=u=>e.value=u)},null,8,["value"]),l[8]||(l[8]=m.createElementVNode("div",{class:"font-[500] text-[14px] mb-[5px] mt-[10px]"},"显示文案",-1)),m.createVNode(lm,{placeholder:"请输入显示文案",value:t.value,"onUpdate:value":l[1]||(l[1]=u=>t.value=u)},null,8,["value"]),m.createElementVNode("div",M5e,[m.createVNode(Wo,{onClick:l[2]||(l[2]=u=>o())},{default:m.withCtx(()=>[...l[5]||(l[5]=[m.createTextVNode("取消",-1)])]),_:1}),m.createVNode(Wo,{type:"primary",onClick:l[3]||(l[3]=u=>a()),disabled:!e.value||!t.value},{default:m.withCtx(()=>[...l[6]||(l[6]=[m.createTextVNode(" 确定 ",-1)])]),_:1},8,["disabled"])])])]),_:1},8,["hide-text","popup-visible"]))}}),A5e=["onClick"],N5e={class:"icon"},zO=m.defineComponent({__name:"MenusSelect",props:{value:{},size:{default:""},options:{},disabled:{type:Boolean,default:!1},search:{type:Boolean,default:!1},searchLabel:{default:"搜索"},maxHeight:{type:Boolean,default:!0},maxWidth:{default:0}},emits:["update:value"],setup(n,{expose:e,emit:t}){const r=n,i=t,a=m.inject("editor"),o=m.ref(!1),s=m.ref(),l=m.ref(),u=m.ref(0),c=m.ref(""),f=m.computed(()=>r.options.find(b=>b.value===r.value)?.label||r.value||"请选择"),d=m.computed(()=>f.value==="请选择"),h=m.computed(()=>{if(!r.search||!c.value.trim())return r.options;const b=r.options.filter(_=>_.label.toLowerCase().indexOf(c.value.toLowerCase())!==-1);return b.length?b:r.options});m.watch(o,()=>{o.value?m.nextTick(()=>{l.value&&l.value.focus()}):c.value=""}),m.onBeforeUnmount(()=>{c.value=""});const p=()=>{s.value&&(u.value=r.maxWidth?Number(r.maxWidth):s.value.clientWidth)},v=new ResizeObserver(p);m.onMounted(()=>{s.value&&v.observe(s.value)}),m.onUnmounted(()=>{s.value&&v.unobserve(s.value)});const g=b=>{b.disabled||(i("update:value",b.value),o.value=!1)};return e({changePopoverVisible:b=>{o.value=b}}),(b,_)=>(m.openBlock(),m.createBlock(js,{class:"white-select-wrapper",trigger:"click",value:o.value,"onUpdate:value":_[0]||(_[0]=x=>o.value=x),placement:"bottom",contentStyle:{padding:0,boxShadow:"0 6px 16px 0 rgba(0, 0, 0, 0.08)"},disabled:n.disabled||m.unref(a)?.isEditable===!1},{content:m.withCtx(()=>[m.createElementVNode("div",{class:"white-options-wrapper",style:m.normalizeStyle({width:u.value+2+"px",maxHeight:n.maxHeight?"260px":"auto"})},[m.renderSlot(b.$slots,"main",{},()=>[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(h.value,(x,T)=>(m.openBlock(),m.createElementBlock("div",{class:m.normalizeClass(["option",{disabled:x.disabled,selected:x.value===n.value}]),key:T,onClick:k=>g(x)},m.toDisplayString(x.label),11,A5e))),128))])],4)]),default:m.withCtx(()=>[m.createElementVNode("div",{class:m.normalizeClass(["select border border-[#d9d9d9] !bg-[#fff]",{[n.size]:n.size,disabled:n.disabled||m.unref(a)?.isEditable===!1}]),ref_key:"selectRef",ref:s},[m.createElementVNode("div",{class:m.normalizeClass(["selector",{placeholder:d.value}])},m.toDisplayString(f.value),3),m.createElementVNode("div",N5e,[m.renderSlot(b.$slots,"icon",{},()=>[_[1]||(_[1]=m.createElementVNode("i",{class:"w-iconfont icon-bottom !text-[8px] transition-transform duration-200"},null,-1))])])],2)]),_:3},8,["value","disabled"]))}}),Wz=m.defineComponent({__name:"font-size",setup(n){const e=m.inject("editor"),t=m.computed(()=>e.value?.getAttributes("textStyle").fontSize||"14px");return(r,i)=>(m.openBlock(),m.createBlock(zO,{value:t.value,size:"small",options:m.unref(Fm),"onUpdate:value":i[0]||(i[0]=a=>m.unref(e)?.chain().focus().setFontSize(a).run())},null,8,["value","options"]))}}),jz=m.defineComponent({__name:"font-family",setup(n){const e=m.inject("editor"),t=[{label:"默认字体",value:null},{label:"华文宋体",value:"STSong"},{label:"华文仿宋",value:"STFangsong"},{label:"Arial",value:"Arial"},{label:"Times New Roman",value:"Times New Roman"},{label:"Verdana",value:"Verdana"},{label:"Helvetica",value:"Helvetica"},{label:"Tahoma",value:"Tahoma"},{label:"Georgia",value:"Georgia"},{label:"Comic Sans MS",value:"Comic Sans MS"},{label:"Impact",value:"Impact"}],r=m.computed(()=>e.value?.getAttributes("textStyle").fontFamily||null);return(i,a)=>(m.openBlock(),m.createBlock(zO,{class:"w-[120px]",size:"small",value:r.value,options:t,"onUpdate:value":a[0]||(a[0]=o=>m.unref(e)?.chain().focus().setFontFamily(o).run())},null,8,["value"]))}}),D5e=["onClick"],O5e=m.defineComponent({__name:"font-heading",setup(n){const e=m.inject("editor"),t=m.ref(),r=m.computed(()=>{const a=o=>e.value?.isActive("heading",{level:o});if(e.value){if(e.value?.isActive("paragraph"))return"paragraph";if(a(1))return"1";if(a(2))return"2";if(a(3))return"3";if(a(4))return"4";if(a(5))return"5";if(a(6))return"6"}return""}),i=a=>{a==="paragraph"?e.value?.chain().focus().setParagraph().run():e.value?.chain().focus().toggleHeading({level:Number(a)}).run(),t.value.changePopoverVisible(!1)};return(a,o)=>(m.openBlock(),m.createBlock(zO,{value:r.value,size:"small",options:m.unref(JM),"max-width":100,ref_key:"selectRef",ref:t},{main:m.withCtx(()=>[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(m.unref(JM),(s,l)=>(m.openBlock(),m.createElementBlock("div",{key:l,class:m.normalizeClass(["white-heading-wrapper cursor-pointer",{selected:s.value===r.value,[s.element]:!0}]),onClick:u=>i(s.value)},m.toDisplayString(s.label),11,D5e))),128))]),_:1},8,["value","options"]))}}),I5e=m.defineComponent({__name:"Modal",props:{visible:{type:Boolean},width:{default:480},closeButton:{type:Boolean,default:!1},closeOnClickMask:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0},contentStyle:{}},emits:["update:visible","closed"],setup(n,{emit:e}){const t=n,r=m.ref(),i=e,a=m.ref(!1),o=m.computed(()=>({width:t.width+"px",...t.contentStyle||{}}));m.watch(()=>t.visible,()=>{t.visible&&m.nextTick(()=>r.value.focus())});const s=()=>{i("update:visible",!1),i("closed")},l=()=>{t.visible&&t.closeOnEsc&&s()},u=()=>{t.closeOnClickMask&&s()};return(c,f)=>(m.openBlock(),m.createBlock(m.Teleport,{to:"body"},[m.createVNode(m.Transition,{name:"modal-fade"},{default:m.withCtx(()=>[m.withDirectives(m.createElementVNode("div",{class:"white-modal-wrapper white-editor-namespace",ref_key:"modalRef",ref:r,tabindex:"-1",onKeyup:f[3]||(f[3]=m.withKeys(d=>l(),["esc"])),onClick:f[4]||(f[4]=m.withModifiers(d=>u(),["self"]))},[m.createVNode(m.Transition,{name:"modal-zoom",onAfterLeave:f[1]||(f[1]=d=>a.value=!1),onBeforeEnter:f[2]||(f[2]=d=>a.value=!0)},{default:m.withCtx(()=>[m.withDirectives(m.createElementVNode("div",{class:"modal-content",style:m.normalizeStyle(o.value)},[n.closeButton?(m.openBlock(),m.createElementBlock("span",{key:0,class:"close-btn",onClick:f[0]||(f[0]=d=>s())},[...f[5]||(f[5]=[m.createElementVNode("i",{class:"w-iconfont icon-close"},null,-1)])])):m.createCommentVNode("",!0),a.value?m.renderSlot(c.$slots,"default",{key:1}):m.createCommentVNode("",!0)],4),[[m.vShow,n.visible]])]),_:3})],544),[[m.vShow,n.visible]])]),_:3})]))}}),R5e={class:"white-editor-table-content"},L5e=["id","onFocus","onBlur","onPaste"],qz=30,Kz=15,P5e=m.defineComponent({__name:"ChartData",props:{type:{},data:{}},emits:["updateData"],setup(n,{expose:e,emit:t}){const r=n,i=m.ref([0,0]),a=m.ref(null),o=m.ref("bar"),s=()=>{o.value=r.type;const p=[],{labels:v,legends:g,series:y}=r.data,b=v.length,_=y.length;p.push(["",...g]);for(let x=0;x<b;x++){const T=[v[x]];for(let k=0;k<_;k++)T.push(y[k][x]+"");p.push(T)}for(let x=0;x<b+1;x++)for(let T=0;T<_+1;T++){const k=document.querySelector(`#cell-${x}-${T}`);k&&(k.value=p[x][T]+"")}i.value=[_+1,b+1]},l=(p,v)=>{if(p===0||v===0)return;const g=document.querySelector(`#cell-${p}-${v}`);g&&g.value&&(/^[0-9]+$/.test(g.value)||(g.value="0"))},u=()=>{if(!a.value)return;const[p,v]=a.value,g=document.querySelector(`#cell-${p+1}-${v}`);g&&g.focus()},c=p=>{p.key.toUpperCase()===YY.ENTER&&u()},f=t;m.onMounted(()=>{s(),document.addEventListener("keydown",c)}),m.onBeforeUnmount(()=>{f("updateData",d()),document.removeEventListener("keydown",c)});const d=()=>{const p=[];let v=[],g=[];for(let y=1;y<qz;y++){const b=document.querySelector(`#cell-${y}-0`);b&&b.value&&p.push({rowIndex:y,value:b.value})}for(let y=1;y<Kz;y++){const b=document.querySelector(`#cell-0-${y}`);if(b&&b.value){v.push(b.value);const _=[];for(let x=0;x<p.length;x++){const T=document.querySelector(`#cell-${p[x].rowIndex}-${y}`);let k=0;T&&T.value&&+T.value&&(k=+T.value),_.push(k)}g.push(_)}}return o.value==="scatter"&&(v.length>2&&(v=v.slice(0,2),g=g.slice(0,2)),v.length<2&&(v.push("Y"),g.push(g[0]))),(o.value==="ring"||o.value==="pie")&&v.length>1&&(v=v.slice(0,1),g=g.slice(0,1)),{data:{labels:p.map(y=>y.value),legends:v,series:g},type:o.value}},h=(p,v,g)=>{p.preventDefault(),console.log("handlePaste",p.clipboardData,v,g),p.clipboardData};return e({getTableData:d,initData:s}),(p,v)=>(m.openBlock(),m.createElementBlock("div",R5e,[m.createElementVNode("table",null,[m.createElementVNode("tbody",null,[(m.openBlock(),m.createElementBlock(m.Fragment,null,m.renderList(qz,g=>m.createElementVNode("tr",{key:g},[(m.openBlock(),m.createElementBlock(m.Fragment,null,m.renderList(Kz,y=>m.createElementVNode("td",{key:y,class:m.normalizeClass({head:y===1&&g<=i.value[1]||g===1&&y<=i.value[0]})},[g===1&&y===1?m.createCommentVNode("",!0):(m.openBlock(),m.createElementBlock("input",{key:0,class:m.normalizeClass(["item",{selected:g<=i.value[1]&&y<=i.value[0]}]),id:`cell-${g-1}-${y-1}`,autocomplete:"off",onFocus:b=>a.value=[g-1,y-1],onBlur:b=>l(g-1,y-1),onPaste:b=>h(b,g-1,y-1)},null,42,L5e))],2)),64))])),64))])])]))}}),B5e={class:"w-full inline-flex items-center mb-[15px]"},V5e={class:"flex items-center gap-[1.2rem] h-[400px]"},z5e={class:"w-[55%] h-full border rounded-md p-2"},F5e={class:"flex-1 h-full border rounded-md p-4"},$5e={class:"flex items-center gap-[10px] mb-[10px]"},H5e={class:"flex items-center gap-[10px] mb-[10px]"},G5e={class:"flex items-center gap-[10px] mb-[10px]"},U5e={class:"flex items-center gap-[10px] mb-[10px]"},W5e={class:"flex items-center gap-[10px] mb-[10px]"},j5e={key:0,class:"w-full h-[400px] overflow-auto"},q5e={class:"flex items-center justify-end gap-[0.8rem] mt-6"},QM=m.defineComponent({__name:"echarts",props:{icon:{default:"chart"},text:{default:"插入图表"},isEdit:{type:Boolean,default:!1},hideText:{type:Boolean,default:!0}},setup(n){const e=n,t=m.inject("editor"),r=m.inject("options"),i=m.ref(!1),a=m.ref("type"),o=m.ref(1),s=m.ref(null),l=m.ref(),u=m.ref({data:[],config:{seriesType:"bar",legendorient:"horizontal",titleText:"",legend:!1,legendleft:"center",legendlocation:"top",titleleft:"left"}});let c=null;const f=async()=>{if(i.value=!0,a.value="type",e.isEdit){if(s.value=Fl(t.value),s.value?.type?.name!=="echarts"||(h(),!s.value.attrs?.chartConfig))return;const x=s.value.attrs?.chartConfig;u.value=JSON.parse(JSON.stringify(x)),console.log("chartConfig",u.value),await m.nextTick(),d()}else h(),await m.nextTick(),d()},d=async()=>{if(await m.nextTick(),c=TE(l.value),!u.value.data){console.log("图表数据为空");return}const x=iH(JSON.parse(JSON.stringify(u.value.data)),JSON.parse(JSON.stringify(u.value.config)),r.value);try{c.setOption(x)}catch(T){console.log("图表渲染错误:",T),y()}},h=()=>{u.value.config.seriesType="bar",u.value.config.legend=!0,u.value.config.legendorient="horizontal",u.value.config.legendlocation="top",u.value.config.legendleft="center",u.value.config.titleText="",u.value.config.titleleft="left",u.value.data=Ez[u.value.config.seriesType]},p=x=>{u.value.data=Ez[x]},v=x=>{u.value.data=x.data},g=x=>{a.value=x,x==="type"&&b()},y=()=>{c!==null&&(c.dispose(),c=null)},b=async()=>{try{y(),await m.nextTick(),await d()}catch(x){console.log("图表配置错误:",x)}},_=()=>{const x={id:"",name:"",mode:o.value,chartOptions:null,chartConfig:null,nodeAlign:"center",margin:{}};e.isEdit?x.id=s.value.attrs.id:x.id=ip(),x.chartConfig=JSON.parse(JSON.stringify({data:u.value.data,config:u.value.config})),e.isEdit?t.value.commands.updateEcharts(x):t.value.commands.setEcharts(x),i.value=!1};return m.onMounted(()=>{}),(x,T)=>(m.openBlock(),m.createElementBlock(m.Fragment,null,[m.createVNode(An,{ico:n.icon,text:n.text,"hide-text":n.hideText,onMenuClick:f},null,8,["ico","text","hide-text"]),m.createVNode(I5e,{visible:i.value,"onUpdate:visible":T[8]||(T[8]=k=>i.value=k),closeButton:"",width:800},{default:m.withCtx(()=>[T[17]||(T[17]=m.createElementVNode("div",{class:"w-full mb-6 font-[500] text-[18px]"},"图表配置",-1)),m.createElementVNode("div",B5e,[m.createElementVNode("span",{class:m.normalizeClass(["px-3 py-2 bg-[#f5f5f5] text-[#333] cursor-pointer rounded-l-md",{"!bg-[#007bff] !text-[#fff]":a.value==="type"}]),onClick:T[0]||(T[0]=k=>g("type"))}," 图表类型 ",2),m.createElementVNode("span",{class:m.normalizeClass(["px-3 py-2 bg-[#f5f5f5] text-[#333] cursor-pointer rounded-r-md",{"!bg-[#007bff] !text-[#fff]":a.value==="data"}]),onClick:T[1]||(T[1]=k=>g("data"))}," 图表数据 ",2)]),m.withDirectives(m.createElementVNode("div",V5e,[m.createElementVNode("div",z5e,[m.createElementVNode("div",{ref_key:"chartRef",ref:l,class:"w-full h-full"},null,512)]),m.createElementVNode("div",F5e,[m.createElementVNode("div",$5e,[T[9]||(T[9]=m.createElementVNode("span",{class:"flex-shrink-0"},"图表类型:",-1)),m.createVNode(wg,{value:u.value.config.seriesType,"onUpdate:value":T[2]||(T[2]=k=>u.value.config.seriesType=k),options:[{label:"柱状图",value:"bar"},{label:"折线图",value:"line"},{label:"曲线图",value:"smooth"},{label:"饼图",value:"pie"},{label:"环形图",value:"ring"},{label:"面积图",value:"area"},{label:"散点图",value:"scatter"},{label:"雷达图",value:"radar"}],maxHeight:!1,onChange:p,class:"flex-1"},null,8,["value"])]),m.createElementVNode("div",H5e,[T[10]||(T[10]=m.createElementVNode("span",{class:"flex-shrink-0"},"标题名称:",-1)),m.createVNode(lm,{value:u.value.config.titleText,"onUpdate:value":T[3]||(T[3]=k=>u.value.config.titleText=k),placeholder:"请输入标题名称",class:"flex-1"},null,8,["value"])]),m.createElementVNode("div",G5e,[m.createVNode(ZY,{value:u.value.config.legend,"onUpdate:value":T[4]||(T[4]=k=>u.value.config.legend=k),class:"flex-shrink-0"},{default:m.withCtx(()=>[...T[11]||(T[11]=[m.createTextVNode(" 显示图例 ",-1)])]),_:1},8,["value"])]),u.value.config.legend?(m.openBlock(),m.createElementBlock(m.Fragment,{key:0},[m.createElementVNode("div",U5e,[T[12]||(T[12]=m.createElementVNode("span",{class:"flex-shrink-0"},"横向位置:",-1)),m.createVNode(wg,{value:u.value.config.legendleft,"onUpdate:value":T[5]||(T[5]=k=>u.value.config.legendleft=k),options:[{label:"左侧",value:"left"},{label:"居中",value:"center"},{label:"右侧",value:"right"}],class:"flex-1"},null,8,["value"])]),m.createElementVNode("div",W5e,[T[13]||(T[13]=m.createElementVNode("span",{class:"flex-shrink-0"},"纵向位置:",-1)),m.createVNode(wg,{value:u.value.config.legendlocation,"onUpdate:value":T[6]||(T[6]=k=>u.value.config.legendlocation=k),options:[{label:"顶部",value:"top"},{label:"底部",value:"bottom"}],class:"flex-1"},null,8,["value"])])],64)):m.createCommentVNode("",!0),m.createVNode(Wo,{type:"primary",onClick:b,size:"small",class:"w-full"},{default:m.withCtx(()=>[...T[14]||(T[14]=[m.createTextVNode("预览",-1)])]),_:1})])],512),[[m.vShow,a.value==="type"]]),a.value==="data"?(m.openBlock(),m.createElementBlock("div",j5e,[m.createVNode(P5e,{type:u.value.config.seriesType,data:u.value.data,onUpdateData:v},null,8,["type","data"])])):m.createCommentVNode("",!0),m.createElementVNode("div",q5e,[m.createVNode(Wo,{onClick:T[7]||(T[7]=k=>i.value=!1)},{default:m.withCtx(()=>[...T[15]||(T[15]=[m.createTextVNode("取消",-1)])]),_:1}),m.createVNode(Wo,{type:"primary",onClick:_},{default:m.withCtx(()=>[...T[16]||(T[16]=[m.createTextVNode("确定",-1)])]),_:1})])]),_:1},8,["visible"])],64))}}),Yz=m.defineComponent({__name:"text-outdent",setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createBlock(An,{ico:"indent-left",text:"减少缩进",shortcut:"Shift+Tab","hide-text":"",onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.chain().focus().outdent().run())}))}}),Kp=m.defineComponent({__name:"align-center",setup(n){const e=m.inject("editor"),t=()=>{e.value?.can().chain().focus().setTextAlign("center").run()&&e.value.chain().focus().setTextAlign("center").run(),e.value?.can().chain().focus().setNodeAlign("center").run()&&e.value.chain().focus().setNodeAlign("center").run()};return(r,i)=>(m.openBlock(),m.createBlock(An,{ico:"align-center",shortcut:"Ctrl+Shift+E",text:"居中对齐","hide-text":"","menu-active":m.unref(e)?.isActive({textAlign:"center"})||m.unref(e)?.isActive({nodeAlign:"center"}),disabled:!m.unref(e)?.can().chain().focus().setTextAlign("center").run()&&!m.unref(e)?.can().chain().focus().setNodeAlign("center").run(),onMenuClick:t},null,8,["menu-active","disabled"]))}}),Yp=m.defineComponent({__name:"align-right",setup(n){const e=m.inject("editor"),t=()=>{e.value?.can().chain().focus().setTextAlign("right").run()&&e.value.chain().focus().setTextAlign("right").run(),e.value?.can().chain().focus().setNodeAlign("flex-end").run()&&e.value.chain().focus().setNodeAlign("flex-end").run()};return(r,i)=>(m.openBlock(),m.createBlock(An,{ico:"align-right",text:"右对齐",shortcut:"Ctrl+Shift+R","hide-text":"","menu-active":m.unref(e)?.isActive({textAlign:"right"})||m.unref(e)?.isActive({nodeAlign:"flex-end"}),disabled:!m.unref(e)?.can().chain().focus().setTextAlign("right").run()&&!m.unref(e)?.can().chain().focus().setNodeAlign("flex-end").run(),onMenuClick:t},null,8,["menu-active","disabled"]))}}),Xp=m.defineComponent({__name:"align-left",setup(n){const e=m.inject("editor"),t=()=>{e.value?.can().chain().focus().setTextAlign("left").run()&&e.value.chain().focus().setTextAlign("left").run(),console.log(e.value?.can().chain().focus().setNodeAlign("flex-start").run(),"22222"),e.value?.can().chain().focus().setNodeAlign("flex-start").run()&&e.value.chain().focus().setNodeAlign("flex-start").run()};return(r,i)=>(m.openBlock(),m.createBlock(An,{ico:"align-left",text:"左对齐",shortcut:"Ctrl+Shift+L","hide-text":"","menu-active":m.unref(e)?.isActive({textAlign:"left"})||m.unref(e)?.isActive({nodeAlign:"flex-start"}),disabled:!m.unref(e)?.can().chain().focus().setTextAlign("left").run()&&!m.unref(e)?.can().chain().focus().setNodeAlign("left").run(),onMenuClick:t},null,8,["menu-active","disabled"]))}}),K5e=m.defineComponent({__name:"align-justify",setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createBlock(An,{ico:"align-justify",text:"两端对齐",shortcut:"Ctrl+Shift+J","hide-text":"","menu-active":m.unref(e)?.isActive({textAlign:"justify"}),disabled:!m.unref(e)?.can().chain().focus().setTextAlign("justify").run(),onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.chain().focus().setTextAlign("justify").run())},null,8,["menu-active","disabled"]))}}),Y5e=m.defineComponent({__name:"align-distributed",setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createBlock(An,{ico:"align-distributed",text:"分散对齐",shortcut:"Ctrl+Shift+D","hide-text":"","menu-active":m.unref(e)?.isActive({textAlign:"distributed"}),disabled:!m.unref(e)?.can().chain().focus().setTextAlign("distributed").run(),onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.chain().focus().setTextAlign("distributed").run())},null,8,["menu-active","disabled"]))}}),X5e=m.defineComponent({__name:"size-increase",setup(n){const e=m.inject("editor"),t=i=>{e.value?.chain().focus().setFontSize(i).run()},r=()=>{const{fontSize:i}=e.value?.getAttributes("textStyle")??{};if(i){const a=Fm.find(({value:s})=>s===i);if(!a)return;const o=Fm.find(({order:s})=>s===a.order+1);o&&t(o.value)}else t("16px")};return(i,a)=>(m.openBlock(),m.createBlock(An,{ico:"size-increase",text:"增大字体","hide-text":"",onMenuClick:r}))}}),Z5e=m.defineComponent({__name:"size-decrease",setup(n){const e=m.inject("editor"),t=i=>{e.value?.chain().focus().setFontSize(i).run()},r=()=>{const{fontSize:i}=e.value?.getAttributes("textStyle")??{};if(i){const a=Fm.find(({value:s})=>s===i);if(console.log(i,a),!a)return;const o=Fm.find(({order:s})=>s===a.order-1);o&&t(o.value)}else t("14px")};return(i,a)=>(m.openBlock(),m.createBlock(An,{ico:"size-decrease",text:"减小字体","hide-text":"",onMenuClick:r}))}}),J5e={class:"p-[5px] bg-[#f3f4f6] rounded-[5px]"},Q5e={class:"w-[240px] h-[50px] white-no-scrollbar overflow-x-auto"},eBe=["onClick"],tBe={class:"font-[500]"},nBe={class:"text-[12px] text-[#737373]"},rBe=m.defineComponent({__name:"heading",setup(n){const e=m.inject("editor"),t=m.computed(()=>{const i=a=>e.value?.isActive("heading",{level:a});if(e.value){if(e.value?.isActive("paragraph"))return"paragraph";if(i(1))return"1";if(i(2))return"2";if(i(3))return"3";if(i(4))return"4";if(i(5))return"5";if(i(6))return"6"}return""}),r=i=>{e.value?.isEditable!==!1&&(i==="paragraph"?e.value?.chain().focus().setParagraph().run():e.value?.chain().focus().toggleHeading({level:Number(i)}).run())};return(i,a)=>(m.openBlock(),m.createElementBlock("div",J5e,[m.createElementVNode("div",Q5e,[m.createElementVNode("div",{class:m.normalizeClass(["flex items-center w-max h-full",{"opacity-50 cursor-not-allowed":m.unref(e)?.isEditable===!1}])},[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(m.unref(JM),o=>(m.openBlock(),m.createElementBlock("div",{key:o.value,class:m.normalizeClass(["w-[80px] h-full flex flex-col gap-[2px] items-center justify-center cursor-pointer flex-shrink-0 rounded-[5px]",{"bg-[#fff]":t.value===o.value,"cursor-not-allowed":m.unref(e)?.isEditable===!1}]),onClick:s=>r(o.value)},[m.createElementVNode("div",tBe,m.toDisplayString(o.label),1),m.createElementVNode("div",nBe,m.toDisplayString(o.element==="p"?"段落":o.element),1)],10,eBe))),128))],2)])]))}}),iBe={class:"text-[14px]"},iu=m.defineComponent({__name:"MenusCheck",props:{ico:{default:""},text:{default:""},disabled:{type:Boolean,default:!1}},setup(n){const e=m.useAttrs(),t=(...r)=>{e.onMenuClickThrough?e.onMenuClickThrough(...r):e.onMenuClick&&e.onMenuClick(...r)};return(r,i)=>(m.openBlock(),m.createElementBlock("div",m.mergeProps({class:"w-check-item w-full rounded-[4px] hover:bg-[#edeef2] px-2 py-[0.3rem] inline-flex items-center gap-2 cursor-pointer"},m.unref(e),{onClick:t}),[m.createElementVNode("i",{class:m.normalizeClass(["w-iconfont",`icon-${n.ico}`])},null,2),m.createElementVNode("div",iBe,m.toDisplayString(n.text),1)],16))}}),aBe=m.defineComponent({__name:"image",props:{hideText:{type:Boolean,default:!0},isInset:{type:Boolean,default:!1}},setup(n){const e=m.inject("editor"),t=m.inject("uploadFileMap"),r=i=>{e.value?.chain().focus().selectFiles(i,t.value).run()};return(i,a)=>n.isInset?(m.openBlock(),m.createBlock(iu,{key:1,ico:"image",text:"图片",onMenuClick:a[1]||(a[1]=o=>r("image"))})):(m.openBlock(),m.createBlock(An,{key:0,ico:"image",text:"插入图片","hide-text":n.hideText,onMenuClick:a[0]||(a[0]=o=>r("image"))},null,8,["hide-text"]))}}),oBe=m.defineComponent({__name:"audio",props:{isInset:{type:Boolean,default:!1}},setup(n){const e=m.inject("editor"),t=m.inject("uploadFileMap");return(r,i)=>n.isInset?(m.openBlock(),m.createBlock(iu,{key:1,ico:"audio",text:"音频",onMenuClick:i[1]||(i[1]=a=>m.unref(e)?.chain().focus().selectFiles("audio",m.unref(t)).run())})):(m.openBlock(),m.createBlock(An,{key:0,ico:"audio",text:"插入音频","hide-text":"",onMenuClick:i[0]||(i[0]=a=>m.unref(e)?.chain().focus().selectFiles("audio",m.unref(t)).run())}))}}),sBe=m.defineComponent({__name:"video",props:{isInset:{type:Boolean,default:!1}},setup(n){const e=m.inject("editor"),t=m.inject("uploadFileMap");return(r,i)=>n.isInset?(m.openBlock(),m.createBlock(iu,{key:1,ico:"video",text:"视频",onMenuClick:i[1]||(i[1]=a=>m.unref(e)?.chain().focus().selectFiles("video",m.unref(t)).run())})):(m.openBlock(),m.createBlock(An,{key:0,ico:"video",text:"插入视频","hide-text":"",onMenuClick:i[0]||(i[0]=a=>m.unref(e)?.chain().focus().selectFiles("video",m.unref(t)).run())}))}}),lBe=m.defineComponent({__name:"tag",props:{isInset:{type:Boolean,default:!1}},setup(n){const e=m.inject("editor");return(t,r)=>n.isInset?(m.openBlock(),m.createBlock(iu,{key:1,ico:"tag",text:"标签",onMenuClick:r[1]||(r[1]=i=>m.unref(e)?.chain().focus().insertTag().run())})):(m.openBlock(),m.createBlock(An,{key:0,ico:"tag",text:"插入标签","hide-text":"",onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.chain().focus().insertTag().run())}))}}),uBe=m.defineComponent({__name:"file",props:{hideText:{type:Boolean,default:!0},isInset:{type:Boolean,default:!1}},setup(n){const e=m.inject("editor"),t=m.inject("uploadFileMap");return(r,i)=>n.isInset?(m.openBlock(),m.createBlock(iu,{key:1,ico:"add-file",text:"文件",onMenuClick:i[1]||(i[1]=a=>m.unref(e)?.chain().focus().selectFiles("file",m.unref(t)).run())})):(m.openBlock(),m.createBlock(An,{key:0,ico:"add-file",text:"插入文件","hide-text":n.hideText,onMenuClick:i[0]||(i[0]=a=>m.unref(e)?.chain().focus().selectFiles("file",m.unref(t)).run())},null,8,["hide-text"]))}}),cBe=m.defineComponent({__name:"data-time",props:{isInset:{type:Boolean,default:!1}},setup(n){const e=i=>zue(Que(),i).value,t=m.inject("editor"),r=({content:i,format:a,capitalize:o,value:s})=>{i&&t.value?.chain().insertDatetime({text:i.includes("自定义")?`[${i}]`:i,date:e(a),withTime:s==="withTime",format:a,capitalize:o}).focus().run()};return(i,a)=>n.isInset?(m.openBlock(),m.createBlock(iu,{key:1,ico:"date",text:"日期",onMenuClick:a[1]||(a[1]=o=>r({content:e("YYYY年M月D日"),format:"YYYY-MM-DD HH:mm:ss",capitalize:!0,value:"withTime"}))})):(m.openBlock(),m.createBlock(An,{key:0,ico:"date",text:"插入日期",shortcut:"Ctrl+B","hide-text":"",onMenuClick:a[0]||(a[0]=o=>r({content:e("YYYY年M月D日"),format:"YYYY-MM-DD HH:mm:ss",capitalize:!0,value:"withTime"}))}))}}),fBe=m.defineComponent({__name:"divider",props:{isInset:{type:Boolean,default:!1}},setup(n){const e=m.inject("editor");return(t,r)=>n.isInset?(m.openBlock(),m.createBlock(iu,{key:1,ico:"divider",text:"分隔线",onMenuClick:r[1]||(r[1]=i=>m.unref(e).chain().focus().setHr({type:"signle",color:"#000"}).run())})):(m.openBlock(),m.createBlock(An,{key:0,ico:"divider",text:"分隔线","hide-text":"",onMenuClick:r[0]||(r[0]=i=>m.unref(e).chain().focus().setHr({type:"signle",color:"#000"}).run())}))}}),dBe={class:"w-[310px] max-h-[400px] overflow-auto white-no-scrollbar"},hBe={class:"flex flex-wrap gap-[0.5rem]"},pBe=["onClick"],vBe=m.defineComponent({__name:"emoji-content",emits:["select"],setup(n,{emit:e}){const t=e,r=i=>{t("select",i)};return(i,a)=>(m.openBlock(),m.createElementBlock("div",dBe,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(m.unref(n5e),(o,s)=>(m.openBlock(),m.createElementBlock(m.Fragment,{key:s},[m.createElementVNode("div",{class:m.normalizeClass(["text-[12px] text-[#666] mb-[10px]",s!==0?"mt-[10px]":""])},m.toDisplayString(o.label),3),m.createElementVNode("div",hBe,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(o.items.split(" "),(l,u)=>(m.openBlock(),m.createElementBlock("div",{key:u,class:"text-[25px] w-[32px] h-[32px] rounded-[4px] cursor-pointer flex items-center justify-center hover:bg-[#f1f2f2]",onClick:c=>r(l)},m.toDisplayString(l),9,pBe))),128))])],64))),128))]))}}),gBe=m.defineComponent({__name:"emoji",props:{hideText:{type:Boolean,default:!0},onSelectEmoji:{type:Function,default:void 0}},setup(n){const e=n,t=m.inject("editor"),r=m.ref(!1),i=a=>{e.onSelectEmoji?e.onSelectEmoji(a):t.value?.chain().focus().insertContent(a).run(),r.value=!1};return(a,o)=>(m.openBlock(),m.createBlock(il,{ico:"emoji",icoSize:16,text:"插入表情","hide-text":n.hideText,"popup-visible":r.value,"onUpdate:popupVisible":o[0]||(o[0]=s=>r.value=s),"popup-type":"select",placement:"right",trigger:"mouseenter"},{content:m.withCtx(()=>[m.createVNode(vBe,{onSelect:i})]),default:m.withCtx(()=>[m.createElementVNode("div",{class:m.normalizeClass(["w-full rounded-[4px] hover:bg-[#edeef2] px-2 py-[0.3rem] inline-flex items-center justify-between cursor-pointer",{"bg-[#edeef2]":r.value}])},[...o[1]||(o[1]=[m.createElementVNode("span",{class:"inline-flex items-center gap-2"},[m.createElementVNode("i",{class:"w-iconfont icon-emoji"}),m.createElementVNode("span",{class:"text-[14px]"},"表情")],-1),m.createElementVNode("i",{class:"w-iconfont icon-right !text-[10px]"},null,-1)])],2)]),_:1},8,["hide-text","popup-visible"]))}}),mBe={class:"w-full text-center pb-2"},yBe={class:"w-[175px] h-[80px] flex items-center gap-[6px]"},bBe=["onMouseenter","onClick"],xBe=m.defineComponent({__name:"columns",setup(n){const e=m.inject("editor"),t=m.ref(!1),r=m.ref([1,2,3,4,5]),i=m.ref(0),a=s=>{i.value=s},o=s=>{e.value?.chain().focus().setColumns(s,!0).run(),e.value?.chain().focus().updateAttributes("columnBlock",{columnSize:s}).run(),t.value=!1};return(s,l)=>(m.openBlock(),m.createBlock(il,{ico:"column",icoSize:16,text:"插入分栏","hide-text":"","popup-visible":t.value,"onUpdate:popupVisible":l[0]||(l[0]=u=>t.value=u),"popup-type":"select",placement:"right",trigger:"mouseenter"},{content:m.withCtx(()=>[m.createElementVNode("div",mBe,m.toDisplayString(i.value)+" 分栏",1),m.createElementVNode("div",yBe,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(r.value,u=>(m.openBlock(),m.createElementBlock("div",{key:u,class:m.normalizeClass(["w-[30px] h-full bg-[rgba(23,26,29,0.06)] rounded-[4px] cursor-pointer flex-shrink-0",{"!bg-[#007bff]":i.value>=u}]),onMouseenter:c=>a(u),onClick:c=>o(u)},null,42,bBe))),128))])]),default:m.withCtx(()=>[m.createElementVNode("div",{class:m.normalizeClass(["w-full rounded-[4px] hover:bg-[#edeef2] px-2 py-[0.3rem] inline-flex items-center justify-between cursor-pointer",{"bg-[#edeef2]":t.value}])},[...l[1]||(l[1]=[m.createElementVNode("span",{class:"inline-flex items-center gap-2"},[m.createElementVNode("i",{class:"w-iconfont icon-column"}),m.createTextVNode(),m.createElementVNode("span",{class:"text-[14px]"},"分栏")],-1),m.createElementVNode("i",{class:"w-iconfont icon-right !text-[10px]"},null,-1)])],2)]),_:1},8,["popup-visible"]))}}),_Be=m.defineComponent({__name:"code-block",setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createBlock(iu,{ico:"code",text:"代码块",onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.chain().focus().setCodeBlock().run())}))}}),SBe=m.defineComponent({__name:"web-page",setup(n){const e=m.inject("editor"),t=()=>{e.value?.chain().focus().setParagraph().run(),e.value?.chain().focus().setIframe({type:"",src:""}).run()};return(r,i)=>(m.openBlock(),m.createBlock(iu,{ico:"web-page",text:"网页",onMenuClick:i[0]||(i[0]=a=>t())}))}}),wBe=["disabled"],kBe={class:"w-[110px]"},Xz=m.defineComponent({__name:"insert-menu",props:{hideText:{type:Boolean,default:!1}},setup(n){const e=m.ref(!1),t=m.inject("editor");return(r,i)=>{const a=m.resolveDirective("tooltip");return m.openBlock(),m.createBlock(il,{ico:"add-circle",icoSize:16,text:"插入元素","hide-text":n.hideText,"popup-visible":e.value,"onUpdate:popupVisible":i[0]||(i[0]=o=>e.value=o),"popup-type":"select"},{content:m.withCtx(()=>[m.createElementVNode("div",kBe,[m.createVNode(aBe,{isInset:!0}),m.createVNode(oBe,{isInset:!0}),m.createVNode(sBe,{isInset:!0}),m.createVNode(uBe,{isInset:!0}),m.createVNode(lBe,{isInset:!0}),m.createVNode(cBe,{isInset:!0}),m.createVNode(fBe,{isInset:!0}),m.createVNode(gBe),m.createVNode(xBe),m.createVNode(_Be),m.createVNode(SBe)])]),default:m.withCtx(()=>[n.hideText?m.withDirectives((m.openBlock(),m.createElementBlock("button",{key:0,disabled:m.unref(t)?.isEditable===!1,class:m.normalizeClass(["white-editor-tool-item flex items-center justify-center gap-[6px] px-[7px]",{"is-disabled":m.unref(t)?.isEditable===!1}])},[...i[1]||(i[1]=[m.createElementVNode("i",{class:"w-iconfont icon-add-circle"},null,-1),m.createElementVNode("span",{class:"text-[14px]"},"插入",-1)])],10,wBe)),[[a,"插入元素"]]):m.createCommentVNode("",!0)]),_:1},8,["hide-text","popup-visible"])}}}),Zz=m.defineComponent({__name:"task-list",setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createBlock(An,{ico:"task-list",text:"任务列表",shortcut:"Ctrl+Shift+9","hide-text":"","menu-active":m.unref(e)?.isActive("taskList"),disabled:!m.unref(e)?.can().chain().focus().toggleTaskList().run(),onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.chain().focus().toggleTaskList().run())},null,8,["menu-active","disabled"]))}}),TBe={class:"flex w-full h-full"},CBe={key:0,class:"inline-flex items-center mx-auto"},EBe={class:"pr-[20px] flex-shrink-0"},MBe={class:"space-y-[6px] px-[20px] border-r border-l"},ABe={class:"space-x-[5px] flex"},NBe={class:"space-x-[5px] flex"},DBe={class:"space-y-[6px] px-[20px] border-r"},OBe={class:"space-x-[8px] flex"},IBe={class:"space-x-[5px] flex"},RBe={class:"space-y-[6px] px-[20px] border-r"},LBe={class:"space-x-[5px] flex"},PBe={class:"space-x-[5px] flex"},BBe={class:"px-[20px] border-r"},VBe={class:"space-x-[6px] pl-[20px] flex"},zBe={key:1,class:"inline-flex items-center gap-[10px] mx-auto"},FBe={class:"px-4 inline-flex items-center"},$Be=m.defineComponent({__name:"index",setup(n){const e=m.inject("page");return(t,r)=>(m.openBlock(),m.createElementBlock("div",TBe,[m.createVNode(kPe,{ref:"scrollableRef",class:"flex-1 h-full p-[10px]"},{default:m.withCtx(()=>[m.unref(e).toolbar==="double"?(m.openBlock(),m.createElementBlock("div",CBe,[m.createElementVNode("div",EBe,[m.createVNode(Xz)]),m.createElementVNode("div",MBe,[m.createElementVNode("div",ABe,[m.createVNode(Vz),m.createVNode(zz)]),m.createElementVNode("div",NBe,[m.createVNode(Fz),m.createVNode($z)])]),m.createElementVNode("div",DBe,[m.createElementVNode("div",OBe,[m.createVNode(jz),m.createVNode(Wz),m.createVNode(X5e),m.createVNode(Z5e)]),m.createElementVNode("div",IBe,[m.createVNode(WM),m.createVNode(jM),m.createVNode(qM),m.createVNode(KM),m.createVNode(Rz),m.createVNode(Iz),m.createVNode(Tz),m.createVNode(Cz)])]),m.createElementVNode("div",RBe,[m.createElementVNode("div",LBe,[m.createVNode(Nz),m.createVNode(Dz),m.createVNode(Oz),m.createVNode(Yz),m.createVNode(Bz),m.createVNode(Zz)]),m.createElementVNode("div",PBe,[m.createVNode(Xp),m.createVNode(Kp),m.createVNode(Yp),m.createVNode(K5e),m.createVNode(Y5e),m.createVNode(Lz),m.createVNode(Pz),m.createVNode(Hz)])]),m.createElementVNode("div",BBe,[m.createVNode(rBe)]),m.createElementVNode("div",VBe,[m.createVNode(Gz,{hideText:!1}),m.createVNode(QM,{hideText:!1}),m.createVNode(Uz,{hideText:!1})])])):(m.openBlock(),m.createElementBlock("div",zBe,[m.createVNode(Xz,{hideText:!0}),m.createVNode(Vz),m.createVNode(zz),m.createVNode(Fz),m.createVNode($z),m.createVNode(O5e),m.createVNode(jz),m.createVNode(Wz),m.createVNode(WM),m.createVNode(jM),m.createVNode(qM),m.createVNode(KM),m.createVNode(Tz),m.createVNode(Cz),m.createVNode(Nz),m.createVNode(Dz),m.createVNode(Zz),m.createVNode(Oz),m.createVNode(Yz),m.createVNode(XY),m.createVNode(Bz),m.createVNode(Rz),m.createVNode(Iz),m.createVNode(Hz),m.createVNode(Lz),m.createVNode(Pz),m.createVNode(QM),m.createVNode(Gz),m.createVNode(Uz)]))]),_:1},512),m.createElementVNode("div",FBe,[m.createVNode(CPe)])]))}}),HBe={class:"h-full flex items-center gap-[0.8rem]"},GBe={key:0,class:"min-w-[100px] flex items-center gap-[0.4rem] rounded hover:text-[#007aff] px-[0.4rem] py-[0.3rem] cursor-pointer select-none"},UBe=["onClick"],WBe={class:"text-[14px] font-[500]"},jBe={key:0,class:"text-[12px] ml-[0.4rem]"},qBe={key:0,class:"min-w-[100px] flex items-center gap-[0.4rem] rounded hover:text-[#007aff] px-[0.4rem] py-[0.3rem] cursor-pointer select-none"},KBe={class:"flex-1 text-center text-[14px]"},YBe={class:"w-[150px] flex flex-col gap-[0.8rem] text-[14px] px-[0.6rem]"},XBe={class:"flex justify-between"},ZBe={class:"flex justify-between"},JBe={class:"flex justify-between"},QBe={class:"flex justify-between"},e8e=m.defineComponent({__name:"FootLeft",setup(n){const e=m.ref(!1),t=m.ref(!1),r=m.inject("page"),i=m.inject("editor"),a=m.inject("options"),o=m.ref({characters:0,paragraphs:0,words:i.value.storage.characterCount?.words()||0,images:0,headings:0}),s=m.computed(()=>r.value.layout==="web"?"网页":r.value.size.key),l=c=>{if(r.value.layout=c.layout,c.layout&&c.layout==="web"){t.value=!1;return}const{label:f,width:d,height:h}=c;r.value.size={key:f,width:d,height:h},t.value=!1},u=()=>{if(!i.value)return;const{doc:c}=i.value.state;let f=0,d=0,h=0;c.descendants(v=>{v.type.name==="paragraph"&&f++,v.type.name==="image"&&d++,v.type.name==="heading"&&h++});const p=i.value.storage.characterCount?.characters()||0;o.value={characters:p,paragraphs:f,words:i.value.storage.characterCount?.words()||0,images:d,headings:h}};return m.watch(()=>i.value,(c,f)=>{f&&f.off("update",u),c&&(c.on("update",u),u())},{immediate:!0}),m.onBeforeUnmount(()=>{i.value&&i.value.off("update",u)}),(c,f)=>{const d=m.resolveDirective("tooltip");return m.openBlock(),m.createElementBlock("div",HBe,[m.unref(a).layout.toc.show?m.withDirectives((m.openBlock(),m.createElementBlock("span",{key:0,class:m.normalizeClass(["cursor-pointer hover:bg-[#e8e8e8] p-[0.3rem] rounded",{"bg-[#e8e8e8]":m.unref(r).showToc}]),onClick:f[0]||(f[0]=h=>m.unref(r).showToc=!m.unref(r).showToc)},[...f[3]||(f[3]=[m.createElementVNode("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20"},[m.createElementVNode("path",{d:"M369.0496 460.3392H184.32a81.92 81.92 0 0 1-81.92-81.92v-184.832a81.92 81.92 0 0 1 81.92-81.92h184.7296a81.92 81.92 0 0 1 81.92 81.92v184.832a81.92 81.92 0 0 1-81.92 81.92zM184.32 173.1072a20.48 20.48 0 0 0-20.48 20.48v184.832a20.48 20.48 0 0 0 20.48 20.48h184.7296a20.48 20.48 0 0 0 20.48-20.48v-184.832a20.48 20.48 0 0 0-20.48-20.48zM369.0496 914.688H184.32a81.92 81.92 0 0 1-81.92-81.92v-184.8832a81.92 81.92 0 0 1 81.92-81.92h184.7296a81.92 81.92 0 0 1 81.92 81.92v184.8832a81.92 81.92 0 0 1-81.92 81.92zM184.32 627.4048a20.48 20.48 0 0 0-20.48 20.48v184.8832a20.48 20.48 0 0 0 20.48 20.48h184.7296a20.48 20.48 0 0 0 20.48-20.48v-184.8832a20.48 20.48 0 0 0-20.48-20.48zM827.904 914.688h-184.8832a81.92 81.92 0 0 1-81.92-81.92v-184.8832a81.92 81.92 0 0 1 81.92-81.92h184.8832a81.92 81.92 0 0 1 81.92 81.92v184.8832a81.92 81.92 0 0 1-81.92 81.92z m-184.8832-287.2832a20.48 20.48 0 0 0-20.48 20.48v184.8832a20.48 20.48 0 0 0 20.48 20.48h184.8832a20.48 20.48 0 0 0 20.48-20.48v-184.8832a20.48 20.48 0 0 0-20.48-20.48z",fill:"#474A54","p-id":"15222"}),m.createElementVNode("path",{d:"M527.230586 280.884442m36.203867-36.203867l130.732164-130.732164q36.203867-36.203867 72.407735 0l130.732164 130.732164q36.203867 36.203867 0 72.407735l-130.732164 130.732164q-36.203867 36.203867-72.407735 0l-130.732164-130.732164q-36.203867-36.203867 0-72.407735Z",fill:"#FDA338","p-id":"15223"}),m.createElementVNode("path",{d:"M730.3168 493.4656a81.92 81.92 0 0 1-57.9072-23.9104L541.696 338.7904a81.92 81.92 0 0 1 0-115.8144L672.4096 92.16A81.92 81.92 0 0 1 788.48 92.16l130.7648 130.7136a81.92 81.92 0 0 1 0 115.8144L788.48 469.5552a81.92 81.92 0 0 1-58.1632 23.9104z m0-363.52a20.48 20.48 0 0 0-14.4896 5.9904L585.1136 266.24a20.48 20.48 0 0 0 0 28.9792l130.7136 130.7136a20.48 20.48 0 0 0 28.9792 0L875.52 295.3728a20.48 20.48 0 0 0 0-29.1328l-130.7136-130.56a20.48 20.48 0 0 0-14.4896-5.9904z",fill:"#474A54","p-id":"15224"})],-1)])],2)),[[d,m.unref(r).showToc?"关闭大纲":"打开大纲"]]):m.createCommentVNode("",!0),m.createVNode(js,{trigger:"click",placement:"top",value:t.value,"onUpdate:value":f[1]||(f[1]=h=>t.value=h),contentStyle:{padding:"6px 0",boxShadow:"0 6px 16px 0 rgba(0, 0, 0, 0.08)"}},{content:m.withCtx(()=>[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(m.unref(t5e),(h,p)=>(m.openBlock(),m.createElementBlock("div",{class:m.normalizeClass(["px-[12px] py-[7px] flex items-center gap-[0.4rem] cursor-pointer hover:bg-[rgb(242,243,245)]",s.value===h.label?"text-[#007aff]":""]),key:p,onClick:v=>l(h)},[m.createElementVNode("span",WBe,m.toDisplayString(h.label),1),h.width?(m.openBlock(),m.createElementBlock("span",jBe,m.toDisplayString(h.width)+" * "+m.toDisplayString(h.height)+"cm ",1)):m.createCommentVNode("",!0)],10,UBe))),128))]),default:m.withCtx(()=>[m.unref(a).layout.foot.pageSize?(m.openBlock(),m.createElementBlock("div",GBe,[f[4]||(f[4]=m.createElementVNode("span",{class:"flex-1 text-center text-[14px]"},"页面大小",-1)),m.createElementVNode("i",{class:m.normalizeClass(["w-iconfont icon-bottom !text-[8px] transition-transform duration-200",t.value?"rotate-180":""])},null,2)])):m.createCommentVNode("",!0)]),_:1},8,["value"]),m.createVNode(js,{trigger:"click",value:e.value,"onUpdate:value":f[2]||(f[2]=h=>e.value=h),placement:"top"},{content:m.withCtx(()=>[m.createElementVNode("div",YBe,[m.createElementVNode("div",XBe,[f[5]||(f[5]=m.createElementVNode("span",{class:"w-[80px]"},"字符数:",-1)),m.createTextVNode(" "+m.toDisplayString(o.value.characters),1)]),m.createElementVNode("div",ZBe,[f[6]||(f[6]=m.createElementVNode("span",{class:"w-[80px]"},"段落:",-1)),m.createTextVNode(" "+m.toDisplayString(o.value.paragraphs),1)]),m.createElementVNode("div",JBe,[f[7]||(f[7]=m.createElementVNode("span",{class:"w-[80px]"},"图片:",-1)),m.createTextVNode(" "+m.toDisplayString(o.value.images),1)]),m.createElementVNode("div",QBe,[f[8]||(f[8]=m.createElementVNode("span",{class:"w-[80px]"},"标题:",-1)),m.createTextVNode(" "+m.toDisplayString(o.value.headings),1)])])]),default:m.withCtx(()=>[m.unref(a).layout.foot.character?(m.openBlock(),m.createElementBlock("div",qBe,[m.createElementVNode("span",KBe,m.toDisplayString(o.value.characters)+" 字符",1),m.createElementVNode("i",{class:m.normalizeClass(["w-iconfont icon-bottom !text-[8px] transition-transform duration-200",e.value?"rotate-180":""])},null,2)])):m.createCommentVNode("",!0)]),_:1},8,["value"])])}}});var V1={exports:{}},t8e=V1.exports,Jz;function n8e(){return Jz||(Jz=1,(function(n,e){(function(t,r){r()})(t8e,function(){function t(u,c){return typeof c>"u"?c={autoBom:!1}:typeof c!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),c={autoBom:!c}),c.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(u.type)?new Blob(["\uFEFF",u],{type:u.type}):u}function r(u,c,f){var d=new XMLHttpRequest;d.open("GET",u),d.responseType="blob",d.onload=function(){l(d.response,c,f)},d.onerror=function(){console.error("could not download file")},d.send()}function i(u){var c=new XMLHttpRequest;c.open("HEAD",u,!1);try{c.send()}catch{}return 200<=c.status&&299>=c.status}function a(u){try{u.dispatchEvent(new MouseEvent("click"))}catch{var c=document.createEvent("MouseEvents");c.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),u.dispatchEvent(c)}}var o=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof Dy=="object"&&Dy.global===Dy?Dy:void 0,s=o.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=o.saveAs||(typeof window!="object"||window!==o?function(){}:"download"in HTMLAnchorElement.prototype&&!s?function(u,c,f){var d=o.URL||o.webkitURL,h=document.createElement("a");c=c||u.name||"download",h.download=c,h.rel="noopener",typeof u=="string"?(h.href=u,h.origin===location.origin?a(h):i(h.href)?r(u,c,f):a(h,h.target="_blank")):(h.href=d.createObjectURL(u),setTimeout(function(){d.revokeObjectURL(h.href)},4e4),setTimeout(function(){a(h)},0))}:"msSaveOrOpenBlob"in navigator?function(u,c,f){if(c=c||u.name||"download",typeof u!="string")navigator.msSaveOrOpenBlob(t(u,f),c);else if(i(u))r(u,c,f);else{var d=document.createElement("a");d.href=u,d.target="_blank",setTimeout(function(){a(d)})}}:function(u,c,f,d){if(d=d||open("","_blank"),d&&(d.document.title=d.document.body.innerText="downloading..."),typeof u=="string")return r(u,c,f);var h=u.type==="application/octet-stream",p=/constructor/i.test(o.HTMLElement)||o.safari,v=/CriOS\/[\d]+/.test(navigator.userAgent);if((v||h&&p||s)&&typeof FileReader<"u"){var g=new FileReader;g.onloadend=function(){var _=g.result;_=v?_:_.replace(/^data:[^;]*;/,"data:attachment/file;"),d?d.location.href=_:location=_,d=null},g.readAsDataURL(u)}else{var y=o.URL||o.webkitURL,b=y.createObjectURL(u);d?d.location=b:location.href=b,d=null,setTimeout(function(){y.revokeObjectURL(b)},4e4)}});o.saveAs=l.saveAs=l,n.exports=l})})(V1)),V1.exports}var r8e=n8e();const i8e=()=>{const n=document.createElement("iframe");return n.style.width="0",n.style.height="0",n.style.position="absolute",n.style.right="0",n.style.top="0",n.style.border="0",document.body.appendChild(n),n},a8e=async(n,e)=>{const t=i8e(),r=t.contentWindow;if(!t.contentDocument||!r)return;t.contentDocument.write(n),t.contentDocument.close();const i=()=>{console.log("handleLoadIframe"),r.focus(),r.print()},a=()=>{t.removeEventListener("load",i),r.removeEventListener("afterprint",a),document.body.removeChild(t),e()};t.addEventListener("load",i),r.addEventListener("afterprint",a)},o8e=m.defineComponent({__name:"print",setup(n){const e=m.inject("options"),t=m.inject("container"),r=m.inject("page"),i=m.computed(()=>e.value?.dicts?.lineHeights?.find(c=>c.default)?.value??1.7),a=()=>{const c=document.querySelector(`#${t.value} .white-editor-container`)?.outerHTML??"";return s(c)},o=()=>Array.from(document.querySelectorAll("link, style")).map(c=>c.outerHTML).join(""),s=c=>{const f=document.createElement("div");f.innerHTML=c;const d=f.querySelectorAll(".white-chart-node");for(const h of d){const p=dW(h);if(p){const v=p.getDataURL({type:"png",pixelRatio:2,backgroundColor:"#fff"}),g=document.createElement("img");g.src=v,g.style.width="100%",h?.parentNode?.replaceChild(g,h)}}return f.innerHTML},l=()=>{const{size:c,margin:f}=r.value;return`
313
+ <path d="M14 27v6H8v-6h6zm0-9v6H8v-6h6zm0-9v6H8V9h6z"></path>`}],t5e=[{label:"表情与角色",items:"😀 😃 😄 😁 😆 😅 🤣 😂 🙂 🙃 😉 😊 😇 🥰 😍 🤩 😘 😗 😚 😙 😋 😛 😜 🤪 😝 🤑 🤗 🤭 🤫 🤔 🤐 🤨 😐 😑 😶 😶‍ 😏 😒 🙄 😬 😮‍ 🤥 😌 😔 😪 🤤 😴 😷 🤒 🤕 🤢 🤮 🤧 🥵 🥶 🥴 😵 😵‍💫 🤯 🤠 🥳 😎 🤓 🧐 😕 😟 🙁 ☹️ 😮 😯 😲 😳 🥺 😦 😧 😨 😰 😥 😢 😭 😱 😖 😣 😞 😓 😩 😫 🥱 😤 😡 😠 🤬 😈 👿 💀 ☠️ 💩 🤡 👹 👺 👻 👽 👾 🤖 👋 🤚 🖐️ ✋ 🖖 👌 🤏 ✌️ 🤞 🤟 🤘 🤙 👈 👉 👆 🖕 👇 ☝️ 👍 👎 ✊ 👊 🤛 🤜 👏 🙌 👐 🤲 🤝 🙏 ✍️ 💅 🤳 💪 🦾 🦿 🦵 🦶 👂 🦻"},{label:"动物与自然",items:"🐵 🐒 🦍 🦧 🐶 🐕 🦮 🐕‍🦺 🐩 🐺 🦊 🦝 🐱 🐈 🐈‍⬛ 🦁 🐯 🐅 🐆 🐴 🐎 🦄 🦓 🦌 🐮 🐂 🐃 🐄 🐷 🐖 🐗 🐽 🐏 🐑 🐐 🐪 🐫 🦙 🦒 🐘 🦏 🦛 🐭 🐁 🐀 🐹 🐰 🐇 🐿️ 🦔 🦇 🐻 🐻‍❄️ 🐨 🐼 🦥 🦦 🦨 🦘 🦡 🐾 🦃 🐔 🐓 🐣 🐤 🐥 🐦 🐧 🕊️ 🦅 🦆 🦢 🦉 🦩 🦚 🦜 🐸 🐊 🐢 🦎 🐍 🐲 🐉 🦕 🦖 🐳 🐋 🐬 🦭 🐟 🐠 🐡 🦈 🐙 🐚 🐌 🦋 🐛 🐜 🐝 🐞 🦗 🕷️ 🕸️ 🦂 🦟 🦠 💐 🌸 💮 🏵️ 🌹 🥀 🌺 🌻 🌼 🌷 🌱 🌲 🌳 🌴 🌵 🌾 🌿 ☘️ 🍀 🍁 🍂 🍃 🌒 🌓 🌔 🌕 🌖 🌗 🌘 🌙 🌚 🌛 🌜 ☀️ 🌝 🌞 🪐 🌟 🌠 🌌 ☁️ ⛅ ⛈️ 🌤️ 🌥️ 🌦️ 🌧️ 🌨️ 🌩️ 🌪️ 🌫️ 🌬️ 🌀 🌈 🌂 ☂️ ☔ ⛱️ ⚡ ❄️ ☃️ ⛄ ☄️ 🔥 💧 🌊"},{label:"食物与食品",items:"🍇 🍉 🍊 🍋 🍌 🍍 🥭 🍎 🍏 🍐 🍑 🍒 🍓 🥝 🍅 🥥 🥑 🍆 🥔 🥕 🌽 🌶️ 🥬 🥦 🧄 🧅 🍄 🥜 🌰 🍞 🥐 🥖 🥨 🥯 🥞 🧇 🧀 🍖 🍗 🥩 🥓 🍔 🍟 🍕 🌭 🥪 🌮 🌯 🥙 🧆 🥚 🍳 🥘 🍲 🥣 🥗 🍿 🧈 🧂 🥫 🍱 🍘 🍙 🍚 🍛 🍜 🍝 🍠 🍢 🍣 🍤 🍥 🥮 🍡 🥟 🥠 🥡 🦀 🦞 🦐 🦑 🦪 🍦 🍧 🍨 🍩 🍪 🎂 🍰 🧁 🥧 🍫 🍬 🍭 🍮 🍯 🍼 🥛 ☕ 🍵 🍶 🍾 🍷 🍸 🍹 🍺 🍻 🥂 🥃 🥤 🧃 🧉 🧊 🥢 🍽️ 🍴 🥄 🔪 🏺"},{label:"活动",items:"🧧 🎁 🎄 🧨 ✨ 🎈 🎉 🏮 🎗️ 🎟️ 🎫 🎖️ 🏆 🏅 🥇 🥈 🥉 ⚽ ⚾ 🥎 🏀 🏐 🏈 🏉 🎾 🥏 🎳 🏏 🏑 🏒 🥍 🏓 🏸 🥊 🥋 🥅 ⛳ ⛸️ 🎣 🤿 🎽 🎿 🛷 🥌 🎯 🪀 🪁 🎱 🔮 🧿 🎮 🕹️ 🎰 🎲 🧩 🧸 ♟️ 🃏 🀄 🎴 🎭 🖼️ 🎨 🧵 🧶"},{label:"旅行与景点",items:"🚈 🚉 🚊 🚝 🚞 🚋 🚌 🚍 🚎 🚐 🚑 🚒 🚓 🚔 🚕 🚖 🚗 🚘 🚙 🚚 🚛 🚜 🏎️ 🏍️ 🛵 🦽 🦼 🛺 🚲 🛴 🛹 🚏 🛣️ 🛤️ 🛢️ ⛽ 🚨 🚥 🚦 🛑 🚧 ⚓ ⛵ 🛶 🚤 🛳️ ⛴️ 🛥️ 🚢 ✈️ 🛩️ 🛫 🛬 🪂 💺 🚁 🚟 🚠 🚡 🛰️ 🚀 🛸 🛎️ 🧳 🧭 ⌚ ⏰ ⏱️ ⏲️ 🕰️ 🕛 🕧 🕐 🕜 🕑 🕝 🕒 🕞 🕓 🕟 🕔 🕠 🕕 🕡 🕖 🕢 🕗 🕣 🕘 🕤 🕙 🕥 🕚 🕦"},{label:"物品",items:"📔 📕 📖 📗 📘 📙 📚 📒 📃 📜 📄 📰 🗞️ 📑 🔖 🏷️ 💰 🔍 🔎 💴 💵 💶 💷 💸 💳 🧾 💹 ✉️ 📧 📨 📩 📤 📥 📦 📫 📪 📬 📭 📮 🗳️ ✏️ ✒️ 🖋️ 🖊️ 🖌️ 🖍️ 📝 💼 📁 📂 🗂️ 📅 📆 🗒️ 🗓️ 📇 📈 📉 📊 📋 📌 📍 📎 🖇️ 📏 📐 ✂️ 🗃️ 🗄️ 🗑️ 🔒 🔓 🔏 🔐 🔑 🗝️ 🔨 🪓 ⛏️ ⚒️ 🛠️ 🗡️ ⚔️ 🔫 🏹 🛡️ 🔧 🔩 ⚙️ 🗜️ ⚖️ 🦯 🔗 ⛓️ 🧰 🧲 ⚗️ 🧪 🧫 🧬 🔬 🔭 📡 💉 🩸 💊 🩹 🩺 🚪 🛏️ 🛋️ 🪑 🚽 🚿 🛁 🪒 🧴 🧷 🧹 🧺 🧻 🧼 🧽 🧯 🛒 🚬 ⚰️ ⚱️ 💎 🔇 🔈 🔉 🔊 🔔 🔕 🔋 🔌 💻 🖥️ 🖨️ ⌨️ 🖱️ 🖲️ 📷 🧱"},{label:"符号",items:"💡 ✅ ☑️ ✔️ ❌ ❎ ❓ ❗ ❔ ❕ ⌛ ⏳ 💰 🆒 🆕 🆖 🅾️ 🆗 🆘 🈲 🉑 🈸 ⛔ 🚫 📵 ✳️ ✴️ ❇️ 🔟 🔠 🔡 🔢 🔣 🔤 🅰️ 🆎 🅱️ 🆑 🆒 🆓 ℹ️ 🆔 🆕 🆖 🅾️ 🆗 🅿️ 🆘 🆙 🆚 🈁 🈂️ 🔴 🟠 🟡 🟢 🔵 🟣 🟤 ⚫ ⚪ 🟥 🟧 🟨 🟩 🟦 🟪 🟫 🔶 🔷 🔸 🔹 🔺 🔻 💠 🔘 🔳 🔲 💌 💘 💝 💖 💗 💓 💞 💕 💟 ❣️ 💔 🤍 💯 💢 💥 💬 💤 ➰ ➿ 🔅 📴 ➡️ 🔃 🔄 🔙 🔚 🔛 🔝 🔀 🔁 🔂"}],qv=[{label:"网页",value:"web",icon:'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M867.62382187 81.79484409c53.52106667 0 96.93866667 43.37208853 96.93866666 96.89315627v664.0071104a102.4 102.4 0 0 1-102.4 102.4H161.83751147a102.4 102.4 0 0 1-102.4-102.4V178.64248889c0-53.52106667 43.37208853-96.93866667 96.8931552-96.93866667z m28.6264896 319.2604448H127.74968853v441.59431147c0 17.29422187 12.83413333 31.58471147 29.4912 33.8147552l4.64213334 0.31857813h700.23395626a34.13333333 34.13333333 0 0 0 34.13333334-34.13333333V401.05528889z m-34.13333334-250.99377813H161.88302187a34.13333333 34.13333333 0 0 0-34.13333334 34.13333333V332.74311076h768.50062294V184.19484409a34.13333333 34.13333333 0 0 0-34.13333334-34.13333333zM216.9059552 195.93671076a45.51111147 45.51111147 0 1 1 0 91.02222293 45.51111147 45.51111147 0 0 1 0-91.02222293z m136.53333333 0a45.51111147 45.51111147 0 1 1 0 91.02222293 45.51111147 45.51111147 0 0 1 0-91.02222293z" fill="#515151" p-id="6081"></path></svg>',validate:n=>n.startsWith("http://")||n.startsWith("https://")},{label:"哔哩哔哩",value:"bilibili",icon:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11.39 3.714h.5c.88.032 1.614.337 2.2.918.586.58.889 1.312.91 2.194v4.293c-.021.88-.324 1.615-.91 2.201-.586.586-1.32.889-2.2.91H4.11c-.88-.021-1.614-.324-2.2-.91-.586-.586-.889-1.32-.91-2.2V6.825c.021-.882.324-1.613.91-2.194.586-.58 1.32-.886 2.2-.918h.452l-.684-.653a.72.72 0 0 1-.218-.529.72.72 0 0 1 .218-.529l.015-.015a.763.763 0 0 1 .537-.218c.202 0 .38.072.537.218L6.63 3.59c.041.041.078.083.109.124h2.49a.487.487 0 0 1 .092-.124l1.665-1.602a.763.763 0 0 1 .536-.218c.203 0 .386.088.542.233a.691.691 0 0 1 .228.53.72.72 0 0 1-.217.528l-.685.653zm-7.28 1.51c-.434.01-.8.16-1.096.45-.295.29-.448.66-.458 1.105v4.387c.01.445.163.813.458 1.104.296.29.662.441 1.097.45h7.778c.435-.009.801-.16 1.097-.45.295-.29.448-.659.458-1.104V6.779c-.01-.446-.163-.814-.458-1.105a1.563 1.563 0 0 0-1.097-.45H4.111zm1.557 2.255c.217 0 .399.072.544.218a.809.809 0 0 1 .233.56v.684a.809.809 0 0 1-.233.56.736.736 0 0 1-.544.218.739.739 0 0 1-.545-.218.809.809 0 0 1-.233-.56v-.684c0-.218.075-.402.225-.553a.753.753 0 0 1 .553-.225zm4.666 0c.218 0 .4.072.545.218a.809.809 0 0 1 .233.56v.684a.809.809 0 0 1-.233.56.737.737 0 0 1-.545.218.739.739 0 0 1-.544-.218.809.809 0 0 1-.233-.56v-.684a.809.809 0 0 1 .233-.56.738.738 0 0 1 .544-.218z" fill="#07A3D7"/></svg>',validate(n){return/^https?:\/\/(www\.)?bilibili\.com\/video\/[a-zA-Z0-9]+/.test(n)},transformURL(n){const e=n.match(/\/video\/([a-zA-Z0-9]+)/)?.[1];return e?`https://player.bilibili.com/player.html?bvid=${e}`:""}},{label:"优酷",value:"youku",icon:'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M270.528 902.592c-82.688-45.952-104.576-161.984-43.072-232 26.688-30.208 214.592-142.784 229.632-137.344 17.088 5.504 7.488-.64-112.768-71.36-105.92-62.464-129.152-83.776-144.896-129.792-34.816-105.664 58.112-218.944 166.08-202.496 24.576 4.096 102.528 42.56 175.616 87.168 13.696 8.32 70.4 41.216 125.76 73.472 119.616 69.376 153.792 97.472 178.368 148.288 20.48 41.856 24.576 100.928 10.24 151.68-8.896 32.32-41.664 78.976-71.04 100.992l-19.2 14.4-33.408-19.2c-19.2-11.008-34.176-17.92-34.176-15.808 0 1.344 12.288 10.24 27.328 18.56 15.04 8.896 27.328 17.152 27.328 19.2 0 4.8-281.6 168.832-334.208 194.24-51.904 26.112-100.48 26.112-147.584 0z" fill="#018EFF"/><path d="M665.984 654.4c0-1.088-6.912-5.888-15.936-10.624-20.16-10.112-21.248-5.888-1.088 4.736 16.512 9.024 17.024 9.6 17.024 5.888zm-50.56 5.952c-8.448-7.424-55.744-33.408-55.744-30.72 0 2.56 53.632 35.008 58.432 35.52 1.024 0 0-2.112-2.688-4.8z" fill="#018EFF"/><path d="M673.472 653.44a4171.008 4171.008 0 0 0-126.336-72.768c-43.712-24.064-92.224-52.864-233.6-137.344C238.4 398.72 213.76 374.016 199.424 332.16c-34.816-105.664 58.048-218.944 166.016-202.496 24.576 4.096 102.4 42.56 175.552 87.168 13.632 8.32 70.336 41.216 125.632 73.472 114.112 65.92 146.88 92.032 170.752 133.184 47.872 81.728 29.44 195.008-40.96 257.472-13.632 11.648-27.968 21.248-32.768 21.248-4.8-.64-45.12-21.952-90.176-48.704z" fill="#FF396E"/><path d="M270.464 902.592A152.32 152.32 0 0 1 193.28 781.76c-6.144-76.8 21.184-115.328 130.496-179.84l75.136-44.608L568.96 630.08c93.568 39.808 172.8 72.064 176.256 72.064 4.096 0 6.784 2.048 6.784 5.504 0 5.504-273.216 165.44-334.016 194.944-51.84 26.112-100.352 26.112-147.52 0z" fill="#00BEFF"/></svg>',validate(n){return/^https?:\/\/v\.youku\.com\/v_show\/id_[a-zA-Z0-9]+/.test(n)},transformURL(n){const e=n.match(/\/id_([a-zA-Z0-9]+)/)?.[1];return e?`https://player.youku.com/embed/${e}`:""}},{label:"Figma",value:"figma",icon:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.324 8c0-1.475 1.2-2.675 2.675-2.675 1.475 0 2.675 1.2 2.675 2.675 0 1.475-1.2 2.675-2.675 2.675A2.678 2.678 0 0 1 8.324 8z" fill="#1ABCFE"/><path d="M3 13.325c0-1.475 1.2-2.675 2.675-2.675h2.65v2.675C8.325 14.8 7.125 16 5.65 16 4.175 16 3 14.8 3 13.325z" fill="#0ACF83"/><path d="M8.324 0v5.325H11c1.475 0 2.675-1.2 2.675-2.675C13.674 1.175 12.474 0 11 0H8.324z" fill="#FF7262"/><path d="M3 2.675C3 4.15 4.2 5.35 5.675 5.35h2.65V0H5.65C4.175 0 3 1.2 3 2.675z" fill="#F24E1E"/><path d="M3 8c0 1.475 1.2 2.675 2.675 2.675h2.65v-5.35H5.65C4.175 5.325 3 6.525 3 8z" fill="#A259FF"/></svg>',validate(n){return/^https?:\/\/www\.figma\.com\/file\/[a-zA-Z0-9]+/.test(n)},transformURL(n){const e=n.match(/\/file\/([a-zA-Z0-9]+)/)?.[1];return e?`https://www.figma.com/embed?embed_host=share&url=https://www.figma.com/file/${e}`:""}},{label:"墨刀",value:"mado",icon:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M2 3h2.715v4.752H2V3zm6.958 0H6.242v4.752h2.716V3zm4.582 0h-2.716v4.752h2.716V3zM9.107 14l-1.096-2.5a3.905 3.905 0 0 0 2.812-3.748h2.716A6.621 6.621 0 0 1 9.107 14z" fill="#F33"/></svg>',validate(n){return/^https?:\/\/modao\.cc\/app\/[a-zA-Z0-9]+/.test(n)},transformURL(n){return n}},{label:"腾讯视频",value:"tencent_video",icon:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5.314 14.541c-1.416-.025-1.71-1.416-1.964-3.16-.155-1.06-.182-2.155-.182-3.23 0-1.074.027-2.169.182-3.23.31-2.14.685-3.75 3.123-2.95 2.336.768 4.586 2.126 6.56 3.67.1.085.209.177.324.272.705.59 1.62 1.355 1.642 2.239-.021.882-.936 1.647-1.641 2.237-.115.096-.225.187-.324.274-1.975 1.543-4.225 2.901-6.561 3.67-.418.136-.774.203-1.08.208h-.08z" fill="#4396F7"/><path d="M2.98 13.143c-1.202-.029-1.527-.954-1.755-2.162l-.02-.1-.036-.206C1.025 9.847 1 8.991 1 8.152c0-.84.025-1.694.17-2.523l.036-.205.019-.1c.267-1.418.668-2.447 2.464-2.094-.151.487-.247 1.067-.339 1.692-.154 1.061-.181 2.156-.181 3.23 0 1.074.027 2.169.181 3.23.092.624.188 1.204.34 1.692a3.501 3.501 0 0 1-.592.07H2.98z" fill="#EF8E34"/><path fill-rule="evenodd" clip-rule="evenodd" d="M3.689 3.229c.125.025.256.055.395.094 2.181.6 4.28 1.66 6.124 2.866.66.483 1.812 1.16 1.834 1.962-.023.803-1.175 1.48-1.834 1.963-1.843 1.205-3.943 2.266-6.124 2.866-.139.038-.27.069-.395.094-.151-.488-.248-1.068-.338-1.693-.155-1.06-.182-2.156-.182-3.23 0-1.074.027-2.169.182-3.23.09-.62.185-1.197.335-1.683l.003-.009z" fill="#78E445"/><path d="M4.845 8.156c0-1.82.13-2.04.13-2.04.053-.234.18-.298.378-.241 0 0 .587.124 2.006.87 1.435.754 1.875 1.168 1.875 1.168.217.188.172.305 0 .483 0 0-.269.308-1.875 1.14-1.606.83-2.006.894-2.006.894-.239.056-.332-.015-.377-.24 0 0-.13-.21-.13-2.034z" fill="#fff"/></svg>',validate(n){return n.startsWith("https://modao.cc/proto/")},transformURL(n){const e=n.match(/\/cover\/[a-zA-Z0-9]+\/([a-zA-Z0-9]+)/)?.[1];return e?`https://v.qq.com/iframe/player.html?vid=${e}`:""}}],n5e={class:"w-[170px] flex flex-wrap gap-[10px]"},r5e=["onClick"],i5e=["innerHTML"],Nz=m.defineComponent({__name:"ordered-list",setup(n){const e=m.inject("editor"),t=m.ref(!1),r=m.ref("");m.watch(()=>t.value,a=>{if(a&&e.value){const{listType:o}=e.value.getAttributes("orderedList");r.value=o}});const i=a=>{const o=e.value?.chain().focus();e.value?.isActive("orderedList")?e.value.getAttributes("orderedList").listType===a?o?.toggleOrderedList().run():o?.updateAttributes("orderedList",{listType:a}).run():(o?.toggleOrderedList().run(),e.value?.chain().updateAttributes("orderedList",{listType:a}).run()),r.value=a,t.value=!1};return(a,o)=>(m.openBlock(),m.createBlock(il,{ico:"ordered-list",icoSize:16,text:"有序列表","hide-text":"",shortcut:"Ctrl+Shift+7","popup-visible":t.value,"onUpdate:popupVisible":o[0]||(o[0]=s=>t.value=s),"popup-type":"arrow",onMenuClick:o[1]||(o[1]=s=>m.unref(e)?.isEditable===!1?()=>{}:i(m.unref(Mz)[0].value))},{content:m.withCtx(()=>[m.createElementVNode("div",n5e,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(m.unref(Mz),(s,l)=>(m.openBlock(),m.createElementBlock("div",{key:l,class:m.normalizeClass(["w-[50px] h-[50px] cursor-pointer rounded-[3px] flex items-center justify-center border hover:bg-[#F5F5F5] overflow-hidden",{"border-[#333639]":r.value===s.value}]),onClick:u=>i(s.value)},[(m.openBlock(),m.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 44 44",innerHTML:s.code},null,8,i5e))],10,r5e))),128))])]),_:1},8,["popup-visible"]))}}),a5e={class:"w-[170px] flex flex-wrap gap-[10px]"},o5e=["onClick"],s5e=["innerHTML"],Dz=m.defineComponent({__name:"bullet-list",setup(n){const e=m.inject("editor"),t=m.ref(!1),r=m.ref("");m.watch(()=>t.value,a=>{if(a&&e.value){const{listType:o}=e.value.getAttributes("bulletList");r.value=o}});const i=a=>{const o=e.value?.chain().focus();e.value?.isActive("bulletList")?e.value.getAttributes("bulletList").listType===a?o?.toggleBulletList().run():o?.updateAttributes("bulletList",{listType:a}).run():(o?.toggleBulletList().run(),e.value?.chain().updateAttributes("bulletList",{listType:a}).run()),r.value=a,t.value=!1};return(a,o)=>(m.openBlock(),m.createBlock(il,{ico:"bullet-list",icoSize:16,text:"无序列表","hide-text":"",shortcut:"Ctrl+Shift+7","popup-visible":t.value,"onUpdate:popupVisible":o[0]||(o[0]=s=>t.value=s),"popup-type":"arrow",onMenuClick:o[1]||(o[1]=s=>m.unref(e)?.isEditable===!1?()=>{}:i(m.unref(Az)[0].value))},{content:m.withCtx(()=>[m.createElementVNode("div",a5e,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(m.unref(Az),(s,l)=>(m.openBlock(),m.createElementBlock("div",{key:l,class:m.normalizeClass(["w-[50px] h-[50px] cursor-pointer rounded-[3px] flex items-center justify-center border hover:bg-[#F5F5F5]",{"border-[#333639]":r.value===s.value}]),onClick:u=>i(s.value)},[(m.openBlock(),m.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 44 44",innerHTML:s.code},null,8,s5e))],10,o5e))),128))])]),_:1},8,["popup-visible"]))}}),Oz=m.defineComponent({__name:"text-indent",setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createBlock(An,{ico:"indent-right",text:"增加缩进",shortcut:"Tab","hide-text":"",onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.chain().focus().indent().run())}))}}),l5e=["disabled"],u5e={key:0,class:"text-[13px] text-[#333639] ml-[3px]"},c5e={class:"flex items-center justify-center w-full h-full"},f5e=["disabled"],d5e={class:"flex items-center gap-[4px] h-full"},h5e={key:0,class:"text-[13px] text-[#333639]"},wS=m.defineComponent({__name:"MenusDropdown",props:{ico:{default:""},icoSize:{default:16},text:{default:""},hideText:{type:Boolean,default:!1},forceEnabled:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},menuActive:{type:Boolean,default:!1},dropType:{default:"dropdown"},popupVisible:{type:Boolean,default:!1},maxHeight:{type:Boolean,default:!0}},emits:["update:popupVisible"],setup(n,{emit:e}){const t=m.useAttrs(),r=m.inject("editor"),i=n,a=e,o=m.computed({get:()=>i.popupVisible,set:l=>a("update:popupVisible",l)}),s=(...l)=>{t.onMenuClickThrough?t.onMenuClickThrough(...l):t.onMenuClick&&t.onMenuClick(...l)};return(l,u)=>{const c=m.resolveDirective("tooltip");return m.openBlock(),m.createElementBlock(m.Fragment,null,[n.dropType==="dropdown"?m.withDirectives((m.openBlock(),m.createElementBlock("button",m.mergeProps({key:0,class:["white-editor-tool-item white-editor-tool-drop-item flex items-center justify-center",{"is-show-text":!n.hideText,"is-active":n.menuActive&&m.unref(r)?.isEditable!==!1,"is-disabled":!n.forceEnabled&&(n.disabled||m.unref(r)?.isEditable===!1)}],disabled:!n.forceEnabled&&(n.disabled||m.unref(r)?.isEditable===!1)},m.unref(t)),[m.createElementVNode("div",{class:"flex items-center h-full",onClick:s},[m.createElementVNode("i",{class:m.normalizeClass(["w-iconfont",`icon-${n.ico}`]),style:m.normalizeStyle(`font-size: ${n.icoSize}px`)},null,6),n.hideText?m.createCommentVNode("",!0):(m.openBlock(),m.createElementBlock("p",u5e,m.toDisplayString(n.text),1))]),m.createVNode(js,{trigger:"click",value:o.value,"onUpdate:value":u[0]||(u[0]=f=>o.value=f),placement:"bottom",contentStyle:{padding:"6px 0",boxShadow:"0 6px 16px 0 rgba(0, 0, 0, 0.08)"},disabled:!n.forceEnabled&&(n.disabled||m.unref(r)?.isEditable===!1),hasClass:"flex items-center justify-center w-[13px] h-full hover:bg-[#d7d3d3] mr-[-6px] ml-[4px] w-arrow"},{content:m.withCtx(()=>[m.renderSlot(l.$slots,"content")]),default:m.withCtx(()=>[m.createElementVNode("span",c5e,[m.createElementVNode("i",{class:m.normalizeClass(["w-iconfont icon-bottom !text-[8px] transition-transform duration-200",o.value?"rotate-180":""])},null,2)])]),_:3},8,["value","disabled"])],16,l5e)),[[c,`${n.text}`]]):m.createCommentVNode("",!0),n.dropType==="select"?(m.openBlock(),m.createBlock(js,{key:1,trigger:"click",value:o.value,"onUpdate:value":u[1]||(u[1]=f=>o.value=f),placement:"bottom",contentStyle:{padding:"6px 0",boxShadow:"0 6px 16px 0 rgba(0, 0, 0, 0.08)"}},{content:m.withCtx(()=>[m.renderSlot(l.$slots,"content")]),default:m.withCtx(()=>[m.withDirectives((m.openBlock(),m.createElementBlock("button",m.mergeProps({class:["white-editor-tool-item white-editor-tool-drop-item flex items-center justify-center",{"is-show-text":!n.hideText,"is-active":n.menuActive&&m.unref(r)?.isEditable!==!1,"is-disabled":!n.forceEnabled&&(n.disabled||m.unref(r)?.isEditable===!1)}],disabled:!n.forceEnabled&&(n.disabled||m.unref(r)?.isEditable===!1)},m.unref(t)),[m.createElementVNode("div",d5e,[m.createElementVNode("i",{class:m.normalizeClass(["w-iconfont",`icon-${n.ico}`]),style:m.normalizeStyle(`font-size: ${n.icoSize}px`)},null,6),n.hideText?m.createCommentVNode("",!0):(m.openBlock(),m.createElementBlock("p",h5e,m.toDisplayString(n.text),1)),m.createElementVNode("i",{class:m.normalizeClass(["w-iconfont icon-bottom !text-[8px] transition-transform duration-200",o.value?"rotate-180":""])},null,2)])],16,f5e)),[[c,`${n.text}`]])]),_:3},8,["value"])):m.createCommentVNode("",!0)],64)}}}),p5e=["disabled"],v5e=["disabled"],g5e=["disabled"],m5e=["disabled"],y5e=["disabled"],XY=m.defineComponent({__name:"text-align",setup(n){const e=m.inject("editor"),t=m.ref(!1),r=m.computed(()=>!e.value||e.value.isActive({textAlign:"left"})?"left":e.value.isActive({textAlign:"center"})?"center":e.value.isActive({textAlign:"right"})?"right":e.value.isActive({textAlign:"justify"})?"justify":e.value.isActive({textAlign:"distributed"})?"distributed":"left"),i=a=>{switch(a){case"left":e.value?.can().chain().focus().setTextAlign("left").run()&&e.value.chain().focus().setTextAlign("left").run(),e.value?.can().chain().focus().setNodeAlign("flex-start").run()&&e.value.chain().focus().setNodeAlign("flex-start").run();break;case"center":e.value?.can().chain().focus().setTextAlign("center").run()&&e.value.chain().focus().setTextAlign("center").run(),e.value?.can().chain().focus().setNodeAlign("center").run()&&e.value.chain().focus().setNodeAlign("center").run();break;case"right":e.value?.can().chain().focus().setTextAlign("right").run()&&e.value.chain().focus().setTextAlign("right").run(),e.value?.can().chain().focus().setNodeAlign("flex-end").run()&&e.value.chain().focus().setNodeAlign("flex-end").run();break;case"justify":e.value?.can().chain().focus().setTextAlign("justify").run()&&e.value.chain().focus().setTextAlign("justify").run();break;case"distributed":e.value?.can().chain().focus().setTextAlign("distributed").run()&&e.value.chain().focus().setTextAlign("distributed").run();break}t.value=!1};return(a,o)=>(m.openBlock(),m.createBlock(wS,{ico:`align-${r.value}`,text:"对齐方式","hide-text":"",onMenuClick:o[5]||(o[5]=s=>m.unref(e)?.isEditable===!1?()=>{}:i(r.value)),"popup-visible":t.value,"onUpdate:popupVisible":o[6]||(o[6]=s=>t.value=s)},{content:m.withCtx(()=>[m.createElementVNode("div",{class:"px-[12px] py-[5px] flex items-center gap-2 text-[14px] hover:bg-[rgb(242,243,245)] cursor-pointer",onClick:o[0]||(o[0]=s=>i("left")),disabled:!m.unref(e)?.can().chain().focus().setTextAlign("left").run()&&!m.unref(e)?.can().chain().focus().setNodeAlign("left").run()},[...o[7]||(o[7]=[m.createElementVNode("i",{class:"w-iconfont icon-align-left"},null,-1),m.createTextVNode(" 左对齐 ",-1)])],8,p5e),m.createElementVNode("div",{class:"px-[12px] py-[5px] flex items-center gap-2 text-[14px] hover:bg-[rgb(242,243,245)] cursor-pointer",onClick:o[1]||(o[1]=s=>i("center")),disabled:!m.unref(e)?.can().chain().focus().setTextAlign("center").run()&&!m.unref(e)?.can().chain().focus().setNodeAlign("center").run()},[...o[8]||(o[8]=[m.createElementVNode("i",{class:"w-iconfont icon-align-center"},null,-1),m.createTextVNode(" 居中对齐 ",-1)])],8,v5e),m.createElementVNode("div",{class:"px-[12px] py-[5px] flex items-center gap-2 text-[14px] hover:bg-[rgb(242,243,245)] cursor-pointer",onClick:o[2]||(o[2]=s=>i("right")),disabled:!m.unref(e)?.can().chain().focus().setTextAlign("right").run()&&!m.unref(e)?.can().chain().focus().setNodeAlign("flex-end").run()},[...o[9]||(o[9]=[m.createElementVNode("i",{class:"w-iconfont icon-align-right"},null,-1),m.createTextVNode(" 右对齐 ",-1)])],8,g5e),m.createElementVNode("div",{class:"px-[12px] py-[5px] flex items-center gap-2 text-[14px] hover:bg-[rgb(242,243,245)] cursor-pointer",onClick:o[3]||(o[3]=s=>i("justify")),disabled:!m.unref(e)?.can().chain().focus().setTextAlign("justify").run()&&!m.unref(e)?.can().chain().focus().setNodeAlign("justify").run()},[...o[10]||(o[10]=[m.createElementVNode("i",{class:"w-iconfont icon-align-justify"},null,-1),m.createTextVNode(" 两端对齐 ",-1)])],8,m5e),m.createElementVNode("div",{class:"px-[12px] py-[5px] flex items-center gap-2 text-[14px] hover:bg-[rgb(242,243,245)] cursor-pointer",onClick:o[4]||(o[4]=s=>i("distributed")),disabled:!m.unref(e)?.can().chain().focus().setTextAlign("distributed").run()&&!m.unref(e)?.can().chain().focus().setNodeAlign("distributed").run()},[...o[11]||(o[11]=[m.createElementVNode("i",{class:"w-iconfont icon-align-distributed"},null,-1),m.createTextVNode(" 分散对齐 ",-1)])],8,y5e)]),_:1},8,["ico","popup-visible"]))}}),Iz=m.defineComponent({__name:"sub-script",setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createBlock(An,{ico:"sub-script",text:"下标",shortcut:"Ctrl+,","hide-text":"","menu-active":m.unref(e)?.isActive("subscript"),disabled:!m.unref(e)?.can().chain().focus().toggleSubscript().run(),onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.commands.toggleSubscript())},null,8,["menu-active","disabled"]))}}),Rz=m.defineComponent({__name:"sup-script",setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createBlock(An,{ico:"sup-script",text:"上标",shortcut:"Ctrl+.","hide-text":"","menu-active":m.unref(e)?.isActive("superscript"),disabled:!m.unref(e)?.can().chain().focus().toggleSuperscript().run(),onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.commands.toggleSuperscript())},null,8,["menu-active","disabled"]))}}),Lz=m.defineComponent({__name:"quote",setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createBlock(An,{ico:"quote",text:"引用",shortcut:"Ctrl+Shift+B","hide-text":"","menu-active":m.unref(e)?.isActive("blockquote"),disabled:!m.unref(e)?.can().chain().focus().toggleBlockquote().run(),onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.chain().focus().toggleBlockquote().run())},null,8,["menu-active","disabled"]))}}),Pz=m.defineComponent({__name:"code",setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createBlock(An,{ico:"code",text:"代码",shortcut:"Ctrl+E","hide-text":"","menu-active":m.unref(e)?.isActive("code"),disabled:!m.unref(e)?.can().chain().focus().toggleCode().run(),onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.chain().focus().toggleCode().run())},null,8,["menu-active","disabled"]))}}),b5e=["onClick"],Bz=m.defineComponent({__name:"line-height",setup(n){const e=m.inject("editor"),t=m.inject("options"),r=m.ref(!1),i=m.computed(()=>t.value.dicts?.lineHeights.map(o=>({label:o.label,value:o.value,active:e.value?.isActive({lineHeight:o.value})}))),a=({content:o,value:s})=>{o&&(e.value?.chain().focus().setLineHeight(s).run(),r.value=!1)};return(o,s)=>(m.openBlock(),m.createBlock(wS,{"drop-type":"select",ico:"line-height",text:"行高","hide-text":"","popup-visible":r.value,"onUpdate:popupVisible":s[0]||(s[0]=l=>r.value=l)},{content:m.withCtx(()=>[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(i.value,l=>(m.openBlock(),m.createElementBlock("div",{key:l.value,class:m.normalizeClass(["px-[12px] py-[5px] flex items-center gap-[4px] text-[14px] hover:bg-[rgb(242,243,245)] cursor-pointer",l.active?"!text-[#007bff] font-[500]":""]),onClick:u=>a({content:l.label,value:l.value})},m.toDisplayString(l.label),11,b5e))),128))]),_:1},8,["popup-visible"]))}}),Vz=m.defineComponent({__name:"undo",setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createBlock(An,{ico:"unde",text:"撤销",shortcut:"Ctrl+Z","hide-text":"",disabled:!m.unref(e)?.can().chain().focus().undo().run(),onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.chain().focus().undo().run())},null,8,["disabled"]))}}),zz=m.defineComponent({__name:"redo",setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createBlock(An,{ico:"redo",text:"重做",shortcut:"Ctrl+Y","hide-text":"",disabled:!m.unref(e)?.can().chain().focus().redo().run(),onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.chain().focus().redo().run())},null,8,["disabled"]))}}),Fz=m.defineComponent({__name:"format-painter",setup(n){const e=m.inject("editor"),t=r=>{if(e.value?.view?.painter?.enabled){e.value?.commands.unsetFormatPainter();return}e.value?.chain().focus().setFormatPainter(r).run()};return(r,i)=>(m.openBlock(),m.createBlock(An,{ico:"format-painter",text:"格式刷","menu-active":m.unref(e)?.view?.painter?.enabled,disabled:m.unref(e)?.state?.selection?.empty,"hide-text":"",onMenuClick:i[0]||(i[0]=a=>t(!0)),onDblclick:i[1]||(i[1]=a=>t(!1))},null,8,["menu-active","disabled"]))}}),$z=m.defineComponent({__name:"clear-format",setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createBlock(An,{ico:"clear-format",text:"清除格式","hide-text":"",onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.chain().focus().unsetAllMarks().run())}))}}),Hz=m.defineComponent({__name:"hard-break",setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createBlock(An,{ico:"hard-break",text:"换行","hide-text":"",shortcut:"Shift+Enter",onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.chain().focus().setHardBreak().run())}))}}),x5e=["checked"],_5e={class:"checkbox-label"},ZY=m.defineComponent({__name:"Checkbox",props:{value:{type:Boolean},disabled:{type:Boolean,default:!1}},emits:["update:value"],setup(n,{emit:e}){const t=n,r=e,i=a=>{t.disabled||r("update:value",a.target.checked)};return(a,o)=>(m.openBlock(),m.createElementBlock("label",{class:m.normalizeClass(["white-checkbox",{checked:n.value,disabled:n.disabled}]),onChange:o[0]||(o[0]=s=>i(s))},[o[1]||(o[1]=m.createElementVNode("span",{class:"checkbox-input"},null,-1)),m.createElementVNode("input",{class:"checkbox-original",type:"checkbox",checked:n.value},null,8,x5e),m.createElementVNode("span",_5e,[m.renderSlot(a.$slots,"default")])],34))}}),S5e={class:"w-full white-table-generator-content"},w5e={class:"text-[14px] font-[600] mb-[5px] user-select-none flex items-center justify-between"},k5e=["onMouseenter"],T5e=m.defineComponent({__name:"TableGenerator",emits:["insert","close"],setup(n,{emit:e}){const t=e,r=m.ref(!0),i=m.ref([]),a=()=>{if(!i.value.length)return;const[o,s]=i.value;t("insert",{row:o,col:s,checked:r.value})};return(o,s)=>(m.openBlock(),m.createElementBlock("div",S5e,[m.createElementVNode("div",w5e,[m.createElementVNode("span",null,"表格 "+m.toDisplayString(`${i.value[0]||0} * ${i.value[1]||0}`),1),m.createVNode(ZY,{value:r.value,"onUpdate:value":s[0]||(s[0]=l=>r.value=l)},{default:m.withCtx(()=>[...s[3]||(s[3]=[m.createTextVNode("包含表头",-1)])]),_:1},8,["value"])]),m.createElementVNode("table",{onMouseleave:s[1]||(s[1]=l=>i.value=[]),onClick:s[2]||(s[2]=l=>a())},[m.createElementVNode("tbody",null,[(m.openBlock(),m.createElementBlock(m.Fragment,null,m.renderList(10,l=>m.createElementVNode("tr",{key:l},[(m.openBlock(),m.createElementBlock(m.Fragment,null,m.renderList(10,u=>m.createElementVNode("td",{onMouseenter:c=>i.value=[l,u],key:u},[m.createElementVNode("div",{class:m.normalizeClass(["cell cursor-pointer",{active:i.value.length&&i.value[0]&&i.value[1]&&l<=i.value[0]&&u<=i.value[1]}])},null,2)],40,k5e)),64))])),64))])],32)]))}}),Gz=m.defineComponent({__name:"table",props:{hideText:{type:Boolean,default:!0}},setup(n){const e=m.inject("editor"),t=m.ref(!1),r=i=>{const{row:a,col:o,checked:s}=i;e.value?.chain().focus().insertTable({rows:a,cols:o,withHeaderRow:s}).run(),t.value=!1};return(i,a)=>(m.openBlock(),m.createBlock(il,{ico:"edit-table",icoSize:16,text:"插入表格","hide-text":n.hideText,"popup-visible":t.value,"onUpdate:popupVisible":a[0]||(a[0]=o=>t.value=o),"popup-type":"select"},{content:m.withCtx(()=>[m.createVNode(T5e,{onInsert:r})]),_:1},8,["hide-text","popup-visible"]))}}),Wo=m.defineComponent({__name:"Button",props:{checked:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},type:{default:"default"},size:{default:"normal"},first:{type:Boolean,default:!1},last:{type:Boolean,default:!1}},emits:["click"],setup(n,{emit:e}){const t=n,r=e,i=()=>{t.disabled||r("click")};return(a,o)=>(m.openBlock(),m.createElementBlock("button",{class:m.normalizeClass(["white-button",{disabled:n.disabled,checked:!n.disabled&&n.checked,default:!n.disabled&&n.type==="default",primary:!n.disabled&&n.type==="primary",checkbox:!n.disabled&&n.type==="checkbox",radio:!n.disabled&&n.type==="radio",small:n.size==="small",first:n.first,last:n.last}]),onClick:o[0]||(o[0]=s=>i())},[m.renderSlot(a.$slots,"default")],2))}}),C5e={class:"w-[250px]"},E5e={class:"flex justify-end mt-[10px] gap-[10px]"},Uz=m.defineComponent({__name:"link",props:{hideText:{type:Boolean,default:!0}},setup(n){const e=m.ref(""),t=m.ref(""),r=m.inject("editor"),i=m.ref(!1),a=()=>{r.value?.commands.setLink({href:e.value,target:"_blank"}),r.value?.chain().focus().insertContent(t.value).run(),i.value=!1},o=()=>{e.value="",t.value="",i.value=!1};return(s,l)=>(m.openBlock(),m.createBlock(il,{ico:"link",icoSize:16,text:"插入链接","hide-text":n.hideText,"popup-visible":i.value,"onUpdate:popupVisible":l[4]||(l[4]=u=>i.value=u),"popup-type":"select"},{content:m.withCtx(()=>[m.createElementVNode("div",C5e,[l[7]||(l[7]=m.createElementVNode("div",{class:"font-[500] text-[14px] mb-[5px]"},"链接到",-1)),m.createVNode(lm,{placeholder:"请输入网址",value:e.value,"onUpdate:value":l[0]||(l[0]=u=>e.value=u)},null,8,["value"]),l[8]||(l[8]=m.createElementVNode("div",{class:"font-[500] text-[14px] mb-[5px] mt-[10px]"},"显示文案",-1)),m.createVNode(lm,{placeholder:"请输入显示文案",value:t.value,"onUpdate:value":l[1]||(l[1]=u=>t.value=u)},null,8,["value"]),m.createElementVNode("div",E5e,[m.createVNode(Wo,{onClick:l[2]||(l[2]=u=>o())},{default:m.withCtx(()=>[...l[5]||(l[5]=[m.createTextVNode("取消",-1)])]),_:1}),m.createVNode(Wo,{type:"primary",onClick:l[3]||(l[3]=u=>a()),disabled:!e.value||!t.value},{default:m.withCtx(()=>[...l[6]||(l[6]=[m.createTextVNode(" 确定 ",-1)])]),_:1},8,["disabled"])])])]),_:1},8,["hide-text","popup-visible"]))}}),M5e=["onClick"],A5e={class:"icon"},zO=m.defineComponent({__name:"MenusSelect",props:{value:{},size:{default:""},options:{},disabled:{type:Boolean,default:!1},search:{type:Boolean,default:!1},searchLabel:{default:"搜索"},maxHeight:{type:Boolean,default:!0},maxWidth:{default:0}},emits:["update:value"],setup(n,{expose:e,emit:t}){const r=n,i=t,a=m.inject("editor"),o=m.ref(!1),s=m.ref(),l=m.ref(),u=m.ref(0),c=m.ref(""),f=m.computed(()=>r.options.find(b=>b.value===r.value)?.label||r.value||"请选择"),d=m.computed(()=>f.value==="请选择"),h=m.computed(()=>{if(!r.search||!c.value.trim())return r.options;const b=r.options.filter(_=>_.label.toLowerCase().indexOf(c.value.toLowerCase())!==-1);return b.length?b:r.options});m.watch(o,()=>{o.value?m.nextTick(()=>{l.value&&l.value.focus()}):c.value=""}),m.onBeforeUnmount(()=>{c.value=""});const p=()=>{s.value&&(u.value=r.maxWidth?Number(r.maxWidth):s.value.clientWidth)},v=new ResizeObserver(p);m.onMounted(()=>{s.value&&v.observe(s.value)}),m.onUnmounted(()=>{s.value&&v.unobserve(s.value)});const g=b=>{b.disabled||(i("update:value",b.value),o.value=!1)};return e({changePopoverVisible:b=>{o.value=b}}),(b,_)=>(m.openBlock(),m.createBlock(js,{class:"white-select-wrapper",trigger:"click",value:o.value,"onUpdate:value":_[0]||(_[0]=x=>o.value=x),placement:"bottom",contentStyle:{padding:0,boxShadow:"0 6px 16px 0 rgba(0, 0, 0, 0.08)"},disabled:n.disabled||m.unref(a)?.isEditable===!1},{content:m.withCtx(()=>[m.createElementVNode("div",{class:"white-options-wrapper",style:m.normalizeStyle({width:u.value+2+"px",maxHeight:n.maxHeight?"260px":"auto"})},[m.renderSlot(b.$slots,"main",{},()=>[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(h.value,(x,T)=>(m.openBlock(),m.createElementBlock("div",{class:m.normalizeClass(["option",{disabled:x.disabled,selected:x.value===n.value}]),key:T,onClick:k=>g(x)},m.toDisplayString(x.label),11,M5e))),128))])],4)]),default:m.withCtx(()=>[m.createElementVNode("div",{class:m.normalizeClass(["select border border-[#d9d9d9] !bg-[#fff]",{[n.size]:n.size,disabled:n.disabled||m.unref(a)?.isEditable===!1}]),ref_key:"selectRef",ref:s},[m.createElementVNode("div",{class:m.normalizeClass(["selector",{placeholder:d.value}])},m.toDisplayString(f.value),3),m.createElementVNode("div",A5e,[m.renderSlot(b.$slots,"icon",{},()=>[_[1]||(_[1]=m.createElementVNode("i",{class:"w-iconfont icon-bottom !text-[8px] transition-transform duration-200"},null,-1))])])],2)]),_:3},8,["value","disabled"]))}}),Wz=m.defineComponent({__name:"font-size",setup(n){const e=m.inject("editor"),t=m.computed(()=>e.value?.getAttributes("textStyle").fontSize||"14px");return(r,i)=>(m.openBlock(),m.createBlock(zO,{value:t.value,size:"small",options:m.unref(Fm),"onUpdate:value":i[0]||(i[0]=a=>m.unref(e)?.chain().focus().setFontSize(a).run())},null,8,["value","options"]))}}),jz=m.defineComponent({__name:"font-family",setup(n){const e=m.inject("editor"),t=[{label:"默认字体",value:null},{label:"华文宋体",value:"STSong"},{label:"华文仿宋",value:"STFangsong"},{label:"Arial",value:"Arial"},{label:"Times New Roman",value:"Times New Roman"},{label:"Verdana",value:"Verdana"},{label:"Helvetica",value:"Helvetica"},{label:"Tahoma",value:"Tahoma"},{label:"Georgia",value:"Georgia"},{label:"Comic Sans MS",value:"Comic Sans MS"},{label:"Impact",value:"Impact"}],r=m.computed(()=>e.value?.getAttributes("textStyle").fontFamily||null);return(i,a)=>(m.openBlock(),m.createBlock(zO,{class:"w-[120px]",size:"small",value:r.value,options:t,"onUpdate:value":a[0]||(a[0]=o=>m.unref(e)?.chain().focus().setFontFamily(o).run())},null,8,["value"]))}}),N5e=["onClick"],D5e=m.defineComponent({__name:"font-heading",setup(n){const e=m.inject("editor"),t=m.ref(),r=m.computed(()=>{const a=o=>e.value?.isActive("heading",{level:o});if(e.value){if(e.value?.isActive("paragraph"))return"paragraph";if(a(1))return"1";if(a(2))return"2";if(a(3))return"3";if(a(4))return"4";if(a(5))return"5";if(a(6))return"6"}return""}),i=a=>{a==="paragraph"?e.value?.chain().focus().setParagraph().run():e.value?.chain().focus().toggleHeading({level:Number(a)}).run(),t.value.changePopoverVisible(!1)};return(a,o)=>(m.openBlock(),m.createBlock(zO,{value:r.value,size:"small",options:m.unref(JM),"max-width":100,ref_key:"selectRef",ref:t},{main:m.withCtx(()=>[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(m.unref(JM),(s,l)=>(m.openBlock(),m.createElementBlock("div",{key:l,class:m.normalizeClass(["white-heading-wrapper cursor-pointer",{selected:s.value===r.value,[s.element]:!0}]),onClick:u=>i(s.value)},m.toDisplayString(s.label),11,N5e))),128))]),_:1},8,["value","options"]))}}),O5e=m.defineComponent({__name:"Modal",props:{visible:{type:Boolean},width:{default:480},closeButton:{type:Boolean,default:!1},closeOnClickMask:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0},contentStyle:{}},emits:["update:visible","closed"],setup(n,{emit:e}){const t=n,r=m.ref(),i=e,a=m.ref(!1),o=m.computed(()=>({width:t.width+"px",...t.contentStyle||{}}));m.watch(()=>t.visible,()=>{t.visible&&m.nextTick(()=>r.value.focus())});const s=()=>{i("update:visible",!1),i("closed")},l=()=>{t.visible&&t.closeOnEsc&&s()},u=()=>{t.closeOnClickMask&&s()};return(c,f)=>(m.openBlock(),m.createBlock(m.Teleport,{to:"body"},[m.createVNode(m.Transition,{name:"modal-fade"},{default:m.withCtx(()=>[m.withDirectives(m.createElementVNode("div",{class:"white-modal-wrapper white-editor-namespace",ref_key:"modalRef",ref:r,tabindex:"-1",onKeyup:f[3]||(f[3]=m.withKeys(d=>l(),["esc"])),onClick:f[4]||(f[4]=m.withModifiers(d=>u(),["self"]))},[m.createVNode(m.Transition,{name:"modal-zoom",onAfterLeave:f[1]||(f[1]=d=>a.value=!1),onBeforeEnter:f[2]||(f[2]=d=>a.value=!0)},{default:m.withCtx(()=>[m.withDirectives(m.createElementVNode("div",{class:"modal-content",style:m.normalizeStyle(o.value)},[n.closeButton?(m.openBlock(),m.createElementBlock("span",{key:0,class:"close-btn",onClick:f[0]||(f[0]=d=>s())},[...f[5]||(f[5]=[m.createElementVNode("i",{class:"w-iconfont icon-close"},null,-1)])])):m.createCommentVNode("",!0),a.value?m.renderSlot(c.$slots,"default",{key:1}):m.createCommentVNode("",!0)],4),[[m.vShow,n.visible]])]),_:3})],544),[[m.vShow,n.visible]])]),_:3})]))}}),I5e={class:"white-editor-table-content"},R5e=["id","onFocus","onBlur","onPaste"],qz=30,Kz=15,L5e=m.defineComponent({__name:"ChartData",props:{type:{},data:{}},emits:["updateData"],setup(n,{expose:e,emit:t}){const r=n,i=m.ref([0,0]),a=m.ref(null),o=m.ref("bar"),s=()=>{o.value=r.type;const p=[],{labels:v,legends:g,series:y}=r.data,b=v.length,_=y.length;p.push(["",...g]);for(let x=0;x<b;x++){const T=[v[x]];for(let k=0;k<_;k++)T.push(y[k][x]+"");p.push(T)}for(let x=0;x<b+1;x++)for(let T=0;T<_+1;T++){const k=document.querySelector(`#cell-${x}-${T}`);k&&(k.value=p[x][T]+"")}i.value=[_+1,b+1]},l=(p,v)=>{if(p===0||v===0)return;const g=document.querySelector(`#cell-${p}-${v}`);g&&g.value&&(/^[0-9]+$/.test(g.value)||(g.value="0"))},u=()=>{if(!a.value)return;const[p,v]=a.value,g=document.querySelector(`#cell-${p+1}-${v}`);g&&g.focus()},c=p=>{p.key.toUpperCase()===YY.ENTER&&u()},f=t;m.onMounted(()=>{s(),document.addEventListener("keydown",c)}),m.onBeforeUnmount(()=>{f("updateData",d()),document.removeEventListener("keydown",c)});const d=()=>{const p=[];let v=[],g=[];for(let y=1;y<qz;y++){const b=document.querySelector(`#cell-${y}-0`);b&&b.value&&p.push({rowIndex:y,value:b.value})}for(let y=1;y<Kz;y++){const b=document.querySelector(`#cell-0-${y}`);if(b&&b.value){v.push(b.value);const _=[];for(let x=0;x<p.length;x++){const T=document.querySelector(`#cell-${p[x].rowIndex}-${y}`);let k=0;T&&T.value&&+T.value&&(k=+T.value),_.push(k)}g.push(_)}}return o.value==="scatter"&&(v.length>2&&(v=v.slice(0,2),g=g.slice(0,2)),v.length<2&&(v.push("Y"),g.push(g[0]))),(o.value==="ring"||o.value==="pie")&&v.length>1&&(v=v.slice(0,1),g=g.slice(0,1)),{data:{labels:p.map(y=>y.value),legends:v,series:g},type:o.value}},h=(p,v,g)=>{p.preventDefault(),console.log("handlePaste",p.clipboardData,v,g),p.clipboardData};return e({getTableData:d,initData:s}),(p,v)=>(m.openBlock(),m.createElementBlock("div",I5e,[m.createElementVNode("table",null,[m.createElementVNode("tbody",null,[(m.openBlock(),m.createElementBlock(m.Fragment,null,m.renderList(qz,g=>m.createElementVNode("tr",{key:g},[(m.openBlock(),m.createElementBlock(m.Fragment,null,m.renderList(Kz,y=>m.createElementVNode("td",{key:y,class:m.normalizeClass({head:y===1&&g<=i.value[1]||g===1&&y<=i.value[0]})},[g===1&&y===1?m.createCommentVNode("",!0):(m.openBlock(),m.createElementBlock("input",{key:0,class:m.normalizeClass(["item",{selected:g<=i.value[1]&&y<=i.value[0]}]),id:`cell-${g-1}-${y-1}`,autocomplete:"off",onFocus:b=>a.value=[g-1,y-1],onBlur:b=>l(g-1,y-1),onPaste:b=>h(b,g-1,y-1)},null,42,R5e))],2)),64))])),64))])])]))}}),P5e={class:"w-full inline-flex items-center mb-[15px]"},B5e={class:"flex items-center gap-[1.2rem] h-[400px]"},V5e={class:"w-[55%] h-full border rounded-md p-2"},z5e={class:"flex-1 h-full border rounded-md p-4"},F5e={class:"flex items-center gap-[10px] mb-[10px]"},$5e={class:"flex items-center gap-[10px] mb-[10px]"},H5e={class:"flex items-center gap-[10px] mb-[10px]"},G5e={class:"flex items-center gap-[10px] mb-[10px]"},U5e={class:"flex items-center gap-[10px] mb-[10px]"},W5e={key:0,class:"w-full h-[400px] overflow-auto"},j5e={class:"flex items-center justify-end gap-[0.8rem] mt-6"},QM=m.defineComponent({__name:"echarts",props:{icon:{default:"chart"},text:{default:"插入图表"},isEdit:{type:Boolean,default:!1},hideText:{type:Boolean,default:!0}},setup(n){const e=n,t=m.inject("editor"),r=m.inject("options"),i=m.ref(!1),a=m.ref("type"),o=m.ref(1),s=m.ref(null),l=m.ref(),u=m.ref({data:[],config:{seriesType:"bar",legendorient:"horizontal",titleText:"",legend:!1,legendleft:"center",legendlocation:"top",titleleft:"left"}});let c=null;const f=async()=>{if(i.value=!0,a.value="type",e.isEdit){if(s.value=Fl(t.value),s.value?.type?.name!=="echarts"||(h(),!s.value.attrs?.chartConfig))return;const x=s.value.attrs?.chartConfig;u.value=JSON.parse(JSON.stringify(x)),console.log("chartConfig",u.value),await m.nextTick(),d()}else h(),await m.nextTick(),d()},d=async()=>{if(await m.nextTick(),c=TE(l.value),!u.value.data){console.log("图表数据为空");return}const x=iH(JSON.parse(JSON.stringify(u.value.data)),JSON.parse(JSON.stringify(u.value.config)),r.value);try{c.setOption(x)}catch(T){console.log("图表渲染错误:",T),y()}},h=()=>{u.value.config.seriesType="bar",u.value.config.legend=!0,u.value.config.legendorient="horizontal",u.value.config.legendlocation="top",u.value.config.legendleft="center",u.value.config.titleText="",u.value.config.titleleft="left",u.value.data=Ez[u.value.config.seriesType]},p=x=>{u.value.data=Ez[x]},v=x=>{u.value.data=x.data},g=x=>{a.value=x,x==="type"&&b()},y=()=>{c!==null&&(c.dispose(),c=null)},b=async()=>{try{y(),await m.nextTick(),await d()}catch(x){console.log("图表配置错误:",x)}},_=()=>{const x={id:"",name:"",mode:o.value,chartOptions:null,chartConfig:null,nodeAlign:"center",margin:{}};e.isEdit?x.id=s.value.attrs.id:x.id=ip(),x.chartConfig=JSON.parse(JSON.stringify({data:u.value.data,config:u.value.config})),e.isEdit?t.value.commands.updateEcharts(x):t.value.commands.setEcharts(x),i.value=!1};return m.onMounted(()=>{}),(x,T)=>(m.openBlock(),m.createElementBlock(m.Fragment,null,[m.createVNode(An,{ico:n.icon,text:n.text,"hide-text":n.hideText,onMenuClick:f},null,8,["ico","text","hide-text"]),m.createVNode(O5e,{visible:i.value,"onUpdate:visible":T[8]||(T[8]=k=>i.value=k),closeButton:"",width:800},{default:m.withCtx(()=>[T[17]||(T[17]=m.createElementVNode("div",{class:"w-full mb-6 font-[500] text-[18px]"},"图表配置",-1)),m.createElementVNode("div",P5e,[m.createElementVNode("span",{class:m.normalizeClass(["px-3 py-2 bg-[#f5f5f5] text-[#333] cursor-pointer rounded-l-md",{"!bg-[#007bff] !text-[#fff]":a.value==="type"}]),onClick:T[0]||(T[0]=k=>g("type"))}," 图表类型 ",2),m.createElementVNode("span",{class:m.normalizeClass(["px-3 py-2 bg-[#f5f5f5] text-[#333] cursor-pointer rounded-r-md",{"!bg-[#007bff] !text-[#fff]":a.value==="data"}]),onClick:T[1]||(T[1]=k=>g("data"))}," 图表数据 ",2)]),m.withDirectives(m.createElementVNode("div",B5e,[m.createElementVNode("div",V5e,[m.createElementVNode("div",{ref_key:"chartRef",ref:l,class:"w-full h-full"},null,512)]),m.createElementVNode("div",z5e,[m.createElementVNode("div",F5e,[T[9]||(T[9]=m.createElementVNode("span",{class:"flex-shrink-0"},"图表类型:",-1)),m.createVNode(wg,{value:u.value.config.seriesType,"onUpdate:value":T[2]||(T[2]=k=>u.value.config.seriesType=k),options:[{label:"柱状图",value:"bar"},{label:"折线图",value:"line"},{label:"曲线图",value:"smooth"},{label:"饼图",value:"pie"},{label:"环形图",value:"ring"},{label:"面积图",value:"area"},{label:"散点图",value:"scatter"},{label:"雷达图",value:"radar"}],maxHeight:!1,onChange:p,class:"flex-1"},null,8,["value"])]),m.createElementVNode("div",$5e,[T[10]||(T[10]=m.createElementVNode("span",{class:"flex-shrink-0"},"标题名称:",-1)),m.createVNode(lm,{value:u.value.config.titleText,"onUpdate:value":T[3]||(T[3]=k=>u.value.config.titleText=k),placeholder:"请输入标题名称",class:"flex-1"},null,8,["value"])]),m.createElementVNode("div",H5e,[m.createVNode(ZY,{value:u.value.config.legend,"onUpdate:value":T[4]||(T[4]=k=>u.value.config.legend=k),class:"flex-shrink-0"},{default:m.withCtx(()=>[...T[11]||(T[11]=[m.createTextVNode(" 显示图例 ",-1)])]),_:1},8,["value"])]),u.value.config.legend?(m.openBlock(),m.createElementBlock(m.Fragment,{key:0},[m.createElementVNode("div",G5e,[T[12]||(T[12]=m.createElementVNode("span",{class:"flex-shrink-0"},"横向位置:",-1)),m.createVNode(wg,{value:u.value.config.legendleft,"onUpdate:value":T[5]||(T[5]=k=>u.value.config.legendleft=k),options:[{label:"左侧",value:"left"},{label:"居中",value:"center"},{label:"右侧",value:"right"}],class:"flex-1"},null,8,["value"])]),m.createElementVNode("div",U5e,[T[13]||(T[13]=m.createElementVNode("span",{class:"flex-shrink-0"},"纵向位置:",-1)),m.createVNode(wg,{value:u.value.config.legendlocation,"onUpdate:value":T[6]||(T[6]=k=>u.value.config.legendlocation=k),options:[{label:"顶部",value:"top"},{label:"底部",value:"bottom"}],class:"flex-1"},null,8,["value"])])],64)):m.createCommentVNode("",!0),m.createVNode(Wo,{type:"primary",onClick:b,size:"small",class:"w-full"},{default:m.withCtx(()=>[...T[14]||(T[14]=[m.createTextVNode("预览",-1)])]),_:1})])],512),[[m.vShow,a.value==="type"]]),a.value==="data"?(m.openBlock(),m.createElementBlock("div",W5e,[m.createVNode(L5e,{type:u.value.config.seriesType,data:u.value.data,onUpdateData:v},null,8,["type","data"])])):m.createCommentVNode("",!0),m.createElementVNode("div",j5e,[m.createVNode(Wo,{onClick:T[7]||(T[7]=k=>i.value=!1)},{default:m.withCtx(()=>[...T[15]||(T[15]=[m.createTextVNode("取消",-1)])]),_:1}),m.createVNode(Wo,{type:"primary",onClick:_},{default:m.withCtx(()=>[...T[16]||(T[16]=[m.createTextVNode("确定",-1)])]),_:1})])]),_:1},8,["visible"])],64))}}),Yz=m.defineComponent({__name:"text-outdent",setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createBlock(An,{ico:"indent-left",text:"减少缩进",shortcut:"Shift+Tab","hide-text":"",onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.chain().focus().outdent().run())}))}}),Kp=m.defineComponent({__name:"align-center",setup(n){const e=m.inject("editor"),t=()=>{e.value?.can().chain().focus().setTextAlign("center").run()&&e.value.chain().focus().setTextAlign("center").run(),e.value?.can().chain().focus().setNodeAlign("center").run()&&e.value.chain().focus().setNodeAlign("center").run()};return(r,i)=>(m.openBlock(),m.createBlock(An,{ico:"align-center",shortcut:"Ctrl+Shift+E",text:"居中对齐","hide-text":"","menu-active":m.unref(e)?.isActive({textAlign:"center"})||m.unref(e)?.isActive({nodeAlign:"center"}),disabled:!m.unref(e)?.can().chain().focus().setTextAlign("center").run()&&!m.unref(e)?.can().chain().focus().setNodeAlign("center").run(),onMenuClick:t},null,8,["menu-active","disabled"]))}}),Yp=m.defineComponent({__name:"align-right",setup(n){const e=m.inject("editor"),t=()=>{e.value?.can().chain().focus().setTextAlign("right").run()&&e.value.chain().focus().setTextAlign("right").run(),e.value?.can().chain().focus().setNodeAlign("flex-end").run()&&e.value.chain().focus().setNodeAlign("flex-end").run()};return(r,i)=>(m.openBlock(),m.createBlock(An,{ico:"align-right",text:"右对齐",shortcut:"Ctrl+Shift+R","hide-text":"","menu-active":m.unref(e)?.isActive({textAlign:"right"})||m.unref(e)?.isActive({nodeAlign:"flex-end"}),disabled:!m.unref(e)?.can().chain().focus().setTextAlign("right").run()&&!m.unref(e)?.can().chain().focus().setNodeAlign("flex-end").run(),onMenuClick:t},null,8,["menu-active","disabled"]))}}),Xp=m.defineComponent({__name:"align-left",setup(n){const e=m.inject("editor"),t=()=>{e.value?.can().chain().focus().setTextAlign("left").run()&&e.value.chain().focus().setTextAlign("left").run(),console.log(e.value?.can().chain().focus().setNodeAlign("flex-start").run(),"22222"),e.value?.can().chain().focus().setNodeAlign("flex-start").run()&&e.value.chain().focus().setNodeAlign("flex-start").run()};return(r,i)=>(m.openBlock(),m.createBlock(An,{ico:"align-left",text:"左对齐",shortcut:"Ctrl+Shift+L","hide-text":"","menu-active":m.unref(e)?.isActive({textAlign:"left"})||m.unref(e)?.isActive({nodeAlign:"flex-start"}),disabled:!m.unref(e)?.can().chain().focus().setTextAlign("left").run()&&!m.unref(e)?.can().chain().focus().setNodeAlign("left").run(),onMenuClick:t},null,8,["menu-active","disabled"]))}}),q5e=m.defineComponent({__name:"align-justify",setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createBlock(An,{ico:"align-justify",text:"两端对齐",shortcut:"Ctrl+Shift+J","hide-text":"","menu-active":m.unref(e)?.isActive({textAlign:"justify"}),disabled:!m.unref(e)?.can().chain().focus().setTextAlign("justify").run(),onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.chain().focus().setTextAlign("justify").run())},null,8,["menu-active","disabled"]))}}),K5e=m.defineComponent({__name:"align-distributed",setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createBlock(An,{ico:"align-distributed",text:"分散对齐",shortcut:"Ctrl+Shift+D","hide-text":"","menu-active":m.unref(e)?.isActive({textAlign:"distributed"}),disabled:!m.unref(e)?.can().chain().focus().setTextAlign("distributed").run(),onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.chain().focus().setTextAlign("distributed").run())},null,8,["menu-active","disabled"]))}}),Y5e=m.defineComponent({__name:"size-increase",setup(n){const e=m.inject("editor"),t=i=>{e.value?.chain().focus().setFontSize(i).run()},r=()=>{const{fontSize:i}=e.value?.getAttributes("textStyle")??{};if(i){const a=Fm.find(({value:s})=>s===i);if(!a)return;const o=Fm.find(({order:s})=>s===a.order+1);o&&t(o.value)}else t("16px")};return(i,a)=>(m.openBlock(),m.createBlock(An,{ico:"size-increase",text:"增大字体","hide-text":"",onMenuClick:r}))}}),X5e=m.defineComponent({__name:"size-decrease",setup(n){const e=m.inject("editor"),t=i=>{e.value?.chain().focus().setFontSize(i).run()},r=()=>{const{fontSize:i}=e.value?.getAttributes("textStyle")??{};if(i){const a=Fm.find(({value:s})=>s===i);if(console.log(i,a),!a)return;const o=Fm.find(({order:s})=>s===a.order-1);o&&t(o.value)}else t("14px")};return(i,a)=>(m.openBlock(),m.createBlock(An,{ico:"size-decrease",text:"减小字体","hide-text":"",onMenuClick:r}))}}),Z5e={class:"p-[5px] bg-[#f3f4f6] rounded-[5px]"},J5e={class:"w-[240px] h-[50px] white-no-scrollbar overflow-x-auto"},Q5e=["onClick"],eBe={class:"font-[500]"},tBe={class:"text-[12px] text-[#737373]"},nBe=m.defineComponent({__name:"heading",setup(n){const e=m.inject("editor"),t=m.computed(()=>{const i=a=>e.value?.isActive("heading",{level:a});if(e.value){if(e.value?.isActive("paragraph"))return"paragraph";if(i(1))return"1";if(i(2))return"2";if(i(3))return"3";if(i(4))return"4";if(i(5))return"5";if(i(6))return"6"}return""}),r=i=>{e.value?.isEditable!==!1&&(i==="paragraph"?e.value?.chain().focus().setParagraph().run():e.value?.chain().focus().toggleHeading({level:Number(i)}).run())};return(i,a)=>(m.openBlock(),m.createElementBlock("div",Z5e,[m.createElementVNode("div",J5e,[m.createElementVNode("div",{class:m.normalizeClass(["flex items-center w-max h-full",{"opacity-50 cursor-not-allowed":m.unref(e)?.isEditable===!1}])},[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(m.unref(JM),o=>(m.openBlock(),m.createElementBlock("div",{key:o.value,class:m.normalizeClass(["w-[80px] h-full flex flex-col gap-[2px] items-center justify-center cursor-pointer flex-shrink-0 rounded-[5px]",{"bg-[#fff]":t.value===o.value,"cursor-not-allowed":m.unref(e)?.isEditable===!1}]),onClick:s=>r(o.value)},[m.createElementVNode("div",eBe,m.toDisplayString(o.label),1),m.createElementVNode("div",tBe,m.toDisplayString(o.element==="p"?"段落":o.element),1)],10,Q5e))),128))],2)])]))}}),rBe={class:"text-[14px]"},iu=m.defineComponent({__name:"MenusCheck",props:{ico:{default:""},text:{default:""},disabled:{type:Boolean,default:!1}},setup(n){const e=m.useAttrs(),t=(...r)=>{e.onMenuClickThrough?e.onMenuClickThrough(...r):e.onMenuClick&&e.onMenuClick(...r)};return(r,i)=>(m.openBlock(),m.createElementBlock("div",m.mergeProps({class:"w-check-item w-full rounded-[4px] hover:bg-[#edeef2] px-2 py-[0.3rem] inline-flex items-center gap-2 cursor-pointer"},m.unref(e),{onClick:t}),[m.createElementVNode("i",{class:m.normalizeClass(["w-iconfont",`icon-${n.ico}`])},null,2),m.createElementVNode("div",rBe,m.toDisplayString(n.text),1)],16))}}),iBe=m.defineComponent({__name:"image",props:{hideText:{type:Boolean,default:!0},isInset:{type:Boolean,default:!1}},setup(n){const e=m.inject("editor"),t=m.inject("uploadFileMap"),r=i=>{e.value?.chain().focus().selectFiles(i,t.value).run()};return(i,a)=>n.isInset?(m.openBlock(),m.createBlock(iu,{key:1,ico:"image",text:"图片",onMenuClick:a[1]||(a[1]=o=>r("image"))})):(m.openBlock(),m.createBlock(An,{key:0,ico:"image",text:"插入图片","hide-text":n.hideText,onMenuClick:a[0]||(a[0]=o=>r("image"))},null,8,["hide-text"]))}}),aBe=m.defineComponent({__name:"audio",props:{isInset:{type:Boolean,default:!1}},setup(n){const e=m.inject("editor"),t=m.inject("uploadFileMap");return(r,i)=>n.isInset?(m.openBlock(),m.createBlock(iu,{key:1,ico:"audio",text:"音频",onMenuClick:i[1]||(i[1]=a=>m.unref(e)?.chain().focus().selectFiles("audio",m.unref(t)).run())})):(m.openBlock(),m.createBlock(An,{key:0,ico:"audio",text:"插入音频","hide-text":"",onMenuClick:i[0]||(i[0]=a=>m.unref(e)?.chain().focus().selectFiles("audio",m.unref(t)).run())}))}}),oBe=m.defineComponent({__name:"video",props:{isInset:{type:Boolean,default:!1}},setup(n){const e=m.inject("editor"),t=m.inject("uploadFileMap");return(r,i)=>n.isInset?(m.openBlock(),m.createBlock(iu,{key:1,ico:"video",text:"视频",onMenuClick:i[1]||(i[1]=a=>m.unref(e)?.chain().focus().selectFiles("video",m.unref(t)).run())})):(m.openBlock(),m.createBlock(An,{key:0,ico:"video",text:"插入视频","hide-text":"",onMenuClick:i[0]||(i[0]=a=>m.unref(e)?.chain().focus().selectFiles("video",m.unref(t)).run())}))}}),sBe=m.defineComponent({__name:"tag",props:{isInset:{type:Boolean,default:!1}},setup(n){const e=m.inject("editor");return(t,r)=>n.isInset?(m.openBlock(),m.createBlock(iu,{key:1,ico:"tag",text:"标签",onMenuClick:r[1]||(r[1]=i=>m.unref(e)?.chain().focus().insertTag().run())})):(m.openBlock(),m.createBlock(An,{key:0,ico:"tag",text:"插入标签","hide-text":"",onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.chain().focus().insertTag().run())}))}}),lBe=m.defineComponent({__name:"file",props:{hideText:{type:Boolean,default:!0},isInset:{type:Boolean,default:!1}},setup(n){const e=m.inject("editor"),t=m.inject("uploadFileMap");return(r,i)=>n.isInset?(m.openBlock(),m.createBlock(iu,{key:1,ico:"add-file",text:"文件",onMenuClick:i[1]||(i[1]=a=>m.unref(e)?.chain().focus().selectFiles("file",m.unref(t)).run())})):(m.openBlock(),m.createBlock(An,{key:0,ico:"add-file",text:"插入文件","hide-text":n.hideText,onMenuClick:i[0]||(i[0]=a=>m.unref(e)?.chain().focus().selectFiles("file",m.unref(t)).run())},null,8,["hide-text"]))}}),uBe=m.defineComponent({__name:"data-time",props:{isInset:{type:Boolean,default:!1}},setup(n){const e=i=>zue(Que(),i).value,t=m.inject("editor"),r=({content:i,format:a,capitalize:o,value:s})=>{i&&t.value?.chain().insertDatetime({text:i.includes("自定义")?`[${i}]`:i,date:e(a),withTime:s==="withTime",format:a,capitalize:o}).focus().run()};return(i,a)=>n.isInset?(m.openBlock(),m.createBlock(iu,{key:1,ico:"date",text:"日期",onMenuClick:a[1]||(a[1]=o=>r({content:e("YYYY年M月D日"),format:"YYYY-MM-DD HH:mm:ss",capitalize:!0,value:"withTime"}))})):(m.openBlock(),m.createBlock(An,{key:0,ico:"date",text:"插入日期",shortcut:"Ctrl+B","hide-text":"",onMenuClick:a[0]||(a[0]=o=>r({content:e("YYYY年M月D日"),format:"YYYY-MM-DD HH:mm:ss",capitalize:!0,value:"withTime"}))}))}}),cBe=m.defineComponent({__name:"divider",props:{isInset:{type:Boolean,default:!1}},setup(n){const e=m.inject("editor");return(t,r)=>n.isInset?(m.openBlock(),m.createBlock(iu,{key:1,ico:"divider",text:"分隔线",onMenuClick:r[1]||(r[1]=i=>m.unref(e).chain().focus().setHr({type:"signle",color:"#000"}).run())})):(m.openBlock(),m.createBlock(An,{key:0,ico:"divider",text:"分隔线","hide-text":"",onMenuClick:r[0]||(r[0]=i=>m.unref(e).chain().focus().setHr({type:"signle",color:"#000"}).run())}))}}),fBe={class:"w-[310px] max-h-[400px] overflow-auto white-no-scrollbar"},dBe={class:"flex flex-wrap gap-[0.5rem]"},hBe=["onClick"],pBe=m.defineComponent({__name:"emoji-content",emits:["select"],setup(n,{emit:e}){const t=e,r=i=>{t("select",i)};return(i,a)=>(m.openBlock(),m.createElementBlock("div",fBe,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(m.unref(t5e),(o,s)=>(m.openBlock(),m.createElementBlock(m.Fragment,{key:s},[m.createElementVNode("div",{class:m.normalizeClass(["text-[12px] text-[#666] mb-[10px]",s!==0?"mt-[10px]":""])},m.toDisplayString(o.label),3),m.createElementVNode("div",dBe,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(o.items.split(" "),(l,u)=>(m.openBlock(),m.createElementBlock("div",{key:u,class:"text-[25px] w-[32px] h-[32px] rounded-[4px] cursor-pointer flex items-center justify-center hover:bg-[#f1f2f2]",onClick:c=>r(l)},m.toDisplayString(l),9,hBe))),128))])],64))),128))]))}}),vBe=m.defineComponent({__name:"emoji",props:{hideText:{type:Boolean,default:!0},onSelectEmoji:{type:Function,default:void 0}},setup(n){const e=n,t=m.inject("editor"),r=m.ref(!1),i=a=>{e.onSelectEmoji?e.onSelectEmoji(a):t.value?.chain().focus().insertContent(a).run(),r.value=!1};return(a,o)=>(m.openBlock(),m.createBlock(il,{ico:"emoji",icoSize:16,text:"插入表情","hide-text":n.hideText,"popup-visible":r.value,"onUpdate:popupVisible":o[0]||(o[0]=s=>r.value=s),"popup-type":"select",placement:"right",trigger:"mouseenter"},{content:m.withCtx(()=>[m.createVNode(pBe,{onSelect:i})]),default:m.withCtx(()=>[m.createElementVNode("div",{class:m.normalizeClass(["w-full rounded-[4px] hover:bg-[#edeef2] px-2 py-[0.3rem] inline-flex items-center justify-between cursor-pointer",{"bg-[#edeef2]":r.value}])},[...o[1]||(o[1]=[m.createElementVNode("span",{class:"inline-flex items-center gap-2"},[m.createElementVNode("i",{class:"w-iconfont icon-emoji"}),m.createElementVNode("span",{class:"text-[14px]"},"表情")],-1),m.createElementVNode("i",{class:"w-iconfont icon-right !text-[10px]"},null,-1)])],2)]),_:1},8,["hide-text","popup-visible"]))}}),gBe={class:"w-full text-center pb-2"},mBe={class:"w-[175px] h-[80px] flex items-center gap-[6px]"},yBe=["onMouseenter","onClick"],bBe=m.defineComponent({__name:"columns",setup(n){const e=m.inject("editor"),t=m.ref(!1),r=m.ref([1,2,3,4,5]),i=m.ref(0),a=s=>{i.value=s},o=s=>{e.value?.chain().focus().setColumns(s,!0).run(),e.value?.chain().focus().updateAttributes("columnBlock",{columnSize:s}).run(),t.value=!1};return(s,l)=>(m.openBlock(),m.createBlock(il,{ico:"column",icoSize:16,text:"插入分栏","hide-text":"","popup-visible":t.value,"onUpdate:popupVisible":l[0]||(l[0]=u=>t.value=u),"popup-type":"select",placement:"right",trigger:"mouseenter"},{content:m.withCtx(()=>[m.createElementVNode("div",gBe,m.toDisplayString(i.value)+" 分栏",1),m.createElementVNode("div",mBe,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(r.value,u=>(m.openBlock(),m.createElementBlock("div",{key:u,class:m.normalizeClass(["w-[30px] h-full bg-[rgba(23,26,29,0.06)] rounded-[4px] cursor-pointer flex-shrink-0",{"!bg-[#007bff]":i.value>=u}]),onMouseenter:c=>a(u),onClick:c=>o(u)},null,42,yBe))),128))])]),default:m.withCtx(()=>[m.createElementVNode("div",{class:m.normalizeClass(["w-full rounded-[4px] hover:bg-[#edeef2] px-2 py-[0.3rem] inline-flex items-center justify-between cursor-pointer",{"bg-[#edeef2]":t.value}])},[...l[1]||(l[1]=[m.createElementVNode("span",{class:"inline-flex items-center gap-2"},[m.createElementVNode("i",{class:"w-iconfont icon-column"}),m.createTextVNode(),m.createElementVNode("span",{class:"text-[14px]"},"分栏")],-1),m.createElementVNode("i",{class:"w-iconfont icon-right !text-[10px]"},null,-1)])],2)]),_:1},8,["popup-visible"]))}}),xBe=m.defineComponent({__name:"code-block",setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createBlock(iu,{ico:"code",text:"代码块",onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.chain().focus().setCodeBlock().run())}))}}),_Be=m.defineComponent({__name:"web-page",setup(n){const e=m.inject("editor"),t=()=>{e.value?.chain().focus().setParagraph().run(),e.value?.chain().focus().setIframe({type:"",src:""}).run()};return(r,i)=>(m.openBlock(),m.createBlock(iu,{ico:"web-page",text:"网页",onMenuClick:i[0]||(i[0]=a=>t())}))}}),SBe=["disabled"],wBe={class:"w-[110px]"},Xz=m.defineComponent({__name:"insert-menu",props:{hideText:{type:Boolean,default:!1}},setup(n){const e=m.ref(!1),t=m.inject("editor");return(r,i)=>{const a=m.resolveDirective("tooltip");return m.openBlock(),m.createBlock(il,{ico:"add-circle",icoSize:16,text:"插入元素","hide-text":n.hideText,"popup-visible":e.value,"onUpdate:popupVisible":i[0]||(i[0]=o=>e.value=o),"popup-type":"select"},{content:m.withCtx(()=>[m.createElementVNode("div",wBe,[m.createVNode(iBe,{isInset:!0}),m.createVNode(aBe,{isInset:!0}),m.createVNode(oBe,{isInset:!0}),m.createVNode(lBe,{isInset:!0}),m.createVNode(sBe,{isInset:!0}),m.createVNode(uBe,{isInset:!0}),m.createVNode(cBe,{isInset:!0}),m.createVNode(vBe),m.createVNode(bBe),m.createVNode(xBe),m.createVNode(_Be)])]),default:m.withCtx(()=>[n.hideText?m.withDirectives((m.openBlock(),m.createElementBlock("button",{key:0,disabled:m.unref(t)?.isEditable===!1,class:m.normalizeClass(["white-editor-tool-item flex items-center justify-center gap-[6px] px-[7px]",{"is-disabled":m.unref(t)?.isEditable===!1}])},[...i[1]||(i[1]=[m.createElementVNode("i",{class:"w-iconfont icon-add-circle"},null,-1),m.createElementVNode("span",{class:"text-[14px]"},"插入",-1)])],10,SBe)),[[a,"插入元素"]]):m.createCommentVNode("",!0)]),_:1},8,["hide-text","popup-visible"])}}}),Zz=m.defineComponent({__name:"task-list",setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createBlock(An,{ico:"task-list",text:"任务列表",shortcut:"Ctrl+Shift+9","hide-text":"","menu-active":m.unref(e)?.isActive("taskList"),disabled:!m.unref(e)?.can().chain().focus().toggleTaskList().run(),onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.chain().focus().toggleTaskList().run())},null,8,["menu-active","disabled"]))}}),kBe={class:"flex w-full h-full"},TBe={key:0,class:"inline-flex items-center mx-auto"},CBe={class:"pr-[20px] flex-shrink-0"},EBe={class:"space-y-[6px] px-[20px] border-r border-l"},MBe={class:"space-x-[5px] flex"},ABe={class:"space-x-[5px] flex"},NBe={class:"space-y-[6px] px-[20px] border-r"},DBe={class:"space-x-[8px] flex"},OBe={class:"space-x-[5px] flex"},IBe={class:"space-y-[6px] px-[20px] border-r"},RBe={class:"space-x-[5px] flex"},LBe={class:"space-x-[5px] flex"},PBe={class:"px-[20px] border-r"},BBe={class:"space-x-[6px] pl-[20px] flex"},VBe={key:1,class:"inline-flex items-center gap-[10px] mx-auto"},zBe={class:"px-4 inline-flex items-center"},FBe=m.defineComponent({__name:"index",setup(n){const e=m.inject("page");return(t,r)=>(m.openBlock(),m.createElementBlock("div",kBe,[m.createVNode(kPe,{ref:"scrollableRef",class:"flex-1 h-full p-[10px]"},{default:m.withCtx(()=>[m.unref(e).toolbar==="double"?(m.openBlock(),m.createElementBlock("div",TBe,[m.createElementVNode("div",CBe,[m.createVNode(Xz)]),m.createElementVNode("div",EBe,[m.createElementVNode("div",MBe,[m.createVNode(Vz),m.createVNode(zz)]),m.createElementVNode("div",ABe,[m.createVNode(Fz),m.createVNode($z)])]),m.createElementVNode("div",NBe,[m.createElementVNode("div",DBe,[m.createVNode(jz),m.createVNode(Wz),m.createVNode(Y5e),m.createVNode(X5e)]),m.createElementVNode("div",OBe,[m.createVNode(WM),m.createVNode(jM),m.createVNode(qM),m.createVNode(KM),m.createVNode(Rz),m.createVNode(Iz),m.createVNode(Tz),m.createVNode(Cz)])]),m.createElementVNode("div",IBe,[m.createElementVNode("div",RBe,[m.createVNode(Nz),m.createVNode(Dz),m.createVNode(Oz),m.createVNode(Yz),m.createVNode(Bz),m.createVNode(Zz)]),m.createElementVNode("div",LBe,[m.createVNode(Xp),m.createVNode(Kp),m.createVNode(Yp),m.createVNode(q5e),m.createVNode(K5e),m.createVNode(Lz),m.createVNode(Pz),m.createVNode(Hz)])]),m.createElementVNode("div",PBe,[m.createVNode(nBe)]),m.createElementVNode("div",BBe,[m.createVNode(Gz,{hideText:!1}),m.createVNode(QM,{hideText:!1}),m.createVNode(Uz,{hideText:!1})])])):(m.openBlock(),m.createElementBlock("div",VBe,[m.createVNode(Xz,{hideText:!0}),m.createVNode(Vz),m.createVNode(zz),m.createVNode(Fz),m.createVNode($z),m.createVNode(D5e),m.createVNode(jz),m.createVNode(Wz),m.createVNode(WM),m.createVNode(jM),m.createVNode(qM),m.createVNode(KM),m.createVNode(Tz),m.createVNode(Cz),m.createVNode(Nz),m.createVNode(Dz),m.createVNode(Zz),m.createVNode(Oz),m.createVNode(Yz),m.createVNode(XY),m.createVNode(Bz),m.createVNode(Rz),m.createVNode(Iz),m.createVNode(Hz),m.createVNode(Lz),m.createVNode(Pz),m.createVNode(QM),m.createVNode(Gz),m.createVNode(Uz)]))]),_:1},512),m.createElementVNode("div",zBe,[m.createVNode(CPe)])]))}}),$Be={class:"h-full flex items-center gap-[0.8rem]"},HBe={key:0,class:"min-w-[100px] flex items-center gap-[0.4rem] rounded hover:text-[#007aff] px-[0.4rem] py-[0.3rem] cursor-pointer select-none"},GBe=["onClick"],UBe={class:"text-[14px] font-[500]"},WBe={key:0,class:"text-[12px] ml-[0.4rem]"},jBe={key:0,class:"min-w-[100px] flex items-center gap-[0.4rem] rounded hover:text-[#007aff] px-[0.4rem] py-[0.3rem] cursor-pointer select-none"},qBe={class:"flex-1 text-center text-[14px]"},KBe={class:"w-[150px] flex flex-col gap-[0.8rem] text-[14px] px-[0.6rem]"},YBe={class:"flex justify-between"},XBe={class:"flex justify-between"},ZBe={class:"flex justify-between"},JBe={class:"flex justify-between"},QBe=m.defineComponent({__name:"FootLeft",setup(n){const e=m.ref(!1),t=m.ref(!1),r=m.inject("page"),i=m.inject("editor"),a=m.inject("options"),o=m.ref({characters:0,paragraphs:0,words:i.value.storage.characterCount?.words()||0,images:0,headings:0}),s=m.computed(()=>r.value.layout==="web"?"网页":r.value.size.key),l=c=>{if(r.value.layout=c.layout,c.layout&&c.layout==="web"){t.value=!1;return}const{label:f,width:d,height:h}=c;r.value.size={key:f,width:d,height:h},t.value=!1},u=()=>{if(!i.value)return;const{doc:c}=i.value.state;let f=0,d=0,h=0;c.descendants(v=>{v.type.name==="paragraph"&&f++,v.type.name==="image"&&d++,v.type.name==="heading"&&h++});const p=i.value.storage.characterCount?.characters()||0;o.value={characters:p,paragraphs:f,words:i.value.storage.characterCount?.words()||0,images:d,headings:h}};return m.watch(()=>i.value,(c,f)=>{f&&f.off("update",u),c&&(c.on("update",u),u())},{immediate:!0}),m.onBeforeUnmount(()=>{i.value&&i.value.off("update",u)}),(c,f)=>{const d=m.resolveDirective("tooltip");return m.openBlock(),m.createElementBlock("div",$Be,[m.unref(a).layout.toc.show?m.withDirectives((m.openBlock(),m.createElementBlock("span",{key:0,class:m.normalizeClass(["cursor-pointer hover:bg-[#e8e8e8] p-[0.3rem] rounded",{"bg-[#e8e8e8]":m.unref(r).showToc}]),onClick:f[0]||(f[0]=h=>m.unref(r).showToc=!m.unref(r).showToc)},[...f[3]||(f[3]=[m.createElementVNode("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20"},[m.createElementVNode("path",{d:"M369.0496 460.3392H184.32a81.92 81.92 0 0 1-81.92-81.92v-184.832a81.92 81.92 0 0 1 81.92-81.92h184.7296a81.92 81.92 0 0 1 81.92 81.92v184.832a81.92 81.92 0 0 1-81.92 81.92zM184.32 173.1072a20.48 20.48 0 0 0-20.48 20.48v184.832a20.48 20.48 0 0 0 20.48 20.48h184.7296a20.48 20.48 0 0 0 20.48-20.48v-184.832a20.48 20.48 0 0 0-20.48-20.48zM369.0496 914.688H184.32a81.92 81.92 0 0 1-81.92-81.92v-184.8832a81.92 81.92 0 0 1 81.92-81.92h184.7296a81.92 81.92 0 0 1 81.92 81.92v184.8832a81.92 81.92 0 0 1-81.92 81.92zM184.32 627.4048a20.48 20.48 0 0 0-20.48 20.48v184.8832a20.48 20.48 0 0 0 20.48 20.48h184.7296a20.48 20.48 0 0 0 20.48-20.48v-184.8832a20.48 20.48 0 0 0-20.48-20.48zM827.904 914.688h-184.8832a81.92 81.92 0 0 1-81.92-81.92v-184.8832a81.92 81.92 0 0 1 81.92-81.92h184.8832a81.92 81.92 0 0 1 81.92 81.92v184.8832a81.92 81.92 0 0 1-81.92 81.92z m-184.8832-287.2832a20.48 20.48 0 0 0-20.48 20.48v184.8832a20.48 20.48 0 0 0 20.48 20.48h184.8832a20.48 20.48 0 0 0 20.48-20.48v-184.8832a20.48 20.48 0 0 0-20.48-20.48z",fill:"#474A54","p-id":"15222"}),m.createElementVNode("path",{d:"M527.230586 280.884442m36.203867-36.203867l130.732164-130.732164q36.203867-36.203867 72.407735 0l130.732164 130.732164q36.203867 36.203867 0 72.407735l-130.732164 130.732164q-36.203867 36.203867-72.407735 0l-130.732164-130.732164q-36.203867-36.203867 0-72.407735Z",fill:"#FDA338","p-id":"15223"}),m.createElementVNode("path",{d:"M730.3168 493.4656a81.92 81.92 0 0 1-57.9072-23.9104L541.696 338.7904a81.92 81.92 0 0 1 0-115.8144L672.4096 92.16A81.92 81.92 0 0 1 788.48 92.16l130.7648 130.7136a81.92 81.92 0 0 1 0 115.8144L788.48 469.5552a81.92 81.92 0 0 1-58.1632 23.9104z m0-363.52a20.48 20.48 0 0 0-14.4896 5.9904L585.1136 266.24a20.48 20.48 0 0 0 0 28.9792l130.7136 130.7136a20.48 20.48 0 0 0 28.9792 0L875.52 295.3728a20.48 20.48 0 0 0 0-29.1328l-130.7136-130.56a20.48 20.48 0 0 0-14.4896-5.9904z",fill:"#474A54","p-id":"15224"})],-1)])],2)),[[d,m.unref(r).showToc?"关闭大纲":"打开大纲"]]):m.createCommentVNode("",!0),m.createVNode(js,{trigger:"click",placement:"top",value:t.value,"onUpdate:value":f[1]||(f[1]=h=>t.value=h),contentStyle:{padding:"6px 0",boxShadow:"0 6px 16px 0 rgba(0, 0, 0, 0.08)"}},{content:m.withCtx(()=>[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(m.unref(a).dicts.pageSizeOption,(h,p)=>(m.openBlock(),m.createElementBlock("div",{class:m.normalizeClass(["px-[12px] py-[7px] flex items-center gap-[0.4rem] cursor-pointer hover:bg-[rgb(242,243,245)]",s.value===h.label?"text-[#007aff]":""]),key:p,onClick:v=>l(h)},[m.createElementVNode("span",UBe,m.toDisplayString(h.label),1),h.width?(m.openBlock(),m.createElementBlock("span",WBe,m.toDisplayString(h.width)+" * "+m.toDisplayString(h.height)+"cm ",1)):m.createCommentVNode("",!0)],10,GBe))),128))]),default:m.withCtx(()=>[m.unref(a).layout.foot.pageSize?(m.openBlock(),m.createElementBlock("div",HBe,[f[4]||(f[4]=m.createElementVNode("span",{class:"flex-1 text-center text-[14px]"},"页面大小",-1)),m.createElementVNode("i",{class:m.normalizeClass(["w-iconfont icon-bottom !text-[8px] transition-transform duration-200",t.value?"rotate-180":""])},null,2)])):m.createCommentVNode("",!0)]),_:1},8,["value"]),m.createVNode(js,{trigger:"click",value:e.value,"onUpdate:value":f[2]||(f[2]=h=>e.value=h),placement:"top"},{content:m.withCtx(()=>[m.createElementVNode("div",KBe,[m.createElementVNode("div",YBe,[f[5]||(f[5]=m.createElementVNode("span",{class:"w-[80px]"},"字符数:",-1)),m.createTextVNode(" "+m.toDisplayString(o.value.characters),1)]),m.createElementVNode("div",XBe,[f[6]||(f[6]=m.createElementVNode("span",{class:"w-[80px]"},"段落:",-1)),m.createTextVNode(" "+m.toDisplayString(o.value.paragraphs),1)]),m.createElementVNode("div",ZBe,[f[7]||(f[7]=m.createElementVNode("span",{class:"w-[80px]"},"图片:",-1)),m.createTextVNode(" "+m.toDisplayString(o.value.images),1)]),m.createElementVNode("div",JBe,[f[8]||(f[8]=m.createElementVNode("span",{class:"w-[80px]"},"标题:",-1)),m.createTextVNode(" "+m.toDisplayString(o.value.headings),1)])])]),default:m.withCtx(()=>[m.unref(a).layout.foot.character?(m.openBlock(),m.createElementBlock("div",jBe,[m.createElementVNode("span",qBe,m.toDisplayString(o.value.characters)+" 字符",1),m.createElementVNode("i",{class:m.normalizeClass(["w-iconfont icon-bottom !text-[8px] transition-transform duration-200",e.value?"rotate-180":""])},null,2)])):m.createCommentVNode("",!0)]),_:1},8,["value"])])}}});var V1={exports:{}},e8e=V1.exports,Jz;function t8e(){return Jz||(Jz=1,(function(n,e){(function(t,r){r()})(e8e,function(){function t(u,c){return typeof c>"u"?c={autoBom:!1}:typeof c!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),c={autoBom:!c}),c.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(u.type)?new Blob(["\uFEFF",u],{type:u.type}):u}function r(u,c,f){var d=new XMLHttpRequest;d.open("GET",u),d.responseType="blob",d.onload=function(){l(d.response,c,f)},d.onerror=function(){console.error("could not download file")},d.send()}function i(u){var c=new XMLHttpRequest;c.open("HEAD",u,!1);try{c.send()}catch{}return 200<=c.status&&299>=c.status}function a(u){try{u.dispatchEvent(new MouseEvent("click"))}catch{var c=document.createEvent("MouseEvents");c.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),u.dispatchEvent(c)}}var o=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof Dy=="object"&&Dy.global===Dy?Dy:void 0,s=o.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=o.saveAs||(typeof window!="object"||window!==o?function(){}:"download"in HTMLAnchorElement.prototype&&!s?function(u,c,f){var d=o.URL||o.webkitURL,h=document.createElement("a");c=c||u.name||"download",h.download=c,h.rel="noopener",typeof u=="string"?(h.href=u,h.origin===location.origin?a(h):i(h.href)?r(u,c,f):a(h,h.target="_blank")):(h.href=d.createObjectURL(u),setTimeout(function(){d.revokeObjectURL(h.href)},4e4),setTimeout(function(){a(h)},0))}:"msSaveOrOpenBlob"in navigator?function(u,c,f){if(c=c||u.name||"download",typeof u!="string")navigator.msSaveOrOpenBlob(t(u,f),c);else if(i(u))r(u,c,f);else{var d=document.createElement("a");d.href=u,d.target="_blank",setTimeout(function(){a(d)})}}:function(u,c,f,d){if(d=d||open("","_blank"),d&&(d.document.title=d.document.body.innerText="downloading..."),typeof u=="string")return r(u,c,f);var h=u.type==="application/octet-stream",p=/constructor/i.test(o.HTMLElement)||o.safari,v=/CriOS\/[\d]+/.test(navigator.userAgent);if((v||h&&p||s)&&typeof FileReader<"u"){var g=new FileReader;g.onloadend=function(){var _=g.result;_=v?_:_.replace(/^data:[^;]*;/,"data:attachment/file;"),d?d.location.href=_:location=_,d=null},g.readAsDataURL(u)}else{var y=o.URL||o.webkitURL,b=y.createObjectURL(u);d?d.location=b:location.href=b,d=null,setTimeout(function(){y.revokeObjectURL(b)},4e4)}});o.saveAs=l.saveAs=l,n.exports=l})})(V1)),V1.exports}var n8e=t8e();const r8e=()=>{const n=document.createElement("iframe");return n.style.width="0",n.style.height="0",n.style.position="absolute",n.style.right="0",n.style.top="0",n.style.border="0",document.body.appendChild(n),n},i8e=async(n,e)=>{const t=r8e(),r=t.contentWindow;if(!t.contentDocument||!r)return;t.contentDocument.write(n),t.contentDocument.close();const i=()=>{console.log("handleLoadIframe"),r.focus(),r.print()},a=()=>{t.removeEventListener("load",i),r.removeEventListener("afterprint",a),document.body.removeChild(t),e()};t.addEventListener("load",i),r.addEventListener("afterprint",a)},a8e=m.defineComponent({__name:"print",setup(n){const e=m.inject("options"),t=m.inject("container"),r=m.inject("page"),i=m.computed(()=>e.value?.dicts?.lineHeights?.find(c=>c.default)?.value??1.7),a=()=>{const c=document.querySelector(`#${t.value} .white-editor-container`)?.outerHTML??"";return s(c)},o=()=>Array.from(document.querySelectorAll("link, style")).map(c=>c.outerHTML).join(""),s=c=>{const f=document.createElement("div");f.innerHTML=c;const d=f.querySelectorAll(".white-chart-node");for(const h of d){const p=dW(h);if(p){const v=p.getDataURL({type:"png",pixelRatio:2,backgroundColor:"#fff"}),g=document.createElement("img");g.src=v,g.style.width="100%",h?.parentNode?.replaceChild(g,h)}}return f.innerHTML},l=()=>{const{size:c,margin:f}=r.value;return`
314
314
  <!DOCTYPE html>
315
315
  <html lang="zh-CN">
316
316
  <head>
@@ -368,6 +368,6 @@ echarts.use([`+F+"]);":"Unknown series "+V))}return}if(f==="tooltip"){if(_){proc
368
368
  });
369
369
  <\/script>
370
370
  </body>
371
- </html>`},u=async()=>{a8e(l(),()=>{console.log("打印完成")})};return(c,f)=>(m.openBlock(),m.createElementBlock("div",{class:"px-[12px] py-[5px] flex items-center gap-[0.4rem] cursor-pointer hover:bg-[rgb(242,243,245)]",onClick:f[0]||(f[0]=d=>u())},[...f[1]||(f[1]=[m.createElementVNode("i",{class:"w-iconfont icon-export-pdf"},null,-1),m.createTextVNode(" 导出为PDF ",-1)])]))}}),s8e={class:"flex items-center gap-[20px] text-[#333] foot-action"},l8e={key:0,class:"cursor-pointer flex items-center gap-[0.4rem] text-[14px] hover:text-[#007aff]"},u8e=m.defineComponent({__name:"FootRight",setup(n){const e=m.inject("editor"),t=m.inject("options"),r=async()=>{if(!e.value)return;const a=e.value.getHTML(),{toClipboard:o}=lN();await o(a)},i=()=>{if(!e.value)return;const a=new Blob([e.value.getText()],{type:"text/plain;charset=utf-8"}),{title:o}=t.value.document??{},s=o!==""?t.value?.document?.title:"无标题文档";r8e.saveAs(a,`${s}.txt`)};return(a,o)=>(m.openBlock(),m.createElementBlock("div",s8e,[m.unref(t).layout.foot.copy?(m.openBlock(),m.createElementBlock("span",{key:0,class:"cursor-pointer flex items-center gap-[0.4rem] text-[14px] hover:text-[#007aff]",onClick:o[0]||(o[0]=s=>r())},[...o[2]||(o[2]=[m.createElementVNode("i",{class:"w-iconfont icon-copy-content"},null,-1),m.createTextVNode(" 复制全文 ",-1)])])):m.createCommentVNode("",!0),m.createVNode(js,{trigger:"click",placement:"top",contentStyle:{padding:"6px 0",boxShadow:"0 6px 16px 0 rgba(0, 0, 0, 0.08)"}},{content:m.withCtx(()=>[m.createElementVNode("div",{class:"px-[12px] py-[5px] flex items-center gap-[0.4rem] cursor-pointer hover:bg-[rgb(242,243,245)]",onClick:o[1]||(o[1]=s=>i())},[...o[4]||(o[4]=[m.createElementVNode("i",{class:"w-iconfont icon-text"},null,-1),m.createTextVNode(" 导出为文本 ",-1)])]),m.createVNode(o8e)]),default:m.withCtx(()=>[m.unref(t).layout.foot.download?(m.openBlock(),m.createElementBlock("span",l8e,[...o[3]||(o[3]=[m.createElementVNode("i",{class:"w-iconfont icon-down"},null,-1),m.createTextVNode(" 下载 ",-1)])])):m.createCommentVNode("",!0)]),_:1})]))}}),c8e={class:"w-full h-full flex items-center justify-between"},f8e=m.defineComponent({__name:"index",setup(n){return(e,t)=>(m.openBlock(),m.createElementBlock("div",c8e,[m.createVNode(e8e),m.createVNode(u8e)]))}}),d8e=["width","height"],h8e={class:"text-[#666]"},p8e=m.defineComponent({__name:"Nodata",props:{size:{default:"1em"},top:{default:"30%"},title:{default:"暂无数据"}},setup(n){return(e,t)=>(m.openBlock(),m.createElementBlock("div",{class:"flex items-center justify-center flex-col gap-2",style:m.normalizeStyle({paddingTop:n.top})},[(m.openBlock(),m.createElementBlock("svg",{t:"1766712532477",class:"icon",viewBox:"0 0 1030 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:n.size,height:n.size},[...t[0]||(t[0]=[m.createStaticVNode('<path d="M927.053254 896q0 1.254249-0.496852 2.508497t-1.484497 2.508497q-0.993704 1.248189-2.48426 2.49032-1.478438 1.248189-3.453728 2.48426-1.969231 1.230012-4.429254 2.447905-2.453964 1.217893-5.392663 2.423669-2.938698 1.199716-6.343953 2.381254-3.405254 1.187598-7.277065 2.3449-3.87787 1.163361-8.198059 2.302485-4.320189 1.133065-9.088757 2.241893t-9.967338 2.181302q-5.210888 1.084592-10.82168 2.126769-5.616852 1.048237-11.645728 2.060119-6.022817 1.005822-12.439479 1.97529-6.422722 0.969467-13.208994 1.90258-6.792331 0.933112-13.948213 1.817751-7.149822 0.890698-14.645018 1.738982-7.495195 0.842225-15.311527 1.635977-7.822391 0.799811-15.94168 1.551148-8.125349 0.745278-16.541539 1.442082-8.404071 0.702864-17.086863 1.345137-8.670675 0.648331-17.589776 1.24213-8.919101 0.593799-18.068449 1.127006-9.14329 0.539266-18.480474 1.01794-9.349302 0.484734-18.874319 0.908876-9.518959 0.424142-19.201515 0.787693-9.676497 0.36355-19.492355 0.666508-9.809799 0.302959-19.728663 0.551385-9.918864 0.242367-19.928615 0.430201-9.997633 0.181775-20.067977 0.302959-10.064284 0.127243-20.170982 0.187834-10.100639 0.060592-20.213396 0.060592-10.118817 0-20.219456-0.060592-10.100639-0.060592-20.164923-0.181775-10.070343-0.121183-20.074035-0.302959-10.003692-0.187834-19.922557-0.43626-9.924923-0.242367-19.734722-0.545325-9.815858-0.309018-19.492355-0.672568-9.676497-0.36355-19.201514-0.787693-9.518959-0.424142-18.868261-0.908876-9.343243-0.478675-18.486532-1.01794-9.14329-0.533207-18.062391-1.127006t-17.595834-1.24213q-8.676734-0.642272-17.086864-1.345137-8.41013-0.696805-16.535479-1.442082-8.11929-0.751337-15.935622-1.551148-7.822391-0.793751-15.317585-1.635977-7.495195-0.848284-14.651077-1.732923-7.149822-0.890698-13.936095-1.817751-6.798391-0.933112-13.208994-1.908639-6.422722-0.969467-12.445539-1.981349-6.028876-1.005822-11.645727-2.05406-5.622911-1.042178-10.821681-2.12071t-9.967337-2.187361q-4.768568-1.108828-9.088757-2.241893-4.326249-1.139124-8.19806-2.302485-3.871811-1.157302-7.277065-2.3449-3.411314-1.181538-6.343952-2.387313-2.938698-1.199716-5.392663-2.423669-2.460024-1.211834-4.435314-2.447905-1.969231-1.230012-3.453728-2.478201-1.484497-1.24213-2.478201-2.49032-0.987645-1.254249-1.484497-2.508497-0.496852-1.254249-0.496852-2.508497 0-1.260308 0.496852-2.514556t1.484497-2.508497q0.993704-1.248189 2.478201-2.49032 1.484497-1.24213 3.453728-2.478201 1.97529-1.230012 4.435314-2.453964 2.453964-1.211834 5.392663-2.423669 2.932639-1.199716 6.343952-2.381255 3.405254-1.181538 7.271006-2.344899 3.87787-1.163361 8.198059-2.302485 4.326249-1.133065 9.094817-2.241894 4.768568-1.108828 9.967337-2.181301 5.198769-1.084592 10.821681-2.12677 5.616852-1.042178 11.645727-2.060118 6.022817-1.005822 12.43948-1.97529 6.422722-0.969467 13.208994-1.90258 6.792331-0.933112 13.942154-1.817751 7.149822-0.890698 14.651077-1.732923 7.495195-0.848284 15.311526-1.642036 7.816331-0.799811 15.941681-1.551148 8.125349-0.745278 16.535479-1.442083 8.41013-0.702864 17.086864-1.345136 8.676734-0.648331 17.595834-1.24213 8.919101-0.58774 18.062391-1.127006 9.149349-0.539266 18.486532-1.017941 9.349302-0.484734 18.868261-0.908875 9.525018-0.424142 19.207574-0.787693 9.676497-0.36355 19.486295-0.666509 9.815858-0.302959 19.734722-0.551384 9.918864-0.242367 19.922557-0.430201 10.003692-0.181775 20.074035-0.302959 10.058225-0.127243 20.164923-0.187834 10.100639-0.060592 20.219456-0.060592 10.118817 0 20.213396 0.060592 10.106698 0.060592 20.170982 0.181775 10.064284 0.121183 20.067977 0.309018 10.009751 0.181775 19.928615 0.424142 9.918864 0.248426 19.728663 0.557443 9.815858 0.302959 19.492355 0.666509 9.682556 0.36355 19.207574 0.787693 9.518959 0.424142 18.862201 0.908875 9.343243 0.484734 18.486533 1.017941 9.149349 0.539266 18.068449 1.127006 8.919101 0.593799 17.595835 1.24213 8.676734 0.642272 17.086864 1.345136 8.41013 0.696805 16.535479 1.442083 8.11929 0.751337 15.935621 1.551148 7.816331 0.793751 15.317586 1.635976 7.495195 0.848284 14.645018 1.738983 7.149822 0.884639 13.948213 1.817751 6.786272 0.933112 13.208994 1.90258 6.416663 0.969467 12.439479 1.981349 6.028876 1.011882 11.645728 2.054059 5.616852 1.042178 10.82168 2.12071 5.198769 1.078533 9.967338 2.187361t9.088757 2.241894q4.326249 1.139124 8.198059 2.302485t7.271006 2.344899q3.411314 1.181538 6.350012 2.387314 2.938698 1.199716 5.392663 2.423669 2.460024 1.211834 4.423195 2.447905 1.981349 1.236071 3.465846 2.478201 1.484497 1.24213 2.478201 2.49032 0.987645 1.254249 1.484497 2.508497 0.496852 1.254249 0.496852 2.514556z" fill="#007bff" opacity=".1"></path><path d="M117.426746 376.832c0 8.70703 6.695385 15.36 15.450887 15.36 8.755503 0 15.450888-6.65297 15.450888-15.36 0-8.70097-6.695385-15.36-15.450888-15.36-8.240473 0-15.450888 7.168-15.450887 15.36z m814.776804 455.16497c-19.571124 5.12-23.691361 9.222059-28.326627 28.16303-5.150296-19.449941-9.270533-23.552-28.326627-28.16303 19.056095-5.12 23.691361-9.209941 28.326627-28.15697 4.635266 18.94703 8.755503 23.552 28.326627 28.15697zM203.436686 323.07503c-25.23645 6.65297-30.386746 11.77297-37.08213 36.864-6.695385-25.08497-11.84568-30.21103-37.08213-36.864 25.23645-6.65903 30.386746-12.288 37.08213-36.864 6.180355 25.08497 11.84568 30.20497 37.08213 36.864z m618.035503-88.064c-15.450888 4.096-18.541065 7.168-22.661301 22.528-4.120237-15.36-7.210414-18.432-22.661302-22.528 15.450888-4.096 18.541065-7.168 22.661302-22.528 3.605207 15.36 7.210414 18.432 22.661301 22.528z m66.438817-78.848c-40.172308 10.24-48.412781 18.94097-59.228402 58.87697-10.300592-39.929941-19.056095-48.128-59.228403-58.87697 40.172308-10.24 48.412781-18.94703 59.228403-58.88303 10.300592 39.42703 19.056095 48.128 59.228402 58.88303z" fill="#007bff" opacity=".5"></path><path d="M422.32426 713.21297v4.096l33.991953 31.23503 130.302485-62.97903-117.941775 75.26703v36.864l19.056095-18.432v-0.51503 0.51503l19.056094 18.432 100.945799-122.88v-4.096l-185.410651 42.49297z" fill="#007bff" opacity=".2"></path><path d="M865.249704 551.936v-1.024c0-1.024-0.51503-1.53297-0.515029-2.55697v-0.51503L754.003314 260.61103c-15.965917-48.64303-61.288521-81.41103-112.79148-81.41103H389.362367c-51.502959 0-96.825562 32.768-112.791479 81.41103L165.839527 547.84v0.51503c-0.51503 1.024-0.51503 1.53297-0.51503 2.55697v206.848c0 65.02097 53.048047 117.76 118.456805 117.76h463.526627c65.408757 0 118.456805-52.73903 118.456805-117.76v-204.8c-0.51503-0.50897-0.51503-0.50897-0.51503-1.024zM305.412544 271.36q0-0.50897 0.51503-0.50897c11.330651-36.864 45.322604-60.93103 83.434793-60.93103h251.334438c38.112189 0 72.104142 24.06703 83.949822 60.416q0 0.51503 0.51503 0.51503l102.490887 266.24H592.284024c-8.755503 0-15.450888 6.65297-15.450888 15.36 0 33.792-27.811598 61.44-61.80355 61.44-33.991953 0-61.80355-27.648-61.80355-61.44 0-8.70703-6.695385-15.36-15.450888-15.36H202.921657l102.490887-265.73103zM834.347929 757.76c0 48.128-39.142249 87.04-87.55503 87.04h-463.526627c-48.412781 0-87.55503-38.912-87.555029-87.04V568.32h228.158106c7.210414 43.52303 45.322604 76.8 91.160237 76.8 45.837633 0 83.949822-33.27697 91.160236-76.8H834.347929v189.44z" fill="#007bff" opacity=".5"></path><path d="M515.029586 578.566059c-14.420828 0-25.751479-11.264-25.751479-25.6v-51.2H254.939645l84.464852-219.136 0.51503-1.024c7.210414-21.504 26.781538-35.84 49.44284-35.84h251.334438c22.661302 0 42.232426 14.336 49.44284 35.84l0.51503 1.024 84.464852 219.136H540.781065v51.2c0 14.336-11.330651 25.6-25.751479 25.6z" fill="#007bff" opacity=".2"></path>',5)])],8,d8e)),m.createElementVNode("p",h8e,m.toDisplayString(n.title),1)],4))}}),v8e={class:"w-[260px] h-full flex flex-col overflow-hidden"},g8e={key:0,class:"h-[50px] flex-none flex items-center px-4 text-[15px] text-[#666] hover:text-[#333]"},m8e={class:"overflow-y-auto min-h-0"},y8e={key:0,class:"flex-1 px-4 py-2 space-y-[0.3rem]"},b8e=["onClick"],x8e=m.defineComponent({__name:"EditorToc",setup(n){const e=m.inject("editor"),t=m.inject("page"),r=m.inject("options"),i=m.ref([]),a=m.ref(""),o=Oue(()=>{i.value=e.value.storage.tableOfContents.content},200);m.watch(()=>e.value?.storage.tableOfContents.content,()=>{o()},{immediate:!0});const s=l=>{if(!e.value)return;a.value=l.id;const u=e.value.view.dom.querySelector(`[data-toc-id="${l.id}"]`);if(!u)return;u.scrollIntoView({behavior:"smooth"});const c=e.value.view.posAtDOM(u,0),{tr:f}=e.value.view.state,d=f.doc.nodeAt(c);if(d){const h=c+d.nodeSize;f.setSelection(Ut.create(f.doc,h))}else f.setSelection(new Ut(f.doc.resolve(c)));e.value.view.dispatch(f),e.value.view.focus()};return(l,u)=>(m.openBlock(),m.createElementBlock("div",v8e,[m.unref(r).layout.foot.show?(m.openBlock(),m.createElementBlock("div",g8e,[m.createElementVNode("span",{class:"flex items-center gap-2 cursor-pointer",onClick:u[0]||(u[0]=c=>m.unref(t).showToc=!1)},[...u[1]||(u[1]=[m.createElementVNode("i",{class:"w-iconfont icon-left !text-[12px]"},null,-1),m.createTextVNode(" 收起大纲 ",-1)])])])):m.createCommentVNode("",!0),m.createElementVNode("div",m8e,[i.value?.length?(m.openBlock(),m.createElementBlock("ul",y8e,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(i.value,c=>(m.openBlock(),m.createElementBlock("li",{key:c.id,class:m.normalizeClass(["cursor-pointer text-[#333] text-[14px] h-[34px] block leading-[34px] pr-2 hover:text-[#101219] rounded text-ellipsis overflow-hidden whitespace-nowrap",a.value===c.id?"font-bold bg-[#f5f5f5]":""]),style:m.normalizeStyle({textIndent:`${c.level}rem`}),onClick:f=>s(c)},m.toDisplayString(c.textContent),15,b8e))),128))])):(m.openBlock(),m.createBlock(p8e,{key:1,size:"120px"}))])]))}}),_8e=m.defineComponent({__name:"flip",setup(n){const e=m.inject("editor"),t=m.computed(()=>{const a=e.value?Fl(e.value):null;return a?.type?.name?e.value?.getAttributes(a?.type?.name)?.flipY:!1}),r=m.computed(()=>{const a=e.value?Fl(e.value):null;return a?.type?.name?e.value?.getAttributes(a?.type?.name)?.flipX:!1}),i=a=>{const o=e.value?Fl(e.value):null,{flipX:s,flipY:l}=o?.attrs??{};o&&a==="flipX"&&e.value?.commands.updateAttributes(o.type,{flipX:!s}),o&&a==="flipY"&&e.value?.commands.updateAttributes(o.type,{flipY:!l})};return(a,o)=>(m.openBlock(),m.createElementBlock(m.Fragment,null,[m.createVNode(An,{ico:"flip-x",text:"水平翻转","hide-text":"","menu-active":t.value,onMenuClick:o[0]||(o[0]=s=>i("flipY"))},null,8,["menu-active"]),m.createVNode(An,{ico:"flip-y",text:"垂直翻转","hide-text":"","menu-active":r.value,onMenuClick:o[1]||(o[1]=s=>i("flipX"))},null,8,["menu-active"])],64))}}),JY=m.defineComponent({__name:"open",setup(n){const e=m.inject("editor"),t=()=>{const r=e.value?Fl(e?.value):null;window.open(r?.attrs.src)};return(r,i)=>(m.openBlock(),m.createBlock(An,{ico:"open",text:"新窗口打开",shortcut:"Backspace","hide-text":"",onMenuClick:t}))}}),S8e=m.defineComponent({__name:"covert",setup(n){const e=m.inject("editor"),t=m.computed(()=>(e.value?Fl(e.value):null)?.type?.name==="inlineImage"?"转为节点图片":"转为行内图片"),r=()=>{const i=e.value?Fl(e.value):null;if(i){const a=i?.type?.name==="inlineImage"?"inlineImage":"image",o=i.attrs??{};!o.error&&o.src&&(e.value?.chain().focus().deleteSelectionNode().run(),a==="inlineImage"?e.value?.chain().focus().setImage({...o,equalProportion:!1,inline:!1}).run():e.value?.chain().focus().setInlineImage({...o,inline:!0,equalProportion:!1}).run())}};return(i,a)=>(m.openBlock(),m.createBlock(An,{ico:"huantu",text:t.value,"hide-text":"",onMenuClick:r},null,8,["text"]))}}),Rd=m.defineComponent({__name:"delete",setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createBlock(An,{ico:"remove",text:"删除",shortcut:"Backspace","hide-text":"",onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.chain().focus().deleteSelectionNode().run())}))}}),w8e={class:"flex items-center gap-2"},k8e=m.defineComponent({__name:"image-menu",setup(n){return(e,t)=>(m.openBlock(),m.createElementBlock("div",w8e,[m.createVNode(Xp),m.createVNode(Kp),m.createVNode(Yp),m.createVNode(_8e),m.createVNode(S8e),m.createVNode(JY),m.createVNode(Rd)]))}}),T8e=m.defineComponent({__name:"down",setup(n){const e=m.inject("editor"),t=()=>{const r=e.value?Fl(e.value):null,i=document.createElement("a");i.href=r?.attrs.url,i.download=r?.attrs.name,i&&(document.body.appendChild(i),i.click(),document.body.removeChild(i))};return(r,i)=>m.unref(e)?.getAttributes("file")?.uploaded?(m.openBlock(),m.createBlock(An,{key:0,ico:"down",text:"下载","hide-text":"",onMenuClick:i[0]||(i[0]=a=>t())})):m.createCommentVNode("",!0)}}),C8e={class:"flex items-center gap-2"},E8e=m.defineComponent({__name:"file-menu",setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createElementBlock("div",C8e,[m.createVNode(Xp),m.createVNode(Kp),m.createVNode(Yp),m.unref(e)?.isActive("file")||m.unref(e)?.isActive("video")||m.unref(e)?.isActive("audio")?(m.openBlock(),m.createBlock(T8e,{key:0})):m.createCommentVNode("",!0),m.createVNode(Rd)]))}}),M8e=m.defineComponent({__name:"cell-background",props:{text:{type:String,default:""},defaultColor:{type:String,default:"#007bff"}},setup(n){const e=n,t=m.inject("editor"),r=m.ref(!1),i=m.ref(e.defaultColor),a=s=>{i.value=s,r.value=!1;const l=s===""?null:s;t.value?.chain().focus().setCellAttribute("background",l).run()},o=aA(s=>{i.value=s,r.value=!1;const l=s===""?null:s;t.value?.chain().focus().setCellAttribute("background",l).run()},200);return m.watch(()=>i.value,s=>{o(s)}),(s,l)=>(m.openBlock(),m.createBlock(il,{ico:"fill",text:"填充背景","hide-text":"","popup-visible":r.value,"onUpdate:popupVisible":l[1]||(l[1]=u=>r.value=u),disabled:!m.unref(t)?.can().setCellAttribute("background",""),"popup-type":"arrow",onMenuClick:l[2]||(l[2]=u=>a(i.value))},{content:m.withCtx(()=>[m.createVNode(m.unref(VO),{modelValue:i.value,"onUpdate:modelValue":l[0]||(l[0]=u=>i.value=u)},null,8,["modelValue"])]),default:m.withCtx(()=>[m.createElementVNode("div",{class:"w-[14px] h-[2px] mx-auto",style:m.normalizeStyle({backgroundColor:i.value})},null,4)]),_:1},8,["popup-visible","disabled"]))}}),A8e=m.defineComponent({__name:"cell-insert",props:{hideText:{type:Boolean,default:!0}},setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createElementBlock(m.Fragment,null,[m.createVNode(An,{ico:"charutop",text:"上方插入一行","hide-text":n.hideText,disabled:!m.unref(e)?.can().addRowBefore(),onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.chain().focus().addRowBefore().run())},null,8,["hide-text","disabled"]),m.createVNode(An,{ico:"charubottom",text:"下方插入一行","hide-text":n.hideText,disabled:!m.unref(e)?.can().addRowAfter(),onMenuClick:r[1]||(r[1]=i=>m.unref(e)?.chain().focus().addRowAfter().run())},null,8,["hide-text","disabled"]),m.createVNode(An,{ico:"charuleft",text:"左方插入一列","hide-text":n.hideText,disabled:!m.unref(e)?.can().addColumnBefore(),onMenuClick:r[2]||(r[2]=i=>m.unref(e)?.chain().focus().addColumnBefore().run())},null,8,["hide-text","disabled"]),m.createVNode(An,{ico:"charuright",text:"右方插入一列","hide-text":n.hideText,disabled:!m.unref(e)?.can().addColumnAfter(),onMenuClick:r[3]||(r[3]=i=>m.unref(e)?.chain().focus().addColumnAfter().run())},null,8,["hide-text","disabled"])],64))}}),N8e=m.defineComponent({__name:"cell-delete",props:{hideText:{type:Boolean,default:!0}},setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createElementBlock(m.Fragment,null,[m.createVNode(An,{ico:"removehang",text:"删除行","hide-text":n.hideText,disabled:!m.unref(e)?.can().deleteColumn(),onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.chain().focus().deleteRow().run())},null,8,["hide-text","disabled"]),m.createVNode(An,{ico:"removelie",text:"删除列","hide-text":n.hideText,disabled:!m.unref(e)?.can().deleteColumn(),onMenuClick:r[1]||(r[1]=i=>m.unref(e)?.chain().focus().deleteColumn().run())},null,8,["hide-text","disabled"])],64))}}),D8e=m.defineComponent({__name:"cell-merge",props:{hideText:{type:Boolean,default:!0}},setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createElementBlock(m.Fragment,null,[m.createVNode(An,{ico:"merge-cell",text:"合并单元格","hide-text":n.hideText,disabled:!m.unref(e)?.can().mergeCells(),onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.chain().focus().mergeCells().run())},null,8,["hide-text","disabled"]),m.createVNode(An,{ico:"split-cell",text:"拆分单元格","hide-text":n.hideText,disabled:!m.unref(e)?.can().splitCell(),onMenuClick:r[1]||(r[1]=i=>m.unref(e)?.chain().focus().splitCell().run())},null,8,["hide-text","disabled"])],64))}}),O8e=m.defineComponent({__name:"table-delete",setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createBlock(An,{ico:"remove",text:"删除表格",shortcut:"Backspace","hide-text":"",disabled:!m.unref(e)?.can().deleteTable(),onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.chain().focus().deleteTable().run())},null,8,["disabled"]))}}),I8e={class:"flex items-center gap-2"},R8e=m.defineComponent({__name:"table-menu",setup(n){return(e,t)=>(m.openBlock(),m.createElementBlock("div",I8e,[m.createVNode(Xp),m.createVNode(Kp),m.createVNode(Yp),m.createVNode(M8e),m.createVNode(A8e),m.createVNode(N8e),m.createVNode(D8e),m.createVNode(O8e)]))}}),L8e=m.defineComponent({__name:"tag-input",setup(n){const e=m.ref(""),t=m.inject("editor"),r=()=>{if(e.value==="")return;t.value?.state?.selection?.$from?.node()&&t.value?.commands.updateAttributes("tag",{text:e.value})},i=()=>{const a=t.value?.getAttributes("tag");a?.text&&(e.value=a.text)};return m.onMounted(()=>{i(),t.value?.on("selectionUpdate",i)}),m.onBeforeUnmount(()=>{t.value?.off("selectionUpdate")}),(a,o)=>(m.openBlock(),m.createElementBlock(m.Fragment,null,[m.createVNode(lm,{placeholder:"请输入标签",value:e.value,"onUpdate:value":o[0]||(o[0]=s=>e.value=s),size:"small"},null,8,["value"]),m.createVNode(Wo,{type:"primary",size:"small",onClick:o[1]||(o[1]=s=>r())},{default:m.withCtx(()=>[...o[2]||(o[2]=[m.createTextVNode("确认",-1)])]),_:1})],64))}}),P8e={class:"px-2"},B8e=["onClick"],V8e=m.defineComponent({__name:"tag-color",setup(n){const e=m.inject("editor"),t=m.ref("#007bff"),r=m.ref(!1),i=[{label:"蓝色",color:"#007bff",bgcolor:"rgb(217, 231, 255)"},{label:"红色",color:"rgba(200, 78, 67, 1)",bgcolor:"rgb(252, 223, 220)"},{label:"黄色",color:"rgba(240, 196, 23, 1)",bgcolor:"rgb(255, 245, 210)"},{label:"绿色",color:"rgba(5, 205, 153, 1)",bgcolor:"rgb(205, 245, 235)"},{label:"紫色",color:"#e6afff",bgcolor:"rgb(220, 223, 252)"}],a=s=>{e.value?.state?.selection?.$from?.node()&&e.value?.commands.updateAttributes("tag",{type:s.type,color:s.color,backgroundColor:s.bgcolor}),t.value=s?.bgcolor,r.value=!1},o=()=>{e.value?.state?.selection?.$from?.node()&&e.value?.commands.updateAttributes("tag",{type:"default",color:"#999",backgroundColor:"rgba(0, 0, 0, 0.05)"}),t.value="rgba(0, 0, 0, 0.05)",r.value=!1};return(s,l)=>(m.openBlock(),m.createBlock(wS,{ico:"fill",text:"高亮填充","hide-text":"",onMenuClick:l[1]||(l[1]=u=>a()),maxHeight:!1,"popup-visible":r.value,"onUpdate:popupVisible":l[2]||(l[2]=u=>r.value=u)},{content:m.withCtx(()=>[m.createElementVNode("div",P8e,[(m.openBlock(),m.createElementBlock(m.Fragment,null,m.renderList(i,(u,c)=>m.createElementVNode("div",{key:c,onClick:f=>a(u),style:m.normalizeStyle({backgroundColor:u.bgcolor}),class:"h-[30px] w-[90px] flex items-center justify-center gap-2 mb-2 rounded-[3px] cursor-pointer"},[l[3]||(l[3]=m.createElementVNode("i",{class:"w-iconfont icon-tumo !text-[14px]"},null,-1)),m.createTextVNode(" "+m.toDisplayString(u.label),1)],12,B8e)),64)),m.createElementVNode("div",{class:"h-[30px] w-[90px] flex items-center justify-center gap-2 mb-2 rounded-[3px] cursor-pointer border",onClick:l[0]||(l[0]=u=>o())},[...l[4]||(l[4]=[m.createElementVNode("i",{class:"w-iconfont icon-clear-format !text-[14px]"},null,-1),m.createTextVNode(" 清除 ",-1)])])])]),_:1},8,["popup-visible"]))}}),z8e={class:"flex items-center gap-2"},F8e=m.defineComponent({__name:"tag-menu",setup(n){return(e,t)=>(m.openBlock(),m.createElementBlock("div",z8e,[m.createVNode(L8e),m.createVNode(V8e),m.createVNode(Rd)]))}}),$8e=m.defineComponent({__name:"ai-operation",setup(n){const e=m.inject("editor"),t=m.inject("assistant"),r=()=>{t.value=!0,e.value?.commands.focus()};return(i,a)=>(m.openBlock(),m.createBlock(An,{ico:"ai-assistant",text:"AI智能助手","hide-text":"",onMenuClick:r}))}}),H8e={class:"px-2"},G8e=["onClick"],U8e=m.defineComponent({__name:"high-background",setup(n){const e=m.inject("editor"),t=m.ref("#007bff"),r=m.ref(!1),i=[{label:"默认",bgcolor:"#007bff"},{label:"红色",bgcolor:"#ff8a8a"},{label:"黄色",bgcolor:"#ffff8a"},{label:"绿色",bgcolor:"#a7ffa7"},{label:"紫色",bgcolor:"#e6afff"},{label:"蓝色",bgcolor:"#83d3ff"}],a=s=>{if(!s){e.value?.chain().focus().setHighlight({color:i[0].bgcolor}).run();return}t.value=s?.bgcolor,e.value?.chain().focus().setHighlight({color:s.bgcolor}).run(),r.value=!1},o=()=>{e.value?.chain().focus().unsetHighlight().run(),t.value="#007bff",r.value=!1};return(s,l)=>(m.openBlock(),m.createBlock(wS,{ico:"fill",text:"高亮填充","hide-text":"",onMenuClick:l[1]||(l[1]=u=>a()),maxHeight:!1,"popup-visible":r.value,"onUpdate:popupVisible":l[2]||(l[2]=u=>r.value=u)},{content:m.withCtx(()=>[m.createElementVNode("div",H8e,[(m.openBlock(),m.createElementBlock(m.Fragment,null,m.renderList(i,(u,c)=>m.createElementVNode("div",{key:c,onClick:f=>a(u),style:m.normalizeStyle({backgroundColor:u.bgcolor}),class:"h-[30px] w-[90px] flex items-center justify-center gap-2 mb-2 rounded-[3px] cursor-pointer"},[l[3]||(l[3]=m.createElementVNode("i",{class:"w-iconfont icon-tumo !text-[14px]"},null,-1)),m.createTextVNode(" "+m.toDisplayString(u.label),1)],12,G8e)),64)),m.createElementVNode("div",{class:"h-[30px] w-[90px] flex items-center justify-center gap-2 mb-2 rounded-[3px] cursor-pointer border",onClick:l[0]||(l[0]=u=>o())},[...l[4]||(l[4]=[m.createElementVNode("i",{class:"w-iconfont icon-clear-format !text-[14px]"},null,-1),m.createTextVNode(" 清除 ",-1)])])])]),_:1},8,["popup-visible"]))}}),W8e={class:"flex items-center gap-2"},j8e=m.defineComponent({__name:"text-menu",setup(n){return(e,t)=>(m.openBlock(),m.createElementBlock("div",W8e,[m.createVNode($8e),m.createVNode(WM),m.createVNode(jM),m.createVNode(qM),m.createVNode(KM),m.createVNode(XY),m.createVNode(U8e),m.createVNode(Rd)]))}}),q8e={class:"flex items-center gap-2"},K8e={key:0,class:"flex items-center gap-2 py-2 px-1"},Y8e={class:"flex-1 h-[90px] flex flex-col justify-between gap-1"},X8e={class:"mb-2"},Z8e={class:"flex items-center gap-2"},J8e=["innerHTML"],Q8e={key:1,class:"text-[12px] text-[#999]"},e6e=["onClick"],t6e=["innerHTML"],n6e={class:"flex items-center gap-2"},r6e=m.defineComponent({__name:"iframe-menu",setup(n){const e=m.inject("editor"),t=m.ref(),r=m.ref(""),i=m.ref(""),a=m.computed(()=>qv.find(l=>l.value===i.value)),o=l=>{i.value=l.value,t.value?.changePopoverVisible(!1)},s=()=>{const{validate:l,transformURL:u}=qv.find(c=>c.value===i.value);l&&!l(r.value)||e.value.chain().focus().setParagraph().setIframe({type:i.value,src:u?u(r.value):r.value}).run()};return(l,u)=>(m.openBlock(),m.createElementBlock("div",q8e,[m.unref(e)?.getAttributes("iframe").src==""?(m.openBlock(),m.createElementBlock("div",K8e,[u[3]||(u[3]=m.createElementVNode("div",{class:"flex flex-col items-center gap-1 h-[80px]"},[m.createElementVNode("span",{class:"w-[24px] h-[24px] text-center rounded-full bg-[#007bff] text-[12px] text-[#fff] font-500",style:{"line-height":"24px"}}," 1 "),m.createElementVNode("div",{class:"w-[1px] flex-1 bg-[#e5e5e5]"}),m.createElementVNode("span",{class:"w-[24px] h-[24px] text-center rounded-full bg-[#007bff] text-[12px] text-[#fff] font-500",style:{"line-height":"24px"}}," 2 ")],-1)),m.createElementVNode("div",Y8e,[m.createElementVNode("div",X8e,[m.createVNode(wg,{value:i.value,"onUpdate:value":u[0]||(u[0]=c=>i.value=c),options:m.unref(qv),placeholder:"选择网页类型",class:"w-full",ref_key:"selectRef",ref:t},{main:m.withCtx(()=>[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(m.unref(qv),(c,f)=>(m.openBlock(),m.createElementBlock("div",{key:c.value,class:m.normalizeClass(["flex items-center gap-2 h-[32px] px-2 cursor-pointer rounded-[4px] hover:bg-[rgb(242,243,245)]",{"bg-[rgb(242,243,245)]":i.value===c.value,"mb-1":f!==m.unref(qv).length-1}]),onClick:d=>o(c)},[m.createElementVNode("span",{innerHTML:c.icon},null,8,t6e),m.createTextVNode(" "+m.toDisplayString(c.label),1)],10,e6e))),128))]),default:m.withCtx(()=>[m.createElementVNode("div",Z8e,[a.value&&Object.keys(a.value).length?(m.openBlock(),m.createElementBlock(m.Fragment,{key:0},[m.createElementVNode("span",{innerHTML:a.value.icon},null,8,J8e),m.createTextVNode(" "+m.toDisplayString(a.value.label),1)],64)):(m.openBlock(),m.createElementBlock("span",Q8e,"选择网页类型"))])]),_:1},8,["value","options"])]),m.createElementVNode("div",n6e,[m.createVNode(lm,{value:r.value,"onUpdate:value":u[1]||(u[1]=c=>r.value=c),placeholder:"打开网址复制链接,以http:// 或 https:// 开头",class:"w-[300px]"},null,8,["value"]),m.createVNode(Wo,{type:"primary",size:"small",disabled:!r.value,onClick:s},{default:m.withCtx(()=>[...u[2]||(u[2]=[m.createTextVNode("添加",-1)])]),_:1},8,["disabled"])])])])):(m.openBlock(),m.createElementBlock(m.Fragment,{key:1},[m.createVNode(Xp),m.createVNode(Kp),m.createVNode(Yp),m.createVNode(JY),m.createVNode(Rd)],64))]))}}),i6e={class:"flex items-center gap-2"},a6e=m.defineComponent({__name:"echarts-menu",setup(n){return(e,t)=>(m.openBlock(),m.createElementBlock("div",i6e,[m.createVNode(Xp),m.createVNode(Kp),m.createVNode(Yp),m.createVNode(QM,{icon:"setting",text:"图表配置",isEdit:!0}),m.createVNode(Rd)]))}}),o6e="data:image/svg+xml,%3csvg%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='14'%20cy='14'%20r='11.0833'%20fill='%23258AFF'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M11.8581%2011.2155C11.9065%2011.1088%2012.058%2011.1088%2012.1064%2011.2155L14.6199%2016.7534C14.6609%2016.8437%2014.5948%2016.9461%2014.4957%2016.9461H11.6756C11.461%2016.9461%2011.2663%2017.072%2011.1782%2017.2677L10.7355%2018.2514C10.6273%2018.492%2010.8033%2018.7642%2011.0671%2018.7642H16.0477C16.7417%2018.7642%2017.2037%2018.0471%2016.9169%2017.4152L12.8512%208.45725C12.5122%207.71045%2011.4515%207.71057%2011.1127%208.45743L6.67056%2018.2504C6.56136%2018.4911%206.73737%2018.7642%207.00171%2018.7642H8.08241C8.29645%2018.7642%208.49072%2018.639%208.57914%2018.4441L11.8581%2011.2155ZM19.373%2018.4441C19.4614%2018.639%2019.6557%2018.7642%2019.8698%2018.7642H20.9504C21.2147%2018.7642%2021.3907%2018.4911%2021.2816%2018.2504L16.7334%208.22172C16.645%208.02677%2016.4508%207.90156%2016.2367%207.90156L15.156%207.90156C14.8917%207.90156%2014.7157%208.17464%2014.8249%208.41537L19.373%2018.4441Z'%20fill='white'/%3e%3c/svg%3e",s6e=["maxlength","disabled"],l6e=["disabled","loading"],u6e={key:0,class:"w-iconfont icon-send"},c6e={key:1,class:"w-iconfont icon-loading animate-spin"},f6e=["innerHTML"],d6e={class:"flex items-center gap-2 text-handle"},h6e=m.defineComponent({__name:"assistant",setup(n){const e=m.inject("editor"),t=m.inject("assistant"),r=m.inject("options"),i=m.ref(null),a=m.ref(""),o=m.ref({prompt:"",content:"",error:!1}),s=m.ref(!1),l=m.ref(600),u=async()=>{s.value=!0,o.value.error=!1,o.value.prompt="",o.value.content="";const y={lang:"",input:e.value?QLe(e.value):"",command:a},b={html:e.value?.getHTML()??"",text:e.value?.getText()??"",json:e.value?.getJSON()??{}};try{const _=await r.value.ai?.sendMessage?.(y,b),x=()=>{o.value.content.startsWith("[ERROR]: ")&&(o.value.error=!0,o.value.content=o.value.content.replace("[ERROR]: ",""))};if(_ instanceof ReadableStream){const T=new WritableStream({write(k){x(),o.value.content+=k},close(){s.value=!1,o.value.command=a}});_.pipeTo(T);return}if(_X(_)){s.value=!1,o.value.command=a,x(),o.value.content=_;return}console.error('"ai.assistant.onMessage" method returns data in an incorrect format, it can be a ReadableStream or plain text.')}catch(_){console.error(_),t.value=!1}},c=()=>{t.value=!1,e.value?.commands.focus()},f=()=>{e.value?.chain().insertContent(o.value.content).run(),c()},d=()=>{const{to:y}=e.value?.state.selection??{};y&&e.value?.chain().insertContentAt(y,o.value.content).focus().run(),c()},h=()=>{e.value?.commands.selectParentNode();const{to:y}=e.value?.state.selection??{};y&&e.value?.chain().insertContentAt(y,o.value.content).focus().run(),c()},p=async()=>{const{toClipboard:y}=lN();await y(o.value.content)},v=()=>{const{command:y}=o.value;y&&(a.value=y),u()},g=()=>{a.value="",o.value.prompt="",o.value.content=""};return(y,b)=>{const _=m.resolveDirective("tooltip");return m.openBlock(),m.createElementBlock(m.Fragment,null,[m.createElementVNode("div",{class:"relative flex items-center gap-4 h-[50px] border-b px-3 white-ai-wrapper",style:m.normalizeStyle({width:`${l.value}px`})},[b[7]||(b[7]=m.createElementVNode("div",{class:"flex-shrink-0"},[m.createElementVNode("img",{src:o6e,alt:"ai",class:"w-8 h-8"})],-1)),m.withDirectives(m.createElementVNode("input",{ref_key:"inputRef",ref:i,"onUpdate:modelValue":b[0]||(b[0]=x=>a.value=x),class:m.normalizeClass(["flex-1 outline-none h-full",{"input-disabled":s.value}]),maxlength:m.unref(r).ai?.maxlength,disabled:s.value,autocomplete:"false",placeholder:"告诉AI下一步怎么做"},null,10,s6e),[[m.vModelText,a.value]]),m.createElementVNode("button",{class:"ai-button",disabled:s.value,loading:s.value,onClick:u},[s.value?(m.openBlock(),m.createElementBlock("i",c6e)):(m.openBlock(),m.createElementBlock("i",u6e))],8,l6e)],4),o.value.content?(m.openBlock(),m.createElementBlock("div",{key:0,class:"w-full px-3 py-2",style:m.normalizeStyle({width:`${l.value}px`})},[m.createElementVNode("div",{class:m.normalizeClass(["w-full min-h-[50px] overflow-y-auto line-clamp-6 result-content",{error:o.value.error}]),innerHTML:o.value.content},null,10,f6e),m.createElementVNode("div",d6e,[m.createVNode(Wo,{type:"primary",size:"small",onClick:b[1]||(b[1]=x=>f())},{default:m.withCtx(()=>[...b[8]||(b[8]=[m.createTextVNode("替换所选",-1)])]),_:1}),m.createVNode(Wo,{size:"small",onClick:b[2]||(b[2]=x=>h())},{default:m.withCtx(()=>[...b[9]||(b[9]=[m.createTextVNode("插入下方",-1)])]),_:1}),m.createVNode(Wo,{size:"small",onClick:b[3]||(b[3]=x=>d())},{default:m.withCtx(()=>[...b[10]||(b[10]=[m.createTextVNode("插入后方",-1)])]),_:1}),m.createVNode(Wo,{size:"small",onClick:b[4]||(b[4]=x=>g())},{default:m.withCtx(()=>[...b[11]||(b[11]=[m.createTextVNode("放弃",-1)])]),_:1}),m.withDirectives(m.createElementVNode("i",{class:"w-iconfont icon-copy-text",onClick:b[5]||(b[5]=x=>p())},null,512),[[_,"复制"]]),m.withDirectives(m.createElementVNode("i",{class:"w-iconfont icon-refresh",onClick:b[6]||(b[6]=x=>v())},null,512),[[_,"重新生成"]])])],4)):m.createCommentVNode("",!0)],64)}}}),p6e=m.defineComponent({__name:"index",setup(n){const e=m.inject("editor"),t=m.inject("assistant"),r=m.ref(null),i=m.ref({appendTo:"parent",maxWidth:600,zIndex:110,onShow(a){r.value=a},onHide(){t.value=!1},onDestroy(){r.value=null}});return m.watch(()=>[t.value],a=>{r.value&&r.value?.setProps({placement:a.includes(!0)?"bottom":"top"})}),m.onUnmounted(()=>{r.value&&(r.value.destroy(),r.value=null)}),(a,o)=>(m.openBlock(),m.createBlock(m.unref(Tae),{class:m.normalizeClass(["white-editor-bubble-menu rounded-md",{"px-3 py-2":!m.unref(t)}]),editor:m.unref(e),"tippy-options":i.value},{default:m.withCtx(()=>[m.unref(t)?m.createCommentVNode("",!0):(m.openBlock(),m.createElementBlock(m.Fragment,{key:0},[m.unref(e)?.isActive("toc")||m.unref(e)?.isActive("pageBreak")||m.unref(e)?.isActive("horizontalRule")||m.unref(e)?.isActive("codeBlock")||m.unref(e)?.getAttributes("image").error?(m.openBlock(),m.createBlock(Rd,{key:0})):m.unref(e)?.isActive("image")&&!m.unref(e)?.getAttributes("image").error||m.unref(e)?.isActive("inlineImage")&&!m.unref(e)?.getAttributes("inlineImage").error?(m.openBlock(),m.createBlock(k8e,{key:1})):m.unref(e)?.isActive("video")||m.unref(e)?.isActive("audio")||m.unref(e)?.isActive("file")?(m.openBlock(),m.createBlock(E8e,{key:2})):m.unref(e)?.isActive("iframe")?(m.openBlock(),m.createBlock(r6e,{key:3})):m.unref(e)?.isActive("table")?(m.openBlock(),m.createBlock(R8e,{key:4})):m.unref(e)?.isActive("tag")?(m.openBlock(),m.createBlock(F8e,{key:5})):m.unref(e)?.isActive("echarts")?(m.openBlock(),m.createBlock(a6e,{key:6})):(m.openBlock(),m.createBlock(j8e,{key:7}))],64)),m.unref(t)?(m.openBlock(),m.createBlock(h6e,{key:1})):m.createCommentVNode("",!0)]),_:1},8,["class","editor","tippy-options"]))}}),v6e={key:0,class:"w-full h-[4rem]"},g6e={key:1,class:"w-full h-[4rem]"},m6e=m.defineComponent({__name:"index",setup(n){const e=m.inject("editor"),t=m.inject("page"),r=m.computed(()=>{const{width:a,height:o}=t.value.size??{width:0,height:0};return{width:a,height:o}}),i=m.computed(()=>t.value.layout==="web"?"100%":`calc(${r.value.width}cm * 1)`);return(a,o)=>(m.openBlock(),m.createElementBlock("div",{class:m.normalizeClass(["white-editor-container min-h-full mx-auto overflow-hidden relative flex flex-col",m.unref(t).layout==="page"?"shadow-[0_0_10px_rgba(0,0,0,0.1)] bg-white":""]),style:m.normalizeStyle({width:i.value})},[m.unref(t).layout==="page"?(m.openBlock(),m.createElementBlock("div",v6e)):m.createCommentVNode("",!0),m.createVNode(m.unref(Eae),{editor:m.unref(e),class:m.normalizeClass(["white-editor-content flex-1 flex flex-col",{"is-empty":m.unref(e)?.isEmpty&&m.unref(e)?.state.doc.childCount<=1,"is-readonly":m.unref(e)?.editable,"format-painter":m.unref(e)?.view?.painter?.enabled}])},null,8,["editor","class"]),m.unref(t).layout==="page"?(m.openBlock(),m.createElementBlock("div",g6e)):m.createCommentVNode("",!0),m.unref(e)?(m.openBlock(),m.createBlock(p6e,{key:2})):m.createCommentVNode("",!0)],6))}}),y6e=n=>n&&typeof n=="string"&&!n.startsWith("<")?(console.log(n.split(`
371
+ </html>`},u=async()=>{i8e(l(),()=>{console.log("打印完成")})};return(c,f)=>(m.openBlock(),m.createElementBlock("div",{class:"px-[12px] py-[5px] flex items-center gap-[0.4rem] cursor-pointer hover:bg-[rgb(242,243,245)]",onClick:f[0]||(f[0]=d=>u())},[...f[1]||(f[1]=[m.createElementVNode("i",{class:"w-iconfont icon-export-pdf"},null,-1),m.createTextVNode(" 导出为PDF ",-1)])]))}}),o8e={class:"flex items-center gap-[20px] text-[#333] foot-action"},s8e={key:0,class:"cursor-pointer flex items-center gap-[0.4rem] text-[14px] hover:text-[#007aff]"},l8e=m.defineComponent({__name:"FootRight",setup(n){const e=m.inject("editor"),t=m.inject("options"),r=async()=>{if(!e.value)return;const a=e.value.getHTML(),{toClipboard:o}=lN();await o(a)},i=()=>{if(!e.value)return;const a=new Blob([e.value.getText()],{type:"text/plain;charset=utf-8"}),{title:o}=t.value.document??{},s=o!==""?t.value?.document?.title:"无标题文档";n8e.saveAs(a,`${s}.txt`)};return(a,o)=>(m.openBlock(),m.createElementBlock("div",o8e,[m.unref(t).layout.foot.copy?(m.openBlock(),m.createElementBlock("span",{key:0,class:"cursor-pointer flex items-center gap-[0.4rem] text-[14px] hover:text-[#007aff]",onClick:o[0]||(o[0]=s=>r())},[...o[2]||(o[2]=[m.createElementVNode("i",{class:"w-iconfont icon-copy-content"},null,-1),m.createTextVNode(" 复制全文 ",-1)])])):m.createCommentVNode("",!0),m.createVNode(js,{trigger:"click",placement:"top",contentStyle:{padding:"6px 0",boxShadow:"0 6px 16px 0 rgba(0, 0, 0, 0.08)"}},{content:m.withCtx(()=>[m.createElementVNode("div",{class:"px-[12px] py-[5px] flex items-center gap-[0.4rem] cursor-pointer hover:bg-[rgb(242,243,245)]",onClick:o[1]||(o[1]=s=>i())},[...o[4]||(o[4]=[m.createElementVNode("i",{class:"w-iconfont icon-text"},null,-1),m.createTextVNode(" 导出为文本 ",-1)])]),m.createVNode(a8e)]),default:m.withCtx(()=>[m.unref(t).layout.foot.download?(m.openBlock(),m.createElementBlock("span",s8e,[...o[3]||(o[3]=[m.createElementVNode("i",{class:"w-iconfont icon-down"},null,-1),m.createTextVNode(" 下载 ",-1)])])):m.createCommentVNode("",!0)]),_:1})]))}}),u8e={class:"w-full h-full flex items-center justify-between"},c8e=m.defineComponent({__name:"index",setup(n){return(e,t)=>(m.openBlock(),m.createElementBlock("div",u8e,[m.createVNode(QBe),m.createVNode(l8e)]))}}),f8e=["width","height"],d8e={class:"text-[#666]"},h8e=m.defineComponent({__name:"Nodata",props:{size:{default:"1em"},top:{default:"30%"},title:{default:"暂无数据"}},setup(n){return(e,t)=>(m.openBlock(),m.createElementBlock("div",{class:"flex items-center justify-center flex-col gap-2",style:m.normalizeStyle({paddingTop:n.top})},[(m.openBlock(),m.createElementBlock("svg",{t:"1766712532477",class:"icon",viewBox:"0 0 1030 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:n.size,height:n.size},[...t[0]||(t[0]=[m.createStaticVNode('<path d="M927.053254 896q0 1.254249-0.496852 2.508497t-1.484497 2.508497q-0.993704 1.248189-2.48426 2.49032-1.478438 1.248189-3.453728 2.48426-1.969231 1.230012-4.429254 2.447905-2.453964 1.217893-5.392663 2.423669-2.938698 1.199716-6.343953 2.381254-3.405254 1.187598-7.277065 2.3449-3.87787 1.163361-8.198059 2.302485-4.320189 1.133065-9.088757 2.241893t-9.967338 2.181302q-5.210888 1.084592-10.82168 2.126769-5.616852 1.048237-11.645728 2.060119-6.022817 1.005822-12.439479 1.97529-6.422722 0.969467-13.208994 1.90258-6.792331 0.933112-13.948213 1.817751-7.149822 0.890698-14.645018 1.738982-7.495195 0.842225-15.311527 1.635977-7.822391 0.799811-15.94168 1.551148-8.125349 0.745278-16.541539 1.442082-8.404071 0.702864-17.086863 1.345137-8.670675 0.648331-17.589776 1.24213-8.919101 0.593799-18.068449 1.127006-9.14329 0.539266-18.480474 1.01794-9.349302 0.484734-18.874319 0.908876-9.518959 0.424142-19.201515 0.787693-9.676497 0.36355-19.492355 0.666508-9.809799 0.302959-19.728663 0.551385-9.918864 0.242367-19.928615 0.430201-9.997633 0.181775-20.067977 0.302959-10.064284 0.127243-20.170982 0.187834-10.100639 0.060592-20.213396 0.060592-10.118817 0-20.219456-0.060592-10.100639-0.060592-20.164923-0.181775-10.070343-0.121183-20.074035-0.302959-10.003692-0.187834-19.922557-0.43626-9.924923-0.242367-19.734722-0.545325-9.815858-0.309018-19.492355-0.672568-9.676497-0.36355-19.201514-0.787693-9.518959-0.424142-18.868261-0.908876-9.343243-0.478675-18.486532-1.01794-9.14329-0.533207-18.062391-1.127006t-17.595834-1.24213q-8.676734-0.642272-17.086864-1.345137-8.41013-0.696805-16.535479-1.442082-8.11929-0.751337-15.935622-1.551148-7.822391-0.793751-15.317585-1.635977-7.495195-0.848284-14.651077-1.732923-7.149822-0.890698-13.936095-1.817751-6.798391-0.933112-13.208994-1.908639-6.422722-0.969467-12.445539-1.981349-6.028876-1.005822-11.645727-2.05406-5.622911-1.042178-10.821681-2.12071t-9.967337-2.187361q-4.768568-1.108828-9.088757-2.241893-4.326249-1.139124-8.19806-2.302485-3.871811-1.157302-7.277065-2.3449-3.411314-1.181538-6.343952-2.387313-2.938698-1.199716-5.392663-2.423669-2.460024-1.211834-4.435314-2.447905-1.969231-1.230012-3.453728-2.478201-1.484497-1.24213-2.478201-2.49032-0.987645-1.254249-1.484497-2.508497-0.496852-1.254249-0.496852-2.508497 0-1.260308 0.496852-2.514556t1.484497-2.508497q0.993704-1.248189 2.478201-2.49032 1.484497-1.24213 3.453728-2.478201 1.97529-1.230012 4.435314-2.453964 2.453964-1.211834 5.392663-2.423669 2.932639-1.199716 6.343952-2.381255 3.405254-1.181538 7.271006-2.344899 3.87787-1.163361 8.198059-2.302485 4.326249-1.133065 9.094817-2.241894 4.768568-1.108828 9.967337-2.181301 5.198769-1.084592 10.821681-2.12677 5.616852-1.042178 11.645727-2.060118 6.022817-1.005822 12.43948-1.97529 6.422722-0.969467 13.208994-1.90258 6.792331-0.933112 13.942154-1.817751 7.149822-0.890698 14.651077-1.732923 7.495195-0.848284 15.311526-1.642036 7.816331-0.799811 15.941681-1.551148 8.125349-0.745278 16.535479-1.442083 8.41013-0.702864 17.086864-1.345136 8.676734-0.648331 17.595834-1.24213 8.919101-0.58774 18.062391-1.127006 9.149349-0.539266 18.486532-1.017941 9.349302-0.484734 18.868261-0.908875 9.525018-0.424142 19.207574-0.787693 9.676497-0.36355 19.486295-0.666509 9.815858-0.302959 19.734722-0.551384 9.918864-0.242367 19.922557-0.430201 10.003692-0.181775 20.074035-0.302959 10.058225-0.127243 20.164923-0.187834 10.100639-0.060592 20.219456-0.060592 10.118817 0 20.213396 0.060592 10.106698 0.060592 20.170982 0.181775 10.064284 0.121183 20.067977 0.309018 10.009751 0.181775 19.928615 0.424142 9.918864 0.248426 19.728663 0.557443 9.815858 0.302959 19.492355 0.666509 9.682556 0.36355 19.207574 0.787693 9.518959 0.424142 18.862201 0.908875 9.343243 0.484734 18.486533 1.017941 9.149349 0.539266 18.068449 1.127006 8.919101 0.593799 17.595835 1.24213 8.676734 0.642272 17.086864 1.345136 8.41013 0.696805 16.535479 1.442083 8.11929 0.751337 15.935621 1.551148 7.816331 0.793751 15.317586 1.635976 7.495195 0.848284 14.645018 1.738983 7.149822 0.884639 13.948213 1.817751 6.786272 0.933112 13.208994 1.90258 6.416663 0.969467 12.439479 1.981349 6.028876 1.011882 11.645728 2.054059 5.616852 1.042178 10.82168 2.12071 5.198769 1.078533 9.967338 2.187361t9.088757 2.241894q4.326249 1.139124 8.198059 2.302485t7.271006 2.344899q3.411314 1.181538 6.350012 2.387314 2.938698 1.199716 5.392663 2.423669 2.460024 1.211834 4.423195 2.447905 1.981349 1.236071 3.465846 2.478201 1.484497 1.24213 2.478201 2.49032 0.987645 1.254249 1.484497 2.508497 0.496852 1.254249 0.496852 2.514556z" fill="#007bff" opacity=".1"></path><path d="M117.426746 376.832c0 8.70703 6.695385 15.36 15.450887 15.36 8.755503 0 15.450888-6.65297 15.450888-15.36 0-8.70097-6.695385-15.36-15.450888-15.36-8.240473 0-15.450888 7.168-15.450887 15.36z m814.776804 455.16497c-19.571124 5.12-23.691361 9.222059-28.326627 28.16303-5.150296-19.449941-9.270533-23.552-28.326627-28.16303 19.056095-5.12 23.691361-9.209941 28.326627-28.15697 4.635266 18.94703 8.755503 23.552 28.326627 28.15697zM203.436686 323.07503c-25.23645 6.65297-30.386746 11.77297-37.08213 36.864-6.695385-25.08497-11.84568-30.21103-37.08213-36.864 25.23645-6.65903 30.386746-12.288 37.08213-36.864 6.180355 25.08497 11.84568 30.20497 37.08213 36.864z m618.035503-88.064c-15.450888 4.096-18.541065 7.168-22.661301 22.528-4.120237-15.36-7.210414-18.432-22.661302-22.528 15.450888-4.096 18.541065-7.168 22.661302-22.528 3.605207 15.36 7.210414 18.432 22.661301 22.528z m66.438817-78.848c-40.172308 10.24-48.412781 18.94097-59.228402 58.87697-10.300592-39.929941-19.056095-48.128-59.228403-58.87697 40.172308-10.24 48.412781-18.94703 59.228403-58.88303 10.300592 39.42703 19.056095 48.128 59.228402 58.88303z" fill="#007bff" opacity=".5"></path><path d="M422.32426 713.21297v4.096l33.991953 31.23503 130.302485-62.97903-117.941775 75.26703v36.864l19.056095-18.432v-0.51503 0.51503l19.056094 18.432 100.945799-122.88v-4.096l-185.410651 42.49297z" fill="#007bff" opacity=".2"></path><path d="M865.249704 551.936v-1.024c0-1.024-0.51503-1.53297-0.515029-2.55697v-0.51503L754.003314 260.61103c-15.965917-48.64303-61.288521-81.41103-112.79148-81.41103H389.362367c-51.502959 0-96.825562 32.768-112.791479 81.41103L165.839527 547.84v0.51503c-0.51503 1.024-0.51503 1.53297-0.51503 2.55697v206.848c0 65.02097 53.048047 117.76 118.456805 117.76h463.526627c65.408757 0 118.456805-52.73903 118.456805-117.76v-204.8c-0.51503-0.50897-0.51503-0.50897-0.51503-1.024zM305.412544 271.36q0-0.50897 0.51503-0.50897c11.330651-36.864 45.322604-60.93103 83.434793-60.93103h251.334438c38.112189 0 72.104142 24.06703 83.949822 60.416q0 0.51503 0.51503 0.51503l102.490887 266.24H592.284024c-8.755503 0-15.450888 6.65297-15.450888 15.36 0 33.792-27.811598 61.44-61.80355 61.44-33.991953 0-61.80355-27.648-61.80355-61.44 0-8.70703-6.695385-15.36-15.450888-15.36H202.921657l102.490887-265.73103zM834.347929 757.76c0 48.128-39.142249 87.04-87.55503 87.04h-463.526627c-48.412781 0-87.55503-38.912-87.555029-87.04V568.32h228.158106c7.210414 43.52303 45.322604 76.8 91.160237 76.8 45.837633 0 83.949822-33.27697 91.160236-76.8H834.347929v189.44z" fill="#007bff" opacity=".5"></path><path d="M515.029586 578.566059c-14.420828 0-25.751479-11.264-25.751479-25.6v-51.2H254.939645l84.464852-219.136 0.51503-1.024c7.210414-21.504 26.781538-35.84 49.44284-35.84h251.334438c22.661302 0 42.232426 14.336 49.44284 35.84l0.51503 1.024 84.464852 219.136H540.781065v51.2c0 14.336-11.330651 25.6-25.751479 25.6z" fill="#007bff" opacity=".2"></path>',5)])],8,f8e)),m.createElementVNode("p",d8e,m.toDisplayString(n.title),1)],4))}}),p8e={class:"w-[260px] h-full flex flex-col overflow-hidden"},v8e={key:0,class:"h-[50px] flex-none flex items-center px-4 text-[15px] text-[#666] hover:text-[#333]"},g8e={class:"overflow-y-auto min-h-0"},m8e={key:0,class:"flex-1 px-4 py-2 space-y-[0.3rem]"},y8e=["onClick"],b8e=m.defineComponent({__name:"EditorToc",setup(n){const e=m.inject("editor"),t=m.inject("page"),r=m.inject("options"),i=m.ref([]),a=m.ref(""),o=Oue(()=>{i.value=e.value.storage.tableOfContents.content},200);m.watch(()=>e.value?.storage.tableOfContents.content,()=>{o()},{immediate:!0});const s=l=>{if(!e.value)return;a.value=l.id;const u=e.value.view.dom.querySelector(`[data-toc-id="${l.id}"]`);if(!u)return;u.scrollIntoView({behavior:"smooth"});const c=e.value.view.posAtDOM(u,0),{tr:f}=e.value.view.state,d=f.doc.nodeAt(c);if(d){const h=c+d.nodeSize;f.setSelection(Ut.create(f.doc,h))}else f.setSelection(new Ut(f.doc.resolve(c)));e.value.view.dispatch(f),e.value.view.focus()};return(l,u)=>(m.openBlock(),m.createElementBlock("div",p8e,[m.unref(r).layout.foot.show?(m.openBlock(),m.createElementBlock("div",v8e,[m.createElementVNode("span",{class:"flex items-center gap-2 cursor-pointer",onClick:u[0]||(u[0]=c=>m.unref(t).showToc=!1)},[...u[1]||(u[1]=[m.createElementVNode("i",{class:"w-iconfont icon-left !text-[12px]"},null,-1),m.createTextVNode(" 收起大纲 ",-1)])])])):m.createCommentVNode("",!0),m.createElementVNode("div",g8e,[i.value?.length?(m.openBlock(),m.createElementBlock("ul",m8e,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(i.value,c=>(m.openBlock(),m.createElementBlock("li",{key:c.id,class:m.normalizeClass(["cursor-pointer text-[#333] text-[14px] h-[34px] block leading-[34px] pr-2 hover:text-[#101219] rounded text-ellipsis overflow-hidden whitespace-nowrap",a.value===c.id?"font-bold bg-[#f5f5f5]":""]),style:m.normalizeStyle({textIndent:`${c.level}rem`}),onClick:f=>s(c)},m.toDisplayString(c.textContent),15,y8e))),128))])):(m.openBlock(),m.createBlock(h8e,{key:1,size:"120px"}))])]))}}),x8e=m.defineComponent({__name:"flip",setup(n){const e=m.inject("editor"),t=m.computed(()=>{const a=e.value?Fl(e.value):null;return a?.type?.name?e.value?.getAttributes(a?.type?.name)?.flipY:!1}),r=m.computed(()=>{const a=e.value?Fl(e.value):null;return a?.type?.name?e.value?.getAttributes(a?.type?.name)?.flipX:!1}),i=a=>{const o=e.value?Fl(e.value):null,{flipX:s,flipY:l}=o?.attrs??{};o&&a==="flipX"&&e.value?.commands.updateAttributes(o.type,{flipX:!s}),o&&a==="flipY"&&e.value?.commands.updateAttributes(o.type,{flipY:!l})};return(a,o)=>(m.openBlock(),m.createElementBlock(m.Fragment,null,[m.createVNode(An,{ico:"flip-x",text:"水平翻转","hide-text":"","menu-active":t.value,onMenuClick:o[0]||(o[0]=s=>i("flipY"))},null,8,["menu-active"]),m.createVNode(An,{ico:"flip-y",text:"垂直翻转","hide-text":"","menu-active":r.value,onMenuClick:o[1]||(o[1]=s=>i("flipX"))},null,8,["menu-active"])],64))}}),JY=m.defineComponent({__name:"open",setup(n){const e=m.inject("editor"),t=()=>{const r=e.value?Fl(e?.value):null;window.open(r?.attrs.src)};return(r,i)=>(m.openBlock(),m.createBlock(An,{ico:"open",text:"新窗口打开",shortcut:"Backspace","hide-text":"",onMenuClick:t}))}}),_8e=m.defineComponent({__name:"covert",setup(n){const e=m.inject("editor"),t=m.computed(()=>(e.value?Fl(e.value):null)?.type?.name==="inlineImage"?"转为节点图片":"转为行内图片"),r=()=>{const i=e.value?Fl(e.value):null;if(i){const a=i?.type?.name==="inlineImage"?"inlineImage":"image",o=i.attrs??{};!o.error&&o.src&&(e.value?.chain().focus().deleteSelectionNode().run(),a==="inlineImage"?e.value?.chain().focus().setImage({...o,equalProportion:!1,inline:!1}).run():e.value?.chain().focus().setInlineImage({...o,inline:!0,equalProportion:!1}).run())}};return(i,a)=>(m.openBlock(),m.createBlock(An,{ico:"huantu",text:t.value,"hide-text":"",onMenuClick:r},null,8,["text"]))}}),Rd=m.defineComponent({__name:"delete",setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createBlock(An,{ico:"remove",text:"删除",shortcut:"Backspace","hide-text":"",onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.chain().focus().deleteSelectionNode().run())}))}}),S8e={class:"flex items-center gap-2"},w8e=m.defineComponent({__name:"image-menu",setup(n){return(e,t)=>(m.openBlock(),m.createElementBlock("div",S8e,[m.createVNode(Xp),m.createVNode(Kp),m.createVNode(Yp),m.createVNode(x8e),m.createVNode(_8e),m.createVNode(JY),m.createVNode(Rd)]))}}),k8e=m.defineComponent({__name:"down",setup(n){const e=m.inject("editor"),t=()=>{const r=e.value?Fl(e.value):null,i=document.createElement("a");i.href=r?.attrs.url,i.download=r?.attrs.name,i&&(document.body.appendChild(i),i.click(),document.body.removeChild(i))};return(r,i)=>m.unref(e)?.getAttributes("file")?.uploaded?(m.openBlock(),m.createBlock(An,{key:0,ico:"down",text:"下载","hide-text":"",onMenuClick:i[0]||(i[0]=a=>t())})):m.createCommentVNode("",!0)}}),T8e={class:"flex items-center gap-2"},C8e=m.defineComponent({__name:"file-menu",setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createElementBlock("div",T8e,[m.createVNode(Xp),m.createVNode(Kp),m.createVNode(Yp),m.unref(e)?.isActive("file")||m.unref(e)?.isActive("video")||m.unref(e)?.isActive("audio")?(m.openBlock(),m.createBlock(k8e,{key:0})):m.createCommentVNode("",!0),m.createVNode(Rd)]))}}),E8e=m.defineComponent({__name:"cell-background",props:{text:{type:String,default:""},defaultColor:{type:String,default:"#007bff"}},setup(n){const e=n,t=m.inject("editor"),r=m.ref(!1),i=m.ref(e.defaultColor),a=s=>{i.value=s,r.value=!1;const l=s===""?null:s;t.value?.chain().focus().setCellAttribute("background",l).run()},o=aA(s=>{i.value=s,r.value=!1;const l=s===""?null:s;t.value?.chain().focus().setCellAttribute("background",l).run()},200);return m.watch(()=>i.value,s=>{o(s)}),(s,l)=>(m.openBlock(),m.createBlock(il,{ico:"fill",text:"填充背景","hide-text":"","popup-visible":r.value,"onUpdate:popupVisible":l[1]||(l[1]=u=>r.value=u),disabled:!m.unref(t)?.can().setCellAttribute("background",""),"popup-type":"arrow",onMenuClick:l[2]||(l[2]=u=>a(i.value))},{content:m.withCtx(()=>[m.createVNode(m.unref(VO),{modelValue:i.value,"onUpdate:modelValue":l[0]||(l[0]=u=>i.value=u)},null,8,["modelValue"])]),default:m.withCtx(()=>[m.createElementVNode("div",{class:"w-[14px] h-[2px] mx-auto",style:m.normalizeStyle({backgroundColor:i.value})},null,4)]),_:1},8,["popup-visible","disabled"]))}}),M8e=m.defineComponent({__name:"cell-insert",props:{hideText:{type:Boolean,default:!0}},setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createElementBlock(m.Fragment,null,[m.createVNode(An,{ico:"charutop",text:"上方插入一行","hide-text":n.hideText,disabled:!m.unref(e)?.can().addRowBefore(),onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.chain().focus().addRowBefore().run())},null,8,["hide-text","disabled"]),m.createVNode(An,{ico:"charubottom",text:"下方插入一行","hide-text":n.hideText,disabled:!m.unref(e)?.can().addRowAfter(),onMenuClick:r[1]||(r[1]=i=>m.unref(e)?.chain().focus().addRowAfter().run())},null,8,["hide-text","disabled"]),m.createVNode(An,{ico:"charuleft",text:"左方插入一列","hide-text":n.hideText,disabled:!m.unref(e)?.can().addColumnBefore(),onMenuClick:r[2]||(r[2]=i=>m.unref(e)?.chain().focus().addColumnBefore().run())},null,8,["hide-text","disabled"]),m.createVNode(An,{ico:"charuright",text:"右方插入一列","hide-text":n.hideText,disabled:!m.unref(e)?.can().addColumnAfter(),onMenuClick:r[3]||(r[3]=i=>m.unref(e)?.chain().focus().addColumnAfter().run())},null,8,["hide-text","disabled"])],64))}}),A8e=m.defineComponent({__name:"cell-delete",props:{hideText:{type:Boolean,default:!0}},setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createElementBlock(m.Fragment,null,[m.createVNode(An,{ico:"removehang",text:"删除行","hide-text":n.hideText,disabled:!m.unref(e)?.can().deleteColumn(),onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.chain().focus().deleteRow().run())},null,8,["hide-text","disabled"]),m.createVNode(An,{ico:"removelie",text:"删除列","hide-text":n.hideText,disabled:!m.unref(e)?.can().deleteColumn(),onMenuClick:r[1]||(r[1]=i=>m.unref(e)?.chain().focus().deleteColumn().run())},null,8,["hide-text","disabled"])],64))}}),N8e=m.defineComponent({__name:"cell-merge",props:{hideText:{type:Boolean,default:!0}},setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createElementBlock(m.Fragment,null,[m.createVNode(An,{ico:"merge-cell",text:"合并单元格","hide-text":n.hideText,disabled:!m.unref(e)?.can().mergeCells(),onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.chain().focus().mergeCells().run())},null,8,["hide-text","disabled"]),m.createVNode(An,{ico:"split-cell",text:"拆分单元格","hide-text":n.hideText,disabled:!m.unref(e)?.can().splitCell(),onMenuClick:r[1]||(r[1]=i=>m.unref(e)?.chain().focus().splitCell().run())},null,8,["hide-text","disabled"])],64))}}),D8e=m.defineComponent({__name:"table-delete",setup(n){const e=m.inject("editor");return(t,r)=>(m.openBlock(),m.createBlock(An,{ico:"remove",text:"删除表格",shortcut:"Backspace","hide-text":"",disabled:!m.unref(e)?.can().deleteTable(),onMenuClick:r[0]||(r[0]=i=>m.unref(e)?.chain().focus().deleteTable().run())},null,8,["disabled"]))}}),O8e={class:"flex items-center gap-2"},I8e=m.defineComponent({__name:"table-menu",setup(n){return(e,t)=>(m.openBlock(),m.createElementBlock("div",O8e,[m.createVNode(Xp),m.createVNode(Kp),m.createVNode(Yp),m.createVNode(E8e),m.createVNode(M8e),m.createVNode(A8e),m.createVNode(N8e),m.createVNode(D8e)]))}}),R8e=m.defineComponent({__name:"tag-input",setup(n){const e=m.ref(""),t=m.inject("editor"),r=()=>{if(e.value==="")return;t.value?.state?.selection?.$from?.node()&&t.value?.commands.updateAttributes("tag",{text:e.value})},i=()=>{const a=t.value?.getAttributes("tag");a?.text&&(e.value=a.text)};return m.onMounted(()=>{i(),t.value?.on("selectionUpdate",i)}),m.onBeforeUnmount(()=>{t.value?.off("selectionUpdate")}),(a,o)=>(m.openBlock(),m.createElementBlock(m.Fragment,null,[m.createVNode(lm,{placeholder:"请输入标签",value:e.value,"onUpdate:value":o[0]||(o[0]=s=>e.value=s),size:"small"},null,8,["value"]),m.createVNode(Wo,{type:"primary",size:"small",onClick:o[1]||(o[1]=s=>r())},{default:m.withCtx(()=>[...o[2]||(o[2]=[m.createTextVNode("确认",-1)])]),_:1})],64))}}),L8e={class:"px-2"},P8e=["onClick"],B8e=m.defineComponent({__name:"tag-color",setup(n){const e=m.inject("editor"),t=m.ref("#007bff"),r=m.ref(!1),i=[{label:"蓝色",color:"#007bff",bgcolor:"rgb(217, 231, 255)"},{label:"红色",color:"rgba(200, 78, 67, 1)",bgcolor:"rgb(252, 223, 220)"},{label:"黄色",color:"rgba(240, 196, 23, 1)",bgcolor:"rgb(255, 245, 210)"},{label:"绿色",color:"rgba(5, 205, 153, 1)",bgcolor:"rgb(205, 245, 235)"},{label:"紫色",color:"#e6afff",bgcolor:"rgb(220, 223, 252)"}],a=s=>{e.value?.state?.selection?.$from?.node()&&e.value?.commands.updateAttributes("tag",{type:s.type,color:s.color,backgroundColor:s.bgcolor}),t.value=s?.bgcolor,r.value=!1},o=()=>{e.value?.state?.selection?.$from?.node()&&e.value?.commands.updateAttributes("tag",{type:"default",color:"#999",backgroundColor:"rgba(0, 0, 0, 0.05)"}),t.value="rgba(0, 0, 0, 0.05)",r.value=!1};return(s,l)=>(m.openBlock(),m.createBlock(wS,{ico:"fill",text:"高亮填充","hide-text":"",onMenuClick:l[1]||(l[1]=u=>a()),maxHeight:!1,"popup-visible":r.value,"onUpdate:popupVisible":l[2]||(l[2]=u=>r.value=u)},{content:m.withCtx(()=>[m.createElementVNode("div",L8e,[(m.openBlock(),m.createElementBlock(m.Fragment,null,m.renderList(i,(u,c)=>m.createElementVNode("div",{key:c,onClick:f=>a(u),style:m.normalizeStyle({backgroundColor:u.bgcolor}),class:"h-[30px] w-[90px] flex items-center justify-center gap-2 mb-2 rounded-[3px] cursor-pointer"},[l[3]||(l[3]=m.createElementVNode("i",{class:"w-iconfont icon-tumo !text-[14px]"},null,-1)),m.createTextVNode(" "+m.toDisplayString(u.label),1)],12,P8e)),64)),m.createElementVNode("div",{class:"h-[30px] w-[90px] flex items-center justify-center gap-2 mb-2 rounded-[3px] cursor-pointer border",onClick:l[0]||(l[0]=u=>o())},[...l[4]||(l[4]=[m.createElementVNode("i",{class:"w-iconfont icon-clear-format !text-[14px]"},null,-1),m.createTextVNode(" 清除 ",-1)])])])]),_:1},8,["popup-visible"]))}}),V8e={class:"flex items-center gap-2"},z8e=m.defineComponent({__name:"tag-menu",setup(n){return(e,t)=>(m.openBlock(),m.createElementBlock("div",V8e,[m.createVNode(R8e),m.createVNode(B8e),m.createVNode(Rd)]))}}),F8e=m.defineComponent({__name:"ai-operation",setup(n){const e=m.inject("editor"),t=m.inject("assistant"),r=()=>{t.value=!0,e.value?.commands.focus()};return(i,a)=>(m.openBlock(),m.createBlock(An,{ico:"ai-assistant",text:"AI智能助手","hide-text":"",onMenuClick:r}))}}),$8e={class:"px-2"},H8e=["onClick"],G8e=m.defineComponent({__name:"high-background",setup(n){const e=m.inject("editor"),t=m.ref("#007bff"),r=m.ref(!1),i=[{label:"默认",bgcolor:"#007bff"},{label:"红色",bgcolor:"#ff8a8a"},{label:"黄色",bgcolor:"#ffff8a"},{label:"绿色",bgcolor:"#a7ffa7"},{label:"紫色",bgcolor:"#e6afff"},{label:"蓝色",bgcolor:"#83d3ff"}],a=s=>{if(!s){e.value?.chain().focus().setHighlight({color:i[0].bgcolor}).run();return}t.value=s?.bgcolor,e.value?.chain().focus().setHighlight({color:s.bgcolor}).run(),r.value=!1},o=()=>{e.value?.chain().focus().unsetHighlight().run(),t.value="#007bff",r.value=!1};return(s,l)=>(m.openBlock(),m.createBlock(wS,{ico:"fill",text:"高亮填充","hide-text":"",onMenuClick:l[1]||(l[1]=u=>a()),maxHeight:!1,"popup-visible":r.value,"onUpdate:popupVisible":l[2]||(l[2]=u=>r.value=u)},{content:m.withCtx(()=>[m.createElementVNode("div",$8e,[(m.openBlock(),m.createElementBlock(m.Fragment,null,m.renderList(i,(u,c)=>m.createElementVNode("div",{key:c,onClick:f=>a(u),style:m.normalizeStyle({backgroundColor:u.bgcolor}),class:"h-[30px] w-[90px] flex items-center justify-center gap-2 mb-2 rounded-[3px] cursor-pointer"},[l[3]||(l[3]=m.createElementVNode("i",{class:"w-iconfont icon-tumo !text-[14px]"},null,-1)),m.createTextVNode(" "+m.toDisplayString(u.label),1)],12,H8e)),64)),m.createElementVNode("div",{class:"h-[30px] w-[90px] flex items-center justify-center gap-2 mb-2 rounded-[3px] cursor-pointer border",onClick:l[0]||(l[0]=u=>o())},[...l[4]||(l[4]=[m.createElementVNode("i",{class:"w-iconfont icon-clear-format !text-[14px]"},null,-1),m.createTextVNode(" 清除 ",-1)])])])]),_:1},8,["popup-visible"]))}}),U8e={class:"flex items-center gap-2"},W8e=m.defineComponent({__name:"text-menu",setup(n){return(e,t)=>(m.openBlock(),m.createElementBlock("div",U8e,[m.createVNode(F8e),m.createVNode(WM),m.createVNode(jM),m.createVNode(qM),m.createVNode(KM),m.createVNode(XY),m.createVNode(G8e),m.createVNode(Rd)]))}}),j8e={class:"flex items-center gap-2"},q8e={key:0,class:"flex items-center gap-2 py-2 px-1"},K8e={class:"flex-1 h-[90px] flex flex-col justify-between gap-1"},Y8e={class:"mb-2"},X8e={class:"flex items-center gap-2"},Z8e=["innerHTML"],J8e={key:1,class:"text-[12px] text-[#999]"},Q8e=["onClick"],e6e=["innerHTML"],t6e={class:"flex items-center gap-2"},n6e=m.defineComponent({__name:"iframe-menu",setup(n){const e=m.inject("editor"),t=m.ref(),r=m.ref(""),i=m.ref(""),a=m.computed(()=>qv.find(l=>l.value===i.value)),o=l=>{i.value=l.value,t.value?.changePopoverVisible(!1)},s=()=>{const{validate:l,transformURL:u}=qv.find(c=>c.value===i.value);l&&!l(r.value)||e.value.chain().focus().setParagraph().setIframe({type:i.value,src:u?u(r.value):r.value}).run()};return(l,u)=>(m.openBlock(),m.createElementBlock("div",j8e,[m.unref(e)?.getAttributes("iframe").src==""?(m.openBlock(),m.createElementBlock("div",q8e,[u[3]||(u[3]=m.createElementVNode("div",{class:"flex flex-col items-center gap-1 h-[80px]"},[m.createElementVNode("span",{class:"w-[24px] h-[24px] text-center rounded-full bg-[#007bff] text-[12px] text-[#fff] font-500",style:{"line-height":"24px"}}," 1 "),m.createElementVNode("div",{class:"w-[1px] flex-1 bg-[#e5e5e5]"}),m.createElementVNode("span",{class:"w-[24px] h-[24px] text-center rounded-full bg-[#007bff] text-[12px] text-[#fff] font-500",style:{"line-height":"24px"}}," 2 ")],-1)),m.createElementVNode("div",K8e,[m.createElementVNode("div",Y8e,[m.createVNode(wg,{value:i.value,"onUpdate:value":u[0]||(u[0]=c=>i.value=c),options:m.unref(qv),placeholder:"选择网页类型",class:"w-full",ref_key:"selectRef",ref:t},{main:m.withCtx(()=>[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(m.unref(qv),(c,f)=>(m.openBlock(),m.createElementBlock("div",{key:c.value,class:m.normalizeClass(["flex items-center gap-2 h-[32px] px-2 cursor-pointer rounded-[4px] hover:bg-[rgb(242,243,245)]",{"bg-[rgb(242,243,245)]":i.value===c.value,"mb-1":f!==m.unref(qv).length-1}]),onClick:d=>o(c)},[m.createElementVNode("span",{innerHTML:c.icon},null,8,e6e),m.createTextVNode(" "+m.toDisplayString(c.label),1)],10,Q8e))),128))]),default:m.withCtx(()=>[m.createElementVNode("div",X8e,[a.value&&Object.keys(a.value).length?(m.openBlock(),m.createElementBlock(m.Fragment,{key:0},[m.createElementVNode("span",{innerHTML:a.value.icon},null,8,Z8e),m.createTextVNode(" "+m.toDisplayString(a.value.label),1)],64)):(m.openBlock(),m.createElementBlock("span",J8e,"选择网页类型"))])]),_:1},8,["value","options"])]),m.createElementVNode("div",t6e,[m.createVNode(lm,{value:r.value,"onUpdate:value":u[1]||(u[1]=c=>r.value=c),placeholder:"打开网址复制链接,以http:// 或 https:// 开头",class:"w-[300px]"},null,8,["value"]),m.createVNode(Wo,{type:"primary",size:"small",disabled:!r.value,onClick:s},{default:m.withCtx(()=>[...u[2]||(u[2]=[m.createTextVNode("添加",-1)])]),_:1},8,["disabled"])])])])):(m.openBlock(),m.createElementBlock(m.Fragment,{key:1},[m.createVNode(Xp),m.createVNode(Kp),m.createVNode(Yp),m.createVNode(JY),m.createVNode(Rd)],64))]))}}),r6e={class:"flex items-center gap-2"},i6e=m.defineComponent({__name:"echarts-menu",setup(n){return(e,t)=>(m.openBlock(),m.createElementBlock("div",r6e,[m.createVNode(Xp),m.createVNode(Kp),m.createVNode(Yp),m.createVNode(QM,{icon:"setting",text:"图表配置",isEdit:!0}),m.createVNode(Rd)]))}}),a6e="data:image/svg+xml,%3csvg%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='14'%20cy='14'%20r='11.0833'%20fill='%23258AFF'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M11.8581%2011.2155C11.9065%2011.1088%2012.058%2011.1088%2012.1064%2011.2155L14.6199%2016.7534C14.6609%2016.8437%2014.5948%2016.9461%2014.4957%2016.9461H11.6756C11.461%2016.9461%2011.2663%2017.072%2011.1782%2017.2677L10.7355%2018.2514C10.6273%2018.492%2010.8033%2018.7642%2011.0671%2018.7642H16.0477C16.7417%2018.7642%2017.2037%2018.0471%2016.9169%2017.4152L12.8512%208.45725C12.5122%207.71045%2011.4515%207.71057%2011.1127%208.45743L6.67056%2018.2504C6.56136%2018.4911%206.73737%2018.7642%207.00171%2018.7642H8.08241C8.29645%2018.7642%208.49072%2018.639%208.57914%2018.4441L11.8581%2011.2155ZM19.373%2018.4441C19.4614%2018.639%2019.6557%2018.7642%2019.8698%2018.7642H20.9504C21.2147%2018.7642%2021.3907%2018.4911%2021.2816%2018.2504L16.7334%208.22172C16.645%208.02677%2016.4508%207.90156%2016.2367%207.90156L15.156%207.90156C14.8917%207.90156%2014.7157%208.17464%2014.8249%208.41537L19.373%2018.4441Z'%20fill='white'/%3e%3c/svg%3e",o6e=["maxlength","disabled"],s6e=["disabled","loading"],l6e={key:0,class:"w-iconfont icon-send"},u6e={key:1,class:"w-iconfont icon-loading animate-spin"},c6e=["innerHTML"],f6e={class:"flex items-center gap-2 text-handle"},d6e=m.defineComponent({__name:"assistant",setup(n){const e=m.inject("editor"),t=m.inject("assistant"),r=m.inject("options"),i=m.ref(null),a=m.ref(""),o=m.ref({prompt:"",content:"",error:!1}),s=m.ref(!1),l=m.ref(600),u=async()=>{s.value=!0,o.value.error=!1,o.value.prompt="",o.value.content="";const y={lang:"",input:e.value?QLe(e.value):"",command:a},b={html:e.value?.getHTML()??"",text:e.value?.getText()??"",json:e.value?.getJSON()??{}};try{const _=await r.value.ai?.sendMessage?.(y,b),x=()=>{o.value.content.startsWith("[ERROR]: ")&&(o.value.error=!0,o.value.content=o.value.content.replace("[ERROR]: ",""))};if(_ instanceof ReadableStream){const T=new WritableStream({write(k){x(),o.value.content+=k},close(){s.value=!1,o.value.command=a}});_.pipeTo(T);return}if(_X(_)){s.value=!1,o.value.command=a,x(),o.value.content=_;return}console.error('"ai.assistant.onMessage" method returns data in an incorrect format, it can be a ReadableStream or plain text.')}catch(_){console.error(_),t.value=!1}},c=()=>{t.value=!1,e.value?.commands.focus()},f=()=>{e.value?.chain().insertContent(o.value.content).run(),c()},d=()=>{const{to:y}=e.value?.state.selection??{};y&&e.value?.chain().insertContentAt(y,o.value.content).focus().run(),c()},h=()=>{e.value?.commands.selectParentNode();const{to:y}=e.value?.state.selection??{};y&&e.value?.chain().insertContentAt(y,o.value.content).focus().run(),c()},p=async()=>{const{toClipboard:y}=lN();await y(o.value.content)},v=()=>{const{command:y}=o.value;y&&(a.value=y),u()},g=()=>{a.value="",o.value.prompt="",o.value.content=""};return(y,b)=>{const _=m.resolveDirective("tooltip");return m.openBlock(),m.createElementBlock(m.Fragment,null,[m.createElementVNode("div",{class:"relative flex items-center gap-4 h-[50px] border-b px-3 white-ai-wrapper",style:m.normalizeStyle({width:`${l.value}px`})},[b[7]||(b[7]=m.createElementVNode("div",{class:"flex-shrink-0"},[m.createElementVNode("img",{src:a6e,alt:"ai",class:"w-8 h-8"})],-1)),m.withDirectives(m.createElementVNode("input",{ref_key:"inputRef",ref:i,"onUpdate:modelValue":b[0]||(b[0]=x=>a.value=x),class:m.normalizeClass(["flex-1 outline-none h-full",{"input-disabled":s.value}]),maxlength:m.unref(r).ai?.maxlength,disabled:s.value,autocomplete:"false",placeholder:"告诉AI下一步怎么做"},null,10,o6e),[[m.vModelText,a.value]]),m.createElementVNode("button",{class:"ai-button",disabled:s.value,loading:s.value,onClick:u},[s.value?(m.openBlock(),m.createElementBlock("i",u6e)):(m.openBlock(),m.createElementBlock("i",l6e))],8,s6e)],4),o.value.content?(m.openBlock(),m.createElementBlock("div",{key:0,class:"w-full px-3 py-2",style:m.normalizeStyle({width:`${l.value}px`})},[m.createElementVNode("div",{class:m.normalizeClass(["w-full min-h-[50px] overflow-y-auto line-clamp-6 result-content",{error:o.value.error}]),innerHTML:o.value.content},null,10,c6e),m.createElementVNode("div",f6e,[m.createVNode(Wo,{type:"primary",size:"small",onClick:b[1]||(b[1]=x=>f())},{default:m.withCtx(()=>[...b[8]||(b[8]=[m.createTextVNode("替换所选",-1)])]),_:1}),m.createVNode(Wo,{size:"small",onClick:b[2]||(b[2]=x=>h())},{default:m.withCtx(()=>[...b[9]||(b[9]=[m.createTextVNode("插入下方",-1)])]),_:1}),m.createVNode(Wo,{size:"small",onClick:b[3]||(b[3]=x=>d())},{default:m.withCtx(()=>[...b[10]||(b[10]=[m.createTextVNode("插入后方",-1)])]),_:1}),m.createVNode(Wo,{size:"small",onClick:b[4]||(b[4]=x=>g())},{default:m.withCtx(()=>[...b[11]||(b[11]=[m.createTextVNode("放弃",-1)])]),_:1}),m.withDirectives(m.createElementVNode("i",{class:"w-iconfont icon-copy-text",onClick:b[5]||(b[5]=x=>p())},null,512),[[_,"复制"]]),m.withDirectives(m.createElementVNode("i",{class:"w-iconfont icon-refresh",onClick:b[6]||(b[6]=x=>v())},null,512),[[_,"重新生成"]])])],4)):m.createCommentVNode("",!0)],64)}}}),h6e=m.defineComponent({__name:"index",setup(n){const e=m.inject("editor"),t=m.inject("assistant"),r=m.ref(null),i=m.ref({appendTo:"parent",maxWidth:600,zIndex:110,onShow(a){r.value=a},onHide(){t.value=!1},onDestroy(){r.value=null}});return m.watch(()=>[t.value],a=>{r.value&&r.value?.setProps({placement:a.includes(!0)?"bottom":"top"})}),m.onUnmounted(()=>{r.value&&(r.value.destroy(),r.value=null)}),(a,o)=>(m.openBlock(),m.createBlock(m.unref(Tae),{class:m.normalizeClass(["white-editor-bubble-menu rounded-md",{"px-3 py-2":!m.unref(t)}]),editor:m.unref(e),"tippy-options":i.value},{default:m.withCtx(()=>[m.unref(t)?m.createCommentVNode("",!0):(m.openBlock(),m.createElementBlock(m.Fragment,{key:0},[m.unref(e)?.isActive("toc")||m.unref(e)?.isActive("pageBreak")||m.unref(e)?.isActive("horizontalRule")||m.unref(e)?.isActive("codeBlock")||m.unref(e)?.getAttributes("image").error?(m.openBlock(),m.createBlock(Rd,{key:0})):m.unref(e)?.isActive("image")&&!m.unref(e)?.getAttributes("image").error||m.unref(e)?.isActive("inlineImage")&&!m.unref(e)?.getAttributes("inlineImage").error?(m.openBlock(),m.createBlock(w8e,{key:1})):m.unref(e)?.isActive("video")||m.unref(e)?.isActive("audio")||m.unref(e)?.isActive("file")?(m.openBlock(),m.createBlock(C8e,{key:2})):m.unref(e)?.isActive("iframe")?(m.openBlock(),m.createBlock(n6e,{key:3})):m.unref(e)?.isActive("table")?(m.openBlock(),m.createBlock(I8e,{key:4})):m.unref(e)?.isActive("tag")?(m.openBlock(),m.createBlock(z8e,{key:5})):m.unref(e)?.isActive("echarts")?(m.openBlock(),m.createBlock(i6e,{key:6})):(m.openBlock(),m.createBlock(W8e,{key:7}))],64)),m.unref(t)?(m.openBlock(),m.createBlock(d6e,{key:1})):m.createCommentVNode("",!0)]),_:1},8,["class","editor","tippy-options"]))}}),p6e={key:0,class:"w-full h-[4rem]"},v6e={key:1,class:"w-full h-[4rem]"},g6e=m.defineComponent({__name:"index",setup(n){const e=m.inject("editor"),t=m.inject("page"),r=m.computed(()=>{const{width:a,height:o}=t.value.size??{width:0,height:0};return{width:a,height:o}}),i=m.computed(()=>t.value.layout==="web"?"100%":`calc(${r.value.width}cm * 1)`);return(a,o)=>(m.openBlock(),m.createElementBlock("div",{class:m.normalizeClass(["white-editor-container min-h-full mx-auto overflow-hidden relative flex flex-col",m.unref(t).layout==="page"?"shadow-[0_0_10px_rgba(0,0,0,0.1)] bg-white":""]),style:m.normalizeStyle({width:i.value})},[m.unref(t).layout==="page"?(m.openBlock(),m.createElementBlock("div",p6e)):m.createCommentVNode("",!0),m.createVNode(m.unref(Eae),{editor:m.unref(e),class:m.normalizeClass(["white-editor-content flex-1 flex flex-col",{"is-empty":m.unref(e)?.isEmpty&&m.unref(e)?.state.doc.childCount<=1,"is-readonly":m.unref(e)?.editable,"format-painter":m.unref(e)?.view?.painter?.enabled}])},null,8,["editor","class"]),m.unref(t).layout==="page"?(m.openBlock(),m.createElementBlock("div",v6e)):m.createCommentVNode("",!0),m.unref(e)?(m.openBlock(),m.createBlock(h6e,{key:2})):m.createCommentVNode("",!0)],6))}}),m6e=n=>n&&typeof n=="string"&&!n.startsWith("<")?(console.log(n.split(`
372
372
  `)),n.split(`
373
- `).map(e=>`<p>${e}</p>`).join("")):n,b6e={class:"flex flex-col white-give-editor-wrapper white-editor-namespace"},x6e={key:0,class:"w-full flex-none border-b border-[#d9d9d9]"},_6e=["id"],S6e={key:1,class:"w-full h-[40px] flex-none border-t border-[#d9d9d9] px-[2rem]"},w6e=m.defineComponent({__name:"HomeView",setup(n){const e=m.inject("editor"),t=m.inject("container"),r=m.inject("options"),i=m.inject("uploadFileMap"),a=m.inject("page"),o=wPe({container:t,options:r,uploadFileMap:i}),s=new Cae({editable:!r.value?.editor?.readOnly,autofocus:r.value?.editor?.autofocus,content:y6e(r.value.document?.content),enableInputRules:gz(r),enablePasteRules:gz(r),editorProps:{attributes:{class:"white-editor"},...r.value?.editor?.editorProps},parseOptions:r.value?.editor?.parseOptions,extensions:o});return e.value=s,e.value.storage.container=t,e.value.storage.options=r.value,(l,u)=>(m.openBlock(),m.createElementBlock("div",b6e,[m.unref(r).layout.toolbar.show?(m.openBlock(),m.createElementBlock("div",x6e,[m.createVNode($Be)])):m.createCommentVNode("",!0),m.createElementVNode("div",{class:"w-full flex-1 min-h-0 flex overflow-hidden",id:m.unref(t)},[m.unref(a).showToc&&m.unref(r).layout.toc.show?(m.openBlock(),m.createBlock(x8e,{key:0})):m.createCommentVNode("",!0),m.createElementVNode("div",{class:m.normalizeClass(["flex-1 h-full overflow-y-auto py-[20px]",m.unref(a).layout==="page"?"bg-[#f4f6fa]":""])},[m.createVNode(m6e)],2)],8,_6e),m.unref(r).layout.foot.show?(m.openBlock(),m.createElementBlock("div",S6e,[m.createVNode(f8e)])):m.createCommentVNode("",!0)]))}}),eA=m.defineComponent({__name:"index",emits:["beforeCreate","created","changed","changed:selection","changed:transaction","changed:menu","changed:toolbar","changed:pageLayout","changed:pageSize","changed:pageOrientation","changed:pageMargin","changed:pageBackground","changed:pageShowToc","changed:pagePreview","changed:pageZoom","changed:pageWatermark","changed:locale","changed:theme","contentError","print","focus","blur","saved","destroy","menuChange"],setup(n,{emit:e}){const t=e,r=m.inject("providedOptions",{}),i=m.ref(`white-editor-${ip()}`),a={document:{title:"无标题文档",content:""},editor:{readOnly:!1,autofocus:!1,parseOptions:{preserveWhitespace:"full"},editorProps:{},enableMarkdown:!0},layout:{toc:{show:!0},toolbar:{show:!0},foot:{show:!0,pageSize:!0,character:!0,copy:!0,download:!0}},dicts:{lineHeights:[{label:"单倍行距",value:1},{label:"1.5 倍行距",value:1.5},{label:"1.7 倍行距",value:1.7,default:!0},{label:"2 倍行距",value:2},{label:"2.5 倍行距",value:2.5},{label:"3 倍行距",value:3}]},file:{allowedMimeTypes:[],maxSize:1024*1024*100},ai:{enabled:!0,maxlength:100,async sendMessage(f){return new Promise(d=>{setTimeout(()=>{d(`这里是 AI 的回复。你发送了:${f.input}`)},1e3)})}},users:[{id:"Cassielxd",label:"Cassielxd"},{id:"Goldziher",label:"Na'aman Hirschfeld"},{id:"SerRashin",label:"SerRashin"},{id:"ChenErik",label:"ChenErik"},{id:"china-wangxu",label:"china-wangxu"},{id:"Sherman Xu",label:"xuzhenjun130"},{id:"testuser",label:"测试用户"}],echarts:{mode:1,renderImage:!1},page:{layouts:["page","web"],layout:"page",showToc:!1,toolbar:"double",watermark:{type:"测试",alpha:.2,fontColor:"#000",fontSize:16,fontFamily:"SimSun",fontWeight:"normal",text:""},size:{key:"A4",width:21,height:29.7},margin:{left:3.18,right:3.18,top:2.54,bottom:2.54}},async onFileUpload(f){if(!f)throw new Error("没有找到要上传的文件");return console.log("onUpload",f),await new Promise(d=>setTimeout(d,3e3)),{id:ip(),url:f.url??URL.createObjectURL(f),name:f.name,type:f.type,size:f.size}},onFileDelete(f,d){console.log(f,d)}},o=m.ref(null),s=m.ref(uQ(r,a)),l=m.ref(s.value?.page),u=m.ref(!1),c=m.ref(new Map);return m.provide("container",i),m.provide("options",s),m.provide("editor",o),m.provide("page",l),m.provide("assistant",u),m.provide("uploadFileMap",c),m.watch(()=>o.value,()=>{o.value&&(o.value.on("create",({editor:f})=>{t("created",{editor:f})}),o.value.on("update",({editor:f})=>{t("changed",{editor:f})}),o.value.on("selectionUpdate",({editor:f})=>{t("changed:selection",{editor:f})}),o.value.on("transaction",({editor:f,transaction:d})=>{t("changed:transaction",{editor:f,transaction:d})}),o.value.on("focus",({editor:f,event:d})=>{t("focus",{editor:f,event:d})}),o.value.on("contentError",({editor:f,error:d,disableCollaboration:h})=>{t("contentError",{editor:f,error:d,disableCollaboration:h})}),o.value.on("blur",({editor:f,event:d})=>{t("blur",{editor:f,event:d})}),o.value.on("destroy",()=>{t("destroy")}))}),(f,d)=>(m.openBlock(),m.createBlock(w6e))}}),Kv="TOOLTIP_INSTANCE",k6e={mounted(n,e){let t="",r="top",i=[300,0];typeof e.value=="string"?t=e.value:(t=e.value.content,e.value.placement!==void 0&&(r=e.value.placement),e.value.delay!==void 0&&(i=e.value.delay)),n[Kv]=Zl(n,{content:t,theme:"tooltip",duration:100,animation:"scale",allowHTML:!0,placement:r,delay:i})},updated(n,e){let t="";typeof e.value=="string"?t=e.value:t=e.value.content,n[Kv]&&n[Kv].setContent(t)},unmounted(n){n[Kv]&&n[Kv].destroy()}},T6e={install(n){n.directive("tooltip",k6e)}},C6e={install:(n,e)=>{n.provide("providedOptions",e??{}),n.component(eA.name??"WhiteEditor",eA),n.use(T6e)}};exports.default=eA;exports.useWhiteEditor=C6e;
373
+ `).map(e=>`<p>${e}</p>`).join("")):n,y6e={class:"flex flex-col white-give-editor-wrapper white-editor-namespace"},b6e={key:0,class:"w-full flex-none border-b border-[#d9d9d9]"},x6e=["id"],_6e={key:1,class:"w-full h-[40px] flex-none border-t border-[#d9d9d9] px-[2rem]"},S6e=m.defineComponent({__name:"HomeView",setup(n){const e=m.inject("editor"),t=m.inject("container"),r=m.inject("options"),i=m.inject("uploadFileMap"),a=m.inject("page"),o=wPe({container:t,options:r,uploadFileMap:i}),s=new Cae({editable:!r.value?.editor?.readOnly,autofocus:r.value?.editor?.autofocus,content:m6e(r.value.document?.content),enableInputRules:gz(r),enablePasteRules:gz(r),editorProps:{attributes:{class:"white-editor"},...r.value?.editor?.editorProps},parseOptions:r.value?.editor?.parseOptions,extensions:o});return e.value=s,e.value.storage.container=t,e.value.storage.options=r.value,(l,u)=>(m.openBlock(),m.createElementBlock("div",y6e,[m.unref(r).layout.toolbar.show?(m.openBlock(),m.createElementBlock("div",b6e,[m.createVNode(FBe)])):m.createCommentVNode("",!0),m.createElementVNode("div",{class:"w-full flex-1 min-h-0 flex overflow-hidden",id:m.unref(t)},[m.unref(a).showToc&&m.unref(r).layout.toc.show?(m.openBlock(),m.createBlock(b8e,{key:0})):m.createCommentVNode("",!0),m.createElementVNode("div",{class:m.normalizeClass(["flex-1 h-full overflow-y-auto py-[20px]",m.unref(a).layout==="page"?"bg-[#f4f6fa]":""])},[m.createVNode(g6e)],2)],8,x6e),m.unref(r).layout.foot.show?(m.openBlock(),m.createElementBlock("div",_6e,[m.createVNode(c8e)])):m.createCommentVNode("",!0)]))}}),eA=m.defineComponent({__name:"index",emits:["beforeCreate","created","change","change:selection","change:transaction","change:menu","change:toolbar","change:pageLayout","change:pageSize","change:pageOrientation","change:pageMargin","change:pageBackground","change:pageShowToc","change:pagePreview","change:pageZoom","change:pageWatermark","change:locale","change:theme","contentError","print","focus","blur","saved","destroy","menuChange"],setup(n,{emit:e}){const t=e,r=m.inject("providedOptions",{}),i=m.ref(`white-editor-${ip()}`),a={document:{title:"无标题文档",content:""},editor:{readOnly:!1,autofocus:!1,parseOptions:{preserveWhitespace:"full"},editorProps:{},enableMarkdown:!0},layout:{toc:{show:!0},toolbar:{show:!0},foot:{show:!0,pageSize:!0,character:!0,copy:!0,download:!0}},dicts:{lineHeights:[{label:"单倍行距",value:1},{label:"1.5 倍行距",value:1.5},{label:"1.7 倍行距",value:1.7,default:!0},{label:"2 倍行距",value:2},{label:"2.5 倍行距",value:2.5},{label:"3 倍行距",value:3}],pageSizeOption:[{label:"网页",layout:"web"},{label:"A4",width:21,height:29.7,default:!0,layout:"page"},{label:"A3",width:29.7,height:42,layout:"page"},{label:"A5",width:14.8,height:21,layout:"page"},{label:"B5",width:17.6,height:25,layout:"page"},{label:"5号信纸",width:10.9,height:12.9,layout:"page"},{label:"6号信纸",width:11.9,height:22.9,layout:"page"},{label:"7号信纸",width:16.1,height:22.8,layout:"page"},{label:"9号信纸",width:22.8,height:32.3,layout:"page"},{label:"法律用纸",width:21.5,height:33.5,layout:"page"}]},file:{allowedMimeTypes:[],maxSize:1024*1024*100},ai:{enabled:!0,maxlength:100,async sendMessage(f){return new Promise(d=>{setTimeout(()=>{d(`这里是 AI 的回复。你发送了:${f.input}`)},1e3)})}},users:[{id:"Cassielxd",label:"Cassielxd"},{id:"Goldziher",label:"Na'aman Hirschfeld"},{id:"SerRashin",label:"SerRashin"},{id:"ChenErik",label:"ChenErik"},{id:"china-wangxu",label:"china-wangxu"},{id:"Sherman Xu",label:"xuzhenjun130"},{id:"testuser",label:"测试用户"}],echarts:{mode:1,renderImage:!1},page:{layouts:["page","web"],layout:"page",showToc:!1,toolbar:"double",watermark:{type:"测试",alpha:.2,fontColor:"#000",fontSize:16,fontFamily:"SimSun",fontWeight:"normal",text:""},size:{key:"A4",width:21,height:29.7},margin:{left:3.18,right:3.18,top:2.54,bottom:2.54}},async onFileUpload(f){if(!f)throw new Error("没有找到要上传的文件");return console.log("onUpload",f),await new Promise(d=>setTimeout(d,3e3)),{id:ip(),url:f.url??URL.createObjectURL(f),name:f.name,type:f.type,size:f.size}},onFileDelete(f,d){console.log(f,d)}},o=m.ref(null),s=m.ref(uQ(r,a)),l=m.ref(s.value?.page),u=m.ref(!1),c=m.ref(new Map);return m.provide("container",i),m.provide("options",s),m.provide("editor",o),m.provide("page",l),m.provide("assistant",u),m.provide("uploadFileMap",c),m.watch(()=>o.value,()=>{o.value&&(o.value.on("create",({editor:f})=>{t("created",{editor:f})}),o.value.on("update",({editor:f})=>{t("change",{editor:f})}),o.value.on("selectionUpdate",({editor:f})=>{t("change:selection",{editor:f})}),o.value.on("transaction",({editor:f,transaction:d})=>{t("change:transaction",{editor:f,transaction:d})}),o.value.on("focus",({editor:f,event:d})=>{t("focus",{editor:f,event:d})}),o.value.on("contentError",({editor:f,error:d,disableCollaboration:h})=>{t("contentError",{editor:f,error:d,disableCollaboration:h})}),o.value.on("blur",({editor:f,event:d})=>{t("blur",{editor:f,event:d})}),o.value.on("destroy",()=>{t("destroy")}))}),(f,d)=>(m.openBlock(),m.createBlock(S6e))}}),Kv="TOOLTIP_INSTANCE",w6e={mounted(n,e){let t="",r="top",i=[300,0];typeof e.value=="string"?t=e.value:(t=e.value.content,e.value.placement!==void 0&&(r=e.value.placement),e.value.delay!==void 0&&(i=e.value.delay)),n[Kv]=Zl(n,{content:t,theme:"tooltip",duration:100,animation:"scale",allowHTML:!0,placement:r,delay:i})},updated(n,e){let t="";typeof e.value=="string"?t=e.value:t=e.value.content,n[Kv]&&n[Kv].setContent(t)},unmounted(n){n[Kv]&&n[Kv].destroy()}},k6e={install(n){n.directive("tooltip",w6e)}},T6e={install:(n,e)=>{n.provide("providedOptions",e??{}),n.component(eA.name??"WhiteEditor",eA),n.use(k6e)}};exports.default=eA;exports.useWhiteEditor=T6e;