@henryx/pagely 0.1.0

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.
Files changed (120) hide show
  1. package/dist/components/BlockMenu.vue.d.ts +27 -0
  2. package/dist/components/CodeBlockView.vue.d.ts +95 -0
  3. package/dist/components/ColAlignBadge.vue.d.ts +15 -0
  4. package/dist/components/ColorPanel.vue.d.ts +14 -0
  5. package/dist/components/CommentContentViewer.vue.d.ts +11 -0
  6. package/dist/components/CommentEditor.vue.d.ts +26 -0
  7. package/dist/components/DotFlowPadBlockView.vue.d.ts +146 -0
  8. package/dist/components/EmbedBlockShell.vue.d.ts +46 -0
  9. package/dist/components/EmbedFullscreenModal.vue.d.ts +29 -0
  10. package/dist/components/EmbedViewBlock.vue.d.ts +26 -0
  11. package/dist/components/EmbedViewToolbar.vue.d.ts +24 -0
  12. package/dist/components/ImageBlockView.vue.d.ts +7 -0
  13. package/dist/components/ImagePreviewDialog.vue.d.ts +13 -0
  14. package/dist/components/InsertLinkDialog.vue.d.ts +19 -0
  15. package/dist/components/InsertMenu.vue.d.ts +27 -0
  16. package/dist/components/LinkToolbar.vue.d.ts +15 -0
  17. package/dist/components/MathPopover.vue.d.ts +15 -0
  18. package/dist/components/MentionNode.vue.d.ts +92 -0
  19. package/dist/components/MermaidBlockView.vue.d.ts +104 -0
  20. package/dist/components/PagelyEditor.vue.d.ts +119 -0
  21. package/dist/components/PagelyViewer.vue.d.ts +15 -0
  22. package/dist/components/SelectionToolbar.vue.d.ts +23 -0
  23. package/dist/components/TableActionMenu.vue.d.ts +28 -0
  24. package/dist/components/TableSizePicker.vue.d.ts +19 -0
  25. package/dist/components/TableTools.vue.d.ts +45 -0
  26. package/dist/composables/useBlockButton.d.ts +21 -0
  27. package/dist/composables/useBlockConvert.d.ts +4 -0
  28. package/dist/composables/useBlockImageExport.d.ts +4 -0
  29. package/dist/composables/useBlockMenu.d.ts +19 -0
  30. package/dist/composables/useBlockOps.d.ts +3 -0
  31. package/dist/composables/useCodeMirror.d.ts +30 -0
  32. package/dist/composables/useCommentAnchors.d.ts +60 -0
  33. package/dist/composables/useCommentEditor.d.ts +24 -0
  34. package/dist/composables/useEditorCommands.d.ts +22 -0
  35. package/dist/composables/useEditorEvents.d.ts +22 -0
  36. package/dist/composables/useEmbedView.d.ts +28 -0
  37. package/dist/composables/useFileUpload.d.ts +28 -0
  38. package/dist/composables/useHeadingCollapse.d.ts +19 -0
  39. package/dist/composables/useHoverMenu.d.ts +7 -0
  40. package/dist/composables/useInsertButton.d.ts +7 -0
  41. package/dist/composables/useInsertMenu.d.ts +17 -0
  42. package/dist/composables/useLinkHover.d.ts +3 -0
  43. package/dist/composables/useLinkOps.d.ts +32 -0
  44. package/dist/composables/useMarkdownSync.d.ts +12 -0
  45. package/dist/composables/useMath.d.ts +38 -0
  46. package/dist/composables/useMention.d.ts +20 -0
  47. package/dist/composables/useMenuPosition.d.ts +13 -0
  48. package/dist/composables/useMenuSidePanel.d.ts +27 -0
  49. package/dist/composables/useNodeViewCommentAttrs.d.ts +12 -0
  50. package/dist/composables/usePagelyEditor.d.ts +17 -0
  51. package/dist/composables/useSelectionToolbar.d.ts +3 -0
  52. package/dist/composables/useTableCellOps.d.ts +21 -0
  53. package/dist/composables/useTableDots.d.ts +60 -0
  54. package/dist/composables/useTableTools.d.ts +72 -0
  55. package/dist/config/blockMenu/index.d.ts +39 -0
  56. package/dist/config/blockMenu/items.d.ts +26 -0
  57. package/dist/config/blockMenu/profiles.d.ts +13 -0
  58. package/dist/config/blockMenu/sections.d.ts +8 -0
  59. package/dist/config/blockMenu/tagMapping.d.ts +9 -0
  60. package/dist/config/blockTypeConfig.d.ts +1 -0
  61. package/dist/config/extensionProfiles.d.ts +3 -0
  62. package/dist/config/insertMenu/blockCommands.d.ts +2 -0
  63. package/dist/config/insertMenu/cellOps.d.ts +22 -0
  64. package/dist/config/insertMenu/commands.d.ts +16 -0
  65. package/dist/config/insertMenu/index.d.ts +10 -0
  66. package/dist/config/insertMenu/items.d.ts +11 -0
  67. package/dist/config/insertMenu/sections.d.ts +15 -0
  68. package/dist/config/selectionToolbarConfig.d.ts +25 -0
  69. package/dist/config/selectionToolbarRules.d.ts +5 -0
  70. package/dist/extensions/AutoLinkTitle.d.ts +2 -0
  71. package/dist/extensions/CodeBlockCM.d.ts +7 -0
  72. package/dist/extensions/CommentBlock.d.ts +3 -0
  73. package/dist/extensions/CommentMark.d.ts +5 -0
  74. package/dist/extensions/CommentableTableView.d.ts +7 -0
  75. package/dist/extensions/DotFlowPadBlock.d.ts +2 -0
  76. package/dist/extensions/EmbedView.d.ts +12 -0
  77. package/dist/extensions/Image.d.ts +15 -0
  78. package/dist/extensions/Mathematics.d.ts +3 -0
  79. package/dist/extensions/Mention.d.ts +13 -0
  80. package/dist/extensions/MermaidBlock.d.ts +2 -0
  81. package/dist/extensions/SlashInsert.d.ts +5 -0
  82. package/dist/extensions/SmartPaste.d.ts +14 -0
  83. package/dist/extensions/TableCellEnter.d.ts +2 -0
  84. package/dist/index.d.ts +41 -0
  85. package/dist/pagely.cjs +318 -0
  86. package/dist/pagely.js +24519 -0
  87. package/dist/stores/linkState.d.ts +21 -0
  88. package/dist/style.css +1 -0
  89. package/dist/types/menuCommands.d.ts +42 -0
  90. package/dist/utils/attachmentUpload.d.ts +15 -0
  91. package/dist/utils/commentIds.d.ts +1 -0
  92. package/dist/utils/embedView/attrs.d.ts +19 -0
  93. package/dist/utils/embedView/detect.d.ts +14 -0
  94. package/dist/utils/embedView/downgrade.d.ts +1 -0
  95. package/dist/utils/embedView/markdown.d.ts +6 -0
  96. package/dist/utils/embedView/metadata.d.ts +8 -0
  97. package/dist/utils/embedView/pagelyPreview.d.ts +1 -0
  98. package/dist/utils/embedView/url.d.ts +10 -0
  99. package/dist/utils/markdown-converter/shared.d.ts +15 -0
  100. package/dist/utils/markdown-converter/toHtml.d.ts +1 -0
  101. package/dist/utils/markdown-converter/toMarkdown.d.ts +7 -0
  102. package/dist/utils/markdown-converter.d.ts +4 -0
  103. package/dist/utils/paste/context.d.ts +4 -0
  104. package/dist/utils/paste/escape.d.ts +2 -0
  105. package/dist/utils/paste/handlers/codeBlock.d.ts +2 -0
  106. package/dist/utils/paste/handlers/dotFlowPad.d.ts +2 -0
  107. package/dist/utils/paste/handlers/jsonCode.d.ts +2 -0
  108. package/dist/utils/paste/handlers/latexBlock.d.ts +2 -0
  109. package/dist/utils/paste/handlers/markdown.d.ts +2 -0
  110. package/dist/utils/paste/handlers/mermaid.d.ts +2 -0
  111. package/dist/utils/paste/handlers/richHtml.d.ts +2 -0
  112. package/dist/utils/paste/handlers/tsv.d.ts +2 -0
  113. package/dist/utils/paste/index.d.ts +10 -0
  114. package/dist/utils/paste/parsers/json.d.ts +5 -0
  115. package/dist/utils/paste/parsers/tsv.d.ts +5 -0
  116. package/dist/utils/paste/richHtml.d.ts +1 -0
  117. package/dist/utils/paste/sanitize.d.ts +1 -0
  118. package/dist/utils/paste/types.d.ts +12 -0
  119. package/dist/utils/tableAlign.d.ts +2 -0
  120. package/package.json +99 -0
@@ -0,0 +1,318 @@
1
+ "use strict";var Pc=Object.create;var Wa=Object.defineProperty;var Hc=Object.getOwnPropertyDescriptor;var Vc=Object.getOwnPropertyNames;var Fc=Object.getPrototypeOf,$c=Object.prototype.hasOwnProperty;var qc=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Vc(e))!$c.call(r,o)&&o!==t&&Wa(r,o,{get:()=>e[o],enumerable:!(n=Hc(e,o))||n.enumerable});return r};var lt=(r,e,t)=>(t=r!=null?Pc(Fc(r)):{},qc(e||!r||!r.__esModule?Wa(t,"default",{value:r,enumerable:!0}):t,r));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),_e=require("@tiptap/vue-3"),L=require("lucide-vue-next"),Me=require("@tiptap/core"),Vn=require("@tiptap/pm/model"),Uc=require("markdown-it"),Wc=require("turndown"),_c=require("@tiptap/starter-kit"),Kr=require("@tiptap/extension-table"),Gc=require("@tiptap/extension-task-list"),Kc=require("@tiptap/extension-task-item"),Yc=require("@tiptap/extension-color"),Jc=require("@tiptap/extension-highlight"),Xc=require("@tiptap/extension-text-style"),mr=require("@tiptap/pm/state");require("@fontsource/jetbrains-mono/400.css");require("@fontsource/jetbrains-mono/500.css");const rt=require("@codemirror/view"),tr=require("@codemirror/state"),yn=require("@codemirror/commands"),_r=require("@codemirror/language"),_a=require("@codemirror/autocomplete"),Ni=require("@tiptap/extension-mathematics"),Ga=require("dot-flow-pad"),jc=require("mermaid-smart-editor"),Qc=require("mermaid"),gl=require("@tiptap/pm/tables"),no=new Set(["P","H1","H2","H3","H4","H5","H6","PRE"]),Zc=new Set(["BLOCKQUOTE"]);function Lt(r,e){switch(e){case"P":r.setParagraph();break;case"H1":r.setHeading({level:1});break;case"H2":r.setHeading({level:2});break;case"H3":r.setHeading({level:3});break;case"H4":r.setHeading({level:4});break;case"H5":r.setHeading({level:5});break;case"H6":r.setHeading({level:6});break;case"UL":r.toggleBulletList();break;case"OL":r.toggleOrderedList();break;case"LI_TASK":r.toggleTaskList();break;case"PRE":r.setCodeBlock();break;case"BLOCKQUOTE":r.toggleBlockquote();break}}function ed(r,e,t,n){if(e!==t){if(no.has(e)){Lt(r,e);return}if(Zc.has(e)){n(),Lt(r,e);return}n(),Lt(r,e)}}function td(r,e){ed(r,e,"BLOCKQUOTE",()=>r.toggleBlockquote())}function rd(r,e){if(e!=="PRE"){if(no.has(e)){Lt(r,e);return}r.unsetCodeBlock(),Lt(r,e)}}function Li(r,e,t,n){e.forEach((o,l)=>{const i=t+1+l;(o.type.name==="bulletList"||o.type.name==="orderedList")&&(r.setNodeMarkup(i,n,o.attrs),o.forEach((s,u)=>{s.type.name==="listItem"&&Li(r,s,i+1+u,n)}))})}function nd(r,e){if(no.has(e)){r.liftListItem("listItem"),e!=="P"&&Lt(r,e);return}if(e==="LI_TASK"){r.liftListItem("listItem"),r.toggleTaskList();return}const t=e==="UL"?"bulletList":"orderedList";r.command(({tr:n,state:o})=>{const{$from:l}=o.selection,i=o.schema.nodes[t];if(!i)return!1;let s=-1;for(let p=l.depth;p>=0;p-=1)if(l.node(p).type.name==="listItem"){s=p;break}if(s<1)return!1;const u=l.before(s),d=l.node(s),m=l.node(s-1),h=l.before(s-1);return(m.type.name==="bulletList"||m.type.name==="orderedList")&&n.setNodeMarkup(h,i,m.attrs),Li(n,d,u,i),!0})}function od(r,e){if(e!=="LI_TASK"){if(no.has(e)){r.liftListItem("taskItem"),e!=="P"&&Lt(r,e);return}r.toggleTaskList(),e!=="P"&&Lt(r,e)}}const ld={text:Lt,blockquote:td,pre:rd,listItem:nd,taskItem:od},Kl={P:{id:"P",label:"正文",icon:L.Type},H1:{id:"H1",label:"一级标题",icon:L.Heading1},H2:{id:"H2",label:"二级标题",icon:L.Heading2},H3:{id:"H3",label:"三级标题",icon:L.Heading3},H4:{id:"H4",label:"四级标题",icon:L.Heading4},H5:{id:"H5",label:"五级标题",icon:L.Heading5},H6:{id:"H6",label:"六级标题",icon:L.Heading6},UL:{id:"UL",label:"无序列表",icon:L.List},OL:{id:"OL",label:"有序列表",icon:L.ListOrdered},LI_TASK:{id:"LI_TASK",label:"任务列表",icon:L.SquareCheckBig},PRE:{id:"PRE",label:"代码块",icon:L.CodeXml},BLOCKQUOTE:{id:"BLOCKQUOTE",label:"引用",icon:L.Quote},CUT_BLOCK:{id:"CUT_BLOCK",label:"剪切",icon:L.Scissors,action:"op",op:"cutBlock"},COPY_BLOCK:{id:"COPY_BLOCK",label:"复制",icon:L.Copy,action:"op",op:"copyBlock"},DELETE_BLOCK:{id:"DELETE_BLOCK",label:"删除",icon:L.Trash2,danger:!0,action:"op",op:"deleteBlock"},COPY_CODE:{id:"COPY_CODE",label:"复制代码",icon:L.Copy,action:"op",op:"copyCode"},DELETE_CODE_BLOCK:{id:"DELETE_CODE_BLOCK",label:"删除代码块",icon:L.Trash2,danger:!0,action:"op",op:"deleteCodeBlock"},COPY_CANVAS_CODE:{id:"COPY_CANVAS_CODE",label:"复制画板代码",icon:L.FileCode,action:"op",op:"copyCanvasCode"},COPY_CANVAS_IMAGE:{id:"COPY_CANVAS_IMAGE",label:"复制图片",icon:L.Image,action:"op",op:"copyCanvasImage"},CUT_TABLE:{id:"CUT_TABLE",label:"剪切",icon:L.Scissors,action:"op",op:"cutTable"},COPY_TABLE:{id:"COPY_TABLE",label:"复制",icon:L.Copy,action:"op",op:"copyTable"},TOGGLE_TABLE_HEADER_ROW:{id:"TOGGLE_TABLE_HEADER_ROW",label:"标题行",icon:L.Rows3,action:"op",op:"toggleTableHeaderRow",toggle:!0},TOGGLE_TABLE_HEADER_COL:{id:"TOGGLE_TABLE_HEADER_COL",label:"标题列",icon:L.Columns3,action:"op",op:"toggleTableHeaderColumn",toggle:!0},DELETE_TABLE:{id:"DELETE_TABLE",label:"删除",icon:L.Trash2,danger:!0,action:"op",op:"deleteTable"},INDENT_INC:{id:"INDENT_INC",label:"增加缩进",icon:L.Indent,action:"indent",indentDir:"inc"},INDENT_DEC:{id:"INDENT_DEC",label:"减少缩进",icon:L.Outdent,action:"indent",indentDir:"dec"},SUBMENU_INDENT_LIST:{id:"SUBMENU_INDENT_LIST",label:"缩进",icon:L.Indent,children:["INDENT_DEC","INDENT_INC"]},COLOR:{id:"COLOR",label:"颜色",icon:L.Palette,panel:"color"},CANVAS:{id:"CANVAS",label:"画板",icon:L.Workflow,description:"在文档中轻松画出清晰好看的示意图、结构图、流程图"},MERMAID:{id:"MERMAID",label:"Mermaid 图表",icon:L.GitBranch,description:"用文本语法描述流程图、时序图、甘特图等"}},ad={CONVERT_TILES:{style:"tiles",items:["P","H1","H2","H3","H4","H5","H6","UL","OL","LI_TASK","PRE","BLOCKQUOTE"]},DRAW:{style:"list",label:"绘图",items:["CANVAS","MERMAID"]},OPS:{style:"list",items:["COPY_BLOCK","DELETE_BLOCK"]},CODE_OPS:{style:"list",items:["COPY_CODE","DELETE_CODE_BLOCK"]},TABLE_OPS:{style:"list",items:["CUT_TABLE","COPY_TABLE","TOGGLE_TABLE_HEADER_ROW","TOGGLE_TABLE_HEADER_COL","DELETE_TABLE"]},INDENT_LIST:{style:"list",items:["SUBMENU_INDENT_LIST"]},COLOR_SECTION:{style:"list",items:["COLOR"]},CANVAS_OPS:{style:"list",items:["CUT_BLOCK","COPY_CANVAS_CODE","COPY_CANVAS_IMAGE","DELETE_BLOCK"]},IMAGE_OPS:{style:"list",items:["CUT_BLOCK","COPY_BLOCK","DELETE_BLOCK"]},EMBED_VIEW_OPS:{style:"list",items:["CUT_BLOCK","DELETE_BLOCK"]}},Ka=r=>r.firstElementChild??r,id={TEXT_LIKE:{sections:["CONVERT_TILES","COLOR_SECTION"],convert:"text"},HEADING:{sections:["CONVERT_TILES","COLOR_SECTION"],convert:"text"},BLOCKQUOTE:{sections:["CONVERT_TILES","OPS"],convert:"blockquote",isWrapper:!0,getPMDomTarget:r=>r.firstElementChild??r},TASK_ITEM:{sections:["CONVERT_TILES","INDENT_LIST","COLOR_SECTION"],currentTypeId:"LI_TASK",getRectEl:r=>r.querySelector(":scope > div")??r.firstElementChild??r,getPMDomTarget:r=>r.querySelector(":scope > div")??r.firstElementChild??r,convert:"taskItem"},LI:{sections:["CONVERT_TILES","INDENT_LIST","COLOR_SECTION"],getCurrentTypeId:r=>{var e;return((e=r.parentElement)==null?void 0:e.tagName.toUpperCase())??"UL"},getRectEl:Ka,getPMDomTarget:Ka,convert:"listItem"},PRE:{sections:["CONVERT_TILES","CODE_OPS"],convert:"pre"},TABLE:{sections:["TABLE_OPS"]},TABLE_CELL:{sections:["OPS"]},MINIMAL:{sections:["OPS"]},MERMAID:{sections:["CODE_OPS"]},CANVAS:{sections:["CANVAS_OPS"]},IMAGE:{sections:["IMAGE_OPS"]},EMBED_VIEW:{sections:["EMBED_VIEW_OPS"]}},sd={P:"TEXT_LIKE",H1:"HEADING",H2:"HEADING",H3:"HEADING",H4:"HEADING",H5:"HEADING",H6:"HEADING",BLOCKQUOTE:"BLOCKQUOTE",TASK_ITEM:"TASK_ITEM",LI:"LI",PRE:"PRE",TABLE:"TABLE",TD:"TABLE_CELL",TH:"TABLE_CELL",HR:"MINIMAL",DOT_FLOW_PAD_BLOCK:"CANVAS",MERMAID_BLOCK:"MERMAID",IMG:"IMAGE",BLOCK_MATH:"MINIMAL",EMBED_VIEW:"EMBED_VIEW"},Ii={P:{label:"正文",icon:L.Type,pillVariant:"text"},H1:{label:"标题 1",icon:L.Heading1,pillVariant:"text"},H2:{label:"标题 2",icon:L.Heading2,pillVariant:"text"},H3:{label:"标题 3",icon:L.Heading3,pillVariant:"text"},H4:{label:"标题 4",icon:L.Heading4,pillVariant:"text"},H5:{label:"标题 5",icon:L.Heading5,pillVariant:"text"},H6:{label:"标题 6",icon:L.Heading6,pillVariant:"text"},PRE:{label:"代码块",icon:L.CodeXml,pillVariant:"text"},BLOCKQUOTE:{label:"引用",icon:L.Quote,pillVariant:"text"},TASK_ITEM:{label:"任务项",icon:L.SquareCheckBig,pillVariant:"text"},LI:{label:"列表项",icon:L.List,pillVariant:"text"},TABLE:{label:"表格",icon:L.Grid2x2,pillVariant:"table"},TD:{label:"单元格",icon:L.Grid2x2,pillVariant:"minimal"},TH:{label:"表头格",icon:L.Grid2x2,pillVariant:"minimal"},HR:{label:"分割线",icon:L.Minus,pillVariant:"minimal"},MERMAID_BLOCK:{label:"Mermaid 图表",icon:L.GitBranch,pillVariant:"minimal"},DOT_FLOW_PAD_BLOCK:{label:"画板",icon:L.Workflow,pillVariant:"minimal"},IMG:{label:"图片",icon:L.Image,pillVariant:"minimal"},BLOCK_MATH:{label:"公式",icon:L.Type,pillVariant:"minimal"},EMBED_VIEW:{label:"预览",icon:L.FileText,pillVariant:"text"}};function ud(r){return{label:r.label,style:r.style,items:r.items.map(e=>Kl[e])}}function zr(r){const e=r.toUpperCase(),t=Ii[e]??cd,n=id[sd[e]??"MINIMAL"];return{...t,sections:n.sections.map(o=>ud(ad[o])),getRectEl:n.getRectEl,getPMDomTarget:n.getPMDomTarget,applyConvert:n.convert?ld[n.convert]:void 0,currentTypeId:n.currentTypeId,getCurrentTypeId:n.getCurrentTypeId,isWrapper:n.isWrapper}}const cd={label:"块",icon:L.Type,pillVariant:"text"},ur=Object.fromEntries(Object.keys(Ii).map(r=>[r,zr(r)]));ur.P??(ur.P=zr("P"));const dd=8,fd=[r=>r.closest("td, th"),(r,e)=>{const t=r.closest(".tableWrapper"),n=t==null?void 0:t.querySelector("table");return n&&e.contains(n)?n:null},(r,e)=>{if(r.tagName==="UL"||r.tagName==="OL")return null;const t=r.closest("li");return t&&e.contains(t)?t:null},(r,e)=>{let t=r;for(;t&&t.parentElement!==e;){if(t===e)return null;t=t.parentElement}return!t||t===e||t.tagName==="UL"||t.tagName==="OL"?null:t}];function md(r,e){if(r===e)return null;for(const t of fd){const n=t(r,e);if(n)return n}return null}function hd(r,e){var n;let t=e;for(;t&&t.parentElement!==r;)t=t.parentElement;return((n=t??r.firstElementChild)==null?void 0:n.tagName.toUpperCase())??null}function Ya(r){var n;const e=r.dataset.type;if(e==="code-block")return"PRE";if(e==="mermaid-block")return"MERMAID_BLOCK";if(e==="dot-flow-pad")return"DOT_FLOW_PAD_BLOCK";if(e==="block-math")return"BLOCK_MATH";if(e==="image-block")return"IMG";if(e==="embed-view")return"EMBED_VIEW";const t=r.tagName.toUpperCase();return t==="LI"&&((n=r.parentElement)==null?void 0:n.dataset.type)==="taskList"?"TASK_ITEM":t}function zi(r,e){const t=a.ref(!1),n=a.reactive({}),o=a.reactive({tag:"P",label:"正文",currentTypeIds:["P"]});let l=null;function i(h){var W,H,A;const p=r.value;if(!p)return;const v=p.querySelector(".ProseMirror");if(!v)return;const b=h.target;if((W=b.closest)!=null&&W.call(b,".block-btn-overlay")||!v.contains(b))return;const w=md(b,v);if(!w)return;l=w;const k=Ya(w),T=zr(k),M=(((H=T.getRectEl)==null?void 0:H.call(T,w))??w).getBoundingClientRect(),B=w.closest("td, th"),D=B?B.getBoundingClientRect().left:M.left;n.top=`${M.top+M.height/2}px`,n.left=`${D-dd}px`,o.tag=k,o.label=T.label;const z=T.currentTypeId??((A=T.getCurrentTypeId)==null?void 0:A.call(T,w))??k;if(T.isWrapper){const R=hd(w,b);o.currentTypeIds=R?[z,R]:[z]}else o.currentTypeIds=[z];t.value=!0}function s(){u()}function u(){t.value=!1,l=null}function d(){var h;if(!l||!e.value)return null;try{const p=Ya(l),v=zr(p),b=((h=v.getPMDomTarget)==null?void 0:h.call(v,l))??l,w=e.value.view.posAtDOM(b,0);if(b!==l)return w;const k=w-1;return k>=0&&e.value.state.doc.nodeAt(k)?k:e.value.state.doc.nodeAt(w)?w:k}catch{return null}}function m(){if(!l||!e.value)return null;try{const h=e.value.view.posAtDOM(l,0),p=h-1;return p>=0&&e.value.state.doc.nodeAt(p)?p:e.value.state.doc.nodeAt(h)?h:p>=0?p:null}catch{return null}}return{overlayVisible:t,overlayStyle:n,blockInfo:o,onMouseMove:i,onMouseLeave:s,getCurrentBlockEl:()=>l,getCurrentBlockPMPos:d,getCurrentBlockRootPMPos:m}}function wn(r,e,t){return Math.max(e,Math.min(r,t))}function Yl(r,e,t,n=4,o=0){const l=window.innerWidth,i=window.innerHeight,s=8,u=Math.max(s,l-e-s),d=Math.max(s,i-o-s),m=M=>M>=s&&M+e<=l-s,h=M=>o<=0||M>=s&&M+o<=i-s,p=r.left-n-e,v=r.left+r.width+n,b=r.top+r.height+n,w=r.top-o-n;function k(M){const B=M==="left"?p:v;return m(B)?{top:wn(r.top,s,d),left:B,placement:M}:null}function T(M){const B=M==="below"?b:w;return h(B)?{top:B,left:wn(r.left,s,u),placement:M}:null}const E=t==="left"?["left","right","below","above"]:t==="right"?["right","left","below","above"]:t==="above"?["above","below","right","left"]:["below","above","right","left"];for(const M of E){const B=M==="left"||M==="right"?k(M):T(M);if(B)return B}return{top:wn(t==="above"?w:b,s,d),left:wn(t==="left"?p:t==="right"?v:r.left,s,u),placement:t}}const Gt=224,oo=4,Ja=8,pd=32,un=120;function Di(r){return r==="below"?"translateY(-4px)":r==="above"?"translateY(4px)":r==="right"?"translateX(-4px)":"translateX(4px)"}function gd(r,e){const t=window.innerHeight-e-Ja,n=r-e/2;return Math.max(Ja,Math.min(n,t))}function Jl(r){const e=a.ref(null),t=a.ref(0),n=a.ref(0),o=a.ref(!1);let l=null;function i(){l&&(clearTimeout(l),l=null)}function s(){i(),e.value=null,o.value=!1,t.value=0,n.value=0}function u(b,w){var M;i(),e.value=b,o.value=!1;const k=w.currentTarget,T=k==null?void 0:k.getBoundingClientRect(),E=(M=k==null?void 0:k.closest(r.rootSelector))==null?void 0:M.getBoundingClientRect();T&&(t.value=gd(T.top+T.height/2,r.estimatedHeight())),E&&(n.value=E.right)}function d(){s()}function m(){l||(l=setTimeout(()=>{o.value||(e.value=null),l=null},r.closeDelay??un))}function h(){o.value=!0,i()}function p(){o.value=!1,m()}const v=a.computed(()=>({position:"fixed",top:`${t.value||r.fallbackTop()}px`,left:`${n.value||r.fallbackLeft()}px`,zIndex:"301"}));return a.watch(r.visible,b=>{b&&s()}),a.onBeforeUnmount(()=>{i()}),{rootId:e,hovered:o,style:v,open:u,close:d,scheduleClose:m,clearCloseTimer:i,onPanelMouseEnter:h,onPanelMouseLeave:p}}const vd=400;function Oi(r,e,t,n,o){const l=a.ref(!1),i=a.ref(0),s=a.ref(0),u=a.ref("left"),d=a.ref(null),m=a.ref("P");let h=null;function p(){h&&(clearTimeout(h),h=null)}function v(){l.value=!1}function b(){const D=d.value;D!==null&&r.value&&r.value.chain().focus().setTextSelection(D+1).run()}function w(){d.value=e(),m.value=n(),o(),p(),b();const D=t();if(!D)return;const z=Yl({top:D.top,left:D.left,width:D.width,height:D.height},Gt,"left",oo,vd);i.value=z.top,s.value=z.left,u.value=z.placement,l.value=!0}function k(){h||(h=setTimeout(()=>{l.value=!1,h=null},un))}function T(){p(),w()}function E(D){var W;const z=D==null?void 0:D.relatedTarget;(W=z==null?void 0:z.closest)!=null&&W.call(z,".pagely-block-menu, .pagely-block-submenu, .pagely-hover-preview")||k()}function M(){p()}function B(){k()}return a.onBeforeUnmount(p),{visible:l,top:i,left:s,placement:u,targetPos:d,sourceTag:m,open:w,close:v,focusTarget:b,onPillEnter:T,onPillLeave:E,onMenuEnter:M,onMenuLeave:B,clearHideTimer:p}}function We(r){if(Array.isArray(r))return r.filter(e=>typeof e=="string"&&e.length>0);if(typeof r!="string"||r.length===0)return[];try{const e=JSON.parse(r);return Array.isArray(e)?e.filter(t=>typeof t=="string"&&t.length>0):[]}catch{return[]}}function bd(r){return Array.from(new Set(r.filter(e=>e.length>0)))}function Ri(r,e){return bd([...r,e])}function Pi(r,e){return r.filter(t=>t!==e)}const Xa=20;function Hi(r){const e=r.trim().replace(/\s+/g," ");return e?e.length>Xa?`${e.slice(0,Xa)}…`:e:""}function Vi(r){return r.type.name==="table"?"[表格]":r.type.name==="tableRow"?"[行]":r.type.name==="tableCell"||r.type.name==="tableHeader"?"[单元格]":r.type.name==="codeBlock"?"[代码块]":r.type.name==="blockMath"?"[公式]":r.type.name==="image"?"[图片]":r.type.name==="mermaidBlock"?"[Mermaid 图表]":r.type.name==="dotFlowPadBlock"?"[画板]":r.type.name==="embedView"?String(r.attrs.label||r.attrs.href||"[嵌入内容]"):null}function Xl(r){const e=Vi(r);if(e)return e;const t=r.textContent.trim().replace(/\s+/g," ");return t||`[${r.type.name}]`}function Fi(r){const e=Vi(r);if(e)return e;const t=Xl(r);return t===`[${r.type.name}]`?t:Hi(t)}function yd(r){const e=new Set;return r.descendants(t=>{const n=We(t.attrs.commentIds);for(const o of n)e.add(o);for(const o of t.marks)if(o.type.name==="commentMark")for(const l of We(o.attrs.commentIds))e.add(l);return!0}),e}function ja(r,e,t,n){const o=r.doc.type.schema.marks.commentMark;if(!o||t<0||n>r.doc.content.size||t>=n)return!1;const l=[];r.doc.nodesBetween(t,n,(i,s)=>{if(!i.isText)return!0;const u=Math.max(t,s),d=Math.min(n,s+i.nodeSize);if(u>=d)return!1;const m=i.marks.find(h=>h.type===o);return l.push({from:u,to:d,commentIds:Ri(We(m==null?void 0:m.attrs.commentIds),e)}),!1});for(const i of l)r.removeMark(i.from,i.to,o),r.addMark(i.from,i.to,o.create({commentIds:i.commentIds}));return l.length>0}function wd(r,e){const t=r.doc.type.schema.marks.commentMark;if(!t)return!1;const n=[];r.doc.descendants((o,l)=>{if(!o.isText)return!0;const i=o.marks.find(u=>u.type===t),s=We(i==null?void 0:i.attrs.commentIds);return s.includes(e)&&n.push({from:l,to:l+o.nodeSize,commentIds:Pi(s,e)}),!1});for(const o of n)r.removeMark(o.from,o.to,t),o.commentIds.length>0&&r.addMark(o.from,o.to,t.create({commentIds:o.commentIds}));return n.length>0}function kd(r){const e=r.doc.type.schema.marks.commentMark;if(!e)return!1;const t=[];r.doc.descendants((n,o)=>n.isText?(n.marks.some(l=>l.type===e)&&t.push({from:o,to:o+n.nodeSize}),!1):!0);for(const n of t)r.removeMark(n.from,n.to,e);return t.length>0}function Qa(r,e,t){if(t<0||t>r.doc.content.size)return!1;const n=r.doc.nodeAt(t);if(!n||n.isText)return!1;const o=Ri(We(n.attrs.commentIds),e);return r.setNodeMarkup(t,void 0,{...n.attrs,commentIds:o},n.marks),!0}function xd(r,e){const t=[];r.doc.descendants((n,o)=>{if(n.isText)return!0;const l=We(n.attrs.commentIds);return l.includes(e)&&t.push({pos:o,node:n,commentIds:Pi(l,e)}),!0});for(const n of t)r.setNodeMarkup(n.pos,void 0,{...n.node.attrs,commentIds:n.commentIds},n.node.marks);return t.length>0}function Cd(r){const e=[];r.doc.descendants((t,n)=>(t.isText||We(t.attrs.commentIds).length>0&&e.push({pos:n,node:t}),!0));for(const t of e)r.setNodeMarkup(t.pos,void 0,{...t.node.attrs,commentIds:[]},t.node.marks);return e.length>0}function Oo(r,e){if(!(r instanceof Element))return null;const t=r.closest(".pagely-comment-inline, .pagely-comment-block");return t&&e.contains(t)?t:null}function Za(r){return We(r.getAttribute("data-comment-ids"))}function Td(r,e){const t=r.view.nodeDOM(e);return t instanceof HTMLElement?t.getBoundingClientRect():Me.posToDOMRect(r.view,e,e+1)}function Ed(r,e){return e.from<0||e.to>r.content.size||e.from>=e.to?!1:e.text?r.textBetween(e.from,e.to,"")===e.text:!0}function Sd(r,e){if(typeof e.nodePos!="number"||e.nodePos<0||e.nodePos>r.content.size)return!1;const t=r.nodeAt(e.nodePos);if(!t||t.isText||e.nodeType&&t.type.name!==e.nodeType)return!1;const n=e.fullText??e.text;return!(n&&Xl(t)!==n&&Fi(t)!==n)}function Ro(r){const e=new Map,t=[],n=r.state.schema.marks.commentMark;return r.state.doc.descendants((o,l)=>{if(o.isText){const s=n?o.marks.find(d=>d.type===n):null,u=We(s==null?void 0:s.attrs.commentIds);for(const d of u){const m=e.get(d)??[];m.push({from:l,to:l+o.nodeSize,text:o.text??""}),e.set(d,m)}return!1}const i=We(o.attrs.commentIds);for(const s of i)t.push({id:s,kind:"block",nodePos:l,nodeType:o.type.name,text:Fi(o),fullText:Xl(o)});return!0}),[...Array.from(e.entries()).map(([o,l])=>({id:o,kind:"inline",ranges:l,text:Hi(l.map(i=>i.text).join(""))})),...t]}function $i(r,e={}){let t,n=null,o=new Set,l=null;const i=new Set;let s="",u=null;function d(){const A=e.enabled;return typeof A=="boolean"?A:A&&typeof A=="object"&&"value"in A?A.value:!0}function m(){const A=r.value;return A?Ro(A):[]}function h(){l&&(clearTimeout(l),l=null)}function p(A){return JSON.stringify(A)}function v(A){return new Set(A.map(R=>R.id))}function b(A){u=A,h(),l=setTimeout(()=>{var K;l=null;const R=u??m();u=null,(K=e.onAnchorsChanged)==null||K.call(e,R)},300)}function w(A){var te;if(!d()||!A.transaction.docChanged)return;const R=Ro(A.editor),K=v(R);for(const Z of o)K.has(Z)||i.has(Z)||(te=e.onOrphaned)==null||te.call(e,{commentId:Z});i.clear(),o=K;const J=p(R);J!==s&&(s=J,b(R))}function k(A){var J;if(!d()||!t)return;const R=Oo(A.target,t.view.dom);if(!R)return;const K=Za(R);K.length!==0&&((J=e.onClick)==null||J.call(e,{commentIds:K,rect:R.getBoundingClientRect()}))}function T(A){var J;if(!d()||!t)return;const R=Oo(A.target,t.view.dom);if(!R)return;const K=Za(R);K.length>0&&((J=e.onHover)==null||J.call(e,{commentIds:K}))}function E(A){var K;if(!d()||!t)return;const R=Oo(A.target,t.view.dom);R&&(A.relatedTarget instanceof Node&&R.contains(A.relatedTarget)||(K=e.onHover)==null||K.call(e,null))}function M(A){t&&(t.off("transaction",w),n==null||n.removeEventListener("click",k),n==null||n.removeEventListener("mouseover",T),n==null||n.removeEventListener("mouseout",E)),t=A,n=null;const R=A?Ro(A):[];o=v(R),s=p(R),u=null,i.clear(),A&&(A.on("transaction",w),n=A.view.dom,n.addEventListener("click",k),n.addEventListener("mouseover",T),n.addEventListener("mouseout",E))}a.watch(r,M,{immediate:!0}),a.onBeforeUnmount(()=>{h(),M(void 0)});function B(A,R){const K=r.value;if(!K||!d())return!1;const J=K.state.tr;return!(R.kind==="inline"?ja(J,A,R.from,R.to):Qa(J,A,R.nodePos))||!J.docChanged?!1:(J.setMeta("addToHistory",!1),K.view.dispatch(J),!0)}function D(A){const R=r.value;if(!R)return!1;const K=R.state.tr,J=wd(K,A),te=xd(K,A);return!J&&!te?!1:(i.add(A),K.setMeta("addToHistory",!1),R.view.dispatch(K),!0)}function z(A){var le;const R=r.value;if(!R||!d())return!1;const K=[],J=[],te=new Set;for(const ee of A)if(ee.kind==="inline")for(const we of ee.ranges??[])Ed(R.state.doc,we)?K.push({id:ee.id,range:we}):te.add(ee.id);else Sd(R.state.doc,ee)?J.push({id:ee.id,nodePos:ee.nodePos}):te.add(ee.id);for(const ee of te)(le=e.onAnchorDrift)==null||le.call(e,{commentId:ee});if(A.length>0&&K.length===0&&J.length===0)return!1;const Z=R.state.tr;for(const ee of yd(R.state.doc))i.add(ee);kd(Z),Cd(Z);for(const ee of K)ja(Z,ee.id,ee.range.from,ee.range.to);for(const ee of J)Qa(Z,ee.id,ee.nodePos);return Z.docChanged?(Z.setMeta("addToHistory",!1),R.view.dispatch(Z),!0):!1}function W(A){var Z;const R=r.value;if(!R||!d())return!1;const{from:K,to:J,empty:te}=R.state.selection;return te||K>=J?!1:((Z=e.onCreate)==null||Z.call(e,{kind:"inline",from:K,to:J,rect:A??Me.posToDOMRect(R.view,K,J)}),!0)}function H(A,R){var J;const K=r.value;return!K||!d()?!1:((J=e.onCreate)==null||J.call(e,{kind:"block",nodePos:A,rect:R??Td(K,A)}),!0)}return{getCommentAnchors:m,applyCommentAnchors:z,addComment:B,removeCommentAnchor:D,requestInlineComment:W,requestBlockComment:H}}function Md(r){let e=!1,t=!1;function n(h){var v,b;const p=!!((b=(v=h.target).closest)!=null&&b.call(v,"td, th"));!e&&!t&&(p?(r.onBlockMouseLeave(),r.clearInsertButton()):(r.onBlockMouseMove(h),r.updateInsertButton())),r.onTableMouseMove(h)}function o(h){var w;const p=h.relatedTarget,v=document.querySelector(".block-btn-overlay"),b=document.querySelector(".pagely-insert-menu");v!=null&&v.contains(p)||b!=null&&b.contains(p)||(w=p==null?void 0:p.closest)!=null&&w.call(p,".table-tools-overlay")||(r.onBlockMouseLeave(),r.clearInsertButton(),r.scheduleTableHide())}function l(){e=!0,r.onBlockMouseLeave(),r.clearInsertButton(),r.closeBlockMenu(),r.closeInsertMenu()}function i(){e=!1}function s(){}function u(){!r.isBlockMenuVisible()&&!r.isInsertMenuVisible()&&(r.onBlockMouseLeave(),r.clearInsertButton())}function d(h){(h.ctrlKey||h.metaKey)&&h.shiftKey&&h.key.toLowerCase()==="v"&&(window.__pagelySkipNextPaste=!0),h.key==="Escape"&&(r.closeBlockMenu(),r.closeInsertMenu())}function m(h){t=h}return{onMove:n,onLeave:o,onEditorMouseDown:l,onDocMouseUp:i,onOverlayEnter:s,onOverlayLeave:u,onKeyDown:d,setHasSelection:m}}const qi={H1:{id:"H1",label:"一级标题",icon:L.Heading1},H2:{id:"H2",label:"二级标题",icon:L.Heading2},H3:{id:"H3",label:"三级标题",icon:L.Heading3},H4:{id:"H4",label:"四级标题",icon:L.Heading4},H5:{id:"H5",label:"五级标题",icon:L.Heading5},H6:{id:"H6",label:"六级标题",icon:L.Heading6},OL:{id:"OL",label:"有序列表",icon:L.ListOrdered},UL:{id:"UL",label:"无序列表",icon:L.List},TASK:{id:"TASK",label:"任务列表",icon:L.SquareCheckBig},PRE:{id:"PRE",label:"代码块",icon:L.CodeXml},BLOCKQUOTE:{id:"BLOCKQUOTE",label:"引用",icon:L.Quote},HR:{id:"HR",label:"分割线",icon:L.SeparatorHorizontal},FORMULA:{id:"FORMULA",label:"公式",icon:L.Sigma},COMMENT:{id:"COMMENT",label:"评论",icon:L.MessageSquare},IMAGE:{id:"IMAGE",label:"图片",icon:L.Image},FILE:{id:"FILE",label:"文件",icon:L.FileText},LINK:{id:"LINK",label:"链接",icon:L.Link2},CANVAS:{id:"CANVAS",label:"画板",icon:L.Workflow},MERMAID:{id:"MERMAID",label:"Mermaid 图表",icon:L.GitBranch},TABLE:{id:"TABLE",label:"表格",icon:L.Table,picker:"table"}},Ad=["H1","H2","H3","H4","H5","H6","OL","UL","TASK","PRE","BLOCKQUOTE","HR"],Ui=[{label:"基础",style:"tiles",items:Ad},{label:"常用",style:"list",items:["FORMULA","IMAGE","FILE","LINK","TABLE"]},{label:"绘图",style:"list",items:["CANVAS","MERMAID"]}],Wi=[{label:"常用",style:"list",items:["COMMENT","FORMULA"]}];function _i(r){return r.map(e=>({...e,items:e.items.map(t=>qi[t])}))}const Gi=_i(Ui),Ki=_i(Wi);function jl(r){const e=r.trim();if(!e)return"";try{return new URL(e).pathname||e}catch{return e.split(/[?#]/,1)[0]??e}}function Bd(r){const e=r.trim();if(!e)return null;try{const t=new URL(e);return t.protocol!=="blob:"?t:new URL(e.slice(5))}catch{return null}}function e0(r){var o;const n=(jl(r).split("/").filter(Boolean).pop()??"").match(/\.([a-z0-9]+)$/i);return((o=n==null?void 0:n[1])==null?void 0:o.toLowerCase())??""}function Nd(r){try{return new URL(r.trim()).protocol==="blob:"}catch{return!1}}function Dr(r){const e=Bd(r);return(e==null?void 0:e.host)||r}function Fn(r){const e=r.trim();if(!e)return"";let t=jl(e);try{t=new URL(e).pathname||e}catch{}const n=t.split("/").filter(Boolean).pop()??e;try{return decodeURIComponent(n)}catch{return n}}const Ld=new Set(["pdf","md","markdown","html","htm","txt","text","png","jpg","jpeg","gif","webp","svg","bmp","avif"]);function $n(r){const e=jl(r);return/\.pdf$/i.test(e)?"pdf":/\.(md|markdown)$/i.test(e)?"md":"url"}function Yi(r,e){const t=$n(r);return t==="url"&&e?$n(e):t}function Id(r,e=""){const t=Yi(r,e);return t==="pdf"?"card":t==="md"?"preview":"link"}function en(r,e=""){const t=$n(r),n=$n(e);if(t==="pdf"||t==="md"||n==="pdf"||n==="md")return!0;const o=e0(e)||e0(r);return o?Ld.has(o):Nd(r)?!1:Hr(r)}function Hr(r){const e=r.trim();if(!e)return!1;try{const t=new URL(e,"https://pagely.local/");if(t.protocol==="http:"||t.protocol==="https:")return!0;if(t.protocol!=="blob:")return!1;const n=new URL(e.slice(5));return n.protocol==="http:"||n.protocol==="https:"}catch{return!1}}const zd=new Set(["link","card","preview"]);function Dd(r,e,t){if(zd.has(t)){const o=t;return o==="preview"&&!en(r,e)?"link":o}const n=Id(r,e);return n==="preview"&&!en(r,e)?"link":n}function cr(r){var o,l;const e=((o=r.href)==null?void 0:o.trim())??"";if(!Hr(e))return null;const n=(((l=r.label)==null?void 0:l.trim())??"")||Fn(e)||e;return{href:e,label:n,view:Dd(e,n,r.preferredView)}}const or={H1:r=>r.setHeading({level:1}),H2:r=>r.setHeading({level:2}),H3:r=>r.setHeading({level:3}),H4:r=>r.setHeading({level:4}),H5:r=>r.setHeading({level:5}),H6:r=>r.setHeading({level:6}),OL:r=>r.toggleOrderedList(),UL:r=>r.toggleBulletList(),TASK:r=>r.toggleTaskList(),PRE:r=>r.setCodeBlock(),BLOCKQUOTE:r=>r.toggleBlockquote(),HR:r=>r.setHorizontalRule(),FORMULA:(r,e)=>r.insertInlineMath({latex:"\\placeholder",...(e==null?void 0:e.pos)!==void 0?{pos:e.pos}:{}}),COMMENT:()=>{},IMAGE:(r,e)=>{e!=null&&e.src&&r.insertImage({src:e.src,alt:e.alt??null,title:e.title??null})},FILE:(r,e)=>{const t=cr({href:(e==null?void 0:e.href)??"",label:(e==null?void 0:e.label)??(e==null?void 0:e.text)??"",preferredView:e==null?void 0:e.view});t&&r.insertEmbedView(t)},LINK:(r,e)=>{var o,l;const t=(o=e==null?void 0:e.href)==null?void 0:o.trim();if(!t)return;const n=((l=e==null?void 0:e.text)==null?void 0:l.trim())||t;r.insertContent({type:"text",text:n,marks:[{type:"link",attrs:{href:t,target:"_blank"}}]})},CANVAS:r=>r.insertDotFlowPadBlock(),MERMAID:r=>r.insertMermaidBlock(),TABLE:(r,e)=>r.insertTable({rows:(e==null?void 0:e.rows)??4,cols:(e==null?void 0:e.cols)??4,withHeaderRow:!0})},Ji={CANVAS:r=>r.insertDotFlowPadBlock(),MERMAID:r=>r.insertMermaidBlock()},xr={rowBefore:{id:"rowBefore",label:"在上方插入行",icon:L.ArrowUpToLine,kind:"cell-op"},rowAfter:{id:"rowAfter",label:"在下方插入行",icon:L.ArrowDownToLine,kind:"cell-op"},colBefore:{id:"colBefore",label:"在左侧插入列",icon:L.ArrowLeftToLine,kind:"cell-op"},colAfter:{id:"colAfter",label:"在右侧插入列",icon:L.ArrowRightToLine,kind:"cell-op"},delRow:{id:"delRow",label:"删除当前行",icon:L.Trash2,danger:!0,kind:"cell-op"},delCol:{id:"delCol",label:"删除当前列",icon:L.Trash2,danger:!0,kind:"cell-op"}},Od=[{label:"行列操作",style:"list",items:[xr.rowBefore,xr.rowAfter,xr.colBefore,xr.colAfter]},{label:"",style:"list",items:[xr.delRow,xr.delCol]}],Xi=[...Ki,...Od];function Vt(r){return"kind"in r&&r.kind==="cell-op"}function ji(r){const{$from:e}=r.state.selection;let t=0;for(let n=0;n<=e.depth;n++){const o=e.node(n).type.name;(o==="listItem"||o==="taskItem")&&t++}return t}function Qi(r){return r?!!(r.can().sinkListItem("listItem")||r.can().sinkListItem("taskItem")):!1}function Zi(r){return r?ji(r)>=2:!1}function es(r){r.can().sinkListItem("listItem")?r.chain().focus().sinkListItem("listItem").run():r.can().sinkListItem("taskItem")&&r.chain().focus().sinkListItem("taskItem").run()}function ts(r){ji(r)<2||(r.isActive("taskItem")?r.chain().focus().liftListItem("taskItem").run():r.chain().focus().liftListItem("listItem").run())}const Rd=["svg.lf-canvas-overlay",".lf-graph svg.lf-canvas-overlay",".lf-container svg.lf-canvas-overlay",".lf-container svg"];function t0(r){if(r.classList.contains("lucide")||r.closest(".eb-toolbar, .dfp-preview-overlay, .floating-left-bar, .canvas-extra-controls, .status-bar, .lf-control"))return!1;const e=r.getBoundingClientRect();return e.width>16&&e.height>16}function rs(r){if(!r)return null;for(const e of Rd){const t=r.querySelector(e);if(t&&t0(t))return t}return Array.from(r.querySelectorAll("svg")).find(e=>t0(e))??null}function lo(){function r(t){var o;const n="http://www.w3.org/2000/svg";for(const l of Array.from(t.querySelectorAll("foreignObject"))){const i=(o=l.textContent)==null?void 0:o.replace(/\s+/g," ").trim();if(!i){l.remove();continue}const s=Number(l.getAttribute("x"))||0,u=Number(l.getAttribute("y"))||0,d=Number(l.getAttribute("width"))||0,m=Number(l.getAttribute("height"))||0,h=document.createElementNS(n,"text");h.setAttribute("x",String(s+d/2)),h.setAttribute("y",String(u+m/2)),h.setAttribute("text-anchor","middle"),h.setAttribute("dominant-baseline","middle"),h.setAttribute("font-family","Arial, sans-serif"),h.setAttribute("font-size","14"),h.setAttribute("fill","#333"),h.textContent=i,l.replaceWith(h)}}async function e(t,n=2){var o;try{if(!("ClipboardItem"in window)||!((o=navigator.clipboard)!=null&&o.write))return!1;const l=t();if(!l)return!1;const i=l.getBoundingClientRect(),s=l.getAttribute("viewBox"),u=(s==null?void 0:s.split(/[\s,]+/).map(Number))??[],d=i.width||Number(l.getAttribute("width"))||u[2]||1,m=i.height||Number(l.getAttribute("height"))||u[3]||1,h=l.cloneNode(!0);r(h),h.setAttribute("xmlns","http://www.w3.org/2000/svg"),h.setAttribute("width",String(d)),h.setAttribute("height",String(m)),h.getAttribute("viewBox")||h.setAttribute("viewBox",`0 0 ${d} ${m}`);const p=new XMLSerializer().serializeToString(h),v=new Blob([p],{type:"image/svg+xml;charset=utf-8"}),b=URL.createObjectURL(v);try{const w=new Image,k=new Promise((B,D)=>{w.onload=()=>B(),w.onerror=()=>D(new Error("Failed to load SVG for PNG export"))});w.src=b,await k;const T=document.createElement("canvas");T.width=Math.max(1,Math.ceil(d*n)),T.height=Math.max(1,Math.ceil(m*n));const E=T.getContext("2d");if(!E)return!1;E.setTransform(n,0,0,n,0,0),E.fillStyle="#fff",E.fillRect(0,0,d,m),E.drawImage(w,0,0,d,m);const M=await new Promise(B=>{T.toBlob(B,"image/png")});return M?(await navigator.clipboard.write([new ClipboardItem({"image/png":M})]),!0):!1}finally{URL.revokeObjectURL(b)}}catch{return!1}}return{copyPngToClipboard:e}}function hr(r,e){const t=r.state.doc.nodeAt(e);return t?{node:t,from:e,to:e+t.nodeSize}:null}async function qn(r){if(r)try{await navigator.clipboard.writeText(r)}catch{}}async function ao(r,e){var t;try{return!("ClipboardItem"in window)||!((t=navigator.clipboard)!=null&&t.write)?(await qn(e),!0):(await navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([r],{type:"text/html"}),"text/plain":new Blob([e],{type:"text/plain"})})]),!0)}catch{return await qn(e),!1}}function io(r,e,t){const n=r.state.doc.slice(e,t),l=Vn.DOMSerializer.fromSchema(r.schema).serializeFragment(n.content),i=document.createElement("div");return i.appendChild(l),i.innerHTML}function so(r,e){if(r.type.name==="image"){const t=r.attrs.src;if(typeof t=="string"&&t)return t}return r.textContent||e}function Pd(r,e){const t=hr(r,e);if(!t)return;const n=io(r,t.from,t.to);ao(n,so(t.node,n))}function Hd(r,e){const t=hr(r,e);!t||t.node.type.name!=="codeBlock"||qn(t.node.textContent)}function Vd(r,e){const t=hr(r,e);t&&r.chain().focus().deleteRange({from:t.from,to:t.to}).run()}function Fd(r,e){const t=hr(r,e);!t||t.node.type.name!=="codeBlock"||r.chain().focus().deleteRange({from:t.from,to:t.to}).run()}function $d(r,e){const t=hr(r,e);if(!t)return;const n=io(r,t.from,t.to),o=so(t.node,n);ao(n,o),r.chain().focus().deleteRange({from:t.from,to:t.to}).run()}function cn(r,e){const t=r.state.doc.nodeAt(e);if((t==null?void 0:t.type.name)==="table")return{node:t,from:e,to:e+t.nodeSize};try{const n=r.state.doc.resolve(e+1);for(let o=n.depth;o>=0;o--){const l=n.node(o);if(l.type.name==="table"){const i=n.before(o);return{node:l,from:i,to:i+l.nodeSize}}}}catch{return null}return null}function ns(r,e){let t=e+1;return r.descendants((n,o)=>n.isTextblock?(t=e+1+o+1,!1):!0),t}function qd(r,e){const t=cn(r,e);if(!t)return;const n=io(r,t.from,t.to);ao(n,so(t.node,n))}function Ud(r,e){const t=cn(r,e);if(!t)return;const n=io(r,t.from,t.to),o=so(t.node,n);ao(n,o),r.chain().focus().deleteRange({from:t.from,to:t.to}).run()}function Wd(r,e){const t=hr(r,e);if(!t||t.node.type.name!=="dotFlowPadBlock")return;const n=t.node.attrs.data;typeof n=="string"&&qn(n)}function _d(r,e){const t=hr(r,e);if(!t||t.node.type.name!=="dotFlowPadBlock")return;const n=r.view.nodeDOM(e);if(!n)return;const{copyPngToClipboard:o}=lo();o(()=>rs(n))}function Gd(r,e){const t=cn(r,e);t&&r.chain().focus().deleteRange({from:t.from,to:t.to}).run()}function Kd(r,e){const t=cn(r,e);t&&r.chain().focus().setTextSelection(ns(t.node,t.from)).toggleHeaderRow().run()}function Yd(r,e){const t=cn(r,e);t&&r.chain().focus().setTextSelection(ns(t.node,t.from)).toggleHeaderColumn().run()}const Po={copyBlock:Pd,copyCode:Hd,copyCanvasCode:Wd,copyCanvasImage:_d,copyTable:qd,cutTable:Ud,cutBlock:$d,deleteBlock:Vd,deleteCodeBlock:Fd,deleteTable:Gd,toggleTableHeaderRow:Kd,toggleTableHeaderColumn:Yd};function vl(r,e,t){var n;e!==null&&((n=Po[t])==null||n.call(Po,r,e))}function os(r){function e(i,s){try{const d=i.state.doc.resolve(s).parent;return d.type.name==="paragraph"&&d.content.size===0}catch{return!1}}function t(i,s){var p;const u=r.editor.value;if(!u)return;const d=u.chain().focus(),m=r.insertTargetPos.value,h=m!==null?m+1:void 0;if(h!==void 0&&d.setTextSelection(h),i==="FORMULA"){r.closeInsertMenu();const v=h??u.state.selection.from,b=e(u,v)?"block":"inline";r.openMathPopoverForInsert(v,r.getMathRectAtPos(v),b);return}(p=or[i])==null||p.call(or,d,{...s,pos:h}),d.run(),r.closeInsertMenu()}function n(i){var m;const s=r.editor.value;if(!s)return;r.focusHoveredCell();const u=s.state.selection.from;if(i==="FORMULA"){r.openMathPopoverForInsert(u,r.getMathRectAtPos(u),"inline");return}const d=s.chain().focus();(m=or[i])==null||m.call(or,d,{pos:u}),d.run()}function o(i){var s,u;(u=(s=r.cellOps)[i])==null||u.call(s)}function l(i){var v;const s=r.editor.value;if(!s)return;const u=Kl[i];if((u==null?void 0:u.action)==="indent"&&u.indentDir){r.focusBlockTarget(),u.indentDir==="inc"?es(s):ts(s),r.closeBlockMenu();return}if((u==null?void 0:u.action)==="op"&&u.op){vl(s,r.blockTargetPos.value,u.op),r.closeBlockMenu();return}const d=Ji[i];if(d){const b=s.chain().focus(),w=r.blockTargetPos.value;w!==null&&b.setTextSelection(w+1),d(b),b.run(),r.closeBlockMenu();return}const m=r.blockTargetPos.value,h=zr(r.blockSourceTag.value),p=s.chain().focus();m!==null&&p.setTextSelection(m+1),(v=h.applyConvert)==null||v.call(h,p,i),p.run(),r.closeBlockMenu()}return{onInsert:t,onCellInsert:n,onCellOp:o,onConvert:l}}function ls(r,e,t){const n=a.ref(!1);function o(){var s;const i=t();n.value=(i==null?void 0:i.tagName.toUpperCase())==="P"&&((s=i.textContent)==null?void 0:s.trim())===""}function l(){n.value=!1}return{isEmptyParagraph:n,updateFromCurrentBlock:o,clear:l}}const Jd=220;function as(r,e,t){const n=a.ref(!1),o=a.ref(0),l=a.ref(0),i=a.ref("left"),s=a.ref(null);let u=null;function d(){u&&(clearTimeout(u),u=null)}function m(){u||(u=setTimeout(()=>{n.value=!1,u=null},un))}function h(M,B,D){s.value=M,t(),d();const z=Yl(B,Gt,D,oo,Jd);o.value=z.top,l.value=z.left,i.value=z.placement,n.value=!0}function p(){const M=r();if(M===null)return;const B=e();B&&h(M,{top:B.top,left:B.left,width:B.width,height:B.height},"left")}function v(M,B){h(M,{top:B.top,left:B.left,width:B.width,height:B.height},"below")}function b(){d(),p()}function w(M){var D;const B=M.relatedTarget;(D=B==null?void 0:B.closest)!=null&&D.call(B,".pagely-insert-menu")||m()}function k(){d()}function T(){m()}function E(){n.value=!1}return a.onBeforeUnmount(d),{visible:n,top:o,left:l,placement:i,targetPos:s,openFromButton:p,openFromSlash:v,onButtonEnter:b,onButtonLeave:w,onMenuEnter:k,onMenuLeave:T,close:E,scheduleClose:m,clearHideTimer:d}}function Xd(r){const e=a.ref(!1),t=a.ref(null),n=a.ref(""),o=a.ref(null),l=a.ref("insert"),i=a.ref("inline");function s(b){var T;const w=(T=r.value)==null?void 0:T.view;if(!w)return null;const k=w.coordsAtPos(b);return new DOMRect(k.left,k.top,k.right-k.left,k.bottom-k.top)}function u(b,w,k="inline"){var E;const T=(E=r.value)==null?void 0:E.view.nodeDOM(w);t.value=(T==null?void 0:T.getBoundingClientRect())??s(w),n.value=b.attrs.latex,o.value=w,l.value="edit",i.value=k,e.value=!0}function d(b,w,k="inline"){t.value=w??s(b),n.value="",o.value=b,l.value="insert",i.value=k,e.value=!0}function m(){e.value=!1}function h(b){if(m(),!r.value||o.value===null)return;const w=b.trim();if(!w)return;const k=r.value.chain().focus(),T={latex:w,pos:o.value};l.value==="insert"?i.value==="block"?k.insertBlockMath(T):k.insertInlineMath(T):i.value==="block"?k.updateBlockMath(T):k.updateInlineMath(T),k.run()}function p(b){!e.value||o.value===null||(o.value=b.mapping.map(o.value,l.value==="insert"?1:-1))}function v(b){p(b.transaction);for(const w of b.appendedTransactions)p(w)}return a.onMounted(()=>{var b;(b=r.value)==null||b.on("transaction",v)}),a.onBeforeUnmount(()=>{var b;(b=r.value)==null||b.off("transaction",v)}),{visible:e,anchorRect:t,initialLatex:n,openForEdit:u,openForInsert:d,confirm:h,close:m,rectAtPos:s}}function jd(r){const{$from:e}=r.state.selection;for(let t=e.depth;t>0;t-=1)if(e.node(t).type.name==="codeBlock")return!0;return!1}function Ho(r){const{selection:e,doc:t}=r.state;if(!e.empty||jd(r))return null;const{$from:n}=e,o=n.start(),l=t.textBetween(o,e.from,`
2
+ `,"\0"),i=/(?:^|\s)@([^\s@]*)$/.exec(l);if(!i)return null;const s=i[1]??"",u=o+l.length-s.length-1;return{query:s,from:u,to:e.from}}function Qd(r,e){const t=`@${e.displayName}`,n=e.from+t.length;if(e.from>=0&&n<=r.content.size&&r.textBetween(e.from,n,"")===t)return{from:e.from,to:n};const o=[];return r.descendants((l,i)=>{if(!l.isText||!l.text)return!0;let s=l.text.indexOf(t);for(;s>=0;){const u=i+s;o.push({from:u,to:u+t.length,distance:Math.abs(u-e.from)}),s=l.text.indexOf(t,s+t.length)}return!0}),o.sort((l,i)=>l.distance-i.distance),o[0]??null}function is(r,e={}){let t,n=null,o="",l=null,i=null,s=!1;function u(k,T=!1){var B;const E=k?Ho(k):null,M=(E==null?void 0:E.from)??(l==null?void 0:l.from)??null;s&&((B=e.onCancel)==null||B.call(e)),o="",l=null,s=!1,i=T?M:null}function d(k){var M;const T=Ho(k);if(!T){u();return}if(i===T.from)return;const E=`${T.from}:${T.to}:${T.query}`;l={from:T.from,to:T.to},E!==o&&(o=E,s=!0,(M=e.onTrigger)==null||M.call(e,{query:T.query,rect:Me.posToDOMRect(k.view,T.from,T.to)}))}function m(k){!k.transaction.docChanged&&!k.transaction.selectionSet||d(k.editor)}function h(k){t&&(k.key!=="Escape"&&k.key!=="Enter"&&k.key!==" "||u(t,k.key==="Escape"))}function p(k){t&&(t.off("transaction",m),n==null||n.removeEventListener("keydown",h,!0)),t=k,n=null,o="",l=null,i=null,s=!1,k&&(k.on("transaction",m),n=k.view.dom,n.addEventListener("keydown",h,!0))}a.watch(r,p,{immediate:!0}),a.onBeforeUnmount(()=>{p(void 0)});function v(k){const T=r.value;if(!T)return!1;const E=Ho(T),M=E?{from:E.from,to:E.to}:l;return l=null,o="",i=null,s=!1,M?T.chain().focus().insertContentAt(M,[{type:"mention",attrs:k},{type:"text",text:" "}]).run():T.commands.insertMention(k)}function b(){const k=r.value;if(!k)return[];const T=[];return k.state.doc.descendants((E,M)=>E.type.name!=="mention"?!0:(T.push({userId:String(E.attrs.userId??""),displayName:String(E.attrs.displayName??""),from:M,to:M+E.nodeSize}),!1)),T}function w(k){const T=r.value,E=T==null?void 0:T.state.schema.nodes.mention;if(!T||!E)return!1;let M=T.state.tr;for(const B of[...k].sort((D,z)=>z.from-D.from)){const D=Qd(M.doc,B);D&&(M=M.replaceWith(D.from,D.to,E.create({userId:B.userId,displayName:B.displayName})))}return M.docChanged?(M.setMeta("addToHistory",!1),T.view.dispatch(M),!0):!1}return{insertMention:v,getMentions:b,applyMentions:w}}const Zd={js:"javascript",ts:"typescript",py:"python",rb:"ruby",md:"markdown",sh:"bash",zsh:"bash",yml:"yaml",tf:"hcl"};function ss(r){const e=r.toLowerCase().trim();return Zd[e]??e}function r0(r){try{return JSON.stringify(JSON.parse(r))}catch{return r}}function e1(r,e){const n=(`${r}
3
+ ${e}`.match(/`+/g)??[]).reduce((l,i)=>Math.max(l,i.length),0),o="`".repeat(Math.max(3,n+1));return`${o}${r}
4
+ ${e}
5
+ ${o}`}function us(r,e){const t=r.extractBody(e);return`
6
+ ${e1(r.lang,t)}
7
+ `}const Ql=[{lang:"mermaid",dataType:"mermaid-block",htmlTag:"pre",extractBody:r=>(r.textContent??"").trim(),buildHtml:(r,e)=>`<pre data-type="mermaid-block">${e(r)}</pre>
8
+ `},{lang:"logicflow",dataType:"dot-flow-pad",htmlTag:"div",extractBody:r=>r0(r.getAttribute("data-graph")??'{"nodes":[],"edges":[]}'),buildHtml:(r,e)=>{const t=r0(r.trim());return`<div data-type="dot-flow-pad" data-graph="${e(t)}"></div>
9
+ `}}];function cs(r){const e=r;return Ql.find(t=>{var n;return r.nodeName===t.htmlTag.toUpperCase()&&((n=e.getAttribute)==null?void 0:n.call(e,"data-type"))===t.dataType})??null}function n0(r){return r.replace(/[&<>"']/g,e=>{switch(e){case"&":return"&amp;";case"<":return"&lt;";case">":return"&gt;";case'"':return"&quot;";case"'":return"&#39;";default:return e}})}function bl(r){return r.nodeName==="SPAN"&&r.getAttribute("data-type")==="inline-math"?r.getAttribute("data-latex")??r.textContent??"":null}function yl(r){var e;return r.nodeName==="DIV"&&((e=r.getAttribute)==null?void 0:e.call(r,"data-type"))==="block-math"?r.getAttribute("data-latex")??"":null}function t1(r){return r===0}function r1(r){let e=0,t=r.length;for(;e<t&&r[e].type==="text"&&r[e].content.trim()==="";)e++;for(;t>e&&r[t-1].type==="text"&&r[t-1].content.trim()==="";)t--;return r.slice(e,t)}function n1(r){return r.replace(/\\/g,"\\\\").replace(/\[/g,"\\[").replace(/\]/g,"\\]").replace(/\r?\n/g," ").trim()}function o1(r){return r.replace(/\)/g,"%29").trim()}function l1(r){r.core.ruler.push("embed_view",e=>{var t;for(let n=0;n<e.tokens.length-2;n++){const o=e.tokens[n],l=e.tokens[n+1],i=e.tokens[n+2];if(o.type!=="paragraph_open"||!t1(o.level)||l.type!=="inline"||!l.children||i.type!=="paragraph_close")continue;const s=r1(l.children);if(s.length!==3)continue;const[u,d,m]=s;if(u.type!=="link_open"||d.type!=="text"||m.type!=="link_close")continue;const h=((t=u.attrGet("href"))==null?void 0:t.trim())??"",p=d.content.trim();if(!h||!p)continue;const v=cr({href:h,label:p});if(!v)continue;const b=new e.Token("html_block","",0);b.block=!0,b.content=`<div data-type="embed-view" data-view="${v.view}" data-href="${r.utils.escapeHtml(v.href)}">${r.utils.escapeHtml(v.label)}</div>
10
+ `,e.tokens.splice(n,3,b)}})}const a1={name:"embedView",filter:r=>r.nodeName==="DIV"&&r.getAttribute("data-type")==="embed-view",replacement:(r,e)=>{var l;const t=e,n=((l=t.getAttribute("data-href"))==null?void 0:l.trim())??"";return n?`
11
+
12
+ [${n1(t.textContent||n)||n}](${o1(n)})
13
+
14
+ `:""}};let Vo=null;function i1(){if(Vo)return Vo;const r=Vo=new Uc({html:!0,linkify:!0,typographer:!1});l1(r);const e=new Map(Ql.map(n=>[n.lang,n])),t=r.utils.escapeHtml.bind(r.utils);return r.renderer.rules.fence=(n,o)=>{const l=n[o],i=l.info?ss(l.info.trim()):"plaintext",s=e.get(i);if(s)return s.buildHtml(l.content,t);const u=t(l.content);return`<pre><code class="language-${i}">${u}</code></pre>
15
+ `},r.core.ruler.push("math_block",n=>{for(let o=0;o<n.tokens.length;o++){if(n.tokens[o].type!=="paragraph_open")continue;const i=n.tokens[o+1],s=n.tokens[o+2];if(!i||i.type!=="inline"||!s||s.type!=="paragraph_close")continue;const u=i.content.match(/^\$\$([\s\S]+?)\$\$$/);if(!u)continue;const d=n0(u[1].trim()),m=new n.Token("html_block","",0);m.content=`<div data-type="block-math" data-latex="${d}"></div>
16
+ `,n.tokens.splice(o,3,m)}}),r.core.ruler.push("math_inline",n=>{for(const o of n.tokens)o.type!=="inline"||!o.children||(o.children=o.children.flatMap(l=>l.type!=="text"?[l]:l.content.split(/(\$(?!\d+\$)[^$\n]+?\$(?!\d))/g).map(s=>{const u=s.match(/^\$(?!\d+\$)([^$\n]+?)\$(?!\d)$/);if(u){const m=new n.Token("html_inline","",0),h=n0(u[1]);return m.content=`<span data-type="inline-math" data-latex="${h}">${h}</span>`,m}const d=new n.Token("text","",0);return d.content=s,d})))}),r}function dn(r){return r.trim()?i1().render(r):""}function Vr(r){var n,o,l;const e=r.getAttribute("align");if(e==="left"||e==="center"||e==="right")return e;const t=(l=(o=(n=r.getAttribute("style"))==null?void 0:n.match(/text-align\s*:\s*(left|center|right)/i))==null?void 0:o[1])==null?void 0:l.toLowerCase();return t==="left"||t==="center"||t==="right"?t:null}function o0(r){let e=r.parentNode;for(;e;){if(e.nodeName==="LI")return!0;e=e.parentNode}return!1}const s1=new Set(["UL","OL","PRE","BLOCKQUOTE","HR","H1","H2","H3","H4","H5","H6"]),u1=new Set(["mermaid-block","block-math","dot-flow-pad","dot-flow-pad-block","embed-view","taskList","taskItem"]),c1=new Set(["data-type","data-latex","data-checked","data-href","data-language","data-view","data-graph","align","href","src","alt","title"]);function d1(r){return Array.from(r.querySelectorAll("*")).some(t=>{if(s1.has(t.tagName))return!0;const n=t.getAttribute("data-type");return n!==null&&u1.has(n)})}function f1(r){return Array.from(r.querySelectorAll("th, td")).some(d1)}function m1(r,e){const t=r.cloneNode(!0);for(const o of Array.from(t.querySelectorAll('span[data-type="inline-math"][data-latex]'))){const l=o.getAttribute("data-latex")??o.textContent??"",i=o.previousSibling,s=o.nextSibling,u=i?"PAGELYCELLSPACE":"",d=s?"PAGELYCELLSPACE":"";(i==null?void 0:i.nodeType)===3&&(i.nodeValue=(i.nodeValue??"").replace(/\s+$/,"")),(s==null?void 0:s.nodeType)===3&&(s.nodeValue=(s.nodeValue??"").replace(/^\s+/,"")),o.replaceWith(t.ownerDocument.createTextNode(`${u}$${l}$${d}`))}for(const o of Array.from(t.querySelectorAll("br")))o.replaceWith(t.ownerDocument.createTextNode("PAGELYBRK"));return e.turndown(t.innerHTML).replace(/PAGELYCELLSPACE/g," ").replace(/PAGELYBRK/g,"<br>").replace(/\r?\n/g," ").replace(/\|/g,"\\|").trim()}function h1(r){return r.name==="class"?r.value.split(/\s+/).some(e=>e.startsWith("language-")):c1.has(r.name)}function p1(r){var n;const e=r.cloneNode(!0);for(const o of Array.from(e.querySelectorAll("colgroup")))o.remove();for(const o of Array.from(e.querySelectorAll('li[data-type="taskItem"]'))){for(const l of Array.from(o.children))l.tagName==="LABEL"&&l.remove();for(const l of Array.from(o.children))if(l.tagName==="DIV"){for(;l.firstChild;)o.insertBefore(l.firstChild,l);l.remove()}}for(const o of Array.from(e.querySelectorAll("th > p, td > p")))!((n=o.textContent)!=null&&n.trim())&&o.children.length===0&&o.remove();const t=[e,...Array.from(e.querySelectorAll("*"))];for(const o of t){if(o.tagName==="TD"||o.tagName==="TH"){const i=Vr(o);for(const s of Array.from(o.attributes))if(s.name!=="align"){if(s.name==="class"){const u=s.value.split(/\s+/).filter(d=>d.startsWith("language-"));u.length?o.setAttribute("class",u.join(" ")):o.removeAttribute("class");continue}o.removeAttribute(s.name)}i?o.setAttribute("align",i):o.removeAttribute("align");continue}for(const i of Array.from(o.attributes))if(!h1(i)){o.removeAttribute(i.name);continue}const l=o.getAttribute("class");if(l!==null){const i=l.split(/\s+/).filter(s=>s.startsWith("language-"));i.length?o.setAttribute("class",i.join(" ")):o.removeAttribute("class")}}return e.outerHTML}function g1(r){return[...Ql.map(n=>({name:`${n.lang}Block`,filter:o=>cs(o)===n,replacement:(o,l)=>us(n,l)})),a1,{name:"strikethrough",filter:["del","s","strike"],replacement:n=>`~~${n}~~`},{name:"codeBlock",filter:n=>n.nodeName==="PRE"&&n.getAttribute("data-type")==="code-block",replacement:(n,o)=>{var u;const l=o,i=l.getAttribute("data-language")??"plaintext",s=((u=l.querySelector("code"))==null?void 0:u.textContent)??"";return`
17
+ \`\`\`${i}
18
+ ${s}
19
+ \`\`\`
20
+ `}},{name:"taskItem",filter:n=>n.nodeName==="LI"&&n.getAttribute("data-type")==="taskItem",replacement:(n,o)=>{const l=o,i=l.getAttribute("data-checked")==="true",s=l.querySelector("div"),u=(s?s.textContent:l.textContent)??"";return`- ${i?"[x]":"[ ]"} ${u.trim()}
21
+ `}},{name:"taskList",filter:n=>n.nodeName==="UL"&&n.getAttribute("data-type")==="taskList",replacement:n=>`
22
+ ${n}
23
+ `},{name:"listItem",filter:"li",replacement:(n,o,l)=>{var s;n=n.replace(/^\n+/,"").replace(/\n+$/,`
24
+ `).replace(/\n/gm,`
25
+ `);const i=o.parentNode;if((i==null?void 0:i.nodeName)==="OL"){const u=parseInt(((s=i.getAttribute)==null?void 0:s.call(i,"start"))??"1")||1,m=Array.from(i.childNodes).filter(h=>h.nodeName==="LI").indexOf(o);return`${u+m}. ${n}${o.nextSibling?`
26
+ `:""}`}return`${l.bulletListMarker} ${n}${o.nextSibling?`
27
+ `:""}`}},{name:"pInsideLi",filter:n=>n.nodeName==="P"&&o0(n),replacement:n=>`${n}
28
+ `},{name:"brInsideLi",filter:n=>n.nodeName==="BR"&&o0(n),replacement:()=>`
29
+ `},{name:"table",filter:"table",replacement:(n,o)=>{const l=o;if(f1(l))return`
30
+
31
+ ${p1(l)}
32
+
33
+ `;const i=Array.from(l.querySelectorAll("tr"));if(!i.length)return"";const s=b=>Array.from(b.querySelectorAll("th, td")).map(w=>m1(w,r)),u=b=>Array.from(b.querySelectorAll(":scope > th, :scope > td")).map(w=>{switch(Vr(w)){case"left":return":---";case"center":return":---:";case"right":return"---:";default:return"---"}}),d=i[0],m=d.querySelector("th")!==null,h=s(d).length,p=u(d),v=[];if(m){v.push("| "+s(d).join(" | ")+" |"),v.push("| "+(p.length===h?p:Array(h).fill("---")).join(" | ")+" |");for(let b=1;b<i.length;b++)v.push("| "+s(i[b]).join(" | ")+" |")}else{v.push("| "+Array(h).fill("").join(" | ")+" |"),v.push("| "+(p.length===h?p:Array(h).fill("---")).join(" | ")+" |");for(const b of i)v.push("| "+s(b).join(" | ")+" |")}return`
34
+
35
+ `+v.join(`
36
+ `)+`
37
+
38
+ `}},{name:"tableCell",filter:["th","td"],replacement:n=>n},{name:"tableRow",filter:"tr",replacement:n=>n},{name:"tableBody",filter:["thead","tbody","tfoot"],replacement:n=>n},{name:"blockMath",filter:n=>yl(n)!==null,replacement:(n,o)=>`
39
+
40
+ $$${yl(o)??""}$$
41
+
42
+ `},{name:"inlineMath",filter:n=>bl(n)!==null,replacement:(n,o)=>`$${bl(o)??""}$`}]}let Cr=null;function v1(){if(Cr)return Cr;Cr=new Wc({headingStyle:"atx",codeBlockStyle:"fenced",hr:"---",bulletListMarker:"-",blankReplacement:(r,e)=>{const t=cs(e);if(t)return us(t,e);const n=yl(e);if(n!==null)return`
43
+
44
+ $$${n}$$
45
+
46
+ `;const o=bl(e);return o!==null?`$${o}$`:""}});for(const{name:r,...e}of[...g1(Cr)].reverse())Cr.addRule(r,e);return Cr}function Un(r){return!r||r==="<p></p>"?"":v1().turndown(r)}const b1=new Set(["P","BR","SPAN","DIV","H1","H2","H3","H4","H5","H6","UL","OL","LI","STRONG","B","EM","I","U","S","CODE","PRE","BLOCKQUOTE","HR","A","IMG","TABLE","THEAD","TBODY","TR","TD","TH"]),y1={A:new Set(["href","title"]),DIV:new Set(["data-type","data-view","data-href","data-latex","data-graph"]),IMG:new Set(["src","alt","title"]),LI:new Set(["data-type","data-checked"]),PRE:new Set(["data-type","data-language"]),SPAN:new Set(["data-type","data-latex","data-mention-user-id","data-mention-display-name"]),UL:new Set(["data-type"])},w1=new Set(["SCRIPT","STYLE","META","LINK","HEAD"]);function Wn(r){const e=document.createElement("template");e.innerHTML=r;for(const t of Array.from(e.content.querySelectorAll("table")))x1(t);return wl(e.content),e.innerHTML.trim()}function wl(r){for(let e=r.childNodes.length-1;e>=0;e--){const t=r.childNodes[e];if(t.nodeType!==Node.ELEMENT_NODE)continue;const n=t,o=n.tagName;if(w1.has(o)){n.remove();continue}if(!b1.has(o)){for(wl(n);n.firstChild;)r.insertBefore(n.firstChild,n);n.remove();continue}k1(n),wl(n)}}function k1(r){if(r.tagName==="TD"||r.tagName==="TH"){const t=Vr(r);for(const n of Array.from(r.attributes)){if(n.name.startsWith("on")){r.removeAttribute(n.name);continue}if(n.name!=="align"){if(n.name==="class"){const o=n.value.split(/\s+/).find(l=>l.startsWith("language-"));o?r.setAttribute("class",o):r.removeAttribute("class");continue}r.removeAttribute(n.name)}}t?r.setAttribute("align",t):r.removeAttribute("align");return}const e=y1[r.tagName];for(const t of Array.from(r.attributes)){if(t.name.startsWith("on")){r.removeAttribute(t.name);continue}if(t.name==="class"){const n=t.value.split(/\s+/).find(o=>o.startsWith("language-"));n?r.setAttribute("class",n):r.removeAttribute("class");continue}(!e||!e.has(t.name))&&r.removeAttribute(t.name)}r.tagName==="DIV"&&r.getAttribute("data-type")==="embed-view"&&!Hr(r.getAttribute("data-href")??"")&&(r.removeAttribute("data-type"),r.removeAttribute("data-view"),r.removeAttribute("data-href"))}function x1(r){var l,i;const e=Array.from(r.querySelectorAll(":scope > tr, :scope > thead > tr, :scope > tbody > tr, :scope > tfoot > tr"));if(!e.length)return;const t=[];function n(s,u){t[s]??(t[s]=[]);let d=u;for(;t[s][d];)d++;return d}for(let s=0;s<e.length;s++){const u=e[s],d=Array.from(u.children).filter(h=>h instanceof HTMLTableCellElement&&(h.tagName==="TD"||h.tagName==="TH"));let m=0;for(const h of d){const p=Math.max(1,Number(h.getAttribute("colspan")||"1")||1),v=Math.max(1,Number(h.getAttribute("rowspan")||"1")||1),b=n(s,m),w=Vr(h),k={cell:h,row:s,col:b,rowspan:v,colspan:p,align:w};for(let T=s;T<s+v;T++){t[T]??(t[T]=[]);for(let E=b;E<b+p;E++)t[T][E]=k}m=b+p}}const o=t.reduce((s,u)=>Math.max(s,u.length),0);for(const s of e)for(;s.firstChild;)s.removeChild(s.firstChild);for(let s=0;s<e.length;s++){const u=e[s],d=((l=u.parentElement)==null?void 0:l.tagName)==="THEAD"||u.querySelector("th")?"th":"td";for(let m=0;m<o;m++){const h=(i=t[s])==null?void 0:i[m];if(!h){u.appendChild(r.ownerDocument.createElement(d));continue}if(h.row===s&&h.col===m){h.cell.removeAttribute("colspan"),h.cell.removeAttribute("rowspan"),h.align?h.cell.setAttribute("align",h.align):h.cell.removeAttribute("align"),u.appendChild(h.cell);continue}const p=r.ownerDocument.createElement(h.cell.tagName.toLowerCase());h.align&&p.setAttribute("align",h.align),u.appendChild(p)}}}function ds(r,e,t=300){const n=a.ref(!1);let o=null;function l(){o&&(clearTimeout(o),o=null)}function i(h){l(),o=setTimeout(()=>{o=null,e("update:markdown",Un(h))},t)}function s(){var h;return((h=r())==null?void 0:h.getHTML())??""}function u(){return Un(s())}function d(h){const p=r();p&&(n.value=!0,p.chain().setMeta("addToHistory",!1).setContent(Wn(dn(h)),{emitUpdate:!1}).run(),a.nextTick(()=>{n.value=!1}))}function m(h){const p=r();p&&(n.value=!0,p.chain().setMeta("addToHistory",!1).setContent(Wn(h),{emitUpdate:!1}).run(),a.nextTick(()=>{n.value=!1}))}return a.onBeforeUnmount(l),{isSettingContent:n,scheduleMarkdownEmit:i,getHtml:s,getMarkdown:u,setMarkdown:d,setHtml:m}}function fs(r,e,t){for(let n=0;;n++){if(n==r.childCount||n==e.childCount)return r.childCount==e.childCount?null:t;let o=r.child(n),l=e.child(n);if(o==l){t+=o.nodeSize;continue}if(!o.sameMarkup(l))return t;if(o.isText&&o.text!=l.text){for(let i=0;o.text[i]==l.text[i];i++)t++;return t}if(o.content.size||l.content.size){let i=fs(o.content,l.content,t+1);if(i!=null)return i}t+=o.nodeSize}}function ms(r,e,t,n){for(let o=r.childCount,l=e.childCount;;){if(o==0||l==0)return o==l?null:{a:t,b:n};let i=r.child(--o),s=e.child(--l),u=i.nodeSize;if(i==s){t-=u,n-=u;continue}if(!i.sameMarkup(s))return{a:t,b:n};if(i.isText&&i.text!=s.text){let d=0,m=Math.min(i.text.length,s.text.length);for(;d<m&&i.text[i.text.length-d-1]==s.text[s.text.length-d-1];)d++,t--,n--;return{a:t,b:n}}if(i.content.size||s.content.size){let d=ms(i.content,s.content,t-1,n-1);if(d)return d}t-=u,n-=u}}class be{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,t,n,o=0,l){for(let i=0,s=0;s<t;i++){let u=this.content[i],d=s+u.nodeSize;if(d>e&&n(u,o+s,l||null,i)!==!1&&u.content.size){let m=s+1;u.nodesBetween(Math.max(0,e-m),Math.min(u.content.size,t-m),n,o+m)}s=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,o){let l="",i=!0;return this.nodesBetween(e,t,(s,u)=>{let d=s.isText?s.text.slice(Math.max(e,u)-u,t-u):s.isLeaf?o?typeof o=="function"?o(s):o:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&d||s.isTextblock)&&n&&(i?i=!1:l+=n),l+=d},0),l}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,o=this.content.slice(),l=0;for(t.isText&&t.sameMarkup(n)&&(o[o.length-1]=t.withText(t.text+n.text),l=1);l<e.content.length;l++)o.push(e.content[l]);return new be(o,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let n=[],o=0;if(t>e)for(let l=0,i=0;i<t;l++){let s=this.content[l],u=i+s.nodeSize;u>e&&((i<e||u>t)&&(s.isText?s=s.cut(Math.max(0,e-i),Math.min(s.text.length,t-i)):s=s.cut(Math.max(0,e-i-1),Math.min(s.content.size,t-i-1))),n.push(s),o+=s.nodeSize),i=u}return new be(n,o)}cutByIndex(e,t){return e==t?be.empty:e==0&&t==this.content.length?this:new be(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let o=this.content.slice(),l=this.size+t.nodeSize-n.nodeSize;return o[e]=t,new be(o,l)}addToStart(e){return new be([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new be(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let o=this.content[t];e(o,n,t),n+=o.nodeSize}}findDiffStart(e,t=0){return fs(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return ms(this,e,t,n)}findIndex(e){if(e==0)return kn(0,e);if(e==this.size)return kn(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let o=this.child(t),l=n+o.nodeSize;if(l>=e)return l==e?kn(t+1,l):kn(t,n);n=l}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return be.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new be(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return be.empty;let t,n=0;for(let o=0;o<e.length;o++){let l=e[o];n+=l.nodeSize,o&&l.isText&&e[o-1].sameMarkup(l)?(t||(t=e.slice(0,o)),t[t.length-1]=l.withText(t[t.length-1].text+l.text)):t&&t.push(l)}return new be(t||e,n)}static from(e){if(!e)return be.empty;if(e instanceof be)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new be([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}be.empty=new be([],0);const Fo={index:0,offset:0};function kn(r,e){return Fo.index=r,Fo.offset=e,Fo}function kl(r,e){if(r===e)return!0;if(!(r&&typeof r=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(r);if(Array.isArray(e)!=t)return!1;if(t){if(r.length!=e.length)return!1;for(let n=0;n<r.length;n++)if(!kl(r[n],e[n]))return!1}else{for(let n in r)if(!(n in e)||!kl(r[n],e[n]))return!1;for(let n in e)if(!(n in r))return!1}return!0}class mt{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let o=0;o<e.length;o++){let l=e[o];if(this.eq(l))return e;if(this.type.excludes(l.type))t||(t=e.slice(0,o));else{if(l.type.excludes(this.type))return e;!n&&l.type.rank>this.type.rank&&(t||(t=e.slice(0,o)),t.push(this),n=!0),t&&t.push(l)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&kl(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw new RangeError(`There is no mark type ${t.type} in this schema`);let o=n.create(t.attrs);return n.checkAttrs(o.attrs),o}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return mt.none;if(e instanceof mt)return[e];let t=e.slice();return t.sort((n,o)=>n.type.rank-o.type.rank),t}}mt.none=[];class C1 extends Error{}class ye{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=ps(this.content,e+this.openStart,t);return n&&new ye(n,this.openStart,this.openEnd)}removeBetween(e,t){return new ye(hs(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return ye.empty;let n=t.openStart||0,o=t.openEnd||0;if(typeof n!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new ye(be.fromJSON(e,t.content),n,o)}static maxOpen(e,t=!0){let n=0,o=0;for(let l=e.firstChild;l&&!l.isLeaf&&(t||!l.type.spec.isolating);l=l.firstChild)n++;for(let l=e.lastChild;l&&!l.isLeaf&&(t||!l.type.spec.isolating);l=l.lastChild)o++;return new ye(e,n,o)}}ye.empty=new ye(be.empty,0,0);function hs(r,e,t){let{index:n,offset:o}=r.findIndex(e),l=r.maybeChild(n),{index:i,offset:s}=r.findIndex(t);if(o==e||l.isText){if(s!=t&&!r.child(i).isText)throw new RangeError("Removing non-flat range");return r.cut(0,e).append(r.cut(t))}if(n!=i)throw new RangeError("Removing non-flat range");return r.replaceChild(n,l.copy(hs(l.content,e-o-1,t-o-1)))}function ps(r,e,t,n){let{index:o,offset:l}=r.findIndex(e),i=r.maybeChild(o);if(l==e||i.isText)return n&&!n.canReplace(o,o,t)?null:r.cut(0,e).append(t).append(r.cut(e));let s=ps(i.content,e-l-1,t,i);return s&&r.replaceChild(o,i.copy(s))}function T1(r){return r.tag!=null}function E1(r){return r.style!=null}let S1=class xl{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(o=>{if(T1(o))this.tags.push(o);else if(E1(o)){let l=/[^=]*/.exec(o.style)[0];n.indexOf(l)<0&&n.push(l),this.styles.push(o)}}),this.normalizeLists=!this.tags.some(o=>{if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;let l=e.nodes[o.node];return l.contentMatch.matchType(l)})}parse(e,t={}){let n=new a0(this,t,!1);return n.addAll(e,mt.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new a0(this,t,!0);return n.addAll(e,mt.none,t.from,t.to),ye.maxOpen(n.finish())}matchTag(e,t,n){for(let o=n?this.tags.indexOf(n)+1:0;o<this.tags.length;o++){let l=this.tags[o];if(B1(e,l.tag)&&(l.namespace===void 0||e.namespaceURI==l.namespace)&&(!l.context||t.matchesContext(l.context))){if(l.getAttrs){let i=l.getAttrs(e);if(i===!1)continue;l.attrs=i||void 0}return l}}}matchStyle(e,t,n,o){for(let l=o?this.styles.indexOf(o)+1:0;l<this.styles.length;l++){let i=this.styles[l],s=i.style;if(!(s.indexOf(e)!=0||i.context&&!n.matchesContext(i.context)||s.length>e.length&&(s.charCodeAt(e.length)!=61||s.slice(e.length+1)!=t))){if(i.getAttrs){let u=i.getAttrs(t);if(u===!1)continue;i.attrs=u||void 0}return i}}}static schemaRules(e){let t=[];function n(o){let l=o.priority==null?50:o.priority,i=0;for(;i<t.length;i++){let s=t[i];if((s.priority==null?50:s.priority)<l)break}t.splice(i,0,o)}for(let o in e.marks){let l=e.marks[o].spec.parseDOM;l&&l.forEach(i=>{n(i=i0(i)),i.mark||i.ignore||i.clearMark||(i.mark=o)})}for(let o in e.nodes){let l=e.nodes[o].spec.parseDOM;l&&l.forEach(i=>{n(i=i0(i)),i.node||i.ignore||i.mark||(i.node=o)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new xl(e,xl.schemaRules(e)))}};const gs={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},M1={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},vs={ol:!0,ul:!0},tn=1,Cl=2,Jr=4;function l0(r,e,t){return e!=null?(e?tn:0)|(e==="full"?Cl:0):r&&r.whitespace=="pre"?tn|Cl:t&~Jr}class xn{constructor(e,t,n,o,l,i){this.type=e,this.attrs=t,this.marks=n,this.solid=o,this.options=i,this.content=[],this.activeMarks=mt.none,this.match=l||(i&Jr?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(be.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let n=this.type.contentMatch,o;return(o=n.findWrapping(e.type))?(this.match=n,o):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&tn)){let n=this.content[this.content.length-1],o;if(n&&n.isText&&(o=/[ \t\r\n\u000c]+$/.exec(n.text))){let l=n;n.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=l.withText(l.text.slice(0,l.text.length-o[0].length))}}let t=be.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(be.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!gs.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class a0{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let o=t.topNode,l,i=l0(null,t.preserveWhitespace,0)|(n?Jr:0);o?l=new xn(o.type,o.attrs,mt.none,!0,t.topMatch||o.type.contentMatch,i):n?l=new xn(null,null,mt.none,!0,null,i):l=new xn(e.schema.topNodeType,null,mt.none,!0,null,i),this.nodes=[l],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,o=this.top,l=o.options&Cl?"full":this.localPreserveWS||(o.options&tn)>0,{schema:i}=this.parser;if(l==="full"||o.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(l)if(l==="full")n=n.replace(/\r\n?/g,`
47
+ `);else if(i.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(i.linebreakReplacement.create())){let s=n.split(/\r?\n|\r/);for(let u=0;u<s.length;u++)u&&this.insertNode(i.linebreakReplacement.create(),t,!0),s[u]&&this.insertNode(i.text(s[u]),t,!/\S/.test(s[u]));n=""}else n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let s=o.content[o.content.length-1],u=e.previousSibling;(!s||u&&u.nodeName=="BR"||s.isText&&/[ \t\r\n\u000c]$/.test(s.text))&&(n=n.slice(1))}n&&this.insertNode(i.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let o=this.localPreserveWS,l=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let i=e.nodeName.toLowerCase(),s;vs.hasOwnProperty(i)&&this.parser.normalizeLists&&A1(e);let u=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(s=this.parser.matchTag(e,this,n));e:if(u?u.ignore:M1.hasOwnProperty(i))this.findInside(e),this.ignoreFallback(e,t);else if(!u||u.skip||u.closeParent){u&&u.closeParent?this.open=Math.max(0,this.open-1):u&&u.skip.nodeType&&(e=u.skip);let d,m=this.needsBlock;if(gs.hasOwnProperty(i))l.content.length&&l.content[0].isInline&&this.open&&(this.open--,l=this.top),d=!0,l.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let h=u&&u.skip?t:this.readStyles(e,t);h&&this.addAll(e,h),d&&this.sync(l),this.needsBlock=m}else{let d=this.readStyles(e,t);d&&this.addElementByRule(e,u,d,u.consuming===!1?s:void 0)}this.localPreserveWS=o}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
48
+ `),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let o=0;o<this.parser.matchedStyles.length;o++){let l=this.parser.matchedStyles[o],i=n.getPropertyValue(l);if(i)for(let s=void 0;;){let u=this.parser.matchStyle(l,i,this,s);if(!u)break;if(u.ignore)return null;if(u.clearMark?t=t.filter(d=>!u.clearMark(d)):t=t.concat(this.parser.schema.marks[u.mark].create(u.attrs)),u.consuming===!1)s=u;else break}}return t}addElementByRule(e,t,n,o){let l,i;if(t.node)if(i=this.parser.schema.nodes[t.node],i.isLeaf)this.insertNode(i.create(t.attrs),n,e.nodeName=="BR")||this.leafFallback(e,n);else{let u=this.enter(i,t.attrs||null,n,t.preserveWhitespace);u&&(l=!0,n=u)}else{let u=this.parser.schema.marks[t.mark];n=n.concat(u.create(t.attrs))}let s=this.top;if(i&&i.isLeaf)this.findInside(e);else if(o)this.addElement(e,n,o);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(u=>this.insertNode(u,n,!1));else{let u=e;typeof t.contentElement=="string"?u=e.querySelector(t.contentElement):typeof t.contentElement=="function"?u=t.contentElement(e):t.contentElement&&(u=t.contentElement),this.findAround(e,u,!0),this.addAll(u,n),this.findAround(e,u,!1)}l&&this.sync(s)&&this.open--}addAll(e,t,n,o){let l=n||0;for(let i=n?e.childNodes[n]:e.firstChild,s=o==null?null:e.childNodes[o];i!=s;i=i.nextSibling,++l)this.findAtPoint(e,l),this.addDOM(i,t);this.findAtPoint(e,l)}findPlace(e,t,n){let o,l;for(let i=this.open,s=0;i>=0;i--){let u=this.nodes[i],d=u.findWrapping(e);if(d&&(!o||o.length>d.length+s)&&(o=d,l=u,!d.length))break;if(u.solid){if(n)break;s+=2}}if(!o)return null;this.sync(l);for(let i=0;i<o.length;i++)t=this.enterInner(o[i],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let l=this.textblockFromContext();l&&(t=this.enterInner(l,null,t))}let o=this.findPlace(e,t,n);if(o){this.closeExtra();let l=this.top;l.match&&(l.match=l.match.matchType(e.type));let i=mt.none;for(let s of o.concat(e.marks))(l.type?l.type.allowsMarkType(s.type):s0(s.type,e.type))&&(i=s.addToSet(i));return l.content.push(e.mark(i)),!0}return!1}enter(e,t,n,o){let l=this.findPlace(e.create(t),n,!1);return l&&(l=this.enterInner(e,t,n,!0,o)),l}enterInner(e,t,n,o=!1,l){this.closeExtra();let i=this.top;i.match=i.match&&i.match.matchType(e);let s=l0(e,l,i.options);i.options&Jr&&i.content.length==0&&(s|=Jr);let u=mt.none;return n=n.filter(d=>(i.type?i.type.allowsMarkType(d.type):s0(d.type,e))?(u=d.addToSet(u),!1):!0),this.nodes.push(new xn(e,t,u,o,null,s)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=tn)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let o=n.length-1;o>=0;o--)e+=n[o].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let o=0;o<this.find.length;o++)this.find[o].pos==null&&e.nodeType==1&&e.contains(this.find[o].node)&&t.compareDocumentPosition(this.find[o].node)&(n?2:4)&&(this.find[o].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,o=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),l=-(n?n.depth+1:0)+(o?0:1),i=(s,u)=>{for(;s>=0;s--){let d=t[s];if(d==""){if(s==t.length-1||s==0)continue;for(;u>=l;u--)if(i(s-1,u))return!0;return!1}else{let m=u>0||u==0&&o?this.nodes[u].type:n&&u>=l?n.node(u-l).type:null;if(!m||m.name!=d&&!m.isInGroup(d))return!1;u--}}return!0};return i(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let t in this.parser.schema.nodes){let n=this.parser.schema.nodes[t];if(n.isTextblock&&n.defaultAttrs)return n}}}function A1(r){for(let e=r.firstChild,t=null;e;e=e.nextSibling){let n=e.nodeType==1?e.nodeName.toLowerCase():null;n&&vs.hasOwnProperty(n)&&t?(t.appendChild(e),e=t):n=="li"?t=e:n&&(t=null)}}function B1(r,e){return(r.matches||r.msMatchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector).call(r,e)}function i0(r){let e={};for(let t in r)e[t]=r[t];return e}function s0(r,e){let t=e.schema.nodes;for(let n in t){let o=t[n];if(!o.allowsMarkType(r))continue;let l=[],i=s=>{l.push(s);for(let u=0;u<s.edgeCount;u++){let{type:d,next:m}=s.edge(u);if(d==e||l.indexOf(m)<0&&i(m))return!0}};if(i(o.contentMatch))return!0}}class uo{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=$o(t).createDocumentFragment());let o=n,l=[];return e.forEach(i=>{if(l.length||i.marks.length){let s=0,u=0;for(;s<l.length&&u<i.marks.length;){let d=i.marks[u];if(!this.marks[d.type.name]){u++;continue}if(!d.eq(l[s][0])||d.type.spec.spanning===!1)break;s++,u++}for(;s<l.length;)o=l.pop()[1];for(;u<i.marks.length;){let d=i.marks[u++],m=this.serializeMark(d,i.isInline,t);m&&(l.push([d,o]),o.appendChild(m.dom),o=m.contentDOM||m.dom)}}o.appendChild(this.serializeNodeInner(i,t))}),n}serializeNodeInner(e,t){let{dom:n,contentDOM:o}=Dn($o(t),this.nodes[e.type.name](e),null,e.attrs);if(o){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,o)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let o=e.marks.length-1;o>=0;o--){let l=this.serializeMark(e.marks[o],e.isInline,t);l&&((l.contentDOM||l.dom).appendChild(n),n=l.dom)}return n}serializeMark(e,t,n={}){let o=this.marks[e.type.name];return o&&Dn($o(n),o(e,t),null,e.attrs)}static renderSpec(e,t,n=null,o){return Dn(e,t,n,o)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new uo(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=u0(e.nodes);return t.text||(t.text=n=>n.text),t}static marksFromSchema(e){return u0(e.marks)}}function u0(r){let e={};for(let t in r){let n=r[t].spec.toDOM;n&&(e[t]=n)}return e}function $o(r){return r.document||window.document}const c0=new WeakMap;function N1(r){let e=c0.get(r);return e===void 0&&c0.set(r,e=L1(r)),e}function L1(r){let e=null;function t(n){if(n&&typeof n=="object")if(Array.isArray(n))if(typeof n[0]=="string")e||(e=[]),e.push(n);else for(let o=0;o<n.length;o++)t(n[o]);else for(let o in n)t(n[o])}return t(r),e}function Dn(r,e,t,n){if(typeof e=="string")return{dom:r.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let o=e[0],l;if(typeof o!="string")throw new RangeError("Invalid array passed to renderSpec");if(n&&(l=N1(n))&&l.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let i=o.indexOf(" ");i>0&&(t=o.slice(0,i),o=o.slice(i+1));let s,u=t?r.createElementNS(t,o):r.createElement(o),d=e[1],m=1;if(d&&typeof d=="object"&&d.nodeType==null&&!Array.isArray(d)){m=2;for(let h in d)if(d[h]!=null){let p=h.indexOf(" ");p>0?u.setAttributeNS(h.slice(0,p),h.slice(p+1),d[h]):h=="style"&&u.style?u.style.cssText=d[h]:u.setAttribute(h,d[h])}}for(let h=m;h<e.length;h++){let p=e[h];if(p===0){if(h<e.length-1||h>m)throw new RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}else{let{dom:v,contentDOM:b}=Dn(r,p,t,n);if(u.appendChild(v),b){if(s)throw new RangeError("Multiple content holes");s=b}}}return{dom:u,contentDOM:s}}const bs=65535,ys=Math.pow(2,16);function I1(r,e){return r+e*ys}function d0(r){return r&bs}function z1(r){return(r-(r&bs))/ys}const ws=1,ks=2,On=4,xs=8;class f0{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&xs)>0}get deletedBefore(){return(this.delInfo&(ws|On))>0}get deletedAfter(){return(this.delInfo&(ks|On))>0}get deletedAcross(){return(this.delInfo&On)>0}}class at{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&at.empty)return at.empty}recover(e){let t=0,n=d0(e);if(!this.inverted)for(let o=0;o<n;o++)t+=this.ranges[o*3+2]-this.ranges[o*3+1];return this.ranges[n*3]+t+z1(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let o=0,l=this.inverted?2:1,i=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let u=this.ranges[s]-(this.inverted?o:0);if(u>e)break;let d=this.ranges[s+l],m=this.ranges[s+i],h=u+d;if(e<=h){let p=d?e==u?-1:e==h?1:t:t,v=u+o+(p<0?0:m);if(n)return v;let b=e==(t<0?u:h)?null:I1(s/3,e-u),w=e==u?ks:e==h?ws:On;return(t<0?e!=u:e!=h)&&(w|=xs),new f0(v,w,b)}o+=m-d}return n?e+o:new f0(e+o,0,null)}touches(e,t){let n=0,o=d0(t),l=this.inverted?2:1,i=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let u=this.ranges[s]-(this.inverted?n:0);if(u>e)break;let d=this.ranges[s+l],m=u+d;if(e<=m&&s==o*3)return!0;n+=this.ranges[s+i]-d}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let o=0,l=0;o<this.ranges.length;o+=3){let i=this.ranges[o],s=i-(this.inverted?l:0),u=i+(this.inverted?0:l),d=this.ranges[o+t],m=this.ranges[o+n];e(s,s+d,u,u+m),l+=m-d}}invert(){return new at(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?at.empty:new at(e<0?[0,-e,0]:[0,0,e])}}at.empty=new at([]);const qo=Object.create(null);class Je{getMap(){return at.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=qo[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in qo)throw new RangeError("Duplicate use of step JSON ID "+e);return qo[e]=t,t.prototype.jsonID=e,t}}class Pe{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new Pe(e,null)}static fail(e){return new Pe(null,e)}static fromReplace(e,t,n,o){try{return Pe.ok(e.replace(t,n,o))}catch(l){if(l instanceof C1)return Pe.fail(l.message);throw l}}}function Zl(r,e,t){let n=[];for(let o=0;o<r.childCount;o++){let l=r.child(o);l.content.size&&(l=l.copy(Zl(l.content,e,l))),l.isInline&&(l=e(l,t,o)),n.push(l)}return be.fromArray(n)}class ar extends Je{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),o=n.node(n.sharedDepth(this.to)),l=new ye(Zl(t.content,(i,s)=>!i.isAtom||!s.type.allowsMarkType(this.mark.type)?i:i.mark(this.mark.addToSet(i.marks)),o),t.openStart,t.openEnd);return Pe.fromReplace(e,this.from,this.to,l)}invert(){return new ir(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new ar(t.pos,n.pos,this.mark)}merge(e){return e instanceof ar&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ar(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new ar(t.from,t.to,e.markFromJSON(t.mark))}}Je.jsonID("addMark",ar);class ir extends Je{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new ye(Zl(t.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),t.openStart,t.openEnd);return Pe.fromReplace(e,this.from,this.to,n)}invert(){return new ar(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new ir(t.pos,n.pos,this.mark)}merge(e){return e instanceof ir&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ir(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new ir(t.from,t.to,e.markFromJSON(t.mark))}}Je.jsonID("removeMark",ir);class sr extends Je{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Pe.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Pe.fromReplace(e,this.pos,this.pos+1,new ye(be.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let n=this.mark.addToSet(t.marks);if(n.length==t.marks.length){for(let o=0;o<t.marks.length;o++)if(!t.marks[o].isInSet(n))return new sr(this.pos,t.marks[o]);return new sr(this.pos,this.mark)}}return new rn(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new sr(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new sr(t.pos,e.markFromJSON(t.mark))}}Je.jsonID("addNodeMark",sr);class rn extends Je{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Pe.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Pe.fromReplace(e,this.pos,this.pos+1,new ye(be.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new sr(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new rn(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new rn(t.pos,e.markFromJSON(t.mark))}}Je.jsonID("removeNodeMark",rn);class Bt extends Je{constructor(e,t,n,o=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=o}apply(e){return this.structure&&Tl(e,this.from,this.to)?Pe.fail("Structure replace would overwrite content"):Pe.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new at([this.from,this.to-this.from,this.slice.size])}invert(e){return new Bt(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deletedAcross&&n.deletedAcross?null:new Bt(t.pos,Math.max(t.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof Bt)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?ye.empty:new ye(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Bt(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?ye.empty:new ye(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Bt(e.from,this.to,t,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Bt(t.from,t.to,ye.fromJSON(e,t.slice),!!t.structure)}}Je.jsonID("replace",Bt);class Br extends Je{constructor(e,t,n,o,l,i,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=o,this.slice=l,this.insert=i,this.structure=s}apply(e){if(this.structure&&(Tl(e,this.from,this.gapFrom)||Tl(e,this.gapTo,this.to)))return Pe.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Pe.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?Pe.fromReplace(e,this.from,this.to,n):Pe.fail("Content does not fit in gap")}getMap(){return new at([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new Br(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),o=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),l=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||o<t.pos||l>n.pos?null:new Br(t.pos,n.pos,o,l,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Br(t.from,t.to,t.gapFrom,t.gapTo,ye.fromJSON(e,t.slice),t.insert,!!t.structure)}}Je.jsonID("replaceAround",Br);function Tl(r,e,t){let n=r.resolve(e),o=t-e,l=n.depth;for(;o>0&&l>0&&n.indexAfter(l)==n.node(l).childCount;)l--,o--;if(o>0){let i=n.node(l).maybeChild(n.indexAfter(l));for(;o>0;){if(!i||i.isLeaf)return!0;i=i.firstChild,o--}}return!1}function D1(r,e,t){let n=r.resolve(e);if(!t.content.size)return e;let o=t.content;for(let l=0;l<t.openStart;l++)o=o.firstChild.content;for(let l=1;l<=(t.openStart==0&&t.size?2:1);l++)for(let i=n.depth;i>=0;i--){let s=i==n.depth?0:n.pos<=(n.start(i+1)+n.end(i+1))/2?-1:1,u=n.index(i)+(s>0?1:0),d=n.node(i),m=!1;if(l==1)m=d.canReplace(u,u,o);else{let h=d.contentMatchAt(u).findWrapping(o.firstChild.type);m=h&&d.canReplaceWith(u,u,h[0])}if(m)return s==0?n.pos:s<0?n.before(i+1):n.after(i+1)}return null}class Xr extends Je{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return Pe.fail("No node at attribute step's position");let n=Object.create(null);for(let l in t.attrs)n[l]=t.attrs[l];n[this.attr]=this.value;let o=t.type.create(n,null,t.marks);return Pe.fromReplace(e,this.pos,this.pos+1,new ye(be.from(o),0,t.isLeaf?0:1))}getMap(){return at.empty}invert(e){return new Xr(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Xr(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Xr(t.pos,t.attr,t.value)}}Je.jsonID("attr",Xr);class _n extends Je{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let o in e.attrs)t[o]=e.attrs[o];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return Pe.ok(n)}getMap(){return at.empty}invert(e){return new _n(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new _n(t.attr,t.value)}}Je.jsonID("docAttr",_n);let nn=class extends Error{};nn=function r(e){let t=Error.call(this,e);return t.__proto__=r.prototype,t};nn.prototype=Object.create(Error.prototype);nn.prototype.constructor=nn;nn.prototype.name="TransformError";const Uo=Object.create(null);class Oe{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new O1(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=ye.empty){let n=t.content.lastChild,o=null;for(let s=0;s<t.openEnd;s++)o=n,n=n.lastChild;let l=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:u,$to:d}=i[s],m=e.mapping.slice(l);e.replaceRange(m.map(u.pos),m.map(d.pos),s?ye.empty:t),s==0&&p0(e,l,(n?n.isInline:o&&o.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,o=this.ranges;for(let l=0;l<o.length;l++){let{$from:i,$to:s}=o[l],u=e.mapping.slice(n),d=u.map(i.pos),m=u.map(s.pos);l?e.deleteRange(d,m):(e.replaceRangeWith(d,m,t),p0(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let o=e.parent.inlineContent?new ze(e):Mr(e.node(0),e.parent,e.pos,e.index(),t,n);if(o)return o;for(let l=e.depth-1;l>=0;l--){let i=t<0?Mr(e.node(0),e.node(l),e.before(l+1),e.index(l),t,n):Mr(e.node(0),e.node(l),e.after(l+1),e.index(l)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new kt(e.node(0))}static atStart(e){return Mr(e,e,0,0,1)||new kt(e)}static atEnd(e){return Mr(e,e,e.content.size,e.childCount,-1)||new kt(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=Uo[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Uo)throw new RangeError("Duplicate use of selection JSON ID "+e);return Uo[e]=t,t.prototype.jsonID=e,t}getBookmark(){return ze.between(this.$anchor,this.$head).getBookmark()}}Oe.prototype.visible=!0;class O1{constructor(e,t){this.$from=e,this.$to=t}}let m0=!1;function h0(r){!m0&&!r.parent.inlineContent&&(m0=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+r.parent.type.name+")"))}class ze extends Oe{constructor(e,t=e){h0(e),h0(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return Oe.near(n);let o=e.resolve(t.map(this.anchor));return new ze(o.parent.inlineContent?o:n,n)}replace(e,t=ye.empty){if(super.replace(e,t),t==ye.empty){let n=this.$from.marksAcross(this.$to);n&&e.ensureMarks(n)}}eq(e){return e instanceof ze&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new co(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new ze(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let o=e.resolve(t);return new this(o,n==t?o:e.resolve(n))}static between(e,t,n){let o=e.pos-t.pos;if((!n||o)&&(n=o>=0?1:-1),!t.parent.inlineContent){let l=Oe.findFrom(t,n,!0)||Oe.findFrom(t,-n,!0);if(l)t=l.$head;else return Oe.near(t,n)}return e.parent.inlineContent||(o==0?e=t:(e=(Oe.findFrom(e,-n,!0)||Oe.findFrom(e,n,!0)).$anchor,e.pos<t.pos!=o<0&&(e=t))),new ze(e,t)}}Oe.jsonID("text",ze);class co{constructor(e,t){this.anchor=e,this.head=t}map(e){return new co(e.map(this.anchor),e.map(this.head))}resolve(e){return ze.between(e.resolve(this.anchor),e.resolve(this.head))}}class ke extends Oe{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(e,t){let{deleted:n,pos:o}=t.mapResult(this.anchor),l=e.resolve(o);return n?Oe.near(l):new ke(l)}content(){return new ye(be.from(this.node),0,0)}eq(e){return e instanceof ke&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new ea(this.anchor)}static fromJSON(e,t){if(typeof t.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new ke(e.resolve(t.anchor))}static create(e,t){return new ke(e.resolve(t))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}ke.prototype.visible=!1;Oe.jsonID("node",ke);class ea{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new co(n,n):new ea(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&ke.isSelectable(n)?new ke(t):Oe.near(t)}}class kt extends Oe{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=ye.empty){if(t==ye.empty){e.delete(0,e.doc.content.size);let n=Oe.atStart(e.doc);n.eq(e.selection)||e.setSelection(n)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new kt(e)}map(e){return new kt(e)}eq(e){return e instanceof kt}getBookmark(){return R1}}Oe.jsonID("all",kt);const R1={map(){return this},resolve(r){return new kt(r)}};function Mr(r,e,t,n,o,l=!1){if(e.inlineContent)return ze.create(r,t);for(let i=n-(o>0?0:1);o>0?i<e.childCount:i>=0;i+=o){let s=e.child(i);if(s.isAtom){if(!l&&ke.isSelectable(s))return ke.create(r,t-(o<0?s.nodeSize:0))}else{let u=Mr(r,s,t+o,o<0?s.childCount:0,o,l);if(u)return u}t+=s.nodeSize*o}return null}function p0(r,e,t){let n=r.steps.length-1;if(n<e)return;let o=r.steps[n];if(!(o instanceof Bt||o instanceof Br))return;let l=r.mapping.maps[n],i;l.forEach((s,u,d,m)=>{i==null&&(i=m)}),r.setSelection(Oe.near(r.doc.resolve(i),t))}function g0(r,e){return!e||!r?r:r.bind(e)}class Cn{constructor(e,t,n){this.name=e,this.init=g0(t.init,n),this.apply=g0(t.apply,n)}}new Cn("doc",{init(r){return r.doc||r.schema.topNodeType.createAndFill()},apply(r){return r.doc}}),new Cn("selection",{init(r,e){return r.selection||Oe.atStart(e.doc)},apply(r){return r.selection}}),new Cn("storedMarks",{init(r){return r.storedMarks||null},apply(r,e,t,n){return n.selection.$cursor?r.storedMarks:null}}),new Cn("scrollToSelection",{init(){return 0},apply(r,e){return r.scrolledIntoView?e+1:e}});function Cs(r,e,t){for(let n in r){let o=r[n];o instanceof Function?o=o.bind(e):n=="handleDOMEvents"&&(o=Cs(o,e,{})),t[n]=o}return t}class Ts{constructor(e){this.spec=e,this.props={},e.props&&Cs(e.props,this,this.props),this.key=e.key?e.key.key:Es("plugin")}getState(e){return e[this.key]}}const Wo=Object.create(null);function Es(r){return r in Wo?r+"$"+ ++Wo[r]:(Wo[r]=0,r+"$")}class Ss{constructor(e="key"){this.key=Es(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const pr=function(r){for(var e=0;;e++)if(r=r.previousSibling,!r)return e},Ms=function(r,e,t,n){return t&&(v0(r,e,t,n,-1)||v0(r,e,t,n,1))},P1=/^(img|br|input|textarea|hr)$/i;function v0(r,e,t,n,o){for(var l;;){if(r==t&&e==n)return!0;if(e==(o<0?0:Gn(r))){let i=r.parentNode;if(!i||i.nodeType!=1||ta(r)||P1.test(r.nodeName)||r.contentEditable=="false")return!1;e=pr(r)+(o<0?0:1),r=i}else if(r.nodeType==1){let i=r.childNodes[e+(o<0?-1:0)];if(i.nodeType==1&&i.contentEditable=="false")if(!((l=i.pmViewDesc)===null||l===void 0)&&l.ignoreForSelection)e+=o;else return!1;else r=i,e=o<0?Gn(r):0}else return!1}}function Gn(r){return r.nodeType==3?r.nodeValue.length:r.childNodes.length}function H1(r,e,t){for(let n=e==0,o=e==Gn(r);n||o;){if(r==t)return!0;let l=pr(r);if(r=r.parentNode,!r)return!1;n=n&&l==0,o=o&&l==Gn(r)}}function ta(r){let e;for(let t=r;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==r||e.contentDOM==r)}const As=function(r){return r.focusNode&&Ms(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)};function Bs(r,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=r,t.key=t.code=e,t}const xt=typeof navigator<"u"?navigator:null,b0=typeof document<"u"?document:null,Qt=xt&&xt.userAgent||"",El=/Edge\/(\d+)/.exec(Qt),Ns=/MSIE \d/.exec(Qt),Sl=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Qt),fn=!!(Ns||Sl||El),Ls=Ns?document.documentMode:Sl?+Sl[1]:El?+El[1]:0,fo=!fn&&/gecko\/(\d+)/i.test(Qt);fo&&+(/Firefox\/(\d+)/.exec(Qt)||[0,0])[1];const Ml=!fn&&/Chrome\/(\d+)/.exec(Qt),Dt=!!Ml,Is=Ml?+Ml[1]:0,gr=!fn&&!!xt&&/Apple Computer/.test(xt.vendor),ra=gr&&(/Mobile\/\w+/.test(Qt)||!!xt&&xt.maxTouchPoints>2),ft=ra||(xt?/Mac/.test(xt.platform):!1),zs=xt?/Win/.test(xt.platform):!1,mn=/Android \d/.test(Qt),na=!!b0&&"webkitFontSmoothing"in b0.documentElement.style,V1=na?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function F1(r,e=null){let t=r.domSelectionRange(),n=r.state.doc;if(!t.focusNode)return null;let o=r.docView.nearestDesc(t.focusNode),l=o&&o.size==0,i=r.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(i<0)return null;let s=n.resolve(i),u,d;if(As(t)){for(u=i;o&&!o.node;)o=o.parent;let h=o.node;if(o&&h.isAtom&&ke.isSelectable(h)&&o.parent&&!(h.isInline&&H1(t.focusNode,t.focusOffset,o.dom))){let p=o.posBefore;d=new ke(i==p?s:n.resolve(p))}}else{if(t instanceof r.dom.ownerDocument.defaultView.Selection&&t.rangeCount>1){let h=i,p=i;for(let v=0;v<t.rangeCount;v++){let b=t.getRangeAt(v);h=Math.min(h,r.docView.posFromDOM(b.startContainer,b.startOffset,1)),p=Math.max(p,r.docView.posFromDOM(b.endContainer,b.endOffset,-1))}if(h<0)return null;[u,i]=p==r.state.selection.anchor?[p,h]:[h,p],s=n.resolve(i)}else u=r.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(u<0)return null}let m=n.resolve(u);if(!d){let h=e=="pointer"||r.state.selection.head<s.pos&&!l?1:-1;d=Os(r,m,s,h)}return d}function Ds(r){return r.editable?r.hasFocus():W1(r)&&document.activeElement&&document.activeElement.contains(r.dom)}function oa(r,e=!1){let t=r.state.selection;if(U1(r,t),!!Ds(r)){if(!e&&r.input.mouseDown&&r.input.mouseDown.allowDefault&&Dt){let n=r.domSelectionRange(),o=r.domObserver.currentSelection;if(n.anchorNode&&o.anchorNode&&Ms(n.anchorNode,n.anchorOffset,o.anchorNode,o.anchorOffset)){r.input.mouseDown.delayedSelectionSync=!0,r.domObserver.setCurSelection();return}}if(r.domObserver.disconnectSelection(),r.cursorWrapper)q1(r);else{let{anchor:n,head:o}=t,l,i;y0&&!(t instanceof ze)&&(t.$from.parent.inlineContent||(l=w0(r,t.from)),!t.empty&&!t.$from.parent.inlineContent&&(i=w0(r,t.to))),r.docView.setSelection(n,o,r,e),y0&&(l&&k0(l),i&&k0(i)),t.visible?r.dom.classList.remove("ProseMirror-hideselection"):(r.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&$1(r))}r.domObserver.setCurSelection(),r.domObserver.connectSelection()}}const y0=gr||Dt&&Is<63;function w0(r,e){let{node:t,offset:n}=r.docView.domFromPos(e,0),o=n<t.childNodes.length?t.childNodes[n]:null,l=n?t.childNodes[n-1]:null;if(gr&&o&&o.contentEditable=="false")return _o(o);if((!o||o.contentEditable=="false")&&(!l||l.contentEditable=="false")){if(o)return _o(o);if(l)return _o(l)}}function _o(r){return r.contentEditable="true",gr&&r.draggable&&(r.draggable=!1,r.wasDraggable=!0),r}function k0(r){r.contentEditable="false",r.wasDraggable&&(r.draggable=!0,r.wasDraggable=null)}function $1(r){let e=r.dom.ownerDocument;e.removeEventListener("selectionchange",r.input.hideSelectionGuard);let t=r.domSelectionRange(),n=t.anchorNode,o=t.anchorOffset;e.addEventListener("selectionchange",r.input.hideSelectionGuard=()=>{(t.anchorNode!=n||t.anchorOffset!=o)&&(e.removeEventListener("selectionchange",r.input.hideSelectionGuard),setTimeout(()=>{(!Ds(r)||r.state.selection.visible)&&r.dom.classList.remove("ProseMirror-hideselection")},20))})}function q1(r){let e=r.domSelection();if(!e)return;let t=r.cursorWrapper.dom,n=t.nodeName=="IMG";n?e.collapse(t.parentNode,pr(t)+1):e.collapse(t,0),!n&&!r.state.selection.visible&&fn&&Ls<=11&&(t.disabled=!0,t.disabled=!1)}function U1(r,e){if(e instanceof ke){let t=r.docView.descAt(e.from);t!=r.lastSelectedViewDesc&&(x0(r),t&&t.selectNode(),r.lastSelectedViewDesc=t)}else x0(r)}function x0(r){r.lastSelectedViewDesc&&(r.lastSelectedViewDesc.parent&&r.lastSelectedViewDesc.deselectNode(),r.lastSelectedViewDesc=void 0)}function Os(r,e,t,n){return r.someProp("createSelectionBetween",o=>o(r,e,t))||ze.between(e,t,n)}function W1(r){let e=r.domSelectionRange();if(!e.anchorNode)return!1;try{return r.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(r.editable||r.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function Al(r,e){let{$anchor:t,$head:n}=r.selection,o=e>0?t.max(n):t.min(n),l=o.parent.inlineContent?o.depth?r.doc.resolve(e>0?o.after():o.before()):null:o;return l&&Oe.findFrom(l,e)}function qt(r,e){return r.dispatch(r.state.tr.setSelection(e).scrollIntoView()),!0}function C0(r,e,t){let n=r.state.selection;if(n instanceof ze)if(t.indexOf("s")>-1){let{$head:o}=n,l=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter;if(!l||l.isText||!l.isLeaf)return!1;let i=r.state.doc.resolve(o.pos+l.nodeSize*(e<0?-1:1));return qt(r,new ze(n.$anchor,i))}else if(n.empty){if(r.endOfTextblock(e>0?"forward":"backward")){let o=Al(r.state,e);return o&&o instanceof ke?qt(r,o):!1}else if(!(ft&&t.indexOf("m")>-1)){let o=n.$head,l=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter,i;if(!l||l.isText)return!1;let s=e<0?o.pos-l.nodeSize:o.pos;return l.isAtom||(i=r.docView.descAt(s))&&!i.contentDOM?ke.isSelectable(l)?qt(r,new ke(e<0?r.state.doc.resolve(o.pos-l.nodeSize):o)):na?qt(r,new ze(r.state.doc.resolve(e<0?s:s+l.nodeSize))):!1:!1}}else return!1;else{if(n instanceof ke&&n.node.isInline)return qt(r,new ze(e>0?n.$to:n.$from));{let o=Al(r.state,e);return o?qt(r,o):!1}}}function Kn(r){return r.nodeType==3?r.nodeValue.length:r.childNodes.length}function jr(r,e){let t=r.pmViewDesc;return t&&t.size==0&&(e<0||r.nextSibling||r.nodeName!="BR")}function Tr(r,e){return e<0?_1(r):G1(r)}function _1(r){let e=r.domSelectionRange(),t=e.focusNode,n=e.focusOffset;if(!t)return;let o,l,i=!1;for(fo&&t.nodeType==1&&n<Kn(t)&&jr(t.childNodes[n],-1)&&(i=!0);;)if(n>0){if(t.nodeType!=1)break;{let s=t.childNodes[n-1];if(jr(s,-1))o=t,l=--n;else if(s.nodeType==3)t=s,n=t.nodeValue.length;else break}}else{if(Rs(t))break;{let s=t.previousSibling;for(;s&&jr(s,-1);)o=t.parentNode,l=pr(s),s=s.previousSibling;if(s)t=s,n=Kn(t);else{if(t=t.parentNode,t==r.dom)break;n=0}}}i?Bl(r,t,n):o&&Bl(r,o,l)}function G1(r){let e=r.domSelectionRange(),t=e.focusNode,n=e.focusOffset;if(!t)return;let o=Kn(t),l,i;for(;;)if(n<o){if(t.nodeType!=1)break;let s=t.childNodes[n];if(jr(s,1))l=t,i=++n;else break}else{if(Rs(t))break;{let s=t.nextSibling;for(;s&&jr(s,1);)l=s.parentNode,i=pr(s)+1,s=s.nextSibling;if(s)t=s,n=0,o=Kn(t);else{if(t=t.parentNode,t==r.dom)break;n=o=0}}}l&&Bl(r,l,i)}function Rs(r){let e=r.pmViewDesc;return e&&e.node&&e.node.isBlock}function K1(r,e){for(;r&&e==r.childNodes.length&&!ta(r);)e=pr(r)+1,r=r.parentNode;for(;r&&e<r.childNodes.length;){let t=r.childNodes[e];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;r=t,e=0}}function Y1(r,e){for(;r&&!e&&!ta(r);)e=pr(r),r=r.parentNode;for(;r&&e;){let t=r.childNodes[e-1];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;r=t,e=r.childNodes.length}}function Bl(r,e,t){if(e.nodeType!=3){let l,i;(i=K1(e,t))?(e=i,t=0):(l=Y1(e,t))&&(e=l,t=l.nodeValue.length)}let n=r.domSelection();if(!n)return;if(As(n)){let l=document.createRange();l.setEnd(e,t),l.setStart(e,t),n.removeAllRanges(),n.addRange(l)}else n.extend&&n.extend(e,t);r.domObserver.setCurSelection();let{state:o}=r;setTimeout(()=>{r.state==o&&oa(r)},50)}function T0(r,e){let t=r.state.doc.resolve(e);if(!(Dt||zs)&&t.parent.inlineContent){let o=r.coordsAtPos(e);if(e>t.start()){let l=r.coordsAtPos(e-1),i=(l.top+l.bottom)/2;if(i>o.top&&i<o.bottom&&Math.abs(l.left-o.left)>1)return l.left<o.left?"ltr":"rtl"}if(e<t.end()){let l=r.coordsAtPos(e+1),i=(l.top+l.bottom)/2;if(i>o.top&&i<o.bottom&&Math.abs(l.left-o.left)>1)return l.left>o.left?"ltr":"rtl"}}return getComputedStyle(r.dom).direction=="rtl"?"rtl":"ltr"}function E0(r,e,t){let n=r.state.selection;if(n instanceof ze&&!n.empty||t.indexOf("s")>-1||ft&&t.indexOf("m")>-1)return!1;let{$from:o,$to:l}=n;if(!o.parent.inlineContent||r.endOfTextblock(e<0?"up":"down")){let i=Al(r.state,e);if(i&&i instanceof ke)return qt(r,i)}if(!o.parent.inlineContent){let i=e<0?o:l,s=n instanceof kt?Oe.near(i,e):Oe.findFrom(i,e);return s?qt(r,s):!1}return!1}function S0(r,e){if(!(r.state.selection instanceof ze))return!0;let{$head:t,$anchor:n,empty:o}=r.state.selection;if(!t.sameParent(n))return!0;if(!o)return!1;if(r.endOfTextblock(e>0?"forward":"backward"))return!0;let l=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(l&&!l.isText){let i=r.state.tr;return e<0?i.delete(t.pos-l.nodeSize,t.pos):i.delete(t.pos,t.pos+l.nodeSize),r.dispatch(i),!0}return!1}function M0(r,e,t){r.domObserver.stop(),e.contentEditable=t,r.domObserver.start()}function J1(r){if(!gr||r.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=r.domSelectionRange();if(e&&e.nodeType==1&&t==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let n=e.firstChild;M0(r,n,"true"),setTimeout(()=>M0(r,n,"false"),20)}return!1}function X1(r){let e="";return r.ctrlKey&&(e+="c"),r.metaKey&&(e+="m"),r.altKey&&(e+="a"),r.shiftKey&&(e+="s"),e}function j1(r,e){let t=e.keyCode,n=X1(e);if(t==8||ft&&t==72&&n=="c")return S0(r,-1)||Tr(r,-1);if(t==46&&!e.shiftKey||ft&&t==68&&n=="c")return S0(r,1)||Tr(r,1);if(t==13||t==27)return!0;if(t==37||ft&&t==66&&n=="c"){let o=t==37?T0(r,r.state.selection.from)=="ltr"?-1:1:-1;return C0(r,o,n)||Tr(r,o)}else if(t==39||ft&&t==70&&n=="c"){let o=t==39?T0(r,r.state.selection.from)=="ltr"?1:-1:1;return C0(r,o,n)||Tr(r,o)}else{if(t==38||ft&&t==80&&n=="c")return E0(r,-1,n)||Tr(r,-1);if(t==40||ft&&t==78&&n=="c")return J1(r)||E0(r,1,n)||Tr(r,1);if(n==(ft?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function Ps(r,e){r.someProp("transformCopied",v=>{e=v(e,r)});let t=[],{content:n,openStart:o,openEnd:l}=e;for(;o>1&&l>1&&n.childCount==1&&n.firstChild.childCount==1;){o--,l--;let v=n.firstChild;t.push(v.type.name,v.attrs!=v.type.defaultAttrs?v.attrs:null),n=v.content}let i=r.someProp("clipboardSerializer")||uo.fromSchema(r.state.schema),s=Us(),u=s.createElement("div");u.appendChild(i.serializeFragment(n,{document:s}));let d=u.firstChild,m,h=0;for(;d&&d.nodeType==1&&(m=qs[d.nodeName.toLowerCase()]);){for(let v=m.length-1;v>=0;v--){let b=s.createElement(m[v]);for(;u.firstChild;)b.appendChild(u.firstChild);u.appendChild(b),h++}d=u.firstChild}d&&d.nodeType==1&&d.setAttribute("data-pm-slice",`${o} ${l}${h?` -${h}`:""} ${JSON.stringify(t)}`);let p=r.someProp("clipboardTextSerializer",v=>v(e,r))||e.content.textBetween(0,e.content.size,`
49
+
50
+ `);return{dom:u,text:p,slice:e}}function Hs(r,e,t,n,o){let l=o.parent.type.spec.code,i,s;if(!t&&!e)return null;let u=!!e&&(n||l||!t);if(u){if(r.someProp("transformPastedText",p=>{e=p(e,l||n,r)}),l)return s=new ye(be.from(r.state.schema.text(e.replace(/\r\n?/g,`
51
+ `))),0,0),r.someProp("transformPasted",p=>{s=p(s,r,!0)}),s;let h=r.someProp("clipboardTextParser",p=>p(e,o,n,r));if(h)s=h;else{let p=o.marks(),{schema:v}=r.state,b=uo.fromSchema(v);i=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(w=>{let k=i.appendChild(document.createElement("p"));w&&k.appendChild(b.serializeNode(v.text(w,p)))})}}else r.someProp("transformPastedHTML",h=>{t=h(t,r)}),i=tf(t),na&&rf(i);let d=i&&i.querySelector("[data-pm-slice]"),m=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(m&&m[3])for(let h=+m[3];h>0;h--){let p=i.firstChild;for(;p&&p.nodeType!=1;)p=p.nextSibling;if(!p)break;i=p}if(s||(s=(r.someProp("clipboardParser")||r.someProp("domParser")||S1.fromSchema(r.state.schema)).parseSlice(i,{preserveWhitespace:!!(u||m),context:o,ruleFromNode(p){return p.nodeName=="BR"&&!p.nextSibling&&p.parentNode&&!Q1.test(p.parentNode.nodeName)?{ignore:!0}:null}})),m)s=nf(A0(s,+m[1],+m[2]),m[4]);else if(s=ye.maxOpen(Z1(s.content,o),!0),s.openStart||s.openEnd){let h=0,p=0;for(let v=s.content.firstChild;h<s.openStart&&!v.type.spec.isolating;h++,v=v.firstChild);for(let v=s.content.lastChild;p<s.openEnd&&!v.type.spec.isolating;p++,v=v.lastChild);s=A0(s,h,p)}return r.someProp("transformPasted",h=>{s=h(s,r,u)}),s}const Q1=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Z1(r,e){if(r.childCount<2)return r;for(let t=e.depth;t>=0;t--){let o=e.node(t).contentMatchAt(e.index(t)),l,i=[];if(r.forEach(s=>{if(!i)return;let u=o.findWrapping(s.type),d;if(!u)return i=null;if(d=i.length&&l.length&&Fs(u,l,s,i[i.length-1],0))i[i.length-1]=d;else{i.length&&(i[i.length-1]=$s(i[i.length-1],l.length));let m=Vs(s,u);i.push(m),o=o.matchType(m.type),l=u}}),i)return be.from(i)}return r}function Vs(r,e,t=0){for(let n=e.length-1;n>=t;n--)r=e[n].create(null,be.from(r));return r}function Fs(r,e,t,n,o){if(o<r.length&&o<e.length&&r[o]==e[o]){let l=Fs(r,e,t,n.lastChild,o+1);if(l)return n.copy(n.content.replaceChild(n.childCount-1,l));if(n.contentMatchAt(n.childCount).matchType(o==r.length-1?t.type:r[o+1]))return n.copy(n.content.append(be.from(Vs(t,r,o+1))))}}function $s(r,e){if(e==0)return r;let t=r.content.replaceChild(r.childCount-1,$s(r.lastChild,e-1)),n=r.contentMatchAt(r.childCount).fillBefore(be.empty,!0);return r.copy(t.append(n))}function Nl(r,e,t,n,o,l){let i=e<0?r.firstChild:r.lastChild,s=i.content;return r.childCount>1&&(l=0),o<n-1&&(s=Nl(s,e,t,n,o+1,l)),o>=t&&(s=e<0?i.contentMatchAt(0).fillBefore(s,l<=o).append(s):s.append(i.contentMatchAt(i.childCount).fillBefore(be.empty,!0))),r.replaceChild(e<0?0:r.childCount-1,i.copy(s))}function A0(r,e,t){return e<r.openStart&&(r=new ye(Nl(r.content,-1,e,r.openStart,0,r.openEnd),e,r.openEnd)),t<r.openEnd&&(r=new ye(Nl(r.content,1,t,r.openEnd,0,0),r.openStart,t)),r}const qs={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let B0=null;function Us(){return B0||(B0=document.implementation.createHTMLDocument("title"))}let Go=null;function ef(r){let e=window.trustedTypes;return e?(Go||(Go=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:t=>t})),Go.createHTML(r)):r}function tf(r){let e=/^(\s*<meta [^>]*>)*/.exec(r);e&&(r=r.slice(e[0].length));let t=Us().createElement("div"),n=/<([a-z][^>\s]+)/i.exec(r),o;if((o=n&&qs[n[1].toLowerCase()])&&(r=o.map(l=>"<"+l+">").join("")+r+o.map(l=>"</"+l+">").reverse().join("")),t.innerHTML=ef(r),o)for(let l=0;l<o.length;l++)t=t.querySelector(o[l])||t;return t}function rf(r){let e=r.querySelectorAll(Dt?"span:not([class]):not([style])":"span.Apple-converted-space");for(let t=0;t<e.length;t++){let n=e[t];n.childNodes.length==1&&n.textContent==" "&&n.parentNode&&n.parentNode.replaceChild(r.ownerDocument.createTextNode(" "),n)}}function nf(r,e){if(!r.size)return r;let t=r.content.firstChild.type.schema,n;try{n=JSON.parse(e)}catch{return r}let{content:o,openStart:l,openEnd:i}=r;for(let s=n.length-2;s>=0;s-=2){let u=t.nodes[n[s]];if(!u||u.hasRequiredAttrs())break;o=be.from(u.create(n[s+1],o)),l++,i++}return new ye(o,l,i)}const bt={},st={};function Wt(r,e){r.input.lastSelectionOrigin=e,r.input.lastSelectionTime=Date.now()}st.keydown=(r,e)=>{let t=e;if(r.input.shiftKey=t.keyCode==16||t.shiftKey,!_s(r,t)&&(r.input.lastKeyCode=t.keyCode,r.input.lastKeyCodeTime=Date.now(),!(mn&&Dt&&t.keyCode==13)))if(t.keyCode!=229&&r.domObserver.forceFlush(),ra&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let n=Date.now();r.input.lastIOSEnter=n,r.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{r.input.lastIOSEnter==n&&(r.someProp("handleKeyDown",o=>o(r,Bs(13,"Enter"))),r.input.lastIOSEnter=0)},200)}else r.someProp("handleKeyDown",n=>n(r,t))||j1(r,t)?t.preventDefault():Wt(r,"key")};st.keyup=(r,e)=>{e.keyCode==16&&(r.input.shiftKey=!1)};st.keypress=(r,e)=>{let t=e;if(_s(r,t)||!t.charCode||t.ctrlKey&&!t.altKey||ft&&t.metaKey)return;if(r.someProp("handleKeyPress",o=>o(r,t))){t.preventDefault();return}let n=r.state.selection;if(!(n instanceof ze)||!n.$from.sameParent(n.$to)){let o=String.fromCharCode(t.charCode),l=()=>r.state.tr.insertText(o).scrollIntoView();!/[\r\n]/.test(o)&&!r.someProp("handleTextInput",i=>i(r,n.$from.pos,n.$to.pos,o,l))&&r.dispatch(l()),t.preventDefault()}};function mo(r){return{left:r.clientX,top:r.clientY}}function of(r,e){let t=e.x-r.clientX,n=e.y-r.clientY;return t*t+n*n<100}function la(r,e,t,n,o){if(n==-1)return!1;let l=r.state.doc.resolve(n);for(let i=l.depth+1;i>0;i--)if(r.someProp(e,s=>i>l.depth?s(r,t,l.nodeAfter,l.before(i),o,!0):s(r,t,l.node(i),l.before(i),o,!1)))return!0;return!1}function Nr(r,e,t){if(r.focused||r.focus(),r.state.selection.eq(e))return;let n=r.state.tr.setSelection(e);n.setMeta("pointer",!0),r.dispatch(n)}function lf(r,e){if(e==-1)return!1;let t=r.state.doc.resolve(e),n=t.nodeAfter;return n&&n.isAtom&&ke.isSelectable(n)?(Nr(r,new ke(t)),!0):!1}function af(r,e){if(e==-1)return!1;let t=r.state.selection,n,o;t instanceof ke&&(n=t.node);let l=r.state.doc.resolve(e);for(let i=l.depth+1;i>0;i--){let s=i>l.depth?l.nodeAfter:l.node(i);if(ke.isSelectable(s)){n&&t.$from.depth>0&&i>=t.$from.depth&&l.before(t.$from.depth+1)==t.$from.pos?o=l.before(t.$from.depth):o=l.before(i);break}}return o!=null?(Nr(r,ke.create(r.state.doc,o)),!0):!1}function sf(r,e,t,n,o){return la(r,"handleClickOn",e,t,n)||r.someProp("handleClick",l=>l(r,e,n))||(o?af(r,t):lf(r,t))}function uf(r,e,t,n){return la(r,"handleDoubleClickOn",e,t,n)||r.someProp("handleDoubleClick",o=>o(r,e,n))}function cf(r,e,t,n){return la(r,"handleTripleClickOn",e,t,n)||r.someProp("handleTripleClick",o=>o(r,e,n))||df(r,t,n)}function df(r,e,t){if(t.button!=0)return!1;let n=r.state.doc;if(e==-1)return n.inlineContent?(Nr(r,ze.create(n,0,n.content.size)),!0):!1;let o=n.resolve(e);for(let l=o.depth+1;l>0;l--){let i=l>o.depth?o.nodeAfter:o.node(l),s=o.before(l);if(i.inlineContent)Nr(r,ze.create(n,s+1,s+1+i.content.size));else if(ke.isSelectable(i))Nr(r,ke.create(n,s));else continue;return!0}}function aa(r){return Yn(r)}const Ws=ft?"metaKey":"ctrlKey";bt.mousedown=(r,e)=>{let t=e;r.input.shiftKey=t.shiftKey;let n=aa(r),o=Date.now(),l="singleClick";o-r.input.lastClick.time<500&&of(t,r.input.lastClick)&&!t[Ws]&&r.input.lastClick.button==t.button&&(r.input.lastClick.type=="singleClick"?l="doubleClick":r.input.lastClick.type=="doubleClick"&&(l="tripleClick")),r.input.lastClick={time:o,x:t.clientX,y:t.clientY,type:l,button:t.button};let i=r.posAtCoords(mo(t));i&&(l=="singleClick"?(r.input.mouseDown&&r.input.mouseDown.done(),r.input.mouseDown=new ff(r,i,t,!!n)):(l=="doubleClick"?uf:cf)(r,i.pos,i.inside,t)?t.preventDefault():Wt(r,"pointer"))};class ff{constructor(e,t,n,o){this.view=e,this.pos=t,this.event=n,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[Ws],this.allowDefault=n.shiftKey;let l,i;if(t.inside>-1)l=e.state.doc.nodeAt(t.inside),i=t.inside;else{let m=e.state.doc.resolve(t.pos);l=m.parent,i=m.depth?m.before():0}const s=o?null:n.target,u=s?e.docView.nearestDesc(s,!0):null;this.target=u&&u.nodeDOM.nodeType==1?u.nodeDOM:null;let{selection:d}=e.state;(n.button==0&&l.type.spec.draggable&&l.type.spec.selectable!==!1||d instanceof ke&&d.from<=i&&d.to>i)&&(this.mightDrag={node:l,pos:i,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&fo&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Wt(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>oa(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(mo(e))),this.updateAllowDefault(e),this.allowDefault||!t?Wt(this.view,"pointer"):sf(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||gr&&this.mightDrag&&!this.mightDrag.node.isAtom||Dt&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Nr(this.view,Oe.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):Wt(this.view,"pointer")}move(e){this.updateAllowDefault(e),Wt(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}bt.touchstart=r=>{r.input.lastTouch=Date.now(),aa(r),Wt(r,"pointer")};bt.touchmove=r=>{r.input.lastTouch=Date.now(),Wt(r,"pointer")};bt.contextmenu=r=>aa(r);function _s(r,e){return r.composing?!0:gr&&Math.abs(e.timeStamp-r.input.compositionEndedAt)<500?(r.input.compositionEndedAt=-2e8,!0):!1}const mf=mn?5e3:-1;st.compositionstart=st.compositionupdate=r=>{if(!r.composing){r.domObserver.flush();let{state:e}=r,t=e.selection.$to;if(e.selection instanceof ze&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(n=>n.type.spec.inclusive===!1)||Dt&&zs&&hf(r)))r.markCursor=r.state.storedMarks||t.marks(),Yn(r,!0),r.markCursor=null;else if(Yn(r,!e.selection.empty),fo&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let n=r.domSelectionRange();for(let o=n.focusNode,l=n.focusOffset;o&&o.nodeType==1&&l!=0;){let i=l<0?o.lastChild:o.childNodes[l-1];if(!i)break;if(i.nodeType==3){let s=r.domSelection();s&&s.collapse(i,i.nodeValue.length);break}else o=i,l=-1}}r.input.composing=!0}Gs(r,mf)};function hf(r){let{focusNode:e,focusOffset:t}=r.domSelectionRange();if(!e||e.nodeType!=1||t>=e.childNodes.length)return!1;let n=e.childNodes[t];return n.nodeType==1&&n.contentEditable=="false"}st.compositionend=(r,e)=>{r.composing&&(r.input.composing=!1,r.input.compositionEndedAt=e.timeStamp,r.input.compositionPendingChanges=r.domObserver.pendingRecords().length?r.input.compositionID:0,r.input.compositionNode=null,r.input.badSafariComposition?r.domObserver.forceFlush():r.input.compositionPendingChanges&&Promise.resolve().then(()=>r.domObserver.flush()),r.input.compositionID++,Gs(r,20))};function Gs(r,e){clearTimeout(r.input.composingTimeout),e>-1&&(r.input.composingTimeout=setTimeout(()=>Yn(r),e))}function pf(r){for(r.composing&&(r.input.composing=!1,r.input.compositionEndedAt=gf());r.input.compositionNodes.length>0;)r.input.compositionNodes.pop().markParentsDirty()}function gf(){let r=document.createEvent("Event");return r.initEvent("event",!0,!0),r.timeStamp}function Yn(r,e=!1){if(!(mn&&r.domObserver.flushingSoon>=0)){if(r.domObserver.forceFlush(),pf(r),e||r.docView&&r.docView.dirty){let t=F1(r),n=r.state.selection;return t&&!t.eq(n)?r.dispatch(r.state.tr.setSelection(t)):(r.markCursor||e)&&!n.$from.node(n.$from.sharedDepth(n.to)).inlineContent?r.dispatch(r.state.tr.deleteSelection()):r.updateState(r.state),!0}return!1}}function vf(r,e){if(!r.dom.parentNode)return;let t=r.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let n=getSelection(),o=document.createRange();o.selectNodeContents(e),r.dom.blur(),n.removeAllRanges(),n.addRange(o),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),r.focus()},50)}const on=fn&&Ls<15||ra&&V1<604;bt.copy=st.cut=(r,e)=>{let t=e,n=r.state.selection,o=t.type=="cut";if(n.empty)return;let l=on?null:t.clipboardData,i=n.content(),{dom:s,text:u}=Ps(r,i);l?(t.preventDefault(),l.clearData(),l.setData("text/html",s.innerHTML),l.setData("text/plain",u)):vf(r,s),o&&r.dispatch(r.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function bf(r){return r.openStart==0&&r.openEnd==0&&r.content.childCount==1?r.content.firstChild:null}function yf(r,e){if(!r.dom.parentNode)return;let t=r.input.shiftKey||r.state.selection.$from.parent.type.spec.code,n=r.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(n.contentEditable="true"),n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus();let o=r.input.shiftKey&&r.input.lastKeyCode!=45;setTimeout(()=>{r.focus(),n.parentNode&&n.parentNode.removeChild(n),t?Ll(r,n.value,null,o,e):Ll(r,n.textContent,n.innerHTML,o,e)},50)}function Ll(r,e,t,n,o){let l=Hs(r,e,t,n,r.state.selection.$from);if(r.someProp("handlePaste",u=>u(r,o,l||ye.empty)))return!0;if(!l)return!1;let i=bf(l),s=i?r.state.tr.replaceSelectionWith(i,n):r.state.tr.replaceSelection(l);return r.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Ks(r){let e=r.getData("text/plain")||r.getData("Text");if(e)return e;let t=r.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}st.paste=(r,e)=>{let t=e;if(r.composing&&!mn)return;let n=on?null:t.clipboardData,o=r.input.shiftKey&&r.input.lastKeyCode!=45;n&&Ll(r,Ks(n),n.getData("text/html"),o,t)?t.preventDefault():yf(r,t)};class wf{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}}const kf=ft?"altKey":"ctrlKey";function Ys(r,e){let t=r.someProp("dragCopies",n=>!n(e));return t??!e[kf]}bt.dragstart=(r,e)=>{let t=e,n=r.input.mouseDown;if(n&&n.done(),!t.dataTransfer)return;let o=r.state.selection,l=o.empty?null:r.posAtCoords(mo(t)),i;if(!(l&&l.pos>=o.from&&l.pos<=(o instanceof ke?o.to-1:o.to))){if(n&&n.mightDrag)i=ke.create(r.state.doc,n.mightDrag.pos);else if(t.target&&t.target.nodeType==1){let h=r.docView.nearestDesc(t.target,!0);h&&h.node.type.spec.draggable&&h!=r.docView&&(i=ke.create(r.state.doc,h.posBefore))}}let s=(i||r.state.selection).content(),{dom:u,text:d,slice:m}=Ps(r,s);(!t.dataTransfer.files.length||!Dt||Is>120)&&t.dataTransfer.clearData(),t.dataTransfer.setData(on?"Text":"text/html",u.innerHTML),t.dataTransfer.effectAllowed="copyMove",on||t.dataTransfer.setData("text/plain",d),r.dragging=new wf(m,Ys(r,t),i)};bt.dragend=r=>{let e=r.dragging;window.setTimeout(()=>{r.dragging==e&&(r.dragging=null)},50)};st.dragover=st.dragenter=(r,e)=>e.preventDefault();st.drop=(r,e)=>{try{xf(r,e,r.dragging)}finally{r.dragging=null}};function xf(r,e,t){if(!e.dataTransfer)return;let n=r.posAtCoords(mo(e));if(!n)return;let o=r.state.doc.resolve(n.pos),l=t&&t.slice;l?r.someProp("transformPasted",v=>{l=v(l,r,!1)}):l=Hs(r,Ks(e.dataTransfer),on?null:e.dataTransfer.getData("text/html"),!1,o);let i=!!(t&&Ys(r,e));if(r.someProp("handleDrop",v=>v(r,e,l||ye.empty,i))){e.preventDefault();return}if(!l)return;e.preventDefault();let s=l?D1(r.state.doc,o.pos,l):o.pos;s==null&&(s=o.pos);let u=r.state.tr;if(i){let{node:v}=t;v?v.replace(u):u.deleteSelection()}let d=u.mapping.map(s),m=l.openStart==0&&l.openEnd==0&&l.content.childCount==1,h=u.doc;if(m?u.replaceRangeWith(d,d,l.content.firstChild):u.replaceRange(d,d,l),u.doc.eq(h))return;let p=u.doc.resolve(d);if(m&&ke.isSelectable(l.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(l.content.firstChild))u.setSelection(new ke(p));else{let v=u.mapping.map(s);u.mapping.maps[u.mapping.maps.length-1].forEach((b,w,k,T)=>v=T),u.setSelection(Os(r,p,u.doc.resolve(v)))}r.focus(),r.dispatch(u.setMeta("uiEvent","drop"))}bt.focus=r=>{r.input.lastFocus=Date.now(),r.focused||(r.domObserver.stop(),r.dom.classList.add("ProseMirror-focused"),r.domObserver.start(),r.focused=!0,setTimeout(()=>{r.docView&&r.hasFocus()&&!r.domObserver.currentSelection.eq(r.domSelectionRange())&&oa(r)},20))};bt.blur=(r,e)=>{let t=e;r.focused&&(r.domObserver.stop(),r.dom.classList.remove("ProseMirror-focused"),r.domObserver.start(),t.relatedTarget&&r.dom.contains(t.relatedTarget)&&r.domObserver.currentSelection.clear(),r.focused=!1)};bt.beforeinput=(r,e)=>{if(Dt&&mn&&e.inputType=="deleteContentBackward"){r.domObserver.flushSoon();let{domChangeCount:n}=r.input;setTimeout(()=>{if(r.input.domChangeCount!=n||(r.dom.blur(),r.focus(),r.someProp("handleKeyDown",l=>l(r,Bs(8,"Backspace")))))return;let{$cursor:o}=r.state.selection;o&&o.pos>0&&r.dispatch(r.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let r in st)bt[r]=st[r];function ln(r,e){if(r==e)return!0;for(let t in r)if(r[t]!==e[t])return!1;for(let t in e)if(!(t in r))return!1;return!0}class Jn{constructor(e,t){this.toDOM=e,this.spec=t||dr,this.side=this.spec.side||0}map(e,t,n,o){let{pos:l,deleted:i}=e.mapResult(t.from+o,this.side<0?-1:1);return i?null:new vt(l-n,l-n,this)}valid(){return!0}eq(e){return this==e||e instanceof Jn&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&ln(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Kt{constructor(e,t){this.attrs=e,this.spec=t||dr}map(e,t,n,o){let l=e.map(t.from+o,this.spec.inclusiveStart?-1:1)-n,i=e.map(t.to+o,this.spec.inclusiveEnd?1:-1)-n;return l>=i?null:new vt(l,i,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof Kt&&ln(this.attrs,e.attrs)&&ln(this.spec,e.spec)}static is(e){return e.type instanceof Kt}destroy(){}}class ia{constructor(e,t){this.attrs=e,this.spec=t||dr}map(e,t,n,o){let l=e.mapResult(t.from+o,1);if(l.deleted)return null;let i=e.mapResult(t.to+o,-1);return i.deleted||i.pos<=l.pos?null:new vt(l.pos-n,i.pos-n,this)}valid(e,t){let{index:n,offset:o}=e.content.findIndex(t.from),l;return o==t.from&&!(l=e.child(n)).isText&&o+l.nodeSize==t.to}eq(e){return this==e||e instanceof ia&&ln(this.attrs,e.attrs)&&ln(this.spec,e.spec)}destroy(){}}class vt{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new vt(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(e,t,n){return new vt(e,e,new Jn(t,n))}static inline(e,t,n,o){return new vt(e,t,new Kt(n,o))}static node(e,t,n,o){return new vt(e,t,new ia(n,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof Kt}get widget(){return this.type instanceof Jn}}const Ar=[],dr={};class Le{constructor(e,t){this.local=e.length?e:Ar,this.children=t.length?t:Ar}static create(e,t){return t.length?Xn(t,e,0,dr):Qe}find(e,t,n){let o=[];return this.findInner(e??0,t??1e9,o,0,n),o}findInner(e,t,n,o,l){for(let i=0;i<this.local.length;i++){let s=this.local[i];s.from<=t&&s.to>=e&&(!l||l(s.spec))&&n.push(s.copy(s.from+o,s.to+o))}for(let i=0;i<this.children.length;i+=3)if(this.children[i]<t&&this.children[i+1]>e){let s=this.children[i]+1;this.children[i+2].findInner(e-s,t-s,n,o+s,l)}}map(e,t,n){return this==Qe||e.maps.length==0?this:this.mapInner(e,t,0,0,n||dr)}mapInner(e,t,n,o,l){let i;for(let s=0;s<this.local.length;s++){let u=this.local[s].map(e,n,o);u&&u.type.valid(t,u)?(i||(i=[])).push(u):l.onRemove&&l.onRemove(this.local[s].spec)}return this.children.length?Cf(this.children,i||[],e,t,n,o,l):i?new Le(i.sort(fr),Ar):Qe}add(e,t){return t.length?this==Qe?Le.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let o,l=0;e.forEach((s,u)=>{let d=u+n,m;if(m=Xs(t,s,d)){for(o||(o=this.children.slice());l<o.length&&o[l]<u;)l+=3;o[l]==u?o[l+2]=o[l+2].addInner(s,m,d+1):o.splice(l,0,u,u+s.nodeSize,Xn(m,s,d+1,dr)),l+=3}});let i=Js(l?js(t):t,-n);for(let s=0;s<i.length;s++)i[s].type.valid(e,i[s])||i.splice(s--,1);return new Le(i.length?this.local.concat(i).sort(fr):this.local,o||this.children)}remove(e){return e.length==0||this==Qe?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,o=this.local;for(let l=0;l<n.length;l+=3){let i,s=n[l]+t,u=n[l+1]+t;for(let m=0,h;m<e.length;m++)(h=e[m])&&h.from>s&&h.to<u&&(e[m]=null,(i||(i=[])).push(h));if(!i)continue;n==this.children&&(n=this.children.slice());let d=n[l+2].removeInner(i,s+1);d!=Qe?n[l+2]=d:(n.splice(l,3),l-=3)}if(o.length){for(let l=0,i;l<e.length;l++)if(i=e[l])for(let s=0;s<o.length;s++)o[s].eq(i,t)&&(o==this.local&&(o=this.local.slice()),o.splice(s--,1))}return n==this.children&&o==this.local?this:o.length||n.length?new Le(o,n):Qe}forChild(e,t){if(this==Qe)return this;if(t.isLeaf)return Le.empty;let n,o;for(let s=0;s<this.children.length;s+=3)if(this.children[s]>=e){this.children[s]==e&&(n=this.children[s+2]);break}let l=e+1,i=l+t.content.size;for(let s=0;s<this.local.length;s++){let u=this.local[s];if(u.from<i&&u.to>l&&u.type instanceof Kt){let d=Math.max(l,u.from)-l,m=Math.min(i,u.to)-l;d<m&&(o||(o=[])).push(u.copy(d,m))}}if(o){let s=new Le(o.sort(fr),Ar);return n?new lr([s,n]):s}return n||Qe}eq(e){if(this==e)return!0;if(!(e instanceof Le)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return sa(this.localsInner(e))}localsInner(e){if(this==Qe)return Ar;if(e.inlineContent||!this.local.some(Kt.is))return this.local;let t=[];for(let n=0;n<this.local.length;n++)this.local[n].type instanceof Kt||t.push(this.local[n]);return t}forEachSet(e){e(this)}}Le.empty=new Le([],[]);Le.removeOverlap=sa;const Qe=Le.empty;class lr{constructor(e){this.members=e}map(e,t){const n=this.members.map(o=>o.map(e,t,dr));return lr.from(n)}forChild(e,t){if(t.isLeaf)return Le.empty;let n=[];for(let o=0;o<this.members.length;o++){let l=this.members[o].forChild(e,t);l!=Qe&&(l instanceof lr?n=n.concat(l.members):n.push(l))}return lr.from(n)}eq(e){if(!(e instanceof lr)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,n=!0;for(let o=0;o<this.members.length;o++){let l=this.members[o].localsInner(e);if(l.length)if(!t)t=l;else{n&&(t=t.slice(),n=!1);for(let i=0;i<l.length;i++)t.push(l[i])}}return t?sa(n?t:t.sort(fr)):Ar}static from(e){switch(e.length){case 0:return Qe;case 1:return e[0];default:return new lr(e.every(t=>t instanceof Le)?e:e.reduce((t,n)=>t.concat(n instanceof Le?n:n.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function Cf(r,e,t,n,o,l,i){let s=r.slice();for(let d=0,m=l;d<t.maps.length;d++){let h=0;t.maps[d].forEach((p,v,b,w)=>{let k=w-b-(v-p);for(let T=0;T<s.length;T+=3){let E=s[T+1];if(E<0||p>E+m-h)continue;let M=s[T]+m-h;v>=M?s[T+1]=p<=M?-2:-1:p>=m&&k&&(s[T]+=k,s[T+1]+=k)}h+=k}),m=t.maps[d].map(m,-1)}let u=!1;for(let d=0;d<s.length;d+=3)if(s[d+1]<0){if(s[d+1]==-2){u=!0,s[d+1]=-1;continue}let m=t.map(r[d]+l),h=m-o;if(h<0||h>=n.content.size){u=!0;continue}let p=t.map(r[d+1]+l,-1),v=p-o,{index:b,offset:w}=n.content.findIndex(h),k=n.maybeChild(b);if(k&&w==h&&w+k.nodeSize==v){let T=s[d+2].mapInner(t,k,m+1,r[d]+l+1,i);T!=Qe?(s[d]=h,s[d+1]=v,s[d+2]=T):(s[d+1]=-2,u=!0)}else u=!0}if(u){let d=Tf(s,r,e,t,o,l,i),m=Xn(d,n,0,i);e=m.local;for(let h=0;h<s.length;h+=3)s[h+1]<0&&(s.splice(h,3),h-=3);for(let h=0,p=0;h<m.children.length;h+=3){let v=m.children[h];for(;p<s.length&&s[p]<v;)p+=3;s.splice(p,0,m.children[h],m.children[h+1],m.children[h+2])}}return new Le(e.sort(fr),s)}function Js(r,e){if(!e||!r.length)return r;let t=[];for(let n=0;n<r.length;n++){let o=r[n];t.push(new vt(o.from+e,o.to+e,o.type))}return t}function Tf(r,e,t,n,o,l,i){function s(u,d){for(let m=0;m<u.local.length;m++){let h=u.local[m].map(n,o,d);h?t.push(h):i.onRemove&&i.onRemove(u.local[m].spec)}for(let m=0;m<u.children.length;m+=3)s(u.children[m+2],u.children[m]+d+1)}for(let u=0;u<r.length;u+=3)r[u+1]==-1&&s(r[u+2],e[u]+l+1);return t}function Xs(r,e,t){if(e.isLeaf)return null;let n=t+e.nodeSize,o=null;for(let l=0,i;l<r.length;l++)(i=r[l])&&i.from>t&&i.to<n&&((o||(o=[])).push(i),r[l]=null);return o}function js(r){let e=[];for(let t=0;t<r.length;t++)r[t]!=null&&e.push(r[t]);return e}function Xn(r,e,t,n){let o=[],l=!1;e.forEach((s,u)=>{let d=Xs(r,s,u+t);if(d){l=!0;let m=Xn(d,s,t+u+1,n);m!=Qe&&o.push(u,u+s.nodeSize,m)}});let i=Js(l?js(r):r,-t).sort(fr);for(let s=0;s<i.length;s++)i[s].type.valid(e,i[s])||(n.onRemove&&n.onRemove(i[s].spec),i.splice(s--,1));return i.length||o.length?new Le(i,o):Qe}function fr(r,e){return r.from-e.from||r.to-e.to}function sa(r){let e=r;for(let t=0;t<e.length-1;t++){let n=e[t];if(n.from!=n.to)for(let o=t+1;o<e.length;o++){let l=e[o];if(l.from==n.from){l.to!=n.to&&(e==r&&(e=r.slice()),e[o]=l.copy(l.from,n.to),N0(e,o+1,l.copy(n.to,l.to)));continue}else{l.from<n.to&&(e==r&&(e=r.slice()),e[t]=n.copy(n.from,l.from),N0(e,o,n.copy(l.from,n.to)));break}}}return e}function N0(r,e,t){for(;e<r.length&&fr(t,r[e])>0;)e++;r.splice(e,0,t)}const Ko=new Map,Yo=new Set,Gr=new Set,qe={getTitle:r=>Ko.get(r),hasTitle:r=>Ko.has(r),setTitle:(r,e)=>{Ko.set(r,e)},isPinned:r=>Yo.has(r),pin:r=>{Yo.add(r)},unpin:r=>{Yo.delete(r)},isFetching:r=>Gr.has(r),startFetch:r=>{Gr.add(r)},endFetch:r=>{Gr.delete(r)},fetchingSize:()=>Gr.size,fetchingSet:()=>Gr},Er=new Ss("autoLinkTitle");function Ef(){const r=document.createElement("span");return r.className="link-loading-icon",r.setAttribute("contenteditable","false"),r.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><path d="M21 12a9 9 0 1 1-6.219-8.56"/></svg>',r}function L0(r,e){const t=e.marks.link;if(!t||qe.fetchingSize()===0)return Le.empty;const n=[];return r.descendants((o,l)=>{if(!o.isText)return;const i=o.marks.find(u=>u.type===t);if(!i)return;const s=i.attrs.href;s!=null&&s.startsWith("http")&&(!qe.isFetching(s)||qe.isPinned(s)||o.text===s&&n.push(vt.widget(l+o.nodeSize,Ef,{side:1,key:`ld:${l}`})))}),Le.create(r,n)}const Sf=Me.Extension.create({name:"autoLinkTitle",addProseMirrorPlugins(){return[new Ts({key:Er,state:{init(r,e){return L0(e.doc,e.schema)},apply(r,e,t,n){return qe.fetchingSize()===0?Le.empty:!r.docChanged&&!r.getMeta(Er)?e.map(r.mapping,n.doc):L0(n.doc,n.schema)}},props:{decorations(r){return Er.getState(r)}},view(){return{update(r,e){if(r.state.doc.eq(e.doc))return;const t=r.state.schema.marks.link;if(!t)return;const n=new Map;r.state.doc.descendants((o,l)=>{if(!o.isText)return;const i=o.marks.find(u=>u.type===t);if(!i)return;const s=i.attrs.href;!s||!s.startsWith("http")||o.text===s&&(n.has(s)||n.set(s,[]),n.get(s).push({from:l,to:l+o.nodeSize}))}),n.size!==0&&n.forEach((o,l)=>{if(!qe.isPinned(l)){if(qe.hasTitle(l)){const i=qe.getTitle(l);i&&I0(r,l,i,t);return}qe.isFetching(l)||(qe.startFetch(l),r.dispatch(r.state.tr.setMeta(Er,!0)),fetch(`/api/fetch-meta?url=${encodeURIComponent(l)}`,{signal:AbortSignal.timeout(6e3)}).then(i=>i.ok?i.json():null).then(i=>{var u;const s=((u=i==null?void 0:i.title)==null?void 0:u.trim())??"";qe.setTitle(l,s),qe.endFetch(l),s&&!qe.isPinned(l)?I0(r,l,s,t):r.dispatch(r.state.tr.setMeta(Er,!0))}).catch(()=>{qe.setTitle(l,""),qe.endFetch(l),r.dispatch(r.state.tr.setMeta(Er,!0))}))}})}}}})]}});function I0(r,e,t,n){const o=r.state,l=[];if(o.doc.descendants((s,u)=>{if(!s.isText)return;const d=s.marks.find(m=>m.type===n);!d||d.attrs.href!==e||s.text===e&&l.push({from:u,to:u+s.nodeSize,mark:d})}),l.length===0)return;let i=o.tr;l.reverse().forEach(({from:s,to:u,mark:d})=>{i=i.replaceWith(s,u,o.schema.text(t,[d]))}),r.dispatch(i)}const Mf=rt.EditorView.theme({"&":{fontSize:"13px",fontFamily:"'JetBrains Mono', 'Cascadia Code', 'Fira Code', monospace",backgroundColor:"transparent"},".cm-content":{padding:"10px 0",caretColor:"#3370ff",fontFamily:"'JetBrains Mono', monospace"},".cm-focused":{outline:"none"},".cm-line":{padding:"0 16px",lineHeight:"1.6",color:"#1f2329"},".cm-lineNumbers .cm-gutterElement":{color:"#bbbfc4",fontSize:"12px",minWidth:"32px",paddingRight:"8px",userSelect:"none"},".cm-gutters":{backgroundColor:"transparent",border:"none",color:"#bbbfc4"},".cm-activeLineGutter":{backgroundColor:"transparent",color:"#8f959e"},".cm-activeLine":{backgroundColor:"rgba(51, 112, 255, 0.04)"},".cm-matchingBracket":{backgroundColor:"rgba(51, 112, 255, 0.15)",outline:"1px solid rgba(51, 112, 255, 0.3)"},".cm-selectionBackground":{backgroundColor:"rgba(51, 112, 255, 0.18)"},"&.cm-focused .cm-selectionBackground":{backgroundColor:"rgba(51, 112, 255, 0.18)"},".cm-cursor":{borderLeftColor:"#3370ff",borderLeftWidth:"2px"},".cm-scroller":{overflow:"auto"}},{dark:!1}),z0=rt.EditorView.lineWrapping;function D0(r){const{container:e,wordWrap:t,onContentChange:n}=r,o=r.readOnly??a.ref(!1);r.initialContent,r.initialLanguage;let l=null,i=!1;const s=new tr.Compartment,u=new tr.Compartment,d=new tr.Compartment,m=new tr.Compartment;function h(D){var H;const W=(((H=r.commentRanges)==null?void 0:H.value)??[]).map(A=>({from:Math.max(0,Math.min(A.from,D)),to:Math.max(0,Math.min(A.to,D)),commentIds:A.commentIds.filter(R=>R.length>0)})).filter(A=>A.from<A.to&&A.commentIds.length>0).sort((A,R)=>A.from-R.from||A.to-R.to).map(A=>rt.Decoration.mark({class:"pagely-comment-inline",attributes:{"data-comment-ids":JSON.stringify(A.commentIds),...A.commentIds.length>1?{"data-comment-count":String(A.commentIds.length)}:{}}}).range(A.from,A.to));return rt.Decoration.set(W,!0)}function p(D){return rt.EditorView.decorations.of(h(D))}function v(){if(!l||!r.onSelectionChange)return;const D=l.state.selection.main;if(D.empty){r.onSelectionChange(null);return}const z=Math.min(D.from,D.to),W=Math.max(D.from,D.to),H=l.coordsAtPos(z),A=l.coordsAtPos(W);if(!H||!A){r.onSelectionChange(null);return}const R=Math.min(H.left,A.left),K=Math.max(H.right,A.right),J=Math.min(H.top,A.top),te=Math.max(H.bottom,A.bottom);r.onSelectionChange({from:z,to:W,rect:new DOMRect(R,J,K-R,te-J)})}async function b(D){try{switch(D){case"javascript":case"typescript":{const{javascript:z}=await import("@codemirror/lang-javascript");return z({typescript:D==="typescript",jsx:!1})}case"jsx":case"tsx":{const{javascript:z}=await import("@codemirror/lang-javascript");return z({typescript:D==="tsx",jsx:!0})}case"python":{const{python:z}=await import("@codemirror/lang-python");return z()}case"html":{const{html:z}=await import("@codemirror/lang-html");return z()}case"css":{const{css:z}=await import("@codemirror/lang-css");return z()}case"json":{const{json:z}=await import("@codemirror/lang-json");return z()}case"markdown":{const{markdown:z}=await import("@codemirror/lang-markdown");return z()}case"java":{const{java:z}=await import("@codemirror/lang-java");return z()}case"cpp":case"c":{const{cpp:z}=await import("@codemirror/lang-cpp");return z()}case"rust":{const{rust:z}=await import("@codemirror/lang-rust");return z()}case"sql":{const{sql:z}=await import("@codemirror/lang-sql");return z()}case"xml":{const{xml:z}=await import("@codemirror/lang-xml");return z()}case"php":{const{php:z}=await import("@codemirror/lang-php");return z()}default:return[]}}catch{return[]}}async function w(D,z){if(!e.value)return;const W=await b(z),H=t.value?z0:[],A=rt.EditorView.updateListener.of(K=>{K.docChanged&&!i&&!o.value&&n(K.state.doc.toString()),K.selectionSet&&requestAnimationFrame(v)}),R=tr.EditorState.create({doc:D,extensions:[yn.history(),rt.keymap.of([..._a.closeBracketsKeymap,...yn.defaultKeymap,...yn.historyKeymap,yn.indentWithTab]),rt.lineNumbers(),rt.highlightActiveLine(),_r.bracketMatching(),_a.closeBrackets(),_r.indentOnInput(),_r.foldGutter(),_r.syntaxHighlighting(_r.defaultHighlightStyle),s.of(W),u.of(H),d.of([tr.EditorState.readOnly.of(o.value),rt.EditorView.editable.of(!o.value)]),m.of(p(D.length)),Mf,A,rt.EditorView.domEventHandlers({mouseup:()=>(requestAnimationFrame(v),!1),keyup:()=>(requestAnimationFrame(v),!1)}),rt.EditorView.contentAttributes.of({"data-gramm":"false"})]});l=new rt.EditorView({state:R,parent:e.value})}function k(D){!l||l.state.doc.toString()===D||(i=!0,l.dispatch({changes:{from:0,to:l.state.doc.length,insert:D}}),i=!1)}async function T(D){if(!l)return;const z=await b(D);l&&l.dispatch({effects:s.reconfigure(z)})}function E(D){l&&l.dispatch({effects:u.reconfigure(D?z0:[])})}a.watch(o,D=>{l&&l.dispatch({effects:d.reconfigure([tr.EditorState.readOnly.of(D),rt.EditorView.editable.of(!D)])})}),r.commentRanges&&a.watch(r.commentRanges,()=>{l&&l.dispatch({effects:m.reconfigure(p(l.state.doc.length))})},{deep:!0});function M(){return l}function B(){l==null||l.destroy(),l=null}return{initCM:w,syncFromPM:k,switchLanguage:T,setWordWrap:E,getCMView:M,destroy:B}}function hn(r){const e=a.computed(()=>We(r().commentIds)),t=a.computed(()=>{const o=e.value;return o.length===0?{}:{"data-comment-ids":JSON.stringify(o),"data-comment-count":o.length>1?String(o.length):void 0}}),n=a.computed(()=>({"pagely-comment-block":e.value.length>0}));return{commentAttrs:t,commentClass:n}}const Af={class:"eb-modal",role:"dialog","aria-modal":"true"},Bf={class:"eb-modal-body"},ho=a.defineComponent({__name:"EmbedFullscreenModal",props:{open:{type:Boolean},beforeClose:{},closeLabel:{default:"完成"}},emits:["update:open"],setup(r,{emit:e}){const t=r,n=e;let o=!1;async function l(){var s;if(!o){o=!0;try{await((s=t.beforeClose)==null?void 0:s.call(t)),n("update:open",!1)}catch(u){console.error(u)}finally{o=!1}}}function i(s){!t.open||s.key!=="Escape"||(s.preventDefault(),s.stopPropagation(),l())}return a.watch(()=>t.open,s=>{s?document.addEventListener("keydown",i,!0):document.removeEventListener("keydown",i,!0)},{immediate:!0}),a.onBeforeUnmount(()=>{document.removeEventListener("keydown",i,!0)}),(s,u)=>(a.openBlock(),a.createBlock(a.Teleport,{to:"body"},[a.createVNode(a.Transition,{name:"eb-modal"},{default:a.withCtx(()=>[r.open?(a.openBlock(),a.createElementBlock("div",{key:0,class:"eb-modal-backdrop",onClick:a.withModifiers(l,["self"])},[a.createElementVNode("div",Af,[a.createElementVNode("div",{class:"eb-modal-toolbar eb-toolbar",onMousedown:u[0]||(u[0]=a.withModifiers(()=>{},["prevent"]))},[a.renderSlot(s.$slots,"toolbar"),u[1]||(u[1]=a.createElementVNode("div",{class:"eb-spacer"},null,-1)),a.createElementVNode("button",{class:"eb-btn eb-btn--text",type:"button",title:"关闭全屏 (Esc)",onClick:l},[a.createVNode(a.unref(L.Minimize2),{size:14,"stroke-width":1.4}),a.createElementVNode("span",null,a.toDisplayString(r.closeLabel),1)])],32),a.createElementVNode("div",Bf,[a.renderSlot(s.$slots,"body")])])])):a.createCommentVNode("",!0)]),_:3})]))}}),Nf=["disabled","title"],Lf=["value","readonly"],If=["value","disabled"],zf=["value"],Df=["disabled"],Of={key:0,class:"cm-copy-tip"},Rf=["value","readonly"],Pf=["value","disabled"],Hf=["value"],Vf=["disabled"],Ff={key:0,class:"cm-copy-tip"},$f=a.defineComponent({__name:"CodeBlockView",props:_e.nodeViewProps,setup(r){const e=r,{commentAttrs:t,commentClass:n}=hn(()=>e.node.attrs),o=a.ref(null),l=a.ref(null),i=a.ref(!1),s=a.ref(""),u=a.ref("plaintext"),d=a.ref(""),m=a.ref(!1),h=a.computed(()=>e.node.attrs.language??"plaintext"),p=a.computed(()=>e.node.attrs.title??""),v=a.computed(()=>e.node.attrs.collapsed??!1),b=a.computed(()=>e.node.attrs.wordWrap??!1),w=a.computed(()=>e.editor.isEditable),k=a.computed(()=>{const ne=[];return e.node.descendants((N,O)=>{if(!N.isText)return!0;for(const $ of N.marks){if($.type.name!=="commentMark")continue;const X=We($.attrs.commentIds);X.length>0&&ne.push({from:O,to:O+N.nodeSize,commentIds:X})}return!1}),ne});function T(ne,N={},O=!1){var Xe,ue;const $=(Xe=e.getPos)==null?void 0:Xe.call(e);if($===void 0||!((ue=e.editor)!=null&&ue.view))return;const{state:X,dispatch:oe}=e.editor.view,ve=X.doc.nodeAt($);if(!ve)return;const Be={...ve.attrs,...N},$e=X.schema,ot=X.tr.replaceWith($,$+ve.nodeSize,ve.type.create(Be,ne.length>0?$e.text(ne):[]));ot.setMeta("addToHistory",O),oe(ot)}function E(ne){w.value&&T(ne)}function M(ne){var ve,Be;if(!w.value||!((ve=e.editor)!=null&&ve.view))return;if(!ne){window.dispatchEvent(new CustomEvent("pagely:code-selection-toolbar",{detail:{editor:e.editor,rect:null}}));return}const N=(Be=e.getPos)==null?void 0:Be.call(e);if(N===void 0)return;const O=N+1+ne.from,$=N+1+ne.to,{state:X,dispatch:oe}=e.editor.view;O<0||$>X.doc.content.size||O>=$||(oe(X.tr.setSelection(mr.TextSelection.create(X.doc,O,$))),window.dispatchEvent(new CustomEvent("pagely:code-selection-toolbar",{detail:{editor:e.editor,rect:ne.rect}})))}const{initCM:B,syncFromPM:D,switchLanguage:z,setWordWrap:W,destroy:H}=D0({container:o,initialContent:e.node.textContent,initialLanguage:h.value,wordWrap:a.ref(b.value),readOnly:a.computed(()=>!w.value),onContentChange:E,onSelectionChange:M,commentRanges:k}),{initCM:A,switchLanguage:R,setWordWrap:K,destroy:J}=D0({container:l,initialContent:e.node.textContent,initialLanguage:h.value,wordWrap:m,readOnly:a.computed(()=>!w.value),onContentChange:ne=>{w.value&&(s.value=ne)}});a.onMounted(()=>{B(e.node.textContent,h.value)}),a.onBeforeUnmount(()=>{H(),J()}),a.watch(()=>e.node.textContent,ne=>{D(ne)}),a.watch(()=>e.node.attrs.language,ne=>{z(ne)}),a.watch(()=>e.node.attrs.wordWrap,ne=>{W(ne)}),a.watch(i,ne=>{ne||J()});function te(){var ne;w.value&&((ne=e.updateAttributes)==null||ne.call(e,{collapsed:!v.value}))}function Z(ne){var N;w.value&&((N=e.updateAttributes)==null||N.call(e,{title:ne.target.value}))}function le(ne){var N;w.value&&((N=e.updateAttributes)==null||N.call(e,{language:ne.target.value}))}function ee(){var ne;w.value&&((ne=e.updateAttributes)==null||ne.call(e,{wordWrap:!b.value}))}function we(){s.value=e.node.textContent,u.value=h.value,d.value=p.value,m.value=b.value,i.value=!0,a.nextTick(async()=>{J(),await A(s.value,u.value),K(m.value)})}function pe(ne){w.value&&(d.value=ne.target.value)}function se(ne){if(!w.value)return;const N=ne.target.value;u.value=N,R(N)}function I(){w.value&&(m.value=!m.value,K(m.value))}function P(){w.value&&T(s.value,{language:u.value,title:d.value,wordWrap:m.value},!0)}const V=a.ref(!1);let q=null;function ae(){const ne=e.node.textContent;navigator.clipboard.writeText(ne).then(()=>{V.value=!0,q&&clearTimeout(q),q=setTimeout(()=>{V.value=!1,q=null},1500)})}function ge(){navigator.clipboard.writeText(s.value).then(()=>{V.value=!0,q&&clearTimeout(q),q=setTimeout(()=>{V.value=!1,q=null},1500)})}return(ne,N)=>(a.openBlock(),a.createBlock(a.unref(_e.NodeViewWrapper),a.mergeProps({"data-type":"code-block",class:["code-block-cm",[{"is-collapsed":v.value},a.unref(n)]]},a.unref(t)),{default:a.withCtx(()=>[a.createElementVNode("div",{class:"cm-toolbar",onMousedown:N[4]||(N[4]=a.withModifiers(()=>{},["prevent"]))},[a.createElementVNode("button",{class:a.normalizeClass(["cm-btn cm-chevron",{collapsed:v.value}]),disabled:!w.value,title:v.value?"展开":"收起",onClick:te},[a.createVNode(a.unref(L.ChevronDown),{size:10,"stroke-width":1.8})],10,Nf),a.createElementVNode("input",{class:"cm-title-input",type:"text",placeholder:"添加标题…",value:p.value,readonly:!w.value,onInput:Z,onKeydown:N[0]||(N[0]=a.withModifiers(()=>{},["stop"])),onMousedown:N[1]||(N[1]=a.withModifiers(()=>{},["stop"]))},null,40,Lf),a.createElementVNode("select",{class:"cm-lang-select",value:h.value,disabled:!w.value,onChange:le,onMousedown:N[2]||(N[2]=a.withModifiers(()=>{},["stop"])),onKeydown:N[3]||(N[3]=a.withModifiers(()=>{},["stop"]))},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(O0),O=>(a.openBlock(),a.createElementBlock("option",{key:O.id,value:O.id},a.toDisplayString(O.label),9,zf))),128))],40,If),a.createElementVNode("button",{class:a.normalizeClass(["cm-btn",{active:b.value}]),disabled:!w.value,title:"自动换行",onClick:ee},[a.createVNode(a.unref(L.WrapText),{size:14,"stroke-width":1.4})],10,Df),a.createElementVNode("button",{class:"cm-btn",title:"复制代码",onClick:ae},[a.createVNode(a.unref(L.Copy),{size:14,"stroke-width":1.4}),V.value?(a.openBlock(),a.createElementBlock("span",Of,"已复制")):a.createCommentVNode("",!0)]),a.createElementVNode("button",{class:"cm-btn",title:"全屏",onClick:we},[a.createVNode(a.unref(L.Maximize2),{size:14,"stroke-width":1.4})])],32),a.withDirectives(a.createElementVNode("div",{ref_key:"cmContainer",ref:o,class:"cm-editor-wrap"},null,512),[[a.vShow,!v.value]]),a.createVNode(ho,{open:i.value,"onUpdate:open":N[9]||(N[9]=O=>i.value=O),"before-close":P,"close-label":"完成"},{toolbar:a.withCtx(()=>[a.createElementVNode("input",{class:"cm-title-input cm-title-input--fullscreen",type:"text",placeholder:"添加标题…",value:d.value,readonly:!w.value,onInput:pe,onKeydown:N[5]||(N[5]=a.withModifiers(()=>{},["stop"])),onMousedown:N[6]||(N[6]=a.withModifiers(()=>{},["stop"]))},null,40,Rf),a.createElementVNode("select",{class:"cm-lang-select",value:u.value,disabled:!w.value,onChange:se,onMousedown:N[7]||(N[7]=a.withModifiers(()=>{},["stop"])),onKeydown:N[8]||(N[8]=a.withModifiers(()=>{},["stop"]))},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(O0),O=>(a.openBlock(),a.createElementBlock("option",{key:O.id,value:O.id},a.toDisplayString(O.label),9,Hf))),128))],40,Pf),a.createElementVNode("button",{class:a.normalizeClass(["cm-btn",{active:m.value}]),disabled:!w.value,title:"自动换行",onClick:I},[a.createVNode(a.unref(L.WrapText),{size:14,"stroke-width":1.4})],10,Vf),a.createElementVNode("button",{class:"cm-btn",title:"复制代码",onClick:ge},[a.createVNode(a.unref(L.Copy),{size:14,"stroke-width":1.4}),V.value?(a.openBlock(),a.createElementBlock("span",Ff,"已复制")):a.createCommentVNode("",!0)])]),body:a.withCtx(()=>[a.createElementVNode("div",{ref_key:"fullscreenCmContainer",ref:l,class:"cm-editor-wrap cm-editor-wrap--fullscreen"},null,512)]),_:1},8,["open"])]),_:1},16,["class"]))}}),O0=[{id:"plaintext",label:"Plain Text"},{id:"javascript",label:"JavaScript"},{id:"typescript",label:"TypeScript"},{id:"jsx",label:"JSX"},{id:"tsx",label:"TSX"},{id:"python",label:"Python"},{id:"html",label:"HTML"},{id:"css",label:"CSS"},{id:"json",label:"JSON"},{id:"java",label:"Java"},{id:"cpp",label:"C++"},{id:"rust",label:"Rust"},{id:"sql",label:"SQL"},{id:"markdown",label:"Markdown"},{id:"xml",label:"XML"},{id:"php",label:"PHP"}],qf=Me.Node.create({name:"codeBlock",content:"text*",marks:"commentMark",group:"block",code:!0,defining:!0,isolating:!0,addAttributes(){return{language:{default:"plaintext",parseHTML:r=>{var e;return r.getAttribute("data-language")??((e=r.querySelector("code"))==null?void 0:e.className.replace("language-",""))??"plaintext"}},title:{default:"",parseHTML:r=>r.getAttribute("data-title")??""},collapsed:{default:!1,parseHTML:r=>r.getAttribute("data-collapsed")==="true"},wordWrap:{default:!1,parseHTML:r=>r.getAttribute("data-word-wrap")==="true"}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full",getAttrs:r=>r.getAttribute("data-type")==="mermaid-block"?!1:null},{tag:'div[data-type="code-block"]',preserveWhitespace:"full"}]},renderHTML({node:r,HTMLAttributes:e}){return["pre",Me.mergeAttributes(e,{"data-type":"code-block","data-language":r.attrs.language,"data-title":r.attrs.title,"data-collapsed":r.attrs.collapsed,"data-word-wrap":r.attrs.wordWrap}),["code",0]]},addCommands(){return{setCodeBlock:r=>({commands:e})=>e.setNode(this.name,r),unsetCodeBlock:()=>({commands:r})=>r.setNode("paragraph"),toggleCodeBlock:r=>({commands:e})=>e.toggleNode(this.name,"paragraph",r)}},addKeyboardShortcuts(){return{"Mod-Enter":()=>{const{state:r}=this.editor.view,{$from:e}=r.selection;return e.parent.type.name!==this.name?!1:this.editor.commands.exitCode()}}},addNodeView(){return _e.VueNodeViewRenderer($f)}});class _ extends Error{constructor(e,t){var n="KaTeX parse error: "+e,o,l,i=t&&t.loc;if(i&&i.start<=i.end){var s=i.lexer.input;o=i.start,l=i.end,o===s.length?n+=" at end of input: ":n+=" at position "+(o+1)+": ";var u=s.slice(o,l).replace(/[^]/g,"$&̲"),d;o>15?d="…"+s.slice(o-15,o):d=s.slice(0,o);var m;l+15<s.length?m=s.slice(l,l+15)+"…":m=s.slice(l),n+=d+u+m}super(n),this.name="ParseError",Object.setPrototypeOf(this,_.prototype),this.position=o,o!=null&&l!=null&&(this.length=l-o),this.rawMessage=e}}var Uf=/([A-Z])/g,ua=r=>r.replace(Uf,"-$1").toLowerCase(),Wf={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},_f=/[&><"']/g,Ye=r=>String(r).replace(_f,e=>Wf[e]),Rn=r=>r.type==="ordgroup"||r.type==="color"?r.body.length===1?Rn(r.body[0]):r:r.type==="font"?Rn(r.body):r,Gf=new Set(["mathord","textord","atom"]),Ot=r=>Gf.has(Rn(r).type),Kf=r=>{var e=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(r);return e?e[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e[1])?null:e[1].toLowerCase():"_relative"},Il={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:r=>"#"+r},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:(r,e)=>(e.push(r),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:r=>Math.max(0,r),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:r=>Math.max(0,r),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:r=>Math.max(0,r),cli:"-e, --max-expand <n>",cliProcessor:r=>r==="Infinity"?1/0:parseInt(r)},globalGroup:{type:"boolean",cli:!1}};function Yf(r){if("default"in r)return r.default;var e=r.type,t=Array.isArray(e)?e[0]:e;if(typeof t!="string")return t.enum[0];switch(t){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class ca{constructor(e){e===void 0&&(e={}),e=e||{};for(var t of Object.keys(Il)){var n=Il[t],o=e[t];this[t]=o!==void 0?n.processor?n.processor(o):o:Yf(n)}}reportNonstrict(e,t,n){var o=this.strict;if(typeof o=="function"&&(o=o(e,t,n)),!(!o||o==="ignore")){if(o===!0||o==="error")throw new _("LaTeX-incompatible input and strict mode is set to 'error': "+(t+" ["+e+"]"),n);o==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+o+"': "+t+" ["+e+"]"))}}useStrictBehavior(e,t,n){var o=this.strict;if(typeof o=="function")try{o=o(e,t,n)}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': "+(t+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+o+"': "+t+" ["+e+"]")),!1)}isTrusted(e){if("url"in e&&e.url&&!e.protocol){var t=Kf(e.url);if(t==null)return!1;e.protocol=t}var n=typeof this.trust=="function"?this.trust(e):this.trust;return!!n}}class Ft{constructor(e,t,n){this.id=e,this.size=t,this.cramped=n}sup(){return yt[Jf[this.id]]}sub(){return yt[Xf[this.id]]}fracNum(){return yt[jf[this.id]]}fracDen(){return yt[Qf[this.id]]}cramp(){return yt[Zf[this.id]]}text(){return yt[em[this.id]]}isTight(){return this.size>=2}}var da=0,jn=1,Lr=2,It=3,an=4,ht=5,Or=6,et=7,yt=[new Ft(da,0,!1),new Ft(jn,0,!0),new Ft(Lr,1,!1),new Ft(It,1,!0),new Ft(an,2,!1),new Ft(ht,2,!0),new Ft(Or,3,!1),new Ft(et,3,!0)],Jf=[an,ht,an,ht,Or,et,Or,et],Xf=[ht,ht,ht,ht,et,et,et,et],jf=[Lr,It,an,ht,Or,et,Or,et],Qf=[It,It,ht,ht,et,et,et,et],Zf=[jn,jn,It,It,ht,ht,et,et],em=[da,jn,Lr,It,Lr,It,Lr,It],fe={DISPLAY:yt[da],TEXT:yt[Lr],SCRIPT:yt[an],SCRIPTSCRIPT:yt[Or]},zl=[{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 tm(r){for(var e=0;e<zl.length;e++)for(var t=zl[e],n=0;n<t.blocks.length;n++){var o=t.blocks[n];if(r>=o[0]&&r<=o[1])return t.name}return null}var Pn=[];zl.forEach(r=>r.blocks.forEach(e=>Pn.push(...e)));function Qs(r){for(var e=0;e<Pn.length;e+=2)if(r>=Pn[e]&&r<=Pn[e+1])return!0;return!1}var Ue=r=>r+" "+r,Sr=80,rm=function(e,t){return"M95,"+(622+e+t)+`
52
+ c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
53
+ c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
54
+ 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
55
+ s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
56
+ c69,-144,104.5,-217.7,106.5,-221
57
+ l`+e/2.075+" -"+e+`
58
+ c5.3,-9.3,12,-14,20,-14
59
+ H400000v`+(40+e)+`H845.2724
60
+ s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
61
+ c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
62
+ M`+(834+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},nm=function(e,t){return"M263,"+(601+e+t)+`c0.7,0,18,39.7,52,119
63
+ c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
64
+ c340,-704.7,510.7,-1060.3,512,-1067
65
+ l`+e/2.084+" -"+e+`
66
+ c4.7,-7.3,11,-11,19,-11
67
+ H40000v`+(40+e)+`H1012.3
68
+ s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
69
+ c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
70
+ s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
71
+ c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
72
+ M`+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},om=function(e,t){return"M983 "+(10+e+t)+`
73
+ l`+e/3.13+" -"+e+`
74
+ c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+`
75
+ H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
76
+ s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
77
+ c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
78
+ c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
79
+ c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
80
+ c53.7,-170.3,84.5,-266.8,92.5,-289.5z
81
+ M`+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},lm=function(e,t){return"M424,"+(2398+e+t)+`
82
+ c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
83
+ c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
84
+ s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
85
+ s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
86
+ l`+e/4.223+" -"+e+`c4,-6.7,10,-10,18,-10 H400000
87
+ v`+(40+e)+`H1014.6
88
+ s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
89
+ c-2,6,-10,9,-24,9
90
+ c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+" "+t+`
91
+ h400000v`+(40+e)+"h-400000z"},am=function(e,t){return"M473,"+(2713+e+t)+`
92
+ c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+" -"+e+`
93
+ c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7
94
+ s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
95
+ c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
96
+ c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
97
+ s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
98
+ 606zM`+(1001+e)+" "+t+"h400000v"+(40+e)+"H1017.7z"},im=function(e){var t=e/2;return"M400000 "+e+" H0 L"+t+" 0 l65 45 L145 "+(e-80)+" H400000z"},sm=function(e,t,n){var o=n-54-t-e;return"M702 "+(e+t)+"H400000"+(40+e)+`
99
+ 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
100
+ h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
101
+ c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
102
+ 219 661 l218 661zM702 `+t+"H400000v"+(40+e)+"H742z"},um=function(e,t,n){t=1e3*t;var o="";switch(e){case"sqrtMain":o=rm(t,Sr);break;case"sqrtSize1":o=nm(t,Sr);break;case"sqrtSize2":o=om(t,Sr);break;case"sqrtSize3":o=lm(t,Sr);break;case"sqrtSize4":o=am(t,Sr);break;case"sqrtTall":o=sm(t,Sr,n)}return o},cm=function(e,t){switch(e){case"⎜":return Ue("M291 0 H417 V"+t+" H291z");case"∣":return Ue("M145 0 H188 V"+t+" H145z");case"∥":return Ue("M145 0 H188 V"+t+" H145z")+Ue("M367 0 H410 V"+t+" H367z");case"⎟":return Ue("M457 0 H583 V"+t+" H457z");case"⎢":return Ue("M319 0 H403 V"+t+" H319z");case"⎥":return Ue("M263 0 H347 V"+t+" H263z");case"⎪":return Ue("M384 0 H504 V"+t+" H384z");case"⏐":return Ue("M312 0 H355 V"+t+" H312z");case"‖":return Ue("M257 0 H300 V"+t+" H257z")+Ue("M478 0 H521 V"+t+" H478z");default:return""}},R0={doubleleftarrow:`M262 157
103
+ 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
104
+ 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
105
+ 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
106
+ c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
107
+ 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
108
+ -86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
109
+ -2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
110
+ m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
111
+ -10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
112
+ 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
113
+ -33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
114
+ -17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
115
+ -13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
116
+ c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
117
+ -107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
118
+ 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
119
+ -5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
120
+ c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
121
+ 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
122
+ 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
123
+ l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
124
+ -45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
125
+ 5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
126
+ 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
127
+ 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
128
+ -331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
129
+ H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
130
+ 435 0h399565z`,leftgroupunder:`M400000 262
131
+ H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
132
+ 435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
133
+ -3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
134
+ -18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
135
+ -196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
136
+ 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
137
+ -4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
138
+ -10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
139
+ m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
140
+ 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
141
+ 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
142
+ -152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
143
+ 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
144
+ -2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
145
+ 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
146
+ -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
147
+ -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
148
+ 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:Ue("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:Ue("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:Ue("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:Ue("M40 281 V448H0V74H40V241H400000v40z"),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
149
+ -.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
150
+ 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
151
+ 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:Ue("M0 50 h400000 v40H0z m0 194h40000v40H0z"),midbrace:`M200428 334
152
+ 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
153
+ -53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
154
+ 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
155
+ 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
156
+ c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
157
+ 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
158
+ 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
159
+ -5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
160
+ -320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
161
+ m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
162
+ 60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
163
+ -451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
164
+ m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
165
+ c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
166
+ -480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
167
+ m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
168
+ 85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
169
+ -707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
170
+ m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
171
+ c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
172
+ -16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
173
+ 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
174
+ 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
175
+ -40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
176
+ -12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
177
+ 151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
178
+ -6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
179
+ s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
180
+ c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
181
+ 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
182
+ -174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
183
+ 3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
184
+ 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
185
+ -3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
186
+ -10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
187
+ 69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
188
+ -18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
189
+ 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
190
+ m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
191
+ 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
192
+ -7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
193
+ -27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
194
+ 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
195
+ 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
196
+ -64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
197
+ 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
198
+ 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
199
+ -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
200
+ 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:Ue("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:Ue("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:Ue("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
201
+ 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
202
+ -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
203
+ -167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
204
+ 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
205
+ -70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
206
+ -40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
207
+ -37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
208
+ 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
209
+ c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
210
+ 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
211
+ 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
212
+ -19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
213
+ 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
214
+ -2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
215
+ 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
216
+ 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
217
+ -68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
218
+ -8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
219
+ 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
220
+ c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
221
+ 181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
222
+ -11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
223
+ 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
224
+ 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
225
+ -338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
226
+ -11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
227
+ 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
228
+ 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
229
+ -175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
230
+ 3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
231
+ 10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
232
+ -1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
233
+ -7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
234
+ H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
235
+ c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
236
+ c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
237
+ -11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
238
+ -11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
239
+ -11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
240
+ -5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
241
+ -11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
242
+ -11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
243
+ -11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
244
+ c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
245
+ c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
246
+ s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
247
+ 121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
248
+ s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
249
+ c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
250
+ M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
251
+ -27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
252
+ 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
253
+ -84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
254
+ -119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
255
+ -12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
256
+ 151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
257
+ c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
258
+ c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
259
+ c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
260
+ c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
261
+ M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
262
+ c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
263
+ -231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
264
+ c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
265
+ M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
266
+ c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
267
+ 1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
268
+ -152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
269
+ M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
270
+ c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
271
+ -231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
272
+ c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
273
+ M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},dm=function(e,t){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+` v1759 h347 v-84
274
+ H403z M403 1759 V0 H319 V1759 v`+t+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+` v1759 H0 v84 H347z
275
+ M347 1759 V0 H263 V1759 v`+t+" v1759 h84z";case"vert":return"M145 15 v585 v"+t+` v585 c2.667,10,9.667,15,21,15
276
+ c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
277
+ c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+" v585 h43z";case"doublevert":return"M145 15 v585 v"+t+` v585 c2.667,10,9.667,15,21,15
278
+ c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
279
+ c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+` v585 h43z
280
+ M367 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15
281
+ c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
282
+ c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+t+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+t+` v1715 h263 v84 H319z
283
+ MM319 602 V0 H403 V602 v`+t+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+t+` v1799 H0 v-84 H319z
284
+ MM319 602 V0 H403 V602 v`+t+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+` v602 h84z
285
+ M403 1759 V0 H319 V1759 v`+t+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+` v602 h84z
286
+ M347 1759 V0 h-84 V1759 v`+t+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
287
+ c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
288
+ -36,557 l0,`+(t+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
289
+ 949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
290
+ c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
291
+ -544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
292
+ l0,-`+(t+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
293
+ -210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
294
+ 63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
295
+ c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(t+9)+`
296
+ c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
297
+ c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
298
+ 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
299
+ c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
300
+ l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
301
+ -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.")}};class Fr{constructor(e){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(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){for(var e="",t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){var e=t=>t.toText();return this.children.map(e).join("")}}var Dl={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},fm={ex:!0,em:!0,mu:!0},Zs=function(e){return typeof e!="string"&&(e=e.unit),e in Dl||e in fm||e==="ex"},Ie=function(e,t){var n;if(e.unit in Dl)n=Dl[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(e.unit==="mu")n=t.fontMetrics().cssEmPerMu;else{var o;if(t.style.isTight()?o=t.havingStyle(t.style.text()):o=t,e.unit==="ex")n=o.fontMetrics().xHeight;else if(e.unit==="em")n=o.fontMetrics().quad;else throw new _("Invalid unit: '"+e.unit+"'");o!==t&&(n*=o.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},Y=function(e){return+e.toFixed(4)+"em"},Yt=function(e){return e.filter(t=>t).join(" ")},eu=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push("mtight");var o=t.getColor();o&&(this.style.color=o)}},tu=function(e){var t=document.createElement(e);t.className=Yt(this.classes);for(var n of Object.keys(this.style))t.style[n]=this.style[n];for(var o of Object.keys(this.attributes))t.setAttribute(o,this.attributes[o]);for(var l=0;l<this.children.length;l++)t.appendChild(this.children[l].toNode());return t},mm=/[\s"'>/=\x00-\x1f]/,ru=function(e){var t="<"+e;this.classes.length&&(t+=' class="'+Ye(Yt(this.classes))+'"');var n="";for(var o of Object.keys(this.style))n+=ua(o)+":"+this.style[o]+";";n&&(t+=' style="'+Ye(n)+'"');for(var l of Object.keys(this.attributes)){if(mm.test(l))throw new _("Invalid attribute name '"+l+"'");t+=" "+l+'="'+Ye(this.attributes[l])+'"'}t+=">";for(var i=0;i<this.children.length;i++)t+=this.children[i].toMarkup();return t+="</"+e+">",t};class $r{constructor(e,t,n,o){eu.call(this,e,n,o),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return tu.call(this,"span")}toMarkup(){return ru.call(this,"span")}}class po{constructor(e,t,n,o){eu.call(this,t,o),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return tu.call(this,"a")}toMarkup(){return ru.call(this,"a")}}class hm{constructor(e,t,n){this.alt=t,this.src=e,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=n}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement("img");e.src=this.src,e.alt=this.alt,e.className="mord";for(var t of Object.keys(this.style))e.style[t]=this.style[t];return e}toMarkup(){var e='<img src="'+Ye(this.src)+'"'+(' alt="'+Ye(this.alt)+'"'),t="";for(var n of Object.keys(this.style))t+=ua(n)+":"+this.style[n]+";";return t&&(e+=' style="'+Ye(t)+'"'),e+="'/>",e}}var pm={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class ut{constructor(e,t,n,o,l,i,s,u){this.text=e,this.height=t||0,this.depth=n||0,this.italic=o||0,this.skew=l||0,this.width=i||0,this.classes=s||[],this.style=u||{},this.maxFontSize=0;var d=tm(this.text.charCodeAt(0));d&&this.classes.push(d+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=pm[this.text])}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createTextNode(this.text),t=null;this.italic>0&&(t=document.createElement("span"),t.style.marginRight=Y(this.italic)),this.classes.length>0&&(t=t||document.createElement("span"),t.className=Yt(this.classes));for(var n of Object.keys(this.style))t=t||document.createElement("span"),t.style[n]=this.style[n];return t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t="<span";this.classes.length&&(e=!0,t+=' class="',t+=Ye(Yt(this.classes)),t+='"');var n="";this.italic>0&&(n+="margin-right:"+Y(this.italic)+";");for(var o of Object.keys(this.style))n+=ua(o)+":"+this.style[o]+";";n&&(e=!0,t+=' style="'+Ye(n)+'"');var l=Ye(this.text);return e?(t+=">",t+=l,t+="</span>",t):l}}class zt{constructor(e,t){this.children=e||[],this.attributes=t||{}}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"svg");for(var n of Object.keys(this.attributes))t.setAttribute(n,this.attributes[n]);for(var o=0;o<this.children.length;o++)t.appendChild(this.children[o].toNode());return t}toMarkup(){var e='<svg xmlns="http://www.w3.org/2000/svg"';for(var t of Object.keys(this.attributes))e+=" "+t+'="'+Ye(this.attributes[t])+'"';e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+="</svg>",e}}class Jt{constructor(e,t){this.pathName=e,this.alternate=t}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"path");return this.alternate?t.setAttribute("d",this.alternate):t.setAttribute("d",R0[this.pathName]),t}toMarkup(){return this.alternate?'<path d="'+Ye(this.alternate)+'"/>':'<path d="'+Ye(R0[this.pathName])+'"/>'}}class Ol{constructor(e){this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"line");for(var n of Object.keys(this.attributes))t.setAttribute(n,this.attributes[n]);return t}toMarkup(){var e="<line";for(var t of Object.keys(this.attributes))e+=" "+t+'="'+Ye(this.attributes[t])+'"';return e+="/>",e}}function gm(r){if(r instanceof ut)return r;throw new Error("Expected symbolNode but got "+String(r)+".")}function vm(r){if(r instanceof $r)return r;throw new Error("Expected span<HtmlDomNode> but got "+String(r)+".")}var bm=r=>r instanceof $r||r instanceof po||r instanceof Fr,wt={"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]}},Tn={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]},P0={Å:"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 ym(r,e){wt[r]=e}function fa(r,e,t){if(!wt[e])throw new Error("Font metrics not found for font: "+e+".");var n=r.charCodeAt(0),o=wt[e][n];if(!o&&r[0]in P0&&(n=P0[r[0]].charCodeAt(0),o=wt[e][n]),!o&&t==="text"&&Qs(n)&&(o=wt[e][77]),o)return{depth:o[0],height:o[1],italic:o[2],skew:o[3],width:o[4]}}var Jo={};function wm(r){var e;if(r>=5?e=0:r>=3?e=1:e=2,!Jo[e]){var t=Jo[e]={cssEmPerMu:Tn.quad[e]/18};for(var n in Tn)Tn.hasOwnProperty(n)&&(t[n]=Tn[n][e])}return Jo[e]}var km={bin:1,close:1,inner:1,open:1,punct:1,rel:1},xm={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},Se={math:{},text:{}};function c(r,e,t,n,o,l){Se[r][o]={font:e,group:t,replace:n},l&&n&&(Se[r][n]=Se[r][o])}var f="math",F="text",g="main",x="ams",Ae="accent-token",Q="bin",tt="close",qr="inner",ie="mathord",Fe="op-token",ct="open",pn="punct",C="rel",Rt="spacing",S="textord";c(f,g,C,"≡","\\equiv",!0);c(f,g,C,"≺","\\prec",!0);c(f,g,C,"≻","\\succ",!0);c(f,g,C,"∼","\\sim",!0);c(f,g,C,"⊥","\\perp");c(f,g,C,"⪯","\\preceq",!0);c(f,g,C,"⪰","\\succeq",!0);c(f,g,C,"≃","\\simeq",!0);c(f,g,C,"∣","\\mid",!0);c(f,g,C,"≪","\\ll",!0);c(f,g,C,"≫","\\gg",!0);c(f,g,C,"≍","\\asymp",!0);c(f,g,C,"∥","\\parallel");c(f,g,C,"⋈","\\bowtie",!0);c(f,g,C,"⌣","\\smile",!0);c(f,g,C,"⊑","\\sqsubseteq",!0);c(f,g,C,"⊒","\\sqsupseteq",!0);c(f,g,C,"≐","\\doteq",!0);c(f,g,C,"⌢","\\frown",!0);c(f,g,C,"∋","\\ni",!0);c(f,g,C,"∝","\\propto",!0);c(f,g,C,"⊢","\\vdash",!0);c(f,g,C,"⊣","\\dashv",!0);c(f,g,C,"∋","\\owns");c(f,g,pn,".","\\ldotp");c(f,g,pn,"⋅","\\cdotp");c(f,g,pn,"⋅","·");c(F,g,S,"⋅","·");c(f,g,S,"#","\\#");c(F,g,S,"#","\\#");c(f,g,S,"&","\\&");c(F,g,S,"&","\\&");c(f,g,S,"ℵ","\\aleph",!0);c(f,g,S,"∀","\\forall",!0);c(f,g,S,"ℏ","\\hbar",!0);c(f,g,S,"∃","\\exists",!0);c(f,g,S,"∇","\\nabla",!0);c(f,g,S,"♭","\\flat",!0);c(f,g,S,"ℓ","\\ell",!0);c(f,g,S,"♮","\\natural",!0);c(f,g,S,"♣","\\clubsuit",!0);c(f,g,S,"℘","\\wp",!0);c(f,g,S,"♯","\\sharp",!0);c(f,g,S,"♢","\\diamondsuit",!0);c(f,g,S,"ℜ","\\Re",!0);c(f,g,S,"♡","\\heartsuit",!0);c(f,g,S,"ℑ","\\Im",!0);c(f,g,S,"♠","\\spadesuit",!0);c(f,g,S,"§","\\S",!0);c(F,g,S,"§","\\S");c(f,g,S,"¶","\\P",!0);c(F,g,S,"¶","\\P");c(f,g,S,"†","\\dag");c(F,g,S,"†","\\dag");c(F,g,S,"†","\\textdagger");c(f,g,S,"‡","\\ddag");c(F,g,S,"‡","\\ddag");c(F,g,S,"‡","\\textdaggerdbl");c(f,g,tt,"⎱","\\rmoustache",!0);c(f,g,ct,"⎰","\\lmoustache",!0);c(f,g,tt,"⟯","\\rgroup",!0);c(f,g,ct,"⟮","\\lgroup",!0);c(f,g,Q,"∓","\\mp",!0);c(f,g,Q,"⊖","\\ominus",!0);c(f,g,Q,"⊎","\\uplus",!0);c(f,g,Q,"⊓","\\sqcap",!0);c(f,g,Q,"∗","\\ast");c(f,g,Q,"⊔","\\sqcup",!0);c(f,g,Q,"◯","\\bigcirc",!0);c(f,g,Q,"∙","\\bullet",!0);c(f,g,Q,"‡","\\ddagger");c(f,g,Q,"≀","\\wr",!0);c(f,g,Q,"⨿","\\amalg");c(f,g,Q,"&","\\And");c(f,g,C,"⟵","\\longleftarrow",!0);c(f,g,C,"⇐","\\Leftarrow",!0);c(f,g,C,"⟸","\\Longleftarrow",!0);c(f,g,C,"⟶","\\longrightarrow",!0);c(f,g,C,"⇒","\\Rightarrow",!0);c(f,g,C,"⟹","\\Longrightarrow",!0);c(f,g,C,"↔","\\leftrightarrow",!0);c(f,g,C,"⟷","\\longleftrightarrow",!0);c(f,g,C,"⇔","\\Leftrightarrow",!0);c(f,g,C,"⟺","\\Longleftrightarrow",!0);c(f,g,C,"↦","\\mapsto",!0);c(f,g,C,"⟼","\\longmapsto",!0);c(f,g,C,"↗","\\nearrow",!0);c(f,g,C,"↩","\\hookleftarrow",!0);c(f,g,C,"↪","\\hookrightarrow",!0);c(f,g,C,"↘","\\searrow",!0);c(f,g,C,"↼","\\leftharpoonup",!0);c(f,g,C,"⇀","\\rightharpoonup",!0);c(f,g,C,"↙","\\swarrow",!0);c(f,g,C,"↽","\\leftharpoondown",!0);c(f,g,C,"⇁","\\rightharpoondown",!0);c(f,g,C,"↖","\\nwarrow",!0);c(f,g,C,"⇌","\\rightleftharpoons",!0);c(f,x,C,"≮","\\nless",!0);c(f,x,C,"","\\@nleqslant");c(f,x,C,"","\\@nleqq");c(f,x,C,"⪇","\\lneq",!0);c(f,x,C,"≨","\\lneqq",!0);c(f,x,C,"","\\@lvertneqq");c(f,x,C,"⋦","\\lnsim",!0);c(f,x,C,"⪉","\\lnapprox",!0);c(f,x,C,"⊀","\\nprec",!0);c(f,x,C,"⋠","\\npreceq",!0);c(f,x,C,"⋨","\\precnsim",!0);c(f,x,C,"⪹","\\precnapprox",!0);c(f,x,C,"≁","\\nsim",!0);c(f,x,C,"","\\@nshortmid");c(f,x,C,"∤","\\nmid",!0);c(f,x,C,"⊬","\\nvdash",!0);c(f,x,C,"⊭","\\nvDash",!0);c(f,x,C,"⋪","\\ntriangleleft");c(f,x,C,"⋬","\\ntrianglelefteq",!0);c(f,x,C,"⊊","\\subsetneq",!0);c(f,x,C,"","\\@varsubsetneq");c(f,x,C,"⫋","\\subsetneqq",!0);c(f,x,C,"","\\@varsubsetneqq");c(f,x,C,"≯","\\ngtr",!0);c(f,x,C,"","\\@ngeqslant");c(f,x,C,"","\\@ngeqq");c(f,x,C,"⪈","\\gneq",!0);c(f,x,C,"≩","\\gneqq",!0);c(f,x,C,"","\\@gvertneqq");c(f,x,C,"⋧","\\gnsim",!0);c(f,x,C,"⪊","\\gnapprox",!0);c(f,x,C,"⊁","\\nsucc",!0);c(f,x,C,"⋡","\\nsucceq",!0);c(f,x,C,"⋩","\\succnsim",!0);c(f,x,C,"⪺","\\succnapprox",!0);c(f,x,C,"≆","\\ncong",!0);c(f,x,C,"","\\@nshortparallel");c(f,x,C,"∦","\\nparallel",!0);c(f,x,C,"⊯","\\nVDash",!0);c(f,x,C,"⋫","\\ntriangleright");c(f,x,C,"⋭","\\ntrianglerighteq",!0);c(f,x,C,"","\\@nsupseteqq");c(f,x,C,"⊋","\\supsetneq",!0);c(f,x,C,"","\\@varsupsetneq");c(f,x,C,"⫌","\\supsetneqq",!0);c(f,x,C,"","\\@varsupsetneqq");c(f,x,C,"⊮","\\nVdash",!0);c(f,x,C,"⪵","\\precneqq",!0);c(f,x,C,"⪶","\\succneqq",!0);c(f,x,C,"","\\@nsubseteqq");c(f,x,Q,"⊴","\\unlhd");c(f,x,Q,"⊵","\\unrhd");c(f,x,C,"↚","\\nleftarrow",!0);c(f,x,C,"↛","\\nrightarrow",!0);c(f,x,C,"⇍","\\nLeftarrow",!0);c(f,x,C,"⇏","\\nRightarrow",!0);c(f,x,C,"↮","\\nleftrightarrow",!0);c(f,x,C,"⇎","\\nLeftrightarrow",!0);c(f,x,C,"△","\\vartriangle");c(f,x,S,"ℏ","\\hslash");c(f,x,S,"▽","\\triangledown");c(f,x,S,"◊","\\lozenge");c(f,x,S,"Ⓢ","\\circledS");c(f,x,S,"®","\\circledR");c(F,x,S,"®","\\circledR");c(f,x,S,"∡","\\measuredangle",!0);c(f,x,S,"∄","\\nexists");c(f,x,S,"℧","\\mho");c(f,x,S,"Ⅎ","\\Finv",!0);c(f,x,S,"⅁","\\Game",!0);c(f,x,S,"‵","\\backprime");c(f,x,S,"▲","\\blacktriangle");c(f,x,S,"▼","\\blacktriangledown");c(f,x,S,"■","\\blacksquare");c(f,x,S,"⧫","\\blacklozenge");c(f,x,S,"★","\\bigstar");c(f,x,S,"∢","\\sphericalangle",!0);c(f,x,S,"∁","\\complement",!0);c(f,x,S,"ð","\\eth",!0);c(F,g,S,"ð","ð");c(f,x,S,"╱","\\diagup");c(f,x,S,"╲","\\diagdown");c(f,x,S,"□","\\square");c(f,x,S,"□","\\Box");c(f,x,S,"◊","\\Diamond");c(f,x,S,"¥","\\yen",!0);c(F,x,S,"¥","\\yen",!0);c(f,x,S,"✓","\\checkmark",!0);c(F,x,S,"✓","\\checkmark");c(f,x,S,"ℶ","\\beth",!0);c(f,x,S,"ℸ","\\daleth",!0);c(f,x,S,"ℷ","\\gimel",!0);c(f,x,S,"ϝ","\\digamma",!0);c(f,x,S,"ϰ","\\varkappa");c(f,x,ct,"┌","\\@ulcorner",!0);c(f,x,tt,"┐","\\@urcorner",!0);c(f,x,ct,"└","\\@llcorner",!0);c(f,x,tt,"┘","\\@lrcorner",!0);c(f,x,C,"≦","\\leqq",!0);c(f,x,C,"⩽","\\leqslant",!0);c(f,x,C,"⪕","\\eqslantless",!0);c(f,x,C,"≲","\\lesssim",!0);c(f,x,C,"⪅","\\lessapprox",!0);c(f,x,C,"≊","\\approxeq",!0);c(f,x,Q,"⋖","\\lessdot");c(f,x,C,"⋘","\\lll",!0);c(f,x,C,"≶","\\lessgtr",!0);c(f,x,C,"⋚","\\lesseqgtr",!0);c(f,x,C,"⪋","\\lesseqqgtr",!0);c(f,x,C,"≑","\\doteqdot");c(f,x,C,"≓","\\risingdotseq",!0);c(f,x,C,"≒","\\fallingdotseq",!0);c(f,x,C,"∽","\\backsim",!0);c(f,x,C,"⋍","\\backsimeq",!0);c(f,x,C,"⫅","\\subseteqq",!0);c(f,x,C,"⋐","\\Subset",!0);c(f,x,C,"⊏","\\sqsubset",!0);c(f,x,C,"≼","\\preccurlyeq",!0);c(f,x,C,"⋞","\\curlyeqprec",!0);c(f,x,C,"≾","\\precsim",!0);c(f,x,C,"⪷","\\precapprox",!0);c(f,x,C,"⊲","\\vartriangleleft");c(f,x,C,"⊴","\\trianglelefteq");c(f,x,C,"⊨","\\vDash",!0);c(f,x,C,"⊪","\\Vvdash",!0);c(f,x,C,"⌣","\\smallsmile");c(f,x,C,"⌢","\\smallfrown");c(f,x,C,"≏","\\bumpeq",!0);c(f,x,C,"≎","\\Bumpeq",!0);c(f,x,C,"≧","\\geqq",!0);c(f,x,C,"⩾","\\geqslant",!0);c(f,x,C,"⪖","\\eqslantgtr",!0);c(f,x,C,"≳","\\gtrsim",!0);c(f,x,C,"⪆","\\gtrapprox",!0);c(f,x,Q,"⋗","\\gtrdot");c(f,x,C,"⋙","\\ggg",!0);c(f,x,C,"≷","\\gtrless",!0);c(f,x,C,"⋛","\\gtreqless",!0);c(f,x,C,"⪌","\\gtreqqless",!0);c(f,x,C,"≖","\\eqcirc",!0);c(f,x,C,"≗","\\circeq",!0);c(f,x,C,"≜","\\triangleq",!0);c(f,x,C,"∼","\\thicksim");c(f,x,C,"≈","\\thickapprox");c(f,x,C,"⫆","\\supseteqq",!0);c(f,x,C,"⋑","\\Supset",!0);c(f,x,C,"⊐","\\sqsupset",!0);c(f,x,C,"≽","\\succcurlyeq",!0);c(f,x,C,"⋟","\\curlyeqsucc",!0);c(f,x,C,"≿","\\succsim",!0);c(f,x,C,"⪸","\\succapprox",!0);c(f,x,C,"⊳","\\vartriangleright");c(f,x,C,"⊵","\\trianglerighteq");c(f,x,C,"⊩","\\Vdash",!0);c(f,x,C,"∣","\\shortmid");c(f,x,C,"∥","\\shortparallel");c(f,x,C,"≬","\\between",!0);c(f,x,C,"⋔","\\pitchfork",!0);c(f,x,C,"∝","\\varpropto");c(f,x,C,"◀","\\blacktriangleleft");c(f,x,C,"∴","\\therefore",!0);c(f,x,C,"∍","\\backepsilon");c(f,x,C,"▶","\\blacktriangleright");c(f,x,C,"∵","\\because",!0);c(f,x,C,"⋘","\\llless");c(f,x,C,"⋙","\\gggtr");c(f,x,Q,"⊲","\\lhd");c(f,x,Q,"⊳","\\rhd");c(f,x,C,"≂","\\eqsim",!0);c(f,g,C,"⋈","\\Join");c(f,x,C,"≑","\\Doteq",!0);c(f,x,Q,"∔","\\dotplus",!0);c(f,x,Q,"∖","\\smallsetminus");c(f,x,Q,"⋒","\\Cap",!0);c(f,x,Q,"⋓","\\Cup",!0);c(f,x,Q,"⩞","\\doublebarwedge",!0);c(f,x,Q,"⊟","\\boxminus",!0);c(f,x,Q,"⊞","\\boxplus",!0);c(f,x,Q,"⋇","\\divideontimes",!0);c(f,x,Q,"⋉","\\ltimes",!0);c(f,x,Q,"⋊","\\rtimes",!0);c(f,x,Q,"⋋","\\leftthreetimes",!0);c(f,x,Q,"⋌","\\rightthreetimes",!0);c(f,x,Q,"⋏","\\curlywedge",!0);c(f,x,Q,"⋎","\\curlyvee",!0);c(f,x,Q,"⊝","\\circleddash",!0);c(f,x,Q,"⊛","\\circledast",!0);c(f,x,Q,"⋅","\\centerdot");c(f,x,Q,"⊺","\\intercal",!0);c(f,x,Q,"⋒","\\doublecap");c(f,x,Q,"⋓","\\doublecup");c(f,x,Q,"⊠","\\boxtimes",!0);c(f,x,C,"⇢","\\dashrightarrow",!0);c(f,x,C,"⇠","\\dashleftarrow",!0);c(f,x,C,"⇇","\\leftleftarrows",!0);c(f,x,C,"⇆","\\leftrightarrows",!0);c(f,x,C,"⇚","\\Lleftarrow",!0);c(f,x,C,"↞","\\twoheadleftarrow",!0);c(f,x,C,"↢","\\leftarrowtail",!0);c(f,x,C,"↫","\\looparrowleft",!0);c(f,x,C,"⇋","\\leftrightharpoons",!0);c(f,x,C,"↶","\\curvearrowleft",!0);c(f,x,C,"↺","\\circlearrowleft",!0);c(f,x,C,"↰","\\Lsh",!0);c(f,x,C,"⇈","\\upuparrows",!0);c(f,x,C,"↿","\\upharpoonleft",!0);c(f,x,C,"⇃","\\downharpoonleft",!0);c(f,g,C,"⊶","\\origof",!0);c(f,g,C,"⊷","\\imageof",!0);c(f,x,C,"⊸","\\multimap",!0);c(f,x,C,"↭","\\leftrightsquigarrow",!0);c(f,x,C,"⇉","\\rightrightarrows",!0);c(f,x,C,"⇄","\\rightleftarrows",!0);c(f,x,C,"↠","\\twoheadrightarrow",!0);c(f,x,C,"↣","\\rightarrowtail",!0);c(f,x,C,"↬","\\looparrowright",!0);c(f,x,C,"↷","\\curvearrowright",!0);c(f,x,C,"↻","\\circlearrowright",!0);c(f,x,C,"↱","\\Rsh",!0);c(f,x,C,"⇊","\\downdownarrows",!0);c(f,x,C,"↾","\\upharpoonright",!0);c(f,x,C,"⇂","\\downharpoonright",!0);c(f,x,C,"⇝","\\rightsquigarrow",!0);c(f,x,C,"⇝","\\leadsto");c(f,x,C,"⇛","\\Rrightarrow",!0);c(f,x,C,"↾","\\restriction");c(f,g,S,"‘","`");c(f,g,S,"$","\\$");c(F,g,S,"$","\\$");c(F,g,S,"$","\\textdollar");c(f,g,S,"%","\\%");c(F,g,S,"%","\\%");c(f,g,S,"_","\\_");c(F,g,S,"_","\\_");c(F,g,S,"_","\\textunderscore");c(f,g,S,"∠","\\angle",!0);c(f,g,S,"∞","\\infty",!0);c(f,g,S,"′","\\prime");c(f,g,S,"△","\\triangle");c(f,g,S,"Γ","\\Gamma",!0);c(f,g,S,"Δ","\\Delta",!0);c(f,g,S,"Θ","\\Theta",!0);c(f,g,S,"Λ","\\Lambda",!0);c(f,g,S,"Ξ","\\Xi",!0);c(f,g,S,"Π","\\Pi",!0);c(f,g,S,"Σ","\\Sigma",!0);c(f,g,S,"Υ","\\Upsilon",!0);c(f,g,S,"Φ","\\Phi",!0);c(f,g,S,"Ψ","\\Psi",!0);c(f,g,S,"Ω","\\Omega",!0);c(f,g,S,"A","Α");c(f,g,S,"B","Β");c(f,g,S,"E","Ε");c(f,g,S,"Z","Ζ");c(f,g,S,"H","Η");c(f,g,S,"I","Ι");c(f,g,S,"K","Κ");c(f,g,S,"M","Μ");c(f,g,S,"N","Ν");c(f,g,S,"O","Ο");c(f,g,S,"P","Ρ");c(f,g,S,"T","Τ");c(f,g,S,"X","Χ");c(f,g,S,"¬","\\neg",!0);c(f,g,S,"¬","\\lnot");c(f,g,S,"⊤","\\top");c(f,g,S,"⊥","\\bot");c(f,g,S,"∅","\\emptyset");c(f,x,S,"∅","\\varnothing");c(f,g,ie,"α","\\alpha",!0);c(f,g,ie,"β","\\beta",!0);c(f,g,ie,"γ","\\gamma",!0);c(f,g,ie,"δ","\\delta",!0);c(f,g,ie,"ϵ","\\epsilon",!0);c(f,g,ie,"ζ","\\zeta",!0);c(f,g,ie,"η","\\eta",!0);c(f,g,ie,"θ","\\theta",!0);c(f,g,ie,"ι","\\iota",!0);c(f,g,ie,"κ","\\kappa",!0);c(f,g,ie,"λ","\\lambda",!0);c(f,g,ie,"μ","\\mu",!0);c(f,g,ie,"ν","\\nu",!0);c(f,g,ie,"ξ","\\xi",!0);c(f,g,ie,"ο","\\omicron",!0);c(f,g,ie,"π","\\pi",!0);c(f,g,ie,"ρ","\\rho",!0);c(f,g,ie,"σ","\\sigma",!0);c(f,g,ie,"τ","\\tau",!0);c(f,g,ie,"υ","\\upsilon",!0);c(f,g,ie,"ϕ","\\phi",!0);c(f,g,ie,"χ","\\chi",!0);c(f,g,ie,"ψ","\\psi",!0);c(f,g,ie,"ω","\\omega",!0);c(f,g,ie,"ε","\\varepsilon",!0);c(f,g,ie,"ϑ","\\vartheta",!0);c(f,g,ie,"ϖ","\\varpi",!0);c(f,g,ie,"ϱ","\\varrho",!0);c(f,g,ie,"ς","\\varsigma",!0);c(f,g,ie,"φ","\\varphi",!0);c(f,g,Q,"∗","*",!0);c(f,g,Q,"+","+");c(f,g,Q,"−","-",!0);c(f,g,Q,"⋅","\\cdot",!0);c(f,g,Q,"∘","\\circ",!0);c(f,g,Q,"÷","\\div",!0);c(f,g,Q,"±","\\pm",!0);c(f,g,Q,"×","\\times",!0);c(f,g,Q,"∩","\\cap",!0);c(f,g,Q,"∪","\\cup",!0);c(f,g,Q,"∖","\\setminus",!0);c(f,g,Q,"∧","\\land");c(f,g,Q,"∨","\\lor");c(f,g,Q,"∧","\\wedge",!0);c(f,g,Q,"∨","\\vee",!0);c(f,g,S,"√","\\surd");c(f,g,ct,"⟨","\\langle",!0);c(f,g,ct,"∣","\\lvert");c(f,g,ct,"∥","\\lVert");c(f,g,tt,"?","?");c(f,g,tt,"!","!");c(f,g,tt,"⟩","\\rangle",!0);c(f,g,tt,"∣","\\rvert");c(f,g,tt,"∥","\\rVert");c(f,g,C,"=","=");c(f,g,C,":",":");c(f,g,C,"≈","\\approx",!0);c(f,g,C,"≅","\\cong",!0);c(f,g,C,"≥","\\ge");c(f,g,C,"≥","\\geq",!0);c(f,g,C,"←","\\gets");c(f,g,C,">","\\gt",!0);c(f,g,C,"∈","\\in",!0);c(f,g,C,"","\\@not");c(f,g,C,"⊂","\\subset",!0);c(f,g,C,"⊃","\\supset",!0);c(f,g,C,"⊆","\\subseteq",!0);c(f,g,C,"⊇","\\supseteq",!0);c(f,x,C,"⊈","\\nsubseteq",!0);c(f,x,C,"⊉","\\nsupseteq",!0);c(f,g,C,"⊨","\\models");c(f,g,C,"←","\\leftarrow",!0);c(f,g,C,"≤","\\le");c(f,g,C,"≤","\\leq",!0);c(f,g,C,"<","\\lt",!0);c(f,g,C,"→","\\rightarrow",!0);c(f,g,C,"→","\\to");c(f,x,C,"≱","\\ngeq",!0);c(f,x,C,"≰","\\nleq",!0);c(f,g,Rt," ","\\ ");c(f,g,Rt," ","\\space");c(f,g,Rt," ","\\nobreakspace");c(F,g,Rt," ","\\ ");c(F,g,Rt," "," ");c(F,g,Rt," ","\\space");c(F,g,Rt," ","\\nobreakspace");c(f,g,Rt,null,"\\nobreak");c(f,g,Rt,null,"\\allowbreak");c(f,g,pn,",",",");c(f,g,pn,";",";");c(f,x,Q,"⊼","\\barwedge",!0);c(f,x,Q,"⊻","\\veebar",!0);c(f,g,Q,"⊙","\\odot",!0);c(f,g,Q,"⊕","\\oplus",!0);c(f,g,Q,"⊗","\\otimes",!0);c(f,g,S,"∂","\\partial",!0);c(f,g,Q,"⊘","\\oslash",!0);c(f,x,Q,"⊚","\\circledcirc",!0);c(f,x,Q,"⊡","\\boxdot",!0);c(f,g,Q,"△","\\bigtriangleup");c(f,g,Q,"▽","\\bigtriangledown");c(f,g,Q,"†","\\dagger");c(f,g,Q,"⋄","\\diamond");c(f,g,Q,"⋆","\\star");c(f,g,Q,"◃","\\triangleleft");c(f,g,Q,"▹","\\triangleright");c(f,g,ct,"{","\\{");c(F,g,S,"{","\\{");c(F,g,S,"{","\\textbraceleft");c(f,g,tt,"}","\\}");c(F,g,S,"}","\\}");c(F,g,S,"}","\\textbraceright");c(f,g,ct,"{","\\lbrace");c(f,g,tt,"}","\\rbrace");c(f,g,ct,"[","\\lbrack",!0);c(F,g,S,"[","\\lbrack",!0);c(f,g,tt,"]","\\rbrack",!0);c(F,g,S,"]","\\rbrack",!0);c(f,g,ct,"(","\\lparen",!0);c(f,g,tt,")","\\rparen",!0);c(F,g,S,"<","\\textless",!0);c(F,g,S,">","\\textgreater",!0);c(f,g,ct,"⌊","\\lfloor",!0);c(f,g,tt,"⌋","\\rfloor",!0);c(f,g,ct,"⌈","\\lceil",!0);c(f,g,tt,"⌉","\\rceil",!0);c(f,g,S,"\\","\\backslash");c(f,g,S,"∣","|");c(f,g,S,"∣","\\vert");c(F,g,S,"|","\\textbar",!0);c(f,g,S,"∥","\\|");c(f,g,S,"∥","\\Vert");c(F,g,S,"∥","\\textbardbl");c(F,g,S,"~","\\textasciitilde");c(F,g,S,"\\","\\textbackslash");c(F,g,S,"^","\\textasciicircum");c(f,g,C,"↑","\\uparrow",!0);c(f,g,C,"⇑","\\Uparrow",!0);c(f,g,C,"↓","\\downarrow",!0);c(f,g,C,"⇓","\\Downarrow",!0);c(f,g,C,"↕","\\updownarrow",!0);c(f,g,C,"⇕","\\Updownarrow",!0);c(f,g,Fe,"∐","\\coprod");c(f,g,Fe,"⋁","\\bigvee");c(f,g,Fe,"⋀","\\bigwedge");c(f,g,Fe,"⨄","\\biguplus");c(f,g,Fe,"⋂","\\bigcap");c(f,g,Fe,"⋃","\\bigcup");c(f,g,Fe,"∫","\\int");c(f,g,Fe,"∫","\\intop");c(f,g,Fe,"∬","\\iint");c(f,g,Fe,"∭","\\iiint");c(f,g,Fe,"∏","\\prod");c(f,g,Fe,"∑","\\sum");c(f,g,Fe,"⨂","\\bigotimes");c(f,g,Fe,"⨁","\\bigoplus");c(f,g,Fe,"⨀","\\bigodot");c(f,g,Fe,"∮","\\oint");c(f,g,Fe,"∯","\\oiint");c(f,g,Fe,"∰","\\oiiint");c(f,g,Fe,"⨆","\\bigsqcup");c(f,g,Fe,"∫","\\smallint");c(F,g,qr,"…","\\textellipsis");c(f,g,qr,"…","\\mathellipsis");c(F,g,qr,"…","\\ldots",!0);c(f,g,qr,"…","\\ldots",!0);c(f,g,qr,"⋯","\\@cdots",!0);c(f,g,qr,"⋱","\\ddots",!0);c(f,g,S,"⋮","\\varvdots");c(F,g,S,"⋮","\\varvdots");c(f,g,Ae,"ˊ","\\acute");c(f,g,Ae,"ˋ","\\grave");c(f,g,Ae,"¨","\\ddot");c(f,g,Ae,"~","\\tilde");c(f,g,Ae,"ˉ","\\bar");c(f,g,Ae,"˘","\\breve");c(f,g,Ae,"ˇ","\\check");c(f,g,Ae,"^","\\hat");c(f,g,Ae,"⃗","\\vec");c(f,g,Ae,"˙","\\dot");c(f,g,Ae,"˚","\\mathring");c(f,g,ie,"","\\@imath");c(f,g,ie,"","\\@jmath");c(f,g,S,"ı","ı");c(f,g,S,"ȷ","ȷ");c(F,g,S,"ı","\\i",!0);c(F,g,S,"ȷ","\\j",!0);c(F,g,S,"ß","\\ss",!0);c(F,g,S,"æ","\\ae",!0);c(F,g,S,"œ","\\oe",!0);c(F,g,S,"ø","\\o",!0);c(F,g,S,"Æ","\\AE",!0);c(F,g,S,"Œ","\\OE",!0);c(F,g,S,"Ø","\\O",!0);c(F,g,Ae,"ˊ","\\'");c(F,g,Ae,"ˋ","\\`");c(F,g,Ae,"ˆ","\\^");c(F,g,Ae,"˜","\\~");c(F,g,Ae,"ˉ","\\=");c(F,g,Ae,"˘","\\u");c(F,g,Ae,"˙","\\.");c(F,g,Ae,"¸","\\c");c(F,g,Ae,"˚","\\r");c(F,g,Ae,"ˇ","\\v");c(F,g,Ae,"¨",'\\"');c(F,g,Ae,"˝","\\H");c(F,g,Ae,"◯","\\textcircled");var nu={"--":!0,"---":!0,"``":!0,"''":!0};c(F,g,S,"–","--",!0);c(F,g,S,"–","\\textendash");c(F,g,S,"—","---",!0);c(F,g,S,"—","\\textemdash");c(F,g,S,"‘","`",!0);c(F,g,S,"‘","\\textquoteleft");c(F,g,S,"’","'",!0);c(F,g,S,"’","\\textquoteright");c(F,g,S,"“","``",!0);c(F,g,S,"“","\\textquotedblleft");c(F,g,S,"”","''",!0);c(F,g,S,"”","\\textquotedblright");c(f,g,S,"°","\\degree",!0);c(F,g,S,"°","\\degree");c(F,g,S,"°","\\textdegree",!0);c(f,g,S,"£","\\pounds");c(f,g,S,"£","\\mathsterling",!0);c(F,g,S,"£","\\pounds");c(F,g,S,"£","\\textsterling",!0);c(f,x,S,"✠","\\maltese");c(F,x,S,"✠","\\maltese");var H0='0123456789/@."';for(var Xo=0;Xo<H0.length;Xo++){var V0=H0.charAt(Xo);c(f,g,S,V0,V0)}var F0='0123456789!@*()-=+";:?/.,';for(var jo=0;jo<F0.length;jo++){var $0=F0.charAt(jo);c(F,g,S,$0,$0)}var Qn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(var Qo=0;Qo<Qn.length;Qo++){var En=Qn.charAt(Qo);c(f,g,ie,En,En),c(F,g,S,En,En)}c(f,x,S,"C","ℂ");c(F,x,S,"C","ℂ");c(f,x,S,"H","ℍ");c(F,x,S,"H","ℍ");c(f,x,S,"N","ℕ");c(F,x,S,"N","ℕ");c(f,x,S,"P","ℙ");c(F,x,S,"P","ℙ");c(f,x,S,"Q","ℚ");c(F,x,S,"Q","ℚ");c(f,x,S,"R","ℝ");c(F,x,S,"R","ℝ");c(f,x,S,"Z","ℤ");c(F,x,S,"Z","ℤ");c(f,g,ie,"h","ℎ");c(F,g,ie,"h","ℎ");var de="";for(var je=0;je<Qn.length;je++){var De=Qn.charAt(je);de=String.fromCharCode(55349,56320+je),c(f,g,ie,De,de),c(F,g,S,De,de),de=String.fromCharCode(55349,56372+je),c(f,g,ie,De,de),c(F,g,S,De,de),de=String.fromCharCode(55349,56424+je),c(f,g,ie,De,de),c(F,g,S,De,de),de=String.fromCharCode(55349,56580+je),c(f,g,ie,De,de),c(F,g,S,De,de),de=String.fromCharCode(55349,56684+je),c(f,g,ie,De,de),c(F,g,S,De,de),de=String.fromCharCode(55349,56736+je),c(f,g,ie,De,de),c(F,g,S,De,de),de=String.fromCharCode(55349,56788+je),c(f,g,ie,De,de),c(F,g,S,De,de),de=String.fromCharCode(55349,56840+je),c(f,g,ie,De,de),c(F,g,S,De,de),de=String.fromCharCode(55349,56944+je),c(f,g,ie,De,de),c(F,g,S,De,de),je<26&&(de=String.fromCharCode(55349,56632+je),c(f,g,ie,De,de),c(F,g,S,De,de),de=String.fromCharCode(55349,56476+je),c(f,g,ie,De,de),c(F,g,S,De,de))}de="𝕜";c(f,g,ie,"k",de);c(F,g,S,"k",de);for(var rr=0;rr<10;rr++){var $t=rr.toString();de=String.fromCharCode(55349,57294+rr),c(f,g,ie,$t,de),c(F,g,S,$t,de),de=String.fromCharCode(55349,57314+rr),c(f,g,ie,$t,de),c(F,g,S,$t,de),de=String.fromCharCode(55349,57324+rr),c(f,g,ie,$t,de),c(F,g,S,$t,de),de=String.fromCharCode(55349,57334+rr),c(f,g,ie,$t,de),c(F,g,S,$t,de)}var Rl="ÐÞþ";for(var Zo=0;Zo<Rl.length;Zo++){var Sn=Rl.charAt(Zo);c(f,g,ie,Sn,Sn),c(F,g,S,Sn,Sn)}var Mn=[["mathbf","textbf","Main-Bold"],["mathbf","textbf","Main-Bold"],["mathnormal","textit","Math-Italic"],["mathnormal","textit","Math-Italic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["mathscr","textscr","Script-Regular"],["","",""],["","",""],["","",""],["mathfrak","textfrak","Fraktur-Regular"],["mathfrak","textfrak","Fraktur-Regular"],["mathbb","textbb","AMS-Regular"],["mathbb","textbb","AMS-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathitsf","textitsf","SansSerif-Italic"],["mathitsf","textitsf","SansSerif-Italic"],["","",""],["","",""],["mathtt","texttt","Typewriter-Regular"],["mathtt","texttt","Typewriter-Regular"]],q0=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],Cm=(r,e)=>{var t=r.charCodeAt(0),n=r.charCodeAt(1),o=(t-55296)*1024+(n-56320)+65536,l=e==="math"?0:1;if(119808<=o&&o<120484){var i=Math.floor((o-119808)/26);return[Mn[i][2],Mn[i][l]]}else if(120782<=o&&o<=120831){var s=Math.floor((o-120782)/10);return[q0[s][2],q0[s][l]]}else{if(o===120485||o===120486)return[Mn[0][2],Mn[0][l]];if(120486<o&&o<120782)return["",""];throw new _("Unsupported character: "+r)}},go=function(e,t,n){if(Se[n][e]){var o=Se[n][e].replace;o&&(e=o)}return{value:e,metrics:fa(e,t,n)}},Ze=function(e,t,n,o,l){var i=go(e,t,n),s=i.metrics;e=i.value;var u;if(s){var d=s.italic;(n==="text"||o&&o.font==="mathit")&&(d=0),u=new ut(e,s.height,s.depth,d,s.skew,s.width,l)}else typeof console<"u"&&console.warn("No character metrics "+("for '"+e+"' in style '"+t+"' and mode '"+n+"'")),u=new ut(e,0,0,0,0,0,l);if(o){u.maxFontSize=o.sizeMultiplier,o.style.isTight()&&u.classes.push("mtight");var m=o.getColor();m&&(u.style.color=m)}return u},ma=function(e,t,n,o){return o===void 0&&(o=[]),n.font==="boldsymbol"&&go(e,"Main-Bold",t).metrics?Ze(e,"Main-Bold",t,n,o.concat(["mathbf"])):e==="\\"||Se[t][e].font==="main"?Ze(e,"Main-Regular",t,n,o):Ze(e,"AMS-Regular",t,n,o.concat(["amsrm"]))},Tm=function(e,t,n,o,l){return l!=="textord"&&go(e,"Math-BoldItalic",t).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},vo=function(e,t,n){var o=e.mode,l=e.text,i=["mord"],s=o==="math"||o==="text"&&t.font,u=s?t.font:t.fontFamily,d="",m="";if(l.charCodeAt(0)===55349&&([d,m]=Cm(l,o)),d.length>0)return Ze(l,d,o,t,i.concat(m));if(u){var h,p;if(u==="boldsymbol"){var v=Tm(l,o,t,i,n);h=v.fontName,p=[v.fontClass]}else s?(h=Pl[u].fontName,p=[u]):(h=An(u,t.fontWeight,t.fontShape),p=[u,t.fontWeight,t.fontShape]);if(go(l,h,o).metrics)return Ze(l,h,o,t,i.concat(p));if(nu.hasOwnProperty(l)&&h.slice(0,10)==="Typewriter"){for(var b=[],w=0;w<l.length;w++)b.push(Ze(l[w],h,o,t,i.concat(p)));return Pt(b)}}if(n==="mathord")return Ze(l,"Math-Italic",o,t,i.concat(["mathnormal"]));if(n==="textord"){var k=Se[o][l]&&Se[o][l].font;if(k==="ams"){var T=An("amsrm",t.fontWeight,t.fontShape);return Ze(l,T,o,t,i.concat("amsrm",t.fontWeight,t.fontShape))}else if(k==="main"||!k){var E=An("textrm",t.fontWeight,t.fontShape);return Ze(l,E,o,t,i.concat(t.fontWeight,t.fontShape))}else{var M=An(k,t.fontWeight,t.fontShape);return Ze(l,M,o,t,i.concat(M,t.fontWeight,t.fontShape))}}else throw new Error("unexpected type: "+n+" in makeOrd")},Em=(r,e)=>{if(Yt(r.classes)!==Yt(e.classes)||r.skew!==e.skew||r.maxFontSize!==e.maxFontSize||r.italic!==0&&r.hasClass("mathnormal"))return!1;if(r.classes.length===1){var t=r.classes[0];if(t==="mbin"||t==="mord")return!1}for(var n of Object.keys(r.style))if(r.style[n]!==e.style[n])return!1;for(var o of Object.keys(e.style))if(r.style[o]!==e.style[o])return!1;return!0},ou=r=>{for(var e=0;e<r.length-1;e++){var t=r[e],n=r[e+1];t instanceof ut&&n instanceof ut&&Em(t,n)&&(t.text+=n.text,t.height=Math.max(t.height,n.height),t.depth=Math.max(t.depth,n.depth),t.italic=n.italic,r.splice(e+1,1),e--)}return r},ha=function(e){for(var t=0,n=0,o=0,l=0;l<e.children.length;l++){var i=e.children[l];i.height>t&&(t=i.height),i.depth>n&&(n=i.depth),i.maxFontSize>o&&(o=i.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=o},U=function(e,t,n,o){var l=new $r(e,t,n,o);return ha(l),l},Xt=(r,e,t,n)=>new $r(r,e,t,n),Rr=function(e,t,n){var o=U([e],[],t);return o.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),o.style.borderBottomWidth=Y(o.height),o.maxFontSize=1,o},Sm=function(e,t,n,o){var l=new po(e,t,n,o);return ha(l),l},Pt=function(e){var t=new Fr(e);return ha(t),t},Pr=function(e,t){return e instanceof Fr?U([],[e],t):e},Mm=function(e){if(e.positionType==="individualShift"){for(var t=e.children,n=[t[0]],o=-t[0].shift-t[0].elem.depth,l=o,i=1;i<t.length;i++){var s=-t[i].shift-l-t[i].elem.depth,u=s-(t[i-1].elem.height+t[i-1].elem.depth);l=l+s,n.push({type:"kern",size:u}),n.push(t[i])}return{children:n,depth:o}}var d;if(e.positionType==="top"){for(var m=e.positionData,h=0;h<e.children.length;h++){var p=e.children[h];m-=p.type==="kern"?p.size:p.elem.height+p.elem.depth}d=m}else if(e.positionType==="bottom")d=-e.positionData;else{var v=e.children[0];if(v.type!=="elem")throw new Error('First child must have type "elem".');if(e.positionType==="shift")d=-v.elem.depth-e.positionData;else if(e.positionType==="firstBaseline")d=-v.elem.depth;else throw new Error("Invalid positionType "+e.positionType+".")}return{children:e.children,depth:d}},xe=function(e,t){for(var{children:n,depth:o}=Mm(e),l=0,i=0;i<n.length;i++){var s=n[i];if(s.type==="elem"){var u=s.elem;l=Math.max(l,u.maxFontSize,u.height)}}l+=2;var d=U(["pstrut"],[]);d.style.height=Y(l);for(var m=[],h=o,p=o,v=o,b=0;b<n.length;b++){var w=n[b];if(w.type==="kern")v+=w.size;else{var k=w.elem,T=w.wrapperClasses||[],E=w.wrapperStyle||{},M=U(T,[d,k],void 0,E);M.style.top=Y(-l-v-k.depth),w.marginLeft&&(M.style.marginLeft=w.marginLeft),w.marginRight&&(M.style.marginRight=w.marginRight),m.push(M),v+=k.height+k.depth}h=Math.min(h,v),p=Math.max(p,v)}var B=U(["vlist"],m);B.style.height=Y(p);var D;if(h<0){var z=U([],[]),W=U(["vlist"],[z]);W.style.height=Y(-h);var H=U(["vlist-s"],[new ut("​")]);D=[U(["vlist-r"],[B,H]),U(["vlist-r"],[W])]}else D=[U(["vlist-r"],[B])];var A=U(["vlist-t"],D);return D.length===2&&A.classes.push("vlist-t2"),A.height=p,A.depth=-h,A},lu=(r,e)=>{var t=U(["mspace"],[],e),n=Ie(r,e);return t.style.marginRight=Y(n),t},An=function(e,t,n){var o="";switch(e){case"amsrm":o="AMS";break;case"textrm":o="Main";break;case"textsf":o="SansSerif";break;case"texttt":o="Typewriter";break;default:o=e}var l;return t==="textbf"&&n==="textit"?l="BoldItalic":t==="textbf"?l="Bold":t==="textit"?l="Italic":l="Regular",o+"-"+l},Pl={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"}},au={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},iu=function(e,t){var[n,o,l]=au[e],i=new Jt(n),s=new zt([i],{width:Y(o),height:Y(l),style:"width:"+Y(o),viewBox:"0 0 "+1e3*o+" "+1e3*l,preserveAspectRatio:"xMinYMin"}),u=Xt(["overlay"],[s],t);return u.height=l,u.style.height=Y(l),u.style.width=Y(o),u},Ne={number:3,unit:"mu"},nr={number:4,unit:"mu"},At={number:5,unit:"mu"},Am={mord:{mop:Ne,mbin:nr,mrel:At,minner:Ne},mop:{mord:Ne,mop:Ne,mrel:At,minner:Ne},mbin:{mord:nr,mop:nr,mopen:nr,minner:nr},mrel:{mord:At,mop:At,mopen:At,minner:At},mopen:{},mclose:{mop:Ne,mbin:nr,mrel:At,minner:Ne},mpunct:{mord:Ne,mop:Ne,mrel:At,mopen:Ne,mclose:Ne,mpunct:Ne,minner:Ne},minner:{mord:Ne,mop:Ne,mbin:nr,mrel:At,mopen:Ne,mpunct:Ne,minner:Ne}},Bm={mord:{mop:Ne},mop:{mord:Ne,mop:Ne},mbin:{},mrel:{},mopen:{},mclose:{mop:Ne},mpunct:{},minner:{mop:Ne}},su={},Zn={},eo={};function j(r){for(var{type:e,names:t,props:n,handler:o,htmlBuilder:l,mathmlBuilder:i}=r,s={type:e,numArgs:n.numArgs,argTypes:n.argTypes,allowedInArgument:!!n.allowedInArgument,allowedInText:!!n.allowedInText,allowedInMath:n.allowedInMath===void 0?!0:n.allowedInMath,numOptionalArgs:n.numOptionalArgs||0,infix:!!n.infix,primitive:!!n.primitive,handler:o},u=0;u<t.length;++u)su[t[u]]=s;e&&(l&&(Zn[e]=l),i&&(eo[e]=i))}function vr(r){var{type:e,htmlBuilder:t,mathmlBuilder:n}=r;j({type:e,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:t,mathmlBuilder:n})}var to=function(e){return e.type==="ordgroup"&&e.body.length===1?e.body[0]:e},He=function(e){return e.type==="ordgroup"?e.body:[e]},Nm=new Set(["leftmost","mbin","mopen","mrel","mop","mpunct"]),Lm=new Set(["rightmost","mrel","mclose","mpunct"]),Im={display:fe.DISPLAY,text:fe.TEXT,script:fe.SCRIPT,scriptscript:fe.SCRIPTSCRIPT},zm={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},Ge=function(e,t,n,o){o===void 0&&(o=[null,null]);for(var l=[],i=0;i<e.length;i++){var s=Ce(e[i],t);if(s instanceof Fr){var u=s.children;l.push(...u)}else l.push(s)}if(ou(l),!n)return l;var d=t;if(e.length===1){var m=e[0];m.type==="sizing"?d=t.havingSize(m.size):m.type==="styling"&&(d=t.havingStyle(Im[m.style]))}var h=U([o[0]||"leftmost"],[],t),p=U([o[1]||"rightmost"],[],t),v=n==="root";return Hl(l,(b,w)=>{var k=w.classes[0],T=b.classes[0];k==="mbin"&&Lm.has(T)?w.classes[0]="mord":T==="mbin"&&Nm.has(k)&&(b.classes[0]="mord")},{node:h},p,v),Hl(l,(b,w)=>{var k,T,E=Fl(w),M=Fl(b),B=E&&M?b.hasClass("mtight")?(k=Bm[E])==null?void 0:k[M]:(T=Am[E])==null?void 0:T[M]:null;if(B)return lu(B,d)},{node:h},p,v),l},Hl=function(e,t,n,o,l){o&&e.push(o);for(var i=0;i<e.length;i++){var s=e[i],u=uu(s);if(u){Hl(u.children,t,n,null,l);continue}var d=!s.hasClass("mspace");if(d){var m=t(s,n.node);m&&(n.insertAfter?n.insertAfter(m):(e.unshift(m),i++))}d?n.node=s:l&&s.hasClass("newline")&&(n.node=U(["leftmost"])),n.insertAfter=(h=>p=>{e.splice(h+1,0,p),i++})(i)}o&&e.pop()},uu=function(e){return e instanceof Fr||e instanceof po||e instanceof $r&&e.hasClass("enclosing")?e:null},Vl=function(e,t){var n=uu(e);if(n){var o=n.children;if(o.length){if(t==="right")return Vl(o[o.length-1],"right");if(t==="left")return Vl(o[0],"left")}}return e},Fl=function(e,t){if(!e)return null;t&&(e=Vl(e,t));var n=e.classes[0];return zm[n]||null},sn=function(e,t){var n=["nulldelimiter"].concat(e.baseSizingClasses());return U(t.concat(n))},Ce=function(e,t,n){if(!e)return U();if(Zn[e.type]){var o=Zn[e.type](e,t);if(n&&t.size!==n.size){o=U(t.sizingClasses(n),[o],t);var l=t.sizeMultiplier/n.sizeMultiplier;o.height*=l,o.depth*=l}return o}else throw new _("Got group of unknown type: '"+e.type+"'")};function Bn(r,e){var t=U(["base"],r,e),n=U(["strut"]);return n.style.height=Y(t.height+t.depth),t.depth&&(n.style.verticalAlign=Y(-t.depth)),t.children.unshift(n),t}function $l(r,e){var t=null;r.length===1&&r[0].type==="tag"&&(t=r[0].tag,r=r[0].body);var n=Ge(r,e,"root"),o;n.length===2&&n[1].hasClass("tag")&&(o=n.pop());for(var l=[],i=[],s=0;s<n.length;s++)if(i.push(n[s]),n[s].hasClass("mbin")||n[s].hasClass("mrel")||n[s].hasClass("allowbreak")){for(var u=!1;s<n.length-1&&n[s+1].hasClass("mspace")&&!n[s+1].hasClass("newline");)s++,i.push(n[s]),n[s].hasClass("nobreak")&&(u=!0);u||(l.push(Bn(i,e)),i=[])}else n[s].hasClass("newline")&&(i.pop(),i.length>0&&(l.push(Bn(i,e)),i=[]),l.push(n[s]));i.length>0&&l.push(Bn(i,e));var d;t?(d=Bn(Ge(t,e,!0),e),d.classes=["tag"],l.push(d)):o&&l.push(o);var m=U(["katex-html"],l);if(m.setAttribute("aria-hidden","true"),d){var h=d.children[0];h.style.height=Y(m.height+m.depth),m.depth&&(h.style.verticalAlign=Y(-m.depth))}return m}function cu(r){return new Fr(r)}class G{constructor(e,t,n){this.type=e,this.attributes={},this.children=t||[],this.classes=n||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=Yt(this.classes));for(var n=0;n<this.children.length;n++)if(this.children[n]instanceof Ve&&this.children[n+1]instanceof Ve){for(var o=this.children[n].toText()+this.children[++n].toText();this.children[n+1]instanceof Ve;)o+=this.children[++n].toText();e.appendChild(new Ve(o).toNode())}else e.appendChild(this.children[n].toNode());return e}toMarkup(){var e="<"+this.type;for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="',e+=Ye(this.attributes[t]),e+='"');this.classes.length>0&&(e+=' class ="'+Ye(Yt(this.classes))+'"'),e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+="</"+this.type+">",e}toText(){return this.children.map(e=>e.toText()).join("")}}class Ve{constructor(e){this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return Ye(this.toText())}toText(){return this.text}}class du{constructor(e){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",Y(this.width)),e}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+Y(this.width)+'"/>'}toText(){return this.character?this.character:" "}}var Dm=new Set(["\\imath","\\jmath"]),Om=new Set(["mrow","mtable"]),pt=function(e,t,n){return Se[t][e]&&Se[t][e].replace&&e.charCodeAt(0)!==55349&&!(nu.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)==="tt"||n.font&&n.font.slice(4,6)==="tt"))&&(e=Se[t][e].replace),new Ve(e)},pa=function(e){return e.length===1?e[0]:new G("mrow",e)},ga=function(e,t){if(t.fontFamily==="texttt")return"monospace";if(t.fontFamily==="textsf")return t.fontShape==="textit"&&t.fontWeight==="textbf"?"sans-serif-bold-italic":t.fontShape==="textit"?"sans-serif-italic":t.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(t.fontShape==="textit"&&t.fontWeight==="textbf")return"bold-italic";if(t.fontShape==="textit")return"italic";if(t.fontWeight==="textbf")return"bold";var n=t.font;if(!n||n==="mathnormal")return null;var o=e.mode;if(n==="mathit")return"italic";if(n==="boldsymbol")return e.type==="textord"?"bold":"bold-italic";if(n==="mathbf")return"bold";if(n==="mathbb")return"double-struck";if(n==="mathsfit")return"sans-serif-italic";if(n==="mathfrak")return"fraktur";if(n==="mathscr"||n==="mathcal")return"script";if(n==="mathsf")return"sans-serif";if(n==="mathtt")return"monospace";var l=e.text;if(Dm.has(l))return null;if(Se[o][l]){var i=Se[o][l].replace;i&&(l=i)}var s=Pl[n].fontName;return fa(l,s,o)?Pl[n].variant:null};function el(r){if(!r)return!1;if(r.type==="mi"&&r.children.length===1){var e=r.children[0];return e instanceof Ve&&e.text==="."}else if(r.type==="mo"&&r.children.length===1&&r.getAttribute("separator")==="true"&&r.getAttribute("lspace")==="0em"&&r.getAttribute("rspace")==="0em"){var t=r.children[0];return t instanceof Ve&&t.text===","}else return!1}var dt=function(e,t,n){if(e.length===1){var o=Ee(e[0],t);return n&&o instanceof G&&o.type==="mo"&&(o.setAttribute("lspace","0em"),o.setAttribute("rspace","0em")),[o]}for(var l=[],i,s=0;s<e.length;s++){var u=Ee(e[s],t);if(u instanceof G&&i instanceof G){if(u.type==="mtext"&&i.type==="mtext"&&u.getAttribute("mathvariant")===i.getAttribute("mathvariant")){i.children.push(...u.children);continue}else if(u.type==="mn"&&i.type==="mn"){i.children.push(...u.children);continue}else if(el(u)&&i.type==="mn"){i.children.push(...u.children);continue}else if(u.type==="mn"&&el(i))u.children=[...i.children,...u.children],l.pop();else if((u.type==="msup"||u.type==="msub")&&u.children.length>=1&&(i.type==="mn"||el(i))){var d=u.children[0];d instanceof G&&d.type==="mn"&&(d.children=[...i.children,...d.children],l.pop())}else if(i.type==="mi"&&i.children.length===1){var m=i.children[0];if(m instanceof Ve&&m.text==="̸"&&(u.type==="mo"||u.type==="mi"||u.type==="mn")){var h=u.children[0];h instanceof Ve&&h.text.length>0&&(h.text=h.text.slice(0,1)+"̸"+h.text.slice(1),l.pop())}}}l.push(u),i=u}return l},jt=function(e,t,n){return pa(dt(e,t,n))},Ee=function(e,t){if(!e)return new G("mrow");if(eo[e.type]){var n=eo[e.type](e,t);return n}else throw new _("Got group of unknown type: '"+e.type+"'")};function U0(r,e,t,n,o){var l=dt(r,t),i;l.length===1&&l[0]instanceof G&&Om.has(l[0].type)?i=l[0]:i=new G("mrow",l);var s=new G("annotation",[new Ve(e)]);s.setAttribute("encoding","application/x-tex");var u=new G("semantics",[i,s]),d=new G("math",[u]);d.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&d.setAttribute("display","block");var m=o?"katex":"katex-mathml";return U([m],[d])}var Rm=[[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]],W0=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],_0=function(e,t){return t.size<2?e:Rm[e-1][t.size-1]};class Nt{constructor(e){this.style=e.style,this.color=e.color,this.size=e.size||Nt.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=W0[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var t={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(t,e),new Nt(t)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:_0(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:W0[e-1]})}havingBaseStyle(e){e=e||this.style.text();var t=_0(Nt.BASESIZE,e);return this.size===t&&this.textSize===Nt.BASESIZE&&this.style===e?this:this.extend({style:e,size:t})}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?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Nt.BASESIZE?["sizing","reset-size"+this.size,"size"+Nt.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=wm(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Nt.BASESIZE=6;var fu=function(e){return new Nt({style:e.displayMode?fe.DISPLAY:fe.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},mu=function(e,t){if(t.displayMode){var n=["katex-display"];t.leqno&&n.push("leqno"),t.fleqn&&n.push("fleqn"),e=U(n,[e])}return e},Pm=function(e,t,n){var o=fu(n),l;if(n.output==="mathml")return U0(e,t,o,n.displayMode,!0);if(n.output==="html"){var i=$l(e,o);l=U(["katex"],[i])}else{var s=U0(e,t,o,n.displayMode,!1),u=$l(e,o);l=U(["katex"],[s,u])}return mu(l,n)},Hm=function(e,t,n){var o=fu(n),l=$l(e,o),i=U(["katex"],[l]);return mu(i,n)},Vm={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":"="},bo=function(e){var t=new G("mo",[new Ve(Vm[e.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},Fm={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]},$m=new Set(["widehat","widecheck","widetilde","utilde"]),yo=function(e,t){function n(){var s=4e5,u=e.label.slice(1);if($m.has(u)){var d=e,m=d.base.type==="ordgroup"?d.base.body.length:1,h,p,v;if(m>5)u==="widehat"||u==="widecheck"?(h=420,s=2364,v=.42,p=u+"4"):(h=312,s=2340,v=.34,p="tilde4");else{var b=[1,1,2,2,3,3][m];u==="widehat"||u==="widecheck"?(s=[0,1062,2364,2364,2364][b],h=[0,239,300,360,420][b],v=[0,.24,.3,.3,.36,.42][b],p=u+b):(s=[0,600,1033,2339,2340][b],h=[0,260,286,306,312][b],v=[0,.26,.286,.3,.306,.34][b],p="tilde"+b)}var w=new Jt(p),k=new zt([w],{width:"100%",height:Y(v),viewBox:"0 0 "+s+" "+h,preserveAspectRatio:"none"});return{span:Xt([],[k],t),minWidth:0,height:v}}else{var T=[],E=Fm[u],[M,B,D]=E,z=D/1e3,W=M.length,H,A;if(W===1){var R=E[3];H=["hide-tail"],A=[R]}else if(W===2)H=["halfarrow-left","halfarrow-right"],A=["xMinYMin","xMaxYMin"];else if(W===3)H=["brace-left","brace-center","brace-right"],A=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
302
+ `+W+" children.");for(var K=0;K<W;K++){var J=new Jt(M[K]),te=new zt([J],{width:"400em",height:Y(z),viewBox:"0 0 "+s+" "+D,preserveAspectRatio:A[K]+" slice"}),Z=Xt([H[K]],[te],t);if(W===1)return{span:Z,minWidth:B,height:z};Z.style.height=Y(z),T.push(Z)}return{span:U(["stretchy"],T,t),minWidth:B,height:z}}}var{span:o,minWidth:l,height:i}=n();return o.height=i,o.style.height=Y(i),l>0&&(o.style.minWidth=Y(l)),o},qm=function(e,t,n,o,l){var i,s=e.height+e.depth+n+o;if(/fbox|color|angl/.test(t)){if(i=U(["stretchy",t],[],l),t==="fbox"){var u=l.color&&l.getColor();u&&(i.style.borderColor=u)}}else{var d=[];/^[bx]cancel$/.test(t)&&d.push(new Ol({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&d.push(new Ol({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var m=new zt(d,{width:"100%",height:Y(s)});i=Xt([],[m],l)}return i.height=s,i.style.height=Y(s),i};function he(r,e){if(!r||r.type!==e)throw new Error("Expected node of type "+e+", but got "+(r?"node of type "+r.type:String(r)));return r}function wo(r){var e=ko(r);if(!e)throw new Error("Expected node of symbol group type, but got "+(r?"node of type "+r.type:String(r)));return e}function ko(r){return r&&(r.type==="atom"||xm.hasOwnProperty(r.type))?r:null}var hu=r=>{if(r instanceof ut)return r;if(bm(r)&&r.children.length===1)return hu(r.children[0])},va=(r,e)=>{var t,n,o;r&&r.type==="supsub"?(n=he(r.base,"accent"),t=n.base,r.base=t,o=vm(Ce(r,e)),r.base=n):(n=he(r,"accent"),t=n.base);var l=Ce(t,e.havingCrampedStyle()),i=n.isShifty&&Ot(t),s=0;if(i){var u,d;s=(u=(d=hu(l))==null?void 0:d.skew)!=null?u:0}var m=n.label==="\\c",h=m?l.height+l.depth:Math.min(l.height,e.fontMetrics().xHeight),p;if(n.isStretchy)p=yo(n,e),p=xe({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"elem",elem:p,wrapperClasses:["svg-align"],wrapperStyle:s>0?{width:"calc(100% - "+Y(2*s)+")",marginLeft:Y(2*s)}:void 0}]});else{var v,b;n.label==="\\vec"?(v=iu("vec",e),b=au.vec[1]):(v=vo({mode:n.mode,text:n.label},e,"textord"),v=gm(v),v.italic=0,b=v.width,m&&(h+=v.depth)),p=U(["accent-body"],[v]);var w=n.label==="\\textcircled";w&&(p.classes.push("accent-full"),h=l.height);var k=s;w||(k-=b/2),p.style.left=Y(k),n.label==="\\textcircled"&&(p.style.top=".2em"),p=xe({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:-h},{type:"elem",elem:p}]})}var T=U(["mord","accent"],[p],e);return o?(o.children[0]=T,o.height=Math.max(T.height,o.height),o.classes[0]="mord",o):T},pu=(r,e)=>{var t=r.isStretchy?bo(r.label):new G("mo",[pt(r.label,r.mode)]),n=new G("mover",[Ee(r.base,e),t]);return n.setAttribute("accent","true"),n},Um=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(r=>"\\"+r).join("|"));j({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"],props:{numArgs:1},handler:(r,e)=>{var t=to(e[0]),n=!Um.test(r.funcName),o=!n||r.funcName==="\\widehat"||r.funcName==="\\widetilde"||r.funcName==="\\widecheck";return{type:"accent",mode:r.parser.mode,label:r.funcName,isStretchy:n,isShifty:o,base:t}},htmlBuilder:va,mathmlBuilder:pu});j({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(r,e)=>{var t=e[0],n=r.parser.mode;return n==="math"&&(r.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+r.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:r.funcName,isStretchy:!1,isShifty:!0,base:t}},htmlBuilder:va,mathmlBuilder:pu});j({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(r,e)=>{var{parser:t,funcName:n}=r,o=e[0];return{type:"accentUnder",mode:t.mode,label:n,base:o}},htmlBuilder:(r,e)=>{var t=Ce(r.base,e),n=yo(r,e),o=r.label==="\\utilde"?.12:0,l=xe({positionType:"top",positionData:t.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:o},{type:"elem",elem:t}]});return U(["mord","accentunder"],[l],e)},mathmlBuilder:(r,e)=>{var t=bo(r.label),n=new G("munder",[Ee(r.base,e),t]);return n.setAttribute("accentunder","true"),n}});var Nn=r=>{var e=new G("mpadded",r?[r]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};j({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"],props:{numArgs:1,numOptionalArgs:1},handler(r,e,t){var{parser:n,funcName:o}=r;return{type:"xArrow",mode:n.mode,label:o,body:e[0],below:t[0]}},htmlBuilder(r,e){var t=e.style,n=e.havingStyle(t.sup()),o=Pr(Ce(r.body,n,e),e),l=r.label.slice(0,2)==="\\x"?"x":"cd";o.classes.push(l+"-arrow-pad");var i;r.below&&(n=e.havingStyle(t.sub()),i=Pr(Ce(r.below,n,e),e),i.classes.push(l+"-arrow-pad"));var s=yo(r,e),u=-e.fontMetrics().axisHeight+.5*s.height,d=-e.fontMetrics().axisHeight-.5*s.height-.111;(o.depth>.25||r.label==="\\xleftequilibrium")&&(d-=o.depth);var m;if(i){var h=-e.fontMetrics().axisHeight+i.height+.5*s.height+.111;m=xe({positionType:"individualShift",children:[{type:"elem",elem:o,shift:d},{type:"elem",elem:s,shift:u},{type:"elem",elem:i,shift:h}]})}else m=xe({positionType:"individualShift",children:[{type:"elem",elem:o,shift:d},{type:"elem",elem:s,shift:u}]});return m.children[0].children[0].children[1].classes.push("svg-align"),U(["mrel","x-arrow"],[m],e)},mathmlBuilder(r,e){var t=bo(r.label);t.setAttribute("minsize",r.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(r.body){var o=Nn(Ee(r.body,e));if(r.below){var l=Nn(Ee(r.below,e));n=new G("munderover",[t,l,o])}else n=new G("mover",[t,o])}else if(r.below){var i=Nn(Ee(r.below,e));n=new G("munder",[t,i])}else n=Nn(),n=new G("mover",[t,n]);return n}});function gu(r,e){var t=Ge(r.body,e,!0);return U([r.mclass],t,e)}function vu(r,e){var t,n=dt(r.body,e);return r.mclass==="minner"?t=new G("mpadded",n):r.mclass==="mord"?r.isCharacterBox?(t=n[0],t.type="mi"):t=new G("mi",n):(r.isCharacterBox?(t=n[0],t.type="mo"):t=new G("mo",n),r.mclass==="mbin"?(t.attributes.lspace="0.22em",t.attributes.rspace="0.22em"):r.mclass==="mpunct"?(t.attributes.lspace="0em",t.attributes.rspace="0.17em"):r.mclass==="mopen"||r.mclass==="mclose"?(t.attributes.lspace="0em",t.attributes.rspace="0em"):r.mclass==="minner"&&(t.attributes.lspace="0.0556em",t.attributes.width="+0.1111em")),t}j({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(r,e){var{parser:t,funcName:n}=r,o=e[0];return{type:"mclass",mode:t.mode,mclass:"m"+n.slice(5),body:He(o),isCharacterBox:Ot(o)}},htmlBuilder:gu,mathmlBuilder:vu});var xo=r=>{var e=r.type==="ordgroup"&&r.body.length?r.body[0]:r;return e.type==="atom"&&(e.family==="bin"||e.family==="rel")?"m"+e.family:"mord"};j({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(r,e){var{parser:t}=r;return{type:"mclass",mode:t.mode,mclass:xo(e[0]),body:He(e[1]),isCharacterBox:Ot(e[1])}}});j({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(r,e){var{parser:t,funcName:n}=r,o=e[1],l=e[0],i;n!=="\\stackrel"?i=xo(o):i="mrel";var s={type:"op",mode:o.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:He(o)},u={type:"supsub",mode:l.mode,base:s,sup:n==="\\underset"?null:l,sub:n==="\\underset"?l:null};return{type:"mclass",mode:t.mode,mclass:i,body:[u],isCharacterBox:Ot(u)}},htmlBuilder:gu,mathmlBuilder:vu});j({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(r,e){var{parser:t}=r;return{type:"pmb",mode:t.mode,mclass:xo(e[0]),body:He(e[0])}},htmlBuilder(r,e){var t=Ge(r.body,e,!0),n=U([r.mclass],t,e);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(r,e){var t=dt(r.body,e),n=new G("mstyle",t);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var Wm={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},G0=()=>({type:"styling",body:[],mode:"math",style:"display"}),K0=r=>r.type==="textord"&&r.text==="@",_m=(r,e)=>(r.type==="mathord"||r.type==="atom")&&r.text===e;function Gm(r,e,t){var n=Wm[r];switch(n){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return t.callFunction(n,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var o=t.callFunction("\\\\cdleft",[e[0]],[]),l={type:"atom",text:n,mode:"math",family:"rel"},i=t.callFunction("\\Big",[l],[]),s=t.callFunction("\\\\cdright",[e[1]],[]),u={type:"ordgroup",mode:"math",body:[o,i,s]};return t.callFunction("\\\\cdparent",[u],[])}case"\\\\cdlongequal":return t.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var d={type:"textord",text:"\\Vert",mode:"math"};return t.callFunction("\\Big",[d],[])}default:return{type:"textord",text:" ",mode:"math"}}}function Km(r){var e=[];for(r.gullet.beginGroup(),r.gullet.macros.set("\\cr","\\\\\\relax"),r.gullet.beginGroup();;){e.push(r.parseExpression(!1,"\\\\")),r.gullet.endGroup(),r.gullet.beginGroup();var t=r.fetch().text;if(t==="&"||t==="\\\\")r.consume();else if(t==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new _("Expected \\\\ or \\cr or \\end",r.nextToken)}for(var n=[],o=[n],l=0;l<e.length;l++){for(var i=e[l],s=G0(),u=0;u<i.length;u++)if(!K0(i[u]))s.body.push(i[u]);else{n.push(s),u+=1;var d=wo(i[u]).text,m=new Array(2);if(m[0]={type:"ordgroup",mode:"math",body:[]},m[1]={type:"ordgroup",mode:"math",body:[]},!"=|.".includes(d))if("<>AV".includes(d))for(var h=0;h<2;h++){for(var p=!0,v=u+1;v<i.length;v++){if(_m(i[v],d)){p=!1,u=v;break}if(K0(i[v]))throw new _("Missing a "+d+" character to complete a CD arrow.",i[v]);m[h].body.push(i[v])}if(p)throw new _("Missing a "+d+" character to complete a CD arrow.",i[u])}else throw new _('Expected one of "<>AV=|." after @',i[u]);var b=Gm(d,m,r),w={type:"styling",body:[b],mode:"math",style:"display"};n.push(w),s=G0()}l%2===0?n.push(s):n.shift(),n=[],o.push(n)}r.gullet.endGroup(),r.gullet.endGroup();var k=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:k,colSeparationType:"CD",hLinesBeforeRow:new Array(o.length+1).fill([])}}j({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(r,e){var{parser:t,funcName:n}=r;return{type:"cdlabel",mode:t.mode,side:n.slice(4),label:e[0]}},htmlBuilder(r,e){var t=e.havingStyle(e.style.sup()),n=Pr(Ce(r.label,t,e),e);return n.classes.push("cd-label-"+r.side),n.style.bottom=Y(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder(r,e){var t=new G("mrow",[Ee(r.label,e)]);return t=new G("mpadded",[t]),t.setAttribute("width","0"),r.side==="left"&&t.setAttribute("lspace","-1width"),t.setAttribute("voffset","0.7em"),t=new G("mstyle",[t]),t.setAttribute("displaystyle","false"),t.setAttribute("scriptlevel","1"),t}});j({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(r,e){var{parser:t}=r;return{type:"cdlabelparent",mode:t.mode,fragment:e[0]}},htmlBuilder(r,e){var t=Pr(Ce(r.fragment,e),e);return t.classes.push("cd-vert-arrow"),t},mathmlBuilder(r,e){return new G("mrow",[Ee(r.fragment,e)])}});j({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(r,e){for(var{parser:t}=r,n=he(e[0],"ordgroup"),o=n.body,l="",i=0;i<o.length;i++){var s=he(o[i],"textord");l+=s.text}var u=parseInt(l),d;if(isNaN(u))throw new _("\\@char has non-numeric argument "+l);if(u<0||u>=1114111)throw new _("\\@char with invalid code point "+l);return u<=65535?d=String.fromCharCode(u):(u-=65536,d=String.fromCharCode((u>>10)+55296,(u&1023)+56320)),{type:"textord",mode:t.mode,text:d}}});var bu=(r,e)=>{var t=Ge(r.body,e.withColor(r.color),!1);return Pt(t)},yu=(r,e)=>{var t=dt(r.body,e.withColor(r.color)),n=new G("mstyle",t);return n.setAttribute("mathcolor",r.color),n};j({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(r,e){var{parser:t}=r,n=he(e[0],"color-token").color,o=e[1];return{type:"color",mode:t.mode,color:n,body:He(o)}},htmlBuilder:bu,mathmlBuilder:yu});j({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(r,e){var{parser:t,breakOnTokenText:n}=r,o=he(e[0],"color-token").color;t.gullet.macros.set("\\current@color",o);var l=t.parseExpression(!0,n);return{type:"color",mode:t.mode,color:o,body:l}},htmlBuilder:bu,mathmlBuilder:yu});j({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(r,e,t){var{parser:n}=r,o=n.gullet.future().text==="["?n.parseSizeGroup(!0):null,l=!n.settings.displayMode||!n.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:n.mode,newLine:l,size:o&&he(o,"size").value}},htmlBuilder(r,e){var t=U(["mspace"],[],e);return r.newLine&&(t.classes.push("newline"),r.size&&(t.style.marginTop=Y(Ie(r.size,e)))),t},mathmlBuilder(r,e){var t=new G("mspace");return r.newLine&&(t.setAttribute("linebreak","newline"),r.size&&t.setAttribute("height",Y(Ie(r.size,e)))),t}});var ql={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},wu=r=>{var e=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new _("Expected a control sequence",r);return e},Ym=r=>{var e=r.gullet.popToken();return e.text==="="&&(e=r.gullet.popToken(),e.text===" "&&(e=r.gullet.popToken())),e},ku=(r,e,t,n)=>{var o=r.gullet.macros.get(t.text);o==null&&(t.noexpand=!0,o={tokens:[t],numArgs:0,unexpandable:!r.gullet.isExpandable(t.text)}),r.gullet.macros.set(e,o,n)};j({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(r){var{parser:e,funcName:t}=r;e.consumeSpaces();var n=e.fetch();if(ql[n.text])return(t==="\\global"||t==="\\\\globallong")&&(n.text=ql[n.text]),he(e.parseFunction(),"internal");throw new _("Invalid token after macro prefix",n)}});j({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r){var{parser:e,funcName:t}=r,n=e.gullet.popToken(),o=n.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(o))throw new _("Expected a control sequence",n);for(var l=0,i,s=[[]];e.gullet.future().text!=="{";)if(n=e.gullet.popToken(),n.text==="#"){if(e.gullet.future().text==="{"){i=e.gullet.future(),s[l].push("{");break}if(n=e.gullet.popToken(),!/^[1-9]$/.test(n.text))throw new _('Invalid argument number "'+n.text+'"');if(parseInt(n.text)!==l+1)throw new _('Argument number "'+n.text+'" out of order');l++,s.push([])}else{if(n.text==="EOF")throw new _("Expected a macro definition");s[l].push(n.text)}var{tokens:u}=e.gullet.consumeArg();return i&&u.unshift(i),(t==="\\edef"||t==="\\xdef")&&(u=e.gullet.expandTokens(u),u.reverse()),e.gullet.macros.set(o,{tokens:u,numArgs:l,delimiters:s},t===ql[t]),{type:"internal",mode:e.mode}}});j({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r){var{parser:e,funcName:t}=r,n=wu(e.gullet.popToken());e.gullet.consumeSpaces();var o=Ym(e);return ku(e,n,o,t==="\\\\globallet"),{type:"internal",mode:e.mode}}});j({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r){var{parser:e,funcName:t}=r,n=wu(e.gullet.popToken()),o=e.gullet.popToken(),l=e.gullet.popToken();return ku(e,n,l,t==="\\\\globalfuture"),e.gullet.pushToken(l),e.gullet.pushToken(o),{type:"internal",mode:e.mode}}});var Yr=function(e,t,n){var o=Se.math[e]&&Se.math[e].replace,l=fa(o||e,t,n);if(!l)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return l},ba=function(e,t,n,o){var l=n.havingBaseStyle(t),i=U(o.concat(l.sizingClasses(n)),[e],n),s=l.sizeMultiplier/n.sizeMultiplier;return i.height*=s,i.depth*=s,i.maxFontSize=l.sizeMultiplier,i},xu=function(e,t,n){var o=t.havingBaseStyle(n),l=(1-t.sizeMultiplier/o.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=Y(l),e.height-=l,e.depth+=l},Jm=function(e,t,n,o,l,i){var s=Ze(e,"Main-Regular",l,o),u=ba(s,t,o,i);return xu(u,o,t),u},Xm=function(e,t,n,o){return Ze(e,"Size"+t+"-Regular",n,o)},Cu=function(e,t,n,o,l,i){var s=Xm(e,t,l,o),u=ba(U(["delimsizing","size"+t],[s],o),fe.TEXT,o,i);return n&&xu(u,o,fe.TEXT),u},tl=function(e,t,n){var o;t==="Size1-Regular"?o="delim-size1":o="delim-size4";var l=U(["delimsizinginner",o],[U([],[Ze(e,t,n)])]);return{type:"elem",elem:l}},rl=function(e,t,n){var o=wt["Size4-Regular"][e.charCodeAt(0)]?wt["Size4-Regular"][e.charCodeAt(0)][4]:wt["Size1-Regular"][e.charCodeAt(0)][4],l=new Jt("inner",cm(e,Math.round(1e3*t))),i=new zt([l],{width:Y(o),height:Y(t),style:"width:"+Y(o),viewBox:"0 0 "+1e3*o+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),s=Xt([],[i],n);return s.height=t,s.style.height=Y(t),s.style.width=Y(o),{type:"elem",elem:s}},Ul=.008,Ln={type:"kern",size:-1*Ul},jm=new Set(["|","\\lvert","\\rvert","\\vert"]),Qm=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),Tu=function(e,t,n,o,l,i){var s,u,d,m,h="",p=0;s=d=m=e,u=null;var v="Size1-Regular";e==="\\uparrow"?d=m="⏐":e==="\\Uparrow"?d=m="‖":e==="\\downarrow"?s=d="⏐":e==="\\Downarrow"?s=d="‖":e==="\\updownarrow"?(s="\\uparrow",d="⏐",m="\\downarrow"):e==="\\Updownarrow"?(s="\\Uparrow",d="‖",m="\\Downarrow"):jm.has(e)?(d="∣",h="vert",p=333):Qm.has(e)?(d="∥",h="doublevert",p=556):e==="["||e==="\\lbrack"?(s="⎡",d="⎢",m="⎣",v="Size4-Regular",h="lbrack",p=667):e==="]"||e==="\\rbrack"?(s="⎤",d="⎥",m="⎦",v="Size4-Regular",h="rbrack",p=667):e==="\\lfloor"||e==="⌊"?(d=s="⎢",m="⎣",v="Size4-Regular",h="lfloor",p=667):e==="\\lceil"||e==="⌈"?(s="⎡",d=m="⎢",v="Size4-Regular",h="lceil",p=667):e==="\\rfloor"||e==="⌋"?(d=s="⎥",m="⎦",v="Size4-Regular",h="rfloor",p=667):e==="\\rceil"||e==="⌉"?(s="⎤",d=m="⎥",v="Size4-Regular",h="rceil",p=667):e==="("||e==="\\lparen"?(s="⎛",d="⎜",m="⎝",v="Size4-Regular",h="lparen",p=875):e===")"||e==="\\rparen"?(s="⎞",d="⎟",m="⎠",v="Size4-Regular",h="rparen",p=875):e==="\\{"||e==="\\lbrace"?(s="⎧",u="⎨",m="⎩",d="⎪",v="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(s="⎫",u="⎬",m="⎭",d="⎪",v="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(s="⎧",m="⎩",d="⎪",v="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(s="⎫",m="⎭",d="⎪",v="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(s="⎧",m="⎭",d="⎪",v="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(s="⎫",m="⎩",d="⎪",v="Size4-Regular");var b=Yr(s,v,l),w=b.height+b.depth,k=Yr(d,v,l),T=k.height+k.depth,E=Yr(m,v,l),M=E.height+E.depth,B=0,D=1;if(u!==null){var z=Yr(u,v,l);B=z.height+z.depth,D=2}var W=w+M+B,H=Math.max(0,Math.ceil((t-W)/(D*T))),A=W+H*D*T,R=o.fontMetrics().axisHeight;n&&(R*=o.sizeMultiplier);var K=A/2-R,J=[];if(h.length>0){var te=A-w-M,Z=Math.round(A*1e3),le=dm(h,Math.round(te*1e3)),ee=new Jt(h,le),we=Y(p/1e3),pe=Y(Z/1e3),se=new zt([ee],{width:we,height:pe,viewBox:"0 0 "+p+" "+Z}),I=Xt([],[se],o);I.height=Z/1e3,I.style.width=we,I.style.height=pe,J.push({type:"elem",elem:I})}else{if(J.push(tl(m,v,l)),J.push(Ln),u===null){var P=A-w-M+2*Ul;J.push(rl(d,P,o))}else{var V=(A-w-M-B)/2+2*Ul;J.push(rl(d,V,o)),J.push(Ln),J.push(tl(u,v,l)),J.push(Ln),J.push(rl(d,V,o))}J.push(Ln),J.push(tl(s,v,l))}var q=o.havingBaseStyle(fe.TEXT),ae=xe({positionType:"bottom",positionData:K,children:J});return ba(U(["delimsizing","mult"],[ae],q),fe.TEXT,o,i)},nl=80,ol=.08,ll=function(e,t,n,o,l){var i=um(e,o,n),s=new Jt(e,i),u=new zt([s],{width:"400em",height:Y(t),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return Xt(["hide-tail"],[u],l)},Zm=function(e,t){var n=t.havingBaseSizing(),o=Bu("\\surd",e*n.sizeMultiplier,Au,n),l=n.sizeMultiplier,i=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),s,u=0,d=0,m=0,h;return o.type==="small"?(m=1e3+1e3*i+nl,e<1?l=1:e<1.4&&(l=.7),u=(1+i+ol)/l,d=(1+i)/l,s=ll("sqrtMain",u,m,i,t),s.style.minWidth="0.853em",h=.833/l):o.type==="large"?(m=(1e3+nl)*Qr[o.size],d=(Qr[o.size]+i)/l,u=(Qr[o.size]+i+ol)/l,s=ll("sqrtSize"+o.size,u,m,i,t),s.style.minWidth="1.02em",h=1/l):(u=e+i+ol,d=e+i,m=Math.floor(1e3*e+i)+nl,s=ll("sqrtTall",u,m,i,t),s.style.minWidth="0.742em",h=1.056),s.height=d,s.style.height=Y(u),{span:s,advanceWidth:h,ruleWidth:(t.fontMetrics().sqrtRuleThickness+i)*l}},Eu=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),eh=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),Su=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),Qr=[0,1.2,1.8,2.4,3],Mu=function(e,t,n,o,l){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),Eu.has(e)||Su.has(e))return Cu(e,t,!1,n,o,l);if(eh.has(e))return Tu(e,Qr[t],!1,n,o,l);throw new _("Illegal delimiter: '"+e+"'")},th=[{type:"small",style:fe.SCRIPTSCRIPT},{type:"small",style:fe.SCRIPT},{type:"small",style:fe.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],rh=[{type:"small",style:fe.SCRIPTSCRIPT},{type:"small",style:fe.SCRIPT},{type:"small",style:fe.TEXT},{type:"stack"}],Au=[{type:"small",style:fe.SCRIPTSCRIPT},{type:"small",style:fe.SCRIPT},{type:"small",style:fe.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],nh=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 t=e.type;throw new Error("Add support for delim type '"+t+"' here.")},Bu=function(e,t,n,o){for(var l=Math.min(2,3-o.style.size),i=l;i<n.length;i++){var s=n[i];if(s.type==="stack")break;var u=Yr(e,nh(s),"math"),d=u.height+u.depth;if(s.type==="small"){var m=o.havingBaseStyle(s.style);d*=m.sizeMultiplier}if(d>t)return s}return n[n.length-1]},Wl=function(e,t,n,o,l,i){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var s;Su.has(e)?s=th:Eu.has(e)?s=Au:s=rh;var u=Bu(e,t,s,o);return u.type==="small"?Jm(e,u.style,n,o,l,i):u.type==="large"?Cu(e,u.size,n,o,l,i):Tu(e,t,n,o,l,i)},al=function(e,t,n,o,l,i){var s=o.fontMetrics().axisHeight*o.sizeMultiplier,u=901,d=5/o.fontMetrics().ptPerEm,m=Math.max(t-s,n+s),h=Math.max(m/500*u,2*m-d);return Wl(e,h,!0,o,l,i)},Y0={"\\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}},oh=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 Co(r,e){var t=ko(r);if(t&&oh.has(t.text))return t;throw t?new _("Invalid delimiter '"+t.text+"' after '"+e.funcName+"'",r):new _("Invalid delimiter type '"+r.type+"'",r)}j({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(r,e)=>{var t=Co(e[0],r);return{type:"delimsizing",mode:r.parser.mode,size:Y0[r.funcName].size,mclass:Y0[r.funcName].mclass,delim:t.text}},htmlBuilder:(r,e)=>r.delim==="."?U([r.mclass]):Mu(r.delim,r.size,e,r.mode,[r.mclass]),mathmlBuilder:r=>{var e=[];r.delim!=="."&&e.push(pt(r.delim,r.mode));var t=new G("mo",e);r.mclass==="mopen"||r.mclass==="mclose"?t.setAttribute("fence","true"):t.setAttribute("fence","false"),t.setAttribute("stretchy","true");var n=Y(Qr[r.size]);return t.setAttribute("minsize",n),t.setAttribute("maxsize",n),t}});function J0(r){if(!r.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}j({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var t=r.parser.gullet.macros.get("\\current@color");if(t&&typeof t!="string")throw new _("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:r.parser.mode,delim:Co(e[0],r).text,color:t}}});j({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var t=Co(e[0],r),n=r.parser;++n.leftrightDepth;var o=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var l=he(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:o,left:t.text,right:l.delim,rightColor:l.color}},htmlBuilder:(r,e)=>{J0(r);for(var t=Ge(r.body,e,!0,["mopen","mclose"]),n=0,o=0,l=!1,i=0;i<t.length;i++)t[i].isMiddle?l=!0:(n=Math.max(t[i].height,n),o=Math.max(t[i].depth,o));n*=e.sizeMultiplier,o*=e.sizeMultiplier;var s;if(r.left==="."?s=sn(e,["mopen"]):s=al(r.left,n,o,e,r.mode,["mopen"]),t.unshift(s),l)for(var u=1;u<t.length;u++){var d=t[u],m=d.isMiddle;m&&(t[u]=al(m.delim,n,o,m.options,r.mode,[]))}var h;if(r.right===".")h=sn(e,["mclose"]);else{var p=r.rightColor?e.withColor(r.rightColor):e;h=al(r.right,n,o,p,r.mode,["mclose"])}return t.push(h),U(["minner"],t,e)},mathmlBuilder:(r,e)=>{J0(r);var t=dt(r.body,e);if(r.left!=="."){var n=new G("mo",[pt(r.left,r.mode)]);n.setAttribute("fence","true"),t.unshift(n)}if(r.right!=="."){var o=new G("mo",[pt(r.right,r.mode)]);o.setAttribute("fence","true"),r.rightColor&&o.setAttribute("mathcolor",r.rightColor),t.push(o)}return pa(t)}});j({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var t=Co(e[0],r);if(!r.parser.leftrightDepth)throw new _("\\middle without preceding \\left",t);return{type:"middle",mode:r.parser.mode,delim:t.text}},htmlBuilder:(r,e)=>{var t;if(r.delim===".")t=sn(e,[]);else{t=Mu(r.delim,1,e,r.mode,[]);var n={delim:r.delim,options:e};t.isMiddle=n}return t},mathmlBuilder:(r,e)=>{var t=r.delim==="\\vert"||r.delim==="|"?pt("|","text"):pt(r.delim,r.mode),n=new G("mo",[t]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n}});var To=(r,e)=>{var t=Pr(Ce(r.body,e),e),n=r.label.slice(1),o=e.sizeMultiplier,l,i=0,s=Ot(r.body);if(n==="sout")l=U(["stretchy","sout"]),l.height=e.fontMetrics().defaultRuleThickness/o,i=-.5*e.fontMetrics().xHeight;else if(n==="phase"){var u=Ie({number:.6,unit:"pt"},e),d=Ie({number:.35,unit:"ex"},e),m=e.havingBaseSizing();o=o/m.sizeMultiplier;var h=t.height+t.depth+u+d;t.style.paddingLeft=Y(h/2+u);var p=Math.floor(1e3*h*o),v=im(p),b=new zt([new Jt("phase",v)],{width:"400em",height:Y(p/1e3),viewBox:"0 0 400000 "+p,preserveAspectRatio:"xMinYMin slice"});l=Xt(["hide-tail"],[b],e),l.style.height=Y(h),i=t.depth+u+d}else{/cancel/.test(n)?s||t.classes.push("cancel-pad"):n==="angl"?t.classes.push("anglpad"):t.classes.push("boxpad");var w=0,k=0,T=0;/box/.test(n)?(T=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),w=e.fontMetrics().fboxsep+(n==="colorbox"?0:T),k=w):n==="angl"?(T=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),w=4*T,k=Math.max(0,.25-t.depth)):(w=s?.2:0,k=w),l=qm(t,n,w,k,e),/fbox|boxed|fcolorbox/.test(n)?(l.style.borderStyle="solid",l.style.borderWidth=Y(T)):n==="angl"&&T!==.049&&(l.style.borderTopWidth=Y(T),l.style.borderRightWidth=Y(T)),i=t.depth+k,r.backgroundColor&&(l.style.backgroundColor=r.backgroundColor,r.borderColor&&(l.style.borderColor=r.borderColor))}var E;if(r.backgroundColor)E=xe({positionType:"individualShift",children:[{type:"elem",elem:l,shift:i},{type:"elem",elem:t,shift:0}]});else{var M=/cancel|phase/.test(n)?["svg-align"]:[];E=xe({positionType:"individualShift",children:[{type:"elem",elem:t,shift:0},{type:"elem",elem:l,shift:i,wrapperClasses:M}]})}return/cancel/.test(n)&&(E.height=t.height,E.depth=t.depth),/cancel/.test(n)&&!s?U(["mord","cancel-lap"],[E],e):U(["mord"],[E],e)},Eo=(r,e)=>{var t=0,n=new G(r.label.includes("colorbox")?"mpadded":"menclose",[Ee(r.body,e)]);switch(r.label){case"\\cancel":n.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":n.setAttribute("notation","downdiagonalstrike");break;case"\\phase":n.setAttribute("notation","phasorangle");break;case"\\sout":n.setAttribute("notation","horizontalstrike");break;case"\\fbox":n.setAttribute("notation","box");break;case"\\angl":n.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(t=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,n.setAttribute("width","+"+2*t+"pt"),n.setAttribute("height","+"+2*t+"pt"),n.setAttribute("lspace",t+"pt"),n.setAttribute("voffset",t+"pt"),r.label==="\\fcolorbox"){var o=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);n.setAttribute("style","border: "+Y(o)+" solid "+r.borderColor)}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return r.backgroundColor&&n.setAttribute("mathbackground",r.backgroundColor),n};j({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(r,e,t){var{parser:n,funcName:o}=r,l=he(e[0],"color-token").color,i=e[1];return{type:"enclose",mode:n.mode,label:o,backgroundColor:l,body:i}},htmlBuilder:To,mathmlBuilder:Eo});j({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(r,e,t){var{parser:n,funcName:o}=r,l=he(e[0],"color-token").color,i=he(e[1],"color-token").color,s=e[2];return{type:"enclose",mode:n.mode,label:o,backgroundColor:i,borderColor:l,body:s}},htmlBuilder:To,mathmlBuilder:Eo});j({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(r,e){var{parser:t}=r;return{type:"enclose",mode:t.mode,label:"\\fbox",body:e[0]}}});j({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(r,e){var{parser:t,funcName:n}=r,o=e[0];return{type:"enclose",mode:t.mode,label:n,body:o}},htmlBuilder:To,mathmlBuilder:Eo});j({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(r,e){var{parser:t,funcName:n}=r;t.mode==="math"&&t.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var o=e[0];return{type:"enclose",mode:t.mode,label:n,body:o}},htmlBuilder:To,mathmlBuilder:Eo});j({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(r,e){var{parser:t}=r;return{type:"enclose",mode:t.mode,label:"\\angl",body:e[0]}}});var Nu={};function Ct(r){for(var{type:e,names:t,props:n,handler:o,htmlBuilder:l,mathmlBuilder:i}=r,s={type:e,numArgs:n.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:o},u=0;u<t.length;++u)Nu[t[u]]=s;l&&(Zn[e]=l),i&&(eo[e]=i)}var Lu={};function y(r,e){Lu[r]=e}class nt{constructor(e,t,n){this.lexer=e,this.start=t,this.end=n}static range(e,t){return t?!e||!e.loc||!t.loc||e.loc.lexer!==t.loc.lexer?null:new nt(e.loc.lexer,e.loc.start,t.loc.end):e&&e.loc}}class it{constructor(e,t){this.text=e,this.loc=t}range(e,t){return new it(t,nt.range(this,e))}}function X0(r){var e=[];r.consumeSpaces();var t=r.fetch().text;for(t==="\\relax"&&(r.consume(),r.consumeSpaces(),t=r.fetch().text);t==="\\hline"||t==="\\hdashline";)r.consume(),e.push(t==="\\hdashline"),r.consumeSpaces(),t=r.fetch().text;return e}var So=r=>{var e=r.parser.settings;if(!e.displayMode)throw new _("{"+r.envName+"} can be used only in display mode.")},lh=new Set(["gather","gather*"]);function ya(r){if(!r.includes("ed"))return!r.includes("*")}function Zt(r,e,t){var{hskipBeforeAndAfter:n,addJot:o,cols:l,arraystretch:i,colSeparationType:s,autoTag:u,singleRow:d,emptySingleRow:m,maxNumCols:h,leqno:p}=e;if(r.gullet.beginGroup(),d||r.gullet.macros.set("\\cr","\\\\\\relax"),!i){var v=r.gullet.expandMacroAsText("\\arraystretch");if(v==null)i=1;else if(i=parseFloat(v),!i||i<0)throw new _("Invalid \\arraystretch: "+v)}r.gullet.beginGroup();var b=[],w=[b],k=[],T=[],E=u!=null?[]:void 0;function M(){u&&r.gullet.macros.set("\\@eqnsw","1",!0)}function B(){E&&(r.gullet.macros.get("\\df@tag")?(E.push(r.subparse([new it("\\df@tag")])),r.gullet.macros.set("\\df@tag",void 0,!0)):E.push(!!u&&r.gullet.macros.get("\\@eqnsw")==="1"))}for(M(),T.push(X0(r));;){var D=r.parseExpression(!1,d?"\\end":"\\\\");r.gullet.endGroup(),r.gullet.beginGroup();var z={type:"ordgroup",mode:r.mode,body:D};t&&(z={type:"styling",mode:r.mode,style:t,body:[z]}),b.push(z);var W=r.fetch().text;if(W==="&"){if(h&&b.length===h){if(d||s)throw new _("Too many tab characters: &",r.nextToken);r.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}r.consume()}else if(W==="\\end"){B(),b.length===1&&z.type==="styling"&&z.body.length===1&&z.body[0].type==="ordgroup"&&z.body[0].body.length===0&&(w.length>1||!m)&&w.pop(),T.length<w.length+1&&T.push([]);break}else if(W==="\\\\"){r.consume();var H=void 0;r.gullet.future().text!==" "&&(H=r.parseSizeGroup(!0)),k.push(H?H.value:null),B(),T.push(X0(r)),b=[],w.push(b),M()}else throw new _("Expected & or \\\\ or \\cr or \\end",r.nextToken)}return r.gullet.endGroup(),r.gullet.endGroup(),{type:"array",mode:r.mode,addJot:o,arraystretch:i,body:w,cols:l,rowGaps:k,hskipBeforeAndAfter:n,hLinesBeforeRow:T,colSeparationType:s,tags:E,leqno:p}}function wa(r){return r.slice(0,1)==="d"?"display":"text"}var Tt=function(e,t){var n,o,l=e.body.length,i=e.hLinesBeforeRow,s=0,u=new Array(l),d=[],m=Math.max(t.fontMetrics().arrayRuleWidth,t.minRuleThickness),h=1/t.fontMetrics().ptPerEm,p=5*h;if(e.colSeparationType&&e.colSeparationType==="small"){var v=t.havingStyle(fe.SCRIPT).sizeMultiplier;p=.2778*(v/t.sizeMultiplier)}var b=e.colSeparationType==="CD"?Ie({number:3,unit:"ex"},t):12*h,w=3*h,k=e.arraystretch*b,T=.7*k,E=.3*k,M=0;function B(yr){for(var wr=0;wr<yr.length;++wr)wr>0&&(M+=.25),d.push({pos:M,isDashed:yr[wr]})}for(B(i[0]),n=0;n<e.body.length;++n){var D=e.body[n],z=T,W=E;s<D.length&&(s=D.length);var H=new Array(D.length);for(o=0;o<D.length;++o){var A=Ce(D[o],t);W<A.depth&&(W=A.depth),z<A.height&&(z=A.height),H[o]=A}var R=e.rowGaps[n],K=0;R&&(K=Ie(R,t),K>0&&(K+=E,W<K&&(W=K),K=0)),e.addJot&&n<e.body.length-1&&(W+=w),H.height=z,H.depth=W,M+=z,H.pos=M,M+=W+K,u[n]=H,B(i[n+1])}var J=M/2+t.fontMetrics().axisHeight,te=e.cols||[],Z=[],le,ee,we=[];if(e.tags&&e.tags.some(yr=>yr))for(n=0;n<l;++n){var pe=u[n],se=pe.pos-J,I=e.tags[n],P=void 0;I===!0?P=U(["eqn-num"],[],t):I===!1?P=U([],[],t):P=U([],Ge(I,t,!0),t),P.depth=pe.depth,P.height=pe.height,we.push({type:"elem",elem:P,shift:se})}for(o=0,ee=0;o<s||ee<te.length;++o,++ee){for(var V,q=te[ee],ae=!0;((ge=q)==null?void 0:ge.type)==="separator";){var ge;if(ae||(le=U(["arraycolsep"],[]),le.style.width=Y(t.fontMetrics().doubleRuleSep),Z.push(le)),q.separator==="|"||q.separator===":"){var ne=q.separator==="|"?"solid":"dashed",N=U(["vertical-separator"],[],t);N.style.height=Y(M),N.style.borderRightWidth=Y(m),N.style.borderRightStyle=ne,N.style.margin="0 "+Y(-m/2);var O=M-J;O&&(N.style.verticalAlign=Y(-O)),Z.push(N)}else throw new _("Invalid separator type: "+q.separator);ee++,q=te[ee],ae=!1}if(!(o>=s)){var $=void 0;if(o>0||e.hskipBeforeAndAfter){var X,oe;$=(X=(oe=q)==null?void 0:oe.pregap)!=null?X:p,$!==0&&(le=U(["arraycolsep"],[]),le.style.width=Y($),Z.push(le))}var ve=[];for(n=0;n<l;++n){var Be=u[n],$e=Be[o];if($e){var ot=Be.pos-J;$e.depth=Be.depth,$e.height=Be.height,ve.push({type:"elem",elem:$e,shift:ot})}}var Xe=xe({positionType:"individualShift",children:ve}),ue=U(["col-align-"+(((V=q)==null?void 0:V.align)||"c")],[Xe]);if(Z.push(ue),o<s-1||e.hskipBeforeAndAfter){var me,Re;$=(me=(Re=q)==null?void 0:Re.postgap)!=null?me:p,$!==0&&(le=U(["arraycolsep"],[]),le.style.width=Y($),Z.push(le))}}}var Ke=U(["mtable"],Z);if(d.length>0){for(var St=Rr("hline",t,m),Ht=Rr("hdashline",t,m),Mt=[{type:"elem",elem:Ke,shift:0}];d.length>0;){var br=d.pop(),vn=br.pos-J;br.isDashed?Mt.push({type:"elem",elem:Ht,shift:vn}):Mt.push({type:"elem",elem:St,shift:vn})}Ke=xe({positionType:"individualShift",children:Mt})}if(we.length===0)return U(["mord"],[Ke],t);var Lo=xe({positionType:"individualShift",children:we}),Wr=U(["tag"],[Lo],t);return Pt([Ke,Wr])},ah={c:"center ",l:"left ",r:"right "},Et=function(e,t){for(var n=[],o=new G("mtd",[],["mtr-glue"]),l=new G("mtd",[],["mml-eqn-num"]),i=0;i<e.body.length;i++){for(var s=e.body[i],u=[],d=0;d<s.length;d++)u.push(new G("mtd",[Ee(s[d],t)]));e.tags&&e.tags[i]&&(u.unshift(o),u.push(o),e.leqno?u.unshift(l):u.push(l)),n.push(new G("mtr",u))}var m=new G("mtable",n),h=e.arraystretch===.5?.1:.16+e.arraystretch-1+(e.addJot?.09:0);m.setAttribute("rowspacing",Y(h));var p="",v="";if(e.cols&&e.cols.length>0){var b=e.cols,w="",k=!1,T=0,E=b.length;b[0].type==="separator"&&(p+="top ",T=1),b[b.length-1].type==="separator"&&(p+="bottom ",E-=1);for(var M=T;M<E;M++){var B=b[M];B.type==="align"?(v+=ah[B.align],k&&(w+="none "),k=!0):B.type==="separator"&&k&&(w+=B.separator==="|"?"solid ":"dashed ",k=!1)}m.setAttribute("columnalign",v.trim()),/[sd]/.test(w)&&m.setAttribute("columnlines",w.trim())}if(e.colSeparationType==="align"){for(var D=e.cols||[],z="",W=1;W<D.length;W++)z+=W%2?"0em ":"1em ";m.setAttribute("columnspacing",z.trim())}else e.colSeparationType==="alignat"||e.colSeparationType==="gather"?m.setAttribute("columnspacing","0em"):e.colSeparationType==="small"?m.setAttribute("columnspacing","0.2778em"):e.colSeparationType==="CD"?m.setAttribute("columnspacing","0.5em"):m.setAttribute("columnspacing","1em");var H="",A=e.hLinesBeforeRow;p+=A[0].length>0?"left ":"",p+=A[A.length-1].length>0?"right ":"";for(var R=1;R<A.length-1;R++)H+=A[R].length===0?"none ":A[R][0]?"dashed ":"solid ";return/[sd]/.test(H)&&m.setAttribute("rowlines",H.trim()),p!==""&&(m=new G("menclose",[m]),m.setAttribute("notation",p.trim())),e.arraystretch&&e.arraystretch<1&&(m=new G("mstyle",[m]),m.setAttribute("scriptlevel","1")),m},Iu=function(e,t){e.envName.includes("ed")||So(e);var n=[],o=e.envName.includes("at")?"alignat":"align",l=e.envName==="split",i=Zt(e.parser,{cols:n,addJot:!0,autoTag:l?void 0:ya(e.envName),emptySingleRow:!0,colSeparationType:o,maxNumCols:l?2:void 0,leqno:e.parser.settings.leqno},"display"),s=0,u=0,d={type:"ordgroup",mode:e.mode,body:[]};if(t[0]&&t[0].type==="ordgroup"){for(var m="",h=0;h<t[0].body.length;h++){var p=he(t[0].body[h],"textord");m+=p.text}s=Number(m),u=s*2}var v=!u;i.body.forEach(function(T){for(var E=1;E<T.length;E+=2){var M=he(T[E],"styling"),B=he(M.body[0],"ordgroup");B.body.unshift(d)}if(v)u<T.length&&(u=T.length);else{var D=T.length/2;if(s<D)throw new _("Too many math in a row: "+("expected "+s+", but got "+D),T[0])}});for(var b=0;b<u;++b){var w="r",k=0;b%2===1?w="l":b>0&&v&&(k=1),n[b]={type:"align",align:w,pregap:k,postgap:0}}return i.colSeparationType=v?"align":"alignat",i};Ct({type:"array",names:["array","darray"],props:{numArgs:1},handler(r,e){var t=ko(e[0]),n=t?[e[0]]:he(e[0],"ordgroup").body,o=n.map(function(i){var s=wo(i),u=s.text;if("lcr".includes(u))return{type:"align",align:u};if(u==="|")return{type:"separator",separator:"|"};if(u===":")return{type:"separator",separator:":"};throw new _("Unknown column alignment: "+u,i)}),l={cols:o,hskipBeforeAndAfter:!0,maxNumCols:o.length};return Zt(r.parser,l,wa(r.envName))},htmlBuilder:Tt,mathmlBuilder:Et});Ct({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(r){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[r.envName.replace("*","")],t="c",n={hskipBeforeAndAfter:!1,cols:[{type:"align",align:t}]};if(r.envName.charAt(r.envName.length-1)==="*"){var o=r.parser;if(o.consumeSpaces(),o.fetch().text==="["){if(o.consume(),o.consumeSpaces(),t=o.fetch().text,!"lcr".includes(t))throw new _("Expected l or c or r",o.nextToken);o.consume(),o.consumeSpaces(),o.expect("]"),o.consume(),n.cols=[{type:"align",align:t}]}}var l=Zt(r.parser,n,wa(r.envName)),i=Math.max(0,...l.body.map(s=>s.length));return l.cols=new Array(i).fill({type:"align",align:t}),e?{type:"leftright",mode:r.mode,body:[l],left:e[0],right:e[1],rightColor:void 0}:l},htmlBuilder:Tt,mathmlBuilder:Et});Ct({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(r){var e={arraystretch:.5},t=Zt(r.parser,e,"script");return t.colSeparationType="small",t},htmlBuilder:Tt,mathmlBuilder:Et});Ct({type:"array",names:["subarray"],props:{numArgs:1},handler(r,e){var t=ko(e[0]),n=t?[e[0]]:he(e[0],"ordgroup").body,o=n.map(function(s){var u=wo(s),d=u.text;if("lc".includes(d))return{type:"align",align:d};throw new _("Unknown column alignment: "+d,s)});if(o.length>1)throw new _("{subarray} can contain only one column");var l={cols:o,hskipBeforeAndAfter:!1,arraystretch:.5},i=Zt(r.parser,l,"script");if(i.body.length>0&&i.body[0].length>1)throw new _("{subarray} can contain only one column");return i},htmlBuilder:Tt,mathmlBuilder:Et});Ct({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(r){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},t=Zt(r.parser,e,wa(r.envName));return{type:"leftright",mode:r.mode,body:[t],left:r.envName.includes("r")?".":"\\{",right:r.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:Tt,mathmlBuilder:Et});Ct({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:Iu,htmlBuilder:Tt,mathmlBuilder:Et});Ct({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(r){lh.has(r.envName)&&So(r);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:ya(r.envName),emptySingleRow:!0,leqno:r.parser.settings.leqno};return Zt(r.parser,e,"display")},htmlBuilder:Tt,mathmlBuilder:Et});Ct({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:Iu,htmlBuilder:Tt,mathmlBuilder:Et});Ct({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(r){So(r);var e={autoTag:ya(r.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:r.parser.settings.leqno};return Zt(r.parser,e,"display")},htmlBuilder:Tt,mathmlBuilder:Et});Ct({type:"array",names:["CD"],props:{numArgs:0},handler(r){return So(r),Km(r.parser)},htmlBuilder:Tt,mathmlBuilder:Et});y("\\nonumber","\\gdef\\@eqnsw{0}");y("\\notag","\\nonumber");j({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(r,e){throw new _(r.funcName+" valid only within array environment")}});var j0=Nu;j({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(r,e){var{parser:t,funcName:n}=r,o=e[0];if(o.type!=="ordgroup")throw new _("Invalid environment name",o);for(var l="",i=0;i<o.body.length;++i)l+=he(o.body[i],"textord").text;if(n==="\\begin"){if(!j0.hasOwnProperty(l))throw new _("No such environment: "+l,o);var s=j0[l],{args:u,optArgs:d}=t.parseArguments("\\begin{"+l+"}",s),m={mode:t.mode,envName:l,parser:t},h=s.handler(m,u,d);t.expect("\\end",!1);var p=t.nextToken,v=he(t.parseFunction(),"environment");if(v.name!==l)throw new _("Mismatch: \\begin{"+l+"} matched by \\end{"+v.name+"}",p);return h}return{type:"environment",mode:t.mode,name:l,nameGroup:o}}});var zu=(r,e)=>{var t=r.font,n=e.withFont(t);return Ce(r.body,n)},Du=(r,e)=>{var t=r.font,n=e.withFont(t);return Ee(r.body,n)},Q0={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};j({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(r,e)=>{var{parser:t,funcName:n}=r,o=to(e[0]),l=n;return l in Q0&&(l=Q0[l]),{type:"font",mode:t.mode,font:l.slice(1),body:o}},htmlBuilder:zu,mathmlBuilder:Du});j({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(r,e)=>{var{parser:t}=r,n=e[0];return{type:"mclass",mode:t.mode,mclass:xo(n),body:[{type:"font",mode:t.mode,font:"boldsymbol",body:n}],isCharacterBox:Ot(n)}}});j({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(r,e)=>{var{parser:t,funcName:n,breakOnTokenText:o}=r,{mode:l}=t,i=t.parseExpression(!0,o),s="math"+n.slice(1);return{type:"font",mode:l,font:s,body:{type:"ordgroup",mode:t.mode,body:i}}},htmlBuilder:zu,mathmlBuilder:Du});var ih=(r,e)=>{var t=e.style,n=t.fracNum(),o=t.fracDen(),l;l=e.havingStyle(n);var i=Ce(r.numer,l,e);if(r.continued){var s=8.5/e.fontMetrics().ptPerEm,u=3.5/e.fontMetrics().ptPerEm;i.height=i.height<s?s:i.height,i.depth=i.depth<u?u:i.depth}l=e.havingStyle(o);var d=Ce(r.denom,l,e),m,h,p;r.hasBarLine?(r.barSize?(h=Ie(r.barSize,e),m=Rr("frac-line",e,h)):m=Rr("frac-line",e),h=m.height,p=m.height):(m=null,h=0,p=e.fontMetrics().defaultRuleThickness);var v,b,w;t.size===fe.DISPLAY.size?(v=e.fontMetrics().num1,h>0?b=3*p:b=7*p,w=e.fontMetrics().denom1):(h>0?(v=e.fontMetrics().num2,b=p):(v=e.fontMetrics().num3,b=3*p),w=e.fontMetrics().denom2);var k;if(m){var E=e.fontMetrics().axisHeight;v-i.depth-(E+.5*h)<b&&(v+=b-(v-i.depth-(E+.5*h))),E-.5*h-(d.height-w)<b&&(w+=b-(E-.5*h-(d.height-w)));var M=-(E-.5*h);k=xe({positionType:"individualShift",children:[{type:"elem",elem:d,shift:w},{type:"elem",elem:m,shift:M},{type:"elem",elem:i,shift:-v}]})}else{var T=v-i.depth-(d.height-w);T<b&&(v+=.5*(b-T),w+=.5*(b-T)),k=xe({positionType:"individualShift",children:[{type:"elem",elem:d,shift:w},{type:"elem",elem:i,shift:-v}]})}l=e.havingStyle(t),k.height*=l.sizeMultiplier/e.sizeMultiplier,k.depth*=l.sizeMultiplier/e.sizeMultiplier;var B;t.size===fe.DISPLAY.size?B=e.fontMetrics().delim1:t.size===fe.SCRIPTSCRIPT.size?B=e.havingStyle(fe.SCRIPT).fontMetrics().delim2:B=e.fontMetrics().delim2;var D,z;return r.leftDelim==null?D=sn(e,["mopen"]):D=Wl(r.leftDelim,B,!0,e.havingStyle(t),r.mode,["mopen"]),r.continued?z=U([]):r.rightDelim==null?z=sn(e,["mclose"]):z=Wl(r.rightDelim,B,!0,e.havingStyle(t),r.mode,["mclose"]),U(["mord"].concat(l.sizingClasses(e)),[D,U(["mfrac"],[k]),z],e)},sh=(r,e)=>{var t=new G("mfrac",[Ee(r.numer,e),Ee(r.denom,e)]);if(!r.hasBarLine)t.setAttribute("linethickness","0px");else if(r.barSize){var n=Ie(r.barSize,e);t.setAttribute("linethickness",Y(n))}if(r.leftDelim!=null||r.rightDelim!=null){var o=[];if(r.leftDelim!=null){var l=new G("mo",[new Ve(r.leftDelim.replace("\\",""))]);l.setAttribute("fence","true"),o.push(l)}if(o.push(t),r.rightDelim!=null){var i=new G("mo",[new Ve(r.rightDelim.replace("\\",""))]);i.setAttribute("fence","true"),o.push(i)}return pa(o)}return t},Ou=(r,e)=>{if(!e)return r;var t={type:"styling",mode:r.mode,style:e,body:[r]};return t};j({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(r,e)=>{var{parser:t,funcName:n}=r,o=e[0],l=e[1],i,s=null,u=null;switch(n){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":i=!0;break;case"\\\\atopfrac":i=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":i=!1,s="(",u=")";break;case"\\\\bracefrac":i=!1,s="\\{",u="\\}";break;case"\\\\brackfrac":i=!1,s="[",u="]";break;default:throw new Error("Unrecognized genfrac command")}var d=n==="\\cfrac",m=null;return d||n.startsWith("\\d")?m="display":n.startsWith("\\t")&&(m="text"),Ou({type:"genfrac",mode:t.mode,numer:o,denom:l,continued:d,hasBarLine:i,leftDelim:s,rightDelim:u,barSize:null},m)},htmlBuilder:ih,mathmlBuilder:sh});j({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(r){var{parser:e,funcName:t,token:n}=r,o;switch(t){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:n}}});var Z0=["display","text","script","scriptscript"],ei=function(e){var t=null;return e.length>0&&(t=e,t=t==="."?null:t),t};j({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(r,e){var{parser:t}=r,n=e[4],o=e[5],l=to(e[0]),i=l.type==="atom"&&l.family==="open"?ei(l.text):null,s=to(e[1]),u=s.type==="atom"&&s.family==="close"?ei(s.text):null,d=he(e[2],"size"),m,h=null;d.isBlank?m=!0:(h=d.value,m=h.number>0);var p=null,v=e[3];if(v.type==="ordgroup"){if(v.body.length>0){var b=he(v.body[0],"textord");p=Z0[Number(b.text)]}}else v=he(v,"textord"),p=Z0[Number(v.text)];return Ou({type:"genfrac",mode:t.mode,numer:n,denom:o,continued:!1,hasBarLine:m,barSize:h,leftDelim:i,rightDelim:u},p)}});j({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(r,e){var{parser:t,funcName:n,token:o}=r;return{type:"infix",mode:t.mode,replaceWith:"\\\\abovefrac",size:he(e[0],"size").value,token:o}}});j({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(r,e)=>{var{parser:t,funcName:n}=r,o=e[0],l=he(e[1],"infix").size;if(!l)throw new Error("\\\\abovefrac expected size, but got "+String(l));var i=e[2],s=l.number>0;return{type:"genfrac",mode:t.mode,numer:o,denom:i,continued:!1,hasBarLine:s,barSize:l,leftDelim:null,rightDelim:null}}});var Ru=(r,e)=>{var t=e.style,n,o;r.type==="supsub"?(n=r.sup?Ce(r.sup,e.havingStyle(t.sup()),e):Ce(r.sub,e.havingStyle(t.sub()),e),o=he(r.base,"horizBrace")):o=he(r,"horizBrace");var l=Ce(o.base,e.havingBaseStyle(fe.DISPLAY)),i=yo(o,e),s;if(o.isOver?(s=xe({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.1},{type:"elem",elem:i}]}),s.children[0].children[0].children[1].classes.push("svg-align")):(s=xe({positionType:"bottom",positionData:l.depth+.1+i.height,children:[{type:"elem",elem:i},{type:"kern",size:.1},{type:"elem",elem:l}]}),s.children[0].children[0].children[0].classes.push("svg-align")),n){var u=U(["minner",o.isOver?"mover":"munder"],[s],e);o.isOver?s=xe({positionType:"firstBaseline",children:[{type:"elem",elem:u},{type:"kern",size:.2},{type:"elem",elem:n}]}):s=xe({positionType:"bottom",positionData:u.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:u}]})}return U(["minner",o.isOver?"mover":"munder"],[s],e)},uh=(r,e)=>{var t=bo(r.label);return new G(r.isOver?"mover":"munder",[Ee(r.base,e),t])};j({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(r,e){var{parser:t,funcName:n}=r;return{type:"horizBrace",mode:t.mode,label:n,isOver:n.includes("\\over"),base:e[0]}},htmlBuilder:Ru,mathmlBuilder:uh});j({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,n=e[1],o=he(e[0],"url").url;return t.settings.isTrusted({command:"\\href",url:o})?{type:"href",mode:t.mode,href:o,body:He(n)}:t.formatUnsupportedCmd("\\href")},htmlBuilder:(r,e)=>{var t=Ge(r.body,e,!1);return Sm(r.href,[],t,e)},mathmlBuilder:(r,e)=>{var t=jt(r.body,e);return t instanceof G||(t=new G("mrow",[t])),t.setAttribute("href",r.href),t}});j({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,n=he(e[0],"url").url;if(!t.settings.isTrusted({command:"\\url",url:n}))return t.formatUnsupportedCmd("\\url");for(var o=[],l=0;l<n.length;l++){var i=n[l];i==="~"&&(i="\\textasciitilde"),o.push({type:"textord",mode:"text",text:i})}var s={type:"text",mode:t.mode,font:"\\texttt",body:o};return{type:"href",mode:t.mode,href:n,body:He(s)}}});j({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler(r,e){var{parser:t}=r;return{type:"hbox",mode:t.mode,body:He(e[0])}},htmlBuilder(r,e){var t=Ge(r.body,e,!1);return Pt(t)},mathmlBuilder(r,e){return new G("mrow",dt(r.body,e))}});j({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(r,e)=>{var{parser:t,funcName:n,token:o}=r,l=he(e[0],"raw").string,i=e[1];t.settings.strict&&t.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var s,u={};switch(n){case"\\htmlClass":u.class=l,s={command:"\\htmlClass",class:l};break;case"\\htmlId":u.id=l,s={command:"\\htmlId",id:l};break;case"\\htmlStyle":u.style=l,s={command:"\\htmlStyle",style:l};break;case"\\htmlData":{for(var d=l.split(","),m=0;m<d.length;m++){var h=d[m],p=h.indexOf("=");if(p<0)throw new _("\\htmlData key/value '"+h+"' missing equals sign");var v=h.slice(0,p),b=h.slice(p+1);u["data-"+v.trim()]=b}s={command:"\\htmlData",attributes:u};break}default:throw new Error("Unrecognized html command")}return t.settings.isTrusted(s)?{type:"html",mode:t.mode,attributes:u,body:He(i)}:t.formatUnsupportedCmd(n)},htmlBuilder:(r,e)=>{var t=Ge(r.body,e,!1),n=["enclosing"];r.attributes.class&&n.push(...r.attributes.class.trim().split(/\s+/));var o=U(n,t,e);for(var l in r.attributes)l!=="class"&&r.attributes.hasOwnProperty(l)&&o.setAttribute(l,r.attributes[l]);return o},mathmlBuilder:(r,e)=>jt(r.body,e)});j({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r;return{type:"htmlmathml",mode:t.mode,html:He(e[0]),mathml:He(e[1])}},htmlBuilder:(r,e)=>{var t=Ge(r.html,e,!1);return Pt(t)},mathmlBuilder:(r,e)=>jt(r.mathml,e)});var il=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new _("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(t[1]+t[2]),unit:t[3]};if(!Zs(n))throw new _("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};j({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(r,e,t)=>{var{parser:n}=r,o={number:0,unit:"em"},l={number:.9,unit:"em"},i={number:0,unit:"em"},s="";if(t[0])for(var u=he(t[0],"raw").string,d=u.split(","),m=0;m<d.length;m++){var h=d[m].split("=");if(h.length===2){var p=h[1].trim();switch(h[0].trim()){case"alt":s=p;break;case"width":o=il(p);break;case"height":l=il(p);break;case"totalheight":i=il(p);break;default:throw new _("Invalid key: '"+h[0]+"' in \\includegraphics.")}}}var v=he(e[0],"url").url;return s===""&&(s=v,s=s.replace(/^.*[\\/]/,""),s=s.substring(0,s.lastIndexOf("."))),n.settings.isTrusted({command:"\\includegraphics",url:v})?{type:"includegraphics",mode:n.mode,alt:s,width:o,height:l,totalheight:i,src:v}:n.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(r,e)=>{var t=Ie(r.height,e),n=0;r.totalheight.number>0&&(n=Ie(r.totalheight,e)-t);var o=0;r.width.number>0&&(o=Ie(r.width,e));var l={height:Y(t+n)};o>0&&(l.width=Y(o)),n>0&&(l.verticalAlign=Y(-n));var i=new hm(r.src,r.alt,l);return i.height=t,i.depth=n,i},mathmlBuilder:(r,e)=>{var t=new G("mglyph",[]);t.setAttribute("alt",r.alt);var n=Ie(r.height,e),o=0;if(r.totalheight.number>0&&(o=Ie(r.totalheight,e)-n,t.setAttribute("valign",Y(-o))),t.setAttribute("height",Y(n+o)),r.width.number>0){var l=Ie(r.width,e);t.setAttribute("width",Y(l))}return t.setAttribute("src",r.src),t}});j({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(r,e){var{parser:t,funcName:n}=r,o=he(e[0],"size");if(t.settings.strict){var l=n[1]==="m",i=o.value.unit==="mu";l?(i||t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" supports only mu units, "+("not "+o.value.unit+" units")),t.mode!=="math"&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" works only in math mode")):i&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" doesn't support mu units")}return{type:"kern",mode:t.mode,dimension:o.value}},htmlBuilder(r,e){return lu(r.dimension,e)},mathmlBuilder(r,e){var t=Ie(r.dimension,e);return new du(t)}});j({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t,funcName:n}=r,o=e[0];return{type:"lap",mode:t.mode,alignment:n.slice(5),body:o}},htmlBuilder:(r,e)=>{var t;r.alignment==="clap"?(t=U([],[Ce(r.body,e)]),t=U(["inner"],[t],e)):t=U(["inner"],[Ce(r.body,e)]);var n=U(["fix"],[]),o=U([r.alignment],[t,n],e),l=U(["strut"]);return l.style.height=Y(o.height+o.depth),o.depth&&(l.style.verticalAlign=Y(-o.depth)),o.children.unshift(l),o=U(["thinbox"],[o],e),U(["mord","vbox"],[o],e)},mathmlBuilder:(r,e)=>{var t=new G("mpadded",[Ee(r.body,e)]);if(r.alignment!=="rlap"){var n=r.alignment==="llap"?"-1":"-0.5";t.setAttribute("lspace",n+"width")}return t.setAttribute("width","0px"),t}});j({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(r,e){var{funcName:t,parser:n}=r,o=n.mode;n.switchMode("math");var l=t==="\\("?"\\)":"$",i=n.parseExpression(!1,l);return n.expect(l),n.switchMode(o),{type:"styling",mode:n.mode,style:"text",body:i}}});j({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(r,e){throw new _("Mismatched "+r.funcName)}});var ti=(r,e)=>{switch(e.style.size){case fe.DISPLAY.size:return r.display;case fe.TEXT.size:return r.text;case fe.SCRIPT.size:return r.script;case fe.SCRIPTSCRIPT.size:return r.scriptscript;default:return r.text}};j({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(r,e)=>{var{parser:t}=r;return{type:"mathchoice",mode:t.mode,display:He(e[0]),text:He(e[1]),script:He(e[2]),scriptscript:He(e[3])}},htmlBuilder:(r,e)=>{var t=ti(r,e),n=Ge(t,e,!1);return Pt(n)},mathmlBuilder:(r,e)=>{var t=ti(r,e);return jt(t,e)}});var Pu=(r,e,t,n,o,l,i)=>{r=U([],[r]);var s=t&&Ot(t),u,d;if(e){var m=Ce(e,n.havingStyle(o.sup()),n);d={elem:m,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-m.depth)}}if(t){var h=Ce(t,n.havingStyle(o.sub()),n);u={elem:h,kern:Math.max(n.fontMetrics().bigOpSpacing2,n.fontMetrics().bigOpSpacing4-h.height)}}var p;if(d&&u){var v=n.fontMetrics().bigOpSpacing5+u.elem.height+u.elem.depth+u.kern+r.depth+i;p=xe({positionType:"bottom",positionData:v,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:u.elem,marginLeft:Y(-l)},{type:"kern",size:u.kern},{type:"elem",elem:r},{type:"kern",size:d.kern},{type:"elem",elem:d.elem,marginLeft:Y(l)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else if(u){var b=r.height-i;p=xe({positionType:"top",positionData:b,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:u.elem,marginLeft:Y(-l)},{type:"kern",size:u.kern},{type:"elem",elem:r}]})}else if(d){var w=r.depth+i;p=xe({positionType:"bottom",positionData:w,children:[{type:"elem",elem:r},{type:"kern",size:d.kern},{type:"elem",elem:d.elem,marginLeft:Y(l)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else return r;var k=[p];if(u&&l!==0&&!s){var T=U(["mspace"],[],n);T.style.marginRight=Y(l),k.unshift(T)}return U(["mop","op-limits"],k,n)},Hu=new Set(["\\smallint"]),Ur=(r,e)=>{var t,n,o=!1,l;r.type==="supsub"?(t=r.sup,n=r.sub,l=he(r.base,"op"),o=!0):l=he(r,"op");var i=e.style,s=!1;i.size===fe.DISPLAY.size&&l.symbol&&!Hu.has(l.name)&&(s=!0);var u;if(l.symbol){var d=s?"Size2-Regular":"Size1-Regular",m="";if((l.name==="\\oiint"||l.name==="\\oiiint")&&(m=l.name.slice(1),l.name=m==="oiint"?"\\iint":"\\iiint"),u=Ze(l.name,d,"math",e,["mop","op-symbol",s?"large-op":"small-op"]),m.length>0){var h=u.italic,p=iu(m+"Size"+(s?"2":"1"),e);u=xe({positionType:"individualShift",children:[{type:"elem",elem:u,shift:0},{type:"elem",elem:p,shift:s?.08:0}]}),l.name="\\"+m,u.classes.unshift("mop"),u.italic=h}}else if(l.body){var v=Ge(l.body,e,!0);v.length===1&&v[0]instanceof ut?(u=v[0],u.classes[0]="mop"):u=U(["mop"],v,e)}else{for(var b=[],w=1;w<l.name.length;w++)b.push(ma(l.name[w],l.mode,e));u=U(["mop"],b,e)}var k=0,T=0;return(u instanceof ut||l.name==="\\oiint"||l.name==="\\oiiint")&&!l.suppressBaseShift&&(k=(u.height-u.depth)/2-e.fontMetrics().axisHeight,T=u.italic||0),o?Pu(u,t,n,e,i,T,k):(k&&(u.style.position="relative",u.style.top=Y(k)),u)},gn=(r,e)=>{var t;if(r.symbol)t=new G("mo",[pt(r.name,r.mode)]),Hu.has(r.name)&&t.setAttribute("largeop","false");else if(r.body)t=new G("mo",dt(r.body,e));else{t=new G("mi",[new Ve(r.name.slice(1))]);var n=new G("mo",[pt("⁡","text")]);r.parentIsSupSub?t=new G("mrow",[t,n]):t=cu([t,n])}return t},ch={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};j({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(r,e)=>{var{parser:t,funcName:n}=r,o=n;return o.length===1&&(o=ch[o]),{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:o}},htmlBuilder:Ur,mathmlBuilder:gn});j({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var{parser:t}=r,n=e[0];return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:He(n)}},htmlBuilder:Ur,mathmlBuilder:gn});var dh={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};j({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"],props:{numArgs:0},handler(r){var{parser:e,funcName:t}=r;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:Ur,mathmlBuilder:gn});j({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(r){var{parser:e,funcName:t}=r;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:Ur,mathmlBuilder:gn});j({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(r){var{parser:e,funcName:t}=r,n=t;return n.length===1&&(n=dh[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:Ur,mathmlBuilder:gn});var Vu=(r,e)=>{var t,n,o=!1,l;r.type==="supsub"?(t=r.sup,n=r.sub,l=he(r.base,"operatorname"),o=!0):l=he(r,"operatorname");var i;if(l.body.length>0){for(var s=l.body.map(h=>{var p="text"in h?h.text:void 0;return typeof p=="string"?{type:"textord",mode:h.mode,text:p}:h}),u=Ge(s,e.withFont("mathrm"),!0),d=0;d<u.length;d++){var m=u[d];m instanceof ut&&(m.text=m.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}i=U(["mop"],u,e)}else i=U(["mop"],[],e);return o?Pu(i,t,n,e,e.style,0,0):i},fh=(r,e)=>{for(var t=dt(r.body,e.withFont("mathrm")),n=!0,o=0;o<t.length;o++){var l=t[o];if(!(l instanceof du))if(l instanceof G)switch(l.type){case"mi":case"mn":case"mspace":case"mtext":break;case"mo":{var i=l.children[0];l.children.length===1&&i instanceof Ve?i.text=i.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):n=!1;break}default:n=!1}else n=!1}if(n){var s=t.map(m=>m.toText()).join("");t=[new Ve(s)]}var u=new G("mi",t);u.setAttribute("mathvariant","normal");var d=new G("mo",[pt("⁡","text")]);return r.parentIsSupSub?new G("mrow",[u,d]):cu([u,d])};j({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(r,e)=>{var{parser:t,funcName:n}=r,o=e[0];return{type:"operatorname",mode:t.mode,body:He(o),alwaysHandleSupSub:n==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:Vu,mathmlBuilder:fh});y("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");vr({type:"ordgroup",htmlBuilder(r,e){return r.semisimple?Pt(Ge(r.body,e,!1)):U(["mord"],Ge(r.body,e,!0),e)},mathmlBuilder(r,e){return jt(r.body,e,!0)}});j({type:"overline",names:["\\overline"],props:{numArgs:1},handler(r,e){var{parser:t}=r,n=e[0];return{type:"overline",mode:t.mode,body:n}},htmlBuilder(r,e){var t=Ce(r.body,e.havingCrampedStyle()),n=Rr("overline-line",e),o=e.fontMetrics().defaultRuleThickness,l=xe({positionType:"firstBaseline",children:[{type:"elem",elem:t},{type:"kern",size:3*o},{type:"elem",elem:n},{type:"kern",size:o}]});return U(["mord","overline"],[l],e)},mathmlBuilder(r,e){var t=new G("mo",[new Ve("‾")]);t.setAttribute("stretchy","true");var n=new G("mover",[Ee(r.body,e),t]);return n.setAttribute("accent","true"),n}});j({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,n=e[0];return{type:"phantom",mode:t.mode,body:He(n)}},htmlBuilder:(r,e)=>{var t=Ge(r.body,e.withPhantom(),!1);return Pt(t)},mathmlBuilder:(r,e)=>{var t=dt(r.body,e);return new G("mphantom",t)}});y("\\hphantom","\\smash{\\phantom{#1}}");j({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,n=e[0];return{type:"vphantom",mode:t.mode,body:n}},htmlBuilder:(r,e)=>{var t=U(["inner"],[Ce(r.body,e.withPhantom())]),n=U(["fix"],[]);return U(["mord","rlap"],[t,n],e)},mathmlBuilder:(r,e)=>{var t=dt(He(r.body),e),n=new G("mphantom",t),o=new G("mpadded",[n]);return o.setAttribute("width","0px"),o}});j({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(r,e){var{parser:t}=r,n=he(e[0],"size").value,o=e[1];return{type:"raisebox",mode:t.mode,dy:n,body:o}},htmlBuilder(r,e){var t=Ce(r.body,e),n=Ie(r.dy,e);return xe({positionType:"shift",positionData:-n,children:[{type:"elem",elem:t}]})},mathmlBuilder(r,e){var t=new G("mpadded",[Ee(r.body,e)]),n=r.dy.number+r.dy.unit;return t.setAttribute("voffset",n),t}});j({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(r){var{parser:e}=r;return{type:"internal",mode:e.mode}}});j({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(r,e,t){var{parser:n}=r,o=t[0],l=he(e[0],"size"),i=he(e[1],"size");return{type:"rule",mode:n.mode,shift:o&&he(o,"size").value,width:l.value,height:i.value}},htmlBuilder(r,e){var t=U(["mord","rule"],[],e),n=Ie(r.width,e),o=Ie(r.height,e),l=r.shift?Ie(r.shift,e):0;return t.style.borderRightWidth=Y(n),t.style.borderTopWidth=Y(o),t.style.bottom=Y(l),t.width=n,t.height=o+l,t.depth=-l,t.maxFontSize=o*1.125*e.sizeMultiplier,t},mathmlBuilder(r,e){var t=Ie(r.width,e),n=Ie(r.height,e),o=r.shift?Ie(r.shift,e):0,l=e.color&&e.getColor()||"black",i=new G("mspace");i.setAttribute("mathbackground",l),i.setAttribute("width",Y(t)),i.setAttribute("height",Y(n));var s=new G("mpadded",[i]);return o>=0?s.setAttribute("height",Y(o)):(s.setAttribute("height",Y(o)),s.setAttribute("depth",Y(-o))),s.setAttribute("voffset",Y(o)),s}});function Fu(r,e,t){for(var n=Ge(r,e,!1),o=e.sizeMultiplier/t.sizeMultiplier,l=0;l<n.length;l++){var i=n[l].classes.indexOf("sizing");i<0?Array.prototype.push.apply(n[l].classes,e.sizingClasses(t)):n[l].classes[i+1]==="reset-size"+e.size&&(n[l].classes[i+1]="reset-size"+t.size),n[l].height*=o,n[l].depth*=o}return Pt(n)}var ri=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],mh=(r,e)=>{var t=e.havingSize(r.size);return Fu(r.body,t,e)};j({type:"sizing",names:ri,props:{numArgs:0,allowedInText:!0},handler:(r,e)=>{var{breakOnTokenText:t,funcName:n,parser:o}=r,l=o.parseExpression(!1,t);return{type:"sizing",mode:o.mode,size:ri.indexOf(n)+1,body:l}},htmlBuilder:mh,mathmlBuilder:(r,e)=>{var t=e.havingSize(r.size),n=dt(r.body,t),o=new G("mstyle",n);return o.setAttribute("mathsize",Y(t.sizeMultiplier)),o}});j({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(r,e,t)=>{var{parser:n}=r,o=!1,l=!1,i=t[0]&&he(t[0],"ordgroup");if(i)for(var s="",u=0;u<i.body.length;++u){var d=i.body[u];if(s=wo(d).text,s==="t")o=!0;else if(s==="b")l=!0;else{o=!1,l=!1;break}}else o=!0,l=!0;var m=e[0];return{type:"smash",mode:n.mode,body:m,smashHeight:o,smashDepth:l}},htmlBuilder:(r,e)=>{var t=U([],[Ce(r.body,e)]);if(!r.smashHeight&&!r.smashDepth)return t;if(r.smashHeight&&(t.height=0),r.smashDepth&&(t.depth=0),r.smashHeight&&r.smashDepth)return U(["mord","smash"],[t],e);if(t.children)for(var n=0;n<t.children.length;n++)r.smashHeight&&(t.children[n].height=0),r.smashDepth&&(t.children[n].depth=0);var o=xe({positionType:"firstBaseline",children:[{type:"elem",elem:t}]});return U(["mord"],[o],e)},mathmlBuilder:(r,e)=>{var t=new G("mpadded",[Ee(r.body,e)]);return r.smashHeight&&t.setAttribute("height","0px"),r.smashDepth&&t.setAttribute("depth","0px"),t}});j({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(r,e,t){var{parser:n}=r,o=t[0],l=e[0];return{type:"sqrt",mode:n.mode,body:l,index:o}},htmlBuilder(r,e){var t=Ce(r.body,e.havingCrampedStyle());t.height===0&&(t.height=e.fontMetrics().xHeight),t=Pr(t,e);var n=e.fontMetrics(),o=n.defaultRuleThickness,l=o;e.style.id<fe.TEXT.id&&(l=e.fontMetrics().xHeight);var i=o+l/4,s=t.height+t.depth+i+o,{span:u,ruleWidth:d,advanceWidth:m}=Zm(s,e),h=u.height-d;h>t.height+t.depth+i&&(i=(i+h-t.height-t.depth)/2);var p=u.height-t.height-i-d;t.style.paddingLeft=Y(m);var v=xe({positionType:"firstBaseline",children:[{type:"elem",elem:t,wrapperClasses:["svg-align"]},{type:"kern",size:-(t.height+p)},{type:"elem",elem:u},{type:"kern",size:d}]});if(r.index){var b=e.havingStyle(fe.SCRIPTSCRIPT),w=Ce(r.index,b,e),k=.6*(v.height-v.depth),T=xe({positionType:"shift",positionData:-k,children:[{type:"elem",elem:w}]}),E=U(["root"],[T]);return U(["mord","sqrt"],[E,v],e)}else return U(["mord","sqrt"],[v],e)},mathmlBuilder(r,e){var{body:t,index:n}=r;return n?new G("mroot",[Ee(t,e),Ee(n,e)]):new G("msqrt",[Ee(t,e)])}});var ni={display:fe.DISPLAY,text:fe.TEXT,script:fe.SCRIPT,scriptscript:fe.SCRIPTSCRIPT};j({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r,e){var{breakOnTokenText:t,funcName:n,parser:o}=r,l=o.parseExpression(!0,t),i=n.slice(1,n.length-5);return{type:"styling",mode:o.mode,style:i,body:l}},htmlBuilder(r,e){var t=ni[r.style],n=e.havingStyle(t).withFont("");return Fu(r.body,n,e)},mathmlBuilder(r,e){var t=ni[r.style],n=e.havingStyle(t),o=dt(r.body,n),l=new G("mstyle",o),i={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},s=i[r.style];return l.setAttribute("scriptlevel",s[0]),l.setAttribute("displaystyle",s[1]),l}});var hh=function(e,t){var n=e.base;if(n)if(n.type==="op"){var o=n.limits&&(t.style.size===fe.DISPLAY.size||n.alwaysHandleSupSub);return o?Ur:null}else if(n.type==="operatorname"){var l=n.alwaysHandleSupSub&&(t.style.size===fe.DISPLAY.size||n.limits);return l?Vu:null}else{if(n.type==="accent")return Ot(n.base)?va:null;if(n.type==="horizBrace"){var i=!e.sub;return i===n.isOver?Ru:null}else return null}else return null};vr({type:"supsub",htmlBuilder(r,e){var t=hh(r,e);if(t)return t(r,e);var{base:n,sup:o,sub:l}=r,i=Ce(n,e),s,u,d=e.fontMetrics(),m=0,h=0,p=n&&Ot(n);if(o){var v=e.havingStyle(e.style.sup());s=Ce(o,v,e),p||(m=i.height-v.fontMetrics().supDrop*v.sizeMultiplier/e.sizeMultiplier)}if(l){var b=e.havingStyle(e.style.sub());u=Ce(l,b,e),p||(h=i.depth+b.fontMetrics().subDrop*b.sizeMultiplier/e.sizeMultiplier)}var w;e.style===fe.DISPLAY?w=d.sup1:e.style.cramped?w=d.sup3:w=d.sup2;var k=e.sizeMultiplier,T=Y(.5/d.ptPerEm/k),E=null;if(u){var M=r.base&&r.base.type==="op"&&r.base.name&&(r.base.name==="\\oiint"||r.base.name==="\\oiiint");(i instanceof ut||M)&&(E=Y(-i.italic))}var B;if(s&&u){m=Math.max(m,w,s.depth+.25*d.xHeight),h=Math.max(h,d.sub2);var D=d.defaultRuleThickness,z=4*D;if(m-s.depth-(u.height-h)<z){h=z-(m-s.depth)+u.height;var W=.8*d.xHeight-(m-s.depth);W>0&&(m+=W,h-=W)}var H=[{type:"elem",elem:u,shift:h,marginRight:T,marginLeft:E},{type:"elem",elem:s,shift:-m,marginRight:T}];B=xe({positionType:"individualShift",children:H})}else if(u){h=Math.max(h,d.sub1,u.height-.8*d.xHeight);var A=[{type:"elem",elem:u,marginLeft:E,marginRight:T}];B=xe({positionType:"shift",positionData:h,children:A})}else if(s)m=Math.max(m,w,s.depth+.25*d.xHeight),B=xe({positionType:"shift",positionData:-m,children:[{type:"elem",elem:s,marginRight:T}]});else throw new Error("supsub must have either sup or sub.");var R=Fl(i,"right")||"mord";return U([R],[i,U(["msupsub"],[B])],e)},mathmlBuilder(r,e){var t=!1,n,o;r.base&&r.base.type==="horizBrace"&&(o=!!r.sup,o===r.base.isOver&&(t=!0,n=r.base.isOver)),r.base&&(r.base.type==="op"||r.base.type==="operatorname")&&(r.base.parentIsSupSub=!0);var l=[Ee(r.base,e)];r.sub&&l.push(Ee(r.sub,e)),r.sup&&l.push(Ee(r.sup,e));var i;if(t)i=n?"mover":"munder";else if(r.sub)if(r.sup){var d=r.base;d&&d.type==="op"&&d.limits&&e.style===fe.DISPLAY||d&&d.type==="operatorname"&&d.alwaysHandleSupSub&&(e.style===fe.DISPLAY||d.limits)?i="munderover":i="msubsup"}else{var u=r.base;u&&u.type==="op"&&u.limits&&(e.style===fe.DISPLAY||u.alwaysHandleSupSub)||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(u.limits||e.style===fe.DISPLAY)?i="munder":i="msub"}else{var s=r.base;s&&s.type==="op"&&s.limits&&(e.style===fe.DISPLAY||s.alwaysHandleSupSub)||s&&s.type==="operatorname"&&s.alwaysHandleSupSub&&(s.limits||e.style===fe.DISPLAY)?i="mover":i="msup"}return new G(i,l)}});vr({type:"atom",htmlBuilder(r,e){return ma(r.text,r.mode,e,["m"+r.family])},mathmlBuilder(r,e){var t=new G("mo",[pt(r.text,r.mode)]);if(r.family==="bin"){var n=ga(r,e);n==="bold-italic"&&t.setAttribute("mathvariant",n)}else r.family==="punct"?t.setAttribute("separator","true"):(r.family==="open"||r.family==="close")&&t.setAttribute("stretchy","false");return t}});var $u={mi:"italic",mn:"normal",mtext:"normal"};vr({type:"mathord",htmlBuilder(r,e){return vo(r,e,"mathord")},mathmlBuilder(r,e){var t=new G("mi",[pt(r.text,r.mode,e)]),n=ga(r,e)||"italic";return n!==$u[t.type]&&t.setAttribute("mathvariant",n),t}});vr({type:"textord",htmlBuilder(r,e){return vo(r,e,"textord")},mathmlBuilder(r,e){var t=pt(r.text,r.mode,e),n=ga(r,e)||"normal",o;return r.mode==="text"?o=new G("mtext",[t]):/[0-9]/.test(r.text)?o=new G("mn",[t]):r.text==="\\prime"?o=new G("mo",[t]):o=new G("mi",[t]),n!==$u[o.type]&&o.setAttribute("mathvariant",n),o}});var sl={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},ul={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};vr({type:"spacing",htmlBuilder(r,e){if(ul.hasOwnProperty(r.text)){var t=ul[r.text].className||"";if(r.mode==="text"){var n=vo(r,e,"textord");return n.classes.push(t),n}else return U(["mspace",t],[ma(r.text,r.mode,e)],e)}else{if(sl.hasOwnProperty(r.text))return U(["mspace",sl[r.text]],[],e);throw new _('Unknown type of space "'+r.text+'"')}},mathmlBuilder(r,e){var t;if(ul.hasOwnProperty(r.text))t=new G("mtext",[new Ve(" ")]);else{if(sl.hasOwnProperty(r.text))return new G("mspace");throw new _('Unknown type of space "'+r.text+'"')}return t}});var oi=()=>{var r=new G("mtd",[]);return r.setAttribute("width","50%"),r};vr({type:"tag",mathmlBuilder(r,e){var t=new G("mtable",[new G("mtr",[oi(),new G("mtd",[jt(r.body,e)]),oi(),new G("mtd",[jt(r.tag,e)])])]);return t.setAttribute("width","100%"),t}});var li={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},ai={"\\textbf":"textbf","\\textmd":"textmd"},ph={"\\textit":"textit","\\textup":"textup"},ii=(r,e)=>{var t=r.font;if(t){if(li[t])return e.withTextFontFamily(li[t]);if(ai[t])return e.withTextFontWeight(ai[t]);if(t==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(ph[t])};j({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(r,e){var{parser:t,funcName:n}=r,o=e[0];return{type:"text",mode:t.mode,body:He(o),font:n}},htmlBuilder(r,e){var t=ii(r,e),n=Ge(r.body,t,!0);return U(["mord","text"],n,t)},mathmlBuilder(r,e){var t=ii(r,e);return jt(r.body,t)}});j({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(r,e){var{parser:t}=r;return{type:"underline",mode:t.mode,body:e[0]}},htmlBuilder(r,e){var t=Ce(r.body,e),n=Rr("underline-line",e),o=e.fontMetrics().defaultRuleThickness,l=xe({positionType:"top",positionData:t.height,children:[{type:"kern",size:o},{type:"elem",elem:n},{type:"kern",size:3*o},{type:"elem",elem:t}]});return U(["mord","underline"],[l],e)},mathmlBuilder(r,e){var t=new G("mo",[new Ve("‾")]);t.setAttribute("stretchy","true");var n=new G("munder",[Ee(r.body,e),t]);return n.setAttribute("accentunder","true"),n}});j({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(r,e){var{parser:t}=r;return{type:"vcenter",mode:t.mode,body:e[0]}},htmlBuilder(r,e){var t=Ce(r.body,e),n=e.fontMetrics().axisHeight,o=.5*(t.height-n-(t.depth+n));return xe({positionType:"shift",positionData:o,children:[{type:"elem",elem:t}]})},mathmlBuilder(r,e){var t=new G("mpadded",[Ee(r.body,e)],["vcenter"]);return new G("mrow",[t])}});j({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(r,e,t){throw new _("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(r,e){for(var t=si(r),n=[],o=e.havingStyle(e.style.text()),l=0;l<t.length;l++){var i=t[l];i==="~"&&(i="\\textasciitilde"),n.push(Ze(i,"Typewriter-Regular",r.mode,o,["mord","texttt"]))}return U(["mord","text"].concat(o.sizingClasses(e)),ou(n),o)},mathmlBuilder(r,e){var t=new Ve(si(r)),n=new G("mtext",[t]);return n.setAttribute("mathvariant","monospace"),n}});var si=r=>r.body.replace(/ /g,r.star?"␣":" "),_t=su,qu=`[ \r
303
+ ]`,gh="\\\\[a-zA-Z@]+",vh="\\\\[^\uD800-\uDFFF]",bh="("+gh+")"+qu+"*",yh=`\\\\(
304
+ |[ \r ]+
305
+ ?)[ \r ]*`,_l="[̀-ͯ]",wh=new RegExp(_l+"+$"),kh="("+qu+"+)|"+(yh+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(_l+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(_l+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+bh)+("|"+vh+")");class ui{constructor(e,t){this.input=e,this.settings=t,this.tokenRegex=new RegExp(kh,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new it("EOF",new nt(this,t,t));var n=this.tokenRegex.exec(e);if(n===null||n.index!==t)throw new _("Unexpected character: '"+e[t]+"'",new it(e[t],new nt(this,t,t+1)));var o=n[6]||n[3]||(n[2]?"\\ ":" ");if(this.catcodes[o]===14){var l=e.indexOf(`
306
+ `,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 it(o,new nt(this,t,this.tokenRegex.lastIndex))}}class xh{constructor(e,t){e===void 0&&(e={}),t===void 0&&(t={}),this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new _("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(e[t]==null?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,n){if(n===void 0&&(n=!1),n){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]=t)}else{var l=this.undefStack[this.undefStack.length-1];l&&!l.hasOwnProperty(e)&&(l[e]=this.current[e])}t==null?delete this.current[e]:this.current[e]=t}}var Ch=Lu;y("\\noexpand",function(r){var e=r.popToken();return r.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});y("\\expandafter",function(r){var e=r.popToken();return r.expandOnce(!0),{tokens:[e],numArgs:0}});y("\\@firstoftwo",function(r){var e=r.consumeArgs(2);return{tokens:e[0],numArgs:0}});y("\\@secondoftwo",function(r){var e=r.consumeArgs(2);return{tokens:e[1],numArgs:0}});y("\\@ifnextchar",function(r){var e=r.consumeArgs(3);r.consumeSpaces();var t=r.future();return e[0].length===1&&e[0][0].text===t.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});y("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");y("\\TextOrMath",function(r){var e=r.consumeArgs(2);return r.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var ci={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(r){var e=r.popToken(),t,n=0;if(e.text==="'")t=8,e=r.popToken();else if(e.text==='"')t=16,e=r.popToken();else if(e.text==="`")if(e=r.popToken(),e.text[0]==="\\")n=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new _("\\char` missing argument");n=e.text.charCodeAt(0)}else t=10;if(t){if(n=ci[e.text],n==null||n>=t)throw new _("Invalid base-"+t+" digit "+e.text);for(var o;(o=ci[r.future().text])!=null&&o<t;)n*=t,n+=o,r.popToken()}return"\\@char{"+n+"}"});var ka=(r,e,t,n)=>{var o=r.consumeArg().tokens;if(o.length!==1)throw new _("\\newcommand's first argument must be a macro name");var l=o[0].text,i=r.isDefined(l);if(i&&!e)throw new _("\\newcommand{"+l+"} attempting to redefine "+(l+"; use \\renewcommand"));if(!i&&!t)throw new _("\\renewcommand{"+l+"} when command "+l+" does not yet exist; use \\newcommand");var s=0;if(o=r.consumeArg().tokens,o.length===1&&o[0].text==="["){for(var u="",d=r.expandNextToken();d.text!=="]"&&d.text!=="EOF";)u+=d.text,d=r.expandNextToken();if(!u.match(/^\s*[0-9]+\s*$/))throw new _("Invalid number of arguments: "+u);s=parseInt(u),o=r.consumeArg().tokens}return i&&n||r.macros.set(l,{tokens:o,numArgs:s}),""};y("\\newcommand",r=>ka(r,!1,!0,!1));y("\\renewcommand",r=>ka(r,!0,!1,!1));y("\\providecommand",r=>ka(r,!0,!0,!0));y("\\message",r=>{var e=r.consumeArgs(1)[0];return console.log(e.reverse().map(t=>t.text).join("")),""});y("\\errmessage",r=>{var e=r.consumeArgs(1)[0];return console.error(e.reverse().map(t=>t.text).join("")),""});y("\\show",r=>{var e=r.popToken(),t=e.text;return console.log(e,r.macros.get(t),_t[t],Se.math[t],Se.text[t]),""});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 di={",":"\\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"},Th=new Set(["bin","rel"]);y("\\dots",function(r){var e="\\dotso",t=r.expandAfterFuture().text;return t in di?e=di[t]:(t.slice(0,4)==="\\not"||t in Se.math&&Th.has(Se.math[t].group))&&(e="\\dotsb"),e});var xa={")":!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(r){var e=r.future().text;return e in xa?"\\ldots\\,":"\\ldots"});y("\\dotsc",function(r){var e=r.future().text;return e in xa&&e!==","?"\\ldots\\,":"\\ldots"});y("\\cdots",function(r){var e=r.future().text;return e in xa?"\\@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",r=>{if(r.macros.get("\\df@tag"))throw new _("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 Uu=Y(wt["Main-Regular"][84][1]-.7*wt["Main-Regular"][65][1]);y("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+Uu+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");y("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+Uu+"}{\\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 Wu=r=>e=>{var t=e.consumeArg().tokens,n=e.consumeArg().tokens,o=e.consumeArg().tokens,l=e.consumeArg().tokens,i=e.macros.get("|"),s=e.macros.get("\\|");e.macros.beginGroup();var u=h=>p=>{r&&(p.macros.set("|",i),o.length&&p.macros.set("\\|",s));var v=h;if(!h&&o.length){var b=p.future();b.text==="|"&&(p.popToken(),v=!0)}return{tokens:v?o:n,numArgs:0}};e.macros.set("|",u(!1)),o.length&&e.macros.set("\\|",u(!0));var d=e.consumeArg().tokens,m=e.expandTokens([...l,...d,...t]);return e.macros.endGroup(),{tokens:m.reverse(),numArgs:0}};y("\\bra@ket",Wu(!1));y("\\bra@set",Wu(!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 _u={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class Eh{constructor(e,t,n){this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new xh(Ch,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new ui(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 t,n,o;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;t=this.popToken(),{tokens:o,end:n}=this.consumeArg(["]"])}else({tokens:o,start:t,end:n}=this.consumeArg());return this.pushToken(new it("EOF",n.loc)),this.pushTokens(o),new it("",nt.range(t,n))}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var o=this.future(),l,i=0,s=0;do{if(l=this.popToken(),t.push(l),l.text==="{")++i;else if(l.text==="}"){if(--i,i===-1)throw new _("Extra }",l)}else if(l.text==="EOF")throw new _("Unexpected end of input in a macro argument, expected '"+(e&&n?e[s]:"}")+"'",l);if(e&&n)if((i===0||i===1&&e[s]==="{")&&l.text===e[s]){if(++s,s===e.length){t.splice(-s,s);break}}else s=0}while(i!==0||n);return o.text==="{"&&t[t.length-1].text==="}"&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:o,end:l}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new _("The length of delimiters doesn't match the number of args!");for(var n=t[0],o=0;o<n.length;o++){var l=this.popToken();if(n[o]!==l.text)throw new _("Use of the macro doesn't match its definition",l)}}for(var i=[],s=0;s<e;s++)i.push(this.consumeArg(t&&t[s+1]).tokens);return i}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new _("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var t=this.popToken(),n=t.text,o=t.noexpand?null:this._getExpansion(n);if(o==null||e&&o.unexpandable){if(e&&o==null&&n[0]==="\\"&&!this.isDefined(n))throw new _("Undefined control sequence: "+n);return this.pushToken(t),!1}this.countExpansion(1);var l=o.tokens,i=this.consumeArgs(o.numArgs,o.delimiters);if(o.numArgs){l=l.slice();for(var s=l.length-1;s>=0;--s){var u=l[s];if(u.text==="#"){if(s===0)throw new _("Incomplete placeholder at end of macro body",u);if(u=l[--s],u.text==="#")l.splice(s+1,1);else if(/^[1-9]$/.test(u.text))l.splice(s,2,...i[+u.text-1]);else throw new _("Not a valid argument number",u)}}}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 it(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var o=this.stack.pop();o.treatAsRelax&&(o.noexpand=!1,o.treatAsRelax=!1),t.push(o)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t&&t.map(n=>n.text).join("")}_getExpansion(e){var t=this.macros.get(e);if(t==null)return t;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var o=typeof t=="function"?t(this):t;if(typeof o=="string"){var l=0;if(o.includes("#"))for(var i=o.replace(/##/g,"");i.includes("#"+(l+1));)++l;for(var s=new ui(o,this.settings),u=[],d=s.lex();d.text!=="EOF";)u.push(d),d=s.lex();u.reverse();var m={tokens:u,numArgs:l};return m}return o}isDefined(e){return this.macros.has(e)||_t.hasOwnProperty(e)||Se.math.hasOwnProperty(e)||Se.text.hasOwnProperty(e)||_u.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return t!=null?typeof t=="string"||typeof t=="function"||!t.unexpandable:_t.hasOwnProperty(e)&&!_t[e].primitive}}var fi=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,In=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","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),cl={"́":{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"}},mi={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class Mo{constructor(e,t){this.mode="math",this.gullet=new Eh(e,t,this.mode),this.settings=t,this.leftrightDepth=0,this.nextToken=null}expect(e,t){if(t===void 0&&(t=!0),this.fetch().text!==e)throw new _("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());t&&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 t=this.nextToken;this.consume(),this.gullet.pushToken(new it("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,n}parseExpression(e,t){for(var n=[];;){this.mode==="math"&&this.consumeSpaces();var o=this.fetch();if(Mo.endOfExpression.has(o.text)||t&&o.text===t||e&&_t[o.text]&&_t[o.text].infix)break;var l=this.parseAtom(t);if(l){if(l.type==="internal")continue}else break;n.push(l)}return this.mode==="text"&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var t=-1,n,o=0;o<e.length;o++){var l=e[o];if(l.type==="infix"){if(t!==-1)throw new _("only one infix operator per group",l.token);t=o,n=l.replaceWith}}if(t!==-1&&n){var i,s,u=e.slice(0,t),d=e.slice(t+1);u.length===1&&u[0].type==="ordgroup"?i=u[0]:i={type:"ordgroup",mode:this.mode,body:u},d.length===1&&d[0].type==="ordgroup"?s=d[0]:s={type:"ordgroup",mode:this.mode,body:d};var m;return n==="\\\\abovefrac"?m=this.callFunction(n,[i,e[t],s],[]):m=this.callFunction(n,[i,s],[]),[m]}else return e}handleSupSubscript(e){var t=this.fetch(),n=t.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 _("Expected group after '"+n+"'",t);return o}formatUnsupportedCmd(e){for(var t=[],n=0;n<e.length;n++)t.push({type:"textord",mode:"text",text:e[n]});var o={type:"text",mode:this.mode,body:t},l={type:"color",mode:this.mode,color:this.settings.errorColor,body:[o]};return l}parseAtom(e){var t=this.parseGroup("atom",e);if((t==null?void 0:t.type)==="internal"||this.mode==="text")return t;for(var n,o;;){this.consumeSpaces();var l=this.fetch();if(l.text==="\\limits"||l.text==="\\nolimits"){if(t&&t.type==="op"){var i=l.text==="\\limits";t.limits=i,t.alwaysHandleSupSub=!0}else if(t&&t.type==="operatorname")t.alwaysHandleSupSub&&(t.limits=l.text==="\\limits");else throw new _("Limit controls must follow a math operator",l);this.consume()}else if(l.text==="^"){if(n)throw new _("Double superscript",l);n=this.handleSupSubscript("superscript")}else if(l.text==="_"){if(o)throw new _("Double subscript",l);o=this.handleSupSubscript("subscript")}else if(l.text==="'"){if(n)throw new _("Double superscript",l);var s={type:"textord",mode:this.mode,text:"\\prime"},u=[s];for(this.consume();this.fetch().text==="'";)u.push(s),this.consume();this.fetch().text==="^"&&u.push(this.handleSupSubscript("superscript")),n={type:"ordgroup",mode:this.mode,body:u}}else if(In[l.text]){var d=fi.test(l.text),m=[];for(m.push(new it(In[l.text])),this.consume();;){var h=this.fetch().text;if(!In[h]||fi.test(h)!==d)break;m.unshift(new it(In[h])),this.consume()}var p=this.subparse(m);d?o={type:"ordgroup",mode:"math",body:p}:n={type:"ordgroup",mode:"math",body:p}}else break}return n||o?{type:"supsub",mode:this.mode,base:t,sup:n,sub:o}:t}parseFunction(e,t){var n=this.fetch(),o=n.text,l=_t[o];if(!l)return null;if(this.consume(),t&&t!=="atom"&&!l.allowedInArgument)throw new _("Got function '"+o+"' with no arguments"+(t?" as "+t:""),n);if(this.mode==="text"&&!l.allowedInText)throw new _("Can't use function '"+o+"' in text mode",n);if(this.mode==="math"&&l.allowedInMath===!1)throw new _("Can't use function '"+o+"' in math mode",n);var{args:i,optArgs:s}=this.parseArguments(o,l);return this.callFunction(o,i,s,n,e)}callFunction(e,t,n,o,l){var i={funcName:e,parser:this,token:o,breakOnTokenText:l},s=_t[e];if(s&&s.handler)return s.handler(i,t,n);throw new _("No function handler for "+e)}parseArguments(e,t){var n=t.numArgs+t.numOptionalArgs;if(n===0)return{args:[],optArgs:[]};for(var o=[],l=[],i=0;i<n;i++){var s=t.argTypes&&t.argTypes[i],u=i<t.numOptionalArgs;("primitive"in t&&t.primitive&&s==null||t.type==="sqrt"&&i===1&&l[0]==null)&&(s="primitive");var d=this.parseGroupOfType("argument to '"+e+"'",s,u);if(u)l.push(d);else if(d!=null)o.push(d);else throw new _("Null argument, please report this as a bug")}return{args:o,optArgs:l}}parseGroupOfType(e,t,n){switch(t){case"color":return this.parseColorGroup(n);case"size":return this.parseSizeGroup(n);case"url":return this.parseUrlGroup(n);case"math":case"text":return this.parseArgumentGroup(n,t);case"hbox":{var o=this.parseArgumentGroup(n,"text");return o!=null?{type:"styling",mode:o.mode,body:[o],style:"text"}:null}case"raw":{var l=this.parseStringGroup("raw",n);return l!=null?{type:"raw",mode:"text",string:l.text}:null}case"primitive":{if(n)throw new _("A primitive argument cannot be optional");var i=this.parseGroup(e);if(i==null)throw new _("Expected group as "+e,this.fetch());return i}case"original":case null:case void 0:return this.parseArgumentGroup(n);default:throw new _("Unknown group type as "+e,this.fetch())}}consumeSpaces(){for(;this.fetch().text===" ";)this.consume()}parseStringGroup(e,t){var n=this.gullet.scanArgument(t);if(n==null)return null;for(var o="",l;(l=this.fetch()).text!=="EOF";)o+=l.text,this.consume();return this.consume(),n.text=o,n}parseRegexGroup(e,t){for(var n=this.fetch(),o=n,l="",i;(i=this.fetch()).text!=="EOF"&&e.test(l+i.text);)o=i,l+=o.text,this.consume();if(l==="")throw new _("Invalid "+t+": '"+n.text+"'",n);return n.range(o,l)}parseColorGroup(e){var t=this.parseStringGroup("color",e);if(t==null)return null;var n=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);if(!n)throw new _("Invalid color: '"+t.text+"'",t);var o=n[0];return/^[0-9a-f]{6}$/i.test(o)&&(o="#"+o),{type:"color-token",mode:this.mode,color:o}}parseSizeGroup(e){var t,n=!1;if(this.gullet.consumeSpaces(),!e&&this.gullet.future().text!=="{"?t=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):t=this.parseStringGroup("size",e),!t)return null;!e&&t.text.length===0&&(t.text="0pt",n=!0);var o=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!o)throw new _("Invalid size: '"+t.text+"'",t);var l={number:+(o[1]+o[2]),unit:o[3]};if(!Zs(l))throw new _("Invalid unit: '"+l.unit+"'",t);return{type:"size",mode:this.mode,value:l,isBlank:n}}parseUrlGroup(e){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var t=this.parseStringGroup("url",e);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),t==null)return null;var n=t.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:n}}parseArgumentGroup(e,t){var n=this.gullet.scanArgument(e);if(n==null)return null;var o=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();var l=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var i={type:"ordgroup",mode:this.mode,loc:n.loc,body:l};return t&&this.switchMode(o),i}parseGroup(e,t){var n=this.fetch(),o=n.text,l;if(o==="{"||o==="\\begingroup"){this.consume();var i=o==="{"?"}":"\\endgroup";this.gullet.beginGroup();var s=this.parseExpression(!1,i),u=this.fetch();this.expect(i),this.gullet.endGroup(),l={type:"ordgroup",mode:this.mode,loc:nt.range(n,u),body:s,semisimple:o==="\\begingroup"||void 0}}else if(l=this.parseFunction(t,e)||this.parseSymbol(),l==null&&o[0]==="\\"&&!_u.hasOwnProperty(o)){if(this.settings.throwOnError)throw new _("Undefined control sequence: "+o,n);l=this.formatUnsupportedCmd(o),this.consume()}return l}formLigatures(e){for(var t=e.length-1,n=0;n<t;++n){var o=e[n];if(o.type==="textord"){var l=o.text,i=e[n+1];if(!(!i||i.type!=="textord")){if(l==="-"&&i.text==="-"){var s=e[n+2];n+1<t&&s&&s.type==="textord"&&s.text==="-"?(e.splice(n,3,{type:"textord",mode:"text",loc:nt.range(o,s),text:"---"}),t-=2):(e.splice(n,2,{type:"textord",mode:"text",loc:nt.range(o,i),text:"--"}),t-=1)}(l==="'"||l==="`")&&i.text===l&&(e.splice(n,2,{type:"textord",mode:"text",loc:nt.range(o,i),text:l+l}),t-=1)}}}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),o=n.charAt(0)==="*";if(o&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new _(`\\verb assertion failed --
307
+ please report what input caused this bug`);return n=n.slice(1,-1),{type:"verb",mode:"text",body:n,star:o}}mi.hasOwnProperty(t[0])&&!Se[this.mode][t[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+t[0]+'" used in math mode',e),t=mi[t[0]]+t.slice(1));var l=wh.exec(t);l&&(t=t.substring(0,l.index),t==="i"?t="ı":t==="j"&&(t="ȷ"));var i;if(Se[this.mode][t]){this.settings.strict&&this.mode==="math"&&Rl.includes(t)&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+t[0]+'" used in math mode',e);var s=Se[this.mode][t].group,u=nt.range(e),d;if(km.hasOwnProperty(s)){var m=s;d={type:"atom",mode:this.mode,family:m,loc:u,text:t}}else d={type:s,mode:this.mode,loc:u,text:t};i=d}else if(t.charCodeAt(0)>=128)this.settings.strict&&(Qs(t.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'"'+(" ("+t.charCodeAt(0)+")"),e)),i={type:"textord",mode:"text",loc:nt.range(e),text:t};else return null;if(this.consume(),l)for(var h=0;h<l[0].length;h++){var p=l[0][h];if(!cl[p])throw new _("Unknown accent ' "+p+"'",e);var v=cl[p][this.mode]||cl[p].text;if(!v)throw new _("Accent "+p+" unsupported in "+this.mode+" mode",e);i={type:"accent",mode:this.mode,loc:nt.range(e),label:v,isStretchy:!1,isShifty:!0,base:i}}return i}}Mo.endOfExpression=new Set(["}","\\endgroup","\\end","\\right","&"]);var Ca=function(e,t){if(!(typeof e=="string"||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var n=new Mo(e,t);delete n.gullet.macros.current["\\df@tag"];var o=n.parse();if(delete n.gullet.macros.current["\\current@color"],delete n.gullet.macros.current["\\color"],n.gullet.macros.get("\\df@tag")){if(!t.displayMode)throw new _("\\tag works only in display equations");o=[{type:"tag",mode:"text",body:o,tag:n.subparse([new it("\\df@tag")])}]}return o},Gu=function(e,t,n){t.textContent="";var o=Ta(e,n).toNode();t.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."),Gu=function(){throw new _("KaTeX doesn't work in quirks mode.")});var Sh=function(e,t){var n=Ta(e,t).toMarkup();return n},Mh=function(e,t){var n=new ca(t);return Ca(e,n)},Ku=function(e,t,n){if(n.throwOnError||!(e instanceof _))throw e;var o=U(["katex-error"],[new ut(t)]);return o.setAttribute("title",e.toString()),o.setAttribute("style","color:"+n.errorColor),o},Ta=function(e,t){var n=new ca(t);try{var o=Ca(e,n);return Pm(o,e,n)}catch(l){return Ku(l,e,n)}},Ah=function(e,t){var n=new ca(t);try{var o=Ca(e,n);return Hm(o,e,n)}catch(l){return Ku(l,e,n)}},Bh="0.16.45",Nh={Span:$r,Anchor:po,SymbolNode:ut,SvgNode:zt,PathNode:Jt,LineNode:Ol},Yu={version:Bh,render:Gu,renderToString:Sh,ParseError:_,SETTINGS_SCHEMA:Il,__parse:Mh,__renderToDomTree:Ta,__renderToHTMLTree:Ah,__setFontMetrics:ym,__defineSymbol:c,__defineFunction:j,__defineMacro:y,__domTree:Nh};const Lh=Ni.BlockMath.extend({addNodeView(){const{katexOptions:r}=this.options;return({node:e,getPos:t})=>{let n=e;const o=document.createElement("div"),l=document.createElement("div");o.classList.add("tiptap-mathematics-render"),this.editor.isEditable&&o.classList.add("tiptap-mathematics-render--editable"),l.className="block-math-inner",o.appendChild(l);const i=()=>{const d=We(n.attrs.commentIds);o.dataset.type="block-math",o.setAttribute("data-latex",n.attrs.latex),d.length>0?(o.setAttribute("data-comment-ids",JSON.stringify(d)),o.classList.add("pagely-comment-block"),d.length>1?o.setAttribute("data-comment-count",String(d.length)):o.removeAttribute("data-comment-count")):(o.removeAttribute("data-comment-ids"),o.removeAttribute("data-comment-count"),o.classList.remove("pagely-comment-block"))};function s(){try{Yu.render(n.attrs.latex,l,r),o.classList.remove("block-math-error")}catch{l.textContent=n.attrs.latex,o.classList.add("block-math-error")}}const u=d=>{var h,p;d.preventDefault(),d.stopPropagation();const m=t();m!=null&&((p=(h=this.options).onClick)==null||p.call(h,n,m))};return this.options.onClick&&o.addEventListener("click",u),i(),s(),{dom:o,update:d=>{if(d.type!==n.type)return!1;const m=d.attrs.latex!==n.attrs.latex;return n=d,i(),m&&s(),!0},destroy(){o.removeEventListener("click",u)}}}}}),Ih=Me.Extension.create({name:"Mathematics",addOptions(){return{inlineOptions:void 0,blockOptions:void 0,katexOptions:void 0}},addExtensions(){return[Lh.configure({...this.options.blockOptions,katexOptions:this.options.katexOptions}),Ni.InlineMath.configure({...this.options.inlineOptions,katexOptions:this.options.katexOptions})]}}),zh=["paragraph","heading","blockquote","bulletList","orderedList","listItem","taskList","taskItem","codeBlock","table","tableRow","tableCell","tableHeader","image","mermaidBlock","dotFlowPadBlock","blockMath","embedView"],Ju=Me.Extension.create({name:"commentBlock",addGlobalAttributes(){return[{types:zh,attributes:{commentIds:{default:[],parseHTML:r=>We(r.getAttribute("data-comment-ids")),renderHTML:r=>{const e=We(r.commentIds);if(e.length===0)return{};const t={"data-comment-ids":JSON.stringify(e),class:"pagely-comment-block"};return e.length>1&&(t["data-comment-count"]=String(e.length)),t}}}}]}});function Dh(r){return r.filter(e=>e.type.name!=="commentMark")}function Xu(r){const e=Dh(r.marks);if(r.isText)return r.mark(e);const t=Array.isArray(r.attrs.commentIds)&&r.attrs.commentIds.length>0?{...r.attrs,commentIds:[]}:r.attrs,n=[];return r.content.forEach(o=>{n.push(Xu(o))}),r.type.create(t,Vn.Fragment.fromArray(n),e)}function Oh(r){const e=[];return r.content.forEach(t=>{e.push(Xu(t))}),new Vn.Slice(Vn.Fragment.fromArray(e),r.openStart,r.openEnd)}const ju=Me.Mark.create({name:"commentMark",priority:1001,inclusive:!1,addAttributes(){return{commentIds:{default:[],parseHTML:r=>We(r.getAttribute("data-comment-ids")),renderHTML:r=>({"data-comment-ids":JSON.stringify(We(r.commentIds))})}}},parseHTML(){return[{tag:"span[data-comment-ids]"}]},renderHTML({HTMLAttributes:r}){const e=We(r["data-comment-ids"]),t={class:"pagely-comment-inline"};return e.length>1&&(t["data-comment-count"]=String(e.length)),["span",Me.mergeAttributes(t,r),0]},addProseMirrorPlugins(){return[new mr.Plugin({key:new mr.PluginKey("commentPasteStrip"),props:{transformPasted(r){return Oh(r)}}})]}});function hi(r,e){const t=We(e.attrs.commentIds);if(t.length>0){r.classList.add("pagely-comment-block"),r.setAttribute("data-comment-ids",JSON.stringify(t)),t.length>1?r.setAttribute("data-comment-count",String(t.length)):r.removeAttribute("data-comment-count");return}r.classList.remove("pagely-comment-block"),r.removeAttribute("data-comment-ids"),r.removeAttribute("data-comment-count")}class Rh extends Kr.TableView{constructor(e,t,n){super(e,t),hi(this.dom,e)}update(e){return super.update(e)?(hi(this.dom,e),!0):!1}}const Ph={class:"eb-shell"},Hh={class:"eb-label"},Vh={key:0,class:"eb-copy-tip"},Fh={key:0,class:"eb-copy-tip"},$h={class:"eb-label"},Ea=a.defineComponent({__name:"EmbedBlockShell",props:{label:{},fullscreen:{type:Boolean,default:!1},beforeCloseFullscreen:{},canCopySource:{type:Boolean,default:!0},canCopyImage:{type:Boolean,default:!1},canFullscreen:{type:Boolean,default:!0},fullscreenCloseLabel:{default:"完成"}},emits:["update:fullscreen","copy-source","copy-image"],setup(r,{expose:e,emit:t}){const n=t,o=a.ref(!1),l=a.ref(!1);let i=null,s=null;function u(p){const v=p==="source"?o:l,b=p==="source"?i:s;b&&clearTimeout(b),v.value=!0;const w=setTimeout(()=>{v.value=!1,p==="source"?i=null:s=null},1500);p==="source"?i=w:s=w}function d(){n("update:fullscreen",!0)}function m(){n("copy-source")}function h(){n("copy-image")}return e({showCopyTip:u}),a.onBeforeUnmount(()=>{i&&clearTimeout(i),s&&clearTimeout(s)}),(p,v)=>(a.openBlock(),a.createElementBlock("div",Ph,[a.createElementVNode("div",{class:"eb-toolbar",onMousedown:v[0]||(v[0]=a.withModifiers(()=>{},["prevent"]))},[a.createElementVNode("span",Hh,a.toDisplayString(r.label),1),a.renderSlot(p.$slots,"toolbar-before-actions"),v[2]||(v[2]=a.createElementVNode("div",{class:"eb-spacer"},null,-1)),a.renderSlot(p.$slots,"toolbar-extra"),r.canCopyImage?(a.openBlock(),a.createElementBlock("button",{key:0,class:"eb-btn",type:"button",title:"复制为图片",onClick:h},[a.createVNode(a.unref(L.Image),{size:14,"stroke-width":1.4}),l.value?(a.openBlock(),a.createElementBlock("span",Vh,"已复制")):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),r.canCopySource?(a.openBlock(),a.createElementBlock("button",{key:1,class:"eb-btn",type:"button",title:"复制源码",onClick:m},[a.createVNode(a.unref(L.Copy),{size:14,"stroke-width":1.4}),o.value?(a.openBlock(),a.createElementBlock("span",Fh,"已复制")):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),r.canFullscreen?(a.openBlock(),a.createElementBlock("button",{key:2,class:"eb-btn",type:"button",title:"全屏",onClick:d},[a.createVNode(a.unref(L.Maximize2),{size:14,"stroke-width":1.4})])):a.createCommentVNode("",!0)],32),a.renderSlot(p.$slots,"inline"),r.canFullscreen?(a.openBlock(),a.createBlock(ho,{key:0,open:r.fullscreen,"before-close":r.beforeCloseFullscreen,"close-label":r.fullscreenCloseLabel,"onUpdate:open":v[1]||(v[1]=b=>n("update:fullscreen",b))},{toolbar:a.withCtx(()=>[a.createElementVNode("span",$h,a.toDisplayString(r.label),1)]),body:a.withCtx(()=>[a.renderSlot(p.$slots,"fullscreen")]),_:3},8,["open","before-close","close-label"])):a.createCommentVNode("",!0)]))}}),qh={key:1,class:"dfp-preview-overlay"},Uh=a.defineComponent({__name:"DotFlowPadBlockView",props:{decorations:{},selected:{type:Boolean},updateAttributes:{type:Function},deleteNode:{type:Function},node:{},view:{},getPos:{},innerDecorations:{},editor:{},extension:{},HTMLAttributes:{}},setup(r){const e=r,{commentAttrs:t,commentClass:n}=hn(()=>e.node.attrs),o=a.ref(null),l=a.ref(null),i=a.ref(null),s=a.ref(null),u=a.ref(!1),d=a.ref(null),{copyPngToClipboard:m}=lo(),h=a.computed(()=>e.editor.isEditable),p=a.ref(!1);a.onMounted(()=>a.nextTick(()=>{p.value=!0,h.value&&e.node.attrs.autoOpen&&(a.nextTick(()=>w()),b({autoOpen:!1}))}));const v=a.computed(()=>{try{return JSON.parse(e.node.attrs.data)}catch{return{nodes:[],edges:[]}}});a.watch(v,B=>{!u.value&&o.value&&(o.value.setData(B),setTimeout(()=>{var D,z;return(z=(D=o.value)==null?void 0:D.fitView)==null?void 0:z.call(D)},100))});function b(B){var A,R;const D=(A=e.getPos)==null?void 0:A.call(e);if(D===void 0||!((R=e.editor)!=null&&R.view))return;const{state:z,dispatch:W}=e.editor.view,H=z.doc.nodeAt(D);H&&W(z.tr.setNodeMarkup(D,void 0,{...H.attrs,...B}))}function w(){u.value=!0}function k(){h.value&&w()}function T(){var D;if(!h.value)return;const B=(D=l.value)==null?void 0:D.getData();B&&(b({data:JSON.stringify(B)}),a.nextTick(()=>{var z;(z=o.value)==null||z.setData(B),setTimeout(()=>{var W,H;return(H=(W=o.value)==null?void 0:W.fitView)==null?void 0:H.call(W)},100)}))}async function E(){var B;try{await navigator.clipboard.writeText(e.node.attrs.data),(B=d.value)==null||B.showCopyTip("source")}catch{}}async function M(){var z;const B=u.value?s.value:i.value;await m(()=>rs(B))&&((z=d.value)==null||z.showCopyTip("image"))}return(B,D)=>(a.openBlock(),a.createBlock(a.unref(_e.NodeViewWrapper),a.mergeProps({"data-type":"dot-flow-pad",class:a.unref(n)},a.unref(t)),{default:a.withCtx(()=>[a.createVNode(Ea,{ref_key:"shellRef",ref:d,class:"dot-flow-pad-block-wrap",label:"画板",fullscreen:u.value,"onUpdate:fullscreen":D[0]||(D[0]=z=>u.value=z),"before-close-fullscreen":T,"can-copy-source":!0,"can-copy-image":!0,"can-fullscreen":!0,onCopySource:E,onCopyImage:M},{inline:a.withCtx(()=>[a.createElementVNode("div",{ref_key:"inlineWrap",ref:i,class:"dfp-canvas-wrap dfp-preview",onClick:k},[p.value?(a.openBlock(),a.createBlock(a.unref(Ga.DotFlowPad),{key:0,ref_key:"inlineRef",ref:o,"initial-data":v.value,readonly:!0,class:"dfp-preview-canvas"},null,8,["initial-data"])):a.createCommentVNode("",!0),h.value?(a.openBlock(),a.createElementBlock("div",qh,[a.createVNode(a.unref(L.Maximize2),{size:20,"stroke-width":1.4}),D[1]||(D[1]=a.createElementVNode("span",null,"点击编辑",-1))])):a.createCommentVNode("",!0)],512)]),fullscreen:a.withCtx(()=>[a.createElementVNode("div",{ref_key:"fullscreenWrap",ref:s,class:"dfp-fullscreen-canvas"},[u.value?(a.openBlock(),a.createBlock(a.unref(Ga.DotFlowPad),{key:0,ref_key:"fullscreenRef",ref:l,"initial-data":v.value,readonly:!h.value},null,8,["initial-data","readonly"])):a.createCommentVNode("",!0)],512)]),_:1},8,["fullscreen"])]),_:1},16,["class"]))}}),gt=(r,e)=>{const t=r.__vccOpts||r;for(const[n,o]of e)t[n]=o;return t},Wh=gt(Uh,[["__scopeId","data-v-50011b37"]]),Qu=Me.Node.create({name:"dotFlowPadBlock",content:"",marks:"",group:"block",atom:!0,defining:!0,isolating:!0,addAttributes(){return{data:{default:JSON.stringify({nodes:[],edges:[]}),parseHTML:r=>r.getAttribute("data-graph")??JSON.stringify({nodes:[],edges:[]}),renderHTML:r=>({"data-graph":r.data})},autoOpen:{default:!1,parseHTML:()=>!1,renderHTML:()=>({})}}},parseHTML(){return[{tag:'div[data-type="dot-flow-pad"]'}]},renderHTML({HTMLAttributes:r}){return["div",Me.mergeAttributes(r,{"data-type":"dot-flow-pad"})]},addNodeView(){return _e.VueNodeViewRenderer(Wh)},addCommands(){return{insertDotFlowPadBlock:()=>({commands:r})=>r.insertContent({type:this.name,attrs:{data:JSON.stringify({nodes:[],edges:[]}),autoOpen:!0}})}}}),_h='.ProseMirror p{margin:3px 0}.ProseMirror p.is-empty:before,.ProseMirror p:first-child:empty:before{content:attr(data-placeholder);float:left;color:#bbbfc4;pointer-events:none;height:0}.ProseMirror h1{font-size:1.875em;font-weight:700;margin:28px 0 6px;color:#1f2329;line-height:1.4}.ProseMirror h2{font-size:1.375em;font-weight:600;margin:22px 0 4px;color:#1f2329;line-height:1.5}.ProseMirror h3{font-size:1.125em;font-weight:600;margin:16px 0 3px;color:#1f2329}.ProseMirror h4{font-size:1em;font-weight:600;margin:12px 0 2px;color:#1f2329}.ProseMirror h5{font-size:.925em;font-weight:600;margin:10px 0 2px;color:#646a73}.ProseMirror h6{font-size:.875em;font-weight:600;margin:8px 0 2px;color:#646a73}.ProseMirror>h1:first-child{font-size:2.125em;margin-top:8px}.ProseMirror code{background:#1c73e812;border:1px solid rgba(28,115,232,.18);border-radius:4px;padding:1px 4px;font-size:.875em;font-family:monospace;color:#3370ff}.ProseMirror blockquote{border-left:3px solid #dee0e3;margin:6px 0;padding:2px 14px;color:#646a73}.ProseMirror ul,.ProseMirror ol{padding-left:1.5em;margin:4px 0}.ProseMirror li{margin:2px 0}.ProseMirror ol{list-style-type:decimal}.ProseMirror ol ol{list-style-type:lower-latin}.ProseMirror ol ol ol{list-style-type:lower-roman}.ProseMirror ol ol ol ol{list-style-type:decimal}.ProseMirror ol ol ol ol ol{list-style-type:lower-latin}.ProseMirror ol ol ol ol ol ol{list-style-type:lower-roman}.ProseMirror hr{border:none;border-top:1px solid #dee0e3;margin:16px 0}.ProseMirror a.pm-link{color:#3370ff;text-decoration:underline;text-underline-offset:2px;cursor:pointer}.ProseMirror a.pm-link:hover{color:#2860de}.link-loading-icon{display:inline-flex;align-items:center;vertical-align:middle;margin-left:1px;color:#8f959e;pointer-events:none;-webkit-user-select:none;user-select:none}.link-loading-icon svg{animation:link-spin .75s linear infinite}@keyframes link-spin{to{transform:rotate(360deg)}}.heading-collapsed-content{display:none!important}.ProseMirror ul[data-type=taskList]{list-style:none;padding-left:.5em}.ProseMirror ul[data-type=taskList] li{display:flex;align-items:flex-start;gap:8px}.ProseMirror ul[data-type=taskList] li>label{flex-shrink:0;margin-top:3px}.ProseMirror ul[data-type=taskList] li input[type=checkbox]{cursor:pointer}.ProseMirror ul[data-type=taskList] li>div{flex:1}.ProseMirror ul[data-type=taskList] li>div>p{margin:0}.ProseMirror ul[data-type=taskList] li[data-checked=true]>div{color:#8f959e;text-decoration:line-through}.ProseMirror table{border-collapse:collapse;width:100%;margin:10px 0;table-layout:fixed}.ProseMirror td,.ProseMirror th{border:1px solid #dee0e3;padding:7px 12px;min-width:80px;vertical-align:top;position:relative;transition:background .1s}.ProseMirror th{background:#f4f5f6;font-weight:600;text-align:left;color:#1f2329;font-size:.9em}.ProseMirror td>p,.ProseMirror th>p{margin:0}.ProseMirror .selectedCell:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;background:#3370ff1a;pointer-events:none}.ProseMirror .column-resize-handle{position:absolute;right:-2px;top:0;bottom:0;width:4px;background-color:#3370ff;cursor:col-resize;pointer-events:all;z-index:1}.ProseMirror table:hover{box-shadow:0 0 0 2px #3370ff38;border-radius:2px}.code-block-cm{background:#f4f5f6;margin:8px 0}.code-block-cm.is-collapsed .cm-editor-wrap{display:none}.cm-title-input{flex:1;min-width:0;border:none;background:transparent;font-size:12px;color:#1f2329;outline:none;padding:2px 4px}.cm-title-input::placeholder{color:#bbbfc4}.cm-title-input--fullscreen{max-width:260px}.cm-lang-select{border:1px solid #dee0e3;border-radius:4px;background:#fff;font-size:11px;color:#646a73;padding:2px 4px;cursor:pointer;outline:none;max-width:110px}.cm-lang-select:hover{border-color:#3370ff}.cm-chevron{transition:transform .15s ease}.cm-chevron.collapsed{transform:rotate(-90deg)}.cm-editor-wrap{overflow:hidden}.cm-editor-wrap .cm-editor{max-height:600px}.cm-editor-wrap--fullscreen{height:100%;background:#f4f5f6}.cm-editor-wrap--fullscreen .cm-editor{height:100%;max-height:none}.cm-editor-wrap--fullscreen .cm-scroller{height:100%}.ProseMirror>.code-block-cm:hover{background:#f4f5f6}.wl-toolbar{position:fixed;display:flex;align-items:center;gap:2px;height:44px;padding:0 8px;background:#fff;border:1px solid rgba(28,31,35,.1);border-radius:6px;box-shadow:0 3px 10px #0000001f;z-index:9999;white-space:nowrap}.wl-tb-url{display:inline-block;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;color:#646a73;background:#f4f5f6;border:1px solid #e4e5e7;border-radius:4px;padding:2px 7px;margin-right:2px}.wl-tb-btn{display:flex;align-items:center;justify-content:center;width:30px;height:30px;border:none;background:transparent;border-radius:4px;color:#646a73;cursor:pointer;padding:0;flex-shrink:0}.wl-tb-btn:hover{background:#1c73e814;color:#3370ff}.wl-tb-sep{width:1px;height:20px;background:#e4e5e7;margin:0 4px;flex-shrink:0}.wl-view-wrap{position:relative}.wl-tb-view-btn{display:flex;align-items:center;gap:4px;height:30px;padding:0 8px;border:none;background:transparent;border-radius:4px;font-size:12px;color:#1f2329;cursor:pointer;white-space:nowrap}.wl-tb-view-btn:hover{background:#1c73e814}.wl-tb-view-btn span{color:#1f2329}.wl-chev{color:#8f959e;transition:transform .15s;flex-shrink:0}.wl-chev.open{transform:rotate(180deg)}.wl-view-menu{position:absolute;top:calc(100% + 4px);right:0;min-width:148px;background:#fff;border:1px solid rgba(28,31,35,.1);border-radius:8px;box-shadow:0 4px 16px #0000001f;padding:4px 0;z-index:10000}.wl-view-sep{height:1px;margin:4px 6px;background:#eef0f4}.wl-view-item{display:flex;align-items:center;gap:8px;width:100%;height:34px;padding:0 12px;border:none;background:transparent;font-size:13px;color:#1f2329;cursor:pointer;text-align:left}.wl-view-item:hover{background:#1c73e80f}.wl-view-item.active .wl-vi-icon{color:#3370ff}.wl-vi-icon{color:#646a73;flex-shrink:0}.wl-vi-check{margin-left:auto;flex-shrink:0}.wl-edit-input{flex:1;min-width:220px;height:26px;border:1px solid #3370ff;border-radius:4px;padding:0 8px;font-size:13px;color:#1f2329;outline:none}.wl-edit-ok{height:26px;padding:0 10px;background:#3370ff;color:#fff;border:none;border-radius:4px;font-size:12px;cursor:pointer}.wl-edit-ok:hover{background:#2860de}.wl-edit-cancel{height:26px;padding:0 8px;background:transparent;color:#646a73;border:1px solid #e4e5e7;border-radius:4px;font-size:12px;cursor:pointer}.wl-edit-cancel:hover{border-color:#c4c9d4;color:#1f2329}.sel-toolbar{position:fixed;display:flex;align-items:center;gap:1px;height:42px;padding:0 8px;background:#fff;border:1px solid rgba(28,31,35,.1);border-radius:6px;box-shadow:#1f23291a 0 4px 8px;z-index:9998;white-space:nowrap;-webkit-user-select:none;user-select:none}.sel-btn{display:inline-flex;align-items:center;justify-content:center;gap:3px;height:28px;min-width:28px;padding:0 5px;border:none;border-radius:4px;background:transparent;color:#1f2329;cursor:pointer;font-size:13px;line-height:1}.sel-btn:hover:not(:disabled){background:#1c73e814;color:#3370ff}.sel-btn.active{color:#3370ff}.sel-btn:disabled,.sel-btn.disabled{opacity:.35;cursor:not-allowed}.sel-sep{width:1px;height:20px;background:#dee0e3;margin:0 3px;flex-shrink:0}.sel-btn--type{padding:0 6px;gap:4px}.sel-type-label{font-size:12px;color:inherit;line-height:1}.sel-chev{color:#8f959e;transition:transform .15s;flex-shrink:0}.sel-chev.open{transform:rotate(180deg)}.sel-type-wrap{position:relative}.sel-dropdown{position:absolute;top:calc(100% + 5px);left:0;min-width:120px;background:#fff;border:1px solid rgba(28,31,35,.1);border-radius:6px;box-shadow:0 3px 10px #0000001f;padding:4px;z-index:10000}.sel-dd-item{display:flex;align-items:center;gap:8px;width:100%;height:32px;padding:0 8px;border:none;border-radius:4px;background:transparent;color:#1f2329;cursor:pointer;font-size:13px;text-align:left}.sel-dd-item:hover{background:#1c73e80f}.sel-dd-item.active .sel-dd-icon{color:#3370ff}.sel-dd-icon{color:#646a73;flex-shrink:0}.sel-dd-check{margin-left:auto;flex-shrink:0}.sel-btn--color{padding:0 5px;gap:2px}.sel-color-wrap{position:relative}.sel-color-panel{position:absolute;top:calc(100% + 5px);left:50%;transform:translate(-50%);z-index:10000}.sel-link-input{height:26px;width:220px;padding:0 8px;border:1px solid #3370ff;border-radius:4px;font-size:13px;color:#1f2329;outline:none}.sel-link-ok{height:26px;padding:0 10px;margin-left:4px;background:#3370ff;color:#fff;border:none;border-radius:4px;font-size:12px;cursor:pointer}.sel-link-ok:hover{background:#2860de}.sel-link-cancel{height:26px;padding:0 8px;margin-left:2px;background:transparent;color:#646a73;border:1px solid #e4e5e7;border-radius:4px;font-size:12px;cursor:pointer}.sel-link-cancel:hover{border-color:#c4c9d4;color:#1f2329}.mermaid-block-wrap{margin:8px 0;border:1px solid #e4e5e7;border-radius:6px;overflow:hidden;background:#f4f5f6}.cm-lang-label{font-size:12px;color:#8f959e;padding:0 6px}.mermaid-preview{padding:20px;background:#fff;min-height:120px;display:flex;align-items:center;justify-content:center}.mermaid-svg-container{width:100%;display:flex;justify-content:center;overflow:auto;max-height:500px}.mermaid-svg-container :deep(svg){max-width:100%;height:auto}.mermaid-error{display:flex;align-items:center;gap:8px;color:#c0392b;padding:12px;background:#ff4d4f14;border-radius:4px;font-size:13px;font-family:monospace}.mermaid-block-wrap .mep-root{height:400px}.mermaid-fullscreen-panel{display:flex;flex-direction:column;height:100%;min-height:0}.mermaid-fullscreen-panel .mep-root{flex:1;height:100%;min-height:0}.mermaid-error--fullscreen{margin:12px;flex-shrink:0}.ProseMirror>.mermaid-block-wrap:hover{background:#f4f5f6}.ProseMirror>[data-type=mermaid-block]:hover,.ProseMirror>[data-type=dot-flow-pad]:hover,.ProseMirror>[data-type=image-block]:hover{background:none}.mermaid-preview--fullscreen{height:100%;min-height:0}.pagely-editor-wrap{max-width:860px;margin:0 auto;padding:60px 80px max(320px,56vh) 100px;position:relative;flex:0 0 auto}.pagely-document-end{display:flex;align-items:center;gap:10px;margin-top:48px;pointer-events:none;-webkit-user-select:none;user-select:none}.pagely-document-end:before,.pagely-document-end:after{content:"";height:1px;flex:1;background:linear-gradient(90deg,transparent,#dfe3e8)}.pagely-document-end:after{background:linear-gradient(90deg,#dfe3e8,transparent)}.pagely-document-end-mark{width:4px;height:4px;border-radius:999px;background:#c8ced6;box-shadow:0 0 0 4px #fff;flex:0 0 auto}.ProseMirror{outline:none;line-height:1.75;font-size:15px;color:#1f2329;caret-color:#3370ff}.ProseMirror>*:hover,.ProseMirror td:hover>*,.ProseMirror th:hover>*{background:#1c73e80a;border-radius:3px}.ProseMirror>pre:hover,.ProseMirror>table:hover{background:none}.ProseMirror ::selection{background:#3370ff2e}',Gh=".ProseMirror p{margin:3px 0}.ProseMirror p.is-empty:before,.ProseMirror p:first-child:empty:before{content:attr(data-placeholder);float:left;color:#bbbfc4;pointer-events:none;height:0}.ProseMirror h1{font-size:1.875em;font-weight:700;margin:28px 0 6px;color:#1f2329;line-height:1.4}.ProseMirror h2{font-size:1.375em;font-weight:600;margin:22px 0 4px;color:#1f2329;line-height:1.5}.ProseMirror h3{font-size:1.125em;font-weight:600;margin:16px 0 3px;color:#1f2329}.ProseMirror h4{font-size:1em;font-weight:600;margin:12px 0 2px;color:#1f2329}.ProseMirror h5{font-size:.925em;font-weight:600;margin:10px 0 2px;color:#646a73}.ProseMirror h6{font-size:.875em;font-weight:600;margin:8px 0 2px;color:#646a73}.ProseMirror>h1:first-child{font-size:2.125em;margin-top:8px}.ProseMirror code{background:#1c73e812;border:1px solid rgba(28,115,232,.18);border-radius:4px;padding:1px 4px;font-size:.875em;font-family:monospace;color:#3370ff}.ProseMirror blockquote{border-left:3px solid #dee0e3;margin:6px 0;padding:2px 14px;color:#646a73}.ProseMirror ul,.ProseMirror ol{padding-left:1.5em;margin:4px 0}.ProseMirror li{margin:2px 0}.ProseMirror ol{list-style-type:decimal}.ProseMirror ol ol{list-style-type:lower-latin}.ProseMirror ol ol ol{list-style-type:lower-roman}.ProseMirror ol ol ol ol{list-style-type:decimal}.ProseMirror ol ol ol ol ol{list-style-type:lower-latin}.ProseMirror ol ol ol ol ol ol{list-style-type:lower-roman}.ProseMirror hr{border:none;border-top:1px solid #dee0e3;margin:16px 0}.ProseMirror a.pm-link{color:#3370ff;text-decoration:underline;text-underline-offset:2px;cursor:pointer}.ProseMirror a.pm-link:hover{color:#2860de}.link-loading-icon{display:inline-flex;align-items:center;vertical-align:middle;margin-left:1px;color:#8f959e;pointer-events:none;-webkit-user-select:none;user-select:none}.link-loading-icon svg{animation:link-spin .75s linear infinite}@keyframes link-spin{to{transform:rotate(360deg)}}.heading-collapsed-content{display:none!important}.ProseMirror ul[data-type=taskList]{list-style:none;padding-left:.5em}.ProseMirror ul[data-type=taskList] li{display:flex;align-items:flex-start;gap:8px}.ProseMirror ul[data-type=taskList] li>label{flex-shrink:0;margin-top:3px}.ProseMirror ul[data-type=taskList] li input[type=checkbox]{cursor:pointer}.ProseMirror ul[data-type=taskList] li>div{flex:1}.ProseMirror ul[data-type=taskList] li>div>p{margin:0}.ProseMirror ul[data-type=taskList] li[data-checked=true]>div{color:#8f959e;text-decoration:line-through}",Kh='.ProseMirror table{border-collapse:collapse;width:100%;margin:10px 0;table-layout:fixed}.ProseMirror td,.ProseMirror th{border:1px solid #dee0e3;padding:7px 12px;min-width:80px;vertical-align:top;position:relative;transition:background .1s}.ProseMirror th{background:#f4f5f6;font-weight:600;text-align:left;color:#1f2329;font-size:.9em}.ProseMirror td>p,.ProseMirror th>p{margin:0}.ProseMirror .selectedCell:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;background:#3370ff1a;pointer-events:none}.ProseMirror .column-resize-handle{position:absolute;right:-2px;top:0;bottom:0;width:4px;background-color:#3370ff;cursor:col-resize;pointer-events:all;z-index:1}.ProseMirror table:hover{box-shadow:0 0 0 2px #3370ff38;border-radius:2px}',Yh=".code-block-cm{background:#f4f5f6;margin:8px 0}.code-block-cm.is-collapsed .cm-editor-wrap{display:none}.cm-title-input{flex:1;min-width:0;border:none;background:transparent;font-size:12px;color:#1f2329;outline:none;padding:2px 4px}.cm-title-input::placeholder{color:#bbbfc4}.cm-title-input--fullscreen{max-width:260px}.cm-lang-select{border:1px solid #dee0e3;border-radius:4px;background:#fff;font-size:11px;color:#646a73;padding:2px 4px;cursor:pointer;outline:none;max-width:110px}.cm-lang-select:hover{border-color:#3370ff}.cm-chevron{transition:transform .15s ease}.cm-chevron.collapsed{transform:rotate(-90deg)}.cm-editor-wrap{overflow:hidden}.cm-editor-wrap .cm-editor{max-height:600px}.cm-editor-wrap--fullscreen{height:100%;background:#f4f5f6}.cm-editor-wrap--fullscreen .cm-editor{height:100%;max-height:none}.cm-editor-wrap--fullscreen .cm-scroller{height:100%}.ProseMirror>.code-block-cm:hover{background:#f4f5f6}",Jh=".mermaid-block-wrap{margin:8px 0;border:1px solid #e4e5e7;border-radius:6px;overflow:hidden;background:#f4f5f6}.cm-lang-label{font-size:12px;color:#8f959e;padding:0 6px}.mermaid-preview{padding:20px;background:#fff;min-height:120px;display:flex;align-items:center;justify-content:center}.mermaid-svg-container{width:100%;display:flex;justify-content:center;overflow:auto;max-height:500px}.mermaid-svg-container :deep(svg){max-width:100%;height:auto}.mermaid-error{display:flex;align-items:center;gap:8px;color:#c0392b;padding:12px;background:#ff4d4f14;border-radius:4px;font-size:13px;font-family:monospace}.mermaid-block-wrap .mep-root{height:400px}.mermaid-fullscreen-panel{display:flex;flex-direction:column;height:100%;min-height:0}.mermaid-fullscreen-panel .mep-root{flex:1;height:100%;min-height:0}.mermaid-error--fullscreen{margin:12px;flex-shrink:0}.ProseMirror>.mermaid-block-wrap:hover{background:#f4f5f6}.ProseMirror>[data-type=mermaid-block]:hover,.ProseMirror>[data-type=dot-flow-pad]:hover,.ProseMirror>[data-type=image-block]:hover{background:none}.mermaid-preview--fullscreen{height:100%;min-height:0}",Xh=`
308
+ html,body{margin:0;background:#fff;}
309
+ body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;}
310
+ .pagely-md-preview{max-width:860px;margin:0 auto;padding:28px 40px 56px;}
311
+ .pagely-md-preview .ProseMirror>*:hover{background:none;}
312
+ @media (max-width:640px){.pagely-md-preview{padding:22px 22px 44px;}.ProseMirror{font-size:14px;}}
313
+ `,jh=[_h,Gh,Kh,Yh,Jh,Xh].join(`
314
+ `);function Qh(r){return['<!doctype html><html><head><meta charset="utf-8"><base target="_blank">',"<style>",jh,"</style></head><body>",'<main class="pagely-md-preview"><article class="ProseMirror">',r,"</article></main>","</body></html>"].join("")}function pi(r){return{title:null,favicon:null,domain:Dr(r)}}function Zh(r,e){if(!e)return null;try{return new URL(e,r).href}catch{return null}}function ep(r,e){const n=Array.from(r.querySelectorAll("link[rel]")).find(i=>{var u;return(((u=i.getAttribute("rel"))==null?void 0:u.toLowerCase())??"").split(/\s+/).some(d=>["icon","shortcut","apple-touch-icon"].includes(d))}),o=Zh(e,(n==null?void 0:n.getAttribute("href"))??null);if(o)return o;const l=Dr(e);return l?`https://${l}/favicon.ico`:null}async function tp(r,e){var t,n;if(!Hr(r))return pi(r);try{const o=await fetch(r,{signal:e});if(!o.ok)throw new Error(`HTTP ${o.status}`);const l=await o.text(),i=new DOMParser().parseFromString(l,"text/html");return{title:((n=(t=i.querySelector("title"))==null?void 0:t.textContent)==null?void 0:n.trim())||null,favicon:ep(i,r),domain:Dr(r)}}catch{return pi(r)}}async function rp(r,e){const t=await fetch(r,{signal:e});if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.text()}function np(r){return Wn(dn(r))}function op(r){var e;return((e=cr({href:r.href,label:r.label,preferredView:r.view}))==null?void 0:e.view)??"link"}function dl(r){return r.label||Fn(r.href)||r.href}function lp(r){var t;if((t=navigator.clipboard)!=null&&t.writeText)return navigator.clipboard.writeText(r);const e=document.createElement("textarea");return e.value=r,e.style.cssText="position:fixed;opacity:0;pointer-events:none",document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e),Promise.resolve()}function ap(r){const e=a.computed(()=>r.getAttrs()),t=a.computed(()=>Yi(e.value.href,e.value.label)),n=a.computed(()=>op(e.value)),o=a.ref(null),l=a.ref(!1),i=a.ref(null),s=a.ref(!1),u=a.ref(null),d=a.ref(!1),m=a.ref(!1);let h=null,p=null,v=null;a.watch(()=>e.value.href,()=>{h==null||h.abort(),p==null||p.abort(),o.value=null,l.value=!1,i.value=null,s.value=!1,u.value=null});function b(){if(o.value||l.value)return;const z=e.value;if(z.href){if(t.value!=="url"){o.value={title:dl(z),favicon:null,domain:Dr(z.href)};return}h==null||h.abort(),h=new AbortController,l.value=!0,tp(z.href,h.signal).then(W=>{o.value=W}).catch(()=>{o.value={title:null,favicon:null,domain:Dr(z.href)}}).finally(()=>{l.value=!1})}}function w(){if(t.value!=="md"||i.value||s.value)return;const z=e.value;p==null||p.abort(),p=new AbortController,s.value=!0,u.value=null,rp(z.href,p.signal).then(W=>{i.value=np(W)}).catch(W=>{W instanceof DOMException&&W.name==="AbortError"||(u.value=`无法加载: ${dl(z)}`)}).finally(()=>{s.value=!1})}function k(z){r.updateAttrs({view:z})}async function T(){try{await lp(e.value.href),m.value=!0,v&&clearTimeout(v),v=setTimeout(()=>{m.value=!1,v=null},1500)}catch{}}function E(){const z=e.value,W=document.createElement("a");W.href=z.href,W.download=dl(z),W.rel="noopener noreferrer",document.body.appendChild(W),W.click(),document.body.removeChild(W)}function M(){window.open(e.value.href,"_blank","noopener,noreferrer")}function B(){var z;(z=r.replaceWithText)==null||z.call(r)}function D(z){d.value=z}return a.onBeforeUnmount(()=>{h==null||h.abort(),p==null||p.abort(),v&&clearTimeout(v)}),{fileType:t,currentView:n,metadata:o,metadataLoading:l,loadMetadataIfNeeded:b,mdHtml:i,mdLoading:s,mdError:u,loadMdIfNeeded:w,setView:k,copyLink:T,download:E,openInNewTab:M,removeLink:B,toggleFullscreen:D,fullscreen:d,copyTip:m}}const ip=["title"],sp=["title","onClick"],up=["title"],cp=a.defineComponent({__name:"EmbedViewToolbar",props:{label:{},currentView:{},fileType:{},canPreview:{type:Boolean},copyTip:{type:Boolean}},emits:["set-view","fullscreen","download","copy","open","remove"],setup(r){const e=r,t=[{view:"link",title:"链接视图",icon:L.Link2},{view:"card",title:"卡片视图",icon:L.LayoutPanelTop},{view:"preview",title:"预览视图",icon:L.Eye}],n=a.computed(()=>t.filter(l=>l.view!=="preview"||e.canPreview)),o=a.computed(()=>e.fileType==="pdf"||e.fileType==="md");return(l,i)=>(a.openBlock(),a.createElementBlock("div",{class:"pagely-embed-toolbar",onMousedown:i[5]||(i[5]=a.withModifiers(()=>{},["prevent"]))},[a.createElementVNode("span",{class:"pagely-embed-toolbar__label",title:r.label},a.toDisplayString(r.label),9,ip),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.value,s=>(a.openBlock(),a.createElementBlock("button",{key:s.view,class:a.normalizeClass(["pagely-embed-btn",{"is-active":r.currentView===s.view}]),type:"button",title:s.title,onClick:u=>l.$emit("set-view",s.view)},[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(s.icon),{size:16,"stroke-width":1.6}))],10,sp))),128)),i[6]||(i[6]=a.createElementVNode("span",{class:"pagely-embed-toolbar__sep"},null,-1)),o.value?(a.openBlock(),a.createElementBlock("button",{key:0,class:"pagely-embed-btn",type:"button",title:"全屏",onClick:i[0]||(i[0]=s=>l.$emit("fullscreen"))},[a.createVNode(a.unref(L.Maximize2),{size:16,"stroke-width":1.8})])):a.createCommentVNode("",!0),o.value?(a.openBlock(),a.createElementBlock("button",{key:1,class:"pagely-embed-btn",type:"button",title:"下载",onClick:i[1]||(i[1]=s=>l.$emit("download"))},[a.createVNode(a.unref(L.Download),{size:16,"stroke-width":1.8})])):a.createCommentVNode("",!0),o.value?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("button",{key:2,class:"pagely-embed-btn",type:"button",title:"新窗口打开",onClick:i[2]||(i[2]=s=>l.$emit("open"))},[a.createVNode(a.unref(L.ExternalLink),{size:16,"stroke-width":1.8})])),a.createElementVNode("button",{class:"pagely-embed-btn",type:"button",title:r.copyTip?"已复制":"复制链接",onClick:i[3]||(i[3]=s=>l.$emit("copy"))},[r.copyTip?(a.openBlock(),a.createBlock(a.unref(L.Check),{key:0,size:16,"stroke-width":2})):(a.openBlock(),a.createBlock(a.unref(L.Copy),{key:1,size:16,"stroke-width":1.8}))],8,up),o.value?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("button",{key:3,class:"pagely-embed-btn",type:"button",title:"移除链接",onClick:i[4]||(i[4]=s=>l.$emit("remove"))},[a.createVNode(a.unref(L.Link2Off),{size:16,"stroke-width":1.8})]))],32))}}),dp=["href"],fp={class:"pagely-embed-link__title"},mp={class:"pagely-embed-link__href"},hp=["title"],pp={class:"pagely-embed-card__icon"},gp=["src"],vp={class:"pagely-embed-card__body"},bp={class:"pagely-embed-card__title"},yp={class:"pagely-embed-card__meta"},wp={key:2,class:"pagely-embed-preview"},kp={key:0,class:"pagely-embed-error"},xp={key:1,class:"pagely-embed-preview__loading"},Cp=["srcdoc"],Tp=["title","src"],Ep={class:"eb-label"},Sp={class:"pagely-embed-fullscreen"},Mp={key:0,class:"pagely-embed-error"},Ap=["srcdoc"],Bp=["title","src"],Np=a.defineComponent({__name:"EmbedViewBlock",props:{decorations:{},selected:{type:Boolean},updateAttributes:{type:Function},deleteNode:{type:Function},node:{},view:{},getPos:{},innerDecorations:{},editor:{},extension:{},HTMLAttributes:{}},setup(r){const e=r,{commentAttrs:t,commentClass:n}=hn(()=>e.node.attrs),o=a.ref(null),l=a.ref(""),i=a.ref(!1),s=a.ref(!1),u=a.ref(!1),d=a.ref({});let m=null,h=null;const{fileType:p,currentView:v,metadata:b,metadataLoading:w,loadMetadataIfNeeded:k,mdHtml:T,mdLoading:E,mdError:M,loadMdIfNeeded:B,setView:D,copyLink:z,download:W,openInNewTab:H,removeLink:A,toggleFullscreen:R,fullscreen:K,copyTip:J}=ap({getAttrs:()=>e.node.attrs,updateAttrs:ue=>e.updateAttributes(ue),replaceWithText:Xe}),te=a.computed(()=>String(e.node.attrs.href??"")),Z=a.computed(()=>String(e.node.attrs.label||Fn(te.value)||te.value)),le=a.computed(()=>{var ue;return p.value==="url"&&!!((ue=b.value)!=null&&ue.favicon)&&!i.value}),ee=a.computed(()=>{var ue;return((ue=b.value)==null?void 0:ue.title)||Z.value||Fn(te.value)||te.value}),we=a.computed(()=>{var ue;return((ue=b.value)==null?void 0:ue.domain)||Dr(te.value)}),pe=a.computed(()=>Qh(T.value??"")),se=a.computed(()=>en(te.value,Z.value)),I=a.computed(()=>p.value==="pdf"?P(te.value,"#toolbar=0&navpanes=0&view=FitH"):te.value);function P(ue,me){return ue&&(ue.indexOf("#")===-1?ue+me:ue)}a.watch([v,p,te],()=>{l.value="",v.value==="card"&&k(),v.value==="preview"&&p.value==="md"&&B(),V()},{immediate:!0}),a.watch(te,()=>{i.value=!1});function V(){m&&(clearTimeout(m),m=null),!(v.value!=="preview"||p.value!=="url")&&(m=setTimeout(()=>{l.value="该网页不允许嵌入预览",m=null},2e3))}function q(){window.dispatchEvent(new CustomEvent("pagely:hide-selection-toolbar"))}function ae(){q(),h&&(clearTimeout(h),h=null),s.value=!0,a.nextTick(oe)}function ge(){h&&clearTimeout(h),h=setTimeout(()=>{u.value||(s.value=!1),h=null},120)}function ne(){ae()}function N(ue){var Re;const me=ue.relatedTarget;(Re=me==null?void 0:me.closest)!=null&&Re.call(me,".pagely-embed-toolbar")||ge()}function O(){u.value=!0,h&&(clearTimeout(h),h=null),q()}function $(ue){u.value=!1;const me=ue.relatedTarget,Re=X();me&&(Re!=null&&Re.contains(me))||ge()}function X(){const ue=o.value;return ue instanceof HTMLElement?ue:(ue==null?void 0:ue.$el)instanceof HTMLElement?ue.$el:null}function oe(){const ue=X();if(!ue)return;const me=ue.getBoundingClientRect(),Re=360,Ke=44,St=8,Ht=window.innerWidth;let Mt=me.left+me.width/2-Re/2;Mt=Math.max(8,Math.min(Mt,Ht-Re-8));const br=me.top>=Ke+St+8?me.top-Ke-St:me.bottom+St;d.value={position:"fixed",top:`${br}px`,left:`${Mt}px`,zIndex:"9998"}}function ve(){m&&(clearTimeout(m),m=null)}function Be(){l.value=`无法加载: ${Z.value}`,m&&(clearTimeout(m),m=null)}function $e(){p.value==="md"&&B(),R(!0)}function ot(){p.value==="url"?H():$e()}function Xe(){var Ht;const ue=(Ht=e.getPos)==null?void 0:Ht.call(e);if(typeof ue!="number")return;const{state:me,dispatch:Re}=e.editor.view,Ke=Z.value||te.value,St=me.schema.nodes.paragraph.create(null,Ke?me.schema.text(Ke):null);Re(me.tr.replaceWith(ue,ue+e.node.nodeSize,St).scrollIntoView()),e.editor.view.focus()}return a.onBeforeUnmount(()=>{m&&clearTimeout(m),h&&clearTimeout(h)}),(ue,me)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createVNode(a.unref(_e.NodeViewWrapper),a.mergeProps({ref_key:"rootRef",ref:o,class:["pagely-embed-block",[`pagely-embed-block--${a.unref(v)}`,{"is-selected":e.selected},a.unref(n)]],"data-type":"embed-view",contenteditable:"false"},a.unref(t),{onMouseenter:ne,onMouseleave:N,onMousedownCapture:q}),{default:a.withCtx(()=>{var Re;return[(a.openBlock(),a.createBlock(a.Teleport,{to:"body"},[a.withDirectives(a.createVNode(cp,{style:a.normalizeStyle(d.value),label:Z.value,"current-view":a.unref(v),"file-type":a.unref(p),"can-preview":se.value,"copy-tip":a.unref(J),onMouseenter:O,onMouseleave:$,onSetView:a.unref(D),onFullscreen:$e,onDownload:a.unref(W),onCopy:a.unref(z),onOpen:a.unref(H),onRemove:a.unref(A)},null,8,["style","label","current-view","file-type","can-preview","copy-tip","onSetView","onDownload","onCopy","onOpen","onRemove"]),[[a.vShow,s.value]])])),a.unref(v)==="link"?(a.openBlock(),a.createElementBlock("a",{key:0,class:"pagely-embed-link",href:te.value,target:"_blank",rel:"noopener noreferrer",onClick:me[0]||(me[0]=a.withModifiers((...Ke)=>a.unref(H)&&a.unref(H)(...Ke),["prevent"]))},[a.unref(p)!=="url"?(a.openBlock(),a.createBlock(a.unref(L.FileText),{key:0,class:"pagely-embed-link__icon",size:16,"stroke-width":1.5})):(a.openBlock(),a.createBlock(a.unref(L.Link),{key:1,class:"pagely-embed-link__icon",size:16,"stroke-width":1.5})),a.createElementVNode("span",fp,a.toDisplayString(Z.value),1),a.createElementVNode("span",mp,a.toDisplayString(te.value),1)],8,dp)):a.unref(v)==="card"?(a.openBlock(),a.createElementBlock("div",{key:1,class:"pagely-embed-card",title:te.value,onDblclick:a.withModifiers(ot,["prevent"])},[a.createElementVNode("div",pp,[le.value?(a.openBlock(),a.createElementBlock("img",{key:0,src:((Re=a.unref(b))==null?void 0:Re.favicon)??"",alt:"",onError:me[1]||(me[1]=Ke=>i.value=!0)},null,40,gp)):a.unref(p)!=="url"?(a.openBlock(),a.createBlock(a.unref(L.FileText),{key:1,size:18,"stroke-width":1.5})):(a.openBlock(),a.createBlock(a.unref(L.Globe2),{key:2,size:18,"stroke-width":1.5}))]),a.createElementVNode("div",vp,[a.unref(w)?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[me[4]||(me[4]=a.createElementVNode("span",{class:"pagely-embed-skeleton pagely-embed-skeleton--title"},null,-1)),me[5]||(me[5]=a.createElementVNode("span",{class:"pagely-embed-skeleton pagely-embed-skeleton--meta"},null,-1))],64)):(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[a.createElementVNode("span",bp,a.toDisplayString(ee.value),1),a.createElementVNode("span",yp,a.toDisplayString(we.value),1)],64))]),a.unref(p)!=="url"?(a.openBlock(),a.createElementBlock("button",{key:0,type:"button",class:"pagely-embed-card__action",onClick:a.withModifiers($e,["stop"])},[a.createVNode(a.unref(L.Maximize2),{size:14,"stroke-width":1.6}),me[6]||(me[6]=a.createElementVNode("span",null,"全屏阅读",-1))])):a.createCommentVNode("",!0)],40,hp)):(a.openBlock(),a.createElementBlock("div",wp,[l.value||a.unref(M)?(a.openBlock(),a.createElementBlock("div",kp,[a.createElementVNode("span",null,a.toDisplayString(l.value||a.unref(M)),1),a.createElementVNode("button",{type:"button",class:"pagely-embed-error__action",onClick:me[2]||(me[2]=Ke=>a.unref(D)("card"))}," 切换为卡片视图 "),a.unref(p)==="url"?(a.openBlock(),a.createElementBlock("button",{key:0,type:"button",class:"pagely-embed-error__action",onClick:me[3]||(me[3]=(...Ke)=>a.unref(H)&&a.unref(H)(...Ke))}," 新窗口打开 ")):a.createCommentVNode("",!0)])):a.unref(p)==="md"&&a.unref(E)?(a.openBlock(),a.createElementBlock("div",xp,[a.createVNode(a.unref(L.Loader2),{class:"pagely-embed-spin",size:18,"stroke-width":1.5})])):a.unref(p)==="md"?(a.openBlock(),a.createElementBlock("iframe",{key:2,class:"pagely-embed-iframe",title:"Markdown preview",srcdoc:pe.value,onLoad:ve,onError:Be},null,40,Cp)):(a.openBlock(),a.createElementBlock("iframe",{key:3,class:"pagely-embed-iframe",title:Z.value,src:I.value,referrerpolicy:"no-referrer-when-downgrade",onLoad:ve,onError:Be},null,40,Tp))]))]}),_:1},16,["class"]),a.unref(p)!=="url"?(a.openBlock(),a.createBlock(ho,{key:0,open:a.unref(K),"close-label":"关闭","onUpdate:open":a.unref(R)},{toolbar:a.withCtx(()=>[a.createElementVNode("span",Ep,a.toDisplayString(Z.value),1)]),body:a.withCtx(()=>[a.createElementVNode("div",Sp,[a.unref(M)?(a.openBlock(),a.createElementBlock("div",Mp,a.toDisplayString(a.unref(M)),1)):a.unref(p)==="md"?(a.openBlock(),a.createElementBlock("iframe",{key:1,class:"pagely-embed-iframe pagely-embed-iframe--fullscreen",title:"Markdown preview",srcdoc:pe.value},null,8,Ap)):(a.openBlock(),a.createElementBlock("iframe",{key:2,class:"pagely-embed-iframe pagely-embed-iframe--fullscreen",title:Z.value,src:te.value,referrerpolicy:"no-referrer-when-downgrade"},null,8,Bp))])]),_:1},8,["open","onUpdate:open"])):a.createCommentVNode("",!0)],64))}}),Zu=Me.Node.create({name:"embedView",group:"block",atom:!0,draggable:!0,addAttributes(){return{href:{default:"",parseHTML:r=>r.getAttribute("data-href")??"",renderHTML:r=>r.href?{"data-href":r.href}:{}},label:{default:"",parseHTML:r=>r.textContent??"",renderHTML:()=>({})},view:{default:"link",parseHTML:r=>{var e;return((e=cr({href:r.getAttribute("data-href")??"",label:r.textContent??"",preferredView:r.getAttribute("data-view")}))==null?void 0:e.view)??"link"},renderHTML:r=>{var e;return{"data-view":((e=cr({href:r.href??"",label:r.label??"",preferredView:r.view}))==null?void 0:e.view)??"link"}}}}},parseHTML(){return[{tag:'div[data-type="embed-view"]'}]},renderHTML({HTMLAttributes:r,node:e}){return["div",Me.mergeAttributes(r,{"data-type":"embed-view"}),e.attrs.label??""]},addNodeView(){return _e.VueNodeViewRenderer(Np)},addCommands(){return{insertEmbedView:r=>({commands:e})=>{const t=cr({href:r.href,label:r.label,preferredView:r.view});return t?e.insertContent({type:this.name,attrs:t}):!1}}}}),Lp=["src","alt","title"],gi=.1,vi=24,Ip=a.defineComponent({__name:"ImagePreviewDialog",props:{src:{},alt:{},title:{},baseWidth:{},baseHeight:{}},emits:["close"],setup(r,{emit:e}){const t=r,n=e,o=a.ref(1),l=a.ref({x:0,y:0}),i=a.ref(!1);let s=null;const u=a.computed(()=>({width:`${Math.max(1,t.baseWidth)*o.value}px`,transform:`translate(${l.value.x}px, ${l.value.y}px)`}));function d(k,T,E){return Math.min(E,Math.max(T,k))}function m(){const k=window.innerWidth*.9,T=window.innerHeight*.86,E=Math.max(1,t.baseWidth),M=Math.max(1,t.baseHeight);return Math.min(1,k/E,T/M)||1}function h(k){const T=k.deltaY<0?1.16:.86;o.value=d(o.value*T,gi,vi)}function p(k){k.button===0&&(s={startX:k.clientX,startY:k.clientY,startOffsetX:l.value.x,startOffsetY:l.value.y,previousCursor:document.body.style.cursor},i.value=!0,document.body.style.cursor="grabbing",window.addEventListener("pointermove",v),window.addEventListener("pointerup",b),window.addEventListener("pointercancel",b))}function v(k){s&&(l.value={x:s.startOffsetX+k.clientX-s.startX,y:s.startOffsetY+k.clientY-s.startY})}function b(){s&&(document.body.style.cursor=s.previousCursor,s=null,i.value=!1,window.removeEventListener("pointermove",v),window.removeEventListener("pointerup",b),window.removeEventListener("pointercancel",b))}function w(k){k.key==="Escape"&&n("close")}return a.onMounted(()=>{o.value=d(m(),gi,vi),l.value={x:0,y:0},window.addEventListener("keydown",w)}),a.onBeforeUnmount(()=>{s&&(document.body.style.cursor=s.previousCursor),b(),window.removeEventListener("keydown",w)}),(k,T)=>(a.openBlock(),a.createBlock(a.Teleport,{to:"body"},[a.createElementVNode("div",{class:"pagely-image-dialog",role:"dialog","aria-modal":"true",onMousedown:T[1]||(T[1]=a.withModifiers(E=>n("close"),["self"])),onWheel:a.withModifiers(h,["prevent"])},[a.createElementVNode("button",{class:"pagely-image-dialog-close",type:"button",title:"关闭",onClick:T[0]||(T[0]=E=>n("close"))},[a.createVNode(a.unref(L.X),{size:18,"stroke-width":1.8})]),a.createElementVNode("div",{class:a.normalizeClass(["pagely-image-dialog-stage",{"is-panning":i.value}])},[a.createElementVNode("img",{class:"pagely-image-dialog-img",src:r.src,alt:r.alt,title:r.title,style:a.normalizeStyle(u.value),draggable:"false",onWheel:a.withModifiers(h,["prevent"]),onPointerdown:a.withModifiers(p,["stop","prevent"])},null,44,Lp)],2)],32)]))}}),zp=gt(Ip,[["__scopeId","data-v-1cd0e251"]]),Dp=["src","alt","title"],Op=["onPointerdown"],bi=12,zn=100,Rp=a.defineComponent({__name:"ImageBlockView",props:{decorations:{},selected:{type:Boolean},updateAttributes:{type:Function},deleteNode:{type:Function},node:{},view:{},getPos:{},innerDecorations:{},editor:{},extension:{},HTMLAttributes:{}},setup(r){const e=r,{commentAttrs:t,commentClass:n}=hn(()=>e.node.attrs),o=["nw","ne","sw","se"],l=a.ref(null),i=a.ref(null),s=a.ref(null),u=a.ref(!1),d=a.ref(null),m=a.ref(null),h=a.ref(null),p=a.ref(!1);let v=null;const b=a.computed(()=>String(e.node.attrs.src??"")),w=a.computed(()=>e.node.attrs.alt??""),k=a.computed(()=>e.node.attrs.title??void 0),T=a.computed(()=>e.editor.isEditable),E=a.computed(()=>z(e.node.attrs.width)),M=a.computed(()=>E.value!==null),B=a.computed(()=>{const I=d.value??E.value;return I!==null?{width:`${I}%`}:m.value?{width:`${m.value}px`}:{}}),D=a.computed(()=>({width:ee(),height:we()}));function z(I){if(I==null||I==="")return null;const P=Number(I);return Number.isFinite(P)?W(P,bi,zn):null}function W(I,P,V){return Math.min(V,Math.max(P,I))}function H(I){return Math.round(I*10)/10}function A(){var P;const I=(P=e.getPos)==null?void 0:P.call(e);return typeof I=="number"?I:null}function R(I){if(I==null||I.preventDefault(),!T.value)return;const P=A();if(P===null)return;const{state:V,dispatch:q}=e.editor.view;q(V.tr.setSelection(mr.NodeSelection.create(V.doc,P))),e.editor.view.focus()}function K(){var I,P,V,q;return((I=l.value)==null?void 0:I.getBoundingClientRect().width)||((V=(P=i.value)==null?void 0:P.parentElement)==null?void 0:V.getBoundingClientRect().width)||((q=i.value)==null?void 0:q.getBoundingClientRect().width)||1}function J(I){const P=I.currentTarget;m.value=P.naturalWidth||null,h.value=P.naturalHeight||null}function te(I,P){var ae;if(!T.value)return;R(I);const V=K(),q=((ae=i.value)==null?void 0:ae.getBoundingClientRect().width)||V*(E.value??zn)/100;v={handle:P,startX:I.clientX,startWidthPx:q,containerWidth:V,previousCursor:document.body.style.cursor},u.value=!0,document.body.style.cursor=P==="nw"||P==="se"?"nwse-resize":"nesw-resize",window.addEventListener("pointermove",Z),window.addEventListener("pointerup",le),window.addEventListener("pointercancel",le)}function Z(I){if(!v)return;const P=v.handle.includes("w")?-1:1,V=(I.clientX-v.startX)*P*2,q=W((v.startWidthPx+V)/v.containerWidth*100,bi,zn);d.value=H(q)}function le(){if(!v)return;const I=d.value??E.value??zn;e.updateAttributes({width:I}),document.body.style.cursor=v.previousCursor,v=null,u.value=!1,d.value=null,window.removeEventListener("pointermove",Z),window.removeEventListener("pointerup",le),window.removeEventListener("pointercancel",le)}function ee(){var I,P;return m.value||((I=s.value)==null?void 0:I.naturalWidth)||((P=s.value)==null?void 0:P.getBoundingClientRect().width)||1}function we(){var I,P;return h.value||((I=s.value)==null?void 0:I.naturalHeight)||((P=s.value)==null?void 0:P.getBoundingClientRect().height)||1}function pe(){p.value=!0}function se(){p.value=!1}return a.onBeforeUnmount(()=>{v&&(document.body.style.cursor=v.previousCursor),se(),window.removeEventListener("pointermove",Z),window.removeEventListener("pointerup",le),window.removeEventListener("pointercancel",le)}),(I,P)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createVNode(a.unref(_e.NodeViewWrapper),a.mergeProps({as:"figure","data-type":"image-block",class:["pagely-image-block",[{"is-selected":r.selected||u.value,"is-resizing":u.value},a.unref(n)]]},a.unref(t),{onClick:a.withModifiers(R,["stop"]),onDblclick:a.withModifiers(pe,["stop","prevent"])}),{default:a.withCtx(()=>[a.createElementVNode("div",{ref_key:"rootRef",ref:l,class:"pagely-image-block-inner"},[a.createElementVNode("div",{ref_key:"frameRef",ref:i,class:a.normalizeClass(["pagely-image-frame",{"has-manual-width":M.value||u.value}]),style:a.normalizeStyle(B.value)},[a.createElementVNode("img",{ref_key:"imageRef",ref:s,class:"pagely-image",src:b.value,alt:w.value,title:k.value,draggable:"false",onLoad:J,onDblclick:a.withModifiers(pe,["stop","prevent"])},null,40,Dp),T.value?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},a.renderList(o,V=>a.createElementVNode("span",{key:V,class:a.normalizeClass(["pagely-image-resize-handle",`pagely-image-resize-handle--${V}`]),title:"Resize image",onPointerdown:a.withModifiers(q=>te(q,V),["stop","prevent"])},null,42,Op)),64)):a.createCommentVNode("",!0)],6)],512)]),_:1},16,["class"]),p.value?(a.openBlock(),a.createBlock(zp,{key:0,src:b.value,alt:w.value,title:k.value,"base-width":D.value.width,"base-height":D.value.height,onClose:se},null,8,["src","alt","title","base-width","base-height"])):a.createCommentVNode("",!0)],64))}}),Pp=gt(Rp,[["__scopeId","data-v-09322283"]]),Hp=12,Vp=100;function Gl(r){return Math.min(Vp,Math.max(Hp,r))}function Fp(r){const e=r.getAttribute("data-width");if(e){const o=Number(e);if(Number.isFinite(o))return Gl(o)}const n=r.style.width.match(/^(\d+(?:\.\d+)?)%$/);return n?Gl(Number(n[1])):null}function $p(r){if(r==null||r==="")return{style:"height: auto; max-width: 100%;"};const e=Number(r);if(!Number.isFinite(e))return{style:"height: auto; max-width: 100%;"};const t=Gl(e);return{"data-width":String(t),style:`width: ${t}%; height: auto; max-width: 100%;`}}const qp=Me.Node.create({name:"image",group:"block",atom:!0,draggable:!0,addAttributes(){return{src:{default:"",parseHTML:r=>r.getAttribute("src")??"",renderHTML:r=>r.src?{src:r.src}:{}},alt:{default:null,parseHTML:r=>r.getAttribute("alt"),renderHTML:r=>r.alt?{alt:r.alt}:{}},title:{default:null,parseHTML:r=>r.getAttribute("title"),renderHTML:r=>r.title?{title:r.title}:{}},width:{default:null,parseHTML:r=>Fp(r),renderHTML:r=>$p(r.width)}}},parseHTML(){return[{tag:"img[src]"}]},renderHTML({HTMLAttributes:r}){return["img",Me.mergeAttributes(r)]},addNodeView(){return _e.VueNodeViewRenderer(Pp)},addCommands(){return{insertImage:r=>({commands:e})=>e.insertContent({type:this.name,attrs:r})}}}),Up={key:0,class:"mermaid-error"},Wp=["innerHTML"],_p={class:"mermaid-fullscreen-panel"},Gp={key:0,class:"mermaid-error mermaid-error--fullscreen"},Kp={key:2,class:"mermaid-preview mermaid-preview--fullscreen"},Yp={key:0,class:"mermaid-error mermaid-error--fullscreen"},Jp=["innerHTML"];let Xp=0;const jp=a.defineComponent({__name:"MermaidBlockView",props:{decorations:{},selected:{type:Boolean},updateAttributes:{type:Function},deleteNode:{type:Function},node:{},view:{},getPos:{},innerDecorations:{},editor:{},extension:{},HTMLAttributes:{}},setup(r){const e=r,{commentAttrs:t,commentClass:n}=hn(()=>e.node.attrs),o=a.ref(e.node.textContent),l=a.ref(!1),i=a.ref(""),s=a.ref(""),u=a.ref(null),d=a.ref(null),{copyPngToClipboard:m}=lo(),h=a.computed(()=>e.editor.isEditable),p=++Xp;let v=0;function b(){const M=document.createElement("div");return M.style.cssText=["position:fixed","left:-10000px","top:0","opacity:0","pointer-events:none","overflow:hidden","z-index:-1"].join(";"),document.body.appendChild(M),M}a.watch(()=>e.node.textContent,M=>{M!==o.value&&(o.value=M)});async function w(){const M=o.value.trim();if(!M){i.value="",s.value="";return}const B=++v,D=b();try{const{svg:z}=await Qc.render(`mermaid-preview-${p}-${B}`,M,D);if(B!==v)return;i.value=z,s.value=""}catch(z){if(B!==v)return;s.value=z instanceof Error?z.message:String(z),i.value=""}finally{D.remove()}}a.onMounted(()=>{w()}),a.watch(o,()=>{w()});async function k(){var M;try{await navigator.clipboard.writeText(o.value),(M=d.value)==null||M.showCopyTip("source")}catch{}}async function T(){var B;await m(()=>{var D;return((D=u.value)==null?void 0:D.querySelector(".mermaid-svg-container svg"))??null})&&((B=d.value)==null||B.showCopyTip("image"))}function E(M){var A,R;if(!h.value)return;o.value=M;const B=(A=e.getPos)==null?void 0:A.call(e);if(B===void 0||!((R=e.editor)!=null&&R.view))return;const{state:D,dispatch:z}=e.editor.view,W=D.doc.nodeAt(B);if(!W)return;const H=D.tr.replaceWith(B,B+W.nodeSize,W.type.create(W.attrs,M.length>0?D.schema.text(M):[]));H.setMeta("addToHistory",!0),z(H)}return(M,B)=>(a.openBlock(),a.createBlock(a.unref(_e.NodeViewWrapper),a.mergeProps({"data-type":"mermaid-block",class:a.unref(n)},a.unref(t)),{default:a.withCtx(()=>[a.createVNode(Ea,{ref_key:"shellRef",ref:d,class:"mermaid-block-wrap",label:"mermaid",fullscreen:l.value,"onUpdate:fullscreen":B[0]||(B[0]=D=>l.value=D),"can-copy-source":!0,"can-copy-image":!0,"can-fullscreen":!0,onCopySource:k,onCopyImage:T},{inline:a.withCtx(()=>[a.createElementVNode("div",{ref_key:"previewWrap",ref:u,class:"mermaid-preview"},[s.value?(a.openBlock(),a.createElementBlock("div",Up,a.toDisplayString(s.value),1)):(a.openBlock(),a.createElementBlock("div",{key:1,class:"mermaid-svg-container",innerHTML:i.value},null,8,Wp))],512)]),fullscreen:a.withCtx(()=>[a.createElementVNode("div",_p,[s.value?(a.openBlock(),a.createElementBlock("div",Gp,a.toDisplayString(s.value),1)):a.createCommentVNode("",!0),h.value?(a.openBlock(),a.createBlock(a.unref(jc.MermaidEditorPanel),{key:1,code:o.value,"onUpdate:code":E},null,8,["code"])):(a.openBlock(),a.createElementBlock("div",Kp,[s.value?(a.openBlock(),a.createElementBlock("div",Yp,a.toDisplayString(s.value),1)):(a.openBlock(),a.createElementBlock("div",{key:1,class:"mermaid-svg-container",innerHTML:i.value},null,8,Jp))]))])]),_:1},8,["fullscreen"])]),_:1},16,["class"]))}}),ec=Me.Node.create({name:"mermaidBlock",content:"text*",marks:"",group:"block",code:!0,defining:!0,isolating:!0,parseHTML(){return[{tag:'pre[data-type="mermaid-block"]',preserveWhitespace:"full"}]},renderHTML({HTMLAttributes:r}){return["pre",Me.mergeAttributes(r,{"data-type":"mermaid-block"}),0]},addNodeView(){return _e.VueNodeViewRenderer(jp)},addCommands(){return{insertMermaidBlock:(r=`graph TD
315
+ A --> B`)=>({commands:e})=>e.insertContent({type:this.name,content:[{type:"text",text:r}]})}}}),Qp=a.defineComponent({__name:"MentionNode",props:_e.nodeViewProps,setup(r){const e=r,t=a.computed(()=>String(e.node.attrs.userId??"")),n=a.computed(()=>String(e.node.attrs.displayName??""));return(o,l)=>(a.openBlock(),a.createBlock(a.unref(_e.NodeViewWrapper),{as:"span",class:"pagely-mention-tag","data-mention-user-id":t.value,"data-mention-display-name":n.value},{default:a.withCtx(()=>[a.createTextVNode(" @"+a.toDisplayString(n.value),1)]),_:1},8,["data-mention-user-id","data-mention-display-name"]))}});function Zp(r){return(r.getAttribute("data-mention-display-name")??r.textContent??"").replace(/^@/,"")}const tc=Me.Node.create({name:"mention",group:"inline",inline:!0,atom:!0,selectable:!0,addAttributes(){return{userId:{default:"",parseHTML:r=>r.getAttribute("data-mention-user-id")??"",renderHTML:r=>r.userId?{"data-mention-user-id":r.userId}:{}},displayName:{default:"",parseHTML:r=>Zp(r),renderHTML:r=>r.displayName?{"data-mention-display-name":r.displayName}:{}}}},parseHTML(){return[{tag:"span[data-mention-user-id]"}]},renderHTML({HTMLAttributes:r}){const e=String(r["data-mention-display-name"]??"");return["span",Me.mergeAttributes({class:"pagely-mention-tag"},r),`@${e}`]},addNodeView(){return _e.VueNodeViewRenderer(Qp)},addCommands(){return{insertMention:r=>({commands:e})=>e.insertContent({type:this.name,attrs:r})}}}),e4=Me.Extension.create({name:"slashInsert",priority:1e3,addOptions(){return{onOpen:()=>{}}},addKeyboardShortcuts(){return{"/":({editor:r})=>{const{state:e,view:t}=r,{selection:n}=e;if(!n.empty)return!1;const{$from:o}=n,l=o.parent;if(!l.isTextblock||l.type.name==="codeBlock")return!1;for(let d=o.depth;d>0;d--){const m=o.node(d).type.name;if(m==="tableCell"||m==="tableHeader")return!1}const i=l.textBetween(0,o.parentOffset,void 0,"");if(i!==""&&!i.endsWith(" "))return!1;const s=t.coordsAtPos(o.pos),u=o.before(o.depth);return this.options.onOpen(u,new DOMRect(s.left,s.bottom,0,0)),!0}}}}),t4=/<(p|h[1-6]|ul|ol|li|table|tbody|thead|tr|td|th|blockquote)\b/i;function r4(r){return r?t4.test(r):!1}const n4=new Set(["tableCell","tableHeader"]);function o4(r,e){const t=r.clipboardData;if(!t)return null;const n=t.getData("text/plain")??"",o=t.getData("text/html")??"",l=o.length>0?o:null;return!n&&!l?null:{plainText:n,html:l,isRichHtml:r4(l),inlineOnly:l4(e)}}function l4(r){const{$from:e}=r.state.selection;for(let t=e.depth;t>=0;t--)if(n4.has(e.node(t).type.name))return!0;return!1}const a4="*/*";async function Sa(r){return URL.createObjectURL?{href:URL.createObjectURL(r),label:r.name}:null}function i4(r){var e;if(!((e=r==null?void 0:r.files)!=null&&e.length))return null;for(const t of Array.from(r.files))if(t.type.startsWith("image/"))return t;return null}function s4(r){var e,t;return r?(((e=r.getData("text/plain"))==null?void 0:e.length)??0)>0||(((t=r.getData("text/html"))==null?void 0:t.length)??0)>0:!1}function u4(r){return new Promise(e=>{const t=new FileReader;t.onload=()=>e(typeof t.result=="string"?t.result:null),t.onerror=()=>e(null),t.readAsDataURL(r)})}function c4(r){var e;return(e=r==null?void 0:r.files)!=null&&e.length?Array.from(r.files):[]}function d4(r){if(!r)return!1;if(r.types&&Array.from(r.types).includes("Files"))return!0;if(r.items){for(const e of Array.from(r.items))if(e.kind==="file")return!0}return!1}const f4=Me.Extension.create({name:"smartPaste",addOptions(){return{handlers:[],debug:!1}},addProseMirrorPlugins(){const r=this.editor,e=[...this.options.handlers].sort((o,l)=>o.priority-l.priority),t=this.options.fileUploadHandler,n=this.options.debug;return[new mr.Plugin({key:new mr.PluginKey("smartPaste"),props:{handleDOMEvents:{dragover(o,l){return d4(l.dataTransfer)&&(l.preventDefault(),l.dataTransfer&&(l.dataTransfer.dropEffect="copy")),!1}},handleDrop(o,l){const i=c4(l.dataTransfer);if(i.length===0)return!1;l.preventDefault(),l.stopPropagation();const s=o.posAtCoords({left:l.clientX,top:l.clientY}),u=r.chain().focus();return s&&u.setTextSelection(s.pos),u.run(),(async()=>{const d=t??Sa;for(const m of i){const h=await d(m);if(!(h!=null&&h.href))continue;const p=cr({href:h.href,label:h.label||m.name});p&&r.commands.insertEmbedView(p)}})(),!0},handlePaste(o,l){var d;if(window.__pagelySkipNextPaste){window.__pagelySkipNextPaste=!1;const m=((d=l.clipboardData)==null?void 0:d.getData("text/plain"))??"";return m?(o.pasteText(m),!0):!1}if(o.state.selection.$from.parent.type.name==="codeBlock")return!1;const s=i4(l.clipboardData);if(s&&!s4(l.clipboardData))return u4(s).then(m=>{m&&r.commands.insertImage({src:m})}),!0;const u=o4(l,o);if(!u)return!1;for(const m of e){let h=!1;try{h=m.detect(u)}catch(p){console.error(`[smartPaste] detect ${m.name} threw`,p);continue}if(h){n&&console.debug("[smartPaste] hit:",m.name);try{const p=m.transform(u);return p&&r.commands.insertContent(p,{parseOptions:{preserveWhitespace:!1}}),!0}catch(p){return console.error(`[smartPaste] transform ${m.name} threw`,p),!1}}}return!1}}})]}}),m4=new Set(["tableCell","tableHeader"]);function h4(r){for(let e=r.depth;e>0;e-=1)if(m4.has(r.node(e).type.name))return!0;return!1}const p4=Me.Extension.create({name:"tableCellEnter",priority:1e3,addProseMirrorPlugins(){const r=this.editor;return[new mr.Plugin({props:{handleKeyDown(e,t){return t.key!=="Enter"||t.shiftKey||t.ctrlKey||t.metaKey||t.altKey||t.isComposing||e.composing||e.state.selection instanceof gl.CellSelection||!h4(e.state.selection.$from)?!1:r.commands.setHardBreak()}}})]}}),rc={starterKit:["edit","view","comment"],table:["edit","view"],tableRow:["edit","view"],tableHeader:["edit","view"],tableCell:["edit","view"],taskList:["edit","view"],taskItem:["edit","view"],codeBlock:["edit","view"],mermaidBlock:["edit","view"],dotFlowPadBlock:["edit","view"],image:["edit","view"],mathematics:["edit","view"],textStyle:["edit","view"],color:["edit","view"],highlight:["edit","view"],autoLinkTitle:["edit","view"],embedView:["edit"],smartPaste:["edit"],slashInsert:["edit"],tableCellEnter:["edit"],commentMark:["edit","view"],commentBlock:["edit","view"],mention:["edit","view","comment"]};function nc(r,e){const t=rc[r];return t?t.includes(e):!0}function Ao(r){return r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function oc(r){return r.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}const g4=[/^#{1,6}[ \t]/m,/^[ \t]*[-*+][ \t]+\S/m,/^[ \t]*\d+\.[ \t]+\S/m,/^[ \t]*>[ \t]/m,/^```/m],v4=/[。!?一-龥]\s*$/,b4=[/^[ \t]{2,}\S/,/[;{}]\s*$/,/\b(function|const|let|var|class|def|import|from|return|if|else|for|while|switch|public|private|interface|enum)\b/,/=>|!==|===|<=|>=/,/^\s*(\/\/|\/\*|#\s|--\s)/,/\b\w+\s*\([^)]*\)\s*\{/],y4=[[/^#!.*\b(bash|sh)\b/m,"bash"],[/^#!.*\bpython\b/m,"python"],[/\b(def\s+\w+|from\s+\w+\s+import)/m,"python"],[/\b(interface\s+\w+|:\s*(string|number|boolean)\b)/m,"typescript"],[/\b(function\s+\w+\s*\(|const\s+\w+\s*=\s*\(|=>)/m,"javascript"],[/\b(public\s+(static\s+)?class|System\.out\.println)/m,"java"],[/^\s*(SELECT|INSERT|UPDATE|DELETE)\s+/im,"sql"]];function w4(r){for(const[e,t]of y4)if(e.test(r))return t;return"plaintext"}const k4={name:"codeBlock",priority:160,detect(r){if(r.inlineOnly||r.isRichHtml)return!1;const e=r.plainText;for(const o of g4)if(o.test(e))return!1;const t=e.split(`
316
+ `).filter(o=>o.trim().length>0);if(t.length<3||t.some(o=>v4.test(o)))return!1;let n=0;for(const o of t)b4.some(l=>l.test(o))&&n++;return n/t.length>=.75},transform(r){const e=w4(r.plainText),t=Ao(r.plainText.replace(/\n+$/,""));return`<pre data-type="code-block" data-language="${e}"><code>${t}</code></pre>`}};function ro(r){const e=r.trim();if(!e||!(e.startsWith("{")||e.startsWith("[")))return null;try{return{value:JSON.parse(e)}}catch{return null}}function yi(r){return Array.isArray(r)}function lc(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}function wi(r){return lc(r)?yi(r.nodes)&&yi(r.edges):!1}function ki(r,e){return!lc(r)||typeof r.type=="string"&&r.type.length>0?r:{...r,type:e}}function x4(r){return{...r,nodes:r.nodes.map(e=>ki(e,"rect")),edges:r.edges.map(e=>ki(e,"polyline"))}}const C4={name:"dotFlowPad",priority:50,detect(r){if(r.inlineOnly||r.isRichHtml)return!1;const e=ro(r.plainText);return e!==null&&wi(e.value)},transform(r){const e=ro(r.plainText);if(!e||!wi(e.value))return"";const t=JSON.stringify(x4(e.value));return`<div data-type="dot-flow-pad" data-graph="${oc(t)}"></div>`}},T4=50,E4={name:"jsonCode",priority:210,detect(r){return r.inlineOnly||r.isRichHtml||r.plainText.trim().length<T4?!1:ro(r.plainText)!==null},transform(r){const e=ro(r.plainText);if(!e)return"";const t=JSON.stringify(e.value,null,2);return`<pre data-type="code-block" data-language="json"><code>${Ao(t)}</code></pre>`}},xi=/^\s*\$\$([\s\S]+?)\$\$\s*$/,S4=/^\s*\\begin\{([a-zA-Z*]+)\}([\s\S]+?)\\end\{\1\}\s*$/,M4={name:"latexBlock",priority:60,detect(r){if(r.inlineOnly||r.isRichHtml)return!1;const e=r.plainText;return xi.test(e)||S4.test(e)},transform(r){const e=r.plainText,t=e.match(xi),n=t?t[1].trim():e.trim();return`<div data-type="block-math" data-latex="${oc(n)}"></div>`}},A4=[/^#{1,6}[ \t]/m,/^[ \t]*[-*+][ \t]+\S/m,/^[ \t]*\d+\.[ \t]+\S/m,/^[ \t]*>[ \t]/m,/^[ \t]*-[ \t]\[[ xX]\][ \t]/m,/^```/m,/^[ \t]*[-*_]{3,}[ \t]*$/m],B4=[/\*\*[^*\n]+\*\*/,/\[[^\]\n]+?\]\([^)\n]+?\)/,/(^|[^`])`[^`\n]+`(?!`)/],N4={name:"markdown",priority:100,detect(r){if(r.isRichHtml)return!1;const e=r.plainText;if(!e||e.trim().length<2)return!1;for(const n of A4)if(n.test(e))return!0;let t=0;for(const n of B4)n.test(e)&&t++;return t>=2},transform(r){const e=dn(r.plainText);return r.inlineOnly?L4(e):e}};function L4(r){const e=document.createElement("template");return e.innerHTML=r,ac(e.content).join("<br>")}const I4=new Set(["P","H1","H2","H3","H4","H5","H6","UL","OL","LI","BLOCKQUOTE","PRE","HR","DIV","TABLE","THEAD","TBODY","TR","TD","TH"]);function ac(r){const e=[];for(const t of Array.from(r.childNodes)){if(t.nodeType===Node.TEXT_NODE){const o=t.textContent??"";o.trim().length>0&&e.push(o);continue}if(t.nodeType!==Node.ELEMENT_NODE)continue;const n=t;I4.has(n.tagName)?e.push(...ac(n)):e.push(n.outerHTML)}return e}const z4=["stateDiagram-v2","stateDiagram","sequenceDiagram","classDiagram","erDiagram","journey","gantt","pie","mindmap","timeline","gitGraph","quadrantChart","requirementDiagram","C4Context"],D4=["graph","flowchart"],O4=["TB","TD","BT","RL","LR"],R4=new RegExp(`^\\s*(?:${z4.join("|")})(?:\\s+|\\s*$)`),P4=new RegExp(`^\\s*(?:${D4.join("|")})\\s+(?:${O4.join("|")})\\b`),H4={name:"mermaid",priority:70,detect(r){if(r.inlineOnly||r.isRichHtml)return!1;const e=r.plainText;return R4.test(e)||P4.test(e)},transform(r){return`<pre data-type="mermaid-block">${Ao(r.plainText.trim())}</pre>`}},V4={name:"richHtml",priority:200,detect:r=>r.isRichHtml&&r.html!==null,transform:r=>Wn(r.html??"")};function Ci(r){const t=r.replace(/\r\n/g,`
317
+ `).replace(/\n+$/,"").split(`
318
+ `).filter(i=>i.length>0);if(t.length<2)return null;const n=t.map(i=>i.split(" ")),o=n[0].length;return o<2||n.some(i=>i.length!==o)||n.every(i=>i[0]==="")?null:{rows:n,cols:o}}const F4={name:"tsv",priority:150,detect(r){return r.inlineOnly||r.isRichHtml?!1:Ci(r.plainText)!==null},transform(r){const e=Ci(r.plainText);return e?`<table><tbody>${e.rows.map(n=>"<tr>"+n.map(o=>`<td>${Ao(o)}</td>`).join("")+"</tr>").join("")}</tbody></table>`:""}},$4=[C4,M4,H4,N4,F4,k4,V4,E4];function Ti(){return{align:{default:null,parseHTML:r=>Vr(r),renderHTML:r=>r.align?{align:r.align,style:`text-align:${r.align}`}:{}}}}function q4(r){return r==="comment"?{blockquote:!1,bold:!1,bulletList:!1,code:!1,codeBlock:!1,dropcursor:!1,gapcursor:!1,hardBreak:!1,heading:!1,horizontalRule:!1,italic:!1,link:!1,listItem:!1,listKeymap:!1,orderedList:!1,strike:!1,trailingNode:!1,underline:!1}:{codeBlock:!1,link:{autolink:!0,openOnClick:!1,isAllowedUri:(e,t)=>Hr(e)||t.defaultValidate(e),HTMLAttributes:{target:"_blank",rel:"noopener noreferrer",class:"pm-link"}}}}function Bo(r){const e=r.editable??r.profile!=="view",t=(l,i)=>nc(l,r.profile)?i():null,o=[t("starterKit",()=>_c.configure(q4(r.profile))),t("table",()=>Kr.Table.configure({resizable:e,View:Rh})),t("tableRow",()=>Kr.TableRow),t("tableHeader",()=>Kr.TableHeader.extend({content:"paragraph",addAttributes(){var l;return{...(l=this.parent)==null?void 0:l.call(this),...Ti()}}})),t("tableCell",()=>Kr.TableCell.extend({content:"paragraph",addAttributes(){var l;return{...(l=this.parent)==null?void 0:l.call(this),...Ti()}}})),r.profile==="comment"?null:r.headingCollapseExtension??null,t("taskList",()=>Gc.TaskList),t("taskItem",()=>Kc.TaskItem.configure({nested:!0})),t("codeBlock",()=>qf),t("mermaidBlock",()=>ec),t("dotFlowPadBlock",()=>Qu),t("embedView",()=>Zu),t("image",()=>qp),t("mathematics",()=>Ih.configure(e?{inlineOptions:{onClick:(l,i)=>{var s;return(s=r.onOpenMathPopover)==null?void 0:s.call(r,l,i,"inline")}},blockOptions:{onClick:(l,i)=>{var s;return(s=r.onOpenMathPopover)==null?void 0:s.call(r,l,i,"block")}}}:{inlineOptions:{},blockOptions:{}})),t("autoLinkTitle",()=>Sf),t("textStyle",()=>Xc.TextStyle),t("color",()=>Yc),t("highlight",()=>Jc.configure({multicolor:!0})),t("commentMark",()=>ju),t("commentBlock",()=>Ju),t("mention",()=>tc),t("smartPaste",()=>f4.configure({handlers:$4,fileUploadHandler:r.fileUploadHandler})),t("tableCellEnter",()=>p4),t("slashInsert",()=>e4.configure({onOpen:r.onOpenSlashInsert??(()=>{})}))].filter(l=>l!==null);return _e.useEditor({editable:e,extensions:o,content:r.initialContent,editorProps:{attributes:{spellcheck:"false"}},onUpdate({editor:l}){var i;e&&(r.isSettingContent.value||(i=r.onHtmlUpdate)==null||i.call(r,l.getHTML()))},onSelectionUpdate(){var l;e&&((l=r.onSelectionUpdate)==null||l.call(r))}})}function Ut(r){return Array.from(r.querySelectorAll(":scope > tr, :scope > thead > tr, :scope > tbody > tr, :scope > tfoot > tr"))}function Ir(r){return r?Array.from(r.children).filter(e=>e instanceof HTMLElement&&(e.tagName==="TD"||e.tagName==="TH")):[]}function Hn(r){return Ir(r)[0]??null}function U4(r){const e=a.reactive({top:0,left:0,width:0,height:0}),t=a.ref([]),n=a.ref([]),o=a.ref([]),l=a.ref(!1),i=a.ref(!1);function s(p){var w;const v=(w=r.value)==null?void 0:w.view;if(!v)return null;let b=null;return v.state.doc.descendants((k,T)=>{if(k.type.name!=="table")return!0;const E=v.nodeDOM(T);return E===p||E instanceof HTMLElement&&E.contains(p)?(b={node:k,pos:T},!1):!0}),b}function u(p){var k,T;const v=((k=s(p))==null?void 0:k.node)??null;if(!v){const E=Ut(p),M=Ir(E[0]);l.value=M.length>0&&M.every(B=>B.tagName==="TH"),i.value=E.length>0&&E.every(B=>{var D;return((D=Hn(B))==null?void 0:D.tagName)==="TH"});return}const b=[];v.forEach(E=>{E.type.name==="tableRow"&&b.push(E)});const w=[];(T=b[0])==null||T.forEach(E=>w.push(E)),l.value=w.length>0&&w.every(E=>E.type.name==="tableHeader"),i.value=b.length>0&&b.every(E=>{var M;return((M=E.firstChild)==null?void 0:M.type.name)==="tableHeader"})}function d(p){var T;const v=Ut(p),b=Ir(v[0]),w=s(p);if(!b.length){o.value=[];return}const k=[];if(w){const E=[];w.node.forEach(M=>{M.type.name==="tableRow"&&E.push(M)}),(T=E[0])==null||T.forEach(M=>k.push(M))}o.value=b.map((E,M)=>{var z;const B=E.getBoundingClientRect(),D=((z=k[M])==null?void 0:z.attrs.align)??null;return{pos:B.right-12,y:B.top+B.height/2,colIndex:M,align:D??Vr(E)}})}function m(p){const v=p.getBoundingClientRect();e.top=v.top,e.left=v.left,e.width=v.width,e.height=v.height,u(p),d(p);const b=Ut(p),w=b.map((E,M)=>({pos:E.getBoundingClientRect().top,index:M}));if(b.length&&w.push({pos:b[b.length-1].getBoundingClientRect().bottom,index:b.length}),t.value=w,!b[0]){n.value=[];return}const k=Ir(b[0]),T=k.map((E,M)=>({pos:E.getBoundingClientRect().left,index:M}));k.length&&T.push({pos:k[k.length-1].getBoundingClientRect().right,index:k.length}),n.value=T}function h(){t.value=[],n.value=[],o.value=[]}return{tableBounds:e,rowDots:t,colDots:n,colAlignDots:o,hasHeaderRow:l,hasHeaderCol:i,findPmTableState:s,refreshDots:m,refreshHeaderState:u,refreshColumnAlignDots:d,clearDots:h}}function W4(r,e,t,n,o,l){function i(H){if(!r.value||!H.isConnected)return;const A=r.value.view;try{const R=A.posAtDOM(H,0),K=A.state.doc.resolve(R+1);A.dispatch(A.state.tr.setSelection(ze.create(A.state.doc,K.pos)))}catch{}}function s(){if(!e.value)return;const H=Hn(Ut(e.value)[0]);H&&i(H)}function u(){if(!e.value)return;const H=Ut(e.value),A=H[H.length-1],R=Hn(A);R&&i(R)}function d(){if(!e.value)return;const H=Ir(Ut(e.value)[0]),A=H[H.length-1];A&&i(A)}function m(H){if(!e.value||!r.value)return;const A=Ut(e.value),R=H===0?A[0]:A[H-1]??A[A.length-1],K=Hn(R);K&&(i(K),H===0?r.value.commands.addRowBefore():r.value.commands.addRowAfter(),requestAnimationFrame(()=>{e.value=null}))}function h(H){if(!e.value||!r.value)return;const A=Ir(Ut(e.value)[0]),R=H===0?A[0]:A[H-1]??A[A.length-1];R&&(i(R),H===0?r.value.commands.addColumnBefore():r.value.commands.addColumnAfter(),requestAnimationFrame(()=>{e.value=null}))}function p(){if(!r.value)return;const{state:H,view:A}=r.value,R=H.selection.$anchor;let K=null,J=null;for(let le=R.depth;le>0;le--){const ee=R.node(le).type.name;K===null&&ee==="table"&&(K=R.before(le)),J===null&&(ee==="tableCell"||ee==="tableHeader")&&(J=R.before(le))}const te=K!==null?A.nodeDOM(K):null,Z=J!==null?A.nodeDOM(J):null;if(e.value=te instanceof HTMLElement?te:null,t.value=Z instanceof HTMLElement?Z:null,e.value&&o(e.value),t.value){const le=t.value.getBoundingClientRect();n.value={top:le.top,left:le.left,width:le.width,height:le.height}}}function v(H){!t.value||!r.value||(i(t.value),H(),requestAnimationFrame(p))}function b(H){!t.value||!r.value||(i(t.value),H(),requestAnimationFrame(l))}function w(){v(()=>r.value.commands.addRowBefore())}function k(){v(()=>r.value.commands.addRowAfter())}function T(){v(()=>r.value.commands.addColumnBefore())}function E(){v(()=>r.value.commands.addColumnAfter())}function M(){b(()=>r.value.chain().focus().deleteRow().run())}function B(){b(()=>r.value.chain().focus().deleteColumn().run())}const D={rowBefore:w,rowAfter:k,colBefore:T,colAfter:E,delRow:M,delCol:B};function z(){t.value&&i(t.value)}function W(){if(!r.value||!t.value)return null;try{const H=r.value.view.posAtDOM(t.value,0),A=r.value.state.doc.nodeAt(H);if(A&&!A.isText)return H;const R=H-1;return R>=0&&r.value.state.doc.nodeAt(R)?R:null}catch{return null}}return{cellOps:D,focusCell:i,focusFirstCell:s,focusLastRowCell:u,focusLastColCell:d,focusHoveredCell:z,insertRowAt:m,insertColAt:h,refreshCurrentCellFromSelection:p,getCurrentCellRootPMPos:W}}function ic(r,e){const t=a.ref(!1),n=a.ref(null),o=a.ref(null),l=a.ref(null);let i=null;const{tableBounds:s,rowDots:u,colDots:d,colAlignDots:m,hasHeaderRow:h,hasHeaderCol:p,findPmTableState:v,refreshDots:b,clearDots:w}=U4(e);function k(){i&&(clearTimeout(i),i=null)}function T(){k(),t.value=!1,n.value=null,w(),o.value=null,l.value=null}const{cellOps:E,focusCell:M,focusFirstCell:B,focusLastRowCell:D,focusLastColCell:z,focusHoveredCell:W,getCurrentCellRootPMPos:H,insertRowAt:A,insertColAt:R}=W4(e,o,l,n,b,T);function K(){i||(i=setTimeout(()=>{i=null,T()},200))}function J(){k()}function te(N){var oe;const O=N.target;if((oe=O.closest)!=null&&oe.call(O,".table-tools-overlay"))return;const $=O.closest("table");if(!$){n.value=null,l.value=null,K();return}k(),o.value!==$&&(o.value=$,b($),t.value=!0);const X=O.closest("td, th");if(X&&X!==l.value){l.value=X;const ve=X.getBoundingClientRect();n.value={top:ve.top,left:ve.left,width:ve.width,height:ve.height}}}function Z(N){A(N),t.value=!1}function le(N){R(N),t.value=!1}function ee(){!e.value||!o.value||(D(),e.value.commands.addRowAfter(),requestAnimationFrame(()=>{o.value&&b(o.value)}))}function we(){!e.value||!o.value||(z(),e.value.commands.addColumnAfter(),requestAnimationFrame(()=>{o.value&&b(o.value)}))}function pe(){!o.value||!e.value||(B(),e.value.chain().focus().toggleHeaderRow().run())}function se(){!o.value||!e.value||(B(),e.value.chain().focus().toggleHeaderColumn().run())}function I(N,O){if(!e.value||!o.value)return;const{view:$}=e.value;try{const X=v(o.value);if(!X)return;let oe=null,ve=X.node,Be=X.pos+1,$e=null,ot=e.value.state.tr;if(typeof O=="number")$e=O,oe=gl.TableMap.get(X.node);else{l.value&&M(l.value);const Xe=e.value.state;ot=Xe.tr;const ue=gl.selectedRect(Xe);oe=ue.map,ve=ue.table,Be=ue.tableStart,$e=ue.left}if($e===null||!oe||$e<0||$e>=oe.width)return;for(let Xe=0;Xe<oe.height;Xe++){const ue=oe.map[Xe*oe.width+$e],me=ve.nodeAt(ue);me&&(me.attrs.align??null)!==N&&ot.setNodeMarkup(Be+ue,null,{...me.attrs,align:N})}ot.steps.length&&$.dispatch(ot),requestAnimationFrame(()=>{o.value&&b(o.value)})}catch{}}function P(){B()}function V(){!e.value||!o.value||(B(),e.value.chain().focus().deleteTable().run(),T())}function q(){if(!e.value||!o.value)return;const N=v(o.value);N&&vl(e.value,N.pos,"copyTable")}function ae(){if(!e.value||!o.value)return;const N=v(o.value);N&&(vl(e.value,N.pos,"cutTable"),T())}function ge(){var N;return o.value?((N=v(o.value))==null?void 0:N.pos)??null:null}function ne(){if(!e.value)return;const{state:N,view:O}=e.value,{selection:$}=N,X=$.$anchor;for(let oe=X.depth;oe>0;oe--)if(X.node(oe).type.name==="table"){const ve=X.before(oe);try{const Be=O.nodeDOM(ve);Be instanceof HTMLElement&&(k(),o.value=Be,b(Be),t.value=!0)}catch{}return}T()}return{tableVisible:t,tableBounds:s,rowDots:u,colDots:d,colAlignDots:m,hoveredCellBounds:n,hasHeaderRow:h,hasHeaderCol:p,onTableMouseMove:te,onTableSelectionUpdate:ne,keepAlive:J,scheduleHide:K,insertRowAt:Z,insertColAt:le,cellOps:E,tableAddRowAfter:ee,tableAddColumnAfter:we,tableToggleHeaderRow:pe,tableToggleHeaderColumn:se,setColumnAlign:I,tableDeleteTable:V,tableCopyTable:q,tableCutTable:ae,getCurrentTableRootPMPos:ge,tableFocusFirstCell:P,focusHoveredCell:W,getCurrentCellRootPMPos:H}}function _4(r,e,t){let n=null;function o(i){const s=i.target.closest("a.pm-link[href]");s&&e(s.getAttribute("href")??"",s.textContent??"",s.getBoundingClientRect())}function l(i){var u,d;const s=i;(u=s.target)!=null&&u.closest("a.pm-link[href]")&&((d=s.relatedTarget)!=null&&d.closest("a.pm-link[href]")||t())}a.onMounted(()=>{requestAnimationFrame(()=>{var i;n=((i=r.value)==null?void 0:i.view.dom)??null,n&&(n.addEventListener("mouseover",o),n.addEventListener("mouseout",l))})}),a.onBeforeUnmount(()=>{n==null||n.removeEventListener("mouseover",o),n==null||n.removeEventListener("mouseout",l),n=null})}function G4(r,e,t){let n=null,o=!1,l=0;function i(){const v=document.activeElement;return v instanceof Element&&v.closest(".pagely-embed-block")!==null}function s(){if(i())return null;const v=window.getSelection();if(!v||v.isCollapsed||v.rangeCount===0||!(n!=null&&n.contains(v.anchorNode)))return null;const b=v.getRangeAt(0).getBoundingClientRect();return b.width===0&&b.height===0?null:b}function u(){o=!0,t()}function d(){l=Date.now()+600,t()}function m(){o=!1,requestAnimationFrame(()=>{if(Date.now()<l||i()){t();return}const v=s();v&&e(v)})}function h(){if(o)return;if(Date.now()<l||i()){t();return}const v=s();v?e(v):t()}function p(v){const b=v.detail;if(!(!b||b.editor!==r.value)){if(Date.now()<l||i()){t();return}b.rect?e(b.rect):t()}}a.onMounted(()=>{requestAnimationFrame(()=>{var v,b;n=((v=r.value)==null?void 0:v.view.dom)??null,n&&(n.addEventListener("mousedown",u),document.addEventListener("mouseup",m),window.addEventListener("pagely:hide-selection-toolbar",d),window.addEventListener("pagely:code-selection-toolbar",p),(b=r.value)==null||b.on("selectionUpdate",h))})}),a.onBeforeUnmount(()=>{var v;n==null||n.removeEventListener("mousedown",u),document.removeEventListener("mouseup",m),window.removeEventListener("pagely:hide-selection-toolbar",d),window.removeEventListener("pagely:code-selection-toolbar",p),(v=r.value)==null||v.off("selectionUpdate",h),n=null})}const K4=["onKeydown"],Y4=["onKeydown"],J4={key:0,class:"math-popover-error"},X4={class:"math-popover-footer"},j4={class:"math-popover-help",href:"https://katex.org/docs/supported.html",target:"_blank",rel:"noopener noreferrer"},Q4=a.defineComponent({__name:"MathPopover",props:{visible:{type:Boolean},anchorRect:{},initialLatex:{}},emits:["confirm","close"],setup(r,{emit:e}){const t=r,n=e,o=a.ref(null),l=a.ref(""),i=a.ref("");let s=0;function u(){s&&window.cancelAnimationFrame(s),a.nextTick(()=>{s=window.requestAnimationFrame(()=>{var p,v;s=0,(p=o.value)==null||p.focus({preventScroll:!0}),(v=o.value)==null||v.select()})})}a.watch(()=>t.visible,p=>{p&&(l.value=t.initialLatex,i.value="",u())},{flush:"post"}),a.onBeforeUnmount(()=>{s&&window.cancelAnimationFrame(s)});const d=a.computed(()=>{const p=t.anchorRect;if(!p)return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};const v=p.bottom+8,b=p.left;return{position:"fixed",top:`${v}px`,left:`${b}px`}});function m(){const p=l.value.trim();if(!p){h();return}try{Yu.renderToString(p,{throwOnError:!0})}catch{i.value="LaTeX 语法有误";return}n("confirm",l.value)}function h(){n("close")}return(p,v)=>(a.openBlock(),a.createBlock(a.Teleport,{to:"body"},[r.visible?(a.openBlock(),a.createElementBlock("div",{key:0,class:"math-popover-backdrop",onMousedown:a.withModifiers(h,["self"])},[a.createElementVNode("div",{class:"math-popover",style:a.normalizeStyle(d.value),onKeydown:a.withKeys(a.withModifiers(m,["prevent","stop"]),["esc"])},[v[3]||(v[3]=a.createElementVNode("div",{class:"math-popover-title"},"添加 LaTeX 公式",-1)),a.withDirectives(a.createElementVNode("input",{ref_key:"inputRef",ref:o,"onUpdate:modelValue":v[0]||(v[0]=b=>l.value=b),autofocus:"",class:"math-popover-input",placeholder:"请输入公式",onKeydown:[a.withKeys(a.withModifiers(m,["prevent","stop"]),["esc"]),a.withKeys(a.withModifiers(m,["prevent","stop"]),["enter"])]},null,40,Y4),[[a.vModelText,l.value]]),i.value?(a.openBlock(),a.createElementBlock("div",J4,a.toDisplayString(i.value),1)):a.createCommentVNode("",!0),a.createElementVNode("div",X4,[v[2]||(v[2]=a.createElementVNode("span",{class:"math-popover-hint"},"Enter / ESC 保存",-1)),a.createElementVNode("a",j4,[a.createVNode(a.unref(L.HelpCircle),{size:13,"stroke-width":1.8}),v[1]||(v[1]=a.createElementVNode("span",null,"查看帮助文档",-1))])])],44,K4)],32)):a.createCommentVNode("",!0)]))}}),Z4=gt(Q4,[["__scopeId","data-v-8b9f6fbc"]]),Zr=new Ss("headingCollapse");function fl(r,e){if(e.size===0)return Le.empty;const t=[];let n=null;return r.forEach((o,l)=>{n!==null&&(o.type.name==="heading"&&o.attrs.level<=n?n=null:t.push(vt.node(l,l+o.nodeSize,{class:"heading-collapsed-content"}))),o.type.name==="heading"&&e.has(l)&&(n=o.attrs.level)}),Le.create(r,t)}function e2(){return new Ts({key:Zr,state:{init(r,e){const t=new Set;return{collapsed:t,decorations:fl(e.doc,t)}},apply(r,e,t,n){const o=r.getMeta(Zr);if(o){const l=new Set(e.collapsed);return l.has(o.toggle)?l.delete(o.toggle):l.add(o.toggle),{collapsed:l,decorations:fl(n.doc,l)}}if(r.docChanged){const l=new Set;return e.collapsed.forEach(i=>l.add(r.mapping.map(i))),{collapsed:l,decorations:fl(n.doc,l)}}return e}},props:{decorations(r){var e;return((e=Zr.getState(r))==null?void 0:e.decorations)??Le.empty}}})}const t2=new Set(["H1","H2","H3","H4","H5","H6"]);function No(){const r=e2(),e=Me.Extension.create({name:"headingCollapse",addProseMirrorPlugins(){return[r]}}),t=a.ref(0);function n(o,l,i){const s=()=>{t.value++};let u;const d=()=>{u&&(u.off("transaction",s),u=void 0)},m=()=>{o.value&&o.value!==u&&(d(),u=o.value,u.on("transaction",s))};m(),a.onBeforeUnmount(d);const h=a.computed(()=>(t.value,t2.has(l()))),p=a.computed(()=>{t.value,m();const b=i(),w=o.value&&Zr.getState(o.value.state);return b!==null&&!!(w!=null&&w.collapsed.has(b))});function v(){const b=i();if(b===null||!o.value)return;const w={toggle:b};o.value.view.dispatch(o.value.view.state.tr.setMeta(Zr,w))}return{isHeadingBlock:h,isCurrentCollapsed:p,onCollapseClick:v}}return{extension:e,bind:n}}const r2=[{color:"#1f2329",label:"默认黑"},{color:"#8f959e",label:"灰色"},{color:"#d83931",label:"红色"},{color:"#de7802",label:"橙色"},{color:"#dc9b04",label:"黄色"},{color:"#2ea121",label:"绿色"},{color:"#245bdb",label:"蓝色"},{color:"#6425d0",label:"紫色"}],n2=[{color:null,label:"无背景"},{color:"rgb(242,243,245)",label:"浅灰"},{color:"rgb(251,191,188)",label:"浅红"},{color:"rgba(254,212,164,0.8)",label:"浅橙"},{color:"rgba(255,246,122,0.8)",label:"浅黄"},{color:"rgba(183,237,177,0.8)",label:"浅绿"},{color:"rgba(186,206,253,0.7)",label:"浅蓝"},{color:"rgba(205,178,250,0.7)",label:"浅紫"},{color:"rgba(222,224,227,0.8)",label:"中灰"},{color:"rgb(187,191,196)",label:"深灰"},{color:"rgb(247,105,100)",label:"深红"},{color:"rgb(255,165,61)",label:"深橙"},{color:"rgb(255,233,40)",label:"深黄"},{color:"rgb(98,210,86)",label:"深绿"},{color:"rgba(78,131,253,0.55)",label:"深蓝"},{color:"rgba(150,88,243,0.6)",label:"深紫"}],ml=[{id:"paragraph",label:"正文",icon:L.Type,isActive:r=>!!(r!=null&&r.isActive("paragraph")),apply:r=>r.chain().focus().setParagraph().run()},{id:"h1",label:"标题 1",icon:L.Heading1,isActive:r=>!!(r!=null&&r.isActive("heading",{level:1})),apply:r=>r.chain().focus().setHeading({level:1}).run()},{id:"h2",label:"标题 2",icon:L.Heading2,isActive:r=>!!(r!=null&&r.isActive("heading",{level:2})),apply:r=>r.chain().focus().setHeading({level:2}).run()},{id:"h3",label:"标题 3",icon:L.Heading3,isActive:r=>!!(r!=null&&r.isActive("heading",{level:3})),apply:r=>r.chain().focus().setHeading({level:3}).run()}],o2={class:"pagely-color-panel"},l2={class:"pagely-color-group"},a2=["title","onClick"],i2={class:"pagely-color-group pagely-color-group--bg"},s2=["title","onClick"],u2=a.defineComponent({__name:"ColorPanel",props:{currentFontColor:{},currentBgColor:{}},emits:["applyFontColor","applyBgColor","reset"],setup(r){return(e,t)=>(a.openBlock(),a.createElementBlock("div",o2,[t[1]||(t[1]=a.createElementVNode("p",{class:"pagely-color-group-title"},"字体颜色",-1)),a.createElementVNode("div",l2,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(r2),n=>(a.openBlock(),a.createElementBlock("button",{key:n.label,class:a.normalizeClass(["pagely-color-btn pagely-color-btn--text",{selected:r.currentFontColor===n.color}]),title:n.label,type:"button",onClick:o=>e.$emit("applyFontColor",n.color)},[a.createVNode(a.unref(L.Baseline),{size:18,"stroke-width":1.5,style:a.normalizeStyle({color:n.color??"#1f2329"})},null,8,["style"])],10,a2))),128))]),t[2]||(t[2]=a.createElementVNode("p",{class:"pagely-color-group-title"},"背景颜色",-1)),a.createElementVNode("div",i2,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(n2),n=>(a.openBlock(),a.createElementBlock("button",{key:n.label,class:a.normalizeClass(["pagely-color-btn pagely-color-btn--bg",{selected:r.currentBgColor===n.color,"is-none":n.color===null}]),title:n.label,type:"button",style:a.normalizeStyle(n.color?{backgroundColor:n.color}:{}),onClick:o=>e.$emit("applyBgColor",n.color)},null,14,s2))),128))]),a.createElementVNode("button",{type:"button",class:"pagely-color-reset",onClick:t[0]||(t[0]=n=>e.$emit("reset"))},"恢复默认")]))}}),sc=gt(u2,[["__scopeId","data-v-bd597618"]]),c2=["data-placement"],d2={class:"pagely-menu-scroll"},f2=["disabled"],m2={class:"pagely-item-icon"},h2={key:1,class:"pagely-menu-divider"},p2={key:0,class:"pagely-menu-tiles"},g2=["title","onClick"],v2={key:0,class:"pagely-menu-section-label"},b2=["disabled","onClick","onMouseenter"],y2={class:"pagely-item-icon"},w2={class:"pagely-item-label"},k2={key:1,class:"pagely-submenu-arrow"},x2={key:2,class:"pagely-menu-divider"},C2=["disabled","onClick"],T2={class:"pagely-item-icon"},E2={class:"pagely-item-label"},S2={class:"pagely-preview-body"},M2={class:"pagely-preview-title"},A2={class:"pagely-preview-desc"},Ei="#1f2329",B2=4,N2=240,L2=a.defineComponent({__name:"BlockMenu",props:{visible:{type:Boolean},menuTop:{},menuLeft:{},placement:{},editor:{},blockInfo:{},blockTargetPos:{},enableComment:{type:Boolean}},emits:["close","menu-enter","menu-leave","convert","comment"],setup(r,{emit:e}){const t=r,n=e;function o(){const N=t.editor,O=t.blockTargetPos;if(!N||O===null)return null;try{const $=N.state.doc.resolve(O+1);return{from:$.start(),to:$.end()}}catch{return null}}function l(N){const O=t.editor,$=o();if(!O||!$)return null;let X=null;return O.state.doc.nodesBetween($.from,$.to,oe=>{if(X)return!1;const ve=oe.marks.find(Be=>Be.type.name===N);return ve&&(X=ve.attrs),!0}),X}const i=a.computed(()=>{const N=l("textStyle");return(N==null?void 0:N.color)??Ei}),s=a.computed(()=>{const N=l("highlight");return(N==null?void 0:N.color)??null});function u(N){const O=t.editor,$=o();if(!O||!$)return;const X=O.chain().focus().setTextSelection($);N===null||N===Ei?X.unsetColor().run():X.setColor(N).run()}function d(N){const O=t.editor,$=o();if(!O||!$)return;const X=O.chain().focus().setTextSelection($);N===null?X.unsetHighlight().run():X.setHighlight({color:N}).run()}function m(){const N=t.editor,O=o();!N||!O||N.chain().focus().setTextSelection(O).unsetColor().unsetHighlight().run()}const h=a.ref(null),p=a.ref(!1),v=a.ref(0);let b=null;a.onBeforeUnmount(()=>{b&&clearTimeout(b)}),a.watch(()=>t.visible,N=>{N&&(b&&(clearTimeout(b),b=null),h.value=null,p.value=!1)});const w=Jl({visible:()=>t.visible,rootSelector:".pagely-block-menu",estimatedHeight:()=>{var N;return((N=M.value)==null?void 0:N.panel)==="color"?N2:Math.max(44,v.value*pd+12)},fallbackTop:()=>t.menuTop,fallbackLeft:()=>t.menuLeft+Gt}),k=w.rootId,T=a.computed(()=>{var N;return((N=M.value)==null?void 0:N.panel)==="color"?"color":null}),E=a.computed(()=>{if(!h.value||B.value.length>0)return null;for(const N of le.value)for(const O of N.items)if(O.id===h.value&&O.description)return O;return null}),M=a.computed(()=>{if(!k.value)return null;for(const N of le.value){const O=N.items.find($=>$.id===k.value);if(O)return O}return null}),B=a.computed(()=>{var N,O;return((O=(N=M.value)==null?void 0:N.children)==null?void 0:O.map($=>Kl[$]).filter(Boolean))??[]});function D(N,O){var $;b&&(clearTimeout(b),b=null),w.clearCloseTimer(),h.value=N.id,we(N)?(v.value=(($=N.children)==null?void 0:$.length)??0,O&&w.open(N.id,O)):w.hovered.value||w.close()}function z(){b=setTimeout(()=>{p.value||(h.value=null)},un),w.scheduleClose()}function W(N){var O;return!!((O=N==null?void 0:N.closest)!=null&&O.call(N,".pagely-block-menu, .pagely-block-submenu, .pagely-block-color-side, .pagely-hover-preview"))}function H(){h.value=null,p.value=!1,w.close()}function A(N){const O=N.relatedTarget;W(O)||(H(),n("menu-leave"))}function R(N){w.onPanelMouseLeave();const O=N.relatedTarget;W(O)||(H(),n("menu-leave"))}function K(N){p.value=!1;const O=N.relatedTarget;W(O)||(H(),n("menu-leave"))}const J=a.computed(()=>({position:"fixed",top:`${t.menuTop}px`,left:`${t.menuLeft}px`,zIndex:"300","--pagely-menu-panel-width":`${Gt}px`,"--menu-enter-translate":Di(t.placement)})),te=a.computed(()=>({position:"fixed",top:`${t.menuTop}px`,left:`${t.menuLeft+Gt+oo+B2}px`,zIndex:"301"})),Z=w.style,le=a.computed(()=>(ur[t.blockInfo.tag]??ur.P).sections);function ee(){n("close")}function we(N){var O;return!!((O=N.children)!=null&&O.length)||!!N.panel}function pe(N){return we(N)?!1:N.action==="indent"?N.indentDir==="inc"?!Qi(t.editor):!Zi(t.editor):!1}function se(){const N=t.editor,O=t.blockTargetPos;if(!N||O===null)return null;const $=N.state.doc.nodeAt(O);if(($==null?void 0:$.type.name)==="table")return $;try{const X=N.state.doc.resolve(O+1);for(let oe=X.depth;oe>=0;oe--){const ve=X.node(oe);if(ve.type.name==="table")return ve}}catch{return null}return null}function I(N){const O=[];return N.forEach($=>{$.type.name==="tableRow"&&O.push($)}),O}function P(N){const O=I(N)[0];if(!O)return!1;const $=[];return O.forEach(X=>$.push(X)),$.length>0&&$.every(X=>X.type.name==="tableHeader")}function V(N){const O=I(N);return O.length>0&&O.every($=>{var X;return((X=$.firstChild)==null?void 0:X.type.name)==="tableHeader"})}function q(N){const O=se();return O?N.id==="TOGGLE_TABLE_HEADER_ROW"?P(O):N.id==="TOGGLE_TABLE_HEADER_COL"?V(O):!1:!1}function ae(N){we(N)||pe(N)||(n("convert",N.id),n("close"))}function ge(N){n("convert",N),ee()}function ne(){t.blockTargetPos!==null&&(n("comment"),n("close"))}return(N,O)=>(a.openBlock(),a.createBlock(a.Teleport,{to:"body"},[r.visible?(a.openBlock(),a.createElementBlock("div",{key:0,class:"pagely-block-menu-wrapper",onClick:O[8]||(O[8]=a.withModifiers(()=>{},["stop"])),onMousedown:O[9]||(O[9]=a.withModifiers(()=>{},["stop"]))},[a.createElementVNode("div",{class:"pagely-block-menu",style:a.normalizeStyle(J.value),"data-placement":r.placement,onMouseenter:O[0]||(O[0]=$=>N.$emit("menu-enter")),onMouseleave:O[1]||(O[1]=$=>A($))},[a.createElementVNode("div",d2,[t.enableComment?(a.openBlock(),a.createElementBlock("button",{key:0,class:a.normalizeClass(["pagely-menu-item",{"pagely-disabled":t.blockTargetPos===null}]),disabled:t.blockTargetPos===null,onClick:ne},[a.createElementVNode("span",m2,[a.createVNode(a.unref(L.MessageSquare),{size:16,"stroke-width":1.5})]),O[10]||(O[10]=a.createElementVNode("span",{class:"pagely-item-label"},"评论",-1))],10,f2)):a.createCommentVNode("",!0),t.enableComment&&le.value.length>0?(a.openBlock(),a.createElementBlock("div",h2)):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(le.value,($,X)=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:X},[$.style==="tiles"?(a.openBlock(),a.createElementBlock("div",p2,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList($.items,oe=>(a.openBlock(),a.createElementBlock("button",{key:oe.id,class:a.normalizeClass(["pagely-menu-tile",{"pagely-current":r.blockInfo.currentTypeIds.includes(oe.id)}]),title:oe.label,onClick:ve=>ge(oe.id)},[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(oe.icon),{size:18,"stroke-width":1.5}))],10,g2))),128))])):(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[$.label?(a.openBlock(),a.createElementBlock("div",v2,a.toDisplayString($.label),1)):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList($.items,oe=>(a.openBlock(),a.createElementBlock("button",{key:oe.id,class:a.normalizeClass(["pagely-menu-item",{"pagely-danger":oe.danger,"pagely-disabled":pe(oe),"pagely-active":q(oe),"pagely-has-submenu":we(oe),"pagely-submenu-open":a.unref(k)===oe.id,"pagely-item-hover-preview":h.value===oe.id}]),disabled:pe(oe),onClick:ve=>ae(oe),onMouseenter:ve=>D(oe,ve),onMouseleave:z},[a.createElementVNode("span",y2,[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(oe.icon),{size:16,"stroke-width":1.5}))]),a.createElementVNode("span",w2,a.toDisplayString(oe.label),1),oe.toggle?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(["pagely-item-toggle",{"pagely-item-toggle-on":q(oe)}]),"aria-hidden":"true"},[...O[11]||(O[11]=[a.createElementVNode("span",{class:"pagely-item-toggle-thumb"},null,-1)])],2)):a.createCommentVNode("",!0),we(oe)?(a.openBlock(),a.createElementBlock("span",k2,"›")):a.createCommentVNode("",!0)],42,b2))),128))],64)),X<le.value.length-1?(a.openBlock(),a.createElementBlock("div",x2)):a.createCommentVNode("",!0)],64))),128))])],44,c2),B.value.length>0?(a.openBlock(),a.createElementBlock("div",{key:0,class:"pagely-block-submenu",style:a.normalizeStyle(a.unref(Z)),"data-placement":"right",onMouseenter:O[2]||(O[2]=(...$)=>a.unref(w).onPanelMouseEnter&&a.unref(w).onPanelMouseEnter(...$)),onMouseleave:O[3]||(O[3]=$=>R($))},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(B.value,$=>(a.openBlock(),a.createElementBlock("button",{key:$.id,class:a.normalizeClass(["pagely-menu-item",{"pagely-danger":$.danger,"pagely-disabled":pe($),"pagely-active":q($)}]),disabled:pe($),onClick:X=>ae($)},[a.createElementVNode("span",T2,[(a.openBlock(),a.createBlock(a.resolveDynamicComponent($.icon),{size:16,"stroke-width":1.5}))]),a.createElementVNode("span",E2,a.toDisplayString($.label),1),$.toggle?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(["pagely-item-toggle",{"pagely-item-toggle-on":q($)}]),"aria-hidden":"true"},[...O[12]||(O[12]=[a.createElementVNode("span",{class:"pagely-item-toggle-thumb"},null,-1)])],2)):a.createCommentVNode("",!0)],10,C2))),128))],36)):a.createCommentVNode("",!0),T.value==="color"?(a.openBlock(),a.createElementBlock("div",{key:1,class:"pagely-block-color-side",style:a.normalizeStyle(a.unref(Z)),"data-placement":"right",onMouseenter:O[4]||(O[4]=(...$)=>a.unref(w).onPanelMouseEnter&&a.unref(w).onPanelMouseEnter(...$)),onMouseleave:O[5]||(O[5]=$=>R($))},[a.createVNode(sc,{"current-font-color":i.value,"current-bg-color":s.value,onApplyFontColor:u,onApplyBgColor:d,onReset:m},null,8,["current-font-color","current-bg-color"])],36)):a.createCommentVNode("",!0),E.value?(a.openBlock(),a.createElementBlock("div",{key:2,class:"pagely-hover-preview",style:a.normalizeStyle(te.value),"data-placement":"right",onMouseenter:O[6]||(O[6]=$=>p.value=!0),onMouseleave:O[7]||(O[7]=$=>K($))},[O[13]||(O[13]=a.createElementVNode("span",{class:"pagely-preview-thumb"},[a.createElementVNode("svg",{viewBox:"0 0 212 100",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[a.createElementVNode("line",{x1:"48",y1:"26",x2:"86",y2:"26",stroke:"#c4c7cc","stroke-width":"1.2"}),a.createElementVNode("line",{x1:"126",y1:"26",x2:"164",y2:"26",stroke:"#c4c7cc","stroke-width":"1.2"}),a.createElementVNode("line",{x1:"106",y1:"42",x2:"106",y2:"58",stroke:"#c4c7cc","stroke-width":"1.2"}),a.createElementVNode("line",{x1:"106",y1:"74",x2:"106",y2:"86",stroke:"#c4c7cc","stroke-width":"1.2"}),a.createElementVNode("line",{x1:"66",y1:"82",x2:"106",y2:"82",stroke:"#c4c7cc","stroke-width":"1.2","stroke-dasharray":"3 2"}),a.createElementVNode("rect",{x:"10",y:"14",width:"38",height:"24",rx:"4",fill:"#e8f5e9",stroke:"#66bb6a","stroke-width":"1.2"}),a.createElementVNode("text",{x:"29",y:"30","text-anchor":"middle",fill:"#2e7d32","font-size":"8","font-weight":"500"},"Data"),a.createElementVNode("circle",{cx:"106",cy:"26",r:"16",fill:"#ede7f6",stroke:"#9575cd","stroke-width":"1.2"}),a.createElementVNode("text",{x:"106",y:"29","text-anchor":"middle",fill:"#5e35b1","font-size":"7","font-weight":"500"},"Open"),a.createElementVNode("polygon",{points:"164,10 180,26 164,42 148,26",fill:"#fff8e1",stroke:"#ffb300","stroke-width":"1.2"}),a.createElementVNode("text",{x:"164",y:"29","text-anchor":"middle",fill:"#e65100","font-size":"7","font-weight":"500"},"?"),a.createElementVNode("rect",{x:"10",y:"58",width:"38",height:"24",rx:"4",fill:"#e3f2fd",stroke:"#42a5f5","stroke-width":"1.2"}),a.createElementVNode("text",{x:"29",y:"74","text-anchor":"middle",fill:"#1565c0","font-size":"8","font-weight":"500"},"Yes"),a.createElementVNode("circle",{cx:"106",cy:"70",r:"16",fill:"#fce4ec",stroke:"#ef5350","stroke-width":"1.2"}),a.createElementVNode("text",{x:"106",y:"73","text-anchor":"middle",fill:"#c62828","font-size":"7","font-weight":"500"},"No"),a.createElementVNode("rect",{x:"148",y:"58",width:"44",height:"24",rx:"4",fill:"#fff3e0",stroke:"#ff9800","stroke-width":"1.2"}),a.createElementVNode("text",{x:"170",y:"74","text-anchor":"middle",fill:"#e65100","font-size":"8","font-weight":"500"},"Action")])],-1)),a.createElementVNode("span",S2,[a.createElementVNode("span",M2,a.toDisplayString(E.value.label),1),a.createElementVNode("span",A2,a.toDisplayString(E.value.description),1)])],36)):a.createCommentVNode("",!0)],32)):a.createCommentVNode("",!0)]))}}),uc=gt(L2,[["__scopeId","data-v-057a6f90"]]),I2="image/*,.png,.jpg,.jpeg,.gif,.webp,.bmp,.svg,.avif",z2=/\.(png|jpe?g|gif|webp|bmp|svg|avif)$/i;function D2(r){return r.type.startsWith("image/")||z2.test(r.name)}function O2(r){return new Promise(e=>{const t=new FileReader;t.onload=()=>e(typeof t.result=="string"?t.result:null),t.onerror=()=>e(null),t.readAsDataURL(r)})}function R2(r){function e(n){var o;(o=r.onBeforeSelect)==null||o.call(r),n.currentTarget.value=""}async function t(n){var s;const o=n.target,l=((s=o.files)==null?void 0:s[0])??null;if(o.value="",!l||!D2(l))return;const i=await O2(l);i&&r.onInsert({src:i,alt:l.name})}return{imageAccept:I2,onImageFileClick:e,onImageFileChange:t}}function P2(r){function e(n){var o;(o=r.onBeforeSelect)==null||o.call(r),n.currentTarget.value=""}async function t(n){var u;const o=n.target,l=((u=o.files)==null?void 0:u[0])??null;if(o.value="",!l)return;const s=await(r.uploadHandler??Sa)(l);s!=null&&s.href&&r.onInsert({href:s.href,label:s.label||l.name})}return{fileAccept:a4,onDocFileClick:e,onDocFileChange:t}}const H2={class:"pagely-link-dialog-head"},V2={class:"pagely-link-dialog-actions"},F2=["disabled"],$2=a.defineComponent({__name:"InsertLinkDialog",props:{open:{type:Boolean}},emits:["close","confirm"],setup(r,{emit:e}){const t=r,n=e,o=Math.random().toString(36).slice(2,9),l=`pagely-insert-${o}-link-text`,i=`pagely-insert-${o}-link-href`,s=a.ref(""),u=a.ref(""),d=a.ref(null),m=a.computed(()=>u.value.trim().length>0);a.watch(()=>t.open,v=>{v&&(s.value="",u.value="",a.nextTick(()=>{var b;return(b=d.value)==null?void 0:b.focus({preventScroll:!0})}))});function h(v){const b=v.trim();return b?/^(https?:|mailto:|tel:|#|\/)/i.test(b)?b:`https://${b}`:""}function p(){const v=h(u.value);v&&n("confirm",{text:s.value.trim()||v,href:v})}return(v,b)=>r.open?(a.openBlock(),a.createElementBlock("div",{key:0,class:"pagely-insert-link-dialog-backdrop",onMousedown:b[6]||(b[6]=a.withModifiers(w=>n("close"),["self"]))},[a.createElementVNode("form",{class:"pagely-insert-link-dialog",role:"dialog","aria-modal":"true","aria-label":"插入链接",onSubmit:a.withModifiers(p,["prevent"])},[a.createElementVNode("div",H2,[b[7]||(b[7]=a.createElementVNode("span",null,"插入链接",-1)),a.createElementVNode("button",{type:"button",class:"pagely-link-dialog-icon-btn","aria-label":"关闭",onClick:b[0]||(b[0]=w=>n("close"))},[a.createVNode(a.unref(L.X),{size:16,"stroke-width":1.8})])]),a.createElementVNode("label",{class:"pagely-link-field",for:l},[b[8]||(b[8]=a.createElementVNode("span",null,"文本",-1)),a.withDirectives(a.createElementVNode("input",{id:l,ref_key:"textInputEl",ref:d,"onUpdate:modelValue":b[1]||(b[1]=w=>s.value=w),name:l,type:"text",autocomplete:"off",onKeydown:b[2]||(b[2]=a.withKeys(a.withModifiers(w=>n("close"),["prevent"]),["esc"]))},null,544),[[a.vModelText,s.value]])]),a.createElementVNode("label",{class:"pagely-link-field",for:i},[b[9]||(b[9]=a.createElementVNode("span",null,"链接",-1)),a.withDirectives(a.createElementVNode("input",{id:i,"onUpdate:modelValue":b[3]||(b[3]=w=>u.value=w),name:i,type:"text",autocomplete:"off",onKeydown:b[4]||(b[4]=a.withKeys(a.withModifiers(w=>n("close"),["prevent"]),["esc"]))},null,544),[[a.vModelText,u.value]])]),a.createElementVNode("div",V2,[a.createElementVNode("button",{type:"button",class:"pagely-link-secondary",onClick:b[5]||(b[5]=w=>n("close"))},"取消"),a.createElementVNode("button",{type:"submit",class:"pagely-link-primary",disabled:!m.value},"插入",8,F2)])],32)],32)):a.createCommentVNode("",!0)}}),q2=gt($2,[["__scopeId","data-v-0af66664"]]),U2={class:"pagely-table-picker"},W2={class:"pagely-picker-head"},_2={key:0},G2=["aria-label","onMouseenter","onClick"],K2=a.defineComponent({inheritAttrs:!0,__name:"TableSizePicker",props:{maxRows:{default:8},maxCols:{default:10}},emits:["pick"],setup(r,{emit:e}){const t=r,n=e,o=a.ref(0),l=a.ref(0),i=a.computed(()=>{const m=[];for(let h=1;h<=t.maxRows;h+=1)for(let p=1;p<=t.maxCols;p+=1)m.push({key:`${h}-${p}`,row:h,col:p});return m});function s(m,h){o.value=m,l.value=h}function u(){o.value=0,l.value=0}function d(m,h){n("pick",{rows:m,cols:h})}return(m,h)=>(a.openBlock(),a.createElementBlock("div",U2,[a.createElementVNode("div",W2,[h[0]||(h[0]=a.createElementVNode("span",null,"插入支持富文本的表格",-1)),o.value>0?(a.openBlock(),a.createElementBlock("span",_2,a.toDisplayString(o.value)+" x "+a.toDisplayString(l.value),1)):a.createCommentVNode("",!0)]),a.createElementVNode("div",{class:"pagely-picker-grid",onMouseleave:u},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(i.value,p=>(a.openBlock(),a.createElementBlock("button",{key:p.key,class:a.normalizeClass(["pagely-picker-cell",{"pagely-active":p.row<=o.value&&p.col<=l.value}]),type:"button","aria-label":`插入 ${p.row} 行 ${p.col} 列表格`,onMouseenter:v=>s(p.row,p.col),onClick:v=>d(p.row,p.col)},null,42,G2))),128))],32)]))}}),cc=gt(K2,[["__scopeId","data-v-5f091973"]]),Y2=["data-placement"],J2={class:"pagely-menu-scroll"},X2={key:0,class:"pagely-menu-section-label"},j2={key:1,class:"pagely-menu-tiles"},Q2=["title","onClick"],Z2=["onMouseenter"],e5={class:"pagely-item-icon"},t5={class:"pagely-item-label"},r5=["accept"],n5=["onMouseenter"],o5={class:"pagely-item-icon"},l5={class:"pagely-item-label"},a5=["accept"],i5=["onClick","onMouseenter"],s5={class:"pagely-item-icon"},u5={class:"pagely-item-label"},c5={key:0,class:"pagely-submenu-arrow"},d5={key:3,class:"pagely-menu-divider"},f5=336,m5=a.defineComponent({__name:"InsertMenu",props:{visible:{type:Boolean},menuTop:{},menuLeft:{},placement:{},editor:{},sections:{},fileUploadHandler:{type:Function}},emits:["close","menu-enter","menu-leave","insert","cell-op"],setup(r,{emit:e}){const t=r,n=e,o=Math.random().toString(36).slice(2,9),l=`pagely-insert-${o}-image-file`,i=`pagely-insert-${o}-doc-file`,s=Jl({visible:()=>t.visible,rootSelector:".pagely-block-menu",estimatedHeight:()=>f5,fallbackTop:()=>t.menuTop,fallbackLeft:()=>t.menuLeft+Gt}),u=s.rootId;a.watch(()=>t.visible,I=>{I&&(u.value=null,s.close())});const d=a.computed(()=>({position:"fixed",top:`${t.menuTop}px`,left:`${t.menuLeft}px`,zIndex:"300","--pagely-menu-panel-width":`${Gt}px`,"--menu-enter-translate":Di(t.placement)})),m=a.computed(()=>{if(!u.value)return null;for(const I of t.sections){const P=I.items.find(V=>V.id===u.value);if(P&&!Vt(P))return P}return null}),h=a.computed(()=>{var I;return((I=m.value)==null?void 0:I.picker)??null}),p=s.style,v=a.ref(!1),{imageAccept:b,onImageFileClick:w,onImageFileChange:k}=R2({onBeforeSelect:ee,onInsert:I=>D("IMAGE",I)}),{fileAccept:T,onDocFileClick:E,onDocFileChange:M}=P2({onBeforeSelect:ee,uploadHandler:I=>{var P;return((P=t.fileUploadHandler)==null?void 0:P.call(t,I))??Sa(I)},onInsert:I=>D("FILE",I)});function B(I){n("insert",I),n("close")}function D(I,P){n("insert",I,P),n("close")}function z(I){Vt(I)||B(I.id)}function W(I){if(Vt(I)){n("cell-op",I.id),n("close");return}if(I.id==="LINK"){we();return}Z(I)||B(I.id)}function H(I,P){if(s.clearCloseTimer(),Vt(I)){ee();return}if(!Z(I)){ee();return}u.value=I.id,s.open(I.id,P)}function A(){s.scheduleClose()}function R(){s.onPanelMouseEnter()}function K(I){var V;s.onPanelMouseLeave();const P=I.relatedTarget;(V=P==null?void 0:P.closest)!=null&&V.call(P,".pagely-block-menu")||n("menu-leave")}function J(I){n("insert","TABLE",I),n("close")}function te(I){var V,q;const P=I.relatedTarget;(V=P==null?void 0:P.closest)!=null&&V.call(P,".pagely-insert-picker")||(q=P==null?void 0:P.closest)!=null&&q.call(P,".pagely-insert-link-dialog-backdrop")||(ee(),n("menu-leave"))}function Z(I){return!Vt(I)&&I.picker!==void 0}function le(I){return Vt(I)&&I.danger===!0}function ee(){u.value=null,s.close()}function we(){ee(),v.value=!0}function pe(){v.value=!1}function se(I){D("LINK",I),pe()}return(I,P)=>(a.openBlock(),a.createBlock(a.Teleport,{to:"body"},[r.visible?(a.openBlock(),a.createElementBlock("div",{key:0,class:"pagely-block-menu-wrapper pagely-insert-menu",onClick:P[7]||(P[7]=a.withModifiers(()=>{},["stop"])),onMousedown:P[8]||(P[8]=a.withModifiers(()=>{},["stop"]))},[a.createElementVNode("div",{class:"pagely-block-menu",style:a.normalizeStyle(d.value),"data-placement":r.placement,onMouseenter:P[4]||(P[4]=V=>I.$emit("menu-enter")),onMouseleave:P[5]||(P[5]=V=>te(V))},[a.createElementVNode("div",J2,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.sections,(V,q)=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:V.label},[V.label?(a.openBlock(),a.createElementBlock("div",X2,a.toDisplayString(V.label),1)):a.createCommentVNode("",!0),V.style==="tiles"?(a.openBlock(),a.createElementBlock("div",j2,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(V.items,ae=>(a.openBlock(),a.createElementBlock("button",{key:ae.id,class:"pagely-menu-tile",title:ae.label,onMouseenter:ee,onClick:ge=>z(ae)},[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(ae.icon),{size:18,"stroke-width":1.5}))],40,Q2))),128))])):(a.openBlock(!0),a.createElementBlock(a.Fragment,{key:2},a.renderList(V.items,ae=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:ae.id},[!a.unref(Vt)(ae)&&ae.id==="IMAGE"?(a.openBlock(),a.createElementBlock("label",{key:0,class:"pagely-menu-item pagely-insert-image-item",for:l,onClick:ee,onMouseenter:ge=>H(ae,ge),onMouseleave:A},[a.createElementVNode("span",e5,[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(ae.icon),{size:16,"stroke-width":1.5}))]),a.createElementVNode("span",t5,a.toDisplayString(ae.label),1),a.createElementVNode("input",{id:l,name:l,class:"pagely-insert-file-input",type:"file",accept:a.unref(b),"aria-label":"图片",onClick:P[0]||(P[0]=(...ge)=>a.unref(w)&&a.unref(w)(...ge)),onChange:P[1]||(P[1]=(...ge)=>a.unref(k)&&a.unref(k)(...ge))},null,40,r5)],40,Z2)):!a.unref(Vt)(ae)&&ae.id==="FILE"?(a.openBlock(),a.createElementBlock("label",{key:1,class:"pagely-menu-item pagely-insert-file-item",for:i,onClick:ee,onMouseenter:ge=>H(ae,ge),onMouseleave:A},[a.createElementVNode("span",o5,[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(ae.icon),{size:16,"stroke-width":1.5}))]),a.createElementVNode("span",l5,a.toDisplayString(ae.label),1),a.createElementVNode("input",{id:i,name:i,class:"pagely-insert-file-input",type:"file",accept:a.unref(T),"aria-label":"文件",onClick:P[2]||(P[2]=(...ge)=>a.unref(E)&&a.unref(E)(...ge)),onChange:P[3]||(P[3]=(...ge)=>a.unref(M)&&a.unref(M)(...ge))},null,40,a5)],40,n5)):(a.openBlock(),a.createElementBlock("button",{key:2,class:a.normalizeClass(["pagely-menu-item",{"pagely-danger":le(ae),"pagely-submenu-open":a.unref(u)===ae.id}]),onClick:ge=>W(ae),onMouseenter:ge=>H(ae,ge),onMouseleave:A},[a.createElementVNode("span",s5,[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(ae.icon),{size:16,"stroke-width":1.5}))]),a.createElementVNode("span",u5,a.toDisplayString(ae.label),1),Z(ae)?(a.openBlock(),a.createElementBlock("span",c5,"›")):a.createCommentVNode("",!0)],42,i5))],64))),128)),q<r.sections.length-1?(a.openBlock(),a.createElementBlock("div",d5)):a.createCommentVNode("",!0)],64))),128))])],44,Y2),h.value==="table"?(a.openBlock(),a.createBlock(cc,{key:0,class:"pagely-insert-picker",style:a.normalizeStyle(a.unref(p)),"data-placement":"right",onPick:J,onMouseenter:R,onMouseleave:P[6]||(P[6]=V=>K(V))},null,8,["style"])):a.createCommentVNode("",!0),a.createVNode(q2,{open:v.value,onConfirm:se,onClose:pe},null,8,["open"])],32)):a.createCommentVNode("",!0)]))}}),Ma=gt(m5,[["__scopeId","data-v-65ba9898"]]);function Aa(r=un){const e=a.ref(!1);let t=null;function n(){t&&(clearTimeout(t),t=null)}function o(){n(),e.value=!0}function l(){n(),e.value=!1}function i(){n(),t=setTimeout(()=>{e.value=!1,t=null},r)}return a.onBeforeUnmount(n),{isOpen:e,open:o,close:l,scheduleClose:i,clearCloseTimer:n}}const h5={class:"table-action-btn",type:"button","aria-label":"表格操作"},p5=a.defineComponent({__name:"TableActionMenu",props:{tableBounds:{},hasHeaderRow:{type:Boolean},hasHeaderCol:{type:Boolean},keepAlive:{type:Function},scheduleHide:{type:Function}},emits:["comment","cutTable","copyTable","toggleHeaderRow","toggleHeaderCol","deleteTable"],setup(r,{emit:e}){const t=r,n=e,o=Aa(),l=o.isOpen;function i(){t.keepAlive(),o.open()}function s(T){var M;const E=T.relatedTarget;(M=E==null?void 0:E.closest)!=null&&M.call(E,".tt-dropdown-right")||(o.scheduleClose(),t.scheduleHide())}function u(){t.keepAlive(),o.clearCloseTimer()}function d(T){var M;const E=T.relatedTarget;(M=E==null?void 0:E.closest)!=null&&M.call(E,".table-action-wrap")||(o.scheduleClose(),t.scheduleHide())}function m(){o.close()}function h(T){var E;m(),n("comment",((E=T.currentTarget)==null?void 0:E.getBoundingClientRect())??null)}function p(){m(),n("cutTable")}function v(){m(),n("copyTable")}function b(){m(),n("toggleHeaderRow")}function w(){m(),n("toggleHeaderCol")}function k(){m(),n("deleteTable")}return(T,E)=>(a.openBlock(),a.createElementBlock("div",{class:"table-tools-overlay table-action-wrap",style:a.normalizeStyle({position:"fixed",top:`${r.tableBounds.top-12}px`,left:`${r.tableBounds.left-12}px`,zIndex:"182"}),onMouseenter:i,onMouseleave:E[1]||(E[1]=M=>s(M))},[a.createElementVNode("button",h5,[a.createVNode(a.unref(L.LayoutGrid),{size:13,"stroke-width":1.8})]),a.unref(l)?(a.openBlock(),a.createElementBlock("div",{key:0,class:"tt-dropdown tt-dropdown-right",onMouseenter:u,onMouseleave:E[0]||(E[0]=M=>d(M))},[a.createElementVNode("button",{class:"tt-item",type:"button",onClick:a.withModifiers(h,["stop"])},[a.createVNode(a.unref(L.MessageSquare),{size:15,"stroke-width":1.5}),E[2]||(E[2]=a.createElementVNode("span",null,"评论",-1))]),a.createElementVNode("button",{class:"tt-item",type:"button",onClick:a.withModifiers(p,["stop"])},[a.createVNode(a.unref(L.Scissors),{size:15,"stroke-width":1.5}),E[3]||(E[3]=a.createElementVNode("span",null,"剪切",-1))]),a.createElementVNode("button",{class:"tt-item",type:"button",onClick:a.withModifiers(v,["stop"])},[a.createVNode(a.unref(L.Copy),{size:15,"stroke-width":1.5}),E[4]||(E[4]=a.createElementVNode("span",null,"复制",-1))]),E[10]||(E[10]=a.createElementVNode("div",{class:"tt-divider"},null,-1)),a.createElementVNode("div",{class:"tt-toggle-row",onClick:a.withModifiers(b,["stop"])},[a.createVNode(a.unref(L.Rows3),{size:15,"stroke-width":1.5}),E[6]||(E[6]=a.createElementVNode("span",null,"标题行",-1)),a.createElementVNode("div",{class:a.normalizeClass(["tt-toggle",{"tt-toggle-on":r.hasHeaderRow}])},[...E[5]||(E[5]=[a.createElementVNode("div",{class:"tt-toggle-thumb"},null,-1)])],2)]),a.createElementVNode("div",{class:"tt-toggle-row",onClick:a.withModifiers(w,["stop"])},[a.createVNode(a.unref(L.Columns3),{size:15,"stroke-width":1.5}),E[8]||(E[8]=a.createElementVNode("span",null,"标题列",-1)),a.createElementVNode("div",{class:a.normalizeClass(["tt-toggle",{"tt-toggle-on":r.hasHeaderCol}])},[...E[7]||(E[7]=[a.createElementVNode("div",{class:"tt-toggle-thumb"},null,-1)])],2)]),E[11]||(E[11]=a.createElementVNode("div",{class:"tt-divider"},null,-1)),a.createElementVNode("button",{class:"tt-item tt-danger",type:"button",onClick:a.withModifiers(k,["stop"])},[a.createVNode(a.unref(L.Trash2),{size:15,"stroke-width":1.5}),E[9]||(E[9]=a.createElementVNode("span",null,"删除",-1))])],32)):a.createCommentVNode("",!0)],36))}}),g5=gt(p5,[["__scopeId","data-v-3191f26f"]]),v5=["title","aria-label"],b5=["onClick"],y5=a.defineComponent({__name:"ColAlignBadge",props:{align:{},colIndex:{},x:{},y:{},keepAlive:{type:Function},scheduleHide:{type:Function}},emits:["change"],setup(r,{emit:e}){const t=[{label:"左对齐",value:"left",icon:L.AlignLeft},{label:"居中",value:"center",icon:L.AlignCenter},{label:"右对齐",value:"right",icon:L.AlignRight}],n=r,o=e,l=Aa(),i=l.isOpen,s=a.computed(()=>n.align??"left"),u=a.computed(()=>s.value==="center"?L.AlignCenter:s.value==="right"?L.AlignRight:L.AlignLeft),d=a.computed(()=>{var w;return((w=t.find(k=>k.value===s.value))==null?void 0:w.label)??"左对齐"});function m(){n.keepAlive(),l.open()}function h(w){var T;const k=w.relatedTarget;(T=k==null?void 0:k.closest)!=null&&T.call(k,".col-align-popover")||(l.scheduleClose(),n.scheduleHide())}function p(){n.keepAlive(),l.clearCloseTimer()}function v(w){var T;const k=w.relatedTarget;(T=k==null?void 0:k.closest)!=null&&T.call(k,".col-align-badge-wrap")||(l.scheduleClose(),n.scheduleHide())}function b(w){n.keepAlive(),o("change",w,n.colIndex),l.close()}return(w,k)=>(a.openBlock(),a.createElementBlock("div",{class:"table-tools-overlay col-align-badge-wrap",style:a.normalizeStyle({position:"fixed",left:`${r.x-9}px`,top:`${r.y-9}px`,zIndex:"181"}),onMouseenter:m,onMouseleave:h},[a.createElementVNode("button",{class:a.normalizeClass(["col-align-badge",{"col-align-badge--active":a.unref(i)||r.align!==null}]),type:"button",title:`列对齐:${d.value}`,"aria-label":`列对齐:${d.value}`},[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(u.value),{size:13,"stroke-width":1.8}))],10,v5),a.unref(i)?(a.openBlock(),a.createElementBlock("div",{key:0,class:"col-align-popover",onMouseenter:p,onMouseleave:v},[(a.openBlock(),a.createElementBlock(a.Fragment,null,a.renderList(t,T=>a.createElementVNode("button",{key:T.label,class:a.normalizeClass(["tt-item",{"tt-toggle-on":s.value===T.value}]),type:"button",onClick:a.withModifiers(E=>b(T.value),["stop"])},[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(T.icon),{size:15,"stroke-width":1.5})),a.createElementVNode("span",null,a.toDisplayString(T.label),1)],10,b5)),64))],32)):a.createCommentVNode("",!0)],36))}}),w5=gt(y5,[["__scopeId","data-v-e7a7604f"]]),k5=["onClick"],x5=["onClick"],C5=24,T5=13,Si=20,Mi=20,E5=a.defineComponent({__name:"TableTools",props:{tableVisible:{type:Boolean},tableBounds:{},rowDots:{},colDots:{},colAlignDots:{},hoveredCellBounds:{},hasHeaderRow:{type:Boolean},hasHeaderCol:{type:Boolean},keepAlive:{type:Function},scheduleHide:{type:Function},insertRowAt:{type:Function},insertColAt:{type:Function},setColumnAlign:{type:Function}},emits:["comment","cutTable","copyTable","toggleHeaderRow","toggleHeaderCol","deleteTable","cellOp","cellInsert","cellComment"],setup(r,{emit:e}){const t=Mi/2,n=r,o=e,l=Aa(),i=l.isOpen;function s(b,w){n.setColumnAlign(b,w)}function u(){n.keepAlive(),l.open()}function d(b){var k;const w=b.relatedTarget;(k=w==null?void 0:w.closest)!=null&&k.call(w,".pagely-insert-menu")||(l.scheduleClose(),n.scheduleHide())}function m(){n.keepAlive(),l.clearCloseTimer()}function h(){l.scheduleClose(),n.scheduleHide()}function p(b){if(l.close(),b==="COMMENT"){const w=n.hoveredCellBounds;o("cellComment",w?new DOMRect(w.left,w.top,w.width,w.height):null);return}o("cellInsert",b)}function v(b){l.close(),o("cellOp",b)}return(b,w)=>(a.openBlock(),a.createBlock(a.Teleport,{to:"body"},[r.tableVisible?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.rowDots,(k,T)=>(a.openBlock(),a.createElementBlock("div",{key:"r"+T,class:"table-tools-overlay ins-wrap ins-row",style:a.normalizeStyle({position:"fixed",top:k.pos-10+"px",left:r.tableBounds.left-20+"px",zIndex:"180"}),onMouseenter:w[0]||(w[0]=(...E)=>r.keepAlive&&r.keepAlive(...E)),onMouseleave:w[1]||(w[1]=(...E)=>r.scheduleHide&&r.scheduleHide(...E)),onClick:a.withModifiers(E=>r.insertRowAt(k.index),["stop"])},[...w[13]||(w[13]=[a.createElementVNode("div",{class:"ins-pill ins-pill-h"},[a.createElementVNode("div",{class:"ins-dot"}),a.createElementVNode("span",{class:"ins-label"},"插入行")],-1)])],44,k5))),128)),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.colDots,(k,T)=>(a.openBlock(),a.createElementBlock("div",{key:"c"+T,class:"table-tools-overlay ins-wrap ins-col",style:a.normalizeStyle({position:"fixed",left:k.pos-10+"px",top:r.tableBounds.top-20+"px",zIndex:"180"}),onMouseenter:w[2]||(w[2]=(...E)=>r.keepAlive&&r.keepAlive(...E)),onMouseleave:w[3]||(w[3]=(...E)=>r.scheduleHide&&r.scheduleHide(...E)),onClick:a.withModifiers(E=>r.insertColAt(k.index),["stop"])},[...w[14]||(w[14]=[a.createElementVNode("div",{class:"ins-pill ins-pill-v"},[a.createElementVNode("div",{class:"ins-dot"}),a.createElementVNode("span",{class:"ins-label"},"插入列")],-1)])],44,x5))),128)),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.colAlignDots,k=>(a.openBlock(),a.createBlock(w5,{key:"ca"+k.colIndex,align:k.align,"col-index":k.colIndex,x:k.pos,y:k.y,"keep-alive":r.keepAlive,"schedule-hide":r.scheduleHide,onChange:s},null,8,["align","col-index","x","y","keep-alive","schedule-hide"]))),128)),a.createVNode(g5,{"table-bounds":r.tableBounds,"has-header-row":r.hasHeaderRow,"has-header-col":r.hasHeaderCol,"keep-alive":r.keepAlive,"schedule-hide":r.scheduleHide,onComment:w[4]||(w[4]=k=>o("comment",k)),onCutTable:w[5]||(w[5]=k=>o("cutTable")),onCopyTable:w[6]||(w[6]=k=>o("copyTable")),onToggleHeaderRow:w[7]||(w[7]=k=>o("toggleHeaderRow")),onToggleHeaderCol:w[8]||(w[8]=k=>o("toggleHeaderCol")),onDeleteTable:w[9]||(w[9]=k=>o("deleteTable"))},null,8,["table-bounds","has-header-row","has-header-col","keep-alive","schedule-hide"]),r.hoveredCellBounds?(a.openBlock(),a.createElementBlock("div",{key:0,class:"table-tools-overlay table-cell-wrap",style:a.normalizeStyle({position:"fixed",top:r.hoveredCellBounds.top+r.hoveredCellBounds.height/2-t+"px",left:r.hoveredCellBounds.left-Si+"px",width:`${Si}px`,height:`${Mi}px`,zIndex:"182"}),onMouseenter:w[10]||(w[10]=(...k)=>r.keepAlive&&r.keepAlive(...k)),onMouseleave:w[11]||(w[11]=k=>d(k))},[a.createElementVNode("button",{class:"table-cell-btn",type:"button","aria-label":"单元格操作",onMouseenter:u},[a.createVNode(a.unref(L.Plus),{size:13,"stroke-width":2})],32)],36)):a.createCommentVNode("",!0),a.unref(i)&&r.hoveredCellBounds?(a.openBlock(),a.createBlock(Ma,{key:1,visible:a.unref(i),sections:a.unref(Xi),"menu-top":r.hoveredCellBounds.top+r.hoveredCellBounds.height/2-T5,"menu-left":r.hoveredCellBounds.left-C5-a.unref(oo)-a.unref(Gt),placement:"left",editor:void 0,onClose:w[12]||(w[12]=k=>a.unref(l).close()),onMenuEnter:m,onMenuLeave:h,onInsert:p,onCellOp:v},null,8,["visible","sections","menu-top","menu-left"])):a.createCommentVNode("",!0)],64)):a.createCommentVNode("",!0)]))}}),dc=gt(E5,[["__scopeId","data-v-a8378ff3"]]);function fc(r,e){const t=r.schema.marks.link;if(!t)return null;const n=[];if(r.doc.descendants((i,s)=>{if(!i.isText)return;i.marks.find(d=>d.type===t&&d.attrs.href===e)&&n.push({from:s,to:s+i.nodeSize})}),!n.length)return null;const o=n[0];let l=o.to;for(let i=1;i<n.length&&n[i].from===l;i++)l=n[i].to;return{from:o.from,to:l}}function Ai(r,e){const t=r.schema.marks.link;if(!t)return null;let n=null;return r.doc.descendants((o,l)=>{if(n)return!1;if(o.type.name!=="paragraph")return!0;let i="",s=!1,u=!0;return o.descendants(d=>{if(!u)return!1;if(!d.isText)return u=!1,!1;const m=d.text??"";return d.marks.find(p=>p.type===t&&p.attrs.href===e)?(s=!0,i+=m,!0):(m.trim().length>0&&(u=!1),i+=m,!0)}),!u||!s||i.trim().length===0||(n={from:l,to:l+o.nodeSize,text:i.trim()}),!1}),n}function hl(r,e,t){const n=r.state,o=n.schema.marks.link;if(!o)return!1;const l=[];if(n.doc.descendants((u,d)=>{if(!u.isText)return;const m=u.marks.find(h=>h.type===o&&h.attrs.href===e);m&&l.push({from:d,to:d+u.nodeSize,mark:m})}),!l.length)return!1;const i=l[0];let s=i.to;for(let u=1;u<l.length&&l[u].from===s;u++)s=l[u].to;return r.view.dispatch(n.tr.replaceWith(i.from,s,n.schema.text(t,[i.mark]))),!0}function S5(r,e,t){const n=fc(r.state,e);return n?(r.view.dispatch(r.state.tr.replaceWith(n.from,n.to,r.state.schema.text(t))),!0):!1}function M5(r,e,t){const n=r.state,o=n.schema.marks.link;if(!o)return!1;const l=fc(n,e);if(!l)return!1;const i=o.create({href:t,target:"_blank"}),s=n.tr.removeMark(l.from,l.to,o).addMark(l.from,l.to,i);return r.view.dispatch(s),!0}const A5=["title"],B5=["title"],N5={class:"wl-view-menu"},L5=["onKeydown"],I5=a.defineComponent({__name:"LinkToolbar",props:{editor:{}},setup(r,{expose:e}){const t=r,n=a.ref(!1),o=a.ref(""),l=a.ref(""),i=a.ref({}),s=a.ref(null),u=a.ref(!1),d=a.ref(""),m=a.ref(null),h=a.ref(!1),p=a.ref(null),v=a.ref(!1);let b=null;const w=a.computed(()=>o.value.length>38?o.value.slice(0,35)+"...":o.value),k=a.computed(()=>l.value===o.value?"link":"title"),T=a.computed(()=>t.editor?Ai(t.editor.state,o.value)!==null:!1),E=a.computed(()=>T.value&&en(o.value,l.value));function M(se,I,P){b&&(clearTimeout(b),b=null),o.value=se,l.value=I,u.value=!1,h.value=!1,D(P),n.value=!0}function B(se=!1){if(se){b&&(clearTimeout(b),b=null),n.value=!1,u.value=!1,h.value=!1;return}b&&clearTimeout(b),b=setTimeout(()=>{v.value||(n.value=!1,u.value=!1,h.value=!1),b=null},200)}function D(se){const V=se.top<56?se.bottom+4:se.top-44-4;i.value={top:`${V}px`,left:`${se.left}px`}}function z(){v.value=!0,b&&(clearTimeout(b),b=null)}function W(){v.value=!1,B()}function H(se){var I;h.value&&!((I=p.value)!=null&&I.contains(se.target))&&(h.value=!1)}a.onMounted(()=>document.addEventListener("click",H)),a.onBeforeUnmount(()=>{document.removeEventListener("click",H),b&&clearTimeout(b),K&&clearTimeout(K)});function A(){window.open(o.value,"_blank","noopener,noreferrer")}const R=a.ref(!1);let K=null;async function J(){try{await navigator.clipboard.writeText(o.value)}catch{const se=document.createElement("textarea");se.value=o.value,se.style.cssText="position:fixed;opacity:0",document.body.appendChild(se),se.select(),document.execCommand("copy"),document.body.removeChild(se)}R.value=!0,K&&clearTimeout(K),K=setTimeout(()=>{R.value=!1},1500)}function te(){t.editor&&(S5(t.editor,o.value,l.value),qe.unpin(o.value),B(!0))}function Z(){d.value=o.value,u.value=!0,a.nextTick(()=>{var se;return(se=m.value)==null?void 0:se.select()})}function le(){const se=d.value.trim();se&&t.editor&&(M5(t.editor,o.value,se),o.value=se),u.value=!1}function ee(){u.value=!1}function we(se){if(t.editor){if(se==="link")qe.pin(o.value),hl(t.editor,o.value,o.value),l.value=o.value;else{qe.unpin(o.value);const I=qe.getTitle(o.value);I?(hl(t.editor,o.value,I),l.value=I):qe.hasTitle(o.value)||(hl(t.editor,o.value,o.value),l.value=o.value)}h.value=!1}}function pe(se){const I=t.editor;if(!I||se==="preview"&&!en(o.value,l.value))return;const P=Ai(I.state,o.value);if(!P)return;const V=I.state.schema.nodes.embedView;if(!V)return;const q=P.text||l.value||o.value;I.view.dispatch(I.state.tr.replaceWith(P.from,P.to,V.create({href:o.value,label:q,view:se})).scrollIntoView()),I.view.focus(),B(!0)}return e({show:M,hide:B}),(se,I)=>(a.openBlock(),a.createBlock(a.Teleport,{to:"body"},[a.withDirectives(a.createElementVNode("div",{ref_key:"toolbarEl",ref:s,class:"wl-toolbar",style:a.normalizeStyle(i.value),onMouseenter:z,onMouseleave:W,onMousedown:I[8]||(I[8]=a.withModifiers(()=>{},["prevent"]))},[u.value?(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[a.withDirectives(a.createElementVNode("input",{ref_key:"editInputEl",ref:m,"onUpdate:modelValue":I[6]||(I[6]=P=>d.value=P),class:"wl-edit-input",placeholder:"输入链接地址...",onKeydown:[a.withKeys(a.withModifiers(le,["prevent"]),["enter"]),a.withKeys(a.withModifiers(ee,["prevent"]),["esc"])],onMousedown:I[7]||(I[7]=a.withModifiers(()=>{},["stop"]))},null,40,L5),[[a.vModelText,d.value]]),a.createElementVNode("button",{class:"wl-edit-ok",onClick:le},"确认"),a.createElementVNode("button",{class:"wl-edit-cancel",onClick:ee},"取消")],64)):(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createElementVNode("span",{class:"wl-tb-url",title:o.value},a.toDisplayString(w.value),9,A5),a.createElementVNode("button",{class:"wl-tb-btn",title:"在新标签打开",onClick:A},[a.createVNode(a.unref(L.ExternalLink),{size:16,"stroke-width":1.8})]),a.createElementVNode("button",{class:"wl-tb-btn",title:R.value?"已复制":"复制链接",onClick:J},[R.value?(a.openBlock(),a.createBlock(a.unref(L.Check),{key:0,size:16,"stroke-width":2,style:{color:"#34c759"}})):(a.openBlock(),a.createBlock(a.unref(L.Copy),{key:1,size:16,"stroke-width":1.8}))],8,B5),a.createElementVNode("button",{class:"wl-tb-btn",title:"编辑链接",onClick:Z},[a.createVNode(a.unref(L.Pencil),{size:16,"stroke-width":1.8})]),a.createElementVNode("button",{class:"wl-tb-btn",title:"取消链接",onClick:te},[a.createVNode(a.unref(L.Link2Off),{size:16,"stroke-width":1.8})]),I[15]||(I[15]=a.createElementVNode("div",{class:"wl-tb-sep"},null,-1)),a.createElementVNode("div",{class:"wl-view-wrap",ref_key:"viewWrapEl",ref:p},[a.createElementVNode("button",{class:"wl-tb-view-btn",onClick:I[0]||(I[0]=a.withModifiers(P=>h.value=!h.value,["stop"]))},[k.value==="link"?(a.openBlock(),a.createBlock(a.unref(L.Link2),{key:0,size:13,"stroke-width":1.6})):(a.openBlock(),a.createBlock(a.unref(L.AlignLeft),{key:1,size:13,"stroke-width":1.6})),a.createElementVNode("span",null,a.toDisplayString(k.value==="title"?"标题视图":"链接视图"),1),a.createVNode(a.unref(L.ChevronDown),{size:12,"stroke-width":1.8,class:a.normalizeClass(["wl-chev",{open:h.value}])},null,8,["class"])]),a.withDirectives(a.createElementVNode("div",N5,[a.createElementVNode("button",{class:a.normalizeClass(["wl-view-item",{active:k.value==="title"}]),onClick:I[1]||(I[1]=P=>we("title"))},[a.createVNode(a.unref(L.AlignLeft),{size:14,"stroke-width":1.6,class:"wl-vi-icon"}),I[9]||(I[9]=a.createElementVNode("span",null,"标题视图",-1)),k.value==="title"?(a.openBlock(),a.createBlock(a.unref(L.Check),{key:0,size:12,"stroke-width":2,class:"wl-vi-check",style:{color:"#3370ff"}})):a.createCommentVNode("",!0)],2),a.createElementVNode("button",{class:a.normalizeClass(["wl-view-item",{active:k.value==="link"}]),onClick:I[2]||(I[2]=P=>we("link"))},[a.createVNode(a.unref(L.Link2),{size:14,"stroke-width":1.6,class:"wl-vi-icon"}),I[10]||(I[10]=a.createElementVNode("span",null,"链接视图",-1)),k.value==="link"?(a.openBlock(),a.createBlock(a.unref(L.Check),{key:0,size:12,"stroke-width":2,class:"wl-vi-check",style:{color:"#3370ff"}})):a.createCommentVNode("",!0)],2),T.value?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[I[14]||(I[14]=a.createElementVNode("div",{class:"wl-view-sep"},null,-1)),a.createElementVNode("button",{class:"wl-view-item",onClick:I[3]||(I[3]=P=>pe("link"))},[a.createVNode(a.unref(L.Link2),{size:14,"stroke-width":1.6,class:"wl-vi-icon"}),I[11]||(I[11]=a.createElementVNode("span",null,"块级链接",-1))]),a.createElementVNode("button",{class:"wl-view-item",onClick:I[4]||(I[4]=P=>pe("card"))},[a.createVNode(a.unref(L.LayoutPanelTop),{size:14,"stroke-width":1.6,class:"wl-vi-icon"}),I[12]||(I[12]=a.createElementVNode("span",null,"卡片视图",-1))]),E.value?(a.openBlock(),a.createElementBlock("button",{key:0,class:"wl-view-item",onClick:I[5]||(I[5]=P=>pe("preview"))},[a.createVNode(a.unref(L.Eye),{size:14,"stroke-width":1.6,class:"wl-vi-icon"}),I[13]||(I[13]=a.createElementVNode("span",null,"预览视图",-1))])):a.createCommentVNode("",!0)],64)):a.createCommentVNode("",!0)],512),[[a.vShow,h.value]])],512)],64))],36),[[a.vShow,n.value]])]))}}),z5=["onKeydown"],D5={class:"sel-type-label"},O5={class:"sel-dropdown"},R5=["onClick"],P5=["disabled"],H5=["disabled"],Bi="#1f2329",V5=a.defineComponent({__name:"SelectionToolbar",props:{editor:{},enableComment:{type:Boolean,default:!1}},emits:["comment"],setup(r,{expose:e,emit:t}){const n=r,o=t,l=a.ref(!1),i=a.ref({}),s=a.ref(null),u=a.ref(!1),d=a.ref(null),m=a.ref(!1),h=a.ref(null),p=a.ref(!1),v=a.ref(""),b=a.ref(null),w=a.computed(()=>ml.find(V=>V.isActive(n.editor))??ml[0]),k=a.computed(()=>w.value.label),T=a.computed(()=>w.value.icon),E=a.computed(()=>{var q;return((q=n.editor)==null?void 0:q.getAttributes("textStyle").color)??Bi}),M=a.computed(()=>{var q;const V=(q=n.editor)==null?void 0:q.getAttributes("highlight");return V!=null&&V.color?V.color:null});function B(V){var q;(q=n.editor)==null||q.chain().focus()[V]().run()}function D(V){n.editor&&V.apply(n.editor),u.value=!1}function z(V){n.editor&&(V===null||V===Bi?n.editor.chain().focus().unsetColor().run():n.editor.chain().focus().setColor(V).run(),m.value=!1)}function W(V){n.editor&&(V===null?n.editor.chain().focus().unsetHighlight().run():n.editor.chain().focus().setHighlight({color:V}).run(),m.value=!1)}function H(){n.editor&&(n.editor.chain().focus().unsetColor().unsetHighlight().run(),m.value=!1)}const A=a.computed(()=>{if(!n.editor)return!1;const{$from:V}=n.editor.state.selection;for(let q=V.depth;q>0;q--){const ae=V.node(q).type.name;if(ae==="tableCell"||ae==="tableHeader")return!0}return!1}),R=a.computed(()=>Qi(n.editor)),K=a.computed(()=>Zi(n.editor));function J(){n.editor&&es(n.editor)}function te(){n.editor&&ts(n.editor)}function Z(){if(n.editor){if(n.editor.isActive("link")){n.editor.chain().focus().unsetLink().run();return}v.value="",p.value=!0,a.nextTick(()=>{var V;return(V=b.value)==null?void 0:V.focus()})}}function le(){const V=v.value.trim();V&&n.editor&&n.editor.chain().focus().setLink({href:V,target:"_blank"}).run(),p.value=!1}function ee(){var V;p.value=!1,(V=n.editor)==null||V.commands.focus()}function we(){o("comment")}function pe(V){p.value=!1,u.value=!1,l.value||(m.value=!1),l.value=!0,a.nextTick(()=>I(V))}function se(){l.value=!1,u.value=!1,m.value=!1,p.value=!1}function I(V){const q=s.value;if(!q)return;const ae=q.offsetWidth||340,ge=q.offsetHeight||40,ne=8,N=window.innerWidth;let O=V.left+V.width/2-ae/2;O=Math.max(8,Math.min(O,N-ae-8));const $=V.top>=ge+ne+8?V.top-ge-ne:V.bottom+ne;i.value={top:`${$}px`,left:`${O}px`}}function P(V){var q,ae;u.value&&!((q=d.value)!=null&&q.contains(V.target))&&(u.value=!1),m.value&&!((ae=h.value)!=null&&ae.contains(V.target))&&(m.value=!1)}return a.onMounted(()=>document.addEventListener("click",P)),a.onBeforeUnmount(()=>document.removeEventListener("click",P)),e({show:pe,hide:se}),(V,q)=>{var ae,ge,ne,N,O,$;return a.openBlock(),a.createBlock(a.Teleport,{to:"body"},[a.withDirectives(a.createElementVNode("div",{ref_key:"toolbarEl",ref:s,class:"sel-toolbar",style:a.normalizeStyle(i.value),onMousedown:q[9]||(q[9]=a.withModifiers(()=>{},["prevent"]))},[p.value?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.withDirectives(a.createElementVNode("input",{ref_key:"linkInputEl",ref:b,"onUpdate:modelValue":q[0]||(q[0]=X=>v.value=X),class:"sel-link-input",placeholder:"输入链接地址…",onKeydown:[a.withKeys(a.withModifiers(le,["prevent"]),["enter"]),a.withKeys(a.withModifiers(ee,["prevent"]),["esc"])],onMousedown:q[1]||(q[1]=a.withModifiers(()=>{},["stop"]))},null,40,z5),[[a.vModelText,v.value]]),a.createElementVNode("button",{class:"sel-link-ok",onClick:le},"确认"),a.createElementVNode("button",{class:"sel-link-cancel",onClick:ee},"取消")],64)):(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[a.createElementVNode("div",{class:"sel-type-wrap",ref_key:"typeWrapEl",ref:d},[a.createElementVNode("button",{class:"sel-btn sel-btn--type",onClick:q[2]||(q[2]=a.withModifiers(X=>u.value=!u.value,["stop"]))},[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(T.value),{size:16,"stroke-width":1.5})),a.createElementVNode("span",D5,a.toDisplayString(k.value),1),a.createVNode(a.unref(L.ChevronDown),{size:10,"stroke-width":1.8,class:a.normalizeClass(["sel-chev",{open:u.value}])},null,8,["class"])]),a.withDirectives(a.createElementVNode("div",O5,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(ml),X=>(a.openBlock(),a.createElementBlock("button",{key:X.id,class:a.normalizeClass(["sel-dd-item",{active:X.isActive(r.editor)}]),onClick:oe=>D(X)},[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(X.icon),{size:15,"stroke-width":1.5,class:"sel-dd-icon"})),a.createElementVNode("span",null,a.toDisplayString(X.label),1),X.isActive(r.editor)?(a.openBlock(),a.createBlock(a.unref(L.Check),{key:0,size:12,"stroke-width":2.2,class:"sel-dd-check",style:{color:"#3370ff"}})):a.createCommentVNode("",!0)],10,R5))),128))],512),[[a.vShow,u.value]])],512),q[11]||(q[11]=a.createElementVNode("div",{class:"sel-sep"},null,-1)),a.createElementVNode("button",{class:a.normalizeClass(["sel-btn",{active:(ae=r.editor)==null?void 0:ae.isActive("bold")}]),title:"粗体 Ctrl+B",onClick:q[3]||(q[3]=X=>B("toggleBold"))},[a.createVNode(a.unref(L.Bold),{size:16,"stroke-width":2.2})],2),a.createElementVNode("button",{class:a.normalizeClass(["sel-btn",{active:(ge=r.editor)==null?void 0:ge.isActive("italic")}]),title:"斜体 Ctrl+I",onClick:q[4]||(q[4]=X=>B("toggleItalic"))},[a.createVNode(a.unref(L.Italic),{size:16,"stroke-width":1.5})],2),a.createElementVNode("button",{class:a.normalizeClass(["sel-btn",{active:(ne=r.editor)==null?void 0:ne.isActive("strike")}]),title:"删除线",onClick:q[5]||(q[5]=X=>B("toggleStrike"))},[a.createVNode(a.unref(L.Strikethrough),{size:16,"stroke-width":1.5})],2),A.value?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("button",{key:0,class:a.normalizeClass(["sel-btn",{active:(N=r.editor)==null?void 0:N.isActive("underline")}]),title:"下划线 Ctrl+U",onClick:q[6]||(q[6]=X=>B("toggleUnderline"))},[a.createVNode(a.unref(L.Underline),{size:16,"stroke-width":1.5})],2)),q[12]||(q[12]=a.createElementVNode("div",{class:"sel-sep"},null,-1)),a.createElementVNode("div",{class:"sel-color-wrap",ref_key:"colorWrapEl",ref:h},[a.createElementVNode("button",{class:"sel-btn sel-btn--color",title:"字体颜色 / 背景颜色",onClick:q[7]||(q[7]=a.withModifiers(X=>m.value=!m.value,["stop"]))},[a.createVNode(a.unref(L.Baseline),{size:16,"stroke-width":1.5,style:a.normalizeStyle({color:E.value})},null,8,["style"]),a.createVNode(a.unref(L.ChevronDown),{size:10,"stroke-width":1.8,class:a.normalizeClass(["sel-chev",{open:m.value}])},null,8,["class"])]),a.withDirectives(a.createVNode(sc,{class:"sel-color-panel","current-font-color":E.value,"current-bg-color":M.value,onApplyFontColor:z,onApplyBgColor:W,onReset:H},null,8,["current-font-color","current-bg-color"]),[[a.vShow,m.value]])],512),A.value?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[q[10]||(q[10]=a.createElementVNode("div",{class:"sel-sep"},null,-1)),a.createElementVNode("button",{class:a.normalizeClass(["sel-btn",{disabled:!R.value}]),disabled:!R.value,title:"增加缩进",onClick:J},[a.createVNode(a.unref(L.Indent),{size:16,"stroke-width":1.5})],10,P5),a.createElementVNode("button",{class:a.normalizeClass(["sel-btn",{disabled:!K.value}]),disabled:!K.value,title:"减少缩进",onClick:te},[a.createVNode(a.unref(L.Outdent),{size:16,"stroke-width":1.5})],10,H5)],64)),q[13]||(q[13]=a.createElementVNode("div",{class:"sel-sep"},null,-1)),a.createElementVNode("button",{class:a.normalizeClass(["sel-btn",{active:(O=r.editor)==null?void 0:O.isActive("code")}]),title:"行内代码",onClick:q[8]||(q[8]=X=>B("toggleCode"))},[a.createVNode(a.unref(L.Code),{size:16,"stroke-width":1.5})],2),a.createElementVNode("button",{class:a.normalizeClass(["sel-btn",{active:($=r.editor)==null?void 0:$.isActive("link")}]),title:"链接",onClick:Z},[a.createVNode(a.unref(L.Link2),{size:16,"stroke-width":1.5})],2),n.enableComment?(a.openBlock(),a.createElementBlock("button",{key:2,class:"sel-btn",title:"评论",onClick:we},[a.createVNode(a.unref(L.MessageSquare),{size:16,"stroke-width":1.5})])):a.createCommentVNode("",!0)],64))],36),[[a.vShow,l.value]])])}}}),F5=["data-variant"],$5=["title"],q5={class:"drag-handle-btn",title:"拖拽移动"},U5=a.defineComponent({__name:"PagelyEditor",props:{initialContent:{default:""},fileUploadHandler:{},enableComment:{type:Boolean,default:!1}},emits:["update:html","update:markdown","comment:create","comment:click","comment:hover","comment:orphaned","comment:anchor-drift","anchors-changed","mention:trigger","mention:cancel"],setup(r,{expose:e,emit:t}){const n=r,o=t;let l=()=>{};const i=ds(()=>l(),o),s=No();let u=()=>{},d=()=>{};function m(re,ce){u(re,ce)}const h=Bo({profile:"edit",initialContent:n.initialContent,headingCollapseExtension:s.extension,isSettingContent:i.isSettingContent,onHtmlUpdate(re){o("update:html",re),i.scheduleMarkdownEmit(re)},onSelectionUpdate(){$()},onOpenMathPopover(re,ce,Te){d(re,ce,Te)},onOpenSlashInsert:m,fileUploadHandler:n.fileUploadHandler});l=()=>h.value;const p=a.ref(null),v=a.computed(()=>n.enableComment),b=$i(h,{enabled:v,onCreate:re=>o("comment:create",re),onClick:re=>o("comment:click",re),onHover:re=>o("comment:hover",re),onOrphaned:re=>o("comment:orphaned",re),onAnchorDrift:re=>o("comment:anchor-drift",re),onAnchorsChanged:re=>o("anchors-changed",re)}),w=is(h,{onTrigger:re=>o("mention:trigger",re),onCancel:()=>o("mention:cancel")}),{visible:k,anchorRect:T,initialLatex:E,openForEdit:M,openForInsert:B,confirm:D,close:z,rectAtPos:W}=Xd(h);d=M;const{overlayVisible:H,overlayStyle:A,blockInfo:R,onMouseMove:K,onMouseLeave:J,getCurrentBlockPMPos:te,getCurrentBlockRootPMPos:Z,getCurrentBlockEl:le}=zi(p,h),ee=a.ref(null),we=a.ref(null);function pe(){const re=ee.value??we.value;return(re==null?void 0:re.getBoundingClientRect())??null}const{isEmptyParagraph:se,updateFromCurrentBlock:I,clear:P}=ls(p,h,le),{tableVisible:V,tableBounds:q,rowDots:ae,colDots:ge,colAlignDots:ne,hoveredCellBounds:N,onTableMouseMove:O,onTableSelectionUpdate:$,keepAlive:X,scheduleHide:oe,insertRowAt:ve,insertColAt:Be,tableDeleteTable:$e,tableCutTable:ot,tableCopyTable:Xe,tableToggleHeaderRow:ue,tableToggleHeaderColumn:me,hasHeaderRow:Re,hasHeaderCol:Ke,cellOps:St,focusHoveredCell:Ht,getCurrentTableRootPMPos:Mt,getCurrentCellRootPMPos:br,setColumnAlign:vn}=ic(p,h),Lo=a.computed(()=>zr(R.tag).icon),Wr=a.computed(()=>{var re;return((re=ur[R.tag])==null?void 0:re.pillVariant)??"text"}),{isHeadingBlock:yr,isCurrentCollapsed:wr,onCollapseClick:Ba}=s.bind(h,()=>R.tag,te);let Na=()=>{};const kr=as(te,pe,()=>{Na()}),er=Oi(h,te,pe,()=>R.tag,()=>{kr.close(),kr.clearHideTimer()});Na=()=>{er.close(),er.clearHideTimer()};const{visible:La,top:hc,left:pc,placement:gc,targetPos:Io,sourceTag:vc,onPillEnter:Ia,onPillLeave:bc,onMenuEnter:yc,onMenuLeave:wc}=er,{visible:za,top:kc,left:xc,placement:Cc,targetPos:Tc,openFromButton:Da,openFromSlash:Ec,onButtonEnter:Oa,onButtonLeave:Sc,onMenuEnter:Mc,onMenuLeave:Ac}=kr;u=Ec;const zo=Md({onBlockMouseMove:K,onBlockMouseLeave:J,updateInsertButton:I,clearInsertButton:P,onTableMouseMove:O,scheduleTableHide:oe,closeBlockMenu:er.close,closeInsertMenu:kr.close,isBlockMenuVisible:()=>La.value,isInsertMenuVisible:()=>za.value}),{onMove:Ra,onLeave:Pa,onEditorMouseDown:Ha,onDocMouseUp:Va,onOverlayEnter:Fa,onOverlayLeave:$a,onKeyDown:qa}=zo,{onInsert:Bc,onCellInsert:Nc,onCellOp:Lc,onConvert:Ic}=os({editor:h,insertTargetPos:Tc,blockTargetPos:Io,blockSourceTag:vc,focusBlockTarget:er.focusTarget,focusHoveredCell:Ht,cellOps:St,closeInsertMenu:kr.close,closeBlockMenu:er.close,openMathPopoverForInsert:B,getMathRectAtPos:W}),Do=a.ref(null);_4(h,(re,ce,Te)=>{var Ua;return(Ua=Do.value)==null?void 0:Ua.show(re,ce,Te)},()=>{var re;return(re=Do.value)==null?void 0:re.hide()});const bn=a.ref(null);G4(h,re=>{var ce;zo.setHasSelection(!0),J(),P(),(ce=bn.value)==null||ce.show(re)},()=>{var re;zo.setHasSelection(!1),(re=bn.value)==null||re.hide()});function zc(){var re;b.requestInlineComment(),(re=bn.value)==null||re.hide()}function Dc(){const re=Z()??Io.value;re!==null&&b.requestBlockComment(re,pe()??void 0)}function Oc(re){const ce=Mt();ce!==null&&b.requestBlockComment(ce,re??void 0)}function Rc(re){const ce=br();ce!==null&&b.requestBlockComment(ce,re??void 0)}return a.onMounted(()=>{document.addEventListener("keydown",qa),document.addEventListener("mouseup",Va)}),a.onBeforeUnmount(()=>{var re;document.removeEventListener("keydown",qa),document.removeEventListener("mouseup",Va),(re=h.value)==null||re.destroy()}),e({getHtml:i.getHtml,getMarkdown:i.getMarkdown,setMarkdown:i.setMarkdown,setHtml:i.setHtml,getEditor:()=>h.value,getCommentAnchors:b.getCommentAnchors,applyCommentAnchors:b.applyCommentAnchors,addComment:(re,ce)=>b.addComment(re,ce),removeCommentAnchor:b.removeCommentAnchor,getMentions:w.getMentions,applyMentions:re=>w.applyMentions(re),insertMention:re=>w.insertMention(re)}),(re,ce)=>(a.openBlock(),a.createElementBlock("div",{class:"pagely-editor-wrap",ref_key:"wrapRef",ref:p,onMousemove:ce[11]||(ce[11]=(...Te)=>a.unref(Ra)&&a.unref(Ra)(...Te)),onMouseleave:ce[12]||(ce[12]=(...Te)=>a.unref(Pa)&&a.unref(Pa)(...Te)),onMousedown:ce[13]||(ce[13]=(...Te)=>a.unref(Ha)&&a.unref(Ha)(...Te))},[a.createVNode(a.unref(_e.EditorContent),{editor:a.unref(h)},null,8,["editor"]),ce[15]||(ce[15]=a.createElementVNode("div",{class:"pagely-document-end","aria-hidden":"true"},[a.createElementVNode("span",{class:"pagely-document-end-mark"})],-1)),(a.openBlock(),a.createBlock(a.Teleport,{to:"body"},[a.createElementVNode("div",{class:a.normalizeClass(["block-btn-overlay",{visible:a.unref(H)}]),style:a.normalizeStyle(a.unref(A)),onMouseenter:ce[7]||(ce[7]=(...Te)=>a.unref(Fa)&&a.unref(Fa)(...Te)),onMouseleave:ce[8]||(ce[8]=(...Te)=>a.unref($a)&&a.unref($a)(...Te))},[a.unref(se)?(a.openBlock(),a.createElementBlock("button",{key:0,ref_key:"insertBtnRef",ref:ee,class:"insert-btn",title:"插入块",onMouseenter:ce[0]||(ce[0]=(...Te)=>a.unref(Oa)&&a.unref(Oa)(...Te)),onMouseleave:ce[1]||(ce[1]=Te=>a.unref(Sc)(Te)),onMousedown:ce[2]||(ce[2]=a.withModifiers(()=>{},["stop","prevent"])),onClick:ce[3]||(ce[3]=a.withModifiers((...Te)=>a.unref(Da)&&a.unref(Da)(...Te),["stop"]))},[a.createVNode(a.unref(L.Plus),{size:14,"stroke-width":1.8})],544)):a.createCommentVNode("",!0),a.unref(se)?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",{key:1,ref_key:"pillRef",ref:we,class:"block-btn-pill","data-variant":Wr.value,onMouseenter:ce[4]||(ce[4]=(...Te)=>a.unref(Ia)&&a.unref(Ia)(...Te)),onMouseleave:ce[5]||(ce[5]=Te=>a.unref(bc)(Te))},[Wr.value!=="minimal"?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createElementVNode("button",{class:"block-type-btn",title:a.unref(R).label},[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(Lo.value),{class:"type-svg",size:16,"stroke-width":1.5})),Wr.value==="text"?(a.openBlock(),a.createBlock(a.unref(L.ChevronDown),{key:0,class:"chevron-svg",size:8,"stroke-width":1.8})):a.createCommentVNode("",!0)],8,$5),ce[14]||(ce[14]=a.createElementVNode("span",{class:"block-btn-divider"},null,-1))],64)):a.createCommentVNode("",!0),a.createElementVNode("button",q5,[a.createVNode(a.unref(L.GripVertical),{class:"drag-svg",size:14,"stroke-width":1.5})])],40,F5)),a.unref(yr)?(a.openBlock(),a.createElementBlock("button",{key:2,class:a.normalizeClass(["collapse-btn",{"is-collapsed":a.unref(wr)}]),title:"收起",onClick:ce[6]||(ce[6]=a.withModifiers((...Te)=>a.unref(Ba)&&a.unref(Ba)(...Te),["stop"]))},[a.createVNode(a.unref(L.ChevronDown),{size:10,"stroke-width":1.8})],2)):a.createCommentVNode("",!0)],38)])),a.createVNode(uc,{visible:a.unref(La),"menu-top":a.unref(hc),"menu-left":a.unref(pc),placement:a.unref(gc),editor:a.unref(h),"block-info":a.unref(R),"block-target-pos":a.unref(Io),"enable-comment":n.enableComment,onClose:ce[9]||(ce[9]=Te=>a.unref(er).close()),onMenuEnter:a.unref(yc),onMenuLeave:a.unref(wc),onConvert:a.unref(Ic),onComment:Dc},null,8,["visible","menu-top","menu-left","placement","editor","block-info","block-target-pos","enable-comment","onMenuEnter","onMenuLeave","onConvert"]),a.createVNode(Ma,{visible:a.unref(za),"menu-top":a.unref(kc),"menu-left":a.unref(xc),placement:a.unref(Cc),editor:a.unref(h),sections:a.unref(Gi),"file-upload-handler":n.fileUploadHandler,onClose:ce[10]||(ce[10]=Te=>a.unref(kr).close()),onMenuEnter:a.unref(Mc),onMenuLeave:a.unref(Ac),onInsert:a.unref(Bc)},null,8,["visible","menu-top","menu-left","placement","editor","sections","file-upload-handler","onMenuEnter","onMenuLeave","onInsert"]),a.createVNode(dc,{"table-visible":a.unref(V),"table-bounds":a.unref(q),"row-dots":a.unref(ae),"col-dots":a.unref(ge),"col-align-dots":a.unref(ne),"hovered-cell-bounds":a.unref(N),"has-header-row":a.unref(Re),"has-header-col":a.unref(Ke),"keep-alive":a.unref(X),"schedule-hide":a.unref(oe),"insert-row-at":a.unref(ve),"insert-col-at":a.unref(Be),"set-column-align":a.unref(vn),onComment:Oc,onCutTable:a.unref(ot),onCopyTable:a.unref(Xe),onToggleHeaderRow:a.unref(ue),onToggleHeaderCol:a.unref(me),onDeleteTable:a.unref($e),onCellOp:a.unref(Lc),onCellInsert:a.unref(Nc),onCellComment:Rc},null,8,["table-visible","table-bounds","row-dots","col-dots","col-align-dots","hovered-cell-bounds","has-header-row","has-header-col","keep-alive","schedule-hide","insert-row-at","insert-col-at","set-column-align","onCutTable","onCopyTable","onToggleHeaderRow","onToggleHeaderCol","onDeleteTable","onCellOp","onCellInsert"]),a.createVNode(I5,{ref_key:"linkToolbarRef",ref:Do,editor:a.unref(h)},null,8,["editor"]),a.createVNode(V5,{ref_key:"selToolbarRef",ref:bn,editor:a.unref(h),"enable-comment":n.enableComment,onComment:zc},null,8,["editor","enable-comment"]),a.createVNode(Z4,{visible:a.unref(k),"anchor-rect":a.unref(T),"initial-latex":a.unref(E),onConfirm:a.unref(D),onClose:a.unref(z)},null,8,["visible","anchor-rect","initial-latex","onConfirm","onClose"])],544))}});function W5(r,e){const t=r.createElement("p");return t.textContent=e,t}function _5(r,e,t){const n=r.createElement("p"),o=r.createElement("a");return o.setAttribute("href",e),o.setAttribute("target","_blank"),o.setAttribute("rel","noopener noreferrer"),o.className="pm-link",o.textContent=t||e,n.appendChild(o),n}function G5(r){var n,o;if(!r||!r.includes("embed-view"))return r;const e=new DOMParser().parseFromString(`<body>${r}</body>`,"text/html"),t=Array.from(e.body.querySelectorAll(':scope > div[data-type="embed-view"]'));for(const l of t){const i=((n=l.getAttribute("data-href"))==null?void 0:n.trim())??"",s=((o=l.textContent)==null?void 0:o.trim())||i,u=Hr(i)?_5(e,i,s):W5(e,s);l.replaceWith(u)}return e.body.innerHTML}const K5={class:"pagely-viewer-wrap"},Y5=a.defineComponent({__name:"PagelyViewer",props:{content:{},format:{default:"markdown"}},setup(r,{expose:e}){const t=r,n=a.ref(!1),o=No();function l(m,h){const p=h==="markdown"?dn(m):m;return G5(p)}const i=Bo({profile:"view",initialContent:l(t.content,t.format),headingCollapseExtension:o.extension,isSettingContent:n});a.watch(()=>t.content,m=>s(m,t.format)),a.watch(()=>t.format,m=>s(t.content,m));function s(m,h=t.format){const p=i.value;if(p){n.value=!0,p.setEditable(!0);try{p.commands.setContent(l(m,h),{emitUpdate:!1})}finally{p.setEditable(!1),n.value=!1}}}function u(){var m;return((m=i.value)==null?void 0:m.getHTML())??""}function d(){return Un(u())}return a.onBeforeUnmount(()=>{var m;(m=i.value)==null||m.destroy()}),e({getHtml:u,getMarkdown:d,setContent:s,getEditor:()=>i.value}),(m,h)=>(a.openBlock(),a.createElementBlock("div",K5,[a.createVNode(a.unref(_e.EditorContent),{editor:a.unref(i)},null,8,["editor"])]))}}),pl={type:"doc",content:[{type:"paragraph"}]};function mc(r={}){const e=a.ref(!1),t=a.ref(!0),n=No(),o=Bo({profile:"comment",initialContent:r.initialContent??pl,headingCollapseExtension:n.extension,isSettingContent:e,editable:r.editable??!0}),l=is(o,{onTrigger:b=>{var w;return(w=r.onMentionTrigger)==null?void 0:w.call(r,b)},onCancel:()=>{var b;return(b=r.onMentionCancel)==null?void 0:b.call(r)}});function i(){var b;t.value=((b=o.value)==null?void 0:b.isEmpty)??!0}function s(b,w){w==null||w.off("transaction",i),b==null||b.on("transaction",i),i()}a.watch(o,s,{immediate:!0}),a.onBeforeUnmount(()=>{var b,w;(b=o.value)==null||b.off("transaction",i),(w=o.value)==null||w.destroy()});function u(){var b;return((b=o.value)==null?void 0:b.getJSON())??pl}function d(b){const w=o.value;w&&(e.value=!0,w.commands.setContent(b,{emitUpdate:!1}),e.value=!1,i())}function m(){d(pl)}function h(b="end"){var w;(w=o.value)==null||w.commands.focus(b)}function p(){var b;(b=r.onSubmit)==null||b.call(r,u())}function v(b){var w;if(b.key==="Enter"){if(b.preventDefault(),b.shiftKey){(w=o.value)==null||w.chain().focus().splitBlock().run();return}p()}}return{editor:o,isEmpty:t,getContent:u,setContent:d,clear:m,focus:h,submit:p,onKeyDown:v,insertMention:b=>l.insertMention(b),getMentions:l.getMentions,applyMentions:l.applyMentions}}const J5={key:0,class:"pagely-comment-placeholder"},X5=a.defineComponent({__name:"CommentEditor",props:{initialContent:{},placeholder:{default:"输入评论"}},emits:["submit","mention:trigger","mention:cancel"],setup(r,{expose:e,emit:t}){const n=r,o=n.placeholder,l=t,i=mc({initialContent:n.initialContent,onSubmit:s=>l("submit",s),onMentionTrigger:s=>l("mention:trigger",s),onMentionCancel:()=>l("mention:cancel")});return e({getContent:i.getContent,setContent:i.setContent,clear:i.clear,focus:i.focus,submit:i.submit,insertMention:s=>i.insertMention(s)}),(s,u)=>(a.openBlock(),a.createElementBlock("div",{class:"pagely-comment-editor",onKeydownCapture:u[0]||(u[0]=(...d)=>a.unref(i).onKeyDown&&a.unref(i).onKeyDown(...d))},[a.createVNode(a.unref(_e.EditorContent),{editor:a.unref(i).editor.value},null,8,["editor"]),a.unref(i).isEmpty.value?(a.openBlock(),a.createElementBlock("span",J5,a.toDisplayString(a.unref(o)),1)):a.createCommentVNode("",!0)],32))}}),j5={class:"pagely-comment-content"},Q5=a.defineComponent({__name:"CommentContentViewer",props:{content:{}},setup(r,{expose:e}){const t=r,n=a.ref(!1),o=No(),l=Bo({profile:"comment",initialContent:t.content,headingCollapseExtension:o.extension,isSettingContent:n,editable:!1});function i(u){const d=l.value;if(d){n.value=!0,d.setEditable(!0);try{d.commands.setContent(u,{emitUpdate:!1})}finally{d.setEditable(!1),n.value=!1}}}function s(){var u;return((u=l.value)==null?void 0:u.getJSON())??null}return a.watch(()=>t.content,u=>i(u)),a.onBeforeUnmount(()=>{var u;(u=l.value)==null||u.destroy()}),e({getContent:s,setContent:i,getEditor:()=>l.value}),(u,d)=>(a.openBlock(),a.createElementBlock("div",j5,[a.createVNode(a.unref(_e.EditorContent),{editor:a.unref(l)},null,8,["editor"])]))}});exports.BLOCK_CONFIGS=ur;exports.BlockMenu=uc;exports.CommentBlock=Ju;exports.CommentContentViewer=Q5;exports.CommentEditor=X5;exports.CommentMark=ju;exports.DotFlowPadBlock=Qu;exports.EXTENSION_PROFILES=rc;exports.EmbedBlockShell=Ea;exports.EmbedFullscreenModal=ho;exports.EmbedView=Zu;exports.INSERT_BLOCK_CMDS=Ji;exports.INSERT_CMDS=or;exports.INSERT_ITEMS=qi;exports.INSERT_SECTIONS=Ui;exports.INSERT_SECTIONS_CELL=Wi;exports.InsertMenu=Ma;exports.Mention=tc;exports.MermaidBlock=ec;exports.PagelyEditor=U5;exports.PagelyViewer=Y5;exports.RESOLVED_INSERT_SECTIONS=Gi;exports.RESOLVED_INSERT_SECTIONS_CELL=Ki;exports.RESOLVED_INSERT_SECTIONS_CELL_WITH_OPS=Xi;exports.TableSizePicker=cc;exports.TableTools=dc;exports.calcMenuPosition=Yl;exports.htmlToMarkdown=Un;exports.markdownToHtml=dn;exports.normalizeLanguage=ss;exports.shouldLoad=nc;exports.useBlockButton=zi;exports.useBlockImageExport=lo;exports.useBlockMenu=Oi;exports.useCommentAnchors=$i;exports.useCommentEditor=mc;exports.useEditorCommands=os;exports.useInsertButton=ls;exports.useInsertMenu=as;exports.useMarkdownSync=ds;exports.useMenuSidePanel=Jl;exports.useTableTools=ic;