xiaodao-editor 0.1.20 → 0.1.21
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/README.ZH.md +191 -68
- package/README.md +230 -78
- package/dist/block-editor.js +10444 -20908
- package/dist/block-editor.umd.cjs +30 -285
- package/dist/core/Editor.d.ts +32 -0
- package/dist/core/command/primitiveCommands.d.ts +1 -1
- package/dist/core/plugin/Plugin.d.ts +45 -5
- package/dist/core/state/EditorState.d.ts +5 -2
- package/dist/core/state/invert.d.ts +2 -2
- package/dist/core/types.d.ts +1 -1
- package/dist/extensions/Equation.d.ts +73 -8
- package/dist/extensions/Image.d.ts +54 -17
- package/dist/extensions/OrderedList.d.ts +1 -1
- package/dist/extensions/Paragraph.d.ts +1 -1
- package/dist/extensions/Table.d.ts +1 -1
- package/dist/extensions/math/ast.d.ts +140 -0
- package/dist/extensions/math/index.d.ts +18 -0
- package/dist/extensions/math/parser.d.ts +5 -0
- package/dist/extensions/math/renderHtml.d.ts +5 -0
- package/dist/extensions/math/renderTree.d.ts +16 -0
- package/dist/extensions/math/renderVNode.d.ts +4 -0
- package/dist/extensions/math/symbols.d.ts +37 -0
- package/dist/extensions/math/tokens.d.ts +22 -0
- package/dist/extensions/tableModel.d.ts +6 -6
- package/dist/i18n.d.ts +2 -2
- package/dist/index.d.ts +6 -3
- package/dist/style.css +1 -1
- package/dist/view/BlockEditor.vue.d.ts +0 -30
- package/dist/view/BlockList.vue.d.ts +2 -2
- package/dist/view/context.d.ts +11 -2
- package/dist/view/imageUpload.d.ts +20 -14
- package/dist/view/ui/icons.d.ts +22 -22
- package/dist/view/ui/inputRulesEngine.d.ts +2 -2
- package/dist/view/ui/popup.d.ts +1 -1
- package/dist/view/urlUtils.d.ts +2 -2
- package/package.json +2 -3
|
@@ -1,288 +1,33 @@
|
|
|
1
|
-
(function(ye,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],i):(ye=typeof globalThis<"u"?globalThis:ye||self,i(ye.BlockEditor={},ye.Vue))})(this,function(ye,i){"use strict";var a5=Object.defineProperty;var s5=(ye,i,To)=>i in ye?a5(ye,i,{enumerable:!0,configurable:!0,writable:!0,value:To}):ye[i]=To;var Pt=(ye,i,To)=>s5(ye,typeof i!="symbol"?i+"":i,To);function To(t){return typeof t=="string"&&t.length>0}function Kd(t){return t.type==="text"}function Ue(t){return t.reduce((e,n)=>n.type==="text"?e+n.text:e,"")}function Xr(t){return t.length===0?[]:[{type:"text",text:t}]}function En(t,e){const n=Math.max(0,Math.floor(e));if(n<=0)return[[],t];const r=Ue(t).length;if(n>=r)return[t,[]];const o=[],l=[];let a=0;for(const s of t){if(s.type!=="text"){a<n?o.push(s):l.push(s);continue}const c=s.text.length;if(a+c<=n){o.push(s),a+=c;continue}if(a>=n){l.push(s);continue}const u=n-a,d=s.text.slice(0,u),f=s.text.slice(u);d.length>0&&o.push(s.marks?{...s,text:d}:{...s,text:d,marks:void 0}),f.length>0&&l.push(s.marks?{...s,text:f}:{...s,text:f,marks:void 0}),a+=c}return[o,l]}const Bs="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-",Is=12;function Yd(t){const e=globalThis.crypto;if(!e||typeof e.getRandomValues!="function")throw new Error("BlockEditor: Web Crypto getRandomValues is unavailable in this environment.");const n=new Uint8Array(t);return e.getRandomValues(n),n}function Mo(){const t=Yd(Is);let e="";for(let n=0;n<Is;n++)e+=Bs[t[n]%Bs.length];return e}function Xd(t){return t}const Zd={empty:t=>t.content.length===0||t.content.every(e=>e.text==="")};function Ml(t){return{type:t.type,attrs:t.attrs??{},content:t.content??"text",nestable:t.nestable??!1,allowedChildren:t.allowedChildren??"*",isolating:t.isolating??!1,listLike:t.listLike??!1,inlineMarks:t.inlineMarks??!0,disallowedMarks:t.disallowedMarks??[],empty:t.empty??Zd.empty}}function Zr(t){const e={};for(const[n,r]of Object.entries(t.attrs))e[n]=r.default;return e}function _s(t,e){const n={};for(const[r,o]of Object.entries(t.attrs)){const l=e[r];l!==void 0&&(!o.validate||o.validate(l))?n[r]=l:n[r]=o.default}return n}function Rs(t,e){return t.nestable?t.allowedChildren==="*"?!0:t.allowedChildren.includes(e):!1}function Ls(t){return t.content==="text"}function Os(t){return t.isolating}function Ds(t,e){return t.empty(e)}class zs{constructor(e,n){Pt(this,"schemas");Pt(this,"fallback");this.schemas=e,this.fallback=n}get(e){return this.schemas.get(e)??this.fallback}has(e){return this.schemas.has(e)}defaultAttrsFor(e){return Zr(this.get(e))}coerceAttrsFor(e,n){return _s(this.get(e),n)}canContain(e,n){return Rs(this.get(e),n)}hasText(e){return Ls(this.get(e))}isIsolating(e){return Os(this.get(e))}isListLike(e){return this.get(e).listLike}hasInlineMarks(e){return this.get(e).inlineMarks}isMarkDisallowed(e,n){return this.get(e).disallowedMarks.includes(n)}isEmpty(e){return Ds(this.get(e.type),e)}}const Hs=new Set(["paragraph","heading","bulletList","orderedList","todoList"]);function Al(t){const e=new Map,n=new Map,r=new Map,o=new Set,l=p=>{if(p&&!o.has(p)){const g=p;return o.add(g),p&&r.set(p,g),g}let b=Mo();for(;o.has(b);)b=Mo();return o.add(b),b},a=(p,b)=>{const g=l(p.id);n.set(g,b);const k=[];for(const E of p.children??[])k.push(a(E,g));return e.set(g,{id:g,type:p.type,attrs:p.attrs??{},content:p.content??[],children:k}),g},s=[];for(const p of t.blocks??[])s.push(a(p,null));const c=Array.from(n.values()).every(p=>p===null);let u=!1;for(const p of e.values())if(typeof p.attrs.indent=="number"&&p.attrs.indent>0){u=!0;break}c&&u&&jd(e,n,s);const d=10;for(const[p,b]of e){const g=Math.min(d,Nl(n,p));if((typeof b.attrs.indent=="number"?b.attrs.indent:0)===g)continue;const{indent:E,...M}=b.attrs,O=g>0?{...M,indent:g}:M;e.set(p,{...b,attrs:O})}return{doc:{id:t.id??t1(),root:s,blocks:e,parent:n},idMap:r}}function jd(t,e,n){const r=[...n];for(const[s,c]of t)t.set(s,{...c,children:[]});const o=[],l=[],a=(s,c)=>{if(s===null){l.push(c),e.set(c,null);return}const u=t.get(s);if(!u){l.push(c),e.set(c,null);return}const d={...u,children:[...u.children,c]};t.set(s,d),e.set(c,s)};for(const s of r){const c=t.get(s);if(!c)continue;const u=typeof c.attrs.indent=="number"?c.attrs.indent:0,d=Hs.has(c.type),f=d?Math.max(0,u):0;for(;o.length>0&&o[o.length-1].indent>=f;)o.pop();let b=o.length>0?o[o.length-1].id:null;for(;b!==null;){const g=t.get(b);if(!g||!Hs.has(g.type))b=e.get(b)??null;else break}a(b,s),d&&o.push({indent:f,id:s})}n.length=0;for(const s of l)n.push(s)}function Ps(t){const e=r=>r.map(o=>o.type==="text"?{type:"text",text:o.text,marks:o.marks&&o.marks.length>0?o.marks.map(l=>({type:l.type,attrs:l.attrs?{...l.attrs}:void 0})):void 0}:{...o}),n=r=>{const o=t.blocks.get(r);if(!o)throw new Error(`BlockEditor: missing block ${r} during serialization`);const l=o.children.map(n);return{id:r,type:o.type,attrs:o.attrs?{...o.attrs}:void 0,content:e(o.content),...l.length?{children:l}:{}}};return{id:t.id,blocks:t.root.map(n)}}function Kt(t,e){return t.blocks.get(e)}function Wn(t,e){const n=t.blocks.get(e);if(!n)throw new Error(`BlockEditor: unknown block ${e}`);return n}function dn(t,e){return t.parent.get(e)??null}function Ir(t,e){return Nl(t.parent,e)}function Nl(t,e){let n=0,r=t.get(e);const o=new Set;for(;r!=null&&!o.has(r);)o.add(r),n++,r=t.get(r);return n}function Ao(t,e){const n=t.parent.get(e);if(n==null)return t.root;const r=t.blocks.get(n);return r?r.children:t.root}function Kn(t,e){return Ao(t,e).indexOf(e)}function Bl(t,e){const n=Kn(t,e);if(n<=0)return;const r=Ao(t,e);return t.blocks.get(r[n-1])}function Qd(t,e){const n=Ao(t,e),r=n.indexOf(e);if(!(r<0||r>=n.length-1))return t.blocks.get(n[r+1])}function yr(t){const e=[],n=r=>{for(const o of r){e.push(o);const l=t.blocks.get(o);l&&n(l.children)}};return n(t.root),e}function _r(t,e){const n=yr(t),r=n.indexOf(e);if(!(r<=0))return t.blocks.get(n[r-1])}function No(t,e){const n=yr(t),r=n.indexOf(e);if(!(r<0||r>=n.length-1))return t.blocks.get(n[r+1])}function $s(t,e){const n=Wn(t,e);if(n.children.length===0)return n;const r=n.children[n.children.length-1];return $s(t,r)}function Fs(t,e){const r=[];for(const[o,l]of t.blocks){const a=Math.min(10,Nl(t.parent,o)),s=e?e.get(l.type).attrs:void 0,c=s?"indent"in s:!0,u=c?a:0;if((typeof l.attrs.indent=="number"?l.attrs.indent:0)===u)continue;const{indent:f,...p}=l.attrs,b=u>0&&c?{...p,indent:u}:p;r.push({id:o,attrs:b})}return r}function Jd(t,e){return{...t,content:e}}function e1(t,e){return{...t,attrs:e}}function t1(){return"doc_"+Math.random().toString(36).slice(2,10)}function n1(t){return{id:t.id,root:t.root,blocks:t.blocks,parent:t.parent}}function Ii(t,e,n){t.blocks.set(e,n),t.changed.add(e)}function Jo(t,e,n){if(e===null)t.root=n;else{const r=t.blocks.get(e);if(!r)throw new Error(`BlockEditor: unknown parent ${e}`);Ii(t,e,{...r,children:n})}}function ei(t,e){if(e===null)return t.root;const n=t.blocks.get(e);if(!n)throw new Error(`BlockEditor: unknown parent ${e}`);return n.children}function r1(t,e){if(!t.blocks.get(e))throw new Error(`BlockEditor: cannot remove unknown block ${e}`);const r=t.parent.get(e)??null,o=ei(t,r).filter(a=>a!==e);Jo(t,r,o);const l=[e];for(;l.length;){const a=l.pop(),s=t.blocks.get(a);if(s)for(const c of s.children)l.push(c);t.blocks.delete(a),t.parent.delete(a),t.removed.add(a),t.changed.delete(a)}}function _i(t,e){const n={id:t.id,root:[...t.root],blocks:new Map(t.blocks),parent:new Map(t.parent),changed:new Set,removed:new Set};for(const r of e)switch(r.op){case"insertBlock":{if(n.blocks.has(r.id))throw new Error(`BlockEditor: insertBlock id collision ${r.id}`);const o={id:r.id,type:r.type,attrs:r.attrs,content:r.content,children:[]};n.blocks.set(r.id,o),n.parent.set(r.id,r.parent),n.changed.add(r.id);const l=[...ei(n,r.parent)],a=Math.max(0,Math.min(r.index,l.length));l.splice(a,0,r.id),Jo(n,r.parent,l);break}case"removeBlock":{r1(n,r.id);break}case"replaceBlock":{const o=n.blocks.get(r.id);if(!o)throw new Error(`BlockEditor: replaceBlock unknown ${r.id}`);Ii(n,r.id,{...o,type:r.type,attrs:r.attrs});break}case"moveBlock":{if(!n.blocks.get(r.id))throw new Error(`BlockEditor: moveBlock unknown ${r.id}`);const l=n.parent.get(r.id)??null;if(l===r.toParent){const a=ei(n,l).filter(c=>c!==r.id),s=Math.max(0,Math.min(r.toIndex,a.length));a.splice(s,0,r.id),Jo(n,l,a)}else{const a=ei(n,l).filter(u=>u!==r.id);Jo(n,l,a);const s=[...ei(n,r.toParent)],c=Math.max(0,Math.min(r.toIndex,s.length));s.splice(c,0,r.id),Jo(n,r.toParent,s),n.parent.set(r.id,r.toParent)}break}case"setText":{const o=n.blocks.get(r.id);if(!o)throw new Error(`BlockEditor: setText unknown ${r.id}`);Ii(n,r.id,{...o,content:r.content});break}case"setAttrs":{const o=n.blocks.get(r.id);if(!o)throw new Error(`BlockEditor: setAttrs unknown ${r.id}`);Ii(n,r.id,{...o,attrs:r.attrs});break}}return{doc:n1(n),changed:n.changed,removed:n.removed}}function Vs(t,e,n){const{doc:r,changed:o,removed:l}=_i(t.doc,e.steps),a=e.selectionAfter??t.selection,s={...t.pluginState};for(const c of n)c.applyTransaction&&(s[c.name]=c.applyTransaction(e,t,r,a));return{doc:r,state:{doc:r,selection:a,pluginState:s,version:t.version+1},changed:o,removed:l}}function Il(t,e,n={}){return{doc:t,selection:e,pluginState:n,version:0}}class Us{constructor(){Pt(this,"steps",[]);Pt(this,"selectionAfter");Pt(this,"meta",{})}insertBlock(e){const n=e.id??Mo();return this.steps.push({op:"insertBlock",parent:e.parent,index:e.index,id:n,type:e.type,attrs:e.attrs??{},content:e.content??[]}),n}removeBlock(e){return this.steps.push({op:"removeBlock",id:e}),this}replaceBlock(e,n,r){return this.steps.push({op:"replaceBlock",id:e,type:n,attrs:r}),this}moveBlock(e,n,r){return this.steps.push({op:"moveBlock",id:e,toParent:n,toIndex:r}),this}setText(e,n){return this.steps.push({op:"setText",id:e,content:n}),this}setAttrs(e,n){return this.steps.push({op:"setAttrs",id:e,attrs:n}),this}peek(){return this.steps}appendSteps(e){for(const n of e)this.steps.push(n);return this}setSelection(e){return this.selectionAfter=e,this}setMeta(e){return this.meta={...this.meta,...e},this}addToHistory(e){return this.meta={...this.meta,addToHistory:e},this}historyGroup(e){return this.meta={...this.meta,historyGroup:e},this}skipDomWrite(e){return this.meta={...this.meta,viewHints:{...this.meta.viewHints,skipDomWrite:e}},this}build(){return{steps:this.steps,selectionAfter:this.selectionAfter,meta:this.meta}}}function kt(){return new Us}function qs(t,e){const n=[];for(let r=t.length-1;r>=0;r--){const o=t[r];switch(o.op){case"insertBlock":n.push({op:"removeBlock",id:o.id});break;case"removeBlock":n.push(...o1(o.id,e));break;case"replaceBlock":{const l=e.blocks.get(o.id);if(!l)break;n.push({op:"replaceBlock",id:o.id,type:l.type,attrs:l.attrs});break}case"moveBlock":{n.push({op:"moveBlock",id:o.id,toParent:dn(e,o.id),toIndex:Kn(e,o.id)});break}case"setText":{const l=e.blocks.get(o.id);if(!l)break;n.push({op:"setText",id:o.id,content:l.content});break}case"setAttrs":{const l=e.blocks.get(o.id);if(!l)break;n.push({op:"setAttrs",id:o.id,attrs:l.attrs});break}}}return n}function o1(t,e){const n=[],r=o=>{const l=Wn(e,o);n.push({op:"insertBlock",parent:dn(e,o),index:Kn(e,o),id:o,type:l.type,attrs:l.attrs,content:l.content});for(const a of l.children)r(a)};return r(t),n}function Ct(t,e){return{kind:"caret",blockId:t,offset:e}}function _l(t,e){return{kind:"text",anchor:t,focus:e}}function i1(t){return{kind:"blocks",blockIds:[...t]}}function Bo(t){return t.kind==="caret"}function jr(t){return t.kind==="text"}function ti(t){return t.kind==="blocks"}function Rl(t){return Bo(t)?!0:jr(t)?t.anchor.blockId===t.focus.blockId&&t.anchor.offset===t.focus.offset:t.blockIds.length===0}function Gs(t){return Bo(t)?t.blockId:jr(t)?t.focus.blockId:t.blockIds[0]??null}function l1(t){return Bo(t)?t.offset:jr(t)?t.focus.offset:0}function a1(t,e){return jr(t)?e(t.anchor,t.focus)<=0?[t.anchor,t.focus]:[t.focus,t.anchor]:null}class Ws{constructor(){Pt(this,"entries",new Map)}register(e){if(this.entries.has(e.name))throw new Error(`BlockEditor: duplicate command "${e.name}"`);this.entries.set(e.name,e)}override(e){this.entries.set(e.name,e)}has(e){return this.entries.has(e)}get(e){return this.entries.get(e)}createProxy(e){const n=this.entries;return new Proxy({},{get:(r,o)=>n.has(o)?l=>e(o,l):()=>!1})}}function Ri(t){if(ti(t))return null;const e=Gs(t);if(!e)return null;const n=Bo(t)?t.offset:t.focus.offset;return{blockId:e,offset:n}}const Ll=10;function jn(t,e,n){const r=e.peek();if(r.length===0)return;const o=_i(t.doc,r),l=Fs(o.doc,n.registries.schema);for(const a of l)e.setAttrs(a.id,a.attrs)}function Li(t){return{name:"insertBlock",run:e=>(n,r)=>{const o=e.type,l=e.attrs??t.registries.schema.defaultAttrsFor(o),a=e.content??[];let s,c;if(e.after){if(!Kt(n.doc,e.after))return!1;s=dn(n.doc,e.after),c=Kn(n.doc,e.after)+1}else if(e.parent!==void 0){s=e.parent;const f=s===null?n.doc.root:Wn(n.doc,s).children;c=e.index??f.length}else s=null,c=n.doc.root.length;if(s!==null){const f=Kt(n.doc,s);if(!f)return!1;const p=t.registries.schema.get(f.type);if(!(p!=null&&p.nestable))return!1}const u=kt(),d=u.insertBlock({parent:s,index:c,type:o,attrs:l,content:a});return u.setSelection(Ct(d,0)),r==null||r(u.build()),!0}}}function Ol(t){return{name:"removeBlock",run:e=>(n,r)=>{if(!Kt(n.doc,e.id))return!1;const o=_r(n.doc,e.id),l=No(n.doc,e.id),a=o??l,s=kt(),u=Wn(n.doc,e.id).children??[];if(u.length>0){const d=dn(n.doc,e.id),f=Kn(n.doc,e.id);if((()=>{if(!o)return!1;const b=t.registries.schema.get(o.type);return!(!(b!=null&&b.nestable)||Ir(n.doc,o.id)>=Ll)})()&&o){let g=(o.children??[]).length;for(const k of u)s.moveBlock(k,o.id,g),g++}else{let b=f;for(const g of u)s.moveBlock(g,d,b),b++}}if(s.removeBlock(e.id),jn(n,s,t),a){const d=Ue(a.content);s.setSelection(Ct(a.id,d.length))}return r==null||r(s.build()),!0}}}function s1(t){return{name:"replaceBlock",run:e=>(n,r)=>{if(!Kt(n.doc,e.id))return!1;const l=e.attrs??t.registries.schema.defaultAttrsFor(e.type),a=kt();return a.replaceBlock(e.id,e.type,l),jn(n,a,t),a.setSelection(Ct(e.id,0)),r==null||r(a.build()),!0}}}function c1(){return{name:"setText",run:t=>(e,n)=>{if(!Kt(e.doc,t.id))return!1;const r=kt();return r.setText(t.id,t.content),t.selectionAfter&&r.setSelection(t.selectionAfter),r.historyGroup("type"),r.skipDomWrite([t.id]),r.setMeta({source:"input",addToHistory:!0}),n==null||n(r.build()),!0}}}function u1(){return{name:"setAttrs",run:t=>(e,n)=>{if(!Kt(e.doc,t.id))return!1;const o=kt();return o.setAttrs(t.id,t.attrs),n==null||n(o.build()),!0}}}function Dl(t){return{name:"splitBlock",run:e=>(n,r)=>{const o=Kt(n.doc,e.id);if(!o||!t.registries.schema.hasText(o.type))return!1;const l=Ue(o.content).length,a=Math.max(0,Math.min(e.offset,l)),[s,c]=En(o.content,a),u=dn(n.doc,e.id),d=Kn(n.doc,e.id),f=o.children??[],p=e.asType??t.registries.defaultBlockType,b=e.asAttrs??t.registries.schema.defaultAttrsFor(p),g=kt();g.setText(e.id,s);const k=g.insertBlock({parent:u,index:d+1,type:p,attrs:b,content:c});if(f.length>0)for(let E=0;E<f.length;E++)g.moveBlock(f[E],k,E);return jn(n,g,t),g.setSelection(Ct(k,0)),r==null||r(g.build()),!0}}}function Ks(t){return{name:"mergeBlock",run:e=>(n,r)=>{const o=Kt(n.doc,e.id);if(!o)return!1;const l=_r(n.doc,e.id);if(!l||!t.registries.schema.hasText(l.type))return!1;const a=Ue(l.content),s=[...l.content,...o.content],c=kt();c.setText(l.id,s);const u=o.children??[];if(u.length>0){const d=dn(n.doc,e.id),f=Kn(n.doc,e.id),p=t.registries.schema.get(l.type);if(!!(p!=null&&p.nestable)&&Ir(n.doc,l.id)<Ll){let k=(l.children??[]).length;for(const E of u)c.moveBlock(E,l.id,k),k++}else{let g=f;for(const k of u)c.moveBlock(k,d,g),g++}}return c.removeBlock(e.id),jn(n,c,t),c.setSelection(Ct(l.id,a.length)),r==null||r(c.build()),!0}}}function d1(t){return{name:"enter",run:()=>(e,n)=>{const r=e.selection,o=Ri(r);if(!o){if(ti(r)&&r.blockIds.length){const u=r.blockIds[r.blockIds.length-1];return Li(t).run({type:t.registries.defaultBlockType,after:u})(e,n)}return!1}const l=Wn(e.doc,o.blockId),a=t.registries.schema.get(l.type);if(!t.registries.schema.hasText(l.type))return Li(t).run({type:t.registries.defaultBlockType,after:l.id})(e,n);if(a.isolating)return!1;const s=Ue(l.content),c=o.offset>=s.length;return a.listLike&&t.registries.schema.isEmpty(l)?Oi(t).run({id:l.id,type:t.registries.defaultBlockType})(e,n):c&&t.registries.schema.isEmpty(l)?Li(t).run({type:t.registries.defaultBlockType,after:l.id})(e,n):a.listLike?Dl(t).run({id:l.id,offset:o.offset,asType:l.type})(e,n):Dl(t).run({id:l.id,offset:o.offset})(e,n)}}}function f1(t){return{name:"backspace",run:()=>(e,n)=>{const r=e.selection;if(ti(r)&&r.blockIds.length){const s=r.blockIds[0],c=_r(e.doc,s),u=kt();for(const f of r.blockIds)u.removeBlock(f);const d=c??No(e.doc,r.blockIds[r.blockIds.length-1]);return jn(e,u,t),d&&u.setSelection(Ct(d.id,Ue(d.content).length)),n==null||n(u.build()),!0}const o=Ri(r);if(!o)return!1;const l=Wn(e.doc,o.blockId);if(jr(r)&&!Rl(r)&&r.anchor.blockId===r.focus.blockId){const[s,c]=r.anchor.offset<=r.focus.offset?[r.anchor.offset,r.focus.offset]:[r.focus.offset,r.anchor.offset],u=Ue(l.content),d=Xr(u.slice(0,s)+u.slice(c)),f=kt();return f.setText(l.id,d),f.setSelection(Ct(l.id,s)),f.skipDomWrite([l.id]),n==null||n(f.build()),!0}if(jr(r)&&!Rl(r)&&r.anchor.blockId!==r.focus.blockId){const s=yr(e.doc),c=s.indexOf(r.anchor.blockId),u=s.indexOf(r.focus.blockId);if(c===-1||u===-1)return!1;const[d,f]=c<=u?[r.anchor,r.focus]:[r.focus,r.anchor],p=s.indexOf(d.blockId),b=s.indexOf(f.blockId);if(p===-1||b===-1||p>=b)return!1;const g=Wn(e.doc,d.blockId),k=Wn(e.doc,f.blockId),E=Ue(g.content).length,M=Ue(k.content).length,O=Math.min(d.offset,E),P=Math.min(f.offset,M),[te]=En(g.content,O),[,z]=En(k.content,P),H=[...te,...z],ie=Ue(te).length,Q=kt();Q.setText(d.blockId,H);for(let ne=b;ne>p;ne--)Q.removeBlock(s[ne]);return Q.setSelection(Ct(d.blockId,ie)),jn(e,Q,t),n==null||n(Q.build()),!0}if(o.offset>0)return!1;if(Ir(e.doc,l.id)>0)return Ys(t).run({id:l.id})(e,n);if(t.registries.schema.isListLike(l.type))return Oi(t).run({id:l.id,type:t.registries.defaultBlockType})(e,n);if(t.registries.schema.isEmpty(l)&&l.type!==t.registries.defaultBlockType)return Oi(t).run({id:l.id,type:t.registries.defaultBlockType})(e,n);const a=_r(e.doc,l.id);return a?t.registries.schema.isIsolating(l.type)||t.registries.schema.isIsolating(a.type)?t.registries.schema.isEmpty(l)?Ol(t).run({id:l.id})(e,n):!1:t.registries.schema.hasText(a.type)?Ks(t).run({id:l.id})(e,n):t.registries.schema.isEmpty(l)?Ol(t).run({id:l.id})(e,n):!1:!1}}}function h1(){return{name:"moveToPreviousBlock",run:()=>(t,e)=>{const n=Ri(t.selection);if(!n)return!1;const r=_r(t.doc,n.blockId);if(!r)return!1;const o=Math.min(n.offset,Ue(r.content).length);return e==null||e(kt().setSelection(Ct(r.id,o)).setMeta({addToHistory:!1}).build()),!0}}}function m1(){return{name:"moveToNextBlock",run:()=>(t,e)=>{const n=Ri(t.selection);if(!n)return!1;const r=No(t.doc,n.blockId);if(!r)return!1;const o=Math.min(n.offset,Ue(r.content).length);return e==null||e(kt().setSelection(Ct(r.id,o)).setMeta({addToHistory:!1}).build()),!0}}}function p1(){return{name:"setSelection",run:t=>(e,n)=>(n==null||n(kt().setSelection(t.selection).setMeta({addToHistory:!1}).build()),!0)}}function g1(){return{name:"clearSelection",run:()=>(t,e)=>(e==null||e(kt().setSelection({kind:"blocks",blockIds:[]}).setMeta({addToHistory:!1}).build()),!0)}}function b1(){return{name:"selectAll",run:()=>(t,e)=>{const n=yr(t.doc);if(n.length===0)return!1;const r=n[0],o=n[n.length-1],l=Wn(t.doc,o),a=Ue(l.content).length,s={kind:"text",anchor:{blockId:r,offset:0},focus:{blockId:o,offset:a}};return e==null||e(kt().setSelection(s).setMeta({addToHistory:!1}).build()),!0}}}function v1(){return{name:"selectBlock",run:t=>(e,n)=>(n==null||n(kt().setSelection({kind:"blocks",blockIds:[t.id]}).setMeta({addToHistory:!1}).build()),!0)}}function k1(t){return{name:"moveBlock",run:e=>(n,r)=>{if(!Kt(n.doc,e.id)||e.toParent===e.id)return!1;if(e.toParent!==null){let a=e.toParent;for(;a!==null;){if(a===e.id)return!1;a=dn(n.doc,a)}}if(e.toParent!==null){const a=Kt(n.doc,e.toParent);if(!a)return!1;const s=t.registries.schema.get(a.type);if(!(s!=null&&s.nestable))return!1}const l=kt();return l.moveBlock(e.id,e.toParent,e.toIndex),jn(n,l,t),l.setSelection(Ct(e.id,0)),r==null||r(l.build()),!0}}}function Oi(t){return{name:"convertBlock",run:e=>(n,r)=>{const o=Kt(n.doc,e.id);if(!o)return!1;const l={...o.attrs,...e.attrs??{}};let a=t.registries.schema.coerceAttrsFor(e.type,l);const s=t.registries.schema.get(e.type);let c=o.content;if(s.content==="none"&&(c=[]),!s.inlineMarks){c=c.map(b=>({type:"text",text:b.text}));const p={...a};"color"in p&&(p.color="default"),"bgColor"in p&&(p.bgColor="default"),a=p}const u=n.selection.kind==="caret"&&n.selection.blockId===e.id?n.selection.offset:0,d=kt();d.replaceBlock(e.id,e.type,a),c!==o.content&&d.setText(e.id,c),jn(n,d,t);const f=Ue(c).length;return d.setSelection(Ct(e.id,Math.min(u,f))),r==null||r(d.build()),!0}}}function y1(t){return{name:"moveBlockUp",run:e=>(n,r)=>{const o=_r(n.doc,e.id);if(!o)return!1;const l=dn(n.doc,o.id),s=(l===null?n.doc.root:Wn(n.doc,l).children).indexOf(o.id),c=l,u=kt();return u.moveBlock(e.id,c,Math.max(0,s)),jn(n,u,t),u.setSelection(Ct(e.id,0)),r==null||r(u.build()),!0}}}function w1(t){return{name:"moveBlockDown",run:e=>(n,r)=>{const o=No(n.doc,e.id);if(!o)return!1;const l=dn(n.doc,e.id),a=l===null?n.doc.root:Wn(n.doc,l).children,s=a.indexOf(o.id),c=l,u=kt(),d=a.indexOf(e.id),f=s>d?s:s+1;return u.moveBlock(e.id,c,Math.max(0,Math.min(a.length,f))),jn(n,u,t),u.setSelection(Ct(e.id,0)),r==null||r(u.build()),!0}}}function x1(t){return{name:"duplicateBlock",run:e=>(n,r)=>{if(!Kt(n.doc,e.id))return!1;const l=[],a=[];for(a.push({id:e.id,parentOldId:dn(n.doc,e.id)});a.length>0;){const{id:f,parentOldId:p}=a.pop(),b=Kt(n.doc,f);if(!b)continue;l.push({oldId:f,parentOldId:p});const g=b.children;for(let k=g.length-1;k>=0;k--)a.push({id:g[k],parentOldId:f})}if(l.length===0)return!1;const s=new Map,c=new Map,u=kt();for(const f of l){const p=Wn(n.doc,f.oldId);let b,g;if(f.oldId===e.id){b=f.parentOldId;const M=b===null?n.doc.root:Wn(n.doc,b).children,O=M.indexOf(e.id);g=O>=0?O+1:M.length}else{const M=f.parentOldId,O=s.get(M)??null;if(O===null)return!1;b=O,g=c.get(O)??0,c.set(O,g+1)}const k=t.registries.schema.coerceAttrsFor(p.type,p.attrs),E=u.insertBlock({parent:b,index:g,type:p.type,attrs:k,content:p.content});s.set(f.oldId,E)}jn(n,u,t);const d=s.get(e.id)??null;return d&&u.setSelection(Ct(d,0)),r==null||r(u.build()),!0}}}function E1(t){return{name:"setBlockAlign",run:e=>(n,r)=>{const o=Kt(n.doc,e.id);if(!o||!("align"in t.registries.schema.get(o.type).attrs))return!1;const a=kt();return a.setAttrs(e.id,{...o.attrs,align:e.align}),r==null||r(a.build()),!0}}}function C1(t){return{name:"setBlockColor",run:e=>(n,r)=>{const o=Kt(n.doc,e.id);if(!o||!t.registries.schema.hasInlineMarks(o.type))return!1;const l=kt();return l.setAttrs(e.id,{...o.attrs,color:e.color}),r==null||r(l.build()),!0}}}function S1(t){return{name:"setBlockBgColor",run:e=>(n,r)=>{const o=Kt(n.doc,e.id);if(!o||!t.registries.schema.hasInlineMarks(o.type))return!1;const l=kt();return l.setAttrs(e.id,{...o.attrs,bgColor:e.bgColor}),r==null||r(l.build()),!0}}}function T1(){return{name:"setStartNumber",run:t=>(e,n)=>{const r=Kt(e.doc,t.id);if(!r||r.type!=="orderedList")return!1;const o=r.attrs,l=t.startNumber;let a;if(l==null){const{startNumber:c,...u}=o;a=u}else{const c=Math.max(1,Math.floor(l));a={...o,startNumber:c}}const s=kt();return s.setAttrs(t.id,a),n==null||n(s.build()),!0}}}function M1(t){return{name:"indentBlock",run:e=>(n,r)=>{const o=(e==null?void 0:e.id)??(n.selection.kind==="caret"?n.selection.blockId:n.selection.kind==="text"?n.selection.focus.blockId:n.selection.kind==="blocks"&&n.selection.blockIds[0]?n.selection.blockIds[0]:void 0);if(!o||!Kt(n.doc,o))return!1;const a=Bl(n.doc,o);if(!a||!t.registries.schema.get(a.type).nestable||Ir(n.doc,a.id)>=Ll)return!1;const c=a.id,u=a.children.length,d=kt();return d.moveBlock(o,c,u),jn(n,d,t),d.setSelection(Ct(o,0)),r==null||r(d.build()),!0}}}function Ys(t){return{name:"outdentBlock",run:e=>(n,r)=>{const o=(e==null?void 0:e.id)??(n.selection.kind==="caret"?n.selection.blockId:n.selection.kind==="text"?n.selection.focus.blockId:n.selection.kind==="blocks"&&n.selection.blockIds[0]?n.selection.blockIds[0]:void 0);if(!o||!Kt(n.doc,o))return!1;const a=dn(n.doc,o);if(a===null)return!1;const s=dn(n.doc,a),c=Ao(n.doc,a),u=c.indexOf(a),d=u===-1?c.length:u+1,f=kt();return f.moveBlock(o,s,d),jn(n,f,t),f.setSelection(Ct(o,0)),r==null||r(f.build()),!0}}}function A1(t,e){if(t.type!==e.type)return!1;const n=t.attrs?Object.keys(t.attrs):[],r=e.attrs?Object.keys(e.attrs):[];return n.length!==r.length?!1:n.every(o=>t.attrs[o]===e.attrs[o])}function Xs(t,e){return t.length!==e.length?!1:t.every(n=>e.some(r=>A1(n,r)))}function N1(t){return{name:"toggleMark",run:e=>(n,r)=>{const o=Kt(n.doc,e.id);if(!o||!t.registries.schema.hasInlineMarks(o.type)||t.registries.schema.isMarkDisallowed(o.type,e.markType))return!1;const l=Ue(o.content),a=Math.max(0,Math.min(e.from,l.length)),s=Math.max(a,Math.min(e.to,l.length));if(a>=s)return!1;const c=[];let u=0;for(const k of o.content){if(k.type!=="text")continue;const E=(k.marks??[]).map(te=>({...te})),M=u,O=u+k.text.length,P=[M,O];a>M&&a<O&&P.push(a),s>M&&s<O&&P.push(s),P.sort((te,z)=>te-z);for(let te=0;te<P.length-1;te++){const z=P[te],H=P[te+1];z>=H||c.push({text:k.text.slice(z-M,H-M),marks:E.map(ie=>({...ie}))})}u=O}let d=!0;u=0;for(const k of c){const E=u,M=u+k.text.length;if(M>a&&E<s&&!k.marks.some(O=>O.type===e.markType)){d=!1;break}u=M}const f=["bold","italic","underline","strikethrough","color","bgColor","link"];u=0;for(const k of c){const E=u,M=u+k.text.length;M>a&&E<s&&(d?k.marks=k.marks.filter(O=>O.type!==e.markType):e.markType==="code"?(k.marks=k.marks.filter(O=>!f.includes(O.type)),k.marks.some(O=>O.type==="code")||k.marks.push({type:"code"})):f.includes(e.markType)?!k.marks.some(O=>O.type==="code")&&!k.marks.some(O=>O.type===e.markType)&&k.marks.push({type:e.markType}):k.marks.some(O=>O.type===e.markType)||k.marks.push({type:e.markType})),u=M}const p=[];for(const k of c){if(k.text.length===0)continue;const E=p[p.length-1];E&&Xs(E.marks,k.marks)?E.text+=k.text:p.push({text:k.text,marks:[...k.marks]})}const b=p.map(k=>({type:"text",text:k.text,marks:k.marks.length>0?k.marks:void 0})),g=kt();return g.setText(e.id,b),g.setMeta({addToHistory:!0}),g.setSelection(n.selection),r==null||r(g.build()),!0}}}function Zs(t){return{name:"setInlineMark",run:e=>(n,r)=>{const o=Kt(n.doc,e.id);if(!o||!t.registries.schema.hasInlineMarks(o.type))return!1;const l=Ue(o.content),a=Math.max(0,Math.min(e.from,l.length)),s=Math.max(a,Math.min(e.to,l.length));if(a>=s)return!1;const c=[];let u=0;for(const b of o.content){if(b.type!=="text")continue;const g=(b.marks??[]).map(O=>({...O})),k=u,E=u+b.text.length,M=[k,E];a>k&&a<E&&M.push(a),s>k&&s<E&&M.push(s),M.sort((O,P)=>O-P);for(let O=0;O<M.length-1;O++){const P=M[O],te=M[O+1];P>=te||c.push({text:b.text.slice(P-k,te-k),marks:[...g]})}u=E}u=0;for(const b of c){const g=u,k=u+b.text.length;if(k>a&&g<s){const E=b.marks.some(M=>M.type==="code");if(e.attrs!==null&&E){u=k;continue}e.attrs===null?b.marks=b.marks.filter(M=>M.type!==e.markType):(b.marks=b.marks.filter(M=>M.type!==e.markType),b.marks.push({type:e.markType,attrs:e.attrs}))}u=k}const d=[];for(const b of c){if(b.text.length===0)continue;const g=d[d.length-1];g&&Xs(g.marks,b.marks)?g.text+=b.text:d.push({text:b.text,marks:[...b.marks]})}const f=d.map(b=>({type:"text",text:b.text,marks:b.marks.length>0?b.marks:void 0})),p=kt();return p.setText(e.id,f),p.setMeta({addToHistory:!0}),p.setSelection(n.selection),r==null||r(p.build()),!0}}}function B1(t){return{name:"setLink",run:e=>(n,r)=>{const o=Kt(n.doc,e.id);if(!o||!t.registries.schema.hasInlineMarks(o.type))return!1;const l=Ue(o.content),a=Math.max(0,Math.min(e.from,l.length)),s=Math.max(a,Math.min(e.to,l.length));if(a>=s&&!e.text)return!1;const[c,u]=En(o.content,a),[,d]=En(u,s-a),p={type:"text",text:e.text??l.slice(a,s),marks:[{type:"link",attrs:{href:e.href}}]},b=[...c,p,...d],g=kt();return g.setText(e.id,b),g.setMeta({addToHistory:!0}),r&&r(g.build()),!0}}}function I1(t){return{name:"unsetLink",run:e=>(n,r)=>{var f;const o=Kt(n.doc,e.id);if(!o||!t.registries.schema.hasInlineMarks(o.type))return!1;const l=Ue(o.content),a=Math.max(0,Math.min(e.from,l.length)),s=Math.max(a,Math.min(e.to,l.length));if(a>=s)return!1;let c=!1,u=0;for(const p of o.content){if(p.type!=="text")continue;const b=u+p.text.length;if(b>a&&u<s&&((f=p.marks)!=null&&f.some(g=>g.type==="link"))){c=!0;break}u=b}return c?Zs(t).run({id:e.id,markType:"link",attrs:null,from:a,to:s})(n,r):!1}}}function js(t){const e={registries:t};return[Li(e),Ol(e),s1(e),c1(),u1(),Dl(e),Ks(e),d1(e),f1(e),h1(),m1(),p1(),b1(),v1(),g1(),k1(e),Oi(e),y1(e),w1(e),x1(e),E1(e),C1(e),S1(e),T1(),M1(e),Ys(e),N1(e),Zs(e),B1(e),I1(e)]}const _1=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform)?"Cmd":"Ctrl",R1={Esc:"Escape",Del:"Delete",Space:" ",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown"};function Qs(t){const e=[];t.ctrlKey&&e.push("Ctrl"),t.metaKey&&e.push("Cmd"),t.altKey&&e.push("Alt"),t.shiftKey&&e.push("Shift");let n=t.key;return n==="Meta"||n==="Control"?"":(n.length===1&&(n=n.toUpperCase()),n=R1[n]??n,e.push(n),e.join("-"))}function Js(t,e){return t.replace(/\bMod\b/g,_1).toLowerCase()===e.toLowerCase()}class e0{constructor(){Pt(this,"bindings",[])}register(e){for(const n of e)this.bindings.push(n);this.bindings.sort((n,r)=>(n.priority??0)-(r.priority??0))}resolve(e){return this.bindings.find(n=>Js(n.key,e))}}class t0{constructor(){Pt(this,"rules",[])}register(e){this.rules.push(e)}get all(){return this.rules}}class n0{constructor(){Pt(this,"commands",new Map)}register(e){if(this.commands.has(e.id))throw new Error(`BlockEditor: duplicate slash command "${e.id}"`);this.commands.set(e.id,e)}get all(){return[...this.commands.values()]}search(e){const n=e.trim().toLowerCase();return n?this.all.filter(r=>(r.title+" "+(r.keywords??[]).join(" ")).toLowerCase().includes(n)):this.all}}class r0{constructor(){Pt(this,"toMarkdown",new Map);Pt(this,"toHTML",new Map)}register(e,n){n.toMarkdown&&this.toMarkdown.set(e,n.toMarkdown),n.toHTML&&this.toHTML.set(e,n.toHTML)}markdownFor(e){var n;return(n=this.toMarkdown.get(e.type))==null?void 0:n(e)}htmlFor(e){var n;return(n=this.toHTML.get(e.type))==null?void 0:n(e)}}class o0{constructor(){Pt(this,"fromMarkdown",[])}register(e){e.fromMarkdown&&this.fromMarkdown.push(e.fromMarkdown)}parseMarkdownLine(e){for(const n of this.fromMarkdown){const r=n(e);if(r)return r}return null}}function L1(t){var e;return((e=t.schema)==null?void 0:e.type)??null}class O1{constructor(){Pt(this,"map",new Map)}register(e,n){if(this.map.has(e))throw new Error(`BlockEditor: duplicate renderer for "${e}"`);this.map.set(e,n)}get(e){return this.map.get(e)}}class D1{constructor(){Pt(this,"map",new Map)}register(e,n){const r=this.map.get(e)??[];this.map.set(e,[...r,...n])}get(e){return this.map.get(e)??[]}}const z1=Ml({type:"__fallback__",content:"text",nestable:!1});function i0(t){const e=new Map,n=r=>{if(r.uses)for(const o of r.uses)n(o);e.set(r.name,r)};for(const r of t)n(r);return[...e.values()]}function l0(t,e={}){const n=i0(t),r=new Map,o=new O1,l=new Ws,a=new e0,s=new t0,c=new n0,u=new D1,d=new r0,f=new o0,p=[],b=[];for(const E of n){let M;if(E.schema){M=E.schema;const O=Ml(M);r.set(O.type,O)}if(E.renderer&&M&&o.register(M.type,E.renderer),E.commands)for(const O of E.commands)b.push(O);if(E.keymap&&a.register(E.keymap),E.inputRules)for(const O of E.inputRules)s.register(O);if(E.slashCommands)for(const O of E.slashCommands)c.register(O);if(E.toolbar&&M&&u.register(M.type,E.toolbar),E.serialize&&M&&d.register(M.type,E.serialize),E.deserialize&&f.register(E.deserialize),E.plugins)for(const O of E.plugins)p.push(O)}const g=e.defaultBlockType??"paragraph";return{schema:new zs(r,z1),renderers:o,commands:l,keymap:a,inputRules:s,slash:c,toolbar:u,serializers:d,deserializers:f,plugins:p,extensionCommands:b,defaultBlockType:g}}class a0{constructor(e=500){Pt(this,"undoStack",[]);Pt(this,"redoStack",[]);Pt(this,"limit");Pt(this,"manualGroupStack",[]);Pt(this,"groupCounter",0);this.limit=e}beginGroup(){const e=`g-${++this.groupCounter}`;return this.manualGroupStack.push(e),e}endGroup(){this.manualGroupStack.pop();const e=this.undoStack[this.undoStack.length-1];e&&e.open&&(e.open=!1)}get currentGroup(){const e=this.manualGroupStack;return e.length>0?e[e.length-1]:null}record(e,n,r){if(e.meta.addToHistory===!1||e.steps.length===0)return;const o={original:e.steps,inverse:qs(e.steps,r),selectionBefore:n},l=this.currentGroup??e.meta.historyGroup??null,a=this.undoStack[this.undoStack.length-1];if(l!==null&&a&&a.open&&a.group===l)a.trs.push(o),a.selectionAfter=e.selectionAfter??n;else{const s={trs:[o],selectionAfter:e.selectionAfter??n,group:l,open:l!==null};this.undoStack.push(s),this.undoStack.length>this.limit&&this.undoStack.shift()}this.redoStack.length=0}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}reset(){this.undoStack.length=0,this.redoStack.length=0}undo(){const e=this.undoStack.pop();if(!e)return null;const n=[];for(let o=e.trs.length-1;o>=0;o--)n.push(...e.trs[o].inverse);const r=e.trs[0].selectionBefore;return this.redoStack.push({...e,open:!1}),kt().setMeta({addToHistory:!1,source:"undo"}).setSelection(r).appendSteps(n).build()}redo(){const e=this.redoStack.pop();if(!e)return null;const n=[];for(const o of e.trs)n.push(...o.original);const r=e.selectionAfter;return this.undoStack.push({...e,open:!1}),kt().setMeta({addToHistory:!1,source:"redo"}).setSelection(r).appendSteps(n).build()}}class s0{constructor(e){Pt(this,"registries");Pt(this,"state");Pt(this,"listeners",new Set);Pt(this,"_history");Pt(this,"commands");Pt(this,"editable");Pt(this,"focusBlockId",null);Pt(this,"history");this.registries=l0(e.extensions,{defaultBlockType:e.defaultBlockType});for(const d of js(this.registries))this.registries.commands.register(d);for(const d of this.registries.extensionCommands)this.registries.commands.has(d.name)?this.registries.commands.override(d):this.registries.commands.register(d);const{doc:n}=Al(e.initialDocument??{blocks:[]}),r=n.root.length===0?this.seedEmptyDocument(n.id):n,o={},l=r.root[0]??null,a=e.initialSelection??(l?Ct(l,0):{kind:"blocks",blockIds:[]}),s=Il(r,a,o);for(const d of this.registries.plugins)d.init&&(o[d.name]=d.init(s));this.state=s,this._history=new a0(e.historyLimit);const c=this._history;this.history={canUndo:()=>c.canUndo(),canRedo:()=>c.canRedo(),beginGroup:()=>c.beginGroup(),endGroup:()=>c.endGroup()},this.editable=e.editable??!0,this.registries.commands.register({name:"undo",run:()=>(d,f)=>{if(!f)return this._history.canUndo();const p=this._history.undo();return p?(f(p),!0):!1}}),this.registries.commands.register({name:"redo",run:()=>(d,f)=>{if(!f)return this._history.canRedo();const p=this._history.redo();return p?(f(p),!0):!1}});const u=(d,f)=>{const p=this.registries.commands.get(d);return p?p.run(f)(this.state,b=>this.dispatch(b)):!1};this.commands=this.registries.commands.createProxy(u)}getState(){return this.state}toData(){return Ps(this.state.doc)}toMarkdown(){return G1(this.state.doc)}setDocFromMarkdown(e){this.adoptDoc(j1(e))}setDocument(e){this.adoptDoc(Al(e).doc)}adoptDoc(e){const n=e.root.length===0?this.seedEmptyDocument(e.id):e,r=n.root[0]??null,o=r?Ct(r,0):{kind:"blocks",blockIds:[]},l={},a=Il(n,o,l);for(const s of this.registries.plugins)s.init&&(l[s.name]=s.init(a));this.state=a,this._history.reset(),this.notify({state:a,changed:new Set(yr(n)),removed:new Set})}dispatch(e){const n=this.state,r=Vs(n,e,this.registries.plugins);this.state=r.state,this._history.record(e,n.selection,n.doc),this.notify(r)}undo(){const e=this._history.undo();return e?(this.dispatch(e),!0):!1}redo(){const e=this._history.redo();return e?(this.dispatch(e),!0):!1}canUndo(){return this._history.canUndo()}canRedo(){return this._history.canRedo()}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}notify(e){for(const n of this.listeners)n(e)}eventContext(){return{state:this.state,dispatch:e=>this.dispatch(e),focusBlockId:()=>this.focusBlockId}}handleKeyDown(e){var r;const n=this.eventContext();for(const o of this.registries.plugins)if((r=o.onKeyDown)!=null&&r.call(o,e,n))return!0;return!1}handleInput(e){var r;const n=this.eventContext();for(const o of this.registries.plugins)if((r=o.onInput)!=null&&r.call(o,e,n))return!0;return!1}handleCompositionStart(e){var r;const n=this.eventContext();for(const o of this.registries.plugins)(r=o.onCompositionStart)==null||r.call(o,e,n)}handleCompositionEnd(e){var r;const n=this.eventContext();for(const o of this.registries.plugins)(r=o.onCompositionEnd)==null||r.call(o,e,n)}destroy(){var e;for(const n of this.registries.plugins)(e=n.onDestroy)==null||e.call(n);this.listeners.clear()}seedEmptyDocument(e){const n=Mo(),r=this.registries.defaultBlockType,o={id:n,type:r,attrs:this.registries.schema.defaultAttrsFor(r),content:[],children:[]};return{id:e,root:[n],blocks:new Map([[n,o]]),parent:new Map([[n,null]])}}}const H1=/([\\`*_[\]])/g;function P1(t){return t.replace(H1,"\\$1")}function ni(t,e){var n;return!!((n=t.marks)!=null&&n.some(r=>r.type===e))}function c0(t){var n;let e="";for(const r of t){if(r.type!=="text")continue;const o=r.text;if(o.length===0)continue;const l=r.marks??[];let a=ni(r,"code")?`\`${o}\``:P1(o);ni(r,"bold")&&(a=`**${a}**`),ni(r,"italic")&&(a=`*${a}*`),ni(r,"strikethrough")&&(a=`~~${a}~~`),ni(r,"underline")&&(a=`++${a}++`);const s=l.find(u=>u.type==="link"),c=typeof((n=s==null?void 0:s.attrs)==null?void 0:n.href)=="string"?s.attrs.href:void 0;c&&(a=`[${a}](${c})`),e+=a}return e}function ri(t){const e=[];let n=0,r="";const o=()=>{r.length>0&&(e.push({type:"text",text:r}),r="")};for(;n<t.length;){const l=t[n];if(l==="\\"&&n+1<t.length){r+=t[n+1],n+=2;continue}if(l==="["){const s=t.indexOf("]",n+1);if(s!==-1&&t.charAt(s+1)==="("){const c=t.indexOf(")",s+2);if(c!==-1){const u=t.slice(n+1,s),d=t.slice(s+2,c);if(d.length>0){o(),e.push({type:"link",text:u,href:d}),n=c+1;continue}}}}if(l==="`"){const s=t.indexOf("`",n+1);if(s!==-1){o(),e.push({type:"code",text:t.slice(n+1,s)}),n=s+1;continue}}const a=t.startsWith("***",n)?"***":t.startsWith("___",n)?"___":null;if(a){const s=t.indexOf(a,n+3);if(s!==-1){o(),e.push({type:"italic",text:`**${t.slice(n+3,s)}**`}),n=s+3;continue}}if(t.startsWith("**",n)||t.startsWith("__",n)){const s=t.charAt(n+1),c=t.indexOf(s+s,n+2);if(c!==-1){o(),e.push({type:"bold",text:t.slice(n+2,c)}),n=c+2;continue}}if(t.startsWith("~~",n)){const s=t.indexOf("~~",n+2);if(s!==-1){o(),e.push({type:"strikethrough",text:t.slice(n+2,s)}),n=s+2;continue}}if(t.startsWith("++",n)){const s=t.indexOf("++",n+2);if(s!==-1){o(),e.push({type:"underline",text:t.slice(n+2,s)}),n=s+2;continue}}if((l==="*"||l==="_")&&!(t.charAt(n+1)===l&&n+1<t.length)){const s=t.indexOf(l,n+1);if(s!==-1){o(),e.push({type:"italic",text:t.slice(n+1,s)}),n=s+1;continue}}r+=l,n+=1}return o(),e}function $1(t,e){if(t===void 0&&e===void 0)return!0;if(t===void 0||e===void 0)return!1;const n=Object.keys(t),r=Object.keys(e);return n.length!==r.length?!1:n.every(o=>t[o]===e[o])}function F1(t,e){return t.length!==e.length?!1:t.every((n,r)=>n.type===e[r].type&&$1(n.attrs,e[r].attrs))}function fo(t){const e=[],n=(o,l)=>{if(o.length===0&&l.length===0)return;const a=e[e.length-1];if(a&&F1(a.marks??[],l)){e[e.length-1]={...a,text:a.text+o};return}e.push({type:"text",text:o,marks:l.length>0?[...l]:void 0})},r=(o,l)=>{for(const a of o)a.type==="text"?n(a.text,l):a.type==="link"?n(a.text,[...l,{type:"link",attrs:{href:a.href??""}}]):a.type==="code"?n(a.text,[...l,{type:"code"}]):a.type==="bold"?r(ri(a.text),[...l,{type:"bold"}]):a.type==="italic"?r(ri(a.text),[...l,{type:"italic"}]):a.type==="strikethrough"?r(ri(a.text),[...l,{type:"strikethrough"}]):a.type==="underline"&&r(ri(a.text),[...l,{type:"underline"}])};return r(ri(t),[]),e}function V1(t){return t.content.reduce((e,n)=>n.type==="text"?e+n.text:e,"")}function U1(t){const e=typeof t.rows=="number"?t.rows:0,n=typeof t.cols=="number"?t.cols:0,r=Array.isArray(t.cells)&&t.cells.length>0?t.cells:[],o=t.headerRow===!0;if(e===0||n===0)return[];const l=(d,f)=>{const p=r[d],b=p==null?void 0:p[f];return!b||b.covered?"":q1(c0(b.content??[]))},a=Array.from({length:n},(d,f)=>l(0,f)),s=Array.from({length:n},()=>"---"),c=[],u=o?1:0;for(let d=u;d<e;d++)c.push(`| ${Array.from({length:n},(f,p)=>l(d,p)).join(" | ")} |`);return[`| ${a.join(" | ")} |`,`| ${s.join(" | ")} |`,...c]}function q1(t){return t.replace(/\\/g,"\\\\").replace(/\|/g,"\\|").replace(/\r?\n/g,"<br>")}function u0(t){return t==="bulletList"||t==="orderedList"||t==="todoList"}function d0(t,e,n){var u,d,f,p,b;const r=t.blocks.get(e);if(!r)return[];const o=Ir(t,e),l=" ".repeat(o*2),a=g=>c0(g.content);let s=[];switch(r.type){case"heading":{const g=typeof((u=r.attrs)==null?void 0:u.level)=="number"?r.attrs.level:1,k=Math.max(1,Math.min(6,g));s=[`${l}${"#".repeat(k)} ${a(r)}`];break}case"quote":{const g=a(r);g.length>0&&(s=g.split(`
|
|
2
|
-
`).map(
|
|
3
|
-
`).map(
|
|
4
|
-
`);
|
|
5
|
-
`)}function
|
|
1
|
+
(function(oe,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],n):(oe=typeof globalThis<"u"?globalThis:oe||self,n(oe.BlockEditor={},oe.Vue))})(this,function(oe,n){"use strict";var Lb=Object.defineProperty;var Ob=(oe,n,go)=>n in oe?Lb(oe,n,{enumerable:!0,configurable:!0,writable:!0,value:go}):oe[n]=go;var pt=(oe,n,go)=>Ob(oe,typeof n!="symbol"?n+"":n,go);function go(e){return typeof e=="string"&&e.length>0}function uc(e){return e.type==="text"}function Me(e){return e.reduce((t,o)=>o.type==="text"?t+o.text:t,"")}function jn(e){return e.length===0?[]:[{type:"text",text:e}]}function Ut(e,t){const o=Math.max(0,Math.floor(t));if(o<=0)return[[],e];const r=Me(e).length;if(o>=r)return[e,[]];const l=[],s=[];let i=0;for(const a of e){if(a.type!=="text"){i<o?l.push(a):s.push(a);continue}const c=a.text.length;if(i+c<=o){l.push(a),i+=c;continue}if(i>=o){s.push(a);continue}const d=o-i,f=a.text.slice(0,d),u=a.text.slice(d);f.length>0&&l.push(a.marks?{...a,text:f}:{...a,text:f,marks:void 0}),u.length>0&&s.push(a.marks?{...a,text:u}:{...a,text:u,marks:void 0}),i+=c}return[l,s]}const Xl="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-",jl=12;function fc(e){const t=globalThis.crypto;if(!t||typeof t.getRandomValues!="function")throw new Error("BlockEditor: Web Crypto getRandomValues is unavailable in this environment.");const o=new Uint8Array(e);return t.getRandomValues(o),o}function bo(){const e=fc(jl);let t="";for(let o=0;o<jl;o++)t+=Xl[e[o]%Xl.length];return t}function pc(e){return e}const mc={empty:e=>e.content.length===0||e.content.every(t=>t.text==="")};function Or(e){return{type:e.type,attrs:e.attrs??{},content:e.content??"text",nestable:e.nestable??!1,allowedChildren:e.allowedChildren??"*",isolating:e.isolating??!1,listLike:e.listLike??!1,inlineMarks:e.inlineMarks??!0,disallowedMarks:e.disallowedMarks??[],empty:e.empty??mc.empty}}function Qn(e){const t={};for(const[o,r]of Object.entries(e.attrs))t[o]=r.default;return t}function Ql(e,t){const o={};for(const[r,l]of Object.entries(e.attrs)){const s=t[r];s!==void 0&&(!l.validate||l.validate(s))?o[r]=s:o[r]=l.default}return o}function Jl(e,t){return e.nestable?e.allowedChildren==="*"?!0:e.allowedChildren.includes(t):!1}function ei(e){return e.content==="text"}function ti(e){return e.isolating}function ni(e,t){return e.empty(t)}class oi{constructor(t,o){pt(this,"schemas");pt(this,"fallback");this.schemas=t,this.fallback=o}get(t){return this.schemas.get(t)??this.fallback}has(t){return this.schemas.has(t)}defaultAttrsFor(t){return Qn(this.get(t))}coerceAttrsFor(t,o){return Ql(this.get(t),o)}canContain(t,o){return Jl(this.get(t),o)}hasText(t){return ei(this.get(t))}isIsolating(t){return ti(this.get(t))}isListLike(t){return this.get(t).listLike}hasInlineMarks(t){return this.get(t).inlineMarks}isMarkDisallowed(t,o){return this.get(t).disallowedMarks.includes(o)}isEmpty(t){return ni(this.get(t.type),t)}}const ri=new Set(["paragraph","heading","bulletList","orderedList","todoList"]);function Dr(e){const t=new Map,o=new Map,r=new Map,l=new Set,s=m=>{if(m&&!l.has(m)){const p=m;return l.add(p),m&&r.set(m,p),p}let h=bo();for(;l.has(h);)h=bo();return l.add(h),h},i=(m,h)=>{const p=s(m.id);o.set(p,h);const b=[];for(const x of m.children??[])b.push(i(x,p));return t.set(p,{id:p,type:m.type,attrs:m.attrs??{},content:m.content??[],children:b}),p},a=[];for(const m of e.blocks??[])a.push(i(m,null));const c=Array.from(o.values()).every(m=>m===null);let d=!1;for(const m of t.values())if(typeof m.attrs.indent=="number"&&m.attrs.indent>0){d=!0;break}c&&d&&hc(t,o,a);const f=10;for(const[m,h]of t){const p=Math.min(f,$r(o,m));if((typeof h.attrs.indent=="number"?h.attrs.indent:0)===p)continue;const{indent:x,...O}=h.attrs,z=p>0?{...O,indent:p}:O;t.set(m,{...h,attrs:z})}return{doc:{id:e.id??yc(),root:a,blocks:t,parent:o},idMap:r}}function hc(e,t,o){const r=[...o];for(const[a,c]of e)e.set(a,{...c,children:[]});const l=[],s=[],i=(a,c)=>{if(a===null){s.push(c),t.set(c,null);return}const d=e.get(a);if(!d){s.push(c),t.set(c,null);return}const f={...d,children:[...d.children,c]};e.set(a,f),t.set(c,a)};for(const a of r){const c=e.get(a);if(!c)continue;const d=typeof c.attrs.indent=="number"?c.attrs.indent:0,f=ri.has(c.type),u=f?Math.max(0,d):0;for(;l.length>0&&l[l.length-1].indent>=u;)l.pop();let h=l.length>0?l[l.length-1].id:null;for(;h!==null;){const p=e.get(h);if(!p||!ri.has(p.type))h=t.get(h)??null;else break}i(h,a),f&&l.push({indent:u,id:a})}o.length=0;for(const a of s)o.push(a)}function li(e){const t=r=>r.map(l=>l.type==="text"?{type:"text",text:l.text,marks:l.marks&&l.marks.length>0?l.marks.map(s=>({type:s.type,attrs:s.attrs?{...s.attrs}:void 0})):void 0}:{...l}),o=r=>{const l=e.blocks.get(r);if(!l)throw new Error(`BlockEditor: missing block ${r} during serialization`);const s=l.children.map(o);return{id:r,type:l.type,attrs:l.attrs?{...l.attrs}:void 0,content:t(l.content),...s.length?{children:s}:{}}};return{id:e.id,blocks:e.root.map(o)}}function Mt(e,t){return e.blocks.get(t)}function an(e,t){const o=e.blocks.get(t);if(!o)throw new Error(`BlockEditor: unknown block ${t}`);return o}function Rt(e,t){return e.parent.get(t)??null}function Pn(e,t){return $r(e.parent,t)}function $r(e,t){let o=0,r=e.get(t);const l=new Set;for(;r!=null&&!l.has(r);)l.add(r),o++,r=e.get(r);return o}function ko(e,t){const o=e.parent.get(t);if(o==null)return e.root;const r=e.blocks.get(o);return r?r.children:e.root}function cn(e,t){return ko(e,t).indexOf(t)}function Pr(e,t){const o=cn(e,t);if(o<=0)return;const r=ko(e,t);return e.blocks.get(r[o-1])}function gc(e,t){const o=ko(e,t),r=o.indexOf(t);if(!(r<0||r>=o.length-1))return e.blocks.get(o[r+1])}function Bn(e){const t=[],o=r=>{for(const l of r){t.push(l);const s=e.blocks.get(l);s&&o(s.children)}};return o(e.root),t}function Hn(e,t){const o=Bn(e),r=o.indexOf(t);if(!(r<=0))return e.blocks.get(o[r-1])}function yo(e,t){const o=Bn(e),r=o.indexOf(t);if(!(r<0||r>=o.length-1))return e.blocks.get(o[r+1])}function ii(e,t){const o=an(e,t);if(o.children.length===0)return o;const r=o.children[o.children.length-1];return ii(e,r)}function si(e,t){const r=[];for(const[l,s]of e.blocks){const i=Math.min(10,$r(e.parent,l)),a=t?t.get(s.type).attrs:void 0,c=a?"indent"in a:!0,d=c?i:0;if((typeof s.attrs.indent=="number"?s.attrs.indent:0)===d)continue;const{indent:u,...m}=s.attrs,h=d>0&&c?{...m,indent:d}:m;r.push({id:l,attrs:h})}return r}function bc(e,t){return{...e,content:t}}function kc(e,t){return{...e,attrs:t}}function yc(){return"doc_"+Math.random().toString(36).slice(2,10)}function wc(e){return{id:e.id,root:e.root,blocks:e.blocks,parent:e.parent}}function rr(e,t,o){e.blocks.set(t,o),e.changed.add(t)}function Do(e,t,o){if(t===null)e.root=o;else{const r=e.blocks.get(t);if(!r)throw new Error(`BlockEditor: unknown parent ${t}`);rr(e,t,{...r,children:o})}}function $o(e,t){if(t===null)return e.root;const o=e.blocks.get(t);if(!o)throw new Error(`BlockEditor: unknown parent ${t}`);return o.children}function Ec(e,t){if(!e.blocks.get(t))throw new Error(`BlockEditor: cannot remove unknown block ${t}`);const r=e.parent.get(t)??null,l=$o(e,r).filter(i=>i!==t);Do(e,r,l);const s=[t];for(;s.length;){const i=s.pop(),a=e.blocks.get(i);if(a)for(const c of a.children)s.push(c);e.blocks.delete(i),e.parent.delete(i),e.removed.add(i),e.changed.delete(i)}}function lr(e,t){const o={id:e.id,root:[...e.root],blocks:new Map(e.blocks),parent:new Map(e.parent),changed:new Set,removed:new Set};for(const r of t)switch(r.op){case"insertBlock":{if(o.blocks.has(r.id))throw new Error(`BlockEditor: insertBlock id collision ${r.id}`);const l={id:r.id,type:r.type,attrs:r.attrs,content:r.content,children:[]};o.blocks.set(r.id,l),o.parent.set(r.id,r.parent),o.changed.add(r.id);const s=[...$o(o,r.parent)],i=Math.max(0,Math.min(r.index,s.length));s.splice(i,0,r.id),Do(o,r.parent,s);break}case"removeBlock":{Ec(o,r.id);break}case"replaceBlock":{const l=o.blocks.get(r.id);if(!l)throw new Error(`BlockEditor: replaceBlock unknown ${r.id}`);rr(o,r.id,{...l,type:r.type,attrs:r.attrs});break}case"moveBlock":{if(!o.blocks.get(r.id))throw new Error(`BlockEditor: moveBlock unknown ${r.id}`);const s=o.parent.get(r.id)??null;if(s===r.toParent){const i=$o(o,s).filter(c=>c!==r.id),a=Math.max(0,Math.min(r.toIndex,i.length));i.splice(a,0,r.id),Do(o,s,i)}else{const i=$o(o,s).filter(d=>d!==r.id);Do(o,s,i);const a=[...$o(o,r.toParent)],c=Math.max(0,Math.min(r.toIndex,a.length));a.splice(c,0,r.id),Do(o,r.toParent,a),o.parent.set(r.id,r.toParent)}break}case"setText":{const l=o.blocks.get(r.id);if(!l)throw new Error(`BlockEditor: setText unknown ${r.id}`);rr(o,r.id,{...l,content:r.content});break}case"setAttrs":{const l=o.blocks.get(r.id);if(!l)throw new Error(`BlockEditor: setAttrs unknown ${r.id}`);rr(o,r.id,{...l,attrs:r.attrs});break}}return{doc:wc(o),changed:o.changed,removed:o.removed}}function ai(e,t,o,r){const{doc:l,changed:s,removed:i}=lr(e.doc,t.steps),a=t.selectionAfter??e.selection,c={...e.pluginState};for(const d of o)d.applyTransaction&&(c[d.name]=d.applyTransaction(t,e,l,a,r));return{doc:l,state:{doc:l,selection:a,pluginState:c,version:e.version+1},changed:s,removed:i}}function Hr(e,t,o={}){return{doc:e,selection:t,pluginState:o,version:0}}class ci{constructor(){pt(this,"steps",[]);pt(this,"selectionAfter");pt(this,"meta",{})}insertBlock(t){const o=t.id??bo();return this.steps.push({op:"insertBlock",parent:t.parent,index:t.index,id:o,type:t.type,attrs:t.attrs??{},content:t.content??[]}),o}removeBlock(t){return this.steps.push({op:"removeBlock",id:t}),this}replaceBlock(t,o,r){return this.steps.push({op:"replaceBlock",id:t,type:o,attrs:r}),this}moveBlock(t,o,r){return this.steps.push({op:"moveBlock",id:t,toParent:o,toIndex:r}),this}setText(t,o){return this.steps.push({op:"setText",id:t,content:o}),this}setAttrs(t,o){return this.steps.push({op:"setAttrs",id:t,attrs:o}),this}peek(){return this.steps}appendSteps(t){for(const o of t)this.steps.push(o);return this}setSelection(t){return this.selectionAfter=t,this}setMeta(t){return this.meta={...this.meta,...t},this}addToHistory(t){return this.meta={...this.meta,addToHistory:t},this}historyGroup(t){return this.meta={...this.meta,historyGroup:t},this}skipDomWrite(t){return this.meta={...this.meta,viewHints:{...this.meta.viewHints,skipDomWrite:t}},this}build(){return{steps:this.steps,selectionAfter:this.selectionAfter,meta:this.meta}}}function Ye(){return new ci}function di(e,t){const o=[];for(let r=e.length-1;r>=0;r--){const l=e[r];switch(l.op){case"insertBlock":o.push({op:"removeBlock",id:l.id});break;case"removeBlock":o.push(...vc(l.id,t));break;case"replaceBlock":{const s=t.blocks.get(l.id);if(!s)break;o.push({op:"replaceBlock",id:l.id,type:s.type,attrs:s.attrs});break}case"moveBlock":{o.push({op:"moveBlock",id:l.id,toParent:Rt(t,l.id),toIndex:cn(t,l.id)});break}case"setText":{const s=t.blocks.get(l.id);if(!s)break;o.push({op:"setText",id:l.id,content:s.content});break}case"setAttrs":{const s=t.blocks.get(l.id);if(!s)break;o.push({op:"setAttrs",id:l.id,attrs:s.attrs});break}}}return o}function vc(e,t){const o=[],r=l=>{const s=an(t,l);o.push({op:"insertBlock",parent:Rt(t,l),index:cn(t,l),id:l,type:s.type,attrs:s.attrs,content:s.content});for(const i of s.children)r(i)};return r(e),o}function Qe(e,t){return{kind:"caret",blockId:e,offset:t}}function Vr(e,t){return{kind:"text",anchor:e,focus:t}}function Cc(e){return{kind:"blocks",blockIds:[...e]}}function wo(e){return e.kind==="caret"}function Jn(e){return e.kind==="text"}function Po(e){return e.kind==="blocks"}function Ur(e){return wo(e)?!0:Jn(e)?e.anchor.blockId===e.focus.blockId&&e.anchor.offset===e.focus.offset:e.blockIds.length===0}function ui(e){return wo(e)?e.blockId:Jn(e)?e.focus.blockId:e.blockIds[0]??null}function Tc(e){return wo(e)?e.offset:Jn(e)?e.focus.offset:0}function xc(e,t){return Jn(e)?t(e.anchor,e.focus)<=0?[e.anchor,e.focus]:[e.focus,e.anchor]:null}class fi{constructor(){pt(this,"entries",new Map)}register(t){if(this.entries.has(t.name))throw new Error(`BlockEditor: duplicate command "${t.name}"`);this.entries.set(t.name,t)}override(t){this.entries.set(t.name,t)}has(t){return this.entries.has(t)}get(t){return this.entries.get(t)}createProxy(t){const o=this.entries;return new Proxy({},{get:(r,l)=>o.has(l)?s=>t(l,s):()=>!1})}}function ir(e){if(Po(e))return null;const t=ui(e);if(!t)return null;const o=wo(e)?e.offset:e.focus.offset;return{blockId:t,offset:o}}const zr=10;function hn(e,t,o){const r=t.peek();if(r.length===0)return;const l=lr(e.doc,r),s=si(l.doc,o.registries.schema);for(const i of s)t.setAttrs(i.id,i.attrs)}function sr(e){return{name:"insertBlock",run:t=>(o,r)=>{const l=t.type,s=t.attrs??e.registries.schema.defaultAttrsFor(l),i=t.content??[];let a,c;if(t.after){if(!Mt(o.doc,t.after))return!1;a=Rt(o.doc,t.after),c=cn(o.doc,t.after)+1}else if(t.parent!==void 0){a=t.parent;const u=a===null?o.doc.root:an(o.doc,a).children;c=t.index??u.length}else a=null,c=o.doc.root.length;if(a!==null){const u=Mt(o.doc,a);if(!u)return!1;const m=e.registries.schema.get(u.type);if(!(m!=null&&m.nestable))return!1}const d=Ye(),f=d.insertBlock({parent:a,index:c,type:l,attrs:s,content:i});return d.setSelection(Qe(f,0)),r==null||r(d.build()),!0}}}function Fr(e){return{name:"removeBlock",run:t=>(o,r)=>{if(!Mt(o.doc,t.id))return!1;const l=Hn(o.doc,t.id),s=yo(o.doc,t.id),i=l??s,a=Ye(),d=an(o.doc,t.id).children??[];if(d.length>0){const f=Rt(o.doc,t.id),u=cn(o.doc,t.id);if((()=>{if(!l)return!1;const h=e.registries.schema.get(l.type);return!(!(h!=null&&h.nestable)||Pn(o.doc,l.id)>=zr)})()&&l){let p=(l.children??[]).length;for(const b of d)a.moveBlock(b,l.id,p),p++}else{let h=u;for(const p of d)a.moveBlock(p,f,h),h++}}if(a.removeBlock(t.id),hn(o,a,e),i){const f=Me(i.content);a.setSelection(Qe(i.id,f.length))}return r==null||r(a.build()),!0}}}function _c(e){return{name:"replaceBlock",run:t=>(o,r)=>{if(!Mt(o.doc,t.id))return!1;const s=t.attrs??e.registries.schema.defaultAttrsFor(t.type),i=Ye();return i.replaceBlock(t.id,t.type,s),hn(o,i,e),i.setSelection(Qe(t.id,0)),r==null||r(i.build()),!0}}}function Mc(){return{name:"setText",run:e=>(t,o)=>{if(!Mt(t.doc,e.id))return!1;const r=Ye();return r.setText(e.id,e.content),e.selectionAfter&&r.setSelection(e.selectionAfter),r.historyGroup("type"),r.skipDomWrite([e.id]),r.setMeta({source:"input",addToHistory:!0}),o==null||o(r.build()),!0}}}function Nc(){return{name:"setAttrs",run:e=>(t,o)=>{if(!Mt(t.doc,e.id))return!1;const l=Ye();return l.setAttrs(e.id,e.attrs),o==null||o(l.build()),!0}}}function Kr(e){return{name:"splitBlock",run:t=>(o,r)=>{const l=Mt(o.doc,t.id);if(!l||!e.registries.schema.hasText(l.type))return!1;const s=Me(l.content).length,i=Math.max(0,Math.min(t.offset,s)),[a,c]=Ut(l.content,i),d=Rt(o.doc,t.id),f=cn(o.doc,t.id),u=l.children??[],m=t.asType??e.registries.defaultBlockType,h=t.asAttrs??e.registries.schema.defaultAttrsFor(m),p=Ye();p.setText(t.id,a);const b=p.insertBlock({parent:d,index:f+1,type:m,attrs:h,content:c});if(u.length>0)for(let x=0;x<u.length;x++)p.moveBlock(u[x],b,x);return hn(o,p,e),p.setSelection(Qe(b,0)),r==null||r(p.build()),!0}}}function pi(e){return{name:"mergeBlock",run:t=>(o,r)=>{const l=Mt(o.doc,t.id);if(!l)return!1;const s=Hn(o.doc,t.id);if(!s||!e.registries.schema.hasText(s.type))return!1;const i=Me(s.content),a=[...s.content,...l.content],c=Ye();c.setText(s.id,a);const d=l.children??[];if(d.length>0){const f=Rt(o.doc,t.id),u=cn(o.doc,t.id),m=e.registries.schema.get(s.type);if(!!(m!=null&&m.nestable)&&Pn(o.doc,s.id)<zr){let b=(s.children??[]).length;for(const x of d)c.moveBlock(x,s.id,b),b++}else{let p=u;for(const b of d)c.moveBlock(b,f,p),p++}}return c.removeBlock(t.id),hn(o,c,e),c.setSelection(Qe(s.id,i.length)),r==null||r(c.build()),!0}}}function Sc(e){return{name:"enter",run:()=>(t,o)=>{const r=t.selection,l=ir(r);if(!l){if(Po(r)&&r.blockIds.length){const d=r.blockIds[r.blockIds.length-1];return sr(e).run({type:e.registries.defaultBlockType,after:d})(t,o)}return!1}const s=an(t.doc,l.blockId),i=e.registries.schema.get(s.type);if(!e.registries.schema.hasText(s.type))return sr(e).run({type:e.registries.defaultBlockType,after:s.id})(t,o);if(i.isolating)return!1;const a=Me(s.content),c=l.offset>=a.length;return i.listLike&&e.registries.schema.isEmpty(s)?ar(e).run({id:s.id,type:e.registries.defaultBlockType})(t,o):c&&e.registries.schema.isEmpty(s)?sr(e).run({type:e.registries.defaultBlockType,after:s.id})(t,o):i.listLike?Kr(e).run({id:s.id,offset:l.offset,asType:s.type})(t,o):Kr(e).run({id:s.id,offset:l.offset})(t,o)}}}function Ac(e){return{name:"backspace",run:()=>(t,o)=>{const r=t.selection;if(Po(r)&&r.blockIds.length){const a=r.blockIds[0],c=Hn(t.doc,a),d=Ye();for(const u of r.blockIds)d.removeBlock(u);const f=c??yo(t.doc,r.blockIds[r.blockIds.length-1]);return hn(t,d,e),f&&d.setSelection(Qe(f.id,Me(f.content).length)),o==null||o(d.build()),!0}const l=ir(r);if(!l)return!1;const s=an(t.doc,l.blockId);if(Jn(r)&&!Ur(r)&&r.anchor.blockId===r.focus.blockId){const[a,c]=r.anchor.offset<=r.focus.offset?[r.anchor.offset,r.focus.offset]:[r.focus.offset,r.anchor.offset],d=Me(s.content),f=jn(d.slice(0,a)+d.slice(c)),u=Ye();return u.setText(s.id,f),u.setSelection(Qe(s.id,a)),u.skipDomWrite([s.id]),o==null||o(u.build()),!0}if(Jn(r)&&!Ur(r)&&r.anchor.blockId!==r.focus.blockId){const a=Bn(t.doc),c=a.indexOf(r.anchor.blockId),d=a.indexOf(r.focus.blockId);if(c===-1||d===-1)return!1;const[f,u]=c<=d?[r.anchor,r.focus]:[r.focus,r.anchor],m=a.indexOf(f.blockId),h=a.indexOf(u.blockId);if(m===-1||h===-1||m>=h)return!1;const p=an(t.doc,f.blockId),b=an(t.doc,u.blockId),x=Me(p.content).length,O=Me(b.content).length,z=Math.min(f.offset,x),F=Math.min(u.offset,O),[j]=Ut(p.content,z),[,P]=Ut(b.content,F),U=[...j,...P],te=Me(j).length,W=Ye();W.setText(f.blockId,U);for(let J=h;J>m;J--)W.removeBlock(a[J]);return W.setSelection(Qe(f.blockId,te)),hn(t,W,e),o==null||o(W.build()),!0}if(l.offset>0)return!1;if(Pn(t.doc,s.id)>0)return mi(e).run({id:s.id})(t,o);if(e.registries.schema.isListLike(s.type))return ar(e).run({id:s.id,type:e.registries.defaultBlockType})(t,o);if(e.registries.schema.isEmpty(s)&&s.type!==e.registries.defaultBlockType)return ar(e).run({id:s.id,type:e.registries.defaultBlockType})(t,o);const i=Hn(t.doc,s.id);return i?e.registries.schema.isIsolating(s.type)||e.registries.schema.isIsolating(i.type)?e.registries.schema.isEmpty(s)?Fr(e).run({id:s.id})(t,o):!1:e.registries.schema.hasText(i.type)?pi(e).run({id:s.id})(t,o):e.registries.schema.isEmpty(s)?Fr(e).run({id:s.id})(t,o):!1:!1}}}function Ic(){return{name:"moveToPreviousBlock",run:()=>(e,t)=>{const o=ir(e.selection);if(!o)return!1;const r=Hn(e.doc,o.blockId);if(!r)return!1;const l=Math.min(o.offset,Me(r.content).length);return t==null||t(Ye().setSelection(Qe(r.id,l)).setMeta({addToHistory:!1}).build()),!0}}}function Bc(){return{name:"moveToNextBlock",run:()=>(e,t)=>{const o=ir(e.selection);if(!o)return!1;const r=yo(e.doc,o.blockId);if(!r)return!1;const l=Math.min(o.offset,Me(r.content).length);return t==null||t(Ye().setSelection(Qe(r.id,l)).setMeta({addToHistory:!1}).build()),!0}}}function Rc(){return{name:"setSelection",run:e=>(t,o)=>(o==null||o(Ye().setSelection(e.selection).setMeta({addToHistory:!1}).build()),!0)}}function Lc(){return{name:"clearSelection",run:()=>(e,t)=>(t==null||t(Ye().setSelection({kind:"blocks",blockIds:[]}).setMeta({addToHistory:!1}).build()),!0)}}function Oc(){return{name:"selectAll",run:()=>(e,t)=>{const o=Bn(e.doc);if(o.length===0)return!1;const r=o[0],l=o[o.length-1],s=an(e.doc,l),i=Me(s.content).length,a={kind:"text",anchor:{blockId:r,offset:0},focus:{blockId:l,offset:i}};return t==null||t(Ye().setSelection(a).setMeta({addToHistory:!1}).build()),!0}}}function Dc(){return{name:"selectBlock",run:e=>(t,o)=>(o==null||o(Ye().setSelection({kind:"blocks",blockIds:[e.id]}).setMeta({addToHistory:!1}).build()),!0)}}function $c(e){return{name:"moveBlock",run:t=>(o,r)=>{if(!Mt(o.doc,t.id)||t.toParent===t.id)return!1;if(t.toParent!==null){let i=t.toParent;for(;i!==null;){if(i===t.id)return!1;i=Rt(o.doc,i)}}if(t.toParent!==null){const i=Mt(o.doc,t.toParent);if(!i)return!1;const a=e.registries.schema.get(i.type);if(!(a!=null&&a.nestable))return!1}const s=Ye();return s.moveBlock(t.id,t.toParent,t.toIndex),hn(o,s,e),s.setSelection(Qe(t.id,0)),r==null||r(s.build()),!0}}}function ar(e){return{name:"convertBlock",run:t=>(o,r)=>{const l=Mt(o.doc,t.id);if(!l)return!1;const s={...l.attrs,...t.attrs??{}};let i=e.registries.schema.coerceAttrsFor(t.type,s);const a=e.registries.schema.get(t.type);let c=l.content;if(a.content==="none"&&(c=[]),!a.inlineMarks){c=c.map(h=>({type:"text",text:h.text}));const m={...i};"color"in m&&(m.color="default"),"bgColor"in m&&(m.bgColor="default"),i=m}const d=o.selection.kind==="caret"&&o.selection.blockId===t.id?o.selection.offset:0,f=Ye();f.replaceBlock(t.id,t.type,i),c!==l.content&&f.setText(t.id,c),hn(o,f,e);const u=Me(c).length;return f.setSelection(Qe(t.id,Math.min(d,u))),r==null||r(f.build()),!0}}}function Pc(e){return{name:"moveBlockUp",run:t=>(o,r)=>{const l=Hn(o.doc,t.id);if(!l)return!1;const s=Rt(o.doc,l.id),a=(s===null?o.doc.root:an(o.doc,s).children).indexOf(l.id),c=s,d=Ye();return d.moveBlock(t.id,c,Math.max(0,a)),hn(o,d,e),d.setSelection(Qe(t.id,0)),r==null||r(d.build()),!0}}}function Hc(e){return{name:"moveBlockDown",run:t=>(o,r)=>{const l=yo(o.doc,t.id);if(!l)return!1;const s=Rt(o.doc,t.id),i=s===null?o.doc.root:an(o.doc,s).children,a=i.indexOf(l.id),c=s,d=Ye(),f=i.indexOf(t.id),u=a>f?a:a+1;return d.moveBlock(t.id,c,Math.max(0,Math.min(i.length,u))),hn(o,d,e),d.setSelection(Qe(t.id,0)),r==null||r(d.build()),!0}}}function Vc(e){return{name:"duplicateBlock",run:t=>(o,r)=>{if(!Mt(o.doc,t.id))return!1;const s=[],i=[];for(i.push({id:t.id,parentOldId:Rt(o.doc,t.id)});i.length>0;){const{id:u,parentOldId:m}=i.pop(),h=Mt(o.doc,u);if(!h)continue;s.push({oldId:u,parentOldId:m});const p=h.children;for(let b=p.length-1;b>=0;b--)i.push({id:p[b],parentOldId:u})}if(s.length===0)return!1;const a=new Map,c=new Map,d=Ye();for(const u of s){const m=an(o.doc,u.oldId);let h,p;if(u.oldId===t.id){h=u.parentOldId;const O=h===null?o.doc.root:an(o.doc,h).children,z=O.indexOf(t.id);p=z>=0?z+1:O.length}else{const O=u.parentOldId,z=a.get(O)??null;if(z===null)return!1;h=z,p=c.get(z)??0,c.set(z,p+1)}const b=e.registries.schema.coerceAttrsFor(m.type,m.attrs),x=d.insertBlock({parent:h,index:p,type:m.type,attrs:b,content:m.content});a.set(u.oldId,x)}hn(o,d,e);const f=a.get(t.id)??null;return f&&d.setSelection(Qe(f,0)),r==null||r(d.build()),!0}}}function Uc(e){return{name:"setBlockAlign",run:t=>(o,r)=>{const l=Mt(o.doc,t.id);if(!l||!("align"in e.registries.schema.get(l.type).attrs))return!1;const i=Ye();return i.setAttrs(t.id,{...l.attrs,align:t.align}),r==null||r(i.build()),!0}}}function zc(e){return{name:"setBlockColor",run:t=>(o,r)=>{const l=Mt(o.doc,t.id);if(!l||!e.registries.schema.hasInlineMarks(l.type))return!1;const s=Ye();return s.setAttrs(t.id,{...l.attrs,color:t.color}),r==null||r(s.build()),!0}}}function Fc(e){return{name:"setBlockBgColor",run:t=>(o,r)=>{const l=Mt(o.doc,t.id);if(!l||!e.registries.schema.hasInlineMarks(l.type))return!1;const s=Ye();return s.setAttrs(t.id,{...l.attrs,bgColor:t.bgColor}),r==null||r(s.build()),!0}}}function Kc(){return{name:"setStartNumber",run:e=>(t,o)=>{const r=Mt(t.doc,e.id);if(!r||r.type!=="orderedList")return!1;const l=r.attrs,s=e.startNumber;let i;if(s==null){const{startNumber:c,...d}=l;i=d}else{const c=Math.max(1,Math.floor(s));i={...l,startNumber:c}}const a=Ye();return a.setAttrs(e.id,i),o==null||o(a.build()),!0}}}function qc(e){return{name:"indentBlock",run:t=>(o,r)=>{const l=(t==null?void 0:t.id)??(o.selection.kind==="caret"?o.selection.blockId:o.selection.kind==="text"?o.selection.focus.blockId:o.selection.kind==="blocks"&&o.selection.blockIds[0]?o.selection.blockIds[0]:void 0);if(!l||!Mt(o.doc,l))return!1;const i=Pr(o.doc,l);if(!i||!e.registries.schema.get(i.type).nestable||Pn(o.doc,i.id)>=zr)return!1;const c=i.id,d=i.children.length,f=Ye();return f.moveBlock(l,c,d),hn(o,f,e),f.setSelection(Qe(l,0)),r==null||r(f.build()),!0}}}function mi(e){return{name:"outdentBlock",run:t=>(o,r)=>{const l=(t==null?void 0:t.id)??(o.selection.kind==="caret"?o.selection.blockId:o.selection.kind==="text"?o.selection.focus.blockId:o.selection.kind==="blocks"&&o.selection.blockIds[0]?o.selection.blockIds[0]:void 0);if(!l||!Mt(o.doc,l))return!1;const i=Rt(o.doc,l);if(i===null)return!1;const a=Rt(o.doc,i),c=ko(o.doc,i),d=c.indexOf(i),f=d===-1?c.length:d+1,u=Ye();return u.moveBlock(l,a,f),hn(o,u,e),u.setSelection(Qe(l,0)),r==null||r(u.build()),!0}}}function Wc(e,t){if(e.type!==t.type)return!1;const o=e.attrs?Object.keys(e.attrs):[],r=t.attrs?Object.keys(t.attrs):[];return o.length!==r.length?!1:o.every(l=>e.attrs[l]===t.attrs[l])}function hi(e,t){return e.length!==t.length?!1:e.every(o=>t.some(r=>Wc(o,r)))}function Gc(e){return{name:"toggleMark",run:t=>(o,r)=>{const l=Mt(o.doc,t.id);if(!l||!e.registries.schema.hasInlineMarks(l.type)||e.registries.schema.isMarkDisallowed(l.type,t.markType))return!1;const s=Me(l.content),i=Math.max(0,Math.min(t.from,s.length)),a=Math.max(i,Math.min(t.to,s.length));if(i>=a)return!1;const c=[];let d=0;for(const b of l.content){if(b.type!=="text")continue;const x=(b.marks??[]).map(j=>({...j})),O=d,z=d+b.text.length,F=[O,z];i>O&&i<z&&F.push(i),a>O&&a<z&&F.push(a),F.sort((j,P)=>j-P);for(let j=0;j<F.length-1;j++){const P=F[j],U=F[j+1];P>=U||c.push({text:b.text.slice(P-O,U-O),marks:x.map(te=>({...te}))})}d=z}let f=!0;d=0;for(const b of c){const x=d,O=d+b.text.length;if(O>i&&x<a&&!b.marks.some(z=>z.type===t.markType)){f=!1;break}d=O}const u=["bold","italic","underline","strikethrough","color","bgColor","link"];d=0;for(const b of c){const x=d,O=d+b.text.length;O>i&&x<a&&(f?b.marks=b.marks.filter(z=>z.type!==t.markType):t.markType==="code"?(b.marks=b.marks.filter(z=>!u.includes(z.type)),b.marks.some(z=>z.type==="code")||b.marks.push({type:"code"})):u.includes(t.markType)?!b.marks.some(z=>z.type==="code")&&!b.marks.some(z=>z.type===t.markType)&&b.marks.push({type:t.markType}):b.marks.some(z=>z.type===t.markType)||b.marks.push({type:t.markType})),d=O}const m=[];for(const b of c){if(b.text.length===0)continue;const x=m[m.length-1];x&&hi(x.marks,b.marks)?x.text+=b.text:m.push({text:b.text,marks:[...b.marks]})}const h=m.map(b=>({type:"text",text:b.text,marks:b.marks.length>0?b.marks:void 0})),p=Ye();return p.setText(t.id,h),p.setMeta({addToHistory:!0}),p.setSelection(o.selection),r==null||r(p.build()),!0}}}function gi(e){return{name:"setInlineMark",run:t=>(o,r)=>{const l=Mt(o.doc,t.id);if(!l||!e.registries.schema.hasInlineMarks(l.type))return!1;const s=Me(l.content),i=Math.max(0,Math.min(t.from,s.length)),a=Math.max(i,Math.min(t.to,s.length));if(i>=a)return!1;const c=[];let d=0;for(const h of l.content){if(h.type!=="text")continue;const p=(h.marks??[]).map(z=>({...z})),b=d,x=d+h.text.length,O=[b,x];i>b&&i<x&&O.push(i),a>b&&a<x&&O.push(a),O.sort((z,F)=>z-F);for(let z=0;z<O.length-1;z++){const F=O[z],j=O[z+1];F>=j||c.push({text:h.text.slice(F-b,j-b),marks:[...p]})}d=x}d=0;for(const h of c){const p=d,b=d+h.text.length;if(b>i&&p<a){const x=h.marks.some(O=>O.type==="code");if(t.attrs!==null&&x){d=b;continue}t.attrs===null?h.marks=h.marks.filter(O=>O.type!==t.markType):(h.marks=h.marks.filter(O=>O.type!==t.markType),h.marks.push({type:t.markType,attrs:t.attrs}))}d=b}const f=[];for(const h of c){if(h.text.length===0)continue;const p=f[f.length-1];p&&hi(p.marks,h.marks)?p.text+=h.text:f.push({text:h.text,marks:[...h.marks]})}const u=f.map(h=>({type:"text",text:h.text,marks:h.marks.length>0?h.marks:void 0})),m=Ye();return m.setText(t.id,u),m.setMeta({addToHistory:!0}),m.setSelection(o.selection),r==null||r(m.build()),!0}}}function Yc(e){return{name:"setLink",run:t=>(o,r)=>{const l=Mt(o.doc,t.id);if(!l||!e.registries.schema.hasInlineMarks(l.type))return!1;const s=Me(l.content),i=Math.max(0,Math.min(t.from,s.length)),a=Math.max(i,Math.min(t.to,s.length));if(i>=a&&!t.text)return!1;const[c,d]=Ut(l.content,i),[,f]=Ut(d,a-i),m={type:"text",text:t.text??s.slice(i,a),marks:[{type:"link",attrs:{href:t.href}}]},h=[...c,m,...f],p=Ye();return p.setText(t.id,h),p.setMeta({addToHistory:!0}),r&&r(p.build()),!0}}}function Zc(e){return{name:"unsetLink",run:t=>(o,r)=>{var u;const l=Mt(o.doc,t.id);if(!l||!e.registries.schema.hasInlineMarks(l.type))return!1;const s=Me(l.content),i=Math.max(0,Math.min(t.from,s.length)),a=Math.max(i,Math.min(t.to,s.length));if(i>=a)return!1;let c=!1,d=0;for(const m of l.content){if(m.type!=="text")continue;const h=d+m.text.length;if(h>i&&d<a&&((u=m.marks)!=null&&u.some(p=>p.type==="link"))){c=!0;break}d=h}return c?gi(e).run({id:t.id,markType:"link",attrs:null,from:i,to:a})(o,r):!1}}}function bi(e){const t={registries:e};return[sr(t),Fr(t),_c(t),Mc(),Nc(),Kr(t),pi(t),Sc(t),Ac(t),Ic(),Bc(),Rc(),Oc(),Dc(),Lc(),$c(t),ar(t),Pc(t),Hc(t),Vc(t),Uc(t),zc(t),Fc(t),Kc(),qc(t),mi(t),Gc(t),gi(t),Yc(t),Zc(t)]}const Xc=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform)?"Cmd":"Ctrl",jc={Esc:"Escape",Del:"Delete",Space:" ",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown"};function ki(e){const t=[];e.ctrlKey&&t.push("Ctrl"),e.metaKey&&t.push("Cmd"),e.altKey&&t.push("Alt"),e.shiftKey&&t.push("Shift");let o=e.key;return o==="Meta"||o==="Control"?"":(o.length===1&&(o=o.toUpperCase()),o=jc[o]??o,t.push(o),t.join("-"))}function yi(e,t){return e.replace(/\bMod\b/g,Xc).toLowerCase()===t.toLowerCase()}class wi{constructor(){pt(this,"bindings",[])}register(t){for(const o of t)this.bindings.push(o);this.bindings.sort((o,r)=>(o.priority??0)-(r.priority??0))}resolve(t){return this.bindings.find(o=>yi(o.key,t))}}class Ei{constructor(){pt(this,"rules",[])}register(t){this.rules.push(t)}get all(){return this.rules}}class vi{constructor(){pt(this,"commands",new Map)}register(t){if(this.commands.has(t.id))throw new Error(`BlockEditor: duplicate slash command "${t.id}"`);this.commands.set(t.id,t)}get all(){return[...this.commands.values()]}search(t){const o=t.trim().toLowerCase();return o?this.all.filter(r=>(r.title+" "+(r.keywords??[]).join(" ")).toLowerCase().includes(o)):this.all}}class Ci{constructor(){pt(this,"toMarkdown",new Map);pt(this,"toHTML",new Map)}register(t,o){o.toMarkdown&&this.toMarkdown.set(t,o.toMarkdown),o.toHTML&&this.toHTML.set(t,o.toHTML)}markdownFor(t){var o;return(o=this.toMarkdown.get(t.type))==null?void 0:o(t)}htmlFor(t){var o;return(o=this.toHTML.get(t.type))==null?void 0:o(t)}}class Ti{constructor(){pt(this,"fromMarkdown",[])}register(t){t.fromMarkdown&&this.fromMarkdown.push(t.fromMarkdown)}parseMarkdownLine(t){for(const o of this.fromMarkdown){const r=o(t);if(r)return r}return null}}function Qc(e){var t;return((t=e.schema)==null?void 0:t.type)??null}class Jc{constructor(){pt(this,"map",new Map)}register(t,o){if(this.map.has(t))throw new Error(`BlockEditor: duplicate renderer for "${t}"`);this.map.set(t,o)}get(t){return this.map.get(t)}}class ed{constructor(){pt(this,"map",new Map)}register(t,o){const r=this.map.get(t)??[];this.map.set(t,[...r,...o])}get(t){return this.map.get(t)??[]}}const td=Or({type:"__fallback__",content:"text",nestable:!1});function xi(e){const t=new Map,o=r=>{if(r.uses)for(const l of r.uses)o(l);t.set(r.name,r)};for(const r of e)o(r);return[...t.values()]}function _i(e,t={}){const o=xi(e),r=new Map,l=new Jc,s=new fi,i=new wi,a=new Ei,c=new vi,d=new ed,f=new Ci,u=new Ti,m=[],h=[];for(const x of o){let O;if(x.schema){O=x.schema;const z=Or(O);r.set(z.type,z)}if(x.renderer&&O&&l.register(O.type,x.renderer),x.commands)for(const z of x.commands)h.push(z);if(x.keymap&&i.register(x.keymap),x.inputRules)for(const z of x.inputRules)a.register(z);if(x.slashCommands)for(const z of x.slashCommands)c.register(z);if(x.toolbar&&O&&d.register(O.type,x.toolbar),x.serialize&&O&&f.register(O.type,x.serialize),x.deserialize&&u.register(x.deserialize),x.plugins)for(const z of x.plugins)m.push(z)}const p=t.defaultBlockType??"paragraph";return{schema:new oi(r,td),renderers:l,commands:s,keymap:i,inputRules:a,slash:c,toolbar:d,serializers:f,deserializers:u,plugins:m,extensionCommands:h,defaultBlockType:p}}class Mi{constructor(t=500){pt(this,"undoStack",[]);pt(this,"redoStack",[]);pt(this,"limit");pt(this,"manualGroupStack",[]);pt(this,"groupCounter",0);this.limit=t}beginGroup(){const t=`g-${++this.groupCounter}`;return this.manualGroupStack.push(t),t}endGroup(){this.manualGroupStack.pop();const t=this.undoStack[this.undoStack.length-1];t&&t.open&&(t.open=!1)}get currentGroup(){const t=this.manualGroupStack;return t.length>0?t[t.length-1]:null}record(t,o,r){if(t.meta.addToHistory===!1||t.steps.length===0)return;const l={original:t.steps,inverse:di(t.steps,r),selectionBefore:o},s=this.currentGroup??t.meta.historyGroup??null,i=this.undoStack[this.undoStack.length-1];if(s!==null&&i&&i.open&&i.group===s)i.trs.push(l),i.selectionAfter=t.selectionAfter??o;else{const a={trs:[l],selectionAfter:t.selectionAfter??o,group:s,open:s!==null};this.undoStack.push(a),this.undoStack.length>this.limit&&this.undoStack.shift()}this.redoStack.length=0}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}reset(){this.undoStack.length=0,this.redoStack.length=0}undo(){const t=this.undoStack.pop();if(!t)return null;const o=[];for(let l=t.trs.length-1;l>=0;l--)o.push(...t.trs[l].inverse);const r=t.trs[0].selectionBefore;return this.redoStack.push({...t,open:!1}),Ye().setMeta({addToHistory:!1,source:"undo"}).setSelection(r).appendSteps(o).build()}redo(){const t=this.redoStack.pop();if(!t)return null;const o=[];for(const l of t.trs)o.push(...l.original);const r=t.selectionAfter;return this.undoStack.push({...t,open:!1}),Ye().setMeta({addToHistory:!1,source:"redo"}).setSelection(r).appendSteps(o).build()}}class Ni{constructor(t){pt(this,"registries");pt(this,"state");pt(this,"listeners",new Set);pt(this,"_history");pt(this,"commands");pt(this,"editable");pt(this,"focusBlockId",null);pt(this,"extensionMethods",new Map);pt(this,"pluginCtx");pt(this,"history");this.pluginCtx={editor:this},this.registries=_i(t.extensions,{defaultBlockType:t.defaultBlockType});for(const f of bi(this.registries))this.registries.commands.register(f);for(const f of this.registries.extensionCommands)this.registries.commands.has(f.name)?this.registries.commands.override(f):this.registries.commands.register(f);const{doc:o}=Dr(t.initialDocument??{blocks:[]}),r=o.root.length===0?this.seedEmptyDocument(o.id):o,l={},s=r.root[0]??null,i=t.initialSelection??(s?Qe(s,0):{kind:"blocks",blockIds:[]}),a=Hr(r,i,l);for(const f of this.registries.plugins)f.init&&(l[f.name]=f.init(a,this.pluginCtx));this.state=a,this._history=new Mi(t.historyLimit);const c=this._history;this.history={canUndo:()=>c.canUndo(),canRedo:()=>c.canRedo(),beginGroup:()=>c.beginGroup(),endGroup:()=>c.endGroup()},this.editable=t.editable??!0,this.registries.commands.register({name:"undo",run:()=>(f,u)=>{if(!u)return this._history.canUndo();const m=this._history.undo();return m?(u(m),!0):!1}}),this.registries.commands.register({name:"redo",run:()=>(f,u)=>{if(!u)return this._history.canRedo();const m=this._history.redo();return m?(u(m),!0):!1}});const d=(f,u)=>{const m=this.registries.commands.get(f);return m?m.run(u)(this.state,h=>this.dispatch(h)):!1};this.commands=this.registries.commands.createProxy(d)}getState(){return this.state}toData(){return li(this.state.doc)}toMarkdown(){return cd(this.state.doc)}setDocFromMarkdown(t){this.adoptDoc(hd(t))}setDocument(t){this.adoptDoc(Dr(t).doc)}adoptDoc(t){var a;const o=t.root.length===0?this.seedEmptyDocument(t.id):t,r=o.root[0]??null,l=r?Qe(r,0):{kind:"blocks",blockIds:[]},s={},i=Hr(o,l,s);for(const c of this.registries.plugins)(a=c.onDestroy)==null||a.call(c);this.extensionMethods.clear();for(const c of this.registries.plugins)c.init&&(s[c.name]=c.init(i,this.pluginCtx));this.state=i,this._history.reset(),this.notify({state:i,changed:new Set(Bn(o)),removed:new Set})}registerExtensionMethod(t,o){if(this.extensionMethods.has(t))throw new Error(`Editor: extension method "${t}" already registered`);return this.extensionMethods.set(t,o),()=>{this.extensionMethods.delete(t)}}getExtensionMethod(t){return this.extensionMethods.get(t)}dispatch(t){const o=this.state,r=ai(o,t,this.registries.plugins,this.pluginCtx);this.state=r.state,this._history.record(t,o.selection,o.doc),this.notify(r)}undo(){const t=this._history.undo();return t?(this.dispatch(t),!0):!1}redo(){const t=this._history.redo();return t?(this.dispatch(t),!0):!1}canUndo(){return this._history.canUndo()}canRedo(){return this._history.canRedo()}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}notify(t){for(const o of this.listeners)o(t)}eventContext(){return{state:this.state,dispatch:t=>this.dispatch(t),focusBlockId:()=>this.focusBlockId,editor:this}}handleKeyDown(t){var r;const o=this.eventContext();for(const l of this.registries.plugins)if((r=l.onKeyDown)!=null&&r.call(l,t,o))return!0;return!1}handleInput(t){var r;const o=this.eventContext();for(const l of this.registries.plugins)if((r=l.onInput)!=null&&r.call(l,t,o))return!0;return!1}handleCompositionStart(t){var r;const o=this.eventContext();for(const l of this.registries.plugins)(r=l.onCompositionStart)==null||r.call(l,t,o)}handleCompositionEnd(t){var r;const o=this.eventContext();for(const l of this.registries.plugins)(r=l.onCompositionEnd)==null||r.call(l,t,o)}destroy(){var t;for(const o of this.registries.plugins)(t=o.onDestroy)==null||t.call(o);this.listeners.clear(),this.extensionMethods.clear()}seedEmptyDocument(t){const o=bo(),r=this.registries.defaultBlockType,l={id:o,type:r,attrs:this.registries.schema.defaultAttrsFor(r),content:[],children:[]};return{id:t,root:[o],blocks:new Map([[o,l]]),parent:new Map([[o,null]])}}}const nd=/([\\`*_[\]])/g;function od(e){return e.replace(nd,"\\$1")}function Ho(e,t){var o;return!!((o=e.marks)!=null&&o.some(r=>r.type===t))}function Si(e){var o;let t="";for(const r of e){if(r.type!=="text")continue;const l=r.text;if(l.length===0)continue;const s=r.marks??[];let i=Ho(r,"code")?`\`${l}\``:od(l);Ho(r,"bold")&&(i=`**${i}**`),Ho(r,"italic")&&(i=`*${i}*`),Ho(r,"strikethrough")&&(i=`~~${i}~~`),Ho(r,"underline")&&(i=`++${i}++`);const a=s.find(d=>d.type==="link"),c=typeof((o=a==null?void 0:a.attrs)==null?void 0:o.href)=="string"?a.attrs.href:void 0;c&&(i=`[${i}](${c})`),t+=i}return t}function Vo(e){const t=[];let o=0,r="";const l=()=>{r.length>0&&(t.push({type:"text",text:r}),r="")};for(;o<e.length;){const s=e[o];if(s==="\\"&&o+1<e.length){r+=e[o+1],o+=2;continue}if(s==="["){const a=e.indexOf("]",o+1);if(a!==-1&&e.charAt(a+1)==="("){const c=e.indexOf(")",a+2);if(c!==-1){const d=e.slice(o+1,a),f=e.slice(a+2,c);if(f.length>0){l(),t.push({type:"link",text:d,href:f}),o=c+1;continue}}}}if(s==="`"){const a=e.indexOf("`",o+1);if(a!==-1){l(),t.push({type:"code",text:e.slice(o+1,a)}),o=a+1;continue}}const i=e.startsWith("***",o)?"***":e.startsWith("___",o)?"___":null;if(i){const a=e.indexOf(i,o+3);if(a!==-1){l(),t.push({type:"italic",text:`**${e.slice(o+3,a)}**`}),o=a+3;continue}}if(e.startsWith("**",o)||e.startsWith("__",o)){const a=e.charAt(o+1),c=e.indexOf(a+a,o+2);if(c!==-1){l(),t.push({type:"bold",text:e.slice(o+2,c)}),o=c+2;continue}}if(e.startsWith("~~",o)){const a=e.indexOf("~~",o+2);if(a!==-1){l(),t.push({type:"strikethrough",text:e.slice(o+2,a)}),o=a+2;continue}}if(e.startsWith("++",o)){const a=e.indexOf("++",o+2);if(a!==-1){l(),t.push({type:"underline",text:e.slice(o+2,a)}),o=a+2;continue}}if((s==="*"||s==="_")&&!(e.charAt(o+1)===s&&o+1<e.length)){const a=e.indexOf(s,o+1);if(a!==-1){l(),t.push({type:"italic",text:e.slice(o+1,a)}),o=a+1;continue}}r+=s,o+=1}return l(),t}function rd(e,t){if(e===void 0&&t===void 0)return!0;if(e===void 0||t===void 0)return!1;const o=Object.keys(e),r=Object.keys(t);return o.length!==r.length?!1:o.every(l=>e[l]===t[l])}function ld(e,t){return e.length!==t.length?!1:e.every((o,r)=>o.type===t[r].type&&rd(o.attrs,t[r].attrs))}function oo(e){const t=[],o=(l,s)=>{if(l.length===0&&s.length===0)return;const i=t[t.length-1];if(i&&ld(i.marks??[],s)){t[t.length-1]={...i,text:i.text+l};return}t.push({type:"text",text:l,marks:s.length>0?[...s]:void 0})},r=(l,s)=>{for(const i of l)i.type==="text"?o(i.text,s):i.type==="link"?o(i.text,[...s,{type:"link",attrs:{href:i.href??""}}]):i.type==="code"?o(i.text,[...s,{type:"code"}]):i.type==="bold"?r(Vo(i.text),[...s,{type:"bold"}]):i.type==="italic"?r(Vo(i.text),[...s,{type:"italic"}]):i.type==="strikethrough"?r(Vo(i.text),[...s,{type:"strikethrough"}]):i.type==="underline"&&r(Vo(i.text),[...s,{type:"underline"}])};return r(Vo(e),[]),t}function id(e){return e.content.reduce((t,o)=>o.type==="text"?t+o.text:t,"")}function sd(e){const t=typeof e.rows=="number"?e.rows:0,o=typeof e.cols=="number"?e.cols:0,r=Array.isArray(e.cells)&&e.cells.length>0?e.cells:[],l=e.headerRow===!0;if(t===0||o===0)return[];const s=(f,u)=>{const m=r[f],h=m==null?void 0:m[u];return!h||h.covered?"":ad(Si(h.content??[]))},i=Array.from({length:o},(f,u)=>s(0,u)),a=Array.from({length:o},()=>"---"),c=[],d=l?1:0;for(let f=d;f<t;f++)c.push(`| ${Array.from({length:o},(u,m)=>s(f,m)).join(" | ")} |`);return[`| ${i.join(" | ")} |`,`| ${a.join(" | ")} |`,...c]}function ad(e){return e.replace(/\\/g,"\\\\").replace(/\|/g,"\\|").replace(/\r?\n/g,"<br>")}function Ai(e){return e==="bulletList"||e==="orderedList"||e==="todoList"}function Ii(e,t,o){var d,f,u,m,h;const r=e.blocks.get(t);if(!r)return[];const l=Pn(e,t),s=" ".repeat(l*2),i=p=>Si(p.content);let a=[];switch(r.type){case"heading":{const p=typeof((d=r.attrs)==null?void 0:d.level)=="number"?r.attrs.level:1,b=Math.max(1,Math.min(6,p));a=[`${s}${"#".repeat(b)} ${i(r)}`];break}case"quote":{const p=i(r);p.length>0&&(a=p.split(`
|
|
2
|
+
`).map(b=>`${s}> ${b}`));break}case"codeBlock":{const p=typeof((f=r.attrs)==null?void 0:f.language)=="string"&&r.attrs.language?r.attrs.language:"",b=id(r),x=b.includes("```")?"````":"```";a=[`${s}${x}${p}`,...b.split(`
|
|
3
|
+
`).map(O=>`${s}${O}`),`${s}${x}`];break}case"bulletList":{a=[`${s}- ${i(r)}`];break}case"orderedList":{const p=typeof((u=r.attrs)==null?void 0:u.startNumber)=="number"?r.attrs.startNumber:1;a=[`${s}${p}. ${i(r)}`];break}case"todoList":{const p=((m=r.attrs)==null?void 0:m.checked)===!0;a=[`${s}- ${p?"[x]":"[ ]"} ${i(r)}`];break}case"divider":{a=[`${s}---`];break}case"image":{const p=r.attrs??{},b=typeof p.src=="string"?p.src:"";if(!b)break;const x=typeof p.alt=="string"?p.alt:"",O=typeof p.title=="string"?p.title:"",z=typeof p.caption=="string"?p.caption:"",F=O?``:``;a=z?[`${s}${F}`,`${s}*${z}*`]:[`${s}${F}`];break}case"table":{a=sd(r.attrs??{});break}case"tableOfContents":{a=[];break}case"equation":{const p=(h=r.attrs)==null?void 0:h.expression,b=typeof p=="string"?p:"";if(b.trim().length>0){const x=b.split(`
|
|
4
|
+
`);a=[`${s}$$$`,...x.map(O=>`${s}${O}`),`${s}$$$`]}break}default:{const p=i(r);p.length>0&&(a=[`${s}${p}`]);break}}const c=[];a.length>0&&c.push({lines:a,level:l,type:r.type});for(const p of r.children)c.push(...Ii(e,p));return c}function cd(e){const t=[];for(const l of e.root)t.push(...Ii(e,l));const o=[];for(let l=0;l<t.length;l++){const s=t[l];if(l>0){const i=t[l-1];!dd(i,s)&&o.push("")}for(const i of s.lines)o.push(i)}const r=[];for(const l of o)l===""&&(r.length===0||r[r.length-1]==="")||r.push(l);return r.join(`
|
|
5
|
+
`)}function dd(e,t){return e.level!==t.level?!0:Ai(e.type)&&Ai(t.type)&&e.type===t.type}function ud(e){const t=/^(#{1,6})\s+(.*)$/.exec(e);if(t)return{type:"heading",attrs:{level:t[1].length},content:oo(t[2])};const o=/^>\s?(.*)$/.exec(e);if(o)return{type:"quote",content:oo(o[1]??"")};const r=/^[-*+]\s+\[([ xX])\]\s+(.*)$/.exec(e);if(r)return{type:"todoList",attrs:{checked:r[1].toLowerCase()==="x"},content:oo(r[2])};const l=/^(\d+)\.\s+(.*)$/.exec(e);if(l)return{type:"orderedList",attrs:{startNumber:Number(l[1])},content:oo(l[2])};const s=/^[-*+]\s+(.*)$/.exec(e);if(s)return{type:"bulletList",content:oo(s[1])};if(/^-{3,}$/.test(e)||/^\*{3,}$/.test(e)||/^_{3,}$/.test(e))return{type:"divider"};const i=/^!\[([^\]]*)\]\((\S+?)(?:\s+"([^"]*)")?\)$/.exec(e.trim());if(i){const a={src:i[2]??"",alt:i[1]??""};return i[3]&&(a.title=i[3]),{type:"image",attrs:a}}return e.trim().length===0?null:{type:"paragraph",content:oo(e)}}function fd(e){const t=e.replace(/\r\n/g,`
|
|
6
6
|
`).split(`
|
|
7
|
-
`),
|
|
8
|
-
`).replace(/\\\|/g,"|").replace(/\\\\/g,"\\")}function
|
|
9
|
-
`)}]}});continue}if(
|
|
10
|
-
`)},content:[]}});continue}const
|
|
11
|
-
`},...M]}}}else e.push({indent:g.indent,block:g.block})}}const r=new Map,o=new Map,l=[],a=[],s=new Set(["paragraph","heading","bulletList","orderedList","todoList"]),c=10,u=(f,p,b)=>{if(r.set(p,b),o.set(p,f),f===null){l.push(p);return}const g=r.get(f);if(!g){l.push(p),o.set(p,null);return}r.set(f,{...g,children:[...g.children,p]})};for(const f of e){const p=Mo(),b=s.has(f.block.type);let g=Math.floor(f.indent/2);for(g<0&&(g=0),g>c&&(g=c);a.length>0&&a[a.length-1].indent>=g;)a.pop();const k=a.length>0?a[a.length-1].id:null,E={...f.block.attrs??{}},M={id:p,type:f.block.type,attrs:E,content:f.block.content??[],children:[]};u(k,p,M),b&&a.push({indent:g,id:p})}const d=10;for(const[f,p]of r){let b=0,g=o.get(f);const k=new Set;for(;g!=null&&!k.has(g);)k.add(g),b++,g=o.get(g);if(b=Math.min(d,b),(typeof p.attrs.indent=="number"?p.attrs.indent:0)===b)continue;const{indent:M,...O}=p.attrs,P=b>0?{...O,indent:b}:O;r.set(f,{...p,attrs:P})}return{id:"doc_"+Math.random().toString(36).slice(2,10),root:l,blocks:r,parent:o}}const f0=Symbol("block-editor-mobile"),zl=Symbol("block-editor-fixed-toolbar-bridge"),oi=Symbol("block-editor-fixed-toolbar-bottom"),Hl=Symbol("block-editor"),h0=Symbol("block-editor-editable"),m0=Symbol("block-editor-image-upload");function Yn(){const t=i.inject(Hl);if(!t)throw new Error("useEditor(): must be called within a <BlockEditor> component tree");return t}function Q1(){return i.inject(m0,null)}function Rr(){return i.inject(h0)??i.ref(!0)}function J1(t,e){const n=Qs(e);if(!n)return!1;const r=t.registries.keymap.resolve(n);if(!r)return!1;const o=t.commands[r.command];return o?o(r.args)===!0:!1}const e3=t=>`[data-block-id="${CSS.escape(t)}"]`;function ii(t,e){const n=e3(e),r=t.querySelector(`${n}[contenteditable], ${n} [contenteditable]`);return r||t.querySelector(n)}function t3(t){const e=window.getSelection();if(!e||e.rangeCount===0)return 0;const n=e.getRangeAt(0),r=n.cloneRange();return r.selectNodeContents(t),r.setEnd(n.endContainer,n.endOffset),r.toString().length}function p0(t,e){const n=window.getSelection();if(!n||n.rangeCount===0)return null;const r=n.getRangeAt(0).endContainer,o=Di(r,t);if(!o)return null;const l=o.dataset.blockId;if(!l)return null;const a=t3(o),s=e.blocks.get(l);if(!s)return null;const c=Ue(s.content).length,u=Math.min(a,c);if(!n.isCollapsed&&n.anchorNode===n.focusNode&&Di(n.anchorNode,t)===o){const f=Math.min(n.anchorOffset,c);return{kind:"text",anchor:{blockId:l,offset:f},focus:{blockId:l,offset:u}}}return Ct(l,u)}function Di(t,e){let n=t;for(;n&&n!==e;){if(n.nodeType===Node.ELEMENT_NODE){const r=n;if(r.dataset&&r.dataset.blockId)return r}n=n.parentNode}return null}function n3(t,e,n){const r=document.createRange();r.selectNodeContents(t);try{r.setEnd(e,n)}catch{return 0}return r.toString().length}function g0(t,e,n){const r=b0(t,e),o=b0(t,n);if(!r||!o)return null;try{const l=document.createRange();return l.setStart(r.node,r.offset),l.setEnd(o.node,o.offset),l}catch{return null}}function b0(t,e){let n=0;const r=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);let o=null;for(;r.nextNode();){const l=r.currentNode;o=l;const a=(l.nodeValue??"").length;if(n+a>=e)return{node:l,offset:Math.max(0,e-n)};n+=a}return o?{node:o,offset:(o.nodeValue??"").length}:{node:t,offset:0}}function zi(t,e,n,r){let o=null;const l=document;if(typeof l.caretRangeFromPoint=="function")o=l.caretRangeFromPoint(t,e);else if(typeof l.caretPositionFromPoint=="function"){const a=l.caretPositionFromPoint(t,e);a&&(o=document.createRange(),o.setStart(a.offsetNode,a.offset),o.collapse(!0))}if(o){const a=Di(o.startContainer,n);if(a){const s=a.dataset.blockId;if(s){const c=r.blocks.get(s);if(c){const u=Ue(c.content).length,d=Math.min(n3(a,o.startContainer,o.startOffset),u);return{blockEl:a,blockId:s,offset:d}}}}}return r3(t,e,n,r)}function r3(t,e,n,r){const o=document.elementFromPoint(t,e),l=o?Di(o,n):null;if(!l)return null;const a=l.dataset.blockId;if(!a)return null;const s=r.blocks.get(a);if(!s)return null;const c=l.matches("[contenteditable]")?l:l.querySelector("[contenteditable]");if(!c)return null;const u=Ue(s.content).length;let d=null,f=0;const p=document.createTreeWalker(c,NodeFilter.SHOW_TEXT);let b;for(;b=p.nextNode();){const g=b,k=(g.nodeValue??"").length;if(k===0)continue;const E=document.createRange();E.setStart(g,0),E.setEnd(g,k);const M=E.getBoundingClientRect();if(M.width<=0&&M.height<=0)continue;const O=Math.max(M.left,Math.min(t,M.right)),P=Math.max(M.top,Math.min(e,M.bottom)),te=Math.hypot(t-O,e-P),z=M.width>0?Math.round((t-M.left)/M.width*k):0,H=f+Math.max(0,Math.min(k,z));(!d||te<d.dist)&&(d={offset:H,dist:te}),f+=k}return d?{blockEl:l,blockId:a,offset:Math.min(d.offset,u)}:{blockEl:l,blockId:a,offset:0}}function Pl(t,e){const n=document.createRange(),r=window.getSelection();if(!r)return;let o=0,l=!1;const a=s=>{var c;if(!l)if(s.nodeType===Node.TEXT_NODE){const u=((c=s.textContent)==null?void 0:c.length)??0;o+u>=e&&(n.setStart(s,Math.max(0,e-o)),n.collapse(!0),l=!0),o+=u}else for(const u of s.childNodes)a(u)};a(t),l||(n.selectNodeContents(t),n.collapse(!1)),r.removeAllRanges(),r.addRange(n)}function v0(t,e){if(Bo(e)){const r=ii(t,e.blockId);if(!r)return;r.focus(),Pl(r,e.offset);return}if(jr(e)&&e.anchor.blockId===e.focus.blockId){const r=ii(t,e.focus.blockId);if(!r)return;if(r.focus(),e.anchor.offset===e.focus.offset)Pl(r,e.focus.offset);else{const o=Math.min(e.anchor.offset,e.focus.offset),l=Math.max(e.anchor.offset,e.focus.offset),a=g0(r,o,l),s=window.getSelection();a&&s?(s.removeAllRanges(),s.addRange(a)):Pl(r,e.focus.offset)}return}const n=window.getSelection();n&&n.rangeCount>0&&n.removeAllRanges()}function kn(t){return t.kind==="text"&&!(t.anchor.blockId===t.focus.blockId&&t.anchor.offset===t.focus.offset)&&t.anchor.blockId!==t.focus.blockId}function $l(t,e,n){if(n.anchor.blockId===n.focus.blockId)return[];const r=yr(e),o=r.indexOf(n.anchor.blockId),l=r.indexOf(n.focus.blockId);if(o===-1||l===-1)return[];const[a,s]=o<=l?[n.anchor.blockId,n.focus.blockId,o<l]:[n.focus.blockId,n.anchor.blockId,o>l],c=r.indexOf(a),u=r.indexOf(s);if(c===-1||u===-1)return[];const d=[];for(let f=c;f<=u;f++){const p=r[f],b=e.blocks.get(p);if(!b)continue;const g=ii(t,p);if(!g)continue;const k=Ue(b.content).length;let E=0,M=k;if(f===c){const P=a===n.anchor.blockId?n.anchor.offset:n.focus.offset;E=Math.min(P,k)}if(f===u){const P=s===n.anchor.blockId?n.anchor.offset:n.focus.offset;M=Math.min(P,k)}const O=g0(g,E,Math.max(E,M));if(O)for(const P of O.getClientRects())P.width>0&&P.height>0&&d.push(P)}return d}function o3(t){var l;const{registry:e,blockId:n,text:r,editor:o}=t;for(const a of e.all){const s=a.pattern.exec(r);if(!s)continue;const c=(l=a.args)==null?void 0:l.call(a,s),u=c&&typeof c=="object"?c:{},d={...u};d.id==="__currentBlock__"&&(d.id=n);const f=typeof u.__stripPrefix=="number"?u.__stripPrefix:0,p=o.commands[a.command];if(p){o.history.beginGroup();try{if(f>0){const b=r.slice(f),g=o.commands.setText;g&&g({id:n,content:Xr(b)})}p(d)}finally{o.history.endGroup()}return!0}}return!1}function i3(t){return t.includes("/")?t.startsWith("/")||/^\s*\/\S*/.test(t):!1}const l3=["http:","https:","mailto:","tel:"],a3=["javascript:","vbscript:","data:","file:"];function Lr(t){const e=t.trim();if(!e)return null;const n=e.toLowerCase();for(const l of a3)if(n.startsWith(l))return null;const r=e.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):/);if(r){const l=r[1].toLowerCase()+":";return l3.includes(l)?e:null}const o=e[0];return o==="/"||o==="."||o==="#"||e.startsWith("//")||Fl(e)?e:null}function Fl(t){const e=t.trim();return!e||e.length<4?!1:/^https?:\/\//i.test(e)||/^mailto:/i.test(e)?!0:/\s/.test(e)?!1:!!/^[\w-]+(\.[\w-]+)+(:\d+)?(\/[^\s]*)?$/.test(e)}function ho(t){const e=t.trim();return e?/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(e)?e:e.startsWith("@")||/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)?e.startsWith("mailto:")?e:`mailto:${e.replace(/^@/,"")}`:Fl(e)&&!e.startsWith("/")?`https://${e}`:e:""}const li=/(^|\s)((?:https?:\/\/|www\.)[^\s<]+|[\w-]+(?:\.[\w-]+)+\.[a-zA-Z]{2,}(?::\d+)?(?:\/[^\s<]*)?)/g;function Hi(t){var r,o;let e=!1;const n=[];for(const l of t){if(l.type!=="text"){n.push(l);continue}const a=(r=l.marks)==null?void 0:r.some(b=>b.type==="link"),s=(o=l.marks)==null?void 0:o.some(b=>b.type==="code");if(a||s){n.push(l);continue}const c=l.text,u=l.marks??[];if(li.lastIndex=0,!li.exec(c)){n.push(l);continue}e=!0;let f=0;li.lastIndex=0;let p;for(;(p=li.exec(c))!==null;){const b=p[0],g=p[2],k=p.index+b.length-g.length,E=k+g.length;if(k>f){const P=c.slice(f,k);P.length>0&&n.push({type:"text",text:P,marks:u.length>0?[...u]:void 0})}const M=ho(g),O=Lr(M);if(O){const P={type:"link",attrs:{href:O}};n.push({type:"text",text:g,marks:[...u,P]})}else n.push({type:"text",text:g,marks:u.length>0?[...u]:void 0});f=E}if(f<c.length){const b=c.slice(f);b.length>0&&n.push({type:"text",text:b,marks:u.length>0?[...u]:void 0})}li.lastIndex=0}return e?n:t}const s3={bold:["b","strong"],italic:["i","em"],underline:["u"],strikethrough:["s","strike","del"],code:["code"],link:["a"]},k0={};for(const[t,e]of Object.entries(s3))for(const n of e)k0[n]=t;const c3="b,strong,i,em,u,s,strike,del,code,a[href],span.be-color-gray,span.be-color-brown,span.be-color-orange,span.be-color-yellow,span.be-color-green,span.be-color-blue,span.be-color-purple,span.be-color-pink,span.be-color-red,span.be-bg-gray,span.be-bg-brown,span.be-bg-orange,span.be-bg-yellow,span.be-bg-green,span.be-bg-blue,span.be-bg-purple,span.be-bg-pink,span.be-bg-red";function u3(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function d3(t){return t.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function y0(t){return t.some(e=>e.type==="text"&&e.marks&&e.marks.length>0)}function Qr(t){return t.length===0?"":t.map(e=>{var d,f,p;if(e.type!=="text")return"";let n=u3(e.text);const r=e.marks??[],o=r.find(b=>b.type==="color"),l=(d=o==null?void 0:o.attrs)==null?void 0:d.color;typeof l=="string"&&(n=`<span class="be-color-${l}">${n}</span>`);const a=r.find(b=>b.type==="bgColor"),s=(f=a==null?void 0:a.attrs)==null?void 0:f.bgColor;typeof s=="string"&&(n=`<span class="be-bg-${s}">${n}</span>`),r.some(b=>b.type==="strikethrough")&&(n=`<s>${n}</s>`),r.some(b=>b.type==="underline")&&(n=`<u>${n}</u>`),r.some(b=>b.type==="italic")&&(n=`<i>${n}</i>`),r.some(b=>b.type==="bold")&&(n=`<b>${n}</b>`),r.some(b=>b.type==="code")&&(n=`<code>${n}</code>`);const c=r.find(b=>b.type==="link"),u=(p=c==null?void 0:c.attrs)==null?void 0:p.href;if(typeof u=="string"){const b=Lr(u);b&&(n=`<a href="${d3(b)}" target="_blank" rel="noopener noreferrer">${n}</a>`)}return n}).join("")}function f3(t){const e=[],n=t.className;if(typeof n=="string"){const r=n.match(/be-color-(\w+)/);r&&e.push({type:"color",attrs:{color:r[1]}});const o=n.match(/be-bg-(\w+)/);o&&e.push({type:"bgColor",attrs:{bgColor:o[1]}})}return e}function Qn(t){const e=[];function n(r,o){if(r.nodeType===Node.TEXT_NODE){const u=r.textContent??"";u.length>0&&e.push({type:"text",text:u,marks:o.length>0?[...o]:void 0});return}if(r.nodeType!==Node.ELEMENT_NODE)return;const l=r,a=l.tagName.toLowerCase();if(a==="br")return;const s=k0[a];let c=o;if(s==="link"){const u=l.getAttribute("href")??"",d=Lr(u);d?c=[...o,{type:"link",attrs:{href:d}}]:c=o}else if(s)c=[...o,{type:s}];else if(a==="span"){const u=f3(l);u.length>0&&(c=[...o,...u])}for(const u of l.childNodes)n(u,c)}return n(t,[]),p3(e)}function h3(t,e){if(t.type!==e.type)return!1;const n=t.attrs?Object.keys(t.attrs):[],r=e.attrs?Object.keys(e.attrs):[];return n.length!==r.length?!1:n.every(o=>t.attrs[o]===e.attrs[o])}function m3(t,e){return!t&&!e?!0:!t||!e||t.length!==e.length?!1:t.every(n=>e.some(r=>h3(n,r)))}function p3(t){const e=[];for(const n of t){const r=e[e.length-1];r&&m3(r.marks,n.marks)?e[e.length-1]={type:"text",text:r.text+n.text,marks:r.marks}:e.push({...n})}return e}function g3(t){return t.attrs?Object.entries(t.attrs).sort((e,n)=>e[0].localeCompare(n[0])).map(([e,n])=>`${e}=${String(n)}`).join(";"):""}function w0(t){return t.map(e=>e.type==="text"?`${e.text}\0${(e.marks??[]).map(n=>`${n.type}:${g3(n)}`).sort().join(",")}`:"").join("")}const Vl=["paragraph","heading","heading1","heading2","heading3","heading4","heading5","heading6","bulletList","orderedList","todoList","quote","codeBlock"],ai=["todoList"],si=["orderedList"],Ul=["left","center","right"],ql=["top","middle","bottom"],Gl=["gray","brown","orange","yellow","green","blue","purple","pink","red"],Wl=["bold","italic","underline","strikethrough","color","bgColor","link"],b3=["bold","italic","underline","strikethrough","code","link","color","bgColor"];function mo(){return{content:[],rowspan:1,colspan:1,covered:!1}}function Io(t,e){const n=e==="codeBlock",r=e==="quote",o=[];for(const l of t){if(l.type!=="text"){o.push({...l});continue}if(n){o.push({type:"text",text:l.text});continue}let a=l.marks?l.marks.filter(s=>b3.includes(s.type)):void 0;a&&a.some(s=>s.type==="code")&&(a=a.filter(s=>s.type==="code"||!Wl.includes(s.type))),r&&a&&(a=a.filter(s=>s.type!=="italic")),a&&(a=a.filter(s=>{var u;if(s.type!=="link")return!0;const c=(u=s.attrs)==null?void 0:u.href;return typeof c!="string"?!1:Lr(c)!==null})),a&&a.length===0&&(a=void 0),o.push(a?{...l,marks:a}:{type:"text",text:l.text})}return o}function mr(t){return{content:t.content.map(e=>({...e})),rowspan:t.rowspan,colspan:t.colspan,covered:t.covered,cellType:t.cellType,align:t.align,verticalAlign:t.verticalAlign,bgColor:t.bgColor,checked:t.checked,startNumber:t.startNumber}}function Or(t,e,n,r,o){var d,f,p;let l=Math.max(0,Math.min(e,r)),a=Math.min(t.rows-1,Math.max(e,r)),s=Math.max(0,Math.min(n,o)),c=Math.min(t.cols-1,Math.max(n,o)),u=!0;for(;u;){u=!1;for(let b=l;b<=a;b++)for(let g=s;g<=c;g++){const k=(d=t.cells[b])==null?void 0:d[g];if(!k)continue;let E=b,M=g;if(k.covered){let z=!1;for(let H=b;H>=0&&!z;H--)for(let ie=g;ie>=0&&!z;ie--){const Q=(f=t.cells[H])==null?void 0:f[ie];!Q||Q.covered||H+Math.max(1,Q.rowspan)>b&&ie+Math.max(1,Q.colspan)>g&&(E=H,M=ie,z=!0)}if(!z)continue}const O=(p=t.cells[E])==null?void 0:p[M];if(!O||O.covered)continue;const P=E+Math.max(1,O.rowspan)-1,te=M+Math.max(1,O.colspan)-1;l>E&&(l=E,u=!0),a<P&&(a=P,u=!0),s>M&&(s=M,u=!0),c<te&&(c=te,u=!0)}}return{r1:l,c1:s,r2:a,c2:c}}function x0(t,e,n,r,o){var u;const l=Math.max(0,Math.min(e,r)),a=Math.min(t.rows-1,Math.max(e,r)),s=Math.max(0,Math.min(n,o)),c=Math.min(t.cols-1,Math.max(n,o));for(let d=l;d<=a;d++)for(let f=s;f<=c;f++){const p=(u=t.cells[d])==null?void 0:u[f];if(!(!p||p.covered)&&(p.rowspan>1||p.colspan>1))return!0}return!1}function v3(t,e,n,r,o){var d;const l=Math.max(0,Math.min(e,r)),a=Math.min(t.rows-1,Math.max(e,r)),s=Math.max(0,Math.min(n,o)),c=Math.min(t.cols-1,Math.max(n,o));let u=0;for(let f=l;f<=a;f++)for(let p=s;p<=c;p++){const b=(d=t.cells[f])==null?void 0:d[p];b&&!b.covered&&(u+=1)}return u}function _o(t){return{content:t.content,rowspan:t.rowspan,colspan:t.colspan,covered:t.covered,cellType:t.cellType,align:t.align,verticalAlign:t.verticalAlign,bgColor:t.bgColor,checked:t.checked,startNumber:t.startNumber}}function k3(t,e){const n=[];for(let r=0;r<t;r++){const o=[];for(let l=0;l<e;l++)o.push(mo());n.push(o)}return n}function ci(t){const e=t.rows,n=t.cols,r=typeof e=="number"&&Number.isInteger(e)&&e>=1?e:1,o=typeof n=="number"&&Number.isInteger(n)&&n>=1?n:1;let l=[];const a=t.colWidths;if(Array.isArray(a))for(const d of a)l.push(typeof d=="number"&&Number.isFinite(d)&&d>=0?d:0);for(;l.length<o;)l.push(0);l.length>o&&(l=l.slice(0,o));const s=typeof t.headerRow=="boolean"?t.headerRow:!1;let c=[];const u=t.cells;if(Array.isArray(u))for(let d=0;d<r;d++){const f=u[d],p=[];if(Array.isArray(f))for(let b=0;b<o;b++){const g=f[b];p.push(y3(g))}else for(let b=0;b<o;b++)p.push(mo());c.push(p)}for(;c.length<r;){const d=[];for(let f=0;f<o;f++)d.push(mo());c.push(d)}return c.length>r&&(c=c.slice(0,r)),c=Dr(c,r,o),{rows:r,cols:o,cells:c,colWidths:l,headerRow:s}}function y3(t){if(!t||typeof t!="object")return mo();const e=t,n=Array.isArray(e.content)?e.content:[],r=typeof e.cellType=="string"?e.cellType:void 0,o=r&&Vl.includes(r)?r:void 0,l=Io(n,o),a=typeof e.rowspan=="number"&&Number.isInteger(e.rowspan)&&e.rowspan>=1?e.rowspan:1,s=typeof e.colspan=="number"&&Number.isInteger(e.colspan)&&e.colspan>=1?e.colspan:1,c=typeof e.covered=="boolean"?e.covered:!1,u=typeof e.align=="string"?e.align:void 0,d=u&&Ul.includes(u)?u:void 0,f=typeof e.verticalAlign=="string"?e.verticalAlign:void 0,p=f&&ql.includes(f)?f:void 0,b=typeof e.bgColor=="string"?e.bgColor:void 0,g=b&&Gl.includes(b)?b:void 0,k=typeof e.checked=="boolean"?e.checked:!1,E=o&&ai.includes(o)?k:void 0,M=typeof e.startNumber=="number"&&Number.isInteger(e.startNumber)&&e.startNumber>=1?e.startNumber:void 0,O=o&&si.includes(o)?M:void 0;return{content:l,rowspan:a,colspan:s,covered:c,cellType:o,align:d,verticalAlign:p,bgColor:g,checked:E,startNumber:O}}function Dr(t,e,n){const r=t.map(o=>o.map(mr));for(let o=0;o<e;o++)for(let l=0;l<n;l++){const a=r[o][l];if(a.covered)continue;const s=Math.max(1,Math.min(a.rowspan,e-o)),c=Math.max(1,Math.min(a.colspan,n-l));if(a.rowspan=s,a.colspan=c,!(s===1&&c===1))for(let u=o;u<o+s;u++)for(let d=l;d<l+c;d++)u===o&&d===l||(r[u][d]={content:[],rowspan:1,colspan:1,covered:!0})}return r.map(o=>o.map(_o))}function E0(t,e){var f,p;const{rows:n,cols:r,cells:o,colWidths:l,headerRow:a}=t,s=Math.max(0,Math.min(e,n)),c=o.map(b=>b.map(mr)),u=[];for(let b=0;b<r;b++){if(s>0){const g=(f=c[s-1])==null?void 0:f[b];if(g&&!g.covered&&s-1+g.rowspan>s){u.push({content:[],rowspan:1,colspan:1,covered:!0});continue}}u.push(mo())}if(c.splice(s,0,u),s>0)for(let b=0;b<r;b++){const g=(p=c[s-1])==null?void 0:p[b];g&&!g.covered&&s-1+g.rowspan>s&&(g.rowspan=g.rowspan+1)}const d=Dr(c,n+1,r);return{rows:n+1,cols:r,cells:d,colWidths:[...l],headerRow:a}}function w3(t,e){var d;const{rows:n,cols:r,colWidths:o,headerRow:l}=t;if(n<=1)return t;const a=Math.max(0,Math.min(e,n-1)),s=t.cells.map(f=>f.map(mr));for(let f=0;f<r;f++)for(let p=0;p<a;p++){const b=(d=s[p])==null?void 0:d[f];if(!b||b.covered)continue;p+b.rowspan>a&&(b.rowspan=Math.max(1,b.rowspan-1))}s.splice(a,1);let c=l;l&&a===0&&(c=!1);const u=Dr(s,n-1,r);return{rows:n-1,cols:r,cells:u,colWidths:[...o],headerRow:c}}function x3(t,e){const{rows:n,cols:r,cells:o,colWidths:l,headerRow:a}=t,s=Math.max(0,Math.min(e,r)),c=o.map(b=>b.map(mr));for(let b=0;b<n;b++){let g=!1;if(s>0){const k=c[b][s-1];k&&!k.covered&&s-1+k.colspan>s&&(k.colspan=k.colspan+1,g=!0)}c[b].splice(s,0,g?{content:[],rowspan:1,colspan:1,covered:!0}:mo())}const u=[...l],d=u.filter(b=>b>0),f=d.length>0?Math.round(d.reduce((b,g)=>b+g,0)/d.length):120;u.splice(s,0,f);const p=Dr(c,n,r+1);return{rows:n,cols:r+1,cells:p,colWidths:u,headerRow:a}}function E3(t,e){const{rows:n,cols:r,cells:o,headerRow:l}=t;if(r<=1)return t;const a=Math.max(0,Math.min(e,r-1)),s=o.map(d=>d.map(mr));for(let d=0;d<n;d++){for(let f=0;f<a;f++){const p=s[d][f];if(!p||p.covered)continue;f+p.colspan>a&&(p.colspan=Math.max(1,p.colspan-1))}s[d].splice(a,1)}const c=[...t.colWidths];c.splice(a,1);const u=Dr(s,n,r-1);return{rows:n,cols:r-1,cells:u,colWidths:c,headerRow:l}}function ui(t,e,n,r){var s;if(e<0||e>=t.rows||n<0||n>=t.cols)return t;const o=(s=t.cells[e])==null?void 0:s[n];if(!o||o.covered)return t;const l=Io(r,o.cellType),a=t.cells.map((c,u)=>c.map((d,f)=>u===e&&f===n?_o({...mr(d),content:l}):d));return{...t,cells:a}}function di(t,e,n,r){var a;if(e<0||e>=t.rows||n<0||n>=t.cols)return t;const o=(a=t.cells[e])==null?void 0:a[n];if(!o||o.covered)return t;const l=t.cells.map((s,c)=>s.map((u,d)=>{if(c!==e||d!==n)return u;const f=mr(u);return r.cellType!==void 0&&(f.cellType=r.cellType==="paragraph"?void 0:Vl.includes(r.cellType)?r.cellType:void 0,f.content=Io(f.content,f.cellType),(!f.cellType||!ai.includes(f.cellType))&&(f.checked=void 0),(!f.cellType||!si.includes(f.cellType))&&(f.startNumber=void 0)),r.align!==void 0&&(f.align=r.align==="left"?void 0:Ul.includes(r.align)?r.align:void 0),r.verticalAlign!==void 0&&(f.verticalAlign=r.verticalAlign==="middle"?void 0:ql.includes(r.verticalAlign)?r.verticalAlign:void 0),r.bgColor!==void 0&&(f.bgColor=r.bgColor==="default"?void 0:Gl.includes(r.bgColor)?r.bgColor:void 0),r.checked!==void 0&&(f.checked=f.cellType&&ai.includes(f.cellType)?r.checked:void 0),r.startNumber!==void 0&&(r.startNumber===null?f.startNumber=void 0:f.startNumber=f.cellType&&si.includes(f.cellType)&&typeof r.startNumber=="number"&&Number.isInteger(r.startNumber)&&r.startNumber>=1?r.startNumber:void 0),_o(f)}));return{...t,cells:l}}function po(t,e,n){const r=new Set(e.map(l=>`${l.row}-${l.col}`)),o=t.cells.map((l,a)=>l.map((s,c)=>{if(!r.has(`${a}-${c}`)||s.covered)return s;const u=mr(s);return n.cellType!==void 0&&(u.cellType=n.cellType==="paragraph"?void 0:Vl.includes(n.cellType)?n.cellType:void 0,u.content=Io(u.content,u.cellType),(!u.cellType||!ai.includes(u.cellType))&&(u.checked=void 0),(!u.cellType||!si.includes(u.cellType))&&(u.startNumber=void 0)),n.align!==void 0&&(u.align=n.align==="left"?void 0:Ul.includes(n.align)?n.align:void 0),n.verticalAlign!==void 0&&(u.verticalAlign=n.verticalAlign==="middle"?void 0:ql.includes(n.verticalAlign)?n.verticalAlign:void 0),n.bgColor!==void 0&&(u.bgColor=n.bgColor==="default"?void 0:Gl.includes(n.bgColor)?n.bgColor:void 0),n.checked!==void 0&&(u.checked=u.cellType&&ai.includes(u.cellType)?n.checked:void 0),n.startNumber!==void 0&&(n.startNumber===null?u.startNumber=void 0:u.startNumber=u.cellType&&si.includes(u.cellType)&&typeof n.startNumber=="number"&&Number.isInteger(n.startNumber)&&n.startNumber>=1?n.startNumber:void 0),_o(u)}));return{...t,cells:o}}function C0(t,e,n,r){const o=new Set(e.map(a=>`${a.row}-${a.col}`)),l=t.cells.map((a,s)=>a.map((c,u)=>{if(!o.has(`${s}-${u}`)||c.covered||c.cellType==="codeBlock"||c.cellType==="quote"&&n==="italic")return c;const d=mr(c);return d.content=d.content.map(f=>{if(f.type!=="text")return f;const p=f.marks?[...f.marks]:[],b=p.some(k=>k.type==="code");if(n==="code"&&r!==null){const k=p.filter(E=>E.type==="code"||!Wl.includes(E.type));return k.some(E=>E.type==="code")||k.push({type:"code"}),{...f,marks:k.length>0?k:void 0}}if(r!==null&&Wl.includes(n)&&b)return f;const g=p.filter(k=>k.type!==n);return r!==null&&g.push(r?{type:n,attrs:r}:{type:n}),{...f,marks:g.length>0?g:void 0}}),_o(d)}));return{...t,cells:l}}function C3(t,e,n){var l,a;new Set(e.map(s=>`${s.row}-${s.col}`));const r=e.filter(s=>{var u;const c=(u=t.cells[s.row])==null?void 0:u[s.col];return!(!c||c.covered||c.cellType==="codeBlock"||c.cellType==="quote"&&n==="italic")});if(r.length===0)return t;let o=!0;for(const s of r){const c=(l=t.cells[s.row])==null?void 0:l[s.col];if(!(!c||c.covered)&&c.content.length!==0){for(const u of c.content){if(u.type!=="text")continue;if(!(((a=u.marks)==null?void 0:a.some(f=>f.type===n))??!1)){o=!1;break}}if(!o)break}}return C0(t,r,n,o?null:{})}function S3(t,e,n,r,o){var z,H,ie;const l=Math.max(0,Math.min(e,r)),a=Math.min(t.rows-1,Math.max(e,r)),s=Math.max(0,Math.min(n,o)),c=Math.min(t.cols-1,Math.max(n,o));if(l===a&&s===c)return t;const u=t.cells.map(Q=>Q.map(mr));for(let Q=l;Q<=a;Q++)for(let ne=s;ne<=c;ne++)u[Q][ne]={content:[],rowspan:1,colspan:1,covered:!1};let d=l,f=s;for(;d>=0&&((H=(z=t.cells[d])==null?void 0:z[f])!=null&&H.covered);){if(f>0){f-=1;continue}d-=1,f=t.cols-1}const p=d>=0?(ie=t.cells[d])==null?void 0:ie[f]:void 0,b=p?p.content.map(Q=>({...Q})):[],g=p==null?void 0:p.cellType,k=p==null?void 0:p.align,E=p==null?void 0:p.verticalAlign,M=p==null?void 0:p.bgColor,O=p==null?void 0:p.checked,P=p==null?void 0:p.startNumber;u[l][s]={content:Io(b,g),rowspan:a-l+1,colspan:c-s+1,covered:!1,cellType:g,align:k,verticalAlign:E,bgColor:M,checked:O,startNumber:P};const te=Dr(u,t.rows,t.cols);return{...t,cells:te}}function S0(t,e,n){var c;if(e<0||e>=t.rows||n<0||n>=t.cols)return t;const r=(c=t.cells[e])==null?void 0:c[n];if(!r||r.covered)return t;const o=e+r.rowspan-1,l=n+r.colspan-1,a=t.cells.map(u=>u.map(mr));for(let u=e;u<=o;u++)for(let d=n;d<=l;d++)a[u][d]={content:u===e&&d===n?[...r.content]:[],rowspan:1,colspan:1,covered:!1};const s=Dr(a,t.rows,t.cols);return{...t,cells:s}}function T3(t,e,n,r,o){var d;const l=Math.max(0,Math.min(e,r)),a=Math.min(t.rows-1,Math.max(e,r)),s=Math.max(0,Math.min(n,o)),c=Math.min(t.cols-1,Math.max(n,o));let u=t;for(let f=a;f>=l;f--)for(let p=c;p>=s;p--){const b=(d=u.cells[f])==null?void 0:d[p];!b||b.covered||b.rowspan===1&&b.colspan===1||(u=S0(u,f,p))}return u}function M3(t){return{...t,headerRow:!t.headerRow}}function T0(t,e,n){if(e<0||e>=t.cols)return t;const r=Math.max(0,Math.round(n)),o=[...t.colWidths];for(;o.length<t.cols;)o.push(0);return o[e]=r,{...t,colWidths:o}}function Pi(t){let e="";for(const n of t.content)n.type==="text"&&(e+=n.text);return e}function M0(t){return t.replace(/\\/g,"\\\\").replace(/\|/g,"\\|").replace(/\r?\n/g,"<br>")}function A3(t){var l,a;const e=[];t.colWidths;const n=[],r=[];for(let s=0;s<t.cols;s++){const c=(l=t.cells[0])==null?void 0:l[s],u=c&&!c.covered?Pi(c):"";n.push(M0(u)),r.push(t.headerRow?"---":"-")}const o=t.headerRow?1:0;t.headerRow?(e.push(`| ${n.join(" | ")} |`),e.push(`| ${r.join(" | ")} |`)):(e.push(`| ${n.join(" | ")} |`),e.push(`| ${r.join(" | ")} |`));for(let s=o;s<t.rows;s++){const c=[];for(let u=0;u<t.cols;u++){const d=(a=t.cells[s])==null?void 0:a[u],f=d&&!d.covered?Pi(d):"";c.push(M0(f))}e.push(`| ${c.join(" | ")} |`)}return e.join(`
|
|
12
|
-
`)}function
|
|
13
|
-
`));for(const p of Array.from(c.childNodes))r.push(p);o=0}continue}if(u==="img"){const d=R3(c);d&&(l(),n.push({type:"image",attrs:{src:d.src,alt:d.alt,title:d.title},content:[]}),o=0);continue}if(u==="table"){const d=B3(c);d&&(l(),n.push({type:"table",attrs:d,content:[]}),o=0);continue}if((a=c.querySelector)!=null&&a.call(c,"img")){l(),fi(c.childNodes,e,n),o=0;continue}r.push(s),o=0}}l()}function P3(t,e,n){const r=[[]];for(const o of t.childNodes)o.nodeType===Node.ELEMENT_NODE&&o.tagName.toLowerCase()==="br"?r.push([]):r[r.length-1].push(o);for(const o of r){const l=e.createElement("div");for(const s of o)l.appendChild(s.cloneNode(!0));const a=Qn(l);n.push({type:"paragraph",attrs:{},content:a})}}const bo=new Map,Fi=new Set;function R0(t,e){for(const n of Fi)n(t,e)}function Jr(t){return bo.get(t)??null}function pr(t,e){if(e===null){if(bo.has(t)){const n=bo.get(t);if(n!=null&&n.tempPreviewUrl&&URL.revokeObjectURL(n.tempPreviewUrl),n!=null&&n.controller)try{n.controller.abort()}catch{}bo.delete(t),R0(t,null)}}else bo.set(t,e),R0(t,e)}function L0(t){return Fi.add(t),()=>{Fi.delete(t)}}const $3=L0;function F3(){for(const[,t]of bo)if(t!=null&&t.tempPreviewUrl&&URL.revokeObjectURL(t.tempPreviewUrl),t!=null&&t.controller)try{t.controller.abort()}catch{}bo.clear();for(const t of Fi)t("",null)}const V3=F3,Vi=new Set;function U3(){for(const t of Vi)try{URL.revokeObjectURL(t)}catch{}Vi.clear()}function Zl(t){const e=URL.createObjectURL(t);return Vi.add(e),e}function q3(t){for(const e of t)pr(e,null)}function G3(t){q3(t)}let jl=null;function W3(t){jl=t}const K3=W3;function O0(t,e,n,r){if(!jl){r.onError("Upload handler not registered");return}jl(t,e,n,r)}function Y3(t,e){return new Promise((n,r)=>{const o=Date.now(),l=500+Math.min(2500,Math.round(t.size/2e3));let a=!1;const s=()=>{if(a)return;const c=Date.now()-o,u=Math.min(1,c/l),d=1-Math.pow(1-u,2);if(e==null||e(d),u<1)requestAnimationFrame(s);else{const f=Zl(t);if(typeof document>"u"){n({url:f});return}const p=document.createElement("img");let b=!1;const g=(k,E)=>{b||(b=!0,n({url:f,width:k,height:E}))};p.onload=()=>g(p.naturalWidth||void 0,p.naturalHeight||void 0),p.onerror=()=>g(),p.src=f,setTimeout(()=>g(),5e3)}};requestAnimationFrame(s),t.type.startsWith("image/")||(a=!0,setTimeout(()=>r(new Error("Not an image file")),30))})}function X3(t,e){return new Promise(n=>{const r=Zl(e),o=new AbortController;pr(t,{status:"pending",progress:0,file:e,tempPreviewUrl:r,controller:o});let l,a;if(typeof document<"u"){const s=document.createElement("img");let c=!1;const u=()=>{c||(c=!0,l=s.naturalWidth||void 0,a=s.naturalHeight||void 0)};s.onload=u,s.onerror=u,s.src=r,setTimeout(u,4e3)}try{O0(e.name,e,o,{onProgress:s=>{const c=Jr(t);if(!c)return;const u=Math.max(0,Math.min(1,Number.isFinite(s)?s:0));pr(t,{...c,progress:u})},onSuccess:s=>{const c=Jr(t);if(c!=null&&c.tempPreviewUrl&&c.tempPreviewUrl!==s.url){try{URL.revokeObjectURL(c.tempPreviewUrl)}catch{}Vi.delete(c.tempPreviewUrl)}pr(t,null),n({ok:!0,value:{url:s.url,width:s.width??l,height:s.height??a,alt:s.alt,title:s.title,fileId:s.fileId}})},onError:s=>{const c=Jr(t);pr(t,{status:"error",progress:0,error:s,file:(c==null?void 0:c.file)??e,tempPreviewUrl:c==null?void 0:c.tempPreviewUrl}),n({ok:!1,error:s})}})}catch(s){const c=s instanceof Error?s.message:String(s);pr(t,{status:"error",progress:0,error:c,file:e,tempPreviewUrl:r}),n({ok:!1,error:c})}})}async function Ql(t,e){if(!t)return null;try{if(t.startsWith("data:"))return Z3(t,e);const n=await fetch(t);if(!n.ok)return null;const r=await n.blob(),o=D0(r.type,t),l=e?z0(e,o):`image-${Date.now()}${o}`;return new File([r],l,{type:r.type||"image/png"})}catch{return null}}function Z3(t,e){const n=t.match(/^data:([^;,]+)?(;base64)?,(.*)$/);if(!n)return null;const[,r,o,l]=n,a=r||"image/png",s=!!o;let c;if(s){const p=atob(l);c=new Uint8Array(p.length);for(let b=0;b<p.length;b++)c[b]=p.charCodeAt(b)}else{const p=decodeURIComponent(l);c=new TextEncoder().encode(p)}const u=D0(a,t),d=e?z0(e,u):`image-${Date.now()}${u}`,f=new Blob([c],{type:a});return new File([f],d,{type:a})}function D0(t,e){if(t.includes("png"))return".png";if(t.includes("jpeg")||t.includes("jpg"))return".jpg";if(t.includes("gif"))return".gif";if(t.includes("webp"))return".webp";if(t.includes("svg"))return".svg";if(t.includes("bmp"))return".bmp";const n=e.match(/\.(png|jpe?g|gif|webp|svg|bmp)$/i);return n?`.${n[1].toLowerCase()}`:".png"}function z0(t,e){return t.toLowerCase().endsWith(e.toLowerCase())?t:t+e}const j3=["data-block-id","data-empty","data-placeholder","contenteditable"],zr=i.defineComponent({__name:"BlockContent",props:{block:{},placeholder:{}},emits:["slashTrigger","inputChanged","linkClick","focusIn"],setup(t,{emit:e}){const n=t,r=e,o=Yn(),l=Rr(),a=i.ref(null),s=i.shallowRef(!1);function c(){return Ue(n.block.content).length===0}const u=i.ref(c());i.onMounted(()=>{const $=a.value;if(!$)return;const D=Ue(n.block.content);y0(n.block.content)?$.innerHTML=Qr(n.block.content):$.textContent=D,u.value=D.length===0});function d($){const D=window.getSelection();if(!D||D.rangeCount===0)return null;const W=D.getRangeAt(0);if(!$.contains(W.commonAncestorContainer))return null;const K=document.createRange();K.selectNodeContents($),K.setEnd(W.startContainer,W.startOffset);const B=K.toString().length;K.setEnd(W.endContainer,W.endOffset);const A=K.toString().length;return{from:Math.min(B,A),to:Math.max(B,A)}}function f($,D){const W=document.createTreeWalker($,NodeFilter.SHOW_TEXT);let K=Math.max(0,D),B=null;for(;W.nextNode();){const A=W.currentNode;B=A;const j=(A.nodeValue??"").length;if(K<=j)return{node:A,offset:K};K-=j}return B?{node:B,offset:(B.nodeValue??"").length}:{node:$,offset:0}}function p($,D,W){const K=window.getSelection();if(!K)return;const B=f($,D),A=f($,Math.max(D,W));try{const j=document.createRange();D<=W?(j.setStart(B.node,B.offset),j.setEnd(A.node,A.offset)):(j.setStart(A.node,A.offset),j.setEnd(B.node,B.offset)),K.removeAllRanges(),K.addRange(j)}catch{try{const j=document.createRange();j.setStart(A.node,A.offset),j.collapse(!0),K.removeAllRanges(),K.addRange(j)}catch{}}}i.watch(()=>n.block,$=>{if(s.value)return;const D=a.value;if(!D)return;const W=d(D),K=W&&W.from!==W.to,B=document.activeElement===D,A=Ue($.content),j=A.length===0;let F=!1;if(j)D.childNodes.length>0&&(D.textContent="",F=!0);else{const V=y0($.content),fe=!!D.querySelector(c3);if(!V&&!fe)D.textContent!==A&&(D.textContent=A,F=!0);else{const Ee=w0(Qn(D)),Me=w0($.content);Ee!==Me&&(D.innerHTML=Qr($.content),F=!0)}}u.value=j,F&&W&&(B||K)&&p(D,W.from,W.to)});function b($){$.key==="Enter"&&!$.shiftKey&&!$.isComposing&&$.preventDefault()}function g($){var F,V;if(!l.value)return;const D=a.value;if(!D)return;const W=Qn(D),K=Ue(W);if(u.value=K.length===0,r("inputChanged",n.block.id,K),s.value||o3({editor:o,registry:o.registries.inputRules,blockId:n.block.id,text:K}))return;if(i3(K)){const fe=K.match(/\/([^/]*)$/),Ee=K.lastIndexOf("/"),Me=fe&&fe[1]!==void 0?fe[1]:Ee>=0?K.slice(Ee+1):"";r("slashTrigger",D,n.block.id,Me)}let A=W;o.registries.schema.get(n.block.type).inlineMarks&&$.data&&/\s/.test($.data)&&(A=Hi(W)),(V=(F=o.commands).setText)==null||V.call(F,{id:n.block.id,content:A})}function k($){s.value=!0}function E($){var j,F;if(s.value=!1,!l.value)return;const D=a.value;if(!D)return;const W=Qn(D),K=Ue(W);u.value=K.length===0,r("inputChanged",n.block.id,K);const A=o.registries.schema.get(n.block.type).inlineMarks?Hi(W):W;(F=(j=o.commands).setText)==null||F.call(j,{id:n.block.id,content:A})}function M(){const $=a.value;if(!$)return null;const D=window.getSelection();if(!D||D.rangeCount===0)return null;const W=D.getRangeAt(0);if(!$.contains(W.commonAncestorContainer))return null;const K=Ue(n.block.content),B=document.createRange();B.selectNodeContents($),B.setEnd(W.startContainer,W.startOffset);const A=Math.min(B.toString().length,K.length);B.setEnd(W.endContainer,W.endOffset);const j=Math.min(B.toString().length,K.length);return[Math.min(A,j),Math.max(A,j)]}function O($){var V,fe;const D=M();if(!D)return;const[W,K]=D;if(W===K)return;const[,B]=En(n.block.content,W),[A]=En(B,K-W),j=Ue(A),F=Qr(A);$.preventDefault(),(V=$.clipboardData)==null||V.setData("text/plain",j),(fe=$.clipboardData)==null||fe.setData("text/html",F)}function P($){var Ee,Me,ae,Te;if(!l.value){$.preventDefault();return}const D=M();if(!D)return;const[W,K]=D;if(W===K)return;const[B,A]=En(n.block.content,W),[j,F]=En(A,K-W),V=Ue(j),fe=Qr(j);$.preventDefault(),(Ee=$.clipboardData)==null||Ee.setData("text/plain",V),(Me=$.clipboardData)==null||Me.setData("text/html",fe),(Te=(ae=o.commands).setText)==null||Te.call(ae,{id:n.block.id,content:[...B,...F],selectionAfter:Ct(n.block.id,W)})}const te=Q1();function z($){const D=[],W=new Set;if($.items&&$.items.length>0)for(let K=0;K<$.items.length;K++){const B=$.items[K];if(B.kind!=="file")continue;const A=B.getAsFile();if(!A||!A.type.startsWith("image/"))continue;const j=`${A.name||""}:${A.size}:${A.type}`;W.has(j)||(W.add(j),D.push(A))}if($.files&&$.files.length>0)for(let K=0;K<$.files.length;K++){const B=$.files[K];if(!B.type.startsWith("image/"))continue;const A=`${B.name||""}:${B.size}:${B.type}`;W.has(A)||(W.add(A),D.push(B))}return D}async function H($){var Vt,on,gn,Gt,ct,Zt,ln,St,Ke,yt,Pe,Ut,Fe,qe,jt,gt,Qt,at,be,Y,L,re,Je,Ve,tn,Mn,an,sr,ut,cr,Cn,Vn;if(!l.value){$.preventDefault();return}const D=$.clipboardData;if(!D)return;if(te){const ht=z(D);if(ht.length>0){$.preventDefault();let xt=n.block.id;for(let Ye=0;Ye<ht.length;Ye++){const Xe=ht[Ye],mt=await te(Xe,{relativeToBlockId:xt,convertIfEmpty:Ye===0,position:"after"});mt&&(xt=mt)}return}}const W=D.getData("text/html"),K=D.getData("text/plain"),B=L3(W||null,K||null);if(B.length===0)return;const A=B.some(ht=>ht.type==="image"),j=M(),F=Ue(n.block.content).length,V=j?j[0]:F,fe=j?j[1]:F,[Ee]=En(n.block.content,V),[,Me]=En(n.block.content,fe),ae=o.registries.schema.get(n.block.type),Te=ht=>ae.inlineMarks?ht:ht.map(xt=>({type:"text",text:xt.text}));if(!A){if(B.length===1){const Ye=Te(B[0].content);if(ae.inlineMarks&&V<fe&&Ye.length===1&&Ye[0].type==="text"&&!Ye[0].marks){const Rt=Ye[0].text;if(Fl(Rt)){const An=ho(Rt),xn=Lr(An);if(xn){(on=(Vt=o.commands).setLink)==null||on.call(Vt,{id:n.block.id,href:xn,from:V,to:fe});return}}}const Xe=[...Ee,...Ye,...Me],mt=ae.inlineMarks?Hi(Xe):Xe,sn=Ue(Ee).length,Tt=Ue(Ye).length,_t=sn+Tt;(Gt=(gn=o.commands).setText)==null||Gt.call(gn,{id:n.block.id,content:mt,selectionAfter:Ct(n.block.id,_t)});return}const ht=[...Ee,...Te(B[0].content)];(Zt=(ct=o.commands).setText)==null||Zt.call(ct,{id:n.block.id,content:ht});let xt=n.block.id;for(let Ye=1;Ye<B.length;Ye++){const Xe=B[Ye],mt=Ye===B.length-1,sn=Te(Xe.content),Tt=mt?[...sn,...Me]:sn,_t=o.registries.schema.coerceAttrsFor(Xe.type,Xe.attrs);(St=(ln=o.commands).insertBlock)==null||St.call(ln,{after:xt,type:Xe.type,attrs:_t,content:Tt});const Rt=o.getState();if(Rt.selection.kind==="caret"&&(xt=Rt.selection.blockId),mt){const An=Ue(sn).length,xn=Me.length>0?An:Ue(Tt).length;(yt=(Ke=o.commands).setSelection)==null||yt.call(Ke,{selection:Ct(xt,xn)})}}return}if(!te){const ht=B.filter(xt=>xt.type!=="image");if(ht.length===0)return;if(B.splice(0,B.length,...ht),B.length===1){const xt=Te(B[0].content),Ye=[...Ee,...xt,...Me];(Ut=(Pe=o.commands).setText)==null||Ut.call(Pe,{id:n.block.id,content:Ye,selectionAfter:Ct(n.block.id,Ue(Ee).length+Ue(xt).length)})}return}let He=-1;for(let ht=B.length-1;ht>=0;ht--)if(B[ht].type!=="image"){He=ht;break}let xe=n.block.id;const tt=B[0];if(tt.type!=="image"){const xt=He===0?[...Ee,...Te(tt.content),...Me]:[...Ee,...Te(tt.content)];(qe=(Fe=o.commands).setText)==null||qe.call(Fe,{id:n.block.id,content:xt}),xe=n.block.id}else{const ht=Ee.length===0&&Me.length===0,xt=tt.attrs.src,Ye=tt.attrs.alt??"";if(ht){const Xe=await Ql(xt,Ye||void 0);if(Xe){const mt=await te(Xe,{relativeToBlockId:xe,position:"after",convertIfEmpty:!0});mt&&(xe=mt)}else{const mt=o.registries.schema.coerceAttrsFor(tt.type,tt.attrs);(gt=(jt=o.commands).replaceBlock)==null||gt.call(jt,{id:n.block.id,type:tt.type,attrs:mt}),xe=n.block.id}}else{(at=(Qt=o.commands).setText)==null||at.call(Qt,{id:n.block.id,content:Ee});const Xe=await Ql(xt,Ye||void 0);if(Xe){const mt=await te(Xe,{relativeToBlockId:xe,position:"after",convertIfEmpty:!1});mt&&(xe=mt)}else{const mt=o.registries.schema.coerceAttrsFor(tt.type,tt.attrs);(Y=(be=o.commands).insertBlock)==null||Y.call(be,{after:xe,type:tt.type,attrs:mt,content:[]});const sn=o.getState();sn.selection.kind==="caret"&&(xe=sn.selection.blockId)}}}for(let ht=1;ht<B.length;ht++){const xt=B[ht],Ye=ht===He;if(xt.type==="image"){const Xe=xt.attrs.src,mt=xt.attrs.alt??"",sn=await Ql(Xe,mt||void 0);if(sn){const Tt=await te(sn,{relativeToBlockId:xe,position:"after",convertIfEmpty:!1});Tt&&(xe=Tt)}else{const Tt=o.registries.schema.coerceAttrsFor(xt.type,xt.attrs);(re=(L=o.commands).insertBlock)==null||re.call(L,{after:xe,type:xt.type,attrs:Tt,content:[]});const _t=o.getState();_t.selection.kind==="caret"&&(xe=_t.selection.blockId)}}else{const Xe=Te(xt.content),mt=Ye?[...Xe,...Me]:Xe,sn=o.registries.schema.coerceAttrsFor(xt.type,xt.attrs);(Ve=(Je=o.commands).insertBlock)==null||Ve.call(Je,{after:xe,type:xt.type,attrs:sn,content:mt});const Tt=o.getState();if(Tt.selection.kind==="caret"&&(xe=Tt.selection.blockId),Ye){const _t=Ue(Xe).length,Rt=Me.length>0?_t:Ue(mt).length;(Mn=(tn=o.commands).setSelection)==null||Mn.call(tn,{selection:Ct(xe,Rt)})}}}if(He===-1&&Me.length>0){(sr=(an=o.commands).insertBlock)==null||sr.call(an,{after:xe,type:"paragraph",attrs:{},content:Me});const ht=o.getState();ht.selection.kind==="caret"&&(xe=ht.selection.blockId,(cr=(ut=o.commands).setSelection)==null||cr.call(ut,{selection:Ct(xe,Ue(Me).length)}))}else He===-1&&(Ee.length>0||Me.length>0)&&((Vn=(Cn=o.commands).insertBlock)==null||Vn.call(Cn,{after:xe,type:"paragraph",attrs:{},content:[]}))}function ie(){r("focusIn",n.block.id)}function Q(){}function ne($){return document.createTreeWalker($,NodeFilter.SHOW_TEXT).nextNode()}function _($){var j;const D=$.target;if(!D)return;const W=D.closest("a");if(!W||!((j=a.value)!=null&&j.contains(W)))return;$.preventDefault();const K=window.getSelection();let B=0;if(K&&K.rangeCount>0&&!!W.contains(K.getRangeAt(0).commonAncestorContainer)){const F=K.getRangeAt(0),V=document.createRange();V.selectNodeContents(a.value),V.setEnd(F.startContainer,F.startOffset),B=V.toString().length}else{const F=ne(W);if(F){const V=document.createRange();V.selectNodeContents(a.value),V.setEnd(F,0),B=V.toString().length}}r("linkClick",n.block.id,B)}return($,D)=>(i.openBlock(),i.createElementBlock("div",{ref_key:"el",ref:a,class:"block-content","data-block-id":t.block.id,"data-empty":u.value,"data-placeholder":t.placeholder,contenteditable:i.unref(l),spellcheck:"false",onInput:g,onCompositionstart:k,onCompositionend:E,onFocus:ie,onBlur:Q,onKeydown:b,onClick:_,onPaste:i.withModifiers(H,["prevent"]),onCopy:O,onCut:P},null,40,j3))}});function H0(t){return t==="zh-CN"||t===null||t===void 0||t===""?"zh-CN":"en-US"}function P0(t){return t==="dark"?"dark":"light"}const Q3={"zh-CN":{"editor.placeholder":"输入文字,或按 '/' 获取命令…","handle.plus.title":"点击添加块","handle.plus.ariaLabel":"Insert block below","handle.grip.title":"拖拽移动 / 点击设置","handle.grip.ariaLabel":"Drag to move block, click to open settings","ui.scrollUp":"向上滚动","ui.scrollDown":"向下滚动","ui.scrollLeft":"向左","ui.scrollRight":"向右","plus.category.basic":"基本区块","plus.category.list":"列表","plus.category.other":"其他","plus.noMatch":"未找到匹配的命令","plus.searchPlaceholder":"搜索命令…","slash.paragraph.title":"正文","slash.paragraph.description":"普通文本段落。","slash.heading1.title":"一级标题","slash.heading1.description":"用于文章的主标题。","slash.heading2.title":"二级标题","slash.heading2.description":"用于主要章节的标题。","slash.heading3.title":"三级标题","slash.heading3.description":"用于子章节的标题。","slash.heading4.title":"四级标题","slash.heading4.description":"用于更细分层的标题。","slash.heading5.title":"五级标题","slash.heading5.description":"用于较小层级的标题。","slash.heading6.title":"六级标题","slash.heading6.description":"用于最小层级的标题。","slash.bulletList.title":"项目符号列表","slash.bulletList.description":"创建一个无序列表。","slash.orderedList.title":"编号列表","slash.orderedList.description":"创建一个带编号的有序列表。","slash.todoList.title":"待办列表","slash.todoList.description":"用复选框追踪待办任务。","slash.quote.title":"引用","slash.quote.description":"引用一段话。","slash.codeBlock.title":"代码块","slash.codeBlock.description":"插入一段代码块。","codeBlock.title":"代码块","slash.divider.title":"分隔符","slash.divider.description":"插入一条水平分隔线。","slash.image.title":"图片","slash.image.description":"插入一张图片(从本地上传或选择文件)。","slash.table3x3.title":"表格(3×3)","slash.table3x3.description":"插入一个 3 行 3 列的表格。","slash.table2x2.title":"表格(2×2)","slash.table2x2.description":"插入一个 2 行 2 列的表格。","slash.table4x4.title":"表格(4×4)","slash.table4x4.description":"插入一个 4 行 4 列的表格。","bsm.section.turnInto":"转换为","bsm.section.alignIndent":"对齐与缩进","bsm.section.align":"对齐","bsm.section.indent":"缩进","bsm.section.action":"操作","bsm.section.textColor":"文字颜色","bsm.section.bgColor":"背景颜色","bsm.indent.decrease":"减少缩进","bsm.indent.increase":"增加缩进","turnInto.paragraph":"正文","turnInto.h1":"一级标题","turnInto.h2":"二级标题","turnInto.h3":"三级标题","turnInto.h4":"四级标题","turnInto.h5":"五级标题","turnInto.h6":"六级标题","turnInto.bullet":"项目符号","turnInto.ordered":"编号列表","turnInto.todo":"待办","turnInto.quote":"引用","turnInto.code":"代码块","align.left":"左对齐","align.center":"居中","align.right":"右对齐","align.justify":"两端对齐","verticalAlign.top":"顶端对齐","verticalAlign.middle":"垂直居中","verticalAlign.bottom":"底端对齐","hoverToolbar.verticalAlignBtnTitle":"垂直对齐","action.duplicate":"复制","action.copy":"拷贝","action.cut":"剪切","action.moveUp":"上移","action.moveDown":"下移","action.delete":"删除","ol.continue":"继续之前的编号","ol.startNew":"开始新列表(从1开始)","ol.modify":"修改编号值…","numberPicker.title":"修改编号值","numberPicker.inputLabel":"编号值","numberPicker.confirm":"确定","codeLang.title":"设置代码类型","codeLang.inputLabel":"代码类型","codeLang.placeholder":"请输入代码类型","codeLang.confirm":"确定","codeLang.custom":"自定义…","codeLang.cancel":"取消","codeLang.plain":"纯文本","hoverToolbar.label":"格式化","hoverToolbar.typeBtnTitle":"切换块类型","hoverToolbar.alignBtnTitle":"对齐方式","hoverToolbar.colorBtnTitle":"颜色","hoverToolbar.textColor":"文字颜色","hoverToolbar.bgColor":"背景颜色","hoverToolbar.copySelection":"复制选中文本","hoverToolbar.deleteBlock":"删除块","mark.bold":"加粗","mark.italic":"斜体","mark.underline":"下划线","mark.strikethrough":"删除线","mark.inlineCode":"行内代码","mark.link":"链接","link.popoverLabel":"链接","link.open":"打开链接","link.copy":"复制链接","link.edit":"编辑链接","link.remove":"移除链接","link.save":"保存","link.cancel":"取消","link.urlPlaceholder":"输入链接地址…","link.textPlaceholder":"链接文本…","link.emptyUrl":"(空链接)","link.invalidUrl":"请输入有效的链接地址","hoverToolbar.linkBtnTitle":"链接","color.default":"默认","color.gray":"灰色","color.brown":"棕色","color.orange":"橙色","color.yellow":"黄色","color.green":"绿色","color.blue":"蓝色","color.purple":"紫色","color.pink":"粉色","color.red":"红色","color.none":"无","image.uploading":"正在上传图片…","image.uploadFailed":"上传失败","image.loadFailed":"图片加载失败","image.retry":"重试","image.replace":"替换图片","image.remove":"删除图片","image.resize":"拖拽调整尺寸","image.emptyTitle":"点击上传图片","image.emptySub":"或拖入图片文件到此处","image.captionPlaceholder":"添加图片说明…","turnInto.image":"图片","table.title":"表格","table.cellPlaceholder":"输入内容…","table.resizeCol":"拖拽调整列宽","table.rowActions":"行操作","table.colActions":"列操作","table.selectRow":"选择此行","table.selectCol":"选择此列","table.selectAll":"选择整个表格","table.insertRowAbove":"在上方插入行","table.insertRowBelow":"在下方插入行","table.insertColLeft":"在左侧插入列","table.insertColRight":"在右侧插入列","table.removeRow":"删除此行","table.removeCol":"删除此列","table.deleteRow":"删除行","table.deleteCol":"删除列","table.toggleHeader":"切换表头行","table.mergeCells":"合并单元格","table.splitCell":"拆分单元格","table.deleteTable":"删除表格","turnInto.table":"表格","toc.title":"目录","toc.empty":"暂无标题","slash.tableOfContents.title":"目录","slash.tableOfContents.description":"插入文档目录。","slash.equation.title":"公式","slash.equation.description":"插入数学公式(LaTeX)","turnInto.equation":"公式","equation.placeholder":"输入数学公式...","equation.invalid":"公式无法解析","equation.edit":"编辑公式"},"en-US":{"editor.placeholder":"Type '/' for commands...","handle.plus.title":"Insert block below","handle.plus.ariaLabel":"Insert block below","handle.grip.title":"Drag to move / click for settings","handle.grip.ariaLabel":"Drag to move block, click to open settings","ui.scrollUp":"Scroll up","ui.scrollDown":"Scroll down","ui.scrollLeft":"Scroll left","ui.scrollRight":"Scroll right","plus.category.basic":"Basic blocks","plus.category.list":"Lists","plus.category.other":"Other","plus.noMatch":"No matching commands","plus.searchPlaceholder":"Search commands...","slash.paragraph.title":"Paragraph","slash.paragraph.description":"Plain text paragraph.","slash.heading1.title":"Heading 1","slash.heading1.description":"Main title for the document.","slash.heading2.title":"Heading 2","slash.heading2.description":"Title for major sections.","slash.heading3.title":"Heading 3","slash.heading3.description":"Title for sub-sections.","slash.heading4.title":"Heading 4","slash.heading4.description":"Title for finer hierarchy levels.","slash.heading5.title":"Heading 5","slash.heading5.description":"Title for smaller hierarchy levels.","slash.heading6.title":"Heading 6","slash.heading6.description":"Title for the smallest hierarchy level.","slash.bulletList.title":"Bullet list","slash.bulletList.description":"Create an unordered list.","slash.orderedList.title":"Numbered list","slash.orderedList.description":"Create a numbered ordered list.","slash.todoList.title":"To-do list","slash.todoList.description":"Track tasks with checkboxes.","slash.quote.title":"Quote","slash.quote.description":"Quote a passage of text.","slash.codeBlock.title":"Code block","slash.codeBlock.description":"Insert a code block.","codeBlock.title":"Code block","slash.divider.title":"Divider","slash.divider.description":"Insert a horizontal divider line.","slash.image.title":"Image","slash.image.description":"Insert an image (upload or choose a file).","slash.table3x3.title":"Table (3×3)","slash.table3x3.description":"Insert a 3-row 3-column table.","slash.table2x2.title":"Table (2×2)","slash.table2x2.description":"Insert a 2-row 2-column table.","slash.table4x4.title":"Table (4×4)","slash.table4x4.description":"Insert a 4-row 4-column table.","bsm.section.turnInto":"Turn into","bsm.section.alignIndent":"Align & Indent","bsm.section.align":"Align","bsm.section.indent":"Indent","bsm.section.action":"Actions","bsm.section.textColor":"Text color","bsm.section.bgColor":"Background color","bsm.indent.decrease":"Decrease indent","bsm.indent.increase":"Increase indent","turnInto.paragraph":"Paragraph","turnInto.h1":"Heading 1","turnInto.h2":"Heading 2","turnInto.h3":"Heading 3","turnInto.h4":"Heading 4","turnInto.h5":"Heading 5","turnInto.h6":"Heading 6","turnInto.bullet":"Bullet list","turnInto.ordered":"Numbered list","turnInto.todo":"To-do","turnInto.quote":"Quote","turnInto.code":"Code block","align.left":"Align left","align.center":"Center","align.right":"Align right","align.justify":"Justify","verticalAlign.top":"Align top","verticalAlign.middle":"Vertical center","verticalAlign.bottom":"Align bottom","hoverToolbar.verticalAlignBtnTitle":"Vertical align","action.duplicate":"Duplicate","action.copy":"Copy","action.cut":"Cut","action.moveUp":"Move up","action.moveDown":"Move down","action.delete":"Delete","ol.continue":"Continue previous numbering","ol.startNew":"Start a new list (from 1)","ol.modify":"Modify starting number...","numberPicker.title":"Modify number value","numberPicker.inputLabel":"Number value","numberPicker.confirm":"Confirm","codeLang.title":"Set code language","codeLang.inputLabel":"Code language","codeLang.placeholder":"Enter code language","codeLang.confirm":"Confirm","codeLang.custom":"Custom…","codeLang.cancel":"Cancel","codeLang.plain":"Plain text","hoverToolbar.label":"Formatting","hoverToolbar.typeBtnTitle":"Switch block type","hoverToolbar.alignBtnTitle":"Alignment","hoverToolbar.colorBtnTitle":"Color","hoverToolbar.textColor":"Text color","hoverToolbar.bgColor":"Background color","hoverToolbar.copySelection":"Copy selection","hoverToolbar.deleteBlock":"Delete block","mark.bold":"Bold","mark.italic":"Italic","mark.underline":"Underline","mark.strikethrough":"Strikethrough","mark.inlineCode":"Inline code","mark.link":"Link","link.popoverLabel":"Link","link.open":"Open link","link.copy":"Copy link","link.edit":"Edit link","link.remove":"Remove link","link.save":"Save","link.cancel":"Cancel","link.urlPlaceholder":"Enter URL...","link.textPlaceholder":"Link text...","link.emptyUrl":"(empty link)","link.invalidUrl":"Please enter a valid URL","hoverToolbar.linkBtnTitle":"Link","hoverToolbar.linkPrompt":"Enter URL:","color.default":"Default","color.gray":"Gray","color.brown":"Brown","color.orange":"Orange","color.yellow":"Yellow","color.green":"Green","color.blue":"Blue","color.purple":"Purple","color.pink":"Pink","color.red":"Red","color.none":"None","image.uploading":"Uploading image...","image.uploadFailed":"Upload failed","image.loadFailed":"Failed to load image","image.retry":"Retry","image.replace":"Replace image","image.remove":"Remove image","image.resize":"Drag to resize","image.emptyTitle":"Click to upload an image","image.emptySub":"or drag an image file here","image.captionPlaceholder":"Add a caption...","turnInto.image":"Image","table.title":"Table","table.cellPlaceholder":"Type here...","table.resizeCol":"Drag to resize column","table.rowActions":"Row actions","table.colActions":"Column actions","table.selectRow":"Select row","table.selectCol":"Select column","table.selectAll":"Select entire table","table.insertRowAbove":"Insert row above","table.insertRowBelow":"Insert row below","table.insertColLeft":"Insert column left","table.insertColRight":"Insert column right","table.removeRow":"Delete row","table.removeCol":"Delete column","table.deleteRow":"Delete row","table.deleteCol":"Delete column","table.toggleHeader":"Toggle header row","table.mergeCells":"Merge cells","table.splitCell":"Split cell","table.deleteTable":"Delete table","turnInto.table":"Table","toc.title":"Table of Contents","toc.empty":"No headings","slash.tableOfContents.title":"Table of Contents","slash.tableOfContents.description":"Insert a table of contents.","slash.equation.title":"Equation","slash.equation.description":"Insert a math formula (LaTeX)","turnInto.equation":"Equation","equation.placeholder":"Type a formula...","equation.invalid":"Invalid equation","equation.edit":"Edit formula"}},$0=Symbol("be-locale"),F0=Symbol("be-theme");function J3(t,e){i.provide($0,t),i.provide(F0,e)}function In(){const t=i.inject($0,i.ref("zh-CN")),e=i.inject(F0,i.ref("light"));return{get locale(){return t.value},get theme(){return e.value},t(n){const o=Q3[t.value][n];return typeof o=="string"?o:n}}}const ef=["title","aria-label","onKeydown"],tf=["title","aria-label","onKeydown"],nf=4,rf=300,of=i.defineComponent({__name:"BlockHandle",props:{blockId:{},visible:{type:Boolean}},emits:["openPlusMenu","openSettingsMenu","gripPointerDown","gripPointerUp"],setup(t,{expose:e,emit:n}){const r=t,o=n,{t:l}=In(),a=Rr(),s=i.ref(null),c=i.ref(null),u=i.ref(null),d=i.ref(!1),f=i.ref(!1),p=i.ref(null);let b=null;const g=i.computed(()=>p.value===null?void 0:{top:`${p.value}px`});function k(){var K;const $=(K=s.value)==null?void 0:K.parentElement;if(!$)return null;const D=$.querySelector(".block-host-content");if(!D)return null;const W=D.firstElementChild;return W instanceof HTMLElement?W:D}function E(){var B;const $=(B=s.value)==null?void 0:B.parentElement,D=k();if(!$||!D)return;const W=$.getBoundingClientRect(),K=D.getBoundingClientRect();p.value=K.top-W.top+K.height/2}function M(){const $=k();$&&(O(),b=new ResizeObserver(()=>E()),b.observe($))}function O(){b==null||b.disconnect(),b=null}i.watch(()=>r.visible,$=>{$?i.nextTick().then(()=>{E(),M()}):O()}),i.onMounted(E),i.onBeforeUnmount(O);function P(){a.value&&c.value&&o("openPlusMenu",c.value)}let te=0,z=0,H=0,ie=!1;function Q($){a.value&&(H=Date.now(),te=$.clientX,z=$.clientY,ie=!0,f.value=!1,o("gripPointerDown",r.blockId,te,z,{thresholdPx:nf}))}function ne($){f.value=$}function _(){a.value&&(f.value||ie&&Date.now()-H>rf||(ie=!1,u.value&&o("openSettingsMenu",u.value)))}return e({isOpen:d,insertBtn:c,gripBtn:u,setLocalDragging:ne}),($,D)=>(i.openBlock(),i.createElementBlock("div",{ref_key:"handleEl",ref:s,class:i.normalizeClass(["block-handle",{visible:t.visible,dragging:f.value}]),style:i.normalizeStyle(g.value)},[i.createElementVNode("div",{ref_key:"insertBtn",ref:c,class:"handle-btn handle-insert",role:"button",tabindex:"0",title:i.unref(l)("handle.plus.title"),"aria-label":i.unref(l)("handle.plus.ariaLabel"),onMousedown:i.withModifiers(P,["prevent","stop"]),onKeydown:[i.withKeys(i.withModifiers(P,["prevent","stop"]),["enter"]),i.withKeys(i.withModifiers(P,["prevent","stop"]),["space"])]},[...D[0]||(D[0]=[i.createElementVNode("svg",{viewBox:"0 0 16 16",width:"16",height:"16","aria-hidden":"true"},[i.createElementVNode("path",{d:"M8 3.5V12.5M3.5 8H12.5",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"})],-1)])],40,ef),i.createElementVNode("div",{ref_key:"gripBtn",ref:u,class:"handle-btn handle-grip",role:"button",tabindex:"0",title:i.unref(l)("handle.grip.title"),"aria-label":i.unref(l)("handle.grip.ariaLabel"),onMousedown:i.withModifiers(Q,["prevent","stop"]),onClick:i.withModifiers(_,["stop"]),onKeydown:[i.withKeys(i.withModifiers(_,["prevent","stop"]),["enter"]),i.withKeys(i.withModifiers(_,["prevent","stop"]),["space"])]},[...D[1]||(D[1]=[i.createStaticVNode('<svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><circle cx="5" cy="4" r="1.3" fill="currentColor"></circle><circle cx="11" cy="4" r="1.3" fill="currentColor"></circle><circle cx="5" cy="8" r="1.3" fill="currentColor"></circle><circle cx="11" cy="8" r="1.3" fill="currentColor"></circle><circle cx="5" cy="12" r="1.3" fill="currentColor"></circle><circle cx="11" cy="12" r="1.3" fill="currentColor"></circle></svg>',1)])],40,tf)],6))}}),lf=["data-block-id","data-block-type"],af={class:"block-host-content"},V0=i.defineComponent({__name:"BlockHost",props:{block:{},placeholder:{},hoveredBlockId:{},focusedBlockId:{},hasTextSelection:{type:Boolean},draggingBlockId:{},dropTargetBlockId:{},dropPosition:{},menuOpenBlockId:{}},emits:["openSettingsMenu","openPlusMenu","slashTrigger","inputChanged","hoverChange","gripPointerDown","gripPointerUp","linkClick","focusIn"],setup(t,{expose:e,emit:n}){const r=t,o=n,l=Yn(),a=Rr(),s=i.ref(null),c=i.ref(null),u=i.computed(()=>!a.value||r.hasTextSelection?!1:r.hoveredBlockId===r.block.id||r.hoveredBlockId===null&&r.focusedBlockId===r.block.id),d=i.computed(()=>r.draggingBlockId===r.block.id),f=i.computed(()=>r.menuOpenBlockId===r.block.id),p=i.computed(()=>r.dropTargetBlockId===r.block.id),b=i.computed(()=>r.dropPosition??"after");function g(_,$,D,W){o("gripPointerDown",_,$,D,W)}function k(_){o("gripPointerUp",_)}function E(_){var $,D;(D=($=c.value)==null?void 0:$.setLocalDragging)==null||D.call($,_)}function M(){o("hoverChange",r.block.id)}function O(){o("hoverChange",null)}function P(_){o("openPlusMenu",r.block.id,_)}function te(_){o("openSettingsMenu",r.block.id,_)}function z(_,$,D){o("slashTrigger",_,r.block.id,D)}function H(_,$){o("inputChanged",_,$)}function ie(_,$){o("linkClick",_,$)}function Q(_){o("focusIn",_)}const ne=i.computed(()=>{const _=l.registries.renderers.get(r.block.type);return _!=null&&_.component?_.component:zr});return e({setHandleDragging:E}),(_,$)=>(i.openBlock(),i.createElementBlock("div",{ref_key:"hostEl",ref:s,class:i.normalizeClass(["block-host",{"block-dragging":d.value,"block-menu-active":f.value,"block-drop-target":p.value,"block-drop-before":p.value&&b.value==="before","block-drop-after":p.value&&b.value==="after","block-drop-into":p.value&&b.value==="into","block-host-readonly":!i.unref(a),"block-focused":t.focusedBlockId===t.block.id}]),"data-block-id":t.block.id,"data-block-type":t.block.type,onMouseenter:M,onMouseleave:O},[i.unref(a)?(i.openBlock(),i.createBlock(of,{key:0,ref_key:"handleRef",ref:c,"block-id":t.block.id,visible:u.value,onOpenPlusMenu:P,onOpenSettingsMenu:te,onGripPointerDown:g,onGripPointerUp:k},null,8,["block-id","visible"])):i.createCommentVNode("",!0),i.createElementVNode("div",af,[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(ne.value),{block:t.block,placeholder:t.placeholder,onSlashTrigger:z,onInputChanged:H,onLinkClick:ie,onFocusIn:Q},null,40,["block","placeholder"]))])],42,lf))}}),U0=i.defineComponent({__name:"BlockList",props:{items:{},blocksMap:{},firstBlockPlaceholder:{},isNested:{type:Boolean},hoveredBlockId:{},focusedBlockId:{},hasTextSelection:{type:Boolean},draggingBlockId:{},dropTargetBlockId:{},dropPosition:{},menuOpenBlockId:{}},emits:["openSettingsMenu","openPlusMenu","slashTrigger","inputChanged","hoverChange","gripPointerDown","gripPointerUp","linkClick","focusIn"],setup(t,{expose:e,emit:n}){const r=t,o=n,l=new Map;function a(z,H){H?l.set(z,H):l.delete(z)}function s(z,H){var ie,Q;(Q=(ie=l.get(z))==null?void 0:ie.setHandleDragging)==null||Q.call(ie,H)}function c(z){const H=[];for(const ie of z.children){const Q=r.blocksMap.get(ie);Q&&H.push({id:ie,block:Q})}return H}const u=i.computed(()=>!r.isNested&&!r.dropTargetBlockId&&r.dropPosition==="first"&&!!r.draggingBlockId),d=i.computed(()=>!r.isNested&&!r.dropTargetBlockId&&r.dropPosition==="last"&&!!r.draggingBlockId);function f(z,H){o("openSettingsMenu",z,H)}function p(z,H){o("openPlusMenu",z,H)}function b(z,H,ie){o("slashTrigger",z,H,ie)}function g(z,H){o("inputChanged",z,H)}function k(z){o("hoverChange",z)}function E(){r.isNested||o("hoverChange",null)}function M(z,H,ie,Q){o("gripPointerDown",z,H,ie,Q)}function O(z){o("gripPointerUp",z)}function P(z,H){o("linkClick",z,H)}function te(z){o("focusIn",z)}return e({setBlockHandleDragging:s}),(z,H)=>{const ie=i.resolveComponent("BlockList",!0);return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["block-list",{"block-children":t.isNested,"drop-indicator-first":u.value,"drop-indicator-last":d.value}]),onMouseleave:E},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.items,(Q,ne)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:Q.id},[i.createVNode(V0,{ref_for:!0,ref:_=>a(Q.id,_),block:Q.block,placeholder:!t.isNested&&ne===0?t.firstBlockPlaceholder:void 0,"hovered-block-id":t.hoveredBlockId,"focused-block-id":t.focusedBlockId,"has-text-selection":t.hasTextSelection,"dragging-block-id":t.draggingBlockId,"drop-target-block-id":t.dropTargetBlockId,"drop-position":t.dropPosition,"menu-open-block-id":t.menuOpenBlockId,onOpenSettingsMenu:f,onOpenPlusMenu:p,onSlashTrigger:b,onInputChanged:g,onHoverChange:k,onGripPointerDown:M,onGripPointerUp:O,onLinkClick:P,onFocusIn:te},null,8,["block","placeholder","hovered-block-id","focused-block-id","has-text-selection","dragging-block-id","drop-target-block-id","drop-position","menu-open-block-id"]),Q.block.children.length>0?(i.openBlock(),i.createBlock(ie,{key:"__nested_"+Q.id,"is-nested":"",items:c(Q.block),"hovered-block-id":t.hoveredBlockId,"focused-block-id":t.focusedBlockId,"has-text-selection":t.hasTextSelection,"dragging-block-id":t.draggingBlockId,"drop-target-block-id":t.dropTargetBlockId,"drop-position":t.dropPosition,"menu-open-block-id":t.menuOpenBlockId,"blocks-map":t.blocksMap,onOpenSettingsMenu:H[0]||(H[0]=(_,$)=>o("openSettingsMenu",_,$)),onOpenPlusMenu:H[1]||(H[1]=(_,$)=>o("openPlusMenu",_,$)),onSlashTrigger:H[2]||(H[2]=(_,$,D)=>o("slashTrigger",_,$,D)),onInputChanged:H[3]||(H[3]=(_,$)=>o("inputChanged",_,$)),onHoverChange:H[4]||(H[4]=_=>o("hoverChange",_)),onGripPointerDown:H[5]||(H[5]=(_,$,D,W)=>o("gripPointerDown",_,$,D,W)),onGripPointerUp:H[6]||(H[6]=_=>o("gripPointerUp",_)),onLinkClick:H[7]||(H[7]=(_,$)=>o("linkClick",_,$)),onFocusIn:H[8]||(H[8]=_=>o("focusIn",_))},null,8,["items","hovered-block-id","focused-block-id","has-text-selection","dragging-block-id","drop-target-block-id","drop-position","menu-open-block-id","blocks-map"])):i.createCommentVNode("",!0)],64))),128))],34)}}});function q0(t,e,n,r=6,o="auto",l=0,a=0){const s=e instanceof HTMLElement?e.getBoundingClientRect():e,c=document.documentElement.clientHeight,u=sf(),d=Math.max(0,c-s.bottom-r-l),f=Math.max(0,s.top-r-a),p=d>=n.height+r,b=f>=n.height+r,g=o==="down"?!1:o==="up"?!0:!p&&(b||f>d);let k,E,M;const O=s.bottom+r,P=s.top-r;g?(k=Math.max(r+a,P-n.height),E=P,M=Math.max(120,f)):(k=O,E=k+n.height,M=Math.max(120,d));const te=u-n.width-r,z=Math.max(r,Math.min(te,s.left));return{top:k,left:z,above:g,availableHeight:M,bottom:E,topBaseline:O}}function Jl(t,e,n,r=8){const o=document.documentElement.clientHeight,l=document.documentElement.clientWidth,a=e.left+(e.width-n.width)/2,s=Math.max(r,Math.min(l-n.width-r,a)),c=o-e.bottom-r,u=e.top-r,d=c>=n.height,f=u>=n.height,p=!d&&(f||u>c),b=e.bottom+r,g=e.top-r,k=p?Math.max(r,g-n.height):b,E=p?g:k+n.height,M=p?Math.max(120,u):Math.max(120,c);return{top:k,left:s,above:p,availableHeight:M,bottom:E,topBaseline:b}}function ea(t,e,n,r=8){const o=document.documentElement.clientHeight,l=document.documentElement.clientWidth,a=e.left+(e.width-n.width)/2,s=Math.max(r,Math.min(l-n.width-r,a)),c=e.top-r,u=o-e.bottom-r,d=c>=n.height,f=u>=n.height,p=d||!f&&c>u||c>=u,b=e.bottom+r,g=e.top-r,k=p?Math.max(r,g-n.height):b,E=p?g:k+n.height,M=p?Math.max(120,c):Math.max(120,u);return{top:k,left:s,above:p,availableHeight:M,bottom:E,topBaseline:b}}function sf(){return document.documentElement.clientWidth}function Ui(t,e){let n=0;function r(u){const d=t.value;if(!d)return;u.preventDefault();const f=u.deltaMode===WheelEvent.DOM_DELTA_LINE?u.deltaY*22:u.deltaY;d.scrollTop+=f,e()}function o(u){u.touches.length===1&&(n=u.touches[0].clientY)}function l(u){if(u.touches.length!==1)return;const d=t.value;if(!d)return;const f=u.touches[0].clientY;d.scrollTop-=f-n,n=f,u.preventDefault(),e()}function a(u){u&&(u.addEventListener("wheel",r,{passive:!1}),u.addEventListener("touchstart",o,{passive:!0}),u.addEventListener("touchmove",l,{passive:!1}))}function s(u){u&&(u.removeEventListener("wheel",r),u.removeEventListener("touchstart",o),u.removeEventListener("touchmove",l))}let c=null;i.watch(t,(u,d,f)=>{s(c),c=u,a(u),f(()=>{s(u),c===u&&(c=null)})},{immediate:!0}),i.onBeforeUnmount(()=>{s(c),c=null})}function G0(t,e,n,r){function o(f){const p=t.value;if(!p||!f)return!1;if(f instanceof Node&&p.contains(f))return!0;if(r){const b=r(),g=Array.isArray(b)?b:[b];for(const k of g)if(k&&f instanceof Node&&k.contains(f))return!0}return!1}function l(f){e()&&(o(f.target)||n())}function a(f){e()&&(o(f.target)||n())}function s(){e()&&n()}function c(f){f&&f.addEventListener("mouseleave",s)}function u(f){f&&f.removeEventListener("mouseleave",s)}let d=null;i.watch(t,(f,p,b)=>{u(d),d=f,c(f),b(()=>{u(f),d===f&&(d=null)})},{immediate:!0}),i.onMounted(()=>{window.addEventListener("mousedown",l,!0),window.addEventListener("touchstart",l,!0),window.addEventListener("wheel",a,!0)}),i.onBeforeUnmount(()=>{window.removeEventListener("mousedown",l,!0),window.removeEventListener("touchstart",l,!0),window.removeEventListener("wheel",a,!0),u(d),d=null})}const cf=["innerHTML"],_n=i.defineComponent({__name:"SafeHtml",props:{html:{default:""}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("span",{innerHTML:t.html},null,8,cf))}}),uf=["aria-label"],df={key:0,class:"slash-menu-empty"},ff={key:0,class:"slash-menu-group-label"},hf=["aria-selected","onMousedown","onMouseenter"],mf={class:"slash-menu-text"},pf={class:"slash-menu-title"},gf={key:0,class:"slash-menu-desc"},bf=["aria-label"],ta=300,vf=80,W0=24,kf=i.defineComponent({__name:"PlusMenu",props:{visible:{type:Boolean},anchorEl:{},blockId:{},query:{},rootEl:{},mode:{default:"slash"}},emits:["close","commit"],setup(t,{expose:e,emit:n}){const r=t,o=n,{t:l}=In(),a=i.computed(()=>({basic:l("plus.category.basic"),list:l("plus.category.list"),other:l("plus.category.other")})),s=Yn(),c=i.inject(oi,i.ref(!1)),u=i.ref(null),d=i.ref(null),f=i.ref(0),p=i.ref({top:0,left:0,availableHeight:360,above:!1,bottom:0,topBaseline:0}),b=i.ref(!1),g=i.ref(!1),k=i.ref(!1),E=i.ref(!1);let M=null;i.watch(()=>r.visible,B=>{B?(M&&(clearTimeout(M),M=null),E.value=!0):M=setTimeout(()=>{E.value=!1,M=null},300)},{immediate:!0});function O(B){return typeof B=="string"?B:"•"}const P=i.computed(()=>{const B=r.query.trim().toLowerCase(),A=s.registries.slash.all;return B?A.filter(j=>(l(j.title)+" "+(j.keywords??[]).join(" ")).toLowerCase().includes(B)):A}),te=i.computed(()=>{const B=[],A=new Map;for(const F of P.value){const V=F.category??"other";A.has(V)||A.set(V,[]),A.get(V).push(F)}const j=["basic","list","other"];for(const F of j){const V=A.get(F);V&&V.length>0&&B.push({category:F,label:a.value[F]??F,items:V})}for(const[F,V]of A)j.includes(F)||B.push({category:F,label:a.value[F]??F,items:V});return B});function z(B){return P.value.findIndex(A=>A.id===B)}i.watch([P,()=>r.visible],()=>{f.value=0,i.nextTick(()=>{d.value&&(d.value.scrollTop=0),H()})});function H(){const B=d.value;B&&(g.value=B.scrollTop>1,k.value=B.scrollTop+B.clientHeight<B.scrollHeight-1)}function ie(){const B=d.value;B&&(B.scrollTop-=B.clientHeight*.8)}function Q(){const B=d.value;B&&(B.scrollTop+=B.clientHeight*.8)}Ui(d,H),i.watch(()=>r.visible,B=>{B&&(b.value=!1,p.value={top:0,left:0,availableHeight:360,above:!1,bottom:0,topBaseline:0})}),i.watch([()=>r.visible,()=>r.anchorEl,u,P,g,k],async()=>{if(!r.visible||!r.anchorEl||!r.rootEl)return;await i.nextTick();const B=u.value;if(!B)return;const A=B.getBoundingClientRect(),j=!!r.anchorEl.closest(".fixed-toolbar"),F=j?c.value?"up":"down":"auto",V=j?10:0,fe=q0(r.rootEl,r.anchorEl,{width:ta,height:A.height},6,F,V,V);p.value=fe,b.value=!0,i.nextTick(H)},{flush:"post"});const ne=i.computed(()=>{if(!r.rootEl)return{display:"none"};if(!b.value)return{visibility:"hidden",top:"0px",left:"0px",width:`${ta}px`,"--scroll-max-height":"100vh"};const B=p.value.above,A=p.value.left,j=(g.value?W0:0)+(k.value?W0:0),F=p.value.availableHeight-j,V={left:`${A}px`,width:`${ta}px`,maxHeight:`${p.value.availableHeight}px`,"--scroll-max-height":`${Math.max(vf,F)}px`};if(B){const fe=document.documentElement.clientHeight;V.bottom=`${Math.max(0,fe-p.value.bottom)}px`,V.top="auto"}else V.top=`${p.value.top}px`,V.bottom="auto";return V});function _(B){if(P.value.length===0)return;const A=P.value.length;f.value=((f.value+B)%A+A)%A,$()}function $(){var j;const B=(j=d.value)==null?void 0:j.querySelectorAll(".slash-menu-item"),A=B==null?void 0:B[f.value];A&&A.scrollIntoView({block:"nearest"}),i.nextTick(H)}function D(B){switch(B.key){case"ArrowDown":return B.preventDefault(),_(1),!0;case"ArrowUp":return B.preventDefault(),_(-1),!0;case"PageDown":return B.preventDefault(),_(5),!0;case"PageUp":return B.preventDefault(),_(-5),!0;case"Home":return B.preventDefault(),f.value=0,$(),!0;case"End":return B.preventDefault(),f.value=Math.max(0,P.value.length-1),$(),!0;case"Enter":return B.preventDefault(),W(),!0;case"Escape":return B.preventDefault(),o("close"),!0;default:return!1}}function W(){const B=P.value[f.value];B&&o("commit",B,r.mode),o("close")}function K(B){const A=P.value.indexOf(B);A>=0&&(f.value=A),W()}return e({onKeyDown:D}),G0(u,()=>r.visible,()=>o("close"),()=>r.anchorEl),i.onMounted(()=>{window.addEventListener("resize",H)}),i.onBeforeUnmount(()=>{window.removeEventListener("resize",H)}),(B,A)=>(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[E.value&&t.rootEl?(i.openBlock(),i.createElementBlock("div",{key:0,ref_key:"menuEl",ref:u,class:i.normalizeClass(["plus-menu slash-menu",{"menu-closing":!t.visible}]),style:i.normalizeStyle(ne.value),role:"listbox"},[g.value?(i.openBlock(),i.createElementBlock("button",{key:0,class:"menu-scroll-btn menu-scroll-up",type:"button","aria-label":i.unref(l)("ui.scrollUp"),onMousedown:i.withModifiers(ie,["prevent"])},[...A[0]||(A[0]=[i.createElementVNode("svg",{viewBox:"0 0 12 12",width:"10",height:"10","aria-hidden":"true"},[i.createElementVNode("path",{d:"M3 7.5L6 4.5L9 7.5",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],40,uf)):i.createCommentVNode("",!0),i.createElementVNode("div",{ref_key:"scrollEl",ref:d,class:"slash-menu-scroll",onScroll:H},[P.value.length===0?(i.openBlock(),i.createElementBlock("div",df,i.toDisplayString(i.unref(l)("plus.noMatch")),1)):(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(te.value,j=>(i.openBlock(),i.createElementBlock("div",{key:j.category,class:"slash-menu-group"},[j.label?(i.openBlock(),i.createElementBlock("div",ff,i.toDisplayString(j.label),1)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(j.items,F=>(i.openBlock(),i.createElementBlock("div",{key:F.id,class:i.normalizeClass(["slash-menu-item",{active:z(F.id)===f.value}]),"aria-selected":z(F.id)===f.value,role:"option",onMousedown:i.withModifiers(V=>K(F),["prevent"]),onMouseenter:V=>f.value=z(F.id)},[i.createVNode(_n,{class:"slash-menu-icon",html:O(F.icon)},null,8,["html"]),i.createElementVNode("div",mf,[i.createElementVNode("div",pf,i.toDisplayString(i.unref(l)(F.title)),1),F.description?(i.openBlock(),i.createElementBlock("div",gf,i.toDisplayString(i.unref(l)(F.description)),1)):i.createCommentVNode("",!0)])],42,hf))),128))]))),128))],544),k.value?(i.openBlock(),i.createElementBlock("button",{key:1,class:"menu-scroll-btn menu-scroll-down",type:"button","aria-label":i.unref(l)("ui.scrollDown"),onMousedown:i.withModifiers(Q,["prevent"])},[...A[1]||(A[1]=[i.createElementVNode("svg",{viewBox:"0 0 12 12",width:"10",height:"10","aria-hidden":"true"},[i.createElementVNode("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],40,bf)):i.createCommentVNode("",!0)],6)):i.createCommentVNode("",!0)]))}}),yf=["left","center","right","justify"],wf=10,Rn={align:{default:"left",validate:t=>yf.includes(t)},color:{default:"default",validate:t=>typeof t=="string"&&t.length>0},bgColor:{default:"default",validate:t=>typeof t=="string"&&t.length>0},indent:{default:0,validate:t=>typeof t=="number"&&Number.isInteger(t)&&t>=0&&t<=wf}},xf={align:Rn.align,color:Rn.color,bgColor:Rn.bgColor},Ef={indent:Rn.indent};function Jn(t){const e=[],n=t.align;typeof n=="string"&&n!=="left"&&e.push(`be-align-${n}`);const r=t.color;typeof r=="string"&&r!=="default"&&e.push(`be-color-${r}`);const o=t.bgColor;typeof o=="string"&&o!=="default"&&e.push(`be-bg-${o}`);const l=t.indent;return typeof l=="number"&&l>0&&e.push(`be-indent-${l}`),e}const K0=[{key:"default",label:"Default",cssValue:"var(--be-fg)",opacity:1},{key:"gray",label:"Gray",cssValue:"var(--be-color-gray)",opacity:1},{key:"brown",label:"Brown",cssValue:"var(--be-color-brown)",opacity:1},{key:"orange",label:"Orange",cssValue:"var(--be-color-orange)",opacity:1},{key:"yellow",label:"Yellow",cssValue:"var(--be-color-yellow)",opacity:1},{key:"green",label:"Green",cssValue:"var(--be-color-green)",opacity:1},{key:"blue",label:"Blue",cssValue:"var(--be-color-blue)",opacity:1},{key:"purple",label:"Purple",cssValue:"var(--be-color-purple)",opacity:1},{key:"pink",label:"Pink",cssValue:"var(--be-color-pink)",opacity:1},{key:"red",label:"Red",cssValue:"var(--be-color-red)",opacity:1}],Y0=[{key:"default",label:"None",cssValue:"transparent",opacity:0},{key:"gray",label:"Gray",cssValue:"var(--be-swatch-bg-gray)",opacity:.15,displayCssValue:"var(--be-swatch-display-bg-gray)"},{key:"brown",label:"Brown",cssValue:"var(--be-swatch-bg-brown)",opacity:.18,displayCssValue:"var(--be-swatch-display-bg-brown)"},{key:"orange",label:"Orange",cssValue:"var(--be-swatch-bg-orange)",opacity:.18,displayCssValue:"var(--be-swatch-display-bg-orange)"},{key:"yellow",label:"Yellow",cssValue:"var(--be-swatch-bg-yellow)",opacity:.18,displayCssValue:"var(--be-swatch-display-bg-yellow)"},{key:"green",label:"Green",cssValue:"var(--be-swatch-bg-green)",opacity:.18,displayCssValue:"var(--be-swatch-display-bg-green)"},{key:"blue",label:"Blue",cssValue:"var(--be-swatch-bg-blue)",opacity:.18,displayCssValue:"var(--be-swatch-display-bg-blue)"},{key:"purple",label:"Purple",cssValue:"var(--be-swatch-bg-purple)",opacity:.18,displayCssValue:"var(--be-swatch-display-bg-purple)"},{key:"pink",label:"Pink",cssValue:"var(--be-swatch-bg-pink)",opacity:.18,displayCssValue:"var(--be-swatch-display-bg-pink)"},{key:"red",label:"Red",cssValue:"var(--be-swatch-bg-red)",opacity:.18,displayCssValue:"var(--be-swatch-display-bg-red)"}],na='<svg viewBox="0 0 1024 1024" width="16" height="16" aria-hidden="true"><path d="M426.666667 939.050667a32 32 0 1 1 0-64h53.333333V160H235.093333V170.666667a32 32 0 0 1-27.648 31.701333l-4.352 0.298667A32 32 0 0 1 171.093333 170.666667V128a32 32 0 0 1 32-32H820.693333a32 32 0 0 1 31.701334 27.648l0.298666 4.352v42.666667a32 32 0 1 1-64 0l-0.042666-10.666667H544v715.050667H597.333333a32 32 0 0 1 31.701334 27.648l0.298666 4.352a32 32 0 0 1-32 32h-170.666666z" fill="currentColor"/></svg>',Ro="M544 170.922667a32 32 0 0 1 32 32v618.666666a32 32 0 1 1-64 0V544H192v277.674667a32 32 0 0 1-27.648 31.701333l-4.352 0.298667a32 32 0 0 1-32-32v-618.666667a32 32 0 0 1 64 0v276.992H512V202.922667a32 32 0 0 1 27.648-31.701334l4.352-0.298666z",ra=`<svg viewBox="0 0 1024 1024" width="16" height="16" aria-hidden="true"><path d="${Ro} M848.512 366.933333A32 32 0 0 1 896 394.965333v426.666667a32 32 0 1 1-64 0v-372.565333l-80.554667 44.416a32 32 0 0 1-41.130666-8.96l-2.346667-3.626667a32 32 0 0 1 12.586667-43.477333l128-70.485334z" fill="currentColor"/></svg>`,oa=`<svg viewBox="0 0 1024 1024" width="16" height="16" aria-hidden="true"><path d="${Ro} M786.133333 362.666667a152.661333 152.661333 0 0 1 107.946667 260.693333l-166.058667 165.973333h178.773334a32 32 0 0 1 31.744 27.648l0.256 4.352a32 32 0 0 1-32 32h-256a32 32 0 0 1-22.613334-54.613333l220.672-220.672A88.661333 88.661333 0 0 0 786.133333 426.666667h-7.338666a96 96 0 0 0-96 96v20.565333a32 32 0 0 1-64 0v-20.565333a160 160 0 0 1 160-160h7.338666z" fill="currentColor"/></svg>`,ia=`<svg viewBox="0 0 1024 1024" width="16" height="16" aria-hidden="true"><path d="${Ro} m362.410667 192a32 32 0 0 1 22.613333 54.656L809.813333 536.746667l1.792 0.341333a160.085333 160.085333 0 0 1 126.506667 148.053333l0.256 8.490667a160 160 0 0 1-310.912 53.248 32 32 0 0 1 60.373333-21.333333 96 96 0 1 0 90.538667-127.914667h-42.666667a32 32 0 0 1-22.613333-54.613333l116.010667-116.053334h-178.773334a32 32 0 0 1-31.701333-27.648l-0.256-4.352a32 32 0 0 1 32-32h256z" fill="currentColor"/></svg>`,la=`<svg viewBox="0 0 1024 1024" width="16" height="16" aria-hidden="true"><path d="${Ro} m244.309333 193.493333a32 32 0 0 1 20.992 40.106667l-93.738666 299.776h116.48v-96a32 32 0 0 1 64 0v96h10.666666a32 32 0 0 1 31.744 27.648l0.298667 4.352a32 32 0 0 1-32 32H896v53.333333a32 32 0 1 1-64 0v-53.333333h-160a32 32 0 0 1-30.506667-41.557334l106.666667-341.333333a32 32 0 0 1 40.106667-20.992z" fill="currentColor"/></svg>`,aa=`<svg viewBox="0 0 1024 1024" width="16" height="16" aria-hidden="true"><path d="${Ro} m363.477333 192.426666a32 32 0 1 1 0 64h-145.706666l-28.245334 113.450667 5.12-1.493333a160.042667 160.042667 0 0 1 100.949334 6.4l9.472 4.266666a160 160 0 1 1-189.610667 249.856 32 32 0 0 1 48-42.325333 96 96 0 1 0 0-126.976c-22.186667 25.130667-63.146667 3.584-55.04-28.928l53.333333-214.016a32 32 0 0 1 31.061334-24.234667h170.666666z" fill="currentColor"/></svg>`,sa=`<svg viewBox="0 0 1024 1024" width="16" height="16" aria-hidden="true"><path d="${Ro} m292.522667 153.173333a32 32 0 0 1 12.586666 43.52l-93.141333 168.874667a159.957333 159.957333 0 0 1 102.4 19.712 158.848 158.848 0 0 1 58.581333 217.685333 160.426667 160.426667 0 0 1-218.453333 58.24 158.890667 158.890667 0 0 1-62.762667-209.962667l157.312-285.44a32 32 0 0 1 43.52-12.586666z m-141.226667 322.517333a94.890667 94.890667 0 0 0 35.072 130.048 96.426667 96.426667 0 0 0 131.242667-34.901333 94.848 94.848 0 0 0-35.114667-130.048 96.426667 96.426667 0 0 0-131.242667 34.901333z" fill="currentColor"/></svg>`,ca='<svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="3" cy="4" r="1.1" fill="currentColor" stroke="none"/><circle cx="3" cy="8" r="1.1" fill="currentColor" stroke="none"/><circle cx="3" cy="12" r="1.1" fill="currentColor" stroke="none"/><line x1="6.5" y1="4" x2="13.5" y2="4"/><line x1="6.5" y1="8" x2="13.5" y2="8"/><line x1="6.5" y1="12" x2="13.5" y2="12"/></svg>',ua='<svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2.3 3.7L3.1 2.8L3.1 5.8" stroke-width="1.1"/><line x1="6.5" y1="4" x2="13.5" y2="4" stroke-width="1.3"/><path d="M1.8 7.4C1.8 6.6 4.2 6.6 4.2 7.4C4.2 8.2 1.8 9.5 1.8 9.5L4.2 9.5" stroke-width="1.1"/><line x1="6.5" y1="8" x2="13.5" y2="8" stroke-width="1.3"/><path d="M4.2 11.2C4.2 10.5 3 10.5 1.8 11.5C1.8 12 3 12 3 12C3 12 4.2 12 4.2 13C4.2 13.5 3 13.5 1.8 12.8" stroke-width="1.1"/><line x1="6.5" y1="12" x2="13.5" y2="12" stroke-width="1.3"/></svg>',da='<svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="2.5" y="2.5" width="11" height="11" rx="2.5"/><path d="M5.5 8L7 9.8L10.8 5.8"/></svg>',fa='<svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="2.5" y="3" width="2" height="10" rx="1" fill="currentColor" stroke="none"/><line x1="6.5" y1="5" x2="13" y2="5"/><line x1="6.5" y1="8" x2="13" y2="8"/><line x1="6.5" y1="11" x2="10" y2="11"/></svg>',ha='<svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 4L2 8L5 12"/><path d="M11 4L14 8L11 12"/><line x1="10" y1="3" x2="6" y2="13"/></svg>',Cf='<svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><line x1="2" y1="8" x2="14" y2="8"/></svg>',Sf='<svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2 3.5h10M2 8h10M2 12.5h10"/><path d="M14.5 3.5v.01M14.5 8v.01M14.5 12.5v.01"/></svg>',Tf='<svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="2" y="3" width="12" height="10" rx="1.5"/><circle cx="5.5" cy="6.5" r="1.1" fill="currentColor" stroke="none"/><path d="M13 11.5L10 8.5L7 11.5L5 9.5L3 11.5"/></svg>',Mf='<svg viewBox="0 0 24 24" width="20" height="20" aria-hidden="true"><g fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round"><path d="M12 3a9 9 0 0 1 9 9" opacity="0.25"/><path d="M12 3a9 9 0 0 0-9 9" class="be-spinner-arc"/></g></svg>',Af='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 8a5 5 0 0 1 8.5-3.5M13 3v3h-3"/><path d="M13 8a5 5 0 0 1-8.5 3.5M3 13v-3h3"/></svg>',Nf='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 4L12 12"/><path d="M12 4L4 12"/></svg>',Bf='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2 5H12M9 2L12 5L9 8"/><path d="M14 11H4M7 8L4 11L7 14"/></svg>',If='<svg viewBox="0 0 1024 1024" width="32" height="32" aria-hidden="true"><path d="M768.35456 416a256 256 0 1 0-512 0 192 192 0 1 0 0 384v64a256 256 0 0 1-58.88-505.216 320.128 320.128 0 0 1 629.76 0A256.128 256.128 0 0 1 768.35456 864v-64a192 192 0 0 0 0-384z m-512 384h128v64H256.35456v-64z m384 0h128v64h-128v-64z" fill="currentColor"/><path d="M539.04256 589.184v333.056a32.448 32.448 0 0 1-32 32.192 32.448 32.448 0 0 1-32-32.192V589.184l-36.096 36.096a32.192 32.192 0 0 1-45.056-0.192 31.616 31.616 0 0 1-0.192-45.056l90.88-90.88a31.36 31.36 0 0 1 22.528-9.152 30.08 30.08 0 0 1 22.4 9.088l90.88 90.944a32.192 32.192 0 0 1-0.192 45.056 31.616 31.616 0 0 1-45.056 0.192l-36.096-36.096z" fill="currentColor"/></svg>',_f='<svg viewBox="0 0 1024 1024" width="16" height="16" aria-hidden="true"><path d="M611.82976 512L300.4928 200.92928l545.2288-0.29696-0.04096-84.44928-667.36128 0.3584-0.04096 82.05312L492.34944 512 179.47648 824.60672l-1.19808 1.20832 0.04096 81.64352 667.36128 0.3584 0.04096-84.44928-545.2288-0.29696L611.82976 512z" fill="currentColor"/></svg>',Rf='<svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M10.5 2.5L13.5 5.5L6 13L3 13L3 10z"/><path d="M9 4L12 7"/></svg>',Lf=["aria-label"],Of={class:"bsm-group"},Df={class:"bsm-icon-grid"},zf=["title","onMousedown","onMouseenter"],Hf={key:1,class:"bsm-group"},Pf={class:"bsm-collapse-title"},$f={class:"bsm-collapse-body"},Ff={class:"bsm-row"},Vf=["disabled","title","onMousedown"],Uf={viewBox:"0 0 16 16",width:"15",height:"15","aria-hidden":"true"},qf={class:"bsm-row"},Gf=["disabled","title"],Wf=["disabled","title"],Kf={key:2,class:"bsm-group"},Yf={class:"bsm-collapse-title"},Xf={class:"bsm-collapse-body"},Zf={class:"bsm-row"},jf=["disabled","title"],Qf=["disabled","title"],Jf={key:3,class:"bsm-group bsm-colors"},e6={class:"bsm-collapse-title"},t6={class:"bsm-collapse-body"},n6={class:"bsm-swatches"},r6=["title","disabled","onMousedown"],o6={key:4,class:"bsm-group bsm-colors"},i6={class:"bsm-collapse-title"},l6={class:"bsm-collapse-body"},a6={class:"bsm-swatches"},s6=["title","disabled","onMousedown"],c6={class:"bsm-group"},u6=["onMousedown","onMouseenter"],d6={class:"bsm-title"},f6={key:1,class:"bsm-shortcut"},h6=["aria-label"],ma=260,m6=80,X0=24,p6='<svg viewBox="0 0 16 16" width="14" height="14"><rect x="5" y="5" width="8" height="8" rx="1.5" fill="none" stroke="currentColor" stroke-width="1.2"/><path d="M3 10.5V3.5C3 2.67 3.67 2 4.5 2H10" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/></svg>',g6='<svg viewBox="0 0 16 16" width="14" height="14"><rect x="5" y="5" width="8" height="8" rx="1.5" fill="none" stroke="currentColor" stroke-width="1.2"/><path d="M3 10.5V3.5C3 2.67 3.67 2 4.5 2H10" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/></svg>',b6='<svg viewBox="0 0 16 16" width="14" height="14"><circle cx="4.5" cy="11.5" r="1.8" fill="none" stroke="currentColor" stroke-width="1.2"/><circle cx="11.5" cy="11.5" r="1.8" fill="none" stroke="currentColor" stroke-width="1.2"/><line x1="6" y1="10" x2="13" y2="3" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/><line x1="10" y1="10" x2="3" y2="3" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/></svg>',v6='<svg viewBox="0 0 16 16" width="14" height="14"><path d="M8 12V4M4 8L8 4L12 8" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/></svg>',k6='<svg viewBox="0 0 16 16" width="14" height="14"><path d="M8 4V12M4 8L8 12L12 8" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/></svg>',y6='<svg viewBox="0 0 16 16" width="14" height="14"><path d="M3.5 4.5H12.5M6.5 4.5V3C6.5 2.45 6.95 2 7.5 2H8.5C9.05 2 9.5 2.45 9.5 3V4.5M5 4.5L5.5 13C5.55 13.55 6 14 6.55 14H9.45C10 14 10.45 13.55 10.5 13L11 4.5" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/></svg>',w6='<svg viewBox="0 0 1024 1024" width="14" height="14" aria-hidden="true"><path d="M597.333333 451.669333l55.168-55.168a42.666667 42.666667 0 0 1 60.330667 60.330667L657.664 512l55.168 55.168a42.666667 42.666667 0 0 1-60.330667 60.330667L597.333333 572.330667l-55.168 55.168a42.666667 42.666667 0 0 1-60.330666-60.330667L537.002667 512l-55.168-55.168a42.666667 42.666667 0 0 1 60.330666-60.330667L597.333333 451.669333zM874.581333 832H376.32c-47.402667 0-106.730667-25.941333-138.752-60.672l-163.178667-176.938667c-42.325333-45.866667-42.346667-118.869333 0-164.778666l163.2-176.938667C269.525333 218.026667 329.045333 192 376.32 192h498.24A106.666667 106.666667 0 0 1 981.333333 298.837333v426.325334A106.752 106.752 0 0 1 874.581333 832z m0-85.333333C886.4 746.666667 896 737.088 896 725.162667V298.837333c0-11.946667-9.514667-21.504-21.418667-21.504H376.32c-23.466667 0-60.224 16.064-76.010667 33.194667l-163.2 176.917333c-12.181333 13.226667-12.16 35.882667 0 49.109334l163.2 176.917333C316.16 730.666667 352.746667 746.666667 376.32 746.666667h498.24z" fill="currentColor"/></svg>',Z0='<svg viewBox="0 0 1024 1024" width="14" height="14" aria-hidden="true"><path d="M672.01024 896l-320 0c-17.67424 0-32.01024-14.336-32.01024-32.01024l0-352.01024-128 0c-12.94336 0-24.61696-7.80288-29.57312-19.7632s-2.21184-25.72288 6.94272-34.87744l320-320c12.4928-12.4928 32.768-12.4928 45.2608 0l320 320c9.15456 9.15456 11.89888 22.91712 6.94272 34.87744s-16.62976 19.7632-29.57312 19.7632l-128 0 0 352.01024c0 17.67424-14.336 32.01024-32.01024 32.01024zM384 832l256 0 0-352.01024c0-17.67424 14.336-32.01024 32.01024-32.01024l82.7392 0-242.74944-242.74944-242.74944 242.74944 82.7392 0c17.67424 0 32.01024 14.336 32.01024 32.01024l0 352.01024z" fill="currentColor"/></svg>',x6='<svg viewBox="0 0 1024 1024" width="14" height="14" aria-hidden="true"><path d="M512.00988746 141.21142578c10.45623779 0 19.24145531 3.50024414 26.37542748 10.71331811l259.5421145 259.55200196C805.03668189 418.58105492 808.63085938 427.33660865 808.63085938 437.84228516c0 10.60949731-3.53485132 19.46887183-10.56994606 26.46936011-7.02026391 7.00543237-15.88952661 10.60949731-26.50891137 10.60949731-10.44140625 0-19.22167969-3.60900903-26.35565185-10.71331811L549.09863305 267.79370094V845.7097168c0 10.19915748-3.62384057 18.94976782-10.89624071 26.16284179-7.23284888 7.31195068-15.97357177 10.91601563-26.2122798 10.91601563-10.23376465 0-18.959656-3.60900903-26.22216796-10.91601563-7.24273705-7.21307397-10.87646508-15.96862769-10.87646508-26.16284179V267.79370094l-196.10760522 196.41906761C271.65484619 471.31213355 262.87951684 474.92114258 252.41833496 474.92114258c-10.61938477 0-19.45898438-3.60900903-26.4990232-10.60949731C218.86444068 457.31115699 215.36914062 448.45178247 215.36914062 437.84228516c0-10.50567651 3.55462623-19.26123023 10.69354248-26.36553931l259.53717042-259.55200196C492.7288816 144.71166992 501.52398658 141.21142578 511.97033691 141.21142578h0.03955055z" fill="currentColor"/></svg>',E6='<svg viewBox="0 0 1024 1024" width="14" height="14" aria-hidden="true"><path d="M511.99011254 141.21142578c10.23376465 0 18.95471191 3.60900903 26.2122798 10.81713891 7.25262451 7.20812988 10.86657691 15.96862769 10.86657763 26.2666626v577.89129615l196.1619873-196.43884254c7.099365-7.00543237 15.90435815-10.61444068 26.34082031-10.61444139 10.61938477 0 19.43426538 3.50518822 26.51385474 10.51062059 7.04498291 7.10430908 10.54522705 15.96862769 10.54522706 26.57318092 0 10.40679908-3.54473877 19.16235352-10.69354248 26.37542748l-259.55694604 259.48278761C531.23156714 879.28833008 522.44635033 882.78857422 512.00988746 882.78857422c-10.45623779 0-19.24145531-3.50024414-26.3704834-10.71331811l-259.55200195-259.48278761C218.94848656 605.37939453 215.36914062 596.62384009 215.36914062 586.21704102c0-10.60949731 3.52496314-19.46887183 10.56994606-26.57318092C232.99395776 552.63842773 241.82861328 549.12829614 252.44799805 549.12829614c10.42163062 0 19.2167356 3.60900903 26.36553931 10.61444068l196.1125493 196.43884253V178.29522729c0-10.30297828 3.60900903-19.05853271 10.88635255-26.2666626C493.05517555 144.81549073 501.80084252 141.21142578 512.02966309 141.21142578h-0.03955055z" fill="currentColor"/></svg>',C6='<svg viewBox="0 0 100 100" width="14" height="14" aria-hidden="true"><path fill="currentColor" d="M 75,28.5 L 71,32 C 67,26.8 61.5,22.5 53.5,22.5 C 38,22.5 24.5,34.5 24.5,50 C 24.5,65.5 38,77.5 53.5,77.5 C 61.5,77.5 67,73.2 71,68 L 75,71.5 C 70,77.8 62.5,83 53.5,83 C 34.5,83 19,68.5 19,50 C 19,31.5 34.5,17 53.5,17 C 62.5,17 70,22.2 75,28.5 Z"/></svg>',S6='<svg viewBox="0 0 100 100" width="14" height="14" aria-hidden="true"><path fill="currentColor" fill-rule="evenodd" d="M 22,17 H 49 C 68,17 79,30.5 79,50 C 79,69.5 68,83 49,83 H 22 Z M 27.5,22.5 H 48.5 C 64.5,22.5 73.5,33.5 73.5,50 C 73.5,66.5 64.5,77.5 48.5,77.5 H 27.5 Z"/></svg>',T6='<svg viewBox="0 0 100 100" width="14" height="14" aria-hidden="true"><path fill="currentColor" d="M 20,17 L 26.5,17 L 50,46.2 L 73.5,17 L 80,17 L 53.8,50 L 80,83 L 73.5,83 L 50,53.8 L 26.5,83 L 20,83 L 46.2,50 Z"/></svg>',M6='<svg viewBox="0 0 1024 1024" width="14" height="14" aria-hidden="true"><path d="M768 597.333333h-85.333333V426.666667h85.333333c94.250667 0 170.666667-76.416 170.666667-170.666667S862.250667 85.333333 768 85.333333c-94.261333 0-170.666667 76.416-170.666667 170.666667v85.333333H426.666667v-85.333333c0-94.250667-76.416-170.666667-170.666667-170.666667S85.333333 161.749333 85.333333 256s76.416 170.666667 170.666667 170.666667h85.333333v170.666666h-85.333333c-94.250667 0-170.666667 76.416-170.666667 170.666667s76.416 170.666667 170.666667 170.666667c94.261333 0 170.666667-76.416 170.666667-170.666667v-85.333333h170.666666v85.12l-0.010666 0.213333c0 94.250667 76.416 170.666667 170.666666 170.666667s170.666667-76.416 170.666667-170.666667S862.250667 597.354667 768 597.333333z m0-426.666666a85.333333 85.333333 0 0 1 0 170.666666h-85.333333v-85.333333a85.333333 85.333333 0 0 1 85.333333-85.333333z m-597.333333 85.333333a85.333333 85.333333 0 0 1 170.666666 0v85.333333h-85.333333c-47.125333 0-85.333333-38.218667-85.333333-85.333333z m85.333333 597.333333a85.333333 85.333333 0 0 1 0-170.666666h85.333333v85.333333a85.333333 85.333333 0 0 1-85.333333 85.333333z m170.666667-256V426.666667h170.666666v170.666666H426.666667z m341.333333 256a85.333333 85.333333 0 0 1-85.333333-85.333333v-85.333333h85.322666A85.333333 85.333333 0 0 1 768 853.333333z" fill="currentColor"/></svg>',A6='<svg viewBox="0 0 100 100" width="14" height="14" aria-hidden="true"><rect x="8" y="8" width="84" height="84" rx="16" fill="none" stroke="currentColor" stroke-width="4.8" stroke-linecap="round" stroke-linejoin="round"/><path fill="currentColor" d="M 43.5,32 C 40.3,30.3 36.3,29.5 31.5,29.5 C 20.5,29.5 14,38.2 14,50 C 14,61.8 20.5,70.5 31.5,70.5 C 36.3,70.5 40.3,69.7 43.5,68 L 43.5,60.5 C 40.5,62.8 36.5,64 32,64 C 23.7,64 20,58 20,50 C 20,42 23.7,36 32,36 C 36.5,36 40.5,37.2 43.5,39.5 Z M 50,32 H 56 V 41.5 H 59.5 V 47.5 H 56 V 62 C 56,64.2 57,65 59,65 H 60 V 70.5 C 58.5,70.8 56.7,71 54.5,71 C 50,71 48,68.5 48,63 V 47.5 H 44.5 V 41.5 H 48 V 32 Z M 62.5,41.5 H 68 V 47 C 70,43.2 73,41.5 76.5,41.5 V 47.5 C 74,47.5 71,49 68.5,52.5 V 70.5 H 62.5 V 41.5 Z M 79.5,32 H 85.5 V 70.5 H 79.5 Z"/></svg>',N6=i.defineComponent({__name:"BlockSettingsMenu",props:{visible:{type:Boolean},anchorEl:{},blockId:{},rootEl:{}},emits:["close"],setup(t,{expose:e,emit:n}){const r=t,o=n,{t:l}=In(),a=Yn(),s=i.inject(oi,i.ref(!1)),c=i.ref(null),u=i.ref(null),d=i.ref("paragraph"),f=i.ref({top:0,left:0,availableHeight:520,above:!1,bottom:0,topBaseline:0}),p=i.ref(!1),b=i.ref(!1),g=i.ref(!1),k=i.reactive({alignIndent:!1,indent:!1,textColor:!1,bgColor:!1}),E=i.ref(!1);let M=null;i.watch(()=>r.visible,Y=>{Y?(M&&(clearTimeout(M),M=null),E.value=!0):M=setTimeout(()=>{E.value=!1,M=null},300)},{immediate:!0});const O=i.shallowRef(a.getState());let P=null;const te=i.computed(()=>r.blockId!=null?O.value.doc.blocks.get(r.blockId):void 0),z=i.ref(void 0),H=i.computed(()=>{var L;const Y=(L=te.value)==null?void 0:L.attrs.align;return typeof Y=="string"?Y:"left"}),ie=i.computed(()=>{const Y=z.value;return Y?!("align"in a.registries.schema.get(Y).attrs):!0}),Q=i.computed(()=>z.value==="image"||z.value==="table"),ne=i.computed(()=>z.value==="divider"||z.value==="tableOfContents"),_=i.computed(()=>z.value==="equation"),$=i.computed(()=>z.value==="divider"||z.value==="table"||z.value==="tableOfContents"||z.value==="equation"),D=i.computed(()=>{const Y=z.value;if(!Y)return!0;const L=a.registries.schema.get(Y);return!("color"in L.attrs)||!("bgColor"in L.attrs)}),W=i.computed(()=>{const Y=te.value;return Y?Ir(O.value.doc,Y.id):0});function K(Y){return["paragraph","heading","orderedList","bulletList","todoList"].includes(Y)}const B=i.computed(()=>!!z.value),A=i.computed(()=>{const Y=te.value;if(!Y)return!0;const L=O.value.doc,re=Bl(L,Y.id);return!re||!K(re.type)||Ir(L,re.id)>=10}),j=i.computed(()=>W.value<=0),F=i.computed(()=>{var L;const Y=(L=te.value)==null?void 0:L.attrs.color;return typeof Y=="string"?Y:"default"}),V=i.computed(()=>{var L;const Y=(L=te.value)==null?void 0:L.attrs.bgColor;return typeof Y=="string"?Y:"default"});function fe(Y,L){var Ve,tn;const re=r.blockId;!re||!a.getState().doc.blocks.get(re)||(tn=(Ve=a.commands).convertBlock)==null||tn.call(Ve,{id:re,type:Y,attrs:L})}const Ee=i.computed(()=>[{id:"paragraph",iconHtml:na,title:l("turnInto.paragraph"),kind:"turnInto",run:()=>void fe("paragraph")},{id:"h1",iconHtml:ra,title:l("turnInto.h1"),kind:"turnInto",run:()=>void fe("heading",{level:1})},{id:"h2",iconHtml:oa,title:l("turnInto.h2"),kind:"turnInto",run:()=>void fe("heading",{level:2})},{id:"h3",iconHtml:ia,title:l("turnInto.h3"),kind:"turnInto",run:()=>void fe("heading",{level:3})},{id:"h4",iconHtml:la,title:l("turnInto.h4"),kind:"turnInto",run:()=>void fe("heading",{level:4})},{id:"h5",iconHtml:aa,title:l("turnInto.h5"),kind:"turnInto",run:()=>void fe("heading",{level:5})},{id:"h6",iconHtml:sa,title:l("turnInto.h6"),kind:"turnInto",run:()=>void fe("heading",{level:6})},{id:"bullet",iconHtml:ca,title:l("turnInto.bullet"),kind:"turnInto",run:()=>void fe("bulletList")},{id:"ordered",iconHtml:ua,title:l("turnInto.ordered"),kind:"turnInto",run:()=>void fe("orderedList")},{id:"todo",iconHtml:da,title:l("turnInto.todo"),kind:"turnInto",run:()=>void fe("todoList",{checked:!1})},{id:"quote",iconHtml:fa,title:l("turnInto.quote"),kind:"turnInto",run:()=>void fe("quote")},{id:"code",iconHtml:ha,title:l("turnInto.code"),kind:"turnInto",run:()=>void fe("codeBlock",{language:"plain"})}]);function Me(Y){const L=te.value;if(!L)return!1;switch(Y){case"paragraph":return L.type==="paragraph";case"h1":return L.type==="heading"&&Number(L.attrs.level)===1;case"h2":return L.type==="heading"&&Number(L.attrs.level)===2;case"h3":return L.type==="heading"&&Number(L.attrs.level)===3;case"h4":return L.type==="heading"&&Number(L.attrs.level)===4;case"h5":return L.type==="heading"&&Number(L.attrs.level)===5;case"h6":return L.type==="heading"&&Number(L.attrs.level)===6;case"bullet":return L.type==="bulletList";case"ordered":return L.type==="orderedList";case"todo":return L.type==="todoList";case"quote":return L.type==="quote";case"code":return L.type==="codeBlock";default:return!1}}function ae(Y){return Me(Y)}i.watch(()=>r.visible,Y=>{var re;if(!Y)return;z.value=r.blockId!=null?(re=O.value.doc.blocks.get(r.blockId))==null?void 0:re.type:void 0;const L=Ee.value.find(Je=>Me(Je.id));d.value=L?L.id:"paragraph",k.alignIndent=!1,k.indent=!1,k.textColor=!1,k.bgColor=!1},{immediate:!0});const Te=i.computed(()=>{const Y=[{id:"align-left",value:"left",title:l("align.left"),run:()=>He("left")},{id:"align-center",value:"center",title:l("align.center"),run:()=>He("center")},{id:"align-right",value:"right",title:l("align.right"),run:()=>He("right")}];return Q.value||Y.push({id:"align-justify",value:"justify",title:l("align.justify"),run:()=>He("justify")}),Y});function He(Y){var L,re;(re=(L=a.commands).setBlockAlign)==null||re.call(L,{id:r.blockId,align:Y})}function xe(){var Y,L;(L=(Y=a.commands).indentBlock)==null||L.call(Y,{id:r.blockId})}function tt(){var Y,L;(L=(Y=a.commands).outdentBlock)==null||L.call(Y,{id:r.blockId})}const Vt=K0,on=Y0;function gn(Y){var L,re;(re=(L=a.commands).setBlockColor)==null||re.call(L,{id:r.blockId,color:Y})}function Gt(Y){var L,re;(re=(L=a.commands).setBlockBgColor)==null||re.call(L,{id:r.blockId,bgColor:Y})}async function ct(){var tn,Mn;const Y=te.value;if(!Y)return;const L=Y.type==="equation"?String(Y.attrs.expression??""):Ue(Y.content),Je=`<meta charset="utf-8"><!-- blockeditor:${JSON.stringify({id:Y.id,type:Y.type,attrs:Y.attrs,text:L}).replace(/--/g,"\\-\\-")} -->${Zt(L)}`;let Ve=!1;try{if((tn=navigator.clipboard)!=null&&tn.write&&typeof ClipboardItem<"u"){const an=new ClipboardItem({"text/plain":new Blob([L],{type:"text/plain"}),"text/html":new Blob([Je],{type:"text/html"})});await navigator.clipboard.write([an]),Ve=!0}}catch{Ve=!1}if(!Ve)try{(Mn=navigator.clipboard)!=null&&Mn.writeText&&(await navigator.clipboard.writeText(L),Ve=!0)}catch{Ve=!1}Ve||(Ve=ln(L))}function Zt(Y){return Y.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function ln(Y){const L=document.createElement("textarea");L.value=Y,L.setAttribute("readonly",""),L.style.position="fixed",L.style.top="-9999px",L.style.left="-9999px",L.style.opacity="0",document.body.appendChild(L);const re=document.activeElement;L.focus(),L.select();try{return document.execCommand("copy")}catch{return!1}finally{if(document.body.removeChild(L),re&&typeof re.focus=="function")try{re.focus()}catch{}}}function St(){ct().then(()=>{var Y,L;return(L=(Y=a.commands).removeBlock)==null?void 0:L.call(Y,{id:r.blockId})})}const Ke=/Mac|iP(hone|[ao]d)/.test(navigator.platform)?M6:A6;function yt(...Y){return Y.join("")}const Pe=i.computed(()=>[{id:"dup",iconHtml:p6,title:l("action.duplicate"),shortcutHtml:yt(Ke,S6),run:()=>{var Y,L;return void((L=(Y=a.commands).duplicateBlock)==null?void 0:L.call(Y,{id:r.blockId}))}},{id:"copy",iconHtml:g6,title:l("action.copy"),shortcutHtml:yt(Ke,C6),run:()=>void ct()},{id:"cut",iconHtml:b6,title:l("action.cut"),shortcutHtml:yt(Ke,T6),run:()=>void St()},{id:"up",iconHtml:v6,title:l("action.moveUp"),shortcutHtml:yt(Ke,Z0,x6),run:()=>{var Y,L;return void((L=(Y=a.commands).moveBlockUp)==null?void 0:L.call(Y,{id:r.blockId}))}},{id:"down",iconHtml:k6,title:l("action.moveDown"),shortcutHtml:yt(Ke,Z0,E6),run:()=>{var Y,L;return void((L=(Y=a.commands).moveBlockDown)==null?void 0:L.call(Y,{id:r.blockId}))}},{id:"del",iconHtml:y6,title:l("action.delete"),shortcutHtml:w6,danger:!0,run:()=>{var Y,L;return void((L=(Y=a.commands).removeBlock)==null?void 0:L.call(Y,{id:r.blockId}))}}]);i.watch(()=>r.visible,Y=>{Y&&(p.value=!1,f.value={top:0,left:0,availableHeight:520,above:!1,bottom:0,topBaseline:0})});function Ut(){const Y=r.anchorEl,L=r.rootEl,re=c.value;!r.visible||!Y||!L||!re||i.nextTick().then(()=>{const Je=c.value;if(!Je)return;const Ve=Je.getBoundingClientRect(),tn=!!Y.closest(".fixed-toolbar"),Mn=tn?s.value?"up":"down":"auto",an=tn?10:0,sr=q0(L,Y,{width:Math.max(Ve.width,ma),height:Ve.height},8,Mn,an,an);f.value=sr,p.value=!0,i.nextTick(qe)})}i.watch([()=>r.visible,()=>r.anchorEl,c,b,g],Ut,{flush:"post"});function Fe(Y){k[Y]=!k[Y],i.nextTick(Ut)}function qe(){const Y=u.value;Y&&(b.value=Y.scrollTop>1,g.value=Y.scrollTop+Y.clientHeight<Y.scrollHeight-1)}function jt(){const Y=u.value;Y&&(Y.scrollTop-=Y.clientHeight*.8)}function gt(){const Y=u.value;Y&&(Y.scrollTop+=Y.clientHeight*.8)}Ui(u,qe);const Qt=i.computed(()=>{if(!r.rootEl)return{display:"none"};if(!p.value)return{visibility:"hidden",top:"0px",left:"0px",width:`${ma}px`,"--scroll-max-height":"100vh"};const Y=f.value.above,L=f.value.left,re=(b.value?X0:0)+(g.value?X0:0),Je=f.value.availableHeight-re,Ve={left:`${L}px`,width:`${ma}px`,maxHeight:`${f.value.availableHeight}px`,"--scroll-max-height":`${Math.max(m6,Je)}px`};if(Y){const tn=document.documentElement.clientHeight;Ve.bottom=`${Math.max(0,tn-f.value.bottom)}px`,Ve.top="auto"}else Ve.top=`${f.value.top}px`,Ve.bottom="auto";return Ve});function at(Y){if(Y.kind==="turnInto"&&ae(Y.id)){const L=Ee.value.find(re=>re.id==="paragraph");if(L){d.value="paragraph",L.run(),o("close");return}}d.value=Y.id,Y.run(),o("close")}function be(Y){const L=[...Ee.value,...Pe.value];if(L.length===0)return!1;const re=L.findIndex(Ve=>Ve.id===d.value),Je=Ve=>(Ve%L.length+L.length)%L.length;switch(Y.key){case"ArrowDown":return Y.preventDefault(),d.value=L[Je(re+1)].id,!0;case"ArrowUp":return Y.preventDefault(),d.value=L[Je(re-1)].id,!0;case"Enter":return Y.preventDefault(),at(L[Je(re)]),!0;case"Escape":return Y.preventDefault(),o("close"),!0;default:return!1}}return e({onKeyDown:be}),G0(c,()=>r.visible,()=>o("close"),()=>r.anchorEl),i.onMounted(()=>{P=a.subscribe(Y=>{O.value=Y.state})}),i.onBeforeUnmount(()=>{P==null||P(),P=null}),(Y,L)=>(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[E.value&&t.rootEl?(i.openBlock(),i.createElementBlock("div",{key:0,ref_key:"menuEl",ref:c,class:i.normalizeClass(["block-settings-menu",{"menu-closing":!t.visible}]),style:i.normalizeStyle(Qt.value),role:"menu"},[b.value?(i.openBlock(),i.createElementBlock("button",{key:0,class:"menu-scroll-btn menu-scroll-up",type:"button","aria-label":i.unref(l)("ui.scrollUp"),onMousedown:i.withModifiers(jt,["prevent"])},[...L[8]||(L[8]=[i.createElementVNode("svg",{viewBox:"0 0 12 12",width:"10",height:"10","aria-hidden":"true"},[i.createElementVNode("path",{d:"M3 7.5L6 4.5L9 7.5",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],40,Lf)):i.createCommentVNode("",!0),i.createElementVNode("div",{ref_key:"scrollEl",ref:u,class:"bsm-scroll",onScroll:qe},[!Q.value&&!ne.value&&!_.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createElementVNode("div",Of,[i.createElementVNode("div",Df,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Ee.value,re=>(i.openBlock(),i.createElementBlock("button",{key:re.id,class:i.normalizeClass(["bsm-icon-cell",{active:ae(re.id)}]),title:re.title,role:"menuitem",onMousedown:i.withModifiers(Je=>at(re),["prevent"]),onMouseenter:Je=>d.value=re.id},[i.createVNode(_n,{class:"bsm-icon-svg",html:re.iconHtml},null,8,["html"])],42,zf))),128))])]),L[9]||(L[9]=i.createElementVNode("div",{class:"bsm-sep"},null,-1))],64)):i.createCommentVNode("",!0),$.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Hf,[i.createElementVNode("button",{class:i.normalizeClass(["bsm-collapse-header",{"bsm-disabled":ie.value&&!B.value,expanded:k.alignIndent}]),role:"menuitem",onMousedown:L[0]||(L[0]=i.withModifiers(re=>Fe("alignIndent"),["prevent"]))},[i.createElementVNode("span",Pf,i.toDisplayString(i.unref(l)("bsm.section.alignIndent")),1),L[10]||(L[10]=i.createElementVNode("svg",{class:"bsm-collapse-chevron",viewBox:"0 0 12 12",width:"10",height:"10","aria-hidden":"true"},[i.createElementVNode("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],34),i.withDirectives(i.createElementVNode("div",$f,[i.createElementVNode("div",Ff,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Te.value,re=>(i.openBlock(),i.createElementBlock("button",{key:re.id,class:i.normalizeClass(["bsm-icon-btn",{active:!ie.value&&H.value===re.value,"bsm-disabled":ie.value}]),disabled:ie.value,title:re.title,role:"menuitem",onMousedown:i.withModifiers(Je=>!ie.value&&at(re),["prevent"])},[(i.openBlock(),i.createElementBlock("svg",Uf,[re.value==="left"?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[L[11]||(L[11]=i.createElementVNode("line",{x1:"2",y1:"4",x2:"14",y2:"4",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),L[12]||(L[12]=i.createElementVNode("line",{x1:"2",y1:"8",x2:"10",y2:"8",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),L[13]||(L[13]=i.createElementVNode("line",{x1:"2",y1:"12",x2:"12",y2:"12",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1))],64)):re.value==="center"?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[L[14]||(L[14]=i.createElementVNode("line",{x1:"2",y1:"4",x2:"14",y2:"4",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),L[15]||(L[15]=i.createElementVNode("line",{x1:"4",y1:"8",x2:"12",y2:"8",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),L[16]||(L[16]=i.createElementVNode("line",{x1:"3",y1:"12",x2:"13",y2:"12",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1))],64)):re.value==="right"?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[L[17]||(L[17]=i.createElementVNode("line",{x1:"2",y1:"4",x2:"14",y2:"4",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),L[18]||(L[18]=i.createElementVNode("line",{x1:"6",y1:"8",x2:"14",y2:"8",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),L[19]||(L[19]=i.createElementVNode("line",{x1:"4",y1:"12",x2:"14",y2:"12",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1))],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:3},[L[20]||(L[20]=i.createElementVNode("line",{x1:"2",y1:"4",x2:"14",y2:"4",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),L[21]||(L[21]=i.createElementVNode("line",{x1:"2",y1:"8",x2:"14",y2:"8",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),L[22]||(L[22]=i.createElementVNode("line",{x1:"2",y1:"12",x2:"14",y2:"12",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1))],64))]))],42,Vf))),128))]),i.createElementVNode("div",qf,[i.createElementVNode("button",{class:i.normalizeClass(["bsm-icon-btn",{"bsm-disabled":j.value}]),disabled:j.value,title:i.unref(l)("bsm.indent.decrease"),role:"menuitem",onMousedown:L[1]||(L[1]=i.withModifiers(re=>!j.value&&at({id:"outdent",run:tt}),["prevent"]))},[...L[23]||(L[23]=[i.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"15",height:"15","aria-hidden":"true"},[i.createElementVNode("path",{d:"M906.666667 379.733333h-448c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h448c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32zM906.666667 580.266667h-448c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h448c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32zM117.333333 245.333333h789.333334c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32h-789.333334C100.266667 181.333333 85.333333 196.266667 85.333333 213.333333s14.933333 32 32 32zM906.666667 778.666667h-789.333334c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h789.333334c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32zM285.866667 657.066667c14.933333 8.533333 34.133333 0 34.133333-17.066667V384c0-17.066667-19.2-27.733333-34.133333-17.066667l-192 128c-12.8 8.533333-12.8 27.733333 0 36.266667l192 125.866667z",fill:"currentColor"})],-1)])],42,Gf),i.createElementVNode("button",{class:i.normalizeClass(["bsm-icon-btn",{"bsm-disabled":A.value}]),disabled:A.value,title:i.unref(l)("bsm.indent.increase"),role:"menuitem",onMousedown:L[2]||(L[2]=i.withModifiers(re=>!A.value&&at({id:"indent",run:xe}),["prevent"]))},[...L[24]||(L[24]=[i.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"15",height:"15","aria-hidden":"true"},[i.createElementVNode("path",{d:"M906.666667 379.733333h-448c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h448c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32zM906.666667 580.266667h-448c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h448c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32zM117.333333 245.333333h789.333334c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32h-789.333334C100.266667 181.333333 85.333333 196.266667 85.333333 213.333333s14.933333 32 32 32zM906.666667 778.666667h-789.333334c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h789.333334c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32zM119.466667 657.066667A21.333333 21.333333 0 0 1 85.333333 640V384c0-17.066667 19.2-27.733333 34.133334-17.066667l192 128c12.8 8.533333 12.8 27.733333 0 36.266667l-192 125.866667z",fill:"currentColor"})],-1)])],42,Wf)])],512),[[i.vShow,k.alignIndent]])])),$.value?(i.openBlock(),i.createElementBlock("div",Kf,[i.createElementVNode("button",{class:i.normalizeClass(["bsm-collapse-header",{"bsm-disabled":!B.value,expanded:k.indent}]),role:"menuitem",onMousedown:L[3]||(L[3]=i.withModifiers(re=>Fe("indent"),["prevent"]))},[i.createElementVNode("span",Yf,i.toDisplayString(i.unref(l)("bsm.section.indent")),1),L[25]||(L[25]=i.createElementVNode("svg",{class:"bsm-collapse-chevron",viewBox:"0 0 12 12",width:"10",height:"10","aria-hidden":"true"},[i.createElementVNode("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],34),i.withDirectives(i.createElementVNode("div",Xf,[i.createElementVNode("div",Zf,[i.createElementVNode("button",{class:i.normalizeClass(["bsm-icon-btn",{"bsm-disabled":j.value}]),disabled:j.value,title:i.unref(l)("bsm.indent.decrease"),role:"menuitem",onMousedown:L[4]||(L[4]=i.withModifiers(re=>!j.value&&at({id:"outdent",run:tt}),["prevent"]))},[...L[26]||(L[26]=[i.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"15",height:"15","aria-hidden":"true"},[i.createElementVNode("path",{d:"M906.666667 379.733333h-448c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h448c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32zM906.666667 580.266667h-448c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h448c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32zM117.333333 245.333333h789.333334c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32h-789.333334C100.266667 181.333333 85.333333 196.266667 85.333333 213.333333s14.933333 32 32 32zM906.666667 778.666667h-789.333334c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h789.333334c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32zM285.866667 657.066667c14.933333 8.533333 34.133333 0 34.133333-17.066667V384c0-17.066667-19.2-27.733333-34.133333-17.066667l-192 128c-12.8 8.533333-12.8 27.733333 0 36.266667l192 125.866667z",fill:"currentColor"})],-1)])],42,jf),i.createElementVNode("button",{class:i.normalizeClass(["bsm-icon-btn",{"bsm-disabled":A.value}]),disabled:A.value,title:i.unref(l)("bsm.indent.increase"),role:"menuitem",onMousedown:L[5]||(L[5]=i.withModifiers(re=>!A.value&&at({id:"indent",run:xe}),["prevent"]))},[...L[27]||(L[27]=[i.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"15",height:"15","aria-hidden":"true"},[i.createElementVNode("path",{d:"M906.666667 379.733333h-448c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h448c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32zM906.666667 580.266667h-448c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h448c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32zM117.333333 245.333333h789.333334c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32h-789.333334C100.266667 181.333333 85.333333 196.266667 85.333333 213.333333s14.933333 32 32 32zM906.666667 778.666667h-789.333334c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h789.333334c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32zM119.466667 657.066667A21.333333 21.333333 0 0 1 85.333333 640V384c0-17.066667 19.2-27.733333 34.133334-17.066667l192 128c12.8 8.533333 12.8 27.733333 0 36.266667l-192 125.866667z",fill:"currentColor"})],-1)])],42,Qf)])],512),[[i.vShow,k.indent]])])):i.createCommentVNode("",!0),!Q.value&&!ne.value?(i.openBlock(),i.createElementBlock("div",Jf,[i.createElementVNode("button",{class:i.normalizeClass(["bsm-collapse-header",{"bsm-disabled":D.value,expanded:k.textColor}]),role:"menuitem",onMousedown:L[6]||(L[6]=i.withModifiers(re=>!D.value&&Fe("textColor"),["prevent"]))},[i.createElementVNode("span",e6,i.toDisplayString(i.unref(l)("bsm.section.textColor")),1),L[28]||(L[28]=i.createElementVNode("svg",{class:"bsm-collapse-chevron",viewBox:"0 0 12 12",width:"10",height:"10","aria-hidden":"true"},[i.createElementVNode("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],34),i.withDirectives(i.createElementVNode("div",t6,[i.createElementVNode("div",n6,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(Vt),re=>(i.openBlock(),i.createElementBlock("button",{key:"tc-"+re.key,class:i.normalizeClass(["bsm-swatch",{active:F.value===re.key,"bsm-disabled":D.value}]),title:i.unref(l)(re.key==="default"?"color.default":"color."+re.key),style:i.normalizeStyle({backgroundColor:re.displayCssValue??re.cssValue}),disabled:D.value,onMousedown:i.withModifiers(Je=>!D.value&&at({id:`tc-${re.key}`,run:()=>gn(re.key)}),["prevent"])},null,46,r6))),128))])],512),[[i.vShow,k.textColor]])])):i.createCommentVNode("",!0),!Q.value&&!ne.value?(i.openBlock(),i.createElementBlock("div",o6,[i.createElementVNode("button",{class:i.normalizeClass(["bsm-collapse-header",{"bsm-disabled":D.value,expanded:k.bgColor}]),role:"menuitem",onMousedown:L[7]||(L[7]=i.withModifiers(re=>!D.value&&Fe("bgColor"),["prevent"]))},[i.createElementVNode("span",i6,i.toDisplayString(i.unref(l)("bsm.section.bgColor")),1),L[29]||(L[29]=i.createElementVNode("svg",{class:"bsm-collapse-chevron",viewBox:"0 0 12 12",width:"10",height:"10","aria-hidden":"true"},[i.createElementVNode("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],34),i.withDirectives(i.createElementVNode("div",l6,[i.createElementVNode("div",a6,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(on),re=>(i.openBlock(),i.createElementBlock("button",{key:"bc-"+re.key,class:i.normalizeClass(["bsm-swatch",[{active:V.value===re.key,"bsm-disabled":D.value},re.key==="default"?"bsm-swatch--none":""]]),title:i.unref(l)(re.key==="default"?"color.none":"color."+re.key),style:i.normalizeStyle({backgroundColor:re.displayCssValue??re.cssValue}),disabled:D.value,onMousedown:i.withModifiers(Je=>!D.value&&at({id:`bc-${re.key}`,run:()=>Gt(re.key)}),["prevent"])},null,46,s6))),128))])],512),[[i.vShow,k.bgColor]])])):i.createCommentVNode("",!0),L[30]||(L[30]=i.createElementVNode("div",{class:"bsm-sep"},null,-1)),i.createElementVNode("div",c6,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Pe.value,re=>(i.openBlock(),i.createElementBlock("button",{key:re.id,class:i.normalizeClass(["bsm-item bsm-action",{danger:re.danger}]),role:"menuitem",onMousedown:i.withModifiers(Je=>at(re),["prevent"]),onMouseenter:Je=>d.value=re.id},[i.createVNode(_n,{class:"bsm-action-icon",html:re.iconHtml},null,8,["html"]),i.createElementVNode("span",d6,i.toDisplayString(re.title),1),re.shortcutHtml?(i.openBlock(),i.createBlock(_n,{key:0,class:"bsm-shortcut",html:re.shortcutHtml},null,8,["html"])):re.shortcut?(i.openBlock(),i.createElementBlock("span",f6,i.toDisplayString(re.shortcut),1)):i.createCommentVNode("",!0)],42,u6))),128))])],544),g.value?(i.openBlock(),i.createElementBlock("button",{key:1,class:"menu-scroll-btn menu-scroll-down",type:"button","aria-label":i.unref(l)("ui.scrollDown"),onMousedown:i.withModifiers(gt,["prevent"])},[...L[31]||(L[31]=[i.createElementVNode("svg",{viewBox:"0 0 12 12",width:"10",height:"10","aria-hidden":"true"},[i.createElementVNode("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],40,h6)):i.createCommentVNode("",!0)],6)):i.createCommentVNode("",!0)]))}}),B6=["aria-hidden"],I6=["aria-label"],_6=["title","aria-label"],R6={class:"ht-dropdown-wrap"},L6=["title","disabled"],O6={class:"ht-type-label"},D6=["aria-label"],z6=["onMousedown"],H6={key:0,class:"ht-check",viewBox:"0 0 12 12",width:"14",height:"14","aria-hidden":"true"},P6=["aria-label"],$6={class:"ht-dropdown-wrap"},F6=["title","disabled"],V6={viewBox:"0 0 16 16",width:"15",height:"15","aria-hidden":"true"},U6=["aria-label"],q6=["onMousedown"],G6={viewBox:"0 0 16 16",width:"15",height:"15","aria-hidden":"true"},W6={key:0,class:"ht-check",viewBox:"0 0 12 12",width:"14",height:"14","aria-hidden":"true"},K6=["aria-label"],Y6={key:0,class:"ht-dropdown-wrap"},X6=["title","disabled"],Z6={viewBox:"0 0 16 16",width:"15",height:"15","aria-hidden":"true"},j6=["aria-label"],Q6=["onMousedown"],J6={viewBox:"0 0 16 16",width:"15",height:"15","aria-hidden":"true"},eh={key:0,class:"ht-check",viewBox:"0 0 12 12",width:"14",height:"14","aria-hidden":"true"},th=["aria-label"],nh=["title","disabled","onMousedown","onTouchstart"],rh=["title","disabled"],oh={class:"ht-dropdown-wrap"},ih=["title","disabled"],lh=["aria-label"],ah={class:"ht-color-section"},sh={class:"ht-color-label"},ch={class:"ht-swatches"},uh=["title","onMousedown"],dh={class:"ht-color-section"},fh={class:"ht-color-label"},hh={class:"ht-swatches"},mh=["title","onMousedown"],ph=["aria-label"],gh=["title","aria-label","disabled"],bh={key:0,class:"ht-sep"},vh=["title"],kh=["title"],yh=["title"],wh={key:0,class:"ht-sep"},xh=["title"],Eh=["title","aria-label"],Ch=80,Sh=24,hi=36,Th=360,j0=10,Q0=200,J0=i.defineComponent({__name:"HoverToolbar",props:{visible:{type:Boolean},selectionRect:{},blockId:{},blockType:{},blockAttrs:{},rootEl:{},tableMode:{type:Boolean},showDelete:{type:Boolean},deleteLabel:{},deleteIcon:{},showMerge:{type:Boolean},showSplit:{type:Boolean},showHeaderRow:{type:Boolean},headerRowActive:{type:Boolean},cellEditMode:{type:Boolean},tableActiveMarks:{},tableActiveColor:{},tableActiveBgColor:{},tableActiveVerticalAlign:{},inline:{type:Boolean}},emits:["close","interacting","linkClick","delete","merge","split","tableHeaderRow","tableType","tableAlign","tableVerticalAlign","tableMark","tableTextColor","tableBgColor","tableCopy"],setup(t,{expose:e,emit:n}){const r=t,o=n;function l(){o("interacting")}const{t:a}=In(),s=Yn(),c=i.inject(oi,i.ref(!1)),u=i.ref(null),d=i.ref(null),f=i.ref(null),p=i.ref(null),b=i.ref(null),g=i.ref(null),k=i.ref(null),E=i.ref(null),M=i.ref(null),O=i.ref({top:0,left:0,above:!1}),P=i.ref(null),te=i.ref(!1),z=i.ref(null),H=i.ref(null),ie=i.ref(!1),Q=i.ref(!1),ne=i.ref(null),_=i.ref(!1),$=i.ref(!1),D=i.ref(!1),W=i.computed(()=>({maxHeight:z.value!==null?`${z.value}px`:void 0})),K=i.ref(null),B=i.computed(()=>{if(!r.inline||!K.value)return;const U=K.value,x={position:"fixed",left:`${U.left}px`};return U.top!==void 0&&(x.top=`${U.top}px`),U.bottom!==void 0&&(x.bottom=`${U.bottom}px`),U.right!==void 0&&(x.right=`${U.right}px`),x}),A=i.shallowRef(null);i.watch(()=>r.blockId,U=>{A.value=U},{immediate:!0});const j=i.shallowRef(s.getState());let F=null;const V=i.computed(()=>j.value.doc.blocks.get(A.value??"")),fe=i.computed(()=>{var x;if(r.cellEditMode||r.tableMode){const Z=r.blockAttrs.align;return typeof Z=="string"?Z:"left"}const U=(x=V.value)==null?void 0:x.attrs.align;return typeof U=="string"?U:"left"}),Ee=i.computed(()=>{if(r.tableMode){const U=r.tableActiveVerticalAlign;return typeof U=="string"?U:"middle"}if(r.cellEditMode){const U=r.blockAttrs.verticalAlign;return typeof U=="string"?U:"middle"}return"middle"}),Me=i.ref(""),ae=i.ref("");i.watch(()=>r.visible,U=>{U||(P.value=null)}),i.watch(()=>r.blockId,()=>{P.value=null});const Te=i.ref(new Set),He=i.ref(0);function xe(){var U;if(!r.rootEl)return null;if(r.cellEditMode){const x=window.getSelection();if(!x||x.rangeCount===0)return null;const Z=x.getRangeAt(0);return(U=Z.commonAncestorContainer.nodeType===1?Z.commonAncestorContainer:Z.commonAncestorContainer.parentElement)==null?void 0:U.closest(".table-cell-inner")}return r.rootEl.querySelector(`[data-block-id="${r.blockId}"]`)}function tt(){const U=new Set;if(!r.visible||!r.blockId||!r.rootEl){Te.value=U;return}if(r.tableMode&&r.tableActiveMarks){Te.value=new Set(r.tableActiveMarks);return}const x=xe();if(x){const R=window.getSelection();if(R&&R.rangeCount>0){const q=R.getRangeAt(0);if(!q.collapsed&&x.contains(q.commonAncestorContainer)){const ee=[],oe=document.createTreeWalker(x,NodeFilter.SHOW_TEXT);for(;oe.nextNode();){const he=oe.currentNode;(he.nodeValue??"").length!==0&&q.intersectsNode(he)&&ee.push(he)}if(ee.length>0){const he={bold:["B","STRONG"],italic:["I","EM"],underline:["U"],strikethrough:["S","STRIKE","DEL"],code:["CODE"],link:["A"]};for(const[ge,Le]of Object.entries(he))ee.every(_e=>{let Ne=_e.parentNode;for(;Ne&&Ne!==x;){if(Ne.nodeType===Node.ELEMENT_NODE&&Le.includes(Ne.nodeName))return!0;Ne=Ne.parentNode}return!1})&&U.add(ge);if(U.size>0){Te.value=U;return}}}}}const Z=j.value,Se=r.blockId?Z.doc.blocks.get(r.blockId):void 0;if(!Se){Te.value=U;return}const ze=Z.selection;let Ze=0,C=Ue(Se.content).length;if(ze.kind==="text"&&ze.anchor.blockId===r.blockId&&ze.focus.blockId===r.blockId)Ze=Math.min(ze.anchor.offset,ze.focus.offset),C=Math.max(ze.anchor.offset,ze.focus.offset);else{const R=_t();R&&(Ze=R.from,C=R.to)}if(Ze>=C){Te.value=U;return}const S=["bold","italic","underline","strikethrough","code","link"];for(const R of S){let q=!0,ee=!1,oe=0;for(const he of Se.content){if(he.type!=="text")continue;const ge=oe,Le=oe+he.text.length;if(Le>Ze&&ge<C&&(ee=!0,!he.marks||!he.marks.some(_e=>_e.type===R))){q=!1;break}oe=Le}ee&&q&&U.add(R)}Te.value=U}const Vt=i.computed(()=>r.inline&&!r.tableMode&&!r.cellEditMode&&!r.selectionRect),on=i.computed(()=>Vt.value||r.blockType==="codeBlock"),gn=i.computed(()=>r.tableMode||r.cellEditMode?Vt.value:!r.blockId),Gt=i.computed(()=>{if(r.tableMode||r.cellEditMode)return Vt.value?!0:r.blockType==="codeBlock";if(!r.blockId||r.blockType==="codeBlock")return!0;const U=r.blockType;return U?!("align"in s.registries.schema.get(U).attrs):!1});function ct(U){if(r.tableMode||r.cellEditMode)return!!(r.blockType==="codeBlock"||r.blockType==="quote"&&U==="italic"||U!=="code"&&Te.value.has("code"));if(on.value)return!0;if(U==="italic"){const x=r.blockType;if(x&&s.registries.schema.isMarkDisallowed(x,"italic"))return!0}if(U==="link"){const x=s.getState().selection;return!!(x.kind==="text"&&kn(x))}return!!(U!=="code"&&Te.value.has("code"))}const Zt=i.computed(()=>[{id:"bold",title:a("mark.bold"),iconHtml:'<svg viewBox="0 0 1024 1024" width="15" height="15" aria-hidden="true"><path d="M214.857 889.143v-68.571h68.571V203.429H214.857v-68.571h411.429v1.257c96.114 10.629 171.429 87.383 171.429 181.6 0 58.971-29.486 111.086-75.109 144.457 72.069 39.291 120.823 113.234 120.823 198.4 0 119.291-95.634 216.594-217.12 227.543l-0.286.029H214.857z m388.572-388.571H352v320h251.429c95.086 0 171.429-72.091 171.429-160s-76.343-160-171.429-160z m0-297.143H352v228.571h251.429l5.211-0.091c67.52-2.515 120.503-53.235 120.503-114.195 0-62.537-55.749-114.285-125.714-114.285z" fill="currentColor"/></svg>'},{id:"italic",title:a("mark.italic"),iconHtml:'<svg viewBox="0 0 1024 1024" width="15" height="15" aria-hidden="true"><path d="M730.143 127.714v64.286h-112.329l-166.521 621.429h128.871v64.286H276.286v-64.286h108.45l166.5-621.429H426.286V127.714h303.857z" fill="currentColor"/></svg>'},{id:"underline",title:a("mark.underline"),iconHtml:'<svg viewBox="0 0 1024 1024" width="15" height="15" aria-hidden="true"><path d="M512 123.639a36.409 36.409 0 0 1 33.642 22.525l230.59 558.27a36.409 36.409 0 1 1-67.284 27.768L638.072 560.545H385.928l-70.876 171.656a36.409 36.409 0 1 1-67.332-27.768l230.59-558.27A36.409 36.409 0 0 1 512 123.639z m-95.974 364.089h191.948L512 255.439l-95.974 232.289zM769.289 827.544c19.418 0 38.836 14.564 38.836 38.836 0 19.418-14.564 33.982-29.127 33.982H259.565c-19.418 0-38.836-14.564-38.836-38.836 0-19.418 14.564-33.982 29.127-33.982h519.433z" fill="currentColor"/></svg>'},{id:"strikethrough",title:a("mark.strikethrough"),iconHtml:'<svg viewBox="0 0 1024 1024" width="15" height="15" aria-hidden="true"><path d="M182.044 490.667h659.911a34.133 34.133 0 0 1 4.642 67.948l-4.597 0.319h-135.395c40.05 37 60.803 81.601 60.803 133.575 0 128.569-147.092 211.171-307.382 192.512-101.717-11.833-173.352-52.565-210.944-122.971a34.133 34.133 0 0 1 60.211-32.176c25.942 48.606 77.46 77.915 158.606 87.381 124.837 14.473 231.242-45.283 231.242-124.746 0-53.339-36.636-96.802-116.736-131.345l-5.279-2.23H182.044a34.133 34.133 0 0 1-33.815-29.492L147.911 524.8a34.133 34.133 0 0 1 29.491-33.815l4.642-0.318z m68.767-176.447c6.918-128.796 128.432-203.343 287.812-184.82 99.579 11.56 175.81 47.923 226.737 109.636a34.133 34.133 0 1 1-52.657 43.463c-38.775-47.013-98.759-75.639-181.999-85.288-123.654-14.381-211.627 36.591-211.627 117.009 0 35.135 10.65 61.349 37.774 90.203l5.826 6.007c4.278 4.369 8.966 8.875 11.377 10.923l1.411 0.91H288.085l-1.092-1.729c-6.508-9.376-38.958-54.386-36.182-106.314z" fill="currentColor"/></svg>'},{id:"code",title:a("mark.inlineCode"),iconHtml:'<svg viewBox="0 0 1024 1024" width="15" height="15" aria-hidden="true"><path d="M197.802 747.664v-145.287a58.916 58.916 0 0 0-58.916-58.916h-19.619v-62.922h19.619a58.916 58.916 0 0 0 58.916-58.916V276.336a117.832 117.832 0 0 1 117.832-117.832h39.297v78.535h-39.356a39.297 39.297 0 0 0-39.238 39.297v161.017A78.594 78.594 0 0 1 222.37 512a78.594 78.594 0 0 1 53.967 74.646V747.664a39.238 39.238 0 0 0 39.238 39.238h39.356v78.594h-39.356a117.832 117.832 0 0 1-117.832-117.832z m628.456-145.287V747.664a117.832 117.832 0 0 1-117.832 117.832h-39.356v-78.594h39.356a39.238 39.238 0 0 0 39.238-39.238v-161.017A78.535 78.535 0 0 1 801.63 512a78.594 78.594 0 0 1-53.967-74.646V276.336a39.297 39.297 0 0 0-39.238-39.297h-39.356V158.504h39.356a117.832 117.832 0 0 1 117.832 117.832v145.287a58.916 58.916 0 0 0 58.916 58.916h19.56v62.922h-19.56a58.916 58.916 0 0 0-58.916 58.916z" fill="currentColor"/></svg>'}]),ln=i.computed(()=>{const U=r.blockType,x=r.blockAttrs,Z=(ze,Ze)=>U===ze&&(Ze===void 0||Number(x.level)===Ze);return[{id:"text",label:a("turnInto.paragraph"),iconHtml:na,active:Z("paragraph"),convertType:"paragraph"},{id:"h1",label:a("turnInto.h1"),iconHtml:ra,active:Z("heading",1),convertType:"heading",convertAttrs:{level:1}},{id:"h2",label:a("turnInto.h2"),iconHtml:oa,active:Z("heading",2),convertType:"heading",convertAttrs:{level:2}},{id:"h3",label:a("turnInto.h3"),iconHtml:ia,active:Z("heading",3),convertType:"heading",convertAttrs:{level:3}},{id:"h4",label:a("turnInto.h4"),iconHtml:la,active:Z("heading",4),convertType:"heading",convertAttrs:{level:4}},{id:"h5",label:a("turnInto.h5"),iconHtml:aa,active:Z("heading",5),convertType:"heading",convertAttrs:{level:5}},{id:"h6",label:a("turnInto.h6"),iconHtml:sa,active:Z("heading",6),convertType:"heading",convertAttrs:{level:6}},{id:"bullet",label:a("turnInto.bullet"),iconHtml:ca,active:Z("bulletList"),convertType:"bulletList"},{id:"ordered",label:a("turnInto.ordered"),iconHtml:ua,active:Z("orderedList"),convertType:"orderedList"},{id:"todo",label:a("turnInto.todo"),iconHtml:da,active:Z("todoList"),convertType:"todoList",convertAttrs:{checked:!1}},{id:"quote",label:a("turnInto.quote"),iconHtml:fa,active:Z("quote"),convertType:"quote"},{id:"code",label:a("turnInto.code"),iconHtml:ha,active:Z("codeBlock"),convertType:"codeBlock",convertAttrs:{language:"plain"}}]}),St=i.computed(()=>{const U=ln.value.find(x=>x.active);return U?U.label:a("turnInto.paragraph")}),Ke=i.computed(()=>[{id:"left",label:a("align.left"),value:"left"},{id:"center",label:a("align.center"),value:"center"},{id:"right",label:a("align.right"),value:"right"},{id:"justify",label:a("align.justify"),value:"justify"}]),yt=i.computed(()=>[{id:"top",label:a("verticalAlign.top"),value:"top"},{id:"middle",label:a("verticalAlign.middle"),value:"middle"},{id:"bottom",label:a("verticalAlign.bottom"),value:"bottom"}]),Pe=K0,Ut=Y0;function Fe(){var S;const U=u.value,x=ne.value;if(!U||!x){_.value=!1;return}const Z=x.scrollLeft;x.style.maxWidth="",x.offsetWidth;const Se=x.scrollWidth,ze=r.inline?Math.max(120,(((S=U.parentElement)==null?void 0:S.clientWidth)??U.clientWidth)-8):Math.max(200,document.documentElement.clientWidth-32),Ze=Sh*2,C=ze-Ze;if(Se>C){_.value=!0,x.style.maxWidth=`${C}px`;const R=Math.max(0,x.scrollWidth-x.clientWidth);x.scrollLeft=Math.min(Z,R),qe()}else _.value=!1,x.style.maxWidth="",$.value=!1,D.value=!1}function qe(){const U=ne.value;U&&($.value=U.scrollLeft>0,D.value=U.scrollLeft+U.clientWidth<U.scrollWidth-1)}function jt(U){P.value=null;const x=ne.value;x&&(x.scrollLeft+=U*Ch,qe())}let gt=null,Qt=0,at=0,be=!1,Y=!1;function L(U){if(!be)return;const x=U.touches[0];if(!x)return;const Z=Math.abs(x.clientX-Qt),Se=Math.abs(x.clientY-at);(Z>j0||Se>j0)&&(Y||(P.value=null),Y=!0)}function re(U){if(!be)return;const x=gt;gt=null,be=!1;const Z=Y;Y=!1,Z||(U.cancelable&&U.preventDefault(),x&&x())}function Je(U,x){x.cancelable&&x.preventDefault(),jt(U)}function Ve(U,x){const Z=x.touches[0];Z&&(Qt=Z.clientX,at=Z.clientY),gt=U,be=!0,Y=!1}i.watch([()=>r.visible,()=>r.selectionRect,u,()=>r.inline],async()=>{if(r.inline){r.visible&&Fe();return}if(!r.visible||!r.selectionRect||!r.rootEl)return;const U=u.value;if(!U||P.value)return;Fe(),await i.nextTick();const x=U.getBoundingClientRect(),Z=x.width,Se=Math.max(x.height,hi);O.value=r.tableMode?ea(r.rootEl,r.selectionRect,{width:Z,height:Se}):Jl(r.rootEl,r.selectionRect,{width:Z,height:Se})},{flush:"post",immediate:!0});const tn=i.computed(()=>({top:"0px",left:"0px",width:"100vw",height:"100vh"})),Mn=i.computed(()=>{const U=u.value,x=(U==null?void 0:U.offsetWidth)??Th,Z=document.documentElement.clientWidth,Se=8;let ze=O.value.left;const Ze=Math.max(Se,Z-x-Se);ze=Math.max(Se,Math.min(Ze,ze));const C={top:`${O.value.top}px`,left:`${ze}px`};if(r.selectionRect){const R=r.selectionRect.left+r.selectionRect.width/2-ze,q=Math.max(10,Math.min(x-10,R));C["--ht-arrow-x"]=`${q}px`}return C});async function an(U){P.value=P.value===U?null:U,P.value&&(await i.nextTick(),cr())}i.watch(P,(U,x)=>{x&&!U&&!r.inline&&sr()});function sr(){ut===null&&(ut=requestAnimationFrame(()=>{if(ut=null,r.inline)return;const U=u.value;!r.visible||!r.selectionRect||!r.rootEl||!U||(Fe(),i.nextTick().then(()=>{const x=U.getBoundingClientRect();O.value=r.tableMode?ea(r.rootEl,r.selectionRect,{width:x.width,height:Math.max(x.height,hi)}):Jl(r.rootEl,r.selectionRect,{width:x.width,height:Math.max(x.height,hi)})}))}))}let ut=null;function cr(){const U=P.value;if(!U)return;const x=U==="type"?d.value:U==="align"?f.value:U==="verticalAlign"?p.value:b.value,Z=U==="type"?g.value:U==="align"?k.value:U==="verticalAlign"?E.value:M.value;if(!x||!Z)return;const Se=Z.getBoundingClientRect(),ze=window.innerHeight,Ze=6,C=Math.floor(ze-Se.bottom-Ze),S=Math.floor(Se.top-Ze),R=x.scrollHeight;if(r.inline){const he=document.documentElement.clientHeight,ge=10;if(c.value){te.value=!0,z.value=Math.max(120,S-ge);const Ae=he-Se.top+Ze;if(U==="color"){const _e=document.documentElement.clientWidth;K.value={bottom:Ae,right:Math.max(8,_e-Se.right)}}else K.value={left:Math.max(8,Se.left),bottom:Ae}}else{te.value=!1,z.value=Math.max(120,C-ge);const Ae=Se.bottom+Ze;if(U==="color"){const _e=document.documentElement.clientWidth;K.value={top:Ae,right:Math.max(8,_e-Se.right)}}else K.value={left:Math.max(8,Se.left),top:Ae}}i.nextTick(Cn);return}K.value=null;let q=!1;if(r.rootEl&&u.value){const he=r.rootEl.getBoundingClientRect(),ge=u.value.getBoundingClientRect();he.bottom-ge.bottom<Q0&&S>Q0&&(q=!0)}let ee=!1,oe;q?(ee=!0,oe=S):R<=C?(ee=!1,oe=C):S>C?(ee=!0,oe=S):(ee=!1,oe=C),te.value=ee,z.value=Math.max(120,Math.min(oe,360)),i.nextTick(Cn)}function Cn(){const U=H.value;if(!U){ie.value=!1,Q.value=!1;return}ie.value=U.scrollTop>1,Q.value=U.scrollTop+U.clientHeight<U.scrollHeight-1}function Vn(){const U=H.value;U&&(U.scrollTop-=U.clientHeight*.8)}function ht(){const U=H.value;U&&(U.scrollTop+=U.clientHeight*.8)}Ui(H,Cn);function xt(U){var Z,Se,ze,Ze,C;if(o("interacting"),r.tableMode||r.cellEditMode){U.convertType==="heading"&&((Z=U.convertAttrs)!=null&&Z.level)?o("tableType",`heading${U.convertAttrs.level}`):o("tableType",U.convertType),P.value=null,r.tableMode&&o("close");return}const x=Rt();if(x){for(const S of x.ranges)(ze=(Se=s.commands).convertBlock)==null||ze.call(Se,{id:S.id,type:U.convertType,attrs:U.convertAttrs??{}});P.value=null,o("close");return}A.value&&((C=(Ze=s.commands).convertBlock)==null||C.call(Ze,{id:A.value,type:U.convertType,attrs:U.convertAttrs??{}}),P.value=null,o("close"))}function Ye(U){var Z,Se,ze,Ze;if(o("interacting"),r.tableMode||r.cellEditMode){o("tableAlign",U),P.value=null;return}const x=Rt();if(x){for(const C of x.ranges)(Se=(Z=s.commands).setBlockAlign)==null||Se.call(Z,{id:C.id,align:U});P.value=null;return}A.value&&((Ze=(ze=s.commands).setBlockAlign)==null||Ze.call(ze,{id:A.value,align:U}),P.value=null)}function Xe(U){if(r.tableMode||r.cellEditMode){o("tableVerticalAlign",U),P.value=null;return}P.value=null}function mt(U){var Se,ze,Ze,C;if(o("interacting"),r.tableMode){o("tableTextColor",U==="default"?null:U),P.value=null;return}if(r.cellEditMode){const S=window.getSelection();if(S&&S.rangeCount>0&&!S.isCollapsed){const R=S.getRangeAt(0);if(U==="default"){const q=R.extractContents();q.querySelectorAll('span[class*="be-color-"]').forEach(ee=>{const oe=ee.className.replace(/be-color-\w+/g,"").trim();if(oe)ee.className=oe;else{for(;ee.firstChild;)ee.parentNode.insertBefore(ee.firstChild,ee);ee.parentNode.removeChild(ee)}}),R.insertNode(q)}else{const q=document.createElement("span");q.className=`be-color-${U}`,q.appendChild(R.extractContents()),R.insertNode(q),S.removeAllRanges();const ee=document.createRange();ee.selectNodeContents(q),S.addRange(ee)}}P.value=null,Tt();return}const x=Rt();if(x){for(const S of x.ranges)(ze=(Se=s.commands).setInlineMark)==null||ze.call(Se,{id:S.id,markType:"color",attrs:U==="default"?null:{color:U},from:S.from,to:S.to});return}if(!A.value)return;const Z=_t();Z&&((C=(Ze=s.commands).setInlineMark)==null||C.call(Ze,{id:A.value,markType:"color",attrs:U==="default"?null:{color:U},from:Z.from,to:Z.to}),i.nextTick(()=>{var ge;const S=window.getSelection(),R=(ge=r.rootEl)==null?void 0:ge.querySelector(`[data-block-id="${r.blockId}"]`),q=S&&S.rangeCount>0?S.getRangeAt(0):null,ee=!!R,oe=!!(q&&R&&R.contains(q.commonAncestorContainer)),he=!!(q&&!q.collapsed&&oe);if(!ee){o("close");return}if(!he&&!oe){o("close");return}Tt(),tt()}))}function sn(U){var Se,ze,Ze,C;if(o("interacting"),r.tableMode){o("tableBgColor",U==="default"?null:U),P.value=null;return}if(r.cellEditMode){const S=window.getSelection();if(S&&S.rangeCount>0&&!S.isCollapsed){const R=S.getRangeAt(0);if(U==="default"){const q=R.extractContents();q.querySelectorAll('span[class*="be-bg-"]').forEach(ee=>{const oe=ee.className.replace(/be-bg-\w+/g,"").trim();if(oe)ee.className=oe;else{for(;ee.firstChild;)ee.parentNode.insertBefore(ee.firstChild,ee);ee.parentNode.removeChild(ee)}}),R.insertNode(q)}else{const q=document.createElement("span");q.className=`be-bg-${U}`,q.appendChild(R.extractContents()),R.insertNode(q),S.removeAllRanges();const ee=document.createRange();ee.selectNodeContents(q),S.addRange(ee)}}P.value=null,Tt();return}const x=Rt();if(x){for(const S of x.ranges)(ze=(Se=s.commands).setInlineMark)==null||ze.call(Se,{id:S.id,markType:"bgColor",attrs:U==="default"?null:{bgColor:U},from:S.from,to:S.to});return}if(!A.value)return;const Z=_t();Z&&((C=(Ze=s.commands).setInlineMark)==null||C.call(Ze,{id:A.value,markType:"bgColor",attrs:U==="default"?null:{bgColor:U},from:Z.from,to:Z.to}),i.nextTick(()=>{var ge;const S=window.getSelection(),R=(ge=r.rootEl)==null?void 0:ge.querySelector(`[data-block-id="${r.blockId}"]`),q=S&&S.rangeCount>0?S.getRangeAt(0):null,ee=!!R,oe=!!(q&&R&&R.contains(q.commonAncestorContainer)),he=!!(q&&!q.collapsed&&oe);if(!ee){o("close");return}if(!he&&!oe){o("close");return}Tt(),tt()}))}function Tt(){if(r.tableMode){Me.value=r.tableActiveColor??"",ae.value=r.tableActiveBgColor??"";return}if(r.visible&&r.blockId&&r.rootEl){const R=xe(),q=window.getSelection();if(R&&q&&q.rangeCount>0){const ee=q.getRangeAt(0);if(!ee.collapsed&&R.contains(ee.commonAncestorContainer)){const oe=new Set,he=new Set,ge=[],Le=document.createTreeWalker(R,NodeFilter.SHOW_TEXT);for(;Le.nextNode();){const Ae=Le.currentNode;(Ae.nodeValue??"").length!==0&&ee.intersectsNode(Ae)&&ge.push(Ae)}for(const Ae of ge){let _e=Ae.parentNode;for(;_e&&_e!==R;){if(_e.nodeType===Node.ELEMENT_NODE){const Ne=_e.className;if(typeof Ne=="string"){const st=Ne.match(/be-color-(\w+)/);st&&oe.add(st[1]);const pt=Ne.match(/be-bg-(\w+)/);pt&&he.add(pt[1])}}_e=_e.parentNode}}if(oe.size>0||he.size>0){Me.value=oe.size===1?[...oe][0]:"",ae.value=he.size===1?[...he][0]:"";return}}}}const U=j.value,x=r.blockId?U.doc.blocks.get(r.blockId):void 0;if(!x){Me.value="",ae.value="";return}const Z=U.selection;let Se,ze;if(Z.kind==="text"&&Z.anchor.blockId===r.blockId&&Z.focus.blockId===r.blockId)Se=Math.min(Z.anchor.offset,Z.focus.offset),ze=Math.max(Z.anchor.offset,Z.focus.offset);else{const R=_t();Se=R?R.from:0,ze=R?R.to:Ue(x.content).length}if(Se>=ze){Me.value="",ae.value="";return}const Ze=new Set,C=new Set;let S=0;for(const R of x.content){if(R.type!=="text")continue;const q=S,ee=S+R.text.length;if(ee>Se&&q<ze&&R.marks)for(const oe of R.marks)oe.type==="color"&&oe.attrs&&typeof oe.attrs.color=="string"&&Ze.add(oe.attrs.color),oe.type==="bgColor"&&oe.attrs&&typeof oe.attrs.bgColor=="string"&&C.add(oe.attrs.bgColor);S=ee}Me.value=Ze.size===1?[...Ze][0]:"",ae.value=C.size===1?[...C][0]:""}function _t(){if(!r.blockId||!r.rootEl)return null;const U=r.rootEl.querySelector(`[data-block-id="${r.blockId}"]`);if(!U)return null;const x=window.getSelection();if(!x||x.rangeCount===0)return null;const Z=x.getRangeAt(0);if(Z.collapsed||!U.contains(Z.commonAncestorContainer))return null;const Se=document.createRange();Se.selectNodeContents(U),Se.setEnd(Z.startContainer,Z.startOffset);const ze=Se.toString().length;Se.setEnd(Z.endContainer,Z.endOffset);const Ze=Se.toString().length;return{from:Math.min(ze,Ze),to:Math.max(ze,Ze)}}function Rt(){const U=j.value.selection;if(U.kind!=="text"||!kn(U))return null;const x=j.value.doc,Z=yr(x),Se=Z.indexOf(U.anchor.blockId),ze=Z.indexOf(U.focus.blockId);if(Se===-1||ze===-1)return null;const[Ze,C]=Se<=ze?[U.anchor,U.focus]:[U.focus,U.anchor],S=Z.indexOf(Ze.blockId),R=Z.indexOf(C.blockId);if(S===-1||R===-1||S>R)return null;const q=[];for(let ee=S;ee<=R;ee++){const oe=Z[ee],he=x.blocks.get(oe);if(!he)continue;const ge=Ue(he.content).length;let Le=0,Ae=ge;ee===S&&(Le=Math.min(Ze.offset,ge)),ee===R&&(Ae=Math.min(C.offset,ge)),q.push({id:oe,from:Le,to:Ae})}return{ranges:q}}function An(){const U=j.value.selection;if(U.kind!=="text"||!kn(U))return null;const x=Rt();if(!x)return null;const Z=j.value.doc,Se=[],ze=[];for(const Ze of x.ranges){const C=Z.blocks.get(Ze.id);if(!C)continue;const[,S]=En(C.content,Ze.from),[R]=En(S,Ze.to-Ze.from);Se.push(Ue(R)),ze.push(Qr(R))}return{text:Se.join(`
|
|
14
|
-
`),html:ze.join("<br>")}}function xn(U){var Se,ze,Ze,C;if(o("interacting"),r.tableMode){o("tableMark",U);return}if(r.cellEditMode){const R={bold:"bold",italic:"italic",underline:"underline",strikethrough:"strikeThrough",code:"insertHTML"}[U];if(R==="insertHTML"){const q=window.getSelection();if(q&&q.rangeCount>0&&!q.isCollapsed){const ee=q.getRangeAt(0),oe=document.createElement("code");try{oe.appendChild(ee.extractContents()),ee.insertNode(oe),q.removeAllRanges();const he=document.createRange();he.selectNodeContents(oe),q.addRange(he)}catch{}}}else R&&document.execCommand(R);tt();return}const x=Rt();if(x){for(const S of x.ranges)(ze=(Se=s.commands).toggleMark)==null||ze.call(Se,{id:S.id,markType:U,from:S.from,to:S.to});return}if(!A.value)return;const Z=_t();Z&&((C=(Ze=s.commands).toggleMark)==null||C.call(Ze,{id:A.value,markType:U,from:Z.from,to:Z.to}),i.nextTick(()=>{var ge;He.value++;const S=window.getSelection(),R=(ge=r.rootEl)==null?void 0:ge.querySelector(`[data-block-id="${r.blockId}"]`),q=S&&S.rangeCount>0?S.getRangeAt(0):null,ee=!!R,oe=!!(q&&R&&R.contains(q.commonAncestorContainer)),he=!!(q&&!q.collapsed&&oe);if(!ee){o("close");return}if(!he&&!oe){o("close");return}tt(),Tt()}))}function co(){if(o("interacting"),P.value=null,r.cellEditMode){o("linkClick",A.value??"",0,0);return}if(A.value){const U=_t();U&&o("linkClick",A.value,U.from,U.to)}}function ur(){var Se,ze;if(r.tableMode){o("tableCopy"),o("close");return}const U=An();if(U){(Se=navigator.clipboard)==null||Se.writeText(U.text),o("close");return}const x=window.getSelection(),Z=x?x.toString():"";Z&&((ze=navigator.clipboard)==null||ze.writeText(Z)),o("close")}e({});async function Un(){if(r.inline){r.visible&&Fe(),P.value&&cr(),Cn(),tt(),Tt();return}if(r.visible&&r.selectionRect&&r.rootEl&&u.value){if(P.value){cr(),Cn(),tt(),Tt();return}Fe(),await i.nextTick();const U=u.value.getBoundingClientRect();O.value=r.tableMode?ea(r.rootEl,r.selectionRect,{width:U.width,height:Math.max(U.height,hi)}):Jl(r.rootEl,r.selectionRect,{width:U.width,height:Math.max(U.height,hi)})}P.value&&cr(),Cn(),tt(),Tt()}function or(U){if(!P.value)return;const x=[d.value,f.value,p.value,b.value],Z=[g.value,k.value,E.value,M.value];for(const Se of x)if(Se&&Se.contains(U))return;for(const Se of Z)if(Se&&Se.contains(U))return;P.value=null}function Mr(U){if(!r.visible)return;const x=u.value;if(x&&x.contains(U.target)){U.preventDefault(),P.value&&or(U.target);return}or(U.target)}function Zn(U){if(!r.visible||!U.touches[0])return;const Z=U.target,Se=u.value;if(Se&&Se.contains(Z)){const ze=ne.value;if(ze&&ze.contains(Z)){P.value&&or(Z);return}U.preventDefault(),P.value&&or(Z);return}or(Z)}i.watch(()=>r.visible,U=>{U&&i.nextTick(()=>{tt(),Tt()})}),i.onMounted(()=>{window.addEventListener("scroll",Un,!0),window.addEventListener("resize",Un),window.addEventListener("mousedown",Mr,!0),window.addEventListener("touchstart",Zn,!0),document.addEventListener("selectionchange",Ar),F=s.subscribe(()=>{i.nextTick(()=>{const U=s.getState();j.value=U,He.value++,tt(),Tt()})})}),i.onBeforeUnmount(()=>{window.removeEventListener("scroll",Un,!0),window.removeEventListener("resize",Un),window.removeEventListener("mousedown",Mr,!0),window.removeEventListener("touchstart",Zn,!0),document.removeEventListener("selectionchange",Ar),F==null||F(),F=null});function Ar(){r.visible&&qn===null&&(qn=requestAnimationFrame(()=>{qn=null,r.visible&&(tt(),Tt())}))}let qn=null;return(U,x)=>(i.openBlock(),i.createBlock(i.Teleport,{to:"body",disabled:t.inline},[i.createElementVNode("div",{class:i.normalizeClass(["hover-toolbar-shell",{visible:t.visible,"inline-shell":t.inline,"inline-visible":t.inline&&t.visible}]),style:i.normalizeStyle(t.inline?void 0:tn.value),"aria-hidden":!t.visible,onMousedownCapture:i.withModifiers(l,["prevent"])},[i.createElementVNode("div",{ref_key:"toolbarEl",ref:u,class:i.normalizeClass(["hover-toolbar",{above:O.value.above,below:!O.value.above,"ht-overflow":_.value,"inline-mode":t.inline}]),style:i.normalizeStyle(t.inline?void 0:Mn.value),role:"toolbar","aria-label":i.unref(a)("hoverToolbar.label")},[_.value?(i.openBlock(),i.createElementBlock("button",{key:0,class:i.normalizeClass(["ht-nav-btn ht-nav-left",{disabled:!$.value}]),title:i.unref(a)("ui.scrollLeft"),"aria-label":i.unref(a)("ui.scrollLeft"),onMousedown:x[0]||(x[0]=i.withModifiers(Z=>jt(-1),["prevent","stop"])),onTouchstart:x[1]||(x[1]=i.withModifiers(()=>{},["stop"])),onTouchend:x[2]||(x[2]=i.withModifiers(Z=>Je(-1,Z),["stop"])),onClick:x[3]||(x[3]=i.withModifiers(()=>{},["prevent","stop"]))},[...x[39]||(x[39]=[i.createElementVNode("svg",{viewBox:"0 0 12 12",width:"10",height:"10","aria-hidden":"true"},[i.createElementVNode("path",{d:"M7.5 3L4.5 6L7.5 9",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],42,_6)):i.createCommentVNode("",!0),i.createElementVNode("div",{ref_key:"htContentEl",ref:ne,class:i.normalizeClass(["ht-content",{"dropdown-open":!t.inline&&!!P.value}]),onScroll:qe,onTouchmovePassive:L,onTouchend:i.withModifiers(re,["stop"])},[i.createElementVNode("div",R6,[i.createElementVNode("button",{ref_key:"typeBtnEl",ref:g,class:i.normalizeClass(["ht-btn ht-type-btn",{open:P.value==="type",disabled:gn.value}]),title:i.unref(a)("hoverToolbar.typeBtnTitle"),disabled:gn.value,onMousedown:x[4]||(x[4]=i.withModifiers(Z=>!gn.value&&an("type"),["prevent","stop"])),onTouchstart:x[5]||(x[5]=i.withModifiers(Z=>{Ve(()=>{gn.value||an("type")},Z)},["stop"])),onClick:x[6]||(x[6]=i.withModifiers(()=>{},["prevent","stop"]))},[i.createElementVNode("span",O6,i.toDisplayString(St.value),1),x[40]||(x[40]=i.createElementVNode("svg",{class:"ht-caret",viewBox:"0 0 12 12",width:"10",height:"10","aria-hidden":"true"},[i.createElementVNode("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],42,L6),(i.openBlock(),i.createBlock(i.Teleport,{to:"body",disabled:!t.inline},[P.value==="type"?(i.openBlock(),i.createElementBlock("div",{key:0,ref_key:"typeDropdownEl",ref:d,class:i.normalizeClass(["ht-dropdown",[t.inline?"ht-dropdown-inline":"",{above:te.value}]]),style:i.normalizeStyle([W.value,B.value])},[ie.value?(i.openBlock(),i.createElementBlock("button",{key:0,class:"menu-scroll-btn menu-scroll-up",type:"button","aria-label":i.unref(a)("ui.scrollUp"),onMousedown:i.withModifiers(Vn,["prevent"])},[...x[41]||(x[41]=[i.createElementVNode("svg",{viewBox:"0 0 12 12",width:"10",height:"10","aria-hidden":"true"},[i.createElementVNode("path",{d:"M3 7.5L6 4.5L9 7.5",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],40,D6)):i.createCommentVNode("",!0),i.createElementVNode("div",{ref_key:"scrollEl",ref:H,class:"ht-dropdown-scroll",onScroll:Cn},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(ln.value,Z=>(i.openBlock(),i.createElementBlock("button",{key:Z.id,class:i.normalizeClass(["ht-dropdown-item",{active:Z.active}]),onMousedown:i.withModifiers(Se=>xt(Z),["prevent","stop"])},[i.createVNode(_n,{class:"ht-dropdown-icon",html:Z.iconHtml},null,8,["html"]),i.createElementVNode("span",null,i.toDisplayString(Z.label),1),Z.active?(i.openBlock(),i.createElementBlock("svg",H6,[...x[42]||(x[42]=[i.createElementVNode("path",{d:"M2.5 6L5 8.5L9.5 4",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):i.createCommentVNode("",!0)],42,z6))),128))],544),Q.value?(i.openBlock(),i.createElementBlock("button",{key:1,class:"menu-scroll-btn menu-scroll-down",type:"button","aria-label":i.unref(a)("ui.scrollDown"),onMousedown:i.withModifiers(ht,["prevent"])},[...x[43]||(x[43]=[i.createElementVNode("svg",{viewBox:"0 0 12 12",width:"10",height:"10","aria-hidden":"true"},[i.createElementVNode("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],40,P6)):i.createCommentVNode("",!0)],6)):i.createCommentVNode("",!0)],8,["disabled"]))]),i.createElementVNode("div",$6,[i.createElementVNode("button",{ref_key:"alignBtnEl",ref:k,class:i.normalizeClass(["ht-btn ht-icon-only",{open:P.value==="align",disabled:Gt.value}]),title:i.unref(a)("hoverToolbar.alignBtnTitle"),disabled:Gt.value,onMousedown:x[7]||(x[7]=i.withModifiers(Z=>!Gt.value&&an("align"),["prevent","stop"])),onTouchstart:x[8]||(x[8]=i.withModifiers(Z=>{Ve(()=>{Gt.value||an("align")},Z)},["stop"])),onClick:x[9]||(x[9]=i.withModifiers(()=>{},["prevent","stop"]))},[(i.openBlock(),i.createElementBlock("svg",V6,[fe.value==="left"?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[x[44]||(x[44]=i.createElementVNode("line",{x1:"2",y1:"4",x2:"14",y2:"4",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),x[45]||(x[45]=i.createElementVNode("line",{x1:"2",y1:"8",x2:"10",y2:"8",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),x[46]||(x[46]=i.createElementVNode("line",{x1:"2",y1:"12",x2:"12",y2:"12",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1))],64)):fe.value==="center"?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[x[47]||(x[47]=i.createElementVNode("line",{x1:"2",y1:"4",x2:"14",y2:"4",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),x[48]||(x[48]=i.createElementVNode("line",{x1:"4",y1:"8",x2:"12",y2:"8",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),x[49]||(x[49]=i.createElementVNode("line",{x1:"3",y1:"12",x2:"13",y2:"12",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1))],64)):fe.value==="right"?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[x[50]||(x[50]=i.createElementVNode("line",{x1:"2",y1:"4",x2:"14",y2:"4",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),x[51]||(x[51]=i.createElementVNode("line",{x1:"6",y1:"8",x2:"14",y2:"8",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),x[52]||(x[52]=i.createElementVNode("line",{x1:"4",y1:"12",x2:"14",y2:"12",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1))],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:3},[x[53]||(x[53]=i.createElementVNode("line",{x1:"2",y1:"4",x2:"14",y2:"4",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),x[54]||(x[54]=i.createElementVNode("line",{x1:"2",y1:"8",x2:"14",y2:"8",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),x[55]||(x[55]=i.createElementVNode("line",{x1:"2",y1:"12",x2:"14",y2:"12",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1))],64))]))],42,F6),(i.openBlock(),i.createBlock(i.Teleport,{to:"body",disabled:!t.inline},[P.value==="align"?(i.openBlock(),i.createElementBlock("div",{key:0,ref_key:"alignDropdownEl",ref:f,class:i.normalizeClass(["ht-dropdown",[t.inline?"ht-dropdown-inline":"",{above:te.value}]]),style:i.normalizeStyle([W.value,B.value])},[ie.value?(i.openBlock(),i.createElementBlock("button",{key:0,class:"menu-scroll-btn menu-scroll-up",type:"button","aria-label":i.unref(a)("ui.scrollUp"),onMousedown:i.withModifiers(Vn,["prevent"])},[...x[56]||(x[56]=[i.createElementVNode("svg",{viewBox:"0 0 12 12",width:"10",height:"10","aria-hidden":"true"},[i.createElementVNode("path",{d:"M3 7.5L6 4.5L9 7.5",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],40,U6)):i.createCommentVNode("",!0),i.createElementVNode("div",{ref_key:"scrollEl",ref:H,class:"ht-dropdown-scroll",onScroll:Cn},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Ke.value,Z=>(i.openBlock(),i.createElementBlock("button",{key:Z.id,class:i.normalizeClass(["ht-dropdown-item ht-align-item",{active:fe.value===Z.value}]),onMousedown:i.withModifiers(Se=>Ye(Z.value),["prevent","stop"])},[(i.openBlock(),i.createElementBlock("svg",G6,[Z.value==="left"?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[x[57]||(x[57]=i.createElementVNode("line",{x1:"2",y1:"4",x2:"14",y2:"4",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),x[58]||(x[58]=i.createElementVNode("line",{x1:"2",y1:"8",x2:"10",y2:"8",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),x[59]||(x[59]=i.createElementVNode("line",{x1:"2",y1:"12",x2:"12",y2:"12",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1))],64)):Z.value==="center"?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[x[60]||(x[60]=i.createElementVNode("line",{x1:"2",y1:"4",x2:"14",y2:"4",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),x[61]||(x[61]=i.createElementVNode("line",{x1:"4",y1:"8",x2:"12",y2:"8",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),x[62]||(x[62]=i.createElementVNode("line",{x1:"3",y1:"12",x2:"13",y2:"12",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1))],64)):Z.value==="right"?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[x[63]||(x[63]=i.createElementVNode("line",{x1:"2",y1:"4",x2:"14",y2:"4",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),x[64]||(x[64]=i.createElementVNode("line",{x1:"6",y1:"8",x2:"14",y2:"8",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),x[65]||(x[65]=i.createElementVNode("line",{x1:"4",y1:"12",x2:"14",y2:"12",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1))],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:3},[x[66]||(x[66]=i.createElementVNode("line",{x1:"2",y1:"4",x2:"14",y2:"4",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),x[67]||(x[67]=i.createElementVNode("line",{x1:"2",y1:"8",x2:"14",y2:"8",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),x[68]||(x[68]=i.createElementVNode("line",{x1:"2",y1:"12",x2:"14",y2:"12",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1))],64))])),i.createElementVNode("span",null,i.toDisplayString(Z.label),1),fe.value===Z.value?(i.openBlock(),i.createElementBlock("svg",W6,[...x[69]||(x[69]=[i.createElementVNode("path",{d:"M2.5 6L5 8.5L9.5 4",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):i.createCommentVNode("",!0)],42,q6))),128))],544),Q.value?(i.openBlock(),i.createElementBlock("button",{key:1,class:"menu-scroll-btn menu-scroll-down",type:"button","aria-label":i.unref(a)("ui.scrollDown"),onMousedown:i.withModifiers(ht,["prevent"])},[...x[70]||(x[70]=[i.createElementVNode("svg",{viewBox:"0 0 12 12",width:"10",height:"10","aria-hidden":"true"},[i.createElementVNode("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],40,K6)):i.createCommentVNode("",!0)],6)):i.createCommentVNode("",!0)],8,["disabled"]))]),t.tableMode||t.cellEditMode?(i.openBlock(),i.createElementBlock("div",Y6,[i.createElementVNode("button",{ref_key:"verticalAlignBtnEl",ref:E,class:i.normalizeClass(["ht-btn ht-icon-only",{open:P.value==="verticalAlign",disabled:Gt.value}]),title:i.unref(a)("hoverToolbar.verticalAlignBtnTitle"),disabled:Gt.value,onMousedown:x[10]||(x[10]=i.withModifiers(Z=>!Gt.value&&an("verticalAlign"),["prevent","stop"])),onTouchstart:x[11]||(x[11]=i.withModifiers(Z=>{Ve(()=>{Gt.value||an("verticalAlign")},Z)},["stop"])),onClick:x[12]||(x[12]=i.withModifiers(()=>{},["prevent","stop"]))},[(i.openBlock(),i.createElementBlock("svg",Z6,[Ee.value==="top"?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[x[71]||(x[71]=i.createElementVNode("line",{x1:"2",y1:"3",x2:"14",y2:"3",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),x[72]||(x[72]=i.createElementVNode("line",{x1:"4",y1:"7",x2:"12",y2:"7",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),x[73]||(x[73]=i.createElementVNode("line",{x1:"5",y1:"11",x2:"11",y2:"11",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1))],64)):Ee.value==="bottom"?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[x[74]||(x[74]=i.createElementVNode("line",{x1:"5",y1:"5",x2:"11",y2:"5",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),x[75]||(x[75]=i.createElementVNode("line",{x1:"4",y1:"9",x2:"12",y2:"9",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),x[76]||(x[76]=i.createElementVNode("line",{x1:"2",y1:"13",x2:"14",y2:"13",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1))],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[x[77]||(x[77]=i.createElementVNode("line",{x1:"5",y1:"3",x2:"11",y2:"3",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),x[78]||(x[78]=i.createElementVNode("line",{x1:"3",y1:"8",x2:"13",y2:"8",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),x[79]||(x[79]=i.createElementVNode("line",{x1:"5",y1:"13",x2:"11",y2:"13",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1))],64))]))],42,X6),(i.openBlock(),i.createBlock(i.Teleport,{to:"body",disabled:!t.inline},[P.value==="verticalAlign"?(i.openBlock(),i.createElementBlock("div",{key:0,ref_key:"verticalAlignDropdownEl",ref:p,class:i.normalizeClass(["ht-dropdown",[t.inline?"ht-dropdown-inline":"",{above:te.value}]]),style:i.normalizeStyle([W.value,B.value])},[ie.value?(i.openBlock(),i.createElementBlock("button",{key:0,class:"menu-scroll-btn menu-scroll-up",type:"button","aria-label":i.unref(a)("ui.scrollUp"),onMousedown:i.withModifiers(Vn,["prevent"])},[...x[80]||(x[80]=[i.createElementVNode("svg",{viewBox:"0 0 12 12",width:"10",height:"10","aria-hidden":"true"},[i.createElementVNode("path",{d:"M3 7.5L6 4.5L9 7.5",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],40,j6)):i.createCommentVNode("",!0),i.createElementVNode("div",{ref_key:"scrollEl",ref:H,class:"ht-dropdown-scroll",onScroll:Cn},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(yt.value,Z=>(i.openBlock(),i.createElementBlock("button",{key:Z.id,class:i.normalizeClass(["ht-dropdown-item ht-align-item",{active:Ee.value===Z.value}]),onMousedown:i.withModifiers(Se=>Xe(Z.value),["prevent","stop"])},[(i.openBlock(),i.createElementBlock("svg",J6,[Z.value==="top"?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[x[81]||(x[81]=i.createElementVNode("line",{x1:"2",y1:"3",x2:"14",y2:"3",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),x[82]||(x[82]=i.createElementVNode("line",{x1:"4",y1:"7",x2:"12",y2:"7",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),x[83]||(x[83]=i.createElementVNode("line",{x1:"5",y1:"11",x2:"11",y2:"11",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1))],64)):Z.value==="bottom"?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[x[84]||(x[84]=i.createElementVNode("line",{x1:"5",y1:"5",x2:"11",y2:"5",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),x[85]||(x[85]=i.createElementVNode("line",{x1:"4",y1:"9",x2:"12",y2:"9",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),x[86]||(x[86]=i.createElementVNode("line",{x1:"2",y1:"13",x2:"14",y2:"13",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1))],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[x[87]||(x[87]=i.createElementVNode("line",{x1:"5",y1:"3",x2:"11",y2:"3",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),x[88]||(x[88]=i.createElementVNode("line",{x1:"3",y1:"8",x2:"13",y2:"8",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),x[89]||(x[89]=i.createElementVNode("line",{x1:"5",y1:"13",x2:"11",y2:"13",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1))],64))])),i.createElementVNode("span",null,i.toDisplayString(Z.label),1),Ee.value===Z.value?(i.openBlock(),i.createElementBlock("svg",eh,[...x[90]||(x[90]=[i.createElementVNode("path",{d:"M2.5 6L5 8.5L9.5 4",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):i.createCommentVNode("",!0)],42,Q6))),128))],544),Q.value?(i.openBlock(),i.createElementBlock("button",{key:1,class:"menu-scroll-btn menu-scroll-down",type:"button","aria-label":i.unref(a)("ui.scrollDown"),onMousedown:i.withModifiers(ht,["prevent"])},[...x[91]||(x[91]=[i.createElementVNode("svg",{viewBox:"0 0 12 12",width:"10",height:"10","aria-hidden":"true"},[i.createElementVNode("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],40,th)):i.createCommentVNode("",!0)],6)):i.createCommentVNode("",!0)],8,["disabled"]))])):i.createCommentVNode("",!0),x[100]||(x[100]=i.createElementVNode("div",{class:"ht-sep"},null,-1)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Zt.value,Z=>(i.openBlock(),i.createElementBlock("button",{key:Z.id,class:i.normalizeClass(["ht-btn ht-icon-only",{active:Te.value.has(Z.id),disabled:ct(Z.id)}]),title:Z.title,disabled:ct(Z.id),onMousedown:i.withModifiers(Se=>!ct(Z.id)&&xn(Z.id),["prevent","stop"]),onTouchstart:i.withModifiers(Se=>{Ve(()=>{ct(Z.id)||xn(Z.id)},Se)},["stop"]),onClick:x[13]||(x[13]=i.withModifiers(()=>{},["prevent","stop"]))},[i.createVNode(_n,{html:Z.iconHtml},null,8,["html"])],42,nh))),128)),t.tableMode?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("button",{key:1,class:i.normalizeClass(["ht-btn ht-icon-only",{active:Te.value.has("link"),disabled:ct("link")}]),title:i.unref(a)("hoverToolbar.linkBtnTitle"),disabled:ct("link"),onMousedown:x[14]||(x[14]=i.withModifiers(Z=>!ct("link")&&co(),["prevent","stop"])),onTouchstart:x[15]||(x[15]=i.withModifiers(Z=>{Ve(()=>{ct("link")||co()},Z)},["stop"])),onClick:x[16]||(x[16]=i.withModifiers(()=>{},["prevent","stop"]))},[...x[92]||(x[92]=[i.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"15",height:"15","aria-hidden":"true"},[i.createElementVNode("path",{d:"M394.666667 298.666667a32 32 0 0 1 4.693333 63.658666l-4.693333 0.341334H298.666667a149.333333 149.333333 0 0 0-8.789334 298.410666L298.666667 661.333333h96a32 32 0 0 1 4.693333 63.658667L394.666667 725.333333H298.666667a213.333333 213.333333 0 0 1-10.666667-426.410666L298.666667 298.666667h96zM725.333333 298.666667a213.333333 213.333333 0 0 1 10.666667 426.410666L725.333333 725.333333h-96a32 32 0 0 1-4.693333-63.658666l4.693333-0.341334H725.333333a149.333333 149.333333 0 0 0 8.789334-298.410666L725.333333 362.666667h-96a32 32 0 0 1-4.693333-63.658667L629.333333 298.666667H725.333333zM298.666667 480h426.666666a32 32 0 0 1 4.352 63.701333L725.333333 544H298.666667a32 32 0 0 1-4.352-63.701333L298.666667 480h426.666666H298.666667z",fill:"currentColor"})],-1)])],42,rh)),x[101]||(x[101]=i.createElementVNode("div",{class:"ht-sep"},null,-1)),i.createElementVNode("div",oh,[i.createElementVNode("button",{ref_key:"colorBtnEl",ref:M,class:i.normalizeClass(["ht-btn ht-icon-only",{open:P.value==="color",disabled:ct("color")}]),title:i.unref(a)("hoverToolbar.colorBtnTitle"),disabled:ct("color"),onMousedown:x[17]||(x[17]=i.withModifiers(Z=>!ct("color")&&an("color"),["prevent","stop"])),onTouchstart:x[18]||(x[18]=i.withModifiers(Z=>{Ve(()=>{ct("color")||an("color")},Z)},["stop"])),onClick:x[19]||(x[19]=i.withModifiers(()=>{},["prevent","stop"]))},[...x[93]||(x[93]=[i.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"15",height:"15","aria-hidden":"true"},[i.createElementVNode("path",{d:"M163.797333 249.941333c125.44-167.082667 385.28-215.68 570.197334-100.693333 182.613333 113.493333 249.770667 331.818667 174.933333 536.618667-70.613333 193.408-256.682667 269.994667-390.784 172.714666-50.218667-36.437333-69.717333-82.133333-79.104-156.330666l-4.522667-42.112-1.92-16.981334c-5.248-39.850667-13.269333-57.685333-30.08-67.072-22.826667-12.714667-38.058667-13.013333-68.053333-1.408l-14.976 6.229334-7.637333 3.328c-43.264 18.773333-72.021333 25.386667-108.416 17.749333l-8.533334-2.005333-6.997333-2.005334c-118.997333-36.864-136.618667-198.272-24.106667-348.032z m41.984 286.549334l5.248 1.578666 5.717334 1.28c18.730667 3.712 34.730667 0.64 61.312-10.325333l25.685333-10.965333c51.285333-21.034667 84.693333-23.04 129.962667 2.133333 39.125333 21.845333 54.4 55.381333 62.165333 113.493333l2.261333 19.584 2.346667 22.698667 2.005333 18.005333c7.338667 58.069333 20.693333 89.173333 53.248 112.810667 97.066667 70.4 236.117333 13.184 293.12-142.890667 64.682667-177.152 7.424-363.264-148.650666-460.330666-156.8-97.450667-379.690667-55.722667-485.248 84.778666-88.533333 117.888-77.653333 225.28-9.173334 248.149334z m478.933334-85.077334a53.333333 53.333333 0 1 1 102.997333-27.605333 53.333333 53.333333 0 0 1-102.997333 27.605333z m21.077333 148.821334a53.333333 53.333333 0 1 1 103.04-27.605334 53.333333 53.333333 0 0 1-103.04 27.605334zM600.32 323.285333a53.333333 53.333333 0 1 1 103.04-27.605333 53.333333 53.333333 0 0 1-103.04 27.605333z m-1.194667 383.914667a53.333333 53.333333 0 1 1 102.997334-27.605333 53.333333 53.333333 0 0 1-102.997334 27.605333z m-149.205333-425.386667a53.333333 53.333333 0 1 1 103.04-27.562666 53.333333 53.333333 0 0 1-103.04 27.562666z",fill:"currentColor"})],-1)])],42,ih),(i.openBlock(),i.createBlock(i.Teleport,{to:"body",disabled:!t.inline},[P.value==="color"?(i.openBlock(),i.createElementBlock("div",{key:0,ref_key:"colorDropdownEl",ref:b,class:i.normalizeClass(["ht-dropdown ht-color-dropdown",[t.inline?"ht-dropdown-inline":"",{above:te.value}]]),style:i.normalizeStyle([W.value,B.value])},[ie.value?(i.openBlock(),i.createElementBlock("button",{key:0,class:"menu-scroll-btn menu-scroll-up",type:"button","aria-label":i.unref(a)("ui.scrollUp"),onMousedown:i.withModifiers(Vn,["prevent"])},[...x[94]||(x[94]=[i.createElementVNode("svg",{viewBox:"0 0 12 12",width:"10",height:"10","aria-hidden":"true"},[i.createElementVNode("path",{d:"M3 7.5L6 4.5L9 7.5",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],40,lh)):i.createCommentVNode("",!0),i.createElementVNode("div",{ref_key:"scrollEl",ref:H,class:"ht-dropdown-scroll",onScroll:Cn},[i.createElementVNode("div",ah,[i.createElementVNode("div",sh,i.toDisplayString(i.unref(a)("hoverToolbar.textColor")),1),i.createElementVNode("div",ch,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(Pe),Z=>(i.openBlock(),i.createElementBlock("button",{key:"tc-"+Z.key,class:i.normalizeClass(["ht-swatch",{active:Me.value===Z.key}]),title:i.unref(a)(Z.key==="default"?"color.default":"color."+Z.key),style:i.normalizeStyle({backgroundColor:Z.displayCssValue??Z.cssValue}),onMousedown:i.withModifiers(Se=>mt(Z.key),["prevent","stop"])},null,46,uh))),128))])]),i.createElementVNode("div",dh,[i.createElementVNode("div",fh,i.toDisplayString(i.unref(a)("hoverToolbar.bgColor")),1),i.createElementVNode("div",hh,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(Ut),Z=>(i.openBlock(),i.createElementBlock("button",{key:"bc-"+Z.key,class:i.normalizeClass(["ht-swatch",[{active:ae.value===Z.key},Z.key==="default"?"ht-swatch--none":""]]),title:i.unref(a)(Z.key==="default"?"color.none":"color."+Z.key),style:i.normalizeStyle({backgroundColor:Z.displayCssValue??Z.cssValue}),onMousedown:i.withModifiers(Se=>sn(Z.key),["prevent","stop"])},null,46,mh))),128))])])],544),Q.value?(i.openBlock(),i.createElementBlock("button",{key:1,class:"menu-scroll-btn menu-scroll-down",type:"button","aria-label":i.unref(a)("ui.scrollDown"),onMousedown:i.withModifiers(ht,["prevent"])},[...x[95]||(x[95]=[i.createElementVNode("svg",{viewBox:"0 0 12 12",width:"10",height:"10","aria-hidden":"true"},[i.createElementVNode("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],40,ph)):i.createCommentVNode("",!0)],6)):i.createCommentVNode("",!0)],8,["disabled"]))]),x[102]||(x[102]=i.createElementVNode("div",{class:"ht-sep"},null,-1)),i.createElementVNode("button",{class:i.normalizeClass(["ht-btn ht-icon-only",{disabled:Vt.value}]),title:i.unref(a)("hoverToolbar.copySelection"),"aria-label":i.unref(a)("hoverToolbar.copySelection"),disabled:Vt.value,onMousedown:x[20]||(x[20]=i.withModifiers(Z=>!Vt.value&&ur(),["prevent","stop"])),onTouchstart:x[21]||(x[21]=i.withModifiers(Z=>{Ve(()=>{Vt.value||ur()},Z)},["stop"])),onClick:x[22]||(x[22]=i.withModifiers(()=>{},["prevent","stop"]))},[...x[96]||(x[96]=[i.createElementVNode("svg",{viewBox:"0 0 16 16",width:"15",height:"15","aria-hidden":"true"},[i.createElementVNode("rect",{x:"5",y:"5",width:"8",height:"8",rx:"1.5",fill:"none",stroke:"currentColor","stroke-width":"1.3"}),i.createElementVNode("path",{d:"M3 10.5V3.5C3 2.67 3.67 2 4.5 2H10",fill:"none",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"})],-1)])],42,gh),t.tableMode?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[t.showMerge||t.showSplit||t.showHeaderRow||t.showDelete?(i.openBlock(),i.createElementBlock("div",bh)):i.createCommentVNode("",!0),t.showMerge?(i.openBlock(),i.createElementBlock("button",{key:1,class:"ht-btn ht-icon-only",title:i.unref(a)("table.mergeCells"),onMousedown:x[23]||(x[23]=i.withModifiers(Z=>o("merge"),["prevent","stop"])),onTouchstart:x[24]||(x[24]=i.withModifiers(Z=>Ve(()=>o("merge"),Z),["stop"])),onClick:x[25]||(x[25]=i.withModifiers(()=>{},["prevent","stop"]))},[...x[97]||(x[97]=[i.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"15",height:"15",fill:"currentColor","aria-hidden":"true"},[i.createElementVNode("path",{d:"M266.666667 128A138.666667 138.666667 0 0 0 128 266.666667v490.666666A138.666667 138.666667 0 0 0 266.666667 896h490.666666A138.666667 138.666667 0 0 0 896 757.333333V266.666667A138.666667 138.666667 0 0 0 757.333333 128H266.666667zM192 266.666667c0-41.216 33.450667-74.666667 74.666667-74.666667H469.333333v128H192V266.666667z m341.333333 437.333333h298.666667v53.333333a74.666667 74.666667 0 0 1-74.666667 74.666667H533.333333v-128z m298.666667-384h-298.666667v-128h224c41.216 0 74.666667 33.450667 74.666667 74.666667V320z m-362.666667 384v128H266.666667a74.666667 74.666667 0 0 1-74.666667-74.666667V704H469.333333zM192 384h640v256h-640V384z"})],-1)])],40,vh)):i.createCommentVNode("",!0),t.showSplit?(i.openBlock(),i.createElementBlock("button",{key:2,class:"ht-btn ht-icon-only",title:i.unref(a)("table.splitCell"),onMousedown:x[26]||(x[26]=i.withModifiers(Z=>o("split"),["prevent","stop"])),onTouchstart:x[27]||(x[27]=i.withModifiers(Z=>Ve(()=>o("split"),Z),["stop"])),onClick:x[28]||(x[28]=i.withModifiers(()=>{},["prevent","stop"]))},[...x[98]||(x[98]=[i.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"15",height:"15",fill:"currentColor","aria-hidden":"true"},[i.createElementVNode("path",{d:"M533.333333 426.666667H469.333333v170.666666h64v-170.666666z"}),i.createElementVNode("path",{d:"M128 266.666667A138.666667 138.666667 0 0 1 266.666667 128h490.666666A138.666667 138.666667 0 0 1 896 266.666667v490.666666A138.666667 138.666667 0 0 1 757.333333 896H266.666667A138.666667 138.666667 0 0 1 128 757.333333V266.666667zM266.666667 192A74.666667 74.666667 0 0 0 192 266.666667V320H469.333333v-128H266.666667z m565.333333 512h-298.666667v128h224a74.666667 74.666667 0 0 0 74.666667-74.666667V704z m0-437.333333a74.666667 74.666667 0 0 0-74.666667-74.666667H533.333333v128h298.666667V266.666667zM192 704v53.333333c0 41.216 33.450667 74.666667 74.666667 74.666667H469.333333v-128H192z m0-64h640V384h-640v256z"})],-1)])],40,kh)):i.createCommentVNode("",!0),t.showHeaderRow?(i.openBlock(),i.createElementBlock("button",{key:3,class:i.normalizeClass(["ht-btn ht-icon-only",{active:t.headerRowActive}]),title:i.unref(a)("table.toggleHeader"),onMousedown:x[29]||(x[29]=i.withModifiers(Z=>o("tableHeaderRow"),["prevent","stop"])),onTouchstart:x[30]||(x[30]=i.withModifiers(Z=>Ve(()=>o("tableHeaderRow"),Z),["stop"])),onClick:x[31]||(x[31]=i.withModifiers(()=>{},["prevent","stop"]))},[...x[99]||(x[99]=[i.createElementVNode("svg",{viewBox:"0 0 16 16",width:"15",height:"15",fill:"none",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[i.createElementVNode("rect",{x:"2",y:"2",width:"12",height:"12",rx:"1"}),i.createElementVNode("path",{d:"M2 6h12"}),i.createElementVNode("path",{d:"M5 2v4"})],-1)])],42,yh)):i.createCommentVNode("",!0),t.showDelete?(i.openBlock(),i.createElementBlock(i.Fragment,{key:4},[t.showMerge||t.showSplit||t.showHeaderRow?(i.openBlock(),i.createElementBlock("div",wh)):i.createCommentVNode("",!0),i.createElementVNode("button",{class:"ht-btn ht-danger ht-icon-only",title:t.deleteLabel||i.unref(a)("hoverToolbar.deleteBlock"),onMousedown:x[32]||(x[32]=i.withModifiers(Z=>o("delete"),["prevent","stop"])),onTouchstart:x[33]||(x[33]=i.withModifiers(Z=>Ve(()=>o("delete"),Z),["stop"])),onClick:x[34]||(x[34]=i.withModifiers(()=>{},["prevent","stop"]))},[i.createVNode(_n,{html:t.deleteIcon||"<svg viewBox='0 0 1024 1024' width='15' height='15' fill='currentColor' aria-hidden='true'><path d='M128 266.666667A138.666667 138.666667 0 0 1 266.666667 128h490.666666A138.666667 138.666667 0 0 1 896 266.666667v246.272a276.096 276.096 0 0 0-64-30.250667V426.666667h-170.666667v56.021333a276.096 276.096 0 0 0-64 30.250667V426.666667h-170.666666v170.666666h86.272a276.096 276.096 0 0 0-30.250667 64H426.666667v170.666667h56.021333c7.381333 22.784 17.578667 44.245333 30.250667 64H266.666667A138.666667 138.666667 0 0 1 128 757.333333V266.666667zM266.666667 192A74.666667 74.666667 0 0 0 192 266.666667V362.666667h170.666667v-170.666667H266.666667zM192 426.666667v170.666666h170.666667v-170.666666h-170.666667z m469.333333-64h170.666667V266.666667a74.666667 74.666667 0 0 0-74.666667-74.666667H661.333333v170.666667z m-64-170.666667h-170.666666v170.666667h170.666666v-170.666667z m-405.333333 469.333333v96c0 41.216 33.450667 74.666667 74.666667 74.666667H362.666667v-170.666667h-170.666667z'/><path d='M981.333333 746.666667a234.666667 234.666667 0 1 1-469.333333 0 234.666667 234.666667 0 0 1 469.333333 0z m-234.666666-30.165334l-70.229334-70.272a21.333333 21.333333 0 0 0-30.208 30.208l70.272 70.229334-70.272 70.229333a21.333333 21.333333 0 0 0 30.208 30.208l70.229334-70.272 70.229333 70.272a21.333333 21.333333 0 0 0 30.208-30.208L776.832 746.666667l70.272-70.229334a21.333333 21.333333 0 0 0-30.208-30.208L746.666667 716.501333z'/></svg>"},null,8,["html"])],40,xh)],64)):i.createCommentVNode("",!0)],64)):i.createCommentVNode("",!0)],34),_.value?(i.openBlock(),i.createElementBlock("button",{key:1,class:i.normalizeClass(["ht-nav-btn ht-nav-right",{disabled:!D.value}]),title:i.unref(a)("ui.scrollRight"),"aria-label":i.unref(a)("ui.scrollRight"),onMousedown:x[35]||(x[35]=i.withModifiers(Z=>jt(1),["prevent","stop"])),onTouchstart:x[36]||(x[36]=i.withModifiers(()=>{},["stop"])),onTouchend:x[37]||(x[37]=i.withModifiers(Z=>Je(1,Z),["stop"])),onClick:x[38]||(x[38]=i.withModifiers(()=>{},["prevent","stop"]))},[...x[103]||(x[103]=[i.createElementVNode("svg",{viewBox:"0 0 12 12",width:"10",height:"10","aria-hidden":"true"},[i.createElementVNode("path",{d:"M4.5 3L7.5 6L4.5 9",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],42,Eh)):i.createCommentVNode("",!0)],14,I6)],46,B6)],8,["disabled"]))}}),Mh=["aria-label"],Ah={class:"tt-left"},Nh=["disabled","title","aria-label"],Bh=["disabled","title","aria-label"],Ih={key:0,class:"tt-sep"},_h=i.defineComponent({__name:"FixedToolbar",props:{rootEl:{},focusBlockId:{},hoverVisible:{type:Boolean},hoverSelectionRect:{},hoverBlockId:{},hoverBlockType:{},hoverBlockAttrs:{},plusMenuVisible:{type:Boolean},settingsMenuVisible:{type:Boolean},position:{}},emits:["openPlusMenu","openSettingsMenu","linkClick","hoverClose","toolbarInteracting"],setup(t,{emit:e}){const n=t,r=e;function o(z){r("toolbarInteracting")}const{t:l}=In(),a=Rr(),s=Yn(),c=i.inject(f0,i.ref(!1)),u=i.computed(()=>n.position==="top"?!1:n.position==="bottom"?!0:c.value);i.provide(oi,u);const d=i.inject(zl,i.ref(null)),f=i.ref(null),p=z=>{var Q;if(!z)return null;const H=z.nodeType===1?z:z.parentElement;if(!H)return null;const ie=H.closest(".block-content");return ie&&(((Q=n.rootEl)==null?void 0:Q.contains(ie))??!1)?ie:null};let b=null;const g=()=>{if(!f.value){b=null;return}try{const z=window.getSelection();if(z&&z.rangeCount>0){const H=z.getRangeAt(0);if(!H.collapsed&&[z.anchorNode,z.focusNode,H.startContainer,H.endContainer].some(Q=>p(Q)!==null)){b=setTimeout(g,1500);return}}}catch{}f.value=null,b=null};i.watch([d,()=>n.hoverVisible,()=>n.hoverSelectionRect,()=>n.hoverBlockId,()=>n.hoverBlockType,()=>n.hoverBlockAttrs],()=>{const z=d.value;if(!(z&&z.visible))if(n.hoverVisible){if(b&&(clearTimeout(b),b=null),n.hoverSelectionRect===null||n.hoverBlockId===null||n.hoverBlockType===null)return;f.value={visible:!0,selectionRect:n.hoverSelectionRect,blockId:n.hoverBlockId,blockType:n.hoverBlockType,blockAttrs:n.hoverBlockAttrs,rootEl:n.rootEl,onClose:()=>r("hoverClose"),onLinkClick:(H,ie,Q)=>r("linkClick",H,ie,Q)}}else f.value&&!b&&(b=setTimeout(g,1500))},{immediate:!0,flush:"sync"});const k=i.computed(()=>{const z=d.value;if(z&&z.visible)return z;if(n.hoverVisible)return{visible:!0,selectionRect:n.hoverSelectionRect,blockId:n.hoverBlockId,blockType:n.hoverBlockType,blockAttrs:n.hoverBlockAttrs,rootEl:n.rootEl,onClose:()=>r("hoverClose"),onLinkClick:(ie,Q,ne)=>r("linkClick",ie,Q,ne)};if(f.value)return{...f.value,visible:!0};const H=n.focusBlockId;if(H){const ie=s.getState().doc.blocks.get(H);return{visible:!0,selectionRect:null,blockId:H,blockType:(ie==null?void 0:ie.type)??null,blockAttrs:(ie==null?void 0:ie.attrs)??{},rootEl:n.rootEl,onClose:()=>r("hoverClose"),onLinkClick:(Q,ne,_)=>r("linkClick",Q,ne,_)}}return{visible:!1,selectionRect:null,blockId:null,blockType:null,blockAttrs:{},rootEl:n.rootEl}}),E=i.computed(()=>{const z=d.value;return z&&z.visible?z.blockId:n.hoverVisible&&n.hoverBlockId?n.hoverBlockId:n.focusBlockId}),M=i.ref(null),O=i.ref(null);function P(){const z=E.value,H=M.value;!z||!H||r("openPlusMenu",z,H)}function te(){const z=E.value,H=O.value;!z||!H||r("openSettingsMenu",z,H)}return i.watch(()=>n.focusBlockId,(z,H)=>{if(z!==H&&f.value){const ie=f.value;z!==null&&ie.blockId!==z&&(f.value=null)}}),(z,H)=>i.unref(a)?(i.openBlock(),i.createElementBlock("div",{key:0,ref:"toolbarRoot",class:i.normalizeClass(["fixed-toolbar",{"fixed-toolbar--bottom":u.value}]),role:"toolbar","aria-label":i.unref(l)("hoverToolbar.label"),onMousedownCapture:i.withModifiers(o,["prevent"])},[i.createElementVNode("div",Ah,[i.createElementVNode("button",{ref_key:"plusBtnEl",ref:M,class:i.normalizeClass(["tt-btn tt-plus",{disabled:!E.value,active:t.plusMenuVisible}]),disabled:!E.value,title:i.unref(l)("handle.plus.title"),"aria-label":i.unref(l)("handle.plus.ariaLabel"),onMousedown:i.withModifiers(P,["prevent","stop"]),onTouchstart:H[0]||(H[0]=i.withModifiers(()=>{},["stop"]))},[...H[3]||(H[3]=[i.createElementVNode("svg",{viewBox:"0 0 16 16",width:"18",height:"18","aria-hidden":"true"},[i.createElementVNode("path",{d:"M8 3.5V12.5M3.5 8H12.5",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round"})],-1)])],42,Nh),i.createElementVNode("button",{ref_key:"handleBtnEl",ref:O,class:i.normalizeClass(["tt-btn tt-handle",{disabled:!E.value,active:t.settingsMenuVisible}]),disabled:!E.value,title:i.unref(l)("handle.grip.title"),"aria-label":i.unref(l)("handle.grip.ariaLabel"),onMousedown:i.withModifiers(te,["prevent","stop"]),onTouchstart:H[1]||(H[1]=i.withModifiers(()=>{},["stop"]))},[...H[4]||(H[4]=[i.createStaticVNode('<svg viewBox="0 0 16 16" width="18" height="18" aria-hidden="true"><circle cx="5" cy="4" r="1.3" fill="currentColor"></circle><circle cx="11" cy="4" r="1.3" fill="currentColor"></circle><circle cx="5" cy="8" r="1.3" fill="currentColor"></circle><circle cx="11" cy="8" r="1.3" fill="currentColor"></circle><circle cx="5" cy="12" r="1.3" fill="currentColor"></circle><circle cx="11" cy="12" r="1.3" fill="currentColor"></circle></svg>',1)])],42,Bh)]),k.value.visible?(i.openBlock(),i.createElementBlock("div",Ih)):i.createCommentVNode("",!0),i.createVNode(J0,i.mergeProps({inline:""},k.value,{onInteracting:H[2]||(H[2]=ie=>r("toolbarInteracting"))}),null,16)],42,Mh)):i.createCommentVNode("",!0)}}),Rh={class:"olm-label"},Lh={class:"olm-label"},Oh={class:"olm-label"},qi=6,ec=i.defineComponent({__name:"OrderedListMenu",props:{visible:{type:Boolean},blockId:{},anchor:{},rootEl:{},canContinue:{type:Boolean},canStartNew:{type:Boolean},currentNumber:{}},emits:["continue","startNew","modify","close"],setup(t,{emit:e}){const n=t,r=e,{t:o}=In(),l=i.ref(null),a=i.ref({top:0,left:0,above:!1});i.watch([()=>n.visible,()=>n.anchor,l],async()=>{if(!n.visible||!n.anchor)return;await i.nextTick();const f=l.value;if(!f)return;const p=n.anchor.getBoundingClientRect(),b=f.getBoundingClientRect(),k=window.innerHeight-p.bottom-qi,E=p.top-qi,M=Math.max(b.height,10);let O=!1;k>=M?O=!1:E>=M?O=!0:O=E>k,a.value={top:O?p.top-(b.height+qi):p.bottom+qi,left:p.left,above:O}},{flush:"post",immediate:!0});const s=i.computed(()=>({top:`${a.value.top}px`,left:`${a.value.left}px`}));function c(){n.canContinue&&r("continue")}function u(){n.canStartNew&&r("startNew")}function d(){r("modify",n.currentNumber)}return(f,p)=>(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[t.visible&&t.anchor&&t.rootEl?(i.openBlock(),i.createElementBlock("div",{key:0,ref_key:"menuEl",ref:l,class:i.normalizeClass(["ordered-list-menu",{above:a.value.above}]),style:i.normalizeStyle(s.value),role:"menu",onMousedown:p[0]||(p[0]=i.withModifiers(()=>{},["prevent","stop"]))},[i.createElementVNode("button",{class:i.normalizeClass(["olm-item",{disabled:!t.canContinue}]),role:"menuitem",onClick:c},[p[1]||(p[1]=i.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"15",height:"15","aria-hidden":"true",fill:"currentColor"},[i.createElementVNode("path",{d:"M2.27072 1012.662857c0 6.253714 5.046857 11.337143 11.337143 11.337143h226.267428a11.337143 11.337143 0 0 0 11.337143-11.337143v-52.114286a11.337143 11.337143 0 0 0-11.337143-11.337142H120.067291L181.031863 885.028571c14.701714-15.323429 26.770286-29.257143 36.205714-41.801142l0.036572-0.109715c9.508571-13.019429 16.859429-25.965714 21.796571-38.875428a110.445714 110.445714 0 0 0 7.570286-39.862857c0-20.955429-5.193143-39.789714-15.872-56.027429a101.302857 101.302857 0 0 0-43.081143-37.156571C169.621577 662.454857 148.849006 658.285714 125.809006 658.285714a136.777143 136.777143 0 0 0-56.137143 11.812572c-17.554286 7.68-32.548571 18.797714-44.8 33.426285a111.542857 111.542857 0 0 0-24.649143 51.309715 11.337143 11.337143 0 0 0 7.753143 13.056l53.833143 16.786285a11.300571 11.300571 0 0 0 14.189714-7.570285c4.315429-14.299429 10.898286-24.137143 19.163429-30.537143l0.182857-0.146286c8.411429-6.729143 18.358857-10.203429 30.464-10.203428 11.52 0 19.931429 3.291429 26.258285 9.216l0.146286 0.109714c6.253714 5.668571 9.801143 13.531429 9.801143 25.124571 0 6.656-1.499429 13.275429-4.754286 20.004572-3.291429 6.838857-9.508571 15.798857-19.163428 26.989714-9.508571 10.971429-23.222857 25.929143-41.289143 44.909714L5.379291 958.171429a11.337143 11.337143 0 0 0-3.108571 7.826285v46.665143zM512.003291 0v109.714286h329.142858a182.857143 182.857143 0 0 1 182.857142 182.857143v438.857142a182.857143 182.857143 0 0 1-182.857142 182.857143H402.289006a36.571429 36.571429 0 1 1 0-73.142857h438.857143a109.714286 109.714286 0 0 0 109.714285-109.714286V292.571429a109.714286 109.714286 0 0 0-109.714285-109.714286h-329.142858v109.714286L292.57472 146.285714l219.428571-146.285714zM108.913006 365.714286a11.483429 11.483429 0 0 1-11.52-11.483429V76.361143H42.791863a11.483429 11.483429 0 0 1-11.52-11.483429V11.483429C31.235291 5.156571 36.391863 0 42.791863 0h128.621714C177.703863 0 182.860434 5.12 182.860434 11.483429v342.747428c0 6.326857-5.12 11.483429-11.483428 11.483429H108.913006z"})],-1)),i.createElementVNode("span",Rh,i.toDisplayString(i.unref(o)("ol.continue")),1)],2),i.createElementVNode("button",{class:i.normalizeClass(["olm-item",{disabled:!t.canStartNew}]),role:"menuitem",onClick:u},[p[2]||(p[2]=i.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"15",height:"15","aria-hidden":"true",fill:"currentColor"},[i.createElementVNode("path",{d:"M128 324.288V162.112l-17.088 17.088c-17.024 17.088-42.624 8.512-59.712-8.512C34.112 153.6 42.688 128 59.712 119.488L128 76.8c25.6-17.088 51.2-17.088 68.288 8.512 8.512 8.576 8.512 17.088 8.512 25.6v204.8c0 25.6-17.088 42.688-34.112 42.688C153.6 358.4 128 341.312 128 324.288zM170.688 469.312c-25.6 0-42.688 25.6-42.688 42.688v213.312H59.712c-8.512 0-17.024 8.576-17.024 25.6v8.576L153.6 955.712c8.512 8.576 17.088 17.088 25.6 8.576l8.512-8.576 110.976-196.224c8.512-8.576 0-25.6-8.576-25.6h-76.8V512c0-17.088-17.024-42.688-42.624-42.688zM426.688 810.688c-25.6 0-42.688 17.024-42.688 42.624s17.088 42.688 42.688 42.688h512c25.6 0 42.624-17.088 42.624-42.688s-17.024-42.624-42.624-42.624h-512zM384 512c0-25.6 17.088-42.688 42.688-42.688h512c25.6 0 42.624 17.088 42.624 42.688s-17.024 42.688-42.624 42.688h-512C401.088 554.688 384 537.6 384 512zM426.688 128c-25.6 0-42.688 17.088-42.688 42.688s17.088 42.624 42.688 42.624h512c25.6 0 42.624-17.024 42.624-42.624S964.288 128 938.688 128h-512z"})],-1)),i.createElementVNode("span",Lh,i.toDisplayString(i.unref(o)("ol.startNew")),1)],2),i.createElementVNode("button",{class:"olm-item",role:"menuitem",onClick:d},[p[3]||(p[3]=i.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"15",height:"15","aria-hidden":"true",fill:"currentColor"},[i.createElementVNode("path",{d:"M45.421714 279.771429c0 4.388571 3.547429 7.936 7.899429 7.936H96.182857c4.388571 0 7.899429-3.547429 7.899429-7.899429V44.470857A7.899429 7.899429 0 0 0 96.182857 36.571429H7.899429A7.899429 7.899429 0 0 0 0 44.470857v36.644572c0 4.388571 3.547429 7.899429 7.899429 7.899428h37.522285V279.771429z m-32.182857 326.729142a7.899429 7.899429 0 0 1-7.899428-7.899428v-32.548572c0-2.011429 0.804571-3.986286 2.194285-5.449142l63.707429-66.633143c12.617143-13.238857 22.162286-23.661714 28.781714-31.305143 6.765714-7.789714 11.081143-14.043429 13.385143-18.797714a31.817143 31.817143 0 0 0 3.291429-13.933715c0-8.045714-2.450286-13.568-6.838858-17.554285l-0.109714-0.073143c-4.388571-4.096-10.24-6.4-18.285714-6.4a32.731429 32.731429 0 0 0-21.211429 7.131428l-0.146285 0.073143c-5.741714 4.461714-10.349714 11.337143-13.348572 21.321143a7.899429 7.899429 0 0 1-9.874286 5.229714l-37.558857-11.702857a7.899429 7.899429 0 0 1-5.376-9.106286c2.742857-13.641143 8.484571-25.6 17.188572-35.730285a84.114286 84.114286 0 0 1 31.195428-23.296c12.397714-5.485714 25.453714-8.228571 39.131429-8.228572 16.091429 0 30.537143 2.889143 43.154286 8.96a69.595429 69.595429 0 0 1 41.069714 64.950857c0 9.435429-1.755429 18.688-5.229714 27.794286a118.198857 118.198857 0 0 1-15.213715 27.062857l-0.036571 0.109715c-6.582857 8.740571-14.994286 18.468571-25.234286 29.110857L87.515429 554.422857h83.492571c4.388571 0 7.899429 3.510857 7.899429 7.899429v36.315428c0 4.388571-3.547429 7.899429-7.899429 7.899429H13.238857z m38.217143 354.486858a94.939429 94.939429 0 0 1-31.963429-22.052572l-0.109714-0.109714a79.030857 79.030857 0 0 1-18.212571-34.706286 7.899429 7.899429 0 0 1 5.010285-9.325714l37.558858-13.275429c4.096-1.462857 8.594286 0.731429 10.057142 4.827429 3.328 9.508571 8.265143 16.237714 14.482286 20.845714 6.326857 4.388571 13.824 6.729143 22.857143 6.729143 7.460571 0 13.421714-1.389714 18.176-3.84l0.073143-0.073143a27.721143 27.721143 0 0 0 11.593143-10.569143 33.938286 33.938286 0 0 0 4.242285-17.408 30.573714 30.573714 0 0 0-4.132571-16.64l-0.182857-0.292571A25.673143 25.673143 0 0 0 109.714286 854.637714a41.691429 41.691429 0 0 0-18.870857-3.913143 59.465143 59.465143 0 0 0-15.213715 2.194286 33.28 33.28 0 0 0-5.229714 2.048 7.862857 7.862857 0 0 1-10.642286-3.657143l-9.801143-20.553143a7.899429 7.899429 0 0 1 1.206858-8.594285l49.371428-56.393143H22.089143a7.899429 7.899429 0 0 1-7.862857-7.899429v-36.315428c0-4.388571 3.510857-7.899429 7.862857-7.899429h144.164571c4.388571 0 7.899429 3.547429 7.899429 7.899429v33.792a7.899429 7.899429 0 0 1-1.901714 5.12L132.388571 807.131429a76.909714 76.909714 0 0 1 14.043429 6.070857c11.739429 6.582857 20.992 15.725714 27.611429 27.318857 6.656 11.702857 9.874286 25.197714 9.874285 40.228571 0 16.530286-4.022857 31.634286-12.178285 45.165715a86.930286 86.930286 0 0 1-33.28 31.268571 97.755429 97.755429 0 0 1-47.323429 11.373714c-13.787429 0-26.989714-2.486857-39.497143-7.497143l-0.182857-0.073142zM292.571429 841.142857a36.571429 36.571429 0 1 0 0 73.142857h694.857142a36.571429 36.571429 0 1 0 0-73.142857H292.571429zM986.185143 138.605714a52.516571 52.516571 0 0 0-3.254857-10.532571 112.64 112.64 0 0 0-19.712-28.818286c-8.484571-9.216-16.237714-15.652571-23.222857-19.309714a72.045714 72.045714 0 0 0-11.702858-4.534857A55.515429 55.515429 0 0 0 914.285714 73.179429a43.776 43.776 0 0 0-29.184 9.764571c-3.657143 2.998857-8.228571 7.094857-13.714285 12.288-5.485714 5.193143-10.24 9.618286-14.262858 13.275429l93.366858 93.769142c2.340571-2.011429 4.827429-4.315429 7.497142-7.021714 2.304-2.340571 5.083429-5.010286 8.228572-8.009143 3.145143-2.998857 6.729143-6.509714 10.715428-10.532571 3.657143-4.022857 6.326857-8.192 8.009143-12.544A36.205714 36.205714 0 0 0 987.428571 151.149714c0-4.352-0.402286-8.521143-1.243428-12.544zM352.073143 614.509714c-7.314286 7.533714-11.958857 12.288-13.970286 14.262857a82.578286 82.578286 0 0 0-10.715428 12.8c-2.523429 3.876571-4.754286 8.118857-6.765715 12.8a111.798857 111.798857 0 0 0-6.473143 16.566858c-2.669714 8.009143-5.412571 16.786286-8.228571 26.331428-2.852571 9.508571-5.485714 18.688-8.009143 27.574857a169.764571 169.764571 0 0 0-4.754286 20.297143c-1.316571 8.704-0.475429 14.884571 2.523429 18.541714 2.998857 3.657143 8.996571 5.010286 17.956571 4.022858 4.352-0.658286 10.898286-2.194286 19.748572-4.498286a686.957714 686.957714 0 0 0 56.137143-18.066286c8.996571-3.328 15.798857-6.217143 20.48-8.521143 4.644571-2.011429 9.142857-4.681143 13.458285-8.045714a215.954286 215.954286 0 0 0 23.954286-21.577143c6.985143-6.985143 15.798857-15.945143 26.441143-26.806857 10.678857-10.861714 22.674286-22.820571 35.949714-35.84l39.936-40.594286 363.300572-363.885714-93.330286-94.244571-363.300571 363.849142-40.448 40.594286-36.425143 36.608c-10.971429 11.044571-20.114286 20.297143-27.428572 27.830857z"})],-1)),i.createElementVNode("span",Oh,i.toDisplayString(i.unref(o)("ol.modify")),1)])],38)):i.createCommentVNode("",!0)]))}}),Dh=["aria-label"],zh=["aria-label"],Hh={class:"np-ok",type:"submit"},Gi=6,tc=i.defineComponent({__name:"NumberPicker",props:{visible:{type:Boolean},initialValue:{},anchor:{},rootEl:{}},emits:["confirm","close"],setup(t,{emit:e}){const n=t,r=e,{t:o}=In(),l=i.ref(null),a=i.ref(n.initialValue),s=i.ref({top:0,left:0});i.watch([()=>n.visible,()=>n.anchor,()=>n.initialValue],async()=>{if(!n.visible||!n.anchor)return;a.value=n.initialValue,await i.nextTick();const d=n.anchor.getBoundingClientRect(),f=window.innerHeight,p=52;let b=!1;f-d.bottom-Gi<p&&d.top-Gi>p&&(b=!0),s.value={top:b?d.top-(p+Gi):d.bottom+Gi,left:d.left},i.nextTick(()=>{var g,k;(g=l.value)==null||g.focus(),(k=l.value)==null||k.select()})},{flush:"post",immediate:!0});const c=i.computed(()=>({top:`${s.value.top}px`,left:`${s.value.left}px`}));function u(){let d=a.value;Number.isFinite(d)||(d=n.initialValue),d=Math.max(1,Math.floor(d)),r("confirm",d)}return(d,f)=>(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[t.visible&&t.anchor&&t.rootEl?(i.openBlock(),i.createElementBlock("div",{key:0,class:"number-picker",style:i.normalizeStyle(c.value),role:"dialog","aria-label":i.unref(o)("numberPicker.title"),onMousedown:f[2]||(f[2]=i.withModifiers(()=>{},["stop"])),onTouchstart:f[3]||(f[3]=i.withModifiers(()=>{},["stop"]))},[i.createElementVNode("form",{class:"np-form",onSubmit:i.withModifiers(u,["prevent"])},[i.withDirectives(i.createElementVNode("input",{ref_key:"inputEl",ref:l,"onUpdate:modelValue":f[0]||(f[0]=p=>a.value=p),type:"number",class:"np-input",min:"1",step:"1","aria-label":i.unref(o)("numberPicker.inputLabel"),onKeydown:f[1]||(f[1]=i.withKeys(p=>r("close"),["escape"]))},null,40,zh),[[i.vModelText,a.value,void 0,{number:!0}]]),i.createElementVNode("button",Hh,i.toDisplayString(i.unref(o)("numberPicker.confirm")),1)],32)],44,Dh)):i.createCommentVNode("",!0)]))}}),Ph=["aria-label"],$h={key:0,class:"clp-custom"},Fh=["placeholder","aria-label"],Vh={class:"clp-actions"},Uh={class:"clp-ok",type:"submit"},qh=["aria-label"],Gh=["onClick"],Wh={class:"clp-item-name"},Kh={key:0,class:"clp-item-check","aria-hidden":"true"},Yh={class:"clp-item-name"},Xh=["aria-label"],vo=6,nc=200,Zh=120,jh=360,Qh=i.defineComponent({__name:"CodeLangPicker",props:{visible:{type:Boolean},initialValue:{},anchor:{},rootEl:{}},emits:["confirm","close"],setup(t,{emit:e}){const n=t,r=e,{t:o}=In(),l=["plain","javascript","typescript","python","java","c","cpp","csharp","go","rust","ruby","php","swift","kotlin","html","css","json","xml","yaml","markdown","lua","bash","shell","powershell","cmd","bat","sql","dart"],a=i.ref(null),s=i.ref(null),c=i.ref(null),u=i.ref(!1),d=i.ref(""),f=i.ref(n.initialValue),p=i.ref({top:0,left:0,above:!1,maxHeight:360}),b=i.ref(!1),g=i.ref(!1);function k(ne){return ne==="plain"?o("codeLang.plain"):ne}function E(){if(!n.visible||!n.anchor||!n.rootEl)return;const ne=a.value;if(!ne)return;const _=n.anchor.getBoundingClientRect(),$=window.innerHeight,D=Math.floor($-_.bottom-vo),W=Math.floor(_.top-vo),K=ne.scrollHeight;let B=!1;n.rootEl.getBoundingClientRect().bottom-_.bottom<nc&&W>nc&&(B=!0);let F,V;B?(F=!0,V=W):K<=D?(F=!1,V=D):W>D?(F=!0,V=W):(F=!1,V=D);const fe=Math.max(Zh,Math.min(V,jh)),Ee=document.documentElement.clientWidth,Me=Math.max(ne.clientWidth,200),ae=Math.max(vo,Math.min(Ee-Me-vo,_.left)),Te=F?Math.max(vo,_.top-vo-Math.min(K,fe)):_.bottom+vo;p.value={top:Te,left:ae,above:F,maxHeight:fe},i.nextTick(M)}i.watch([()=>n.visible,()=>n.anchor,()=>n.initialValue],async()=>{n.visible&&(u.value=!1,f.value=n.initialValue??"plain",d.value=f.value==="plain"?"":f.value,await i.nextTick(),E())},{flush:"post",immediate:!0});function M(){const ne=c.value;ne&&(b.value=ne.scrollTop>1,g.value=ne.scrollTop+ne.clientHeight<ne.scrollHeight-1)}function O(){const ne=c.value;ne&&(ne.scrollTop-=ne.clientHeight*.8)}function P(){const ne=c.value;ne&&(ne.scrollTop+=ne.clientHeight*.8)}Ui(c,M);function te(){u.value=!0,d.value=f.value==="plain"?"":f.value,i.nextTick(()=>{var ne,_;(ne=s.value)==null||ne.focus(),(_=s.value)==null||_.select(),E()})}function z(){u.value=!1,i.nextTick(E)}function H(){const ne=d.value.replace(/[^a-zA-Z]/g,"").slice(0,20);ne!==d.value&&(d.value=ne)}function ie(){const ne=(d.value??"").replace(/[^a-zA-Z]/g,"").slice(0,20);r("confirm",ne.length===0?"plain":ne)}const Q=i.computed(()=>({top:`${p.value.top}px`,left:`${p.value.left}px`,maxHeight:`${p.value.maxHeight}px`}));return(ne,_)=>(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[t.visible&&t.anchor&&t.rootEl?(i.openBlock(),i.createElementBlock("div",{key:0,ref_key:"menuEl",ref:a,class:i.normalizeClass(["code-lang-picker",{above:p.value.above}]),style:i.normalizeStyle(Q.value),role:"menu","aria-label":i.unref(o)("codeLang.title"),onMousedown:_[1]||(_[1]=i.withModifiers(()=>{},["stop"])),onTouchstart:_[2]||(_[2]=i.withModifiers(()=>{},["stop"])),onWheel:_[3]||(_[3]=i.withModifiers(()=>{},["prevent"])),onTouchmove:_[4]||(_[4]=i.withModifiers(()=>{},["prevent"]))},[u.value?(i.openBlock(),i.createElementBlock("div",$h,[i.createElementVNode("form",{class:"clp-form",onSubmit:i.withModifiers(ie,["prevent"])},[i.withDirectives(i.createElementVNode("input",{ref_key:"inputEl",ref:s,"onUpdate:modelValue":_[0]||(_[0]=$=>d.value=$),type:"text",class:"clp-input",maxlength:"20",placeholder:i.unref(o)("codeLang.placeholder"),"aria-label":i.unref(o)("codeLang.inputLabel"),autocomplete:"off",spellcheck:"false",onInput:H,onKeydown:i.withKeys(z,["escape"])},null,40,Fh),[[i.vModelText,d.value]]),i.createElementVNode("div",Vh,[i.createElementVNode("button",Uh,i.toDisplayString(i.unref(o)("codeLang.confirm")),1),i.createElementVNode("button",{class:"clp-cancel",type:"button",onClick:z},i.toDisplayString(i.unref(o)("codeLang.cancel")),1)])],32)])):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[b.value?(i.openBlock(),i.createElementBlock("button",{key:0,class:"menu-scroll-btn menu-scroll-up",type:"button","aria-label":i.unref(o)("ui.scrollUp"),onMousedown:i.withModifiers(O,["prevent"])},[..._[5]||(_[5]=[i.createElementVNode("svg",{viewBox:"0 0 12 12",width:"10",height:"10","aria-hidden":"true"},[i.createElementVNode("path",{d:"M3 7.5L6 4.5L9 7.5",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],40,qh)):i.createCommentVNode("",!0),i.createElementVNode("div",{ref_key:"scrollEl",ref:c,class:"clp-list",onScroll:M},[(i.openBlock(),i.createElementBlock(i.Fragment,null,i.renderList(l,$=>i.createElementVNode("button",{key:$,class:i.normalizeClass(["clp-item",{active:$===f.value}]),role:"menuitem",onClick:D=>r("confirm",$)},[i.createElementVNode("span",Wh,i.toDisplayString(k($)),1),$===f.value?(i.openBlock(),i.createElementBlock("span",Kh,"✓")):i.createCommentVNode("",!0)],10,Gh)),64)),i.createElementVNode("button",{class:"clp-item clp-item-custom",role:"menuitem",onClick:te},[i.createElementVNode("span",Yh,i.toDisplayString(i.unref(o)("codeLang.custom")),1)])],544),g.value?(i.openBlock(),i.createElementBlock("button",{key:1,class:"menu-scroll-btn menu-scroll-down",type:"button","aria-label":i.unref(o)("ui.scrollDown"),onMousedown:i.withModifiers(P,["prevent"])},[..._[6]||(_[6]=[i.createElementVNode("svg",{viewBox:"0 0 12 12",width:"10",height:"10","aria-hidden":"true"},[i.createElementVNode("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],40,Xh)):i.createCommentVNode("",!0)],64))],46,Ph)):i.createCommentVNode("",!0)]))}}),Jh=["aria-label"],em={key:0,class:"link-popover-view"},tm=["href","title"],nm={class:"link-popover-actions"},rm=["title","aria-label"],om=["title","aria-label"],im=["title","aria-label"],lm=["title","aria-label"],am={key:1,class:"link-popover-edit"},sm=["placeholder"],cm={key:0,class:"link-popover-error",role:"alert"},um=["placeholder"],dm={class:"link-popover-edit-actions"},fm=["title"],hm=["title"],rc=i.defineComponent({__name:"LinkPopover",props:{visible:{type:Boolean},anchorRect:{},blockId:{},from:{},to:{},href:{},text:{},initialMode:{},showTextInput:{type:Boolean},onSaveLink:{type:Function},onRemoveLinkMark:{type:Function},readonly:{type:Boolean}},emits:["close"],setup(t,{expose:e,emit:n}){const r=t,o=n,{t:l}=In(),a=Yn(),s=i.ref(null),c=i.ref(null),u=i.ref(!1),d=i.ref(!1),f=i.ref("view"),p=i.ref(""),b=i.ref(""),g=i.ref({top:0,left:0}),k=i.ref(""),E=i.computed(()=>r.showTextInput??!1),M=i.computed(()=>f.value==="edit"?p.value:r.href),O=i.computed(()=>{const W=ho(M.value);return Lr(W)??"#"}),P=i.computed(()=>{const W=M.value;return W?W.length>60?W.slice(0,57)+"...":W:l("link.emptyUrl")}),te=i.computed(()=>({top:`${g.value.top}px`,left:`${g.value.left}px`,visibility:d.value?"visible":"hidden"}));async function z(){if(!r.visible||!r.anchorRect||!s.value)return;await i.nextTick();const K=s.value.getBoundingClientRect(),B=8,A=document.documentElement.clientWidth,F=document.documentElement.clientHeight-r.anchorRect.bottom-B,V=r.anchorRect.top-B,Ee=F<K.height+B&&V>F?Math.max(B,r.anchorRect.top-K.height-B):r.anchorRect.bottom+B,Me=r.anchorRect.left+(r.anchorRect.width-K.width)/2,ae=Math.max(B,A-K.width-B),Te=Math.max(B,Math.min(ae,Me));g.value={top:Ee,left:Te},d.value=!0}i.watch(()=>r.visible,W=>{W?(u.value=!0,f.value=r.readonly?"view":r.initialMode??(r.href?"view":"edit"),p.value=r.href,b.value=r.text,d.value=!1,i.nextTick(()=>{var K,B;z(),f.value==="edit"&&((K=c.value)==null||K.focus(),(B=c.value)==null||B.select())})):(d.value=!1,setTimeout(()=>{r.visible||(u.value=!1)},200))},{immediate:!0}),i.watch(()=>r.anchorRect,()=>{r.visible&&z()});function H(){r.readonly||(f.value="edit",p.value=r.href,b.value=r.text,k.value="",i.nextTick(()=>{var W,K;(W=c.value)==null||W.focus(),(K=c.value)==null||K.select()}))}function ie(){const W=p.value;if(!W.trim()){k.value="";return}const K=ho(W);Lr(K)?k.value="":k.value=l("link.invalidUrl")}function Q(){var A,j,F;if(!r.blockId&&!r.onSaveLink)return;const W=ho(p.value),K=Lr(W);if(!K){k.value=l("link.invalidUrl"),(A=c.value)==null||A.focus();return}k.value="";const B=E.value&&b.value!==r.text;r.onSaveLink?r.onSaveLink(K,B?b.value:void 0):(F=(j=a.commands).setLink)==null||F.call(j,{id:r.blockId,href:K,from:r.from,to:r.to,text:B?b.value:void 0}),r.href?(f.value="view",i.nextTick(()=>{z()})):o("close")}function ne(){r.href?(f.value="view",p.value=r.href,b.value=r.text):o("close")}function _(){var W,K;!r.blockId&&!r.onRemoveLinkMark||(r.onRemoveLinkMark?r.onRemoveLinkMark():(K=(W=a.commands).unsetLink)==null||K.call(W,{id:r.blockId,from:r.from,to:r.to}),o("close"))}function $(){var K;const W=ho(r.href);W&&((K=navigator.clipboard)==null||K.writeText(W))}function D(){const W=ho(r.href),K=Lr(W);K&&K!=="#"&&window.open(K,"_blank","noopener,noreferrer")}return i.onBeforeUnmount(()=>{u.value=!1}),e({isEditing:()=>f.value==="edit",save:Q,cancel:ne}),(W,K)=>(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[u.value?(i.openBlock(),i.createElementBlock("div",{key:0,ref_key:"popoverEl",ref:s,class:i.normalizeClass(["link-popover",{visible:d.value}]),style:i.normalizeStyle(te.value),role:"dialog","aria-label":i.unref(l)("link.popoverLabel"),onMousedown:K[2]||(K[2]=i.withModifiers(()=>{},["stop"])),onTouchstart:K[3]||(K[3]=i.withModifiers(()=>{},["stop"]))},[f.value==="view"?(i.openBlock(),i.createElementBlock("div",em,[i.createElementVNode("a",{href:O.value,target:"_blank",rel:"noopener noreferrer",class:"link-popover-url",title:M.value,onClick:D},i.toDisplayString(P.value),9,tm),i.createElementVNode("div",nm,[i.createElementVNode("button",{class:"link-popover-btn",title:i.unref(l)("link.open"),"aria-label":i.unref(l)("link.open"),onMousedown:i.withModifiers(D,["prevent","stop"])},[...K[4]||(K[4]=[i.createElementVNode("svg",{viewBox:"0 0 16 16",width:"14",height:"14","aria-hidden":"true"},[i.createElementVNode("path",{d:"M6 3H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h7a2 2 0 0 0 2-2v-2",fill:"none",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round","stroke-linejoin":"round"}),i.createElementVNode("path",{d:"M9 3h4v4M13 3L7 9",fill:"none",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],40,rm),i.createElementVNode("button",{class:"link-popover-btn",title:i.unref(l)("link.copy"),"aria-label":i.unref(l)("link.copy"),onMousedown:i.withModifiers($,["prevent","stop"])},[...K[5]||(K[5]=[i.createElementVNode("svg",{viewBox:"0 0 16 16",width:"14",height:"14","aria-hidden":"true"},[i.createElementVNode("rect",{x:"5",y:"5",width:"8",height:"8",rx:"1.5",fill:"none",stroke:"currentColor","stroke-width":"1.3"}),i.createElementVNode("path",{d:"M3 10.5V3.5C3 2.67 3.67 2 4.5 2H10",fill:"none",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"})],-1)])],40,om),t.readonly?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("button",{key:0,class:"link-popover-btn",title:i.unref(l)("link.edit"),"aria-label":i.unref(l)("link.edit"),onMousedown:i.withModifiers(H,["prevent","stop"])},[...K[6]||(K[6]=[i.createElementVNode("svg",{viewBox:"0 0 16 16",width:"14",height:"14","aria-hidden":"true"},[i.createElementVNode("path",{d:"M11.5 2.5l2 2L6 12l-2.5.5L4 10l7.5-7.5z",fill:"none",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],40,im)),t.readonly?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("button",{key:1,class:"link-popover-btn link-popover-danger",title:i.unref(l)("link.remove"),"aria-label":i.unref(l)("link.remove"),onMousedown:i.withModifiers(_,["prevent","stop"])},[...K[7]||(K[7]=[i.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"14",height:"14","aria-hidden":"true"},[i.createElementVNode("path",{d:"M394.666667 213.333333a32 32 0 0 1 4.693333 63.658667l-4.693333 0.341333H298.666667a149.333333 149.333333 0 0 0-8.789334 298.410667L298.666667 576h96a32 32 0 0 1 4.693333 63.658667L394.666667 640H298.666667a213.333333 213.333333 0 0 1-10.666667-426.410667L298.666667 213.333333h96zM725.333333 213.333333a213.333333 213.333333 0 0 1 189.013334 312.405334 277.162667 277.162667 0 0 0-55.210667-32.64 149.333333 149.333333 0 0 0-125.013333-215.466667L725.333333 277.290667h-96a32 32 0 0 1-4.693333-63.658667L629.333333 213.333333H725.333333zM298.666667 394.666667h426.666666a32 32 0 0 1 4.352 63.701333L725.333333 458.666667H298.666667a32 32 0 0 1-4.352-63.701334L298.666667 394.666667z m682.666666 352a234.666667 234.666667 0 1 1-469.333333 0 234.666667 234.666667 0 0 1 469.333333 0z m-304.896-100.437334a21.333333 21.333333 0 0 0-30.208 30.208l70.272 70.229334-70.272 70.229333a21.333333 21.333333 0 0 0 30.208 30.208l70.229334-70.272 70.229333 70.272a21.333333 21.333333 0 0 0 30.208-30.208L776.832 746.666667l70.272-70.229334a21.333333 21.333333 0 0 0-30.208-30.208L746.666667 716.501333l-70.229334-70.272z",fill:"currentColor"})],-1)])],40,lm))])])):(i.openBlock(),i.createElementBlock("div",am,[i.withDirectives(i.createElementVNode("input",{ref_key:"urlInputEl",ref:c,"onUpdate:modelValue":K[0]||(K[0]=B=>p.value=B),class:i.normalizeClass(["link-popover-input",{"link-popover-input-error":k.value}]),type:"text",placeholder:i.unref(l)("link.urlPlaceholder"),onKeydown:[i.withKeys(Q,["enter"]),i.withKeys(ne,["escape"])],onInput:ie},null,42,sm),[[i.vModelText,p.value]]),k.value?(i.openBlock(),i.createElementBlock("div",cm,i.toDisplayString(k.value),1)):i.createCommentVNode("",!0),E.value?i.withDirectives((i.openBlock(),i.createElementBlock("input",{key:1,"onUpdate:modelValue":K[1]||(K[1]=B=>b.value=B),class:"link-popover-input",type:"text",placeholder:i.unref(l)("link.textPlaceholder"),onKeydown:[i.withKeys(Q,["enter"]),i.withKeys(ne,["escape"])]},null,40,um)),[[i.vModelText,b.value]]):i.createCommentVNode("",!0),i.createElementVNode("div",dm,[i.createElementVNode("button",{class:"link-popover-btn link-popover-save",title:i.unref(l)("link.save"),onMousedown:i.withModifiers(Q,["prevent","stop"])},i.toDisplayString(i.unref(l)("link.save")),41,fm),i.createElementVNode("button",{class:"link-popover-btn link-popover-cancel",title:i.unref(l)("link.cancel"),onMousedown:i.withModifiers(ne,["prevent","stop"])},i.toDisplayString(i.unref(l)("link.cancel")),41,hm)])]))],46,Jh)):i.createCommentVNode("",!0)]))}}),mm={default:null,validate:t=>t==null?!0:Number.isInteger(t)&&t>=1};function oc(t,e){const n=Ao(t,e),r=Kn(t,e);if(r<0)return 1;const o=t.blocks.get(e);if(!o)return 1;const l=o.attrs.startNumber;if(typeof l=="number")return l;let a=null,s=0;for(let c=r-1;c>=0;c--){const u=t.blocks.get(n[c]);if(!u||u.type!=="orderedList")break;const d=u.attrs.startNumber;if(typeof d=="number"){a=d;break}s++}return a!==null?a+s+1:1+s}const pm=i.defineComponent({name:"OrderedListBlock",props:{block:{type:Object,required:!0},placeholder:{type:String,default:void 0}},setup(t){const e=Yn(),n=Rr(),r=i.ref(null),o=i.useAttrs(),l={...typeof o.onLinkClick=="function"?{onLinkClick:o.onLinkClick}:{},...typeof o.onSlashTrigger=="function"?{onSlashTrigger:o.onSlashTrigger}:{},...typeof o.onInputChanged=="function"?{onInputChanged:o.onInputChanged}:{}},a=i.ref(0),s=e.subscribe(()=>{a.value++});return i.onBeforeUnmount(s),()=>{a.value;const c=e.getState().doc,u=oc(c,t.block.id),d=i.h("div",{ref:r,class:"ol-marker","data-ol-number":String(u),onMousedown:k=>{k.preventDefault(),k.stopPropagation()},onClick:k=>{if(k.stopPropagation(),!n.value)return;const E=new CustomEvent("ordered-list-marker-click",{bubbles:!0,detail:{blockId:t.block.id,anchor:r.value}});k.currentTarget.dispatchEvent(E)}},[`${u}.`]),f=Jn(t.block.attrs),p=f.filter(k=>k.startsWith("be-indent-")),b=f.filter(k=>!k.startsWith("be-indent-")),g=i.h(zr,{block:t.block,placeholder:t.placeholder,class:["block-ordered-list-content",...b],...l});return i.h("div",{class:["block-ordered-list-wrapper",...p],"data-block-type":"orderedList"},[d,g])}}}),gm={name:"orderedList",schema:{type:"orderedList",content:"text",nestable:!0,listLike:!0,attrs:{...Rn,startNumber:mm}},renderer:{component:pm},slashCommands:[{id:"ordered-list",title:"slash.orderedList.title",keywords:["list","numbered","ordered","有序列表","编号列表","ol","1"],description:"slash.orderedList.description",icon:ua,command:"convertBlock",category:"list",args:()=>({id:"__currentBlock__",type:"orderedList"})}],inputRules:[{name:"ordered-1-dot",pattern:/^1\. $/,command:"convertBlock",args:()=>({id:"__currentBlock__",type:"orderedList",__stripPrefix:3})}]},bm=i.defineComponent({name:"ParagraphBlock",props:{block:{type:Object,required:!0},placeholder:{type:String,default:void 0}},setup(t){return()=>i.h(zr,{block:t.block,placeholder:t.placeholder,class:["block-paragraph",...Jn(t.block.attrs)]})}}),ic={name:"paragraph",schema:{type:"paragraph",content:"text",nestable:!0,attrs:{...Rn}},renderer:{component:bm},slashCommands:[{id:"paragraph",title:"slash.paragraph.title",keywords:["text","paragraph","normal","正文","段落"],description:"slash.paragraph.description",icon:na,command:"convertBlock",category:"basic",args:t=>({id:"__currentBlock__",type:"paragraph"})}],inputRules:[{name:"paragraph-noop",pattern:/^$/,command:"setText",args:t=>({id:"__currentBlock__",content:[]})}]},vm=i.defineComponent({name:"HeadingBlock",props:{block:{type:Object,required:!0},placeholder:{type:String,default:void 0}},setup(t){return()=>{const e=t.block.attrs.level??1;return i.h(zr,{block:t.block,placeholder:t.placeholder,class:["block-heading",`block-heading-h${e}`,...Jn(t.block.attrs)]})}}});function Lo(t){const e="#".repeat(t);return{name:`heading-h${t}`,pattern:new RegExp(`^${e} $`),command:"convertBlock",args:()=>({id:"__currentBlock__",type:"heading",attrs:{level:t},__stripPrefix:t+1})}}const Oo=(t,e,n,r,o,l)=>({id:t,title:n,keywords:l,description:r,icon:o,command:"convertBlock",category:"basic",args:()=>({id:"__currentBlock__",type:"heading",attrs:{level:e}})}),lc={name:"heading",schema:{type:"heading",content:"text",nestable:!0,attrs:{level:{default:1,validate:t=>typeof t=="number"&&t>=1&&t<=6},...Rn}},renderer:{component:vm},slashCommands:[Oo("heading-1",1,"slash.heading1.title","slash.heading1.description",ra,["h1","标题1","大标题","title"]),Oo("heading-2",2,"slash.heading2.title","slash.heading2.description",oa,["h2","标题2","小标题"]),Oo("heading-3",3,"slash.heading3.title","slash.heading3.description",ia,["h3","标题3","section"]),Oo("heading-4",4,"slash.heading4.title","slash.heading4.description",la,["h4","标题4"]),Oo("heading-5",5,"slash.heading5.title","slash.heading5.description",aa,["h5","标题5"]),Oo("heading-6",6,"slash.heading6.title","slash.heading6.description",sa,["h6","标题6"])],inputRules:[Lo(1),Lo(2),Lo(3),Lo(4),Lo(5),Lo(6)]},ac={name:"default-keymap",keymap:[{key:"Enter",command:"enter"},{key:"Backspace",command:"backspace"},{key:"Delete",command:"backspace"},{key:"Tab",command:"indentBlock"},{key:"Shift-Tab",command:"outdentBlock"},{key:"Mod-a",command:"selectAll"},{key:"ArrowUp",command:"moveToPreviousBlock"},{key:"ArrowDown",command:"moveToNextBlock"}]},sc={name:"history-keymap",keymap:[{key:"Mod-z",command:"undo"},{key:"Mod-Shift-z",command:"redo"},{key:"Mod-y",command:"redo"}]},km=i.defineComponent({name:"BulletListBlock",props:{block:{type:Object,required:!0},placeholder:{type:String,default:void 0}},setup(t){return()=>i.h(zr,{block:t.block,placeholder:t.placeholder,class:["block-bullet-list",...Jn(t.block.attrs)]})}}),ym={name:"bulletList",schema:{type:"bulletList",content:"text",nestable:!0,listLike:!0,attrs:{...Rn}},renderer:{component:km},slashCommands:[{id:"bullet-list",title:"slash.bulletList.title",keywords:["list","bullet","unordered","项目符号","无序列表","ul","-","*"],description:"slash.bulletList.description",icon:ca,command:"convertBlock",category:"list",args:()=>({id:"__currentBlock__",type:"bulletList"})}],inputRules:[{name:"bullet-dash",pattern:/^- $/,command:"convertBlock",args:()=>({id:"__currentBlock__",type:"bulletList",__stripPrefix:2})},{name:"bullet-star",pattern:/^\* $/,command:"convertBlock",args:()=>({id:"__currentBlock__",type:"bulletList",__stripPrefix:2})}]},wm=i.defineComponent({name:"TodoListBlock",props:{block:{type:Object,required:!0},placeholder:{type:String,default:void 0}},setup(t){const e=Yn(),n=i.useAttrs(),r={...typeof n.onLinkClick=="function"?{onLinkClick:n.onLinkClick}:{},...typeof n.onSlashTrigger=="function"?{onSlashTrigger:n.onSlashTrigger}:{},...typeof n.onInputChanged=="function"?{onInputChanged:n.onInputChanged}:{}};function o(l){var s,c;const a=l.target;(c=(s=e.commands).setAttrs)==null||c.call(s,{id:t.block.id,attrs:{...t.block.attrs,checked:a.checked}})}return()=>{const l=!!t.block.attrs.checked,a=Jn(t.block.attrs),s=a.filter(d=>d.startsWith("be-indent-")),c=a.filter(d=>!d.startsWith("be-indent-")),u=["block-todo-list",l?"todo-checked":"todo-unchecked",...c];return i.h("div",{class:["block-todo-wrapper",...s]},[i.h("input",{type:"checkbox",class:"block-todo-checkbox",checked:l,onchange:o}),i.h(zr,{block:t.block,placeholder:t.placeholder,class:u,...r})])}}}),xm={name:"todoList",schema:{type:"todoList",content:"text",nestable:!0,listLike:!0,attrs:{...Rn,checked:{default:!1,validate:t=>typeof t=="boolean"}}},renderer:{component:wm},slashCommands:[{id:"todo-list",title:"slash.todoList.title",keywords:["todo","task","checkbox","待办","任务","复选框","[]","[ ]"],description:"slash.todoList.description",icon:da,command:"convertBlock",category:"list",args:()=>({id:"__currentBlock__",type:"todoList",attrs:{checked:!1}})}],inputRules:[{name:"todo-empty",pattern:/^\[\] $/,command:"convertBlock",args:()=>({id:"__currentBlock__",type:"todoList",attrs:{checked:!1},__stripPrefix:3})},{name:"todo-space-bracket",pattern:/^\[ \] $/,command:"convertBlock",args:()=>({id:"__currentBlock__",type:"todoList",attrs:{checked:!1},__stripPrefix:4})}]},Em=i.defineComponent({name:"QuoteBlock",props:{block:{type:Object,required:!0},placeholder:{type:String,default:void 0}},setup(t){return()=>i.h(zr,{block:t.block,placeholder:t.placeholder,class:["block-quote",...Jn(t.block.attrs)]})}}),Cm={name:"quote",schema:{type:"quote",content:"text",nestable:!1,disallowedMarks:["italic"],attrs:{...xf,indent:Rn.indent}},renderer:{component:Em},slashCommands:[{id:"quote",title:"slash.quote.title",keywords:["quote","blockquote","引用",">","引言"],description:"slash.quote.description",icon:fa,command:"convertBlock",category:"other",args:()=>({id:"__currentBlock__",type:"quote"})}],inputRules:[{name:"quote-gt",pattern:/^> $/,command:"convertBlock",args:()=>({id:"__currentBlock__",type:"quote",__stripPrefix:2})}]};function Sm(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function cc(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(e=>{const n=t[e],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&cc(n)}),t}class uc{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function dc(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function eo(t,...e){const n=Object.create(null);for(const r in t)n[r]=t[r];return e.forEach(function(r){for(const o in r)n[o]=r[o]}),n}const Tm="</span>",fc=t=>!!t.scope,Mm=(t,{prefix:e})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){const n=t.split(".");return[`${e}${n.shift()}`,...n.map((r,o)=>`${r}${"_".repeat(o+1)}`)].join(" ")}return`${e}${t}`};class Am{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=dc(e)}openNode(e){if(!fc(e))return;const n=Mm(e.scope,{prefix:this.classPrefix});this.span(n)}closeNode(e){fc(e)&&(this.buffer+=Tm)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}const hc=(t={})=>{const e={children:[]};return Object.assign(e,t),e};class pa{constructor(){this.rootNode=hc(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const n=hc({scope:e});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return typeof n=="string"?e.addText(n):n.children&&(e.openNode(n),n.children.forEach(r=>this._walk(e,r)),e.closeNode(n)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every(n=>typeof n=="string")?e.children=[e.children.join("")]:e.children.forEach(n=>{pa._collapse(n)}))}}class Nm extends pa{constructor(e){super(),this.options=e}addText(e){e!==""&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,n){const r=e.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new Am(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function mi(t){return t?typeof t=="string"?t:t.source:null}function mc(t){return ko("(?=",t,")")}function Bm(t){return ko("(?:",t,")*")}function Im(t){return ko("(?:",t,")?")}function ko(...t){return t.map(n=>mi(n)).join("")}function _m(t){const e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function ga(...t){return"("+(_m(t).capture?"":"?:")+t.map(r=>mi(r)).join("|")+")"}function pc(t){return new RegExp(t.toString()+"|").exec("").length-1}function Rm(t,e){const n=t&&t.exec(e);return n&&n.index===0}const Lm=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function ba(t,{joinWith:e}){let n=0;return t.map(r=>{n+=1;const o=n;let l=mi(r),a="";for(;l.length>0;){const s=Lm.exec(l);if(!s){a+=l;break}a+=l.substring(0,s.index),l=l.substring(s.index+s[0].length),s[0][0]==="\\"&&s[1]?a+="\\"+String(Number(s[1])+o):(a+=s[0],s[0]==="("&&n++)}return a}).map(r=>`(${r})`).join(e)}const Om=/\b\B/,gc="[a-zA-Z]\\w*",va="[a-zA-Z_]\\w*",bc="\\b\\d+(\\.\\d+)?",vc="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",kc="\\b(0b[01]+)",Dm="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",zm=(t={})=>{const e=/^#![ ]*\//;return t.binary&&(t.begin=ko(e,/.*\b/,t.binary,/\b.*/)),eo({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},t)},pi={begin:"\\\\[\\s\\S]",relevance:0},Hm={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[pi]},Pm={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[pi]},$m={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Wi=function(t,e,n={}){const r=eo({scope:"comment",begin:t,end:e,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const o=ga("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:ko(/[ ]+/,"(",o,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},Fm=Wi("//","$"),Vm=Wi("/\\*","\\*/"),Um=Wi("#","$"),qm={scope:"number",begin:bc,relevance:0},Gm={scope:"number",begin:vc,relevance:0},Wm={scope:"number",begin:kc,relevance:0},Km={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[pi,{begin:/\[/,end:/\]/,relevance:0,contains:[pi]}]},Ym={scope:"title",begin:gc,relevance:0},Xm={scope:"title",begin:va,relevance:0},Zm={begin:"\\.\\s*"+va,relevance:0};var Ki=Object.freeze({__proto__:null,APOS_STRING_MODE:Hm,BACKSLASH_ESCAPE:pi,BINARY_NUMBER_MODE:Wm,BINARY_NUMBER_RE:kc,COMMENT:Wi,C_BLOCK_COMMENT_MODE:Vm,C_LINE_COMMENT_MODE:Fm,C_NUMBER_MODE:Gm,C_NUMBER_RE:vc,END_SAME_AS_BEGIN:function(t){return Object.assign(t,{"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{n.data._beginMatch!==e[1]&&n.ignoreMatch()}})},HASH_COMMENT_MODE:Um,IDENT_RE:gc,MATCH_NOTHING_RE:Om,METHOD_GUARD:Zm,NUMBER_MODE:qm,NUMBER_RE:bc,PHRASAL_WORDS_MODE:$m,QUOTE_STRING_MODE:Pm,REGEXP_MODE:Km,RE_STARTERS_RE:Dm,SHEBANG:zm,TITLE_MODE:Ym,UNDERSCORE_IDENT_RE:va,UNDERSCORE_TITLE_MODE:Xm});function jm(t,e){t.input[t.index-1]==="."&&e.ignoreMatch()}function Qm(t,e){t.className!==void 0&&(t.scope=t.className,delete t.className)}function Jm(t,e){e&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=jm,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function e2(t,e){Array.isArray(t.illegal)&&(t.illegal=ga(...t.illegal))}function t2(t,e){if(t.match){if(t.begin||t.end)throw new Error("begin & end are not supported with match");t.begin=t.match,delete t.match}}function n2(t,e){t.relevance===void 0&&(t.relevance=1)}const r2=(t,e)=>{if(!t.beforeMatch)return;if(t.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},t);Object.keys(t).forEach(r=>{delete t[r]}),t.keywords=n.keywords,t.begin=ko(n.beforeMatch,mc(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},o2=["of","and","for","in","not","or","if","then","parent","list","value"],i2="keyword";function yc(t,e,n=i2){const r=Object.create(null);return typeof t=="string"?o(n,t.split(" ")):Array.isArray(t)?o(n,t):Object.keys(t).forEach(function(l){Object.assign(r,yc(t[l],e,l))}),r;function o(l,a){e&&(a=a.map(s=>s.toLowerCase())),a.forEach(function(s){const c=s.split("|");r[c[0]]=[l,l2(c[0],c[1])]})}}function l2(t,e){return e?Number(e):a2(t)?0:1}function a2(t){return o2.includes(t.toLowerCase())}const wc={},yo=t=>{console.error(t)},xc=(t,...e)=>{console.log(`WARN: ${t}`,...e)},Do=(t,e)=>{wc[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),wc[`${t}/${e}`]=!0)},Yi=new Error;function Ec(t,e,{key:n}){let r=0;const o=t[n],l={},a={};for(let s=1;s<=e.length;s++)a[s+r]=o[s],l[s+r]=!0,r+=pc(e[s-1]);t[n]=a,t[n]._emit=l,t[n]._multi=!0}function s2(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw yo("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Yi;if(typeof t.beginScope!="object"||t.beginScope===null)throw yo("beginScope must be object"),Yi;Ec(t,t.begin,{key:"beginScope"}),t.begin=ba(t.begin,{joinWith:""})}}function c2(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw yo("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Yi;if(typeof t.endScope!="object"||t.endScope===null)throw yo("endScope must be object"),Yi;Ec(t,t.end,{key:"endScope"}),t.end=ba(t.end,{joinWith:""})}}function u2(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function d2(t){u2(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),s2(t),c2(t)}function f2(t){function e(a,s){return new RegExp(mi(a),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(s?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(s,c){c.position=this.position++,this.matchIndexes[this.matchAt]=c,this.regexes.push([c,s]),this.matchAt+=pc(s)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const s=this.regexes.map(c=>c[1]);this.matcherRe=e(ba(s,{joinWith:"|"}),!0),this.lastIndex=0}exec(s){this.matcherRe.lastIndex=this.lastIndex;const c=this.matcherRe.exec(s);if(!c)return null;const u=c.findIndex((f,p)=>p>0&&f!==void 0),d=this.matchIndexes[u];return c.splice(0,u),Object.assign(c,d)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(s){if(this.multiRegexes[s])return this.multiRegexes[s];const c=new n;return this.rules.slice(s).forEach(([u,d])=>c.addRule(u,d)),c.compile(),this.multiRegexes[s]=c,c}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(s,c){this.rules.push([s,c]),c.type==="begin"&&this.count++}exec(s){const c=this.getMatcher(this.regexIndex);c.lastIndex=this.lastIndex;let u=c.exec(s);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){const d=this.getMatcher(0);d.lastIndex=this.lastIndex+1,u=d.exec(s)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function o(a){const s=new r;return a.contains.forEach(c=>s.addRule(c.begin,{rule:c,type:"begin"})),a.terminatorEnd&&s.addRule(a.terminatorEnd,{type:"end"}),a.illegal&&s.addRule(a.illegal,{type:"illegal"}),s}function l(a,s){const c=a;if(a.isCompiled)return c;[Qm,t2,d2,r2].forEach(d=>d(a,s)),t.compilerExtensions.forEach(d=>d(a,s)),a.__beforeBegin=null,[Jm,e2,n2].forEach(d=>d(a,s)),a.isCompiled=!0;let u=null;return typeof a.keywords=="object"&&a.keywords.$pattern&&(a.keywords=Object.assign({},a.keywords),u=a.keywords.$pattern,delete a.keywords.$pattern),u=u||/\w+/,a.keywords&&(a.keywords=yc(a.keywords,t.case_insensitive)),c.keywordPatternRe=e(u,!0),s&&(a.begin||(a.begin=/\B|\b/),c.beginRe=e(c.begin),!a.end&&!a.endsWithParent&&(a.end=/\B|\b/),a.end&&(c.endRe=e(c.end)),c.terminatorEnd=mi(c.end)||"",a.endsWithParent&&s.terminatorEnd&&(c.terminatorEnd+=(a.end?"|":"")+s.terminatorEnd)),a.illegal&&(c.illegalRe=e(a.illegal)),a.contains||(a.contains=[]),a.contains=[].concat(...a.contains.map(function(d){return h2(d==="self"?a:d)})),a.contains.forEach(function(d){l(d,c)}),a.starts&&l(a.starts,s),c.matcher=o(c),c}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=eo(t.classNameAliases||{}),l(t)}function Cc(t){return t?t.endsWithParent||Cc(t.starts):!1}function h2(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return eo(t,{variants:null},e)})),t.cachedVariants?t.cachedVariants:Cc(t)?eo(t,{starts:t.starts?eo(t.starts):null}):Object.isFrozen(t)?eo(t):t}var m2="11.11.0";class p2 extends Error{constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}}const ka=dc,Sc=eo,Tc=Symbol("nomatch"),g2=7,Mc=function(t){const e=Object.create(null),n=Object.create(null),r=[];let o=!0;const l="Could not find the language '{}', did you forget to load/include a language module?",a={disableAutodetect:!0,name:"Plain text",contains:[]};let s={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Nm};function c(A){return s.noHighlightRe.test(A)}function u(A){let j=A.className+" ";j+=A.parentNode?A.parentNode.className:"";const F=s.languageDetectRe.exec(j);if(F){const V=Q(F[1]);return V||(xc(l.replace("{}",F[1])),xc("Falling back to no-highlight mode for this block.",A)),V?F[1]:"no-highlight"}return j.split(/\s+/).find(V=>c(V)||Q(V))}function d(A,j,F){let V="",fe="";typeof j=="object"?(V=A,F=j.ignoreIllegals,fe=j.language):(Do("10.7.0","highlight(lang, code, ...args) has been deprecated."),Do("10.7.0",`Please use highlight(code, options) instead.
|
|
15
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),
|
|
16
|
-
`,1;if(Qt>1e5&&Qt>Y.index*3)throw new Error("potential infinite loop, way more iterations than matches");return qe+=L,L.length}const St=Q(A);if(!St)throw yo(l.replace("{}",A)),new Error('Unknown language: "'+A+'"');const Ke=f2(St);let yt="",Pe=V||Ke;const Ut={},Fe=new s.__emitter(s);ct();let qe="",jt=0,gt=0,Qt=0,at=!1;try{if(St.__emitTokens)St.__emitTokens(j,Fe);else{for(Pe.matcher.considerAll();;){Qt++,at?at=!1:Pe.matcher.considerAll(),Pe.matcher.lastIndex=gt;const be=Pe.matcher.exec(j);if(!be)break;const Y=j.substring(gt,be.index),L=ln(Y,be);gt=be.index+L}ln(j.substring(gt))}return Fe.finalize(),yt=Fe.toHTML(),{language:A,value:yt,relevance:jt,illegal:!1,_emitter:Fe,_top:Pe}}catch(be){if(be.message&&be.message.includes("Illegal"))return{language:A,value:ka(j),illegal:!0,relevance:0,_illegalBy:{message:be.message,index:gt,context:j.slice(gt-100,gt+100),mode:be.mode,resultSoFar:yt},_emitter:Fe};if(o)return{language:A,value:ka(j),illegal:!1,relevance:0,errorRaised:be,_emitter:Fe,_top:Pe};throw be}}function p(A){const j={value:ka(A),illegal:!1,relevance:0,_top:a,_emitter:new s.__emitter(s)};return j._emitter.addText(A),j}function b(A,j){j=j||s.languages||Object.keys(e);const F=p(A),V=j.filter(Q).filter(_).map(Te=>f(Te,A,!1));V.unshift(F);const fe=V.sort((Te,He)=>{if(Te.relevance!==He.relevance)return He.relevance-Te.relevance;if(Te.language&&He.language){if(Q(Te.language).supersetOf===He.language)return 1;if(Q(He.language).supersetOf===Te.language)return-1}return 0}),[Ee,Me]=fe,ae=Ee;return ae.secondBest=Me,ae}function g(A,j,F){const V=j&&n[j]||F;A.classList.add("hljs"),A.classList.add(`language-${V}`)}function k(A){let j=null;const F=u(A);if(c(F))return;if(K("before:highlightElement",{el:A,language:F}),A.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",A);return}if(A.children.length>0&&(s.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(A)),s.throwUnescapedHTML))throw new p2("One of your code blocks includes unescaped HTML.",A.innerHTML);j=A;const V=j.textContent,fe=F?d(V,{language:F,ignoreIllegals:!0}):b(V);A.innerHTML=fe.value,A.dataset.highlighted="yes",g(A,F,fe.language),A.result={language:fe.language,re:fe.relevance,relevance:fe.relevance},fe.secondBest&&(A.secondBest={language:fe.secondBest.language,relevance:fe.secondBest.relevance}),K("after:highlightElement",{el:A,result:fe,text:V})}function E(A){s=Sc(s,A)}const M=()=>{te(),Do("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function O(){te(),Do("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let P=!1;function te(){function A(){te()}if(document.readyState==="loading"){P||window.addEventListener("DOMContentLoaded",A,!1),P=!0;return}document.querySelectorAll(s.cssSelector).forEach(k)}function z(A,j){let F=null;try{F=j(t)}catch(V){if(yo("Language definition for '{}' could not be registered.".replace("{}",A)),o)yo(V);else throw V;F=a}F.name||(F.name=A),e[A]=F,F.rawDefinition=j.bind(null,t),F.aliases&&ne(F.aliases,{languageName:A})}function H(A){delete e[A];for(const j of Object.keys(n))n[j]===A&&delete n[j]}function ie(){return Object.keys(e)}function Q(A){return A=(A||"").toLowerCase(),e[A]||e[n[A]]}function ne(A,{languageName:j}){typeof A=="string"&&(A=[A]),A.forEach(F=>{n[F.toLowerCase()]=j})}function _(A){const j=Q(A);return j&&!j.disableAutodetect}function $(A){A["before:highlightBlock"]&&!A["before:highlightElement"]&&(A["before:highlightElement"]=j=>{A["before:highlightBlock"](Object.assign({block:j.el},j))}),A["after:highlightBlock"]&&!A["after:highlightElement"]&&(A["after:highlightElement"]=j=>{A["after:highlightBlock"](Object.assign({block:j.el},j))})}function D(A){$(A),r.push(A)}function W(A){const j=r.indexOf(A);j!==-1&&r.splice(j,1)}function K(A,j){const F=A;r.forEach(function(V){V[F]&&V[F](j)})}function B(A){return Do("10.7.0","highlightBlock will be removed entirely in v12.0"),Do("10.7.0","Please use highlightElement now."),k(A)}Object.assign(t,{highlight:d,highlightAuto:b,highlightAll:te,highlightElement:k,highlightBlock:B,configure:E,initHighlighting:M,initHighlightingOnLoad:O,registerLanguage:z,unregisterLanguage:H,listLanguages:ie,getLanguage:Q,registerAliases:ne,autoDetection:_,inherit:Sc,addPlugin:D,removePlugin:W}),t.debugMode=function(){o=!1},t.safeMode=function(){o=!0},t.versionString=m2,t.regex={concat:ko,lookahead:mc,either:ga,optional:Im,anyNumberOfTimes:Bm};for(const A in Ki)typeof Ki[A]=="object"&&cc(Ki[A]);return Object.assign(t,Ki),t},zo=Mc({});zo.newInstance=()=>Mc({});var b2=zo;zo.HighlightJS=zo,zo.default=zo;const Ac=Sm(b2),Nc="[A-Za-z$_][0-9A-Za-z$_]*",v2=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],k2=["true","false","null","undefined","NaN","Infinity"],Bc=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Ic=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],_c=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],y2=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],w2=[].concat(_c,Bc,Ic);function x2(t){const e=t.regex,n=(F,{after:V})=>{const fe="</"+F[0].slice(1);return F.input.indexOf(fe,V)!==-1},r=Nc,o={begin:"<>",end:"</>"},l=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(F,V)=>{const fe=F[0].length+F.index,Ee=F.input[fe];if(Ee==="<"||Ee===","){V.ignoreMatch();return}Ee===">"&&(n(F,{after:fe})||V.ignoreMatch());let Me;const ae=F.input.substring(fe);if(Me=ae.match(/^\s*=/)){V.ignoreMatch();return}if((Me=ae.match(/^\s+extends\s+/))&&Me.index===0){V.ignoreMatch();return}}},s={$pattern:Nc,keyword:v2,literal:k2,built_in:w2,"variable.language":y2},c="[0-9](_?[0-9])*",u=`\\.(${c})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},p={className:"subst",begin:"\\$\\{",end:"\\}",keywords:s,contains:[]},b={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,p],subLanguage:"xml"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,p],subLanguage:"css"}},k={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,p],subLanguage:"graphql"}},E={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,p]},O={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},P=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,b,g,k,E,{match:/\$\d+/},f];p.contains=P.concat({begin:/\{/,end:/\}/,keywords:s,contains:["self"].concat(P)});const te=[].concat(O,p.contains),z=te.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:["self"].concat(te)}]),H={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:z},ie={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},Q={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Bc,...Ic]}},ne={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},_={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[H],illegal:/%/},$={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function D(F){return e.concat("(?!",F.join("|"),")")}const W={match:e.concat(/\b/,D([..._c,"super","import"].map(F=>`${F}\\s*\\(`)),r,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},K={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},B={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},H]},A="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",j={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(A)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[H]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:z,CLASS_REFERENCE:Q},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),ne,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,b,g,k,E,O,{match:/\$\d+/},f,Q,{scope:"attr",match:r+e.lookahead(":"),relevance:0},j,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[O,t.REGEXP_MODE,{className:"function",begin:A,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:z}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:l},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},_,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[H,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},K,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[H]},W,$,ie,B,{match:/\$[(.]/}]}}const Xi="[A-Za-z$_][0-9A-Za-z$_]*",Rc=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Lc=["true","false","null","undefined","NaN","Infinity"],Oc=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Dc=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],zc=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Hc=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Pc=[].concat(zc,Oc,Dc);function E2(t){const e=t.regex,n=(F,{after:V})=>{const fe="</"+F[0].slice(1);return F.input.indexOf(fe,V)!==-1},r=Xi,o={begin:"<>",end:"</>"},l=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(F,V)=>{const fe=F[0].length+F.index,Ee=F.input[fe];if(Ee==="<"||Ee===","){V.ignoreMatch();return}Ee===">"&&(n(F,{after:fe})||V.ignoreMatch());let Me;const ae=F.input.substring(fe);if(Me=ae.match(/^\s*=/)){V.ignoreMatch();return}if((Me=ae.match(/^\s+extends\s+/))&&Me.index===0){V.ignoreMatch();return}}},s={$pattern:Xi,keyword:Rc,literal:Lc,built_in:Pc,"variable.language":Hc},c="[0-9](_?[0-9])*",u=`\\.(${c})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},p={className:"subst",begin:"\\$\\{",end:"\\}",keywords:s,contains:[]},b={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,p],subLanguage:"xml"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,p],subLanguage:"css"}},k={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,p],subLanguage:"graphql"}},E={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,p]},O={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},P=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,b,g,k,E,{match:/\$\d+/},f];p.contains=P.concat({begin:/\{/,end:/\}/,keywords:s,contains:["self"].concat(P)});const te=[].concat(O,p.contains),z=te.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:["self"].concat(te)}]),H={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:z},ie={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},Q={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Oc,...Dc]}},ne={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},_={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[H],illegal:/%/},$={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function D(F){return e.concat("(?!",F.join("|"),")")}const W={match:e.concat(/\b/,D([...zc,"super","import"].map(F=>`${F}\\s*\\(`)),r,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},K={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},B={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},H]},A="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",j={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(A)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[H]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:z,CLASS_REFERENCE:Q},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),ne,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,b,g,k,E,O,{match:/\$\d+/},f,Q,{scope:"attr",match:r+e.lookahead(":"),relevance:0},j,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[O,t.REGEXP_MODE,{className:"function",begin:A,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:z}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:l},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},_,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[H,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},K,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[H]},W,$,ie,B,{match:/\$[(.]/}]}}function C2(t){const e=t.regex,n=E2(t),r=Xi,o=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],l={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},a={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:o},contains:[n.exports.CLASS_REFERENCE]},s={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},c=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:Xi,keyword:Rc.concat(c),literal:Lc,built_in:Pc.concat(o),"variable.language":Hc},d={className:"meta",begin:"@"+r},f=(k,E,M)=>{const O=k.contains.findIndex(P=>P.label===E);if(O===-1)throw new Error("can not find mode to replace");k.contains.splice(O,1,M)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(d);const p=n.contains.find(k=>k.scope==="attr"),b=Object.assign({},p,{match:e.concat(r,e.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,p,b]),n.contains=n.contains.concat([d,l,a,b]),f(n,"shebang",t.SHEBANG()),f(n,"use_strict",s);const g=n.contains.find(k=>k.label==="func.def");return g.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function S2(t){const e=t.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],s={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},c={className:"meta",begin:/^(>>>|\.\.\.) /},u={className:"subst",begin:/\{/,end:/\}/,keywords:s,illegal:/#/},d={begin:/\{\{/,relevance:0},f={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,c,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,c,d,u]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,d,u]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},p="[0-9](_?[0-9])*",b=`(\\b(${p}))?\\.(${p})|\\b(${p})\\.`,g=`\\b|${r.join("|")}`,k={className:"number",relevance:0,variants:[{begin:`(\\b(${p})|(${b}))[eE][+-]?(${p})[jJ]?(?=${g})`},{begin:`(${b})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${g})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${g})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${g})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${g})`},{begin:`\\b(${p})[jJ](?=${g})`}]},E={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:s,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},M={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:["self",c,k,f,t.HASH_COMMENT_MODE]}]};return u.contains=[f,k,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:s,illegal:/(<\/|\?)|=>/,contains:[c,k,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,E,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[M]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[k,M,f]}]}}var Ho="[0-9](_*[0-9])*",Zi=`\\.(${Ho})`,ji="[0-9a-fA-F](_*[0-9a-fA-F])*",$c={className:"number",variants:[{begin:`(\\b(${Ho})((${Zi})|\\.)?|(${Zi}))[eE][+-]?(${Ho})[fFdD]?\\b`},{begin:`\\b(${Ho})((${Zi})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Zi})[fFdD]?\\b`},{begin:`\\b(${Ho})[fFdD]\\b`},{begin:`\\b0[xX]((${ji})\\.?|(${ji})?\\.(${ji}))[pP][+-]?(${Ho})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${ji})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Fc(t,e,n){return n===-1?"":t.replace(e,r=>Fc(t,e,n-1))}function T2(t){const e=t.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+Fc("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),c={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},u={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},d={className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:c,illegal:/<\/|#/,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[t.BACKSLASH_ESCAPE]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[e.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[d,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",t.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:c,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[u,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,$c,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},$c,u]}}function M2(t){const e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",a="("+r+"|"+e.optional(o)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",s={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},p={className:"title",begin:e.optional(o)+t.IDENT_RE,relevance:0},b=e.optional(o)+t.IDENT_RE+"\\s*\\(",E={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},M=[f,s,n,t.C_BLOCK_COMMENT_MODE,d,u],O={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:E,contains:M.concat([{begin:/\(/,end:/\)/,keywords:E,contains:M.concat(["self"]),relevance:0}]),relevance:0},P={begin:"("+a+"[\\*&\\s]+)+"+b,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:E,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:E,relevance:0},{begin:b,returnBegin:!0,contains:[t.inherit(p,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:E,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,u,d,s,{begin:/\(/,end:/\)/,keywords:E,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,u,d,s]}]},s,n,t.C_BLOCK_COMMENT_MODE,f]};return{name:"C",aliases:["h"],keywords:E,disableAutodetect:!0,illegal:"</",contains:[].concat(O,P,M,[f,{begin:t.IDENT_RE+"::",keywords:E},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:f,strings:u,keywords:E}}}function A2(t){const e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",a="(?!struct)("+r+"|"+e.optional(o)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",s={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},p={className:"title",begin:e.optional(o)+t.IDENT_RE,relevance:0},b=e.optional(o)+t.IDENT_RE+"\\s*\\(",g=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],k=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],E=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],M=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],te={type:k,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:E},z={className:"function.dispatch",relevance:0,keywords:{_hint:M},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},H=[z,f,s,n,t.C_BLOCK_COMMENT_MODE,d,u],ie={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:te,contains:H.concat([{begin:/\(/,end:/\)/,keywords:te,contains:H.concat(["self"]),relevance:0}]),relevance:0},Q={className:"function",begin:"("+a+"[\\*&\\s]+)+"+b,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:te,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:te,relevance:0},{begin:b,returnBegin:!0,contains:[p],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:te,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,u,d,s,{begin:/\(/,end:/\)/,keywords:te,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,u,d,s]}]},s,n,t.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:te,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(ie,Q,z,H,[f,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:te,contains:["self",s]},{begin:t.IDENT_RE+"::",keywords:te},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function N2(t){const e=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],o=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],l=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],a={keyword:o.concat(l),built_in:e,literal:r},s=t.inherit(t.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),c={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},u={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},d={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},f=t.inherit(d,{illegal:/\n/}),p={className:"subst",begin:/\{/,end:/\}/,keywords:a},b=t.inherit(p,{illegal:/\n/}),g={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},t.BACKSLASH_ESCAPE,b]},k={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]},E=t.inherit(k,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},b]});p.contains=[k,g,d,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,c,t.C_BLOCK_COMMENT_MODE],b.contains=[E,g,f,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,c,t.inherit(t.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const M={variants:[u,k,g,d,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},O={begin:"<",end:">",contains:[{beginKeywords:"in out"},s]},P=t.IDENT_RE+"(<"+t.IDENT_RE+"(\\s*,\\s*"+t.IDENT_RE+")*>)?(\\[\\])?",te={begin:"@"+t.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:a,illegal:/::/,contains:[t.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},M,c,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},s,O,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[s,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[s,O,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+P+"\\s+)+"+t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:a,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[t.TITLE_MODE,O],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,relevance:0,contains:[M,c,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},te]}}function B2(t){const l={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:l,illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",variants:[t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:l,illegal:/["']/}]}]}}function I2(t){const e=t.regex,n=/(r#)?/,r=e.concat(n,t.UNDERSCORE_IDENT_RE),o=e.concat(n,t.IDENT_RE),l={className:"title.function.invoke",relevance:0,begin:e.concat(/\b/,/(?!let|for|while|if|else|match\b)/,o,e.lookahead(/\s*\(/))},a="([ui](8|16|32|64|128|size)|f(32|64))?",s=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],c=["true","false","Some","None","Ok","Err"],u=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],d=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:d,keyword:s,literal:c,built_in:u},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\(\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*/},{className:"number",variants:[{begin:"\\b0b([01_]+)"+a},{begin:"\\b0o([0-7_]+)"+a},{begin:"\\b0x([A-Fa-f0-9_]+)"+a},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+a}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:u,type:d}},{className:"punctuation",begin:"->"},l]}}function _2(t){const e=t.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=e.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),o=e.concat(r,/(::\w+)*/),a={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},s={className:"doctag",begin:"@[A-Za-z]+"},c={begin:"#<",end:">"},u=[t.COMMENT("#","$",{contains:[s]}),t.COMMENT("^=begin","^=end",{contains:[s],relevance:10}),t.COMMENT("^__END__",t.MATCH_NOTHING_RE)],d={className:"subst",begin:/#\{/,end:/\}/,keywords:a},f={className:"string",contains:[t.BACKSLASH_ESCAPE,d],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:e.concat(/<<[-~]?'?/,e.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[t.BACKSLASH_ESCAPE,d]})]}]},p="[1-9](_?[0-9])*|0",b="[0-9](_?[0-9])*",g={className:"number",relevance:0,variants:[{begin:`\\b(${p})(\\.(${b}))?([eE][+-]?(${b})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},k={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:a}]},H=[f,{variants:[{match:[/class\s+/,o,/\s+<\s+/,o]},{match:[/\b(class|module)\s+/,o]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:a},{match:[/(include|extend)\s+/,o],scope:{2:"title.class"},keywords:a},{relevance:0,match:[o,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[k]},{begin:t.IDENT_RE+"::"},{className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[f,{begin:n}],relevance:0},g,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:a},{begin:"("+t.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[t.BACKSLASH_ESCAPE,d],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(c,u),relevance:0}].concat(c,u);d.contains=H,k.contains=H;const _=[{begin:/^\s*=>/,starts:{end:"$",contains:H}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:a,contains:H}}];return u.unshift(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:[t.SHEBANG({binary:"ruby"})].concat(_).concat(u).concat(H)}}function R2(t){const e=t.regex,n=/(?![A-Za-z0-9])(?![$])/,r=e.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),o=e.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),l=e.concat(/[A-Z]+/,n),a={scope:"variable",match:"\\$+"+r},s={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},c={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},u=t.inherit(t.APOS_STRING_MODE,{illegal:null}),d=t.inherit(t.QUOTE_STRING_MODE,{illegal:null,contains:t.QUOTE_STRING_MODE.contains.concat(c)}),f={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:t.QUOTE_STRING_MODE.contains.concat(c),"on:begin":(K,B)=>{B.data._beginMatch=K[1]||K[2]},"on:end":(K,B)=>{B.data._beginMatch!==K[1]&&B.ignoreMatch()}},p=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),b=`[
|
|
17
|
-
]`,g={scope:"string",variants:[d,u,f,p]},k={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},E=["false","null","true"],M=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],O=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],te={keyword:M,literal:(K=>{const B=[];return K.forEach(A=>{B.push(A),A.toLowerCase()===A?B.push(A.toUpperCase()):B.push(A.toLowerCase())}),B})(E),built_in:O},z=K=>K.map(B=>B.replace(/\|\d+$/,"")),H={variants:[{match:[/new/,e.concat(b,"+"),e.concat("(?!",z(O).join("\\b|"),"\\b)"),o],scope:{1:"keyword",4:"title.class"}}]},ie=e.concat(r,"\\b(?!\\()"),Q={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),ie],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[o,e.concat(/::/,e.lookahead(/(?!class\b)/)),ie],scope:{1:"title.class",3:"variable.constant"}},{match:[o,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[o,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},ne={scope:"attr",match:e.concat(r,e.lookahead(":"),e.lookahead(/(?!::)/))},_={relevance:0,begin:/\(/,end:/\)/,keywords:te,contains:[ne,a,Q,t.C_BLOCK_COMMENT_MODE,g,k,H]},$={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",z(M).join("\\b|"),"|",z(O).join("\\b|"),"\\b)"),r,e.concat(b,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[_]};_.contains.push($);const D=[ne,Q,t.C_BLOCK_COMMENT_MODE,g,k,H],W={begin:e.concat(/#\[\s*\\?/,e.either(o,l)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:E,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:E,keyword:["new","array"]},contains:["self",...D]},...D,{scope:"meta",variants:[{match:o},{match:l}]}]};return{case_insensitive:!1,keywords:te,contains:[W,t.HASH_COMMENT_MODE,t.COMMENT("//","$"),t.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:t.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},s,{scope:"variable.language",match:/\$this\b/},a,$,Q,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},H,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},t.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:te,contains:["self",W,a,Q,t.C_BLOCK_COMMENT_MODE,g,k]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[t.inherit(t.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},t.UNDERSCORE_TITLE_MODE]},g,k]}}function Vc(t){return t?typeof t=="string"?t:t.source:null}function gi(t){return zt("(?=",t,")")}function zt(...t){return t.map(n=>Vc(n)).join("")}function L2(t){const e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function zn(...t){return"("+(L2(t).capture?"":"?:")+t.map(r=>Vc(r)).join("|")+")"}const ya=t=>zt(/\b/,t,/\w$/.test(t)?/\b/:/\B/),O2=["Protocol","Type"].map(ya),Uc=["init","self"].map(ya),D2=["Any","Self"],wa=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],qc=["false","nil","true"],z2=["assignment","associativity","higherThan","left","lowerThan","none","right"],H2=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],Gc=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],Wc=zn(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),Kc=zn(Wc,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),xa=zt(Wc,Kc,"*"),Yc=zn(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),Qi=zn(Yc,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),wr=zt(Yc,Qi,"*"),Ji=zt(/[A-Z]/,Qi,"*"),P2=["attached","autoclosure",zt(/convention\(/,zn("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",zt(/objc\(/,wr,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],$2=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function F2(t){const e={match:/\s+/,relevance:0},n=t.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[t.C_LINE_COMMENT_MODE,n],o={match:[/\./,zn(...O2,...Uc)],className:{2:"keyword"}},l={match:zt(/\./,zn(...wa)),relevance:0},a=wa.filter(Ke=>typeof Ke=="string").concat(["_|0"]),s=wa.filter(Ke=>typeof Ke!="string").concat(D2).map(ya),c={variants:[{className:"keyword",match:zn(...s,...Uc)}]},u={$pattern:zn(/\b\w+/,/#\w+/),keyword:a.concat(H2),literal:qc},d=[o,l,c],f={match:zt(/\./,zn(...Gc)),relevance:0},p={className:"built_in",match:zt(/\b/,zn(...Gc),/(?=\()/)},b=[f,p],g={match:/->/,relevance:0},k={className:"operator",relevance:0,variants:[{match:xa},{match:`\\.(\\.|${Kc})+`}]},E=[g,k],M="([0-9]_*)+",O="([0-9a-fA-F]_*)+",P={className:"number",relevance:0,variants:[{match:`\\b(${M})(\\.(${M}))?([eE][+-]?(${M}))?\\b`},{match:`\\b0x(${O})(\\.(${O}))?([pP][+-]?(${M}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},te=(Ke="")=>({className:"subst",variants:[{match:zt(/\\/,Ke,/[0\\tnr"']/)},{match:zt(/\\/,Ke,/u\{[0-9a-fA-F]{1,8}\}/)}]}),z=(Ke="")=>({className:"subst",match:zt(/\\/,Ke,/[\t ]*(?:[\r\n]|\r\n)/)}),H=(Ke="")=>({className:"subst",label:"interpol",begin:zt(/\\/,Ke,/\(/),end:/\)/}),ie=(Ke="")=>({begin:zt(Ke,/"""/),end:zt(/"""/,Ke),contains:[te(Ke),z(Ke),H(Ke)]}),Q=(Ke="")=>({begin:zt(Ke,/"/),end:zt(/"/,Ke),contains:[te(Ke),H(Ke)]}),ne={className:"string",variants:[ie(),ie("#"),ie("##"),ie("###"),Q(),Q("#"),Q("##"),Q("###")]},_=[t.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[t.BACKSLASH_ESCAPE]}],$={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:_},D=Ke=>{const yt=zt(Ke,/\//),Pe=zt(/\//,Ke);return{begin:yt,end:Pe,contains:[..._,{scope:"comment",begin:`#(?!.*${Pe})`,end:/$/}]}},W={scope:"regexp",variants:[D("###"),D("##"),D("#"),$]},K={match:zt(/`/,wr,/`/)},B={className:"variable",match:/\$\d+/},A={className:"variable",match:`\\$${Qi}+`},j=[K,B,A],F={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:$2,contains:[...E,P,ne]}]}},V={scope:"keyword",match:zt(/@/,zn(...P2),gi(zn(/\(/,/\s+/)))},fe={scope:"meta",match:zt(/@/,wr)},Ee=[F,V,fe],Me={match:gi(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:zt(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Qi,"+")},{className:"type",match:Ji,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:zt(/\s+&\s+/,gi(Ji)),relevance:0}]},ae={begin:/</,end:/>/,keywords:u,contains:[...r,...d,...Ee,g,Me]};Me.contains.push(ae);const Te={match:zt(wr,/\s*:/),keywords:"_|0",relevance:0},He={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",Te,...r,W,...d,...b,...E,P,ne,...j,...Ee,Me]},xe={begin:/</,end:/>/,keywords:"repeat each",contains:[...r,Me]},tt={begin:zn(gi(zt(wr,/\s*:/)),gi(zt(wr,/\s+/,wr,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:wr}]},Vt={begin:/\(/,end:/\)/,keywords:u,contains:[tt,...r,...d,...E,P,ne,...Ee,Me,He],endsParent:!0,illegal:/["']/},on={match:[/(func|macro)/,/\s+/,zn(K.match,wr,xa)],className:{1:"keyword",3:"title.function"},contains:[xe,Vt,e],illegal:[/\[/,/%/]},gn={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[xe,Vt,e],illegal:/\[|%/},Gt={match:[/operator/,/\s+/,xa],className:{1:"keyword",3:"title"}},ct={begin:[/precedencegroup/,/\s+/,Ji],className:{1:"keyword",3:"title"},contains:[Me],keywords:[...z2,...qc],end:/}/},Zt={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},ln={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},St={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,wr,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[xe,...d,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:Ji},...d],relevance:0}]};for(const Ke of ne.variants){const yt=Ke.contains.find(Ut=>Ut.label==="interpol");yt.keywords=u;const Pe=[...d,...b,...E,P,ne,...j];yt.contains=[...Pe,{begin:/\(/,end:/\)/,contains:["self",...Pe]}]}return{name:"Swift",keywords:u,contains:[...r,on,gn,Zt,ln,St,Gt,ct,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},W,...d,...b,...E,P,ne,...j,...Ee,Me,He]}}var Po="[0-9](_*[0-9])*",el=`\\.(${Po})`,tl="[0-9a-fA-F](_*[0-9a-fA-F])*",V2={className:"number",variants:[{begin:`(\\b(${Po})((${el})|\\.)?|(${el}))[eE][+-]?(${Po})[fFdD]?\\b`},{begin:`\\b(${Po})((${el})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${el})[fFdD]?\\b`},{begin:`\\b(${Po})[fFdD]\\b`},{begin:`\\b0[xX]((${tl})\\.?|(${tl})?\\.(${tl}))[pP][+-]?(${Po})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${tl})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function U2(t){const e={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"@"},o={className:"subst",begin:/\$\{/,end:/\}/,contains:[t.C_NUMBER_MODE]},l={className:"variable",begin:"\\$"+t.UNDERSCORE_IDENT_RE},a={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[l,o]},{begin:"'",end:"'",illegal:/\n/,contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[t.BACKSLASH_ESCAPE,l,o]}]};o.contains.push(a);const s={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+t.UNDERSCORE_IDENT_RE+")?"},c={className:"meta",begin:"@"+t.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[t.inherit(a,{className:"string"}),"self"]}]},u=V2,d=t.COMMENT("/\\*","\\*/",{contains:[t.C_BLOCK_COMMENT_MODE]}),f={variants:[{className:"type",begin:t.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},p=f;return p.variants[1].contains=[f],f.variants[1].contains=[p],{name:"Kotlin",aliases:["kt","kts"],keywords:e,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),t.C_LINE_COMMENT_MODE,d,n,r,s,c,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:e,relevance:5,contains:[{begin:t.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[t.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:e,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[f,t.C_LINE_COMMENT_MODE,d],relevance:0},t.C_LINE_COMMENT_MODE,d,s,c,a,t.C_NUMBER_MODE]},d]},{begin:[/class|interface|trait/,/\s+/,t.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},t.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},s,c]},a,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
|
|
18
|
-
`},u]}}function q2(t){const e=t.regex,n=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,o={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},l={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},a=t.inherit(l,{begin:/\(/,end:/\)/}),s=t.inherit(t.APOS_STRING_MODE,{className:"string"}),c=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),u={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[o]},{begin:/'/,end:/'/,contains:[o]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[l,c,s,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[l,a,c,s]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},o,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[u],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[u],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(/</,e.lookahead(e.concat(n,e.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:u}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}const G2=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),W2=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],K2=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Y2=[...W2,...K2],X2=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Z2=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),j2=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Q2=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function J2(t){const e=t.regex,n=G2(t),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},o="and or not only",l=/@-?\w[\w]*(-\w+)*/,a="[a-zA-Z-][a-zA-Z0-9_-]*",s=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+a,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Z2.join("|")+")"},{begin:":(:)?("+j2.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Q2.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...s,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...s,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:e.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:l},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:o,attribute:X2.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...s,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Y2.join("|")+")\\b"}]}}function e4(t){const e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],o={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[e,n,t.QUOTE_STRING_MODE,o,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function t4(t){const e="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},o={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},l={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},a={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,o]},s=t.inherit(a,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),p={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},b={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},g={begin:/\{/,end:/\}/,contains:[b],illegal:"\\n",relevance:0},k={begin:"\\[",end:"\\]",contains:[b],illegal:"\\n",relevance:0},E=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},p,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},g,k,l,a],M=[...E];return M.pop(),M.push(s),b.contains=M,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:E}}function n4(t){const e=t.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},o={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},l={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},a={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},s=/[A-Za-z][A-Za-z0-9+.-]*/,c={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.concat(/\[.+?\]\(/,s,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},u={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},d={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},f=t.inherit(u,{contains:[]}),p=t.inherit(d,{contains:[]});u.contains.push(p),d.contains.push(f);let b=[n,c];return[u,d,f,p].forEach(M=>{M.contains=M.contains.concat(b)}),b=b.concat(u,d),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:b},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:b}]}]},n,l,u,d,{className:"quote",begin:"^>\\s+",contains:b,end:"$"},o,r,c,a,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function r4(t){const e="\\[=*\\[",n="\\]=*\\]",r={begin:e,end:n,contains:["self"]},o=[t.COMMENT("--(?!"+e+")","$"),t.COMMENT("--"+e,n,{contains:[r],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:t.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:o.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[t.inherit(t.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:o}].concat(o)},t.C_NUMBER_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"string",begin:e,end:n,contains:[r],relevance:5}])}}function o4(t){const e=t.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:e.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const o={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},l=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),a={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},s={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n,o]};o.contains.push(s);const c={match:/\\"/},u={className:"string",begin:/'/,end:/'/},d={match:/\\'/},f={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},p=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],b=t.SHEBANG({binary:`(${p.join("|")})`,relevance:10}),g={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},k=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],E=["true","false"],M={match:/(\/[a-z._-]+)+/},O=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],P=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],te=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],z=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:k,literal:E,built_in:[...O,...P,"set","shopt",...te,...z]},contains:[b,t.SHEBANG(),g,f,l,a,M,s,c,u,d,n]}}function i4(t){const e=["string","char","byte","int","long","bool","decimal","single","double","DateTime","xml","array","hashtable","void"],n="Add|Clear|Close|Copy|Enter|Exit|Find|Format|Get|Hide|Join|Lock|Move|New|Open|Optimize|Pop|Push|Redo|Remove|Rename|Reset|Resize|Search|Select|Set|Show|Skip|Split|Step|Switch|Undo|Unlock|Watch|Backup|Checkpoint|Compare|Compress|Convert|ConvertFrom|ConvertTo|Dismount|Edit|Expand|Export|Group|Import|Initialize|Limit|Merge|Mount|Out|Publish|Restore|Save|Sync|Unpublish|Update|Approve|Assert|Build|Complete|Confirm|Deny|Deploy|Disable|Enable|Install|Invoke|Register|Request|Restart|Resume|Start|Stop|Submit|Suspend|Uninstall|Unregister|Wait|Debug|Measure|Ping|Repair|Resolve|Test|Trace|Connect|Disconnect|Read|Receive|Send|Write|Block|Grant|Protect|Revoke|Unblock|Unprotect|Use|ForEach|Sort|Tee|Where",r="-and|-as|-band|-bnot|-bor|-bxor|-casesensitive|-ccontains|-ceq|-cge|-cgt|-cle|-clike|-clt|-cmatch|-cne|-cnotcontains|-cnotlike|-cnotmatch|-contains|-creplace|-csplit|-eq|-exact|-f|-file|-ge|-gt|-icontains|-ieq|-ige|-igt|-ile|-ilike|-ilt|-imatch|-in|-ine|-inotcontains|-inotlike|-inotmatch|-ireplace|-is|-isnot|-isplit|-join|-le|-like|-lt|-match|-ne|-not|-notcontains|-notin|-notlike|-notmatch|-or|-regex|-replace|-shl|-shr|-split|-wildcard|-xor",o={$pattern:/-?[A-z\.\-]+\b/,keyword:"if else foreach return do while until elseif begin for trap data dynamicparam end break throw param continue finally in switch exit filter try process catch hidden static parameter",built_in:"ac asnp cat cd CFS chdir clc clear clhy cli clp cls clv cnsn compare copy cp cpi cpp curl cvpa dbp del diff dir dnsn ebp echo|0 epal epcsv epsn erase etsn exsn fc fhx fl ft fw gal gbp gc gcb gci gcm gcs gdr gerr ghy gi gin gjb gl gm gmo gp gps gpv group gsn gsnp gsv gtz gu gv gwmi h history icm iex ihy ii ipal ipcsv ipmo ipsn irm ise iwmi iwr kill lp ls man md measure mi mount move mp mv nal ndr ni nmo npssc nsn nv ogv oh popd ps pushd pwd r rbp rcjb rcsn rd rdr ren ri rjb rm rmdir rmo rni rnp rp rsn rsnp rujb rv rvpa rwmi sajb sal saps sasv sbp sc scb select set shcm si sl sleep sls sort sp spjb spps spsv start stz sujb sv swmi tee trcm type wget where wjb write"},l=/\w[\w\d]*((-)[\w\d]+)*/,a={begin:"`[\\s\\S]",relevance:0},s={className:"variable",variants:[{begin:/\$\B/},{className:"keyword",begin:/\$this/},{begin:/\$[\w\d][\w\d_:]*/}]},c={className:"literal",begin:/\$(null|true|false)\b/},u={className:"string",variants:[{begin:/"/,end:/"/},{begin:/@"/,end:/^"@/}],contains:[a,s,{className:"variable",begin:/\$[A-z]/,end:/[^A-z]/}]},d={className:"string",variants:[{begin:/'/,end:/'/},{begin:/@'/,end:/^'@/}]},f={className:"doctag",variants:[{begin:/\.(synopsis|description|example|inputs|outputs|notes|link|component|role|functionality)/},{begin:/\.(parameter|forwardhelptargetname|forwardhelpcategory|remotehelprunspace|externalhelp)\s+\S+/}]},p=t.inherit(t.COMMENT(null,null),{variants:[{begin:/#/,end:/$/},{begin:/<#/,end:/#>/}],contains:[f]}),b={className:"built_in",variants:[{begin:"(".concat(n,")+(-)[\\w\\d]+")}]},g={className:"class",beginKeywords:"class enum",end:/\s*[{]/,excludeEnd:!0,relevance:0,contains:[t.TITLE_MODE]},k={className:"function",begin:/function\s+/,end:/\s*\{|$/,excludeEnd:!0,returnBegin:!0,relevance:0,contains:[{begin:"function",relevance:0,className:"keyword"},{className:"title",begin:l,relevance:0},{begin:/\(/,end:/\)/,className:"params",relevance:0,contains:[s]}]},E={begin:/using\s/,end:/$/,returnBegin:!0,contains:[u,d,{className:"keyword",begin:/(using|assembly|command|module|namespace|type)/}]},M={variants:[{className:"operator",begin:"(".concat(r,")\\b")},{className:"literal",begin:/(-){1,2}[\w\d-]+/,relevance:0}]},O={className:"selector-tag",begin:/@\B/,relevance:0},P={className:"function",begin:/\[.*\]\s*[\w]+[ ]??\(/,end:/$/,returnBegin:!0,relevance:0,contains:[{className:"keyword",begin:"(".concat(o.keyword.toString().replace(/\s/g,"|"),")\\b"),endsParent:!0,relevance:0},t.inherit(t.TITLE_MODE,{endsParent:!0})]},te=[P,p,a,t.NUMBER_MODE,u,d,b,s,c,O],z={begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0,relevance:0,contains:[].concat("self",te,{begin:"("+e.join("|")+")",className:"built_in",relevance:0},{className:"type",begin:/[\.\w\d]+/,relevance:0})};return P.contains.unshift(z),{name:"PowerShell",aliases:["pwsh","ps","ps1"],case_insensitive:!0,keywords:o,contains:te.concat(g,k,E,M,z)}}function l4(t){const e=t.COMMENT(/^\s*@?rem\b/,/$/,{relevance:10});return{name:"Batch file (DOS)",aliases:["bat","cmd"],case_insensitive:!0,illegal:/\/\*/,keywords:{keyword:["if","else","goto","for","in","do","call","exit","not","exist","errorlevel","defined","equ","neq","lss","leq","gtr","geq"],built_in:["prn","nul","lpt3","lpt2","lpt1","con","com4","com3","com2","com1","aux","shift","cd","dir","echo","setlocal","endlocal","set","pause","copy","append","assoc","at","attrib","break","cacls","cd","chcp","chdir","chkdsk","chkntfs","cls","cmd","color","comp","compact","convert","date","dir","diskcomp","diskcopy","doskey","erase","fs","find","findstr","format","ftype","graftabl","help","keyb","label","md","mkdir","mode","more","move","path","pause","print","popd","pushd","promt","rd","recover","rem","rename","replace","restore","rmdir","shift","sort","start","subst","time","title","tree","type","ver","verify","vol","ping","net","ipconfig","taskkill","xcopy","ren","del"]},contains:[{className:"variable",begin:/%%[^ ]|%[^ ]+?%|![^ ]+?!/},{className:"function",begin:{begin:"^\\s*[A-Za-z._?][A-Za-z0-9_$#@~.?]*(:|\\s+label)"}.begin,end:"goto:eof",contains:[t.inherit(t.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),e]},{className:"number",begin:"\\b\\d+",relevance:0},e]}}function a4(t){const e=t.regex,n=t.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},o={begin:/"/,end:/"/,contains:[{match:/""/}]},l=["true","false","unknown"],a=["double precision","large object","with timezone","without timezone"],s=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],c=["add","asc","collation","desc","final","first","last","view"],u=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],d=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],f=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],p=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],b=d,g=[...u,...c].filter(z=>!d.includes(z)),k={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},E={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},M={match:e.concat(/\b/,e.either(...b),/\s*\(/),relevance:0,keywords:{built_in:b}};function O(z){return e.concat(/\b/,e.either(...z.map(H=>H.replace(/\s+/,"\\s+"))),/\b/)}const P={scope:"keyword",match:O(p),relevance:0};function te(z,{exceptions:H,when:ie}={}){const Q=ie;return H=H||[],z.map(ne=>ne.match(/\|\d+$/)||H.includes(ne)?ne:Q(ne)?`${ne}|0`:ne)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:te(g,{when:z=>z.length<3}),literal:l,type:s,built_in:f},contains:[{scope:"type",match:O(a)},P,M,k,r,o,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,E]}}function s4(t){const e={className:"subst",variants:[{begin:"\\$[A-Za-z0-9_]+"}]},n={className:"subst",variants:[{begin:/\$\{/,end:/\}/}],keywords:"true false null this is new super"},r={className:"number",relevance:0,variants:[{match:/\b[0-9][0-9_]*(\.[0-9][0-9_]*)?([eE][+-]?[0-9][0-9_]*)?\b/},{match:/\b0[xX][0-9A-Fa-f][0-9A-Fa-f_]*\b/}]},o={className:"string",variants:[{begin:"r'''",end:"'''"},{begin:'r"""',end:'"""'},{begin:"r'",end:"'",illegal:"\\n"},{begin:'r"',end:'"',illegal:"\\n"},{begin:"'''",end:"'''",contains:[t.BACKSLASH_ESCAPE,e,n]},{begin:'"""',end:'"""',contains:[t.BACKSLASH_ESCAPE,e,n]},{begin:"'",end:"'",illegal:"\\n",contains:[t.BACKSLASH_ESCAPE,e,n]},{begin:'"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE,e,n]}]};n.contains=[r,o];const l=["Comparable","DateTime","Duration","Function","Iterable","Iterator","List","Map","Match","Object","Pattern","RegExp","Set","Stopwatch","String","StringBuffer","StringSink","Symbol","Type","Uri","bool","double","int","num","Element","ElementList"],a=l.map(u=>`${u}?`);return{name:"Dart",keywords:{keyword:["abstract","as","assert","async","await","base","break","case","catch","class","const","continue","covariant","default","deferred","do","dynamic","else","enum","export","extends","extension","external","factory","false","final","finally","for","Function","get","hide","if","implements","import","in","interface","is","late","library","mixin","new","null","on","operator","part","required","rethrow","return","sealed","set","show","static","super","switch","sync","this","throw","true","try","typedef","var","void","when","while","with","yield"],built_in:l.concat(a).concat(["Never","Null","dynamic","print","document","querySelector","querySelectorAll","window"]),$pattern:/[A-Za-z][A-Za-z0-9_]*\??/},contains:[o,t.COMMENT(/\/\*\*(?!\/)/,/\*\//,{subLanguage:"markdown",relevance:0}),t.COMMENT(/\/{3,} ?/,/$/,{contains:[{subLanguage:"markdown",begin:".",end:"$",relevance:0}]}),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"class",beginKeywords:"class interface",end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},r,{className:"meta",begin:"@[A-Za-z]+"},{begin:"=>"}]}}const c4=[["javascript",x2],["typescript",C2],["python",S2],["java",T2],["c",M2],["cpp",A2],["csharp",N2],["go",B2],["rust",I2],["ruby",_2],["php",R2],["swift",F2],["kotlin",U2],["xml",q2],["css",J2],["json",e4],["yaml",t4],["markdown",n4],["lua",r4],["bash",o4],["powershell",i4],["dos",l4],["sql",a4],["dart",s4]];for(const[t,e]of c4)Ac.registerLanguage(t,e);const u4={javascript:"javascript",typescript:"typescript",python:"python",java:"java",c:"c",cpp:"cpp",csharp:"csharp",go:"go",rust:"rust",ruby:"ruby",php:"php",swift:"swift",kotlin:"kotlin",html:"xml",css:"css",json:"json",xml:"xml",yaml:"yaml",markdown:"markdown",lua:"lua",bash:"bash",shell:"bash",powershell:"powershell",cmd:"dos",bat:"dos",sql:"sql",dart:"dart"};function Xc(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function d4(t,e){const n=u4[e];if(!n||t.length===0)return Xc(t);try{return Ac.highlight(t,{language:n,ignoreIllegals:!0}).value}catch{return Xc(t)}}const f4=i.defineComponent({name:"CodeBlock",props:{block:{type:Object,required:!0},placeholder:{type:String,default:void 0}},setup(t){const e=i.ref(null),n=In(),r=Rr(),o=i.computed(()=>d4(Ue(t.block.content),t.block.attrs.language??"plain"));return()=>{const l=t.block.attrs.language??"plain",a=i.h("div",{ref:e,class:"block-code-lang",onMousedown:u=>{u.preventDefault(),u.stopPropagation()},onClick:u=>{if(u.stopPropagation(),!r.value)return;const d=new CustomEvent("code-lang-click",{bubbles:!0,detail:{blockId:t.block.id,anchor:e.value}});u.currentTarget.dispatchEvent(d)}},l.toUpperCase()),s=i.h("div",{class:"block-code-title"},n.t("codeBlock.title")),c=i.h("pre",{class:"block-code-highlight","aria-hidden":"true"},[i.h("code",{class:"hljs",innerHTML:o.value})]);return i.h("div",{class:["block-code-wrapper","block-focus-root",...Jn(t.block.attrs)],"data-lang":l},[s,a,c,i.h(zr,{block:t.block,placeholder:t.placeholder,class:"block-code"})])}}}),h4={name:"codeBlock",schema:{type:"codeBlock",content:"text",nestable:!1,isolating:!0,inlineMarks:!1,attrs:{...Ef,language:{default:"plain",validate:t=>typeof t=="string"&&t.length>0}}},renderer:{component:f4},slashCommands:[{id:"code-block",title:"slash.codeBlock.title",keywords:["code","fence","pre","代码","代码块","```","codeblock"],description:"slash.codeBlock.description",icon:ha,command:"convertBlock",category:"other",args:()=>({id:"__currentBlock__",type:"codeBlock",attrs:{language:"plain"}})}],inputRules:[{name:"code-fence",pattern:/^``` ?$/,command:"convertBlock",args:t=>(t==null||t.input,{id:"__currentBlock__",type:"codeBlock",attrs:{language:"plain"},__stripPrefix:3})}]},m4={align:Rn.align,indent:Rn.indent,src:{default:"",validate:t=>typeof t=="string"},alt:{default:"",validate:t=>typeof t=="string"},title:{default:"",validate:t=>typeof t=="string"},width:{default:0,validate:t=>typeof t=="number"&&Number.isFinite(t)&&t>=0},height:{default:0,validate:t=>typeof t=="number"&&Number.isFinite(t)&&t>=0},caption:{default:"",validate:t=>typeof t=="string"},fileId:{default:0,validate:t=>typeof t=="number"&&Number.isFinite(t)&&Number.isInteger(t)&&t>=0}},p4=i.defineComponent({name:"ImageBlock",props:{block:{type:Object,required:!0},placeholder:{type:String,default:void 0}},setup(t){t.placeholder;const e=Yn(),n=Rr(),r=In(),o=t.block.id,l=i.ref(Jr(o)),a=L0((_,$)=>{_===o&&(l.value=$)});i.onBeforeUnmount(()=>{a()});const s=i.ref(null),c=i.ref(null),u=i.ref(!1);let d=0,f=0,p=0,b=1;function g(){var D,W;const _=c.value;if(!_)return;s.value={w:_.naturalWidth,h:_.naturalHeight};const $=t.block.attrs;(!$.width||$.width===0)&&(!$.height||$.height===0)&&((W=(D=e.commands).setAttrs)==null||W.call(D,{id:o,attrs:{...$,width:_.naturalWidth,height:_.naturalHeight}}))}function k(_){var A,j,F;_.preventDefault(),_.stopPropagation();const $=t.block.attrs,D=(A=c.value)==null?void 0:A.closest(".block-image-container"),W=D?D.clientWidth-8:0;let K=$.width||((j=s.value)==null?void 0:j.w)||200,B=$.height||((F=s.value)==null?void 0:F.h)||150;if(B>E){const V=K/Math.max(1,B);B=E,K=Math.round(B*V)}if(W>0&&K>W){const V=K/Math.max(1,B);K=W,B=Math.round(K/V)}d=K,f=B,p=_.clientX,b=d/Math.max(1,f),u.value=!0,document.addEventListener("mousemove",M,!0),document.addEventListener("mouseup",O,!0),document.addEventListener("selectstart",P,!0)}const E=600;function M(_){var B,A,j;if(!u.value)return;const $=_.clientX-p;let D=Math.max(40,Math.round(d+$)),W=Math.max(40,Math.round(D/b));W>E&&(W=E,D=Math.max(40,Math.round(W*b)));const K=(B=c.value)==null?void 0:B.closest(".block-image-container");if(K){const F=K.clientWidth-8;D>F&&(D=Math.max(40,F),W=Math.max(40,Math.round(D/b)))}(j=(A=e.commands).setAttrs)==null||j.call(A,{id:o,attrs:{...t.block.attrs,width:D,height:W}})}function O(){u.value=!1,document.removeEventListener("mousemove",M,!0),document.removeEventListener("mouseup",O,!0),document.removeEventListener("selectstart",P,!0)}function P(_){_.preventDefault()}const te=i.ref(null);function z(){if(!te.value){const _=document.createElement("input");_.type="file",_.accept="image/*",_.multiple=!1,te.value=_,_.addEventListener("change",()=>{var D;const $=(D=_.files)==null?void 0:D[0];$&&H($),_.value=""})}te.value.click()}function H(_){const $=Zl(_),D=new AbortController;pr(o,{status:"pending",progress:0,file:_,tempPreviewUrl:$,controller:D}),O0(_.name,_,D,{onProgress:W=>{const K=Jr(o);K&&pr(o,{...K,progress:Math.max(0,Math.min(1,W))})},onSuccess:W=>{var j,F;const K=Jr(o);if(K!=null&&K.tempPreviewUrl&&K.tempPreviewUrl!==W.url)try{URL.revokeObjectURL(K.tempPreviewUrl)}catch{}const B={...t.block.attrs,src:W.url},A={...B,width:W.width??B.width,height:W.height??B.height,alt:W.alt??B.alt,title:W.title??B.title,fileId:W.fileId??B.fileId};(F=(j=e.commands).setAttrs)==null||F.call(j,{id:o,attrs:A}),pr(o,null)},onError:W=>{const K=Jr(o);K&&pr(o,{...K,status:"error",progress:0,error:W})}})}function ie(){const _=Jr(o);!_||!_.file||H(_.file)}function Q(){var _,$;($=(_=e.commands).removeBlock)==null||$.call(_,{id:o})}function ne(){const _=l.value;return _!=null&&_.tempPreviewUrl?_.tempPreviewUrl:t.block.attrs.src??""}return()=>{const _=t.block.attrs,$=ne(),D=l.value,W=_.width,K=_.height;let B=W;W>0&&K>E&&(B=Math.max(1,Math.round(W*E/K)));const A={},j=(D==null?void 0:D.status)==="error";W&&W>0&&!j&&(A.width=`${B}px`);const F=[],V=!!D&&D.status!=="success";if(n.value&&F.push(i.h("div",{class:["image-block-toolbar",{"image-block-toolbar-forced":V}]},[i.h("button",{class:"image-block-btn",title:r.t("image.replace"),onClick:ae=>{ae.stopPropagation(),z()}},[i.h(_n,{html:Bf})]),i.h("button",{class:"image-block-btn",title:r.t("image.remove"),onClick:ae=>{ae.stopPropagation(),Q()}},[i.h(_n,{html:Nf})])])),(D==null?void 0:D.status)==="pending"){const ae=Math.round(D.progress*100);F.push(i.h("div",{class:"image-block-upload-overlay"},[i.h(_n,{html:Mf,class:"image-block-spinner"}),i.h("div",{class:"image-block-upload-label"},r.t("image.uploading")),i.h("div",{class:"image-block-progress-track"},[i.h("div",{class:"image-block-progress-bar",style:{width:`${ae}%`}})]),i.h("div",{class:"image-block-progress-pct"},`${ae}%`)]))}if((D==null?void 0:D.status)==="error"&&F.push(i.h("div",{class:"image-block-error-overlay"},[i.h("div",{class:"image-block-error-icon"},"!"),i.h("div",{class:"image-block-error-title"},r.t("image.uploadFailed")),i.h("div",{class:"image-block-error-msg"},D.error??""),i.h("button",{class:"image-block-retry-btn",onClick:ae=>{ae.stopPropagation(),ie()}},[i.h(_n,{html:Af})," ",r.t("image.retry")])])),!$&&(!D||D.status==="success")&&F.push(i.h("div",{class:"image-block-empty",onClick:ae=>{ae.stopPropagation(),n.value&&z()}},[i.h(_n,{html:If,class:"image-block-empty-icon"}),i.h("div",{class:"image-block-empty-title"},r.t("image.emptyTitle")),i.h("div",{class:"image-block-empty-sub"},r.t("image.emptySub"))])),$&&(D==null?void 0:D.status)!=="error"){const ae={};W&&W>0&&(ae.width=`${B}px`);const Te=[i.h("img",{ref:c,class:"image-block-img",src:$,alt:_.alt||"",title:_.title||"",style:ae,draggable:!1,onLoad:g,onError:()=>{(!D||D.status!=="pending"&&D.status!=="error")&&pr(o,{status:"error",progress:0,error:r.t("image.loadFailed"),tempPreviewUrl:void 0})}})];s.value&&n.value&&Te.push(i.h("div",{class:"image-block-resize-handle",onMousedown:k,title:r.t("image.resize")})),F.push(i.h("div",{class:"image-block-main"},Te))}const fe=_.caption||"";!((D==null?void 0:D.status)==="error")&&(fe||$)&&F.push(i.h("div",{class:"image-block-caption",contenteditable:n.value?"true":"false","data-placeholder":r.t("image.captionPlaceholder"),onBlur:ae=>{var He,xe;const Te=ae.currentTarget.textContent??"";Te!==fe&&((xe=(He=e.commands).setAttrs)==null||xe.call(He,{id:o,attrs:{...t.block.attrs,caption:Te}}))},onInput:()=>{},onMousedown:ae=>{ae.stopPropagation()},onClick:ae=>{ae.stopPropagation()}},fe));const Me=["block-image-wrapper"];return(D==null?void 0:D.status)==="error"&&Me.push("image-block-wrapper-error"),(D==null?void 0:D.status)==="pending"&&!$&&!D.tempPreviewUrl&&Me.push("image-block-wrapper-loading"),i.h("div",{class:["block-image-container","block-focus-root",...Jn(_)]},[i.h("div",{class:Me,style:A},F)])}}}),Zc={name:"image",schema:{type:"image",content:"none",nestable:!1,attrs:{...m4},empty:t=>{const e=t.attrs.src;return typeof e!="string"||e.length===0}},renderer:{component:p4,editable:!1},slashCommands:[{id:"image",title:"slash.image.title",keywords:["image","picture","photo","img","图片","图像","照片"],description:"slash.image.description",icon:Tf,command:"convertBlock",category:"other",args:()=>({id:"__currentBlock__",type:"image",attrs:{}})}],serialize:{toHTML:t=>{const e=t.attrs,n=e.src;if(!n)return"";const r=e.alt||"",o=e.title||"",l=e.width,a=e.height,s=e.caption||"",c=[];l&&l>0&&c.push(`width:${l}px`),a&&a>0&&c.push(`height:${a}px`);const u=c.length?` style="${c.join(";")}"`:"",d=o?` title="${Ea(o)}"`:"",f=`<img src="${Ea(n)}" alt="${Ea(r)}"${d}${u}>`;return s?`<figure>${f}<figcaption>${g4(s)}</figcaption></figure>`:f},toMarkdown:t=>{const e=t.attrs,n=e.src;if(!n)return"";const r=e.alt||"",o=e.title||"",l=e.caption||"",a=o?``:``;return l?`${a}
|
|
19
|
-
*${
|
|
20
|
-
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
|
|
21
|
-
|
|
22
|
-
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
|
|
23
|
-
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
|
|
24
|
-
c69,-144,104.5,-217.7,106.5,-221
|
|
25
|
-
l`+e/2.075+" -"+e+`
|
|
26
|
-
c5.3,-9.3,12,-14,20,-14
|
|
27
|
-
H400000v`+(40+e)+`H845.2724
|
|
28
|
-
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
|
|
29
|
-
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
|
|
30
|
-
M`+(834+e)+" "+n+"h400000v"+(40+e)+"h-400000z"},L4=function(e,n){return"M263,"+(601+e+n)+`c0.7,0,18,39.7,52,119
|
|
31
|
-
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
|
|
32
|
-
c340,-704.7,510.7,-1060.3,512,-1067
|
|
33
|
-
l`+e/2.084+" -"+e+`
|
|
34
|
-
c4.7,-7.3,11,-11,19,-11
|
|
35
|
-
H40000v`+(40+e)+`H1012.3
|
|
36
|
-
s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
|
|
37
|
-
c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
|
|
38
|
-
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
|
|
39
|
-
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
|
|
40
|
-
M`+(1001+e)+" "+n+"h400000v"+(40+e)+"h-400000z"},O4=function(e,n){return"M983 "+(10+e+n)+`
|
|
41
|
-
l`+e/3.13+" -"+e+`
|
|
42
|
-
c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+`
|
|
43
|
-
H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
|
|
44
|
-
s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
|
|
45
|
-
c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
|
|
46
|
-
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
|
|
47
|
-
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
|
|
48
|
-
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
|
|
49
|
-
M`+(1001+e)+" "+n+"h400000v"+(40+e)+"h-400000z"},D4=function(e,n){return"M424,"+(2398+e+n)+`
|
|
50
|
-
c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
|
|
51
|
-
c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
|
|
52
|
-
s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
|
|
53
|
-
s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
|
|
54
|
-
l`+e/4.223+" -"+e+`c4,-6.7,10,-10,18,-10 H400000
|
|
55
|
-
v`+(40+e)+`H1014.6
|
|
56
|
-
s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
|
|
57
|
-
c-2,6,-10,9,-24,9
|
|
58
|
-
c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+" "+n+`
|
|
59
|
-
h400000v`+(40+e)+"h-400000z"},z4=function(e,n){return"M473,"+(2713+e+n)+`
|
|
60
|
-
c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+" -"+e+`
|
|
61
|
-
c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7
|
|
62
|
-
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
|
|
63
|
-
c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
|
|
64
|
-
c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
|
|
65
|
-
s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
|
|
66
|
-
606zM`+(1001+e)+" "+n+"h400000v"+(40+e)+"H1017.7z"},H4=function(e){var n=e/2;return"M400000 "+e+" H0 L"+n+" 0 l65 45 L145 "+(e-80)+" H400000z"},P4=function(e,n,r){var o=r-54-n-e;return"M702 "+(e+n)+"H400000"+(40+e)+`
|
|
67
|
-
H742v`+o+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
|
|
68
|
-
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
|
|
69
|
-
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
|
|
70
|
-
219 661 l218 661zM702 `+n+"H400000v"+(40+e)+"H742z"},$4=function(e,n,r){n=1e3*n;var o="";switch(e){case"sqrtMain":o=R4(n,Vo);break;case"sqrtSize1":o=L4(n,Vo);break;case"sqrtSize2":o=O4(n,Vo);break;case"sqrtSize3":o=D4(n,Vo);break;case"sqrtSize4":o=z4(n,Vo);break;case"sqrtTall":o=P4(n,Vo,r)}return o},F4=function(e,n){switch(e){case"⎜":return yn("M291 0 H417 V"+n+" H291z");case"∣":return yn("M145 0 H188 V"+n+" H145z");case"∥":return yn("M145 0 H188 V"+n+" H145z")+yn("M367 0 H410 V"+n+" H367z");case"⎟":return yn("M457 0 H583 V"+n+" H457z");case"⎢":return yn("M319 0 H403 V"+n+" H319z");case"⎥":return yn("M263 0 H347 V"+n+" H263z");case"⎪":return yn("M384 0 H504 V"+n+" H384z");case"⏐":return yn("M312 0 H355 V"+n+" H312z");case"‖":return yn("M257 0 H300 V"+n+" H257z")+yn("M478 0 H521 V"+n+" H478z");default:return""}},Qc={doubleleftarrow:`M262 157
|
|
71
|
-
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
|
|
72
|
-
0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
|
|
73
|
-
14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
|
|
74
|
-
c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
|
|
75
|
-
157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
|
|
76
|
-
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
|
|
77
|
-
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
|
|
78
|
-
m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
|
|
79
|
-
-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
|
|
80
|
-
14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
|
|
81
|
-
-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
|
|
82
|
-
-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
|
|
83
|
-
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
|
|
84
|
-
c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
|
|
85
|
-
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
|
|
86
|
-
135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
|
|
87
|
-
-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
|
|
88
|
-
c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
|
|
89
|
-
490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
|
|
90
|
-
1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
|
|
91
|
-
l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
|
|
92
|
-
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
|
|
93
|
-
5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
|
|
94
|
-
35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
|
|
95
|
-
0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
|
|
96
|
-
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
|
|
97
|
-
H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
|
|
98
|
-
435 0h399565z`,leftgroupunder:`M400000 262
|
|
99
|
-
H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
|
|
100
|
-
435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
|
|
101
|
-
-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
|
|
102
|
-
-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
|
|
103
|
-
-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
|
|
104
|
-
20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
|
|
105
|
-
-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
|
|
106
|
-
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
|
|
107
|
-
m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
|
|
108
|
-
5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
|
|
109
|
-
1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
|
|
110
|
-
-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
|
|
111
|
-
10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
|
|
112
|
-
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
|
|
113
|
-
v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
|
|
114
|
-
-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
|
|
115
|
-
-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
|
|
116
|
-
71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:yn("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:yn("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:yn("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:yn("M40 281 V448H0V74H40V241H400000v40z"),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
|
|
117
|
-
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
|
|
118
|
-
c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
|
|
119
|
-
68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:yn("M0 50 h400000 v40H0z m0 194h40000v40H0z"),midbrace:`M200428 334
|
|
120
|
-
c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
|
|
121
|
-
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
|
|
122
|
-
311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
|
|
123
|
-
12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
|
|
124
|
-
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
|
|
125
|
-
53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
|
|
126
|
-
11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
|
|
127
|
-
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
|
|
128
|
-
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
|
|
129
|
-
m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
|
|
130
|
-
60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
|
|
131
|
-
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
|
|
132
|
-
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
|
|
133
|
-
c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
|
|
134
|
-
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
|
|
135
|
-
m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
|
|
136
|
-
85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
|
|
137
|
-
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
|
|
138
|
-
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
|
|
139
|
-
c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
|
|
140
|
-
-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
|
|
141
|
-
11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
|
|
142
|
-
39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
|
|
143
|
-
-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
|
|
144
|
-
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
|
|
145
|
-
151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
|
|
146
|
-
-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
|
|
147
|
-
s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
|
|
148
|
-
c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
|
|
149
|
-
28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
|
|
150
|
-
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
|
|
151
|
-
3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
|
|
152
|
-
0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
|
|
153
|
-
-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
|
|
154
|
-
-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
|
|
155
|
-
69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
|
|
156
|
-
-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
|
|
157
|
-
2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
|
|
158
|
-
m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
|
|
159
|
-
8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
|
|
160
|
-
-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
|
|
161
|
-
-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
|
|
162
|
-
15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
|
|
163
|
-
8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
|
|
164
|
-
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
|
|
165
|
-
m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
|
|
166
|
-
15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
|
|
167
|
-
-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
|
|
168
|
-
66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:yn("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:yn("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:yn("M399995 440 h-120 V150 H0 v-120 H399995z"),rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
|
|
169
|
-
1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
|
|
170
|
-
-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
|
|
171
|
-
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
|
|
172
|
-
115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
|
|
173
|
-
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
|
|
174
|
-
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
|
|
175
|
-
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
|
|
176
|
-
10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
|
|
177
|
-
c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
|
|
178
|
-
41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
|
|
179
|
-
18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
|
|
180
|
-
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
|
|
181
|
-
101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
|
|
182
|
-
-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
|
|
183
|
-
114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
|
|
184
|
-
4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
|
|
185
|
-
-68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
|
|
186
|
-
-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
|
|
187
|
-
31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
|
|
188
|
-
c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
|
|
189
|
-
181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
|
|
190
|
-
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
|
|
191
|
-
411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
|
|
192
|
-
16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
|
|
193
|
-
-338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
|
|
194
|
-
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
|
|
195
|
-
177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
|
|
196
|
-
14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
|
|
197
|
-
-175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
|
|
198
|
-
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
|
|
199
|
-
10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
|
|
200
|
-
-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
|
|
201
|
-
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
|
|
202
|
-
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
|
|
203
|
-
c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
|
|
204
|
-
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|
205
|
-
-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|
206
|
-
-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|
207
|
-
-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
|
|
208
|
-
-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|
209
|
-
-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|
210
|
-
-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|
211
|
-
-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
|
|
212
|
-
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
|
|
213
|
-
c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
|
|
214
|
-
s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
|
|
215
|
-
121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
|
|
216
|
-
s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
|
|
217
|
-
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
|
|
218
|
-
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
|
|
219
|
-
-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
|
|
220
|
-
13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
|
|
221
|
-
-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
|
|
222
|
-
-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
|
|
223
|
-
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
|
|
224
|
-
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
|
|
225
|
-
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
|
|
226
|
-
c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
|
|
227
|
-
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
|
|
228
|
-
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
|
|
229
|
-
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
|
|
230
|
-
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
|
|
231
|
-
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
|
|
232
|
-
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
|
|
233
|
-
M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
|
|
234
|
-
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
|
|
235
|
-
1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
|
|
236
|
-
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
|
|
237
|
-
M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
|
|
238
|
-
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
|
|
239
|
-
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
|
|
240
|
-
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
|
|
241
|
-
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},V4=function(e,n){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v1759 v84 h347 v-84
|
|
242
|
-
H403z M403 1759 V0 H319 V1759 v`+n+" v1759 v84 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v1759 H0 v84 H347z
|
|
243
|
-
M347 1759 V0 H263 V1759 v`+n+" v1759 h84z";case"vert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15
|
|
244
|
-
c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|
245
|
-
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+" v585 h43z";case"doublevert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15
|
|
246
|
-
c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|
247
|
-
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+` v585 h43z
|
|
248
|
-
M367 15 v585 v`+n+` v585 c2.667,10,9.667,15,21,15
|
|
249
|
-
c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|
250
|
-
c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+n+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+n+` v1715 h263 v84 H319z
|
|
251
|
-
MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+n+` v1799 H0 v-84 H319z
|
|
252
|
-
MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v602 h84z
|
|
253
|
-
M403 1759 V0 H319 V1759 v`+n+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v602 h84z
|
|
254
|
-
M347 1759 V0 h-84 V1759 v`+n+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
|
|
255
|
-
c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
|
|
256
|
-
-36,557 l0,`+(n+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
|
|
257
|
-
949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
|
|
258
|
-
c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
|
|
259
|
-
-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
|
|
260
|
-
l0,-`+(n+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
|
|
261
|
-
-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
|
|
262
|
-
63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
|
|
263
|
-
c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(n+9)+`
|
|
264
|
-
c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
|
|
265
|
-
c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
|
|
266
|
-
c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
|
|
267
|
-
c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
|
|
268
|
-
l0,-`+(n+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
|
|
269
|
-
-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};function U4(t){return"toText"in t}class Uo{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){for(var e="",n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e}toText(){return this.children.map(e=>{if(U4(e))return e.toText();throw new Error("Expected MathDomNode with toText, got "+e.constructor.name)}).join("")}}var Aa={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},q4={ex:!0,em:!0,mu:!0},Jc=function(e){return typeof e!="string"&&(e=e.unit),e in Aa||e in q4||e==="ex"},Jt=function(e,n){var r;if(e.unit in Aa)r=Aa[e.unit]/n.fontMetrics().ptPerEm/n.sizeMultiplier;else if(e.unit==="mu")r=n.fontMetrics().cssEmPerMu;else{var o;if(n.style.isTight()?o=n.havingStyle(n.style.text()):o=n,e.unit==="ex")r=o.fontMetrics().xHeight;else if(e.unit==="em")r=o.fontMetrics().quad;else throw new ke("Invalid unit: '"+e.unit+"'");o!==n&&(r*=o.sizeMultiplier/n.sizeMultiplier)}return Math.min(e.number*r,n.maxSize)},Ce=function(e){return+e.toFixed(4)+"em"},no=function(e){return e.filter(n=>n).join(" ")},Na=function(e){var n="";for(var r of Object.keys(e)){var o=e[r];o!==void 0&&(n+=v4(r)+":"+o+";")}return n},eu=function(e,n,r){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},n){n.style.isTight()&&this.classes.push("mtight");var o=n.getColor();o&&(this.style.color=o)}},tu=function(e){var n=document.createElement(e);n.className=no(this.classes),Object.assign(n.style,this.style);for(var r of Object.keys(this.attributes))n.setAttribute(r,this.attributes[r]);for(var o=0;o<this.children.length;o++)n.appendChild(this.children[o].toNode());return n},G4=/[\s"'>/=\x00-\x1f]/,nu=function(e){var n="<"+e;this.classes.length&&(n+=' class="'+Ln(no(this.classes))+'"');var r=Na(this.style);r&&(n+=' style="'+Ln(r)+'"');for(var o of Object.keys(this.attributes)){if(G4.test(o))throw new ke("Invalid attribute name '"+o+"'");n+=" "+o+'="'+Ln(this.attributes[o])+'"'}n+=">";for(var l=0;l<this.children.length;l++)n+=this.children[l].toMarkup();return n+="</"+e+">",n};class qo{constructor(e,n,r,o){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,eu.call(this,e,r,o),this.children=n||[]}setAttribute(e,n){this.attributes[e]=n}hasClass(e){return this.classes.includes(e)}toNode(){return tu.call(this,"span")}toMarkup(){return nu.call(this,"span")}}class il{constructor(e,n,r,o){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,eu.call(this,n,o),this.children=r||[],this.setAttribute("href",e)}setAttribute(e,n){this.attributes[e]=n}hasClass(e){return this.classes.includes(e)}toNode(){return tu.call(this,"a")}toMarkup(){return nu.call(this,"a")}}class W4{constructor(e,n,r){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=n,this.src=e,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=r}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement("img");return e.src=this.src,e.alt=this.alt,e.className="mord",Object.assign(e.style,this.style),e}toMarkup(){var e='<img src="'+Ln(this.src)+'"'+(' alt="'+Ln(this.alt)+'"'),n=Na(this.style);return n&&(e+=' style="'+Ln(n)+'"'),e+="'/>",e}}var K4={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class er{constructor(e,n,r,o,l,a,s,c){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=n||0,this.depth=r||0,this.italic=o||0,this.skew=l||0,this.width=a||0,this.classes=s||[],this.style=c||{},this.maxFontSize=0;var u=_4(this.text.charCodeAt(0));u&&this.classes.push(u+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=K4[this.text])}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createTextNode(this.text),n=null;return this.italic>0&&(n=document.createElement("span"),n.style.marginRight=Ce(this.italic)),this.classes.length>0&&(n=n||document.createElement("span"),n.className=no(this.classes)),Object.keys(this.style).length>0&&(n=n||document.createElement("span"),Object.assign(n.style,this.style)),n?(n.appendChild(e),n):e}toMarkup(){var e=!1,n="<span";this.classes.length&&(e=!0,n+=' class="',n+=Ln(no(this.classes)),n+='"');var r="";this.italic>0&&(r+="margin-right:"+Ce(this.italic)+";"),r+=Na(this.style),r&&(e=!0,n+=' style="'+Ln(r)+'"');var o=Ln(this.text);return e?(n+=">",n+=o,n+="</span>",n):o}}class $r{constructor(e,n){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=n||{}}toNode(){var e="http://www.w3.org/2000/svg",n=document.createElementNS(e,"svg");for(var r of Object.keys(this.attributes))n.setAttribute(r,this.attributes[r]);for(var o=0;o<this.children.length;o++)n.appendChild(this.children[o].toNode());return n}toMarkup(){var e='<svg xmlns="http://www.w3.org/2000/svg"';for(var n of Object.keys(this.attributes))e+=" "+n+'="'+Ln(this.attributes[n])+'"';e+=">";for(var r=0;r<this.children.length;r++)e+=this.children[r].toMarkup();return e+="</svg>",e}}class ro{constructor(e,n){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=n}toNode(){var e="http://www.w3.org/2000/svg",n=document.createElementNS(e,"path");return this.alternate?n.setAttribute("d",this.alternate):n.setAttribute("d",Qc[this.pathName]),n}toMarkup(){return this.alternate?'<path d="'+Ln(this.alternate)+'"/>':'<path d="'+Ln(Qc[this.pathName])+'"/>'}}class Ba{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",n=document.createElementNS(e,"line");for(var r of Object.keys(this.attributes))n.setAttribute(r,this.attributes[r]);return n}toMarkup(){var e="<line";for(var n of Object.keys(this.attributes))e+=" "+n+'="'+Ln(this.attributes[n])+'"';return e+="/>",e}}function Y4(t){if(t instanceof er)return t;throw new Error("Expected symbolNode but got "+String(t)+".")}function X4(t){if(t instanceof qo)return t;throw new Error("Expected span<HtmlDomNode> but got "+String(t)+".")}var Z4=t=>t instanceof qo||t instanceof il||t instanceof Uo,Er={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Ia={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},ru={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function j4(t,e){Er[t]=e}function _a(t,e,n){if(!Er[e])throw new Error("Font metrics not found for font: "+e+".");var r=t.charCodeAt(0),o=Er[e][r];if(!o&&t[0]in ru&&(r=ru[t[0]].charCodeAt(0),o=Er[e][r]),!o&&n==="text"&&jc(r)&&(o=Er[e][77]),o)return{depth:o[0],height:o[1],italic:o[2],skew:o[3],width:o[4]}}var Ra={};function Q4(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!Ra[e]){var n=Ra[e]={cssEmPerMu:Ia.quad[e]/18};for(var r of Object.keys(Ia))n[r]=Ia[r][e]}return Ra[e]}var Yt={math:{},text:{}};function h(t,e,n,r,o,l){Yt[t][o]={font:e,group:n,replace:r},l&&r&&(Yt[t][r]=Yt[t][o])}var m="math",pe="text",v="main",N="ams",Xt="accent-token",Oe="bin",Pn="close",Go="inner",We="mathord",hn="op-token",tr="open",vi="punct",I="rel",Fr="spacing",G="textord";h(m,v,I,"≡","\\equiv",!0),h(m,v,I,"≺","\\prec",!0),h(m,v,I,"≻","\\succ",!0),h(m,v,I,"∼","\\sim",!0),h(m,v,I,"⊥","\\perp"),h(m,v,I,"⪯","\\preceq",!0),h(m,v,I,"⪰","\\succeq",!0),h(m,v,I,"≃","\\simeq",!0),h(m,v,I,"∣","\\mid",!0),h(m,v,I,"≪","\\ll",!0),h(m,v,I,"≫","\\gg",!0),h(m,v,I,"≍","\\asymp",!0),h(m,v,I,"∥","\\parallel"),h(m,v,I,"⋈","\\bowtie",!0),h(m,v,I,"⌣","\\smile",!0),h(m,v,I,"⊑","\\sqsubseteq",!0),h(m,v,I,"⊒","\\sqsupseteq",!0),h(m,v,I,"≐","\\doteq",!0),h(m,v,I,"⌢","\\frown",!0),h(m,v,I,"∋","\\ni",!0),h(m,v,I,"∝","\\propto",!0),h(m,v,I,"⊢","\\vdash",!0),h(m,v,I,"⊣","\\dashv",!0),h(m,v,I,"∋","\\owns"),h(m,v,vi,".","\\ldotp"),h(m,v,vi,"⋅","\\cdotp"),h(m,v,vi,"⋅","·"),h(pe,v,G,"⋅","·"),h(m,v,G,"#","\\#"),h(pe,v,G,"#","\\#"),h(m,v,G,"&","\\&"),h(pe,v,G,"&","\\&"),h(m,v,G,"ℵ","\\aleph",!0),h(m,v,G,"∀","\\forall",!0),h(m,v,G,"ℏ","\\hbar",!0),h(m,v,G,"∃","\\exists",!0),h(m,v,G,"∇","\\nabla",!0),h(m,v,G,"♭","\\flat",!0),h(m,v,G,"ℓ","\\ell",!0),h(m,v,G,"♮","\\natural",!0),h(m,v,G,"♣","\\clubsuit",!0),h(m,v,G,"℘","\\wp",!0),h(m,v,G,"♯","\\sharp",!0),h(m,v,G,"♢","\\diamondsuit",!0),h(m,v,G,"ℜ","\\Re",!0),h(m,v,G,"♡","\\heartsuit",!0),h(m,v,G,"ℑ","\\Im",!0),h(m,v,G,"♠","\\spadesuit",!0),h(m,v,G,"§","\\S",!0),h(pe,v,G,"§","\\S"),h(m,v,G,"¶","\\P",!0),h(pe,v,G,"¶","\\P"),h(m,v,G,"†","\\dag"),h(pe,v,G,"†","\\dag"),h(pe,v,G,"†","\\textdagger"),h(m,v,G,"‡","\\ddag"),h(pe,v,G,"‡","\\ddag"),h(pe,v,G,"‡","\\textdaggerdbl"),h(m,v,Pn,"⎱","\\rmoustache",!0),h(m,v,tr,"⎰","\\lmoustache",!0),h(m,v,Pn,"⟯","\\rgroup",!0),h(m,v,tr,"⟮","\\lgroup",!0),h(m,v,Oe,"∓","\\mp",!0),h(m,v,Oe,"⊖","\\ominus",!0),h(m,v,Oe,"⊎","\\uplus",!0),h(m,v,Oe,"⊓","\\sqcap",!0),h(m,v,Oe,"∗","\\ast"),h(m,v,Oe,"⊔","\\sqcup",!0),h(m,v,Oe,"◯","\\bigcirc",!0),h(m,v,Oe,"∙","\\bullet",!0),h(m,v,Oe,"‡","\\ddagger"),h(m,v,Oe,"≀","\\wr",!0),h(m,v,Oe,"⨿","\\amalg"),h(m,v,Oe,"&","\\And"),h(m,v,I,"⟵","\\longleftarrow",!0),h(m,v,I,"⇐","\\Leftarrow",!0),h(m,v,I,"⟸","\\Longleftarrow",!0),h(m,v,I,"⟶","\\longrightarrow",!0),h(m,v,I,"⇒","\\Rightarrow",!0),h(m,v,I,"⟹","\\Longrightarrow",!0),h(m,v,I,"↔","\\leftrightarrow",!0),h(m,v,I,"⟷","\\longleftrightarrow",!0),h(m,v,I,"⇔","\\Leftrightarrow",!0),h(m,v,I,"⟺","\\Longleftrightarrow",!0),h(m,v,I,"↦","\\mapsto",!0),h(m,v,I,"⟼","\\longmapsto",!0),h(m,v,I,"↗","\\nearrow",!0),h(m,v,I,"↩","\\hookleftarrow",!0),h(m,v,I,"↪","\\hookrightarrow",!0),h(m,v,I,"↘","\\searrow",!0),h(m,v,I,"↼","\\leftharpoonup",!0),h(m,v,I,"⇀","\\rightharpoonup",!0),h(m,v,I,"↙","\\swarrow",!0),h(m,v,I,"↽","\\leftharpoondown",!0),h(m,v,I,"⇁","\\rightharpoondown",!0),h(m,v,I,"↖","\\nwarrow",!0),h(m,v,I,"⇌","\\rightleftharpoons",!0),h(m,N,I,"≮","\\nless",!0),h(m,N,I,"","\\@nleqslant"),h(m,N,I,"","\\@nleqq"),h(m,N,I,"⪇","\\lneq",!0),h(m,N,I,"≨","\\lneqq",!0),h(m,N,I,"","\\@lvertneqq"),h(m,N,I,"⋦","\\lnsim",!0),h(m,N,I,"⪉","\\lnapprox",!0),h(m,N,I,"⊀","\\nprec",!0),h(m,N,I,"⋠","\\npreceq",!0),h(m,N,I,"⋨","\\precnsim",!0),h(m,N,I,"⪹","\\precnapprox",!0),h(m,N,I,"≁","\\nsim",!0),h(m,N,I,"","\\@nshortmid"),h(m,N,I,"∤","\\nmid",!0),h(m,N,I,"⊬","\\nvdash",!0),h(m,N,I,"⊭","\\nvDash",!0),h(m,N,I,"⋪","\\ntriangleleft"),h(m,N,I,"⋬","\\ntrianglelefteq",!0),h(m,N,I,"⊊","\\subsetneq",!0),h(m,N,I,"","\\@varsubsetneq"),h(m,N,I,"⫋","\\subsetneqq",!0),h(m,N,I,"","\\@varsubsetneqq"),h(m,N,I,"≯","\\ngtr",!0),h(m,N,I,"","\\@ngeqslant"),h(m,N,I,"","\\@ngeqq"),h(m,N,I,"⪈","\\gneq",!0),h(m,N,I,"≩","\\gneqq",!0),h(m,N,I,"","\\@gvertneqq"),h(m,N,I,"⋧","\\gnsim",!0),h(m,N,I,"⪊","\\gnapprox",!0),h(m,N,I,"⊁","\\nsucc",!0),h(m,N,I,"⋡","\\nsucceq",!0),h(m,N,I,"⋩","\\succnsim",!0),h(m,N,I,"⪺","\\succnapprox",!0),h(m,N,I,"≆","\\ncong",!0),h(m,N,I,"","\\@nshortparallel"),h(m,N,I,"∦","\\nparallel",!0),h(m,N,I,"⊯","\\nVDash",!0),h(m,N,I,"⋫","\\ntriangleright"),h(m,N,I,"⋭","\\ntrianglerighteq",!0),h(m,N,I,"","\\@nsupseteqq"),h(m,N,I,"⊋","\\supsetneq",!0),h(m,N,I,"","\\@varsupsetneq"),h(m,N,I,"⫌","\\supsetneqq",!0),h(m,N,I,"","\\@varsupsetneqq"),h(m,N,I,"⊮","\\nVdash",!0),h(m,N,I,"⪵","\\precneqq",!0),h(m,N,I,"⪶","\\succneqq",!0),h(m,N,I,"","\\@nsubseteqq"),h(m,N,Oe,"⊴","\\unlhd"),h(m,N,Oe,"⊵","\\unrhd"),h(m,N,I,"↚","\\nleftarrow",!0),h(m,N,I,"↛","\\nrightarrow",!0),h(m,N,I,"⇍","\\nLeftarrow",!0),h(m,N,I,"⇏","\\nRightarrow",!0),h(m,N,I,"↮","\\nleftrightarrow",!0),h(m,N,I,"⇎","\\nLeftrightarrow",!0),h(m,N,I,"△","\\vartriangle"),h(m,N,G,"ℏ","\\hslash"),h(m,N,G,"▽","\\triangledown"),h(m,N,G,"◊","\\lozenge"),h(m,N,G,"Ⓢ","\\circledS"),h(m,N,G,"®","\\circledR"),h(pe,N,G,"®","\\circledR"),h(m,N,G,"∡","\\measuredangle",!0),h(m,N,G,"∄","\\nexists"),h(m,N,G,"℧","\\mho"),h(m,N,G,"Ⅎ","\\Finv",!0),h(m,N,G,"⅁","\\Game",!0),h(m,N,G,"‵","\\backprime"),h(m,N,G,"▲","\\blacktriangle"),h(m,N,G,"▼","\\blacktriangledown"),h(m,N,G,"■","\\blacksquare"),h(m,N,G,"⧫","\\blacklozenge"),h(m,N,G,"★","\\bigstar"),h(m,N,G,"∢","\\sphericalangle",!0),h(m,N,G,"∁","\\complement",!0),h(m,N,G,"ð","\\eth",!0),h(pe,v,G,"ð","ð"),h(m,N,G,"╱","\\diagup"),h(m,N,G,"╲","\\diagdown"),h(m,N,G,"□","\\square"),h(m,N,G,"□","\\Box"),h(m,N,G,"◊","\\Diamond"),h(m,N,G,"¥","\\yen",!0),h(pe,N,G,"¥","\\yen",!0),h(m,N,G,"✓","\\checkmark",!0),h(pe,N,G,"✓","\\checkmark"),h(m,N,G,"ℶ","\\beth",!0),h(m,N,G,"ℸ","\\daleth",!0),h(m,N,G,"ℷ","\\gimel",!0),h(m,N,G,"ϝ","\\digamma",!0),h(m,N,G,"ϰ","\\varkappa"),h(m,N,tr,"┌","\\@ulcorner",!0),h(m,N,Pn,"┐","\\@urcorner",!0),h(m,N,tr,"└","\\@llcorner",!0),h(m,N,Pn,"┘","\\@lrcorner",!0),h(m,N,I,"≦","\\leqq",!0),h(m,N,I,"⩽","\\leqslant",!0),h(m,N,I,"⪕","\\eqslantless",!0),h(m,N,I,"≲","\\lesssim",!0),h(m,N,I,"⪅","\\lessapprox",!0),h(m,N,I,"≊","\\approxeq",!0),h(m,N,Oe,"⋖","\\lessdot"),h(m,N,I,"⋘","\\lll",!0),h(m,N,I,"≶","\\lessgtr",!0),h(m,N,I,"⋚","\\lesseqgtr",!0),h(m,N,I,"⪋","\\lesseqqgtr",!0),h(m,N,I,"≑","\\doteqdot"),h(m,N,I,"≓","\\risingdotseq",!0),h(m,N,I,"≒","\\fallingdotseq",!0),h(m,N,I,"∽","\\backsim",!0),h(m,N,I,"⋍","\\backsimeq",!0),h(m,N,I,"⫅","\\subseteqq",!0),h(m,N,I,"⋐","\\Subset",!0),h(m,N,I,"⊏","\\sqsubset",!0),h(m,N,I,"≼","\\preccurlyeq",!0),h(m,N,I,"⋞","\\curlyeqprec",!0),h(m,N,I,"≾","\\precsim",!0),h(m,N,I,"⪷","\\precapprox",!0),h(m,N,I,"⊲","\\vartriangleleft"),h(m,N,I,"⊴","\\trianglelefteq"),h(m,N,I,"⊨","\\vDash",!0),h(m,N,I,"⊪","\\Vvdash",!0),h(m,N,I,"⌣","\\smallsmile"),h(m,N,I,"⌢","\\smallfrown"),h(m,N,I,"≏","\\bumpeq",!0),h(m,N,I,"≎","\\Bumpeq",!0),h(m,N,I,"≧","\\geqq",!0),h(m,N,I,"⩾","\\geqslant",!0),h(m,N,I,"⪖","\\eqslantgtr",!0),h(m,N,I,"≳","\\gtrsim",!0),h(m,N,I,"⪆","\\gtrapprox",!0),h(m,N,Oe,"⋗","\\gtrdot"),h(m,N,I,"⋙","\\ggg",!0),h(m,N,I,"≷","\\gtrless",!0),h(m,N,I,"⋛","\\gtreqless",!0),h(m,N,I,"⪌","\\gtreqqless",!0),h(m,N,I,"≖","\\eqcirc",!0),h(m,N,I,"≗","\\circeq",!0),h(m,N,I,"≜","\\triangleq",!0),h(m,N,I,"∼","\\thicksim"),h(m,N,I,"≈","\\thickapprox"),h(m,N,I,"⫆","\\supseteqq",!0),h(m,N,I,"⋑","\\Supset",!0),h(m,N,I,"⊐","\\sqsupset",!0),h(m,N,I,"≽","\\succcurlyeq",!0),h(m,N,I,"⋟","\\curlyeqsucc",!0),h(m,N,I,"≿","\\succsim",!0),h(m,N,I,"⪸","\\succapprox",!0),h(m,N,I,"⊳","\\vartriangleright"),h(m,N,I,"⊵","\\trianglerighteq"),h(m,N,I,"⊩","\\Vdash",!0),h(m,N,I,"∣","\\shortmid"),h(m,N,I,"∥","\\shortparallel"),h(m,N,I,"≬","\\between",!0),h(m,N,I,"⋔","\\pitchfork",!0),h(m,N,I,"∝","\\varpropto"),h(m,N,I,"◀","\\blacktriangleleft"),h(m,N,I,"∴","\\therefore",!0),h(m,N,I,"∍","\\backepsilon"),h(m,N,I,"▶","\\blacktriangleright"),h(m,N,I,"∵","\\because",!0),h(m,N,I,"⋘","\\llless"),h(m,N,I,"⋙","\\gggtr"),h(m,N,Oe,"⊲","\\lhd"),h(m,N,Oe,"⊳","\\rhd"),h(m,N,I,"≂","\\eqsim",!0),h(m,v,I,"⋈","\\Join"),h(m,N,I,"≑","\\Doteq",!0),h(m,N,Oe,"∔","\\dotplus",!0),h(m,N,Oe,"∖","\\smallsetminus"),h(m,N,Oe,"⋒","\\Cap",!0),h(m,N,Oe,"⋓","\\Cup",!0),h(m,N,Oe,"⩞","\\doublebarwedge",!0),h(m,N,Oe,"⊟","\\boxminus",!0),h(m,N,Oe,"⊞","\\boxplus",!0),h(m,N,Oe,"⋇","\\divideontimes",!0),h(m,N,Oe,"⋉","\\ltimes",!0),h(m,N,Oe,"⋊","\\rtimes",!0),h(m,N,Oe,"⋋","\\leftthreetimes",!0),h(m,N,Oe,"⋌","\\rightthreetimes",!0),h(m,N,Oe,"⋏","\\curlywedge",!0),h(m,N,Oe,"⋎","\\curlyvee",!0),h(m,N,Oe,"⊝","\\circleddash",!0),h(m,N,Oe,"⊛","\\circledast",!0),h(m,N,Oe,"⋅","\\centerdot"),h(m,N,Oe,"⊺","\\intercal",!0),h(m,N,Oe,"⋒","\\doublecap"),h(m,N,Oe,"⋓","\\doublecup"),h(m,N,Oe,"⊠","\\boxtimes",!0),h(m,N,I,"⇢","\\dashrightarrow",!0),h(m,N,I,"⇠","\\dashleftarrow",!0),h(m,N,I,"⇇","\\leftleftarrows",!0),h(m,N,I,"⇆","\\leftrightarrows",!0),h(m,N,I,"⇚","\\Lleftarrow",!0),h(m,N,I,"↞","\\twoheadleftarrow",!0),h(m,N,I,"↢","\\leftarrowtail",!0),h(m,N,I,"↫","\\looparrowleft",!0),h(m,N,I,"⇋","\\leftrightharpoons",!0),h(m,N,I,"↶","\\curvearrowleft",!0),h(m,N,I,"↺","\\circlearrowleft",!0),h(m,N,I,"↰","\\Lsh",!0),h(m,N,I,"⇈","\\upuparrows",!0),h(m,N,I,"↿","\\upharpoonleft",!0),h(m,N,I,"⇃","\\downharpoonleft",!0),h(m,v,I,"⊶","\\origof",!0),h(m,v,I,"⊷","\\imageof",!0),h(m,N,I,"⊸","\\multimap",!0),h(m,N,I,"↭","\\leftrightsquigarrow",!0),h(m,N,I,"⇉","\\rightrightarrows",!0),h(m,N,I,"⇄","\\rightleftarrows",!0),h(m,N,I,"↠","\\twoheadrightarrow",!0),h(m,N,I,"↣","\\rightarrowtail",!0),h(m,N,I,"↬","\\looparrowright",!0),h(m,N,I,"↷","\\curvearrowright",!0),h(m,N,I,"↻","\\circlearrowright",!0),h(m,N,I,"↱","\\Rsh",!0),h(m,N,I,"⇊","\\downdownarrows",!0),h(m,N,I,"↾","\\upharpoonright",!0),h(m,N,I,"⇂","\\downharpoonright",!0),h(m,N,I,"⇝","\\rightsquigarrow",!0),h(m,N,I,"⇝","\\leadsto"),h(m,N,I,"⇛","\\Rrightarrow",!0),h(m,N,I,"↾","\\restriction"),h(m,v,G,"‘","`"),h(m,v,G,"$","\\$"),h(pe,v,G,"$","\\$"),h(pe,v,G,"$","\\textdollar"),h(m,v,G,"%","\\%"),h(pe,v,G,"%","\\%"),h(m,v,G,"_","\\_"),h(pe,v,G,"_","\\_"),h(pe,v,G,"_","\\textunderscore"),h(m,v,G,"∠","\\angle",!0),h(m,v,G,"∞","\\infty",!0),h(m,v,G,"′","\\prime"),h(m,v,G,"△","\\triangle"),h(m,v,G,"Γ","\\Gamma",!0),h(m,v,G,"Δ","\\Delta",!0),h(m,v,G,"Θ","\\Theta",!0),h(m,v,G,"Λ","\\Lambda",!0),h(m,v,G,"Ξ","\\Xi",!0),h(m,v,G,"Π","\\Pi",!0),h(m,v,G,"Σ","\\Sigma",!0),h(m,v,G,"Υ","\\Upsilon",!0),h(m,v,G,"Φ","\\Phi",!0),h(m,v,G,"Ψ","\\Psi",!0),h(m,v,G,"Ω","\\Omega",!0),h(m,v,G,"A","Α"),h(m,v,G,"B","Β"),h(m,v,G,"E","Ε"),h(m,v,G,"Z","Ζ"),h(m,v,G,"H","Η"),h(m,v,G,"I","Ι"),h(m,v,G,"K","Κ"),h(m,v,G,"M","Μ"),h(m,v,G,"N","Ν"),h(m,v,G,"O","Ο"),h(m,v,G,"P","Ρ"),h(m,v,G,"T","Τ"),h(m,v,G,"X","Χ"),h(m,v,G,"¬","\\neg",!0),h(m,v,G,"¬","\\lnot"),h(m,v,G,"⊤","\\top"),h(m,v,G,"⊥","\\bot"),h(m,v,G,"∅","\\emptyset"),h(m,N,G,"∅","\\varnothing"),h(m,v,We,"α","\\alpha",!0),h(m,v,We,"β","\\beta",!0),h(m,v,We,"γ","\\gamma",!0),h(m,v,We,"δ","\\delta",!0),h(m,v,We,"ϵ","\\epsilon",!0),h(m,v,We,"ζ","\\zeta",!0),h(m,v,We,"η","\\eta",!0),h(m,v,We,"θ","\\theta",!0),h(m,v,We,"ι","\\iota",!0),h(m,v,We,"κ","\\kappa",!0),h(m,v,We,"λ","\\lambda",!0),h(m,v,We,"μ","\\mu",!0),h(m,v,We,"ν","\\nu",!0),h(m,v,We,"ξ","\\xi",!0),h(m,v,We,"ο","\\omicron",!0),h(m,v,We,"π","\\pi",!0),h(m,v,We,"ρ","\\rho",!0),h(m,v,We,"σ","\\sigma",!0),h(m,v,We,"τ","\\tau",!0),h(m,v,We,"υ","\\upsilon",!0),h(m,v,We,"ϕ","\\phi",!0),h(m,v,We,"χ","\\chi",!0),h(m,v,We,"ψ","\\psi",!0),h(m,v,We,"ω","\\omega",!0),h(m,v,We,"ε","\\varepsilon",!0),h(m,v,We,"ϑ","\\vartheta",!0),h(m,v,We,"ϖ","\\varpi",!0),h(m,v,We,"ϱ","\\varrho",!0),h(m,v,We,"ς","\\varsigma",!0),h(m,v,We,"φ","\\varphi",!0),h(m,v,Oe,"∗","*",!0),h(m,v,Oe,"+","+"),h(m,v,Oe,"−","-",!0),h(m,v,Oe,"⋅","\\cdot",!0),h(m,v,Oe,"∘","\\circ",!0),h(m,v,Oe,"÷","\\div",!0),h(m,v,Oe,"±","\\pm",!0),h(m,v,Oe,"×","\\times",!0),h(m,v,Oe,"∩","\\cap",!0),h(m,v,Oe,"∪","\\cup",!0),h(m,v,Oe,"∖","\\setminus",!0),h(m,v,Oe,"∧","\\land"),h(m,v,Oe,"∨","\\lor"),h(m,v,Oe,"∧","\\wedge",!0),h(m,v,Oe,"∨","\\vee",!0),h(m,v,G,"√","\\surd"),h(m,v,tr,"⟨","\\langle",!0),h(m,v,tr,"∣","\\lvert"),h(m,v,tr,"∥","\\lVert"),h(m,v,Pn,"?","?"),h(m,v,Pn,"!","!"),h(m,v,Pn,"⟩","\\rangle",!0),h(m,v,Pn,"∣","\\rvert"),h(m,v,Pn,"∥","\\rVert"),h(m,v,I,"=","="),h(m,v,I,":",":"),h(m,v,I,"≈","\\approx",!0),h(m,v,I,"≅","\\cong",!0),h(m,v,I,"≥","\\ge"),h(m,v,I,"≥","\\geq",!0),h(m,v,I,"←","\\gets"),h(m,v,I,">","\\gt",!0),h(m,v,I,"∈","\\in",!0),h(m,v,I,"","\\@not"),h(m,v,I,"⊂","\\subset",!0),h(m,v,I,"⊃","\\supset",!0),h(m,v,I,"⊆","\\subseteq",!0),h(m,v,I,"⊇","\\supseteq",!0),h(m,N,I,"⊈","\\nsubseteq",!0),h(m,N,I,"⊉","\\nsupseteq",!0),h(m,v,I,"⊨","\\models"),h(m,v,I,"←","\\leftarrow",!0),h(m,v,I,"≤","\\le"),h(m,v,I,"≤","\\leq",!0),h(m,v,I,"<","\\lt",!0),h(m,v,I,"→","\\rightarrow",!0),h(m,v,I,"→","\\to"),h(m,N,I,"≱","\\ngeq",!0),h(m,N,I,"≰","\\nleq",!0),h(m,v,Fr," ","\\ "),h(m,v,Fr," ","\\space"),h(m,v,Fr," ","\\nobreakspace"),h(pe,v,Fr," ","\\ "),h(pe,v,Fr," "," "),h(pe,v,Fr," ","\\space"),h(pe,v,Fr," ","\\nobreakspace"),h(m,v,Fr,"","\\nobreak"),h(m,v,Fr,"","\\allowbreak"),h(m,v,vi,",",","),h(m,v,vi,";",";"),h(m,N,Oe,"⊼","\\barwedge",!0),h(m,N,Oe,"⊻","\\veebar",!0),h(m,v,Oe,"⊙","\\odot",!0),h(m,v,Oe,"⊕","\\oplus",!0),h(m,v,Oe,"⊗","\\otimes",!0),h(m,v,G,"∂","\\partial",!0),h(m,v,Oe,"⊘","\\oslash",!0),h(m,N,Oe,"⊚","\\circledcirc",!0),h(m,N,Oe,"⊡","\\boxdot",!0),h(m,v,Oe,"△","\\bigtriangleup"),h(m,v,Oe,"▽","\\bigtriangledown"),h(m,v,Oe,"†","\\dagger"),h(m,v,Oe,"⋄","\\diamond"),h(m,v,Oe,"⋆","\\star"),h(m,v,Oe,"◃","\\triangleleft"),h(m,v,Oe,"▹","\\triangleright"),h(m,v,tr,"{","\\{"),h(pe,v,G,"{","\\{"),h(pe,v,G,"{","\\textbraceleft"),h(m,v,Pn,"}","\\}"),h(pe,v,G,"}","\\}"),h(pe,v,G,"}","\\textbraceright"),h(m,v,tr,"{","\\lbrace"),h(m,v,Pn,"}","\\rbrace"),h(m,v,tr,"[","\\lbrack",!0),h(pe,v,G,"[","\\lbrack",!0),h(m,v,Pn,"]","\\rbrack",!0),h(pe,v,G,"]","\\rbrack",!0),h(m,v,tr,"(","\\lparen",!0),h(m,v,Pn,")","\\rparen",!0),h(pe,v,G,"<","\\textless",!0),h(pe,v,G,">","\\textgreater",!0),h(m,v,tr,"⌊","\\lfloor",!0),h(m,v,Pn,"⌋","\\rfloor",!0),h(m,v,tr,"⌈","\\lceil",!0),h(m,v,Pn,"⌉","\\rceil",!0),h(m,v,G,"\\","\\backslash"),h(m,v,G,"∣","|"),h(m,v,G,"∣","\\vert"),h(pe,v,G,"|","\\textbar",!0),h(m,v,G,"∥","\\|"),h(m,v,G,"∥","\\Vert"),h(pe,v,G,"∥","\\textbardbl"),h(pe,v,G,"~","\\textasciitilde"),h(pe,v,G,"\\","\\textbackslash"),h(pe,v,G,"^","\\textasciicircum"),h(m,v,I,"↑","\\uparrow",!0),h(m,v,I,"⇑","\\Uparrow",!0),h(m,v,I,"↓","\\downarrow",!0),h(m,v,I,"⇓","\\Downarrow",!0),h(m,v,I,"↕","\\updownarrow",!0),h(m,v,I,"⇕","\\Updownarrow",!0),h(m,v,hn,"∐","\\coprod"),h(m,v,hn,"⋁","\\bigvee"),h(m,v,hn,"⋀","\\bigwedge"),h(m,v,hn,"⨄","\\biguplus"),h(m,v,hn,"⋂","\\bigcap"),h(m,v,hn,"⋃","\\bigcup"),h(m,v,hn,"∫","\\int"),h(m,v,hn,"∫","\\intop"),h(m,v,hn,"∬","\\iint"),h(m,v,hn,"∭","\\iiint"),h(m,v,hn,"∏","\\prod"),h(m,v,hn,"∑","\\sum"),h(m,v,hn,"⨂","\\bigotimes"),h(m,v,hn,"⨁","\\bigoplus"),h(m,v,hn,"⨀","\\bigodot"),h(m,v,hn,"∮","\\oint"),h(m,v,hn,"∯","\\oiint"),h(m,v,hn,"∰","\\oiiint"),h(m,v,hn,"⨆","\\bigsqcup"),h(m,v,hn,"∫","\\smallint"),h(pe,v,Go,"…","\\textellipsis"),h(m,v,Go,"…","\\mathellipsis"),h(pe,v,Go,"…","\\ldots",!0),h(m,v,Go,"…","\\ldots",!0),h(m,v,Go,"⋯","\\@cdots",!0),h(m,v,Go,"⋱","\\ddots",!0),h(m,v,G,"⋮","\\varvdots"),h(pe,v,G,"⋮","\\varvdots"),h(m,v,Xt,"ˊ","\\acute"),h(m,v,Xt,"ˋ","\\grave"),h(m,v,Xt,"¨","\\ddot"),h(m,v,Xt,"~","\\tilde"),h(m,v,Xt,"ˉ","\\bar"),h(m,v,Xt,"˘","\\breve"),h(m,v,Xt,"ˇ","\\check"),h(m,v,Xt,"^","\\hat"),h(m,v,Xt,"⃗","\\vec"),h(m,v,Xt,"˙","\\dot"),h(m,v,Xt,"˚","\\mathring"),h(m,v,We,"","\\@imath"),h(m,v,We,"","\\@jmath"),h(m,v,G,"ı","ı"),h(m,v,G,"ȷ","ȷ"),h(pe,v,G,"ı","\\i",!0),h(pe,v,G,"ȷ","\\j",!0),h(pe,v,G,"ß","\\ss",!0),h(pe,v,G,"æ","\\ae",!0),h(pe,v,G,"œ","\\oe",!0),h(pe,v,G,"ø","\\o",!0),h(pe,v,G,"Æ","\\AE",!0),h(pe,v,G,"Œ","\\OE",!0),h(pe,v,G,"Ø","\\O",!0),h(pe,v,Xt,"ˊ","\\'"),h(pe,v,Xt,"ˋ","\\`"),h(pe,v,Xt,"ˆ","\\^"),h(pe,v,Xt,"˜","\\~"),h(pe,v,Xt,"ˉ","\\="),h(pe,v,Xt,"˘","\\u"),h(pe,v,Xt,"˙","\\."),h(pe,v,Xt,"¸","\\c"),h(pe,v,Xt,"˚","\\r"),h(pe,v,Xt,"ˇ","\\v"),h(pe,v,Xt,"¨",'\\"'),h(pe,v,Xt,"˝","\\H"),h(pe,v,Xt,"◯","\\textcircled");var ou={"--":!0,"---":!0,"``":!0,"''":!0};h(pe,v,G,"–","--",!0),h(pe,v,G,"–","\\textendash"),h(pe,v,G,"—","---",!0),h(pe,v,G,"—","\\textemdash"),h(pe,v,G,"‘","`",!0),h(pe,v,G,"‘","\\textquoteleft"),h(pe,v,G,"’","'",!0),h(pe,v,G,"’","\\textquoteright"),h(pe,v,G,"“","``",!0),h(pe,v,G,"“","\\textquotedblleft"),h(pe,v,G,"”","''",!0),h(pe,v,G,"”","\\textquotedblright"),h(m,v,G,"°","\\degree",!0),h(pe,v,G,"°","\\degree"),h(pe,v,G,"°","\\textdegree",!0),h(m,v,G,"£","\\pounds"),h(m,v,G,"£","\\mathsterling",!0),h(pe,v,G,"£","\\pounds"),h(pe,v,G,"£","\\textsterling",!0),h(m,N,G,"✠","\\maltese"),h(pe,N,G,"✠","\\maltese");for(var iu='0123456789/@."',La=0;La<iu.length;La++){var lu=iu.charAt(La);h(m,v,G,lu,lu)}for(var au='0123456789!@*()-=+";:?/.,',Oa=0;Oa<au.length;Oa++){var su=au.charAt(Oa);h(pe,v,G,su,su)}for(var ll="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Da=0;Da<ll.length;Da++){var al=ll.charAt(Da);h(m,v,We,al,al),h(pe,v,G,al,al)}h(m,N,G,"C","ℂ"),h(pe,N,G,"C","ℂ"),h(m,N,G,"H","ℍ"),h(pe,N,G,"H","ℍ"),h(m,N,G,"N","ℕ"),h(pe,N,G,"N","ℕ"),h(m,N,G,"P","ℙ"),h(pe,N,G,"P","ℙ"),h(m,N,G,"Q","ℚ"),h(pe,N,G,"Q","ℚ"),h(m,N,G,"R","ℝ"),h(pe,N,G,"R","ℝ"),h(m,N,G,"Z","ℤ"),h(pe,N,G,"Z","ℤ"),h(m,v,We,"h","ℎ"),h(pe,v,We,"h","ℎ");for(var Qe,$n=0;$n<ll.length;$n++){var rn=ll.charAt($n);Qe=String.fromCharCode(55349,56320+$n),h(m,v,We,rn,Qe),h(pe,v,G,rn,Qe),Qe=String.fromCharCode(55349,56372+$n),h(m,v,We,rn,Qe),h(pe,v,G,rn,Qe),Qe=String.fromCharCode(55349,56424+$n),h(m,v,We,rn,Qe),h(pe,v,G,rn,Qe),Qe=String.fromCharCode(55349,56580+$n),h(m,v,We,rn,Qe),h(pe,v,G,rn,Qe),Qe=String.fromCharCode(55349,56684+$n),h(m,v,We,rn,Qe),h(pe,v,G,rn,Qe),Qe=String.fromCharCode(55349,56736+$n),h(m,v,We,rn,Qe),h(pe,v,G,rn,Qe),Qe=String.fromCharCode(55349,56788+$n),h(m,v,We,rn,Qe),h(pe,v,G,rn,Qe),Qe=String.fromCharCode(55349,56840+$n),h(m,v,We,rn,Qe),h(pe,v,G,rn,Qe),Qe=String.fromCharCode(55349,56944+$n),h(m,v,We,rn,Qe),h(pe,v,G,rn,Qe),$n<26&&(Qe=String.fromCharCode(55349,56632+$n),h(m,v,We,rn,Qe),h(pe,v,G,rn,Qe),Qe=String.fromCharCode(55349,56476+$n),h(m,v,We,rn,Qe),h(pe,v,G,rn,Qe))}Qe="𝕜",h(m,v,We,"k",Qe),h(pe,v,G,"k",Qe);for(var wo=0;wo<10;wo++){var oo=wo.toString();Qe=String.fromCharCode(55349,57294+wo),h(m,v,We,oo,Qe),h(pe,v,G,oo,Qe),Qe=String.fromCharCode(55349,57314+wo),h(m,v,We,oo,Qe),h(pe,v,G,oo,Qe),Qe=String.fromCharCode(55349,57324+wo),h(m,v,We,oo,Qe),h(pe,v,G,oo,Qe),Qe=String.fromCharCode(55349,57334+wo),h(m,v,We,oo,Qe),h(pe,v,G,oo,Qe)}for(var za="ÐÞþ",Ha=0;Ha<za.length;Ha++){var sl=za.charAt(Ha);h(m,v,We,sl,sl),h(pe,v,G,sl,sl)}var Pa={mathClass:"mathbf",textClass:"textbf",font:"Main-Bold"},cu={mathClass:"mathnormal",textClass:"textit",font:"Math-Italic"},uu={mathClass:"boldsymbol",textClass:"boldsymbol",font:"Main-BoldItalic"},J4={mathClass:"mathscr",textClass:"textscr",font:"Script-Regular"},xo={mathClass:"",textClass:"",font:""},du={mathClass:"mathfrak",textClass:"textfrak",font:"Fraktur-Regular"},fu={mathClass:"mathbb",textClass:"textbb",font:"AMS-Regular"},hu={mathClass:"mathboldfrak",textClass:"textboldfrak",font:"Fraktur-Regular"},$a={mathClass:"mathsf",textClass:"textsf",font:"SansSerif-Regular"},Fa={mathClass:"mathboldsf",textClass:"textboldsf",font:"SansSerif-Bold"},mu={mathClass:"mathitsf",textClass:"textitsf",font:"SansSerif-Italic"},Va={mathClass:"mathtt",textClass:"texttt",font:"Typewriter-Regular"},pu=[Pa,Pa,cu,cu,uu,uu,J4,xo,xo,xo,du,du,fu,fu,hu,hu,$a,$a,Fa,Fa,mu,mu,xo,xo,Va,Va],ep=[Pa,xo,$a,Fa,Va],tp=t=>{var e=t.charCodeAt(0),n=t.charCodeAt(1),r=(e-55296)*1024+(n-56320)+65536;if(119808<=r&&r<120484){var o=Math.floor((r-119808)/26);return pu[o]}else if(120782<=r&&r<=120831){var l=Math.floor((r-120782)/10);return ep[l]}else{if(r===120485||r===120486)return pu[0];if(120486<r&&r<120782)return xo;throw new ke("Unsupported character: "+t)}},cl=function(e,n,r){if(Yt[r][e]){var o=Yt[r][e].replace;o&&(e=o)}return{value:e,metrics:_a(e,n,r)}},Fn=function(e,n,r,o,l){var a=cl(e,n,r),s=a.metrics;e=a.value;var c;if(s){var u=s.italic;(r==="text"||o&&o.font==="mathit")&&(u=0),c=new er(e,s.height,s.depth,u,s.skew,s.width,l)}else typeof console<"u"&&console.warn("No character metrics "+("for '"+e+"' in style '"+n+"' and mode '"+r+"'")),c=new er(e,0,0,0,0,0,l);if(o){c.maxFontSize=o.sizeMultiplier,o.style.isTight()&&c.classes.push("mtight");var d=o.getColor();d&&(c.style.color=d)}return c},Ua=function(e,n,r,o){return o===void 0&&(o=[]),r.font==="boldsymbol"&&cl(e,"Main-Bold",n).metrics?Fn(e,"Main-Bold",n,r,o.concat(["mathbf"])):e==="\\"||Yt[n][e].font==="main"?Fn(e,"Main-Regular",n,r,o):Fn(e,"AMS-Regular",n,r,o.concat(["amsrm"]))},np=function(e,n,r){return r!=="textord"&&cl(e,"Math-BoldItalic",n).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},ul=function(e,n){var r=e.type==="mathord"?"mathord":"textord",o=e.mode,l=e.text,a=["mord"],s=n.font,c=n.fontFamily,u=n.fontWeight,d=n.fontShape,f=o==="math"||o==="text"&&!!s,p=f?s:c,b="",g="";if(l.charCodeAt(0)===55349){var k=tp(l);b=k.font,g=k[o+"Class"]}if(b)return Fn(l,b,o,n,a.concat(g));if(p){var E,M;if(p==="boldsymbol"){var O=np(l,o,r);E=O.fontName,M=[O.fontClass]}else f?(E=Ga[s].fontName,M=[s]):(E=dl(c,u,d),M=[c,u,d]);if(cl(l,E,o).metrics)return Fn(l,E,o,n,a.concat(M));if(Object.prototype.hasOwnProperty.call(ou,l)&&E.slice(0,10)==="Typewriter"){for(var P=[],te=0;te<l.length;te++)P.push(Fn(l[te],E,o,n,a.concat(M)));return Vr(P)}}if(r==="mathord")return Fn(l,"Math-Italic",o,n,a.concat(["mathnormal"]));if(r==="textord"){var z=Yt[o][l]&&Yt[o][l].font;if(z==="ams"){var H=dl("amsrm",u,d);return Fn(l,H,o,n,a.concat("amsrm",u,d))}else if(z==="main"||!z){var ie=dl("textrm",u,d);return Fn(l,ie,o,n,a.concat(u,d))}else{var Q=dl(z,u,d);return Fn(l,Q,o,n,a.concat(Q,u,d))}}else throw new Error("unexpected type: "+r+" in makeOrd")},rp=(t,e)=>{if(no(t.classes)!==no(e.classes)||t.skew!==e.skew||t.maxFontSize!==e.maxFontSize||t.italic!==0&&t.hasClass("mathnormal"))return!1;if(t.classes.length===1){var n=t.classes[0];if(n==="mbin"||n==="mord")return!1}for(var r of Object.keys(t.style))if(t.style[r]!==e.style[r])return!1;for(var o of Object.keys(e.style))if(t.style[o]!==e.style[o])return!1;return!0},gu=t=>{for(var e=0;e<t.length-1;e++){var n=t[e],r=t[e+1];n instanceof er&&r instanceof er&&rp(n,r)&&(n.text+=r.text,n.height=Math.max(n.height,r.height),n.depth=Math.max(n.depth,r.depth),n.italic=r.italic,t.splice(e+1,1),e--)}return t},qa=function(e){for(var n=0,r=0,o=0,l=0;l<e.children.length;l++){var a=e.children[l];a.height>n&&(n=a.height),a.depth>r&&(r=a.depth),a.maxFontSize>o&&(o=a.maxFontSize)}e.height=n,e.depth=r,e.maxFontSize=o},ve=function(e,n,r,o){var l=new qo(e,n,r,o);return qa(l),l},io=(t,e,n,r)=>new qo(t,e,n,r),Wo=function(e,n,r){var o=ve([e],[],n);return o.height=Math.max(r||n.fontMetrics().defaultRuleThickness,n.minRuleThickness),o.style.borderBottomWidth=Ce(o.height),o.maxFontSize=1,o},op=function(e,n,r,o){var l=new il(e,n,r,o);return qa(l),l},Vr=function(e){var n=new Uo(e);return qa(n),n},Ko=function(e,n){return e instanceof Uo?ve([],[e],n):e},ip=function(e){if(e.positionType==="individualShift"){for(var n=e.children,r=[n[0]],o=-n[0].shift-n[0].elem.depth,l=o,a=1;a<n.length;a++){var s=-n[a].shift-l-n[a].elem.depth,c=s-(n[a-1].elem.height+n[a-1].elem.depth);l=l+s,r.push({type:"kern",size:c}),r.push(n[a])}return{children:r,depth:o}}var u;if(e.positionType==="top"){for(var d=e.positionData,f=0;f<e.children.length;f++){var p=e.children[f];d-=p.type==="kern"?p.size:p.elem.height+p.elem.depth}u=d}else if(e.positionType==="bottom")u=-e.positionData;else{var b=e.children[0];if(b.type!=="elem")throw new Error('First child must have type "elem".');if(e.positionType==="shift")u=-b.elem.depth-e.positionData;else if(e.positionType==="firstBaseline")u=-b.elem.depth;else throw new Error("Invalid positionType "+e.positionType+".")}return{children:e.children,depth:u}},Nt=function(e,n){for(var r=ip(e),o=r.children,l=r.depth,a=0,s=0;s<o.length;s++){var c=o[s];if(c.type==="elem"){var u=c.elem;a=Math.max(a,u.maxFontSize,u.height)}}a+=2;var d=ve(["pstrut"],[]);d.style.height=Ce(a);for(var f=[],p=l,b=l,g=l,k=0;k<o.length;k++){var E=o[k];if(E.type==="kern")g+=E.size;else{var M=E.elem,O=E.wrapperClasses||[],P=E.wrapperStyle||{},te=ve(O,[d,M],void 0,P);te.style.top=Ce(-a-g-M.depth),E.marginLeft&&(te.style.marginLeft=E.marginLeft),E.marginRight&&(te.style.marginRight=E.marginRight),f.push(te),g+=M.height+M.depth}p=Math.min(p,g),b=Math.max(b,g)}var z=ve(["vlist"],f);z.style.height=Ce(b);var H;if(p<0){var ie=ve([],[]),Q=ve(["vlist"],[ie]);Q.style.height=Ce(-p);var ne=ve(["vlist-s"],[new er("")]);H=[ve(["vlist-r"],[z,ne]),ve(["vlist-r"],[Q])]}else H=[ve(["vlist-r"],[z])];var _=ve(["vlist-t"],H);return H.length===2&&_.classes.push("vlist-t2"),_.height=b,_.depth=-p,_},bu=(t,e)=>{var n=ve(["mspace"],[],e),r=Jt(t,e);return n.style.marginRight=Ce(r),n},dl=(t,e,n)=>{var r,o;switch(t){case"amsrm":r="AMS";break;case"textrm":r="Main";break;case"textsf":r="SansSerif";break;case"texttt":r="Typewriter";break;default:r=t}return e==="textbf"&&n==="textit"?o="BoldItalic":e==="textbf"?o="Bold":n==="textit"?o="Italic":o="Regular",r+"-"+o},Ga={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},vu={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},ku=function(e,n){var r=vu[e],o=r[0],l=r[1],a=r[2],s=new ro(o),c=new $r([s],{width:Ce(l),height:Ce(a),style:"width:"+Ce(l),viewBox:"0 0 "+1e3*l+" "+1e3*a,preserveAspectRatio:"xMinYMin"}),u=io(["katex-overlay"],[c],n);return u.height=a,u.style.height=Ce(a),u.style.width=Ce(l),u},en={number:3,unit:"mu"},Eo={number:4,unit:"mu"},Ur={number:5,unit:"mu"},lp={mord:{mop:en,mbin:Eo,mrel:Ur,minner:en},mop:{mord:en,mop:en,mrel:Ur,minner:en},mbin:{mord:Eo,mop:Eo,mopen:Eo,minner:Eo},mrel:{mord:Ur,mop:Ur,mopen:Ur,minner:Ur},mopen:{},mclose:{mop:en,mbin:Eo,mrel:Ur,minner:en},mpunct:{mord:en,mop:en,mrel:Ur,mopen:en,mclose:en,mpunct:en,minner:en},minner:{mord:en,mop:en,mbin:Eo,mrel:Ur,mopen:en,mpunct:en,minner:en}},ap={mord:{mop:en},mop:{mord:en,mop:en},mbin:{},mrel:{},mopen:{},mclose:{mop:en},mpunct:{},minner:{mop:en}},yu={},ki={},yi={};function Ie(t){for(var e=t.type,n=t.names,r=t.htmlBuilder,o=t.mathmlBuilder,l=0;l<n.length;++l)yu[n[l]]=t;e&&(r&&(ki[e]=r),o&&(yi[e]=o))}function Co(t){var e=t.type,n=t.htmlBuilder,r=t.mathmlBuilder;n&&(ki[e]=n),r&&(yi[e]=r)}var wi=function(e){return e.type==="ordgroup"&&e.body.length===1?e.body[0]:e},mn=function(e){return e.type==="ordgroup"?e.body:[e]},sp=new Set(["leftmost","mbin","mopen","mrel","mop","mpunct"]),cp=new Set(["rightmost","mrel","mclose","mpunct"]),up={display:nt.DISPLAY,text:nt.TEXT,script:nt.SCRIPT,scriptscript:nt.SCRIPTSCRIPT},dp={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},wn=function(e,n,r,o){o===void 0&&(o=[null,null]);for(var l=[],a=0;a<e.length;a++){var s=Bt(e[a],n);if(s instanceof Uo){var c=s.children;l.push(...c)}else l.push(s)}if(gu(l),!r)return l;var u=n;if(e.length===1){var d=e[0];d.type==="sizing"?u=n.havingSize(d.size):d.type==="styling"&&(u=n.havingStyle(up[d.style]))}var f=ve([o[0]||"leftmost"],[],n),p=ve([o[1]||"rightmost"],[],n),b=r==="root";return Wa(l,(g,k)=>{var E=k.classes[0],M=g.classes[0];E==="mbin"&&cp.has(M)?k.classes[0]="mord":M==="mbin"&&sp.has(E)&&(g.classes[0]="mord")},{node:f},p,b),Wa(l,(g,k)=>{var E,M,O=Ya(k),P=Ya(g),te=O&&P?g.hasClass("mtight")?(E=ap[O])==null?void 0:E[P]:(M=lp[O])==null?void 0:M[P]:null;if(te)return bu(te,u)},{node:f},p,b),l},Wa=function(e,n,r,o,l){o&&e.push(o);for(var a=0;a<e.length;a++){var s=e[a],c=wu(s);if(c){Wa(c.children,n,r,null,l);continue}var u=!s.hasClass("mspace");if(u){var d=n(s,r.node);d&&(r.insertAfter?r.insertAfter(d):(e.unshift(d),a++))}u?r.node=s:l&&s.hasClass("katex-newline")&&(r.node=ve(["leftmost"])),r.insertAfter=(f=>p=>{e.splice(f+1,0,p),a++})(a)}o&&e.pop()},wu=function(e){return e instanceof Uo||e instanceof il||e instanceof qo&&e.hasClass("enclosing")?e:null},Ka=function(e,n){var r=wu(e);if(r){var o=r.children;if(o.length){if(n==="right")return Ka(o[o.length-1],"right");if(n==="left")return Ka(o[0],"left")}}return e},Ya=function(e,n){if(!e)return null;n&&(e=Ka(e,n));var r=e.classes[0];return dp[r]||null},xi=function(e,n){var r=["nulldelimiter"].concat(e.baseSizingClasses());return ve(n.concat(r))},Bt=function(e,n,r){if(!e)return ve();if(ki[e.type]){var o=ki[e.type](e,n);if(r&&n.size!==r.size){o=ve(n.sizingClasses(r),[o],n);var l=n.sizeMultiplier/r.sizeMultiplier;o.height*=l,o.depth*=l}return o}else throw new ke("Got group of unknown type: '"+e.type+"'")};function fl(t,e){var n=ve(["katex-base"],t,e),r=ve(["katex-strut"]);return r.style.height=Ce(n.height+n.depth),n.depth&&(r.style.verticalAlign=Ce(-n.depth)),n.children.unshift(r),n}function Xa(t,e){var n=null;t.length===1&&t[0].type==="tag"&&(n=t[0].tag,t=t[0].body);var r=wn(t,e,"root"),o;r.length===2&&r[1].hasClass("katex-tag")&&(o=r.pop());for(var l=[],a=[],s=0;s<r.length;s++)if(a.push(r[s]),r[s].hasClass("mbin")||r[s].hasClass("mrel")||r[s].hasClass("allowbreak")){for(var c=!1;s<r.length-1&&r[s+1].hasClass("mspace")&&!r[s+1].hasClass("katex-newline");)s++,a.push(r[s]),r[s].hasClass("nobreak")&&(c=!0);c||(l.push(fl(a,e)),a=[])}else r[s].hasClass("katex-newline")&&(a.pop(),a.length>0&&(l.push(fl(a,e)),a=[]),l.push(r[s]));a.length>0&&l.push(fl(a,e));var u;n?(u=fl(wn(n,e,!0),e),u.classes=["katex-tag"],l.push(u)):o&&l.push(o);var d=ve(["katex-html"],l);if(d.setAttribute("aria-hidden","true"),u){var f=u.children[0];f.style.height=Ce(d.height+d.depth),d.depth&&(f.style.verticalAlign=Ce(-d.depth))}return d}function xu(t){return new Uo(t)}class we{constructor(e,n,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=n||[],this.classes=r||[]}setAttribute(e,n){this.attributes[e]=n}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var n of Object.entries(this.attributes)){var r=n[0],o=n[1];e.setAttribute(r,o)}this.classes.length>0&&(e.className=no(this.classes));for(var l=0;l<this.children.length;l++)if(this.children[l]instanceof pn&&this.children[l+1]instanceof pn){for(var a=this.children[l].toText()+this.children[++l].toText();this.children[l+1]instanceof pn;)a+=this.children[++l].toText();e.appendChild(new pn(a).toNode())}else e.appendChild(this.children[l].toNode());return e}toMarkup(){var e="<"+this.type;for(var n of Object.entries(this.attributes)){var r=n[0],o=n[1];e+=" "+r+'="',e+=Ln(o),e+='"'}this.classes.length>0&&(e+=' class ="'+Ln(no(this.classes))+'"'),e+=">";for(var l=0;l<this.children.length;l++)e+=this.children[l].toMarkup();return e+="</"+this.type+">",e}toText(){return this.children.map(e=>e.toText()).join("")}}class pn{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return Ln(this.toText())}toText(){return this.text}}class Eu{constructor(e){this.width=void 0,this.character=void 0,this.width=e,e>=.05555&&e<=.05556?this.character=" ":e>=.1666&&e<=.1667?this.character=" ":e>=.2222&&e<=.2223?this.character=" ":e>=.2777&&e<=.2778?this.character=" ":e>=-.05556&&e<=-.05555?this.character=" ":e>=-.1667&&e<=-.1666?this.character=" ":e>=-.2223&&e<=-.2222?this.character=" ":e>=-.2778&&e<=-.2777?this.character=" ":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",Ce(this.width)),e}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+Ce(this.width)+'"/>'}toText(){return this.character?this.character:" "}}var fp=new Set(["\\imath","\\jmath"]),hp=new Set(["mrow","mtable"]),ar=function(e,n,r){var o,l;return Yt[n][e]&&Yt[n][e].replace&&e.charCodeAt(0)!==55349&&!(Object.prototype.hasOwnProperty.call(ou,e)&&((r==null||(o=r.fontFamily)==null?void 0:o.slice(4,6))==="tt"||(r==null||(l=r.font)==null?void 0:l.slice(4,6))==="tt"))&&(e=Yt[n][e].replace),new pn(e)},Za=function(e){return e.length===1?e[0]:new we("mrow",e)},mp={mathit:"italic",boldsymbol:t=>t.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},ja=(t,e)=>{if(t.mode==="text"){if(e.fontFamily==="texttt")return"monospace";if(e.fontFamily==="textsf")return e.fontShape==="textit"&&e.fontWeight==="textbf"?"sans-serif-bold-italic":e.fontShape==="textit"?"sans-serif-italic":e.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(e.fontShape==="textit"&&e.fontWeight==="textbf")return"bold-italic";if(e.fontShape==="textit")return"italic";if(e.fontWeight==="textbf")return"bold"}var n=e.font;if(!n||n==="mathnormal")return null;var r=t.mode,o=mp[n];if(o)return typeof o=="function"?o(t):o;var l=t.text;if(fp.has(l))return null;if(Yt[r][l]){var a=Yt[r][l].replace;a&&(l=a)}var s=Ga[n].fontName;return _a(l,s,r)?Ga[n].variant:null};function Qa(t){if(!t)return!1;if(t.type==="mi"&&t.children.length===1){var e=t.children[0];return e instanceof pn&&e.text==="."}else if(t.type==="mo"&&t.children.length===1&&t.getAttribute("separator")==="true"&&t.getAttribute("lspace")==="0em"&&t.getAttribute("rspace")==="0em"){var n=t.children[0];return n instanceof pn&&n.text===","}else return!1}var nr=function(e,n,r){if(e.length===1){var o=$t(e[0],n);return r&&o instanceof we&&o.type==="mo"&&(o.setAttribute("lspace","0em"),o.setAttribute("rspace","0em")),[o]}for(var l=[],a,s=0;s<e.length;s++){var c=$t(e[s],n);if(c instanceof we&&a instanceof we){if(c.type==="mtext"&&a.type==="mtext"&&c.getAttribute("mathvariant")===a.getAttribute("mathvariant")){a.children.push(...c.children);continue}else if(c.type==="mn"&&a.type==="mn"){a.children.push(...c.children);continue}else if(Qa(c)&&a.type==="mn"){a.children.push(...c.children);continue}else if(c.type==="mn"&&Qa(a))c.children=[...a.children,...c.children],l.pop();else if((c.type==="msup"||c.type==="msub")&&c.children.length>=1&&(a.type==="mn"||Qa(a))){var u=c.children[0];u instanceof we&&u.type==="mn"&&(u.children=[...a.children,...u.children],l.pop())}else if(a.type==="mi"&&a.children.length===1){var d=a.children[0];if(d instanceof pn&&d.text==="̸"&&(c.type==="mo"||c.type==="mi"||c.type==="mn")){var f=c.children[0];f instanceof pn&&f.text.length>0&&(f.text=f.text.slice(0,1)+"̸"+f.text.slice(1),l.pop())}}}l.push(c),a=c}return l},lo=function(e,n,r){return Za(nr(e,n,r))},$t=function(e,n){if(!e)return new we("mrow");if(yi[e.type])return yi[e.type](e,n);throw new ke("Got group of unknown type: '"+e.type+"'")};function Cu(t,e,n,r,o){var l=nr(t,n),a;l.length===1&&l[0]instanceof we&&hp.has(l[0].type)?a=l[0]:a=new we("mrow",l);var s=new we("annotation",[new pn(e)]);s.setAttribute("encoding","application/x-tex");var c=new we("semantics",[a,s]),u=new we("math",[c]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&u.setAttribute("display","block");var d=o?"katex":"katex-mathml";return ve([d],[u])}var pp=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],Su=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Tu=function(e,n){return n.size<2?e:pp[e-1][n.size-1]};class qr{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||qr.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=Su[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var n={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(n,e),new qr(n)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:Tu(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:Su[e-1]})}havingBaseStyle(e){e=e||this.style.text();var n=Tu(qr.BASESIZE,e);return this.size===n&&this.textSize===qr.BASESIZE&&this.style===e?this:this.extend({style:e,size:n})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["katex-sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==qr.BASESIZE?["katex-sizing","reset-size"+this.size,"size"+qr.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=Q4(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}qr.BASESIZE=6;var Mu=function(e){return new qr({style:e.displayMode?nt.DISPLAY:nt.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},Au=function(e,n){if(n.displayMode){var r=["katex-display"];n.leqno&&r.push("leqno"),n.fleqn&&r.push("fleqn"),e=ve(r,[e])}return e},gp=function(e,n,r){var o=Mu(r),l;if(r.output==="mathml")return Cu(e,n,o,r.displayMode,!0);if(r.output==="html"){var a=Xa(e,o);l=ve(["katex"],[a])}else{var s=Cu(e,n,o,r.displayMode,!1),c=Xa(e,o);l=ve(["katex"],[s,c])}return Au(l,r)},bp=function(e,n,r){var o=Mu(r),l=Xa(e,o),a=ve(["katex"],[l]);return Au(a,r)},vp={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},hl=function(e){var n=new we("mo",[new pn(vp[e.replace(/^\\/,"")])]);return n.setAttribute("stretchy","true"),n},kp={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},yp=new Set(["widehat","widecheck","widetilde","utilde"]),ml=function(e,n){function r(){var c=4e5,u=e.label.slice(1);if(yp.has(u)&&"base"in e){var d=e.base.type==="ordgroup"?e.base.body.length:1,f,p,b;if(d>5)u==="widehat"||u==="widecheck"?(f=420,c=2364,b=.42,p=u+"4"):(f=312,c=2340,b=.34,p="tilde4");else{var g=[1,1,2,2,3,3][d];u==="widehat"||u==="widecheck"?(c=[0,1062,2364,2364,2364][g],f=[0,239,300,360,420][g],b=[0,.24,.3,.3,.36,.42][g],p=u+g):(c=[0,600,1033,2339,2340][g],f=[0,260,286,306,312][g],b=[0,.26,.286,.3,.306,.34][g],p="tilde"+g)}var k=new ro(p),E=new $r([k],{width:"100%",height:Ce(b),viewBox:"0 0 "+c+" "+f,preserveAspectRatio:"none"});return{span:io([],[E],n),minWidth:0,height:b}}else{var M=[],O=kp[u];if(!O)throw new Error('No SVG data for "'+u+'".');var P=O[0],te=O[1],z=O[2],H=z/1e3,ie=P.length,Q,ne;if(ie===1){if(O.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+u+'".');Q=["hide-tail"],ne=[O[3]]}else if(ie===2)Q=["halfarrow-left","halfarrow-right"],ne=["xMinYMin","xMaxYMin"];else if(ie===3)Q=["brace-left","brace-center","brace-right"],ne=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
|
|
270
|
-
`+ie+" children.");for(var _=0;_<ie;_++){var $=new ro(P[_]),D=new $r([$],{width:"400em",height:Ce(H),viewBox:"0 0 "+c+" "+z,preserveAspectRatio:ne[_]+" slice"}),W=io([Q[_]],[D],n);if(ie===1)return{span:W,minWidth:te,height:H};W.style.height=Ce(H),M.push(W)}return{span:ve(["katex-stretchy"],M,n),minWidth:te,height:H}}}var o=r(),l=o.span,a=o.minWidth,s=o.height;return l.height=s,l.style.height=Ce(s),a>0&&(l.style.minWidth=Ce(a)),l},wp=function(e,n,r,o,l){var a,s=e.height+e.depth+r+o;if(/fbox|color|angl/.test(n)){if(a=ve(["katex-stretchy",n],[],l),n==="fbox"){var c=l.color&&l.getColor();c&&(a.style.borderColor=c)}}else{var u=[];/^[bx]cancel$/.test(n)&&u.push(new Ba({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(n)&&u.push(new Ba({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var d=new $r(u,{width:"100%",height:Ce(s)});a=io([],[d],l)}return a.height=s,a.style.height=Ce(s),a},xp=["bin","close","inner","open","punct","rel"],Ep=["accent-token","mathord","op-token","spacing","textord"],Cp=new Set(xp),Sp=new Set(Ep);function Tp(t){return Cp.has(t)}function ft(t,e){if(!t||t.type!==e)throw new Error("Expected node of type "+e+", but got "+(t?"node of type "+t.type:String(t)));return t}function pl(t){var e=gl(t);if(!e)throw new Error("Expected node of symbol group type, but got "+(t?"node of type "+t.type:String(t)));return e}function gl(t){return t.type==="atom"||Sp.has(t.type)?t:null}function Ja(t,e,n){var r="";for(var o of t.body)if(o.type==="textord")r+=o.text;else if(n&&o.type==="spacing"&&o.text===" ")r+=" ";else throw new ke(e,t);return r}var Nu=t=>{if(t instanceof er)return t;if(Z4(t)&&t.children.length===1)return Nu(t.children[0])},Bu=(t,e)=>{var n,r,o;t&&t.type==="supsub"?(r=ft(t.base,"accent"),n=r.base,t.base=n,o=X4(Bt(t,e)),t.base=r):(r=ft(t,"accent"),n=r.base);var l=Bt(n,e.havingCrampedStyle()),a=r.isShifty&&Hr(n),s=0;if(a){var c,u;s=(c=(u=Nu(l))==null?void 0:u.skew)!=null?c:0}var d=r.label==="\\c",f=d?l.height+l.depth:Math.min(l.height,e.fontMetrics().xHeight),p;if(r.isStretchy)p=ml(r,e),p=Nt({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"elem",elem:p,wrapperClasses:["svg-align"],wrapperStyle:s>0?{width:"calc(100% - "+Ce(2*s)+")",marginLeft:Ce(2*s)}:void 0}]});else{var b,g;r.label==="\\vec"?(b=ku("vec",e),g=vu.vec[1]):(b=ul({type:"textord",mode:r.mode,text:r.label},e),b=Y4(b),b.italic=0,g=b.width,d&&(f+=b.depth)),p=ve(["accent-body"],[b]);var k=r.label==="\\textcircled";k&&(p.classes.push("accent-full"),f=l.height);var E=s;k||(E-=g/2),p.style.left=Ce(E),r.label==="\\textcircled"&&(p.style.top=".2em"),p=Nt({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:-f},{type:"elem",elem:p}]})}var M=ve(["mord","katex-accent"],[p],e);return o?(o.children[0]=M,o.height=Math.max(M.height,o.height),o.classes[0]="mord",o):M},Mp=(t,e)=>{var n=t.isStretchy?hl(t.label):new we("mo",[ar(t.label,t.mode)]),r=new we("mover",[$t(t.base,e),n]);return r.setAttribute("accent","true"),r},Ap=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));Ie({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],numArgs:1,handler:(t,e)=>{var n=wi(e[0]),r=!Ap.test(t.funcName),o=!r||t.funcName==="\\widehat"||t.funcName==="\\widetilde"||t.funcName==="\\widecheck";return{type:"accent",mode:t.parser.mode,label:t.funcName,isStretchy:r,isShifty:o,base:n}},htmlBuilder:Bu,mathmlBuilder:Mp}),Ie({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"],handler:(t,e)=>{var n=e[0],r=t.parser.mode;return r==="math"&&(t.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+t.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:t.funcName,isStretchy:!1,isShifty:!0,base:n}}}),Ie({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],numArgs:1,handler:(t,e)=>{var n=t.parser,r=t.funcName,o=e[0];return{type:"accentUnder",mode:n.mode,label:r,base:o}},htmlBuilder:(t,e)=>{var n=Bt(t.base,e),r=ml(t,e),o=t.label==="\\utilde"?.12:0,l=Nt({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:o},{type:"elem",elem:n}]});return ve(["mord","accentunder"],[l],e)},mathmlBuilder:(t,e)=>{var n=hl(t.label),r=new we("munder",[$t(t.base,e),n]);return r.setAttribute("accentunder","true"),r}});var bl=t=>{var e=new we("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};Ie({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],numArgs:1,numOptionalArgs:1,handler(t,e,n){var r=t.parser,o=t.funcName;return{type:"xArrow",mode:r.mode,label:o,body:e[0],below:n[0]}},htmlBuilder(t,e){var n=e.style,r=e.havingStyle(n.sup()),o=Ko(Bt(t.body,r,e),e),l=t.label.slice(0,2)==="\\x"?"x":"cd";o.classes.push(l+"-arrow-pad");var a;t.below&&(r=e.havingStyle(n.sub()),a=Ko(Bt(t.below,r,e),e),a.classes.push(l+"-arrow-pad"));var s=ml(t,e),c=-e.fontMetrics().axisHeight+.5*s.height,u=-e.fontMetrics().axisHeight-.5*s.height-.111;(o.depth>.25||t.label==="\\xleftequilibrium")&&(u-=o.depth);var d;if(a){var f=-e.fontMetrics().axisHeight+a.height+.5*s.height+.111;d=Nt({positionType:"individualShift",children:[{type:"elem",elem:o,shift:u},{type:"elem",elem:s,shift:c,wrapperClasses:["svg-align"]},{type:"elem",elem:a,shift:f}]})}else d=Nt({positionType:"individualShift",children:[{type:"elem",elem:o,shift:u},{type:"elem",elem:s,shift:c,wrapperClasses:["svg-align"]}]});return ve(["mrel","x-arrow"],[d],e)},mathmlBuilder(t,e){var n=hl(t.label);n.setAttribute("minsize",t.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(t.body){var o=bl($t(t.body,e));if(t.below){var l=bl($t(t.below,e));r=new we("munderover",[n,l,o])}else r=new we("mover",[n,o])}else if(t.below){var a=bl($t(t.below,e));r=new we("munder",[n,a])}else r=bl(),r=new we("mover",[n,r]);return r}});function Np(t,e){var n=wn(t.body,e,!0);return ve([t.mclass],n,e)}function Bp(t,e){var n,r=nr(t.body,e);return t.mclass==="minner"?n=new we("mpadded",r):t.mclass==="mord"?t.isCharacterBox?(n=r[0],n.type="mi"):n=new we("mi",r):(t.isCharacterBox?(n=r[0],n.type="mo"):n=new we("mo",r),t.mclass==="mbin"?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):t.mclass==="mpunct"?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):(t.mclass==="mopen"||t.mclass==="mclose")&&(n.attributes.lspace="0em",n.attributes.rspace="0em")),n}Ie({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],numArgs:1,primitive:!0,handler(t,e){var n=t.parser,r=t.funcName,o=e[0];return{type:"mclass",mode:n.mode,mclass:"m"+r.slice(5),body:mn(o),isCharacterBox:Hr(o)}},htmlBuilder:Np,mathmlBuilder:Bp});var vl=t=>{var e=t.type==="ordgroup"&&t.body.length?t.body[0]:t;return e.type==="atom"&&(e.family==="bin"||e.family==="rel")?"m"+e.family:"mord"};Ie({type:"mclass",names:["\\@binrel"],numArgs:2,handler(t,e){var n=t.parser;return{type:"mclass",mode:n.mode,mclass:vl(e[0]),body:mn(e[1]),isCharacterBox:Hr(e[1])}}}),Ie({type:"mclass",names:["\\stackrel","\\overset","\\underset"],numArgs:2,handler(t,e){var n=t.parser,r=t.funcName,o=e[1],l=e[0],a;r!=="\\stackrel"?a=vl(o):a="mrel";var s={type:"op",mode:o.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!=="\\stackrel",body:mn(o)},c=r==="\\underset"?{type:"supsub",mode:l.mode,base:s,sub:l}:{type:"supsub",mode:l.mode,base:s,sup:l};return{type:"mclass",mode:n.mode,mclass:a,body:[c],isCharacterBox:Hr(c)}}}),Ie({type:"pmb",names:["\\pmb"],numArgs:1,allowedInText:!0,handler(t,e){var n=t.parser;return{type:"pmb",mode:n.mode,mclass:vl(e[0]),body:mn(e[0])}},htmlBuilder(t,e){var n=wn(t.body,e,!0),r=ve([t.mclass],n,e);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(t,e){var n=nr(t.body,e),r=new we("mstyle",n);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var Ip={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},Iu=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),_u=t=>t.type==="textord"&&t.text==="@",_p=(t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e;function Rp(t,e,n){var r=Ip[t];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(r,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var o=n.callFunction("\\\\cdleft",[e[0]],[]),l={type:"atom",text:r,mode:"math",family:"rel"},a=n.callFunction("\\Big",[l],[]),s=n.callFunction("\\\\cdright",[e[1]],[]),c={type:"ordgroup",mode:"math",body:[o,a,s]};return n.callFunction("\\\\cdparent",[c],[])}case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var u={type:"textord",text:"\\Vert",mode:"math"};return n.callFunction("\\Big",[u],[])}default:return{type:"textord",text:" ",mode:"math"}}}function Lp(t){var e=[];for(t.gullet.beginGroup(),t.gullet.macros.set("\\cr","\\\\\\relax"),t.gullet.beginGroup();;){e.push(t.parseExpression(!1,"\\\\")),t.gullet.endGroup(),t.gullet.beginGroup();var n=t.fetch().text;if(n==="&"||n==="\\\\")t.consume();else if(n==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new ke("Expected \\\\ or \\cr or \\end",t.nextToken)}for(var r=[],o=[r],l=0;l<e.length;l++){for(var a=e[l],s=Iu(),c=0;c<a.length;c++)if(!_u(a[c]))s.body.push(a[c]);else{r.push(s),c+=1;var u=pl(a[c]).text,d=new Array(2);if(d[0]={type:"ordgroup",mode:"math",body:[]},d[1]={type:"ordgroup",mode:"math",body:[]},!"=|.".includes(u))if("<>AV".includes(u))for(var f=0;f<2;f++){for(var p=!0,b=c+1;b<a.length;b++){if(_p(a[b],u)){p=!1,c=b;break}if(_u(a[b]))throw new ke("Missing a "+u+" character to complete a CD arrow.",a[b]);d[f].body.push(a[b])}if(p)throw new ke("Missing a "+u+" character to complete a CD arrow.",a[c])}else throw new ke('Expected one of "<>AV=|." after @',a[c]);var g=Rp(u,d,t),k={type:"styling",body:[g],mode:"math",style:"display",resetFont:!0};r.push(k),s=Iu()}l%2===0?r.push(s):r.shift(),r=[],o.push(r)}t.gullet.endGroup(),t.gullet.endGroup();var E=new Array(o[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:o,arraystretch:1,addJot:!0,rowGaps:[null],cols:E,colSeparationType:"CD",hLinesBeforeRow:new Array(o.length+1).fill([])}}Ie({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],numArgs:1,handler(t,e){var n=t.parser,r=t.funcName;return{type:"cdlabel",mode:n.mode,side:r.slice(4),label:e[0]}},htmlBuilder(t,e){var n=e.havingStyle(e.style.sup()),r=Ko(Bt(t.label,n,e),e);return r.classes.push("cd-label-"+t.side),r.style.bottom=Ce(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(t,e){var n=new we("mrow",[$t(t.label,e)]);return n=new we("mpadded",[n]),n.setAttribute("width","0"),t.side==="left"&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),n=new we("mstyle",[n]),n.setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}}),Ie({type:"cdlabelparent",names:["\\\\cdparent"],numArgs:1,handler(t,e){var n=t.parser;return{type:"cdlabelparent",mode:n.mode,fragment:e[0]}},htmlBuilder(t,e){var n=Ko(Bt(t.fragment,e),e);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder(t,e){return new we("mrow",[$t(t.fragment,e)])}}),Ie({type:"textord",names:["\\@char"],numArgs:1,allowedInText:!0,handler(t,e){var n=t.parser,r=ft(e[0],"ordgroup"),o=Ja(r,"\\@char has non-numeric argument"),l=parseInt(o),a;if(isNaN(l))throw new ke("\\@char has non-numeric argument "+o);if(l<0||l>=1114111)throw new ke("\\@char with invalid code point "+o);return l<=65535?a=String.fromCharCode(l):(l-=65536,a=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:n.mode,text:a}}});var Op=(t,e)=>{var n=wn(t.body,e.withColor(t.color),!1);return Vr(n)},Dp=(t,e)=>{var n=nr(t.body,e.withColor(t.color)),r=new we("mstyle",n);return r.setAttribute("mathcolor",t.color),r};Ie({type:"color",names:["\\textcolor"],numArgs:2,allowedInText:!0,argTypes:["color","original"],handler(t,e){var n=t.parser,r=ft(e[0],"color-token").color,o=e[1];return{type:"color",mode:n.mode,color:r,body:mn(o)}},htmlBuilder:Op,mathmlBuilder:Dp}),Ie({type:"color",names:["\\color"],numArgs:1,allowedInText:!0,argTypes:["color"],handler(t,e){var n=t.parser,r=t.breakOnTokenText,o=ft(e[0],"color-token").color;n.gullet.macros.set("\\current@color",o);var l=n.parseExpression(!0,r);return{type:"color",mode:n.mode,color:o,body:l}}}),Ie({type:"cr",names:["\\\\"],numArgs:0,numOptionalArgs:0,allowedInText:!0,handler(t,e,n){var r=t.parser,o=r.gullet.future().text==="["?r.parseSizeGroup(!0):null,l=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:l,size:o&&ft(o,"size").value}},htmlBuilder(t,e){var n=ve(["mspace"],[],e);return t.newLine&&(n.classes.push("katex-newline"),t.size&&(n.style.marginTop=Ce(Jt(t.size,e)))),n},mathmlBuilder(t,e){var n=new we("mspace");return t.newLine&&(n.setAttribute("linebreak","newline"),t.size&&n.setAttribute("height",Ce(Jt(t.size,e)))),n}});var es={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},Ru=t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new ke("Expected a control sequence",t);return e},zp=t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},Lu=(t,e,n,r)=>{var o=t.gullet.macros.get(n.text);o==null&&(n.noexpand=!0,o={tokens:[n],numArgs:0,unexpandable:!t.gullet.isExpandable(n.text)}),t.gullet.macros.set(e,o,r)};Ie({type:"internal",names:["\\global","\\long","\\\\globallong"],numArgs:0,allowedInText:!0,handler(t){var e=t.parser,n=t.funcName;e.consumeSpaces();var r=e.fetch();if(es[r.text])return(n==="\\global"||n==="\\\\globallong")&&(r.text=es[r.text]),ft(e.parseFunction(),"internal");throw new ke("Invalid token after macro prefix",r)}}),Ie({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],numArgs:0,allowedInText:!0,primitive:!0,handler(t){var e=t.parser,n=t.funcName,r=e.gullet.popToken(),o=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(o))throw new ke("Expected a control sequence",r);for(var l=0,a,s=[[]];e.gullet.future().text!=="{";)if(r=e.gullet.popToken(),r.text==="#"){if(e.gullet.future().text==="{"){a=e.gullet.future(),s[l].push("{");break}if(r=e.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new ke('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==l+1)throw new ke('Argument number "'+r.text+'" out of order');l++,s.push([])}else{if(r.text==="EOF")throw new ke("Expected a macro definition");s[l].push(r.text)}var c=e.gullet.consumeArg(),u=c.tokens;return a&&u.unshift(a),(n==="\\edef"||n==="\\xdef")&&(u=e.gullet.expandTokens(u),u.reverse()),e.gullet.macros.set(o,{tokens:u,numArgs:l,delimiters:s},n===es[n]),{type:"internal",mode:e.mode}}}),Ie({type:"internal",names:["\\let","\\\\globallet"],numArgs:0,allowedInText:!0,primitive:!0,handler(t){var e=t.parser,n=t.funcName,r=Ru(e.gullet.popToken());e.gullet.consumeSpaces();var o=zp(e);return Lu(e,r,o,n==="\\\\globallet"),{type:"internal",mode:e.mode}}}),Ie({type:"internal",names:["\\futurelet","\\\\globalfuture"],numArgs:0,allowedInText:!0,primitive:!0,handler(t){var e=t.parser,n=t.funcName,r=Ru(e.gullet.popToken()),o=e.gullet.popToken(),l=e.gullet.popToken();return Lu(e,r,l,n==="\\\\globalfuture"),e.gullet.pushToken(l),e.gullet.pushToken(o),{type:"internal",mode:e.mode}}});var Ei=function(e,n,r){var o=Yt.math[e]&&Yt.math[e].replace,l=_a(o||e,n,r);if(!l)throw new Error("Unsupported symbol "+e+" and font size "+n+".");return l},ts=function(e,n,r,o){var l=r.havingBaseStyle(n),a=ve(o.concat(l.sizingClasses(r)),[e],r),s=l.sizeMultiplier/r.sizeMultiplier;return a.height*=s,a.depth*=s,a.maxFontSize=l.sizeMultiplier,a},Ou=function(e,n,r){var o=n.havingBaseStyle(r),l=(1-n.sizeMultiplier/o.sizeMultiplier)*n.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=Ce(l),e.height-=l,e.depth+=l},Hp=function(e,n,r,o,l,a){var s=Fn(e,"Main-Regular",l,o),c=ts(s,n,o,a);return Ou(c,o,n),c},Pp=function(e,n,r,o){return Fn(e,"Size"+n+"-Regular",r,o)},Du=function(e,n,r,o,l,a){var s=Pp(e,n,l,o),c=ts(ve(["delimsizing","size"+n],[s],o),nt.TEXT,o,a);return r&&Ou(c,o,nt.TEXT),c},ns=function(e,n,r){var o;n==="Size1-Regular"?o="delim-size1":o="delim-size4";var l=ve(["delimsizinginner",o],[ve([],[Fn(e,n,r)])]);return{type:"elem",elem:l}},rs=function(e,n,r){var o=Er["Size4-Regular"][e.charCodeAt(0)]?Er["Size4-Regular"][e.charCodeAt(0)][4]:Er["Size1-Regular"][e.charCodeAt(0)][4],l=new ro("inner",F4(e,Math.round(1e3*n))),a=new $r([l],{width:Ce(o),height:Ce(n),style:"width:"+Ce(o),viewBox:"0 0 "+1e3*o+" "+Math.round(1e3*n),preserveAspectRatio:"xMinYMin"}),s=io([],[a],r);return s.height=n,s.style.height=Ce(n),s.style.width=Ce(o),{type:"elem",elem:s}},os=.008,kl={type:"kern",size:-1*os},$p=new Set(["|","\\lvert","\\rvert","\\vert"]),Fp=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),zu=function(e,n,r,o,l,a){var s,c,u,d,f="",p=0;s=u=d=e,c=null;var b="Size1-Regular";e==="\\uparrow"?u=d="⏐":e==="\\Uparrow"?u=d="‖":e==="\\downarrow"?s=u="⏐":e==="\\Downarrow"?s=u="‖":e==="\\updownarrow"?(s="\\uparrow",u="⏐",d="\\downarrow"):e==="\\Updownarrow"?(s="\\Uparrow",u="‖",d="\\Downarrow"):$p.has(e)?(u="∣",f="vert",p=333):Fp.has(e)?(u="∥",f="doublevert",p=556):e==="["||e==="\\lbrack"?(s="⎡",u="⎢",d="⎣",b="Size4-Regular",f="lbrack",p=667):e==="]"||e==="\\rbrack"?(s="⎤",u="⎥",d="⎦",b="Size4-Regular",f="rbrack",p=667):e==="\\lfloor"||e==="⌊"?(u=s="⎢",d="⎣",b="Size4-Regular",f="lfloor",p=667):e==="\\lceil"||e==="⌈"?(s="⎡",u=d="⎢",b="Size4-Regular",f="lceil",p=667):e==="\\rfloor"||e==="⌋"?(u=s="⎥",d="⎦",b="Size4-Regular",f="rfloor",p=667):e==="\\rceil"||e==="⌉"?(s="⎤",u=d="⎥",b="Size4-Regular",f="rceil",p=667):e==="("||e==="\\lparen"?(s="⎛",u="⎜",d="⎝",b="Size4-Regular",f="lparen",p=875):e===")"||e==="\\rparen"?(s="⎞",u="⎟",d="⎠",b="Size4-Regular",f="rparen",p=875):e==="\\{"||e==="\\lbrace"?(s="⎧",c="⎨",d="⎩",u="⎪",b="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(s="⎫",c="⎬",d="⎭",u="⎪",b="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(s="⎧",d="⎩",u="⎪",b="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(s="⎫",d="⎭",u="⎪",b="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(s="⎧",d="⎭",u="⎪",b="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(s="⎫",d="⎩",u="⎪",b="Size4-Regular");var g=Ei(s,b,l),k=g.height+g.depth,E=Ei(u,b,l),M=E.height+E.depth,O=Ei(d,b,l),P=O.height+O.depth,te=0,z=1;if(c!==null){var H=Ei(c,b,l);te=H.height+H.depth,z=2}var ie=k+P+te,Q=Math.max(0,Math.ceil((n-ie)/(z*M))),ne=ie+Q*z*M,_=o.fontMetrics().axisHeight;r&&(_*=o.sizeMultiplier);var $=ne/2-_,D=[];if(f.length>0){var W=ne-k-P,K=Math.round(ne*1e3),B=V4(f,Math.round(W*1e3)),A=new ro(f,B),j=Ce(p/1e3),F=Ce(K/1e3),V=new $r([A],{width:j,height:F,viewBox:"0 0 "+p+" "+K}),fe=io([],[V],o);fe.height=K/1e3,fe.style.width=j,fe.style.height=F,D.push({type:"elem",elem:fe})}else{if(D.push(ns(d,b,l)),D.push(kl),c===null){var Ee=ne-k-P+2*os;D.push(rs(u,Ee,o))}else{var Me=(ne-k-P-te)/2+2*os;D.push(rs(u,Me,o)),D.push(kl),D.push(ns(c,b,l)),D.push(kl),D.push(rs(u,Me,o))}D.push(kl),D.push(ns(s,b,l))}var ae=o.havingBaseStyle(nt.TEXT),Te=Nt({positionType:"bottom",positionData:$,children:D});return ts(ve(["delimsizing","mult"],[Te],ae),nt.TEXT,o,a)},is=80,ls=.08,as=function(e,n,r,o,l){var a=$4(e,o,r),s=new ro(e,a),c=new $r([s],{width:"400em",height:Ce(n),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return io(["hide-tail"],[c],l)},Vp=function(e,n){var r=n.havingBaseSizing(),o=Vu("\\surd",e*r.sizeMultiplier,Fu,r),l=r.sizeMultiplier,a=Math.max(0,n.minRuleThickness-n.fontMetrics().sqrtRuleThickness),s,c,u,d,f;return o.type==="small"?(d=1e3+1e3*a+is,e<1?l=1:e<1.4&&(l=.7),c=(1+a+ls)/l,u=(1+a)/l,s=as("sqrtMain",c,d,a,n),s.style.minWidth="0.853em",f=.833/l):o.type==="large"?(d=(1e3+is)*Ci[o.size],u=(Ci[o.size]+a)/l,c=(Ci[o.size]+a+ls)/l,s=as("sqrtSize"+o.size,c,d,a,n),s.style.minWidth="1.02em",f=1/l):(c=e+a+ls,u=e+a,d=Math.floor(1e3*e+a)+is,s=as("sqrtTall",c,d,a,n),s.style.minWidth="0.742em",f=1.056),s.height=u,s.style.height=Ce(c),{span:s,advanceWidth:f,ruleWidth:(n.fontMetrics().sqrtRuleThickness+a)*l}},Hu=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),Up=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),Pu=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),Ci=[0,1.2,1.8,2.4,3],$u=function(e,n,r,o,l){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),Hu.has(e)||Pu.has(e))return Du(e,n,!1,r,o,l);if(Up.has(e))return zu(e,Ci[n],!1,r,o,l);throw new ke("Illegal delimiter: '"+e+"'")},qp=[{type:"small",style:nt.SCRIPTSCRIPT},{type:"small",style:nt.SCRIPT},{type:"small",style:nt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Gp=[{type:"small",style:nt.SCRIPTSCRIPT},{type:"small",style:nt.SCRIPT},{type:"small",style:nt.TEXT},{type:"stack"}],Fu=[{type:"small",style:nt.SCRIPTSCRIPT},{type:"small",style:nt.SCRIPT},{type:"small",style:nt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],Wp=function(e){if(e.type==="small")return"Main-Regular";if(e.type==="large")return"Size"+e.size+"-Regular";if(e.type==="stack")return"Size4-Regular";var n=e.type;throw new Error("Add support for delim type '"+n+"' here.")},Vu=function(e,n,r,o){for(var l=Math.min(2,3-o.style.size),a=l;a<r.length;a++){var s=r[a];if(s.type==="stack")break;var c=Ei(e,Wp(s),"math"),u=c.height+c.depth;if(s.type==="small"){var d=o.havingBaseStyle(s.style);u*=d.sizeMultiplier}if(u>n)return s}return r[r.length-1]},ss=function(e,n,r,o,l,a){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var s;Pu.has(e)?s=qp:Hu.has(e)?s=Fu:s=Gp;var c=Vu(e,n,s,o);return c.type==="small"?Hp(e,c.style,r,o,l,a):c.type==="large"?Du(e,c.size,r,o,l,a):zu(e,n,r,o,l,a)},cs=function(e,n,r,o,l,a){var s=o.fontMetrics().axisHeight*o.sizeMultiplier,c=901,u=5/o.fontMetrics().ptPerEm,d=Math.max(n-s,r+s),f=Math.max(d/500*c,2*d-u);return ss(e,f,!0,o,l,a)},Uu={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},Kp=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function qu(t){return"isMiddle"in t}function yl(t,e){var n=gl(t);if(n&&Kp.has(n.text))return n;throw n?new ke("Invalid delimiter '"+n.text+"' after '"+e.funcName+"'",t):new ke("Invalid delimiter type '"+t.type+"'",t)}Ie({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],numArgs:1,argTypes:["primitive"],handler:(t,e)=>{var n=yl(wi(e[0]),t);return{type:"delimsizing",mode:t.parser.mode,size:Uu[t.funcName].size,mclass:Uu[t.funcName].mclass,delim:n.text}},htmlBuilder:(t,e)=>t.delim==="."?ve([t.mclass]):$u(t.delim,t.size,e,t.mode,[t.mclass]),mathmlBuilder:t=>{var e=[];t.delim!=="."&&e.push(ar(t.delim,t.mode));var n=new we("mo",e);t.mclass==="mopen"||t.mclass==="mclose"?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=Ce(Ci[t.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}});function Gu(t){if(!t.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Ie({type:"leftright-right",names:["\\right"],numArgs:1,primitive:!0,handler:(t,e)=>{var n=t.parser.gullet.macros.get("\\current@color");if(n&&typeof n!="string")throw new ke("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:t.parser.mode,delim:yl(e[0],t).text,color:n}}}),Ie({type:"leftright",names:["\\left"],numArgs:1,primitive:!0,handler:(t,e)=>{var n=yl(e[0],t),r=t.parser;++r.leftrightDepth;var o=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var l=ft(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:o,left:n.text,right:l.delim,rightColor:l.color}},htmlBuilder:(t,e)=>{Gu(t);for(var n=wn(t.body,e,!0,["mopen","mclose"]),r=0,o=0,l=!1,a=0;a<n.length;a++){var s=n[a];qu(s)?l=!0:(r=Math.max(n[a].height,r),o=Math.max(n[a].depth,o))}r*=e.sizeMultiplier,o*=e.sizeMultiplier;var c;if(t.left==="."?c=xi(e,["mopen"]):c=cs(t.left,r,o,e,t.mode,["mopen"]),n.unshift(c),l)for(var u=1;u<n.length;u++){var d=n[u];if(qu(d)){var f=d.isMiddle;n[u]=cs(f.delim,r,o,f.options,t.mode,[])}}var p;if(t.right===".")p=xi(e,["mclose"]);else{var b=t.rightColor?e.withColor(t.rightColor):e;p=cs(t.right,r,o,b,t.mode,["mclose"])}return n.push(p),ve(["minner"],n,e)},mathmlBuilder:(t,e)=>{Gu(t);var n=nr(t.body,e);if(t.left!=="."){var r=new we("mo",[ar(t.left,t.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if(t.right!=="."){var o=new we("mo",[ar(t.right,t.mode)]);o.setAttribute("fence","true"),t.rightColor&&o.setAttribute("mathcolor",t.rightColor),n.push(o)}return Za(n)}}),Ie({type:"middle",names:["\\middle"],numArgs:1,primitive:!0,handler:(t,e)=>{var n=yl(e[0],t);if(!t.parser.leftrightDepth)throw new ke("\\middle without preceding \\left",n);return{type:"middle",mode:t.parser.mode,delim:n.text}},htmlBuilder:(t,e)=>{var n;return t.delim==="."?n=xi(e,[]):(n=$u(t.delim,1,e,t.mode,[]),n.isMiddle={delim:t.delim,options:e}),n},mathmlBuilder:(t,e)=>{var n=t.delim==="\\vert"||t.delim==="|"?ar("|","text"):ar(t.delim,t.mode),r=new we("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var Yp=(t,e)=>{var n=Ko(Bt(t.body,e),e),r=t.label.slice(1),o=e.sizeMultiplier,l,a,s=Hr(t.body);if(r==="sout")l=ve(["katex-stretchy","katex-sout"]),l.height=e.fontMetrics().defaultRuleThickness/o,a=-.5*e.fontMetrics().xHeight;else if(r==="phase"){var c=Jt({number:.6,unit:"pt"},e),u=Jt({number:.35,unit:"ex"},e),d=e.havingBaseSizing();o=o/d.sizeMultiplier;var f=n.height+n.depth+c+u;n.style.paddingLeft=Ce(f/2+c);var p=Math.floor(1e3*f*o),b=H4(p),g=new $r([new ro("phase",b)],{width:"400em",height:Ce(p/1e3),viewBox:"0 0 400000 "+p,preserveAspectRatio:"xMinYMin slice"});l=io(["hide-tail"],[g],e),l.style.height=Ce(f),a=n.depth+c+u}else{/cancel/.test(r)?s||n.classes.push("cancel-pad"):r==="angl"?n.classes.push("anglpad"):n.classes.push("boxpad");var k,E,M=0;/box/.test(r)?(M=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),k=e.fontMetrics().fboxsep+(r==="colorbox"?0:M),E=k):r==="angl"?(M=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),k=4*M,E=Math.max(0,.25-n.depth)):(k=s?.2:0,E=k),l=wp(n,r,k,E,e),/fbox|boxed|fcolorbox/.test(r)?(l.style.borderStyle="solid",l.style.borderWidth=Ce(M)):r==="angl"&&M!==.049&&(l.style.borderTopWidth=Ce(M),l.style.borderRightWidth=Ce(M)),a=n.depth+E,t.backgroundColor&&(l.style.backgroundColor=t.backgroundColor,t.borderColor&&(l.style.borderColor=t.borderColor))}var O;if(t.backgroundColor)O=Nt({positionType:"individualShift",children:[{type:"elem",elem:l,shift:a},{type:"elem",elem:n,shift:0}]});else{var P=/cancel|phase/.test(r)?["svg-align"]:[];O=Nt({positionType:"individualShift",children:[{type:"elem",elem:n,shift:0},{type:"elem",elem:l,shift:a,wrapperClasses:P}]})}return/cancel/.test(r)&&(O.height=n.height,O.depth=n.depth),/cancel/.test(r)&&!s?ve(["mord","cancel-lap"],[O],e):ve(["mord"],[O],e)},Xp=(t,e)=>{var n,r=new we(t.label.includes("colorbox")?"mpadded":"menclose",[$t(t.body,e)]);switch(t.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),t.label==="\\fcolorbox"){var o=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);r.setAttribute("style","border: "+Ce(o)+" solid "+t.borderColor)}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return t.backgroundColor&&r.setAttribute("mathbackground",t.backgroundColor),r};Ie({type:"enclose",names:["\\colorbox"],numArgs:2,allowedInText:!0,argTypes:["color","hbox"],handler(t,e,n){var r=t.parser,o=t.funcName,l=ft(e[0],"color-token").color,a=e[1];return{type:"enclose",mode:r.mode,label:o,backgroundColor:l,body:a}},htmlBuilder:Yp,mathmlBuilder:Xp}),Ie({type:"enclose",names:["\\fcolorbox"],numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"],handler(t,e,n){var r=t.parser,o=t.funcName,l=ft(e[0],"color-token").color,a=ft(e[1],"color-token").color,s=e[2];return{type:"enclose",mode:r.mode,label:o,backgroundColor:a,borderColor:l,body:s}}}),Ie({type:"enclose",names:["\\fbox"],numArgs:1,argTypes:["hbox"],allowedInText:!0,handler(t,e){var n=t.parser;return{type:"enclose",mode:n.mode,label:"\\fbox",body:e[0]}}}),Ie({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],numArgs:1,handler(t,e){var n=t.parser,r=t.funcName,o=e[0];return{type:"enclose",mode:n.mode,label:r,body:o}}}),Ie({type:"enclose",names:["\\sout"],numArgs:1,allowedInText:!0,handler(t,e){var n=t.parser,r=t.funcName;n.mode==="math"&&n.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var o=e[0];return{type:"enclose",mode:n.mode,label:r,body:o}}}),Ie({type:"enclose",names:["\\angl"],numArgs:1,argTypes:["hbox"],allowedInText:!1,handler(t,e){var n=t.parser;return{type:"enclose",mode:n.mode,label:"\\angl",body:e[0]}}});var Wu={};function Cr(t){for(var e=t.type,n=t.names,r=t.props,o=t.handler,l=t.htmlBuilder,a=t.mathmlBuilder,s={type:e,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:o},c=0;c<n.length;++c)Wu[n[c]]=s;l&&(ki[e]=l),a&&(yi[e]=a)}var Ku={};function y(t,e){Ku[t]=e}class Xn{constructor(e,n,r){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=n,this.end=r}static range(e,n){return n?!e||!e.loc||!n.loc||e.loc.lexer!==n.loc.lexer?null:new Xn(e.loc.lexer,e.loc.start,n.loc.end):e&&e.loc}}class rr{constructor(e,n){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=n}range(e,n){return new rr(n,Xn.range(this,e))}}function Yu(t){var e=[];t.consumeSpaces();var n=t.fetch().text;for(n==="\\relax"&&(t.consume(),t.consumeSpaces(),n=t.fetch().text);n==="\\hline"||n==="\\hdashline";)t.consume(),e.push(n==="\\hdashline"),t.consumeSpaces(),n=t.fetch().text;return e}var wl=t=>{var e=t.parser.settings;if(!e.displayMode)throw new ke("{"+t.envName+"} can be used only in display mode.")},Zp=new Set(["gather","gather*"]);function us(t){if(!t.includes("ed"))return!t.includes("*")}function ao(t,e,n){var r=e.hskipBeforeAndAfter,o=e.addJot,l=e.cols,a=e.arraystretch,s=e.colSeparationType,c=e.autoTag,u=e.singleRow,d=e.emptySingleRow,f=e.maxNumCols,p=e.leqno;if(t.gullet.beginGroup(),u||t.gullet.macros.set("\\cr","\\\\\\relax"),!a){var b=t.gullet.expandMacroAsText("\\arraystretch");if(b==null)a=1;else if(a=parseFloat(b),!a||a<0)throw new ke("Invalid \\arraystretch: "+b)}t.gullet.beginGroup();var g=[],k=[g],E=[],M=[],O=c!=null?[]:void 0;function P(){c&&t.gullet.macros.set("\\@eqnsw","1",!0)}function te(){O&&(t.gullet.macros.get("\\df@tag")?(O.push(t.subparse([new rr("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):O.push(!!c&&t.gullet.macros.get("\\@eqnsw")==="1"))}for(P(),M.push(Yu(t));;){var z=t.parseExpression(!1,u?"\\end":"\\\\");t.gullet.endGroup(),t.gullet.beginGroup();var H={type:"ordgroup",mode:t.mode,body:z};n&&(H={type:"styling",mode:t.mode,style:n,resetFont:!0,body:[H]}),g.push(H);var ie=t.fetch().text;if(ie==="&"){if(f&&g.length===f){if(u||s)throw new ke("Too many tab characters: &",t.nextToken);t.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}t.consume()}else if(ie==="\\end"){te(),g.length===1&&H.type==="styling"&&H.body.length===1&&H.body[0].type==="ordgroup"&&H.body[0].body.length===0&&(k.length>1||!d)&&k.pop(),M.length<k.length+1&&M.push([]);break}else if(ie==="\\\\"){t.consume();var Q=void 0;t.gullet.future().text!==" "&&(Q=t.parseSizeGroup(!0)),E.push(Q?Q.value:null),te(),M.push(Yu(t)),g=[],k.push(g),P()}else throw new ke("Expected & or \\\\ or \\cr or \\end",t.nextToken)}return t.gullet.endGroup(),t.gullet.endGroup(),{type:"array",mode:t.mode,addJot:o,arraystretch:a,body:k,cols:l,rowGaps:E,hskipBeforeAndAfter:r,hLinesBeforeRow:M,colSeparationType:s,tags:O,leqno:p}}function ds(t){return t.slice(0,1)==="d"?"display":"text"}var Sr=function(e,n){var r,o,l=e.body.length,a=e.hLinesBeforeRow,s=0,c=new Array(l),u=[],d=Math.max(n.fontMetrics().arrayRuleWidth,n.minRuleThickness),f=1/n.fontMetrics().ptPerEm,p=5*f;if(e.colSeparationType&&e.colSeparationType==="small"){var b=n.havingStyle(nt.SCRIPT).sizeMultiplier;p=.2778*(b/n.sizeMultiplier)}var g=e.colSeparationType==="CD"?Jt({number:3,unit:"ex"},n):12*f,k=3*f,E=e.arraystretch*g,M=.7*E,O=.3*E,P=0;function te(L){for(var re=0;re<L.length;++re)re>0&&(P+=.25),u.push({pos:P,isDashed:L[re]})}for(te(a[0]),r=0;r<e.body.length;++r){var z=e.body[r],H=M,ie=O;s<z.length&&(s=z.length);var Q={cells:new Array(z.length),height:0,depth:0,pos:0};for(o=0;o<z.length;++o){var ne=Bt(z[o],n);ie<ne.depth&&(ie=ne.depth),H<ne.height&&(H=ne.height),Q.cells[o]=ne}var _=e.rowGaps[r],$=0;_&&($=Jt(_,n),$>0&&($+=O,ie<$&&(ie=$),$=0)),e.addJot&&r<e.body.length-1&&(ie+=k),Q.height=H,Q.depth=ie,P+=H,Q.pos=P,P+=ie+$,c[r]=Q,te(a[r+1])}var D=P/2+n.fontMetrics().axisHeight,W=e.cols||[],K=[],B,A,j=[];if(e.tags&&e.tags.some(L=>L))for(r=0;r<l;++r){var F=c[r],V=F.pos-D,fe=e.tags[r],Ee=void 0;fe===!0?Ee=ve(["eqn-num"],[],n):fe===!1?Ee=ve([],[],n):Ee=ve([],wn(fe,n,!0),n),Ee.depth=F.depth,Ee.height=F.height,j.push({type:"elem",elem:Ee,shift:V})}for(o=0,A=0;o<s||A<W.length;++o,++A){for(var Me,ae=W[A],Te=!0;((He=ae)==null?void 0:He.type)==="separator";){var He;if(Te||(B=ve(["arraycolsep"],[]),B.style.width=Ce(n.fontMetrics().doubleRuleSep),K.push(B)),ae.separator==="|"||ae.separator===":"){var xe=ae.separator==="|"?"solid":"dashed",tt=ve(["vertical-separator"],[],n);tt.style.height=Ce(P),tt.style.borderRightWidth=Ce(d),tt.style.borderRightStyle=xe,tt.style.margin="0 "+Ce(-d/2);var Vt=P-D;Vt&&(tt.style.verticalAlign=Ce(-Vt)),K.push(tt)}else throw new ke("Invalid separator type: "+ae.separator);A++,ae=W[A],Te=!1}if(!(o>=s)){var on=void 0;if(o>0||e.hskipBeforeAndAfter){var gn,Gt;on=(gn=(Gt=ae)==null?void 0:Gt.pregap)!=null?gn:p,on!==0&&(B=ve(["arraycolsep"],[]),B.style.width=Ce(on),K.push(B))}var ct=[];for(r=0;r<l;++r){var Zt=c[r],ln=Zt.cells[o];if(ln){var St=Zt.pos-D;ln.depth=Zt.depth,ln.height=Zt.height,ct.push({type:"elem",elem:ln,shift:St})}}var Ke=Nt({positionType:"individualShift",children:ct}),yt=ve(["col-align-"+(((Me=ae)==null?void 0:Me.align)||"c")],[Ke]);if(K.push(yt),o<s-1||e.hskipBeforeAndAfter){var Pe,Ut;on=(Pe=(Ut=ae)==null?void 0:Ut.postgap)!=null?Pe:p,on!==0&&(B=ve(["arraycolsep"],[]),B.style.width=Ce(on),K.push(B))}}}var Fe=ve(["mtable"],K);if(u.length>0){for(var qe=Wo("katex-hline",n,d),jt=Wo("katex-hdashline",n,d),gt=[{type:"elem",elem:Fe,shift:0}];u.length>0;){var Qt=u.pop(),at=Qt.pos-D;Qt.isDashed?gt.push({type:"elem",elem:jt,shift:at}):gt.push({type:"elem",elem:qe,shift:at})}Fe=Nt({positionType:"individualShift",children:gt})}if(j.length===0)return ve(["mord"],[Fe],n);var be=Nt({positionType:"individualShift",children:j}),Y=ve(["katex-tag"],[be],n);return Vr([Fe,Y])},jp={c:"center ",l:"left ",r:"right "},Tr=function(e,n){for(var r=[],o=new we("mtd",[],["mtr-glue"]),l=new we("mtd",[],["mml-eqn-num"]),a=0;a<e.body.length;a++){for(var s=e.body[a],c=[],u=0;u<s.length;u++)c.push(new we("mtd",[$t(s[u],n)]));e.tags&&e.tags[a]&&(c.unshift(o),c.push(o),e.leqno?c.unshift(l):c.push(l)),r.push(new we("mtr",c))}var d=new we("mtable",r),f=e.arraystretch===.5?.1:.16+e.arraystretch-1+(e.addJot?.09:0);d.setAttribute("rowspacing",Ce(f));var p="",b="";if(e.cols&&e.cols.length>0){var g=e.cols,k="",E=!1,M=0,O=g.length;g[0].type==="separator"&&(p+="top ",M=1),g[g.length-1].type==="separator"&&(p+="bottom ",O-=1);for(var P=M;P<O;P++){var te=g[P];te.type==="align"?(b+=jp[te.align],E&&(k+="none "),E=!0):te.type==="separator"&&E&&(k+=te.separator==="|"?"solid ":"dashed ",E=!1)}d.setAttribute("columnalign",b.trim()),/[sd]/.test(k)&&d.setAttribute("columnlines",k.trim())}if(e.colSeparationType==="align"){for(var z=e.cols||[],H="",ie=1;ie<z.length;ie++)H+=ie%2?"0em ":"1em ";d.setAttribute("columnspacing",H.trim())}else e.colSeparationType==="alignat"||e.colSeparationType==="gather"?d.setAttribute("columnspacing","0em"):e.colSeparationType==="small"?d.setAttribute("columnspacing","0.2778em"):e.colSeparationType==="CD"?d.setAttribute("columnspacing","0.5em"):d.setAttribute("columnspacing","1em");var Q="",ne=e.hLinesBeforeRow;p+=ne[0].length>0?"left ":"",p+=ne[ne.length-1].length>0?"right ":"";for(var _=1;_<ne.length-1;_++)Q+=ne[_].length===0?"none ":ne[_][0]?"dashed ":"solid ";return/[sd]/.test(Q)&&d.setAttribute("rowlines",Q.trim()),p!==""&&(d=new we("menclose",[d]),d.setAttribute("notation",p.trim())),e.arraystretch&&e.arraystretch<1&&(d=new we("mstyle",[d]),d.setAttribute("scriptlevel","1")),d},Xu=function(e,n){e.envName.includes("ed")||wl(e);var r=[],o=e.envName==="split",l=ao(e.parser,{cols:r,addJot:!0,autoTag:o?void 0:us(e.envName),emptySingleRow:!0,colSeparationType:e.envName.includes("at")?"alignat":"align",maxNumCols:o?2:void 0,leqno:e.parser.settings.leqno},"display"),a=0,s=0,c={type:"ordgroup",mode:e.mode,body:[]};if(n[0]&&n[0].type==="ordgroup"){var u="Number of columns should be a positive integer",d=Ja(n[0],u);if(!/^[0-9]+$/.test(d)||Number(d)<1)throw new ke(u,n[0]);a=Number(d),s=a*2}var f=!s;l.body.forEach(function(k){for(var E=1;E<k.length;E+=2){var M=ft(k[E],"styling"),O=ft(M.body[0],"ordgroup");O.body.unshift(c)}if(f)s<k.length&&(s=k.length);else{var P=k.length/2;if(a<P)throw new ke("Too many math in a row: "+("expected "+a+", but got "+P),k[0])}});for(var p=0;p<s;++p){var b="r",g=0;p%2===1?b="l":p>0&&f&&(g=1),r[p]={type:"align",align:b,pregap:g,postgap:0}}return l.colSeparationType=f?"align":"alignat",l};Cr({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var n=gl(e[0]),r=n?[e[0]]:ft(e[0],"ordgroup").body,o=r.map(function(a){var s=pl(a),c=s.text;if("lcr".includes(c))return{type:"align",align:c};if(c==="|")return{type:"separator",separator:"|"};if(c===":")return{type:"separator",separator:":"};throw new ke("Unknown column alignment: "+c,a)}),l={cols:o,hskipBeforeAndAfter:!0,maxNumCols:o.length};return ao(t.parser,l,ds(t.envName))},htmlBuilder:Sr,mathmlBuilder:Tr}),Cr({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(t){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[t.envName.replace("*","")],n="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if(t.envName.charAt(t.envName.length-1)==="*"){var o=t.parser;if(o.consumeSpaces(),o.fetch().text==="["){if(o.consume(),o.consumeSpaces(),n=o.fetch().text,!"lcr".includes(n))throw new ke("Expected l or c or r",o.nextToken);o.consume(),o.consumeSpaces(),o.expect("]"),o.consume(),r.cols=[{type:"align",align:n}]}}var l=ao(t.parser,r,ds(t.envName)),a=Math.max(0,...l.body.map(s=>s.length));return l.cols=new Array(a).fill({type:"align",align:n}),e?{type:"leftright",mode:t.mode,body:[l],left:e[0],right:e[1],rightColor:void 0}:l},htmlBuilder:Sr,mathmlBuilder:Tr}),Cr({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e={arraystretch:.5},n=ao(t.parser,e,"script");return n.colSeparationType="small",n},htmlBuilder:Sr,mathmlBuilder:Tr}),Cr({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var n=gl(e[0]),r=n?[e[0]]:ft(e[0],"ordgroup").body,o=r.map(function(s){var c=pl(s),u=c.text;if("lc".includes(u))return{type:"align",align:u};throw new ke("Unknown column alignment: "+u,s)});if(o.length>1)throw new ke("{subarray} can contain only one column");var l={cols:o,hskipBeforeAndAfter:!1,arraystretch:.5},a=ao(t.parser,l,"script");if(a.body.length>0&&a.body[0].length>1)throw new ke("{subarray} can contain only one column");return a},htmlBuilder:Sr,mathmlBuilder:Tr}),Cr({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(t){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},n=ao(t.parser,e,ds(t.envName));return{type:"leftright",mode:t.mode,body:[n],left:t.envName.includes("r")?".":"\\{",right:t.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:Sr,mathmlBuilder:Tr}),Cr({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:Xu,htmlBuilder:Sr,mathmlBuilder:Tr}),Cr({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){Zp.has(t.envName)&&wl(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:us(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return ao(t.parser,e,"display")},htmlBuilder:Sr,mathmlBuilder:Tr}),Cr({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:Xu,htmlBuilder:Sr,mathmlBuilder:Tr}),Cr({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){wl(t);var e={autoTag:us(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return ao(t.parser,e,"display")},htmlBuilder:Sr,mathmlBuilder:Tr}),Cr({type:"array",names:["CD"],props:{numArgs:0},handler(t){return wl(t),Lp(t.parser)},htmlBuilder:Sr,mathmlBuilder:Tr}),y("\\nonumber","\\gdef\\@eqnsw{0}"),y("\\notag","\\nonumber"),Ie({type:"text",names:["\\hline","\\hdashline"],numArgs:0,allowedInText:!0,allowedInMath:!0,handler(t,e){throw new ke(t.funcName+" valid only within array environment")}});var Zu=Wu;Ie({type:"environment",names:["\\begin","\\end"],numArgs:1,argTypes:["text"],handler(t,e){var n=t.parser,r=t.funcName,o=e[0];if(o.type!=="ordgroup")throw new ke("Invalid environment name",o);var l=Ja(o,"Environment name should contain only text characters and spaces",!0);if(r==="\\begin"){if(!Object.prototype.hasOwnProperty.call(Zu,l))throw new ke("No such environment: "+l,o);var a=Zu[l],s=n.parseArguments("\\begin{"+l+"}",a),c=s.args,u=s.optArgs,d={mode:n.mode,envName:l,parser:n},f=a.handler(d,c,u);n.expect("\\end",!1);var p=n.nextToken,b=ft(n.parseFunction(),"environment");if(b.name!==l)throw new ke("Mismatch: \\begin{"+l+"} matched by \\end{"+b.name+"}",p);return f}return{type:"environment",mode:n.mode,name:l,nameGroup:o}}});var Qp=(t,e)=>{var n=t.font,r=e.withFont(n);return Bt(t.body,r)},Jp=(t,e)=>{var n=t.font,r=e.withFont(n);return $t(t.body,r)},ju={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};Ie({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],numArgs:1,allowedInArgument:!0,handler:(t,e)=>{var n=t.parser,r=t.funcName,o=wi(e[0]),l=r in ju?ju[r]:r;return{type:"font",mode:n.mode,font:l.slice(1),body:o}},htmlBuilder:Qp,mathmlBuilder:Jp}),Ie({type:"mclass",names:["\\boldsymbol","\\bm"],numArgs:1,handler:(t,e)=>{var n=t.parser,r=e[0];return{type:"mclass",mode:n.mode,mclass:vl(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:Hr(r)}}}),Ie({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],numArgs:0,allowedInText:!0,handler:(t,e)=>{var n=t.parser,r=t.funcName,o=t.breakOnTokenText,l=n.mode,a=n.parseExpression(!0,o);return{type:"font",mode:l,font:"math"+r.slice(1),body:{type:"ordgroup",mode:n.mode,body:a}}}});var e7=(t,e)=>{var n=e.style,r=n.fracNum(),o=n.fracDen(),l;l=e.havingStyle(r);var a=Bt(t.numer,l,e);if(t.continued){var s=8.5/e.fontMetrics().ptPerEm,c=3.5/e.fontMetrics().ptPerEm;a.height=a.height<s?s:a.height,a.depth=a.depth<c?c:a.depth}l=e.havingStyle(o);var u=Bt(t.denom,l,e),d,f,p;t.hasBarLine?(t.barSize?(f=Jt(t.barSize,e),d=Wo("frac-line",e,f)):d=Wo("frac-line",e),f=d.height,p=d.height):(d=null,f=0,p=e.fontMetrics().defaultRuleThickness);var b,g,k;n.size===nt.DISPLAY.size?(b=e.fontMetrics().num1,f>0?g=3*p:g=7*p,k=e.fontMetrics().denom1):(f>0?(b=e.fontMetrics().num2,g=p):(b=e.fontMetrics().num3,g=3*p),k=e.fontMetrics().denom2);var E;if(d){var O=e.fontMetrics().axisHeight;b-a.depth-(O+.5*f)<g&&(b+=g-(b-a.depth-(O+.5*f))),O-.5*f-(u.height-k)<g&&(k+=g-(O-.5*f-(u.height-k)));var P=-(O-.5*f);E=Nt({positionType:"individualShift",children:[{type:"elem",elem:u,shift:k},{type:"elem",elem:d,shift:P},{type:"elem",elem:a,shift:-b}]})}else{var M=b-a.depth-(u.height-k);M<g&&(b+=.5*(g-M),k+=.5*(g-M)),E=Nt({positionType:"individualShift",children:[{type:"elem",elem:u,shift:k},{type:"elem",elem:a,shift:-b}]})}l=e.havingStyle(n),E.height*=l.sizeMultiplier/e.sizeMultiplier,E.depth*=l.sizeMultiplier/e.sizeMultiplier;var te;n.size===nt.DISPLAY.size?te=e.fontMetrics().delim1:n.size===nt.SCRIPTSCRIPT.size?te=e.havingStyle(nt.SCRIPT).fontMetrics().delim2:te=e.fontMetrics().delim2;var z,H;return t.leftDelim==null?z=xi(e,["mopen"]):z=ss(t.leftDelim,te,!0,e.havingStyle(n),t.mode,["mopen"]),t.continued?H=ve([]):t.rightDelim==null?H=xi(e,["mclose"]):H=ss(t.rightDelim,te,!0,e.havingStyle(n),t.mode,["mclose"]),ve(["mord"].concat(l.sizingClasses(e)),[z,ve(["mfrac"],[E]),H],e)},t7=(t,e)=>{var n=new we("mfrac",[$t(t.numer,e),$t(t.denom,e)]);if(!t.hasBarLine)n.setAttribute("linethickness","0px");else if(t.barSize){var r=Jt(t.barSize,e);n.setAttribute("linethickness",Ce(r))}if(t.leftDelim!=null||t.rightDelim!=null){var o=[];if(t.leftDelim!=null){var l=new we("mo",[new pn(t.leftDelim.replace("\\",""))]);l.setAttribute("fence","true"),o.push(l)}if(o.push(n),t.rightDelim!=null){var a=new we("mo",[new pn(t.rightDelim.replace("\\",""))]);a.setAttribute("fence","true"),o.push(a)}return Za(o)}return n},Qu=(t,e)=>{if(!e)return t;var n={type:"styling",mode:t.mode,style:e,body:[t]};return n};Ie({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],numArgs:2,allowedInArgument:!0,handler:(t,e)=>{var n=t.parser,r=t.funcName,o=e[0],l=e[1],a,s=null,c=null;switch(r){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":a=!0;break;case"\\\\atopfrac":a=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":a=!1,s="(",c=")";break;case"\\\\bracefrac":a=!1,s="\\{",c="\\}";break;case"\\\\brackfrac":a=!1,s="[",c="]";break;default:throw new Error("Unrecognized genfrac command")}var u=r==="\\cfrac",d=null;return u||r.startsWith("\\d")?d="display":r.startsWith("\\t")&&(d="text"),Qu({type:"genfrac",mode:n.mode,numer:o,denom:l,continued:u,hasBarLine:a,leftDelim:s,rightDelim:c,barSize:null},d)},htmlBuilder:e7,mathmlBuilder:t7}),Ie({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],numArgs:0,infix:!0,handler(t){var e=t.parser,n=t.funcName,r=t.token,o;switch(n){case"\\over":o="\\frac";break;case"\\choose":o="\\binom";break;case"\\atop":o="\\\\atopfrac";break;case"\\brace":o="\\\\bracefrac";break;case"\\brack":o="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:e.mode,replaceWith:o,token:r}}});var Ju=["display","text","script","scriptscript"],ed=function(e){var n=null;return e.length>0&&(n=e,n=n==="."?null:n),n};Ie({type:"genfrac",names:["\\genfrac"],numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"],handler(t,e){var n=t.parser,r=e[4],o=e[5],l=wi(e[0]),a=l.type==="atom"&&l.family==="open"?ed(l.text):null,s=wi(e[1]),c=s.type==="atom"&&s.family==="close"?ed(s.text):null,u=ft(e[2],"size"),d,f=null;u.isBlank?d=!0:(f=u.value,d=f.number>0);var p=null,b=e[3];if(b.type==="ordgroup"){if(b.body.length>0){var g=ft(b.body[0],"textord");p=Ju[Number(g.text)]}}else b=ft(b,"textord"),p=Ju[Number(b.text)];return Qu({type:"genfrac",mode:n.mode,numer:r,denom:o,continued:!1,hasBarLine:d,barSize:f,leftDelim:a,rightDelim:c},p)}}),Ie({type:"infix",names:["\\above"],numArgs:1,argTypes:["size"],infix:!0,handler(t,e){var n=t.parser;t.funcName;var r=t.token;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:ft(e[0],"size").value,token:r}}}),Ie({type:"genfrac",names:["\\\\abovefrac"],numArgs:3,argTypes:["math","size","math"],handler:(t,e)=>{var n=t.parser;t.funcName;var r=e[0],o=ft(e[1],"infix").size;if(!o)throw new Error("\\\\abovefrac expected size, but got "+String(o));var l=e[2],a=o.number>0;return{type:"genfrac",mode:n.mode,numer:r,denom:l,continued:!1,hasBarLine:a,barSize:o,leftDelim:null,rightDelim:null}}});var td=(t,e)=>{var n=e.style,r,o;t.type==="supsub"?(r=t.sup?Bt(t.sup,e.havingStyle(n.sup()),e):Bt(t.sub,e.havingStyle(n.sub()),e),o=ft(t.base,"horizBrace")):o=ft(t,"horizBrace");var l=Bt(o.base,e.havingBaseStyle(nt.DISPLAY)),a=ml(o,e),s;if(o.isOver?s=Nt({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.1},{type:"elem",elem:a,wrapperClasses:["svg-align"]}]}):s=Nt({positionType:"bottom",positionData:l.depth+.1+a.height,children:[{type:"elem",elem:a,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:l}]}),r){var c=ve(["minner",o.isOver?"mover":"munder"],[s],e);o.isOver?s=Nt({positionType:"firstBaseline",children:[{type:"elem",elem:c},{type:"kern",size:.2},{type:"elem",elem:r}]}):s=Nt({positionType:"bottom",positionData:c.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:c}]})}return ve(["minner",o.isOver?"mover":"munder"],[s],e)},n7=(t,e)=>{var n=hl(t.label);return new we(t.isOver?"mover":"munder",[$t(t.base,e),n])};Ie({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],numArgs:1,handler(t,e){var n=t.parser,r=t.funcName;return{type:"horizBrace",mode:n.mode,label:r,isOver:r.includes("\\over"),base:e[0]}},htmlBuilder:td,mathmlBuilder:n7}),Ie({type:"href",names:["\\href"],numArgs:2,argTypes:["url","original"],allowedInText:!0,handler:(t,e)=>{var n=t.parser,r=e[1],o=ft(e[0],"url").url;return n.settings.isTrusted({command:"\\href",url:o})?{type:"href",mode:n.mode,href:o,body:mn(r)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(t,e)=>{var n=wn(t.body,e,!1);return op(t.href,[],n,e)},mathmlBuilder:(t,e)=>{var n=lo(t.body,e);return n instanceof we||(n=new we("mrow",[n])),n.setAttribute("href",t.href),n}}),Ie({type:"href",names:["\\url"],numArgs:1,argTypes:["url"],allowedInText:!0,handler:(t,e)=>{var n=t.parser,r=ft(e[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:r}))return n.formatUnsupportedCmd("\\url");for(var o=[],l=0;l<r.length;l++){var a=r[l];a==="~"&&(a="\\textasciitilde"),o.push({type:"textord",mode:"text",text:a})}var s={type:"text",mode:n.mode,font:"\\texttt",body:o};return{type:"href",mode:n.mode,href:r,body:mn(s)}}}),Ie({type:"hbox",names:["\\hbox"],numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0,handler(t,e){var n=t.parser;return{type:"hbox",mode:n.mode,body:mn(e[0])}},htmlBuilder(t,e){var n=wn(t.body,e.withFont(""),!1);return Vr(n)},mathmlBuilder(t,e){return new we("mrow",nr(t.body,e.withFont("")))}}),Ie({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],numArgs:2,argTypes:["raw","original"],allowedInText:!0,handler:(t,e)=>{var n=t.parser,r=t.funcName;t.token;var o=ft(e[0],"raw").string,l=e[1];n.settings.strict&&n.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var a,s={};switch(r){case"\\htmlClass":s.class=o,a={command:"\\htmlClass",class:o};break;case"\\htmlId":s.id=o,a={command:"\\htmlId",id:o};break;case"\\htmlStyle":s.style=o,a={command:"\\htmlStyle",style:o};break;case"\\htmlData":{for(var c="{,}",u=[],d="",f=0;f<o.length;f++)o.startsWith(c,f)?(d+=",",f+=c.length-1):o[f]===","?(u.push(d),d=""):d+=o[f];u.push(d);for(var p=0;p<u.length;p++){var b=u[p],g=b.indexOf("=");if(g<0)throw new ke("\\htmlData key/value '"+b+"' missing equals sign");var k=b.slice(0,g),E=b.slice(g+1);s["data-"+k.trim()]=E}a={command:"\\htmlData",attributes:s};break}default:throw new Error("Unrecognized html command")}return n.settings.isTrusted(a)?{type:"html",mode:n.mode,attributes:s,body:mn(l)}:n.formatUnsupportedCmd(r)},htmlBuilder:(t,e)=>{var n=wn(t.body,e,!1),r=["enclosing"];t.attributes.class&&r.push(...t.attributes.class.trim().split(/\s+/));var o=ve(r,n,e);for(var l of Object.entries(t.attributes)){var a=l[0],s=l[1];a!=="class"&&o.setAttribute(a,s)}return o},mathmlBuilder:(t,e)=>lo(t.body,e)}),Ie({type:"htmlmathml",names:["\\html@mathml"],numArgs:2,allowedInArgument:!0,allowedInText:!0,handler:(t,e)=>{var n=t.parser;return{type:"htmlmathml",mode:n.mode,html:mn(e[0]),mathml:mn(e[1])}},htmlBuilder:(t,e)=>{var n=wn(t.html,e,!1);return Vr(n)},mathmlBuilder:(t,e)=>lo(t.mathml,e)});var fs=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var n=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!n)throw new ke("Invalid size: '"+e+"' in \\includegraphics");var r={number:+(n[1]+n[2]),unit:n[3]};if(!Jc(r))throw new ke("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};Ie({type:"includegraphics",names:["\\includegraphics"],numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1,handler:(t,e,n)=>{var r=t.parser,o={number:0,unit:"em"},l={number:.9,unit:"em"},a={number:0,unit:"em"},s="";if(n[0])for(var c=ft(n[0],"raw").string,u=c.split(","),d=0;d<u.length;d++){var f=u[d].split("=");if(f.length===2){var p=f[1].trim();switch(f[0].trim()){case"alt":s=p;break;case"width":o=fs(p);break;case"height":l=fs(p);break;case"totalheight":a=fs(p);break;default:throw new ke("Invalid key: '"+f[0]+"' in \\includegraphics.")}}}var b=ft(e[0],"url").url;return s===""&&(s=b,s=s.replace(/^.*[\\/]/,""),s=s.substring(0,s.lastIndexOf("."))),r.settings.isTrusted({command:"\\includegraphics",url:b})?{type:"includegraphics",mode:r.mode,alt:s,width:o,height:l,totalheight:a,src:b}:r.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(t,e)=>{var n=Jt(t.height,e),r=0;t.totalheight.number>0&&(r=Jt(t.totalheight,e)-n);var o=0;t.width.number>0&&(o=Jt(t.width,e));var l={height:Ce(n+r)};o>0&&(l.width=Ce(o)),r>0&&(l.verticalAlign=Ce(-r));var a=new W4(t.src,t.alt,l);return a.height=n,a.depth=r,a},mathmlBuilder:(t,e)=>{var n=new we("mglyph",[]);n.setAttribute("alt",t.alt);var r=Jt(t.height,e),o=0;if(t.totalheight.number>0&&(o=Jt(t.totalheight,e)-r,n.setAttribute("valign",Ce(-o))),n.setAttribute("height",Ce(r+o)),t.width.number>0){var l=Jt(t.width,e);n.setAttribute("width",Ce(l))}return n.setAttribute("src",t.src),n}}),Ie({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0,handler(t,e){var n=t.parser,r=t.funcName,o=ft(e[0],"size");if(n.settings.strict){var l=r[1]==="m",a=o.value.unit==="mu";l?(a||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, "+("not "+o.value.unit+" units")),n.mode!=="math"&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):a&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:o.value}},htmlBuilder(t,e){return bu(t.dimension,e)},mathmlBuilder(t,e){var n=Jt(t.dimension,e);return new Eu(n)}}),Ie({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],numArgs:1,allowedInText:!0,handler:(t,e)=>{var n=t.parser,r=t.funcName,o=e[0];return{type:"lap",mode:n.mode,alignment:r.slice(5),body:o}},htmlBuilder:(t,e)=>{var n;t.alignment==="clap"?(n=ve([],[Bt(t.body,e)]),n=ve(["katex-inner"],[n],e)):n=ve(["katex-inner"],[Bt(t.body,e)]);var r=ve(["katex-fix"],[]),o=ve([t.alignment],[n,r],e),l=ve(["katex-strut"]);return l.style.height=Ce(o.height+o.depth),o.depth&&(l.style.verticalAlign=Ce(-o.depth)),o.children.unshift(l),o=ve(["katex-thinbox"],[o],e),ve(["mord","katex-vbox"],[o],e)},mathmlBuilder:(t,e)=>{var n=new we("mpadded",[$t(t.body,e)]);if(t.alignment!=="rlap"){var r=t.alignment==="llap"?"-1":"-0.5";n.setAttribute("lspace",r+"width")}return n.setAttribute("width","0px"),n}}),Ie({type:"styling",names:["\\(","$"],numArgs:0,allowedInText:!0,allowedInMath:!1,handler(t,e){var n=t.funcName,r=t.parser,o=r.mode;r.switchMode("math");var l=n==="\\("?"\\)":"$",a=r.parseExpression(!1,l);return r.expect(l),r.switchMode(o),{type:"styling",mode:r.mode,style:"text",resetFont:!0,body:a}}}),Ie({type:"text",names:["\\)","\\]"],numArgs:0,allowedInText:!0,allowedInMath:!1,handler(t,e){throw new ke("Mismatched "+t.funcName)}});var nd=(t,e)=>{switch(e.style.size){case nt.DISPLAY.size:return t.display;case nt.TEXT.size:return t.text;case nt.SCRIPT.size:return t.script;case nt.SCRIPTSCRIPT.size:return t.scriptscript;default:return t.text}};Ie({type:"mathchoice",names:["\\mathchoice"],numArgs:4,primitive:!0,handler:(t,e)=>{var n=t.parser;return{type:"mathchoice",mode:n.mode,display:mn(e[0]),text:mn(e[1]),script:mn(e[2]),scriptscript:mn(e[3])}},htmlBuilder:(t,e)=>{var n=nd(t,e),r=wn(n,e,!1);return Vr(r)},mathmlBuilder:(t,e)=>{var n=nd(t,e);return lo(n,e)}});var rd=(t,e,n,r,o,l,a)=>{t=ve([],[t]);var s=n&&Hr(n),c,u;if(e){var d=Bt(e,r.havingStyle(o.sup()),r);u={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-d.depth)}}if(n){var f=Bt(n,r.havingStyle(o.sub()),r);c={elem:f,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-f.height)}}var p;if(u&&c){var b=r.fontMetrics().bigOpSpacing5+c.elem.height+c.elem.depth+c.kern+t.depth+a;p=Nt({positionType:"bottom",positionData:b,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:c.elem,marginLeft:Ce(-l)},{type:"kern",size:c.kern},{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:Ce(l)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else if(c){var g=t.height-a;p=Nt({positionType:"top",positionData:g,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:c.elem,marginLeft:Ce(-l)},{type:"kern",size:c.kern},{type:"elem",elem:t}]})}else if(u){var k=t.depth+a;p=Nt({positionType:"bottom",positionData:k,children:[{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:Ce(l)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else return t;var E=[p];if(c&&l!==0&&!s){var M=ve(["mspace"],[],r);M.style.marginRight=Ce(l),E.unshift(M)}return ve(["mop","op-limits"],E,r)},od=new Set(["\\smallint"]),id=(t,e)=>{var n,r,o=!1,l;t.type==="supsub"?(n=t.sup,r=t.sub,l=ft(t.base,"op"),o=!0):l=ft(t,"op");var a=e.style,s=!1;a.size===nt.DISPLAY.size&&l.symbol&&!od.has(l.name)&&(s=!0);var c,u;if(l.symbol){var d=s?"Size2-Regular":"Size1-Regular",f="";if((l.name==="\\oiint"||l.name==="\\oiiint")&&(f=l.name.slice(1),l.name=f==="oiint"?"\\iint":"\\iiint"),c=Fn(l.name,d,"math",e,["mop","op-symbol",s?"large-op":"small-op"]),u=c.italic,f.length>0){var p=ku(f+"Size"+(s?"2":"1"),e);c=Nt({positionType:"individualShift",children:[{type:"elem",elem:c,shift:0},{type:"elem",elem:p,shift:s?.08:0}]}),l.name="\\"+f,c.classes.unshift("mop"),c.italic=u}}else if(l.body){var b=wn(l.body,e,!0);b.length===1&&b[0]instanceof er?(c=b[0],c.classes[0]="mop"):c=ve(["mop"],b,e)}else{for(var g=[],k=1;k<l.name.length;k++)g.push(Ua(l.name[k],l.mode,e));c=ve(["mop"],g,e)}var E=0,M=0;if((c instanceof er||l.name==="\\oiint"||l.name==="\\oiiint")&&!l.suppressBaseShift){var O;E=(c.height-c.depth)/2-e.fontMetrics().axisHeight,M=(O=c.italic)!=null?O:0}return o?rd(c,n,r,e,a,M,E):(E&&(c.style.position="relative",c.style.top=Ce(E)),c)},r7=(t,e)=>{var n;if(t.symbol)n=new we("mo",[ar(t.name,t.mode)]),od.has(t.name)&&n.setAttribute("largeop","false");else if(t.body)n=new we("mo",nr(t.body,e));else{n=new we("mi",[new pn(t.name.slice(1))]);var r=new we("mo",[ar("","text")]);t.parentIsSupSub?n=new we("mrow",[n,r]):n=xu([n,r])}return n},o7={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Ie({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],numArgs:0,handler:(t,e)=>{var n=t.parser,r=t.funcName,o=r;return o.length===1&&(o=o7[o]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:o}},htmlBuilder:id,mathmlBuilder:r7}),Ie({type:"op",names:["\\mathop"],numArgs:1,primitive:!0,handler:(t,e)=>{var n=t.parser,r=e[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:mn(r)}}});var i7={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Ie({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],numArgs:0,handler(t){var e=t.parser,n=t.funcName;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}}}),Ie({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],numArgs:0,handler(t){var e=t.parser,n=t.funcName;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}}}),Ie({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],numArgs:0,allowedInArgument:!0,handler(t){var e=t.parser,n=t.funcName,r=n;return r.length===1&&(r=i7[r]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}}});var ld=(t,e)=>{var n,r,o=!1,l;t.type==="supsub"?(n=t.sup,r=t.sub,l=ft(t.base,"operatorname"),o=!0):l=ft(t,"operatorname");var a;if(l.body.length>0){for(var s=l.body.map(f=>{var p="text"in f?f.text:void 0;return typeof p=="string"?{type:"textord",mode:f.mode,text:p}:f}),c=wn(s,e.withFont("mathrm"),!0),u=0;u<c.length;u++){var d=c[u];d instanceof er&&(d.text=d.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}a=ve(["mop"],c,e)}else a=ve(["mop"],[],e);return o?rd(a,n,r,e,e.style,0,0):a},l7=(t,e)=>{for(var n=nr(t.body,e.withFont("mathrm")),r=!0,o=0;o<n.length;o++){var l=n[o];if(!(l instanceof Eu))if(l instanceof we)switch(l.type){case"mi":case"mn":case"mspace":case"mtext":break;case"mo":{var a=l.children[0];l.children.length===1&&a instanceof pn?a.text=a.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):r=!1;break}default:r=!1}else r=!1}if(r){var s=n.map(d=>d.toText()).join("");n=[new pn(s)]}var c=new we("mi",n);c.setAttribute("mathvariant","normal");var u=new we("mo",[ar("","text")]);return t.parentIsSupSub?new we("mrow",[c,u]):xu([c,u])};Ie({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],numArgs:1,handler:(t,e)=>{var n=t.parser,r=t.funcName,o=e[0];return{type:"operatorname",mode:n.mode,body:mn(o),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:ld,mathmlBuilder:l7}),y("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),Co({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?Vr(wn(t.body,e,!1)):ve(["mord"],wn(t.body,e,!0),e)},mathmlBuilder(t,e){return lo(t.body,e,!0)}}),Ie({type:"overline",names:["\\overline"],numArgs:1,handler(t,e){var n=t.parser,r=e[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder(t,e){var n=Bt(t.body,e.havingCrampedStyle()),r=Wo("overline-line",e),o=e.fontMetrics().defaultRuleThickness,l=Nt({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*o},{type:"elem",elem:r},{type:"kern",size:o}]});return ve(["mord","katex-overline"],[l],e)},mathmlBuilder(t,e){var n=new we("mo",[new pn("‾")]);n.setAttribute("stretchy","true");var r=new we("mover",[$t(t.body,e),n]);return r.setAttribute("accent","true"),r}}),Ie({type:"phantom",names:["\\phantom"],numArgs:1,allowedInText:!0,handler:(t,e)=>{var n=t.parser,r=e[0];return{type:"phantom",mode:n.mode,body:mn(r)}},htmlBuilder:(t,e)=>{var n=wn(t.body,e.withPhantom(),!1);return Vr(n)},mathmlBuilder:(t,e)=>{var n=nr(t.body,e);return new we("mphantom",n)}}),y("\\hphantom","\\smash{\\phantom{#1}}"),Ie({type:"vphantom",names:["\\vphantom"],numArgs:1,allowedInText:!0,handler:(t,e)=>{var n=t.parser,r=e[0];return{type:"vphantom",mode:n.mode,body:r}},htmlBuilder:(t,e)=>{var n=ve(["katex-inner"],[Bt(t.body,e.withPhantom())]),r=ve(["katex-fix"],[]);return ve(["mord","rlap"],[n,r],e)},mathmlBuilder:(t,e)=>{var n=nr(mn(t.body),e),r=new we("mphantom",n),o=new we("mpadded",[r]);return o.setAttribute("width","0px"),o}}),Ie({type:"raisebox",names:["\\raisebox"],numArgs:2,argTypes:["size","hbox"],allowedInText:!0,handler(t,e){var n=t.parser,r=ft(e[0],"size").value,o=e[1];return{type:"raisebox",mode:n.mode,dy:r,body:o}},htmlBuilder(t,e){var n=Bt(t.body,e),r=Jt(t.dy,e);return Nt({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]})},mathmlBuilder(t,e){var n=new we("mpadded",[$t(t.body,e)]),r=t.dy.number+t.dy.unit;return n.setAttribute("voffset",r),n}}),Ie({type:"internal",names:["\\relax"],numArgs:0,allowedInText:!0,allowedInArgument:!0,handler(t){var e=t.parser;return{type:"internal",mode:e.mode}}}),Ie({type:"rule",names:["\\rule"],numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"],handler(t,e,n){var r=t.parser,o=n[0],l=ft(e[0],"size"),a=ft(e[1],"size");return{type:"rule",mode:r.mode,shift:o&&ft(o,"size").value,width:l.value,height:a.value}},htmlBuilder(t,e){var n=ve(["mord","katex-rule"],[],e),r=Jt(t.width,e),o=Jt(t.height,e),l=t.shift?Jt(t.shift,e):0;return n.style.borderRightWidth=Ce(r),n.style.borderTopWidth=Ce(o),n.style.bottom=Ce(l),n.width=r,n.height=o+l,n.depth=-l,n.maxFontSize=o*1.125*e.sizeMultiplier,n},mathmlBuilder(t,e){var n=Jt(t.width,e),r=Jt(t.height,e),o=t.shift?Jt(t.shift,e):0,l=e.color&&e.getColor()||"black",a=new we("mspace");a.setAttribute("mathbackground",l),a.setAttribute("width",Ce(n)),a.setAttribute("height",Ce(r));var s=new we("mpadded",[a]);return o>=0?s.setAttribute("height",Ce(o)):(s.setAttribute("height",Ce(o)),s.setAttribute("depth",Ce(-o))),s.setAttribute("voffset",Ce(o)),s}});function ad(t,e,n){for(var r=wn(t,e,!1),o=e.sizeMultiplier/n.sizeMultiplier,l=0;l<r.length;l++){var a=r[l].classes.indexOf("katex-sizing");a<0?Array.prototype.push.apply(r[l].classes,e.sizingClasses(n)):r[l].classes[a+1]==="reset-size"+e.size&&(r[l].classes[a+1]="reset-size"+n.size),r[l].height*=o,r[l].depth*=o}return Vr(r)}var sd=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],a7=(t,e)=>{var n=e.havingSize(t.size);return ad(t.body,n,e)};Ie({type:"sizing",names:sd,numArgs:0,allowedInText:!0,handler:(t,e)=>{var n=t.breakOnTokenText,r=t.funcName,o=t.parser,l=o.parseExpression(!1,n);return{type:"sizing",mode:o.mode,size:sd.indexOf(r)+1,body:l}},htmlBuilder:a7,mathmlBuilder:(t,e)=>{var n=e.havingSize(t.size),r=nr(t.body,n),o=new we("mstyle",r);return o.setAttribute("mathsize",Ce(n.sizeMultiplier)),o}}),Ie({type:"smash",names:["\\smash"],numArgs:1,numOptionalArgs:1,allowedInText:!0,handler:(t,e,n)=>{var r=t.parser,o=!1,l=!1,a=n[0]&&ft(n[0],"ordgroup");if(a)for(var s,c=0;c<a.body.length;++c){var u=a.body[c];if(s=pl(u).text,s==="t")o=!0;else if(s==="b")l=!0;else{o=!1,l=!1;break}}else o=!0,l=!0;var d=e[0];return{type:"smash",mode:r.mode,body:d,smashHeight:o,smashDepth:l}},htmlBuilder:(t,e)=>{var n=ve([],[Bt(t.body,e)]);if(!t.smashHeight&&!t.smashDepth)return n;if(t.smashHeight&&(n.height=0),t.smashDepth&&(n.depth=0),t.smashHeight&&t.smashDepth)return ve(["mord","katex-smash"],[n],e);if(n.children)for(var r=0;r<n.children.length;r++)t.smashHeight&&(n.children[r].height=0),t.smashDepth&&(n.children[r].depth=0);var o=Nt({positionType:"firstBaseline",children:[{type:"elem",elem:n}]});return ve(["mord"],[o],e)},mathmlBuilder:(t,e)=>{var n=new we("mpadded",[$t(t.body,e)]);return t.smashHeight&&n.setAttribute("height","0px"),t.smashDepth&&n.setAttribute("depth","0px"),n}}),Ie({type:"sqrt",names:["\\sqrt"],numArgs:1,numOptionalArgs:1,handler(t,e,n){var r=t.parser,o=n[0],l=e[0];return{type:"sqrt",mode:r.mode,body:l,index:o}},htmlBuilder(t,e){var n=Bt(t.body,e.havingCrampedStyle());n.height===0&&(n.height=e.fontMetrics().xHeight),n=Ko(n,e);var r=e.fontMetrics(),o=r.defaultRuleThickness,l=o;e.style.id<nt.TEXT.id&&(l=e.fontMetrics().xHeight);var a=o+l/4,s=n.height+n.depth+a+o,c=Vp(s,e),u=c.span,d=c.ruleWidth,f=c.advanceWidth,p=u.height-d;p>n.height+n.depth+a&&(a=(a+p-n.height-n.depth)/2);var b=u.height-n.height-a-d;n.style.paddingLeft=Ce(f);var g=Nt({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+b)},{type:"elem",elem:u},{type:"kern",size:d}]});if(t.index){var k=e.havingStyle(nt.SCRIPTSCRIPT),E=Bt(t.index,k,e),M=.6*(g.height-g.depth),O=Nt({positionType:"shift",positionData:-M,children:[{type:"elem",elem:E}]}),P=ve(["katex-root"],[O]);return ve(["mord","sqrt"],[P,g],e)}else return ve(["mord","sqrt"],[g],e)},mathmlBuilder(t,e){var n=t.body,r=t.index;return r?new we("mroot",[$t(n,e),$t(r,e)]):new we("msqrt",[$t(n,e)])}});var hs={display:nt.DISPLAY,text:nt.TEXT,script:nt.SCRIPT,scriptscript:nt.SCRIPTSCRIPT};function s7(t){return t in hs}Ie({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],numArgs:0,allowedInText:!0,primitive:!0,handler(t,e){var n=t.breakOnTokenText,r=t.funcName,o=t.parser,l=o.parseExpression(!0,n),a=r.slice(1,r.length-5);if(!s7(a))throw new Error("Unknown style: "+a);return{type:"styling",mode:o.mode,style:a,body:l}},htmlBuilder(t,e){var n=hs[t.style],r=e.havingStyle(n);return t.resetFont&&(r=r.withFont("")),ad(t.body,r,e)},mathmlBuilder(t,e){var n=hs[t.style],r=e.havingStyle(n);t.resetFont&&(r=r.withFont(""));var o=nr(t.body,r),l=new we("mstyle",o),a={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},s=a[t.style];return l.setAttribute("scriptlevel",s[0]),l.setAttribute("displaystyle",s[1]),l}});var c7=function(e,n){var r=e.base;if(r)if(r.type==="op"){var o=r.limits&&(n.style.size===nt.DISPLAY.size||r.alwaysHandleSupSub);return o?id:null}else if(r.type==="operatorname"){var l=r.alwaysHandleSupSub&&(n.style.size===nt.DISPLAY.size||r.limits);return l?ld:null}else{if(r.type==="accent")return Hr(r.base)?Bu:null;if(r.type==="horizBrace"){var a=!e.sub;return a===r.isOver?td:null}else return null}else return null};Co({type:"supsub",htmlBuilder(t,e){var n=c7(t,e);if(n)return n(t,e);var r=t.base,o=t.sup,l=t.sub,a=Bt(r,e),s,c,u=e.fontMetrics(),d=0,f=0,p=r&&Hr(r);if(o){var b=e.havingStyle(e.style.sup());s=Bt(o,b,e),p||(d=a.height-b.fontMetrics().supDrop*b.sizeMultiplier/e.sizeMultiplier)}if(l){var g=e.havingStyle(e.style.sub());c=Bt(l,g,e),p||(f=a.depth+g.fontMetrics().subDrop*g.sizeMultiplier/e.sizeMultiplier)}var k;e.style===nt.DISPLAY?k=u.sup1:e.style.cramped?k=u.sup3:k=u.sup2;var E=e.sizeMultiplier,M=Ce(.5/u.ptPerEm/E),O=null;if(c){var P=t.base&&t.base.type==="op"&&t.base.name&&(t.base.name==="\\oiint"||t.base.name==="\\oiiint");if(a instanceof er||P){var te;O=Ce(-((te=a.italic)!=null?te:0))}}var z;if(s&&c){d=Math.max(d,k,s.depth+.25*u.xHeight),f=Math.max(f,u.sub2);var H=u.defaultRuleThickness,ie=4*H;if(d-s.depth-(c.height-f)<ie){f=ie-(d-s.depth)+c.height;var Q=.8*u.xHeight-(d-s.depth);Q>0&&(d+=Q,f-=Q)}var ne=[{type:"elem",elem:c,shift:f,marginRight:M,marginLeft:O},{type:"elem",elem:s,shift:-d,marginRight:M}];z=Nt({positionType:"individualShift",children:ne})}else if(c){f=Math.max(f,u.sub1,c.height-.8*u.xHeight);var _=[{type:"elem",elem:c,marginLeft:O,marginRight:M}];z=Nt({positionType:"shift",positionData:f,children:_})}else if(s)d=Math.max(d,k,s.depth+.25*u.xHeight),z=Nt({positionType:"shift",positionData:-d,children:[{type:"elem",elem:s,marginRight:M}]});else throw new Error("supsub must have either sup or sub.");var $=Ya(a,"right")||"mord";return ve([$],[a,ve(["msupsub"],[z])],e)},mathmlBuilder(t,e){var n=!1,r,o;t.base&&t.base.type==="horizBrace"&&(o=!!t.sup,o===t.base.isOver&&(n=!0,r=t.base.isOver)),t.base&&(t.base.type==="op"||t.base.type==="operatorname")&&(t.base.parentIsSupSub=!0);var l=[$t(t.base,e)];t.sub&&l.push($t(t.sub,e)),t.sup&&l.push($t(t.sup,e));var a;if(n)a=r?"mover":"munder";else if(t.sub)if(t.sup){var u=t.base;u&&u.type==="op"&&u.limits&&e.style===nt.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(e.style===nt.DISPLAY||u.limits)?a="munderover":a="msubsup"}else{var c=t.base;c&&c.type==="op"&&c.limits&&(e.style===nt.DISPLAY||c.alwaysHandleSupSub)||c&&c.type==="operatorname"&&c.alwaysHandleSupSub&&(c.limits||e.style===nt.DISPLAY)?a="munder":a="msub"}else{var s=t.base;s&&s.type==="op"&&s.limits&&(e.style===nt.DISPLAY||s.alwaysHandleSupSub)||s&&s.type==="operatorname"&&s.alwaysHandleSupSub&&(s.limits||e.style===nt.DISPLAY)?a="mover":a="msup"}return new we(a,l)}}),Co({type:"atom",htmlBuilder(t,e){return Ua(t.text,t.mode,e,["m"+t.family])},mathmlBuilder(t,e){var n=new we("mo",[ar(t.text,t.mode)]);if(t.family==="bin"){var r=ja(t,e);r==="bold-italic"&&n.setAttribute("mathvariant",r)}else t.family==="punct"?n.setAttribute("separator","true"):(t.family==="open"||t.family==="close")&&n.setAttribute("stretchy","false");return n}});var cd={mi:"italic",mn:"normal",mtext:"normal"};Co({type:"mathord",htmlBuilder(t,e){return ul(t,e)},mathmlBuilder(t,e){var n=new we("mi",[ar(t.text,t.mode,e)]),r=ja(t,e)||"italic";return r!==cd[n.type]&&n.setAttribute("mathvariant",r),n}}),Co({type:"textord",htmlBuilder(t,e){return ul(t,e)},mathmlBuilder(t,e){var n=ar(t.text,t.mode,e),r=ja(t,e)||"normal",o;return t.mode==="text"?o=new we("mtext",[n]):/[0-9]/.test(t.text)?o=new we("mn",[n]):t.text==="\\prime"?o=new we("mo",[n]):o=new we("mi",[n]),r!==cd[o.type]&&o.setAttribute("mathvariant",r),o}});var ud=new Map([["\\nobreak","nobreak"],["\\allowbreak","allowbreak"]]),dd=new Map([[" ",{}],["\\ ",{}],["~",{className:"nobreak"}],["\\space",{}],["\\nobreakspace",{className:"nobreak"}]]);Co({type:"spacing",htmlBuilder(t,e){var n=dd.get(t.text),r=ud.get(t.text);if(n){var o=n.className||"";if(t.mode==="text"){var l=ul(t,e);return l.classes.push(o),l}else return ve(["mspace",o],[Ua(t.text,t.mode,e)],e)}else{if(r)return ve(["mspace",r],[],e);throw new ke('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var n;if(dd.has(t.text))n=new we("mtext",[new pn(" ")]);else{if(ud.has(t.text))return new we("mspace");throw new ke('Unknown type of space "'+t.text+'"')}return n}});var fd=()=>{var t=new we("mtd",[]);return t.setAttribute("width","50%"),t};Co({type:"tag",mathmlBuilder(t,e){var n=new we("mtable",[new we("mtr",[fd(),new we("mtd",[lo(t.body,e)]),fd(),new we("mtd",[lo(t.tag,e)])])]);return n.setAttribute("width","100%"),n}});var hd={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},md={"\\textbf":"textbf","\\textmd":"textmd"},u7={"\\textit":"textit","\\textup":"textup"},pd=(t,e)=>{var n=t.font;if(n){if(hd[n])return e.withTextFontFamily(hd[n]);if(md[n])return e.withTextFontWeight(md[n]);if(n==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(u7[n])};Ie({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0,handler(t,e){var n=t.parser,r=t.funcName,o=e[0];return{type:"text",mode:n.mode,body:mn(o),font:r}},htmlBuilder(t,e){var n=pd(t,e),r=wn(t.body,n,!0);return ve(["mord","text"],r,n)},mathmlBuilder(t,e){var n=pd(t,e);return lo(t.body,n)}}),Ie({type:"underline",names:["\\underline"],numArgs:1,allowedInText:!0,handler(t,e){var n=t.parser;return{type:"underline",mode:n.mode,body:e[0]}},htmlBuilder(t,e){var n=Bt(t.body,e),r=Wo("underline-line",e),o=e.fontMetrics().defaultRuleThickness,l=Nt({positionType:"top",positionData:n.height,children:[{type:"kern",size:o},{type:"elem",elem:r},{type:"kern",size:3*o},{type:"elem",elem:n}]});return ve(["mord","katex-underline"],[l],e)},mathmlBuilder(t,e){var n=new we("mo",[new pn("‾")]);n.setAttribute("stretchy","true");var r=new we("munder",[$t(t.body,e),n]);return r.setAttribute("accentunder","true"),r}}),Ie({type:"vcenter",names:["\\vcenter"],numArgs:1,argTypes:["original"],allowedInText:!1,handler(t,e){var n=t.parser;return{type:"vcenter",mode:n.mode,body:e[0]}},htmlBuilder(t,e){var n=Bt(t.body,e),r=e.fontMetrics().axisHeight,o=.5*(n.height-r-(n.depth+r));return Nt({positionType:"shift",positionData:o,children:[{type:"elem",elem:n}]})},mathmlBuilder(t,e){var n=new we("mpadded",[$t(t.body,e)],["vcenter"]);return new we("mrow",[n])}}),Ie({type:"verb",names:["\\verb"],numArgs:0,allowedInText:!0,handler(t,e,n){throw new ke("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(t,e){for(var n=gd(t),r=[],o=e.havingStyle(e.style.text()),l=0;l<n.length;l++){var a=n[l];a==="~"&&(a="\\textasciitilde"),r.push(Fn(a,"Typewriter-Regular",t.mode,o,["mord","texttt"]))}return ve(["mord","text"].concat(o.sizingClasses(e)),gu(r),o)},mathmlBuilder(t,e){var n=new pn(gd(t)),r=new we("mtext",[n]);return r.setAttribute("mathvariant","monospace"),r}});var gd=t=>t.body.replace(/ /g,t.star?"␣":" "),so=yu,bd=`[ \r
|
|
271
|
-
]`,d7="\\\\[a-zA-Z@]+",f7="\\\\[^\uD800-\uDFFF]",h7="("+d7+")"+bd+"*",m7=`\\\\(
|
|
272
|
-
|[ \r ]+
|
|
273
|
-
?)[ \r ]*`,ms="[̀-ͯ]",p7=new RegExp(ms+"+$"),g7="("+bd+"+)|"+(m7+"|")+"([!-\\[\\]-‧-豈-]"+(ms+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(ms+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+h7)+("|"+f7+")");class vd{constructor(e,n){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=n,this.tokenRegex=new RegExp(g7,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,n){this.catcodes[e]=n}lex(){var e=this.input,n=this.tokenRegex.lastIndex;if(n===e.length)return new rr("EOF",new Xn(this,n,n));var r=this.tokenRegex.exec(e);if(r===null||r.index!==n)throw new ke("Unexpected character: '"+e[n]+"'",new rr(e[n],new Xn(this,n,n+1)));var o=r[6]||r[3]||(r[2]?"\\ ":" ");if(this.catcodes[o]===14){var l=e.indexOf(`
|
|
274
|
-
`,this.tokenRegex.lastIndex);return l===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=l+1,this.lex()}return new rr(o,new Xn(this,n,this.tokenRegex.lastIndex))}}class b7{constructor(e,n){e===void 0&&(e={}),n===void 0&&(n={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=n,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new ke("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var n of Object.keys(e))e[n]===void 0?delete this.current[n]:this.current[n]=e[n]}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return Object.prototype.hasOwnProperty.call(this.current,e)||Object.prototype.hasOwnProperty.call(this.builtins,e)}get(e){return Object.prototype.hasOwnProperty.call(this.current,e)?this.current[e]:Object.prototype.hasOwnProperty.call(this.builtins,e)?this.builtins[e]:void 0}set(e,n,r){if(r===void 0&&(r=!1),r){for(var o=0;o<this.undefStack.length;o++)delete this.undefStack[o][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=n)}else{var l=this.undefStack[this.undefStack.length-1];l&&!Object.prototype.hasOwnProperty.call(l,e)&&(l[e]=Object.prototype.hasOwnProperty.call(this.current,e)?this.current[e]:void 0)}n==null?delete this.current[e]:this.current[e]=n}}var v7=Ku;y("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}}),y("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}}),y("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}}),y("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}}),y("\\@ifnextchar",function(t){var e=t.consumeArgs(3);t.consumeSpaces();var n=t.future();return e[0].length===1&&e[0][0].text===n.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}}),y("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),y("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var kd={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};y("\\char",function(t){var e=t.popToken(),n,r=0;if(e.text==="'")n=8,e=t.popToken();else if(e.text==='"')n=16,e=t.popToken();else if(e.text==="`")if(e=t.popToken(),e.text[0]==="\\")r=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new ke("\\char` missing argument");r=e.text.charCodeAt(0)}else n=10;if(n){if(r=kd[e.text],r==null||r>=n)throw new ke("Invalid base-"+n+" digit "+e.text);for(var o;(o=kd[t.future().text])!=null&&o<n;)r*=n,r+=o,t.popToken()}return"\\@char{"+r+"}"});var ps=(t,e,n,r)=>{var o=t.consumeArg().tokens;if(o.length!==1)throw new ke("\\newcommand's first argument must be a macro name");var l=o[0].text,a=t.isDefined(l);if(a&&!e)throw new ke("\\newcommand{"+l+"} attempting to redefine "+(l+"; use \\renewcommand"));if(!a&&!n)throw new ke("\\renewcommand{"+l+"} when command "+l+" does not yet exist; use \\newcommand");var s=0;if(o=t.consumeArg().tokens,o.length===1&&o[0].text==="["){for(var c="",u=t.expandNextToken();u.text!=="]"&&u.text!=="EOF";)c+=u.text,u=t.expandNextToken();if(!c.match(/^\s*[0-9]+\s*$/))throw new ke("Invalid number of arguments: "+c);s=parseInt(c),o=t.consumeArg().tokens}return a&&r||t.macros.set(l,{tokens:o,numArgs:s}),""};y("\\newcommand",t=>ps(t,!1,!0,!1)),y("\\renewcommand",t=>ps(t,!0,!1,!1)),y("\\providecommand",t=>ps(t,!0,!0,!0)),y("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(n=>n.text).join("")),""}),y("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(n=>n.text).join("")),""}),y("\\show",t=>{var e=t.popToken(),n=e.text;return console.log(e,t.macros.get(n),so[n],Yt.math[n],Yt.text[n]),""}),y("\\bgroup","{"),y("\\egroup","}"),y("~","\\nobreakspace"),y("\\lq","`"),y("\\rq","'"),y("\\aa","\\r a"),y("\\AA","\\r A"),y("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),y("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),y("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),y("ℬ","\\mathscr{B}"),y("ℰ","\\mathscr{E}"),y("ℱ","\\mathscr{F}"),y("ℋ","\\mathscr{H}"),y("ℐ","\\mathscr{I}"),y("ℒ","\\mathscr{L}"),y("ℳ","\\mathscr{M}"),y("ℛ","\\mathscr{R}"),y("ℭ","\\mathfrak{C}"),y("ℌ","\\mathfrak{H}"),y("ℨ","\\mathfrak{Z}"),y("\\Bbbk","\\Bbb{k}"),y("\\llap","\\mathllap{\\textrm{#1}}"),y("\\rlap","\\mathrlap{\\textrm{#1}}"),y("\\clap","\\mathclap{\\textrm{#1}}"),y("\\mathstrut","\\vphantom{(}"),y("\\underbar","\\underline{\\text{#1}}"),y("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}'),y("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),y("\\ne","\\neq"),y("≠","\\neq"),y("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),y("∉","\\notin"),y("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),y("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),y("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),y("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),y("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),y("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),y("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),y("⟂","\\perp"),y("‼","\\mathclose{!\\mkern-0.8mu!}"),y("∌","\\notni"),y("⌜","\\ulcorner"),y("⌝","\\urcorner"),y("⌞","\\llcorner"),y("⌟","\\lrcorner"),y("©","\\copyright"),y("®","\\textregistered"),y("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),y("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),y("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),y("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),y("\\vdots","{\\varvdots\\rule{0pt}{15pt}}"),y("⋮","\\vdots"),y("\\varGamma","\\mathit{\\Gamma}"),y("\\varDelta","\\mathit{\\Delta}"),y("\\varTheta","\\mathit{\\Theta}"),y("\\varLambda","\\mathit{\\Lambda}"),y("\\varXi","\\mathit{\\Xi}"),y("\\varPi","\\mathit{\\Pi}"),y("\\varSigma","\\mathit{\\Sigma}"),y("\\varUpsilon","\\mathit{\\Upsilon}"),y("\\varPhi","\\mathit{\\Phi}"),y("\\varPsi","\\mathit{\\Psi}"),y("\\varOmega","\\mathit{\\Omega}"),y("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),y("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),y("\\boxed","\\fbox{$\\displaystyle{#1}$}"),y("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),y("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),y("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;"),y("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}"),y("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var yd={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},k7=new Set(["bin","rel"]);y("\\dots",function(t){var e="\\dotso",n=t.expandAfterFuture().text;return n in yd?e=yd[n]:(n.slice(0,4)==="\\not"||n in Yt.math&&k7.has(Yt.math[n].group))&&(e="\\dotsb"),e});var gs={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};y("\\dotso",function(t){var e=t.future().text;return e in gs?"\\ldots\\,":"\\ldots"}),y("\\dotsc",function(t){var e=t.future().text;return e in gs&&e!==","?"\\ldots\\,":"\\ldots"}),y("\\cdots",function(t){var e=t.future().text;return e in gs?"\\@cdots\\,":"\\@cdots"}),y("\\dotsb","\\cdots"),y("\\dotsm","\\cdots"),y("\\dotsi","\\!\\cdots"),y("\\dotsx","\\ldots\\,"),y("\\DOTSI","\\relax"),y("\\DOTSB","\\relax"),y("\\DOTSX","\\relax"),y("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),y("\\,","\\tmspace+{3mu}{.1667em}"),y("\\thinspace","\\,"),y("\\>","\\mskip{4mu}"),y("\\:","\\tmspace+{4mu}{.2222em}"),y("\\medspace","\\:"),y("\\;","\\tmspace+{5mu}{.2777em}"),y("\\thickspace","\\;"),y("\\!","\\tmspace-{3mu}{.1667em}"),y("\\negthinspace","\\!"),y("\\negmedspace","\\tmspace-{4mu}{.2222em}"),y("\\negthickspace","\\tmspace-{5mu}{.277em}"),y("\\enspace","\\kern.5em "),y("\\enskip","\\hskip.5em\\relax"),y("\\quad","\\hskip1em\\relax"),y("\\qquad","\\hskip2em\\relax"),y("\\tag","\\@ifstar\\tag@literal\\tag@paren"),y("\\tag@paren","\\tag@literal{({#1})}"),y("\\tag@literal",t=>{if(t.macros.get("\\df@tag"))throw new ke("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"}),y("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),y("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),y("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),y("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),y("\\newline","\\\\\\relax"),y("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var wd=Ce(Er["Main-Regular"][84][1]-.7*Er["Main-Regular"][65][1]);y("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+wd+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}"),y("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+wd+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}"),y("\\hspace","\\@ifstar\\@hspacer\\@hspace"),y("\\@hspace","\\hskip #1\\relax"),y("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),y("\\ordinarycolon",":"),y("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),y("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),y("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),y("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),y("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),y("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),y("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),y("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),y("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),y("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),y("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),y("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),y("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),y("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),y("∷","\\dblcolon"),y("∹","\\eqcolon"),y("≔","\\coloneqq"),y("≕","\\eqqcolon"),y("⩴","\\Coloneqq"),y("\\ratio","\\vcentcolon"),y("\\coloncolon","\\dblcolon"),y("\\colonequals","\\coloneqq"),y("\\coloncolonequals","\\Coloneqq"),y("\\equalscolon","\\eqqcolon"),y("\\equalscoloncolon","\\Eqqcolon"),y("\\colonminus","\\coloneq"),y("\\coloncolonminus","\\Coloneq"),y("\\minuscolon","\\eqcolon"),y("\\minuscoloncolon","\\Eqcolon"),y("\\coloncolonapprox","\\Colonapprox"),y("\\coloncolonsim","\\Colonsim"),y("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),y("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),y("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),y("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),y("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),y("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),y("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),y("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),y("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),y("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),y("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),y("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),y("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),y("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),y("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),y("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),y("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),y("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),y("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),y("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),y("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),y("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),y("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),y("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),y("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),y("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),y("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),y("\\imath","\\html@mathml{\\@imath}{ı}"),y("\\jmath","\\html@mathml{\\@jmath}{ȷ}"),y("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),y("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),y("⟦","\\llbracket"),y("⟧","\\rrbracket"),y("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),y("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),y("⦃","\\lBrace"),y("⦄","\\rBrace"),y("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),y("⦵","\\minuso"),y("\\darr","\\downarrow"),y("\\dArr","\\Downarrow"),y("\\Darr","\\Downarrow"),y("\\lang","\\langle"),y("\\rang","\\rangle"),y("\\uarr","\\uparrow"),y("\\uArr","\\Uparrow"),y("\\Uarr","\\Uparrow"),y("\\N","\\mathbb{N}"),y("\\R","\\mathbb{R}"),y("\\Z","\\mathbb{Z}"),y("\\alef","\\aleph"),y("\\alefsym","\\aleph"),y("\\Alpha","\\mathrm{A}"),y("\\Beta","\\mathrm{B}"),y("\\bull","\\bullet"),y("\\Chi","\\mathrm{X}"),y("\\clubs","\\clubsuit"),y("\\cnums","\\mathbb{C}"),y("\\Complex","\\mathbb{C}"),y("\\Dagger","\\ddagger"),y("\\diamonds","\\diamondsuit"),y("\\empty","\\emptyset"),y("\\Epsilon","\\mathrm{E}"),y("\\Eta","\\mathrm{H}"),y("\\exist","\\exists"),y("\\harr","\\leftrightarrow"),y("\\hArr","\\Leftrightarrow"),y("\\Harr","\\Leftrightarrow"),y("\\hearts","\\heartsuit"),y("\\image","\\Im"),y("\\infin","\\infty"),y("\\Iota","\\mathrm{I}"),y("\\isin","\\in"),y("\\Kappa","\\mathrm{K}"),y("\\larr","\\leftarrow"),y("\\lArr","\\Leftarrow"),y("\\Larr","\\Leftarrow"),y("\\lrarr","\\leftrightarrow"),y("\\lrArr","\\Leftrightarrow"),y("\\Lrarr","\\Leftrightarrow"),y("\\Mu","\\mathrm{M}"),y("\\natnums","\\mathbb{N}"),y("\\Nu","\\mathrm{N}"),y("\\Omicron","\\mathrm{O}"),y("\\plusmn","\\pm"),y("\\rarr","\\rightarrow"),y("\\rArr","\\Rightarrow"),y("\\Rarr","\\Rightarrow"),y("\\real","\\Re"),y("\\reals","\\mathbb{R}"),y("\\Reals","\\mathbb{R}"),y("\\Rho","\\mathrm{P}"),y("\\sdot","\\cdot"),y("\\sect","\\S"),y("\\spades","\\spadesuit"),y("\\sub","\\subset"),y("\\sube","\\subseteq"),y("\\supe","\\supseteq"),y("\\Tau","\\mathrm{T}"),y("\\thetasym","\\vartheta"),y("\\weierp","\\wp"),y("\\Zeta","\\mathrm{Z}"),y("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),y("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),y("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),y("\\bra","\\mathinner{\\langle{#1}|}"),y("\\ket","\\mathinner{|{#1}\\rangle}"),y("\\braket","\\mathinner{\\langle{#1}\\rangle}"),y("\\Bra","\\left\\langle#1\\right|"),y("\\Ket","\\left|#1\\right\\rangle");var xd=t=>e=>{var n=e.consumeArg().tokens,r=e.consumeArg().tokens,o=e.consumeArg().tokens,l=e.consumeArg().tokens,a=e.macros.get("|"),s=e.macros.get("\\|");e.macros.beginGroup();var c=f=>p=>{t&&(p.macros.set("|",a),o.length&&p.macros.set("\\|",s));var b=f;if(!f&&o.length){var g=p.future();g.text==="|"&&(p.popToken(),b=!0)}return{tokens:b?o:r,numArgs:0}};e.macros.set("|",c(!1)),o.length&&e.macros.set("\\|",c(!0));var u=e.consumeArg().tokens,d=e.expandTokens([...l,...u,...n]);return e.macros.endGroup(),{tokens:d.reverse(),numArgs:0}};y("\\bra@ket",xd(!1)),y("\\bra@set",xd(!0)),y("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),y("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),y("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),y("\\angln","{\\angl n}"),y("\\blue","\\textcolor{##6495ed}{#1}"),y("\\orange","\\textcolor{##ffa500}{#1}"),y("\\pink","\\textcolor{##ff00af}{#1}"),y("\\red","\\textcolor{##df0030}{#1}"),y("\\green","\\textcolor{##28ae7b}{#1}"),y("\\gray","\\textcolor{gray}{#1}"),y("\\purple","\\textcolor{##9d38bd}{#1}"),y("\\blueA","\\textcolor{##ccfaff}{#1}"),y("\\blueB","\\textcolor{##80f6ff}{#1}"),y("\\blueC","\\textcolor{##63d9ea}{#1}"),y("\\blueD","\\textcolor{##11accd}{#1}"),y("\\blueE","\\textcolor{##0c7f99}{#1}"),y("\\tealA","\\textcolor{##94fff5}{#1}"),y("\\tealB","\\textcolor{##26edd5}{#1}"),y("\\tealC","\\textcolor{##01d1c1}{#1}"),y("\\tealD","\\textcolor{##01a995}{#1}"),y("\\tealE","\\textcolor{##208170}{#1}"),y("\\greenA","\\textcolor{##b6ffb0}{#1}"),y("\\greenB","\\textcolor{##8af281}{#1}"),y("\\greenC","\\textcolor{##74cf70}{#1}"),y("\\greenD","\\textcolor{##1fab54}{#1}"),y("\\greenE","\\textcolor{##0d923f}{#1}"),y("\\goldA","\\textcolor{##ffd0a9}{#1}"),y("\\goldB","\\textcolor{##ffbb71}{#1}"),y("\\goldC","\\textcolor{##ff9c39}{#1}"),y("\\goldD","\\textcolor{##e07d10}{#1}"),y("\\goldE","\\textcolor{##a75a05}{#1}"),y("\\redA","\\textcolor{##fca9a9}{#1}"),y("\\redB","\\textcolor{##ff8482}{#1}"),y("\\redC","\\textcolor{##f9685d}{#1}"),y("\\redD","\\textcolor{##e84d39}{#1}"),y("\\redE","\\textcolor{##bc2612}{#1}"),y("\\maroonA","\\textcolor{##ffbde0}{#1}"),y("\\maroonB","\\textcolor{##ff92c6}{#1}"),y("\\maroonC","\\textcolor{##ed5fa6}{#1}"),y("\\maroonD","\\textcolor{##ca337c}{#1}"),y("\\maroonE","\\textcolor{##9e034e}{#1}"),y("\\purpleA","\\textcolor{##ddd7ff}{#1}"),y("\\purpleB","\\textcolor{##c6b9fc}{#1}"),y("\\purpleC","\\textcolor{##aa87ff}{#1}"),y("\\purpleD","\\textcolor{##7854ab}{#1}"),y("\\purpleE","\\textcolor{##543b78}{#1}"),y("\\mintA","\\textcolor{##f5f9e8}{#1}"),y("\\mintB","\\textcolor{##edf2df}{#1}"),y("\\mintC","\\textcolor{##e0e5cc}{#1}"),y("\\grayA","\\textcolor{##f6f7f7}{#1}"),y("\\grayB","\\textcolor{##f0f1f2}{#1}"),y("\\grayC","\\textcolor{##e3e5e6}{#1}"),y("\\grayD","\\textcolor{##d6d8da}{#1}"),y("\\grayE","\\textcolor{##babec2}{#1}"),y("\\grayF","\\textcolor{##888d93}{#1}"),y("\\grayG","\\textcolor{##626569}{#1}"),y("\\grayH","\\textcolor{##3b3e40}{#1}"),y("\\grayI","\\textcolor{##21242c}{#1}"),y("\\kaBlue","\\textcolor{##314453}{#1}"),y("\\kaGreen","\\textcolor{##71B307}{#1}");var Ed={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class y7{constructor(e,n,r){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=n,this.expansionCount=0,this.feed(e),this.macros=new b7(v7,n.macros),this.mode=r,this.stack=[]}feed(e){this.lexer=new vd(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var n,r,o;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;n=this.popToken();var l=this.consumeArg(["]"]);o=l.tokens,r=l.end}else{var a=this.consumeArg();o=a.tokens,n=a.start,r=a.end}return this.pushToken(new rr("EOF",r.loc)),this.pushTokens(o),new rr("",Xn.range(n,r))}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var n=[],r=e&&e.length>0;r||this.consumeSpaces();var o=this.future(),l,a=0,s=0;do{if(l=this.popToken(),n.push(l),l.text==="{")++a;else if(l.text==="}"){if(--a,a===-1)throw new ke("Extra }",l)}else if(l.text==="EOF")throw new ke("Unexpected end of input in a macro argument, expected '"+(e&&r?e[s]:"}")+"'",l);if(e&&r)if((a===0||a===1&&e[s]==="{")&&l.text===e[s]){if(++s,s===e.length){n.splice(-s,s);break}}else s=0}while(a!==0||r);return o.text==="{"&&n[n.length-1].text==="}"&&(n.pop(),n.shift()),n.reverse(),{tokens:n,start:o,end:l}}consumeArgs(e,n){if(n){if(n.length!==e+1)throw new ke("The length of delimiters doesn't match the number of args!");for(var r=n[0],o=0;o<r.length;o++){var l=this.popToken();if(r[o]!==l.text)throw new ke("Use of the macro doesn't match its definition",l)}}for(var a=[],s=0;s<e;s++)a.push(this.consumeArg(n&&n[s+1]).tokens);return a}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new ke("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var n=this.popToken(),r=n.text,o=n.noexpand?null:this._getExpansion(r);if(o==null||e&&o.unexpandable){if(e&&o==null&&r[0]==="\\"&&!this.isDefined(r))throw new ke("Undefined control sequence: "+r);return this.pushToken(n),!1}this.countExpansion(1);var l=o.tokens,a=this.consumeArgs(o.numArgs,o.delimiters);if(o.numArgs){l=l.slice();for(var s=l.length-1;s>=0;--s){var c=l[s];if(c.text==="#"){if(s===0)throw new ke("Incomplete placeholder at end of macro body",c);if(c=l[--s],c.text==="#")l.splice(s+1,1);else if(/^[1-9]$/.test(c.text))l.splice(s,2,...a[+c.text-1]);else throw new ke("Not a valid argument number",c)}}}return this.pushTokens(l),l.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}}expandMacro(e){return this.macros.has(e)?this.expandTokens([new rr(e)]):void 0}expandTokens(e){var n=[],r=this.stack.length;for(this.pushTokens(e);this.stack.length>r;)if(this.expandOnce(!0)===!1){var o=this.stack.pop();o.treatAsRelax&&(o.noexpand=!1,o.treatAsRelax=!1),n.push(o)}return this.countExpansion(n.length),n}expandMacroAsText(e){var n=this.expandMacro(e);return n&&n.map(r=>r.text).join("")}_getExpansion(e){var n=this.macros.get(e);if(n==null)return n;if(e.length===1){var r=this.lexer.catcodes[e];if(r!=null&&r!==13)return}var o=typeof n=="function"?n(this):n;if(typeof o=="string"){var l=0;if(o.includes("#"))for(var a=o.replace(/##/g,"");a.includes("#"+(l+1));)++l;for(var s=new vd(o,this.settings),c=[],u=s.lex();u.text!=="EOF";)c.push(u),u=s.lex();c.reverse();var d={tokens:c,numArgs:l};return d}return o}isDefined(e){return this.macros.has(e)||Object.prototype.hasOwnProperty.call(so,e)||Object.prototype.hasOwnProperty.call(Yt.math,e)||Object.prototype.hasOwnProperty.call(Yt.text,e)||Object.prototype.hasOwnProperty.call(Ed,e)}isExpandable(e){var n=this.macros.get(e);return n!=null?typeof n=="string"||typeof n=="function"||!n.unexpandable:Object.prototype.hasOwnProperty.call(so,e)&&!so[e].primitive}}var Cd=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,xl=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),bs={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},Sd={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class El{constructor(e,n){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new y7(e,n,this.mode),this.settings=n,this.leftrightDepth=0,this.nextToken=null}expect(e,n){if(n===void 0&&(n=!0),this.fetch().text!==e)throw new ke("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());n&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var n=this.nextToken;this.consume(),this.gullet.pushToken(new rr("}")),this.gullet.pushTokens(e);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=n,r}parseExpression(e,n){for(var r=[];;){this.mode==="math"&&this.consumeSpaces();var o=this.fetch();if(El.endOfExpression.has(o.text)||n&&o.text===n||e&&so[o.text]&&so[o.text].infix)break;var l=this.parseAtom(n);if(l){if(l.type==="internal")continue}else break;r.push(l)}return this.mode==="text"&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(e){for(var n=-1,r,o=0;o<e.length;o++){var l=e[o];if(l.type==="infix"){if(n!==-1)throw new ke("only one infix operator per group",l.token);n=o,r=l.replaceWith}}if(n!==-1&&r){var a,s,c=e.slice(0,n),u=e.slice(n+1);c.length===1&&c[0].type==="ordgroup"?a=c[0]:a={type:"ordgroup",mode:this.mode,body:c},u.length===1&&u[0].type==="ordgroup"?s=u[0]:s={type:"ordgroup",mode:this.mode,body:u};var d;return r==="\\\\abovefrac"?d=this.callFunction(r,[a,e[n],s],[]):d=this.callFunction(r,[a,s],[]),[d]}else return e}handleSupSubscript(e){var n=this.fetch(),r=n.text;this.consume(),this.consumeSpaces();var o;do{var l;o=this.parseGroup(e)}while(((l=o)==null?void 0:l.type)==="internal");if(!o)throw new ke("Expected group after '"+r+"'",n);return o}formatUnsupportedCmd(e){for(var n=[],r=0;r<e.length;r++)n.push({type:"textord",mode:"text",text:e[r]});var o={type:"text",mode:this.mode,body:n},l={type:"color",mode:this.mode,color:this.settings.errorColor,body:[o]};return l}parseAtom(e){var n=this.parseGroup("atom",e);if((n==null?void 0:n.type)==="internal"||this.mode==="text")return n;for(var r,o;;){this.consumeSpaces();var l=this.fetch();if(l.text==="\\limits"||l.text==="\\nolimits"){if(n&&n.type==="op")n.limits=l.text==="\\limits",n.alwaysHandleSupSub=!0;else if(n&&n.type==="operatorname")n.alwaysHandleSupSub&&(n.limits=l.text==="\\limits");else throw new ke("Limit controls must follow a math operator",l);this.consume()}else if(l.text==="^"){if(r)throw new ke("Double superscript",l);r=this.handleSupSubscript("superscript")}else if(l.text==="_"){if(o)throw new ke("Double subscript",l);o=this.handleSupSubscript("subscript")}else if(l.text==="'"){if(r)throw new ke("Double superscript",l);var a={type:"textord",mode:this.mode,text:"\\prime"},s=[a];for(this.consume();this.fetch().text==="'";)s.push(a),this.consume();this.fetch().text==="^"&&s.push(this.handleSupSubscript("superscript")),r={type:"ordgroup",mode:this.mode,body:s}}else if(xl[l.text]){var c=Cd.test(l.text),u=[];for(u.push(new rr(xl[l.text])),this.consume();;){var d=this.fetch().text;if(!xl[d]||Cd.test(d)!==c)break;u.unshift(new rr(xl[d])),this.consume()}var f=this.subparse(u);c?o={type:"ordgroup",mode:"math",body:f}:r={type:"ordgroup",mode:"math",body:f}}else break}return r&&o?{type:"supsub",mode:this.mode,base:n,sup:r,sub:o}:r?{type:"supsub",mode:this.mode,base:n,sup:r}:o?{type:"supsub",mode:this.mode,base:n,sub:o}:n}parseFunction(e,n){var r=this.fetch(),o=r.text,l=so[o];if(!l)return null;if(this.consume(),n&&n!=="atom"&&!l.allowedInArgument)throw new ke("Got function '"+o+"' with no arguments"+(n?" as "+n:""),r);if(this.mode==="text"&&!l.allowedInText)throw new ke("Can't use function '"+o+"' in text mode",r);if(this.mode==="math"&&l.allowedInMath===!1)throw new ke("Can't use function '"+o+"' in math mode",r);var a=this.parseArguments(o,l),s=a.args,c=a.optArgs;return this.callFunction(o,s,c,r,e)}callFunction(e,n,r,o,l){var a={funcName:e,parser:this,token:o,breakOnTokenText:l},s=so[e];if(s&&s.handler)return s.handler(a,n,r);throw new ke("No function handler for "+e)}parseArguments(e,n){var r,o=(r=n.numOptionalArgs)!=null?r:0,l=n.numArgs+o;if(l===0)return{args:[],optArgs:[]};for(var a=[],s=[],c=0;c<l;c++){var u,d=(u=n.argTypes)==null?void 0:u[c],f=c<o;("primitive"in n&&n.primitive&&d==null||n.type==="sqrt"&&c===1&&s[0]==null)&&(d="primitive");var p=this.parseGroupOfType("argument to '"+e+"'",d,f);if(f)s.push(p);else if(p!=null)a.push(p);else throw new ke("Null argument, please report this as a bug")}return{args:a,optArgs:s}}parseGroupOfType(e,n,r){switch(n){case"color":return this.parseColorGroup(r);case"size":return this.parseSizeGroup(r);case"url":return this.parseUrlGroup(r);case"math":case"text":return this.parseArgumentGroup(r,n);case"hbox":{var o=this.parseArgumentGroup(r,"text");return o!=null?{type:"styling",mode:o.mode,body:[o],style:"text",resetFont:!0}:null}case"raw":{var l=this.parseStringGroup(r);return l!=null?{type:"raw",mode:"text",string:l.text}:null}case"primitive":{if(r)throw new ke("A primitive argument cannot be optional");var a=this.parseGroup(e);if(a==null)throw new ke("Expected group as "+e,this.fetch());return a}case"original":case void 0:return this.parseArgumentGroup(r);default:throw new ke("Unknown group type as "+e,this.fetch())}}consumeSpaces(){for(;this.fetch().text===" ";)this.consume()}parseStringGroup(e){var n=this.gullet.scanArgument(e);if(n==null)return null;for(var r="",o;(o=this.fetch()).text!=="EOF";)r+=o.text,this.consume();return this.consume(),n.text=r,n}parseRegexGroup(e,n){for(var r=this.fetch(),o=r,l="",a;(a=this.fetch()).text!=="EOF"&&e.test(l+a.text);)o=a,l+=o.text,this.consume();if(l==="")throw new ke("Invalid "+n+": '"+r.text+"'",r);return r.range(o,l)}parseColorGroup(e){var n=this.parseStringGroup(e);if(n==null)return null;var r=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(n.text);if(!r)throw new ke("Invalid color: '"+n.text+"'",n);var o=r[0];return/^[0-9a-f]{6}$/i.test(o)&&(o="#"+o),{type:"color-token",mode:this.mode,color:o}}parseSizeGroup(e){var n,r=!1;if(this.gullet.consumeSpaces(),!e&&this.gullet.future().text!=="{"?n=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):n=this.parseStringGroup(e),!n)return null;!e&&n.text.length===0&&(n.text="0pt",r=!0);var o=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(n.text);if(!o)throw new ke("Invalid size: '"+n.text+"'",n);var l={number:+(o[1]+o[2]),unit:o[3]};if(!Jc(l))throw new ke("Invalid unit: '"+l.unit+"'",n);return{type:"size",mode:this.mode,value:l,isBlank:r}}parseUrlGroup(e){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var n=this.parseStringGroup(e);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),n==null)return null;var r=n.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:r}}parseArgumentGroup(e,n){var r=this.gullet.scanArgument(e);if(r==null)return null;var o=this.mode;n&&this.switchMode(n),this.gullet.beginGroup();var l=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var a={type:"ordgroup",mode:this.mode,loc:r.loc,body:l};return n&&this.switchMode(o),a}parseGroup(e,n){var r=this.fetch(),o=r.text,l;if(o==="{"||o==="\\begingroup"){this.consume();var a=o==="{"?"}":"\\endgroup";this.gullet.beginGroup();var s=this.parseExpression(!1,a),c=this.fetch();this.expect(a),this.gullet.endGroup(),l={type:"ordgroup",mode:this.mode,loc:Xn.range(r,c),body:s,semisimple:o==="\\begingroup"||void 0}}else if(l=this.parseFunction(n,e)||this.parseSymbol(),l==null&&o[0]==="\\"&&!Object.prototype.hasOwnProperty.call(Ed,o)){if(this.settings.throwOnError)throw new ke("Undefined control sequence: "+o,r);l=this.formatUnsupportedCmd(o),this.consume()}return l}formLigatures(e){for(var n=e.length-1,r=0;r<n;++r){var o=e[r];if(o.type==="textord"){var l=o.text,a=e[r+1];if(!(!a||a.type!=="textord")){if(l==="-"&&a.text==="-"){var s=e[r+2];r+1<n&&s&&s.type==="textord"&&s.text==="-"?(e.splice(r,3,{type:"textord",mode:"text",loc:Xn.range(o,s),text:"---"}),n-=2):(e.splice(r,2,{type:"textord",mode:"text",loc:Xn.range(o,a),text:"--"}),n-=1)}(l==="'"||l==="`")&&a.text===l&&(e.splice(r,2,{type:"textord",mode:"text",loc:Xn.range(o,a),text:l+l}),n-=1)}}}}parseSymbol(){var e=this.fetch(),n=e.text;if(/^\\verb[^a-zA-Z]/.test(n)){this.consume();var r=n.slice(5),o=r.charAt(0)==="*";if(o&&(r=r.slice(1)),r.length<2||r.charAt(0)!==r.slice(-1))throw new ke(`\\verb assertion failed --
|
|
275
|
-
please report what input caused this bug`);return r=r.slice(1,-1),{type:"verb",mode:"text",body:r,star:o}}Object.prototype.hasOwnProperty.call(Sd,n[0])&&!Yt[this.mode][n[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+n[0]+'" used in math mode',e),n=Sd[n[0]]+n.slice(1));var l=p7.exec(n);l&&(n=n.substring(0,l.index),n==="i"?n="ı":n==="j"&&(n="ȷ"));var a;if(Yt[this.mode][n]){this.settings.strict&&this.mode==="math"&&za.includes(n)&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+n[0]+'" used in math mode',e);var s=Yt[this.mode][n].group,c=Xn.range(e),u;Tp(s)?u={type:"atom",mode:this.mode,family:s,loc:c,text:n}:u={type:s,mode:this.mode,loc:c,text:n},a=u}else if(n.charCodeAt(0)>=128)this.settings.strict&&(jc(n.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+n[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+n[0]+'"'+(" ("+n.charCodeAt(0)+")"),e)),a={type:"textord",mode:"text",loc:Xn.range(e),text:n};else return null;if(this.consume(),l)for(var d=0;d<l[0].length;d++){var f=l[0][d];if(!bs[f])throw new ke("Unknown accent ' "+f+"'",e);var p=bs[f][this.mode]||bs[f].text;if(!p)throw new ke("Accent "+f+" unsupported in "+this.mode+" mode",e);a={type:"accent",mode:this.mode,loc:Xn.range(e),label:p,isStretchy:!1,isShifty:!0,base:a}}return a}}El.endOfExpression=new Set(["}","\\endgroup","\\end","\\right","&"]);var vs=function(e,n){if(!(typeof e=="string"||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var r=new El(e,n);delete r.gullet.macros.current["\\df@tag"];var o=r.parse();if(delete r.gullet.macros.current["\\current@color"],delete r.gullet.macros.current["\\color"],r.gullet.macros.get("\\df@tag")){if(!n.displayMode)throw new ke("\\tag works only in display equations");o=[{type:"tag",mode:"text",body:o,tag:r.subparse([new rr("\\df@tag")])}]}return o},Td=function(e,n,r){n.textContent="";var o=ks(e,r).toNode();n.appendChild(o)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),Td=function(){throw new ke("KaTeX doesn't work in quirks mode.")});var w7=function(e,n){var r=ks(e,n).toMarkup();return r},x7=function(e,n){var r=new Sa(n);return vs(e,r)},Md=function(e,n,r){if(r.throwOnError||!(e instanceof ke))throw e;var o=ve(["katex-error"],[new er(n)]);return o.setAttribute("title",e.toString()),o.setAttribute("style","color:"+r.errorColor),o},ks=function(e,n){var r=new Sa(n);try{var o=vs(e,r);return gp(o,e,r)}catch(l){return Md(l,e,r)}},E7=function(e,n){var r=new Sa(n);try{var o=vs(e,r);return bp(o,e,r)}catch(l){return Md(l,e,r)}},C7="0.18.4",S7={Span:qo,Anchor:il,SymbolNode:er,SvgNode:$r,PathNode:ro,LineNode:Ba},T7={version:C7,render:Td,renderToString:w7,ParseError:ke,SETTINGS_SCHEMA:Ca,__parse:x7,__renderToDomTree:ks,__renderToHTMLTree:E7,__setFontMetrics:j4,__defineSymbol:h,__defineFunction:Ie,__defineMacro:y,__domTree:S7};function Si(t){const e=t??"";try{const n=T7.renderToString(e,{displayMode:!0,throwOnError:!1,trust:!1,strict:!1,output:"htmlAndMathml"}),r=/class="katex-error"/.test(n);return{html:n,error:r}}catch{return{html:"",error:!0}}}const M7={expression:{default:"",validate:t=>typeof t=="string"},indent:Rn.indent},A7=i.defineComponent({name:"EquationBlock",props:{block:{type:Object,required:!0},placeholder:{type:String,default:void 0}},setup(t){const e=Yn(),n=Rr(),r=In(),o=t.block.id,l=i.ref(!1),a=i.ref(""),s=i.ref(""),c=i.ref(""),u=i.ref(!1),d=i.ref(null);function f(){const _=t.block.attrs.expression;return typeof _=="string"?_:""}const p=i.computed(()=>Si(f())),b=i.computed(()=>f().trim().length===0);let g=0;function k(){if(typeof requestAnimationFrame>"u"){const _=Si(a.value);c.value=_.html,u.value=_.error;return}g&&cancelAnimationFrame(g),g=requestAnimationFrame(()=>{const _=Si(a.value);c.value=_.html,u.value=_.error})}function E(){const _=Si(a.value);c.value=_.html,u.value=_.error}function M(){const _=d.value;_&&(_.style.height="auto",_.style.height=`${_.scrollHeight}px`)}function O(_){if(!l.value)return;const $=_.target;$&&$.closest("[data-equation-edit]")||H()}function P(){typeof document<"u"&&document.addEventListener("mousedown",O,!0)}function te(){typeof document<"u"&&document.removeEventListener("mousedown",O,!0)}function z(){n.value&&(l.value||(s.value=f(),a.value=f(),l.value=!0,i.nextTick(()=>{const _=d.value;if(_){_.focus();const $=_.value.length;_.setSelectionRange($,$),M()}E()}),P()))}function H(){var D,W,K,B;if(!l.value)return;te(),l.value=!1;const _=a.value;if(_.trim().length===0){(W=(D=e.commands).removeBlock)==null||W.call(D,{id:o});return}(B=(K=e.commands).setAttrs)==null||B.call(K,{id:o,attrs:{expression:_}})}function ie(){var _,$;l.value&&(te(),l.value=!1,s.value.trim().length===0&&(($=(_=e.commands).removeBlock)==null||$.call(_,{id:o})))}function Q(_){if(_.stopPropagation(),_.key==="Escape"){_.preventDefault(),ie();return}if(_.key==="Enter"&&!_.shiftKey){_.preventDefault(),H();return}if(_.key==="Enter"&&(_.ctrlKey||_.metaKey)){_.preventDefault(),H();return}}function ne(_){var $,D;_.stopPropagation(),n.value&&((D=($=e.commands).selectBlock)==null||D.call($,{id:o}),z())}return i.watch(b,_=>{_&&n.value&&!l.value&&z()}),n.value&&b.value&&z(),i.onBeforeUnmount(()=>{te(),g&&typeof cancelAnimationFrame<"u"&&cancelAnimationFrame(g)}),()=>{t.block.attrs;const _=t.placeholder??r.t("equation.placeholder");if(l.value||n.value&&b.value)return i.h("div",{class:["equation-block","equation-editing","block-focus-root",...Jn(t.block.attrs)],"data-equation-block":"","data-equation-edit":""},[i.h("div",{class:"equation-edit","data-equation-edit":""},[i.h("textarea",{ref:d,class:"equation-edit-input","data-equation-edit":"",value:a.value,placeholder:_,spellcheck:!1,autocapitalize:"off",autocomplete:"off",onInput:K=>{a.value=K.currentTarget.value,k(),M()},onKeydown:Q})]),i.h("div",{class:"equation-edit-preview"},[u.value?i.h("div",{class:"equation-error-badge"},r.t("equation.invalid")):null,i.h(_n,{html:c.value,class:"equation-preview-html"})])]);const $=p.value.html,D=p.value.error,W=[];return b.value?W.push(i.h("span",{class:"equation-placeholder"},[_])):D?W.push(i.h("span",{class:"equation-error-inline"},[r.t("equation.invalid")])):W.push(i.h(_n,{html:$,class:"equation-render"})),n.value&&!b.value&&W.push(i.h("div",{class:["equation-toolbar"]},[i.h("button",{type:"button",class:"equation-edit-btn",title:r.t("equation.edit"),onClick:ne},[i.h(_n,{html:Rf})])])),i.h("div",{class:["equation-block","block-focus-root",...Jn(t.block.attrs)],"data-equation-block":""},W)}}}),Ad={name:"equation",schema:{type:"equation",content:"none",nestable:!1,isolating:!0,attrs:{...M7},empty:t=>{const e=t.attrs.expression;return typeof e!="string"||e.trim().length===0}},renderer:{component:A7,editable:!1},slashCommands:[{id:"equation",title:"slash.equation.title",keywords:["math","equation","formula","latex","tex","公式","数学","tex"],description:"slash.equation.description",icon:_f,command:"convertBlock",category:"other",args:()=>({id:"__currentBlock__",type:"equation",attrs:{expression:""}})}],serialize:{toHTML:t=>{const e=t.attrs.expression,n=typeof e=="string"?e:"";if(!n.trim())return"";const{html:r,error:o}=Si(n);return o?`<p class="katex-error-block">${N7(n)}</p>`:`<div class="equation-block-rendered">${r}</div>`},toMarkdown:t=>{const e=t.attrs.expression,n=typeof e=="string"?e:"";return n.trim()?`$$$
|
|
276
|
-
${(n.length?n.split(`
|
|
7
|
+
`),o=[];let r=[],l=0;const s=()=>{r.length>0&&o.push({kind:"lines",lines:r}),r=[]};for(;l<t.length;){const i=t[l]??"",a=/^(\s*)(```+|~~~+)\s*(\S*)\s*$/.exec(i);if(a){s();const d=a[2][0],f=a[3]??"",u=[];for(l+=1;l<t.length;){const m=t[l];if(new RegExp(`^\\s*${d}{3,}\\s*$`).test(m))break;u.push(m),l+=1}o.push({kind:"fence",lang:f,body:u}),l+=1;continue}if(/^\s*\${2,3}\s*$/.exec(i)){s();const d=[];for(l+=1;l<t.length;){const f=t[l];if(/^\s*\${2,3}\s*$/.test(f))break;d.push(f),l+=1}o.push({kind:"math",body:d}),l+=1;continue}if(i.includes("|")&&l+1<t.length&&/^\s*\|?\s*:?-{2,}:?\s*(\|\s*:?-{2,}:?\s*)+\|?\s*$/.test(t[l+1]??"")){s();const d=[i,t[l+1]];for(l+=2;l<t.length&&(t[l]??"").includes("|");)d.push(t[l]),l+=1;o.push({kind:"table",lines:d});continue}r.push(i),l+=1}return s(),o}function pd(e){const t=a=>a.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(d=>d.trim()),o=t(e[0]??""),r=e.slice(2).map(a=>t(a)),l=Math.max(o.length,...r.map(a=>a.length)),s=r.length+1,i=[];for(let a=0;a<s;a++){const c=[],d=a===0?o:r[a-1]??[];for(let f=0;f<l;f++)c.push({content:oo(md(d[f]??"")),covered:!1});i.push(c)}return{type:"table",attrs:{cells:i,rows:s,cols:l,headerRow:!0,colWidths:[]}}}function md(e){return e.replace(/<br>/gi,`
|
|
8
|
+
`).replace(/\\\|/g,"|").replace(/\\\\/g,"\\")}function hd(e){const t=[],o=fd(e);for(const u of o){if(u.kind==="fence"){t.push({indent:0,block:{type:"codeBlock",attrs:u.lang?{language:u.lang}:void 0,content:[{type:"text",text:u.body.join(`
|
|
9
|
+
`)}]}});continue}if(u.kind==="table"){t.push({indent:0,block:pd(u.lines)});continue}if(u.kind==="math"){t.push({indent:0,block:{type:"equation",attrs:{expression:u.body.join(`
|
|
10
|
+
`)},content:[]}});continue}const m=[];let h=!1;for(const p of u.lines){if(p.trim().length===0){h=!0;continue}const b=p.length-p.trimStart().length,x=ud(p.trim());if(!x){h=!1;continue}m.push({indent:b,block:x,blankBefore:h}),h=!1}for(const p of m){const b=t[t.length-1];if(b&&!p.blankBefore&&b.indent===p.indent&&b.block.type===p.block.type&&(p.block.type==="quote"||p.block.type==="paragraph")){const x=b.block.content??[],O=p.block.content??[];t[t.length-1]={indent:b.indent,block:{type:b.block.type,...b.block.attrs?{attrs:b.block.attrs}:{},content:[...x,{type:"text",text:`
|
|
11
|
+
`},...O]}}}else t.push({indent:p.indent,block:p.block})}}const r=new Map,l=new Map,s=[],i=[],a=new Set(["paragraph","heading","bulletList","orderedList","todoList"]),c=10,d=(u,m,h)=>{if(r.set(m,h),l.set(m,u),u===null){s.push(m);return}const p=r.get(u);if(!p){s.push(m),l.set(m,null);return}r.set(u,{...p,children:[...p.children,m]})};for(const u of t){const m=bo(),h=a.has(u.block.type);let p=Math.floor(u.indent/2);for(p<0&&(p=0),p>c&&(p=c);i.length>0&&i[i.length-1].indent>=p;)i.pop();const b=i.length>0?i[i.length-1].id:null,x={...u.block.attrs??{}},O={id:m,type:u.block.type,attrs:x,content:u.block.content??[],children:[]};d(b,m,O),h&&i.push({indent:p,id:m})}const f=10;for(const[u,m]of r){let h=0,p=l.get(u);const b=new Set;for(;p!=null&&!b.has(p);)b.add(p),h++,p=l.get(p);if(h=Math.min(f,h),(typeof m.attrs.indent=="number"?m.attrs.indent:0)===h)continue;const{indent:O,...z}=m.attrs,F=h>0?{...z,indent:h}:z;r.set(u,{...m,attrs:F})}return{id:"doc_"+Math.random().toString(36).slice(2,10),root:s,blocks:r,parent:l}}const Bi=Symbol("block-editor-mobile"),qr=Symbol("block-editor-fixed-toolbar-bridge"),Uo=Symbol("block-editor-fixed-toolbar-bottom"),Wr=Symbol("block-editor"),Ri=Symbol("block-editor-editable"),Li=Symbol("block-editor-image-upload");function dn(){const e=n.inject(Wr);if(!e)throw new Error("useEditor(): must be called within a <BlockEditor> component tree");return e}function gd(){return n.inject(Li,null)}function Vn(){return n.inject(Ri)??n.ref(!0)}function bd(e,t){const o=ki(t);if(!o)return!1;const r=e.registries.keymap.resolve(o);if(!r)return!1;const l=e.commands[r.command];return l?l(r.args)===!0:!1}const kd=e=>`[data-block-id="${CSS.escape(e)}"]`;function zo(e,t){const o=kd(t),r=e.querySelector(`${o}[contenteditable], ${o} [contenteditable]`);return r||e.querySelector(o)}function yd(e){const t=window.getSelection();if(!t||t.rangeCount===0)return 0;const o=t.getRangeAt(0),r=o.cloneRange();return r.selectNodeContents(e),r.setEnd(o.endContainer,o.endOffset),r.toString().length}function Oi(e,t){const o=window.getSelection();if(!o||o.rangeCount===0)return null;const r=o.getRangeAt(0).endContainer,l=cr(r,e);if(!l)return null;const s=l.dataset.blockId;if(!s)return null;const i=yd(l),a=t.blocks.get(s);if(!a)return null;const c=Me(a.content).length,d=Math.min(i,c);if(!o.isCollapsed&&o.anchorNode===o.focusNode&&cr(o.anchorNode,e)===l){const u=Math.min(o.anchorOffset,c);return{kind:"text",anchor:{blockId:s,offset:u},focus:{blockId:s,offset:d}}}return Qe(s,d)}function cr(e,t){let o=e;for(;o&&o!==t;){if(o.nodeType===Node.ELEMENT_NODE){const r=o;if(r.dataset&&r.dataset.blockId)return r}o=o.parentNode}return null}function wd(e,t,o){const r=document.createRange();r.selectNodeContents(e);try{r.setEnd(t,o)}catch{return 0}return r.toString().length}function Di(e,t,o){const r=$i(e,t),l=$i(e,o);if(!r||!l)return null;try{const s=document.createRange();return s.setStart(r.node,r.offset),s.setEnd(l.node,l.offset),s}catch{return null}}function $i(e,t){let o=0;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);let l=null;for(;r.nextNode();){const s=r.currentNode;l=s;const i=(s.nodeValue??"").length;if(o+i>=t)return{node:s,offset:Math.max(0,t-o)};o+=i}return l?{node:l,offset:(l.nodeValue??"").length}:{node:e,offset:0}}function dr(e,t,o,r){let l=null;const s=document;if(typeof s.caretRangeFromPoint=="function")l=s.caretRangeFromPoint(e,t);else if(typeof s.caretPositionFromPoint=="function"){const i=s.caretPositionFromPoint(e,t);i&&(l=document.createRange(),l.setStart(i.offsetNode,i.offset),l.collapse(!0))}if(l){const i=cr(l.startContainer,o);if(i){const a=i.dataset.blockId;if(a){const c=r.blocks.get(a);if(c){const d=Me(c.content).length,f=Math.min(wd(i,l.startContainer,l.startOffset),d);return{blockEl:i,blockId:a,offset:f}}}}}return Ed(e,t,o,r)}function Ed(e,t,o,r){const l=document.elementFromPoint(e,t),s=l?cr(l,o):null;if(!s)return null;const i=s.dataset.blockId;if(!i)return null;const a=r.blocks.get(i);if(!a)return null;const c=s.matches("[contenteditable]")?s:s.querySelector("[contenteditable]");if(!c)return null;const d=Me(a.content).length;let f=null,u=0;const m=document.createTreeWalker(c,NodeFilter.SHOW_TEXT);let h;for(;h=m.nextNode();){const p=h,b=(p.nodeValue??"").length;if(b===0)continue;const x=document.createRange();x.setStart(p,0),x.setEnd(p,b);const O=x.getBoundingClientRect();if(O.width<=0&&O.height<=0)continue;const z=Math.max(O.left,Math.min(e,O.right)),F=Math.max(O.top,Math.min(t,O.bottom)),j=Math.hypot(e-z,t-F),P=O.width>0?Math.round((e-O.left)/O.width*b):0,U=u+Math.max(0,Math.min(b,P));(!f||j<f.dist)&&(f={offset:U,dist:j}),u+=b}return f?{blockEl:s,blockId:i,offset:Math.min(f.offset,d)}:{blockEl:s,blockId:i,offset:0}}function Gr(e,t){const o=document.createRange(),r=window.getSelection();if(!r)return;let l=0,s=!1;const i=a=>{var c;if(!s)if(a.nodeType===Node.TEXT_NODE){const d=((c=a.textContent)==null?void 0:c.length)??0;l+d>=t&&(o.setStart(a,Math.max(0,t-l)),o.collapse(!0),s=!0),l+=d}else for(const d of a.childNodes)i(d)};i(e),s||(o.selectNodeContents(e),o.collapse(!1)),r.removeAllRanges(),r.addRange(o)}function Pi(e,t){if(wo(t)){const r=zo(e,t.blockId);if(!r)return;r.focus(),Gr(r,t.offset);return}if(Jn(t)&&t.anchor.blockId===t.focus.blockId){const r=zo(e,t.focus.blockId);if(!r)return;if(r.focus(),t.anchor.offset===t.focus.offset)Gr(r,t.focus.offset);else{const l=Math.min(t.anchor.offset,t.focus.offset),s=Math.max(t.anchor.offset,t.focus.offset),i=Di(r,l,s),a=window.getSelection();i&&a?(a.removeAllRanges(),a.addRange(i)):Gr(r,t.focus.offset)}return}const o=window.getSelection();o&&o.rangeCount>0&&o.removeAllRanges()}function Ht(e){return e.kind==="text"&&!(e.anchor.blockId===e.focus.blockId&&e.anchor.offset===e.focus.offset)&&e.anchor.blockId!==e.focus.blockId}function Yr(e,t,o){if(o.anchor.blockId===o.focus.blockId)return[];const r=Bn(t),l=r.indexOf(o.anchor.blockId),s=r.indexOf(o.focus.blockId);if(l===-1||s===-1)return[];const[i,a]=l<=s?[o.anchor.blockId,o.focus.blockId,l<s]:[o.focus.blockId,o.anchor.blockId,l>s],c=r.indexOf(i),d=r.indexOf(a);if(c===-1||d===-1)return[];const f=[];for(let u=c;u<=d;u++){const m=r[u],h=t.blocks.get(m);if(!h)continue;const p=zo(e,m);if(!p)continue;const b=Me(h.content).length;let x=0,O=b;if(u===c){const F=i===o.anchor.blockId?o.anchor.offset:o.focus.offset;x=Math.min(F,b)}if(u===d){const F=a===o.anchor.blockId?o.anchor.offset:o.focus.offset;O=Math.min(F,b)}const z=Di(p,x,Math.max(x,O));if(z)for(const F of z.getClientRects())F.width>0&&F.height>0&&f.push(F)}return f}function vd(e){var s;const{registry:t,blockId:o,text:r,editor:l}=e;for(const i of t.all){const a=i.pattern.exec(r);if(!a)continue;const c=(s=i.args)==null?void 0:s.call(i,a),d=c&&typeof c=="object"?c:{},f={...d};f.id==="__currentBlock__"&&(f.id=o);const u=typeof d.__stripPrefix=="number"?d.__stripPrefix:0,m=l.commands[i.command];if(m){l.history.beginGroup();try{if(u>0){const h=r.slice(u),p=l.commands.setText;p&&p({id:o,content:jn(h)})}m(f)}finally{l.history.endGroup()}return!0}}return!1}function Cd(e){return e.includes("/")?e.startsWith("/")||/^\s*\/\S*/.test(e):!1}const Td=["http:","https:","mailto:","tel:"],xd=["javascript:","vbscript:","data:","file:"];function Un(e){const t=e.trim();if(!t)return null;const o=t.toLowerCase();for(const s of xd)if(o.startsWith(s))return null;const r=t.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):/);if(r){const s=r[1].toLowerCase()+":";return Td.includes(s)?t:null}const l=t[0];return l==="/"||l==="."||l==="#"||t.startsWith("//")||Zr(t)?t:null}function Zr(e){const t=e.trim();return!t||t.length<4?!1:/^https?:\/\//i.test(t)||/^mailto:/i.test(t)?!0:/\s/.test(t)?!1:!!/^[\w-]+(\.[\w-]+)+(:\d+)?(\/[^\s]*)?$/.test(t)}function ro(e){const t=e.trim();return t?/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(t)?t:t.startsWith("@")||/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)?t.startsWith("mailto:")?t:`mailto:${t.replace(/^@/,"")}`:Zr(t)&&!t.startsWith("/")?`https://${t}`:t:""}const Fo=/(^|\s)((?:https?:\/\/|www\.)[^\s<]+|[\w-]+(?:\.[\w-]+)+\.[a-zA-Z]{2,}(?::\d+)?(?:\/[^\s<]*)?)/g;function ur(e){var r,l;let t=!1;const o=[];for(const s of e){if(s.type!=="text"){o.push(s);continue}const i=(r=s.marks)==null?void 0:r.some(h=>h.type==="link"),a=(l=s.marks)==null?void 0:l.some(h=>h.type==="code");if(i||a){o.push(s);continue}const c=s.text,d=s.marks??[];if(Fo.lastIndex=0,!Fo.exec(c)){o.push(s);continue}t=!0;let u=0;Fo.lastIndex=0;let m;for(;(m=Fo.exec(c))!==null;){const h=m[0],p=m[2],b=m.index+h.length-p.length,x=b+p.length;if(b>u){const F=c.slice(u,b);F.length>0&&o.push({type:"text",text:F,marks:d.length>0?[...d]:void 0})}const O=ro(p),z=Un(O);if(z){const F={type:"link",attrs:{href:z}};o.push({type:"text",text:p,marks:[...d,F]})}else o.push({type:"text",text:p,marks:d.length>0?[...d]:void 0});u=x}if(u<c.length){const h=c.slice(u);h.length>0&&o.push({type:"text",text:h,marks:d.length>0?[...d]:void 0})}Fo.lastIndex=0}return t?o:e}const _d={bold:["b","strong"],italic:["i","em"],underline:["u"],strikethrough:["s","strike","del"],code:["code"],link:["a"]},Hi={};for(const[e,t]of Object.entries(_d))for(const o of t)Hi[o]=e;const Md="b,strong,i,em,u,s,strike,del,code,a[href],span.be-color-gray,span.be-color-brown,span.be-color-orange,span.be-color-yellow,span.be-color-green,span.be-color-blue,span.be-color-purple,span.be-color-pink,span.be-color-red,span.be-bg-gray,span.be-bg-brown,span.be-bg-orange,span.be-bg-yellow,span.be-bg-green,span.be-bg-blue,span.be-bg-purple,span.be-bg-pink,span.be-bg-red";function Nd(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function Sd(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function Vi(e){return e.some(t=>t.type==="text"&&t.marks&&t.marks.length>0)}function eo(e){return e.length===0?"":e.map(t=>{var f,u,m;if(t.type!=="text")return"";let o=Nd(t.text);const r=t.marks??[],l=r.find(h=>h.type==="color"),s=(f=l==null?void 0:l.attrs)==null?void 0:f.color;typeof s=="string"&&(o=`<span class="be-color-${s}">${o}</span>`);const i=r.find(h=>h.type==="bgColor"),a=(u=i==null?void 0:i.attrs)==null?void 0:u.bgColor;typeof a=="string"&&(o=`<span class="be-bg-${a}">${o}</span>`),r.some(h=>h.type==="strikethrough")&&(o=`<s>${o}</s>`),r.some(h=>h.type==="underline")&&(o=`<u>${o}</u>`),r.some(h=>h.type==="italic")&&(o=`<i>${o}</i>`),r.some(h=>h.type==="bold")&&(o=`<b>${o}</b>`),r.some(h=>h.type==="code")&&(o=`<code>${o}</code>`);const c=r.find(h=>h.type==="link"),d=(m=c==null?void 0:c.attrs)==null?void 0:m.href;if(typeof d=="string"){const h=Un(d);h&&(o=`<a href="${Sd(h)}" target="_blank" rel="noopener noreferrer">${o}</a>`)}return o}).join("")}function Ad(e){const t=[],o=e.className;if(typeof o=="string"){const r=o.match(/be-color-(\w+)/);r&&t.push({type:"color",attrs:{color:r[1]}});const l=o.match(/be-bg-(\w+)/);l&&t.push({type:"bgColor",attrs:{bgColor:l[1]}})}return t}function gn(e){const t=[];function o(r,l){if(r.nodeType===Node.TEXT_NODE){const d=r.textContent??"";d.length>0&&t.push({type:"text",text:d,marks:l.length>0?[...l]:void 0});return}if(r.nodeType!==Node.ELEMENT_NODE)return;const s=r,i=s.tagName.toLowerCase();if(i==="br")return;const a=Hi[i];let c=l;if(a==="link"){const d=s.getAttribute("href")??"",f=Un(d);f?c=[...l,{type:"link",attrs:{href:f}}]:c=l}else if(a)c=[...l,{type:a}];else if(i==="span"){const d=Ad(s);d.length>0&&(c=[...l,...d])}for(const d of s.childNodes)o(d,c)}return o(e,[]),Rd(t)}function Id(e,t){if(e.type!==t.type)return!1;const o=e.attrs?Object.keys(e.attrs):[],r=t.attrs?Object.keys(t.attrs):[];return o.length!==r.length?!1:o.every(l=>e.attrs[l]===t.attrs[l])}function Bd(e,t){return!e&&!t?!0:!e||!t||e.length!==t.length?!1:e.every(o=>t.some(r=>Id(o,r)))}function Rd(e){const t=[];for(const o of e){const r=t[t.length-1];r&&Bd(r.marks,o.marks)?t[t.length-1]={type:"text",text:r.text+o.text,marks:r.marks}:t.push({...o})}return t}function Ld(e){return e.attrs?Object.entries(e.attrs).sort((t,o)=>t[0].localeCompare(o[0])).map(([t,o])=>`${t}=${String(o)}`).join(";"):""}function Ui(e){return e.map(t=>t.type==="text"?`${t.text}\0${(t.marks??[]).map(o=>`${o.type}:${Ld(o)}`).sort().join(",")}`:"").join("")}const Xr=["paragraph","heading","heading1","heading2","heading3","heading4","heading5","heading6","bulletList","orderedList","todoList","quote","codeBlock"],Ko=["todoList"],qo=["orderedList"],jr=["left","center","right"],Qr=["top","middle","bottom"],Jr=["gray","brown","orange","yellow","green","blue","purple","pink","red"],el=["bold","italic","underline","strikethrough","color","bgColor","link"],Od=["bold","italic","underline","strikethrough","code","link","color","bgColor"];function lo(){return{content:[],rowspan:1,colspan:1,covered:!1}}function Eo(e,t){const o=t==="codeBlock",r=t==="quote",l=[];for(const s of e){if(s.type!=="text"){l.push({...s});continue}if(o){l.push({type:"text",text:s.text});continue}let i=s.marks?s.marks.filter(a=>Od.includes(a.type)):void 0;i&&i.some(a=>a.type==="code")&&(i=i.filter(a=>a.type==="code"||!el.includes(a.type))),r&&i&&(i=i.filter(a=>a.type!=="italic")),i&&(i=i.filter(a=>{var d;if(a.type!=="link")return!0;const c=(d=a.attrs)==null?void 0:d.href;return typeof c!="string"?!1:Un(c)!==null})),i&&i.length===0&&(i=void 0),l.push(i?{...s,marks:i}:{type:"text",text:s.text})}return l}function xn(e){return{content:e.content.map(t=>({...t})),rowspan:e.rowspan,colspan:e.colspan,covered:e.covered,cellType:e.cellType,align:e.align,verticalAlign:e.verticalAlign,bgColor:e.bgColor,checked:e.checked,startNumber:e.startNumber}}function zn(e,t,o,r,l){var f,u,m;let s=Math.max(0,Math.min(t,r)),i=Math.min(e.rows-1,Math.max(t,r)),a=Math.max(0,Math.min(o,l)),c=Math.min(e.cols-1,Math.max(o,l)),d=!0;for(;d;){d=!1;for(let h=s;h<=i;h++)for(let p=a;p<=c;p++){const b=(f=e.cells[h])==null?void 0:f[p];if(!b)continue;let x=h,O=p;if(b.covered){let P=!1;for(let U=h;U>=0&&!P;U--)for(let te=p;te>=0&&!P;te--){const W=(u=e.cells[U])==null?void 0:u[te];!W||W.covered||U+Math.max(1,W.rowspan)>h&&te+Math.max(1,W.colspan)>p&&(x=U,O=te,P=!0)}if(!P)continue}const z=(m=e.cells[x])==null?void 0:m[O];if(!z||z.covered)continue;const F=x+Math.max(1,z.rowspan)-1,j=O+Math.max(1,z.colspan)-1;s>x&&(s=x,d=!0),i<F&&(i=F,d=!0),a>O&&(a=O,d=!0),c<j&&(c=j,d=!0)}}return{r1:s,c1:a,r2:i,c2:c}}function zi(e,t,o,r,l){var d;const s=Math.max(0,Math.min(t,r)),i=Math.min(e.rows-1,Math.max(t,r)),a=Math.max(0,Math.min(o,l)),c=Math.min(e.cols-1,Math.max(o,l));for(let f=s;f<=i;f++)for(let u=a;u<=c;u++){const m=(d=e.cells[f])==null?void 0:d[u];if(!(!m||m.covered)&&(m.rowspan>1||m.colspan>1))return!0}return!1}function Dd(e,t,o,r,l){var f;const s=Math.max(0,Math.min(t,r)),i=Math.min(e.rows-1,Math.max(t,r)),a=Math.max(0,Math.min(o,l)),c=Math.min(e.cols-1,Math.max(o,l));let d=0;for(let u=s;u<=i;u++)for(let m=a;m<=c;m++){const h=(f=e.cells[u])==null?void 0:f[m];h&&!h.covered&&(d+=1)}return d}function vo(e){return{content:e.content,rowspan:e.rowspan,colspan:e.colspan,covered:e.covered,cellType:e.cellType,align:e.align,verticalAlign:e.verticalAlign,bgColor:e.bgColor,checked:e.checked,startNumber:e.startNumber}}function $d(e,t){const o=[];for(let r=0;r<e;r++){const l=[];for(let s=0;s<t;s++)l.push(lo());o.push(l)}return o}function Wo(e){const t=e.rows,o=e.cols,r=typeof t=="number"&&Number.isInteger(t)&&t>=1?t:1,l=typeof o=="number"&&Number.isInteger(o)&&o>=1?o:1;let s=[];const i=e.colWidths;if(Array.isArray(i))for(const f of i)s.push(typeof f=="number"&&Number.isFinite(f)&&f>=0?f:0);for(;s.length<l;)s.push(0);s.length>l&&(s=s.slice(0,l));const a=typeof e.headerRow=="boolean"?e.headerRow:!1;let c=[];const d=e.cells;if(Array.isArray(d))for(let f=0;f<r;f++){const u=d[f],m=[];if(Array.isArray(u))for(let h=0;h<l;h++){const p=u[h];m.push(Pd(p))}else for(let h=0;h<l;h++)m.push(lo());c.push(m)}for(;c.length<r;){const f=[];for(let u=0;u<l;u++)f.push(lo());c.push(f)}return c.length>r&&(c=c.slice(0,r)),c=Fn(c,r,l),{rows:r,cols:l,cells:c,colWidths:s,headerRow:a}}function Pd(e){if(!e||typeof e!="object")return lo();const t=e,o=Array.isArray(t.content)?t.content:[],r=typeof t.cellType=="string"?t.cellType:void 0,l=r&&Xr.includes(r)?r:void 0,s=Eo(o,l),i=typeof t.rowspan=="number"&&Number.isInteger(t.rowspan)&&t.rowspan>=1?t.rowspan:1,a=typeof t.colspan=="number"&&Number.isInteger(t.colspan)&&t.colspan>=1?t.colspan:1,c=typeof t.covered=="boolean"?t.covered:!1,d=typeof t.align=="string"?t.align:void 0,f=d&&jr.includes(d)?d:void 0,u=typeof t.verticalAlign=="string"?t.verticalAlign:void 0,m=u&&Qr.includes(u)?u:void 0,h=typeof t.bgColor=="string"?t.bgColor:void 0,p=h&&Jr.includes(h)?h:void 0,b=typeof t.checked=="boolean"?t.checked:!1,x=l&&Ko.includes(l)?b:void 0,O=typeof t.startNumber=="number"&&Number.isInteger(t.startNumber)&&t.startNumber>=1?t.startNumber:void 0,z=l&&qo.includes(l)?O:void 0;return{content:s,rowspan:i,colspan:a,covered:c,cellType:l,align:f,verticalAlign:m,bgColor:p,checked:x,startNumber:z}}function Fn(e,t,o){const r=e.map(l=>l.map(xn));for(let l=0;l<t;l++)for(let s=0;s<o;s++){const i=r[l][s];if(i.covered)continue;const a=Math.max(1,Math.min(i.rowspan,t-l)),c=Math.max(1,Math.min(i.colspan,o-s));if(i.rowspan=a,i.colspan=c,!(a===1&&c===1))for(let d=l;d<l+a;d++)for(let f=s;f<s+c;f++)d===l&&f===s||(r[d][f]={content:[],rowspan:1,colspan:1,covered:!0})}return r.map(l=>l.map(vo))}function Fi(e,t){var u,m;const{rows:o,cols:r,cells:l,colWidths:s,headerRow:i}=e,a=Math.max(0,Math.min(t,o)),c=l.map(h=>h.map(xn)),d=[];for(let h=0;h<r;h++){if(a>0){const p=(u=c[a-1])==null?void 0:u[h];if(p&&!p.covered&&a-1+p.rowspan>a){d.push({content:[],rowspan:1,colspan:1,covered:!0});continue}}d.push(lo())}if(c.splice(a,0,d),a>0)for(let h=0;h<r;h++){const p=(m=c[a-1])==null?void 0:m[h];p&&!p.covered&&a-1+p.rowspan>a&&(p.rowspan=p.rowspan+1)}const f=Fn(c,o+1,r);return{rows:o+1,cols:r,cells:f,colWidths:[...s],headerRow:i}}function Hd(e,t){var f;const{rows:o,cols:r,colWidths:l,headerRow:s}=e;if(o<=1)return e;const i=Math.max(0,Math.min(t,o-1)),a=e.cells.map(u=>u.map(xn));for(let u=0;u<r;u++)for(let m=0;m<i;m++){const h=(f=a[m])==null?void 0:f[u];if(!h||h.covered)continue;m+h.rowspan>i&&(h.rowspan=Math.max(1,h.rowspan-1))}a.splice(i,1);let c=s;s&&i===0&&(c=!1);const d=Fn(a,o-1,r);return{rows:o-1,cols:r,cells:d,colWidths:[...l],headerRow:c}}function Vd(e,t){const{rows:o,cols:r,cells:l,colWidths:s,headerRow:i}=e,a=Math.max(0,Math.min(t,r)),c=l.map(h=>h.map(xn));for(let h=0;h<o;h++){let p=!1;if(a>0){const b=c[h][a-1];b&&!b.covered&&a-1+b.colspan>a&&(b.colspan=b.colspan+1,p=!0)}c[h].splice(a,0,p?{content:[],rowspan:1,colspan:1,covered:!0}:lo())}const d=[...s],f=d.filter(h=>h>0),u=f.length>0?Math.round(f.reduce((h,p)=>h+p,0)/f.length):120;d.splice(a,0,u);const m=Fn(c,o,r+1);return{rows:o,cols:r+1,cells:m,colWidths:d,headerRow:i}}function Ud(e,t){const{rows:o,cols:r,cells:l,headerRow:s}=e;if(r<=1)return e;const i=Math.max(0,Math.min(t,r-1)),a=l.map(f=>f.map(xn));for(let f=0;f<o;f++){for(let u=0;u<i;u++){const m=a[f][u];if(!m||m.covered)continue;u+m.colspan>i&&(m.colspan=Math.max(1,m.colspan-1))}a[f].splice(i,1)}const c=[...e.colWidths];c.splice(i,1);const d=Fn(a,o,r-1);return{rows:o,cols:r-1,cells:d,colWidths:c,headerRow:s}}function Go(e,t,o,r){var a;if(t<0||t>=e.rows||o<0||o>=e.cols)return e;const l=(a=e.cells[t])==null?void 0:a[o];if(!l||l.covered)return e;const s=Eo(r,l.cellType),i=e.cells.map((c,d)=>c.map((f,u)=>d===t&&u===o?vo({...xn(f),content:s}):f));return{...e,cells:i}}function Yo(e,t,o,r){var i;if(t<0||t>=e.rows||o<0||o>=e.cols)return e;const l=(i=e.cells[t])==null?void 0:i[o];if(!l||l.covered)return e;const s=e.cells.map((a,c)=>a.map((d,f)=>{if(c!==t||f!==o)return d;const u=xn(d);return r.cellType!==void 0&&(u.cellType=r.cellType==="paragraph"?void 0:Xr.includes(r.cellType)?r.cellType:void 0,u.content=Eo(u.content,u.cellType),(!u.cellType||!Ko.includes(u.cellType))&&(u.checked=void 0),(!u.cellType||!qo.includes(u.cellType))&&(u.startNumber=void 0)),r.align!==void 0&&(u.align=r.align==="left"?void 0:jr.includes(r.align)?r.align:void 0),r.verticalAlign!==void 0&&(u.verticalAlign=r.verticalAlign==="middle"?void 0:Qr.includes(r.verticalAlign)?r.verticalAlign:void 0),r.bgColor!==void 0&&(u.bgColor=r.bgColor==="default"?void 0:Jr.includes(r.bgColor)?r.bgColor:void 0),r.checked!==void 0&&(u.checked=u.cellType&&Ko.includes(u.cellType)?r.checked:void 0),r.startNumber!==void 0&&(r.startNumber===null?u.startNumber=void 0:u.startNumber=u.cellType&&qo.includes(u.cellType)&&typeof r.startNumber=="number"&&Number.isInteger(r.startNumber)&&r.startNumber>=1?r.startNumber:void 0),vo(u)}));return{...e,cells:s}}function io(e,t,o){const r=new Set(t.map(s=>`${s.row}-${s.col}`)),l=e.cells.map((s,i)=>s.map((a,c)=>{if(!r.has(`${i}-${c}`)||a.covered)return a;const d=xn(a);return o.cellType!==void 0&&(d.cellType=o.cellType==="paragraph"?void 0:Xr.includes(o.cellType)?o.cellType:void 0,d.content=Eo(d.content,d.cellType),(!d.cellType||!Ko.includes(d.cellType))&&(d.checked=void 0),(!d.cellType||!qo.includes(d.cellType))&&(d.startNumber=void 0)),o.align!==void 0&&(d.align=o.align==="left"?void 0:jr.includes(o.align)?o.align:void 0),o.verticalAlign!==void 0&&(d.verticalAlign=o.verticalAlign==="middle"?void 0:Qr.includes(o.verticalAlign)?o.verticalAlign:void 0),o.bgColor!==void 0&&(d.bgColor=o.bgColor==="default"?void 0:Jr.includes(o.bgColor)?o.bgColor:void 0),o.checked!==void 0&&(d.checked=d.cellType&&Ko.includes(d.cellType)?o.checked:void 0),o.startNumber!==void 0&&(o.startNumber===null?d.startNumber=void 0:d.startNumber=d.cellType&&qo.includes(d.cellType)&&typeof o.startNumber=="number"&&Number.isInteger(o.startNumber)&&o.startNumber>=1?o.startNumber:void 0),vo(d)}));return{...e,cells:l}}function Ki(e,t,o,r){const l=new Set(t.map(i=>`${i.row}-${i.col}`)),s=e.cells.map((i,a)=>i.map((c,d)=>{if(!l.has(`${a}-${d}`)||c.covered||c.cellType==="codeBlock"||c.cellType==="quote"&&o==="italic")return c;const f=xn(c);return f.content=f.content.map(u=>{if(u.type!=="text")return u;const m=u.marks?[...u.marks]:[],h=m.some(b=>b.type==="code");if(o==="code"&&r!==null){const b=m.filter(x=>x.type==="code"||!el.includes(x.type));return b.some(x=>x.type==="code")||b.push({type:"code"}),{...u,marks:b.length>0?b:void 0}}if(r!==null&&el.includes(o)&&h)return u;const p=m.filter(b=>b.type!==o);return r!==null&&p.push(r?{type:o,attrs:r}:{type:o}),{...u,marks:p.length>0?p:void 0}}),vo(f)}));return{...e,cells:s}}function zd(e,t,o){var s,i;new Set(t.map(a=>`${a.row}-${a.col}`));const r=t.filter(a=>{var d;const c=(d=e.cells[a.row])==null?void 0:d[a.col];return!(!c||c.covered||c.cellType==="codeBlock"||c.cellType==="quote"&&o==="italic")});if(r.length===0)return e;let l=!0;for(const a of r){const c=(s=e.cells[a.row])==null?void 0:s[a.col];if(!(!c||c.covered)&&c.content.length!==0){for(const d of c.content){if(d.type!=="text")continue;if(!(((i=d.marks)==null?void 0:i.some(u=>u.type===o))??!1)){l=!1;break}}if(!l)break}}return Ki(e,r,o,l?null:{})}function Fd(e,t,o,r,l){var P,U,te;const s=Math.max(0,Math.min(t,r)),i=Math.min(e.rows-1,Math.max(t,r)),a=Math.max(0,Math.min(o,l)),c=Math.min(e.cols-1,Math.max(o,l));if(s===i&&a===c)return e;const d=e.cells.map(W=>W.map(xn));for(let W=s;W<=i;W++)for(let J=a;J<=c;J++)d[W][J]={content:[],rowspan:1,colspan:1,covered:!1};let f=s,u=a;for(;f>=0&&((U=(P=e.cells[f])==null?void 0:P[u])!=null&&U.covered);){if(u>0){u-=1;continue}f-=1,u=e.cols-1}const m=f>=0?(te=e.cells[f])==null?void 0:te[u]:void 0,h=m?m.content.map(W=>({...W})):[],p=m==null?void 0:m.cellType,b=m==null?void 0:m.align,x=m==null?void 0:m.verticalAlign,O=m==null?void 0:m.bgColor,z=m==null?void 0:m.checked,F=m==null?void 0:m.startNumber;d[s][a]={content:Eo(h,p),rowspan:i-s+1,colspan:c-a+1,covered:!1,cellType:p,align:b,verticalAlign:x,bgColor:O,checked:z,startNumber:F};const j=Fn(d,e.rows,e.cols);return{...e,cells:j}}function qi(e,t,o){var c;if(t<0||t>=e.rows||o<0||o>=e.cols)return e;const r=(c=e.cells[t])==null?void 0:c[o];if(!r||r.covered)return e;const l=t+r.rowspan-1,s=o+r.colspan-1,i=e.cells.map(d=>d.map(xn));for(let d=t;d<=l;d++)for(let f=o;f<=s;f++)i[d][f]={content:d===t&&f===o?[...r.content]:[],rowspan:1,colspan:1,covered:!1};const a=Fn(i,e.rows,e.cols);return{...e,cells:a}}function Kd(e,t,o,r,l){var f;const s=Math.max(0,Math.min(t,r)),i=Math.min(e.rows-1,Math.max(t,r)),a=Math.max(0,Math.min(o,l)),c=Math.min(e.cols-1,Math.max(o,l));let d=e;for(let u=i;u>=s;u--)for(let m=c;m>=a;m--){const h=(f=d.cells[u])==null?void 0:f[m];!h||h.covered||h.rowspan===1&&h.colspan===1||(d=qi(d,u,m))}return d}function qd(e){return{...e,headerRow:!e.headerRow}}function Wi(e,t,o){if(t<0||t>=e.cols)return e;const r=Math.max(0,Math.round(o)),l=[...e.colWidths];for(;l.length<e.cols;)l.push(0);return l[t]=r,{...e,colWidths:l}}function fr(e){let t="";for(const o of e.content)o.type==="text"&&(t+=o.text);return t}function Gi(e){return e.replace(/\\/g,"\\\\").replace(/\|/g,"\\|").replace(/\r?\n/g,"<br>")}function Wd(e){var s,i;const t=[];e.colWidths;const o=[],r=[];for(let a=0;a<e.cols;a++){const c=(s=e.cells[0])==null?void 0:s[a],d=c&&!c.covered?fr(c):"";o.push(Gi(d)),r.push(e.headerRow?"---":"-")}const l=e.headerRow?1:0;e.headerRow?(t.push(`| ${o.join(" | ")} |`),t.push(`| ${r.join(" | ")} |`)):(t.push(`| ${o.join(" | ")} |`),t.push(`| ${r.join(" | ")} |`));for(let a=l;a<e.rows;a++){const c=[];for(let d=0;d<e.cols;d++){const f=(i=e.cells[a])==null?void 0:i[d],u=f&&!f.covered?fr(f):"";c.push(Gi(u))}t.push(`| ${c.join(" | ")} |`)}return t.join(`
|
|
12
|
+
`)}function Gd(e){var l,s;const t=["<table>"],o=[];for(let i=0;i<e.cols;i++){const a=e.colWidths[i]??0;o.push(a>0?`<col style="width:${a}px">`:"<col>")}o.length>0&&t.push(`<colgroup>${o.join("")}</colgroup>`);const r=e.headerRow?1:0;if(e.headerRow){t.push("<thead><tr>");for(let i=0;i<e.cols;i++){const a=(l=e.cells[0])==null?void 0:l[i];if(!a||a.covered)continue;const c=a.rowspan>1?` rowspan="${a.rowspan}"`:"",d=a.colspan>1?` colspan="${a.colspan}"`:"";t.push(`<th${c}${d}>${Yi(fr(a))}</th>`)}t.push("</tr></thead>")}t.push("<tbody>");for(let i=r;i<e.rows;i++){t.push("<tr>");for(let a=0;a<e.cols;a++){const c=(s=e.cells[i])==null?void 0:s[a];if(!c||c.covered)continue;const d=c.rowspan>1?` rowspan="${c.rowspan}"`:"",f=c.colspan>1?` colspan="${c.colspan}"`:"";t.push(`<td${d}${f}>${Yi(fr(c))}</td>`)}t.push("</tr>")}return t.push("</tbody></table>"),t.join("")}function Yi(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Yd(e){var f;const t=Array.from(e.querySelectorAll("tr"));if(t.length===0)return null;let o=0;const r=[];for(const u of t){const m=Array.from(u.children).filter(p=>p.tagName==="TH"||p.tagName==="TD");let h=0;for(const p of m)h+=p.colSpan||1;h>o&&(o=h),r.push(m)}o=Math.max(1,o);const l=t.length,s=[];for(let u=0;u<l;u++){const m=[];for(let h=0;h<o;h++)m.push(lo());s.push(m)}for(let u=0;u<l;u++){const m=r[u]??[];let h=0;for(const p of m){for(;h<o&&s[u][h].covered;)h++;if(h>=o)break;const b=Math.max(1,Math.min(p.rowSpan||1,l-u)),x=Math.max(1,Math.min(p.colSpan||1,o-h)),O=Eo(gn(p));s[u][h]={content:O,rowspan:b,colspan:x,covered:!1};for(let z=u;z<u+b;z++)for(let F=h;F<h+x;F++)z===u&&F===h||z<l&&F<o&&(s[z][F]={content:[],rowspan:1,colspan:1,covered:!0});h+=x}}const i=e.querySelectorAll("thead tr").length>0||((f=r[0])==null?void 0:f.every(u=>u.tagName==="TH"))===!0,a=[];for(let u=0;u<o;u++)a.push(0);const c=s.map(u=>u.map(vo)),d=Fn(c,l,o);return{rows:l,cols:o,cells:d,colWidths:a,headerRow:i}}function Zd(e){if(!e||typeof e!="object")return!1;const t=e;return!(typeof t.rows!="number"||!Number.isInteger(t.rows)||t.rows<1||typeof t.cols!="number"||!Number.isInteger(t.cols)||t.cols<1)}function so(e){return Wo(e)}function tl(e,t,o){var l,s;const r=(l=e.cells[t])==null?void 0:l[o];if(!r||r.covered)return 1;if(typeof r.startNumber=="number")return r.startNumber;for(let i=t-1;i>=0;i--){const a=(s=e.cells[i])==null?void 0:s[o];if(!(!a||a.covered)){if(a.cellType!=="orderedList")break;return tl(e,i,o)+1}}return 1}const Zi=new Set(["p","h1","h2","h3","h4","h5","h6","li","pre","blockquote","hr","tr","table-row","table"]),Xd=/^(?:-{3,}|\*{3,}|_{3,})\s*$/,nl={h1:1,h2:2,h3:3,h4:4,h5:5,h6:6},Xi=new Set(["meta","style","script","head","title","link","object","embed"]);function jd(e){const t=(e.getAttribute("src")??"").trim();return!t||/^cid:/i.test(t)||/^(javascript|vbscript|data:text\/)/i.test(t)||t.length>1e7?null:{src:t,alt:(e.getAttribute("alt")??"").trim(),title:(e.getAttribute("title")??"").trim()}}function pr(e){return Zi.has(e)||e in nl}function Qd(e,t){if(e){const o=Jd(e);if(o.length>0)return o}if(e){const o=nu(e);if(o.length>0)return o}return t?tu(t):[]}function Jd(e){const t=e.match(/<!--\s*blockeditor:(.+?)\s*-->/);if(!t)return[];try{const o=JSON.parse(t[1]),r=o.type,l=o.attrs,s=o.text;if(!r)return[];const i=[];return s&&s.length>0?i.push({type:r,attrs:l??{},content:jn(s)}):i.push({type:r,attrs:l??{},content:[]}),i}catch{return[]}}function ol(e){let t=0;for(const o of e)o.type==="text"&&(t+=o.text.length);return t}function eu(e){if(e.length===0)return e;const t=[...e];for(;t.length>0;){const o=t[0];if(o.type!=="text")break;const r=o.text.replace(/^[\s\r\n]+/,"");if(r===o.text)break;if(r.length===0)t.shift();else{t[0]={...o,text:r};break}}for(;t.length>0;){const o=t[t.length-1];if(o.type!=="text")break;const r=o.text.replace(/[\s\r\n]+$/,"");if(r===o.text)break;if(r.length===0)t.pop();else{t[t.length-1]={...o,text:r};break}}return t}function ji(e){for(let t=0;t<e.length;t++){const o=e[t];o.type==="codeBlock"||o.type==="image"||o.type==="table"||o.type==="divider"||(e[t]={...o,content:eu(o.content)})}}function tu(e){const t=e.split(/\r?\n/),o=[];for(const r of t)Xd.test(r)?o.push({type:"divider",attrs:{},content:[]}):o.push({type:"paragraph",attrs:{},content:jn(r)});return ji(o),Qi(o),o}function Qi(e){const t=new Set(["image","table","divider","codeBlock","equation"]),o=[];let r=!1;for(const l of e)!t.has(l.type)&&ol(l.content)===0?(r||o.push(l),r=!0):(o.push(l),r=!1);for(;o.length>1&&!t.has(o[0].type)&&ol(o[0].content)===0;)o.shift();for(;o.length>1&&!t.has(o[o.length-1].type)&&ol(o[o.length-1].content)===0;)o.pop();e.length=0;for(const l of o)e.push(l)}function nu(e){const t=new DOMParser().parseFromString(e,"text/html"),o=[];let r=t.body;for(;r.nodeType===Node.ELEMENT_NODE;){const l=r,s=Array.from(l.childNodes),i=s.filter(u=>u.nodeType===Node.ELEMENT_NODE&&!Xi.has(u.tagName.toLowerCase())),a=i.some(u=>pr(u.tagName.toLowerCase())||u.tagName.toLowerCase()==="br"),c=s.some(u=>u.nodeType===Node.TEXT_NODE&&(u.textContent??"").length>0),d=i.some(u=>!pr(u.tagName.toLowerCase())&&u.tagName.toLowerCase()!=="div");if(a||c||d||i.length!==1)break;const f=i[0];if(f&&(f.tagName.toLowerCase()==="div"||f.tagName.toLowerCase()==="span"))r=f;else break}if(Zo(r.childNodes,t,o),ji(o),Qi(o),o.length===0){const l=t.body.textContent??"";l.length>0&&o.push({type:"paragraph",attrs:{},content:jn(l)})}return o}function Zo(e,t,o){var i;let r=[],l=0;function s(a=!1){if(r.length===0&&!a){l=0;return}const c=t.createElement("div");for(const f of r)c.appendChild(f.cloneNode(!0));const d=gn(c);o.push({type:"paragraph",attrs:{},content:d}),r=[],l=0}for(const a of e){if(a.nodeType===Node.COMMENT_NODE)continue;if(a.nodeType===Node.TEXT_NODE){const f=a.textContent??"";if(f.length>0&&f.trim().length===0)continue;r.push(a),l=0;continue}if(a.nodeType!==Node.ELEMENT_NODE)continue;const c=a,d=c.tagName.toLowerCase();if(!Xi.has(d)){if(d==="br"){l+=1;const f=r.length>0;s(!1),f||(l>=2||o.length>0)&&o.push({type:"paragraph",attrs:{},content:[]});continue}if(d==="pre"){s();const f=(c.textContent??"").replace(/^\n+|\n+$/g,"");o.push({type:"codeBlock",attrs:{language:"plain"},content:jn(f)}),l=0;continue}if(d==="hr"){s(),o.push({type:"divider",attrs:{},content:[]}),l=0;continue}if(d in nl){s(),o.push({type:"heading",attrs:{level:nl[d]},content:gn(c)}),l=0;continue}if(d==="blockquote"){s(),Zo(c.childNodes,t,o),l=0;continue}if(d==="li"){s();const f=c.parentElement,u=(f==null?void 0:f.tagName.toLowerCase())??"",m=gn(c);u==="ol"?o.push({type:"orderedList",attrs:{},content:m}):u==="ul"?o.push({type:"bulletList",attrs:{},content:m}):o.push({type:"paragraph",attrs:{},content:m}),l=0;continue}if(Zi.has(d)){s();const f=Array.from(c.children).some(m=>pr(m.tagName.toLowerCase())),u=!!c.querySelector("img");f||u?Zo(c.childNodes,t,o):c.querySelector("br")?ou(c,t,o):o.push({type:"paragraph",attrs:{},content:gn(c)}),l=0;continue}if(d==="div"||d==="span"){const f=Array.from(c.children).some(m=>{const h=m.tagName.toLowerCase();return pr(h)||h==="div"}),u=!!c.querySelector("img");if(f||u)s(),Zo(c.childNodes,t,o),l=0;else{d==="div"&&r.length>0&&r.push(t.createTextNode(`
|
|
13
|
+
`));for(const m of Array.from(c.childNodes))r.push(m);l=0}continue}if(d==="img"){const f=jd(c);f&&(s(),o.push({type:"image",attrs:{src:f.src,alt:f.alt,title:f.title},content:[]}),l=0);continue}if(d==="table"){const f=Yd(c);f&&(s(),o.push({type:"table",attrs:f,content:[]}),l=0);continue}if((i=c.querySelector)!=null&&i.call(c,"img")){s(),Zo(c.childNodes,t,o),l=0;continue}r.push(a),l=0}}s()}function ou(e,t,o){const r=[[]];for(const l of e.childNodes)l.nodeType===Node.ELEMENT_NODE&&l.tagName.toLowerCase()==="br"?r.push([]):r[r.length-1].push(l);for(const l of r){const s=t.createElement("div");for(const a of l)s.appendChild(a.cloneNode(!0));const i=gn(s);o.push({type:"paragraph",attrs:{},content:i})}}const Xo=new Map,rl=new Set;function Ji(e,t){for(const o of rl)o(e,t)}function to(e){return Xo.get(e)??null}function Tn(e,t){if(t===null){if(Xo.has(e)){const o=Xo.get(e);if(o!=null&&o.tempPreviewUrl&&URL.revokeObjectURL(o.tempPreviewUrl),o!=null&&o.controller)try{o.controller.abort()}catch{}Xo.delete(e),Ji(e,null)}}else Xo.set(e,t),Ji(e,t)}function ru(e){return rl.add(e),()=>{rl.delete(e)}}const es=new Set;function ll(e){const t=URL.createObjectURL(e);return es.add(t),t}function lu(e){for(const t of e)Tn(t,null)}function iu(e){lu(e)}let il=null;function su(e){il=e}const ts=su;function ns(e,t,o,r){if(!il){r.onError("Upload handler not registered");return}il(e,t,o,r)}function au(e,t){return new Promise((o,r)=>{const l=Date.now(),s=500+Math.min(2500,Math.round(e.size/2e3));let i=!1;const a=()=>{if(i)return;const c=Date.now()-l,d=Math.min(1,c/s),f=1-Math.pow(1-d,2);if(t==null||t(f),d<1)requestAnimationFrame(a);else{const u=ll(e);if(typeof document>"u"){o({url:u});return}const m=document.createElement("img");let h=!1;const p=(b,x)=>{h||(h=!0,o({url:u,width:b,height:x}))};m.onload=()=>p(m.naturalWidth||void 0,m.naturalHeight||void 0),m.onerror=()=>p(),m.src=u,setTimeout(()=>p(),5e3)}};requestAnimationFrame(a),e.type.startsWith("image/")||(i=!0,setTimeout(()=>r(new Error("Not an image file")),30))})}function cu(e,t){return new Promise(o=>{const r=ll(t),l=new AbortController;Tn(e,{status:"pending",progress:0,file:t,tempPreviewUrl:r,controller:l});let s,i;if(typeof document<"u"){const a=document.createElement("img");let c=!1;const d=()=>{c||(c=!0,s=a.naturalWidth||void 0,i=a.naturalHeight||void 0)};a.onload=d,a.onerror=d,a.src=r,setTimeout(d,4e3)}try{ns(t.name,t,l,{onProgress:a=>{const c=to(e);if(!c)return;const d=Math.max(0,Math.min(1,Number.isFinite(a)?a:0));Tn(e,{...c,progress:d})},onSuccess:a=>{const c=to(e);if(c!=null&&c.tempPreviewUrl&&c.tempPreviewUrl!==a.url){try{URL.revokeObjectURL(c.tempPreviewUrl)}catch{}es.delete(c.tempPreviewUrl)}Tn(e,null),o({ok:!0,value:{url:a.url,width:a.width??s,height:a.height??i,alt:a.alt,title:a.title,fileId:a.fileId}})},onError:a=>{const c=to(e);Tn(e,{status:"error",progress:0,error:a,file:(c==null?void 0:c.file)??t,tempPreviewUrl:c==null?void 0:c.tempPreviewUrl}),o({ok:!1,error:a})}})}catch(a){const c=a instanceof Error?a.message:String(a);Tn(e,{status:"error",progress:0,error:c,file:t,tempPreviewUrl:r}),o({ok:!1,error:c})}})}async function sl(e,t){if(!e)return null;try{if(e.startsWith("data:"))return du(e,t);const o=await fetch(e);if(!o.ok)return null;const r=await o.blob(),l=os(r.type,e),s=t?rs(t,l):`image-${Date.now()}${l}`;return new File([r],s,{type:r.type||"image/png"})}catch{return null}}function du(e,t){const o=e.match(/^data:([^;,]+)?(;base64)?,(.*)$/);if(!o)return null;const[,r,l,s]=o,i=r||"image/png",a=!!l;let c;if(a){const m=atob(s);c=new Uint8Array(m.length);for(let h=0;h<m.length;h++)c[h]=m.charCodeAt(h)}else{const m=decodeURIComponent(s);c=new TextEncoder().encode(m)}const d=os(i,e),f=t?rs(t,d):`image-${Date.now()}${d}`,u=new Blob([c],{type:i});return new File([u],f,{type:i})}function os(e,t){if(e.includes("png"))return".png";if(e.includes("jpeg")||e.includes("jpg"))return".jpg";if(e.includes("gif"))return".gif";if(e.includes("webp"))return".webp";if(e.includes("svg"))return".svg";if(e.includes("bmp"))return".bmp";const o=t.match(/\.(png|jpe?g|gif|webp|svg|bmp)$/i);return o?`.${o[1].toLowerCase()}`:".png"}function rs(e,t){return e.toLowerCase().endsWith(t.toLowerCase())?e:e+t}const uu=["data-block-id","data-empty","data-placeholder","contenteditable"],Kn=n.defineComponent({__name:"BlockContent",props:{block:{},placeholder:{}},emits:["slashTrigger","inputChanged","linkClick","focusIn"],setup(e,{emit:t}){const o=e,r=t,l=dn(),s=Vn(),i=n.ref(null),a=n.shallowRef(!1);function c(){return Me(o.block.content).length===0}const d=n.ref(c());n.onMounted(()=>{const _=i.value;if(!_)return;const I=Me(o.block.content);Vi(o.block.content)?_.innerHTML=eo(o.block.content):_.textContent=I,d.value=I.length===0});function f(_){const I=window.getSelection();if(!I||I.rangeCount===0)return null;const S=I.getRangeAt(0);if(!_.contains(S.commonAncestorContainer))return null;const $=document.createRange();$.selectNodeContents(_),$.setEnd(S.startContainer,S.startOffset);const N=$.toString().length;$.setEnd(S.endContainer,S.endOffset);const E=$.toString().length;return{from:Math.min(N,E),to:Math.max(N,E)}}function u(_,I){const S=document.createTreeWalker(_,NodeFilter.SHOW_TEXT);let $=Math.max(0,I),N=null;for(;S.nextNode();){const E=S.currentNode;N=E;const T=(E.nodeValue??"").length;if($<=T)return{node:E,offset:$};$-=T}return N?{node:N,offset:(N.nodeValue??"").length}:{node:_,offset:0}}function m(_,I,S){const $=window.getSelection();if(!$)return;const N=u(_,I),E=u(_,Math.max(I,S));try{const T=document.createRange();I<=S?(T.setStart(N.node,N.offset),T.setEnd(E.node,E.offset)):(T.setStart(E.node,E.offset),T.setEnd(N.node,N.offset)),$.removeAllRanges(),$.addRange(T)}catch{try{const T=document.createRange();T.setStart(E.node,E.offset),T.collapse(!0),$.removeAllRanges(),$.addRange(T)}catch{}}}n.watch(()=>o.block,_=>{if(a.value)return;const I=i.value;if(!I)return;const S=f(I),$=S&&S.from!==S.to,N=document.activeElement===I,E=Me(_.content),T=E.length===0;let R=!1;if(T)I.childNodes.length>0&&(I.textContent="",R=!0);else{const Y=Vi(_.content),ae=!!I.querySelector(Md);if(!Y&&!ae)I.textContent!==E&&(I.textContent=E,R=!0);else{const ie=Ui(gn(I)),pe=Ui(_.content);ie!==pe&&(I.innerHTML=eo(_.content),R=!0)}}d.value=T,R&&S&&(N||$)&&m(I,S.from,S.to)});function h(_){_.key==="Enter"&&!_.shiftKey&&!_.isComposing&&_.preventDefault()}function p(_){var R,Y;if(!s.value)return;const I=i.value;if(!I)return;const S=gn(I),$=Me(S);if(d.value=$.length===0,r("inputChanged",o.block.id,$),a.value||vd({editor:l,registry:l.registries.inputRules,blockId:o.block.id,text:$}))return;if(Cd($)){const ae=$.match(/\/([^/]*)$/),ie=$.lastIndexOf("/"),pe=ae&&ae[1]!==void 0?ae[1]:ie>=0?$.slice(ie+1):"";r("slashTrigger",I,o.block.id,pe)}let E=S;l.registries.schema.get(o.block.type).inlineMarks&&_.data&&/\s/.test(_.data)&&(E=ur(S)),(Y=(R=l.commands).setText)==null||Y.call(R,{id:o.block.id,content:E})}function b(_){a.value=!0}function x(_){var T,R;if(a.value=!1,!s.value)return;const I=i.value;if(!I)return;const S=gn(I),$=Me(S);d.value=$.length===0,r("inputChanged",o.block.id,$);const E=l.registries.schema.get(o.block.type).inlineMarks?ur(S):S;(R=(T=l.commands).setText)==null||R.call(T,{id:o.block.id,content:E})}function O(){const _=i.value;if(!_)return null;const I=window.getSelection();if(!I||I.rangeCount===0)return null;const S=I.getRangeAt(0);if(!_.contains(S.commonAncestorContainer))return null;const $=Me(o.block.content),N=document.createRange();N.selectNodeContents(_),N.setEnd(S.startContainer,S.startOffset);const E=Math.min(N.toString().length,$.length);N.setEnd(S.endContainer,S.endOffset);const T=Math.min(N.toString().length,$.length);return[Math.min(E,T),Math.max(E,T)]}function z(_){var Y,ae;const I=O();if(!I)return;const[S,$]=I;if(S===$)return;const[,N]=Ut(o.block.content,S),[E]=Ut(N,$-S),T=Me(E),R=eo(E);_.preventDefault(),(Y=_.clipboardData)==null||Y.setData("text/plain",T),(ae=_.clipboardData)==null||ae.setData("text/html",R)}function F(_){var ie,pe,re,le;if(!s.value){_.preventDefault();return}const I=O();if(!I)return;const[S,$]=I;if(S===$)return;const[N,E]=Ut(o.block.content,S),[T,R]=Ut(E,$-S),Y=Me(T),ae=eo(T);_.preventDefault(),(ie=_.clipboardData)==null||ie.setData("text/plain",Y),(pe=_.clipboardData)==null||pe.setData("text/html",ae),(le=(re=l.commands).setText)==null||le.call(re,{id:o.block.id,content:[...N,...R],selectionAfter:Qe(o.block.id,S)})}const j=gd();function P(_){const I=[],S=new Set;if(_.items&&_.items.length>0)for(let $=0;$<_.items.length;$++){const N=_.items[$];if(N.kind!=="file")continue;const E=N.getAsFile();if(!E||!E.type.startsWith("image/"))continue;const T=`${E.name||""}:${E.size}:${E.type}`;S.has(T)||(S.add(T),I.push(E))}if(_.files&&_.files.length>0)for(let $=0;$<_.files.length;$++){const N=_.files[$];if(!N.type.startsWith("image/"))continue;const E=`${N.name||""}:${N.size}:${N.type}`;S.has(E)||(S.add(E),I.push(N))}return I}async function U(_){var At,nn,Gt,Ot,qe,bt,It,Je,Le,mt,fe,_t,Ve,_e,Ft,Ct,Et,je,ce,D,M,X,Oe,Ne,Ie,Qt,St,_n,Ln,Mn,ze,ot;if(!s.value){_.preventDefault();return}const I=_.clipboardData;if(!I)return;if(j){const De=P(I);if(De.length>0){_.preventDefault();let We=o.block.id;for(let st=0;st<De.length;st++){const at=De[st],et=await j(at,{relativeToBlockId:We,convertIfEmpty:st===0,position:"after"});et&&(We=et)}return}}const S=I.getData("text/html"),$=I.getData("text/plain"),N=Qd(S||null,$||null);if(N.length===0)return;const E=N.some(De=>De.type==="image"),T=O(),R=Me(o.block.content).length,Y=T?T[0]:R,ae=T?T[1]:R,[ie]=Ut(o.block.content,Y),[,pe]=Ut(o.block.content,ae),re=l.registries.schema.get(o.block.type),le=De=>re.inlineMarks?De:De.map(We=>({type:"text",text:We.text}));if(!E){if(N.length===1){const st=le(N[0].content);if(re.inlineMarks&&Y<ae&&st.length===1&&st[0].type==="text"&&!st[0].marks){const ht=st[0].text;if(Zr(ht)){const Jt=ro(ht),$t=Un(Jt);if($t){(nn=(At=l.commands).setLink)==null||nn.call(At,{id:o.block.id,href:$t,from:Y,to:ae});return}}}const at=[...ie,...st,...pe],et=re.inlineMarks?ur(at):at,Tt=Me(ie).length,rt=Me(st).length,dt=Tt+rt;(Ot=(Gt=l.commands).setText)==null||Ot.call(Gt,{id:o.block.id,content:et,selectionAfter:Qe(o.block.id,dt)});return}const De=[...ie,...le(N[0].content)];(bt=(qe=l.commands).setText)==null||bt.call(qe,{id:o.block.id,content:De});let We=o.block.id;for(let st=1;st<N.length;st++){const at=N[st],et=st===N.length-1,Tt=le(at.content),rt=et?[...Tt,...pe]:Tt,dt=l.registries.schema.coerceAttrsFor(at.type,at.attrs);(Je=(It=l.commands).insertBlock)==null||Je.call(It,{after:We,type:at.type,attrs:dt,content:rt});const ht=l.getState();if(ht.selection.kind==="caret"&&(We=ht.selection.blockId),et){const Jt=Me(Tt).length,$t=pe.length>0?Jt:Me(rt).length;(mt=(Le=l.commands).setSelection)==null||mt.call(Le,{selection:Qe(We,$t)})}}return}if(!j){const De=N.filter(We=>We.type!=="image");if(De.length===0)return;if(N.splice(0,N.length,...De),N.length===1){const We=le(N[0].content),st=[...ie,...We,...pe];(_t=(fe=l.commands).setText)==null||_t.call(fe,{id:o.block.id,content:st,selectionAfter:Qe(o.block.id,Me(ie).length+Me(We).length)})}return}let xe=-1;for(let De=N.length-1;De>=0;De--)if(N[De].type!=="image"){xe=De;break}let Ae=o.block.id;const Xe=N[0];if(Xe.type!=="image"){const We=xe===0?[...ie,...le(Xe.content),...pe]:[...ie,...le(Xe.content)];(_e=(Ve=l.commands).setText)==null||_e.call(Ve,{id:o.block.id,content:We}),Ae=o.block.id}else{const De=ie.length===0&&pe.length===0,We=Xe.attrs.src,st=Xe.attrs.alt??"";if(De){const at=await sl(We,st||void 0);if(at){const et=await j(at,{relativeToBlockId:Ae,position:"after",convertIfEmpty:!0});et&&(Ae=et)}else{const et=l.registries.schema.coerceAttrsFor(Xe.type,Xe.attrs);(Ct=(Ft=l.commands).replaceBlock)==null||Ct.call(Ft,{id:o.block.id,type:Xe.type,attrs:et}),Ae=o.block.id}}else{(je=(Et=l.commands).setText)==null||je.call(Et,{id:o.block.id,content:ie});const at=await sl(We,st||void 0);if(at){const et=await j(at,{relativeToBlockId:Ae,position:"after",convertIfEmpty:!1});et&&(Ae=et)}else{const et=l.registries.schema.coerceAttrsFor(Xe.type,Xe.attrs);(D=(ce=l.commands).insertBlock)==null||D.call(ce,{after:Ae,type:Xe.type,attrs:et,content:[]});const Tt=l.getState();Tt.selection.kind==="caret"&&(Ae=Tt.selection.blockId)}}}for(let De=1;De<N.length;De++){const We=N[De],st=De===xe;if(We.type==="image"){const at=We.attrs.src,et=We.attrs.alt??"",Tt=await sl(at,et||void 0);if(Tt){const rt=await j(Tt,{relativeToBlockId:Ae,position:"after",convertIfEmpty:!1});rt&&(Ae=rt)}else{const rt=l.registries.schema.coerceAttrsFor(We.type,We.attrs);(X=(M=l.commands).insertBlock)==null||X.call(M,{after:Ae,type:We.type,attrs:rt,content:[]});const dt=l.getState();dt.selection.kind==="caret"&&(Ae=dt.selection.blockId)}}else{const at=le(We.content),et=st?[...at,...pe]:at,Tt=l.registries.schema.coerceAttrsFor(We.type,We.attrs);(Ne=(Oe=l.commands).insertBlock)==null||Ne.call(Oe,{after:Ae,type:We.type,attrs:Tt,content:et});const rt=l.getState();if(rt.selection.kind==="caret"&&(Ae=rt.selection.blockId),st){const dt=Me(at).length,ht=pe.length>0?dt:Me(et).length;(Qt=(Ie=l.commands).setSelection)==null||Qt.call(Ie,{selection:Qe(Ae,ht)})}}}if(xe===-1&&pe.length>0){(_n=(St=l.commands).insertBlock)==null||_n.call(St,{after:Ae,type:"paragraph",attrs:{},content:pe});const De=l.getState();De.selection.kind==="caret"&&(Ae=De.selection.blockId,(Mn=(Ln=l.commands).setSelection)==null||Mn.call(Ln,{selection:Qe(Ae,Me(pe).length)}))}else xe===-1&&(ie.length>0||pe.length>0)&&((ot=(ze=l.commands).insertBlock)==null||ot.call(ze,{after:Ae,type:"paragraph",attrs:{},content:[]}))}function te(){r("focusIn",o.block.id)}function W(){}function J(_){return document.createTreeWalker(_,NodeFilter.SHOW_TEXT).nextNode()}function A(_){var T;const I=_.target;if(!I)return;const S=I.closest("a");if(!S||!((T=i.value)!=null&&T.contains(S)))return;_.preventDefault();const $=window.getSelection();let N=0;if($&&$.rangeCount>0&&!!S.contains($.getRangeAt(0).commonAncestorContainer)){const R=$.getRangeAt(0),Y=document.createRange();Y.selectNodeContents(i.value),Y.setEnd(R.startContainer,R.startOffset),N=Y.toString().length}else{const R=J(S);if(R){const Y=document.createRange();Y.selectNodeContents(i.value),Y.setEnd(R,0),N=Y.toString().length}}r("linkClick",o.block.id,N)}return(_,I)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"el",ref:i,class:"block-content","data-block-id":e.block.id,"data-empty":d.value,"data-placeholder":e.placeholder,contenteditable:n.unref(s),spellcheck:"false",onInput:p,onCompositionstart:b,onCompositionend:x,onFocus:te,onBlur:W,onKeydown:h,onClick:A,onPaste:n.withModifiers(U,["prevent"]),onCopy:z,onCut:F},null,40,uu))}});function ls(e){return e==="zh-CN"||e===null||e===void 0||e===""?"zh-CN":"en-US"}function is(e){return e==="dark"?"dark":"light"}const fu={"zh-CN":{"editor.placeholder":"输入文字,或按 '/' 获取命令…","handle.plus.title":"点击添加块","handle.plus.ariaLabel":"Insert block below","handle.grip.title":"拖拽移动 / 点击设置","handle.grip.ariaLabel":"Drag to move block, click to open settings","ui.scrollUp":"向上滚动","ui.scrollDown":"向下滚动","ui.scrollLeft":"向左","ui.scrollRight":"向右","plus.category.basic":"基本区块","plus.category.list":"列表","plus.category.other":"其他","plus.noMatch":"未找到匹配的命令","plus.searchPlaceholder":"搜索命令…","slash.paragraph.title":"正文","slash.paragraph.description":"普通文本段落。","slash.heading1.title":"一级标题","slash.heading1.description":"用于文章的主标题。","slash.heading2.title":"二级标题","slash.heading2.description":"用于主要章节的标题。","slash.heading3.title":"三级标题","slash.heading3.description":"用于子章节的标题。","slash.heading4.title":"四级标题","slash.heading4.description":"用于更细分层的标题。","slash.heading5.title":"五级标题","slash.heading5.description":"用于较小层级的标题。","slash.heading6.title":"六级标题","slash.heading6.description":"用于最小层级的标题。","slash.bulletList.title":"项目符号列表","slash.bulletList.description":"创建一个无序列表。","slash.orderedList.title":"编号列表","slash.orderedList.description":"创建一个带编号的有序列表。","slash.todoList.title":"待办列表","slash.todoList.description":"用复选框追踪待办任务。","slash.quote.title":"引用","slash.quote.description":"引用一段话。","slash.codeBlock.title":"代码块","slash.codeBlock.description":"插入一段代码块。","codeBlock.title":"代码块","slash.divider.title":"分隔符","slash.divider.description":"插入一条水平分隔线。","slash.image.title":"图片","slash.image.description":"插入一张图片(从本地上传或选择文件)。","slash.table3x3.title":"表格(3×3)","slash.table3x3.description":"插入一个 3 行 3 列的表格。","slash.table2x2.title":"表格(2×2)","slash.table2x2.description":"插入一个 2 行 2 列的表格。","slash.table4x4.title":"表格(4×4)","slash.table4x4.description":"插入一个 4 行 4 列的表格。","bsm.section.turnInto":"转换为","bsm.section.alignIndent":"对齐与缩进","bsm.section.align":"对齐","bsm.section.indent":"缩进","bsm.section.action":"操作","bsm.section.textColor":"文字颜色","bsm.section.bgColor":"背景颜色","bsm.indent.decrease":"减少缩进","bsm.indent.increase":"增加缩进","turnInto.paragraph":"正文","turnInto.h1":"一级标题","turnInto.h2":"二级标题","turnInto.h3":"三级标题","turnInto.h4":"四级标题","turnInto.h5":"五级标题","turnInto.h6":"六级标题","turnInto.bullet":"项目符号","turnInto.ordered":"编号列表","turnInto.todo":"待办","turnInto.quote":"引用","turnInto.code":"代码块","align.left":"左对齐","align.center":"居中","align.right":"右对齐","align.justify":"两端对齐","verticalAlign.top":"顶端对齐","verticalAlign.middle":"垂直居中","verticalAlign.bottom":"底端对齐","hoverToolbar.verticalAlignBtnTitle":"垂直对齐","action.duplicate":"复制","action.copy":"拷贝","action.cut":"剪切","action.moveUp":"上移","action.moveDown":"下移","action.delete":"删除","ol.continue":"继续之前的编号","ol.startNew":"开始新列表(从1开始)","ol.modify":"修改编号值…","numberPicker.title":"修改编号值","numberPicker.inputLabel":"编号值","numberPicker.confirm":"确定","codeLang.title":"设置代码类型","codeLang.inputLabel":"代码类型","codeLang.placeholder":"请输入代码类型","codeLang.confirm":"确定","codeLang.custom":"自定义…","codeLang.cancel":"取消","codeLang.plain":"纯文本","hoverToolbar.label":"格式化","hoverToolbar.typeBtnTitle":"切换块类型","hoverToolbar.alignBtnTitle":"对齐方式","hoverToolbar.colorBtnTitle":"颜色","hoverToolbar.textColor":"文字颜色","hoverToolbar.bgColor":"背景颜色","hoverToolbar.copySelection":"复制选中文本","hoverToolbar.deleteBlock":"删除块","mark.bold":"加粗","mark.italic":"斜体","mark.underline":"下划线","mark.strikethrough":"删除线","mark.inlineCode":"行内代码","mark.link":"链接","link.popoverLabel":"链接","link.open":"打开链接","link.copy":"复制链接","link.edit":"编辑链接","link.remove":"移除链接","link.save":"保存","link.cancel":"取消","link.urlPlaceholder":"输入链接地址…","link.textPlaceholder":"链接文本…","link.emptyUrl":"(空链接)","link.invalidUrl":"请输入有效的链接地址","hoverToolbar.linkBtnTitle":"链接","color.default":"默认","color.gray":"灰色","color.brown":"棕色","color.orange":"橙色","color.yellow":"黄色","color.green":"绿色","color.blue":"蓝色","color.purple":"紫色","color.pink":"粉色","color.red":"红色","color.none":"无","image.uploading":"正在上传图片…","image.uploadFailed":"上传失败","image.loadFailed":"图片加载失败","image.retry":"重试","image.replace":"替换图片","image.remove":"删除图片","image.resize":"拖拽调整尺寸","image.emptyTitle":"点击上传图片","image.emptySub":"或拖入图片文件到此处","image.captionPlaceholder":"添加图片说明…","turnInto.image":"图片","table.title":"表格","table.cellPlaceholder":"输入内容…","table.resizeCol":"拖拽调整列宽","table.rowActions":"行操作","table.colActions":"列操作","table.selectRow":"选择此行","table.selectCol":"选择此列","table.selectAll":"选择整个表格","table.insertRowAbove":"在上方插入行","table.insertRowBelow":"在下方插入行","table.insertColLeft":"在左侧插入列","table.insertColRight":"在右侧插入列","table.removeRow":"删除此行","table.removeCol":"删除此列","table.deleteRow":"删除行","table.deleteCol":"删除列","table.toggleHeader":"切换表头行","table.mergeCells":"合并单元格","table.splitCell":"拆分单元格","table.deleteTable":"删除表格","turnInto.table":"表格","toc.title":"目录","toc.empty":"暂无标题","slash.tableOfContents.title":"目录","slash.tableOfContents.description":"插入文档目录。","slash.equation.title":"公式","slash.equation.description":"插入数学公式(LaTeX)","turnInto.equation":"公式","equation.placeholder":"输入数学公式...","equation.invalid":"公式无法解析","equation.edit":"编辑公式"},"en-US":{"editor.placeholder":"Type '/' for commands...","handle.plus.title":"Insert block below","handle.plus.ariaLabel":"Insert block below","handle.grip.title":"Drag to move / click for settings","handle.grip.ariaLabel":"Drag to move block, click to open settings","ui.scrollUp":"Scroll up","ui.scrollDown":"Scroll down","ui.scrollLeft":"Scroll left","ui.scrollRight":"Scroll right","plus.category.basic":"Basic blocks","plus.category.list":"Lists","plus.category.other":"Other","plus.noMatch":"No matching commands","plus.searchPlaceholder":"Search commands...","slash.paragraph.title":"Paragraph","slash.paragraph.description":"Plain text paragraph.","slash.heading1.title":"Heading 1","slash.heading1.description":"Main title for the document.","slash.heading2.title":"Heading 2","slash.heading2.description":"Title for major sections.","slash.heading3.title":"Heading 3","slash.heading3.description":"Title for sub-sections.","slash.heading4.title":"Heading 4","slash.heading4.description":"Title for finer hierarchy levels.","slash.heading5.title":"Heading 5","slash.heading5.description":"Title for smaller hierarchy levels.","slash.heading6.title":"Heading 6","slash.heading6.description":"Title for the smallest hierarchy level.","slash.bulletList.title":"Bullet list","slash.bulletList.description":"Create an unordered list.","slash.orderedList.title":"Numbered list","slash.orderedList.description":"Create a numbered ordered list.","slash.todoList.title":"To-do list","slash.todoList.description":"Track tasks with checkboxes.","slash.quote.title":"Quote","slash.quote.description":"Quote a passage of text.","slash.codeBlock.title":"Code block","slash.codeBlock.description":"Insert a code block.","codeBlock.title":"Code block","slash.divider.title":"Divider","slash.divider.description":"Insert a horizontal divider line.","slash.image.title":"Image","slash.image.description":"Insert an image (upload or choose a file).","slash.table3x3.title":"Table (3×3)","slash.table3x3.description":"Insert a 3-row 3-column table.","slash.table2x2.title":"Table (2×2)","slash.table2x2.description":"Insert a 2-row 2-column table.","slash.table4x4.title":"Table (4×4)","slash.table4x4.description":"Insert a 4-row 4-column table.","bsm.section.turnInto":"Turn into","bsm.section.alignIndent":"Align & Indent","bsm.section.align":"Align","bsm.section.indent":"Indent","bsm.section.action":"Actions","bsm.section.textColor":"Text color","bsm.section.bgColor":"Background color","bsm.indent.decrease":"Decrease indent","bsm.indent.increase":"Increase indent","turnInto.paragraph":"Paragraph","turnInto.h1":"Heading 1","turnInto.h2":"Heading 2","turnInto.h3":"Heading 3","turnInto.h4":"Heading 4","turnInto.h5":"Heading 5","turnInto.h6":"Heading 6","turnInto.bullet":"Bullet list","turnInto.ordered":"Numbered list","turnInto.todo":"To-do","turnInto.quote":"Quote","turnInto.code":"Code block","align.left":"Align left","align.center":"Center","align.right":"Align right","align.justify":"Justify","verticalAlign.top":"Align top","verticalAlign.middle":"Vertical center","verticalAlign.bottom":"Align bottom","hoverToolbar.verticalAlignBtnTitle":"Vertical align","action.duplicate":"Duplicate","action.copy":"Copy","action.cut":"Cut","action.moveUp":"Move up","action.moveDown":"Move down","action.delete":"Delete","ol.continue":"Continue previous numbering","ol.startNew":"Start a new list (from 1)","ol.modify":"Modify starting number...","numberPicker.title":"Modify number value","numberPicker.inputLabel":"Number value","numberPicker.confirm":"Confirm","codeLang.title":"Set code language","codeLang.inputLabel":"Code language","codeLang.placeholder":"Enter code language","codeLang.confirm":"Confirm","codeLang.custom":"Custom…","codeLang.cancel":"Cancel","codeLang.plain":"Plain text","hoverToolbar.label":"Formatting","hoverToolbar.typeBtnTitle":"Switch block type","hoverToolbar.alignBtnTitle":"Alignment","hoverToolbar.colorBtnTitle":"Color","hoverToolbar.textColor":"Text color","hoverToolbar.bgColor":"Background color","hoverToolbar.copySelection":"Copy selection","hoverToolbar.deleteBlock":"Delete block","mark.bold":"Bold","mark.italic":"Italic","mark.underline":"Underline","mark.strikethrough":"Strikethrough","mark.inlineCode":"Inline code","mark.link":"Link","link.popoverLabel":"Link","link.open":"Open link","link.copy":"Copy link","link.edit":"Edit link","link.remove":"Remove link","link.save":"Save","link.cancel":"Cancel","link.urlPlaceholder":"Enter URL...","link.textPlaceholder":"Link text...","link.emptyUrl":"(empty link)","link.invalidUrl":"Please enter a valid URL","hoverToolbar.linkBtnTitle":"Link","hoverToolbar.linkPrompt":"Enter URL:","color.default":"Default","color.gray":"Gray","color.brown":"Brown","color.orange":"Orange","color.yellow":"Yellow","color.green":"Green","color.blue":"Blue","color.purple":"Purple","color.pink":"Pink","color.red":"Red","color.none":"None","image.uploading":"Uploading image...","image.uploadFailed":"Upload failed","image.loadFailed":"Failed to load image","image.retry":"Retry","image.replace":"Replace image","image.remove":"Remove image","image.resize":"Drag to resize","image.emptyTitle":"Click to upload an image","image.emptySub":"or drag an image file here","image.captionPlaceholder":"Add a caption...","turnInto.image":"Image","table.title":"Table","table.cellPlaceholder":"Type here...","table.resizeCol":"Drag to resize column","table.rowActions":"Row actions","table.colActions":"Column actions","table.selectRow":"Select row","table.selectCol":"Select column","table.selectAll":"Select entire table","table.insertRowAbove":"Insert row above","table.insertRowBelow":"Insert row below","table.insertColLeft":"Insert column left","table.insertColRight":"Insert column right","table.removeRow":"Delete row","table.removeCol":"Delete column","table.deleteRow":"Delete row","table.deleteCol":"Delete column","table.toggleHeader":"Toggle header row","table.mergeCells":"Merge cells","table.splitCell":"Split cell","table.deleteTable":"Delete table","turnInto.table":"Table","toc.title":"Table of Contents","toc.empty":"No headings","slash.tableOfContents.title":"Table of Contents","slash.tableOfContents.description":"Insert a table of contents.","slash.equation.title":"Equation","slash.equation.description":"Insert a math formula (LaTeX)","turnInto.equation":"Equation","equation.placeholder":"Type a formula...","equation.invalid":"Invalid equation","equation.edit":"Edit formula"}},ss=Symbol("be-locale"),as=Symbol("be-theme");function pu(e,t){n.provide(ss,e),n.provide(as,t)}function Zt(){const e=n.inject(ss,n.ref("zh-CN")),t=n.inject(as,n.ref("light"));return{get locale(){return e.value},get theme(){return t.value},t(o){const l=fu[e.value][o];return typeof l=="string"?l:o}}}const mu=["title","aria-label","onKeydown"],hu=["title","aria-label","onKeydown"],gu=4,bu=300,ku=n.defineComponent({__name:"BlockHandle",props:{blockId:{},visible:{type:Boolean}},emits:["openPlusMenu","openSettingsMenu","gripPointerDown","gripPointerUp"],setup(e,{expose:t,emit:o}){const r=e,l=o,{t:s}=Zt(),i=Vn(),a=n.ref(null),c=n.ref(null),d=n.ref(null),f=n.ref(!1),u=n.ref(!1),m=n.ref(null);let h=null;const p=n.computed(()=>m.value===null?void 0:{top:`${m.value}px`});function b(){var $;const _=($=a.value)==null?void 0:$.parentElement;if(!_)return null;const I=_.querySelector(".block-host-content");if(!I)return null;const S=I.firstElementChild;return S instanceof HTMLElement?S:I}function x(){var N;const _=(N=a.value)==null?void 0:N.parentElement,I=b();if(!_||!I)return;const S=_.getBoundingClientRect(),$=I.getBoundingClientRect();m.value=$.top-S.top+$.height/2}function O(){const _=b();_&&(z(),h=new ResizeObserver(()=>x()),h.observe(_))}function z(){h==null||h.disconnect(),h=null}n.watch(()=>r.visible,_=>{_?n.nextTick().then(()=>{x(),O()}):z()}),n.onMounted(x),n.onBeforeUnmount(z);function F(){i.value&&c.value&&l("openPlusMenu",c.value)}let j=0,P=0,U=0,te=!1;function W(_){i.value&&(U=Date.now(),j=_.clientX,P=_.clientY,te=!0,u.value=!1,l("gripPointerDown",r.blockId,j,P,{thresholdPx:gu}))}function J(_){u.value=_}function A(){i.value&&(u.value||te&&Date.now()-U>bu||(te=!1,d.value&&l("openSettingsMenu",d.value)))}return t({isOpen:f,insertBtn:c,gripBtn:d,setLocalDragging:J}),(_,I)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"handleEl",ref:a,class:n.normalizeClass(["block-handle",{visible:e.visible,dragging:u.value}]),style:n.normalizeStyle(p.value)},[n.createElementVNode("div",{ref_key:"insertBtn",ref:c,class:"handle-btn handle-insert",role:"button",tabindex:"0",title:n.unref(s)("handle.plus.title"),"aria-label":n.unref(s)("handle.plus.ariaLabel"),onMousedown:n.withModifiers(F,["prevent","stop"]),onKeydown:[n.withKeys(n.withModifiers(F,["prevent","stop"]),["enter"]),n.withKeys(n.withModifiers(F,["prevent","stop"]),["space"])]},[...I[0]||(I[0]=[n.createElementVNode("svg",{viewBox:"0 0 16 16",width:"16",height:"16","aria-hidden":"true"},[n.createElementVNode("path",{d:"M8 3.5V12.5M3.5 8H12.5",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"})],-1)])],40,mu),n.createElementVNode("div",{ref_key:"gripBtn",ref:d,class:"handle-btn handle-grip",role:"button",tabindex:"0",title:n.unref(s)("handle.grip.title"),"aria-label":n.unref(s)("handle.grip.ariaLabel"),onMousedown:n.withModifiers(W,["prevent","stop"]),onClick:n.withModifiers(A,["stop"]),onKeydown:[n.withKeys(n.withModifiers(A,["prevent","stop"]),["enter"]),n.withKeys(n.withModifiers(A,["prevent","stop"]),["space"])]},[...I[1]||(I[1]=[n.createStaticVNode('<svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><circle cx="5" cy="4" r="1.3" fill="currentColor"></circle><circle cx="11" cy="4" r="1.3" fill="currentColor"></circle><circle cx="5" cy="8" r="1.3" fill="currentColor"></circle><circle cx="11" cy="8" r="1.3" fill="currentColor"></circle><circle cx="5" cy="12" r="1.3" fill="currentColor"></circle><circle cx="11" cy="12" r="1.3" fill="currentColor"></circle></svg>',1)])],40,hu)],6))}}),yu=["data-block-id","data-block-type"],wu={class:"block-host-content"},cs=n.defineComponent({__name:"BlockHost",props:{block:{},placeholder:{},hoveredBlockId:{},focusedBlockId:{},hasTextSelection:{type:Boolean},draggingBlockId:{},dropTargetBlockId:{},dropPosition:{},menuOpenBlockId:{}},emits:["openSettingsMenu","openPlusMenu","slashTrigger","inputChanged","hoverChange","gripPointerDown","gripPointerUp","linkClick","focusIn"],setup(e,{expose:t,emit:o}){const r=e,l=o,s=dn(),i=Vn(),a=n.ref(null),c=n.ref(null),d=n.computed(()=>!i.value||r.hasTextSelection?!1:r.hoveredBlockId===r.block.id||r.hoveredBlockId===null&&r.focusedBlockId===r.block.id),f=n.computed(()=>r.draggingBlockId===r.block.id),u=n.computed(()=>r.menuOpenBlockId===r.block.id),m=n.computed(()=>r.dropTargetBlockId===r.block.id),h=n.computed(()=>r.dropPosition??"after");function p(A,_,I,S){l("gripPointerDown",A,_,I,S)}function b(A){l("gripPointerUp",A)}function x(A){var _,I;(I=(_=c.value)==null?void 0:_.setLocalDragging)==null||I.call(_,A)}function O(){l("hoverChange",r.block.id)}function z(){l("hoverChange",null)}function F(A){l("openPlusMenu",r.block.id,A)}function j(A){l("openSettingsMenu",r.block.id,A)}function P(A,_,I){l("slashTrigger",A,r.block.id,I)}function U(A,_){l("inputChanged",A,_)}function te(A,_){l("linkClick",A,_)}function W(A){l("focusIn",A)}const J=n.computed(()=>{const A=s.registries.renderers.get(r.block.type);return A!=null&&A.component?A.component:Kn});return t({setHandleDragging:x}),(A,_)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"hostEl",ref:a,class:n.normalizeClass(["block-host",{"block-dragging":f.value,"block-menu-active":u.value,"block-drop-target":m.value,"block-drop-before":m.value&&h.value==="before","block-drop-after":m.value&&h.value==="after","block-drop-into":m.value&&h.value==="into","block-host-readonly":!n.unref(i),"block-focused":e.focusedBlockId===e.block.id}]),"data-block-id":e.block.id,"data-block-type":e.block.type,onMouseenter:O,onMouseleave:z},[n.unref(i)?(n.openBlock(),n.createBlock(ku,{key:0,ref_key:"handleRef",ref:c,"block-id":e.block.id,visible:d.value,onOpenPlusMenu:F,onOpenSettingsMenu:j,onGripPointerDown:p,onGripPointerUp:b},null,8,["block-id","visible"])):n.createCommentVNode("",!0),n.createElementVNode("div",wu,[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(J.value),{block:e.block,placeholder:e.placeholder,onSlashTrigger:P,onInputChanged:U,onLinkClick:te,onFocusIn:W},null,40,["block","placeholder"]))])],42,yu))}}),ds=n.defineComponent({__name:"BlockList",props:{items:{},blocksMap:{},firstBlockPlaceholder:{},isNested:{type:Boolean},hoveredBlockId:{},focusedBlockId:{},hasTextSelection:{type:Boolean},draggingBlockId:{},dropTargetBlockId:{},dropPosition:{},menuOpenBlockId:{}},emits:["openSettingsMenu","openPlusMenu","slashTrigger","inputChanged","hoverChange","gripPointerDown","gripPointerUp","linkClick","focusIn"],setup(e,{expose:t,emit:o}){const r=e,l=o,s=new Map;function i(P,U){U?s.set(P,U):s.delete(P)}function a(P,U){var te,W;(W=(te=s.get(P))==null?void 0:te.setHandleDragging)==null||W.call(te,U)}function c(P){const U=[];for(const te of P.children){const W=r.blocksMap.get(te);W&&U.push({id:te,block:W})}return U}const d=n.computed(()=>!r.isNested&&!r.dropTargetBlockId&&r.dropPosition==="first"&&!!r.draggingBlockId),f=n.computed(()=>!r.isNested&&!r.dropTargetBlockId&&r.dropPosition==="last"&&!!r.draggingBlockId);function u(P,U){l("openSettingsMenu",P,U)}function m(P,U){l("openPlusMenu",P,U)}function h(P,U,te){l("slashTrigger",P,U,te)}function p(P,U){l("inputChanged",P,U)}function b(P){l("hoverChange",P)}function x(){r.isNested||l("hoverChange",null)}function O(P,U,te,W){l("gripPointerDown",P,U,te,W)}function z(P){l("gripPointerUp",P)}function F(P,U){l("linkClick",P,U)}function j(P){l("focusIn",P)}return t({setBlockHandleDragging:a}),(P,U)=>{const te=n.resolveComponent("BlockList",!0);return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["block-list",{"block-children":e.isNested,"drop-indicator-first":d.value,"drop-indicator-last":f.value}]),onMouseleave:x},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.items,(W,J)=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:W.id},[n.createVNode(cs,{ref_for:!0,ref:A=>i(W.id,A),block:W.block,placeholder:!e.isNested&&J===0?e.firstBlockPlaceholder:void 0,"hovered-block-id":e.hoveredBlockId,"focused-block-id":e.focusedBlockId,"has-text-selection":e.hasTextSelection,"dragging-block-id":e.draggingBlockId,"drop-target-block-id":e.dropTargetBlockId,"drop-position":e.dropPosition,"menu-open-block-id":e.menuOpenBlockId,onOpenSettingsMenu:u,onOpenPlusMenu:m,onSlashTrigger:h,onInputChanged:p,onHoverChange:b,onGripPointerDown:O,onGripPointerUp:z,onLinkClick:F,onFocusIn:j},null,8,["block","placeholder","hovered-block-id","focused-block-id","has-text-selection","dragging-block-id","drop-target-block-id","drop-position","menu-open-block-id"]),W.block.children.length>0?(n.openBlock(),n.createBlock(te,{key:"__nested_"+W.id,"is-nested":"",items:c(W.block),"hovered-block-id":e.hoveredBlockId,"focused-block-id":e.focusedBlockId,"has-text-selection":e.hasTextSelection,"dragging-block-id":e.draggingBlockId,"drop-target-block-id":e.dropTargetBlockId,"drop-position":e.dropPosition,"menu-open-block-id":e.menuOpenBlockId,"blocks-map":e.blocksMap,onOpenSettingsMenu:U[0]||(U[0]=(A,_)=>l("openSettingsMenu",A,_)),onOpenPlusMenu:U[1]||(U[1]=(A,_)=>l("openPlusMenu",A,_)),onSlashTrigger:U[2]||(U[2]=(A,_,I)=>l("slashTrigger",A,_,I)),onInputChanged:U[3]||(U[3]=(A,_)=>l("inputChanged",A,_)),onHoverChange:U[4]||(U[4]=A=>l("hoverChange",A)),onGripPointerDown:U[5]||(U[5]=(A,_,I,S)=>l("gripPointerDown",A,_,I,S)),onGripPointerUp:U[6]||(U[6]=A=>l("gripPointerUp",A)),onLinkClick:U[7]||(U[7]=(A,_)=>l("linkClick",A,_)),onFocusIn:U[8]||(U[8]=A=>l("focusIn",A))},null,8,["items","hovered-block-id","focused-block-id","has-text-selection","dragging-block-id","drop-target-block-id","drop-position","menu-open-block-id","blocks-map"])):n.createCommentVNode("",!0)],64))),128))],34)}}});function us(e,t,o,r=6,l="auto",s=0,i=0){const a=t instanceof HTMLElement?t.getBoundingClientRect():t,c=document.documentElement.clientHeight,d=Eu(),f=Math.max(0,c-a.bottom-r-s),u=Math.max(0,a.top-r-i),m=f>=o.height+r,h=u>=o.height+r,p=l==="down"?!1:l==="up"?!0:!m&&(h||u>f);let b,x,O;const z=a.bottom+r,F=a.top-r;p?(b=Math.max(r+i,F-o.height),x=F,O=Math.max(120,u)):(b=z,x=b+o.height,O=Math.max(120,f));const j=d-o.width-r,P=Math.max(r,Math.min(j,a.left));return{top:b,left:P,above:p,availableHeight:O,bottom:x,topBaseline:z}}function al(e,t,o,r=8){const l=document.documentElement.clientHeight,s=document.documentElement.clientWidth,i=t.left+(t.width-o.width)/2,a=Math.max(r,Math.min(s-o.width-r,i)),c=l-t.bottom-r,d=t.top-r,f=c>=o.height,u=d>=o.height,m=!f&&(u||d>c),h=t.bottom+r,p=t.top-r,b=m?Math.max(r,p-o.height):h,x=m?p:b+o.height,O=m?Math.max(120,d):Math.max(120,c);return{top:b,left:a,above:m,availableHeight:O,bottom:x,topBaseline:h}}function cl(e,t,o,r=8){const l=document.documentElement.clientHeight,s=document.documentElement.clientWidth,i=t.left+(t.width-o.width)/2,a=Math.max(r,Math.min(s-o.width-r,i)),c=t.top-r,d=l-t.bottom-r,f=c>=o.height,u=d>=o.height,m=f||!u&&c>d||c>=d,h=t.bottom+r,p=t.top-r,b=m?Math.max(r,p-o.height):h,x=m?p:b+o.height,O=m?Math.max(120,c):Math.max(120,d);return{top:b,left:a,above:m,availableHeight:O,bottom:x,topBaseline:h}}function Eu(){return document.documentElement.clientWidth}function mr(e,t){let o=0;function r(d){const f=e.value;if(!f)return;d.preventDefault();const u=d.deltaMode===WheelEvent.DOM_DELTA_LINE?d.deltaY*22:d.deltaY;f.scrollTop+=u,t()}function l(d){d.touches.length===1&&(o=d.touches[0].clientY)}function s(d){if(d.touches.length!==1)return;const f=e.value;if(!f)return;const u=d.touches[0].clientY;f.scrollTop-=u-o,o=u,d.preventDefault(),t()}function i(d){d&&(d.addEventListener("wheel",r,{passive:!1}),d.addEventListener("touchstart",l,{passive:!0}),d.addEventListener("touchmove",s,{passive:!1}))}function a(d){d&&(d.removeEventListener("wheel",r),d.removeEventListener("touchstart",l),d.removeEventListener("touchmove",s))}let c=null;n.watch(e,(d,f,u)=>{a(c),c=d,i(d),u(()=>{a(d),c===d&&(c=null)})},{immediate:!0}),n.onBeforeUnmount(()=>{a(c),c=null})}function fs(e,t,o,r){function l(u){const m=e.value;if(!m||!u)return!1;if(u instanceof Node&&m.contains(u))return!0;if(r){const h=r(),p=Array.isArray(h)?h:[h];for(const b of p)if(b&&u instanceof Node&&b.contains(u))return!0}return!1}function s(u){t()&&(l(u.target)||o())}function i(u){t()&&(l(u.target)||o())}function a(){t()&&o()}function c(u){u&&u.addEventListener("mouseleave",a)}function d(u){u&&u.removeEventListener("mouseleave",a)}let f=null;n.watch(e,(u,m,h)=>{d(f),f=u,c(u),h(()=>{d(u),f===u&&(f=null)})},{immediate:!0}),n.onMounted(()=>{window.addEventListener("mousedown",s,!0),window.addEventListener("touchstart",s,!0),window.addEventListener("wheel",i,!0)}),n.onBeforeUnmount(()=>{window.removeEventListener("mousedown",s,!0),window.removeEventListener("touchstart",s,!0),window.removeEventListener("wheel",i,!0),d(f),f=null})}const vu=["innerHTML"],Xt=n.defineComponent({__name:"SafeHtml",props:{html:{default:""}},setup(e){return(t,o)=>(n.openBlock(),n.createElementBlock("span",{innerHTML:e.html},null,8,vu))}}),Cu=["aria-label"],Tu={key:0,class:"slash-menu-empty"},xu={key:0,class:"slash-menu-group-label"},_u=["aria-selected","onMousedown","onMouseenter"],Mu={class:"slash-menu-text"},Nu={class:"slash-menu-title"},Su={key:0,class:"slash-menu-desc"},Au=["aria-label"],dl=300,Iu=80,ps=24,Bu=n.defineComponent({__name:"PlusMenu",props:{visible:{type:Boolean},anchorEl:{},blockId:{},query:{},rootEl:{},mode:{default:"slash"}},emits:["close","commit"],setup(e,{expose:t,emit:o}){const r=e,l=o,{t:s}=Zt(),i=n.computed(()=>({basic:s("plus.category.basic"),list:s("plus.category.list"),other:s("plus.category.other")})),a=dn(),c=n.inject(Uo,n.ref(!1)),d=n.ref(null),f=n.ref(null),u=n.ref(0),m=n.ref({top:0,left:0,availableHeight:360,above:!1,bottom:0,topBaseline:0}),h=n.ref(!1),p=n.ref(!1),b=n.ref(!1),x=n.ref(!1);let O=null;n.watch(()=>r.visible,N=>{N?(O&&(clearTimeout(O),O=null),x.value=!0):O=setTimeout(()=>{x.value=!1,O=null},300)},{immediate:!0});function z(N){return typeof N=="string"?N:"•"}const F=n.computed(()=>{const N=r.query.trim().toLowerCase(),E=a.registries.slash.all;return N?E.filter(T=>(s(T.title)+" "+(T.keywords??[]).join(" ")).toLowerCase().includes(N)):E}),j=n.computed(()=>{const N=[],E=new Map;for(const R of F.value){const Y=R.category??"other";E.has(Y)||E.set(Y,[]),E.get(Y).push(R)}const T=["basic","list","other"];for(const R of T){const Y=E.get(R);Y&&Y.length>0&&N.push({category:R,label:i.value[R]??R,items:Y})}for(const[R,Y]of E)T.includes(R)||N.push({category:R,label:i.value[R]??R,items:Y});return N});function P(N){return F.value.findIndex(E=>E.id===N)}n.watch([F,()=>r.visible],()=>{u.value=0,n.nextTick(()=>{f.value&&(f.value.scrollTop=0),U()})});function U(){const N=f.value;N&&(p.value=N.scrollTop>1,b.value=N.scrollTop+N.clientHeight<N.scrollHeight-1)}function te(){const N=f.value;N&&(N.scrollTop-=N.clientHeight*.8)}function W(){const N=f.value;N&&(N.scrollTop+=N.clientHeight*.8)}mr(f,U),n.watch(()=>r.visible,N=>{N&&(h.value=!1,m.value={top:0,left:0,availableHeight:360,above:!1,bottom:0,topBaseline:0})}),n.watch([()=>r.visible,()=>r.anchorEl,d,F,p,b],async()=>{if(!r.visible||!r.anchorEl||!r.rootEl)return;await n.nextTick();const N=d.value;if(!N)return;const E=N.getBoundingClientRect(),T=!!r.anchorEl.closest(".fixed-toolbar"),R=T?c.value?"up":"down":"auto",Y=T?10:0,ae=us(r.rootEl,r.anchorEl,{width:dl,height:E.height},6,R,Y,Y);m.value=ae,h.value=!0,n.nextTick(U)},{flush:"post"});const J=n.computed(()=>{if(!r.rootEl)return{display:"none"};if(!h.value)return{visibility:"hidden",top:"0px",left:"0px",width:`${dl}px`,"--scroll-max-height":"100vh"};const N=m.value.above,E=m.value.left,T=(p.value?ps:0)+(b.value?ps:0),R=m.value.availableHeight-T,Y={left:`${E}px`,width:`${dl}px`,maxHeight:`${m.value.availableHeight}px`,"--scroll-max-height":`${Math.max(Iu,R)}px`};if(N){const ae=document.documentElement.clientHeight;Y.bottom=`${Math.max(0,ae-m.value.bottom)}px`,Y.top="auto"}else Y.top=`${m.value.top}px`,Y.bottom="auto";return Y});function A(N){if(F.value.length===0)return;const E=F.value.length;u.value=((u.value+N)%E+E)%E,_()}function _(){var T;const N=(T=f.value)==null?void 0:T.querySelectorAll(".slash-menu-item"),E=N==null?void 0:N[u.value];E&&E.scrollIntoView({block:"nearest"}),n.nextTick(U)}function I(N){switch(N.key){case"ArrowDown":return N.preventDefault(),A(1),!0;case"ArrowUp":return N.preventDefault(),A(-1),!0;case"PageDown":return N.preventDefault(),A(5),!0;case"PageUp":return N.preventDefault(),A(-5),!0;case"Home":return N.preventDefault(),u.value=0,_(),!0;case"End":return N.preventDefault(),u.value=Math.max(0,F.value.length-1),_(),!0;case"Enter":return N.preventDefault(),S(),!0;case"Escape":return N.preventDefault(),l("close"),!0;default:return!1}}function S(){const N=F.value[u.value];N&&l("commit",N,r.mode),l("close")}function $(N){const E=F.value.indexOf(N);E>=0&&(u.value=E),S()}return t({onKeyDown:I}),fs(d,()=>r.visible,()=>l("close"),()=>r.anchorEl),n.onMounted(()=>{window.addEventListener("resize",U)}),n.onBeforeUnmount(()=>{window.removeEventListener("resize",U)}),(N,E)=>(n.openBlock(),n.createBlock(n.Teleport,{to:"body"},[x.value&&e.rootEl?(n.openBlock(),n.createElementBlock("div",{key:0,ref_key:"menuEl",ref:d,class:n.normalizeClass(["plus-menu slash-menu",{"menu-closing":!e.visible}]),style:n.normalizeStyle(J.value),role:"listbox"},[p.value?(n.openBlock(),n.createElementBlock("button",{key:0,class:"menu-scroll-btn menu-scroll-up",type:"button","aria-label":n.unref(s)("ui.scrollUp"),onMousedown:n.withModifiers(te,["prevent"])},[...E[0]||(E[0]=[n.createElementVNode("svg",{viewBox:"0 0 12 12",width:"10",height:"10","aria-hidden":"true"},[n.createElementVNode("path",{d:"M3 7.5L6 4.5L9 7.5",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],40,Cu)):n.createCommentVNode("",!0),n.createElementVNode("div",{ref_key:"scrollEl",ref:f,class:"slash-menu-scroll",onScroll:U},[F.value.length===0?(n.openBlock(),n.createElementBlock("div",Tu,n.toDisplayString(n.unref(s)("plus.noMatch")),1)):(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:1},n.renderList(j.value,T=>(n.openBlock(),n.createElementBlock("div",{key:T.category,class:"slash-menu-group"},[T.label?(n.openBlock(),n.createElementBlock("div",xu,n.toDisplayString(T.label),1)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(T.items,R=>(n.openBlock(),n.createElementBlock("div",{key:R.id,class:n.normalizeClass(["slash-menu-item",{active:P(R.id)===u.value}]),"aria-selected":P(R.id)===u.value,role:"option",onMousedown:n.withModifiers(Y=>$(R),["prevent"]),onMouseenter:Y=>u.value=P(R.id)},[n.createVNode(Xt,{class:"slash-menu-icon",html:z(R.icon)},null,8,["html"]),n.createElementVNode("div",Mu,[n.createElementVNode("div",Nu,n.toDisplayString(n.unref(s)(R.title)),1),R.description?(n.openBlock(),n.createElementBlock("div",Su,n.toDisplayString(n.unref(s)(R.description)),1)):n.createCommentVNode("",!0)])],42,_u))),128))]))),128))],544),b.value?(n.openBlock(),n.createElementBlock("button",{key:1,class:"menu-scroll-btn menu-scroll-down",type:"button","aria-label":n.unref(s)("ui.scrollDown"),onMousedown:n.withModifiers(W,["prevent"])},[...E[1]||(E[1]=[n.createElementVNode("svg",{viewBox:"0 0 12 12",width:"10",height:"10","aria-hidden":"true"},[n.createElementVNode("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],40,Au)):n.createCommentVNode("",!0)],6)):n.createCommentVNode("",!0)]))}}),Ru=["left","center","right","justify"],Lu=10,jt={align:{default:"left",validate:e=>Ru.includes(e)},color:{default:"default",validate:e=>typeof e=="string"&&e.length>0},bgColor:{default:"default",validate:e=>typeof e=="string"&&e.length>0},indent:{default:0,validate:e=>typeof e=="number"&&Number.isInteger(e)&&e>=0&&e<=Lu}},Ou={align:jt.align,color:jt.color,bgColor:jt.bgColor},Du={indent:jt.indent};function bn(e){const t=[],o=e.align;typeof o=="string"&&o!=="left"&&t.push(`be-align-${o}`);const r=e.color;typeof r=="string"&&r!=="default"&&t.push(`be-color-${r}`);const l=e.bgColor;typeof l=="string"&&l!=="default"&&t.push(`be-bg-${l}`);const s=e.indent;return typeof s=="number"&&s>0&&t.push(`be-indent-${s}`),t}const ms=[{key:"default",label:"Default",cssValue:"var(--be-fg)",opacity:1},{key:"gray",label:"Gray",cssValue:"var(--be-color-gray)",opacity:1},{key:"brown",label:"Brown",cssValue:"var(--be-color-brown)",opacity:1},{key:"orange",label:"Orange",cssValue:"var(--be-color-orange)",opacity:1},{key:"yellow",label:"Yellow",cssValue:"var(--be-color-yellow)",opacity:1},{key:"green",label:"Green",cssValue:"var(--be-color-green)",opacity:1},{key:"blue",label:"Blue",cssValue:"var(--be-color-blue)",opacity:1},{key:"purple",label:"Purple",cssValue:"var(--be-color-purple)",opacity:1},{key:"pink",label:"Pink",cssValue:"var(--be-color-pink)",opacity:1},{key:"red",label:"Red",cssValue:"var(--be-color-red)",opacity:1}],hs=[{key:"default",label:"None",cssValue:"transparent",opacity:0},{key:"gray",label:"Gray",cssValue:"var(--be-swatch-bg-gray)",opacity:.15,displayCssValue:"var(--be-swatch-display-bg-gray)"},{key:"brown",label:"Brown",cssValue:"var(--be-swatch-bg-brown)",opacity:.18,displayCssValue:"var(--be-swatch-display-bg-brown)"},{key:"orange",label:"Orange",cssValue:"var(--be-swatch-bg-orange)",opacity:.18,displayCssValue:"var(--be-swatch-display-bg-orange)"},{key:"yellow",label:"Yellow",cssValue:"var(--be-swatch-bg-yellow)",opacity:.18,displayCssValue:"var(--be-swatch-display-bg-yellow)"},{key:"green",label:"Green",cssValue:"var(--be-swatch-bg-green)",opacity:.18,displayCssValue:"var(--be-swatch-display-bg-green)"},{key:"blue",label:"Blue",cssValue:"var(--be-swatch-bg-blue)",opacity:.18,displayCssValue:"var(--be-swatch-display-bg-blue)"},{key:"purple",label:"Purple",cssValue:"var(--be-swatch-bg-purple)",opacity:.18,displayCssValue:"var(--be-swatch-display-bg-purple)"},{key:"pink",label:"Pink",cssValue:"var(--be-swatch-bg-pink)",opacity:.18,displayCssValue:"var(--be-swatch-display-bg-pink)"},{key:"red",label:"Red",cssValue:"var(--be-swatch-bg-red)",opacity:.18,displayCssValue:"var(--be-swatch-display-bg-red)"}],ul='<svg viewBox="0 0 1024 1024" width="16" height="16" aria-hidden="true"><path d="M426.666667 939.050667a32 32 0 1 1 0-64h53.333333V160H235.093333V170.666667a32 32 0 0 1-27.648 31.701333l-4.352 0.298667A32 32 0 0 1 171.093333 170.666667V128a32 32 0 0 1 32-32H820.693333a32 32 0 0 1 31.701334 27.648l0.298666 4.352v42.666667a32 32 0 1 1-64 0l-0.042666-10.666667H544v715.050667H597.333333a32 32 0 0 1 31.701334 27.648l0.298666 4.352a32 32 0 0 1-32 32h-170.666666z" fill="currentColor"/></svg>',Co="M544 170.922667a32 32 0 0 1 32 32v618.666666a32 32 0 1 1-64 0V544H192v277.674667a32 32 0 0 1-27.648 31.701333l-4.352 0.298667a32 32 0 0 1-32-32v-618.666667a32 32 0 0 1 64 0v276.992H512V202.922667a32 32 0 0 1 27.648-31.701334l4.352-0.298666z",fl=`<svg viewBox="0 0 1024 1024" width="16" height="16" aria-hidden="true"><path d="${Co} M848.512 366.933333A32 32 0 0 1 896 394.965333v426.666667a32 32 0 1 1-64 0v-372.565333l-80.554667 44.416a32 32 0 0 1-41.130666-8.96l-2.346667-3.626667a32 32 0 0 1 12.586667-43.477333l128-70.485334z" fill="currentColor"/></svg>`,pl=`<svg viewBox="0 0 1024 1024" width="16" height="16" aria-hidden="true"><path d="${Co} M786.133333 362.666667a152.661333 152.661333 0 0 1 107.946667 260.693333l-166.058667 165.973333h178.773334a32 32 0 0 1 31.744 27.648l0.256 4.352a32 32 0 0 1-32 32h-256a32 32 0 0 1-22.613334-54.613333l220.672-220.672A88.661333 88.661333 0 0 0 786.133333 426.666667h-7.338666a96 96 0 0 0-96 96v20.565333a32 32 0 0 1-64 0v-20.565333a160 160 0 0 1 160-160h7.338666z" fill="currentColor"/></svg>`,ml=`<svg viewBox="0 0 1024 1024" width="16" height="16" aria-hidden="true"><path d="${Co} m362.410667 192a32 32 0 0 1 22.613333 54.656L809.813333 536.746667l1.792 0.341333a160.085333 160.085333 0 0 1 126.506667 148.053333l0.256 8.490667a160 160 0 0 1-310.912 53.248 32 32 0 0 1 60.373333-21.333333 96 96 0 1 0 90.538667-127.914667h-42.666667a32 32 0 0 1-22.613333-54.613333l116.010667-116.053334h-178.773334a32 32 0 0 1-31.701333-27.648l-0.256-4.352a32 32 0 0 1 32-32h256z" fill="currentColor"/></svg>`,hl=`<svg viewBox="0 0 1024 1024" width="16" height="16" aria-hidden="true"><path d="${Co} m244.309333 193.493333a32 32 0 0 1 20.992 40.106667l-93.738666 299.776h116.48v-96a32 32 0 0 1 64 0v96h10.666666a32 32 0 0 1 31.744 27.648l0.298667 4.352a32 32 0 0 1-32 32H896v53.333333a32 32 0 1 1-64 0v-53.333333h-160a32 32 0 0 1-30.506667-41.557334l106.666667-341.333333a32 32 0 0 1 40.106667-20.992z" fill="currentColor"/></svg>`,gl=`<svg viewBox="0 0 1024 1024" width="16" height="16" aria-hidden="true"><path d="${Co} m363.477333 192.426666a32 32 0 1 1 0 64h-145.706666l-28.245334 113.450667 5.12-1.493333a160.042667 160.042667 0 0 1 100.949334 6.4l9.472 4.266666a160 160 0 1 1-189.610667 249.856 32 32 0 0 1 48-42.325333 96 96 0 1 0 0-126.976c-22.186667 25.130667-63.146667 3.584-55.04-28.928l53.333333-214.016a32 32 0 0 1 31.061334-24.234667h170.666666z" fill="currentColor"/></svg>`,bl=`<svg viewBox="0 0 1024 1024" width="16" height="16" aria-hidden="true"><path d="${Co} m292.522667 153.173333a32 32 0 0 1 12.586666 43.52l-93.141333 168.874667a159.957333 159.957333 0 0 1 102.4 19.712 158.848 158.848 0 0 1 58.581333 217.685333 160.426667 160.426667 0 0 1-218.453333 58.24 158.890667 158.890667 0 0 1-62.762667-209.962667l157.312-285.44a32 32 0 0 1 43.52-12.586666z m-141.226667 322.517333a94.890667 94.890667 0 0 0 35.072 130.048 96.426667 96.426667 0 0 0 131.242667-34.901333 94.848 94.848 0 0 0-35.114667-130.048 96.426667 96.426667 0 0 0-131.242667 34.901333z" fill="currentColor"/></svg>`,kl='<svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="3" cy="4" r="1.1" fill="currentColor" stroke="none"/><circle cx="3" cy="8" r="1.1" fill="currentColor" stroke="none"/><circle cx="3" cy="12" r="1.1" fill="currentColor" stroke="none"/><line x1="6.5" y1="4" x2="13.5" y2="4"/><line x1="6.5" y1="8" x2="13.5" y2="8"/><line x1="6.5" y1="12" x2="13.5" y2="12"/></svg>',yl='<svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2.3 3.7L3.1 2.8L3.1 5.8" stroke-width="1.1"/><line x1="6.5" y1="4" x2="13.5" y2="4" stroke-width="1.3"/><path d="M1.8 7.4C1.8 6.6 4.2 6.6 4.2 7.4C4.2 8.2 1.8 9.5 1.8 9.5L4.2 9.5" stroke-width="1.1"/><line x1="6.5" y1="8" x2="13.5" y2="8" stroke-width="1.3"/><path d="M4.2 11.2C4.2 10.5 3 10.5 1.8 11.5C1.8 12 3 12 3 12C3 12 4.2 12 4.2 13C4.2 13.5 3 13.5 1.8 12.8" stroke-width="1.1"/><line x1="6.5" y1="12" x2="13.5" y2="12" stroke-width="1.3"/></svg>',wl='<svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="2.5" y="2.5" width="11" height="11" rx="2.5"/><path d="M5.5 8L7 9.8L10.8 5.8"/></svg>',El='<svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="2.5" y="3" width="2" height="10" rx="1" fill="currentColor" stroke="none"/><line x1="6.5" y1="5" x2="13" y2="5"/><line x1="6.5" y1="8" x2="13" y2="8"/><line x1="6.5" y1="11" x2="10" y2="11"/></svg>',vl='<svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 4L2 8L5 12"/><path d="M11 4L14 8L11 12"/><line x1="10" y1="3" x2="6" y2="13"/></svg>',$u='<svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><line x1="2" y1="8" x2="14" y2="8"/></svg>',Pu='<svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2 3.5h10M2 8h10M2 12.5h10"/><path d="M14.5 3.5v.01M14.5 8v.01M14.5 12.5v.01"/></svg>',Hu='<svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="2" y="3" width="12" height="10" rx="1.5"/><circle cx="5.5" cy="6.5" r="1.1" fill="currentColor" stroke="none"/><path d="M13 11.5L10 8.5L7 11.5L5 9.5L3 11.5"/></svg>',Vu='<svg viewBox="0 0 24 24" width="20" height="20" aria-hidden="true"><g fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round"><path d="M12 3a9 9 0 0 1 9 9" opacity="0.25"/><path d="M12 3a9 9 0 0 0-9 9" class="be-spinner-arc"/></g></svg>',Uu='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 8a5 5 0 0 1 8.5-3.5M13 3v3h-3"/><path d="M13 8a5 5 0 0 1-8.5 3.5M3 13v-3h3"/></svg>',zu='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 4L12 12"/><path d="M12 4L4 12"/></svg>',Fu='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2 5H12M9 2L12 5L9 8"/><path d="M14 11H4M7 8L4 11L7 14"/></svg>',Ku='<svg viewBox="0 0 1024 1024" width="32" height="32" aria-hidden="true"><path d="M768.35456 416a256 256 0 1 0-512 0 192 192 0 1 0 0 384v64a256 256 0 0 1-58.88-505.216 320.128 320.128 0 0 1 629.76 0A256.128 256.128 0 0 1 768.35456 864v-64a192 192 0 0 0 0-384z m-512 384h128v64H256.35456v-64z m384 0h128v64h-128v-64z" fill="currentColor"/><path d="M539.04256 589.184v333.056a32.448 32.448 0 0 1-32 32.192 32.448 32.448 0 0 1-32-32.192V589.184l-36.096 36.096a32.192 32.192 0 0 1-45.056-0.192 31.616 31.616 0 0 1-0.192-45.056l90.88-90.88a31.36 31.36 0 0 1 22.528-9.152 30.08 30.08 0 0 1 22.4 9.088l90.88 90.944a32.192 32.192 0 0 1-0.192 45.056 31.616 31.616 0 0 1-45.056 0.192l-36.096-36.096z" fill="currentColor"/></svg>',qu='<svg viewBox="0 0 1024 1024" width="16" height="16" aria-hidden="true"><path d="M611.82976 512L300.4928 200.92928l545.2288-0.29696-0.04096-84.44928-667.36128 0.3584-0.04096 82.05312L492.34944 512 179.47648 824.60672l-1.19808 1.20832 0.04096 81.64352 667.36128 0.3584 0.04096-84.44928-545.2288-0.29696L611.82976 512z" fill="currentColor"/></svg>',Wu='<svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M10.5 2.5L13.5 5.5L6 13L3 13L3 10z"/><path d="M9 4L12 7"/></svg>',Gu=["aria-label"],Yu={class:"bsm-group"},Zu={class:"bsm-icon-grid"},Xu=["title","onMousedown","onMouseenter"],ju={key:1,class:"bsm-group"},Qu={class:"bsm-collapse-title"},Ju={class:"bsm-collapse-body"},ef={class:"bsm-row"},tf=["disabled","title","onMousedown"],nf={viewBox:"0 0 16 16",width:"15",height:"15","aria-hidden":"true"},of={class:"bsm-row"},rf=["disabled","title"],lf=["disabled","title"],sf={key:2,class:"bsm-group"},af={class:"bsm-collapse-title"},cf={class:"bsm-collapse-body"},df={class:"bsm-row"},uf=["disabled","title"],ff=["disabled","title"],pf={key:3,class:"bsm-group bsm-colors"},mf={class:"bsm-collapse-title"},hf={class:"bsm-collapse-body"},gf={class:"bsm-swatches"},bf=["title","disabled","onMousedown"],kf={key:4,class:"bsm-group bsm-colors"},yf={class:"bsm-collapse-title"},wf={class:"bsm-collapse-body"},Ef={class:"bsm-swatches"},vf=["title","disabled","onMousedown"],Cf={class:"bsm-group"},Tf=["onMousedown","onMouseenter"],xf={class:"bsm-title"},_f={key:1,class:"bsm-shortcut"},Mf=["aria-label"],Cl=260,Nf=80,gs=24,Sf='<svg viewBox="0 0 16 16" width="14" height="14"><rect x="5" y="5" width="8" height="8" rx="1.5" fill="none" stroke="currentColor" stroke-width="1.2"/><path d="M3 10.5V3.5C3 2.67 3.67 2 4.5 2H10" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/></svg>',Af='<svg viewBox="0 0 16 16" width="14" height="14"><rect x="5" y="5" width="8" height="8" rx="1.5" fill="none" stroke="currentColor" stroke-width="1.2"/><path d="M3 10.5V3.5C3 2.67 3.67 2 4.5 2H10" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/></svg>',If='<svg viewBox="0 0 16 16" width="14" height="14"><circle cx="4.5" cy="11.5" r="1.8" fill="none" stroke="currentColor" stroke-width="1.2"/><circle cx="11.5" cy="11.5" r="1.8" fill="none" stroke="currentColor" stroke-width="1.2"/><line x1="6" y1="10" x2="13" y2="3" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/><line x1="10" y1="10" x2="3" y2="3" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/></svg>',Bf='<svg viewBox="0 0 16 16" width="14" height="14"><path d="M8 12V4M4 8L8 4L12 8" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/></svg>',Rf='<svg viewBox="0 0 16 16" width="14" height="14"><path d="M8 4V12M4 8L8 12L12 8" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/></svg>',Lf='<svg viewBox="0 0 16 16" width="14" height="14"><path d="M3.5 4.5H12.5M6.5 4.5V3C6.5 2.45 6.95 2 7.5 2H8.5C9.05 2 9.5 2.45 9.5 3V4.5M5 4.5L5.5 13C5.55 13.55 6 14 6.55 14H9.45C10 14 10.45 13.55 10.5 13L11 4.5" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/></svg>',Of='<svg viewBox="0 0 1024 1024" width="14" height="14" aria-hidden="true"><path d="M597.333333 451.669333l55.168-55.168a42.666667 42.666667 0 0 1 60.330667 60.330667L657.664 512l55.168 55.168a42.666667 42.666667 0 0 1-60.330667 60.330667L597.333333 572.330667l-55.168 55.168a42.666667 42.666667 0 0 1-60.330666-60.330667L537.002667 512l-55.168-55.168a42.666667 42.666667 0 0 1 60.330666-60.330667L597.333333 451.669333zM874.581333 832H376.32c-47.402667 0-106.730667-25.941333-138.752-60.672l-163.178667-176.938667c-42.325333-45.866667-42.346667-118.869333 0-164.778666l163.2-176.938667C269.525333 218.026667 329.045333 192 376.32 192h498.24A106.666667 106.666667 0 0 1 981.333333 298.837333v426.325334A106.752 106.752 0 0 1 874.581333 832z m0-85.333333C886.4 746.666667 896 737.088 896 725.162667V298.837333c0-11.946667-9.514667-21.504-21.418667-21.504H376.32c-23.466667 0-60.224 16.064-76.010667 33.194667l-163.2 176.917333c-12.181333 13.226667-12.16 35.882667 0 49.109334l163.2 176.917333C316.16 730.666667 352.746667 746.666667 376.32 746.666667h498.24z" fill="currentColor"/></svg>',bs='<svg viewBox="0 0 1024 1024" width="14" height="14" aria-hidden="true"><path d="M672.01024 896l-320 0c-17.67424 0-32.01024-14.336-32.01024-32.01024l0-352.01024-128 0c-12.94336 0-24.61696-7.80288-29.57312-19.7632s-2.21184-25.72288 6.94272-34.87744l320-320c12.4928-12.4928 32.768-12.4928 45.2608 0l320 320c9.15456 9.15456 11.89888 22.91712 6.94272 34.87744s-16.62976 19.7632-29.57312 19.7632l-128 0 0 352.01024c0 17.67424-14.336 32.01024-32.01024 32.01024zM384 832l256 0 0-352.01024c0-17.67424 14.336-32.01024 32.01024-32.01024l82.7392 0-242.74944-242.74944-242.74944 242.74944 82.7392 0c17.67424 0 32.01024 14.336 32.01024 32.01024l0 352.01024z" fill="currentColor"/></svg>',Df='<svg viewBox="0 0 1024 1024" width="14" height="14" aria-hidden="true"><path d="M512.00988746 141.21142578c10.45623779 0 19.24145531 3.50024414 26.37542748 10.71331811l259.5421145 259.55200196C805.03668189 418.58105492 808.63085938 427.33660865 808.63085938 437.84228516c0 10.60949731-3.53485132 19.46887183-10.56994606 26.46936011-7.02026391 7.00543237-15.88952661 10.60949731-26.50891137 10.60949731-10.44140625 0-19.22167969-3.60900903-26.35565185-10.71331811L549.09863305 267.79370094V845.7097168c0 10.19915748-3.62384057 18.94976782-10.89624071 26.16284179-7.23284888 7.31195068-15.97357177 10.91601563-26.2122798 10.91601563-10.23376465 0-18.959656-3.60900903-26.22216796-10.91601563-7.24273705-7.21307397-10.87646508-15.96862769-10.87646508-26.16284179V267.79370094l-196.10760522 196.41906761C271.65484619 471.31213355 262.87951684 474.92114258 252.41833496 474.92114258c-10.61938477 0-19.45898438-3.60900903-26.4990232-10.60949731C218.86444068 457.31115699 215.36914062 448.45178247 215.36914062 437.84228516c0-10.50567651 3.55462623-19.26123023 10.69354248-26.36553931l259.53717042-259.55200196C492.7288816 144.71166992 501.52398658 141.21142578 511.97033691 141.21142578h0.03955055z" fill="currentColor"/></svg>',$f='<svg viewBox="0 0 1024 1024" width="14" height="14" aria-hidden="true"><path d="M511.99011254 141.21142578c10.23376465 0 18.95471191 3.60900903 26.2122798 10.81713891 7.25262451 7.20812988 10.86657691 15.96862769 10.86657763 26.2666626v577.89129615l196.1619873-196.43884254c7.099365-7.00543237 15.90435815-10.61444068 26.34082031-10.61444139 10.61938477 0 19.43426538 3.50518822 26.51385474 10.51062059 7.04498291 7.10430908 10.54522705 15.96862769 10.54522706 26.57318092 0 10.40679908-3.54473877 19.16235352-10.69354248 26.37542748l-259.55694604 259.48278761C531.23156714 879.28833008 522.44635033 882.78857422 512.00988746 882.78857422c-10.45623779 0-19.24145531-3.50024414-26.3704834-10.71331811l-259.55200195-259.48278761C218.94848656 605.37939453 215.36914062 596.62384009 215.36914062 586.21704102c0-10.60949731 3.52496314-19.46887183 10.56994606-26.57318092C232.99395776 552.63842773 241.82861328 549.12829614 252.44799805 549.12829614c10.42163062 0 19.2167356 3.60900903 26.36553931 10.61444068l196.1125493 196.43884253V178.29522729c0-10.30297828 3.60900903-19.05853271 10.88635255-26.2666626C493.05517555 144.81549073 501.80084252 141.21142578 512.02966309 141.21142578h-0.03955055z" fill="currentColor"/></svg>',Pf='<svg viewBox="0 0 100 100" width="14" height="14" aria-hidden="true"><path fill="currentColor" d="M 75,28.5 L 71,32 C 67,26.8 61.5,22.5 53.5,22.5 C 38,22.5 24.5,34.5 24.5,50 C 24.5,65.5 38,77.5 53.5,77.5 C 61.5,77.5 67,73.2 71,68 L 75,71.5 C 70,77.8 62.5,83 53.5,83 C 34.5,83 19,68.5 19,50 C 19,31.5 34.5,17 53.5,17 C 62.5,17 70,22.2 75,28.5 Z"/></svg>',Hf='<svg viewBox="0 0 100 100" width="14" height="14" aria-hidden="true"><path fill="currentColor" fill-rule="evenodd" d="M 22,17 H 49 C 68,17 79,30.5 79,50 C 79,69.5 68,83 49,83 H 22 Z M 27.5,22.5 H 48.5 C 64.5,22.5 73.5,33.5 73.5,50 C 73.5,66.5 64.5,77.5 48.5,77.5 H 27.5 Z"/></svg>',Vf='<svg viewBox="0 0 100 100" width="14" height="14" aria-hidden="true"><path fill="currentColor" d="M 20,17 L 26.5,17 L 50,46.2 L 73.5,17 L 80,17 L 53.8,50 L 80,83 L 73.5,83 L 50,53.8 L 26.5,83 L 20,83 L 46.2,50 Z"/></svg>',Uf='<svg viewBox="0 0 1024 1024" width="14" height="14" aria-hidden="true"><path d="M768 597.333333h-85.333333V426.666667h85.333333c94.250667 0 170.666667-76.416 170.666667-170.666667S862.250667 85.333333 768 85.333333c-94.261333 0-170.666667 76.416-170.666667 170.666667v85.333333H426.666667v-85.333333c0-94.250667-76.416-170.666667-170.666667-170.666667S85.333333 161.749333 85.333333 256s76.416 170.666667 170.666667 170.666667h85.333333v170.666666h-85.333333c-94.250667 0-170.666667 76.416-170.666667 170.666667s76.416 170.666667 170.666667 170.666667c94.261333 0 170.666667-76.416 170.666667-170.666667v-85.333333h170.666666v85.12l-0.010666 0.213333c0 94.250667 76.416 170.666667 170.666666 170.666667s170.666667-76.416 170.666667-170.666667S862.250667 597.354667 768 597.333333z m0-426.666666a85.333333 85.333333 0 0 1 0 170.666666h-85.333333v-85.333333a85.333333 85.333333 0 0 1 85.333333-85.333333z m-597.333333 85.333333a85.333333 85.333333 0 0 1 170.666666 0v85.333333h-85.333333c-47.125333 0-85.333333-38.218667-85.333333-85.333333z m85.333333 597.333333a85.333333 85.333333 0 0 1 0-170.666666h85.333333v85.333333a85.333333 85.333333 0 0 1-85.333333 85.333333z m170.666667-256V426.666667h170.666666v170.666666H426.666667z m341.333333 256a85.333333 85.333333 0 0 1-85.333333-85.333333v-85.333333h85.322666A85.333333 85.333333 0 0 1 768 853.333333z" fill="currentColor"/></svg>',zf='<svg viewBox="0 0 100 100" width="14" height="14" aria-hidden="true"><rect x="8" y="8" width="84" height="84" rx="16" fill="none" stroke="currentColor" stroke-width="4.8" stroke-linecap="round" stroke-linejoin="round"/><path fill="currentColor" d="M 43.5,32 C 40.3,30.3 36.3,29.5 31.5,29.5 C 20.5,29.5 14,38.2 14,50 C 14,61.8 20.5,70.5 31.5,70.5 C 36.3,70.5 40.3,69.7 43.5,68 L 43.5,60.5 C 40.5,62.8 36.5,64 32,64 C 23.7,64 20,58 20,50 C 20,42 23.7,36 32,36 C 36.5,36 40.5,37.2 43.5,39.5 Z M 50,32 H 56 V 41.5 H 59.5 V 47.5 H 56 V 62 C 56,64.2 57,65 59,65 H 60 V 70.5 C 58.5,70.8 56.7,71 54.5,71 C 50,71 48,68.5 48,63 V 47.5 H 44.5 V 41.5 H 48 V 32 Z M 62.5,41.5 H 68 V 47 C 70,43.2 73,41.5 76.5,41.5 V 47.5 C 74,47.5 71,49 68.5,52.5 V 70.5 H 62.5 V 41.5 Z M 79.5,32 H 85.5 V 70.5 H 79.5 Z"/></svg>',Ff=n.defineComponent({__name:"BlockSettingsMenu",props:{visible:{type:Boolean},anchorEl:{},blockId:{},rootEl:{}},emits:["close"],setup(e,{expose:t,emit:o}){const r=e,l=o,{t:s}=Zt(),i=dn(),a=n.inject(Uo,n.ref(!1)),c=n.ref(null),d=n.ref(null),f=n.ref("paragraph"),u=n.ref({top:0,left:0,availableHeight:520,above:!1,bottom:0,topBaseline:0}),m=n.ref(!1),h=n.ref(!1),p=n.ref(!1),b=n.reactive({alignIndent:!1,indent:!1,textColor:!1,bgColor:!1}),x=n.ref(!1);let O=null;n.watch(()=>r.visible,D=>{D?(O&&(clearTimeout(O),O=null),x.value=!0):O=setTimeout(()=>{x.value=!1,O=null},300)},{immediate:!0});const z=n.shallowRef(i.getState());let F=null;const j=n.computed(()=>r.blockId!=null?z.value.doc.blocks.get(r.blockId):void 0),P=n.ref(void 0),U=n.computed(()=>{var M;const D=(M=j.value)==null?void 0:M.attrs.align;return typeof D=="string"?D:"left"}),te=n.computed(()=>{const D=P.value;return D?!("align"in i.registries.schema.get(D).attrs):!0}),W=n.computed(()=>P.value==="image"||P.value==="table"),J=n.computed(()=>P.value==="divider"||P.value==="tableOfContents"),A=n.computed(()=>P.value==="equation"),_=n.computed(()=>P.value==="divider"||P.value==="table"||P.value==="tableOfContents"||P.value==="equation"),I=n.computed(()=>{const D=P.value;if(!D)return!0;const M=i.registries.schema.get(D);return!("color"in M.attrs)||!("bgColor"in M.attrs)}),S=n.computed(()=>{const D=j.value;return D?Pn(z.value.doc,D.id):0});function $(D){return["paragraph","heading","orderedList","bulletList","todoList"].includes(D)}const N=n.computed(()=>!!P.value),E=n.computed(()=>{const D=j.value;if(!D)return!0;const M=z.value.doc,X=Pr(M,D.id);return!X||!$(X.type)||Pn(M,X.id)>=10}),T=n.computed(()=>S.value<=0),R=n.computed(()=>{var M;const D=(M=j.value)==null?void 0:M.attrs.color;return typeof D=="string"?D:"default"}),Y=n.computed(()=>{var M;const D=(M=j.value)==null?void 0:M.attrs.bgColor;return typeof D=="string"?D:"default"});function ae(D,M){var Ne,Ie;const X=r.blockId;!X||!i.getState().doc.blocks.get(X)||(Ie=(Ne=i.commands).convertBlock)==null||Ie.call(Ne,{id:X,type:D,attrs:M})}const ie=n.computed(()=>[{id:"paragraph",iconHtml:ul,title:s("turnInto.paragraph"),kind:"turnInto",run:()=>void ae("paragraph")},{id:"h1",iconHtml:fl,title:s("turnInto.h1"),kind:"turnInto",run:()=>void ae("heading",{level:1})},{id:"h2",iconHtml:pl,title:s("turnInto.h2"),kind:"turnInto",run:()=>void ae("heading",{level:2})},{id:"h3",iconHtml:ml,title:s("turnInto.h3"),kind:"turnInto",run:()=>void ae("heading",{level:3})},{id:"h4",iconHtml:hl,title:s("turnInto.h4"),kind:"turnInto",run:()=>void ae("heading",{level:4})},{id:"h5",iconHtml:gl,title:s("turnInto.h5"),kind:"turnInto",run:()=>void ae("heading",{level:5})},{id:"h6",iconHtml:bl,title:s("turnInto.h6"),kind:"turnInto",run:()=>void ae("heading",{level:6})},{id:"bullet",iconHtml:kl,title:s("turnInto.bullet"),kind:"turnInto",run:()=>void ae("bulletList")},{id:"ordered",iconHtml:yl,title:s("turnInto.ordered"),kind:"turnInto",run:()=>void ae("orderedList")},{id:"todo",iconHtml:wl,title:s("turnInto.todo"),kind:"turnInto",run:()=>void ae("todoList",{checked:!1})},{id:"quote",iconHtml:El,title:s("turnInto.quote"),kind:"turnInto",run:()=>void ae("quote")},{id:"code",iconHtml:vl,title:s("turnInto.code"),kind:"turnInto",run:()=>void ae("codeBlock",{language:"plain"})}]);function pe(D){const M=j.value;if(!M)return!1;switch(D){case"paragraph":return M.type==="paragraph";case"h1":return M.type==="heading"&&Number(M.attrs.level)===1;case"h2":return M.type==="heading"&&Number(M.attrs.level)===2;case"h3":return M.type==="heading"&&Number(M.attrs.level)===3;case"h4":return M.type==="heading"&&Number(M.attrs.level)===4;case"h5":return M.type==="heading"&&Number(M.attrs.level)===5;case"h6":return M.type==="heading"&&Number(M.attrs.level)===6;case"bullet":return M.type==="bulletList";case"ordered":return M.type==="orderedList";case"todo":return M.type==="todoList";case"quote":return M.type==="quote";case"code":return M.type==="codeBlock";default:return!1}}function re(D){return pe(D)}n.watch(()=>r.visible,D=>{var X;if(!D)return;P.value=r.blockId!=null?(X=z.value.doc.blocks.get(r.blockId))==null?void 0:X.type:void 0;const M=ie.value.find(Oe=>pe(Oe.id));f.value=M?M.id:"paragraph",b.alignIndent=!1,b.indent=!1,b.textColor=!1,b.bgColor=!1},{immediate:!0});const le=n.computed(()=>{const D=[{id:"align-left",value:"left",title:s("align.left"),run:()=>xe("left")},{id:"align-center",value:"center",title:s("align.center"),run:()=>xe("center")},{id:"align-right",value:"right",title:s("align.right"),run:()=>xe("right")}];return W.value||D.push({id:"align-justify",value:"justify",title:s("align.justify"),run:()=>xe("justify")}),D});function xe(D){var M,X;(X=(M=i.commands).setBlockAlign)==null||X.call(M,{id:r.blockId,align:D})}function Ae(){var D,M;(M=(D=i.commands).indentBlock)==null||M.call(D,{id:r.blockId})}function Xe(){var D,M;(M=(D=i.commands).outdentBlock)==null||M.call(D,{id:r.blockId})}const At=ms,nn=hs;function Gt(D){var M,X;(X=(M=i.commands).setBlockColor)==null||X.call(M,{id:r.blockId,color:D})}function Ot(D){var M,X;(X=(M=i.commands).setBlockBgColor)==null||X.call(M,{id:r.blockId,bgColor:D})}async function qe(){var Ie,Qt;const D=j.value;if(!D)return;const M=D.type==="equation"?String(D.attrs.expression??""):Me(D.content),Oe=`<meta charset="utf-8"><!-- blockeditor:${JSON.stringify({id:D.id,type:D.type,attrs:D.attrs,text:M}).replace(/--/g,"\\-\\-")} -->${bt(M)}`;let Ne=!1;try{if((Ie=navigator.clipboard)!=null&&Ie.write&&typeof ClipboardItem<"u"){const St=new ClipboardItem({"text/plain":new Blob([M],{type:"text/plain"}),"text/html":new Blob([Oe],{type:"text/html"})});await navigator.clipboard.write([St]),Ne=!0}}catch{Ne=!1}if(!Ne)try{(Qt=navigator.clipboard)!=null&&Qt.writeText&&(await navigator.clipboard.writeText(M),Ne=!0)}catch{Ne=!1}Ne||(Ne=It(M))}function bt(D){return D.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function It(D){const M=document.createElement("textarea");M.value=D,M.setAttribute("readonly",""),M.style.position="fixed",M.style.top="-9999px",M.style.left="-9999px",M.style.opacity="0",document.body.appendChild(M);const X=document.activeElement;M.focus(),M.select();try{return document.execCommand("copy")}catch{return!1}finally{if(document.body.removeChild(M),X&&typeof X.focus=="function")try{X.focus()}catch{}}}function Je(){qe().then(()=>{var D,M;return(M=(D=i.commands).removeBlock)==null?void 0:M.call(D,{id:r.blockId})})}const Le=/Mac|iP(hone|[ao]d)/.test(navigator.platform)?Uf:zf;function mt(...D){return D.join("")}const fe=n.computed(()=>[{id:"dup",iconHtml:Sf,title:s("action.duplicate"),shortcutHtml:mt(Le,Hf),run:()=>{var D,M;return void((M=(D=i.commands).duplicateBlock)==null?void 0:M.call(D,{id:r.blockId}))}},{id:"copy",iconHtml:Af,title:s("action.copy"),shortcutHtml:mt(Le,Pf),run:()=>void qe()},{id:"cut",iconHtml:If,title:s("action.cut"),shortcutHtml:mt(Le,Vf),run:()=>void Je()},{id:"up",iconHtml:Bf,title:s("action.moveUp"),shortcutHtml:mt(Le,bs,Df),run:()=>{var D,M;return void((M=(D=i.commands).moveBlockUp)==null?void 0:M.call(D,{id:r.blockId}))}},{id:"down",iconHtml:Rf,title:s("action.moveDown"),shortcutHtml:mt(Le,bs,$f),run:()=>{var D,M;return void((M=(D=i.commands).moveBlockDown)==null?void 0:M.call(D,{id:r.blockId}))}},{id:"del",iconHtml:Lf,title:s("action.delete"),shortcutHtml:Of,danger:!0,run:()=>{var D,M;return void((M=(D=i.commands).removeBlock)==null?void 0:M.call(D,{id:r.blockId}))}}]);n.watch(()=>r.visible,D=>{D&&(m.value=!1,u.value={top:0,left:0,availableHeight:520,above:!1,bottom:0,topBaseline:0})});function _t(){const D=r.anchorEl,M=r.rootEl,X=c.value;!r.visible||!D||!M||!X||n.nextTick().then(()=>{const Oe=c.value;if(!Oe)return;const Ne=Oe.getBoundingClientRect(),Ie=!!D.closest(".fixed-toolbar"),Qt=Ie?a.value?"up":"down":"auto",St=Ie?10:0,_n=us(M,D,{width:Math.max(Ne.width,Cl),height:Ne.height},8,Qt,St,St);u.value=_n,m.value=!0,n.nextTick(_e)})}n.watch([()=>r.visible,()=>r.anchorEl,c,h,p],_t,{flush:"post"});function Ve(D){b[D]=!b[D],n.nextTick(_t)}function _e(){const D=d.value;D&&(h.value=D.scrollTop>1,p.value=D.scrollTop+D.clientHeight<D.scrollHeight-1)}function Ft(){const D=d.value;D&&(D.scrollTop-=D.clientHeight*.8)}function Ct(){const D=d.value;D&&(D.scrollTop+=D.clientHeight*.8)}mr(d,_e);const Et=n.computed(()=>{if(!r.rootEl)return{display:"none"};if(!m.value)return{visibility:"hidden",top:"0px",left:"0px",width:`${Cl}px`,"--scroll-max-height":"100vh"};const D=u.value.above,M=u.value.left,X=(h.value?gs:0)+(p.value?gs:0),Oe=u.value.availableHeight-X,Ne={left:`${M}px`,width:`${Cl}px`,maxHeight:`${u.value.availableHeight}px`,"--scroll-max-height":`${Math.max(Nf,Oe)}px`};if(D){const Ie=document.documentElement.clientHeight;Ne.bottom=`${Math.max(0,Ie-u.value.bottom)}px`,Ne.top="auto"}else Ne.top=`${u.value.top}px`,Ne.bottom="auto";return Ne});function je(D){if(D.kind==="turnInto"&&re(D.id)){const M=ie.value.find(X=>X.id==="paragraph");if(M){f.value="paragraph",M.run(),l("close");return}}f.value=D.id,D.run(),l("close")}function ce(D){const M=[...ie.value,...fe.value];if(M.length===0)return!1;const X=M.findIndex(Ne=>Ne.id===f.value),Oe=Ne=>(Ne%M.length+M.length)%M.length;switch(D.key){case"ArrowDown":return D.preventDefault(),f.value=M[Oe(X+1)].id,!0;case"ArrowUp":return D.preventDefault(),f.value=M[Oe(X-1)].id,!0;case"Enter":return D.preventDefault(),je(M[Oe(X)]),!0;case"Escape":return D.preventDefault(),l("close"),!0;default:return!1}}return t({onKeyDown:ce}),fs(c,()=>r.visible,()=>l("close"),()=>r.anchorEl),n.onMounted(()=>{F=i.subscribe(D=>{z.value=D.state})}),n.onBeforeUnmount(()=>{F==null||F(),F=null}),(D,M)=>(n.openBlock(),n.createBlock(n.Teleport,{to:"body"},[x.value&&e.rootEl?(n.openBlock(),n.createElementBlock("div",{key:0,ref_key:"menuEl",ref:c,class:n.normalizeClass(["block-settings-menu",{"menu-closing":!e.visible}]),style:n.normalizeStyle(Et.value),role:"menu"},[h.value?(n.openBlock(),n.createElementBlock("button",{key:0,class:"menu-scroll-btn menu-scroll-up",type:"button","aria-label":n.unref(s)("ui.scrollUp"),onMousedown:n.withModifiers(Ft,["prevent"])},[...M[8]||(M[8]=[n.createElementVNode("svg",{viewBox:"0 0 12 12",width:"10",height:"10","aria-hidden":"true"},[n.createElementVNode("path",{d:"M3 7.5L6 4.5L9 7.5",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],40,Gu)):n.createCommentVNode("",!0),n.createElementVNode("div",{ref_key:"scrollEl",ref:d,class:"bsm-scroll",onScroll:_e},[!W.value&&!J.value&&!A.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createElementVNode("div",Yu,[n.createElementVNode("div",Zu,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(ie.value,X=>(n.openBlock(),n.createElementBlock("button",{key:X.id,class:n.normalizeClass(["bsm-icon-cell",{active:re(X.id)}]),title:X.title,role:"menuitem",onMousedown:n.withModifiers(Oe=>je(X),["prevent"]),onMouseenter:Oe=>f.value=X.id},[n.createVNode(Xt,{class:"bsm-icon-svg",html:X.iconHtml},null,8,["html"])],42,Xu))),128))])]),M[9]||(M[9]=n.createElementVNode("div",{class:"bsm-sep"},null,-1))],64)):n.createCommentVNode("",!0),_.value?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",ju,[n.createElementVNode("button",{class:n.normalizeClass(["bsm-collapse-header",{"bsm-disabled":te.value&&!N.value,expanded:b.alignIndent}]),role:"menuitem",onMousedown:M[0]||(M[0]=n.withModifiers(X=>Ve("alignIndent"),["prevent"]))},[n.createElementVNode("span",Qu,n.toDisplayString(n.unref(s)("bsm.section.alignIndent")),1),M[10]||(M[10]=n.createElementVNode("svg",{class:"bsm-collapse-chevron",viewBox:"0 0 12 12",width:"10",height:"10","aria-hidden":"true"},[n.createElementVNode("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],34),n.withDirectives(n.createElementVNode("div",Ju,[n.createElementVNode("div",ef,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(le.value,X=>(n.openBlock(),n.createElementBlock("button",{key:X.id,class:n.normalizeClass(["bsm-icon-btn",{active:!te.value&&U.value===X.value,"bsm-disabled":te.value}]),disabled:te.value,title:X.title,role:"menuitem",onMousedown:n.withModifiers(Oe=>!te.value&&je(X),["prevent"])},[(n.openBlock(),n.createElementBlock("svg",nf,[X.value==="left"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[M[11]||(M[11]=n.createElementVNode("line",{x1:"2",y1:"4",x2:"14",y2:"4",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),M[12]||(M[12]=n.createElementVNode("line",{x1:"2",y1:"8",x2:"10",y2:"8",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),M[13]||(M[13]=n.createElementVNode("line",{x1:"2",y1:"12",x2:"12",y2:"12",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1))],64)):X.value==="center"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[M[14]||(M[14]=n.createElementVNode("line",{x1:"2",y1:"4",x2:"14",y2:"4",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),M[15]||(M[15]=n.createElementVNode("line",{x1:"4",y1:"8",x2:"12",y2:"8",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),M[16]||(M[16]=n.createElementVNode("line",{x1:"3",y1:"12",x2:"13",y2:"12",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1))],64)):X.value==="right"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:2},[M[17]||(M[17]=n.createElementVNode("line",{x1:"2",y1:"4",x2:"14",y2:"4",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),M[18]||(M[18]=n.createElementVNode("line",{x1:"6",y1:"8",x2:"14",y2:"8",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),M[19]||(M[19]=n.createElementVNode("line",{x1:"4",y1:"12",x2:"14",y2:"12",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1))],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:3},[M[20]||(M[20]=n.createElementVNode("line",{x1:"2",y1:"4",x2:"14",y2:"4",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),M[21]||(M[21]=n.createElementVNode("line",{x1:"2",y1:"8",x2:"14",y2:"8",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),M[22]||(M[22]=n.createElementVNode("line",{x1:"2",y1:"12",x2:"14",y2:"12",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1))],64))]))],42,tf))),128))]),n.createElementVNode("div",of,[n.createElementVNode("button",{class:n.normalizeClass(["bsm-icon-btn",{"bsm-disabled":T.value}]),disabled:T.value,title:n.unref(s)("bsm.indent.decrease"),role:"menuitem",onMousedown:M[1]||(M[1]=n.withModifiers(X=>!T.value&&je({id:"outdent",run:Xe}),["prevent"]))},[...M[23]||(M[23]=[n.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"15",height:"15","aria-hidden":"true"},[n.createElementVNode("path",{d:"M906.666667 379.733333h-448c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h448c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32zM906.666667 580.266667h-448c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h448c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32zM117.333333 245.333333h789.333334c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32h-789.333334C100.266667 181.333333 85.333333 196.266667 85.333333 213.333333s14.933333 32 32 32zM906.666667 778.666667h-789.333334c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h789.333334c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32zM285.866667 657.066667c14.933333 8.533333 34.133333 0 34.133333-17.066667V384c0-17.066667-19.2-27.733333-34.133333-17.066667l-192 128c-12.8 8.533333-12.8 27.733333 0 36.266667l192 125.866667z",fill:"currentColor"})],-1)])],42,rf),n.createElementVNode("button",{class:n.normalizeClass(["bsm-icon-btn",{"bsm-disabled":E.value}]),disabled:E.value,title:n.unref(s)("bsm.indent.increase"),role:"menuitem",onMousedown:M[2]||(M[2]=n.withModifiers(X=>!E.value&&je({id:"indent",run:Ae}),["prevent"]))},[...M[24]||(M[24]=[n.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"15",height:"15","aria-hidden":"true"},[n.createElementVNode("path",{d:"M906.666667 379.733333h-448c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h448c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32zM906.666667 580.266667h-448c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h448c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32zM117.333333 245.333333h789.333334c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32h-789.333334C100.266667 181.333333 85.333333 196.266667 85.333333 213.333333s14.933333 32 32 32zM906.666667 778.666667h-789.333334c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h789.333334c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32zM119.466667 657.066667A21.333333 21.333333 0 0 1 85.333333 640V384c0-17.066667 19.2-27.733333 34.133334-17.066667l192 128c12.8 8.533333 12.8 27.733333 0 36.266667l-192 125.866667z",fill:"currentColor"})],-1)])],42,lf)])],512),[[n.vShow,b.alignIndent]])])),_.value?(n.openBlock(),n.createElementBlock("div",sf,[n.createElementVNode("button",{class:n.normalizeClass(["bsm-collapse-header",{"bsm-disabled":!N.value,expanded:b.indent}]),role:"menuitem",onMousedown:M[3]||(M[3]=n.withModifiers(X=>Ve("indent"),["prevent"]))},[n.createElementVNode("span",af,n.toDisplayString(n.unref(s)("bsm.section.indent")),1),M[25]||(M[25]=n.createElementVNode("svg",{class:"bsm-collapse-chevron",viewBox:"0 0 12 12",width:"10",height:"10","aria-hidden":"true"},[n.createElementVNode("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],34),n.withDirectives(n.createElementVNode("div",cf,[n.createElementVNode("div",df,[n.createElementVNode("button",{class:n.normalizeClass(["bsm-icon-btn",{"bsm-disabled":T.value}]),disabled:T.value,title:n.unref(s)("bsm.indent.decrease"),role:"menuitem",onMousedown:M[4]||(M[4]=n.withModifiers(X=>!T.value&&je({id:"outdent",run:Xe}),["prevent"]))},[...M[26]||(M[26]=[n.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"15",height:"15","aria-hidden":"true"},[n.createElementVNode("path",{d:"M906.666667 379.733333h-448c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h448c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32zM906.666667 580.266667h-448c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h448c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32zM117.333333 245.333333h789.333334c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32h-789.333334C100.266667 181.333333 85.333333 196.266667 85.333333 213.333333s14.933333 32 32 32zM906.666667 778.666667h-789.333334c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h789.333334c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32zM285.866667 657.066667c14.933333 8.533333 34.133333 0 34.133333-17.066667V384c0-17.066667-19.2-27.733333-34.133333-17.066667l-192 128c-12.8 8.533333-12.8 27.733333 0 36.266667l192 125.866667z",fill:"currentColor"})],-1)])],42,uf),n.createElementVNode("button",{class:n.normalizeClass(["bsm-icon-btn",{"bsm-disabled":E.value}]),disabled:E.value,title:n.unref(s)("bsm.indent.increase"),role:"menuitem",onMousedown:M[5]||(M[5]=n.withModifiers(X=>!E.value&&je({id:"indent",run:Ae}),["prevent"]))},[...M[27]||(M[27]=[n.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"15",height:"15","aria-hidden":"true"},[n.createElementVNode("path",{d:"M906.666667 379.733333h-448c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h448c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32zM906.666667 580.266667h-448c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h448c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32zM117.333333 245.333333h789.333334c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32h-789.333334C100.266667 181.333333 85.333333 196.266667 85.333333 213.333333s14.933333 32 32 32zM906.666667 778.666667h-789.333334c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h789.333334c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32zM119.466667 657.066667A21.333333 21.333333 0 0 1 85.333333 640V384c0-17.066667 19.2-27.733333 34.133334-17.066667l192 128c12.8 8.533333 12.8 27.733333 0 36.266667l-192 125.866667z",fill:"currentColor"})],-1)])],42,ff)])],512),[[n.vShow,b.indent]])])):n.createCommentVNode("",!0),!W.value&&!J.value?(n.openBlock(),n.createElementBlock("div",pf,[n.createElementVNode("button",{class:n.normalizeClass(["bsm-collapse-header",{"bsm-disabled":I.value,expanded:b.textColor}]),role:"menuitem",onMousedown:M[6]||(M[6]=n.withModifiers(X=>!I.value&&Ve("textColor"),["prevent"]))},[n.createElementVNode("span",mf,n.toDisplayString(n.unref(s)("bsm.section.textColor")),1),M[28]||(M[28]=n.createElementVNode("svg",{class:"bsm-collapse-chevron",viewBox:"0 0 12 12",width:"10",height:"10","aria-hidden":"true"},[n.createElementVNode("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],34),n.withDirectives(n.createElementVNode("div",hf,[n.createElementVNode("div",gf,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(At),X=>(n.openBlock(),n.createElementBlock("button",{key:"tc-"+X.key,class:n.normalizeClass(["bsm-swatch",{active:R.value===X.key,"bsm-disabled":I.value}]),title:n.unref(s)(X.key==="default"?"color.default":"color."+X.key),style:n.normalizeStyle({backgroundColor:X.displayCssValue??X.cssValue}),disabled:I.value,onMousedown:n.withModifiers(Oe=>!I.value&&je({id:`tc-${X.key}`,run:()=>Gt(X.key)}),["prevent"])},null,46,bf))),128))])],512),[[n.vShow,b.textColor]])])):n.createCommentVNode("",!0),!W.value&&!J.value?(n.openBlock(),n.createElementBlock("div",kf,[n.createElementVNode("button",{class:n.normalizeClass(["bsm-collapse-header",{"bsm-disabled":I.value,expanded:b.bgColor}]),role:"menuitem",onMousedown:M[7]||(M[7]=n.withModifiers(X=>!I.value&&Ve("bgColor"),["prevent"]))},[n.createElementVNode("span",yf,n.toDisplayString(n.unref(s)("bsm.section.bgColor")),1),M[29]||(M[29]=n.createElementVNode("svg",{class:"bsm-collapse-chevron",viewBox:"0 0 12 12",width:"10",height:"10","aria-hidden":"true"},[n.createElementVNode("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],34),n.withDirectives(n.createElementVNode("div",wf,[n.createElementVNode("div",Ef,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(nn),X=>(n.openBlock(),n.createElementBlock("button",{key:"bc-"+X.key,class:n.normalizeClass(["bsm-swatch",[{active:Y.value===X.key,"bsm-disabled":I.value},X.key==="default"?"bsm-swatch--none":""]]),title:n.unref(s)(X.key==="default"?"color.none":"color."+X.key),style:n.normalizeStyle({backgroundColor:X.displayCssValue??X.cssValue}),disabled:I.value,onMousedown:n.withModifiers(Oe=>!I.value&&je({id:`bc-${X.key}`,run:()=>Ot(X.key)}),["prevent"])},null,46,vf))),128))])],512),[[n.vShow,b.bgColor]])])):n.createCommentVNode("",!0),M[30]||(M[30]=n.createElementVNode("div",{class:"bsm-sep"},null,-1)),n.createElementVNode("div",Cf,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(fe.value,X=>(n.openBlock(),n.createElementBlock("button",{key:X.id,class:n.normalizeClass(["bsm-item bsm-action",{danger:X.danger}]),role:"menuitem",onMousedown:n.withModifiers(Oe=>je(X),["prevent"]),onMouseenter:Oe=>f.value=X.id},[n.createVNode(Xt,{class:"bsm-action-icon",html:X.iconHtml},null,8,["html"]),n.createElementVNode("span",xf,n.toDisplayString(X.title),1),X.shortcutHtml?(n.openBlock(),n.createBlock(Xt,{key:0,class:"bsm-shortcut",html:X.shortcutHtml},null,8,["html"])):X.shortcut?(n.openBlock(),n.createElementBlock("span",_f,n.toDisplayString(X.shortcut),1)):n.createCommentVNode("",!0)],42,Tf))),128))])],544),p.value?(n.openBlock(),n.createElementBlock("button",{key:1,class:"menu-scroll-btn menu-scroll-down",type:"button","aria-label":n.unref(s)("ui.scrollDown"),onMousedown:n.withModifiers(Ct,["prevent"])},[...M[31]||(M[31]=[n.createElementVNode("svg",{viewBox:"0 0 12 12",width:"10",height:"10","aria-hidden":"true"},[n.createElementVNode("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],40,Mf)):n.createCommentVNode("",!0)],6)):n.createCommentVNode("",!0)]))}}),Kf=["aria-hidden"],qf=["aria-label"],Wf=["title","aria-label"],Gf={class:"ht-dropdown-wrap"},Yf=["title","disabled"],Zf={class:"ht-type-label"},Xf=["aria-label"],jf=["onMousedown"],Qf={key:0,class:"ht-check",viewBox:"0 0 12 12",width:"14",height:"14","aria-hidden":"true"},Jf=["aria-label"],ep={class:"ht-dropdown-wrap"},tp=["title","disabled"],np={viewBox:"0 0 16 16",width:"15",height:"15","aria-hidden":"true"},op=["aria-label"],rp=["onMousedown"],lp={viewBox:"0 0 16 16",width:"15",height:"15","aria-hidden":"true"},ip={key:0,class:"ht-check",viewBox:"0 0 12 12",width:"14",height:"14","aria-hidden":"true"},sp=["aria-label"],ap={key:0,class:"ht-dropdown-wrap"},cp=["title","disabled"],dp={viewBox:"0 0 16 16",width:"15",height:"15","aria-hidden":"true"},up=["aria-label"],fp=["onMousedown"],pp={viewBox:"0 0 16 16",width:"15",height:"15","aria-hidden":"true"},mp={key:0,class:"ht-check",viewBox:"0 0 12 12",width:"14",height:"14","aria-hidden":"true"},hp=["aria-label"],gp=["title","disabled","onMousedown","onTouchstart"],bp=["title","disabled"],kp={class:"ht-dropdown-wrap"},yp=["title","disabled"],wp=["aria-label"],Ep={class:"ht-color-section"},vp={class:"ht-color-label"},Cp={class:"ht-swatches"},Tp=["title","onMousedown"],xp={class:"ht-color-section"},_p={class:"ht-color-label"},Mp={class:"ht-swatches"},Np=["title","onMousedown"],Sp=["aria-label"],Ap=["title","aria-label","disabled"],Ip={key:0,class:"ht-sep"},Bp=["title"],Rp=["title"],Lp=["title"],Op={key:0,class:"ht-sep"},Dp=["title"],$p=["title","aria-label"],Pp=80,Hp=24,jo=36,Vp=360,ks=10,ys=200,ws=n.defineComponent({__name:"HoverToolbar",props:{visible:{type:Boolean},selectionRect:{},blockId:{},blockType:{},blockAttrs:{},rootEl:{},tableMode:{type:Boolean},showDelete:{type:Boolean},deleteLabel:{},deleteIcon:{},showMerge:{type:Boolean},showSplit:{type:Boolean},showHeaderRow:{type:Boolean},headerRowActive:{type:Boolean},cellEditMode:{type:Boolean},tableActiveMarks:{},tableActiveColor:{},tableActiveBgColor:{},tableActiveVerticalAlign:{},inline:{type:Boolean}},emits:["close","interacting","linkClick","delete","merge","split","tableHeaderRow","tableType","tableAlign","tableVerticalAlign","tableMark","tableTextColor","tableBgColor","tableCopy"],setup(e,{expose:t,emit:o}){const r=e,l=o;function s(){l("interacting")}const{t:i}=Zt(),a=dn(),c=n.inject(Uo,n.ref(!1)),d=n.ref(null),f=n.ref(null),u=n.ref(null),m=n.ref(null),h=n.ref(null),p=n.ref(null),b=n.ref(null),x=n.ref(null),O=n.ref(null),z=n.ref({top:0,left:0,above:!1}),F=n.ref(null),j=n.ref(!1),P=n.ref(null),U=n.ref(null),te=n.ref(!1),W=n.ref(!1),J=n.ref(null),A=n.ref(!1),_=n.ref(!1),I=n.ref(!1),S=n.computed(()=>({maxHeight:P.value!==null?`${P.value}px`:void 0})),$=n.ref(null),N=n.computed(()=>{if(!r.inline||!$.value)return;const L=$.value,g={position:"fixed",left:`${L.left}px`};return L.top!==void 0&&(g.top=`${L.top}px`),L.bottom!==void 0&&(g.bottom=`${L.bottom}px`),L.right!==void 0&&(g.right=`${L.right}px`),g}),E=n.shallowRef(null);n.watch(()=>r.blockId,L=>{E.value=L},{immediate:!0});const T=n.shallowRef(a.getState());let R=null;const Y=n.computed(()=>T.value.doc.blocks.get(E.value??"")),ae=n.computed(()=>{var g;if(r.cellEditMode||r.tableMode){const H=r.blockAttrs.align;return typeof H=="string"?H:"left"}const L=(g=Y.value)==null?void 0:g.attrs.align;return typeof L=="string"?L:"left"}),ie=n.computed(()=>{if(r.tableMode){const L=r.tableActiveVerticalAlign;return typeof L=="string"?L:"middle"}if(r.cellEditMode){const L=r.blockAttrs.verticalAlign;return typeof L=="string"?L:"middle"}return"middle"}),pe=n.ref(""),re=n.ref("");n.watch(()=>r.visible,L=>{L||(F.value=null)}),n.watch(()=>r.blockId,()=>{F.value=null});const le=n.ref(new Set),xe=n.ref(0);function Ae(){var L;if(!r.rootEl)return null;if(r.cellEditMode){const g=window.getSelection();if(!g||g.rangeCount===0)return null;const H=g.getRangeAt(0);return(L=H.commonAncestorContainer.nodeType===1?H.commonAncestorContainer:H.commonAncestorContainer.parentElement)==null?void 0:L.closest(".table-cell-inner")}return r.rootEl.querySelector(`[data-block-id="${r.blockId}"]`)}function Xe(){const L=new Set;if(!r.visible||!r.blockId||!r.rootEl){le.value=L;return}if(r.tableMode&&r.tableActiveMarks){le.value=new Set(r.tableActiveMarks);return}const g=Ae();if(g){const C=window.getSelection();if(C&&C.rangeCount>0){const B=C.getRangeAt(0);if(!B.collapsed&&g.contains(B.commonAncestorContainer)){const K=[],G=document.createTreeWalker(g,NodeFilter.SHOW_TEXT);for(;G.nextNode();){const ee=G.currentNode;(ee.nodeValue??"").length!==0&&B.intersectsNode(ee)&&K.push(ee)}if(K.length>0){const ee={bold:["B","STRONG"],italic:["I","EM"],underline:["U"],strikethrough:["S","STRIKE","DEL"],code:["CODE"],link:["A"]};for(const[ne,ye]of Object.entries(ee))K.every(be=>{let ve=be.parentNode;for(;ve&&ve!==g;){if(ve.nodeType===Node.ELEMENT_NODE&&ye.includes(ve.nodeName))return!0;ve=ve.parentNode}return!1})&&L.add(ne);if(L.size>0){le.value=L;return}}}}}const H=T.value,ue=r.blockId?H.doc.blocks.get(r.blockId):void 0;if(!ue){le.value=L;return}const Ee=H.selection;let Be=0,y=Me(ue.content).length;if(Ee.kind==="text"&&Ee.anchor.blockId===r.blockId&&Ee.focus.blockId===r.blockId)Be=Math.min(Ee.anchor.offset,Ee.focus.offset),y=Math.max(Ee.anchor.offset,Ee.focus.offset);else{const C=dt();C&&(Be=C.from,y=C.to)}if(Be>=y){le.value=L;return}const w=["bold","italic","underline","strikethrough","code","link"];for(const C of w){let B=!0,K=!1,G=0;for(const ee of ue.content){if(ee.type!=="text")continue;const ne=G,ye=G+ee.text.length;if(ye>Be&&ne<y&&(K=!0,!ee.marks||!ee.marks.some(be=>be.type===C))){B=!1;break}G=ye}K&&B&&L.add(C)}le.value=L}const At=n.computed(()=>r.inline&&!r.tableMode&&!r.cellEditMode&&!r.selectionRect),nn=n.computed(()=>At.value||r.blockType==="codeBlock"),Gt=n.computed(()=>r.tableMode||r.cellEditMode?At.value:!r.blockId),Ot=n.computed(()=>{if(r.tableMode||r.cellEditMode)return At.value?!0:r.blockType==="codeBlock";if(!r.blockId||r.blockType==="codeBlock")return!0;const L=r.blockType;return L?!("align"in a.registries.schema.get(L).attrs):!1});function qe(L){if(r.tableMode||r.cellEditMode)return!!(r.blockType==="codeBlock"||r.blockType==="quote"&&L==="italic"||L!=="code"&&le.value.has("code"));if(nn.value)return!0;if(L==="italic"){const g=r.blockType;if(g&&a.registries.schema.isMarkDisallowed(g,"italic"))return!0}if(L==="link"){const g=a.getState().selection;return!!(g.kind==="text"&&Ht(g))}return!!(L!=="code"&&le.value.has("code"))}const bt=n.computed(()=>[{id:"bold",title:i("mark.bold"),iconHtml:'<svg viewBox="0 0 1024 1024" width="15" height="15" aria-hidden="true"><path d="M214.857 889.143v-68.571h68.571V203.429H214.857v-68.571h411.429v1.257c96.114 10.629 171.429 87.383 171.429 181.6 0 58.971-29.486 111.086-75.109 144.457 72.069 39.291 120.823 113.234 120.823 198.4 0 119.291-95.634 216.594-217.12 227.543l-0.286.029H214.857z m388.572-388.571H352v320h251.429c95.086 0 171.429-72.091 171.429-160s-76.343-160-171.429-160z m0-297.143H352v228.571h251.429l5.211-0.091c67.52-2.515 120.503-53.235 120.503-114.195 0-62.537-55.749-114.285-125.714-114.285z" fill="currentColor"/></svg>'},{id:"italic",title:i("mark.italic"),iconHtml:'<svg viewBox="0 0 1024 1024" width="15" height="15" aria-hidden="true"><path d="M730.143 127.714v64.286h-112.329l-166.521 621.429h128.871v64.286H276.286v-64.286h108.45l166.5-621.429H426.286V127.714h303.857z" fill="currentColor"/></svg>'},{id:"underline",title:i("mark.underline"),iconHtml:'<svg viewBox="0 0 1024 1024" width="15" height="15" aria-hidden="true"><path d="M512 123.639a36.409 36.409 0 0 1 33.642 22.525l230.59 558.27a36.409 36.409 0 1 1-67.284 27.768L638.072 560.545H385.928l-70.876 171.656a36.409 36.409 0 1 1-67.332-27.768l230.59-558.27A36.409 36.409 0 0 1 512 123.639z m-95.974 364.089h191.948L512 255.439l-95.974 232.289zM769.289 827.544c19.418 0 38.836 14.564 38.836 38.836 0 19.418-14.564 33.982-29.127 33.982H259.565c-19.418 0-38.836-14.564-38.836-38.836 0-19.418 14.564-33.982 29.127-33.982h519.433z" fill="currentColor"/></svg>'},{id:"strikethrough",title:i("mark.strikethrough"),iconHtml:'<svg viewBox="0 0 1024 1024" width="15" height="15" aria-hidden="true"><path d="M182.044 490.667h659.911a34.133 34.133 0 0 1 4.642 67.948l-4.597 0.319h-135.395c40.05 37 60.803 81.601 60.803 133.575 0 128.569-147.092 211.171-307.382 192.512-101.717-11.833-173.352-52.565-210.944-122.971a34.133 34.133 0 0 1 60.211-32.176c25.942 48.606 77.46 77.915 158.606 87.381 124.837 14.473 231.242-45.283 231.242-124.746 0-53.339-36.636-96.802-116.736-131.345l-5.279-2.23H182.044a34.133 34.133 0 0 1-33.815-29.492L147.911 524.8a34.133 34.133 0 0 1 29.491-33.815l4.642-0.318z m68.767-176.447c6.918-128.796 128.432-203.343 287.812-184.82 99.579 11.56 175.81 47.923 226.737 109.636a34.133 34.133 0 1 1-52.657 43.463c-38.775-47.013-98.759-75.639-181.999-85.288-123.654-14.381-211.627 36.591-211.627 117.009 0 35.135 10.65 61.349 37.774 90.203l5.826 6.007c4.278 4.369 8.966 8.875 11.377 10.923l1.411 0.91H288.085l-1.092-1.729c-6.508-9.376-38.958-54.386-36.182-106.314z" fill="currentColor"/></svg>'},{id:"code",title:i("mark.inlineCode"),iconHtml:'<svg viewBox="0 0 1024 1024" width="15" height="15" aria-hidden="true"><path d="M197.802 747.664v-145.287a58.916 58.916 0 0 0-58.916-58.916h-19.619v-62.922h19.619a58.916 58.916 0 0 0 58.916-58.916V276.336a117.832 117.832 0 0 1 117.832-117.832h39.297v78.535h-39.356a39.297 39.297 0 0 0-39.238 39.297v161.017A78.594 78.594 0 0 1 222.37 512a78.594 78.594 0 0 1 53.967 74.646V747.664a39.238 39.238 0 0 0 39.238 39.238h39.356v78.594h-39.356a117.832 117.832 0 0 1-117.832-117.832z m628.456-145.287V747.664a117.832 117.832 0 0 1-117.832 117.832h-39.356v-78.594h39.356a39.238 39.238 0 0 0 39.238-39.238v-161.017A78.535 78.535 0 0 1 801.63 512a78.594 78.594 0 0 1-53.967-74.646V276.336a39.297 39.297 0 0 0-39.238-39.297h-39.356V158.504h39.356a117.832 117.832 0 0 1 117.832 117.832v145.287a58.916 58.916 0 0 0 58.916 58.916h19.56v62.922h-19.56a58.916 58.916 0 0 0-58.916 58.916z" fill="currentColor"/></svg>'}]),It=n.computed(()=>{const L=r.blockType,g=r.blockAttrs,H=(Ee,Be)=>L===Ee&&(Be===void 0||Number(g.level)===Be);return[{id:"text",label:i("turnInto.paragraph"),iconHtml:ul,active:H("paragraph"),convertType:"paragraph"},{id:"h1",label:i("turnInto.h1"),iconHtml:fl,active:H("heading",1),convertType:"heading",convertAttrs:{level:1}},{id:"h2",label:i("turnInto.h2"),iconHtml:pl,active:H("heading",2),convertType:"heading",convertAttrs:{level:2}},{id:"h3",label:i("turnInto.h3"),iconHtml:ml,active:H("heading",3),convertType:"heading",convertAttrs:{level:3}},{id:"h4",label:i("turnInto.h4"),iconHtml:hl,active:H("heading",4),convertType:"heading",convertAttrs:{level:4}},{id:"h5",label:i("turnInto.h5"),iconHtml:gl,active:H("heading",5),convertType:"heading",convertAttrs:{level:5}},{id:"h6",label:i("turnInto.h6"),iconHtml:bl,active:H("heading",6),convertType:"heading",convertAttrs:{level:6}},{id:"bullet",label:i("turnInto.bullet"),iconHtml:kl,active:H("bulletList"),convertType:"bulletList"},{id:"ordered",label:i("turnInto.ordered"),iconHtml:yl,active:H("orderedList"),convertType:"orderedList"},{id:"todo",label:i("turnInto.todo"),iconHtml:wl,active:H("todoList"),convertType:"todoList",convertAttrs:{checked:!1}},{id:"quote",label:i("turnInto.quote"),iconHtml:El,active:H("quote"),convertType:"quote"},{id:"code",label:i("turnInto.code"),iconHtml:vl,active:H("codeBlock"),convertType:"codeBlock",convertAttrs:{language:"plain"}}]}),Je=n.computed(()=>{const L=It.value.find(g=>g.active);return L?L.label:i("turnInto.paragraph")}),Le=n.computed(()=>[{id:"left",label:i("align.left"),value:"left"},{id:"center",label:i("align.center"),value:"center"},{id:"right",label:i("align.right"),value:"right"},{id:"justify",label:i("align.justify"),value:"justify"}]),mt=n.computed(()=>[{id:"top",label:i("verticalAlign.top"),value:"top"},{id:"middle",label:i("verticalAlign.middle"),value:"middle"},{id:"bottom",label:i("verticalAlign.bottom"),value:"bottom"}]),fe=ms,_t=hs;function Ve(){var w;const L=d.value,g=J.value;if(!L||!g){A.value=!1;return}const H=g.scrollLeft;g.style.maxWidth="",g.offsetWidth;const ue=g.scrollWidth,Ee=r.inline?Math.max(120,(((w=L.parentElement)==null?void 0:w.clientWidth)??L.clientWidth)-8):Math.max(200,document.documentElement.clientWidth-32),Be=Hp*2,y=Ee-Be;if(ue>y){A.value=!0,g.style.maxWidth=`${y}px`;const C=Math.max(0,g.scrollWidth-g.clientWidth);g.scrollLeft=Math.min(H,C),_e()}else A.value=!1,g.style.maxWidth="",_.value=!1,I.value=!1}function _e(){const L=J.value;L&&(_.value=L.scrollLeft>0,I.value=L.scrollLeft+L.clientWidth<L.scrollWidth-1)}function Ft(L){F.value=null;const g=J.value;g&&(g.scrollLeft+=L*Pp,_e())}let Ct=null,Et=0,je=0,ce=!1,D=!1;function M(L){if(!ce)return;const g=L.touches[0];if(!g)return;const H=Math.abs(g.clientX-Et),ue=Math.abs(g.clientY-je);(H>ks||ue>ks)&&(D||(F.value=null),D=!0)}function X(L){if(!ce)return;const g=Ct;Ct=null,ce=!1;const H=D;D=!1,H||(L.cancelable&&L.preventDefault(),g&&g())}function Oe(L,g){g.cancelable&&g.preventDefault(),Ft(L)}function Ne(L,g){const H=g.touches[0];H&&(Et=H.clientX,je=H.clientY),Ct=L,ce=!0,D=!1}n.watch([()=>r.visible,()=>r.selectionRect,d,()=>r.inline],async()=>{if(r.inline){r.visible&&Ve();return}if(!r.visible||!r.selectionRect||!r.rootEl)return;const L=d.value;if(!L||F.value)return;Ve(),await n.nextTick();const g=L.getBoundingClientRect(),H=g.width,ue=Math.max(g.height,jo);z.value=r.tableMode?cl(r.rootEl,r.selectionRect,{width:H,height:ue}):al(r.rootEl,r.selectionRect,{width:H,height:ue})},{flush:"post",immediate:!0});const Ie=n.computed(()=>({top:"0px",left:"0px",width:"100vw",height:"100vh"})),Qt=n.computed(()=>{const L=d.value,g=(L==null?void 0:L.offsetWidth)??Vp,H=document.documentElement.clientWidth,ue=8;let Ee=z.value.left;const Be=Math.max(ue,H-g-ue);Ee=Math.max(ue,Math.min(Be,Ee));const y={top:`${z.value.top}px`,left:`${Ee}px`};if(r.selectionRect){const C=r.selectionRect.left+r.selectionRect.width/2-Ee,B=Math.max(10,Math.min(g-10,C));y["--ht-arrow-x"]=`${B}px`}return y});async function St(L){F.value=F.value===L?null:L,F.value&&(await n.nextTick(),Mn())}n.watch(F,(L,g)=>{g&&!L&&!r.inline&&_n()});function _n(){Ln===null&&(Ln=requestAnimationFrame(()=>{if(Ln=null,r.inline)return;const L=d.value;!r.visible||!r.selectionRect||!r.rootEl||!L||(Ve(),n.nextTick().then(()=>{const g=L.getBoundingClientRect();z.value=r.tableMode?cl(r.rootEl,r.selectionRect,{width:g.width,height:Math.max(g.height,jo)}):al(r.rootEl,r.selectionRect,{width:g.width,height:Math.max(g.height,jo)})}))}))}let Ln=null;function Mn(){const L=F.value;if(!L)return;const g=L==="type"?f.value:L==="align"?u.value:L==="verticalAlign"?m.value:h.value,H=L==="type"?p.value:L==="align"?b.value:L==="verticalAlign"?x.value:O.value;if(!g||!H)return;const ue=H.getBoundingClientRect(),Ee=window.innerHeight,Be=6,y=Math.floor(Ee-ue.bottom-Be),w=Math.floor(ue.top-Be),C=g.scrollHeight;if(r.inline){const ee=document.documentElement.clientHeight,ne=10;if(c.value){j.value=!0,P.value=Math.max(120,w-ne);const he=ee-ue.top+Be;if(L==="color"){const be=document.documentElement.clientWidth;$.value={bottom:he,right:Math.max(8,be-ue.right)}}else $.value={left:Math.max(8,ue.left),bottom:he}}else{j.value=!1,P.value=Math.max(120,y-ne);const he=ue.bottom+Be;if(L==="color"){const be=document.documentElement.clientWidth;$.value={top:he,right:Math.max(8,be-ue.right)}}else $.value={left:Math.max(8,ue.left),top:he}}n.nextTick(ze);return}$.value=null;let B=!1;if(r.rootEl&&d.value){const ee=r.rootEl.getBoundingClientRect(),ne=d.value.getBoundingClientRect();ee.bottom-ne.bottom<ys&&w>ys&&(B=!0)}let K=!1,G;B?(K=!0,G=w):C<=y?(K=!1,G=y):w>y?(K=!0,G=w):(K=!1,G=y),j.value=K,P.value=Math.max(120,Math.min(G,360)),n.nextTick(ze)}function ze(){const L=U.value;if(!L){te.value=!1,W.value=!1;return}te.value=L.scrollTop>1,W.value=L.scrollTop+L.clientHeight<L.scrollHeight-1}function ot(){const L=U.value;L&&(L.scrollTop-=L.clientHeight*.8)}function De(){const L=U.value;L&&(L.scrollTop+=L.clientHeight*.8)}mr(U,ze);function We(L){var H,ue,Ee,Be,y;if(l("interacting"),r.tableMode||r.cellEditMode){L.convertType==="heading"&&((H=L.convertAttrs)!=null&&H.level)?l("tableType",`heading${L.convertAttrs.level}`):l("tableType",L.convertType),F.value=null,r.tableMode&&l("close");return}const g=ht();if(g){for(const w of g.ranges)(Ee=(ue=a.commands).convertBlock)==null||Ee.call(ue,{id:w.id,type:L.convertType,attrs:L.convertAttrs??{}});F.value=null,l("close");return}E.value&&((y=(Be=a.commands).convertBlock)==null||y.call(Be,{id:E.value,type:L.convertType,attrs:L.convertAttrs??{}}),F.value=null,l("close"))}function st(L){var H,ue,Ee,Be;if(l("interacting"),r.tableMode||r.cellEditMode){l("tableAlign",L),F.value=null;return}const g=ht();if(g){for(const y of g.ranges)(ue=(H=a.commands).setBlockAlign)==null||ue.call(H,{id:y.id,align:L});F.value=null;return}E.value&&((Be=(Ee=a.commands).setBlockAlign)==null||Be.call(Ee,{id:E.value,align:L}),F.value=null)}function at(L){if(r.tableMode||r.cellEditMode){l("tableVerticalAlign",L),F.value=null;return}F.value=null}function et(L){var ue,Ee,Be,y;if(l("interacting"),r.tableMode){l("tableTextColor",L==="default"?null:L),F.value=null;return}if(r.cellEditMode){const w=window.getSelection();if(w&&w.rangeCount>0&&!w.isCollapsed){const C=w.getRangeAt(0);if(L==="default"){const B=C.extractContents();B.querySelectorAll('span[class*="be-color-"]').forEach(K=>{const G=K.className.replace(/be-color-\w+/g,"").trim();if(G)K.className=G;else{for(;K.firstChild;)K.parentNode.insertBefore(K.firstChild,K);K.parentNode.removeChild(K)}}),C.insertNode(B)}else{const B=document.createElement("span");B.className=`be-color-${L}`,B.appendChild(C.extractContents()),C.insertNode(B),w.removeAllRanges();const K=document.createRange();K.selectNodeContents(B),w.addRange(K)}}F.value=null,rt();return}const g=ht();if(g){for(const w of g.ranges)(Ee=(ue=a.commands).setInlineMark)==null||Ee.call(ue,{id:w.id,markType:"color",attrs:L==="default"?null:{color:L},from:w.from,to:w.to});return}if(!E.value)return;const H=dt();H&&((y=(Be=a.commands).setInlineMark)==null||y.call(Be,{id:E.value,markType:"color",attrs:L==="default"?null:{color:L},from:H.from,to:H.to}),n.nextTick(()=>{var ne;const w=window.getSelection(),C=(ne=r.rootEl)==null?void 0:ne.querySelector(`[data-block-id="${r.blockId}"]`),B=w&&w.rangeCount>0?w.getRangeAt(0):null,K=!!C,G=!!(B&&C&&C.contains(B.commonAncestorContainer)),ee=!!(B&&!B.collapsed&&G);if(!K){l("close");return}if(!ee&&!G){l("close");return}rt(),Xe()}))}function Tt(L){var ue,Ee,Be,y;if(l("interacting"),r.tableMode){l("tableBgColor",L==="default"?null:L),F.value=null;return}if(r.cellEditMode){const w=window.getSelection();if(w&&w.rangeCount>0&&!w.isCollapsed){const C=w.getRangeAt(0);if(L==="default"){const B=C.extractContents();B.querySelectorAll('span[class*="be-bg-"]').forEach(K=>{const G=K.className.replace(/be-bg-\w+/g,"").trim();if(G)K.className=G;else{for(;K.firstChild;)K.parentNode.insertBefore(K.firstChild,K);K.parentNode.removeChild(K)}}),C.insertNode(B)}else{const B=document.createElement("span");B.className=`be-bg-${L}`,B.appendChild(C.extractContents()),C.insertNode(B),w.removeAllRanges();const K=document.createRange();K.selectNodeContents(B),w.addRange(K)}}F.value=null,rt();return}const g=ht();if(g){for(const w of g.ranges)(Ee=(ue=a.commands).setInlineMark)==null||Ee.call(ue,{id:w.id,markType:"bgColor",attrs:L==="default"?null:{bgColor:L},from:w.from,to:w.to});return}if(!E.value)return;const H=dt();H&&((y=(Be=a.commands).setInlineMark)==null||y.call(Be,{id:E.value,markType:"bgColor",attrs:L==="default"?null:{bgColor:L},from:H.from,to:H.to}),n.nextTick(()=>{var ne;const w=window.getSelection(),C=(ne=r.rootEl)==null?void 0:ne.querySelector(`[data-block-id="${r.blockId}"]`),B=w&&w.rangeCount>0?w.getRangeAt(0):null,K=!!C,G=!!(B&&C&&C.contains(B.commonAncestorContainer)),ee=!!(B&&!B.collapsed&&G);if(!K){l("close");return}if(!ee&&!G){l("close");return}rt(),Xe()}))}function rt(){if(r.tableMode){pe.value=r.tableActiveColor??"",re.value=r.tableActiveBgColor??"";return}if(r.visible&&r.blockId&&r.rootEl){const C=Ae(),B=window.getSelection();if(C&&B&&B.rangeCount>0){const K=B.getRangeAt(0);if(!K.collapsed&&C.contains(K.commonAncestorContainer)){const G=new Set,ee=new Set,ne=[],ye=document.createTreeWalker(C,NodeFilter.SHOW_TEXT);for(;ye.nextNode();){const he=ye.currentNode;(he.nodeValue??"").length!==0&&K.intersectsNode(he)&&ne.push(he)}for(const he of ne){let be=he.parentNode;for(;be&&be!==C;){if(be.nodeType===Node.ELEMENT_NODE){const ve=be.className;if(typeof ve=="string"){const $e=ve.match(/be-color-(\w+)/);$e&&G.add($e[1]);const Fe=ve.match(/be-bg-(\w+)/);Fe&&ee.add(Fe[1])}}be=be.parentNode}}if(G.size>0||ee.size>0){pe.value=G.size===1?[...G][0]:"",re.value=ee.size===1?[...ee][0]:"";return}}}}const L=T.value,g=r.blockId?L.doc.blocks.get(r.blockId):void 0;if(!g){pe.value="",re.value="";return}const H=L.selection;let ue,Ee;if(H.kind==="text"&&H.anchor.blockId===r.blockId&&H.focus.blockId===r.blockId)ue=Math.min(H.anchor.offset,H.focus.offset),Ee=Math.max(H.anchor.offset,H.focus.offset);else{const C=dt();ue=C?C.from:0,Ee=C?C.to:Me(g.content).length}if(ue>=Ee){pe.value="",re.value="";return}const Be=new Set,y=new Set;let w=0;for(const C of g.content){if(C.type!=="text")continue;const B=w,K=w+C.text.length;if(K>ue&&B<Ee&&C.marks)for(const G of C.marks)G.type==="color"&&G.attrs&&typeof G.attrs.color=="string"&&Be.add(G.attrs.color),G.type==="bgColor"&&G.attrs&&typeof G.attrs.bgColor=="string"&&y.add(G.attrs.bgColor);w=K}pe.value=Be.size===1?[...Be][0]:"",re.value=y.size===1?[...y][0]:""}function dt(){if(!r.blockId||!r.rootEl)return null;const L=r.rootEl.querySelector(`[data-block-id="${r.blockId}"]`);if(!L)return null;const g=window.getSelection();if(!g||g.rangeCount===0)return null;const H=g.getRangeAt(0);if(H.collapsed||!L.contains(H.commonAncestorContainer))return null;const ue=document.createRange();ue.selectNodeContents(L),ue.setEnd(H.startContainer,H.startOffset);const Ee=ue.toString().length;ue.setEnd(H.endContainer,H.endOffset);const Be=ue.toString().length;return{from:Math.min(Ee,Be),to:Math.max(Ee,Be)}}function ht(){const L=T.value.selection;if(L.kind!=="text"||!Ht(L))return null;const g=T.value.doc,H=Bn(g),ue=H.indexOf(L.anchor.blockId),Ee=H.indexOf(L.focus.blockId);if(ue===-1||Ee===-1)return null;const[Be,y]=ue<=Ee?[L.anchor,L.focus]:[L.focus,L.anchor],w=H.indexOf(Be.blockId),C=H.indexOf(y.blockId);if(w===-1||C===-1||w>C)return null;const B=[];for(let K=w;K<=C;K++){const G=H[K],ee=g.blocks.get(G);if(!ee)continue;const ne=Me(ee.content).length;let ye=0,he=ne;K===w&&(ye=Math.min(Be.offset,ne)),K===C&&(he=Math.min(y.offset,ne)),B.push({id:G,from:ye,to:he})}return{ranges:B}}function Jt(){const L=T.value.selection;if(L.kind!=="text"||!Ht(L))return null;const g=ht();if(!g)return null;const H=T.value.doc,ue=[],Ee=[];for(const Be of g.ranges){const y=H.blocks.get(Be.id);if(!y)continue;const[,w]=Ut(y.content,Be.from),[C]=Ut(w,Be.to-Be.from);ue.push(Me(C)),Ee.push(eo(C))}return{text:ue.join(`
|
|
14
|
+
`),html:Ee.join("<br>")}}function $t(L){var ue,Ee,Be,y;if(l("interacting"),r.tableMode){l("tableMark",L);return}if(r.cellEditMode){const C={bold:"bold",italic:"italic",underline:"underline",strikethrough:"strikeThrough",code:"insertHTML"}[L];if(C==="insertHTML"){const B=window.getSelection();if(B&&B.rangeCount>0&&!B.isCollapsed){const K=B.getRangeAt(0),G=document.createElement("code");try{G.appendChild(K.extractContents()),K.insertNode(G),B.removeAllRanges();const ee=document.createRange();ee.selectNodeContents(G),B.addRange(ee)}catch{}}}else C&&document.execCommand(C);Xe();return}const g=ht();if(g){for(const w of g.ranges)(Ee=(ue=a.commands).toggleMark)==null||Ee.call(ue,{id:w.id,markType:L,from:w.from,to:w.to});return}if(!E.value)return;const H=dt();H&&((y=(Be=a.commands).toggleMark)==null||y.call(Be,{id:E.value,markType:L,from:H.from,to:H.to}),n.nextTick(()=>{var ne;xe.value++;const w=window.getSelection(),C=(ne=r.rootEl)==null?void 0:ne.querySelector(`[data-block-id="${r.blockId}"]`),B=w&&w.rangeCount>0?w.getRangeAt(0):null,K=!!C,G=!!(B&&C&&C.contains(B.commonAncestorContainer)),ee=!!(B&&!B.collapsed&&G);if(!K){l("close");return}if(!ee&&!G){l("close");return}Xe(),rt()}))}function Wn(){if(l("interacting"),F.value=null,r.cellEditMode){l("linkClick",E.value??"",0,0);return}if(E.value){const L=dt();L&&l("linkClick",E.value,L.from,L.to)}}function on(){var ue,Ee;if(r.tableMode){l("tableCopy"),l("close");return}const L=Jt();if(L){(ue=navigator.clipboard)==null||ue.writeText(L.text),l("close");return}const g=window.getSelection(),H=g?g.toString():"";H&&((Ee=navigator.clipboard)==null||Ee.writeText(H)),l("close")}t({});async function Nn(){if(r.inline){r.visible&&Ve(),F.value&&Mn(),ze(),Xe(),rt();return}if(r.visible&&r.selectionRect&&r.rootEl&&d.value){if(F.value){Mn(),ze(),Xe(),rt();return}Ve(),await n.nextTick();const L=d.value.getBoundingClientRect();z.value=r.tableMode?cl(r.rootEl,r.selectionRect,{width:L.width,height:Math.max(L.height,jo)}):al(r.rootEl,r.selectionRect,{width:L.width,height:Math.max(L.height,jo)})}F.value&&Mn(),ze(),Xe(),rt()}function yn(L){if(!F.value)return;const g=[f.value,u.value,m.value,h.value],H=[p.value,b.value,x.value,O.value];for(const ue of g)if(ue&&ue.contains(L))return;for(const ue of H)if(ue&&ue.contains(L))return;F.value=null}function fo(L){if(!r.visible)return;const g=d.value;if(g&&g.contains(L.target)){L.preventDefault(),F.value&&yn(L.target);return}yn(L.target)}function po(L){if(!r.visible||!L.touches[0])return;const H=L.target,ue=d.value;if(ue&&ue.contains(H)){const Ee=J.value;if(Ee&&Ee.contains(H)){F.value&&yn(H);return}L.preventDefault(),F.value&&yn(H);return}yn(H)}n.watch(()=>r.visible,L=>{L&&n.nextTick(()=>{Xe(),rt()})}),n.onMounted(()=>{window.addEventListener("scroll",Nn,!0),window.addEventListener("resize",Nn),window.addEventListener("mousedown",fo,!0),window.addEventListener("touchstart",po,!0),document.addEventListener("selectionchange",On),R=a.subscribe(()=>{n.nextTick(()=>{const L=a.getState();T.value=L,xe.value++,Xe(),rt()})})}),n.onBeforeUnmount(()=>{window.removeEventListener("scroll",Nn,!0),window.removeEventListener("resize",Nn),window.removeEventListener("mousedown",fo,!0),window.removeEventListener("touchstart",po,!0),document.removeEventListener("selectionchange",On),R==null||R(),R=null});function On(){r.visible&&wn===null&&(wn=requestAnimationFrame(()=>{wn=null,r.visible&&(Xe(),rt())}))}let wn=null;return(L,g)=>(n.openBlock(),n.createBlock(n.Teleport,{to:"body",disabled:e.inline},[n.createElementVNode("div",{class:n.normalizeClass(["hover-toolbar-shell",{visible:e.visible,"inline-shell":e.inline,"inline-visible":e.inline&&e.visible}]),style:n.normalizeStyle(e.inline?void 0:Ie.value),"aria-hidden":!e.visible,onMousedownCapture:n.withModifiers(s,["prevent"])},[n.createElementVNode("div",{ref_key:"toolbarEl",ref:d,class:n.normalizeClass(["hover-toolbar",{above:z.value.above,below:!z.value.above,"ht-overflow":A.value,"inline-mode":e.inline}]),style:n.normalizeStyle(e.inline?void 0:Qt.value),role:"toolbar","aria-label":n.unref(i)("hoverToolbar.label")},[A.value?(n.openBlock(),n.createElementBlock("button",{key:0,class:n.normalizeClass(["ht-nav-btn ht-nav-left",{disabled:!_.value}]),title:n.unref(i)("ui.scrollLeft"),"aria-label":n.unref(i)("ui.scrollLeft"),onMousedown:g[0]||(g[0]=n.withModifiers(H=>Ft(-1),["prevent","stop"])),onTouchstart:g[1]||(g[1]=n.withModifiers(()=>{},["stop"])),onTouchend:g[2]||(g[2]=n.withModifiers(H=>Oe(-1,H),["stop"])),onClick:g[3]||(g[3]=n.withModifiers(()=>{},["prevent","stop"]))},[...g[39]||(g[39]=[n.createElementVNode("svg",{viewBox:"0 0 12 12",width:"10",height:"10","aria-hidden":"true"},[n.createElementVNode("path",{d:"M7.5 3L4.5 6L7.5 9",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],42,Wf)):n.createCommentVNode("",!0),n.createElementVNode("div",{ref_key:"htContentEl",ref:J,class:n.normalizeClass(["ht-content",{"dropdown-open":!e.inline&&!!F.value}]),onScroll:_e,onTouchmovePassive:M,onTouchend:n.withModifiers(X,["stop"])},[n.createElementVNode("div",Gf,[n.createElementVNode("button",{ref_key:"typeBtnEl",ref:p,class:n.normalizeClass(["ht-btn ht-type-btn",{open:F.value==="type",disabled:Gt.value}]),title:n.unref(i)("hoverToolbar.typeBtnTitle"),disabled:Gt.value,onMousedown:g[4]||(g[4]=n.withModifiers(H=>!Gt.value&&St("type"),["prevent","stop"])),onTouchstart:g[5]||(g[5]=n.withModifiers(H=>{Ne(()=>{Gt.value||St("type")},H)},["stop"])),onClick:g[6]||(g[6]=n.withModifiers(()=>{},["prevent","stop"]))},[n.createElementVNode("span",Zf,n.toDisplayString(Je.value),1),g[40]||(g[40]=n.createElementVNode("svg",{class:"ht-caret",viewBox:"0 0 12 12",width:"10",height:"10","aria-hidden":"true"},[n.createElementVNode("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],42,Yf),(n.openBlock(),n.createBlock(n.Teleport,{to:"body",disabled:!e.inline},[F.value==="type"?(n.openBlock(),n.createElementBlock("div",{key:0,ref_key:"typeDropdownEl",ref:f,class:n.normalizeClass(["ht-dropdown",[e.inline?"ht-dropdown-inline":"",{above:j.value}]]),style:n.normalizeStyle([S.value,N.value])},[te.value?(n.openBlock(),n.createElementBlock("button",{key:0,class:"menu-scroll-btn menu-scroll-up",type:"button","aria-label":n.unref(i)("ui.scrollUp"),onMousedown:n.withModifiers(ot,["prevent"])},[...g[41]||(g[41]=[n.createElementVNode("svg",{viewBox:"0 0 12 12",width:"10",height:"10","aria-hidden":"true"},[n.createElementVNode("path",{d:"M3 7.5L6 4.5L9 7.5",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],40,Xf)):n.createCommentVNode("",!0),n.createElementVNode("div",{ref_key:"scrollEl",ref:U,class:"ht-dropdown-scroll",onScroll:ze},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(It.value,H=>(n.openBlock(),n.createElementBlock("button",{key:H.id,class:n.normalizeClass(["ht-dropdown-item",{active:H.active}]),onMousedown:n.withModifiers(ue=>We(H),["prevent","stop"])},[n.createVNode(Xt,{class:"ht-dropdown-icon",html:H.iconHtml},null,8,["html"]),n.createElementVNode("span",null,n.toDisplayString(H.label),1),H.active?(n.openBlock(),n.createElementBlock("svg",Qf,[...g[42]||(g[42]=[n.createElementVNode("path",{d:"M2.5 6L5 8.5L9.5 4",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):n.createCommentVNode("",!0)],42,jf))),128))],544),W.value?(n.openBlock(),n.createElementBlock("button",{key:1,class:"menu-scroll-btn menu-scroll-down",type:"button","aria-label":n.unref(i)("ui.scrollDown"),onMousedown:n.withModifiers(De,["prevent"])},[...g[43]||(g[43]=[n.createElementVNode("svg",{viewBox:"0 0 12 12",width:"10",height:"10","aria-hidden":"true"},[n.createElementVNode("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],40,Jf)):n.createCommentVNode("",!0)],6)):n.createCommentVNode("",!0)],8,["disabled"]))]),n.createElementVNode("div",ep,[n.createElementVNode("button",{ref_key:"alignBtnEl",ref:b,class:n.normalizeClass(["ht-btn ht-icon-only",{open:F.value==="align",disabled:Ot.value}]),title:n.unref(i)("hoverToolbar.alignBtnTitle"),disabled:Ot.value,onMousedown:g[7]||(g[7]=n.withModifiers(H=>!Ot.value&&St("align"),["prevent","stop"])),onTouchstart:g[8]||(g[8]=n.withModifiers(H=>{Ne(()=>{Ot.value||St("align")},H)},["stop"])),onClick:g[9]||(g[9]=n.withModifiers(()=>{},["prevent","stop"]))},[(n.openBlock(),n.createElementBlock("svg",np,[ae.value==="left"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[g[44]||(g[44]=n.createElementVNode("line",{x1:"2",y1:"4",x2:"14",y2:"4",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),g[45]||(g[45]=n.createElementVNode("line",{x1:"2",y1:"8",x2:"10",y2:"8",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),g[46]||(g[46]=n.createElementVNode("line",{x1:"2",y1:"12",x2:"12",y2:"12",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1))],64)):ae.value==="center"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[g[47]||(g[47]=n.createElementVNode("line",{x1:"2",y1:"4",x2:"14",y2:"4",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),g[48]||(g[48]=n.createElementVNode("line",{x1:"4",y1:"8",x2:"12",y2:"8",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),g[49]||(g[49]=n.createElementVNode("line",{x1:"3",y1:"12",x2:"13",y2:"12",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1))],64)):ae.value==="right"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:2},[g[50]||(g[50]=n.createElementVNode("line",{x1:"2",y1:"4",x2:"14",y2:"4",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),g[51]||(g[51]=n.createElementVNode("line",{x1:"6",y1:"8",x2:"14",y2:"8",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),g[52]||(g[52]=n.createElementVNode("line",{x1:"4",y1:"12",x2:"14",y2:"12",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1))],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:3},[g[53]||(g[53]=n.createElementVNode("line",{x1:"2",y1:"4",x2:"14",y2:"4",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),g[54]||(g[54]=n.createElementVNode("line",{x1:"2",y1:"8",x2:"14",y2:"8",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),g[55]||(g[55]=n.createElementVNode("line",{x1:"2",y1:"12",x2:"14",y2:"12",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1))],64))]))],42,tp),(n.openBlock(),n.createBlock(n.Teleport,{to:"body",disabled:!e.inline},[F.value==="align"?(n.openBlock(),n.createElementBlock("div",{key:0,ref_key:"alignDropdownEl",ref:u,class:n.normalizeClass(["ht-dropdown",[e.inline?"ht-dropdown-inline":"",{above:j.value}]]),style:n.normalizeStyle([S.value,N.value])},[te.value?(n.openBlock(),n.createElementBlock("button",{key:0,class:"menu-scroll-btn menu-scroll-up",type:"button","aria-label":n.unref(i)("ui.scrollUp"),onMousedown:n.withModifiers(ot,["prevent"])},[...g[56]||(g[56]=[n.createElementVNode("svg",{viewBox:"0 0 12 12",width:"10",height:"10","aria-hidden":"true"},[n.createElementVNode("path",{d:"M3 7.5L6 4.5L9 7.5",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],40,op)):n.createCommentVNode("",!0),n.createElementVNode("div",{ref_key:"scrollEl",ref:U,class:"ht-dropdown-scroll",onScroll:ze},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Le.value,H=>(n.openBlock(),n.createElementBlock("button",{key:H.id,class:n.normalizeClass(["ht-dropdown-item ht-align-item",{active:ae.value===H.value}]),onMousedown:n.withModifiers(ue=>st(H.value),["prevent","stop"])},[(n.openBlock(),n.createElementBlock("svg",lp,[H.value==="left"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[g[57]||(g[57]=n.createElementVNode("line",{x1:"2",y1:"4",x2:"14",y2:"4",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),g[58]||(g[58]=n.createElementVNode("line",{x1:"2",y1:"8",x2:"10",y2:"8",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),g[59]||(g[59]=n.createElementVNode("line",{x1:"2",y1:"12",x2:"12",y2:"12",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1))],64)):H.value==="center"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[g[60]||(g[60]=n.createElementVNode("line",{x1:"2",y1:"4",x2:"14",y2:"4",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),g[61]||(g[61]=n.createElementVNode("line",{x1:"4",y1:"8",x2:"12",y2:"8",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),g[62]||(g[62]=n.createElementVNode("line",{x1:"3",y1:"12",x2:"13",y2:"12",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1))],64)):H.value==="right"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:2},[g[63]||(g[63]=n.createElementVNode("line",{x1:"2",y1:"4",x2:"14",y2:"4",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),g[64]||(g[64]=n.createElementVNode("line",{x1:"6",y1:"8",x2:"14",y2:"8",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),g[65]||(g[65]=n.createElementVNode("line",{x1:"4",y1:"12",x2:"14",y2:"12",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1))],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:3},[g[66]||(g[66]=n.createElementVNode("line",{x1:"2",y1:"4",x2:"14",y2:"4",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),g[67]||(g[67]=n.createElementVNode("line",{x1:"2",y1:"8",x2:"14",y2:"8",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),g[68]||(g[68]=n.createElementVNode("line",{x1:"2",y1:"12",x2:"14",y2:"12",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1))],64))])),n.createElementVNode("span",null,n.toDisplayString(H.label),1),ae.value===H.value?(n.openBlock(),n.createElementBlock("svg",ip,[...g[69]||(g[69]=[n.createElementVNode("path",{d:"M2.5 6L5 8.5L9.5 4",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):n.createCommentVNode("",!0)],42,rp))),128))],544),W.value?(n.openBlock(),n.createElementBlock("button",{key:1,class:"menu-scroll-btn menu-scroll-down",type:"button","aria-label":n.unref(i)("ui.scrollDown"),onMousedown:n.withModifiers(De,["prevent"])},[...g[70]||(g[70]=[n.createElementVNode("svg",{viewBox:"0 0 12 12",width:"10",height:"10","aria-hidden":"true"},[n.createElementVNode("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],40,sp)):n.createCommentVNode("",!0)],6)):n.createCommentVNode("",!0)],8,["disabled"]))]),e.tableMode||e.cellEditMode?(n.openBlock(),n.createElementBlock("div",ap,[n.createElementVNode("button",{ref_key:"verticalAlignBtnEl",ref:x,class:n.normalizeClass(["ht-btn ht-icon-only",{open:F.value==="verticalAlign",disabled:Ot.value}]),title:n.unref(i)("hoverToolbar.verticalAlignBtnTitle"),disabled:Ot.value,onMousedown:g[10]||(g[10]=n.withModifiers(H=>!Ot.value&&St("verticalAlign"),["prevent","stop"])),onTouchstart:g[11]||(g[11]=n.withModifiers(H=>{Ne(()=>{Ot.value||St("verticalAlign")},H)},["stop"])),onClick:g[12]||(g[12]=n.withModifiers(()=>{},["prevent","stop"]))},[(n.openBlock(),n.createElementBlock("svg",dp,[ie.value==="top"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[g[71]||(g[71]=n.createElementVNode("line",{x1:"2",y1:"3",x2:"14",y2:"3",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),g[72]||(g[72]=n.createElementVNode("line",{x1:"4",y1:"7",x2:"12",y2:"7",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),g[73]||(g[73]=n.createElementVNode("line",{x1:"5",y1:"11",x2:"11",y2:"11",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1))],64)):ie.value==="bottom"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[g[74]||(g[74]=n.createElementVNode("line",{x1:"5",y1:"5",x2:"11",y2:"5",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),g[75]||(g[75]=n.createElementVNode("line",{x1:"4",y1:"9",x2:"12",y2:"9",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),g[76]||(g[76]=n.createElementVNode("line",{x1:"2",y1:"13",x2:"14",y2:"13",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1))],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:2},[g[77]||(g[77]=n.createElementVNode("line",{x1:"5",y1:"3",x2:"11",y2:"3",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),g[78]||(g[78]=n.createElementVNode("line",{x1:"3",y1:"8",x2:"13",y2:"8",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),g[79]||(g[79]=n.createElementVNode("line",{x1:"5",y1:"13",x2:"11",y2:"13",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1))],64))]))],42,cp),(n.openBlock(),n.createBlock(n.Teleport,{to:"body",disabled:!e.inline},[F.value==="verticalAlign"?(n.openBlock(),n.createElementBlock("div",{key:0,ref_key:"verticalAlignDropdownEl",ref:m,class:n.normalizeClass(["ht-dropdown",[e.inline?"ht-dropdown-inline":"",{above:j.value}]]),style:n.normalizeStyle([S.value,N.value])},[te.value?(n.openBlock(),n.createElementBlock("button",{key:0,class:"menu-scroll-btn menu-scroll-up",type:"button","aria-label":n.unref(i)("ui.scrollUp"),onMousedown:n.withModifiers(ot,["prevent"])},[...g[80]||(g[80]=[n.createElementVNode("svg",{viewBox:"0 0 12 12",width:"10",height:"10","aria-hidden":"true"},[n.createElementVNode("path",{d:"M3 7.5L6 4.5L9 7.5",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],40,up)):n.createCommentVNode("",!0),n.createElementVNode("div",{ref_key:"scrollEl",ref:U,class:"ht-dropdown-scroll",onScroll:ze},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(mt.value,H=>(n.openBlock(),n.createElementBlock("button",{key:H.id,class:n.normalizeClass(["ht-dropdown-item ht-align-item",{active:ie.value===H.value}]),onMousedown:n.withModifiers(ue=>at(H.value),["prevent","stop"])},[(n.openBlock(),n.createElementBlock("svg",pp,[H.value==="top"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[g[81]||(g[81]=n.createElementVNode("line",{x1:"2",y1:"3",x2:"14",y2:"3",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),g[82]||(g[82]=n.createElementVNode("line",{x1:"4",y1:"7",x2:"12",y2:"7",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),g[83]||(g[83]=n.createElementVNode("line",{x1:"5",y1:"11",x2:"11",y2:"11",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1))],64)):H.value==="bottom"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[g[84]||(g[84]=n.createElementVNode("line",{x1:"5",y1:"5",x2:"11",y2:"5",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),g[85]||(g[85]=n.createElementVNode("line",{x1:"4",y1:"9",x2:"12",y2:"9",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),g[86]||(g[86]=n.createElementVNode("line",{x1:"2",y1:"13",x2:"14",y2:"13",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1))],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:2},[g[87]||(g[87]=n.createElementVNode("line",{x1:"5",y1:"3",x2:"11",y2:"3",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),g[88]||(g[88]=n.createElementVNode("line",{x1:"3",y1:"8",x2:"13",y2:"8",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),g[89]||(g[89]=n.createElementVNode("line",{x1:"5",y1:"13",x2:"11",y2:"13",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1))],64))])),n.createElementVNode("span",null,n.toDisplayString(H.label),1),ie.value===H.value?(n.openBlock(),n.createElementBlock("svg",mp,[...g[90]||(g[90]=[n.createElementVNode("path",{d:"M2.5 6L5 8.5L9.5 4",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):n.createCommentVNode("",!0)],42,fp))),128))],544),W.value?(n.openBlock(),n.createElementBlock("button",{key:1,class:"menu-scroll-btn menu-scroll-down",type:"button","aria-label":n.unref(i)("ui.scrollDown"),onMousedown:n.withModifiers(De,["prevent"])},[...g[91]||(g[91]=[n.createElementVNode("svg",{viewBox:"0 0 12 12",width:"10",height:"10","aria-hidden":"true"},[n.createElementVNode("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],40,hp)):n.createCommentVNode("",!0)],6)):n.createCommentVNode("",!0)],8,["disabled"]))])):n.createCommentVNode("",!0),g[100]||(g[100]=n.createElementVNode("div",{class:"ht-sep"},null,-1)),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(bt.value,H=>(n.openBlock(),n.createElementBlock("button",{key:H.id,class:n.normalizeClass(["ht-btn ht-icon-only",{active:le.value.has(H.id),disabled:qe(H.id)}]),title:H.title,disabled:qe(H.id),onMousedown:n.withModifiers(ue=>!qe(H.id)&&$t(H.id),["prevent","stop"]),onTouchstart:n.withModifiers(ue=>{Ne(()=>{qe(H.id)||$t(H.id)},ue)},["stop"]),onClick:g[13]||(g[13]=n.withModifiers(()=>{},["prevent","stop"]))},[n.createVNode(Xt,{html:H.iconHtml},null,8,["html"])],42,gp))),128)),e.tableMode?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("button",{key:1,class:n.normalizeClass(["ht-btn ht-icon-only",{active:le.value.has("link"),disabled:qe("link")}]),title:n.unref(i)("hoverToolbar.linkBtnTitle"),disabled:qe("link"),onMousedown:g[14]||(g[14]=n.withModifiers(H=>!qe("link")&&Wn(),["prevent","stop"])),onTouchstart:g[15]||(g[15]=n.withModifiers(H=>{Ne(()=>{qe("link")||Wn()},H)},["stop"])),onClick:g[16]||(g[16]=n.withModifiers(()=>{},["prevent","stop"]))},[...g[92]||(g[92]=[n.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"15",height:"15","aria-hidden":"true"},[n.createElementVNode("path",{d:"M394.666667 298.666667a32 32 0 0 1 4.693333 63.658666l-4.693333 0.341334H298.666667a149.333333 149.333333 0 0 0-8.789334 298.410666L298.666667 661.333333h96a32 32 0 0 1 4.693333 63.658667L394.666667 725.333333H298.666667a213.333333 213.333333 0 0 1-10.666667-426.410666L298.666667 298.666667h96zM725.333333 298.666667a213.333333 213.333333 0 0 1 10.666667 426.410666L725.333333 725.333333h-96a32 32 0 0 1-4.693333-63.658666l4.693333-0.341334H725.333333a149.333333 149.333333 0 0 0 8.789334-298.410666L725.333333 362.666667h-96a32 32 0 0 1-4.693333-63.658667L629.333333 298.666667H725.333333zM298.666667 480h426.666666a32 32 0 0 1 4.352 63.701333L725.333333 544H298.666667a32 32 0 0 1-4.352-63.701333L298.666667 480h426.666666H298.666667z",fill:"currentColor"})],-1)])],42,bp)),g[101]||(g[101]=n.createElementVNode("div",{class:"ht-sep"},null,-1)),n.createElementVNode("div",kp,[n.createElementVNode("button",{ref_key:"colorBtnEl",ref:O,class:n.normalizeClass(["ht-btn ht-icon-only",{open:F.value==="color",disabled:qe("color")}]),title:n.unref(i)("hoverToolbar.colorBtnTitle"),disabled:qe("color"),onMousedown:g[17]||(g[17]=n.withModifiers(H=>!qe("color")&&St("color"),["prevent","stop"])),onTouchstart:g[18]||(g[18]=n.withModifiers(H=>{Ne(()=>{qe("color")||St("color")},H)},["stop"])),onClick:g[19]||(g[19]=n.withModifiers(()=>{},["prevent","stop"]))},[...g[93]||(g[93]=[n.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"15",height:"15","aria-hidden":"true"},[n.createElementVNode("path",{d:"M163.797333 249.941333c125.44-167.082667 385.28-215.68 570.197334-100.693333 182.613333 113.493333 249.770667 331.818667 174.933333 536.618667-70.613333 193.408-256.682667 269.994667-390.784 172.714666-50.218667-36.437333-69.717333-82.133333-79.104-156.330666l-4.522667-42.112-1.92-16.981334c-5.248-39.850667-13.269333-57.685333-30.08-67.072-22.826667-12.714667-38.058667-13.013333-68.053333-1.408l-14.976 6.229334-7.637333 3.328c-43.264 18.773333-72.021333 25.386667-108.416 17.749333l-8.533334-2.005333-6.997333-2.005334c-118.997333-36.864-136.618667-198.272-24.106667-348.032z m41.984 286.549334l5.248 1.578666 5.717334 1.28c18.730667 3.712 34.730667 0.64 61.312-10.325333l25.685333-10.965333c51.285333-21.034667 84.693333-23.04 129.962667 2.133333 39.125333 21.845333 54.4 55.381333 62.165333 113.493333l2.261333 19.584 2.346667 22.698667 2.005333 18.005333c7.338667 58.069333 20.693333 89.173333 53.248 112.810667 97.066667 70.4 236.117333 13.184 293.12-142.890667 64.682667-177.152 7.424-363.264-148.650666-460.330666-156.8-97.450667-379.690667-55.722667-485.248 84.778666-88.533333 117.888-77.653333 225.28-9.173334 248.149334z m478.933334-85.077334a53.333333 53.333333 0 1 1 102.997333-27.605333 53.333333 53.333333 0 0 1-102.997333 27.605333z m21.077333 148.821334a53.333333 53.333333 0 1 1 103.04-27.605334 53.333333 53.333333 0 0 1-103.04 27.605334zM600.32 323.285333a53.333333 53.333333 0 1 1 103.04-27.605333 53.333333 53.333333 0 0 1-103.04 27.605333z m-1.194667 383.914667a53.333333 53.333333 0 1 1 102.997334-27.605333 53.333333 53.333333 0 0 1-102.997334 27.605333z m-149.205333-425.386667a53.333333 53.333333 0 1 1 103.04-27.562666 53.333333 53.333333 0 0 1-103.04 27.562666z",fill:"currentColor"})],-1)])],42,yp),(n.openBlock(),n.createBlock(n.Teleport,{to:"body",disabled:!e.inline},[F.value==="color"?(n.openBlock(),n.createElementBlock("div",{key:0,ref_key:"colorDropdownEl",ref:h,class:n.normalizeClass(["ht-dropdown ht-color-dropdown",[e.inline?"ht-dropdown-inline":"",{above:j.value}]]),style:n.normalizeStyle([S.value,N.value])},[te.value?(n.openBlock(),n.createElementBlock("button",{key:0,class:"menu-scroll-btn menu-scroll-up",type:"button","aria-label":n.unref(i)("ui.scrollUp"),onMousedown:n.withModifiers(ot,["prevent"])},[...g[94]||(g[94]=[n.createElementVNode("svg",{viewBox:"0 0 12 12",width:"10",height:"10","aria-hidden":"true"},[n.createElementVNode("path",{d:"M3 7.5L6 4.5L9 7.5",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],40,wp)):n.createCommentVNode("",!0),n.createElementVNode("div",{ref_key:"scrollEl",ref:U,class:"ht-dropdown-scroll",onScroll:ze},[n.createElementVNode("div",Ep,[n.createElementVNode("div",vp,n.toDisplayString(n.unref(i)("hoverToolbar.textColor")),1),n.createElementVNode("div",Cp,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(fe),H=>(n.openBlock(),n.createElementBlock("button",{key:"tc-"+H.key,class:n.normalizeClass(["ht-swatch",{active:pe.value===H.key}]),title:n.unref(i)(H.key==="default"?"color.default":"color."+H.key),style:n.normalizeStyle({backgroundColor:H.displayCssValue??H.cssValue}),onMousedown:n.withModifiers(ue=>et(H.key),["prevent","stop"])},null,46,Tp))),128))])]),n.createElementVNode("div",xp,[n.createElementVNode("div",_p,n.toDisplayString(n.unref(i)("hoverToolbar.bgColor")),1),n.createElementVNode("div",Mp,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(_t),H=>(n.openBlock(),n.createElementBlock("button",{key:"bc-"+H.key,class:n.normalizeClass(["ht-swatch",[{active:re.value===H.key},H.key==="default"?"ht-swatch--none":""]]),title:n.unref(i)(H.key==="default"?"color.none":"color."+H.key),style:n.normalizeStyle({backgroundColor:H.displayCssValue??H.cssValue}),onMousedown:n.withModifiers(ue=>Tt(H.key),["prevent","stop"])},null,46,Np))),128))])])],544),W.value?(n.openBlock(),n.createElementBlock("button",{key:1,class:"menu-scroll-btn menu-scroll-down",type:"button","aria-label":n.unref(i)("ui.scrollDown"),onMousedown:n.withModifiers(De,["prevent"])},[...g[95]||(g[95]=[n.createElementVNode("svg",{viewBox:"0 0 12 12",width:"10",height:"10","aria-hidden":"true"},[n.createElementVNode("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],40,Sp)):n.createCommentVNode("",!0)],6)):n.createCommentVNode("",!0)],8,["disabled"]))]),g[102]||(g[102]=n.createElementVNode("div",{class:"ht-sep"},null,-1)),n.createElementVNode("button",{class:n.normalizeClass(["ht-btn ht-icon-only",{disabled:At.value}]),title:n.unref(i)("hoverToolbar.copySelection"),"aria-label":n.unref(i)("hoverToolbar.copySelection"),disabled:At.value,onMousedown:g[20]||(g[20]=n.withModifiers(H=>!At.value&&on(),["prevent","stop"])),onTouchstart:g[21]||(g[21]=n.withModifiers(H=>{Ne(()=>{At.value||on()},H)},["stop"])),onClick:g[22]||(g[22]=n.withModifiers(()=>{},["prevent","stop"]))},[...g[96]||(g[96]=[n.createElementVNode("svg",{viewBox:"0 0 16 16",width:"15",height:"15","aria-hidden":"true"},[n.createElementVNode("rect",{x:"5",y:"5",width:"8",height:"8",rx:"1.5",fill:"none",stroke:"currentColor","stroke-width":"1.3"}),n.createElementVNode("path",{d:"M3 10.5V3.5C3 2.67 3.67 2 4.5 2H10",fill:"none",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"})],-1)])],42,Ap),e.tableMode?(n.openBlock(),n.createElementBlock(n.Fragment,{key:2},[e.showMerge||e.showSplit||e.showHeaderRow||e.showDelete?(n.openBlock(),n.createElementBlock("div",Ip)):n.createCommentVNode("",!0),e.showMerge?(n.openBlock(),n.createElementBlock("button",{key:1,class:"ht-btn ht-icon-only",title:n.unref(i)("table.mergeCells"),onMousedown:g[23]||(g[23]=n.withModifiers(H=>l("merge"),["prevent","stop"])),onTouchstart:g[24]||(g[24]=n.withModifiers(H=>Ne(()=>l("merge"),H),["stop"])),onClick:g[25]||(g[25]=n.withModifiers(()=>{},["prevent","stop"]))},[...g[97]||(g[97]=[n.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"15",height:"15",fill:"currentColor","aria-hidden":"true"},[n.createElementVNode("path",{d:"M266.666667 128A138.666667 138.666667 0 0 0 128 266.666667v490.666666A138.666667 138.666667 0 0 0 266.666667 896h490.666666A138.666667 138.666667 0 0 0 896 757.333333V266.666667A138.666667 138.666667 0 0 0 757.333333 128H266.666667zM192 266.666667c0-41.216 33.450667-74.666667 74.666667-74.666667H469.333333v128H192V266.666667z m341.333333 437.333333h298.666667v53.333333a74.666667 74.666667 0 0 1-74.666667 74.666667H533.333333v-128z m298.666667-384h-298.666667v-128h224c41.216 0 74.666667 33.450667 74.666667 74.666667V320z m-362.666667 384v128H266.666667a74.666667 74.666667 0 0 1-74.666667-74.666667V704H469.333333zM192 384h640v256h-640V384z"})],-1)])],40,Bp)):n.createCommentVNode("",!0),e.showSplit?(n.openBlock(),n.createElementBlock("button",{key:2,class:"ht-btn ht-icon-only",title:n.unref(i)("table.splitCell"),onMousedown:g[26]||(g[26]=n.withModifiers(H=>l("split"),["prevent","stop"])),onTouchstart:g[27]||(g[27]=n.withModifiers(H=>Ne(()=>l("split"),H),["stop"])),onClick:g[28]||(g[28]=n.withModifiers(()=>{},["prevent","stop"]))},[...g[98]||(g[98]=[n.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"15",height:"15",fill:"currentColor","aria-hidden":"true"},[n.createElementVNode("path",{d:"M533.333333 426.666667H469.333333v170.666666h64v-170.666666z"}),n.createElementVNode("path",{d:"M128 266.666667A138.666667 138.666667 0 0 1 266.666667 128h490.666666A138.666667 138.666667 0 0 1 896 266.666667v490.666666A138.666667 138.666667 0 0 1 757.333333 896H266.666667A138.666667 138.666667 0 0 1 128 757.333333V266.666667zM266.666667 192A74.666667 74.666667 0 0 0 192 266.666667V320H469.333333v-128H266.666667z m565.333333 512h-298.666667v128h224a74.666667 74.666667 0 0 0 74.666667-74.666667V704z m0-437.333333a74.666667 74.666667 0 0 0-74.666667-74.666667H533.333333v128h298.666667V266.666667zM192 704v53.333333c0 41.216 33.450667 74.666667 74.666667 74.666667H469.333333v-128H192z m0-64h640V384h-640v256z"})],-1)])],40,Rp)):n.createCommentVNode("",!0),e.showHeaderRow?(n.openBlock(),n.createElementBlock("button",{key:3,class:n.normalizeClass(["ht-btn ht-icon-only",{active:e.headerRowActive}]),title:n.unref(i)("table.toggleHeader"),onMousedown:g[29]||(g[29]=n.withModifiers(H=>l("tableHeaderRow"),["prevent","stop"])),onTouchstart:g[30]||(g[30]=n.withModifiers(H=>Ne(()=>l("tableHeaderRow"),H),["stop"])),onClick:g[31]||(g[31]=n.withModifiers(()=>{},["prevent","stop"]))},[...g[99]||(g[99]=[n.createElementVNode("svg",{viewBox:"0 0 16 16",width:"15",height:"15",fill:"none",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[n.createElementVNode("rect",{x:"2",y:"2",width:"12",height:"12",rx:"1"}),n.createElementVNode("path",{d:"M2 6h12"}),n.createElementVNode("path",{d:"M5 2v4"})],-1)])],42,Lp)):n.createCommentVNode("",!0),e.showDelete?(n.openBlock(),n.createElementBlock(n.Fragment,{key:4},[e.showMerge||e.showSplit||e.showHeaderRow?(n.openBlock(),n.createElementBlock("div",Op)):n.createCommentVNode("",!0),n.createElementVNode("button",{class:"ht-btn ht-danger ht-icon-only",title:e.deleteLabel||n.unref(i)("hoverToolbar.deleteBlock"),onMousedown:g[32]||(g[32]=n.withModifiers(H=>l("delete"),["prevent","stop"])),onTouchstart:g[33]||(g[33]=n.withModifiers(H=>Ne(()=>l("delete"),H),["stop"])),onClick:g[34]||(g[34]=n.withModifiers(()=>{},["prevent","stop"]))},[n.createVNode(Xt,{html:e.deleteIcon||"<svg viewBox='0 0 1024 1024' width='15' height='15' fill='currentColor' aria-hidden='true'><path d='M128 266.666667A138.666667 138.666667 0 0 1 266.666667 128h490.666666A138.666667 138.666667 0 0 1 896 266.666667v246.272a276.096 276.096 0 0 0-64-30.250667V426.666667h-170.666667v56.021333a276.096 276.096 0 0 0-64 30.250667V426.666667h-170.666666v170.666666h86.272a276.096 276.096 0 0 0-30.250667 64H426.666667v170.666667h56.021333c7.381333 22.784 17.578667 44.245333 30.250667 64H266.666667A138.666667 138.666667 0 0 1 128 757.333333V266.666667zM266.666667 192A74.666667 74.666667 0 0 0 192 266.666667V362.666667h170.666667v-170.666667H266.666667zM192 426.666667v170.666666h170.666667v-170.666666h-170.666667z m469.333333-64h170.666667V266.666667a74.666667 74.666667 0 0 0-74.666667-74.666667H661.333333v170.666667z m-64-170.666667h-170.666666v170.666667h170.666666v-170.666667z m-405.333333 469.333333v96c0 41.216 33.450667 74.666667 74.666667 74.666667H362.666667v-170.666667h-170.666667z'/><path d='M981.333333 746.666667a234.666667 234.666667 0 1 1-469.333333 0 234.666667 234.666667 0 0 1 469.333333 0z m-234.666666-30.165334l-70.229334-70.272a21.333333 21.333333 0 0 0-30.208 30.208l70.272 70.229334-70.272 70.229333a21.333333 21.333333 0 0 0 30.208 30.208l70.229334-70.272 70.229333 70.272a21.333333 21.333333 0 0 0 30.208-30.208L776.832 746.666667l70.272-70.229334a21.333333 21.333333 0 0 0-30.208-30.208L746.666667 716.501333z'/></svg>"},null,8,["html"])],40,Dp)],64)):n.createCommentVNode("",!0)],64)):n.createCommentVNode("",!0)],34),A.value?(n.openBlock(),n.createElementBlock("button",{key:1,class:n.normalizeClass(["ht-nav-btn ht-nav-right",{disabled:!I.value}]),title:n.unref(i)("ui.scrollRight"),"aria-label":n.unref(i)("ui.scrollRight"),onMousedown:g[35]||(g[35]=n.withModifiers(H=>Ft(1),["prevent","stop"])),onTouchstart:g[36]||(g[36]=n.withModifiers(()=>{},["stop"])),onTouchend:g[37]||(g[37]=n.withModifiers(H=>Oe(1,H),["stop"])),onClick:g[38]||(g[38]=n.withModifiers(()=>{},["prevent","stop"]))},[...g[103]||(g[103]=[n.createElementVNode("svg",{viewBox:"0 0 12 12",width:"10",height:"10","aria-hidden":"true"},[n.createElementVNode("path",{d:"M4.5 3L7.5 6L4.5 9",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],42,$p)):n.createCommentVNode("",!0)],14,qf)],46,Kf)],8,["disabled"]))}}),Up=["aria-label"],zp={class:"tt-left"},Fp=["disabled","title","aria-label"],Kp=["disabled","title","aria-label"],qp={key:0,class:"tt-sep"},Wp=n.defineComponent({__name:"FixedToolbar",props:{rootEl:{},focusBlockId:{},hoverVisible:{type:Boolean},hoverSelectionRect:{},hoverBlockId:{},hoverBlockType:{},hoverBlockAttrs:{},plusMenuVisible:{type:Boolean},settingsMenuVisible:{type:Boolean},position:{}},emits:["openPlusMenu","openSettingsMenu","linkClick","hoverClose","toolbarInteracting"],setup(e,{emit:t}){const o=e,r=t;function l(P){r("toolbarInteracting")}const{t:s}=Zt(),i=Vn(),a=dn(),c=n.inject(Bi,n.ref(!1)),d=n.computed(()=>o.position==="top"?!1:o.position==="bottom"?!0:c.value);n.provide(Uo,d);const f=n.inject(qr,n.ref(null)),u=n.ref(null),m=P=>{var W;if(!P)return null;const U=P.nodeType===1?P:P.parentElement;if(!U)return null;const te=U.closest(".block-content");return te&&(((W=o.rootEl)==null?void 0:W.contains(te))??!1)?te:null};let h=null;const p=()=>{if(!u.value){h=null;return}try{const P=window.getSelection();if(P&&P.rangeCount>0){const U=P.getRangeAt(0);if(!U.collapsed&&[P.anchorNode,P.focusNode,U.startContainer,U.endContainer].some(W=>m(W)!==null)){h=setTimeout(p,1500);return}}}catch{}u.value=null,h=null};n.watch([f,()=>o.hoverVisible,()=>o.hoverSelectionRect,()=>o.hoverBlockId,()=>o.hoverBlockType,()=>o.hoverBlockAttrs],()=>{const P=f.value;if(!(P&&P.visible))if(o.hoverVisible){if(h&&(clearTimeout(h),h=null),o.hoverSelectionRect===null||o.hoverBlockId===null||o.hoverBlockType===null)return;u.value={visible:!0,selectionRect:o.hoverSelectionRect,blockId:o.hoverBlockId,blockType:o.hoverBlockType,blockAttrs:o.hoverBlockAttrs,rootEl:o.rootEl,onClose:()=>r("hoverClose"),onLinkClick:(U,te,W)=>r("linkClick",U,te,W)}}else u.value&&!h&&(h=setTimeout(p,1500))},{immediate:!0,flush:"sync"});const b=n.computed(()=>{const P=f.value;if(P&&P.visible)return P;if(o.hoverVisible)return{visible:!0,selectionRect:o.hoverSelectionRect,blockId:o.hoverBlockId,blockType:o.hoverBlockType,blockAttrs:o.hoverBlockAttrs,rootEl:o.rootEl,onClose:()=>r("hoverClose"),onLinkClick:(te,W,J)=>r("linkClick",te,W,J)};if(u.value)return{...u.value,visible:!0};const U=o.focusBlockId;if(U){const te=a.getState().doc.blocks.get(U);return{visible:!0,selectionRect:null,blockId:U,blockType:(te==null?void 0:te.type)??null,blockAttrs:(te==null?void 0:te.attrs)??{},rootEl:o.rootEl,onClose:()=>r("hoverClose"),onLinkClick:(W,J,A)=>r("linkClick",W,J,A)}}return{visible:!1,selectionRect:null,blockId:null,blockType:null,blockAttrs:{},rootEl:o.rootEl}}),x=n.computed(()=>{const P=f.value;return P&&P.visible?P.blockId:o.hoverVisible&&o.hoverBlockId?o.hoverBlockId:o.focusBlockId}),O=n.ref(null),z=n.ref(null);function F(){const P=x.value,U=O.value;!P||!U||r("openPlusMenu",P,U)}function j(){const P=x.value,U=z.value;!P||!U||r("openSettingsMenu",P,U)}return n.watch(()=>o.focusBlockId,(P,U)=>{if(P!==U&&u.value){const te=u.value;P!==null&&te.blockId!==P&&(u.value=null)}}),(P,U)=>n.unref(i)?(n.openBlock(),n.createElementBlock("div",{key:0,ref:"toolbarRoot",class:n.normalizeClass(["fixed-toolbar",{"fixed-toolbar--bottom":d.value}]),role:"toolbar","aria-label":n.unref(s)("hoverToolbar.label"),onMousedownCapture:n.withModifiers(l,["prevent"])},[n.createElementVNode("div",zp,[n.createElementVNode("button",{ref_key:"plusBtnEl",ref:O,class:n.normalizeClass(["tt-btn tt-plus",{disabled:!x.value,active:e.plusMenuVisible}]),disabled:!x.value,title:n.unref(s)("handle.plus.title"),"aria-label":n.unref(s)("handle.plus.ariaLabel"),onMousedown:n.withModifiers(F,["prevent","stop"]),onTouchstart:U[0]||(U[0]=n.withModifiers(()=>{},["stop"]))},[...U[3]||(U[3]=[n.createElementVNode("svg",{viewBox:"0 0 16 16",width:"18",height:"18","aria-hidden":"true"},[n.createElementVNode("path",{d:"M8 3.5V12.5M3.5 8H12.5",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round"})],-1)])],42,Fp),n.createElementVNode("button",{ref_key:"handleBtnEl",ref:z,class:n.normalizeClass(["tt-btn tt-handle",{disabled:!x.value,active:e.settingsMenuVisible}]),disabled:!x.value,title:n.unref(s)("handle.grip.title"),"aria-label":n.unref(s)("handle.grip.ariaLabel"),onMousedown:n.withModifiers(j,["prevent","stop"]),onTouchstart:U[1]||(U[1]=n.withModifiers(()=>{},["stop"]))},[...U[4]||(U[4]=[n.createStaticVNode('<svg viewBox="0 0 16 16" width="18" height="18" aria-hidden="true"><circle cx="5" cy="4" r="1.3" fill="currentColor"></circle><circle cx="11" cy="4" r="1.3" fill="currentColor"></circle><circle cx="5" cy="8" r="1.3" fill="currentColor"></circle><circle cx="11" cy="8" r="1.3" fill="currentColor"></circle><circle cx="5" cy="12" r="1.3" fill="currentColor"></circle><circle cx="11" cy="12" r="1.3" fill="currentColor"></circle></svg>',1)])],42,Kp)]),b.value.visible?(n.openBlock(),n.createElementBlock("div",qp)):n.createCommentVNode("",!0),n.createVNode(ws,n.mergeProps({inline:""},b.value,{onInteracting:U[2]||(U[2]=te=>r("toolbarInteracting"))}),null,16)],42,Up)):n.createCommentVNode("",!0)}}),Gp={class:"olm-label"},Yp={class:"olm-label"},Zp={class:"olm-label"},hr=6,Es=n.defineComponent({__name:"OrderedListMenu",props:{visible:{type:Boolean},blockId:{},anchor:{},rootEl:{},canContinue:{type:Boolean},canStartNew:{type:Boolean},currentNumber:{}},emits:["continue","startNew","modify","close"],setup(e,{emit:t}){const o=e,r=t,{t:l}=Zt(),s=n.ref(null),i=n.ref({top:0,left:0,above:!1});n.watch([()=>o.visible,()=>o.anchor,s],async()=>{if(!o.visible||!o.anchor)return;await n.nextTick();const u=s.value;if(!u)return;const m=o.anchor.getBoundingClientRect(),h=u.getBoundingClientRect(),b=window.innerHeight-m.bottom-hr,x=m.top-hr,O=Math.max(h.height,10);let z=!1;b>=O?z=!1:x>=O?z=!0:z=x>b,i.value={top:z?m.top-(h.height+hr):m.bottom+hr,left:m.left,above:z}},{flush:"post",immediate:!0});const a=n.computed(()=>({top:`${i.value.top}px`,left:`${i.value.left}px`}));function c(){o.canContinue&&r("continue")}function d(){o.canStartNew&&r("startNew")}function f(){r("modify",o.currentNumber)}return(u,m)=>(n.openBlock(),n.createBlock(n.Teleport,{to:"body"},[e.visible&&e.anchor&&e.rootEl?(n.openBlock(),n.createElementBlock("div",{key:0,ref_key:"menuEl",ref:s,class:n.normalizeClass(["ordered-list-menu",{above:i.value.above}]),style:n.normalizeStyle(a.value),role:"menu",onMousedown:m[0]||(m[0]=n.withModifiers(()=>{},["prevent","stop"]))},[n.createElementVNode("button",{class:n.normalizeClass(["olm-item",{disabled:!e.canContinue}]),role:"menuitem",onClick:c},[m[1]||(m[1]=n.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"15",height:"15","aria-hidden":"true",fill:"currentColor"},[n.createElementVNode("path",{d:"M2.27072 1012.662857c0 6.253714 5.046857 11.337143 11.337143 11.337143h226.267428a11.337143 11.337143 0 0 0 11.337143-11.337143v-52.114286a11.337143 11.337143 0 0 0-11.337143-11.337142H120.067291L181.031863 885.028571c14.701714-15.323429 26.770286-29.257143 36.205714-41.801142l0.036572-0.109715c9.508571-13.019429 16.859429-25.965714 21.796571-38.875428a110.445714 110.445714 0 0 0 7.570286-39.862857c0-20.955429-5.193143-39.789714-15.872-56.027429a101.302857 101.302857 0 0 0-43.081143-37.156571C169.621577 662.454857 148.849006 658.285714 125.809006 658.285714a136.777143 136.777143 0 0 0-56.137143 11.812572c-17.554286 7.68-32.548571 18.797714-44.8 33.426285a111.542857 111.542857 0 0 0-24.649143 51.309715 11.337143 11.337143 0 0 0 7.753143 13.056l53.833143 16.786285a11.300571 11.300571 0 0 0 14.189714-7.570285c4.315429-14.299429 10.898286-24.137143 19.163429-30.537143l0.182857-0.146286c8.411429-6.729143 18.358857-10.203429 30.464-10.203428 11.52 0 19.931429 3.291429 26.258285 9.216l0.146286 0.109714c6.253714 5.668571 9.801143 13.531429 9.801143 25.124571 0 6.656-1.499429 13.275429-4.754286 20.004572-3.291429 6.838857-9.508571 15.798857-19.163428 26.989714-9.508571 10.971429-23.222857 25.929143-41.289143 44.909714L5.379291 958.171429a11.337143 11.337143 0 0 0-3.108571 7.826285v46.665143zM512.003291 0v109.714286h329.142858a182.857143 182.857143 0 0 1 182.857142 182.857143v438.857142a182.857143 182.857143 0 0 1-182.857142 182.857143H402.289006a36.571429 36.571429 0 1 1 0-73.142857h438.857143a109.714286 109.714286 0 0 0 109.714285-109.714286V292.571429a109.714286 109.714286 0 0 0-109.714285-109.714286h-329.142858v109.714286L292.57472 146.285714l219.428571-146.285714zM108.913006 365.714286a11.483429 11.483429 0 0 1-11.52-11.483429V76.361143H42.791863a11.483429 11.483429 0 0 1-11.52-11.483429V11.483429C31.235291 5.156571 36.391863 0 42.791863 0h128.621714C177.703863 0 182.860434 5.12 182.860434 11.483429v342.747428c0 6.326857-5.12 11.483429-11.483428 11.483429H108.913006z"})],-1)),n.createElementVNode("span",Gp,n.toDisplayString(n.unref(l)("ol.continue")),1)],2),n.createElementVNode("button",{class:n.normalizeClass(["olm-item",{disabled:!e.canStartNew}]),role:"menuitem",onClick:d},[m[2]||(m[2]=n.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"15",height:"15","aria-hidden":"true",fill:"currentColor"},[n.createElementVNode("path",{d:"M128 324.288V162.112l-17.088 17.088c-17.024 17.088-42.624 8.512-59.712-8.512C34.112 153.6 42.688 128 59.712 119.488L128 76.8c25.6-17.088 51.2-17.088 68.288 8.512 8.512 8.576 8.512 17.088 8.512 25.6v204.8c0 25.6-17.088 42.688-34.112 42.688C153.6 358.4 128 341.312 128 324.288zM170.688 469.312c-25.6 0-42.688 25.6-42.688 42.688v213.312H59.712c-8.512 0-17.024 8.576-17.024 25.6v8.576L153.6 955.712c8.512 8.576 17.088 17.088 25.6 8.576l8.512-8.576 110.976-196.224c8.512-8.576 0-25.6-8.576-25.6h-76.8V512c0-17.088-17.024-42.688-42.624-42.688zM426.688 810.688c-25.6 0-42.688 17.024-42.688 42.624s17.088 42.688 42.688 42.688h512c25.6 0 42.624-17.088 42.624-42.688s-17.024-42.624-42.624-42.624h-512zM384 512c0-25.6 17.088-42.688 42.688-42.688h512c25.6 0 42.624 17.088 42.624 42.688s-17.024 42.688-42.624 42.688h-512C401.088 554.688 384 537.6 384 512zM426.688 128c-25.6 0-42.688 17.088-42.688 42.688s17.088 42.624 42.688 42.624h512c25.6 0 42.624-17.024 42.624-42.624S964.288 128 938.688 128h-512z"})],-1)),n.createElementVNode("span",Yp,n.toDisplayString(n.unref(l)("ol.startNew")),1)],2),n.createElementVNode("button",{class:"olm-item",role:"menuitem",onClick:f},[m[3]||(m[3]=n.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"15",height:"15","aria-hidden":"true",fill:"currentColor"},[n.createElementVNode("path",{d:"M45.421714 279.771429c0 4.388571 3.547429 7.936 7.899429 7.936H96.182857c4.388571 0 7.899429-3.547429 7.899429-7.899429V44.470857A7.899429 7.899429 0 0 0 96.182857 36.571429H7.899429A7.899429 7.899429 0 0 0 0 44.470857v36.644572c0 4.388571 3.547429 7.899429 7.899429 7.899428h37.522285V279.771429z m-32.182857 326.729142a7.899429 7.899429 0 0 1-7.899428-7.899428v-32.548572c0-2.011429 0.804571-3.986286 2.194285-5.449142l63.707429-66.633143c12.617143-13.238857 22.162286-23.661714 28.781714-31.305143 6.765714-7.789714 11.081143-14.043429 13.385143-18.797714a31.817143 31.817143 0 0 0 3.291429-13.933715c0-8.045714-2.450286-13.568-6.838858-17.554285l-0.109714-0.073143c-4.388571-4.096-10.24-6.4-18.285714-6.4a32.731429 32.731429 0 0 0-21.211429 7.131428l-0.146285 0.073143c-5.741714 4.461714-10.349714 11.337143-13.348572 21.321143a7.899429 7.899429 0 0 1-9.874286 5.229714l-37.558857-11.702857a7.899429 7.899429 0 0 1-5.376-9.106286c2.742857-13.641143 8.484571-25.6 17.188572-35.730285a84.114286 84.114286 0 0 1 31.195428-23.296c12.397714-5.485714 25.453714-8.228571 39.131429-8.228572 16.091429 0 30.537143 2.889143 43.154286 8.96a69.595429 69.595429 0 0 1 41.069714 64.950857c0 9.435429-1.755429 18.688-5.229714 27.794286a118.198857 118.198857 0 0 1-15.213715 27.062857l-0.036571 0.109715c-6.582857 8.740571-14.994286 18.468571-25.234286 29.110857L87.515429 554.422857h83.492571c4.388571 0 7.899429 3.510857 7.899429 7.899429v36.315428c0 4.388571-3.547429 7.899429-7.899429 7.899429H13.238857z m38.217143 354.486858a94.939429 94.939429 0 0 1-31.963429-22.052572l-0.109714-0.109714a79.030857 79.030857 0 0 1-18.212571-34.706286 7.899429 7.899429 0 0 1 5.010285-9.325714l37.558858-13.275429c4.096-1.462857 8.594286 0.731429 10.057142 4.827429 3.328 9.508571 8.265143 16.237714 14.482286 20.845714 6.326857 4.388571 13.824 6.729143 22.857143 6.729143 7.460571 0 13.421714-1.389714 18.176-3.84l0.073143-0.073143a27.721143 27.721143 0 0 0 11.593143-10.569143 33.938286 33.938286 0 0 0 4.242285-17.408 30.573714 30.573714 0 0 0-4.132571-16.64l-0.182857-0.292571A25.673143 25.673143 0 0 0 109.714286 854.637714a41.691429 41.691429 0 0 0-18.870857-3.913143 59.465143 59.465143 0 0 0-15.213715 2.194286 33.28 33.28 0 0 0-5.229714 2.048 7.862857 7.862857 0 0 1-10.642286-3.657143l-9.801143-20.553143a7.899429 7.899429 0 0 1 1.206858-8.594285l49.371428-56.393143H22.089143a7.899429 7.899429 0 0 1-7.862857-7.899429v-36.315428c0-4.388571 3.510857-7.899429 7.862857-7.899429h144.164571c4.388571 0 7.899429 3.547429 7.899429 7.899429v33.792a7.899429 7.899429 0 0 1-1.901714 5.12L132.388571 807.131429a76.909714 76.909714 0 0 1 14.043429 6.070857c11.739429 6.582857 20.992 15.725714 27.611429 27.318857 6.656 11.702857 9.874286 25.197714 9.874285 40.228571 0 16.530286-4.022857 31.634286-12.178285 45.165715a86.930286 86.930286 0 0 1-33.28 31.268571 97.755429 97.755429 0 0 1-47.323429 11.373714c-13.787429 0-26.989714-2.486857-39.497143-7.497143l-0.182857-0.073142zM292.571429 841.142857a36.571429 36.571429 0 1 0 0 73.142857h694.857142a36.571429 36.571429 0 1 0 0-73.142857H292.571429zM986.185143 138.605714a52.516571 52.516571 0 0 0-3.254857-10.532571 112.64 112.64 0 0 0-19.712-28.818286c-8.484571-9.216-16.237714-15.652571-23.222857-19.309714a72.045714 72.045714 0 0 0-11.702858-4.534857A55.515429 55.515429 0 0 0 914.285714 73.179429a43.776 43.776 0 0 0-29.184 9.764571c-3.657143 2.998857-8.228571 7.094857-13.714285 12.288-5.485714 5.193143-10.24 9.618286-14.262858 13.275429l93.366858 93.769142c2.340571-2.011429 4.827429-4.315429 7.497142-7.021714 2.304-2.340571 5.083429-5.010286 8.228572-8.009143 3.145143-2.998857 6.729143-6.509714 10.715428-10.532571 3.657143-4.022857 6.326857-8.192 8.009143-12.544A36.205714 36.205714 0 0 0 987.428571 151.149714c0-4.352-0.402286-8.521143-1.243428-12.544zM352.073143 614.509714c-7.314286 7.533714-11.958857 12.288-13.970286 14.262857a82.578286 82.578286 0 0 0-10.715428 12.8c-2.523429 3.876571-4.754286 8.118857-6.765715 12.8a111.798857 111.798857 0 0 0-6.473143 16.566858c-2.669714 8.009143-5.412571 16.786286-8.228571 26.331428-2.852571 9.508571-5.485714 18.688-8.009143 27.574857a169.764571 169.764571 0 0 0-4.754286 20.297143c-1.316571 8.704-0.475429 14.884571 2.523429 18.541714 2.998857 3.657143 8.996571 5.010286 17.956571 4.022858 4.352-0.658286 10.898286-2.194286 19.748572-4.498286a686.957714 686.957714 0 0 0 56.137143-18.066286c8.996571-3.328 15.798857-6.217143 20.48-8.521143 4.644571-2.011429 9.142857-4.681143 13.458285-8.045714a215.954286 215.954286 0 0 0 23.954286-21.577143c6.985143-6.985143 15.798857-15.945143 26.441143-26.806857 10.678857-10.861714 22.674286-22.820571 35.949714-35.84l39.936-40.594286 363.300572-363.885714-93.330286-94.244571-363.300571 363.849142-40.448 40.594286-36.425143 36.608c-10.971429 11.044571-20.114286 20.297143-27.428572 27.830857z"})],-1)),n.createElementVNode("span",Zp,n.toDisplayString(n.unref(l)("ol.modify")),1)])],38)):n.createCommentVNode("",!0)]))}}),Xp=["aria-label"],jp=["aria-label"],Qp={class:"np-ok",type:"submit"},gr=6,vs=n.defineComponent({__name:"NumberPicker",props:{visible:{type:Boolean},initialValue:{},anchor:{},rootEl:{}},emits:["confirm","close"],setup(e,{emit:t}){const o=e,r=t,{t:l}=Zt(),s=n.ref(null),i=n.ref(o.initialValue),a=n.ref({top:0,left:0});n.watch([()=>o.visible,()=>o.anchor,()=>o.initialValue],async()=>{if(!o.visible||!o.anchor)return;i.value=o.initialValue,await n.nextTick();const f=o.anchor.getBoundingClientRect(),u=window.innerHeight,m=52;let h=!1;u-f.bottom-gr<m&&f.top-gr>m&&(h=!0),a.value={top:h?f.top-(m+gr):f.bottom+gr,left:f.left},n.nextTick(()=>{var p,b;(p=s.value)==null||p.focus(),(b=s.value)==null||b.select()})},{flush:"post",immediate:!0});const c=n.computed(()=>({top:`${a.value.top}px`,left:`${a.value.left}px`}));function d(){let f=i.value;Number.isFinite(f)||(f=o.initialValue),f=Math.max(1,Math.floor(f)),r("confirm",f)}return(f,u)=>(n.openBlock(),n.createBlock(n.Teleport,{to:"body"},[e.visible&&e.anchor&&e.rootEl?(n.openBlock(),n.createElementBlock("div",{key:0,class:"number-picker",style:n.normalizeStyle(c.value),role:"dialog","aria-label":n.unref(l)("numberPicker.title"),onMousedown:u[2]||(u[2]=n.withModifiers(()=>{},["stop"])),onTouchstart:u[3]||(u[3]=n.withModifiers(()=>{},["stop"]))},[n.createElementVNode("form",{class:"np-form",onSubmit:n.withModifiers(d,["prevent"])},[n.withDirectives(n.createElementVNode("input",{ref_key:"inputEl",ref:s,"onUpdate:modelValue":u[0]||(u[0]=m=>i.value=m),type:"number",class:"np-input",min:"1",step:"1","aria-label":n.unref(l)("numberPicker.inputLabel"),onKeydown:u[1]||(u[1]=n.withKeys(m=>r("close"),["escape"]))},null,40,jp),[[n.vModelText,i.value,void 0,{number:!0}]]),n.createElementVNode("button",Qp,n.toDisplayString(n.unref(l)("numberPicker.confirm")),1)],32)],44,Xp)):n.createCommentVNode("",!0)]))}}),Jp=["aria-label"],em={key:0,class:"clp-custom"},tm=["placeholder","aria-label"],nm={class:"clp-actions"},om={class:"clp-ok",type:"submit"},rm=["aria-label"],lm=["onClick"],im={class:"clp-item-name"},sm={key:0,class:"clp-item-check","aria-hidden":"true"},am={class:"clp-item-name"},cm=["aria-label"],ao=6,Cs=200,dm=120,um=360,fm=n.defineComponent({__name:"CodeLangPicker",props:{visible:{type:Boolean},initialValue:{},anchor:{},rootEl:{}},emits:["confirm","close"],setup(e,{emit:t}){const o=e,r=t,{t:l}=Zt(),s=["plain","javascript","typescript","python","java","c","cpp","csharp","go","rust","ruby","php","swift","kotlin","html","css","json","xml","yaml","markdown","lua","bash","shell","powershell","cmd","bat","sql","dart"],i=n.ref(null),a=n.ref(null),c=n.ref(null),d=n.ref(!1),f=n.ref(""),u=n.ref(o.initialValue),m=n.ref({top:0,left:0,above:!1,maxHeight:360}),h=n.ref(!1),p=n.ref(!1);function b(J){return J==="plain"?l("codeLang.plain"):J}function x(){if(!o.visible||!o.anchor||!o.rootEl)return;const J=i.value;if(!J)return;const A=o.anchor.getBoundingClientRect(),_=window.innerHeight,I=Math.floor(_-A.bottom-ao),S=Math.floor(A.top-ao),$=J.scrollHeight;let N=!1;o.rootEl.getBoundingClientRect().bottom-A.bottom<Cs&&S>Cs&&(N=!0);let R,Y;N?(R=!0,Y=S):$<=I?(R=!1,Y=I):S>I?(R=!0,Y=S):(R=!1,Y=I);const ae=Math.max(dm,Math.min(Y,um)),ie=document.documentElement.clientWidth,pe=Math.max(J.clientWidth,200),re=Math.max(ao,Math.min(ie-pe-ao,A.left)),le=R?Math.max(ao,A.top-ao-Math.min($,ae)):A.bottom+ao;m.value={top:le,left:re,above:R,maxHeight:ae},n.nextTick(O)}n.watch([()=>o.visible,()=>o.anchor,()=>o.initialValue],async()=>{o.visible&&(d.value=!1,u.value=o.initialValue??"plain",f.value=u.value==="plain"?"":u.value,await n.nextTick(),x())},{flush:"post",immediate:!0});function O(){const J=c.value;J&&(h.value=J.scrollTop>1,p.value=J.scrollTop+J.clientHeight<J.scrollHeight-1)}function z(){const J=c.value;J&&(J.scrollTop-=J.clientHeight*.8)}function F(){const J=c.value;J&&(J.scrollTop+=J.clientHeight*.8)}mr(c,O);function j(){d.value=!0,f.value=u.value==="plain"?"":u.value,n.nextTick(()=>{var J,A;(J=a.value)==null||J.focus(),(A=a.value)==null||A.select(),x()})}function P(){d.value=!1,n.nextTick(x)}function U(){const J=f.value.replace(/[^a-zA-Z]/g,"").slice(0,20);J!==f.value&&(f.value=J)}function te(){const J=(f.value??"").replace(/[^a-zA-Z]/g,"").slice(0,20);r("confirm",J.length===0?"plain":J)}const W=n.computed(()=>({top:`${m.value.top}px`,left:`${m.value.left}px`,maxHeight:`${m.value.maxHeight}px`}));return(J,A)=>(n.openBlock(),n.createBlock(n.Teleport,{to:"body"},[e.visible&&e.anchor&&e.rootEl?(n.openBlock(),n.createElementBlock("div",{key:0,ref_key:"menuEl",ref:i,class:n.normalizeClass(["code-lang-picker",{above:m.value.above}]),style:n.normalizeStyle(W.value),role:"menu","aria-label":n.unref(l)("codeLang.title"),onMousedown:A[1]||(A[1]=n.withModifiers(()=>{},["stop"])),onTouchstart:A[2]||(A[2]=n.withModifiers(()=>{},["stop"])),onWheel:A[3]||(A[3]=n.withModifiers(()=>{},["prevent"])),onTouchmove:A[4]||(A[4]=n.withModifiers(()=>{},["prevent"]))},[d.value?(n.openBlock(),n.createElementBlock("div",em,[n.createElementVNode("form",{class:"clp-form",onSubmit:n.withModifiers(te,["prevent"])},[n.withDirectives(n.createElementVNode("input",{ref_key:"inputEl",ref:a,"onUpdate:modelValue":A[0]||(A[0]=_=>f.value=_),type:"text",class:"clp-input",maxlength:"20",placeholder:n.unref(l)("codeLang.placeholder"),"aria-label":n.unref(l)("codeLang.inputLabel"),autocomplete:"off",spellcheck:"false",onInput:U,onKeydown:n.withKeys(P,["escape"])},null,40,tm),[[n.vModelText,f.value]]),n.createElementVNode("div",nm,[n.createElementVNode("button",om,n.toDisplayString(n.unref(l)("codeLang.confirm")),1),n.createElementVNode("button",{class:"clp-cancel",type:"button",onClick:P},n.toDisplayString(n.unref(l)("codeLang.cancel")),1)])],32)])):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[h.value?(n.openBlock(),n.createElementBlock("button",{key:0,class:"menu-scroll-btn menu-scroll-up",type:"button","aria-label":n.unref(l)("ui.scrollUp"),onMousedown:n.withModifiers(z,["prevent"])},[...A[5]||(A[5]=[n.createElementVNode("svg",{viewBox:"0 0 12 12",width:"10",height:"10","aria-hidden":"true"},[n.createElementVNode("path",{d:"M3 7.5L6 4.5L9 7.5",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],40,rm)):n.createCommentVNode("",!0),n.createElementVNode("div",{ref_key:"scrollEl",ref:c,class:"clp-list",onScroll:O},[(n.openBlock(),n.createElementBlock(n.Fragment,null,n.renderList(s,_=>n.createElementVNode("button",{key:_,class:n.normalizeClass(["clp-item",{active:_===u.value}]),role:"menuitem",onClick:I=>r("confirm",_)},[n.createElementVNode("span",im,n.toDisplayString(b(_)),1),_===u.value?(n.openBlock(),n.createElementBlock("span",sm,"✓")):n.createCommentVNode("",!0)],10,lm)),64)),n.createElementVNode("button",{class:"clp-item clp-item-custom",role:"menuitem",onClick:j},[n.createElementVNode("span",am,n.toDisplayString(n.unref(l)("codeLang.custom")),1)])],544),p.value?(n.openBlock(),n.createElementBlock("button",{key:1,class:"menu-scroll-btn menu-scroll-down",type:"button","aria-label":n.unref(l)("ui.scrollDown"),onMousedown:n.withModifiers(F,["prevent"])},[...A[6]||(A[6]=[n.createElementVNode("svg",{viewBox:"0 0 12 12",width:"10",height:"10","aria-hidden":"true"},[n.createElementVNode("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],40,cm)):n.createCommentVNode("",!0)],64))],46,Jp)):n.createCommentVNode("",!0)]))}}),pm=["aria-label"],mm={key:0,class:"link-popover-view"},hm=["href","title"],gm={class:"link-popover-actions"},bm=["title","aria-label"],km=["title","aria-label"],ym=["title","aria-label"],wm=["title","aria-label"],Em={key:1,class:"link-popover-edit"},vm=["placeholder"],Cm={key:0,class:"link-popover-error",role:"alert"},Tm=["placeholder"],xm={class:"link-popover-edit-actions"},_m=["title"],Mm=["title"],Ts=n.defineComponent({__name:"LinkPopover",props:{visible:{type:Boolean},anchorRect:{},blockId:{},from:{},to:{},href:{},text:{},initialMode:{},showTextInput:{type:Boolean},onSaveLink:{type:Function},onRemoveLinkMark:{type:Function},readonly:{type:Boolean}},emits:["close"],setup(e,{expose:t,emit:o}){const r=e,l=o,{t:s}=Zt(),i=dn(),a=n.ref(null),c=n.ref(null),d=n.ref(!1),f=n.ref(!1),u=n.ref("view"),m=n.ref(""),h=n.ref(""),p=n.ref({top:0,left:0}),b=n.ref(""),x=n.computed(()=>r.showTextInput??!1),O=n.computed(()=>u.value==="edit"?m.value:r.href),z=n.computed(()=>{const S=ro(O.value);return Un(S)??"#"}),F=n.computed(()=>{const S=O.value;return S?S.length>60?S.slice(0,57)+"...":S:s("link.emptyUrl")}),j=n.computed(()=>({top:`${p.value.top}px`,left:`${p.value.left}px`,visibility:f.value?"visible":"hidden"}));async function P(){if(!r.visible||!r.anchorRect||!a.value)return;await n.nextTick();const $=a.value.getBoundingClientRect(),N=8,E=document.documentElement.clientWidth,R=document.documentElement.clientHeight-r.anchorRect.bottom-N,Y=r.anchorRect.top-N,ie=R<$.height+N&&Y>R?Math.max(N,r.anchorRect.top-$.height-N):r.anchorRect.bottom+N,pe=r.anchorRect.left+(r.anchorRect.width-$.width)/2,re=Math.max(N,E-$.width-N),le=Math.max(N,Math.min(re,pe));p.value={top:ie,left:le},f.value=!0}n.watch(()=>r.visible,S=>{S?(d.value=!0,u.value=r.readonly?"view":r.initialMode??(r.href?"view":"edit"),m.value=r.href,h.value=r.text,f.value=!1,n.nextTick(()=>{var $,N;P(),u.value==="edit"&&(($=c.value)==null||$.focus(),(N=c.value)==null||N.select())})):(f.value=!1,setTimeout(()=>{r.visible||(d.value=!1)},200))},{immediate:!0}),n.watch(()=>r.anchorRect,()=>{r.visible&&P()});function U(){r.readonly||(u.value="edit",m.value=r.href,h.value=r.text,b.value="",n.nextTick(()=>{var S,$;(S=c.value)==null||S.focus(),($=c.value)==null||$.select()}))}function te(){const S=m.value;if(!S.trim()){b.value="";return}const $=ro(S);Un($)?b.value="":b.value=s("link.invalidUrl")}function W(){var E,T,R;if(!r.blockId&&!r.onSaveLink)return;const S=ro(m.value),$=Un(S);if(!$){b.value=s("link.invalidUrl"),(E=c.value)==null||E.focus();return}b.value="";const N=x.value&&h.value!==r.text;r.onSaveLink?r.onSaveLink($,N?h.value:void 0):(R=(T=i.commands).setLink)==null||R.call(T,{id:r.blockId,href:$,from:r.from,to:r.to,text:N?h.value:void 0}),r.href?(u.value="view",n.nextTick(()=>{P()})):l("close")}function J(){r.href?(u.value="view",m.value=r.href,h.value=r.text):l("close")}function A(){var S,$;!r.blockId&&!r.onRemoveLinkMark||(r.onRemoveLinkMark?r.onRemoveLinkMark():($=(S=i.commands).unsetLink)==null||$.call(S,{id:r.blockId,from:r.from,to:r.to}),l("close"))}function _(){var $;const S=ro(r.href);S&&(($=navigator.clipboard)==null||$.writeText(S))}function I(){const S=ro(r.href),$=Un(S);$&&$!=="#"&&window.open($,"_blank","noopener,noreferrer")}return n.onBeforeUnmount(()=>{d.value=!1}),t({isEditing:()=>u.value==="edit",save:W,cancel:J}),(S,$)=>(n.openBlock(),n.createBlock(n.Teleport,{to:"body"},[d.value?(n.openBlock(),n.createElementBlock("div",{key:0,ref_key:"popoverEl",ref:a,class:n.normalizeClass(["link-popover",{visible:f.value}]),style:n.normalizeStyle(j.value),role:"dialog","aria-label":n.unref(s)("link.popoverLabel"),onMousedown:$[2]||($[2]=n.withModifiers(()=>{},["stop"])),onTouchstart:$[3]||($[3]=n.withModifiers(()=>{},["stop"]))},[u.value==="view"?(n.openBlock(),n.createElementBlock("div",mm,[n.createElementVNode("a",{href:z.value,target:"_blank",rel:"noopener noreferrer",class:"link-popover-url",title:O.value,onClick:I},n.toDisplayString(F.value),9,hm),n.createElementVNode("div",gm,[n.createElementVNode("button",{class:"link-popover-btn",title:n.unref(s)("link.open"),"aria-label":n.unref(s)("link.open"),onMousedown:n.withModifiers(I,["prevent","stop"])},[...$[4]||($[4]=[n.createElementVNode("svg",{viewBox:"0 0 16 16",width:"14",height:"14","aria-hidden":"true"},[n.createElementVNode("path",{d:"M6 3H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h7a2 2 0 0 0 2-2v-2",fill:"none",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round","stroke-linejoin":"round"}),n.createElementVNode("path",{d:"M9 3h4v4M13 3L7 9",fill:"none",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],40,bm),n.createElementVNode("button",{class:"link-popover-btn",title:n.unref(s)("link.copy"),"aria-label":n.unref(s)("link.copy"),onMousedown:n.withModifiers(_,["prevent","stop"])},[...$[5]||($[5]=[n.createElementVNode("svg",{viewBox:"0 0 16 16",width:"14",height:"14","aria-hidden":"true"},[n.createElementVNode("rect",{x:"5",y:"5",width:"8",height:"8",rx:"1.5",fill:"none",stroke:"currentColor","stroke-width":"1.3"}),n.createElementVNode("path",{d:"M3 10.5V3.5C3 2.67 3.67 2 4.5 2H10",fill:"none",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"})],-1)])],40,km),e.readonly?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("button",{key:0,class:"link-popover-btn",title:n.unref(s)("link.edit"),"aria-label":n.unref(s)("link.edit"),onMousedown:n.withModifiers(U,["prevent","stop"])},[...$[6]||($[6]=[n.createElementVNode("svg",{viewBox:"0 0 16 16",width:"14",height:"14","aria-hidden":"true"},[n.createElementVNode("path",{d:"M11.5 2.5l2 2L6 12l-2.5.5L4 10l7.5-7.5z",fill:"none",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],40,ym)),e.readonly?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("button",{key:1,class:"link-popover-btn link-popover-danger",title:n.unref(s)("link.remove"),"aria-label":n.unref(s)("link.remove"),onMousedown:n.withModifiers(A,["prevent","stop"])},[...$[7]||($[7]=[n.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"14",height:"14","aria-hidden":"true"},[n.createElementVNode("path",{d:"M394.666667 213.333333a32 32 0 0 1 4.693333 63.658667l-4.693333 0.341333H298.666667a149.333333 149.333333 0 0 0-8.789334 298.410667L298.666667 576h96a32 32 0 0 1 4.693333 63.658667L394.666667 640H298.666667a213.333333 213.333333 0 0 1-10.666667-426.410667L298.666667 213.333333h96zM725.333333 213.333333a213.333333 213.333333 0 0 1 189.013334 312.405334 277.162667 277.162667 0 0 0-55.210667-32.64 149.333333 149.333333 0 0 0-125.013333-215.466667L725.333333 277.290667h-96a32 32 0 0 1-4.693333-63.658667L629.333333 213.333333H725.333333zM298.666667 394.666667h426.666666a32 32 0 0 1 4.352 63.701333L725.333333 458.666667H298.666667a32 32 0 0 1-4.352-63.701334L298.666667 394.666667z m682.666666 352a234.666667 234.666667 0 1 1-469.333333 0 234.666667 234.666667 0 0 1 469.333333 0z m-304.896-100.437334a21.333333 21.333333 0 0 0-30.208 30.208l70.272 70.229334-70.272 70.229333a21.333333 21.333333 0 0 0 30.208 30.208l70.229334-70.272 70.229333 70.272a21.333333 21.333333 0 0 0 30.208-30.208L776.832 746.666667l70.272-70.229334a21.333333 21.333333 0 0 0-30.208-30.208L746.666667 716.501333l-70.229334-70.272z",fill:"currentColor"})],-1)])],40,wm))])])):(n.openBlock(),n.createElementBlock("div",Em,[n.withDirectives(n.createElementVNode("input",{ref_key:"urlInputEl",ref:c,"onUpdate:modelValue":$[0]||($[0]=N=>m.value=N),class:n.normalizeClass(["link-popover-input",{"link-popover-input-error":b.value}]),type:"text",placeholder:n.unref(s)("link.urlPlaceholder"),onKeydown:[n.withKeys(W,["enter"]),n.withKeys(J,["escape"])],onInput:te},null,42,vm),[[n.vModelText,m.value]]),b.value?(n.openBlock(),n.createElementBlock("div",Cm,n.toDisplayString(b.value),1)):n.createCommentVNode("",!0),x.value?n.withDirectives((n.openBlock(),n.createElementBlock("input",{key:1,"onUpdate:modelValue":$[1]||($[1]=N=>h.value=N),class:"link-popover-input",type:"text",placeholder:n.unref(s)("link.textPlaceholder"),onKeydown:[n.withKeys(W,["enter"]),n.withKeys(J,["escape"])]},null,40,Tm)),[[n.vModelText,h.value]]):n.createCommentVNode("",!0),n.createElementVNode("div",xm,[n.createElementVNode("button",{class:"link-popover-btn link-popover-save",title:n.unref(s)("link.save"),onMousedown:n.withModifiers(W,["prevent","stop"])},n.toDisplayString(n.unref(s)("link.save")),41,_m),n.createElementVNode("button",{class:"link-popover-btn link-popover-cancel",title:n.unref(s)("link.cancel"),onMousedown:n.withModifiers(J,["prevent","stop"])},n.toDisplayString(n.unref(s)("link.cancel")),41,Mm)])]))],46,pm)):n.createCommentVNode("",!0)]))}}),Nm={default:null,validate:e=>e==null?!0:Number.isInteger(e)&&e>=1};function xs(e,t){const o=ko(e,t),r=cn(e,t);if(r<0)return 1;const l=e.blocks.get(t);if(!l)return 1;const s=l.attrs.startNumber;if(typeof s=="number")return s;let i=null,a=0;for(let c=r-1;c>=0;c--){const d=e.blocks.get(o[c]);if(!d||d.type!=="orderedList")break;const f=d.attrs.startNumber;if(typeof f=="number"){i=f;break}a++}return i!==null?i+a+1:1+a}const Sm=n.defineComponent({name:"OrderedListBlock",props:{block:{type:Object,required:!0},placeholder:{type:String,default:void 0}},setup(e){const t=dn(),o=Vn(),r=n.ref(null),l=n.useAttrs(),s={...typeof l.onLinkClick=="function"?{onLinkClick:l.onLinkClick}:{},...typeof l.onSlashTrigger=="function"?{onSlashTrigger:l.onSlashTrigger}:{},...typeof l.onInputChanged=="function"?{onInputChanged:l.onInputChanged}:{}},i=n.ref(0),a=t.subscribe(()=>{i.value++});return n.onBeforeUnmount(a),()=>{i.value;const c=t.getState().doc,d=xs(c,e.block.id),f=n.h("div",{ref:r,class:"ol-marker","data-ol-number":String(d),onMousedown:b=>{b.preventDefault(),b.stopPropagation()},onClick:b=>{if(b.stopPropagation(),!o.value)return;const x=new CustomEvent("ordered-list-marker-click",{bubbles:!0,detail:{blockId:e.block.id,anchor:r.value}});b.currentTarget.dispatchEvent(x)}},[`${d}.`]),u=bn(e.block.attrs),m=u.filter(b=>b.startsWith("be-indent-")),h=u.filter(b=>!b.startsWith("be-indent-")),p=n.h(Kn,{block:e.block,placeholder:e.placeholder,class:["block-ordered-list-content",...h],...s});return n.h("div",{class:["block-ordered-list-wrapper",...m],"data-block-type":"orderedList"},[f,p])}}}),Am={name:"orderedList",schema:{type:"orderedList",content:"text",nestable:!0,listLike:!0,attrs:{...jt,startNumber:Nm}},renderer:{component:Sm},slashCommands:[{id:"ordered-list",title:"slash.orderedList.title",keywords:["list","numbered","ordered","有序列表","编号列表","ol","1"],description:"slash.orderedList.description",icon:yl,command:"convertBlock",category:"list",args:()=>({id:"__currentBlock__",type:"orderedList"})}],inputRules:[{name:"ordered-1-dot",pattern:/^1\. $/,command:"convertBlock",args:()=>({id:"__currentBlock__",type:"orderedList",__stripPrefix:3})}]},Im=n.defineComponent({name:"ParagraphBlock",props:{block:{type:Object,required:!0},placeholder:{type:String,default:void 0}},setup(e){return()=>n.h(Kn,{block:e.block,placeholder:e.placeholder,class:["block-paragraph",...bn(e.block.attrs)]})}}),_s={name:"paragraph",schema:{type:"paragraph",content:"text",nestable:!0,attrs:{...jt}},renderer:{component:Im},slashCommands:[{id:"paragraph",title:"slash.paragraph.title",keywords:["text","paragraph","normal","正文","段落"],description:"slash.paragraph.description",icon:ul,command:"convertBlock",category:"basic",args:e=>({id:"__currentBlock__",type:"paragraph"})}],inputRules:[{name:"paragraph-noop",pattern:/^$/,command:"setText",args:e=>({id:"__currentBlock__",content:[]})}]},Bm=n.defineComponent({name:"HeadingBlock",props:{block:{type:Object,required:!0},placeholder:{type:String,default:void 0}},setup(e){return()=>{const t=e.block.attrs.level??1;return n.h(Kn,{block:e.block,placeholder:e.placeholder,class:["block-heading",`block-heading-h${t}`,...bn(e.block.attrs)]})}}});function To(e){const t="#".repeat(e);return{name:`heading-h${e}`,pattern:new RegExp(`^${t} $`),command:"convertBlock",args:()=>({id:"__currentBlock__",type:"heading",attrs:{level:e},__stripPrefix:e+1})}}const xo=(e,t,o,r,l,s)=>({id:e,title:o,keywords:s,description:r,icon:l,command:"convertBlock",category:"basic",args:()=>({id:"__currentBlock__",type:"heading",attrs:{level:t}})}),Ms={name:"heading",schema:{type:"heading",content:"text",nestable:!0,attrs:{level:{default:1,validate:e=>typeof e=="number"&&e>=1&&e<=6},...jt}},renderer:{component:Bm},slashCommands:[xo("heading-1",1,"slash.heading1.title","slash.heading1.description",fl,["h1","标题1","大标题","title"]),xo("heading-2",2,"slash.heading2.title","slash.heading2.description",pl,["h2","标题2","小标题"]),xo("heading-3",3,"slash.heading3.title","slash.heading3.description",ml,["h3","标题3","section"]),xo("heading-4",4,"slash.heading4.title","slash.heading4.description",hl,["h4","标题4"]),xo("heading-5",5,"slash.heading5.title","slash.heading5.description",gl,["h5","标题5"]),xo("heading-6",6,"slash.heading6.title","slash.heading6.description",bl,["h6","标题6"])],inputRules:[To(1),To(2),To(3),To(4),To(5),To(6)]},Ns={name:"default-keymap",keymap:[{key:"Enter",command:"enter"},{key:"Backspace",command:"backspace"},{key:"Delete",command:"backspace"},{key:"Tab",command:"indentBlock"},{key:"Shift-Tab",command:"outdentBlock"},{key:"Mod-a",command:"selectAll"},{key:"ArrowUp",command:"moveToPreviousBlock"},{key:"ArrowDown",command:"moveToNextBlock"}]},Ss={name:"history-keymap",keymap:[{key:"Mod-z",command:"undo"},{key:"Mod-Shift-z",command:"redo"},{key:"Mod-y",command:"redo"}]},Rm=n.defineComponent({name:"BulletListBlock",props:{block:{type:Object,required:!0},placeholder:{type:String,default:void 0}},setup(e){return()=>n.h(Kn,{block:e.block,placeholder:e.placeholder,class:["block-bullet-list",...bn(e.block.attrs)]})}}),Lm={name:"bulletList",schema:{type:"bulletList",content:"text",nestable:!0,listLike:!0,attrs:{...jt}},renderer:{component:Rm},slashCommands:[{id:"bullet-list",title:"slash.bulletList.title",keywords:["list","bullet","unordered","项目符号","无序列表","ul","-","*"],description:"slash.bulletList.description",icon:kl,command:"convertBlock",category:"list",args:()=>({id:"__currentBlock__",type:"bulletList"})}],inputRules:[{name:"bullet-dash",pattern:/^- $/,command:"convertBlock",args:()=>({id:"__currentBlock__",type:"bulletList",__stripPrefix:2})},{name:"bullet-star",pattern:/^\* $/,command:"convertBlock",args:()=>({id:"__currentBlock__",type:"bulletList",__stripPrefix:2})}]},Om=n.defineComponent({name:"TodoListBlock",props:{block:{type:Object,required:!0},placeholder:{type:String,default:void 0}},setup(e){const t=dn(),o=n.useAttrs(),r={...typeof o.onLinkClick=="function"?{onLinkClick:o.onLinkClick}:{},...typeof o.onSlashTrigger=="function"?{onSlashTrigger:o.onSlashTrigger}:{},...typeof o.onInputChanged=="function"?{onInputChanged:o.onInputChanged}:{}};function l(s){var a,c;const i=s.target;(c=(a=t.commands).setAttrs)==null||c.call(a,{id:e.block.id,attrs:{...e.block.attrs,checked:i.checked}})}return()=>{const s=!!e.block.attrs.checked,i=bn(e.block.attrs),a=i.filter(f=>f.startsWith("be-indent-")),c=i.filter(f=>!f.startsWith("be-indent-")),d=["block-todo-list",s?"todo-checked":"todo-unchecked",...c];return n.h("div",{class:["block-todo-wrapper",...a]},[n.h("input",{type:"checkbox",class:"block-todo-checkbox",checked:s,onchange:l}),n.h(Kn,{block:e.block,placeholder:e.placeholder,class:d,...r})])}}}),Dm={name:"todoList",schema:{type:"todoList",content:"text",nestable:!0,listLike:!0,attrs:{...jt,checked:{default:!1,validate:e=>typeof e=="boolean"}}},renderer:{component:Om},slashCommands:[{id:"todo-list",title:"slash.todoList.title",keywords:["todo","task","checkbox","待办","任务","复选框","[]","[ ]"],description:"slash.todoList.description",icon:wl,command:"convertBlock",category:"list",args:()=>({id:"__currentBlock__",type:"todoList",attrs:{checked:!1}})}],inputRules:[{name:"todo-empty",pattern:/^\[\] $/,command:"convertBlock",args:()=>({id:"__currentBlock__",type:"todoList",attrs:{checked:!1},__stripPrefix:3})},{name:"todo-space-bracket",pattern:/^\[ \] $/,command:"convertBlock",args:()=>({id:"__currentBlock__",type:"todoList",attrs:{checked:!1},__stripPrefix:4})}]},$m=n.defineComponent({name:"QuoteBlock",props:{block:{type:Object,required:!0},placeholder:{type:String,default:void 0}},setup(e){return()=>n.h(Kn,{block:e.block,placeholder:e.placeholder,class:["block-quote",...bn(e.block.attrs)]})}}),Pm={name:"quote",schema:{type:"quote",content:"text",nestable:!1,disallowedMarks:["italic"],attrs:{...Ou,indent:jt.indent}},renderer:{component:$m},slashCommands:[{id:"quote",title:"slash.quote.title",keywords:["quote","blockquote","引用",">","引言"],description:"slash.quote.description",icon:El,command:"convertBlock",category:"other",args:()=>({id:"__currentBlock__",type:"quote"})}],inputRules:[{name:"quote-gt",pattern:/^> $/,command:"convertBlock",args:()=>({id:"__currentBlock__",type:"quote",__stripPrefix:2})}]};function Hm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function As(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const o=e[t],r=typeof o;(r==="object"||r==="function")&&!Object.isFrozen(o)&&As(o)}),e}class Is{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Bs(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function no(e,...t){const o=Object.create(null);for(const r in e)o[r]=e[r];return t.forEach(function(r){for(const l in r)o[l]=r[l]}),o}const Vm="</span>",Rs=e=>!!e.scope,Um=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const o=e.split(".");return[`${t}${o.shift()}`,...o.map((r,l)=>`${r}${"_".repeat(l+1)}`)].join(" ")}return`${t}${e}`};class zm{constructor(t,o){this.buffer="",this.classPrefix=o.classPrefix,t.walk(this)}addText(t){this.buffer+=Bs(t)}openNode(t){if(!Rs(t))return;const o=Um(t.scope,{prefix:this.classPrefix});this.span(o)}closeNode(t){Rs(t)&&(this.buffer+=Vm)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}}const Ls=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class Tl{constructor(){this.rootNode=Ls(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const o=Ls({scope:t});this.add(o),this.stack.push(o)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,o){return typeof o=="string"?t.addText(o):o.children&&(t.openNode(o),o.children.forEach(r=>this._walk(t,r)),t.closeNode(o)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(o=>typeof o=="string")?t.children=[t.children.join("")]:t.children.forEach(o=>{Tl._collapse(o)}))}}class Fm extends Tl{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,o){const r=t.root;o&&(r.scope=`language:${o}`),this.add(r)}toHTML(){return new zm(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Qo(e){return e?typeof e=="string"?e:e.source:null}function Os(e){return co("(?=",e,")")}function Km(e){return co("(?:",e,")*")}function qm(e){return co("(?:",e,")?")}function co(...e){return e.map(o=>Qo(o)).join("")}function Wm(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function xl(...e){return"("+(Wm(e).capture?"":"?:")+e.map(r=>Qo(r)).join("|")+")"}function Ds(e){return new RegExp(e.toString()+"|").exec("").length-1}function Gm(e,t){const o=e&&e.exec(t);return o&&o.index===0}const Ym=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function _l(e,{joinWith:t}){let o=0;return e.map(r=>{o+=1;const l=o;let s=Qo(r),i="";for(;s.length>0;){const a=Ym.exec(s);if(!a){i+=s;break}i+=s.substring(0,a.index),s=s.substring(a.index+a[0].length),a[0][0]==="\\"&&a[1]?i+="\\"+String(Number(a[1])+l):(i+=a[0],a[0]==="("&&o++)}return i}).map(r=>`(${r})`).join(t)}const Zm=/\b\B/,$s="[a-zA-Z]\\w*",Ml="[a-zA-Z_]\\w*",Ps="\\b\\d+(\\.\\d+)?",Hs="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Vs="\\b(0b[01]+)",Xm="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",jm=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=co(t,/.*\b/,e.binary,/\b.*/)),no({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(o,r)=>{o.index!==0&&r.ignoreMatch()}},e)},Jo={begin:"\\\\[\\s\\S]",relevance:0},Qm={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Jo]},Jm={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Jo]},eh={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},br=function(e,t,o={}){const r=no({scope:"comment",begin:e,end:t,contains:[]},o);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const l=xl("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:co(/[ ]+/,"(",l,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},th=br("//","$"),nh=br("/\\*","\\*/"),oh=br("#","$"),rh={scope:"number",begin:Ps,relevance:0},lh={scope:"number",begin:Hs,relevance:0},ih={scope:"number",begin:Vs,relevance:0},sh={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Jo,{begin:/\[/,end:/\]/,relevance:0,contains:[Jo]}]},ah={scope:"title",begin:$s,relevance:0},ch={scope:"title",begin:Ml,relevance:0},dh={begin:"\\.\\s*"+Ml,relevance:0};var kr=Object.freeze({__proto__:null,APOS_STRING_MODE:Qm,BACKSLASH_ESCAPE:Jo,BINARY_NUMBER_MODE:ih,BINARY_NUMBER_RE:Vs,COMMENT:br,C_BLOCK_COMMENT_MODE:nh,C_LINE_COMMENT_MODE:th,C_NUMBER_MODE:lh,C_NUMBER_RE:Hs,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(t,o)=>{o.data._beginMatch=t[1]},"on:end":(t,o)=>{o.data._beginMatch!==t[1]&&o.ignoreMatch()}})},HASH_COMMENT_MODE:oh,IDENT_RE:$s,MATCH_NOTHING_RE:Zm,METHOD_GUARD:dh,NUMBER_MODE:rh,NUMBER_RE:Ps,PHRASAL_WORDS_MODE:eh,QUOTE_STRING_MODE:Jm,REGEXP_MODE:sh,RE_STARTERS_RE:Xm,SHEBANG:jm,TITLE_MODE:ah,UNDERSCORE_IDENT_RE:Ml,UNDERSCORE_TITLE_MODE:ch});function uh(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function fh(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function ph(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=uh,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function mh(e,t){Array.isArray(e.illegal)&&(e.illegal=xl(...e.illegal))}function hh(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function gh(e,t){e.relevance===void 0&&(e.relevance=1)}const bh=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const o=Object.assign({},e);Object.keys(e).forEach(r=>{delete e[r]}),e.keywords=o.keywords,e.begin=co(o.beforeMatch,Os(o.begin)),e.starts={relevance:0,contains:[Object.assign(o,{endsParent:!0})]},e.relevance=0,delete o.beforeMatch},kh=["of","and","for","in","not","or","if","then","parent","list","value"],yh="keyword";function Us(e,t,o=yh){const r=Object.create(null);return typeof e=="string"?l(o,e.split(" ")):Array.isArray(e)?l(o,e):Object.keys(e).forEach(function(s){Object.assign(r,Us(e[s],t,s))}),r;function l(s,i){t&&(i=i.map(a=>a.toLowerCase())),i.forEach(function(a){const c=a.split("|");r[c[0]]=[s,wh(c[0],c[1])]})}}function wh(e,t){return t?Number(t):Eh(e)?0:1}function Eh(e){return kh.includes(e.toLowerCase())}const zs={},uo=e=>{console.error(e)},Fs=(e,...t)=>{console.log(`WARN: ${e}`,...t)},_o=(e,t)=>{zs[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),zs[`${e}/${t}`]=!0)},yr=new Error;function Ks(e,t,{key:o}){let r=0;const l=e[o],s={},i={};for(let a=1;a<=t.length;a++)i[a+r]=l[a],s[a+r]=!0,r+=Ds(t[a-1]);e[o]=i,e[o]._emit=s,e[o]._multi=!0}function vh(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw uo("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),yr;if(typeof e.beginScope!="object"||e.beginScope===null)throw uo("beginScope must be object"),yr;Ks(e,e.begin,{key:"beginScope"}),e.begin=_l(e.begin,{joinWith:""})}}function Ch(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw uo("skip, excludeEnd, returnEnd not compatible with endScope: {}"),yr;if(typeof e.endScope!="object"||e.endScope===null)throw uo("endScope must be object"),yr;Ks(e,e.end,{key:"endScope"}),e.end=_l(e.end,{joinWith:""})}}function Th(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function xh(e){Th(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),vh(e),Ch(e)}function _h(e){function t(i,a){return new RegExp(Qo(i),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(a?"g":""))}class o{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(a,c){c.position=this.position++,this.matchIndexes[this.matchAt]=c,this.regexes.push([c,a]),this.matchAt+=Ds(a)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const a=this.regexes.map(c=>c[1]);this.matcherRe=t(_l(a,{joinWith:"|"}),!0),this.lastIndex=0}exec(a){this.matcherRe.lastIndex=this.lastIndex;const c=this.matcherRe.exec(a);if(!c)return null;const d=c.findIndex((u,m)=>m>0&&u!==void 0),f=this.matchIndexes[d];return c.splice(0,d),Object.assign(c,f)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(a){if(this.multiRegexes[a])return this.multiRegexes[a];const c=new o;return this.rules.slice(a).forEach(([d,f])=>c.addRule(d,f)),c.compile(),this.multiRegexes[a]=c,c}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(a,c){this.rules.push([a,c]),c.type==="begin"&&this.count++}exec(a){const c=this.getMatcher(this.regexIndex);c.lastIndex=this.lastIndex;let d=c.exec(a);if(this.resumingScanAtSamePosition()&&!(d&&d.index===this.lastIndex)){const f=this.getMatcher(0);f.lastIndex=this.lastIndex+1,d=f.exec(a)}return d&&(this.regexIndex+=d.position+1,this.regexIndex===this.count&&this.considerAll()),d}}function l(i){const a=new r;return i.contains.forEach(c=>a.addRule(c.begin,{rule:c,type:"begin"})),i.terminatorEnd&&a.addRule(i.terminatorEnd,{type:"end"}),i.illegal&&a.addRule(i.illegal,{type:"illegal"}),a}function s(i,a){const c=i;if(i.isCompiled)return c;[fh,hh,xh,bh].forEach(f=>f(i,a)),e.compilerExtensions.forEach(f=>f(i,a)),i.__beforeBegin=null,[ph,mh,gh].forEach(f=>f(i,a)),i.isCompiled=!0;let d=null;return typeof i.keywords=="object"&&i.keywords.$pattern&&(i.keywords=Object.assign({},i.keywords),d=i.keywords.$pattern,delete i.keywords.$pattern),d=d||/\w+/,i.keywords&&(i.keywords=Us(i.keywords,e.case_insensitive)),c.keywordPatternRe=t(d,!0),a&&(i.begin||(i.begin=/\B|\b/),c.beginRe=t(c.begin),!i.end&&!i.endsWithParent&&(i.end=/\B|\b/),i.end&&(c.endRe=t(c.end)),c.terminatorEnd=Qo(c.end)||"",i.endsWithParent&&a.terminatorEnd&&(c.terminatorEnd+=(i.end?"|":"")+a.terminatorEnd)),i.illegal&&(c.illegalRe=t(i.illegal)),i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map(function(f){return Mh(f==="self"?i:f)})),i.contains.forEach(function(f){s(f,c)}),i.starts&&s(i.starts,a),c.matcher=l(c),c}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=no(e.classNameAliases||{}),s(e)}function qs(e){return e?e.endsWithParent||qs(e.starts):!1}function Mh(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return no(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:qs(e)?no(e,{starts:e.starts?no(e.starts):null}):Object.isFrozen(e)?no(e):e}var Nh="11.11.0";class Sh extends Error{constructor(t,o){super(t),this.name="HTMLInjectionError",this.html=o}}const Nl=Bs,Ws=no,Gs=Symbol("nomatch"),Ah=7,Ys=function(e){const t=Object.create(null),o=Object.create(null),r=[];let l=!0;const s="Could not find the language '{}', did you forget to load/include a language module?",i={disableAutodetect:!0,name:"Plain text",contains:[]};let a={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Fm};function c(E){return a.noHighlightRe.test(E)}function d(E){let T=E.className+" ";T+=E.parentNode?E.parentNode.className:"";const R=a.languageDetectRe.exec(T);if(R){const Y=W(R[1]);return Y||(Fs(s.replace("{}",R[1])),Fs("Falling back to no-highlight mode for this block.",E)),Y?R[1]:"no-highlight"}return T.split(/\s+/).find(Y=>c(Y)||W(Y))}function f(E,T,R){let Y="",ae="";typeof T=="object"?(Y=E,R=T.ignoreIllegals,ae=T.language):(_o("10.7.0","highlight(lang, code, ...args) has been deprecated."),_o("10.7.0",`Please use highlight(code, options) instead.
|
|
15
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),ae=E,Y=T),R===void 0&&(R=!0);const ie={code:Y,language:ae};$("before:highlight",ie);const pe=ie.result?ie.result:u(ie.language,ie.code,R);return pe.code=ie.code,$("after:highlight",pe),pe}function u(E,T,R,Y){const ae=Object.create(null);function ie(ce,D){return ce.keywords[D]}function pe(){if(!fe.keywords){Ve.addText(_e);return}let ce=0;fe.keywordPatternRe.lastIndex=0;let D=fe.keywordPatternRe.exec(_e),M="";for(;D;){M+=_e.substring(ce,D.index);const X=Je.case_insensitive?D[0].toLowerCase():D[0],Oe=ie(fe,X);if(Oe){const[Ne,Ie]=Oe;if(Ve.addText(M),M="",ae[X]=(ae[X]||0)+1,ae[X]<=Ah&&(Ft+=Ie),Ne.startsWith("_"))M+=D[0];else{const Qt=Je.classNameAliases[Ne]||Ne;xe(D[0],Qt)}}else M+=D[0];ce=fe.keywordPatternRe.lastIndex,D=fe.keywordPatternRe.exec(_e)}M+=_e.substring(ce),Ve.addText(M)}function re(){if(_e==="")return;let ce=null;if(typeof fe.subLanguage=="string"){if(!t[fe.subLanguage]){Ve.addText(_e);return}ce=u(fe.subLanguage,_e,!0,_t[fe.subLanguage]),_t[fe.subLanguage]=ce._top}else ce=h(_e,fe.subLanguage.length?fe.subLanguage:null);fe.relevance>0&&(Ft+=ce.relevance),Ve.__addSublanguage(ce._emitter,ce.language)}function le(){fe.subLanguage!=null?re():pe(),_e=""}function xe(ce,D){ce!==""&&(Ve.startScope(D),Ve.addText(ce),Ve.endScope())}function Ae(ce,D){let M=1;const X=D.length-1;for(;M<=X;){if(!ce._emit[M]){M++;continue}const Oe=Je.classNameAliases[ce[M]]||ce[M],Ne=D[M];Oe?xe(Ne,Oe):(_e=Ne,pe(),_e=""),M++}}function Xe(ce,D){return ce.scope&&typeof ce.scope=="string"&&Ve.openNode(Je.classNameAliases[ce.scope]||ce.scope),ce.beginScope&&(ce.beginScope._wrap?(xe(_e,Je.classNameAliases[ce.beginScope._wrap]||ce.beginScope._wrap),_e=""):ce.beginScope._multi&&(Ae(ce.beginScope,D),_e="")),fe=Object.create(ce,{parent:{value:fe}}),fe}function At(ce,D,M){let X=Gm(ce.endRe,M);if(X){if(ce["on:end"]){const Oe=new Is(ce);ce["on:end"](D,Oe),Oe.isMatchIgnored&&(X=!1)}if(X){for(;ce.endsParent&&ce.parent;)ce=ce.parent;return ce}}if(ce.endsWithParent)return At(ce.parent,D,M)}function nn(ce){return fe.matcher.regexIndex===0?(_e+=ce[0],1):(je=!0,0)}function Gt(ce){const D=ce[0],M=ce.rule,X=new Is(M),Oe=[M.__beforeBegin,M["on:begin"]];for(const Ne of Oe)if(Ne&&(Ne(ce,X),X.isMatchIgnored))return nn(D);return M.skip?_e+=D:(M.excludeBegin&&(_e+=D),le(),!M.returnBegin&&!M.excludeBegin&&(_e=D)),Xe(M,ce),M.returnBegin?0:D.length}function Ot(ce){const D=ce[0],M=T.substring(ce.index),X=At(fe,ce,M);if(!X)return Gs;const Oe=fe;fe.endScope&&fe.endScope._wrap?(le(),xe(D,fe.endScope._wrap)):fe.endScope&&fe.endScope._multi?(le(),Ae(fe.endScope,ce)):Oe.skip?_e+=D:(Oe.returnEnd||Oe.excludeEnd||(_e+=D),le(),Oe.excludeEnd&&(_e=D));do fe.scope&&Ve.closeNode(),!fe.skip&&!fe.subLanguage&&(Ft+=fe.relevance),fe=fe.parent;while(fe!==X.parent);return X.starts&&Xe(X.starts,ce),Oe.returnEnd?0:D.length}function qe(){const ce=[];for(let D=fe;D!==Je;D=D.parent)D.scope&&ce.unshift(D.scope);ce.forEach(D=>Ve.openNode(D))}let bt={};function It(ce,D){const M=D&&D[0];if(_e+=ce,M==null)return le(),0;if(bt.type==="begin"&&D.type==="end"&&bt.index===D.index&&M===""){if(_e+=T.slice(D.index,D.index+1),!l){const X=new Error(`0 width match regex (${E})`);throw X.languageName=E,X.badRule=bt.rule,X}return 1}if(bt=D,D.type==="begin")return Gt(D);if(D.type==="illegal"&&!R){const X=new Error('Illegal lexeme "'+M+'" for mode "'+(fe.scope||"<unnamed>")+'"');throw X.mode=fe,X}else if(D.type==="end"){const X=Ot(D);if(X!==Gs)return X}if(D.type==="illegal"&&M==="")return _e+=`
|
|
16
|
+
`,1;if(Et>1e5&&Et>D.index*3)throw new Error("potential infinite loop, way more iterations than matches");return _e+=M,M.length}const Je=W(E);if(!Je)throw uo(s.replace("{}",E)),new Error('Unknown language: "'+E+'"');const Le=_h(Je);let mt="",fe=Y||Le;const _t={},Ve=new a.__emitter(a);qe();let _e="",Ft=0,Ct=0,Et=0,je=!1;try{if(Je.__emitTokens)Je.__emitTokens(T,Ve);else{for(fe.matcher.considerAll();;){Et++,je?je=!1:fe.matcher.considerAll(),fe.matcher.lastIndex=Ct;const ce=fe.matcher.exec(T);if(!ce)break;const D=T.substring(Ct,ce.index),M=It(D,ce);Ct=ce.index+M}It(T.substring(Ct))}return Ve.finalize(),mt=Ve.toHTML(),{language:E,value:mt,relevance:Ft,illegal:!1,_emitter:Ve,_top:fe}}catch(ce){if(ce.message&&ce.message.includes("Illegal"))return{language:E,value:Nl(T),illegal:!0,relevance:0,_illegalBy:{message:ce.message,index:Ct,context:T.slice(Ct-100,Ct+100),mode:ce.mode,resultSoFar:mt},_emitter:Ve};if(l)return{language:E,value:Nl(T),illegal:!1,relevance:0,errorRaised:ce,_emitter:Ve,_top:fe};throw ce}}function m(E){const T={value:Nl(E),illegal:!1,relevance:0,_top:i,_emitter:new a.__emitter(a)};return T._emitter.addText(E),T}function h(E,T){T=T||a.languages||Object.keys(t);const R=m(E),Y=T.filter(W).filter(A).map(le=>u(le,E,!1));Y.unshift(R);const ae=Y.sort((le,xe)=>{if(le.relevance!==xe.relevance)return xe.relevance-le.relevance;if(le.language&&xe.language){if(W(le.language).supersetOf===xe.language)return 1;if(W(xe.language).supersetOf===le.language)return-1}return 0}),[ie,pe]=ae,re=ie;return re.secondBest=pe,re}function p(E,T,R){const Y=T&&o[T]||R;E.classList.add("hljs"),E.classList.add(`language-${Y}`)}function b(E){let T=null;const R=d(E);if(c(R))return;if($("before:highlightElement",{el:E,language:R}),E.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",E);return}if(E.children.length>0&&(a.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(E)),a.throwUnescapedHTML))throw new Sh("One of your code blocks includes unescaped HTML.",E.innerHTML);T=E;const Y=T.textContent,ae=R?f(Y,{language:R,ignoreIllegals:!0}):h(Y);E.innerHTML=ae.value,E.dataset.highlighted="yes",p(E,R,ae.language),E.result={language:ae.language,re:ae.relevance,relevance:ae.relevance},ae.secondBest&&(E.secondBest={language:ae.secondBest.language,relevance:ae.secondBest.relevance}),$("after:highlightElement",{el:E,result:ae,text:Y})}function x(E){a=Ws(a,E)}const O=()=>{j(),_o("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function z(){j(),_o("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let F=!1;function j(){function E(){j()}if(document.readyState==="loading"){F||window.addEventListener("DOMContentLoaded",E,!1),F=!0;return}document.querySelectorAll(a.cssSelector).forEach(b)}function P(E,T){let R=null;try{R=T(e)}catch(Y){if(uo("Language definition for '{}' could not be registered.".replace("{}",E)),l)uo(Y);else throw Y;R=i}R.name||(R.name=E),t[E]=R,R.rawDefinition=T.bind(null,e),R.aliases&&J(R.aliases,{languageName:E})}function U(E){delete t[E];for(const T of Object.keys(o))o[T]===E&&delete o[T]}function te(){return Object.keys(t)}function W(E){return E=(E||"").toLowerCase(),t[E]||t[o[E]]}function J(E,{languageName:T}){typeof E=="string"&&(E=[E]),E.forEach(R=>{o[R.toLowerCase()]=T})}function A(E){const T=W(E);return T&&!T.disableAutodetect}function _(E){E["before:highlightBlock"]&&!E["before:highlightElement"]&&(E["before:highlightElement"]=T=>{E["before:highlightBlock"](Object.assign({block:T.el},T))}),E["after:highlightBlock"]&&!E["after:highlightElement"]&&(E["after:highlightElement"]=T=>{E["after:highlightBlock"](Object.assign({block:T.el},T))})}function I(E){_(E),r.push(E)}function S(E){const T=r.indexOf(E);T!==-1&&r.splice(T,1)}function $(E,T){const R=E;r.forEach(function(Y){Y[R]&&Y[R](T)})}function N(E){return _o("10.7.0","highlightBlock will be removed entirely in v12.0"),_o("10.7.0","Please use highlightElement now."),b(E)}Object.assign(e,{highlight:f,highlightAuto:h,highlightAll:j,highlightElement:b,highlightBlock:N,configure:x,initHighlighting:O,initHighlightingOnLoad:z,registerLanguage:P,unregisterLanguage:U,listLanguages:te,getLanguage:W,registerAliases:J,autoDetection:A,inherit:Ws,addPlugin:I,removePlugin:S}),e.debugMode=function(){l=!1},e.safeMode=function(){l=!0},e.versionString=Nh,e.regex={concat:co,lookahead:Os,either:xl,optional:qm,anyNumberOfTimes:Km};for(const E in kr)typeof kr[E]=="object"&&As(kr[E]);return Object.assign(e,kr),e},Mo=Ys({});Mo.newInstance=()=>Ys({});var Ih=Mo;Mo.HighlightJS=Mo,Mo.default=Mo;const Zs=Hm(Ih),Xs="[A-Za-z$_][0-9A-Za-z$_]*",Bh=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Rh=["true","false","null","undefined","NaN","Infinity"],js=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Qs=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Js=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Lh=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Oh=[].concat(Js,js,Qs);function Dh(e){const t=e.regex,o=(R,{after:Y})=>{const ae="</"+R[0].slice(1);return R.input.indexOf(ae,Y)!==-1},r=Xs,l={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,i={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(R,Y)=>{const ae=R[0].length+R.index,ie=R.input[ae];if(ie==="<"||ie===","){Y.ignoreMatch();return}ie===">"&&(o(R,{after:ae})||Y.ignoreMatch());let pe;const re=R.input.substring(ae);if(pe=re.match(/^\s*=/)){Y.ignoreMatch();return}if((pe=re.match(/^\s+extends\s+/))&&pe.index===0){Y.ignoreMatch();return}}},a={$pattern:Xs,keyword:Bh,literal:Rh,built_in:Oh,"variable.language":Lh},c="[0-9](_?[0-9])*",d=`\\.(${c})`,f="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",u={className:"number",variants:[{begin:`(\\b(${f})((${d})|\\.)?|(${d}))[eE][+-]?(${c})\\b`},{begin:`\\b(${f})\\b((${d})\\b|\\.)?|(${d})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},m={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},h={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"xml"}},p={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"css"}},b={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"graphql"}},x={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,m]},z={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},F=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,p,b,x,{match:/\$\d+/},u];m.contains=F.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(F)});const j=[].concat(z,m.contains),P=j.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(j)}]),U={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:P},te={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},W={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...js,...Qs]}},J={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},A={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[U],illegal:/%/},_={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function I(R){return t.concat("(?!",R.join("|"),")")}const S={match:t.concat(/\b/,I([...Js,"super","import"].map(R=>`${R}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},$={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},N={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},U]},E="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",T={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(E)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[U]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:P,CLASS_REFERENCE:W},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),J,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,p,b,x,z,{match:/\$\d+/},u,W,{scope:"attr",match:r+t.lookahead(":"),relevance:0},T,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[z,e.REGEXP_MODE,{className:"function",begin:E,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:P}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:l.begin,end:l.end},{match:s},{begin:i.begin,"on:begin":i.isTrulyOpeningTag,end:i.end}],subLanguage:"xml",contains:[{begin:i.begin,end:i.end,skip:!0,contains:["self"]}]}]},A,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[U,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},$,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[U]},S,_,te,N,{match:/\$[(.]/}]}}const wr="[A-Za-z$_][0-9A-Za-z$_]*",ea=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],ta=["true","false","null","undefined","NaN","Infinity"],na=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],oa=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],ra=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],la=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],ia=[].concat(ra,na,oa);function $h(e){const t=e.regex,o=(R,{after:Y})=>{const ae="</"+R[0].slice(1);return R.input.indexOf(ae,Y)!==-1},r=wr,l={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,i={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(R,Y)=>{const ae=R[0].length+R.index,ie=R.input[ae];if(ie==="<"||ie===","){Y.ignoreMatch();return}ie===">"&&(o(R,{after:ae})||Y.ignoreMatch());let pe;const re=R.input.substring(ae);if(pe=re.match(/^\s*=/)){Y.ignoreMatch();return}if((pe=re.match(/^\s+extends\s+/))&&pe.index===0){Y.ignoreMatch();return}}},a={$pattern:wr,keyword:ea,literal:ta,built_in:ia,"variable.language":la},c="[0-9](_?[0-9])*",d=`\\.(${c})`,f="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",u={className:"number",variants:[{begin:`(\\b(${f})((${d})|\\.)?|(${d}))[eE][+-]?(${c})\\b`},{begin:`\\b(${f})\\b((${d})\\b|\\.)?|(${d})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},m={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},h={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"xml"}},p={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"css"}},b={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"graphql"}},x={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,m]},z={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},F=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,p,b,x,{match:/\$\d+/},u];m.contains=F.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(F)});const j=[].concat(z,m.contains),P=j.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(j)}]),U={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:P},te={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},W={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...na,...oa]}},J={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},A={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[U],illegal:/%/},_={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function I(R){return t.concat("(?!",R.join("|"),")")}const S={match:t.concat(/\b/,I([...ra,"super","import"].map(R=>`${R}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},$={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},N={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},U]},E="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",T={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(E)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[U]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:P,CLASS_REFERENCE:W},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),J,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,p,b,x,z,{match:/\$\d+/},u,W,{scope:"attr",match:r+t.lookahead(":"),relevance:0},T,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[z,e.REGEXP_MODE,{className:"function",begin:E,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:P}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:l.begin,end:l.end},{match:s},{begin:i.begin,"on:begin":i.isTrulyOpeningTag,end:i.end}],subLanguage:"xml",contains:[{begin:i.begin,end:i.end,skip:!0,contains:["self"]}]}]},A,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[U,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},$,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[U]},S,_,te,N,{match:/\$[(.]/}]}}function Ph(e){const t=e.regex,o=$h(e),r=wr,l=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},i={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:l},contains:[o.exports.CLASS_REFERENCE]},a={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},c=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],d={$pattern:wr,keyword:ea.concat(c),literal:ta,built_in:ia.concat(l),"variable.language":la},f={className:"meta",begin:"@"+r},u=(b,x,O)=>{const z=b.contains.findIndex(F=>F.label===x);if(z===-1)throw new Error("can not find mode to replace");b.contains.splice(z,1,O)};Object.assign(o.keywords,d),o.exports.PARAMS_CONTAINS.push(f);const m=o.contains.find(b=>b.scope==="attr"),h=Object.assign({},m,{match:t.concat(r,t.lookahead(/\s*\?:/))});o.exports.PARAMS_CONTAINS.push([o.exports.CLASS_REFERENCE,m,h]),o.contains=o.contains.concat([f,s,i,h]),u(o,"shebang",e.SHEBANG()),u(o,"use_strict",a);const p=o.contains.find(b=>b.label==="func.def");return p.relevance=0,Object.assign(o,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),o}function Hh(e){const t=e.regex,o=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],a={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},c={className:"meta",begin:/^(>>>|\.\.\.) /},d={className:"subst",begin:/\{/,end:/\}/,keywords:a,illegal:/#/},f={begin:/\{\{/,relevance:0},u={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c,f,d]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c,f,d]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,f,d]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,f,d]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},m="[0-9](_?[0-9])*",h=`(\\b(${m}))?\\.(${m})|\\b(${m})\\.`,p=`\\b|${r.join("|")}`,b={className:"number",relevance:0,variants:[{begin:`(\\b(${m})|(${h}))[eE][+-]?(${m})[jJ]?(?=${p})`},{begin:`(${h})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${p})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${p})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${p})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${p})`},{begin:`\\b(${m})[jJ](?=${p})`}]},x={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:a,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},O={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:["self",c,b,u,e.HASH_COMMENT_MODE]}]};return d.contains=[u,b,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:a,illegal:/(<\/|\?)|=>/,contains:[c,b,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},u,x,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,o],scope:{1:"keyword",3:"title.function"},contains:[O]},{variants:[{match:[/\bclass/,/\s+/,o,/\s*/,/\(\s*/,o,/\s*\)/]},{match:[/\bclass/,/\s+/,o]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[b,O,u]}]}}var No="[0-9](_*[0-9])*",Er=`\\.(${No})`,vr="[0-9a-fA-F](_*[0-9a-fA-F])*",sa={className:"number",variants:[{begin:`(\\b(${No})((${Er})|\\.)?|(${Er}))[eE][+-]?(${No})[fFdD]?\\b`},{begin:`\\b(${No})((${Er})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Er})[fFdD]?\\b`},{begin:`\\b(${No})[fFdD]\\b`},{begin:`\\b0[xX]((${vr})\\.?|(${vr})?\\.(${vr}))[pP][+-]?(${No})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${vr})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function aa(e,t,o){return o===-1?"":e.replace(t,r=>aa(e,t,o-1))}function Vh(e){const t=e.regex,o="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=o+aa("(?:<"+o+"~~~(?:\\s*,\\s*"+o+"~~~)*>)?",/~~~/g,2),c={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},d={className:"meta",begin:"@"+o,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},f={className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:c,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,o],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,o),/\s+/,o,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,o],className:{1:"keyword",3:"title.class"},contains:[f,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:c,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,sa,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},sa,d]}}function Uh(e){const t=e.regex,o=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",l="[a-zA-Z_]\\w*::",i="("+r+"|"+t.optional(l)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",a={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},d={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},f={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},u={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(d,{className:"string"}),{className:"string",begin:/<.*?>/},o,e.C_BLOCK_COMMENT_MODE]},m={className:"title",begin:t.optional(l)+e.IDENT_RE,relevance:0},h=t.optional(l)+e.IDENT_RE+"\\s*\\(",x={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},O=[u,a,o,e.C_BLOCK_COMMENT_MODE,f,d],z={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:x,contains:O.concat([{begin:/\(/,end:/\)/,keywords:x,contains:O.concat(["self"]),relevance:0}]),relevance:0},F={begin:"("+i+"[\\*&\\s]+)+"+h,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:x,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:x,relevance:0},{begin:h,returnBegin:!0,contains:[e.inherit(m,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:x,relevance:0,contains:[o,e.C_BLOCK_COMMENT_MODE,d,f,a,{begin:/\(/,end:/\)/,keywords:x,relevance:0,contains:["self",o,e.C_BLOCK_COMMENT_MODE,d,f,a]}]},a,o,e.C_BLOCK_COMMENT_MODE,u]};return{name:"C",aliases:["h"],keywords:x,disableAutodetect:!0,illegal:"</",contains:[].concat(z,F,O,[u,{begin:e.IDENT_RE+"::",keywords:x},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:u,strings:d,keywords:x}}}function zh(e){const t=e.regex,o=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",l="[a-zA-Z_]\\w*::",i="(?!struct)("+r+"|"+t.optional(l)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",a={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},d={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},f={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},u={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(d,{className:"string"}),{className:"string",begin:/<.*?>/},o,e.C_BLOCK_COMMENT_MODE]},m={className:"title",begin:t.optional(l)+e.IDENT_RE,relevance:0},h=t.optional(l)+e.IDENT_RE+"\\s*\\(",p=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],b=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],x=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],O=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],j={type:b,keyword:p,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:x},P={className:"function.dispatch",relevance:0,keywords:{_hint:O},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},U=[P,u,a,o,e.C_BLOCK_COMMENT_MODE,f,d],te={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:j,contains:U.concat([{begin:/\(/,end:/\)/,keywords:j,contains:U.concat(["self"]),relevance:0}]),relevance:0},W={className:"function",begin:"("+i+"[\\*&\\s]+)+"+h,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:j,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:j,relevance:0},{begin:h,returnBegin:!0,contains:[m],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[d,f]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:j,relevance:0,contains:[o,e.C_BLOCK_COMMENT_MODE,d,f,a,{begin:/\(/,end:/\)/,keywords:j,relevance:0,contains:["self",o,e.C_BLOCK_COMMENT_MODE,d,f,a]}]},a,o,e.C_BLOCK_COMMENT_MODE,u]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:j,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(te,W,P,U,[u,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:j,contains:["self",a]},{begin:e.IDENT_RE+"::",keywords:j},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Fh(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],o=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],l=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],s=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],i={keyword:l.concat(s),built_in:t,literal:r},a=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),c={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},d={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},f={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},u=e.inherit(f,{illegal:/\n/}),m={className:"subst",begin:/\{/,end:/\}/,keywords:i},h=e.inherit(m,{illegal:/\n/}),p={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,h]},b={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},m]},x=e.inherit(b,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]});m.contains=[b,p,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.C_BLOCK_COMMENT_MODE],h.contains=[x,p,u,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const O={variants:[d,b,p,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},z={begin:"<",end:">",contains:[{beginKeywords:"in out"},a]},F=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",j={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:i,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},O,c,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},a,z,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[a,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[a,z,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+F+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:i,contains:[{beginKeywords:o.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,z],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,relevance:0,contains:[O,c,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},j]}}function Kh(e){const s={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:s,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:s,illegal:/["']/}]}]}}function qh(e){const t=e.regex,o=/(r#)?/,r=t.concat(o,e.UNDERSCORE_IDENT_RE),l=t.concat(o,e.IDENT_RE),s={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,l,t.lookahead(/\s*\(/))},i="([ui](8|16|32|64|128|size)|f(32|64))?",a=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],c=["true","false","Some","None","Ok","Err"],d=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],f=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:f,keyword:a,literal:c,built_in:d},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\(\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*/},{className:"number",variants:[{begin:"\\b0b([01_]+)"+i},{begin:"\\b0o([0-7_]+)"+i},{begin:"\\b0x([A-Fa-f0-9_]+)"+i},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+i}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:d,type:f}},{className:"punctuation",begin:"->"},s]}}function Wh(e){const t=e.regex,o="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),l=t.concat(r,/(::\w+)*/),i={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},a={className:"doctag",begin:"@[A-Za-z]+"},c={begin:"#<",end:">"},d=[e.COMMENT("#","$",{contains:[a]}),e.COMMENT("^=begin","^=end",{contains:[a],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],f={className:"subst",begin:/#\{/,end:/\}/,keywords:i},u={className:"string",contains:[e.BACKSLASH_ESCAPE,f],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,f]})]}]},m="[1-9](_?[0-9])*|0",h="[0-9](_?[0-9])*",p={className:"number",relevance:0,variants:[{begin:`\\b(${m})(\\.(${h}))?([eE][+-]?(${h})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},b={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:i}]},U=[u,{variants:[{match:[/class\s+/,l,/\s+<\s+/,l]},{match:[/\b(class|module)\s+/,l]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:i},{match:[/(include|extend)\s+/,l],scope:{2:"title.class"},keywords:i},{relevance:0,match:[l,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,o],scope:{1:"keyword",3:"title.function"},contains:[b]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[u,{begin:o}],relevance:0},p,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:i},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,f],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(c,d),relevance:0}].concat(c,d);f.contains=U,b.contains=U;const A=[{begin:/^\s*=>/,starts:{end:"$",contains:U}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:i,contains:U}}];return d.unshift(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:i,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(A).concat(d).concat(U)}}function Gh(e){const t=e.regex,o=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,o),l=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,o),s=t.concat(/[A-Z]+/,o),i={scope:"variable",match:"\\$+"+r},a={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},c={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},d=e.inherit(e.APOS_STRING_MODE,{illegal:null}),f=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(c)}),u={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(c),"on:begin":($,N)=>{N.data._beginMatch=$[1]||$[2]},"on:end":($,N)=>{N.data._beginMatch!==$[1]&&N.ignoreMatch()}},m=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),h=`[
|
|
17
|
+
]`,p={scope:"string",variants:[f,d,u,m]},b={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},x=["false","null","true"],O=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],z=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],j={keyword:O,literal:($=>{const N=[];return $.forEach(E=>{N.push(E),E.toLowerCase()===E?N.push(E.toUpperCase()):N.push(E.toLowerCase())}),N})(x),built_in:z},P=$=>$.map(N=>N.replace(/\|\d+$/,"")),U={variants:[{match:[/new/,t.concat(h,"+"),t.concat("(?!",P(z).join("\\b|"),"\\b)"),l],scope:{1:"keyword",4:"title.class"}}]},te=t.concat(r,"\\b(?!\\()"),W={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),te],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[l,t.concat(/::/,t.lookahead(/(?!class\b)/)),te],scope:{1:"title.class",3:"variable.constant"}},{match:[l,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[l,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},J={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},A={relevance:0,begin:/\(/,end:/\)/,keywords:j,contains:[J,i,W,e.C_BLOCK_COMMENT_MODE,p,b,U]},_={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",P(O).join("\\b|"),"|",P(z).join("\\b|"),"\\b)"),r,t.concat(h,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[A]};A.contains.push(_);const I=[J,W,e.C_BLOCK_COMMENT_MODE,p,b,U],S={begin:t.concat(/#\[\s*\\?/,t.either(l,s)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:x,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:x,keyword:["new","array"]},contains:["self",...I]},...I,{scope:"meta",variants:[{match:l},{match:s}]}]};return{case_insensitive:!1,keywords:j,contains:[S,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},a,{scope:"variable.language",match:/\$this\b/},i,_,W,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},U,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:j,contains:["self",S,i,W,e.C_BLOCK_COMMENT_MODE,p,b]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},p,b]}}function ca(e){return e?typeof e=="string"?e:e.source:null}function er(e){return gt("(?=",e,")")}function gt(...e){return e.map(o=>ca(o)).join("")}function Yh(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function tn(...e){return"("+(Yh(e).capture?"":"?:")+e.map(r=>ca(r)).join("|")+")"}const Sl=e=>gt(/\b/,e,/\w$/.test(e)?/\b/:/\B/),Zh=["Protocol","Type"].map(Sl),da=["init","self"].map(Sl),Xh=["Any","Self"],Al=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],ua=["false","nil","true"],jh=["assignment","associativity","higherThan","left","lowerThan","none","right"],Qh=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],fa=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],pa=tn(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),ma=tn(pa,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Il=gt(pa,ma,"*"),ha=tn(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),Cr=tn(ha,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Rn=gt(ha,Cr,"*"),Tr=gt(/[A-Z]/,Cr,"*"),Jh=["attached","autoclosure",gt(/convention\(/,tn("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",gt(/objc\(/,Rn,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],eg=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function tg(e){const t={match:/\s+/,relevance:0},o=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,o],l={match:[/\./,tn(...Zh,...da)],className:{2:"keyword"}},s={match:gt(/\./,tn(...Al)),relevance:0},i=Al.filter(Le=>typeof Le=="string").concat(["_|0"]),a=Al.filter(Le=>typeof Le!="string").concat(Xh).map(Sl),c={variants:[{className:"keyword",match:tn(...a,...da)}]},d={$pattern:tn(/\b\w+/,/#\w+/),keyword:i.concat(Qh),literal:ua},f=[l,s,c],u={match:gt(/\./,tn(...fa)),relevance:0},m={className:"built_in",match:gt(/\b/,tn(...fa),/(?=\()/)},h=[u,m],p={match:/->/,relevance:0},b={className:"operator",relevance:0,variants:[{match:Il},{match:`\\.(\\.|${ma})+`}]},x=[p,b],O="([0-9]_*)+",z="([0-9a-fA-F]_*)+",F={className:"number",relevance:0,variants:[{match:`\\b(${O})(\\.(${O}))?([eE][+-]?(${O}))?\\b`},{match:`\\b0x(${z})(\\.(${z}))?([pP][+-]?(${O}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},j=(Le="")=>({className:"subst",variants:[{match:gt(/\\/,Le,/[0\\tnr"']/)},{match:gt(/\\/,Le,/u\{[0-9a-fA-F]{1,8}\}/)}]}),P=(Le="")=>({className:"subst",match:gt(/\\/,Le,/[\t ]*(?:[\r\n]|\r\n)/)}),U=(Le="")=>({className:"subst",label:"interpol",begin:gt(/\\/,Le,/\(/),end:/\)/}),te=(Le="")=>({begin:gt(Le,/"""/),end:gt(/"""/,Le),contains:[j(Le),P(Le),U(Le)]}),W=(Le="")=>({begin:gt(Le,/"/),end:gt(/"/,Le),contains:[j(Le),U(Le)]}),J={className:"string",variants:[te(),te("#"),te("##"),te("###"),W(),W("#"),W("##"),W("###")]},A=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],_={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:A},I=Le=>{const mt=gt(Le,/\//),fe=gt(/\//,Le);return{begin:mt,end:fe,contains:[...A,{scope:"comment",begin:`#(?!.*${fe})`,end:/$/}]}},S={scope:"regexp",variants:[I("###"),I("##"),I("#"),_]},$={match:gt(/`/,Rn,/`/)},N={className:"variable",match:/\$\d+/},E={className:"variable",match:`\\$${Cr}+`},T=[$,N,E],R={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:eg,contains:[...x,F,J]}]}},Y={scope:"keyword",match:gt(/@/,tn(...Jh),er(tn(/\(/,/\s+/)))},ae={scope:"meta",match:gt(/@/,Rn)},ie=[R,Y,ae],pe={match:er(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:gt(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Cr,"+")},{className:"type",match:Tr,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:gt(/\s+&\s+/,er(Tr)),relevance:0}]},re={begin:/</,end:/>/,keywords:d,contains:[...r,...f,...ie,p,pe]};pe.contains.push(re);const le={match:gt(Rn,/\s*:/),keywords:"_|0",relevance:0},xe={begin:/\(/,end:/\)/,relevance:0,keywords:d,contains:["self",le,...r,S,...f,...h,...x,F,J,...T,...ie,pe]},Ae={begin:/</,end:/>/,keywords:"repeat each",contains:[...r,pe]},Xe={begin:tn(er(gt(Rn,/\s*:/)),er(gt(Rn,/\s+/,Rn,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Rn}]},At={begin:/\(/,end:/\)/,keywords:d,contains:[Xe,...r,...f,...x,F,J,...ie,pe,xe],endsParent:!0,illegal:/["']/},nn={match:[/(func|macro)/,/\s+/,tn($.match,Rn,Il)],className:{1:"keyword",3:"title.function"},contains:[Ae,At,t],illegal:[/\[/,/%/]},Gt={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[Ae,At,t],illegal:/\[|%/},Ot={match:[/operator/,/\s+/,Il],className:{1:"keyword",3:"title"}},qe={begin:[/precedencegroup/,/\s+/,Tr],className:{1:"keyword",3:"title"},contains:[pe],keywords:[...jh,...ua],end:/}/},bt={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},It={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Je={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Rn,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:d,contains:[Ae,...f,{begin:/:/,end:/\{/,keywords:d,contains:[{scope:"title.class.inherited",match:Tr},...f],relevance:0}]};for(const Le of J.variants){const mt=Le.contains.find(_t=>_t.label==="interpol");mt.keywords=d;const fe=[...f,...h,...x,F,J,...T];mt.contains=[...fe,{begin:/\(/,end:/\)/,contains:["self",...fe]}]}return{name:"Swift",keywords:d,contains:[...r,nn,Gt,bt,It,Je,Ot,qe,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},S,...f,...h,...x,F,J,...T,...ie,pe,xe]}}var So="[0-9](_*[0-9])*",xr=`\\.(${So})`,_r="[0-9a-fA-F](_*[0-9a-fA-F])*",ng={className:"number",variants:[{begin:`(\\b(${So})((${xr})|\\.)?|(${xr}))[eE][+-]?(${So})[fFdD]?\\b`},{begin:`\\b(${So})((${xr})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${xr})[fFdD]?\\b`},{begin:`\\b(${So})[fFdD]\\b`},{begin:`\\b0[xX]((${_r})\\.?|(${_r})?\\.(${_r}))[pP][+-]?(${So})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${_r})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function og(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},o={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},l={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},s={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},i={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[s,l]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,s,l]}]};l.contains.push(i);const a={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},c={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(i,{className:"string"}),"self"]}]},d=ng,f=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),u={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},m=u;return m.variants[1].contains=[u],u.variants[1].contains=[m],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,f,o,r,a,c,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[u,e.C_LINE_COMMENT_MODE,f],relevance:0},e.C_LINE_COMMENT_MODE,f,a,c,i,e.C_NUMBER_MODE]},f]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},a,c]},i,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
|
|
18
|
+
`},d]}}function rg(e){const t=e.regex,o=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,l={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},i=e.inherit(s,{begin:/\(/,end:/\)/}),a=e.inherit(e.APOS_STRING_MODE,{className:"string"}),c=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),d={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[l]},{begin:/'/,end:/'/,contains:[l]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[s,c,a,i,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[s,i,c,a]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},l,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[d],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[d],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(o,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:o,relevance:0,starts:d}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(o,/>/))),contains:[{className:"name",begin:o,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}const lg=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),ig=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],sg=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],ag=[...ig,...sg],cg=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),dg=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),ug=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),fg=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function pg(e){const t=e.regex,o=lg(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},l="and or not only",s=/@-?\w[\w]*(-\w+)*/,i="[a-zA-Z-][a-zA-Z0-9_-]*",a=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[o.BLOCK_COMMENT,r,o.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+i,relevance:0},o.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+dg.join("|")+")"},{begin:":(:)?("+ug.join("|")+")"}]},o.CSS_VARIABLE,{className:"attribute",begin:"\\b("+fg.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[o.BLOCK_COMMENT,o.HEXCOLOR,o.IMPORTANT,o.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...a,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},o.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:s},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:l,attribute:cg.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...a,o.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+ag.join("|")+")\\b"}]}}function mg(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},o={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],l={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[t,o,e.QUOTE_STRING_MODE,l,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function hg(e){const t="true false yes no null",o="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},l={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},i={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,l]},a=e.inherit(i,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),m={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},h={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},p={begin:/\{/,end:/\}/,contains:[h],illegal:"\\n",relevance:0},b={begin:"\\[",end:"\\]",contains:[h],illegal:"\\n",relevance:0},x=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+o},{className:"type",begin:"!<"+o+">"},{className:"type",begin:"!"+o},{className:"type",begin:"!!"+o},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},m,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},p,b,s,i],O=[...x];return O.pop(),O.push(a),h.contains=O,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:x}}function gg(e){const t=e.regex,o={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},l={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},s={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},i={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},a=/[A-Za-z][A-Za-z0-9+.-]*/,c={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,a,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},d={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},f={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},u=e.inherit(d,{contains:[]}),m=e.inherit(f,{contains:[]});d.contains.push(m),f.contains.push(u);let h=[o,c];return[d,f,u,m].forEach(O=>{O.contains=O.contains.concat(h)}),h=h.concat(d,f),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:h},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:h}]}]},o,s,d,f,{className:"quote",begin:"^>\\s+",contains:h,end:"$"},l,r,c,i,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function bg(e){const t="\\[=*\\[",o="\\]=*\\]",r={begin:t,end:o,contains:["self"]},l=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,o,{contains:[r],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:l.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:l}].concat(l)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:o,contains:[r],relevance:5}])}}function kg(e){const t=e.regex,o={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[o]}]};Object.assign(o,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const l={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},s=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),i={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},a={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,o,l]};l.contains.push(a);const c={match:/\\"/},d={className:"string",begin:/'/,end:/'/},f={match:/\\'/},u={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,o]},m=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],h=e.SHEBANG({binary:`(${m.join("|")})`,relevance:10}),p={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},b=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],x=["true","false"],O={match:/(\/[a-z._-]+)+/},z=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],F=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],j=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],P=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:b,literal:x,built_in:[...z,...F,"set","shopt",...j,...P]},contains:[h,e.SHEBANG(),p,u,s,i,O,a,c,d,f,o]}}function yg(e){const t=["string","char","byte","int","long","bool","decimal","single","double","DateTime","xml","array","hashtable","void"],o="Add|Clear|Close|Copy|Enter|Exit|Find|Format|Get|Hide|Join|Lock|Move|New|Open|Optimize|Pop|Push|Redo|Remove|Rename|Reset|Resize|Search|Select|Set|Show|Skip|Split|Step|Switch|Undo|Unlock|Watch|Backup|Checkpoint|Compare|Compress|Convert|ConvertFrom|ConvertTo|Dismount|Edit|Expand|Export|Group|Import|Initialize|Limit|Merge|Mount|Out|Publish|Restore|Save|Sync|Unpublish|Update|Approve|Assert|Build|Complete|Confirm|Deny|Deploy|Disable|Enable|Install|Invoke|Register|Request|Restart|Resume|Start|Stop|Submit|Suspend|Uninstall|Unregister|Wait|Debug|Measure|Ping|Repair|Resolve|Test|Trace|Connect|Disconnect|Read|Receive|Send|Write|Block|Grant|Protect|Revoke|Unblock|Unprotect|Use|ForEach|Sort|Tee|Where",r="-and|-as|-band|-bnot|-bor|-bxor|-casesensitive|-ccontains|-ceq|-cge|-cgt|-cle|-clike|-clt|-cmatch|-cne|-cnotcontains|-cnotlike|-cnotmatch|-contains|-creplace|-csplit|-eq|-exact|-f|-file|-ge|-gt|-icontains|-ieq|-ige|-igt|-ile|-ilike|-ilt|-imatch|-in|-ine|-inotcontains|-inotlike|-inotmatch|-ireplace|-is|-isnot|-isplit|-join|-le|-like|-lt|-match|-ne|-not|-notcontains|-notin|-notlike|-notmatch|-or|-regex|-replace|-shl|-shr|-split|-wildcard|-xor",l={$pattern:/-?[A-z\.\-]+\b/,keyword:"if else foreach return do while until elseif begin for trap data dynamicparam end break throw param continue finally in switch exit filter try process catch hidden static parameter",built_in:"ac asnp cat cd CFS chdir clc clear clhy cli clp cls clv cnsn compare copy cp cpi cpp curl cvpa dbp del diff dir dnsn ebp echo|0 epal epcsv epsn erase etsn exsn fc fhx fl ft fw gal gbp gc gcb gci gcm gcs gdr gerr ghy gi gin gjb gl gm gmo gp gps gpv group gsn gsnp gsv gtz gu gv gwmi h history icm iex ihy ii ipal ipcsv ipmo ipsn irm ise iwmi iwr kill lp ls man md measure mi mount move mp mv nal ndr ni nmo npssc nsn nv ogv oh popd ps pushd pwd r rbp rcjb rcsn rd rdr ren ri rjb rm rmdir rmo rni rnp rp rsn rsnp rujb rv rvpa rwmi sajb sal saps sasv sbp sc scb select set shcm si sl sleep sls sort sp spjb spps spsv start stz sujb sv swmi tee trcm type wget where wjb write"},s=/\w[\w\d]*((-)[\w\d]+)*/,i={begin:"`[\\s\\S]",relevance:0},a={className:"variable",variants:[{begin:/\$\B/},{className:"keyword",begin:/\$this/},{begin:/\$[\w\d][\w\d_:]*/}]},c={className:"literal",begin:/\$(null|true|false)\b/},d={className:"string",variants:[{begin:/"/,end:/"/},{begin:/@"/,end:/^"@/}],contains:[i,a,{className:"variable",begin:/\$[A-z]/,end:/[^A-z]/}]},f={className:"string",variants:[{begin:/'/,end:/'/},{begin:/@'/,end:/^'@/}]},u={className:"doctag",variants:[{begin:/\.(synopsis|description|example|inputs|outputs|notes|link|component|role|functionality)/},{begin:/\.(parameter|forwardhelptargetname|forwardhelpcategory|remotehelprunspace|externalhelp)\s+\S+/}]},m=e.inherit(e.COMMENT(null,null),{variants:[{begin:/#/,end:/$/},{begin:/<#/,end:/#>/}],contains:[u]}),h={className:"built_in",variants:[{begin:"(".concat(o,")+(-)[\\w\\d]+")}]},p={className:"class",beginKeywords:"class enum",end:/\s*[{]/,excludeEnd:!0,relevance:0,contains:[e.TITLE_MODE]},b={className:"function",begin:/function\s+/,end:/\s*\{|$/,excludeEnd:!0,returnBegin:!0,relevance:0,contains:[{begin:"function",relevance:0,className:"keyword"},{className:"title",begin:s,relevance:0},{begin:/\(/,end:/\)/,className:"params",relevance:0,contains:[a]}]},x={begin:/using\s/,end:/$/,returnBegin:!0,contains:[d,f,{className:"keyword",begin:/(using|assembly|command|module|namespace|type)/}]},O={variants:[{className:"operator",begin:"(".concat(r,")\\b")},{className:"literal",begin:/(-){1,2}[\w\d-]+/,relevance:0}]},z={className:"selector-tag",begin:/@\B/,relevance:0},F={className:"function",begin:/\[.*\]\s*[\w]+[ ]??\(/,end:/$/,returnBegin:!0,relevance:0,contains:[{className:"keyword",begin:"(".concat(l.keyword.toString().replace(/\s/g,"|"),")\\b"),endsParent:!0,relevance:0},e.inherit(e.TITLE_MODE,{endsParent:!0})]},j=[F,m,i,e.NUMBER_MODE,d,f,h,a,c,z],P={begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0,relevance:0,contains:[].concat("self",j,{begin:"("+t.join("|")+")",className:"built_in",relevance:0},{className:"type",begin:/[\.\w\d]+/,relevance:0})};return F.contains.unshift(P),{name:"PowerShell",aliases:["pwsh","ps","ps1"],case_insensitive:!0,keywords:l,contains:j.concat(p,b,x,O,P)}}function wg(e){const t=e.COMMENT(/^\s*@?rem\b/,/$/,{relevance:10});return{name:"Batch file (DOS)",aliases:["bat","cmd"],case_insensitive:!0,illegal:/\/\*/,keywords:{keyword:["if","else","goto","for","in","do","call","exit","not","exist","errorlevel","defined","equ","neq","lss","leq","gtr","geq"],built_in:["prn","nul","lpt3","lpt2","lpt1","con","com4","com3","com2","com1","aux","shift","cd","dir","echo","setlocal","endlocal","set","pause","copy","append","assoc","at","attrib","break","cacls","cd","chcp","chdir","chkdsk","chkntfs","cls","cmd","color","comp","compact","convert","date","dir","diskcomp","diskcopy","doskey","erase","fs","find","findstr","format","ftype","graftabl","help","keyb","label","md","mkdir","mode","more","move","path","pause","print","popd","pushd","promt","rd","recover","rem","rename","replace","restore","rmdir","shift","sort","start","subst","time","title","tree","type","ver","verify","vol","ping","net","ipconfig","taskkill","xcopy","ren","del"]},contains:[{className:"variable",begin:/%%[^ ]|%[^ ]+?%|![^ ]+?!/},{className:"function",begin:{begin:"^\\s*[A-Za-z._?][A-Za-z0-9_$#@~.?]*(:|\\s+label)"}.begin,end:"goto:eof",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),t]},{className:"number",begin:"\\b\\d+",relevance:0},t]}}function Eg(e){const t=e.regex,o=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},l={begin:/"/,end:/"/,contains:[{match:/""/}]},s=["true","false","unknown"],i=["double precision","large object","with timezone","without timezone"],a=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],c=["add","asc","collation","desc","final","first","last","view"],d=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],f=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],u=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],m=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],h=f,p=[...d,...c].filter(P=>!f.includes(P)),b={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},x={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},O={match:t.concat(/\b/,t.either(...h),/\s*\(/),relevance:0,keywords:{built_in:h}};function z(P){return t.concat(/\b/,t.either(...P.map(U=>U.replace(/\s+/,"\\s+"))),/\b/)}const F={scope:"keyword",match:z(m),relevance:0};function j(P,{exceptions:U,when:te}={}){const W=te;return U=U||[],P.map(J=>J.match(/\|\d+$/)||U.includes(J)?J:W(J)?`${J}|0`:J)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:j(p,{when:P=>P.length<3}),literal:s,type:a,built_in:u},contains:[{scope:"type",match:z(i)},F,O,b,r,l,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,o,x]}}function vg(e){const t={className:"subst",variants:[{begin:"\\$[A-Za-z0-9_]+"}]},o={className:"subst",variants:[{begin:/\$\{/,end:/\}/}],keywords:"true false null this is new super"},r={className:"number",relevance:0,variants:[{match:/\b[0-9][0-9_]*(\.[0-9][0-9_]*)?([eE][+-]?[0-9][0-9_]*)?\b/},{match:/\b0[xX][0-9A-Fa-f][0-9A-Fa-f_]*\b/}]},l={className:"string",variants:[{begin:"r'''",end:"'''"},{begin:'r"""',end:'"""'},{begin:"r'",end:"'",illegal:"\\n"},{begin:'r"',end:'"',illegal:"\\n"},{begin:"'''",end:"'''",contains:[e.BACKSLASH_ESCAPE,t,o]},{begin:'"""',end:'"""',contains:[e.BACKSLASH_ESCAPE,t,o]},{begin:"'",end:"'",illegal:"\\n",contains:[e.BACKSLASH_ESCAPE,t,o]},{begin:'"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE,t,o]}]};o.contains=[r,l];const s=["Comparable","DateTime","Duration","Function","Iterable","Iterator","List","Map","Match","Object","Pattern","RegExp","Set","Stopwatch","String","StringBuffer","StringSink","Symbol","Type","Uri","bool","double","int","num","Element","ElementList"],i=s.map(d=>`${d}?`);return{name:"Dart",keywords:{keyword:["abstract","as","assert","async","await","base","break","case","catch","class","const","continue","covariant","default","deferred","do","dynamic","else","enum","export","extends","extension","external","factory","false","final","finally","for","Function","get","hide","if","implements","import","in","interface","is","late","library","mixin","new","null","on","operator","part","required","rethrow","return","sealed","set","show","static","super","switch","sync","this","throw","true","try","typedef","var","void","when","while","with","yield"],built_in:s.concat(i).concat(["Never","Null","dynamic","print","document","querySelector","querySelectorAll","window"]),$pattern:/[A-Za-z][A-Za-z0-9_]*\??/},contains:[l,e.COMMENT(/\/\*\*(?!\/)/,/\*\//,{subLanguage:"markdown",relevance:0}),e.COMMENT(/\/{3,} ?/,/$/,{contains:[{subLanguage:"markdown",begin:".",end:"$",relevance:0}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"class",beginKeywords:"class interface",end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},r,{className:"meta",begin:"@[A-Za-z]+"},{begin:"=>"}]}}const Cg=[["javascript",Dh],["typescript",Ph],["python",Hh],["java",Vh],["c",Uh],["cpp",zh],["csharp",Fh],["go",Kh],["rust",qh],["ruby",Wh],["php",Gh],["swift",tg],["kotlin",og],["xml",rg],["css",pg],["json",mg],["yaml",hg],["markdown",gg],["lua",bg],["bash",kg],["powershell",yg],["dos",wg],["sql",Eg],["dart",vg]];for(const[e,t]of Cg)Zs.registerLanguage(e,t);const Tg={javascript:"javascript",typescript:"typescript",python:"python",java:"java",c:"c",cpp:"cpp",csharp:"csharp",go:"go",rust:"rust",ruby:"ruby",php:"php",swift:"swift",kotlin:"kotlin",html:"xml",css:"css",json:"json",xml:"xml",yaml:"yaml",markdown:"markdown",lua:"lua",bash:"bash",shell:"bash",powershell:"powershell",cmd:"dos",bat:"dos",sql:"sql",dart:"dart"};function ga(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function xg(e,t){const o=Tg[t];if(!o||e.length===0)return ga(e);try{return Zs.highlight(e,{language:o,ignoreIllegals:!0}).value}catch{return ga(e)}}const _g=n.defineComponent({name:"CodeBlock",props:{block:{type:Object,required:!0},placeholder:{type:String,default:void 0}},setup(e){const t=n.ref(null),o=Zt(),r=Vn(),l=n.computed(()=>xg(Me(e.block.content),e.block.attrs.language??"plain"));return()=>{const s=e.block.attrs.language??"plain",i=n.h("div",{ref:t,class:"block-code-lang",onMousedown:d=>{d.preventDefault(),d.stopPropagation()},onClick:d=>{if(d.stopPropagation(),!r.value)return;const f=new CustomEvent("code-lang-click",{bubbles:!0,detail:{blockId:e.block.id,anchor:t.value}});d.currentTarget.dispatchEvent(f)}},s.toUpperCase()),a=n.h("div",{class:"block-code-title"},o.t("codeBlock.title")),c=n.h("pre",{class:"block-code-highlight","aria-hidden":"true"},[n.h("code",{class:"hljs",innerHTML:l.value})]);return n.h("div",{class:["block-code-wrapper","block-focus-root",...bn(e.block.attrs)],"data-lang":s},[a,i,c,n.h(Kn,{block:e.block,placeholder:e.placeholder,class:"block-code"})])}}}),Mg={name:"codeBlock",schema:{type:"codeBlock",content:"text",nestable:!1,isolating:!0,inlineMarks:!1,attrs:{...Du,language:{default:"plain",validate:e=>typeof e=="string"&&e.length>0}}},renderer:{component:_g},slashCommands:[{id:"code-block",title:"slash.codeBlock.title",keywords:["code","fence","pre","代码","代码块","```","codeblock"],description:"slash.codeBlock.description",icon:vl,command:"convertBlock",category:"other",args:()=>({id:"__currentBlock__",type:"codeBlock",attrs:{language:"plain"}})}],inputRules:[{name:"code-fence",pattern:/^``` ?$/,command:"convertBlock",args:e=>(e==null||e.input,{id:"__currentBlock__",type:"codeBlock",attrs:{language:"plain"},__stripPrefix:3})}]},ba="cancelImageUpload",Ng={align:jt.align,indent:jt.indent,src:{default:"",validate:e=>typeof e=="string"},alt:{default:"",validate:e=>typeof e=="string"},title:{default:"",validate:e=>typeof e=="string"},width:{default:0,validate:e=>typeof e=="number"&&Number.isFinite(e)&&e>=0},height:{default:0,validate:e=>typeof e=="number"&&Number.isFinite(e)&&e>=0},caption:{default:"",validate:e=>typeof e=="string"},fileId:{default:0,validate:e=>typeof e=="number"&&Number.isFinite(e)&&Number.isInteger(e)&&e>=0}},Sg=n.defineComponent({name:"ImageBlock",props:{block:{type:Object,required:!0},placeholder:{type:String,default:void 0}},setup(e){e.placeholder;const t=dn(),o=Vn(),r=Zt(),l=e.block.id,s=n.ref(to(l)),i=ru((A,_)=>{A===l&&(s.value=_)});n.onBeforeUnmount(()=>{i()});const a=n.ref(null),c=n.ref(null),d=n.ref(!1);let f=0,u=0,m=0,h=1;function p(){var I,S;const A=c.value;if(!A)return;a.value={w:A.naturalWidth,h:A.naturalHeight};const _=e.block.attrs;(!_.width||_.width===0)&&(!_.height||_.height===0)&&((S=(I=t.commands).setAttrs)==null||S.call(I,{id:l,attrs:{..._,width:A.naturalWidth,height:A.naturalHeight}}))}function b(A){var E,T,R;A.preventDefault(),A.stopPropagation();const _=e.block.attrs,I=(E=c.value)==null?void 0:E.closest(".block-image-container"),S=I?I.clientWidth-8:0;let $=_.width||((T=a.value)==null?void 0:T.w)||200,N=_.height||((R=a.value)==null?void 0:R.h)||150;if(N>x){const Y=$/Math.max(1,N);N=x,$=Math.round(N*Y)}if(S>0&&$>S){const Y=$/Math.max(1,N);$=S,N=Math.round($/Y)}f=$,u=N,m=A.clientX,h=f/Math.max(1,u),d.value=!0,document.addEventListener("mousemove",O,!0),document.addEventListener("mouseup",z,!0),document.addEventListener("selectstart",F,!0)}const x=600;function O(A){var N,E,T;if(!d.value)return;const _=A.clientX-m;let I=Math.max(40,Math.round(f+_)),S=Math.max(40,Math.round(I/h));S>x&&(S=x,I=Math.max(40,Math.round(S*h)));const $=(N=c.value)==null?void 0:N.closest(".block-image-container");if($){const R=$.clientWidth-8;I>R&&(I=Math.max(40,R),S=Math.max(40,Math.round(I/h)))}(T=(E=t.commands).setAttrs)==null||T.call(E,{id:l,attrs:{...e.block.attrs,width:I,height:S}})}function z(){d.value=!1,document.removeEventListener("mousemove",O,!0),document.removeEventListener("mouseup",z,!0),document.removeEventListener("selectstart",F,!0)}function F(A){A.preventDefault()}const j=n.ref(null);function P(){if(!j.value){const A=document.createElement("input");A.type="file",A.accept="image/*",A.multiple=!1,j.value=A,A.addEventListener("change",()=>{var I;const _=(I=A.files)==null?void 0:I[0];_&&U(_),A.value=""})}j.value.click()}function U(A){const _=ll(A),I=new AbortController;Tn(l,{status:"pending",progress:0,file:A,tempPreviewUrl:_,controller:I}),ns(A.name,A,I,{onProgress:S=>{const $=to(l);$&&Tn(l,{...$,progress:Math.max(0,Math.min(1,S))})},onSuccess:S=>{var T,R;const $=to(l);if($!=null&&$.tempPreviewUrl&&$.tempPreviewUrl!==S.url)try{URL.revokeObjectURL($.tempPreviewUrl)}catch{}const N={...e.block.attrs,src:S.url},E={...N,width:S.width??N.width,height:S.height??N.height,alt:S.alt??N.alt,title:S.title??N.title,fileId:S.fileId??N.fileId};(R=(T=t.commands).setAttrs)==null||R.call(T,{id:l,attrs:E}),Tn(l,null)},onError:S=>{const $=to(l);$&&Tn(l,{...$,status:"error",progress:0,error:S})}})}function te(){const A=to(l);!A||!A.file||U(A.file)}function W(){var A,_;(_=(A=t.commands).removeBlock)==null||_.call(A,{id:l})}function J(){const A=s.value;return A!=null&&A.tempPreviewUrl?A.tempPreviewUrl:e.block.attrs.src??""}return()=>{const A=e.block.attrs,_=J(),I=s.value,S=A.width,$=A.height;let N=S;S>0&&$>x&&(N=Math.max(1,Math.round(S*x/$)));const E={},T=(I==null?void 0:I.status)==="error";S&&S>0&&!T&&(E.width=`${N}px`);const R=[],Y=!!I&&I.status!=="success";if(o.value&&R.push(n.h("div",{class:["image-block-toolbar",{"image-block-toolbar-forced":Y}]},[n.h("button",{class:"image-block-btn",title:r.t("image.replace"),onClick:re=>{re.stopPropagation(),P()}},[n.h(Xt,{html:Fu})]),n.h("button",{class:"image-block-btn",title:r.t("image.remove"),onClick:re=>{re.stopPropagation(),W()}},[n.h(Xt,{html:zu})])])),(I==null?void 0:I.status)==="pending"){const re=Math.round(I.progress*100);R.push(n.h("div",{class:"image-block-upload-overlay"},[n.h(Xt,{html:Vu,class:"image-block-spinner"}),n.h("div",{class:"image-block-upload-label"},r.t("image.uploading")),n.h("div",{class:"image-block-progress-track"},[n.h("div",{class:"image-block-progress-bar",style:{width:`${re}%`}})]),n.h("div",{class:"image-block-progress-pct"},`${re}%`)]))}if((I==null?void 0:I.status)==="error"&&R.push(n.h("div",{class:"image-block-error-overlay"},[n.h("div",{class:"image-block-error-icon"},"!"),n.h("div",{class:"image-block-error-title"},r.t("image.uploadFailed")),n.h("div",{class:"image-block-error-msg"},I.error??""),n.h("button",{class:"image-block-retry-btn",onClick:re=>{re.stopPropagation(),te()}},[n.h(Xt,{html:Uu})," ",r.t("image.retry")])])),!_&&(!I||I.status==="success")&&R.push(n.h("div",{class:"image-block-empty",onClick:re=>{re.stopPropagation(),o.value&&P()}},[n.h(Xt,{html:Ku,class:"image-block-empty-icon"}),n.h("div",{class:"image-block-empty-title"},r.t("image.emptyTitle")),n.h("div",{class:"image-block-empty-sub"},r.t("image.emptySub"))])),_&&(I==null?void 0:I.status)!=="error"){const re={};S&&S>0&&(re.width=`${N}px`);const le=[n.h("img",{ref:c,class:"image-block-img",src:_,alt:A.alt||"",title:A.title||"",style:re,draggable:!1,onLoad:p,onError:()=>{(!I||I.status!=="pending"&&I.status!=="error")&&Tn(l,{status:"error",progress:0,error:r.t("image.loadFailed"),tempPreviewUrl:void 0})}})];a.value&&o.value&&le.push(n.h("div",{class:"image-block-resize-handle",onMousedown:b,title:r.t("image.resize")})),R.push(n.h("div",{class:"image-block-main"},le))}const ae=A.caption||"";!((I==null?void 0:I.status)==="error")&&(ae||_)&&R.push(n.h("div",{class:"image-block-caption",contenteditable:o.value?"true":"false","data-placeholder":r.t("image.captionPlaceholder"),onBlur:re=>{var xe,Ae;const le=re.currentTarget.textContent??"";le!==ae&&((Ae=(xe=t.commands).setAttrs)==null||Ae.call(xe,{id:l,attrs:{...e.block.attrs,caption:le}}))},onInput:()=>{},onMousedown:re=>{re.stopPropagation()},onClick:re=>{re.stopPropagation()}},ae));const pe=["block-image-wrapper"];return(I==null?void 0:I.status)==="error"&&pe.push("image-block-wrapper-error"),(I==null?void 0:I.status)==="pending"&&!_&&!I.tempPreviewUrl&&pe.push("image-block-wrapper-loading"),n.h("div",{class:["block-image-container","block-focus-root",...bn(A)]},[n.h("div",{class:pe,style:E},R)])}}});function Bl(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function Ag(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function Ig(e){return e?(t,o,r,l)=>{e(t,o,r,s=>{const i=Number.isFinite(s)?Math.max(0,Math.min(1,s/100)):0;l.onProgress(i)}).then(s=>{l.onSuccess({url:s.url,width:s.width,height:s.height,alt:s.alt,title:s.title,fileId:s.fileId})}).catch(s=>{r.signal.aborted||l.onError(s instanceof Error?s.message:String(s))})}:(t,o,r,l)=>{au(o,l.onProgress).then(s=>l.onSuccess({url:s.url,width:s.width,height:s.height}),s=>l.onError(s instanceof Error?s.message:String(s)))}}const ka="startImageUpload";async function Bg(e,t,o={}){var d,f,u,m,h,p,b,x,O,z,F,j,P,U,te,W,J,A;const{relativeToBlockId:r=null,position:l="after",convertIfEmpty:s=!0}=o;let i=null,a=r??null;if(!a){const _=e.getState().selection;_.kind==="caret"?a=_.blockId:_.kind==="text"&&(a=_.anchor.blockId)}if(a||(a=e.getState().doc.root[0]??null),l==="replace"&&a){const _=e.registries.schema.get("image");_&&((f=(d=e.commands).replaceBlock)==null||f.call(d,{id:a,type:"image",attrs:Qn(_)}),i=a)}if(!i&&a&&s&&l!=="before"){const I=e.getState().doc.blocks.get(a);if(I&&I.type==="paragraph"&&Me(I.content).length===0){const S=e.registries.schema.get("image");S&&((m=(u=e.commands).replaceBlock)==null||m.call(u,{id:a,type:"image",attrs:Qn(S)}),i=a)}}if(!i&&a&&l==="before"){const _=e.registries.schema.get("image");if(_){(p=(h=e.commands).insertBlock)==null||p.call(h,{before:a,type:"image",attrs:Qn(_)});const I=e.getState().selection;I.kind==="caret"?i=I.blockId:I.kind==="text"&&(i=I.anchor.blockId)}}if(!i&&a){const _=e.registries.schema.get("image");if(_){(x=(b=e.commands).insertBlock)==null||x.call(b,{after:a,type:"image",attrs:Qn(_)});const I=e.getState().selection;I.kind==="caret"?i=I.blockId:I.kind==="text"&&(i=I.anchor.blockId)}}if(!i){const _=e.registries.schema.get("image");if(!_)return null;const I=e.getState().doc,S=I.root[I.root.length-1]??null;S?(z=(O=e.commands).insertBlock)==null||z.call(O,{after:S,type:"image",attrs:Qn(_)}):(j=(F=e.commands).insertBlock)==null||j.call(F,{after:null,type:"image",attrs:Qn(_)});const $=e.getState().selection;$.kind==="caret"?i=$.blockId:$.kind==="text"&&(i=$.anchor.blockId)}if(!i)return null;if(typeof t=="string"){const _=t;try{const I=await new Promise($=>{if(typeof document>"u")return $({});const N=document.createElement("img");let E=!1;const T=()=>{E||(E=!0,$({width:N.naturalWidth||void 0,height:N.naturalHeight||void 0}))};N.onload=T,N.onerror=T,N.src=_,setTimeout(T,4e3)}),S={src:_,width:I.width,height:I.height};(U=(P=e.commands).setAttrs)==null||U.call(P,{id:i,attrs:S})}catch{(W=(te=e.commands).setAttrs)==null||W.call(te,{id:i,attrs:{src:_}})}return i}const c=await cu(i,t);if(c.ok){const _=c.value,I={src:_.url,alt:_.alt,title:_.title,width:_.width,height:_.height,fileId:_.fileId};(A=(J=e.commands).setAttrs)==null||A.call(J,{id:i,attrs:I})}return i}function ya(e){const t=new Map;for(const o of e.values()){if(o.type!=="image")continue;const r=o.attrs.fileId;typeof r=="number"&&Number.isFinite(r)&&r>0&&t.set(r,(t.get(r)??0)+1)}return t}function Rg(e,t){let o=null;return{name:"image-upload",init(r,l){const s=Ig(e);return ts(s),o=l.editor.registerExtensionMethod(ka,(i,a)=>Bg(l.editor,i,a??{})),{refCounts:ya(r.doc.blocks),prevBlocks:r.doc.blocks}},applyTransaction(r,l,s,i,a){const c=l.pluginState["image-upload"],d=(c==null?void 0:c.refCounts)??new Map,f=(c==null?void 0:c.prevBlocks)??s.blocks,u=ya(s.blocks);for(const[h,p]of d)(u.get(h)??0)===0&&p>0&&(t==null||t(h));const m=[];for(const[h]of f)s.blocks.has(h)||m.push(h);return m.length>0&&iu(m),{refCounts:u,prevBlocks:s.blocks}},onDestroy(){ts(null),o==null||o(),o=null}}}function wa(e={}){const t=Rg(e.upload??null,e.onFileCleanup);return{name:"image",schema:{type:"image",content:"none",nestable:!1,attrs:{...Ng},empty:o=>{const r=o.attrs.src;return typeof r!="string"||r.length===0}},renderer:{component:Sg,editable:!1},commands:[{name:ba,run:o=>(r,l)=>{const s=o==null?void 0:o.blockId;return typeof s!="string"?!1:(Tn(s,null),!0)}}],plugins:[t],slashCommands:[{id:"image",title:"slash.image.title",keywords:["image","picture","photo","img","图片","图像","照片"],description:"slash.image.description",icon:Hu,command:"convertBlock",category:"other",args:()=>({id:"__currentBlock__",type:"image",attrs:{}})}],serialize:{toHTML:o=>{const r=o.attrs,l=r.src;if(!l)return"";const s=r.alt||"",i=r.title||"",a=r.width,c=r.height,d=r.caption||"",f=[];a&&a>0&&f.push(`width:${a}px`),c&&c>0&&f.push(`height:${c}px`);const u=f.length?` style="${f.join(";")}"`:"",m=i?` title="${Bl(i)}"`:"",h=`<img src="${Bl(l)}" alt="${Bl(s)}"${m}${u}>`;return d?`<figure>${h}<figcaption>${Ag(d)}</figcaption></figure>`:h},toMarkdown:o=>{const r=o.attrs,l=r.src;if(!l)return"";const s=r.alt||"",i=r.title||"",a=r.caption||"",c=i?``:``;return a?`${c}
|
|
19
|
+
*${a}*`:c}}}}const Ea=wa();function Rl(e){return/[A-Za-z]/.test(e)}function Ll(e){return e>="0"&&e<="9"}function va(e){return e===" "||e===" "||e===`
|
|
20
|
+
`||e==="\r"||e==="\f"||e==="\v"}const Lg={"{":"lbrace","}":"rbrace","[":"lbracket","]":"rbracket","(":"lparen",")":"rparen","^":"sup",_:"sub","&":"amp"};function Og(e){const t=e??"",o=[];let r=0;for(;r<t.length;){const l=t[r];if(l==="\\"){const i=t[r+1];if(i==="\\"){o.push({kind:"newline",value:"\\\\",start:r,end:r+2}),r+=2;continue}if(i!==void 0&&Rl(i)){let a=r+1;for(;a<t.length&&Rl(t[a]);)a+=1;o.push({kind:"command",value:t.slice(r+1,a),start:r,end:a}),r=a;continue}if(i!==void 0){o.push({kind:"char",value:i,start:r,end:r+2}),r+=2;continue}o.push({kind:"char",value:"\\",start:r,end:r+1}),r+=1;continue}if(Rl(l)){o.push({kind:"char",value:l,start:r,end:r+1}),r+=1;continue}if(Ll(l)){let i=r,a=!1;for(;i<t.length;){const c=t[i];if(Ll(c)){i+=1;continue}if(c==="."&&!a&&i+1<t.length&&Ll(t[i+1])){a=!0,i+=1;continue}break}o.push({kind:"number",value:t.slice(r,i),start:r,end:i}),r=i;continue}if(va(l)){let i=r;for(;i<t.length&&va(t[i]);)i+=1;o.push({kind:"space",value:t.slice(r,i),start:r,end:i}),r=i;continue}const s=Lg[l]??null;if(s){o.push({kind:s,value:l,start:r,end:r+1}),r+=1;continue}o.push({kind:"operator",value:l,start:r,end:r+1}),r+=1}return o}const Ca={alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",pi:"π",rho:"ρ",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",Gamma:"Γ",Delta:"Δ",Theta:"Θ",Lambda:"Λ",Xi:"Ξ",Pi:"Π",Sigma:"Σ",Upsilon:"Υ",Phi:"Φ",Psi:"Ψ",Omega:"Ω"},Ol={pm:"±",mp:"∓",times:"×",div:"÷",cdot:"⋅",ast:"∗",star:"⋆",circ:"∘",neq:"≠",ne:"≠",leq:"≤",le:"≤",geq:"≥",ge:"≥",ll:"≪",gg:"≫",approx:"≈",equiv:"≡",sim:"∼",propto:"∝",infty:"∞",partial:"∂",nabla:"∇",to:"→",rightarrow:"→",longrightarrow:"⟶",leftarrow:"←",leftrightarrow:"↔",mapsto:"↦",dots:"…",ldots:"…",cdots:"⋯",vdots:"⋮",prime:"′",angle:"∠",in:"∈",notin:"∉",subset:"⊂",cup:"∪",cap:"∩",forall:"∀",exists:"∃",emptyset:"∅",langle:"⟨",rangle:"⟩"},Ta={sin:"sin",cos:"cos",tan:"tan",cot:"cot",sec:"sec",csc:"csc",arcsin:"arcsin",arccos:"arccos",arctan:"arctan",sinh:"sinh",cosh:"cosh",tanh:"tanh",log:"log",ln:"ln",lg:"lg",exp:"exp",lim:"lim",liminf:"lim inf",limsup:"lim sup",min:"min",max:"max",sup:"sup",inf:"inf",det:"det",gcd:"gcd",dim:"dim",arg:"arg",deg:"deg"},xa={sum:"∑",prod:"∏",coprod:"∐",int:"∫",iint:"∬",oint:"∮",bigcup:"⋃",bigcap:"⋂"},Dg=["frac","sqrt","left","right","begin","end"],_a={quad:" ",qquad:" "},Ma={",":" ",":":" ",";":" ","!":""," ":" "},$g=[...Dg,...Object.keys(Ca),...Object.keys(Ol),...Object.keys(Ta),...Object.keys(xa),...Object.keys(_a),...Object.keys(Ma)];function Dl(e){return e.index>=e.tokens.length}function un(e){return e.tokens[e.index]}function Nt(e){const t=e.tokens[e.index];return t&&(e.index+=1),t}function Lt(e,t){const o=e.tokens[e.index-1];return o?o.end:t}const Pg=new Set(["operator","sup","sub","lbrace","lparen","lbracket","amp","newline"]);function Hg(e){const t=e.tokens[e.index-2];return t?t.kind==="command"?Object.prototype.hasOwnProperty.call(Ol,t.value):Pg.has(t.kind):!0}function Na(e){return!e||e.kind==="rbrace"||e.kind==="rparen"||e.kind==="rbracket"||e.kind==="amp"||e.kind==="newline"||e.kind==="sup"||e.kind==="sub"?!0:e.kind==="command"&&(e.value==="right"||e.value==="end")}function fn(e,t,o,r){return e.diagnostics.push({severity:"error",message:t,start:o,end:r}),{type:"error",message:t,start:o,end:r}}function Sa(e,t,o,r){e.diagnostics.push({severity:"warning",message:t,start:o,end:r})}function Aa(e){const t=e??"";try{const r={tokens:Og(t).filter(s=>s.kind!=="space"),index:0,diagnostics:[]};return{nodes:Ao(r,()=>!1),diagnostics:r.diagnostics}}catch(o){const r=o instanceof Error?o.message:String(o),l=t.length;return{nodes:[{type:"error",message:r,start:0,end:l}],diagnostics:[{severity:"error",message:r,start:0,end:l}]}}}function Ao(e,t){const o=[];for(;!Dl(e);){const r=un(e);if(t(r))break;const l=Ia(e);l?o.push(l):Nt(e)}return o}function Ia(e){const t=un(e);if(!t)return null;const o=$l(e);if(!o)return null;let r=null,l=null;for(;;){const s=un(e);if(!s)break;if(s.kind==="sup")Nt(e),r===null&&(r=Ba(e,"^"));else if(s.kind==="sub")Nt(e),l===null&&(l=Ba(e,"_"));else break}return o.type==="largeOperator"?r===null&&l===null?o:{...o,sup:o.sup??r,sub:o.sub??l,end:Lt(e,o.end)}:r===null&&l===null?o:{type:"scripts",base:o,sup:r,sub:l,start:t.start,end:Lt(e,t.end)}}function Ba(e,t){const o=un(e);if(Na(o))return[fn(e,`missing script after "${t}"`,o?o.start:Lt(e,0),o?o.end:Lt(e,0))];const r=$l(e);return r?[r]:[fn(e,`missing script after "${t}"`,o.start,o.end)]}function $l(e){const t=un(e);if(!t)return null;switch(t.kind){case"lbrace":{Nt(e);const o=Ao(e,l=>l.kind==="rbrace"),r=un(e);return r&&r.kind==="rbrace"?(Nt(e),{type:"group",body:o,open:null,close:null,start:t.start,end:r.end}):(o.push(fn(e,'unterminated group: missing "}"',t.start,Lt(e,t.end))),{type:"group",body:o,open:null,close:null,start:t.start,end:Lt(e,t.end)})}case"lparen":case"lbracket":{Nt(e);const o=t.kind==="lparen"?"rparen":"rbracket",r=t.kind==="lparen"?"(":"[",l=t.kind==="lparen"?")":"]",s=Ao(e,a=>a.kind===o),i=un(e);return i&&i.kind===o?(Nt(e),{type:"group",body:s,open:r,close:l,start:t.start,end:i.end}):(s.push(fn(e,`unterminated group: missing "${l}"`,t.start,Lt(e,t.end))),{type:"group",body:s,open:r,close:l,start:t.start,end:Lt(e,t.end)})}case"number":return Nt(e),{type:"number",value:t.value,start:t.start,end:t.end};case"char":{Nt(e);const o=Ma[t.value];return o!==void 0?{type:"symbol",char:o,command:t.value,start:t.start,end:t.end}:{type:"identifier",value:t.value,start:t.start,end:t.end}}case"operator":{Nt(e);const o={type:"operator",value:t.value,command:null,start:t.start,end:t.end};return t.value==="-"&&Hg(e)&&(o.unary=!0),o}case"command":return Vg(e);default:return null}}function Vg(e){var r;const t=Nt(e);switch(t.value){case"frac":{const l=Pl(e,"frac"),s=Pl(e,"frac");return{type:"fraction",numerator:l,denominator:s,start:t.start,end:Lt(e,t.end)}}case"sqrt":{let l=null;const s=un(e);return s&&s.kind==="lbracket"&&(Nt(e),l=Ao(e,a=>a.kind==="rbracket"),((r=un(e))==null?void 0:r.kind)==="rbracket"?Nt(e):fn(e,'unterminated optional argument: missing "]"',s.start,Lt(e,s.end))),{type:"root",radicand:Pl(e,"sqrt"),index:l,start:t.start,end:Lt(e,t.end)}}case"left":{const l=Hl(e),s=Ao(e,c=>c.kind==="command"&&c.value==="right"),i=un(e);let a=zg(l);return i&&i.kind==="command"&&i.value==="right"?(Nt(e),a=Hl(e)):fn(e,"missing \\right",t.start,Lt(e,t.end)),{type:"group",body:s,open:l,close:a,start:t.start,end:Lt(e,t.end)}}case"right":return Hl(e),fn(e,"unexpected \\right",t.start,t.end);case"begin":return Fg(e,t);case"end":return Vl(e),fn(e,"unexpected \\end",t.start,t.end);default:return Ug(e,t)}}function Ug(e,t){const o=t.value,r=Ca[o];if(r!==void 0)return{type:"symbol",char:r,command:o,start:t.start,end:t.end};const l=_a[o];if(l!==void 0)return{type:"symbol",char:l,command:o,start:t.start,end:t.end};const s=Ol[o];if(s!==void 0)return{type:"operator",value:s,command:o,start:t.start,end:t.end};const i=Ta[o];if(i!==void 0)return{type:"function",name:i,command:o,start:t.start,end:t.end};const a=xa[o];return a!==void 0?{type:"largeOperator",symbol:a,command:o,sup:null,sub:null,start:t.start,end:t.end}:(Sa(e,`unknown command "\\${o}"`,t.start,t.end),{type:"unknown",command:o,start:t.start,end:t.end})}function Pl(e,t){var l;const o=un(e);if(!o||Na(o))return[fn(e,`missing argument for "\\${t}"`,Lt(e,0),Lt(e,0))];if(o.kind==="lbrace"){Nt(e);const s=Ao(e,i=>i.kind==="rbrace");return((l=un(e))==null?void 0:l.kind)==="rbrace"?Nt(e):s.push(fn(e,'unterminated group: missing "}"',o.start,Lt(e,o.end))),s}const r=$l(e);return r?[r]:[fn(e,`missing argument for "\\${t}"`,o.start,o.end)]}function Hl(e){const t=Nt(e);if(!t)return null;switch(t.kind){case"lparen":return"(";case"rparen":return")";case"lbracket":return"[";case"rbracket":return"]";case"lbrace":return"{";case"rbrace":return"}";case"operator":return t.value==="|"?"|":(t.value===".",null);case"char":return t.value==="{"||t.value==="}"?t.value:null;default:return e.index-=1,null}}function zg(e){switch(e){case"(":return")";case"[":return"]";case"{":return"}";case"|":return"|";default:return null}}function Vl(e){const t=un(e);if(!t||t.kind!=="lbrace")return null;Nt(e);let o="";for(;!Dl(e);){const r=Nt(e);if(r.kind==="rbrace")break;o+=r.value}return o}function Fg(e,t){const o=Vl(e);if(o===null)return fn(e,"missing environment name after \\begin",t.start,t.end);const r=o==="matrix"?"matrix":o==="aligned"?"aligned":null,l=Kg(e,o);return r===null?fn(e,`unsupported environment "${o}"`,t.start,Lt(e,t.end)):{type:"matrix",env:r,rows:l,start:t.start,end:Lt(e,t.end)}}function Kg(e,t){const o=[];let r=[],l=[],s=!1;const i=()=>{r.push(l),l=[]},a=()=>{i(),o.push(r),r=[]};for(;!Dl(e);){const c=un(e);if(c.kind==="newline"){Nt(e),a();continue}if(c.kind==="amp"){Nt(e),i();continue}if(c.kind==="command"&&c.value==="end"){Nt(e);const f=Vl(e);s=!0,f!==null&&f!==t&&Sa(e,`environment "${t}" closed by \\end{${f}}`,c.start,Lt(e,c.end));break}const d=Ia(e);d?l.push(d):Nt(e)}return(l.length>0||r.length>0)&&a(),s||fn(e,`missing \\end{${t}}`,Lt(e,0),Lt(e,0)),o}function nt(e,t,o,r=null){return{tag:e,class:t,style:r,text:null,children:o}}function kn(e,t,o){return{tag:e,class:t,style:null,text:o,children:null}}function Ra(e){switch(e){case"(":return"(";case")":return")";case"[":return"[";case"]":return"]";case"{":return"{";case"}":return"}";case"|":return"|";default:return""}}function La(e,t){return nt("span",t.displayMode?"math-equation math-display":"math-equation",zt(e,t))}const qg={"-":"−"};function Wg(e){return qg[e]??e}function zt(e,t){const o=[];for(const r of e)o.push(...Ul(r,t));return o}function Ul(e,t){switch(e.type){case"text":return[kn("span","math-text",e.value)];case"number":return[kn("span","math-number",e.value)];case"identifier":return[kn("span","math-identifier",e.value)];case"operator":return[kn("span",e.unary?"math-operator math-op-unary":"math-operator",Wg(e.value))];case"symbol":return[kn("span","math-symbol",e.char)];case"function":return[kn("span","math-function",e.name)];case"unknown":return[kn("span","math-unknown","\\"+e.command)];case"error":return[kn("span","math-error","⚠")];case"group":{const o=[];return e.open&&o.push(kn("span","math-delimiter",Ra(e.open))),o.push(nt("span","math-group",zt(e.body,t))),e.close&&o.push(kn("span","math-delimiter",Ra(e.close))),o}case"fraction":return[nt("span","math-fraction",[nt("span","math-fraction-numerator",zt(e.numerator,t)),nt("span","math-fraction-bar",[]),nt("span","math-fraction-denominator",zt(e.denominator,t))])];case"root":{const o=[];return e.index&&o.push(nt("span","math-root-index",zt(e.index,t))),o.push(kn("span","math-root-sign","")),o.push(nt("span","math-root-radicand",zt(e.radicand,t))),[nt("span","math-root",o)]}case"scripts":{if(t.displayMode&&e.base.type==="function"&&e.sub&&!e.sup)return[nt("span","math-limit",[nt("span","math-limit-base",Ul(e.base,t)),nt("span","math-limit-under",zt(e.sub,t))])];const o=[nt("span","math-base",Ul(e.base,t))];return e.sup&&e.sub?o.push(nt("span","math-scripts",[nt("sup","math-sup",zt(e.sup,t)),nt("sub","math-sub",zt(e.sub,t))])):e.sup?o.push(nt("sup","math-sup",zt(e.sup,t))):e.sub&&o.push(nt("sub","math-sub",zt(e.sub,t))),[nt("span","math-script",o)]}case"largeOperator":{if(t.displayMode&&(e.sup||e.sub))return[nt("span","math-large-operator",[nt("span","math-op-limits",[nt("span","math-op-upper",e.sup?zt(e.sup,t):[]),kn("span","math-op-symbol",e.symbol),nt("span","math-op-lower",e.sub?zt(e.sub,t):[])])])];const o=[kn("span","math-op-symbol",e.symbol)];return e.sup&&o.push(nt("sup","math-sup",zt(e.sup,t))),e.sub&&o.push(nt("sub","math-sub",zt(e.sub,t))),[nt("span","math-large-operator math-op-inline",o)]}case"matrix":return e.env==="aligned"?[Yg(e.rows,t)]:[Gg(e.rows,t)];default:return[]}}function Gg(e,t){let o=1;for(const r of e)o=Math.max(o,r.length);return nt("span","math-matrix",e.map(r=>nt("span","math-matrix-row",r.map(l=>nt("span","math-matrix-cell",zt(l,t))))),{gridTemplateColumns:`repeat(${o}, auto)`})}function Yg(e,t){return nt("span","math-aligned",e.map(o=>nt("span","math-aligned-row",[nt("span","math-aligned-left",zt(o[0]??[],t)),nt("span","math-aligned-right",zt(Zg(o),t))])))}function Zg(e){return e.length<=1?[]:e.slice(1).flat()}function Xg(e,t){return Oa(La(e,t))}function Oa(e){const t={};if(e.class&&(t.class=e.class),e.style&&(t.style=e.style),e.text!==null)return n.h(e.tag,t,e.text);const o=e.children?e.children.map(Oa):void 0;return n.h(e.tag,t,o)}function jg(e,t){return Da(La(e,t))}function zl(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function Fl(e){return zl(e).replace(/"/g,""")}function Qg(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Jg(e){return Object.keys(e).map(t=>`${Qg(t)}: ${Fl(e[t]??"")}`).join("; ")}function Da(e){const t=e.class?` class="${Fl(e.class)}"`:"",o=e.style?` style="${Fl(Jg(e.style))}"`:"",r=`<${e.tag}${t}${o}>`;if(e.text!==null)return`${r}${zl(e.text)}</${e.tag}>`;const l=e.children?e.children.map(Da).join(""):"";return`${r}${l}</${e.tag}>`}const $a={html:"",vnode:null,error:!1,diagnostics:[]};function Mr(e,t,o){const r=t??"";try{const l=e.render(r,o);return!l||typeof l!="object"?$a:{html:typeof l.html=="string"?l.html:"",vnode:l.vnode??null,error:l.error===!0,diagnostics:Array.isArray(l.diagnostics)?l.diagnostics:[]}}catch{return{html:"",vnode:null,error:!0,diagnostics:[{severity:"error",message:"Equation renderer failed",start:0,end:r.length}]}}}const Nr={render(e,t){const o=(t==null?void 0:t.displayMode)??!0,{nodes:r,diagnostics:l}=Aa(e??"");return{html:jg(r,{displayMode:o}),vnode:Xg(r,{displayMode:o}),error:l.some(s=>s.severity==="error"),diagnostics:l}}};function eb(e){const t=Mr(Nr,e,{displayMode:!0});return{html:t.html,error:t.error}}const tb={expression:{default:"",validate:e=>typeof e=="string"},indent:jt.indent};function Pa(e){return n.defineComponent({name:"EquationBlock",props:{block:{type:Object,required:!0},placeholder:{type:String,default:void 0}},setup(t){const o=dn(),r=Vn(),l=Zt(),s=t.block.id,i=n.ref(!1),a=n.ref(""),c=n.ref(""),d=n.ref($a),f=n.ref(null);function u(){const A=t.block.attrs.expression;return typeof A=="string"?A:""}const m=n.computed(()=>Mr(e,u(),{displayMode:!0})),h=n.computed(()=>u().trim().length===0);let p=0;function b(){d.value=Mr(e,a.value,{displayMode:!0})}function x(){if(typeof requestAnimationFrame>"u"){b();return}p&&cancelAnimationFrame(p),p=requestAnimationFrame(()=>{b()})}function O(){const A=f.value;A&&(A.style.height="auto",A.style.height=`${A.scrollHeight}px`)}function z(A){if(!i.value)return;const _=A.target;_&&_.closest("[data-equation-edit]")||U()}function F(){typeof document<"u"&&document.addEventListener("mousedown",z,!0)}function j(){typeof document<"u"&&document.removeEventListener("mousedown",z,!0)}function P(){r.value&&(i.value||(c.value=u(),a.value=u(),i.value=!0,n.nextTick(()=>{const A=f.value;if(A){A.focus();const _=A.value.length;A.setSelectionRange(_,_),O()}b()}),F()))}function U(){var I,S,$,N;if(!i.value)return;j(),i.value=!1;const A=a.value;if(A.trim().length===0){(S=(I=o.commands).removeBlock)==null||S.call(I,{id:s});return}(N=($=o.commands).setAttrs)==null||N.call($,{id:s,attrs:{expression:A}})}function te(){var A,_;i.value&&(j(),i.value=!1,c.value.trim().length===0&&((_=(A=o.commands).removeBlock)==null||_.call(A,{id:s})))}function W(A){if(A.stopPropagation(),A.key==="Escape"){A.preventDefault(),te();return}if(A.key==="Enter"&&!A.shiftKey){A.preventDefault(),U();return}if(A.key==="Enter"&&(A.ctrlKey||A.metaKey)){A.preventDefault(),U();return}}function J(A){var _,I;A.stopPropagation(),r.value&&((I=(_=o.commands).selectBlock)==null||I.call(_,{id:s}),P())}return n.watch(h,A=>{A&&r.value&&!i.value&&P()}),r.value&&h.value&&P(),n.onBeforeUnmount(()=>{j(),p&&typeof cancelAnimationFrame<"u"&&cancelAnimationFrame(p)}),()=>{const A=t.placeholder??l.t("equation.placeholder");if(i.value||r.value&&h.value){const I=d.value.vnode;return n.h("div",{class:["equation-block","equation-editing","block-focus-root",...bn(t.block.attrs)],"data-equation-block":"","data-equation-edit":""},[n.h("div",{class:"equation-edit","data-equation-edit":""},[n.h("textarea",{ref:f,class:"equation-edit-input","data-equation-edit":"",value:a.value,placeholder:A,spellcheck:!1,autocapitalize:"off",autocomplete:"off",onInput:S=>{a.value=S.currentTarget.value,x(),O()},onKeydown:W})]),n.h("div",{class:"equation-edit-preview"},[d.value.error?n.h("div",{class:"equation-error-badge"},l.t("equation.invalid")):null,I?n.h("div",{class:"equation-preview-html"},[I]):n.h(Xt,{html:d.value.html,class:"equation-preview-html"})])])}const _=[];return h.value?_.push(n.h("span",{class:"equation-placeholder"},[A])):m.value.error?_.push(n.h("span",{class:"equation-error-inline"},[l.t("equation.invalid")])):m.value.vnode?_.push(n.h("div",{class:"equation-render"},[m.value.vnode])):_.push(n.h(Xt,{html:m.value.html,class:"equation-render"})),r.value&&!h.value&&_.push(n.h("div",{class:["equation-toolbar"]},[n.h("button",{type:"button",class:"equation-edit-btn",title:l.t("equation.edit"),onClick:J},[n.h(Xt,{html:Wu})])])),n.h("div",{class:["equation-block","block-focus-root",...bn(t.block.attrs)],"data-equation-block":""},_)}}})}const nb=Pa(Nr);function Ha(e={}){const t=e.renderer??Nr,o=Pa(t);return{name:"equation",schema:{type:"equation",content:"none",nestable:!1,isolating:!0,attrs:{...tb},empty:r=>{const l=r.attrs.expression;return typeof l!="string"||l.trim().length===0}},renderer:{component:o,editable:!1},slashCommands:[{id:"equation",title:"slash.equation.title",keywords:["math","equation","formula","latex","tex","公式","数学","tex"],description:"slash.equation.description",icon:qu,command:"convertBlock",category:"other",args:()=>({id:"__currentBlock__",type:"equation",attrs:{expression:""}})}],serialize:{toHTML:r=>{const l=r.attrs.expression,s=typeof l=="string"?l:"";if(!s.trim())return"";const i=Mr(t,s,{displayMode:!0});return i.error?`<p class="math-error-block">${zl(s)}</p>`:`<div class="equation-block-rendered">${i.html}</div>`},toMarkdown:r=>{const l=r.attrs.expression,s=typeof l=="string"?l:"";return s.trim()?`$$$
|
|
21
|
+
${(s.length?s.split(`
|
|
277
22
|
`):[""]).join(`
|
|
278
23
|
`)}
|
|
279
|
-
$$$`:""}}};function N7(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}const Cl='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="2" y="3" width="12" height="10" rx="1"/><path d="M2 7h12M2 10h12M6 3v10M10 3v10"/></svg>',B7='<svg viewBox="0 0 1024 1024" width="14" height="14" fill="currentColor" aria-hidden="true"><path d="M160 85.333333a32 32 0 0 0-32 32v42.666667A138.666667 138.666667 0 0 0 266.666667 298.666667h490.666666A138.666667 138.666667 0 0 0 896 160v-42.666667a32 32 0 0 0-64 0v42.666667a74.666667 74.666667 0 0 1-74.666667 74.666667H661.333333V117.333333a32 32 0 0 0-64 0V234.666667h-170.666666V117.333333a32 32 0 0 0-64 0V234.666667H266.666667A74.666667 74.666667 0 0 1 192 160v-42.666667A32 32 0 0 0 160 85.333333zM160 938.666667a32 32 0 0 1-32-32v-42.666667A138.666667 138.666667 0 0 1 266.666667 725.333333h490.666666A138.666667 138.666667 0 0 1 896 864v42.666667a32 32 0 0 1-64 0v-42.666667a74.666667 74.666667 0 0 0-74.666667-74.666667H661.333333v117.333334a32 32 0 0 1-64 0V789.333333h-170.666666v117.333334a32 32 0 0 1-64 0V789.333333H266.666667a74.666667 74.666667 0 0 0-74.666667 74.666667v42.666667a32 32 0 0 1-32 32zM512 557.226667l62.72 62.72a32 32 0 1 0 45.226667-45.226667L557.226667 512l62.72-62.72a32 32 0 1 0-45.226667-45.226667L512 466.773333l-62.72-62.72a32 32 0 1 0-45.226667 45.226667L466.773333 512l-62.72 62.72a32 32 0 1 0 45.226667 45.226667L512 557.226667z"/><path d="M372.352 544c0.981333-1.109333 2.005333-2.176 3.072-3.242667L404.181333 512l-28.757333-28.757333a78.72 78.72 0 0 1-3.072-3.242667H117.333333a32 32 0 0 0 0 64h255.018667zM662.314667 544h244.352a32 32 0 0 0 0-64h-244.352a77.909333 77.909333 0 0 1-3.072 3.242667l-28.757334 28.757333 28.757334 28.757333 3.072 3.242667z"/></svg>',I7='<svg viewBox="0 0 1024 1024" width="14" height="14" fill="currentColor" aria-hidden="true"><path d="M938.666667 160a32 32 0 0 0-32-32h-42.666667A138.666667 138.666667 0 0 0 725.333333 266.666667v490.666666A138.666667 138.666667 0 0 0 864 896h42.666667a32 32 0 0 0 0-64h-42.666667a74.666667 74.666667 0 0 1-74.666667-74.666667V661.333333h117.333334a32 32 0 0 0 0-64H789.333333v-170.666666h117.333334a32 32 0 0 0 0-64H789.333333V266.666667c0-41.216 33.450667-74.666667 74.666667-74.666667h42.666667a32 32 0 0 0 32-32zM85.333333 160A32 32 0 0 1 117.333333 128h42.666667A138.666667 138.666667 0 0 1 298.666667 266.666667v490.666666A138.666667 138.666667 0 0 1 160 896h-42.666667a32 32 0 0 1 0-64h42.666667a74.666667 74.666667 0 0 0 74.666667-74.666667V661.333333H117.333333a32 32 0 0 1 0-64H234.666667v-170.666666H117.333333a32 32 0 0 1 0-64H234.666667V266.666667A74.666667 74.666667 0 0 0 160 192h-42.666667A32 32 0 0 1 85.333333 160zM466.773333 512l-62.72 62.72a32 32 0 1 0 45.226667 45.226667L512 557.226667l62.72 62.72a32 32 0 1 0 45.226667-45.226667L557.226667 512l62.72-62.72a32 32 0 1 0-45.226667-45.226667L512 466.773333l-62.72-62.72a32 32 0 1 0-45.226667 45.226667L466.773333 512z"/><path d="M480 372.352c1.109333 0.981333 2.176 2.005333 3.242667 3.072l28.757333 28.757333 28.757333-28.757333c1.066667-1.066667 2.133333-2.090667 3.242667-3.072V117.333333a32 32 0 0 0-64 0v255.018667zM480 662.314667v244.352a32 32 0 0 0 64 0v-244.352a77.909333 77.909333 0 0 1-3.242667-3.072L512 630.485333l-28.757333 28.757334-3.242667 3.072z"/></svg>',Nd='<svg viewBox="0 0 1024 1024" width="14" height="14" fill="currentColor" aria-hidden="true"><path d="M128 266.666667A138.666667 138.666667 0 0 1 266.666667 128h490.666666A138.666667 138.666667 0 0 1 896 266.666667v246.272a276.096 276.096 0 0 0-64-30.250667V426.666667h-170.666667v56.021333a276.096 276.096 0 0 0-64 30.250667V426.666667h-170.666666v170.666666h86.272a276.096 276.096 0 0 0-30.250667 64H426.666667v170.666667h56.021333c7.381333 22.784 17.578667 44.245333 30.250667 64H266.666667A138.666667 138.666667 0 0 1 128 757.333333V266.666667zM266.666667 192A74.666667 74.666667 0 0 0 192 266.666667V362.666667h170.666667v-170.666667H266.666667zM192 426.666667v170.666666h170.666667v-170.666666h-170.666667z m469.333333-64h170.666667V266.666667a74.666667 74.666667 0 0 0-74.666667-74.666667H661.333333v170.666667z m-64-170.666667h-170.666666v170.666667h170.666666v-170.666667z m-405.333333 469.333333v96c0 41.216 33.450667 74.666667 74.666667 74.666667H362.666667v-170.666667h-170.666667z"/><path d="M981.333333 746.666667a234.666667 234.666667 0 1 1-469.333333 0 234.666667 234.666667 0 0 1 469.333333 0z m-234.666666-30.165334l-70.229334-70.272a21.333333 21.333333 0 0 0-30.208 30.208l70.272 70.229334-70.272 70.229333a21.333333 21.333333 0 0 0 30.208 30.208l70.229334-70.272 70.229333 70.272a21.333333 21.333333 0 0 0 30.208-30.208L776.832 746.666667l70.272-70.229334a21.333333 21.333333 0 0 0-30.208-30.208L746.666667 716.501333z"/></svg>',_7={indent:Rn.indent,rows:{default:3,validate:t=>typeof t=="number"&&Number.isInteger(t)&&t>=1},cols:{default:3,validate:t=>typeof t=="number"&&Number.isInteger(t)&&t>=1},cells:{default:[],validate:I3},colWidths:{default:[],validate:t=>Array.isArray(t)},headerRow:{default:!1,validate:t=>typeof t=="boolean"}},R7=i.defineComponent({name:"TableBlock",props:{block:{type:Object,required:!0},placeholder:{type:String,default:void 0}},setup(t,{expose:e}){t.placeholder;const n=Yn(),r=Rr(),o=In(),l=t.block.id,a=i.inject(zl,null);let s="__none__";function c(C){if(!C)return"null";const S=C.selectionRect,R=C.tableActiveMarks?[...C.tableActiveMarks].sort().join(","):"";return[C.visible?"v":"-",C.cellEditMode?"c":C.tableMode?"t":"-",String(C.blockId??""),String(C.blockType??""),C.showDelete?"D":"-",C.showMerge?"M":"-",C.showSplit?"S":"-",C.showHeaderRow?"H":"-",C.headerRowActive?"h":"-",C.tableActiveColor??"",C.tableActiveBgColor??"",C.tableActiveVerticalAlign??"",R,S?`${S.left.toFixed(1)},${S.top.toFixed(1)},${S.width.toFixed(1)},${S.height.toFixed(1)}`:"",C.blockAttrs?JSON.stringify(C.blockAttrs):""].join("|")}function u(C){if(!a)return;const S=c(C);S!==s&&(s=S,a.value=C)}function d(C){a&&i.nextTick(()=>{u(C)})}const f=i.computed(()=>go(t.block.attrs)),p=new Map,b=i.ref(null),g=i.ref(null),k=i.ref(null);let E=0;const M=500;function O(){return Date.now()-E<M}function P(C){var q;const S=C.target;!!(S&&(S.nodeType===1?S.closest(".hover-toolbar"):(q=S.parentElement)!=null&&q.closest(".hover-toolbar")))&&(E=Date.now())}function te(){E=Date.now()}const z=i.ref(null);let H=0,ie=0;const Q=i.ref({kind:"none"}),ne=i.ref(null);let _=!1;const $=i.ref(null);let D=null,W=null,K=!1,B=!1;const A=i.reactive({blockType:"paragraph",blockAttrs:{align:"left"},marks:new Set,textColor:"",bgColor:"",verticalAlign:"middle",showDelete:!1,deleteLabel:"",deleteIcon:Nd,showMerge:!1,showSplit:!1,showHeaderRow:!1,headerRowActive:!1}),j=i.ref(null),F=i.reactive({visible:!1,selectionRect:null}),V=i.reactive({visible:!1,anchorRect:null,href:"",text:"",initialMode:"edit",showTextInput:!1});let fe=null,Ee=null,Me=!1;const ae=i.reactive({visible:!1,row:-1,col:-1,anchor:null,canContinue:!1,canStartNew:!1,currentNumber:1});function Te(){ae.visible=!1,ae.anchor=null,ae.row=-1,ae.col=-1}const He=i.reactive({visible:!1,row:-1,col:-1,anchor:null,initialValue:1});function xe(){He.visible=!1,He.anchor=null,He.row=-1,He.col=-1}function tt(C,S,R){var Ae,_e;if(!r.value)return;const q=(Ae=f.value.cells[C])==null?void 0:Ae[S];if(!q||q.covered||q.cellType!=="orderedList")return;const ee=Kl(f.value,C,S),oe=typeof q.startNumber=="number";let he=!1;for(let Ne=C-1;Ne>=0;Ne--){const st=(_e=f.value.cells[Ne])==null?void 0:_e[S];if(!(!st||st.covered)){he=st.cellType==="orderedList";break}}const ge=oe&&he,Le=ee!==1;ct(),F.visible=!1,F.selectionRect=null,xe(),ae.visible=!0,ae.row=C,ae.col=S,ae.anchor=R,ae.canContinue=ge,ae.canStartNew=Le,ae.currentNumber=ee}function Vt(){var S,R;if(ae.row<0||ae.col<0)return;const C=di(f.value,ae.row,ae.col,{startNumber:null});(R=(S=n.commands).setAttrs)==null||R.call(S,{id:l,attrs:C}),Te()}function on(){var S,R;if(ae.row<0||ae.col<0)return;const C=di(f.value,ae.row,ae.col,{startNumber:1});(R=(S=n.commands).setAttrs)==null||R.call(S,{id:l,attrs:C}),Te()}function gn(){if(ae.row<0||ae.col<0)return;const C=ae.anchor,S=ae.row,R=ae.col,q=ae.currentNumber;Te(),C&&(He.visible=!0,He.initialValue=q,He.anchor=C,He.row=S,He.col=R)}function Gt(C){var R,q;if(He.row<0||He.col<0){xe();return}const S=di(f.value,He.row,He.col,{startNumber:C});(q=(R=n.commands).setAttrs)==null||q.call(R,{id:l,attrs:S}),xe()}function ct(){if(!V.visible)return;if(V.visible=!1,fe=null,Ee=null,F.visible=!1,F.selectionRect=null,Me){Me=!1;return}const C=k.value;if(C){const S=p.get(`${C.row}-${C.col}`);S&&re(C.row,C.col,S),k.value=null}}function Zt(){const C=window.getSelection();if(!C||C.rangeCount===0)return null;const R=C.getRangeAt(0).commonAncestorContainer,q=R.nodeType===1?R:R.parentElement;return q?q.closest("a"):null}function ln(){const C=window.getSelection();if(!C||C.rangeCount===0)return;const S=C.getRangeAt(0),R=S.getBoundingClientRect();if(R.width===0&&R.height===0)return;fe=S.cloneRange();const q=Zt(),ee=(q==null?void 0:q.getAttribute("href"))??"",oe=C.toString();V.anchorRect=R,V.href=ee,V.text=oe,V.initialMode=ee?"view":"edit",V.showTextInput=!oe&&!ee,V.visible=!0,F.visible=!1}function St(C){const S=C.getAttribute("href")||"",R=C.textContent||"",q=C.getBoundingClientRect();V.anchorRect=q,V.href=S,V.text=R,V.initialMode="view",V.showTextInput=!1,V.visible=!0,Me=!0,Ee=C,F.visible=!1,F.selectionRect=null}function Ke(C){const S=C.closest(".table-cell-inner");if(!S)return;const R=S.closest(".table-cell");if(!R)return;const q=Number(R.getAttribute("data-row")),ee=Number(R.getAttribute("data-col"));!Number.isFinite(q)||!Number.isFinite(ee)||re(q,ee,S)}function yt(C,S){if(Ee&&Ee.isConnected){Ee.setAttribute("href",C),Ee.setAttribute("target","_blank"),Ee.setAttribute("rel","noopener noreferrer"),S!==void 0&&S!==Ee.textContent&&(Ee.textContent=S),Ke(Ee);return}const R=window.getSelection();if(!R)return;if(fe){const ee=k.value,oe=ee?p.get(`${ee.row}-${ee.col}`):null;oe&&oe.isConnected&&(R.removeAllRanges(),R.addRange(fe))}const q=Zt();if(q)q.setAttribute("href",C),q.setAttribute("target","_blank"),q.setAttribute("rel","noopener noreferrer"),S!==void 0&&S!==q.textContent&&(q.textContent=S);else{if(R.rangeCount===0)return;const ee=R.getRangeAt(0),oe=document.createElement("a");oe.setAttribute("href",C),oe.setAttribute("target","_blank"),oe.setAttribute("rel","noopener noreferrer");try{oe.appendChild(ee.extractContents()),ee.insertNode(oe),R.removeAllRanges();const he=document.createRange();he.selectNodeContents(oe),R.addRange(he),fe=he.cloneRange()}catch{}}Ut()}function Pe(){if(Ee&&Ee.isConnected){const q=Ee,ee=q.parentElement;if(ee){for(;q.firstChild;)ee.insertBefore(q.firstChild,q);ee.removeChild(q)}Ke(q);return}const C=window.getSelection();if(!C)return;if(fe){const q=k.value,ee=q?p.get(`${q.row}-${q.col}`):null;ee&&ee.isConnected&&(C.removeAllRanges(),C.addRange(fe))}const S=Zt();if(!S)return;const R=S.parentElement;if(R){for(;S.firstChild;)R.insertBefore(S.firstChild,S);R.removeChild(S);try{C.removeAllRanges(),fe&&fe.startContainer!==S&&C.addRange(fe)}catch{}Ut()}}function Ut(){const C=k.value;if(!C)return;const S=p.get(`${C.row}-${C.col}`);S&&re(C.row,C.col,S)}let Fe=!1;function qe(){var oe,he;if(!r.value){F.visible=!1,F.selectionRect=null;return}if(F.visible&&O())return;if(!k.value){const ge=window.getSelection();if(!ge||ge.rangeCount===0||ge.isCollapsed){F.visible=!1,F.selectionRect=null;return}const Le=ge.getRangeAt(0);if(!((oe=Le.commonAncestorContainer.nodeType===1?Le.commonAncestorContainer:Le.commonAncestorContainer.parentElement)==null?void 0:oe.closest(".table-cell-inner"))){F.visible=!1,F.selectionRect=null;return}return}const S=window.getSelection();if(!S||S.rangeCount===0||S.isCollapsed){F.visible=!1,F.selectionRect=null;return}const R=S.getRangeAt(0);if(!((he=R.commonAncestorContainer.nodeType===1?R.commonAncestorContainer:R.commonAncestorContainer.parentElement)==null?void 0:he.closest(".table-cell-inner"))){F.visible=!1,F.selectionRect=null;return}const ee=R.getBoundingClientRect();if(ee.width===0&&ee.height===0){F.visible=!1,F.selectionRect=null;return}Fe||(F.visible=!0,F.selectionRect=ee,D&&(clearTimeout(D),D=null),$.value=null)}function jt(){Fe&&(Fe=!1,qe())}function gt(C){const S=_t.value;if(!S)return C;const R=S.getBoundingClientRect();return new DOMRect(R.left+C.left-S.scrollLeft,R.top+C.top,C.width,C.height)}function Qt(C){r.value&&(D&&(clearTimeout(D),D=null),W&&(clearTimeout(W),W=null),F.visible=!1,F.selectionRect=null,K=!1,$.value=gt(C))}function at(C=150){W&&(clearTimeout(W),W=null),K=!1,D=setTimeout(()=>{$.value=null,D=null},C)}function be(){const C=j.value;C&&C.focus()}function Y(C){var R,q;const S=C.target;if(S.closest("a")&&S.closest(".table-cell-inner")){C.preventDefault();return}S.closest(".table-cell, .table-wrapper, table, .table-row-strip, .table-col-strip, .table-insert-dot, .table-corner-handle")||(C.stopPropagation(),Q.value={kind:"none"},g.value=null,at(0),(q=(R=n.commands).selectBlock)==null||q.call(R,{id:l}))}function L(C,S){if(C.length!==S.length)return!1;for(let R=0;R<C.length;R++){const q=C[R],ee=S[R];if(q.type!==ee.type||"text"in q&&q.text!==ee.text)return!1;const oe=q.marks??[],he=ee.marks??[];if(oe.length!==he.length)return!1;for(let ge=0;ge<oe.length;ge++){const Le=oe[ge],Ae=he[ge];if(Le.type!==Ae.type)return!1;const _e=Le.attrs??{},Ne=Ae.attrs??{},st=Object.keys(_e),pt=Object.keys(Ne);if(st.length!==pt.length)return!1;for(const Lt of st)if(_e[Lt]!==Ne[Lt])return!1}}return!0}function re(C,S,R){var Le,Ae,_e;const q=Qn(R),ee=Hi(q),oe=f.value,he=(Le=oe.cells[C])==null?void 0:Le[S];if(he&&L(he.content,ee))return;const ge=ui(oe,C,S,ee);if((_e=(Ae=n.commands).setAttrs)==null||_e.call(Ae,{id:l,attrs:ge}),ee!==q){const Ne=Qr(ee);R.innerHTML!==Ne&&(R.innerHTML=Ne)}}function Je(C,S,R,q){var oe,he,ge;if(F.visible&&O())return;const ee=q==null?void 0:q.relatedTarget;if(!(ee!=null&&ee.closest(".link-popover"))&&!(ee!=null&&ee.closest(".hover-toolbar"))){if(F.visible){const Le=window.getSelection();if(Le&&Le.rangeCount>0&&!Le.isCollapsed){const Ae=Le.getRangeAt(0);if((oe=Ae.commonAncestorContainer.nodeType===1?Ae.commonAncestorContainer:Ae.commonAncestorContainer.parentElement)==null?void 0:oe.closest(".table-cell-inner"))return}}((he=k.value)==null?void 0:he.row)===C&&((ge=k.value)==null?void 0:ge.col)===S&&(k.value=null),F.visible=!1,F.selectionRect=null,ct(),re(C,S,R)}}function Ve(C){var q;if(F.visible&&O()){g.value&&(g.value=null),Q.value.kind!=="none"&&(Q.value={kind:"none"},at(0)),Te(),xe();return}const S=C.currentTarget,R=C.relatedTarget;if(!(R&&S.contains(R))&&!(R!=null&&R.closest(".link-popover"))&&!(R!=null&&R.closest(".hover-toolbar"))){if(F.visible){const ee=window.getSelection();if(ee&&ee.rangeCount>0&&!ee.isCollapsed){const oe=ee.getRangeAt(0);if((q=oe.commonAncestorContainer.nodeType===1?oe.commonAncestorContainer:oe.commonAncestorContainer.parentElement)==null?void 0:q.closest(".table-cell-inner")){g.value&&(g.value=null),Q.value.kind!=="none"&&(Q.value={kind:"none"},at(0)),Te(),xe();return}}}g.value&&(g.value=null),Q.value.kind!=="none"&&(Q.value={kind:"none"},at(0)),k.value&&(k.value=null),ct(),Te(),xe()}}function tn(C,S,R,q){var ee,oe,he,ge,Le,Ae,_e,Ne,st,pt,Lt,bn,Sn;if(q.key==="Enter"&&!q.shiftKey&&!q.ctrlKey&&!q.metaKey){const fn=(ee=f.value.cells[C])==null?void 0:ee[S];if((fn==null?void 0:fn.cellType)==="codeBlock"){q.preventDefault(),q.stopPropagation();const ot=window.getSelection();let Ft=((oe=R.textContent)==null?void 0:oe.length)??0;if(ot&&ot.rangeCount>0){const it=ot.getRangeAt(0);if(R.contains(it.startContainer)){const Wt=document.createRange();Wt.selectNodeContents(R);try{Wt.setEnd(it.startContainer,it.startOffset),Ft=Wt.toString().length}catch{Ft=((he=R.textContent)==null?void 0:he.length)??0}}}if(ot&&ot.rangeCount>0){const it=ot.getRangeAt(0);if(R.contains(it.commonAncestorContainer)){it.collapsed||it.deleteContents();const Wt=document.createTextNode(`
|
|
280
|
-
`);it.insertNode(Wt),it.setStartAfter(Wt),it.collapse(!0),ot.removeAllRanges(),ot.addRange(it)}}re(C,S,R);const On=Ft+1;i.nextTick(()=>{const it=p.get(`${C}-${S}`);if(!it)return;it.focus();const Wt=window.getSelection();if(!Wt)return;const Nn=document.createRange();let Dn=0,Tn=!1;const Bn=cn=>{var Wr;if(!Tn)if(cn.nodeType===Node.TEXT_NODE){const Nr=((Wr=cn.textContent)==null?void 0:Wr.length)??0;Dn+Nr>=On&&(Nn.setStart(cn,Math.max(0,On-Dn)),Nn.collapse(!0),Tn=!0),Dn+=Nr}else for(const Nr of cn.childNodes)Bn(Nr)};Bn(it),Tn||(Nn.selectNodeContents(it),Nn.collapse(!1)),Wt.removeAllRanges(),Wt.addRange(Nn)});return}q.preventDefault(),q.stopPropagation(),re(C,S,R),k.value=null,F.visible=!1,F.selectionRect=null,ct(),R.blur(),Q.value={kind:"cell",rect:{r1:C,c1:S,r2:C,c2:S}},g.value={anchor:{row:C,col:S},focus:{row:C,col:S}},be(),i.nextTick(()=>{const ot=Xe(C,S,C,S);ot&&Qt(ot)});return}if(q.key==="Tab"){q.preventDefault(),q.stopPropagation(),ct();const fn=L7(f.value,C,S,q.shiftKey);if(!fn){if(O7(f.value,C,S)&&!q.shiftKey){const Tn=Qn(R),Bn=f.value,cn=ui(Bn,C,S,Tn),Wr=E0(cn,cn.rows);(Le=(ge=n.commands).setAttrs)==null||Le.call(ge,{id:l,attrs:Wr}),i.nextTick(()=>{const Nr=`${Wr.rows-1}-0`,un=p.get(Nr);un==null||un.focus(),ys(un)});return}return}const{r:ot,c:Ft}=fn,On=Qn(R),it=f.value,Wt=(Ae=it.cells[C])==null?void 0:Ae[S];let Nn=it;Wt&&(L(Wt.content,On)||(Nn=ui(it,C,S,On))),Nn!==it&&((Ne=(_e=n.commands).setAttrs)==null||Ne.call(_e,{id:l,attrs:Nn})),i.nextTick(()=>{const Dn=`${ot}-${Ft}`,Tn=p.get(Dn);Tn==null||Tn.focus(),q.shiftKey?Bd(Tn):ys(Tn)});return}if(q.key==="Backspace"){const fn=(st=f.value.cells[C])==null?void 0:st[S],ot=fn==null?void 0:fn.cellType;if(ot&&ot!=="paragraph"){const Ft=window.getSelection();let On=((pt=R.textContent)==null?void 0:pt.length)??0;if(Ft&&Ft.rangeCount>0){const it=Ft.getRangeAt(0);if(R.contains(it.startContainer)){const Wt=document.createRange();Wt.selectNodeContents(R);try{Wt.setEnd(it.startContainer,it.startOffset),On=Wt.toString().length}catch{On=((Lt=R.textContent)==null?void 0:Lt.length)??0}}}if(On===0&&(!R.textContent||R.textContent.trim()===""||(ot==="bulletList"||ot==="orderedList"||ot==="todoList"))){q.preventDefault(),q.stopPropagation(),ct(),Te(),xe();const Nn=Qn(R),Dn=f.value,Tn=ui(Dn,C,S,Nn),Bn=di(Tn,C,S,{cellType:"paragraph"});(Sn=(bn=n.commands).setAttrs)==null||Sn.call(bn,{id:l,attrs:Bn}),i.nextTick(()=>{const cn=p.get(`${C}-${S}`);cn&&(cn.focus(),Bd(cn))});return}}}q.key==="Escape"&&(q.preventDefault(),q.stopPropagation(),re(C,S,R),k.value=null,F.visible=!1,F.selectionRect=null,ct(),R.blur())}function Mn(C,S,R){k.value={row:C,col:S},g.value&&(g.value=null),Q.value.kind!=="none"&&(Q.value={kind:"none"},at(0))}function an(C){const S=C.target;if(!S)return null;const R=S.closest(".table-cell");if(!R)return null;const q=Number(R.getAttribute("data-row")??R.dataset.row),ee=Number(R.getAttribute("data-col")??R.dataset.col);return!Number.isFinite(q)||!Number.isFinite(ee)?null:{r:q,c:ee,el:R}}function sr(C){if(!r.value)return;const S=C.target;if(!S)return;const R=S.closest(".table-cell-inner");if(!R)return;const q=R.closest(".table-cell");if(!q)return;const ee=Number(q.getAttribute("data-row")),oe=Number(q.getAttribute("data-col"));!Number.isFinite(ee)||!Number.isFinite(oe)||tn(ee,oe,R,C)}function ut(C){var Ae,_e;const S=C.target;if(S.closest(".table-row-strip, .table-col-strip, .table-insert-dot, .table-corner-handle, .table-col-resizer")||S.tagName==="INPUT"&&S.classList.contains("table-cell-todo-checkbox")||S.classList.contains("table-cell-ol-marker"))return;const R=S.closest("a");if(R&&R.closest(".table-cell-inner")){C.preventDefault(),C.stopPropagation(),St(R);return}V.visible&&ct();const q=an(C);if(!q||C.button!==0)return;const ee=k.value;if(ee&&ee.row===q.r&&ee.col===q.c){Fe=!0,document.addEventListener("mouseup",jt,{once:!0,capture:!0});return}C.preventDefault(),C.stopPropagation();const{r:oe,c:he}=q,ge=document.activeElement;ge&&ge.closest(".table-cell-inner")&&ge.blur(),k.value=null,(_e=(Ae=n.commands).selectBlock)==null||_e.call(Ae,{id:l}),be(),B=$.value!==null,B&&(K=!0,D&&(clearTimeout(D),D=null),W&&(clearTimeout(W),W=null)),Q.value={kind:"none"},_=!0;const Le={row:oe,col:he};ne.value={start:Le,current:Le},g.value={anchor:Le,focus:Le},document.addEventListener("mouseup",Vn,!0)}function cr(C){if(!_||!ne.value)return;const S=an(C);if(!S)return;const{r:R,c:q}=S,ee=ne.value.current;if(R===ee.row&&q===ee.col)return;ne.value={...ne.value,current:{row:R,col:q}};const oe=ne.value.start;g.value={anchor:oe,focus:{row:R,col:q}}}function Cn(C){if(!r.value)return;const S=C.target;if(S.tagName==="INPUT"&&S.classList.contains("table-cell-todo-checkbox")||S.classList.contains("table-cell-ol-marker"))return;const R=an(C);if(!R)return;const{r:q,c:ee}=R,oe=k.value;oe&&oe.row===q&&oe.col===ee||(C.preventDefault(),C.stopPropagation(),W&&(clearTimeout(W),W=null),K=!1,_=!1,ne.value=null,g.value=null,Q.value={kind:"none"},at(0),document.removeEventListener("mouseup",Vn,!0),k.value={row:q,col:ee},i.nextTick(()=>{const he=`${q}-${ee}`,ge=p.get(he);ge&&(ge.focus(),ys(ge))}))}function Vn(C){if(_&&ne.value){const S=ne.value.start,R=ne.value.current,q=Math.min(S.row,R.row),ee=Math.min(S.col,R.col),oe=Math.max(S.row,R.row),he=Math.max(S.col,R.col),ge=Or(f.value,q,ee,oe,he),{r1:Le,c1:Ae,r2:_e,c2:Ne}=ge;if(Q.value={kind:"cell",rect:{r1:Le,c1:Ae,r2:_e,c2:Ne}},g.value={anchor:{row:Le,col:Ae},focus:{row:_e,col:Ne}},Le!==_e||Ae!==Ne)i.nextTick(()=>{const pt=Xe(Le,Ae,_e,Ne);pt&&Qt(pt)});else if(B){const pt=Xe(Le,Ae,_e,Ne);pt&&Qt(pt)}else W&&clearTimeout(W),W=setTimeout(()=>{W=null;const pt=Xe(Le,Ae,_e,Ne);pt&&Qt(pt)},250)}_=!1,ne.value=null,document.removeEventListener("mouseup",Vn,!0)}function ht(C){if(Q.value.kind==="row"&&Q.value.row===C){Q.value={kind:"none"},g.value=null,at(0);return}$.value!==null&&(K=!0);const S=f.value,R=S.cols,q=C,ee=0,oe=C,he=Math.max(0,R-1),ge=R>0?Or(S,q,ee,oe,he):{r1:q,c1:ee,r2:oe,c2:he};Q.value={kind:"row",row:C},g.value=R>0?{anchor:{row:ge.r1,col:ge.c1},focus:{row:ge.r2,col:ge.c2}}:null,k.value=null;const Le=document.activeElement;Le&&Le.closest(".table-cell-inner")&&Le.blur(),be(),i.nextTick(()=>{const Ae=Rt.value,_e=Ae.rowTops[ge.r1]??0,Ne=Ae.rowTops[ge.r2]??0,st=Ae.rowHeights[ge.r2]??32,pt=Ne+st-_e,Lt=Ae.colWidths.length>0?Ae.colWidths.reduce((fn,ot)=>fn+ot,0):S.colWidths.reduce((fn,ot)=>fn+ot,0),bn=Ae.colLefts[0]??0,Sn=new DOMRect(bn,_e,Lt,pt);Qt(Sn)})}function xt(C){if(Q.value.kind==="col"&&Q.value.col===C){Q.value={kind:"none"},g.value=null,at(0);return}$.value!==null&&(K=!0);const S=f.value,R=S.rows,q=0,ee=C,oe=Math.max(0,R-1),he=C,ge=R>0?Or(S,q,ee,oe,he):{r1:q,c1:ee,r2:oe,c2:he};Q.value={kind:"col",col:C},g.value=R>0?{anchor:{row:ge.r1,col:ge.c1},focus:{row:ge.r2,col:ge.c2}}:null,k.value=null;const Le=document.activeElement;Le&&Le.closest(".table-cell-inner")&&Le.blur(),be(),i.nextTick(()=>{const Ae=Rt.value,_e=Ae.colLefts[ge.c1]??0,Ne=Ae.colLefts[ge.c2]??0,st=Ae.colWidths[ge.c2]??80,pt=Ne+st-_e,Lt=Ae.rowTops[0]??0,bn=R>0?(Ae.rowTops[R-1]??0)+(Ae.rowHeights[R-1]??32)-Lt:32,Sn=new DOMRect(_e,Lt,pt,bn);Qt(Sn)})}function Ye(){if(Q.value.kind==="all"){Q.value={kind:"none"},g.value=null,at(0);return}$.value!==null&&(K=!0);const C=f.value;if(C.rows===0||C.cols===0)return;Q.value={kind:"all"};const S=Or(C,0,0,C.rows-1,C.cols-1);g.value={anchor:{row:S.r1,col:S.c1},focus:{row:S.r2,col:S.c2}},k.value=null;const R=document.activeElement;R&&R.closest(".table-cell-inner")&&R.blur(),be(),i.nextTick(()=>{const q=Rt.value,ee=q.rowTops[0]??0,oe=q.colLefts[0]??0,he=q.colWidths.length>0?q.colWidths.reduce((_e,Ne)=>_e+Ne,0):C.colWidths.reduce((_e,Ne)=>_e+Ne,0),ge=q.rowTops[C.rows-1]??0,Le=q.rowHeights[C.rows-1]??32,Ae=new DOMRect(oe,ee,he,ge+Le-ee);Qt(Ae)})}function Xe(C,S,R,q){const ee=Rt.value,oe=ee.rowTops[C]??0,he=ee.rowTops[R]??0,ge=ee.rowHeights[R]??32,Le=he+ge,Ae=ee.colLefts[S]??0,_e=ee.colLefts[q]??0,Ne=ee.colWidths[q]??80,st=_e+Ne;return new DOMRect(Ae,oe,st-Ae,Le-oe)}i.onBeforeUnmount(()=>{document.removeEventListener("mouseup",Vn,!0),document.removeEventListener("mouseup",jt,!0),document.removeEventListener("mousemove",ur,!0),document.removeEventListener("mouseup",Un,!0),document.removeEventListener("keydown",mt,!0),document.removeEventListener("selectionchange",qe),document.removeEventListener("mousedown",sn,!0),window.removeEventListener("scroll",Tt,!0),document.removeEventListener("touchmove",Tt,!0),document.removeEventListener("mousedown",P,!0),document.removeEventListener("mouseup",te,!0),W&&(clearTimeout(W),W=null)});function mt(C){var ee,oe;if(!r.value)return;const S=Q.value;if(S.kind==="none")return;const R=document.activeElement;if(R!=null&&R.closest(".table-cell-inner"))return;if(C.key==="Escape"){C.preventDefault(),C.stopPropagation(),Q.value={kind:"none"},g.value=null,at(0);return}if(C.key==="Delete"||C.key==="Backspace"){if(C.preventDefault(),C.stopPropagation(),S.kind==="row")ze("tableRemoveRow",{row:S.row});else if(S.kind==="col")ze("tableRemoveCol",{col:S.col});else if(S.kind==="all")ze("tableDelete");else if(S.kind==="cell"){const{r1:he,c1:ge,r2:Le,c2:Ae}=S.rect,_e=[];let Ne=f.value;for(let st=he;st<=Le;st++)for(let pt=ge;pt<=Ae;pt++)Ne=ui(Ne,st,pt,_e);(oe=(ee=n.commands).setAttrs)==null||oe.call(ee,{id:l,attrs:Ne})}}}function sn(C){if(!V.visible&&!ae.visible&&!He.visible)return;const S=C.target;S.closest(".link-popover")||S.closest(".ordered-list-menu")||S.closest(".number-picker")||j.value&&j.value.contains(S)||(V.visible&&ct(),ae.visible&&Te(),He.visible&&xe())}function Tt(){if(V.visible&&ct(),ae.visible&&Te(),He.visible&&xe(),$.value!==null&&g.value){const C=Ti(g.value);if(C){const S=Or(f.value,C.r1,C.c1,C.r2,C.c2),R=Xe(S.r1,S.c1,S.r2,S.c2);R&&($.value=gt(R))}}}i.onMounted(()=>{document.addEventListener("keydown",mt,!0),document.addEventListener("selectionchange",qe),document.addEventListener("mousedown",sn,!0),document.addEventListener("mousedown",P,!0),document.addEventListener("mouseup",te,!0),window.addEventListener("scroll",Tt,!0),document.addEventListener("touchmove",Tt,{passive:!0,capture:!0})});const _t=i.ref(null),Rt=i.ref({rowTops:[],rowHeights:[],colLefts:[],colWidths:[],wrapperOffsetLeft:0,wrapperOffsetTop:0,tableTotalWidth:0,tableTotalHeight:0});function An(){const C=b.value,S=_t.value,R=j.value;if(!C||!S||!R)return;const q=f.value.rows,ee=f.value.cols,oe=S.getBoundingClientRect(),he=R.getBoundingClientRect(),ge=Math.round(oe.left-he.left),Le=Math.round(oe.top-he.top),Ae=Array.from(C.querySelectorAll("tr")),_e=[],Ne=[];for(const ot of Ae){const Ft=ot.getBoundingClientRect();_e.push(Math.round(Ft.top-oe.top)),Ne.push(Math.round(Ft.height))}for(;_e.length<q;){const ot=_e.length>0?_e[_e.length-1]+Ne[Ne.length-1]:0;_e.push(ot),Ne.push(Ne.length>0?Ne[Ne.length-1]:32)}const st=S.scrollLeft,pt=[],Lt=[],bn=Array.from(C.querySelectorAll("colgroup > col"));if(bn.length>0)for(const ot of bn){const Ft=ot.getBoundingClientRect();pt.push(Math.round(Ft.left-oe.left+st)),Lt.push(Math.round(Ft.width))}for(;pt.length<ee;){const ot=pt.length>0?pt[pt.length-1]+Lt[Lt.length-1]:0;pt.push(ot),Lt.push(Lt.length>0?Lt[Lt.length-1]:80)}const Sn=Lt.reduce((ot,Ft)=>ot+Ft,0),fn=Ne.reduce((ot,Ft)=>ot+Ft,0);Rt.value={rowTops:_e,rowHeights:Ne,colLefts:pt,colWidths:Lt,wrapperOffsetLeft:ge,wrapperOffsetTop:Le,tableTotalWidth:Sn,tableTotalHeight:fn},x()}i.watchEffect(()=>{var C,S;f.value.rows,f.value.cols,f.value.headerRow,(C=k.value)==null||C.row,(S=k.value)==null||S.col,i.nextTick(()=>{z.value===null&&An()})});let xn=null;i.onMounted(()=>{var S;xn=new ResizeObserver(()=>{z.value===null&&(An(),x())}),_t.value&&xn.observe(_t.value),b.value&&xn.observe(b.value);const C=(S=j.value)==null?void 0:S.closest(".block-editor");C&&xn.observe(C),_t.value&&_t.value.addEventListener("scroll",Z,{passive:!0}),x()}),i.onBeforeUnmount(()=>{var C;xn==null||xn.disconnect(),_t.value&&_t.value.removeEventListener("scroll",Z),qn&&cancelAnimationFrame(qn),U&&clearTimeout(U),a&&((C=a.value)==null?void 0:C.blockId)===l&&(a.value=null)});function co(C,S){if(!r.value)return;S.preventDefault(),S.stopPropagation(),z.value=C,ie=Rt.value.colWidths[C]??80,H=S.clientX,document.addEventListener("mousemove",ur,!0),document.addEventListener("mouseup",Un,!0),document.body.style.cursor="col-resize",document.body.style.userSelect="none"}function ur(C){var oe,he;if(z.value===null)return;const S=C.clientX-H;let R=Math.max(40,Math.round(ie+S));const q=_t.value;if(q){const ge=q.clientWidth-4,Le=f.value.colWidths.reduce((_e,Ne,st)=>st===z.value?_e:_e+Ne,0);if(Le+R<=ge){const _e=Math.max(40,ge-Le);R=Math.min(R,_e)}}const ee=T0(f.value,z.value,R);(he=(oe=n.commands).setAttrs)==null||he.call(oe,{id:l,attrs:ee})}function Un(){z.value=null,document.removeEventListener("mousemove",ur,!0),document.removeEventListener("mouseup",Un,!0),document.body.style.cursor="",document.body.style.userSelect="",i.nextTick(()=>{An(),x()})}const or=i.ref(0),Mr=i.ref(0),Zn=i.ref(0),Ar=i.ref(!1);let qn=0,U;function x(){const C=_t.value;C&&(or.value=C.scrollLeft,Mr.value=C.clientWidth,Zn.value=C.scrollWidth)}function Z(){Ar.value||(Ar.value=!0),qn&&cancelAnimationFrame(qn),qn=requestAnimationFrame(()=>{qn=0,x()}),U&&clearTimeout(U),U=setTimeout(()=>{Ar.value=!1,x()},130)}const Se=i.computed(()=>{if(!r.value)return[];const C=Rt.value,S=f.value.cols,R=C.colLefts,q=C.colWidths;if(S===0||R.length<S||q.length<S)return[];const ee=or.value,oe=Mr.value,he=Zn.value;if(oe<=0)return[];const ge=ee<=0,Le=ee+oe>=he-1,Ae=he<=oe+1,_e=6,Ne=[];for(let st=0;st<=S;st++){const Lt=(st===0?R[0]??0:st===S?(R[S-1]??0)+(q[S-1]??0):R[st]??0)-ee;let bn=Lt>=-1&&Lt<=oe+1;if(st===0&&(ge||Ae)&&(bn=!0),st===S&&(Le||Ae)&&(bn=!0),!bn)continue;const Sn=Math.max(_e,Math.min(Lt,oe-_e))+(st>0?2:-2);Ne.push({c:st,left:Sn})}return Ne});function ze(C,S){var q,ee;const R={id:l,...S};(ee=(q=n.commands)[C])==null||ee.call(q,R)}function Ze(){k.value=null,g.value=null,Q.value.kind!=="none"&&(Q.value={kind:"none"}),at(0),Te(),xe()}return e({clearInnerFocus:Ze}),()=>{var fr,hr,uo,Ni,Xo,Od,Dd,zd,Hd,Pd,$d;const C=f.value,S=C.rows,R=C.cols,q=Ti(g.value),ee=q?Or(C,q.r1,q.c1,q.r2,q.c2):null,oe=Rt.value,he=Q.value,ge=[],Le=i.h("div",{class:"table-toolbar"},[i.h("div",{class:"table-toolbar-title"},[i.h(_n,{html:Cl,class:"table-toolbar-icon"}),i.h("span",o.t("table.title"))])]),Ae=[];for(let le=0;le<R;le++){const De=C.colWidths[le]??0,$e={};De&&De>0&&($e.width=`${De}px`),Ae.push(i.h("col",{"data-col":le,style:$e}))}const _e=i.h("colgroup",{},Ae),Ne=[],st=[],pt=C.headerRow?0:-1;for(let le=0;le<S;le++){const De=[];for(let $e=0;$e<R;$e++){const Re=(fr=C.cells[le])==null?void 0:fr[$e];if(!Re||Re.covered)continue;const vt=`${le}-${$e}`,vr=pt===0&&le===0,Zo=!!ee&&D7(le,$e,ee),jo=he.kind==="row"&&he.row===le,Qo=he.kind==="col"&&he.col===$e,Bi=he.kind==="all",o5=Zo||jo||Qo||Bi;let Ms=Qr(Re.content);Re.cellType==="codeBlock"&&Ms.endsWith(`
|
|
281
|
-
`)&&(
|
|
282
|
-
`);$e&&((vt=navigator.clipboard)==null||vt.writeText($e))},At={visible:!!Tn,selectionRect:Tn,blockId:l,blockType:A.blockType,blockAttrs:A.blockAttrs,rootEl:document.querySelector(".block-editor"),tableMode:!0,tableActiveMarks:A.marks,tableActiveColor:A.textColor,tableActiveBgColor:A.bgColor,tableActiveVerticalAlign:A.verticalAlign,showDelete:A.showDelete,deleteLabel:A.deleteLabel,deleteIcon:A.deleteIcon,showMerge:A.showMerge,showSplit:A.showSplit,showHeaderRow:A.showHeaderRow,headerRowActive:A.headerRowActive,onDelete:Cs,onMerge:Sl,onSplit:Kr,onTableHeaderRow:Ss,onClose:Yo,onTableType:bt,onTableAlign:lt,onTableVerticalAlign:Mt,onTableMark:Ge,onTableTextColor:nn,onTableBgColor:It,onTableCopy:Ot};a&&(At.visible?d(At):((Dd=a.value)==null?void 0:Dd.blockId)===l&&!((zd=a.value)!=null&&zd.cellEditMode)&&d(null));const wt=k.value,Ht=wt?(Hd=f.value.cells[wt.row])==null?void 0:Hd[wt.col]:void 0,Dt=Ht==null?void 0:Ht.cellType;let vn="paragraph";const rt={};Dt==="heading"||Dt==="heading1"?(vn="heading",rt.level=1):Dt==="heading2"?(vn="heading",rt.level=2):Dt==="heading3"?(vn="heading",rt.level=3):Dt==="heading4"?(vn="heading",rt.level=4):Dt==="heading5"?(vn="heading",rt.level=5):Dt==="heading6"?(vn="heading",rt.level=6):Dt==="bulletList"?vn="bulletList":Dt==="orderedList"?vn="orderedList":Dt==="todoList"?vn="todoList":Dt==="quote"?vn="quote":Dt==="codeBlock"&&(vn="codeBlock"),typeof(Ht==null?void 0:Ht.align)=="string"&&(rt.align=Ht.align),typeof(Ht==null?void 0:Ht.verticalAlign)=="string"&&(rt.verticalAlign=Ht.verticalAlign);const qt={visible:F.visible&&!!F.selectionRect,selectionRect:F.selectionRect,blockId:l,blockType:vn,blockAttrs:rt,rootEl:document.querySelector(".block-editor"),cellEditMode:!0,onClose:()=>{F.visible=!1,F.selectionRect=null},onTableType:le=>{var $e,Re;if(!wt)return;const De=po(f.value,[{row:wt.row,col:wt.col}],{cellType:le});(Re=($e=n.commands).setAttrs)==null||Re.call($e,{id:l,attrs:De})},onTableAlign:le=>{var $e,Re;if(!wt)return;const De=po(f.value,[{row:wt.row,col:wt.col}],{align:le});(Re=($e=n.commands).setAttrs)==null||Re.call($e,{id:l,attrs:De})},onTableVerticalAlign:le=>{var $e,Re;if(!wt)return;const De=po(f.value,[{row:wt.row,col:wt.col}],{verticalAlign:le});(Re=($e=n.commands).setAttrs)==null||Re.call($e,{id:l,attrs:De})},onLinkClick:()=>{ln()}};return a&&(qt.visible?d(qt):((Pd=a.value)==null?void 0:Pd.blockId)===l&&(($d=a.value)!=null&&$d.cellEditMode)&&d(null)),ge.push(i.h(rc,{visible:V.visible,anchorRect:V.anchorRect,blockId:null,from:0,to:0,href:V.href,text:V.text,initialMode:V.initialMode,showTextInput:V.showTextInput,readonly:!r.value,onSaveLink:(le,De)=>{yt(le,De),V.href=le,De!==void 0&&(V.text=De)},onRemoveLinkMark:()=>{Pe()},onClose:()=>{ct()}})),ge.push(i.h(ec,{visible:ae.visible,blockId:null,anchor:ae.anchor,rootEl:document.querySelector(".block-editor"),canContinue:ae.canContinue,canStartNew:ae.canStartNew,currentNumber:ae.currentNumber,onContinue:Vt,onStartNew:on,onModify:gn,onClose:Te})),ge.push(i.h(tc,{visible:He.visible,initialValue:He.initialValue,anchor:He.anchor,rootEl:document.querySelector(".block-editor"),onConfirm:Gt,onClose:xe})),i.h("div",{class:["block-table-container","block-focus-root",...Jn(t.block.attrs)],ref:j,tabindex:"-1",onClick:Y,onMousedown:ut,onMouseover:cr,onDblclick:Cn,onFocusout:Ve,onKeydown:sr},ge)}}});function L7(t,e,n,r){var a;const o=[];for(let s=0;s<t.rows;s++)for(let c=0;c<t.cols;c++){const u=(a=t.cells[s])==null?void 0:a[c];u&&!u.covered&&o.push({r:s,c})}const l=o.findIndex(s=>s.r===e&&s.c===n);return l===-1?null:r?l===0?null:o[l-1]??null:l===o.length-1?null:o[l+1]??null}function O7(t,e,n){var o;let r=null;for(let l=0;l<t.rows;l++)for(let a=0;a<t.cols;a++){const s=(o=t.cells[l])==null?void 0:o[a];s&&!s.covered&&(r={r:l,c:a})}return r!==null&&r.r===e&&r.c===n}function ys(t){if(!t)return;t.focus();const e=document.createRange();e.selectNodeContents(t),e.collapse(!1);const n=window.getSelection();n==null||n.removeAllRanges(),n==null||n.addRange(e)}function Bd(t){if(!t)return;t.focus();const e=document.createRange();e.selectNodeContents(t),e.collapse(!0);const n=window.getSelection();n==null||n.removeAllRanges(),n==null||n.addRange(e)}function Ti(t){if(!t)return null;const e=t.anchor,n=t.focus,r=Math.min(e.row,n.row),o=Math.max(e.row,n.row),l=Math.min(e.col,n.col),a=Math.max(e.col,n.col);return{r1:r,c1:l,r2:o,c2:a}}function D7(t,e,n){return t>=n.r1&&t<=n.r2&&e>=n.c1&&e<=n.c2}function Mi(t,e){return null}function Gr(t,e,n,r){const o=t.doc.blocks.get(e);if(!o||o.type!=="table")return!1;const l=ci(o.attrs),a=r(l),s=kt();return s.setAttrs(e,a),n==null||n(s.build()),!0}function z7(){return{name:"tableInsertRow",run:t=>(e,n)=>{const r=e.doc.blocks.get(t.id);if(!r||r.type!=="table")return!1;const o=go(r.attrs);Mi(e,t.id);const l=t.beforeRow??o.rows;return Gr(e,t.id,n,a=>E0(a,l))}}}function H7(){return{name:"tableRemoveRow",run:t=>(e,n)=>{const r=e.doc.blocks.get(t.id);if(!r||r.type!=="table")return!1;const o=go(r.attrs);Mi(e,t.id);const l=t.row??o.rows-1;return Gr(e,t.id,n,a=>w3(a,l))}}}function P7(){return{name:"tableInsertCol",run:t=>(e,n)=>{const r=e.doc.blocks.get(t.id);if(!r||r.type!=="table")return!1;const o=go(r.attrs);Mi(e,t.id);const l=t.beforeCol??o.cols;return Gr(e,t.id,n,a=>x3(a,l))}}}function $7(){return{name:"tableRemoveCol",run:t=>(e,n)=>{const r=e.doc.blocks.get(t.id);if(!r||r.type!=="table")return!1;const o=go(r.attrs);Mi(e,t.id);const l=t.col??o.cols-1;return Gr(e,t.id,n,a=>E3(a,l))}}}function F7(){return{name:"tableToggleHeaderRow",run:t=>(e,n)=>{const r=e.doc.blocks.get(t.id);return!r||r.type!=="table"?!1:Gr(e,t.id,n,M3)}}}function V7(){return{name:"tableMergeCells",run:t=>(e,n)=>{const r=e.doc.blocks.get(t.id);if(!r||r.type!=="table")return!1;const o=go(r.attrs);Mi(e,t.id);const l=t.r1??0,a=t.c1??0;let s=t.r2??0,c=t.c2??0;if(l===s&&a===c&&(s+1<o.rows&&(s=l+1),c+1<o.cols&&(c=a+1),l===s&&a===c))return!1;const u=Or(o,l,a,s,c);return u.r1===u.r2&&u.c1===u.c2?!1:Gr(e,t.id,n,d=>S3(d,u.r1,u.c1,u.r2,u.c2))}}}function U7(){return{name:"tableSplitCell",run:t=>(e,n)=>{const r=e.doc.blocks.get(t.id);return!r||r.type!=="table"?!1:Gr(e,t.id,n,o=>S0(o,t.row,t.col))}}}function q7(){return{name:"tableSplitCellsInRect",run:t=>(e,n)=>{const r=e.doc.blocks.get(t.id);if(!r||r.type!=="table")return!1;const o=go(r.attrs),l=Or(o,t.r1,t.c1,t.r2,t.c2);return x0(o,l.r1,l.c1,l.r2,l.c2)?Gr(e,t.id,n,a=>T3(a,l.r1,l.c1,l.r2,l.c2)):!1}}}function G7(){return{name:"tableSetColWidth",run:t=>(e,n)=>{const r=e.doc.blocks.get(t.id);return!r||r.type!=="table"?!1:Gr(e,t.id,n,o=>T0(o,t.col,t.width))}}}function W7(){return{name:"tableDelete",run:t=>(e,n)=>{const r=e.doc.blocks.get(t.id);if(!r||r.type!=="table")return!1;const o=kt();return o.removeBlock(t.id),n==null||n(o.build()),!0}}}function K7(){return{name:"insertTable",run:t=>(e,n)=>{const r=t.rows??3,o=t.cols??3,l=Math.max(1,Math.min(50,Number.isInteger(r)?r:3)),a=Math.max(1,Math.min(20,Number.isInteger(o)?o:3)),s=k3(l,a),u={rows:l,cols:a,cells:Dr(s,l,a),colWidths:new Array(a).fill(120),headerRow:!0};let d=null,f=e.doc.root.length,p=null;if(t.replaceCurrent){const z=e.selection,H=z.kind==="caret"?z.blockId:z.kind==="text"?z.focus.blockId:z.blockIds[0]??null;H&&(p=H)}if(p&&(e.doc.blocks.get(p)?(d=dn(e.doc,p),f=Kn(e.doc,p)):p=null),!p)if(t.after){if(!e.doc.blocks.get(t.after))return!1;d=dn(e.doc,t.after),f=Kn(e.doc,t.after)+1}else{const z=e.selection,H=z.kind==="caret"?z.blockId:z.kind==="text"?z.focus.blockId:z.blockIds[0]??null;H&&(d=dn(e.doc,H),f=Kn(e.doc,H)+1)}const b=kt();p&&b.removeBlock(p);const g=d===null?0:Ir(e.doc,d)+1,k=g>0?{...u,indent:g}:u,E=b.insertBlock({parent:d,index:f,type:"table",attrs:k,content:[]}),M=_i(e.doc,b.peek()),O=No(M.doc,E),P=_r(M.doc,E),te=O??P;return te?b.setSelection(Ct(te.id,0)):b.setSelection(Ct(E,0)),n==null||n(b.build()),!0}}}const Id={name:"table",schema:{type:"table",content:"none",nestable:!1,isolating:!0,inlineMarks:!1,attrs:{..._7},empty:t=>{var n;const e=ci(t.attrs);for(let r=0;r<e.rows;r++)for(let o=0;o<e.cols;o++){const l=(n=e.cells[r])==null?void 0:n[o];if(!(!l||l.covered)){for(const a of l.content)if(a.type==="text"&&a.text.length>0)return!1}}return!0}},renderer:{component:R7,editable:!1},commands:[z7(),H7(),P7(),$7(),F7(),V7(),U7(),q7(),G7(),W7(),K7()],slashCommands:[{id:"table-3x3",title:"slash.table3x3.title",keywords:["table","grid","spreadsheet","表格","数据表","网格"],description:"slash.table3x3.description",icon:Cl,command:"insertTable",category:"other",args:()=>({rows:3,cols:3,replaceCurrent:!0})},{id:"table-2x2",title:"slash.table2x2.title",keywords:["table","grid","表格","2行2列"],description:"slash.table2x2.description",icon:Cl,command:"insertTable",category:"other",args:()=>({rows:2,cols:2,replaceCurrent:!0})},{id:"table-4x4",title:"slash.table4x4.title",keywords:["table","grid","表格","4行4列"],description:"slash.table4x4.description",icon:Cl,command:"insertTable",category:"other",args:()=>({rows:4,cols:4,replaceCurrent:!0})}],serialize:{toHTML:t=>{if(t.type!=="table")return"";const e=ci(t.attrs);return N3(e)},toMarkdown:t=>{if(t.type!=="table")return"";const e=ci(t.attrs);return A3(e)}}},Y7=i.defineComponent({name:"DividerBlock",props:{block:{type:Object,required:!0},placeholder:{type:String,default:void 0}},setup(t){return t.placeholder,()=>i.h("div",{class:["block-divider","block-focus-root",...Jn(t.block.attrs)],"data-block-divider":!0})}}),_d={name:"divider",schema:{type:"divider",content:"none",nestable:!1,inlineMarks:!1,attrs:{indent:Rn.indent},empty:()=>!1},renderer:{component:Y7,editable:!1},slashCommands:[{id:"divider",title:"slash.divider.title",keywords:["divider","separator","hr","horizontal","line","分隔符","分割线","水平线","横线"],description:"slash.divider.description",icon:Cf,command:"convertBlock",category:"basic",args:()=>({id:"__currentBlock__",type:"divider"})}],inputRules:[{name:"divider-md-thematic-break",pattern:/^(?:-{3,}|\*{3,}|_{3,})\s*$/,command:"convertBlock",args:()=>({id:"__currentBlock__",type:"divider"})}],serialize:{toHTML:()=>"<hr/>",toMarkdown:()=>"---"},deserialize:{fromMarkdown:t=>{const e=t.trim();return/^-{3,}$/.test(e)||/^\*{3,}$/.test(e)||/^_{3,}$/.test(e)?{type:"divider"}:null}}};function X7(t){const e=[];for(const n of t.root){const r=t.blocks.get(n);if(!r||r.type!=="heading")continue;const o=Ue(r.content).trim();if(o.length===0)continue;const l=typeof r.attrs.level=="number"?r.attrs.level:1;e.push({id:n,level:Math.max(1,Math.min(6,Math.floor(l))),text:o})}return e}const Z7=i.defineComponent({name:"TableOfContentsBlock",props:{block:{type:Object,required:!0},placeholder:{type:String,default:void 0}},setup(t){t.block,t.placeholder;const e=Yn(),n=In(),r=i.ref(null),o=i.ref(0),l=i.computed(()=>(o.value,X7(e.getState().doc)));let a=null;i.onMounted(()=>{a=e.subscribe(()=>{o.value++})}),i.onBeforeUnmount(()=>{a==null||a()});function s(c){var u,d;(d=(u=e.commands).setSelection)==null||d.call(u,{selection:Ct(c,0)}),i.nextTick(()=>{var b,g;const f=(g=(b=r.value)==null?void 0:b.closest)==null?void 0:g.call(b,".block-editor"),p=f?ii(f,c):null;p==null||p.scrollIntoView({block:"center",behavior:"smooth"})})}return()=>{const c=l.value,u=[i.h("div",{class:"toc-title"},n.t("toc.title"))];if(c.length===0)u.push(i.h("div",{class:"toc-empty"},n.t("toc.empty")));else for(const d of c)u.push(i.h("button",{type:"button",class:["toc-item",`toc-level-${d.level}`],style:{paddingLeft:`${(d.level-1)*16}px`},"data-toc-target":d.id,onClick:()=>s(d.id)},d.text));return i.h("div",{ref:r,class:["block-table-of-contents","block-focus-root",...Jn(t.block.attrs)]},u)}}}),Rd={name:"tableOfContents",schema:{type:"tableOfContents",content:"none",nestable:!1,inlineMarks:!1,attrs:{indent:Rn.indent},empty:()=>!1},renderer:{component:Z7,editable:!1},slashCommands:[{id:"tableOfContents",title:"slash.tableOfContents.title",keywords:["toc","contents","table of contents","outline","目录","标题","大纲"],description:"slash.tableOfContents.description",icon:Sf,command:"convertBlock",category:"basic",args:()=>({id:"__currentBlock__",type:"tableOfContents"})}],serialize:{toHTML:()=>"",toMarkdown:()=>""}},Ld=[ic,lc,ym,gm,xm,Cm,h4,Zc,Ad,Id,_d,Rd,ac,sc],j7={class:"editor-content"},Q7={key:0,class:"cross-block-selection-overlay","aria-hidden":"true"},J7=200,e5=.25,t5=.75,n5=400,r5=i.defineComponent({__name:"BlockEditor",props:{extensions:{default:()=>Ld},modelValue:{default:()=>({blocks:[]})},editable:{type:Boolean,default:!0},placeholder:{default:""},theme:{default:"light"},locale:{default:"zh-CN"},uploadImage:{type:Function,default:void 0},width:{default:void 0},height:{default:void 0},toolbarPosition:{default:"auto"}},emits:["update:modelValue","cleanup:image-file"],setup(t,{expose:e,emit:n}){const r=t,o=r.placeholder!=="",l=n,a=i.computed(()=>H0(r.locale)),s=i.computed(()=>P0(r.theme)),c=i.ref(a.value),u=i.ref(s.value);J3(c,u),i.watch([a,s],([w,T])=>{c.value=w,u.value=T});const d=In(),f=i.computed(()=>`theme-${s.value}`),p=i.computed(()=>{const w={};return w.width=r.width!==void 0?typeof r.width=="number"?`${r.width}px`:r.width:"100%",w.height=r.height!==void 0?typeof r.height=="number"?`${r.height}px`:r.height:"100%",w});i.watch(s,w=>{if(typeof document>"u")return;const T=document.body;T.classList.toggle("theme-dark",w==="dark"),T.classList.toggle("theme-light",w==="light")},{immediate:!0});const b=i.computed(()=>o?r.placeholder??"":d.t("editor.placeholder")),g=new s0({extensions:r.extensions,initialDocument:r.modelValue,editable:r.editable}),k=i.ref(r.editable);i.provide(h0,k),i.provide(Hl,g);const E=typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)"):null,M=i.ref(!!(E!=null&&E.matches));function O(){M.value=!!(E!=null&&E.matches)}const P=i.ref(null);i.provide(f0,M),i.provide(zl,P);const te=i.computed(()=>r.toolbarPosition==="top"?"top":r.toolbarPosition==="bottom"||M.value?"bottom":"top"),z=i.computed(()=>r.toolbarPosition==="float"&&!M.value),H=i.computed(()=>{const w=P.value;return w&&w.visible?w:{visible:V.visible,selectionRect:V.selectionRect,blockId:V.blockId,blockType:V.blockType,blockAttrs:V.blockAttrs,rootEl:ut.value??null,onClose:()=>{V.visible=!1},onLinkClick:(T,X,J)=>Gt(T,X,J)}});i.provide(oi,i.computed(()=>te.value==="bottom")),i.watch(()=>r.editable,w=>{var T,X;k.value=w,g.editable=w,w||(V.visible=!1,V.selectionRect=null,V.blockId=null,V.blockType=null,V.blockAttrs={},gr(),br(),Kr(),tt(),Ne(),ge(),Ut(null,{clearNativeSelection:!0}),(X=(T=g.commands).clearSelection)==null||X.call(T))}),K3((w,T,X,J)=>{const{onProgress:se,onSuccess:ue,onError:me}=J,de=r.uploadImage;typeof de=="function"?de(w,T,X,ce=>{const Be=Number.isFinite(ce)?Math.max(0,Math.min(1,ce/100)):0;se(Be)}).then(ce=>{ue({url:ce.url,width:ce.width,height:ce.height,alt:ce.alt,title:ce.title,fileId:ce.fileId})}).catch(ce=>{X.signal.aborted||me(ce instanceof Error?ce.message:String(ce))}):Y3(T,se).then(ce=>ue({url:ce.url,width:ce.width,height:ce.height}),ce=>me(ce instanceof Error?ce.message:String(ce)))});const ie=i.ref(0),Q=$3(()=>{ie.value++}),ne=async(w,T={})=>{var ce,Be,et,je,Et,dt,bt,lt,Mt,Ge,nn,It,Ot,At,wt,Ht,Dt,vn;const{relativeToBlockId:X=null,position:J="after",convertIfEmpty:se=!0}=T;ie.value;let ue=null,me=X??null;if(!me){const rt=g.getState().selection;rt.kind==="caret"?me=rt.blockId:rt.kind==="text"&&(me=rt.anchor.blockId)}if(me||(me=_.value.doc.root[0]??null),J==="replace"&&me){const rt=g.registries.schema.get("image");rt&&((Be=(ce=g.commands).replaceBlock)==null||Be.call(ce,{id:me,type:"image",attrs:Zr(rt)}),ue=me)}if(!ue&&me&&se&&J!=="before"){const qt=g.getState().doc.blocks.get(me);if(qt&&qt.type==="paragraph"&&Ue(qt.content).length===0){const fr=g.registries.schema.get("image");fr&&((je=(et=g.commands).replaceBlock)==null||je.call(et,{id:me,type:"image",attrs:Zr(fr)}),ue=me)}}if(!ue&&me&&J==="before"){const rt=g.registries.schema.get("image");if(rt){(dt=(Et=g.commands).insertBlock)==null||dt.call(Et,{before:me,type:"image",attrs:Zr(rt)});const qt=g.getState().selection;qt.kind==="caret"?ue=qt.blockId:qt.kind==="text"&&(ue=qt.anchor.blockId)}}if(!ue&&me){const rt=g.registries.schema.get("image");if(rt){(lt=(bt=g.commands).insertBlock)==null||lt.call(bt,{after:me,type:"image",attrs:Zr(rt)});const qt=g.getState().selection;qt.kind==="caret"?ue=qt.blockId:qt.kind==="text"&&(ue=qt.anchor.blockId)}}if(!ue){const rt=g.registries.schema.get("image");if(!rt)return null;const qt=g.getState().doc,fr=qt.root[qt.root.length-1]??null;fr?(Ge=(Mt=g.commands).insertBlock)==null||Ge.call(Mt,{after:fr,type:"image",attrs:Zr(rt)}):(It=(nn=g.commands).insertBlock)==null||It.call(nn,{after:null,type:"image",attrs:Zr(rt)});const hr=g.getState().selection;hr.kind==="caret"?ue=hr.blockId:hr.kind==="text"&&(ue=hr.anchor.blockId)}if(!ue)return null;if(typeof w=="string"){const rt=w;try{const qt=await new Promise(hr=>{if(typeof document>"u")return hr({});const uo=document.createElement("img");let Ni=!1;const Xo=()=>{Ni||(Ni=!0,hr({width:uo.naturalWidth||void 0,height:uo.naturalHeight||void 0}))};uo.onload=Xo,uo.onerror=Xo,uo.src=rt,setTimeout(Xo,4e3)}),fr={src:rt,width:qt.width,height:qt.height};(At=(Ot=g.commands).setAttrs)==null||At.call(Ot,{id:ue,attrs:fr})}catch{(Ht=(wt=g.commands).setAttrs)==null||Ht.call(wt,{id:ue,attrs:{src:rt}})}return ue}const de=await X3(ue,w);if(de.ok){const rt=de.value,qt={src:rt.url,alt:rt.alt,title:rt.title,width:rt.width,height:rt.height,fileId:rt.fileId};(vn=(Dt=g.commands).setAttrs)==null||vn.call(Dt,{id:ue,attrs:qt})}return ue};i.provide(m0,ne);const _=i.shallowRef(g.getState());let $=g.getState().selection,D=!1,W=!1;const K=i.computed(()=>{const w=_.value.doc,T=[];for(const X of w.root){const J=w.blocks.get(X);J&&T.push({id:X,block:J})}return T}),B=i.reactive({visible:!1,anchorEl:null,blockId:"",query:"",mode:"slash"}),A=i.ref(null),j=i.reactive({visible:!1,anchorEl:null,blockId:null}),F=i.ref(null),V=i.reactive({visible:!1,selectionRect:null,blockId:null,blockType:null,blockAttrs:{}});let fe=!1,Ee=null;function Me(){fe=!0,Ee&&clearTimeout(Ee),Ee=setTimeout(()=>{fe=!1,Ee=null,bn({force:!0})},500)}const ae=i.reactive({visible:!1,blockId:null,anchor:null,canContinue:!1,canStartNew:!1,currentNumber:1}),Te=i.reactive({visible:!1,initialValue:1,anchor:null,blockId:null}),He=i.reactive({visible:!1,initialValue:"plain",anchor:null,blockId:null}),xe=i.reactive({visible:!1,anchorRect:null,blockId:null,from:0,to:0,href:"",text:"",initialMode:"view",showTextInput:!1});function tt(){xe.visible=!1}i.watch(()=>xe.visible,w=>{w&&(V.visible=!1)});function Vt(w,T){var se,ue;const X=g.getState().doc.blocks.get(w);if(!X)return null;let J=0;for(const me of X.content){if(me.type!=="text")continue;const de=J,ce=J+me.text.length;if(T>=de&&T<=ce){const Be=(se=me.marks)==null?void 0:se.find(et=>et.type==="link");if(Be&&typeof((ue=Be.attrs)==null?void 0:ue.href)=="string")return{from:de,to:ce,href:Be.attrs.href,text:me.text};if(T<ce)return null}J=ce}return null}function on(w,T,X){var et,je,Et;const J=g.getState().doc.blocks.get(w);if(!J)return;let se="",ue="",me=0;for(const dt of J.content){if(dt.type!=="text")continue;const bt=me,lt=me+dt.text.length;if(lt>T&&bt<X){const Mt=(et=dt.marks)==null?void 0:et.find(Ge=>Ge.type==="link");if(Mt&&typeof((je=Mt.attrs)==null?void 0:je.href)=="string"){se=Mt.attrs.href,ue=dt.text;break}}me=lt}let de=null;const ce=(Et=ut.value)==null?void 0:Et.querySelector(`[data-block-id="${w}"]`);if(ce){const dt=window.getSelection();if(dt&&dt.rangeCount>0){const bt=dt.getRangeAt(0);ce.contains(bt.commonAncestorContainer)&&(de=bt.getBoundingClientRect())}de||(de=ce.getBoundingClientRect())}const Be=T<X;Ne(),ge(),gr(),br(),Kr(),xe.blockId=w,xe.from=T,xe.to=X,xe.href=se,xe.text=ue,xe.anchorRect=de,xe.initialMode=se||!k.value?"view":"edit",xe.showTextInput=!Be&&!se,xe.visible=!0}function gn(){var T;if(!k.value)return;Vn();const w=g.getState().selection;if(w.kind==="caret"){const X=Vt(w.blockId,w.offset);if(X){xe.blockId=w.blockId,xe.from=X.from,xe.to=X.to,xe.href=X.href,xe.text=X.text;const J=(T=ut.value)==null?void 0:T.querySelector(`[data-block-id="${w.blockId}"]`),se=J==null?void 0:J.querySelector("a");xe.anchorRect=(se==null?void 0:se.getBoundingClientRect())??(J==null?void 0:J.getBoundingClientRect())??null,xe.initialMode="view",xe.showTextInput=!1,xe.visible=!0}}else w.kind==="text"&&!kn(w)&&on(w.focus.blockId,w.anchor.offset,w.focus.offset)}function Gt(w,T,X){on(w,T,X)}function ct(w,T){var ue;const X=Vt(w,T);if(!X)return;const J=(ue=ut.value)==null?void 0:ue.querySelector(`[data-block-id="${w}"]`),se=J==null?void 0:J.querySelector("a");xe.blockId=w,xe.from=X.from,xe.to=X.to,xe.href=X.href,xe.text=X.text,xe.anchorRect=(se==null?void 0:se.getBoundingClientRect())??(J==null?void 0:J.getBoundingClientRect())??null,xe.initialMode="view",xe.showTextInput=!1,xe.visible=!0}function Zt(w){Ut(w)}const ln=i.ref(null),St=i.ref(null),Ke=i.ref(null);let yt=!1,Pe=!1;function Ut(w,T={}){const{clearNativeSelection:X=!1}=T;if(X)try{const J=window.getSelection();J&&J.removeAllRanges()}catch{}St.value=w}let Fe=null,qe=0,jt=null;const gt=i.ref([]);function Qt(w){ln.value=w}function at(){const w=ut.value;if(!w){gt.value=[];return}const T=g.getState().selection;if(T.kind!=="text"||!kn(T)){gt.value=[];return}gt.value=$l(w,g.getState().doc,T)}function be(w){w.preventDefault()}function Y(w){var me,de;const T=ut.value;if(!T||!Fe)return;const X=zi(w.clientX,w.clientY,T,g.getState().doc);if(!X)return;const J=Fe.start;if(X.blockId===J.blockId){if(Fe.crossBlock){Fe.crossBlock=!1,gt.value=[],document.removeEventListener("selectstart",be,!0);const ce=window.getSelection();ce&&ce.removeAllRanges()}return}if(!Fe.crossBlock){Fe.crossBlock=!0,document.addEventListener("selectstart",be,!0);const ce=window.getSelection();ce&&ce.removeAllRanges()}const se={blockId:X.blockId,offset:X.offset},ue=_l(J,se);D=!0,(de=(me=g.commands).setSelection)==null||de.call(me,{selection:ue}),D=!1,at()}function L(w){Fe&&(jt=w,!qe&&(qe=requestAnimationFrame(()=>{qe=0,jt&&Y(jt)})))}function re(){if(!Fe)return;Fe=null,qe&&(cancelAnimationFrame(qe),qe=0),jt=null,document.removeEventListener("mousemove",L,!0),document.removeEventListener("mouseup",re,!0),document.removeEventListener("selectstart",be,!0),at();const w=g.getState().selection;w.kind==="text"&&kn(w)&&ot(w)}const Je=new Set(["image","divider","table","toc","tableOfContents","codeBlock","equation"]),Ve=new Map;let tn=g.getState().doc.blocks;{const w=g.getState().doc;for(const T of w.root){const X=w.blocks.get(T);if(!X||X.type!=="image")continue;const J=X.attrs.fileId;typeof J=="number"&&Number.isFinite(J)&&J>0&&Ve.set(J,(Ve.get(J)??0)+1)}}let Mn=!1;const an=g.subscribe(w=>{if(_.value=w.state,w.removed.size>0&&G3(w.removed),w.changed.size>0||w.removed.size>0){const se=new Map;for(const me of w.state.doc.root){const de=w.state.doc.blocks.get(me);if(!de||de.type!=="image")continue;const ce=de.attrs.fileId;typeof ce=="number"&&Number.isFinite(ce)&&ce>0&&se.set(ce,(se.get(ce)??0)+1)}const ue=new Set;for(const me of w.changed){const de=me?tn.get(me):void 0;if(de&&de.type==="image"){const ce=de.attrs.fileId;typeof ce=="number"&&Number.isFinite(ce)&&ce>0&&ue.add(ce)}}for(const me of w.removed){const de=me?tn.get(me):void 0;if(de&&de.type==="image"){const ce=de.attrs.fileId;typeof ce=="number"&&Number.isFinite(ce)&&ce>0&&ue.add(ce)}}for(const me of se.keys())ue.add(me);for(const me of ue){const de=se.get(me)??0,ce=Ve.get(me)??0;Ve.set(me,de),de===0&&ce>0&&l("cleanup:image-file",me)}tn=w.state.doc.blocks,Mn=!0,l("update:modelValue",g.toData()),Promise.resolve().then(()=>{Mn=!1})}const T=w.state.selection;let J=T.kind==="caret"?T.blockId:T.kind==="text"?T.focus.blockId:T.kind==="blocks"?T.blockIds[0]??null:null;if(St.value!==null&&J!==St.value){const se=w.state.doc.blocks.get(St.value);se&&Je.has(se.type)&&(T.kind!=="blocks"||T.blockIds.length===0)&&(J=St.value)}fe||Ut(J),!D&&T!==$&&(W?W=!1:i.nextTick(()=>{const se=ut.value;se&&v0(se,T)})),T.kind==="text"&&kn(T)?i.nextTick(()=>{at(),!Fe&&!yt&&ot(T)}):gt.value.length>0&&(gt.value=[]),$=T});function sr(w,T){if(Object.is(w,T))return!0;if(typeof w!=typeof T||w===null||T===null||typeof w!="object"||Array.isArray(w)!==Array.isArray(T))return!1;if(Array.isArray(w)){if(w.length!==T.length)return!1;for(let se=0;se<w.length;se++)if(!sr(w[se],T[se]))return!1;return!0}const X=Object.keys(w),J=Object.keys(T);if(X.length!==J.length)return!1;for(const se of X)if(!Object.prototype.hasOwnProperty.call(T,se)||!sr(w[se],T[se]))return!1;return!0}i.watch(()=>r.modelValue,w=>{if(Mn||w===void 0)return;const T=g.toData();sr(T,w)||g.setDocument(w)},{deep:!0});const ut=i.ref(null),cr=i.ref(null),Cn=()=>cr.value;function Vn(){const w=ut.value;if(!w)return;const T=p0(w,g.getState().doc);if(!T)return;const X={steps:[],selectionAfter:T,meta:{addToHistory:!1}};D=!0,g.dispatch(X),D=!1}function ht(w){var ue,me,de,ce,Be,et,je,Et,dt,bt,lt,Mt;if(B.visible&&((ue=A.value)!=null&&ue.onKeyDown(w))||j.visible&&((me=F.value)!=null&&me.onKeyDown(w)))return;if(!k.value){const Ge=w.key,nn=w.ctrlKey||w.metaKey,It=Ge.length===1&&!nn&&!w.altKey&&!w.isComposing,Ot=Ge==="Enter"||Ge==="Backspace"||Ge==="Delete",At=Ge.toLowerCase();if(It||Ot||nn&&(At==="x"||At==="v"||At==="z"||At==="y"||At==="d")){w.preventDefault();return}if(nn&&At==="a"){w.preventDefault(),(ce=(de=g.commands).selectAll)==null||ce.call(de);return}if(nn&&At==="c"){const Ht=g.getState().selection;if(Ht.kind==="text"&&kn(Ht)){const Dt=cn(Ht);if(Dt){w.preventDefault();const vn=window.ClipboardItem;if(vn){const rt=new vn({"text/plain":new Blob([Dt.text],{type:"text/plain"}),"text/html":new Blob([Dt.html],{type:"text/html"})});navigator.clipboard.write([rt]).catch(()=>{navigator.clipboard.writeText(Dt.text).catch(()=>{})})}else navigator.clipboard.writeText(Dt.text).catch(()=>{})}}return}return}if((w.metaKey||w.ctrlKey)&&w.key.toLowerCase()==="k"&&!w.isComposing){w.preventDefault(),gn();return}const T=w.target;if(T&&T.classList.contains("image-block-caption")||T&&T.closest("[data-equation-edit]")||T&&T.closest(".table-cell-inner"))return;const X=g.getState().selection;X.kind==="text"&&kn(X)||Vn();const J=g.getState().selection;if(J.kind==="text"&&kn(J)&&!w.isComposing){const Ge=w.key,nn=Ge.length===1&&!w.ctrlKey&&!w.metaKey&&!w.altKey;if(nn||Ge==="Enter"||Ge==="Tab"){if(w.preventDefault(),(et=(Be=g.commands).backspace)==null||et.call(Be),nn){const It=g.getState().selection;if(It.kind==="caret"){const Ot=g.getState().doc.blocks.get(It.blockId);if(Ot){const[At,wt]=En(Ot.content,It.offset),Ht=[...At,{type:"text",text:Ge},...wt];(Et=(je=g.commands).setText)==null||Et.call(je,{id:It.blockId,content:Ht,selectionAfter:Ct(It.blockId,It.offset+1)})}}}return}if((w.ctrlKey||w.metaKey)&&(Ge==="c"||Ge==="C"||Ge==="x"||Ge==="X")){const It=cn(J);if(It){w.preventDefault();const Ot=window.ClipboardItem;if(Ot){const At=new Ot({"text/plain":new Blob([It.text],{type:"text/plain"}),"text/html":new Blob([It.html],{type:"text/html"})});navigator.clipboard.write([At]).catch(()=>{navigator.clipboard.writeText(It.text).catch(()=>{})})}else navigator.clipboard.writeText(It.text).catch(()=>{});(Ge==="x"||Ge==="X")&&((bt=(dt=g.commands).backspace)==null||bt.call(dt))}return}if(Ge==="ArrowLeft"||Ge==="ArrowUp"||Ge==="ArrowRight"||Ge==="ArrowDown"){w.preventDefault();const It=yr(g.getState().doc),Ot=It.indexOf(J.anchor.blockId),At=It.indexOf(J.focus.blockId),[wt,Ht]=Ot<=At?[J.anchor,J.focus]:[J.focus,J.anchor],Dt=Ge==="ArrowLeft"||Ge==="ArrowUp"?wt:Ht;gt.value=[],(Mt=(lt=g.commands).setSelection)==null||Mt.call(lt,{selection:Ct(Dt.blockId,Dt.offset)});return}}if((w.key==="ArrowUp"||w.key==="ArrowDown")&&!w.shiftKey&&!w.isComposing){const Ge=g.getState().selection;if(Ge.kind==="caret"||Ge.kind==="text"){const nn=Ge.kind==="caret"?Ge.blockId:Ge.focus.blockId,It=Ge.kind==="caret"?Ge.offset:Ge.focus.offset,Ot=g.getState().doc.blocks.get(nn);if(Ot&&g.registries.schema.get(Ot.type).isolating){const wt=Ue(Ot.content),Ht=wt.slice(0,It),Dt=wt.slice(It),vn=Ht.lastIndexOf(`
|
|
283
|
-
`)+1,
|
|
284
|
-
`),
|
|
285
|
-
`},...
|
|
286
|
-
`);if(
|
|
287
|
-
`)){const bt=ce.lastChild;bt&&bt.nodeType===Node.ELEMENT_NODE&&bt.tagName==="BR"&&ce.removeChild(bt),ce.appendChild(document.createElement("br"))}W=!0}else ce.textContent=me}else ce&&(ce.textContent=me);const et={steps:[{op:"setText",id:w,content:ue}],selectionAfter:Ct(w,T+1),meta:{source:"input",addToHistory:!0}};g.dispatch(et)}const Ye=i.ref(null),Xe=i.ref("after");let mt="idle",sn=0,Tt=0,_t=4,Rt=null,An=null,xn=0,co=0,ur=null,Un=null,or=null,Mr=null;function Zn(){Mr!==null&&(clearTimeout(Mr),Mr=null),or=null}function Ar(){var w;ur&&(ur.classList.remove("block-being-dragged"),ur=null),An&&(An.remove(),An=null),Un!==null&&((w=Cn())==null||w.setBlockHandleDragging(Un,!1)),Un=null,Rt=null,mt="idle",Ke.value=null,Ye.value=null,Xe.value="after",Zn()}function qn(){document.removeEventListener("mousemove",Se,!0),document.removeEventListener("mouseup",ze,!0),document.removeEventListener("selectstart",Z,!0)}function U(w,T,X,J){k.value&&(mt!=="idle"&&(qn(),Ar()),mt="pending",Rt=w,sn=T,Tt=X,_t=J.thresholdPx,document.addEventListener("selectstart",Z,!0),document.addEventListener("mousemove",Se,!0),document.addEventListener("mouseup",ze,!0))}function x(w){}function Z(w){w.preventDefault()}function Se(w){if(mt==="pending"){const lt=w.clientX-sn,Mt=w.clientY-Tt;if(Math.sqrt(lt*lt+Mt*Mt)<=_t)return;Ze()}if(mt!=="active")return;try{const lt=window.getSelection();lt&<.rangeCount>0&<.removeAllRanges()}catch{}An&&(An.style.left=`${w.clientX+xn}px`,An.style.top=`${w.clientY+co}px`);const T=Un;if(!T)return;const X=Array.from(document.querySelectorAll(".block-host"));if(X.length<=1){Ye.value=null;return}const J=X[0].getBoundingClientRect(),se=X[X.length-1].getBoundingClientRect();if(w.clientY<J.top+J.height/2){Zn(),Ye.value=null,Xe.value="first";return}if(w.clientY>se.bottom-se.height/2){Zn(),Ye.value=null,Xe.value="last";return}const ue=document.elementFromPoint(w.clientX,w.clientY);if(!ue){Zn(),Ye.value=null;return}const me=ue.closest(".block-host");if(!me){Zn(),Ye.value=null;return}const de=me.dataset.blockId;if(!de||de===T){Zn(),Ye.value=null;return}const ce=me.getBoundingClientRect(),Be=ce.height===0?0:(w.clientY-ce.top)/ce.height;let et=!1;const je=g.getState().doc,Et=je.blocks.get(de);if(Et){const lt=g.registries.schema.get(Et.type);if(lt!=null&<.nestable){let Mt=de;for(et=!0;Mt!==null;){if(Mt===T){et=!1;break}Mt=dn(je,Mt)}}}if(Be>e5&&Be<t5&&et){Ye.value=de;const lt=Be<.5;or!==de&&(Zn(),or=de,Mr=setTimeout(()=>{or===de&&(Ye.value=de,Xe.value="into")},J7)),Xe.value!=="into"&&(Xe.value=lt?"before":"after")}else Zn(),Ye.value=de,Xe.value=Be<.5?"before":"after"}function ze(w){if(qn(),mt==="pending"){mt="idle",Rt=null;return}const T=Un,X=Ye.value,J=Xe.value;Ar(),T&&(J==="into"&&!X||!X&&J!=="first"&&J!=="last"||C(T,X,J))}function Ze(){var Be,et;const w=Rt;if(!w)return;const T=sn,X=Tt;try{const je=window.getSelection();je&&je.removeAllRanges()}catch{}Fe&&(Fe=null,qe&&(cancelAnimationFrame(qe),qe=0),jt=null,document.removeEventListener("mousemove",L,!0),document.removeEventListener("mouseup",re,!0),document.removeEventListener("selectstart",be,!0),gt.value=[]),Ut(null);const J=document.querySelector(`.block-host[data-block-id="${w}"]`);if(!J){qn(),mt="idle",Rt=null;return}J.classList.add("block-being-dragged"),ur=J;const se=J.querySelector(".block-host-content");if(!se){J.classList.remove("block-being-dragged"),ur=null,qn(),mt="idle",Rt=null;return}const ue=se.getBoundingClientRect(),me=((Be=se.firstElementChild)==null?void 0:Be.getBoundingClientRect())??ue;xn=me.left-T,co=me.top-X;const de=document.createElement("div");de.className="drag-ghost";const ce=se.firstElementChild;ce&&de.appendChild(ce.cloneNode(!0)),de.style.width=`${me.width}px`,de.style.left=`${T+xn}px`,de.style.top=`${X+co}px`,document.body.appendChild(de),An=de,Ke.value=w,Un=w,Ye.value=null,Xe.value="after",(et=Cn())==null||et.setBlockHandleDragging(w,!0),mt="active"}function C(w,T,X){var je,Et,dt;Ke.value=null;const J=g.getState().doc;if(!J.blocks.get(w))return;if(T){let bt=T;for(;bt!==null;){if(bt===w)return;bt=dn(J,bt)}}const ue=dn(J,w),me=Kn(J,w);if(me===-1)return;let de=null,ce;if(X==="first")de=null,ce=0;else if(X==="last")de=null,ce=J.root.length;else if(X==="into"&&T){const bt=J.blocks.get(T);if(!bt)return;const lt=g.registries.schema.get(bt.type);if(!(lt!=null&<.nestable))return;let Mt=T;for(;Mt!==null;){if(Mt===w)return;Mt=dn(J,Mt)}de=T,ce=0}else if((X==="before"||X==="after")&&T){const bt=dn(J,T),lt=Kn(J,T);if(lt===-1)return;de=bt,ce=X==="before"?lt:lt+1}else return;ue===de&&me<ce&&ce--,ce=Math.max(0,ce);const et=de===null?J.root:(je=J.blocks.get(de))==null?void 0:je.children;et&&(ce=Math.min(ce,et.length)),(dt=(Et=g.commands).moveBlock)==null||dt.call(Et,{id:w,toParent:de,toIndex:ce})}const S=i.ref(!1);function R(w){const T=[];if(!w||!w.types||!Array.from(w.types).includes("Files"))return T;const X=new Set;if(w.items&&w.items.length>0)for(let J=0;J<w.items.length;J++){const se=w.items[J];if(se.kind!=="file")continue;const ue=se.getAsFile();if(!ue||!ue.type.startsWith("image/"))continue;const me=`${ue.name||""}:${ue.size}:${ue.type}`;X.has(me)||(X.add(me),T.push(ue))}if(w.files&&w.files.length>0)for(let J=0;J<w.files.length;J++){const se=w.files[J];if(!se.type.startsWith("image/"))continue;const ue=`${se.name||""}:${se.size}:${se.type}`;X.has(ue)||(X.add(ue),T.push(se))}return T}function q(w){if(Ke.value)return;const T=w.dataTransfer;if(!T||R(T).length===0)return;S.value||(S.value=!0);const J=Array.from(document.querySelectorAll(".block-host"));if(J.length===0){Ye.value=null,Xe.value="last";return}const se=J[0].getBoundingClientRect(),ue=J[J.length-1].getBoundingClientRect(),me=w.clientY;if(me<se.top+se.height/2){Ye.value=null,Xe.value="first";return}if(me>ue.bottom-ue.height/2){Ye.value=null,Xe.value="last";return}const de=document.elementFromPoint(w.clientX,w.clientY);if(!de){Ye.value=null,Xe.value="last";return}const ce=de.closest(".block-host");if(!ce){Ye.value=null,Xe.value="last";return}const Be=ce.getBoundingClientRect(),et=ce.dataset.blockId;if(!et){Ye.value=null,Xe.value="last";return}Ye.value=et,Xe.value=me<Be.top+Be.height/2?"before":"after"}function ee(w){const T=w.relatedTarget,X=ut.value;X&&T&&X.contains(T)||S.value&&(S.value=!1,Ye.value=null,Xe.value="after")}async function oe(w){if(Ke.value)return;const T=w.dataTransfer;if(!T)return;const X=R(T);if(X.length===0)return;const J=Ye.value,se=Xe.value;S.value=!1,Ye.value=null,Xe.value="after";let ue=J,me=se==="before"?"before":"after";const de=g.getState().doc;se==="first"?(ue=de.root[0]??null,me="before"):se==="last"&&(ue=de.root[de.root.length-1]??null,me="after");let ce=ue;for(let Be=0;Be<X.length;Be++){const et=X[Be],je=await ne(et,{relativeToBlockId:ce,position:Be===0?me:"after",convertIfEmpty:Be===0});je&&(ce=je)}}function he(w,T){Ne(),ge(),j.visible=!0,j.anchorEl=T,j.blockId=w}function ge(){j.visible=!1,j.anchorEl=null}function Le(w,T){var ce,Be;if(!k.value)return;ge(),Ne();const X=g.getState().doc.blocks.get(w);if(!X)return;const J=g.registries.schema.get(X.type);if((J==null?void 0:J.content)==="text"&&Ue(X.content).length===0){B.visible=!0,B.anchorEl=T,B.blockId=w,B.query="",B.mode="slash",B.sourceBlockId=void 0;return}(Be=(ce=g.commands).insertBlock)==null||Be.call(ce,{type:g.registries.defaultBlockType,after:w,content:[]});const me=g.getState().selection,de=me.kind==="caret"?me.blockId:w;B.visible=!0,B.anchorEl=T,B.blockId=de,B.query="",B.mode="insert",B.sourceBlockId=w}function Ae(w,T,X){k.value&&(ge(),B.visible=!0,B.anchorEl=w,B.blockId=T,B.query=X,B.mode="slash",B.sourceBlockId=void 0)}function _e(w,T){if(!B.visible)return;if(w!==B.blockId){Ne();return}const X=T.match(/\/([^/]*)$/);if(!X){Ne();return}B.query=X[1]??""}function Ne(){B.visible=!1,B.anchorEl=null,B.query="",B.sourceBlockId=void 0}i.watch(()=>V.visible,w=>{w&&(B.visible||Ne(),j.visible||ge())});function st(w,T){var ue,me,de,ce;const X=B.blockId,J=pt(X),se=Lt(J);g.history.beginGroup();try{J!==se&&((me=(ue=g.commands).setText)==null||me.call(ue,{id:X,content:Xr(se)}));const Be=g.registries.slash.all.find(et=>et.id===w.id);if(Be){const et=typeof Be.args=="function"?Be.args(null):Be.args,je=et&&typeof et=="object"?{...et}:{};je.id==="__currentBlock__"&&(je.id=X),je.after==="__currentBlock__"&&(je.after=X);const Et=g.commands[Be.command];Et==null||Et(je),(ce=(de=g.commands).setSelection)==null||ce.call(de,{selection:{kind:"caret",blockId:X,offset:0}}),w.id==="image"&&i.nextTick(()=>{const dt=document.createElement("input");dt.type="file",dt.accept="image/*",dt.multiple=!1,dt.addEventListener("change",()=>{var lt;const bt=(lt=dt.files)==null?void 0:lt[0];bt&&ne(bt,{relativeToBlockId:X,position:"replace",convertIfEmpty:!0})}),dt.click()})}}finally{g.history.endGroup()}Ne()}function pt(w){const T=ut.value;if(!T)return"";const X=T.querySelector(`.block-content[data-block-id="${w}"]`);return(X==null?void 0:X.textContent)??""}function Lt(w){const T=w.lastIndexOf("/");return T<0?w:w.slice(0,T)}function bn(w){var lt,Mt,Ge,nn,It;let T=!1;w&&typeof w=="object"&&!("type"in w)&&(T=!!w.force);const X=ut.value;if(X){const Ot=window.getSelection();let At=null;if(Ot&&Ot.rangeCount>0){const wt=Ot.focusNode,Ht=(wt==null?void 0:wt.nodeType)===1?wt.closest(".block-content"):(lt=wt==null?void 0:wt.parentElement)==null?void 0:lt.closest(".block-content");if(Ht&&X.contains(Ht)){const Dt=Ht.getAttribute("data-block-id");Dt&&(At=Dt)}}if(At!==null&&St.value!==null&&At!==St.value){const wt=g.getState().doc.blocks.get(St.value);wt&&Je.has(wt.type)&&(At=null)}At!==null&&!fe&&Ut(At)}if(!k.value){V.visible=!1,V.selectionRect=null,V.blockId=null,V.blockType=null,V.blockAttrs={};return}const J=ut.value;if(!J)return;const se=g.getState().selection;if(se.kind==="text"&&kn(se)&&!Fe)return;if(ti(se)&&se.blockIds.length>0){const Ot=window.getSelection();if(Ot&&Ot.rangeCount>0&&Ot.getRangeAt(0).collapsed){const At=p0(J,g.getState().doc);At&&At.kind==="caret"&&(D=!0,(Ge=(Mt=g.commands).setSelection)==null||Ge.call(Mt,{selection:At}),D=!1)}}const ue=window.getSelection();if(!ue||ue.rangeCount===0){!fe&&!yt&&(V.visible=!1,V.selectionRect=null,V.blockId=null,V.blockType=null,V.blockAttrs={});return}const me=ue.getRangeAt(0);if(me.collapsed){!fe&&!yt&&(V.visible=!1,V.selectionRect=null,V.blockId=null);return}if(!J.contains(me.commonAncestorContainer)){!fe&&!yt&&(V.visible=!1,V.selectionRect=null,V.blockId=null);return}if(yt&&!T)return;const de=ue.anchorNode;if((de==null?void 0:de.nodeType)===1?de.closest(".table-cell-inner"):(nn=de==null?void 0:de.parentElement)==null?void 0:nn.closest(".table-cell-inner")){!fe&&!yt&&(V.visible=!1,V.selectionRect=null,V.blockId=null,V.blockType=null,V.blockAttrs={});return}const Be=(de==null?void 0:de.nodeType)===1?de.closest(".block-content"):(It=de==null?void 0:de.parentElement)==null?void 0:It.closest(".block-content");if(!Be){!fe&&!yt&&(V.visible=!1,V.selectionRect=null,V.blockId=null);return}const et=Be.getAttribute("data-block-id");if(!et){!fe&&!yt&&(V.visible=!1,V.selectionRect=null,V.blockId=null);return}const Et=g.getState().doc.blocks.get(et),dt=me.getBoundingClientRect(),bt=dt.width===0&&dt.height===0?Be.getBoundingClientRect():dt;V.visible=!0,V.selectionRect=bt,V.blockId=et,V.blockType=(Et==null?void 0:Et.type)??null,V.blockAttrs=(Et==null?void 0:Et.attrs)??{}}function Sn(){const w=g.getState().selection;if(w.kind==="text"&&kn(w)){if(at(),V.visible){const se=ut.value;if(se){const ue=$l(se,g.getState().doc,w);ue.length>0&&(V.selectionRect=fn(ue))}}return}if(!V.visible)return;const T=window.getSelection();if(!T||T.rangeCount===0)return;const X=T.getRangeAt(0);if(X.collapsed)return;const J=X.getBoundingClientRect();J.width===0&&J.height===0||(V.selectionRect=J)}function fn(w){if(w.length===0)return new DOMRect(0,0,0,0);let T=1/0,X=1/0,J=-1/0,se=-1/0;for(const ue of w)T=Math.min(T,ue.left),X=Math.min(X,ue.top),J=Math.max(J,ue.right),se=Math.max(se,ue.bottom);return new DOMRect(T,X,J-T,se-X)}function ot(w){if(!k.value)return;const T=ut.value;if(!T)return;const X=$l(T,g.getState().doc,w);if(X.length===0)return;const J=fn(X),ue=g.getState().doc.blocks.get(w.focus.blockId);V.visible=!0,V.selectionRect=J,V.blockId=w.focus.blockId,V.blockType=(ue==null?void 0:ue.type)??null,V.blockAttrs=(ue==null?void 0:ue.attrs)??{}}function Ft(w){var se,ue;const T=ut.value;if(!T||M.value||!T.contains(w.target))return;const X=w.target;if(X&&X.closest(".block-handle"))return;yt=!0,V.visible=!1;const J=g.getState().selection;if(J.kind==="text"&&kn(J)&&(gt.value=[]),w.button===0&&!w.shiftKey){const me=w.target;if(me&&(me.closest(".table-cell-inner, .block-table-container, .block-table-of-contents")||me.closest(".block-focus-root")&&!me.closest('[contenteditable="true"]')&&!me.closest("[data-equation-edit]")||me.closest(".equation-block")&&!me.closest("[data-equation-edit]"))){Pe=!0;try{const ce=window.getSelection();ce&&ce.removeAllRanges()}catch{}return}else Pe=!1;const de=zi(w.clientX,w.clientY,T,g.getState().doc);de&&(J.kind==="text"&&kn(J)&&(D=!0,(ue=(se=g.commands).setSelection)==null||ue.call(se,{selection:Ct(de.blockId,de.offset)}),D=!1),Fe={start:{blockId:de.blockId,offset:de.offset},crossBlock:!1},document.addEventListener("mousemove",L,!0),document.addEventListener("mouseup",re,!0))}}function On(){if(!yt)return;if(M.value){yt=!1;return}if(yt=!1,Pe){Pe=!1;return}const w=g.getState().selection;w.kind==="text"&&kn(w)||bn()}let it=null,Wt=!1;function Nn(w){if(!M.value)return;const T=ut.value;if(!T||!T.contains(w.target))return;const X=w.target;if(!X||!X.closest(".block-content")||X.closest(".block-handle, .tt-btn, .ht-btn, a[href]"))return;const se=w.touches[0];se&&(Wt=!1,it={longPressTimer:window.setTimeout(()=>{it&&Tn(T,it.startTouch)},n5),startTouch:se},document.addEventListener("touchmove",Dn,{passive:!1,capture:!0}),document.addEventListener("touchend",Bn,!0),document.addEventListener("touchcancel",Bn,!0))}function Dn(w){var de,ce;if(!it)return;Wt=!0;const T=ut.value;if(!T)return;if(!Fe){const Be=w.touches[0];if(!Be)return;const et=Be.clientX-it.startTouch.clientX,je=Be.clientY-it.startTouch.clientY;if(Math.hypot(et,je)>10){it.longPressTimer&&clearTimeout(it.longPressTimer),it=null;return}return}const X=w.touches[0];if(!X)return;const J=zi(X.clientX,X.clientY,T,g.getState().doc);if(!J)return;const se=Fe.start;if(J.blockId===se.blockId){if(Fe.crossBlock){Fe.crossBlock=!1,gt.value=[],document.removeEventListener("selectstart",be,!0);const Be=window.getSelection();Be&&Be.removeAllRanges()}return}if(w.preventDefault(),!Fe.crossBlock){Fe.crossBlock=!0,document.addEventListener("selectstart",be,!0);const Be=window.getSelection();Be&&Be.removeAllRanges()}const ue={blockId:J.blockId,offset:J.offset},me=_l(se,ue);D=!0,(ce=(de=g.commands).setSelection)==null||ce.call(de,{selection:me}),D=!1,at()}function Tn(w,T){const X=zi(T.clientX,T.clientY,w,g.getState().doc);if(!X){it=null;return}V.visible=!1;const J=g.getState().selection;J.kind==="text"&&kn(J)&&(gt.value=[]),Fe={start:{blockId:X.blockId,offset:X.offset},crossBlock:!1}}function Bn(){if(it&&(it.longPressTimer&&clearTimeout(it.longPressTimer),it=null),!Fe){document.removeEventListener("touchmove",Dn,!0),document.removeEventListener("touchend",Bn,!0),document.removeEventListener("touchcancel",Bn,!0);return}if(Fe=null,document.removeEventListener("touchmove",Dn,!0),document.removeEventListener("touchend",Bn,!0),document.removeEventListener("touchcancel",Bn,!0),document.removeEventListener("selectstart",be,!0),!Wt)return;at();const w=g.getState().selection;w.kind==="text"&&kn(w)&&ot(w)}function cn(w){const T=g.getState().doc,X=yr(T),J=X.indexOf(w.anchor.blockId),se=X.indexOf(w.focus.blockId);if(J===-1||se===-1)return null;const[ue,me]=J<=se?[w.anchor,w.focus]:[w.focus,w.anchor],de=X.indexOf(ue.blockId),ce=X.indexOf(me.blockId);if(de===-1||ce===-1)return null;const Be=[],et=[];for(let je=de;je<=ce;je++){const Et=X[je],dt=T.blocks.get(Et);if(!dt)continue;const bt=Ue(dt.content).length;let lt=0,Mt=bt;je===de&&(lt=Math.min(ue.offset,bt)),je===ce&&(Mt=Math.min(me.offset,bt)),lt>Mt&&([lt,Mt]=[Mt,lt]);const[,Ge]=En(dt.content,lt),[nn]=En(Ge,Mt-lt);Be.push(Ue(nn)),et.push(Qr(nn))}return{text:Be.join(`
|
|
288
|
-
`),html:et.join("<br>")}}function Wr(w){var J,se;const T=g.getState().selection;if(T.kind!=="text"||!kn(T))return;const X=cn(T);X&&(w.preventDefault(),(J=w.clipboardData)==null||J.setData("text/plain",X.text),(se=w.clipboardData)==null||se.setData("text/html",X.html))}function Nr(w){var J,se,ue,me;if(!k.value){w.preventDefault();return}const T=g.getState().selection;if(T.kind!=="text"||!kn(T))return;const X=cn(T);X&&(w.preventDefault(),(J=w.clipboardData)==null||J.setData("text/plain",X.text),(se=w.clipboardData)==null||se.setData("text/html",X.html),(me=(ue=g.commands).backspace)==null||me.call(ue))}function un(w){if(!k.value)return;const T=w.detail;if(!(T!=null&&T.blockId)||!(T!=null&&T.anchor))return;const X=T.blockId,J=g.getState().doc,se=J.blocks.get(X),ue=_r(J,X),de=typeof(se==null?void 0:se.attrs).startNumber=="number"&&!!ue&&ue.type==="orderedList",ce=oc(J,X),Be=ce!==1;Ne(),ge(),br(),tt(),V.visible=!1,ae.visible=!0,ae.blockId=X,ae.anchor=T.anchor,ae.canContinue=de,ae.canStartNew=Be,ae.currentNumber=ce}function gr(){ae.visible=!1,ae.anchor=null,ae.blockId=null}function ws(){var w,T;ae.blockId&&((T=(w=g.commands).setStartNumber)==null||T.call(w,{id:ae.blockId,startNumber:null}),gr())}function xs(){var w,T;ae.blockId&&((T=(w=g.commands).setStartNumber)==null||T.call(w,{id:ae.blockId,startNumber:1}),gr())}function Es(w){if(!ae.blockId)return;const T=ae.anchor,X=ae.blockId;gr(),T&&(Te.visible=!0,Te.initialValue=w,Te.anchor=T,Te.blockId=X)}function br(){Te.visible=!1,Te.anchor=null,Te.blockId=null}function Cs(w){var T,X;if(!Te.blockId){br();return}(X=(T=g.commands).setStartNumber)==null||X.call(T,{id:Te.blockId,startNumber:w}),br(),gr()}function Sl(w){if(!k.value)return;const T=w.detail;if(!(T!=null&&T.blockId)||!(T!=null&&T.anchor))return;const X=T.blockId,se=g.getState().doc.blocks.get(X);if(!se)return;const ue=se.attrs.language??"plain";Ne(),ge(),br(),gr(),tt(),V.visible=!1,He.visible=!0,He.blockId=X,He.anchor=T.anchor,He.initialValue=ue}function Kr(){He.visible=!1,He.anchor=null,He.blockId=null}function Ss(w){var T,X;if(!He.blockId){Kr();return}(X=(T=g.commands).setAttrs)==null||X.call(T,{id:He.blockId,attrs:{language:w}}),Kr()}function Yo(w){var de,ce,Be,et,je;const T=w.target,X=document.querySelector(".ordered-list-menu"),J=document.querySelector(".number-picker"),se=document.querySelector(".code-lang-picker"),ue=document.querySelector(".link-popover");if(X&&X.contains(T)||J&&J.contains(T)||se&&se.contains(T)||ue&&ue.contains(T)||T instanceof Node&&((de=T.closest)!=null&&de.call(T,".ol-marker"))||T instanceof Node&&((ce=T.closest)!=null&&ce.call(T,".block-code-lang"))||T instanceof Node&&((Be=T.closest)!=null&&Be.call(T,"a[href]")))return;gr(),br(),Kr(),tt();const me=g.getState().selection;if(me.kind==="blocks"&&me.blockIds.length>0){const Et=ut.value;if(Et&&Et.contains(T)){const dt=T.nodeType===1?T:T.parentElement??null;if(dt&&(dt.closest("[contenteditable]")||dt.closest(".block-image-wrapper, .block-image-container, .block-table-container, .block-code-wrapper, .block-divider, .block-todo-checkbox, .block-ordered-list-wrapper, .block-video, .block-file, .block-embed, .block-callout")))return}(je=(et=g.commands).clearSelection)==null||je.call(et)}}function dr(w){const T=w.target;T instanceof Element&&(T.closest(".code-lang-picker")||T.closest(".ordered-list-menu")||T.closest(".number-picker")||T.closest(".link-popover"))||(ae.visible&&gr(),Te.visible&&br(),He.visible&&Kr(),xe.visible&&tt())}function Ts(w){var X,J;if(w.key!=="Escape")return;const T=g.getState().selection;T.kind==="blocks"&&T.blockIds.length>0&&(w.preventDefault(),(J=(X=g.commands).clearSelection)==null||J.call(X))}function Br(w){const T=w.target;if(!T||T.closest(".block-handle")||T.closest('[contenteditable="true"]')||T.closest("[data-equation-edit]"))return;const X=T.closest(".block-focus-root");if(!X)return;const J=X.closest(".block-host");if(!J)return;const se=ut.value;if(!se||!se.contains(J))return;const ue=J.getAttribute("data-block-id");ue&&Ut(ue,{clearNativeSelection:!0})}function Ai(w){w.target===ut.value&&Ut(null,{clearNativeSelection:!0})}return i.onMounted(()=>{i.nextTick(()=>{const w=ut.value;if(!w)return;const T=g.getState().selection;v0(w,T),w.addEventListener("ordered-list-marker-click",un),w.addEventListener("code-lang-click",Sl),w.addEventListener("click",Br),w.addEventListener("click",Ai)}),document.addEventListener("selectionchange",bn),document.addEventListener("mousedown",Ft,!0),document.addEventListener("mouseup",On,!0),document.addEventListener("mousedown",Yo,!0),document.addEventListener("touchstart",Yo,!0),window.addEventListener("scroll",Sn,!0),window.addEventListener("resize",Sn),window.addEventListener("scroll",dr,!0),document.addEventListener("touchmove",dr,{passive:!0,capture:!0}),document.addEventListener("keydown",Ts,!0),E==null||E.addEventListener("change",O),document.addEventListener("touchstart",Nn,{passive:!1,capture:!0})}),i.onBeforeUnmount(()=>{const w=ut.value;w&&(w.removeEventListener("ordered-list-marker-click",un),w.removeEventListener("code-lang-click",Sl),w.removeEventListener("click",Br),w.removeEventListener("click",Ai)),document.removeEventListener("selectionchange",bn),document.removeEventListener("mousedown",Ft,!0),document.removeEventListener("mouseup",On,!0),document.removeEventListener("mousedown",Yo,!0),document.removeEventListener("touchstart",Yo,!0),window.removeEventListener("scroll",Sn,!0),window.removeEventListener("resize",Sn),window.removeEventListener("scroll",dr,!0),document.removeEventListener("touchmove",dr,!0),document.removeEventListener("keydown",Ts,!0),E==null||E.removeEventListener("change",O),document.removeEventListener("touchstart",Nn,!0),document.removeEventListener("touchmove",Dn,!0),document.removeEventListener("touchend",Bn,!0),document.removeEventListener("touchcancel",Bn,!0),an(),g.destroy(),Q(),V3(),U3()}),e({editor:g}),(w,T)=>(i.openBlock(),i.createElementBlock("div",{ref_key:"rootEl",ref:ut,class:i.normalizeClass(["block-editor",[f.value,{"block-editor-dragging":Ke.value!==null,"is-mobile":M.value}]]),style:i.normalizeStyle(p.value),contenteditable:!1,onKeydown:ht,onCopy:Wr,onCut:Nr,onDragover:i.withModifiers(q,["prevent"]),onDragleave:ee,onDrop:i.withModifiers(oe,["prevent"])},[z.value?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(_h,{key:0,"root-el":ut.value,"focus-block-id":St.value,"hover-visible":V.visible,"hover-selection-rect":V.selectionRect,"hover-block-id":V.blockId,"hover-block-type":V.blockType,"hover-block-attrs":V.blockAttrs,"plus-menu-visible":B.visible,"settings-menu-visible":j.visible,position:te.value,onToolbarInteracting:Me,onOpenPlusMenu:Le,onOpenSettingsMenu:he,onLinkClick:Gt,onHoverClose:T[0]||(T[0]=X=>V.visible=!1)},null,8,["root-el","focus-block-id","hover-visible","hover-selection-rect","hover-block-id","hover-block-type","hover-block-attrs","plus-menu-visible","settings-menu-visible","position"])),z.value?(i.openBlock(),i.createBlock(J0,i.mergeProps({key:1},H.value,{onInteracting:Me}),null,16)):i.createCommentVNode("",!0),i.createElementVNode("div",j7,[i.createVNode(U0,{ref_key:"blockListRef",ref:cr,items:K.value,"blocks-map":_.value.doc.blocks,"first-block-placeholder":b.value,"hovered-block-id":ln.value,"focused-block-id":St.value,"has-text-selection":V.visible,"dragging-block-id":Ke.value,"drop-target-block-id":Ye.value,"drop-position":Xe.value,"menu-open-block-id":j.visible?j.blockId:null,onOpenSettingsMenu:he,onOpenPlusMenu:Le,onSlashTrigger:Ae,onInputChanged:_e,onHoverChange:Qt,onGripPointerDown:U,onGripPointerUp:x,onLinkClick:ct,onFocusIn:Zt},null,8,["items","blocks-map","first-block-placeholder","hovered-block-id","focused-block-id","has-text-selection","dragging-block-id","drop-target-block-id","drop-position","menu-open-block-id"])]),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[gt.value.length>0?(i.openBlock(),i.createElementBlock("div",Q7,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(gt.value,(X,J)=>(i.openBlock(),i.createElementBlock("div",{key:J,class:"cross-block-selection-rect",style:i.normalizeStyle({left:X.left+"px",top:X.top+"px",width:X.width+"px",height:X.height+"px"})},null,4))),128))])):i.createCommentVNode("",!0)])),i.createVNode(kf,{ref_key:"plusMenuRef",ref:A,visible:B.visible,"anchor-el":B.anchorEl,"block-id":B.blockId,query:B.query,"root-el":ut.value,mode:B.mode,onClose:Ne,onCommit:st},null,8,["visible","anchor-el","block-id","query","root-el","mode"]),i.createVNode(N6,{ref_key:"settingsMenuRef",ref:F,visible:j.visible,"anchor-el":j.anchorEl,"block-id":j.blockId,"root-el":ut.value,onClose:ge},null,8,["visible","anchor-el","block-id","root-el"]),i.createVNode(ec,{visible:ae.visible,"block-id":ae.blockId,anchor:ae.anchor,"root-el":ut.value,"can-continue":ae.canContinue,"can-start-new":ae.canStartNew,"current-number":ae.currentNumber,onContinue:ws,onStartNew:xs,onModify:Es,onClose:gr},null,8,["visible","block-id","anchor","root-el","can-continue","can-start-new","current-number"]),i.createVNode(tc,{visible:Te.visible,"initial-value":Te.initialValue,anchor:Te.anchor,"root-el":ut.value,onConfirm:Cs,onClose:br},null,8,["visible","initial-value","anchor","root-el"]),i.createVNode(Qh,{visible:He.visible,"initial-value":He.initialValue,anchor:He.anchor,"root-el":ut.value,onConfirm:Ss,onClose:Kr},null,8,["visible","initial-value","anchor","root-el"]),i.createVNode(rc,{visible:xe.visible,"anchor-rect":xe.anchorRect,"block-id":xe.blockId,from:xe.from,to:xe.to,href:xe.href,text:xe.text,"initial-mode":xe.initialMode,"show-text-input":xe.showTextInput,readonly:!k.value,onClose:tt},null,8,["visible","anchor-rect","block-id","from","to","href","text","initial-mode","show-text-input","readonly"])],38))}});ye.BlockContent=zr,ye.BlockEditor=r5,ye.BlockHost=V0,ye.BlockList=U0,ye.BuiltinExtensions=Ld,ye.CommandRegistry=Ws,ye.DeserializerRegistry=o0,ye.DividerExtension=_d,ye.Editor=s0,ye.EquationExtension=Ad,ye.HeadingExtension=lc,ye.HistoryExtension=sc,ye.HistoryManager=a0,ye.ImageExtension=Zc,ye.InputRuleRegistry=t0,ye.KeymapExtension=ac,ye.KeymapRegistry=e0,ye.ParagraphExtension=ic,ye.SchemaRegistry=zs,ye.SerializerRegistry=r0,ye.SlashCommandRegistry=n0,ye.TableExtension=Id,ye.TableOfContentsExtension=Rd,ye.TransactionBuilder=Us,ye.applySteps=_i,ye.applyTransaction=Vs,ye.asBlockId=Xd,ye.blockAfter=No,ye.blockBefore=_r,ye.blocksSelection=i1,ye.buildRegistries=l0,ye.canContain=Rs,ye.caretSelection=Ct,ye.coerceAttrs=_s,ye.collectIndentSyncPatches=Fs,ye.createBlockId=Mo,ye.createPrimitiveCommands=js,ye.createState=Il,ye.createTransaction=kt,ye.defaultAttrs=Zr,ye.defineSchema=Ml,ye.depthOf=Ir,ye.docFromData=Al,ye.docToData=Ps,ye.editorKey=Hl,ye.extensionBlockType=L1,ye.flatten=yr,ye.flattenExtensions=i0,ye.focusOffset=l1,ye.getBlock=Kt,ye.hasText=Ls,ye.indexOf=Kn,ye.inlineFromString=Xr,ye.inlineText=Ue,ye.invertSteps=qs,ye.isBlockId=To,ye.isBlocks=ti,ye.isCaret=Bo,ye.isCollapsed=Rl,ye.isEmpty=Ds,ye.isIsolating=Os,ye.isText=jr,ye.isTextRun=Kd,ye.keyMatches=Js,ye.keyNameFromEvent=Qs,ye.lastDescendant=$s,ye.nextSibling=Qd,ye.normalizeLocale=H0,ye.normalizeTheme=P0,ye.orderedAnchors=a1,ye.parentOf=dn,ye.prevSibling=Bl,ye.primaryBlock=Gs,ye.requireBlock=Wn,ye.siblingList=Ao,ye.splitInline=En,ye.textSelection=_l,ye.useEditor=Yn,ye.useI18n=In,ye.withAttrs=e1,ye.withContent=Jd,Object.defineProperty(ye,Symbol.toStringTag,{value:"Module"})});
|
|
24
|
+
$$$`:""}}}}const Va=Ha(),Sr='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="2" y="3" width="12" height="10" rx="1"/><path d="M2 7h12M2 10h12M6 3v10M10 3v10"/></svg>',ob='<svg viewBox="0 0 1024 1024" width="14" height="14" fill="currentColor" aria-hidden="true"><path d="M160 85.333333a32 32 0 0 0-32 32v42.666667A138.666667 138.666667 0 0 0 266.666667 298.666667h490.666666A138.666667 138.666667 0 0 0 896 160v-42.666667a32 32 0 0 0-64 0v42.666667a74.666667 74.666667 0 0 1-74.666667 74.666667H661.333333V117.333333a32 32 0 0 0-64 0V234.666667h-170.666666V117.333333a32 32 0 0 0-64 0V234.666667H266.666667A74.666667 74.666667 0 0 1 192 160v-42.666667A32 32 0 0 0 160 85.333333zM160 938.666667a32 32 0 0 1-32-32v-42.666667A138.666667 138.666667 0 0 1 266.666667 725.333333h490.666666A138.666667 138.666667 0 0 1 896 864v42.666667a32 32 0 0 1-64 0v-42.666667a74.666667 74.666667 0 0 0-74.666667-74.666667H661.333333v117.333334a32 32 0 0 1-64 0V789.333333h-170.666666v117.333334a32 32 0 0 1-64 0V789.333333H266.666667a74.666667 74.666667 0 0 0-74.666667 74.666667v42.666667a32 32 0 0 1-32 32zM512 557.226667l62.72 62.72a32 32 0 1 0 45.226667-45.226667L557.226667 512l62.72-62.72a32 32 0 1 0-45.226667-45.226667L512 466.773333l-62.72-62.72a32 32 0 1 0-45.226667 45.226667L466.773333 512l-62.72 62.72a32 32 0 1 0 45.226667 45.226667L512 557.226667z"/><path d="M372.352 544c0.981333-1.109333 2.005333-2.176 3.072-3.242667L404.181333 512l-28.757333-28.757333a78.72 78.72 0 0 1-3.072-3.242667H117.333333a32 32 0 0 0 0 64h255.018667zM662.314667 544h244.352a32 32 0 0 0 0-64h-244.352a77.909333 77.909333 0 0 1-3.072 3.242667l-28.757334 28.757333 28.757334 28.757333 3.072 3.242667z"/></svg>',rb='<svg viewBox="0 0 1024 1024" width="14" height="14" fill="currentColor" aria-hidden="true"><path d="M938.666667 160a32 32 0 0 0-32-32h-42.666667A138.666667 138.666667 0 0 0 725.333333 266.666667v490.666666A138.666667 138.666667 0 0 0 864 896h42.666667a32 32 0 0 0 0-64h-42.666667a74.666667 74.666667 0 0 1-74.666667-74.666667V661.333333h117.333334a32 32 0 0 0 0-64H789.333333v-170.666666h117.333334a32 32 0 0 0 0-64H789.333333V266.666667c0-41.216 33.450667-74.666667 74.666667-74.666667h42.666667a32 32 0 0 0 32-32zM85.333333 160A32 32 0 0 1 117.333333 128h42.666667A138.666667 138.666667 0 0 1 298.666667 266.666667v490.666666A138.666667 138.666667 0 0 1 160 896h-42.666667a32 32 0 0 1 0-64h42.666667a74.666667 74.666667 0 0 0 74.666667-74.666667V661.333333H117.333333a32 32 0 0 1 0-64H234.666667v-170.666666H117.333333a32 32 0 0 1 0-64H234.666667V266.666667A74.666667 74.666667 0 0 0 160 192h-42.666667A32 32 0 0 1 85.333333 160zM466.773333 512l-62.72 62.72a32 32 0 1 0 45.226667 45.226667L512 557.226667l62.72 62.72a32 32 0 1 0 45.226667-45.226667L557.226667 512l62.72-62.72a32 32 0 1 0-45.226667-45.226667L512 466.773333l-62.72-62.72a32 32 0 1 0-45.226667 45.226667L466.773333 512z"/><path d="M480 372.352c1.109333 0.981333 2.176 2.005333 3.242667 3.072l28.757333 28.757333 28.757333-28.757333c1.066667-1.066667 2.133333-2.090667 3.242667-3.072V117.333333a32 32 0 0 0-64 0v255.018667zM480 662.314667v244.352a32 32 0 0 0 64 0v-244.352a77.909333 77.909333 0 0 1-3.242667-3.072L512 630.485333l-28.757333 28.757334-3.242667 3.072z"/></svg>',Ua='<svg viewBox="0 0 1024 1024" width="14" height="14" fill="currentColor" aria-hidden="true"><path d="M128 266.666667A138.666667 138.666667 0 0 1 266.666667 128h490.666666A138.666667 138.666667 0 0 1 896 266.666667v246.272a276.096 276.096 0 0 0-64-30.250667V426.666667h-170.666667v56.021333a276.096 276.096 0 0 0-64 30.250667V426.666667h-170.666666v170.666666h86.272a276.096 276.096 0 0 0-30.250667 64H426.666667v170.666667h56.021333c7.381333 22.784 17.578667 44.245333 30.250667 64H266.666667A138.666667 138.666667 0 0 1 128 757.333333V266.666667zM266.666667 192A74.666667 74.666667 0 0 0 192 266.666667V362.666667h170.666667v-170.666667H266.666667zM192 426.666667v170.666666h170.666667v-170.666666h-170.666667z m469.333333-64h170.666667V266.666667a74.666667 74.666667 0 0 0-74.666667-74.666667H661.333333v170.666667z m-64-170.666667h-170.666666v170.666667h170.666666v-170.666667z m-405.333333 469.333333v96c0 41.216 33.450667 74.666667 74.666667 74.666667H362.666667v-170.666667h-170.666667z"/><path d="M981.333333 746.666667a234.666667 234.666667 0 1 1-469.333333 0 234.666667 234.666667 0 0 1 469.333333 0z m-234.666666-30.165334l-70.229334-70.272a21.333333 21.333333 0 0 0-30.208 30.208l70.272 70.229334-70.272 70.229333a21.333333 21.333333 0 0 0 30.208 30.208l70.229334-70.272 70.229333 70.272a21.333333 21.333333 0 0 0 30.208-30.208L776.832 746.666667l70.272-70.229334a21.333333 21.333333 0 0 0-30.208-30.208L746.666667 716.501333z"/></svg>',lb={indent:jt.indent,rows:{default:3,validate:e=>typeof e=="number"&&Number.isInteger(e)&&e>=1},cols:{default:3,validate:e=>typeof e=="number"&&Number.isInteger(e)&&e>=1},cells:{default:[],validate:Zd},colWidths:{default:[],validate:e=>Array.isArray(e)},headerRow:{default:!1,validate:e=>typeof e=="boolean"}},ib=n.defineComponent({name:"TableBlock",props:{block:{type:Object,required:!0},placeholder:{type:String,default:void 0}},setup(e,{expose:t}){e.placeholder;const o=dn(),r=Vn(),l=Zt(),s=e.block.id,i=n.inject(qr,null);let a="__none__";function c(y){if(!y)return"null";const w=y.selectionRect,C=y.tableActiveMarks?[...y.tableActiveMarks].sort().join(","):"";return[y.visible?"v":"-",y.cellEditMode?"c":y.tableMode?"t":"-",String(y.blockId??""),String(y.blockType??""),y.showDelete?"D":"-",y.showMerge?"M":"-",y.showSplit?"S":"-",y.showHeaderRow?"H":"-",y.headerRowActive?"h":"-",y.tableActiveColor??"",y.tableActiveBgColor??"",y.tableActiveVerticalAlign??"",C,w?`${w.left.toFixed(1)},${w.top.toFixed(1)},${w.width.toFixed(1)},${w.height.toFixed(1)}`:"",y.blockAttrs?JSON.stringify(y.blockAttrs):""].join("|")}function d(y){if(!i)return;const w=c(y);w!==a&&(a=w,i.value=y)}function f(y){i&&n.nextTick(()=>{d(y)})}const u=n.computed(()=>so(e.block.attrs)),m=new Map,h=n.ref(null),p=n.ref(null),b=n.ref(null);let x=0;const O=500;function z(){return Date.now()-x<O}function F(y){var B;const w=y.target;!!(w&&(w.nodeType===1?w.closest(".hover-toolbar"):(B=w.parentElement)!=null&&B.closest(".hover-toolbar")))&&(x=Date.now())}function j(){x=Date.now()}const P=n.ref(null);let U=0,te=0;const W=n.ref({kind:"none"}),J=n.ref(null);let A=!1;const _=n.ref(null);let I=null,S=null,$=!1,N=!1;const E=n.reactive({blockType:"paragraph",blockAttrs:{align:"left"},marks:new Set,textColor:"",bgColor:"",verticalAlign:"middle",showDelete:!1,deleteLabel:"",deleteIcon:Ua,showMerge:!1,showSplit:!1,showHeaderRow:!1,headerRowActive:!1}),T=n.ref(null),R=n.reactive({visible:!1,selectionRect:null}),Y=n.reactive({visible:!1,anchorRect:null,href:"",text:"",initialMode:"edit",showTextInput:!1});let ae=null,ie=null,pe=!1;const re=n.reactive({visible:!1,row:-1,col:-1,anchor:null,canContinue:!1,canStartNew:!1,currentNumber:1});function le(){re.visible=!1,re.anchor=null,re.row=-1,re.col=-1}const xe=n.reactive({visible:!1,row:-1,col:-1,anchor:null,initialValue:1});function Ae(){xe.visible=!1,xe.anchor=null,xe.row=-1,xe.col=-1}function Xe(y,w,C){var he,be;if(!r.value)return;const B=(he=u.value.cells[y])==null?void 0:he[w];if(!B||B.covered||B.cellType!=="orderedList")return;const K=tl(u.value,y,w),G=typeof B.startNumber=="number";let ee=!1;for(let ve=y-1;ve>=0;ve--){const $e=(be=u.value.cells[ve])==null?void 0:be[w];if(!(!$e||$e.covered)){ee=$e.cellType==="orderedList";break}}const ne=G&&ee,ye=K!==1;qe(),R.visible=!1,R.selectionRect=null,Ae(),re.visible=!0,re.row=y,re.col=w,re.anchor=C,re.canContinue=ne,re.canStartNew=ye,re.currentNumber=K}function At(){var w,C;if(re.row<0||re.col<0)return;const y=Yo(u.value,re.row,re.col,{startNumber:null});(C=(w=o.commands).setAttrs)==null||C.call(w,{id:s,attrs:y}),le()}function nn(){var w,C;if(re.row<0||re.col<0)return;const y=Yo(u.value,re.row,re.col,{startNumber:1});(C=(w=o.commands).setAttrs)==null||C.call(w,{id:s,attrs:y}),le()}function Gt(){if(re.row<0||re.col<0)return;const y=re.anchor,w=re.row,C=re.col,B=re.currentNumber;le(),y&&(xe.visible=!0,xe.initialValue=B,xe.anchor=y,xe.row=w,xe.col=C)}function Ot(y){var C,B;if(xe.row<0||xe.col<0){Ae();return}const w=Yo(u.value,xe.row,xe.col,{startNumber:y});(B=(C=o.commands).setAttrs)==null||B.call(C,{id:s,attrs:w}),Ae()}function qe(){if(!Y.visible)return;if(Y.visible=!1,ae=null,ie=null,R.visible=!1,R.selectionRect=null,pe){pe=!1;return}const y=b.value;if(y){const w=m.get(`${y.row}-${y.col}`);w&&X(y.row,y.col,w),b.value=null}}function bt(){const y=window.getSelection();if(!y||y.rangeCount===0)return null;const C=y.getRangeAt(0).commonAncestorContainer,B=C.nodeType===1?C:C.parentElement;return B?B.closest("a"):null}function It(){const y=window.getSelection();if(!y||y.rangeCount===0)return;const w=y.getRangeAt(0),C=w.getBoundingClientRect();if(C.width===0&&C.height===0)return;ae=w.cloneRange();const B=bt(),K=(B==null?void 0:B.getAttribute("href"))??"",G=y.toString();Y.anchorRect=C,Y.href=K,Y.text=G,Y.initialMode=K?"view":"edit",Y.showTextInput=!G&&!K,Y.visible=!0,R.visible=!1}function Je(y){const w=y.getAttribute("href")||"",C=y.textContent||"",B=y.getBoundingClientRect();Y.anchorRect=B,Y.href=w,Y.text=C,Y.initialMode="view",Y.showTextInput=!1,Y.visible=!0,pe=!0,ie=y,R.visible=!1,R.selectionRect=null}function Le(y){const w=y.closest(".table-cell-inner");if(!w)return;const C=w.closest(".table-cell");if(!C)return;const B=Number(C.getAttribute("data-row")),K=Number(C.getAttribute("data-col"));!Number.isFinite(B)||!Number.isFinite(K)||X(B,K,w)}function mt(y,w){if(ie&&ie.isConnected){ie.setAttribute("href",y),ie.setAttribute("target","_blank"),ie.setAttribute("rel","noopener noreferrer"),w!==void 0&&w!==ie.textContent&&(ie.textContent=w),Le(ie);return}const C=window.getSelection();if(!C)return;if(ae){const K=b.value,G=K?m.get(`${K.row}-${K.col}`):null;G&&G.isConnected&&(C.removeAllRanges(),C.addRange(ae))}const B=bt();if(B)B.setAttribute("href",y),B.setAttribute("target","_blank"),B.setAttribute("rel","noopener noreferrer"),w!==void 0&&w!==B.textContent&&(B.textContent=w);else{if(C.rangeCount===0)return;const K=C.getRangeAt(0),G=document.createElement("a");G.setAttribute("href",y),G.setAttribute("target","_blank"),G.setAttribute("rel","noopener noreferrer");try{G.appendChild(K.extractContents()),K.insertNode(G),C.removeAllRanges();const ee=document.createRange();ee.selectNodeContents(G),C.addRange(ee),ae=ee.cloneRange()}catch{}}_t()}function fe(){if(ie&&ie.isConnected){const B=ie,K=B.parentElement;if(K){for(;B.firstChild;)K.insertBefore(B.firstChild,B);K.removeChild(B)}Le(B);return}const y=window.getSelection();if(!y)return;if(ae){const B=b.value,K=B?m.get(`${B.row}-${B.col}`):null;K&&K.isConnected&&(y.removeAllRanges(),y.addRange(ae))}const w=bt();if(!w)return;const C=w.parentElement;if(C){for(;w.firstChild;)C.insertBefore(w.firstChild,w);C.removeChild(w);try{y.removeAllRanges(),ae&&ae.startContainer!==w&&y.addRange(ae)}catch{}_t()}}function _t(){const y=b.value;if(!y)return;const w=m.get(`${y.row}-${y.col}`);w&&X(y.row,y.col,w)}let Ve=!1;function _e(){var G,ee;if(!r.value){R.visible=!1,R.selectionRect=null;return}if(R.visible&&z())return;if(!b.value){const ne=window.getSelection();if(!ne||ne.rangeCount===0||ne.isCollapsed){R.visible=!1,R.selectionRect=null;return}const ye=ne.getRangeAt(0);if(!((G=ye.commonAncestorContainer.nodeType===1?ye.commonAncestorContainer:ye.commonAncestorContainer.parentElement)==null?void 0:G.closest(".table-cell-inner"))){R.visible=!1,R.selectionRect=null;return}return}const w=window.getSelection();if(!w||w.rangeCount===0||w.isCollapsed){R.visible=!1,R.selectionRect=null;return}const C=w.getRangeAt(0);if(!((ee=C.commonAncestorContainer.nodeType===1?C.commonAncestorContainer:C.commonAncestorContainer.parentElement)==null?void 0:ee.closest(".table-cell-inner"))){R.visible=!1,R.selectionRect=null;return}const K=C.getBoundingClientRect();if(K.width===0&&K.height===0){R.visible=!1,R.selectionRect=null;return}Ve||(R.visible=!0,R.selectionRect=K,I&&(clearTimeout(I),I=null),_.value=null)}function Ft(){Ve&&(Ve=!1,_e())}function Ct(y){const w=dt.value;if(!w)return y;const C=w.getBoundingClientRect();return new DOMRect(C.left+y.left-w.scrollLeft,C.top+y.top,y.width,y.height)}function Et(y){r.value&&(I&&(clearTimeout(I),I=null),S&&(clearTimeout(S),S=null),R.visible=!1,R.selectionRect=null,$=!1,_.value=Ct(y))}function je(y=150){S&&(clearTimeout(S),S=null),$=!1,I=setTimeout(()=>{_.value=null,I=null},y)}function ce(){const y=T.value;y&&y.focus()}function D(y){var C,B;const w=y.target;if(w.closest("a")&&w.closest(".table-cell-inner")){y.preventDefault();return}w.closest(".table-cell, .table-wrapper, table, .table-row-strip, .table-col-strip, .table-insert-dot, .table-corner-handle")||(y.stopPropagation(),W.value={kind:"none"},p.value=null,je(0),(B=(C=o.commands).selectBlock)==null||B.call(C,{id:s}))}function M(y,w){if(y.length!==w.length)return!1;for(let C=0;C<y.length;C++){const B=y[C],K=w[C];if(B.type!==K.type||"text"in B&&B.text!==K.text)return!1;const G=B.marks??[],ee=K.marks??[];if(G.length!==ee.length)return!1;for(let ne=0;ne<G.length;ne++){const ye=G[ne],he=ee[ne];if(ye.type!==he.type)return!1;const be=ye.attrs??{},ve=he.attrs??{},$e=Object.keys(be),Fe=Object.keys(ve);if($e.length!==Fe.length)return!1;for(const ct of $e)if(be[ct]!==ve[ct])return!1}}return!0}function X(y,w,C){var ye,he,be;const B=gn(C),K=ur(B),G=u.value,ee=(ye=G.cells[y])==null?void 0:ye[w];if(ee&&M(ee.content,K))return;const ne=Go(G,y,w,K);if((be=(he=o.commands).setAttrs)==null||be.call(he,{id:s,attrs:ne}),K!==B){const ve=eo(K);C.innerHTML!==ve&&(C.innerHTML=ve)}}function Oe(y,w,C,B){var G,ee,ne;if(R.visible&&z())return;const K=B==null?void 0:B.relatedTarget;if(!(K!=null&&K.closest(".link-popover"))&&!(K!=null&&K.closest(".hover-toolbar"))){if(R.visible){const ye=window.getSelection();if(ye&&ye.rangeCount>0&&!ye.isCollapsed){const he=ye.getRangeAt(0);if((G=he.commonAncestorContainer.nodeType===1?he.commonAncestorContainer:he.commonAncestorContainer.parentElement)==null?void 0:G.closest(".table-cell-inner"))return}}((ee=b.value)==null?void 0:ee.row)===y&&((ne=b.value)==null?void 0:ne.col)===w&&(b.value=null),R.visible=!1,R.selectionRect=null,qe(),X(y,w,C)}}function Ne(y){var B;if(R.visible&&z()){p.value&&(p.value=null),W.value.kind!=="none"&&(W.value={kind:"none"},je(0)),le(),Ae();return}const w=y.currentTarget,C=y.relatedTarget;if(!(C&&w.contains(C))&&!(C!=null&&C.closest(".link-popover"))&&!(C!=null&&C.closest(".hover-toolbar"))){if(R.visible){const K=window.getSelection();if(K&&K.rangeCount>0&&!K.isCollapsed){const G=K.getRangeAt(0);if((B=G.commonAncestorContainer.nodeType===1?G.commonAncestorContainer:G.commonAncestorContainer.parentElement)==null?void 0:B.closest(".table-cell-inner")){p.value&&(p.value=null),W.value.kind!=="none"&&(W.value={kind:"none"},je(0)),le(),Ae();return}}}p.value&&(p.value=null),W.value.kind!=="none"&&(W.value={kind:"none"},je(0)),b.value&&(b.value=null),qe(),le(),Ae()}}function Ie(y,w,C,B){var K,G,ee,ne,ye,he,be,ve,$e,Fe,ct,Kt,en;if(B.key==="Enter"&&!B.shiftKey&&!B.ctrlKey&&!B.metaKey){const lt=(K=u.value.cells[y])==null?void 0:K[w];if((lt==null?void 0:lt.cellType)==="codeBlock"){B.preventDefault(),B.stopPropagation();const Pe=window.getSelection();let vt=((G=C.textContent)==null?void 0:G.length)??0;if(Pe&&Pe.rangeCount>0){const ut=Pe.getRangeAt(0);if(C.contains(ut.startContainer)){const ft=document.createRange();ft.selectNodeContents(C);try{ft.setEnd(ut.startContainer,ut.startOffset),vt=ft.toString().length}catch{vt=((ee=C.textContent)==null?void 0:ee.length)??0}}}if(Pe&&Pe.rangeCount>0){const ut=Pe.getRangeAt(0);if(C.contains(ut.commonAncestorContainer)){ut.collapsed||ut.deleteContents();const ft=document.createTextNode(`
|
|
25
|
+
`);ut.insertNode(ft),ut.setStartAfter(ft),ut.collapse(!0),Pe.removeAllRanges(),Pe.addRange(ut)}}X(y,w,C);const qt=vt+1;n.nextTick(()=>{const ut=m.get(`${y}-${w}`);if(!ut)return;ut.focus();const ft=window.getSelection();if(!ft)return;const Vt=document.createRange();let En=0,Wt=!1;const Sn=kt=>{var Gn;if(!Wt)if(kt.nodeType===Node.TEXT_NODE){const Dn=((Gn=kt.textContent)==null?void 0:Gn.length)??0;En+Dn>=qt&&(Vt.setStart(kt,Math.max(0,qt-En)),Vt.collapse(!0),Wt=!0),En+=Dn}else for(const Dn of kt.childNodes)Sn(Dn)};Sn(ut),Wt||(Vt.selectNodeContents(ut),Vt.collapse(!1)),ft.removeAllRanges(),ft.addRange(Vt)});return}B.preventDefault(),B.stopPropagation(),X(y,w,C),b.value=null,R.visible=!1,R.selectionRect=null,qe(),C.blur(),W.value={kind:"cell",rect:{r1:y,c1:w,r2:y,c2:w}},p.value={anchor:{row:y,col:w},focus:{row:y,col:w}},ce(),n.nextTick(()=>{const Pe=at(y,w,y,w);Pe&&Et(Pe)});return}if(B.key==="Tab"){B.preventDefault(),B.stopPropagation(),qe();const lt=sb(u.value,y,w,B.shiftKey);if(!lt){if(ab(u.value,y,w)&&!B.shiftKey){const Wt=gn(C),Sn=u.value,kt=Go(Sn,y,w,Wt),Gn=Fi(kt,kt.rows);(ye=(ne=o.commands).setAttrs)==null||ye.call(ne,{id:s,attrs:Gn}),n.nextTick(()=>{const Dn=`${Gn.rows-1}-0`,Dt=m.get(Dn);Dt==null||Dt.focus(),Kl(Dt)});return}return}const{r:Pe,c:vt}=lt,qt=gn(C),ut=u.value,ft=(he=ut.cells[y])==null?void 0:he[w];let Vt=ut;ft&&(M(ft.content,qt)||(Vt=Go(ut,y,w,qt))),Vt!==ut&&((ve=(be=o.commands).setAttrs)==null||ve.call(be,{id:s,attrs:Vt})),n.nextTick(()=>{const En=`${Pe}-${vt}`,Wt=m.get(En);Wt==null||Wt.focus(),B.shiftKey?za(Wt):Kl(Wt)});return}if(B.key==="Backspace"){const lt=($e=u.value.cells[y])==null?void 0:$e[w],Pe=lt==null?void 0:lt.cellType;if(Pe&&Pe!=="paragraph"){const vt=window.getSelection();let qt=((Fe=C.textContent)==null?void 0:Fe.length)??0;if(vt&&vt.rangeCount>0){const ut=vt.getRangeAt(0);if(C.contains(ut.startContainer)){const ft=document.createRange();ft.selectNodeContents(C);try{ft.setEnd(ut.startContainer,ut.startOffset),qt=ft.toString().length}catch{qt=((ct=C.textContent)==null?void 0:ct.length)??0}}}if(qt===0&&(!C.textContent||C.textContent.trim()===""||(Pe==="bulletList"||Pe==="orderedList"||Pe==="todoList"))){B.preventDefault(),B.stopPropagation(),qe(),le(),Ae();const Vt=gn(C),En=u.value,Wt=Go(En,y,w,Vt),Sn=Yo(Wt,y,w,{cellType:"paragraph"});(en=(Kt=o.commands).setAttrs)==null||en.call(Kt,{id:s,attrs:Sn}),n.nextTick(()=>{const kt=m.get(`${y}-${w}`);kt&&(kt.focus(),za(kt))});return}}}B.key==="Escape"&&(B.preventDefault(),B.stopPropagation(),X(y,w,C),b.value=null,R.visible=!1,R.selectionRect=null,qe(),C.blur())}function Qt(y,w,C){b.value={row:y,col:w},p.value&&(p.value=null),W.value.kind!=="none"&&(W.value={kind:"none"},je(0))}function St(y){const w=y.target;if(!w)return null;const C=w.closest(".table-cell");if(!C)return null;const B=Number(C.getAttribute("data-row")??C.dataset.row),K=Number(C.getAttribute("data-col")??C.dataset.col);return!Number.isFinite(B)||!Number.isFinite(K)?null:{r:B,c:K,el:C}}function _n(y){if(!r.value)return;const w=y.target;if(!w)return;const C=w.closest(".table-cell-inner");if(!C)return;const B=C.closest(".table-cell");if(!B)return;const K=Number(B.getAttribute("data-row")),G=Number(B.getAttribute("data-col"));!Number.isFinite(K)||!Number.isFinite(G)||Ie(K,G,C,y)}function Ln(y){var he,be;const w=y.target;if(w.closest(".table-row-strip, .table-col-strip, .table-insert-dot, .table-corner-handle, .table-col-resizer")||w.tagName==="INPUT"&&w.classList.contains("table-cell-todo-checkbox")||w.classList.contains("table-cell-ol-marker"))return;const C=w.closest("a");if(C&&C.closest(".table-cell-inner")){y.preventDefault(),y.stopPropagation(),Je(C);return}Y.visible&&qe();const B=St(y);if(!B||y.button!==0)return;const K=b.value;if(K&&K.row===B.r&&K.col===B.c){Ve=!0,document.addEventListener("mouseup",Ft,{once:!0,capture:!0});return}y.preventDefault(),y.stopPropagation();const{r:G,c:ee}=B,ne=document.activeElement;ne&&ne.closest(".table-cell-inner")&&ne.blur(),b.value=null,(be=(he=o.commands).selectBlock)==null||be.call(he,{id:s}),ce(),N=_.value!==null,N&&($=!0,I&&(clearTimeout(I),I=null),S&&(clearTimeout(S),S=null)),W.value={kind:"none"},A=!0;const ye={row:G,col:ee};J.value={start:ye,current:ye},p.value={anchor:ye,focus:ye},document.addEventListener("mouseup",ot,!0)}function Mn(y){if(!A||!J.value)return;const w=St(y);if(!w)return;const{r:C,c:B}=w,K=J.value.current;if(C===K.row&&B===K.col)return;J.value={...J.value,current:{row:C,col:B}};const G=J.value.start;p.value={anchor:G,focus:{row:C,col:B}}}function ze(y){if(!r.value)return;const w=y.target;if(w.tagName==="INPUT"&&w.classList.contains("table-cell-todo-checkbox")||w.classList.contains("table-cell-ol-marker"))return;const C=St(y);if(!C)return;const{r:B,c:K}=C,G=b.value;G&&G.row===B&&G.col===K||(y.preventDefault(),y.stopPropagation(),S&&(clearTimeout(S),S=null),$=!1,A=!1,J.value=null,p.value=null,W.value={kind:"none"},je(0),document.removeEventListener("mouseup",ot,!0),b.value={row:B,col:K},n.nextTick(()=>{const ee=`${B}-${K}`,ne=m.get(ee);ne&&(ne.focus(),Kl(ne))}))}function ot(y){if(A&&J.value){const w=J.value.start,C=J.value.current,B=Math.min(w.row,C.row),K=Math.min(w.col,C.col),G=Math.max(w.row,C.row),ee=Math.max(w.col,C.col),ne=zn(u.value,B,K,G,ee),{r1:ye,c1:he,r2:be,c2:ve}=ne;if(W.value={kind:"cell",rect:{r1:ye,c1:he,r2:be,c2:ve}},p.value={anchor:{row:ye,col:he},focus:{row:be,col:ve}},ye!==be||he!==ve)n.nextTick(()=>{const Fe=at(ye,he,be,ve);Fe&&Et(Fe)});else if(N){const Fe=at(ye,he,be,ve);Fe&&Et(Fe)}else S&&clearTimeout(S),S=setTimeout(()=>{S=null;const Fe=at(ye,he,be,ve);Fe&&Et(Fe)},250)}A=!1,J.value=null,document.removeEventListener("mouseup",ot,!0)}function De(y){if(W.value.kind==="row"&&W.value.row===y){W.value={kind:"none"},p.value=null,je(0);return}_.value!==null&&($=!0);const w=u.value,C=w.cols,B=y,K=0,G=y,ee=Math.max(0,C-1),ne=C>0?zn(w,B,K,G,ee):{r1:B,c1:K,r2:G,c2:ee};W.value={kind:"row",row:y},p.value=C>0?{anchor:{row:ne.r1,col:ne.c1},focus:{row:ne.r2,col:ne.c2}}:null,b.value=null;const ye=document.activeElement;ye&&ye.closest(".table-cell-inner")&&ye.blur(),ce(),n.nextTick(()=>{const he=ht.value,be=he.rowTops[ne.r1]??0,ve=he.rowTops[ne.r2]??0,$e=he.rowHeights[ne.r2]??32,Fe=ve+$e-be,ct=he.colWidths.length>0?he.colWidths.reduce((lt,Pe)=>lt+Pe,0):w.colWidths.reduce((lt,Pe)=>lt+Pe,0),Kt=he.colLefts[0]??0,en=new DOMRect(Kt,be,ct,Fe);Et(en)})}function We(y){if(W.value.kind==="col"&&W.value.col===y){W.value={kind:"none"},p.value=null,je(0);return}_.value!==null&&($=!0);const w=u.value,C=w.rows,B=0,K=y,G=Math.max(0,C-1),ee=y,ne=C>0?zn(w,B,K,G,ee):{r1:B,c1:K,r2:G,c2:ee};W.value={kind:"col",col:y},p.value=C>0?{anchor:{row:ne.r1,col:ne.c1},focus:{row:ne.r2,col:ne.c2}}:null,b.value=null;const ye=document.activeElement;ye&&ye.closest(".table-cell-inner")&&ye.blur(),ce(),n.nextTick(()=>{const he=ht.value,be=he.colLefts[ne.c1]??0,ve=he.colLefts[ne.c2]??0,$e=he.colWidths[ne.c2]??80,Fe=ve+$e-be,ct=he.rowTops[0]??0,Kt=C>0?(he.rowTops[C-1]??0)+(he.rowHeights[C-1]??32)-ct:32,en=new DOMRect(be,ct,Fe,Kt);Et(en)})}function st(){if(W.value.kind==="all"){W.value={kind:"none"},p.value=null,je(0);return}_.value!==null&&($=!0);const y=u.value;if(y.rows===0||y.cols===0)return;W.value={kind:"all"};const w=zn(y,0,0,y.rows-1,y.cols-1);p.value={anchor:{row:w.r1,col:w.c1},focus:{row:w.r2,col:w.c2}},b.value=null;const C=document.activeElement;C&&C.closest(".table-cell-inner")&&C.blur(),ce(),n.nextTick(()=>{const B=ht.value,K=B.rowTops[0]??0,G=B.colLefts[0]??0,ee=B.colWidths.length>0?B.colWidths.reduce((be,ve)=>be+ve,0):y.colWidths.reduce((be,ve)=>be+ve,0),ne=B.rowTops[y.rows-1]??0,ye=B.rowHeights[y.rows-1]??32,he=new DOMRect(G,K,ee,ne+ye-K);Et(he)})}function at(y,w,C,B){const K=ht.value,G=K.rowTops[y]??0,ee=K.rowTops[C]??0,ne=K.rowHeights[C]??32,ye=ee+ne,he=K.colLefts[w]??0,be=K.colLefts[B]??0,ve=K.colWidths[B]??80,$e=be+ve;return new DOMRect(he,G,$e-he,ye-G)}n.onBeforeUnmount(()=>{document.removeEventListener("mouseup",ot,!0),document.removeEventListener("mouseup",Ft,!0),document.removeEventListener("mousemove",on,!0),document.removeEventListener("mouseup",Nn,!0),document.removeEventListener("keydown",et,!0),document.removeEventListener("selectionchange",_e),document.removeEventListener("mousedown",Tt,!0),window.removeEventListener("scroll",rt,!0),document.removeEventListener("touchmove",rt,!0),document.removeEventListener("mousedown",F,!0),document.removeEventListener("mouseup",j,!0),S&&(clearTimeout(S),S=null)});function et(y){var K,G;if(!r.value)return;const w=W.value;if(w.kind==="none")return;const C=document.activeElement;if(C!=null&&C.closest(".table-cell-inner"))return;if(y.key==="Escape"){y.preventDefault(),y.stopPropagation(),W.value={kind:"none"},p.value=null,je(0);return}if(y.key==="Delete"||y.key==="Backspace"){if(y.preventDefault(),y.stopPropagation(),w.kind==="row")Ee("tableRemoveRow",{row:w.row});else if(w.kind==="col")Ee("tableRemoveCol",{col:w.col});else if(w.kind==="all")Ee("tableDelete");else if(w.kind==="cell"){const{r1:ee,c1:ne,r2:ye,c2:he}=w.rect,be=[];let ve=u.value;for(let $e=ee;$e<=ye;$e++)for(let Fe=ne;Fe<=he;Fe++)ve=Go(ve,$e,Fe,be);(G=(K=o.commands).setAttrs)==null||G.call(K,{id:s,attrs:ve})}}}function Tt(y){if(!Y.visible&&!re.visible&&!xe.visible)return;const w=y.target;w.closest(".link-popover")||w.closest(".ordered-list-menu")||w.closest(".number-picker")||T.value&&T.value.contains(w)||(Y.visible&&qe(),re.visible&&le(),xe.visible&&Ae())}function rt(){if(Y.visible&&qe(),re.visible&&le(),xe.visible&&Ae(),_.value!==null&&p.value){const y=tr(p.value);if(y){const w=zn(u.value,y.r1,y.c1,y.r2,y.c2),C=at(w.r1,w.c1,w.r2,w.c2);C&&(_.value=Ct(C))}}}n.onMounted(()=>{document.addEventListener("keydown",et,!0),document.addEventListener("selectionchange",_e),document.addEventListener("mousedown",Tt,!0),document.addEventListener("mousedown",F,!0),document.addEventListener("mouseup",j,!0),window.addEventListener("scroll",rt,!0),document.addEventListener("touchmove",rt,{passive:!0,capture:!0})});const dt=n.ref(null),ht=n.ref({rowTops:[],rowHeights:[],colLefts:[],colWidths:[],wrapperOffsetLeft:0,wrapperOffsetTop:0,tableTotalWidth:0,tableTotalHeight:0});function Jt(){const y=h.value,w=dt.value,C=T.value;if(!y||!w||!C)return;const B=u.value.rows,K=u.value.cols,G=w.getBoundingClientRect(),ee=C.getBoundingClientRect(),ne=Math.round(G.left-ee.left),ye=Math.round(G.top-ee.top),he=Array.from(y.querySelectorAll("tr")),be=[],ve=[];for(const Pe of he){const vt=Pe.getBoundingClientRect();be.push(Math.round(vt.top-G.top)),ve.push(Math.round(vt.height))}for(;be.length<B;){const Pe=be.length>0?be[be.length-1]+ve[ve.length-1]:0;be.push(Pe),ve.push(ve.length>0?ve[ve.length-1]:32)}const $e=w.scrollLeft,Fe=[],ct=[],Kt=Array.from(y.querySelectorAll("colgroup > col"));if(Kt.length>0)for(const Pe of Kt){const vt=Pe.getBoundingClientRect();Fe.push(Math.round(vt.left-G.left+$e)),ct.push(Math.round(vt.width))}for(;Fe.length<K;){const Pe=Fe.length>0?Fe[Fe.length-1]+ct[ct.length-1]:0;Fe.push(Pe),ct.push(ct.length>0?ct[ct.length-1]:80)}const en=ct.reduce((Pe,vt)=>Pe+vt,0),lt=ve.reduce((Pe,vt)=>Pe+vt,0);ht.value={rowTops:be,rowHeights:ve,colLefts:Fe,colWidths:ct,wrapperOffsetLeft:ne,wrapperOffsetTop:ye,tableTotalWidth:en,tableTotalHeight:lt},g()}n.watchEffect(()=>{var y,w;u.value.rows,u.value.cols,u.value.headerRow,(y=b.value)==null||y.row,(w=b.value)==null||w.col,n.nextTick(()=>{P.value===null&&Jt()})});let $t=null;n.onMounted(()=>{var w;$t=new ResizeObserver(()=>{P.value===null&&(Jt(),g())}),dt.value&&$t.observe(dt.value),h.value&&$t.observe(h.value);const y=(w=T.value)==null?void 0:w.closest(".block-editor");y&&$t.observe(y),dt.value&&dt.value.addEventListener("scroll",H,{passive:!0}),g()}),n.onBeforeUnmount(()=>{var y;$t==null||$t.disconnect(),dt.value&&dt.value.removeEventListener("scroll",H),wn&&cancelAnimationFrame(wn),L&&clearTimeout(L),i&&((y=i.value)==null?void 0:y.blockId)===s&&(i.value=null)});function Wn(y,w){if(!r.value)return;w.preventDefault(),w.stopPropagation(),P.value=y,te=ht.value.colWidths[y]??80,U=w.clientX,document.addEventListener("mousemove",on,!0),document.addEventListener("mouseup",Nn,!0),document.body.style.cursor="col-resize",document.body.style.userSelect="none"}function on(y){var G,ee;if(P.value===null)return;const w=y.clientX-U;let C=Math.max(40,Math.round(te+w));const B=dt.value;if(B){const ne=B.clientWidth-4,ye=u.value.colWidths.reduce((be,ve,$e)=>$e===P.value?be:be+ve,0);if(ye+C<=ne){const be=Math.max(40,ne-ye);C=Math.min(C,be)}}const K=Wi(u.value,P.value,C);(ee=(G=o.commands).setAttrs)==null||ee.call(G,{id:s,attrs:K})}function Nn(){P.value=null,document.removeEventListener("mousemove",on,!0),document.removeEventListener("mouseup",Nn,!0),document.body.style.cursor="",document.body.style.userSelect="",n.nextTick(()=>{Jt(),g()})}const yn=n.ref(0),fo=n.ref(0),po=n.ref(0),On=n.ref(!1);let wn=0,L;function g(){const y=dt.value;y&&(yn.value=y.scrollLeft,fo.value=y.clientWidth,po.value=y.scrollWidth)}function H(){On.value||(On.value=!0),wn&&cancelAnimationFrame(wn),wn=requestAnimationFrame(()=>{wn=0,g()}),L&&clearTimeout(L),L=setTimeout(()=>{On.value=!1,g()},130)}const ue=n.computed(()=>{if(!r.value)return[];const y=ht.value,w=u.value.cols,C=y.colLefts,B=y.colWidths;if(w===0||C.length<w||B.length<w)return[];const K=yn.value,G=fo.value,ee=po.value;if(G<=0)return[];const ne=K<=0,ye=K+G>=ee-1,he=ee<=G+1,be=6,ve=[];for(let $e=0;$e<=w;$e++){const ct=($e===0?C[0]??0:$e===w?(C[w-1]??0)+(B[w-1]??0):C[$e]??0)-K;let Kt=ct>=-1&&ct<=G+1;if($e===0&&(ne||he)&&(Kt=!0),$e===w&&(ye||he)&&(Kt=!0),!Kt)continue;const en=Math.max(be,Math.min(ct,G-be))+($e>0?2:-2);ve.push({c:$e,left:en})}return ve});function Ee(y,w){var B,K;const C={id:s,...w};(K=(B=o.commands)[y])==null||K.call(B,C)}function Be(){b.value=null,p.value=null,W.value.kind!=="none"&&(W.value={kind:"none"}),je(0),le(),Ae()}return t({clearInnerFocus:Be}),()=>{var Ya,Za,Xa,ja,Qa,Ja,ec,tc,nc,oc,rc;const y=u.value,w=y.rows,C=y.cols,B=tr(p.value),K=B?zn(y,B.r1,B.c1,B.r2,B.c2):null,G=ht.value,ee=W.value,ne=[],ye=n.h("div",{class:"table-toolbar"},[n.h("div",{class:"table-toolbar-title"},[n.h(Xt,{html:Sr,class:"table-toolbar-icon"}),n.h("span",l.t("table.title"))])]),he=[];for(let Z=0;Z<C;Z++){const we=y.colWidths[Z]??0,Ce={};we&&we>0&&(Ce.width=`${we}px`),he.push(n.h("col",{"data-col":Z,style:Ce}))}const be=n.h("colgroup",{},he),ve=[],$e=[],Fe=y.headerRow?0:-1;for(let Z=0;Z<w;Z++){const we=[];for(let Ce=0;Ce<C;Ce++){const ke=(Ya=y.cells[Z])==null?void 0:Ya[Ce];if(!ke||ke.covered)continue;const Ge=`${Z}-${Ce}`,An=Fe===0&&Z===0,Ro=!!K&&cb(Z,Ce,K),Lo=ee.kind==="row"&&ee.row===Z,Oo=ee.kind==="col"&&ee.col===Ce,or=ee.kind==="all",Ib=Ro||Lo||Oo||or;let Gl=eo(ke.content);ke.cellType==="codeBlock"&&Gl.endsWith(`
|
|
26
|
+
`)&&(Gl+="<br>");const ho=["table-cell"];An&&ho.push("table-cell-header"),Ro&&ho.push("table-cell-selected"),(Lo||Oo||or)&&ho.push("table-cell-selected"),typeof ke.align=="string"&&ke.align!=="left"&&ho.push(`be-align-${ke.align}`),typeof ke.bgColor=="string"&&ke.bgColor!=="default"&&ho.push(`be-bg-${ke.bgColor}`);const lc=ke.verticalAlign??"middle";let ic;lc!=="top"&&(ic={verticalAlign:lc});const sc=!Ib&&((Za=b.value)==null?void 0:Za.row)===Z&&((Xa=b.value)==null?void 0:Xa.col)===Ce;sc&&ho.push("table-cell-focused");const Cn=["table-cell-inner"],sn=ke.cellType;sn==="heading"||sn==="heading1"?Cn.push("table-cell-heading","table-cell-h1"):sn==="heading2"?Cn.push("table-cell-heading","table-cell-h2"):sn==="heading3"?Cn.push("table-cell-heading","table-cell-h3"):sn==="heading4"?Cn.push("table-cell-heading","table-cell-h4"):sn==="heading5"?Cn.push("table-cell-heading","table-cell-h5"):sn==="heading6"?Cn.push("table-cell-heading","table-cell-h6"):sn==="bulletList"?Cn.push("table-cell-bullet"):sn==="orderedList"?Cn.push("table-cell-ordered"):sn==="todoList"?(Cn.push("table-cell-todo"),ke.checked&&Cn.push("todo-checked")):sn==="quote"?Cn.push("table-cell-quote"):sn==="codeBlock"&&Cn.push("table-cell-code");const ac=sn==="orderedList"?tl(y,Z,Ce):-1,Yl=n.h("div",{class:Cn,contenteditable:sc&&r.value?"true":"false","data-placeholder":l.t("table.cellPlaceholder"),innerHTML:Gl,ref:In=>{In instanceof HTMLDivElement?m.set(Ge,In):m.delete(Ge)},onBlur:In=>Oe(Z,Ce,In.currentTarget,In),onFocus:In=>Qt(Z,Ce,In.currentTarget)});let Lr;if(sn==="todoList"){const In=n.h("input",{type:"checkbox",class:"table-cell-todo-checkbox",checked:!!ke.checked,onClick:Xn=>{Xn.stopPropagation()},onchange:Xn=>{var cc,dc;if(!r.value)return;const Zl=Xn.target,Rb=Yo(u.value,Z,Ce,{checked:Zl.checked});(dc=(cc=o.commands).setAttrs)==null||dc.call(cc,{id:s,attrs:Rb})}});Lr=[n.h("div",{class:"table-cell-todo-wrapper"},[In,Yl])]}else if(sn==="orderedList"&&ac>=1){const In=n.h("div",{class:"ol-marker table-cell-ol-marker",onMousedown:Xn=>{Xn.preventDefault(),Xn.stopPropagation()},onClick:Xn=>{Xn.stopPropagation();const Zl=Xn.currentTarget;Xe(Z,Ce,Zl)}},`${ac}.`);Lr=[n.h("div",{class:"block-ordered-list-wrapper"},[In,Yl])]}else Lr=[Yl];const Bb=n.h(An?"th":"td",{rowspan:ke.rowspan>1?ke.rowspan:void 0,colspan:ke.colspan>1?ke.colspan:void 0,class:ho,style:ic,"data-row":Z,"data-col":Ce},Lr);we.push(Bb)}Fe===0&&Z===0?ve.push(n.h("tr",{class:"table-row table-row-head"},we)):$e.push(n.h("tr",{class:"table-row"},we))}const ct=[be];ve.length>0&&ct.push(n.h("thead",{},ve)),ct.push(n.h("tbody",{},$e));const Kt=n.h("table",{ref:h,class:"block-table-grid"},ct),en=[];for(let Z=0;Z<w;Z++){const we=G.rowTops[Z],Ce=G.rowHeights[Z]??32,ke=ee.kind==="row"&&ee.row===Z;en.push(n.h("div",{class:`table-row-strip${ke?" is-selected":""}`,"data-row":Z,style:{top:`${we}px`,height:`${Ce}px`},title:l.t("table.selectRow"),onClick:Ge=>{Ge.preventDefault(),De(Z)}}))}const lt=P.value!==null,Pe=[],vt=[];let qt;if(lt){const Z=y.colWidths;let we=0;for(let Ce=0;Ce<C;Ce++){Pe.push(we);const ke=Z[Ce]??80;vt.push(ke),we+=ke}qt=we}else{for(let Z=0;Z<C;Z++)Pe.push(G.colLefts[Z]??0),vt.push(G.colWidths[Z]??0);qt=G.tableTotalWidth}const ut=[];for(let Z=0;Z<C;Z++){const we=Pe[Z],Ce=vt[Z]??0,ke=ee.kind==="col"&&ee.col===Z;ut.push(n.h("div",{class:`table-col-strip${ke?" is-selected":""}`,"data-col":Z,style:{left:`${we}px`,width:`${Ce}px`},title:l.t("table.selectCol"),onClick:Ge=>{Ge.preventDefault(),We(Z)}}))}const ft=[];if(r.value)for(let Z=0;Z<=w;Z++){let we;if(Z===0)we=(G.rowTops[0]??0)+3;else if(Z===w){const Ce=G.rowTops[Z-1]??0,ke=G.rowHeights[Z-1]??32;we=Ce+ke+2}else{const Ce=(G.rowTops[Z-1]??0)+(G.rowHeights[Z-1]??32),ke=G.rowTops[Z]??0;we=Math.round((Ce+ke)/2)}ft.push(n.h("div",{class:"table-insert-dot table-insert-dot-row",style:{top:`${we}px`},title:Z<w?l.t("table.insertRowAbove"):l.t("table.insertRowBelow"),onClick:Ce=>{Ce.preventDefault(),Ce.stopPropagation(),Ee("tableInsertRow",{beforeRow:Z})}}))}const Vt=[];for(let Z=0;Z<C;Z++){const we=Pe[Z]??0,Ce=vt[Z]??0;Vt.push(n.h("div",{class:"table-col-resize-item",style:{left:`${we}px`,width:`${Ce}px`}},[n.h("div",{class:"table-col-resizer",title:l.t("table.resizeCol"),onMousedown:ke=>Wn(Z,ke)})]))}const En=n.h("div",{class:"table-corner-handle",title:l.t("table.selectAll"),onClick:Z=>{Z.preventDefault(),st()}});ne.push(ye,En),ne.push(n.h("div",{class:"table-row-handles",style:{height:`${G.tableTotalHeight}px`}},[...en,...ft])),ne.push(n.h("div",{class:"table-wrapper",ref:dt},[n.h("div",{class:"table-col-handles",style:{width:`${qt}px`}},[...ut]),n.h("div",{class:"table-col-resizers"},Vt),Kt])),ne.push(n.h("div",{class:["table-col-insert-dots",On.value||P.value!==null?"is-scrolling":""]},ue.value.map(Z=>n.h("div",{class:"table-insert-dot table-insert-dot-col",style:{left:`${Z.left}px`},title:Z.c<C?l.t("table.insertColLeft"):l.t("table.insertColRight"),onClick:we=>{we.preventDefault(),we.stopPropagation(),Ee("tableInsertCol",{beforeCol:Z.c})}}))));const Wt=_.value,Sn=ee.kind==="row"||ee.kind==="col"||ee.kind==="all",kt=tr(p.value),Gn=kt?zn(u.value,kt.r1,kt.c1,kt.r2,kt.c2):null,Dn=b.value?{r1:b.value.row,c1:b.value.col,r2:b.value.row,c2:b.value.col}:null,Dt=Gn??Dn,ql=(Dt?Dd(u.value,Dt.r1,Dt.c1,Dt.r2,Dt.c2):0)>=2,Ar=Dt?zi(u.value,Dt.r1,Dt.c1,Dt.r2,Dt.c2):!1,Yn=ee.kind==="row"?l.t("table.deleteRow"):ee.kind==="col"?l.t("table.deleteCol"):ee.kind==="all"?l.t("table.deleteTable"):"",Wl=ee.kind==="row"?ob:ee.kind==="col"?rb:Ua,Io=()=>{ee.kind==="row"?Ee("tableRemoveRow",{row:ee.row}):ee.kind==="col"?Ee("tableRemoveCol",{col:ee.col}):Ee("tableDelete")},Bo=()=>{Dt&&Ee("tableMergeCells",Dt)},Ir=()=>{Dt&&Ee("tableSplitCellsInRect",Dt)},Br=()=>{Ee("tableToggleHeaderRow")},Rr=()=>{W.value={kind:"none"},p.value=null,je(0)};function k(){var Ce;const Z=tr(p.value);if(!Z)return[];const we=[];for(let ke=Z.r1;ke<=Z.r2;ke++)for(let Ge=Z.c1;Ge<=Z.c2;Ge++){const An=(Ce=u.value.cells[ke])==null?void 0:Ce[Ge];An&&!An.covered&&we.push({row:ke,col:Ge})}return we}const V=k().map(Z=>{var we;return(we=u.value.cells[Z.row])==null?void 0:we[Z.col]}).filter(Z=>!!Z&&!Z.covered),q=new Set(V.map(Z=>Z.cellType??"paragraph"));let Q="paragraph",se;if(q.size===1){const Z=[...q][0];Z==="heading"||Z==="heading1"?(Q="heading",se=1):Z==="heading2"?(Q="heading",se=2):Z==="heading3"?(Q="heading",se=3):Z==="heading4"?(Q="heading",se=4):Z==="heading5"?(Q="heading",se=5):Z==="heading6"?(Q="heading",se=6):Z==="bulletList"?Q="bulletList":Z==="orderedList"?Q="orderedList":Z==="todoList"?Q="todoList":Z==="quote"?Q="quote":Z==="codeBlock"&&(Q="codeBlock")}const ge=new Set(V.map(Z=>Z.align??"left")),me={align:ge.size===1?[...ge][0]:"left"},Te=new Set(V.map(Z=>Z.verticalAlign??"middle")),Se=Te.size===1?[...Te][0]:"middle";me.verticalAlign=Se,se!==void 0&&(me.level=se);const He=["bold","italic","underline","strikethrough","code"],Ze=new Set;for(const Z of He){let we=!0,Ce=!1;for(const ke of V){for(const Ge of ke.content)if(Ge.type==="text"&&(Ce=!0,!((ja=Ge.marks)!=null&&ja.some(An=>An.type===Z)))){we=!1;break}if(!we)break}Ce&&we&&Ze.add(Z)}const tt=new Set;for(const Z of V)for(const we of Z.content){if(we.type!=="text")continue;const Ce=(Qa=we.marks)==null?void 0:Qa.find(Ge=>Ge.type==="color"),ke=(Ja=Ce==null?void 0:Ce.attrs)==null?void 0:Ja.color;typeof ke=="string"&&tt.add(ke)}const Ke=tt.size===1?[...tt][0]:"",Ue=new Set(V.map(Z=>Z.bgColor??"")),it=Ue.size===1?[...Ue][0]:"";if((ee.kind==="row"||ee.kind==="col"||ee.kind==="all"||V.length>0)&&!$){E.blockType=Q,E.blockAttrs={...me},E.marks.clear();for(const Z of Ze)E.marks.add(Z);E.textColor=Ke,E.bgColor=it,E.verticalAlign=Se,E.showDelete=Sn,E.deleteLabel=Yn,E.deleteIcon=Wl,E.showMerge=ql,E.showSplit=Ar,E.showHeaderRow=ee.kind==="all",E.headerRowActive=!!u.value.headerRow}const Pt=Z=>{var ke,Ge;const we=k();if(we.length===0)return;const Ce=io(u.value,we,{cellType:Z});(Ge=(ke=o.commands).setAttrs)==null||Ge.call(ke,{id:s,attrs:Ce})},yt=Z=>{var ke,Ge;const we=k();if(we.length===0)return;const Ce=io(u.value,we,{align:Z});(Ge=(ke=o.commands).setAttrs)==null||Ge.call(ke,{id:s,attrs:Ce})},xt=Z=>{var ke,Ge;const we=k();if(we.length===0)return;const Ce=io(u.value,we,{verticalAlign:Z});(Ge=(ke=o.commands).setAttrs)==null||Ge.call(ke,{id:s,attrs:Ce})},wt=Z=>{var ke,Ge;const we=k();if(we.length===0)return;const Ce=zd(u.value,we,Z);(Ge=(ke=o.commands).setAttrs)==null||Ge.call(ke,{id:s,attrs:Ce})},Bt=Z=>{var ke,Ge;const we=k();if(we.length===0)return;const Ce=Ki(u.value,we,"color",Z?{color:Z}:null);(Ge=(ke=o.commands).setAttrs)==null||Ge.call(ke,{id:s,attrs:Ce})},rn=Z=>{var ke,Ge;const we=k();if(we.length===0)return;const Ce=io(u.value,we,{bgColor:Z??"default"});(Ge=(ke=o.commands).setAttrs)==null||Ge.call(ke,{id:s,attrs:Ce})},ln=()=>{var ke,Ge;const Z=tr(p.value);if(!Z)return;const we=[];for(let An=Z.r1;An<=Z.r2;An++){const Ro=[];for(let Lo=Z.c1;Lo<=Z.c2;Lo++){const Oo=(ke=u.value.cells[An])==null?void 0:ke[Lo];Oo&&!Oo.covered?Ro.push(Oo.content.map(or=>or.type==="text"?or.text:"").join("")):Ro.push("")}we.push(Ro.join(" "))}const Ce=we.join(`
|
|
27
|
+
`);Ce&&((Ge=navigator.clipboard)==null||Ge.writeText(Ce))},mo={visible:!!Wt,selectionRect:Wt,blockId:s,blockType:E.blockType,blockAttrs:E.blockAttrs,rootEl:document.querySelector(".block-editor"),tableMode:!0,tableActiveMarks:E.marks,tableActiveColor:E.textColor,tableActiveBgColor:E.bgColor,tableActiveVerticalAlign:E.verticalAlign,showDelete:E.showDelete,deleteLabel:E.deleteLabel,deleteIcon:E.deleteIcon,showMerge:E.showMerge,showSplit:E.showSplit,showHeaderRow:E.showHeaderRow,headerRowActive:E.headerRowActive,onDelete:Io,onMerge:Bo,onSplit:Ir,onTableHeaderRow:Br,onClose:Rr,onTableType:Pt,onTableAlign:yt,onTableVerticalAlign:xt,onTableMark:wt,onTableTextColor:Bt,onTableBgColor:rn,onTableCopy:ln};i&&(mo.visible?f(mo):((ec=i.value)==null?void 0:ec.blockId)===s&&!((tc=i.value)!=null&&tc.cellEditMode)&&f(null));const Yt=b.value,vn=Yt?(nc=u.value.cells[Yt.row])==null?void 0:nc[Yt.col]:void 0,pn=vn==null?void 0:vn.cellType;let mn="paragraph";const Zn={};pn==="heading"||pn==="heading1"?(mn="heading",Zn.level=1):pn==="heading2"?(mn="heading",Zn.level=2):pn==="heading3"?(mn="heading",Zn.level=3):pn==="heading4"?(mn="heading",Zn.level=4):pn==="heading5"?(mn="heading",Zn.level=5):pn==="heading6"?(mn="heading",Zn.level=6):pn==="bulletList"?mn="bulletList":pn==="orderedList"?mn="orderedList":pn==="todoList"?mn="todoList":pn==="quote"?mn="quote":pn==="codeBlock"&&(mn="codeBlock"),typeof(vn==null?void 0:vn.align)=="string"&&(Zn.align=vn.align),typeof(vn==null?void 0:vn.verticalAlign)=="string"&&(Zn.verticalAlign=vn.verticalAlign);const Ga={visible:R.visible&&!!R.selectionRect,selectionRect:R.selectionRect,blockId:s,blockType:mn,blockAttrs:Zn,rootEl:document.querySelector(".block-editor"),cellEditMode:!0,onClose:()=>{R.visible=!1,R.selectionRect=null},onTableType:Z=>{var Ce,ke;if(!Yt)return;const we=io(u.value,[{row:Yt.row,col:Yt.col}],{cellType:Z});(ke=(Ce=o.commands).setAttrs)==null||ke.call(Ce,{id:s,attrs:we})},onTableAlign:Z=>{var Ce,ke;if(!Yt)return;const we=io(u.value,[{row:Yt.row,col:Yt.col}],{align:Z});(ke=(Ce=o.commands).setAttrs)==null||ke.call(Ce,{id:s,attrs:we})},onTableVerticalAlign:Z=>{var Ce,ke;if(!Yt)return;const we=io(u.value,[{row:Yt.row,col:Yt.col}],{verticalAlign:Z});(ke=(Ce=o.commands).setAttrs)==null||ke.call(Ce,{id:s,attrs:we})},onLinkClick:()=>{It()}};return i&&(Ga.visible?f(Ga):((oc=i.value)==null?void 0:oc.blockId)===s&&((rc=i.value)!=null&&rc.cellEditMode)&&f(null)),ne.push(n.h(Ts,{visible:Y.visible,anchorRect:Y.anchorRect,blockId:null,from:0,to:0,href:Y.href,text:Y.text,initialMode:Y.initialMode,showTextInput:Y.showTextInput,readonly:!r.value,onSaveLink:(Z,we)=>{mt(Z,we),Y.href=Z,we!==void 0&&(Y.text=we)},onRemoveLinkMark:()=>{fe()},onClose:()=>{qe()}})),ne.push(n.h(Es,{visible:re.visible,blockId:null,anchor:re.anchor,rootEl:document.querySelector(".block-editor"),canContinue:re.canContinue,canStartNew:re.canStartNew,currentNumber:re.currentNumber,onContinue:At,onStartNew:nn,onModify:Gt,onClose:le})),ne.push(n.h(vs,{visible:xe.visible,initialValue:xe.initialValue,anchor:xe.anchor,rootEl:document.querySelector(".block-editor"),onConfirm:Ot,onClose:Ae})),n.h("div",{class:["block-table-container","block-focus-root",...bn(e.block.attrs)],ref:T,tabindex:"-1",onClick:D,onMousedown:Ln,onMouseover:Mn,onDblclick:ze,onFocusout:Ne,onKeydown:_n},ne)}}});function sb(e,t,o,r){var i;const l=[];for(let a=0;a<e.rows;a++)for(let c=0;c<e.cols;c++){const d=(i=e.cells[a])==null?void 0:i[c];d&&!d.covered&&l.push({r:a,c})}const s=l.findIndex(a=>a.r===t&&a.c===o);return s===-1?null:r?s===0?null:l[s-1]??null:s===l.length-1?null:l[s+1]??null}function ab(e,t,o){var l;let r=null;for(let s=0;s<e.rows;s++)for(let i=0;i<e.cols;i++){const a=(l=e.cells[s])==null?void 0:l[i];a&&!a.covered&&(r={r:s,c:i})}return r!==null&&r.r===t&&r.c===o}function Kl(e){if(!e)return;e.focus();const t=document.createRange();t.selectNodeContents(e),t.collapse(!1);const o=window.getSelection();o==null||o.removeAllRanges(),o==null||o.addRange(t)}function za(e){if(!e)return;e.focus();const t=document.createRange();t.selectNodeContents(e),t.collapse(!0);const o=window.getSelection();o==null||o.removeAllRanges(),o==null||o.addRange(t)}function tr(e){if(!e)return null;const t=e.anchor,o=e.focus,r=Math.min(t.row,o.row),l=Math.max(t.row,o.row),s=Math.min(t.col,o.col),i=Math.max(t.col,o.col);return{r1:r,c1:s,r2:l,c2:i}}function cb(e,t,o){return e>=o.r1&&e<=o.r2&&t>=o.c1&&t<=o.c2}function nr(e,t){return null}function qn(e,t,o,r){const l=e.doc.blocks.get(t);if(!l||l.type!=="table")return!1;const s=Wo(l.attrs),i=r(s),a=Ye();return a.setAttrs(t,i),o==null||o(a.build()),!0}function db(){return{name:"tableInsertRow",run:e=>(t,o)=>{const r=t.doc.blocks.get(e.id);if(!r||r.type!=="table")return!1;const l=so(r.attrs);nr(t,e.id);const s=e.beforeRow??l.rows;return qn(t,e.id,o,i=>Fi(i,s))}}}function ub(){return{name:"tableRemoveRow",run:e=>(t,o)=>{const r=t.doc.blocks.get(e.id);if(!r||r.type!=="table")return!1;const l=so(r.attrs);nr(t,e.id);const s=e.row??l.rows-1;return qn(t,e.id,o,i=>Hd(i,s))}}}function fb(){return{name:"tableInsertCol",run:e=>(t,o)=>{const r=t.doc.blocks.get(e.id);if(!r||r.type!=="table")return!1;const l=so(r.attrs);nr(t,e.id);const s=e.beforeCol??l.cols;return qn(t,e.id,o,i=>Vd(i,s))}}}function pb(){return{name:"tableRemoveCol",run:e=>(t,o)=>{const r=t.doc.blocks.get(e.id);if(!r||r.type!=="table")return!1;const l=so(r.attrs);nr(t,e.id);const s=e.col??l.cols-1;return qn(t,e.id,o,i=>Ud(i,s))}}}function mb(){return{name:"tableToggleHeaderRow",run:e=>(t,o)=>{const r=t.doc.blocks.get(e.id);return!r||r.type!=="table"?!1:qn(t,e.id,o,qd)}}}function hb(){return{name:"tableMergeCells",run:e=>(t,o)=>{const r=t.doc.blocks.get(e.id);if(!r||r.type!=="table")return!1;const l=so(r.attrs);nr(t,e.id);const s=e.r1??0,i=e.c1??0;let a=e.r2??0,c=e.c2??0;if(s===a&&i===c&&(a+1<l.rows&&(a=s+1),c+1<l.cols&&(c=i+1),s===a&&i===c))return!1;const d=zn(l,s,i,a,c);return d.r1===d.r2&&d.c1===d.c2?!1:qn(t,e.id,o,f=>Fd(f,d.r1,d.c1,d.r2,d.c2))}}}function gb(){return{name:"tableSplitCell",run:e=>(t,o)=>{const r=t.doc.blocks.get(e.id);return!r||r.type!=="table"?!1:qn(t,e.id,o,l=>qi(l,e.row,e.col))}}}function bb(){return{name:"tableSplitCellsInRect",run:e=>(t,o)=>{const r=t.doc.blocks.get(e.id);if(!r||r.type!=="table")return!1;const l=so(r.attrs),s=zn(l,e.r1,e.c1,e.r2,e.c2);return zi(l,s.r1,s.c1,s.r2,s.c2)?qn(t,e.id,o,i=>Kd(i,s.r1,s.c1,s.r2,s.c2)):!1}}}function kb(){return{name:"tableSetColWidth",run:e=>(t,o)=>{const r=t.doc.blocks.get(e.id);return!r||r.type!=="table"?!1:qn(t,e.id,o,l=>Wi(l,e.col,e.width))}}}function yb(){return{name:"tableDelete",run:e=>(t,o)=>{const r=t.doc.blocks.get(e.id);if(!r||r.type!=="table")return!1;const l=Ye();return l.removeBlock(e.id),o==null||o(l.build()),!0}}}function wb(){return{name:"insertTable",run:e=>(t,o)=>{const r=e.rows??3,l=e.cols??3,s=Math.max(1,Math.min(50,Number.isInteger(r)?r:3)),i=Math.max(1,Math.min(20,Number.isInteger(l)?l:3)),a=$d(s,i),d={rows:s,cols:i,cells:Fn(a,s,i),colWidths:new Array(i).fill(120),headerRow:!0};let f=null,u=t.doc.root.length,m=null;if(e.replaceCurrent){const P=t.selection,U=P.kind==="caret"?P.blockId:P.kind==="text"?P.focus.blockId:P.blockIds[0]??null;U&&(m=U)}if(m&&(t.doc.blocks.get(m)?(f=Rt(t.doc,m),u=cn(t.doc,m)):m=null),!m)if(e.after){if(!t.doc.blocks.get(e.after))return!1;f=Rt(t.doc,e.after),u=cn(t.doc,e.after)+1}else{const P=t.selection,U=P.kind==="caret"?P.blockId:P.kind==="text"?P.focus.blockId:P.blockIds[0]??null;U&&(f=Rt(t.doc,U),u=cn(t.doc,U)+1)}const h=Ye();m&&h.removeBlock(m);const p=f===null?0:Pn(t.doc,f)+1,b=p>0?{...d,indent:p}:d,x=h.insertBlock({parent:f,index:u,type:"table",attrs:b,content:[]}),O=lr(t.doc,h.peek()),z=yo(O.doc,x),F=Hn(O.doc,x),j=z??F;return j?h.setSelection(Qe(j.id,0)):h.setSelection(Qe(x,0)),o==null||o(h.build()),!0}}}const Fa={name:"table",schema:{type:"table",content:"none",nestable:!1,isolating:!0,inlineMarks:!1,attrs:{...lb},empty:e=>{var o;const t=Wo(e.attrs);for(let r=0;r<t.rows;r++)for(let l=0;l<t.cols;l++){const s=(o=t.cells[r])==null?void 0:o[l];if(!(!s||s.covered)){for(const i of s.content)if(i.type==="text"&&i.text.length>0)return!1}}return!0}},renderer:{component:ib,editable:!1},commands:[db(),ub(),fb(),pb(),mb(),hb(),gb(),bb(),kb(),yb(),wb()],slashCommands:[{id:"table-3x3",title:"slash.table3x3.title",keywords:["table","grid","spreadsheet","表格","数据表","网格"],description:"slash.table3x3.description",icon:Sr,command:"insertTable",category:"other",args:()=>({rows:3,cols:3,replaceCurrent:!0})},{id:"table-2x2",title:"slash.table2x2.title",keywords:["table","grid","表格","2行2列"],description:"slash.table2x2.description",icon:Sr,command:"insertTable",category:"other",args:()=>({rows:2,cols:2,replaceCurrent:!0})},{id:"table-4x4",title:"slash.table4x4.title",keywords:["table","grid","表格","4行4列"],description:"slash.table4x4.description",icon:Sr,command:"insertTable",category:"other",args:()=>({rows:4,cols:4,replaceCurrent:!0})}],serialize:{toHTML:e=>{if(e.type!=="table")return"";const t=Wo(e.attrs);return Gd(t)},toMarkdown:e=>{if(e.type!=="table")return"";const t=Wo(e.attrs);return Wd(t)}}},Eb=n.defineComponent({name:"DividerBlock",props:{block:{type:Object,required:!0},placeholder:{type:String,default:void 0}},setup(e){return e.placeholder,()=>n.h("div",{class:["block-divider","block-focus-root",...bn(e.block.attrs)],"data-block-divider":!0})}}),Ka={name:"divider",schema:{type:"divider",content:"none",nestable:!1,inlineMarks:!1,attrs:{indent:jt.indent},empty:()=>!1},renderer:{component:Eb,editable:!1},slashCommands:[{id:"divider",title:"slash.divider.title",keywords:["divider","separator","hr","horizontal","line","分隔符","分割线","水平线","横线"],description:"slash.divider.description",icon:$u,command:"convertBlock",category:"basic",args:()=>({id:"__currentBlock__",type:"divider"})}],inputRules:[{name:"divider-md-thematic-break",pattern:/^(?:-{3,}|\*{3,}|_{3,})\s*$/,command:"convertBlock",args:()=>({id:"__currentBlock__",type:"divider"})}],serialize:{toHTML:()=>"<hr/>",toMarkdown:()=>"---"},deserialize:{fromMarkdown:e=>{const t=e.trim();return/^-{3,}$/.test(t)||/^\*{3,}$/.test(t)||/^_{3,}$/.test(t)?{type:"divider"}:null}}};function vb(e){const t=[];for(const o of e.root){const r=e.blocks.get(o);if(!r||r.type!=="heading")continue;const l=Me(r.content).trim();if(l.length===0)continue;const s=typeof r.attrs.level=="number"?r.attrs.level:1;t.push({id:o,level:Math.max(1,Math.min(6,Math.floor(s))),text:l})}return t}const Cb=n.defineComponent({name:"TableOfContentsBlock",props:{block:{type:Object,required:!0},placeholder:{type:String,default:void 0}},setup(e){e.block,e.placeholder;const t=dn(),o=Zt(),r=n.ref(null),l=n.ref(0),s=n.computed(()=>(l.value,vb(t.getState().doc)));let i=null;n.onMounted(()=>{i=t.subscribe(()=>{l.value++})}),n.onBeforeUnmount(()=>{i==null||i()});function a(c){var d,f;(f=(d=t.commands).setSelection)==null||f.call(d,{selection:Qe(c,0)}),n.nextTick(()=>{var h,p;const u=(p=(h=r.value)==null?void 0:h.closest)==null?void 0:p.call(h,".block-editor"),m=u?zo(u,c):null;m==null||m.scrollIntoView({block:"center",behavior:"smooth"})})}return()=>{const c=s.value,d=[n.h("div",{class:"toc-title"},o.t("toc.title"))];if(c.length===0)d.push(n.h("div",{class:"toc-empty"},o.t("toc.empty")));else for(const f of c)d.push(n.h("button",{type:"button",class:["toc-item",`toc-level-${f.level}`],style:{paddingLeft:`${(f.level-1)*16}px`},"data-toc-target":f.id,onClick:()=>a(f.id)},f.text));return n.h("div",{ref:r,class:["block-table-of-contents","block-focus-root",...bn(e.block.attrs)]},d)}}}),qa={name:"tableOfContents",schema:{type:"tableOfContents",content:"none",nestable:!1,inlineMarks:!1,attrs:{indent:jt.indent},empty:()=>!1},renderer:{component:Cb,editable:!1},slashCommands:[{id:"tableOfContents",title:"slash.tableOfContents.title",keywords:["toc","contents","table of contents","outline","目录","标题","大纲"],description:"slash.tableOfContents.description",icon:Pu,command:"convertBlock",category:"basic",args:()=>({id:"__currentBlock__",type:"tableOfContents"})}],serialize:{toHTML:()=>"",toMarkdown:()=>""}},Wa=[_s,Ms,Lm,Am,Dm,Pm,Mg,Ea,Va,Fa,Ka,qa,Ns,Ss],Tb={class:"editor-content"},xb={key:0,class:"cross-block-selection-overlay","aria-hidden":"true"},_b=200,Mb=.25,Nb=.75,Sb=400,Ab=n.defineComponent({__name:"BlockEditor",props:{extensions:{default:()=>Wa},modelValue:{default:()=>({blocks:[]})},editable:{type:Boolean,default:!0},placeholder:{default:""},theme:{default:"light"},locale:{default:"zh-CN"},width:{default:void 0},height:{default:void 0},toolbarPosition:{default:"auto"}},emits:["update:modelValue"],setup(e,{expose:t,emit:o}){const r=e,l=r.placeholder!=="",s=o,i=n.computed(()=>ls(r.locale)),a=n.computed(()=>is(r.theme)),c=n.ref(i.value),d=n.ref(a.value);pu(c,d),n.watch([i,a],([k,v])=>{c.value=k,d.value=v});const f=Zt(),u=n.computed(()=>`theme-${a.value}`),m=n.computed(()=>{const k={};return k.width=r.width!==void 0?typeof r.width=="number"?`${r.width}px`:r.width:"100%",k.height=r.height!==void 0?typeof r.height=="number"?`${r.height}px`:r.height:"100%",k});n.watch(a,k=>{if(typeof document>"u")return;const v=document.body;v.classList.toggle("theme-dark",k==="dark"),v.classList.toggle("theme-light",k==="light")},{immediate:!0});const h=n.computed(()=>l?r.placeholder??"":f.t("editor.placeholder")),p=new Ni({extensions:r.extensions,initialDocument:r.modelValue,editable:r.editable}),b=n.ref(r.editable);n.provide(Ri,b),n.provide(Wr,p);const x=typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)"):null,O=n.ref(!!(x!=null&&x.matches));function z(){O.value=!!(x!=null&&x.matches)}const F=n.ref(null);n.provide(Bi,O),n.provide(qr,F);const j=n.computed(()=>r.toolbarPosition==="top"?"top":r.toolbarPosition==="bottom"||O.value?"bottom":"top"),P=n.computed(()=>r.toolbarPosition==="float"&&!O.value),U=n.computed(()=>{const k=F.value;return k&&k.visible?k:{visible:T.visible,selectionRect:T.selectionRect,blockId:T.blockId,blockType:T.blockType,blockAttrs:T.blockAttrs,rootEl:Ie.value??null,onClose:()=>{T.visible=!1},onLinkClick:(v,V,q)=>nn(v,V,q)}});n.provide(Uo,n.computed(()=>j.value==="bottom")),n.watch(()=>r.editable,k=>{var v,V;b.value=k,p.editable=k,k||(T.visible=!1,T.selectionRect=null,T.blockId=null,T.blockType=null,T.blockAttrs={},kt(),$n(),Yn(),xe(),ne(),B(),mt(null,{clearNativeSelection:!0}),(V=(v=p.commands).clearSelection)==null||V.call(v))});const te=p.getExtensionMethod("startImageUpload");te&&n.provide(Li,te);const W=n.shallowRef(p.getState());let J=p.getState().selection,A=!1,_=!1;const I=n.computed(()=>{const k=W.value.doc,v=[];for(const V of k.root){const q=k.blocks.get(V);q&&v.push({id:V,block:q})}return v}),S=n.reactive({visible:!1,anchorEl:null,blockId:"",query:"",mode:"slash"}),$=n.ref(null),N=n.reactive({visible:!1,anchorEl:null,blockId:null}),E=n.ref(null),T=n.reactive({visible:!1,selectionRect:null,blockId:null,blockType:null,blockAttrs:{}});let R=!1,Y=null;function ae(){R=!0,Y&&clearTimeout(Y),Y=setTimeout(()=>{R=!1,Y=null,ve({force:!0})},500)}const ie=n.reactive({visible:!1,blockId:null,anchor:null,canContinue:!1,canStartNew:!1,currentNumber:1}),pe=n.reactive({visible:!1,initialValue:1,anchor:null,blockId:null}),re=n.reactive({visible:!1,initialValue:"plain",anchor:null,blockId:null}),le=n.reactive({visible:!1,anchorRect:null,blockId:null,from:0,to:0,href:"",text:"",initialMode:"view",showTextInput:!1});function xe(){le.visible=!1}n.watch(()=>le.visible,k=>{k&&(T.visible=!1)});function Ae(k,v){var Q,se;const V=p.getState().doc.blocks.get(k);if(!V)return null;let q=0;for(const ge of V.content){if(ge.type!=="text")continue;const de=q,me=q+ge.text.length;if(v>=de&&v<=me){const Te=(Q=ge.marks)==null?void 0:Q.find(Se=>Se.type==="link");if(Te&&typeof((se=Te.attrs)==null?void 0:se.href)=="string")return{from:de,to:me,href:Te.attrs.href,text:ge.text};if(v<me)return null}q=me}return null}function Xe(k,v,V){var Se,He,Ze;const q=p.getState().doc.blocks.get(k);if(!q)return;let Q="",se="",ge=0;for(const tt of q.content){if(tt.type!=="text")continue;const Ke=ge,Ue=ge+tt.text.length;if(Ue>v&&Ke<V){const it=(Se=tt.marks)==null?void 0:Se.find(Re=>Re.type==="link");if(it&&typeof((He=it.attrs)==null?void 0:He.href)=="string"){Q=it.attrs.href,se=tt.text;break}}ge=Ue}let de=null;const me=(Ze=Ie.value)==null?void 0:Ze.querySelector(`[data-block-id="${k}"]`);if(me){const tt=window.getSelection();if(tt&&tt.rangeCount>0){const Ke=tt.getRangeAt(0);me.contains(Ke.commonAncestorContainer)&&(de=Ke.getBoundingClientRect())}de||(de=me.getBoundingClientRect())}const Te=v<V;ne(),B(),kt(),$n(),Yn(),le.blockId=k,le.from=v,le.to=V,le.href=Q,le.text=se,le.anchorRect=de,le.initialMode=Q||!b.value?"view":"edit",le.showTextInput=!Te&&!Q,le.visible=!0}function At(){var v;if(!b.value)return;_n();const k=p.getState().selection;if(k.kind==="caret"){const V=Ae(k.blockId,k.offset);if(V){le.blockId=k.blockId,le.from=V.from,le.to=V.to,le.href=V.href,le.text=V.text;const q=(v=Ie.value)==null?void 0:v.querySelector(`[data-block-id="${k.blockId}"]`),Q=q==null?void 0:q.querySelector("a");le.anchorRect=(Q==null?void 0:Q.getBoundingClientRect())??(q==null?void 0:q.getBoundingClientRect())??null,le.initialMode="view",le.showTextInput=!1,le.visible=!0}}else k.kind==="text"&&!Ht(k)&&Xe(k.focus.blockId,k.anchor.offset,k.focus.offset)}function nn(k,v,V){Xe(k,v,V)}function Gt(k,v){var se;const V=Ae(k,v);if(!V)return;const q=(se=Ie.value)==null?void 0:se.querySelector(`[data-block-id="${k}"]`),Q=q==null?void 0:q.querySelector("a");le.blockId=k,le.from=V.from,le.to=V.to,le.href=V.href,le.text=V.text,le.anchorRect=(Q==null?void 0:Q.getBoundingClientRect())??(q==null?void 0:q.getBoundingClientRect())??null,le.initialMode="view",le.showTextInput=!1,le.visible=!0}function Ot(k){mt(k)}const qe=n.ref(null),bt=n.ref(null),It=n.ref(null);let Je=!1,Le=!1;function mt(k,v={}){const{clearNativeSelection:V=!1}=v;if(V)try{const q=window.getSelection();q&&q.removeAllRanges()}catch{}bt.value=k}let fe=null,_t=0,Ve=null;const _e=n.ref([]);function Ft(k){qe.value=k}function Ct(){const k=Ie.value;if(!k){_e.value=[];return}const v=p.getState().selection;if(v.kind!=="text"||!Ht(v)){_e.value=[];return}_e.value=Yr(k,p.getState().doc,v)}function Et(k){k.preventDefault()}function je(k){var ge,de;const v=Ie.value;if(!v||!fe)return;const V=dr(k.clientX,k.clientY,v,p.getState().doc);if(!V)return;const q=fe.start;if(V.blockId===q.blockId){if(fe.crossBlock){fe.crossBlock=!1,_e.value=[],document.removeEventListener("selectstart",Et,!0);const me=window.getSelection();me&&me.removeAllRanges()}return}if(!fe.crossBlock){fe.crossBlock=!0,document.addEventListener("selectstart",Et,!0);const me=window.getSelection();me&&me.removeAllRanges()}const Q={blockId:V.blockId,offset:V.offset},se=Vr(q,Q);A=!0,(de=(ge=p.commands).setSelection)==null||de.call(ge,{selection:se}),A=!1,Ct()}function ce(k){fe&&(Ve=k,!_t&&(_t=requestAnimationFrame(()=>{_t=0,Ve&&je(Ve)})))}function D(){if(!fe)return;fe=null,_t&&(cancelAnimationFrame(_t),_t=0),Ve=null,document.removeEventListener("mousemove",ce,!0),document.removeEventListener("mouseup",D,!0),document.removeEventListener("selectstart",Et,!0),Ct();const k=p.getState().selection;k.kind==="text"&&Ht(k)&&ct(k)}const M=new Set(["image","divider","table","toc","tableOfContents","codeBlock","equation"]);let X=!1;const Oe=p.subscribe(k=>{W.value=k.state,(k.changed.size>0||k.removed.size>0)&&(X=!0,s("update:modelValue",p.toData()),Promise.resolve().then(()=>{X=!1}));const v=k.state.selection;let q=v.kind==="caret"?v.blockId:v.kind==="text"?v.focus.blockId:v.kind==="blocks"?v.blockIds[0]??null:null;if(bt.value!==null&&q!==bt.value){const Q=k.state.doc.blocks.get(bt.value);Q&&M.has(Q.type)&&(v.kind!=="blocks"||v.blockIds.length===0)&&(q=bt.value)}R||mt(q),!A&&v!==J&&(_?_=!1:n.nextTick(()=>{const Q=Ie.value;Q&&Pi(Q,v)})),v.kind==="text"&&Ht(v)?n.nextTick(()=>{Ct(),!fe&&!Je&&ct(v)}):_e.value.length>0&&(_e.value=[]),J=v});function Ne(k,v){if(Object.is(k,v))return!0;if(typeof k!=typeof v||k===null||v===null||typeof k!="object"||Array.isArray(k)!==Array.isArray(v))return!1;if(Array.isArray(k)){if(k.length!==v.length)return!1;for(let Q=0;Q<k.length;Q++)if(!Ne(k[Q],v[Q]))return!1;return!0}const V=Object.keys(k),q=Object.keys(v);if(V.length!==q.length)return!1;for(const Q of V)if(!Object.prototype.hasOwnProperty.call(v,Q)||!Ne(k[Q],v[Q]))return!1;return!0}n.watch(()=>r.modelValue,k=>{if(X||k===void 0)return;const v=p.toData();Ne(v,k)||p.setDocument(k)},{deep:!0});const Ie=n.ref(null),Qt=n.ref(null),St=()=>Qt.value;function _n(){const k=Ie.value;if(!k)return;const v=Oi(k,p.getState().doc);if(!v)return;const V={steps:[],selectionAfter:v,meta:{addToHistory:!1}};A=!0,p.dispatch(V),A=!1}function Ln(k){var se,ge,de,me,Te,Se,He,Ze,tt,Ke,Ue,it;if(S.visible&&((se=$.value)!=null&&se.onKeyDown(k))||N.visible&&((ge=E.value)!=null&&ge.onKeyDown(k)))return;if(!b.value){const Re=k.key,Pt=k.ctrlKey||k.metaKey,yt=Re.length===1&&!Pt&&!k.altKey&&!k.isComposing,xt=Re==="Enter"||Re==="Backspace"||Re==="Delete",wt=Re.toLowerCase();if(yt||xt||Pt&&(wt==="x"||wt==="v"||wt==="z"||wt==="y"||wt==="d")){k.preventDefault();return}if(Pt&&wt==="a"){k.preventDefault(),(me=(de=p.commands).selectAll)==null||me.call(de);return}if(Pt&&wt==="c"){const rn=p.getState().selection;if(rn.kind==="text"&&Ht(rn)){const ln=Vt(rn);if(ln){k.preventDefault();const mo=window.ClipboardItem;if(mo){const Yt=new mo({"text/plain":new Blob([ln.text],{type:"text/plain"}),"text/html":new Blob([ln.html],{type:"text/html"})});navigator.clipboard.write([Yt]).catch(()=>{navigator.clipboard.writeText(ln.text).catch(()=>{})})}else navigator.clipboard.writeText(ln.text).catch(()=>{})}}return}return}if((k.metaKey||k.ctrlKey)&&k.key.toLowerCase()==="k"&&!k.isComposing){k.preventDefault(),At();return}const v=k.target;if(v&&v.classList.contains("image-block-caption")||v&&v.closest("[data-equation-edit]")||v&&v.closest(".table-cell-inner"))return;const V=p.getState().selection;V.kind==="text"&&Ht(V)||_n();const q=p.getState().selection;if(q.kind==="text"&&Ht(q)&&!k.isComposing){const Re=k.key,Pt=Re.length===1&&!k.ctrlKey&&!k.metaKey&&!k.altKey;if(Pt||Re==="Enter"||Re==="Tab"){if(k.preventDefault(),(Se=(Te=p.commands).backspace)==null||Se.call(Te),Pt){const yt=p.getState().selection;if(yt.kind==="caret"){const xt=p.getState().doc.blocks.get(yt.blockId);if(xt){const[wt,Bt]=Ut(xt.content,yt.offset),rn=[...wt,{type:"text",text:Re},...Bt];(Ze=(He=p.commands).setText)==null||Ze.call(He,{id:yt.blockId,content:rn,selectionAfter:Qe(yt.blockId,yt.offset+1)})}}}return}if((k.ctrlKey||k.metaKey)&&(Re==="c"||Re==="C"||Re==="x"||Re==="X")){const yt=Vt(q);if(yt){k.preventDefault();const xt=window.ClipboardItem;if(xt){const wt=new xt({"text/plain":new Blob([yt.text],{type:"text/plain"}),"text/html":new Blob([yt.html],{type:"text/html"})});navigator.clipboard.write([wt]).catch(()=>{navigator.clipboard.writeText(yt.text).catch(()=>{})})}else navigator.clipboard.writeText(yt.text).catch(()=>{});(Re==="x"||Re==="X")&&((Ke=(tt=p.commands).backspace)==null||Ke.call(tt))}return}if(Re==="ArrowLeft"||Re==="ArrowUp"||Re==="ArrowRight"||Re==="ArrowDown"){k.preventDefault();const yt=Bn(p.getState().doc),xt=yt.indexOf(q.anchor.blockId),wt=yt.indexOf(q.focus.blockId),[Bt,rn]=xt<=wt?[q.anchor,q.focus]:[q.focus,q.anchor],ln=Re==="ArrowLeft"||Re==="ArrowUp"?Bt:rn;_e.value=[],(it=(Ue=p.commands).setSelection)==null||it.call(Ue,{selection:Qe(ln.blockId,ln.offset)});return}}if((k.key==="ArrowUp"||k.key==="ArrowDown")&&!k.shiftKey&&!k.isComposing){const Re=p.getState().selection;if(Re.kind==="caret"||Re.kind==="text"){const Pt=Re.kind==="caret"?Re.blockId:Re.focus.blockId,yt=Re.kind==="caret"?Re.offset:Re.focus.offset,xt=p.getState().doc.blocks.get(Pt);if(xt&&p.registries.schema.get(xt.type).isolating){const Bt=Me(xt.content),rn=Bt.slice(0,yt),ln=Bt.slice(yt),mo=rn.lastIndexOf(`
|
|
28
|
+
`)+1,Yt=ln.indexOf(`
|
|
29
|
+
`),vn=Yt===-1?Bt.length:yt+Yt,pn=mo===0,mn=vn===Bt.length;if(k.key==="ArrowUp"&&!pn||k.key==="ArrowDown"&&!mn)return}}}if(bd(p,k)){k.preventDefault();return}if(k.key==="Enter"&&!k.shiftKey&&!k.isComposing){const Re=p.getState().selection;if(Re.kind==="caret"||Re.kind==="text"){const Pt=Re.kind==="caret"?Re.blockId:Re.focus.blockId,yt=Re.kind==="caret"?Re.offset:Re.focus.offset,xt=p.getState().doc.blocks.get(Pt);xt&&p.registries.schema.get(xt.type).isolating&&(k.preventDefault(),Mn(Pt,yt))}}}function Mn(k,v){const V=p.getState().doc.blocks.get(k);if(!V)return;const[q,Q]=Ut(V.content,v),se=[...q,{type:"text",text:`
|
|
30
|
+
`},...Q],ge=Me(se),de=Ie.value,me=de?zo(de,k):null,Te=window.getSelection();if(me&&Te&&Te.rangeCount>0){const He=Te.getRangeAt(0);if(me.contains(He.commonAncestorContainer)){He.collapsed||He.deleteContents();const Ze=document.createTextNode(`
|
|
31
|
+
`);if(He.insertNode(Ze),He.setStartAfter(Ze),He.collapse(!0),Te.removeAllRanges(),Te.addRange(He),ge.endsWith(`
|
|
32
|
+
`)){const Ke=me.lastChild;Ke&&Ke.nodeType===Node.ELEMENT_NODE&&Ke.tagName==="BR"&&me.removeChild(Ke),me.appendChild(document.createElement("br"))}_=!0}else me.textContent=ge}else me&&(me.textContent=ge);const Se={steps:[{op:"setText",id:k,content:se}],selectionAfter:Qe(k,v+1),meta:{source:"input",addToHistory:!0}};p.dispatch(Se)}const ze=n.ref(null),ot=n.ref("after");let De="idle",We=0,st=0,at=4,et=null,Tt=null,rt=0,dt=0,ht=null,Jt=null,$t=null,Wn=null;function on(){Wn!==null&&(clearTimeout(Wn),Wn=null),$t=null}function Nn(){var k;ht&&(ht.classList.remove("block-being-dragged"),ht=null),Tt&&(Tt.remove(),Tt=null),Jt!==null&&((k=St())==null||k.setBlockHandleDragging(Jt,!1)),Jt=null,et=null,De="idle",It.value=null,ze.value=null,ot.value="after",on()}function yn(){document.removeEventListener("mousemove",wn,!0),document.removeEventListener("mouseup",L,!0),document.removeEventListener("selectstart",On,!0)}function fo(k,v,V,q){b.value&&(De!=="idle"&&(yn(),Nn()),De="pending",et=k,We=v,st=V,at=q.thresholdPx,document.addEventListener("selectstart",On,!0),document.addEventListener("mousemove",wn,!0),document.addEventListener("mouseup",L,!0))}function po(k){}function On(k){k.preventDefault()}function wn(k){if(De==="pending"){const Ue=k.clientX-We,it=k.clientY-st;if(Math.sqrt(Ue*Ue+it*it)<=at)return;g()}if(De!=="active")return;try{const Ue=window.getSelection();Ue&&Ue.rangeCount>0&&Ue.removeAllRanges()}catch{}Tt&&(Tt.style.left=`${k.clientX+rt}px`,Tt.style.top=`${k.clientY+dt}px`);const v=Jt;if(!v)return;const V=Array.from(document.querySelectorAll(".block-host"));if(V.length<=1){ze.value=null;return}const q=V[0].getBoundingClientRect(),Q=V[V.length-1].getBoundingClientRect();if(k.clientY<q.top+q.height/2){on(),ze.value=null,ot.value="first";return}if(k.clientY>Q.bottom-Q.height/2){on(),ze.value=null,ot.value="last";return}const se=document.elementFromPoint(k.clientX,k.clientY);if(!se){on(),ze.value=null;return}const ge=se.closest(".block-host");if(!ge){on(),ze.value=null;return}const de=ge.dataset.blockId;if(!de||de===v){on(),ze.value=null;return}const me=ge.getBoundingClientRect(),Te=me.height===0?0:(k.clientY-me.top)/me.height;let Se=!1;const He=p.getState().doc,Ze=He.blocks.get(de);if(Ze){const Ue=p.registries.schema.get(Ze.type);if(Ue!=null&&Ue.nestable){let it=de;for(Se=!0;it!==null;){if(it===v){Se=!1;break}it=Rt(He,it)}}}if(Te>Mb&&Te<Nb&&Se){ze.value=de;const Ue=Te<.5;$t!==de&&(on(),$t=de,Wn=setTimeout(()=>{$t===de&&(ze.value=de,ot.value="into")},_b)),ot.value!=="into"&&(ot.value=Ue?"before":"after")}else on(),ze.value=de,ot.value=Te<.5?"before":"after"}function L(k){if(yn(),De==="pending"){De="idle",et=null;return}const v=Jt,V=ze.value,q=ot.value;Nn(),v&&(q==="into"&&!V||!V&&q!=="first"&&q!=="last"||H(v,V,q))}function g(){var Te,Se;const k=et;if(!k)return;const v=We,V=st;try{const He=window.getSelection();He&&He.removeAllRanges()}catch{}fe&&(fe=null,_t&&(cancelAnimationFrame(_t),_t=0),Ve=null,document.removeEventListener("mousemove",ce,!0),document.removeEventListener("mouseup",D,!0),document.removeEventListener("selectstart",Et,!0),_e.value=[]),mt(null);const q=document.querySelector(`.block-host[data-block-id="${k}"]`);if(!q){yn(),De="idle",et=null;return}q.classList.add("block-being-dragged"),ht=q;const Q=q.querySelector(".block-host-content");if(!Q){q.classList.remove("block-being-dragged"),ht=null,yn(),De="idle",et=null;return}const se=Q.getBoundingClientRect(),ge=((Te=Q.firstElementChild)==null?void 0:Te.getBoundingClientRect())??se;rt=ge.left-v,dt=ge.top-V;const de=document.createElement("div");de.className="drag-ghost";const me=Q.firstElementChild;me&&de.appendChild(me.cloneNode(!0)),de.style.width=`${ge.width}px`,de.style.left=`${v+rt}px`,de.style.top=`${V+dt}px`,document.body.appendChild(de),Tt=de,It.value=k,Jt=k,ze.value=null,ot.value="after",(Se=St())==null||Se.setBlockHandleDragging(k,!0),De="active"}function H(k,v,V){var He,Ze,tt;It.value=null;const q=p.getState().doc;if(!q.blocks.get(k))return;if(v){let Ke=v;for(;Ke!==null;){if(Ke===k)return;Ke=Rt(q,Ke)}}const se=Rt(q,k),ge=cn(q,k);if(ge===-1)return;let de=null,me;if(V==="first")de=null,me=0;else if(V==="last")de=null,me=q.root.length;else if(V==="into"&&v){const Ke=q.blocks.get(v);if(!Ke)return;const Ue=p.registries.schema.get(Ke.type);if(!(Ue!=null&&Ue.nestable))return;let it=v;for(;it!==null;){if(it===k)return;it=Rt(q,it)}de=v,me=0}else if((V==="before"||V==="after")&&v){const Ke=Rt(q,v),Ue=cn(q,v);if(Ue===-1)return;de=Ke,me=V==="before"?Ue:Ue+1}else return;se===de&&ge<me&&me--,me=Math.max(0,me);const Se=de===null?q.root:(He=q.blocks.get(de))==null?void 0:He.children;Se&&(me=Math.min(me,Se.length)),(tt=(Ze=p.commands).moveBlock)==null||tt.call(Ze,{id:k,toParent:de,toIndex:me})}const ue=n.ref(!1);function Ee(k){const v=[];if(!k||!k.types||!Array.from(k.types).includes("Files"))return v;const V=new Set;if(k.items&&k.items.length>0)for(let q=0;q<k.items.length;q++){const Q=k.items[q];if(Q.kind!=="file")continue;const se=Q.getAsFile();if(!se||!se.type.startsWith("image/"))continue;const ge=`${se.name||""}:${se.size}:${se.type}`;V.has(ge)||(V.add(ge),v.push(se))}if(k.files&&k.files.length>0)for(let q=0;q<k.files.length;q++){const Q=k.files[q];if(!Q.type.startsWith("image/"))continue;const se=`${Q.name||""}:${Q.size}:${Q.type}`;V.has(se)||(V.add(se),v.push(Q))}return v}function Be(k){if(It.value)return;const v=k.dataTransfer;if(!v||Ee(v).length===0)return;ue.value||(ue.value=!0);const q=Array.from(document.querySelectorAll(".block-host"));if(q.length===0){ze.value=null,ot.value="last";return}const Q=q[0].getBoundingClientRect(),se=q[q.length-1].getBoundingClientRect(),ge=k.clientY;if(ge<Q.top+Q.height/2){ze.value=null,ot.value="first";return}if(ge>se.bottom-se.height/2){ze.value=null,ot.value="last";return}const de=document.elementFromPoint(k.clientX,k.clientY);if(!de){ze.value=null,ot.value="last";return}const me=de.closest(".block-host");if(!me){ze.value=null,ot.value="last";return}const Te=me.getBoundingClientRect(),Se=me.dataset.blockId;if(!Se){ze.value=null,ot.value="last";return}ze.value=Se,ot.value=ge<Te.top+Te.height/2?"before":"after"}function y(k){const v=k.relatedTarget,V=Ie.value;V&&v&&V.contains(v)||ue.value&&(ue.value=!1,ze.value=null,ot.value="after")}async function w(k){if(It.value)return;const v=k.dataTransfer;if(!v)return;const V=Ee(v);if(V.length===0)return;const q=te;if(!q)return;const Q=ze.value,se=ot.value;ue.value=!1,ze.value=null,ot.value="after";let ge=Q,de=se==="before"?"before":"after";const me=p.getState().doc;se==="first"?(ge=me.root[0]??null,de="before"):se==="last"&&(ge=me.root[me.root.length-1]??null,de="after");let Te=ge;for(let Se=0;Se<V.length;Se++){const He=V[Se],Ze=await q(He,{relativeToBlockId:Te,position:Se===0?de:"after",convertIfEmpty:Se===0});Ze&&(Te=Ze)}}function C(k,v){ne(),B(),N.visible=!0,N.anchorEl=v,N.blockId=k}function B(){N.visible=!1,N.anchorEl=null}function K(k,v){var me,Te;if(!b.value)return;B(),ne();const V=p.getState().doc.blocks.get(k);if(!V)return;const q=p.registries.schema.get(V.type);if((q==null?void 0:q.content)==="text"&&Me(V.content).length===0){S.visible=!0,S.anchorEl=v,S.blockId=k,S.query="",S.mode="slash",S.sourceBlockId=void 0;return}(Te=(me=p.commands).insertBlock)==null||Te.call(me,{type:p.registries.defaultBlockType,after:k,content:[]});const ge=p.getState().selection,de=ge.kind==="caret"?ge.blockId:k;S.visible=!0,S.anchorEl=v,S.blockId=de,S.query="",S.mode="insert",S.sourceBlockId=k}function G(k,v,V){b.value&&(B(),S.visible=!0,S.anchorEl=k,S.blockId=v,S.query=V,S.mode="slash",S.sourceBlockId=void 0)}function ee(k,v){if(!S.visible)return;if(k!==S.blockId){ne();return}const V=v.match(/\/([^/]*)$/);if(!V){ne();return}S.query=V[1]??""}function ne(){S.visible=!1,S.anchorEl=null,S.query="",S.sourceBlockId=void 0}n.watch(()=>T.visible,k=>{k&&(S.visible||ne(),N.visible||B())});function ye(k,v){var se,ge,de,me;const V=S.blockId,q=he(V),Q=be(q);p.history.beginGroup();try{q!==Q&&((ge=(se=p.commands).setText)==null||ge.call(se,{id:V,content:jn(Q)}));const Te=p.registries.slash.all.find(Se=>Se.id===k.id);if(Te){const Se=typeof Te.args=="function"?Te.args(null):Te.args,He=Se&&typeof Se=="object"?{...Se}:{};He.id==="__currentBlock__"&&(He.id=V),He.after==="__currentBlock__"&&(He.after=V);const Ze=p.commands[Te.command];if(Ze==null||Ze(He),(me=(de=p.commands).setSelection)==null||me.call(de,{selection:{kind:"caret",blockId:V,offset:0}}),k.id==="image"&&te){const tt=te;n.nextTick(()=>{const Ke=document.createElement("input");Ke.type="file",Ke.accept="image/*",Ke.multiple=!1,Ke.addEventListener("change",()=>{var it;const Ue=(it=Ke.files)==null?void 0:it[0];Ue&&tt(Ue,{relativeToBlockId:V,position:"replace",convertIfEmpty:!0})}),Ke.click()})}}}finally{p.history.endGroup()}ne()}function he(k){const v=Ie.value;if(!v)return"";const V=v.querySelector(`.block-content[data-block-id="${k}"]`);return(V==null?void 0:V.textContent)??""}function be(k){const v=k.lastIndexOf("/");return v<0?k:k.slice(0,v)}function ve(k){var Ue,it,Re,Pt,yt;let v=!1;k&&typeof k=="object"&&!("type"in k)&&(v=!!k.force);const V=Ie.value;if(V){const xt=window.getSelection();let wt=null;if(xt&&xt.rangeCount>0){const Bt=xt.focusNode,rn=(Bt==null?void 0:Bt.nodeType)===1?Bt.closest(".block-content"):(Ue=Bt==null?void 0:Bt.parentElement)==null?void 0:Ue.closest(".block-content");if(rn&&V.contains(rn)){const ln=rn.getAttribute("data-block-id");ln&&(wt=ln)}}if(wt!==null&&bt.value!==null&&wt!==bt.value){const Bt=p.getState().doc.blocks.get(bt.value);Bt&&M.has(Bt.type)&&(wt=null)}wt!==null&&!R&&mt(wt)}if(!b.value){T.visible=!1,T.selectionRect=null,T.blockId=null,T.blockType=null,T.blockAttrs={};return}const q=Ie.value;if(!q)return;const Q=p.getState().selection;if(Q.kind==="text"&&Ht(Q)&&!fe)return;if(Po(Q)&&Q.blockIds.length>0){const xt=window.getSelection();if(xt&&xt.rangeCount>0&&xt.getRangeAt(0).collapsed){const wt=Oi(q,p.getState().doc);wt&&wt.kind==="caret"&&(A=!0,(Re=(it=p.commands).setSelection)==null||Re.call(it,{selection:wt}),A=!1)}}const se=window.getSelection();if(!se||se.rangeCount===0){!R&&!Je&&(T.visible=!1,T.selectionRect=null,T.blockId=null,T.blockType=null,T.blockAttrs={});return}const ge=se.getRangeAt(0);if(ge.collapsed){!R&&!Je&&(T.visible=!1,T.selectionRect=null,T.blockId=null);return}if(!q.contains(ge.commonAncestorContainer)){!R&&!Je&&(T.visible=!1,T.selectionRect=null,T.blockId=null);return}if(Je&&!v)return;const de=se.anchorNode;if((de==null?void 0:de.nodeType)===1?de.closest(".table-cell-inner"):(Pt=de==null?void 0:de.parentElement)==null?void 0:Pt.closest(".table-cell-inner")){!R&&!Je&&(T.visible=!1,T.selectionRect=null,T.blockId=null,T.blockType=null,T.blockAttrs={});return}const Te=(de==null?void 0:de.nodeType)===1?de.closest(".block-content"):(yt=de==null?void 0:de.parentElement)==null?void 0:yt.closest(".block-content");if(!Te){!R&&!Je&&(T.visible=!1,T.selectionRect=null,T.blockId=null);return}const Se=Te.getAttribute("data-block-id");if(!Se){!R&&!Je&&(T.visible=!1,T.selectionRect=null,T.blockId=null);return}const Ze=p.getState().doc.blocks.get(Se),tt=ge.getBoundingClientRect(),Ke=tt.width===0&&tt.height===0?Te.getBoundingClientRect():tt;T.visible=!0,T.selectionRect=Ke,T.blockId=Se,T.blockType=(Ze==null?void 0:Ze.type)??null,T.blockAttrs=(Ze==null?void 0:Ze.attrs)??{}}function $e(){const k=p.getState().selection;if(k.kind==="text"&&Ht(k)){if(Ct(),T.visible){const Q=Ie.value;if(Q){const se=Yr(Q,p.getState().doc,k);se.length>0&&(T.selectionRect=Fe(se))}}return}if(!T.visible)return;const v=window.getSelection();if(!v||v.rangeCount===0)return;const V=v.getRangeAt(0);if(V.collapsed)return;const q=V.getBoundingClientRect();q.width===0&&q.height===0||(T.selectionRect=q)}function Fe(k){if(k.length===0)return new DOMRect(0,0,0,0);let v=1/0,V=1/0,q=-1/0,Q=-1/0;for(const se of k)v=Math.min(v,se.left),V=Math.min(V,se.top),q=Math.max(q,se.right),Q=Math.max(Q,se.bottom);return new DOMRect(v,V,q-v,Q-V)}function ct(k){if(!b.value)return;const v=Ie.value;if(!v)return;const V=Yr(v,p.getState().doc,k);if(V.length===0)return;const q=Fe(V),se=p.getState().doc.blocks.get(k.focus.blockId);T.visible=!0,T.selectionRect=q,T.blockId=k.focus.blockId,T.blockType=(se==null?void 0:se.type)??null,T.blockAttrs=(se==null?void 0:se.attrs)??{}}function Kt(k){var Q,se;const v=Ie.value;if(!v||O.value||!v.contains(k.target))return;const V=k.target;if(V&&V.closest(".block-handle"))return;Je=!0,T.visible=!1;const q=p.getState().selection;if(q.kind==="text"&&Ht(q)&&(_e.value=[]),k.button===0&&!k.shiftKey){const ge=k.target;if(ge&&(ge.closest(".table-cell-inner, .block-table-container, .block-table-of-contents")||ge.closest(".block-focus-root")&&!ge.closest('[contenteditable="true"]')&&!ge.closest("[data-equation-edit]")||ge.closest(".equation-block")&&!ge.closest("[data-equation-edit]"))){Le=!0;try{const me=window.getSelection();me&&me.removeAllRanges()}catch{}return}else Le=!1;const de=dr(k.clientX,k.clientY,v,p.getState().doc);de&&(q.kind==="text"&&Ht(q)&&(A=!0,(se=(Q=p.commands).setSelection)==null||se.call(Q,{selection:Qe(de.blockId,de.offset)}),A=!1),fe={start:{blockId:de.blockId,offset:de.offset},crossBlock:!1},document.addEventListener("mousemove",ce,!0),document.addEventListener("mouseup",D,!0))}}function en(){if(!Je)return;if(O.value){Je=!1;return}if(Je=!1,Le){Le=!1;return}const k=p.getState().selection;k.kind==="text"&&Ht(k)||ve()}let lt=null,Pe=!1;function vt(k){if(!O.value)return;const v=Ie.value;if(!v||!v.contains(k.target))return;const V=k.target;if(!V||!V.closest(".block-content")||V.closest(".block-handle, .tt-btn, .ht-btn, a[href]"))return;const Q=k.touches[0];Q&&(Pe=!1,lt={longPressTimer:window.setTimeout(()=>{lt&&ut(v,lt.startTouch)},Sb),startTouch:Q},document.addEventListener("touchmove",qt,{passive:!1,capture:!0}),document.addEventListener("touchend",ft,!0),document.addEventListener("touchcancel",ft,!0))}function qt(k){var de,me;if(!lt)return;Pe=!0;const v=Ie.value;if(!v)return;if(!fe){const Te=k.touches[0];if(!Te)return;const Se=Te.clientX-lt.startTouch.clientX,He=Te.clientY-lt.startTouch.clientY;if(Math.hypot(Se,He)>10){lt.longPressTimer&&clearTimeout(lt.longPressTimer),lt=null;return}return}const V=k.touches[0];if(!V)return;const q=dr(V.clientX,V.clientY,v,p.getState().doc);if(!q)return;const Q=fe.start;if(q.blockId===Q.blockId){if(fe.crossBlock){fe.crossBlock=!1,_e.value=[],document.removeEventListener("selectstart",Et,!0);const Te=window.getSelection();Te&&Te.removeAllRanges()}return}if(k.preventDefault(),!fe.crossBlock){fe.crossBlock=!0,document.addEventListener("selectstart",Et,!0);const Te=window.getSelection();Te&&Te.removeAllRanges()}const se={blockId:q.blockId,offset:q.offset},ge=Vr(Q,se);A=!0,(me=(de=p.commands).setSelection)==null||me.call(de,{selection:ge}),A=!1,Ct()}function ut(k,v){const V=dr(v.clientX,v.clientY,k,p.getState().doc);if(!V){lt=null;return}T.visible=!1;const q=p.getState().selection;q.kind==="text"&&Ht(q)&&(_e.value=[]),fe={start:{blockId:V.blockId,offset:V.offset},crossBlock:!1}}function ft(){if(lt&&(lt.longPressTimer&&clearTimeout(lt.longPressTimer),lt=null),!fe){document.removeEventListener("touchmove",qt,!0),document.removeEventListener("touchend",ft,!0),document.removeEventListener("touchcancel",ft,!0);return}if(fe=null,document.removeEventListener("touchmove",qt,!0),document.removeEventListener("touchend",ft,!0),document.removeEventListener("touchcancel",ft,!0),document.removeEventListener("selectstart",Et,!0),!Pe)return;Ct();const k=p.getState().selection;k.kind==="text"&&Ht(k)&&ct(k)}function Vt(k){const v=p.getState().doc,V=Bn(v),q=V.indexOf(k.anchor.blockId),Q=V.indexOf(k.focus.blockId);if(q===-1||Q===-1)return null;const[se,ge]=q<=Q?[k.anchor,k.focus]:[k.focus,k.anchor],de=V.indexOf(se.blockId),me=V.indexOf(ge.blockId);if(de===-1||me===-1)return null;const Te=[],Se=[];for(let He=de;He<=me;He++){const Ze=V[He],tt=v.blocks.get(Ze);if(!tt)continue;const Ke=Me(tt.content).length;let Ue=0,it=Ke;He===de&&(Ue=Math.min(se.offset,Ke)),He===me&&(it=Math.min(ge.offset,Ke)),Ue>it&&([Ue,it]=[it,Ue]);const[,Re]=Ut(tt.content,Ue),[Pt]=Ut(Re,it-Ue);Te.push(Me(Pt)),Se.push(eo(Pt))}return{text:Te.join(`
|
|
33
|
+
`),html:Se.join("<br>")}}function En(k){var q,Q;const v=p.getState().selection;if(v.kind!=="text"||!Ht(v))return;const V=Vt(v);V&&(k.preventDefault(),(q=k.clipboardData)==null||q.setData("text/plain",V.text),(Q=k.clipboardData)==null||Q.setData("text/html",V.html))}function Wt(k){var q,Q,se,ge;if(!b.value){k.preventDefault();return}const v=p.getState().selection;if(v.kind!=="text"||!Ht(v))return;const V=Vt(v);V&&(k.preventDefault(),(q=k.clipboardData)==null||q.setData("text/plain",V.text),(Q=k.clipboardData)==null||Q.setData("text/html",V.html),(ge=(se=p.commands).backspace)==null||ge.call(se))}function Sn(k){if(!b.value)return;const v=k.detail;if(!(v!=null&&v.blockId)||!(v!=null&&v.anchor))return;const V=v.blockId,q=p.getState().doc,Q=q.blocks.get(V),se=Hn(q,V),de=typeof(Q==null?void 0:Q.attrs).startNumber=="number"&&!!se&&se.type==="orderedList",me=xs(q,V),Te=me!==1;ne(),B(),$n(),xe(),T.visible=!1,ie.visible=!0,ie.blockId=V,ie.anchor=v.anchor,ie.canContinue=de,ie.canStartNew=Te,ie.currentNumber=me}function kt(){ie.visible=!1,ie.anchor=null,ie.blockId=null}function Gn(){var k,v;ie.blockId&&((v=(k=p.commands).setStartNumber)==null||v.call(k,{id:ie.blockId,startNumber:null}),kt())}function Dn(){var k,v;ie.blockId&&((v=(k=p.commands).setStartNumber)==null||v.call(k,{id:ie.blockId,startNumber:1}),kt())}function Dt(k){if(!ie.blockId)return;const v=ie.anchor,V=ie.blockId;kt(),v&&(pe.visible=!0,pe.initialValue=k,pe.anchor=v,pe.blockId=V)}function $n(){pe.visible=!1,pe.anchor=null,pe.blockId=null}function ql(k){var v,V;if(!pe.blockId){$n();return}(V=(v=p.commands).setStartNumber)==null||V.call(v,{id:pe.blockId,startNumber:k}),$n(),kt()}function Ar(k){if(!b.value)return;const v=k.detail;if(!(v!=null&&v.blockId)||!(v!=null&&v.anchor))return;const V=v.blockId,Q=p.getState().doc.blocks.get(V);if(!Q)return;const se=Q.attrs.language??"plain";ne(),B(),$n(),kt(),xe(),T.visible=!1,re.visible=!0,re.blockId=V,re.anchor=v.anchor,re.initialValue=se}function Yn(){re.visible=!1,re.anchor=null,re.blockId=null}function Wl(k){var v,V;if(!re.blockId){Yn();return}(V=(v=p.commands).setAttrs)==null||V.call(v,{id:re.blockId,attrs:{language:k}}),Yn()}function Io(k){var de,me,Te,Se,He;const v=k.target,V=document.querySelector(".ordered-list-menu"),q=document.querySelector(".number-picker"),Q=document.querySelector(".code-lang-picker"),se=document.querySelector(".link-popover");if(V&&V.contains(v)||q&&q.contains(v)||Q&&Q.contains(v)||se&&se.contains(v)||v instanceof Node&&((de=v.closest)!=null&&de.call(v,".ol-marker"))||v instanceof Node&&((me=v.closest)!=null&&me.call(v,".block-code-lang"))||v instanceof Node&&((Te=v.closest)!=null&&Te.call(v,"a[href]")))return;kt(),$n(),Yn(),xe();const ge=p.getState().selection;if(ge.kind==="blocks"&&ge.blockIds.length>0){const Ze=Ie.value;if(Ze&&Ze.contains(v)){const tt=v.nodeType===1?v:v.parentElement??null;if(tt&&(tt.closest("[contenteditable]")||tt.closest(".block-image-wrapper, .block-image-container, .block-table-container, .block-code-wrapper, .block-divider, .block-todo-checkbox, .block-ordered-list-wrapper, .block-video, .block-file, .block-embed, .block-callout")))return}(He=(Se=p.commands).clearSelection)==null||He.call(Se)}}function Bo(k){const v=k.target;v instanceof Element&&(v.closest(".code-lang-picker")||v.closest(".ordered-list-menu")||v.closest(".number-picker")||v.closest(".link-popover"))||(ie.visible&&kt(),pe.visible&&$n(),re.visible&&Yn(),le.visible&&xe())}function Ir(k){var V,q;if(k.key!=="Escape")return;const v=p.getState().selection;v.kind==="blocks"&&v.blockIds.length>0&&(k.preventDefault(),(q=(V=p.commands).clearSelection)==null||q.call(V))}function Br(k){const v=k.target;if(!v||v.closest(".block-handle")||v.closest('[contenteditable="true"]')||v.closest("[data-equation-edit]"))return;const V=v.closest(".block-focus-root");if(!V)return;const q=V.closest(".block-host");if(!q)return;const Q=Ie.value;if(!Q||!Q.contains(q))return;const se=q.getAttribute("data-block-id");se&&mt(se,{clearNativeSelection:!0})}function Rr(k){k.target===Ie.value&&mt(null,{clearNativeSelection:!0})}return n.onMounted(()=>{n.nextTick(()=>{const k=Ie.value;if(!k)return;const v=p.getState().selection;Pi(k,v),k.addEventListener("ordered-list-marker-click",Sn),k.addEventListener("code-lang-click",Ar),k.addEventListener("click",Br),k.addEventListener("click",Rr)}),document.addEventListener("selectionchange",ve),document.addEventListener("mousedown",Kt,!0),document.addEventListener("mouseup",en,!0),document.addEventListener("mousedown",Io,!0),document.addEventListener("touchstart",Io,!0),window.addEventListener("scroll",$e,!0),window.addEventListener("resize",$e),window.addEventListener("scroll",Bo,!0),document.addEventListener("touchmove",Bo,{passive:!0,capture:!0}),document.addEventListener("keydown",Ir,!0),x==null||x.addEventListener("change",z),document.addEventListener("touchstart",vt,{passive:!1,capture:!0})}),n.onBeforeUnmount(()=>{const k=Ie.value;k&&(k.removeEventListener("ordered-list-marker-click",Sn),k.removeEventListener("code-lang-click",Ar),k.removeEventListener("click",Br),k.removeEventListener("click",Rr)),document.removeEventListener("selectionchange",ve),document.removeEventListener("mousedown",Kt,!0),document.removeEventListener("mouseup",en,!0),document.removeEventListener("mousedown",Io,!0),document.removeEventListener("touchstart",Io,!0),window.removeEventListener("scroll",$e,!0),window.removeEventListener("resize",$e),window.removeEventListener("scroll",Bo,!0),document.removeEventListener("touchmove",Bo,!0),document.removeEventListener("keydown",Ir,!0),x==null||x.removeEventListener("change",z),document.removeEventListener("touchstart",vt,!0),document.removeEventListener("touchmove",qt,!0),document.removeEventListener("touchend",ft,!0),document.removeEventListener("touchcancel",ft,!0),Oe(),p.destroy()}),t({editor:p}),(k,v)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"rootEl",ref:Ie,class:n.normalizeClass(["block-editor",[u.value,{"block-editor-dragging":It.value!==null,"is-mobile":O.value}]]),style:n.normalizeStyle(m.value),contenteditable:!1,onKeydown:Ln,onCopy:En,onCut:Wt,onDragover:n.withModifiers(Be,["prevent"]),onDragleave:y,onDrop:n.withModifiers(w,["prevent"])},[P.value?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(Wp,{key:0,"root-el":Ie.value,"focus-block-id":bt.value,"hover-visible":T.visible,"hover-selection-rect":T.selectionRect,"hover-block-id":T.blockId,"hover-block-type":T.blockType,"hover-block-attrs":T.blockAttrs,"plus-menu-visible":S.visible,"settings-menu-visible":N.visible,position:j.value,onToolbarInteracting:ae,onOpenPlusMenu:K,onOpenSettingsMenu:C,onLinkClick:nn,onHoverClose:v[0]||(v[0]=V=>T.visible=!1)},null,8,["root-el","focus-block-id","hover-visible","hover-selection-rect","hover-block-id","hover-block-type","hover-block-attrs","plus-menu-visible","settings-menu-visible","position"])),P.value?(n.openBlock(),n.createBlock(ws,n.mergeProps({key:1},U.value,{onInteracting:ae}),null,16)):n.createCommentVNode("",!0),n.createElementVNode("div",Tb,[n.createVNode(ds,{ref_key:"blockListRef",ref:Qt,items:I.value,"blocks-map":W.value.doc.blocks,"first-block-placeholder":h.value,"hovered-block-id":qe.value,"focused-block-id":bt.value,"has-text-selection":T.visible,"dragging-block-id":It.value,"drop-target-block-id":ze.value,"drop-position":ot.value,"menu-open-block-id":N.visible?N.blockId:null,onOpenSettingsMenu:C,onOpenPlusMenu:K,onSlashTrigger:G,onInputChanged:ee,onHoverChange:Ft,onGripPointerDown:fo,onGripPointerUp:po,onLinkClick:Gt,onFocusIn:Ot},null,8,["items","blocks-map","first-block-placeholder","hovered-block-id","focused-block-id","has-text-selection","dragging-block-id","drop-target-block-id","drop-position","menu-open-block-id"])]),(n.openBlock(),n.createBlock(n.Teleport,{to:"body"},[_e.value.length>0?(n.openBlock(),n.createElementBlock("div",xb,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(_e.value,(V,q)=>(n.openBlock(),n.createElementBlock("div",{key:q,class:"cross-block-selection-rect",style:n.normalizeStyle({left:V.left+"px",top:V.top+"px",width:V.width+"px",height:V.height+"px"})},null,4))),128))])):n.createCommentVNode("",!0)])),n.createVNode(Bu,{ref_key:"plusMenuRef",ref:$,visible:S.visible,"anchor-el":S.anchorEl,"block-id":S.blockId,query:S.query,"root-el":Ie.value,mode:S.mode,onClose:ne,onCommit:ye},null,8,["visible","anchor-el","block-id","query","root-el","mode"]),n.createVNode(Ff,{ref_key:"settingsMenuRef",ref:E,visible:N.visible,"anchor-el":N.anchorEl,"block-id":N.blockId,"root-el":Ie.value,onClose:B},null,8,["visible","anchor-el","block-id","root-el"]),n.createVNode(Es,{visible:ie.visible,"block-id":ie.blockId,anchor:ie.anchor,"root-el":Ie.value,"can-continue":ie.canContinue,"can-start-new":ie.canStartNew,"current-number":ie.currentNumber,onContinue:Gn,onStartNew:Dn,onModify:Dt,onClose:kt},null,8,["visible","block-id","anchor","root-el","can-continue","can-start-new","current-number"]),n.createVNode(vs,{visible:pe.visible,"initial-value":pe.initialValue,anchor:pe.anchor,"root-el":Ie.value,onConfirm:ql,onClose:$n},null,8,["visible","initial-value","anchor","root-el"]),n.createVNode(fm,{visible:re.visible,"initial-value":re.initialValue,anchor:re.anchor,"root-el":Ie.value,onConfirm:Wl,onClose:Yn},null,8,["visible","initial-value","anchor","root-el"]),n.createVNode(Ts,{visible:le.visible,"anchor-rect":le.anchorRect,"block-id":le.blockId,from:le.from,to:le.to,href:le.href,text:le.text,"initial-mode":le.initialMode,"show-text-input":le.showTextInput,readonly:!b.value,onClose:xe},null,8,["visible","anchor-rect","block-id","from","to","href","text","initial-mode","show-text-input","readonly"])],38))}});oe.BlockContent=Kn,oe.BlockEditor=Ab,oe.BlockHost=cs,oe.BlockList=ds,oe.BuiltinExtensions=Wa,oe.CANCEL_IMAGE_UPLOAD_COMMAND=ba,oe.CommandRegistry=fi,oe.DeserializerRegistry=Ti,oe.DividerExtension=Ka,oe.Editor=Ni,oe.EquationBlock=nb,oe.EquationExtension=Va,oe.HeadingExtension=Ms,oe.HistoryExtension=Ss,oe.HistoryManager=Mi,oe.ImageExtension=Ea,oe.InputRuleRegistry=Ei,oe.KeymapExtension=Ns,oe.KeymapRegistry=wi,oe.ParagraphExtension=_s,oe.START_IMAGE_UPLOAD_METHOD=ka,oe.SUPPORTED_COMMANDS=$g,oe.SchemaRegistry=oi,oe.SerializerRegistry=Ci,oe.SlashCommandRegistry=vi,oe.TableExtension=Fa,oe.TableOfContentsExtension=qa,oe.TransactionBuilder=ci,oe.applySteps=lr,oe.applyTransaction=ai,oe.asBlockId=pc,oe.blockAfter=yo,oe.blockBefore=Hn,oe.blocksSelection=Cc,oe.buildRegistries=_i,oe.builtinEquationRenderer=Nr,oe.canContain=Jl,oe.caretSelection=Qe,oe.coerceAttrs=Ql,oe.collectIndentSyncPatches=si,oe.createBlockId=bo,oe.createEquationExtension=Ha,oe.createImageExtension=wa,oe.createPrimitiveCommands=bi,oe.createState=Hr,oe.createTransaction=Ye,oe.defaultAttrs=Qn,oe.defineSchema=Or,oe.depthOf=Pn,oe.docFromData=Dr,oe.docToData=li,oe.editorKey=Wr,oe.extensionBlockType=Qc,oe.flatten=Bn,oe.flattenExtensions=xi,oe.focusOffset=Tc,oe.getBlock=Mt,oe.hasText=ei,oe.indexOf=cn,oe.inlineFromString=jn,oe.inlineText=Me,oe.invertSteps=di,oe.isBlockId=go,oe.isBlocks=Po,oe.isCaret=wo,oe.isCollapsed=Ur,oe.isEmpty=ni,oe.isIsolating=ti,oe.isText=Jn,oe.isTextRun=uc,oe.keyMatches=yi,oe.keyNameFromEvent=ki,oe.lastDescendant=ii,oe.nextSibling=gc,oe.normalizeLocale=ls,oe.normalizeTheme=is,oe.orderedAnchors=xc,oe.parentOf=Rt,oe.parseMath=Aa,oe.prevSibling=Pr,oe.primaryBlock=ui,oe.renderEquation=eb,oe.requireBlock=an,oe.siblingList=ko,oe.splitInline=Ut,oe.textSelection=Vr,oe.useEditor=dn,oe.useI18n=Zt,oe.withAttrs=kc,oe.withContent=bc,Object.defineProperty(oe,Symbol.toStringTag,{value:"Module"})});
|