xiaodao-editor 0.1.18 → 0.1.20
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 +1 -1
- package/README.md +1 -1
- package/dist/block-editor.js +5711 -5730
- package/dist/block-editor.umd.cjs +38 -38
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
(function(ke,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],i):(ke=typeof globalThis<"u"?globalThis:ke||self,i(ke.BlockEditor={},ke.Vue))})(this,function(ke,i){"use strict";var a5=Object.defineProperty;var s5=(ke,i,To)=>i in ke?a5(ke,i,{enumerable:!0,configurable:!0,writable:!0,value:To}):ke[i]=To;var Ft=(ke,i,To)=>s5(ke,typeof i!="symbol"?i+"":i,To);function To(t){return typeof t=="string"&&t.length>0}function Yd(t){return t.type==="text"}function Ve(t){return t.reduce((e,n)=>n.type==="text"?e+n.text:e,"")}function Ir(t){return t.length===0?[]:[{type:"text",text:t}]}function Cn(t,e){const n=Math.max(0,Math.floor(e));if(n<=0)return[[],t];const r=Ve(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 Xd(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=Xd(Is);let e="";for(let n=0;n<Is;n++)e+=Bs[t[n]%Bs.length];return e}function Zd(t){return t}const jd={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??jd.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){Ft(this,"schemas");Ft(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&&Qd(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??n1(),root:s,blocks:e,parent:n},idMap:r}}function Qd(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 Yt(t,e){return t.blocks.get(e)}function Kn(t,e){const n=t.blocks.get(e);if(!n)throw new Error(`BlockEditor: unknown block ${e}`);return n}function un(t,e){return t.parent.get(e)??null}function _r(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 Yn(t,e){return Ao(t,e).indexOf(e)}function Bl(t,e){const n=Yn(t,e);if(n<=0)return;const r=Ao(t,e);return t.blocks.get(r[n-1])}function Jd(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 Rr(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=Kn(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 e1(t,e){return{...t,content:e}}function t1(t,e){return{...t,attrs:e}}function n1(){return"doc_"+Math.random().toString(36).slice(2,10)}function r1(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 o1(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":{o1(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:r1(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(){Ft(this,"steps",[]);Ft(this,"selectionAfter");Ft(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(...i1(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:un(e,o.id),toIndex:Yn(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 i1(t,e){const n=[],r=o=>{const l=Kn(e,o);n.push({op:"insertBlock",parent:un(e,o),index:Yn(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 Et(t,e){return{kind:"caret",blockId:t,offset:e}}function _l(t,e){return{kind:"text",anchor:t,focus:e}}function l1(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 a1(t){return Bo(t)?t.offset:jr(t)?t.focus.offset:0}function s1(t,e){return jr(t)?e(t.anchor,t.focus)<=0?[t.anchor,t.focus]:[t.focus,t.anchor]:null}class Ws{constructor(){Ft(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 Qn(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(!Yt(n.doc,e.after))return!1;s=un(n.doc,e.after),c=Yn(n.doc,e.after)+1}else if(e.parent!==void 0){s=e.parent;const f=s===null?n.doc.root:Kn(n.doc,s).children;c=e.index??f.length}else s=null,c=n.doc.root.length;if(s!==null){const f=Yt(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(Et(d,0)),r==null||r(u.build()),!0}}}function Ol(t){return{name:"removeBlock",run:e=>(n,r)=>{if(!Yt(n.doc,e.id))return!1;const o=Rr(n.doc,e.id),l=No(n.doc,e.id),a=o??l,s=kt(),u=Kn(n.doc,e.id).children??[];if(u.length>0){const d=un(n.doc,e.id),f=Yn(n.doc,e.id);if((()=>{if(!o)return!1;const b=t.registries.schema.get(o.type);return!(!(b!=null&&b.nestable)||_r(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),Qn(n,s,t),a){const d=Ve(a.content);s.setSelection(Et(a.id,d.length))}return r==null||r(s.build()),!0}}}function c1(t){return{name:"replaceBlock",run:e=>(n,r)=>{if(!Yt(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),Qn(n,a,t),a.setSelection(Et(e.id,0)),r==null||r(a.build()),!0}}}function u1(){return{name:"setText",run:t=>(e,n)=>{if(!Yt(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 d1(){return{name:"setAttrs",run:t=>(e,n)=>{if(!Yt(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=Yt(n.doc,e.id);if(!o||!t.registries.schema.hasText(o.type))return!1;const l=Ve(o.content).length,a=Math.max(0,Math.min(e.offset,l)),[s,c]=Cn(o.content,a),u=un(n.doc,e.id),d=Yn(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 Qn(n,g,t),g.setSelection(Et(k,0)),r==null||r(g.build()),!0}}}function Ks(t){return{name:"mergeBlock",run:e=>(n,r)=>{const o=Yt(n.doc,e.id);if(!o)return!1;const l=Rr(n.doc,e.id);if(!l||!t.registries.schema.hasText(l.type))return!1;const a=Ve(l.content),s=[...l.content,...o.content],c=kt();c.setText(l.id,s);const u=o.children??[];if(u.length>0){const d=un(n.doc,e.id),f=Yn(n.doc,e.id),p=t.registries.schema.get(l.type);if(!!(p!=null&&p.nestable)&&_r(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),Qn(n,c,t),c.setSelection(Et(l.id,a.length)),r==null||r(c.build()),!0}}}function f1(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=Kn(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=Ve(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 h1(t){return{name:"backspace",run:()=>(e,n)=>{const r=e.selection;if(ti(r)&&r.blockIds.length){const s=r.blockIds[0],c=Rr(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 Qn(e,u,t),d&&u.setSelection(Et(d.id,Ve(d.content).length)),n==null||n(u.build()),!0}const o=Ri(r);if(!o)return!1;const l=Kn(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=Ve(l.content),d=Ir(u.slice(0,s)+u.slice(c)),f=kt();return f.setText(l.id,d),f.setSelection(Et(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=Kn(e.doc,d.blockId),k=Kn(e.doc,f.blockId),E=Ve(g.content).length,M=Ve(k.content).length,O=Math.min(d.offset,E),V=Math.min(f.offset,M),[te]=Cn(g.content,O),[,D]=Cn(k.content,V),F=[...te,...D],ie=Ve(te).length,Q=kt();Q.setText(d.blockId,F);for(let re=b;re>p;re--)Q.removeBlock(s[re]);return Q.setSelection(Et(d.blockId,ie)),Qn(e,Q,t),n==null||n(Q.build()),!0}if(o.offset>0)return!1;if(_r(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=Rr(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 m1(){return{name:"moveToPreviousBlock",run:()=>(t,e)=>{const n=Ri(t.selection);if(!n)return!1;const r=Rr(t.doc,n.blockId);if(!r)return!1;const o=Math.min(n.offset,Ve(r.content).length);return e==null||e(kt().setSelection(Et(r.id,o)).setMeta({addToHistory:!1}).build()),!0}}}function p1(){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,Ve(r.content).length);return e==null||e(kt().setSelection(Et(r.id,o)).setMeta({addToHistory:!1}).build()),!0}}}function g1(){return{name:"setSelection",run:t=>(e,n)=>(n==null||n(kt().setSelection(t.selection).setMeta({addToHistory:!1}).build()),!0)}}function b1(){return{name:"clearSelection",run:()=>(t,e)=>(e==null||e(kt().setSelection({kind:"blocks",blockIds:[]}).setMeta({addToHistory:!1}).build()),!0)}}function v1(){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=Kn(t.doc,o),a=Ve(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 k1(){return{name:"selectBlock",run:t=>(e,n)=>(n==null||n(kt().setSelection({kind:"blocks",blockIds:[t.id]}).setMeta({addToHistory:!1}).build()),!0)}}function y1(t){return{name:"moveBlock",run:e=>(n,r)=>{if(!Yt(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=un(n.doc,a)}}if(e.toParent!==null){const a=Yt(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),Qn(n,l,t),l.setSelection(Et(e.id,0)),r==null||r(l.build()),!0}}}function Oi(t){return{name:"convertBlock",run:e=>(n,r)=>{const o=Yt(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),Qn(n,d,t);const f=Ve(c).length;return d.setSelection(Et(e.id,Math.min(u,f))),r==null||r(d.build()),!0}}}function w1(t){return{name:"moveBlockUp",run:e=>(n,r)=>{const o=Rr(n.doc,e.id);if(!o)return!1;const l=un(n.doc,o.id),s=(l===null?n.doc.root:Kn(n.doc,l).children).indexOf(o.id),c=l,u=kt();return u.moveBlock(e.id,c,Math.max(0,s)),Qn(n,u,t),u.setSelection(Et(e.id,0)),r==null||r(u.build()),!0}}}function x1(t){return{name:"moveBlockDown",run:e=>(n,r)=>{const o=No(n.doc,e.id);if(!o)return!1;const l=un(n.doc,e.id),a=l===null?n.doc.root:Kn(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))),Qn(n,u,t),u.setSelection(Et(e.id,0)),r==null||r(u.build()),!0}}}function E1(t){return{name:"duplicateBlock",run:e=>(n,r)=>{if(!Yt(n.doc,e.id))return!1;const l=[],a=[];for(a.push({id:e.id,parentOldId:un(n.doc,e.id)});a.length>0;){const{id:f,parentOldId:p}=a.pop(),b=Yt(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=Kn(n.doc,f.oldId);let b,g;if(f.oldId===e.id){b=f.parentOldId;const M=b===null?n.doc.root:Kn(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)}Qn(n,u,t);const d=s.get(e.id)??null;return d&&u.setSelection(Et(d,0)),r==null||r(u.build()),!0}}}function C1(t){return{name:"setBlockAlign",run:e=>(n,r)=>{const o=Yt(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 S1(t){return{name:"setBlockColor",run:e=>(n,r)=>{const o=Yt(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 T1(t){return{name:"setBlockBgColor",run:e=>(n,r)=>{const o=Yt(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 M1(){return{name:"setStartNumber",run:t=>(e,n)=>{const r=Yt(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 A1(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||!Yt(n.doc,o))return!1;const a=Bl(n.doc,o);if(!a||!t.registries.schema.get(a.type).nestable||_r(n.doc,a.id)>=Ll)return!1;const c=a.id,u=a.children.length,d=kt();return d.moveBlock(o,c,u),Qn(n,d,t),d.setSelection(Et(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||!Yt(n.doc,o))return!1;const a=un(n.doc,o);if(a===null)return!1;const s=un(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),Qn(n,f,t),f.setSelection(Et(o,0)),r==null||r(f.build()),!0}}}function N1(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=>N1(n,r)))}function B1(t){return{name:"toggleMark",run:e=>(n,r)=>{const o=Yt(n.doc,e.id);if(!o||!t.registries.schema.hasInlineMarks(o.type)||t.registries.schema.isMarkDisallowed(o.type,e.markType))return!1;const l=Ve(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,V=[M,O];a>M&&a<O&&V.push(a),s>M&&s<O&&V.push(s),V.sort((te,D)=>te-D);for(let te=0;te<V.length-1;te++){const D=V[te],F=V[te+1];D>=F||c.push({text:k.text.slice(D-M,F-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=Yt(n.doc,e.id);if(!o||!t.registries.schema.hasInlineMarks(o.type))return!1;const l=Ve(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,V)=>O-V);for(let O=0;O<M.length-1;O++){const V=M[O],te=M[O+1];V>=te||c.push({text:b.text.slice(V-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 I1(t){return{name:"setLink",run:e=>(n,r)=>{const o=Yt(n.doc,e.id);if(!o||!t.registries.schema.hasInlineMarks(o.type))return!1;const l=Ve(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]=Cn(o.content,a),[,d]=Cn(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 _1(t){return{name:"unsetLink",run:e=>(n,r)=>{var f;const o=Yt(n.doc,e.id);if(!o||!t.registries.schema.hasInlineMarks(o.type))return!1;const l=Ve(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),c1(e),u1(),d1(),Dl(e),Ks(e),f1(e),h1(e),m1(),p1(),g1(),v1(),k1(),b1(),y1(e),Oi(e),w1(e),x1(e),E1(e),C1(e),S1(e),T1(e),M1(),A1(e),Ys(e),B1(e),Zs(e),I1(e),_1(e)]}const R1=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform)?"Cmd":"Ctrl",L1={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=L1[n]??n,e.push(n),e.join("-"))}function Js(t,e){return t.replace(/\bMod\b/g,R1).toLowerCase()===e.toLowerCase()}class e0{constructor(){Ft(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(){Ft(this,"rules",[])}register(e){this.rules.push(e)}get all(){return this.rules}}class n0{constructor(){Ft(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(){Ft(this,"toMarkdown",new Map);Ft(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(){Ft(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 O1(t){var e;return((e=t.schema)==null?void 0:e.type)??null}class D1{constructor(){Ft(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 z1{constructor(){Ft(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 H1=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 D1,l=new Ws,a=new e0,s=new t0,c=new n0,u=new z1,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,H1),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){Ft(this,"undoStack",[]);Ft(this,"redoStack",[]);Ft(this,"limit");Ft(this,"manualGroupStack",[]);Ft(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){Ft(this,"registries");Ft(this,"state");Ft(this,"listeners",new Set);Ft(this,"_history");Ft(this,"commands");Ft(this,"editable");Ft(this,"focusBlockId",null);Ft(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?Et(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 W1(this.state.doc)}setDocFromMarkdown(e){this.adoptDoc(Q1(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?Et(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 P1=/([\\`*_[\]])/g;function $1(t){return t.replace(P1,"\\$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}\``:$1(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 F1(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 V1(t,e){return t.length!==e.length?!1:t.every((n,r)=>n.type===e[r].type&&F1(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&&V1(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 U1(t){return t.content.reduce((e,n)=>n.type==="text"?e+n.text:e,"")}function q1(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?"":G1(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 G1(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=_r(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(k=>`${l}> ${k}`));break}case"codeBlock":{const g=typeof((d=r.attrs)==null?void 0:d.language)=="string"&&r.attrs.language?r.attrs.language:"",k=
|
|
3
|
-
`).map(M=>`${l}${M}`),`${l}${E}`];break}case"bulletList":{s=[`${l}- ${a(r)}`];break}case"orderedList":{const g=typeof((f=r.attrs)==null?void 0:f.startNumber)=="number"?r.attrs.startNumber:1;s=[`${l}${g}. ${a(r)}`];break}case"todoList":{const g=((p=r.attrs)==null?void 0:p.checked)===!0;s=[`${l}- ${g?"[x]":"[ ]"} ${a(r)}`];break}case"divider":{s=[`${l}---`];break}case"image":{const g=r.attrs??{},k=typeof g.src=="string"?g.src:"";if(!k)break;const E=typeof g.alt=="string"?g.alt:"",M=typeof g.title=="string"?g.title:"",O=typeof g.caption=="string"?g.caption:"",
|
|
4
|
-
`);s=[`${l}$$$`,...E.map(M=>`${l}${M}`),`${l}$$$`]}break}default:{const g=a(r);g.length>0&&(s=[`${l}${g}`]);break}}const c=[];s.length>0&&c.push({lines:s,level:o,type:r.type});for(const g of r.children)c.push(...d0(t,g));return c}function
|
|
5
|
-
`)}function
|
|
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(k=>`${l}> ${k}`));break}case"codeBlock":{const g=typeof((d=r.attrs)==null?void 0:d.language)=="string"&&r.attrs.language?r.attrs.language:"",k=V1(r),E=k.includes("```")?"````":"```";s=[`${l}${E}${g}`,...k.split(`
|
|
3
|
+
`).map(M=>`${l}${M}`),`${l}${E}`];break}case"bulletList":{s=[`${l}- ${a(r)}`];break}case"orderedList":{const g=typeof((f=r.attrs)==null?void 0:f.startNumber)=="number"?r.attrs.startNumber:1;s=[`${l}${g}. ${a(r)}`];break}case"todoList":{const g=((p=r.attrs)==null?void 0:p.checked)===!0;s=[`${l}- ${g?"[x]":"[ ]"} ${a(r)}`];break}case"divider":{s=[`${l}---`];break}case"image":{const g=r.attrs??{},k=typeof g.src=="string"?g.src:"";if(!k)break;const E=typeof g.alt=="string"?g.alt:"",M=typeof g.title=="string"?g.title:"",O=typeof g.caption=="string"?g.caption:"",P=M?``:``;s=O?[`${l}${P}`,`${l}*${O}*`]:[`${l}${P}`];break}case"table":{s=U1(r.attrs??{});break}case"tableOfContents":{s=[];break}case"equation":{const g=(b=r.attrs)==null?void 0:b.expression,k=typeof g=="string"?g:"";if(k.trim().length>0){const E=k.split(`
|
|
4
|
+
`);s=[`${l}$$$`,...E.map(M=>`${l}${M}`),`${l}$$$`]}break}default:{const g=a(r);g.length>0&&(s=[`${l}${g}`]);break}}const c=[];s.length>0&&c.push({lines:s,level:o,type:r.type});for(const g of r.children)c.push(...d0(t,g));return c}function G1(t){const e=[];for(const o of t.root)e.push(...d0(t,o));const n=[];for(let o=0;o<e.length;o++){const l=e[o];if(o>0){const a=e[o-1];!W1(a,l)&&n.push("")}for(const a of l.lines)n.push(a)}const r=[];for(const o of n)o===""&&(r.length===0||r[r.length-1]==="")||r.push(o);return r.join(`
|
|
5
|
+
`)}function W1(t,e){return t.level!==e.level?!0:u0(t.type)&&u0(e.type)&&t.type===e.type}function K1(t){const e=/^(#{1,6})\s+(.*)$/.exec(t);if(e)return{type:"heading",attrs:{level:e[1].length},content:fo(e[2])};const n=/^>\s?(.*)$/.exec(t);if(n)return{type:"quote",content:fo(n[1]??"")};const r=/^[-*+]\s+\[([ xX])\]\s+(.*)$/.exec(t);if(r)return{type:"todoList",attrs:{checked:r[1].toLowerCase()==="x"},content:fo(r[2])};const o=/^(\d+)\.\s+(.*)$/.exec(t);if(o)return{type:"orderedList",attrs:{startNumber:Number(o[1])},content:fo(o[2])};const l=/^[-*+]\s+(.*)$/.exec(t);if(l)return{type:"bulletList",content:fo(l[1])};if(/^-{3,}$/.test(t)||/^\*{3,}$/.test(t)||/^_{3,}$/.test(t))return{type:"divider"};const a=/^!\[([^\]]*)\]\((\S+?)(?:\s+"([^"]*)")?\)$/.exec(t.trim());if(a){const s={src:a[2]??"",alt:a[1]??""};return a[3]&&(s.title=a[3]),{type:"image",attrs:s}}return t.trim().length===0?null:{type:"paragraph",content:fo(t)}}function Y1(t){const e=t.replace(/\r\n/g,`
|
|
6
6
|
`).split(`
|
|
7
|
-
`),n=[];let r=[],o=0;const l=()=>{r.length>0&&n.push({kind:"lines",lines:r}),r=[]};for(;o<e.length;){const a=e[o]??"",s=/^(\s*)(```+|~~~+)\s*(\S*)\s*$/.exec(a);if(s){l();const u=s[2][0],d=s[3]??"",f=[];for(o+=1;o<e.length;){const p=e[o];if(new RegExp(`^\\s*${u}{3,}\\s*$`).test(p))break;f.push(p),o+=1}n.push({kind:"fence",lang:d,body:f}),o+=1;continue}if(/^\s*\$\$\s*$/.exec(a)){l();const u=[];for(o+=1;o<e.length;){const d=e[o];if(/^\s*\$\$\s*$/.test(d))break;u.push(d),o+=1}n.push({kind:"math",body:u}),o+=1;continue}if(a.includes("|")&&o+1<e.length&&/^\s*\|?\s*:?-{2,}:?\s*(\|\s*:?-{2,}:?\s*)+\|?\s*$/.test(e[o+1]??"")){l();const u=[a,e[o+1]];for(o+=2;o<e.length&&(e[o]??"").includes("|");)u.push(e[o]),o+=1;n.push({kind:"table",lines:u});continue}r.push(a),o+=1}return l(),n}function
|
|
8
|
-
`).replace(/\\\|/g,"|").replace(/\\\\/g,"\\")}function
|
|
9
|
-
`)}]}});continue}if(f.kind==="table"){e.push({indent:0,block:
|
|
10
|
-
`)},content:[]}});continue}const p=[];let b=!1;for(const g of f.lines){if(g.trim().length===0){b=!0;continue}const k=g.length-g.trimStart().length,E=
|
|
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,V=b>0?{...O,indent:b}:O;r.set(f,{...p,attrs:V})}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 Xn(){const t=i.inject(Hl);if(!t)throw new Error("useEditor(): must be called within a <BlockEditor> component tree");return t}function J1(){return i.inject(m0,null)}function Lr(){return i.inject(h0)??i.ref(!0)}function e3(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 t3=t=>`[data-block-id="${CSS.escape(t)}"]`;function ii(t,e){const n=t3(e),r=t.querySelector(`${n}[contenteditable], ${n} [contenteditable]`);return r||t.querySelector(n)}function n3(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=n3(o),s=e.blocks.get(l);if(!s)return null;const c=Ve(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 Et(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 r3(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=Ve(c.content).length,d=Math.min(r3(a,o.startContainer,o.startOffset),u);return{blockEl:a,blockId:s,offset:d}}}}}return o3(t,e,n,r)}function o3(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=Ve(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)),V=Math.max(M.top,Math.min(e,M.bottom)),te=Math.hypot(t-O,e-V),D=M.width>0?Math.round((t-M.left)/M.width*k):0,F=f+Math.max(0,Math.min(k,D));(!d||te<d.dist)&&(d={offset:F,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 yn(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=Ve(b.content).length;let E=0,M=k;if(f===c){const V=a===n.anchor.blockId?n.anchor.offset:n.focus.offset;E=Math.min(V,k)}if(f===u){const V=s===n.anchor.blockId?n.anchor.offset:n.focus.offset;M=Math.min(V,k)}const O=g0(g,E,Math.max(E,M));if(O)for(const V of O.getClientRects())V.width>0&&V.height>0&&d.push(V)}return d}function i3(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:Ir(b)})}p(d)}finally{o.history.endGroup()}return!0}}return!1}function l3(t){return t.includes("/")?t.startsWith("/")||/^\s*\/\S*/.test(t):!1}const a3=["http:","https:","mailto:","tel:"],s3=["javascript:","vbscript:","data:","file:"];function Or(t){const e=t.trim();if(!e)return null;const n=e.toLowerCase();for(const l of s3)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 a3.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 V=c.slice(f,k);V.length>0&&n.push({type:"text",text:V,marks:u.length>0?[...u]:void 0})}const M=ho(g),O=Or(M);if(O){const V={type:"link",attrs:{href:O}};n.push({type:"text",text:g,marks:[...u,V]})}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 c3={bold:["b","strong"],italic:["i","em"],underline:["u"],strikethrough:["s","strike","del"],code:["code"],link:["a"]},k0={};for(const[t,e]of Object.entries(c3))for(const n of e)k0[n]=t;const u3="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 d3(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function f3(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=d3(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=Or(u);b&&(n=`<a href="${f3(b)}" target="_blank" rel="noopener noreferrer">${n}</a>`)}return n}).join("")}function h3(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 Jn(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=Or(u);d?c=[...o,{type:"link",attrs:{href:d}}]:c=o}else if(s)c=[...o,{type:s}];else if(a==="span"){const u=h3(l);u.length>0&&(c=[...o,...u])}for(const u of l.childNodes)n(u,c)}return n(t,[]),g3(e)}function m3(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 p3(t,e){return!t&&!e?!0:!t||!e||t.length!==e.length?!1:t.every(n=>e.some(r=>m3(n,r)))}function g3(t){const e=[];for(const n of t){const r=e[e.length-1];r&&p3(r.marks,n.marks)?e[e.length-1]={type:"text",text:r.text+n.text,marks:r.marks}:e.push({...n})}return e}function b3(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}:${b3(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"],v3=["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=>v3.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:Or(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 Dr(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 D=!1;for(let F=b;F>=0&&!D;F--)for(let ie=g;ie>=0&&!D;ie--){const Q=(f=t.cells[F])==null?void 0:f[ie];!Q||Q.covered||F+Math.max(1,Q.rowspan)>b&&ie+Math.max(1,Q.colspan)>g&&(E=F,M=ie,D=!0)}if(!D)continue}const O=(p=t.cells[E])==null?void 0:p[M];if(!O||O.covered)continue;const V=E+Math.max(1,O.rowspan)-1,te=M+Math.max(1,O.colspan)-1;l>E&&(l=E,u=!0),a<V&&(a=V,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 k3(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 y3(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(w3(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=zr(c,r,o),{rows:r,cols:o,cells:c,colWidths:l,headerRow:s}}function w3(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 zr(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=zr(c,n+1,r);return{rows:n+1,cols:r,cells:d,colWidths:[...l],headerRow:a}}function x3(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=zr(s,n-1,r);return{rows:n-1,cols:r,cells:u,colWidths:[...o],headerRow:c}}function E3(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=zr(c,n,r+1);return{rows:n,cols:r+1,cells:p,colWidths:u,headerRow:a}}function C3(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=zr(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 S3(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 T3(t,e,n,r,o){var D,F,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 re=s;re<=c;re++)u[Q][re]={content:[],rowspan:1,colspan:1,covered:!1};let d=l,f=s;for(;d>=0&&((F=(D=t.cells[d])==null?void 0:D[f])!=null&&F.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,V=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:V};const te=zr(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=zr(a,t.rows,t.cols);return{...t,cells:s}}function M3(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 A3(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 N3(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=L3(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=I3(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 $3(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=Jn(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 F3=L0;function V3(){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 U3=V3,Vi=new Set;function q3(){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 G3(t){for(const e of t)pr(e,null)}function W3(t){G3(t)}let jl=null;function K3(t){jl=t}const Y3=K3;function O0(t,e,n,r){if(!jl){r.onError("Upload handler not registered");return}jl(t,e,n,r)}function X3(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 Z3(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 j3(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 j3(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 Q3=["data-block-id","data-empty","data-placeholder","contenteditable"],Hr=i.defineComponent({__name:"BlockContent",props:{block:{},placeholder:{}},emits:["slashTrigger","inputChanged","linkClick","focusIn"],setup(t,{emit:e}){const n=t,r=e,o=Xn(),l=Lr(),a=i.ref(null),s=i.shallowRef(!1);function c(){return Ve(n.block.content).length===0}const u=i.ref(c());i.onMounted(()=>{const H=a.value;if(!H)return;const $=Ve(n.block.content);y0(n.block.content)?H.innerHTML=Qr(n.block.content):H.textContent=$,u.value=$.length===0});function d(H){const $=window.getSelection();if(!$||$.rangeCount===0)return null;const K=$.getRangeAt(0);if(!H.contains(K.commonAncestorContainer))return null;const Y=document.createRange();Y.selectNodeContents(H),Y.setEnd(K.startContainer,K.startOffset);const N=Y.toString().length;Y.setEnd(K.endContainer,K.endOffset);const A=Y.toString().length;return{from:Math.min(N,A),to:Math.max(N,A)}}function f(H,$){const K=document.createTreeWalker(H,NodeFilter.SHOW_TEXT);let Y=Math.max(0,$),N=null;for(;K.nextNode();){const A=K.currentNode;N=A;const j=(A.nodeValue??"").length;if(Y<=j)return{node:A,offset:Y};Y-=j}return N?{node:N,offset:(N.nodeValue??"").length}:{node:H,offset:0}}function p(H,$,K){const Y=window.getSelection();if(!Y)return;const N=f(H,$),A=f(H,Math.max($,K));try{const j=document.createRange();$<=K?(j.setStart(N.node,N.offset),j.setEnd(A.node,A.offset)):(j.setStart(A.node,A.offset),j.setEnd(N.node,N.offset)),Y.removeAllRanges(),Y.addRange(j)}catch{try{const j=document.createRange();j.setStart(A.node,A.offset),j.collapse(!0),Y.removeAllRanges(),Y.addRange(j)}catch{}}}i.watch(()=>n.block,H=>{if(s.value)return;const $=a.value;if(!$)return;const K=d($),Y=K&&K.from!==K.to,N=document.activeElement===$,A=Ve(H.content),j=A.length===0;let U=!1;if(j)$.childNodes.length>0&&($.textContent="",U=!0);else{const P=y0(H.content),ge=!!$.querySelector(u3);if(!P&&!ge)$.textContent!==A&&($.textContent=A,U=!0);else{const Ee=w0(Jn($)),Me=w0(H.content);Ee!==Me&&($.innerHTML=Qr(H.content),U=!0)}}u.value=j,U&&K&&(N||Y)&&p($,K.from,K.to)});function b(H){H.key==="Enter"&&!H.shiftKey&&!H.isComposing&&H.preventDefault()}function g(H){var U,P;if(!l.value)return;const $=a.value;if(!$)return;const K=Jn($),Y=Ve(K);if(u.value=Y.length===0,r("inputChanged",n.block.id,Y),s.value||i3({editor:o,registry:o.registries.inputRules,blockId:n.block.id,text:Y}))return;if(l3(Y)){const ge=Y.match(/\/([^/]*)$/),Ee=Y.lastIndexOf("/"),Me=ge&&ge[1]!==void 0?ge[1]:Ee>=0?Y.slice(Ee+1):"";r("slashTrigger",$,n.block.id,Me)}let A=K;o.registries.schema.get(n.block.type).inlineMarks&&H.data&&/\s/.test(H.data)&&(A=Hi(K)),(P=(U=o.commands).setText)==null||P.call(U,{id:n.block.id,content:A})}function k(H){s.value=!0}function E(H){var j,U;if(s.value=!1,!l.value)return;const $=a.value;if(!$)return;const K=Jn($),Y=Ve(K);u.value=Y.length===0,r("inputChanged",n.block.id,Y);const A=o.registries.schema.get(n.block.type).inlineMarks?Hi(K):K;(U=(j=o.commands).setText)==null||U.call(j,{id:n.block.id,content:A})}function M(){const H=a.value;if(!H)return null;const $=window.getSelection();if(!$||$.rangeCount===0)return null;const K=$.getRangeAt(0);if(!H.contains(K.commonAncestorContainer))return null;const Y=Ve(n.block.content),N=document.createRange();N.selectNodeContents(H),N.setEnd(K.startContainer,K.startOffset);const A=Math.min(N.toString().length,Y.length);N.setEnd(K.endContainer,K.endOffset);const j=Math.min(N.toString().length,Y.length);return[Math.min(A,j),Math.max(A,j)]}function O(H){var P,ge;const $=M();if(!$)return;const[K,Y]=$;if(K===Y)return;const[,N]=Cn(n.block.content,K),[A]=Cn(N,Y-K),j=Ve(A),U=Qr(A);H.preventDefault(),(P=H.clipboardData)==null||P.setData("text/plain",j),(ge=H.clipboardData)==null||ge.setData("text/html",U)}function V(H){var Ee,Me,ae,Ce;if(!l.value){H.preventDefault();return}const $=M();if(!$)return;const[K,Y]=$;if(K===Y)return;const[N,A]=Cn(n.block.content,K),[j,U]=Cn(A,Y-K),P=Ve(j),ge=Qr(j);H.preventDefault(),(Ee=H.clipboardData)==null||Ee.setData("text/plain",P),(Me=H.clipboardData)==null||Me.setData("text/html",ge),(Ce=(ae=o.commands).setText)==null||Ce.call(ae,{id:n.block.id,content:[...N,...U],selectionAfter:Et(n.block.id,K)})}const te=J1();function D(H){const $=[],K=new Set;if(H.items&&H.items.length>0)for(let Y=0;Y<H.items.length;Y++){const N=H.items[Y];if(N.kind!=="file")continue;const A=N.getAsFile();if(!A||!A.type.startsWith("image/"))continue;const j=`${A.name||""}:${A.size}:${A.type}`;K.has(j)||(K.add(j),$.push(A))}if(H.files&&H.files.length>0)for(let Y=0;Y<H.files.length;Y++){const N=H.files[Y];if(!N.type.startsWith("image/"))continue;const A=`${N.name||""}:${N.size}:${N.type}`;K.has(A)||(K.add(A),$.push(N))}return $}async function F(H){var qt,rn,pn,Gt,dt,jt,on,ft,Ge,St,He,Pt,Fe,Ke,Qt,gt,Tt,Ct,z,I,ne,Te,Ye,lt,gn,bn,ln,ir,at,An,Sn,Un;if(!l.value){H.preventDefault();return}const $=H.clipboardData;if(!$)return;if(te){const ht=D($);if(ht.length>0){H.preventDefault();let wt=n.block.id;for(let We=0;We<ht.length;We++){const Xe=ht[We],mt=await te(Xe,{relativeToBlockId:wt,convertIfEmpty:We===0,position:"after"});mt&&(wt=mt)}return}}const K=$.getData("text/html"),Y=$.getData("text/plain"),N=O3(K||null,Y||null);if(N.length===0)return;const A=N.some(ht=>ht.type==="image"),j=M(),U=Ve(n.block.content).length,P=j?j[0]:U,ge=j?j[1]:U,[Ee]=Cn(n.block.content,P),[,Me]=Cn(n.block.content,ge),ae=o.registries.schema.get(n.block.type),Ce=ht=>ae.inlineMarks?ht:ht.map(wt=>({type:"text",text:wt.text}));if(!A){if(N.length===1){const We=Ce(N[0].content);if(ae.inlineMarks&&P<ge&&We.length===1&&We[0].type==="text"&&!We[0].marks){const Lt=We[0].text;if(Fl(Lt)){const Nn=ho(Lt),En=Or(Nn);if(En){(rn=(qt=o.commands).setLink)==null||rn.call(qt,{id:n.block.id,href:En,from:P,to:ge});return}}}const Xe=[...Ee,...We,...Me],mt=ae.inlineMarks?Hi(Xe):Xe,an=Ve(Ee).length,Mt=Ve(We).length,Rt=an+Mt;(Gt=(pn=o.commands).setText)==null||Gt.call(pn,{id:n.block.id,content:mt,selectionAfter:Et(n.block.id,Rt)});return}const ht=[...Ee,...Ce(N[0].content)];(jt=(dt=o.commands).setText)==null||jt.call(dt,{id:n.block.id,content:ht});let wt=n.block.id;for(let We=1;We<N.length;We++){const Xe=N[We],mt=We===N.length-1,an=Ce(Xe.content),Mt=mt?[...an,...Me]:an,Rt=o.registries.schema.coerceAttrsFor(Xe.type,Xe.attrs);(ft=(on=o.commands).insertBlock)==null||ft.call(on,{after:wt,type:Xe.type,attrs:Rt,content:Mt});const Lt=o.getState();if(Lt.selection.kind==="caret"&&(wt=Lt.selection.blockId),mt){const Nn=Ve(an).length,En=Me.length>0?Nn:Ve(Mt).length;(St=(Ge=o.commands).setSelection)==null||St.call(Ge,{selection:Et(wt,En)})}}return}if(!te){const ht=N.filter(wt=>wt.type!=="image");if(ht.length===0)return;if(N.splice(0,N.length,...ht),N.length===1){const wt=Ce(N[0].content),We=[...Ee,...wt,...Me];(Pt=(He=o.commands).setText)==null||Pt.call(He,{id:n.block.id,content:We,selectionAfter:Et(n.block.id,Ve(Ee).length+Ve(wt).length)})}return}let $e=-1;for(let ht=N.length-1;ht>=0;ht--)if(N[ht].type!=="image"){$e=ht;break}let we=n.block.id;const tt=N[0];if(tt.type!=="image"){const wt=$e===0?[...Ee,...Ce(tt.content),...Me]:[...Ee,...Ce(tt.content)];(Ke=(Fe=o.commands).setText)==null||Ke.call(Fe,{id:n.block.id,content:wt}),we=n.block.id}else{const ht=Ee.length===0&&Me.length===0,wt=tt.attrs.src,We=tt.attrs.alt??"";if(ht){const Xe=await Ql(wt,We||void 0);if(Xe){const mt=await te(Xe,{relativeToBlockId:we,position:"after",convertIfEmpty:!0});mt&&(we=mt)}else{const mt=o.registries.schema.coerceAttrsFor(tt.type,tt.attrs);(gt=(Qt=o.commands).replaceBlock)==null||gt.call(Qt,{id:n.block.id,type:tt.type,attrs:mt}),we=n.block.id}}else{(Ct=(Tt=o.commands).setText)==null||Ct.call(Tt,{id:n.block.id,content:Ee});const Xe=await Ql(wt,We||void 0);if(Xe){const mt=await te(Xe,{relativeToBlockId:we,position:"after",convertIfEmpty:!1});mt&&(we=mt)}else{const mt=o.registries.schema.coerceAttrsFor(tt.type,tt.attrs);(I=(z=o.commands).insertBlock)==null||I.call(z,{after:we,type:tt.type,attrs:mt,content:[]});const an=o.getState();an.selection.kind==="caret"&&(we=an.selection.blockId)}}}for(let ht=1;ht<N.length;ht++){const wt=N[ht],We=ht===$e;if(wt.type==="image"){const Xe=wt.attrs.src,mt=wt.attrs.alt??"",an=await Ql(Xe,mt||void 0);if(an){const Mt=await te(an,{relativeToBlockId:we,position:"after",convertIfEmpty:!1});Mt&&(we=Mt)}else{const Mt=o.registries.schema.coerceAttrsFor(wt.type,wt.attrs);(Te=(ne=o.commands).insertBlock)==null||Te.call(ne,{after:we,type:wt.type,attrs:Mt,content:[]});const Rt=o.getState();Rt.selection.kind==="caret"&&(we=Rt.selection.blockId)}}else{const Xe=Ce(wt.content),mt=We?[...Xe,...Me]:Xe,an=o.registries.schema.coerceAttrsFor(wt.type,wt.attrs);(lt=(Ye=o.commands).insertBlock)==null||lt.call(Ye,{after:we,type:wt.type,attrs:an,content:mt});const Mt=o.getState();if(Mt.selection.kind==="caret"&&(we=Mt.selection.blockId),We){const Rt=Ve(Xe).length,Lt=Me.length>0?Rt:Ve(mt).length;(bn=(gn=o.commands).setSelection)==null||bn.call(gn,{selection:Et(we,Lt)})}}}if($e===-1&&Me.length>0){(ir=(ln=o.commands).insertBlock)==null||ir.call(ln,{after:we,type:"paragraph",attrs:{},content:Me});const ht=o.getState();ht.selection.kind==="caret"&&(we=ht.selection.blockId,(An=(at=o.commands).setSelection)==null||An.call(at,{selection:Et(we,Ve(Me).length)}))}else $e===-1&&(Ee.length>0||Me.length>0)&&((Un=(Sn=o.commands).insertBlock)==null||Un.call(Sn,{after:we,type:"paragraph",attrs:{},content:[]}))}function ie(){r("focusIn",n.block.id)}function Q(){}function re(H){return document.createTreeWalker(H,NodeFilter.SHOW_TEXT).nextNode()}function _(H){var j;const $=H.target;if(!$)return;const K=$.closest("a");if(!K||!((j=a.value)!=null&&j.contains(K)))return;H.preventDefault();const Y=window.getSelection();let N=0;if(Y&&Y.rangeCount>0&&!!K.contains(Y.getRangeAt(0).commonAncestorContainer)){const U=Y.getRangeAt(0),P=document.createRange();P.selectNodeContents(a.value),P.setEnd(U.startContainer,U.startOffset),N=P.toString().length}else{const U=re(K);if(U){const P=document.createRange();P.selectNodeContents(a.value),P.setEnd(U,0),N=P.toString().length}}r("linkClick",n.block.id,N)}return(H,$)=>(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(F,["prevent"]),onCopy:O,onCut:V},null,40,Q3))}});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 J3={"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 ef(t,e){i.provide($0,t),i.provide(F0,e)}function _n(){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=J3[t.value][n];return typeof o=="string"?o:n}}}const tf=["title","aria-label","onKeydown"],nf=["title","aria-label","onKeydown"],rf=4,of=300,lf=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}=_n(),a=Lr(),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 Y;const H=(Y=s.value)==null?void 0:Y.parentElement;if(!H)return null;const $=H.querySelector(".block-host-content");if(!$)return null;const K=$.firstElementChild;return K instanceof HTMLElement?K:$}function E(){var N;const H=(N=s.value)==null?void 0:N.parentElement,$=k();if(!H||!$)return;const K=H.getBoundingClientRect(),Y=$.getBoundingClientRect();p.value=Y.top-K.top+Y.height/2}function M(){const H=k();H&&(O(),b=new ResizeObserver(()=>E()),b.observe(H))}function O(){b==null||b.disconnect(),b=null}i.watch(()=>r.visible,H=>{H?i.nextTick().then(()=>{E(),M()}):O()}),i.onMounted(E),i.onBeforeUnmount(O);function V(){a.value&&c.value&&o("openPlusMenu",c.value)}let te=0,D=0,F=0,ie=!1;function Q(H){a.value&&(F=Date.now(),te=H.clientX,D=H.clientY,ie=!0,f.value=!1,o("gripPointerDown",r.blockId,te,D,{thresholdPx:rf}))}function re(H){f.value=H}function _(){a.value&&(f.value||ie&&Date.now()-F>of||(ie=!1,u.value&&o("openSettingsMenu",u.value)))}return e({isOpen:d,insertBtn:c,gripBtn:u,setLocalDragging:re}),(H,$)=>(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(V,["prevent","stop"]),onKeydown:[i.withKeys(i.withModifiers(V,["prevent","stop"]),["enter"]),i.withKeys(i.withModifiers(V,["prevent","stop"]),["space"])]},[...$[0]||($[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,tf),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"])]},[...$[1]||($[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,nf)],6))}}),af=["data-block-id","data-block-type"],sf={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=Xn(),a=Lr(),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(_,H,$,K){o("gripPointerDown",_,H,$,K)}function k(_){o("gripPointerUp",_)}function E(_){var H,$;($=(H=c.value)==null?void 0:H.setLocalDragging)==null||$.call(H,_)}function M(){o("hoverChange",r.block.id)}function O(){o("hoverChange",null)}function V(_){o("openPlusMenu",r.block.id,_)}function te(_){o("openSettingsMenu",r.block.id,_)}function D(_,H,$){o("slashTrigger",_,r.block.id,$)}function F(_,H){o("inputChanged",_,H)}function ie(_,H){o("linkClick",_,H)}function Q(_){o("focusIn",_)}const re=i.computed(()=>{const _=l.registries.renderers.get(r.block.type);return _!=null&&_.component?_.component:Hr});return e({setHandleDragging:E}),(_,H)=>(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(lf,{key:0,ref_key:"handleRef",ref:c,"block-id":t.block.id,visible:u.value,onOpenPlusMenu:V,onOpenSettingsMenu:te,onGripPointerDown:g,onGripPointerUp:k},null,8,["block-id","visible"])):i.createCommentVNode("",!0),i.createElementVNode("div",sf,[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(re.value),{block:t.block,placeholder:t.placeholder,onSlashTrigger:D,onInputChanged:F,onLinkClick:ie,onFocusIn:Q},null,40,["block","placeholder"]))])],42,af))}}),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(D,F){F?l.set(D,F):l.delete(D)}function s(D,F){var ie,Q;(Q=(ie=l.get(D))==null?void 0:ie.setHandleDragging)==null||Q.call(ie,F)}function c(D){const F=[];for(const ie of D.children){const Q=r.blocksMap.get(ie);Q&&F.push({id:ie,block:Q})}return F}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(D,F){o("openSettingsMenu",D,F)}function p(D,F){o("openPlusMenu",D,F)}function b(D,F,ie){o("slashTrigger",D,F,ie)}function g(D,F){o("inputChanged",D,F)}function k(D){o("hoverChange",D)}function E(){r.isNested||o("hoverChange",null)}function M(D,F,ie,Q){o("gripPointerDown",D,F,ie,Q)}function O(D){o("gripPointerUp",D)}function V(D,F){o("linkClick",D,F)}function te(D){o("focusIn",D)}return e({setBlockHandleDragging:s}),(D,F)=>{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,re)=>(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&&re===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:V,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:F[0]||(F[0]=(_,H)=>o("openSettingsMenu",_,H)),onOpenPlusMenu:F[1]||(F[1]=(_,H)=>o("openPlusMenu",_,H)),onSlashTrigger:F[2]||(F[2]=(_,H,$)=>o("slashTrigger",_,H,$)),onInputChanged:F[3]||(F[3]=(_,H)=>o("inputChanged",_,H)),onHoverChange:F[4]||(F[4]=_=>o("hoverChange",_)),onGripPointerDown:F[5]||(F[5]=(_,H,$,K)=>o("gripPointerDown",_,H,$,K)),onGripPointerUp:F[6]||(F[6]=_=>o("gripPointerUp",_)),onLinkClick:F[7]||(F[7]=(_,H)=>o("linkClick",_,H)),onFocusIn:F[8]||(F[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=cf(),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,V=s.top-r;g?(k=Math.max(r+a,V-n.height),E=V,M=Math.max(120,f)):(k=O,E=k+n.height,M=Math.max(120,d));const te=u-n.width-r,D=Math.max(r,Math.min(te,s.left));return{top:k,left:D,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 cf(){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 uf=["innerHTML"],Rn=i.defineComponent({__name:"SafeHtml",props:{html:{default:""}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("span",{innerHTML:t.html},null,8,uf))}}),df=["aria-label"],ff={key:0,class:"slash-menu-empty"},hf={key:0,class:"slash-menu-group-label"},mf=["aria-selected","onMousedown","onMouseenter"],pf={class:"slash-menu-text"},gf={class:"slash-menu-title"},bf={key:0,class:"slash-menu-desc"},vf=["aria-label"],ta=300,kf=80,W0=24,yf=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}=_n(),a=i.computed(()=>({basic:l("plus.category.basic"),list:l("plus.category.list"),other:l("plus.category.other")})),s=Xn(),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,N=>{N?(M&&(clearTimeout(M),M=null),E.value=!0):M=setTimeout(()=>{E.value=!1,M=null},300)},{immediate:!0});function O(N){return typeof N=="string"?N:"•"}const V=i.computed(()=>{const N=r.query.trim().toLowerCase(),A=s.registries.slash.all;return N?A.filter(j=>(l(j.title)+" "+(j.keywords??[]).join(" ")).toLowerCase().includes(N)):A}),te=i.computed(()=>{const N=[],A=new Map;for(const U of V.value){const P=U.category??"other";A.has(P)||A.set(P,[]),A.get(P).push(U)}const j=["basic","list","other"];for(const U of j){const P=A.get(U);P&&P.length>0&&N.push({category:U,label:a.value[U]??U,items:P})}for(const[U,P]of A)j.includes(U)||N.push({category:U,label:a.value[U]??U,items:P});return N});function D(N){return V.value.findIndex(A=>A.id===N)}i.watch([V,()=>r.visible],()=>{f.value=0,i.nextTick(()=>{d.value&&(d.value.scrollTop=0),F()})});function F(){const N=d.value;N&&(g.value=N.scrollTop>1,k.value=N.scrollTop+N.clientHeight<N.scrollHeight-1)}function ie(){const N=d.value;N&&(N.scrollTop-=N.clientHeight*.8)}function Q(){const N=d.value;N&&(N.scrollTop+=N.clientHeight*.8)}Ui(d,F),i.watch(()=>r.visible,N=>{N&&(b.value=!1,p.value={top:0,left:0,availableHeight:360,above:!1,bottom:0,topBaseline:0})}),i.watch([()=>r.visible,()=>r.anchorEl,u,V,g,k],async()=>{if(!r.visible||!r.anchorEl||!r.rootEl)return;await i.nextTick();const N=u.value;if(!N)return;const A=N.getBoundingClientRect(),j=!!r.anchorEl.closest(".fixed-toolbar"),U=j?c.value?"up":"down":"auto",P=j?10:0,ge=q0(r.rootEl,r.anchorEl,{width:ta,height:A.height},6,U,P,P);p.value=ge,b.value=!0,i.nextTick(F)},{flush:"post"});const re=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 N=p.value.above,A=p.value.left,j=(g.value?W0:0)+(k.value?W0:0),U=p.value.availableHeight-j,P={left:`${A}px`,width:`${ta}px`,maxHeight:`${p.value.availableHeight}px`,"--scroll-max-height":`${Math.max(kf,U)}px`};if(N){const ge=document.documentElement.clientHeight;P.bottom=`${Math.max(0,ge-p.value.bottom)}px`,P.top="auto"}else P.top=`${p.value.top}px`,P.bottom="auto";return P});function _(N){if(V.value.length===0)return;const A=V.value.length;f.value=((f.value+N)%A+A)%A,H()}function H(){var j;const N=(j=d.value)==null?void 0:j.querySelectorAll(".slash-menu-item"),A=N==null?void 0:N[f.value];A&&A.scrollIntoView({block:"nearest"}),i.nextTick(F)}function $(N){switch(N.key){case"ArrowDown":return N.preventDefault(),_(1),!0;case"ArrowUp":return N.preventDefault(),_(-1),!0;case"PageDown":return N.preventDefault(),_(5),!0;case"PageUp":return N.preventDefault(),_(-5),!0;case"Home":return N.preventDefault(),f.value=0,H(),!0;case"End":return N.preventDefault(),f.value=Math.max(0,V.value.length-1),H(),!0;case"Enter":return N.preventDefault(),K(),!0;case"Escape":return N.preventDefault(),o("close"),!0;default:return!1}}function K(){const N=V.value[f.value];N&&o("commit",N,r.mode),o("close")}function Y(N){const A=V.value.indexOf(N);A>=0&&(f.value=A),K()}return e({onKeyDown:$}),G0(u,()=>r.visible,()=>o("close"),()=>r.anchorEl),i.onMounted(()=>{window.addEventListener("resize",F)}),i.onBeforeUnmount(()=>{window.removeEventListener("resize",F)}),(N,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(re.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,df)):i.createCommentVNode("",!0),i.createElementVNode("div",{ref_key:"scrollEl",ref:d,class:"slash-menu-scroll",onScroll:F},[V.value.length===0?(i.openBlock(),i.createElementBlock("div",ff,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",hf,i.toDisplayString(j.label),1)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(j.items,U=>(i.openBlock(),i.createElementBlock("div",{key:U.id,class:i.normalizeClass(["slash-menu-item",{active:D(U.id)===f.value}]),"aria-selected":D(U.id)===f.value,role:"option",onMousedown:i.withModifiers(P=>Y(U),["prevent"]),onMouseenter:P=>f.value=D(U.id)},[i.createVNode(Rn,{class:"slash-menu-icon",html:O(U.icon)},null,8,["html"]),i.createElementVNode("div",pf,[i.createElementVNode("div",gf,i.toDisplayString(i.unref(l)(U.title)),1),U.description?(i.openBlock(),i.createElementBlock("div",bf,i.toDisplayString(i.unref(l)(U.description)),1)):i.createCommentVNode("",!0)])],42,mf))),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,vf)):i.createCommentVNode("",!0)],6)):i.createCommentVNode("",!0)]))}}),wf=["left","center","right","justify"],xf=10,Ln={align:{default:"left",validate:t=>wf.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<=xf}},Ef={align:Ln.align,color:Ln.color,bgColor:Ln.bgColor},Cf={indent:Ln.indent};function er(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>',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"><line x1="2" y1="8" x2="14" y2="8"/></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"><path d="M2 3.5h10M2 8h10M2 12.5h10"/><path d="M14.5 3.5v.01M14.5 8v.01M14.5 12.5v.01"/></svg>',Mf='<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>',Af='<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>',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="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>',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="M4 4L12 12"/><path d="M12 4L4 12"/></svg>',If='<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>',_f='<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>',X0='<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,Z0=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>',j0='<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}=_n(),a=Xn(),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,z=>{z?(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 V=null;const te=i.computed(()=>r.blockId!=null?O.value.doc.blocks.get(r.blockId):void 0),D=i.ref(void 0),F=i.computed(()=>{var I;const z=(I=te.value)==null?void 0:I.attrs.align;return typeof z=="string"?z:"left"}),ie=i.computed(()=>{const z=D.value;return z?!("align"in a.registries.schema.get(z).attrs):!0}),Q=i.computed(()=>D.value==="image"||D.value==="table"),re=i.computed(()=>D.value==="divider"||D.value==="tableOfContents"),_=i.computed(()=>D.value==="divider"||D.value==="table"||D.value==="tableOfContents"||D.value==="equation"),H=i.computed(()=>{const z=D.value;if(!z)return!0;const I=a.registries.schema.get(z);return!("color"in I.attrs)||!("bgColor"in I.attrs)}),$=i.computed(()=>{const z=te.value;return z?_r(O.value.doc,z.id):0});function K(z){return["paragraph","heading","orderedList","bulletList","todoList"].includes(z)}const Y=i.computed(()=>!!D.value),N=i.computed(()=>{const z=te.value;if(!z)return!0;const I=O.value.doc,ne=Bl(I,z.id);return!ne||!K(ne.type)||_r(I,ne.id)>=10}),A=i.computed(()=>$.value<=0),j=i.computed(()=>{var I;const z=(I=te.value)==null?void 0:I.attrs.color;return typeof z=="string"?z:"default"}),U=i.computed(()=>{var I;const z=(I=te.value)==null?void 0:I.attrs.bgColor;return typeof z=="string"?z:"default"});function P(z,I){var lt,gn,bn,ln,ir,at;const ne=r.blockId;if(!ne)return;const Te=a.getState().doc.blocks.get(ne);if(!Te)return;if(z==="equation"){const An=Ve(Te.content);(gn=(lt=a.commands).convertBlock)==null||gn.call(lt,{id:ne,type:"equation",attrs:{expression:An}});return}const Ye=Te.type==="equation"?String(Te.attrs.expression??""):"";if((ln=(bn=a.commands).convertBlock)==null||ln.call(bn,{id:ne,type:z,attrs:I}),Ye){const An=a.registries.schema.get(z);An&&An.content==="text"&&((at=(ir=a.commands).setText)==null||at.call(ir,{id:ne,content:Ir(Ye)}))}}const ge=i.computed(()=>[{id:"paragraph",iconHtml:na,title:l("turnInto.paragraph"),kind:"turnInto",run:()=>void P("paragraph")},{id:"h1",iconHtml:ra,title:l("turnInto.h1"),kind:"turnInto",run:()=>void P("heading",{level:1})},{id:"h2",iconHtml:oa,title:l("turnInto.h2"),kind:"turnInto",run:()=>void P("heading",{level:2})},{id:"h3",iconHtml:ia,title:l("turnInto.h3"),kind:"turnInto",run:()=>void P("heading",{level:3})},{id:"h4",iconHtml:la,title:l("turnInto.h4"),kind:"turnInto",run:()=>void P("heading",{level:4})},{id:"h5",iconHtml:aa,title:l("turnInto.h5"),kind:"turnInto",run:()=>void P("heading",{level:5})},{id:"h6",iconHtml:sa,title:l("turnInto.h6"),kind:"turnInto",run:()=>void P("heading",{level:6})},{id:"bullet",iconHtml:ca,title:l("turnInto.bullet"),kind:"turnInto",run:()=>void P("bulletList")},{id:"ordered",iconHtml:ua,title:l("turnInto.ordered"),kind:"turnInto",run:()=>void P("orderedList")},{id:"todo",iconHtml:da,title:l("turnInto.todo"),kind:"turnInto",run:()=>void P("todoList",{checked:!1})},{id:"quote",iconHtml:fa,title:l("turnInto.quote"),kind:"turnInto",run:()=>void P("quote")},{id:"code",iconHtml:ha,title:l("turnInto.code"),kind:"turnInto",run:()=>void P("codeBlock",{language:"plain"})},{id:"equation",iconHtml:X0,title:l("turnInto.equation"),kind:"turnInto",run:()=>void P("equation")}]);function Ee(z){const I=te.value;if(!I)return!1;switch(z){case"paragraph":return I.type==="paragraph";case"h1":return I.type==="heading"&&Number(I.attrs.level)===1;case"h2":return I.type==="heading"&&Number(I.attrs.level)===2;case"h3":return I.type==="heading"&&Number(I.attrs.level)===3;case"h4":return I.type==="heading"&&Number(I.attrs.level)===4;case"h5":return I.type==="heading"&&Number(I.attrs.level)===5;case"h6":return I.type==="heading"&&Number(I.attrs.level)===6;case"bullet":return I.type==="bulletList";case"ordered":return I.type==="orderedList";case"todo":return I.type==="todoList";case"quote":return I.type==="quote";case"code":return I.type==="codeBlock";case"equation":return I.type==="equation";default:return!1}}function Me(z){return Ee(z)}i.watch(()=>r.visible,z=>{var ne;if(!z)return;D.value=r.blockId!=null?(ne=O.value.doc.blocks.get(r.blockId))==null?void 0:ne.type:void 0;const I=ge.value.find(Te=>Ee(Te.id));d.value=I?I.id:"paragraph",k.alignIndent=!1,k.indent=!1,k.textColor=!1,k.bgColor=!1},{immediate:!0});const ae=i.computed(()=>{const z=[{id:"align-left",value:"left",title:l("align.left"),run:()=>Ce("left")},{id:"align-center",value:"center",title:l("align.center"),run:()=>Ce("center")},{id:"align-right",value:"right",title:l("align.right"),run:()=>Ce("right")}];return Q.value||z.push({id:"align-justify",value:"justify",title:l("align.justify"),run:()=>Ce("justify")}),z});function Ce(z){var I,ne;(ne=(I=a.commands).setBlockAlign)==null||ne.call(I,{id:r.blockId,align:z})}function $e(){var z,I;(I=(z=a.commands).indentBlock)==null||I.call(z,{id:r.blockId})}function we(){var z,I;(I=(z=a.commands).outdentBlock)==null||I.call(z,{id:r.blockId})}const tt=K0,qt=Y0;function rn(z){var I,ne;(ne=(I=a.commands).setBlockColor)==null||ne.call(I,{id:r.blockId,color:z})}function pn(z){var I,ne;(ne=(I=a.commands).setBlockBgColor)==null||ne.call(I,{id:r.blockId,bgColor:z})}async function Gt(){var lt,gn;const z=te.value;if(!z)return;const I=z.type==="equation"?String(z.attrs.expression??""):Ve(z.content),Te=`<meta charset="utf-8"><!-- blockeditor:${JSON.stringify({id:z.id,type:z.type,attrs:z.attrs,text:I}).replace(/--/g,"\\-\\-")} -->${dt(I)}`;let Ye=!1;try{if((lt=navigator.clipboard)!=null&<.write&&typeof ClipboardItem<"u"){const bn=new ClipboardItem({"text/plain":new Blob([I],{type:"text/plain"}),"text/html":new Blob([Te],{type:"text/html"})});await navigator.clipboard.write([bn]),Ye=!0}}catch{Ye=!1}if(!Ye)try{(gn=navigator.clipboard)!=null&&gn.writeText&&(await navigator.clipboard.writeText(I),Ye=!0)}catch{Ye=!1}Ye||(Ye=jt(I))}function dt(z){return z.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function jt(z){const I=document.createElement("textarea");I.value=z,I.setAttribute("readonly",""),I.style.position="fixed",I.style.top="-9999px",I.style.left="-9999px",I.style.opacity="0",document.body.appendChild(I);const ne=document.activeElement;I.focus(),I.select();try{return document.execCommand("copy")}catch{return!1}finally{if(document.body.removeChild(I),ne&&typeof ne.focus=="function")try{ne.focus()}catch{}}}function on(){Gt().then(()=>{var z,I;return(I=(z=a.commands).removeBlock)==null?void 0:I.call(z,{id:r.blockId})})}const ft=/Mac|iP(hone|[ao]d)/.test(navigator.platform)?M6:A6;function Ge(...z){return z.join("")}const St=i.computed(()=>[{id:"dup",iconHtml:p6,title:l("action.duplicate"),shortcutHtml:Ge(ft,S6),run:()=>{var z,I;return void((I=(z=a.commands).duplicateBlock)==null?void 0:I.call(z,{id:r.blockId}))}},{id:"copy",iconHtml:g6,title:l("action.copy"),shortcutHtml:Ge(ft,C6),run:()=>void Gt()},{id:"cut",iconHtml:b6,title:l("action.cut"),shortcutHtml:Ge(ft,T6),run:()=>void on()},{id:"up",iconHtml:v6,title:l("action.moveUp"),shortcutHtml:Ge(ft,j0,x6),run:()=>{var z,I;return void((I=(z=a.commands).moveBlockUp)==null?void 0:I.call(z,{id:r.blockId}))}},{id:"down",iconHtml:k6,title:l("action.moveDown"),shortcutHtml:Ge(ft,j0,E6),run:()=>{var z,I;return void((I=(z=a.commands).moveBlockDown)==null?void 0:I.call(z,{id:r.blockId}))}},{id:"del",iconHtml:y6,title:l("action.delete"),shortcutHtml:w6,danger:!0,run:()=>{var z,I;return void((I=(z=a.commands).removeBlock)==null?void 0:I.call(z,{id:r.blockId}))}}]);i.watch(()=>r.visible,z=>{z&&(p.value=!1,f.value={top:0,left:0,availableHeight:520,above:!1,bottom:0,topBaseline:0})});function He(){const z=r.anchorEl,I=r.rootEl,ne=c.value;!r.visible||!z||!I||!ne||i.nextTick().then(()=>{const Te=c.value;if(!Te)return;const Ye=Te.getBoundingClientRect(),lt=!!z.closest(".fixed-toolbar"),gn=lt?s.value?"up":"down":"auto",bn=lt?10:0,ln=q0(I,z,{width:Math.max(Ye.width,ma),height:Ye.height},8,gn,bn,bn);f.value=ln,p.value=!0,i.nextTick(Fe)})}i.watch([()=>r.visible,()=>r.anchorEl,c,b,g],He,{flush:"post"});function Pt(z){k[z]=!k[z],i.nextTick(He)}function Fe(){const z=u.value;z&&(b.value=z.scrollTop>1,g.value=z.scrollTop+z.clientHeight<z.scrollHeight-1)}function Ke(){const z=u.value;z&&(z.scrollTop-=z.clientHeight*.8)}function Qt(){const z=u.value;z&&(z.scrollTop+=z.clientHeight*.8)}Ui(u,Fe);const gt=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 z=f.value.above,I=f.value.left,ne=(b.value?Z0:0)+(g.value?Z0:0),Te=f.value.availableHeight-ne,Ye={left:`${I}px`,width:`${ma}px`,maxHeight:`${f.value.availableHeight}px`,"--scroll-max-height":`${Math.max(m6,Te)}px`};if(z){const lt=document.documentElement.clientHeight;Ye.bottom=`${Math.max(0,lt-f.value.bottom)}px`,Ye.top="auto"}else Ye.top=`${f.value.top}px`,Ye.bottom="auto";return Ye});function Tt(z){if(z.kind==="turnInto"&&Me(z.id)){const I=ge.value.find(ne=>ne.id==="paragraph");if(I){d.value="paragraph",I.run(),o("close");return}}d.value=z.id,z.run(),o("close")}function Ct(z){const I=[...ge.value,...St.value];if(I.length===0)return!1;const ne=I.findIndex(Ye=>Ye.id===d.value),Te=Ye=>(Ye%I.length+I.length)%I.length;switch(z.key){case"ArrowDown":return z.preventDefault(),d.value=I[Te(ne+1)].id,!0;case"ArrowUp":return z.preventDefault(),d.value=I[Te(ne-1)].id,!0;case"Enter":return z.preventDefault(),Tt(I[Te(ne)]),!0;case"Escape":return z.preventDefault(),o("close"),!0;default:return!1}}return e({onKeyDown:Ct}),G0(c,()=>r.visible,()=>o("close"),()=>r.anchorEl),i.onMounted(()=>{V=a.subscribe(z=>{O.value=z.state})}),i.onBeforeUnmount(()=>{V==null||V(),V=null}),(z,I)=>(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(gt.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(Ke,["prevent"])},[...I[8]||(I[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:Fe},[!Q.value&&!re.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(ge.value,ne=>(i.openBlock(),i.createElementBlock("button",{key:ne.id,class:i.normalizeClass(["bsm-icon-cell",{active:Me(ne.id)}]),title:ne.title,role:"menuitem",onMousedown:i.withModifiers(Te=>Tt(ne),["prevent"]),onMouseenter:Te=>d.value=ne.id},[i.createVNode(Rn,{class:"bsm-icon-svg",html:ne.iconHtml},null,8,["html"])],42,zf))),128))])]),I[9]||(I[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&&!Y.value,expanded:k.alignIndent}]),role:"menuitem",onMousedown:I[0]||(I[0]=i.withModifiers(ne=>Pt("alignIndent"),["prevent"]))},[i.createElementVNode("span",Pf,i.toDisplayString(i.unref(l)("bsm.section.alignIndent")),1),I[10]||(I[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(ae.value,ne=>(i.openBlock(),i.createElementBlock("button",{key:ne.id,class:i.normalizeClass(["bsm-icon-btn",{active:!ie.value&&F.value===ne.value,"bsm-disabled":ie.value}]),disabled:ie.value,title:ne.title,role:"menuitem",onMousedown:i.withModifiers(Te=>!ie.value&&Tt(ne),["prevent"])},[(i.openBlock(),i.createElementBlock("svg",Uf,[ne.value==="left"?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[I[11]||(I[11]=i.createElementVNode("line",{x1:"2",y1:"4",x2:"14",y2:"4",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),I[12]||(I[12]=i.createElementVNode("line",{x1:"2",y1:"8",x2:"10",y2:"8",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),I[13]||(I[13]=i.createElementVNode("line",{x1:"2",y1:"12",x2:"12",y2:"12",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1))],64)):ne.value==="center"?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[I[14]||(I[14]=i.createElementVNode("line",{x1:"2",y1:"4",x2:"14",y2:"4",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),I[15]||(I[15]=i.createElementVNode("line",{x1:"4",y1:"8",x2:"12",y2:"8",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),I[16]||(I[16]=i.createElementVNode("line",{x1:"3",y1:"12",x2:"13",y2:"12",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1))],64)):ne.value==="right"?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[I[17]||(I[17]=i.createElementVNode("line",{x1:"2",y1:"4",x2:"14",y2:"4",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),I[18]||(I[18]=i.createElementVNode("line",{x1:"6",y1:"8",x2:"14",y2:"8",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),I[19]||(I[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},[I[20]||(I[20]=i.createElementVNode("line",{x1:"2",y1:"4",x2:"14",y2:"4",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),I[21]||(I[21]=i.createElementVNode("line",{x1:"2",y1:"8",x2:"14",y2:"8",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"},null,-1)),I[22]||(I[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":A.value}]),disabled:A.value,title:i.unref(l)("bsm.indent.decrease"),role:"menuitem",onMousedown:I[1]||(I[1]=i.withModifiers(ne=>!A.value&&Tt({id:"outdent",run:we}),["prevent"]))},[...I[23]||(I[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":N.value}]),disabled:N.value,title:i.unref(l)("bsm.indent.increase"),role:"menuitem",onMousedown:I[2]||(I[2]=i.withModifiers(ne=>!N.value&&Tt({id:"indent",run:$e}),["prevent"]))},[...I[24]||(I[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":!Y.value,expanded:k.indent}]),role:"menuitem",onMousedown:I[3]||(I[3]=i.withModifiers(ne=>Pt("indent"),["prevent"]))},[i.createElementVNode("span",Yf,i.toDisplayString(i.unref(l)("bsm.section.indent")),1),I[25]||(I[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":A.value}]),disabled:A.value,title:i.unref(l)("bsm.indent.decrease"),role:"menuitem",onMousedown:I[4]||(I[4]=i.withModifiers(ne=>!A.value&&Tt({id:"outdent",run:we}),["prevent"]))},[...I[26]||(I[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":N.value}]),disabled:N.value,title:i.unref(l)("bsm.indent.increase"),role:"menuitem",onMousedown:I[5]||(I[5]=i.withModifiers(ne=>!N.value&&Tt({id:"indent",run:$e}),["prevent"]))},[...I[27]||(I[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&&!re.value?(i.openBlock(),i.createElementBlock("div",Jf,[i.createElementVNode("button",{class:i.normalizeClass(["bsm-collapse-header",{"bsm-disabled":H.value,expanded:k.textColor}]),role:"menuitem",onMousedown:I[6]||(I[6]=i.withModifiers(ne=>!H.value&&Pt("textColor"),["prevent"]))},[i.createElementVNode("span",e6,i.toDisplayString(i.unref(l)("bsm.section.textColor")),1),I[28]||(I[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(tt),ne=>(i.openBlock(),i.createElementBlock("button",{key:"tc-"+ne.key,class:i.normalizeClass(["bsm-swatch",{active:j.value===ne.key,"bsm-disabled":H.value}]),title:i.unref(l)(ne.key==="default"?"color.default":"color."+ne.key),style:i.normalizeStyle({backgroundColor:ne.displayCssValue??ne.cssValue}),disabled:H.value,onMousedown:i.withModifiers(Te=>!H.value&&Tt({id:`tc-${ne.key}`,run:()=>rn(ne.key)}),["prevent"])},null,46,r6))),128))])],512),[[i.vShow,k.textColor]])])):i.createCommentVNode("",!0),!Q.value&&!re.value?(i.openBlock(),i.createElementBlock("div",o6,[i.createElementVNode("button",{class:i.normalizeClass(["bsm-collapse-header",{"bsm-disabled":H.value,expanded:k.bgColor}]),role:"menuitem",onMousedown:I[7]||(I[7]=i.withModifiers(ne=>!H.value&&Pt("bgColor"),["prevent"]))},[i.createElementVNode("span",i6,i.toDisplayString(i.unref(l)("bsm.section.bgColor")),1),I[29]||(I[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(qt),ne=>(i.openBlock(),i.createElementBlock("button",{key:"bc-"+ne.key,class:i.normalizeClass(["bsm-swatch",[{active:U.value===ne.key,"bsm-disabled":H.value},ne.key==="default"?"bsm-swatch--none":""]]),title:i.unref(l)(ne.key==="default"?"color.none":"color."+ne.key),style:i.normalizeStyle({backgroundColor:ne.displayCssValue??ne.cssValue}),disabled:H.value,onMousedown:i.withModifiers(Te=>!H.value&&Tt({id:`bc-${ne.key}`,run:()=>pn(ne.key)}),["prevent"])},null,46,s6))),128))])],512),[[i.vShow,k.bgColor]])])):i.createCommentVNode("",!0),I[30]||(I[30]=i.createElementVNode("div",{class:"bsm-sep"},null,-1)),i.createElementVNode("div",c6,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(St.value,ne=>(i.openBlock(),i.createElementBlock("button",{key:ne.id,class:i.normalizeClass(["bsm-item bsm-action",{danger:ne.danger}]),role:"menuitem",onMousedown:i.withModifiers(Te=>Tt(ne),["prevent"]),onMouseenter:Te=>d.value=ne.id},[i.createVNode(Rn,{class:"bsm-action-icon",html:ne.iconHtml},null,8,["html"]),i.createElementVNode("span",d6,i.toDisplayString(ne.title),1),ne.shortcutHtml?(i.openBlock(),i.createBlock(Rn,{key:0,class:"bsm-shortcut",html:ne.shortcutHtml},null,8,["html"])):ne.shortcut?(i.openBlock(),i.createElementBlock("span",f6,i.toDisplayString(ne.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(Qt,["prevent"])},[...I[31]||(I[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,Q0=10,J0=200,ec=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}=_n(),s=Xn(),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}),V=i.ref(null),te=i.ref(!1),D=i.ref(null),F=i.ref(null),ie=i.ref(!1),Q=i.ref(!1),re=i.ref(null),_=i.ref(!1),H=i.ref(!1),$=i.ref(!1),K=i.computed(()=>({maxHeight:D.value!==null?`${D.value}px`:void 0})),Y=i.ref(null),N=i.computed(()=>{if(!r.inline||!Y.value)return;const q=Y.value,x={position:"fixed",left:`${q.left}px`};return q.top!==void 0&&(x.top=`${q.top}px`),q.bottom!==void 0&&(x.bottom=`${q.bottom}px`),q.right!==void 0&&(x.right=`${q.right}px`),x}),A=i.shallowRef(null);i.watch(()=>r.blockId,q=>{A.value=q},{immediate:!0});const j=i.shallowRef(s.getState());let U=null;const P=i.computed(()=>j.value.doc.blocks.get(A.value??"")),ge=i.computed(()=>{var x;if(r.cellEditMode||r.tableMode){const Z=r.blockAttrs.align;return typeof Z=="string"?Z:"left"}const q=(x=P.value)==null?void 0:x.attrs.align;return typeof q=="string"?q:"left"}),Ee=i.computed(()=>{if(r.tableMode){const q=r.tableActiveVerticalAlign;return typeof q=="string"?q:"middle"}if(r.cellEditMode){const q=r.blockAttrs.verticalAlign;return typeof q=="string"?q:"middle"}return"middle"}),Me=i.ref(""),ae=i.ref("");i.watch(()=>r.visible,q=>{q||(V.value=null)}),i.watch(()=>r.blockId,()=>{V.value=null});const Ce=i.ref(new Set),$e=i.ref(0);function we(){var q;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(q=Z.commonAncestorContainer.nodeType===1?Z.commonAncestorContainer:Z.commonAncestorContainer.parentElement)==null?void 0:q.closest(".table-cell-inner")}return r.rootEl.querySelector(`[data-block-id="${r.blockId}"]`)}function tt(){const q=new Set;if(!r.visible||!r.blockId||!r.rootEl){Ce.value=q;return}if(r.tableMode&&r.tableActiveMarks){Ce.value=new Set(r.tableActiveMarks);return}const x=we();if(x){const L=window.getSelection();if(L&&L.rangeCount>0){const G=L.getRangeAt(0);if(!G.collapsed&&x.contains(G.commonAncestorContainer)){const ee=[],oe=document.createTreeWalker(x,NodeFilter.SHOW_TEXT);for(;oe.nextNode();){const fe=oe.currentNode;(fe.nodeValue??"").length!==0&&G.intersectsNode(fe)&&ee.push(fe)}if(ee.length>0){const fe={bold:["B","STRONG"],italic:["I","EM"],underline:["U"],strikethrough:["S","STRIKE","DEL"],code:["CODE"],link:["A"]};for(const[pe,Le]of Object.entries(fe))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})&&q.add(pe);if(q.size>0){Ce.value=q;return}}}}}const Z=j.value,Se=r.blockId?Z.doc.blocks.get(r.blockId):void 0;if(!Se){Ce.value=q;return}const ze=Z.selection;let Ze=0,C=Ve(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 L=Rt();L&&(Ze=L.from,C=L.to)}if(Ze>=C){Ce.value=q;return}const S=["bold","italic","underline","strikethrough","code","link"];for(const L of S){let G=!0,ee=!1,oe=0;for(const fe of Se.content){if(fe.type!=="text")continue;const pe=oe,Le=oe+fe.text.length;if(Le>Ze&&pe<C&&(ee=!0,!fe.marks||!fe.marks.some(_e=>_e.type===L))){G=!1;break}oe=Le}ee&&G&&q.add(L)}Ce.value=q}const qt=i.computed(()=>r.inline&&!r.tableMode&&!r.cellEditMode&&!r.selectionRect),rn=i.computed(()=>qt.value||r.blockType==="codeBlock"),pn=i.computed(()=>r.tableMode||r.cellEditMode?qt.value:!r.blockId),Gt=i.computed(()=>{if(r.tableMode||r.cellEditMode)return qt.value?!0:r.blockType==="codeBlock";if(!r.blockId||r.blockType==="codeBlock")return!0;const q=r.blockType;return q?!("align"in s.registries.schema.get(q).attrs):!1});function dt(q){if(r.tableMode||r.cellEditMode)return!!(r.blockType==="codeBlock"||r.blockType==="quote"&&q==="italic"||q!=="code"&&Ce.value.has("code"));if(rn.value)return!0;if(q==="italic"){const x=r.blockType;if(x&&s.registries.schema.isMarkDisallowed(x,"italic"))return!0}if(q==="link"){const x=s.getState().selection;return!!(x.kind==="text"&&yn(x))}return!!(q!=="code"&&Ce.value.has("code"))}const jt=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>'}]),on=i.computed(()=>{const q=r.blockType,x=r.blockAttrs,Z=(ze,Ze)=>q===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"}}]}),ft=i.computed(()=>{const q=on.value.find(x=>x.active);return q?q.label:a("turnInto.paragraph")}),Ge=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"}]),St=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"}]),He=K0,Pt=Y0;function Fe(){var S;const q=u.value,x=re.value;if(!q||!x){_.value=!1;return}const Z=x.scrollLeft;x.style.maxWidth="",x.offsetWidth;const Se=x.scrollWidth,ze=r.inline?Math.max(120,(((S=q.parentElement)==null?void 0:S.clientWidth)??q.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 L=Math.max(0,x.scrollWidth-x.clientWidth);x.scrollLeft=Math.min(Z,L),Ke()}else _.value=!1,x.style.maxWidth="",H.value=!1,$.value=!1}function Ke(){const q=re.value;q&&(H.value=q.scrollLeft>0,$.value=q.scrollLeft+q.clientWidth<q.scrollWidth-1)}function Qt(q){V.value=null;const x=re.value;x&&(x.scrollLeft+=q*Ch,Ke())}let gt=null,Tt=0,Ct=0,z=!1,I=!1;function ne(q){if(!z)return;const x=q.touches[0];if(!x)return;const Z=Math.abs(x.clientX-Tt),Se=Math.abs(x.clientY-Ct);(Z>Q0||Se>Q0)&&(I||(V.value=null),I=!0)}function Te(q){if(!z)return;const x=gt;gt=null,z=!1;const Z=I;I=!1,Z||(q.cancelable&&q.preventDefault(),x&&x())}function Ye(q,x){x.cancelable&&x.preventDefault(),Qt(q)}function lt(q,x){const Z=x.touches[0];Z&&(Tt=Z.clientX,Ct=Z.clientY),gt=q,z=!0,I=!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 q=u.value;if(!q||V.value)return;Fe(),await i.nextTick();const x=q.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 gn=i.computed(()=>({top:"0px",left:"0px",width:"100vw",height:"100vh"})),bn=i.computed(()=>{const q=u.value,x=(q==null?void 0:q.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 L=r.selectionRect.left+r.selectionRect.width/2-ze,G=Math.max(10,Math.min(x-10,L));C["--ht-arrow-x"]=`${G}px`}return C});async function ln(q){V.value=V.value===q?null:q,V.value&&(await i.nextTick(),An())}i.watch(V,(q,x)=>{x&&!q&&!r.inline&&ir()});function ir(){at===null&&(at=requestAnimationFrame(()=>{if(at=null,r.inline)return;const q=u.value;!r.visible||!r.selectionRect||!r.rootEl||!q||(Fe(),i.nextTick().then(()=>{const x=q.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 at=null;function An(){const q=V.value;if(!q)return;const x=q==="type"?d.value:q==="align"?f.value:q==="verticalAlign"?p.value:b.value,Z=q==="type"?g.value:q==="align"?k.value:q==="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),L=x.scrollHeight;if(r.inline){const fe=document.documentElement.clientHeight,pe=10;if(c.value){te.value=!0,D.value=Math.max(120,S-pe);const Ae=fe-Se.top+Ze;if(q==="color"){const _e=document.documentElement.clientWidth;Y.value={bottom:Ae,right:Math.max(8,_e-Se.right)}}else Y.value={left:Math.max(8,Se.left),bottom:Ae}}else{te.value=!1,D.value=Math.max(120,C-pe);const Ae=Se.bottom+Ze;if(q==="color"){const _e=document.documentElement.clientWidth;Y.value={top:Ae,right:Math.max(8,_e-Se.right)}}else Y.value={left:Math.max(8,Se.left),top:Ae}}i.nextTick(Sn);return}Y.value=null;let G=!1;if(r.rootEl&&u.value){const fe=r.rootEl.getBoundingClientRect(),pe=u.value.getBoundingClientRect();fe.bottom-pe.bottom<J0&&S>J0&&(G=!0)}let ee=!1,oe;G?(ee=!0,oe=S):L<=C?(ee=!1,oe=C):S>C?(ee=!0,oe=S):(ee=!1,oe=C),te.value=ee,D.value=Math.max(120,Math.min(oe,360)),i.nextTick(Sn)}function Sn(){const q=F.value;if(!q){ie.value=!1,Q.value=!1;return}ie.value=q.scrollTop>1,Q.value=q.scrollTop+q.clientHeight<q.scrollHeight-1}function Un(){const q=F.value;q&&(q.scrollTop-=q.clientHeight*.8)}function ht(){const q=F.value;q&&(q.scrollTop+=q.clientHeight*.8)}Ui(F,Sn);function wt(q){var Z,Se,ze,Ze,C;if(o("interacting"),r.tableMode||r.cellEditMode){q.convertType==="heading"&&((Z=q.convertAttrs)!=null&&Z.level)?o("tableType",`heading${q.convertAttrs.level}`):o("tableType",q.convertType),V.value=null,r.tableMode&&o("close");return}const x=Lt();if(x){for(const S of x.ranges)(ze=(Se=s.commands).convertBlock)==null||ze.call(Se,{id:S.id,type:q.convertType,attrs:q.convertAttrs??{}});V.value=null,o("close");return}A.value&&((C=(Ze=s.commands).convertBlock)==null||C.call(Ze,{id:A.value,type:q.convertType,attrs:q.convertAttrs??{}}),V.value=null,o("close"))}function We(q){var Z,Se,ze,Ze;if(o("interacting"),r.tableMode||r.cellEditMode){o("tableAlign",q),V.value=null;return}const x=Lt();if(x){for(const C of x.ranges)(Se=(Z=s.commands).setBlockAlign)==null||Se.call(Z,{id:C.id,align:q});V.value=null;return}A.value&&((Ze=(ze=s.commands).setBlockAlign)==null||Ze.call(ze,{id:A.value,align:q}),V.value=null)}function Xe(q){if(r.tableMode||r.cellEditMode){o("tableVerticalAlign",q),V.value=null;return}V.value=null}function mt(q){var Se,ze,Ze,C;if(o("interacting"),r.tableMode){o("tableTextColor",q==="default"?null:q),V.value=null;return}if(r.cellEditMode){const S=window.getSelection();if(S&&S.rangeCount>0&&!S.isCollapsed){const L=S.getRangeAt(0);if(q==="default"){const G=L.extractContents();G.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)}}),L.insertNode(G)}else{const G=document.createElement("span");G.className=`be-color-${q}`,G.appendChild(L.extractContents()),L.insertNode(G),S.removeAllRanges();const ee=document.createRange();ee.selectNodeContents(G),S.addRange(ee)}}V.value=null,Mt();return}const x=Lt();if(x){for(const S of x.ranges)(ze=(Se=s.commands).setInlineMark)==null||ze.call(Se,{id:S.id,markType:"color",attrs:q==="default"?null:{color:q},from:S.from,to:S.to});return}if(!A.value)return;const Z=Rt();Z&&((C=(Ze=s.commands).setInlineMark)==null||C.call(Ze,{id:A.value,markType:"color",attrs:q==="default"?null:{color:q},from:Z.from,to:Z.to}),i.nextTick(()=>{var pe;const S=window.getSelection(),L=(pe=r.rootEl)==null?void 0:pe.querySelector(`[data-block-id="${r.blockId}"]`),G=S&&S.rangeCount>0?S.getRangeAt(0):null,ee=!!L,oe=!!(G&&L&&L.contains(G.commonAncestorContainer)),fe=!!(G&&!G.collapsed&&oe);if(!ee){o("close");return}if(!fe&&!oe){o("close");return}Mt(),tt()}))}function an(q){var Se,ze,Ze,C;if(o("interacting"),r.tableMode){o("tableBgColor",q==="default"?null:q),V.value=null;return}if(r.cellEditMode){const S=window.getSelection();if(S&&S.rangeCount>0&&!S.isCollapsed){const L=S.getRangeAt(0);if(q==="default"){const G=L.extractContents();G.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)}}),L.insertNode(G)}else{const G=document.createElement("span");G.className=`be-bg-${q}`,G.appendChild(L.extractContents()),L.insertNode(G),S.removeAllRanges();const ee=document.createRange();ee.selectNodeContents(G),S.addRange(ee)}}V.value=null,Mt();return}const x=Lt();if(x){for(const S of x.ranges)(ze=(Se=s.commands).setInlineMark)==null||ze.call(Se,{id:S.id,markType:"bgColor",attrs:q==="default"?null:{bgColor:q},from:S.from,to:S.to});return}if(!A.value)return;const Z=Rt();Z&&((C=(Ze=s.commands).setInlineMark)==null||C.call(Ze,{id:A.value,markType:"bgColor",attrs:q==="default"?null:{bgColor:q},from:Z.from,to:Z.to}),i.nextTick(()=>{var pe;const S=window.getSelection(),L=(pe=r.rootEl)==null?void 0:pe.querySelector(`[data-block-id="${r.blockId}"]`),G=S&&S.rangeCount>0?S.getRangeAt(0):null,ee=!!L,oe=!!(G&&L&&L.contains(G.commonAncestorContainer)),fe=!!(G&&!G.collapsed&&oe);if(!ee){o("close");return}if(!fe&&!oe){o("close");return}Mt(),tt()}))}function Mt(){if(r.tableMode){Me.value=r.tableActiveColor??"",ae.value=r.tableActiveBgColor??"";return}if(r.visible&&r.blockId&&r.rootEl){const L=we(),G=window.getSelection();if(L&&G&&G.rangeCount>0){const ee=G.getRangeAt(0);if(!ee.collapsed&&L.contains(ee.commonAncestorContainer)){const oe=new Set,fe=new Set,pe=[],Le=document.createTreeWalker(L,NodeFilter.SHOW_TEXT);for(;Le.nextNode();){const Ae=Le.currentNode;(Ae.nodeValue??"").length!==0&&ee.intersectsNode(Ae)&&pe.push(Ae)}for(const Ae of pe){let _e=Ae.parentNode;for(;_e&&_e!==L;){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&&fe.add(pt[1])}}_e=_e.parentNode}}if(oe.size>0||fe.size>0){Me.value=oe.size===1?[...oe][0]:"",ae.value=fe.size===1?[...fe][0]:"";return}}}}const q=j.value,x=r.blockId?q.doc.blocks.get(r.blockId):void 0;if(!x){Me.value="",ae.value="";return}const Z=q.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 L=Rt();Se=L?L.from:0,ze=L?L.to:Ve(x.content).length}if(Se>=ze){Me.value="",ae.value="";return}const Ze=new Set,C=new Set;let S=0;for(const L of x.content){if(L.type!=="text")continue;const G=S,ee=S+L.text.length;if(ee>Se&&G<ze&&L.marks)for(const oe of L.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 Rt(){if(!r.blockId||!r.rootEl)return null;const q=r.rootEl.querySelector(`[data-block-id="${r.blockId}"]`);if(!q)return null;const x=window.getSelection();if(!x||x.rangeCount===0)return null;const Z=x.getRangeAt(0);if(Z.collapsed||!q.contains(Z.commonAncestorContainer))return null;const Se=document.createRange();Se.selectNodeContents(q),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 Lt(){const q=j.value.selection;if(q.kind!=="text"||!yn(q))return null;const x=j.value.doc,Z=yr(x),Se=Z.indexOf(q.anchor.blockId),ze=Z.indexOf(q.focus.blockId);if(Se===-1||ze===-1)return null;const[Ze,C]=Se<=ze?[q.anchor,q.focus]:[q.focus,q.anchor],S=Z.indexOf(Ze.blockId),L=Z.indexOf(C.blockId);if(S===-1||L===-1||S>L)return null;const G=[];for(let ee=S;ee<=L;ee++){const oe=Z[ee],fe=x.blocks.get(oe);if(!fe)continue;const pe=Ve(fe.content).length;let Le=0,Ae=pe;ee===S&&(Le=Math.min(Ze.offset,pe)),ee===L&&(Ae=Math.min(C.offset,pe)),G.push({id:oe,from:Le,to:Ae})}return{ranges:G}}function Nn(){const q=j.value.selection;if(q.kind!=="text"||!yn(q))return null;const x=Lt();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]=Cn(C.content,Ze.from),[L]=Cn(S,Ze.to-Ze.from);Se.push(Ve(L)),ze.push(Qr(L))}return{text:Se.join(`
|
|
14
|
-
`),html:ze.join("<br>")}}function En(q){var Se,ze,Ze,C;if(o("interacting"),r.tableMode){o("tableMark",q);return}if(r.cellEditMode){const L={bold:"bold",italic:"italic",underline:"underline",strikethrough:"strikeThrough",code:"insertHTML"}[q];if(L==="insertHTML"){const G=window.getSelection();if(G&&G.rangeCount>0&&!G.isCollapsed){const ee=G.getRangeAt(0),oe=document.createElement("code");try{oe.appendChild(ee.extractContents()),ee.insertNode(oe),G.removeAllRanges();const fe=document.createRange();fe.selectNodeContents(oe),G.addRange(fe)}catch{}}}else L&&document.execCommand(L);tt();return}const x=Lt();if(x){for(const S of x.ranges)(ze=(Se=s.commands).toggleMark)==null||ze.call(Se,{id:S.id,markType:q,from:S.from,to:S.to});return}if(!A.value)return;const Z=Rt();Z&&((C=(Ze=s.commands).toggleMark)==null||C.call(Ze,{id:A.value,markType:q,from:Z.from,to:Z.to}),i.nextTick(()=>{var pe;$e.value++;const S=window.getSelection(),L=(pe=r.rootEl)==null?void 0:pe.querySelector(`[data-block-id="${r.blockId}"]`),G=S&&S.rangeCount>0?S.getRangeAt(0):null,ee=!!L,oe=!!(G&&L&&L.contains(G.commonAncestorContainer)),fe=!!(G&&!G.collapsed&&oe);if(!ee){o("close");return}if(!fe&&!oe){o("close");return}tt(),Mt()}))}function co(){if(o("interacting"),V.value=null,r.cellEditMode){o("linkClick",A.value??"",0,0);return}if(A.value){const q=Rt();q&&o("linkClick",A.value,q.from,q.to)}}function ur(){var Se,ze;if(r.tableMode){o("tableCopy"),o("close");return}const q=Nn();if(q){(Se=navigator.clipboard)==null||Se.writeText(q.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 qn(){if(r.inline){r.visible&&Fe(),V.value&&An(),Sn(),tt(),Mt();return}if(r.visible&&r.selectionRect&&r.rootEl&&u.value){if(V.value){An(),Sn(),tt(),Mt();return}Fe(),await i.nextTick();const q=u.value.getBoundingClientRect();O.value=r.tableMode?ea(r.rootEl,r.selectionRect,{width:q.width,height:Math.max(q.height,hi)}):Jl(r.rootEl,r.selectionRect,{width:q.width,height:Math.max(q.height,hi)})}V.value&&An(),Sn(),tt(),Mt()}function lr(q){if(!V.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(q))return;for(const Se of Z)if(Se&&Se.contains(q))return;V.value=null}function Mr(q){if(!r.visible)return;const x=u.value;if(x&&x.contains(q.target)){q.preventDefault(),V.value&&lr(q.target);return}lr(q.target)}function jn(q){if(!r.visible||!q.touches[0])return;const Z=q.target,Se=u.value;if(Se&&Se.contains(Z)){const ze=re.value;if(ze&&ze.contains(Z)){V.value&&lr(Z);return}q.preventDefault(),V.value&&lr(Z);return}lr(Z)}i.watch(()=>r.visible,q=>{q&&i.nextTick(()=>{tt(),Mt()})}),i.onMounted(()=>{window.addEventListener("scroll",qn,!0),window.addEventListener("resize",qn),window.addEventListener("mousedown",Mr,!0),window.addEventListener("touchstart",jn,!0),document.addEventListener("selectionchange",Ar),U=s.subscribe(()=>{i.nextTick(()=>{const q=s.getState();j.value=q,$e.value++,tt(),Mt()})})}),i.onBeforeUnmount(()=>{window.removeEventListener("scroll",qn,!0),window.removeEventListener("resize",qn),window.removeEventListener("mousedown",Mr,!0),window.removeEventListener("touchstart",jn,!0),document.removeEventListener("selectionchange",Ar),U==null||U(),U=null});function Ar(){r.visible&&Gn===null&&(Gn=requestAnimationFrame(()=>{Gn=null,r.visible&&(tt(),Mt())}))}let Gn=null;return(q,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:gn.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:bn.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:!H.value}]),title:i.unref(a)("ui.scrollLeft"),"aria-label":i.unref(a)("ui.scrollLeft"),onMousedown:x[0]||(x[0]=i.withModifiers(Z=>Qt(-1),["prevent","stop"])),onTouchstart:x[1]||(x[1]=i.withModifiers(()=>{},["stop"])),onTouchend:x[2]||(x[2]=i.withModifiers(Z=>Ye(-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:re,class:i.normalizeClass(["ht-content",{"dropdown-open":!t.inline&&!!V.value}]),onScroll:Ke,onTouchmovePassive:ne,onTouchend:i.withModifiers(Te,["stop"])},[i.createElementVNode("div",R6,[i.createElementVNode("button",{ref_key:"typeBtnEl",ref:g,class:i.normalizeClass(["ht-btn ht-type-btn",{open:V.value==="type",disabled:pn.value}]),title:i.unref(a)("hoverToolbar.typeBtnTitle"),disabled:pn.value,onMousedown:x[4]||(x[4]=i.withModifiers(Z=>!pn.value&&ln("type"),["prevent","stop"])),onTouchstart:x[5]||(x[5]=i.withModifiers(Z=>{lt(()=>{pn.value||ln("type")},Z)},["stop"])),onClick:x[6]||(x[6]=i.withModifiers(()=>{},["prevent","stop"]))},[i.createElementVNode("span",O6,i.toDisplayString(ft.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},[V.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([K.value,N.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(Un,["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:F,class:"ht-dropdown-scroll",onScroll:Sn},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(on.value,Z=>(i.openBlock(),i.createElementBlock("button",{key:Z.id,class:i.normalizeClass(["ht-dropdown-item",{active:Z.active}]),onMousedown:i.withModifiers(Se=>wt(Z),["prevent","stop"])},[i.createVNode(Rn,{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:V.value==="align",disabled:Gt.value}]),title:i.unref(a)("hoverToolbar.alignBtnTitle"),disabled:Gt.value,onMousedown:x[7]||(x[7]=i.withModifiers(Z=>!Gt.value&&ln("align"),["prevent","stop"])),onTouchstart:x[8]||(x[8]=i.withModifiers(Z=>{lt(()=>{Gt.value||ln("align")},Z)},["stop"])),onClick:x[9]||(x[9]=i.withModifiers(()=>{},["prevent","stop"]))},[(i.openBlock(),i.createElementBlock("svg",V6,[ge.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)):ge.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)):ge.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},[V.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([K.value,N.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(Un,["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:F,class:"ht-dropdown-scroll",onScroll:Sn},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Ge.value,Z=>(i.openBlock(),i.createElementBlock("button",{key:Z.id,class:i.normalizeClass(["ht-dropdown-item ht-align-item",{active:ge.value===Z.value}]),onMousedown:i.withModifiers(Se=>We(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),ge.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:V.value==="verticalAlign",disabled:Gt.value}]),title:i.unref(a)("hoverToolbar.verticalAlignBtnTitle"),disabled:Gt.value,onMousedown:x[10]||(x[10]=i.withModifiers(Z=>!Gt.value&&ln("verticalAlign"),["prevent","stop"])),onTouchstart:x[11]||(x[11]=i.withModifiers(Z=>{lt(()=>{Gt.value||ln("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},[V.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([K.value,N.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(Un,["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:F,class:"ht-dropdown-scroll",onScroll:Sn},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(St.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(jt.value,Z=>(i.openBlock(),i.createElementBlock("button",{key:Z.id,class:i.normalizeClass(["ht-btn ht-icon-only",{active:Ce.value.has(Z.id),disabled:dt(Z.id)}]),title:Z.title,disabled:dt(Z.id),onMousedown:i.withModifiers(Se=>!dt(Z.id)&&En(Z.id),["prevent","stop"]),onTouchstart:i.withModifiers(Se=>{lt(()=>{dt(Z.id)||En(Z.id)},Se)},["stop"]),onClick:x[13]||(x[13]=i.withModifiers(()=>{},["prevent","stop"]))},[i.createVNode(Rn,{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:Ce.value.has("link"),disabled:dt("link")}]),title:i.unref(a)("hoverToolbar.linkBtnTitle"),disabled:dt("link"),onMousedown:x[14]||(x[14]=i.withModifiers(Z=>!dt("link")&&co(),["prevent","stop"])),onTouchstart:x[15]||(x[15]=i.withModifiers(Z=>{lt(()=>{dt("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:V.value==="color",disabled:dt("color")}]),title:i.unref(a)("hoverToolbar.colorBtnTitle"),disabled:dt("color"),onMousedown:x[17]||(x[17]=i.withModifiers(Z=>!dt("color")&&ln("color"),["prevent","stop"])),onTouchstart:x[18]||(x[18]=i.withModifiers(Z=>{lt(()=>{dt("color")||ln("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},[V.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([K.value,N.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(Un,["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:F,class:"ht-dropdown-scroll",onScroll:Sn},[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(He),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(Pt),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=>an(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:qt.value}]),title:i.unref(a)("hoverToolbar.copySelection"),"aria-label":i.unref(a)("hoverToolbar.copySelection"),disabled:qt.value,onMousedown:x[20]||(x[20]=i.withModifiers(Z=>!qt.value&&ur(),["prevent","stop"])),onTouchstart:x[21]||(x[21]=i.withModifiers(Z=>{lt(()=>{qt.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=>lt(()=>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=>lt(()=>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=>lt(()=>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=>lt(()=>o("delete"),Z),["stop"])),onClick:x[34]||(x[34]=i.withModifiers(()=>{},["prevent","stop"]))},[i.createVNode(Rn,{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:!$.value}]),title:i.unref(a)("ui.scrollRight"),"aria-label":i.unref(a)("ui.scrollRight"),onMousedown:x[35]||(x[35]=i.withModifiers(Z=>Qt(1),["prevent","stop"])),onTouchstart:x[36]||(x[36]=i.withModifiers(()=>{},["stop"])),onTouchend:x[37]||(x[37]=i.withModifiers(Z=>Ye(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(D){r("toolbarInteracting")}const{t:l}=_n(),a=Lr(),s=Xn(),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=D=>{var Q;if(!D)return null;const F=D.nodeType===1?D:D.parentElement;if(!F)return null;const ie=F.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 D=window.getSelection();if(D&&D.rangeCount>0){const F=D.getRangeAt(0);if(!F.collapsed&&[D.anchorNode,D.focusNode,F.startContainer,F.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 D=d.value;if(!(D&&D.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:(F,ie,Q)=>r("linkClick",F,ie,Q)}}else f.value&&!b&&(b=setTimeout(g,1500))},{immediate:!0,flush:"sync"});const k=i.computed(()=>{const D=d.value;if(D&&D.visible)return D;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,re)=>r("linkClick",ie,Q,re)};if(f.value)return{...f.value,visible:!0};const F=n.focusBlockId;if(F){const ie=s.getState().doc.blocks.get(F);return{visible:!0,selectionRect:null,blockId:F,blockType:(ie==null?void 0:ie.type)??null,blockAttrs:(ie==null?void 0:ie.attrs)??{},rootEl:n.rootEl,onClose:()=>r("hoverClose"),onLinkClick:(Q,re,_)=>r("linkClick",Q,re,_)}}return{visible:!1,selectionRect:null,blockId:null,blockType:null,blockAttrs:{},rootEl:n.rootEl}}),E=i.computed(()=>{const D=d.value;return D&&D.visible?D.blockId:n.hoverVisible&&n.hoverBlockId?n.hoverBlockId:n.focusBlockId}),M=i.ref(null),O=i.ref(null);function V(){const D=E.value,F=M.value;!D||!F||r("openPlusMenu",D,F)}function te(){const D=E.value,F=O.value;!D||!F||r("openSettingsMenu",D,F)}return i.watch(()=>n.focusBlockId,(D,F)=>{if(D!==F&&f.value){const ie=f.value;D!==null&&ie.blockId!==D&&(f.value=null)}}),(D,F)=>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(V,["prevent","stop"]),onTouchstart:F[0]||(F[0]=i.withModifiers(()=>{},["stop"]))},[...F[3]||(F[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:F[1]||(F[1]=i.withModifiers(()=>{},["stop"]))},[...F[4]||(F[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(ec,i.mergeProps({inline:""},k.value,{onInteracting:F[2]||(F[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,tc=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}=_n(),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,nc=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}=_n(),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,rc=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}=_n(),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(re){return re==="plain"?o("codeLang.plain"):re}function E(){if(!n.visible||!n.anchor||!n.rootEl)return;const re=a.value;if(!re)return;const _=n.anchor.getBoundingClientRect(),H=window.innerHeight,$=Math.floor(H-_.bottom-vo),K=Math.floor(_.top-vo),Y=re.scrollHeight;let N=!1;n.rootEl.getBoundingClientRect().bottom-_.bottom<rc&&K>rc&&(N=!0);let U,P;N?(U=!0,P=K):Y<=$?(U=!1,P=$):K>$?(U=!0,P=K):(U=!1,P=$);const ge=Math.max(Zh,Math.min(P,jh)),Ee=document.documentElement.clientWidth,Me=Math.max(re.clientWidth,200),ae=Math.max(vo,Math.min(Ee-Me-vo,_.left)),Ce=U?Math.max(vo,_.top-vo-Math.min(Y,ge)):_.bottom+vo;p.value={top:Ce,left:ae,above:U,maxHeight:ge},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 re=c.value;re&&(b.value=re.scrollTop>1,g.value=re.scrollTop+re.clientHeight<re.scrollHeight-1)}function O(){const re=c.value;re&&(re.scrollTop-=re.clientHeight*.8)}function V(){const re=c.value;re&&(re.scrollTop+=re.clientHeight*.8)}Ui(c,M);function te(){u.value=!0,d.value=f.value==="plain"?"":f.value,i.nextTick(()=>{var re,_;(re=s.value)==null||re.focus(),(_=s.value)==null||_.select(),E()})}function D(){u.value=!1,i.nextTick(E)}function F(){const re=d.value.replace(/[^a-zA-Z]/g,"").slice(0,20);re!==d.value&&(d.value=re)}function ie(){const re=(d.value??"").replace(/[^a-zA-Z]/g,"").slice(0,20);r("confirm",re.length===0?"plain":re)}const Q=i.computed(()=>({top:`${p.value.top}px`,left:`${p.value.left}px`,maxHeight:`${p.value.maxHeight}px`}));return(re,_)=>(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]=H=>d.value=H),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:F,onKeydown:i.withKeys(D,["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:D},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,H=>i.createElementVNode("button",{key:H,class:i.normalizeClass(["clp-item",{active:H===f.value}]),role:"menuitem",onClick:$=>r("confirm",H)},[i.createElementVNode("span",Wh,i.toDisplayString(k(H)),1),H===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(V,["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"],oc=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}=_n(),a=Xn(),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 K=ho(M.value);return Or(K)??"#"}),V=i.computed(()=>{const K=M.value;return K?K.length>60?K.slice(0,57)+"...":K:l("link.emptyUrl")}),te=i.computed(()=>({top:`${g.value.top}px`,left:`${g.value.left}px`,visibility:d.value?"visible":"hidden"}));async function D(){if(!r.visible||!r.anchorRect||!s.value)return;await i.nextTick();const Y=s.value.getBoundingClientRect(),N=8,A=document.documentElement.clientWidth,U=document.documentElement.clientHeight-r.anchorRect.bottom-N,P=r.anchorRect.top-N,Ee=U<Y.height+N&&P>U?Math.max(N,r.anchorRect.top-Y.height-N):r.anchorRect.bottom+N,Me=r.anchorRect.left+(r.anchorRect.width-Y.width)/2,ae=Math.max(N,A-Y.width-N),Ce=Math.max(N,Math.min(ae,Me));g.value={top:Ee,left:Ce},d.value=!0}i.watch(()=>r.visible,K=>{K?(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 Y,N;D(),f.value==="edit"&&((Y=c.value)==null||Y.focus(),(N=c.value)==null||N.select())})):(d.value=!1,setTimeout(()=>{r.visible||(u.value=!1)},200))},{immediate:!0}),i.watch(()=>r.anchorRect,()=>{r.visible&&D()});function F(){r.readonly||(f.value="edit",p.value=r.href,b.value=r.text,k.value="",i.nextTick(()=>{var K,Y;(K=c.value)==null||K.focus(),(Y=c.value)==null||Y.select()}))}function ie(){const K=p.value;if(!K.trim()){k.value="";return}const Y=ho(K);Or(Y)?k.value="":k.value=l("link.invalidUrl")}function Q(){var A,j,U;if(!r.blockId&&!r.onSaveLink)return;const K=ho(p.value),Y=Or(K);if(!Y){k.value=l("link.invalidUrl"),(A=c.value)==null||A.focus();return}k.value="";const N=E.value&&b.value!==r.text;r.onSaveLink?r.onSaveLink(Y,N?b.value:void 0):(U=(j=a.commands).setLink)==null||U.call(j,{id:r.blockId,href:Y,from:r.from,to:r.to,text:N?b.value:void 0}),r.href?(f.value="view",i.nextTick(()=>{D()})):o("close")}function re(){r.href?(f.value="view",p.value=r.href,b.value=r.text):o("close")}function _(){var K,Y;!r.blockId&&!r.onRemoveLinkMark||(r.onRemoveLinkMark?r.onRemoveLinkMark():(Y=(K=a.commands).unsetLink)==null||Y.call(K,{id:r.blockId,from:r.from,to:r.to}),o("close"))}function H(){var Y;const K=ho(r.href);K&&((Y=navigator.clipboard)==null||Y.writeText(K))}function $(){const K=ho(r.href),Y=Or(K);Y&&Y!=="#"&&window.open(Y,"_blank","noopener,noreferrer")}return i.onBeforeUnmount(()=>{u.value=!1}),e({isEditing:()=>f.value==="edit",save:Q,cancel:re}),(K,Y)=>(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:Y[2]||(Y[2]=i.withModifiers(()=>{},["stop"])),onTouchstart:Y[3]||(Y[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:$},i.toDisplayString(V.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($,["prevent","stop"])},[...Y[4]||(Y[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(H,["prevent","stop"])},[...Y[5]||(Y[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(F,["prevent","stop"])},[...Y[6]||(Y[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"])},[...Y[7]||(Y[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":Y[0]||(Y[0]=N=>p.value=N),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(re,["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":Y[1]||(Y[1]=N=>b.value=N),class:"link-popover-input",type:"text",placeholder:i.unref(l)("link.textPlaceholder"),onKeydown:[i.withKeys(Q,["enter"]),i.withKeys(re,["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(re,["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 ic(t,e){const n=Ao(t,e),r=Yn(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=Xn(),n=Lr(),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=ic(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=er(t.block.attrs),p=f.filter(k=>k.startsWith("be-indent-")),b=f.filter(k=>!k.startsWith("be-indent-")),g=i.h(Hr,{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:{...Ln,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(Hr,{block:t.block,placeholder:t.placeholder,class:["block-paragraph",...er(t.block.attrs)]})}}),lc={name:"paragraph",schema:{type:"paragraph",content:"text",nestable:!0,attrs:{...Ln}},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(Hr,{block:t.block,placeholder:t.placeholder,class:["block-heading",`block-heading-h${e}`,...er(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}})}),ac={name:"heading",schema:{type:"heading",content:"text",nestable:!0,attrs:{level:{default:1,validate:t=>typeof t=="number"&&t>=1&&t<=6},...Ln}},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)]},sc={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"}]},cc={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(Hr,{block:t.block,placeholder:t.placeholder,class:["block-bullet-list",...er(t.block.attrs)]})}}),ym={name:"bulletList",schema:{type:"bulletList",content:"text",nestable:!0,listLike:!0,attrs:{...Ln}},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=Xn(),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=er(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(Hr,{block:t.block,placeholder:t.placeholder,class:u,...r})])}}}),xm={name:"todoList",schema:{type:"todoList",content:"text",nestable:!0,listLike:!0,attrs:{...Ln,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(Hr,{block:t.block,placeholder:t.placeholder,class:["block-quote",...er(t.block.attrs)]})}}),Cm={name:"quote",schema:{type:"quote",content:"text",nestable:!1,disallowedMarks:["italic"],attrs:{...Ef,indent:Ln.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 uc(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)&&uc(n)}),t}class dc{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function fc(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>",hc=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+=fc(e)}openNode(e){if(!hc(e))return;const n=Mm(e.scope,{prefix:this.classPrefix});this.span(n)}closeNode(e){hc(e)&&(this.buffer+=Tm)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}const mc=(t={})=>{const e={children:[]};return Object.assign(e,t),e};class pa{constructor(){this.rootNode=mc(),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=mc({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 pc(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 gc(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/,bc="[a-zA-Z]\\w*",va="[a-zA-Z_]\\w*",vc="\\b\\d+(\\.\\d+)?",kc="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",yc="\\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:vc,relevance:0},Gm={scope:"number",begin:kc,relevance:0},Wm={scope:"number",begin:yc,relevance:0},Km={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[pi,{begin:/\[/,end:/\]/,relevance:0,contains:[pi]}]},Ym={scope:"title",begin:bc,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:yc,COMMENT:Wi,C_BLOCK_COMMENT_MODE:Vm,C_LINE_COMMENT_MODE:Fm,C_NUMBER_MODE:Gm,C_NUMBER_RE:kc,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:bc,MATCH_NOTHING_RE:Om,METHOD_GUARD:Zm,NUMBER_MODE:qm,NUMBER_RE:vc,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,pc(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 wc(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,wc(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 xc={},yo=t=>{console.error(t)},Ec=(t,...e)=>{console.log(`WARN: ${t}`,...e)},Do=(t,e)=>{xc[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),xc[`${t}/${e}`]=!0)},Yi=new Error;function Cc(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+=gc(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;Cc(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;Cc(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+=gc(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=wc(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 Sc(t){return t?t.endsWithParent||Sc(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:Sc(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=fc,Tc=eo,Mc=Symbol("nomatch"),g2=7,Ac=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 U=s.languageDetectRe.exec(j);if(U){const P=Q(U[1]);return P||(Ec(l.replace("{}",U[1])),Ec("Falling back to no-highlight mode for this block.",A)),P?U[1]:"no-highlight"}return j.split(/\s+/).find(P=>c(P)||Q(P))}function d(A,j,U){let P="",ge="";typeof j=="object"?(P=A,U=j.ignoreIllegals,ge=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(Tt>1e5&&Tt>I.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Ke+=ne,ne.length}const ft=Q(A);if(!ft)throw yo(l.replace("{}",A)),new Error('Unknown language: "'+A+'"');const Ge=f2(ft);let St="",He=P||Ge;const Pt={},Fe=new s.__emitter(s);dt();let Ke="",Qt=0,gt=0,Tt=0,Ct=!1;try{if(ft.__emitTokens)ft.__emitTokens(j,Fe);else{for(He.matcher.considerAll();;){Tt++,Ct?Ct=!1:He.matcher.considerAll(),He.matcher.lastIndex=gt;const z=He.matcher.exec(j);if(!z)break;const I=j.substring(gt,z.index),ne=on(I,z);gt=z.index+ne}on(j.substring(gt))}return Fe.finalize(),St=Fe.toHTML(),{language:A,value:St,relevance:Qt,illegal:!1,_emitter:Fe,_top:He}}catch(z){if(z.message&&z.message.includes("Illegal"))return{language:A,value:ka(j),illegal:!0,relevance:0,_illegalBy:{message:z.message,index:gt,context:j.slice(gt-100,gt+100),mode:z.mode,resultSoFar:St},_emitter:Fe};if(o)return{language:A,value:ka(j),illegal:!1,relevance:0,errorRaised:z,_emitter:Fe,_top:He};throw z}}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 U=p(A),P=j.filter(Q).filter(_).map(Ce=>f(Ce,A,!1));P.unshift(U);const ge=P.sort((Ce,$e)=>{if(Ce.relevance!==$e.relevance)return $e.relevance-Ce.relevance;if(Ce.language&&$e.language){if(Q(Ce.language).supersetOf===$e.language)return 1;if(Q($e.language).supersetOf===Ce.language)return-1}return 0}),[Ee,Me]=ge,ae=Ee;return ae.secondBest=Me,ae}function g(A,j,U){const P=j&&n[j]||U;A.classList.add("hljs"),A.classList.add(`language-${P}`)}function k(A){let j=null;const U=u(A);if(c(U))return;if(Y("before:highlightElement",{el:A,language:U}),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 P=j.textContent,ge=U?d(P,{language:U,ignoreIllegals:!0}):b(P);A.innerHTML=ge.value,A.dataset.highlighted="yes",g(A,U,ge.language),A.result={language:ge.language,re:ge.relevance,relevance:ge.relevance},ge.secondBest&&(A.secondBest={language:ge.secondBest.language,relevance:ge.secondBest.relevance}),Y("after:highlightElement",{el:A,result:ge,text:P})}function E(A){s=Tc(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 V=!1;function te(){function A(){te()}if(document.readyState==="loading"){V||window.addEventListener("DOMContentLoaded",A,!1),V=!0;return}document.querySelectorAll(s.cssSelector).forEach(k)}function D(A,j){let U=null;try{U=j(t)}catch(P){if(yo("Language definition for '{}' could not be registered.".replace("{}",A)),o)yo(P);else throw P;U=a}U.name||(U.name=A),e[A]=U,U.rawDefinition=j.bind(null,t),U.aliases&&re(U.aliases,{languageName:A})}function F(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 re(A,{languageName:j}){typeof A=="string"&&(A=[A]),A.forEach(U=>{n[U.toLowerCase()]=j})}function _(A){const j=Q(A);return j&&!j.disableAutodetect}function H(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 $(A){H(A),r.push(A)}function K(A){const j=r.indexOf(A);j!==-1&&r.splice(j,1)}function Y(A,j){const U=A;r.forEach(function(P){P[U]&&P[U](j)})}function N(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:N,configure:E,initHighlighting:M,initHighlightingOnLoad:O,registerLanguage:D,unregisterLanguage:F,listLanguages:ie,getLanguage:Q,registerAliases:re,autoDetection:_,inherit:Tc,addPlugin:$,removePlugin:K}),t.debugMode=function(){o=!1},t.safeMode=function(){o=!0},t.versionString=m2,t.regex={concat:ko,lookahead:pc,either:ga,optional:Im,anyNumberOfTimes:Bm};for(const A in Ki)typeof Ki[A]=="object"&&uc(Ki[A]);return Object.assign(t,Ki),t},zo=Ac({});zo.newInstance=()=>Ac({});var b2=zo;zo.HighlightJS=zo,zo.default=zo;const Nc=Sm(b2),Bc="[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"],Ic=["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"],_c=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Rc=["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(Rc,Ic,_c);function x2(t){const e=t.regex,n=(U,{after:P})=>{const ge="</"+U[0].slice(1);return U.input.indexOf(ge,P)!==-1},r=Bc,o={begin:"<>",end:"</>"},l=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(U,P)=>{const ge=U[0].length+U.index,Ee=U.input[ge];if(Ee==="<"||Ee===","){P.ignoreMatch();return}Ee===">"&&(n(U,{after:ge})||P.ignoreMatch());let Me;const ae=U.input.substring(ge);if(Me=ae.match(/^\s*=/)){P.ignoreMatch();return}if((Me=ae.match(/^\s+extends\s+/))&&Me.index===0){P.ignoreMatch();return}}},s={$pattern:Bc,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]},V=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,b,g,k,E,{match:/\$\d+/},f];p.contains=V.concat({begin:/\{/,end:/\}/,keywords:s,contains:["self"].concat(V)});const te=[].concat(O,p.contains),D=te.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:["self"].concat(te)}]),F={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:D},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:{_:[...Ic,..._c]}},re={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:[F],illegal:/%/},H={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function $(U){return e.concat("(?!",U.join("|"),")")}const K={match:e.concat(/\b/,$([...Rc,"super","import"].map(U=>`${U}\\s*\\(`)),r,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},Y={begin:e.concat(/\./,e.lookahead(e.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:/\(\)/},F]},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:[F]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:D,CLASS_REFERENCE:Q},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),re,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:D}]}]},{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:[F,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},Y,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[F]},K,H,ie,N,{match:/\$[(.]/}]}}const Xi="[A-Za-z$_][0-9A-Za-z$_]*",Lc=["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"],Oc=["true","false","null","undefined","NaN","Infinity"],Dc=["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"],zc=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Hc=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Pc=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],$c=[].concat(Hc,Dc,zc);function E2(t){const e=t.regex,n=(U,{after:P})=>{const ge="</"+U[0].slice(1);return U.input.indexOf(ge,P)!==-1},r=Xi,o={begin:"<>",end:"</>"},l=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(U,P)=>{const ge=U[0].length+U.index,Ee=U.input[ge];if(Ee==="<"||Ee===","){P.ignoreMatch();return}Ee===">"&&(n(U,{after:ge})||P.ignoreMatch());let Me;const ae=U.input.substring(ge);if(Me=ae.match(/^\s*=/)){P.ignoreMatch();return}if((Me=ae.match(/^\s+extends\s+/))&&Me.index===0){P.ignoreMatch();return}}},s={$pattern:Xi,keyword:Lc,literal:Oc,built_in:$c,"variable.language":Pc},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]},V=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,b,g,k,E,{match:/\$\d+/},f];p.contains=V.concat({begin:/\{/,end:/\}/,keywords:s,contains:["self"].concat(V)});const te=[].concat(O,p.contains),D=te.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:["self"].concat(te)}]),F={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:D},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:{_:[...Dc,...zc]}},re={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:[F],illegal:/%/},H={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function $(U){return e.concat("(?!",U.join("|"),")")}const K={match:e.concat(/\b/,$([...Hc,"super","import"].map(U=>`${U}\\s*\\(`)),r,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},Y={begin:e.concat(/\./,e.lookahead(e.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:/\(\)/},F]},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:[F]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:D,CLASS_REFERENCE:Q},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),re,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:D}]}]},{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:[F,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},Y,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[F]},K,H,ie,N,{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:Lc.concat(c),literal:Oc,built_in:$c.concat(o),"variable.language":Pc},d={className:"meta",begin:"@"+r},f=(k,E,M)=>{const O=k.contains.findIndex(V=>V.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])*",Fc={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 Vc(t,e,n){return n===-1?"":t.replace(e,r=>Vc(t,e,n-1))}function T2(t){const e=t.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+Vc("(?:<"+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,Fc,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},Fc,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},V={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,V,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},D={className:"function.dispatch",relevance:0,keywords:{_hint:M},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},F=[D,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:F.concat([{begin:/\(/,end:/\)/,keywords:te,contains:F.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,D,F,[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]},V=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:"("+V+"\\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}]},F=[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=F,k.contains=F;const _=[{begin:/^\s*=>/,starts:{end:"$",contains:F}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:a,contains:F}}];return u.unshift(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:[t.SHEBANG({binary:"ruby"})].concat(_).concat(u).concat(F)}}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":(Y,N)=>{N.data._beginMatch=Y[1]||Y[2]},"on:end":(Y,N)=>{N.data._beginMatch!==Y[1]&&N.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:(Y=>{const N=[];return Y.forEach(A=>{N.push(A),A.toLowerCase()===A?N.push(A.toUpperCase()):N.push(A.toLowerCase())}),N})(E),built_in:O},D=Y=>Y.map(N=>N.replace(/\|\d+$/,"")),F={variants:[{match:[/new/,e.concat(b,"+"),e.concat("(?!",D(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"}}]},re={scope:"attr",match:e.concat(r,e.lookahead(":"),e.lookahead(/(?!::)/))},_={relevance:0,begin:/\(/,end:/\)/,keywords:te,contains:[re,a,Q,t.C_BLOCK_COMMENT_MODE,g,k,F]},H={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",D(M).join("\\b|"),"|",D(O).join("\\b|"),"\\b)"),r,e.concat(b,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[_]};_.contains.push(H);const $=[re,Q,t.C_BLOCK_COMMENT_MODE,g,k,F],K={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",...$]},...$,{scope:"meta",variants:[{match:o},{match:l}]}]};return{case_insensitive:!1,keywords:te,contains:[K,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,H,Q,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},F,{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",K,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 Uc(t){return t?typeof t=="string"?t:t.source:null}function gi(t){return Ht("(?=",t,")")}function Ht(...t){return t.map(n=>Uc(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 Hn(...t){return"("+(L2(t).capture?"":"?:")+t.map(r=>Uc(r)).join("|")+")"}const ya=t=>Ht(/\b/,t,/\w$/.test(t)?/\b/:/\B/),O2=["Protocol","Type"].map(ya),qc=["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"],Gc=["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"],Wc=["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"],Kc=Hn(/[/=\-+!*%<>&|^~?]/,/[\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]/),Yc=Hn(Kc,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),xa=Ht(Kc,Yc,"*"),Xc=Hn(/[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=Hn(Xc,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),wr=Ht(Xc,Qi,"*"),Ji=Ht(/[A-Z]/,Qi,"*"),P2=["attached","autoclosure",Ht(/convention\(/,Hn("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Ht(/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:[/\./,Hn(...O2,...qc)],className:{2:"keyword"}},l={match:Ht(/\./,Hn(...wa)),relevance:0},a=wa.filter(Ge=>typeof Ge=="string").concat(["_|0"]),s=wa.filter(Ge=>typeof Ge!="string").concat(D2).map(ya),c={variants:[{className:"keyword",match:Hn(...s,...qc)}]},u={$pattern:Hn(/\b\w+/,/#\w+/),keyword:a.concat(H2),literal:Gc},d=[o,l,c],f={match:Ht(/\./,Hn(...Wc)),relevance:0},p={className:"built_in",match:Ht(/\b/,Hn(...Wc),/(?=\()/)},b=[f,p],g={match:/->/,relevance:0},k={className:"operator",relevance:0,variants:[{match:xa},{match:`\\.(\\.|${Yc})+`}]},E=[g,k],M="([0-9]_*)+",O="([0-9a-fA-F]_*)+",V={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=(Ge="")=>({className:"subst",variants:[{match:Ht(/\\/,Ge,/[0\\tnr"']/)},{match:Ht(/\\/,Ge,/u\{[0-9a-fA-F]{1,8}\}/)}]}),D=(Ge="")=>({className:"subst",match:Ht(/\\/,Ge,/[\t ]*(?:[\r\n]|\r\n)/)}),F=(Ge="")=>({className:"subst",label:"interpol",begin:Ht(/\\/,Ge,/\(/),end:/\)/}),ie=(Ge="")=>({begin:Ht(Ge,/"""/),end:Ht(/"""/,Ge),contains:[te(Ge),D(Ge),F(Ge)]}),Q=(Ge="")=>({begin:Ht(Ge,/"/),end:Ht(/"/,Ge),contains:[te(Ge),F(Ge)]}),re={className:"string",variants:[ie(),ie("#"),ie("##"),ie("###"),Q(),Q("#"),Q("##"),Q("###")]},_=[t.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[t.BACKSLASH_ESCAPE]}],H={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:_},$=Ge=>{const St=Ht(Ge,/\//),He=Ht(/\//,Ge);return{begin:St,end:He,contains:[..._,{scope:"comment",begin:`#(?!.*${He})`,end:/$/}]}},K={scope:"regexp",variants:[$("###"),$("##"),$("#"),H]},Y={match:Ht(/`/,wr,/`/)},N={className:"variable",match:/\$\d+/},A={className:"variable",match:`\\$${Qi}+`},j=[Y,N,A],U={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:$2,contains:[...E,V,re]}]}},P={scope:"keyword",match:Ht(/@/,Hn(...P2),gi(Hn(/\(/,/\s+/)))},ge={scope:"meta",match:Ht(/@/,wr)},Ee=[U,P,ge],Me={match:gi(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Ht(/(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:Ht(/\s+&\s+/,gi(Ji)),relevance:0}]},ae={begin:/</,end:/>/,keywords:u,contains:[...r,...d,...Ee,g,Me]};Me.contains.push(ae);const Ce={match:Ht(wr,/\s*:/),keywords:"_|0",relevance:0},$e={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",Ce,...r,K,...d,...b,...E,V,re,...j,...Ee,Me]},we={begin:/</,end:/>/,keywords:"repeat each",contains:[...r,Me]},tt={begin:Hn(gi(Ht(wr,/\s*:/)),gi(Ht(wr,/\s+/,wr,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:wr}]},qt={begin:/\(/,end:/\)/,keywords:u,contains:[tt,...r,...d,...E,V,re,...Ee,Me,$e],endsParent:!0,illegal:/["']/},rn={match:[/(func|macro)/,/\s+/,Hn(Y.match,wr,xa)],className:{1:"keyword",3:"title.function"},contains:[we,qt,e],illegal:[/\[/,/%/]},pn={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[we,qt,e],illegal:/\[|%/},Gt={match:[/operator/,/\s+/,xa],className:{1:"keyword",3:"title"}},dt={begin:[/precedencegroup/,/\s+/,Ji],className:{1:"keyword",3:"title"},contains:[Me],keywords:[...z2,...Gc],end:/}/},jt={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},on={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},ft={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,wr,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[we,...d,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:Ji},...d],relevance:0}]};for(const Ge of re.variants){const St=Ge.contains.find(Pt=>Pt.label==="interpol");St.keywords=u;const He=[...d,...b,...E,V,re,...j];St.contains=[...He,{begin:/\(/,end:/\)/,contains:["self",...He]}]}return{name:"Swift",keywords:u,contains:[...r,rn,pn,jt,on,ft,Gt,dt,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},K,...d,...b,...E,V,re,...j,...Ee,Me,$e]}}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"],V=["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"],D=["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,...V,"set","shopt",...te,...D]},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},V={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=[V,p,a,t.NUMBER_MODE,u,d,b,s,c,O],D={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 V.contains.unshift(D),{name:"PowerShell",aliases:["pwsh","ps","ps1"],case_insensitive:!0,keywords:o,contains:te.concat(g,k,E,M,D)}}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(D=>!d.includes(D)),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(D){return e.concat(/\b/,e.either(...D.map(F=>F.replace(/\s+/,"\\s+"))),/\b/)}const V={scope:"keyword",match:O(p),relevance:0};function te(D,{exceptions:F,when:ie}={}){const Q=ie;return F=F||[],D.map(re=>re.match(/\|\d+$/)||F.includes(re)?re:Q(re)?`${re}|0`:re)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:te(g,{when:D=>D.length<3}),literal:l,type:s,built_in:f},contains:[{scope:"type",match:O(a)},V,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)Nc.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 Zc(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function d4(t,e){const n=u4[e];if(!n||t.length===0)return Zc(t);try{return Nc.highlight(t,{language:n,ignoreIllegals:!0}).value}catch{return Zc(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=_n(),r=Lr(),o=i.computed(()=>d4(Ve(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",...er(t.block.attrs)],"data-lang":l},[s,a,c,i.h(Hr,{block:t.block,placeholder:t.placeholder,class:"block-code"})])}}}),h4={name:"codeBlock",schema:{type:"codeBlock",content:"text",nestable:!1,isolating:!0,inlineMarks:!1,attrs:{...Cf,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:Ln.align,indent:Ln.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=Xn(),n=Lr(),r=_n(),o=t.block.id,l=i.ref(Jr(o)),a=L0((_,H)=>{_===o&&(l.value=H)});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 $,K;const _=c.value;if(!_)return;s.value={w:_.naturalWidth,h:_.naturalHeight};const H=t.block.attrs;(!H.width||H.width===0)&&(!H.height||H.height===0)&&((K=($=e.commands).setAttrs)==null||K.call($,{id:o,attrs:{...H,width:_.naturalWidth,height:_.naturalHeight}}))}function k(_){var A,j,U;_.preventDefault(),_.stopPropagation();const H=t.block.attrs,$=(A=c.value)==null?void 0:A.closest(".block-image-container"),K=$?$.clientWidth-8:0;let Y=H.width||((j=s.value)==null?void 0:j.w)||200,N=H.height||((U=s.value)==null?void 0:U.h)||150;if(N>E){const P=Y/Math.max(1,N);N=E,Y=Math.round(N*P)}if(K>0&&Y>K){const P=Y/Math.max(1,N);Y=K,N=Math.round(Y/P)}d=Y,f=N,p=_.clientX,b=d/Math.max(1,f),u.value=!0,document.addEventListener("mousemove",M,!0),document.addEventListener("mouseup",O,!0),document.addEventListener("selectstart",V,!0)}const E=600;function M(_){var N,A,j;if(!u.value)return;const H=_.clientX-p;let $=Math.max(40,Math.round(d+H)),K=Math.max(40,Math.round($/b));K>E&&(K=E,$=Math.max(40,Math.round(K*b)));const Y=(N=c.value)==null?void 0:N.closest(".block-image-container");if(Y){const U=Y.clientWidth-8;$>U&&($=Math.max(40,U),K=Math.max(40,Math.round($/b)))}(j=(A=e.commands).setAttrs)==null||j.call(A,{id:o,attrs:{...t.block.attrs,width:$,height:K}})}function O(){u.value=!1,document.removeEventListener("mousemove",M,!0),document.removeEventListener("mouseup",O,!0),document.removeEventListener("selectstart",V,!0)}function V(_){_.preventDefault()}const te=i.ref(null);function D(){if(!te.value){const _=document.createElement("input");_.type="file",_.accept="image/*",_.multiple=!1,te.value=_,_.addEventListener("change",()=>{var $;const H=($=_.files)==null?void 0:$[0];H&&F(H),_.value=""})}te.value.click()}function F(_){const H=Zl(_),$=new AbortController;pr(o,{status:"pending",progress:0,file:_,tempPreviewUrl:H,controller:$}),O0(_.name,_,$,{onProgress:K=>{const Y=Jr(o);Y&&pr(o,{...Y,progress:Math.max(0,Math.min(1,K))})},onSuccess:K=>{var j,U;const Y=Jr(o);if(Y!=null&&Y.tempPreviewUrl&&Y.tempPreviewUrl!==K.url)try{URL.revokeObjectURL(Y.tempPreviewUrl)}catch{}const N={...t.block.attrs,src:K.url},A={...N,width:K.width??N.width,height:K.height??N.height,alt:K.alt??N.alt,title:K.title??N.title,fileId:K.fileId??N.fileId};(U=(j=e.commands).setAttrs)==null||U.call(j,{id:o,attrs:A}),pr(o,null)},onError:K=>{const Y=Jr(o);Y&&pr(o,{...Y,status:"error",progress:0,error:K})}})}function ie(){const _=Jr(o);!_||!_.file||F(_.file)}function Q(){var _,H;(H=(_=e.commands).removeBlock)==null||H.call(_,{id:o})}function re(){const _=l.value;return _!=null&&_.tempPreviewUrl?_.tempPreviewUrl:t.block.attrs.src??""}return()=>{const _=t.block.attrs,H=re(),$=l.value,K=_.width,Y=_.height;let N=K;K>0&&Y>E&&(N=Math.max(1,Math.round(K*E/Y)));const A={},j=($==null?void 0:$.status)==="error";K&&K>0&&!j&&(A.width=`${N}px`);const U=[],P=!!$&&$.status!=="success";if(n.value&&U.push(i.h("div",{class:["image-block-toolbar",{"image-block-toolbar-forced":P}]},[i.h("button",{class:"image-block-btn",title:r.t("image.replace"),onClick:ae=>{ae.stopPropagation(),D()}},[i.h(Rn,{html:If})]),i.h("button",{class:"image-block-btn",title:r.t("image.remove"),onClick:ae=>{ae.stopPropagation(),Q()}},[i.h(Rn,{html:Bf})])])),($==null?void 0:$.status)==="pending"){const ae=Math.round($.progress*100);U.push(i.h("div",{class:"image-block-upload-overlay"},[i.h(Rn,{html:Af,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(($==null?void 0:$.status)==="error"&&U.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"},$.error??""),i.h("button",{class:"image-block-retry-btn",onClick:ae=>{ae.stopPropagation(),ie()}},[i.h(Rn,{html:Nf})," ",r.t("image.retry")])])),!H&&(!$||$.status==="success")&&U.push(i.h("div",{class:"image-block-empty",onClick:ae=>{ae.stopPropagation(),n.value&&D()}},[i.h(Rn,{html:_f,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"))])),H&&($==null?void 0:$.status)!=="error"){const ae={};K&&K>0&&(ae.width=`${N}px`);const Ce=[i.h("img",{ref:c,class:"image-block-img",src:H,alt:_.alt||"",title:_.title||"",style:ae,draggable:!1,onLoad:g,onError:()=>{(!$||$.status!=="pending"&&$.status!=="error")&&pr(o,{status:"error",progress:0,error:r.t("image.loadFailed"),tempPreviewUrl:void 0})}})];s.value&&n.value&&Ce.push(i.h("div",{class:"image-block-resize-handle",onMousedown:k,title:r.t("image.resize")})),U.push(i.h("div",{class:"image-block-main"},Ce))}const ge=_.caption||"";!(($==null?void 0:$.status)==="error")&&(ge||H)&&U.push(i.h("div",{class:"image-block-caption",contenteditable:n.value?"true":"false","data-placeholder":r.t("image.captionPlaceholder"),onBlur:ae=>{var $e,we;const Ce=ae.currentTarget.textContent??"";Ce!==ge&&((we=($e=e.commands).setAttrs)==null||we.call($e,{id:o,attrs:{...t.block.attrs,caption:Ce}}))},onInput:()=>{},onMousedown:ae=>{ae.stopPropagation()},onClick:ae=>{ae.stopPropagation()}},ge));const Me=["block-image-wrapper"];return($==null?void 0:$.status)==="error"&&Me.push("image-block-wrapper-error"),($==null?void 0:$.status)==="pending"&&!H&&!$.tempPreviewUrl&&Me.push("image-block-wrapper-loading"),i.h("div",{class:["block-image-container","block-focus-root",...er(_)]},[i.h("div",{class:Me,style:A},U)])}}}),jc={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:Mf,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
|
-
*${l}*`:a}}};function Ea(t){return t.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function g4(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}class
|
|
7
|
+
`),n=[];let r=[],o=0;const l=()=>{r.length>0&&n.push({kind:"lines",lines:r}),r=[]};for(;o<e.length;){const a=e[o]??"",s=/^(\s*)(```+|~~~+)\s*(\S*)\s*$/.exec(a);if(s){l();const u=s[2][0],d=s[3]??"",f=[];for(o+=1;o<e.length;){const p=e[o];if(new RegExp(`^\\s*${u}{3,}\\s*$`).test(p))break;f.push(p),o+=1}n.push({kind:"fence",lang:d,body:f}),o+=1;continue}if(/^\s*\$\$\s*$/.exec(a)){l();const u=[];for(o+=1;o<e.length;){const d=e[o];if(/^\s*\$\$\s*$/.test(d))break;u.push(d),o+=1}n.push({kind:"math",body:u}),o+=1;continue}if(a.includes("|")&&o+1<e.length&&/^\s*\|?\s*:?-{2,}:?\s*(\|\s*:?-{2,}:?\s*)+\|?\s*$/.test(e[o+1]??"")){l();const u=[a,e[o+1]];for(o+=2;o<e.length&&(e[o]??"").includes("|");)u.push(e[o]),o+=1;n.push({kind:"table",lines:u});continue}r.push(a),o+=1}return l(),n}function X1(t){const e=s=>s.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(u=>u.trim()),n=e(t[0]??""),r=t.slice(2).map(s=>e(s)),o=Math.max(n.length,...r.map(s=>s.length)),l=r.length+1,a=[];for(let s=0;s<l;s++){const c=[],u=s===0?n:r[s-1]??[];for(let d=0;d<o;d++)c.push({content:fo(Z1(u[d]??"")),covered:!1});a.push(c)}return{type:"table",attrs:{cells:a,rows:l,cols:o,headerRow:!0,colWidths:[]}}}function Z1(t){return t.replace(/<br>/gi,`
|
|
8
|
+
`).replace(/\\\|/g,"|").replace(/\\\\/g,"\\")}function j1(t){const e=[],n=Y1(t);for(const f of n){if(f.kind==="fence"){e.push({indent:0,block:{type:"codeBlock",attrs:f.lang?{language:f.lang}:void 0,content:[{type:"text",text:f.body.join(`
|
|
9
|
+
`)}]}});continue}if(f.kind==="table"){e.push({indent:0,block:X1(f.lines)});continue}if(f.kind==="math"){e.push({indent:0,block:{type:"equation",attrs:{expression:f.body.join(`
|
|
10
|
+
`)},content:[]}});continue}const p=[];let b=!1;for(const g of f.lines){if(g.trim().length===0){b=!0;continue}const k=g.length-g.trimStart().length,E=K1(g.trim());if(!E){b=!1;continue}p.push({indent:k,block:E,blankBefore:b}),b=!1}for(const g of p){const k=e[e.length-1];if(k&&!g.blankBefore&&k.indent===g.indent&&k.block.type===g.block.type&&(g.block.type==="quote"||g.block.type==="paragraph")){const E=k.block.content??[],M=g.block.content??[];e[e.length-1]={indent:k.indent,block:{type:k.block.type,...k.block.attrs?{attrs:k.block.attrs}:{},content:[...E,{type:"text",text:`
|
|
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 N3(t){var o,l;const e=["<table>"],n=[];for(let a=0;a<t.cols;a++){const s=t.colWidths[a]??0;n.push(s>0?`<col style="width:${s}px">`:"<col>")}n.length>0&&e.push(`<colgroup>${n.join("")}</colgroup>`);const r=t.headerRow?1:0;if(t.headerRow){e.push("<thead><tr>");for(let a=0;a<t.cols;a++){const s=(o=t.cells[0])==null?void 0:o[a];if(!s||s.covered)continue;const c=s.rowspan>1?` rowspan="${s.rowspan}"`:"",u=s.colspan>1?` colspan="${s.colspan}"`:"";e.push(`<th${c}${u}>${A0(Pi(s))}</th>`)}e.push("</tr></thead>")}e.push("<tbody>");for(let a=r;a<t.rows;a++){e.push("<tr>");for(let s=0;s<t.cols;s++){const c=(l=t.cells[a])==null?void 0:l[s];if(!c||c.covered)continue;const u=c.rowspan>1?` rowspan="${c.rowspan}"`:"",d=c.colspan>1?` colspan="${c.colspan}"`:"";e.push(`<td${u}${d}>${A0(Pi(c))}</td>`)}e.push("</tr>")}return e.push("</tbody></table>"),e.join("")}function A0(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function B3(t){var d;const e=Array.from(t.querySelectorAll("tr"));if(e.length===0)return null;let n=0;const r=[];for(const f of e){const p=Array.from(f.children).filter(g=>g.tagName==="TH"||g.tagName==="TD");let b=0;for(const g of p)b+=g.colSpan||1;b>n&&(n=b),r.push(p)}n=Math.max(1,n);const o=e.length,l=[];for(let f=0;f<o;f++){const p=[];for(let b=0;b<n;b++)p.push(mo());l.push(p)}for(let f=0;f<o;f++){const p=r[f]??[];let b=0;for(const g of p){for(;b<n&&l[f][b].covered;)b++;if(b>=n)break;const k=Math.max(1,Math.min(g.rowSpan||1,o-f)),E=Math.max(1,Math.min(g.colSpan||1,n-b)),M=Io(Qn(g));l[f][b]={content:M,rowspan:k,colspan:E,covered:!1};for(let O=f;O<f+k;O++)for(let P=b;P<b+E;P++)O===f&&P===b||O<o&&P<n&&(l[O][P]={content:[],rowspan:1,colspan:1,covered:!0});b+=E}}const a=t.querySelectorAll("thead tr").length>0||((d=r[0])==null?void 0:d.every(f=>f.tagName==="TH"))===!0,s=[];for(let f=0;f<n;f++)s.push(0);const c=l.map(f=>f.map(_o)),u=Dr(c,o,n);return{rows:o,cols:n,cells:u,colWidths:s,headerRow:a}}function I3(t){if(!t||typeof t!="object")return!1;const e=t;return!(typeof e.rows!="number"||!Number.isInteger(e.rows)||e.rows<1||typeof e.cols!="number"||!Number.isInteger(e.cols)||e.cols<1)}function go(t){return ci(t)}function Kl(t,e,n){var o,l;const r=(o=t.cells[e])==null?void 0:o[n];if(!r||r.covered)return 1;if(typeof r.startNumber=="number")return r.startNumber;for(let a=e-1;a>=0;a--){const s=(l=t.cells[a])==null?void 0:l[n];if(!(!s||s.covered)){if(s.cellType!=="orderedList")break;return Kl(t,a,n)+1}}return 1}const N0=new Set(["p","h1","h2","h3","h4","h5","h6","li","pre","blockquote","hr","tr","table-row","table"]),_3=/^(?:-{3,}|\*{3,}|_{3,})\s*$/,Yl={h1:1,h2:2,h3:3,h4:4,h5:5,h6:6},B0=new Set(["meta","style","script","head","title","link","object","embed"]);function R3(t){const e=(t.getAttribute("src")??"").trim();return!e||/^cid:/i.test(e)||/^(javascript|vbscript|data:text\/)/i.test(e)||e.length>1e7?null:{src:e,alt:(t.getAttribute("alt")??"").trim(),title:(t.getAttribute("title")??"").trim()}}function $i(t){return N0.has(t)||t in Yl}function L3(t,e){if(t){const n=O3(t);if(n.length>0)return n}if(t){const n=H3(t);if(n.length>0)return n}return e?z3(e):[]}function O3(t){const e=t.match(/<!--\s*blockeditor:(.+?)\s*-->/);if(!e)return[];try{const n=JSON.parse(e[1]),r=n.type,o=n.attrs,l=n.text;if(!r)return[];const a=[];return l&&l.length>0?a.push({type:r,attrs:o??{},content:Xr(l)}):a.push({type:r,attrs:o??{},content:[]}),a}catch{return[]}}function Xl(t){let e=0;for(const n of t)n.type==="text"&&(e+=n.text.length);return e}function D3(t){if(t.length===0)return t;const e=[...t];for(;e.length>0;){const n=e[0];if(n.type!=="text")break;const r=n.text.replace(/^[\s\r\n]+/,"");if(r===n.text)break;if(r.length===0)e.shift();else{e[0]={...n,text:r};break}}for(;e.length>0;){const n=e[e.length-1];if(n.type!=="text")break;const r=n.text.replace(/[\s\r\n]+$/,"");if(r===n.text)break;if(r.length===0)e.pop();else{e[e.length-1]={...n,text:r};break}}return e}function I0(t){for(let e=0;e<t.length;e++){const n=t[e];n.type==="codeBlock"||n.type==="image"||n.type==="table"||n.type==="divider"||(t[e]={...n,content:D3(n.content)})}}function z3(t){const e=t.split(/\r?\n/),n=[];for(const r of e)_3.test(r)?n.push({type:"divider",attrs:{},content:[]}):n.push({type:"paragraph",attrs:{},content:Xr(r)});return I0(n),_0(n),n}function _0(t){const e=new Set(["image","table","divider","codeBlock","equation"]),n=[];let r=!1;for(const o of t)!e.has(o.type)&&Xl(o.content)===0?(r||n.push(o),r=!0):(n.push(o),r=!1);for(;n.length>1&&!e.has(n[0].type)&&Xl(n[0].content)===0;)n.shift();for(;n.length>1&&!e.has(n[n.length-1].type)&&Xl(n[n.length-1].content)===0;)n.pop();t.length=0;for(const o of n)t.push(o)}function H3(t){const e=new DOMParser().parseFromString(t,"text/html"),n=[];let r=e.body;for(;r.nodeType===Node.ELEMENT_NODE;){const o=r,l=Array.from(o.childNodes),a=l.filter(f=>f.nodeType===Node.ELEMENT_NODE&&!B0.has(f.tagName.toLowerCase())),s=a.some(f=>$i(f.tagName.toLowerCase())||f.tagName.toLowerCase()==="br"),c=l.some(f=>f.nodeType===Node.TEXT_NODE&&(f.textContent??"").length>0),u=a.some(f=>!$i(f.tagName.toLowerCase())&&f.tagName.toLowerCase()!=="div");if(s||c||u||a.length!==1)break;const d=a[0];if(d&&(d.tagName.toLowerCase()==="div"||d.tagName.toLowerCase()==="span"))r=d;else break}if(fi(r.childNodes,e,n),I0(n),_0(n),n.length===0){const o=e.body.textContent??"";o.length>0&&n.push({type:"paragraph",attrs:{},content:Xr(o)})}return n}function fi(t,e,n){var a;let r=[],o=0;function l(s=!1){if(r.length===0&&!s){o=0;return}const c=e.createElement("div");for(const d of r)c.appendChild(d.cloneNode(!0));const u=Qn(c);n.push({type:"paragraph",attrs:{},content:u}),r=[],o=0}for(const s of t){if(s.nodeType===Node.COMMENT_NODE)continue;if(s.nodeType===Node.TEXT_NODE){const d=s.textContent??"";if(d.length>0&&d.trim().length===0)continue;r.push(s),o=0;continue}if(s.nodeType!==Node.ELEMENT_NODE)continue;const c=s,u=c.tagName.toLowerCase();if(!B0.has(u)){if(u==="br"){o+=1;const d=r.length>0;l(!1),d||(o>=2||n.length>0)&&n.push({type:"paragraph",attrs:{},content:[]});continue}if(u==="pre"){l();const d=(c.textContent??"").replace(/^\n+|\n+$/g,"");n.push({type:"codeBlock",attrs:{language:"plain"},content:Xr(d)}),o=0;continue}if(u==="hr"){l(),n.push({type:"divider",attrs:{},content:[]}),o=0;continue}if(u in Yl){l(),n.push({type:"heading",attrs:{level:Yl[u]},content:Qn(c)}),o=0;continue}if(u==="blockquote"){l(),fi(c.childNodes,e,n),o=0;continue}if(u==="li"){l();const d=c.parentElement,f=(d==null?void 0:d.tagName.toLowerCase())??"",p=Qn(c);f==="ol"?n.push({type:"orderedList",attrs:{},content:p}):f==="ul"?n.push({type:"bulletList",attrs:{},content:p}):n.push({type:"paragraph",attrs:{},content:p}),o=0;continue}if(N0.has(u)){l();const d=Array.from(c.children).some(p=>$i(p.tagName.toLowerCase())),f=!!c.querySelector("img");d||f?fi(c.childNodes,e,n):c.querySelector("br")?P3(c,e,n):n.push({type:"paragraph",attrs:{},content:Qn(c)}),o=0;continue}if(u==="div"||u==="span"){const d=Array.from(c.children).some(p=>{const b=p.tagName.toLowerCase();return $i(b)||b==="div"}),f=!!c.querySelector("img");if(d||f)l(),fi(c.childNodes,e,n),o=0;else{u==="div"&&r.length>0&&r.push(e.createTextNode(`
|
|
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`),fe=A,V=j),F===void 0&&(F=!0);const Ee={code:V,language:fe};K("before:highlight",Ee);const Me=Ee.result?Ee.result:f(Ee.language,Ee.code,F);return Me.code=Ee.code,K("after:highlight",Me),Me}function f(A,j,F,V){const fe=Object.create(null);function Ee(be,Y){return be.keywords[Y]}function Me(){if(!Pe.keywords){Fe.addText(qe);return}let be=0;Pe.keywordPatternRe.lastIndex=0;let Y=Pe.keywordPatternRe.exec(qe),L="";for(;Y;){L+=qe.substring(be,Y.index);const re=St.case_insensitive?Y[0].toLowerCase():Y[0],Je=Ee(Pe,re);if(Je){const[Ve,tn]=Je;if(Fe.addText(L),L="",fe[re]=(fe[re]||0)+1,fe[re]<=g2&&(jt+=tn),Ve.startsWith("_"))L+=Y[0];else{const Mn=St.classNameAliases[Ve]||Ve;He(Y[0],Mn)}}else L+=Y[0];be=Pe.keywordPatternRe.lastIndex,Y=Pe.keywordPatternRe.exec(qe)}L+=qe.substring(be),Fe.addText(L)}function ae(){if(qe==="")return;let be=null;if(typeof Pe.subLanguage=="string"){if(!e[Pe.subLanguage]){Fe.addText(qe);return}be=f(Pe.subLanguage,qe,!0,Ut[Pe.subLanguage]),Ut[Pe.subLanguage]=be._top}else be=b(qe,Pe.subLanguage.length?Pe.subLanguage:null);Pe.relevance>0&&(jt+=be.relevance),Fe.__addSublanguage(be._emitter,be.language)}function Te(){Pe.subLanguage!=null?ae():Me(),qe=""}function He(be,Y){be!==""&&(Fe.startScope(Y),Fe.addText(be),Fe.endScope())}function xe(be,Y){let L=1;const re=Y.length-1;for(;L<=re;){if(!be._emit[L]){L++;continue}const Je=St.classNameAliases[be[L]]||be[L],Ve=Y[L];Je?He(Ve,Je):(qe=Ve,Me(),qe=""),L++}}function tt(be,Y){return be.scope&&typeof be.scope=="string"&&Fe.openNode(St.classNameAliases[be.scope]||be.scope),be.beginScope&&(be.beginScope._wrap?(He(qe,St.classNameAliases[be.beginScope._wrap]||be.beginScope._wrap),qe=""):be.beginScope._multi&&(xe(be.beginScope,Y),qe="")),Pe=Object.create(be,{parent:{value:Pe}}),Pe}function Vt(be,Y,L){let re=Rm(be.endRe,L);if(re){if(be["on:end"]){const Je=new uc(be);be["on:end"](Y,Je),Je.isMatchIgnored&&(re=!1)}if(re){for(;be.endsParent&&be.parent;)be=be.parent;return be}}if(be.endsWithParent)return Vt(be.parent,Y,L)}function on(be){return Pe.matcher.regexIndex===0?(qe+=be[0],1):(at=!0,0)}function gn(be){const Y=be[0],L=be.rule,re=new uc(L),Je=[L.__beforeBegin,L["on:begin"]];for(const Ve of Je)if(Ve&&(Ve(be,re),re.isMatchIgnored))return on(Y);return L.skip?qe+=Y:(L.excludeBegin&&(qe+=Y),Te(),!L.returnBegin&&!L.excludeBegin&&(qe=Y)),tt(L,be),L.returnBegin?0:Y.length}function Gt(be){const Y=be[0],L=j.substring(be.index),re=Vt(Pe,be,L);if(!re)return Tc;const Je=Pe;Pe.endScope&&Pe.endScope._wrap?(Te(),He(Y,Pe.endScope._wrap)):Pe.endScope&&Pe.endScope._multi?(Te(),xe(Pe.endScope,be)):Je.skip?qe+=Y:(Je.returnEnd||Je.excludeEnd||(qe+=Y),Te(),Je.excludeEnd&&(qe=Y));do Pe.scope&&Fe.closeNode(),!Pe.skip&&!Pe.subLanguage&&(jt+=Pe.relevance),Pe=Pe.parent;while(Pe!==re.parent);return re.starts&&tt(re.starts,be),Je.returnEnd?0:Y.length}function ct(){const be=[];for(let Y=Pe;Y!==St;Y=Y.parent)Y.scope&&be.unshift(Y.scope);be.forEach(Y=>Fe.openNode(Y))}let Zt={};function ln(be,Y){const L=Y&&Y[0];if(qe+=be,L==null)return Te(),0;if(Zt.type==="begin"&&Y.type==="end"&&Zt.index===Y.index&&L===""){if(qe+=j.slice(Y.index,Y.index+1),!o){const re=new Error(`0 width match regex (${A})`);throw re.languageName=A,re.badRule=Zt.rule,re}return 1}if(Zt=Y,Y.type==="begin")return gn(Y);if(Y.type==="illegal"&&!F){const re=new Error('Illegal lexeme "'+L+'" for mode "'+(Pe.scope||"<unnamed>")+'"');throw re.mode=Pe,re}else if(Y.type==="end"){const re=Gt(Y);if(re!==Tc)return re}if(Y.type==="illegal"&&L==="")return qe+=`
|
|
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
|
+
*${l}*`:a}}};function Ea(t){return t.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function g4(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}class ke extends Error{constructor(e,n){var r="KaTeX parse error: "+e,o,l,a=n&&n.loc;if(a&&a.start<=a.end){var s=a.lexer.input;o=a.start,l=a.end,o===s.length?r+=" at end of input: ":r+=" at position "+(o+1)+": ";var c=s.slice(o,l).replace(/[^]/g,"$&̲"),u;o>15?u="…"+s.slice(o-15,o):u=s.slice(0,o);var d;l+15<s.length?d=s.slice(l,l+15)+"…":d=s.slice(l),r+=u+c+d}super(r),this.name="ParseError",this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,ke.prototype),this.position=o,o!=null&&l!=null&&(this.length=l-o),this.rawMessage=e}}var b4=/([A-Z])/g,v4=t=>t.replace(b4,"-$1").toLowerCase(),k4={"&":"&",">":">","<":"<",'"':""","'":"'"},y4=/[&><"']/g,Ln=t=>String(t).replace(y4,e=>k4[e]),nl=t=>t.type==="ordgroup"||t.type==="color"?t.body.length===1?nl(t.body[0]):t:t.type==="font"?nl(t.body):t,w4=new Set(["mathord","textord","atom"]),Hr=t=>w4.has(nl(t).type),x4=t=>{var e=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(t);return e?e[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e[1])?null:e[1].toLowerCase():"_relative"},Ca={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:t=>"#"+t},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(t,e)=>(e.push(t),e)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:t=>Math.max(0,t),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:t=>Math.max(0,t),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:t=>Math.max(0,t),cli:"-e, --max-expand <n>",cliProcessor:t=>t==="Infinity"?1/0:parseInt(t)},globalGroup:{type:"boolean",cli:!1}};function E4(t){if(typeof t!="string")return t.enum[0];switch(t){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function C4(t){if(Object.prototype.hasOwnProperty.call(t,"default")&&t.default!==void 0)return t.default;var e=Array.isArray(t.type)?t.type[0]:t.type;return E4(e)}function S4(t,e,n,r){var o=Object.prototype.hasOwnProperty.call(n,e)?n[e]:void 0,l=Object.prototype.hasOwnProperty.call(r,"processor")?r.processor:void 0;t[e]=o!==void 0?l?l(o):o:C4(r)}class Sa{constructor(e){e===void 0&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{};for(var n of Object.keys(Ca)){var r=Ca[n];r&&S4(this,n,e,r)}}reportNonstrict(e,n,r){var o=this.strict;if(typeof o=="function"&&(o=o(e,n,r)),!(!o||o==="ignore")){if(o===!0||o==="error")throw new ke("LaTeX-incompatible input and strict mode is set to 'error': "+(n+" ["+e+"]"),r);o==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+o+"': "+n+" ["+e+"]"))}}useStrictBehavior(e,n,r){var o=this.strict;if(typeof o=="function")try{o=o(e,n,r)}catch{o="error"}return!o||o==="ignore"?!1:o===!0||o==="error"?!0:o==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+o+"': "+n+" ["+e+"]")),!1)}isTrusted(e){if("url"in e&&e.url&&!e.protocol){var n=x4(e.url);if(n==null)return!1;e.protocol=n}var r=typeof this.trust=="function"?this.trust(e):this.trust;return!!r}}class to{constructor(e,n,r){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=n,this.cramped=r}sup(){return xr[T4[this.id]]}sub(){return xr[M4[this.id]]}fracNum(){return xr[A4[this.id]]}fracDen(){return xr[N4[this.id]]}cramp(){return xr[B4[this.id]]}text(){return xr[I4[this.id]]}isTight(){return this.size>=2}}var Ta=0,rl=1,$o=2,Pr=3,bi=4,lr=5,Fo=6,Hn=7,xr=[new to(Ta,0,!1),new to(rl,0,!0),new to($o,1,!1),new to(Pr,1,!0),new to(bi,2,!1),new to(lr,2,!0),new to(Fo,3,!1),new to(Hn,3,!0)],T4=[bi,lr,bi,lr,Fo,Hn,Fo,Hn],M4=[lr,lr,lr,lr,Hn,Hn,Hn,Hn],A4=[$o,Pr,bi,lr,Fo,Hn,Fo,Hn],N4=[Pr,Pr,lr,lr,Hn,Hn,Hn,Hn],B4=[rl,rl,Pr,Pr,lr,lr,Hn,Hn],I4=[Ta,rl,$o,Pr,$o,Pr,$o,Pr],nt={DISPLAY:xr[Ta],TEXT:xr[$o],SCRIPT:xr[bi],SCRIPTSCRIPT:xr[Fo]},Ma=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function _4(t){for(var e=0;e<Ma.length;e++)for(var n=Ma[e],r=0;r<n.blocks.length;r++){var o=n.blocks[r];if(t>=o[0]&&t<=o[1])return n.name}return null}var ol=[];Ma.forEach(t=>t.blocks.forEach(e=>ol.push(...e)));function jc(t){for(var e=0;e<ol.length;e+=2)if(t>=ol[e]&&t<=ol[e+1])return!0;return!1}var yn=t=>t+" "+t,Vo=80,R4=function(e,n){return"M95,"+(622+e+n)+`
|
|
20
20
|
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
|
|
21
21
|
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
|
|
22
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
|
|
@@ -67,7 +67,7 @@ s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,1
|
|
|
67
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
68
|
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
|
|
69
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
|
|
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
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
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
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
|
|
@@ -113,10 +113,10 @@ m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9
|
|
|
113
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
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
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:
|
|
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
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
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:
|
|
119
|
+
68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:yn("M0 50 h400000 v40H0z m0 194h40000v40H0z"),midbrace:`M200428 334
|
|
120
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
121
|
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
|
|
122
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
|
|
@@ -165,7 +165,7 @@ m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown
|
|
|
165
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
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
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:
|
|
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
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
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
171
|
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
|
|
@@ -266,23 +266,23 @@ 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
|
|
|
266
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
267
|
c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
|
|
268
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},eu=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 ve("Invalid unit: '"+e.unit+"'");o!==n&&(r*=o.sizeMultiplier/n.sizeMultiplier)}return Math.min(e.number*r,n.maxSize)},xe=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},tu=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)}},nu=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]/,ru=function(e){var n="<"+e;this.classes.length&&(n+=' class="'+On(no(this.classes))+'"');var r=Na(this.style);r&&(n+=' style="'+On(r)+'"');for(var o of Object.keys(this.attributes)){if(G4.test(o))throw new ve("Invalid attribute name '"+o+"'");n+=" "+o+'="'+On(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,tu.call(this,e,r,o),this.children=n||[]}setAttribute(e,n){this.attributes[e]=n}hasClass(e){return this.classes.includes(e)}toNode(){return nu.call(this,"span")}toMarkup(){return ru.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,tu.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 nu.call(this,"a")}toMarkup(){return ru.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="'+On(this.src)+'"'+(' alt="'+On(this.alt)+'"'),n=Na(this.style);return n&&(e+=' style="'+On(n)+'"'),e+="'/>",e}}var K4={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class tr{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=xe(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+=On(no(this.classes)),n+='"');var r="";this.italic>0&&(r+="margin-right:"+xe(this.italic)+";"),r+=Na(this.style),r&&(e=!0,n+=' style="'+On(r)+'"');var o=On(this.text);return e?(n+=">",n+=o,n+="</span>",n):o}}class Fr{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+'="'+On(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",Jc[this.pathName]),n}toMarkup(){return this.alternate?'<path d="'+On(this.alternate)+'"/>':'<path d="'+On(Jc[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+'="'+On(this.attributes[n])+'"';return e+="/>",e}}function Y4(t){if(t instanceof tr)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]},ou={Å:"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 ou&&(r=ou[t[0]].charCodeAt(0),o=Er[e][r]),!o&&n==="text"&&Qc(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 Xt={math:{},text:{}};function h(t,e,n,r,o,l){Xt[t][o]={font:e,group:n,replace:r},l&&r&&(Xt[t][r]=Xt[t][o])}var m="math",me="text",v="main",B="ams",Zt="accent-token",Oe="bin",$n="close",Go="inner",qe="mathord",fn="op-token",nr="open",vi="punct",R="rel",Vr="spacing",W="textord";h(m,v,R,"≡","\\equiv",!0),h(m,v,R,"≺","\\prec",!0),h(m,v,R,"≻","\\succ",!0),h(m,v,R,"∼","\\sim",!0),h(m,v,R,"⊥","\\perp"),h(m,v,R,"⪯","\\preceq",!0),h(m,v,R,"⪰","\\succeq",!0),h(m,v,R,"≃","\\simeq",!0),h(m,v,R,"∣","\\mid",!0),h(m,v,R,"≪","\\ll",!0),h(m,v,R,"≫","\\gg",!0),h(m,v,R,"≍","\\asymp",!0),h(m,v,R,"∥","\\parallel"),h(m,v,R,"⋈","\\bowtie",!0),h(m,v,R,"⌣","\\smile",!0),h(m,v,R,"⊑","\\sqsubseteq",!0),h(m,v,R,"⊒","\\sqsupseteq",!0),h(m,v,R,"≐","\\doteq",!0),h(m,v,R,"⌢","\\frown",!0),h(m,v,R,"∋","\\ni",!0),h(m,v,R,"∝","\\propto",!0),h(m,v,R,"⊢","\\vdash",!0),h(m,v,R,"⊣","\\dashv",!0),h(m,v,R,"∋","\\owns"),h(m,v,vi,".","\\ldotp"),h(m,v,vi,"⋅","\\cdotp"),h(m,v,vi,"⋅","·"),h(me,v,W,"⋅","·"),h(m,v,W,"#","\\#"),h(me,v,W,"#","\\#"),h(m,v,W,"&","\\&"),h(me,v,W,"&","\\&"),h(m,v,W,"ℵ","\\aleph",!0),h(m,v,W,"∀","\\forall",!0),h(m,v,W,"ℏ","\\hbar",!0),h(m,v,W,"∃","\\exists",!0),h(m,v,W,"∇","\\nabla",!0),h(m,v,W,"♭","\\flat",!0),h(m,v,W,"ℓ","\\ell",!0),h(m,v,W,"♮","\\natural",!0),h(m,v,W,"♣","\\clubsuit",!0),h(m,v,W,"℘","\\wp",!0),h(m,v,W,"♯","\\sharp",!0),h(m,v,W,"♢","\\diamondsuit",!0),h(m,v,W,"ℜ","\\Re",!0),h(m,v,W,"♡","\\heartsuit",!0),h(m,v,W,"ℑ","\\Im",!0),h(m,v,W,"♠","\\spadesuit",!0),h(m,v,W,"§","\\S",!0),h(me,v,W,"§","\\S"),h(m,v,W,"¶","\\P",!0),h(me,v,W,"¶","\\P"),h(m,v,W,"†","\\dag"),h(me,v,W,"†","\\dag"),h(me,v,W,"†","\\textdagger"),h(m,v,W,"‡","\\ddag"),h(me,v,W,"‡","\\ddag"),h(me,v,W,"‡","\\textdaggerdbl"),h(m,v,$n,"⎱","\\rmoustache",!0),h(m,v,nr,"⎰","\\lmoustache",!0),h(m,v,$n,"⟯","\\rgroup",!0),h(m,v,nr,"⟮","\\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,R,"⟵","\\longleftarrow",!0),h(m,v,R,"⇐","\\Leftarrow",!0),h(m,v,R,"⟸","\\Longleftarrow",!0),h(m,v,R,"⟶","\\longrightarrow",!0),h(m,v,R,"⇒","\\Rightarrow",!0),h(m,v,R,"⟹","\\Longrightarrow",!0),h(m,v,R,"↔","\\leftrightarrow",!0),h(m,v,R,"⟷","\\longleftrightarrow",!0),h(m,v,R,"⇔","\\Leftrightarrow",!0),h(m,v,R,"⟺","\\Longleftrightarrow",!0),h(m,v,R,"↦","\\mapsto",!0),h(m,v,R,"⟼","\\longmapsto",!0),h(m,v,R,"↗","\\nearrow",!0),h(m,v,R,"↩","\\hookleftarrow",!0),h(m,v,R,"↪","\\hookrightarrow",!0),h(m,v,R,"↘","\\searrow",!0),h(m,v,R,"↼","\\leftharpoonup",!0),h(m,v,R,"⇀","\\rightharpoonup",!0),h(m,v,R,"↙","\\swarrow",!0),h(m,v,R,"↽","\\leftharpoondown",!0),h(m,v,R,"⇁","\\rightharpoondown",!0),h(m,v,R,"↖","\\nwarrow",!0),h(m,v,R,"⇌","\\rightleftharpoons",!0),h(m,B,R,"≮","\\nless",!0),h(m,B,R,"","\\@nleqslant"),h(m,B,R,"","\\@nleqq"),h(m,B,R,"⪇","\\lneq",!0),h(m,B,R,"≨","\\lneqq",!0),h(m,B,R,"","\\@lvertneqq"),h(m,B,R,"⋦","\\lnsim",!0),h(m,B,R,"⪉","\\lnapprox",!0),h(m,B,R,"⊀","\\nprec",!0),h(m,B,R,"⋠","\\npreceq",!0),h(m,B,R,"⋨","\\precnsim",!0),h(m,B,R,"⪹","\\precnapprox",!0),h(m,B,R,"≁","\\nsim",!0),h(m,B,R,"","\\@nshortmid"),h(m,B,R,"∤","\\nmid",!0),h(m,B,R,"⊬","\\nvdash",!0),h(m,B,R,"⊭","\\nvDash",!0),h(m,B,R,"⋪","\\ntriangleleft"),h(m,B,R,"⋬","\\ntrianglelefteq",!0),h(m,B,R,"⊊","\\subsetneq",!0),h(m,B,R,"","\\@varsubsetneq"),h(m,B,R,"⫋","\\subsetneqq",!0),h(m,B,R,"","\\@varsubsetneqq"),h(m,B,R,"≯","\\ngtr",!0),h(m,B,R,"","\\@ngeqslant"),h(m,B,R,"","\\@ngeqq"),h(m,B,R,"⪈","\\gneq",!0),h(m,B,R,"≩","\\gneqq",!0),h(m,B,R,"","\\@gvertneqq"),h(m,B,R,"⋧","\\gnsim",!0),h(m,B,R,"⪊","\\gnapprox",!0),h(m,B,R,"⊁","\\nsucc",!0),h(m,B,R,"⋡","\\nsucceq",!0),h(m,B,R,"⋩","\\succnsim",!0),h(m,B,R,"⪺","\\succnapprox",!0),h(m,B,R,"≆","\\ncong",!0),h(m,B,R,"","\\@nshortparallel"),h(m,B,R,"∦","\\nparallel",!0),h(m,B,R,"⊯","\\nVDash",!0),h(m,B,R,"⋫","\\ntriangleright"),h(m,B,R,"⋭","\\ntrianglerighteq",!0),h(m,B,R,"","\\@nsupseteqq"),h(m,B,R,"⊋","\\supsetneq",!0),h(m,B,R,"","\\@varsupsetneq"),h(m,B,R,"⫌","\\supsetneqq",!0),h(m,B,R,"","\\@varsupsetneqq"),h(m,B,R,"⊮","\\nVdash",!0),h(m,B,R,"⪵","\\precneqq",!0),h(m,B,R,"⪶","\\succneqq",!0),h(m,B,R,"","\\@nsubseteqq"),h(m,B,Oe,"⊴","\\unlhd"),h(m,B,Oe,"⊵","\\unrhd"),h(m,B,R,"↚","\\nleftarrow",!0),h(m,B,R,"↛","\\nrightarrow",!0),h(m,B,R,"⇍","\\nLeftarrow",!0),h(m,B,R,"⇏","\\nRightarrow",!0),h(m,B,R,"↮","\\nleftrightarrow",!0),h(m,B,R,"⇎","\\nLeftrightarrow",!0),h(m,B,R,"△","\\vartriangle"),h(m,B,W,"ℏ","\\hslash"),h(m,B,W,"▽","\\triangledown"),h(m,B,W,"◊","\\lozenge"),h(m,B,W,"Ⓢ","\\circledS"),h(m,B,W,"®","\\circledR"),h(me,B,W,"®","\\circledR"),h(m,B,W,"∡","\\measuredangle",!0),h(m,B,W,"∄","\\nexists"),h(m,B,W,"℧","\\mho"),h(m,B,W,"Ⅎ","\\Finv",!0),h(m,B,W,"⅁","\\Game",!0),h(m,B,W,"‵","\\backprime"),h(m,B,W,"▲","\\blacktriangle"),h(m,B,W,"▼","\\blacktriangledown"),h(m,B,W,"■","\\blacksquare"),h(m,B,W,"⧫","\\blacklozenge"),h(m,B,W,"★","\\bigstar"),h(m,B,W,"∢","\\sphericalangle",!0),h(m,B,W,"∁","\\complement",!0),h(m,B,W,"ð","\\eth",!0),h(me,v,W,"ð","ð"),h(m,B,W,"╱","\\diagup"),h(m,B,W,"╲","\\diagdown"),h(m,B,W,"□","\\square"),h(m,B,W,"□","\\Box"),h(m,B,W,"◊","\\Diamond"),h(m,B,W,"¥","\\yen",!0),h(me,B,W,"¥","\\yen",!0),h(m,B,W,"✓","\\checkmark",!0),h(me,B,W,"✓","\\checkmark"),h(m,B,W,"ℶ","\\beth",!0),h(m,B,W,"ℸ","\\daleth",!0),h(m,B,W,"ℷ","\\gimel",!0),h(m,B,W,"ϝ","\\digamma",!0),h(m,B,W,"ϰ","\\varkappa"),h(m,B,nr,"┌","\\@ulcorner",!0),h(m,B,$n,"┐","\\@urcorner",!0),h(m,B,nr,"└","\\@llcorner",!0),h(m,B,$n,"┘","\\@lrcorner",!0),h(m,B,R,"≦","\\leqq",!0),h(m,B,R,"⩽","\\leqslant",!0),h(m,B,R,"⪕","\\eqslantless",!0),h(m,B,R,"≲","\\lesssim",!0),h(m,B,R,"⪅","\\lessapprox",!0),h(m,B,R,"≊","\\approxeq",!0),h(m,B,Oe,"⋖","\\lessdot"),h(m,B,R,"⋘","\\lll",!0),h(m,B,R,"≶","\\lessgtr",!0),h(m,B,R,"⋚","\\lesseqgtr",!0),h(m,B,R,"⪋","\\lesseqqgtr",!0),h(m,B,R,"≑","\\doteqdot"),h(m,B,R,"≓","\\risingdotseq",!0),h(m,B,R,"≒","\\fallingdotseq",!0),h(m,B,R,"∽","\\backsim",!0),h(m,B,R,"⋍","\\backsimeq",!0),h(m,B,R,"⫅","\\subseteqq",!0),h(m,B,R,"⋐","\\Subset",!0),h(m,B,R,"⊏","\\sqsubset",!0),h(m,B,R,"≼","\\preccurlyeq",!0),h(m,B,R,"⋞","\\curlyeqprec",!0),h(m,B,R,"≾","\\precsim",!0),h(m,B,R,"⪷","\\precapprox",!0),h(m,B,R,"⊲","\\vartriangleleft"),h(m,B,R,"⊴","\\trianglelefteq"),h(m,B,R,"⊨","\\vDash",!0),h(m,B,R,"⊪","\\Vvdash",!0),h(m,B,R,"⌣","\\smallsmile"),h(m,B,R,"⌢","\\smallfrown"),h(m,B,R,"≏","\\bumpeq",!0),h(m,B,R,"≎","\\Bumpeq",!0),h(m,B,R,"≧","\\geqq",!0),h(m,B,R,"⩾","\\geqslant",!0),h(m,B,R,"⪖","\\eqslantgtr",!0),h(m,B,R,"≳","\\gtrsim",!0),h(m,B,R,"⪆","\\gtrapprox",!0),h(m,B,Oe,"⋗","\\gtrdot"),h(m,B,R,"⋙","\\ggg",!0),h(m,B,R,"≷","\\gtrless",!0),h(m,B,R,"⋛","\\gtreqless",!0),h(m,B,R,"⪌","\\gtreqqless",!0),h(m,B,R,"≖","\\eqcirc",!0),h(m,B,R,"≗","\\circeq",!0),h(m,B,R,"≜","\\triangleq",!0),h(m,B,R,"∼","\\thicksim"),h(m,B,R,"≈","\\thickapprox"),h(m,B,R,"⫆","\\supseteqq",!0),h(m,B,R,"⋑","\\Supset",!0),h(m,B,R,"⊐","\\sqsupset",!0),h(m,B,R,"≽","\\succcurlyeq",!0),h(m,B,R,"⋟","\\curlyeqsucc",!0),h(m,B,R,"≿","\\succsim",!0),h(m,B,R,"⪸","\\succapprox",!0),h(m,B,R,"⊳","\\vartriangleright"),h(m,B,R,"⊵","\\trianglerighteq"),h(m,B,R,"⊩","\\Vdash",!0),h(m,B,R,"∣","\\shortmid"),h(m,B,R,"∥","\\shortparallel"),h(m,B,R,"≬","\\between",!0),h(m,B,R,"⋔","\\pitchfork",!0),h(m,B,R,"∝","\\varpropto"),h(m,B,R,"◀","\\blacktriangleleft"),h(m,B,R,"∴","\\therefore",!0),h(m,B,R,"∍","\\backepsilon"),h(m,B,R,"▶","\\blacktriangleright"),h(m,B,R,"∵","\\because",!0),h(m,B,R,"⋘","\\llless"),h(m,B,R,"⋙","\\gggtr"),h(m,B,Oe,"⊲","\\lhd"),h(m,B,Oe,"⊳","\\rhd"),h(m,B,R,"≂","\\eqsim",!0),h(m,v,R,"⋈","\\Join"),h(m,B,R,"≑","\\Doteq",!0),h(m,B,Oe,"∔","\\dotplus",!0),h(m,B,Oe,"∖","\\smallsetminus"),h(m,B,Oe,"⋒","\\Cap",!0),h(m,B,Oe,"⋓","\\Cup",!0),h(m,B,Oe,"⩞","\\doublebarwedge",!0),h(m,B,Oe,"⊟","\\boxminus",!0),h(m,B,Oe,"⊞","\\boxplus",!0),h(m,B,Oe,"⋇","\\divideontimes",!0),h(m,B,Oe,"⋉","\\ltimes",!0),h(m,B,Oe,"⋊","\\rtimes",!0),h(m,B,Oe,"⋋","\\leftthreetimes",!0),h(m,B,Oe,"⋌","\\rightthreetimes",!0),h(m,B,Oe,"⋏","\\curlywedge",!0),h(m,B,Oe,"⋎","\\curlyvee",!0),h(m,B,Oe,"⊝","\\circleddash",!0),h(m,B,Oe,"⊛","\\circledast",!0),h(m,B,Oe,"⋅","\\centerdot"),h(m,B,Oe,"⊺","\\intercal",!0),h(m,B,Oe,"⋒","\\doublecap"),h(m,B,Oe,"⋓","\\doublecup"),h(m,B,Oe,"⊠","\\boxtimes",!0),h(m,B,R,"⇢","\\dashrightarrow",!0),h(m,B,R,"⇠","\\dashleftarrow",!0),h(m,B,R,"⇇","\\leftleftarrows",!0),h(m,B,R,"⇆","\\leftrightarrows",!0),h(m,B,R,"⇚","\\Lleftarrow",!0),h(m,B,R,"↞","\\twoheadleftarrow",!0),h(m,B,R,"↢","\\leftarrowtail",!0),h(m,B,R,"↫","\\looparrowleft",!0),h(m,B,R,"⇋","\\leftrightharpoons",!0),h(m,B,R,"↶","\\curvearrowleft",!0),h(m,B,R,"↺","\\circlearrowleft",!0),h(m,B,R,"↰","\\Lsh",!0),h(m,B,R,"⇈","\\upuparrows",!0),h(m,B,R,"↿","\\upharpoonleft",!0),h(m,B,R,"⇃","\\downharpoonleft",!0),h(m,v,R,"⊶","\\origof",!0),h(m,v,R,"⊷","\\imageof",!0),h(m,B,R,"⊸","\\multimap",!0),h(m,B,R,"↭","\\leftrightsquigarrow",!0),h(m,B,R,"⇉","\\rightrightarrows",!0),h(m,B,R,"⇄","\\rightleftarrows",!0),h(m,B,R,"↠","\\twoheadrightarrow",!0),h(m,B,R,"↣","\\rightarrowtail",!0),h(m,B,R,"↬","\\looparrowright",!0),h(m,B,R,"↷","\\curvearrowright",!0),h(m,B,R,"↻","\\circlearrowright",!0),h(m,B,R,"↱","\\Rsh",!0),h(m,B,R,"⇊","\\downdownarrows",!0),h(m,B,R,"↾","\\upharpoonright",!0),h(m,B,R,"⇂","\\downharpoonright",!0),h(m,B,R,"⇝","\\rightsquigarrow",!0),h(m,B,R,"⇝","\\leadsto"),h(m,B,R,"⇛","\\Rrightarrow",!0),h(m,B,R,"↾","\\restriction"),h(m,v,W,"‘","`"),h(m,v,W,"$","\\$"),h(me,v,W,"$","\\$"),h(me,v,W,"$","\\textdollar"),h(m,v,W,"%","\\%"),h(me,v,W,"%","\\%"),h(m,v,W,"_","\\_"),h(me,v,W,"_","\\_"),h(me,v,W,"_","\\textunderscore"),h(m,v,W,"∠","\\angle",!0),h(m,v,W,"∞","\\infty",!0),h(m,v,W,"′","\\prime"),h(m,v,W,"△","\\triangle"),h(m,v,W,"Γ","\\Gamma",!0),h(m,v,W,"Δ","\\Delta",!0),h(m,v,W,"Θ","\\Theta",!0),h(m,v,W,"Λ","\\Lambda",!0),h(m,v,W,"Ξ","\\Xi",!0),h(m,v,W,"Π","\\Pi",!0),h(m,v,W,"Σ","\\Sigma",!0),h(m,v,W,"Υ","\\Upsilon",!0),h(m,v,W,"Φ","\\Phi",!0),h(m,v,W,"Ψ","\\Psi",!0),h(m,v,W,"Ω","\\Omega",!0),h(m,v,W,"A","Α"),h(m,v,W,"B","Β"),h(m,v,W,"E","Ε"),h(m,v,W,"Z","Ζ"),h(m,v,W,"H","Η"),h(m,v,W,"I","Ι"),h(m,v,W,"K","Κ"),h(m,v,W,"M","Μ"),h(m,v,W,"N","Ν"),h(m,v,W,"O","Ο"),h(m,v,W,"P","Ρ"),h(m,v,W,"T","Τ"),h(m,v,W,"X","Χ"),h(m,v,W,"¬","\\neg",!0),h(m,v,W,"¬","\\lnot"),h(m,v,W,"⊤","\\top"),h(m,v,W,"⊥","\\bot"),h(m,v,W,"∅","\\emptyset"),h(m,B,W,"∅","\\varnothing"),h(m,v,qe,"α","\\alpha",!0),h(m,v,qe,"β","\\beta",!0),h(m,v,qe,"γ","\\gamma",!0),h(m,v,qe,"δ","\\delta",!0),h(m,v,qe,"ϵ","\\epsilon",!0),h(m,v,qe,"ζ","\\zeta",!0),h(m,v,qe,"η","\\eta",!0),h(m,v,qe,"θ","\\theta",!0),h(m,v,qe,"ι","\\iota",!0),h(m,v,qe,"κ","\\kappa",!0),h(m,v,qe,"λ","\\lambda",!0),h(m,v,qe,"μ","\\mu",!0),h(m,v,qe,"ν","\\nu",!0),h(m,v,qe,"ξ","\\xi",!0),h(m,v,qe,"ο","\\omicron",!0),h(m,v,qe,"π","\\pi",!0),h(m,v,qe,"ρ","\\rho",!0),h(m,v,qe,"σ","\\sigma",!0),h(m,v,qe,"τ","\\tau",!0),h(m,v,qe,"υ","\\upsilon",!0),h(m,v,qe,"ϕ","\\phi",!0),h(m,v,qe,"χ","\\chi",!0),h(m,v,qe,"ψ","\\psi",!0),h(m,v,qe,"ω","\\omega",!0),h(m,v,qe,"ε","\\varepsilon",!0),h(m,v,qe,"ϑ","\\vartheta",!0),h(m,v,qe,"ϖ","\\varpi",!0),h(m,v,qe,"ϱ","\\varrho",!0),h(m,v,qe,"ς","\\varsigma",!0),h(m,v,qe,"φ","\\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,W,"√","\\surd"),h(m,v,nr,"⟨","\\langle",!0),h(m,v,nr,"∣","\\lvert"),h(m,v,nr,"∥","\\lVert"),h(m,v,$n,"?","?"),h(m,v,$n,"!","!"),h(m,v,$n,"⟩","\\rangle",!0),h(m,v,$n,"∣","\\rvert"),h(m,v,$n,"∥","\\rVert"),h(m,v,R,"=","="),h(m,v,R,":",":"),h(m,v,R,"≈","\\approx",!0),h(m,v,R,"≅","\\cong",!0),h(m,v,R,"≥","\\ge"),h(m,v,R,"≥","\\geq",!0),h(m,v,R,"←","\\gets"),h(m,v,R,">","\\gt",!0),h(m,v,R,"∈","\\in",!0),h(m,v,R,"","\\@not"),h(m,v,R,"⊂","\\subset",!0),h(m,v,R,"⊃","\\supset",!0),h(m,v,R,"⊆","\\subseteq",!0),h(m,v,R,"⊇","\\supseteq",!0),h(m,B,R,"⊈","\\nsubseteq",!0),h(m,B,R,"⊉","\\nsupseteq",!0),h(m,v,R,"⊨","\\models"),h(m,v,R,"←","\\leftarrow",!0),h(m,v,R,"≤","\\le"),h(m,v,R,"≤","\\leq",!0),h(m,v,R,"<","\\lt",!0),h(m,v,R,"→","\\rightarrow",!0),h(m,v,R,"→","\\to"),h(m,B,R,"≱","\\ngeq",!0),h(m,B,R,"≰","\\nleq",!0),h(m,v,Vr," ","\\ "),h(m,v,Vr," ","\\space"),h(m,v,Vr," ","\\nobreakspace"),h(me,v,Vr," ","\\ "),h(me,v,Vr," "," "),h(me,v,Vr," ","\\space"),h(me,v,Vr," ","\\nobreakspace"),h(m,v,Vr,"","\\nobreak"),h(m,v,Vr,"","\\allowbreak"),h(m,v,vi,",",","),h(m,v,vi,";",";"),h(m,B,Oe,"⊼","\\barwedge",!0),h(m,B,Oe,"⊻","\\veebar",!0),h(m,v,Oe,"⊙","\\odot",!0),h(m,v,Oe,"⊕","\\oplus",!0),h(m,v,Oe,"⊗","\\otimes",!0),h(m,v,W,"∂","\\partial",!0),h(m,v,Oe,"⊘","\\oslash",!0),h(m,B,Oe,"⊚","\\circledcirc",!0),h(m,B,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,nr,"{","\\{"),h(me,v,W,"{","\\{"),h(me,v,W,"{","\\textbraceleft"),h(m,v,$n,"}","\\}"),h(me,v,W,"}","\\}"),h(me,v,W,"}","\\textbraceright"),h(m,v,nr,"{","\\lbrace"),h(m,v,$n,"}","\\rbrace"),h(m,v,nr,"[","\\lbrack",!0),h(me,v,W,"[","\\lbrack",!0),h(m,v,$n,"]","\\rbrack",!0),h(me,v,W,"]","\\rbrack",!0),h(m,v,nr,"(","\\lparen",!0),h(m,v,$n,")","\\rparen",!0),h(me,v,W,"<","\\textless",!0),h(me,v,W,">","\\textgreater",!0),h(m,v,nr,"⌊","\\lfloor",!0),h(m,v,$n,"⌋","\\rfloor",!0),h(m,v,nr,"⌈","\\lceil",!0),h(m,v,$n,"⌉","\\rceil",!0),h(m,v,W,"\\","\\backslash"),h(m,v,W,"∣","|"),h(m,v,W,"∣","\\vert"),h(me,v,W,"|","\\textbar",!0),h(m,v,W,"∥","\\|"),h(m,v,W,"∥","\\Vert"),h(me,v,W,"∥","\\textbardbl"),h(me,v,W,"~","\\textasciitilde"),h(me,v,W,"\\","\\textbackslash"),h(me,v,W,"^","\\textasciicircum"),h(m,v,R,"↑","\\uparrow",!0),h(m,v,R,"⇑","\\Uparrow",!0),h(m,v,R,"↓","\\downarrow",!0),h(m,v,R,"⇓","\\Downarrow",!0),h(m,v,R,"↕","\\updownarrow",!0),h(m,v,R,"⇕","\\Updownarrow",!0),h(m,v,fn,"∐","\\coprod"),h(m,v,fn,"⋁","\\bigvee"),h(m,v,fn,"⋀","\\bigwedge"),h(m,v,fn,"⨄","\\biguplus"),h(m,v,fn,"⋂","\\bigcap"),h(m,v,fn,"⋃","\\bigcup"),h(m,v,fn,"∫","\\int"),h(m,v,fn,"∫","\\intop"),h(m,v,fn,"∬","\\iint"),h(m,v,fn,"∭","\\iiint"),h(m,v,fn,"∏","\\prod"),h(m,v,fn,"∑","\\sum"),h(m,v,fn,"⨂","\\bigotimes"),h(m,v,fn,"⨁","\\bigoplus"),h(m,v,fn,"⨀","\\bigodot"),h(m,v,fn,"∮","\\oint"),h(m,v,fn,"∯","\\oiint"),h(m,v,fn,"∰","\\oiiint"),h(m,v,fn,"⨆","\\bigsqcup"),h(m,v,fn,"∫","\\smallint"),h(me,v,Go,"…","\\textellipsis"),h(m,v,Go,"…","\\mathellipsis"),h(me,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,W,"⋮","\\varvdots"),h(me,v,W,"⋮","\\varvdots"),h(m,v,Zt,"ˊ","\\acute"),h(m,v,Zt,"ˋ","\\grave"),h(m,v,Zt,"¨","\\ddot"),h(m,v,Zt,"~","\\tilde"),h(m,v,Zt,"ˉ","\\bar"),h(m,v,Zt,"˘","\\breve"),h(m,v,Zt,"ˇ","\\check"),h(m,v,Zt,"^","\\hat"),h(m,v,Zt,"⃗","\\vec"),h(m,v,Zt,"˙","\\dot"),h(m,v,Zt,"˚","\\mathring"),h(m,v,qe,"","\\@imath"),h(m,v,qe,"","\\@jmath"),h(m,v,W,"ı","ı"),h(m,v,W,"ȷ","ȷ"),h(me,v,W,"ı","\\i",!0),h(me,v,W,"ȷ","\\j",!0),h(me,v,W,"ß","\\ss",!0),h(me,v,W,"æ","\\ae",!0),h(me,v,W,"œ","\\oe",!0),h(me,v,W,"ø","\\o",!0),h(me,v,W,"Æ","\\AE",!0),h(me,v,W,"Œ","\\OE",!0),h(me,v,W,"Ø","\\O",!0),h(me,v,Zt,"ˊ","\\'"),h(me,v,Zt,"ˋ","\\`"),h(me,v,Zt,"ˆ","\\^"),h(me,v,Zt,"˜","\\~"),h(me,v,Zt,"ˉ","\\="),h(me,v,Zt,"˘","\\u"),h(me,v,Zt,"˙","\\."),h(me,v,Zt,"¸","\\c"),h(me,v,Zt,"˚","\\r"),h(me,v,Zt,"ˇ","\\v"),h(me,v,Zt,"¨",'\\"'),h(me,v,Zt,"˝","\\H"),h(me,v,Zt,"◯","\\textcircled");var iu={"--":!0,"---":!0,"``":!0,"''":!0};h(me,v,W,"–","--",!0),h(me,v,W,"–","\\textendash"),h(me,v,W,"—","---",!0),h(me,v,W,"—","\\textemdash"),h(me,v,W,"‘","`",!0),h(me,v,W,"‘","\\textquoteleft"),h(me,v,W,"’","'",!0),h(me,v,W,"’","\\textquoteright"),h(me,v,W,"“","``",!0),h(me,v,W,"“","\\textquotedblleft"),h(me,v,W,"”","''",!0),h(me,v,W,"”","\\textquotedblright"),h(m,v,W,"°","\\degree",!0),h(me,v,W,"°","\\degree"),h(me,v,W,"°","\\textdegree",!0),h(m,v,W,"£","\\pounds"),h(m,v,W,"£","\\mathsterling",!0),h(me,v,W,"£","\\pounds"),h(me,v,W,"£","\\textsterling",!0),h(m,B,W,"✠","\\maltese"),h(me,B,W,"✠","\\maltese");for(var lu='0123456789/@."',La=0;La<lu.length;La++){var au=lu.charAt(La);h(m,v,W,au,au)}for(var su='0123456789!@*()-=+";:?/.,',Oa=0;Oa<su.length;Oa++){var cu=su.charAt(Oa);h(me,v,W,cu,cu)}for(var ll="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Da=0;Da<ll.length;Da++){var al=ll.charAt(Da);h(m,v,qe,al,al),h(me,v,W,al,al)}h(m,B,W,"C","ℂ"),h(me,B,W,"C","ℂ"),h(m,B,W,"H","ℍ"),h(me,B,W,"H","ℍ"),h(m,B,W,"N","ℕ"),h(me,B,W,"N","ℕ"),h(m,B,W,"P","ℙ"),h(me,B,W,"P","ℙ"),h(m,B,W,"Q","ℚ"),h(me,B,W,"Q","ℚ"),h(m,B,W,"R","ℝ"),h(me,B,W,"R","ℝ"),h(m,B,W,"Z","ℤ"),h(me,B,W,"Z","ℤ"),h(m,v,qe,"h","ℎ"),h(me,v,qe,"h","ℎ");for(var Qe,Fn=0;Fn<ll.length;Fn++){var nn=ll.charAt(Fn);Qe=String.fromCharCode(55349,56320+Fn),h(m,v,qe,nn,Qe),h(me,v,W,nn,Qe),Qe=String.fromCharCode(55349,56372+Fn),h(m,v,qe,nn,Qe),h(me,v,W,nn,Qe),Qe=String.fromCharCode(55349,56424+Fn),h(m,v,qe,nn,Qe),h(me,v,W,nn,Qe),Qe=String.fromCharCode(55349,56580+Fn),h(m,v,qe,nn,Qe),h(me,v,W,nn,Qe),Qe=String.fromCharCode(55349,56684+Fn),h(m,v,qe,nn,Qe),h(me,v,W,nn,Qe),Qe=String.fromCharCode(55349,56736+Fn),h(m,v,qe,nn,Qe),h(me,v,W,nn,Qe),Qe=String.fromCharCode(55349,56788+Fn),h(m,v,qe,nn,Qe),h(me,v,W,nn,Qe),Qe=String.fromCharCode(55349,56840+Fn),h(m,v,qe,nn,Qe),h(me,v,W,nn,Qe),Qe=String.fromCharCode(55349,56944+Fn),h(m,v,qe,nn,Qe),h(me,v,W,nn,Qe),Fn<26&&(Qe=String.fromCharCode(55349,56632+Fn),h(m,v,qe,nn,Qe),h(me,v,W,nn,Qe),Qe=String.fromCharCode(55349,56476+Fn),h(m,v,qe,nn,Qe),h(me,v,W,nn,Qe))}Qe="𝕜",h(m,v,qe,"k",Qe),h(me,v,W,"k",Qe);for(var wo=0;wo<10;wo++){var oo=wo.toString();Qe=String.fromCharCode(55349,57294+wo),h(m,v,qe,oo,Qe),h(me,v,W,oo,Qe),Qe=String.fromCharCode(55349,57314+wo),h(m,v,qe,oo,Qe),h(me,v,W,oo,Qe),Qe=String.fromCharCode(55349,57324+wo),h(m,v,qe,oo,Qe),h(me,v,W,oo,Qe),Qe=String.fromCharCode(55349,57334+wo),h(m,v,qe,oo,Qe),h(me,v,W,oo,Qe)}for(var za="ÐÞþ",Ha=0;Ha<za.length;Ha++){var sl=za.charAt(Ha);h(m,v,qe,sl,sl),h(me,v,W,sl,sl)}var Pa={mathClass:"mathbf",textClass:"textbf",font:"Main-Bold"},uu={mathClass:"mathnormal",textClass:"textit",font:"Math-Italic"},du={mathClass:"boldsymbol",textClass:"boldsymbol",font:"Main-BoldItalic"},J4={mathClass:"mathscr",textClass:"textscr",font:"Script-Regular"},xo={mathClass:"",textClass:"",font:""},fu={mathClass:"mathfrak",textClass:"textfrak",font:"Fraktur-Regular"},hu={mathClass:"mathbb",textClass:"textbb",font:"AMS-Regular"},mu={mathClass:"mathboldfrak",textClass:"textboldfrak",font:"Fraktur-Regular"},$a={mathClass:"mathsf",textClass:"textsf",font:"SansSerif-Regular"},Fa={mathClass:"mathboldsf",textClass:"textboldsf",font:"SansSerif-Bold"},pu={mathClass:"mathitsf",textClass:"textitsf",font:"SansSerif-Italic"},Va={mathClass:"mathtt",textClass:"texttt",font:"Typewriter-Regular"},gu=[Pa,Pa,uu,uu,du,du,J4,xo,xo,xo,fu,fu,hu,hu,mu,mu,$a,$a,Fa,Fa,pu,pu,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 gu[o]}else if(120782<=r&&r<=120831){var l=Math.floor((r-120782)/10);return ep[l]}else{if(r===120485||r===120486)return gu[0];if(120486<r&&r<120782)return xo;throw new ve("Unsupported character: "+t)}},cl=function(e,n,r){if(Xt[r][e]){var o=Xt[r][e].replace;o&&(e=o)}return{value:e,metrics:_a(e,n,r)}},Vn=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 tr(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 tr(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?Vn(e,"Main-Bold",n,r,o.concat(["mathbf"])):e==="\\"||Xt[n][e].font==="main"?Vn(e,"Main-Regular",n,r,o):Vn(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 Vn(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 Vn(l,E,o,n,a.concat(M));if(Object.prototype.hasOwnProperty.call(iu,l)&&E.slice(0,10)==="Typewriter"){for(var V=[],te=0;te<l.length;te++)V.push(Vn(l[te],E,o,n,a.concat(M)));return Ur(V)}}if(r==="mathord")return Vn(l,"Math-Italic",o,n,a.concat(["mathnormal"]));if(r==="textord"){var D=Xt[o][l]&&Xt[o][l].font;if(D==="ams"){var F=dl("amsrm",u,d);return Vn(l,F,o,n,a.concat("amsrm",u,d))}else if(D==="main"||!D){var ie=dl("textrm",u,d);return Vn(l,ie,o,n,a.concat(u,d))}else{var Q=dl(D,u,d);return Vn(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},bu=t=>{for(var e=0;e<t.length-1;e++){var n=t[e],r=t[e+1];n instanceof tr&&r instanceof tr&&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},be=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=be([e],[],n);return o.height=Math.max(r||n.fontMetrics().defaultRuleThickness,n.minRuleThickness),o.style.borderBottomWidth=xe(o.height),o.maxFontSize=1,o},op=function(e,n,r,o){var l=new il(e,n,r,o);return qa(l),l},Ur=function(e){var n=new Uo(e);return qa(n),n},Ko=function(e,n){return e instanceof Uo?be([],[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}},Bt=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=be(["pstrut"],[]);d.style.height=xe(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||[],V=E.wrapperStyle||{},te=be(O,[d,M],void 0,V);te.style.top=xe(-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 D=be(["vlist"],f);D.style.height=xe(b);var F;if(p<0){var ie=be([],[]),Q=be(["vlist"],[ie]);Q.style.height=xe(-p);var re=be(["vlist-s"],[new tr("")]);F=[be(["vlist-r"],[D,re]),be(["vlist-r"],[Q])]}else F=[be(["vlist-r"],[D])];var _=be(["vlist-t"],F);return F.length===2&&_.classes.push("vlist-t2"),_.height=b,_.depth=-p,_},vu=(t,e)=>{var n=be(["mspace"],[],e),r=Jt(t,e);return n.style.marginRight=xe(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"}},ku={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},yu=function(e,n){var r=ku[e],o=r[0],l=r[1],a=r[2],s=new ro(o),c=new Fr([s],{width:xe(l),height:xe(a),style:"width:"+xe(l),viewBox:"0 0 "+1e3*l+" "+1e3*a,preserveAspectRatio:"xMinYMin"}),u=io(["katex-overlay"],[c],n);return u.height=a,u.style.height=xe(a),u.style.width=xe(l),u},en={number:3,unit:"mu"},Eo={number:4,unit:"mu"},qr={number:5,unit:"mu"},lp={mord:{mop:en,mbin:Eo,mrel:qr,minner:en},mop:{mord:en,mop:en,mrel:qr,minner:en},mbin:{mord:Eo,mop:Eo,mopen:Eo,minner:Eo},mrel:{mord:qr,mop:qr,mopen:qr,minner:qr},mopen:{},mclose:{mop:en,mbin:Eo,mrel:qr,minner:en},mpunct:{mord:en,mop:en,mrel:qr,mopen:en,mclose:en,mpunct:en,minner:en},minner:{mord:en,mop:en,mbin:Eo,mrel:qr,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}},wu={},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)wu[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},hn=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:et.DISPLAY,text:et.TEXT,script:et.SCRIPT,scriptscript:et.SCRIPTSCRIPT},dp={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},xn=function(e,n,r,o){o===void 0&&(o=[null,null]);for(var l=[],a=0;a<e.length;a++){var s=It(e[a],n);if(s instanceof Uo){var c=s.children;l.push(...c)}else l.push(s)}if(bu(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=be([o[0]||"leftmost"],[],n),p=be([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),V=Ya(g),te=O&&V?g.hasClass("mtight")?(E=ap[O])==null?void 0:E[V]:(M=lp[O])==null?void 0:M[V]:null;if(te)return vu(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=xu(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=be(["leftmost"])),r.insertAfter=(f=>p=>{e.splice(f+1,0,p),a++})(a)}o&&e.pop()},xu=function(e){return e instanceof Uo||e instanceof il||e instanceof qo&&e.hasClass("enclosing")?e:null},Ka=function(e,n){var r=xu(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 be(n.concat(r))},It=function(e,n,r){if(!e)return be();if(ki[e.type]){var o=ki[e.type](e,n);if(r&&n.size!==r.size){o=be(n.sizingClasses(r),[o],n);var l=n.sizeMultiplier/r.sizeMultiplier;o.height*=l,o.depth*=l}return o}else throw new ve("Got group of unknown type: '"+e.type+"'")};function fl(t,e){var n=be(["katex-base"],t,e),r=be(["katex-strut"]);return r.style.height=xe(n.height+n.depth),n.depth&&(r.style.verticalAlign=xe(-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=xn(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(xn(n,e,!0),e),u.classes=["katex-tag"],l.push(u)):o&&l.push(o);var d=be(["katex-html"],l);if(d.setAttribute("aria-hidden","true"),u){var f=u.children[0];f.style.height=xe(d.height+d.depth),d.depth&&(f.style.verticalAlign=xe(-d.depth))}return d}function Eu(t){return new Uo(t)}class ye{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 mn&&this.children[l+1]instanceof mn){for(var a=this.children[l].toText()+this.children[++l].toText();this.children[l+1]instanceof mn;)a+=this.children[++l].toText();e.appendChild(new mn(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+=On(o),e+='"'}this.classes.length>0&&(e+=' class ="'+On(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 mn{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return On(this.toText())}toText(){return this.text}}class Cu{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",xe(this.width)),e}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+xe(this.width)+'"/>'}toText(){return this.character?this.character:" "}}var fp=new Set(["\\imath","\\jmath"]),hp=new Set(["mrow","mtable"]),cr=function(e,n,r){var o,l;return Xt[n][e]&&Xt[n][e].replace&&e.charCodeAt(0)!==55349&&!(Object.prototype.hasOwnProperty.call(iu,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=Xt[n][e].replace),new mn(e)},Za=function(e){return e.length===1?e[0]:new ye("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(Xt[r][l]){var a=Xt[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 mn&&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 mn&&n.text===","}else return!1}var rr=function(e,n,r){if(e.length===1){var o=Vt(e[0],n);return r&&o instanceof ye&&o.type==="mo"&&(o.setAttribute("lspace","0em"),o.setAttribute("rspace","0em")),[o]}for(var l=[],a,s=0;s<e.length;s++){var c=Vt(e[s],n);if(c instanceof ye&&a instanceof ye){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 ye&&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 mn&&d.text==="̸"&&(c.type==="mo"||c.type==="mi"||c.type==="mn")){var f=c.children[0];f instanceof mn&&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(rr(e,n,r))},Vt=function(e,n){if(!e)return new ye("mrow");if(yi[e.type])return yi[e.type](e,n);throw new ve("Got group of unknown type: '"+e.type+"'")};function Su(t,e,n,r,o){var l=rr(t,n),a;l.length===1&&l[0]instanceof ye&&hp.has(l[0].type)?a=l[0]:a=new ye("mrow",l);var s=new ye("annotation",[new mn(e)]);s.setAttribute("encoding","application/x-tex");var c=new ye("semantics",[a,s]),u=new ye("math",[c]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&u.setAttribute("display","block");var d=o?"katex":"katex-mathml";return be([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]],Tu=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Mu=function(e,n){return n.size<2?e:pp[e-1][n.size-1]};class Gr{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||Gr.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=Tu[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 Gr(n)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:Mu(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:Tu[e-1]})}havingBaseStyle(e){e=e||this.style.text();var n=Mu(Gr.BASESIZE,e);return this.size===n&&this.textSize===Gr.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!==Gr.BASESIZE?["katex-sizing","reset-size"+this.size,"size"+Gr.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=Q4(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Gr.BASESIZE=6;var Au=function(e){return new Gr({style:e.displayMode?et.DISPLAY:et.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},Nu=function(e,n){if(n.displayMode){var r=["katex-display"];n.leqno&&r.push("leqno"),n.fleqn&&r.push("fleqn"),e=be(r,[e])}return e},gp=function(e,n,r){var o=Au(r),l;if(r.output==="mathml")return Su(e,n,o,r.displayMode,!0);if(r.output==="html"){var a=Xa(e,o);l=be(["katex"],[a])}else{var s=Su(e,n,o,r.displayMode,!1),c=Xa(e,o);l=be(["katex"],[s,c])}return Nu(l,r)},bp=function(e,n,r){var o=Au(r),l=Xa(e,o),a=be(["katex"],[l]);return Nu(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 ye("mo",[new mn(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 Fr([k],{width:"100%",height:xe(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 V=O[0],te=O[1],D=O[2],F=D/1e3,ie=V.length,Q,re;if(ie===1){if(O.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+u+'".');Q=["hide-tail"],re=[O[3]]}else if(ie===2)Q=["halfarrow-left","halfarrow-right"],re=["xMinYMin","xMaxYMin"];else if(ie===3)Q=["brace-left","brace-center","brace-right"],re=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
|
|
270
|
-
`+ie+" children.");for(var _=0;_<ie;_++){var H=new ro(V[_]),$=new Fr([H],{width:"400em",height:xe(F),viewBox:"0 0 "+c+" "+D,preserveAspectRatio:re[_]+" slice"}),K=io([Q[_]],[$],n);if(ie===1)return{span:K,minWidth:te,height:F};K.style.height=xe(F),M.push(K)}return{span:be(["katex-stretchy"],M,n),minWidth:te,height:F}}}var o=r(),l=o.span,a=o.minWidth,s=o.height;return l.height=s,l.style.height=xe(s),a>0&&(l.style.minWidth=xe(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=be(["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 Fr(u,{width:"100%",height:xe(s)});a=io([],[d],l)}return a.height=s,a.style.height=xe(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 ut(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 ve(e,t);return r}var Bu=t=>{if(t instanceof tr)return t;if(Z4(t)&&t.children.length===1)return Bu(t.children[0])},Iu=(t,e)=>{var n,r,o;t&&t.type==="supsub"?(r=ut(t.base,"accent"),n=r.base,t.base=n,o=X4(It(t,e)),t.base=r):(r=ut(t,"accent"),n=r.base);var l=It(n,e.havingCrampedStyle()),a=r.isShifty&&Pr(n),s=0;if(a){var c,u;s=(c=(u=Bu(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=Bt({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"elem",elem:p,wrapperClasses:["svg-align"],wrapperStyle:s>0?{width:"calc(100% - "+xe(2*s)+")",marginLeft:xe(2*s)}:void 0}]});else{var b,g;r.label==="\\vec"?(b=yu("vec",e),g=ku.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=be(["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=xe(E),r.label==="\\textcircled"&&(p.style.top=".2em"),p=Bt({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:-f},{type:"elem",elem:p}]})}var M=be(["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 ye("mo",[cr(t.label,t.mode)]),r=new ye("mover",[Vt(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:Iu,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=It(t.base,e),r=ml(t,e),o=t.label==="\\utilde"?.12:0,l=Bt({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:o},{type:"elem",elem:n}]});return be(["mord","accentunder"],[l],e)},mathmlBuilder:(t,e)=>{var n=hl(t.label),r=new ye("munder",[Vt(t.base,e),n]);return r.setAttribute("accentunder","true"),r}});var bl=t=>{var e=new ye("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(It(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(It(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=Bt({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=Bt({positionType:"individualShift",children:[{type:"elem",elem:o,shift:u},{type:"elem",elem:s,shift:c,wrapperClasses:["svg-align"]}]});return be(["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(Vt(t.body,e));if(t.below){var l=bl(Vt(t.below,e));r=new ye("munderover",[n,l,o])}else r=new ye("mover",[n,o])}else if(t.below){var a=bl(Vt(t.below,e));r=new ye("munder",[n,a])}else r=bl(),r=new ye("mover",[n,r]);return r}});function Np(t,e){var n=xn(t.body,e,!0);return be([t.mclass],n,e)}function Bp(t,e){var n,r=rr(t.body,e);return t.mclass==="minner"?n=new ye("mpadded",r):t.mclass==="mord"?t.isCharacterBox?(n=r[0],n.type="mi"):n=new ye("mi",r):(t.isCharacterBox?(n=r[0],n.type="mo"):n=new ye("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:hn(o),isCharacterBox:Pr(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:hn(e[1]),isCharacterBox:Pr(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:hn(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:Pr(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:hn(e[0])}},htmlBuilder(t,e){var n=xn(t.body,e,!0),r=be([t.mclass],n,e);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(t,e){var n=rr(t.body,e),r=new ye("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"},_u=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),Ru=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 ve("Expected \\\\ or \\cr or \\end",t.nextToken)}for(var r=[],o=[r],l=0;l<e.length;l++){for(var a=e[l],s=_u(),c=0;c<a.length;c++)if(!Ru(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(Ru(a[b]))throw new ve("Missing a "+u+" character to complete a CD arrow.",a[b]);d[f].body.push(a[b])}if(p)throw new ve("Missing a "+u+" character to complete a CD arrow.",a[c])}else throw new ve('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=_u()}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(It(t.label,n,e),e);return r.classes.push("cd-label-"+t.side),r.style.bottom=xe(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(t,e){var n=new ye("mrow",[Vt(t.label,e)]);return n=new ye("mpadded",[n]),n.setAttribute("width","0"),t.side==="left"&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),n=new ye("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(It(t.fragment,e),e);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder(t,e){return new ye("mrow",[Vt(t.fragment,e)])}}),Ie({type:"textord",names:["\\@char"],numArgs:1,allowedInText:!0,handler(t,e){var n=t.parser,r=ut(e[0],"ordgroup"),o=Ja(r,"\\@char has non-numeric argument"),l=parseInt(o),a;if(isNaN(l))throw new ve("\\@char has non-numeric argument "+o);if(l<0||l>=1114111)throw new ve("\\@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=xn(t.body,e.withColor(t.color),!1);return Ur(n)},Dp=(t,e)=>{var n=rr(t.body,e.withColor(t.color)),r=new ye("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=ut(e[0],"color-token").color,o=e[1];return{type:"color",mode:n.mode,color:r,body:hn(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=ut(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&&ut(o,"size").value}},htmlBuilder(t,e){var n=be(["mspace"],[],e);return t.newLine&&(n.classes.push("katex-newline"),t.size&&(n.style.marginTop=xe(Jt(t.size,e)))),n},mathmlBuilder(t,e){var n=new ye("mspace");return t.newLine&&(n.setAttribute("linebreak","newline"),t.size&&n.setAttribute("height",xe(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"},Lu=t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new ve("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},Ou=(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]),ut(e.parseFunction(),"internal");throw new ve("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 ve("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 ve('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==l+1)throw new ve('Argument number "'+r.text+'" out of order');l++,s.push([])}else{if(r.text==="EOF")throw new ve("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=Lu(e.gullet.popToken());e.gullet.consumeSpaces();var o=zp(e);return Ou(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=Lu(e.gullet.popToken()),o=e.gullet.popToken(),l=e.gullet.popToken();return Ou(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=Xt.math[e]&&Xt.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=be(o.concat(l.sizingClasses(r)),[e],r),s=l.sizeMultiplier/r.sizeMultiplier;return a.height*=s,a.depth*=s,a.maxFontSize=l.sizeMultiplier,a},Du=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=xe(l),e.height-=l,e.depth+=l},Hp=function(e,n,r,o,l,a){var s=Vn(e,"Main-Regular",l,o),c=ts(s,n,o,a);return Du(c,o,n),c},Pp=function(e,n,r,o){return Vn(e,"Size"+n+"-Regular",r,o)},zu=function(e,n,r,o,l,a){var s=Pp(e,n,l,o),c=ts(be(["delimsizing","size"+n],[s],o),et.TEXT,o,a);return r&&Du(c,o,et.TEXT),c},ns=function(e,n,r){var o;n==="Size1-Regular"?o="delim-size1":o="delim-size4";var l=be(["delimsizinginner",o],[be([],[Vn(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 Fr([l],{width:xe(o),height:xe(n),style:"width:"+xe(o),viewBox:"0 0 "+1e3*o+" "+Math.round(1e3*n),preserveAspectRatio:"xMinYMin"}),s=io([],[a],r);return s.height=n,s.style.height=xe(n),s.style.width=xe(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"]),Hu=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),V=O.height+O.depth,te=0,D=1;if(c!==null){var F=Ei(c,b,l);te=F.height+F.depth,D=2}var ie=k+V+te,Q=Math.max(0,Math.ceil((n-ie)/(D*M))),re=ie+Q*D*M,_=o.fontMetrics().axisHeight;r&&(_*=o.sizeMultiplier);var H=re/2-_,$=[];if(f.length>0){var K=re-k-V,Y=Math.round(re*1e3),N=V4(f,Math.round(K*1e3)),A=new ro(f,N),j=xe(p/1e3),U=xe(Y/1e3),P=new Fr([A],{width:j,height:U,viewBox:"0 0 "+p+" "+Y}),ge=io([],[P],o);ge.height=Y/1e3,ge.style.width=j,ge.style.height=U,$.push({type:"elem",elem:ge})}else{if($.push(ns(d,b,l)),$.push(kl),c===null){var Ee=re-k-V+2*os;$.push(rs(u,Ee,o))}else{var Me=(re-k-V-te)/2+2*os;$.push(rs(u,Me,o)),$.push(kl),$.push(ns(c,b,l)),$.push(kl),$.push(rs(u,Me,o))}$.push(kl),$.push(ns(s,b,l))}var ae=o.havingBaseStyle(et.TEXT),Ce=Bt({positionType:"bottom",positionData:H,children:$});return ts(be(["delimsizing","mult"],[Ce],ae),et.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 Fr([s],{width:"400em",height:xe(n),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return io(["hide-tail"],[c],l)},Vp=function(e,n){var r=n.havingBaseSizing(),o=Uu("\\surd",e*r.sizeMultiplier,Vu,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=xe(c),{span:s,advanceWidth:f,ruleWidth:(n.fontMetrics().sqrtRuleThickness+a)*l}},Pu=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","⎰","⎱"]),$u=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),Ci=[0,1.2,1.8,2.4,3],Fu=function(e,n,r,o,l){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),Pu.has(e)||$u.has(e))return zu(e,n,!1,r,o,l);if(Up.has(e))return Hu(e,Ci[n],!1,r,o,l);throw new ve("Illegal delimiter: '"+e+"'")},qp=[{type:"small",style:et.SCRIPTSCRIPT},{type:"small",style:et.SCRIPT},{type:"small",style:et.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Gp=[{type:"small",style:et.SCRIPTSCRIPT},{type:"small",style:et.SCRIPT},{type:"small",style:et.TEXT},{type:"stack"}],Vu=[{type:"small",style:et.SCRIPTSCRIPT},{type:"small",style:et.SCRIPT},{type:"small",style:et.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.")},Uu=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;$u.has(e)?s=qp:Pu.has(e)?s=Vu:s=Gp;var c=Uu(e,n,s,o);return c.type==="small"?Hp(e,c.style,r,o,l,a):c.type==="large"?zu(e,c.size,r,o,l,a):Hu(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)},qu={"\\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 Gu(t){return"isMiddle"in t}function yl(t,e){var n=gl(t);if(n&&Kp.has(n.text))return n;throw n?new ve("Invalid delimiter '"+n.text+"' after '"+e.funcName+"'",t):new ve("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:qu[t.funcName].size,mclass:qu[t.funcName].mclass,delim:n.text}},htmlBuilder:(t,e)=>t.delim==="."?be([t.mclass]):Fu(t.delim,t.size,e,t.mode,[t.mclass]),mathmlBuilder:t=>{var e=[];t.delim!=="."&&e.push(cr(t.delim,t.mode));var n=new ye("mo",e);t.mclass==="mopen"||t.mclass==="mclose"?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=xe(Ci[t.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}});function Wu(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 ve("\\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=ut(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:o,left:n.text,right:l.delim,rightColor:l.color}},htmlBuilder:(t,e)=>{Wu(t);for(var n=xn(t.body,e,!0,["mopen","mclose"]),r=0,o=0,l=!1,a=0;a<n.length;a++){var s=n[a];Gu(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(Gu(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),be(["minner"],n,e)},mathmlBuilder:(t,e)=>{Wu(t);var n=rr(t.body,e);if(t.left!=="."){var r=new ye("mo",[cr(t.left,t.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if(t.right!=="."){var o=new ye("mo",[cr(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 ve("\\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=Fu(t.delim,1,e,t.mode,[]),n.isMiddle={delim:t.delim,options:e}),n},mathmlBuilder:(t,e)=>{var n=t.delim==="\\vert"||t.delim==="|"?cr("|","text"):cr(t.delim,t.mode),r=new ye("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(It(t.body,e),e),r=t.label.slice(1),o=e.sizeMultiplier,l,a,s=Pr(t.body);if(r==="sout")l=be(["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=xe(f/2+c);var p=Math.floor(1e3*f*o),b=H4(p),g=new Fr([new ro("phase",b)],{width:"400em",height:xe(p/1e3),viewBox:"0 0 400000 "+p,preserveAspectRatio:"xMinYMin slice"});l=io(["hide-tail"],[g],e),l.style.height=xe(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=xe(M)):r==="angl"&&M!==.049&&(l.style.borderTopWidth=xe(M),l.style.borderRightWidth=xe(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=Bt({positionType:"individualShift",children:[{type:"elem",elem:l,shift:a},{type:"elem",elem:n,shift:0}]});else{var V=/cancel|phase/.test(r)?["svg-align"]:[];O=Bt({positionType:"individualShift",children:[{type:"elem",elem:n,shift:0},{type:"elem",elem:l,shift:a,wrapperClasses:V}]})}return/cancel/.test(r)&&(O.height=n.height,O.depth=n.depth),/cancel/.test(r)&&!s?be(["mord","cancel-lap"],[O],e):be(["mord"],[O],e)},Xp=(t,e)=>{var n,r=new ye(t.label.includes("colorbox")?"mpadded":"menclose",[Vt(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: "+xe(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=ut(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=ut(e[0],"color-token").color,a=ut(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 Ku={};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)Ku[n[c]]=s;l&&(ki[e]=l),a&&(yi[e]=a)}var Yu={};function y(t,e){Yu[t]=e}class Zn{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 Zn(e.loc.lexer,e.loc.start,n.loc.end):e&&e.loc}}class or{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 or(n,Zn.range(this,e))}}function Xu(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 ve("{"+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 ve("Invalid \\arraystretch: "+b)}t.gullet.beginGroup();var g=[],k=[g],E=[],M=[],O=c!=null?[]:void 0;function V(){c&&t.gullet.macros.set("\\@eqnsw","1",!0)}function te(){O&&(t.gullet.macros.get("\\df@tag")?(O.push(t.subparse([new or("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):O.push(!!c&&t.gullet.macros.get("\\@eqnsw")==="1"))}for(V(),M.push(Xu(t));;){var D=t.parseExpression(!1,u?"\\end":"\\\\");t.gullet.endGroup(),t.gullet.beginGroup();var F={type:"ordgroup",mode:t.mode,body:D};n&&(F={type:"styling",mode:t.mode,style:n,resetFont:!0,body:[F]}),g.push(F);var ie=t.fetch().text;if(ie==="&"){if(f&&g.length===f){if(u||s)throw new ve("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&&F.type==="styling"&&F.body.length===1&&F.body[0].type==="ordgroup"&&F.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(Xu(t)),g=[],k.push(g),V()}else throw new ve("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(et.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,V=0;function te(ne){for(var Te=0;Te<ne.length;++Te)Te>0&&(V+=.25),u.push({pos:V,isDashed:ne[Te]})}for(te(a[0]),r=0;r<e.body.length;++r){var D=e.body[r],F=M,ie=O;s<D.length&&(s=D.length);var Q={cells:new Array(D.length),height:0,depth:0,pos:0};for(o=0;o<D.length;++o){var re=It(D[o],n);ie<re.depth&&(ie=re.depth),F<re.height&&(F=re.height),Q.cells[o]=re}var _=e.rowGaps[r],H=0;_&&(H=Jt(_,n),H>0&&(H+=O,ie<H&&(ie=H),H=0)),e.addJot&&r<e.body.length-1&&(ie+=k),Q.height=F,Q.depth=ie,V+=F,Q.pos=V,V+=ie+H,c[r]=Q,te(a[r+1])}var $=V/2+n.fontMetrics().axisHeight,K=e.cols||[],Y=[],N,A,j=[];if(e.tags&&e.tags.some(ne=>ne))for(r=0;r<l;++r){var U=c[r],P=U.pos-$,ge=e.tags[r],Ee=void 0;ge===!0?Ee=be(["eqn-num"],[],n):ge===!1?Ee=be([],[],n):Ee=be([],xn(ge,n,!0),n),Ee.depth=U.depth,Ee.height=U.height,j.push({type:"elem",elem:Ee,shift:P})}for(o=0,A=0;o<s||A<K.length;++o,++A){for(var Me,ae=K[A],Ce=!0;(($e=ae)==null?void 0:$e.type)==="separator";){var $e;if(Ce||(N=be(["arraycolsep"],[]),N.style.width=xe(n.fontMetrics().doubleRuleSep),Y.push(N)),ae.separator==="|"||ae.separator===":"){var we=ae.separator==="|"?"solid":"dashed",tt=be(["vertical-separator"],[],n);tt.style.height=xe(V),tt.style.borderRightWidth=xe(d),tt.style.borderRightStyle=we,tt.style.margin="0 "+xe(-d/2);var qt=V-$;qt&&(tt.style.verticalAlign=xe(-qt)),Y.push(tt)}else throw new ve("Invalid separator type: "+ae.separator);A++,ae=K[A],Ce=!1}if(!(o>=s)){var rn=void 0;if(o>0||e.hskipBeforeAndAfter){var pn,Gt;rn=(pn=(Gt=ae)==null?void 0:Gt.pregap)!=null?pn:p,rn!==0&&(N=be(["arraycolsep"],[]),N.style.width=xe(rn),Y.push(N))}var dt=[];for(r=0;r<l;++r){var jt=c[r],on=jt.cells[o];if(on){var ft=jt.pos-$;on.depth=jt.depth,on.height=jt.height,dt.push({type:"elem",elem:on,shift:ft})}}var Ge=Bt({positionType:"individualShift",children:dt}),St=be(["col-align-"+(((Me=ae)==null?void 0:Me.align)||"c")],[Ge]);if(Y.push(St),o<s-1||e.hskipBeforeAndAfter){var He,Pt;rn=(He=(Pt=ae)==null?void 0:Pt.postgap)!=null?He:p,rn!==0&&(N=be(["arraycolsep"],[]),N.style.width=xe(rn),Y.push(N))}}}var Fe=be(["mtable"],Y);if(u.length>0){for(var Ke=Wo("katex-hline",n,d),Qt=Wo("katex-hdashline",n,d),gt=[{type:"elem",elem:Fe,shift:0}];u.length>0;){var Tt=u.pop(),Ct=Tt.pos-$;Tt.isDashed?gt.push({type:"elem",elem:Qt,shift:Ct}):gt.push({type:"elem",elem:Ke,shift:Ct})}Fe=Bt({positionType:"individualShift",children:gt})}if(j.length===0)return be(["mord"],[Fe],n);var z=Bt({positionType:"individualShift",children:j}),I=be(["katex-tag"],[z],n);return Ur([Fe,I])},jp={c:"center ",l:"left ",r:"right "},Tr=function(e,n){for(var r=[],o=new ye("mtd",[],["mtr-glue"]),l=new ye("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 ye("mtd",[Vt(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 ye("mtr",c))}var d=new ye("mtable",r),f=e.arraystretch===.5?.1:.16+e.arraystretch-1+(e.addJot?.09:0);d.setAttribute("rowspacing",xe(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 V=M;V<O;V++){var te=g[V];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 D=e.cols||[],F="",ie=1;ie<D.length;ie++)F+=ie%2?"0em ":"1em ";d.setAttribute("columnspacing",F.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="",re=e.hLinesBeforeRow;p+=re[0].length>0?"left ":"",p+=re[re.length-1].length>0?"right ":"";for(var _=1;_<re.length-1;_++)Q+=re[_].length===0?"none ":re[_][0]?"dashed ":"solid ";return/[sd]/.test(Q)&&d.setAttribute("rowlines",Q.trim()),p!==""&&(d=new ye("menclose",[d]),d.setAttribute("notation",p.trim())),e.arraystretch&&e.arraystretch<1&&(d=new ye("mstyle",[d]),d.setAttribute("scriptlevel","1")),d},Zu=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 ve(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=ut(k[E],"styling"),O=ut(M.body[0],"ordgroup");O.body.unshift(c)}if(f)s<k.length&&(s=k.length);else{var V=k.length/2;if(a<V)throw new ve("Too many math in a row: "+("expected "+a+", but got "+V),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]]:ut(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 ve("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 ve("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]]:ut(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 ve("Unknown column alignment: "+u,s)});if(o.length>1)throw new ve("{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 ve("{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:Zu,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:Zu,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 ve(t.funcName+" valid only within array environment")}});var ju=Ku;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 ve("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(ju,l))throw new ve("No such environment: "+l,o);var a=ju[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=ut(n.parseFunction(),"environment");if(b.name!==l)throw new ve("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 It(t.body,r)},Jp=(t,e)=>{var n=t.font,r=e.withFont(n);return Vt(t.body,r)},Qu={"\\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 Qu?Qu[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:Pr(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=It(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=It(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===et.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 V=-(O-.5*f);E=Bt({positionType:"individualShift",children:[{type:"elem",elem:u,shift:k},{type:"elem",elem:d,shift:V},{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=Bt({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===et.DISPLAY.size?te=e.fontMetrics().delim1:n.size===et.SCRIPTSCRIPT.size?te=e.havingStyle(et.SCRIPT).fontMetrics().delim2:te=e.fontMetrics().delim2;var D,F;return t.leftDelim==null?D=xi(e,["mopen"]):D=ss(t.leftDelim,te,!0,e.havingStyle(n),t.mode,["mopen"]),t.continued?F=be([]):t.rightDelim==null?F=xi(e,["mclose"]):F=ss(t.rightDelim,te,!0,e.havingStyle(n),t.mode,["mclose"]),be(["mord"].concat(l.sizingClasses(e)),[D,be(["mfrac"],[E]),F],e)},t7=(t,e)=>{var n=new ye("mfrac",[Vt(t.numer,e),Vt(t.denom,e)]);if(!t.hasBarLine)n.setAttribute("linethickness","0px");else if(t.barSize){var r=Jt(t.barSize,e);n.setAttribute("linethickness",xe(r))}if(t.leftDelim!=null||t.rightDelim!=null){var o=[];if(t.leftDelim!=null){var l=new ye("mo",[new mn(t.leftDelim.replace("\\",""))]);l.setAttribute("fence","true"),o.push(l)}if(o.push(n),t.rightDelim!=null){var a=new ye("mo",[new mn(t.rightDelim.replace("\\",""))]);a.setAttribute("fence","true"),o.push(a)}return Za(o)}return n},Ju=(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"),Ju({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 ed=["display","text","script","scriptscript"],td=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"?td(l.text):null,s=wi(e[1]),c=s.type==="atom"&&s.family==="close"?td(s.text):null,u=ut(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=ut(b.body[0],"textord");p=ed[Number(g.text)]}}else b=ut(b,"textord"),p=ed[Number(b.text)];return Ju({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:ut(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=ut(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 nd=(t,e)=>{var n=e.style,r,o;t.type==="supsub"?(r=t.sup?It(t.sup,e.havingStyle(n.sup()),e):It(t.sub,e.havingStyle(n.sub()),e),o=ut(t.base,"horizBrace")):o=ut(t,"horizBrace");var l=It(o.base,e.havingBaseStyle(et.DISPLAY)),a=ml(o,e),s;if(o.isOver?s=Bt({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.1},{type:"elem",elem:a,wrapperClasses:["svg-align"]}]}):s=Bt({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=be(["minner",o.isOver?"mover":"munder"],[s],e);o.isOver?s=Bt({positionType:"firstBaseline",children:[{type:"elem",elem:c},{type:"kern",size:.2},{type:"elem",elem:r}]}):s=Bt({positionType:"bottom",positionData:c.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:c}]})}return be(["minner",o.isOver?"mover":"munder"],[s],e)},n7=(t,e)=>{var n=hl(t.label);return new ye(t.isOver?"mover":"munder",[Vt(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:nd,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=ut(e[0],"url").url;return n.settings.isTrusted({command:"\\href",url:o})?{type:"href",mode:n.mode,href:o,body:hn(r)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(t,e)=>{var n=xn(t.body,e,!1);return op(t.href,[],n,e)},mathmlBuilder:(t,e)=>{var n=lo(t.body,e);return n instanceof ye||(n=new ye("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=ut(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:hn(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:hn(e[0])}},htmlBuilder(t,e){var n=xn(t.body,e.withFont(""),!1);return Ur(n)},mathmlBuilder(t,e){return new ye("mrow",rr(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=ut(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 ve("\\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:hn(l)}:n.formatUnsupportedCmd(r)},htmlBuilder:(t,e)=>{var n=xn(t.body,e,!1),r=["enclosing"];t.attributes.class&&r.push(...t.attributes.class.trim().split(/\s+/));var o=be(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:hn(e[0]),mathml:hn(e[1])}},htmlBuilder:(t,e)=>{var n=xn(t.html,e,!1);return Ur(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 ve("Invalid size: '"+e+"' in \\includegraphics");var r={number:+(n[1]+n[2]),unit:n[3]};if(!eu(r))throw new ve("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=ut(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 ve("Invalid key: '"+f[0]+"' in \\includegraphics.")}}}var b=ut(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:xe(n+r)};o>0&&(l.width=xe(o)),r>0&&(l.verticalAlign=xe(-r));var a=new W4(t.src,t.alt,l);return a.height=n,a.depth=r,a},mathmlBuilder:(t,e)=>{var n=new ye("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",xe(-o))),n.setAttribute("height",xe(r+o)),t.width.number>0){var l=Jt(t.width,e);n.setAttribute("width",xe(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=ut(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 vu(t.dimension,e)},mathmlBuilder(t,e){var n=Jt(t.dimension,e);return new Cu(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=be([],[It(t.body,e)]),n=be(["katex-inner"],[n],e)):n=be(["katex-inner"],[It(t.body,e)]);var r=be(["katex-fix"],[]),o=be([t.alignment],[n,r],e),l=be(["katex-strut"]);return l.style.height=xe(o.height+o.depth),o.depth&&(l.style.verticalAlign=xe(-o.depth)),o.children.unshift(l),o=be(["katex-thinbox"],[o],e),be(["mord","katex-vbox"],[o],e)},mathmlBuilder:(t,e)=>{var n=new ye("mpadded",[Vt(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 ve("Mismatched "+t.funcName)}});var rd=(t,e)=>{switch(e.style.size){case et.DISPLAY.size:return t.display;case et.TEXT.size:return t.text;case et.SCRIPT.size:return t.script;case et.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:hn(e[0]),text:hn(e[1]),script:hn(e[2]),scriptscript:hn(e[3])}},htmlBuilder:(t,e)=>{var n=rd(t,e),r=xn(n,e,!1);return Ur(r)},mathmlBuilder:(t,e)=>{var n=rd(t,e);return lo(n,e)}});var od=(t,e,n,r,o,l,a)=>{t=be([],[t]);var s=n&&Pr(n),c,u;if(e){var d=It(e,r.havingStyle(o.sup()),r);u={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-d.depth)}}if(n){var f=It(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=Bt({positionType:"bottom",positionData:b,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:c.elem,marginLeft:xe(-l)},{type:"kern",size:c.kern},{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:xe(l)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else if(c){var g=t.height-a;p=Bt({positionType:"top",positionData:g,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:c.elem,marginLeft:xe(-l)},{type:"kern",size:c.kern},{type:"elem",elem:t}]})}else if(u){var k=t.depth+a;p=Bt({positionType:"bottom",positionData:k,children:[{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:xe(l)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else return t;var E=[p];if(c&&l!==0&&!s){var M=be(["mspace"],[],r);M.style.marginRight=xe(l),E.unshift(M)}return be(["mop","op-limits"],E,r)},id=new Set(["\\smallint"]),ld=(t,e)=>{var n,r,o=!1,l;t.type==="supsub"?(n=t.sup,r=t.sub,l=ut(t.base,"op"),o=!0):l=ut(t,"op");var a=e.style,s=!1;a.size===et.DISPLAY.size&&l.symbol&&!id.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=Vn(l.name,d,"math",e,["mop","op-symbol",s?"large-op":"small-op"]),u=c.italic,f.length>0){var p=yu(f+"Size"+(s?"2":"1"),e);c=Bt({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=xn(l.body,e,!0);b.length===1&&b[0]instanceof tr?(c=b[0],c.classes[0]="mop"):c=be(["mop"],b,e)}else{for(var g=[],k=1;k<l.name.length;k++)g.push(Ua(l.name[k],l.mode,e));c=be(["mop"],g,e)}var E=0,M=0;if((c instanceof tr||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?od(c,n,r,e,a,M,E):(E&&(c.style.position="relative",c.style.top=xe(E)),c)},r7=(t,e)=>{var n;if(t.symbol)n=new ye("mo",[cr(t.name,t.mode)]),id.has(t.name)&&n.setAttribute("largeop","false");else if(t.body)n=new ye("mo",rr(t.body,e));else{n=new ye("mi",[new mn(t.name.slice(1))]);var r=new ye("mo",[cr("","text")]);t.parentIsSupSub?n=new ye("mrow",[n,r]):n=Eu([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:ld,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:hn(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 ad=(t,e)=>{var n,r,o=!1,l;t.type==="supsub"?(n=t.sup,r=t.sub,l=ut(t.base,"operatorname"),o=!0):l=ut(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=xn(s,e.withFont("mathrm"),!0),u=0;u<c.length;u++){var d=c[u];d instanceof tr&&(d.text=d.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}a=be(["mop"],c,e)}else a=be(["mop"],[],e);return o?od(a,n,r,e,e.style,0,0):a},l7=(t,e)=>{for(var n=rr(t.body,e.withFont("mathrm")),r=!0,o=0;o<n.length;o++){var l=n[o];if(!(l instanceof Cu))if(l instanceof ye)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 mn?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 mn(s)]}var c=new ye("mi",n);c.setAttribute("mathvariant","normal");var u=new ye("mo",[cr("","text")]);return t.parentIsSupSub?new ye("mrow",[c,u]):Eu([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:hn(o),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:ad,mathmlBuilder:l7}),y("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),Co({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?Ur(xn(t.body,e,!1)):be(["mord"],xn(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=It(t.body,e.havingCrampedStyle()),r=Wo("overline-line",e),o=e.fontMetrics().defaultRuleThickness,l=Bt({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*o},{type:"elem",elem:r},{type:"kern",size:o}]});return be(["mord","katex-overline"],[l],e)},mathmlBuilder(t,e){var n=new ye("mo",[new mn("‾")]);n.setAttribute("stretchy","true");var r=new ye("mover",[Vt(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:hn(r)}},htmlBuilder:(t,e)=>{var n=xn(t.body,e.withPhantom(),!1);return Ur(n)},mathmlBuilder:(t,e)=>{var n=rr(t.body,e);return new ye("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=be(["katex-inner"],[It(t.body,e.withPhantom())]),r=be(["katex-fix"],[]);return be(["mord","rlap"],[n,r],e)},mathmlBuilder:(t,e)=>{var n=rr(hn(t.body),e),r=new ye("mphantom",n),o=new ye("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=ut(e[0],"size").value,o=e[1];return{type:"raisebox",mode:n.mode,dy:r,body:o}},htmlBuilder(t,e){var n=It(t.body,e),r=Jt(t.dy,e);return Bt({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]})},mathmlBuilder(t,e){var n=new ye("mpadded",[Vt(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=ut(e[0],"size"),a=ut(e[1],"size");return{type:"rule",mode:r.mode,shift:o&&ut(o,"size").value,width:l.value,height:a.value}},htmlBuilder(t,e){var n=be(["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=xe(r),n.style.borderTopWidth=xe(o),n.style.bottom=xe(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 ye("mspace");a.setAttribute("mathbackground",l),a.setAttribute("width",xe(n)),a.setAttribute("height",xe(r));var s=new ye("mpadded",[a]);return o>=0?s.setAttribute("height",xe(o)):(s.setAttribute("height",xe(o)),s.setAttribute("depth",xe(-o))),s.setAttribute("voffset",xe(o)),s}});function sd(t,e,n){for(var r=xn(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 Ur(r)}var cd=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],a7=(t,e)=>{var n=e.havingSize(t.size);return sd(t.body,n,e)};Ie({type:"sizing",names:cd,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:cd.indexOf(r)+1,body:l}},htmlBuilder:a7,mathmlBuilder:(t,e)=>{var n=e.havingSize(t.size),r=rr(t.body,n),o=new ye("mstyle",r);return o.setAttribute("mathsize",xe(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]&&ut(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=be([],[It(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 be(["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=Bt({positionType:"firstBaseline",children:[{type:"elem",elem:n}]});return be(["mord"],[o],e)},mathmlBuilder:(t,e)=>{var n=new ye("mpadded",[Vt(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=It(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<et.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=xe(f);var g=Bt({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(et.SCRIPTSCRIPT),E=It(t.index,k,e),M=.6*(g.height-g.depth),O=Bt({positionType:"shift",positionData:-M,children:[{type:"elem",elem:E}]}),V=be(["katex-root"],[O]);return be(["mord","sqrt"],[V,g],e)}else return be(["mord","sqrt"],[g],e)},mathmlBuilder(t,e){var n=t.body,r=t.index;return r?new ye("mroot",[Vt(n,e),Vt(r,e)]):new ye("msqrt",[Vt(n,e)])}});var hs={display:et.DISPLAY,text:et.TEXT,script:et.SCRIPT,scriptscript:et.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("")),sd(t.body,r,e)},mathmlBuilder(t,e){var n=hs[t.style],r=e.havingStyle(n);t.resetFont&&(r=r.withFont(""));var o=rr(t.body,r),l=new ye("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===et.DISPLAY.size||r.alwaysHandleSupSub);return o?ld:null}else if(r.type==="operatorname"){var l=r.alwaysHandleSupSub&&(n.style.size===et.DISPLAY.size||r.limits);return l?ad:null}else{if(r.type==="accent")return Pr(r.base)?Iu:null;if(r.type==="horizBrace"){var a=!e.sub;return a===r.isOver?nd: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=It(r,e),s,c,u=e.fontMetrics(),d=0,f=0,p=r&&Pr(r);if(o){var b=e.havingStyle(e.style.sup());s=It(o,b,e),p||(d=a.height-b.fontMetrics().supDrop*b.sizeMultiplier/e.sizeMultiplier)}if(l){var g=e.havingStyle(e.style.sub());c=It(l,g,e),p||(f=a.depth+g.fontMetrics().subDrop*g.sizeMultiplier/e.sizeMultiplier)}var k;e.style===et.DISPLAY?k=u.sup1:e.style.cramped?k=u.sup3:k=u.sup2;var E=e.sizeMultiplier,M=xe(.5/u.ptPerEm/E),O=null;if(c){var V=t.base&&t.base.type==="op"&&t.base.name&&(t.base.name==="\\oiint"||t.base.name==="\\oiiint");if(a instanceof tr||V){var te;O=xe(-((te=a.italic)!=null?te:0))}}var D;if(s&&c){d=Math.max(d,k,s.depth+.25*u.xHeight),f=Math.max(f,u.sub2);var F=u.defaultRuleThickness,ie=4*F;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 re=[{type:"elem",elem:c,shift:f,marginRight:M,marginLeft:O},{type:"elem",elem:s,shift:-d,marginRight:M}];D=Bt({positionType:"individualShift",children:re})}else if(c){f=Math.max(f,u.sub1,c.height-.8*u.xHeight);var _=[{type:"elem",elem:c,marginLeft:O,marginRight:M}];D=Bt({positionType:"shift",positionData:f,children:_})}else if(s)d=Math.max(d,k,s.depth+.25*u.xHeight),D=Bt({positionType:"shift",positionData:-d,children:[{type:"elem",elem:s,marginRight:M}]});else throw new Error("supsub must have either sup or sub.");var H=Ya(a,"right")||"mord";return be([H],[a,be(["msupsub"],[D])],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=[Vt(t.base,e)];t.sub&&l.push(Vt(t.sub,e)),t.sup&&l.push(Vt(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===et.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(e.style===et.DISPLAY||u.limits)?a="munderover":a="msubsup"}else{var c=t.base;c&&c.type==="op"&&c.limits&&(e.style===et.DISPLAY||c.alwaysHandleSupSub)||c&&c.type==="operatorname"&&c.alwaysHandleSupSub&&(c.limits||e.style===et.DISPLAY)?a="munder":a="msub"}else{var s=t.base;s&&s.type==="op"&&s.limits&&(e.style===et.DISPLAY||s.alwaysHandleSupSub)||s&&s.type==="operatorname"&&s.alwaysHandleSupSub&&(s.limits||e.style===et.DISPLAY)?a="mover":a="msup"}return new ye(a,l)}}),Co({type:"atom",htmlBuilder(t,e){return Ua(t.text,t.mode,e,["m"+t.family])},mathmlBuilder(t,e){var n=new ye("mo",[cr(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 ud={mi:"italic",mn:"normal",mtext:"normal"};Co({type:"mathord",htmlBuilder(t,e){return ul(t,e)},mathmlBuilder(t,e){var n=new ye("mi",[cr(t.text,t.mode,e)]),r=ja(t,e)||"italic";return r!==ud[n.type]&&n.setAttribute("mathvariant",r),n}}),Co({type:"textord",htmlBuilder(t,e){return ul(t,e)},mathmlBuilder(t,e){var n=cr(t.text,t.mode,e),r=ja(t,e)||"normal",o;return t.mode==="text"?o=new ye("mtext",[n]):/[0-9]/.test(t.text)?o=new ye("mn",[n]):t.text==="\\prime"?o=new ye("mo",[n]):o=new ye("mi",[n]),r!==ud[o.type]&&o.setAttribute("mathvariant",r),o}});var dd=new Map([["\\nobreak","nobreak"],["\\allowbreak","allowbreak"]]),fd=new Map([[" ",{}],["\\ ",{}],["~",{className:"nobreak"}],["\\space",{}],["\\nobreakspace",{className:"nobreak"}]]);Co({type:"spacing",htmlBuilder(t,e){var n=fd.get(t.text),r=dd.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 be(["mspace",o],[Ua(t.text,t.mode,e)],e)}else{if(r)return be(["mspace",r],[],e);throw new ve('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var n;if(fd.has(t.text))n=new ye("mtext",[new mn(" ")]);else{if(dd.has(t.text))return new ye("mspace");throw new ve('Unknown type of space "'+t.text+'"')}return n}});var hd=()=>{var t=new ye("mtd",[]);return t.setAttribute("width","50%"),t};Co({type:"tag",mathmlBuilder(t,e){var n=new ye("mtable",[new ye("mtr",[hd(),new ye("mtd",[lo(t.body,e)]),hd(),new ye("mtd",[lo(t.tag,e)])])]);return n.setAttribute("width","100%"),n}});var md={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},pd={"\\textbf":"textbf","\\textmd":"textmd"},u7={"\\textit":"textit","\\textup":"textup"},gd=(t,e)=>{var n=t.font;if(n){if(md[n])return e.withTextFontFamily(md[n]);if(pd[n])return e.withTextFontWeight(pd[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:hn(o),font:r}},htmlBuilder(t,e){var n=gd(t,e),r=xn(t.body,n,!0);return be(["mord","text"],r,n)},mathmlBuilder(t,e){var n=gd(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=It(t.body,e),r=Wo("underline-line",e),o=e.fontMetrics().defaultRuleThickness,l=Bt({positionType:"top",positionData:n.height,children:[{type:"kern",size:o},{type:"elem",elem:r},{type:"kern",size:3*o},{type:"elem",elem:n}]});return be(["mord","katex-underline"],[l],e)},mathmlBuilder(t,e){var n=new ye("mo",[new mn("‾")]);n.setAttribute("stretchy","true");var r=new ye("munder",[Vt(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=It(t.body,e),r=e.fontMetrics().axisHeight,o=.5*(n.height-r-(n.depth+r));return Bt({positionType:"shift",positionData:o,children:[{type:"elem",elem:n}]})},mathmlBuilder(t,e){var n=new ye("mpadded",[Vt(t.body,e)],["vcenter"]);return new ye("mrow",[n])}}),Ie({type:"verb",names:["\\verb"],numArgs:0,allowedInText:!0,handler(t,e,n){throw new ve("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(t,e){for(var n=bd(t),r=[],o=e.havingStyle(e.style.text()),l=0;l<n.length;l++){var a=n[l];a==="~"&&(a="\\textasciitilde"),r.push(Vn(a,"Typewriter-Regular",t.mode,o,["mord","texttt"]))}return be(["mord","text"].concat(o.sizingClasses(e)),bu(r),o)},mathmlBuilder(t,e){var n=new mn(bd(t)),r=new ye("mtext",[n]);return r.setAttribute("mathvariant","monospace"),r}});var bd=t=>t.body.replace(/ /g,t.star?"␣":" "),so=wu,vd=`[ \r
|
|
271
|
-
]`,d7="\\\\[a-zA-Z@]+",f7="\\\\[^\uD800-\uDFFF]",h7="("+d7+")"+
|
|
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
272
|
|[ \r ]+
|
|
273
|
-
?)[ \r ]*`,ms="[̀-ͯ]",p7=new RegExp(ms+"+$"),g7="("+
|
|
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 or(o,new Zn(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 ve("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=Yu;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 yd={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 ve("\\char` missing argument");r=e.text.charCodeAt(0)}else n=10;if(n){if(r=yd[e.text],r==null||r>=n)throw new ve("Invalid base-"+n+" digit "+e.text);for(var o;(o=yd[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 ve("\\newcommand's first argument must be a macro name");var l=o[0].text,a=t.isDefined(l);if(a&&!e)throw new ve("\\newcommand{"+l+"} attempting to redefine "+(l+"; use \\renewcommand"));if(!a&&!n)throw new ve("\\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 ve("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],Xt.math[n],Xt.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 wd={",":"\\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 wd?e=wd[n]:(n.slice(0,4)==="\\not"||n in Xt.math&&k7.has(Xt.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 ve("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 xd=xe(Er["Main-Regular"][84][1]-.7*Er["Main-Regular"][65][1]);y("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+xd+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}"),y("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+xd+"}{\\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 Ed=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",Ed(!1)),y("\\bra@set",Ed(!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 Cd={"^":!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 kd(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 or("EOF",r.loc)),this.pushTokens(o),new or("",Zn.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 ve("Extra }",l)}else if(l.text==="EOF")throw new ve("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 ve("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 ve("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 ve("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 ve("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 ve("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 ve("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 or(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 kd(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(Xt.math,e)||Object.prototype.hasOwnProperty.call(Xt.text,e)||Object.prototype.hasOwnProperty.call(Cd,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 Sd=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,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"}},Td={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};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 ve("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 or("}")),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 ve("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 ve("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 ve("Limit controls must follow a math operator",l);this.consume()}else if(l.text==="^"){if(r)throw new ve("Double superscript",l);r=this.handleSupSubscript("superscript")}else if(l.text==="_"){if(o)throw new ve("Double subscript",l);o=this.handleSupSubscript("subscript")}else if(l.text==="'"){if(r)throw new ve("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=Sd.test(l.text),u=[];for(u.push(new or(xl[l.text])),this.consume();;){var d=this.fetch().text;if(!xl[d]||Sd.test(d)!==c)break;u.unshift(new or(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 ve("Got function '"+o+"' with no arguments"+(n?" as "+n:""),r);if(this.mode==="text"&&!l.allowedInText)throw new ve("Can't use function '"+o+"' in text mode",r);if(this.mode==="math"&&l.allowedInMath===!1)throw new ve("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 ve("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 ve("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 ve("A primitive argument cannot be optional");var a=this.parseGroup(e);if(a==null)throw new ve("Expected group as "+e,this.fetch());return a}case"original":case void 0:return this.parseArgumentGroup(r);default:throw new ve("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 ve("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 ve("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 ve("Invalid size: '"+n.text+"'",n);var l={number:+(o[1]+o[2]),unit:o[3]};if(!eu(l))throw new ve("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:Zn.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(Cd,o)){if(this.settings.throwOnError)throw new ve("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:Zn.range(o,s),text:"---"}),n-=2):(e.splice(r,2,{type:"textord",mode:"text",loc:Zn.range(o,a),text:"--"}),n-=1)}(l==="'"||l==="`")&&a.text===l&&(e.splice(r,2,{type:"textord",mode:"text",loc:Zn.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 ve(`\\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(
|
|
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
276
|
${(n.length?n.split(`
|
|
277
277
|
`):[""]).join(`
|
|
278
278
|
`)}
|
|
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>',Bd='<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:Ln.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:_3},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=Xn(),r=Lr(),o=_n(),l=t.block.id,a=i.inject(zl,null);let s="__none__";function c(C){if(!C)return"null";const S=C.selectionRect,L=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??"",L,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 V(C){var G;const S=C.target;!!(S&&(S.nodeType===1?S.closest(".hover-toolbar"):(G=S.parentElement)!=null&&G.closest(".hover-toolbar")))&&(E=Date.now())}function te(){E=Date.now()}const D=i.ref(null);let F=0,ie=0;const Q=i.ref({kind:"none"}),re=i.ref(null);let _=!1;const H=i.ref(null);let $=null,K=null,Y=!1,N=!1;const A=i.reactive({blockType:"paragraph",blockAttrs:{align:"left"},marks:new Set,textColor:"",bgColor:"",verticalAlign:"middle",showDelete:!1,deleteLabel:"",deleteIcon:Bd,showMerge:!1,showSplit:!1,showHeaderRow:!1,headerRowActive:!1}),j=i.ref(null),U=i.reactive({visible:!1,selectionRect:null}),P=i.reactive({visible:!1,anchorRect:null,href:"",text:"",initialMode:"edit",showTextInput:!1});let ge=null,Ee=null,Me=!1;const ae=i.reactive({visible:!1,row:-1,col:-1,anchor:null,canContinue:!1,canStartNew:!1,currentNumber:1});function Ce(){ae.visible=!1,ae.anchor=null,ae.row=-1,ae.col=-1}const $e=i.reactive({visible:!1,row:-1,col:-1,anchor:null,initialValue:1});function we(){$e.visible=!1,$e.anchor=null,$e.row=-1,$e.col=-1}function tt(C,S,L){var Ae,_e;if(!r.value)return;const G=(Ae=f.value.cells[C])==null?void 0:Ae[S];if(!G||G.covered||G.cellType!=="orderedList")return;const ee=Kl(f.value,C,S),oe=typeof G.startNumber=="number";let fe=!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)){fe=st.cellType==="orderedList";break}}const pe=oe&&fe,Le=ee!==1;dt(),U.visible=!1,U.selectionRect=null,we(),ae.visible=!0,ae.row=C,ae.col=S,ae.anchor=L,ae.canContinue=pe,ae.canStartNew=Le,ae.currentNumber=ee}function qt(){var S,L;if(ae.row<0||ae.col<0)return;const C=di(f.value,ae.row,ae.col,{startNumber:null});(L=(S=n.commands).setAttrs)==null||L.call(S,{id:l,attrs:C}),Ce()}function rn(){var S,L;if(ae.row<0||ae.col<0)return;const C=di(f.value,ae.row,ae.col,{startNumber:1});(L=(S=n.commands).setAttrs)==null||L.call(S,{id:l,attrs:C}),Ce()}function pn(){if(ae.row<0||ae.col<0)return;const C=ae.anchor,S=ae.row,L=ae.col,G=ae.currentNumber;Ce(),C&&($e.visible=!0,$e.initialValue=G,$e.anchor=C,$e.row=S,$e.col=L)}function Gt(C){var L,G;if($e.row<0||$e.col<0){we();return}const S=di(f.value,$e.row,$e.col,{startNumber:C});(G=(L=n.commands).setAttrs)==null||G.call(L,{id:l,attrs:S}),we()}function dt(){if(!P.visible)return;if(P.visible=!1,ge=null,Ee=null,U.visible=!1,U.selectionRect=null,Me){Me=!1;return}const C=k.value;if(C){const S=p.get(`${C.row}-${C.col}`);S&&Te(C.row,C.col,S),k.value=null}}function jt(){const C=window.getSelection();if(!C||C.rangeCount===0)return null;const L=C.getRangeAt(0).commonAncestorContainer,G=L.nodeType===1?L:L.parentElement;return G?G.closest("a"):null}function on(){const C=window.getSelection();if(!C||C.rangeCount===0)return;const S=C.getRangeAt(0),L=S.getBoundingClientRect();if(L.width===0&&L.height===0)return;ge=S.cloneRange();const G=jt(),ee=(G==null?void 0:G.getAttribute("href"))??"",oe=C.toString();P.anchorRect=L,P.href=ee,P.text=oe,P.initialMode=ee?"view":"edit",P.showTextInput=!oe&&!ee,P.visible=!0,U.visible=!1}function ft(C){const S=C.getAttribute("href")||"",L=C.textContent||"",G=C.getBoundingClientRect();P.anchorRect=G,P.href=S,P.text=L,P.initialMode="view",P.showTextInput=!1,P.visible=!0,Me=!0,Ee=C,U.visible=!1,U.selectionRect=null}function Ge(C){const S=C.closest(".table-cell-inner");if(!S)return;const L=S.closest(".table-cell");if(!L)return;const G=Number(L.getAttribute("data-row")),ee=Number(L.getAttribute("data-col"));!Number.isFinite(G)||!Number.isFinite(ee)||Te(G,ee,S)}function St(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),Ge(Ee);return}const L=window.getSelection();if(!L)return;if(ge){const ee=k.value,oe=ee?p.get(`${ee.row}-${ee.col}`):null;oe&&oe.isConnected&&(L.removeAllRanges(),L.addRange(ge))}const G=jt();if(G)G.setAttribute("href",C),G.setAttribute("target","_blank"),G.setAttribute("rel","noopener noreferrer"),S!==void 0&&S!==G.textContent&&(G.textContent=S);else{if(L.rangeCount===0)return;const ee=L.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),L.removeAllRanges();const fe=document.createRange();fe.selectNodeContents(oe),L.addRange(fe),ge=fe.cloneRange()}catch{}}Pt()}function He(){if(Ee&&Ee.isConnected){const G=Ee,ee=G.parentElement;if(ee){for(;G.firstChild;)ee.insertBefore(G.firstChild,G);ee.removeChild(G)}Ge(G);return}const C=window.getSelection();if(!C)return;if(ge){const G=k.value,ee=G?p.get(`${G.row}-${G.col}`):null;ee&&ee.isConnected&&(C.removeAllRanges(),C.addRange(ge))}const S=jt();if(!S)return;const L=S.parentElement;if(L){for(;S.firstChild;)L.insertBefore(S.firstChild,S);L.removeChild(S);try{C.removeAllRanges(),ge&&ge.startContainer!==S&&C.addRange(ge)}catch{}Pt()}}function Pt(){const C=k.value;if(!C)return;const S=p.get(`${C.row}-${C.col}`);S&&Te(C.row,C.col,S)}let Fe=!1;function Ke(){var oe,fe;if(!r.value){U.visible=!1,U.selectionRect=null;return}if(U.visible&&O())return;if(!k.value){const pe=window.getSelection();if(!pe||pe.rangeCount===0||pe.isCollapsed){U.visible=!1,U.selectionRect=null;return}const Le=pe.getRangeAt(0);if(!((oe=Le.commonAncestorContainer.nodeType===1?Le.commonAncestorContainer:Le.commonAncestorContainer.parentElement)==null?void 0:oe.closest(".table-cell-inner"))){U.visible=!1,U.selectionRect=null;return}return}const S=window.getSelection();if(!S||S.rangeCount===0||S.isCollapsed){U.visible=!1,U.selectionRect=null;return}const L=S.getRangeAt(0);if(!((fe=L.commonAncestorContainer.nodeType===1?L.commonAncestorContainer:L.commonAncestorContainer.parentElement)==null?void 0:fe.closest(".table-cell-inner"))){U.visible=!1,U.selectionRect=null;return}const ee=L.getBoundingClientRect();if(ee.width===0&&ee.height===0){U.visible=!1,U.selectionRect=null;return}Fe||(U.visible=!0,U.selectionRect=ee,$&&(clearTimeout($),$=null),H.value=null)}function Qt(){Fe&&(Fe=!1,Ke())}function gt(C){const S=Rt.value;if(!S)return C;const L=S.getBoundingClientRect();return new DOMRect(L.left+C.left-S.scrollLeft,L.top+C.top,C.width,C.height)}function Tt(C){r.value&&($&&(clearTimeout($),$=null),K&&(clearTimeout(K),K=null),U.visible=!1,U.selectionRect=null,Y=!1,H.value=gt(C))}function Ct(C=150){K&&(clearTimeout(K),K=null),Y=!1,$=setTimeout(()=>{H.value=null,$=null},C)}function z(){const C=j.value;C&&C.focus()}function I(C){var L,G;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,Ct(0),(G=(L=n.commands).selectBlock)==null||G.call(L,{id:l}))}function ne(C,S){if(C.length!==S.length)return!1;for(let L=0;L<C.length;L++){const G=C[L],ee=S[L];if(G.type!==ee.type||"text"in G&&G.text!==ee.text)return!1;const oe=G.marks??[],fe=ee.marks??[];if(oe.length!==fe.length)return!1;for(let pe=0;pe<oe.length;pe++){const Le=oe[pe],Ae=fe[pe];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 Ot of st)if(_e[Ot]!==Ne[Ot])return!1}}return!0}function Te(C,S,L){var Le,Ae,_e;const G=Jn(L),ee=Hi(G),oe=f.value,fe=(Le=oe.cells[C])==null?void 0:Le[S];if(fe&&ne(fe.content,ee))return;const pe=ui(oe,C,S,ee);if((_e=(Ae=n.commands).setAttrs)==null||_e.call(Ae,{id:l,attrs:pe}),ee!==G){const Ne=Qr(ee);L.innerHTML!==Ne&&(L.innerHTML=Ne)}}function Ye(C,S,L,G){var oe,fe,pe;if(U.visible&&O())return;const ee=G==null?void 0:G.relatedTarget;if(!(ee!=null&&ee.closest(".link-popover"))&&!(ee!=null&&ee.closest(".hover-toolbar"))){if(U.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}}((fe=k.value)==null?void 0:fe.row)===C&&((pe=k.value)==null?void 0:pe.col)===S&&(k.value=null),U.visible=!1,U.selectionRect=null,dt(),Te(C,S,L)}}function lt(C){var G;if(U.visible&&O()){g.value&&(g.value=null),Q.value.kind!=="none"&&(Q.value={kind:"none"},Ct(0)),Ce(),we();return}const S=C.currentTarget,L=C.relatedTarget;if(!(L&&S.contains(L))&&!(L!=null&&L.closest(".link-popover"))&&!(L!=null&&L.closest(".hover-toolbar"))){if(U.visible){const ee=window.getSelection();if(ee&&ee.rangeCount>0&&!ee.isCollapsed){const oe=ee.getRangeAt(0);if((G=oe.commonAncestorContainer.nodeType===1?oe.commonAncestorContainer:oe.commonAncestorContainer.parentElement)==null?void 0:G.closest(".table-cell-inner")){g.value&&(g.value=null),Q.value.kind!=="none"&&(Q.value={kind:"none"},Ct(0)),Ce(),we();return}}}g.value&&(g.value=null),Q.value.kind!=="none"&&(Q.value={kind:"none"},Ct(0)),k.value&&(k.value=null),dt(),Ce(),we()}}function gn(C,S,L,G){var ee,oe,fe,pe,Le,Ae,_e,Ne,st,pt,Ot,vn,Tn;if(G.key==="Enter"&&!G.shiftKey&&!G.ctrlKey&&!G.metaKey){const dn=(ee=f.value.cells[C])==null?void 0:ee[S];if((dn==null?void 0:dn.cellType)==="codeBlock"){G.preventDefault(),G.stopPropagation();const rt=window.getSelection();let Ut=((oe=L.textContent)==null?void 0:oe.length)??0;if(rt&&rt.rangeCount>0){const ot=rt.getRangeAt(0);if(L.contains(ot.startContainer)){const Kt=document.createRange();Kt.selectNodeContents(L);try{Kt.setEnd(ot.startContainer,ot.startOffset),Ut=Kt.toString().length}catch{Ut=((fe=L.textContent)==null?void 0:fe.length)??0}}}if(rt&&rt.rangeCount>0){const ot=rt.getRangeAt(0);if(L.contains(ot.commonAncestorContainer)){ot.collapsed||ot.deleteContents();const Kt=document.createTextNode(`
|
|
280
|
-
`);ot.insertNode(Kt),ot.setStartAfter(Kt),ot.collapse(!0),rt.removeAllRanges(),rt.addRange(ot)}}Te(C,S,L);const Dn=Ut+1;i.nextTick(()=>{const ot=p.get(`${C}-${S}`);if(!ot)return;ot.focus();const Kt=window.getSelection();if(!Kt)return;const Bn=document.createRange();let zn=0,Mn=!1;const In=sn=>{var Kr;if(!Mn)if(sn.nodeType===Node.TEXT_NODE){const Nr=((Kr=sn.textContent)==null?void 0:Kr.length)??0;zn+Nr>=Dn&&(Bn.setStart(sn,Math.max(0,Dn-zn)),Bn.collapse(!0),Mn=!0),zn+=Nr}else for(const Nr of sn.childNodes)In(Nr)};In(ot),Mn||(Bn.selectNodeContents(ot),Bn.collapse(!1)),Kt.removeAllRanges(),Kt.addRange(Bn)});return}G.preventDefault(),G.stopPropagation(),Te(C,S,L),k.value=null,U.visible=!1,U.selectionRect=null,dt(),L.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}},z(),i.nextTick(()=>{const rt=Xe(C,S,C,S);rt&&Tt(rt)});return}if(G.key==="Tab"){G.preventDefault(),G.stopPropagation(),dt();const dn=L7(f.value,C,S,G.shiftKey);if(!dn){if(O7(f.value,C,S)&&!G.shiftKey){const Mn=Jn(L),In=f.value,sn=ui(In,C,S,Mn),Kr=E0(sn,sn.rows);(Le=(pe=n.commands).setAttrs)==null||Le.call(pe,{id:l,attrs:Kr}),i.nextTick(()=>{const Nr=`${Kr.rows-1}-0`,cn=p.get(Nr);cn==null||cn.focus(),ys(cn)});return}return}const{r:rt,c:Ut}=dn,Dn=Jn(L),ot=f.value,Kt=(Ae=ot.cells[C])==null?void 0:Ae[S];let Bn=ot;Kt&&(ne(Kt.content,Dn)||(Bn=ui(ot,C,S,Dn))),Bn!==ot&&((Ne=(_e=n.commands).setAttrs)==null||Ne.call(_e,{id:l,attrs:Bn})),i.nextTick(()=>{const zn=`${rt}-${Ut}`,Mn=p.get(zn);Mn==null||Mn.focus(),G.shiftKey?Id(Mn):ys(Mn)});return}if(G.key==="Backspace"){const dn=(st=f.value.cells[C])==null?void 0:st[S],rt=dn==null?void 0:dn.cellType;if(rt&&rt!=="paragraph"){const Ut=window.getSelection();let Dn=((pt=L.textContent)==null?void 0:pt.length)??0;if(Ut&&Ut.rangeCount>0){const ot=Ut.getRangeAt(0);if(L.contains(ot.startContainer)){const Kt=document.createRange();Kt.selectNodeContents(L);try{Kt.setEnd(ot.startContainer,ot.startOffset),Dn=Kt.toString().length}catch{Dn=((Ot=L.textContent)==null?void 0:Ot.length)??0}}}if(Dn===0&&(!L.textContent||L.textContent.trim()===""||(rt==="bulletList"||rt==="orderedList"||rt==="todoList"))){G.preventDefault(),G.stopPropagation(),dt(),Ce(),we();const Bn=Jn(L),zn=f.value,Mn=ui(zn,C,S,Bn),In=di(Mn,C,S,{cellType:"paragraph"});(Tn=(vn=n.commands).setAttrs)==null||Tn.call(vn,{id:l,attrs:In}),i.nextTick(()=>{const sn=p.get(`${C}-${S}`);sn&&(sn.focus(),Id(sn))});return}}}G.key==="Escape"&&(G.preventDefault(),G.stopPropagation(),Te(C,S,L),k.value=null,U.visible=!1,U.selectionRect=null,dt(),L.blur())}function bn(C,S,L){k.value={row:C,col:S},g.value&&(g.value=null),Q.value.kind!=="none"&&(Q.value={kind:"none"},Ct(0))}function ln(C){const S=C.target;if(!S)return null;const L=S.closest(".table-cell");if(!L)return null;const G=Number(L.getAttribute("data-row")??L.dataset.row),ee=Number(L.getAttribute("data-col")??L.dataset.col);return!Number.isFinite(G)||!Number.isFinite(ee)?null:{r:G,c:ee,el:L}}function ir(C){if(!r.value)return;const S=C.target;if(!S)return;const L=S.closest(".table-cell-inner");if(!L)return;const G=L.closest(".table-cell");if(!G)return;const ee=Number(G.getAttribute("data-row")),oe=Number(G.getAttribute("data-col"));!Number.isFinite(ee)||!Number.isFinite(oe)||gn(ee,oe,L,C)}function at(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 L=S.closest("a");if(L&&L.closest(".table-cell-inner")){C.preventDefault(),C.stopPropagation(),ft(L);return}P.visible&&dt();const G=ln(C);if(!G||C.button!==0)return;const ee=k.value;if(ee&&ee.row===G.r&&ee.col===G.c){Fe=!0,document.addEventListener("mouseup",Qt,{once:!0,capture:!0});return}C.preventDefault(),C.stopPropagation();const{r:oe,c:fe}=G,pe=document.activeElement;pe&&pe.closest(".table-cell-inner")&&pe.blur(),k.value=null,(_e=(Ae=n.commands).selectBlock)==null||_e.call(Ae,{id:l}),z(),N=H.value!==null,N&&(Y=!0,$&&(clearTimeout($),$=null),K&&(clearTimeout(K),K=null)),Q.value={kind:"none"},_=!0;const Le={row:oe,col:fe};re.value={start:Le,current:Le},g.value={anchor:Le,focus:Le},document.addEventListener("mouseup",Un,!0)}function An(C){if(!_||!re.value)return;const S=ln(C);if(!S)return;const{r:L,c:G}=S,ee=re.value.current;if(L===ee.row&&G===ee.col)return;re.value={...re.value,current:{row:L,col:G}};const oe=re.value.start;g.value={anchor:oe,focus:{row:L,col:G}}}function Sn(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 L=ln(C);if(!L)return;const{r:G,c:ee}=L,oe=k.value;oe&&oe.row===G&&oe.col===ee||(C.preventDefault(),C.stopPropagation(),K&&(clearTimeout(K),K=null),Y=!1,_=!1,re.value=null,g.value=null,Q.value={kind:"none"},Ct(0),document.removeEventListener("mouseup",Un,!0),k.value={row:G,col:ee},i.nextTick(()=>{const fe=`${G}-${ee}`,pe=p.get(fe);pe&&(pe.focus(),ys(pe))}))}function Un(C){if(_&&re.value){const S=re.value.start,L=re.value.current,G=Math.min(S.row,L.row),ee=Math.min(S.col,L.col),oe=Math.max(S.row,L.row),fe=Math.max(S.col,L.col),pe=Dr(f.value,G,ee,oe,fe),{r1:Le,c1:Ae,r2:_e,c2:Ne}=pe;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&&Tt(pt)});else if(N){const pt=Xe(Le,Ae,_e,Ne);pt&&Tt(pt)}else K&&clearTimeout(K),K=setTimeout(()=>{K=null;const pt=Xe(Le,Ae,_e,Ne);pt&&Tt(pt)},250)}_=!1,re.value=null,document.removeEventListener("mouseup",Un,!0)}function ht(C){if(Q.value.kind==="row"&&Q.value.row===C){Q.value={kind:"none"},g.value=null,Ct(0);return}H.value!==null&&(Y=!0);const S=f.value,L=S.cols,G=C,ee=0,oe=C,fe=Math.max(0,L-1),pe=L>0?Dr(S,G,ee,oe,fe):{r1:G,c1:ee,r2:oe,c2:fe};Q.value={kind:"row",row:C},g.value=L>0?{anchor:{row:pe.r1,col:pe.c1},focus:{row:pe.r2,col:pe.c2}}:null,k.value=null;const Le=document.activeElement;Le&&Le.closest(".table-cell-inner")&&Le.blur(),z(),i.nextTick(()=>{const Ae=Lt.value,_e=Ae.rowTops[pe.r1]??0,Ne=Ae.rowTops[pe.r2]??0,st=Ae.rowHeights[pe.r2]??32,pt=Ne+st-_e,Ot=Ae.colWidths.length>0?Ae.colWidths.reduce((dn,rt)=>dn+rt,0):S.colWidths.reduce((dn,rt)=>dn+rt,0),vn=Ae.colLefts[0]??0,Tn=new DOMRect(vn,_e,Ot,pt);Tt(Tn)})}function wt(C){if(Q.value.kind==="col"&&Q.value.col===C){Q.value={kind:"none"},g.value=null,Ct(0);return}H.value!==null&&(Y=!0);const S=f.value,L=S.rows,G=0,ee=C,oe=Math.max(0,L-1),fe=C,pe=L>0?Dr(S,G,ee,oe,fe):{r1:G,c1:ee,r2:oe,c2:fe};Q.value={kind:"col",col:C},g.value=L>0?{anchor:{row:pe.r1,col:pe.c1},focus:{row:pe.r2,col:pe.c2}}:null,k.value=null;const Le=document.activeElement;Le&&Le.closest(".table-cell-inner")&&Le.blur(),z(),i.nextTick(()=>{const Ae=Lt.value,_e=Ae.colLefts[pe.c1]??0,Ne=Ae.colLefts[pe.c2]??0,st=Ae.colWidths[pe.c2]??80,pt=Ne+st-_e,Ot=Ae.rowTops[0]??0,vn=L>0?(Ae.rowTops[L-1]??0)+(Ae.rowHeights[L-1]??32)-Ot:32,Tn=new DOMRect(_e,Ot,pt,vn);Tt(Tn)})}function We(){if(Q.value.kind==="all"){Q.value={kind:"none"},g.value=null,Ct(0);return}H.value!==null&&(Y=!0);const C=f.value;if(C.rows===0||C.cols===0)return;Q.value={kind:"all"};const S=Dr(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 L=document.activeElement;L&&L.closest(".table-cell-inner")&&L.blur(),z(),i.nextTick(()=>{const G=Lt.value,ee=G.rowTops[0]??0,oe=G.colLefts[0]??0,fe=G.colWidths.length>0?G.colWidths.reduce((_e,Ne)=>_e+Ne,0):C.colWidths.reduce((_e,Ne)=>_e+Ne,0),pe=G.rowTops[C.rows-1]??0,Le=G.rowHeights[C.rows-1]??32,Ae=new DOMRect(oe,ee,fe,pe+Le-ee);Tt(Ae)})}function Xe(C,S,L,G){const ee=Lt.value,oe=ee.rowTops[C]??0,fe=ee.rowTops[L]??0,pe=ee.rowHeights[L]??32,Le=fe+pe,Ae=ee.colLefts[S]??0,_e=ee.colLefts[G]??0,Ne=ee.colWidths[G]??80,st=_e+Ne;return new DOMRect(Ae,oe,st-Ae,Le-oe)}i.onBeforeUnmount(()=>{document.removeEventListener("mouseup",Un,!0),document.removeEventListener("mouseup",Qt,!0),document.removeEventListener("mousemove",ur,!0),document.removeEventListener("mouseup",qn,!0),document.removeEventListener("keydown",mt,!0),document.removeEventListener("selectionchange",Ke),document.removeEventListener("mousedown",an,!0),window.removeEventListener("scroll",Mt,!0),document.removeEventListener("touchmove",Mt,!0),document.removeEventListener("mousedown",V,!0),document.removeEventListener("mouseup",te,!0),K&&(clearTimeout(K),K=null)});function mt(C){var ee,oe;if(!r.value)return;const S=Q.value;if(S.kind==="none")return;const L=document.activeElement;if(L!=null&&L.closest(".table-cell-inner"))return;if(C.key==="Escape"){C.preventDefault(),C.stopPropagation(),Q.value={kind:"none"},g.value=null,Ct(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:fe,c1:pe,r2:Le,c2:Ae}=S.rect,_e=[];let Ne=f.value;for(let st=fe;st<=Le;st++)for(let pt=pe;pt<=Ae;pt++)Ne=ui(Ne,st,pt,_e);(oe=(ee=n.commands).setAttrs)==null||oe.call(ee,{id:l,attrs:Ne})}}}function an(C){if(!P.visible&&!ae.visible&&!$e.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)||(P.visible&&dt(),ae.visible&&Ce(),$e.visible&&we())}function Mt(){if(P.visible&&dt(),ae.visible&&Ce(),$e.visible&&we(),H.value!==null&&g.value){const C=Ti(g.value);if(C){const S=Dr(f.value,C.r1,C.c1,C.r2,C.c2),L=Xe(S.r1,S.c1,S.r2,S.c2);L&&(H.value=gt(L))}}}i.onMounted(()=>{document.addEventListener("keydown",mt,!0),document.addEventListener("selectionchange",Ke),document.addEventListener("mousedown",an,!0),document.addEventListener("mousedown",V,!0),document.addEventListener("mouseup",te,!0),window.addEventListener("scroll",Mt,!0),document.addEventListener("touchmove",Mt,{passive:!0,capture:!0})});const Rt=i.ref(null),Lt=i.ref({rowTops:[],rowHeights:[],colLefts:[],colWidths:[],wrapperOffsetLeft:0,wrapperOffsetTop:0,tableTotalWidth:0,tableTotalHeight:0});function Nn(){const C=b.value,S=Rt.value,L=j.value;if(!C||!S||!L)return;const G=f.value.rows,ee=f.value.cols,oe=S.getBoundingClientRect(),fe=L.getBoundingClientRect(),pe=Math.round(oe.left-fe.left),Le=Math.round(oe.top-fe.top),Ae=Array.from(C.querySelectorAll("tr")),_e=[],Ne=[];for(const rt of Ae){const Ut=rt.getBoundingClientRect();_e.push(Math.round(Ut.top-oe.top)),Ne.push(Math.round(Ut.height))}for(;_e.length<G;){const rt=_e.length>0?_e[_e.length-1]+Ne[Ne.length-1]:0;_e.push(rt),Ne.push(Ne.length>0?Ne[Ne.length-1]:32)}const st=S.scrollLeft,pt=[],Ot=[],vn=Array.from(C.querySelectorAll("colgroup > col"));if(vn.length>0)for(const rt of vn){const Ut=rt.getBoundingClientRect();pt.push(Math.round(Ut.left-oe.left+st)),Ot.push(Math.round(Ut.width))}for(;pt.length<ee;){const rt=pt.length>0?pt[pt.length-1]+Ot[Ot.length-1]:0;pt.push(rt),Ot.push(Ot.length>0?Ot[Ot.length-1]:80)}const Tn=Ot.reduce((rt,Ut)=>rt+Ut,0),dn=Ne.reduce((rt,Ut)=>rt+Ut,0);Lt.value={rowTops:_e,rowHeights:Ne,colLefts:pt,colWidths:Ot,wrapperOffsetLeft:pe,wrapperOffsetTop:Le,tableTotalWidth:Tn,tableTotalHeight:dn},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(()=>{D.value===null&&Nn()})});let En=null;i.onMounted(()=>{var S;En=new ResizeObserver(()=>{D.value===null&&(Nn(),x())}),Rt.value&&En.observe(Rt.value),b.value&&En.observe(b.value);const C=(S=j.value)==null?void 0:S.closest(".block-editor");C&&En.observe(C),Rt.value&&Rt.value.addEventListener("scroll",Z,{passive:!0}),x()}),i.onBeforeUnmount(()=>{var C;En==null||En.disconnect(),Rt.value&&Rt.value.removeEventListener("scroll",Z),Gn&&cancelAnimationFrame(Gn),q&&clearTimeout(q),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(),D.value=C,ie=Lt.value.colWidths[C]??80,F=S.clientX,document.addEventListener("mousemove",ur,!0),document.addEventListener("mouseup",qn,!0),document.body.style.cursor="col-resize",document.body.style.userSelect="none"}function ur(C){var oe,fe;if(D.value===null)return;const S=C.clientX-F;let L=Math.max(40,Math.round(ie+S));const G=Rt.value;if(G){const pe=G.clientWidth-4,Le=f.value.colWidths.reduce((_e,Ne,st)=>st===D.value?_e:_e+Ne,0);if(Le+L<=pe){const _e=Math.max(40,pe-Le);L=Math.min(L,_e)}}const ee=T0(f.value,D.value,L);(fe=(oe=n.commands).setAttrs)==null||fe.call(oe,{id:l,attrs:ee})}function qn(){D.value=null,document.removeEventListener("mousemove",ur,!0),document.removeEventListener("mouseup",qn,!0),document.body.style.cursor="",document.body.style.userSelect="",i.nextTick(()=>{Nn(),x()})}const lr=i.ref(0),Mr=i.ref(0),jn=i.ref(0),Ar=i.ref(!1);let Gn=0,q;function x(){const C=Rt.value;C&&(lr.value=C.scrollLeft,Mr.value=C.clientWidth,jn.value=C.scrollWidth)}function Z(){Ar.value||(Ar.value=!0),Gn&&cancelAnimationFrame(Gn),Gn=requestAnimationFrame(()=>{Gn=0,x()}),q&&clearTimeout(q),q=setTimeout(()=>{Ar.value=!1,x()},130)}const Se=i.computed(()=>{if(!r.value)return[];const C=Lt.value,S=f.value.cols,L=C.colLefts,G=C.colWidths;if(S===0||L.length<S||G.length<S)return[];const ee=lr.value,oe=Mr.value,fe=jn.value;if(oe<=0)return[];const pe=ee<=0,Le=ee+oe>=fe-1,Ae=fe<=oe+1,_e=6,Ne=[];for(let st=0;st<=S;st++){const Ot=(st===0?L[0]??0:st===S?(L[S-1]??0)+(G[S-1]??0):L[st]??0)-ee;let vn=Ot>=-1&&Ot<=oe+1;if(st===0&&(pe||Ae)&&(vn=!0),st===S&&(Le||Ae)&&(vn=!0),!vn)continue;const Tn=Math.max(_e,Math.min(Ot,oe-_e))+(st>0?2:-2);Ne.push({c:st,left:Tn})}return Ne});function ze(C,S){var G,ee;const L={id:l,...S};(ee=(G=n.commands)[C])==null||ee.call(G,L)}function Ze(){k.value=null,g.value=null,Q.value.kind!=="none"&&(Q.value={kind:"none"}),Ct(0),Ce(),we()}return e({clearInnerFocus:Ze}),()=>{var fr,hr,uo,Ni,Xo,Dd,zd,Hd,Pd,$d,Fd;const C=f.value,S=C.rows,L=C.cols,G=Ti(g.value),ee=G?Dr(C,G.r1,G.c1,G.r2,G.c2):null,oe=Lt.value,fe=Q.value,pe=[],Le=i.h("div",{class:"table-toolbar"},[i.h("div",{class:"table-toolbar-title"},[i.h(Rn,{html:Cl,class:"table-toolbar-icon"}),i.h("span",o.t("table.title"))])]),Ae=[];for(let le=0;le<L;le++){const De=C.colWidths[le]??0,Pe={};De&&De>0&&(Pe.width=`${De}px`),Ae.push(i.h("col",{"data-col":le,style:Pe}))}const _e=i.h("colgroup",{},Ae),Ne=[],st=[],pt=C.headerRow?0:-1;for(let le=0;le<S;le++){const De=[];for(let Pe=0;Pe<L;Pe++){const Re=(fr=C.cells[le])==null?void 0:fr[Pe];if(!Re||Re.covered)continue;const vt=`${le}-${Pe}`,vr=pt===0&&le===0,Zo=!!ee&&D7(le,Pe,ee),jo=fe.kind==="row"&&fe.row===le,Qo=fe.kind==="col"&&fe.col===Pe,Bi=fe.kind==="all",o5=Zo||jo||Qo||Bi;let Ms=Qr(Re.content);Re.cellType==="codeBlock"&&Ms.endsWith(`
|
|
281
|
-
`)&&(Ms+="<br>");const So=["table-cell"];vr&&So.push("table-cell-header"),Zo&&So.push("table-cell-selected"),(jo||Qo||Bi)&&So.push("table-cell-selected"),typeof Re.align=="string"&&Re.align!=="left"&&So.push(`be-align-${Re.align}`),typeof Re.bgColor=="string"&&Re.bgColor!=="default"&&So.push(`be-bg-${Re.bgColor}`);const
|
|
282
|
-
`);Pe&&((vt=navigator.clipboard)==null||vt.writeText(Pe))},Nt={visible:!!Mn,selectionRect:Mn,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:Yr,onTableHeaderRow:Ss,onClose:Yo,onTableType:bt,onTableAlign:it,onTableVerticalAlign:At,onTableMark:Ue,onTableTextColor:tn,onTableBgColor:_t,onTableCopy:Dt};a&&(Nt.visible?d(Nt):((zd=a.value)==null?void 0:zd.blockId)===l&&!((Hd=a.value)!=null&&Hd.cellEditMode)&&d(null));const yt=k.value,$t=yt?(Pd=f.value.cells[yt.row])==null?void 0:Pd[yt.col]:void 0,zt=$t==null?void 0:$t.cellType;let kn="paragraph";const nt={};zt==="heading"||zt==="heading1"?(kn="heading",nt.level=1):zt==="heading2"?(kn="heading",nt.level=2):zt==="heading3"?(kn="heading",nt.level=3):zt==="heading4"?(kn="heading",nt.level=4):zt==="heading5"?(kn="heading",nt.level=5):zt==="heading6"?(kn="heading",nt.level=6):zt==="bulletList"?kn="bulletList":zt==="orderedList"?kn="orderedList":zt==="todoList"?kn="todoList":zt==="quote"?kn="quote":zt==="codeBlock"&&(kn="codeBlock"),typeof($t==null?void 0:$t.align)=="string"&&(nt.align=$t.align),typeof($t==null?void 0:$t.verticalAlign)=="string"&&(nt.verticalAlign=$t.verticalAlign);const Wt={visible:U.visible&&!!U.selectionRect,selectionRect:U.selectionRect,blockId:l,blockType:kn,blockAttrs:nt,rootEl:document.querySelector(".block-editor"),cellEditMode:!0,onClose:()=>{U.visible=!1,U.selectionRect=null},onTableType:le=>{var Pe,Re;if(!yt)return;const De=po(f.value,[{row:yt.row,col:yt.col}],{cellType:le});(Re=(Pe=n.commands).setAttrs)==null||Re.call(Pe,{id:l,attrs:De})},onTableAlign:le=>{var Pe,Re;if(!yt)return;const De=po(f.value,[{row:yt.row,col:yt.col}],{align:le});(Re=(Pe=n.commands).setAttrs)==null||Re.call(Pe,{id:l,attrs:De})},onTableVerticalAlign:le=>{var Pe,Re;if(!yt)return;const De=po(f.value,[{row:yt.row,col:yt.col}],{verticalAlign:le});(Re=(Pe=n.commands).setAttrs)==null||Re.call(Pe,{id:l,attrs:De})},onLinkClick:()=>{on()}};return a&&(Wt.visible?d(Wt):(($d=a.value)==null?void 0:$d.blockId)===l&&((Fd=a.value)!=null&&Fd.cellEditMode)&&d(null)),pe.push(i.h(oc,{visible:P.visible,anchorRect:P.anchorRect,blockId:null,from:0,to:0,href:P.href,text:P.text,initialMode:P.initialMode,showTextInput:P.showTextInput,readonly:!r.value,onSaveLink:(le,De)=>{St(le,De),P.href=le,De!==void 0&&(P.text=De)},onRemoveLinkMark:()=>{He()},onClose:()=>{dt()}})),pe.push(i.h(tc,{visible:ae.visible,blockId:null,anchor:ae.anchor,rootEl:document.querySelector(".block-editor"),canContinue:ae.canContinue,canStartNew:ae.canStartNew,currentNumber:ae.currentNumber,onContinue:qt,onStartNew:rn,onModify:pn,onClose:Ce})),pe.push(i.h(nc,{visible:$e.visible,initialValue:$e.initialValue,anchor:$e.anchor,rootEl:document.querySelector(".block-editor"),onConfirm:Gt,onClose:we})),i.h("div",{class:["block-table-container","block-focus-root",...er(t.block.attrs)],ref:j,tabindex:"-1",onClick:I,onMousedown:at,onMouseover:An,onDblclick:Sn,onFocusout:lt,onKeydown:ir},pe)}}});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 Id(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 Wr(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 Wr(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 Wr(e,t.id,n,a=>x3(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 Wr(e,t.id,n,a=>E3(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 Wr(e,t.id,n,a=>C3(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:Wr(e,t.id,n,A3)}}}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=Dr(o,l,a,s,c);return u.r1===u.r2&&u.c1===u.c2?!1:Wr(e,t.id,n,d=>T3(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:Wr(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=Dr(o,t.r1,t.c1,t.r2,t.c2);return x0(o,l.r1,l.c1,l.r2,l.c2)?Wr(e,t.id,n,a=>M3(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:Wr(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=y3(l,a),u={rows:l,cols:a,cells:zr(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 D=e.selection,F=D.kind==="caret"?D.blockId:D.kind==="text"?D.focus.blockId:D.blockIds[0]??null;F&&(p=F)}if(p&&(e.doc.blocks.get(p)?(d=un(e.doc,p),f=Yn(e.doc,p)):p=null),!p)if(t.after){if(!e.doc.blocks.get(t.after))return!1;d=un(e.doc,t.after),f=Yn(e.doc,t.after)+1}else{const D=e.selection,F=D.kind==="caret"?D.blockId:D.kind==="text"?D.focus.blockId:D.blockIds[0]??null;F&&(d=un(e.doc,F),f=Yn(e.doc,F)+1)}const b=kt();p&&b.removeBlock(p);const g=d===null?0:_r(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),V=Rr(M.doc,E),te=O??V;return te?b.setSelection(Et(te.id,0)):b.setSelection(Et(E,0)),n==null||n(b.build()),!0}}}const _d={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 B3(e)},toMarkdown:t=>{if(t.type!=="table")return"";const e=ci(t.attrs);return N3(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",...er(t.block.attrs)],"data-block-divider":!0})}}),Rd={name:"divider",schema:{type:"divider",content:"none",nestable:!1,inlineMarks:!1,attrs:{indent:Ln.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:Sf,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=Ve(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=Xn(),n=_n(),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:Et(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",...er(t.block.attrs)]},u)}}}),Ld={name:"tableOfContents",schema:{type:"tableOfContents",content:"none",nestable:!1,inlineMarks:!1,attrs:{indent:Ln.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:Tf,command:"convertBlock",category:"basic",args:()=>({id:"__currentBlock__",type:"tableOfContents"})}],serialize:{toHTML:()=>"",toMarkdown:()=>""}},Od=[lc,ac,ym,gm,xm,Cm,h4,jc,Nd,_d,Rd,Ld,sc,cc],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:()=>Od},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);ef(c,u),i.watch([a,s],([w,T])=>{c.value=w,u.value=T});const d=_n(),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 V=i.ref(null);i.provide(f0,M),i.provide(zl,V);const te=i.computed(()=>r.toolbarPosition==="top"?"top":r.toolbarPosition==="bottom"||M.value?"bottom":"top"),D=i.computed(()=>r.toolbarPosition==="float"&&!M.value),F=i.computed(()=>{const w=V.value;return w&&w.visible?w:{visible:P.visible,selectionRect:P.selectionRect,blockId:P.blockId,blockType:P.blockType,blockAttrs:P.blockAttrs,rootEl:at.value??null,onClose:()=>{P.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||(P.visible=!1,P.selectionRect=null,P.blockId=null,P.blockType=null,P.blockAttrs={},gr(),br(),Yr(),tt(),Ne(),pe(),Pt(null,{clearNativeSelection:!0}),(X=(T=g.commands).clearSelection)==null||X.call(T))}),Y3((w,T,X,J)=>{const{onProgress:se,onSuccess:ue,onError:he}=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||he(ce instanceof Error?ce.message:String(ce))}):X3(T,se).then(ce=>ue({url:ce.url,width:ce.width,height:ce.height}),ce=>he(ce instanceof Error?ce.message:String(ce)))});const ie=i.ref(0),Q=F3(()=>{ie.value++}),re=async(w,T={})=>{var ce,Be,Je,je,xt,ct,bt,it,At,Ue,tn,_t,Dt,Nt,yt,$t,zt,kn;const{relativeToBlockId:X=null,position:J="after",convertIfEmpty:se=!0}=T;ie.value;let ue=null,he=X??null;if(!he){const nt=g.getState().selection;nt.kind==="caret"?he=nt.blockId:nt.kind==="text"&&(he=nt.anchor.blockId)}if(he||(he=_.value.doc.root[0]??null),J==="replace"&&he){const nt=g.registries.schema.get("image");nt&&((Be=(ce=g.commands).replaceBlock)==null||Be.call(ce,{id:he,type:"image",attrs:Zr(nt)}),ue=he)}if(!ue&&he&&se&&J!=="before"){const Wt=g.getState().doc.blocks.get(he);if(Wt&&Wt.type==="paragraph"&&Ve(Wt.content).length===0){const fr=g.registries.schema.get("image");fr&&((je=(Je=g.commands).replaceBlock)==null||je.call(Je,{id:he,type:"image",attrs:Zr(fr)}),ue=he)}}if(!ue&&he&&J==="before"){const nt=g.registries.schema.get("image");if(nt){(ct=(xt=g.commands).insertBlock)==null||ct.call(xt,{before:he,type:"image",attrs:Zr(nt)});const Wt=g.getState().selection;Wt.kind==="caret"?ue=Wt.blockId:Wt.kind==="text"&&(ue=Wt.anchor.blockId)}}if(!ue&&he){const nt=g.registries.schema.get("image");if(nt){(it=(bt=g.commands).insertBlock)==null||it.call(bt,{after:he,type:"image",attrs:Zr(nt)});const Wt=g.getState().selection;Wt.kind==="caret"?ue=Wt.blockId:Wt.kind==="text"&&(ue=Wt.anchor.blockId)}}if(!ue){const nt=g.registries.schema.get("image");if(!nt)return null;const Wt=g.getState().doc,fr=Wt.root[Wt.root.length-1]??null;fr?(Ue=(At=g.commands).insertBlock)==null||Ue.call(At,{after:fr,type:"image",attrs:Zr(nt)}):(_t=(tn=g.commands).insertBlock)==null||_t.call(tn,{after:null,type:"image",attrs:Zr(nt)});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 nt=w;try{const Wt=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=nt,setTimeout(Xo,4e3)}),fr={src:nt,width:Wt.width,height:Wt.height};(Nt=(Dt=g.commands).setAttrs)==null||Nt.call(Dt,{id:ue,attrs:fr})}catch{($t=(yt=g.commands).setAttrs)==null||$t.call(yt,{id:ue,attrs:{src:nt}})}return ue}const de=await Z3(ue,w);if(de.ok){const nt=de.value,Wt={src:nt.url,alt:nt.alt,title:nt.title,width:nt.width,height:nt.height,fileId:nt.fileId};(kn=(zt=g.commands).setAttrs)==null||kn.call(zt,{id:ue,attrs:Wt})}return ue};i.provide(m0,re);const _=i.shallowRef(g.getState());let H=g.getState().selection,$=!1,K=!1;const Y=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}),N=i.reactive({visible:!1,anchorEl:null,blockId:"",query:"",mode:"slash"}),A=i.ref(null),j=i.reactive({visible:!1,anchorEl:null,blockId:null}),U=i.ref(null),P=i.reactive({visible:!1,selectionRect:null,blockId:null,blockType:null,blockAttrs:{}});let ge=!1,Ee=null;function Me(){ge=!0,Ee&&clearTimeout(Ee),Ee=setTimeout(()=>{ge=!1,Ee=null,vn({force:!0})},500)}const ae=i.reactive({visible:!1,blockId:null,anchor:null,canContinue:!1,canStartNew:!1,currentNumber:1}),Ce=i.reactive({visible:!1,initialValue:1,anchor:null,blockId:null}),$e=i.reactive({visible:!1,initialValue:"plain",anchor:null,blockId:null}),we=i.reactive({visible:!1,anchorRect:null,blockId:null,from:0,to:0,href:"",text:"",initialMode:"view",showTextInput:!1});function tt(){we.visible=!1}i.watch(()=>we.visible,w=>{w&&(P.visible=!1)});function qt(w,T){var se,ue;const X=g.getState().doc.blocks.get(w);if(!X)return null;let J=0;for(const he of X.content){if(he.type!=="text")continue;const de=J,ce=J+he.text.length;if(T>=de&&T<=ce){const Be=(se=he.marks)==null?void 0:se.find(Je=>Je.type==="link");if(Be&&typeof((ue=Be.attrs)==null?void 0:ue.href)=="string")return{from:de,to:ce,href:Be.attrs.href,text:he.text};if(T<ce)return null}J=ce}return null}function rn(w,T,X){var Je,je,xt;const J=g.getState().doc.blocks.get(w);if(!J)return;let se="",ue="",he=0;for(const ct of J.content){if(ct.type!=="text")continue;const bt=he,it=he+ct.text.length;if(it>T&&bt<X){const At=(Je=ct.marks)==null?void 0:Je.find(Ue=>Ue.type==="link");if(At&&typeof((je=At.attrs)==null?void 0:je.href)=="string"){se=At.attrs.href,ue=ct.text;break}}he=it}let de=null;const ce=(xt=at.value)==null?void 0:xt.querySelector(`[data-block-id="${w}"]`);if(ce){const ct=window.getSelection();if(ct&&ct.rangeCount>0){const bt=ct.getRangeAt(0);ce.contains(bt.commonAncestorContainer)&&(de=bt.getBoundingClientRect())}de||(de=ce.getBoundingClientRect())}const Be=T<X;Ne(),pe(),gr(),br(),Yr(),we.blockId=w,we.from=T,we.to=X,we.href=se,we.text=ue,we.anchorRect=de,we.initialMode=se||!k.value?"view":"edit",we.showTextInput=!Be&&!se,we.visible=!0}function pn(){var T;if(!k.value)return;Un();const w=g.getState().selection;if(w.kind==="caret"){const X=qt(w.blockId,w.offset);if(X){we.blockId=w.blockId,we.from=X.from,we.to=X.to,we.href=X.href,we.text=X.text;const J=(T=at.value)==null?void 0:T.querySelector(`[data-block-id="${w.blockId}"]`),se=J==null?void 0:J.querySelector("a");we.anchorRect=(se==null?void 0:se.getBoundingClientRect())??(J==null?void 0:J.getBoundingClientRect())??null,we.initialMode="view",we.showTextInput=!1,we.visible=!0}}else w.kind==="text"&&!yn(w)&&rn(w.focus.blockId,w.anchor.offset,w.focus.offset)}function Gt(w,T,X){rn(w,T,X)}function dt(w,T){var ue;const X=qt(w,T);if(!X)return;const J=(ue=at.value)==null?void 0:ue.querySelector(`[data-block-id="${w}"]`),se=J==null?void 0:J.querySelector("a");we.blockId=w,we.from=X.from,we.to=X.to,we.href=X.href,we.text=X.text,we.anchorRect=(se==null?void 0:se.getBoundingClientRect())??(J==null?void 0:J.getBoundingClientRect())??null,we.initialMode="view",we.showTextInput=!1,we.visible=!0}function jt(w){Pt(w)}const on=i.ref(null),ft=i.ref(null),Ge=i.ref(null);let St=!1,He=!1;function Pt(w,T={}){const{clearNativeSelection:X=!1}=T;if(X)try{const J=window.getSelection();J&&J.removeAllRanges()}catch{}ft.value=w}let Fe=null,Ke=0,Qt=null;const gt=i.ref([]);function Tt(w){on.value=w}function Ct(){const w=at.value;if(!w){gt.value=[];return}const T=g.getState().selection;if(T.kind!=="text"||!yn(T)){gt.value=[];return}gt.value=$l(w,g.getState().doc,T)}function z(w){w.preventDefault()}function I(w){var he,de;const T=at.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",z,!0);const ce=window.getSelection();ce&&ce.removeAllRanges()}return}if(!Fe.crossBlock){Fe.crossBlock=!0,document.addEventListener("selectstart",z,!0);const ce=window.getSelection();ce&&ce.removeAllRanges()}const se={blockId:X.blockId,offset:X.offset},ue=_l(J,se);$=!0,(de=(he=g.commands).setSelection)==null||de.call(he,{selection:ue}),$=!1,Ct()}function ne(w){Fe&&(Qt=w,!Ke&&(Ke=requestAnimationFrame(()=>{Ke=0,Qt&&I(Qt)})))}function Te(){if(!Fe)return;Fe=null,Ke&&(cancelAnimationFrame(Ke),Ke=0),Qt=null,document.removeEventListener("mousemove",ne,!0),document.removeEventListener("mouseup",Te,!0),document.removeEventListener("selectstart",z,!0),Ct();const w=g.getState().selection;w.kind==="text"&&yn(w)&&rt(w)}const Ye=new Set(["image","divider","table","toc","tableOfContents","codeBlock","equation"]),lt=new Map;let gn=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&<.set(J,(lt.get(J)??0)+1)}}let bn=!1;const ln=g.subscribe(w=>{if(_.value=w.state,w.removed.size>0&&W3(w.removed),w.changed.size>0||w.removed.size>0){const se=new Map;for(const he of w.state.doc.root){const de=w.state.doc.blocks.get(he);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 he of w.changed){const de=he?gn.get(he):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 he of w.removed){const de=he?gn.get(he):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 he of se.keys())ue.add(he);for(const he of ue){const de=se.get(he)??0,ce=lt.get(he)??0;lt.set(he,de),de===0&&ce>0&&l("cleanup:image-file",he)}gn=w.state.doc.blocks,bn=!0,l("update:modelValue",g.toData()),Promise.resolve().then(()=>{bn=!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(ft.value!==null&&J!==ft.value){const se=w.state.doc.blocks.get(ft.value);se&&Ye.has(se.type)&&(T.kind!=="blocks"||T.blockIds.length===0)&&(J=ft.value)}ge||Pt(J),!$&&T!==H&&(K?K=!1:i.nextTick(()=>{const se=at.value;se&&v0(se,T)})),T.kind==="text"&&yn(T)?i.nextTick(()=>{Ct(),!Fe&&!St&&rt(T)}):gt.value.length>0&&(gt.value=[]),H=T});function ir(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(!ir(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)||!ir(w[se],T[se]))return!1;return!0}i.watch(()=>r.modelValue,w=>{if(bn||w===void 0)return;const T=g.toData();ir(T,w)||g.setDocument(w)},{deep:!0});const at=i.ref(null),An=i.ref(null),Sn=()=>An.value;function Un(){const w=at.value;if(!w)return;const T=p0(w,g.getState().doc);if(!T)return;const X={steps:[],selectionAfter:T,meta:{addToHistory:!1}};$=!0,g.dispatch(X),$=!1}function ht(w){var ue,he,de,ce,Be,Je,je,xt,ct,bt,it,At;if(N.visible&&((ue=A.value)!=null&&ue.onKeyDown(w))||j.visible&&((he=U.value)!=null&&he.onKeyDown(w)))return;if(!k.value){const Ue=w.key,tn=w.ctrlKey||w.metaKey,_t=Ue.length===1&&!tn&&!w.altKey&&!w.isComposing,Dt=Ue==="Enter"||Ue==="Backspace"||Ue==="Delete",Nt=Ue.toLowerCase();if(_t||Dt||tn&&(Nt==="x"||Nt==="v"||Nt==="z"||Nt==="y"||Nt==="d")){w.preventDefault();return}if(tn&&Nt==="a"){w.preventDefault(),(ce=(de=g.commands).selectAll)==null||ce.call(de);return}if(tn&&Nt==="c"){const $t=g.getState().selection;if($t.kind==="text"&&yn($t)){const zt=sn($t);if(zt){w.preventDefault();const kn=window.ClipboardItem;if(kn){const nt=new kn({"text/plain":new Blob([zt.text],{type:"text/plain"}),"text/html":new Blob([zt.html],{type:"text/html"})});navigator.clipboard.write([nt]).catch(()=>{navigator.clipboard.writeText(zt.text).catch(()=>{})})}else navigator.clipboard.writeText(zt.text).catch(()=>{})}}return}return}if((w.metaKey||w.ctrlKey)&&w.key.toLowerCase()==="k"&&!w.isComposing){w.preventDefault(),pn();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"&&yn(X)||Un();const J=g.getState().selection;if(J.kind==="text"&&yn(J)&&!w.isComposing){const Ue=w.key,tn=Ue.length===1&&!w.ctrlKey&&!w.metaKey&&!w.altKey;if(tn||Ue==="Enter"||Ue==="Tab"){if(w.preventDefault(),(Je=(Be=g.commands).backspace)==null||Je.call(Be),tn){const _t=g.getState().selection;if(_t.kind==="caret"){const Dt=g.getState().doc.blocks.get(_t.blockId);if(Dt){const[Nt,yt]=Cn(Dt.content,_t.offset),$t=[...Nt,{type:"text",text:Ue},...yt];(xt=(je=g.commands).setText)==null||xt.call(je,{id:_t.blockId,content:$t,selectionAfter:Et(_t.blockId,_t.offset+1)})}}}return}if((w.ctrlKey||w.metaKey)&&(Ue==="c"||Ue==="C"||Ue==="x"||Ue==="X")){const _t=sn(J);if(_t){w.preventDefault();const Dt=window.ClipboardItem;if(Dt){const Nt=new Dt({"text/plain":new Blob([_t.text],{type:"text/plain"}),"text/html":new Blob([_t.html],{type:"text/html"})});navigator.clipboard.write([Nt]).catch(()=>{navigator.clipboard.writeText(_t.text).catch(()=>{})})}else navigator.clipboard.writeText(_t.text).catch(()=>{});(Ue==="x"||Ue==="X")&&((bt=(ct=g.commands).backspace)==null||bt.call(ct))}return}if(Ue==="ArrowLeft"||Ue==="ArrowUp"||Ue==="ArrowRight"||Ue==="ArrowDown"){w.preventDefault();const _t=yr(g.getState().doc),Dt=_t.indexOf(J.anchor.blockId),Nt=_t.indexOf(J.focus.blockId),[yt,$t]=Dt<=Nt?[J.anchor,J.focus]:[J.focus,J.anchor],zt=Ue==="ArrowLeft"||Ue==="ArrowUp"?yt:$t;gt.value=[],(At=(it=g.commands).setSelection)==null||At.call(it,{selection:Et(zt.blockId,zt.offset)});return}}if((w.key==="ArrowUp"||w.key==="ArrowDown")&&!w.shiftKey&&!w.isComposing){const Ue=g.getState().selection;if(Ue.kind==="caret"||Ue.kind==="text"){const tn=Ue.kind==="caret"?Ue.blockId:Ue.focus.blockId,_t=Ue.kind==="caret"?Ue.offset:Ue.focus.offset,Dt=g.getState().doc.blocks.get(tn);if(Dt&&g.registries.schema.get(Dt.type).isolating){const yt=Ve(Dt.content),$t=yt.slice(0,_t),zt=yt.slice(_t),kn=$t.lastIndexOf(`
|
|
283
|
-
`)+1,
|
|
284
|
-
`),
|
|
285
|
-
`},...se],
|
|
286
|
-
`);if(je.insertNode(
|
|
287
|
-
`)){const bt=ce.lastChild;bt&&bt.nodeType===Node.ELEMENT_NODE&&bt.tagName==="BR"&&ce.removeChild(bt),ce.appendChild(document.createElement("br"))}K=!0}else ce.textContent=he}else ce&&(ce.textContent=he);const Je={steps:[{op:"setText",id:w,content:ue}],selectionAfter:Et(w,T+1),meta:{source:"input",addToHistory:!0}};g.dispatch(Je)}const We=i.ref(null),Xe=i.ref("after");let mt="idle",an=0,Mt=0,Rt=4,Lt=null,Nn=null,En=0,co=0,ur=null,qn=null,lr=null,Mr=null;function jn(){Mr!==null&&(clearTimeout(Mr),Mr=null),lr=null}function Ar(){var w;ur&&(ur.classList.remove("block-being-dragged"),ur=null),Nn&&(Nn.remove(),Nn=null),qn!==null&&((w=Sn())==null||w.setBlockHandleDragging(qn,!1)),qn=null,Lt=null,mt="idle",Ge.value=null,We.value=null,Xe.value="after",jn()}function Gn(){document.removeEventListener("mousemove",Se,!0),document.removeEventListener("mouseup",ze,!0),document.removeEventListener("selectstart",Z,!0)}function q(w,T,X,J){k.value&&(mt!=="idle"&&(Gn(),Ar()),mt="pending",Lt=w,an=T,Mt=X,Rt=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 it=w.clientX-an,At=w.clientY-Mt;if(Math.sqrt(it*it+At*At)<=Rt)return;Ze()}if(mt!=="active")return;try{const it=window.getSelection();it&&it.rangeCount>0&&it.removeAllRanges()}catch{}Nn&&(Nn.style.left=`${w.clientX+En}px`,Nn.style.top=`${w.clientY+co}px`);const T=qn;if(!T)return;const X=Array.from(document.querySelectorAll(".block-host"));if(X.length<=1){We.value=null;return}const J=X[0].getBoundingClientRect(),se=X[X.length-1].getBoundingClientRect();if(w.clientY<J.top+J.height/2){jn(),We.value=null,Xe.value="first";return}if(w.clientY>se.bottom-se.height/2){jn(),We.value=null,Xe.value="last";return}const ue=document.elementFromPoint(w.clientX,w.clientY);if(!ue){jn(),We.value=null;return}const he=ue.closest(".block-host");if(!he){jn(),We.value=null;return}const de=he.dataset.blockId;if(!de||de===T){jn(),We.value=null;return}const ce=he.getBoundingClientRect(),Be=ce.height===0?0:(w.clientY-ce.top)/ce.height;let Je=!1;const je=g.getState().doc,xt=je.blocks.get(de);if(xt){const it=g.registries.schema.get(xt.type);if(it!=null&&it.nestable){let At=de;for(Je=!0;At!==null;){if(At===T){Je=!1;break}At=un(je,At)}}}if(Be>e5&&Be<t5&&Je){We.value=de;const it=Be<.5;lr!==de&&(jn(),lr=de,Mr=setTimeout(()=>{lr===de&&(We.value=de,Xe.value="into")},J7)),Xe.value!=="into"&&(Xe.value=it?"before":"after")}else jn(),We.value=de,Xe.value=Be<.5?"before":"after"}function ze(w){if(Gn(),mt==="pending"){mt="idle",Lt=null;return}const T=qn,X=We.value,J=Xe.value;Ar(),T&&(J==="into"&&!X||!X&&J!=="first"&&J!=="last"||C(T,X,J))}function Ze(){var Be,Je;const w=Lt;if(!w)return;const T=an,X=Mt;try{const je=window.getSelection();je&&je.removeAllRanges()}catch{}Fe&&(Fe=null,Ke&&(cancelAnimationFrame(Ke),Ke=0),Qt=null,document.removeEventListener("mousemove",ne,!0),document.removeEventListener("mouseup",Te,!0),document.removeEventListener("selectstart",z,!0),gt.value=[]),Pt(null);const J=document.querySelector(`.block-host[data-block-id="${w}"]`);if(!J){Gn(),mt="idle",Lt=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,Gn(),mt="idle",Lt=null;return}const ue=se.getBoundingClientRect(),he=((Be=se.firstElementChild)==null?void 0:Be.getBoundingClientRect())??ue;En=he.left-T,co=he.top-X;const de=document.createElement("div");de.className="drag-ghost";const ce=se.firstElementChild;ce&&de.appendChild(ce.cloneNode(!0)),de.style.width=`${he.width}px`,de.style.left=`${T+En}px`,de.style.top=`${X+co}px`,document.body.appendChild(de),Nn=de,Ge.value=w,qn=w,We.value=null,Xe.value="after",(Je=Sn())==null||Je.setBlockHandleDragging(w,!0),mt="active"}function C(w,T,X){var je,xt,ct;Ge.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=un(J,bt)}}const ue=un(J,w),he=Yn(J,w);if(he===-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 it=g.registries.schema.get(bt.type);if(!(it!=null&&it.nestable))return;let At=T;for(;At!==null;){if(At===w)return;At=un(J,At)}de=T,ce=0}else if((X==="before"||X==="after")&&T){const bt=un(J,T),it=Yn(J,T);if(it===-1)return;de=bt,ce=X==="before"?it:it+1}else return;ue===de&&he<ce&&ce--,ce=Math.max(0,ce);const Je=de===null?J.root:(je=J.blocks.get(de))==null?void 0:je.children;Je&&(ce=Math.min(ce,Je.length)),(ct=(xt=g.commands).moveBlock)==null||ct.call(xt,{id:w,toParent:de,toIndex:ce})}const S=i.ref(!1);function L(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 he=`${ue.name||""}:${ue.size}:${ue.type}`;X.has(he)||(X.add(he),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 G(w){if(Ge.value)return;const T=w.dataTransfer;if(!T||L(T).length===0)return;S.value||(S.value=!0);const J=Array.from(document.querySelectorAll(".block-host"));if(J.length===0){We.value=null,Xe.value="last";return}const se=J[0].getBoundingClientRect(),ue=J[J.length-1].getBoundingClientRect(),he=w.clientY;if(he<se.top+se.height/2){We.value=null,Xe.value="first";return}if(he>ue.bottom-ue.height/2){We.value=null,Xe.value="last";return}const de=document.elementFromPoint(w.clientX,w.clientY);if(!de){We.value=null,Xe.value="last";return}const ce=de.closest(".block-host");if(!ce){We.value=null,Xe.value="last";return}const Be=ce.getBoundingClientRect(),Je=ce.dataset.blockId;if(!Je){We.value=null,Xe.value="last";return}We.value=Je,Xe.value=he<Be.top+Be.height/2?"before":"after"}function ee(w){const T=w.relatedTarget,X=at.value;X&&T&&X.contains(T)||S.value&&(S.value=!1,We.value=null,Xe.value="after")}async function oe(w){if(Ge.value)return;const T=w.dataTransfer;if(!T)return;const X=L(T);if(X.length===0)return;const J=We.value,se=Xe.value;S.value=!1,We.value=null,Xe.value="after";let ue=J,he=se==="before"?"before":"after";const de=g.getState().doc;se==="first"?(ue=de.root[0]??null,he="before"):se==="last"&&(ue=de.root[de.root.length-1]??null,he="after");let ce=ue;for(let Be=0;Be<X.length;Be++){const Je=X[Be],je=await re(Je,{relativeToBlockId:ce,position:Be===0?he:"after",convertIfEmpty:Be===0});je&&(ce=je)}}function fe(w,T){Ne(),pe(),j.visible=!0,j.anchorEl=T,j.blockId=w}function pe(){j.visible=!1,j.anchorEl=null}function Le(w,T){var ce,Be;if(!k.value)return;pe(),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"&&Ve(X.content).length===0){N.visible=!0,N.anchorEl=T,N.blockId=w,N.query="",N.mode="slash",N.sourceBlockId=void 0;return}(Be=(ce=g.commands).insertBlock)==null||Be.call(ce,{type:g.registries.defaultBlockType,after:w,content:[]});const he=g.getState().selection,de=he.kind==="caret"?he.blockId:w;N.visible=!0,N.anchorEl=T,N.blockId=de,N.query="",N.mode="insert",N.sourceBlockId=w}function Ae(w,T,X){k.value&&(pe(),N.visible=!0,N.anchorEl=w,N.blockId=T,N.query=X,N.mode="slash",N.sourceBlockId=void 0)}function _e(w,T){if(!N.visible)return;if(w!==N.blockId){Ne();return}const X=T.match(/\/([^/]*)$/);if(!X){Ne();return}N.query=X[1]??""}function Ne(){N.visible=!1,N.anchorEl=null,N.query="",N.sourceBlockId=void 0}i.watch(()=>P.visible,w=>{w&&(N.visible||Ne(),j.visible||pe())});function st(w,T){var ue,he,de,ce;const X=N.blockId,J=pt(X),se=Ot(J);g.history.beginGroup();try{J!==se&&((he=(ue=g.commands).setText)==null||he.call(ue,{id:X,content:Ir(se)}));const Be=g.registries.slash.all.find(Je=>Je.id===w.id);if(Be){const Je=typeof Be.args=="function"?Be.args(null):Be.args,je=Je&&typeof Je=="object"?{...Je}:{};je.id==="__currentBlock__"&&(je.id=X),je.after==="__currentBlock__"&&(je.after=X);const xt=g.commands[Be.command];xt==null||xt(je),(ce=(de=g.commands).setSelection)==null||ce.call(de,{selection:{kind:"caret",blockId:X,offset:0}}),w.id==="image"&&i.nextTick(()=>{const ct=document.createElement("input");ct.type="file",ct.accept="image/*",ct.multiple=!1,ct.addEventListener("change",()=>{var it;const bt=(it=ct.files)==null?void 0:it[0];bt&&re(bt,{relativeToBlockId:X,position:"replace",convertIfEmpty:!0})}),ct.click()})}}finally{g.history.endGroup()}Ne()}function pt(w){const T=at.value;if(!T)return"";const X=T.querySelector(`.block-content[data-block-id="${w}"]`);return(X==null?void 0:X.textContent)??""}function Ot(w){const T=w.lastIndexOf("/");return T<0?w:w.slice(0,T)}function vn(w){var it,At,Ue,tn,_t;let T=!1;w&&typeof w=="object"&&!("type"in w)&&(T=!!w.force);const X=at.value;if(X){const Dt=window.getSelection();let Nt=null;if(Dt&&Dt.rangeCount>0){const yt=Dt.focusNode,$t=(yt==null?void 0:yt.nodeType)===1?yt.closest(".block-content"):(it=yt==null?void 0:yt.parentElement)==null?void 0:it.closest(".block-content");if($t&&X.contains($t)){const zt=$t.getAttribute("data-block-id");zt&&(Nt=zt)}}if(Nt!==null&&ft.value!==null&&Nt!==ft.value){const yt=g.getState().doc.blocks.get(ft.value);yt&&Ye.has(yt.type)&&(Nt=null)}Nt!==null&&!ge&&Pt(Nt)}if(!k.value){P.visible=!1,P.selectionRect=null,P.blockId=null,P.blockType=null,P.blockAttrs={};return}const J=at.value;if(!J)return;const se=g.getState().selection;if(se.kind==="text"&&yn(se)&&!Fe)return;if(ti(se)&&se.blockIds.length>0){const Dt=window.getSelection();if(Dt&&Dt.rangeCount>0&&Dt.getRangeAt(0).collapsed){const Nt=p0(J,g.getState().doc);Nt&&Nt.kind==="caret"&&($=!0,(Ue=(At=g.commands).setSelection)==null||Ue.call(At,{selection:Nt}),$=!1)}}const ue=window.getSelection();if(!ue||ue.rangeCount===0){!ge&&!St&&(P.visible=!1,P.selectionRect=null,P.blockId=null,P.blockType=null,P.blockAttrs={});return}const he=ue.getRangeAt(0);if(he.collapsed){!ge&&!St&&(P.visible=!1,P.selectionRect=null,P.blockId=null);return}if(!J.contains(he.commonAncestorContainer)){!ge&&!St&&(P.visible=!1,P.selectionRect=null,P.blockId=null);return}if(St&&!T)return;const de=ue.anchorNode;if((de==null?void 0:de.nodeType)===1?de.closest(".table-cell-inner"):(tn=de==null?void 0:de.parentElement)==null?void 0:tn.closest(".table-cell-inner")){!ge&&!St&&(P.visible=!1,P.selectionRect=null,P.blockId=null,P.blockType=null,P.blockAttrs={});return}const Be=(de==null?void 0:de.nodeType)===1?de.closest(".block-content"):(_t=de==null?void 0:de.parentElement)==null?void 0:_t.closest(".block-content");if(!Be){!ge&&!St&&(P.visible=!1,P.selectionRect=null,P.blockId=null);return}const Je=Be.getAttribute("data-block-id");if(!Je){!ge&&!St&&(P.visible=!1,P.selectionRect=null,P.blockId=null);return}const xt=g.getState().doc.blocks.get(Je),ct=he.getBoundingClientRect(),bt=ct.width===0&&ct.height===0?Be.getBoundingClientRect():ct;P.visible=!0,P.selectionRect=bt,P.blockId=Je,P.blockType=(xt==null?void 0:xt.type)??null,P.blockAttrs=(xt==null?void 0:xt.attrs)??{}}function Tn(){const w=g.getState().selection;if(w.kind==="text"&&yn(w)){if(Ct(),P.visible){const se=at.value;if(se){const ue=$l(se,g.getState().doc,w);ue.length>0&&(P.selectionRect=dn(ue))}}return}if(!P.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||(P.selectionRect=J)}function dn(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 rt(w){if(!k.value)return;const T=at.value;if(!T)return;const X=$l(T,g.getState().doc,w);if(X.length===0)return;const J=dn(X),ue=g.getState().doc.blocks.get(w.focus.blockId);P.visible=!0,P.selectionRect=J,P.blockId=w.focus.blockId,P.blockType=(ue==null?void 0:ue.type)??null,P.blockAttrs=(ue==null?void 0:ue.attrs)??{}}function Ut(w){var se,ue;const T=at.value;if(!T||M.value||!T.contains(w.target))return;const X=w.target;if(X&&X.closest(".block-handle"))return;St=!0,P.visible=!1;const J=g.getState().selection;if(J.kind==="text"&&yn(J)&&(gt.value=[]),w.button===0&&!w.shiftKey){const he=w.target;if(he&&(he.closest(".table-cell-inner, .block-table-container, .block-table-of-contents")||he.closest(".block-focus-root")&&!he.closest('[contenteditable="true"]')&&!he.closest("[data-equation-edit]")||he.closest(".equation-block")&&!he.closest("[data-equation-edit]"))){He=!0;try{const ce=window.getSelection();ce&&ce.removeAllRanges()}catch{}return}else He=!1;const de=zi(w.clientX,w.clientY,T,g.getState().doc);de&&(J.kind==="text"&&yn(J)&&($=!0,(ue=(se=g.commands).setSelection)==null||ue.call(se,{selection:Et(de.blockId,de.offset)}),$=!1),Fe={start:{blockId:de.blockId,offset:de.offset},crossBlock:!1},document.addEventListener("mousemove",ne,!0),document.addEventListener("mouseup",Te,!0))}}function Dn(){if(!St)return;if(M.value){St=!1;return}if(St=!1,He){He=!1;return}const w=g.getState().selection;w.kind==="text"&&yn(w)||vn()}let ot=null,Kt=!1;function Bn(w){if(!M.value)return;const T=at.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&&(Kt=!1,ot={longPressTimer:window.setTimeout(()=>{ot&&Mn(T,ot.startTouch)},n5),startTouch:se},document.addEventListener("touchmove",zn,{passive:!1,capture:!0}),document.addEventListener("touchend",In,!0),document.addEventListener("touchcancel",In,!0))}function zn(w){var de,ce;if(!ot)return;Kt=!0;const T=at.value;if(!T)return;if(!Fe){const Be=w.touches[0];if(!Be)return;const Je=Be.clientX-ot.startTouch.clientX,je=Be.clientY-ot.startTouch.clientY;if(Math.hypot(Je,je)>10){ot.longPressTimer&&clearTimeout(ot.longPressTimer),ot=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",z,!0);const Be=window.getSelection();Be&&Be.removeAllRanges()}return}if(w.preventDefault(),!Fe.crossBlock){Fe.crossBlock=!0,document.addEventListener("selectstart",z,!0);const Be=window.getSelection();Be&&Be.removeAllRanges()}const ue={blockId:J.blockId,offset:J.offset},he=_l(se,ue);$=!0,(ce=(de=g.commands).setSelection)==null||ce.call(de,{selection:he}),$=!1,Ct()}function Mn(w,T){const X=zi(T.clientX,T.clientY,w,g.getState().doc);if(!X){ot=null;return}P.visible=!1;const J=g.getState().selection;J.kind==="text"&&yn(J)&&(gt.value=[]),Fe={start:{blockId:X.blockId,offset:X.offset},crossBlock:!1}}function In(){if(ot&&(ot.longPressTimer&&clearTimeout(ot.longPressTimer),ot=null),!Fe){document.removeEventListener("touchmove",zn,!0),document.removeEventListener("touchend",In,!0),document.removeEventListener("touchcancel",In,!0);return}if(Fe=null,document.removeEventListener("touchmove",zn,!0),document.removeEventListener("touchend",In,!0),document.removeEventListener("touchcancel",In,!0),document.removeEventListener("selectstart",z,!0),!Kt)return;Ct();const w=g.getState().selection;w.kind==="text"&&yn(w)&&rt(w)}function sn(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,he]=J<=se?[w.anchor,w.focus]:[w.focus,w.anchor],de=X.indexOf(ue.blockId),ce=X.indexOf(he.blockId);if(de===-1||ce===-1)return null;const Be=[],Je=[];for(let je=de;je<=ce;je++){const xt=X[je],ct=T.blocks.get(xt);if(!ct)continue;const bt=Ve(ct.content).length;let it=0,At=bt;je===de&&(it=Math.min(ue.offset,bt)),je===ce&&(At=Math.min(he.offset,bt)),it>At&&([it,At]=[At,it]);const[,Ue]=Cn(ct.content,it),[tn]=Cn(Ue,At-it);Be.push(Ve(tn)),Je.push(Qr(tn))}return{text:Be.join(`
|
|
288
|
-
`),html:Je.join("<br>")}}function Kr(w){var J,se;const T=g.getState().selection;if(T.kind!=="text"||!yn(T))return;const X=sn(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,he;if(!k.value){w.preventDefault();return}const T=g.getState().selection;if(T.kind!=="text"||!yn(T))return;const X=sn(T);X&&(w.preventDefault(),(J=w.clipboardData)==null||J.setData("text/plain",X.text),(se=w.clipboardData)==null||se.setData("text/html",X.html),(he=(ue=g.commands).backspace)==null||he.call(ue))}function cn(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=Rr(J,X),de=typeof(se==null?void 0:se.attrs).startNumber=="number"&&!!ue&&ue.type==="orderedList",ce=ic(J,X),Be=ce!==1;Ne(),pe(),br(),tt(),P.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&&(Ce.visible=!0,Ce.initialValue=w,Ce.anchor=T,Ce.blockId=X)}function br(){Ce.visible=!1,Ce.anchor=null,Ce.blockId=null}function Cs(w){var T,X;if(!Ce.blockId){br();return}(X=(T=g.commands).setStartNumber)==null||X.call(T,{id:Ce.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(),pe(),br(),gr(),tt(),P.visible=!1,$e.visible=!0,$e.blockId=X,$e.anchor=T.anchor,$e.initialValue=ue}function Yr(){$e.visible=!1,$e.anchor=null,$e.blockId=null}function Ss(w){var T,X;if(!$e.blockId){Yr();return}(X=(T=g.commands).setAttrs)==null||X.call(T,{id:$e.blockId,attrs:{language:w}}),Yr()}function Yo(w){var de,ce,Be,Je,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(),Yr(),tt();const he=g.getState().selection;if(he.kind==="blocks"&&he.blockIds.length>0){const xt=at.value;if(xt&&xt.contains(T)){const ct=T.nodeType===1?T:T.parentElement??null;if(ct&&(ct.closest("[contenteditable]")||ct.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=(Je=g.commands).clearSelection)==null||je.call(Je)}}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(),Ce.visible&&br(),$e.visible&&Yr(),we.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=at.value;if(!se||!se.contains(J))return;const ue=J.getAttribute("data-block-id");ue&&Pt(ue,{clearNativeSelection:!0})}function Ai(w){w.target===at.value&&Pt(null,{clearNativeSelection:!0})}return i.onMounted(()=>{i.nextTick(()=>{const w=at.value;if(!w)return;const T=g.getState().selection;v0(w,T),w.addEventListener("ordered-list-marker-click",cn),w.addEventListener("code-lang-click",Sl),w.addEventListener("click",Br),w.addEventListener("click",Ai)}),document.addEventListener("selectionchange",vn),document.addEventListener("mousedown",Ut,!0),document.addEventListener("mouseup",Dn,!0),document.addEventListener("mousedown",Yo,!0),document.addEventListener("touchstart",Yo,!0),window.addEventListener("scroll",Tn,!0),window.addEventListener("resize",Tn),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",Bn,{passive:!1,capture:!0})}),i.onBeforeUnmount(()=>{const w=at.value;w&&(w.removeEventListener("ordered-list-marker-click",cn),w.removeEventListener("code-lang-click",Sl),w.removeEventListener("click",Br),w.removeEventListener("click",Ai)),document.removeEventListener("selectionchange",vn),document.removeEventListener("mousedown",Ut,!0),document.removeEventListener("mouseup",Dn,!0),document.removeEventListener("mousedown",Yo,!0),document.removeEventListener("touchstart",Yo,!0),window.removeEventListener("scroll",Tn,!0),window.removeEventListener("resize",Tn),window.removeEventListener("scroll",dr,!0),document.removeEventListener("touchmove",dr,!0),document.removeEventListener("keydown",Ts,!0),E==null||E.removeEventListener("change",O),document.removeEventListener("touchstart",Bn,!0),document.removeEventListener("touchmove",zn,!0),document.removeEventListener("touchend",In,!0),document.removeEventListener("touchcancel",In,!0),ln(),g.destroy(),Q(),U3(),q3()}),e({editor:g}),(w,T)=>(i.openBlock(),i.createElementBlock("div",{ref_key:"rootEl",ref:at,class:i.normalizeClass(["block-editor",[f.value,{"block-editor-dragging":Ge.value!==null,"is-mobile":M.value}]]),style:i.normalizeStyle(p.value),contenteditable:!1,onKeydown:ht,onCopy:Kr,onCut:Nr,onDragover:i.withModifiers(G,["prevent"]),onDragleave:ee,onDrop:i.withModifiers(oe,["prevent"])},[D.value?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(_h,{key:0,"root-el":at.value,"focus-block-id":ft.value,"hover-visible":P.visible,"hover-selection-rect":P.selectionRect,"hover-block-id":P.blockId,"hover-block-type":P.blockType,"hover-block-attrs":P.blockAttrs,"plus-menu-visible":N.visible,"settings-menu-visible":j.visible,position:te.value,onToolbarInteracting:Me,onOpenPlusMenu:Le,onOpenSettingsMenu:fe,onLinkClick:Gt,onHoverClose:T[0]||(T[0]=X=>P.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"])),D.value?(i.openBlock(),i.createBlock(ec,i.mergeProps({key:1},F.value,{onInteracting:Me}),null,16)):i.createCommentVNode("",!0),i.createElementVNode("div",j7,[i.createVNode(U0,{ref_key:"blockListRef",ref:An,items:Y.value,"blocks-map":_.value.doc.blocks,"first-block-placeholder":b.value,"hovered-block-id":on.value,"focused-block-id":ft.value,"has-text-selection":P.visible,"dragging-block-id":Ge.value,"drop-target-block-id":We.value,"drop-position":Xe.value,"menu-open-block-id":j.visible?j.blockId:null,onOpenSettingsMenu:fe,onOpenPlusMenu:Le,onSlashTrigger:Ae,onInputChanged:_e,onHoverChange:Tt,onGripPointerDown:q,onGripPointerUp:x,onLinkClick:dt,onFocusIn:jt},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(yf,{ref_key:"plusMenuRef",ref:A,visible:N.visible,"anchor-el":N.anchorEl,"block-id":N.blockId,query:N.query,"root-el":at.value,mode:N.mode,onClose:Ne,onCommit:st},null,8,["visible","anchor-el","block-id","query","root-el","mode"]),i.createVNode(N6,{ref_key:"settingsMenuRef",ref:U,visible:j.visible,"anchor-el":j.anchorEl,"block-id":j.blockId,"root-el":at.value,onClose:pe},null,8,["visible","anchor-el","block-id","root-el"]),i.createVNode(tc,{visible:ae.visible,"block-id":ae.blockId,anchor:ae.anchor,"root-el":at.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(nc,{visible:Ce.visible,"initial-value":Ce.initialValue,anchor:Ce.anchor,"root-el":at.value,onConfirm:Cs,onClose:br},null,8,["visible","initial-value","anchor","root-el"]),i.createVNode(Qh,{visible:$e.visible,"initial-value":$e.initialValue,anchor:$e.anchor,"root-el":at.value,onConfirm:Ss,onClose:Yr},null,8,["visible","initial-value","anchor","root-el"]),i.createVNode(oc,{visible:we.visible,"anchor-rect":we.anchorRect,"block-id":we.blockId,from:we.from,to:we.to,href:we.href,text:we.text,"initial-mode":we.initialMode,"show-text-input":we.showTextInput,readonly:!k.value,onClose:tt},null,8,["visible","anchor-rect","block-id","from","to","href","text","initial-mode","show-text-input","readonly"])],38))}});ke.BlockContent=Hr,ke.BlockEditor=r5,ke.BlockHost=V0,ke.BlockList=U0,ke.BuiltinExtensions=Od,ke.CommandRegistry=Ws,ke.DeserializerRegistry=o0,ke.DividerExtension=Rd,ke.Editor=s0,ke.EquationExtension=Nd,ke.HeadingExtension=ac,ke.HistoryExtension=cc,ke.HistoryManager=a0,ke.ImageExtension=jc,ke.InputRuleRegistry=t0,ke.KeymapExtension=sc,ke.KeymapRegistry=e0,ke.ParagraphExtension=lc,ke.SchemaRegistry=zs,ke.SerializerRegistry=r0,ke.SlashCommandRegistry=n0,ke.TableExtension=_d,ke.TableOfContentsExtension=Ld,ke.TransactionBuilder=Us,ke.applySteps=_i,ke.applyTransaction=Vs,ke.asBlockId=Zd,ke.blockAfter=No,ke.blockBefore=Rr,ke.blocksSelection=l1,ke.buildRegistries=l0,ke.canContain=Rs,ke.caretSelection=Et,ke.coerceAttrs=_s,ke.collectIndentSyncPatches=Fs,ke.createBlockId=Mo,ke.createPrimitiveCommands=js,ke.createState=Il,ke.createTransaction=kt,ke.defaultAttrs=Zr,ke.defineSchema=Ml,ke.depthOf=_r,ke.docFromData=Al,ke.docToData=Ps,ke.editorKey=Hl,ke.extensionBlockType=O1,ke.flatten=yr,ke.flattenExtensions=i0,ke.focusOffset=a1,ke.getBlock=Yt,ke.hasText=Ls,ke.indexOf=Yn,ke.inlineFromString=Ir,ke.inlineText=Ve,ke.invertSteps=qs,ke.isBlockId=To,ke.isBlocks=ti,ke.isCaret=Bo,ke.isCollapsed=Rl,ke.isEmpty=Ds,ke.isIsolating=Os,ke.isText=jr,ke.isTextRun=Yd,ke.keyMatches=Js,ke.keyNameFromEvent=Qs,ke.lastDescendant=$s,ke.nextSibling=Jd,ke.normalizeLocale=H0,ke.normalizeTheme=P0,ke.orderedAnchors=s1,ke.parentOf=un,ke.prevSibling=Bl,ke.primaryBlock=Gs,ke.requireBlock=Kn,ke.siblingList=Ao,ke.splitInline=Cn,ke.textSelection=_l,ke.useEditor=Xn,ke.useI18n=_n,ke.withAttrs=t1,ke.withContent=e1,Object.defineProperty(ke,Symbol.toStringTag,{value:"Module"})});
|
|
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
|
+
`)&&(Ms+="<br>");const So=["table-cell"];vr&&So.push("table-cell-header"),Zo&&So.push("table-cell-selected"),(jo||Qo||Bi)&&So.push("table-cell-selected"),typeof Re.align=="string"&&Re.align!=="left"&&So.push(`be-align-${Re.align}`),typeof Re.bgColor=="string"&&Re.bgColor!=="default"&&So.push(`be-bg-${Re.bgColor}`);const Fd=Re.verticalAlign??"middle";let Vd;Fd!=="top"&&(Vd={verticalAlign:Fd});const Ud=!o5&&((hr=k.value)==null?void 0:hr.row)===le&&((uo=k.value)==null?void 0:uo.col)===$e;Ud&&So.push("table-cell-focused");const ir=["table-cell-inner"],Gn=Re.cellType;Gn==="heading"||Gn==="heading1"?ir.push("table-cell-heading","table-cell-h1"):Gn==="heading2"?ir.push("table-cell-heading","table-cell-h2"):Gn==="heading3"?ir.push("table-cell-heading","table-cell-h3"):Gn==="heading4"?ir.push("table-cell-heading","table-cell-h4"):Gn==="heading5"?ir.push("table-cell-heading","table-cell-h5"):Gn==="heading6"?ir.push("table-cell-heading","table-cell-h6"):Gn==="bulletList"?ir.push("table-cell-bullet"):Gn==="orderedList"?ir.push("table-cell-ordered"):Gn==="todoList"?(ir.push("table-cell-todo"),Re.checked&&ir.push("todo-checked")):Gn==="quote"?ir.push("table-cell-quote"):Gn==="codeBlock"&&ir.push("table-cell-code");const qd=Gn==="orderedList"?Kl(C,le,$e):-1,As=i.h("div",{class:ir,contenteditable:Ud&&r.value?"true":"false","data-placeholder":o.t("table.cellPlaceholder"),innerHTML:Ms,ref:kr=>{kr instanceof HTMLDivElement?p.set(vt,kr):p.delete(vt)},onBlur:kr=>Je(le,$e,kr.currentTarget,kr),onFocus:kr=>Mn(le,$e,kr.currentTarget)});let Tl;if(Gn==="todoList"){const kr=i.h("input",{type:"checkbox",class:"table-cell-todo-checkbox",checked:!!Re.checked,onClick:Yr=>{Yr.stopPropagation()},onchange:Yr=>{var Gd,Wd;if(!r.value)return;const Ns=Yr.target,l5=di(f.value,le,$e,{checked:Ns.checked});(Wd=(Gd=n.commands).setAttrs)==null||Wd.call(Gd,{id:l,attrs:l5})}});Tl=[i.h("div",{class:"table-cell-todo-wrapper"},[kr,As])]}else if(Gn==="orderedList"&&qd>=1){const kr=i.h("div",{class:"ol-marker table-cell-ol-marker",onMousedown:Yr=>{Yr.preventDefault(),Yr.stopPropagation()},onClick:Yr=>{Yr.stopPropagation();const Ns=Yr.currentTarget;tt(le,$e,Ns)}},`${qd}.`);Tl=[i.h("div",{class:"block-ordered-list-wrapper"},[kr,As])]}else Tl=[As];const i5=i.h(vr?"th":"td",{rowspan:Re.rowspan>1?Re.rowspan:void 0,colspan:Re.colspan>1?Re.colspan:void 0,class:So,style:Vd,"data-row":le,"data-col":$e},Tl);De.push(i5)}pt===0&&le===0?Ne.push(i.h("tr",{class:"table-row table-row-head"},De)):st.push(i.h("tr",{class:"table-row"},De))}const Lt=[_e];Ne.length>0&&Lt.push(i.h("thead",{},Ne)),Lt.push(i.h("tbody",{},st));const bn=i.h("table",{ref:b,class:"block-table-grid"},Lt),Sn=[];for(let le=0;le<S;le++){const De=oe.rowTops[le],$e=oe.rowHeights[le]??32,Re=he.kind==="row"&&he.row===le;Sn.push(i.h("div",{class:`table-row-strip${Re?" is-selected":""}`,"data-row":le,style:{top:`${De}px`,height:`${$e}px`},title:o.t("table.selectRow"),onClick:vt=>{vt.preventDefault(),ht(le)}}))}const fn=z.value!==null,ot=[],Ft=[];let On;if(fn){const le=C.colWidths;let De=0;for(let $e=0;$e<R;$e++){ot.push(De);const Re=le[$e]??80;Ft.push(Re),De+=Re}On=De}else{for(let le=0;le<R;le++)ot.push(oe.colLefts[le]??0),Ft.push(oe.colWidths[le]??0);On=oe.tableTotalWidth}const it=[];for(let le=0;le<R;le++){const De=ot[le],$e=Ft[le]??0,Re=he.kind==="col"&&he.col===le;it.push(i.h("div",{class:`table-col-strip${Re?" is-selected":""}`,"data-col":le,style:{left:`${De}px`,width:`${$e}px`},title:o.t("table.selectCol"),onClick:vt=>{vt.preventDefault(),xt(le)}}))}const Wt=[];if(r.value)for(let le=0;le<=S;le++){let De;if(le===0)De=(oe.rowTops[0]??0)+3;else if(le===S){const $e=oe.rowTops[le-1]??0,Re=oe.rowHeights[le-1]??32;De=$e+Re+2}else{const $e=(oe.rowTops[le-1]??0)+(oe.rowHeights[le-1]??32),Re=oe.rowTops[le]??0;De=Math.round(($e+Re)/2)}Wt.push(i.h("div",{class:"table-insert-dot table-insert-dot-row",style:{top:`${De}px`},title:le<S?o.t("table.insertRowAbove"):o.t("table.insertRowBelow"),onClick:$e=>{$e.preventDefault(),$e.stopPropagation(),ze("tableInsertRow",{beforeRow:le})}}))}const Nn=[];for(let le=0;le<R;le++){const De=ot[le]??0,$e=Ft[le]??0;Nn.push(i.h("div",{class:"table-col-resize-item",style:{left:`${De}px`,width:`${$e}px`}},[i.h("div",{class:"table-col-resizer",title:o.t("table.resizeCol"),onMousedown:Re=>co(le,Re)})]))}const Dn=i.h("div",{class:"table-corner-handle",title:o.t("table.selectAll"),onClick:le=>{le.preventDefault(),Ye()}});ge.push(Le,Dn),ge.push(i.h("div",{class:"table-row-handles",style:{height:`${oe.tableTotalHeight}px`}},[...Sn,...Wt])),ge.push(i.h("div",{class:"table-wrapper",ref:_t},[i.h("div",{class:"table-col-handles",style:{width:`${On}px`}},[...it]),i.h("div",{class:"table-col-resizers"},Nn),bn])),ge.push(i.h("div",{class:["table-col-insert-dots",Ar.value||z.value!==null?"is-scrolling":""]},Se.value.map(le=>i.h("div",{class:"table-insert-dot table-insert-dot-col",style:{left:`${le.left}px`},title:le.c<R?o.t("table.insertColLeft"):o.t("table.insertColRight"),onClick:De=>{De.preventDefault(),De.stopPropagation(),ze("tableInsertCol",{beforeCol:le.c})}}))));const Tn=$.value,Bn=he.kind==="row"||he.kind==="col"||he.kind==="all",cn=Ti(g.value),Wr=cn?Or(f.value,cn.r1,cn.c1,cn.r2,cn.c2):null,Nr=k.value?{r1:k.value.row,c1:k.value.col,r2:k.value.row,c2:k.value.col}:null,un=Wr??Nr,ws=(un?v3(f.value,un.r1,un.c1,un.r2,un.c2):0)>=2,xs=un?x0(f.value,un.r1,un.c1,un.r2,un.c2):!1,Es=he.kind==="row"?o.t("table.deleteRow"):he.kind==="col"?o.t("table.deleteCol"):he.kind==="all"?o.t("table.deleteTable"):"",br=he.kind==="row"?B7:he.kind==="col"?I7:Nd,Cs=()=>{he.kind==="row"?ze("tableRemoveRow",{row:he.row}):he.kind==="col"?ze("tableRemoveCol",{col:he.col}):ze("tableDelete")},Sl=()=>{un&&ze("tableMergeCells",un)},Kr=()=>{un&&ze("tableSplitCellsInRect",un)},Ss=()=>{ze("tableToggleHeaderRow")},Yo=()=>{Q.value={kind:"none"},g.value=null,at(0)};function dr(){var $e;const le=Ti(g.value);if(!le)return[];const De=[];for(let Re=le.r1;Re<=le.r2;Re++)for(let vt=le.c1;vt<=le.c2;vt++){const vr=($e=f.value.cells[Re])==null?void 0:$e[vt];vr&&!vr.covered&&De.push({row:Re,col:vt})}return De}const Br=dr().map(le=>{var De;return(De=f.value.cells[le.row])==null?void 0:De[le.col]}).filter(le=>!!le&&!le.covered),Ai=new Set(Br.map(le=>le.cellType??"paragraph"));let w="paragraph",T;if(Ai.size===1){const le=[...Ai][0];le==="heading"||le==="heading1"?(w="heading",T=1):le==="heading2"?(w="heading",T=2):le==="heading3"?(w="heading",T=3):le==="heading4"?(w="heading",T=4):le==="heading5"?(w="heading",T=5):le==="heading6"?(w="heading",T=6):le==="bulletList"?w="bulletList":le==="orderedList"?w="orderedList":le==="todoList"?w="todoList":le==="quote"?w="quote":le==="codeBlock"&&(w="codeBlock")}const X=new Set(Br.map(le=>le.align??"left")),se={align:X.size===1?[...X][0]:"left"},ue=new Set(Br.map(le=>le.verticalAlign??"middle")),me=ue.size===1?[...ue][0]:"middle";se.verticalAlign=me,T!==void 0&&(se.level=T);const de=["bold","italic","underline","strikethrough","code"],ce=new Set;for(const le of de){let De=!0,$e=!1;for(const Re of Br){for(const vt of Re.content)if(vt.type==="text"&&($e=!0,!((Ni=vt.marks)!=null&&Ni.some(vr=>vr.type===le)))){De=!1;break}if(!De)break}$e&&De&&ce.add(le)}const Be=new Set;for(const le of Br)for(const De of le.content){if(De.type!=="text")continue;const $e=(Xo=De.marks)==null?void 0:Xo.find(vt=>vt.type==="color"),Re=(Od=$e==null?void 0:$e.attrs)==null?void 0:Od.color;typeof Re=="string"&&Be.add(Re)}const et=Be.size===1?[...Be][0]:"",je=new Set(Br.map(le=>le.bgColor??"")),Et=je.size===1?[...je][0]:"";if((he.kind==="row"||he.kind==="col"||he.kind==="all"||Br.length>0)&&!K){A.blockType=w,A.blockAttrs={...se},A.marks.clear();for(const le of ce)A.marks.add(le);A.textColor=et,A.bgColor=Et,A.verticalAlign=me,A.showDelete=Bn,A.deleteLabel=Es,A.deleteIcon=br,A.showMerge=ws,A.showSplit=xs,A.showHeaderRow=he.kind==="all",A.headerRowActive=!!f.value.headerRow}const bt=le=>{var Re,vt;const De=dr();if(De.length===0)return;const $e=po(f.value,De,{cellType:le});(vt=(Re=n.commands).setAttrs)==null||vt.call(Re,{id:l,attrs:$e})},lt=le=>{var Re,vt;const De=dr();if(De.length===0)return;const $e=po(f.value,De,{align:le});(vt=(Re=n.commands).setAttrs)==null||vt.call(Re,{id:l,attrs:$e})},Mt=le=>{var Re,vt;const De=dr();if(De.length===0)return;const $e=po(f.value,De,{verticalAlign:le});(vt=(Re=n.commands).setAttrs)==null||vt.call(Re,{id:l,attrs:$e})},Ge=le=>{var Re,vt;const De=dr();if(De.length===0)return;const $e=C3(f.value,De,le);(vt=(Re=n.commands).setAttrs)==null||vt.call(Re,{id:l,attrs:$e})},nn=le=>{var Re,vt;const De=dr();if(De.length===0)return;const $e=C0(f.value,De,"color",le?{color:le}:null);(vt=(Re=n.commands).setAttrs)==null||vt.call(Re,{id:l,attrs:$e})},It=le=>{var Re,vt;const De=dr();if(De.length===0)return;const $e=po(f.value,De,{bgColor:le??"default"});(vt=(Re=n.commands).setAttrs)==null||vt.call(Re,{id:l,attrs:$e})},Ot=()=>{var Re,vt;const le=Ti(g.value);if(!le)return;const De=[];for(let vr=le.r1;vr<=le.r2;vr++){const Zo=[];for(let jo=le.c1;jo<=le.c2;jo++){const Qo=(Re=f.value.cells[vr])==null?void 0:Re[jo];Qo&&!Qo.covered?Zo.push(Qo.content.map(Bi=>Bi.type==="text"?Bi.text:"").join("")):Zo.push("")}De.push(Zo.join(" "))}const $e=De.join(`
|
|
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,rt=Dt.indexOf(`
|
|
284
|
+
`),qt=rt===-1?wt.length:It+rt,fr=vn===0,hr=qt===wt.length;if(w.key==="ArrowUp"&&!fr||w.key==="ArrowDown"&&!hr)return}}}if(J1(g,w)){w.preventDefault();return}if(w.key==="Enter"&&!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);Ot&&g.registries.schema.get(Ot.type).isolating&&(w.preventDefault(),xt(nn,It))}}}function xt(w,T){const X=g.getState().doc.blocks.get(w);if(!X)return;const[J,se]=En(X.content,T),ue=[...J,{type:"text",text:`
|
|
285
|
+
`},...se],me=Ue(ue),de=ut.value,ce=de?ii(de,w):null,Be=window.getSelection();if(ce&&Be&&Be.rangeCount>0){const je=Be.getRangeAt(0);if(ce.contains(je.commonAncestorContainer)){je.collapsed||je.deleteContents();const Et=document.createTextNode(`
|
|
286
|
+
`);if(je.insertNode(Et),je.setStartAfter(Et),je.collapse(!0),Be.removeAllRanges(),Be.addRange(je),me.endsWith(`
|
|
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"})});
|