@inkeep/open-knowledge 0.43.0-beta.10 → 0.43.0-beta.11

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 (108) hide show
  1. package/dist/{acp-harness-probe-D9cTkuMT.mjs → acp-harness-probe-FScZV-OJ.mjs} +2 -2
  2. package/dist/assets/skills/discovery/SKILL.md +1 -1
  3. package/dist/assets/skills/project/SKILL.md +1 -1
  4. package/dist/cli.mjs +7 -7
  5. package/dist/constants-BGUGvvvl.mjs +2 -0
  6. package/dist/git-handle-Df2gTERY.mjs +1 -0
  7. package/dist/{git-handle-UIC7K5Fw.mjs → git-handle-DtR_jYUx.mjs} +2 -2
  8. package/dist/index.mjs +1 -1
  9. package/dist/init-BN5ycAVH.mjs +1 -0
  10. package/dist/{init-C3jLZpVV.mjs → init-DOMbM9QZ.mjs} +3 -3
  11. package/dist/{launch-json-removal-XwBCEaAO.mjs → launch-json-removal-BvzisN3q.mjs} +2 -2
  12. package/dist/{loader-BYtT6HwT.mjs → loader-Bh7WABE3.mjs} +2 -2
  13. package/dist/loader-CzSKMzBj.mjs +1 -0
  14. package/dist/md-manager-YqgOJSVI.mjs +2 -0
  15. package/dist/{open-browser-CGiyukoG.mjs → open-browser-peVrHuth.mjs} +2 -2
  16. package/dist/parse-worker.mjs +1 -1
  17. package/dist/{preview-DlzwRGU_.mjs → preview-DMMV4nt0.mjs} +2 -2
  18. package/dist/preview-Doi3j_Cy.mjs +1 -0
  19. package/dist/public/assets/{ActivityModeContent-BjW-VNSE.js → ActivityModeContent-HvPAzuap.js} +1 -1
  20. package/dist/public/assets/{AgentDiffPane-j36DVL1g.js → AgentDiffPane-DXVF7xlv.js} +1 -1
  21. package/dist/public/assets/{AgentThreadClientBinder-CE6rI2aT.js → AgentThreadClientBinder-IMQ8kqrK.js} +1 -1
  22. package/dist/public/assets/{CodeMirrorPropInput-CVrIx84a.js → CodeMirrorPropInput-B6WcHF3z.js} +1 -1
  23. package/dist/public/assets/{DocumentContext-BBZuJCfz.js → DocumentContext-QO2VJVUd.js} +1 -1
  24. package/dist/public/assets/{EditorModeToggle-CX5Jh4N0.js → EditorModeToggle-Br3TJSCO.js} +1 -1
  25. package/dist/public/assets/{EnableSyncConfirmDialog-B10u8n1i.js → EnableSyncConfirmDialog-URmUoyAC.js} +1 -1
  26. package/dist/public/assets/FeedbackForm-CwFVGju3.js +1 -0
  27. package/dist/public/assets/{GraphPanel-CJYpjaIw.js → GraphPanel-DHT3M_Xf.js} +1 -1
  28. package/dist/public/assets/{LintConfigEditor-CgfN9-PD.js → LintConfigEditor-D6wXCH7g.js} +1 -1
  29. package/dist/public/assets/{ManagedArtifactProperties-BDVq5wN3.js → ManagedArtifactProperties-CvnDCIWw.js} +1 -1
  30. package/dist/public/assets/{McpConsentDialogBody-Coe3N-YS.js → McpConsentDialogBody-C6b_iEsN.js} +1 -1
  31. package/dist/public/assets/{MermaidDocEditor-DcZ_-MzA.js → MermaidDocEditor-Ckjm-HWk.js} +1 -1
  32. package/dist/public/assets/{PropertyPanel-BISGQmxU.js → PropertyPanel-BCDQKDSD.js} +1 -1
  33. package/dist/public/assets/{ReportBugDialogBody-C5wWE46i.js → ReportBugDialogBody-lMg15sYD.js} +1 -1
  34. package/dist/public/assets/{SchemaConfigEditor-B3eLp98_.js → SchemaConfigEditor-Bf9Tfipc.js} +1 -1
  35. package/dist/public/assets/{SettingsDialogBody-D4dqeST7.js → SettingsDialogBody-CV0CO7sa.js} +1 -1
  36. package/dist/public/assets/{ShareBranchSwitchDialog-D_HYrO-M.js → ShareBranchSwitchDialog-PmMhJ9zu.js} +1 -1
  37. package/dist/public/assets/{ShareReceiveDialog-CCw_xKkg.js → ShareReceiveDialog-DUde-jX4.js} +1 -1
  38. package/dist/public/assets/{ShareReceiveMissDialog-TDfzNW6D.js → ShareReceiveMissDialog-CQTG5IFu.js} +1 -1
  39. package/dist/public/assets/{SkillEditorActions-Donhizbo.js → SkillEditorActions-CrM2BHhi.js} +1 -1
  40. package/dist/public/assets/{SourceEditor-D2SZ5OF3.js → SourceEditor-I-pbVLHm.js} +1 -1
  41. package/dist/public/assets/{TerminalPanel-C7pIldJ0.js → TerminalPanel-BJuvvjn8.js} +1 -1
  42. package/dist/public/assets/{TerminalSessionsHost-BTWnv_Gu.js → TerminalSessionsHost-CxF-jkuS.js} +2 -2
  43. package/dist/public/assets/{TerminalWindowApp-iqp-Np-a.js → TerminalWindowApp-CGrMEICf.js} +1 -1
  44. package/dist/public/assets/{ThreadView-DbS6XYBN.js → ThreadView-CDeOr2kl.js} +1 -1
  45. package/dist/public/assets/{TimelineDiffPane-CT7VsrDy.js → TimelineDiffPane-DTug7oMZ.js} +1 -1
  46. package/dist/public/assets/{agent-diff-store-CmJJu7WO.js → agent-diff-store-DyEP3Km6.js} +1 -1
  47. package/dist/public/assets/{agent-visibility-DujHi06m.js → agent-visibility-ik0M421s.js} +1 -1
  48. package/dist/public/assets/{auth-state-cache-C8cTMd6P.js → auth-state-cache--uMim9lN.js} +1 -1
  49. package/dist/public/assets/{client-version-Z-1kpNfZ.js → client-version-C5fqEdXh.js} +1 -1
  50. package/dist/public/assets/{config-provider-BI6LhEXG.js → config-provider-CY7XLhYT.js} +1 -1
  51. package/dist/public/assets/{dist-BlIr-8t0.js → dist-BMPs3czI.js} +92 -90
  52. package/dist/public/assets/{doc-hash-D0_HbJ23.js → doc-hash-Cx09mMdJ.js} +1 -1
  53. package/dist/public/assets/{documents-events-CJea1fR_.js → documents-events-CsZSbgqD.js} +1 -1
  54. package/dist/public/assets/{file-tree-adapter-DzAMgO1O.js → file-tree-adapter-DUQncykJ.js} +1 -1
  55. package/dist/public/assets/{file-tree-utils-3pfPI1X_.js → file-tree-utils-CMdRs-iN.js} +1 -1
  56. package/dist/public/assets/{index-C0AkDryr.js → index-DPtaNCi4.js} +7 -7
  57. package/dist/public/assets/{lint-config-client-DbBWIg_9.js → lint-config-client-T5L7AekD.js} +1 -1
  58. package/dist/public/assets/{markdownlint-rule-browser-CUFRDZ2I.js → markdownlint-rule-browser-DFieU89D.js} +1 -1
  59. package/dist/public/assets/{navigation-targets-dewfI5_V.js → navigation-targets-BYWxwjbH.js} +1 -1
  60. package/dist/public/assets/{open-managed-artifact-tab-kMJwQpt4.js → open-managed-artifact-tab-DHg0RpJW.js} +1 -1
  61. package/dist/public/assets/{pending-receive-nav-store-CDDIEMIE.js → pending-receive-nav-store-DJ88nbxo.js} +1 -1
  62. package/dist/public/assets/{prop-types-BmO8uGg2.js → prop-types-CBLBXb_o.js} +1 -1
  63. package/dist/public/assets/{receive-store-4fDKib_S.js → receive-store-D9WHZxmq.js} +1 -1
  64. package/dist/public/assets/{selection-context-C0NUwqpZ.js → selection-context-DUT4aHVv.js} +1 -1
  65. package/dist/public/assets/{skill-actions-BLuXIHSm.js → skill-actions-BIWFZvwD.js} +1 -1
  66. package/dist/public/assets/{skills-api-SMCgwzEY.js → skills-api-CzT5ZHi7.js} +1 -1
  67. package/dist/public/assets/{src-itVDbQfo.js → src-BffE3bRu.js} +1 -1
  68. package/dist/public/assets/{tag-pill-input-DR244KKn.js → tag-pill-input-iCzfP5zx.js} +1 -1
  69. package/dist/public/assets/{target-navigation-intent-Cbl2tfqs.js → target-navigation-intent-BJNDfVBU.js} +1 -1
  70. package/dist/public/assets/{terminal-launch-events-BRcRf0Xe.js → terminal-launch-events-CnydHAmR.js} +1 -1
  71. package/dist/public/assets/{terminal-telemetry-B2HfhwZL.js → terminal-telemetry-CgddbfDu.js} +1 -1
  72. package/dist/public/assets/{typing-burst-detector-D-YHMlG7.js → typing-burst-detector-Bq4PIaYN.js} +1 -1
  73. package/dist/public/assets/{uninstall-CBrvDiNY.js → uninstall-7eKZCCHA.js} +1 -1
  74. package/dist/public/assets/{use-activity-panel-DmOMj8An.js → use-activity-panel-BVKEKlCy.js} +1 -1
  75. package/dist/public/assets/{use-apply-config-color-theme-CVaACVk5.js → use-apply-config-color-theme-VU8Nd0Xm.js} +1 -1
  76. package/dist/public/assets/{use-collab-url-CNP-irXj.js → use-collab-url-Bb6AGYgx.js} +1 -1
  77. package/dist/public/assets/{use-live-xterm-theme-Dcnl-fJO.js → use-live-xterm-theme-C30BtcRX.js} +1 -1
  78. package/dist/public/assets/{use-settings-route-u-AZNZ9O.js → use-settings-route-D3WOGF5C.js} +1 -1
  79. package/dist/public/assets/{use-terminal-enabled-CkLthL6Z.js → use-terminal-enabled-BAUrOHbA.js} +1 -1
  80. package/dist/public/assets/{use-timeline-entry-diff-YCuC-AiR.js → use-timeline-entry-diff-B2Lo0NgF.js} +1 -1
  81. package/dist/public/assets/{use-workspace-Cn4V4yWb.js → use-workspace-BkbyFgS0.js} +1 -1
  82. package/dist/public/assets/{workspace-paths-Cs9eIuPX.js → workspace-paths-SOIn4Gp4.js} +1 -1
  83. package/dist/public/index.html +35 -35
  84. package/dist/public/uninstall.html +2 -2
  85. package/dist/{repair-launch-json-B7EsRree.mjs → repair-launch-json-A72nX3ay.mjs} +2 -2
  86. package/dist/{repair-mcp-configs-CAdsYeAL.mjs → repair-mcp-configs-DDgR6Hw-.mjs} +2 -2
  87. package/dist/repair-skills-BFhWJnt3.mjs +1 -0
  88. package/dist/{repair-skills-DVSrDMGl.mjs → repair-skills-CbG5sTm2.mjs} +2 -2
  89. package/dist/server-lock-CQupI16l.mjs +1 -0
  90. package/dist/{server-lock-WyY-R-p6.mjs → server-lock-Dasu-v2i.mjs} +2 -2
  91. package/dist/{src-BBhkxvx7.mjs → src-CG_sJ7fr.mjs} +4 -4
  92. package/dist/{src-BMO6onuh.mjs → src-Cne-ucNX.mjs} +1 -1
  93. package/dist/{src-DjCV5AKN.mjs → src-Dn5gGky8.mjs} +59 -57
  94. package/dist/{src-BzvNUgtF.mjs → src-NZxNysCL.mjs} +2 -2
  95. package/dist/{start-BYvqfT9V.mjs → start-CFKsyapS.mjs} +3 -3
  96. package/dist/start-vmGNxdER.mjs +1 -0
  97. package/dist/{write-project-skill-CS4rRA1W.mjs → write-project-skill-xElcbz-O.mjs} +2 -2
  98. package/package.json +4 -4
  99. package/dist/constants-BT3Cjn4w.mjs +0 -2
  100. package/dist/git-handle-BS2VGYSG.mjs +0 -1
  101. package/dist/init-mD_V5dOp.mjs +0 -1
  102. package/dist/loader-CqtToSGf.mjs +0 -1
  103. package/dist/md-manager-DP9jzxy1.mjs +0 -2
  104. package/dist/preview-BCOpQaY2.mjs +0 -1
  105. package/dist/public/assets/FeedbackForm-DxEuHipa.js +0 -1
  106. package/dist/repair-skills-ClK8g58l.mjs +0 -1
  107. package/dist/server-lock-W-oGU6ba.mjs +0 -1
  108. package/dist/start-ConG7Bk_.mjs +0 -1
@@ -306,67 +306,67 @@ ${n}`}}),s}var zw=new WeakMap;function Bw(e,t){let n=zw.get(e);if(!n){let t={cal
306
306
  `).map(e=>e.trim()===``?`>`:`> ${e}`);n.push(i.join(`
307
307
  `))}),n.join(`
308
308
  >
309
- `)},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[ww({find:Hk,type:this.type})]}}),Wk=Uk,Gk=/(^|[^`])`([^`]+)`(?!`)$/,Kk=/(^|[^`])`([^`]+)`(?!`)/g,qk=XC.create({name:`code`,addOptions(){return{HTMLAttributes:{}}},excludes:`_`,code:!0,exitable:!0,parseHTML(){return[{tag:`code`}]},renderHTML({HTMLAttributes:e}){return[`code`,PS(this.options.HTMLAttributes,e),0]},markdownTokenName:`codespan`,parseMarkdown:(e,t)=>t.applyMark(`code`,[{type:`text`,text:e.text||``}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:``,addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[xw({find:Gk,type:this.type})]},addPasteRules(){return[Gw({find:Kk,type:this.type})]}}),Jk=qk,Xee=Uw.create({name:`doc`,topNode:!0,content:`block+`,renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
309
+ `)},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[ww({find:Hk,type:this.type})]}}),Wk=Uk,Gk=/(^|[^`])`([^`]+)`(?!`)$/,Kk=/(^|[^`])`([^`]+)`(?!`)/g,qk=XC.create({name:`code`,addOptions(){return{HTMLAttributes:{}}},excludes:`_`,code:!0,exitable:!0,parseHTML(){return[{tag:`code`}]},renderHTML({HTMLAttributes:e}){return[`code`,PS(this.options.HTMLAttributes,e),0]},markdownTokenName:`codespan`,parseMarkdown:(e,t)=>t.applyMark(`code`,[{type:`text`,text:e.text||``}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:``,addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[xw({find:Gk,type:this.type})]},addPasteRules(){return[Gw({find:Kk,type:this.type})]}}),Xee=qk,Zee=Uw.create({name:`doc`,topNode:!0,content:`block+`,renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
310
310
 
311
- `):``}),Yk=Uw.create({name:`horizontalRule`,addOptions(){return{HTMLAttributes:{},nextNodeType:`paragraph`}},group:`block`,parseHTML(){return[{tag:`hr`}]},renderHTML({HTMLAttributes:e}){return[`hr`,PS(this.options.HTMLAttributes,e)]},markdownTokenName:`hr`,parseMarkdown:(e,t)=>t.createNode(`horizontalRule`),renderMarkdown:()=>`---`,addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!Dw(t,t.schema.nodes[this.name]))return!1;let{selection:n}=t,{$to:r}=n,i=e();return dC(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:e,tr:t,dispatch:n})=>{if(n){let{$to:n}=t.selection,r=n.end();if(n.nodeAfter)n.nodeAfter.isTextblock?t.setSelection(K.create(t.doc,n.pos+1)):n.nodeAfter.isBlock?t.setSelection(q.create(t.doc,n.pos)):t.setSelection(K.create(t.doc,n.pos));else{let i=(e.schema.nodes[this.options.nextNodeType]||n.parent.type.contentMatch.defaultType)?.create();i&&(t.insert(r,i),t.setSelection(K.create(t.doc,r+1)))}t.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Sw({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),Zee=Yk,Qee=Object.defineProperty,$ee=(e,t)=>{for(var n in t)Qee(e,n,{get:t[n],enumerable:!0})},ete=`listItem`,Xk=`textStyle`,Zk=/^\s*([-+*])\s$/,Qk=Uw.create({name:`bulletList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul`}]},renderHTML({HTMLAttributes:e}){return[`ul`,PS(this.options.HTMLAttributes,e),0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>e.type!==`list`||e.ordered?[]:{type:`bulletList`,content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
312
- `):``,markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(ete,this.editor.getAttributes(Xk)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=ww({find:Zk,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=ww({find:Zk,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Xk),editor:this.editor})),[e]}}),$k=Uw.create({name:`listItem`,addOptions(){return{HTMLAttributes:{},bulletListTypeName:`bulletList`,orderedListTypeName:`orderedList`}},content:`paragraph block*`,defining:!0,parseHTML(){return[{tag:`li`}]},renderHTML({HTMLAttributes:e}){return[`li`,PS(this.options.HTMLAttributes,e),0]},markdownTokenName:`list_item`,parseMarkdown:(e,t)=>{if(e.type!==`list_item`)return[];let n=t.parseBlockChildren??t.parseChildren,r=[];if(e.tokens&&e.tokens.length>0)if(e.tokens.some(e=>e.type===`paragraph`))r=n(e.tokens);else{let i=e.tokens[0];if(i&&i.type===`text`&&i.tokens&&i.tokens.length>0){if(r=[{type:`paragraph`,content:t.parseInline(i.tokens)}],e.tokens.length>1){let t=n(e.tokens.slice(1));r.push(...t)}}else r=n(e.tokens)}return r.length===0&&(r=[{type:`paragraph`,content:[]}]),{type:`listItem`,content:r}},renderMarkdown:(e,t,n)=>Rw(e,t,e=>e.parentType===`bulletList`?`- `:e.parentType===`orderedList`?`${(e.meta?.parentAttrs?.start||1)+e.index}. `:`- `,n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}});$ee({},{findListItemPos:()=>eA,getNextListDepth:()=>tA,handleBackspace:()=>aA,handleDelete:()=>cA,hasListBefore:()=>nA,hasListItemAfter:()=>tte,hasListItemBefore:()=>rA,listItemHasSubList:()=>iA,nextListIsDeeper:()=>oA,nextListIsHigher:()=>sA});var eA=(e,t)=>{let{$from:n}=t.selection,r=hx(e,t.schema),i=null,a=n.depth,o=n.pos,s=null;for(;a>0&&s===null;)i=n.node(a),i.type===r?s=a:(--a,--o);return s===null?null:{$pos:t.doc.resolve(o),depth:s}},tA=(e,t)=>{let n=eA(e,t);if(!n)return!1;let[,r]=eC(t,e,n.$pos.pos+4);return r},nA=(e,t,n)=>{let{$anchor:r}=e.selection,i=Math.max(0,r.pos-2),a=e.doc.resolve(i).node();return!(!a||!n.includes(a.type.name))},rA=(e,t)=>{let{$anchor:n}=t.selection,r=t.doc.resolve(n.pos-2);return!(r.index()===0||r.nodeBefore?.type.name!==e)},iA=(e,t,n)=>{if(!n)return!1;let r=hx(e,t.schema),i=!1;return n.descendants(e=>{e.type===r&&(i=!0)}),i},aA=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!tS(e.state,t)&&nA(e.state,t,n)){let{$anchor:n}=e.state.selection,r=e.state.doc.resolve(n.before()-1),i=[];r.node().descendants((e,n)=>{e.type.name===t&&i.push({node:e,pos:n})});let a=i.at(-1);if(!a)return!1;let o=e.state.doc.resolve(r.start()+a.pos+1);return e.chain().cut({from:n.start()-1,to:n.end()+1},o.end()).joinForward().run()}if(!tS(e.state,t)||!sC(e.state))return!1;let r=eA(t,e.state);if(!r)return!1;let i=e.state.doc.resolve(r.$pos.pos-2).node(r.depth),a=iA(t,e.state,i);return rA(t,e.state)&&!a?e.commands.joinItemBackward():e.chain().liftListItem(t).run()},oA=(e,t)=>{let n=tA(e,t),r=eA(e,t);return!r||!n?!1:n>r.depth},sA=(e,t)=>{let n=tA(e,t),r=eA(e,t);return!r||!n?!1:n<r.depth},cA=(e,t)=>{if(!tS(e.state,t)||!oC(e.state,t))return!1;let{selection:n}=e.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:oA(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():sA(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},tte=(e,t)=>{let{$anchor:n}=t.selection,r=t.doc.resolve(n.pos-n.parentOffset-2);return!(r.index()===r.parent.childCount-1||r.nodeAfter?.type.name!==e)},lA=aw.create({name:`listKeymap`,addOptions(){return{listTypes:[{itemName:`listItem`,wrapperNames:[`bulletList`,`orderedList`]},{itemName:`taskItem`,wrapperNames:[`taskList`]}]}},addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&cA(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&cA(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&aA(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&aA(e,n,r)&&(t=!0)}),t}}}}),uA=/^(\s*)(\d+)\.\s+(.*)$/,nte=/^\s/;function rte(e){let t=[],n=0,r=0;for(;n<e.length;){let i=e[n],a=i.match(uA);if(!a)break;let[,o,s,c]=a,l=o.length,u=c,d=n+1,f=[i];for(;d<e.length;){let t=e[d];if(t.match(uA))break;if(t.trim()===``)f.push(t),u+=`
313
- `,d+=1;else if(t.match(nte))f.push(t),u+=`
311
+ `):``}),Jk=Uw.create({name:`horizontalRule`,addOptions(){return{HTMLAttributes:{},nextNodeType:`paragraph`}},group:`block`,parseHTML(){return[{tag:`hr`}]},renderHTML({HTMLAttributes:e}){return[`hr`,PS(this.options.HTMLAttributes,e)]},markdownTokenName:`hr`,parseMarkdown:(e,t)=>t.createNode(`horizontalRule`),renderMarkdown:()=>`---`,addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!Dw(t,t.schema.nodes[this.name]))return!1;let{selection:n}=t,{$to:r}=n,i=e();return dC(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:e,tr:t,dispatch:n})=>{if(n){let{$to:n}=t.selection,r=n.end();if(n.nodeAfter)n.nodeAfter.isTextblock?t.setSelection(K.create(t.doc,n.pos+1)):n.nodeAfter.isBlock?t.setSelection(q.create(t.doc,n.pos)):t.setSelection(K.create(t.doc,n.pos));else{let i=(e.schema.nodes[this.options.nextNodeType]||n.parent.type.contentMatch.defaultType)?.create();i&&(t.insert(r,i),t.setSelection(K.create(t.doc,r+1)))}t.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Sw({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),Qee=Jk,$ee=Object.defineProperty,ete=(e,t)=>{for(var n in t)$ee(e,n,{get:t[n],enumerable:!0})},tte=`listItem`,Yk=`textStyle`,Xk=/^\s*([-+*])\s$/,Zk=Uw.create({name:`bulletList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul`}]},renderHTML({HTMLAttributes:e}){return[`ul`,PS(this.options.HTMLAttributes,e),0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>e.type!==`list`||e.ordered?[]:{type:`bulletList`,content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
312
+ `):``,markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(tte,this.editor.getAttributes(Yk)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=ww({find:Xk,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=ww({find:Xk,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Yk),editor:this.editor})),[e]}}),Qk=Uw.create({name:`listItem`,addOptions(){return{HTMLAttributes:{},bulletListTypeName:`bulletList`,orderedListTypeName:`orderedList`}},content:`paragraph block*`,defining:!0,parseHTML(){return[{tag:`li`}]},renderHTML({HTMLAttributes:e}){return[`li`,PS(this.options.HTMLAttributes,e),0]},markdownTokenName:`list_item`,parseMarkdown:(e,t)=>{if(e.type!==`list_item`)return[];let n=t.parseBlockChildren??t.parseChildren,r=[];if(e.tokens&&e.tokens.length>0)if(e.tokens.some(e=>e.type===`paragraph`))r=n(e.tokens);else{let i=e.tokens[0];if(i&&i.type===`text`&&i.tokens&&i.tokens.length>0){if(r=[{type:`paragraph`,content:t.parseInline(i.tokens)}],e.tokens.length>1){let t=n(e.tokens.slice(1));r.push(...t)}}else r=n(e.tokens)}return r.length===0&&(r=[{type:`paragraph`,content:[]}]),{type:`listItem`,content:r}},renderMarkdown:(e,t,n)=>Rw(e,t,e=>e.parentType===`bulletList`?`- `:e.parentType===`orderedList`?`${(e.meta?.parentAttrs?.start||1)+e.index}. `:`- `,n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}});ete({},{findListItemPos:()=>$k,getNextListDepth:()=>eA,handleBackspace:()=>iA,handleDelete:()=>sA,hasListBefore:()=>tA,hasListItemAfter:()=>nte,hasListItemBefore:()=>nA,listItemHasSubList:()=>rA,nextListIsDeeper:()=>aA,nextListIsHigher:()=>oA});var $k=(e,t)=>{let{$from:n}=t.selection,r=hx(e,t.schema),i=null,a=n.depth,o=n.pos,s=null;for(;a>0&&s===null;)i=n.node(a),i.type===r?s=a:(--a,--o);return s===null?null:{$pos:t.doc.resolve(o),depth:s}},eA=(e,t)=>{let n=$k(e,t);if(!n)return!1;let[,r]=eC(t,e,n.$pos.pos+4);return r},tA=(e,t,n)=>{let{$anchor:r}=e.selection,i=Math.max(0,r.pos-2),a=e.doc.resolve(i).node();return!(!a||!n.includes(a.type.name))},nA=(e,t)=>{let{$anchor:n}=t.selection,r=t.doc.resolve(n.pos-2);return!(r.index()===0||r.nodeBefore?.type.name!==e)},rA=(e,t,n)=>{if(!n)return!1;let r=hx(e,t.schema),i=!1;return n.descendants(e=>{e.type===r&&(i=!0)}),i},iA=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!tS(e.state,t)&&tA(e.state,t,n)){let{$anchor:n}=e.state.selection,r=e.state.doc.resolve(n.before()-1),i=[];r.node().descendants((e,n)=>{e.type.name===t&&i.push({node:e,pos:n})});let a=i.at(-1);if(!a)return!1;let o=e.state.doc.resolve(r.start()+a.pos+1);return e.chain().cut({from:n.start()-1,to:n.end()+1},o.end()).joinForward().run()}if(!tS(e.state,t)||!sC(e.state))return!1;let r=$k(t,e.state);if(!r)return!1;let i=e.state.doc.resolve(r.$pos.pos-2).node(r.depth),a=rA(t,e.state,i);return nA(t,e.state)&&!a?e.commands.joinItemBackward():e.chain().liftListItem(t).run()},aA=(e,t)=>{let n=eA(e,t),r=$k(e,t);return!r||!n?!1:n>r.depth},oA=(e,t)=>{let n=eA(e,t),r=$k(e,t);return!r||!n?!1:n<r.depth},sA=(e,t)=>{if(!tS(e.state,t)||!oC(e.state,t))return!1;let{selection:n}=e.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:aA(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():oA(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},nte=(e,t)=>{let{$anchor:n}=t.selection,r=t.doc.resolve(n.pos-n.parentOffset-2);return!(r.index()===r.parent.childCount-1||r.nodeAfter?.type.name!==e)},cA=aw.create({name:`listKeymap`,addOptions(){return{listTypes:[{itemName:`listItem`,wrapperNames:[`bulletList`,`orderedList`]},{itemName:`taskItem`,wrapperNames:[`taskList`]}]}},addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&sA(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&sA(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&iA(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&iA(e,n,r)&&(t=!0)}),t}}}}),lA=/^(\s*)(\d+)\.\s+(.*)$/,rte=/^\s/;function ite(e){let t=[],n=0,r=0;for(;n<e.length;){let i=e[n],a=i.match(lA);if(!a)break;let[,o,s,c]=a,l=o.length,u=c,d=n+1,f=[i];for(;d<e.length;){let t=e[d];if(t.match(lA))break;if(t.trim()===``)f.push(t),u+=`
313
+ `,d+=1;else if(t.match(rte))f.push(t),u+=`
314
314
  ${t.slice(l+2)}`,d+=1;else break}t.push({indent:l,number:parseInt(s,10),content:u.trim(),raw:f.join(`
315
- `)}),r=d,n=d}return[t,r]}function dA(e,t,n){let r=[],i=0;for(;i<e.length;){let a=e[i];if(a.indent===t){let o=a.content.split(`
315
+ `)}),r=d,n=d}return[t,r]}function uA(e,t,n){let r=[],i=0;for(;i<e.length;){let a=e[i];if(a.indent===t){let o=a.content.split(`
316
316
  `),s=o[0]?.trim()||``,c=[];s&&c.push({type:`paragraph`,raw:s,tokens:n.inlineTokens(s)});let l=o.slice(1).join(`
317
- `).trim();if(l){let e=n.blockTokens(l);c.push(...e)}let u=i+1,d=[];for(;u<e.length&&e[u].indent>t;)d.push(e[u]),u+=1;if(d.length>0){let e=dA(d,Math.min(...d.map(e=>e.indent)),n);c.push({type:`list`,ordered:!0,start:d[0].number,items:e,raw:d.map(e=>e.raw).join(`
318
- `)})}r.push({type:`list_item`,raw:a.raw,tokens:c}),i=u}else i+=1}return r}function ite(e,t){return e.map(e=>{if(e.type!==`list_item`)return t.parseChildren([e])[0];let n=[];return e.tokens&&e.tokens.length>0&&e.tokens.forEach(e=>{if(e.type===`paragraph`||e.type===`list`||e.type===`blockquote`||e.type===`code`)n.push(...t.parseChildren([e]));else if(e.type===`text`&&e.tokens){let r=t.parseChildren([e]);n.push({type:`paragraph`,content:r})}else{let r=t.parseChildren([e]);r.length>0&&n.push(...r)}}),{type:`listItem`,content:n}})}var ate=`listItem`,fA=`textStyle`,pA=/^(\d+)\.\s$/,mA=Uw.create({name:`orderedList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute(`start`)?parseInt(e.getAttribute(`start`)||``,10):1},type:{default:null,parseHTML:e=>e.getAttribute(`type`)}}},parseHTML(){return[{tag:`ol`}]},renderHTML({HTMLAttributes:e}){let{start:t,...n}=e;return t===1?[`ol`,PS(this.options.HTMLAttributes,n),0]:[`ol`,PS(this.options.HTMLAttributes,e),0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>{if(e.type!==`list`||!e.ordered)return[];let n=e.start||1,r=e.items?ite(e.items,t):[];return n===1?{type:`orderedList`,content:r}:{type:`orderedList`,attrs:{start:n},content:r}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
317
+ `).trim();if(l){let e=n.blockTokens(l);c.push(...e)}let u=i+1,d=[];for(;u<e.length&&e[u].indent>t;)d.push(e[u]),u+=1;if(d.length>0){let e=uA(d,Math.min(...d.map(e=>e.indent)),n);c.push({type:`list`,ordered:!0,start:d[0].number,items:e,raw:d.map(e=>e.raw).join(`
318
+ `)})}r.push({type:`list_item`,raw:a.raw,tokens:c}),i=u}else i+=1}return r}function ate(e,t){return e.map(e=>{if(e.type!==`list_item`)return t.parseChildren([e])[0];let n=[];return e.tokens&&e.tokens.length>0&&e.tokens.forEach(e=>{if(e.type===`paragraph`||e.type===`list`||e.type===`blockquote`||e.type===`code`)n.push(...t.parseChildren([e]));else if(e.type===`text`&&e.tokens){let r=t.parseChildren([e]);n.push({type:`paragraph`,content:r})}else{let r=t.parseChildren([e]);r.length>0&&n.push(...r)}}),{type:`listItem`,content:n}})}var ote=`listItem`,dA=`textStyle`,fA=/^(\d+)\.\s$/,pA=Uw.create({name:`orderedList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute(`start`)?parseInt(e.getAttribute(`start`)||``,10):1},type:{default:null,parseHTML:e=>e.getAttribute(`type`)}}},parseHTML(){return[{tag:`ol`}]},renderHTML({HTMLAttributes:e}){let{start:t,...n}=e;return t===1?[`ol`,PS(this.options.HTMLAttributes,n),0]:[`ol`,PS(this.options.HTMLAttributes,e),0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>{if(e.type!==`list`||!e.ordered)return[];let n=e.start||1,r=e.items?ate(e.items,t):[];return n===1?{type:`orderedList`,content:r}:{type:`orderedList`,attrs:{start:n},content:r}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
319
319
  `):``,markdownTokenizer:{name:`orderedList`,level:`block`,start:e=>{let t=e.match(/^(\s*)(\d+)\.\s+/)?.index;return t===void 0?-1:t},tokenize:(e,t,n)=>{let r=e.split(`
320
- `),[i,a]=rte(r);if(i.length===0)return;let o=dA(i,0,n);if(o.length!==0)return{type:`list`,ordered:!0,start:i[0]?.number||1,items:o,raw:r.slice(0,a).join(`
321
- `)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(ate,this.editor.getAttributes(fA)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=ww({find:pA,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=ww({find:pA,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(fA)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[e]}}),ote=/^\s*(\[([( |x])?\])\s$/,ste=Uw.create({name:`taskItem`,addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:`taskList`,a11y:void 0}},content(){return this.options.nested?`paragraph block*`:`paragraph+`},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{let t=e.getAttribute(`data-checked`);return t===``||t===`true`},renderHTML:e=>({"data-checked":e.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return[`li`,PS(this.options.HTMLAttributes,t,{"data-type":this.name}),[`label`,[`input`,{type:`checkbox`,checked:e.attrs.checked?`checked`:null}],[`span`]],[`div`,0]]},parseMarkdown:(e,t)=>{let n=[];if(e.tokens&&e.tokens.length>0?n.push(t.createNode(`paragraph`,{},t.parseInline(e.tokens))):e.text?n.push(t.createNode(`paragraph`,{},[t.createNode(`text`,{text:e.text})])):n.push(t.createNode(`paragraph`,{},[])),e.nestedTokens&&e.nestedTokens.length>0){let r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode(`taskItem`,{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>Rw(e,t,`- [${e.attrs?.checked?`x`:` `}] `),addKeyboardShortcuts(){let e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{let i=document.createElement(`li`),a=document.createElement(`label`),o=document.createElement(`span`),s=document.createElement(`input`),c=document.createElement(`div`),l=e=>{var t;s.ariaLabel=((t=this.options.a11y)?.checkboxLabel)?.call(t,e,s.checked)||`Task item checkbox for ${e.textContent||`empty task item`}`};l(e),a.contentEditable=`false`,s.type=`checkbox`,s.addEventListener(`mousedown`,e=>e.preventDefault()),s.addEventListener(`change`,t=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){s.checked=!s.checked;return}let{checked:i}=t.target;r.isEditable&&typeof n==`function`&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:e})=>{let t=n();if(typeof t!=`number`)return!1;let r=e.doc.nodeAt(t);return e.setNodeMarkup(t,void 0,{...r?.attrs,checked:i}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,i)||(s.checked=!s.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([e,t])=>{i.setAttribute(e,t)}),i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,a.append(s,o),i.append(a,c),Object.entries(t).forEach(([e,t])=>{i.setAttribute(e,t)});let u=new Set(Object.keys(t));return{dom:i,contentDOM:c,update:e=>{if(e.type!==this.type)return!1;i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,l(e);let t=r.extensionManager.attributes,n=FS(e,t),a=new Set(Object.keys(n)),o=this.options.HTMLAttributes;return u.forEach(e=>{a.has(e)||(e in o?i.setAttribute(e,o[e]):i.removeAttribute(e))}),Object.entries(n).forEach(([e,t])=>{t==null?e in o?i.setAttribute(e,o[e]):i.removeAttribute(e):i.setAttribute(e,t)}),u=a,!0}}}},addInputRules(){return[ww({find:ote,type:this.type,getAttributes:e=>({checked:e[e.length-1]===`x`})})]}}),cte=Uw.create({name:`taskList`,addOptions(){return{itemTypeName:`taskItem`,HTMLAttributes:{}}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return[`ul`,PS(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,t)=>t.createNode(`taskList`,{},t.parseChildren(e.items||[])),renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
322
- `):``,markdownTokenizer:{name:`taskList`,level:`block`,start(e){let t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/)?.index;return t===void 0?-1:t},tokenize(e,t,n){let r=e=>{let t=Lw(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);return t?[{type:`taskList`,raw:t.raw,items:t.items}]:n.blockTokens(e)},i=Lw(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(i)return{type:`taskList`,raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});aw.create({name:`listKit`,addExtensions(){let e=[];return this.options.bulletList!==!1&&e.push(Qk.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push($k.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(lA.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(mA.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(ste.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(cte.configure(this.options.taskList)),e}});var hA=`&nbsp;`,gA=`\xA0`,lte=Uw.create({name:`paragraph`,priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML({HTMLAttributes:e}){return[`p`,PS(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{let n=e.tokens||[];if(n.length===1&&n[0].type===`image`)return t.parseChildren([n[0]]);let r=t.parseInline(n);return n.length===1&&n[0].type===`text`&&(n[0].raw===hA||n[0].text===hA||n[0].raw===gA||n[0].text===gA)&&r.length===1&&r[0].type===`text`&&(r[0].text===hA||r[0].text===gA)?t.createNode(`paragraph`,void 0,[]):t.createNode(`paragraph`,void 0,r)},renderMarkdown:(e,t,n)=>{if(!e)return``;let r=Array.isArray(e.content)?e.content:[];if(r.length===0){let e=Array.isArray(n?.previousNode?.content)?n.previousNode.content:[];return n?.previousNode?.type===`paragraph`&&e.length===0?hA:``}return t.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),ute=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,dte=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,_A=XC.create({name:`strike`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`s`},{tag:`del`},{tag:`strike`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`line-through`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`s`,PS(this.options.HTMLAttributes,e),0]},markdownTokenName:`del`,parseMarkdown:(e,t)=>t.applyMark(`strike`,t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[xw({find:ute,type:this.type})]},addPasteRules(){return[Gw({find:dte,type:this.type})]}}),fte=_A,pte=Uw.create({name:`text`,group:`inline`,parseMarkdown:e=>({type:`text`,text:e.text||``}),renderMarkdown:e=>e.text||``}),mte=XC.create({name:`underline`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`u`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`underline`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`u`,PS(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||`underline`,t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`++${t.renderChildren(e)}++`},markdownTokenizer:{name:`underline`,level:`inline`,start(e){return e.indexOf(`++`)},tokenize(e,t,n){let r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;let i=r[2].trim();return{type:`underline`,raw:r[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function hte(e={}){return new Qh({view(t){return new gte(t,e)}})}var gte=class{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.lastDragEvent=null,this.width=t.width??1,this.color=t.color===!1?void 0:t.color||`black`,this.class=t.class,this.handlers=[`dragover`,`dragend`,`drop`,`dragleave`].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){if(this.cursorPos!=null&&t.doc!=e.state.doc)if(this.lastDragEvent){let e=this.computeTarget(this.lastDragEvent);e==this.cursorPos?this.updateOverlay():this.setCursor(e)}else this.updateOverlay()}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,r=this.editorView.dom,i=r.getBoundingClientRect(),a=i.width/r.offsetWidth,o=i.height/r.offsetHeight;if(t){let t=e.nodeBefore,r=e.nodeAfter;if(t||r){let e=this.editorView.nodeDOM(this.cursorPos-(t?t.nodeSize:0));if(e){let i=e.getBoundingClientRect(),a=t?i.bottom:i.top;t&&r&&(a=(a+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*o;n={left:i.left,right:i.right,top:a-s,bottom:a+s}}}}if(!n){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*a;n={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let s=this.editorView.dom.offsetParent;this.element||(this.element=s.appendChild(document.createElement(`div`)),this.class&&(this.element.className=this.class),this.element.style.cssText=`position: absolute; z-index: 50; pointer-events: none;`,this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle(`prosemirror-dropcursor-block`,t),this.element.classList.toggle(`prosemirror-dropcursor-inline`,!t);let c,l;if(!s||s==document.body&&getComputedStyle(s).position==`static`)c=-pageXOffset,l=-pageYOffset;else{let e=s.getBoundingClientRect(),t=e.width/s.offsetWidth,n=e.height/s.offsetHeight;c=e.left-s.scrollLeft*t,l=e.top-s.scrollTop*n}this.element.style.left=(n.left-c)/a+`px`,this.element.style.top=(n.top-l)/o+`px`,this.element.style.width=(n.right-n.left)/a+`px`,this.element.style.height=(n.bottom-n.top)/o+`px`}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}computeTarget(e){let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i=typeof r==`function`?r(this.editorView,t,e):r;if(!t||i)return null;let a=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let e=fh(this.editorView.state.doc,a,this.editorView.dragging.slice);e!=null&&(a=e)}return a}dragover(e){if(!this.editorView.editable)return;this.lastDragEvent=e;let t=this.computeTarget(e);t!=null&&(this.setCursor(t),this.scheduleRemoval(5e3))}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}},vA=class e extends G{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):G.near(r)}content(){return W.empty}eq(t){return t instanceof e&&t.head==this.head}toJSON(){return{type:`gapcursor`,pos:this.head}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for GapCursor.fromJSON`);return new e(t.resolve(n.pos))}getBookmark(){return new _te(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!vte(e)||!yte(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,n,r=!1){search:for(;;){if(!r&&e.valid(t))return t;let i=t.pos,a=null;for(let r=t.depth;;r--){let o=t.node(r);if(n>0?t.indexAfter(r)<o.childCount:t.index(r)>0){a=o.child(n>0?t.indexAfter(r):t.index(r)-1);break}else if(r==0)return null;i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}for(;;){let o=n>0?a.firstChild:a.lastChild;if(!o){if(a.isAtom&&!a.isText&&!q.isSelectable(a)){t=t.doc.resolve(i+a.nodeSize*n),r=!1;continue search}break}a=o,i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}return null}}};vA.prototype.visible=!1,vA.findFrom=vA.findGapCursorFrom,G.jsonID(`gapcursor`,vA);var _te=class e{constructor(e){this.pos=e}map(t){return new e(t.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return vA.valid(t)?new vA(t):G.near(t)}};function yA(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function vte(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n-1);;e=e.lastChild){if(e.childCount==0&&!e.inlineContent||yA(e.type))return!0;if(e.inlineContent)return!1}}return!0}function yte(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n);;e=e.firstChild){if(e.childCount==0&&!e.inlineContent||yA(e.type))return!0;if(e.inlineContent)return!1}}return!0}function bte(){return new Qh({props:{decorations:wte,createSelectionBetween(e,t,n){return t.pos==n.pos&&vA.valid(n)?new vA(n):null},handleClick:Ste,handleKeyDown:xte,handleDOMEvents:{beforeinput:Cte}}})}var xte=nx({ArrowLeft:bA(`horiz`,-1),ArrowRight:bA(`horiz`,1),ArrowUp:bA(`vert`,-1),ArrowDown:bA(`vert`,1)});function bA(e,t){let n=e==`vert`?t>0?`down`:`up`:t>0?`right`:`left`;return function(e,r,i){let a=e.selection,o=t>0?a.$to:a.$from,s=a.empty;if(a instanceof K){if(!i.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}let c=vA.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new vA(c))),!0):!1}}function Ste(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!vA.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&q.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new vA(r))),!0)}function Cte(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof vA))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=U.empty;for(let e=r.length-1;e>=0;e--)i=U.from(r[e].createAndFill(null,i));let a=e.state.tr.replace(n.pos,n.pos,new W(i,0,0));return a.setSelection(K.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function wte(e){if(!(e.selection instanceof vA))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,cb.create(e.doc,[ab.widget(e.selection.head,t,{key:`gapcursor`})])}var xA=200,SA=function(){};SA.prototype.append=function(e){return e.length?(e=SA.from(e),!this.length&&e||e.length<xA&&this.leafAppend(e)||this.length<xA&&e.leafPrepend(this)||this.appendInner(e)):this},SA.prototype.prepend=function(e){return e.length?SA.from(e).append(this):this},SA.prototype.appendInner=function(e){return new Tte(this,e)},SA.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?SA.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},SA.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},SA.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},SA.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},SA.from=function(e){return e instanceof SA?e:e&&e.length?new CA(e):SA.empty};var CA=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return e==0&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(e(this.values[i],r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(e(this.values[i],r+i)===!1)return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=xA)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=xA)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(SA);SA.empty=new CA([]);var Tte=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&this.left.forEachInner(e,t,Math.min(n,i),r)===!1||n>i&&this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)===!1||n<i&&this.left.forEachInvertedInner(e,Math.min(t,i),n,r)===!1)return!1},t.prototype.sliceInner=function(e,t){if(e==0&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(SA),Ete=500,wA=class e{constructor(e,t){this.items=e,this.eventCount=t}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,a;n&&(i=this.remapping(r,this.items.length),a=i.maps.length);let o=t.tr,s,c,l=[],u=[];return this.items.forEach((t,n)=>{if(!t.step){i||(i=this.remapping(r,n+1),a=i.maps.length),a--,u.push(t);return}if(i){u.push(new TA(t.map));let e=t.step.map(i.slice(a)),n;e&&o.maybeStep(e).doc&&(n=o.mapping.maps[o.mapping.maps.length-1],l.push(new TA(n,void 0,void 0,l.length+u.length))),a--,n&&i.appendMap(n,a)}else o.maybeStep(t.step);if(t.selection)return s=i?t.selection.map(i.slice(a)):t.selection,c=new e(this.items.slice(0,r).append(u.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:o,selection:s}}addTransform(t,n,r,i){let a=[],o=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let e=0;e<t.steps.length;e++){let r=t.steps[e].invert(t.docs[e]),l=new TA(t.mapping.maps[e],r,n),u;(u=c&&c.merge(l))&&(l=u,e?a.pop():s=s.slice(0,s.length-1)),a.push(l),n&&=(o++,void 0),i||(c=l)}let l=o-r.depth;return l>Ote&&(s=Dte(s,l),o-=l),new e(s.append(a),o)}remapping(e,t){let n=new Am;return this.items.forEach((t,r)=>{let i=t.mirrorOffset!=null&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(t){return this.eventCount==0?this:new e(this.items.append(t.map(e=>new TA(e))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),a=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},i);let c=n;this.items.forEach(e=>{let n=a.getMirror(--c);if(n==null)return;o=Math.min(o,n);let i=a.maps[n];if(e.step){let o=t.steps[n].invert(t.docs[n]),l=e.selection&&e.selection.map(a.slice(c+1,n));l&&s++,r.push(new TA(i,o,l))}else r.push(new TA(i))},i);let l=[];for(let e=n;e<o;e++)l.push(new TA(a.maps[e]));let u=new e(this.items.slice(0,i).append(l).append(r),s);return u.emptyItemCount()>Ete&&(u=u.compress(this.items.length-r.length)),u}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],a=0;return this.items.forEach((e,o)=>{if(o>=t)i.push(e),e.selection&&a++;else if(e.step){let t=e.step.map(n.slice(r)),o=t&&t.getMap();if(r--,o&&n.appendMap(o,r),t){let s=e.selection&&e.selection.map(n.slice(r));s&&a++;let c=new TA(o.invert(),t,s),l,u=i.length-1;(l=i.length&&i[u].merge(c))?i[u]=l:i.push(c)}}else e.map&&r--},this.items.length,0),new e(SA.from(i.reverse()),a)}};wA.empty=new wA(SA.empty,0);function Dte(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}var TA=class e{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}},EA=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}},Ote=20;function kte(e,t,n,r){let i=n.getMeta(MA),a;if(i)return i.historyState;n.getMeta(Mte)&&(e=new EA(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(MA))return o.getMeta(MA).redo?new EA(e.done.addTransform(n,void 0,r,jA(t)),e.undone,DA(n.mapping.maps),e.prevTime,e.prevComposition):new EA(e.done,e.undone.addTransform(n,void 0,r,jA(t)),null,e.prevTime,e.prevComposition);if(n.getMeta(`addToHistory`)!==!1&&!(o&&o.getMeta(`addToHistory`)===!1)){let i=n.getMeta(`composition`),a=e.prevTime==0||!o&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!Ate(n,e.prevRanges)),s=o?OA(e.prevRanges,n.mapping):DA(n.mapping.maps);return new EA(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,jA(t)),wA.empty,s,n.time,i??e.prevComposition)}else if(a=n.getMeta(`rebased`))return new EA(e.done.rebased(n,a),e.undone.rebased(n,a),OA(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);else return new EA(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),OA(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function Ate(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}function DA(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function OA(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),a=t.map(e[r+1],-1);i<=a&&n.push(i,a)}return n}function jte(e,t,n){let r=jA(t),i=MA.get(t).spec.config,a=(n?e.undone:e.done).popEvent(t,r);if(!a)return null;let o=a.selection.resolve(a.transform.doc),s=(n?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),i,r),c=new EA(n?s:a.remaining,n?a.remaining:s,null,0,-1);return a.transform.setSelection(o).setMeta(MA,{redo:n,historyState:c})}var kA=!1,AA=null;function jA(e){let t=e.plugins;if(AA!=t){kA=!1,AA=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){kA=!0;break}}return kA}var MA=new tg(`history`),Mte=new tg(`closeHistory`);function NA(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new Qh({key:MA,state:{init(){return new EA(wA.empty,wA.empty,null,0,-1)},apply(t,n,r){return kte(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r=n==`historyUndo`?FA:n==`historyRedo`?IA:null;return!r||!e.editable?!1:(t.preventDefault(),r(e.state,e.dispatch))}}}})}function PA(e,t){return(n,r)=>{let i=MA.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=jte(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}var FA=PA(!1,!0),IA=PA(!0,!0);aw.create({name:`characterCount`,addOptions(){return{limit:null,mode:`textSize`,textCounter:e=>e.length,wordCounter:e=>e.split(` `).filter(e=>e!==``).length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{let t=e?.node||this.editor.state.doc;if((e?.mode||this.options.mode)===`textSize`){let e=t.textBetween(0,t.content.size,void 0,` `);return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{let t=e?.node||this.editor.state.doc,n=t.textBetween(0,t.content.size,` `,` `);return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new Qh({key:new tg(`characterCount`),appendTransaction:(t,n,r)=>{if(e)return;let i=this.options.limit;if(i==null||i===0){e=!0;return}let a=this.storage.characters({node:r.doc});if(a>i){let t=a-i;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let n=r.tr.deleteRange(0,t);return e=!0,n}e=!0},filterTransaction:(e,t)=>{let n=this.options.limit;if(!e.docChanged||n===0||n==null)return!0;let r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n||r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r||!e.getMeta(`paste`))return!1;let a=e.selection.$head.pos,o=a-(i-n),s=a;return e.deleteRange(o,s),!(this.storage.characters({node:e.doc})>n)}})]}});var Nte=aw.create({name:`dropCursor`,addOptions(){return{color:`currentColor`,width:1,class:void 0}},addProseMirrorPlugins(){return[hte(this.options)]}});aw.create({name:`focus`,addOptions(){return{className:`has-focus`,mode:`all`}},addProseMirrorPlugins(){return[new Qh({key:new tg(`focus`),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,a=[];if(!n||!r)return cb.create(e,[]);let o=0;this.options.mode===`deepest`&&e.descendants((e,t)=>{if(!e.isText){if(!(i>=t&&i<=t+e.nodeSize-1))return!1;o+=1}});let s=0;return e.descendants((e,t)=>{if(e.isText||!(i>=t&&i<=t+e.nodeSize-1))return!1;if(s+=1,this.options.mode===`deepest`&&o-s>0||this.options.mode===`shallowest`&&s>1)return this.options.mode===`deepest`;a.push(ab.node(t,t+e.nodeSize,{class:this.options.className}))}),cb.create(e,a)}}})]}});var Pte=aw.create({name:`gapCursor`,addProseMirrorPlugins(){return[bte()]},extendNodeSchema(e){return{allowGapCursor:OS(J(e,`allowGapCursor`,{name:e.name,options:e.options,storage:e.storage}))??null}}}),LA=`placeholder`;function Fte(e){return e.replace(/\s+/g,`-`).replace(/[^a-zA-Z0-9-]/g,``).replace(/^[0-9-]+/,``).replace(/^-+/,``).toLowerCase()}var Ite=aw.create({name:`placeholder`,addOptions(){return{emptyEditorClass:`is-editor-empty`,emptyNodeClass:`is-empty`,dataAttribute:LA,placeholder:`Write something …`,showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){let e=this.options.dataAttribute?`data-${Fte(this.options.dataAttribute)}`:`data-${LA}`;return[new Qh({key:new tg(`placeholder`),props:{decorations:({doc:t,selection:n})=>{let r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=n,a=[];if(!r)return null;let o=this.editor.isEmpty;return t.descendants((t,n)=>{let r=i>=n&&i<=n+t.nodeSize,s=!t.isLeaf&&uC(t);if(!t.type.isTextblock)return this.options.includeChildren;if((r||!this.options.showOnlyCurrent)&&s){let i=[this.options.emptyNodeClass];o&&i.push(this.options.emptyEditorClass);let s=ab.node(n,n+t.nodeSize,{class:i.join(` `),[e]:typeof this.options.placeholder==`function`?this.options.placeholder({editor:this.editor,node:t,pos:n,hasAnchor:r}):this.options.placeholder});a.push(s)}return this.options.includeChildren}),cb.create(t,a)}}})]}});aw.create({name:`selection`,addOptions(){return{className:`selection`}},addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new Qh({key:new tg(`selection`),props:{decorations(n){return n.selection.empty||e.isFocused||!e.isEditable||dC(n.selection)||e.view.dragging?null:cb.create(n.doc,[ab.inline(n.selection.from,n.selection.to,{class:t.className})])}}})]}});function RA({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}var Lte=aw.create({name:`trailingNode`,addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){let e=new tg(this.name),t=this.options.node||this.editor.schema.topNodeType.contentMatch.defaultType?.name||`paragraph`,n=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(t).includes(e.name));return[new Qh({key:e,appendTransaction:(n,r,i)=>{let{doc:a,tr:o,schema:s}=i,c=e.getState(i),l=a.content.size,u=s.nodes[t];if(!n.some(e=>e.getMeta(`skipTrailingNode`))&&c)return o.insert(l,u.create())},state:{init:(e,t)=>{let r=t.tr.doc.lastChild;return!RA({node:r,types:n})},apply:(e,t)=>{if(!e.docChanged||e.getMeta(`__uniqueIDTransaction`))return t;let r=e.doc.lastChild;return!RA({node:r,types:n})}}})]}}),Rte=aw.create({name:`undoRedo`,addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>FA(e,t),redo:()=>({state:e,dispatch:t})=>IA(e,t)}},addProseMirrorPlugins(){return[NA(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),zte=aw.create({name:`starterKit`,addExtensions(){let e=[];return this.options.bold!==!1&&e.push(nT.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(Uk.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(Qk.configure(this.options.bulletList)),this.options.code!==!1&&e.push(qk.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(Yw.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(Xee.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(Nte.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(Pte.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(uT.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(fT.configure(this.options.heading)),this.options.undoRedo!==!1&&e.push(Rte.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&e.push(Yk.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(cT.configure(this.options.italic)),this.options.listItem!==!1&&e.push($k.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(lA.configure(this.options?.listKeymap)),this.options.link!==!1&&e.push(AD.configure(this.options?.link)),this.options.orderedList!==!1&&e.push(mA.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(lte.configure(this.options.paragraph)),this.options.strike!==!1&&e.push(_A.configure(this.options.strike)),this.options.text!==!1&&e.push(pte.configure(this.options.text)),this.options.underline!==!1&&e.push(mte.configure(this.options?.underline)),this.options.trailingNode!==!1&&e.push(Lte.configure(this.options?.trailingNode)),e}}),Bte={abandonedHeadElementChild:{reason:`Unexpected metadata element after head`,description:"Unexpected element after head. Expected the element before `</head>`",url:!1},abruptClosingOfEmptyComment:{reason:`Unexpected abruptly closed empty comment`,description:"Unexpected `>` or `->`. Expected `-->` to close comments"},abruptDoctypePublicIdentifier:{reason:`Unexpected abruptly closed public identifier`,description:"Unexpected `>`. Expected a closing `\"` or `'` after the public identifier"},abruptDoctypeSystemIdentifier:{reason:`Unexpected abruptly closed system identifier`,description:"Unexpected `>`. Expected a closing `\"` or `'` after the identifier identifier"},absenceOfDigitsInNumericCharacterReference:{reason:`Unexpected non-digit at start of numeric character reference`,description:"Unexpected `%c`. Expected `[0-9]` for decimal references or `[0-9a-fA-F]` for hexadecimal references"},cdataInHtmlContent:{reason:`Unexpected CDATA section in HTML`,description:"Unexpected `<![CDATA[` in HTML. Remove it, use a comment, or encode special characters instead"},characterReferenceOutsideUnicodeRange:{reason:`Unexpected too big numeric character reference`,description:`Unexpectedly high character reference. Expected character references to be at most hexadecimal 10ffff (or decimal 1114111)`},closingOfElementWithOpenChildElements:{reason:`Unexpected closing tag with open child elements`,description:`Unexpectedly closing tag. Expected other tags to be closed first`,url:!1},controlCharacterInInputStream:{reason:`Unexpected control character`,description:"Unexpected control character `%x`. Expected a non-control code point, 0x00, or ASCII whitespace"},controlCharacterReference:{reason:`Unexpected control character reference`,description:`Unexpectedly control character in reference. Expected a non-control code point, 0x00, or ASCII whitespace`},disallowedContentInNoscriptInHead:{reason:"Disallowed content inside `<noscript>` in `<head>`",description:"Unexpected text character `%c`. Only use text in `<noscript>`s in `<body>`",url:!1},duplicateAttribute:{reason:`Unexpected duplicate attribute`,description:`Unexpectedly double attribute. Expected attributes to occur only once`},endTagWithAttributes:{reason:`Unexpected attribute on closing tag`,description:"Unexpected attribute. Expected `>` instead"},endTagWithTrailingSolidus:{reason:`Unexpected slash at end of closing tag`,description:"Unexpected `%c-1`. Expected `>` instead"},endTagWithoutMatchingOpenElement:{reason:`Unexpected unopened end tag`,description:`Unexpected end tag. Expected no end tag or another end tag`,url:!1},eofBeforeTagName:{reason:`Unexpected end of file`,description:`Unexpected end of file. Expected tag name instead`},eofInCdata:{reason:`Unexpected end of file in CDATA`,description:"Unexpected end of file. Expected `]]>` to close the CDATA"},eofInComment:{reason:`Unexpected end of file in comment`,description:"Unexpected end of file. Expected `-->` to close the comment"},eofInDoctype:{reason:`Unexpected end of file in doctype`,description:"Unexpected end of file. Expected a valid doctype (such as `<!doctype html>`)"},eofInElementThatCanContainOnlyText:{reason:`Unexpected end of file in element that can only contain text`,description:`Unexpected end of file. Expected text or a closing tag`,url:!1},eofInScriptHtmlCommentLikeText:{reason:`Unexpected end of file in comment inside script`,description:"Unexpected end of file. Expected `-->` to close the comment"},eofInTag:{reason:`Unexpected end of file in tag`,description:"Unexpected end of file. Expected `>` to close the tag"},incorrectlyClosedComment:{reason:`Incorrectly closed comment`,description:"Unexpected `%c-1`. Expected `-->` to close the comment"},incorrectlyOpenedComment:{reason:`Incorrectly opened comment`,description:"Unexpected `%c`. Expected `<!--` to open the comment"},invalidCharacterSequenceAfterDoctypeName:{reason:`Invalid sequence after doctype name`,description:"Unexpected sequence at `%c`. Expected `public` or `system`"},invalidFirstCharacterOfTagName:{reason:`Invalid first character in tag name`,description:"Unexpected `%c`. Expected an ASCII letter instead"},misplacedDoctype:{reason:`Misplaced doctype`,description:`Unexpected doctype. Expected doctype before head`,url:!1},misplacedStartTagForHeadElement:{reason:"Misplaced `<head>` start tag",description:"Unexpected start tag `<head>`. Expected `<head>` directly after doctype",url:!1},missingAttributeValue:{reason:`Missing attribute value`,description:"Unexpected `%c-1`. Expected an attribute value or no `%c-1` instead"},missingDoctype:{reason:`Missing doctype before other content`,description:"Expected a `<!doctype html>` before anything else",url:!1},missingDoctypeName:{reason:`Missing doctype name`,description:"Unexpected doctype end at `%c`. Expected `html` instead"},missingDoctypePublicIdentifier:{reason:`Missing public identifier in doctype`,description:"Unexpected `%c`. Expected identifier for `public` instead"},missingDoctypeSystemIdentifier:{reason:`Missing system identifier in doctype`,description:'Unexpected `%c`. Expected identifier for `system` instead (suggested: `"about:legacy-compat"`)'},missingEndTagName:{reason:`Missing name in end tag`,description:"Unexpected `%c`. Expected an ASCII letter instead"},missingQuoteBeforeDoctypePublicIdentifier:{reason:`Missing quote before public identifier in doctype`,description:"Unexpected `%c`. Expected `\"` or `'` instead"},missingQuoteBeforeDoctypeSystemIdentifier:{reason:`Missing quote before system identifier in doctype`,description:"Unexpected `%c`. Expected `\"` or `'` instead"},missingSemicolonAfterCharacterReference:{reason:`Missing semicolon after character reference`,description:"Unexpected `%c`. Expected `;` instead"},missingWhitespaceAfterDoctypePublicKeyword:{reason:`Missing whitespace after public identifier in doctype`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceAfterDoctypeSystemKeyword:{reason:`Missing whitespace after system identifier in doctype`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBeforeDoctypeName:{reason:`Missing whitespace before doctype name`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBetweenAttributes:{reason:`Missing whitespace between attributes`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers:{reason:`Missing whitespace between public and system identifiers in doctype`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},nestedComment:{reason:`Unexpected nested comment`,description:"Unexpected `<!--`. Expected `-->`"},nestedNoscriptInHead:{reason:"Unexpected nested `<noscript>` in `<head>`",description:"Unexpected `<noscript>`. Expected a closing tag or a meta element",url:!1},nonConformingDoctype:{reason:`Unexpected non-conforming doctype declaration`,description:'Expected `<!doctype html>` or `<!doctype html system "about:legacy-compat">`',url:!1},nonVoidHtmlElementStartTagWithTrailingSolidus:{reason:`Unexpected trailing slash on start tag of non-void element`,description:"Unexpected `/`. Expected `>` instead"},noncharacterCharacterReference:{reason:`Unexpected noncharacter code point referenced by character reference`,description:`Unexpected code point. Do not use noncharacters in HTML`},noncharacterInInputStream:{reason:`Unexpected noncharacter character`,description:"Unexpected code point `%x`. Do not use noncharacters in HTML"},nullCharacterReference:{reason:`Unexpected NULL character referenced by character reference`,description:`Unexpected code point. Do not use NULL characters in HTML`},openElementsLeftAfterEof:{reason:`Unexpected end of file`,description:`Unexpected end of file. Expected closing tag instead`,url:!1},surrogateCharacterReference:{reason:`Unexpected surrogate character referenced by character reference`,description:`Unexpected code point. Do not use lone surrogate characters in HTML`},surrogateInInputStream:{reason:`Unexpected surrogate character`,description:"Unexpected code point `%x`. Do not use lone surrogate characters in HTML"},unexpectedCharacterAfterDoctypeSystemIdentifier:{reason:`Invalid character after system identifier in doctype`,description:"Unexpected character at `%c`. Expected `>`"},unexpectedCharacterInAttributeName:{reason:`Unexpected character in attribute name`,description:"Unexpected `%c`. Expected whitespace, `/`, `>`, `=`, or probably an ASCII letter"},unexpectedCharacterInUnquotedAttributeValue:{reason:`Unexpected character in unquoted attribute value`,description:"Unexpected `%c`. Quote the attribute value to include it"},unexpectedEqualsSignBeforeAttributeName:{reason:`Unexpected equals sign before attribute name`,description:"Unexpected `%c`. Add an attribute name before it"},unexpectedNullCharacter:{reason:`Unexpected NULL character`,description:"Unexpected code point `%x`. Do not use NULL characters in HTML"},unexpectedQuestionMarkInsteadOfTagName:{reason:`Unexpected question mark instead of tag name`,description:"Unexpected `%c`. Expected an ASCII letter instead"},unexpectedSolidusInTag:{reason:`Unexpected slash in tag`,description:"Unexpected `%c-1`. Expected it followed by `>` or in a quoted attribute value"},unknownNamedCharacterReference:{reason:`Unexpected unknown named character reference`,description:`Unexpected character reference. Expected known named character references`}},Vte=`https://html.spec.whatwg.org/multipage/parsing.html#parse-error-`,Hte=/-[a-z]/g,Ute=/%c(?:([-+])(\d+))?/g,Wte=/%x/g,Gte={2:!0,1:!1,0:null},Kte={};function zA(e,t){let n=t||Kte,r=n.onerror,i=e instanceof ie?e:new ie(e),a=n.fragment?l:w,o=String(i);return A(a(o,{sourceCodeLocationInfo:!0,onParseError:n.onerror?s:null,scriptingEnabled:!1}),{file:i,space:n.space,verbose:n.verbose});function s(e){let t=e.code,a=qte(t),s=n[a]??!0,c=typeof s==`number`?s:+!!s;if(c){let n=Bte[a],o=new xe(l(n.reason),{place:{start:{line:e.startLine,column:e.startCol,offset:e.startOffset},end:{line:e.endLine,column:e.endCol,offset:e.endOffset}},ruleId:t,source:`hast-util-from-html`});i.path&&(o.file=i.path,o.name=i.path+`:`+o.name),o.fatal=Gte[c],o.note=l(n.description),o.url=n.url===!1?void 0:Vte+t,r(o)}function l(t){return t.replace(Ute,n).replace(Wte,r);function n(t,n,r){let i=(r?Number.parseInt(r,10):0)*(n===`-`?-1:1);return Yte(o.charAt(e.startOffset+i))}function r(){return Xte(o.charCodeAt(e.startOffset))}}}}function qte(e){return e.replace(Hte,Jte)}function Jte(e){return e.charAt(1).toUpperCase()}function Yte(e){return e==="`"?"` ` `":e}function Xte(e){return`0x`+e.toString(16).toUpperCase()}function Zte(e){let t=this,{emitParseErrors:n,...r}={...t.data(`settings`),...e};t.parser=i;function i(e,t){return zA(e,{...r,onerror:n?function(e){t.path&&(e.name=t.path+`:`+e.name,e.file=t.path),t.messages.push(e)}:void 0})}}var BA=(function(e,t,n,r,i){let a=VA(t);if(n!=null&&(typeof n!=`number`||n<0||n===1/0))throw Error("Expected positive finite `index`");if(r!=null&&(!r.type||!r.children))throw Error("Expected valid `parent`");if(n==null!=(r==null))throw Error("Expected both `index` and `parent`");return UA(e)?a.call(i,e,n,r):!1}),VA=(function(e){if(e==null)return ene;if(typeof e==`string`)return $te(e);if(typeof e==`object`)return Qte(e);if(typeof e==`function`)return HA(e);throw Error("Expected function, string, or array as `test`")});function Qte(e){let t=[],n=-1;for(;++n<e.length;)t[n]=VA(e[n]);return HA(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function $te(e){return HA(t);function t(t){return t.tagName===e}}function HA(e){return t;function t(t,n,r){return!!(UA(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function ene(e){return!!(e&&typeof e==`object`&&`type`in e&&e.type===`element`&&`tagName`in e&&typeof e.tagName==`string`)}function UA(e){return typeof e==`object`&&!!e&&`type`in e&&`tagName`in e}var WA=VA(function(e){return e.tagName===`audio`||e.tagName===`canvas`||e.tagName===`embed`||e.tagName===`iframe`||e.tagName===`img`||e.tagName===`math`||e.tagName===`object`||e.tagName===`picture`||e.tagName===`svg`||e.tagName===`video`}),tne=`address.article.aside.blockquote.body.br.caption.center.col.colgroup.dd.dialog.dir.div.dl.dt.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.legend.li.li.listing.main.menu.nav.ol.optgroup.option.p.plaintext.pre.section.summary.table.tbody.td.td.tfoot.th.th.thead.tr.ul.wbr.xmp`.split(`.`),nne=[`button`,`input`,`select`,`textarea`],rne=[`area`,`base`,`basefont`,`dialog`,`datalist`,`head`,`link`,`meta`,`noembed`,`noframes`,`param`,`rp`,`script`,`source`,`style`,`template`,`track`,`title`],ine={},GA=Se([`comment`,`doctype`]);function KA(e,t){qA(e,{collapse:ij((t||ine).newlines?nj:rj),whitespace:`normal`})}function qA(e,t){if(`children`in e){let n={...t};return(e.type===`root`||$A(e))&&(n.before=!0,n.after=!0),n.whitespace=aj(e,t),YA(e,n)}if(e.type===`text`){if(t.whitespace===`normal`)return JA(e,t);t.whitespace===`nowrap`&&(e.value=t.collapse(e.value))}return{ignore:GA(e),stripAtStart:!1,remove:!1}}function JA(e,t){let n=t.collapse(e.value),r={ignore:!1,stripAtStart:!1,remove:!1},i=0,a=n.length;return t.before&&tj(n.charAt(0))&&i++,i!==a&&tj(n.charAt(a-1))&&(t.after?a--:r.stripAtStart=!0),i===a?r.remove=!0:e.value=n.slice(i,a),r}function YA(e,t){let n=t.before,r=t.after,i=e.children,a=i.length,o=-1;for(;++o<a;){let e=qA(i[o],{...t,after:XA(i,o,r),before:n});e.remove?(i.splice(o,1),o--,a--):e.ignore||(n=e.stripAtStart),QA(i[o])&&(n=!1)}return{ignore:!1,stripAtStart:!!(n||r),remove:!1}}function XA(e,t,n){for(;++t<e.length;){let n=e[t],r=ZA(n);if(r===void 0&&`children`in n&&!ej(n)&&(r=XA(n.children,-1)),typeof r==`boolean`)return r}return n}function ZA(e){if(e.type===`element`){if(QA(e))return!1;if($A(e))return!0}else if(e.type===`text`){if(!re(e))return!1}else if(!GA(e))return!1}function QA(e){return WA(e)||BA(e,nne)}function $A(e){return BA(e,tne)}function ej(e){return!!(e.type===`element`&&e.properties.hidden)||GA(e)||BA(e,rne)}function tj(e){return e===` `||e===`
323
- `}function nj(e){let t=/\r?\n|\r/.exec(e);return t?t[0]:` `}function rj(){return` `}function ij(e){return t;function t(t){return String(t).replace(/[\t\n\v\f\r ]+/g,e)}}function aj(e,t){if(`tagName`in e&&e.properties)switch(e.tagName){case`listing`:case`plaintext`:case`script`:case`style`:case`xmp`:return`pre`;case`nobr`:return`nowrap`;case`pre`:return e.properties.wrap?`pre-wrap`:`pre`;case`td`:case`th`:return e.properties.noWrap?`nowrap`:t.whitespace;case`textarea`:return`pre-wrap`;default:}return t.whitespace}function oj(e){return function(t){KA(t,e)}}function sj(e,t){let n=t.properties||{},r=e.all(t),i={type:`link`,url:e.resolve(String(n.href||``)||null),title:n.title?String(n.title):null,children:r};return e.patch(t,i),i}function cj(e,t){e.baseFound||=(e.frozenBaseUrl=String(t.properties&&t.properties.href||``)||void 0,!0)}function lj(e,t){let n={type:`blockquote`,children:e.toFlow(e.all(t))};return e.patch(t,n),n}function uj(e,t){let n={type:`break`};return e.patch(t,n),n}var dj=(function(e,t,n){let r=Se(n);if(!e||!e.type||!e.children)throw Error(`Expected parent node`);if(typeof t==`number`){if(t<0||t===1/0)throw Error(`Expected positive finite number as index`)}else if(t=e.children.indexOf(t),t<0)throw Error(`Expected child node or index`);for(;++t<e.children.length;)if(r(e.children[t],t,e))return e.children[t]}),fj=/\n/g,pj=/[\t ]+/g,mj=VA(`br`),hj=VA(Oj),gj=VA(`p`),_j=VA(`tr`),vj=VA([`datalist`,`head`,`noembed`,`noframes`,`noscript`,`rp`,`script`,`style`,`template`,`title`,Dj,kj]),yj=VA(`address.article.aside.blockquote.body.caption.center.dd.dialog.dir.dl.dt.div.figure.figcaption.footer.form,.h1.h2.h3.h4.h5.h6.header.hgroup.hr.html.legend.li.listing.main.menu.nav.ol.p.plaintext.pre.section.ul.xmp`.split(`.`));function bj(e,t){let n=t||{},r=`children`in e?e.children:[],i=yj(e),a=Ej(e,{whitespace:n.whitespace||`normal`,breakBefore:!1,breakAfter:!1}),o=[];(e.type===`text`||e.type===`comment`)&&o.push(...Cj(e,{whitespace:a,breakBefore:!0,breakAfter:!0}));let s=-1;for(;++s<r.length;)o.push(...xj(r[s],e,{whitespace:a,breakBefore:s?void 0:i,breakAfter:s<r.length-1?mj(r[s+1]):i}));let c=[],l;for(s=-1;++s<o.length;){let e=o[s];typeof e==`number`?l!==void 0&&e>l&&(l=e):e&&(l!==void 0&&l>-1&&c.push(`
324
- `.repeat(l)||` `),l=-1,c.push(e))}return c.join(``)}function xj(e,t,n){return e.type===`element`?Sj(e,t,n):e.type===`text`?n.whitespace===`normal`?Cj(e,n):wj(e):[]}function Sj(e,t,n){let r=Ej(e,n),i=e.children||[],a=-1,o=[];if(vj(e))return o;let s,c;for(mj(e)||_j(e)&&dj(t,e,_j)?c=`
325
- `:gj(e)?(s=2,c=2):yj(e)&&(s=1,c=1);++a<i.length;)o=o.concat(xj(i[a],e,{whitespace:r,breakBefore:a?void 0:s,breakAfter:a<i.length-1?mj(i[a+1]):c}));return hj(e)&&dj(t,e,hj)&&o.push(` `),s&&o.unshift(s),c&&o.push(c),o}function Cj(e,t){let n=String(e.value),r=[],i=[],a=0;for(;a<=n.length;){fj.lastIndex=a;let e=fj.exec(n),i=e&&`index`in e?e.index:n.length;r.push(Tj(n.slice(a,i).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,``),a===0?t.breakBefore:!0,i===n.length?t.breakAfter:!0)),a=i+1}let o=-1,s;for(;++o<r.length;)r[o].charCodeAt(r[o].length-1)===8203||o<r.length-1&&r[o+1].charCodeAt(0)===8203?(i.push(r[o]),s=void 0):r[o]?(typeof s==`number`&&i.push(s),i.push(r[o]),s=0):(o===0||o===r.length-1)&&i.push(0);return i}function wj(e){return[String(e.value)]}function Tj(e,t,n){let r=[],i=0,a;for(;i<e.length;){pj.lastIndex=i;let n=pj.exec(e);a=n?n.index:e.length,!i&&!a&&n&&!t&&r.push(``),i!==a&&r.push(e.slice(i,a)),i=n?a+n[0].length:a}return i!==a&&!n&&r.push(``),r.join(` `)}function Ej(e,t){if(e.type===`element`){let n=e.properties||{};switch(e.tagName){case`listing`:case`plaintext`:case`xmp`:return`pre`;case`nobr`:return`nowrap`;case`pre`:return n.wrap?`pre-wrap`:`pre`;case`td`:case`th`:return n.noWrap?`nowrap`:t.whitespace;case`textarea`:return`pre-wrap`;default:}}return t.whitespace}function Dj(e){return!!(e.properties||{}).hidden}function Oj(e){return e.tagName===`td`||e.tagName===`th`}function kj(e){return e.tagName===`dialog`&&!(e.properties||{}).open}function Aj(e){let t=String(e),n=t.length;for(;n>0;){let e=t.codePointAt(n-1);if(e!==void 0&&(e===10||e===13))n--;else break}return t.slice(0,n)}var jj=`language-`;function Mj(e,t){let n=t.children,r=-1,i,a;if(t.tagName===`pre`)for(;++r<n.length;){let e=n[r];if(e.type===`element`&&e.tagName===`code`&&e.properties&&e.properties.className&&Array.isArray(e.properties.className)){i=e.properties.className;break}}if(i){for(r=-1;++r<i.length;)if(String(i[r]).slice(0,9)===jj){a=String(i[r]).slice(9);break}}let o={type:`code`,lang:a||null,meta:null,value:Aj(bj(t))};return e.patch(t,o),o}function Nj(e,t){let n={type:`html`,value:`<!--`+t.value+`-->`};return e.patch(t,n),n}function Pj(e,t){let n={type:`delete`,children:e.all(t)};return e.patch(t,n),n}function Fj(e){let t=-1;if(e.length>1){for(;++t<e.length;)if(e[t].spread)return!0}return!1}function Ij(e,t){let n=[],r=[],i=-1;for(;++i<t.children.length;){let e=t.children[i];e.type===`element`&&e.tagName===`div`?n.push(...e.children):n.push(e)}let a={definitions:[],titles:[]};for(i=-1;++i<n.length;){let e=n[i];if(e.type===`element`&&e.tagName===`dt`){let t=n[i-1];t&&t.type===`element`&&t.tagName===`dd`&&(r.push(a),a={definitions:[],titles:[]}),a.titles.push(e)}else a.definitions.push(e)}r.push(a),i=-1;let o=[];for(;++i<r.length;){let t=[...Lj(e,r[i].titles),...Lj(e,r[i].definitions)];t.length>0&&o.push({type:`listItem`,spread:t.length>1,checked:null,children:t})}if(o.length>0){let n={type:`list`,ordered:!1,start:null,spread:Fj(o),children:o};return e.patch(t,n),n}}function Lj(e,t){let n=e.all({type:`root`,children:t}),r=e.toSpecificContent(n,Rj);return r.length===0?[]:r.length===1?r[0].children:[{type:`list`,ordered:!1,start:null,spread:Fj(r),children:r}]}function Rj(){return{type:`listItem`,spread:!1,checked:null,children:[]}}function zj(e,t){let n={type:`emphasis`,children:e.all(t)};return e.patch(t,n),n}function Bj(e){let t=0,n=e.length;for(;t<n&&e[t].type===`break`;)t++;for(;n>t&&e[n-1].type===`break`;)n--;return t===0&&n===e.length?e:e.slice(t,n)}function Vj(e,t){let n={type:`heading`,depth:Number(t.tagName.charAt(1))||1,children:Bj(e.all(t))};return e.patch(t,n),n}function Hj(e,t){let n={type:`thematicBreak`};return e.patch(t,n),n}function Uj(e,t){let n=t.properties||{},r=String(n.src||``),i=String(n.title||``);if(r&&i){let n={type:`link`,title:null,url:e.resolve(r),children:[{type:`text`,value:i}]};return e.patch(t,n),n}}function Wj(e,t){let n=t.properties||{},r={type:`image`,url:e.resolve(String(n.src||``)||null),title:n.title?String(n.title):null,alt:n.alt?String(n.alt):``};return e.patch(t,r),r}function Gj(e,t){let n={type:`inlineCode`,value:bj(t)};return e.patch(t,n),n}function Kj(e,t){let n=[],r=[],i=t||e.properties||{},a=qj(e),o=Math.min(Number.parseInt(String(i.size),10),0)||(i.multiple?4:1),s=-1;for(;++s<a.length;){let e=a[s];e&&e.properties&&e.properties.selected&&n.push(e)}let c=n.length>0?n:a,l=Math.min(c.length,o);for(s=-1;++s<l;){let e=c[s],t=e.properties||{},n=bj(e),i=n||String(t.label||``),a=String(t.value||``)||n;r.push([a,i===a?void 0:i])}return r}function qj(e){let t=[],n=-1;for(;++n<e.children.length;){let r=e.children[n];`children`in r&&Array.isArray(r.children)&&t.push(...qj(r)),r.type===`element`&&r.tagName===`option`&&(!r.properties||!r.properties.disabled)&&t.push(r)}return t}var Jj=`[x]`,Yj=`[ ]`;function Xj(e,t){let n=t.properties||{},r=String(n.value||n.placeholder||``);if(n.disabled||n.type===`hidden`||n.type===`file`)return;if(n.type===`checkbox`||n.type===`radio`){let r={type:`text`,value:n.checked?e.options.checked||Jj:e.options.unchecked||Yj};return e.patch(t,r),r}if(n.type===`image`){let i=n.alt||r;if(i){let r={type:`image`,url:e.resolve(String(n.src||``)||null),title:String(n.title||``)||null,alt:String(i)};return e.patch(t,r),r}return}let i=[];if(r)i=[[r,void 0]];else if(n.type!==`button`&&n.type!==`file`&&n.type!==`password`&&n.type!==`reset`&&n.type!==`submit`&&n.list){let t=String(n.list),r=e.elementById.get(t);r&&r.tagName===`datalist`&&(i=Kj(r,n))}if(i.length===0)return;if(n.type===`password`&&(i[0]=[`•`.repeat(i[0][0].length),void 0]),n.type===`email`||n.type===`url`){let t=[],r=-1;for(;++r<i.length;){let a=e.resolve(i[r][0]),o={type:`link`,title:null,url:n.type===`email`?`mailto:`+a:a,children:[{type:`text`,value:i[r][1]||a}]};t.push(o),r!==i.length-1&&t.push({type:`text`,value:`, `})}return t}let a=[],o=-1;for(;++o<i.length;)a.push(i[o][1]?i[o][1]+` (`+i[o][0]+`)`:i[o][0]);let s={type:`text`,value:a.join(`, `)};return e.patch(t,s),s}var Zj={}.hasOwnProperty;function Qj(e,t){let n=e.type===`element`&&Zj.call(e.properties,t)&&e.properties[t];return n!=null&&n!==!1}var $j=new Set([`pingback`,`prefetch`,`stylesheet`]);function eM(e){if(e.type!==`element`||e.tagName!==`link`)return!1;if(e.properties.itemProp)return!0;let t=e.properties.rel,n=-1;if(!Array.isArray(t)||t.length===0)return!1;for(;++n<t.length;)if(!$j.has(String(t[n])))return!1;return!0}var tM=VA(`a.abbr.area.b.bdi.bdo.br.button.cite.code.data.datalist.del.dfn.em.i.input.ins.kbd.keygen.label.map.mark.meter.noscript.output.progress.q.ruby.s.samp.script.select.small.span.strong.sub.sup.template.textarea.time.u.var.wbr`.split(`.`)),nM=VA(`meta`);function rM(e){return!!(e.type===`text`||tM(e)||WA(e)||eM(e)||nM(e)&&Qj(e,`itemProp`))}function iM(e,t){let{rest:n,checkbox:r}=oM(t),i=r?!!r.properties.checked:null,a={type:`listItem`,spread:aM(n),checked:i,children:e.toFlow(e.all(n))};return e.patch(t,a),a}function aM(e){let t=-1,n=!1;for(;++t<e.children.length;){let r=e.children[t];if(r.type===`element`){if(rM(r))continue;if(r.tagName===`p`||n||aM(r))return!0;n=!0}}return!1}function oM(e){let t=e.children[0];if(t&&t.type===`element`&&t.tagName===`input`&&t.properties&&(t.properties.type===`checkbox`||t.properties.type===`radio`))return{checkbox:t,rest:{...e,children:e.children.slice(1)}};if(t&&t.type===`element`&&t.tagName===`p`){let{checkbox:n,rest:r}=oM(t);if(n)return{checkbox:n,rest:{...e,children:[r,...e.children.slice(1)]}}}return{checkbox:void 0,rest:e}}function sM(e,t){let n=t.tagName===`ol`,r=e.toSpecificContent(e.all(t),cM),i=null;n&&(i=t.properties&&t.properties.start?Number.parseInt(String(t.properties.start),10):1);let a={type:`list`,ordered:n,start:i,spread:Fj(r),children:r};return e.patch(t,a),a}function cM(){return{type:`listItem`,spread:!1,checked:null,children:[]}}function lM(e){let t=-1;for(;++t<e.length;){let n=e[t];if(!mM(n)||`children`in n&&lM(n.children))return!0}return!1}function uM(e){return fM(e,t,function(e){return e});function t(e){return e.every(function(e){return e.type===`text`?re(e.value):!1})?[]:[{type:`paragraph`,children:Bj(e)}]}}function dM(e){return fM(e.children,t,n);function t(t){let n=hM(e);return n.children=t,[n]}function n(t){if(`children`in t&&`children`in e){let n=hM(e),r=hM(t);return n.children=t.children,r.children.push(n),r}return{...t}}}function fM(e,t,n){let r=pM(e),i=[],a=[],o=-1;for(;++o<r.length;){let e=r[o];mM(e)?a.push(e):(a.length>0&&(i.push(...t(a)),a=[]),i.push(n(e)))}return a.length>0&&(i.push(...t(a)),a=[]),i}function pM(e){let t=[],n=-1;for(;++n<e.length;){let r=e[n];(r.type===`delete`||r.type===`link`)&&lM(r.children)?t.push(...dM(r)):t.push(r)}return t}function mM(e){let t=e.data&&e.data.hName;return t?rM({type:`element`,tagName:t,properties:{},children:[]}):Ne(e)}function hM(e){return ne({...e,children:[]})}function gM(e,t){let n=t.properties||{},r=t.tagName===`video`?String(n.poster||``):``,i=String(n.src||``),a=-1,o=!1,s=e.all(t);if(D({type:`root`,children:s},function(e){if(e.type===`link`)return o=!0,!1}),o||lM(s))return s;for(;!i&&++a<t.children.length;){let e=t.children[a];e.type===`element`&&e.tagName===`source`&&e.properties&&(i=String(e.properties.src||``))}if(r){let n={type:`image`,title:null,url:e.resolve(r),alt:d(s)};e.patch(t,n),s=[n]}let c=s,l={type:`link`,title:n.title?String(n.title):null,url:e.resolve(i),children:c};return e.patch(t,l),l}function _M(e,t){let n=Bj(e.all(t));if(n.length>0){let r={type:`paragraph`,children:n};return e.patch(t,r),r}}var vM=[`"`];function yM(e,t){let n=e.options.quotes||vM;e.qNesting++;let r=e.all(t);e.qNesting--;let i=n[e.qNesting%n.length],a=r[0],o=r[r.length-1],s=i.charAt(0),c=i.length>1?i.charAt(1):i;return a&&a.type===`text`?a.value=s+a.value:r.unshift({type:`text`,value:s}),o&&o.type===`text`?o.value+=c:r.push({type:`text`,value:c}),r}function bM(e,t){let n=e.all(t);(e.options.document||lM(n))&&(n=uM(n));let r={type:`root`,children:n};return e.patch(t,r),r}function xM(e,t){let n=Kj(t),r=-1,i=[];for(;++r<n.length;){let e=n[r];i.push(e[1]?e[1]+` (`+e[0]+`)`:e[0])}if(i.length>0){let n={type:`text`,value:i.join(`, `)};return e.patch(t,n),n}}function SM(e,t){let n={type:`strong`,children:e.all(t)};return e.patch(t,n),n}function CM(e,t){let n={type:`tableCell`,children:e.all(t)};if(e.patch(t,n),t.properties){let e=t.properties.rowSpan,r=t.properties.colSpan;if(e||r){let t=n.data||={};e&&(t.hastUtilToMdastTemporaryRowSpan=e),r&&(t.hastUtilToMdastTemporaryColSpan=r)}}return n}function wM(e,t){let n={type:`tableRow`,children:e.toSpecificContent(e.all(t),TM)};return e.patch(t,n),n}function TM(){return{type:`tableCell`,children:[]}}function EM(e,t){if(e.inTable){let n={type:`text`,value:bj(t)};return e.patch(t,n),n}e.inTable=!0;let{align:n,headless:r}=DM(t),i=e.toSpecificContent(e.all(t),kM);r&&i.unshift(kM());let a=-1;for(;++a<i.length;){let t=i[a];t.children=e.toSpecificContent(t.children,OM)}let o=1;for(a=-1;++a<i.length;){let e=i[a].children,t=-1;for(;++t<e.length;){let n=e[t];if(n.data){let e=n.data,r=Number.parseInt(String(e.hastUtilToMdastTemporaryColSpan),10)||1,o=Number.parseInt(String(e.hastUtilToMdastTemporaryRowSpan),10)||1;if(r>1||o>1){let e=a-1;for(;++e<a+o;){let n=t-1;for(;++n<t+r&&i[e];){let r=[];(e!==a||n!==t)&&r.push({type:`tableCell`,children:[]}),i[e].children.splice(n,0,...r)}}}`hastUtilToMdastTemporaryColSpan`in n.data&&delete n.data.hastUtilToMdastTemporaryColSpan,`hastUtilToMdastTemporaryRowSpan`in n.data&&delete n.data.hastUtilToMdastTemporaryRowSpan,Object.keys(n.data).length===0&&delete n.data}}e.length>o&&(o=e.length)}for(a=-1;++a<i.length;){let e=i[a].children,t=e.length-1;for(;++t<o;)e.push({type:`tableCell`,children:[]})}let s=n.length-1;for(;++s<o;)n.push(null);e.inTable=!1;let c={type:`table`,align:n,children:i};return e.patch(t,c),c}function DM(e){let t={align:[null],headless:!0},n=0,r=0;return D(e,function(i){if(i.type===`element`){if(i.tagName===`table`&&e!==i)return g;if((i.tagName===`th`||i.tagName===`td`)&&i.properties){if(!t.align[r]){let e=String(i.properties.align||``)||null;(e===`center`||e===`left`||e===`right`||e===null)&&(t.align[r]=e)}t.headless&&n<2&&i.tagName===`th`&&(t.headless=!1),r++}else i.tagName===`thead`?t.headless=!1:i.tagName===`tr`&&(n++,r=0)}}),t}function OM(){return{type:`tableCell`,children:[]}}function kM(){return{type:`tableRow`,children:[]}}function AM(e,t){let n={type:`text`,value:t.value};return e.patch(t,n),n}function jM(e,t){let n={type:`text`,value:bj(t)};return e.patch(t,n),n}function MM(e,t){let n={type:`text`,value:`​`};return e.patch(t,n),n}var NM={comment:Nj,doctype:LM,root:bM,text:AM},PM={applet:LM,area:LM,basefont:LM,bgsound:LM,caption:LM,col:LM,colgroup:LM,command:LM,content:LM,datalist:LM,dialog:LM,element:LM,embed:LM,frame:LM,frameset:LM,isindex:LM,keygen:LM,link:LM,math:LM,menu:LM,menuitem:LM,meta:LM,nextid:LM,noembed:LM,noframes:LM,optgroup:LM,option:LM,param:LM,script:LM,shadow:LM,source:LM,spacer:LM,style:LM,svg:LM,template:LM,title:LM,track:LM,abbr:FM,acronym:FM,bdi:FM,bdo:FM,big:FM,blink:FM,button:FM,canvas:FM,cite:FM,data:FM,details:FM,dfn:FM,font:FM,ins:FM,label:FM,map:FM,marquee:FM,meter:FM,nobr:FM,noscript:FM,object:FM,output:FM,progress:FM,rb:FM,rbc:FM,rp:FM,rt:FM,rtc:FM,ruby:FM,slot:FM,small:FM,span:FM,sup:FM,sub:FM,tbody:FM,tfoot:FM,thead:FM,time:FM,address:IM,article:IM,aside:IM,body:IM,center:IM,div:IM,fieldset:IM,figcaption:IM,figure:IM,form:IM,footer:IM,header:IM,hgroup:IM,html:IM,legend:IM,main:IM,multicol:IM,nav:IM,picture:IM,section:IM,a:sj,audio:gM,b:SM,base:cj,blockquote:lj,br:uj,code:Gj,dir:sM,dl:Ij,dt:iM,dd:iM,del:Pj,em:zj,h1:Vj,h2:Vj,h3:Vj,h4:Vj,h5:Vj,h6:Vj,hr:Hj,i:zj,iframe:Uj,img:Wj,image:Wj,input:Xj,kbd:Gj,li:iM,listing:Mj,mark:zj,ol:sM,p:_M,plaintext:Mj,pre:Mj,q:yM,s:Pj,samp:Gj,select:xM,strike:Pj,strong:SM,summary:_M,table:EM,td:CM,textarea:jM,th:CM,tr:wM,tt:Gj,u:zj,ul:sM,var:Gj,video:gM,wbr:MM,xmp:Mj};function FM(e,t){return e.all(t)}function IM(e,t){return e.toFlow(e.all(t))}function LM(){}var RM={}.hasOwnProperty;function zM(e){return{all:BM,baseFound:!1,elementById:new Map,frozenBaseUrl:void 0,handlers:{...PM,...e.handlers},inTable:!1,nodeHandlers:{...NM,...e.nodeHandlers},one:VM,options:e,patch:HM,qNesting:0,resolve:UM,toFlow:WM,toSpecificContent:GM}}function BM(e){let t=e.children||[],n=[],r=-1;for(;++r<t.length;){let i=t[r],a=this.one(i,e);Array.isArray(a)?n.push(...a):a&&n.push(a)}return n}function VM(e,t){if(e.type===`element`){if(e.properties&&e.properties.dataMdast===`ignore`)return;if(RM.call(this.handlers,e.tagName))return this.handlers[e.tagName](this,e,t)||void 0}else if(RM.call(this.nodeHandlers,e.type))return this.nodeHandlers[e.type](this,e,t)||void 0;if(`value`in e&&typeof e.value==`string`){let t={type:`text`,value:e.value};return this.patch(e,t),t}if(`children`in e)return this.all(e)}function HM(e,t){e.position&&(t.position=te(e))}function UM(e){let t=this.frozenBaseUrl;return e==null?``:t?String(new URL(e,t)):e}function WM(e){return uM(e)}function GM(e,t){let n=t(),r=[],i=[],a=-1;for(;++a<e.length;){let t=e[a];if(o(t))i.length>0&&(t.children.unshift(...i),i=[]),r.push(t);else{let e=t;i.push(e)}}if(i.length>0){let e=r[r.length-1];e||(e=t(),r.push(e)),e.children.push(...i),i=[]}return r;function o(e){return e.type===n.type}}var KM={};function qM(e,t){let n=ne(e),r=t||KM,i=oj({newlines:r.newlines===!0}),a=zM(r),o;i(n),D(n,function(e){if(e&&e.type===`element`&&e.properties){let t=String(e.properties.id||``)||void 0;t&&!a.elementById.has(t)&&a.elementById.set(t,e)}});let s=a.one(n,void 0);return o=s?Array.isArray(s)?{type:`root`,children:s}:s:{type:`root`,children:[]},D(o,function(e,t,n){if(e.type===`text`&&t!==void 0&&n){let r=n.children[t-1];if(r&&r.type===e.type)return r.value+=e.value,n.children.splice(t,1),r.position&&e.position&&(r.position.end=e.position.end),t-1;if(e.value=e.value.replace(/[\t ]*(\r?\n|\r)[\t ]*/,`$1`),n&&(n.type===`heading`||n.type===`paragraph`||n.type===`root`)&&(t||(e.value=e.value.replace(/^[\t ]+/,``)),t===n.children.length-1&&(e.value=e.value.replace(/[\t ]+$/,``))),!e.value)return n.children.splice(t,1),t}}),o}var JM={document:!0};function YM(e,t){return e&&`run`in e?async function(n,r){let i=qM(n,{...JM,...t});await e.run(i,r)}:function(t){return qM(t,{...JM,...e})}}var XM={}.hasOwnProperty;function ZM(e,t){let n=-1,r;if(t.extensions)for(;++n<t.extensions.length;)ZM(e,t.extensions[n]);for(r in t)if(XM.call(t,r))switch(r){case`extensions`:break;case`unsafe`:QM(e[r],t[r]);break;case`join`:QM(e[r],t[r]);break;case`handlers`:$M(e[r],t[r]);break;default:e.options[r]=t[r]}return e}function QM(e,t){t&&e.push(...t)}function $M(e,t){t&&Object.assign(e,t)}var eN=[tN];function tN(e,t,n,r){if(t.type===`code`&&S(t,r)&&(e.type===`list`||e.type===t.type&&S(e,r)))return!1;if(`spread`in n&&typeof n.spread==`boolean`)return e.type===`paragraph`&&(e.type===t.type||t.type===`definition`||t.type===`heading`&&ee(t,r))?void 0:+!!n.spread}var nN=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`],rN=[{character:` `,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,before:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`]},{character:`\r`,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`,`codeFencedMetaGraveAccent`,`codeFencedMetaTilde`,`destinationLiteral`,`headingAtx`]},{character:`
326
- `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`,`codeFencedMetaGraveAccent`,`codeFencedMetaTilde`,`destinationLiteral`,`headingAtx`]},{character:` `,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,before:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`]},{character:`!`,after:`\\[`,inConstruct:`phrasing`,notInConstruct:nN},{character:`"`,inConstruct:`titleQuote`},{atBreak:!0,character:`#`},{character:`#`,inConstruct:`headingAtx`,after:`(?:[\r
327
- ]|$)`},{character:`&`,after:`[#A-Za-z]`,inConstruct:`phrasing`},{character:`'`,inConstruct:`titleApostrophe`},{character:`(`,inConstruct:`destinationRaw`},{before:`\\]`,character:`(`,inConstruct:`phrasing`,notInConstruct:nN},{atBreak:!0,before:`\\d+`,character:`)`},{character:`)`,inConstruct:`destinationRaw`},{atBreak:!0,character:`*`,after:`(?:[ \r
328
- *])`},{character:`*`,inConstruct:`phrasing`,notInConstruct:nN},{atBreak:!0,character:`+`,after:`(?:[ \r
320
+ `),[i,a]=ite(r);if(i.length===0)return;let o=uA(i,0,n);if(o.length!==0)return{type:`list`,ordered:!0,start:i[0]?.number||1,items:o,raw:r.slice(0,a).join(`
321
+ `)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(ote,this.editor.getAttributes(dA)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=ww({find:fA,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=ww({find:fA,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(dA)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[e]}}),ste=/^\s*(\[([( |x])?\])\s$/,cte=Uw.create({name:`taskItem`,addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:`taskList`,a11y:void 0}},content(){return this.options.nested?`paragraph block*`:`paragraph+`},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{let t=e.getAttribute(`data-checked`);return t===``||t===`true`},renderHTML:e=>({"data-checked":e.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return[`li`,PS(this.options.HTMLAttributes,t,{"data-type":this.name}),[`label`,[`input`,{type:`checkbox`,checked:e.attrs.checked?`checked`:null}],[`span`]],[`div`,0]]},parseMarkdown:(e,t)=>{let n=[];if(e.tokens&&e.tokens.length>0?n.push(t.createNode(`paragraph`,{},t.parseInline(e.tokens))):e.text?n.push(t.createNode(`paragraph`,{},[t.createNode(`text`,{text:e.text})])):n.push(t.createNode(`paragraph`,{},[])),e.nestedTokens&&e.nestedTokens.length>0){let r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode(`taskItem`,{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>Rw(e,t,`- [${e.attrs?.checked?`x`:` `}] `),addKeyboardShortcuts(){let e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{let i=document.createElement(`li`),a=document.createElement(`label`),o=document.createElement(`span`),s=document.createElement(`input`),c=document.createElement(`div`),l=e=>{var t;s.ariaLabel=((t=this.options.a11y)?.checkboxLabel)?.call(t,e,s.checked)||`Task item checkbox for ${e.textContent||`empty task item`}`};l(e),a.contentEditable=`false`,s.type=`checkbox`,s.addEventListener(`mousedown`,e=>e.preventDefault()),s.addEventListener(`change`,t=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){s.checked=!s.checked;return}let{checked:i}=t.target;r.isEditable&&typeof n==`function`&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:e})=>{let t=n();if(typeof t!=`number`)return!1;let r=e.doc.nodeAt(t);return e.setNodeMarkup(t,void 0,{...r?.attrs,checked:i}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,i)||(s.checked=!s.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([e,t])=>{i.setAttribute(e,t)}),i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,a.append(s,o),i.append(a,c),Object.entries(t).forEach(([e,t])=>{i.setAttribute(e,t)});let u=new Set(Object.keys(t));return{dom:i,contentDOM:c,update:e=>{if(e.type!==this.type)return!1;i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,l(e);let t=r.extensionManager.attributes,n=FS(e,t),a=new Set(Object.keys(n)),o=this.options.HTMLAttributes;return u.forEach(e=>{a.has(e)||(e in o?i.setAttribute(e,o[e]):i.removeAttribute(e))}),Object.entries(n).forEach(([e,t])=>{t==null?e in o?i.setAttribute(e,o[e]):i.removeAttribute(e):i.setAttribute(e,t)}),u=a,!0}}}},addInputRules(){return[ww({find:ste,type:this.type,getAttributes:e=>({checked:e[e.length-1]===`x`})})]}}),lte=Uw.create({name:`taskList`,addOptions(){return{itemTypeName:`taskItem`,HTMLAttributes:{}}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return[`ul`,PS(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,t)=>t.createNode(`taskList`,{},t.parseChildren(e.items||[])),renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
322
+ `):``,markdownTokenizer:{name:`taskList`,level:`block`,start(e){let t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/)?.index;return t===void 0?-1:t},tokenize(e,t,n){let r=e=>{let t=Lw(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);return t?[{type:`taskList`,raw:t.raw,items:t.items}]:n.blockTokens(e)},i=Lw(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(i)return{type:`taskList`,raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});aw.create({name:`listKit`,addExtensions(){let e=[];return this.options.bulletList!==!1&&e.push(Zk.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(Qk.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(cA.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(pA.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(cte.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(lte.configure(this.options.taskList)),e}});var mA=`&nbsp;`,hA=`\xA0`,ute=Uw.create({name:`paragraph`,priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML({HTMLAttributes:e}){return[`p`,PS(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{let n=e.tokens||[];if(n.length===1&&n[0].type===`image`)return t.parseChildren([n[0]]);let r=t.parseInline(n);return n.length===1&&n[0].type===`text`&&(n[0].raw===mA||n[0].text===mA||n[0].raw===hA||n[0].text===hA)&&r.length===1&&r[0].type===`text`&&(r[0].text===mA||r[0].text===hA)?t.createNode(`paragraph`,void 0,[]):t.createNode(`paragraph`,void 0,r)},renderMarkdown:(e,t,n)=>{if(!e)return``;let r=Array.isArray(e.content)?e.content:[];if(r.length===0){let e=Array.isArray(n?.previousNode?.content)?n.previousNode.content:[];return n?.previousNode?.type===`paragraph`&&e.length===0?mA:``}return t.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),dte=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,fte=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,gA=XC.create({name:`strike`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`s`},{tag:`del`},{tag:`strike`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`line-through`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`s`,PS(this.options.HTMLAttributes,e),0]},markdownTokenName:`del`,parseMarkdown:(e,t)=>t.applyMark(`strike`,t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[xw({find:dte,type:this.type})]},addPasteRules(){return[Gw({find:fte,type:this.type})]}}),pte=gA,mte=Uw.create({name:`text`,group:`inline`,parseMarkdown:e=>({type:`text`,text:e.text||``}),renderMarkdown:e=>e.text||``}),hte=XC.create({name:`underline`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`u`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`underline`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`u`,PS(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||`underline`,t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`++${t.renderChildren(e)}++`},markdownTokenizer:{name:`underline`,level:`inline`,start(e){return e.indexOf(`++`)},tokenize(e,t,n){let r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;let i=r[2].trim();return{type:`underline`,raw:r[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function gte(e={}){return new Qh({view(t){return new _te(t,e)}})}var _te=class{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.lastDragEvent=null,this.width=t.width??1,this.color=t.color===!1?void 0:t.color||`black`,this.class=t.class,this.handlers=[`dragover`,`dragend`,`drop`,`dragleave`].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){if(this.cursorPos!=null&&t.doc!=e.state.doc)if(this.lastDragEvent){let e=this.computeTarget(this.lastDragEvent);e==this.cursorPos?this.updateOverlay():this.setCursor(e)}else this.updateOverlay()}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,r=this.editorView.dom,i=r.getBoundingClientRect(),a=i.width/r.offsetWidth,o=i.height/r.offsetHeight;if(t){let t=e.nodeBefore,r=e.nodeAfter;if(t||r){let e=this.editorView.nodeDOM(this.cursorPos-(t?t.nodeSize:0));if(e){let i=e.getBoundingClientRect(),a=t?i.bottom:i.top;t&&r&&(a=(a+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*o;n={left:i.left,right:i.right,top:a-s,bottom:a+s}}}}if(!n){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*a;n={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let s=this.editorView.dom.offsetParent;this.element||(this.element=s.appendChild(document.createElement(`div`)),this.class&&(this.element.className=this.class),this.element.style.cssText=`position: absolute; z-index: 50; pointer-events: none;`,this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle(`prosemirror-dropcursor-block`,t),this.element.classList.toggle(`prosemirror-dropcursor-inline`,!t);let c,l;if(!s||s==document.body&&getComputedStyle(s).position==`static`)c=-pageXOffset,l=-pageYOffset;else{let e=s.getBoundingClientRect(),t=e.width/s.offsetWidth,n=e.height/s.offsetHeight;c=e.left-s.scrollLeft*t,l=e.top-s.scrollTop*n}this.element.style.left=(n.left-c)/a+`px`,this.element.style.top=(n.top-l)/o+`px`,this.element.style.width=(n.right-n.left)/a+`px`,this.element.style.height=(n.bottom-n.top)/o+`px`}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}computeTarget(e){let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i=typeof r==`function`?r(this.editorView,t,e):r;if(!t||i)return null;let a=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let e=fh(this.editorView.state.doc,a,this.editorView.dragging.slice);e!=null&&(a=e)}return a}dragover(e){if(!this.editorView.editable)return;this.lastDragEvent=e;let t=this.computeTarget(e);t!=null&&(this.setCursor(t),this.scheduleRemoval(5e3))}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}},_A=class e extends G{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):G.near(r)}content(){return W.empty}eq(t){return t instanceof e&&t.head==this.head}toJSON(){return{type:`gapcursor`,pos:this.head}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for GapCursor.fromJSON`);return new e(t.resolve(n.pos))}getBookmark(){return new vte(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!yte(e)||!bte(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,n,r=!1){search:for(;;){if(!r&&e.valid(t))return t;let i=t.pos,a=null;for(let r=t.depth;;r--){let o=t.node(r);if(n>0?t.indexAfter(r)<o.childCount:t.index(r)>0){a=o.child(n>0?t.indexAfter(r):t.index(r)-1);break}else if(r==0)return null;i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}for(;;){let o=n>0?a.firstChild:a.lastChild;if(!o){if(a.isAtom&&!a.isText&&!q.isSelectable(a)){t=t.doc.resolve(i+a.nodeSize*n),r=!1;continue search}break}a=o,i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}return null}}};_A.prototype.visible=!1,_A.findFrom=_A.findGapCursorFrom,G.jsonID(`gapcursor`,_A);var vte=class e{constructor(e){this.pos=e}map(t){return new e(t.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return _A.valid(t)?new _A(t):G.near(t)}};function vA(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function yte(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n-1);;e=e.lastChild){if(e.childCount==0&&!e.inlineContent||vA(e.type))return!0;if(e.inlineContent)return!1}}return!0}function bte(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n);;e=e.firstChild){if(e.childCount==0&&!e.inlineContent||vA(e.type))return!0;if(e.inlineContent)return!1}}return!0}function xte(){return new Qh({props:{decorations:Tte,createSelectionBetween(e,t,n){return t.pos==n.pos&&_A.valid(n)?new _A(n):null},handleClick:Cte,handleKeyDown:Ste,handleDOMEvents:{beforeinput:wte}}})}var Ste=nx({ArrowLeft:yA(`horiz`,-1),ArrowRight:yA(`horiz`,1),ArrowUp:yA(`vert`,-1),ArrowDown:yA(`vert`,1)});function yA(e,t){let n=e==`vert`?t>0?`down`:`up`:t>0?`right`:`left`;return function(e,r,i){let a=e.selection,o=t>0?a.$to:a.$from,s=a.empty;if(a instanceof K){if(!i.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}let c=_A.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new _A(c))),!0):!1}}function Cte(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!_A.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&q.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new _A(r))),!0)}function wte(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof _A))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=U.empty;for(let e=r.length-1;e>=0;e--)i=U.from(r[e].createAndFill(null,i));let a=e.state.tr.replace(n.pos,n.pos,new W(i,0,0));return a.setSelection(K.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function Tte(e){if(!(e.selection instanceof _A))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,cb.create(e.doc,[ab.widget(e.selection.head,t,{key:`gapcursor`})])}var bA=200,xA=function(){};xA.prototype.append=function(e){return e.length?(e=xA.from(e),!this.length&&e||e.length<bA&&this.leafAppend(e)||this.length<bA&&e.leafPrepend(this)||this.appendInner(e)):this},xA.prototype.prepend=function(e){return e.length?xA.from(e).append(this):this},xA.prototype.appendInner=function(e){return new Ete(this,e)},xA.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?xA.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},xA.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},xA.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},xA.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},xA.from=function(e){return e instanceof xA?e:e&&e.length?new SA(e):xA.empty};var SA=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return e==0&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(e(this.values[i],r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(e(this.values[i],r+i)===!1)return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=bA)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=bA)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(xA);xA.empty=new SA([]);var Ete=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&this.left.forEachInner(e,t,Math.min(n,i),r)===!1||n>i&&this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)===!1||n<i&&this.left.forEachInvertedInner(e,Math.min(t,i),n,r)===!1)return!1},t.prototype.sliceInner=function(e,t){if(e==0&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(xA),Dte=500,CA=class e{constructor(e,t){this.items=e,this.eventCount=t}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,a;n&&(i=this.remapping(r,this.items.length),a=i.maps.length);let o=t.tr,s,c,l=[],u=[];return this.items.forEach((t,n)=>{if(!t.step){i||(i=this.remapping(r,n+1),a=i.maps.length),a--,u.push(t);return}if(i){u.push(new wA(t.map));let e=t.step.map(i.slice(a)),n;e&&o.maybeStep(e).doc&&(n=o.mapping.maps[o.mapping.maps.length-1],l.push(new wA(n,void 0,void 0,l.length+u.length))),a--,n&&i.appendMap(n,a)}else o.maybeStep(t.step);if(t.selection)return s=i?t.selection.map(i.slice(a)):t.selection,c=new e(this.items.slice(0,r).append(u.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:o,selection:s}}addTransform(t,n,r,i){let a=[],o=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let e=0;e<t.steps.length;e++){let r=t.steps[e].invert(t.docs[e]),l=new wA(t.mapping.maps[e],r,n),u;(u=c&&c.merge(l))&&(l=u,e?a.pop():s=s.slice(0,s.length-1)),a.push(l),n&&=(o++,void 0),i||(c=l)}let l=o-r.depth;return l>kte&&(s=Ote(s,l),o-=l),new e(s.append(a),o)}remapping(e,t){let n=new Am;return this.items.forEach((t,r)=>{let i=t.mirrorOffset!=null&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(t){return this.eventCount==0?this:new e(this.items.append(t.map(e=>new wA(e))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),a=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},i);let c=n;this.items.forEach(e=>{let n=a.getMirror(--c);if(n==null)return;o=Math.min(o,n);let i=a.maps[n];if(e.step){let o=t.steps[n].invert(t.docs[n]),l=e.selection&&e.selection.map(a.slice(c+1,n));l&&s++,r.push(new wA(i,o,l))}else r.push(new wA(i))},i);let l=[];for(let e=n;e<o;e++)l.push(new wA(a.maps[e]));let u=new e(this.items.slice(0,i).append(l).append(r),s);return u.emptyItemCount()>Dte&&(u=u.compress(this.items.length-r.length)),u}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],a=0;return this.items.forEach((e,o)=>{if(o>=t)i.push(e),e.selection&&a++;else if(e.step){let t=e.step.map(n.slice(r)),o=t&&t.getMap();if(r--,o&&n.appendMap(o,r),t){let s=e.selection&&e.selection.map(n.slice(r));s&&a++;let c=new wA(o.invert(),t,s),l,u=i.length-1;(l=i.length&&i[u].merge(c))?i[u]=l:i.push(c)}}else e.map&&r--},this.items.length,0),new e(xA.from(i.reverse()),a)}};CA.empty=new CA(xA.empty,0);function Ote(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}var wA=class e{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}},TA=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}},kte=20;function Ate(e,t,n,r){let i=n.getMeta(jA),a;if(i)return i.historyState;n.getMeta(Nte)&&(e=new TA(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(jA))return o.getMeta(jA).redo?new TA(e.done.addTransform(n,void 0,r,AA(t)),e.undone,EA(n.mapping.maps),e.prevTime,e.prevComposition):new TA(e.done,e.undone.addTransform(n,void 0,r,AA(t)),null,e.prevTime,e.prevComposition);if(n.getMeta(`addToHistory`)!==!1&&!(o&&o.getMeta(`addToHistory`)===!1)){let i=n.getMeta(`composition`),a=e.prevTime==0||!o&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!jte(n,e.prevRanges)),s=o?DA(e.prevRanges,n.mapping):EA(n.mapping.maps);return new TA(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,AA(t)),CA.empty,s,n.time,i??e.prevComposition)}else if(a=n.getMeta(`rebased`))return new TA(e.done.rebased(n,a),e.undone.rebased(n,a),DA(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);else return new TA(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),DA(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function jte(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}function EA(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function DA(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),a=t.map(e[r+1],-1);i<=a&&n.push(i,a)}return n}function Mte(e,t,n){let r=AA(t),i=jA.get(t).spec.config,a=(n?e.undone:e.done).popEvent(t,r);if(!a)return null;let o=a.selection.resolve(a.transform.doc),s=(n?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),i,r),c=new TA(n?s:a.remaining,n?a.remaining:s,null,0,-1);return a.transform.setSelection(o).setMeta(jA,{redo:n,historyState:c})}var OA=!1,kA=null;function AA(e){let t=e.plugins;if(kA!=t){OA=!1,kA=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){OA=!0;break}}return OA}var jA=new tg(`history`),Nte=new tg(`closeHistory`);function MA(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new Qh({key:jA,state:{init(){return new TA(CA.empty,CA.empty,null,0,-1)},apply(t,n,r){return Ate(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r=n==`historyUndo`?PA:n==`historyRedo`?FA:null;return!r||!e.editable?!1:(t.preventDefault(),r(e.state,e.dispatch))}}}})}function NA(e,t){return(n,r)=>{let i=jA.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=Mte(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}var PA=NA(!1,!0),FA=NA(!0,!0);aw.create({name:`characterCount`,addOptions(){return{limit:null,mode:`textSize`,textCounter:e=>e.length,wordCounter:e=>e.split(` `).filter(e=>e!==``).length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{let t=e?.node||this.editor.state.doc;if((e?.mode||this.options.mode)===`textSize`){let e=t.textBetween(0,t.content.size,void 0,` `);return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{let t=e?.node||this.editor.state.doc,n=t.textBetween(0,t.content.size,` `,` `);return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new Qh({key:new tg(`characterCount`),appendTransaction:(t,n,r)=>{if(e)return;let i=this.options.limit;if(i==null||i===0){e=!0;return}let a=this.storage.characters({node:r.doc});if(a>i){let t=a-i;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let n=r.tr.deleteRange(0,t);return e=!0,n}e=!0},filterTransaction:(e,t)=>{let n=this.options.limit;if(!e.docChanged||n===0||n==null)return!0;let r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n||r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r||!e.getMeta(`paste`))return!1;let a=e.selection.$head.pos,o=a-(i-n),s=a;return e.deleteRange(o,s),!(this.storage.characters({node:e.doc})>n)}})]}});var Pte=aw.create({name:`dropCursor`,addOptions(){return{color:`currentColor`,width:1,class:void 0}},addProseMirrorPlugins(){return[gte(this.options)]}});aw.create({name:`focus`,addOptions(){return{className:`has-focus`,mode:`all`}},addProseMirrorPlugins(){return[new Qh({key:new tg(`focus`),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,a=[];if(!n||!r)return cb.create(e,[]);let o=0;this.options.mode===`deepest`&&e.descendants((e,t)=>{if(!e.isText){if(!(i>=t&&i<=t+e.nodeSize-1))return!1;o+=1}});let s=0;return e.descendants((e,t)=>{if(e.isText||!(i>=t&&i<=t+e.nodeSize-1))return!1;if(s+=1,this.options.mode===`deepest`&&o-s>0||this.options.mode===`shallowest`&&s>1)return this.options.mode===`deepest`;a.push(ab.node(t,t+e.nodeSize,{class:this.options.className}))}),cb.create(e,a)}}})]}});var Fte=aw.create({name:`gapCursor`,addProseMirrorPlugins(){return[xte()]},extendNodeSchema(e){return{allowGapCursor:OS(J(e,`allowGapCursor`,{name:e.name,options:e.options,storage:e.storage}))??null}}}),IA=`placeholder`;function Ite(e){return e.replace(/\s+/g,`-`).replace(/[^a-zA-Z0-9-]/g,``).replace(/^[0-9-]+/,``).replace(/^-+/,``).toLowerCase()}var Lte=aw.create({name:`placeholder`,addOptions(){return{emptyEditorClass:`is-editor-empty`,emptyNodeClass:`is-empty`,dataAttribute:IA,placeholder:`Write something …`,showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){let e=this.options.dataAttribute?`data-${Ite(this.options.dataAttribute)}`:`data-${IA}`;return[new Qh({key:new tg(`placeholder`),props:{decorations:({doc:t,selection:n})=>{let r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=n,a=[];if(!r)return null;let o=this.editor.isEmpty;return t.descendants((t,n)=>{let r=i>=n&&i<=n+t.nodeSize,s=!t.isLeaf&&uC(t);if(!t.type.isTextblock)return this.options.includeChildren;if((r||!this.options.showOnlyCurrent)&&s){let i=[this.options.emptyNodeClass];o&&i.push(this.options.emptyEditorClass);let s=ab.node(n,n+t.nodeSize,{class:i.join(` `),[e]:typeof this.options.placeholder==`function`?this.options.placeholder({editor:this.editor,node:t,pos:n,hasAnchor:r}):this.options.placeholder});a.push(s)}return this.options.includeChildren}),cb.create(t,a)}}})]}});aw.create({name:`selection`,addOptions(){return{className:`selection`}},addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new Qh({key:new tg(`selection`),props:{decorations(n){return n.selection.empty||e.isFocused||!e.isEditable||dC(n.selection)||e.view.dragging?null:cb.create(n.doc,[ab.inline(n.selection.from,n.selection.to,{class:t.className})])}}})]}});function LA({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}var Rte=aw.create({name:`trailingNode`,addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){let e=new tg(this.name),t=this.options.node||this.editor.schema.topNodeType.contentMatch.defaultType?.name||`paragraph`,n=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(t).includes(e.name));return[new Qh({key:e,appendTransaction:(n,r,i)=>{let{doc:a,tr:o,schema:s}=i,c=e.getState(i),l=a.content.size,u=s.nodes[t];if(!n.some(e=>e.getMeta(`skipTrailingNode`))&&c)return o.insert(l,u.create())},state:{init:(e,t)=>{let r=t.tr.doc.lastChild;return!LA({node:r,types:n})},apply:(e,t)=>{if(!e.docChanged||e.getMeta(`__uniqueIDTransaction`))return t;let r=e.doc.lastChild;return!LA({node:r,types:n})}}})]}}),zte=aw.create({name:`undoRedo`,addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>PA(e,t),redo:()=>({state:e,dispatch:t})=>FA(e,t)}},addProseMirrorPlugins(){return[MA(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),Bte=aw.create({name:`starterKit`,addExtensions(){let e=[];return this.options.bold!==!1&&e.push(nT.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(Uk.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(Zk.configure(this.options.bulletList)),this.options.code!==!1&&e.push(qk.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(Yw.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(Zee.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(Pte.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(Fte.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(uT.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(fT.configure(this.options.heading)),this.options.undoRedo!==!1&&e.push(zte.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&e.push(Jk.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(cT.configure(this.options.italic)),this.options.listItem!==!1&&e.push(Qk.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(cA.configure(this.options?.listKeymap)),this.options.link!==!1&&e.push(AD.configure(this.options?.link)),this.options.orderedList!==!1&&e.push(pA.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(ute.configure(this.options.paragraph)),this.options.strike!==!1&&e.push(gA.configure(this.options.strike)),this.options.text!==!1&&e.push(mte.configure(this.options.text)),this.options.underline!==!1&&e.push(hte.configure(this.options?.underline)),this.options.trailingNode!==!1&&e.push(Rte.configure(this.options?.trailingNode)),e}}),Vte={abandonedHeadElementChild:{reason:`Unexpected metadata element after head`,description:"Unexpected element after head. Expected the element before `</head>`",url:!1},abruptClosingOfEmptyComment:{reason:`Unexpected abruptly closed empty comment`,description:"Unexpected `>` or `->`. Expected `-->` to close comments"},abruptDoctypePublicIdentifier:{reason:`Unexpected abruptly closed public identifier`,description:"Unexpected `>`. Expected a closing `\"` or `'` after the public identifier"},abruptDoctypeSystemIdentifier:{reason:`Unexpected abruptly closed system identifier`,description:"Unexpected `>`. Expected a closing `\"` or `'` after the identifier identifier"},absenceOfDigitsInNumericCharacterReference:{reason:`Unexpected non-digit at start of numeric character reference`,description:"Unexpected `%c`. Expected `[0-9]` for decimal references or `[0-9a-fA-F]` for hexadecimal references"},cdataInHtmlContent:{reason:`Unexpected CDATA section in HTML`,description:"Unexpected `<![CDATA[` in HTML. Remove it, use a comment, or encode special characters instead"},characterReferenceOutsideUnicodeRange:{reason:`Unexpected too big numeric character reference`,description:`Unexpectedly high character reference. Expected character references to be at most hexadecimal 10ffff (or decimal 1114111)`},closingOfElementWithOpenChildElements:{reason:`Unexpected closing tag with open child elements`,description:`Unexpectedly closing tag. Expected other tags to be closed first`,url:!1},controlCharacterInInputStream:{reason:`Unexpected control character`,description:"Unexpected control character `%x`. Expected a non-control code point, 0x00, or ASCII whitespace"},controlCharacterReference:{reason:`Unexpected control character reference`,description:`Unexpectedly control character in reference. Expected a non-control code point, 0x00, or ASCII whitespace`},disallowedContentInNoscriptInHead:{reason:"Disallowed content inside `<noscript>` in `<head>`",description:"Unexpected text character `%c`. Only use text in `<noscript>`s in `<body>`",url:!1},duplicateAttribute:{reason:`Unexpected duplicate attribute`,description:`Unexpectedly double attribute. Expected attributes to occur only once`},endTagWithAttributes:{reason:`Unexpected attribute on closing tag`,description:"Unexpected attribute. Expected `>` instead"},endTagWithTrailingSolidus:{reason:`Unexpected slash at end of closing tag`,description:"Unexpected `%c-1`. Expected `>` instead"},endTagWithoutMatchingOpenElement:{reason:`Unexpected unopened end tag`,description:`Unexpected end tag. Expected no end tag or another end tag`,url:!1},eofBeforeTagName:{reason:`Unexpected end of file`,description:`Unexpected end of file. Expected tag name instead`},eofInCdata:{reason:`Unexpected end of file in CDATA`,description:"Unexpected end of file. Expected `]]>` to close the CDATA"},eofInComment:{reason:`Unexpected end of file in comment`,description:"Unexpected end of file. Expected `-->` to close the comment"},eofInDoctype:{reason:`Unexpected end of file in doctype`,description:"Unexpected end of file. Expected a valid doctype (such as `<!doctype html>`)"},eofInElementThatCanContainOnlyText:{reason:`Unexpected end of file in element that can only contain text`,description:`Unexpected end of file. Expected text or a closing tag`,url:!1},eofInScriptHtmlCommentLikeText:{reason:`Unexpected end of file in comment inside script`,description:"Unexpected end of file. Expected `-->` to close the comment"},eofInTag:{reason:`Unexpected end of file in tag`,description:"Unexpected end of file. Expected `>` to close the tag"},incorrectlyClosedComment:{reason:`Incorrectly closed comment`,description:"Unexpected `%c-1`. Expected `-->` to close the comment"},incorrectlyOpenedComment:{reason:`Incorrectly opened comment`,description:"Unexpected `%c`. Expected `<!--` to open the comment"},invalidCharacterSequenceAfterDoctypeName:{reason:`Invalid sequence after doctype name`,description:"Unexpected sequence at `%c`. Expected `public` or `system`"},invalidFirstCharacterOfTagName:{reason:`Invalid first character in tag name`,description:"Unexpected `%c`. Expected an ASCII letter instead"},misplacedDoctype:{reason:`Misplaced doctype`,description:`Unexpected doctype. Expected doctype before head`,url:!1},misplacedStartTagForHeadElement:{reason:"Misplaced `<head>` start tag",description:"Unexpected start tag `<head>`. Expected `<head>` directly after doctype",url:!1},missingAttributeValue:{reason:`Missing attribute value`,description:"Unexpected `%c-1`. Expected an attribute value or no `%c-1` instead"},missingDoctype:{reason:`Missing doctype before other content`,description:"Expected a `<!doctype html>` before anything else",url:!1},missingDoctypeName:{reason:`Missing doctype name`,description:"Unexpected doctype end at `%c`. Expected `html` instead"},missingDoctypePublicIdentifier:{reason:`Missing public identifier in doctype`,description:"Unexpected `%c`. Expected identifier for `public` instead"},missingDoctypeSystemIdentifier:{reason:`Missing system identifier in doctype`,description:'Unexpected `%c`. Expected identifier for `system` instead (suggested: `"about:legacy-compat"`)'},missingEndTagName:{reason:`Missing name in end tag`,description:"Unexpected `%c`. Expected an ASCII letter instead"},missingQuoteBeforeDoctypePublicIdentifier:{reason:`Missing quote before public identifier in doctype`,description:"Unexpected `%c`. Expected `\"` or `'` instead"},missingQuoteBeforeDoctypeSystemIdentifier:{reason:`Missing quote before system identifier in doctype`,description:"Unexpected `%c`. Expected `\"` or `'` instead"},missingSemicolonAfterCharacterReference:{reason:`Missing semicolon after character reference`,description:"Unexpected `%c`. Expected `;` instead"},missingWhitespaceAfterDoctypePublicKeyword:{reason:`Missing whitespace after public identifier in doctype`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceAfterDoctypeSystemKeyword:{reason:`Missing whitespace after system identifier in doctype`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBeforeDoctypeName:{reason:`Missing whitespace before doctype name`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBetweenAttributes:{reason:`Missing whitespace between attributes`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers:{reason:`Missing whitespace between public and system identifiers in doctype`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},nestedComment:{reason:`Unexpected nested comment`,description:"Unexpected `<!--`. Expected `-->`"},nestedNoscriptInHead:{reason:"Unexpected nested `<noscript>` in `<head>`",description:"Unexpected `<noscript>`. Expected a closing tag or a meta element",url:!1},nonConformingDoctype:{reason:`Unexpected non-conforming doctype declaration`,description:'Expected `<!doctype html>` or `<!doctype html system "about:legacy-compat">`',url:!1},nonVoidHtmlElementStartTagWithTrailingSolidus:{reason:`Unexpected trailing slash on start tag of non-void element`,description:"Unexpected `/`. Expected `>` instead"},noncharacterCharacterReference:{reason:`Unexpected noncharacter code point referenced by character reference`,description:`Unexpected code point. Do not use noncharacters in HTML`},noncharacterInInputStream:{reason:`Unexpected noncharacter character`,description:"Unexpected code point `%x`. Do not use noncharacters in HTML"},nullCharacterReference:{reason:`Unexpected NULL character referenced by character reference`,description:`Unexpected code point. Do not use NULL characters in HTML`},openElementsLeftAfterEof:{reason:`Unexpected end of file`,description:`Unexpected end of file. Expected closing tag instead`,url:!1},surrogateCharacterReference:{reason:`Unexpected surrogate character referenced by character reference`,description:`Unexpected code point. Do not use lone surrogate characters in HTML`},surrogateInInputStream:{reason:`Unexpected surrogate character`,description:"Unexpected code point `%x`. Do not use lone surrogate characters in HTML"},unexpectedCharacterAfterDoctypeSystemIdentifier:{reason:`Invalid character after system identifier in doctype`,description:"Unexpected character at `%c`. Expected `>`"},unexpectedCharacterInAttributeName:{reason:`Unexpected character in attribute name`,description:"Unexpected `%c`. Expected whitespace, `/`, `>`, `=`, or probably an ASCII letter"},unexpectedCharacterInUnquotedAttributeValue:{reason:`Unexpected character in unquoted attribute value`,description:"Unexpected `%c`. Quote the attribute value to include it"},unexpectedEqualsSignBeforeAttributeName:{reason:`Unexpected equals sign before attribute name`,description:"Unexpected `%c`. Add an attribute name before it"},unexpectedNullCharacter:{reason:`Unexpected NULL character`,description:"Unexpected code point `%x`. Do not use NULL characters in HTML"},unexpectedQuestionMarkInsteadOfTagName:{reason:`Unexpected question mark instead of tag name`,description:"Unexpected `%c`. Expected an ASCII letter instead"},unexpectedSolidusInTag:{reason:`Unexpected slash in tag`,description:"Unexpected `%c-1`. Expected it followed by `>` or in a quoted attribute value"},unknownNamedCharacterReference:{reason:`Unexpected unknown named character reference`,description:`Unexpected character reference. Expected known named character references`}},Hte=`https://html.spec.whatwg.org/multipage/parsing.html#parse-error-`,Ute=/-[a-z]/g,Wte=/%c(?:([-+])(\d+))?/g,Gte=/%x/g,Kte={2:!0,1:!1,0:null},qte={};function RA(e,t){let n=t||qte,r=n.onerror,i=e instanceof ie?e:new ie(e),a=n.fragment?l:w,o=String(i);return A(a(o,{sourceCodeLocationInfo:!0,onParseError:n.onerror?s:null,scriptingEnabled:!1}),{file:i,space:n.space,verbose:n.verbose});function s(e){let t=e.code,a=Jte(t),s=n[a]??!0,c=typeof s==`number`?s:+!!s;if(c){let n=Vte[a],o=new xe(l(n.reason),{place:{start:{line:e.startLine,column:e.startCol,offset:e.startOffset},end:{line:e.endLine,column:e.endCol,offset:e.endOffset}},ruleId:t,source:`hast-util-from-html`});i.path&&(o.file=i.path,o.name=i.path+`:`+o.name),o.fatal=Kte[c],o.note=l(n.description),o.url=n.url===!1?void 0:Hte+t,r(o)}function l(t){return t.replace(Wte,n).replace(Gte,r);function n(t,n,r){let i=(r?Number.parseInt(r,10):0)*(n===`-`?-1:1);return Xte(o.charAt(e.startOffset+i))}function r(){return Zte(o.charCodeAt(e.startOffset))}}}}function Jte(e){return e.replace(Ute,Yte)}function Yte(e){return e.charAt(1).toUpperCase()}function Xte(e){return e==="`"?"` ` `":e}function Zte(e){return`0x`+e.toString(16).toUpperCase()}function Qte(e){let t=this,{emitParseErrors:n,...r}={...t.data(`settings`),...e};t.parser=i;function i(e,t){return RA(e,{...r,onerror:n?function(e){t.path&&(e.name=t.path+`:`+e.name,e.file=t.path),t.messages.push(e)}:void 0})}}var zA=(function(e,t,n,r,i){let a=BA(t);if(n!=null&&(typeof n!=`number`||n<0||n===1/0))throw Error("Expected positive finite `index`");if(r!=null&&(!r.type||!r.children))throw Error("Expected valid `parent`");if(n==null!=(r==null))throw Error("Expected both `index` and `parent`");return HA(e)?a.call(i,e,n,r):!1}),BA=(function(e){if(e==null)return tne;if(typeof e==`string`)return ene(e);if(typeof e==`object`)return $te(e);if(typeof e==`function`)return VA(e);throw Error("Expected function, string, or array as `test`")});function $te(e){let t=[],n=-1;for(;++n<e.length;)t[n]=BA(e[n]);return VA(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function ene(e){return VA(t);function t(t){return t.tagName===e}}function VA(e){return t;function t(t,n,r){return!!(HA(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function tne(e){return!!(e&&typeof e==`object`&&`type`in e&&e.type===`element`&&`tagName`in e&&typeof e.tagName==`string`)}function HA(e){return typeof e==`object`&&!!e&&`type`in e&&`tagName`in e}var UA=BA(function(e){return e.tagName===`audio`||e.tagName===`canvas`||e.tagName===`embed`||e.tagName===`iframe`||e.tagName===`img`||e.tagName===`math`||e.tagName===`object`||e.tagName===`picture`||e.tagName===`svg`||e.tagName===`video`}),nne=`address.article.aside.blockquote.body.br.caption.center.col.colgroup.dd.dialog.dir.div.dl.dt.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.legend.li.li.listing.main.menu.nav.ol.optgroup.option.p.plaintext.pre.section.summary.table.tbody.td.td.tfoot.th.th.thead.tr.ul.wbr.xmp`.split(`.`),rne=[`button`,`input`,`select`,`textarea`],ine=[`area`,`base`,`basefont`,`dialog`,`datalist`,`head`,`link`,`meta`,`noembed`,`noframes`,`param`,`rp`,`script`,`source`,`style`,`template`,`track`,`title`],ane={},WA=Se([`comment`,`doctype`]);function GA(e,t){KA(e,{collapse:rj((t||ane).newlines?tj:nj),whitespace:`normal`})}function KA(e,t){if(`children`in e){let n={...t};return(e.type===`root`||QA(e))&&(n.before=!0,n.after=!0),n.whitespace=ij(e,t),JA(e,n)}if(e.type===`text`){if(t.whitespace===`normal`)return qA(e,t);t.whitespace===`nowrap`&&(e.value=t.collapse(e.value))}return{ignore:WA(e),stripAtStart:!1,remove:!1}}function qA(e,t){let n=t.collapse(e.value),r={ignore:!1,stripAtStart:!1,remove:!1},i=0,a=n.length;return t.before&&ej(n.charAt(0))&&i++,i!==a&&ej(n.charAt(a-1))&&(t.after?a--:r.stripAtStart=!0),i===a?r.remove=!0:e.value=n.slice(i,a),r}function JA(e,t){let n=t.before,r=t.after,i=e.children,a=i.length,o=-1;for(;++o<a;){let e=KA(i[o],{...t,after:YA(i,o,r),before:n});e.remove?(i.splice(o,1),o--,a--):e.ignore||(n=e.stripAtStart),ZA(i[o])&&(n=!1)}return{ignore:!1,stripAtStart:!!(n||r),remove:!1}}function YA(e,t,n){for(;++t<e.length;){let n=e[t],r=XA(n);if(r===void 0&&`children`in n&&!$A(n)&&(r=YA(n.children,-1)),typeof r==`boolean`)return r}return n}function XA(e){if(e.type===`element`){if(ZA(e))return!1;if(QA(e))return!0}else if(e.type===`text`){if(!re(e))return!1}else if(!WA(e))return!1}function ZA(e){return UA(e)||zA(e,rne)}function QA(e){return zA(e,nne)}function $A(e){return!!(e.type===`element`&&e.properties.hidden)||WA(e)||zA(e,ine)}function ej(e){return e===` `||e===`
323
+ `}function tj(e){let t=/\r?\n|\r/.exec(e);return t?t[0]:` `}function nj(){return` `}function rj(e){return t;function t(t){return String(t).replace(/[\t\n\v\f\r ]+/g,e)}}function ij(e,t){if(`tagName`in e&&e.properties)switch(e.tagName){case`listing`:case`plaintext`:case`script`:case`style`:case`xmp`:return`pre`;case`nobr`:return`nowrap`;case`pre`:return e.properties.wrap?`pre-wrap`:`pre`;case`td`:case`th`:return e.properties.noWrap?`nowrap`:t.whitespace;case`textarea`:return`pre-wrap`;default:}return t.whitespace}function aj(e){return function(t){GA(t,e)}}function oj(e,t){let n=t.properties||{},r=e.all(t),i={type:`link`,url:e.resolve(String(n.href||``)||null),title:n.title?String(n.title):null,children:r};return e.patch(t,i),i}function sj(e,t){e.baseFound||=(e.frozenBaseUrl=String(t.properties&&t.properties.href||``)||void 0,!0)}function cj(e,t){let n={type:`blockquote`,children:e.toFlow(e.all(t))};return e.patch(t,n),n}function lj(e,t){let n={type:`break`};return e.patch(t,n),n}var uj=(function(e,t,n){let r=Se(n);if(!e||!e.type||!e.children)throw Error(`Expected parent node`);if(typeof t==`number`){if(t<0||t===1/0)throw Error(`Expected positive finite number as index`)}else if(t=e.children.indexOf(t),t<0)throw Error(`Expected child node or index`);for(;++t<e.children.length;)if(r(e.children[t],t,e))return e.children[t]}),dj=/\n/g,fj=/[\t ]+/g,pj=BA(`br`),mj=BA(Dj),hj=BA(`p`),gj=BA(`tr`),_j=BA([`datalist`,`head`,`noembed`,`noframes`,`noscript`,`rp`,`script`,`style`,`template`,`title`,Ej,Oj]),vj=BA(`address.article.aside.blockquote.body.caption.center.dd.dialog.dir.dl.dt.div.figure.figcaption.footer.form,.h1.h2.h3.h4.h5.h6.header.hgroup.hr.html.legend.li.listing.main.menu.nav.ol.p.plaintext.pre.section.ul.xmp`.split(`.`));function yj(e,t){let n=t||{},r=`children`in e?e.children:[],i=vj(e),a=Tj(e,{whitespace:n.whitespace||`normal`,breakBefore:!1,breakAfter:!1}),o=[];(e.type===`text`||e.type===`comment`)&&o.push(...Sj(e,{whitespace:a,breakBefore:!0,breakAfter:!0}));let s=-1;for(;++s<r.length;)o.push(...bj(r[s],e,{whitespace:a,breakBefore:s?void 0:i,breakAfter:s<r.length-1?pj(r[s+1]):i}));let c=[],l;for(s=-1;++s<o.length;){let e=o[s];typeof e==`number`?l!==void 0&&e>l&&(l=e):e&&(l!==void 0&&l>-1&&c.push(`
324
+ `.repeat(l)||` `),l=-1,c.push(e))}return c.join(``)}function bj(e,t,n){return e.type===`element`?xj(e,t,n):e.type===`text`?n.whitespace===`normal`?Sj(e,n):Cj(e):[]}function xj(e,t,n){let r=Tj(e,n),i=e.children||[],a=-1,o=[];if(_j(e))return o;let s,c;for(pj(e)||gj(e)&&uj(t,e,gj)?c=`
325
+ `:hj(e)?(s=2,c=2):vj(e)&&(s=1,c=1);++a<i.length;)o=o.concat(bj(i[a],e,{whitespace:r,breakBefore:a?void 0:s,breakAfter:a<i.length-1?pj(i[a+1]):c}));return mj(e)&&uj(t,e,mj)&&o.push(` `),s&&o.unshift(s),c&&o.push(c),o}function Sj(e,t){let n=String(e.value),r=[],i=[],a=0;for(;a<=n.length;){dj.lastIndex=a;let e=dj.exec(n),i=e&&`index`in e?e.index:n.length;r.push(wj(n.slice(a,i).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,``),a===0?t.breakBefore:!0,i===n.length?t.breakAfter:!0)),a=i+1}let o=-1,s;for(;++o<r.length;)r[o].charCodeAt(r[o].length-1)===8203||o<r.length-1&&r[o+1].charCodeAt(0)===8203?(i.push(r[o]),s=void 0):r[o]?(typeof s==`number`&&i.push(s),i.push(r[o]),s=0):(o===0||o===r.length-1)&&i.push(0);return i}function Cj(e){return[String(e.value)]}function wj(e,t,n){let r=[],i=0,a;for(;i<e.length;){fj.lastIndex=i;let n=fj.exec(e);a=n?n.index:e.length,!i&&!a&&n&&!t&&r.push(``),i!==a&&r.push(e.slice(i,a)),i=n?a+n[0].length:a}return i!==a&&!n&&r.push(``),r.join(` `)}function Tj(e,t){if(e.type===`element`){let n=e.properties||{};switch(e.tagName){case`listing`:case`plaintext`:case`xmp`:return`pre`;case`nobr`:return`nowrap`;case`pre`:return n.wrap?`pre-wrap`:`pre`;case`td`:case`th`:return n.noWrap?`nowrap`:t.whitespace;case`textarea`:return`pre-wrap`;default:}}return t.whitespace}function Ej(e){return!!(e.properties||{}).hidden}function Dj(e){return e.tagName===`td`||e.tagName===`th`}function Oj(e){return e.tagName===`dialog`&&!(e.properties||{}).open}function kj(e){let t=String(e),n=t.length;for(;n>0;){let e=t.codePointAt(n-1);if(e!==void 0&&(e===10||e===13))n--;else break}return t.slice(0,n)}var Aj=`language-`;function jj(e,t){let n=t.children,r=-1,i,a;if(t.tagName===`pre`)for(;++r<n.length;){let e=n[r];if(e.type===`element`&&e.tagName===`code`&&e.properties&&e.properties.className&&Array.isArray(e.properties.className)){i=e.properties.className;break}}if(i){for(r=-1;++r<i.length;)if(String(i[r]).slice(0,9)===Aj){a=String(i[r]).slice(9);break}}let o={type:`code`,lang:a||null,meta:null,value:kj(yj(t))};return e.patch(t,o),o}function Mj(e,t){let n={type:`html`,value:`<!--`+t.value+`-->`};return e.patch(t,n),n}function Nj(e,t){let n={type:`delete`,children:e.all(t)};return e.patch(t,n),n}function Pj(e){let t=-1;if(e.length>1){for(;++t<e.length;)if(e[t].spread)return!0}return!1}function Fj(e,t){let n=[],r=[],i=-1;for(;++i<t.children.length;){let e=t.children[i];e.type===`element`&&e.tagName===`div`?n.push(...e.children):n.push(e)}let a={definitions:[],titles:[]};for(i=-1;++i<n.length;){let e=n[i];if(e.type===`element`&&e.tagName===`dt`){let t=n[i-1];t&&t.type===`element`&&t.tagName===`dd`&&(r.push(a),a={definitions:[],titles:[]}),a.titles.push(e)}else a.definitions.push(e)}r.push(a),i=-1;let o=[];for(;++i<r.length;){let t=[...Ij(e,r[i].titles),...Ij(e,r[i].definitions)];t.length>0&&o.push({type:`listItem`,spread:t.length>1,checked:null,children:t})}if(o.length>0){let n={type:`list`,ordered:!1,start:null,spread:Pj(o),children:o};return e.patch(t,n),n}}function Ij(e,t){let n=e.all({type:`root`,children:t}),r=e.toSpecificContent(n,Lj);return r.length===0?[]:r.length===1?r[0].children:[{type:`list`,ordered:!1,start:null,spread:Pj(r),children:r}]}function Lj(){return{type:`listItem`,spread:!1,checked:null,children:[]}}function Rj(e,t){let n={type:`emphasis`,children:e.all(t)};return e.patch(t,n),n}function zj(e){let t=0,n=e.length;for(;t<n&&e[t].type===`break`;)t++;for(;n>t&&e[n-1].type===`break`;)n--;return t===0&&n===e.length?e:e.slice(t,n)}function Bj(e,t){let n={type:`heading`,depth:Number(t.tagName.charAt(1))||1,children:zj(e.all(t))};return e.patch(t,n),n}function Vj(e,t){let n={type:`thematicBreak`};return e.patch(t,n),n}function Hj(e,t){let n=t.properties||{},r=String(n.src||``),i=String(n.title||``);if(r&&i){let n={type:`link`,title:null,url:e.resolve(r),children:[{type:`text`,value:i}]};return e.patch(t,n),n}}function Uj(e,t){let n=t.properties||{},r={type:`image`,url:e.resolve(String(n.src||``)||null),title:n.title?String(n.title):null,alt:n.alt?String(n.alt):``};return e.patch(t,r),r}function Wj(e,t){let n={type:`inlineCode`,value:yj(t)};return e.patch(t,n),n}function Gj(e,t){let n=[],r=[],i=t||e.properties||{},a=Kj(e),o=Math.min(Number.parseInt(String(i.size),10),0)||(i.multiple?4:1),s=-1;for(;++s<a.length;){let e=a[s];e&&e.properties&&e.properties.selected&&n.push(e)}let c=n.length>0?n:a,l=Math.min(c.length,o);for(s=-1;++s<l;){let e=c[s],t=e.properties||{},n=yj(e),i=n||String(t.label||``),a=String(t.value||``)||n;r.push([a,i===a?void 0:i])}return r}function Kj(e){let t=[],n=-1;for(;++n<e.children.length;){let r=e.children[n];`children`in r&&Array.isArray(r.children)&&t.push(...Kj(r)),r.type===`element`&&r.tagName===`option`&&(!r.properties||!r.properties.disabled)&&t.push(r)}return t}var qj=`[x]`,Jj=`[ ]`;function Yj(e,t){let n=t.properties||{},r=String(n.value||n.placeholder||``);if(n.disabled||n.type===`hidden`||n.type===`file`)return;if(n.type===`checkbox`||n.type===`radio`){let r={type:`text`,value:n.checked?e.options.checked||qj:e.options.unchecked||Jj};return e.patch(t,r),r}if(n.type===`image`){let i=n.alt||r;if(i){let r={type:`image`,url:e.resolve(String(n.src||``)||null),title:String(n.title||``)||null,alt:String(i)};return e.patch(t,r),r}return}let i=[];if(r)i=[[r,void 0]];else if(n.type!==`button`&&n.type!==`file`&&n.type!==`password`&&n.type!==`reset`&&n.type!==`submit`&&n.list){let t=String(n.list),r=e.elementById.get(t);r&&r.tagName===`datalist`&&(i=Gj(r,n))}if(i.length===0)return;if(n.type===`password`&&(i[0]=[`•`.repeat(i[0][0].length),void 0]),n.type===`email`||n.type===`url`){let t=[],r=-1;for(;++r<i.length;){let a=e.resolve(i[r][0]),o={type:`link`,title:null,url:n.type===`email`?`mailto:`+a:a,children:[{type:`text`,value:i[r][1]||a}]};t.push(o),r!==i.length-1&&t.push({type:`text`,value:`, `})}return t}let a=[],o=-1;for(;++o<i.length;)a.push(i[o][1]?i[o][1]+` (`+i[o][0]+`)`:i[o][0]);let s={type:`text`,value:a.join(`, `)};return e.patch(t,s),s}var Xj={}.hasOwnProperty;function Zj(e,t){let n=e.type===`element`&&Xj.call(e.properties,t)&&e.properties[t];return n!=null&&n!==!1}var Qj=new Set([`pingback`,`prefetch`,`stylesheet`]);function $j(e){if(e.type!==`element`||e.tagName!==`link`)return!1;if(e.properties.itemProp)return!0;let t=e.properties.rel,n=-1;if(!Array.isArray(t)||t.length===0)return!1;for(;++n<t.length;)if(!Qj.has(String(t[n])))return!1;return!0}var eM=BA(`a.abbr.area.b.bdi.bdo.br.button.cite.code.data.datalist.del.dfn.em.i.input.ins.kbd.keygen.label.map.mark.meter.noscript.output.progress.q.ruby.s.samp.script.select.small.span.strong.sub.sup.template.textarea.time.u.var.wbr`.split(`.`)),tM=BA(`meta`);function nM(e){return!!(e.type===`text`||eM(e)||UA(e)||$j(e)||tM(e)&&Zj(e,`itemProp`))}function rM(e,t){let{rest:n,checkbox:r}=aM(t),i=r?!!r.properties.checked:null,a={type:`listItem`,spread:iM(n),checked:i,children:e.toFlow(e.all(n))};return e.patch(t,a),a}function iM(e){let t=-1,n=!1;for(;++t<e.children.length;){let r=e.children[t];if(r.type===`element`){if(nM(r))continue;if(r.tagName===`p`||n||iM(r))return!0;n=!0}}return!1}function aM(e){let t=e.children[0];if(t&&t.type===`element`&&t.tagName===`input`&&t.properties&&(t.properties.type===`checkbox`||t.properties.type===`radio`))return{checkbox:t,rest:{...e,children:e.children.slice(1)}};if(t&&t.type===`element`&&t.tagName===`p`){let{checkbox:n,rest:r}=aM(t);if(n)return{checkbox:n,rest:{...e,children:[r,...e.children.slice(1)]}}}return{checkbox:void 0,rest:e}}function oM(e,t){let n=t.tagName===`ol`,r=e.toSpecificContent(e.all(t),sM),i=null;n&&(i=t.properties&&t.properties.start?Number.parseInt(String(t.properties.start),10):1);let a={type:`list`,ordered:n,start:i,spread:Pj(r),children:r};return e.patch(t,a),a}function sM(){return{type:`listItem`,spread:!1,checked:null,children:[]}}function cM(e){let t=-1;for(;++t<e.length;){let n=e[t];if(!pM(n)||`children`in n&&cM(n.children))return!0}return!1}function lM(e){return dM(e,t,function(e){return e});function t(e){return e.every(function(e){return e.type===`text`?re(e.value):!1})?[]:[{type:`paragraph`,children:zj(e)}]}}function uM(e){return dM(e.children,t,n);function t(t){let n=mM(e);return n.children=t,[n]}function n(t){if(`children`in t&&`children`in e){let n=mM(e),r=mM(t);return n.children=t.children,r.children.push(n),r}return{...t}}}function dM(e,t,n){let r=fM(e),i=[],a=[],o=-1;for(;++o<r.length;){let e=r[o];pM(e)?a.push(e):(a.length>0&&(i.push(...t(a)),a=[]),i.push(n(e)))}return a.length>0&&(i.push(...t(a)),a=[]),i}function fM(e){let t=[],n=-1;for(;++n<e.length;){let r=e[n];(r.type===`delete`||r.type===`link`)&&cM(r.children)?t.push(...uM(r)):t.push(r)}return t}function pM(e){let t=e.data&&e.data.hName;return t?nM({type:`element`,tagName:t,properties:{},children:[]}):Ne(e)}function mM(e){return ne({...e,children:[]})}function hM(e,t){let n=t.properties||{},r=t.tagName===`video`?String(n.poster||``):``,i=String(n.src||``),a=-1,o=!1,s=e.all(t);if(D({type:`root`,children:s},function(e){if(e.type===`link`)return o=!0,!1}),o||cM(s))return s;for(;!i&&++a<t.children.length;){let e=t.children[a];e.type===`element`&&e.tagName===`source`&&e.properties&&(i=String(e.properties.src||``))}if(r){let n={type:`image`,title:null,url:e.resolve(r),alt:d(s)};e.patch(t,n),s=[n]}let c=s,l={type:`link`,title:n.title?String(n.title):null,url:e.resolve(i),children:c};return e.patch(t,l),l}function gM(e,t){let n=zj(e.all(t));if(n.length>0){let r={type:`paragraph`,children:n};return e.patch(t,r),r}}var _M=[`"`];function vM(e,t){let n=e.options.quotes||_M;e.qNesting++;let r=e.all(t);e.qNesting--;let i=n[e.qNesting%n.length],a=r[0],o=r[r.length-1],s=i.charAt(0),c=i.length>1?i.charAt(1):i;return a&&a.type===`text`?a.value=s+a.value:r.unshift({type:`text`,value:s}),o&&o.type===`text`?o.value+=c:r.push({type:`text`,value:c}),r}function yM(e,t){let n=e.all(t);(e.options.document||cM(n))&&(n=lM(n));let r={type:`root`,children:n};return e.patch(t,r),r}function bM(e,t){let n=Gj(t),r=-1,i=[];for(;++r<n.length;){let e=n[r];i.push(e[1]?e[1]+` (`+e[0]+`)`:e[0])}if(i.length>0){let n={type:`text`,value:i.join(`, `)};return e.patch(t,n),n}}function xM(e,t){let n={type:`strong`,children:e.all(t)};return e.patch(t,n),n}function SM(e,t){let n={type:`tableCell`,children:e.all(t)};if(e.patch(t,n),t.properties){let e=t.properties.rowSpan,r=t.properties.colSpan;if(e||r){let t=n.data||={};e&&(t.hastUtilToMdastTemporaryRowSpan=e),r&&(t.hastUtilToMdastTemporaryColSpan=r)}}return n}function CM(e,t){let n={type:`tableRow`,children:e.toSpecificContent(e.all(t),wM)};return e.patch(t,n),n}function wM(){return{type:`tableCell`,children:[]}}function TM(e,t){if(e.inTable){let n={type:`text`,value:yj(t)};return e.patch(t,n),n}e.inTable=!0;let{align:n,headless:r}=EM(t),i=e.toSpecificContent(e.all(t),OM);r&&i.unshift(OM());let a=-1;for(;++a<i.length;){let t=i[a];t.children=e.toSpecificContent(t.children,DM)}let o=1;for(a=-1;++a<i.length;){let e=i[a].children,t=-1;for(;++t<e.length;){let n=e[t];if(n.data){let e=n.data,r=Number.parseInt(String(e.hastUtilToMdastTemporaryColSpan),10)||1,o=Number.parseInt(String(e.hastUtilToMdastTemporaryRowSpan),10)||1;if(r>1||o>1){let e=a-1;for(;++e<a+o;){let n=t-1;for(;++n<t+r&&i[e];){let r=[];(e!==a||n!==t)&&r.push({type:`tableCell`,children:[]}),i[e].children.splice(n,0,...r)}}}`hastUtilToMdastTemporaryColSpan`in n.data&&delete n.data.hastUtilToMdastTemporaryColSpan,`hastUtilToMdastTemporaryRowSpan`in n.data&&delete n.data.hastUtilToMdastTemporaryRowSpan,Object.keys(n.data).length===0&&delete n.data}}e.length>o&&(o=e.length)}for(a=-1;++a<i.length;){let e=i[a].children,t=e.length-1;for(;++t<o;)e.push({type:`tableCell`,children:[]})}let s=n.length-1;for(;++s<o;)n.push(null);e.inTable=!1;let c={type:`table`,align:n,children:i};return e.patch(t,c),c}function EM(e){let t={align:[null],headless:!0},n=0,r=0;return D(e,function(i){if(i.type===`element`){if(i.tagName===`table`&&e!==i)return g;if((i.tagName===`th`||i.tagName===`td`)&&i.properties){if(!t.align[r]){let e=String(i.properties.align||``)||null;(e===`center`||e===`left`||e===`right`||e===null)&&(t.align[r]=e)}t.headless&&n<2&&i.tagName===`th`&&(t.headless=!1),r++}else i.tagName===`thead`?t.headless=!1:i.tagName===`tr`&&(n++,r=0)}}),t}function DM(){return{type:`tableCell`,children:[]}}function OM(){return{type:`tableRow`,children:[]}}function kM(e,t){let n={type:`text`,value:t.value};return e.patch(t,n),n}function AM(e,t){let n={type:`text`,value:yj(t)};return e.patch(t,n),n}function jM(e,t){let n={type:`text`,value:`​`};return e.patch(t,n),n}var MM={comment:Mj,doctype:IM,root:yM,text:kM},NM={applet:IM,area:IM,basefont:IM,bgsound:IM,caption:IM,col:IM,colgroup:IM,command:IM,content:IM,datalist:IM,dialog:IM,element:IM,embed:IM,frame:IM,frameset:IM,isindex:IM,keygen:IM,link:IM,math:IM,menu:IM,menuitem:IM,meta:IM,nextid:IM,noembed:IM,noframes:IM,optgroup:IM,option:IM,param:IM,script:IM,shadow:IM,source:IM,spacer:IM,style:IM,svg:IM,template:IM,title:IM,track:IM,abbr:PM,acronym:PM,bdi:PM,bdo:PM,big:PM,blink:PM,button:PM,canvas:PM,cite:PM,data:PM,details:PM,dfn:PM,font:PM,ins:PM,label:PM,map:PM,marquee:PM,meter:PM,nobr:PM,noscript:PM,object:PM,output:PM,progress:PM,rb:PM,rbc:PM,rp:PM,rt:PM,rtc:PM,ruby:PM,slot:PM,small:PM,span:PM,sup:PM,sub:PM,tbody:PM,tfoot:PM,thead:PM,time:PM,address:FM,article:FM,aside:FM,body:FM,center:FM,div:FM,fieldset:FM,figcaption:FM,figure:FM,form:FM,footer:FM,header:FM,hgroup:FM,html:FM,legend:FM,main:FM,multicol:FM,nav:FM,picture:FM,section:FM,a:oj,audio:hM,b:xM,base:sj,blockquote:cj,br:lj,code:Wj,dir:oM,dl:Fj,dt:rM,dd:rM,del:Nj,em:Rj,h1:Bj,h2:Bj,h3:Bj,h4:Bj,h5:Bj,h6:Bj,hr:Vj,i:Rj,iframe:Hj,img:Uj,image:Uj,input:Yj,kbd:Wj,li:rM,listing:jj,mark:Rj,ol:oM,p:gM,plaintext:jj,pre:jj,q:vM,s:Nj,samp:Wj,select:bM,strike:Nj,strong:xM,summary:gM,table:TM,td:SM,textarea:AM,th:SM,tr:CM,tt:Wj,u:Rj,ul:oM,var:Wj,video:hM,wbr:jM,xmp:jj};function PM(e,t){return e.all(t)}function FM(e,t){return e.toFlow(e.all(t))}function IM(){}var LM={}.hasOwnProperty;function RM(e){return{all:zM,baseFound:!1,elementById:new Map,frozenBaseUrl:void 0,handlers:{...NM,...e.handlers},inTable:!1,nodeHandlers:{...MM,...e.nodeHandlers},one:BM,options:e,patch:VM,qNesting:0,resolve:HM,toFlow:UM,toSpecificContent:WM}}function zM(e){let t=e.children||[],n=[],r=-1;for(;++r<t.length;){let i=t[r],a=this.one(i,e);Array.isArray(a)?n.push(...a):a&&n.push(a)}return n}function BM(e,t){if(e.type===`element`){if(e.properties&&e.properties.dataMdast===`ignore`)return;if(LM.call(this.handlers,e.tagName))return this.handlers[e.tagName](this,e,t)||void 0}else if(LM.call(this.nodeHandlers,e.type))return this.nodeHandlers[e.type](this,e,t)||void 0;if(`value`in e&&typeof e.value==`string`){let t={type:`text`,value:e.value};return this.patch(e,t),t}if(`children`in e)return this.all(e)}function VM(e,t){e.position&&(t.position=te(e))}function HM(e){let t=this.frozenBaseUrl;return e==null?``:t?String(new URL(e,t)):e}function UM(e){return lM(e)}function WM(e,t){let n=t(),r=[],i=[],a=-1;for(;++a<e.length;){let t=e[a];if(o(t))i.length>0&&(t.children.unshift(...i),i=[]),r.push(t);else{let e=t;i.push(e)}}if(i.length>0){let e=r[r.length-1];e||(e=t(),r.push(e)),e.children.push(...i),i=[]}return r;function o(e){return e.type===n.type}}var GM={};function KM(e,t){let n=ne(e),r=t||GM,i=aj({newlines:r.newlines===!0}),a=RM(r),o;i(n),D(n,function(e){if(e&&e.type===`element`&&e.properties){let t=String(e.properties.id||``)||void 0;t&&!a.elementById.has(t)&&a.elementById.set(t,e)}});let s=a.one(n,void 0);return o=s?Array.isArray(s)?{type:`root`,children:s}:s:{type:`root`,children:[]},D(o,function(e,t,n){if(e.type===`text`&&t!==void 0&&n){let r=n.children[t-1];if(r&&r.type===e.type)return r.value+=e.value,n.children.splice(t,1),r.position&&e.position&&(r.position.end=e.position.end),t-1;if(e.value=e.value.replace(/[\t ]*(\r?\n|\r)[\t ]*/,`$1`),n&&(n.type===`heading`||n.type===`paragraph`||n.type===`root`)&&(t||(e.value=e.value.replace(/^[\t ]+/,``)),t===n.children.length-1&&(e.value=e.value.replace(/[\t ]+$/,``))),!e.value)return n.children.splice(t,1),t}}),o}var qM={document:!0};function JM(e,t){return e&&`run`in e?async function(n,r){let i=KM(n,{...qM,...t});await e.run(i,r)}:function(t){return KM(t,{...qM,...e})}}var YM={}.hasOwnProperty;function XM(e,t){let n=-1,r;if(t.extensions)for(;++n<t.extensions.length;)XM(e,t.extensions[n]);for(r in t)if(YM.call(t,r))switch(r){case`extensions`:break;case`unsafe`:ZM(e[r],t[r]);break;case`join`:ZM(e[r],t[r]);break;case`handlers`:QM(e[r],t[r]);break;default:e.options[r]=t[r]}return e}function ZM(e,t){t&&e.push(...t)}function QM(e,t){t&&Object.assign(e,t)}var $M=[eN];function eN(e,t,n,r){if(t.type===`code`&&S(t,r)&&(e.type===`list`||e.type===t.type&&S(e,r)))return!1;if(`spread`in n&&typeof n.spread==`boolean`)return e.type===`paragraph`&&(e.type===t.type||t.type===`definition`||t.type===`heading`&&ee(t,r))?void 0:+!!n.spread}var tN=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`],nN=[{character:` `,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,before:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`]},{character:`\r`,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`,`codeFencedMetaGraveAccent`,`codeFencedMetaTilde`,`destinationLiteral`,`headingAtx`]},{character:`
326
+ `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`,`codeFencedMetaGraveAccent`,`codeFencedMetaTilde`,`destinationLiteral`,`headingAtx`]},{character:` `,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,before:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`]},{character:`!`,after:`\\[`,inConstruct:`phrasing`,notInConstruct:tN},{character:`"`,inConstruct:`titleQuote`},{atBreak:!0,character:`#`},{character:`#`,inConstruct:`headingAtx`,after:`(?:[\r
327
+ ]|$)`},{character:`&`,after:`[#A-Za-z]`,inConstruct:`phrasing`},{character:`'`,inConstruct:`titleApostrophe`},{character:`(`,inConstruct:`destinationRaw`},{before:`\\]`,character:`(`,inConstruct:`phrasing`,notInConstruct:tN},{atBreak:!0,before:`\\d+`,character:`)`},{character:`)`,inConstruct:`destinationRaw`},{atBreak:!0,character:`*`,after:`(?:[ \r
328
+ *])`},{character:`*`,inConstruct:`phrasing`,notInConstruct:tN},{atBreak:!0,character:`+`,after:`(?:[ \r
329
329
  ])`},{atBreak:!0,character:`-`,after:`(?:[ \r
330
330
  -])`},{atBreak:!0,before:`\\d+`,character:`.`,after:`(?:[ \r
331
- ]|$)`},{atBreak:!0,character:`<`,after:`[!/?A-Za-z]`},{character:`<`,after:`[!/?A-Za-z]`,inConstruct:`phrasing`,notInConstruct:nN},{character:`<`,inConstruct:`destinationLiteral`},{atBreak:!0,character:`=`},{atBreak:!0,character:`>`},{character:`>`,inConstruct:`destinationLiteral`},{atBreak:!0,character:`[`},{character:`[`,inConstruct:`phrasing`,notInConstruct:nN},{character:`[`,inConstruct:[`label`,`reference`]},{character:`\\`,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:`]`,inConstruct:[`label`,`reference`]},{atBreak:!0,character:`_`},{character:`_`,inConstruct:`phrasing`,notInConstruct:nN},{atBreak:!0,character:"`"},{character:"`",inConstruct:[`codeFencedLangGraveAccent`,`codeFencedMetaGraveAccent`]},{character:"`",inConstruct:`phrasing`,notInConstruct:nN},{atBreak:!0,character:`~`}];function iN(e){return e.label||!e.identifier?e.label||``:je(e.identifier)}function aN(e){if(!e._compiled){let t=(e.atBreak?`[\\r\\n][\\t ]*`:``)+(e.before?`(?:`+e.before+`)`:``);e._compiled=RegExp((t?`(`+t+`)`:``)+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?`\\`:``)+e.character+(e.after?`(?:`+e.after+`)`:``),`g`)}return e._compiled}function oN(e,t,n){let r=t.indexStack,i=e.children||[],a=[],o=-1,s=n.before,c;r.push(-1);let l=t.createTracker(n);for(;++o<i.length;){let u=i[o],d;if(r[r.length-1]=o,o+1<i.length){let n=t.handle.handlers[i[o+1].type];n&&n.peek&&(n=n.peek),d=n?n(i[o+1],e,t,{before:``,after:``,...l.current()}).charAt(0):``}else d=n.after;a.length>0&&(s===`\r`||s===`
332
- `)&&u.type===`html`&&(a[a.length-1]=a[a.length-1].replace(/(\r?\n|\r)$/,` `),s=` `,l=t.createTracker(n),l.move(a.join(``)));let f=t.handle(u,e,t,{...l.current(),after:d,before:s});c&&c===f.slice(0,1)&&(f=p(c.charCodeAt(0))+f.slice(1));let m=t.attentionEncodeSurroundingInfo;t.attentionEncodeSurroundingInfo=void 0,c=void 0,m&&(a.length>0&&m.before&&s===a[a.length-1].slice(-1)&&(a[a.length-1]=a[a.length-1].slice(0,-1)+p(s.charCodeAt(0))),m.after&&(c=d)),l.move(f),a.push(f),s=f.slice(-1)}return r.pop(),a.join(``)}function sN(e,t,n){let r=t.indexStack,i=e.children||[],a=t.createTracker(n),o=[],s=-1;for(r.push(-1);++s<i.length;){let n=i[s];r[r.length-1]=s,o.push(a.move(t.handle(n,e,t,{before:`
331
+ ]|$)`},{atBreak:!0,character:`<`,after:`[!/?A-Za-z]`},{character:`<`,after:`[!/?A-Za-z]`,inConstruct:`phrasing`,notInConstruct:tN},{character:`<`,inConstruct:`destinationLiteral`},{atBreak:!0,character:`=`},{atBreak:!0,character:`>`},{character:`>`,inConstruct:`destinationLiteral`},{atBreak:!0,character:`[`},{character:`[`,inConstruct:`phrasing`,notInConstruct:tN},{character:`[`,inConstruct:[`label`,`reference`]},{character:`\\`,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:`]`,inConstruct:[`label`,`reference`]},{atBreak:!0,character:`_`},{character:`_`,inConstruct:`phrasing`,notInConstruct:tN},{atBreak:!0,character:"`"},{character:"`",inConstruct:[`codeFencedLangGraveAccent`,`codeFencedMetaGraveAccent`]},{character:"`",inConstruct:`phrasing`,notInConstruct:tN},{atBreak:!0,character:`~`}];function rN(e){return e.label||!e.identifier?e.label||``:je(e.identifier)}function iN(e){if(!e._compiled){let t=(e.atBreak?`[\\r\\n][\\t ]*`:``)+(e.before?`(?:`+e.before+`)`:``);e._compiled=RegExp((t?`(`+t+`)`:``)+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?`\\`:``)+e.character+(e.after?`(?:`+e.after+`)`:``),`g`)}return e._compiled}function aN(e,t,n){let r=t.indexStack,i=e.children||[],a=[],o=-1,s=n.before,c;r.push(-1);let l=t.createTracker(n);for(;++o<i.length;){let u=i[o],d;if(r[r.length-1]=o,o+1<i.length){let n=t.handle.handlers[i[o+1].type];n&&n.peek&&(n=n.peek),d=n?n(i[o+1],e,t,{before:``,after:``,...l.current()}).charAt(0):``}else d=n.after;a.length>0&&(s===`\r`||s===`
332
+ `)&&u.type===`html`&&(a[a.length-1]=a[a.length-1].replace(/(\r?\n|\r)$/,` `),s=` `,l=t.createTracker(n),l.move(a.join(``)));let f=t.handle(u,e,t,{...l.current(),after:d,before:s});c&&c===f.slice(0,1)&&(f=p(c.charCodeAt(0))+f.slice(1));let m=t.attentionEncodeSurroundingInfo;t.attentionEncodeSurroundingInfo=void 0,c=void 0,m&&(a.length>0&&m.before&&s===a[a.length-1].slice(-1)&&(a[a.length-1]=a[a.length-1].slice(0,-1)+p(s.charCodeAt(0))),m.after&&(c=d)),l.move(f),a.push(f),s=f.slice(-1)}return r.pop(),a.join(``)}function oN(e,t,n){let r=t.indexStack,i=e.children||[],a=t.createTracker(n),o=[],s=-1;for(r.push(-1);++s<i.length;){let n=i[s];r[r.length-1]=s,o.push(a.move(t.handle(n,e,t,{before:`
333
333
  `,after:`
334
- `,...a.current()}))),n.type!==`list`&&(t.bulletLastUsed=void 0),s<i.length-1&&o.push(a.move(cN(n,i[s+1],e,t)))}return r.pop(),o.join(``)}function cN(e,t,n,r){let i=r.join.length;for(;i--;){let a=r.join[i](e,t,n,r);if(a===!0||a===1)break;if(typeof a==`number`)return`
334
+ `,...a.current()}))),n.type!==`list`&&(t.bulletLastUsed=void 0),s<i.length-1&&o.push(a.move(sN(n,i[s+1],e,t)))}return r.pop(),o.join(``)}function sN(e,t,n,r){let i=r.join.length;for(;i--;){let a=r.join[i](e,t,n,r);if(a===!0||a===1)break;if(typeof a==`number`)return`
335
335
  `.repeat(1+a);if(a===!1)return`
336
336
 
337
337
  <!---->
338
338
 
339
339
  `}return`
340
340
 
341
- `}var lN=/\r?\n|\r/g;function uN(e,t){let n=[],r=0,i=0,a;for(;a=lN.exec(e);)o(e.slice(r,a.index)),n.push(a[0]),r=a.index+a[0].length,i++;return o(e.slice(r)),n.join(``);function o(e){n.push(t(e,i,!e))}}function dN(e,t,n){let r=(n.before||``)+(t||``)+(n.after||``),i=[],a=[],o={},s=-1;for(;++s<e.unsafe.length;){let t=e.unsafe[s];if(!u(e.stack,t))continue;let n=e.compilePattern(t),a;for(;a=n.exec(r);){let e=`before`in t||!!t.atBreak,n=`after`in t,r=a.index+(e?a[1].length:0);i.includes(r)?(o[r].before&&!e&&(o[r].before=!1),o[r].after&&!n&&(o[r].after=!1)):(i.push(r),o[r]={before:e,after:n})}}i.sort(fN);let c=n.before?n.before.length:0,l=r.length-(n.after?n.after.length:0);for(s=-1;++s<i.length;){let e=i[s];e<c||e>=l||e+1<l&&i[s+1]===e+1&&o[e].after&&!o[e+1].before&&!o[e+1].after||i[s-1]===e-1&&o[e].before&&!o[e-1].before&&!o[e-1].after||(c!==e&&a.push(pN(r.slice(c,e),`\\`)),c=e,/[!-/:-@[-`{-~]/.test(r.charAt(e))&&(!n.encode||!n.encode.includes(r.charAt(e)))?a.push(`\\`):(a.push(p(r.charCodeAt(e))),c++))}return a.push(pN(r.slice(c,l),n.after)),a.join(``)}function fN(e,t){return e-t}function pN(e,t){let n=/\\(?=[!-/:-@[-`{-~])/g,r=[],i=[],a=e+t,o=-1,s=0,c;for(;c=n.exec(a);)r.push(c.index);for(;++o<r.length;)s!==r[o]&&i.push(e.slice(s,r[o])),i.push(`\\`),s=r[o];return i.push(e.slice(s)),i.join(``)}function mN(e){let t=e||{},n=t.now||{},r=t.lineShift||0,i=n.line||1,a=n.column||1;return{move:c,current:o,shift:s};function o(){return{now:{line:i,column:a},lineShift:r}}function s(e){r+=e}function c(e){let t=e||``,n=t.split(/\r?\n|\r/g),o=n[n.length-1];return i+=n.length-1,a=n.length===1?a+o.length:1+o.length+r,t}}function hN(e,t){let n=t||{},r={associationId:iN,containerPhrasing:yN,containerFlow:bN,createTracker:mN,compilePattern:aN,enter:a,handlers:{...Ae},handle:void 0,indentLines:uN,indexStack:[],join:[...eN],options:{},safe:xN,stack:[],unsafe:[...rN]};ZM(r,n),r.options.tightDefinitions&&r.join.push(vN),r.handle=fe(`type`,{invalid:gN,unknown:_N,handlers:r.handlers});let i=r.handle(e,void 0,r,{before:`
341
+ `}var cN=/\r?\n|\r/g;function lN(e,t){let n=[],r=0,i=0,a;for(;a=cN.exec(e);)o(e.slice(r,a.index)),n.push(a[0]),r=a.index+a[0].length,i++;return o(e.slice(r)),n.join(``);function o(e){n.push(t(e,i,!e))}}function uN(e,t,n){let r=(n.before||``)+(t||``)+(n.after||``),i=[],a=[],o={},s=-1;for(;++s<e.unsafe.length;){let t=e.unsafe[s];if(!u(e.stack,t))continue;let n=e.compilePattern(t),a;for(;a=n.exec(r);){let e=`before`in t||!!t.atBreak,n=`after`in t,r=a.index+(e?a[1].length:0);i.includes(r)?(o[r].before&&!e&&(o[r].before=!1),o[r].after&&!n&&(o[r].after=!1)):(i.push(r),o[r]={before:e,after:n})}}i.sort(dN);let c=n.before?n.before.length:0,l=r.length-(n.after?n.after.length:0);for(s=-1;++s<i.length;){let e=i[s];e<c||e>=l||e+1<l&&i[s+1]===e+1&&o[e].after&&!o[e+1].before&&!o[e+1].after||i[s-1]===e-1&&o[e].before&&!o[e-1].before&&!o[e-1].after||(c!==e&&a.push(fN(r.slice(c,e),`\\`)),c=e,/[!-/:-@[-`{-~]/.test(r.charAt(e))&&(!n.encode||!n.encode.includes(r.charAt(e)))?a.push(`\\`):(a.push(p(r.charCodeAt(e))),c++))}return a.push(fN(r.slice(c,l),n.after)),a.join(``)}function dN(e,t){return e-t}function fN(e,t){let n=/\\(?=[!-/:-@[-`{-~])/g,r=[],i=[],a=e+t,o=-1,s=0,c;for(;c=n.exec(a);)r.push(c.index);for(;++o<r.length;)s!==r[o]&&i.push(e.slice(s,r[o])),i.push(`\\`),s=r[o];return i.push(e.slice(s)),i.join(``)}function pN(e){let t=e||{},n=t.now||{},r=t.lineShift||0,i=n.line||1,a=n.column||1;return{move:c,current:o,shift:s};function o(){return{now:{line:i,column:a},lineShift:r}}function s(e){r+=e}function c(e){let t=e||``,n=t.split(/\r?\n|\r/g),o=n[n.length-1];return i+=n.length-1,a=n.length===1?a+o.length:1+o.length+r,t}}function mN(e,t){let n=t||{},r={associationId:rN,containerPhrasing:vN,containerFlow:yN,createTracker:pN,compilePattern:iN,enter:a,handlers:{...Ae},handle:void 0,indentLines:lN,indexStack:[],join:[...$M],options:{},safe:bN,stack:[],unsafe:[...nN]};XM(r,n),r.options.tightDefinitions&&r.join.push(_N),r.handle=fe(`type`,{invalid:hN,unknown:gN,handlers:r.handlers});let i=r.handle(e,void 0,r,{before:`
342
342
  `,after:`
343
343
  `,now:{line:1,column:1},lineShift:0});return i&&i.charCodeAt(i.length-1)!==10&&i.charCodeAt(i.length-1)!==13&&(i+=`
344
- `),i;function a(e){return r.stack.push(e),t;function t(){r.stack.pop()}}}function gN(e){throw Error("Cannot handle value `"+e+"`, expected node")}function _N(e){throw Error("Cannot handle unknown node `"+e.type+"`")}function vN(e,t){if(e.type===`definition`&&e.type===t.type)return 0}function yN(e,t){return oN(e,this,t)}function bN(e,t){return sN(e,this,t)}function xN(e,t){return dN(this,e,t)}function SN(e){let t=this;t.compiler=n;function n(n){return hN(n,{...t.data(`settings`),...e,extensions:t.data(`toMarkdownExtensions`)||[]})}}function CN(e,t,n,r){let i=new Map,a=new Map,o={all:c,definitionById:i,footnoteById:a,footnoteCounts:new Map,footnoteOrder:[],one:s};return D(r,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?i:a,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),o;function s(r,i){return jN(e,t,n,r,i,o)}function c(t){let n=[];if(`children`in t){let r=t.children,i=-1;for(;++i<r.length;){let a=o.one(r[i],t);if(a){let t=i?r[i-1]:void 0;if(t?.type===`break`&&t.data?.sourceStyle!==`html`){if(!Array.isArray(a)&&a.type===e.nodes.text){let t=DN(a.text);a=t.length>0?e.text(t):void 0}else if(!Array.isArray(a)&&a.type!==e.nodes.text){let t=a.firstChild;if(t&&t.type===e.nodes.text){let n=DN(t.text),r=U.from(a.content);a=a.copy(n.length>0?r.replaceChild(0,e.text(n)):r.cut(t.nodeSize))}}}}a&&(Array.isArray(a)?n.push(...a):n.push(a))}}return n}}function wN(e){return e.replaceAll(/\n([^\n])/g,` $1`)}function TN(e,t,n){let r=t.referenceType,i=`]`;if(r===`collapsed`?i+=`[]`:r===`full`&&(i+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[e.text(`![`+(t.alt??``)+i)];let a=n.all(t),o=a[0];o&&o.type===e.nodes.text?a[0]=o.copy(U.from(e.text(`[`+(o.text??``)))):a.unshift(e.text(`[`));let s=a[a.length-1];return s&&s.type===e.nodes.text?a[a.length-1]=s.copy(U.from(e.text((s.text??``)+i))):a.push(e.text(i)),a}function EN(e){throw Error(`unknown markdown node: ${e.type}`)}function DN(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function ON(){}function kN(e){throw Error("Expected node, not `"+JSON.stringify(e)+"`")}function AN(e,t,n,r){return fe(`tagName`,{handlers:e})(t,n,r)}function jN(e,t,n,r,i,a){return fe(`type`,{invalid:kN,unknown:EN,handlers:{toml:ON,yaml:ON,definition:ON,footnoteDefinition:ON,root(t,n,r){let i=r.all(t);return e.topNodeType.create(null,i)},html(t){let r=zA(t.value).children[0];if(r?.type!==`element`)return null;let[,i]=r.children;if(i?.type!==`element`)return null;let o=i.children[0];return o?.type===`element`?AN(n,o,void 0,a)||(t.value?e.text(t.value):null):null},text(t){let n=wN(De(String(t.value)));return n?e.text(n):null},...t,linkReference(n,r,i){if(t.linkReference)return t.linkReference(n,r,i);let a=String(n.identifier).toUpperCase(),o=i.definitionById.get(a);if(!o)return TN(e,n,i);let s={type:`link`,url:o.url,title:o.title,children:n.children,data:{...o.data,...n.data}};return t.link?.(s,r,i)}}})(r,i,a)}function MN(e,t){return(n,r,i)=>{let a=i.all(n);return e.createAndFill(t?.(n)??null,a)}}function NN(e,t){return(n,r,i)=>{let a=i.all(n),o=e.create(t?.(n)??null);return a.map(e=>e.mark(o.addToSet(e.marks)))}}var PN=function(e,t){let n=jN(t.schema,t.handlers,t.htmlHandlers??{},e,void 0,CN(t.schema,t.handlers,t.htmlHandlers??{},e));return n.check(),n},FN=function(e){this.compiler=function(t){return PN(t,e)}};function IN(e,t){let n={one:r,all:u,nodeHandlers:e,markHandlers:t};function r(e,t){let r=e.type.schema,i=e.type.name,a=n.nodeHandlers[i];if(a)return a(e,t,n);if(e.type===r.topNodeType){let t=n.all(e);return t.some(e=>v(e,`root`)),{type:`root`,children:t}}return e.type===r.nodes.text?{type:`text`,value:e.text}:null}function i(e){if(e.length===0)return[];let t=e[0].marks,n=[];for(let r of t){let t=!0;for(let n=1;n<e.length;n++)if(!e[n].marks.some(e=>e.eq(r))){t=!1;break}t&&n.push(r)}return n}function a(e,t){let n=e.findIndex(e=>e.eq(t));return n===-1?e:e.slice(0,n).concat(e.slice(n+1))}function o(e,t){let n=[];for(let r of e)t.some(e=>e.eq(r))&&n.push(r);return n}function s(e,t,r){let i=n.markHandlers[e.type.name];if(!i)return r;let a=i(e,t,r,n);return(Array.isArray(a)?a:[a]).filter(e=>e!=null)}function c(e,t){let r=[];for(let i of e){let e=n.one(i.node,t);e!=null&&r.push(e)}return r}function l(e,t){if(e.length===0)return[];if(e.every(e=>e.marks.length===0))return c(e,t);let n=i(e);if(n.length>0){let r=n[0];return s(r,t,l(e.map(e=>({node:e.node,marks:a(e.marks,r)})),t))}let r=[],u=[e[0]],d=e[0].marks.slice();for(let t=1;t<e.length;t++){let n=e[t],i=o(d,n.marks),a=d.length===0&&n.marks.length===0;i.length>0||a?(u.push(n),d=a?[]:i):(r.push(u),u=[n],d=n.marks.slice())}if(r.push(u),r.length===1&&e.length>1){console.warn(`[mdast-util-from-prosemirror] degenerate mark partition; falling back to per-span rendering`,{spanCount:e.length,firstSpanMarks:e[0]?.marks.map(e=>e.type.name),lastSpanMarks:e[e.length-1]?.marks.map(e=>e.type.name)});let n=[];for(let r of e)for(let e of l([r],t))n.push(e);return n}let f=[];for(let e of r)for(let n of l(e,t))f.push(n);return f}function u(e){return l(e.children.map(e=>({node:e,marks:e.marks})),e)}return n}function LN(e,t){return IN(t.nodeHandlers,t.markHandlers).one(e)}function RN(e,t){return(n,r,i)=>{let a=i.all(n);return{type:e,...t?.(n),children:a}}}function zN(e,t){return(n,r,i)=>({type:e,...t?.(n),children:i})}var BN=r(a(((e,t)=>{(function(){var e=t===void 0?function(){return this||(0,eval)(`this`)}():t.exports=i;e.format=i,e.vsprintf=r,typeof console<`u`&&typeof console.log==`function`&&(e.printf=n);function n(){console.log(i.apply(null,arguments))}function r(e,t){return i.apply(null,[e].concat(t))}function i(e){for(var t=1,n=[].slice.call(arguments),r=0,i=e.length,a=``,o,s=!1,c,l,u=!1,d,f=function(){return n[t++]},p=function(){for(var t=``;/\d/.test(e[r]);)t+=e[r++],o=e[r];return t.length>0?parseInt(t):null};r<i;++r)if(o=e[r],s)switch(s=!1,o==`.`?(u=!1,o=e[++r]):o==`0`&&e[r+1]==`.`?(u=!0,r+=2,o=e[r]):u=!0,d=p(),o){case`b`:a+=parseInt(f(),10).toString(2);break;case`c`:c=f(),typeof c==`string`||c instanceof String?a+=c:a+=String.fromCharCode(parseInt(c,10));break;case`d`:a+=parseInt(f(),10);break;case`f`:l=String(parseFloat(f()).toFixed(d||6)),a+=u?l:l.replace(/^0/,``);break;case`j`:a+=JSON.stringify(f());break;case`o`:a+=`0`+parseInt(f(),10).toString(8);break;case`s`:a+=f();break;case`x`:a+=`0x`+parseInt(f(),10).toString(16);break;case`X`:a+=`0x`+parseInt(f(),10).toString(16).toUpperCase();break;default:a+=o;break}else o===`%`?s=!0:a+=o;return a}})()}))(),1),VN=Object.assign(HN(Error),{eval:HN(EvalError),range:HN(RangeError),reference:HN(ReferenceError),syntax:HN(SyntaxError),type:HN(TypeError),uri:HN(URIError)});function HN(e){return t.displayName=e.displayName||e.name,t;function t(t,...n){return new e(t&&(0,BN.default)(t,...n))}}var UN={}.hasOwnProperty,WN={yaml:`-`,toml:`+`};function GN(e){let t=[],n=-1,r=Array.isArray(e)?e:e?[e]:[`yaml`];for(;++n<r.length;)t[n]=KN(r[n]);return t}function KN(e){let t=e;if(typeof t==`string`){if(!UN.call(WN,t))throw VN("Missing matter definition for `%s`",t);t={type:t,marker:WN[t]}}else if(typeof t!=`object`)throw VN("Expected matter to be an object, not `%j`",t);if(!UN.call(t,`type`))throw VN("Missing `type` in matter `%j`",t);if(!UN.call(t,`fence`)&&!UN.call(t,`marker`))throw VN("Missing `marker` or `fence` in matter `%j`",t);return t}function qN(e){let t=GN(e),n={},r=-1;for(;++r<t.length;){let e=t[r],i=YN(e,`open`).charCodeAt(0),a=JN(e),o=n[i];Array.isArray(o)?o.push(a):n[i]=[a]}return{flow:n}}function JN(e){let t=e.anywhere,n=e.type,r=n+`Fence`,i=r+`Sequence`,a=n+`Value`,o={tokenize:u,partial:!0},s,c=0;return{tokenize:l,concrete:!0};function l(l,u,d){let f=this;return p;function p(a){let o=f.now();return o.column===1&&(o.line===1||t)&&(s=YN(e,`open`),c=0,a===s.charCodeAt(c))?(l.enter(n),l.enter(r),l.enter(i),m(a)):d(a)}function m(e){return c===s.length?(l.exit(i),h(e)?(l.enter(`whitespace`),g(e)):_(e)):e===s.charCodeAt(c++)?(l.consume(e),m):d(e)}function g(e){return h(e)?(l.consume(e),g):(l.exit(`whitespace`),_(e))}function _(t){return x(t)?(l.exit(r),l.enter(`lineEnding`),l.consume(t),l.exit(`lineEnding`),s=YN(e,`close`),c=0,l.attempt(o,S,v)):d(t)}function v(e){return e===null||x(e)?b(e):(l.enter(a),y(e))}function y(e){return e===null||x(e)?(l.exit(a),b(e)):(l.consume(e),y)}function b(e){return e===null?d(e):(l.enter(`lineEnding`),l.consume(e),l.exit(`lineEnding`),l.attempt(o,S,v))}function S(e){return l.exit(n),u(e)}}function u(e,t,n){let a=0;return o;function o(t){return t===s.charCodeAt(a)?(e.enter(r),e.enter(i),c(t)):n(t)}function c(t){return a===s.length?(e.exit(i),h(t)?(e.enter(`whitespace`),l(t)):u(t)):t===s.charCodeAt(a++)?(e.consume(t),c):n(t)}function l(t){return h(t)?(e.consume(t),l):(e.exit(`whitespace`),u(t))}function u(i){return i===null||x(i)?(e.exit(r),t(i)):n(i)}}}function YN(e,t){return e.marker?XN(e.marker,t).repeat(3):XN(e.fence,t)}function XN(e,t){return typeof e==`string`?e:e[t]}function ZN(e){let t=GN(e),n={},r={},i=-1;for(;++i<t.length;){let e=t[i];n[e.type]=QN(e),r[e.type]=$N,r[e.type+`Value`]=eP}return{enter:n,exit:r}}function QN(e){return t;function t(t){this.enter({type:e.type,value:``},t),this.buffer()}}function $N(e){let t=this.resume(),n=this.stack[this.stack.length-1];`value`in n,this.exit(e),n.value=t.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``)}function eP(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function tP(e){let t=[],n={},r=GN(e),i=-1;for(;++i<r.length;){let e=r[i];n[e.type]=nP(e);let a=rP(e,`open`);t.push({atBreak:!0,character:a.charAt(0),after:b(a.charAt(1))})}return{unsafe:t,handlers:n}}function nP(e){let t=rP(e,`open`),n=rP(e,`close`);return r;function r(e){return t+(e.value?`
344
+ `),i;function a(e){return r.stack.push(e),t;function t(){r.stack.pop()}}}function hN(e){throw Error("Cannot handle value `"+e+"`, expected node")}function gN(e){throw Error("Cannot handle unknown node `"+e.type+"`")}function _N(e,t){if(e.type===`definition`&&e.type===t.type)return 0}function vN(e,t){return aN(e,this,t)}function yN(e,t){return oN(e,this,t)}function bN(e,t){return uN(this,e,t)}function xN(e){let t=this;t.compiler=n;function n(n){return mN(n,{...t.data(`settings`),...e,extensions:t.data(`toMarkdownExtensions`)||[]})}}function SN(e,t,n,r){let i=new Map,a=new Map,o={all:c,definitionById:i,footnoteById:a,footnoteCounts:new Map,footnoteOrder:[],one:s};return D(r,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?i:a,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),o;function s(r,i){return AN(e,t,n,r,i,o)}function c(t){let n=[];if(`children`in t){let r=t.children,i=-1;for(;++i<r.length;){let a=o.one(r[i],t);if(a){let t=i?r[i-1]:void 0;if(t?.type===`break`&&t.data?.sourceStyle!==`html`){if(!Array.isArray(a)&&a.type===e.nodes.text){let t=EN(a.text);a=t.length>0?e.text(t):void 0}else if(!Array.isArray(a)&&a.type!==e.nodes.text){let t=a.firstChild;if(t&&t.type===e.nodes.text){let n=EN(t.text),r=U.from(a.content);a=a.copy(n.length>0?r.replaceChild(0,e.text(n)):r.cut(t.nodeSize))}}}}a&&(Array.isArray(a)?n.push(...a):n.push(a))}}return n}}function CN(e){return e.replaceAll(/\n([^\n])/g,` $1`)}function wN(e,t,n){let r=t.referenceType,i=`]`;if(r===`collapsed`?i+=`[]`:r===`full`&&(i+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[e.text(`![`+(t.alt??``)+i)];let a=n.all(t),o=a[0];o&&o.type===e.nodes.text?a[0]=o.copy(U.from(e.text(`[`+(o.text??``)))):a.unshift(e.text(`[`));let s=a[a.length-1];return s&&s.type===e.nodes.text?a[a.length-1]=s.copy(U.from(e.text((s.text??``)+i))):a.push(e.text(i)),a}function TN(e){throw Error(`unknown markdown node: ${e.type}`)}function EN(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function DN(){}function ON(e){throw Error("Expected node, not `"+JSON.stringify(e)+"`")}function kN(e,t,n,r){return fe(`tagName`,{handlers:e})(t,n,r)}function AN(e,t,n,r,i,a){return fe(`type`,{invalid:ON,unknown:TN,handlers:{toml:DN,yaml:DN,definition:DN,footnoteDefinition:DN,root(t,n,r){let i=r.all(t);return e.topNodeType.create(null,i)},html(t){let r=RA(t.value).children[0];if(r?.type!==`element`)return null;let[,i]=r.children;if(i?.type!==`element`)return null;let o=i.children[0];return o?.type===`element`?kN(n,o,void 0,a)||(t.value?e.text(t.value):null):null},text(t){let n=CN(De(String(t.value)));return n?e.text(n):null},...t,linkReference(n,r,i){if(t.linkReference)return t.linkReference(n,r,i);let a=String(n.identifier).toUpperCase(),o=i.definitionById.get(a);if(!o)return wN(e,n,i);let s={type:`link`,url:o.url,title:o.title,children:n.children,data:{...o.data,...n.data}};return t.link?.(s,r,i)}}})(r,i,a)}function jN(e,t){return(n,r,i)=>{let a=i.all(n);return e.createAndFill(t?.(n)??null,a)}}function MN(e,t){return(n,r,i)=>{let a=i.all(n),o=e.create(t?.(n)??null);return a.map(e=>e.mark(o.addToSet(e.marks)))}}var NN=function(e,t){let n=AN(t.schema,t.handlers,t.htmlHandlers??{},e,void 0,SN(t.schema,t.handlers,t.htmlHandlers??{},e));return n.check(),n},PN=function(e){this.compiler=function(t){return NN(t,e)}};function FN(e,t){let n={one:r,all:u,nodeHandlers:e,markHandlers:t};function r(e,t){let r=e.type.schema,i=e.type.name,a=n.nodeHandlers[i];if(a)return a(e,t,n);if(e.type===r.topNodeType){let t=n.all(e);return t.some(e=>v(e,`root`)),{type:`root`,children:t}}return e.type===r.nodes.text?{type:`text`,value:e.text}:null}function i(e){if(e.length===0)return[];let t=e[0].marks,n=[];for(let r of t){let t=!0;for(let n=1;n<e.length;n++)if(!e[n].marks.some(e=>e.eq(r))){t=!1;break}t&&n.push(r)}return n}function a(e,t){let n=e.findIndex(e=>e.eq(t));return n===-1?e:e.slice(0,n).concat(e.slice(n+1))}function o(e,t){let n=[];for(let r of e)t.some(e=>e.eq(r))&&n.push(r);return n}function s(e,t,r){let i=n.markHandlers[e.type.name];if(!i)return r;let a=i(e,t,r,n);return(Array.isArray(a)?a:[a]).filter(e=>e!=null)}function c(e,t){let r=[];for(let i of e){let e=n.one(i.node,t);e!=null&&r.push(e)}return r}function l(e,t){if(e.length===0)return[];if(e.every(e=>e.marks.length===0))return c(e,t);let n=i(e);if(n.length>0){let r=n[0];return s(r,t,l(e.map(e=>({node:e.node,marks:a(e.marks,r)})),t))}let r=[],u=[e[0]],d=e[0].marks.slice();for(let t=1;t<e.length;t++){let n=e[t],i=o(d,n.marks),a=d.length===0&&n.marks.length===0;i.length>0||a?(u.push(n),d=a?[]:i):(r.push(u),u=[n],d=n.marks.slice())}if(r.push(u),r.length===1&&e.length>1){console.warn(`[mdast-util-from-prosemirror] degenerate mark partition; falling back to per-span rendering`,{spanCount:e.length,firstSpanMarks:e[0]?.marks.map(e=>e.type.name),lastSpanMarks:e[e.length-1]?.marks.map(e=>e.type.name)});let n=[];for(let r of e)for(let e of l([r],t))n.push(e);return n}let f=[];for(let e of r)for(let n of l(e,t))f.push(n);return f}function u(e){return l(e.children.map(e=>({node:e,marks:e.marks})),e)}return n}function IN(e,t){return FN(t.nodeHandlers,t.markHandlers).one(e)}function LN(e,t){return(n,r,i)=>{let a=i.all(n);return{type:e,...t?.(n),children:a}}}function RN(e,t){return(n,r,i)=>({type:e,...t?.(n),children:i})}var zN=r(a(((e,t)=>{(function(){var e=t===void 0?function(){return this||(0,eval)(`this`)}():t.exports=i;e.format=i,e.vsprintf=r,typeof console<`u`&&typeof console.log==`function`&&(e.printf=n);function n(){console.log(i.apply(null,arguments))}function r(e,t){return i.apply(null,[e].concat(t))}function i(e){for(var t=1,n=[].slice.call(arguments),r=0,i=e.length,a=``,o,s=!1,c,l,u=!1,d,f=function(){return n[t++]},p=function(){for(var t=``;/\d/.test(e[r]);)t+=e[r++],o=e[r];return t.length>0?parseInt(t):null};r<i;++r)if(o=e[r],s)switch(s=!1,o==`.`?(u=!1,o=e[++r]):o==`0`&&e[r+1]==`.`?(u=!0,r+=2,o=e[r]):u=!0,d=p(),o){case`b`:a+=parseInt(f(),10).toString(2);break;case`c`:c=f(),typeof c==`string`||c instanceof String?a+=c:a+=String.fromCharCode(parseInt(c,10));break;case`d`:a+=parseInt(f(),10);break;case`f`:l=String(parseFloat(f()).toFixed(d||6)),a+=u?l:l.replace(/^0/,``);break;case`j`:a+=JSON.stringify(f());break;case`o`:a+=`0`+parseInt(f(),10).toString(8);break;case`s`:a+=f();break;case`x`:a+=`0x`+parseInt(f(),10).toString(16);break;case`X`:a+=`0x`+parseInt(f(),10).toString(16).toUpperCase();break;default:a+=o;break}else o===`%`?s=!0:a+=o;return a}})()}))(),1),BN=Object.assign(VN(Error),{eval:VN(EvalError),range:VN(RangeError),reference:VN(ReferenceError),syntax:VN(SyntaxError),type:VN(TypeError),uri:VN(URIError)});function VN(e){return t.displayName=e.displayName||e.name,t;function t(t,...n){return new e(t&&(0,zN.default)(t,...n))}}var HN={}.hasOwnProperty,UN={yaml:`-`,toml:`+`};function WN(e){let t=[],n=-1,r=Array.isArray(e)?e:e?[e]:[`yaml`];for(;++n<r.length;)t[n]=GN(r[n]);return t}function GN(e){let t=e;if(typeof t==`string`){if(!HN.call(UN,t))throw BN("Missing matter definition for `%s`",t);t={type:t,marker:UN[t]}}else if(typeof t!=`object`)throw BN("Expected matter to be an object, not `%j`",t);if(!HN.call(t,`type`))throw BN("Missing `type` in matter `%j`",t);if(!HN.call(t,`fence`)&&!HN.call(t,`marker`))throw BN("Missing `marker` or `fence` in matter `%j`",t);return t}function KN(e){let t=WN(e),n={},r=-1;for(;++r<t.length;){let e=t[r],i=JN(e,`open`).charCodeAt(0),a=qN(e),o=n[i];Array.isArray(o)?o.push(a):n[i]=[a]}return{flow:n}}function qN(e){let t=e.anywhere,n=e.type,r=n+`Fence`,i=r+`Sequence`,a=n+`Value`,o={tokenize:u,partial:!0},s,c=0;return{tokenize:l,concrete:!0};function l(l,u,d){let f=this;return p;function p(a){let o=f.now();return o.column===1&&(o.line===1||t)&&(s=JN(e,`open`),c=0,a===s.charCodeAt(c))?(l.enter(n),l.enter(r),l.enter(i),m(a)):d(a)}function m(e){return c===s.length?(l.exit(i),h(e)?(l.enter(`whitespace`),g(e)):_(e)):e===s.charCodeAt(c++)?(l.consume(e),m):d(e)}function g(e){return h(e)?(l.consume(e),g):(l.exit(`whitespace`),_(e))}function _(t){return x(t)?(l.exit(r),l.enter(`lineEnding`),l.consume(t),l.exit(`lineEnding`),s=JN(e,`close`),c=0,l.attempt(o,S,v)):d(t)}function v(e){return e===null||x(e)?b(e):(l.enter(a),y(e))}function y(e){return e===null||x(e)?(l.exit(a),b(e)):(l.consume(e),y)}function b(e){return e===null?d(e):(l.enter(`lineEnding`),l.consume(e),l.exit(`lineEnding`),l.attempt(o,S,v))}function S(e){return l.exit(n),u(e)}}function u(e,t,n){let a=0;return o;function o(t){return t===s.charCodeAt(a)?(e.enter(r),e.enter(i),c(t)):n(t)}function c(t){return a===s.length?(e.exit(i),h(t)?(e.enter(`whitespace`),l(t)):u(t)):t===s.charCodeAt(a++)?(e.consume(t),c):n(t)}function l(t){return h(t)?(e.consume(t),l):(e.exit(`whitespace`),u(t))}function u(i){return i===null||x(i)?(e.exit(r),t(i)):n(i)}}}function JN(e,t){return e.marker?YN(e.marker,t).repeat(3):YN(e.fence,t)}function YN(e,t){return typeof e==`string`?e:e[t]}function XN(e){let t=WN(e),n={},r={},i=-1;for(;++i<t.length;){let e=t[i];n[e.type]=ZN(e),r[e.type]=QN,r[e.type+`Value`]=$N}return{enter:n,exit:r}}function ZN(e){return t;function t(t){this.enter({type:e.type,value:``},t),this.buffer()}}function QN(e){let t=this.resume(),n=this.stack[this.stack.length-1];`value`in n,this.exit(e),n.value=t.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``)}function $N(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function eP(e){let t=[],n={},r=WN(e),i=-1;for(;++i<r.length;){let e=r[i];n[e.type]=tP(e);let a=nP(e,`open`);t.push({atBreak:!0,character:a.charAt(0),after:b(a.charAt(1))})}return{unsafe:t,handlers:n}}function tP(e){let t=nP(e,`open`),n=nP(e,`close`);return r;function r(e){return t+(e.value?`
345
345
  `+e.value:``)+`
346
- `+n}}function rP(e,t){return e.marker?iP(e.marker,t).repeat(3):iP(e.fence,t)}function iP(e,t){return typeof e==`string`?e:e[t]}var aP=`yaml`;function oP(e){let t=this,n=e||aP,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(qN(n)),a.push(ZN(n)),o.push(tP(n))}function sP(e){return e.charAt(0).toUpperCase()+e.slice(1)}var cP={note:`<svg class="octicon octicon-info mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></svg>`,tip:`<svg class="octicon octicon-light-bulb mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z"></path></svg>`,important:`<svg class="octicon octicon-report mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg>`,warning:`<svg class="octicon octicon-alert mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg>`,caution:`<svg class="octicon octicon-stop mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></svg>`};function lP(e){return e.replace(`<svg`,~e.indexOf(`xmlns`)?`<svg`:`<svg xmlns="http://www.w3.org/2000/svg"`).replaceAll(`"`,`'`).replaceAll(`%`,`%25`).replaceAll(`#`,`%23`).replaceAll(`{`,`%7B`).replaceAll(`}`,`%7D`).replaceAll(`<`,`%3C`).replaceAll(`>`,`%3E`)}var uP=(e={})=>{let{markers:t=[`TIP`,`NOTE`,`IMPORTANT`,`WARNING`,`CAUTION`],icons:n=cP,matchCaseSensitive:r=!1,titles:i={},classPrefix:a=`markdown-alert`,ignoreSquareBracket:o=!1}=e,s=t===`*`?`\\w+`:t.join(`|`),c=RegExp(o?`^!(${s})([^\\n\\r]*)`:`^\\[\\!(${s})\\]([^\\n\\r]*)`,r?``:`i`);return e=>(D(e,`blockquote`,(e,t,r)=>{let o=e.children[0];if(!o)return;let s=o.children?.[0];if(!s||(!(`value`in s)&&`children`in s&&s.children[0]&&(s=s.children[0]),s.type!==`text`))return;let l=s.value.match(c);if(!l)return;let u=l[1]?.toLowerCase(),d=l[2]?.trim()||(i[u]??sP(u)),f=n[u],p=`data:image/svg+xml;utf8,${lP(f)}`;t===void 0||!r||(s.value=s.value.slice(l[0].length).trimStart(),e.data={hName:`div`,hProperties:{class:`${a} ${a}-${u}`}},e.children=[{type:`paragraph`,data:{hName:`p`,hProperties:{class:`${a}-title`}},children:[{type:`span`,data:{hName:`span`,hProperties:{class:`octicon octicon-${u}`,style:`--oct-icon: url("${p}")`}}},{type:`text`,value:d}]},...e.children])}),e)};function dP(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:a},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:s,mathText:o,mathTextData:s}};function e(e){this.enter({type:`math`,meta:null,value:``,data:{hName:`pre`,hChildren:[{type:`element`,tagName:`code`,properties:{className:[`language-math`,`math-display`]},children:[]}]}},e)}function t(){this.buffer()}function n(){let e=this.resume(),t=this.stack[this.stack.length-1];t.type,t.meta=e}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(e){let t=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t;let r=n.data.hChildren[0];r.type,r.tagName,r.children.push({type:`text`,value:t}),this.data.mathFlowInside=void 0}function a(e){this.enter({type:`inlineMath`,value:``,data:{hName:`code`,hProperties:{className:[`language-math`,`math-inline`]},hChildren:[]}},e),this.buffer()}function o(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t,n.data.hChildren.push({type:`text`,value:t})}function s(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}}function fP(e){let t=(e||{}).singleDollarTextMath;return t??=!0,r.peek=i,{unsafe:[{character:`\r`,inConstruct:`mathFlowMeta`},{character:`
346
+ `+n}}function nP(e,t){return e.marker?rP(e.marker,t).repeat(3):rP(e.fence,t)}function rP(e,t){return typeof e==`string`?e:e[t]}var iP=`yaml`;function aP(e){let t=this,n=e||iP,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(KN(n)),a.push(XN(n)),o.push(eP(n))}function oP(e){return e.charAt(0).toUpperCase()+e.slice(1)}var sP={note:`<svg class="octicon octicon-info mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></svg>`,tip:`<svg class="octicon octicon-light-bulb mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z"></path></svg>`,important:`<svg class="octicon octicon-report mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg>`,warning:`<svg class="octicon octicon-alert mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg>`,caution:`<svg class="octicon octicon-stop mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></svg>`};function cP(e){return e.replace(`<svg`,~e.indexOf(`xmlns`)?`<svg`:`<svg xmlns="http://www.w3.org/2000/svg"`).replaceAll(`"`,`'`).replaceAll(`%`,`%25`).replaceAll(`#`,`%23`).replaceAll(`{`,`%7B`).replaceAll(`}`,`%7D`).replaceAll(`<`,`%3C`).replaceAll(`>`,`%3E`)}var lP=(e={})=>{let{markers:t=[`TIP`,`NOTE`,`IMPORTANT`,`WARNING`,`CAUTION`],icons:n=sP,matchCaseSensitive:r=!1,titles:i={},classPrefix:a=`markdown-alert`,ignoreSquareBracket:o=!1}=e,s=t===`*`?`\\w+`:t.join(`|`),c=RegExp(o?`^!(${s})([^\\n\\r]*)`:`^\\[\\!(${s})\\]([^\\n\\r]*)`,r?``:`i`);return e=>(D(e,`blockquote`,(e,t,r)=>{let o=e.children[0];if(!o)return;let s=o.children?.[0];if(!s||(!(`value`in s)&&`children`in s&&s.children[0]&&(s=s.children[0]),s.type!==`text`))return;let l=s.value.match(c);if(!l)return;let u=l[1]?.toLowerCase(),d=l[2]?.trim()||(i[u]??oP(u)),f=n[u],p=`data:image/svg+xml;utf8,${cP(f)}`;t===void 0||!r||(s.value=s.value.slice(l[0].length).trimStart(),e.data={hName:`div`,hProperties:{class:`${a} ${a}-${u}`}},e.children=[{type:`paragraph`,data:{hName:`p`,hProperties:{class:`${a}-title`}},children:[{type:`span`,data:{hName:`span`,hProperties:{class:`octicon octicon-${u}`,style:`--oct-icon: url("${p}")`}}},{type:`text`,value:d}]},...e.children])}),e)};function uP(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:a},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:s,mathText:o,mathTextData:s}};function e(e){this.enter({type:`math`,meta:null,value:``,data:{hName:`pre`,hChildren:[{type:`element`,tagName:`code`,properties:{className:[`language-math`,`math-display`]},children:[]}]}},e)}function t(){this.buffer()}function n(){let e=this.resume(),t=this.stack[this.stack.length-1];t.type,t.meta=e}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(e){let t=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t;let r=n.data.hChildren[0];r.type,r.tagName,r.children.push({type:`text`,value:t}),this.data.mathFlowInside=void 0}function a(e){this.enter({type:`inlineMath`,value:``,data:{hName:`code`,hProperties:{className:[`language-math`,`math-inline`]},hChildren:[]}},e),this.buffer()}function o(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t,n.data.hChildren.push({type:`text`,value:t})}function s(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}}function dP(e){let t=(e||{}).singleDollarTextMath;return t??=!0,r.peek=i,{unsafe:[{character:`\r`,inConstruct:`mathFlowMeta`},{character:`
347
347
  `,inConstruct:`mathFlowMeta`},{character:`$`,after:t?void 0:`\\$`,inConstruct:`phrasing`},{character:`$`,inConstruct:`mathFlowMeta`},{atBreak:!0,character:`$`,after:`\\$`}],handlers:{math:n,inlineMath:r}};function n(e,t,n,r){let i=e.value||``,a=n.createTracker(r),o=`$`.repeat(Math.max(pe(i,`$`)+1,2)),s=n.enter(`mathFlow`),c=a.move(o);if(e.meta){let t=n.enter(`mathFlowMeta`);c+=a.move(n.safe(e.meta,{after:`
348
348
  `,before:c,encode:[`$`],...a.current()})),t()}return c+=a.move(`
349
349
  `),i&&(c+=a.move(i+`
350
- `)),c+=a.move(o),s(),c}function r(e,n,r){let i=e.value||``,a=1;for(t||a++;RegExp(`(^|[^$])`+`\\$`.repeat(a)+`([^$]|$)`).test(i);)a++;let o=`$`.repeat(a);/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^\$|\$$/.test(i))&&(i=` `+i+` `);let s=-1;for(;++s<r.unsafe.length;){let e=r.unsafe[s];if(!e.atBreak)continue;let t=r.compilePattern(e),n;for(;n=t.exec(i);){let e=n.index;i.codePointAt(e)===10&&i.codePointAt(e-1)===13&&e--,i=i.slice(0,e)+` `+i.slice(n.index+1)}}return o+i+o}function i(){return`$`}}var pP={tokenize:hP,concrete:!0,name:`mathFlow`},mP={tokenize:gP,partial:!0};function hP(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){return e.enter(`mathFlow`),e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),c(t)}function c(t){return t===36?(e.consume(t),o++,c):o<2?n(t):(e.exit(`mathFlowFenceSequence`),ae(e,l,`whitespace`)(t))}function l(t){return t===null||x(t)?d(t):(e.enter(`mathFlowFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===null||x(t)?(e.exit(`chunkString`),e.exit(`mathFlowFenceMeta`),d(t)):t===36?n(t):(e.consume(t),u)}function d(n){return e.exit(`mathFlowFence`),r.interrupt?t(n):e.attempt(mP,f,g)(n)}function f(t){return e.attempt({tokenize:_,partial:!0},g,p)(t)}function p(t){return(a?ae(e,m,`linePrefix`,a+1):m)(t)}function m(t){return t===null?g(t):x(t)?e.attempt(mP,f,g)(t):(e.enter(`mathFlowValue`),h(t))}function h(t){return t===null||x(t)?(e.exit(`mathFlowValue`),m(t)):(e.consume(t),h)}function g(n){return e.exit(`mathFlow`),t(n)}function _(e,t,n){let i=0;return ae(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4);function a(t){return e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),s(t)}function s(t){return t===36?(i++,e.consume(t),s):i<o?n(t):(e.exit(`mathFlowFenceSequence`),ae(e,c,`whitespace`)(t))}function c(r){return r===null||x(r)?(e.exit(`mathFlowFence`),t(r)):n(r)}}}function gP(e,t,n){let r=this;return i;function i(n){return n===null?t(n):(e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function _P(e){let t=(e||{}).singleDollarTextMath;return t??=!0,{tokenize:n,resolve:vP,previous:yP,name:`mathText`};function n(e,n,r){let i=0,a,o;return s;function s(t){return e.enter(`mathText`),e.enter(`mathTextSequence`),c(t)}function c(n){return n===36?(e.consume(n),i++,c):i<2&&!t?r(n):(e.exit(`mathTextSequence`),l(n))}function l(t){return t===null?r(t):t===36?(o=e.enter(`mathTextSequence`),a=0,d(t)):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),l):x(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),l):(e.enter(`mathTextData`),u(t))}function u(t){return t===null||t===32||t===36||x(t)?(e.exit(`mathTextData`),l(t)):(e.consume(t),u)}function d(t){return t===36?(e.consume(t),a++,d):a===i?(e.exit(`mathTextSequence`),e.exit(`mathText`),n(t)):(o.type=`mathTextData`,u(t))}}}function vP(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`mathTextData`){e[t][1].type=`mathTextPadding`,e[n][1].type=`mathTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`mathTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function yP(e){return e!==36||this.events[this.events.length-1][1].type===`characterEscape`}function bP(e){return{flow:{36:pP},text:{36:_P(e)}}}var xP={};function SP(e){let t=this,n=e||xP,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(bP(n)),a.push(dP()),o.push(fP(n))}function CP(){return{enter:{mdxFlowExpression:TP,mdxTextExpression:EP},exit:{mdxFlowExpression:DP,mdxFlowExpressionChunk:OP,mdxTextExpression:DP,mdxTextExpressionChunk:OP}}}function wP(){return{handlers:{mdxFlowExpression:kP,mdxTextExpression:kP},unsafe:[{character:`{`,inConstruct:[`phrasing`]},{atBreak:!0,character:`{`}]}}function TP(e){this.enter({type:`mdxFlowExpression`,value:``},e),this.buffer()}function EP(e){this.enter({type:`mdxTextExpression`,value:``},e),this.buffer()}function DP(e){let t=this.resume(),n=e.estree,r=this.stack[this.stack.length-1];r.type===`mdxFlowExpression`||r.type,this.exit(e),r.value=t,n&&(r.data={estree:n})}function OP(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function kP(e,t,n){let r=e.value||``;return`{`+n.indentLines(r,function(e,t,n){return(t===0||n?``:` `)+e})+`}`}var AP=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),jP={0:`�`,128:`€`,130:`‚`,131:`ƒ`,132:`„`,133:`…`,134:`†`,135:`‡`,136:`ˆ`,137:`‰`,138:`Š`,139:`‹`,140:`Œ`,142:`Ž`,145:`‘`,146:`’`,147:`“`,148:`”`,149:`•`,150:`–`,151:`—`,152:`˜`,153:`™`,154:`š`,155:`›`,156:`œ`,158:`ž`,159:`Ÿ`};function MP(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=48&&t<=57}function NP(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function PP(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function FP(e){return PP(e)||MP(e)}var IP=[``,`Named character references must be terminated by a semicolon`,`Numeric character references must be terminated by a semicolon`,`Named character references cannot be empty`,`Numeric character references cannot be empty`,`Named character references must be known`,`Numeric character references cannot be disallowed`,`Numeric character references cannot be outside the permissible Unicode range`];function LP(e,t){let n=t||{},r=typeof n.additional==`string`?n.additional.charCodeAt(0):n.additional,i=[],a=0,o=-1,s=``,c,l;n.position&&(`start`in n.position||`indent`in n.position?(l=n.position.indent,c=n.position.start):c=n.position);let u=(c?c.line:0)||1,d=(c?c.column:0)||1,p=h(),m;for(a--;++a<=e.length;)if(m===10&&(d=(l?l[o]:0)||1),m=e.charCodeAt(a),m===38){let t=e.charCodeAt(a+1);if(t===9||t===10||t===12||t===32||t===38||t===60||Number.isNaN(t)||r&&t===r){s+=String.fromCharCode(m),d++;continue}let o=a+1,c=o,l=o,u;if(t===35){l=++c;let t=e.charCodeAt(l);t===88||t===120?(u=`hexadecimal`,l=++c):u=`decimal`}else u=`named`;let v=``,y=``,b=``,x=u===`named`?FP:u===`decimal`?MP:NP;for(l--;++l<=e.length;){let t=e.charCodeAt(l);if(!x(t))break;b+=String.fromCharCode(t),u===`named`&&AP.includes(b)&&(v=b,y=f(b))}let S=e.charCodeAt(l)===59;if(S){l++;let e=u===`named`?f(b):!1;e&&(v=b,y=e)}let C=1+l-o,w=``;if(!(!S&&n.nonTerminated===!1))if(!b)u!==`named`&&g(4,C);else if(u===`named`){if(S&&!y)g(5,1);else if(v!==b&&(l=c+v.length,C=1+l-c,S=!1),!S){let t=v?1:3;if(n.attribute){let n=e.charCodeAt(l);n===61?(g(t,C),y=``):FP(n)?y=``:g(t,C)}else g(t,C)}w=y}else{S||g(2,C);let e=Number.parseInt(b,u===`hexadecimal`?16:10);if(RP(e))g(7,C),w=`�`;else if(e in jP)g(6,C),w=jP[e];else{let t=``;zP(e)&&g(6,C),e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10|55296),e=56320|e&1023),w=t+String.fromCharCode(e)}}if(w){_(),p=h(),a=l-1,d+=l-o+1,i.push(w);let t=h();t.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,w,{start:p,end:t},e.slice(o-1,l)),p=t}else b=e.slice(o-1,l),s+=b,d+=b.length,a=l-1}else m===10&&(u++,o++,d=0),Number.isNaN(m)?_():(s+=String.fromCharCode(m),d++);return i.join(``);function h(){return{line:u,column:d,offset:a+((c?c.offset:0)||0)}}function g(e,t){let r;n.warning&&(r=h(),r.column+=t,r.offset+=t,n.warning.call(n.warningContext||void 0,IP[e],r,e))}function _(){s&&=(i.push(s),n.text&&n.text.call(n.textContext||void 0,s,{start:p,end:h()}),``)}}function RP(e){return e>=55296&&e<=57343||e>1114111}function zP(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534}var BP=/["&'<>`]/g,VP=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,HP=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,UP=/[|\\{}()[\]^$+*?.]/g,WP=new WeakMap;function GP(e,t){if(e=e.replace(t.subset?KP(t.subset):BP,r),t.subset||t.escapeOnly)return e;return e.replace(VP,n).replace(HP,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function KP(e){let t=WP.get(e);return t||(t=qP(e),WP.set(e,t)),t}function qP(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(UP,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var JP=/[\dA-Fa-f]/;function YP(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!JP.test(String.fromCharCode(t))?r:r+`;`}var XP=/\d/;function ZP(e,t,n){let r=`&#`+String(e);return n&&t&&!XP.test(String.fromCharCode(t))?r:r+`;`}var QP={nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:`­`,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,fnof:`ƒ`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,bull:`•`,hellip:`…`,prime:`′`,Prime:`″`,oline:`‾`,frasl:`⁄`,weierp:`℘`,image:`ℑ`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`,quot:`"`,amp:`&`,lt:`<`,gt:`>`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,circ:`ˆ`,tilde:`˜`,ensp:` `,emsp:` `,thinsp:` `,zwnj:`‌`,zwj:`‍`,lrm:`‎`,rlm:`‏`,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,permil:`‰`,lsaquo:`‹`,rsaquo:`›`,euro:`€`},$P=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],eF={}.hasOwnProperty,tF={},nF;for(nF in QP)eF.call(QP,nF)&&(tF[QP[nF]]=nF);var rF=/[^\dA-Za-z]/;function iF(e,t,n,r){let i=String.fromCharCode(e);if(eF.call(tF,i)){let e=tF[i],a=`&`+e;return n&&AP.includes(e)&&!$P.includes(e)&&(!r||t&&t!==61&&rF.test(String.fromCharCode(t)))?a:a+`;`}return``}function aF(e,t,n){let r=YP(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=iF(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=ZP(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function oF(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function sF(e,t){return GP(e,Object.assign({format:aF},t))}function cF(e,t){return GP(e,Object.assign({format:oF},t))}var lF=` `;function uF(){return{canContainEols:[`mdxJsxTextElement`],enter:{mdxJsxFlowTag:r,mdxJsxFlowTagClosingMarker:i,mdxJsxFlowTagAttribute:d,mdxJsxFlowTagExpressionAttribute:f,mdxJsxFlowTagAttributeValueLiteral:e,mdxJsxFlowTagAttributeValueExpression:e,mdxJsxFlowTagSelfClosingMarker:o,mdxJsxTextTag:r,mdxJsxTextTagClosingMarker:i,mdxJsxTextTagAttribute:d,mdxJsxTextTagExpressionAttribute:f,mdxJsxTextTagAttributeValueLiteral:e,mdxJsxTextTagAttributeValueExpression:e,mdxJsxTextTagSelfClosingMarker:o},exit:{mdxJsxFlowTagClosingMarker:s,mdxJsxFlowTagNamePrimary:c,mdxJsxFlowTagNameMember:l,mdxJsxFlowTagNameLocal:u,mdxJsxFlowTagExpressionAttribute:p,mdxJsxFlowTagExpressionAttributeValue:n,mdxJsxFlowTagAttributeNamePrimary:m,mdxJsxFlowTagAttributeNameLocal:h,mdxJsxFlowTagAttributeValueLiteral:g,mdxJsxFlowTagAttributeValueLiteralValue:n,mdxJsxFlowTagAttributeValueExpression:_,mdxJsxFlowTagAttributeValueExpressionValue:n,mdxJsxFlowTagSelfClosingMarker:v,mdxJsxFlowTag:y,mdxJsxTextTagClosingMarker:s,mdxJsxTextTagNamePrimary:c,mdxJsxTextTagNameMember:l,mdxJsxTextTagNameLocal:u,mdxJsxTextTagExpressionAttribute:p,mdxJsxTextTagExpressionAttributeValue:n,mdxJsxTextTagAttributeNamePrimary:m,mdxJsxTextTagAttributeNameLocal:h,mdxJsxTextTagAttributeValueLiteral:g,mdxJsxTextTagAttributeValueLiteralValue:n,mdxJsxTextTagAttributeValueExpression:_,mdxJsxTextTagAttributeValueExpressionValue:n,mdxJsxTextTagSelfClosingMarker:v,mdxJsxTextTag:y}};function e(){this.buffer()}function t(e){return{line:e.line,column:e.column,offset:e.offset}}function n(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function r(e){let t={name:void 0,attributes:[],close:!1,selfClosing:!1,start:e.start,end:e.end};this.data.mdxJsxTagStack||(this.data.mdxJsxTagStack=[]),this.data.mdxJsxTag=t,this.buffer()}function i(e){if(this.data.mdxJsxTagStack.length===0)throw new xe("Unexpected closing slash `/` in tag, expected an open tag first",{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-closing-slash`)}function a(e){if(this.data.mdxJsxTag.close)throw new xe(`Unexpected attribute in closing tag, expected the end of the tag`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-attribute`)}function o(e){if(this.data.mdxJsxTag.close)throw new xe("Unexpected self-closing slash `/` in closing tag, expected the end of the tag",{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-self-closing-slash`)}function s(){let e=this.data.mdxJsxTag;e.close=!0}function c(e){let t=this.data.mdxJsxTag;t.name=this.sliceSerialize(e)}function l(e){let t=this.data.mdxJsxTag;t.name+=`.`+this.sliceSerialize(e)}function u(e){let t=this.data.mdxJsxTag;t.name+=`:`+this.sliceSerialize(e)}function d(e){let n=this.data.mdxJsxTag;a.call(this,e),n.attributes.push({type:`mdxJsxAttribute`,name:``,value:null,position:{start:t(e.start),end:void 0}})}function f(e){let n=this.data.mdxJsxTag;a.call(this,e),n.attributes.push({type:`mdxJsxExpressionAttribute`,value:``,position:{start:t(e.start),end:void 0}}),this.buffer()}function p(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type;let i=e.estree;r.value=this.resume(),r.position,r.position.end=t(e.end),i&&(r.data={estree:i})}function m(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name=this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function h(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name+=`:`+this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function g(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.value=LP(this.resume(),{nonTerminated:!1}),r.position,r.position.end=t(e.end)}function _(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type;let i={type:`mdxJsxAttributeValueExpression`,value:this.resume()},a=e.estree;a&&(i.data={estree:a}),r.value=i,r.position,r.position.end=t(e.end)}function v(){let e=this.data.mdxJsxTag;e.selfClosing=!0}function y(e){let t=this.data.mdxJsxTag,n=this.data.mdxJsxTagStack,r=n[n.length-1];if(t.close&&r.name!==t.name)throw new xe("Unexpected closing tag `"+S(t)+"`, expected corresponding closing tag for `"+S(r)+"` ("+_e(r)+`)`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:end-tag-mismatch`);this.resume(),t.close?n.pop():this.enter({type:e.type===`mdxJsxTextTag`?`mdxJsxTextElement`:`mdxJsxFlowElement`,name:t.name||null,attributes:t.attributes,children:[]},e,b),t.selfClosing||t.close?this.exit(e,x):n.push(t)}function b(e,t){let n=this.data.mdxJsxTagStack,r=n[n.length-1],i=e?" before the end of `"+e.type+"`":``,a=e?{start:e.start,end:e.end}:void 0;throw new xe("Expected a closing tag for `"+S(r)+"` ("+_e({start:t.start,end:t.end})+`)`+i,a,`mdast-util-mdx-jsx:end-tag-mismatch`)}function x(e,t){let n=this.data.mdxJsxTag;throw new xe("Expected the closing tag `"+S(n)+"` either after the end of `"+t.type+"` ("+_e(t.end)+") or another opening tag after the start of `"+t.type+"` ("+_e(t.start)+`)`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:end-tag-mismatch`)}function S(e){return`<`+(e.close?`/`:``)+(e.name||``)+`>`}}function dF(e){let t=e||{},n=t.quote||`"`,r=t.quoteSmart||!1,i=t.tightSelfClosing||!1,a=t.printWidth||1/0,o=n===`"`?`'`:`"`;if(n!==`"`&&n!==`'`)throw Error("Cannot serialize attribute values with `"+n+"` for `options.quote`, expected `\"`, or `'`");return s.peek=hF,{handlers:{mdxJsxFlowElement:s,mdxJsxTextElement:s},unsafe:[{character:`<`,inConstruct:[`phrasing`]},{atBreak:!0,character:`<`}],fences:!0,resourceLink:!0};function s(e,t,s,c){let l=e.type===`mdxJsxFlowElement`,u=e.name?!e.children||e.children.length===0:!1,d=mF(pF(s)),f=s.createTracker(c),p=s.createTracker(c),m=[],h=(l?d:``)+`<`+(e.name||``),g=s.enter(e.type);if(f.move(h),p.move(h),e.attributes&&e.attributes.length>0){if(!e.name)throw Error(`Cannot serialize fragment w/ attributes`);let t=-1;for(;++t<e.attributes.length;){let i=e.attributes[t],a;if(i.type===`mdxJsxExpressionAttribute`)a=`{`+(i.value||``)+`}`;else{if(!i.name)throw Error(`Cannot serialize attribute w/o name`);let e=i.value,t=i.name,s=``;if(e!=null)if(typeof e==`object`)s=`{`+(e.value||``)+`}`;else{let t=r&&T(e,n)>T(e,o)?o:n;s=t+cF(e,{subset:[t]})+t}a=t+(s?`=`:``)+s}m.push(a)}}let _=!1,v=m.join(` `);l&&(/\r?\n|\r/.test(v)||f.current().now.column+v.length+(u?i?2:3:1)>a)&&(_=!0);let y=f,b=h;if(_){y=p;let e=-1;for(;++e<m.length;)m[e]=d+lF+m[e];b+=y.move(`
350
+ `)),c+=a.move(o),s(),c}function r(e,n,r){let i=e.value||``,a=1;for(t||a++;RegExp(`(^|[^$])`+`\\$`.repeat(a)+`([^$]|$)`).test(i);)a++;let o=`$`.repeat(a);/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^\$|\$$/.test(i))&&(i=` `+i+` `);let s=-1;for(;++s<r.unsafe.length;){let e=r.unsafe[s];if(!e.atBreak)continue;let t=r.compilePattern(e),n;for(;n=t.exec(i);){let e=n.index;i.codePointAt(e)===10&&i.codePointAt(e-1)===13&&e--,i=i.slice(0,e)+` `+i.slice(n.index+1)}}return o+i+o}function i(){return`$`}}var fP={tokenize:mP,concrete:!0,name:`mathFlow`},pP={tokenize:hP,partial:!0};function mP(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){return e.enter(`mathFlow`),e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),c(t)}function c(t){return t===36?(e.consume(t),o++,c):o<2?n(t):(e.exit(`mathFlowFenceSequence`),ae(e,l,`whitespace`)(t))}function l(t){return t===null||x(t)?d(t):(e.enter(`mathFlowFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===null||x(t)?(e.exit(`chunkString`),e.exit(`mathFlowFenceMeta`),d(t)):t===36?n(t):(e.consume(t),u)}function d(n){return e.exit(`mathFlowFence`),r.interrupt?t(n):e.attempt(pP,f,g)(n)}function f(t){return e.attempt({tokenize:_,partial:!0},g,p)(t)}function p(t){return(a?ae(e,m,`linePrefix`,a+1):m)(t)}function m(t){return t===null?g(t):x(t)?e.attempt(pP,f,g)(t):(e.enter(`mathFlowValue`),h(t))}function h(t){return t===null||x(t)?(e.exit(`mathFlowValue`),m(t)):(e.consume(t),h)}function g(n){return e.exit(`mathFlow`),t(n)}function _(e,t,n){let i=0;return ae(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4);function a(t){return e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),s(t)}function s(t){return t===36?(i++,e.consume(t),s):i<o?n(t):(e.exit(`mathFlowFenceSequence`),ae(e,c,`whitespace`)(t))}function c(r){return r===null||x(r)?(e.exit(`mathFlowFence`),t(r)):n(r)}}}function hP(e,t,n){let r=this;return i;function i(n){return n===null?t(n):(e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function gP(e){let t=(e||{}).singleDollarTextMath;return t??=!0,{tokenize:n,resolve:_P,previous:vP,name:`mathText`};function n(e,n,r){let i=0,a,o;return s;function s(t){return e.enter(`mathText`),e.enter(`mathTextSequence`),c(t)}function c(n){return n===36?(e.consume(n),i++,c):i<2&&!t?r(n):(e.exit(`mathTextSequence`),l(n))}function l(t){return t===null?r(t):t===36?(o=e.enter(`mathTextSequence`),a=0,d(t)):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),l):x(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),l):(e.enter(`mathTextData`),u(t))}function u(t){return t===null||t===32||t===36||x(t)?(e.exit(`mathTextData`),l(t)):(e.consume(t),u)}function d(t){return t===36?(e.consume(t),a++,d):a===i?(e.exit(`mathTextSequence`),e.exit(`mathText`),n(t)):(o.type=`mathTextData`,u(t))}}}function _P(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`mathTextData`){e[t][1].type=`mathTextPadding`,e[n][1].type=`mathTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`mathTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function vP(e){return e!==36||this.events[this.events.length-1][1].type===`characterEscape`}function yP(e){return{flow:{36:fP},text:{36:gP(e)}}}var bP={};function xP(e){let t=this,n=e||bP,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(yP(n)),a.push(uP()),o.push(dP(n))}function SP(){return{enter:{mdxFlowExpression:wP,mdxTextExpression:TP},exit:{mdxFlowExpression:EP,mdxFlowExpressionChunk:DP,mdxTextExpression:EP,mdxTextExpressionChunk:DP}}}function CP(){return{handlers:{mdxFlowExpression:OP,mdxTextExpression:OP},unsafe:[{character:`{`,inConstruct:[`phrasing`]},{atBreak:!0,character:`{`}]}}function wP(e){this.enter({type:`mdxFlowExpression`,value:``},e),this.buffer()}function TP(e){this.enter({type:`mdxTextExpression`,value:``},e),this.buffer()}function EP(e){let t=this.resume(),n=e.estree,r=this.stack[this.stack.length-1];r.type===`mdxFlowExpression`||r.type,this.exit(e),r.value=t,n&&(r.data={estree:n})}function DP(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function OP(e,t,n){let r=e.value||``;return`{`+n.indentLines(r,function(e,t,n){return(t===0||n?``:` `)+e})+`}`}var kP=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),AP={0:`�`,128:`€`,130:`‚`,131:`ƒ`,132:`„`,133:`…`,134:`†`,135:`‡`,136:`ˆ`,137:`‰`,138:`Š`,139:`‹`,140:`Œ`,142:`Ž`,145:`‘`,146:`’`,147:`“`,148:`”`,149:`•`,150:`–`,151:`—`,152:`˜`,153:`™`,154:`š`,155:`›`,156:`œ`,158:`ž`,159:`Ÿ`};function jP(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=48&&t<=57}function MP(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function NP(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function PP(e){return NP(e)||jP(e)}var FP=[``,`Named character references must be terminated by a semicolon`,`Numeric character references must be terminated by a semicolon`,`Named character references cannot be empty`,`Numeric character references cannot be empty`,`Named character references must be known`,`Numeric character references cannot be disallowed`,`Numeric character references cannot be outside the permissible Unicode range`];function IP(e,t){let n=t||{},r=typeof n.additional==`string`?n.additional.charCodeAt(0):n.additional,i=[],a=0,o=-1,s=``,c,l;n.position&&(`start`in n.position||`indent`in n.position?(l=n.position.indent,c=n.position.start):c=n.position);let u=(c?c.line:0)||1,d=(c?c.column:0)||1,p=h(),m;for(a--;++a<=e.length;)if(m===10&&(d=(l?l[o]:0)||1),m=e.charCodeAt(a),m===38){let t=e.charCodeAt(a+1);if(t===9||t===10||t===12||t===32||t===38||t===60||Number.isNaN(t)||r&&t===r){s+=String.fromCharCode(m),d++;continue}let o=a+1,c=o,l=o,u;if(t===35){l=++c;let t=e.charCodeAt(l);t===88||t===120?(u=`hexadecimal`,l=++c):u=`decimal`}else u=`named`;let v=``,y=``,b=``,x=u===`named`?PP:u===`decimal`?jP:MP;for(l--;++l<=e.length;){let t=e.charCodeAt(l);if(!x(t))break;b+=String.fromCharCode(t),u===`named`&&kP.includes(b)&&(v=b,y=f(b))}let S=e.charCodeAt(l)===59;if(S){l++;let e=u===`named`?f(b):!1;e&&(v=b,y=e)}let C=1+l-o,w=``;if(!(!S&&n.nonTerminated===!1))if(!b)u!==`named`&&g(4,C);else if(u===`named`){if(S&&!y)g(5,1);else if(v!==b&&(l=c+v.length,C=1+l-c,S=!1),!S){let t=v?1:3;if(n.attribute){let n=e.charCodeAt(l);n===61?(g(t,C),y=``):PP(n)?y=``:g(t,C)}else g(t,C)}w=y}else{S||g(2,C);let e=Number.parseInt(b,u===`hexadecimal`?16:10);if(LP(e))g(7,C),w=`�`;else if(e in AP)g(6,C),w=AP[e];else{let t=``;RP(e)&&g(6,C),e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10|55296),e=56320|e&1023),w=t+String.fromCharCode(e)}}if(w){_(),p=h(),a=l-1,d+=l-o+1,i.push(w);let t=h();t.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,w,{start:p,end:t},e.slice(o-1,l)),p=t}else b=e.slice(o-1,l),s+=b,d+=b.length,a=l-1}else m===10&&(u++,o++,d=0),Number.isNaN(m)?_():(s+=String.fromCharCode(m),d++);return i.join(``);function h(){return{line:u,column:d,offset:a+((c?c.offset:0)||0)}}function g(e,t){let r;n.warning&&(r=h(),r.column+=t,r.offset+=t,n.warning.call(n.warningContext||void 0,FP[e],r,e))}function _(){s&&=(i.push(s),n.text&&n.text.call(n.textContext||void 0,s,{start:p,end:h()}),``)}}function LP(e){return e>=55296&&e<=57343||e>1114111}function RP(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534}var zP=/["&'<>`]/g,BP=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,VP=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,HP=/[|\\{}()[\]^$+*?.]/g,UP=new WeakMap;function WP(e,t){if(e=e.replace(t.subset?GP(t.subset):zP,r),t.subset||t.escapeOnly)return e;return e.replace(BP,n).replace(VP,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function GP(e){let t=UP.get(e);return t||(t=KP(e),UP.set(e,t)),t}function KP(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(HP,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var qP=/[\dA-Fa-f]/;function JP(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!qP.test(String.fromCharCode(t))?r:r+`;`}var YP=/\d/;function XP(e,t,n){let r=`&#`+String(e);return n&&t&&!YP.test(String.fromCharCode(t))?r:r+`;`}var ZP={nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:`­`,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,fnof:`ƒ`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,bull:`•`,hellip:`…`,prime:`′`,Prime:`″`,oline:`‾`,frasl:`⁄`,weierp:`℘`,image:`ℑ`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`,quot:`"`,amp:`&`,lt:`<`,gt:`>`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,circ:`ˆ`,tilde:`˜`,ensp:` `,emsp:` `,thinsp:` `,zwnj:`‌`,zwj:`‍`,lrm:`‎`,rlm:`‏`,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,permil:`‰`,lsaquo:`‹`,rsaquo:`›`,euro:`€`},QP=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],$P={}.hasOwnProperty,eF={},tF;for(tF in ZP)$P.call(ZP,tF)&&(eF[ZP[tF]]=tF);var nF=/[^\dA-Za-z]/;function rF(e,t,n,r){let i=String.fromCharCode(e);if($P.call(eF,i)){let e=eF[i],a=`&`+e;return n&&kP.includes(e)&&!QP.includes(e)&&(!r||t&&t!==61&&nF.test(String.fromCharCode(t)))?a:a+`;`}return``}function iF(e,t,n){let r=JP(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=rF(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=XP(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function aF(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function oF(e,t){return WP(e,Object.assign({format:iF},t))}function sF(e,t){return WP(e,Object.assign({format:aF},t))}var cF=` `;function lF(){return{canContainEols:[`mdxJsxTextElement`],enter:{mdxJsxFlowTag:r,mdxJsxFlowTagClosingMarker:i,mdxJsxFlowTagAttribute:d,mdxJsxFlowTagExpressionAttribute:f,mdxJsxFlowTagAttributeValueLiteral:e,mdxJsxFlowTagAttributeValueExpression:e,mdxJsxFlowTagSelfClosingMarker:o,mdxJsxTextTag:r,mdxJsxTextTagClosingMarker:i,mdxJsxTextTagAttribute:d,mdxJsxTextTagExpressionAttribute:f,mdxJsxTextTagAttributeValueLiteral:e,mdxJsxTextTagAttributeValueExpression:e,mdxJsxTextTagSelfClosingMarker:o},exit:{mdxJsxFlowTagClosingMarker:s,mdxJsxFlowTagNamePrimary:c,mdxJsxFlowTagNameMember:l,mdxJsxFlowTagNameLocal:u,mdxJsxFlowTagExpressionAttribute:p,mdxJsxFlowTagExpressionAttributeValue:n,mdxJsxFlowTagAttributeNamePrimary:m,mdxJsxFlowTagAttributeNameLocal:h,mdxJsxFlowTagAttributeValueLiteral:g,mdxJsxFlowTagAttributeValueLiteralValue:n,mdxJsxFlowTagAttributeValueExpression:_,mdxJsxFlowTagAttributeValueExpressionValue:n,mdxJsxFlowTagSelfClosingMarker:v,mdxJsxFlowTag:y,mdxJsxTextTagClosingMarker:s,mdxJsxTextTagNamePrimary:c,mdxJsxTextTagNameMember:l,mdxJsxTextTagNameLocal:u,mdxJsxTextTagExpressionAttribute:p,mdxJsxTextTagExpressionAttributeValue:n,mdxJsxTextTagAttributeNamePrimary:m,mdxJsxTextTagAttributeNameLocal:h,mdxJsxTextTagAttributeValueLiteral:g,mdxJsxTextTagAttributeValueLiteralValue:n,mdxJsxTextTagAttributeValueExpression:_,mdxJsxTextTagAttributeValueExpressionValue:n,mdxJsxTextTagSelfClosingMarker:v,mdxJsxTextTag:y}};function e(){this.buffer()}function t(e){return{line:e.line,column:e.column,offset:e.offset}}function n(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function r(e){let t={name:void 0,attributes:[],close:!1,selfClosing:!1,start:e.start,end:e.end};this.data.mdxJsxTagStack||(this.data.mdxJsxTagStack=[]),this.data.mdxJsxTag=t,this.buffer()}function i(e){if(this.data.mdxJsxTagStack.length===0)throw new xe("Unexpected closing slash `/` in tag, expected an open tag first",{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-closing-slash`)}function a(e){if(this.data.mdxJsxTag.close)throw new xe(`Unexpected attribute in closing tag, expected the end of the tag`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-attribute`)}function o(e){if(this.data.mdxJsxTag.close)throw new xe("Unexpected self-closing slash `/` in closing tag, expected the end of the tag",{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-self-closing-slash`)}function s(){let e=this.data.mdxJsxTag;e.close=!0}function c(e){let t=this.data.mdxJsxTag;t.name=this.sliceSerialize(e)}function l(e){let t=this.data.mdxJsxTag;t.name+=`.`+this.sliceSerialize(e)}function u(e){let t=this.data.mdxJsxTag;t.name+=`:`+this.sliceSerialize(e)}function d(e){let n=this.data.mdxJsxTag;a.call(this,e),n.attributes.push({type:`mdxJsxAttribute`,name:``,value:null,position:{start:t(e.start),end:void 0}})}function f(e){let n=this.data.mdxJsxTag;a.call(this,e),n.attributes.push({type:`mdxJsxExpressionAttribute`,value:``,position:{start:t(e.start),end:void 0}}),this.buffer()}function p(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type;let i=e.estree;r.value=this.resume(),r.position,r.position.end=t(e.end),i&&(r.data={estree:i})}function m(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name=this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function h(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name+=`:`+this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function g(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.value=IP(this.resume(),{nonTerminated:!1}),r.position,r.position.end=t(e.end)}function _(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type;let i={type:`mdxJsxAttributeValueExpression`,value:this.resume()},a=e.estree;a&&(i.data={estree:a}),r.value=i,r.position,r.position.end=t(e.end)}function v(){let e=this.data.mdxJsxTag;e.selfClosing=!0}function y(e){let t=this.data.mdxJsxTag,n=this.data.mdxJsxTagStack,r=n[n.length-1];if(t.close&&r.name!==t.name)throw new xe("Unexpected closing tag `"+S(t)+"`, expected corresponding closing tag for `"+S(r)+"` ("+_e(r)+`)`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:end-tag-mismatch`);this.resume(),t.close?n.pop():this.enter({type:e.type===`mdxJsxTextTag`?`mdxJsxTextElement`:`mdxJsxFlowElement`,name:t.name||null,attributes:t.attributes,children:[]},e,b),t.selfClosing||t.close?this.exit(e,x):n.push(t)}function b(e,t){let n=this.data.mdxJsxTagStack,r=n[n.length-1],i=e?" before the end of `"+e.type+"`":``,a=e?{start:e.start,end:e.end}:void 0;throw new xe("Expected a closing tag for `"+S(r)+"` ("+_e({start:t.start,end:t.end})+`)`+i,a,`mdast-util-mdx-jsx:end-tag-mismatch`)}function x(e,t){let n=this.data.mdxJsxTag;throw new xe("Expected the closing tag `"+S(n)+"` either after the end of `"+t.type+"` ("+_e(t.end)+") or another opening tag after the start of `"+t.type+"` ("+_e(t.start)+`)`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:end-tag-mismatch`)}function S(e){return`<`+(e.close?`/`:``)+(e.name||``)+`>`}}function uF(e){let t=e||{},n=t.quote||`"`,r=t.quoteSmart||!1,i=t.tightSelfClosing||!1,a=t.printWidth||1/0,o=n===`"`?`'`:`"`;if(n!==`"`&&n!==`'`)throw Error("Cannot serialize attribute values with `"+n+"` for `options.quote`, expected `\"`, or `'`");return s.peek=mF,{handlers:{mdxJsxFlowElement:s,mdxJsxTextElement:s},unsafe:[{character:`<`,inConstruct:[`phrasing`]},{atBreak:!0,character:`<`}],fences:!0,resourceLink:!0};function s(e,t,s,c){let l=e.type===`mdxJsxFlowElement`,u=e.name?!e.children||e.children.length===0:!1,d=pF(fF(s)),f=s.createTracker(c),p=s.createTracker(c),m=[],h=(l?d:``)+`<`+(e.name||``),g=s.enter(e.type);if(f.move(h),p.move(h),e.attributes&&e.attributes.length>0){if(!e.name)throw Error(`Cannot serialize fragment w/ attributes`);let t=-1;for(;++t<e.attributes.length;){let i=e.attributes[t],a;if(i.type===`mdxJsxExpressionAttribute`)a=`{`+(i.value||``)+`}`;else{if(!i.name)throw Error(`Cannot serialize attribute w/o name`);let e=i.value,t=i.name,s=``;if(e!=null)if(typeof e==`object`)s=`{`+(e.value||``)+`}`;else{let t=r&&T(e,n)>T(e,o)?o:n;s=t+sF(e,{subset:[t]})+t}a=t+(s?`=`:``)+s}m.push(a)}}let _=!1,v=m.join(` `);l&&(/\r?\n|\r/.test(v)||f.current().now.column+v.length+(u?i?2:3:1)>a)&&(_=!0);let y=f,b=h;if(_){y=p;let e=-1;for(;++e<m.length;)m[e]=d+cF+m[e];b+=y.move(`
351
351
  `+m.join(`
352
352
  `)+`
353
353
  `+d)}else v&&(b+=y.move(` `+v));return u&&(b+=y.move((i||_?``:` `)+`/`)),b+=y.move(`>`),e.children&&e.children.length>0&&(e.type===`mdxJsxTextElement`?b+=y.move(s.containerPhrasing(e,{...y.current(),before:`>`,after:`<`})):(y.shift(2),b+=y.move(`
354
- `),b+=y.move(fF(e,s,y.current())),b+=y.move(`
355
- `))),u||(b+=y.move((l?d:``)+`</`+(e.name||``)+`>`)),g(),b}}function fF(e,t,n){let r=t.indexStack,i=e.children,a=t.createTracker(n),o=mF(pF(t)),s=[],c=-1;for(r.push(-1);++c<i.length;){let n=i[c];r[r.length-1]=c;let l={before:`
354
+ `),b+=y.move(dF(e,s,y.current())),b+=y.move(`
355
+ `))),u||(b+=y.move((l?d:``)+`</`+(e.name||``)+`>`)),g(),b}}function dF(e,t,n){let r=t.indexStack,i=e.children,a=t.createTracker(n),o=pF(fF(t)),s=[],c=-1;for(r.push(-1);++c<i.length;){let n=i[c];r[r.length-1]=c;let l={before:`
356
356
  `,after:`
357
357
  `,...a.current()},u=t.handle(n,e,t,l),d=n.type===`mdxJsxFlowElement`?u:t.indentLines(u,function(e,t,n){return(n?``:o)+e});s.push(a.move(d)),n.type!==`list`&&(t.bulletLastUsed=void 0),c<i.length-1&&s.push(a.move(`
358
358
 
359
- `))}return r.pop(),s.join(``)}function pF(e){let t=0,n=e.stack.length;for(;--n>-1;){let r=e.stack[n];if(r===`blockquote`||r===`listItem`)break;r===`mdxJsxFlowElement`&&t++}return t}function mF(e){return lF.repeat(e)}function hF(){return`<`}function gF(){return{enter:{mdxjsEsm:vF},exit:{mdxjsEsm:yF,mdxjsEsmData:bF}}}function _F(){return{handlers:{mdxjsEsm:xF}}}function vF(e){this.enter({type:`mdxjsEsm`,value:``},e),this.buffer()}function yF(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,this.exit(e);let r=e.estree;n.value=t,r&&(n.data={estree:r})}function bF(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function xF(e){return e.value||``}function SF(){return[CP(),uF(),gF()]}function CF(e){return{extensions:[wP(),dF(e),_F()]}}function wF(e){return e}var TF={}.hasOwnProperty,EF=Symbol(`continue`),DF=Symbol(`exit`),OF=Symbol(`skip`);function kF(e,t){let n,r;typeof t==`function`?n=t:t&&typeof t==`object`&&(t.enter&&(n=t.enter),t.leave&&(r=t.leave)),i(e,void 0,void 0,[])();function i(e,t,a,o){return jF(e)&&(s.displayName=`node (`+wF(e.type)+`)`),s;function s(){let s=n?AF(n(e,t,a,o)):[];if(s[0]===DF)return s;if(s[0]!==OF){let t;for(t in e)if(TF.call(e,t)&&e[t]&&typeof e[t]==`object`&&t!==`data`&&t!==`position`){let n=o.concat(e),r=e[t];if(Array.isArray(r)){let e=r,a=0;for(;a>-1&&a<e.length;){let r=e[a];if(jF(r)){let e=i(r,t,a,n)();if(e[0]===DF)return e;a=typeof e[1]==`number`?e[1]:a+1}else a++}}else if(jF(r)){let e=i(r,t,void 0,n)();if(e[0]===DF)return e}}}return r?AF(r(e,t,a,o)):s}}}function AF(e){return Array.isArray(e)?e:typeof e==`number`?[EF,e]:[e]}function jF(e){return!!(e&&typeof e==`object`&&`type`in e&&typeof e.type==`string`&&e.type.length>0)}function MF(e,t){let n=t.prefix||``,r=t.suffix||``,i=Object.assign({},t.acornOptions),a=[],o=[],s=i.onComment,c=i.onToken,l=!1,u,d,f=Object.assign({},i,{onComment:a,preserveParens:!0});c&&(f.onToken=o);let p=PF(e,t.tokenTypes),m=p.value,h=n+m+r,g=t.expression&&NF(m);if(g&&!t.allowEmpty)throw new xe(`Unexpected empty expression`,{place:v(0),ruleId:`unexpected-empty-expression`,source:`micromark-extension-mdx-expression`});try{u=t.expression&&!g?t.acorn.parseExpressionAt(h,0,f):t.acorn.parse(h,f)}catch(e){let t=e,r=v(t.pos);t.message=String(t.message).replace(/ \(\d+:\d+\)$/,``),t.pos=r.offset,t.loc={line:r.line,column:r.column-1},d=t,l=t.raisedAt>=n.length+m.length||t.message===`Unterminated comment`}if(u&&t.expression&&!g)if(NF(h.slice(u.end,h.length-r.length)))u={type:`Program`,start:0,end:n.length+m.length,body:[{type:`ExpressionStatement`,expression:u,start:0,end:n.length+m.length}],sourceType:`module`,comments:[]};else{let e=v(u.end),t=Error(`Unexpected content after expression`);t.pos=e.offset,t.loc={line:e.line,column:e.column-1},d=t,u=void 0}if(u){if(u.comments=a,kF(u,function(e,t,n,r){let i=r[r.length-1],a=t;e.type===`ParenthesizedExpression`&&i&&a&&(typeof n==`number`&&(i=i[a],a=n),i[a]=e.expression),_(e)}),Array.isArray(s))s.push(...a);else if(typeof s==`function`)for(let e of a)s(e.type===`Block`,e.value,e.start,e.end,e.loc.start,e.loc.end);for(let e of o)e.end<=n.length||e.start-n.length>=m.length||(_(e),Array.isArray(c)?c.push(e):c(e))}return{estree:u,error:d,swallow:l};function _(e){let t=v(e.start),n=v(e.end);e.start=t.offset,e.end=n.offset,e.loc={start:{line:t.line,column:t.column-1,offset:t.offset},end:{line:n.line,column:n.column-1,offset:n.offset}},e.range=[e.start,e.end]}function v(e){let r=e-n.length;r<0?r=0:r>m.length&&(r=m.length);let i=FF(p.stops,r);return i||={line:t.start.line,column:t.start.column,offset:t.start.offset},i}}function NF(e){return/^\s*$/.test(e.replace(/\/\*[\s\S]*?\*\//g,``).replace(/\/\/[^\r\n]*(\r\n|\n|\r)/g,``))}function PF(e,t){let n={value:``,stops:[]},r=-1;for(;++r<e.length;){let i=e[r];if(i[0]===`enter`){let e=i[1].type;if(e===`lineEnding`||t.includes(e)){let e=i[2].sliceStream(i[1]);for(;e.length>0&&e[0]===-1;)e.shift();let t=IF(e);n.stops.push([n.value.length,i[1].start]),n.value+=t,n.stops.push([n.value.length,i[1].end])}}}return n}function FF(e,t){let n=0;for(;n<e.length&&e[n][0]<=t;)n+=1;if(n===0)return;let[r,i]=e[n-1],a=t-r;return{line:i.line,column:i.column+a,offset:i.offset+a}}function IF(e){let t=-1,n=[],r;for(;++t<e.length;){let i=e[t],a;if(typeof i==`string`)a=i;else switch(i){case-5:a=`\r`;break;case-4:a=`
359
+ `))}return r.pop(),s.join(``)}function fF(e){let t=0,n=e.stack.length;for(;--n>-1;){let r=e.stack[n];if(r===`blockquote`||r===`listItem`)break;r===`mdxJsxFlowElement`&&t++}return t}function pF(e){return cF.repeat(e)}function mF(){return`<`}function hF(){return{enter:{mdxjsEsm:_F},exit:{mdxjsEsm:vF,mdxjsEsmData:yF}}}function gF(){return{handlers:{mdxjsEsm:bF}}}function _F(e){this.enter({type:`mdxjsEsm`,value:``},e),this.buffer()}function vF(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,this.exit(e);let r=e.estree;n.value=t,r&&(n.data={estree:r})}function yF(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function bF(e){return e.value||``}function xF(){return[SP(),lF(),hF()]}function SF(e){return{extensions:[CP(),uF(e),gF()]}}function CF(e){return e}var wF={}.hasOwnProperty,TF=Symbol(`continue`),EF=Symbol(`exit`),DF=Symbol(`skip`);function OF(e,t){let n,r;typeof t==`function`?n=t:t&&typeof t==`object`&&(t.enter&&(n=t.enter),t.leave&&(r=t.leave)),i(e,void 0,void 0,[])();function i(e,t,a,o){return AF(e)&&(s.displayName=`node (`+CF(e.type)+`)`),s;function s(){let s=n?kF(n(e,t,a,o)):[];if(s[0]===EF)return s;if(s[0]!==DF){let t;for(t in e)if(wF.call(e,t)&&e[t]&&typeof e[t]==`object`&&t!==`data`&&t!==`position`){let n=o.concat(e),r=e[t];if(Array.isArray(r)){let e=r,a=0;for(;a>-1&&a<e.length;){let r=e[a];if(AF(r)){let e=i(r,t,a,n)();if(e[0]===EF)return e;a=typeof e[1]==`number`?e[1]:a+1}else a++}}else if(AF(r)){let e=i(r,t,void 0,n)();if(e[0]===EF)return e}}}return r?kF(r(e,t,a,o)):s}}}function kF(e){return Array.isArray(e)?e:typeof e==`number`?[TF,e]:[e]}function AF(e){return!!(e&&typeof e==`object`&&`type`in e&&typeof e.type==`string`&&e.type.length>0)}function jF(e,t){let n=t.prefix||``,r=t.suffix||``,i=Object.assign({},t.acornOptions),a=[],o=[],s=i.onComment,c=i.onToken,l=!1,u,d,f=Object.assign({},i,{onComment:a,preserveParens:!0});c&&(f.onToken=o);let p=NF(e,t.tokenTypes),m=p.value,h=n+m+r,g=t.expression&&MF(m);if(g&&!t.allowEmpty)throw new xe(`Unexpected empty expression`,{place:v(0),ruleId:`unexpected-empty-expression`,source:`micromark-extension-mdx-expression`});try{u=t.expression&&!g?t.acorn.parseExpressionAt(h,0,f):t.acorn.parse(h,f)}catch(e){let t=e,r=v(t.pos);t.message=String(t.message).replace(/ \(\d+:\d+\)$/,``),t.pos=r.offset,t.loc={line:r.line,column:r.column-1},d=t,l=t.raisedAt>=n.length+m.length||t.message===`Unterminated comment`}if(u&&t.expression&&!g)if(MF(h.slice(u.end,h.length-r.length)))u={type:`Program`,start:0,end:n.length+m.length,body:[{type:`ExpressionStatement`,expression:u,start:0,end:n.length+m.length}],sourceType:`module`,comments:[]};else{let e=v(u.end),t=Error(`Unexpected content after expression`);t.pos=e.offset,t.loc={line:e.line,column:e.column-1},d=t,u=void 0}if(u){if(u.comments=a,OF(u,function(e,t,n,r){let i=r[r.length-1],a=t;e.type===`ParenthesizedExpression`&&i&&a&&(typeof n==`number`&&(i=i[a],a=n),i[a]=e.expression),_(e)}),Array.isArray(s))s.push(...a);else if(typeof s==`function`)for(let e of a)s(e.type===`Block`,e.value,e.start,e.end,e.loc.start,e.loc.end);for(let e of o)e.end<=n.length||e.start-n.length>=m.length||(_(e),Array.isArray(c)?c.push(e):c(e))}return{estree:u,error:d,swallow:l};function _(e){let t=v(e.start),n=v(e.end);e.start=t.offset,e.end=n.offset,e.loc={start:{line:t.line,column:t.column-1,offset:t.offset},end:{line:n.line,column:n.column-1,offset:n.offset}},e.range=[e.start,e.end]}function v(e){let r=e-n.length;r<0?r=0:r>m.length&&(r=m.length);let i=PF(p.stops,r);return i||={line:t.start.line,column:t.start.column,offset:t.start.offset},i}}function MF(e){return/^\s*$/.test(e.replace(/\/\*[\s\S]*?\*\//g,``).replace(/\/\/[^\r\n]*(\r\n|\n|\r)/g,``))}function NF(e,t){let n={value:``,stops:[]},r=-1;for(;++r<e.length;){let i=e[r];if(i[0]===`enter`){let e=i[1].type;if(e===`lineEnding`||t.includes(e)){let e=i[2].sliceStream(i[1]);for(;e.length>0&&e[0]===-1;)e.shift();let t=FF(e);n.stops.push([n.value.length,i[1].start]),n.value+=t,n.stops.push([n.value.length,i[1].end])}}}return n}function PF(e,t){let n=0;for(;n<e.length&&e[n][0]<=t;)n+=1;if(n===0)return;let[r,i]=e[n-1],a=t-r;return{line:i.line,column:i.column+a,offset:i.offset+a}}function FF(e){let t=-1,n=[],r;for(;++t<e.length;){let i=e[t],a;if(typeof i==`string`)a=i;else switch(i){case-5:a=`\r`;break;case-4:a=`
360
360
  `;break;case-3:a=`\r
361
- `;break;case-2:a=` `;break;case-1:if(r)continue;a=` `;break;default:a=String.fromCharCode(i)}r=i===-2,n.push(a)}return n.join(``)}function LF(e){let t=e||{},n=t.loc||{},r=t.range||[void 0,void 0],i=RF(n.start,r[0]||t.start),a=RF(n.end,r[1]||t.end);if(i&&a)return{start:i,end:a}}function RF(e,t){if(e&&typeof e==`object`){let n=`line`in e?zF(e.line):void 0,r=`column`in e?zF(e.column):void 0;if(n&&r!==void 0)return{line:n,column:r+1,offset:zF(t)}}}function zF(e){return typeof e==`number`&&e>-1?e:void 0}var BF=2,VF=`https://github.com/micromark/micromark-extension-mdx-expression/tree/main/packages/micromark-extension-mdx-expression`,HF=`#unexpected-end-of-file-in-expression-expected-a-corresponding-closing-brace-for-`,UF=`#unexpected-lazy-line-in-expression-in-container-expected-line-to-be-prefixed`,WF=`#unexpected-type-in-code-expected-an-object-spread-spread`,GF=`#unexpected-extra-content-in-spread-only-a-single-spread-is-supported`,KF=`#could-not-parse-expression-with-acorn`;function qF(e,t,n,r,i,a,o,s,c,l,u){let d=this,f=this.events.length+3,p=0,m,g;return _;function _(t){return e.enter(n),e.enter(r),e.consume(t),e.exit(r),m=d.now(),v}function v(u){if(u===null){if(g)throw g;let e=new xe("Unexpected end of file in expression, expected a corresponding closing brace for `{`",{place:d.now(),ruleId:`unexpected-eof`,source:`micromark-extension-mdx-expression`});throw e.url=VF+HF,e}if(x(u))return e.enter(`lineEnding`),e.consume(u),e.exit(`lineEnding`),b;if(u===125&&p===0){let p=a?JF.call(d,a,o,i,f,m,l||!1,c||!1):{type:`ok`,estree:void 0};if(p.type===`ok`){e.enter(r),e.consume(u),e.exit(r);let i=e.exit(n);return s&&p.estree&&Object.assign(i,{estree:p.estree}),t}return g=p.message,e.enter(i),e.consume(u),y}return e.enter(i),y(u)}function y(t){return t===125&&p===0||t===null||x(t)?(e.exit(i),v(t)):(t===123&&!a?p+=1:t===125&&--p,e.consume(t),y)}function b(t){let n=d.now();if(n.line!==m.line&&!u&&d.parser.lazy[n.line]){let e=new xe("Unexpected lazy line in expression in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",{place:d.now(),ruleId:`unexpected-lazy`,source:`micromark-extension-mdx-expression`});throw e.url=VF+UF,e}return h(t)?ae(e,v,`linePrefix`,BF+1)(t):v(t)}}function JF(e,t,n,r,i,a,o){let s=MF(this.events.slice(r),{acorn:e,tokenTypes:[n],acornOptions:t,start:i,expression:!0,allowEmpty:a,prefix:o?`({`:``,suffix:o?`})`:``}),c=s.estree;if(o&&c){let e=c.body[0];if(e.type!==`ExpressionStatement`||e.expression.type!==`ObjectExpression`){let t=LF(e),n=new xe("Unexpected `"+e.type+"` in code: expected an object spread (`{...spread}`)",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=VF+WF,n}if(e.expression.properties[1]){let t=new xe(`Unexpected extra content in spread: only a single spread is supported`,{place:LF(e.expression.properties[1]).start,ruleId:`spread-extra`,source:`micromark-extension-mdx-expression`});throw t.url=VF+GF,t}if(e.expression.properties[0]&&e.expression.properties[0].type!==`SpreadElement`){let t=LF(e.expression.properties[0]),n=new xe("Unexpected `"+e.expression.properties[0].type+"` in code: only spread elements are supported",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=VF+WF,n}}if(s.error){let e=new xe(`Could not parse expression with acorn`,{cause:s.error,place:{line:s.error.loc.line,column:s.error.loc.column+1,offset:s.error.pos},ruleId:`acorn`,source:`micromark-extension-mdx-expression`});return e.url=VF+KF,{type:`nok`,message:e}}return{type:`ok`,estree:c}}function YF(e){let t=e||{},n=t.addResult,r=t.acorn,i=t.spread,a=t.allowEmpty,o;if(a??=!0,r){if(!r.parseExpressionAt)throw Error("Expected a proper `acorn` instance passed in as `options.acorn`");o=Object.assign({ecmaVersion:2024,sourceType:`module`},t.acornOptions)}else if(t.acornOptions||t.addResult)throw Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{123:{name:`mdxFlowExpression`,tokenize:s,concrete:!0}},text:{123:{name:`mdxTextExpression`,tokenize:c}}};function s(e,t,s){let c=this;return l;function l(e){return u(e)}function u(t){return qF.call(c,e,d,`mdxFlowExpression`,`mdxFlowExpressionMarker`,`mdxFlowExpressionChunk`,r,o,n,i,a)(t)}function d(t){return h(t)?ae(e,f,`whitespace`)(t):f(t)}function f(n){let r=c.parser.constructs.flow[60],i=(Array.isArray(r)?r:r?[r]:[]).find(function(e){return e.name===`mdxJsxFlowTag`});return n===60&&i?e.attempt(i,f,s)(n):n===null||x(n)?t(n):s(n)}}function c(e,t){let s=this;return c;function c(c){return qF.call(s,e,t,`mdxTextExpression`,`mdxTextExpressionMarker`,`mdxTextExpressionChunk`,r,o,n,i,a,!0)(c)}}}var XF=`https://github.com/micromark/micromark-extension-mdx-jsx`;function ZF(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,g,_,v,b,S,w,T,E,ee,te,D,ne,re,ie,ae,se,ce){let O=this,le,ue;return de;function de(t){return e.enter(s),e.enter(c),e.consume(t),e.exit(c),k}function k(e){return C(e)?n(e):(le=A,Fe(e))}function A(t){if(t===47)return e.enter(l),e.consume(t),e.exit(l),le=fe,Fe;if(t===62)return Pe(t);if(t!==null&&t>=0&&oe(t))return e.enter(d),e.enter(f),e.consume(t),pe;Re(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===33?" (note: to create a comment in MDX, use `{/* text */}`)":``))}function fe(t){if(t===62)return Pe(t);if(t!==null&&t>=0&&oe(t))return e.enter(d),e.enter(f),e.consume(t),pe;Re(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===42||t===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function pe(t){if(t!==null&&t>=0&&Ce(t,{jsx:!0}))return e.consume(t),pe;if(t===46||t===47||t===58||t===62||t===123||C(t)||y(t))return e.exit(f),le=me,Fe(t);Re(t,`in name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function me(t){if(t===46)return e.enter(p),e.consume(t),e.exit(p),le=he,Fe;if(t===58)return e.enter(g),e.consume(t),e.exit(g),le=ve,Fe;if(t===47||t===62||t===123||t!==null&&t>=0&&oe(t))return e.exit(d),j(t);Re(t,`after name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function he(t){if(t!==null&&t>=0&&oe(t))return e.enter(m),e.consume(t),ge;Re(t,`before member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function ge(t){if(t!==null&&t>=0&&Ce(t,{jsx:!0}))return e.consume(t),ge;if(t===46||t===47||t===62||t===123||C(t)||y(t))return e.exit(m),le=_e,Fe(t);Re(t,`in member name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function _e(t){if(t===46)return e.enter(p),e.consume(t),e.exit(p),le=he,Fe;if(t===47||t===62||t===123||t!==null&&t>=0&&oe(t))return e.exit(d),j(t);Re(t,`after member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function ve(t){if(t!==null&&t>=0&&oe(t))return e.enter(_),e.consume(t),ye;Re(t,`before local name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===43||t!==null&&t>46&&t<58?" (note: to create a link in MDX, use `[text](url)`)":``))}function ye(t){if(t!==null&&t>=0&&Ce(t,{jsx:!0}))return e.consume(t),ye;if(t===47||t===62||t===123||C(t)||y(t))return e.exit(_),le=be,Fe(t);Re(t,`in local name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag")}function be(t){if(t===47||t===62||t===123||t!==null&&t>=0&&oe(t))return e.exit(d),j(t);Re(t,`after local name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function j(t){if(t===47)return e.enter(u),e.consume(t),e.exit(u),le=Ne,Fe;if(t===62)return Pe(t);if(t===123)return qF.call(O,e,Se,v,b,S,r,i,a,!0,!1,o)(t);if(t!==null&&t>=0&&oe(t))return e.enter(w),e.enter(T),e.enter(E),e.consume(t),we;Re(t,`before attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function Se(e){return le=j,Fe(e)}function we(t){if(t!==null&&t>=0&&Ce(t,{jsx:!0}))return e.consume(t),we;if(t===47||t===58||t===61||t===62||t===123||C(t)||y(t))return e.exit(E),le=Te,Fe(t);Re(t,`in attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function Te(t){if(t===58)return e.enter(ee),e.consume(t),e.exit(ee),le=Ee,Fe;if(t===61)return e.exit(T),e.enter(D),e.consume(t),e.exit(D),le=ke,Fe;if(t===47||t===62||t===123||C(t)||y(t)||t!==null&&t>=0&&oe(t))return e.exit(T),e.exit(w),le=j,Fe(t);Re(t,`after attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function Ee(t){if(t!==null&&t>=0&&oe(t))return e.enter(te),e.consume(t),De;Re(t,`before local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function De(t){if(t!==null&&t>=0&&Ce(t,{jsx:!0}))return e.consume(t),De;if(t===47||t===61||t===62||t===123||C(t)||y(t))return e.exit(te),e.exit(T),le=Oe,Fe(t);Re(t,`in local attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function Oe(t){if(t===61)return e.enter(D),e.consume(t),e.exit(D),le=ke,Fe;if(t===47||t===62||t===123||t!==null&&t>=0&&oe(t))return e.exit(w),j(t);Re(t,`after local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function ke(t){if(t===34||t===39)return e.enter(ne),e.enter(re),e.consume(t),e.exit(re),ue=t,je;if(t===123)return qF.call(O,e,Ae,ae,se,ce,r,i,a,!1,!1,o)(t);Re(t,`before attribute value`,"a character that can start an attribute value, such as `\"`, `'`, or `{`"+(t===60?" (note: to use an element or fragment as a prop value in MDX, use `{<element />}`)":``))}function Ae(t){return e.exit(w),le=j,Fe(t)}function je(t){return t===null&&Re(t,`in attribute value`,"a corresponding closing quote `"+String.fromCodePoint(ue)+"`"),t===ue?(e.enter(re),e.consume(t),e.exit(re),e.exit(ne),e.exit(w),ue=void 0,le=j,Fe):x(t)?(le=je,Fe(t)):(e.enter(ie),Me(t))}function Me(t){return t===null||t===ue||x(t)?(e.exit(ie),je(t)):(e.consume(t),Me)}function Ne(e){if(e===62)return Pe(e);Re(e,`after self-closing slash`,"`>` to end the tag"+(e===42||e===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function Pe(n){return e.enter(c),e.consume(n),e.exit(c),e.exit(s),t}function Fe(t){return x(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Le):h(t)||y(t)?(e.enter(`esWhitespace`),Ie(t)):le(t)}function Ie(t){return x(t)?(e.exit(`esWhitespace`),Fe(t)):h(t)||y(t)?(e.consume(t),Ie):(e.exit(`esWhitespace`),le(t))}function Le(e){if(!o&&O.parser.lazy[O.now().line]){let e=new xe("Unexpected lazy line in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",O.now(),`micromark-extension-mdx-jsx:unexpected-lazy`);throw e.url=XF+`#unexpected-lazy-line-in-container-expected-line-to-be`,e}return Fe(e)}function Re(e,t,n){let r=new xe(`Unexpected `+(e===null?`end of file`:"character `"+(e===96?"` ` `":String.fromCodePoint(e))+"` ("+QF(e)+`)`)+` `+t+`, expected `+n,O.now(),`micromark-extension-mdx-jsx:unexpected-`+(e===null?`eof`:`character`));throw r.url=XF+(e===null?`#unexpected-end-of-file-at-expected-expect`:`#unexpected-character-at-expected-expect`),r}}function QF(e){return`U+`+e.toString(16).toUpperCase().padStart(4,`0`)}function $F(e,t){return{name:`mdxJsxTextTag`,tokenize:n};function n(n,r,i){return ZF.call(this,n,r,i,e,t.acornOptions,t.addResult,!0,`mdxJsxTextTag`,`mdxJsxTextTagMarker`,`mdxJsxTextTagClosingMarker`,`mdxJsxTextTagSelfClosingMarker`,`mdxJsxTextTagName`,`mdxJsxTextTagNamePrimary`,`mdxJsxTextTagNameMemberMarker`,`mdxJsxTextTagNameMember`,`mdxJsxTextTagNamePrefixMarker`,`mdxJsxTextTagNameLocal`,`mdxJsxTextTagExpressionAttribute`,`mdxJsxTextTagExpressionAttributeMarker`,`mdxJsxTextTagExpressionAttributeValue`,`mdxJsxTextTagAttribute`,`mdxJsxTextTagAttributeName`,`mdxJsxTextTagAttributeNamePrimary`,`mdxJsxTextTagAttributeNamePrefixMarker`,`mdxJsxTextTagAttributeNameLocal`,`mdxJsxTextTagAttributeInitializerMarker`,`mdxJsxTextTagAttributeValueLiteral`,`mdxJsxTextTagAttributeValueLiteralMarker`,`mdxJsxTextTagAttributeValueLiteralValue`,`mdxJsxTextTagAttributeValueExpression`,`mdxJsxTextTagAttributeValueExpressionMarker`,`mdxJsxTextTagAttributeValueExpressionValue`)}}function eI(e,t){return{concrete:!0,name:`mdxJsxFlowTag`,tokenize:n};function n(n,r,i){let a=this;return o;function o(e){return s(e)}function s(r){return ZF.call(a,n,c,i,e,t.acornOptions,t.addResult,!1,`mdxJsxFlowTag`,`mdxJsxFlowTagMarker`,`mdxJsxFlowTagClosingMarker`,`mdxJsxFlowTagSelfClosingMarker`,`mdxJsxFlowTagName`,`mdxJsxFlowTagNamePrimary`,`mdxJsxFlowTagNameMemberMarker`,`mdxJsxFlowTagNameMember`,`mdxJsxFlowTagNamePrefixMarker`,`mdxJsxFlowTagNameLocal`,`mdxJsxFlowTagExpressionAttribute`,`mdxJsxFlowTagExpressionAttributeMarker`,`mdxJsxFlowTagExpressionAttributeValue`,`mdxJsxFlowTagAttribute`,`mdxJsxFlowTagAttributeName`,`mdxJsxFlowTagAttributeNamePrimary`,`mdxJsxFlowTagAttributeNamePrefixMarker`,`mdxJsxFlowTagAttributeNameLocal`,`mdxJsxFlowTagAttributeInitializerMarker`,`mdxJsxFlowTagAttributeValueLiteral`,`mdxJsxFlowTagAttributeValueLiteralMarker`,`mdxJsxFlowTagAttributeValueLiteralValue`,`mdxJsxFlowTagAttributeValueExpression`,`mdxJsxFlowTagAttributeValueExpressionMarker`,`mdxJsxFlowTagAttributeValueExpressionValue`)(r)}function c(e){return h(e)?ae(n,l,`whitespace`)(e):l(e)}function l(e){let t=a.parser.constructs.flow[123],s=Array.isArray(t)?t:t?[t]:[],c;for(let e of s)if(e.name===`mdxFlowExpression`){c=e;break}return e===60?o(e):e===123&&c?n.attempt(c,l,i)(e):e===null||x(e)?r(e):i(e)}}}function tI(e){let t=e||{},n=t.acorn,r;if(n){if(!n.parse||!n.parseExpressionAt)throw Error("Expected a proper `acorn` instance passed in as `options.acorn`");r=Object.assign({ecmaVersion:2024,sourceType:`module`},t.acornOptions,{locations:!0})}else if(t.acornOptions||t.addResult)throw Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{60:eI(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})},text:{60:$F(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})}}}function nI(){return{disable:{null:[`autolink`,`codeIndented`,`htmlFlow`,`htmlText`]}}}function rI(){return se([YF(),tI(),nI()])}var iI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;var t=class{};e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var n=class extends t{constructor(t){if(super(),!e.IDENTIFIER.test(t))throw Error(`CodeGen: name must be a valid identifier`);this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};e.Name=n;var r=class extends t{constructor(e){super(),this._items=typeof e==`string`?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===``||e===`""`}get str(){return this._str??=this._items.reduce((e,t)=>`${e}${t}`,``)}get names(){return this._names??=this._items.reduce((e,t)=>(t instanceof n&&(e[t.str]=(e[t.str]||0)+1),e),{})}};e._Code=r,e.nil=new r(``);function i(e,...t){let n=[e[0]],i=0;for(;i<t.length;)s(n,t[i]),n.push(e[++i]);return new r(n)}e._=i;var a=new r(`+`);function o(e,...t){let n=[p(e[0])],i=0;for(;i<t.length;)n.push(a),s(n,t[i]),n.push(a,p(e[++i]));return c(n),new r(n)}e.str=o;function s(e,t){t instanceof r?e.push(...t._items):t instanceof n?e.push(t):e.push(d(t))}e.addCodeArg=s;function c(e){let t=1;for(;t<e.length-1;){if(e[t]===a){let n=l(e[t-1],e[t+1]);if(n!==void 0){e.splice(t-1,3,n);continue}e[t++]=`+`}t++}}function l(e,t){if(t===`""`)return e;if(e===`""`)return t;if(typeof e==`string`)return t instanceof n||e[e.length-1]!==`"`?void 0:typeof t==`string`?t[0]===`"`?e.slice(0,-1)+t.slice(1):void 0:`${e.slice(0,-1)}${t}"`;if(typeof t==`string`&&t[0]===`"`&&!(e instanceof n))return`"${e}${t.slice(1)}`}function u(e,t){return t.emptyStr()?e:e.emptyStr()?t:o`${e}${t}`}e.strConcat=u;function d(e){return typeof e==`number`||typeof e==`boolean`||e===null?e:p(Array.isArray(e)?e.join(`,`):e)}function f(e){return new r(p(e))}e.stringify=f;function p(e){return JSON.stringify(e).replace(/\u2028/g,`\\u2028`).replace(/\u2029/g,`\\u2029`)}e.safeStringify=p;function m(t){return typeof t==`string`&&e.IDENTIFIER.test(t)?new r(`.${t}`):i`[${t}]`}e.getProperty=m;function h(t){if(typeof t==`string`&&e.IDENTIFIER.test(t))return new r(`${t}`);throw Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}e.getEsmExportName=h;function g(e){return new r(e.toString())}e.regexpCode=g})),aI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;var t=iI(),n=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},r;(function(e){e[e.Started=0]=`Started`,e[e.Completed=1]=`Completed`})(r||(e.UsedValueState=r={})),e.varKinds={const:new t.Name(`const`),let:new t.Name(`let`),var:new t.Name(`var`)};var i=class{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof t.Name?e:this.name(e)}name(e){return new t.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){if((this._parent?._prefixes)?.has(e)||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};e.Scope=i;var a=class extends t.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:n,itemIndex:r}){this.value=e,this.scopePath=(0,t._)`.${new t.Name(n)}[${r}]`}};e.ValueScopeName=a;var o=(0,t._)`\n`;e.ValueScope=class extends i{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?o:t.nil}}get(){return this._scope}name(e){return new a(e,this._newName(e))}value(e,t){if(t.ref===void 0)throw Error(`CodeGen: ref must be passed in value`);let n=this.toName(e),{prefix:r}=n,i=t.key??t.ref,a=this._values[r];if(a){let e=a.get(i);if(e)return e}else a=this._values[r]=new Map;a.set(i,n);let o=this._scope[r]||(this._scope[r]=[]),s=o.length;return o[s]=t.ref,n.setValue(t,{property:r,itemIndex:s}),n}getValue(e,t){let n=this._values[e];if(n)return n.get(t)}scopeRefs(e,n=this._values){return this._reduceValues(n,n=>{if(n.scopePath===void 0)throw Error(`CodeGen: name "${n}" has no value`);return(0,t._)`${e}${n.scopePath}`})}scopeCode(e=this._values,t,n){return this._reduceValues(e,e=>{if(e.value===void 0)throw Error(`CodeGen: name "${e}" has no value`);return e.value.code},t,n)}_reduceValues(i,a,o={},s){let c=t.nil;for(let l in i){let u=i[l];if(!u)continue;let d=o[l]=o[l]||new Map;u.forEach(i=>{if(d.has(i))return;d.set(i,r.Started);let o=a(i);if(o){let n=this.opts.es5?e.varKinds.var:e.varKinds.const;c=(0,t._)`${c}${n} ${i} = ${o};${this.opts._n}`}else if(o=s?.(i))c=(0,t._)`${c}${o}${this.opts._n}`;else throw new n(i);d.set(i,r.Completed)})}return c}}})),X=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;var t=iI(),n=aI(),r=iI();Object.defineProperty(e,`_`,{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,`str`,{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,`strConcat`,{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(e,`nil`,{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,`getProperty`,{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(e,`stringify`,{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,`regexpCode`,{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(e,`Name`,{enumerable:!0,get:function(){return r.Name}});var i=aI();Object.defineProperty(e,`Scope`,{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(e,`ValueScope`,{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(e,`ValueScopeName`,{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(e,`varKinds`,{enumerable:!0,get:function(){return i.varKinds}}),e.operators={GT:new t._Code(`>`),GTE:new t._Code(`>=`),LT:new t._Code(`<`),LTE:new t._Code(`<=`),EQ:new t._Code(`===`),NEQ:new t._Code(`!==`),NOT:new t._Code(`!`),OR:new t._Code(`||`),AND:new t._Code(`&&`),ADD:new t._Code(`+`)};var a=class{optimizeNodes(){return this}optimizeNames(e,t){return this}},o=class extends a{constructor(e,t,n){super(),this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){let r=e?n.varKinds.var:this.varKind,i=this.rhs===void 0?``:` = ${this.rhs}`;return`${r} ${this.name}${i};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&=D(this.rhs,e,t),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}},s=class extends a{constructor(e,t,n){super(),this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,n){if(!(this.lhs instanceof t.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=D(this.rhs,e,n),this}get names(){return te(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}},c=class extends s{constructor(e,t,n,r){super(e,n,r),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},l=class extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},u=class extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:``};`+e}},d=class extends a{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},f=class extends a{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=D(this.code,e,t),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}},p=class extends a{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,n)=>t+n.render(e),``)}optimizeNodes(){let{nodes:e}=this,t=e.length;for(;t--;){let n=e[t].optimizeNodes();Array.isArray(n)?e.splice(t,1,...n):n?e[t]=n:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:n}=this,r=n.length;for(;r--;){let i=n[r];i.optimizeNames(e,t)||(ne(e,i.names),n.splice(r,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>ee(e,t.names),{})}},m=class extends p{render(e){return`{`+e._n+super.render(e)+`}`+e._n}},h=class extends p{},g=class extends m{};g.kind=`else`;var _=class e extends m{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+=`else `+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let n=this.else;if(n){let e=n.optimizeNodes();n=this.else=Array.isArray(e)?new g(e):e}if(n)return t===!1?n instanceof e?n:n.nodes:this.nodes.length?this:new e(re(t),n instanceof e?[n]:n.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(e,t){if(this.else=this.else?.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=D(this.condition,e,t),this}get names(){let e=super.names;return te(e,this.condition),this.else&&ee(e,this.else.names),e}};_.kind=`if`;var v=class extends m{};v.kind=`for`;var y=class extends v{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=D(this.iteration,e,t),this}get names(){return ee(super.names,this.iteration.names)}},b=class extends v{constructor(e,t,n,r){super(),this.varKind=e,this.name=t,this.from=n,this.to=r}render(e){let t=e.es5?n.varKinds.var:this.varKind,{name:r,from:i,to:a}=this;return`for(${t} ${r}=${i}; ${r}<${a}; ${r}++)`+super.render(e)}get names(){return te(te(super.names,this.from),this.to)}},x=class extends v{constructor(e,t,n,r){super(),this.loop=e,this.varKind=t,this.name=n,this.iterable=r}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=D(this.iterable,e,t),this}get names(){return ee(super.names,this.iterable.names)}},S=class extends m{constructor(e,t,n){super(),this.name=e,this.args=t,this.async=n}render(e){return`${this.async?`async `:``}function ${this.name}(${this.args})`+super.render(e)}};S.kind=`func`;var C=class extends p{render(e){return`return `+super.render(e)}};C.kind=`return`;var w=class extends m{render(e){let t=`try`+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)==null||e.optimizeNodes(),(t=this.finally)==null||t.optimizeNodes(),this}optimizeNames(e,t){var n,r;return super.optimizeNames(e,t),(n=this.catch)==null||n.optimizeNames(e,t),(r=this.finally)==null||r.optimizeNames(e,t),this}get names(){let e=super.names;return this.catch&&ee(e,this.catch.names),this.finally&&ee(e,this.finally.names),e}},T=class extends m{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};T.kind=`catch`;var E=class extends m{render(e){return`finally`+super.render(e)}};E.kind=`finally`,e.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
362
- `:``},this._extScope=e,this._scope=new n.Scope({parent:e}),this._nodes=[new h]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,n,r){let i=this._scope.toName(t);return n!==void 0&&r&&(this._constants[i.str]=n),this._leafNode(new o(e,i,n)),i}const(e,t,r){return this._def(n.varKinds.const,e,t,r)}let(e,t,r){return this._def(n.varKinds.let,e,t,r)}var(e,t,r){return this._def(n.varKinds.var,e,t,r)}assign(e,t,n){return this._leafNode(new s(e,t,n))}add(t,n){return this._leafNode(new c(t,e.operators.ADD,n))}code(e){return typeof e==`function`?e():e!==t.nil&&this._leafNode(new f(e)),this}object(...e){let n=[`{`];for(let[r,i]of e)n.length>1&&n.push(`,`),n.push(r),(r!==i||this.opts.es5)&&(n.push(`:`),(0,t.addCodeArg)(n,i));return n.push(`}`),new t._Code(n)}if(e,t,n){if(this._blockNode(new _(e)),t&&n)this.code(t).else().code(n).endIf();else if(t)this.code(t).endIf();else if(n)throw Error(`CodeGen: "else" body without "then" body`);return this}elseIf(e){return this._elseNode(new _(e))}else(){return this._elseNode(new g)}endIf(){return this._endBlockNode(_,g)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new y(e),t)}forRange(e,t,r,i,a=this.opts.es5?n.varKinds.var:n.varKinds.let){let o=this._scope.toName(e);return this._for(new b(a,o,t,r),()=>i(o))}forOf(e,r,i,a=n.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let e=r instanceof t.Name?r:this.var(`_arr`,r);return this.forRange(`_i`,0,(0,t._)`${e}.length`,n=>{this.var(o,(0,t._)`${e}[${n}]`),i(o)})}return this._for(new x(`of`,a,o,r),()=>i(o))}forIn(e,r,i,a=this.opts.es5?n.varKinds.var:n.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,t._)`Object.keys(${r})`,i);let o=this._scope.toName(e);return this._for(new x(`in`,a,o,r),()=>i(o))}endFor(){return this._endBlockNode(v)}label(e){return this._leafNode(new l(e))}break(e){return this._leafNode(new u(e))}return(e){let t=new C;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error(`CodeGen: "return" should have one node`);return this._endBlockNode(C)}try(e,t,n){if(!t&&!n)throw Error(`CodeGen: "try" without "catch" and "finally"`);let r=new w;if(this._blockNode(r),this.code(e),t){let e=this.name(`e`);this._currNode=r.catch=new T(e),t(e)}return n&&(this._currNode=r.finally=new E,this.code(n)),this._endBlockNode(T,E)}throw(e){return this._leafNode(new d(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw Error(`CodeGen: not in self-balancing block`);let n=this._nodes.length-t;if(n<0||e!==void 0&&n!==e)throw Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=t,this}func(e,n=t.nil,r,i){return this._blockNode(new S(e,n,r)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(S)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let n=this._currNode;if(n instanceof e||t&&n instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof _))throw Error(`CodeGen: "else" without "if"`);return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}};function ee(e,t){for(let n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function te(e,n){return n instanceof t._CodeOrName?ee(e,n.names):e}function D(e,n,r){if(e instanceof t.Name)return i(e);if(!a(e))return e;return new t._Code(e._items.reduce((e,n)=>(n instanceof t.Name&&(n=i(n)),n instanceof t._Code?e.push(...n._items):e.push(n),e),[]));function i(e){let t=r[e.str];return t===void 0||n[e.str]!==1?e:(delete n[e.str],t)}function a(e){return e instanceof t._Code&&e._items.some(e=>e instanceof t.Name&&n[e.str]===1&&r[e.str]!==void 0)}}function ne(e,t){for(let n in t)e[n]=(e[n]||0)-(t[n]||0)}function re(e){return typeof e==`boolean`||typeof e==`number`||e===null?!e:(0,t._)`!${O(e)}`}e.not=re;var ie=ce(e.operators.AND);function ae(...e){return e.reduce(ie)}e.and=ae;var oe=ce(e.operators.OR);function se(...e){return e.reduce(oe)}e.or=se;function ce(e){return(n,r)=>n===t.nil?r:r===t.nil?n:(0,t._)`${O(n)} ${e} ${O(r)}`}function O(e){return e instanceof t.Name?e:(0,t._)`(${e})`}})),oI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;var t=X(),n=iI();function r(e){let t={};for(let n of e)t[n]=!0;return t}e.toHash=r;function i(e,t){return typeof t==`boolean`?t:Object.keys(t).length===0?!0:(a(e,t),!o(t,e.self.RULES.all))}e.alwaysValidSchema=i;function a(e,t=e.schema){let{opts:n,self:r}=e;if(!n.strictSchema||typeof t==`boolean`)return;let i=r.RULES.keywords;for(let n in t)i[n]||x(e,`unknown keyword: "${n}"`)}e.checkUnknownRules=a;function o(e,t){if(typeof e==`boolean`)return!e;for(let n in e)if(t[n])return!0;return!1}e.schemaHasRules=o;function s(e,t){if(typeof e==`boolean`)return!e;for(let n in e)if(n!==`$ref`&&t.all[n])return!0;return!1}e.schemaHasRulesButRef=s;function c({topSchemaRef:e,schemaPath:n},r,i,a){if(!a){if(typeof r==`number`||typeof r==`boolean`)return r;if(typeof r==`string`)return(0,t._)`${r}`}return(0,t._)`${e}${n}${(0,t.getProperty)(i)}`}e.schemaRefOrVal=c;function l(e){return f(decodeURIComponent(e))}e.unescapeFragment=l;function u(e){return encodeURIComponent(d(e))}e.escapeFragment=u;function d(e){return typeof e==`number`?`${e}`:e.replace(/~/g,`~0`).replace(/\//g,`~1`)}e.escapeJsonPointer=d;function f(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}e.unescapeJsonPointer=f;function p(e,t){if(Array.isArray(e))for(let n of e)t(n);else t(e)}e.eachItem=p;function m({mergeNames:e,mergeToName:n,mergeValues:r,resultToName:i}){return(a,o,s,c)=>{let l=s===void 0?o:s instanceof t.Name?(o instanceof t.Name?e(a,o,s):n(a,o,s),s):o instanceof t.Name?(n(a,s,o),o):r(o,s);return c===t.Name&&!(l instanceof t.Name)?i(a,l):l}}e.mergeEvaluated={props:m({mergeNames:(e,n,r)=>e.if((0,t._)`${r} !== true && ${n} !== undefined`,()=>{e.if((0,t._)`${n} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,t._)`${r} || {}`).code((0,t._)`Object.assign(${r}, ${n})`))}),mergeToName:(e,n,r)=>e.if((0,t._)`${r} !== true`,()=>{n===!0?e.assign(r,!0):(e.assign(r,(0,t._)`${r} || {}`),g(e,r,n))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:h}),items:m({mergeNames:(e,n,r)=>e.if((0,t._)`${r} !== true && ${n} !== undefined`,()=>e.assign(r,(0,t._)`${n} === true ? true : ${r} > ${n} ? ${r} : ${n}`)),mergeToName:(e,n,r)=>e.if((0,t._)`${r} !== true`,()=>e.assign(r,n===!0?!0:(0,t._)`${r} > ${n} ? ${r} : ${n}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var(`items`,t)})};function h(e,n){if(n===!0)return e.var(`props`,!0);let r=e.var(`props`,(0,t._)`{}`);return n!==void 0&&g(e,r,n),r}e.evaluatedPropsToName=h;function g(e,n,r){Object.keys(r).forEach(r=>e.assign((0,t._)`${n}${(0,t.getProperty)(r)}`,!0))}e.setEvaluated=g;var _={};function v(e,t){return e.scopeValue(`func`,{ref:t,code:_[t.code]||(_[t.code]=new n._Code(t.code))})}e.useFunc=v;var y;(function(e){e[e.Num=0]=`Num`,e[e.Str=1]=`Str`})(y||(e.Type=y={}));function b(e,n,r){if(e instanceof t.Name){let i=n===y.Num;return r?i?(0,t._)`"[" + ${e} + "]"`:(0,t._)`"['" + ${e} + "']"`:i?(0,t._)`"/" + ${e}`:(0,t._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,t.getProperty)(e).toString():`/`+d(e)}e.getErrorPath=b;function x(e,t,n=e.opts.strictSchema){if(n){if(t=`strict mode: ${t}`,n===!0)throw Error(t);e.self.logger.warn(t)}}e.checkStrictMode=x})),sI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X();e.default={data:new t.Name(`data`),valCxt:new t.Name(`valCxt`),instancePath:new t.Name(`instancePath`),parentData:new t.Name(`parentData`),parentDataProperty:new t.Name(`parentDataProperty`),rootData:new t.Name(`rootData`),dynamicAnchors:new t.Name(`dynamicAnchors`),vErrors:new t.Name(`vErrors`),errors:new t.Name(`errors`),this:new t.Name(`this`),self:new t.Name(`self`),scope:new t.Name(`scope`),json:new t.Name(`json`),jsonPos:new t.Name(`jsonPos`),jsonLen:new t.Name(`jsonLen`),jsonPart:new t.Name(`jsonPart`)}})),cI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;var t=X(),n=oI(),r=sI();e.keywordError={message:({keyword:e})=>(0,t.str)`must pass "${e}" keyword validation`},e.keyword$DataError={message:({keyword:e,schemaType:n})=>n?(0,t.str)`"${e}" keyword must be ${n} ($data)`:(0,t.str)`"${e}" keyword is invalid ($data)`};function i(n,r=e.keywordError,i,a){let{it:o}=n,{gen:s,compositeRule:u,allErrors:f}=o,p=d(n,r,i);a??(u||f)?c(s,p):l(o,(0,t._)`[${p}]`)}e.reportError=i;function a(t,n=e.keywordError,i){let{it:a}=t,{gen:o,compositeRule:s,allErrors:u}=a;c(o,d(t,n,i)),s||u||l(a,r.default.vErrors)}e.reportExtraError=a;function o(e,n){e.assign(r.default.errors,n),e.if((0,t._)`${r.default.vErrors} !== null`,()=>e.if(n,()=>e.assign((0,t._)`${r.default.vErrors}.length`,n),()=>e.assign(r.default.vErrors,null)))}e.resetErrorsCount=o;function s({gen:e,keyword:n,schemaValue:i,data:a,errsCount:o,it:s}){if(o===void 0)throw Error(`ajv implementation error`);let c=e.name(`err`);e.forRange(`i`,o,r.default.errors,o=>{e.const(c,(0,t._)`${r.default.vErrors}[${o}]`),e.if((0,t._)`${c}.instancePath === undefined`,()=>e.assign((0,t._)`${c}.instancePath`,(0,t.strConcat)(r.default.instancePath,s.errorPath))),e.assign((0,t._)`${c}.schemaPath`,(0,t.str)`${s.errSchemaPath}/${n}`),s.opts.verbose&&(e.assign((0,t._)`${c}.schema`,i),e.assign((0,t._)`${c}.data`,a))})}e.extendErrors=s;function c(e,n){let i=e.const(`err`,n);e.if((0,t._)`${r.default.vErrors} === null`,()=>e.assign(r.default.vErrors,(0,t._)`[${i}]`),(0,t._)`${r.default.vErrors}.push(${i})`),e.code((0,t._)`${r.default.errors}++`)}function l(e,n){let{gen:r,validateName:i,schemaEnv:a}=e;a.$async?r.throw((0,t._)`new ${e.ValidationError}(${n})`):(r.assign((0,t._)`${i}.errors`,n),r.return(!1))}var u={keyword:new t.Name(`keyword`),schemaPath:new t.Name(`schemaPath`),params:new t.Name(`params`),propertyName:new t.Name(`propertyName`),message:new t.Name(`message`),schema:new t.Name(`schema`),parentSchema:new t.Name(`parentSchema`)};function d(e,n,r){let{createErrors:i}=e.it;return i===!1?(0,t._)`{}`:f(e,n,r)}function f(e,t,n={}){let{gen:r,it:i}=e,a=[p(i,n),m(e,n)];return h(e,t,a),r.object(...a)}function p({errorPath:e},{instancePath:i}){let a=i?(0,t.str)`${e}${(0,n.getErrorPath)(i,n.Type.Str)}`:e;return[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,a)]}function m({keyword:e,it:{errSchemaPath:r}},{schemaPath:i,parentSchema:a}){let o=a?r:(0,t.str)`${r}/${e}`;return i&&(o=(0,t.str)`${o}${(0,n.getErrorPath)(i,n.Type.Str)}`),[u.schemaPath,o]}function h(e,{params:n,message:i},a){let{keyword:o,data:s,schemaValue:c,it:l}=e,{opts:d,propertyName:f,topSchemaRef:p,schemaPath:m}=l;a.push([u.keyword,o],[u.params,typeof n==`function`?n(e):n||(0,t._)`{}`]),d.messages&&a.push([u.message,typeof i==`function`?i(e):i]),d.verbose&&a.push([u.schema,c],[u.parentSchema,(0,t._)`${p}${m}`],[r.default.data,s]),f&&a.push([u.propertyName,f])}})),lI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;var t=cI(),n=X(),r=sI(),i={message:`boolean schema is false`};function a(e){let{gen:t,schema:i,validateName:a}=e;i===!1?s(e,!1):typeof i==`object`&&i.$async===!0?t.return(r.default.data):(t.assign((0,n._)`${a}.errors`,null),t.return(!0))}e.topBoolOrEmptySchema=a;function o(e,t){let{gen:n,schema:r}=e;r===!1?(n.var(t,!1),s(e)):n.var(t,!0)}e.boolOrEmptySchema=o;function s(e,n){let{gen:r,data:a}=e,o={gen:r,keyword:`false schema`,data:a,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,t.reportError)(o,i,void 0,n)}})),uI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getRules=e.isJSONType=void 0;var t=new Set([`string`,`number`,`integer`,`boolean`,`null`,`object`,`array`]);function n(e){return typeof e==`string`&&t.has(e)}e.isJSONType=n;function r(){let e={number:{type:`number`,rules:[]},string:{type:`string`,rules:[]},array:{type:`array`,rules:[]},object:{type:`object`,rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}e.getRules=r})),dI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.shouldUseRule=e.shouldUseGroup=e.schemaHasRulesForType=void 0;function t({schema:e,self:t},r){let i=t.RULES.types[r];return i&&i!==!0&&n(e,i)}e.schemaHasRulesForType=t;function n(e,t){return t.rules.some(t=>r(e,t))}e.shouldUseGroup=n;function r(e,t){return e[t.keyword]!==void 0||t.definition.implements?.some(t=>e[t]!==void 0)}e.shouldUseRule=r})),fI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;var t=uI(),n=dI(),r=cI(),i=X(),a=oI(),o;(function(e){e[e.Correct=0]=`Correct`,e[e.Wrong=1]=`Wrong`})(o||(e.DataType=o={}));function s(e){let t=c(e.type);if(t.includes(`null`)){if(e.nullable===!1)throw Error(`type: null contradicts nullable: false`)}else{if(!t.length&&e.nullable!==void 0)throw Error(`"nullable" cannot be used without "type"`);e.nullable===!0&&t.push(`null`)}return t}e.getSchemaTypes=s;function c(e){let n=Array.isArray(e)?e:e?[e]:[];if(n.every(t.isJSONType))return n;throw Error(`type must be JSONType or JSONType[]: `+n.join(`,`))}e.getJSONTypes=c;function l(e,t){let{gen:r,data:i,opts:a}=e,s=d(t,a.coerceTypes),c=t.length>0&&!(s.length===0&&t.length===1&&(0,n.schemaHasRulesForType)(e,t[0]));if(c){let n=h(t,i,a.strictNumbers,o.Wrong);r.if(n,()=>{s.length?f(e,t,s):_(e)})}return c}e.coerceAndCheckDataType=l;var u=new Set([`string`,`number`,`integer`,`boolean`,`null`]);function d(e,t){return t?e.filter(e=>u.has(e)||t===`array`&&e===`array`):[]}function f(e,t,n){let{gen:r,data:a,opts:o}=e,s=r.let(`dataType`,(0,i._)`typeof ${a}`),c=r.let(`coerced`,(0,i._)`undefined`);o.coerceTypes===`array`&&r.if((0,i._)`${s} == 'object' && Array.isArray(${a}) && ${a}.length == 1`,()=>r.assign(a,(0,i._)`${a}[0]`).assign(s,(0,i._)`typeof ${a}`).if(h(t,a,o.strictNumbers),()=>r.assign(c,a))),r.if((0,i._)`${c} !== undefined`);for(let e of n)(u.has(e)||e===`array`&&o.coerceTypes===`array`)&&l(e);r.else(),_(e),r.endIf(),r.if((0,i._)`${c} !== undefined`,()=>{r.assign(a,c),p(e,c)});function l(e){switch(e){case`string`:r.elseIf((0,i._)`${s} == "number" || ${s} == "boolean"`).assign(c,(0,i._)`"" + ${a}`).elseIf((0,i._)`${a} === null`).assign(c,(0,i._)`""`);return;case`number`:r.elseIf((0,i._)`${s} == "boolean" || ${a} === null
361
+ `;break;case-2:a=` `;break;case-1:if(r)continue;a=` `;break;default:a=String.fromCharCode(i)}r=i===-2,n.push(a)}return n.join(``)}function IF(e){let t=e||{},n=t.loc||{},r=t.range||[void 0,void 0],i=LF(n.start,r[0]||t.start),a=LF(n.end,r[1]||t.end);if(i&&a)return{start:i,end:a}}function LF(e,t){if(e&&typeof e==`object`){let n=`line`in e?RF(e.line):void 0,r=`column`in e?RF(e.column):void 0;if(n&&r!==void 0)return{line:n,column:r+1,offset:RF(t)}}}function RF(e){return typeof e==`number`&&e>-1?e:void 0}var zF=2,BF=`https://github.com/micromark/micromark-extension-mdx-expression/tree/main/packages/micromark-extension-mdx-expression`,VF=`#unexpected-end-of-file-in-expression-expected-a-corresponding-closing-brace-for-`,HF=`#unexpected-lazy-line-in-expression-in-container-expected-line-to-be-prefixed`,UF=`#unexpected-type-in-code-expected-an-object-spread-spread`,WF=`#unexpected-extra-content-in-spread-only-a-single-spread-is-supported`,GF=`#could-not-parse-expression-with-acorn`;function KF(e,t,n,r,i,a,o,s,c,l,u){let d=this,f=this.events.length+3,p=0,m,g;return _;function _(t){return e.enter(n),e.enter(r),e.consume(t),e.exit(r),m=d.now(),v}function v(u){if(u===null){if(g)throw g;let e=new xe("Unexpected end of file in expression, expected a corresponding closing brace for `{`",{place:d.now(),ruleId:`unexpected-eof`,source:`micromark-extension-mdx-expression`});throw e.url=BF+VF,e}if(x(u))return e.enter(`lineEnding`),e.consume(u),e.exit(`lineEnding`),b;if(u===125&&p===0){let p=a?qF.call(d,a,o,i,f,m,l||!1,c||!1):{type:`ok`,estree:void 0};if(p.type===`ok`){e.enter(r),e.consume(u),e.exit(r);let i=e.exit(n);return s&&p.estree&&Object.assign(i,{estree:p.estree}),t}return g=p.message,e.enter(i),e.consume(u),y}return e.enter(i),y(u)}function y(t){return t===125&&p===0||t===null||x(t)?(e.exit(i),v(t)):(t===123&&!a?p+=1:t===125&&--p,e.consume(t),y)}function b(t){let n=d.now();if(n.line!==m.line&&!u&&d.parser.lazy[n.line]){let e=new xe("Unexpected lazy line in expression in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",{place:d.now(),ruleId:`unexpected-lazy`,source:`micromark-extension-mdx-expression`});throw e.url=BF+HF,e}return h(t)?ae(e,v,`linePrefix`,zF+1)(t):v(t)}}function qF(e,t,n,r,i,a,o){let s=jF(this.events.slice(r),{acorn:e,tokenTypes:[n],acornOptions:t,start:i,expression:!0,allowEmpty:a,prefix:o?`({`:``,suffix:o?`})`:``}),c=s.estree;if(o&&c){let e=c.body[0];if(e.type!==`ExpressionStatement`||e.expression.type!==`ObjectExpression`){let t=IF(e),n=new xe("Unexpected `"+e.type+"` in code: expected an object spread (`{...spread}`)",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=BF+UF,n}if(e.expression.properties[1]){let t=new xe(`Unexpected extra content in spread: only a single spread is supported`,{place:IF(e.expression.properties[1]).start,ruleId:`spread-extra`,source:`micromark-extension-mdx-expression`});throw t.url=BF+WF,t}if(e.expression.properties[0]&&e.expression.properties[0].type!==`SpreadElement`){let t=IF(e.expression.properties[0]),n=new xe("Unexpected `"+e.expression.properties[0].type+"` in code: only spread elements are supported",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=BF+UF,n}}if(s.error){let e=new xe(`Could not parse expression with acorn`,{cause:s.error,place:{line:s.error.loc.line,column:s.error.loc.column+1,offset:s.error.pos},ruleId:`acorn`,source:`micromark-extension-mdx-expression`});return e.url=BF+GF,{type:`nok`,message:e}}return{type:`ok`,estree:c}}function JF(e){let t=e||{},n=t.addResult,r=t.acorn,i=t.spread,a=t.allowEmpty,o;if(a??=!0,r){if(!r.parseExpressionAt)throw Error("Expected a proper `acorn` instance passed in as `options.acorn`");o=Object.assign({ecmaVersion:2024,sourceType:`module`},t.acornOptions)}else if(t.acornOptions||t.addResult)throw Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{123:{name:`mdxFlowExpression`,tokenize:s,concrete:!0}},text:{123:{name:`mdxTextExpression`,tokenize:c}}};function s(e,t,s){let c=this;return l;function l(e){return u(e)}function u(t){return KF.call(c,e,d,`mdxFlowExpression`,`mdxFlowExpressionMarker`,`mdxFlowExpressionChunk`,r,o,n,i,a)(t)}function d(t){return h(t)?ae(e,f,`whitespace`)(t):f(t)}function f(n){let r=c.parser.constructs.flow[60],i=(Array.isArray(r)?r:r?[r]:[]).find(function(e){return e.name===`mdxJsxFlowTag`});return n===60&&i?e.attempt(i,f,s)(n):n===null||x(n)?t(n):s(n)}}function c(e,t){let s=this;return c;function c(c){return KF.call(s,e,t,`mdxTextExpression`,`mdxTextExpressionMarker`,`mdxTextExpressionChunk`,r,o,n,i,a,!0)(c)}}}var YF=`https://github.com/micromark/micromark-extension-mdx-jsx`;function XF(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,g,_,v,b,S,w,T,E,ee,te,D,ne,re,ie,ae,se,ce){let O=this,le,ue;return de;function de(t){return e.enter(s),e.enter(c),e.consume(t),e.exit(c),k}function k(e){return C(e)?n(e):(le=A,Fe(e))}function A(t){if(t===47)return e.enter(l),e.consume(t),e.exit(l),le=fe,Fe;if(t===62)return Pe(t);if(t!==null&&t>=0&&oe(t))return e.enter(d),e.enter(f),e.consume(t),pe;Re(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===33?" (note: to create a comment in MDX, use `{/* text */}`)":``))}function fe(t){if(t===62)return Pe(t);if(t!==null&&t>=0&&oe(t))return e.enter(d),e.enter(f),e.consume(t),pe;Re(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===42||t===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function pe(t){if(t!==null&&t>=0&&Ce(t,{jsx:!0}))return e.consume(t),pe;if(t===46||t===47||t===58||t===62||t===123||C(t)||y(t))return e.exit(f),le=me,Fe(t);Re(t,`in name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function me(t){if(t===46)return e.enter(p),e.consume(t),e.exit(p),le=he,Fe;if(t===58)return e.enter(g),e.consume(t),e.exit(g),le=ve,Fe;if(t===47||t===62||t===123||t!==null&&t>=0&&oe(t))return e.exit(d),j(t);Re(t,`after name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function he(t){if(t!==null&&t>=0&&oe(t))return e.enter(m),e.consume(t),ge;Re(t,`before member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function ge(t){if(t!==null&&t>=0&&Ce(t,{jsx:!0}))return e.consume(t),ge;if(t===46||t===47||t===62||t===123||C(t)||y(t))return e.exit(m),le=_e,Fe(t);Re(t,`in member name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function _e(t){if(t===46)return e.enter(p),e.consume(t),e.exit(p),le=he,Fe;if(t===47||t===62||t===123||t!==null&&t>=0&&oe(t))return e.exit(d),j(t);Re(t,`after member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function ve(t){if(t!==null&&t>=0&&oe(t))return e.enter(_),e.consume(t),ye;Re(t,`before local name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===43||t!==null&&t>46&&t<58?" (note: to create a link in MDX, use `[text](url)`)":``))}function ye(t){if(t!==null&&t>=0&&Ce(t,{jsx:!0}))return e.consume(t),ye;if(t===47||t===62||t===123||C(t)||y(t))return e.exit(_),le=be,Fe(t);Re(t,`in local name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag")}function be(t){if(t===47||t===62||t===123||t!==null&&t>=0&&oe(t))return e.exit(d),j(t);Re(t,`after local name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function j(t){if(t===47)return e.enter(u),e.consume(t),e.exit(u),le=Ne,Fe;if(t===62)return Pe(t);if(t===123)return KF.call(O,e,Se,v,b,S,r,i,a,!0,!1,o)(t);if(t!==null&&t>=0&&oe(t))return e.enter(w),e.enter(T),e.enter(E),e.consume(t),we;Re(t,`before attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function Se(e){return le=j,Fe(e)}function we(t){if(t!==null&&t>=0&&Ce(t,{jsx:!0}))return e.consume(t),we;if(t===47||t===58||t===61||t===62||t===123||C(t)||y(t))return e.exit(E),le=Te,Fe(t);Re(t,`in attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function Te(t){if(t===58)return e.enter(ee),e.consume(t),e.exit(ee),le=Ee,Fe;if(t===61)return e.exit(T),e.enter(D),e.consume(t),e.exit(D),le=ke,Fe;if(t===47||t===62||t===123||C(t)||y(t)||t!==null&&t>=0&&oe(t))return e.exit(T),e.exit(w),le=j,Fe(t);Re(t,`after attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function Ee(t){if(t!==null&&t>=0&&oe(t))return e.enter(te),e.consume(t),De;Re(t,`before local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function De(t){if(t!==null&&t>=0&&Ce(t,{jsx:!0}))return e.consume(t),De;if(t===47||t===61||t===62||t===123||C(t)||y(t))return e.exit(te),e.exit(T),le=Oe,Fe(t);Re(t,`in local attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function Oe(t){if(t===61)return e.enter(D),e.consume(t),e.exit(D),le=ke,Fe;if(t===47||t===62||t===123||t!==null&&t>=0&&oe(t))return e.exit(w),j(t);Re(t,`after local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function ke(t){if(t===34||t===39)return e.enter(ne),e.enter(re),e.consume(t),e.exit(re),ue=t,je;if(t===123)return KF.call(O,e,Ae,ae,se,ce,r,i,a,!1,!1,o)(t);Re(t,`before attribute value`,"a character that can start an attribute value, such as `\"`, `'`, or `{`"+(t===60?" (note: to use an element or fragment as a prop value in MDX, use `{<element />}`)":``))}function Ae(t){return e.exit(w),le=j,Fe(t)}function je(t){return t===null&&Re(t,`in attribute value`,"a corresponding closing quote `"+String.fromCodePoint(ue)+"`"),t===ue?(e.enter(re),e.consume(t),e.exit(re),e.exit(ne),e.exit(w),ue=void 0,le=j,Fe):x(t)?(le=je,Fe(t)):(e.enter(ie),Me(t))}function Me(t){return t===null||t===ue||x(t)?(e.exit(ie),je(t)):(e.consume(t),Me)}function Ne(e){if(e===62)return Pe(e);Re(e,`after self-closing slash`,"`>` to end the tag"+(e===42||e===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function Pe(n){return e.enter(c),e.consume(n),e.exit(c),e.exit(s),t}function Fe(t){return x(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Le):h(t)||y(t)?(e.enter(`esWhitespace`),Ie(t)):le(t)}function Ie(t){return x(t)?(e.exit(`esWhitespace`),Fe(t)):h(t)||y(t)?(e.consume(t),Ie):(e.exit(`esWhitespace`),le(t))}function Le(e){if(!o&&O.parser.lazy[O.now().line]){let e=new xe("Unexpected lazy line in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",O.now(),`micromark-extension-mdx-jsx:unexpected-lazy`);throw e.url=YF+`#unexpected-lazy-line-in-container-expected-line-to-be`,e}return Fe(e)}function Re(e,t,n){let r=new xe(`Unexpected `+(e===null?`end of file`:"character `"+(e===96?"` ` `":String.fromCodePoint(e))+"` ("+ZF(e)+`)`)+` `+t+`, expected `+n,O.now(),`micromark-extension-mdx-jsx:unexpected-`+(e===null?`eof`:`character`));throw r.url=YF+(e===null?`#unexpected-end-of-file-at-expected-expect`:`#unexpected-character-at-expected-expect`),r}}function ZF(e){return`U+`+e.toString(16).toUpperCase().padStart(4,`0`)}function QF(e,t){return{name:`mdxJsxTextTag`,tokenize:n};function n(n,r,i){return XF.call(this,n,r,i,e,t.acornOptions,t.addResult,!0,`mdxJsxTextTag`,`mdxJsxTextTagMarker`,`mdxJsxTextTagClosingMarker`,`mdxJsxTextTagSelfClosingMarker`,`mdxJsxTextTagName`,`mdxJsxTextTagNamePrimary`,`mdxJsxTextTagNameMemberMarker`,`mdxJsxTextTagNameMember`,`mdxJsxTextTagNamePrefixMarker`,`mdxJsxTextTagNameLocal`,`mdxJsxTextTagExpressionAttribute`,`mdxJsxTextTagExpressionAttributeMarker`,`mdxJsxTextTagExpressionAttributeValue`,`mdxJsxTextTagAttribute`,`mdxJsxTextTagAttributeName`,`mdxJsxTextTagAttributeNamePrimary`,`mdxJsxTextTagAttributeNamePrefixMarker`,`mdxJsxTextTagAttributeNameLocal`,`mdxJsxTextTagAttributeInitializerMarker`,`mdxJsxTextTagAttributeValueLiteral`,`mdxJsxTextTagAttributeValueLiteralMarker`,`mdxJsxTextTagAttributeValueLiteralValue`,`mdxJsxTextTagAttributeValueExpression`,`mdxJsxTextTagAttributeValueExpressionMarker`,`mdxJsxTextTagAttributeValueExpressionValue`)}}function $F(e,t){return{concrete:!0,name:`mdxJsxFlowTag`,tokenize:n};function n(n,r,i){let a=this;return o;function o(e){return s(e)}function s(r){return XF.call(a,n,c,i,e,t.acornOptions,t.addResult,!1,`mdxJsxFlowTag`,`mdxJsxFlowTagMarker`,`mdxJsxFlowTagClosingMarker`,`mdxJsxFlowTagSelfClosingMarker`,`mdxJsxFlowTagName`,`mdxJsxFlowTagNamePrimary`,`mdxJsxFlowTagNameMemberMarker`,`mdxJsxFlowTagNameMember`,`mdxJsxFlowTagNamePrefixMarker`,`mdxJsxFlowTagNameLocal`,`mdxJsxFlowTagExpressionAttribute`,`mdxJsxFlowTagExpressionAttributeMarker`,`mdxJsxFlowTagExpressionAttributeValue`,`mdxJsxFlowTagAttribute`,`mdxJsxFlowTagAttributeName`,`mdxJsxFlowTagAttributeNamePrimary`,`mdxJsxFlowTagAttributeNamePrefixMarker`,`mdxJsxFlowTagAttributeNameLocal`,`mdxJsxFlowTagAttributeInitializerMarker`,`mdxJsxFlowTagAttributeValueLiteral`,`mdxJsxFlowTagAttributeValueLiteralMarker`,`mdxJsxFlowTagAttributeValueLiteralValue`,`mdxJsxFlowTagAttributeValueExpression`,`mdxJsxFlowTagAttributeValueExpressionMarker`,`mdxJsxFlowTagAttributeValueExpressionValue`)(r)}function c(e){return h(e)?ae(n,l,`whitespace`)(e):l(e)}function l(e){let t=a.parser.constructs.flow[123],s=Array.isArray(t)?t:t?[t]:[],c;for(let e of s)if(e.name===`mdxFlowExpression`){c=e;break}return e===60?o(e):e===123&&c?n.attempt(c,l,i)(e):e===null||x(e)?r(e):i(e)}}}function eI(e){let t=e||{},n=t.acorn,r;if(n){if(!n.parse||!n.parseExpressionAt)throw Error("Expected a proper `acorn` instance passed in as `options.acorn`");r=Object.assign({ecmaVersion:2024,sourceType:`module`},t.acornOptions,{locations:!0})}else if(t.acornOptions||t.addResult)throw Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{60:$F(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})},text:{60:QF(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})}}}function tI(){return{disable:{null:[`autolink`,`codeIndented`,`htmlFlow`,`htmlText`]}}}function nI(){return se([JF(),eI(),tI()])}var rI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;var t=class{};e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var n=class extends t{constructor(t){if(super(),!e.IDENTIFIER.test(t))throw Error(`CodeGen: name must be a valid identifier`);this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};e.Name=n;var r=class extends t{constructor(e){super(),this._items=typeof e==`string`?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===``||e===`""`}get str(){return this._str??=this._items.reduce((e,t)=>`${e}${t}`,``)}get names(){return this._names??=this._items.reduce((e,t)=>(t instanceof n&&(e[t.str]=(e[t.str]||0)+1),e),{})}};e._Code=r,e.nil=new r(``);function i(e,...t){let n=[e[0]],i=0;for(;i<t.length;)s(n,t[i]),n.push(e[++i]);return new r(n)}e._=i;var a=new r(`+`);function o(e,...t){let n=[p(e[0])],i=0;for(;i<t.length;)n.push(a),s(n,t[i]),n.push(a,p(e[++i]));return c(n),new r(n)}e.str=o;function s(e,t){t instanceof r?e.push(...t._items):t instanceof n?e.push(t):e.push(d(t))}e.addCodeArg=s;function c(e){let t=1;for(;t<e.length-1;){if(e[t]===a){let n=l(e[t-1],e[t+1]);if(n!==void 0){e.splice(t-1,3,n);continue}e[t++]=`+`}t++}}function l(e,t){if(t===`""`)return e;if(e===`""`)return t;if(typeof e==`string`)return t instanceof n||e[e.length-1]!==`"`?void 0:typeof t==`string`?t[0]===`"`?e.slice(0,-1)+t.slice(1):void 0:`${e.slice(0,-1)}${t}"`;if(typeof t==`string`&&t[0]===`"`&&!(e instanceof n))return`"${e}${t.slice(1)}`}function u(e,t){return t.emptyStr()?e:e.emptyStr()?t:o`${e}${t}`}e.strConcat=u;function d(e){return typeof e==`number`||typeof e==`boolean`||e===null?e:p(Array.isArray(e)?e.join(`,`):e)}function f(e){return new r(p(e))}e.stringify=f;function p(e){return JSON.stringify(e).replace(/\u2028/g,`\\u2028`).replace(/\u2029/g,`\\u2029`)}e.safeStringify=p;function m(t){return typeof t==`string`&&e.IDENTIFIER.test(t)?new r(`.${t}`):i`[${t}]`}e.getProperty=m;function h(t){if(typeof t==`string`&&e.IDENTIFIER.test(t))return new r(`${t}`);throw Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}e.getEsmExportName=h;function g(e){return new r(e.toString())}e.regexpCode=g})),iI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;var t=rI(),n=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},r;(function(e){e[e.Started=0]=`Started`,e[e.Completed=1]=`Completed`})(r||(e.UsedValueState=r={})),e.varKinds={const:new t.Name(`const`),let:new t.Name(`let`),var:new t.Name(`var`)};var i=class{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof t.Name?e:this.name(e)}name(e){return new t.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){if((this._parent?._prefixes)?.has(e)||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};e.Scope=i;var a=class extends t.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:n,itemIndex:r}){this.value=e,this.scopePath=(0,t._)`.${new t.Name(n)}[${r}]`}};e.ValueScopeName=a;var o=(0,t._)`\n`;e.ValueScope=class extends i{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?o:t.nil}}get(){return this._scope}name(e){return new a(e,this._newName(e))}value(e,t){if(t.ref===void 0)throw Error(`CodeGen: ref must be passed in value`);let n=this.toName(e),{prefix:r}=n,i=t.key??t.ref,a=this._values[r];if(a){let e=a.get(i);if(e)return e}else a=this._values[r]=new Map;a.set(i,n);let o=this._scope[r]||(this._scope[r]=[]),s=o.length;return o[s]=t.ref,n.setValue(t,{property:r,itemIndex:s}),n}getValue(e,t){let n=this._values[e];if(n)return n.get(t)}scopeRefs(e,n=this._values){return this._reduceValues(n,n=>{if(n.scopePath===void 0)throw Error(`CodeGen: name "${n}" has no value`);return(0,t._)`${e}${n.scopePath}`})}scopeCode(e=this._values,t,n){return this._reduceValues(e,e=>{if(e.value===void 0)throw Error(`CodeGen: name "${e}" has no value`);return e.value.code},t,n)}_reduceValues(i,a,o={},s){let c=t.nil;for(let l in i){let u=i[l];if(!u)continue;let d=o[l]=o[l]||new Map;u.forEach(i=>{if(d.has(i))return;d.set(i,r.Started);let o=a(i);if(o){let n=this.opts.es5?e.varKinds.var:e.varKinds.const;c=(0,t._)`${c}${n} ${i} = ${o};${this.opts._n}`}else if(o=s?.(i))c=(0,t._)`${c}${o}${this.opts._n}`;else throw new n(i);d.set(i,r.Completed)})}return c}}})),X=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;var t=rI(),n=iI(),r=rI();Object.defineProperty(e,`_`,{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,`str`,{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,`strConcat`,{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(e,`nil`,{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,`getProperty`,{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(e,`stringify`,{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,`regexpCode`,{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(e,`Name`,{enumerable:!0,get:function(){return r.Name}});var i=iI();Object.defineProperty(e,`Scope`,{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(e,`ValueScope`,{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(e,`ValueScopeName`,{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(e,`varKinds`,{enumerable:!0,get:function(){return i.varKinds}}),e.operators={GT:new t._Code(`>`),GTE:new t._Code(`>=`),LT:new t._Code(`<`),LTE:new t._Code(`<=`),EQ:new t._Code(`===`),NEQ:new t._Code(`!==`),NOT:new t._Code(`!`),OR:new t._Code(`||`),AND:new t._Code(`&&`),ADD:new t._Code(`+`)};var a=class{optimizeNodes(){return this}optimizeNames(e,t){return this}},o=class extends a{constructor(e,t,n){super(),this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){let r=e?n.varKinds.var:this.varKind,i=this.rhs===void 0?``:` = ${this.rhs}`;return`${r} ${this.name}${i};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&=D(this.rhs,e,t),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}},s=class extends a{constructor(e,t,n){super(),this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,n){if(!(this.lhs instanceof t.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=D(this.rhs,e,n),this}get names(){return te(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}},c=class extends s{constructor(e,t,n,r){super(e,n,r),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},l=class extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},u=class extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:``};`+e}},d=class extends a{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},f=class extends a{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=D(this.code,e,t),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}},p=class extends a{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,n)=>t+n.render(e),``)}optimizeNodes(){let{nodes:e}=this,t=e.length;for(;t--;){let n=e[t].optimizeNodes();Array.isArray(n)?e.splice(t,1,...n):n?e[t]=n:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:n}=this,r=n.length;for(;r--;){let i=n[r];i.optimizeNames(e,t)||(ne(e,i.names),n.splice(r,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>ee(e,t.names),{})}},m=class extends p{render(e){return`{`+e._n+super.render(e)+`}`+e._n}},h=class extends p{},g=class extends m{};g.kind=`else`;var _=class e extends m{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+=`else `+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let n=this.else;if(n){let e=n.optimizeNodes();n=this.else=Array.isArray(e)?new g(e):e}if(n)return t===!1?n instanceof e?n:n.nodes:this.nodes.length?this:new e(re(t),n instanceof e?[n]:n.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(e,t){if(this.else=this.else?.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=D(this.condition,e,t),this}get names(){let e=super.names;return te(e,this.condition),this.else&&ee(e,this.else.names),e}};_.kind=`if`;var v=class extends m{};v.kind=`for`;var y=class extends v{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=D(this.iteration,e,t),this}get names(){return ee(super.names,this.iteration.names)}},b=class extends v{constructor(e,t,n,r){super(),this.varKind=e,this.name=t,this.from=n,this.to=r}render(e){let t=e.es5?n.varKinds.var:this.varKind,{name:r,from:i,to:a}=this;return`for(${t} ${r}=${i}; ${r}<${a}; ${r}++)`+super.render(e)}get names(){return te(te(super.names,this.from),this.to)}},x=class extends v{constructor(e,t,n,r){super(),this.loop=e,this.varKind=t,this.name=n,this.iterable=r}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=D(this.iterable,e,t),this}get names(){return ee(super.names,this.iterable.names)}},S=class extends m{constructor(e,t,n){super(),this.name=e,this.args=t,this.async=n}render(e){return`${this.async?`async `:``}function ${this.name}(${this.args})`+super.render(e)}};S.kind=`func`;var C=class extends p{render(e){return`return `+super.render(e)}};C.kind=`return`;var w=class extends m{render(e){let t=`try`+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)==null||e.optimizeNodes(),(t=this.finally)==null||t.optimizeNodes(),this}optimizeNames(e,t){var n,r;return super.optimizeNames(e,t),(n=this.catch)==null||n.optimizeNames(e,t),(r=this.finally)==null||r.optimizeNames(e,t),this}get names(){let e=super.names;return this.catch&&ee(e,this.catch.names),this.finally&&ee(e,this.finally.names),e}},T=class extends m{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};T.kind=`catch`;var E=class extends m{render(e){return`finally`+super.render(e)}};E.kind=`finally`,e.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
362
+ `:``},this._extScope=e,this._scope=new n.Scope({parent:e}),this._nodes=[new h]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,n,r){let i=this._scope.toName(t);return n!==void 0&&r&&(this._constants[i.str]=n),this._leafNode(new o(e,i,n)),i}const(e,t,r){return this._def(n.varKinds.const,e,t,r)}let(e,t,r){return this._def(n.varKinds.let,e,t,r)}var(e,t,r){return this._def(n.varKinds.var,e,t,r)}assign(e,t,n){return this._leafNode(new s(e,t,n))}add(t,n){return this._leafNode(new c(t,e.operators.ADD,n))}code(e){return typeof e==`function`?e():e!==t.nil&&this._leafNode(new f(e)),this}object(...e){let n=[`{`];for(let[r,i]of e)n.length>1&&n.push(`,`),n.push(r),(r!==i||this.opts.es5)&&(n.push(`:`),(0,t.addCodeArg)(n,i));return n.push(`}`),new t._Code(n)}if(e,t,n){if(this._blockNode(new _(e)),t&&n)this.code(t).else().code(n).endIf();else if(t)this.code(t).endIf();else if(n)throw Error(`CodeGen: "else" body without "then" body`);return this}elseIf(e){return this._elseNode(new _(e))}else(){return this._elseNode(new g)}endIf(){return this._endBlockNode(_,g)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new y(e),t)}forRange(e,t,r,i,a=this.opts.es5?n.varKinds.var:n.varKinds.let){let o=this._scope.toName(e);return this._for(new b(a,o,t,r),()=>i(o))}forOf(e,r,i,a=n.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let e=r instanceof t.Name?r:this.var(`_arr`,r);return this.forRange(`_i`,0,(0,t._)`${e}.length`,n=>{this.var(o,(0,t._)`${e}[${n}]`),i(o)})}return this._for(new x(`of`,a,o,r),()=>i(o))}forIn(e,r,i,a=this.opts.es5?n.varKinds.var:n.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,t._)`Object.keys(${r})`,i);let o=this._scope.toName(e);return this._for(new x(`in`,a,o,r),()=>i(o))}endFor(){return this._endBlockNode(v)}label(e){return this._leafNode(new l(e))}break(e){return this._leafNode(new u(e))}return(e){let t=new C;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error(`CodeGen: "return" should have one node`);return this._endBlockNode(C)}try(e,t,n){if(!t&&!n)throw Error(`CodeGen: "try" without "catch" and "finally"`);let r=new w;if(this._blockNode(r),this.code(e),t){let e=this.name(`e`);this._currNode=r.catch=new T(e),t(e)}return n&&(this._currNode=r.finally=new E,this.code(n)),this._endBlockNode(T,E)}throw(e){return this._leafNode(new d(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw Error(`CodeGen: not in self-balancing block`);let n=this._nodes.length-t;if(n<0||e!==void 0&&n!==e)throw Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=t,this}func(e,n=t.nil,r,i){return this._blockNode(new S(e,n,r)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(S)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let n=this._currNode;if(n instanceof e||t&&n instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof _))throw Error(`CodeGen: "else" without "if"`);return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}};function ee(e,t){for(let n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function te(e,n){return n instanceof t._CodeOrName?ee(e,n.names):e}function D(e,n,r){if(e instanceof t.Name)return i(e);if(!a(e))return e;return new t._Code(e._items.reduce((e,n)=>(n instanceof t.Name&&(n=i(n)),n instanceof t._Code?e.push(...n._items):e.push(n),e),[]));function i(e){let t=r[e.str];return t===void 0||n[e.str]!==1?e:(delete n[e.str],t)}function a(e){return e instanceof t._Code&&e._items.some(e=>e instanceof t.Name&&n[e.str]===1&&r[e.str]!==void 0)}}function ne(e,t){for(let n in t)e[n]=(e[n]||0)-(t[n]||0)}function re(e){return typeof e==`boolean`||typeof e==`number`||e===null?!e:(0,t._)`!${O(e)}`}e.not=re;var ie=ce(e.operators.AND);function ae(...e){return e.reduce(ie)}e.and=ae;var oe=ce(e.operators.OR);function se(...e){return e.reduce(oe)}e.or=se;function ce(e){return(n,r)=>n===t.nil?r:r===t.nil?n:(0,t._)`${O(n)} ${e} ${O(r)}`}function O(e){return e instanceof t.Name?e:(0,t._)`(${e})`}})),aI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;var t=X(),n=rI();function r(e){let t={};for(let n of e)t[n]=!0;return t}e.toHash=r;function i(e,t){return typeof t==`boolean`?t:Object.keys(t).length===0?!0:(a(e,t),!o(t,e.self.RULES.all))}e.alwaysValidSchema=i;function a(e,t=e.schema){let{opts:n,self:r}=e;if(!n.strictSchema||typeof t==`boolean`)return;let i=r.RULES.keywords;for(let n in t)i[n]||x(e,`unknown keyword: "${n}"`)}e.checkUnknownRules=a;function o(e,t){if(typeof e==`boolean`)return!e;for(let n in e)if(t[n])return!0;return!1}e.schemaHasRules=o;function s(e,t){if(typeof e==`boolean`)return!e;for(let n in e)if(n!==`$ref`&&t.all[n])return!0;return!1}e.schemaHasRulesButRef=s;function c({topSchemaRef:e,schemaPath:n},r,i,a){if(!a){if(typeof r==`number`||typeof r==`boolean`)return r;if(typeof r==`string`)return(0,t._)`${r}`}return(0,t._)`${e}${n}${(0,t.getProperty)(i)}`}e.schemaRefOrVal=c;function l(e){return f(decodeURIComponent(e))}e.unescapeFragment=l;function u(e){return encodeURIComponent(d(e))}e.escapeFragment=u;function d(e){return typeof e==`number`?`${e}`:e.replace(/~/g,`~0`).replace(/\//g,`~1`)}e.escapeJsonPointer=d;function f(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}e.unescapeJsonPointer=f;function p(e,t){if(Array.isArray(e))for(let n of e)t(n);else t(e)}e.eachItem=p;function m({mergeNames:e,mergeToName:n,mergeValues:r,resultToName:i}){return(a,o,s,c)=>{let l=s===void 0?o:s instanceof t.Name?(o instanceof t.Name?e(a,o,s):n(a,o,s),s):o instanceof t.Name?(n(a,s,o),o):r(o,s);return c===t.Name&&!(l instanceof t.Name)?i(a,l):l}}e.mergeEvaluated={props:m({mergeNames:(e,n,r)=>e.if((0,t._)`${r} !== true && ${n} !== undefined`,()=>{e.if((0,t._)`${n} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,t._)`${r} || {}`).code((0,t._)`Object.assign(${r}, ${n})`))}),mergeToName:(e,n,r)=>e.if((0,t._)`${r} !== true`,()=>{n===!0?e.assign(r,!0):(e.assign(r,(0,t._)`${r} || {}`),g(e,r,n))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:h}),items:m({mergeNames:(e,n,r)=>e.if((0,t._)`${r} !== true && ${n} !== undefined`,()=>e.assign(r,(0,t._)`${n} === true ? true : ${r} > ${n} ? ${r} : ${n}`)),mergeToName:(e,n,r)=>e.if((0,t._)`${r} !== true`,()=>e.assign(r,n===!0?!0:(0,t._)`${r} > ${n} ? ${r} : ${n}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var(`items`,t)})};function h(e,n){if(n===!0)return e.var(`props`,!0);let r=e.var(`props`,(0,t._)`{}`);return n!==void 0&&g(e,r,n),r}e.evaluatedPropsToName=h;function g(e,n,r){Object.keys(r).forEach(r=>e.assign((0,t._)`${n}${(0,t.getProperty)(r)}`,!0))}e.setEvaluated=g;var _={};function v(e,t){return e.scopeValue(`func`,{ref:t,code:_[t.code]||(_[t.code]=new n._Code(t.code))})}e.useFunc=v;var y;(function(e){e[e.Num=0]=`Num`,e[e.Str=1]=`Str`})(y||(e.Type=y={}));function b(e,n,r){if(e instanceof t.Name){let i=n===y.Num;return r?i?(0,t._)`"[" + ${e} + "]"`:(0,t._)`"['" + ${e} + "']"`:i?(0,t._)`"/" + ${e}`:(0,t._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,t.getProperty)(e).toString():`/`+d(e)}e.getErrorPath=b;function x(e,t,n=e.opts.strictSchema){if(n){if(t=`strict mode: ${t}`,n===!0)throw Error(t);e.self.logger.warn(t)}}e.checkStrictMode=x})),oI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X();e.default={data:new t.Name(`data`),valCxt:new t.Name(`valCxt`),instancePath:new t.Name(`instancePath`),parentData:new t.Name(`parentData`),parentDataProperty:new t.Name(`parentDataProperty`),rootData:new t.Name(`rootData`),dynamicAnchors:new t.Name(`dynamicAnchors`),vErrors:new t.Name(`vErrors`),errors:new t.Name(`errors`),this:new t.Name(`this`),self:new t.Name(`self`),scope:new t.Name(`scope`),json:new t.Name(`json`),jsonPos:new t.Name(`jsonPos`),jsonLen:new t.Name(`jsonLen`),jsonPart:new t.Name(`jsonPart`)}})),sI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;var t=X(),n=aI(),r=oI();e.keywordError={message:({keyword:e})=>(0,t.str)`must pass "${e}" keyword validation`},e.keyword$DataError={message:({keyword:e,schemaType:n})=>n?(0,t.str)`"${e}" keyword must be ${n} ($data)`:(0,t.str)`"${e}" keyword is invalid ($data)`};function i(n,r=e.keywordError,i,a){let{it:o}=n,{gen:s,compositeRule:u,allErrors:f}=o,p=d(n,r,i);a??(u||f)?c(s,p):l(o,(0,t._)`[${p}]`)}e.reportError=i;function a(t,n=e.keywordError,i){let{it:a}=t,{gen:o,compositeRule:s,allErrors:u}=a;c(o,d(t,n,i)),s||u||l(a,r.default.vErrors)}e.reportExtraError=a;function o(e,n){e.assign(r.default.errors,n),e.if((0,t._)`${r.default.vErrors} !== null`,()=>e.if(n,()=>e.assign((0,t._)`${r.default.vErrors}.length`,n),()=>e.assign(r.default.vErrors,null)))}e.resetErrorsCount=o;function s({gen:e,keyword:n,schemaValue:i,data:a,errsCount:o,it:s}){if(o===void 0)throw Error(`ajv implementation error`);let c=e.name(`err`);e.forRange(`i`,o,r.default.errors,o=>{e.const(c,(0,t._)`${r.default.vErrors}[${o}]`),e.if((0,t._)`${c}.instancePath === undefined`,()=>e.assign((0,t._)`${c}.instancePath`,(0,t.strConcat)(r.default.instancePath,s.errorPath))),e.assign((0,t._)`${c}.schemaPath`,(0,t.str)`${s.errSchemaPath}/${n}`),s.opts.verbose&&(e.assign((0,t._)`${c}.schema`,i),e.assign((0,t._)`${c}.data`,a))})}e.extendErrors=s;function c(e,n){let i=e.const(`err`,n);e.if((0,t._)`${r.default.vErrors} === null`,()=>e.assign(r.default.vErrors,(0,t._)`[${i}]`),(0,t._)`${r.default.vErrors}.push(${i})`),e.code((0,t._)`${r.default.errors}++`)}function l(e,n){let{gen:r,validateName:i,schemaEnv:a}=e;a.$async?r.throw((0,t._)`new ${e.ValidationError}(${n})`):(r.assign((0,t._)`${i}.errors`,n),r.return(!1))}var u={keyword:new t.Name(`keyword`),schemaPath:new t.Name(`schemaPath`),params:new t.Name(`params`),propertyName:new t.Name(`propertyName`),message:new t.Name(`message`),schema:new t.Name(`schema`),parentSchema:new t.Name(`parentSchema`)};function d(e,n,r){let{createErrors:i}=e.it;return i===!1?(0,t._)`{}`:f(e,n,r)}function f(e,t,n={}){let{gen:r,it:i}=e,a=[p(i,n),m(e,n)];return h(e,t,a),r.object(...a)}function p({errorPath:e},{instancePath:i}){let a=i?(0,t.str)`${e}${(0,n.getErrorPath)(i,n.Type.Str)}`:e;return[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,a)]}function m({keyword:e,it:{errSchemaPath:r}},{schemaPath:i,parentSchema:a}){let o=a?r:(0,t.str)`${r}/${e}`;return i&&(o=(0,t.str)`${o}${(0,n.getErrorPath)(i,n.Type.Str)}`),[u.schemaPath,o]}function h(e,{params:n,message:i},a){let{keyword:o,data:s,schemaValue:c,it:l}=e,{opts:d,propertyName:f,topSchemaRef:p,schemaPath:m}=l;a.push([u.keyword,o],[u.params,typeof n==`function`?n(e):n||(0,t._)`{}`]),d.messages&&a.push([u.message,typeof i==`function`?i(e):i]),d.verbose&&a.push([u.schema,c],[u.parentSchema,(0,t._)`${p}${m}`],[r.default.data,s]),f&&a.push([u.propertyName,f])}})),cI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;var t=sI(),n=X(),r=oI(),i={message:`boolean schema is false`};function a(e){let{gen:t,schema:i,validateName:a}=e;i===!1?s(e,!1):typeof i==`object`&&i.$async===!0?t.return(r.default.data):(t.assign((0,n._)`${a}.errors`,null),t.return(!0))}e.topBoolOrEmptySchema=a;function o(e,t){let{gen:n,schema:r}=e;r===!1?(n.var(t,!1),s(e)):n.var(t,!0)}e.boolOrEmptySchema=o;function s(e,n){let{gen:r,data:a}=e,o={gen:r,keyword:`false schema`,data:a,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,t.reportError)(o,i,void 0,n)}})),lI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getRules=e.isJSONType=void 0;var t=new Set([`string`,`number`,`integer`,`boolean`,`null`,`object`,`array`]);function n(e){return typeof e==`string`&&t.has(e)}e.isJSONType=n;function r(){let e={number:{type:`number`,rules:[]},string:{type:`string`,rules:[]},array:{type:`array`,rules:[]},object:{type:`object`,rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}e.getRules=r})),uI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.shouldUseRule=e.shouldUseGroup=e.schemaHasRulesForType=void 0;function t({schema:e,self:t},r){let i=t.RULES.types[r];return i&&i!==!0&&n(e,i)}e.schemaHasRulesForType=t;function n(e,t){return t.rules.some(t=>r(e,t))}e.shouldUseGroup=n;function r(e,t){return e[t.keyword]!==void 0||t.definition.implements?.some(t=>e[t]!==void 0)}e.shouldUseRule=r})),dI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;var t=lI(),n=uI(),r=sI(),i=X(),a=aI(),o;(function(e){e[e.Correct=0]=`Correct`,e[e.Wrong=1]=`Wrong`})(o||(e.DataType=o={}));function s(e){let t=c(e.type);if(t.includes(`null`)){if(e.nullable===!1)throw Error(`type: null contradicts nullable: false`)}else{if(!t.length&&e.nullable!==void 0)throw Error(`"nullable" cannot be used without "type"`);e.nullable===!0&&t.push(`null`)}return t}e.getSchemaTypes=s;function c(e){let n=Array.isArray(e)?e:e?[e]:[];if(n.every(t.isJSONType))return n;throw Error(`type must be JSONType or JSONType[]: `+n.join(`,`))}e.getJSONTypes=c;function l(e,t){let{gen:r,data:i,opts:a}=e,s=d(t,a.coerceTypes),c=t.length>0&&!(s.length===0&&t.length===1&&(0,n.schemaHasRulesForType)(e,t[0]));if(c){let n=h(t,i,a.strictNumbers,o.Wrong);r.if(n,()=>{s.length?f(e,t,s):_(e)})}return c}e.coerceAndCheckDataType=l;var u=new Set([`string`,`number`,`integer`,`boolean`,`null`]);function d(e,t){return t?e.filter(e=>u.has(e)||t===`array`&&e===`array`):[]}function f(e,t,n){let{gen:r,data:a,opts:o}=e,s=r.let(`dataType`,(0,i._)`typeof ${a}`),c=r.let(`coerced`,(0,i._)`undefined`);o.coerceTypes===`array`&&r.if((0,i._)`${s} == 'object' && Array.isArray(${a}) && ${a}.length == 1`,()=>r.assign(a,(0,i._)`${a}[0]`).assign(s,(0,i._)`typeof ${a}`).if(h(t,a,o.strictNumbers),()=>r.assign(c,a))),r.if((0,i._)`${c} !== undefined`);for(let e of n)(u.has(e)||e===`array`&&o.coerceTypes===`array`)&&l(e);r.else(),_(e),r.endIf(),r.if((0,i._)`${c} !== undefined`,()=>{r.assign(a,c),p(e,c)});function l(e){switch(e){case`string`:r.elseIf((0,i._)`${s} == "number" || ${s} == "boolean"`).assign(c,(0,i._)`"" + ${a}`).elseIf((0,i._)`${a} === null`).assign(c,(0,i._)`""`);return;case`number`:r.elseIf((0,i._)`${s} == "boolean" || ${a} === null
363
363
  || (${s} == "string" && ${a} && ${a} == +${a})`).assign(c,(0,i._)`+${a}`);return;case`integer`:r.elseIf((0,i._)`${s} === "boolean" || ${a} === null
364
364
  || (${s} === "string" && ${a} && ${a} == +${a} && !(${a} % 1))`).assign(c,(0,i._)`+${a}`);return;case`boolean`:r.elseIf((0,i._)`${a} === "false" || ${a} === 0 || ${a} === null`).assign(c,!1).elseIf((0,i._)`${a} === "true" || ${a} === 1`).assign(c,!0);return;case`null`:r.elseIf((0,i._)`${a} === "" || ${a} === 0 || ${a} === false`),r.assign(c,null);return;case`array`:r.elseIf((0,i._)`${s} === "string" || ${s} === "number"
365
- || ${s} === "boolean" || ${a} === null`).assign(c,(0,i._)`[${a}]`)}}}function p({gen:e,parentData:t,parentDataProperty:n},r){e.if((0,i._)`${t} !== undefined`,()=>e.assign((0,i._)`${t}[${n}]`,r))}function m(e,t,n,r=o.Correct){let a=r===o.Correct?i.operators.EQ:i.operators.NEQ,s;switch(e){case`null`:return(0,i._)`${t} ${a} null`;case`array`:s=(0,i._)`Array.isArray(${t})`;break;case`object`:s=(0,i._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case`integer`:s=c((0,i._)`!(${t} % 1) && !isNaN(${t})`);break;case`number`:s=c();break;default:return(0,i._)`typeof ${t} ${a} ${e}`}return r===o.Correct?s:(0,i.not)(s);function c(e=i.nil){return(0,i.and)((0,i._)`typeof ${t} == "number"`,e,n?(0,i._)`isFinite(${t})`:i.nil)}}e.checkDataType=m;function h(e,t,n,r){if(e.length===1)return m(e[0],t,n,r);let o,s=(0,a.toHash)(e);if(s.array&&s.object){let e=(0,i._)`typeof ${t} != "object"`;o=s.null?e:(0,i._)`!${t} || ${e}`,delete s.null,delete s.array,delete s.object}else o=i.nil;s.number&&delete s.integer;for(let e in s)o=(0,i.and)(o,m(e,t,n,r));return o}e.checkDataTypes=h;var g={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e==`string`?(0,i._)`{type: ${e}}`:(0,i._)`{type: ${t}}`};function _(e){let t=v(e);(0,r.reportError)(t,g)}e.reportTypeError=_;function v(e){let{gen:t,data:n,schema:r}=e,i=(0,a.schemaRefOrVal)(e,r,`type`);return{gen:t,keyword:`type`,data:n,schema:r.type,schemaCode:i,schemaValue:i,parentSchema:r,params:{},it:e}}})),pI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.assignDefaults=void 0;var t=X(),n=oI();function r(e,t){let{properties:n,items:r}=e.schema;if(t===`object`&&n)for(let t in n)i(e,t,n[t].default);else t===`array`&&Array.isArray(r)&&r.forEach((t,n)=>i(e,n,t.default))}e.assignDefaults=r;function i(e,r,i){let{gen:a,compositeRule:o,data:s,opts:c}=e;if(i===void 0)return;let l=(0,t._)`${s}${(0,t.getProperty)(r)}`;if(o){(0,n.checkStrictMode)(e,`default is ignored for: ${l}`);return}let u=(0,t._)`${l} === undefined`;c.useDefaults===`empty`&&(u=(0,t._)`${u} || ${l} === null || ${l} === ""`),a.if(u,(0,t._)`${l} = ${(0,t.stringify)(i)}`)}})),mI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.validateUnion=e.validateArray=e.usePattern=e.callValidateCode=e.schemaProperties=e.allSchemaProperties=e.noPropertyInData=e.propertyInData=e.isOwnProperty=e.hasPropFunc=e.reportMissingProp=e.checkMissingProp=e.checkReportMissingProp=void 0;var t=X(),n=oI(),r=sI(),i=oI();function a(e,n){let{gen:r,data:i,it:a}=e;r.if(d(r,i,n,a.opts.ownProperties),()=>{e.setParams({missingProperty:(0,t._)`${n}`},!0),e.error()})}e.checkReportMissingProp=a;function o({gen:e,data:n,it:{opts:r}},i,a){return(0,t.or)(...i.map(i=>(0,t.and)(d(e,n,i,r.ownProperties),(0,t._)`${a} = ${i}`)))}e.checkMissingProp=o;function s(e,t){e.setParams({missingProperty:t},!0),e.error()}e.reportMissingProp=s;function c(e){return e.scopeValue(`func`,{ref:Object.prototype.hasOwnProperty,code:(0,t._)`Object.prototype.hasOwnProperty`})}e.hasPropFunc=c;function l(e,n,r){return(0,t._)`${c(e)}.call(${n}, ${r})`}e.isOwnProperty=l;function u(e,n,r,i){let a=(0,t._)`${n}${(0,t.getProperty)(r)} !== undefined`;return i?(0,t._)`${a} && ${l(e,n,r)}`:a}e.propertyInData=u;function d(e,n,r,i){let a=(0,t._)`${n}${(0,t.getProperty)(r)} === undefined`;return i?(0,t.or)(a,(0,t.not)(l(e,n,r))):a}e.noPropertyInData=d;function f(e){return e?Object.keys(e).filter(e=>e!==`__proto__`):[]}e.allSchemaProperties=f;function p(e,t){return f(t).filter(r=>!(0,n.alwaysValidSchema)(e,t[r]))}e.schemaProperties=p;function m({schemaCode:e,data:n,it:{gen:i,topSchemaRef:a,schemaPath:o,errorPath:s},it:c},l,u,d){let f=d?(0,t._)`${e}, ${n}, ${a}${o}`:n,p=[[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,s)],[r.default.parentData,c.parentData],[r.default.parentDataProperty,c.parentDataProperty],[r.default.rootData,r.default.rootData]];c.opts.dynamicRef&&p.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);let m=(0,t._)`${f}, ${i.object(...p)}`;return u===t.nil?(0,t._)`${l}(${m})`:(0,t._)`${l}.call(${u}, ${m})`}e.callValidateCode=m;var h=(0,t._)`new RegExp`;function g({gen:e,it:{opts:n}},r){let a=n.unicodeRegExp?`u`:``,{regExp:o}=n.code,s=o(r,a);return e.scopeValue(`pattern`,{key:s.toString(),ref:s,code:(0,t._)`${o.code===`new RegExp`?h:(0,i.useFunc)(e,o)}(${r}, ${a})`})}e.usePattern=g;function _(e){let{gen:r,data:i,keyword:a,it:o}=e,s=r.name(`valid`);if(o.allErrors){let e=r.let(`valid`,!0);return c(()=>r.assign(e,!1)),e}return r.var(s,!0),c(()=>r.break()),s;function c(o){let c=r.const(`len`,(0,t._)`${i}.length`);r.forRange(`i`,0,c,i=>{e.subschema({keyword:a,dataProp:i,dataPropType:n.Type.Num},s),r.if((0,t.not)(s),o)})}}e.validateArray=_;function v(e){let{gen:r,schema:i,keyword:a,it:o}=e;if(!Array.isArray(i))throw Error(`ajv implementation error`);if(i.some(e=>(0,n.alwaysValidSchema)(o,e))&&!o.opts.unevaluated)return;let s=r.let(`valid`,!1),c=r.name(`_valid`);r.block(()=>i.forEach((n,i)=>{let o=e.subschema({keyword:a,schemaProp:i,compositeRule:!0},c);r.assign(s,(0,t._)`${s} || ${c}`),e.mergeValidEvaluated(o,c)||r.if((0,t.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}e.validateUnion=v})),hI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.validateKeywordUsage=e.validSchemaType=e.funcKeywordCode=e.macroKeywordCode=void 0;var t=X(),n=sI(),r=mI(),i=cI();function a(e,n){let{gen:r,keyword:i,schema:a,parentSchema:o,it:s}=e,c=n.macro.call(s.self,a,o,s),l=u(r,i,c);s.opts.validateSchema!==!1&&s.self.validateSchema(c,!0);let d=r.name(`valid`);e.subschema({schema:c,schemaPath:t.nil,errSchemaPath:`${s.errSchemaPath}/${i}`,topSchemaRef:l,compositeRule:!0},d),e.pass(d,()=>e.error(!0))}e.macroKeywordCode=a;function o(e,i){let{gen:a,keyword:o,schema:d,parentSchema:f,$data:p,it:m}=e;l(m,i);let h=u(a,o,!p&&i.compile?i.compile.call(m.self,d,f,m):i.validate),g=a.let(`valid`);e.block$data(g,_),e.ok(i.valid??g);function _(){if(i.errors===!1)b(),i.modifying&&s(e),x(()=>e.error());else{let t=i.async?v():y();i.modifying&&s(e),x(()=>c(e,t))}}function v(){let e=a.let(`ruleErrs`,null);return a.try(()=>b((0,t._)`await `),n=>a.assign(g,!1).if((0,t._)`${n} instanceof ${m.ValidationError}`,()=>a.assign(e,(0,t._)`${n}.errors`),()=>a.throw(n))),e}function y(){let e=(0,t._)`${h}.errors`;return a.assign(e,null),b(t.nil),e}function b(o=i.async?(0,t._)`await `:t.nil){let s=m.opts.passContext?n.default.this:n.default.self,c=!(`compile`in i&&!p||i.schema===!1);a.assign(g,(0,t._)`${o}${(0,r.callValidateCode)(e,h,s,c)}`,i.modifying)}function x(e){a.if((0,t.not)(i.valid??g),e)}}e.funcKeywordCode=o;function s(e){let{gen:n,data:r,it:i}=e;n.if(i.parentData,()=>n.assign(r,(0,t._)`${i.parentData}[${i.parentDataProperty}]`))}function c(e,r){let{gen:a}=e;a.if((0,t._)`Array.isArray(${r})`,()=>{a.assign(n.default.vErrors,(0,t._)`${n.default.vErrors} === null ? ${r} : ${n.default.vErrors}.concat(${r})`).assign(n.default.errors,(0,t._)`${n.default.vErrors}.length`),(0,i.extendErrors)(e)},()=>e.error())}function l({schemaEnv:e},t){if(t.async&&!e.$async)throw Error(`async keyword in sync schema`)}function u(e,n,r){if(r===void 0)throw Error(`keyword "${n}" failed to compile`);return e.scopeValue(`keyword`,typeof r==`function`?{ref:r}:{ref:r,code:(0,t.stringify)(r)})}function d(e,t,n=!1){return!t.length||t.some(t=>t===`array`?Array.isArray(e):t===`object`?e&&typeof e==`object`&&!Array.isArray(e):typeof e==t||n&&e===void 0)}e.validSchemaType=d;function f({schema:e,opts:t,self:n,errSchemaPath:r},i,a){if(Array.isArray(i.keyword)?!i.keyword.includes(a):i.keyword!==a)throw Error(`ajv implementation error`);let o=i.dependencies;if(o?.some(t=>!Object.prototype.hasOwnProperty.call(e,t)))throw Error(`parent schema must have dependencies of ${a}: ${o.join(`,`)}`);if(i.validateSchema&&!i.validateSchema(e[a])){let e=`keyword "${a}" value is invalid at path "${r}": `+n.errorsText(i.validateSchema.errors);if(t.validateSchema===`log`)n.logger.error(e);else throw Error(e)}}e.validateKeywordUsage=f})),gI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.extendSubschemaMode=e.extendSubschemaData=e.getSubschema=void 0;var t=X(),n=oI();function r(e,{keyword:r,schemaProp:i,schema:a,schemaPath:o,errSchemaPath:s,topSchemaRef:c}){if(r!==void 0&&a!==void 0)throw Error(`both "keyword" and "schema" passed, only one allowed`);if(r!==void 0){let a=e.schema[r];return i===void 0?{schema:a,schemaPath:(0,t._)`${e.schemaPath}${(0,t.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${r}`}:{schema:a[i],schemaPath:(0,t._)`${e.schemaPath}${(0,t.getProperty)(r)}${(0,t.getProperty)(i)}`,errSchemaPath:`${e.errSchemaPath}/${r}/${(0,n.escapeFragment)(i)}`}}if(a!==void 0){if(o===void 0||s===void 0||c===void 0)throw Error(`"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"`);return{schema:a,schemaPath:o,topSchemaRef:c,errSchemaPath:s}}throw Error(`either "keyword" or "schema" must be passed`)}e.getSubschema=r;function i(e,r,{dataProp:i,dataPropType:a,data:o,dataTypes:s,propertyName:c}){if(o!==void 0&&i!==void 0)throw Error(`both "data" and "dataProp" passed, only one allowed`);let{gen:l}=r;if(i!==void 0){let{errorPath:o,dataPathArr:s,opts:c}=r;u(l.let(`data`,(0,t._)`${r.data}${(0,t.getProperty)(i)}`,!0)),e.errorPath=(0,t.str)`${o}${(0,n.getErrorPath)(i,a,c.jsPropertySyntax)}`,e.parentDataProperty=(0,t._)`${i}`,e.dataPathArr=[...s,e.parentDataProperty]}o!==void 0&&(u(o instanceof t.Name?o:l.let(`data`,o,!0)),c!==void 0&&(e.propertyName=c)),s&&(e.dataTypes=s);function u(t){e.data=t,e.dataLevel=r.dataLevel+1,e.dataTypes=[],r.definedProperties=new Set,e.parentData=r.data,e.dataNames=[...r.dataNames,t]}}e.extendSubschemaData=i;function a(e,{jtdDiscriminator:t,jtdMetadata:n,compositeRule:r,createErrors:i,allErrors:a}){r!==void 0&&(e.compositeRule=r),i!==void 0&&(e.createErrors=i),a!==void 0&&(e.allErrors=a),e.jtdDiscriminator=t,e.jtdMetadata=n}e.extendSubschemaMode=a})),_I=a(((e,t)=>{t.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t==`object`&&typeof n==`object`){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}})),vI=a(((e,t)=>{var n=t.exports=function(e,t,n){typeof t==`function`&&(n=t,t={}),n=t.cb||n;var i=typeof n==`function`?n:n.pre||function(){},a=n.post||function(){};r(t,i,a,e,``,e)};n.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},n.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},n.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},n.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function r(e,t,a,o,s,c,l,u,d,f){if(o&&typeof o==`object`&&!Array.isArray(o)){for(var p in t(o,s,c,l,u,d,f),o){var m=o[p];if(Array.isArray(m)){if(p in n.arrayKeywords)for(var h=0;h<m.length;h++)r(e,t,a,m[h],s+`/`+p+`/`+h,c,s,p,o,h)}else if(p in n.propsKeywords){if(m&&typeof m==`object`)for(var g in m)r(e,t,a,m[g],s+`/`+p+`/`+i(g),c,s,p,o,g)}else (p in n.keywords||e.allKeys&&!(p in n.skipKeywords))&&r(e,t,a,m,s+`/`+p,c,s,p,o)}a(o,s,c,l,u,d,f)}}function i(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}})),yI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getSchemaRefs=e.resolveUrl=e.normalizeId=e._getFullPath=e.getFullPath=e.inlineRef=void 0;var t=oI(),n=_I(),r=vI(),i=new Set([`type`,`format`,`pattern`,`maxLength`,`minLength`,`maxProperties`,`minProperties`,`maxItems`,`minItems`,`maximum`,`minimum`,`uniqueItems`,`multipleOf`,`required`,`enum`,`const`]);function a(e,t=!0){return typeof e==`boolean`?!0:t===!0?!s(e):t?c(e)<=t:!1}e.inlineRef=a;var o=new Set([`$ref`,`$recursiveRef`,`$recursiveAnchor`,`$dynamicRef`,`$dynamicAnchor`]);function s(e){for(let t in e){if(o.has(t))return!0;let n=e[t];if(Array.isArray(n)&&n.some(s)||typeof n==`object`&&s(n))return!0}return!1}function c(e){let n=0;for(let r in e)if(r===`$ref`||(n++,!i.has(r)&&(typeof e[r]==`object`&&(0,t.eachItem)(e[r],e=>n+=c(e)),n===1/0)))return 1/0;return n}function l(e,t=``,n){return n!==!1&&(t=f(t)),u(e,e.parse(t))}e.getFullPath=l;function u(e,t){return e.serialize(t).split(`#`)[0]+`#`}e._getFullPath=u;var d=/#\/?$/;function f(e){return e?e.replace(d,``):``}e.normalizeId=f;function p(e,t,n){return n=f(n),e.resolve(t,n)}e.resolveUrl=p;var m=/^[a-z_][-a-z0-9._]*$/i;function h(e,t){if(typeof e==`boolean`)return{};let{schemaId:i,uriResolver:a}=this.opts,o=f(e[i]||t),s={"":o},c=l(a,o,!1),u={},d=new Set;return r(e,{allKeys:!0},(e,t,n,r)=>{if(r===void 0)return;let a=c+t,o=s[r];typeof e[i]==`string`&&(o=l.call(this,e[i])),g.call(this,e.$anchor),g.call(this,e.$dynamicAnchor),s[t]=o;function l(t){let n=this.opts.uriResolver.resolve;if(t=f(o?n(o,t):t),d.has(t))throw h(t);d.add(t);let r=this.refs[t];return typeof r==`string`&&(r=this.refs[r]),typeof r==`object`?p(e,r.schema,t):t!==f(a)&&(t[0]===`#`?(p(e,u[t],t),u[t]=e):this.refs[t]=a),t}function g(e){if(typeof e==`string`){if(!m.test(e))throw Error(`invalid anchor "${e}"`);l.call(this,`#${e}`)}}}),u;function p(e,t,r){if(t!==void 0&&!n(e,t))throw h(r)}function h(e){return Error(`reference "${e}" resolves to more than one schema`)}}e.getSchemaRefs=h})),bI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getData=e.KeywordCxt=e.validateFunctionCode=void 0;var t=lI(),n=fI(),r=dI(),i=fI(),a=pI(),o=hI(),s=gI(),c=X(),l=sI(),u=yI(),d=oI(),f=cI();function p(e){if(S(e)&&(w(e),x(e))){_(e);return}m(e,()=>(0,t.topBoolOrEmptySchema)(e))}e.validateFunctionCode=p;function m({gen:e,validateName:t,schema:n,schemaEnv:r,opts:i},a){i.code.es5?e.func(t,(0,c._)`${l.default.data}, ${l.default.valCxt}`,r.$async,()=>{e.code((0,c._)`"use strict"; ${y(n,i)}`),g(e,i),e.code(a)}):e.func(t,(0,c._)`${l.default.data}, ${h(i)}`,r.$async,()=>e.code(y(n,i)).code(a))}function h(e){return(0,c._)`{${l.default.instancePath}="", ${l.default.parentData}, ${l.default.parentDataProperty}, ${l.default.rootData}=${l.default.data}${e.dynamicRef?(0,c._)`, ${l.default.dynamicAnchors}={}`:c.nil}}={}`}function g(e,t){e.if(l.default.valCxt,()=>{e.var(l.default.instancePath,(0,c._)`${l.default.valCxt}.${l.default.instancePath}`),e.var(l.default.parentData,(0,c._)`${l.default.valCxt}.${l.default.parentData}`),e.var(l.default.parentDataProperty,(0,c._)`${l.default.valCxt}.${l.default.parentDataProperty}`),e.var(l.default.rootData,(0,c._)`${l.default.valCxt}.${l.default.rootData}`),t.dynamicRef&&e.var(l.default.dynamicAnchors,(0,c._)`${l.default.valCxt}.${l.default.dynamicAnchors}`)},()=>{e.var(l.default.instancePath,(0,c._)`""`),e.var(l.default.parentData,(0,c._)`undefined`),e.var(l.default.parentDataProperty,(0,c._)`undefined`),e.var(l.default.rootData,l.default.data),t.dynamicRef&&e.var(l.default.dynamicAnchors,(0,c._)`{}`)})}function _(e){let{schema:t,opts:n,gen:r}=e;m(e,()=>{n.$comment&&t.$comment&&ne(e),ee(e),r.let(l.default.vErrors,null),r.let(l.default.errors,0),n.unevaluated&&v(e),T(e),re(e)})}function v(e){let{gen:t,validateName:n}=e;e.evaluated=t.const(`evaluated`,(0,c._)`${n}.evaluated`),t.if((0,c._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,c._)`${e.evaluated}.props`,(0,c._)`undefined`)),t.if((0,c._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,c._)`${e.evaluated}.items`,(0,c._)`undefined`))}function y(e,t){let n=typeof e==`object`&&e[t.schemaId];return n&&(t.code.source||t.code.process)?(0,c._)`/*# sourceURL=${n} */`:c.nil}function b(e,n){if(S(e)&&(w(e),x(e))){C(e,n);return}(0,t.boolOrEmptySchema)(e,n)}function x({schema:e,self:t}){if(typeof e==`boolean`)return!e;for(let n in e)if(t.RULES.all[n])return!0;return!1}function S(e){return typeof e.schema!=`boolean`}function C(e,t){let{schema:n,gen:r,opts:i}=e;i.$comment&&n.$comment&&ne(e),te(e),D(e);let a=r.const(`_errs`,l.default.errors);T(e,a),r.var(t,(0,c._)`${a} === ${l.default.errors}`)}function w(e){(0,d.checkUnknownRules)(e),E(e)}function T(e,t){if(e.opts.jtd)return ae(e,[],!1,t);let r=(0,n.getSchemaTypes)(e.schema);ae(e,r,!(0,n.coerceAndCheckDataType)(e,r),t)}function E(e){let{schema:t,errSchemaPath:n,opts:r,self:i}=e;t.$ref&&r.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}function ee(e){let{schema:t,opts:n}=e;t.default!==void 0&&n.useDefaults&&n.strictSchema&&(0,d.checkStrictMode)(e,`default is ignored in the schema root`)}function te(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,u.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function D(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error(`async schema in sync schema`)}function ne({gen:e,schemaEnv:t,schema:n,errSchemaPath:r,opts:i}){let a=n.$comment;if(i.$comment===!0)e.code((0,c._)`${l.default.self}.logger.log(${a})`);else if(typeof i.$comment==`function`){let n=(0,c.str)`${r}/$comment`,i=e.scopeValue(`root`,{ref:t.root});e.code((0,c._)`${l.default.self}.opts.$comment(${a}, ${n}, ${i}.schema)`)}}function re(e){let{gen:t,schemaEnv:n,validateName:r,ValidationError:i,opts:a}=e;n.$async?t.if((0,c._)`${l.default.errors} === 0`,()=>t.return(l.default.data),()=>t.throw((0,c._)`new ${i}(${l.default.vErrors})`)):(t.assign((0,c._)`${r}.errors`,l.default.vErrors),a.unevaluated&&ie(e),t.return((0,c._)`${l.default.errors} === 0`))}function ie({gen:e,evaluated:t,props:n,items:r}){n instanceof c.Name&&e.assign((0,c._)`${t}.props`,n),r instanceof c.Name&&e.assign((0,c._)`${t}.items`,r)}function ae(e,t,n,a){let{gen:o,schema:s,data:u,allErrors:f,opts:p,self:m}=e,{RULES:h}=m;if(s.$ref&&(p.ignoreKeywordsWithRef||!(0,d.schemaHasRulesButRef)(s,h))){o.block(()=>pe(e,`$ref`,h.all.$ref.definition));return}p.jtd||se(e,t),o.block(()=>{for(let e of h.rules)g(e);g(h.post)});function g(d){(0,r.shouldUseGroup)(s,d)&&(d.type?(o.if((0,i.checkDataType)(d.type,u,p.strictNumbers)),oe(e,d),t.length===1&&t[0]===d.type&&n&&(o.else(),(0,i.reportTypeError)(e)),o.endIf()):oe(e,d),f||o.if((0,c._)`${l.default.errors} === ${a||0}`))}}function oe(e,t){let{gen:n,schema:i,opts:{useDefaults:o}}=e;o&&(0,a.assignDefaults)(e,t.type),n.block(()=>{for(let n of t.rules)(0,r.shouldUseRule)(i,n)&&pe(e,n.keyword,n.definition,t.type)})}function se(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(ce(e,t),e.opts.allowUnionTypes||O(e,t),le(e,e.dataTypes))}function ce(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(t=>{de(e.dataTypes,t)||A(e,`type "${t}" not allowed by context "${e.dataTypes.join(`,`)}"`)}),k(e,t)}}function O(e,t){t.length>1&&!(t.length===2&&t.includes(`null`))&&A(e,`use allowUnionTypes to allow union type keyword`)}function le(e,t){let n=e.self.RULES.all;for(let i in n){let a=n[i];if(typeof a==`object`&&(0,r.shouldUseRule)(e.schema,a)){let{type:n}=a.definition;n.length&&!n.some(e=>ue(t,e))&&A(e,`missing type "${n.join(`,`)}" for keyword "${i}"`)}}}function ue(e,t){return e.includes(t)||t===`number`&&e.includes(`integer`)}function de(e,t){return e.includes(t)||t===`integer`&&e.includes(`number`)}function k(e,t){let n=[];for(let r of e.dataTypes)de(t,r)?n.push(r):t.includes(`integer`)&&r===`number`&&n.push(`integer`);e.dataTypes=n}function A(e,t){let n=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${n}" (strictTypes)`,(0,d.checkStrictMode)(e,t,e.opts.strictTypes)}var fe=class{constructor(e,t,n){if((0,o.validateKeywordUsage)(e,t,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,d.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const(`vSchema`,ge(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,o.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw Error(`${n} value must be ${JSON.stringify(t.schemaType)}`);(`code`in t?t.trackErrors:t.errors!==!1)&&(this.errsCount=e.gen.const(`_errs`,l.default.errors))}result(e,t,n){this.failResult((0,c.not)(e),t,n)}failResult(e,t,n){this.gen.if(e),n?n():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,c.not)(e),void 0,t)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail((0,c._)`${t} !== undefined && (${(0,c.or)(this.invalid$data(),e)})`)}error(e,t,n){if(t){this.setParams(t),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,t){(e?f.reportExtraError:f.reportError)(this,this.def.error,t)}$dataError(){(0,f.reportError)(this,this.def.$dataError||f.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error(`add "trackErrors" to keyword definition`);(0,f.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,n=c.nil){this.gen.block(()=>{this.check$data(e,n),t()})}check$data(e=c.nil,t=c.nil){if(!this.$data)return;let{gen:n,schemaCode:r,schemaType:i,def:a}=this;n.if((0,c.or)((0,c._)`${r} === undefined`,t)),e!==c.nil&&n.assign(e,!0),(i.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==c.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:n,def:r,it:a}=this;return(0,c.or)(o(),s());function o(){if(n.length){if(!(t instanceof c.Name))throw Error(`ajv implementation error`);let e=Array.isArray(n)?n:[n];return(0,c._)`${(0,i.checkDataTypes)(e,t,a.opts.strictNumbers,i.DataType.Wrong)}`}return c.nil}function s(){if(r.validateSchema){let n=e.scopeValue(`validate$data`,{ref:r.validateSchema});return(0,c._)`!${n}(${t})`}return c.nil}}subschema(e,t){let n=(0,s.getSubschema)(this.it,e);(0,s.extendSubschemaData)(n,this.it,e),(0,s.extendSubschemaMode)(n,e);let r={...this.it,...n,items:void 0,props:void 0};return b(r,t),r}mergeEvaluated(e,t){let{it:n,gen:r}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=d.mergeEvaluated.props(r,e.props,n.props,t)),n.items!==!0&&e.items!==void 0&&(n.items=d.mergeEvaluated.items(r,e.items,n.items,t)))}mergeValidEvaluated(e,t){let{it:n,gen:r}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return r.if(t,()=>this.mergeEvaluated(e,c.Name)),!0}};e.KeywordCxt=fe;function pe(e,t,n,r){let i=new fe(e,n,t);`code`in n?n.code(i,r):i.$data&&n.validate?(0,o.funcKeywordCode)(i,n):`macro`in n?(0,o.macroKeywordCode)(i,n):(n.compile||n.validate)&&(0,o.funcKeywordCode)(i,n)}var me=/^\/(?:[^~]|~0|~1)*$/,he=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function ge(e,{dataLevel:t,dataNames:n,dataPathArr:r}){let i,a;if(e===``)return l.default.rootData;if(e[0]===`/`){if(!me.test(e))throw Error(`Invalid JSON-pointer: ${e}`);i=e,a=l.default.rootData}else{let o=he.exec(e);if(!o)throw Error(`Invalid JSON-pointer: ${e}`);let s=+o[1];if(i=o[2],i===`#`){if(s>=t)throw Error(u(`property/index`,s));return r[t-s]}if(s>t)throw Error(u(`data`,s));if(a=n[t-s],!i)return a}let o=a,s=i.split(`/`);for(let e of s)e&&(a=(0,c._)`${a}${(0,c.getProperty)((0,d.unescapeJsonPointer)(e))}`,o=(0,c._)`${o} && ${a}`);return o;function u(e,n){return`Cannot access ${e} ${n} levels up, current level is ${t}`}}e.getData=ge})),xI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=class extends Error{constructor(e){super(`validation failed`),this.errors=e,this.ajv=this.validation=!0}}})),SI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=yI();e.default=class extends Error{constructor(e,n,r,i){super(i||`can't resolve reference ${r} from id ${n}`),this.missingRef=(0,t.resolveUrl)(e,n,r),this.missingSchema=(0,t.normalizeId)((0,t.getFullPath)(e,this.missingRef))}}})),CI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.resolveSchema=e.getCompilingSchema=e.resolveRef=e.compileSchema=e.SchemaEnv=void 0;var t=X(),n=xI(),r=sI(),i=yI(),a=oI(),o=bI(),s=class{constructor(e){this.refs={},this.dynamicAnchors={};let t;typeof e.schema==`object`&&(t=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=e.baseId??(0,i.normalizeId)(t?.[e.schemaId||`$id`]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=t?.$async,this.refs={}}};e.SchemaEnv=s;function c(e){let a=d.call(this,e);if(a)return a;let s=(0,i.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:c,lines:l}=this.opts.code,{ownProperties:u}=this.opts,f=new t.CodeGen(this.scope,{es5:c,lines:l,ownProperties:u}),p;e.$async&&(p=f.scopeValue(`Error`,{ref:n.default,code:(0,t._)`require("ajv/dist/runtime/validation_error").default`}));let m=f.scopeName(`validate`);e.validateName=m;let h={gen:f,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[t.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:f.scopeValue(`schema`,this.opts.code.source===!0?{ref:e.schema,code:(0,t.stringify)(e.schema)}:{ref:e.schema}),validateName:m,ValidationError:p,schema:e.schema,schemaEnv:e,rootId:s,baseId:e.baseId||s,schemaPath:t.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?``:`#`),errorPath:(0,t._)`""`,opts:this.opts,self:this},g;try{this._compilations.add(e),(0,o.validateFunctionCode)(h),f.optimize(this.opts.code.optimize);let n=f.toString();g=`${f.scopeRefs(r.default.scope)}return ${n}`,this.opts.code.process&&(g=this.opts.code.process(g,e));let i=Function(`${r.default.self}`,`${r.default.scope}`,g)(this,this.scope.get());if(this.scope.value(m,{ref:i}),i.errors=null,i.schema=e.schema,i.schemaEnv=e,e.$async&&(i.$async=!0),this.opts.code.source===!0&&(i.source={validateName:m,validateCode:n,scopeValues:f._values}),this.opts.unevaluated){let{props:e,items:n}=h;i.evaluated={props:e instanceof t.Name?void 0:e,items:n instanceof t.Name?void 0:n,dynamicProps:e instanceof t.Name,dynamicItems:n instanceof t.Name},i.source&&(i.source.evaluated=(0,t.stringify)(i.evaluated))}return e.validate=i,e}catch(t){throw delete e.validate,delete e.validateName,g&&this.logger.error(`Error compiling schema, function code:`,g),t}finally{this._compilations.delete(e)}}e.compileSchema=c;function l(e,t,n){n=(0,i.resolveUrl)(this.opts.uriResolver,t,n);let r=e.refs[n];if(r)return r;let a=p.call(this,e,n);if(a===void 0){let r=e.localRefs?.[n],{schemaId:i}=this.opts;r&&(a=new s({schema:r,schemaId:i,root:e,baseId:t}))}if(a!==void 0)return e.refs[n]=u.call(this,a)}e.resolveRef=l;function u(e){return(0,i.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:c.call(this,e)}function d(e){for(let t of this._compilations)if(f(t,e))return t}e.getCompilingSchema=d;function f(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function p(e,t){let n;for(;typeof(n=this.refs[t])==`string`;)t=n;return n||this.schemas[t]||m.call(this,e,t)}function m(e,t){let n=this.opts.uriResolver.parse(t),r=(0,i._getFullPath)(this.opts.uriResolver,n),a=(0,i.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&r===a)return g.call(this,n,e);let o=(0,i.normalizeId)(r),l=this.refs[o]||this.schemas[o];if(typeof l==`string`){let t=m.call(this,e,l);return typeof t?.schema==`object`?g.call(this,n,t):void 0}if(typeof l?.schema==`object`){if(l.validate||c.call(this,l),o===(0,i.normalizeId)(t)){let{schema:t}=l,{schemaId:n}=this.opts,r=t[n];return r&&(a=(0,i.resolveUrl)(this.opts.uriResolver,a,r)),new s({schema:t,schemaId:n,root:e,baseId:a})}return g.call(this,n,l)}}e.resolveSchema=m;var h=new Set([`properties`,`patternProperties`,`enum`,`dependencies`,`definitions`]);function g(e,{baseId:t,schema:n,root:r}){if(e.fragment?.[0]!==`/`)return;for(let r of e.fragment.slice(1).split(`/`)){if(typeof n==`boolean`)return;let e=n[(0,a.unescapeFragment)(r)];if(e===void 0)return;n=e;let o=typeof n==`object`&&n[this.opts.schemaId];!h.has(r)&&o&&(t=(0,i.resolveUrl)(this.opts.uriResolver,t,o))}let o;if(typeof n!=`boolean`&&n.$ref&&!(0,a.schemaHasRulesButRef)(n,this.RULES)){let e=(0,i.resolveUrl)(this.opts.uriResolver,t,n.$ref);o=m.call(this,r,e)}let{schemaId:c}=this.opts;if(o||=new s({schema:n,schemaId:c,root:r,baseId:t}),o.schema!==o.root.schema)return o}})),wI=i({$id:()=>TI,additionalProperties:()=>!1,default:()=>AI,description:()=>EI,properties:()=>kI,required:()=>OI,type:()=>DI}),TI,EI,DI,OI,kI,AI,jI=n((()=>{TI=`https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#`,EI=`Meta-schema for $data reference (JSON AnySchema extension proposal)`,DI=`object`,OI=[`$data`],kI={$data:{type:`string`,anyOf:[{format:`relative-json-pointer`},{format:`json-pointer`}]}},AI={$id:TI,description:EI,type:DI,required:OI,properties:kI,additionalProperties:!1}})),MI=a(((e,t)=>{var n=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),r=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),i=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),a=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),o=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function s(e){let t=``,n=0,r=0;for(r=0;r<e.length;r++)if(n=e[r].charCodeAt(0),n!==48){if(!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return``;t+=e[r];break}for(r+=1;r<e.length;r++){if(n=e[r].charCodeAt(0),!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return``;t+=e[r]}return t}var c=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function l(e){return e.length=0,!0}function u(e,t,n){if(e.length){let r=s(e);if(r!==``)t.push(r);else return n.error=!0,!1;e.length=0}return!0}function d(e){let t=0,n={error:!1,address:``,zone:``},r=[],i=[],a=!1,o=!1,c=u;for(let s=0;s<e.length;s++){let u=e[s];if(!(u===`[`||u===`]`))if(u===`:`){if(a===!0&&(o=!0),!c(i,r,n))break;if(++t>7){n.error=!0;break}s>0&&e[s-1]===`:`&&(a=!0),r.push(`:`);continue}else if(u===`%`){if(!c(i,r,n))break;c=l}else{i.push(u);continue}}return i.length&&(c===l?n.zone=i.join(``):o?r.push(i.join(``)):r.push(s(i))),n.address=r.join(``),n}function f(e){if(p(e,`:`)<2)return{host:e,isIPV6:!1};let t=d(e);if(t.error)return{host:e,isIPV6:!1};{let e=t.address,n=t.address;return t.zone&&(e+=`%`+t.zone,n+=`%25`+t.zone),{host:e,isIPV6:!0,escapedHost:n}}}function p(e,t){let n=0;for(let r=0;r<e.length;r++)e[r]===t&&n++;return n}function m(e){let t=e,n=[],r=-1,i=0;for(;i=t.length;){if(i===1){if(t===`.`)break;if(t===`/`){n.push(`/`);break}else{n.push(t);break}}else if(i===2){if(t[0]===`.`){if(t[1]===`.`)break;if(t[1]===`/`){t=t.slice(2);continue}}else if(t[0]===`/`&&(t[1]===`.`||t[1]===`/`)){n.push(`/`);break}}else if(i===3&&t===`/..`){n.length!==0&&n.pop(),n.push(`/`);break}if(t[0]===`.`){if(t[1]===`.`){if(t[2]===`/`){t=t.slice(3);continue}}else if(t[1]===`/`){t=t.slice(2);continue}}else if(t[0]===`/`&&t[1]===`.`){if(t[2]===`/`){t=t.slice(2);continue}else if(t[2]===`.`&&t[3]===`/`){t=t.slice(3),n.length!==0&&n.pop();continue}}if((r=t.indexOf(`/`,1))===-1){n.push(t);break}else n.push(t.slice(0,r)),t=t.slice(r)}return n.join(``)}var h={"@":`%40`,"/":`%2F`,"?":`%3F`,"#":`%23`,":":`%3A`},g=/[@/?#:]/g,_=/[@/?#]/g;function v(e,t){let n=t?_:g;return n.lastIndex=0,e.replace(n,e=>h[e])}function y(e,t=!1){if(e.indexOf(`%`)===-1)return e;let n=``;for(let r=0;r<e.length;r++){if(e[r]===`%`&&r+2<e.length){let o=e.slice(r+1,r+3);if(i(o)){let e=o.toUpperCase(),i=String.fromCharCode(parseInt(e,16));t&&a(i)?n+=i:n+=`%`+e,r+=2;continue}}n+=e[r]}return n}function b(e){let t=``;for(let n=0;n<e.length;n++){if(e[n]===`%`&&n+2<e.length){let r=e.slice(n+1,n+3);if(i(r)){let e=r.toUpperCase(),i=String.fromCharCode(parseInt(e,16));i!==`.`&&a(i)?t+=i:t+=`%`+e,n+=2;continue}}o(e[n])?t+=e[n]:t+=escape(e[n])}return t}function x(e){let t=``;for(let n=0;n<e.length;n++){if(e[n]===`%`&&n+2<e.length){let r=e.slice(n+1,n+3);if(i(r)){t+=`%`+r.toUpperCase(),n+=2;continue}}t+=escape(e[n])}return t}function S(e){let t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push(`@`)),e.host!==void 0){let n=unescape(e.host);if(!r(n)){let e=f(n);n=e.isIPV6===!0?`[${e.escapedHost}]`:v(n,!1)}t.push(n)}return(typeof e.port==`number`||typeof e.port==`string`)&&(t.push(`:`),t.push(String(e.port))),t.length?t.join(``):void 0}t.exports={nonSimpleDomain:c,recomposeAuthority:S,reescapeHostDelimiters:v,normalizePercentEncoding:y,normalizePathEncoding:b,escapePreservingEscapes:x,removeDotSegments:m,isIPv4:r,isUUID:n,normalizeIPv6:f,stringArrayToHexStripped:s}})),NI=a(((e,t)=>{var{isUUID:n}=MI(),r=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,i=[`http`,`https`,`ws`,`wss`,`urn`,`urn:uuid`];function a(e){return i.indexOf(e)!==-1}function o(e){return e.secure===!0?!0:e.secure===!1?!1:e.scheme?e.scheme.length===3&&(e.scheme[0]===`w`||e.scheme[0]===`W`)&&(e.scheme[1]===`s`||e.scheme[1]===`S`)&&(e.scheme[2]===`s`||e.scheme[2]===`S`):!1}function s(e){return e.host||(e.error=e.error||`HTTP URIs must have a host.`),e}function c(e){let t=String(e.scheme).toLowerCase()===`https`;return(e.port===(t?443:80)||e.port===``)&&(e.port=void 0),e.path||=`/`,e}function l(e){return e.secure=o(e),e.resourceName=(e.path||`/`)+(e.query?`?`+e.query:``),e.path=void 0,e.query=void 0,e}function u(e){if((e.port===(o(e)?443:80)||e.port===``)&&(e.port=void 0),typeof e.secure==`boolean`&&(e.scheme=e.secure?`wss`:`ws`,e.secure=void 0),e.resourceName){let[t,n]=e.resourceName.split(`?`);e.path=t&&t!==`/`?t:void 0,e.query=n,e.resourceName=void 0}return e.fragment=void 0,e}function d(e,t){if(!e.path)return e.error=`URN can not be parsed`,e;let n=e.path.match(r);if(n){let r=t.scheme||e.scheme||`urn`;e.nid=n[1].toLowerCase(),e.nss=n[2];let i=y(`${r}:${t.nid||e.nid}`);e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||`URN can not be parsed.`;return e}function f(e,t){if(e.nid===void 0)throw Error(`URN without nid cannot be serialized`);let n=t.scheme||e.scheme||`urn`,r=e.nid.toLowerCase(),i=y(`${n}:${t.nid||r}`);i&&(e=i.serialize(e,t));let a=e,o=e.nss;return a.path=`${r||t.nid}:${o}`,t.skipEscape=!0,a}function p(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!n(r.uuid))&&(r.error=r.error||`UUID is not valid.`),r}function m(e){let t=e;return t.nss=(e.uuid||``).toLowerCase(),t}var h={scheme:`http`,domainHost:!0,parse:s,serialize:c},g={scheme:`https`,domainHost:h.domainHost,parse:s,serialize:c},_={scheme:`ws`,domainHost:!0,parse:l,serialize:u},v={http:h,https:g,ws:_,wss:{scheme:`wss`,domainHost:_.domainHost,parse:_.parse,serialize:_.serialize},urn:{scheme:`urn`,parse:d,serialize:f,skipNormalize:!0},"urn:uuid":{scheme:`urn:uuid`,parse:p,serialize:m,skipNormalize:!0}};Object.setPrototypeOf(v,null);function y(e){return e&&(v[e]||v[e.toLowerCase()])||void 0}t.exports={wsIsSecure:o,SCHEMES:v,isValidSchemeName:a,getSchemeHandler:y}})),PI=a(((e,t)=>{var{normalizeIPv6:n,removeDotSegments:r,recomposeAuthority:i,normalizePercentEncoding:a,normalizePathEncoding:o,escapePreservingEscapes:s,reescapeHostDelimiters:c,isIPv4:l,nonSimpleDomain:u}=MI(),{SCHEMES:d,getSchemeHandler:f}=NI();function p(e,t){return typeof e==`string`?e=S(e,t):typeof e==`object`&&(e=x(_(e,t),t)),e}function m(e,t,n){let r=n?Object.assign({scheme:`null`},n):{scheme:`null`},i=h(x(e,r),x(t,r),r,!0);return r.skipEscape=!0,_(i,r)}function h(e,t,n,i){let a={};return i||(e=x(_(e,n),n),t=x(_(t,n),n)),n||={},!n.tolerant&&t.scheme?(a.scheme=t.scheme,a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=r(t.path||``),a.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=r(t.path||``),a.query=t.query):(t.path?(t.path[0]===`/`?a.path=r(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?a.path=`/`+t.path:e.path?a.path=e.path.slice(0,e.path.lastIndexOf(`/`)+1)+t.path:a.path=t.path,a.path=r(a.path)),a.query=t.query):(a.path=e.path,t.query===void 0?a.query=e.query:a.query=t.query),a.userinfo=e.userinfo,a.host=e.host,a.port=e.port),a.scheme=e.scheme),a.fragment=t.fragment,a}function g(e,t,n){let r=w(e,n),i=w(t,n);return r!==void 0&&i!==void 0&&r.toLowerCase()===i.toLowerCase()}function _(e,t){let n={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:``},o=Object.assign({},t),c=[],l=f(o.scheme||n.scheme);l&&l.serialize&&l.serialize(n,o),n.path!==void 0&&(o.skipEscape?n.path=a(n.path):(n.path=s(n.path),n.scheme!==void 0&&(n.path=n.path.split(`%3A`).join(`:`)))),o.reference!==`suffix`&&n.scheme&&c.push(n.scheme,`:`);let u=i(n);if(u!==void 0&&(o.reference!==`suffix`&&c.push(`//`),c.push(u),n.path&&n.path[0]!==`/`&&c.push(`/`)),n.path!==void 0){let e=n.path;!o.absolutePath&&(!l||!l.absolutePath)&&(e=r(e)),u===void 0&&e[0]===`/`&&e[1]===`/`&&(e=`/%2F`+e.slice(2)),c.push(e)}return n.query!==void 0&&c.push(`?`,n.query),n.fragment!==void 0&&c.push(`#`,n.fragment),c.join(``)}var v=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function y(e,t){if(t[2]!==void 0&&e.path&&e.path[0]!==`/`)return`URI path must start with "/" when authority is present.`;if(typeof e.port==`number`&&(e.port<0||e.port>65535))return`URI port is malformed.`}function b(e,t){let r=Object.assign({},t),i={scheme:void 0,userinfo:void 0,host:``,port:void 0,path:``,query:void 0,fragment:void 0},a=!1,s=!1;r.reference===`suffix`&&(e=r.scheme?r.scheme+`:`+e:`//`+e);let d=e.match(v);if(d){i.scheme=d[1],i.userinfo=d[3],i.host=d[4],i.port=parseInt(d[5],10),i.path=d[6]||``,i.query=d[7],i.fragment=d[8],isNaN(i.port)&&(i.port=d[5]);let t=y(i,d);if(t!==void 0&&(i.error=i.error||t,a=!0),i.host)if(l(i.host)===!1){let e=n(i.host);i.host=e.host.toLowerCase(),s=e.isIPV6}else s=!0;i.scheme===void 0&&i.userinfo===void 0&&i.host===void 0&&i.port===void 0&&i.query===void 0&&!i.path?i.reference=`same-document`:i.scheme===void 0?i.reference=`relative`:i.fragment===void 0?i.reference=`absolute`:i.reference=`uri`,r.reference&&r.reference!==`suffix`&&r.reference!==i.reference&&(i.error=i.error||`URI is not a `+r.reference+` reference.`);let p=f(r.scheme||i.scheme);if(!r.unicodeSupport&&(!p||!p.unicodeSupport)&&i.host&&(r.domainHost||p&&p.domainHost)&&s===!1&&u(i.host))try{i.host=new URL(`http://`+i.host).hostname}catch(e){i.error=i.error||`Host's domain name can not be converted to ASCII: `+e}if((!p||p&&!p.skipNormalize)&&(e.indexOf(`%`)!==-1&&(i.scheme!==void 0&&(i.scheme=unescape(i.scheme)),i.host!==void 0&&(i.host=c(unescape(i.host),s))),i.path&&=o(i.path),i.fragment))try{i.fragment=encodeURI(decodeURIComponent(i.fragment))}catch{i.error=i.error||`URI malformed`}p&&p.parse&&p.parse(i,r)}else i.error=i.error||`URI can not be parsed.`;return{parsed:i,malformedAuthorityOrPort:a}}function x(e,t){return b(e,t).parsed}function S(e,t){return C(e,t).normalized}function C(e,t){let{parsed:n,malformedAuthorityOrPort:r}=b(e,t);return{normalized:r?e:_(n,t),malformedAuthorityOrPort:r}}function w(e,t){if(typeof e==`string`){let{normalized:n,malformedAuthorityOrPort:r}=C(e,t);return r?void 0:n}if(typeof e==`object`)return _(e,t)}var T={SCHEMES:d,normalize:p,resolve:m,resolveComponent:h,equal:g,serialize:_,parse:x};t.exports=T,t.exports.default=T,t.exports.fastUri=T})),FI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=PI();t.code=`require("ajv/dist/runtime/uri").default`,e.default=t})),II=a((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var n=bI();Object.defineProperty(t,`KeywordCxt`,{enumerable:!0,get:function(){return n.KeywordCxt}});var r=X();Object.defineProperty(t,`_`,{enumerable:!0,get:function(){return r._}}),Object.defineProperty(t,`str`,{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(t,`stringify`,{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(t,`nil`,{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(t,`Name`,{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(t,`CodeGen`,{enumerable:!0,get:function(){return r.CodeGen}});var i=xI(),a=SI(),o=uI(),s=CI(),c=X(),l=yI(),u=fI(),d=oI(),f=(jI(),e(wI).default),p=FI(),m=(e,t)=>new RegExp(e,t);m.code=`new RegExp`;var h=[`removeAdditional`,`useDefaults`,`coerceTypes`],g=new Set([`validate`,`serialize`,`parse`,`wrapper`,`root`,`schema`,`keyword`,`pattern`,`formats`,`validate$data`,`func`,`obj`,`Error`]),_={errorDataPath:``,format:"`validateFormats: false` can be used instead.",nullable:`"nullable" keyword is supported by default.`,jsonPointers:`Deprecated jsPropertySyntax can be used instead.`,extendRefs:`Deprecated ignoreKeywordsWithRef can be used instead.`,missingRefs:`Pass empty schema with $id that should be ignored to ajv.addSchema.`,processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:`"uniqueItems" keyword is always validated.`,unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:`Map is used as cache, schema object as key.`,serialize:`Map is used as cache, schema object as key.`,ajvErrors:`It is default now.`},v={ignoreKeywordsWithRef:``,jsPropertySyntax:``,unicode:`"minLength"/"maxLength" account for unicode characters by default.`},y=200;function b(e){let t=e.strict,n=e.code?.optimize,r=n===!0||n===void 0?1:n||0,i=e.code?.regExp??m,a=e.uriResolver??p.default;return{strictSchema:e.strictSchema??t??!0,strictNumbers:e.strictNumbers??t??!0,strictTypes:e.strictTypes??t??`log`,strictTuples:e.strictTuples??t??`log`,strictRequired:e.strictRequired??t??!1,code:e.code?{...e.code,optimize:r,regExp:i}:{optimize:r,regExp:i},loopRequired:e.loopRequired??y,loopEnum:e.loopEnum??y,meta:e.meta??!0,messages:e.messages??!0,inlineRefs:e.inlineRefs??!0,schemaId:e.schemaId??`$id`,addUsedSchema:e.addUsedSchema??!0,validateSchema:e.validateSchema??!0,validateFormats:e.validateFormats??!0,unicodeRegExp:e.unicodeRegExp??!0,int32range:e.int32range??!0,uriResolver:a}}var x=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...b(e)};let{es5:t,lines:n}=this.opts.code;this.scope=new c.ValueScope({scope:{},prefixes:g,es5:t,lines:n}),this.logger=D(e.logger);let r=e.validateFormats;e.validateFormats=!1,this.RULES=(0,o.getRules)(),S.call(this,_,e,`NOT SUPPORTED`),S.call(this,v,e,`DEPRECATED`,`warn`),this._metaOpts=ee.call(this),e.formats&&T.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&E.call(this,e.keywords),typeof e.meta==`object`&&this.addMetaSchema(e.meta),w.call(this),e.validateFormats=r}_addVocabularies(){this.addKeyword(`$async`)}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:n}=this.opts,r=f;n===`id`&&(r={...f},r.id=r.$id,delete r.$id),t&&e&&this.addMetaSchema(r,r[n],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e==`object`?e[t]||e:void 0}validate(e,t){let n;if(typeof e==`string`){if(n=this.getSchema(e),!n)throw Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let r=n(t);return`$async`in n||(this.errors=n.errors),r}compile(e,t){let n=this._addSchema(e,t);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,t){if(typeof this.opts.loadSchema!=`function`)throw Error(`options.loadSchema should be a function`);let{loadSchema:n}=this.opts;return r.call(this,e,t);async function r(e,t){await i.call(this,e.$schema);let n=this._addSchema(e,t);return n.validate||o.call(this,n)}async function i(e){e&&!this.getSchema(e)&&await r.call(this,{$ref:e},!0)}async function o(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof a.default))throw t;return s.call(this,t),await c.call(this,t.missingSchema),o.call(this,e)}}function s({missingSchema:e,missingRef:t}){if(this.refs[e])throw Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function c(e){let n=await l.call(this,e);this.refs[e]||await i.call(this,n.$schema),this.refs[e]||this.addSchema(n,e,t)}async function l(e){let t=this._loading[e];if(t)return t;try{return await(this._loading[e]=n(e))}finally{delete this._loading[e]}}}addSchema(e,t,n,r=this.opts.validateSchema){if(Array.isArray(e)){for(let t of e)this.addSchema(t,void 0,n,r);return this}let i;if(typeof e==`object`){let{schemaId:t}=this.opts;if(i=e[t],i!==void 0&&typeof i!=`string`)throw Error(`schema ${t} must be string`)}return t=(0,l.normalizeId)(t||i),this._checkUnique(t),this.schemas[t]=this._addSchema(e,n,t,r,!0),this}addMetaSchema(e,t,n=this.opts.validateSchema){return this.addSchema(e,t,!0,n),this}validateSchema(e,t){if(typeof e==`boolean`)return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!=`string`)throw Error(`$schema must be a string`);if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn(`meta-schema not available`),this.errors=null,!0;let r=this.validate(n,e);if(!r&&t){let e=`schema is invalid: `+this.errorsText();if(this.opts.validateSchema===`log`)this.logger.error(e);else throw Error(e)}return r}getSchema(e){let t;for(;typeof(t=C.call(this,e))==`string`;)e=t;if(t===void 0){let{schemaId:n}=this.opts,r=new s.SchemaEnv({schema:{},schemaId:n});if(t=s.resolveSchema.call(this,r,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case`undefined`:return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case`string`:{let t=C.call(this,e);return typeof t==`object`&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case`object`:{let t=e;this._cache.delete(t);let n=e[this.opts.schemaId];return n&&(n=(0,l.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw Error(`ajv.removeSchema: invalid parameter`)}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let n;if(typeof e==`string`)n=e,typeof t==`object`&&(this.logger.warn(`these parameters are deprecated, see docs for addKeyword`),t.keyword=n);else if(typeof e==`object`&&t===void 0){if(t=e,n=t.keyword,Array.isArray(n)&&!n.length)throw Error(`addKeywords: keyword must be string or non-empty array`)}else throw Error(`invalid addKeywords parameters`);if(re.call(this,n,t),!t)return(0,d.eachItem)(n,e=>ie.call(this,e)),this;oe.call(this,t);let r={...t,type:(0,u.getJSONTypes)(t.type),schemaType:(0,u.getJSONTypes)(t.schemaType)};return(0,d.eachItem)(n,r.type.length===0?e=>ie.call(this,e,r):e=>r.type.forEach(t=>ie.call(this,e,r,t))),this}getKeyword(e){let t=this.RULES.all[e];return typeof t==`object`?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(let n of t.rules){let t=n.rules.findIndex(t=>t.keyword===e);t>=0&&n.rules.splice(t,1)}return this}addFormat(e,t){return typeof t==`string`&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=`, `,dataVar:n=`data`}={}){return!e||e.length===0?`No errors`:e.map(e=>`${n}${e.instancePath} ${e.message}`).reduce((e,n)=>e+t+n)}$dataMetaSchema(e,t){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let r of t){let t=r.split(`/`).slice(1),i=e;for(let e of t)i=i[e];for(let e in n){let t=n[e];if(typeof t!=`object`)continue;let{$data:r}=t.definition,a=i[e];r&&a&&(i[e]=ce(a))}}return e}_removeAllSchemas(e,t){for(let n in e){let r=e[n];(!t||t.test(n))&&(typeof r==`string`?delete e[n]:r&&!r.meta&&(this._cache.delete(r.schema),delete e[n]))}}_addSchema(e,t,n,r=this.opts.validateSchema,i=this.opts.addUsedSchema){let a,{schemaId:o}=this.opts;if(typeof e==`object`)a=e[o];else if(this.opts.jtd)throw Error(`schema must be object`);else if(typeof e!=`boolean`)throw Error(`schema must be object or boolean`);let c=this._cache.get(e);if(c!==void 0)return c;n=(0,l.normalizeId)(a||n);let u=l.getSchemaRefs.call(this,e,n);return c=new s.SchemaEnv({schema:e,schemaId:o,meta:t,baseId:n,localRefs:u}),this._cache.set(c.schema,c),i&&!n.startsWith(`#`)&&(n&&this._checkUnique(n),this.refs[n]=c),r&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):s.compileSchema.call(this,e),!e.validate)throw Error(`ajv implementation error`);return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{s.compileSchema.call(this,e)}finally{this.opts=t}}};x.ValidationError=i.default,x.MissingRefError=a.default,t.default=x;function S(e,t,n,r=`error`){for(let i in e){let a=i;a in t&&this.logger[r](`${n}: option ${i}. ${e[a]}`)}}function C(e){return e=(0,l.normalizeId)(e),this.schemas[e]||this.refs[e]}function w(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function T(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function E(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn(`keywords option as map is deprecated, pass array`);for(let t in e){let n=e[t];n.keyword||=t,this.addKeyword(n)}}function ee(){let e={...this.opts};for(let t of h)delete e[t];return e}var te={log(){},warn(){},error(){}};function D(e){if(e===!1)return te;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw Error(`logger must implement log, warn and error methods`)}var ne=/^[a-z_$][a-z0-9_$:-]*$/i;function re(e,t){let{RULES:n}=this;if((0,d.eachItem)(e,e=>{if(n.keywords[e])throw Error(`Keyword ${e} is already defined`);if(!ne.test(e))throw Error(`Keyword ${e} has invalid name`)}),t&&t.$data&&!(`code`in t||`validate`in t))throw Error(`$data keyword must have "code" or "validate" function`)}function ie(e,t,n){var r;let i=t?.post;if(n&&i)throw Error(`keyword with "post" flag cannot have "type"`);let{RULES:a}=this,o=i?a.post:a.rules.find(({type:e})=>e===n);if(o||(o={type:n,rules:[]},a.rules.push(o)),a.keywords[e]=!0,!t)return;let s={keyword:e,definition:{...t,type:(0,u.getJSONTypes)(t.type),schemaType:(0,u.getJSONTypes)(t.schemaType)}};t.before?ae.call(this,o,s,t.before):o.rules.push(s),a.all[e]=s,(r=t.implements)==null||r.forEach(e=>this.addKeyword(e))}function ae(e,t,n){let r=e.rules.findIndex(e=>e.keyword===n);r>=0?e.rules.splice(r,0,t):(e.rules.push(t),this.logger.warn(`rule ${n} is not defined`))}function oe(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=ce(t)),e.validateSchema=this.compile(t,!0))}var se={$ref:`https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#`};function ce(e){return{anyOf:[e,se]}}})),LI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={keyword:`id`,code(){throw Error(`NOT SUPPORTED: keyword "id", use "$id" for schema ID`)}}})),RI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.callRef=e.getValidate=void 0;var t=SI(),n=mI(),r=X(),i=sI(),a=CI(),o=oI(),s={keyword:`$ref`,schemaType:`string`,code(e){let{gen:n,schema:i,it:o}=e,{baseId:s,schemaEnv:u,validateName:d,opts:f,self:p}=o,{root:m}=u;if((i===`#`||i===`#/`)&&s===m.baseId)return g();let h=a.resolveRef.call(p,m,s,i);if(h===void 0)throw new t.default(o.opts.uriResolver,s,i);if(h instanceof a.SchemaEnv)return _(h);return v(h);function g(){if(u===m)return l(e,d,u,u.$async);let t=n.scopeValue(`root`,{ref:m});return l(e,(0,r._)`${t}.validate`,m,m.$async)}function _(t){l(e,c(e,t),t,t.$async)}function v(t){let a=n.scopeValue(`schema`,f.code.source===!0?{ref:t,code:(0,r.stringify)(t)}:{ref:t}),o=n.name(`valid`),s=e.subschema({schema:t,dataTypes:[],schemaPath:r.nil,topSchemaRef:a,errSchemaPath:i},o);e.mergeEvaluated(s),e.ok(o)}}};function c(e,t){let{gen:n}=e;return t.validate?n.scopeValue(`validate`,{ref:t.validate}):(0,r._)`${n.scopeValue(`wrapper`,{ref:t})}.validate`}e.getValidate=c;function l(e,t,a,s){let{gen:c,it:l}=e,{allErrors:u,schemaEnv:d,opts:f}=l,p=f.passContext?i.default.this:r.nil;s?m():h();function m(){if(!d.$async)throw Error(`async schema referenced by sync schema`);let i=c.let(`valid`);c.try(()=>{c.code((0,r._)`await ${(0,n.callValidateCode)(e,t,p)}`),_(t),u||c.assign(i,!0)},e=>{c.if((0,r._)`!(${e} instanceof ${l.ValidationError})`,()=>c.throw(e)),g(e),u||c.assign(i,!1)}),e.ok(i)}function h(){e.result((0,n.callValidateCode)(e,t,p),()=>_(t),()=>g(t))}function g(e){let t=(0,r._)`${e}.errors`;c.assign(i.default.vErrors,(0,r._)`${i.default.vErrors} === null ? ${t} : ${i.default.vErrors}.concat(${t})`),c.assign(i.default.errors,(0,r._)`${i.default.vErrors}.length`)}function _(e){if(!l.opts.unevaluated)return;let t=a?.validate?.evaluated;if(l.props!==!0)if(t&&!t.dynamicProps)t.props!==void 0&&(l.props=o.mergeEvaluated.props(c,t.props,l.props));else{let t=c.var(`props`,(0,r._)`${e}.evaluated.props`);l.props=o.mergeEvaluated.props(c,t,l.props,r.Name)}if(l.items!==!0)if(t&&!t.dynamicItems)t.items!==void 0&&(l.items=o.mergeEvaluated.items(c,t.items,l.items));else{let t=c.var(`items`,(0,r._)`${e}.evaluated.items`);l.items=o.mergeEvaluated.items(c,t,l.items,r.Name)}}}e.callRef=l,e.default=s})),zI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=LI(),n=RI();e.default=[`$schema`,`$id`,`$defs`,`$vocabulary`,{keyword:`$comment`},`definitions`,t.default,n.default]})),BI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=t.operators,r={maximum:{okStr:`<=`,ok:n.LTE,fail:n.GT},minimum:{okStr:`>=`,ok:n.GTE,fail:n.LT},exclusiveMaximum:{okStr:`<`,ok:n.LT,fail:n.GTE},exclusiveMinimum:{okStr:`>`,ok:n.GT,fail:n.LTE}};e.default={keyword:Object.keys(r),type:`number`,schemaType:`number`,$data:!0,error:{message:({keyword:e,schemaCode:n})=>(0,t.str)`must be ${r[e].okStr} ${n}`,params:({keyword:e,schemaCode:n})=>(0,t._)`{comparison: ${r[e].okStr}, limit: ${n}}`},code(e){let{keyword:n,data:i,schemaCode:a}=e;e.fail$data((0,t._)`${i} ${r[n].fail} ${a} || isNaN(${i})`)}}})),VI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X();e.default={keyword:`multipleOf`,type:`number`,schemaType:`number`,$data:!0,error:{message:({schemaCode:e})=>(0,t.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,t._)`{multipleOf: ${e}}`},code(e){let{gen:n,data:r,schemaCode:i,it:a}=e,o=a.opts.multipleOfPrecision,s=n.let(`res`),c=o?(0,t._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${o}`:(0,t._)`${s} !== parseInt(${s})`;e.fail$data((0,t._)`(${i} === 0 || (${s} = ${r}/${i}, ${c}))`)}}})),HI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});function t(e){let t=e.length,n=0,r=0,i;for(;r<t;)n++,i=e.charCodeAt(r++),i>=55296&&i<=56319&&r<t&&(i=e.charCodeAt(r),(i&64512)==56320&&r++);return n}e.default=t,t.code=`require("ajv/dist/runtime/ucs2length").default`})),UI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=oI(),r=HI();e.default={keyword:[`maxLength`,`minLength`],type:`string`,schemaType:`number`,$data:!0,error:{message({keyword:e,schemaCode:n}){let r=e===`maxLength`?`more`:`fewer`;return(0,t.str)`must NOT have ${r} than ${n} characters`},params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:i,data:a,schemaCode:o,it:s}=e,c=i===`maxLength`?t.operators.GT:t.operators.LT,l=s.opts.unicode===!1?(0,t._)`${a}.length`:(0,t._)`${(0,n.useFunc)(e.gen,r.default)}(${a})`;e.fail$data((0,t._)`${l} ${c} ${o}`)}}})),WI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=mI(),n=oI(),r=X();e.default={keyword:`pattern`,type:`string`,schemaType:`string`,$data:!0,error:{message:({schemaCode:e})=>(0,r.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,r._)`{pattern: ${e}}`},code(e){let{gen:i,data:a,$data:o,schema:s,schemaCode:c,it:l}=e,u=l.opts.unicodeRegExp?`u`:``;if(o){let{regExp:t}=l.opts.code,o=t.code===`new RegExp`?(0,r._)`new RegExp`:(0,n.useFunc)(i,t),s=i.let(`valid`);i.try(()=>i.assign(s,(0,r._)`${o}(${c}, ${u}).test(${a})`),()=>i.assign(s,!1)),e.fail$data((0,r._)`!${s}`)}else{let n=(0,t.usePattern)(e,s);e.fail$data((0,r._)`!${n}.test(${a})`)}}}})),GI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X();e.default={keyword:[`maxProperties`,`minProperties`],type:`object`,schemaType:`number`,$data:!0,error:{message({keyword:e,schemaCode:n}){let r=e===`maxProperties`?`more`:`fewer`;return(0,t.str)`must NOT have ${r} than ${n} properties`},params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:n,data:r,schemaCode:i}=e,a=n===`maxProperties`?t.operators.GT:t.operators.LT;e.fail$data((0,t._)`Object.keys(${r}).length ${a} ${i}`)}}})),KI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=mI(),n=X(),r=oI();e.default={keyword:`required`,type:`object`,schemaType:`array`,$data:!0,error:{message:({params:{missingProperty:e}})=>(0,n.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,n._)`{missingProperty: ${e}}`},code(e){let{gen:i,schema:a,schemaCode:o,data:s,$data:c,it:l}=e,{opts:u}=l;if(!c&&a.length===0)return;let d=a.length>=u.loopRequired;if(l.allErrors?f():p(),u.strictRequired){let t=e.parentSchema.properties,{definedProperties:n}=e.it;for(let e of a)if(t?.[e]===void 0&&!n.has(e)){let t=`required property "${e}" is not defined at "${l.schemaEnv.baseId+l.errSchemaPath}" (strictRequired)`;(0,r.checkStrictMode)(l,t,l.opts.strictRequired)}}function f(){if(d||c)e.block$data(n.nil,m);else for(let n of a)(0,t.checkReportMissingProp)(e,n)}function p(){let n=i.let(`missing`);if(d||c){let t=i.let(`valid`,!0);e.block$data(t,()=>h(n,t)),e.ok(t)}else i.if((0,t.checkMissingProp)(e,a,n)),(0,t.reportMissingProp)(e,n),i.else()}function m(){i.forOf(`prop`,o,n=>{e.setParams({missingProperty:n}),i.if((0,t.noPropertyInData)(i,s,n,u.ownProperties),()=>e.error())})}function h(r,a){e.setParams({missingProperty:r}),i.forOf(r,o,()=>{i.assign(a,(0,t.propertyInData)(i,s,r,u.ownProperties)),i.if((0,n.not)(a),()=>{e.error(),i.break()})},n.nil)}}}})),qI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X();e.default={keyword:[`maxItems`,`minItems`],type:`array`,schemaType:`number`,$data:!0,error:{message({keyword:e,schemaCode:n}){let r=e===`maxItems`?`more`:`fewer`;return(0,t.str)`must NOT have ${r} than ${n} items`},params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:n,data:r,schemaCode:i}=e,a=n===`maxItems`?t.operators.GT:t.operators.LT;e.fail$data((0,t._)`${r}.length ${a} ${i}`)}}})),JI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=_I();t.code=`require("ajv/dist/runtime/equal").default`,e.default=t})),YI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=fI(),n=X(),r=oI(),i=JI();e.default={keyword:`uniqueItems`,type:`array`,schemaType:`boolean`,$data:!0,error:{message:({params:{i:e,j:t}})=>(0,n.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,n._)`{i: ${e}, j: ${t}}`},code(e){let{gen:a,data:o,$data:s,schema:c,parentSchema:l,schemaCode:u,it:d}=e;if(!s&&!c)return;let f=a.let(`valid`),p=l.items?(0,t.getSchemaTypes)(l.items):[];e.block$data(f,m,(0,n._)`${u} === false`),e.ok(f);function m(){let t=a.let(`i`,(0,n._)`${o}.length`),r=a.let(`j`);e.setParams({i:t,j:r}),a.assign(f,!0),a.if((0,n._)`${t} > 1`,()=>(h()?g:_)(t,r))}function h(){return p.length>0&&!p.some(e=>e===`object`||e===`array`)}function g(r,i){let s=a.name(`item`),c=(0,t.checkDataTypes)(p,s,d.opts.strictNumbers,t.DataType.Wrong),l=a.const(`indices`,(0,n._)`{}`);a.for((0,n._)`;${r}--;`,()=>{a.let(s,(0,n._)`${o}[${r}]`),a.if(c,(0,n._)`continue`),p.length>1&&a.if((0,n._)`typeof ${s} == "string"`,(0,n._)`${s} += "_"`),a.if((0,n._)`typeof ${l}[${s}] == "number"`,()=>{a.assign(i,(0,n._)`${l}[${s}]`),e.error(),a.assign(f,!1).break()}).code((0,n._)`${l}[${s}] = ${r}`)})}function _(t,s){let c=(0,r.useFunc)(a,i.default),l=a.name(`outer`);a.label(l).for((0,n._)`;${t}--;`,()=>a.for((0,n._)`${s} = ${t}; ${s}--;`,()=>a.if((0,n._)`${c}(${o}[${t}], ${o}[${s}])`,()=>{e.error(),a.assign(f,!1).break(l)})))}}}})),XI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=oI(),r=JI();e.default={keyword:`const`,$data:!0,error:{message:`must be equal to constant`,params:({schemaCode:e})=>(0,t._)`{allowedValue: ${e}}`},code(e){let{gen:i,data:a,$data:o,schemaCode:s,schema:c}=e;o||c&&typeof c==`object`?e.fail$data((0,t._)`!${(0,n.useFunc)(i,r.default)}(${a}, ${s})`):e.fail((0,t._)`${c} !== ${a}`)}}})),ZI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=oI(),r=JI();e.default={keyword:`enum`,schemaType:`array`,$data:!0,error:{message:`must be equal to one of the allowed values`,params:({schemaCode:e})=>(0,t._)`{allowedValues: ${e}}`},code(e){let{gen:i,data:a,$data:o,schema:s,schemaCode:c,it:l}=e;if(!o&&s.length===0)throw Error(`enum must have non-empty array`);let u=s.length>=l.opts.loopEnum,d,f=()=>d??=(0,n.useFunc)(i,r.default),p;if(u||o)p=i.let(`valid`),e.block$data(p,m);else{if(!Array.isArray(s))throw Error(`ajv implementation error`);let e=i.const(`vSchema`,c);p=(0,t.or)(...s.map((t,n)=>h(e,n)))}e.pass(p);function m(){i.assign(p,!1),i.forOf(`v`,c,e=>i.if((0,t._)`${f()}(${a}, ${e})`,()=>i.assign(p,!0).break()))}function h(e,n){let r=s[n];return typeof r==`object`&&r?(0,t._)`${f()}(${a}, ${e}[${n}])`:(0,t._)`${a} === ${r}`}}}})),QI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=BI(),n=VI(),r=UI(),i=WI(),a=GI(),o=KI(),s=qI(),c=YI(),l=XI(),u=ZI();e.default=[t.default,n.default,r.default,i.default,a.default,o.default,s.default,c.default,{keyword:`type`,schemaType:[`string`,`array`]},{keyword:`nullable`,schemaType:`boolean`},l.default,u.default]})),$I=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.validateAdditionalItems=void 0;var t=X(),n=oI(),r={keyword:`additionalItems`,type:`array`,schemaType:[`boolean`,`object`],before:`uniqueItems`,error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{parentSchema:t,it:r}=e,{items:a}=t;if(!Array.isArray(a)){(0,n.checkStrictMode)(r,`"additionalItems" is ignored when "items" is not an array of schemas`);return}i(e,a)}};function i(e,r){let{gen:i,schema:a,data:o,keyword:s,it:c}=e;c.items=!0;let l=i.const(`len`,(0,t._)`${o}.length`);if(a===!1)e.setParams({len:r.length}),e.pass((0,t._)`${l} <= ${r.length}`);else if(typeof a==`object`&&!(0,n.alwaysValidSchema)(c,a)){let n=i.var(`valid`,(0,t._)`${l} <= ${r.length}`);i.if((0,t.not)(n),()=>u(n)),e.ok(n)}function u(a){i.forRange(`i`,r.length,l,r=>{e.subschema({keyword:s,dataProp:r,dataPropType:n.Type.Num},a),c.allErrors||i.if((0,t.not)(a),()=>i.break())})}}e.validateAdditionalItems=i,e.default=r})),eL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.validateTuple=void 0;var t=X(),n=oI(),r=mI(),i={keyword:`items`,type:`array`,schemaType:[`object`,`array`,`boolean`],before:`uniqueItems`,code(e){let{schema:t,it:i}=e;if(Array.isArray(t))return a(e,`additionalItems`,t);i.items=!0,!(0,n.alwaysValidSchema)(i,t)&&e.ok((0,r.validateArray)(e))}};function a(e,r,i=e.schema){let{gen:a,parentSchema:o,data:s,keyword:c,it:l}=e;f(o),l.opts.unevaluated&&i.length&&l.items!==!0&&(l.items=n.mergeEvaluated.items(a,i.length,l.items));let u=a.name(`valid`),d=a.const(`len`,(0,t._)`${s}.length`);i.forEach((r,i)=>{(0,n.alwaysValidSchema)(l,r)||(a.if((0,t._)`${d} > ${i}`,()=>e.subschema({keyword:c,schemaProp:i,dataProp:i},u)),e.ok(u))});function f(e){let{opts:t,errSchemaPath:a}=l,o=i.length,s=o===e.minItems&&(o===e.maxItems||e[r]===!1);if(t.strictTuples&&!s){let e=`"${c}" is ${o}-tuple, but minItems or maxItems/${r} are not specified or different at path "${a}"`;(0,n.checkStrictMode)(l,e,t.strictTuples)}}}e.validateTuple=a,e.default=i})),tL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=eL();e.default={keyword:`prefixItems`,type:`array`,schemaType:[`array`],before:`uniqueItems`,code:e=>(0,t.validateTuple)(e,`items`)}})),nL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=oI(),r=mI(),i=$I();e.default={keyword:`items`,type:`array`,schemaType:[`object`,`boolean`],before:`uniqueItems`,error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{schema:t,parentSchema:a,it:o}=e,{prefixItems:s}=a;o.items=!0,!(0,n.alwaysValidSchema)(o,t)&&(s?(0,i.validateAdditionalItems)(e,s):e.ok((0,r.validateArray)(e)))}}})),rL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=oI();e.default={keyword:`contains`,type:`array`,schemaType:[`object`,`boolean`],before:`uniqueItems`,trackErrors:!0,error:{message:({params:{min:e,max:n}})=>n===void 0?(0,t.str)`must contain at least ${e} valid item(s)`:(0,t.str)`must contain at least ${e} and no more than ${n} valid item(s)`,params:({params:{min:e,max:n}})=>n===void 0?(0,t._)`{minContains: ${e}}`:(0,t._)`{minContains: ${e}, maxContains: ${n}}`},code(e){let{gen:r,schema:i,parentSchema:a,data:o,it:s}=e,c,l,{minContains:u,maxContains:d}=a;s.opts.next?(c=u===void 0?1:u,l=d):c=1;let f=r.const(`len`,(0,t._)`${o}.length`);if(e.setParams({min:c,max:l}),l===void 0&&c===0){(0,n.checkStrictMode)(s,`"minContains" == 0 without "maxContains": "contains" keyword ignored`);return}if(l!==void 0&&c>l){(0,n.checkStrictMode)(s,`"minContains" > "maxContains" is always invalid`),e.fail();return}if((0,n.alwaysValidSchema)(s,i)){let n=(0,t._)`${f} >= ${c}`;l!==void 0&&(n=(0,t._)`${n} && ${f} <= ${l}`),e.pass(n);return}s.items=!0;let p=r.name(`valid`);l===void 0&&c===1?h(p,()=>r.if(p,()=>r.break())):c===0?(r.let(p,!0),l!==void 0&&r.if((0,t._)`${o}.length > 0`,m)):(r.let(p,!1),m()),e.result(p,()=>e.reset());function m(){let e=r.name(`_valid`),t=r.let(`count`,0);h(e,()=>r.if(e,()=>g(t)))}function h(t,i){r.forRange(`i`,0,f,r=>{e.subschema({keyword:`contains`,dataProp:r,dataPropType:n.Type.Num,compositeRule:!0},t),i()})}function g(e){r.code((0,t._)`${e}++`),l===void 0?r.if((0,t._)`${e} >= ${c}`,()=>r.assign(p,!0).break()):(r.if((0,t._)`${e} > ${l}`,()=>r.assign(p,!1).break()),c===1?r.assign(p,!0):r.if((0,t._)`${e} >= ${c}`,()=>r.assign(p,!0)))}}}})),iL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;var t=X(),n=oI(),r=mI();e.error={message:({params:{property:e,depsCount:n,deps:r}})=>{let i=n===1?`property`:`properties`;return(0,t.str)`must have ${i} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:n,deps:r,missingProperty:i}})=>(0,t._)`{property: ${e},
365
+ || ${s} === "boolean" || ${a} === null`).assign(c,(0,i._)`[${a}]`)}}}function p({gen:e,parentData:t,parentDataProperty:n},r){e.if((0,i._)`${t} !== undefined`,()=>e.assign((0,i._)`${t}[${n}]`,r))}function m(e,t,n,r=o.Correct){let a=r===o.Correct?i.operators.EQ:i.operators.NEQ,s;switch(e){case`null`:return(0,i._)`${t} ${a} null`;case`array`:s=(0,i._)`Array.isArray(${t})`;break;case`object`:s=(0,i._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case`integer`:s=c((0,i._)`!(${t} % 1) && !isNaN(${t})`);break;case`number`:s=c();break;default:return(0,i._)`typeof ${t} ${a} ${e}`}return r===o.Correct?s:(0,i.not)(s);function c(e=i.nil){return(0,i.and)((0,i._)`typeof ${t} == "number"`,e,n?(0,i._)`isFinite(${t})`:i.nil)}}e.checkDataType=m;function h(e,t,n,r){if(e.length===1)return m(e[0],t,n,r);let o,s=(0,a.toHash)(e);if(s.array&&s.object){let e=(0,i._)`typeof ${t} != "object"`;o=s.null?e:(0,i._)`!${t} || ${e}`,delete s.null,delete s.array,delete s.object}else o=i.nil;s.number&&delete s.integer;for(let e in s)o=(0,i.and)(o,m(e,t,n,r));return o}e.checkDataTypes=h;var g={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e==`string`?(0,i._)`{type: ${e}}`:(0,i._)`{type: ${t}}`};function _(e){let t=v(e);(0,r.reportError)(t,g)}e.reportTypeError=_;function v(e){let{gen:t,data:n,schema:r}=e,i=(0,a.schemaRefOrVal)(e,r,`type`);return{gen:t,keyword:`type`,data:n,schema:r.type,schemaCode:i,schemaValue:i,parentSchema:r,params:{},it:e}}})),fI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.assignDefaults=void 0;var t=X(),n=aI();function r(e,t){let{properties:n,items:r}=e.schema;if(t===`object`&&n)for(let t in n)i(e,t,n[t].default);else t===`array`&&Array.isArray(r)&&r.forEach((t,n)=>i(e,n,t.default))}e.assignDefaults=r;function i(e,r,i){let{gen:a,compositeRule:o,data:s,opts:c}=e;if(i===void 0)return;let l=(0,t._)`${s}${(0,t.getProperty)(r)}`;if(o){(0,n.checkStrictMode)(e,`default is ignored for: ${l}`);return}let u=(0,t._)`${l} === undefined`;c.useDefaults===`empty`&&(u=(0,t._)`${u} || ${l} === null || ${l} === ""`),a.if(u,(0,t._)`${l} = ${(0,t.stringify)(i)}`)}})),pI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.validateUnion=e.validateArray=e.usePattern=e.callValidateCode=e.schemaProperties=e.allSchemaProperties=e.noPropertyInData=e.propertyInData=e.isOwnProperty=e.hasPropFunc=e.reportMissingProp=e.checkMissingProp=e.checkReportMissingProp=void 0;var t=X(),n=aI(),r=oI(),i=aI();function a(e,n){let{gen:r,data:i,it:a}=e;r.if(d(r,i,n,a.opts.ownProperties),()=>{e.setParams({missingProperty:(0,t._)`${n}`},!0),e.error()})}e.checkReportMissingProp=a;function o({gen:e,data:n,it:{opts:r}},i,a){return(0,t.or)(...i.map(i=>(0,t.and)(d(e,n,i,r.ownProperties),(0,t._)`${a} = ${i}`)))}e.checkMissingProp=o;function s(e,t){e.setParams({missingProperty:t},!0),e.error()}e.reportMissingProp=s;function c(e){return e.scopeValue(`func`,{ref:Object.prototype.hasOwnProperty,code:(0,t._)`Object.prototype.hasOwnProperty`})}e.hasPropFunc=c;function l(e,n,r){return(0,t._)`${c(e)}.call(${n}, ${r})`}e.isOwnProperty=l;function u(e,n,r,i){let a=(0,t._)`${n}${(0,t.getProperty)(r)} !== undefined`;return i?(0,t._)`${a} && ${l(e,n,r)}`:a}e.propertyInData=u;function d(e,n,r,i){let a=(0,t._)`${n}${(0,t.getProperty)(r)} === undefined`;return i?(0,t.or)(a,(0,t.not)(l(e,n,r))):a}e.noPropertyInData=d;function f(e){return e?Object.keys(e).filter(e=>e!==`__proto__`):[]}e.allSchemaProperties=f;function p(e,t){return f(t).filter(r=>!(0,n.alwaysValidSchema)(e,t[r]))}e.schemaProperties=p;function m({schemaCode:e,data:n,it:{gen:i,topSchemaRef:a,schemaPath:o,errorPath:s},it:c},l,u,d){let f=d?(0,t._)`${e}, ${n}, ${a}${o}`:n,p=[[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,s)],[r.default.parentData,c.parentData],[r.default.parentDataProperty,c.parentDataProperty],[r.default.rootData,r.default.rootData]];c.opts.dynamicRef&&p.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);let m=(0,t._)`${f}, ${i.object(...p)}`;return u===t.nil?(0,t._)`${l}(${m})`:(0,t._)`${l}.call(${u}, ${m})`}e.callValidateCode=m;var h=(0,t._)`new RegExp`;function g({gen:e,it:{opts:n}},r){let a=n.unicodeRegExp?`u`:``,{regExp:o}=n.code,s=o(r,a);return e.scopeValue(`pattern`,{key:s.toString(),ref:s,code:(0,t._)`${o.code===`new RegExp`?h:(0,i.useFunc)(e,o)}(${r}, ${a})`})}e.usePattern=g;function _(e){let{gen:r,data:i,keyword:a,it:o}=e,s=r.name(`valid`);if(o.allErrors){let e=r.let(`valid`,!0);return c(()=>r.assign(e,!1)),e}return r.var(s,!0),c(()=>r.break()),s;function c(o){let c=r.const(`len`,(0,t._)`${i}.length`);r.forRange(`i`,0,c,i=>{e.subschema({keyword:a,dataProp:i,dataPropType:n.Type.Num},s),r.if((0,t.not)(s),o)})}}e.validateArray=_;function v(e){let{gen:r,schema:i,keyword:a,it:o}=e;if(!Array.isArray(i))throw Error(`ajv implementation error`);if(i.some(e=>(0,n.alwaysValidSchema)(o,e))&&!o.opts.unevaluated)return;let s=r.let(`valid`,!1),c=r.name(`_valid`);r.block(()=>i.forEach((n,i)=>{let o=e.subschema({keyword:a,schemaProp:i,compositeRule:!0},c);r.assign(s,(0,t._)`${s} || ${c}`),e.mergeValidEvaluated(o,c)||r.if((0,t.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}e.validateUnion=v})),mI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.validateKeywordUsage=e.validSchemaType=e.funcKeywordCode=e.macroKeywordCode=void 0;var t=X(),n=oI(),r=pI(),i=sI();function a(e,n){let{gen:r,keyword:i,schema:a,parentSchema:o,it:s}=e,c=n.macro.call(s.self,a,o,s),l=u(r,i,c);s.opts.validateSchema!==!1&&s.self.validateSchema(c,!0);let d=r.name(`valid`);e.subschema({schema:c,schemaPath:t.nil,errSchemaPath:`${s.errSchemaPath}/${i}`,topSchemaRef:l,compositeRule:!0},d),e.pass(d,()=>e.error(!0))}e.macroKeywordCode=a;function o(e,i){let{gen:a,keyword:o,schema:d,parentSchema:f,$data:p,it:m}=e;l(m,i);let h=u(a,o,!p&&i.compile?i.compile.call(m.self,d,f,m):i.validate),g=a.let(`valid`);e.block$data(g,_),e.ok(i.valid??g);function _(){if(i.errors===!1)b(),i.modifying&&s(e),x(()=>e.error());else{let t=i.async?v():y();i.modifying&&s(e),x(()=>c(e,t))}}function v(){let e=a.let(`ruleErrs`,null);return a.try(()=>b((0,t._)`await `),n=>a.assign(g,!1).if((0,t._)`${n} instanceof ${m.ValidationError}`,()=>a.assign(e,(0,t._)`${n}.errors`),()=>a.throw(n))),e}function y(){let e=(0,t._)`${h}.errors`;return a.assign(e,null),b(t.nil),e}function b(o=i.async?(0,t._)`await `:t.nil){let s=m.opts.passContext?n.default.this:n.default.self,c=!(`compile`in i&&!p||i.schema===!1);a.assign(g,(0,t._)`${o}${(0,r.callValidateCode)(e,h,s,c)}`,i.modifying)}function x(e){a.if((0,t.not)(i.valid??g),e)}}e.funcKeywordCode=o;function s(e){let{gen:n,data:r,it:i}=e;n.if(i.parentData,()=>n.assign(r,(0,t._)`${i.parentData}[${i.parentDataProperty}]`))}function c(e,r){let{gen:a}=e;a.if((0,t._)`Array.isArray(${r})`,()=>{a.assign(n.default.vErrors,(0,t._)`${n.default.vErrors} === null ? ${r} : ${n.default.vErrors}.concat(${r})`).assign(n.default.errors,(0,t._)`${n.default.vErrors}.length`),(0,i.extendErrors)(e)},()=>e.error())}function l({schemaEnv:e},t){if(t.async&&!e.$async)throw Error(`async keyword in sync schema`)}function u(e,n,r){if(r===void 0)throw Error(`keyword "${n}" failed to compile`);return e.scopeValue(`keyword`,typeof r==`function`?{ref:r}:{ref:r,code:(0,t.stringify)(r)})}function d(e,t,n=!1){return!t.length||t.some(t=>t===`array`?Array.isArray(e):t===`object`?e&&typeof e==`object`&&!Array.isArray(e):typeof e==t||n&&e===void 0)}e.validSchemaType=d;function f({schema:e,opts:t,self:n,errSchemaPath:r},i,a){if(Array.isArray(i.keyword)?!i.keyword.includes(a):i.keyword!==a)throw Error(`ajv implementation error`);let o=i.dependencies;if(o?.some(t=>!Object.prototype.hasOwnProperty.call(e,t)))throw Error(`parent schema must have dependencies of ${a}: ${o.join(`,`)}`);if(i.validateSchema&&!i.validateSchema(e[a])){let e=`keyword "${a}" value is invalid at path "${r}": `+n.errorsText(i.validateSchema.errors);if(t.validateSchema===`log`)n.logger.error(e);else throw Error(e)}}e.validateKeywordUsage=f})),hI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.extendSubschemaMode=e.extendSubschemaData=e.getSubschema=void 0;var t=X(),n=aI();function r(e,{keyword:r,schemaProp:i,schema:a,schemaPath:o,errSchemaPath:s,topSchemaRef:c}){if(r!==void 0&&a!==void 0)throw Error(`both "keyword" and "schema" passed, only one allowed`);if(r!==void 0){let a=e.schema[r];return i===void 0?{schema:a,schemaPath:(0,t._)`${e.schemaPath}${(0,t.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${r}`}:{schema:a[i],schemaPath:(0,t._)`${e.schemaPath}${(0,t.getProperty)(r)}${(0,t.getProperty)(i)}`,errSchemaPath:`${e.errSchemaPath}/${r}/${(0,n.escapeFragment)(i)}`}}if(a!==void 0){if(o===void 0||s===void 0||c===void 0)throw Error(`"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"`);return{schema:a,schemaPath:o,topSchemaRef:c,errSchemaPath:s}}throw Error(`either "keyword" or "schema" must be passed`)}e.getSubschema=r;function i(e,r,{dataProp:i,dataPropType:a,data:o,dataTypes:s,propertyName:c}){if(o!==void 0&&i!==void 0)throw Error(`both "data" and "dataProp" passed, only one allowed`);let{gen:l}=r;if(i!==void 0){let{errorPath:o,dataPathArr:s,opts:c}=r;u(l.let(`data`,(0,t._)`${r.data}${(0,t.getProperty)(i)}`,!0)),e.errorPath=(0,t.str)`${o}${(0,n.getErrorPath)(i,a,c.jsPropertySyntax)}`,e.parentDataProperty=(0,t._)`${i}`,e.dataPathArr=[...s,e.parentDataProperty]}o!==void 0&&(u(o instanceof t.Name?o:l.let(`data`,o,!0)),c!==void 0&&(e.propertyName=c)),s&&(e.dataTypes=s);function u(t){e.data=t,e.dataLevel=r.dataLevel+1,e.dataTypes=[],r.definedProperties=new Set,e.parentData=r.data,e.dataNames=[...r.dataNames,t]}}e.extendSubschemaData=i;function a(e,{jtdDiscriminator:t,jtdMetadata:n,compositeRule:r,createErrors:i,allErrors:a}){r!==void 0&&(e.compositeRule=r),i!==void 0&&(e.createErrors=i),a!==void 0&&(e.allErrors=a),e.jtdDiscriminator=t,e.jtdMetadata=n}e.extendSubschemaMode=a})),gI=a(((e,t)=>{t.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t==`object`&&typeof n==`object`){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}})),_I=a(((e,t)=>{var n=t.exports=function(e,t,n){typeof t==`function`&&(n=t,t={}),n=t.cb||n;var i=typeof n==`function`?n:n.pre||function(){},a=n.post||function(){};r(t,i,a,e,``,e)};n.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},n.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},n.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},n.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function r(e,t,a,o,s,c,l,u,d,f){if(o&&typeof o==`object`&&!Array.isArray(o)){for(var p in t(o,s,c,l,u,d,f),o){var m=o[p];if(Array.isArray(m)){if(p in n.arrayKeywords)for(var h=0;h<m.length;h++)r(e,t,a,m[h],s+`/`+p+`/`+h,c,s,p,o,h)}else if(p in n.propsKeywords){if(m&&typeof m==`object`)for(var g in m)r(e,t,a,m[g],s+`/`+p+`/`+i(g),c,s,p,o,g)}else (p in n.keywords||e.allKeys&&!(p in n.skipKeywords))&&r(e,t,a,m,s+`/`+p,c,s,p,o)}a(o,s,c,l,u,d,f)}}function i(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}})),vI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getSchemaRefs=e.resolveUrl=e.normalizeId=e._getFullPath=e.getFullPath=e.inlineRef=void 0;var t=aI(),n=gI(),r=_I(),i=new Set([`type`,`format`,`pattern`,`maxLength`,`minLength`,`maxProperties`,`minProperties`,`maxItems`,`minItems`,`maximum`,`minimum`,`uniqueItems`,`multipleOf`,`required`,`enum`,`const`]);function a(e,t=!0){return typeof e==`boolean`?!0:t===!0?!s(e):t?c(e)<=t:!1}e.inlineRef=a;var o=new Set([`$ref`,`$recursiveRef`,`$recursiveAnchor`,`$dynamicRef`,`$dynamicAnchor`]);function s(e){for(let t in e){if(o.has(t))return!0;let n=e[t];if(Array.isArray(n)&&n.some(s)||typeof n==`object`&&s(n))return!0}return!1}function c(e){let n=0;for(let r in e)if(r===`$ref`||(n++,!i.has(r)&&(typeof e[r]==`object`&&(0,t.eachItem)(e[r],e=>n+=c(e)),n===1/0)))return 1/0;return n}function l(e,t=``,n){return n!==!1&&(t=f(t)),u(e,e.parse(t))}e.getFullPath=l;function u(e,t){return e.serialize(t).split(`#`)[0]+`#`}e._getFullPath=u;var d=/#\/?$/;function f(e){return e?e.replace(d,``):``}e.normalizeId=f;function p(e,t,n){return n=f(n),e.resolve(t,n)}e.resolveUrl=p;var m=/^[a-z_][-a-z0-9._]*$/i;function h(e,t){if(typeof e==`boolean`)return{};let{schemaId:i,uriResolver:a}=this.opts,o=f(e[i]||t),s={"":o},c=l(a,o,!1),u={},d=new Set;return r(e,{allKeys:!0},(e,t,n,r)=>{if(r===void 0)return;let a=c+t,o=s[r];typeof e[i]==`string`&&(o=l.call(this,e[i])),g.call(this,e.$anchor),g.call(this,e.$dynamicAnchor),s[t]=o;function l(t){let n=this.opts.uriResolver.resolve;if(t=f(o?n(o,t):t),d.has(t))throw h(t);d.add(t);let r=this.refs[t];return typeof r==`string`&&(r=this.refs[r]),typeof r==`object`?p(e,r.schema,t):t!==f(a)&&(t[0]===`#`?(p(e,u[t],t),u[t]=e):this.refs[t]=a),t}function g(e){if(typeof e==`string`){if(!m.test(e))throw Error(`invalid anchor "${e}"`);l.call(this,`#${e}`)}}}),u;function p(e,t,r){if(t!==void 0&&!n(e,t))throw h(r)}function h(e){return Error(`reference "${e}" resolves to more than one schema`)}}e.getSchemaRefs=h})),yI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getData=e.KeywordCxt=e.validateFunctionCode=void 0;var t=cI(),n=dI(),r=uI(),i=dI(),a=fI(),o=mI(),s=hI(),c=X(),l=oI(),u=vI(),d=aI(),f=sI();function p(e){if(S(e)&&(w(e),x(e))){_(e);return}m(e,()=>(0,t.topBoolOrEmptySchema)(e))}e.validateFunctionCode=p;function m({gen:e,validateName:t,schema:n,schemaEnv:r,opts:i},a){i.code.es5?e.func(t,(0,c._)`${l.default.data}, ${l.default.valCxt}`,r.$async,()=>{e.code((0,c._)`"use strict"; ${y(n,i)}`),g(e,i),e.code(a)}):e.func(t,(0,c._)`${l.default.data}, ${h(i)}`,r.$async,()=>e.code(y(n,i)).code(a))}function h(e){return(0,c._)`{${l.default.instancePath}="", ${l.default.parentData}, ${l.default.parentDataProperty}, ${l.default.rootData}=${l.default.data}${e.dynamicRef?(0,c._)`, ${l.default.dynamicAnchors}={}`:c.nil}}={}`}function g(e,t){e.if(l.default.valCxt,()=>{e.var(l.default.instancePath,(0,c._)`${l.default.valCxt}.${l.default.instancePath}`),e.var(l.default.parentData,(0,c._)`${l.default.valCxt}.${l.default.parentData}`),e.var(l.default.parentDataProperty,(0,c._)`${l.default.valCxt}.${l.default.parentDataProperty}`),e.var(l.default.rootData,(0,c._)`${l.default.valCxt}.${l.default.rootData}`),t.dynamicRef&&e.var(l.default.dynamicAnchors,(0,c._)`${l.default.valCxt}.${l.default.dynamicAnchors}`)},()=>{e.var(l.default.instancePath,(0,c._)`""`),e.var(l.default.parentData,(0,c._)`undefined`),e.var(l.default.parentDataProperty,(0,c._)`undefined`),e.var(l.default.rootData,l.default.data),t.dynamicRef&&e.var(l.default.dynamicAnchors,(0,c._)`{}`)})}function _(e){let{schema:t,opts:n,gen:r}=e;m(e,()=>{n.$comment&&t.$comment&&ne(e),ee(e),r.let(l.default.vErrors,null),r.let(l.default.errors,0),n.unevaluated&&v(e),T(e),re(e)})}function v(e){let{gen:t,validateName:n}=e;e.evaluated=t.const(`evaluated`,(0,c._)`${n}.evaluated`),t.if((0,c._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,c._)`${e.evaluated}.props`,(0,c._)`undefined`)),t.if((0,c._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,c._)`${e.evaluated}.items`,(0,c._)`undefined`))}function y(e,t){let n=typeof e==`object`&&e[t.schemaId];return n&&(t.code.source||t.code.process)?(0,c._)`/*# sourceURL=${n} */`:c.nil}function b(e,n){if(S(e)&&(w(e),x(e))){C(e,n);return}(0,t.boolOrEmptySchema)(e,n)}function x({schema:e,self:t}){if(typeof e==`boolean`)return!e;for(let n in e)if(t.RULES.all[n])return!0;return!1}function S(e){return typeof e.schema!=`boolean`}function C(e,t){let{schema:n,gen:r,opts:i}=e;i.$comment&&n.$comment&&ne(e),te(e),D(e);let a=r.const(`_errs`,l.default.errors);T(e,a),r.var(t,(0,c._)`${a} === ${l.default.errors}`)}function w(e){(0,d.checkUnknownRules)(e),E(e)}function T(e,t){if(e.opts.jtd)return ae(e,[],!1,t);let r=(0,n.getSchemaTypes)(e.schema);ae(e,r,!(0,n.coerceAndCheckDataType)(e,r),t)}function E(e){let{schema:t,errSchemaPath:n,opts:r,self:i}=e;t.$ref&&r.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}function ee(e){let{schema:t,opts:n}=e;t.default!==void 0&&n.useDefaults&&n.strictSchema&&(0,d.checkStrictMode)(e,`default is ignored in the schema root`)}function te(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,u.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function D(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error(`async schema in sync schema`)}function ne({gen:e,schemaEnv:t,schema:n,errSchemaPath:r,opts:i}){let a=n.$comment;if(i.$comment===!0)e.code((0,c._)`${l.default.self}.logger.log(${a})`);else if(typeof i.$comment==`function`){let n=(0,c.str)`${r}/$comment`,i=e.scopeValue(`root`,{ref:t.root});e.code((0,c._)`${l.default.self}.opts.$comment(${a}, ${n}, ${i}.schema)`)}}function re(e){let{gen:t,schemaEnv:n,validateName:r,ValidationError:i,opts:a}=e;n.$async?t.if((0,c._)`${l.default.errors} === 0`,()=>t.return(l.default.data),()=>t.throw((0,c._)`new ${i}(${l.default.vErrors})`)):(t.assign((0,c._)`${r}.errors`,l.default.vErrors),a.unevaluated&&ie(e),t.return((0,c._)`${l.default.errors} === 0`))}function ie({gen:e,evaluated:t,props:n,items:r}){n instanceof c.Name&&e.assign((0,c._)`${t}.props`,n),r instanceof c.Name&&e.assign((0,c._)`${t}.items`,r)}function ae(e,t,n,a){let{gen:o,schema:s,data:u,allErrors:f,opts:p,self:m}=e,{RULES:h}=m;if(s.$ref&&(p.ignoreKeywordsWithRef||!(0,d.schemaHasRulesButRef)(s,h))){o.block(()=>pe(e,`$ref`,h.all.$ref.definition));return}p.jtd||se(e,t),o.block(()=>{for(let e of h.rules)g(e);g(h.post)});function g(d){(0,r.shouldUseGroup)(s,d)&&(d.type?(o.if((0,i.checkDataType)(d.type,u,p.strictNumbers)),oe(e,d),t.length===1&&t[0]===d.type&&n&&(o.else(),(0,i.reportTypeError)(e)),o.endIf()):oe(e,d),f||o.if((0,c._)`${l.default.errors} === ${a||0}`))}}function oe(e,t){let{gen:n,schema:i,opts:{useDefaults:o}}=e;o&&(0,a.assignDefaults)(e,t.type),n.block(()=>{for(let n of t.rules)(0,r.shouldUseRule)(i,n)&&pe(e,n.keyword,n.definition,t.type)})}function se(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(ce(e,t),e.opts.allowUnionTypes||O(e,t),le(e,e.dataTypes))}function ce(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(t=>{de(e.dataTypes,t)||A(e,`type "${t}" not allowed by context "${e.dataTypes.join(`,`)}"`)}),k(e,t)}}function O(e,t){t.length>1&&!(t.length===2&&t.includes(`null`))&&A(e,`use allowUnionTypes to allow union type keyword`)}function le(e,t){let n=e.self.RULES.all;for(let i in n){let a=n[i];if(typeof a==`object`&&(0,r.shouldUseRule)(e.schema,a)){let{type:n}=a.definition;n.length&&!n.some(e=>ue(t,e))&&A(e,`missing type "${n.join(`,`)}" for keyword "${i}"`)}}}function ue(e,t){return e.includes(t)||t===`number`&&e.includes(`integer`)}function de(e,t){return e.includes(t)||t===`integer`&&e.includes(`number`)}function k(e,t){let n=[];for(let r of e.dataTypes)de(t,r)?n.push(r):t.includes(`integer`)&&r===`number`&&n.push(`integer`);e.dataTypes=n}function A(e,t){let n=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${n}" (strictTypes)`,(0,d.checkStrictMode)(e,t,e.opts.strictTypes)}var fe=class{constructor(e,t,n){if((0,o.validateKeywordUsage)(e,t,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,d.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const(`vSchema`,ge(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,o.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw Error(`${n} value must be ${JSON.stringify(t.schemaType)}`);(`code`in t?t.trackErrors:t.errors!==!1)&&(this.errsCount=e.gen.const(`_errs`,l.default.errors))}result(e,t,n){this.failResult((0,c.not)(e),t,n)}failResult(e,t,n){this.gen.if(e),n?n():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,c.not)(e),void 0,t)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail((0,c._)`${t} !== undefined && (${(0,c.or)(this.invalid$data(),e)})`)}error(e,t,n){if(t){this.setParams(t),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,t){(e?f.reportExtraError:f.reportError)(this,this.def.error,t)}$dataError(){(0,f.reportError)(this,this.def.$dataError||f.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error(`add "trackErrors" to keyword definition`);(0,f.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,n=c.nil){this.gen.block(()=>{this.check$data(e,n),t()})}check$data(e=c.nil,t=c.nil){if(!this.$data)return;let{gen:n,schemaCode:r,schemaType:i,def:a}=this;n.if((0,c.or)((0,c._)`${r} === undefined`,t)),e!==c.nil&&n.assign(e,!0),(i.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==c.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:n,def:r,it:a}=this;return(0,c.or)(o(),s());function o(){if(n.length){if(!(t instanceof c.Name))throw Error(`ajv implementation error`);let e=Array.isArray(n)?n:[n];return(0,c._)`${(0,i.checkDataTypes)(e,t,a.opts.strictNumbers,i.DataType.Wrong)}`}return c.nil}function s(){if(r.validateSchema){let n=e.scopeValue(`validate$data`,{ref:r.validateSchema});return(0,c._)`!${n}(${t})`}return c.nil}}subschema(e,t){let n=(0,s.getSubschema)(this.it,e);(0,s.extendSubschemaData)(n,this.it,e),(0,s.extendSubschemaMode)(n,e);let r={...this.it,...n,items:void 0,props:void 0};return b(r,t),r}mergeEvaluated(e,t){let{it:n,gen:r}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=d.mergeEvaluated.props(r,e.props,n.props,t)),n.items!==!0&&e.items!==void 0&&(n.items=d.mergeEvaluated.items(r,e.items,n.items,t)))}mergeValidEvaluated(e,t){let{it:n,gen:r}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return r.if(t,()=>this.mergeEvaluated(e,c.Name)),!0}};e.KeywordCxt=fe;function pe(e,t,n,r){let i=new fe(e,n,t);`code`in n?n.code(i,r):i.$data&&n.validate?(0,o.funcKeywordCode)(i,n):`macro`in n?(0,o.macroKeywordCode)(i,n):(n.compile||n.validate)&&(0,o.funcKeywordCode)(i,n)}var me=/^\/(?:[^~]|~0|~1)*$/,he=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function ge(e,{dataLevel:t,dataNames:n,dataPathArr:r}){let i,a;if(e===``)return l.default.rootData;if(e[0]===`/`){if(!me.test(e))throw Error(`Invalid JSON-pointer: ${e}`);i=e,a=l.default.rootData}else{let o=he.exec(e);if(!o)throw Error(`Invalid JSON-pointer: ${e}`);let s=+o[1];if(i=o[2],i===`#`){if(s>=t)throw Error(u(`property/index`,s));return r[t-s]}if(s>t)throw Error(u(`data`,s));if(a=n[t-s],!i)return a}let o=a,s=i.split(`/`);for(let e of s)e&&(a=(0,c._)`${a}${(0,c.getProperty)((0,d.unescapeJsonPointer)(e))}`,o=(0,c._)`${o} && ${a}`);return o;function u(e,n){return`Cannot access ${e} ${n} levels up, current level is ${t}`}}e.getData=ge})),bI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=class extends Error{constructor(e){super(`validation failed`),this.errors=e,this.ajv=this.validation=!0}}})),xI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=vI();e.default=class extends Error{constructor(e,n,r,i){super(i||`can't resolve reference ${r} from id ${n}`),this.missingRef=(0,t.resolveUrl)(e,n,r),this.missingSchema=(0,t.normalizeId)((0,t.getFullPath)(e,this.missingRef))}}})),SI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.resolveSchema=e.getCompilingSchema=e.resolveRef=e.compileSchema=e.SchemaEnv=void 0;var t=X(),n=bI(),r=oI(),i=vI(),a=aI(),o=yI(),s=class{constructor(e){this.refs={},this.dynamicAnchors={};let t;typeof e.schema==`object`&&(t=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=e.baseId??(0,i.normalizeId)(t?.[e.schemaId||`$id`]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=t?.$async,this.refs={}}};e.SchemaEnv=s;function c(e){let a=d.call(this,e);if(a)return a;let s=(0,i.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:c,lines:l}=this.opts.code,{ownProperties:u}=this.opts,f=new t.CodeGen(this.scope,{es5:c,lines:l,ownProperties:u}),p;e.$async&&(p=f.scopeValue(`Error`,{ref:n.default,code:(0,t._)`require("ajv/dist/runtime/validation_error").default`}));let m=f.scopeName(`validate`);e.validateName=m;let h={gen:f,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[t.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:f.scopeValue(`schema`,this.opts.code.source===!0?{ref:e.schema,code:(0,t.stringify)(e.schema)}:{ref:e.schema}),validateName:m,ValidationError:p,schema:e.schema,schemaEnv:e,rootId:s,baseId:e.baseId||s,schemaPath:t.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?``:`#`),errorPath:(0,t._)`""`,opts:this.opts,self:this},g;try{this._compilations.add(e),(0,o.validateFunctionCode)(h),f.optimize(this.opts.code.optimize);let n=f.toString();g=`${f.scopeRefs(r.default.scope)}return ${n}`,this.opts.code.process&&(g=this.opts.code.process(g,e));let i=Function(`${r.default.self}`,`${r.default.scope}`,g)(this,this.scope.get());if(this.scope.value(m,{ref:i}),i.errors=null,i.schema=e.schema,i.schemaEnv=e,e.$async&&(i.$async=!0),this.opts.code.source===!0&&(i.source={validateName:m,validateCode:n,scopeValues:f._values}),this.opts.unevaluated){let{props:e,items:n}=h;i.evaluated={props:e instanceof t.Name?void 0:e,items:n instanceof t.Name?void 0:n,dynamicProps:e instanceof t.Name,dynamicItems:n instanceof t.Name},i.source&&(i.source.evaluated=(0,t.stringify)(i.evaluated))}return e.validate=i,e}catch(t){throw delete e.validate,delete e.validateName,g&&this.logger.error(`Error compiling schema, function code:`,g),t}finally{this._compilations.delete(e)}}e.compileSchema=c;function l(e,t,n){n=(0,i.resolveUrl)(this.opts.uriResolver,t,n);let r=e.refs[n];if(r)return r;let a=p.call(this,e,n);if(a===void 0){let r=e.localRefs?.[n],{schemaId:i}=this.opts;r&&(a=new s({schema:r,schemaId:i,root:e,baseId:t}))}if(a!==void 0)return e.refs[n]=u.call(this,a)}e.resolveRef=l;function u(e){return(0,i.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:c.call(this,e)}function d(e){for(let t of this._compilations)if(f(t,e))return t}e.getCompilingSchema=d;function f(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function p(e,t){let n;for(;typeof(n=this.refs[t])==`string`;)t=n;return n||this.schemas[t]||m.call(this,e,t)}function m(e,t){let n=this.opts.uriResolver.parse(t),r=(0,i._getFullPath)(this.opts.uriResolver,n),a=(0,i.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&r===a)return g.call(this,n,e);let o=(0,i.normalizeId)(r),l=this.refs[o]||this.schemas[o];if(typeof l==`string`){let t=m.call(this,e,l);return typeof t?.schema==`object`?g.call(this,n,t):void 0}if(typeof l?.schema==`object`){if(l.validate||c.call(this,l),o===(0,i.normalizeId)(t)){let{schema:t}=l,{schemaId:n}=this.opts,r=t[n];return r&&(a=(0,i.resolveUrl)(this.opts.uriResolver,a,r)),new s({schema:t,schemaId:n,root:e,baseId:a})}return g.call(this,n,l)}}e.resolveSchema=m;var h=new Set([`properties`,`patternProperties`,`enum`,`dependencies`,`definitions`]);function g(e,{baseId:t,schema:n,root:r}){if(e.fragment?.[0]!==`/`)return;for(let r of e.fragment.slice(1).split(`/`)){if(typeof n==`boolean`)return;let e=n[(0,a.unescapeFragment)(r)];if(e===void 0)return;n=e;let o=typeof n==`object`&&n[this.opts.schemaId];!h.has(r)&&o&&(t=(0,i.resolveUrl)(this.opts.uriResolver,t,o))}let o;if(typeof n!=`boolean`&&n.$ref&&!(0,a.schemaHasRulesButRef)(n,this.RULES)){let e=(0,i.resolveUrl)(this.opts.uriResolver,t,n.$ref);o=m.call(this,r,e)}let{schemaId:c}=this.opts;if(o||=new s({schema:n,schemaId:c,root:r,baseId:t}),o.schema!==o.root.schema)return o}})),CI=i({$id:()=>wI,additionalProperties:()=>!1,default:()=>kI,description:()=>TI,properties:()=>OI,required:()=>DI,type:()=>EI}),wI,TI,EI,DI,OI,kI,AI=n((()=>{wI=`https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#`,TI=`Meta-schema for $data reference (JSON AnySchema extension proposal)`,EI=`object`,DI=[`$data`],OI={$data:{type:`string`,anyOf:[{format:`relative-json-pointer`},{format:`json-pointer`}]}},kI={$id:wI,description:TI,type:EI,required:DI,properties:OI,additionalProperties:!1}})),jI=a(((e,t)=>{var n=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),r=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),i=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),a=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),o=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function s(e){let t=``,n=0,r=0;for(r=0;r<e.length;r++)if(n=e[r].charCodeAt(0),n!==48){if(!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return``;t+=e[r];break}for(r+=1;r<e.length;r++){if(n=e[r].charCodeAt(0),!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return``;t+=e[r]}return t}var c=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function l(e){return e.length=0,!0}function u(e,t,n){if(e.length){let r=s(e);if(r!==``)t.push(r);else return n.error=!0,!1;e.length=0}return!0}function d(e){let t=0,n={error:!1,address:``,zone:``},r=[],i=[],a=!1,o=!1,c=u;for(let s=0;s<e.length;s++){let u=e[s];if(!(u===`[`||u===`]`))if(u===`:`){if(a===!0&&(o=!0),!c(i,r,n))break;if(++t>7){n.error=!0;break}s>0&&e[s-1]===`:`&&(a=!0),r.push(`:`);continue}else if(u===`%`){if(!c(i,r,n))break;c=l}else{i.push(u);continue}}return i.length&&(c===l?n.zone=i.join(``):o?r.push(i.join(``)):r.push(s(i))),n.address=r.join(``),n}function f(e){if(p(e,`:`)<2)return{host:e,isIPV6:!1};let t=d(e);if(t.error)return{host:e,isIPV6:!1};{let e=t.address,n=t.address;return t.zone&&(e+=`%`+t.zone,n+=`%25`+t.zone),{host:e,isIPV6:!0,escapedHost:n}}}function p(e,t){let n=0;for(let r=0;r<e.length;r++)e[r]===t&&n++;return n}function m(e){let t=e,n=[],r=-1,i=0;for(;i=t.length;){if(i===1){if(t===`.`)break;if(t===`/`){n.push(`/`);break}else{n.push(t);break}}else if(i===2){if(t[0]===`.`){if(t[1]===`.`)break;if(t[1]===`/`){t=t.slice(2);continue}}else if(t[0]===`/`&&(t[1]===`.`||t[1]===`/`)){n.push(`/`);break}}else if(i===3&&t===`/..`){n.length!==0&&n.pop(),n.push(`/`);break}if(t[0]===`.`){if(t[1]===`.`){if(t[2]===`/`){t=t.slice(3);continue}}else if(t[1]===`/`){t=t.slice(2);continue}}else if(t[0]===`/`&&t[1]===`.`){if(t[2]===`/`){t=t.slice(2);continue}else if(t[2]===`.`&&t[3]===`/`){t=t.slice(3),n.length!==0&&n.pop();continue}}if((r=t.indexOf(`/`,1))===-1){n.push(t);break}else n.push(t.slice(0,r)),t=t.slice(r)}return n.join(``)}var h={"@":`%40`,"/":`%2F`,"?":`%3F`,"#":`%23`,":":`%3A`},g=/[@/?#:]/g,_=/[@/?#]/g;function v(e,t){let n=t?_:g;return n.lastIndex=0,e.replace(n,e=>h[e])}function y(e,t=!1){if(e.indexOf(`%`)===-1)return e;let n=``;for(let r=0;r<e.length;r++){if(e[r]===`%`&&r+2<e.length){let o=e.slice(r+1,r+3);if(i(o)){let e=o.toUpperCase(),i=String.fromCharCode(parseInt(e,16));t&&a(i)?n+=i:n+=`%`+e,r+=2;continue}}n+=e[r]}return n}function b(e){let t=``;for(let n=0;n<e.length;n++){if(e[n]===`%`&&n+2<e.length){let r=e.slice(n+1,n+3);if(i(r)){let e=r.toUpperCase(),i=String.fromCharCode(parseInt(e,16));i!==`.`&&a(i)?t+=i:t+=`%`+e,n+=2;continue}}o(e[n])?t+=e[n]:t+=escape(e[n])}return t}function x(e){let t=``;for(let n=0;n<e.length;n++){if(e[n]===`%`&&n+2<e.length){let r=e.slice(n+1,n+3);if(i(r)){t+=`%`+r.toUpperCase(),n+=2;continue}}t+=escape(e[n])}return t}function S(e){let t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push(`@`)),e.host!==void 0){let n=unescape(e.host);if(!r(n)){let e=f(n);n=e.isIPV6===!0?`[${e.escapedHost}]`:v(n,!1)}t.push(n)}return(typeof e.port==`number`||typeof e.port==`string`)&&(t.push(`:`),t.push(String(e.port))),t.length?t.join(``):void 0}t.exports={nonSimpleDomain:c,recomposeAuthority:S,reescapeHostDelimiters:v,normalizePercentEncoding:y,normalizePathEncoding:b,escapePreservingEscapes:x,removeDotSegments:m,isIPv4:r,isUUID:n,normalizeIPv6:f,stringArrayToHexStripped:s}})),MI=a(((e,t)=>{var{isUUID:n}=jI(),r=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,i=[`http`,`https`,`ws`,`wss`,`urn`,`urn:uuid`];function a(e){return i.indexOf(e)!==-1}function o(e){return e.secure===!0?!0:e.secure===!1?!1:e.scheme?e.scheme.length===3&&(e.scheme[0]===`w`||e.scheme[0]===`W`)&&(e.scheme[1]===`s`||e.scheme[1]===`S`)&&(e.scheme[2]===`s`||e.scheme[2]===`S`):!1}function s(e){return e.host||(e.error=e.error||`HTTP URIs must have a host.`),e}function c(e){let t=String(e.scheme).toLowerCase()===`https`;return(e.port===(t?443:80)||e.port===``)&&(e.port=void 0),e.path||=`/`,e}function l(e){return e.secure=o(e),e.resourceName=(e.path||`/`)+(e.query?`?`+e.query:``),e.path=void 0,e.query=void 0,e}function u(e){if((e.port===(o(e)?443:80)||e.port===``)&&(e.port=void 0),typeof e.secure==`boolean`&&(e.scheme=e.secure?`wss`:`ws`,e.secure=void 0),e.resourceName){let[t,n]=e.resourceName.split(`?`);e.path=t&&t!==`/`?t:void 0,e.query=n,e.resourceName=void 0}return e.fragment=void 0,e}function d(e,t){if(!e.path)return e.error=`URN can not be parsed`,e;let n=e.path.match(r);if(n){let r=t.scheme||e.scheme||`urn`;e.nid=n[1].toLowerCase(),e.nss=n[2];let i=y(`${r}:${t.nid||e.nid}`);e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||`URN can not be parsed.`;return e}function f(e,t){if(e.nid===void 0)throw Error(`URN without nid cannot be serialized`);let n=t.scheme||e.scheme||`urn`,r=e.nid.toLowerCase(),i=y(`${n}:${t.nid||r}`);i&&(e=i.serialize(e,t));let a=e,o=e.nss;return a.path=`${r||t.nid}:${o}`,t.skipEscape=!0,a}function p(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!n(r.uuid))&&(r.error=r.error||`UUID is not valid.`),r}function m(e){let t=e;return t.nss=(e.uuid||``).toLowerCase(),t}var h={scheme:`http`,domainHost:!0,parse:s,serialize:c},g={scheme:`https`,domainHost:h.domainHost,parse:s,serialize:c},_={scheme:`ws`,domainHost:!0,parse:l,serialize:u},v={http:h,https:g,ws:_,wss:{scheme:`wss`,domainHost:_.domainHost,parse:_.parse,serialize:_.serialize},urn:{scheme:`urn`,parse:d,serialize:f,skipNormalize:!0},"urn:uuid":{scheme:`urn:uuid`,parse:p,serialize:m,skipNormalize:!0}};Object.setPrototypeOf(v,null);function y(e){return e&&(v[e]||v[e.toLowerCase()])||void 0}t.exports={wsIsSecure:o,SCHEMES:v,isValidSchemeName:a,getSchemeHandler:y}})),NI=a(((e,t)=>{var{normalizeIPv6:n,removeDotSegments:r,recomposeAuthority:i,normalizePercentEncoding:a,normalizePathEncoding:o,escapePreservingEscapes:s,reescapeHostDelimiters:c,isIPv4:l,nonSimpleDomain:u}=jI(),{SCHEMES:d,getSchemeHandler:f}=MI();function p(e,t){return typeof e==`string`?e=S(e,t):typeof e==`object`&&(e=x(_(e,t),t)),e}function m(e,t,n){let r=n?Object.assign({scheme:`null`},n):{scheme:`null`},i=h(x(e,r),x(t,r),r,!0);return r.skipEscape=!0,_(i,r)}function h(e,t,n,i){let a={};return i||(e=x(_(e,n),n),t=x(_(t,n),n)),n||={},!n.tolerant&&t.scheme?(a.scheme=t.scheme,a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=r(t.path||``),a.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=r(t.path||``),a.query=t.query):(t.path?(t.path[0]===`/`?a.path=r(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?a.path=`/`+t.path:e.path?a.path=e.path.slice(0,e.path.lastIndexOf(`/`)+1)+t.path:a.path=t.path,a.path=r(a.path)),a.query=t.query):(a.path=e.path,t.query===void 0?a.query=e.query:a.query=t.query),a.userinfo=e.userinfo,a.host=e.host,a.port=e.port),a.scheme=e.scheme),a.fragment=t.fragment,a}function g(e,t,n){let r=w(e,n),i=w(t,n);return r!==void 0&&i!==void 0&&r.toLowerCase()===i.toLowerCase()}function _(e,t){let n={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:``},o=Object.assign({},t),c=[],l=f(o.scheme||n.scheme);l&&l.serialize&&l.serialize(n,o),n.path!==void 0&&(o.skipEscape?n.path=a(n.path):(n.path=s(n.path),n.scheme!==void 0&&(n.path=n.path.split(`%3A`).join(`:`)))),o.reference!==`suffix`&&n.scheme&&c.push(n.scheme,`:`);let u=i(n);if(u!==void 0&&(o.reference!==`suffix`&&c.push(`//`),c.push(u),n.path&&n.path[0]!==`/`&&c.push(`/`)),n.path!==void 0){let e=n.path;!o.absolutePath&&(!l||!l.absolutePath)&&(e=r(e)),u===void 0&&e[0]===`/`&&e[1]===`/`&&(e=`/%2F`+e.slice(2)),c.push(e)}return n.query!==void 0&&c.push(`?`,n.query),n.fragment!==void 0&&c.push(`#`,n.fragment),c.join(``)}var v=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function y(e,t){if(t[2]!==void 0&&e.path&&e.path[0]!==`/`)return`URI path must start with "/" when authority is present.`;if(typeof e.port==`number`&&(e.port<0||e.port>65535))return`URI port is malformed.`}function b(e,t){let r=Object.assign({},t),i={scheme:void 0,userinfo:void 0,host:``,port:void 0,path:``,query:void 0,fragment:void 0},a=!1,s=!1;r.reference===`suffix`&&(e=r.scheme?r.scheme+`:`+e:`//`+e);let d=e.match(v);if(d){i.scheme=d[1],i.userinfo=d[3],i.host=d[4],i.port=parseInt(d[5],10),i.path=d[6]||``,i.query=d[7],i.fragment=d[8],isNaN(i.port)&&(i.port=d[5]);let t=y(i,d);if(t!==void 0&&(i.error=i.error||t,a=!0),i.host)if(l(i.host)===!1){let e=n(i.host);i.host=e.host.toLowerCase(),s=e.isIPV6}else s=!0;i.scheme===void 0&&i.userinfo===void 0&&i.host===void 0&&i.port===void 0&&i.query===void 0&&!i.path?i.reference=`same-document`:i.scheme===void 0?i.reference=`relative`:i.fragment===void 0?i.reference=`absolute`:i.reference=`uri`,r.reference&&r.reference!==`suffix`&&r.reference!==i.reference&&(i.error=i.error||`URI is not a `+r.reference+` reference.`);let p=f(r.scheme||i.scheme);if(!r.unicodeSupport&&(!p||!p.unicodeSupport)&&i.host&&(r.domainHost||p&&p.domainHost)&&s===!1&&u(i.host))try{i.host=new URL(`http://`+i.host).hostname}catch(e){i.error=i.error||`Host's domain name can not be converted to ASCII: `+e}if((!p||p&&!p.skipNormalize)&&(e.indexOf(`%`)!==-1&&(i.scheme!==void 0&&(i.scheme=unescape(i.scheme)),i.host!==void 0&&(i.host=c(unescape(i.host),s))),i.path&&=o(i.path),i.fragment))try{i.fragment=encodeURI(decodeURIComponent(i.fragment))}catch{i.error=i.error||`URI malformed`}p&&p.parse&&p.parse(i,r)}else i.error=i.error||`URI can not be parsed.`;return{parsed:i,malformedAuthorityOrPort:a}}function x(e,t){return b(e,t).parsed}function S(e,t){return C(e,t).normalized}function C(e,t){let{parsed:n,malformedAuthorityOrPort:r}=b(e,t);return{normalized:r?e:_(n,t),malformedAuthorityOrPort:r}}function w(e,t){if(typeof e==`string`){let{normalized:n,malformedAuthorityOrPort:r}=C(e,t);return r?void 0:n}if(typeof e==`object`)return _(e,t)}var T={SCHEMES:d,normalize:p,resolve:m,resolveComponent:h,equal:g,serialize:_,parse:x};t.exports=T,t.exports.default=T,t.exports.fastUri=T})),PI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=NI();t.code=`require("ajv/dist/runtime/uri").default`,e.default=t})),FI=a((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var n=yI();Object.defineProperty(t,`KeywordCxt`,{enumerable:!0,get:function(){return n.KeywordCxt}});var r=X();Object.defineProperty(t,`_`,{enumerable:!0,get:function(){return r._}}),Object.defineProperty(t,`str`,{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(t,`stringify`,{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(t,`nil`,{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(t,`Name`,{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(t,`CodeGen`,{enumerable:!0,get:function(){return r.CodeGen}});var i=bI(),a=xI(),o=lI(),s=SI(),c=X(),l=vI(),u=dI(),d=aI(),f=(AI(),e(CI).default),p=PI(),m=(e,t)=>new RegExp(e,t);m.code=`new RegExp`;var h=[`removeAdditional`,`useDefaults`,`coerceTypes`],g=new Set([`validate`,`serialize`,`parse`,`wrapper`,`root`,`schema`,`keyword`,`pattern`,`formats`,`validate$data`,`func`,`obj`,`Error`]),_={errorDataPath:``,format:"`validateFormats: false` can be used instead.",nullable:`"nullable" keyword is supported by default.`,jsonPointers:`Deprecated jsPropertySyntax can be used instead.`,extendRefs:`Deprecated ignoreKeywordsWithRef can be used instead.`,missingRefs:`Pass empty schema with $id that should be ignored to ajv.addSchema.`,processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:`"uniqueItems" keyword is always validated.`,unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:`Map is used as cache, schema object as key.`,serialize:`Map is used as cache, schema object as key.`,ajvErrors:`It is default now.`},v={ignoreKeywordsWithRef:``,jsPropertySyntax:``,unicode:`"minLength"/"maxLength" account for unicode characters by default.`},y=200;function b(e){let t=e.strict,n=e.code?.optimize,r=n===!0||n===void 0?1:n||0,i=e.code?.regExp??m,a=e.uriResolver??p.default;return{strictSchema:e.strictSchema??t??!0,strictNumbers:e.strictNumbers??t??!0,strictTypes:e.strictTypes??t??`log`,strictTuples:e.strictTuples??t??`log`,strictRequired:e.strictRequired??t??!1,code:e.code?{...e.code,optimize:r,regExp:i}:{optimize:r,regExp:i},loopRequired:e.loopRequired??y,loopEnum:e.loopEnum??y,meta:e.meta??!0,messages:e.messages??!0,inlineRefs:e.inlineRefs??!0,schemaId:e.schemaId??`$id`,addUsedSchema:e.addUsedSchema??!0,validateSchema:e.validateSchema??!0,validateFormats:e.validateFormats??!0,unicodeRegExp:e.unicodeRegExp??!0,int32range:e.int32range??!0,uriResolver:a}}var x=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...b(e)};let{es5:t,lines:n}=this.opts.code;this.scope=new c.ValueScope({scope:{},prefixes:g,es5:t,lines:n}),this.logger=D(e.logger);let r=e.validateFormats;e.validateFormats=!1,this.RULES=(0,o.getRules)(),S.call(this,_,e,`NOT SUPPORTED`),S.call(this,v,e,`DEPRECATED`,`warn`),this._metaOpts=ee.call(this),e.formats&&T.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&E.call(this,e.keywords),typeof e.meta==`object`&&this.addMetaSchema(e.meta),w.call(this),e.validateFormats=r}_addVocabularies(){this.addKeyword(`$async`)}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:n}=this.opts,r=f;n===`id`&&(r={...f},r.id=r.$id,delete r.$id),t&&e&&this.addMetaSchema(r,r[n],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e==`object`?e[t]||e:void 0}validate(e,t){let n;if(typeof e==`string`){if(n=this.getSchema(e),!n)throw Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let r=n(t);return`$async`in n||(this.errors=n.errors),r}compile(e,t){let n=this._addSchema(e,t);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,t){if(typeof this.opts.loadSchema!=`function`)throw Error(`options.loadSchema should be a function`);let{loadSchema:n}=this.opts;return r.call(this,e,t);async function r(e,t){await i.call(this,e.$schema);let n=this._addSchema(e,t);return n.validate||o.call(this,n)}async function i(e){e&&!this.getSchema(e)&&await r.call(this,{$ref:e},!0)}async function o(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof a.default))throw t;return s.call(this,t),await c.call(this,t.missingSchema),o.call(this,e)}}function s({missingSchema:e,missingRef:t}){if(this.refs[e])throw Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function c(e){let n=await l.call(this,e);this.refs[e]||await i.call(this,n.$schema),this.refs[e]||this.addSchema(n,e,t)}async function l(e){let t=this._loading[e];if(t)return t;try{return await(this._loading[e]=n(e))}finally{delete this._loading[e]}}}addSchema(e,t,n,r=this.opts.validateSchema){if(Array.isArray(e)){for(let t of e)this.addSchema(t,void 0,n,r);return this}let i;if(typeof e==`object`){let{schemaId:t}=this.opts;if(i=e[t],i!==void 0&&typeof i!=`string`)throw Error(`schema ${t} must be string`)}return t=(0,l.normalizeId)(t||i),this._checkUnique(t),this.schemas[t]=this._addSchema(e,n,t,r,!0),this}addMetaSchema(e,t,n=this.opts.validateSchema){return this.addSchema(e,t,!0,n),this}validateSchema(e,t){if(typeof e==`boolean`)return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!=`string`)throw Error(`$schema must be a string`);if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn(`meta-schema not available`),this.errors=null,!0;let r=this.validate(n,e);if(!r&&t){let e=`schema is invalid: `+this.errorsText();if(this.opts.validateSchema===`log`)this.logger.error(e);else throw Error(e)}return r}getSchema(e){let t;for(;typeof(t=C.call(this,e))==`string`;)e=t;if(t===void 0){let{schemaId:n}=this.opts,r=new s.SchemaEnv({schema:{},schemaId:n});if(t=s.resolveSchema.call(this,r,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case`undefined`:return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case`string`:{let t=C.call(this,e);return typeof t==`object`&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case`object`:{let t=e;this._cache.delete(t);let n=e[this.opts.schemaId];return n&&(n=(0,l.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw Error(`ajv.removeSchema: invalid parameter`)}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let n;if(typeof e==`string`)n=e,typeof t==`object`&&(this.logger.warn(`these parameters are deprecated, see docs for addKeyword`),t.keyword=n);else if(typeof e==`object`&&t===void 0){if(t=e,n=t.keyword,Array.isArray(n)&&!n.length)throw Error(`addKeywords: keyword must be string or non-empty array`)}else throw Error(`invalid addKeywords parameters`);if(re.call(this,n,t),!t)return(0,d.eachItem)(n,e=>ie.call(this,e)),this;oe.call(this,t);let r={...t,type:(0,u.getJSONTypes)(t.type),schemaType:(0,u.getJSONTypes)(t.schemaType)};return(0,d.eachItem)(n,r.type.length===0?e=>ie.call(this,e,r):e=>r.type.forEach(t=>ie.call(this,e,r,t))),this}getKeyword(e){let t=this.RULES.all[e];return typeof t==`object`?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(let n of t.rules){let t=n.rules.findIndex(t=>t.keyword===e);t>=0&&n.rules.splice(t,1)}return this}addFormat(e,t){return typeof t==`string`&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=`, `,dataVar:n=`data`}={}){return!e||e.length===0?`No errors`:e.map(e=>`${n}${e.instancePath} ${e.message}`).reduce((e,n)=>e+t+n)}$dataMetaSchema(e,t){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let r of t){let t=r.split(`/`).slice(1),i=e;for(let e of t)i=i[e];for(let e in n){let t=n[e];if(typeof t!=`object`)continue;let{$data:r}=t.definition,a=i[e];r&&a&&(i[e]=ce(a))}}return e}_removeAllSchemas(e,t){for(let n in e){let r=e[n];(!t||t.test(n))&&(typeof r==`string`?delete e[n]:r&&!r.meta&&(this._cache.delete(r.schema),delete e[n]))}}_addSchema(e,t,n,r=this.opts.validateSchema,i=this.opts.addUsedSchema){let a,{schemaId:o}=this.opts;if(typeof e==`object`)a=e[o];else if(this.opts.jtd)throw Error(`schema must be object`);else if(typeof e!=`boolean`)throw Error(`schema must be object or boolean`);let c=this._cache.get(e);if(c!==void 0)return c;n=(0,l.normalizeId)(a||n);let u=l.getSchemaRefs.call(this,e,n);return c=new s.SchemaEnv({schema:e,schemaId:o,meta:t,baseId:n,localRefs:u}),this._cache.set(c.schema,c),i&&!n.startsWith(`#`)&&(n&&this._checkUnique(n),this.refs[n]=c),r&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):s.compileSchema.call(this,e),!e.validate)throw Error(`ajv implementation error`);return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{s.compileSchema.call(this,e)}finally{this.opts=t}}};x.ValidationError=i.default,x.MissingRefError=a.default,t.default=x;function S(e,t,n,r=`error`){for(let i in e){let a=i;a in t&&this.logger[r](`${n}: option ${i}. ${e[a]}`)}}function C(e){return e=(0,l.normalizeId)(e),this.schemas[e]||this.refs[e]}function w(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function T(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function E(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn(`keywords option as map is deprecated, pass array`);for(let t in e){let n=e[t];n.keyword||=t,this.addKeyword(n)}}function ee(){let e={...this.opts};for(let t of h)delete e[t];return e}var te={log(){},warn(){},error(){}};function D(e){if(e===!1)return te;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw Error(`logger must implement log, warn and error methods`)}var ne=/^[a-z_$][a-z0-9_$:-]*$/i;function re(e,t){let{RULES:n}=this;if((0,d.eachItem)(e,e=>{if(n.keywords[e])throw Error(`Keyword ${e} is already defined`);if(!ne.test(e))throw Error(`Keyword ${e} has invalid name`)}),t&&t.$data&&!(`code`in t||`validate`in t))throw Error(`$data keyword must have "code" or "validate" function`)}function ie(e,t,n){var r;let i=t?.post;if(n&&i)throw Error(`keyword with "post" flag cannot have "type"`);let{RULES:a}=this,o=i?a.post:a.rules.find(({type:e})=>e===n);if(o||(o={type:n,rules:[]},a.rules.push(o)),a.keywords[e]=!0,!t)return;let s={keyword:e,definition:{...t,type:(0,u.getJSONTypes)(t.type),schemaType:(0,u.getJSONTypes)(t.schemaType)}};t.before?ae.call(this,o,s,t.before):o.rules.push(s),a.all[e]=s,(r=t.implements)==null||r.forEach(e=>this.addKeyword(e))}function ae(e,t,n){let r=e.rules.findIndex(e=>e.keyword===n);r>=0?e.rules.splice(r,0,t):(e.rules.push(t),this.logger.warn(`rule ${n} is not defined`))}function oe(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=ce(t)),e.validateSchema=this.compile(t,!0))}var se={$ref:`https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#`};function ce(e){return{anyOf:[e,se]}}})),II=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={keyword:`id`,code(){throw Error(`NOT SUPPORTED: keyword "id", use "$id" for schema ID`)}}})),LI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.callRef=e.getValidate=void 0;var t=xI(),n=pI(),r=X(),i=oI(),a=SI(),o=aI(),s={keyword:`$ref`,schemaType:`string`,code(e){let{gen:n,schema:i,it:o}=e,{baseId:s,schemaEnv:u,validateName:d,opts:f,self:p}=o,{root:m}=u;if((i===`#`||i===`#/`)&&s===m.baseId)return g();let h=a.resolveRef.call(p,m,s,i);if(h===void 0)throw new t.default(o.opts.uriResolver,s,i);if(h instanceof a.SchemaEnv)return _(h);return v(h);function g(){if(u===m)return l(e,d,u,u.$async);let t=n.scopeValue(`root`,{ref:m});return l(e,(0,r._)`${t}.validate`,m,m.$async)}function _(t){l(e,c(e,t),t,t.$async)}function v(t){let a=n.scopeValue(`schema`,f.code.source===!0?{ref:t,code:(0,r.stringify)(t)}:{ref:t}),o=n.name(`valid`),s=e.subschema({schema:t,dataTypes:[],schemaPath:r.nil,topSchemaRef:a,errSchemaPath:i},o);e.mergeEvaluated(s),e.ok(o)}}};function c(e,t){let{gen:n}=e;return t.validate?n.scopeValue(`validate`,{ref:t.validate}):(0,r._)`${n.scopeValue(`wrapper`,{ref:t})}.validate`}e.getValidate=c;function l(e,t,a,s){let{gen:c,it:l}=e,{allErrors:u,schemaEnv:d,opts:f}=l,p=f.passContext?i.default.this:r.nil;s?m():h();function m(){if(!d.$async)throw Error(`async schema referenced by sync schema`);let i=c.let(`valid`);c.try(()=>{c.code((0,r._)`await ${(0,n.callValidateCode)(e,t,p)}`),_(t),u||c.assign(i,!0)},e=>{c.if((0,r._)`!(${e} instanceof ${l.ValidationError})`,()=>c.throw(e)),g(e),u||c.assign(i,!1)}),e.ok(i)}function h(){e.result((0,n.callValidateCode)(e,t,p),()=>_(t),()=>g(t))}function g(e){let t=(0,r._)`${e}.errors`;c.assign(i.default.vErrors,(0,r._)`${i.default.vErrors} === null ? ${t} : ${i.default.vErrors}.concat(${t})`),c.assign(i.default.errors,(0,r._)`${i.default.vErrors}.length`)}function _(e){if(!l.opts.unevaluated)return;let t=a?.validate?.evaluated;if(l.props!==!0)if(t&&!t.dynamicProps)t.props!==void 0&&(l.props=o.mergeEvaluated.props(c,t.props,l.props));else{let t=c.var(`props`,(0,r._)`${e}.evaluated.props`);l.props=o.mergeEvaluated.props(c,t,l.props,r.Name)}if(l.items!==!0)if(t&&!t.dynamicItems)t.items!==void 0&&(l.items=o.mergeEvaluated.items(c,t.items,l.items));else{let t=c.var(`items`,(0,r._)`${e}.evaluated.items`);l.items=o.mergeEvaluated.items(c,t,l.items,r.Name)}}}e.callRef=l,e.default=s})),RI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=II(),n=LI();e.default=[`$schema`,`$id`,`$defs`,`$vocabulary`,{keyword:`$comment`},`definitions`,t.default,n.default]})),zI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=t.operators,r={maximum:{okStr:`<=`,ok:n.LTE,fail:n.GT},minimum:{okStr:`>=`,ok:n.GTE,fail:n.LT},exclusiveMaximum:{okStr:`<`,ok:n.LT,fail:n.GTE},exclusiveMinimum:{okStr:`>`,ok:n.GT,fail:n.LTE}};e.default={keyword:Object.keys(r),type:`number`,schemaType:`number`,$data:!0,error:{message:({keyword:e,schemaCode:n})=>(0,t.str)`must be ${r[e].okStr} ${n}`,params:({keyword:e,schemaCode:n})=>(0,t._)`{comparison: ${r[e].okStr}, limit: ${n}}`},code(e){let{keyword:n,data:i,schemaCode:a}=e;e.fail$data((0,t._)`${i} ${r[n].fail} ${a} || isNaN(${i})`)}}})),BI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X();e.default={keyword:`multipleOf`,type:`number`,schemaType:`number`,$data:!0,error:{message:({schemaCode:e})=>(0,t.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,t._)`{multipleOf: ${e}}`},code(e){let{gen:n,data:r,schemaCode:i,it:a}=e,o=a.opts.multipleOfPrecision,s=n.let(`res`),c=o?(0,t._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${o}`:(0,t._)`${s} !== parseInt(${s})`;e.fail$data((0,t._)`(${i} === 0 || (${s} = ${r}/${i}, ${c}))`)}}})),VI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});function t(e){let t=e.length,n=0,r=0,i;for(;r<t;)n++,i=e.charCodeAt(r++),i>=55296&&i<=56319&&r<t&&(i=e.charCodeAt(r),(i&64512)==56320&&r++);return n}e.default=t,t.code=`require("ajv/dist/runtime/ucs2length").default`})),HI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=aI(),r=VI();e.default={keyword:[`maxLength`,`minLength`],type:`string`,schemaType:`number`,$data:!0,error:{message({keyword:e,schemaCode:n}){let r=e===`maxLength`?`more`:`fewer`;return(0,t.str)`must NOT have ${r} than ${n} characters`},params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:i,data:a,schemaCode:o,it:s}=e,c=i===`maxLength`?t.operators.GT:t.operators.LT,l=s.opts.unicode===!1?(0,t._)`${a}.length`:(0,t._)`${(0,n.useFunc)(e.gen,r.default)}(${a})`;e.fail$data((0,t._)`${l} ${c} ${o}`)}}})),UI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=pI(),n=aI(),r=X();e.default={keyword:`pattern`,type:`string`,schemaType:`string`,$data:!0,error:{message:({schemaCode:e})=>(0,r.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,r._)`{pattern: ${e}}`},code(e){let{gen:i,data:a,$data:o,schema:s,schemaCode:c,it:l}=e,u=l.opts.unicodeRegExp?`u`:``;if(o){let{regExp:t}=l.opts.code,o=t.code===`new RegExp`?(0,r._)`new RegExp`:(0,n.useFunc)(i,t),s=i.let(`valid`);i.try(()=>i.assign(s,(0,r._)`${o}(${c}, ${u}).test(${a})`),()=>i.assign(s,!1)),e.fail$data((0,r._)`!${s}`)}else{let n=(0,t.usePattern)(e,s);e.fail$data((0,r._)`!${n}.test(${a})`)}}}})),WI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X();e.default={keyword:[`maxProperties`,`minProperties`],type:`object`,schemaType:`number`,$data:!0,error:{message({keyword:e,schemaCode:n}){let r=e===`maxProperties`?`more`:`fewer`;return(0,t.str)`must NOT have ${r} than ${n} properties`},params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:n,data:r,schemaCode:i}=e,a=n===`maxProperties`?t.operators.GT:t.operators.LT;e.fail$data((0,t._)`Object.keys(${r}).length ${a} ${i}`)}}})),GI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=pI(),n=X(),r=aI();e.default={keyword:`required`,type:`object`,schemaType:`array`,$data:!0,error:{message:({params:{missingProperty:e}})=>(0,n.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,n._)`{missingProperty: ${e}}`},code(e){let{gen:i,schema:a,schemaCode:o,data:s,$data:c,it:l}=e,{opts:u}=l;if(!c&&a.length===0)return;let d=a.length>=u.loopRequired;if(l.allErrors?f():p(),u.strictRequired){let t=e.parentSchema.properties,{definedProperties:n}=e.it;for(let e of a)if(t?.[e]===void 0&&!n.has(e)){let t=`required property "${e}" is not defined at "${l.schemaEnv.baseId+l.errSchemaPath}" (strictRequired)`;(0,r.checkStrictMode)(l,t,l.opts.strictRequired)}}function f(){if(d||c)e.block$data(n.nil,m);else for(let n of a)(0,t.checkReportMissingProp)(e,n)}function p(){let n=i.let(`missing`);if(d||c){let t=i.let(`valid`,!0);e.block$data(t,()=>h(n,t)),e.ok(t)}else i.if((0,t.checkMissingProp)(e,a,n)),(0,t.reportMissingProp)(e,n),i.else()}function m(){i.forOf(`prop`,o,n=>{e.setParams({missingProperty:n}),i.if((0,t.noPropertyInData)(i,s,n,u.ownProperties),()=>e.error())})}function h(r,a){e.setParams({missingProperty:r}),i.forOf(r,o,()=>{i.assign(a,(0,t.propertyInData)(i,s,r,u.ownProperties)),i.if((0,n.not)(a),()=>{e.error(),i.break()})},n.nil)}}}})),KI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X();e.default={keyword:[`maxItems`,`minItems`],type:`array`,schemaType:`number`,$data:!0,error:{message({keyword:e,schemaCode:n}){let r=e===`maxItems`?`more`:`fewer`;return(0,t.str)`must NOT have ${r} than ${n} items`},params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:n,data:r,schemaCode:i}=e,a=n===`maxItems`?t.operators.GT:t.operators.LT;e.fail$data((0,t._)`${r}.length ${a} ${i}`)}}})),qI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=gI();t.code=`require("ajv/dist/runtime/equal").default`,e.default=t})),JI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=dI(),n=X(),r=aI(),i=qI();e.default={keyword:`uniqueItems`,type:`array`,schemaType:`boolean`,$data:!0,error:{message:({params:{i:e,j:t}})=>(0,n.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,n._)`{i: ${e}, j: ${t}}`},code(e){let{gen:a,data:o,$data:s,schema:c,parentSchema:l,schemaCode:u,it:d}=e;if(!s&&!c)return;let f=a.let(`valid`),p=l.items?(0,t.getSchemaTypes)(l.items):[];e.block$data(f,m,(0,n._)`${u} === false`),e.ok(f);function m(){let t=a.let(`i`,(0,n._)`${o}.length`),r=a.let(`j`);e.setParams({i:t,j:r}),a.assign(f,!0),a.if((0,n._)`${t} > 1`,()=>(h()?g:_)(t,r))}function h(){return p.length>0&&!p.some(e=>e===`object`||e===`array`)}function g(r,i){let s=a.name(`item`),c=(0,t.checkDataTypes)(p,s,d.opts.strictNumbers,t.DataType.Wrong),l=a.const(`indices`,(0,n._)`{}`);a.for((0,n._)`;${r}--;`,()=>{a.let(s,(0,n._)`${o}[${r}]`),a.if(c,(0,n._)`continue`),p.length>1&&a.if((0,n._)`typeof ${s} == "string"`,(0,n._)`${s} += "_"`),a.if((0,n._)`typeof ${l}[${s}] == "number"`,()=>{a.assign(i,(0,n._)`${l}[${s}]`),e.error(),a.assign(f,!1).break()}).code((0,n._)`${l}[${s}] = ${r}`)})}function _(t,s){let c=(0,r.useFunc)(a,i.default),l=a.name(`outer`);a.label(l).for((0,n._)`;${t}--;`,()=>a.for((0,n._)`${s} = ${t}; ${s}--;`,()=>a.if((0,n._)`${c}(${o}[${t}], ${o}[${s}])`,()=>{e.error(),a.assign(f,!1).break(l)})))}}}})),YI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=aI(),r=qI();e.default={keyword:`const`,$data:!0,error:{message:`must be equal to constant`,params:({schemaCode:e})=>(0,t._)`{allowedValue: ${e}}`},code(e){let{gen:i,data:a,$data:o,schemaCode:s,schema:c}=e;o||c&&typeof c==`object`?e.fail$data((0,t._)`!${(0,n.useFunc)(i,r.default)}(${a}, ${s})`):e.fail((0,t._)`${c} !== ${a}`)}}})),XI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=aI(),r=qI();e.default={keyword:`enum`,schemaType:`array`,$data:!0,error:{message:`must be equal to one of the allowed values`,params:({schemaCode:e})=>(0,t._)`{allowedValues: ${e}}`},code(e){let{gen:i,data:a,$data:o,schema:s,schemaCode:c,it:l}=e;if(!o&&s.length===0)throw Error(`enum must have non-empty array`);let u=s.length>=l.opts.loopEnum,d,f=()=>d??=(0,n.useFunc)(i,r.default),p;if(u||o)p=i.let(`valid`),e.block$data(p,m);else{if(!Array.isArray(s))throw Error(`ajv implementation error`);let e=i.const(`vSchema`,c);p=(0,t.or)(...s.map((t,n)=>h(e,n)))}e.pass(p);function m(){i.assign(p,!1),i.forOf(`v`,c,e=>i.if((0,t._)`${f()}(${a}, ${e})`,()=>i.assign(p,!0).break()))}function h(e,n){let r=s[n];return typeof r==`object`&&r?(0,t._)`${f()}(${a}, ${e}[${n}])`:(0,t._)`${a} === ${r}`}}}})),ZI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=zI(),n=BI(),r=HI(),i=UI(),a=WI(),o=GI(),s=KI(),c=JI(),l=YI(),u=XI();e.default=[t.default,n.default,r.default,i.default,a.default,o.default,s.default,c.default,{keyword:`type`,schemaType:[`string`,`array`]},{keyword:`nullable`,schemaType:`boolean`},l.default,u.default]})),QI=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.validateAdditionalItems=void 0;var t=X(),n=aI(),r={keyword:`additionalItems`,type:`array`,schemaType:[`boolean`,`object`],before:`uniqueItems`,error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{parentSchema:t,it:r}=e,{items:a}=t;if(!Array.isArray(a)){(0,n.checkStrictMode)(r,`"additionalItems" is ignored when "items" is not an array of schemas`);return}i(e,a)}};function i(e,r){let{gen:i,schema:a,data:o,keyword:s,it:c}=e;c.items=!0;let l=i.const(`len`,(0,t._)`${o}.length`);if(a===!1)e.setParams({len:r.length}),e.pass((0,t._)`${l} <= ${r.length}`);else if(typeof a==`object`&&!(0,n.alwaysValidSchema)(c,a)){let n=i.var(`valid`,(0,t._)`${l} <= ${r.length}`);i.if((0,t.not)(n),()=>u(n)),e.ok(n)}function u(a){i.forRange(`i`,r.length,l,r=>{e.subschema({keyword:s,dataProp:r,dataPropType:n.Type.Num},a),c.allErrors||i.if((0,t.not)(a),()=>i.break())})}}e.validateAdditionalItems=i,e.default=r})),$I=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.validateTuple=void 0;var t=X(),n=aI(),r=pI(),i={keyword:`items`,type:`array`,schemaType:[`object`,`array`,`boolean`],before:`uniqueItems`,code(e){let{schema:t,it:i}=e;if(Array.isArray(t))return a(e,`additionalItems`,t);i.items=!0,!(0,n.alwaysValidSchema)(i,t)&&e.ok((0,r.validateArray)(e))}};function a(e,r,i=e.schema){let{gen:a,parentSchema:o,data:s,keyword:c,it:l}=e;f(o),l.opts.unevaluated&&i.length&&l.items!==!0&&(l.items=n.mergeEvaluated.items(a,i.length,l.items));let u=a.name(`valid`),d=a.const(`len`,(0,t._)`${s}.length`);i.forEach((r,i)=>{(0,n.alwaysValidSchema)(l,r)||(a.if((0,t._)`${d} > ${i}`,()=>e.subschema({keyword:c,schemaProp:i,dataProp:i},u)),e.ok(u))});function f(e){let{opts:t,errSchemaPath:a}=l,o=i.length,s=o===e.minItems&&(o===e.maxItems||e[r]===!1);if(t.strictTuples&&!s){let e=`"${c}" is ${o}-tuple, but minItems or maxItems/${r} are not specified or different at path "${a}"`;(0,n.checkStrictMode)(l,e,t.strictTuples)}}}e.validateTuple=a,e.default=i})),eL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=$I();e.default={keyword:`prefixItems`,type:`array`,schemaType:[`array`],before:`uniqueItems`,code:e=>(0,t.validateTuple)(e,`items`)}})),tL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=aI(),r=pI(),i=QI();e.default={keyword:`items`,type:`array`,schemaType:[`object`,`boolean`],before:`uniqueItems`,error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{schema:t,parentSchema:a,it:o}=e,{prefixItems:s}=a;o.items=!0,!(0,n.alwaysValidSchema)(o,t)&&(s?(0,i.validateAdditionalItems)(e,s):e.ok((0,r.validateArray)(e)))}}})),nL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=aI();e.default={keyword:`contains`,type:`array`,schemaType:[`object`,`boolean`],before:`uniqueItems`,trackErrors:!0,error:{message:({params:{min:e,max:n}})=>n===void 0?(0,t.str)`must contain at least ${e} valid item(s)`:(0,t.str)`must contain at least ${e} and no more than ${n} valid item(s)`,params:({params:{min:e,max:n}})=>n===void 0?(0,t._)`{minContains: ${e}}`:(0,t._)`{minContains: ${e}, maxContains: ${n}}`},code(e){let{gen:r,schema:i,parentSchema:a,data:o,it:s}=e,c,l,{minContains:u,maxContains:d}=a;s.opts.next?(c=u===void 0?1:u,l=d):c=1;let f=r.const(`len`,(0,t._)`${o}.length`);if(e.setParams({min:c,max:l}),l===void 0&&c===0){(0,n.checkStrictMode)(s,`"minContains" == 0 without "maxContains": "contains" keyword ignored`);return}if(l!==void 0&&c>l){(0,n.checkStrictMode)(s,`"minContains" > "maxContains" is always invalid`),e.fail();return}if((0,n.alwaysValidSchema)(s,i)){let n=(0,t._)`${f} >= ${c}`;l!==void 0&&(n=(0,t._)`${n} && ${f} <= ${l}`),e.pass(n);return}s.items=!0;let p=r.name(`valid`);l===void 0&&c===1?h(p,()=>r.if(p,()=>r.break())):c===0?(r.let(p,!0),l!==void 0&&r.if((0,t._)`${o}.length > 0`,m)):(r.let(p,!1),m()),e.result(p,()=>e.reset());function m(){let e=r.name(`_valid`),t=r.let(`count`,0);h(e,()=>r.if(e,()=>g(t)))}function h(t,i){r.forRange(`i`,0,f,r=>{e.subschema({keyword:`contains`,dataProp:r,dataPropType:n.Type.Num,compositeRule:!0},t),i()})}function g(e){r.code((0,t._)`${e}++`),l===void 0?r.if((0,t._)`${e} >= ${c}`,()=>r.assign(p,!0).break()):(r.if((0,t._)`${e} > ${l}`,()=>r.assign(p,!1).break()),c===1?r.assign(p,!0):r.if((0,t._)`${e} >= ${c}`,()=>r.assign(p,!0)))}}}})),rL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;var t=X(),n=aI(),r=pI();e.error={message:({params:{property:e,depsCount:n,deps:r}})=>{let i=n===1?`property`:`properties`;return(0,t.str)`must have ${i} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:n,deps:r,missingProperty:i}})=>(0,t._)`{property: ${e},
366
366
  missingProperty: ${i},
367
367
  depsCount: ${n},
368
- deps: ${r}}`};var i={keyword:`dependencies`,type:`object`,schemaType:`object`,error:e.error,code(e){let[t,n]=a(e);o(e,t),s(e,n)}};function a({schema:e}){let t={},n={};for(let r in e){if(r===`__proto__`)continue;let i=Array.isArray(e[r])?t:n;i[r]=e[r]}return[t,n]}function o(e,n=e.schema){let{gen:i,data:a,it:o}=e;if(Object.keys(n).length===0)return;let s=i.let(`missing`);for(let c in n){let l=n[c];if(l.length===0)continue;let u=(0,r.propertyInData)(i,a,c,o.opts.ownProperties);e.setParams({property:c,depsCount:l.length,deps:l.join(`, `)}),o.allErrors?i.if(u,()=>{for(let t of l)(0,r.checkReportMissingProp)(e,t)}):(i.if((0,t._)`${u} && (${(0,r.checkMissingProp)(e,l,s)})`),(0,r.reportMissingProp)(e,s),i.else())}}e.validatePropertyDeps=o;function s(e,t=e.schema){let{gen:i,data:a,keyword:o,it:s}=e,c=i.name(`valid`);for(let l in t)(0,n.alwaysValidSchema)(s,t[l])||(i.if((0,r.propertyInData)(i,a,l,s.opts.ownProperties),()=>{let t=e.subschema({keyword:o,schemaProp:l},c);e.mergeValidEvaluated(t,c)},()=>i.var(c,!0)),e.ok(c))}e.validateSchemaDeps=s,e.default=i})),aL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=oI();e.default={keyword:`propertyNames`,type:`object`,schemaType:[`object`,`boolean`],error:{message:`property name must be valid`,params:({params:e})=>(0,t._)`{propertyName: ${e.propertyName}}`},code(e){let{gen:r,schema:i,data:a,it:o}=e;if((0,n.alwaysValidSchema)(o,i))return;let s=r.name(`valid`);r.forIn(`key`,a,n=>{e.setParams({propertyName:n}),e.subschema({keyword:`propertyNames`,data:n,dataTypes:[`string`],propertyName:n,compositeRule:!0},s),r.if((0,t.not)(s),()=>{e.error(!0),o.allErrors||r.break()})}),e.ok(s)}}})),oL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=mI(),n=X(),r=sI(),i=oI();e.default={keyword:`additionalProperties`,type:[`object`],schemaType:[`boolean`,`object`],allowUndefined:!0,trackErrors:!0,error:{message:`must NOT have additional properties`,params:({params:e})=>(0,n._)`{additionalProperty: ${e.additionalProperty}}`},code(e){let{gen:a,schema:o,parentSchema:s,data:c,errsCount:l,it:u}=e;if(!l)throw Error(`ajv implementation error`);let{allErrors:d,opts:f}=u;if(u.props=!0,f.removeAdditional!==`all`&&(0,i.alwaysValidSchema)(u,o))return;let p=(0,t.allSchemaProperties)(s.properties),m=(0,t.allSchemaProperties)(s.patternProperties);h(),e.ok((0,n._)`${l} === ${r.default.errors}`);function h(){a.forIn(`key`,c,e=>{!p.length&&!m.length?v(e):a.if(g(e),()=>v(e))})}function g(r){let o;if(p.length>8){let e=(0,i.schemaRefOrVal)(u,s.properties,`properties`);o=(0,t.isOwnProperty)(a,e,r)}else o=p.length?(0,n.or)(...p.map(e=>(0,n._)`${r} === ${e}`)):n.nil;return m.length&&(o=(0,n.or)(o,...m.map(i=>(0,n._)`${(0,t.usePattern)(e,i)}.test(${r})`))),(0,n.not)(o)}function _(e){a.code((0,n._)`delete ${c}[${e}]`)}function v(t){if(f.removeAdditional===`all`||f.removeAdditional&&o===!1){_(t);return}if(o===!1){e.setParams({additionalProperty:t}),e.error(),d||a.break();return}if(typeof o==`object`&&!(0,i.alwaysValidSchema)(u,o)){let r=a.name(`valid`);f.removeAdditional===`failing`?(y(t,r,!1),a.if((0,n.not)(r),()=>{e.reset(),_(t)})):(y(t,r),d||a.if((0,n.not)(r),()=>a.break()))}}function y(t,n,r){let a={keyword:`additionalProperties`,dataProp:t,dataPropType:i.Type.Str};r===!1&&Object.assign(a,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(a,n)}}}})),sL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=bI(),n=mI(),r=oI(),i=oL();e.default={keyword:`properties`,type:`object`,schemaType:`object`,code(e){let{gen:a,schema:o,parentSchema:s,data:c,it:l}=e;l.opts.removeAdditional===`all`&&s.additionalProperties===void 0&&i.default.code(new t.KeywordCxt(l,i.default,`additionalProperties`));let u=(0,n.allSchemaProperties)(o);for(let e of u)l.definedProperties.add(e);l.opts.unevaluated&&u.length&&l.props!==!0&&(l.props=r.mergeEvaluated.props(a,(0,r.toHash)(u),l.props));let d=u.filter(e=>!(0,r.alwaysValidSchema)(l,o[e]));if(d.length===0)return;let f=a.name(`valid`);for(let t of d)p(t)?m(t):(a.if((0,n.propertyInData)(a,c,t,l.opts.ownProperties)),m(t),l.allErrors||a.else().var(f,!0),a.endIf()),e.it.definedProperties.add(t),e.ok(f);function p(e){return l.opts.useDefaults&&!l.compositeRule&&o[e].default!==void 0}function m(t){e.subschema({keyword:`properties`,schemaProp:t,dataProp:t},f)}}}})),cL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=mI(),n=X(),r=oI(),i=oI();e.default={keyword:`patternProperties`,type:`object`,schemaType:`object`,code(e){let{gen:a,schema:o,data:s,parentSchema:c,it:l}=e,{opts:u}=l,d=(0,t.allSchemaProperties)(o),f=d.filter(e=>(0,r.alwaysValidSchema)(l,o[e]));if(d.length===0||f.length===d.length&&(!l.opts.unevaluated||l.props===!0))return;let p=u.strictSchema&&!u.allowMatchingProperties&&c.properties,m=a.name(`valid`);l.props!==!0&&!(l.props instanceof n.Name)&&(l.props=(0,i.evaluatedPropsToName)(a,l.props));let{props:h}=l;g();function g(){for(let e of d)p&&_(e),l.allErrors?v(e):(a.var(m,!0),v(e),a.if(m))}function _(e){for(let t in p)new RegExp(e).test(t)&&(0,r.checkStrictMode)(l,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function v(r){a.forIn(`key`,s,o=>{a.if((0,n._)`${(0,t.usePattern)(e,r)}.test(${o})`,()=>{let t=f.includes(r);t||e.subschema({keyword:`patternProperties`,schemaProp:r,dataProp:o,dataPropType:i.Type.Str},m),l.opts.unevaluated&&h!==!0?a.assign((0,n._)`${h}[${o}]`,!0):!t&&!l.allErrors&&a.if((0,n.not)(m),()=>a.break())})})}}}})),lL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=oI();e.default={keyword:`not`,schemaType:[`object`,`boolean`],trackErrors:!0,code(e){let{gen:n,schema:r,it:i}=e;if((0,t.alwaysValidSchema)(i,r)){e.fail();return}let a=n.name(`valid`);e.subschema({keyword:`not`,compositeRule:!0,createErrors:!1,allErrors:!1},a),e.failResult(a,()=>e.reset(),()=>e.error())},error:{message:`must NOT be valid`}}})),uL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={keyword:`anyOf`,schemaType:`array`,trackErrors:!0,code:mI().validateUnion,error:{message:`must match a schema in anyOf`}}})),dL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=oI();e.default={keyword:`oneOf`,schemaType:`array`,trackErrors:!0,error:{message:`must match exactly one schema in oneOf`,params:({params:e})=>(0,t._)`{passingSchemas: ${e.passing}}`},code(e){let{gen:r,schema:i,parentSchema:a,it:o}=e;if(!Array.isArray(i))throw Error(`ajv implementation error`);if(o.opts.discriminator&&a.discriminator)return;let s=i,c=r.let(`valid`,!1),l=r.let(`passing`,null),u=r.name(`_valid`);e.setParams({passing:l}),r.block(d),e.result(c,()=>e.reset(),()=>e.error(!0));function d(){s.forEach((i,a)=>{let s;(0,n.alwaysValidSchema)(o,i)?r.var(u,!0):s=e.subschema({keyword:`oneOf`,schemaProp:a,compositeRule:!0},u),a>0&&r.if((0,t._)`${u} && ${c}`).assign(c,!1).assign(l,(0,t._)`[${l}, ${a}]`).else(),r.if(u,()=>{r.assign(c,!0),r.assign(l,a),s&&e.mergeEvaluated(s,t.Name)})})}}}})),fL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=oI();e.default={keyword:`allOf`,schemaType:`array`,code(e){let{gen:n,schema:r,it:i}=e;if(!Array.isArray(r))throw Error(`ajv implementation error`);let a=n.name(`valid`);r.forEach((n,r)=>{if((0,t.alwaysValidSchema)(i,n))return;let o=e.subschema({keyword:`allOf`,schemaProp:r},a);e.ok(a),e.mergeEvaluated(o)})}}})),pL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=oI(),r={keyword:`if`,schemaType:[`object`,`boolean`],trackErrors:!0,error:{message:({params:e})=>(0,t.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,t._)`{failingKeyword: ${e.ifClause}}`},code(e){let{gen:r,parentSchema:a,it:o}=e;a.then===void 0&&a.else===void 0&&(0,n.checkStrictMode)(o,`"if" without "then" and "else" is ignored`);let s=i(o,`then`),c=i(o,`else`);if(!s&&!c)return;let l=r.let(`valid`,!0),u=r.name(`_valid`);if(d(),e.reset(),s&&c){let t=r.let(`ifClause`);e.setParams({ifClause:t}),r.if(u,f(`then`,t),f(`else`,t))}else s?r.if(u,f(`then`)):r.if((0,t.not)(u),f(`else`));e.pass(l,()=>e.error(!0));function d(){let t=e.subschema({keyword:`if`,compositeRule:!0,createErrors:!1,allErrors:!1},u);e.mergeEvaluated(t)}function f(n,i){return()=>{let a=e.subschema({keyword:n},u);r.assign(l,u),e.mergeValidEvaluated(a,l),i?r.assign(i,(0,t._)`${n}`):e.setParams({ifClause:n})}}}};function i(e,t){let r=e.schema[t];return r!==void 0&&!(0,n.alwaysValidSchema)(e,r)}e.default=r})),mL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=oI();e.default={keyword:[`then`,`else`],schemaType:[`object`,`boolean`],code({keyword:e,parentSchema:n,it:r}){n.if===void 0&&(0,t.checkStrictMode)(r,`"${e}" without "if" is ignored`)}}})),hL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=$I(),n=tL(),r=eL(),i=nL(),a=rL(),o=iL(),s=aL(),c=oL(),l=sL(),u=cL(),d=lL(),f=uL(),p=dL(),m=fL(),h=pL(),g=mL();function _(e=!1){let _=[d.default,f.default,p.default,m.default,h.default,g.default,s.default,c.default,o.default,l.default,u.default];return e?_.push(n.default,i.default):_.push(t.default,r.default),_.push(a.default),_}e.default=_})),gL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X();e.default={keyword:`format`,type:[`number`,`string`],schemaType:`string`,$data:!0,error:{message:({schemaCode:e})=>(0,t.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,t._)`{format: ${e}}`},code(e,n){let{gen:r,data:i,$data:a,schema:o,schemaCode:s,it:c}=e,{opts:l,errSchemaPath:u,schemaEnv:d,self:f}=c;if(!l.validateFormats)return;a?p():m();function p(){let a=r.scopeValue(`formats`,{ref:f.formats,code:l.code.formats}),o=r.const(`fDef`,(0,t._)`${a}[${s}]`),c=r.let(`fType`),u=r.let(`format`);r.if((0,t._)`typeof ${o} == "object" && !(${o} instanceof RegExp)`,()=>r.assign(c,(0,t._)`${o}.type || "string"`).assign(u,(0,t._)`${o}.validate`),()=>r.assign(c,(0,t._)`"string"`).assign(u,o)),e.fail$data((0,t.or)(p(),m()));function p(){return l.strictSchema===!1?t.nil:(0,t._)`${s} && !${u}`}function m(){let e=d.$async?(0,t._)`(${o}.async ? await ${u}(${i}) : ${u}(${i}))`:(0,t._)`${u}(${i})`,r=(0,t._)`(typeof ${u} == "function" ? ${e} : ${u}.test(${i}))`;return(0,t._)`${u} && ${u} !== true && ${c} === ${n} && !${r}`}}function m(){let a=f.formats[o];if(!a){m();return}if(a===!0)return;let[s,c,p]=h(a);s===n&&e.pass(g());function m(){if(l.strictSchema===!1){f.logger.warn(e());return}throw Error(e());function e(){return`unknown format "${o}" ignored in schema at path "${u}"`}}function h(e){let n=e instanceof RegExp?(0,t.regexpCode)(e):l.code.formats?(0,t._)`${l.code.formats}${(0,t.getProperty)(o)}`:void 0,i=r.scopeValue(`formats`,{key:o,ref:e,code:n});return typeof e==`object`&&!(e instanceof RegExp)?[e.type||`string`,e.validate,(0,t._)`${i}.validate`]:[`string`,e,i]}function g(){if(typeof a==`object`&&!(a instanceof RegExp)&&a.async){if(!d.$async)throw Error(`async format in sync schema`);return(0,t._)`await ${p}(${i})`}return typeof c==`function`?(0,t._)`${p}(${i})`:(0,t._)`${p}.test(${i})`}}}}})),_L=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=[gL().default]})),vL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.contentVocabulary=e.metadataVocabulary=void 0,e.metadataVocabulary=[`title`,`description`,`default`,`deprecated`,`readOnly`,`writeOnly`,`examples`],e.contentVocabulary=[`contentMediaType`,`contentEncoding`,`contentSchema`]})),yL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=zI(),n=QI(),r=hL(),i=_L(),a=vL();e.default=[t.default,n.default,(0,r.default)(),i.default,a.metadataVocabulary,a.contentVocabulary]})),bL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DiscrError=void 0;var t;(function(e){e.Tag=`tag`,e.Mapping=`mapping`})(t||(e.DiscrError=t={}))})),xL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=bL(),r=CI(),i=SI(),a=oI();e.default={keyword:`discriminator`,type:`object`,schemaType:`object`,error:{message:({params:{discrError:e,tagName:t}})=>e===n.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:n,tagName:r}})=>(0,t._)`{error: ${e}, tag: ${r}, tagValue: ${n}}`},code(e){let{gen:o,data:s,schema:c,parentSchema:l,it:u}=e,{oneOf:d}=l;if(!u.opts.discriminator)throw Error(`discriminator: requires discriminator option`);let f=c.propertyName;if(typeof f!=`string`)throw Error(`discriminator: requires propertyName`);if(c.mapping)throw Error(`discriminator: mapping is not supported`);if(!d)throw Error(`discriminator: requires oneOf keyword`);let p=o.let(`valid`,!1),m=o.const(`tag`,(0,t._)`${s}${(0,t.getProperty)(f)}`);o.if((0,t._)`typeof ${m} == "string"`,()=>h(),()=>e.error(!1,{discrError:n.DiscrError.Tag,tag:m,tagName:f})),e.ok(p);function h(){let r=_();o.if(!1);for(let e in r)o.elseIf((0,t._)`${m} === ${e}`),o.assign(p,g(r[e]));o.else(),e.error(!1,{discrError:n.DiscrError.Mapping,tag:m,tagName:f}),o.endIf()}function g(n){let r=o.name(`valid`),i=e.subschema({keyword:`oneOf`,schemaProp:n},r);return e.mergeEvaluated(i,t.Name),r}function _(){let e={},t=o(l),n=!0;for(let e=0;e<d.length;e++){let c=d[e];if(c?.$ref&&!(0,a.schemaHasRulesButRef)(c,u.self.RULES)){let e=c.$ref;if(c=r.resolveRef.call(u.self,u.schemaEnv.root,u.baseId,e),c instanceof r.SchemaEnv&&(c=c.schema),c===void 0)throw new i.default(u.opts.uriResolver,u.baseId,e)}let l=c?.properties?.[f];if(typeof l!=`object`)throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${f}"`);n&&=t||o(c),s(l,e)}if(!n)throw Error(`discriminator: "${f}" must be required`);return e;function o({required:e}){return Array.isArray(e)&&e.includes(f)}function s(e,t){if(e.const)c(e.const,t);else if(e.enum)for(let n of e.enum)c(n,t);else throw Error(`discriminator: "properties/${f}" must have "const" or "enum"`)}function c(t,n){if(typeof t!=`string`||t in e)throw Error(`discriminator: "${f}" values must be unique strings`);e[t]=n}}}}})),SL=i({$id:()=>wL,$schema:()=>CL,default:()=>kL,definitions:()=>EL,properties:()=>OL,title:()=>TL,type:()=>DL}),CL,wL,TL,EL,DL,OL,kL,AL=n((()=>{CL=`http://json-schema.org/draft-07/schema#`,wL=`http://json-schema.org/draft-07/schema#`,TL=`Core schema meta-schema`,EL={schemaArray:{type:`array`,minItems:1,items:{$ref:`#`}},nonNegativeInteger:{type:`integer`,minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:`#/definitions/nonNegativeInteger`},{default:0}]},simpleTypes:{enum:[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]},stringArray:{type:`array`,items:{type:`string`},uniqueItems:!0,default:[]}},DL=[`object`,`boolean`],OL={$id:{type:`string`,format:`uri-reference`},$schema:{type:`string`,format:`uri`},$ref:{type:`string`,format:`uri-reference`},$comment:{type:`string`},title:{type:`string`},description:{type:`string`},default:!0,readOnly:{type:`boolean`,default:!1},examples:{type:`array`,items:!0},multipleOf:{type:`number`,exclusiveMinimum:0},maximum:{type:`number`},exclusiveMaximum:{type:`number`},minimum:{type:`number`},exclusiveMinimum:{type:`number`},maxLength:{$ref:`#/definitions/nonNegativeInteger`},minLength:{$ref:`#/definitions/nonNegativeIntegerDefault0`},pattern:{type:`string`,format:`regex`},additionalItems:{$ref:`#`},items:{anyOf:[{$ref:`#`},{$ref:`#/definitions/schemaArray`}],default:!0},maxItems:{$ref:`#/definitions/nonNegativeInteger`},minItems:{$ref:`#/definitions/nonNegativeIntegerDefault0`},uniqueItems:{type:`boolean`,default:!1},contains:{$ref:`#`},maxProperties:{$ref:`#/definitions/nonNegativeInteger`},minProperties:{$ref:`#/definitions/nonNegativeIntegerDefault0`},required:{$ref:`#/definitions/stringArray`},additionalProperties:{$ref:`#`},definitions:{type:`object`,additionalProperties:{$ref:`#`},default:{}},properties:{type:`object`,additionalProperties:{$ref:`#`},default:{}},patternProperties:{type:`object`,additionalProperties:{$ref:`#`},propertyNames:{format:`regex`},default:{}},dependencies:{type:`object`,additionalProperties:{anyOf:[{$ref:`#`},{$ref:`#/definitions/stringArray`}]}},propertyNames:{$ref:`#`},const:!0,enum:{type:`array`,items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:`#/definitions/simpleTypes`},{type:`array`,items:{$ref:`#/definitions/simpleTypes`},minItems:1,uniqueItems:!0}]},format:{type:`string`},contentMediaType:{type:`string`},contentEncoding:{type:`string`},if:{$ref:`#`},then:{$ref:`#`},else:{$ref:`#`},allOf:{$ref:`#/definitions/schemaArray`},anyOf:{$ref:`#/definitions/schemaArray`},oneOf:{$ref:`#/definitions/schemaArray`},not:{$ref:`#`}},kL={$schema:CL,$id:wL,title:TL,definitions:EL,type:DL,properties:OL,default:!0}})),jL=a(((t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;var r=II(),i=yL(),a=xL(),o=(AL(),e(SL).default),s=[`/properties`],c=`http://json-schema.org/draft-07/schema`,l=class extends r.default{_addVocabularies(){super._addVocabularies(),i.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(a.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(o,s):o;this.addMetaSchema(e,c,!1),this.refs[`http://json-schema.org/schema`]=c}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:void 0)}};t.Ajv=l,n.exports=t=l,n.exports.Ajv=l,Object.defineProperty(t,`__esModule`,{value:!0}),t.default=l;var u=bI();Object.defineProperty(t,`KeywordCxt`,{enumerable:!0,get:function(){return u.KeywordCxt}});var d=X();Object.defineProperty(t,`_`,{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,`str`,{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,`stringify`,{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,`nil`,{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,`Name`,{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,`CodeGen`,{enumerable:!0,get:function(){return d.CodeGen}});var f=xI();Object.defineProperty(t,`ValidationError`,{enumerable:!0,get:function(){return f.default}});var p=SI();Object.defineProperty(t,`MissingRefError`,{enumerable:!0,get:function(){return p.default}})})),ML=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.dynamicAnchor=void 0;var t=X(),n=sI(),r=CI(),i=RI(),a={keyword:`$dynamicAnchor`,schemaType:`string`,code:e=>o(e,e.schema)};function o(e,r){let{gen:i,it:a}=e;a.schemaEnv.root.dynamicAnchors[r]=!0;let o=(0,t._)`${n.default.dynamicAnchors}${(0,t.getProperty)(r)}`,c=a.errSchemaPath===`#`?a.validateName:s(e);i.if((0,t._)`!${o}`,()=>i.assign(o,c))}e.dynamicAnchor=o;function s(e){let{schemaEnv:t,schema:n,self:a}=e.it,{root:o,baseId:s,localRefs:c,meta:l}=t.root,{schemaId:u}=a.opts,d=new r.SchemaEnv({schema:n,schemaId:u,root:o,baseId:s,localRefs:c,meta:l});return r.compileSchema.call(a,d),(0,i.getValidate)(e,d)}e.default=a})),NL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.dynamicRef=void 0;var t=X(),n=sI(),r=RI(),i={keyword:`$dynamicRef`,schemaType:`string`,code:e=>a(e,e.schema)};function a(e,i){let{gen:a,keyword:o,it:s}=e;if(i[0]!==`#`)throw Error(`"${o}" only supports hash fragment reference`);let c=i.slice(1);if(s.allErrors)l();else{let t=a.let(`valid`,!1);l(t),e.ok(t)}function l(e){if(s.schemaEnv.root.dynamicAnchors[c]){let r=a.let(`_v`,(0,t._)`${n.default.dynamicAnchors}${(0,t.getProperty)(c)}`);a.if(r,u(r,e),u(s.validateName,e))}else u(s.validateName,e)()}function u(t,n){return n?()=>a.block(()=>{(0,r.callRef)(e,t),a.let(n,!0)}):()=>(0,r.callRef)(e,t)}}e.dynamicRef=a,e.default=i})),PL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=ML(),n=oI();e.default={keyword:`$recursiveAnchor`,schemaType:`boolean`,code(e){e.schema?(0,t.dynamicAnchor)(e,``):(0,n.checkStrictMode)(e.it,`$recursiveAnchor: false is ignored`)}}})),FL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=NL();e.default={keyword:`$recursiveRef`,schemaType:`string`,code:e=>(0,t.dynamicRef)(e,e.schema)}})),IL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=ML(),n=NL(),r=PL(),i=FL();e.default=[t.default,n.default,r.default,i.default]})),LL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=iL();e.default={keyword:`dependentRequired`,type:`object`,schemaType:`object`,error:t.error,code:e=>(0,t.validatePropertyDeps)(e)}})),RL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=iL();e.default={keyword:`dependentSchemas`,type:`object`,schemaType:`object`,code:e=>(0,t.validateSchemaDeps)(e)}})),zL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=oI();e.default={keyword:[`maxContains`,`minContains`],type:`array`,schemaType:`number`,code({keyword:e,parentSchema:n,it:r}){n.contains===void 0&&(0,t.checkStrictMode)(r,`"${e}" without "contains" is ignored`)}}})),BL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=LL(),n=RL(),r=zL();e.default=[t.default,n.default,r.default]})),VL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=oI(),r=sI();e.default={keyword:`unevaluatedProperties`,type:`object`,schemaType:[`boolean`,`object`],trackErrors:!0,error:{message:`must NOT have unevaluated properties`,params:({params:e})=>(0,t._)`{unevaluatedProperty: ${e.unevaluatedProperty}}`},code(e){let{gen:i,schema:a,data:o,errsCount:s,it:c}=e;if(!s)throw Error(`ajv implementation error`);let{allErrors:l,props:u}=c;u instanceof t.Name?i.if((0,t._)`${u} !== true`,()=>i.forIn(`key`,o,e=>i.if(f(u,e),()=>d(e)))):u!==!0&&i.forIn(`key`,o,e=>u===void 0?d(e):i.if(p(u,e),()=>d(e))),c.props=!0,e.ok((0,t._)`${s} === ${r.default.errors}`);function d(r){if(a===!1){e.setParams({unevaluatedProperty:r}),e.error(),l||i.break();return}if(!(0,n.alwaysValidSchema)(c,a)){let a=i.name(`valid`);e.subschema({keyword:`unevaluatedProperties`,dataProp:r,dataPropType:n.Type.Str},a),l||i.if((0,t.not)(a),()=>i.break())}}function f(e,n){return(0,t._)`!${e} || !${e}[${n}]`}function p(e,n){let r=[];for(let i in e)e[i]===!0&&r.push((0,t._)`${n} !== ${i}`);return(0,t.and)(...r)}}}})),HL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=oI();e.default={keyword:`unevaluatedItems`,type:`array`,schemaType:[`boolean`,`object`],error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{gen:r,schema:i,data:a,it:o}=e,s=o.items||0;if(s===!0)return;let c=r.const(`len`,(0,t._)`${a}.length`);if(i===!1)e.setParams({len:s}),e.fail((0,t._)`${c} > ${s}`);else if(typeof i==`object`&&!(0,n.alwaysValidSchema)(o,i)){let n=r.var(`valid`,(0,t._)`${c} <= ${s}`);r.if((0,t.not)(n),()=>l(n,s)),e.ok(n)}o.items=!0;function l(i,a){r.forRange(`i`,a,c,a=>{e.subschema({keyword:`unevaluatedItems`,dataProp:a,dataPropType:n.Type.Num},i),o.allErrors||r.if((0,t.not)(i),()=>r.break())})}}}})),UL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=VL(),n=HL();e.default=[t.default,n.default]})),WL=i({$id:()=>KL,$recursiveAnchor:()=>!0,$schema:()=>GL,$vocabulary:()=>qL,allOf:()=>YL,default:()=>QL,properties:()=>ZL,title:()=>JL,type:()=>XL}),GL,KL,qL,JL,YL,XL,ZL,QL,$L=n((()=>{GL=`https://json-schema.org/draft/2019-09/schema`,KL=`https://json-schema.org/draft/2019-09/schema`,qL={"https://json-schema.org/draft/2019-09/vocab/core":!0,"https://json-schema.org/draft/2019-09/vocab/applicator":!0,"https://json-schema.org/draft/2019-09/vocab/validation":!0,"https://json-schema.org/draft/2019-09/vocab/meta-data":!0,"https://json-schema.org/draft/2019-09/vocab/format":!1,"https://json-schema.org/draft/2019-09/vocab/content":!0},JL=`Core and Validation specifications meta-schema`,YL=[{$ref:`meta/core`},{$ref:`meta/applicator`},{$ref:`meta/validation`},{$ref:`meta/meta-data`},{$ref:`meta/format`},{$ref:`meta/content`}],XL=[`object`,`boolean`],ZL={definitions:{$comment:`While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.`,type:`object`,additionalProperties:{$recursiveRef:`#`},default:{}},dependencies:{$comment:`"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"`,type:`object`,additionalProperties:{anyOf:[{$recursiveRef:`#`},{$ref:`meta/validation#/$defs/stringArray`}]}}},QL={$schema:GL,$id:KL,$vocabulary:qL,$recursiveAnchor:!0,title:JL,allOf:YL,type:XL,properties:ZL}})),eR=i({$defs:()=>sR,$id:()=>nR,$recursiveAnchor:()=>!0,$schema:()=>tR,$vocabulary:()=>rR,default:()=>cR,properties:()=>oR,title:()=>iR,type:()=>aR}),tR,nR,rR,iR,aR,oR,sR,cR,lR=n((()=>{tR=`https://json-schema.org/draft/2019-09/schema`,nR=`https://json-schema.org/draft/2019-09/meta/applicator`,rR={"https://json-schema.org/draft/2019-09/vocab/applicator":!0},iR=`Applicator vocabulary meta-schema`,aR=[`object`,`boolean`],oR={additionalItems:{$recursiveRef:`#`},unevaluatedItems:{$recursiveRef:`#`},items:{anyOf:[{$recursiveRef:`#`},{$ref:`#/$defs/schemaArray`}]},contains:{$recursiveRef:`#`},additionalProperties:{$recursiveRef:`#`},unevaluatedProperties:{$recursiveRef:`#`},properties:{type:`object`,additionalProperties:{$recursiveRef:`#`},default:{}},patternProperties:{type:`object`,additionalProperties:{$recursiveRef:`#`},propertyNames:{format:`regex`},default:{}},dependentSchemas:{type:`object`,additionalProperties:{$recursiveRef:`#`}},propertyNames:{$recursiveRef:`#`},if:{$recursiveRef:`#`},then:{$recursiveRef:`#`},else:{$recursiveRef:`#`},allOf:{$ref:`#/$defs/schemaArray`},anyOf:{$ref:`#/$defs/schemaArray`},oneOf:{$ref:`#/$defs/schemaArray`},not:{$recursiveRef:`#`}},sR={schemaArray:{type:`array`,minItems:1,items:{$recursiveRef:`#`}}},cR={$schema:tR,$id:nR,$vocabulary:rR,$recursiveAnchor:!0,title:iR,type:aR,properties:oR,$defs:sR}})),uR=i({$id:()=>fR,$recursiveAnchor:()=>!0,$schema:()=>dR,$vocabulary:()=>pR,default:()=>_R,properties:()=>gR,title:()=>mR,type:()=>hR}),dR,fR,pR,mR,hR,gR,_R,vR=n((()=>{dR=`https://json-schema.org/draft/2019-09/schema`,fR=`https://json-schema.org/draft/2019-09/meta/content`,pR={"https://json-schema.org/draft/2019-09/vocab/content":!0},mR=`Content vocabulary meta-schema`,hR=[`object`,`boolean`],gR={contentMediaType:{type:`string`},contentEncoding:{type:`string`},contentSchema:{$recursiveRef:`#`}},_R={$schema:dR,$id:fR,$vocabulary:pR,$recursiveAnchor:!0,title:mR,type:hR,properties:gR}})),yR=i({$id:()=>xR,$recursiveAnchor:()=>!0,$schema:()=>bR,$vocabulary:()=>SR,default:()=>ER,properties:()=>TR,title:()=>CR,type:()=>wR}),bR,xR,SR,CR,wR,TR,ER,DR=n((()=>{bR=`https://json-schema.org/draft/2019-09/schema`,xR=`https://json-schema.org/draft/2019-09/meta/core`,SR={"https://json-schema.org/draft/2019-09/vocab/core":!0},CR=`Core vocabulary meta-schema`,wR=[`object`,`boolean`],TR={$id:{type:`string`,format:`uri-reference`,$comment:`Non-empty fragments not allowed.`,pattern:`^[^#]*#?$`},$schema:{type:`string`,format:`uri`},$anchor:{type:`string`,pattern:`^[A-Za-z][-A-Za-z0-9.:_]*$`},$ref:{type:`string`,format:`uri-reference`},$recursiveRef:{type:`string`,format:`uri-reference`},$recursiveAnchor:{type:`boolean`,default:!1},$vocabulary:{type:`object`,propertyNames:{type:`string`,format:`uri`},additionalProperties:{type:`boolean`}},$comment:{type:`string`},$defs:{type:`object`,additionalProperties:{$recursiveRef:`#`},default:{}}},ER={$schema:bR,$id:xR,$vocabulary:SR,$recursiveAnchor:!0,title:CR,type:wR,properties:TR}})),OR=i({$id:()=>AR,$recursiveAnchor:()=>!0,$schema:()=>kR,$vocabulary:()=>jR,default:()=>FR,properties:()=>PR,title:()=>MR,type:()=>NR}),kR,AR,jR,MR,NR,PR,FR,IR=n((()=>{kR=`https://json-schema.org/draft/2019-09/schema`,AR=`https://json-schema.org/draft/2019-09/meta/format`,jR={"https://json-schema.org/draft/2019-09/vocab/format":!0},MR=`Format vocabulary meta-schema`,NR=[`object`,`boolean`],PR={format:{type:`string`}},FR={$schema:kR,$id:AR,$vocabulary:jR,$recursiveAnchor:!0,title:MR,type:NR,properties:PR}})),LR=i({$id:()=>zR,$recursiveAnchor:()=>!0,$schema:()=>RR,$vocabulary:()=>BR,default:()=>WR,properties:()=>UR,title:()=>VR,type:()=>HR}),RR,zR,BR,VR,HR,UR,WR,GR=n((()=>{RR=`https://json-schema.org/draft/2019-09/schema`,zR=`https://json-schema.org/draft/2019-09/meta/meta-data`,BR={"https://json-schema.org/draft/2019-09/vocab/meta-data":!0},VR=`Meta-data vocabulary meta-schema`,HR=[`object`,`boolean`],UR={title:{type:`string`},description:{type:`string`},default:!0,deprecated:{type:`boolean`,default:!1},readOnly:{type:`boolean`,default:!1},writeOnly:{type:`boolean`,default:!1},examples:{type:`array`,items:!0}},WR={$schema:RR,$id:zR,$vocabulary:BR,$recursiveAnchor:!0,title:VR,type:HR,properties:UR}})),KR=i({$defs:()=>$R,$id:()=>JR,$recursiveAnchor:()=>!0,$schema:()=>qR,$vocabulary:()=>YR,default:()=>ez,properties:()=>QR,title:()=>XR,type:()=>ZR}),qR,JR,YR,XR,ZR,QR,$R,ez,tz=n((()=>{qR=`https://json-schema.org/draft/2019-09/schema`,JR=`https://json-schema.org/draft/2019-09/meta/validation`,YR={"https://json-schema.org/draft/2019-09/vocab/validation":!0},XR=`Validation vocabulary meta-schema`,ZR=[`object`,`boolean`],QR={multipleOf:{type:`number`,exclusiveMinimum:0},maximum:{type:`number`},exclusiveMaximum:{type:`number`},minimum:{type:`number`},exclusiveMinimum:{type:`number`},maxLength:{$ref:`#/$defs/nonNegativeInteger`},minLength:{$ref:`#/$defs/nonNegativeIntegerDefault0`},pattern:{type:`string`,format:`regex`},maxItems:{$ref:`#/$defs/nonNegativeInteger`},minItems:{$ref:`#/$defs/nonNegativeIntegerDefault0`},uniqueItems:{type:`boolean`,default:!1},maxContains:{$ref:`#/$defs/nonNegativeInteger`},minContains:{$ref:`#/$defs/nonNegativeInteger`,default:1},maxProperties:{$ref:`#/$defs/nonNegativeInteger`},minProperties:{$ref:`#/$defs/nonNegativeIntegerDefault0`},required:{$ref:`#/$defs/stringArray`},dependentRequired:{type:`object`,additionalProperties:{$ref:`#/$defs/stringArray`}},const:!0,enum:{type:`array`,items:!0},type:{anyOf:[{$ref:`#/$defs/simpleTypes`},{type:`array`,items:{$ref:`#/$defs/simpleTypes`},minItems:1,uniqueItems:!0}]}},$R={nonNegativeInteger:{type:`integer`,minimum:0},nonNegativeIntegerDefault0:{$ref:`#/$defs/nonNegativeInteger`,default:0},simpleTypes:{enum:[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]},stringArray:{type:`array`,items:{type:`string`},uniqueItems:!0,default:[]}},ez={$schema:qR,$id:JR,$vocabulary:YR,$recursiveAnchor:!0,title:XR,type:ZR,properties:QR,$defs:$R}})),nz=a((t=>{Object.defineProperty(t,`__esModule`,{value:!0});var n=($L(),e(WL).default),r=(lR(),e(eR).default),i=(vR(),e(uR).default),a=(DR(),e(yR).default),o=(IR(),e(OR).default),s=(GR(),e(LR).default),c=(tz(),e(KR).default),l=[`/properties`];function u(e){return[n,r,i,a,t(this,o),s,t(this,c)].forEach(e=>this.addMetaSchema(e,void 0,!1)),this;function t(t,n){return e?t.$dataMetaSchema(n,l):n}}t.default=u})),rz=a(((e,t)=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2019=void 0;var n=II(),r=yL(),i=IL(),a=BL(),o=UL(),s=xL(),c=nz(),l=`https://json-schema.org/draft/2019-09/schema`,u=class extends n.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(i.default),r.default.forEach(e=>this.addVocabulary(e)),this.addVocabulary(a.default),this.addVocabulary(o.default),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;t&&(c.default.call(this,e),this.refs[`http://json-schema.org/schema`]=l)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}};e.Ajv2019=u,t.exports=e=u,t.exports.Ajv2019=u,Object.defineProperty(e,`__esModule`,{value:!0}),e.default=u;var d=bI();Object.defineProperty(e,`KeywordCxt`,{enumerable:!0,get:function(){return d.KeywordCxt}});var f=X();Object.defineProperty(e,`_`,{enumerable:!0,get:function(){return f._}}),Object.defineProperty(e,`str`,{enumerable:!0,get:function(){return f.str}}),Object.defineProperty(e,`stringify`,{enumerable:!0,get:function(){return f.stringify}}),Object.defineProperty(e,`nil`,{enumerable:!0,get:function(){return f.nil}}),Object.defineProperty(e,`Name`,{enumerable:!0,get:function(){return f.Name}}),Object.defineProperty(e,`CodeGen`,{enumerable:!0,get:function(){return f.CodeGen}});var p=xI();Object.defineProperty(e,`ValidationError`,{enumerable:!0,get:function(){return p.default}});var m=SI();Object.defineProperty(e,`MissingRefError`,{enumerable:!0,get:function(){return m.default}})})),iz=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=zI(),n=QI(),r=hL(),i=IL(),a=BL(),o=UL(),s=_L(),c=vL();e.default=[i.default,t.default,n.default,(0,r.default)(!0),s.default,c.metadataVocabulary,c.contentVocabulary,a.default,o.default]})),az=i({$comment:()=>pz,$dynamicAnchor:()=>lz,$id:()=>sz,$schema:()=>oz,$vocabulary:()=>cz,allOf:()=>dz,default:()=>hz,properties:()=>mz,title:()=>uz,type:()=>fz}),oz,sz,cz,lz,uz,dz,fz,pz,mz,hz,gz=n((()=>{oz=`https://json-schema.org/draft/2020-12/schema`,sz=`https://json-schema.org/draft/2020-12/schema`,cz={"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},lz=`meta`,uz=`Core and Validation specifications meta-schema`,dz=[{$ref:`meta/core`},{$ref:`meta/applicator`},{$ref:`meta/unevaluated`},{$ref:`meta/validation`},{$ref:`meta/meta-data`},{$ref:`meta/format-annotation`},{$ref:`meta/content`}],fz=[`object`,`boolean`],pz=`This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.`,mz={definitions:{$comment:`"definitions" has been replaced by "$defs".`,type:`object`,additionalProperties:{$dynamicRef:`#meta`},deprecated:!0,default:{}},dependencies:{$comment:`"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.`,type:`object`,additionalProperties:{anyOf:[{$dynamicRef:`#meta`},{$ref:`meta/validation#/$defs/stringArray`}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:`"$recursiveAnchor" has been replaced by "$dynamicAnchor".`,$ref:`meta/core#/$defs/anchorString`,deprecated:!0},$recursiveRef:{$comment:`"$recursiveRef" has been replaced by "$dynamicRef".`,$ref:`meta/core#/$defs/uriReferenceString`,deprecated:!0}},hz={$schema:oz,$id:sz,$vocabulary:cz,$dynamicAnchor:lz,title:uz,allOf:dz,type:fz,$comment:pz,properties:mz}})),_z=i({$defs:()=>Tz,$dynamicAnchor:()=>xz,$id:()=>yz,$schema:()=>vz,$vocabulary:()=>bz,default:()=>Ez,properties:()=>wz,title:()=>Sz,type:()=>Cz}),vz,yz,bz,xz,Sz,Cz,wz,Tz,Ez,Dz=n((()=>{vz=`https://json-schema.org/draft/2020-12/schema`,yz=`https://json-schema.org/draft/2020-12/meta/applicator`,bz={"https://json-schema.org/draft/2020-12/vocab/applicator":!0},xz=`meta`,Sz=`Applicator vocabulary meta-schema`,Cz=[`object`,`boolean`],wz={prefixItems:{$ref:`#/$defs/schemaArray`},items:{$dynamicRef:`#meta`},contains:{$dynamicRef:`#meta`},additionalProperties:{$dynamicRef:`#meta`},properties:{type:`object`,additionalProperties:{$dynamicRef:`#meta`},default:{}},patternProperties:{type:`object`,additionalProperties:{$dynamicRef:`#meta`},propertyNames:{format:`regex`},default:{}},dependentSchemas:{type:`object`,additionalProperties:{$dynamicRef:`#meta`},default:{}},propertyNames:{$dynamicRef:`#meta`},if:{$dynamicRef:`#meta`},then:{$dynamicRef:`#meta`},else:{$dynamicRef:`#meta`},allOf:{$ref:`#/$defs/schemaArray`},anyOf:{$ref:`#/$defs/schemaArray`},oneOf:{$ref:`#/$defs/schemaArray`},not:{$dynamicRef:`#meta`}},Tz={schemaArray:{type:`array`,minItems:1,items:{$dynamicRef:`#meta`}}},Ez={$schema:vz,$id:yz,$vocabulary:bz,$dynamicAnchor:xz,title:Sz,type:Cz,properties:wz,$defs:Tz}})),Oz=i({$dynamicAnchor:()=>Mz,$id:()=>Az,$schema:()=>kz,$vocabulary:()=>jz,default:()=>Iz,properties:()=>Fz,title:()=>Nz,type:()=>Pz}),kz,Az,jz,Mz,Nz,Pz,Fz,Iz,Lz=n((()=>{kz=`https://json-schema.org/draft/2020-12/schema`,Az=`https://json-schema.org/draft/2020-12/meta/unevaluated`,jz={"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},Mz=`meta`,Nz=`Unevaluated applicator vocabulary meta-schema`,Pz=[`object`,`boolean`],Fz={unevaluatedItems:{$dynamicRef:`#meta`},unevaluatedProperties:{$dynamicRef:`#meta`}},Iz={$schema:kz,$id:Az,$vocabulary:jz,$dynamicAnchor:Mz,title:Nz,type:Pz,properties:Fz}})),Rz=i({$dynamicAnchor:()=>Hz,$id:()=>Bz,$schema:()=>zz,$vocabulary:()=>Vz,default:()=>Kz,properties:()=>Gz,title:()=>Uz,type:()=>Wz}),zz,Bz,Vz,Hz,Uz,Wz,Gz,Kz,qz=n((()=>{zz=`https://json-schema.org/draft/2020-12/schema`,Bz=`https://json-schema.org/draft/2020-12/meta/content`,Vz={"https://json-schema.org/draft/2020-12/vocab/content":!0},Hz=`meta`,Uz=`Content vocabulary meta-schema`,Wz=[`object`,`boolean`],Gz={contentEncoding:{type:`string`},contentMediaType:{type:`string`},contentSchema:{$dynamicRef:`#meta`}},Kz={$schema:zz,$id:Bz,$vocabulary:Vz,$dynamicAnchor:Hz,title:Uz,type:Wz,properties:Gz}})),Jz=i({$defs:()=>nB,$dynamicAnchor:()=>Qz,$id:()=>Xz,$schema:()=>Yz,$vocabulary:()=>Zz,default:()=>rB,properties:()=>tB,title:()=>$z,type:()=>eB}),Yz,Xz,Zz,Qz,$z,eB,tB,nB,rB,iB=n((()=>{Yz=`https://json-schema.org/draft/2020-12/schema`,Xz=`https://json-schema.org/draft/2020-12/meta/core`,Zz={"https://json-schema.org/draft/2020-12/vocab/core":!0},Qz=`meta`,$z=`Core vocabulary meta-schema`,eB=[`object`,`boolean`],tB={$id:{$ref:`#/$defs/uriReferenceString`,$comment:`Non-empty fragments not allowed.`,pattern:`^[^#]*#?$`},$schema:{$ref:`#/$defs/uriString`},$ref:{$ref:`#/$defs/uriReferenceString`},$anchor:{$ref:`#/$defs/anchorString`},$dynamicRef:{$ref:`#/$defs/uriReferenceString`},$dynamicAnchor:{$ref:`#/$defs/anchorString`},$vocabulary:{type:`object`,propertyNames:{$ref:`#/$defs/uriString`},additionalProperties:{type:`boolean`}},$comment:{type:`string`},$defs:{type:`object`,additionalProperties:{$dynamicRef:`#meta`}}},nB={anchorString:{type:`string`,pattern:`^[A-Za-z_][-A-Za-z0-9._]*$`},uriString:{type:`string`,format:`uri`},uriReferenceString:{type:`string`,format:`uri-reference`}},rB={$schema:Yz,$id:Xz,$vocabulary:Zz,$dynamicAnchor:Qz,title:$z,type:eB,properties:tB,$defs:nB}})),aB=i({$dynamicAnchor:()=>lB,$id:()=>sB,$schema:()=>oB,$vocabulary:()=>cB,default:()=>pB,properties:()=>fB,title:()=>uB,type:()=>dB}),oB,sB,cB,lB,uB,dB,fB,pB,mB=n((()=>{oB=`https://json-schema.org/draft/2020-12/schema`,sB=`https://json-schema.org/draft/2020-12/meta/format-annotation`,cB={"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},lB=`meta`,uB=`Format vocabulary meta-schema for annotation results`,dB=[`object`,`boolean`],fB={format:{type:`string`}},pB={$schema:oB,$id:sB,$vocabulary:cB,$dynamicAnchor:lB,title:uB,type:dB,properties:fB}})),hB=i({$dynamicAnchor:()=>yB,$id:()=>_B,$schema:()=>gB,$vocabulary:()=>vB,default:()=>CB,properties:()=>SB,title:()=>bB,type:()=>xB}),gB,_B,vB,yB,bB,xB,SB,CB,wB=n((()=>{gB=`https://json-schema.org/draft/2020-12/schema`,_B=`https://json-schema.org/draft/2020-12/meta/meta-data`,vB={"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},yB=`meta`,bB=`Meta-data vocabulary meta-schema`,xB=[`object`,`boolean`],SB={title:{type:`string`},description:{type:`string`},default:!0,deprecated:{type:`boolean`,default:!1},readOnly:{type:`boolean`,default:!1},writeOnly:{type:`boolean`,default:!1},examples:{type:`array`,items:!0}},CB={$schema:gB,$id:_B,$vocabulary:vB,$dynamicAnchor:yB,title:bB,type:xB,properties:SB}})),TB=i({$defs:()=>NB,$dynamicAnchor:()=>kB,$id:()=>DB,$schema:()=>EB,$vocabulary:()=>OB,default:()=>PB,properties:()=>MB,title:()=>AB,type:()=>jB}),EB,DB,OB,kB,AB,jB,MB,NB,PB,FB=n((()=>{EB=`https://json-schema.org/draft/2020-12/schema`,DB=`https://json-schema.org/draft/2020-12/meta/validation`,OB={"https://json-schema.org/draft/2020-12/vocab/validation":!0},kB=`meta`,AB=`Validation vocabulary meta-schema`,jB=[`object`,`boolean`],MB={type:{anyOf:[{$ref:`#/$defs/simpleTypes`},{type:`array`,items:{$ref:`#/$defs/simpleTypes`},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:`array`,items:!0},multipleOf:{type:`number`,exclusiveMinimum:0},maximum:{type:`number`},exclusiveMaximum:{type:`number`},minimum:{type:`number`},exclusiveMinimum:{type:`number`},maxLength:{$ref:`#/$defs/nonNegativeInteger`},minLength:{$ref:`#/$defs/nonNegativeIntegerDefault0`},pattern:{type:`string`,format:`regex`},maxItems:{$ref:`#/$defs/nonNegativeInteger`},minItems:{$ref:`#/$defs/nonNegativeIntegerDefault0`},uniqueItems:{type:`boolean`,default:!1},maxContains:{$ref:`#/$defs/nonNegativeInteger`},minContains:{$ref:`#/$defs/nonNegativeInteger`,default:1},maxProperties:{$ref:`#/$defs/nonNegativeInteger`},minProperties:{$ref:`#/$defs/nonNegativeIntegerDefault0`},required:{$ref:`#/$defs/stringArray`},dependentRequired:{type:`object`,additionalProperties:{$ref:`#/$defs/stringArray`}}},NB={nonNegativeInteger:{type:`integer`,minimum:0},nonNegativeIntegerDefault0:{$ref:`#/$defs/nonNegativeInteger`,default:0},simpleTypes:{enum:[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]},stringArray:{type:`array`,items:{type:`string`},uniqueItems:!0,default:[]}},PB={$schema:EB,$id:DB,$vocabulary:OB,$dynamicAnchor:kB,title:AB,type:jB,properties:MB,$defs:NB}})),IB=a((t=>{Object.defineProperty(t,`__esModule`,{value:!0});var n=(gz(),e(az).default),r=(Dz(),e(_z).default),i=(Lz(),e(Oz).default),a=(qz(),e(Rz).default),o=(iB(),e(Jz).default),s=(mB(),e(aB).default),c=(wB(),e(hB).default),l=(FB(),e(TB).default),u=[`/properties`];function d(e){return[n,r,i,a,o,t(this,s),c,t(this,l)].forEach(e=>this.addMetaSchema(e,void 0,!1)),this;function t(t,n){return e?t.$dataMetaSchema(n,u):n}}t.default=d})),LB=a(((e,t)=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2020=void 0;var n=II(),r=iz(),i=xL(),a=IB(),o=`https://json-schema.org/draft/2020-12/schema`,s=class extends n.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),r.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;t&&(a.default.call(this,e),this.refs[`http://json-schema.org/schema`]=o)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(o)?o:void 0)}};e.Ajv2020=s,t.exports=e=s,t.exports.Ajv2020=s,Object.defineProperty(e,`__esModule`,{value:!0}),e.default=s;var c=bI();Object.defineProperty(e,`KeywordCxt`,{enumerable:!0,get:function(){return c.KeywordCxt}});var l=X();Object.defineProperty(e,`_`,{enumerable:!0,get:function(){return l._}}),Object.defineProperty(e,`str`,{enumerable:!0,get:function(){return l.str}}),Object.defineProperty(e,`stringify`,{enumerable:!0,get:function(){return l.stringify}}),Object.defineProperty(e,`nil`,{enumerable:!0,get:function(){return l.nil}}),Object.defineProperty(e,`Name`,{enumerable:!0,get:function(){return l.Name}}),Object.defineProperty(e,`CodeGen`,{enumerable:!0,get:function(){return l.CodeGen}});var u=xI();Object.defineProperty(e,`ValidationError`,{enumerable:!0,get:function(){return u.default}});var d=SI();Object.defineProperty(e,`MissingRefError`,{enumerable:!0,get:function(){return d.default}})})),RB=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(e,t){return{validate:e,compare:t}}e.fullFormats={date:t(a,o),time:t(c(!0),l),"date-time":t(f(!0),p),"iso-time":t(c(),u),"iso-date-time":t(f(),m),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:_,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:E,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:y,int32:{type:`number`,validate:S},int64:{type:`number`,validate:C},float:{type:`number`,validate:w},double:{type:`number`,validate:w},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,o),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,l),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,p),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,u),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,m),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function n(e){return e%4==0&&(e%100!=0||e%400==0)}var r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,i=[0,31,28,31,30,31,30,31,31,30,31,30,31];function a(e){let t=r.exec(e);if(!t)return!1;let a=+t[1],o=+t[2],s=+t[3];return o>=1&&o<=12&&s>=1&&s<=(o===2&&n(a)?29:i[o])}function o(e,t){if(e&&t)return e>t?1:e<t?-1:0}var s=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function c(e){return function(t){let n=s.exec(t);if(!n)return!1;let r=+n[1],i=+n[2],a=+n[3],o=n[4],c=n[5]===`-`?-1:1,l=+(n[6]||0),u=+(n[7]||0);if(l>23||u>59||e&&!o)return!1;if(r<=23&&i<=59&&a<60)return!0;let d=i-u*c,f=r-l*c-+(d<0);return(f===23||f===-1)&&(d===59||d===-1)&&a<61}}function l(e,t){if(!(e&&t))return;let n=new Date(`2020-01-01T`+e).valueOf(),r=new Date(`2020-01-01T`+t).valueOf();if(n&&r)return n-r}function u(e,t){if(!(e&&t))return;let n=s.exec(e),r=s.exec(t);if(n&&r)return e=n[1]+n[2]+n[3],t=r[1]+r[2]+r[3],e>t?1:e<t?-1:0}var d=/t|\s/i;function f(e){let t=c(e);return function(e){let n=e.split(d);return n.length===2&&a(n[0])&&t(n[1])}}function p(e,t){if(!(e&&t))return;let n=new Date(e).valueOf(),r=new Date(t).valueOf();if(n&&r)return n-r}function m(e,t){if(!(e&&t))return;let[n,r]=e.split(d),[i,a]=t.split(d),s=o(n,i);if(s!==void 0)return s||l(r,a)}var h=/\/|:/,g=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function _(e){return h.test(e)&&g.test(e)}var v=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function y(e){return v.lastIndex=0,v.test(e)}var b=-(2**31),x=2**31-1;function S(e){return Number.isInteger(e)&&e<=x&&e>=b}function C(e){return Number.isInteger(e)}function w(){return!0}var T=/[^\\]\\Z/;function E(e){if(T.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}})),zB=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.formatLimitDefinition=void 0;var t=jL(),n=X(),r=n.operators,i={formatMaximum:{okStr:`<=`,ok:r.LTE,fail:r.GT},formatMinimum:{okStr:`>=`,ok:r.GTE,fail:r.LT},formatExclusiveMaximum:{okStr:`<`,ok:r.LT,fail:r.GTE},formatExclusiveMinimum:{okStr:`>`,ok:r.GT,fail:r.LTE}};e.formatLimitDefinition={keyword:Object.keys(i),type:`string`,schemaType:`string`,$data:!0,error:{message:({keyword:e,schemaCode:t})=>(0,n.str)`should be ${i[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,n._)`{comparison: ${i[e].okStr}, limit: ${t}}`},code(e){let{gen:r,data:a,schemaCode:o,keyword:s,it:c}=e,{opts:l,self:u}=c;if(!l.validateFormats)return;let d=new t.KeywordCxt(c,u.RULES.all.format.definition,`format`);d.$data?f():p();function f(){let t=r.scopeValue(`formats`,{ref:u.formats,code:l.code.formats}),i=r.const(`fmt`,(0,n._)`${t}[${d.schemaCode}]`);e.fail$data((0,n.or)((0,n._)`typeof ${i} != "object"`,(0,n._)`${i} instanceof RegExp`,(0,n._)`typeof ${i}.compare != "function"`,m(i)))}function p(){let t=d.schema,i=u.formats[t];if(!i||i===!0)return;if(typeof i!=`object`||i instanceof RegExp||typeof i.compare!=`function`)throw Error(`"${s}": format "${t}" does not define "compare" function`);let a=r.scopeValue(`formats`,{key:t,ref:i,code:l.code.formats?(0,n._)`${l.code.formats}${(0,n.getProperty)(t)}`:void 0});e.fail$data(m(a))}function m(e){return(0,n._)`${e}.compare(${a}, ${o}) ${i[s].fail} 0`}},dependencies:[`format`]},e.default=t=>(t.addKeyword(e.formatLimitDefinition),t)})),BB=a(((e,t)=>{Object.defineProperty(e,`__esModule`,{value:!0});var n=RB(),r=zB(),i=X(),a=new i.Name(`fullFormats`),o=new i.Name(`fastFormats`),s=(e,t={keywords:!0})=>{if(Array.isArray(t))return c(e,t,n.fullFormats,a),e;let[i,s]=t.mode===`fast`?[n.fastFormats,o]:[n.fullFormats,a];return c(e,t.formats||n.formatNames,i,s),t.keywords&&(0,r.default)(e),e};s.get=(e,t=`full`)=>{let r=(t===`fast`?n.fastFormats:n.fullFormats)[e];if(!r)throw Error(`Unknown format "${e}"`);return r};function c(e,t,n,r){var a;(a=e.opts.code).formats??(a.formats=(0,i._)`require("ajv-formats/dist/formats").${r}`);for(let r of t)e.addFormat(r,n[r])}t.exports=e=s,Object.defineProperty(e,`__esModule`,{value:!0}),e.default=s})),VB=a(((e,t)=>{var n=`\\\\/`,r=`[^${n}]`,i=0,a=`\\.`,o=`\\+`,s=`\\?`,c=`\\/`,l=`(?=.)`,u=`[^/]`,d=`(?:${c}|$)`,f=`(?:^|${c})`,p=`${a}{1,2}${d}`,m={DOT_LITERAL:a,PLUS_LITERAL:o,QMARK_LITERAL:s,SLASH_LITERAL:c,ONE_CHAR:l,QMARK:u,END_ANCHOR:d,DOTS_SLASH:p,NO_DOT:`(?!${a})`,NO_DOTS:`(?!${f}${p})`,NO_DOT_SLASH:`(?!${a}{0,1}${d})`,NO_DOTS_SLASH:`(?!${p})`,QMARK_NO_DOT:`[^.${c}]`,STAR:`${u}*?`,START_ANCHOR:f,SEP:`/`},h={...m,SLASH_LITERAL:`[${n}]`,QMARK:r,STAR:`${r}*?`,DOTS_SLASH:`${a}{1,2}(?:[${n}]|$)`,NO_DOT:`(?!${a})`,NO_DOTS:`(?!(?:^|[${n}])${a}{1,2}(?:[${n}]|$))`,NO_DOT_SLASH:`(?!${a}{0,1}(?:[${n}]|$))`,NO_DOTS_SLASH:`(?!${a}{1,2}(?:[${n}]|$))`,QMARK_NO_DOT:`[^.${n}]`,START_ANCHOR:`(?:^|[${n}])`,END_ANCHOR:`(?:[${n}]|$)`,SEP:`\\`};t.exports={DEFAULT_MAX_EXTGLOB_RECURSION:i,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:{__proto__:null,alnum:`a-zA-Z0-9`,alpha:`a-zA-Z`,ascii:`\\x00-\\x7F`,blank:` \\t`,cntrl:`\\x00-\\x1F\\x7F`,digit:`0-9`,graph:`\\x21-\\x7E`,lower:`a-z`,print:`\\x20-\\x7E `,punct:`\\-!"#$%&'()\\*+,./:;<=>?@[\\]^_\`{|}~`,space:` \\t\\r\\n\\v\\f`,upper:`A-Z`,word:`A-Za-z0-9_`,xdigit:`A-Fa-f0-9`},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":`*`,"**/**":`**`,"**/**/**":`**`},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(e){return{"!":{type:`negate`,open:`(?:(?!(?:`,close:`))${e.STAR})`},"?":{type:`qmark`,open:`(?:`,close:`)?`},"+":{type:`plus`,open:`(?:`,close:`)+`},"*":{type:`star`,open:`(?:`,close:`)*`},"@":{type:`at`,open:`(?:`,close:`)`}}},globChars(e){return e===!0?h:m}}})),HB=a((e=>{var{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:i}=VB();e.isObject=e=>typeof e==`object`&&!!e&&!Array.isArray(e),e.hasRegexChars=e=>r.test(e),e.isRegexChar=t=>t.length===1&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(i,`\\$1`),e.toPosixSlashes=e=>e.replace(t,`/`),e.isWindows=()=>{if(typeof navigator<`u`&&navigator.platform){let e=navigator.platform.toLowerCase();return e===`win32`||e===`windows`}return typeof process<`u`&&process.platform?process.platform===`win32`:!1},e.removeBackslashes=e=>e.replace(n,e=>e===`\\`?``:e),e.escapeLast=(t,n,r)=>{let i=t.lastIndexOf(n,r);return i===-1?t:t[i-1]===`\\`?e.escapeLast(t,n,i-1):`${t.slice(0,i)}\\${t.slice(i)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith(`./`)&&(n=n.slice(2),t.prefix=`./`),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?``:`^`}(?:${e})${n.contains?``:`$`}`;return t.negated===!0&&(r=`(?:^(?!${r}).*$)`),r},e.basename=(e,{windows:t}={})=>{let n=e.split(t?/[\\/]/:`/`),r=n[n.length-1];return r===``?n[n.length-2]:r}})),UB=a(((e,t)=>{var n=HB(),{CHAR_ASTERISK:r,CHAR_AT:i,CHAR_BACKWARD_SLASH:a,CHAR_COMMA:o,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:c,CHAR_FORWARD_SLASH:l,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:d,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_PLUS:p,CHAR_QUESTION_MARK:m,CHAR_RIGHT_CURLY_BRACE:h,CHAR_RIGHT_PARENTHESES:g,CHAR_RIGHT_SQUARE_BRACKET:_}=VB(),v=e=>e===l||e===a,y=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)};t.exports=(e,t)=>{let b=t||{},x=e.length-1,S=b.parts===!0||b.scanToEnd===!0,C=[],w=[],T=[],E=e,ee=-1,te=0,D=0,ne=!1,re=!1,ie=!1,ae=!1,oe=!1,se=!1,ce=!1,O=!1,le=!1,ue=!1,de=0,k,A,fe={value:``,depth:0,isGlob:!1},pe=()=>ee>=x,me=()=>E.charCodeAt(ee+1),he=()=>(k=A,E.charCodeAt(++ee));for(;ee<x;){A=he();let e;if(A===a){ce=fe.backslashes=!0,A=he(),A===u&&(se=!0);continue}if(se===!0||A===u){for(de++;pe()!==!0&&(A=he());){if(A===a){ce=fe.backslashes=!0,he();continue}if(A===u){de++;continue}if(se!==!0&&A===s&&(A=he())===s){if(ne=fe.isBrace=!0,ie=fe.isGlob=!0,ue=!0,S===!0)continue;break}if(se!==!0&&A===o){if(ne=fe.isBrace=!0,ie=fe.isGlob=!0,ue=!0,S===!0)continue;break}if(A===h&&(de--,de===0)){se=!1,ne=fe.isBrace=!0,ue=!0;break}}if(S===!0)continue;break}if(A===l){if(C.push(ee),w.push(fe),fe={value:``,depth:0,isGlob:!1},ue===!0)continue;if(k===s&&ee===te+1){te+=2;continue}D=ee+1;continue}if(b.noext!==!0&&(A===p||A===i||A===r||A===m||A===c)&&me()===d){if(ie=fe.isGlob=!0,ae=fe.isExtglob=!0,ue=!0,A===c&&ee===te&&(le=!0),S===!0){for(;pe()!==!0&&(A=he());){if(A===a){ce=fe.backslashes=!0,A=he();continue}if(A===g){ie=fe.isGlob=!0,ue=!0;break}}continue}break}if(A===r){if(k===r&&(oe=fe.isGlobstar=!0),ie=fe.isGlob=!0,ue=!0,S===!0)continue;break}if(A===m){if(ie=fe.isGlob=!0,ue=!0,S===!0)continue;break}if(A===f){for(;pe()!==!0&&(e=he());){if(e===a){ce=fe.backslashes=!0,he();continue}if(e===_){re=fe.isBracket=!0,ie=fe.isGlob=!0,ue=!0;break}}if(S===!0)continue;break}if(b.nonegate!==!0&&A===c&&ee===te){O=fe.negated=!0,te++;continue}if(b.noparen!==!0&&A===d){if(ie=fe.isGlob=!0,S===!0){for(;pe()!==!0&&(A=he());){if(A===d){ce=fe.backslashes=!0,A=he();continue}if(A===g){ue=!0;break}}continue}break}if(ie===!0){if(ue=!0,S===!0)continue;break}}b.noext===!0&&(ae=!1,ie=!1);let ge=E,_e=``,ve=``;te>0&&(_e=E.slice(0,te),E=E.slice(te),D-=te),ge&&ie===!0&&D>0?(ge=E.slice(0,D),ve=E.slice(D)):ie===!0?(ge=``,ve=E):ge=E,ge&&ge!==``&&ge!==`/`&&ge!==E&&v(ge.charCodeAt(ge.length-1))&&(ge=ge.slice(0,-1)),b.unescape===!0&&(ve&&=n.removeBackslashes(ve),ge&&ce===!0&&(ge=n.removeBackslashes(ge)));let ye={prefix:_e,input:e,start:te,base:ge,glob:ve,isBrace:ne,isBracket:re,isGlob:ie,isExtglob:ae,isGlobstar:oe,negated:O,negatedExtglob:le};if(b.tokens===!0&&(ye.maxDepth=0,v(A)||w.push(fe),ye.tokens=w),b.parts===!0||b.tokens===!0){let t;for(let n=0;n<C.length;n++){let r=t?t+1:te,i=C[n],a=e.slice(r,i);b.tokens&&(n===0&&te!==0?(w[n].isPrefix=!0,w[n].value=_e):w[n].value=a,y(w[n]),ye.maxDepth+=w[n].depth),(n!==0||a!==``)&&T.push(a),t=i}if(t&&t+1<e.length){let n=e.slice(t+1);T.push(n),b.tokens&&(w[w.length-1].value=n,y(w[w.length-1]),ye.maxDepth+=w[w.length-1].depth)}ye.slashes=C,ye.parts=T}return ye}})),WB=a(((e,t)=>{var n=VB(),r=HB(),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:a,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:c}=n,l=(e,t)=>{if(typeof t.expandRange==`function`)return t.expandRange(...e,t);e.sort();let n=`[${e.join(`-`)}]`;try{new RegExp(n)}catch{return e.map(e=>r.escapeRegex(e)).join(`..`)}return n},u=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,d=e=>{let t=[],n=0,r=0,i=0,a=``,o=!1;for(let s of e){if(o===!0){a+=s,o=!1;continue}if(s===`\\`){a+=s,o=!0;continue}if(s===`"`){i=i===1?0:1,a+=s;continue}if(i===0){if(s===`[`)n++;else if(s===`]`&&n>0)n--;else if(n===0){if(s===`(`)r++;else if(s===`)`&&r>0)r--;else if(s===`|`&&r===0){t.push(a),a=``;continue}}}a+=s}return t.push(a),t},f=e=>{let t=!1;for(let n of e){if(t===!0){t=!1;continue}if(n===`\\`){t=!0;continue}if(/[?*+@!()[\]{}]/.test(n))return!1}return!0},p=e=>{let t=e.trim(),n=!0;for(;n===!0;)n=!1,/^@\([^\\()[\]{}|]+\)$/.test(t)&&(t=t.slice(2,-1),n=!0);if(f(t))return t.replace(/\\(.)/g,`$1`)},m=e=>{let t=e.map(p).filter(Boolean);for(let e=0;e<t.length;e++)for(let n=e+1;n<t.length;n++){let r=t[e],i=t[n],a=r[0];if(!(!a||r!==a.repeat(r.length)||i!==a.repeat(i.length))&&(r===i||r.startsWith(i)||i.startsWith(r)))return!0}return!1},h=(e,t=!0)=>{if(e[0]!==`+`&&e[0]!==`*`||e[1]!==`(`)return;let n=0,r=0,i=0,a=!1;for(let o=1;o<e.length;o++){let s=e[o];if(a===!0){a=!1;continue}if(s===`\\`){a=!0;continue}if(s===`"`){i=i===1?0:1;continue}if(i!==1){if(s===`[`){n++;continue}if(s===`]`&&n>0){n--;continue}if(!(n>0)){if(s===`(`){r++;continue}if(s===`)`&&(r--,r===0))return t===!0&&o!==e.length-1?void 0:{type:e[0],body:e.slice(2,o),end:o}}}}},g=e=>`${e.length===1?r.escapeRegex(e[0]):`[${e.map(e=>r.escapeRegex(e)).join(``)}]`}*`,_=e=>{let t=0,n=[];for(;t<e.length;){let r=h(e.slice(t),!1);if(!r||r.type!==`*`)return;let i=d(r.body).map(e=>e.trim());if(i.length!==1)return;let a=p(i[0]);if(!a||a.length!==1)return;n.push(a),t+=r.end+1}if(!(n.length<1))return n},v=e=>{let t=0,n=e.trim(),r=h(n);for(;r;)t++,n=r.body.trim(),r=h(n);return t},y=(e,t)=>{if(t.maxExtglobRecursion===!1)return{risky:!1};let r=typeof t.maxExtglobRecursion==`number`?t.maxExtglobRecursion:n.DEFAULT_MAX_EXTGLOB_RECURSION,i=d(e).map(e=>e.trim());if(i.length>1&&(i.some(e=>e===``)||i.some(e=>/^[*?]+$/.test(e))||m(i)))return{risky:!0};let a=[],o=!1,s=!0;for(let e of i){let t=_(e);if(t){o=!0,a.push(...t);continue}let n=p(e);if(n&&n.length===1){a.push(n);continue}if(s=!1,v(e)>r)return{risky:!0}}return o?s?{risky:!0,safeOutput:g([...new Set(a)])}:{risky:!0}:{risky:!1}},b=(e,t)=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);e=c[e]||e;let d={...t},f=typeof d.maxLength==`number`?Math.min(i,d.maxLength):i,p=e.length;if(p>f)throw SyntaxError(`Input length: ${p}, exceeds maximum allowed length: ${f}`);let m={type:`bos`,value:``,output:d.prepend||``},h=[m],g=d.capture?``:`?:`,_=n.globChars(d.windows),v=n.extglobChars(_),{DOT_LITERAL:x,PLUS_LITERAL:S,SLASH_LITERAL:C,ONE_CHAR:w,DOTS_SLASH:T,NO_DOT:E,NO_DOT_SLASH:ee,NO_DOTS_SLASH:te,QMARK:D,QMARK_NO_DOT:ne,STAR:re,START_ANCHOR:ie}=_,ae=e=>`(${g}(?:(?!${ie}${e.dot?T:x}).)*?)`,oe=d.dot?``:E,se=d.dot?D:ne,ce=d.bash===!0?ae(d):re;d.capture&&(ce=`(${ce})`),typeof d.noext==`boolean`&&(d.noextglob=d.noext);let O={input:e,index:-1,start:0,dot:d.dot===!0,consumed:``,output:``,prefix:``,backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:h};e=r.removePrefix(e,O),p=e.length;let le=[],ue=[],de=[],k=m,A,fe=()=>O.index===p-1,pe=O.peek=(t=1)=>e[O.index+t],me=O.advance=()=>e[++O.index]||``,he=()=>e.slice(O.index+1),ge=(e=``,t=0)=>{O.consumed+=e,O.index+=t},_e=e=>{O.output+=e.output==null?e.value:e.output,ge(e.value)},ve=()=>{let e=1;for(;pe()===`!`&&(pe(2)!==`(`||pe(3)===`?`);)me(),O.start++,e++;return e%2==0?!1:(O.negated=!0,O.start++,!0)},ye=e=>{O[e]++,de.push(e)},be=e=>{O[e]--,de.pop()},j=e=>{if(k.type===`globstar`){let t=O.braces>0&&(e.type===`comma`||e.type===`brace`),n=e.extglob===!0||le.length&&(e.type===`pipe`||e.type===`paren`);e.type!==`slash`&&e.type!==`paren`&&!t&&!n&&(O.output=O.output.slice(0,-k.output.length),k.type=`star`,k.value=`*`,k.output=ce,O.output+=k.output)}if(le.length&&e.type!==`paren`&&(le[le.length-1].inner+=e.value),(e.value||e.output)&&_e(e),k&&k.type===`text`&&e.type===`text`){k.output=(k.output||k.value)+e.value,k.value+=e.value;return}e.prev=k,h.push(e),k=e},xe=(e,t)=>{let n={...v[t],conditions:1,inner:``};n.prev=k,n.parens=O.parens,n.output=O.output,n.startIndex=O.index,n.tokensIndex=h.length;let r=(d.capture?`(`:``)+n.open;ye(`parens`),j({type:e,value:t,output:O.output?``:w}),j({type:`paren`,extglob:!0,value:me(),output:r}),le.push(n)},Se=n=>{let i=e.slice(n.startIndex,O.index+1),a=y(e.slice(n.startIndex+2,O.index),d);if((n.type===`plus`||n.type===`star`)&&a.risky){let e=a.safeOutput?(n.output?``:w)+(d.capture?`(${a.safeOutput})`:a.safeOutput):void 0,t=h[n.tokensIndex];t.type=`text`,t.value=i,t.output=e||r.escapeRegex(i);for(let e=n.tokensIndex+1;e<h.length;e++)h[e].value=``,h[e].output=``,delete h[e].suffix;O.output=n.output+t.output,O.backtrack=!0,j({type:`paren`,extglob:!0,value:A,output:``}),be(`parens`);return}let o=n.close+(d.capture?`)`:``),s;if(n.type===`negate`){let e=ce;n.inner&&n.inner.length>1&&n.inner.includes(`/`)&&(e=ae(d)),(e!==ce||fe()||/^\)+$/.test(he()))&&(o=n.close=`)$))${e}`),n.inner.includes(`*`)&&(s=he())&&/^\.[^\\/.]+$/.test(s)&&(o=n.close=`)${b(s,{...t,fastpaths:!1}).output})${e})`),n.prev.type===`bos`&&(O.negatedExtglob=!0)}j({type:`paren`,extglob:!0,value:A,output:o}),be(`parens`)};if(d.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let n=!1,i=e.replace(s,(e,t,r,i,a,o)=>i===`\\`?(n=!0,e):i===`?`?t?t+i+(a?D.repeat(a.length):``):o===0?se+(a?D.repeat(a.length):``):D.repeat(r.length):i===`.`?x.repeat(r.length):i===`*`?t?t+i+(a?ce:``):ce:t?e:`\\${e}`);return n===!0&&(i=d.unescape===!0?i.replace(/\\/g,``):i.replace(/\\+/g,e=>e.length%2==0?`\\\\`:e?`\\`:``)),i===e&&d.contains===!0?(O.output=e,O):(O.output=r.wrapOutput(i,O,t),O)}for(;!fe();){if(A=me(),A===`\0`)continue;if(A===`\\`){let e=pe();if(e===`/`&&d.bash!==!0||e===`.`||e===`;`)continue;if(!e){A+=`\\`,j({type:`text`,value:A});continue}let t=/^\\+/.exec(he()),n=0;if(t&&t[0].length>2&&(n=t[0].length,O.index+=n,n%2!=0&&(A+=`\\`)),d.unescape===!0?A=me():A+=me(),O.brackets===0){j({type:`text`,value:A});continue}}if(O.brackets>0&&(A!==`]`||k.value===`[`||k.value===`[^`)){if(d.posix!==!1&&A===`:`){let e=k.value.slice(1);if(e.includes(`[`)&&(k.posix=!0,e.includes(`:`))){let e=k.value.lastIndexOf(`[`),t=k.value.slice(0,e),n=a[k.value.slice(e+2)];if(n){k.value=t+n,O.backtrack=!0,me(),!m.output&&h.indexOf(k)===1&&(m.output=w);continue}}}(A===`[`&&pe()!==`:`||A===`-`&&pe()===`]`)&&(A=`\\${A}`),A===`]`&&(k.value===`[`||k.value===`[^`)&&(A=`\\${A}`),d.posix===!0&&A===`!`&&k.value===`[`&&(A=`^`),k.value+=A,_e({value:A});continue}if(O.quotes===1&&A!==`"`){A=r.escapeRegex(A),k.value+=A,_e({value:A});continue}if(A===`"`){O.quotes=O.quotes===1?0:1,d.keepQuotes===!0&&j({type:`text`,value:A});continue}if(A===`(`){ye(`parens`),j({type:`paren`,value:A});continue}if(A===`)`){if(O.parens===0&&d.strictBrackets===!0)throw SyntaxError(u(`opening`,`(`));let e=le[le.length-1];if(e&&O.parens===e.parens+1){Se(le.pop());continue}j({type:`paren`,value:A,output:O.parens?`)`:`\\)`}),be(`parens`);continue}if(A===`[`){if(d.nobracket===!0||!he().includes(`]`)){if(d.nobracket!==!0&&d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));A=`\\${A}`}else ye(`brackets`);j({type:`bracket`,value:A});continue}if(A===`]`){if(d.nobracket===!0||k&&k.type===`bracket`&&k.value.length===1){j({type:`text`,value:A,output:`\\${A}`});continue}if(O.brackets===0){if(d.strictBrackets===!0)throw SyntaxError(u(`opening`,`[`));j({type:`text`,value:A,output:`\\${A}`});continue}be(`brackets`);let e=k.value.slice(1);if(k.posix!==!0&&e[0]===`^`&&!e.includes(`/`)&&(A=`/${A}`),k.value+=A,_e({value:A}),d.literalBrackets===!1||r.hasRegexChars(e))continue;let t=r.escapeRegex(k.value);if(O.output=O.output.slice(0,-k.value.length),d.literalBrackets===!0){O.output+=t,k.value=t;continue}k.value=`(${g}${t}|${k.value})`,O.output+=k.value;continue}if(A===`{`&&d.nobrace!==!0){ye(`braces`);let e={type:`brace`,value:A,output:`(`,outputIndex:O.output.length,tokensIndex:O.tokens.length};ue.push(e),j(e);continue}if(A===`}`){let e=ue[ue.length-1];if(d.nobrace===!0||!e){j({type:`text`,value:A,output:A});continue}let t=`)`;if(e.dots===!0){let e=h.slice(),n=[];for(let t=e.length-1;t>=0&&(h.pop(),e[t].type!==`brace`);t--)e[t].type!==`dots`&&n.unshift(e[t].value);t=l(n,d),O.backtrack=!0}if(e.comma!==!0&&e.dots!==!0){let n=O.output.slice(0,e.outputIndex),r=O.tokens.slice(e.tokensIndex);e.value=e.output=`\\{`,A=t=`\\}`,O.output=n;for(let e of r)O.output+=e.output||e.value}j({type:`brace`,value:A,output:t}),be(`braces`),ue.pop();continue}if(A===`|`){le.length>0&&le[le.length-1].conditions++,j({type:`text`,value:A});continue}if(A===`,`){let e=A,t=ue[ue.length-1];t&&de[de.length-1]===`braces`&&(t.comma=!0,e=`|`),j({type:`comma`,value:A,output:e});continue}if(A===`/`){if(k.type===`dot`&&O.index===O.start+1){O.start=O.index+1,O.consumed=``,O.output=``,h.pop(),k=m;continue}j({type:`slash`,value:A,output:C});continue}if(A===`.`){if(O.braces>0&&k.type===`dot`){k.value===`.`&&(k.output=x);let e=ue[ue.length-1];k.type=`dots`,k.output+=A,k.value+=A,e.dots=!0;continue}if(O.braces+O.parens===0&&k.type!==`bos`&&k.type!==`slash`){j({type:`text`,value:A,output:x});continue}j({type:`dot`,value:A,output:x});continue}if(A===`?`){if(!(k&&k.value===`(`)&&d.noextglob!==!0&&pe()===`(`&&pe(2)!==`?`){xe(`qmark`,A);continue}if(k&&k.type===`paren`){let e=pe(),t=A;(k.value===`(`&&!/[!=<:]/.test(e)||e===`<`&&!/<([!=]|\w+>)/.test(he()))&&(t=`\\${A}`),j({type:`text`,value:A,output:t});continue}if(d.dot!==!0&&(k.type===`slash`||k.type===`bos`)){j({type:`qmark`,value:A,output:ne});continue}j({type:`qmark`,value:A,output:D});continue}if(A===`!`){if(d.noextglob!==!0&&pe()===`(`&&(pe(2)!==`?`||!/[!=<:]/.test(pe(3)))){xe(`negate`,A);continue}if(d.nonegate!==!0&&O.index===0){ve();continue}}if(A===`+`){if(d.noextglob!==!0&&pe()===`(`&&pe(2)!==`?`){xe(`plus`,A);continue}if(k&&k.value===`(`||d.regex===!1){j({type:`plus`,value:A,output:S});continue}if(k&&(k.type===`bracket`||k.type===`paren`||k.type===`brace`)||O.parens>0){j({type:`plus`,value:A});continue}j({type:`plus`,value:S});continue}if(A===`@`){if(d.noextglob!==!0&&pe()===`(`&&pe(2)!==`?`){j({type:`at`,extglob:!0,value:A,output:``});continue}j({type:`text`,value:A});continue}if(A!==`*`){(A===`$`||A===`^`)&&(A=`\\${A}`);let e=o.exec(he());e&&(A+=e[0],O.index+=e[0].length),j({type:`text`,value:A});continue}if(k&&(k.type===`globstar`||k.star===!0)){k.type=`star`,k.star=!0,k.value+=A,k.output=ce,O.backtrack=!0,O.globstar=!0,ge(A);continue}let t=he();if(d.noextglob!==!0&&/^\([^?]/.test(t)){xe(`star`,A);continue}if(k.type===`star`){if(d.noglobstar===!0){ge(A);continue}let n=k.prev,r=n.prev,i=n.type===`slash`||n.type===`bos`,a=r&&(r.type===`star`||r.type===`globstar`);if(d.bash===!0&&(!i||t[0]&&t[0]!==`/`)){j({type:`star`,value:A,output:``});continue}let o=O.braces>0&&(n.type===`comma`||n.type===`brace`),s=le.length&&(n.type===`pipe`||n.type===`paren`);if(!i&&n.type!==`paren`&&!o&&!s){j({type:`star`,value:A,output:``});continue}for(;t.slice(0,3)===`/**`;){let n=e[O.index+4];if(n&&n!==`/`)break;t=t.slice(3),ge(`/**`,3)}if(n.type===`bos`&&fe()){k.type=`globstar`,k.value+=A,k.output=ae(d),O.output=k.output,O.globstar=!0,ge(A);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&!a&&fe()){O.output=O.output.slice(0,-(n.output+k.output).length),n.output=`(?:${n.output}`,k.type=`globstar`,k.output=ae(d)+(d.strictSlashes?`)`:`|$)`),k.value+=A,O.globstar=!0,O.output+=n.output+k.output,ge(A);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&t[0]===`/`){let e=t[1]===void 0?``:`|$`;O.output=O.output.slice(0,-(n.output+k.output).length),n.output=`(?:${n.output}`,k.type=`globstar`,k.output=`${ae(d)}${C}|${C}${e})`,k.value+=A,O.output+=n.output+k.output,O.globstar=!0,ge(A+me()),j({type:`slash`,value:`/`,output:``});continue}if(n.type===`bos`&&t[0]===`/`){k.type=`globstar`,k.value+=A,k.output=`(?:^|${C}|${ae(d)}${C})`,O.output=k.output,O.globstar=!0,ge(A+me()),j({type:`slash`,value:`/`,output:``});continue}O.output=O.output.slice(0,-k.output.length),k.type=`globstar`,k.output=ae(d),k.value+=A,O.output+=k.output,O.globstar=!0,ge(A);continue}let n={type:`star`,value:A,output:ce};if(d.bash===!0){n.output=`.*?`,(k.type===`bos`||k.type===`slash`)&&(n.output=oe+n.output),j(n);continue}if(k&&(k.type===`bracket`||k.type===`paren`)&&d.regex===!0){n.output=A,j(n);continue}(O.index===O.start||k.type===`slash`||k.type===`dot`)&&(k.type===`dot`?(O.output+=ee,k.output+=ee):d.dot===!0?(O.output+=te,k.output+=te):(O.output+=oe,k.output+=oe),pe()!==`*`&&(O.output+=w,k.output+=w)),j(n)}for(;O.brackets>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));O.output=r.escapeLast(O.output,`[`),be(`brackets`)}for(;O.parens>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`)`));O.output=r.escapeLast(O.output,`(`),be(`parens`)}for(;O.braces>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`}`));O.output=r.escapeLast(O.output,`{`),be(`braces`)}if(d.strictSlashes!==!0&&(k.type===`star`||k.type===`bracket`)&&j({type:`maybe_slash`,value:``,output:`${C}?`}),O.backtrack===!0){O.output=``;for(let e of O.tokens)O.output+=e.output==null?e.value:e.output,e.suffix&&(O.output+=e.suffix)}return O};b.fastpaths=(e,t)=>{let a={...t},o=typeof a.maxLength==`number`?Math.min(i,a.maxLength):i,s=e.length;if(s>o)throw SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${o}`);e=c[e]||e;let{DOT_LITERAL:l,SLASH_LITERAL:u,ONE_CHAR:d,DOTS_SLASH:f,NO_DOT:p,NO_DOTS:m,NO_DOTS_SLASH:h,STAR:g,START_ANCHOR:_}=n.globChars(a.windows),v=a.dot?m:p,y=a.dot?h:p,b=a.capture?``:`?:`,x={negated:!1,prefix:``},S=a.bash===!0?`.*?`:g;a.capture&&(S=`(${S})`);let C=e=>e.noglobstar===!0?S:`(${b}(?:(?!${_}${e.dot?f:l}).)*?)`,w=e=>{switch(e){case`*`:return`${v}${d}${S}`;case`.*`:return`${l}${d}${S}`;case`*.*`:return`${v}${S}${l}${d}${S}`;case`*/*`:return`${v}${S}${u}${d}${y}${S}`;case`**`:return v+C(a);case`**/*`:return`(?:${v}${C(a)}${u})?${y}${d}${S}`;case`**/*.*`:return`(?:${v}${C(a)}${u})?${y}${S}${l}${d}${S}`;case`**/.*`:return`(?:${v}${C(a)}${u})?${l}${d}${S}`;default:{let t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;let n=w(t[1]);return n?n+l+t[2]:void 0}}},T=w(r.removePrefix(e,x));return T&&a.strictSlashes!==!0&&(T+=`${u}?`),T},t.exports=b})),GB=a(((e,t)=>{var n=UB(),r=WB(),i=HB(),a=VB(),o=e=>e&&typeof e==`object`&&!Array.isArray(e),s=(e,t,n=!1)=>{if(Array.isArray(e)){let r=e.map(e=>s(e,t,n));return e=>{for(let t of r){let n=t(e);if(n)return n}return!1}}let r=o(e)&&e.tokens&&e.input;if(e===``||typeof e!=`string`&&!r)throw TypeError(`Expected pattern to be a non-empty string`);let i=t||{},a=i.windows,c=r?s.compileRe(e,t):s.makeRe(e,t,!1,!0),l=c.state;delete c.state;let u=()=>!1;if(i.ignore){let e={...t,ignore:null,onMatch:null,onResult:null};u=s(i.ignore,e,n)}let d=(n,r=!1)=>{let{isMatch:o,match:d,output:f}=s.test(n,c,t,{glob:e,posix:a}),p={glob:e,state:l,regex:c,posix:a,input:n,output:f,match:d,isMatch:o};return typeof i.onResult==`function`&&i.onResult(p),o===!1?(p.isMatch=!1,r?p:!1):u(n)?(typeof i.onIgnore==`function`&&i.onIgnore(p),p.isMatch=!1,r?p:!1):(typeof i.onMatch==`function`&&i.onMatch(p),r?p:!0)};return n&&(d.state=l),d};s.test=(e,t,n,{glob:r,posix:a}={})=>{if(typeof e!=`string`)throw TypeError(`Expected input to be a string`);if(e===``)return{isMatch:!1,output:``};let o=n||{},c=o.format||(a?i.toPosixSlashes:null),l=e===r,u=l&&c?c(e):e;return l===!1&&(u=c?c(e):e,l=u===r),(l===!1||o.capture===!0)&&(l=o.matchBase===!0||o.basename===!0?s.matchBase(e,t,n,a):t.exec(u)),{isMatch:!!l,match:l,output:u}},s.matchBase=(e,t,n,r=n&&n.windows)=>(t instanceof RegExp?t:s.makeRe(t,n)).test(i.basename(e,{windows:r})),s.isMatch=(e,t,n)=>s(t,n)(e),s.parse=(e,t)=>Array.isArray(e)?e.map(e=>s.parse(e,t)):r(e,{...t,fastpaths:!1}),s.scan=(e,t)=>n(e,t),s.compileRe=(e,t,n=!1,r=!1)=>{if(n===!0)return e.output;let i=t||{},a=i.contains?``:`^`,o=i.contains?``:`$`,c=`${a}(?:${e.output})${o}`;e&&e.negated===!0&&(c=`^(?!${c}).*$`);let l=s.toRegex(c,t);return r===!0&&(l.state=e),l},s.makeRe=(e,t={},n=!1,i=!1)=>{if(!e||typeof e!=`string`)throw TypeError(`Expected a non-empty string`);let a={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]===`.`||e[0]===`*`)&&(a.output=r.fastpaths(e,t)),a.output||(a=r(e,t)),s.compileRe(a,t,n,i)},s.toRegex=(e,t)=>{try{let n=t||{};return new RegExp(e,n.flags||(n.nocase?`i`:``))}catch(e){if(t&&t.debug===!0)throw e;return/$^/}},s.constants=a,t.exports=s})),KB=a(((e,t)=>{var n=GB(),r=HB();function i(e,t,i=!1){return t&&(t.windows===null||t.windows===void 0)&&(t={...t,windows:r.isWindows()}),n(e,t,i)}Object.assign(i,n),t.exports=i})),qB=r(jL(),1),JB=r(rz(),1),YB=r(LB(),1),XB=r(BB(),1),ZB=r(KB(),1),QB=()=>Error(`Node APIs are not available in browser context.`),$B=()=>{throw QB()},eV={access:(e,t)=>t(QB()),accessSync:$B,readFile:(e,t,n)=>n(QB()),readFileSync:$B},tV={},nV=a(((e,t)=>{var{flatTokensSymbol:n,htmlFlowSymbol:r,newlineRe:i}=Ie();function a(e){return Object.hasOwn(e,r)}function o(e){let{text:t,type:n}=e;if(n===`htmlFlow`&&t.startsWith(`<!--`)&&t.endsWith(`-->`)){let e=t.slice(4,-3);return!e.startsWith(`>`)&&!e.startsWith(`->`)&&!e.endsWith(`-`)}return!1}function s(e,t,n){for(let r=t;r<=n;r++)e.add(r)}function c(e,t,n){let r=[],i=[{array:e,index:0}];for(;i.length>0;){let e=i[i.length-1],{array:a,index:o}=e;if(o<a.length){let o=a[e.index++];t(o)&&r.push(o);let{children:s}=o;if(s.length>0){let e=n?n(o):s;i.push({array:e,index:0})}}else i.pop()}return r}function l(e,t,r){let i=e=>t.includes(e.type)&&(r||!a(e)),o=e[n];return o?o.filter(i):c(e,i)}function u(e,t,n=1){return l(e,[`blockQuotePrefix`,`linePrefix`]).filter(e=>e.startLine===t).map(e=>e.text).join(``).trimEnd().concat(`
369
- `).repeat(n)}function d(e,t){let n=Array.isArray(e)?e:[e];for(let e of t){let t=t=>Array.isArray(e)?e.includes(t.type):e===t.type;n=n.flatMap(e=>e.children.filter(t))}return n}function f(e){let t=1,{text:n}=e.children.find(e=>[`atxHeadingSequence`,`setextHeadingLine`].includes(e.type));return n[0]===`#`?t=Math.min(n.length,6):n[0]===`-`&&(t=2),t}function p(e){return e.type===`setextHeading`?`setext`:e.children.filter(e=>e.type===`atxHeadingSequence`).length===1?`atx`:`atx_closed`}function m(e){return d(e,[[`atxHeadingText`,`setextHeadingText`]]).flatMap(e=>e.children.filter(e=>e.type!==`htmlText`)).map(e=>e.text).join(``).replace(i,` `)}function h(e){let t=/^<([^!>][^/\s>]*)/;if(e.type===`htmlText`){let n=t.exec(e.text);if(n){let e=n[1],t=e.startsWith(`/`);return{close:t,name:t?e.slice(1):e}}}return null}function g(e,t){let n=e;for(;(n=n.parent)&&!t.includes(n.type););return n}var _=/^#tab\//;function v(e){if(e?.type===`atxHeading`){let t=d(e,[`atxHeadingText`]);if(t.length===1&&t[0].children.length===1&&t[0].children[0].type===`link`){let e=l(t[0].children[0].children,[`resourceDestinationString`]);return e.length===1&&_.test(e[0].text)}}return!1}t.exports={addRangeToSet:s,filterByPredicate:c,filterByTypes:l,getBlockQuotePrefixText:u,getDescendantsByType:d,getHeadingLevel:f,getHeadingStyle:p,getHeadingText:m,getHtmlTagInfo:h,getParentOfType:g,inHtmlFlow:a,isDocfxTab:v,isHtmlFlowComment:o,nonContentTokens:new Set([`blockQuoteMarker`,`blockQuotePrefix`,`blockQuotePrefixWhitespace`,`gfmFootnoteDefinitionIndent`,`lineEnding`,`lineEndingBlank`,`linePrefix`,`listItemIndent`,`undefinedReference`,`undefinedReferenceCollapsed`,`undefinedReferenceFull`,`undefinedReferenceShortcut`])}})),Z=r(a(((e,t)=>{var n=nV(),{newlineRe:r,nextLinesRe:i}=Ie();t.exports.newLineRe=r,t.exports.nextLinesRe=i,t.exports.frontMatterRe=/((^---[^\S\r\n\u2028\u2029]*$[\s\S]+?^---\s*)|(^\+\+\+[^\S\r\n\u2028\u2029]*$[\s\S]+?^(\+\+\+|\.\.\.)\s*)|(^\{[^\S\r\n\u2028\u2029]*$[\s\S]+?^\}\s*))(\r\n|\r|\n|$)/m;var a=/(<!--\s*markdownlint-(disable|enable|capture|restore|disable-file|enable-file|disable-line|disable-next-line|configure-file))(?:\s|-->)/gi;t.exports.inlineCommentStartRe=a,t.exports.endOfLineHtmlEntityRe=/&(?:#\d+|#[xX][\da-fA-F]+|[a-zA-Z]{2,31}|blk\d{2}|emsp1[34]|frac\d{2}|sup\d|there4);$/,t.exports.endOfLineGemojiCodeRe=/:(?:[abmovx]|[-+]1|100|1234|(?:1st|2nd|3rd)_place_medal|8ball|clock\d{1,4}|e-mail|non-potable_water|o2|t-rex|u5272|u5408|u55b6|u6307|u6708|u6709|u6e80|u7121|u7533|u7981|u7a7a|[a-z]{2,15}2?|[a-z]{1,14}(?:_[a-z\d]{1,16})+):$/;var o=`.,;:!?。,;:!?`;t.exports.allPunctuation=o,t.exports.allPunctuationNoQuestion=o.replace(/[??]/gu,``);function s(e){return typeof e==`number`}t.exports.isNumber=s;function c(e){return typeof e==`string`}t.exports.isString=c;function l(e){return e.length===0}t.exports.isEmptyString=l;function u(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}t.exports.isObject=u;function d(e){return!!e&&Object.getPrototypeOf(e)===URL.prototype}t.exports.isUrl=d;function f(e){return Array.isArray(e)?[...e]:e}t.exports.cloneIfArray=f;function p(e){return d(e)?new URL(e):e}t.exports.cloneIfUrl=p,t.exports.getHtmlAttributeRe=function(e){return RegExp(`\\s${e}\\s*=\\s*['"]?([^'"\\s>]*)`,`iu`)};function m(e){return!e||!e.trim()||!(e=>{for(;;){let t=e.indexOf(`<!--`),n=e.indexOf(`-->`);if(n!==-1&&(t===-1||n<t))e=e.slice(n+3);else if(t!==-1&&n!==-1)e=e.slice(0,t)+e.slice(n+3);else if(t!==-1&&n===-1)e=e.slice(0,t);else return e}})(e).replace(/>/g,``).trim()}t.exports.isBlankLine=m;var h=`<!--`,g=`-->`,_=`.`,v=/^ *\|/,y=/[^\r\n]/g,b=/[^ \r\n]/g,x=/ +[\r\n]/g,S=e=>e.replace(y,_);t.exports.clearHtmlCommentText=function(e){let t=0;for(;(t=e.indexOf(h,t))!==-1;){let n=e.indexOf(g,t+2);if(n===-1)break;if(n>t+4){let r=e.slice(t+4,n),i=e.lastIndexOf(`
368
+ deps: ${r}}`};var i={keyword:`dependencies`,type:`object`,schemaType:`object`,error:e.error,code(e){let[t,n]=a(e);o(e,t),s(e,n)}};function a({schema:e}){let t={},n={};for(let r in e){if(r===`__proto__`)continue;let i=Array.isArray(e[r])?t:n;i[r]=e[r]}return[t,n]}function o(e,n=e.schema){let{gen:i,data:a,it:o}=e;if(Object.keys(n).length===0)return;let s=i.let(`missing`);for(let c in n){let l=n[c];if(l.length===0)continue;let u=(0,r.propertyInData)(i,a,c,o.opts.ownProperties);e.setParams({property:c,depsCount:l.length,deps:l.join(`, `)}),o.allErrors?i.if(u,()=>{for(let t of l)(0,r.checkReportMissingProp)(e,t)}):(i.if((0,t._)`${u} && (${(0,r.checkMissingProp)(e,l,s)})`),(0,r.reportMissingProp)(e,s),i.else())}}e.validatePropertyDeps=o;function s(e,t=e.schema){let{gen:i,data:a,keyword:o,it:s}=e,c=i.name(`valid`);for(let l in t)(0,n.alwaysValidSchema)(s,t[l])||(i.if((0,r.propertyInData)(i,a,l,s.opts.ownProperties),()=>{let t=e.subschema({keyword:o,schemaProp:l},c);e.mergeValidEvaluated(t,c)},()=>i.var(c,!0)),e.ok(c))}e.validateSchemaDeps=s,e.default=i})),iL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=aI();e.default={keyword:`propertyNames`,type:`object`,schemaType:[`object`,`boolean`],error:{message:`property name must be valid`,params:({params:e})=>(0,t._)`{propertyName: ${e.propertyName}}`},code(e){let{gen:r,schema:i,data:a,it:o}=e;if((0,n.alwaysValidSchema)(o,i))return;let s=r.name(`valid`);r.forIn(`key`,a,n=>{e.setParams({propertyName:n}),e.subschema({keyword:`propertyNames`,data:n,dataTypes:[`string`],propertyName:n,compositeRule:!0},s),r.if((0,t.not)(s),()=>{e.error(!0),o.allErrors||r.break()})}),e.ok(s)}}})),aL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=pI(),n=X(),r=oI(),i=aI();e.default={keyword:`additionalProperties`,type:[`object`],schemaType:[`boolean`,`object`],allowUndefined:!0,trackErrors:!0,error:{message:`must NOT have additional properties`,params:({params:e})=>(0,n._)`{additionalProperty: ${e.additionalProperty}}`},code(e){let{gen:a,schema:o,parentSchema:s,data:c,errsCount:l,it:u}=e;if(!l)throw Error(`ajv implementation error`);let{allErrors:d,opts:f}=u;if(u.props=!0,f.removeAdditional!==`all`&&(0,i.alwaysValidSchema)(u,o))return;let p=(0,t.allSchemaProperties)(s.properties),m=(0,t.allSchemaProperties)(s.patternProperties);h(),e.ok((0,n._)`${l} === ${r.default.errors}`);function h(){a.forIn(`key`,c,e=>{!p.length&&!m.length?v(e):a.if(g(e),()=>v(e))})}function g(r){let o;if(p.length>8){let e=(0,i.schemaRefOrVal)(u,s.properties,`properties`);o=(0,t.isOwnProperty)(a,e,r)}else o=p.length?(0,n.or)(...p.map(e=>(0,n._)`${r} === ${e}`)):n.nil;return m.length&&(o=(0,n.or)(o,...m.map(i=>(0,n._)`${(0,t.usePattern)(e,i)}.test(${r})`))),(0,n.not)(o)}function _(e){a.code((0,n._)`delete ${c}[${e}]`)}function v(t){if(f.removeAdditional===`all`||f.removeAdditional&&o===!1){_(t);return}if(o===!1){e.setParams({additionalProperty:t}),e.error(),d||a.break();return}if(typeof o==`object`&&!(0,i.alwaysValidSchema)(u,o)){let r=a.name(`valid`);f.removeAdditional===`failing`?(y(t,r,!1),a.if((0,n.not)(r),()=>{e.reset(),_(t)})):(y(t,r),d||a.if((0,n.not)(r),()=>a.break()))}}function y(t,n,r){let a={keyword:`additionalProperties`,dataProp:t,dataPropType:i.Type.Str};r===!1&&Object.assign(a,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(a,n)}}}})),oL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=yI(),n=pI(),r=aI(),i=aL();e.default={keyword:`properties`,type:`object`,schemaType:`object`,code(e){let{gen:a,schema:o,parentSchema:s,data:c,it:l}=e;l.opts.removeAdditional===`all`&&s.additionalProperties===void 0&&i.default.code(new t.KeywordCxt(l,i.default,`additionalProperties`));let u=(0,n.allSchemaProperties)(o);for(let e of u)l.definedProperties.add(e);l.opts.unevaluated&&u.length&&l.props!==!0&&(l.props=r.mergeEvaluated.props(a,(0,r.toHash)(u),l.props));let d=u.filter(e=>!(0,r.alwaysValidSchema)(l,o[e]));if(d.length===0)return;let f=a.name(`valid`);for(let t of d)p(t)?m(t):(a.if((0,n.propertyInData)(a,c,t,l.opts.ownProperties)),m(t),l.allErrors||a.else().var(f,!0),a.endIf()),e.it.definedProperties.add(t),e.ok(f);function p(e){return l.opts.useDefaults&&!l.compositeRule&&o[e].default!==void 0}function m(t){e.subschema({keyword:`properties`,schemaProp:t,dataProp:t},f)}}}})),sL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=pI(),n=X(),r=aI(),i=aI();e.default={keyword:`patternProperties`,type:`object`,schemaType:`object`,code(e){let{gen:a,schema:o,data:s,parentSchema:c,it:l}=e,{opts:u}=l,d=(0,t.allSchemaProperties)(o),f=d.filter(e=>(0,r.alwaysValidSchema)(l,o[e]));if(d.length===0||f.length===d.length&&(!l.opts.unevaluated||l.props===!0))return;let p=u.strictSchema&&!u.allowMatchingProperties&&c.properties,m=a.name(`valid`);l.props!==!0&&!(l.props instanceof n.Name)&&(l.props=(0,i.evaluatedPropsToName)(a,l.props));let{props:h}=l;g();function g(){for(let e of d)p&&_(e),l.allErrors?v(e):(a.var(m,!0),v(e),a.if(m))}function _(e){for(let t in p)new RegExp(e).test(t)&&(0,r.checkStrictMode)(l,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function v(r){a.forIn(`key`,s,o=>{a.if((0,n._)`${(0,t.usePattern)(e,r)}.test(${o})`,()=>{let t=f.includes(r);t||e.subschema({keyword:`patternProperties`,schemaProp:r,dataProp:o,dataPropType:i.Type.Str},m),l.opts.unevaluated&&h!==!0?a.assign((0,n._)`${h}[${o}]`,!0):!t&&!l.allErrors&&a.if((0,n.not)(m),()=>a.break())})})}}}})),cL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=aI();e.default={keyword:`not`,schemaType:[`object`,`boolean`],trackErrors:!0,code(e){let{gen:n,schema:r,it:i}=e;if((0,t.alwaysValidSchema)(i,r)){e.fail();return}let a=n.name(`valid`);e.subschema({keyword:`not`,compositeRule:!0,createErrors:!1,allErrors:!1},a),e.failResult(a,()=>e.reset(),()=>e.error())},error:{message:`must NOT be valid`}}})),lL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={keyword:`anyOf`,schemaType:`array`,trackErrors:!0,code:pI().validateUnion,error:{message:`must match a schema in anyOf`}}})),uL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=aI();e.default={keyword:`oneOf`,schemaType:`array`,trackErrors:!0,error:{message:`must match exactly one schema in oneOf`,params:({params:e})=>(0,t._)`{passingSchemas: ${e.passing}}`},code(e){let{gen:r,schema:i,parentSchema:a,it:o}=e;if(!Array.isArray(i))throw Error(`ajv implementation error`);if(o.opts.discriminator&&a.discriminator)return;let s=i,c=r.let(`valid`,!1),l=r.let(`passing`,null),u=r.name(`_valid`);e.setParams({passing:l}),r.block(d),e.result(c,()=>e.reset(),()=>e.error(!0));function d(){s.forEach((i,a)=>{let s;(0,n.alwaysValidSchema)(o,i)?r.var(u,!0):s=e.subschema({keyword:`oneOf`,schemaProp:a,compositeRule:!0},u),a>0&&r.if((0,t._)`${u} && ${c}`).assign(c,!1).assign(l,(0,t._)`[${l}, ${a}]`).else(),r.if(u,()=>{r.assign(c,!0),r.assign(l,a),s&&e.mergeEvaluated(s,t.Name)})})}}}})),dL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=aI();e.default={keyword:`allOf`,schemaType:`array`,code(e){let{gen:n,schema:r,it:i}=e;if(!Array.isArray(r))throw Error(`ajv implementation error`);let a=n.name(`valid`);r.forEach((n,r)=>{if((0,t.alwaysValidSchema)(i,n))return;let o=e.subschema({keyword:`allOf`,schemaProp:r},a);e.ok(a),e.mergeEvaluated(o)})}}})),fL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=aI(),r={keyword:`if`,schemaType:[`object`,`boolean`],trackErrors:!0,error:{message:({params:e})=>(0,t.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,t._)`{failingKeyword: ${e.ifClause}}`},code(e){let{gen:r,parentSchema:a,it:o}=e;a.then===void 0&&a.else===void 0&&(0,n.checkStrictMode)(o,`"if" without "then" and "else" is ignored`);let s=i(o,`then`),c=i(o,`else`);if(!s&&!c)return;let l=r.let(`valid`,!0),u=r.name(`_valid`);if(d(),e.reset(),s&&c){let t=r.let(`ifClause`);e.setParams({ifClause:t}),r.if(u,f(`then`,t),f(`else`,t))}else s?r.if(u,f(`then`)):r.if((0,t.not)(u),f(`else`));e.pass(l,()=>e.error(!0));function d(){let t=e.subschema({keyword:`if`,compositeRule:!0,createErrors:!1,allErrors:!1},u);e.mergeEvaluated(t)}function f(n,i){return()=>{let a=e.subschema({keyword:n},u);r.assign(l,u),e.mergeValidEvaluated(a,l),i?r.assign(i,(0,t._)`${n}`):e.setParams({ifClause:n})}}}};function i(e,t){let r=e.schema[t];return r!==void 0&&!(0,n.alwaysValidSchema)(e,r)}e.default=r})),pL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=aI();e.default={keyword:[`then`,`else`],schemaType:[`object`,`boolean`],code({keyword:e,parentSchema:n,it:r}){n.if===void 0&&(0,t.checkStrictMode)(r,`"${e}" without "if" is ignored`)}}})),mL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=QI(),n=eL(),r=$I(),i=tL(),a=nL(),o=rL(),s=iL(),c=aL(),l=oL(),u=sL(),d=cL(),f=lL(),p=uL(),m=dL(),h=fL(),g=pL();function _(e=!1){let _=[d.default,f.default,p.default,m.default,h.default,g.default,s.default,c.default,o.default,l.default,u.default];return e?_.push(n.default,i.default):_.push(t.default,r.default),_.push(a.default),_}e.default=_})),hL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X();e.default={keyword:`format`,type:[`number`,`string`],schemaType:`string`,$data:!0,error:{message:({schemaCode:e})=>(0,t.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,t._)`{format: ${e}}`},code(e,n){let{gen:r,data:i,$data:a,schema:o,schemaCode:s,it:c}=e,{opts:l,errSchemaPath:u,schemaEnv:d,self:f}=c;if(!l.validateFormats)return;a?p():m();function p(){let a=r.scopeValue(`formats`,{ref:f.formats,code:l.code.formats}),o=r.const(`fDef`,(0,t._)`${a}[${s}]`),c=r.let(`fType`),u=r.let(`format`);r.if((0,t._)`typeof ${o} == "object" && !(${o} instanceof RegExp)`,()=>r.assign(c,(0,t._)`${o}.type || "string"`).assign(u,(0,t._)`${o}.validate`),()=>r.assign(c,(0,t._)`"string"`).assign(u,o)),e.fail$data((0,t.or)(p(),m()));function p(){return l.strictSchema===!1?t.nil:(0,t._)`${s} && !${u}`}function m(){let e=d.$async?(0,t._)`(${o}.async ? await ${u}(${i}) : ${u}(${i}))`:(0,t._)`${u}(${i})`,r=(0,t._)`(typeof ${u} == "function" ? ${e} : ${u}.test(${i}))`;return(0,t._)`${u} && ${u} !== true && ${c} === ${n} && !${r}`}}function m(){let a=f.formats[o];if(!a){m();return}if(a===!0)return;let[s,c,p]=h(a);s===n&&e.pass(g());function m(){if(l.strictSchema===!1){f.logger.warn(e());return}throw Error(e());function e(){return`unknown format "${o}" ignored in schema at path "${u}"`}}function h(e){let n=e instanceof RegExp?(0,t.regexpCode)(e):l.code.formats?(0,t._)`${l.code.formats}${(0,t.getProperty)(o)}`:void 0,i=r.scopeValue(`formats`,{key:o,ref:e,code:n});return typeof e==`object`&&!(e instanceof RegExp)?[e.type||`string`,e.validate,(0,t._)`${i}.validate`]:[`string`,e,i]}function g(){if(typeof a==`object`&&!(a instanceof RegExp)&&a.async){if(!d.$async)throw Error(`async format in sync schema`);return(0,t._)`await ${p}(${i})`}return typeof c==`function`?(0,t._)`${p}(${i})`:(0,t._)`${p}.test(${i})`}}}}})),gL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=[hL().default]})),_L=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.contentVocabulary=e.metadataVocabulary=void 0,e.metadataVocabulary=[`title`,`description`,`default`,`deprecated`,`readOnly`,`writeOnly`,`examples`],e.contentVocabulary=[`contentMediaType`,`contentEncoding`,`contentSchema`]})),vL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=RI(),n=ZI(),r=mL(),i=gL(),a=_L();e.default=[t.default,n.default,(0,r.default)(),i.default,a.metadataVocabulary,a.contentVocabulary]})),yL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DiscrError=void 0;var t;(function(e){e.Tag=`tag`,e.Mapping=`mapping`})(t||(e.DiscrError=t={}))})),bL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=yL(),r=SI(),i=xI(),a=aI();e.default={keyword:`discriminator`,type:`object`,schemaType:`object`,error:{message:({params:{discrError:e,tagName:t}})=>e===n.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:n,tagName:r}})=>(0,t._)`{error: ${e}, tag: ${r}, tagValue: ${n}}`},code(e){let{gen:o,data:s,schema:c,parentSchema:l,it:u}=e,{oneOf:d}=l;if(!u.opts.discriminator)throw Error(`discriminator: requires discriminator option`);let f=c.propertyName;if(typeof f!=`string`)throw Error(`discriminator: requires propertyName`);if(c.mapping)throw Error(`discriminator: mapping is not supported`);if(!d)throw Error(`discriminator: requires oneOf keyword`);let p=o.let(`valid`,!1),m=o.const(`tag`,(0,t._)`${s}${(0,t.getProperty)(f)}`);o.if((0,t._)`typeof ${m} == "string"`,()=>h(),()=>e.error(!1,{discrError:n.DiscrError.Tag,tag:m,tagName:f})),e.ok(p);function h(){let r=_();o.if(!1);for(let e in r)o.elseIf((0,t._)`${m} === ${e}`),o.assign(p,g(r[e]));o.else(),e.error(!1,{discrError:n.DiscrError.Mapping,tag:m,tagName:f}),o.endIf()}function g(n){let r=o.name(`valid`),i=e.subschema({keyword:`oneOf`,schemaProp:n},r);return e.mergeEvaluated(i,t.Name),r}function _(){let e={},t=o(l),n=!0;for(let e=0;e<d.length;e++){let c=d[e];if(c?.$ref&&!(0,a.schemaHasRulesButRef)(c,u.self.RULES)){let e=c.$ref;if(c=r.resolveRef.call(u.self,u.schemaEnv.root,u.baseId,e),c instanceof r.SchemaEnv&&(c=c.schema),c===void 0)throw new i.default(u.opts.uriResolver,u.baseId,e)}let l=c?.properties?.[f];if(typeof l!=`object`)throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${f}"`);n&&=t||o(c),s(l,e)}if(!n)throw Error(`discriminator: "${f}" must be required`);return e;function o({required:e}){return Array.isArray(e)&&e.includes(f)}function s(e,t){if(e.const)c(e.const,t);else if(e.enum)for(let n of e.enum)c(n,t);else throw Error(`discriminator: "properties/${f}" must have "const" or "enum"`)}function c(t,n){if(typeof t!=`string`||t in e)throw Error(`discriminator: "${f}" values must be unique strings`);e[t]=n}}}}})),xL=i({$id:()=>CL,$schema:()=>SL,default:()=>OL,definitions:()=>TL,properties:()=>DL,title:()=>wL,type:()=>EL}),SL,CL,wL,TL,EL,DL,OL,kL=n((()=>{SL=`http://json-schema.org/draft-07/schema#`,CL=`http://json-schema.org/draft-07/schema#`,wL=`Core schema meta-schema`,TL={schemaArray:{type:`array`,minItems:1,items:{$ref:`#`}},nonNegativeInteger:{type:`integer`,minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:`#/definitions/nonNegativeInteger`},{default:0}]},simpleTypes:{enum:[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]},stringArray:{type:`array`,items:{type:`string`},uniqueItems:!0,default:[]}},EL=[`object`,`boolean`],DL={$id:{type:`string`,format:`uri-reference`},$schema:{type:`string`,format:`uri`},$ref:{type:`string`,format:`uri-reference`},$comment:{type:`string`},title:{type:`string`},description:{type:`string`},default:!0,readOnly:{type:`boolean`,default:!1},examples:{type:`array`,items:!0},multipleOf:{type:`number`,exclusiveMinimum:0},maximum:{type:`number`},exclusiveMaximum:{type:`number`},minimum:{type:`number`},exclusiveMinimum:{type:`number`},maxLength:{$ref:`#/definitions/nonNegativeInteger`},minLength:{$ref:`#/definitions/nonNegativeIntegerDefault0`},pattern:{type:`string`,format:`regex`},additionalItems:{$ref:`#`},items:{anyOf:[{$ref:`#`},{$ref:`#/definitions/schemaArray`}],default:!0},maxItems:{$ref:`#/definitions/nonNegativeInteger`},minItems:{$ref:`#/definitions/nonNegativeIntegerDefault0`},uniqueItems:{type:`boolean`,default:!1},contains:{$ref:`#`},maxProperties:{$ref:`#/definitions/nonNegativeInteger`},minProperties:{$ref:`#/definitions/nonNegativeIntegerDefault0`},required:{$ref:`#/definitions/stringArray`},additionalProperties:{$ref:`#`},definitions:{type:`object`,additionalProperties:{$ref:`#`},default:{}},properties:{type:`object`,additionalProperties:{$ref:`#`},default:{}},patternProperties:{type:`object`,additionalProperties:{$ref:`#`},propertyNames:{format:`regex`},default:{}},dependencies:{type:`object`,additionalProperties:{anyOf:[{$ref:`#`},{$ref:`#/definitions/stringArray`}]}},propertyNames:{$ref:`#`},const:!0,enum:{type:`array`,items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:`#/definitions/simpleTypes`},{type:`array`,items:{$ref:`#/definitions/simpleTypes`},minItems:1,uniqueItems:!0}]},format:{type:`string`},contentMediaType:{type:`string`},contentEncoding:{type:`string`},if:{$ref:`#`},then:{$ref:`#`},else:{$ref:`#`},allOf:{$ref:`#/definitions/schemaArray`},anyOf:{$ref:`#/definitions/schemaArray`},oneOf:{$ref:`#/definitions/schemaArray`},not:{$ref:`#`}},OL={$schema:SL,$id:CL,title:wL,definitions:TL,type:EL,properties:DL,default:!0}})),AL=a(((t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;var r=FI(),i=vL(),a=bL(),o=(kL(),e(xL).default),s=[`/properties`],c=`http://json-schema.org/draft-07/schema`,l=class extends r.default{_addVocabularies(){super._addVocabularies(),i.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(a.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(o,s):o;this.addMetaSchema(e,c,!1),this.refs[`http://json-schema.org/schema`]=c}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:void 0)}};t.Ajv=l,n.exports=t=l,n.exports.Ajv=l,Object.defineProperty(t,`__esModule`,{value:!0}),t.default=l;var u=yI();Object.defineProperty(t,`KeywordCxt`,{enumerable:!0,get:function(){return u.KeywordCxt}});var d=X();Object.defineProperty(t,`_`,{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,`str`,{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,`stringify`,{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,`nil`,{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,`Name`,{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,`CodeGen`,{enumerable:!0,get:function(){return d.CodeGen}});var f=bI();Object.defineProperty(t,`ValidationError`,{enumerable:!0,get:function(){return f.default}});var p=xI();Object.defineProperty(t,`MissingRefError`,{enumerable:!0,get:function(){return p.default}})})),jL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.dynamicAnchor=void 0;var t=X(),n=oI(),r=SI(),i=LI(),a={keyword:`$dynamicAnchor`,schemaType:`string`,code:e=>o(e,e.schema)};function o(e,r){let{gen:i,it:a}=e;a.schemaEnv.root.dynamicAnchors[r]=!0;let o=(0,t._)`${n.default.dynamicAnchors}${(0,t.getProperty)(r)}`,c=a.errSchemaPath===`#`?a.validateName:s(e);i.if((0,t._)`!${o}`,()=>i.assign(o,c))}e.dynamicAnchor=o;function s(e){let{schemaEnv:t,schema:n,self:a}=e.it,{root:o,baseId:s,localRefs:c,meta:l}=t.root,{schemaId:u}=a.opts,d=new r.SchemaEnv({schema:n,schemaId:u,root:o,baseId:s,localRefs:c,meta:l});return r.compileSchema.call(a,d),(0,i.getValidate)(e,d)}e.default=a})),ML=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.dynamicRef=void 0;var t=X(),n=oI(),r=LI(),i={keyword:`$dynamicRef`,schemaType:`string`,code:e=>a(e,e.schema)};function a(e,i){let{gen:a,keyword:o,it:s}=e;if(i[0]!==`#`)throw Error(`"${o}" only supports hash fragment reference`);let c=i.slice(1);if(s.allErrors)l();else{let t=a.let(`valid`,!1);l(t),e.ok(t)}function l(e){if(s.schemaEnv.root.dynamicAnchors[c]){let r=a.let(`_v`,(0,t._)`${n.default.dynamicAnchors}${(0,t.getProperty)(c)}`);a.if(r,u(r,e),u(s.validateName,e))}else u(s.validateName,e)()}function u(t,n){return n?()=>a.block(()=>{(0,r.callRef)(e,t),a.let(n,!0)}):()=>(0,r.callRef)(e,t)}}e.dynamicRef=a,e.default=i})),NL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=jL(),n=aI();e.default={keyword:`$recursiveAnchor`,schemaType:`boolean`,code(e){e.schema?(0,t.dynamicAnchor)(e,``):(0,n.checkStrictMode)(e.it,`$recursiveAnchor: false is ignored`)}}})),PL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=ML();e.default={keyword:`$recursiveRef`,schemaType:`string`,code:e=>(0,t.dynamicRef)(e,e.schema)}})),FL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=jL(),n=ML(),r=NL(),i=PL();e.default=[t.default,n.default,r.default,i.default]})),IL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=rL();e.default={keyword:`dependentRequired`,type:`object`,schemaType:`object`,error:t.error,code:e=>(0,t.validatePropertyDeps)(e)}})),LL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=rL();e.default={keyword:`dependentSchemas`,type:`object`,schemaType:`object`,code:e=>(0,t.validateSchemaDeps)(e)}})),RL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=aI();e.default={keyword:[`maxContains`,`minContains`],type:`array`,schemaType:`number`,code({keyword:e,parentSchema:n,it:r}){n.contains===void 0&&(0,t.checkStrictMode)(r,`"${e}" without "contains" is ignored`)}}})),zL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=IL(),n=LL(),r=RL();e.default=[t.default,n.default,r.default]})),BL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=aI(),r=oI();e.default={keyword:`unevaluatedProperties`,type:`object`,schemaType:[`boolean`,`object`],trackErrors:!0,error:{message:`must NOT have unevaluated properties`,params:({params:e})=>(0,t._)`{unevaluatedProperty: ${e.unevaluatedProperty}}`},code(e){let{gen:i,schema:a,data:o,errsCount:s,it:c}=e;if(!s)throw Error(`ajv implementation error`);let{allErrors:l,props:u}=c;u instanceof t.Name?i.if((0,t._)`${u} !== true`,()=>i.forIn(`key`,o,e=>i.if(f(u,e),()=>d(e)))):u!==!0&&i.forIn(`key`,o,e=>u===void 0?d(e):i.if(p(u,e),()=>d(e))),c.props=!0,e.ok((0,t._)`${s} === ${r.default.errors}`);function d(r){if(a===!1){e.setParams({unevaluatedProperty:r}),e.error(),l||i.break();return}if(!(0,n.alwaysValidSchema)(c,a)){let a=i.name(`valid`);e.subschema({keyword:`unevaluatedProperties`,dataProp:r,dataPropType:n.Type.Str},a),l||i.if((0,t.not)(a),()=>i.break())}}function f(e,n){return(0,t._)`!${e} || !${e}[${n}]`}function p(e,n){let r=[];for(let i in e)e[i]===!0&&r.push((0,t._)`${n} !== ${i}`);return(0,t.and)(...r)}}}})),VL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=X(),n=aI();e.default={keyword:`unevaluatedItems`,type:`array`,schemaType:[`boolean`,`object`],error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{gen:r,schema:i,data:a,it:o}=e,s=o.items||0;if(s===!0)return;let c=r.const(`len`,(0,t._)`${a}.length`);if(i===!1)e.setParams({len:s}),e.fail((0,t._)`${c} > ${s}`);else if(typeof i==`object`&&!(0,n.alwaysValidSchema)(o,i)){let n=r.var(`valid`,(0,t._)`${c} <= ${s}`);r.if((0,t.not)(n),()=>l(n,s)),e.ok(n)}o.items=!0;function l(i,a){r.forRange(`i`,a,c,a=>{e.subschema({keyword:`unevaluatedItems`,dataProp:a,dataPropType:n.Type.Num},i),o.allErrors||r.if((0,t.not)(i),()=>r.break())})}}}})),HL=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=BL(),n=VL();e.default=[t.default,n.default]})),UL=i({$id:()=>GL,$recursiveAnchor:()=>!0,$schema:()=>WL,$vocabulary:()=>KL,allOf:()=>JL,default:()=>ZL,properties:()=>XL,title:()=>qL,type:()=>YL}),WL,GL,KL,qL,JL,YL,XL,ZL,QL=n((()=>{WL=`https://json-schema.org/draft/2019-09/schema`,GL=`https://json-schema.org/draft/2019-09/schema`,KL={"https://json-schema.org/draft/2019-09/vocab/core":!0,"https://json-schema.org/draft/2019-09/vocab/applicator":!0,"https://json-schema.org/draft/2019-09/vocab/validation":!0,"https://json-schema.org/draft/2019-09/vocab/meta-data":!0,"https://json-schema.org/draft/2019-09/vocab/format":!1,"https://json-schema.org/draft/2019-09/vocab/content":!0},qL=`Core and Validation specifications meta-schema`,JL=[{$ref:`meta/core`},{$ref:`meta/applicator`},{$ref:`meta/validation`},{$ref:`meta/meta-data`},{$ref:`meta/format`},{$ref:`meta/content`}],YL=[`object`,`boolean`],XL={definitions:{$comment:`While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.`,type:`object`,additionalProperties:{$recursiveRef:`#`},default:{}},dependencies:{$comment:`"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"`,type:`object`,additionalProperties:{anyOf:[{$recursiveRef:`#`},{$ref:`meta/validation#/$defs/stringArray`}]}}},ZL={$schema:WL,$id:GL,$vocabulary:KL,$recursiveAnchor:!0,title:qL,allOf:JL,type:YL,properties:XL}})),$L=i({$defs:()=>oR,$id:()=>tR,$recursiveAnchor:()=>!0,$schema:()=>eR,$vocabulary:()=>nR,default:()=>sR,properties:()=>aR,title:()=>rR,type:()=>iR}),eR,tR,nR,rR,iR,aR,oR,sR,cR=n((()=>{eR=`https://json-schema.org/draft/2019-09/schema`,tR=`https://json-schema.org/draft/2019-09/meta/applicator`,nR={"https://json-schema.org/draft/2019-09/vocab/applicator":!0},rR=`Applicator vocabulary meta-schema`,iR=[`object`,`boolean`],aR={additionalItems:{$recursiveRef:`#`},unevaluatedItems:{$recursiveRef:`#`},items:{anyOf:[{$recursiveRef:`#`},{$ref:`#/$defs/schemaArray`}]},contains:{$recursiveRef:`#`},additionalProperties:{$recursiveRef:`#`},unevaluatedProperties:{$recursiveRef:`#`},properties:{type:`object`,additionalProperties:{$recursiveRef:`#`},default:{}},patternProperties:{type:`object`,additionalProperties:{$recursiveRef:`#`},propertyNames:{format:`regex`},default:{}},dependentSchemas:{type:`object`,additionalProperties:{$recursiveRef:`#`}},propertyNames:{$recursiveRef:`#`},if:{$recursiveRef:`#`},then:{$recursiveRef:`#`},else:{$recursiveRef:`#`},allOf:{$ref:`#/$defs/schemaArray`},anyOf:{$ref:`#/$defs/schemaArray`},oneOf:{$ref:`#/$defs/schemaArray`},not:{$recursiveRef:`#`}},oR={schemaArray:{type:`array`,minItems:1,items:{$recursiveRef:`#`}}},sR={$schema:eR,$id:tR,$vocabulary:nR,$recursiveAnchor:!0,title:rR,type:iR,properties:aR,$defs:oR}})),lR=i({$id:()=>dR,$recursiveAnchor:()=>!0,$schema:()=>uR,$vocabulary:()=>fR,default:()=>gR,properties:()=>hR,title:()=>pR,type:()=>mR}),uR,dR,fR,pR,mR,hR,gR,_R=n((()=>{uR=`https://json-schema.org/draft/2019-09/schema`,dR=`https://json-schema.org/draft/2019-09/meta/content`,fR={"https://json-schema.org/draft/2019-09/vocab/content":!0},pR=`Content vocabulary meta-schema`,mR=[`object`,`boolean`],hR={contentMediaType:{type:`string`},contentEncoding:{type:`string`},contentSchema:{$recursiveRef:`#`}},gR={$schema:uR,$id:dR,$vocabulary:fR,$recursiveAnchor:!0,title:pR,type:mR,properties:hR}})),vR=i({$id:()=>bR,$recursiveAnchor:()=>!0,$schema:()=>yR,$vocabulary:()=>xR,default:()=>TR,properties:()=>wR,title:()=>SR,type:()=>CR}),yR,bR,xR,SR,CR,wR,TR,ER=n((()=>{yR=`https://json-schema.org/draft/2019-09/schema`,bR=`https://json-schema.org/draft/2019-09/meta/core`,xR={"https://json-schema.org/draft/2019-09/vocab/core":!0},SR=`Core vocabulary meta-schema`,CR=[`object`,`boolean`],wR={$id:{type:`string`,format:`uri-reference`,$comment:`Non-empty fragments not allowed.`,pattern:`^[^#]*#?$`},$schema:{type:`string`,format:`uri`},$anchor:{type:`string`,pattern:`^[A-Za-z][-A-Za-z0-9.:_]*$`},$ref:{type:`string`,format:`uri-reference`},$recursiveRef:{type:`string`,format:`uri-reference`},$recursiveAnchor:{type:`boolean`,default:!1},$vocabulary:{type:`object`,propertyNames:{type:`string`,format:`uri`},additionalProperties:{type:`boolean`}},$comment:{type:`string`},$defs:{type:`object`,additionalProperties:{$recursiveRef:`#`},default:{}}},TR={$schema:yR,$id:bR,$vocabulary:xR,$recursiveAnchor:!0,title:SR,type:CR,properties:wR}})),DR=i({$id:()=>kR,$recursiveAnchor:()=>!0,$schema:()=>OR,$vocabulary:()=>AR,default:()=>PR,properties:()=>NR,title:()=>jR,type:()=>MR}),OR,kR,AR,jR,MR,NR,PR,FR=n((()=>{OR=`https://json-schema.org/draft/2019-09/schema`,kR=`https://json-schema.org/draft/2019-09/meta/format`,AR={"https://json-schema.org/draft/2019-09/vocab/format":!0},jR=`Format vocabulary meta-schema`,MR=[`object`,`boolean`],NR={format:{type:`string`}},PR={$schema:OR,$id:kR,$vocabulary:AR,$recursiveAnchor:!0,title:jR,type:MR,properties:NR}})),IR=i({$id:()=>RR,$recursiveAnchor:()=>!0,$schema:()=>LR,$vocabulary:()=>zR,default:()=>UR,properties:()=>HR,title:()=>BR,type:()=>VR}),LR,RR,zR,BR,VR,HR,UR,WR=n((()=>{LR=`https://json-schema.org/draft/2019-09/schema`,RR=`https://json-schema.org/draft/2019-09/meta/meta-data`,zR={"https://json-schema.org/draft/2019-09/vocab/meta-data":!0},BR=`Meta-data vocabulary meta-schema`,VR=[`object`,`boolean`],HR={title:{type:`string`},description:{type:`string`},default:!0,deprecated:{type:`boolean`,default:!1},readOnly:{type:`boolean`,default:!1},writeOnly:{type:`boolean`,default:!1},examples:{type:`array`,items:!0}},UR={$schema:LR,$id:RR,$vocabulary:zR,$recursiveAnchor:!0,title:BR,type:VR,properties:HR}})),GR=i({$defs:()=>QR,$id:()=>qR,$recursiveAnchor:()=>!0,$schema:()=>KR,$vocabulary:()=>JR,default:()=>$R,properties:()=>ZR,title:()=>YR,type:()=>XR}),KR,qR,JR,YR,XR,ZR,QR,$R,ez=n((()=>{KR=`https://json-schema.org/draft/2019-09/schema`,qR=`https://json-schema.org/draft/2019-09/meta/validation`,JR={"https://json-schema.org/draft/2019-09/vocab/validation":!0},YR=`Validation vocabulary meta-schema`,XR=[`object`,`boolean`],ZR={multipleOf:{type:`number`,exclusiveMinimum:0},maximum:{type:`number`},exclusiveMaximum:{type:`number`},minimum:{type:`number`},exclusiveMinimum:{type:`number`},maxLength:{$ref:`#/$defs/nonNegativeInteger`},minLength:{$ref:`#/$defs/nonNegativeIntegerDefault0`},pattern:{type:`string`,format:`regex`},maxItems:{$ref:`#/$defs/nonNegativeInteger`},minItems:{$ref:`#/$defs/nonNegativeIntegerDefault0`},uniqueItems:{type:`boolean`,default:!1},maxContains:{$ref:`#/$defs/nonNegativeInteger`},minContains:{$ref:`#/$defs/nonNegativeInteger`,default:1},maxProperties:{$ref:`#/$defs/nonNegativeInteger`},minProperties:{$ref:`#/$defs/nonNegativeIntegerDefault0`},required:{$ref:`#/$defs/stringArray`},dependentRequired:{type:`object`,additionalProperties:{$ref:`#/$defs/stringArray`}},const:!0,enum:{type:`array`,items:!0},type:{anyOf:[{$ref:`#/$defs/simpleTypes`},{type:`array`,items:{$ref:`#/$defs/simpleTypes`},minItems:1,uniqueItems:!0}]}},QR={nonNegativeInteger:{type:`integer`,minimum:0},nonNegativeIntegerDefault0:{$ref:`#/$defs/nonNegativeInteger`,default:0},simpleTypes:{enum:[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]},stringArray:{type:`array`,items:{type:`string`},uniqueItems:!0,default:[]}},$R={$schema:KR,$id:qR,$vocabulary:JR,$recursiveAnchor:!0,title:YR,type:XR,properties:ZR,$defs:QR}})),tz=a((t=>{Object.defineProperty(t,`__esModule`,{value:!0});var n=(QL(),e(UL).default),r=(cR(),e($L).default),i=(_R(),e(lR).default),a=(ER(),e(vR).default),o=(FR(),e(DR).default),s=(WR(),e(IR).default),c=(ez(),e(GR).default),l=[`/properties`];function u(e){return[n,r,i,a,t(this,o),s,t(this,c)].forEach(e=>this.addMetaSchema(e,void 0,!1)),this;function t(t,n){return e?t.$dataMetaSchema(n,l):n}}t.default=u})),nz=a(((e,t)=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2019=void 0;var n=FI(),r=vL(),i=FL(),a=zL(),o=HL(),s=bL(),c=tz(),l=`https://json-schema.org/draft/2019-09/schema`,u=class extends n.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(i.default),r.default.forEach(e=>this.addVocabulary(e)),this.addVocabulary(a.default),this.addVocabulary(o.default),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;t&&(c.default.call(this,e),this.refs[`http://json-schema.org/schema`]=l)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}};e.Ajv2019=u,t.exports=e=u,t.exports.Ajv2019=u,Object.defineProperty(e,`__esModule`,{value:!0}),e.default=u;var d=yI();Object.defineProperty(e,`KeywordCxt`,{enumerable:!0,get:function(){return d.KeywordCxt}});var f=X();Object.defineProperty(e,`_`,{enumerable:!0,get:function(){return f._}}),Object.defineProperty(e,`str`,{enumerable:!0,get:function(){return f.str}}),Object.defineProperty(e,`stringify`,{enumerable:!0,get:function(){return f.stringify}}),Object.defineProperty(e,`nil`,{enumerable:!0,get:function(){return f.nil}}),Object.defineProperty(e,`Name`,{enumerable:!0,get:function(){return f.Name}}),Object.defineProperty(e,`CodeGen`,{enumerable:!0,get:function(){return f.CodeGen}});var p=bI();Object.defineProperty(e,`ValidationError`,{enumerable:!0,get:function(){return p.default}});var m=xI();Object.defineProperty(e,`MissingRefError`,{enumerable:!0,get:function(){return m.default}})})),rz=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=RI(),n=ZI(),r=mL(),i=FL(),a=zL(),o=HL(),s=gL(),c=_L();e.default=[i.default,t.default,n.default,(0,r.default)(!0),s.default,c.metadataVocabulary,c.contentVocabulary,a.default,o.default]})),iz=i({$comment:()=>fz,$dynamicAnchor:()=>cz,$id:()=>oz,$schema:()=>az,$vocabulary:()=>sz,allOf:()=>uz,default:()=>mz,properties:()=>pz,title:()=>lz,type:()=>dz}),az,oz,sz,cz,lz,uz,dz,fz,pz,mz,hz=n((()=>{az=`https://json-schema.org/draft/2020-12/schema`,oz=`https://json-schema.org/draft/2020-12/schema`,sz={"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},cz=`meta`,lz=`Core and Validation specifications meta-schema`,uz=[{$ref:`meta/core`},{$ref:`meta/applicator`},{$ref:`meta/unevaluated`},{$ref:`meta/validation`},{$ref:`meta/meta-data`},{$ref:`meta/format-annotation`},{$ref:`meta/content`}],dz=[`object`,`boolean`],fz=`This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.`,pz={definitions:{$comment:`"definitions" has been replaced by "$defs".`,type:`object`,additionalProperties:{$dynamicRef:`#meta`},deprecated:!0,default:{}},dependencies:{$comment:`"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.`,type:`object`,additionalProperties:{anyOf:[{$dynamicRef:`#meta`},{$ref:`meta/validation#/$defs/stringArray`}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:`"$recursiveAnchor" has been replaced by "$dynamicAnchor".`,$ref:`meta/core#/$defs/anchorString`,deprecated:!0},$recursiveRef:{$comment:`"$recursiveRef" has been replaced by "$dynamicRef".`,$ref:`meta/core#/$defs/uriReferenceString`,deprecated:!0}},mz={$schema:az,$id:oz,$vocabulary:sz,$dynamicAnchor:cz,title:lz,allOf:uz,type:dz,$comment:fz,properties:pz}})),gz=i({$defs:()=>wz,$dynamicAnchor:()=>bz,$id:()=>vz,$schema:()=>_z,$vocabulary:()=>yz,default:()=>Tz,properties:()=>Cz,title:()=>xz,type:()=>Sz}),_z,vz,yz,bz,xz,Sz,Cz,wz,Tz,Ez=n((()=>{_z=`https://json-schema.org/draft/2020-12/schema`,vz=`https://json-schema.org/draft/2020-12/meta/applicator`,yz={"https://json-schema.org/draft/2020-12/vocab/applicator":!0},bz=`meta`,xz=`Applicator vocabulary meta-schema`,Sz=[`object`,`boolean`],Cz={prefixItems:{$ref:`#/$defs/schemaArray`},items:{$dynamicRef:`#meta`},contains:{$dynamicRef:`#meta`},additionalProperties:{$dynamicRef:`#meta`},properties:{type:`object`,additionalProperties:{$dynamicRef:`#meta`},default:{}},patternProperties:{type:`object`,additionalProperties:{$dynamicRef:`#meta`},propertyNames:{format:`regex`},default:{}},dependentSchemas:{type:`object`,additionalProperties:{$dynamicRef:`#meta`},default:{}},propertyNames:{$dynamicRef:`#meta`},if:{$dynamicRef:`#meta`},then:{$dynamicRef:`#meta`},else:{$dynamicRef:`#meta`},allOf:{$ref:`#/$defs/schemaArray`},anyOf:{$ref:`#/$defs/schemaArray`},oneOf:{$ref:`#/$defs/schemaArray`},not:{$dynamicRef:`#meta`}},wz={schemaArray:{type:`array`,minItems:1,items:{$dynamicRef:`#meta`}}},Tz={$schema:_z,$id:vz,$vocabulary:yz,$dynamicAnchor:bz,title:xz,type:Sz,properties:Cz,$defs:wz}})),Dz=i({$dynamicAnchor:()=>jz,$id:()=>kz,$schema:()=>Oz,$vocabulary:()=>Az,default:()=>Fz,properties:()=>Pz,title:()=>Mz,type:()=>Nz}),Oz,kz,Az,jz,Mz,Nz,Pz,Fz,Iz=n((()=>{Oz=`https://json-schema.org/draft/2020-12/schema`,kz=`https://json-schema.org/draft/2020-12/meta/unevaluated`,Az={"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},jz=`meta`,Mz=`Unevaluated applicator vocabulary meta-schema`,Nz=[`object`,`boolean`],Pz={unevaluatedItems:{$dynamicRef:`#meta`},unevaluatedProperties:{$dynamicRef:`#meta`}},Fz={$schema:Oz,$id:kz,$vocabulary:Az,$dynamicAnchor:jz,title:Mz,type:Nz,properties:Pz}})),Lz=i({$dynamicAnchor:()=>Vz,$id:()=>zz,$schema:()=>Rz,$vocabulary:()=>Bz,default:()=>Gz,properties:()=>Wz,title:()=>Hz,type:()=>Uz}),Rz,zz,Bz,Vz,Hz,Uz,Wz,Gz,Kz=n((()=>{Rz=`https://json-schema.org/draft/2020-12/schema`,zz=`https://json-schema.org/draft/2020-12/meta/content`,Bz={"https://json-schema.org/draft/2020-12/vocab/content":!0},Vz=`meta`,Hz=`Content vocabulary meta-schema`,Uz=[`object`,`boolean`],Wz={contentEncoding:{type:`string`},contentMediaType:{type:`string`},contentSchema:{$dynamicRef:`#meta`}},Gz={$schema:Rz,$id:zz,$vocabulary:Bz,$dynamicAnchor:Vz,title:Hz,type:Uz,properties:Wz}})),qz=i({$defs:()=>tB,$dynamicAnchor:()=>Zz,$id:()=>Yz,$schema:()=>Jz,$vocabulary:()=>Xz,default:()=>nB,properties:()=>eB,title:()=>Qz,type:()=>$z}),Jz,Yz,Xz,Zz,Qz,$z,eB,tB,nB,rB=n((()=>{Jz=`https://json-schema.org/draft/2020-12/schema`,Yz=`https://json-schema.org/draft/2020-12/meta/core`,Xz={"https://json-schema.org/draft/2020-12/vocab/core":!0},Zz=`meta`,Qz=`Core vocabulary meta-schema`,$z=[`object`,`boolean`],eB={$id:{$ref:`#/$defs/uriReferenceString`,$comment:`Non-empty fragments not allowed.`,pattern:`^[^#]*#?$`},$schema:{$ref:`#/$defs/uriString`},$ref:{$ref:`#/$defs/uriReferenceString`},$anchor:{$ref:`#/$defs/anchorString`},$dynamicRef:{$ref:`#/$defs/uriReferenceString`},$dynamicAnchor:{$ref:`#/$defs/anchorString`},$vocabulary:{type:`object`,propertyNames:{$ref:`#/$defs/uriString`},additionalProperties:{type:`boolean`}},$comment:{type:`string`},$defs:{type:`object`,additionalProperties:{$dynamicRef:`#meta`}}},tB={anchorString:{type:`string`,pattern:`^[A-Za-z_][-A-Za-z0-9._]*$`},uriString:{type:`string`,format:`uri`},uriReferenceString:{type:`string`,format:`uri-reference`}},nB={$schema:Jz,$id:Yz,$vocabulary:Xz,$dynamicAnchor:Zz,title:Qz,type:$z,properties:eB,$defs:tB}})),iB=i({$dynamicAnchor:()=>cB,$id:()=>oB,$schema:()=>aB,$vocabulary:()=>sB,default:()=>fB,properties:()=>dB,title:()=>lB,type:()=>uB}),aB,oB,sB,cB,lB,uB,dB,fB,pB=n((()=>{aB=`https://json-schema.org/draft/2020-12/schema`,oB=`https://json-schema.org/draft/2020-12/meta/format-annotation`,sB={"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},cB=`meta`,lB=`Format vocabulary meta-schema for annotation results`,uB=[`object`,`boolean`],dB={format:{type:`string`}},fB={$schema:aB,$id:oB,$vocabulary:sB,$dynamicAnchor:cB,title:lB,type:uB,properties:dB}})),mB=i({$dynamicAnchor:()=>vB,$id:()=>gB,$schema:()=>hB,$vocabulary:()=>_B,default:()=>SB,properties:()=>xB,title:()=>yB,type:()=>bB}),hB,gB,_B,vB,yB,bB,xB,SB,CB=n((()=>{hB=`https://json-schema.org/draft/2020-12/schema`,gB=`https://json-schema.org/draft/2020-12/meta/meta-data`,_B={"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},vB=`meta`,yB=`Meta-data vocabulary meta-schema`,bB=[`object`,`boolean`],xB={title:{type:`string`},description:{type:`string`},default:!0,deprecated:{type:`boolean`,default:!1},readOnly:{type:`boolean`,default:!1},writeOnly:{type:`boolean`,default:!1},examples:{type:`array`,items:!0}},SB={$schema:hB,$id:gB,$vocabulary:_B,$dynamicAnchor:vB,title:yB,type:bB,properties:xB}})),wB=i({$defs:()=>MB,$dynamicAnchor:()=>OB,$id:()=>EB,$schema:()=>TB,$vocabulary:()=>DB,default:()=>NB,properties:()=>jB,title:()=>kB,type:()=>AB}),TB,EB,DB,OB,kB,AB,jB,MB,NB,PB=n((()=>{TB=`https://json-schema.org/draft/2020-12/schema`,EB=`https://json-schema.org/draft/2020-12/meta/validation`,DB={"https://json-schema.org/draft/2020-12/vocab/validation":!0},OB=`meta`,kB=`Validation vocabulary meta-schema`,AB=[`object`,`boolean`],jB={type:{anyOf:[{$ref:`#/$defs/simpleTypes`},{type:`array`,items:{$ref:`#/$defs/simpleTypes`},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:`array`,items:!0},multipleOf:{type:`number`,exclusiveMinimum:0},maximum:{type:`number`},exclusiveMaximum:{type:`number`},minimum:{type:`number`},exclusiveMinimum:{type:`number`},maxLength:{$ref:`#/$defs/nonNegativeInteger`},minLength:{$ref:`#/$defs/nonNegativeIntegerDefault0`},pattern:{type:`string`,format:`regex`},maxItems:{$ref:`#/$defs/nonNegativeInteger`},minItems:{$ref:`#/$defs/nonNegativeIntegerDefault0`},uniqueItems:{type:`boolean`,default:!1},maxContains:{$ref:`#/$defs/nonNegativeInteger`},minContains:{$ref:`#/$defs/nonNegativeInteger`,default:1},maxProperties:{$ref:`#/$defs/nonNegativeInteger`},minProperties:{$ref:`#/$defs/nonNegativeIntegerDefault0`},required:{$ref:`#/$defs/stringArray`},dependentRequired:{type:`object`,additionalProperties:{$ref:`#/$defs/stringArray`}}},MB={nonNegativeInteger:{type:`integer`,minimum:0},nonNegativeIntegerDefault0:{$ref:`#/$defs/nonNegativeInteger`,default:0},simpleTypes:{enum:[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]},stringArray:{type:`array`,items:{type:`string`},uniqueItems:!0,default:[]}},NB={$schema:TB,$id:EB,$vocabulary:DB,$dynamicAnchor:OB,title:kB,type:AB,properties:jB,$defs:MB}})),FB=a((t=>{Object.defineProperty(t,`__esModule`,{value:!0});var n=(hz(),e(iz).default),r=(Ez(),e(gz).default),i=(Iz(),e(Dz).default),a=(Kz(),e(Lz).default),o=(rB(),e(qz).default),s=(pB(),e(iB).default),c=(CB(),e(mB).default),l=(PB(),e(wB).default),u=[`/properties`];function d(e){return[n,r,i,a,o,t(this,s),c,t(this,l)].forEach(e=>this.addMetaSchema(e,void 0,!1)),this;function t(t,n){return e?t.$dataMetaSchema(n,u):n}}t.default=d})),IB=a(((e,t)=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2020=void 0;var n=FI(),r=rz(),i=bL(),a=FB(),o=`https://json-schema.org/draft/2020-12/schema`,s=class extends n.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),r.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;t&&(a.default.call(this,e),this.refs[`http://json-schema.org/schema`]=o)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(o)?o:void 0)}};e.Ajv2020=s,t.exports=e=s,t.exports.Ajv2020=s,Object.defineProperty(e,`__esModule`,{value:!0}),e.default=s;var c=yI();Object.defineProperty(e,`KeywordCxt`,{enumerable:!0,get:function(){return c.KeywordCxt}});var l=X();Object.defineProperty(e,`_`,{enumerable:!0,get:function(){return l._}}),Object.defineProperty(e,`str`,{enumerable:!0,get:function(){return l.str}}),Object.defineProperty(e,`stringify`,{enumerable:!0,get:function(){return l.stringify}}),Object.defineProperty(e,`nil`,{enumerable:!0,get:function(){return l.nil}}),Object.defineProperty(e,`Name`,{enumerable:!0,get:function(){return l.Name}}),Object.defineProperty(e,`CodeGen`,{enumerable:!0,get:function(){return l.CodeGen}});var u=bI();Object.defineProperty(e,`ValidationError`,{enumerable:!0,get:function(){return u.default}});var d=xI();Object.defineProperty(e,`MissingRefError`,{enumerable:!0,get:function(){return d.default}})})),LB=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(e,t){return{validate:e,compare:t}}e.fullFormats={date:t(a,o),time:t(c(!0),l),"date-time":t(f(!0),p),"iso-time":t(c(),u),"iso-date-time":t(f(),m),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:_,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:E,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:y,int32:{type:`number`,validate:S},int64:{type:`number`,validate:C},float:{type:`number`,validate:w},double:{type:`number`,validate:w},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,o),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,l),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,p),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,u),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,m),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function n(e){return e%4==0&&(e%100!=0||e%400==0)}var r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,i=[0,31,28,31,30,31,30,31,31,30,31,30,31];function a(e){let t=r.exec(e);if(!t)return!1;let a=+t[1],o=+t[2],s=+t[3];return o>=1&&o<=12&&s>=1&&s<=(o===2&&n(a)?29:i[o])}function o(e,t){if(e&&t)return e>t?1:e<t?-1:0}var s=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function c(e){return function(t){let n=s.exec(t);if(!n)return!1;let r=+n[1],i=+n[2],a=+n[3],o=n[4],c=n[5]===`-`?-1:1,l=+(n[6]||0),u=+(n[7]||0);if(l>23||u>59||e&&!o)return!1;if(r<=23&&i<=59&&a<60)return!0;let d=i-u*c,f=r-l*c-+(d<0);return(f===23||f===-1)&&(d===59||d===-1)&&a<61}}function l(e,t){if(!(e&&t))return;let n=new Date(`2020-01-01T`+e).valueOf(),r=new Date(`2020-01-01T`+t).valueOf();if(n&&r)return n-r}function u(e,t){if(!(e&&t))return;let n=s.exec(e),r=s.exec(t);if(n&&r)return e=n[1]+n[2]+n[3],t=r[1]+r[2]+r[3],e>t?1:e<t?-1:0}var d=/t|\s/i;function f(e){let t=c(e);return function(e){let n=e.split(d);return n.length===2&&a(n[0])&&t(n[1])}}function p(e,t){if(!(e&&t))return;let n=new Date(e).valueOf(),r=new Date(t).valueOf();if(n&&r)return n-r}function m(e,t){if(!(e&&t))return;let[n,r]=e.split(d),[i,a]=t.split(d),s=o(n,i);if(s!==void 0)return s||l(r,a)}var h=/\/|:/,g=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function _(e){return h.test(e)&&g.test(e)}var v=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function y(e){return v.lastIndex=0,v.test(e)}var b=-(2**31),x=2**31-1;function S(e){return Number.isInteger(e)&&e<=x&&e>=b}function C(e){return Number.isInteger(e)}function w(){return!0}var T=/[^\\]\\Z/;function E(e){if(T.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}})),RB=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.formatLimitDefinition=void 0;var t=AL(),n=X(),r=n.operators,i={formatMaximum:{okStr:`<=`,ok:r.LTE,fail:r.GT},formatMinimum:{okStr:`>=`,ok:r.GTE,fail:r.LT},formatExclusiveMaximum:{okStr:`<`,ok:r.LT,fail:r.GTE},formatExclusiveMinimum:{okStr:`>`,ok:r.GT,fail:r.LTE}};e.formatLimitDefinition={keyword:Object.keys(i),type:`string`,schemaType:`string`,$data:!0,error:{message:({keyword:e,schemaCode:t})=>(0,n.str)`should be ${i[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,n._)`{comparison: ${i[e].okStr}, limit: ${t}}`},code(e){let{gen:r,data:a,schemaCode:o,keyword:s,it:c}=e,{opts:l,self:u}=c;if(!l.validateFormats)return;let d=new t.KeywordCxt(c,u.RULES.all.format.definition,`format`);d.$data?f():p();function f(){let t=r.scopeValue(`formats`,{ref:u.formats,code:l.code.formats}),i=r.const(`fmt`,(0,n._)`${t}[${d.schemaCode}]`);e.fail$data((0,n.or)((0,n._)`typeof ${i} != "object"`,(0,n._)`${i} instanceof RegExp`,(0,n._)`typeof ${i}.compare != "function"`,m(i)))}function p(){let t=d.schema,i=u.formats[t];if(!i||i===!0)return;if(typeof i!=`object`||i instanceof RegExp||typeof i.compare!=`function`)throw Error(`"${s}": format "${t}" does not define "compare" function`);let a=r.scopeValue(`formats`,{key:t,ref:i,code:l.code.formats?(0,n._)`${l.code.formats}${(0,n.getProperty)(t)}`:void 0});e.fail$data(m(a))}function m(e){return(0,n._)`${e}.compare(${a}, ${o}) ${i[s].fail} 0`}},dependencies:[`format`]},e.default=t=>(t.addKeyword(e.formatLimitDefinition),t)})),zB=a(((e,t)=>{Object.defineProperty(e,`__esModule`,{value:!0});var n=LB(),r=RB(),i=X(),a=new i.Name(`fullFormats`),o=new i.Name(`fastFormats`),s=(e,t={keywords:!0})=>{if(Array.isArray(t))return c(e,t,n.fullFormats,a),e;let[i,s]=t.mode===`fast`?[n.fastFormats,o]:[n.fullFormats,a];return c(e,t.formats||n.formatNames,i,s),t.keywords&&(0,r.default)(e),e};s.get=(e,t=`full`)=>{let r=(t===`fast`?n.fastFormats:n.fullFormats)[e];if(!r)throw Error(`Unknown format "${e}"`);return r};function c(e,t,n,r){var a;(a=e.opts.code).formats??(a.formats=(0,i._)`require("ajv-formats/dist/formats").${r}`);for(let r of t)e.addFormat(r,n[r])}t.exports=e=s,Object.defineProperty(e,`__esModule`,{value:!0}),e.default=s})),BB=a(((e,t)=>{var n=`\\\\/`,r=`[^${n}]`,i=0,a=`\\.`,o=`\\+`,s=`\\?`,c=`\\/`,l=`(?=.)`,u=`[^/]`,d=`(?:${c}|$)`,f=`(?:^|${c})`,p=`${a}{1,2}${d}`,m={DOT_LITERAL:a,PLUS_LITERAL:o,QMARK_LITERAL:s,SLASH_LITERAL:c,ONE_CHAR:l,QMARK:u,END_ANCHOR:d,DOTS_SLASH:p,NO_DOT:`(?!${a})`,NO_DOTS:`(?!${f}${p})`,NO_DOT_SLASH:`(?!${a}{0,1}${d})`,NO_DOTS_SLASH:`(?!${p})`,QMARK_NO_DOT:`[^.${c}]`,STAR:`${u}*?`,START_ANCHOR:f,SEP:`/`},h={...m,SLASH_LITERAL:`[${n}]`,QMARK:r,STAR:`${r}*?`,DOTS_SLASH:`${a}{1,2}(?:[${n}]|$)`,NO_DOT:`(?!${a})`,NO_DOTS:`(?!(?:^|[${n}])${a}{1,2}(?:[${n}]|$))`,NO_DOT_SLASH:`(?!${a}{0,1}(?:[${n}]|$))`,NO_DOTS_SLASH:`(?!${a}{1,2}(?:[${n}]|$))`,QMARK_NO_DOT:`[^.${n}]`,START_ANCHOR:`(?:^|[${n}])`,END_ANCHOR:`(?:[${n}]|$)`,SEP:`\\`};t.exports={DEFAULT_MAX_EXTGLOB_RECURSION:i,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:{__proto__:null,alnum:`a-zA-Z0-9`,alpha:`a-zA-Z`,ascii:`\\x00-\\x7F`,blank:` \\t`,cntrl:`\\x00-\\x1F\\x7F`,digit:`0-9`,graph:`\\x21-\\x7E`,lower:`a-z`,print:`\\x20-\\x7E `,punct:`\\-!"#$%&'()\\*+,./:;<=>?@[\\]^_\`{|}~`,space:` \\t\\r\\n\\v\\f`,upper:`A-Z`,word:`A-Za-z0-9_`,xdigit:`A-Fa-f0-9`},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":`*`,"**/**":`**`,"**/**/**":`**`},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(e){return{"!":{type:`negate`,open:`(?:(?!(?:`,close:`))${e.STAR})`},"?":{type:`qmark`,open:`(?:`,close:`)?`},"+":{type:`plus`,open:`(?:`,close:`)+`},"*":{type:`star`,open:`(?:`,close:`)*`},"@":{type:`at`,open:`(?:`,close:`)`}}},globChars(e){return e===!0?h:m}}})),VB=a((e=>{var{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:i}=BB();e.isObject=e=>typeof e==`object`&&!!e&&!Array.isArray(e),e.hasRegexChars=e=>r.test(e),e.isRegexChar=t=>t.length===1&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(i,`\\$1`),e.toPosixSlashes=e=>e.replace(t,`/`),e.isWindows=()=>{if(typeof navigator<`u`&&navigator.platform){let e=navigator.platform.toLowerCase();return e===`win32`||e===`windows`}return typeof process<`u`&&process.platform?process.platform===`win32`:!1},e.removeBackslashes=e=>e.replace(n,e=>e===`\\`?``:e),e.escapeLast=(t,n,r)=>{let i=t.lastIndexOf(n,r);return i===-1?t:t[i-1]===`\\`?e.escapeLast(t,n,i-1):`${t.slice(0,i)}\\${t.slice(i)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith(`./`)&&(n=n.slice(2),t.prefix=`./`),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?``:`^`}(?:${e})${n.contains?``:`$`}`;return t.negated===!0&&(r=`(?:^(?!${r}).*$)`),r},e.basename=(e,{windows:t}={})=>{let n=e.split(t?/[\\/]/:`/`),r=n[n.length-1];return r===``?n[n.length-2]:r}})),HB=a(((e,t)=>{var n=VB(),{CHAR_ASTERISK:r,CHAR_AT:i,CHAR_BACKWARD_SLASH:a,CHAR_COMMA:o,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:c,CHAR_FORWARD_SLASH:l,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:d,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_PLUS:p,CHAR_QUESTION_MARK:m,CHAR_RIGHT_CURLY_BRACE:h,CHAR_RIGHT_PARENTHESES:g,CHAR_RIGHT_SQUARE_BRACKET:_}=BB(),v=e=>e===l||e===a,y=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)};t.exports=(e,t)=>{let b=t||{},x=e.length-1,S=b.parts===!0||b.scanToEnd===!0,C=[],w=[],T=[],E=e,ee=-1,te=0,D=0,ne=!1,re=!1,ie=!1,ae=!1,oe=!1,se=!1,ce=!1,O=!1,le=!1,ue=!1,de=0,k,A,fe={value:``,depth:0,isGlob:!1},pe=()=>ee>=x,me=()=>E.charCodeAt(ee+1),he=()=>(k=A,E.charCodeAt(++ee));for(;ee<x;){A=he();let e;if(A===a){ce=fe.backslashes=!0,A=he(),A===u&&(se=!0);continue}if(se===!0||A===u){for(de++;pe()!==!0&&(A=he());){if(A===a){ce=fe.backslashes=!0,he();continue}if(A===u){de++;continue}if(se!==!0&&A===s&&(A=he())===s){if(ne=fe.isBrace=!0,ie=fe.isGlob=!0,ue=!0,S===!0)continue;break}if(se!==!0&&A===o){if(ne=fe.isBrace=!0,ie=fe.isGlob=!0,ue=!0,S===!0)continue;break}if(A===h&&(de--,de===0)){se=!1,ne=fe.isBrace=!0,ue=!0;break}}if(S===!0)continue;break}if(A===l){if(C.push(ee),w.push(fe),fe={value:``,depth:0,isGlob:!1},ue===!0)continue;if(k===s&&ee===te+1){te+=2;continue}D=ee+1;continue}if(b.noext!==!0&&(A===p||A===i||A===r||A===m||A===c)&&me()===d){if(ie=fe.isGlob=!0,ae=fe.isExtglob=!0,ue=!0,A===c&&ee===te&&(le=!0),S===!0){for(;pe()!==!0&&(A=he());){if(A===a){ce=fe.backslashes=!0,A=he();continue}if(A===g){ie=fe.isGlob=!0,ue=!0;break}}continue}break}if(A===r){if(k===r&&(oe=fe.isGlobstar=!0),ie=fe.isGlob=!0,ue=!0,S===!0)continue;break}if(A===m){if(ie=fe.isGlob=!0,ue=!0,S===!0)continue;break}if(A===f){for(;pe()!==!0&&(e=he());){if(e===a){ce=fe.backslashes=!0,he();continue}if(e===_){re=fe.isBracket=!0,ie=fe.isGlob=!0,ue=!0;break}}if(S===!0)continue;break}if(b.nonegate!==!0&&A===c&&ee===te){O=fe.negated=!0,te++;continue}if(b.noparen!==!0&&A===d){if(ie=fe.isGlob=!0,S===!0){for(;pe()!==!0&&(A=he());){if(A===d){ce=fe.backslashes=!0,A=he();continue}if(A===g){ue=!0;break}}continue}break}if(ie===!0){if(ue=!0,S===!0)continue;break}}b.noext===!0&&(ae=!1,ie=!1);let ge=E,_e=``,ve=``;te>0&&(_e=E.slice(0,te),E=E.slice(te),D-=te),ge&&ie===!0&&D>0?(ge=E.slice(0,D),ve=E.slice(D)):ie===!0?(ge=``,ve=E):ge=E,ge&&ge!==``&&ge!==`/`&&ge!==E&&v(ge.charCodeAt(ge.length-1))&&(ge=ge.slice(0,-1)),b.unescape===!0&&(ve&&=n.removeBackslashes(ve),ge&&ce===!0&&(ge=n.removeBackslashes(ge)));let ye={prefix:_e,input:e,start:te,base:ge,glob:ve,isBrace:ne,isBracket:re,isGlob:ie,isExtglob:ae,isGlobstar:oe,negated:O,negatedExtglob:le};if(b.tokens===!0&&(ye.maxDepth=0,v(A)||w.push(fe),ye.tokens=w),b.parts===!0||b.tokens===!0){let t;for(let n=0;n<C.length;n++){let r=t?t+1:te,i=C[n],a=e.slice(r,i);b.tokens&&(n===0&&te!==0?(w[n].isPrefix=!0,w[n].value=_e):w[n].value=a,y(w[n]),ye.maxDepth+=w[n].depth),(n!==0||a!==``)&&T.push(a),t=i}if(t&&t+1<e.length){let n=e.slice(t+1);T.push(n),b.tokens&&(w[w.length-1].value=n,y(w[w.length-1]),ye.maxDepth+=w[w.length-1].depth)}ye.slashes=C,ye.parts=T}return ye}})),UB=a(((e,t)=>{var n=BB(),r=VB(),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:a,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:c}=n,l=(e,t)=>{if(typeof t.expandRange==`function`)return t.expandRange(...e,t);e.sort();let n=`[${e.join(`-`)}]`;try{new RegExp(n)}catch{return e.map(e=>r.escapeRegex(e)).join(`..`)}return n},u=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,d=e=>{let t=[],n=0,r=0,i=0,a=``,o=!1;for(let s of e){if(o===!0){a+=s,o=!1;continue}if(s===`\\`){a+=s,o=!0;continue}if(s===`"`){i=i===1?0:1,a+=s;continue}if(i===0){if(s===`[`)n++;else if(s===`]`&&n>0)n--;else if(n===0){if(s===`(`)r++;else if(s===`)`&&r>0)r--;else if(s===`|`&&r===0){t.push(a),a=``;continue}}}a+=s}return t.push(a),t},f=e=>{let t=!1;for(let n of e){if(t===!0){t=!1;continue}if(n===`\\`){t=!0;continue}if(/[?*+@!()[\]{}]/.test(n))return!1}return!0},p=e=>{let t=e.trim(),n=!0;for(;n===!0;)n=!1,/^@\([^\\()[\]{}|]+\)$/.test(t)&&(t=t.slice(2,-1),n=!0);if(f(t))return t.replace(/\\(.)/g,`$1`)},m=e=>{let t=e.map(p).filter(Boolean);for(let e=0;e<t.length;e++)for(let n=e+1;n<t.length;n++){let r=t[e],i=t[n],a=r[0];if(!(!a||r!==a.repeat(r.length)||i!==a.repeat(i.length))&&(r===i||r.startsWith(i)||i.startsWith(r)))return!0}return!1},h=(e,t=!0)=>{if(e[0]!==`+`&&e[0]!==`*`||e[1]!==`(`)return;let n=0,r=0,i=0,a=!1;for(let o=1;o<e.length;o++){let s=e[o];if(a===!0){a=!1;continue}if(s===`\\`){a=!0;continue}if(s===`"`){i=i===1?0:1;continue}if(i!==1){if(s===`[`){n++;continue}if(s===`]`&&n>0){n--;continue}if(!(n>0)){if(s===`(`){r++;continue}if(s===`)`&&(r--,r===0))return t===!0&&o!==e.length-1?void 0:{type:e[0],body:e.slice(2,o),end:o}}}}},g=e=>`${e.length===1?r.escapeRegex(e[0]):`[${e.map(e=>r.escapeRegex(e)).join(``)}]`}*`,_=e=>{let t=0,n=[];for(;t<e.length;){let r=h(e.slice(t),!1);if(!r||r.type!==`*`)return;let i=d(r.body).map(e=>e.trim());if(i.length!==1)return;let a=p(i[0]);if(!a||a.length!==1)return;n.push(a),t+=r.end+1}if(!(n.length<1))return n},v=e=>{let t=0,n=e.trim(),r=h(n);for(;r;)t++,n=r.body.trim(),r=h(n);return t},y=(e,t)=>{if(t.maxExtglobRecursion===!1)return{risky:!1};let r=typeof t.maxExtglobRecursion==`number`?t.maxExtglobRecursion:n.DEFAULT_MAX_EXTGLOB_RECURSION,i=d(e).map(e=>e.trim());if(i.length>1&&(i.some(e=>e===``)||i.some(e=>/^[*?]+$/.test(e))||m(i)))return{risky:!0};let a=[],o=!1,s=!0;for(let e of i){let t=_(e);if(t){o=!0,a.push(...t);continue}let n=p(e);if(n&&n.length===1){a.push(n);continue}if(s=!1,v(e)>r)return{risky:!0}}return o?s?{risky:!0,safeOutput:g([...new Set(a)])}:{risky:!0}:{risky:!1}},b=(e,t)=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);e=c[e]||e;let d={...t},f=typeof d.maxLength==`number`?Math.min(i,d.maxLength):i,p=e.length;if(p>f)throw SyntaxError(`Input length: ${p}, exceeds maximum allowed length: ${f}`);let m={type:`bos`,value:``,output:d.prepend||``},h=[m],g=d.capture?``:`?:`,_=n.globChars(d.windows),v=n.extglobChars(_),{DOT_LITERAL:x,PLUS_LITERAL:S,SLASH_LITERAL:C,ONE_CHAR:w,DOTS_SLASH:T,NO_DOT:E,NO_DOT_SLASH:ee,NO_DOTS_SLASH:te,QMARK:D,QMARK_NO_DOT:ne,STAR:re,START_ANCHOR:ie}=_,ae=e=>`(${g}(?:(?!${ie}${e.dot?T:x}).)*?)`,oe=d.dot?``:E,se=d.dot?D:ne,ce=d.bash===!0?ae(d):re;d.capture&&(ce=`(${ce})`),typeof d.noext==`boolean`&&(d.noextglob=d.noext);let O={input:e,index:-1,start:0,dot:d.dot===!0,consumed:``,output:``,prefix:``,backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:h};e=r.removePrefix(e,O),p=e.length;let le=[],ue=[],de=[],k=m,A,fe=()=>O.index===p-1,pe=O.peek=(t=1)=>e[O.index+t],me=O.advance=()=>e[++O.index]||``,he=()=>e.slice(O.index+1),ge=(e=``,t=0)=>{O.consumed+=e,O.index+=t},_e=e=>{O.output+=e.output==null?e.value:e.output,ge(e.value)},ve=()=>{let e=1;for(;pe()===`!`&&(pe(2)!==`(`||pe(3)===`?`);)me(),O.start++,e++;return e%2==0?!1:(O.negated=!0,O.start++,!0)},ye=e=>{O[e]++,de.push(e)},be=e=>{O[e]--,de.pop()},j=e=>{if(k.type===`globstar`){let t=O.braces>0&&(e.type===`comma`||e.type===`brace`),n=e.extglob===!0||le.length&&(e.type===`pipe`||e.type===`paren`);e.type!==`slash`&&e.type!==`paren`&&!t&&!n&&(O.output=O.output.slice(0,-k.output.length),k.type=`star`,k.value=`*`,k.output=ce,O.output+=k.output)}if(le.length&&e.type!==`paren`&&(le[le.length-1].inner+=e.value),(e.value||e.output)&&_e(e),k&&k.type===`text`&&e.type===`text`){k.output=(k.output||k.value)+e.value,k.value+=e.value;return}e.prev=k,h.push(e),k=e},xe=(e,t)=>{let n={...v[t],conditions:1,inner:``};n.prev=k,n.parens=O.parens,n.output=O.output,n.startIndex=O.index,n.tokensIndex=h.length;let r=(d.capture?`(`:``)+n.open;ye(`parens`),j({type:e,value:t,output:O.output?``:w}),j({type:`paren`,extglob:!0,value:me(),output:r}),le.push(n)},Se=n=>{let i=e.slice(n.startIndex,O.index+1),a=y(e.slice(n.startIndex+2,O.index),d);if((n.type===`plus`||n.type===`star`)&&a.risky){let e=a.safeOutput?(n.output?``:w)+(d.capture?`(${a.safeOutput})`:a.safeOutput):void 0,t=h[n.tokensIndex];t.type=`text`,t.value=i,t.output=e||r.escapeRegex(i);for(let e=n.tokensIndex+1;e<h.length;e++)h[e].value=``,h[e].output=``,delete h[e].suffix;O.output=n.output+t.output,O.backtrack=!0,j({type:`paren`,extglob:!0,value:A,output:``}),be(`parens`);return}let o=n.close+(d.capture?`)`:``),s;if(n.type===`negate`){let e=ce;n.inner&&n.inner.length>1&&n.inner.includes(`/`)&&(e=ae(d)),(e!==ce||fe()||/^\)+$/.test(he()))&&(o=n.close=`)$))${e}`),n.inner.includes(`*`)&&(s=he())&&/^\.[^\\/.]+$/.test(s)&&(o=n.close=`)${b(s,{...t,fastpaths:!1}).output})${e})`),n.prev.type===`bos`&&(O.negatedExtglob=!0)}j({type:`paren`,extglob:!0,value:A,output:o}),be(`parens`)};if(d.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let n=!1,i=e.replace(s,(e,t,r,i,a,o)=>i===`\\`?(n=!0,e):i===`?`?t?t+i+(a?D.repeat(a.length):``):o===0?se+(a?D.repeat(a.length):``):D.repeat(r.length):i===`.`?x.repeat(r.length):i===`*`?t?t+i+(a?ce:``):ce:t?e:`\\${e}`);return n===!0&&(i=d.unescape===!0?i.replace(/\\/g,``):i.replace(/\\+/g,e=>e.length%2==0?`\\\\`:e?`\\`:``)),i===e&&d.contains===!0?(O.output=e,O):(O.output=r.wrapOutput(i,O,t),O)}for(;!fe();){if(A=me(),A===`\0`)continue;if(A===`\\`){let e=pe();if(e===`/`&&d.bash!==!0||e===`.`||e===`;`)continue;if(!e){A+=`\\`,j({type:`text`,value:A});continue}let t=/^\\+/.exec(he()),n=0;if(t&&t[0].length>2&&(n=t[0].length,O.index+=n,n%2!=0&&(A+=`\\`)),d.unescape===!0?A=me():A+=me(),O.brackets===0){j({type:`text`,value:A});continue}}if(O.brackets>0&&(A!==`]`||k.value===`[`||k.value===`[^`)){if(d.posix!==!1&&A===`:`){let e=k.value.slice(1);if(e.includes(`[`)&&(k.posix=!0,e.includes(`:`))){let e=k.value.lastIndexOf(`[`),t=k.value.slice(0,e),n=a[k.value.slice(e+2)];if(n){k.value=t+n,O.backtrack=!0,me(),!m.output&&h.indexOf(k)===1&&(m.output=w);continue}}}(A===`[`&&pe()!==`:`||A===`-`&&pe()===`]`)&&(A=`\\${A}`),A===`]`&&(k.value===`[`||k.value===`[^`)&&(A=`\\${A}`),d.posix===!0&&A===`!`&&k.value===`[`&&(A=`^`),k.value+=A,_e({value:A});continue}if(O.quotes===1&&A!==`"`){A=r.escapeRegex(A),k.value+=A,_e({value:A});continue}if(A===`"`){O.quotes=O.quotes===1?0:1,d.keepQuotes===!0&&j({type:`text`,value:A});continue}if(A===`(`){ye(`parens`),j({type:`paren`,value:A});continue}if(A===`)`){if(O.parens===0&&d.strictBrackets===!0)throw SyntaxError(u(`opening`,`(`));let e=le[le.length-1];if(e&&O.parens===e.parens+1){Se(le.pop());continue}j({type:`paren`,value:A,output:O.parens?`)`:`\\)`}),be(`parens`);continue}if(A===`[`){if(d.nobracket===!0||!he().includes(`]`)){if(d.nobracket!==!0&&d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));A=`\\${A}`}else ye(`brackets`);j({type:`bracket`,value:A});continue}if(A===`]`){if(d.nobracket===!0||k&&k.type===`bracket`&&k.value.length===1){j({type:`text`,value:A,output:`\\${A}`});continue}if(O.brackets===0){if(d.strictBrackets===!0)throw SyntaxError(u(`opening`,`[`));j({type:`text`,value:A,output:`\\${A}`});continue}be(`brackets`);let e=k.value.slice(1);if(k.posix!==!0&&e[0]===`^`&&!e.includes(`/`)&&(A=`/${A}`),k.value+=A,_e({value:A}),d.literalBrackets===!1||r.hasRegexChars(e))continue;let t=r.escapeRegex(k.value);if(O.output=O.output.slice(0,-k.value.length),d.literalBrackets===!0){O.output+=t,k.value=t;continue}k.value=`(${g}${t}|${k.value})`,O.output+=k.value;continue}if(A===`{`&&d.nobrace!==!0){ye(`braces`);let e={type:`brace`,value:A,output:`(`,outputIndex:O.output.length,tokensIndex:O.tokens.length};ue.push(e),j(e);continue}if(A===`}`){let e=ue[ue.length-1];if(d.nobrace===!0||!e){j({type:`text`,value:A,output:A});continue}let t=`)`;if(e.dots===!0){let e=h.slice(),n=[];for(let t=e.length-1;t>=0&&(h.pop(),e[t].type!==`brace`);t--)e[t].type!==`dots`&&n.unshift(e[t].value);t=l(n,d),O.backtrack=!0}if(e.comma!==!0&&e.dots!==!0){let n=O.output.slice(0,e.outputIndex),r=O.tokens.slice(e.tokensIndex);e.value=e.output=`\\{`,A=t=`\\}`,O.output=n;for(let e of r)O.output+=e.output||e.value}j({type:`brace`,value:A,output:t}),be(`braces`),ue.pop();continue}if(A===`|`){le.length>0&&le[le.length-1].conditions++,j({type:`text`,value:A});continue}if(A===`,`){let e=A,t=ue[ue.length-1];t&&de[de.length-1]===`braces`&&(t.comma=!0,e=`|`),j({type:`comma`,value:A,output:e});continue}if(A===`/`){if(k.type===`dot`&&O.index===O.start+1){O.start=O.index+1,O.consumed=``,O.output=``,h.pop(),k=m;continue}j({type:`slash`,value:A,output:C});continue}if(A===`.`){if(O.braces>0&&k.type===`dot`){k.value===`.`&&(k.output=x);let e=ue[ue.length-1];k.type=`dots`,k.output+=A,k.value+=A,e.dots=!0;continue}if(O.braces+O.parens===0&&k.type!==`bos`&&k.type!==`slash`){j({type:`text`,value:A,output:x});continue}j({type:`dot`,value:A,output:x});continue}if(A===`?`){if(!(k&&k.value===`(`)&&d.noextglob!==!0&&pe()===`(`&&pe(2)!==`?`){xe(`qmark`,A);continue}if(k&&k.type===`paren`){let e=pe(),t=A;(k.value===`(`&&!/[!=<:]/.test(e)||e===`<`&&!/<([!=]|\w+>)/.test(he()))&&(t=`\\${A}`),j({type:`text`,value:A,output:t});continue}if(d.dot!==!0&&(k.type===`slash`||k.type===`bos`)){j({type:`qmark`,value:A,output:ne});continue}j({type:`qmark`,value:A,output:D});continue}if(A===`!`){if(d.noextglob!==!0&&pe()===`(`&&(pe(2)!==`?`||!/[!=<:]/.test(pe(3)))){xe(`negate`,A);continue}if(d.nonegate!==!0&&O.index===0){ve();continue}}if(A===`+`){if(d.noextglob!==!0&&pe()===`(`&&pe(2)!==`?`){xe(`plus`,A);continue}if(k&&k.value===`(`||d.regex===!1){j({type:`plus`,value:A,output:S});continue}if(k&&(k.type===`bracket`||k.type===`paren`||k.type===`brace`)||O.parens>0){j({type:`plus`,value:A});continue}j({type:`plus`,value:S});continue}if(A===`@`){if(d.noextglob!==!0&&pe()===`(`&&pe(2)!==`?`){j({type:`at`,extglob:!0,value:A,output:``});continue}j({type:`text`,value:A});continue}if(A!==`*`){(A===`$`||A===`^`)&&(A=`\\${A}`);let e=o.exec(he());e&&(A+=e[0],O.index+=e[0].length),j({type:`text`,value:A});continue}if(k&&(k.type===`globstar`||k.star===!0)){k.type=`star`,k.star=!0,k.value+=A,k.output=ce,O.backtrack=!0,O.globstar=!0,ge(A);continue}let t=he();if(d.noextglob!==!0&&/^\([^?]/.test(t)){xe(`star`,A);continue}if(k.type===`star`){if(d.noglobstar===!0){ge(A);continue}let n=k.prev,r=n.prev,i=n.type===`slash`||n.type===`bos`,a=r&&(r.type===`star`||r.type===`globstar`);if(d.bash===!0&&(!i||t[0]&&t[0]!==`/`)){j({type:`star`,value:A,output:``});continue}let o=O.braces>0&&(n.type===`comma`||n.type===`brace`),s=le.length&&(n.type===`pipe`||n.type===`paren`);if(!i&&n.type!==`paren`&&!o&&!s){j({type:`star`,value:A,output:``});continue}for(;t.slice(0,3)===`/**`;){let n=e[O.index+4];if(n&&n!==`/`)break;t=t.slice(3),ge(`/**`,3)}if(n.type===`bos`&&fe()){k.type=`globstar`,k.value+=A,k.output=ae(d),O.output=k.output,O.globstar=!0,ge(A);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&!a&&fe()){O.output=O.output.slice(0,-(n.output+k.output).length),n.output=`(?:${n.output}`,k.type=`globstar`,k.output=ae(d)+(d.strictSlashes?`)`:`|$)`),k.value+=A,O.globstar=!0,O.output+=n.output+k.output,ge(A);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&t[0]===`/`){let e=t[1]===void 0?``:`|$`;O.output=O.output.slice(0,-(n.output+k.output).length),n.output=`(?:${n.output}`,k.type=`globstar`,k.output=`${ae(d)}${C}|${C}${e})`,k.value+=A,O.output+=n.output+k.output,O.globstar=!0,ge(A+me()),j({type:`slash`,value:`/`,output:``});continue}if(n.type===`bos`&&t[0]===`/`){k.type=`globstar`,k.value+=A,k.output=`(?:^|${C}|${ae(d)}${C})`,O.output=k.output,O.globstar=!0,ge(A+me()),j({type:`slash`,value:`/`,output:``});continue}O.output=O.output.slice(0,-k.output.length),k.type=`globstar`,k.output=ae(d),k.value+=A,O.output+=k.output,O.globstar=!0,ge(A);continue}let n={type:`star`,value:A,output:ce};if(d.bash===!0){n.output=`.*?`,(k.type===`bos`||k.type===`slash`)&&(n.output=oe+n.output),j(n);continue}if(k&&(k.type===`bracket`||k.type===`paren`)&&d.regex===!0){n.output=A,j(n);continue}(O.index===O.start||k.type===`slash`||k.type===`dot`)&&(k.type===`dot`?(O.output+=ee,k.output+=ee):d.dot===!0?(O.output+=te,k.output+=te):(O.output+=oe,k.output+=oe),pe()!==`*`&&(O.output+=w,k.output+=w)),j(n)}for(;O.brackets>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));O.output=r.escapeLast(O.output,`[`),be(`brackets`)}for(;O.parens>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`)`));O.output=r.escapeLast(O.output,`(`),be(`parens`)}for(;O.braces>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`}`));O.output=r.escapeLast(O.output,`{`),be(`braces`)}if(d.strictSlashes!==!0&&(k.type===`star`||k.type===`bracket`)&&j({type:`maybe_slash`,value:``,output:`${C}?`}),O.backtrack===!0){O.output=``;for(let e of O.tokens)O.output+=e.output==null?e.value:e.output,e.suffix&&(O.output+=e.suffix)}return O};b.fastpaths=(e,t)=>{let a={...t},o=typeof a.maxLength==`number`?Math.min(i,a.maxLength):i,s=e.length;if(s>o)throw SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${o}`);e=c[e]||e;let{DOT_LITERAL:l,SLASH_LITERAL:u,ONE_CHAR:d,DOTS_SLASH:f,NO_DOT:p,NO_DOTS:m,NO_DOTS_SLASH:h,STAR:g,START_ANCHOR:_}=n.globChars(a.windows),v=a.dot?m:p,y=a.dot?h:p,b=a.capture?``:`?:`,x={negated:!1,prefix:``},S=a.bash===!0?`.*?`:g;a.capture&&(S=`(${S})`);let C=e=>e.noglobstar===!0?S:`(${b}(?:(?!${_}${e.dot?f:l}).)*?)`,w=e=>{switch(e){case`*`:return`${v}${d}${S}`;case`.*`:return`${l}${d}${S}`;case`*.*`:return`${v}${S}${l}${d}${S}`;case`*/*`:return`${v}${S}${u}${d}${y}${S}`;case`**`:return v+C(a);case`**/*`:return`(?:${v}${C(a)}${u})?${y}${d}${S}`;case`**/*.*`:return`(?:${v}${C(a)}${u})?${y}${S}${l}${d}${S}`;case`**/.*`:return`(?:${v}${C(a)}${u})?${l}${d}${S}`;default:{let t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;let n=w(t[1]);return n?n+l+t[2]:void 0}}},T=w(r.removePrefix(e,x));return T&&a.strictSlashes!==!0&&(T+=`${u}?`),T},t.exports=b})),WB=a(((e,t)=>{var n=HB(),r=UB(),i=VB(),a=BB(),o=e=>e&&typeof e==`object`&&!Array.isArray(e),s=(e,t,n=!1)=>{if(Array.isArray(e)){let r=e.map(e=>s(e,t,n));return e=>{for(let t of r){let n=t(e);if(n)return n}return!1}}let r=o(e)&&e.tokens&&e.input;if(e===``||typeof e!=`string`&&!r)throw TypeError(`Expected pattern to be a non-empty string`);let i=t||{},a=i.windows,c=r?s.compileRe(e,t):s.makeRe(e,t,!1,!0),l=c.state;delete c.state;let u=()=>!1;if(i.ignore){let e={...t,ignore:null,onMatch:null,onResult:null};u=s(i.ignore,e,n)}let d=(n,r=!1)=>{let{isMatch:o,match:d,output:f}=s.test(n,c,t,{glob:e,posix:a}),p={glob:e,state:l,regex:c,posix:a,input:n,output:f,match:d,isMatch:o};return typeof i.onResult==`function`&&i.onResult(p),o===!1?(p.isMatch=!1,r?p:!1):u(n)?(typeof i.onIgnore==`function`&&i.onIgnore(p),p.isMatch=!1,r?p:!1):(typeof i.onMatch==`function`&&i.onMatch(p),r?p:!0)};return n&&(d.state=l),d};s.test=(e,t,n,{glob:r,posix:a}={})=>{if(typeof e!=`string`)throw TypeError(`Expected input to be a string`);if(e===``)return{isMatch:!1,output:``};let o=n||{},c=o.format||(a?i.toPosixSlashes:null),l=e===r,u=l&&c?c(e):e;return l===!1&&(u=c?c(e):e,l=u===r),(l===!1||o.capture===!0)&&(l=o.matchBase===!0||o.basename===!0?s.matchBase(e,t,n,a):t.exec(u)),{isMatch:!!l,match:l,output:u}},s.matchBase=(e,t,n,r=n&&n.windows)=>(t instanceof RegExp?t:s.makeRe(t,n)).test(i.basename(e,{windows:r})),s.isMatch=(e,t,n)=>s(t,n)(e),s.parse=(e,t)=>Array.isArray(e)?e.map(e=>s.parse(e,t)):r(e,{...t,fastpaths:!1}),s.scan=(e,t)=>n(e,t),s.compileRe=(e,t,n=!1,r=!1)=>{if(n===!0)return e.output;let i=t||{},a=i.contains?``:`^`,o=i.contains?``:`$`,c=`${a}(?:${e.output})${o}`;e&&e.negated===!0&&(c=`^(?!${c}).*$`);let l=s.toRegex(c,t);return r===!0&&(l.state=e),l},s.makeRe=(e,t={},n=!1,i=!1)=>{if(!e||typeof e!=`string`)throw TypeError(`Expected a non-empty string`);let a={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]===`.`||e[0]===`*`)&&(a.output=r.fastpaths(e,t)),a.output||(a=r(e,t)),s.compileRe(a,t,n,i)},s.toRegex=(e,t)=>{try{let n=t||{};return new RegExp(e,n.flags||(n.nocase?`i`:``))}catch(e){if(t&&t.debug===!0)throw e;return/$^/}},s.constants=a,t.exports=s})),GB=a(((e,t)=>{var n=WB(),r=VB();function i(e,t,i=!1){return t&&(t.windows===null||t.windows===void 0)&&(t={...t,windows:r.isWindows()}),n(e,t,i)}Object.assign(i,n),t.exports=i})),KB=r(AL(),1),qB=r(nz(),1),JB=r(IB(),1),YB=r(zB(),1),XB=r(GB(),1),ZB=()=>Error(`Node APIs are not available in browser context.`),QB=()=>{throw ZB()},$B={access:(e,t)=>t(ZB()),accessSync:QB,readFile:(e,t,n)=>n(ZB()),readFileSync:QB},eV={},tV=a(((e,t)=>{var{flatTokensSymbol:n,htmlFlowSymbol:r,newlineRe:i}=Ie();function a(e){return Object.hasOwn(e,r)}function o(e){let{text:t,type:n}=e;if(n===`htmlFlow`&&t.startsWith(`<!--`)&&t.endsWith(`-->`)){let e=t.slice(4,-3);return!e.startsWith(`>`)&&!e.startsWith(`->`)&&!e.endsWith(`-`)}return!1}function s(e,t,n){for(let r=t;r<=n;r++)e.add(r)}function c(e,t,n){let r=[],i=[{array:e,index:0}];for(;i.length>0;){let e=i[i.length-1],{array:a,index:o}=e;if(o<a.length){let o=a[e.index++];t(o)&&r.push(o);let{children:s}=o;if(s.length>0){let e=n?n(o):s;i.push({array:e,index:0})}}else i.pop()}return r}function l(e,t,r){let i=e=>t.includes(e.type)&&(r||!a(e)),o=e[n];return o?o.filter(i):c(e,i)}function u(e,t,n=1){return l(e,[`blockQuotePrefix`,`linePrefix`]).filter(e=>e.startLine===t).map(e=>e.text).join(``).trimEnd().concat(`
369
+ `).repeat(n)}function d(e,t){let n=Array.isArray(e)?e:[e];for(let e of t){let t=t=>Array.isArray(e)?e.includes(t.type):e===t.type;n=n.flatMap(e=>e.children.filter(t))}return n}function f(e){let t=1,{text:n}=e.children.find(e=>[`atxHeadingSequence`,`setextHeadingLine`].includes(e.type));return n[0]===`#`?t=Math.min(n.length,6):n[0]===`-`&&(t=2),t}function p(e){return e.type===`setextHeading`?`setext`:e.children.filter(e=>e.type===`atxHeadingSequence`).length===1?`atx`:`atx_closed`}function m(e){return d(e,[[`atxHeadingText`,`setextHeadingText`]]).flatMap(e=>e.children.filter(e=>e.type!==`htmlText`)).map(e=>e.text).join(``).replace(i,` `)}function h(e){let t=/^<([^!>][^/\s>]*)/;if(e.type===`htmlText`){let n=t.exec(e.text);if(n){let e=n[1],t=e.startsWith(`/`);return{close:t,name:t?e.slice(1):e}}}return null}function g(e,t){let n=e;for(;(n=n.parent)&&!t.includes(n.type););return n}var _=/^#tab\//;function v(e){if(e?.type===`atxHeading`){let t=d(e,[`atxHeadingText`]);if(t.length===1&&t[0].children.length===1&&t[0].children[0].type===`link`){let e=l(t[0].children[0].children,[`resourceDestinationString`]);return e.length===1&&_.test(e[0].text)}}return!1}t.exports={addRangeToSet:s,filterByPredicate:c,filterByTypes:l,getBlockQuotePrefixText:u,getDescendantsByType:d,getHeadingLevel:f,getHeadingStyle:p,getHeadingText:m,getHtmlTagInfo:h,getParentOfType:g,inHtmlFlow:a,isDocfxTab:v,isHtmlFlowComment:o,nonContentTokens:new Set([`blockQuoteMarker`,`blockQuotePrefix`,`blockQuotePrefixWhitespace`,`gfmFootnoteDefinitionIndent`,`lineEnding`,`lineEndingBlank`,`linePrefix`,`listItemIndent`,`undefinedReference`,`undefinedReferenceCollapsed`,`undefinedReferenceFull`,`undefinedReferenceShortcut`])}})),Z=r(a(((e,t)=>{var n=tV(),{newlineRe:r,nextLinesRe:i}=Ie();t.exports.newLineRe=r,t.exports.nextLinesRe=i,t.exports.frontMatterRe=/((^---[^\S\r\n\u2028\u2029]*$[\s\S]+?^---\s*)|(^\+\+\+[^\S\r\n\u2028\u2029]*$[\s\S]+?^(\+\+\+|\.\.\.)\s*)|(^\{[^\S\r\n\u2028\u2029]*$[\s\S]+?^\}\s*))(\r\n|\r|\n|$)/m;var a=/(<!--\s*markdownlint-(disable|enable|capture|restore|disable-file|enable-file|disable-line|disable-next-line|configure-file))(?:\s|-->)/gi;t.exports.inlineCommentStartRe=a,t.exports.endOfLineHtmlEntityRe=/&(?:#\d+|#[xX][\da-fA-F]+|[a-zA-Z]{2,31}|blk\d{2}|emsp1[34]|frac\d{2}|sup\d|there4);$/,t.exports.endOfLineGemojiCodeRe=/:(?:[abmovx]|[-+]1|100|1234|(?:1st|2nd|3rd)_place_medal|8ball|clock\d{1,4}|e-mail|non-potable_water|o2|t-rex|u5272|u5408|u55b6|u6307|u6708|u6709|u6e80|u7121|u7533|u7981|u7a7a|[a-z]{2,15}2?|[a-z]{1,14}(?:_[a-z\d]{1,16})+):$/;var o=`.,;:!?。,;:!?`;t.exports.allPunctuation=o,t.exports.allPunctuationNoQuestion=o.replace(/[??]/gu,``);function s(e){return typeof e==`number`}t.exports.isNumber=s;function c(e){return typeof e==`string`}t.exports.isString=c;function l(e){return e.length===0}t.exports.isEmptyString=l;function u(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}t.exports.isObject=u;function d(e){return!!e&&Object.getPrototypeOf(e)===URL.prototype}t.exports.isUrl=d;function f(e){return Array.isArray(e)?[...e]:e}t.exports.cloneIfArray=f;function p(e){return d(e)?new URL(e):e}t.exports.cloneIfUrl=p,t.exports.getHtmlAttributeRe=function(e){return RegExp(`\\s${e}\\s*=\\s*['"]?([^'"\\s>]*)`,`iu`)};function m(e){return!e||!e.trim()||!(e=>{for(;;){let t=e.indexOf(`<!--`),n=e.indexOf(`-->`);if(n!==-1&&(t===-1||n<t))e=e.slice(n+3);else if(t!==-1&&n!==-1)e=e.slice(0,t)+e.slice(n+3);else if(t!==-1&&n===-1)e=e.slice(0,t);else return e}})(e).replace(/>/g,``).trim()}t.exports.isBlankLine=m;var h=`<!--`,g=`-->`,_=`.`,v=/^ *\|/,y=/[^\r\n]/g,b=/[^ \r\n]/g,x=/ +[\r\n]/g,S=e=>e.replace(y,_);t.exports.clearHtmlCommentText=function(e){let t=0;for(;(t=e.indexOf(h,t))!==-1;){let n=e.indexOf(g,t+2);if(n===-1)break;if(n>t+4){let r=e.slice(t+4,n),i=e.lastIndexOf(`
370
370
  `,t)+1,a=e.slice(i,t),o=a.trim().length===0,s=v.test(a)&&r.includes(`
371
371
  `);if(o||!(s||r.startsWith(`>`)||r.startsWith(`->`)||r.endsWith(`-`)||r.includes(`--`))){let i=r.replace(b,_).replace(x,S);e=e.slice(0,t+4)+i+e.slice(n)}}t=n+3}return e},t.exports.escapeForRegExp=function(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,`\\$&`)};function C(e,t,n){return e.length<=30||(e=t&&n?e.slice(0,15)+`...`+e.slice(-15):n?`...`+e.slice(-30):e.slice(0,30)+`...`),e}t.exports.ellipsify=C;function w(e,t,n,r,i,a){e({lineNumber:t,detail:n,context:r,range:i,fixInfo:a})}t.exports.addError=w;function T(e,t,n,r,i,a,o,s){n!==r&&w(e,t,`Expected: `+n+`; Actual: `+r+(i?`; `+i:``),a,o,s)}t.exports.addErrorDetailIf=T;function E(e,t,n,i,a,o,s){n=C(n.replace(r,`
372
372
  `),i,a),w(e,t,void 0,n,o,s)}t.exports.addErrorContext=E;var ee=(e,t,n,r)=>e<n||e===n&&t<=r;t.exports.hasOverlap=function(e,t){let n=ee(e.startLine,e.startColumn,t.startLine,t.startColumn),r=n?e:t,i=n?t:e;return ee(i.startLine,i.startColumn,r.endLine,r.endColumn)},t.exports.frontMatterHasTitle=function(e,t){let n=t!==void 0&&!t,r=new RegExp(String(t||`^\\s*"?title"?\\s*[:=]`),`i`);return!n&&e.some(e=>r.test(e))};function te(e){let t=e=>e.toLowerCase().trim().replace(/\s+/g,` `),r=e=>e?.children.filter(e=>e.type!==`blockQuotePrefix`).map(e=>e.text).join(``),i=new Map,a=new Map,o=(e,n,r)=>{let o=[e.startLine-1,e.startColumn-1,e.text.length],s=t(n),c=r?a:i,l=c.get(s)||[];l.push(o),c.set(s,l)},s=new Map,c=[],l=[],u=n.filterByTypes(e,[`definition`,`gfmFootnoteDefinition`,`definitionLabelString`,`gfmFootnoteDefinitionLabelString`,`gfmFootnoteCall`,`image`,`link`,`undefinedReferenceCollapsed`,`undefinedReferenceFull`,`undefinedReferenceShortcut`]);for(let e of u){let i=``;switch(e.type){case`definition`:case`gfmFootnoteDefinition`:for(let t=e.startLine;t<=e.endLine;t++)c.push(t-1);break;case`gfmFootnoteDefinitionLabelString`:i=`^`;case`definitionLabelString`:{let r=t(`${i}${e.text}`);if(s.has(r))l.push([r,e.startLine-1]);else{let t=n.getParentOfType(e,[`definition`]),i=t&&n.getDescendantsByType(t,[`definitionDestination`,`definitionDestinationRaw`,`definitionDestinationString`])[0]?.text;s.set(r,[e.startLine-1,i||``])}break}case`gfmFootnoteCall`:case`image`:case`link`:{let t=e.children.length===1,i=e.children.length===2&&!e.children.some(e=>e.type===`resource`),[a]=n.getDescendantsByType(e,[`label`,`labelText`]),[s]=n.getDescendantsByType(e,[`reference`,`referenceString`]),c=r(a);if(!t&&!i){let[n,r]=e.children.filter(e=>[`gfmFootnoteCallMarker`,`gfmFootnoteCallString`].includes(e.type));n&&r&&(c=`${n.text}${r.text}`,t=!0)}(t||i)&&o(e,r(s)||c,t);break}case`undefinedReferenceCollapsed`:case`undefinedReferenceFull`:case`undefinedReferenceShortcut`:o(e,n.getDescendantsByType(e,[`undefinedReference`])[0].children.map(e=>e.text).join(``),e.type===`undefinedReferenceShortcut`);break}}return{references:i,shortcuts:a,definitions:s,duplicateDefinitions:l,definitionLineIndices:c}}t.exports.getReferenceLinkImageData=te;function D(e,t){let n=0,i=0,a=0,o=e.match(r)||[];for(let e of o)switch(e){case`\r`:n++;break;case`
@@ -374,11 +374,11 @@ ${t.slice(l+2)}`,d+=1;else break}t.push({indent:l,number:parseInt(s,10),content:
374
374
  `:a++;break}let s=null;return s=!n&&!i&&!a?t&&t.EOL||`
375
375
  `:i>=a&&i>=n?`
376
376
  `:a>=n?`\r
377
- `:`\r`,s}t.exports.getPreferredLineEnding=D;function ne(e,t){let n=t&&t.homedir&&t.homedir();return n?e.replace(/^~($|\/|\\)/,`${n}$1`):e}t.exports.expandTildePath=ne;function re(e){let t={ruleNames:[],lineNumber:-1};return e.filter((e,n,r)=>{delete e.fixInfo,delete e.severity;let i=r[n-1]||t;return e.ruleNames[0]!==i.ruleNames[0]||e.lineNumber!==i.lineNumber})}function ie(e){for(let t of e)t.ruleName=t.ruleNames[0],t.ruleAlias=t.ruleNames[1]||t.ruleName,delete t.ruleNames;return e}function ae(e){let t={};for(let n of e){let e=n.ruleNames[0],r=t[e]||[];r.push(n.lineNumber),t[e]=r}return t}function oe(e,t){let n={};for(let[r,i]of Object.entries(e))n[r]=t(i.map(e=>({...e})));return n}t.exports.convertToResultVersion0=function(e){return oe(e,e=>ae(re(e)))},t.exports.convertToResultVersion1=function(e){return oe(e,e=>ie(re(e)))},t.exports.convertToResultVersion2=function(e){return oe(e,re)},t.exports.formatLintResults=function(e){let t=[],n=Object.entries(e||{});n.sort((e,t)=>e[0].localeCompare(t[0]));for(let[e,r]of n)for(let n of r){let{lineNumber:r,ruleNames:i,ruleDescription:a,errorDetail:o,errorContext:s,errorRange:c,severity:l}=n,u=i.join(`/`),d=`:${r}`,f=c&&c[0]||0,p=f?`:${f}`:``,m=a,h=o?` [${o}]`:``,g=s?` [Context: "${s}"]`:``;t.push(`${e}${d}${p} ${l} ${u} ${m}${h}${g}`)}return t}}))(),1),Q=nV(),rV=new Map,iV=void 0;function aV(e){rV.clear(),iV=e}function oV(){return iV?.parsers.micromark.tokens||[]}function sV(e,t){if(rV.has(e))return rV.get(e);let n=t();return rV.set(e,n),n}function $(e,t){return sV(JSON.stringify(arguments),()=>(0,Q.filterByTypes)(oV(),e,t))}function cV(){return sV(cV.name,()=>(0,Z.getReferenceLinkImageData)(oV()))}var lV=`https://github.com/DavidAnson/markdownlint`,uV=`0.41.1`,dV=a(((e,t)=>{function n(){return Le()}t.exports={requireMarkdownItCjs:n}})),fV=a(((e,n)=>{var r=typeof __non_webpack_require__>`u`?t:__non_webpack_require__,i=(e,t,n=[])=>{let r=e.paths?.(``)||[];return e(t,{paths:[...n,...r]})};n.exports={resolveModule:(e,t)=>i(r.resolve,e,t),resolveModuleCustomResolve:i}})),pV=dV();fV();var mV={names:[`MD001`,`heading-increment`],description:`Heading levels should only increment by one level at a time`,tags:[`headings`],parser:`micromark`,function:function(e,t){let n=(0,Z.frontMatterHasTitle)(e.frontMatterLines,e.config.front_matter_title)?1:2**53-1;for(let e of $([`atxHeading`,`setextHeading`])){let r=(0,Q.getHeadingLevel)(e);r>n&&(0,Z.addErrorDetailIf)(t,e.startLine,`h${n+1}`,`h${r}`),n=r}}},hV={names:[`MD003`,`heading-style`],description:`Heading style`,tags:[`headings`],parser:`micromark`,function:function(e,t){let n=String(e.config.style||`consistent`);for(let e of $([`atxHeading`,`setextHeading`])){let r=(0,Q.getHeadingStyle)(e);if(n===`consistent`&&(n=r),r!==n){let i=(0,Q.getHeadingLevel)(e)<=2;if(!(n===`setext_with_atx`&&(i&&r===`setext`||!i&&r===`atx`))&&!(n===`setext_with_atx_closed`&&(i&&r===`setext`||!i&&r===`atx_closed`))){let a=n;n===`setext_with_atx`?a=i?`setext`:`atx`:n===`setext_with_atx_closed`&&(a=i?`setext`:`atx_closed`),(0,Z.addErrorDetailIf)(t,e.startLine,a,r)}}}}},gV=e=>e===`-`?`dash`:e===`+`?`plus`:`asterisk`,_V=e=>e===`dash`?`-`:e===`plus`?`+`:`*`,vV=e=>e===`dash`?`plus`:e===`plus`?`asterisk`:`dash`,yV=new Set([`asterisk`,`consistent`,`dash`,`plus`,`sublist`]),bV={names:[`MD004`,`ul-style`],description:`Unordered list style`,tags:[`bullet`,`ul`],parser:`micromark`,function:function(e,t){let n=String(e.config.style||`consistent`),r=yV.has(n)?n:`dash`,i=[];for(let e of $([`listUnordered`])){let a=0;if(n===`sublist`){let t=e;for(;t=(0,Q.getParentOfType)(t,[`listOrdered`,`listUnordered`]);)a++}let o=(0,Q.getDescendantsByType)(e,[`listItemPrefix`,`listItemMarker`]);for(let e of o){let o=gV(e.text);n===`sublist`?(i[a]||(i[a]=o===i[a-1]?vV(o):o),r=i[a]):r===`consistent`&&(r=o);let s=e.startColumn,c=e.endColumn-e.startColumn;(0,Z.addErrorDetailIf)(t,e.startLine,r,o,void 0,void 0,[s,c],{editColumn:s,deleteCount:c,insertText:_V(r)})}}}},xV={names:[`MD005`,`list-indent`],description:`Inconsistent indentation for list items at the same level`,tags:[`bullet`,`ul`,`indentation`],parser:`micromark`,function:function(e,t){for(let e of $([`listOrdered`,`listUnordered`])){let n=e.startColumn-1,r=0,i=!1,a=e.children.filter(e=>e.type===`listItemPrefix`);for(let o of a){let a=o.startLine,s=o.startColumn-1,c=[1,o.endColumn-1];if(e.type===`listUnordered`)(0,Z.addErrorDetailIf)(t,a,n,s,void 0,void 0,c);else{let e=o.text.trim().length,l=o.startColumn+e-1;if(r||=l,n!==s||i)if(r===l)i=!0;else{let o=i?`Expected: (${r}); Actual: (${l})`:`Expected: ${n}; Actual: ${s}`,u=i?r-e:n,d=i?l-e:s;(0,Z.addError)(t,a,o,void 0,c,{editColumn:Math.min(d,u)+1,deleteCount:Math.max(d-u,0),insertText:``.padEnd(Math.max(u-d,0))})}}}}}},SV=[`blockQuotePrefix`,`listItemPrefix`,`listUnordered`],CV=[`blockQuote`,`listOrdered`,`listUnordered`],wV={names:[`MD007`,`ul-indent`],description:`Unordered list indentation`,tags:[`bullet`,`ul`,`indentation`],parser:`micromark`,function:function(e,t){let n=Number(e.config.indent||2),r=!!e.config.start_indented,i=Number(e.config.start_indent||n),a=new Map,o=null,s=$(SV);for(let e of s){let{endColumn:s,parent:c,startColumn:l,startLine:u,type:d}=e;if(d===`blockQuotePrefix`)o=e;else if(d===`listUnordered`){let t=0,n=e;for(;n=(0,Q.getParentOfType)(n,CV);){if(n.type===`listUnordered`){t++;continue}else n.type===`listOrdered`&&(t=-1);break}t>=0&&a.set(e,t)}else{let d=a.get(c);if(d!==void 0){let a=((0,Q.getParentOfType)(e,[`gfmFootnoteDefinition`])?4:0)+(r?i:0)+d*n,c=o?.endLine===u?o.endColumn-1:0,f=l-1-c;(0,Z.addErrorDetailIf)(t,u,a,f,void 0,void 0,[1,s-1],{editColumn:l-f,deleteCount:Math.max(f-a,0),insertText:``.padEnd(Math.max(a-f,0))})}}}}},TV={names:[`MD009`,`no-trailing-spaces`],description:`Trailing spaces`,tags:[`whitespace`],parser:`micromark`,function:function(e,t){let n=e.config.br_spaces;n=Number(n===void 0?2:n);let r=e.config.code_blocks,i=r===void 0?!1:!!r,a=!!e.config.list_item_empty_lines,o=!!e.config.strict,s=new Set;if(!i){for(let e of $([`codeFenced`]))(0,Q.addRangeToSet)(s,e.startLine+1,e.endLine-1);for(let e of $([`codeIndented`]))(0,Q.addRangeToSet)(s,e.startLine,e.endLine)}let c=new Set;if(a)for(let e of $([`listOrdered`,`listUnordered`])){(0,Q.addRangeToSet)(c,e.startLine,e.endLine);let t=!0;for(let n=e.children.length-1;n>=0;n--){let r=e.children[n];switch(r.type){case`content`:t=!1;break;case`listItemIndent`:t&&c.delete(r.startLine);break;case`listItemPrefix`:t=!0;break;default:break}}}let l=new Set,u=new Set;if(o){for(let e of $([`paragraph`]))(0,Q.addRangeToSet)(l,e.startLine,e.endLine-1);for(let e of $([`codeText`]))(0,Q.addRangeToSet)(u,e.startLine,e.endLine-1)}let d=n<2?0:n;for(let n=0;n<e.lines.length;n++){let r=e.lines[n],i=n+1,a=r.length-r.trimEnd().length;if(a&&!s.has(i)&&!c.has(i)&&(d!==a||o&&(!l.has(i)||u.has(i)))){let e=r.length-a+1;(0,Z.addError)(t,i,`Expected: `+(d===0?``:`0 or `)+d+`; Actual: `+a,void 0,[e,a],{editColumn:e,deleteCount:a})}}}},EV=/\t+/g,DV={names:[`MD010`,`no-hard-tabs`],description:`Hard tabs`,tags:[`whitespace`,`hard_tab`],parser:`micromark`,function:function(e,t){let n=e.config.code_blocks,r=n===void 0?!0:!!n,i=new Set((e.config.ignore_code_languages||[]).map(e=>String(e).toLowerCase())),a=e.config.spaces_per_tab,o=a===void 0?1:Math.max(0,Number(a)),s=[];r?i.size>0&&s.push(`codeFenced`):s.push(`codeFenced`,`codeIndented`,`codeText`);let c=$(s).filter(e=>e.type===`codeFenced`&&i.size>0?(0,Q.getDescendantsByType)(e,[`codeFencedFence`,`codeFencedFenceInfo`]).every(e=>i.has(e.text.toLowerCase())):!0).map(e=>{let{type:t,startLine:n,startColumn:r,endLine:i,endColumn:a}=e,o=t===`codeFenced`;return{startLine:n+ +!!o,startColumn:o?0:r,endLine:i-+!!o,endColumn:o?2**53-1:a}});for(let n=0;n<e.lines.length;n++){let r=e.lines[n],i=null;for(;(i=EV.exec(r))!==null;){let e=n+1,r=i.index+1,a=i[0].length,s={startLine:e,startColumn:r,endLine:e,endColumn:r+a-1};c.some(e=>(0,Z.hasOverlap)(e,s))||(0,Z.addError)(t,e,`Column: `+r,void 0,[r,a],{editColumn:r,deleteCount:a,insertText:``.padEnd(a*o)})}}}},OV=/(^|[^\\])\(([^()]+)\)\[([^\]^][^\]]*)\](?!\()/g,kV={names:[`MD011`,`no-reversed-links`],description:`Reversed link syntax`,tags:[`links`],parser:`micromark`,function:function(e,t){let n=new Set;for(let e of $([`codeFenced`,`codeIndented`,`mathFlow`]))(0,Q.addRangeToSet)(n,e.startLine,e.endLine);let r=$([`codeText`,`mathText`]);for(let[i,a]of e.lines.entries()){let e=i+1;if(!n.has(e)){let n=null;for(;(n=OV.exec(a))!==null;){let[i,a,o,s]=n;if(!o.endsWith(`\\`)&&!s.endsWith(`\\`)){let c=n.index+a.length+1,l=n[0].length-a.length,u={startLine:e,startColumn:c,endLine:e,endColumn:c+l-1};r.some(e=>(0,Z.hasOverlap)(e,u))||(0,Z.addError)(t,e,i.slice(a.length),void 0,[c,l],{editColumn:c,deleteCount:l,insertText:`[${o}](${s})`})}}}}}},AV={names:[`MD012`,`no-multiple-blanks`],description:`Multiple consecutive blank lines`,tags:[`whitespace`,`blank_lines`],parser:`micromark`,function:function(e,t){let n=Number(e.config.maximum||1),{lines:r}=e,i=new Set;for(let e of $([`codeFenced`,`codeIndented`]))(0,Q.addRangeToSet)(i,e.startLine,e.endLine);let a=0;for(let[e,o]of r.entries())a=i.has(e+1)||o.trim().length>0?0:a+1,n<a&&(0,Z.addErrorDetailIf)(t,e+1,n,a,void 0,void 0,void 0,{deleteCount:-1})}},jV=/^(?:[#>\s]*\s)?\S*$/,MV={names:[`MD013`,`line-length`],description:`Line length`,tags:[`line_length`],parser:`micromark`,function:function(e,t){let n=Number(e.config.line_length||80),r=Number(e.config.heading_line_length||n),i=Number(e.config.code_block_line_length||n),a=!!e.config.strict,o=!!e.config.stern,s=e.config.code_blocks,c=s===void 0?!0:!!s,l=e.config.tables,u=l===void 0?!0:!!l,d=e.config.headings,f=d===void 0?!0:!!d,p=new Set;for(let e of $([`atxHeading`,`setextHeading`]))(0,Q.addRangeToSet)(p,e.startLine,e.endLine);let m=new Set;for(let e of $([`codeFenced`,`codeIndented`]))(0,Q.addRangeToSet)(m,e.startLine,e.endLine);let h=new Set;for(let e of $([`table`]))(0,Q.addRangeToSet)(h,e.startLine,e.endLine);let g=new Set;for(let e of $([`autolink`,`image`,`link`,`literalAutolink`]))(0,Q.addRangeToSet)(g,e.startLine,e.endLine);let _=new Set;for(let e of $([`paragraph`]))for(let t of(0,Q.getDescendantsByType)(e,[`data`]))(0,Q.addRangeToSet)(_,t.startLine,t.endLine);let v=new Set;for(let e of g)_.has(e)||v.add(e);let y=new Set(cV().definitionLineIndices);for(let s=0;s<e.lines.length;s++){let l=e.lines[s],d=s+1,g=p.has(d),_=m.has(d),b=h.has(d),x=_?i:g?r:n,S=a||o?l:l.replace(/\S*$/u,`#`);x>0&&(c||!_)&&(u||!b)&&(f||!g)&&!y.has(s)&&(a||!(o&&jV.test(l))&&!v.has(d))&&S.length>x&&(0,Z.addErrorDetailIf)(t,d,x,l.length,void 0,void 0,[x+1,l.length-x])}}},NV=/^(\s*)(\$\s+)/,PV={names:[`MD014`,`commands-show-output`],description:`Dollar signs used before commands without showing output`,tags:[`code`],parser:`micromark`,function:function(e,t){for(let e of $([`codeFenced`,`codeIndented`])){let n=e.children.filter(e=>e.type===`codeFlowValue`),r=n.map(e=>({result:e.text.match(NV),startColumn:e.startColumn,startLine:e.startLine,text:e.text})).filter(e=>e.result);if(r.length===n.length)for(let e of r){let n=e.startColumn+e.result[1].length,r=e.result[2].length;(0,Z.addErrorContext)(t,e.startLine,e.text,void 0,void 0,[n,r],{editColumn:n,deleteCount:r})}}}},FV={names:[`MD018`,`no-missing-space-atx`],description:`No space after hash on atx style heading`,tags:[`headings`,`atx`,`spaces`],parser:`micromark`,function:function(e,t){let{lines:n}=e,r=new Set;for(let e of $([`codeFenced`,`codeIndented`,`htmlFlow`]))(0,Q.addRangeToSet)(r,e.startLine,e.endLine);for(let[e,i]of n.entries())if(!r.has(e+1)&&/^#+[^# \t]/.test(i)&&!/#\s*$/.test(i)&&!i.startsWith(`#️⃣`)){let n=/^#+/.exec(i)[0].length;(0,Z.addErrorContext)(t,e+1,i.trim(),void 0,void 0,[1,n+1],{editColumn:n+1,insertText:` `})}}};function IV(e,t,n){let{children:r,startLine:i,text:a}=t,o=n>0?0:r.length-1;for(;r[o]&&r[o].type!==`atxHeadingSequence`;)o+=n;let s=r[o],c=r[o+n];if(s?.type===`atxHeadingSequence`&&c?.type===`whitespace`&&c.text.length>1){let t=c.startColumn+1,r=c.endColumn-t;(0,Z.addErrorContext)(e,i,a.trim(),n>0,n<0,[t,r],{editColumn:t,deleteCount:r})}}var LV=[{names:[`MD019`,`no-multiple-space-atx`],description:`Multiple spaces after hash on atx style heading`,tags:[`headings`,`atx`,`spaces`],parser:`micromark`,function:function(e,t){let n=$([`atxHeading`]).filter(e=>(0,Q.getHeadingStyle)(e)===`atx`);for(let e of n)IV(t,e,1)}},{names:[`MD021`,`no-multiple-space-closed-atx`],description:`Multiple spaces inside hashes on closed atx style heading`,tags:[`headings`,`atx_closed`,`spaces`],parser:`micromark`,function:function(e,t){let n=$([`atxHeading`]).filter(e=>(0,Q.getHeadingStyle)(e)===`atx_closed`);for(let e of n)IV(t,e,1),IV(t,e,-1)}}],RV={names:[`MD020`,`no-missing-space-closed-atx`],description:`No space inside hashes on closed atx style heading`,tags:[`headings`,`atx_closed`,`spaces`],parser:`micromark`,function:function(e,t){let{lines:n}=e,r=new Set;for(let e of $([`codeFenced`,`codeIndented`,`htmlFlow`]))(0,Q.addRangeToSet)(r,e.startLine,e.endLine);for(let[e,i]of n.entries())if(!r.has(e+1)){let n=/^(#+)([ \t]*)([^# \t\\]|[^# \t][^#]*?[^# \t\\])([ \t]*)((?:\\#)?)(#+)(\s*)$/.exec(i);if(n){let[,r,{length:a},o,{length:s},c,l,{length:u}]=n,d=r.length,f=l.length,p=!a,m=!s||!!c,h=c?`${c} `:``;if(p||m){let n=p?[1,d+1]:[i.length-u-f,f+1];(0,Z.addErrorContext)(t,e+1,i.trim(),p,m,n,{editColumn:1,deleteCount:i.length,insertText:`${r} ${o} ${h}${l}`})}}}}},zV=1,BV=e=>{if(Array.isArray(e)){let t=[,,,,,,].fill(zV);for(let[n,r]of[...e.entries()].slice(0,6))t[n]=r;return e=>t[(0,Q.getHeadingLevel)(e)-1]}let t=e===void 0?zV:Number(e);return()=>t},VV=(e,t,n,r)=>t>=0&&t<e.length?e[t]:r&&n.length>0&&t<0&&t>=-n.length?n[n.length+t]:``,HV={names:[`MD022`,`blanks-around-headings`],description:`Headings should be surrounded by blank lines`,tags:[`headings`,`blank_lines`],parser:`micromark`,function:function(e,t){let n=BV(e.config.lines_above),r=BV(e.config.lines_below),i=!!e.config.include_front_matter,{lines:a,frontMatterLines:o}=e,s=$([`blockQuotePrefix`,`linePrefix`]);for(let e of $([`atxHeading`,`setextHeading`])){let{startLine:c,endLine:l}=e,u=a[c-1].trim(),d=n(e);if(d>=0){let e=0;for(let t=0;t<d&&(0,Z.isBlankLine)(VV(a,c-2-t,o,i));t++)e++;(0,Z.addErrorDetailIf)(t,c,d,e,`Above`,u,void 0,{insertText:(0,Q.getBlockQuotePrefixText)(s,c-1,d-e)})}let f=r(e);if(f>=0){let e=0;for(let t=0;t<f&&(0,Z.isBlankLine)(VV(a,l+t,o,!1));t++)e++;(0,Z.addErrorDetailIf)(t,c,f,e,`Below`,u,void 0,{lineNumber:l+1,insertText:(0,Q.getBlockQuotePrefixText)(s,l+1,f-e)})}}}},UV={names:[`MD023`,`heading-start-left`],description:`Headings must start at the beginning of the line`,tags:[`headings`,`spaces`],parser:`micromark`,function:function(e,t){let n=$([`atxHeading`,`linePrefix`,`setextHeading`]);for(let r=0;r<n.length-1;r++)if(n[r].type===`linePrefix`&&n[r+1].type!==`linePrefix`&&n[r].startLine===n[r+1].startLine){let{endColumn:i,startColumn:a,startLine:o}=n[r],s=i-a;(0,Z.addErrorContext)(t,o,e.lines[o-1],!0,!1,[a,s],{editColumn:a,deleteCount:s})}}},WV={names:[`MD024`,`no-duplicate-heading`],description:`Multiple headings with the same content`,tags:[`headings`],parser:`micromark`,function:function(e,t){let n=!!e.config.siblings_only,r=[null,[]],i=1,a=r[i];for(let e of $([`atxHeading`,`setextHeading`])){let o=(0,Q.getHeadingText)(e);if(n){let t=(0,Q.getHeadingLevel)(e);for(;i<t;)i++,r[i]=[];for(;i>t;)r[i]=[],i--;a=r[t]}a.includes(o)?(0,Z.addErrorContext)(t,e.startLine,o.trim()):a.push(o)}}},GV={names:[`MD025`,`single-title`,`single-h1`],description:`Multiple top-level headings in the same document`,tags:[`headings`],parser:`micromark`,function:function(e,t){let n=Number(e.config.level||1),{tokens:r}=e.parsers.micromark,i=$([`atxHeading`,`setextHeading`]).filter(e=>n===(0,Q.getHeadingLevel)(e)&&!(0,Q.isDocfxTab)(e));if(i.length>0){let n=(0,Z.frontMatterHasTitle)(e.frontMatterLines,e.config.front_matter_title),a=n;if(a||=r.slice(0,r.indexOf(i[0])).every(e=>Q.nonContentTokens.has(e.type)||(0,Q.isHtmlFlowComment)(e)),a)for(let e of i.slice(+!n))(0,Z.addErrorContext)(t,e.startLine,(0,Q.getHeadingText)(e))}}},KV={names:[`MD026`,`no-trailing-punctuation`],description:`Trailing punctuation in heading`,tags:[`headings`],parser:`micromark`,function:function(e,t){let n=e.config.punctuation;n=String(n===void 0?Z.allPunctuationNoQuestion:n);let r=RegExp(`\\s*[`+(0,Z.escapeForRegExp)(n)+`]+$`),i=$([`atxHeadingText`,`setextHeadingText`]);for(let e of i){let{endColumn:n,endLine:i,text:a}=e,o=r.exec(a);if(o&&!Z.endOfLineHtmlEntityRe.test(a)&&!Z.endOfLineGemojiCodeRe.test(a)){let e=o[0],r=e.length,a=n-r;(0,Z.addError)(t,i,`Punctuation: '${e}'`,void 0,[a,r],{editColumn:a,deleteCount:r})}}}},qV=[`listOrdered`,`listUnordered`],JV={names:[`MD027`,`no-multiple-space-blockquote`],description:`Multiple spaces after blockquote symbol`,tags:[`blockquote`,`whitespace`,`indentation`],parser:`micromark`,function:function(e,t){let n=e.config.list_items,r=n===void 0?!0:!!n,{tokens:i}=e.parsers.micromark;for(let n of $([`linePrefix`])){let a=n.parent,o=a?.type===`codeIndented`,s=a?.children||i;if(!o&&s[s.indexOf(n)-1]?.type===`blockQuotePrefix`&&(r||!qV.includes(s[s.indexOf(n)+1]?.type)&&!(0,Q.getParentOfType)(n,qV))){let{startColumn:r,startLine:i,text:a}=n,{length:o}=a,s=e.lines[i-1];(0,Z.addErrorContext)(t,i,s,void 0,void 0,[r,o],{editColumn:r,deleteCount:o})}}}},YV=new Set([`lineEnding`,`listItemIndent`,`linePrefix`]),XV={names:[`MD028`,`no-blanks-blockquote`],description:`Blank line inside blockquote`,tags:[`blockquote`,`whitespace`],parser:`micromark`,function:function(e,t){for(let n of $([`blockQuote`])){let r=[],i=n.parent?.children||e.parsers.micromark.tokens;for(let e=i.indexOf(n)+1;e<i.length;e++){let{startLine:n,type:a}=i[e];if(a===`lineEndingBlank`)r.push(n);else if(!YV.has(a))if(a===`blockQuote`){for(let e of r)(0,Z.addError)(t,e);break}else break}}}},ZV={one:`1/1/1`,ordered:`1/2/3`,zero:`0/0/0`},QV=Object.keys(ZV);function $V(e){let{startColumn:t,endColumn:n,text:r}=(0,Q.getDescendantsByType)(e,[`listItemValue`])[0];return{startColumn:t,endColumn:n,text:r,number:Number(r)}}var eH={names:[`MD029`,`ol-prefix`],description:`Ordered list item prefix`,tags:[`ol`],parser:`micromark`,function:function(e,t){let n=String(e.config.style);for(let e of $([`listOrdered`])){let r=(0,Q.getDescendantsByType)(e,[`listItemPrefix`]),i=1,a=!1,o=!1,s=!1;if(r.length>0){let e=r[0].endColumn;if(o=r.every(t=>t.endColumn===e),r.length>1){let e=$V(r[0]);($V(r[1]).number!==1||e.number===0)&&(a=!0,e.number===0&&(i=0)),s=e.text.startsWith(`0`)}}let c=QV.includes(n)?n:a?`ordered`:`one`;c===`zero`?i=0:c===`one`&&(i=1);for(let e of r){let n=i.toString(),{endColumn:r,startColumn:a,number:l}=$V(e),u=r-a,d={editColumn:a,deleteCount:u,insertText:o?n.padStart(u,s?`0`:` `):n};(0,Z.addErrorDetailIf)(t,e.startLine,i,l,`Style: `+ZV[c],void 0,[e.startColumn,e.endColumn-e.startColumn],d),c===`ordered`&&i++}}}},tH={names:[`MD030`,`list-marker-space`],description:`Spaces after list markers`,tags:[`ol`,`ul`,`whitespace`],parser:`micromark`,function:function(e,t){let n=Number(e.config.ul_single||1),r=Number(e.config.ol_single||1),i=Number(e.config.ul_multi||1),a=Number(e.config.ol_multi||1);for(let e of $([`listOrdered`,`listUnordered`])){let o=e.type===`listOrdered`,s=e.children.filter(e=>e.type===`listItemPrefix`),c=e.endLine-e.startLine+1===s.length,l=o?c?r:a:c?n:i;for(let e of s){let n=[e.startColumn,e.endColumn-e.startColumn],r=e.children.filter(e=>e.type===`listItemPrefixWhitespace`);for(let e of r){let{endColumn:r,startColumn:i,startLine:a}=e,o=r-i;(0,Z.addErrorDetailIf)(t,a,l,o,void 0,void 0,n,{editColumn:i,deleteCount:o,insertText:``.padEnd(l)})}}}}},nH=/^(.*?)[`~]/;function rH(e,t,n,r){let i=t[n-1],[,a]=i.match(nH)||[],o=a===void 0?void 0:{lineNumber:n+ +!r,insertText:`${a.replace(/[^>]/g,` `).trim()}\n`};(0,Z.addErrorContext)(e,n,i.trim(),void 0,void 0,void 0,o)}var iH={names:[`MD031`,`blanks-around-fences`],description:`Fenced code blocks should be surrounded by blank lines`,tags:[`code`,`blank_lines`],parser:`micromark`,function:function(e,t){let n=e.config.list_items,r=n===void 0?!0:!!n,{lines:i}=e;for(let e of $([`codeFenced`]))(r||!(0,Q.getParentOfType)(e,[`listOrdered`,`listUnordered`]))&&((0,Z.isBlankLine)(i[e.startLine-2])||rH(t,i,e.startLine,!0),!(0,Z.isBlankLine)(i[e.endLine])&&!(0,Z.isBlankLine)(i[e.endLine-1])&&rH(t,i,e.endLine,!1))}},aH=e=>e.type===`listOrdered`||e.type===`listUnordered`,oH={names:[`MD032`,`blanks-around-lists`],description:`Lists should be surrounded by blank lines`,tags:[`bullet`,`ul`,`ol`,`blank_lines`],parser:`micromark`,function:function(e,t){let{lines:n,parsers:r}=e,i=$([`blockQuotePrefix`,`linePrefix`]),a=(0,Q.filterByPredicate)(r.micromark.tokens,aH,e=>aH(e)||e.type===`htmlFlow`?[]:e.children);for(let e of a){let r=e.startLine;(0,Z.isBlankLine)(n[r-2])||(0,Z.addErrorContext)(t,r,n[r-1].trim(),void 0,void 0,void 0,{insertText:(0,Q.getBlockQuotePrefixText)(i,r)});let a=(0,Q.filterByPredicate)(e.children,e=>!Q.nonContentTokens.has(e.type),e=>Q.nonContentTokens.has(e.type)?[]:e.children),o=(a.length>0?a[a.length-1]:e).endLine;(0,Z.isBlankLine)(n[o])||(0,Z.addErrorContext)(t,o,n[o-1].trim(),void 0,void 0,void 0,{lineNumber:o+1,insertText:(0,Q.getBlockQuotePrefixText)(i,o)})}}},sH=e=>Array.isArray(e)?e.map(e=>String(e).toLowerCase()):[],cH={names:[`MD033`,`no-inline-html`],description:`Inline HTML`,tags:[`html`],parser:`micromark`,function:function(e,t){let n=sH(e.config.allowed_elements),r=sH(e.config.table_allowed_elements||e.config.allowed_elements);for(let e of $([`htmlText`],!0)){let i=(0,Q.getHtmlTagInfo)(e);if(i&&!i.close){let a=i?.name.toLowerCase(),o=!!(0,Q.getParentOfType)(e,[`table`]);if((o||!n.includes(a))&&(!o||!r.includes(a))){let n=[e.startColumn,e.text.replace(Z.nextLinesRe,``).length];(0,Z.addError)(t,e.startLine,`Element: `+i.name,void 0,n)}}}}},lH={names:[`MD034`,`no-bare-urls`],description:`Bare URL used`,tags:[`links`,`url`],parser:`micromark`,function:function(e,t){let n=e=>(0,Q.filterByPredicate)(e,e=>{if(e.type===`literalAutolink`&&!(0,Q.inHtmlFlow)(e)){let t=e.parent?.children,n=t?.indexOf(e),r=t?.at(n-1),i=t?.at(n+1);return!(r&&i&&r.type===`data`&&i.type===`data`&&r.text.endsWith(`<`)&&i.text.startsWith(`>`))}return!1},e=>{let{children:t}=e,n=[];for(let e=0;e<t.length;e++){let r=t[e],i=(0,Q.getHtmlTagInfo)(r);if(i&&!i.close){let n=1;for(let r=e+1;r<t.length;r++){let a=t[r],o=(0,Q.getHtmlTagInfo)(a);if(o&&i.name===o.name)if(o.close){if(n--,n===0){e=r;break}}else n++}}else n.push(r)}return n});for(let r of n(e.parsers.micromark.tokens)){let e=[r.startColumn,r.endColumn-r.startColumn],n={editColumn:e[0],deleteCount:e[1],insertText:`<${r.text}>`};(0,Z.addErrorContext)(t,r.startLine,r.text,void 0,void 0,e,n)}}},uH={names:[`MD035`,`hr-style`],description:`Horizontal rule style`,tags:[`hr`],parser:`micromark`,function:function(e,t){let n=String(e.config.style||`consistent`).trim(),r=$([`thematicBreak`]);for(let e of r){let{startLine:r,text:i}=e;n===`consistent`&&(n=i),(0,Z.addErrorDetailIf)(t,r,n,i)}}},dH=[[`emphasis`,`emphasisText`],[`strong`,`strongText`]],fH=e=>!(e.type===`htmlText`||e.type===`data`&&e.text.trim().length===0),pH={names:[`MD036`,`no-emphasis-as-heading`],description:`Emphasis used instead of a heading`,tags:[`headings`,`emphasis`],parser:`micromark`,function:function(e,t){let n=e.config.punctuation;n=String(n===void 0?Z.allPunctuation:n);let r=RegExp(`[`+n+`]$`),i=$([`paragraph`],!0).filter(e=>e.parent?.type===`content`&&(!e.parent?.parent||e.parent?.parent?.type===`htmlFlow`&&!e.parent?.parent?.parent)&&e.children.filter(fH).length===1);for(let e of dH){let n=(0,Q.getDescendantsByType)(i,e);for(let e of n)e.children.length===1&&e.children[0].type===`data`&&!r.test(e.text)&&(0,Z.addErrorContext)(t,e.startLine,e.text)}}},mH={names:[`MD037`,`no-space-in-emphasis`],description:`Spaces inside emphasis markers`,tags:[`whitespace`,`emphasis`],parser:`micromark`,function:function(e,t){let{lines:n,parsers:r}=e,i=new Map;for(let e of[`_`,`__`,`___`,`*`,`**`,`***`])i.set(e,[]);let a=(0,Q.filterByPredicate)(r.micromark.tokens,e=>e.children.some(e=>e.type===`data`));for(let e of a){for(let e of i.values())e.length=0;for(let t of e.children){let{text:e,type:n}=t;if(n===`data`&&e.length<=3){let n=i.get(e);n&&!(0,Q.inHtmlFlow)(t)&&n.push(t)}}for(let[e,r]of i)for(let i=0;i+1<r.length;i+=2){let a=r[i],o=n[a.startLine-1].slice(a.endColumn-1).match(/^\s+\S/);if(o){let[n]=o,r=`${e}${n}`,i=a.endColumn,s=n.length-1;(0,Z.addError)(t,a.startLine,void 0,r,[i,s],{editColumn:i,deleteCount:s})}let s=r[i+1],c=n[s.startLine-1].slice(0,s.startColumn-1).match(/\S\s+$/);if(c){let[n]=c,r=`${n}${e}`,i=s.startColumn-(n.length-1),a=n.length-1;(0,Z.addError)(t,s.startLine,void 0,r,[i,a],{editColumn:i,deleteCount:a})}}}}},hH={names:[`MD038`,`no-space-in-code`],description:`Spaces inside code span elements`,tags:[`whitespace`,`code`],parser:`micromark`,function:function(e,t){let n=$([`codeText`]);for(let e of n){let n=(0,Q.getDescendantsByType)(e,[`codeTextData`]);if(n.length>0){let r=(0,Q.getDescendantsByType)(e,[`codeTextPadding`]),i=r[0],a=n[0],o=/^(\s+)(\S)/.exec(a.text)||[null,``,``],s=o[2]==="`",c=o[1].length-(s&&!i?1:0),l=c>0,u=r[r.length-1],d=n[n.length-1],f=/(\S)(\s+)$/.exec(d.text)||[null,``,``],p=f[1]==="`",m=f[2].length-(p&&!u?1:0),h=m>0,g=l&&h&&i&&u&&!s&&!p,_=e.text;if(l){let e=(g?i:a).startColumn,n=c+(g?i.text.length:0);(0,Z.addErrorContext)(t,a.startLine,_,!0,!1,[e,n],{editColumn:e,deleteCount:n})}if(h){let e=(g?u:d).endColumn,n=m+(g?u.text.length:0);(0,Z.addErrorContext)(t,d.endLine,_,!1,!0,[e-n,n],{editColumn:e-n,deleteCount:n})}}}}};function gH(e,t,n,r){let i=n.text.match(r?/^[^\S\r\n]+/:/[^\S\r\n]+$/),a=i?[r?n.startColumn:n.endColumn-i[0].length,i[0].length]:void 0;(0,Z.addErrorContext)(e,r?n.startLine+ +!i:n.endLine-+!i,t.text.replace(/\s+/g,` `),r,!r,a,a?{editColumn:a[0],deleteCount:a[1]}:void 0)}var _H={names:[`MD039`,`no-space-in-links`],description:`Spaces inside link text`,tags:[`whitespace`,`links`],parser:`micromark`,function:function(e,t){let n=$([`label`]).filter(e=>e.parent?.type===`link`);for(let e of n){let n=e.children.filter(e=>e.type===`labelText`);for(let r of n)r.text.trimStart().length!==r.text.length&&gH(t,e,r,!0),r.text.trimEnd().length!==r.text.length&&gH(t,e,r,!1)}}},vH={names:[`MD040`,`fenced-code-language`],description:`Fenced code blocks should have a language specified`,tags:[`code`,`language`],parser:`micromark`,function:function(e,t){let n=e.config.allowed_languages;n=Array.isArray(n)?n:[];let r=!!e.config.language_only,i=$([`codeFenced`]);for(let e of i){let i=(0,Q.getDescendantsByType)(e,[`codeFencedFence`])[0],{startLine:a,text:o}=i,s=(0,Q.getDescendantsByType)(i,[`codeFencedFenceInfo`])[0]?.text;s?n.length>0&&!n.includes(s)&&(0,Z.addError)(t,a,`"${s}" is not allowed`):(0,Z.addErrorContext)(t,a,o),r&&(0,Q.getDescendantsByType)(i,[`codeFencedFenceMeta`]).length>0&&(0,Z.addError)(t,a,`Info string contains more than language: "${o}"`)}}},yH=/^h[1-6]$/;function bH(e){let{children:t,type:n}=e;if(n===`htmlFlow`){let e=(0,Q.filterByTypes)(t,[`htmlText`],!0),n=e.length>0&&(0,Q.getHtmlTagInfo)(e[0]);if(n)return n.name.toLowerCase()}return null}var xH={names:[`MD041`,`first-line-heading`,`first-line-h1`],description:`First line in a file should be a top-level heading`,tags:[`headings`],parser:`micromark`,function:function(e,t){let n=!!e.config.allow_preamble,r=Number(e.config.level||1),{tokens:i}=e.parsers.micromark;if(!(0,Z.frontMatterHasTitle)(e.frontMatterLines,e.config.front_matter_title)){let a=0;for(let e of i){let{startLine:t,type:i}=e;if(!Q.nonContentTokens.has(i)&&!(0,Q.isHtmlFlowComment)(e)){let o=null;if(i===`atxHeading`||i===`setextHeading`){(0,Q.getHeadingLevel)(e)!==r&&(a=t);break}else if((o=bH(e))&&yH.test(o)){o!==`h${r}`&&(a=t);break}else if(!n){a=t;break}}}a>0&&(0,Z.addErrorContext)(t,a,e.lines[a-1])}}},SH={names:[`MD042`,`no-empty-links`],description:`No empty links`,tags:[`links`],parser:`micromark`,function:function(e,t){let{definitions:n}=cV(),r=e=>{let t=n.get(e.text.trim());return!!(t&&t[1]===`#`)},i=$([`link`]);for(let e of i){let n=(0,Q.getDescendantsByType)(e,[`label`,`labelText`]),i=(0,Q.getDescendantsByType)(e,[`reference`]),a=(0,Q.getDescendantsByType)(e,[`resource`]),o=(0,Q.getDescendantsByType)(i,[`referenceString`]),s=(0,Q.getDescendantsByType)(a,[`resourceDestination`,[`resourceDestinationLiteral`,`resourceDestinationRaw`],`resourceDestinationString`]),c=n.length>0,l=i.length>0,u=a.length>0,d=o.length>0,f=s.length>0,p=!1;c&&(!l&&!u||l&&!d)?p=r(n[0]):d&&!f?p=r(o[0]):!d&&f?p=s[0].text.trim()===`#`:!d&&!f&&(p=!0),p&&(0,Z.addErrorContext)(t,e.startLine,e.text,void 0,void 0,[e.startColumn,e.endColumn-e.startColumn])}}},CH={names:[`MD043`,`required-headings`],description:`Required heading structure`,tags:[`headings`],parser:`micromark`,function:function(e,t){let n=e.config.headings;if(!Array.isArray(n))return;let r=e.config.match_case||!1,i=0,a=!1,o=!1,s=!1,c=()=>String(n[i++]||`[None]`),l=e=>r?e:e.toLowerCase();for(let e of $([`atxHeading`,`setextHeading`]))if(!o){let n=(0,Q.getHeadingText)(e),r=(0,Q.getHeadingLevel)(e);s=!0;let u=`${``.padEnd(r,`#`)} ${n}`,d=c();d===`*`?l(c())!==l(u)&&(a=!0,i--):d===`+`?a=!0:d===`?`||(l(d)===l(u)?a=!1:a?i--:((0,Z.addErrorDetailIf)(t,e.startLine,d,u),o=!0))}let u=n.length-i;!o&&(u>1||u===1&&n[i]!==`*`)&&(s||!n.every(e=>e===`*`))&&(0,Z.addErrorContext)(t,e.lines.length,n[i])}};function wH(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m){let g,v;return b;function b(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),S}function S(t){return t===35?(g=o,w(t)):t===46?(g=s,w(t)):m&&h(t)?ae(e,S,`whitespace`)(t):!m&&C(t)?de(e,S)(t):t===null||x(t)||y(t)||_(t)&&t!==45&&t!==95?ce(t):(e.enter(a),e.enter(c),e.consume(t),ee)}function w(t){let n=g+`Marker`;return e.enter(a),e.enter(g),e.enter(n),e.consume(t),e.exit(n),T}function T(t){if(t===null||t===34||t===35||t===39||t===46||t===60||t===61||t===62||t===96||t===125||C(t))return n(t);let r=g+`Value`;return e.enter(r),e.consume(t),E}function E(t){if(t===null||t===34||t===39||t===60||t===61||t===62||t===96)return n(t);if(t===35||t===46||t===125||C(t)){let n=g+`Value`;return e.exit(n),e.exit(g),e.exit(a),S(t)}return e.consume(t),E}function ee(t){return t===null||x(t)||y(t)||_(t)&&t!==45&&t!==46&&t!==58&&t!==95?(e.exit(c),m&&h(t)?ae(e,te,`whitespace`)(t):!m&&C(t)?de(e,te)(t):te(t)):(e.consume(t),ee)}function te(t){return t===61?(e.enter(l),e.consume(t),e.exit(l),D):(e.exit(a),S(t))}function D(t){return t===null||t===60||t===61||t===62||t===96||t===125||m&&x(t)?n(t):t===34||t===39?(e.enter(u),e.enter(f),e.consume(t),e.exit(f),v=t,re):m&&h(t)?ae(e,D,`whitespace`)(t):!m&&C(t)?de(e,D)(t):(e.enter(d),e.enter(p),e.consume(t),v=void 0,ne)}function ne(t){return t===null||t===34||t===39||t===60||t===61||t===62||t===96?n(t):t===125||C(t)?(e.exit(p),e.exit(d),e.exit(a),S(t)):(e.consume(t),ne)}function re(t){return t===v?(e.enter(f),e.consume(t),e.exit(f),e.exit(u),e.exit(a),se):(e.enter(d),ie(t))}function ie(t){return t===v?(e.exit(d),re(t)):t===null?n(t):x(t)?m?n(t):de(e,ie)(t):(e.enter(p),e.consume(t),oe)}function oe(t){return t===v||t===null||x(t)?(e.exit(p),ie(t)):(e.consume(t),oe)}function se(e){return e===125||C(e)?S(e):ce(e)}function ce(a){return a===125?(e.enter(i),e.consume(a),e.exit(i),e.exit(r),t):n(a)}}function TH(e,t,n,r,i,a,o){let s=0,c=0,l;return u;function u(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),d}function d(n){return n===93?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),f(n))}function f(t){if(t===93&&!c)return h(t);let n=e.enter(`chunkText`,{_contentTypeTextTrailing:!0,contentType:`text`,previous:l});return l&&(l.next=n),l=n,p(t)}function p(t){return t===null||s>999||t===91&&++c>32?n(t):t===93&&!c--?(e.exit(`chunkText`),h(t)):x(t)?o?n(t):(e.consume(t),e.exit(`chunkText`),f):(e.consume(t),t===92?m:p)}function m(t){return t===91||t===92||t===93?(e.consume(t),s++,p):p(t)}function h(n){return e.exit(a),e.enter(i),e.consume(n),e.exit(i),e.exit(r),t}}function EH(e,t,n,r){let i=this;return a;function a(t){return t===null||x(t)||_(t)||y(t)?n(t):(e.enter(r),e.consume(t),o)}function o(a){return a===null||x(a)||y(a)||_(a)&&a!==45&&a!==95?(e.exit(r),i.previous===45||i.previous===95?n(a):t(a)):(e.consume(a),o)}}var DH={tokenize:jH,concrete:!0},OH={tokenize:MH,partial:!0},kH={tokenize:NH,partial:!0},AH={tokenize:PH,partial:!0};function jH(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0,s;return c;function c(t){return e.enter(`directiveContainer`),e.enter(`directiveContainerFence`),e.enter(`directiveContainerSequence`),l(t)}function l(t){return t===58?(e.consume(t),o++,l):o<3?n(t):(e.exit(`directiveContainerSequence`),EH.call(r,e,u,n,`directiveContainerName`)(t))}function u(t){return t===91?e.attempt(OH,d,d)(t):d(t)}function d(t){return t===123?e.attempt(kH,f,f)(t):f(t)}function f(t){return ae(e,p,`whitespace`)(t)}function p(i){return e.exit(`directiveContainerFence`),i===null?w(i):x(i)?r.interrupt?t(i):e.attempt(AH,m,w)(i):n(i)}function m(t){return t===null?w(t):x(t)?e.check(AH,y,w)(t):(e.enter(`directiveContainerContent`),h(t))}function h(t){return e.attempt({tokenize:T,partial:!0},C,a?ae(e,g,`linePrefix`,a+1):g)(t)}function g(t){return t===null?C(t):x(t)?e.check(AH,v,C)(t):v(t)}function _(t){if(t===null){let n=e.exit(`chunkDocument`);return r.parser.lazy[n.start.line]=!1,C(t)}return x(t)?e.check(AH,b,S)(t):(e.consume(t),_)}function v(t){let n=e.enter(`chunkDocument`,{contentType:`document`,previous:s});return s&&(s.next=n),s=n,_(t)}function y(t){return e.enter(`directiveContainerContent`),h(t)}function b(t){e.consume(t);let n=e.exit(`chunkDocument`);return r.parser.lazy[n.start.line]=!1,h}function S(t){let n=e.exit(`chunkDocument`);return r.parser.lazy[n.start.line]=!1,C(t)}function C(t){return e.exit(`directiveContainerContent`),w(t)}function w(n){return e.exit(`directiveContainer`),t(n)}function T(e,t,n){let i=0;return ae(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4);function a(t){return e.enter(`directiveContainerFence`),e.enter(`directiveContainerSequence`),s(t)}function s(t){return t===58?(e.consume(t),i++,s):i<o?n(t):(e.exit(`directiveContainerSequence`),ae(e,c,`whitespace`)(t))}function c(r){return r===null||x(r)?(e.exit(`directiveContainerFence`),t(r)):n(r)}}}function MH(e,t,n){return TH(e,t,n,`directiveContainerLabel`,`directiveContainerLabelMarker`,`directiveContainerLabelString`,!0)}function NH(e,t,n){return wH(e,t,n,`directiveContainerAttributes`,`directiveContainerAttributesMarker`,`directiveContainerAttribute`,`directiveContainerAttributeId`,`directiveContainerAttributeClass`,`directiveContainerAttributeName`,`directiveContainerAttributeInitializerMarker`,`directiveContainerAttributeValueLiteral`,`directiveContainerAttributeValue`,`directiveContainerAttributeValueMarker`,`directiveContainerAttributeValueData`,!0)}function PH(e,t,n){let r=this;return i;function i(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var FH={tokenize:RH},IH={tokenize:zH,partial:!0},LH={tokenize:BH,partial:!0};function RH(e,t,n){let r=this;return i;function i(t){return e.enter(`directiveLeaf`),e.enter(`directiveLeafSequence`),e.consume(t),a}function a(t){return t===58?(e.consume(t),e.exit(`directiveLeafSequence`),EH.call(r,e,o,n,`directiveLeafName`)):n(t)}function o(t){return t===91?e.attempt(IH,s,s)(t):s(t)}function s(t){return t===123?e.attempt(LH,c,c)(t):c(t)}function c(t){return ae(e,l,`whitespace`)(t)}function l(r){return r===null||x(r)?(e.exit(`directiveLeaf`),t(r)):n(r)}}function zH(e,t,n){return TH(e,t,n,`directiveLeafLabel`,`directiveLeafLabelMarker`,`directiveLeafLabelString`,!0)}function BH(e,t,n){return wH(e,t,n,`directiveLeafAttributes`,`directiveLeafAttributesMarker`,`directiveLeafAttribute`,`directiveLeafAttributeId`,`directiveLeafAttributeClass`,`directiveLeafAttributeName`,`directiveLeafAttributeInitializerMarker`,`directiveLeafAttributeValueLiteral`,`directiveLeafAttributeValue`,`directiveLeafAttributeValueMarker`,`directiveLeafAttributeValueData`,!0)}var VH={tokenize:GH,previous:WH},HH={tokenize:KH,partial:!0},UH={tokenize:qH,partial:!0};function WH(e){return e!==58||this.events[this.events.length-1][1].type===`characterEscape`}function GH(e,t,n){let r=this;return i;function i(t){return e.enter(`directiveText`),e.enter(`directiveTextMarker`),e.consume(t),e.exit(`directiveTextMarker`),EH.call(r,e,a,n,`directiveTextName`)}function a(t){return t===58?n(t):t===91?e.attempt(HH,o,o)(t):o(t)}function o(t){return t===123?e.attempt(UH,s,s)(t):s(t)}function s(n){return e.exit(`directiveText`),t(n)}}function KH(e,t,n){return TH(e,t,n,`directiveTextLabel`,`directiveTextLabelMarker`,`directiveTextLabelString`)}function qH(e,t,n){return wH(e,t,n,`directiveTextAttributes`,`directiveTextAttributesMarker`,`directiveTextAttribute`,`directiveTextAttributeId`,`directiveTextAttributeClass`,`directiveTextAttributeName`,`directiveTextAttributeInitializerMarker`,`directiveTextAttributeValueLiteral`,`directiveTextAttributeValue`,`directiveTextAttributeValueMarker`,`directiveTextAttributeValueData`)}function JH(){return{text:{58:VH},flow:{58:[DH,FH]}}}var YH=Ie();function XH(){let e={...JH()};return delete e.text,e}function ZH(e,t){return e.slice(t.start.offset,t.end.offset)}function QH(e,t={}){let n=[XH(),Me(),ge(),j(),bP(),...t.extensions||[]],r=[],i=k.tokenize;function a(t,n,a){let o=this,s=o.events;return i.call(o,t,n,t=>{let n=s.length;for(;--n>=0;){let[e,t]=s[n];if(e===`enter`){let{type:e}=t;if(e===`labelImage`||e===`labelLink`)break}}if(n>=0){let[,t]=s[n],[,i]=s[s.length-1],a={type:`undefinedReferenceShortcut`,start:t.start,end:i.end},c={type:`undefinedReference`,start:t.start,end:i.end},l=s.slice(n).filter(e=>{let[,t]=e,{type:n}=t;return n===`data`||n===`lineEnding`}),u=r.length>0&&r[r.length-1][0],d=u&&u[1];d&&d.end.line===a.start.line&&d.end.column===a.start.column&&(l.length===0?(d.type=`undefinedReferenceCollapsed`,d.end=i.end):(a.type=`undefinedReferenceFull`,a.start=d.start,r.pop()));let f=l.filter(e=>e[0]===`enter`).map(t=>ZH(e,t[1])).join(``).trim();if(f.length>0&&!f.includes(`]`)){let e=[[`enter`,a,o],[`enter`,c,o]];for(let t of l){let[n,r]=t;e.push([n,{...r},o])}e.push([`exit`,c,o],[`exit`,a,o]),r.push(e)}}return a(t)})}try{k.tokenize=a;let i=me({...t,extensions:n}),o=we()(e,void 0,!0);return ce(i.document().write(o)).concat(...r)}finally{k.tokenize=i}}function $H(e,t={},n={},r=0,i=void 0){let a=!!t.freezeTokens,o=QH(e,n),s=[],c=[],l={type:`data`,startLine:-1,startColumn:-1,endLine:-1,endColumn:-1,text:`ROOT`,children:s,parent:null},u=[l],d=l,f=null,p=null,m=!1;for(let s of o){let[o,h]=s,{type:g,start:_,end:v}=h,{column:y,line:b}=_,{column:x,line:S}=v,C=ZH(e,h);if(o===`enter`&&!m){let a=d;if(u.push(a),d={type:g,startLine:b+r,startColumn:y,endLine:S+r,endColumn:x,text:C,children:[],parent:a===l?i||null:a},i&&Object.defineProperty(d,YH.htmlFlowSymbol,{value:!0}),a.children.push(d),c.push(d),d.type===`htmlFlow`&&!(0,Q.isHtmlFlowComment)(d)){m=!0,(!f||!p)&&(f={...n,extensions:[{disable:{null:[`codeIndented`,`htmlFlow`]}}]},p=e.split(YH.newlineRe));let r=$H(p.slice(d.startLine-1,d.endLine).join(`
378
- `),t,f,d.startLine-1,d);d.children=r,c=c.concat(r[YH.flatTokensSymbol])}}else o===`exit`&&(g===`htmlFlow`&&(m=!1),m||(a&&(Object.freeze(d.children),Object.freeze(d)),d=u.pop()))}return Object.defineProperty(s,YH.flatTokensSymbol,{value:c}),a&&Object.freeze(s),s}function eU(e,t){return $H(e,t)}var tU=new Set([`codeFencedFence`,`definition`,`reference`,`resource`]),nU={names:[`MD044`,`proper-names`],description:`Proper names should have the correct capitalization`,tags:[`spelling`],parser:`micromark`,function:function(e,t){let n=e.config.names;if(n=Array.isArray(n)?n:[],n.sort((e,t)=>t.length-e.length||e.localeCompare(t)),n.length===0)return;let r=e.config.code_blocks,i=r===void 0?!0:!!r,a=e.config.html_elements,o=a===void 0?!0:!!a,s=new Set([`data`]);i&&(s.add(`codeFlowValue`),s.add(`codeTextData`)),o&&(s.add(`htmlFlowData`),s.add(`htmlTextData`));let c=(0,Q.filterByPredicate)(e.parsers.micromark.tokens,e=>s.has(e.type),e=>e.children.filter(e=>!tU.has(e.type))),l=[],u=new Set;for(let e of n){let r=(0,Z.escapeForRegExp)(e),i=`(${/^\W/.test(e)?``:`\\b_*`})(${r})${/\W$/.test(e)?``:`_*\\b`}`,a=new RegExp(i,`gi`);for(let r of c){let i=null;for(;(i=a.exec(r.text))!==null;){let[,a,o]=i,s=r.startColumn+i.index+a.length,c=o.length,d=r.startLine,f={startLine:d,startColumn:s,endLine:d,endColumn:s+c-1};if(!n.includes(o)&&!l.some(e=>(0,Z.hasOverlap)(e,f))){let n=[];u.has(r)||(n=(0,Q.filterByTypes)(eU(r.text),[`literalAutolink`]).map(e=>({startLine:d,startColumn:r.startColumn+e.startColumn-1,endLine:d,endColumn:r.endColumn+e.endColumn-1})),l.push(...n),u.add(r)),n.some(e=>(0,Z.hasOverlap)(e,f))||(0,Z.addErrorDetailIf)(t,r.startLine,e,o,void 0,void 0,[s,c],{editColumn:s,deleteCount:c,insertText:e})}l.push(f)}}}}},rU=(0,Z.getHtmlAttributeRe)(`alt`),iU=(0,Z.getHtmlAttributeRe)(`aria-hidden`),aU={names:[`MD045`,`no-alt-text`],description:`Images should have alternate text (alt text)`,tags:[`accessibility`,`images`],parser:`micromark`,function:function(e,t){let n=$([`image`]);for(let e of n)if((0,Q.getDescendantsByType)(e,[`label`,`labelText`]).some(e=>e.text.length===0)){let n=e.startLine===e.endLine?[e.startColumn,e.endColumn-e.startColumn]:void 0;(0,Z.addError)(t,e.startLine,void 0,void 0,n)}let r=$([`htmlText`],!0);for(let e of r){let{startColumn:n,startLine:r,text:i}=e,a=(0,Q.getHtmlTagInfo)(e);a&&!a.close&&a.name.toLowerCase()===`img`&&!rU.test(i)&&iU.exec(i)?.[1].toLowerCase()!==`true`&&(0,Z.addError)(t,r,void 0,void 0,[n,i.replace(Z.nextLinesRe,``).length])}}},oU=e=>e===`codeFenced`?`fenced`:`indented`,sU={names:[`MD046`,`code-block-style`],description:`Code block style`,tags:[`code`],parser:`micromark`,function:function(e,t){let n=String(e.config.style||`consistent`);for(let e of $([`codeFenced`,`codeIndented`])){let{startLine:r,type:i}=e;n===`consistent`&&(n=oU(i)),(0,Z.addErrorDetailIf)(t,r,n,oU(i))}}},cU={names:[`MD047`,`single-trailing-newline`],description:`Files should end with a single newline character`,tags:[`blank_lines`],parser:`none`,function:function(e,t){let n=e.lines.length,r=e.lines[n-1];(0,Z.isBlankLine)(r)||(0,Z.addError)(t,n,void 0,void 0,[r.length,1],{insertText:`
379
- `,editColumn:r.length+1})}};function lU(e){switch(e[0]){case`~`:return`tilde`;default:return`backtick`}}var uU={names:[`MD048`,`code-fence-style`],description:`Code fence style`,tags:[`code`],parser:`micromark`,function:function(e,t){let n=String(e.config.style||`consistent`),r=$([`codeFenced`]);for(let e of r){let{startLine:r,text:i}=(0,Q.getDescendantsByType)(e,[`codeFencedFence`,`codeFencedFenceSequence`])[0];n===`consistent`&&(n=lU(i)),(0,Z.addErrorDetailIf)(t,r,n,lU(i))}}},dU=/^\w$/;function fU(e){switch(e[0]){case`*`:return`asterisk`;default:return`underscore`}}var pU=(e,t,n,r,i,a,o=`consistent`)=>{let{lines:s,parsers:c}=e,l=(0,Q.filterByPredicate)(c.micromark.tokens,e=>e.type===n,e=>e.type===`htmlFlow`?[]:e.children);for(let e of l){let n=(0,Q.getDescendantsByType)(e,[r]),c=n[0],l=n[n.length-1];if(c&&l){let e=fU(c.text);if(o===`consistent`&&(o=e),o!==e&&!(o===`underscore`&&(dU.test(s[c.startLine-1][c.startColumn-2])||dU.test(s[l.endLine-1][l.endColumn-1]))))for(let n of[c,l])(0,Z.addError)(t,n.startLine,`Expected: ${o}; Actual: ${e}`,void 0,[n.startColumn,n.text.length],{editColumn:n.startColumn,deleteCount:n.text.length,insertText:o===`asterisk`?i:a})}}},mU=[{names:[`MD049`,`emphasis-style`],description:`Emphasis style`,tags:[`emphasis`],parser:`micromark`,function:function(e,t){return pU(e,t,`emphasis`,`emphasisSequence`,`*`,`_`,e.config.style||void 0)}},{names:[`MD050`,`strong-style`],description:`Strong style`,tags:[`emphasis`],parser:`micromark`,function:function(e,t){return pU(e,t,`strong`,`strongSequence`,`**`,`__`,e.config.style||void 0)}}],hU=(0,Z.getHtmlAttributeRe)(`id`),gU=(0,Z.getHtmlAttributeRe)(`name`),_U=/\{(#[a-z\d]+(?:[-_][a-z\d]+)*)\}/gu,vU=/^#(?:L\d+(?:C\d+)?-L\d+(?:C\d+)?|L\d+)$/,yU=new Set([`image`,`reference`,`resource`]),bU=new Set([`characterEscapeValue`,`codeTextData`,`data`,`mathTextData`]);function xU(e){let t=(0,Q.filterByPredicate)(e.children,e=>bU.has(e.type),e=>yU.has(e.type)?[]:e.children).map(e=>e.text).join(``);return`#`+encodeURIComponent(t.toLowerCase().replace(/[^\p{Letter}\p{Mark}\p{Number}\p{Connector_Punctuation}\- ]/gu,``).replace(/ /gu,`-`).toWellFormed())}function SU(e){return(0,Q.filterByTypes)(e.children,[`characterEscapeValue`,`data`]).map(e=>e.text).join(``)}var CU={names:[`MD051`,`link-fragments`],description:`Link fragments should be valid`,tags:[`links`],parser:`micromark`,function:function(e,t){let n=e.config.ignore_case||!1,r=e.config.ignored_pattern||``,i=new RegExp(r||`^$`),a=new Map([[`#top`,0]]),o=$([`atxHeadingText`,`setextHeadingText`]);for(let e of o){let t=xU(e);if(t!==`#`){let n=a.get(t)||0;n&&a.set(`${t}-${n}`,0),a.set(t,n+1);let r=null;for(;(r=_U.exec(e.text))!==null;){let[,e]=r;a.has(e)||a.set(e,1)}}}for(let e of $([`htmlText`],!0)){let t=(0,Q.getHtmlTagInfo)(e);if(t&&!t.close){let n=hU.exec(e.text)||t.name.toLowerCase()===`a`&&gU.exec(e.text);n&&n.length>0&&a.set(`#${n[1]}`,0)}}for(let[e,r]of[[`link`,`resourceDestinationString`],[`definition`,`definitionDestinationString`]]){let o=$([e]).filter(e=>!(e.parent?.type===`atxHeadingText`&&(0,Q.isDocfxTab)(e.parent.parent)));for(let e of o){let o=(0,Q.filterByTypes)(e.children,[r]);for(let r of o){let{endColumn:o,startColumn:s}=r,c=SU(r),l=c.slice(1),u=`#${encodeURIComponent(l.toWellFormed())}`;if(c.length>1&&c.startsWith(`#`)&&!a.has(u)&&!vU.test(u)&&!i.test(l)){let r,i,l;e.startLine===e.endLine&&(r=e.text,i=[e.startColumn,e.endColumn-e.startColumn],l={editColumn:s,deleteCount:o-s});let u=c.toLowerCase(),d=[...a.keys()].find(e=>u===e.toLowerCase());d?((l||{}).insertText=d,!n&&d!==c&&(0,Z.addError)(t,e.startLine,`Expected: ${d}; Actual: ${c}`,r,i,l)):(0,Z.addError)(t,e.startLine,void 0,r,i)}}}}}},wU={names:[`MD052`,`reference-links-images`],description:`Reference links and images should use a label that is defined`,tags:[`images`,`links`],parser:`none`,function:function(e,t){let{config:n,lines:r}=e,i=n.shortcut_syntax||!1,a=new Set(n.ignored_labels||[`x`]),{definitions:o,references:s,shortcuts:c}=cV(),l=i?[...s.entries(),...c.entries()]:s.entries();for(let e of l){let[n,i]=e;if(!o.has(n)&&!a.has(n))for(let e of i){let[i,a,o]=e,s=r[i].slice(a,a+o);(0,Z.addError)(t,i+1,`Missing link or image reference definition: "${n}"`,s,[a+1,s.length])}}}},TU=/^ {0,3}\[([^\]]*[^\\])\]:/,EU={names:[`MD053`,`link-image-reference-definitions`],description:`Link and image reference definitions should be needed`,tags:[`images`,`links`],parser:`none`,function:function(e,t){let n=new Set(e.config.ignored_definitions||[`//`]),r=e.lines,{references:i,shortcuts:a,definitions:o,duplicateDefinitions:s}=cV(),c=e=>e.replace(TU,``).trim().length>0,l={deleteCount:-1};for(let e of o.entries()){let[o,[s]]=e;if(!n.has(o)&&!i.has(o)&&!a.has(o)){let e=r[s];(0,Z.addError)(t,s+1,`Unused link or image reference definition: "${o}"`,(0,Z.ellipsify)(e),[1,e.length],c(e)?l:void 0)}}for(let e of s){let[i,a]=e;if(!n.has(i)){let e=r[a];(0,Z.addError)(t,a+1,`Duplicate link or image reference definition: "${i}"`,(0,Z.ellipsify)(e),[1,e.length],c(e)?l:void 0)}}}},DU=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,OU=e=>e.replace(DU,`$1`),kU=/[ <>]/,AU=e=>{try{new URL(e)}catch{return!1}return!kU.test(e)},jU={names:[`MD054`,`link-image-style`],description:`Link and image style`,tags:[`images`,`links`],parser:`micromark`,function:(e,t)=>{let n=e.config,r=n.autolink===void 0||!!n.autolink,i=n.inline===void 0||!!n.inline,a=n.full===void 0||!!n.full,o=n.collapsed===void 0||!!n.collapsed,s=n.shortcut===void 0||!!n.shortcut,c=n.url_inline===void 0||!!n.url_inline;if(r&&i&&a&&o&&s&&c)return;let{definitions:l}=cV(),u=$([`autolink`,`image`,`link`]);for(let e of u){let n=null,u=null,{endColumn:d,endLine:f,startColumn:p,startLine:m,text:h,type:g}=e,_=g===`image`,v=!1;if(g===`autolink`)u=(0,Q.getDescendantsByType)(e,[[`autolinkEmail`,`autolinkProtocol`]])[0]?.text,n=u,v=!r&&!!u;else if(n=(0,Q.getDescendantsByType)(e,[`label`,`labelText`])[0].text,u=(0,Q.getDescendantsByType)(e,[`resource`,`resourceDestination`,[`resourceDestinationLiteral`,`resourceDestinationRaw`],`resourceDestinationString`])[0]?.text,u){let t=(0,Q.getDescendantsByType)(e,[`resource`,`resourceTitle`,`resourceTitleString`])[0]?.text;v=!i||!c&&r&&!_&&!t&&n===u&&AU(u)}else{let t=(0,Q.getDescendantsByType)(e,[`reference`]).length===0,r=(0,Q.getDescendantsByType)(e,[`reference`,`referenceString`])[0]?.text,i=r===void 0,c=l.get(r||n);u=c&&c[1]||``,v=!!(u&&(t?!s:i?!o:!a))}if(v){let e,a;if(m===f){e=[p,d-p];let t=null,o=i&&n,s=r&&!_&&AU(u);o&&(c||!s)?t=`${_?`!`:``}[${n.replace(/[[\]]/g,`\\$&`)}](${u.replace(/[()]/g,`\\$&`)})`:s&&(t=`<${OU(u)}>`),t&&(a={editColumn:e[0],insertText:t,deleteCount:e[1]})}(0,Z.addErrorContext)(t,m,h.replace(Z.nextLinesRe,``),void 0,void 0,e,a)}}}},MU=new Set([`linePrefix`,`whitespace`]),NU=e=>e.filter(e=>!MU.has(e.type)),PU=e=>e[0],FU=e=>e[e.length-1],IU=(e,t)=>[e,t-e+1],LU={names:[`MD055`,`table-pipe-style`],description:`Table pipe style`,tags:[`table`],parser:`micromark`,function:function(e,t){let n=String(e.config.style||`consistent`),r=n!==`no_leading_or_trailing`&&n!==`trailing_only`,i=n!==`no_leading_or_trailing`&&n!==`leading_only`,a=$([`tableDelimiterRow`,`tableRow`]);for(let e of a){let a=PU(e.children),o=PU(NU(a.children)).type===`tableCellDivider`,s=FU(e.children),c=FU(NU(s.children)).type===`tableCellDivider`,l=o?c?`leading_and_trailing`:`leading_only`:c?`trailing_only`:`no_leading_or_trailing`;n===`consistent`&&(n=l,r=o,i=c),o!==r&&(0,Z.addErrorDetailIf)(t,a.startLine,n,l,`${r?`Missing`:`Unexpected`} leading pipe`,void 0,IU(e.startColumn,a.startColumn)),c!==i&&(0,Z.addErrorDetailIf)(t,s.endLine,n,l,`${i?`Missing`:`Unexpected`} trailing pipe`,void 0,IU(s.endColumn-1,e.endColumn-1))}}},RU=(e,t)=>[e,t-e+1],zU={names:[`MD056`,`table-column-count`],description:`Table column count`,tags:[`table`],parser:`micromark`,function:function(e,t){let n=$([`tableDelimiterRow`,`tableRow`]),r=0,i=null;for(let e of n){let n=(0,Q.getParentOfType)(e,[`table`]);i!==n&&(r=0,i=n);let a=e.children.filter(e=>[`tableData`,`tableDelimiter`,`tableHeader`].includes(e.type)),o=a.length;r||=o;let s,c;o<r?(s=`Too few cells, row will be missing data`,c=[e.endColumn-1,1]):r<o&&(s=`Too many cells, extra data will be missing`,c=RU(a[r].startColumn,e.endColumn-1)),(0,Z.addErrorDetailIf)(t,e.endLine,r,o,s,void 0,c)}}},BU={names:[`MD058`,`blanks-around-tables`],description:`Tables should be surrounded by blank lines`,tags:[`table`],parser:`micromark`,function:function(e,t){let{lines:n}=e,r=$([`blockQuotePrefix`,`linePrefix`]),i=$([`table`]);for(let e of i){let i=e.startLine;(0,Z.isBlankLine)(n[i-2])||(0,Z.addErrorContext)(t,i,n[i-1].trim(),void 0,void 0,void 0,{insertText:(0,Q.getBlockQuotePrefixText)(r,i)});let a=e.endLine;(0,Z.isBlankLine)(n[a])||(0,Z.addErrorContext)(t,a,n[a-1].trim(),void 0,void 0,void 0,{lineNumber:a+1,insertText:(0,Q.getBlockQuotePrefixText)(r,a)})}}},VU=new Set([`codeText`,`htmlText`]),HU=[`click here`,`here`,`link`,`more`];function UU(e){return e.replace(/[\W_]+/g,` `).replace(/\s+/g,` `).toLowerCase().trim()}var WU={names:[`MD059`,`descriptive-link-text`],description:`Link text should be descriptive`,tags:[`accessibility`,`links`],parser:`micromark`,function:function(e,t){let n=new Set((e.config.prohibited_texts||HU).map(UU));if(n.size>0){let e=$([`link`]);for(let r of e){let e=(0,Q.getDescendantsByType)(r,[`label`,`labelText`]);for(let r of e){let{children:e,endColumn:i,endLine:a,parent:o,startColumn:s,startLine:c,text:l}=r;if(!e.some(e=>VU.has(e.type))&&n.has(UU(l))){let e=c===a?[s,i-s]:void 0;(0,Z.addErrorContext)(t,c,o.text,void 0,void 0,e)}}}}}};function GU({onlyFirst:e=!1}={}){return RegExp(`(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]`,e?void 0:`g`)}var KU=GU();function qU(e){if(typeof e!=`string`)throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return!e.includes(`\x1B`)&&!e.includes(`›`)?e:e.replace(KU,``)}var JU=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],YU=[12288,12288,65281,65376,65504,65510],XU=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],ZU=(e,t)=>{let n=0,r=Math.floor(e.length/2)-1;for(;n<=r;){let i=Math.floor((n+r)/2),a=i*2;if(t<e[a])r=i-1;else if(t>e[a+1])n=i+1;else return!0}return!1},QU=19968,[$U,eW]=tW(XU);function tW(e){let t=e[0],n=e[1];for(let r=0;r<e.length;r+=2){let i=e[r],a=e[r+1];if(QU>=i&&QU<=a)return[i,a];a-i>n-t&&(t=i,n=a)}return[t,n]}var nW=e=>e<161||e>1114109?!1:ZU(JU,e),rW=e=>e<12288||e>65510?!1:ZU(YU,e),iW=e=>e>=$U&&e<=eW?!0:e<4352||e>262141?!1:ZU(XU,e);function aW(e){if(!Number.isSafeInteger(e))throw TypeError(`Expected a code point, got \`${typeof e}\`.`)}function oW(e,{ambiguousAsWide:t=!1}={}){return aW(e),rW(e)||iW(e)||t&&nW(e)?2:1}var sW=new Intl.Segmenter,cW=RegExp(`^(?:\\p{Default_Ignorable_Code_Point}|\\p{Control}|\\p{Format}|\\p{Mark}|\\p{Surrogate})+$`,`v`),lW=RegExp(`^[\\p{Default_Ignorable_Code_Point}\\p{Control}\\p{Format}\\p{Mark}\\p{Surrogate}]+`,`v`),uW=RegExp(`^\\p{RGI_Emoji}$`,`v`),dW=/^[\d#*]\u20E3$/,fW=/\p{Extended_Pictographic}/gu;function pW(e){if(e.length>50)return!1;if(dW.test(e))return!0;if(e.includes(`‍`)){let t=e.match(fW);return t!==null&&t.length>=2}return!1}function mW(e){return e.replace(lW,``)}function hW(e){return cW.test(e)}function gW(e){return e>=4352&&e<=4447||e>=43360&&e<=43388}function _W(e){return e>=4448&&e<=4519||e>=55216&&e<=55238}function vW(e){return e>=4520&&e<=4607||e>=55243&&e<=55291}function yW(e){return gW(e)||_W(e)||vW(e)}function bW(e,t){let n=[];for(let t of e)cW.test(t)||n.push(t.codePointAt(0));if(n.length===0)return;let r=0;for(let e=0;e<n.length;e++){let i=n[e];if(!yW(i)){if(r===0)return;for(let i=e;i<n.length;i++)r+=oW(n[i],t);return r}if(gW(i)&&_W(n[e+1])){r+=2,e+=vW(n[e+2])?2:1;continue}r+=oW(i,t)}return r}function xW(e,t){let n=0,r=!0;for(let i of e){if(r){r=!1;continue}i>=`＀`&&i<=`￯`&&(n+=oW(i.codePointAt(0),t))}return n}function SW(e,t={}){if(typeof e!=`string`||e.length===0)return 0;let{ambiguousIsNarrow:n=!0,countAnsiEscapeCodes:r=!1}=t,i=e;if(!r&&(i.includes(`\x1B`)||i.includes(`›`))&&(i=qU(i)),i.length===0)return 0;if(/^[\u0020-\u007E]*$/.test(i))return i.length;let a=0,o={ambiguousAsWide:!n};for(let{segment:e}of sW.segment(i)){if(hW(e))continue;if(uW.test(e)||pW(e)){a+=2;continue}let t=mW(e),n=bW(t,o);if(n!==void 0){a+=n;continue}let r=t.codePointAt(0);a+=oW(r,o),a+=xW(t,o)}return a}function CW(e,t,n,r,i){e.push({lineNumber:t,detail:r,range:[n,1],fixInfo:i})}function wW(e,t){return(0,Q.filterByTypes)(t.children,[`tableCellDivider`]).map(n=>({actual:n.startColumn,effective:SW(e[t.startLine-1].slice(0,n.startColumn-1))}))}function TW(e,t,n){let r=[],i=t[0],a=wW(e,i);for(let i of t.slice(1)){let t=new Set(a.map(e=>e.effective)),o=wW(e,i);for(let e of o)t.size>0&&!t.delete(e.effective)&&CW(r,i.startLine,e.actual,n)}return r}var EW={names:[`MD060`,`table-column-style`],description:`Table column style`,tags:[`table`],parser:`micromark`,function:function(e,t){let n=String(e.config.style||`any`),r=n===`any`||n===`aligned`,i=n===`any`||n===`compact`,a=n===`any`||n===`tight`,o=!!e.config.aligned_delimiter,s=e.lines,c=$([`table`]);for(let e of c){let n=(0,Q.filterByTypes)(e.children,[`tableDelimiterRow`,`tableRow`]),c=[];r&&c.push(...TW(s,n,`Table pipe does not align with header for style "aligned"`));let l=[],u=[];if((i||a)&&!(r&&c.length===0)){if(o){let e=TW(s,n.slice(0,2),`Table pipe does not align with header for option "aligned_delimiter"`);l.push(...e),u.push(...e)}for(let e of n){let t=(0,Q.filterByTypes)(e.children,[`tableCellDivider`,`tableContent`,`whitespace`]);for(let n=0;n<t.length;n++){let{startColumn:r,startLine:i,type:a}=t[n];if(a===`tableCellDivider`){let a=t[n-1];a&&(a.type===`whitespace`?(a.text.length!==1&&CW(l,i,r,`Table pipe has extra space to the left for style "compact"`,{editColumn:a.startColumn,deleteCount:a.text.length-1}),CW(u,i,r,`Table pipe has space to the left for style "tight"`,{editColumn:a.startColumn,deleteCount:a.text.length})):CW(l,i,r,`Table pipe is missing space to the left for style "compact"`,{editColumn:a.endColumn,insertText:` `}));let o=t[n+1];o&&(o.type===`whitespace`?o.endColumn!==e.endColumn&&(o.text.length!==1&&CW(l,i,r,`Table pipe has extra space to the right for style "compact"`,{editColumn:o.startColumn,deleteCount:o.text.length-1}),CW(u,i,r,`Table pipe has space to the right for style "tight"`,{editColumn:o.startColumn,deleteCount:o.text.length})):CW(l,i,r,`Table pipe is missing space to the right for style "compact"`,{editColumn:o.startColumn,insertText:` `}))}}}}let d=c;i&&(l.length<d.length||!r)&&(d=l),a&&(u.length<d.length||!r&&!i)&&(d=u);for(let e of d)t(e)}}},[DW,OW]=LV,[kW,AW]=mU,jW=[mV,hV,bV,xV,wV,TV,DV,kV,AV,MV,PV,FV,DW,RV,OW,HV,UV,WV,GV,KV,JV,XV,eH,tH,iH,oH,cH,lH,uH,pH,mH,hH,_H,vH,xH,SH,CH,nU,aU,sU,cU,uU,kW,AW,CU,wU,EU,jU,LU,zU,BU,WU,EW];for(let e of jW){let t=e.names[0].toLowerCase();e.information=new URL(`${lV}/blob/v${uV}/doc/${t}.md`)}function MW(e,t,n){let r=null,i=null,a=[],o=0;return(n||[JSON.parse]).every(e=>{try{let n=e(t);return r=n&&typeof n==`object`&&!Array.isArray(n)?n:{},!1}catch(e){a.push(`Parser ${o++}: ${e?.message}`)}return!0})&&(a.unshift(`Unable to parse '${e}'`),i=a.join(`; `)),{config:r,message:i}}function NW(e,t){let n=null;if(e.length===jW.length)return n;let r={};for(let[i,a]of e.entries()){let e=i-jW.length;function o(t,n){return Error(`Property '${t}' of custom rule at index ${e} is incorrect: '${n}'.`)}for(let e of[`names`,`tags`]){let t=a[e];!n&&(!t||!Array.isArray(t)||t.length===0||!t.every(Z.isString)||t.some(Z.isEmptyString))&&(n=o(e,t))}for(let e of[[`description`,`string`],[`function`,`function`]]){let t=e[0],r=a[t];!n&&(!r||typeof r!==e[1])&&(n=o(t,r))}if(!n&&a.parser!==void 0&&a.parser!==`markdownit`&&a.parser!==`micromark`&&a.parser!==`none`&&(n=o(`parser`,a.parser)),!n&&a.information&&!Z.isUrl(a.information)&&(n=o(`information`,a.information)),!n&&a.asynchronous!==void 0&&typeof a.asynchronous!=`boolean`&&(n=o(`asynchronous`,a.asynchronous)),!n&&a.asynchronous&&t&&(n=Error(`Custom rule `+a.names.join(`/`)+` at index `+e+` is asynchronous and can not be used in a synchronous context.`)),!n){for(let t of a.names){let i=t.toUpperCase();!n&&r[i]!==void 0&&(n=Error(`Name '`+t+`' of custom rule at index `+e+` is already used as a name or tag.`)),r[i]=!0}for(let t of a.tags){let i=t.toUpperCase();!n&&r[i]&&(n=Error(`Tag '`+t+`' of custom rule at index `+e+` is already used as a name.`)),r[i]=!1}}}return n}function PW(e,t){let n=[];if(t){let r=e.match(t);if(r&&!r.index){let t=r[0];e=e.slice(t.length),n=t.split(Z.newLineRe),n.length>0&&n[n.length-1]===``&&n.length--}}return{content:e,frontMatterLines:n}}function FW(e){let t={};for(let n of e){let e=n.names[0].toUpperCase();for(let r of n.names){let n=r.toUpperCase();t[n]=[e]}for(let r of n.tags){let n=r.toUpperCase(),i=t[n]||[];i.push(e),t[n]=i}}return t}function IW(e,t,n){let r=!0,i=`error`;Object.entries(t).every(([e,t])=>e.toUpperCase()===`DEFAULT`?(r=!!t,t===`warning`&&(i=`warning`),!1):!0);let a={},o=new Map,s=new Map,c=Object.freeze({});for(let t of e.map(e=>e.names[0].toUpperCase()))a[t]=c,o.set(t,r),s.set(t,i);for(let[e,r]of Object.entries(t)){let t=e.toUpperCase(),i=!1,c=`error`,l={};if(r)if(r instanceof Object){let e=r;i=e.enabled===void 0?!0:!!e.enabled,c=e.severity===`warning`?`warning`:`error`,l=Object.fromEntries(Object.entries(r).filter(([e])=>e!==`enabled`&&e!==`severity`))}else i=!0,c=r===`warning`?`warning`:`error`;for(let e of n[t]||[])Object.freeze(l),a[e]=l,o.set(e,i),s.set(e,c)}return{effectiveConfig:a,rulesEnabled:o,rulesSeverity:s}}function LW(e,t,n,r,i,a,o){let s=new Map,c=s,l=Array(1+n.length);function u(e,t,n=void 0){for(let[i,a]of e.entries()){if(!r){let e=null;for(;e=Z.inlineCommentStartRe.exec(a);){let n=e[2].toUpperCase(),r=e.index+e[1].length,o=a.indexOf(`-->`,r);if(o===-1)break;t(n,a.slice(r,o),i+1)}}n&&n()}}function d(e,t){if(e===`CONFIGURE-FILE`){let{config:e}=MW(`CONFIGURE-FILE`,t,a);e&&(i={...i,...e})}}function f(e,t,n){n=new Map(n);let r=e.startsWith(`ENABLE`),i=t&&t.trim(),a=i?i.toUpperCase().split(/\s+/):b;for(let e of a)for(let t of o[e]||[])n.set(t,r);return n}function p(e,t){(e===`ENABLE-FILE`||e===`DISABLE-FILE`)&&(s=f(e,t,s))}function m(e,t){e===`CAPTURE`?c=s:e===`RESTORE`?s=c:(e===`ENABLE`||e===`DISABLE`)&&(s=f(e,t,s))}function h(){l.push(s)}function g(e,t,r){let i=e===`DISABLE-LINE`,a=e===`DISABLE-NEXT-LINE`;if(i||a){let i=n.length+r+ +!!a;l[i]=f(e,t,l[i])}}u([t.join(`
380
- `)],d);let{effectiveConfig:_,rulesEnabled:v,rulesSeverity:y}=IW(e,i,o),b=[...v.keys()];return s=new Map(v),c=s,u(t,p),u(t,m,h),u(t,g),{effectiveConfig:_,enabledRulesPerLineNumber:l,enabledRuleList:e.filter(e=>{let t=e.names[0].toUpperCase();return l.some(e=>e.get(t))}),rulesSeverity:y}}function RW(e,t,n,i,a,s,c,l,u,d,f,p){let m=e=>p(e instanceof Error?e:Error(e));i=i.replace(/^\uFEFF/,``);let h=PW(i,l),{frontMatterLines:g}=h;i=h.content;let{effectiveConfig:_,enabledRulesPerLineNumber:v,enabledRuleList:y,rulesSeverity:b}=LW(e,i.split(Z.newLineRe),g,d,s,c,t),x=y.some(e=>e.parser===`markdownit`||e.parser===void 0),S=y.some(e=>e.parser===`micromark`),C=e.length!==jW.length,w=S?eU(i,{freezeTokens:C}):[],T=i;i=Z.clearHtmlCommentText(i);let E=i.split(Z.newLineRe),ee=e=>{let t=Object.freeze({markdownit:Object.freeze({tokens:e})}),r=Object.freeze({micromark:Object.freeze({tokens:w})}),i=Object.freeze({}),a={name:n,version:uV,lines:Object.freeze(E),frontMatterLines:Object.freeze(g)};aV({...a,parsers:r,config:{}});let o=[],s=s=>{let c=s.names[0].toUpperCase(),l={},d=i;s.parser===void 0?(l.tokens=e,d=t):s.parser===`markdownit`?d=t:s.parser===`micromark`&&(d=r);let f=Object.freeze({...a,...l,parsers:d,config:_[c]});function p(e){throw Error(`Value of '${e}' passed to onError by '${c}' is incorrect for '${n}'.`)}function m(e){(!e||!Z.isNumber(e.lineNumber)||e.lineNumber<1||e.lineNumber>E.length)&&p(`lineNumber`);let t=e.lineNumber+g.length;if(!v[t].get(c))return;e.detail&&!Z.isString(e.detail)&&p(`detail`),e.context&&!Z.isString(e.context)&&p(`context`),e.information&&!Z.isUrl(e.information)&&p(`information`),e.range&&(!Array.isArray(e.range)||e.range.length!==2||!Z.isNumber(e.range[0])||e.range[0]<1||!Z.isNumber(e.range[1])||e.range[1]<1||e.range[0]+e.range[1]-1>E[e.lineNumber-1].length)&&p(`range`);let n=e.fixInfo,r={};if(n){Z.isObject(n)||p(`fixInfo`),n.lineNumber!==void 0&&((!Z.isNumber(n.lineNumber)||n.lineNumber<1||n.lineNumber>E.length)&&p(`fixInfo.lineNumber`),r.lineNumber=n.lineNumber+g.length);let t=n.lineNumber||e.lineNumber;n.editColumn!==void 0&&((!Z.isNumber(n.editColumn)||n.editColumn<1||n.editColumn>E[t-1].length+1)&&p(`fixInfo.editColumn`),r.editColumn=n.editColumn),n.deleteCount!==void 0&&((!Z.isNumber(n.deleteCount)||n.deleteCount<-1||n.deleteCount>E[t-1].length)&&p(`fixInfo.deleteCount`),r.deleteCount=n.deleteCount),n.insertText!==void 0&&(Z.isString(n.insertText)||p(`fixInfo.insertText`),r.insertText=n.insertText)}let i=e.information||s.information;o.push({lineNumber:t,ruleNames:s.names,ruleDescription:s.description,ruleInformation:i?i.href:null,errorDetail:e.detail?.replace(Z.newLineRe,` `)||null,errorContext:e.context?.replace(Z.newLineRe,` `)||null,errorRange:e.range?[...e.range]:null,fixInfo:n?r:null,severity:b.get(c)})}let h=e=>m({lineNumber:1,detail:`This rule threw an exception: ${e.message||e}`}),y=()=>s.function(f,m);if(s.asynchronous){let e=Promise.resolve().then(y);return u?e.catch(h):e}try{y()}catch(e){if(u)h(e);else throw e}return null},c=()=>(o.sort((e,t)=>e.ruleNames[0].localeCompare(t.ruleNames[0])||e.lineNumber-t.lineNumber),o),l=y.filter(e=>e.asynchronous),d=y.filter(e=>!e.asynchronous),f=[...l,...d],h=()=>p(null,c());try{let e=f.map(s);l.length>0?Promise.all(e.slice(0,l.length)).then(h).catch(m):h()}catch(e){m(e)}finally{aV()}};!x||f?ee(x?(0,pV.requireMarkdownItCjs)().getMarkdownItTokens(a(),T,E):[]):Promise.all([o(()=>import(`./markdownit-YwcN3EvW.js`).then(e=>r(e.t(),1)),__vite__mapDeps([0,1]),import.meta.url),new Promise(e=>e(a()))]).then(([e,t])=>{ee(e.getMarkdownItTokens(t,T,E))}).catch(m)}function zW(e,t,n,r,i,a,o,s,c,l,u,d){function f(l,f){return l?d(l):RW(e,t,n,f,r,i,a,o,s,c,u,d)}u?f(null,l.readFileSync(n,`utf8`)):l.readFile(n,`utf8`,f)}function BW(e,t,n){e||={},n||=()=>{};let r=[e.customRules||[]].flat().map(e=>({names:Z.cloneIfArray(e.names),description:e.description,information:Z.cloneIfUrl(e.information),tags:Z.cloneIfArray(e.tags),parser:e.parser,asynchronous:e.asynchronous,function:e.function})),i=jW.concat(r),a=NW(i,t);if(a){n(a);return}let o=[];Array.isArray(e.files)?o=[...e.files]:e.files&&(o=[String(e.files)]);let s=e.strings||{},c=Object.keys(s),l=e.config||{default:!0},u=e.configParsers||void 0,d=e.frontMatter===void 0?Z.frontMatterRe:e.frontMatter,f=!!e.handleRuleFailures,p=!!e.noInlineConfig,m=e.markdownItFactory||(()=>{throw Error(`The option 'markdownItFactory' was required (due to the option 'customRules' including a rule requiring the 'markdown-it' parser), but 'markdownItFactory' was not set.`)}),h=e.fs||eV,g=FW(i),_={},v=!1,y=0;function b(){let e;function r(r,i){return y--,r?(v=!0,n(r)):(_[e]=i,t||b(),null)}if(!v){if(e=o.shift())y++,zW(i,g,e,m,l,u,d,f,p,h,t,r);else if(e=c.shift())y++,RW(i,g,e,s[e]||``,m,l,u,d,f,p,t,r);else if(y===0){v=!0;let e=Object.entries(_);e.sort(([e],[t])=>e.localeCompare(t));let t=Object.fromEntries(e);return n(null,t)}}return null}if(t)for(;!v;)b();else b(),b(),b(),b(),b(),b(),b(),b()}function VW(e){let t=null;return BW(e,!0,function(e,n){if(e)throw e;t=n}),t}function HW(e,t=0){return{lineNumber:e.lineNumber||t,editColumn:e.editColumn||1,deleteCount:e.deleteCount||0,insertText:e.insertText||``}}function UW(e,t,n=`
381
- `){let{editColumn:r,deleteCount:i,insertText:a}=HW(t),o=r-1;return i===-1?null:e.slice(0,o)+a.replace(/\n/g,n)+e.slice(o+i)}function WW(e,t){let n=Z.getPreferredLineEnding(e,tV),r=e.split(Z.newLineRe),i=t.filter(e=>e.fixInfo).map(e=>HW(e.fixInfo,e.lineNumber));i.sort((e,t)=>{let n=e.deleteCount===-1,r=t.deleteCount===-1;return t.lineNumber-e.lineNumber||(n?1:r?-1:0)||t.editColumn-e.editColumn||t.insertText.length-e.insertText.length});let a={};i=i.filter(e=>{let t=e.lineNumber!==a.lineNumber||e.editColumn!==a.editColumn||e.deleteCount!==a.deleteCount||e.insertText!==a.insertText;return a=e,t}),a={lineNumber:-1};for(let e of i)e.lineNumber===a.lineNumber&&e.editColumn===a.editColumn&&!e.insertText&&e.deleteCount>0&&a.insertText&&!a.deleteCount&&(e.insertText=a.insertText,a.lineNumber=0),a=e;i=i.filter(e=>e.lineNumber);let o=-1,s=-1;for(let e of i){let{lineNumber:t,editColumn:i,deleteCount:a}=e,c=t-1,l=i-1;(c!==o||a===-1||l+a<=s-(a>0?0:1))&&(r[c]=UW(r[c],e,n)),o=c,s=l}return r.filter(e=>e!==null).join(n)}var GW=/^>|^->|<!--|-->|--!>|<!-$/g,KW=[`>`],qW=[`<`,`>`];function JW(e,t,n,r){return r.settings.bogusComments?`<?`+sF(e.value,Object.assign({},r.settings.characterReferences,{subset:KW}))+`>`:`<!--`+e.value.replace(GW,i)+`-->`;function i(e){return sF(e,Object.assign({},r.settings.characterReferences,{subset:qW}))}}function YW(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}var XW=$W(1),ZW=$W(-1),QW=[];function $W(e){return t;function t(t,n,r){let i=t?t.children:QW,a=(n||0)+e,o=i[a];if(!r)for(;o&&re(o);)a+=e,o=i[a];return o}}var eG={}.hasOwnProperty;function tG(e){return t;function t(t,n,r){return eG.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var nG=tG({body:aG,caption:rG,colgroup:rG,dd:lG,dt:cG,head:rG,html:iG,li:sG,optgroup:dG,option:fG,p:oG,rp:uG,rt:uG,tbody:mG,td:_G,tfoot:hG,th:_G,thead:pG,tr:gG});function rG(e,t,n){let r=XW(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&re(r.value.charAt(0)))}function iG(e,t,n){let r=XW(n,t);return!r||r.type!==`comment`}function aG(e,t,n){let r=XW(n,t);return!r||r.type!==`comment`}function oG(e,t,n){let r=XW(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||!(n.type===`element`&&(n.tagName===`a`||n.tagName===`audio`||n.tagName===`del`||n.tagName===`ins`||n.tagName===`map`||n.tagName===`noscript`||n.tagName===`video`))}function sG(e,t,n){let r=XW(n,t);return!r||r.type===`element`&&r.tagName===`li`}function cG(e,t,n){let r=XW(n,t);return!!(r&&r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`))}function lG(e,t,n){let r=XW(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function uG(e,t,n){let r=XW(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function dG(e,t,n){let r=XW(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function fG(e,t,n){let r=XW(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function pG(e,t,n){let r=XW(n,t);return!!(r&&r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`))}function mG(e,t,n){let r=XW(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function hG(e,t,n){return!XW(n,t)}function gG(e,t,n){let r=XW(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function _G(e,t,n){let r=XW(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var vG=tG({body:xG,colgroup:SG,head:bG,html:yG,tbody:CG});function yG(e){let t=XW(e,-1);return!t||t.type!==`comment`}function bG(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function xG(e){let t=XW(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&re(t.value.charAt(0)))&&!(t.type===`element`&&(t.tagName===`meta`||t.tagName===`link`||t.tagName===`script`||t.tagName===`style`||t.tagName===`template`))}function SG(e,t,n){let r=ZW(n,t),i=XW(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&nG(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function CG(e,t,n){let r=ZW(n,t),i=XW(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&nG(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var wG={name:[[`
377
+ `:`\r`,s}t.exports.getPreferredLineEnding=D;function ne(e,t){let n=t&&t.homedir&&t.homedir();return n?e.replace(/^~($|\/|\\)/,`${n}$1`):e}t.exports.expandTildePath=ne;function re(e){let t={ruleNames:[],lineNumber:-1};return e.filter((e,n,r)=>{delete e.fixInfo,delete e.severity;let i=r[n-1]||t;return e.ruleNames[0]!==i.ruleNames[0]||e.lineNumber!==i.lineNumber})}function ie(e){for(let t of e)t.ruleName=t.ruleNames[0],t.ruleAlias=t.ruleNames[1]||t.ruleName,delete t.ruleNames;return e}function ae(e){let t={};for(let n of e){let e=n.ruleNames[0],r=t[e]||[];r.push(n.lineNumber),t[e]=r}return t}function oe(e,t){let n={};for(let[r,i]of Object.entries(e))n[r]=t(i.map(e=>({...e})));return n}t.exports.convertToResultVersion0=function(e){return oe(e,e=>ae(re(e)))},t.exports.convertToResultVersion1=function(e){return oe(e,e=>ie(re(e)))},t.exports.convertToResultVersion2=function(e){return oe(e,re)},t.exports.formatLintResults=function(e){let t=[],n=Object.entries(e||{});n.sort((e,t)=>e[0].localeCompare(t[0]));for(let[e,r]of n)for(let n of r){let{lineNumber:r,ruleNames:i,ruleDescription:a,errorDetail:o,errorContext:s,errorRange:c,severity:l}=n,u=i.join(`/`),d=`:${r}`,f=c&&c[0]||0,p=f?`:${f}`:``,m=a,h=o?` [${o}]`:``,g=s?` [Context: "${s}"]`:``;t.push(`${e}${d}${p} ${l} ${u} ${m}${h}${g}`)}return t}}))(),1),Q=tV(),nV=new Map,rV=void 0;function iV(e){nV.clear(),rV=e}function aV(){return rV?.parsers.micromark.tokens||[]}function oV(e,t){if(nV.has(e))return nV.get(e);let n=t();return nV.set(e,n),n}function $(e,t){return oV(JSON.stringify(arguments),()=>(0,Q.filterByTypes)(aV(),e,t))}function sV(){return oV(sV.name,()=>(0,Z.getReferenceLinkImageData)(aV()))}var cV=`https://github.com/DavidAnson/markdownlint`,lV=`0.41.1`,uV=a(((e,t)=>{function n(){return Le()}t.exports={requireMarkdownItCjs:n}})),dV=a(((e,n)=>{var r=typeof __non_webpack_require__>`u`?t:__non_webpack_require__,i=(e,t,n=[])=>{let r=e.paths?.(``)||[];return e(t,{paths:[...n,...r]})};n.exports={resolveModule:(e,t)=>i(r.resolve,e,t),resolveModuleCustomResolve:i}})),fV=uV();dV();var pV={names:[`MD001`,`heading-increment`],description:`Heading levels should only increment by one level at a time`,tags:[`headings`],parser:`micromark`,function:function(e,t){let n=(0,Z.frontMatterHasTitle)(e.frontMatterLines,e.config.front_matter_title)?1:2**53-1;for(let e of $([`atxHeading`,`setextHeading`])){let r=(0,Q.getHeadingLevel)(e);r>n&&(0,Z.addErrorDetailIf)(t,e.startLine,`h${n+1}`,`h${r}`),n=r}}},mV={names:[`MD003`,`heading-style`],description:`Heading style`,tags:[`headings`],parser:`micromark`,function:function(e,t){let n=String(e.config.style||`consistent`);for(let e of $([`atxHeading`,`setextHeading`])){let r=(0,Q.getHeadingStyle)(e);if(n===`consistent`&&(n=r),r!==n){let i=(0,Q.getHeadingLevel)(e)<=2;if(!(n===`setext_with_atx`&&(i&&r===`setext`||!i&&r===`atx`))&&!(n===`setext_with_atx_closed`&&(i&&r===`setext`||!i&&r===`atx_closed`))){let a=n;n===`setext_with_atx`?a=i?`setext`:`atx`:n===`setext_with_atx_closed`&&(a=i?`setext`:`atx_closed`),(0,Z.addErrorDetailIf)(t,e.startLine,a,r)}}}}},hV=e=>e===`-`?`dash`:e===`+`?`plus`:`asterisk`,gV=e=>e===`dash`?`-`:e===`plus`?`+`:`*`,_V=e=>e===`dash`?`plus`:e===`plus`?`asterisk`:`dash`,vV=new Set([`asterisk`,`consistent`,`dash`,`plus`,`sublist`]),yV={names:[`MD004`,`ul-style`],description:`Unordered list style`,tags:[`bullet`,`ul`],parser:`micromark`,function:function(e,t){let n=String(e.config.style||`consistent`),r=vV.has(n)?n:`dash`,i=[];for(let e of $([`listUnordered`])){let a=0;if(n===`sublist`){let t=e;for(;t=(0,Q.getParentOfType)(t,[`listOrdered`,`listUnordered`]);)a++}let o=(0,Q.getDescendantsByType)(e,[`listItemPrefix`,`listItemMarker`]);for(let e of o){let o=hV(e.text);n===`sublist`?(i[a]||(i[a]=o===i[a-1]?_V(o):o),r=i[a]):r===`consistent`&&(r=o);let s=e.startColumn,c=e.endColumn-e.startColumn;(0,Z.addErrorDetailIf)(t,e.startLine,r,o,void 0,void 0,[s,c],{editColumn:s,deleteCount:c,insertText:gV(r)})}}}},bV={names:[`MD005`,`list-indent`],description:`Inconsistent indentation for list items at the same level`,tags:[`bullet`,`ul`,`indentation`],parser:`micromark`,function:function(e,t){for(let e of $([`listOrdered`,`listUnordered`])){let n=e.startColumn-1,r=0,i=!1,a=e.children.filter(e=>e.type===`listItemPrefix`);for(let o of a){let a=o.startLine,s=o.startColumn-1,c=[1,o.endColumn-1];if(e.type===`listUnordered`)(0,Z.addErrorDetailIf)(t,a,n,s,void 0,void 0,c);else{let e=o.text.trim().length,l=o.startColumn+e-1;if(r||=l,n!==s||i)if(r===l)i=!0;else{let o=i?`Expected: (${r}); Actual: (${l})`:`Expected: ${n}; Actual: ${s}`,u=i?r-e:n,d=i?l-e:s;(0,Z.addError)(t,a,o,void 0,c,{editColumn:Math.min(d,u)+1,deleteCount:Math.max(d-u,0),insertText:``.padEnd(Math.max(u-d,0))})}}}}}},xV=[`blockQuotePrefix`,`listItemPrefix`,`listUnordered`],SV=[`blockQuote`,`listOrdered`,`listUnordered`],CV={names:[`MD007`,`ul-indent`],description:`Unordered list indentation`,tags:[`bullet`,`ul`,`indentation`],parser:`micromark`,function:function(e,t){let n=Number(e.config.indent||2),r=!!e.config.start_indented,i=Number(e.config.start_indent||n),a=new Map,o=null,s=$(xV);for(let e of s){let{endColumn:s,parent:c,startColumn:l,startLine:u,type:d}=e;if(d===`blockQuotePrefix`)o=e;else if(d===`listUnordered`){let t=0,n=e;for(;n=(0,Q.getParentOfType)(n,SV);){if(n.type===`listUnordered`){t++;continue}else n.type===`listOrdered`&&(t=-1);break}t>=0&&a.set(e,t)}else{let d=a.get(c);if(d!==void 0){let a=((0,Q.getParentOfType)(e,[`gfmFootnoteDefinition`])?4:0)+(r?i:0)+d*n,c=o?.endLine===u?o.endColumn-1:0,f=l-1-c;(0,Z.addErrorDetailIf)(t,u,a,f,void 0,void 0,[1,s-1],{editColumn:l-f,deleteCount:Math.max(f-a,0),insertText:``.padEnd(Math.max(a-f,0))})}}}}},wV={names:[`MD009`,`no-trailing-spaces`],description:`Trailing spaces`,tags:[`whitespace`],parser:`micromark`,function:function(e,t){let n=e.config.br_spaces;n=Number(n===void 0?2:n);let r=e.config.code_blocks,i=r===void 0?!1:!!r,a=!!e.config.list_item_empty_lines,o=!!e.config.strict,s=new Set;if(!i){for(let e of $([`codeFenced`]))(0,Q.addRangeToSet)(s,e.startLine+1,e.endLine-1);for(let e of $([`codeIndented`]))(0,Q.addRangeToSet)(s,e.startLine,e.endLine)}let c=new Set;if(a)for(let e of $([`listOrdered`,`listUnordered`])){(0,Q.addRangeToSet)(c,e.startLine,e.endLine);let t=!0;for(let n=e.children.length-1;n>=0;n--){let r=e.children[n];switch(r.type){case`content`:t=!1;break;case`listItemIndent`:t&&c.delete(r.startLine);break;case`listItemPrefix`:t=!0;break;default:break}}}let l=new Set,u=new Set;if(o){for(let e of $([`paragraph`]))(0,Q.addRangeToSet)(l,e.startLine,e.endLine-1);for(let e of $([`codeText`]))(0,Q.addRangeToSet)(u,e.startLine,e.endLine-1)}let d=n<2?0:n;for(let n=0;n<e.lines.length;n++){let r=e.lines[n],i=n+1,a=r.length-r.trimEnd().length;if(a&&!s.has(i)&&!c.has(i)&&(d!==a||o&&(!l.has(i)||u.has(i)))){let e=r.length-a+1;(0,Z.addError)(t,i,`Expected: `+(d===0?``:`0 or `)+d+`; Actual: `+a,void 0,[e,a],{editColumn:e,deleteCount:a})}}}},TV=/\t+/g,EV={names:[`MD010`,`no-hard-tabs`],description:`Hard tabs`,tags:[`whitespace`,`hard_tab`],parser:`micromark`,function:function(e,t){let n=e.config.code_blocks,r=n===void 0?!0:!!n,i=new Set((e.config.ignore_code_languages||[]).map(e=>String(e).toLowerCase())),a=e.config.spaces_per_tab,o=a===void 0?1:Math.max(0,Number(a)),s=[];r?i.size>0&&s.push(`codeFenced`):s.push(`codeFenced`,`codeIndented`,`codeText`);let c=$(s).filter(e=>e.type===`codeFenced`&&i.size>0?(0,Q.getDescendantsByType)(e,[`codeFencedFence`,`codeFencedFenceInfo`]).every(e=>i.has(e.text.toLowerCase())):!0).map(e=>{let{type:t,startLine:n,startColumn:r,endLine:i,endColumn:a}=e,o=t===`codeFenced`;return{startLine:n+ +!!o,startColumn:o?0:r,endLine:i-+!!o,endColumn:o?2**53-1:a}});for(let n=0;n<e.lines.length;n++){let r=e.lines[n],i=null;for(;(i=TV.exec(r))!==null;){let e=n+1,r=i.index+1,a=i[0].length,s={startLine:e,startColumn:r,endLine:e,endColumn:r+a-1};c.some(e=>(0,Z.hasOverlap)(e,s))||(0,Z.addError)(t,e,`Column: `+r,void 0,[r,a],{editColumn:r,deleteCount:a,insertText:``.padEnd(a*o)})}}}},DV=/(^|[^\\])\(([^()]+)\)\[([^\]^][^\]]*)\](?!\()/g,OV={names:[`MD011`,`no-reversed-links`],description:`Reversed link syntax`,tags:[`links`],parser:`micromark`,function:function(e,t){let n=new Set;for(let e of $([`codeFenced`,`codeIndented`,`mathFlow`]))(0,Q.addRangeToSet)(n,e.startLine,e.endLine);let r=$([`codeText`,`mathText`]);for(let[i,a]of e.lines.entries()){let e=i+1;if(!n.has(e)){let n=null;for(;(n=DV.exec(a))!==null;){let[i,a,o,s]=n;if(!o.endsWith(`\\`)&&!s.endsWith(`\\`)){let c=n.index+a.length+1,l=n[0].length-a.length,u={startLine:e,startColumn:c,endLine:e,endColumn:c+l-1};r.some(e=>(0,Z.hasOverlap)(e,u))||(0,Z.addError)(t,e,i.slice(a.length),void 0,[c,l],{editColumn:c,deleteCount:l,insertText:`[${o}](${s})`})}}}}}},kV={names:[`MD012`,`no-multiple-blanks`],description:`Multiple consecutive blank lines`,tags:[`whitespace`,`blank_lines`],parser:`micromark`,function:function(e,t){let n=Number(e.config.maximum||1),{lines:r}=e,i=new Set;for(let e of $([`codeFenced`,`codeIndented`]))(0,Q.addRangeToSet)(i,e.startLine,e.endLine);let a=0;for(let[e,o]of r.entries())a=i.has(e+1)||o.trim().length>0?0:a+1,n<a&&(0,Z.addErrorDetailIf)(t,e+1,n,a,void 0,void 0,void 0,{deleteCount:-1})}},AV=/^(?:[#>\s]*\s)?\S*$/,jV={names:[`MD013`,`line-length`],description:`Line length`,tags:[`line_length`],parser:`micromark`,function:function(e,t){let n=Number(e.config.line_length||80),r=Number(e.config.heading_line_length||n),i=Number(e.config.code_block_line_length||n),a=!!e.config.strict,o=!!e.config.stern,s=e.config.code_blocks,c=s===void 0?!0:!!s,l=e.config.tables,u=l===void 0?!0:!!l,d=e.config.headings,f=d===void 0?!0:!!d,p=new Set;for(let e of $([`atxHeading`,`setextHeading`]))(0,Q.addRangeToSet)(p,e.startLine,e.endLine);let m=new Set;for(let e of $([`codeFenced`,`codeIndented`]))(0,Q.addRangeToSet)(m,e.startLine,e.endLine);let h=new Set;for(let e of $([`table`]))(0,Q.addRangeToSet)(h,e.startLine,e.endLine);let g=new Set;for(let e of $([`autolink`,`image`,`link`,`literalAutolink`]))(0,Q.addRangeToSet)(g,e.startLine,e.endLine);let _=new Set;for(let e of $([`paragraph`]))for(let t of(0,Q.getDescendantsByType)(e,[`data`]))(0,Q.addRangeToSet)(_,t.startLine,t.endLine);let v=new Set;for(let e of g)_.has(e)||v.add(e);let y=new Set(sV().definitionLineIndices);for(let s=0;s<e.lines.length;s++){let l=e.lines[s],d=s+1,g=p.has(d),_=m.has(d),b=h.has(d),x=_?i:g?r:n,S=a||o?l:l.replace(/\S*$/u,`#`);x>0&&(c||!_)&&(u||!b)&&(f||!g)&&!y.has(s)&&(a||!(o&&AV.test(l))&&!v.has(d))&&S.length>x&&(0,Z.addErrorDetailIf)(t,d,x,l.length,void 0,void 0,[x+1,l.length-x])}}},MV=/^(\s*)(\$\s+)/,NV={names:[`MD014`,`commands-show-output`],description:`Dollar signs used before commands without showing output`,tags:[`code`],parser:`micromark`,function:function(e,t){for(let e of $([`codeFenced`,`codeIndented`])){let n=e.children.filter(e=>e.type===`codeFlowValue`),r=n.map(e=>({result:e.text.match(MV),startColumn:e.startColumn,startLine:e.startLine,text:e.text})).filter(e=>e.result);if(r.length===n.length)for(let e of r){let n=e.startColumn+e.result[1].length,r=e.result[2].length;(0,Z.addErrorContext)(t,e.startLine,e.text,void 0,void 0,[n,r],{editColumn:n,deleteCount:r})}}}},PV={names:[`MD018`,`no-missing-space-atx`],description:`No space after hash on atx style heading`,tags:[`headings`,`atx`,`spaces`],parser:`micromark`,function:function(e,t){let{lines:n}=e,r=new Set;for(let e of $([`codeFenced`,`codeIndented`,`htmlFlow`]))(0,Q.addRangeToSet)(r,e.startLine,e.endLine);for(let[e,i]of n.entries())if(!r.has(e+1)&&/^#+[^# \t]/.test(i)&&!/#\s*$/.test(i)&&!i.startsWith(`#️⃣`)){let n=/^#+/.exec(i)[0].length;(0,Z.addErrorContext)(t,e+1,i.trim(),void 0,void 0,[1,n+1],{editColumn:n+1,insertText:` `})}}};function FV(e,t,n){let{children:r,startLine:i,text:a}=t,o=n>0?0:r.length-1;for(;r[o]&&r[o].type!==`atxHeadingSequence`;)o+=n;let s=r[o],c=r[o+n];if(s?.type===`atxHeadingSequence`&&c?.type===`whitespace`&&c.text.length>1){let t=c.startColumn+1,r=c.endColumn-t;(0,Z.addErrorContext)(e,i,a.trim(),n>0,n<0,[t,r],{editColumn:t,deleteCount:r})}}var IV=[{names:[`MD019`,`no-multiple-space-atx`],description:`Multiple spaces after hash on atx style heading`,tags:[`headings`,`atx`,`spaces`],parser:`micromark`,function:function(e,t){let n=$([`atxHeading`]).filter(e=>(0,Q.getHeadingStyle)(e)===`atx`);for(let e of n)FV(t,e,1)}},{names:[`MD021`,`no-multiple-space-closed-atx`],description:`Multiple spaces inside hashes on closed atx style heading`,tags:[`headings`,`atx_closed`,`spaces`],parser:`micromark`,function:function(e,t){let n=$([`atxHeading`]).filter(e=>(0,Q.getHeadingStyle)(e)===`atx_closed`);for(let e of n)FV(t,e,1),FV(t,e,-1)}}],LV={names:[`MD020`,`no-missing-space-closed-atx`],description:`No space inside hashes on closed atx style heading`,tags:[`headings`,`atx_closed`,`spaces`],parser:`micromark`,function:function(e,t){let{lines:n}=e,r=new Set;for(let e of $([`codeFenced`,`codeIndented`,`htmlFlow`]))(0,Q.addRangeToSet)(r,e.startLine,e.endLine);for(let[e,i]of n.entries())if(!r.has(e+1)){let n=/^(#+)([ \t]*)([^# \t\\]|[^# \t][^#]*?[^# \t\\])([ \t]*)((?:\\#)?)(#+)(\s*)$/.exec(i);if(n){let[,r,{length:a},o,{length:s},c,l,{length:u}]=n,d=r.length,f=l.length,p=!a,m=!s||!!c,h=c?`${c} `:``;if(p||m){let n=p?[1,d+1]:[i.length-u-f,f+1];(0,Z.addErrorContext)(t,e+1,i.trim(),p,m,n,{editColumn:1,deleteCount:i.length,insertText:`${r} ${o} ${h}${l}`})}}}}},RV=1,zV=e=>{if(Array.isArray(e)){let t=[,,,,,,].fill(RV);for(let[n,r]of[...e.entries()].slice(0,6))t[n]=r;return e=>t[(0,Q.getHeadingLevel)(e)-1]}let t=e===void 0?RV:Number(e);return()=>t},BV=(e,t,n,r)=>t>=0&&t<e.length?e[t]:r&&n.length>0&&t<0&&t>=-n.length?n[n.length+t]:``,VV={names:[`MD022`,`blanks-around-headings`],description:`Headings should be surrounded by blank lines`,tags:[`headings`,`blank_lines`],parser:`micromark`,function:function(e,t){let n=zV(e.config.lines_above),r=zV(e.config.lines_below),i=!!e.config.include_front_matter,{lines:a,frontMatterLines:o}=e,s=$([`blockQuotePrefix`,`linePrefix`]);for(let e of $([`atxHeading`,`setextHeading`])){let{startLine:c,endLine:l}=e,u=a[c-1].trim(),d=n(e);if(d>=0){let e=0;for(let t=0;t<d&&(0,Z.isBlankLine)(BV(a,c-2-t,o,i));t++)e++;(0,Z.addErrorDetailIf)(t,c,d,e,`Above`,u,void 0,{insertText:(0,Q.getBlockQuotePrefixText)(s,c-1,d-e)})}let f=r(e);if(f>=0){let e=0;for(let t=0;t<f&&(0,Z.isBlankLine)(BV(a,l+t,o,!1));t++)e++;(0,Z.addErrorDetailIf)(t,c,f,e,`Below`,u,void 0,{lineNumber:l+1,insertText:(0,Q.getBlockQuotePrefixText)(s,l+1,f-e)})}}}},HV={names:[`MD023`,`heading-start-left`],description:`Headings must start at the beginning of the line`,tags:[`headings`,`spaces`],parser:`micromark`,function:function(e,t){let n=$([`atxHeading`,`linePrefix`,`setextHeading`]);for(let r=0;r<n.length-1;r++)if(n[r].type===`linePrefix`&&n[r+1].type!==`linePrefix`&&n[r].startLine===n[r+1].startLine){let{endColumn:i,startColumn:a,startLine:o}=n[r],s=i-a;(0,Z.addErrorContext)(t,o,e.lines[o-1],!0,!1,[a,s],{editColumn:a,deleteCount:s})}}},UV={names:[`MD024`,`no-duplicate-heading`],description:`Multiple headings with the same content`,tags:[`headings`],parser:`micromark`,function:function(e,t){let n=!!e.config.siblings_only,r=[null,[]],i=1,a=r[i];for(let e of $([`atxHeading`,`setextHeading`])){let o=(0,Q.getHeadingText)(e);if(n){let t=(0,Q.getHeadingLevel)(e);for(;i<t;)i++,r[i]=[];for(;i>t;)r[i]=[],i--;a=r[t]}a.includes(o)?(0,Z.addErrorContext)(t,e.startLine,o.trim()):a.push(o)}}},WV={names:[`MD025`,`single-title`,`single-h1`],description:`Multiple top-level headings in the same document`,tags:[`headings`],parser:`micromark`,function:function(e,t){let n=Number(e.config.level||1),{tokens:r}=e.parsers.micromark,i=$([`atxHeading`,`setextHeading`]).filter(e=>n===(0,Q.getHeadingLevel)(e)&&!(0,Q.isDocfxTab)(e));if(i.length>0){let n=(0,Z.frontMatterHasTitle)(e.frontMatterLines,e.config.front_matter_title),a=n;if(a||=r.slice(0,r.indexOf(i[0])).every(e=>Q.nonContentTokens.has(e.type)||(0,Q.isHtmlFlowComment)(e)),a)for(let e of i.slice(+!n))(0,Z.addErrorContext)(t,e.startLine,(0,Q.getHeadingText)(e))}}},GV={names:[`MD026`,`no-trailing-punctuation`],description:`Trailing punctuation in heading`,tags:[`headings`],parser:`micromark`,function:function(e,t){let n=e.config.punctuation;n=String(n===void 0?Z.allPunctuationNoQuestion:n);let r=RegExp(`\\s*[`+(0,Z.escapeForRegExp)(n)+`]+$`),i=$([`atxHeadingText`,`setextHeadingText`]);for(let e of i){let{endColumn:n,endLine:i,text:a}=e,o=r.exec(a);if(o&&!Z.endOfLineHtmlEntityRe.test(a)&&!Z.endOfLineGemojiCodeRe.test(a)){let e=o[0],r=e.length,a=n-r;(0,Z.addError)(t,i,`Punctuation: '${e}'`,void 0,[a,r],{editColumn:a,deleteCount:r})}}}},KV=[`listOrdered`,`listUnordered`],qV={names:[`MD027`,`no-multiple-space-blockquote`],description:`Multiple spaces after blockquote symbol`,tags:[`blockquote`,`whitespace`,`indentation`],parser:`micromark`,function:function(e,t){let n=e.config.list_items,r=n===void 0?!0:!!n,{tokens:i}=e.parsers.micromark;for(let n of $([`linePrefix`])){let a=n.parent,o=a?.type===`codeIndented`,s=a?.children||i;if(!o&&s[s.indexOf(n)-1]?.type===`blockQuotePrefix`&&(r||!KV.includes(s[s.indexOf(n)+1]?.type)&&!(0,Q.getParentOfType)(n,KV))){let{startColumn:r,startLine:i,text:a}=n,{length:o}=a,s=e.lines[i-1];(0,Z.addErrorContext)(t,i,s,void 0,void 0,[r,o],{editColumn:r,deleteCount:o})}}}},JV=new Set([`lineEnding`,`listItemIndent`,`linePrefix`]),YV={names:[`MD028`,`no-blanks-blockquote`],description:`Blank line inside blockquote`,tags:[`blockquote`,`whitespace`],parser:`micromark`,function:function(e,t){for(let n of $([`blockQuote`])){let r=[],i=n.parent?.children||e.parsers.micromark.tokens;for(let e=i.indexOf(n)+1;e<i.length;e++){let{startLine:n,type:a}=i[e];if(a===`lineEndingBlank`)r.push(n);else if(!JV.has(a))if(a===`blockQuote`){for(let e of r)(0,Z.addError)(t,e);break}else break}}}},XV={one:`1/1/1`,ordered:`1/2/3`,zero:`0/0/0`},ZV=Object.keys(XV);function QV(e){let{startColumn:t,endColumn:n,text:r}=(0,Q.getDescendantsByType)(e,[`listItemValue`])[0];return{startColumn:t,endColumn:n,text:r,number:Number(r)}}var $V={names:[`MD029`,`ol-prefix`],description:`Ordered list item prefix`,tags:[`ol`],parser:`micromark`,function:function(e,t){let n=String(e.config.style);for(let e of $([`listOrdered`])){let r=(0,Q.getDescendantsByType)(e,[`listItemPrefix`]),i=1,a=!1,o=!1,s=!1;if(r.length>0){let e=r[0].endColumn;if(o=r.every(t=>t.endColumn===e),r.length>1){let e=QV(r[0]);(QV(r[1]).number!==1||e.number===0)&&(a=!0,e.number===0&&(i=0)),s=e.text.startsWith(`0`)}}let c=ZV.includes(n)?n:a?`ordered`:`one`;c===`zero`?i=0:c===`one`&&(i=1);for(let e of r){let n=i.toString(),{endColumn:r,startColumn:a,number:l}=QV(e),u=r-a,d={editColumn:a,deleteCount:u,insertText:o?n.padStart(u,s?`0`:` `):n};(0,Z.addErrorDetailIf)(t,e.startLine,i,l,`Style: `+XV[c],void 0,[e.startColumn,e.endColumn-e.startColumn],d),c===`ordered`&&i++}}}},eH={names:[`MD030`,`list-marker-space`],description:`Spaces after list markers`,tags:[`ol`,`ul`,`whitespace`],parser:`micromark`,function:function(e,t){let n=Number(e.config.ul_single||1),r=Number(e.config.ol_single||1),i=Number(e.config.ul_multi||1),a=Number(e.config.ol_multi||1);for(let e of $([`listOrdered`,`listUnordered`])){let o=e.type===`listOrdered`,s=e.children.filter(e=>e.type===`listItemPrefix`),c=e.endLine-e.startLine+1===s.length,l=o?c?r:a:c?n:i;for(let e of s){let n=[e.startColumn,e.endColumn-e.startColumn],r=e.children.filter(e=>e.type===`listItemPrefixWhitespace`);for(let e of r){let{endColumn:r,startColumn:i,startLine:a}=e,o=r-i;(0,Z.addErrorDetailIf)(t,a,l,o,void 0,void 0,n,{editColumn:i,deleteCount:o,insertText:``.padEnd(l)})}}}}},tH=/^(.*?)[`~]/;function nH(e,t,n,r){let i=t[n-1],[,a]=i.match(tH)||[],o=a===void 0?void 0:{lineNumber:n+ +!r,insertText:`${a.replace(/[^>]/g,` `).trim()}\n`};(0,Z.addErrorContext)(e,n,i.trim(),void 0,void 0,void 0,o)}var rH={names:[`MD031`,`blanks-around-fences`],description:`Fenced code blocks should be surrounded by blank lines`,tags:[`code`,`blank_lines`],parser:`micromark`,function:function(e,t){let n=e.config.list_items,r=n===void 0?!0:!!n,{lines:i}=e;for(let e of $([`codeFenced`]))(r||!(0,Q.getParentOfType)(e,[`listOrdered`,`listUnordered`]))&&((0,Z.isBlankLine)(i[e.startLine-2])||nH(t,i,e.startLine,!0),!(0,Z.isBlankLine)(i[e.endLine])&&!(0,Z.isBlankLine)(i[e.endLine-1])&&nH(t,i,e.endLine,!1))}},iH=e=>e.type===`listOrdered`||e.type===`listUnordered`,aH={names:[`MD032`,`blanks-around-lists`],description:`Lists should be surrounded by blank lines`,tags:[`bullet`,`ul`,`ol`,`blank_lines`],parser:`micromark`,function:function(e,t){let{lines:n,parsers:r}=e,i=$([`blockQuotePrefix`,`linePrefix`]),a=(0,Q.filterByPredicate)(r.micromark.tokens,iH,e=>iH(e)||e.type===`htmlFlow`?[]:e.children);for(let e of a){let r=e.startLine;(0,Z.isBlankLine)(n[r-2])||(0,Z.addErrorContext)(t,r,n[r-1].trim(),void 0,void 0,void 0,{insertText:(0,Q.getBlockQuotePrefixText)(i,r)});let a=(0,Q.filterByPredicate)(e.children,e=>!Q.nonContentTokens.has(e.type),e=>Q.nonContentTokens.has(e.type)?[]:e.children),o=(a.length>0?a[a.length-1]:e).endLine;(0,Z.isBlankLine)(n[o])||(0,Z.addErrorContext)(t,o,n[o-1].trim(),void 0,void 0,void 0,{lineNumber:o+1,insertText:(0,Q.getBlockQuotePrefixText)(i,o)})}}},oH=e=>Array.isArray(e)?e.map(e=>String(e).toLowerCase()):[],sH={names:[`MD033`,`no-inline-html`],description:`Inline HTML`,tags:[`html`],parser:`micromark`,function:function(e,t){let n=oH(e.config.allowed_elements),r=oH(e.config.table_allowed_elements||e.config.allowed_elements);for(let e of $([`htmlText`],!0)){let i=(0,Q.getHtmlTagInfo)(e);if(i&&!i.close){let a=i?.name.toLowerCase(),o=!!(0,Q.getParentOfType)(e,[`table`]);if((o||!n.includes(a))&&(!o||!r.includes(a))){let n=[e.startColumn,e.text.replace(Z.nextLinesRe,``).length];(0,Z.addError)(t,e.startLine,`Element: `+i.name,void 0,n)}}}}},cH={names:[`MD034`,`no-bare-urls`],description:`Bare URL used`,tags:[`links`,`url`],parser:`micromark`,function:function(e,t){let n=e=>(0,Q.filterByPredicate)(e,e=>{if(e.type===`literalAutolink`&&!(0,Q.inHtmlFlow)(e)){let t=e.parent?.children,n=t?.indexOf(e),r=t?.at(n-1),i=t?.at(n+1);return!(r&&i&&r.type===`data`&&i.type===`data`&&r.text.endsWith(`<`)&&i.text.startsWith(`>`))}return!1},e=>{let{children:t}=e,n=[];for(let e=0;e<t.length;e++){let r=t[e],i=(0,Q.getHtmlTagInfo)(r);if(i&&!i.close){let n=1;for(let r=e+1;r<t.length;r++){let a=t[r],o=(0,Q.getHtmlTagInfo)(a);if(o&&i.name===o.name)if(o.close){if(n--,n===0){e=r;break}}else n++}}else n.push(r)}return n});for(let r of n(e.parsers.micromark.tokens)){let e=[r.startColumn,r.endColumn-r.startColumn],n={editColumn:e[0],deleteCount:e[1],insertText:`<${r.text}>`};(0,Z.addErrorContext)(t,r.startLine,r.text,void 0,void 0,e,n)}}},lH={names:[`MD035`,`hr-style`],description:`Horizontal rule style`,tags:[`hr`],parser:`micromark`,function:function(e,t){let n=String(e.config.style||`consistent`).trim(),r=$([`thematicBreak`]);for(let e of r){let{startLine:r,text:i}=e;n===`consistent`&&(n=i),(0,Z.addErrorDetailIf)(t,r,n,i)}}},uH=[[`emphasis`,`emphasisText`],[`strong`,`strongText`]],dH=e=>!(e.type===`htmlText`||e.type===`data`&&e.text.trim().length===0),fH={names:[`MD036`,`no-emphasis-as-heading`],description:`Emphasis used instead of a heading`,tags:[`headings`,`emphasis`],parser:`micromark`,function:function(e,t){let n=e.config.punctuation;n=String(n===void 0?Z.allPunctuation:n);let r=RegExp(`[`+n+`]$`),i=$([`paragraph`],!0).filter(e=>e.parent?.type===`content`&&(!e.parent?.parent||e.parent?.parent?.type===`htmlFlow`&&!e.parent?.parent?.parent)&&e.children.filter(dH).length===1);for(let e of uH){let n=(0,Q.getDescendantsByType)(i,e);for(let e of n)e.children.length===1&&e.children[0].type===`data`&&!r.test(e.text)&&(0,Z.addErrorContext)(t,e.startLine,e.text)}}},pH={names:[`MD037`,`no-space-in-emphasis`],description:`Spaces inside emphasis markers`,tags:[`whitespace`,`emphasis`],parser:`micromark`,function:function(e,t){let{lines:n,parsers:r}=e,i=new Map;for(let e of[`_`,`__`,`___`,`*`,`**`,`***`])i.set(e,[]);let a=(0,Q.filterByPredicate)(r.micromark.tokens,e=>e.children.some(e=>e.type===`data`));for(let e of a){for(let e of i.values())e.length=0;for(let t of e.children){let{text:e,type:n}=t;if(n===`data`&&e.length<=3){let n=i.get(e);n&&!(0,Q.inHtmlFlow)(t)&&n.push(t)}}for(let[e,r]of i)for(let i=0;i+1<r.length;i+=2){let a=r[i],o=n[a.startLine-1].slice(a.endColumn-1).match(/^\s+\S/);if(o){let[n]=o,r=`${e}${n}`,i=a.endColumn,s=n.length-1;(0,Z.addError)(t,a.startLine,void 0,r,[i,s],{editColumn:i,deleteCount:s})}let s=r[i+1],c=n[s.startLine-1].slice(0,s.startColumn-1).match(/\S\s+$/);if(c){let[n]=c,r=`${n}${e}`,i=s.startColumn-(n.length-1),a=n.length-1;(0,Z.addError)(t,s.startLine,void 0,r,[i,a],{editColumn:i,deleteCount:a})}}}}},mH={names:[`MD038`,`no-space-in-code`],description:`Spaces inside code span elements`,tags:[`whitespace`,`code`],parser:`micromark`,function:function(e,t){let n=$([`codeText`]);for(let e of n){let n=(0,Q.getDescendantsByType)(e,[`codeTextData`]);if(n.length>0){let r=(0,Q.getDescendantsByType)(e,[`codeTextPadding`]),i=r[0],a=n[0],o=/^(\s+)(\S)/.exec(a.text)||[null,``,``],s=o[2]==="`",c=o[1].length-(s&&!i?1:0),l=c>0,u=r[r.length-1],d=n[n.length-1],f=/(\S)(\s+)$/.exec(d.text)||[null,``,``],p=f[1]==="`",m=f[2].length-(p&&!u?1:0),h=m>0,g=l&&h&&i&&u&&!s&&!p,_=e.text;if(l){let e=(g?i:a).startColumn,n=c+(g?i.text.length:0);(0,Z.addErrorContext)(t,a.startLine,_,!0,!1,[e,n],{editColumn:e,deleteCount:n})}if(h){let e=(g?u:d).endColumn,n=m+(g?u.text.length:0);(0,Z.addErrorContext)(t,d.endLine,_,!1,!0,[e-n,n],{editColumn:e-n,deleteCount:n})}}}}};function hH(e,t,n,r){let i=n.text.match(r?/^[^\S\r\n]+/:/[^\S\r\n]+$/),a=i?[r?n.startColumn:n.endColumn-i[0].length,i[0].length]:void 0;(0,Z.addErrorContext)(e,r?n.startLine+ +!i:n.endLine-+!i,t.text.replace(/\s+/g,` `),r,!r,a,a?{editColumn:a[0],deleteCount:a[1]}:void 0)}var gH={names:[`MD039`,`no-space-in-links`],description:`Spaces inside link text`,tags:[`whitespace`,`links`],parser:`micromark`,function:function(e,t){let n=$([`label`]).filter(e=>e.parent?.type===`link`);for(let e of n){let n=e.children.filter(e=>e.type===`labelText`);for(let r of n)r.text.trimStart().length!==r.text.length&&hH(t,e,r,!0),r.text.trimEnd().length!==r.text.length&&hH(t,e,r,!1)}}},_H={names:[`MD040`,`fenced-code-language`],description:`Fenced code blocks should have a language specified`,tags:[`code`,`language`],parser:`micromark`,function:function(e,t){let n=e.config.allowed_languages;n=Array.isArray(n)?n:[];let r=!!e.config.language_only,i=$([`codeFenced`]);for(let e of i){let i=(0,Q.getDescendantsByType)(e,[`codeFencedFence`])[0],{startLine:a,text:o}=i,s=(0,Q.getDescendantsByType)(i,[`codeFencedFenceInfo`])[0]?.text;s?n.length>0&&!n.includes(s)&&(0,Z.addError)(t,a,`"${s}" is not allowed`):(0,Z.addErrorContext)(t,a,o),r&&(0,Q.getDescendantsByType)(i,[`codeFencedFenceMeta`]).length>0&&(0,Z.addError)(t,a,`Info string contains more than language: "${o}"`)}}},vH=/^h[1-6]$/;function yH(e){let{children:t,type:n}=e;if(n===`htmlFlow`){let e=(0,Q.filterByTypes)(t,[`htmlText`],!0),n=e.length>0&&(0,Q.getHtmlTagInfo)(e[0]);if(n)return n.name.toLowerCase()}return null}var bH={names:[`MD041`,`first-line-heading`,`first-line-h1`],description:`First line in a file should be a top-level heading`,tags:[`headings`],parser:`micromark`,function:function(e,t){let n=!!e.config.allow_preamble,r=Number(e.config.level||1),{tokens:i}=e.parsers.micromark;if(!(0,Z.frontMatterHasTitle)(e.frontMatterLines,e.config.front_matter_title)){let a=0;for(let e of i){let{startLine:t,type:i}=e;if(!Q.nonContentTokens.has(i)&&!(0,Q.isHtmlFlowComment)(e)){let o=null;if(i===`atxHeading`||i===`setextHeading`){(0,Q.getHeadingLevel)(e)!==r&&(a=t);break}else if((o=yH(e))&&vH.test(o)){o!==`h${r}`&&(a=t);break}else if(!n){a=t;break}}}a>0&&(0,Z.addErrorContext)(t,a,e.lines[a-1])}}},xH={names:[`MD042`,`no-empty-links`],description:`No empty links`,tags:[`links`],parser:`micromark`,function:function(e,t){let{definitions:n}=sV(),r=e=>{let t=n.get(e.text.trim());return!!(t&&t[1]===`#`)},i=$([`link`]);for(let e of i){let n=(0,Q.getDescendantsByType)(e,[`label`,`labelText`]),i=(0,Q.getDescendantsByType)(e,[`reference`]),a=(0,Q.getDescendantsByType)(e,[`resource`]),o=(0,Q.getDescendantsByType)(i,[`referenceString`]),s=(0,Q.getDescendantsByType)(a,[`resourceDestination`,[`resourceDestinationLiteral`,`resourceDestinationRaw`],`resourceDestinationString`]),c=n.length>0,l=i.length>0,u=a.length>0,d=o.length>0,f=s.length>0,p=!1;c&&(!l&&!u||l&&!d)?p=r(n[0]):d&&!f?p=r(o[0]):!d&&f?p=s[0].text.trim()===`#`:!d&&!f&&(p=!0),p&&(0,Z.addErrorContext)(t,e.startLine,e.text,void 0,void 0,[e.startColumn,e.endColumn-e.startColumn])}}},SH={names:[`MD043`,`required-headings`],description:`Required heading structure`,tags:[`headings`],parser:`micromark`,function:function(e,t){let n=e.config.headings;if(!Array.isArray(n))return;let r=e.config.match_case||!1,i=0,a=!1,o=!1,s=!1,c=()=>String(n[i++]||`[None]`),l=e=>r?e:e.toLowerCase();for(let e of $([`atxHeading`,`setextHeading`]))if(!o){let n=(0,Q.getHeadingText)(e),r=(0,Q.getHeadingLevel)(e);s=!0;let u=`${``.padEnd(r,`#`)} ${n}`,d=c();d===`*`?l(c())!==l(u)&&(a=!0,i--):d===`+`?a=!0:d===`?`||(l(d)===l(u)?a=!1:a?i--:((0,Z.addErrorDetailIf)(t,e.startLine,d,u),o=!0))}let u=n.length-i;!o&&(u>1||u===1&&n[i]!==`*`)&&(s||!n.every(e=>e===`*`))&&(0,Z.addErrorContext)(t,e.lines.length,n[i])}};function CH(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m){let g,v;return b;function b(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),S}function S(t){return t===35?(g=o,w(t)):t===46?(g=s,w(t)):m&&h(t)?ae(e,S,`whitespace`)(t):!m&&C(t)?de(e,S)(t):t===null||x(t)||y(t)||_(t)&&t!==45&&t!==95?ce(t):(e.enter(a),e.enter(c),e.consume(t),ee)}function w(t){let n=g+`Marker`;return e.enter(a),e.enter(g),e.enter(n),e.consume(t),e.exit(n),T}function T(t){if(t===null||t===34||t===35||t===39||t===46||t===60||t===61||t===62||t===96||t===125||C(t))return n(t);let r=g+`Value`;return e.enter(r),e.consume(t),E}function E(t){if(t===null||t===34||t===39||t===60||t===61||t===62||t===96)return n(t);if(t===35||t===46||t===125||C(t)){let n=g+`Value`;return e.exit(n),e.exit(g),e.exit(a),S(t)}return e.consume(t),E}function ee(t){return t===null||x(t)||y(t)||_(t)&&t!==45&&t!==46&&t!==58&&t!==95?(e.exit(c),m&&h(t)?ae(e,te,`whitespace`)(t):!m&&C(t)?de(e,te)(t):te(t)):(e.consume(t),ee)}function te(t){return t===61?(e.enter(l),e.consume(t),e.exit(l),D):(e.exit(a),S(t))}function D(t){return t===null||t===60||t===61||t===62||t===96||t===125||m&&x(t)?n(t):t===34||t===39?(e.enter(u),e.enter(f),e.consume(t),e.exit(f),v=t,re):m&&h(t)?ae(e,D,`whitespace`)(t):!m&&C(t)?de(e,D)(t):(e.enter(d),e.enter(p),e.consume(t),v=void 0,ne)}function ne(t){return t===null||t===34||t===39||t===60||t===61||t===62||t===96?n(t):t===125||C(t)?(e.exit(p),e.exit(d),e.exit(a),S(t)):(e.consume(t),ne)}function re(t){return t===v?(e.enter(f),e.consume(t),e.exit(f),e.exit(u),e.exit(a),se):(e.enter(d),ie(t))}function ie(t){return t===v?(e.exit(d),re(t)):t===null?n(t):x(t)?m?n(t):de(e,ie)(t):(e.enter(p),e.consume(t),oe)}function oe(t){return t===v||t===null||x(t)?(e.exit(p),ie(t)):(e.consume(t),oe)}function se(e){return e===125||C(e)?S(e):ce(e)}function ce(a){return a===125?(e.enter(i),e.consume(a),e.exit(i),e.exit(r),t):n(a)}}function wH(e,t,n,r,i,a,o){let s=0,c=0,l;return u;function u(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),d}function d(n){return n===93?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),f(n))}function f(t){if(t===93&&!c)return h(t);let n=e.enter(`chunkText`,{_contentTypeTextTrailing:!0,contentType:`text`,previous:l});return l&&(l.next=n),l=n,p(t)}function p(t){return t===null||s>999||t===91&&++c>32?n(t):t===93&&!c--?(e.exit(`chunkText`),h(t)):x(t)?o?n(t):(e.consume(t),e.exit(`chunkText`),f):(e.consume(t),t===92?m:p)}function m(t){return t===91||t===92||t===93?(e.consume(t),s++,p):p(t)}function h(n){return e.exit(a),e.enter(i),e.consume(n),e.exit(i),e.exit(r),t}}function TH(e,t,n,r){let i=this;return a;function a(t){return t===null||x(t)||_(t)||y(t)?n(t):(e.enter(r),e.consume(t),o)}function o(a){return a===null||x(a)||y(a)||_(a)&&a!==45&&a!==95?(e.exit(r),i.previous===45||i.previous===95?n(a):t(a)):(e.consume(a),o)}}var EH={tokenize:AH,concrete:!0},DH={tokenize:jH,partial:!0},OH={tokenize:MH,partial:!0},kH={tokenize:NH,partial:!0};function AH(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0,s;return c;function c(t){return e.enter(`directiveContainer`),e.enter(`directiveContainerFence`),e.enter(`directiveContainerSequence`),l(t)}function l(t){return t===58?(e.consume(t),o++,l):o<3?n(t):(e.exit(`directiveContainerSequence`),TH.call(r,e,u,n,`directiveContainerName`)(t))}function u(t){return t===91?e.attempt(DH,d,d)(t):d(t)}function d(t){return t===123?e.attempt(OH,f,f)(t):f(t)}function f(t){return ae(e,p,`whitespace`)(t)}function p(i){return e.exit(`directiveContainerFence`),i===null?w(i):x(i)?r.interrupt?t(i):e.attempt(kH,m,w)(i):n(i)}function m(t){return t===null?w(t):x(t)?e.check(kH,y,w)(t):(e.enter(`directiveContainerContent`),h(t))}function h(t){return e.attempt({tokenize:T,partial:!0},C,a?ae(e,g,`linePrefix`,a+1):g)(t)}function g(t){return t===null?C(t):x(t)?e.check(kH,v,C)(t):v(t)}function _(t){if(t===null){let n=e.exit(`chunkDocument`);return r.parser.lazy[n.start.line]=!1,C(t)}return x(t)?e.check(kH,b,S)(t):(e.consume(t),_)}function v(t){let n=e.enter(`chunkDocument`,{contentType:`document`,previous:s});return s&&(s.next=n),s=n,_(t)}function y(t){return e.enter(`directiveContainerContent`),h(t)}function b(t){e.consume(t);let n=e.exit(`chunkDocument`);return r.parser.lazy[n.start.line]=!1,h}function S(t){let n=e.exit(`chunkDocument`);return r.parser.lazy[n.start.line]=!1,C(t)}function C(t){return e.exit(`directiveContainerContent`),w(t)}function w(n){return e.exit(`directiveContainer`),t(n)}function T(e,t,n){let i=0;return ae(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4);function a(t){return e.enter(`directiveContainerFence`),e.enter(`directiveContainerSequence`),s(t)}function s(t){return t===58?(e.consume(t),i++,s):i<o?n(t):(e.exit(`directiveContainerSequence`),ae(e,c,`whitespace`)(t))}function c(r){return r===null||x(r)?(e.exit(`directiveContainerFence`),t(r)):n(r)}}}function jH(e,t,n){return wH(e,t,n,`directiveContainerLabel`,`directiveContainerLabelMarker`,`directiveContainerLabelString`,!0)}function MH(e,t,n){return CH(e,t,n,`directiveContainerAttributes`,`directiveContainerAttributesMarker`,`directiveContainerAttribute`,`directiveContainerAttributeId`,`directiveContainerAttributeClass`,`directiveContainerAttributeName`,`directiveContainerAttributeInitializerMarker`,`directiveContainerAttributeValueLiteral`,`directiveContainerAttributeValue`,`directiveContainerAttributeValueMarker`,`directiveContainerAttributeValueData`,!0)}function NH(e,t,n){let r=this;return i;function i(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var PH={tokenize:LH},FH={tokenize:RH,partial:!0},IH={tokenize:zH,partial:!0};function LH(e,t,n){let r=this;return i;function i(t){return e.enter(`directiveLeaf`),e.enter(`directiveLeafSequence`),e.consume(t),a}function a(t){return t===58?(e.consume(t),e.exit(`directiveLeafSequence`),TH.call(r,e,o,n,`directiveLeafName`)):n(t)}function o(t){return t===91?e.attempt(FH,s,s)(t):s(t)}function s(t){return t===123?e.attempt(IH,c,c)(t):c(t)}function c(t){return ae(e,l,`whitespace`)(t)}function l(r){return r===null||x(r)?(e.exit(`directiveLeaf`),t(r)):n(r)}}function RH(e,t,n){return wH(e,t,n,`directiveLeafLabel`,`directiveLeafLabelMarker`,`directiveLeafLabelString`,!0)}function zH(e,t,n){return CH(e,t,n,`directiveLeafAttributes`,`directiveLeafAttributesMarker`,`directiveLeafAttribute`,`directiveLeafAttributeId`,`directiveLeafAttributeClass`,`directiveLeafAttributeName`,`directiveLeafAttributeInitializerMarker`,`directiveLeafAttributeValueLiteral`,`directiveLeafAttributeValue`,`directiveLeafAttributeValueMarker`,`directiveLeafAttributeValueData`,!0)}var BH={tokenize:WH,previous:UH},VH={tokenize:GH,partial:!0},HH={tokenize:KH,partial:!0};function UH(e){return e!==58||this.events[this.events.length-1][1].type===`characterEscape`}function WH(e,t,n){let r=this;return i;function i(t){return e.enter(`directiveText`),e.enter(`directiveTextMarker`),e.consume(t),e.exit(`directiveTextMarker`),TH.call(r,e,a,n,`directiveTextName`)}function a(t){return t===58?n(t):t===91?e.attempt(VH,o,o)(t):o(t)}function o(t){return t===123?e.attempt(HH,s,s)(t):s(t)}function s(n){return e.exit(`directiveText`),t(n)}}function GH(e,t,n){return wH(e,t,n,`directiveTextLabel`,`directiveTextLabelMarker`,`directiveTextLabelString`)}function KH(e,t,n){return CH(e,t,n,`directiveTextAttributes`,`directiveTextAttributesMarker`,`directiveTextAttribute`,`directiveTextAttributeId`,`directiveTextAttributeClass`,`directiveTextAttributeName`,`directiveTextAttributeInitializerMarker`,`directiveTextAttributeValueLiteral`,`directiveTextAttributeValue`,`directiveTextAttributeValueMarker`,`directiveTextAttributeValueData`)}function qH(){return{text:{58:BH},flow:{58:[EH,PH]}}}var JH=Ie();function YH(){let e={...qH()};return delete e.text,e}function XH(e,t){return e.slice(t.start.offset,t.end.offset)}function ZH(e,t={}){let n=[YH(),Me(),ge(),j(),yP(),...t.extensions||[]],r=[],i=k.tokenize;function a(t,n,a){let o=this,s=o.events;return i.call(o,t,n,t=>{let n=s.length;for(;--n>=0;){let[e,t]=s[n];if(e===`enter`){let{type:e}=t;if(e===`labelImage`||e===`labelLink`)break}}if(n>=0){let[,t]=s[n],[,i]=s[s.length-1],a={type:`undefinedReferenceShortcut`,start:t.start,end:i.end},c={type:`undefinedReference`,start:t.start,end:i.end},l=s.slice(n).filter(e=>{let[,t]=e,{type:n}=t;return n===`data`||n===`lineEnding`}),u=r.length>0&&r[r.length-1][0],d=u&&u[1];d&&d.end.line===a.start.line&&d.end.column===a.start.column&&(l.length===0?(d.type=`undefinedReferenceCollapsed`,d.end=i.end):(a.type=`undefinedReferenceFull`,a.start=d.start,r.pop()));let f=l.filter(e=>e[0]===`enter`).map(t=>XH(e,t[1])).join(``).trim();if(f.length>0&&!f.includes(`]`)){let e=[[`enter`,a,o],[`enter`,c,o]];for(let t of l){let[n,r]=t;e.push([n,{...r},o])}e.push([`exit`,c,o],[`exit`,a,o]),r.push(e)}}return a(t)})}try{k.tokenize=a;let i=me({...t,extensions:n}),o=we()(e,void 0,!0);return ce(i.document().write(o)).concat(...r)}finally{k.tokenize=i}}function QH(e,t={},n={},r=0,i=void 0){let a=!!t.freezeTokens,o=ZH(e,n),s=[],c=[],l={type:`data`,startLine:-1,startColumn:-1,endLine:-1,endColumn:-1,text:`ROOT`,children:s,parent:null},u=[l],d=l,f=null,p=null,m=!1;for(let s of o){let[o,h]=s,{type:g,start:_,end:v}=h,{column:y,line:b}=_,{column:x,line:S}=v,C=XH(e,h);if(o===`enter`&&!m){let a=d;if(u.push(a),d={type:g,startLine:b+r,startColumn:y,endLine:S+r,endColumn:x,text:C,children:[],parent:a===l?i||null:a},i&&Object.defineProperty(d,JH.htmlFlowSymbol,{value:!0}),a.children.push(d),c.push(d),d.type===`htmlFlow`&&!(0,Q.isHtmlFlowComment)(d)){m=!0,(!f||!p)&&(f={...n,extensions:[{disable:{null:[`codeIndented`,`htmlFlow`]}}]},p=e.split(JH.newlineRe));let r=QH(p.slice(d.startLine-1,d.endLine).join(`
378
+ `),t,f,d.startLine-1,d);d.children=r,c=c.concat(r[JH.flatTokensSymbol])}}else o===`exit`&&(g===`htmlFlow`&&(m=!1),m||(a&&(Object.freeze(d.children),Object.freeze(d)),d=u.pop()))}return Object.defineProperty(s,JH.flatTokensSymbol,{value:c}),a&&Object.freeze(s),s}function $H(e,t){return QH(e,t)}var eU=new Set([`codeFencedFence`,`definition`,`reference`,`resource`]),tU={names:[`MD044`,`proper-names`],description:`Proper names should have the correct capitalization`,tags:[`spelling`],parser:`micromark`,function:function(e,t){let n=e.config.names;if(n=Array.isArray(n)?n:[],n.sort((e,t)=>t.length-e.length||e.localeCompare(t)),n.length===0)return;let r=e.config.code_blocks,i=r===void 0?!0:!!r,a=e.config.html_elements,o=a===void 0?!0:!!a,s=new Set([`data`]);i&&(s.add(`codeFlowValue`),s.add(`codeTextData`)),o&&(s.add(`htmlFlowData`),s.add(`htmlTextData`));let c=(0,Q.filterByPredicate)(e.parsers.micromark.tokens,e=>s.has(e.type),e=>e.children.filter(e=>!eU.has(e.type))),l=[],u=new Set;for(let e of n){let r=(0,Z.escapeForRegExp)(e),i=`(${/^\W/.test(e)?``:`\\b_*`})(${r})${/\W$/.test(e)?``:`_*\\b`}`,a=new RegExp(i,`gi`);for(let r of c){let i=null;for(;(i=a.exec(r.text))!==null;){let[,a,o]=i,s=r.startColumn+i.index+a.length,c=o.length,d=r.startLine,f={startLine:d,startColumn:s,endLine:d,endColumn:s+c-1};if(!n.includes(o)&&!l.some(e=>(0,Z.hasOverlap)(e,f))){let n=[];u.has(r)||(n=(0,Q.filterByTypes)($H(r.text),[`literalAutolink`]).map(e=>({startLine:d,startColumn:r.startColumn+e.startColumn-1,endLine:d,endColumn:r.endColumn+e.endColumn-1})),l.push(...n),u.add(r)),n.some(e=>(0,Z.hasOverlap)(e,f))||(0,Z.addErrorDetailIf)(t,r.startLine,e,o,void 0,void 0,[s,c],{editColumn:s,deleteCount:c,insertText:e})}l.push(f)}}}}},nU=(0,Z.getHtmlAttributeRe)(`alt`),rU=(0,Z.getHtmlAttributeRe)(`aria-hidden`),iU={names:[`MD045`,`no-alt-text`],description:`Images should have alternate text (alt text)`,tags:[`accessibility`,`images`],parser:`micromark`,function:function(e,t){let n=$([`image`]);for(let e of n)if((0,Q.getDescendantsByType)(e,[`label`,`labelText`]).some(e=>e.text.length===0)){let n=e.startLine===e.endLine?[e.startColumn,e.endColumn-e.startColumn]:void 0;(0,Z.addError)(t,e.startLine,void 0,void 0,n)}let r=$([`htmlText`],!0);for(let e of r){let{startColumn:n,startLine:r,text:i}=e,a=(0,Q.getHtmlTagInfo)(e);a&&!a.close&&a.name.toLowerCase()===`img`&&!nU.test(i)&&rU.exec(i)?.[1].toLowerCase()!==`true`&&(0,Z.addError)(t,r,void 0,void 0,[n,i.replace(Z.nextLinesRe,``).length])}}},aU=e=>e===`codeFenced`?`fenced`:`indented`,oU={names:[`MD046`,`code-block-style`],description:`Code block style`,tags:[`code`],parser:`micromark`,function:function(e,t){let n=String(e.config.style||`consistent`);for(let e of $([`codeFenced`,`codeIndented`])){let{startLine:r,type:i}=e;n===`consistent`&&(n=aU(i)),(0,Z.addErrorDetailIf)(t,r,n,aU(i))}}},sU={names:[`MD047`,`single-trailing-newline`],description:`Files should end with a single newline character`,tags:[`blank_lines`],parser:`none`,function:function(e,t){let n=e.lines.length,r=e.lines[n-1];(0,Z.isBlankLine)(r)||(0,Z.addError)(t,n,void 0,void 0,[r.length,1],{insertText:`
379
+ `,editColumn:r.length+1})}};function cU(e){switch(e[0]){case`~`:return`tilde`;default:return`backtick`}}var lU={names:[`MD048`,`code-fence-style`],description:`Code fence style`,tags:[`code`],parser:`micromark`,function:function(e,t){let n=String(e.config.style||`consistent`),r=$([`codeFenced`]);for(let e of r){let{startLine:r,text:i}=(0,Q.getDescendantsByType)(e,[`codeFencedFence`,`codeFencedFenceSequence`])[0];n===`consistent`&&(n=cU(i)),(0,Z.addErrorDetailIf)(t,r,n,cU(i))}}},uU=/^\w$/;function dU(e){switch(e[0]){case`*`:return`asterisk`;default:return`underscore`}}var fU=(e,t,n,r,i,a,o=`consistent`)=>{let{lines:s,parsers:c}=e,l=(0,Q.filterByPredicate)(c.micromark.tokens,e=>e.type===n,e=>e.type===`htmlFlow`?[]:e.children);for(let e of l){let n=(0,Q.getDescendantsByType)(e,[r]),c=n[0],l=n[n.length-1];if(c&&l){let e=dU(c.text);if(o===`consistent`&&(o=e),o!==e&&!(o===`underscore`&&(uU.test(s[c.startLine-1][c.startColumn-2])||uU.test(s[l.endLine-1][l.endColumn-1]))))for(let n of[c,l])(0,Z.addError)(t,n.startLine,`Expected: ${o}; Actual: ${e}`,void 0,[n.startColumn,n.text.length],{editColumn:n.startColumn,deleteCount:n.text.length,insertText:o===`asterisk`?i:a})}}},pU=[{names:[`MD049`,`emphasis-style`],description:`Emphasis style`,tags:[`emphasis`],parser:`micromark`,function:function(e,t){return fU(e,t,`emphasis`,`emphasisSequence`,`*`,`_`,e.config.style||void 0)}},{names:[`MD050`,`strong-style`],description:`Strong style`,tags:[`emphasis`],parser:`micromark`,function:function(e,t){return fU(e,t,`strong`,`strongSequence`,`**`,`__`,e.config.style||void 0)}}],mU=(0,Z.getHtmlAttributeRe)(`id`),hU=(0,Z.getHtmlAttributeRe)(`name`),gU=/\{(#[a-z\d]+(?:[-_][a-z\d]+)*)\}/gu,_U=/^#(?:L\d+(?:C\d+)?-L\d+(?:C\d+)?|L\d+)$/,vU=new Set([`image`,`reference`,`resource`]),yU=new Set([`characterEscapeValue`,`codeTextData`,`data`,`mathTextData`]);function bU(e){let t=(0,Q.filterByPredicate)(e.children,e=>yU.has(e.type),e=>vU.has(e.type)?[]:e.children).map(e=>e.text).join(``);return`#`+encodeURIComponent(t.toLowerCase().replace(/[^\p{Letter}\p{Mark}\p{Number}\p{Connector_Punctuation}\- ]/gu,``).replace(/ /gu,`-`).toWellFormed())}function xU(e){return(0,Q.filterByTypes)(e.children,[`characterEscapeValue`,`data`]).map(e=>e.text).join(``)}var SU={names:[`MD051`,`link-fragments`],description:`Link fragments should be valid`,tags:[`links`],parser:`micromark`,function:function(e,t){let n=e.config.ignore_case||!1,r=e.config.ignored_pattern||``,i=new RegExp(r||`^$`),a=new Map([[`#top`,0]]),o=$([`atxHeadingText`,`setextHeadingText`]);for(let e of o){let t=bU(e);if(t!==`#`){let n=a.get(t)||0;n&&a.set(`${t}-${n}`,0),a.set(t,n+1);let r=null;for(;(r=gU.exec(e.text))!==null;){let[,e]=r;a.has(e)||a.set(e,1)}}}for(let e of $([`htmlText`],!0)){let t=(0,Q.getHtmlTagInfo)(e);if(t&&!t.close){let n=mU.exec(e.text)||t.name.toLowerCase()===`a`&&hU.exec(e.text);n&&n.length>0&&a.set(`#${n[1]}`,0)}}for(let[e,r]of[[`link`,`resourceDestinationString`],[`definition`,`definitionDestinationString`]]){let o=$([e]).filter(e=>!(e.parent?.type===`atxHeadingText`&&(0,Q.isDocfxTab)(e.parent.parent)));for(let e of o){let o=(0,Q.filterByTypes)(e.children,[r]);for(let r of o){let{endColumn:o,startColumn:s}=r,c=xU(r),l=c.slice(1),u=`#${encodeURIComponent(l.toWellFormed())}`;if(c.length>1&&c.startsWith(`#`)&&!a.has(u)&&!_U.test(u)&&!i.test(l)){let r,i,l;e.startLine===e.endLine&&(r=e.text,i=[e.startColumn,e.endColumn-e.startColumn],l={editColumn:s,deleteCount:o-s});let u=c.toLowerCase(),d=[...a.keys()].find(e=>u===e.toLowerCase());d?((l||{}).insertText=d,!n&&d!==c&&(0,Z.addError)(t,e.startLine,`Expected: ${d}; Actual: ${c}`,r,i,l)):(0,Z.addError)(t,e.startLine,void 0,r,i)}}}}}},CU={names:[`MD052`,`reference-links-images`],description:`Reference links and images should use a label that is defined`,tags:[`images`,`links`],parser:`none`,function:function(e,t){let{config:n,lines:r}=e,i=n.shortcut_syntax||!1,a=new Set(n.ignored_labels||[`x`]),{definitions:o,references:s,shortcuts:c}=sV(),l=i?[...s.entries(),...c.entries()]:s.entries();for(let e of l){let[n,i]=e;if(!o.has(n)&&!a.has(n))for(let e of i){let[i,a,o]=e,s=r[i].slice(a,a+o);(0,Z.addError)(t,i+1,`Missing link or image reference definition: "${n}"`,s,[a+1,s.length])}}}},wU=/^ {0,3}\[([^\]]*[^\\])\]:/,TU={names:[`MD053`,`link-image-reference-definitions`],description:`Link and image reference definitions should be needed`,tags:[`images`,`links`],parser:`none`,function:function(e,t){let n=new Set(e.config.ignored_definitions||[`//`]),r=e.lines,{references:i,shortcuts:a,definitions:o,duplicateDefinitions:s}=sV(),c=e=>e.replace(wU,``).trim().length>0,l={deleteCount:-1};for(let e of o.entries()){let[o,[s]]=e;if(!n.has(o)&&!i.has(o)&&!a.has(o)){let e=r[s];(0,Z.addError)(t,s+1,`Unused link or image reference definition: "${o}"`,(0,Z.ellipsify)(e),[1,e.length],c(e)?l:void 0)}}for(let e of s){let[i,a]=e;if(!n.has(i)){let e=r[a];(0,Z.addError)(t,a+1,`Duplicate link or image reference definition: "${i}"`,(0,Z.ellipsify)(e),[1,e.length],c(e)?l:void 0)}}}},EU=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,DU=e=>e.replace(EU,`$1`),OU=/[ <>]/,kU=e=>{try{new URL(e)}catch{return!1}return!OU.test(e)},AU={names:[`MD054`,`link-image-style`],description:`Link and image style`,tags:[`images`,`links`],parser:`micromark`,function:(e,t)=>{let n=e.config,r=n.autolink===void 0||!!n.autolink,i=n.inline===void 0||!!n.inline,a=n.full===void 0||!!n.full,o=n.collapsed===void 0||!!n.collapsed,s=n.shortcut===void 0||!!n.shortcut,c=n.url_inline===void 0||!!n.url_inline;if(r&&i&&a&&o&&s&&c)return;let{definitions:l}=sV(),u=$([`autolink`,`image`,`link`]);for(let e of u){let n=null,u=null,{endColumn:d,endLine:f,startColumn:p,startLine:m,text:h,type:g}=e,_=g===`image`,v=!1;if(g===`autolink`)u=(0,Q.getDescendantsByType)(e,[[`autolinkEmail`,`autolinkProtocol`]])[0]?.text,n=u,v=!r&&!!u;else if(n=(0,Q.getDescendantsByType)(e,[`label`,`labelText`])[0].text,u=(0,Q.getDescendantsByType)(e,[`resource`,`resourceDestination`,[`resourceDestinationLiteral`,`resourceDestinationRaw`],`resourceDestinationString`])[0]?.text,u){let t=(0,Q.getDescendantsByType)(e,[`resource`,`resourceTitle`,`resourceTitleString`])[0]?.text;v=!i||!c&&r&&!_&&!t&&n===u&&kU(u)}else{let t=(0,Q.getDescendantsByType)(e,[`reference`]).length===0,r=(0,Q.getDescendantsByType)(e,[`reference`,`referenceString`])[0]?.text,i=r===void 0,c=l.get(r||n);u=c&&c[1]||``,v=!!(u&&(t?!s:i?!o:!a))}if(v){let e,a;if(m===f){e=[p,d-p];let t=null,o=i&&n,s=r&&!_&&kU(u);o&&(c||!s)?t=`${_?`!`:``}[${n.replace(/[[\]]/g,`\\$&`)}](${u.replace(/[()]/g,`\\$&`)})`:s&&(t=`<${DU(u)}>`),t&&(a={editColumn:e[0],insertText:t,deleteCount:e[1]})}(0,Z.addErrorContext)(t,m,h.replace(Z.nextLinesRe,``),void 0,void 0,e,a)}}}},jU=new Set([`linePrefix`,`whitespace`]),MU=e=>e.filter(e=>!jU.has(e.type)),NU=e=>e[0],PU=e=>e[e.length-1],FU=(e,t)=>[e,t-e+1],IU={names:[`MD055`,`table-pipe-style`],description:`Table pipe style`,tags:[`table`],parser:`micromark`,function:function(e,t){let n=String(e.config.style||`consistent`),r=n!==`no_leading_or_trailing`&&n!==`trailing_only`,i=n!==`no_leading_or_trailing`&&n!==`leading_only`,a=$([`tableDelimiterRow`,`tableRow`]);for(let e of a){let a=NU(e.children),o=NU(MU(a.children)).type===`tableCellDivider`,s=PU(e.children),c=PU(MU(s.children)).type===`tableCellDivider`,l=o?c?`leading_and_trailing`:`leading_only`:c?`trailing_only`:`no_leading_or_trailing`;n===`consistent`&&(n=l,r=o,i=c),o!==r&&(0,Z.addErrorDetailIf)(t,a.startLine,n,l,`${r?`Missing`:`Unexpected`} leading pipe`,void 0,FU(e.startColumn,a.startColumn)),c!==i&&(0,Z.addErrorDetailIf)(t,s.endLine,n,l,`${i?`Missing`:`Unexpected`} trailing pipe`,void 0,FU(s.endColumn-1,e.endColumn-1))}}},LU=(e,t)=>[e,t-e+1],RU={names:[`MD056`,`table-column-count`],description:`Table column count`,tags:[`table`],parser:`micromark`,function:function(e,t){let n=$([`tableDelimiterRow`,`tableRow`]),r=0,i=null;for(let e of n){let n=(0,Q.getParentOfType)(e,[`table`]);i!==n&&(r=0,i=n);let a=e.children.filter(e=>[`tableData`,`tableDelimiter`,`tableHeader`].includes(e.type)),o=a.length;r||=o;let s,c;o<r?(s=`Too few cells, row will be missing data`,c=[e.endColumn-1,1]):r<o&&(s=`Too many cells, extra data will be missing`,c=LU(a[r].startColumn,e.endColumn-1)),(0,Z.addErrorDetailIf)(t,e.endLine,r,o,s,void 0,c)}}},zU={names:[`MD058`,`blanks-around-tables`],description:`Tables should be surrounded by blank lines`,tags:[`table`],parser:`micromark`,function:function(e,t){let{lines:n}=e,r=$([`blockQuotePrefix`,`linePrefix`]),i=$([`table`]);for(let e of i){let i=e.startLine;(0,Z.isBlankLine)(n[i-2])||(0,Z.addErrorContext)(t,i,n[i-1].trim(),void 0,void 0,void 0,{insertText:(0,Q.getBlockQuotePrefixText)(r,i)});let a=e.endLine;(0,Z.isBlankLine)(n[a])||(0,Z.addErrorContext)(t,a,n[a-1].trim(),void 0,void 0,void 0,{lineNumber:a+1,insertText:(0,Q.getBlockQuotePrefixText)(r,a)})}}},BU=new Set([`codeText`,`htmlText`]),VU=[`click here`,`here`,`link`,`more`];function HU(e){return e.replace(/[\W_]+/g,` `).replace(/\s+/g,` `).toLowerCase().trim()}var UU={names:[`MD059`,`descriptive-link-text`],description:`Link text should be descriptive`,tags:[`accessibility`,`links`],parser:`micromark`,function:function(e,t){let n=new Set((e.config.prohibited_texts||VU).map(HU));if(n.size>0){let e=$([`link`]);for(let r of e){let e=(0,Q.getDescendantsByType)(r,[`label`,`labelText`]);for(let r of e){let{children:e,endColumn:i,endLine:a,parent:o,startColumn:s,startLine:c,text:l}=r;if(!e.some(e=>BU.has(e.type))&&n.has(HU(l))){let e=c===a?[s,i-s]:void 0;(0,Z.addErrorContext)(t,c,o.text,void 0,void 0,e)}}}}}};function WU({onlyFirst:e=!1}={}){return RegExp(`(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]`,e?void 0:`g`)}var GU=WU();function KU(e){if(typeof e!=`string`)throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return!e.includes(`\x1B`)&&!e.includes(`›`)?e:e.replace(GU,``)}var qU=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],JU=[12288,12288,65281,65376,65504,65510],YU=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],XU=(e,t)=>{let n=0,r=Math.floor(e.length/2)-1;for(;n<=r;){let i=Math.floor((n+r)/2),a=i*2;if(t<e[a])r=i-1;else if(t>e[a+1])n=i+1;else return!0}return!1},ZU=19968,[QU,$U]=eW(YU);function eW(e){let t=e[0],n=e[1];for(let r=0;r<e.length;r+=2){let i=e[r],a=e[r+1];if(ZU>=i&&ZU<=a)return[i,a];a-i>n-t&&(t=i,n=a)}return[t,n]}var tW=e=>e<161||e>1114109?!1:XU(qU,e),nW=e=>e<12288||e>65510?!1:XU(JU,e),rW=e=>e>=QU&&e<=$U?!0:e<4352||e>262141?!1:XU(YU,e);function iW(e){if(!Number.isSafeInteger(e))throw TypeError(`Expected a code point, got \`${typeof e}\`.`)}function aW(e,{ambiguousAsWide:t=!1}={}){return iW(e),nW(e)||rW(e)||t&&tW(e)?2:1}var oW=new Intl.Segmenter,sW=RegExp(`^(?:\\p{Default_Ignorable_Code_Point}|\\p{Control}|\\p{Format}|\\p{Mark}|\\p{Surrogate})+$`,`v`),cW=RegExp(`^[\\p{Default_Ignorable_Code_Point}\\p{Control}\\p{Format}\\p{Mark}\\p{Surrogate}]+`,`v`),lW=RegExp(`^\\p{RGI_Emoji}$`,`v`),uW=/^[\d#*]\u20E3$/,dW=/\p{Extended_Pictographic}/gu;function fW(e){if(e.length>50)return!1;if(uW.test(e))return!0;if(e.includes(`‍`)){let t=e.match(dW);return t!==null&&t.length>=2}return!1}function pW(e){return e.replace(cW,``)}function mW(e){return sW.test(e)}function hW(e){return e>=4352&&e<=4447||e>=43360&&e<=43388}function gW(e){return e>=4448&&e<=4519||e>=55216&&e<=55238}function _W(e){return e>=4520&&e<=4607||e>=55243&&e<=55291}function vW(e){return hW(e)||gW(e)||_W(e)}function yW(e,t){let n=[];for(let t of e)sW.test(t)||n.push(t.codePointAt(0));if(n.length===0)return;let r=0;for(let e=0;e<n.length;e++){let i=n[e];if(!vW(i)){if(r===0)return;for(let i=e;i<n.length;i++)r+=aW(n[i],t);return r}if(hW(i)&&gW(n[e+1])){r+=2,e+=_W(n[e+2])?2:1;continue}r+=aW(i,t)}return r}function bW(e,t){let n=0,r=!0;for(let i of e){if(r){r=!1;continue}i>=`＀`&&i<=`￯`&&(n+=aW(i.codePointAt(0),t))}return n}function xW(e,t={}){if(typeof e!=`string`||e.length===0)return 0;let{ambiguousIsNarrow:n=!0,countAnsiEscapeCodes:r=!1}=t,i=e;if(!r&&(i.includes(`\x1B`)||i.includes(`›`))&&(i=KU(i)),i.length===0)return 0;if(/^[\u0020-\u007E]*$/.test(i))return i.length;let a=0,o={ambiguousAsWide:!n};for(let{segment:e}of oW.segment(i)){if(mW(e))continue;if(lW.test(e)||fW(e)){a+=2;continue}let t=pW(e),n=yW(t,o);if(n!==void 0){a+=n;continue}let r=t.codePointAt(0);a+=aW(r,o),a+=bW(t,o)}return a}function SW(e,t,n,r,i){e.push({lineNumber:t,detail:r,range:[n,1],fixInfo:i})}function CW(e,t){return(0,Q.filterByTypes)(t.children,[`tableCellDivider`]).map(n=>({actual:n.startColumn,effective:xW(e[t.startLine-1].slice(0,n.startColumn-1))}))}function wW(e,t,n){let r=[],i=t[0],a=CW(e,i);for(let i of t.slice(1)){let t=new Set(a.map(e=>e.effective)),o=CW(e,i);for(let e of o)t.size>0&&!t.delete(e.effective)&&SW(r,i.startLine,e.actual,n)}return r}var TW={names:[`MD060`,`table-column-style`],description:`Table column style`,tags:[`table`],parser:`micromark`,function:function(e,t){let n=String(e.config.style||`any`),r=n===`any`||n===`aligned`,i=n===`any`||n===`compact`,a=n===`any`||n===`tight`,o=!!e.config.aligned_delimiter,s=e.lines,c=$([`table`]);for(let e of c){let n=(0,Q.filterByTypes)(e.children,[`tableDelimiterRow`,`tableRow`]),c=[];r&&c.push(...wW(s,n,`Table pipe does not align with header for style "aligned"`));let l=[],u=[];if((i||a)&&!(r&&c.length===0)){if(o){let e=wW(s,n.slice(0,2),`Table pipe does not align with header for option "aligned_delimiter"`);l.push(...e),u.push(...e)}for(let e of n){let t=(0,Q.filterByTypes)(e.children,[`tableCellDivider`,`tableContent`,`whitespace`]);for(let n=0;n<t.length;n++){let{startColumn:r,startLine:i,type:a}=t[n];if(a===`tableCellDivider`){let a=t[n-1];a&&(a.type===`whitespace`?(a.text.length!==1&&SW(l,i,r,`Table pipe has extra space to the left for style "compact"`,{editColumn:a.startColumn,deleteCount:a.text.length-1}),SW(u,i,r,`Table pipe has space to the left for style "tight"`,{editColumn:a.startColumn,deleteCount:a.text.length})):SW(l,i,r,`Table pipe is missing space to the left for style "compact"`,{editColumn:a.endColumn,insertText:` `}));let o=t[n+1];o&&(o.type===`whitespace`?o.endColumn!==e.endColumn&&(o.text.length!==1&&SW(l,i,r,`Table pipe has extra space to the right for style "compact"`,{editColumn:o.startColumn,deleteCount:o.text.length-1}),SW(u,i,r,`Table pipe has space to the right for style "tight"`,{editColumn:o.startColumn,deleteCount:o.text.length})):SW(l,i,r,`Table pipe is missing space to the right for style "compact"`,{editColumn:o.startColumn,insertText:` `}))}}}}let d=c;i&&(l.length<d.length||!r)&&(d=l),a&&(u.length<d.length||!r&&!i)&&(d=u);for(let e of d)t(e)}}},[EW,DW]=IV,[OW,kW]=pU,AW=[pV,mV,yV,bV,CV,wV,EV,OV,kV,jV,NV,PV,EW,LV,DW,VV,HV,UV,WV,GV,qV,YV,$V,eH,rH,aH,sH,cH,lH,fH,pH,mH,gH,_H,bH,xH,SH,tU,iU,oU,sU,lU,OW,kW,SU,CU,TU,AU,IU,RU,zU,UU,TW];for(let e of AW){let t=e.names[0].toLowerCase();e.information=new URL(`${cV}/blob/v${lV}/doc/${t}.md`)}function jW(e,t,n){let r=null,i=null,a=[],o=0;return(n||[JSON.parse]).every(e=>{try{let n=e(t);return r=n&&typeof n==`object`&&!Array.isArray(n)?n:{},!1}catch(e){a.push(`Parser ${o++}: ${e?.message}`)}return!0})&&(a.unshift(`Unable to parse '${e}'`),i=a.join(`; `)),{config:r,message:i}}function MW(e,t){let n=null;if(e.length===AW.length)return n;let r={};for(let[i,a]of e.entries()){let e=i-AW.length;function o(t,n){return Error(`Property '${t}' of custom rule at index ${e} is incorrect: '${n}'.`)}for(let e of[`names`,`tags`]){let t=a[e];!n&&(!t||!Array.isArray(t)||t.length===0||!t.every(Z.isString)||t.some(Z.isEmptyString))&&(n=o(e,t))}for(let e of[[`description`,`string`],[`function`,`function`]]){let t=e[0],r=a[t];!n&&(!r||typeof r!==e[1])&&(n=o(t,r))}if(!n&&a.parser!==void 0&&a.parser!==`markdownit`&&a.parser!==`micromark`&&a.parser!==`none`&&(n=o(`parser`,a.parser)),!n&&a.information&&!Z.isUrl(a.information)&&(n=o(`information`,a.information)),!n&&a.asynchronous!==void 0&&typeof a.asynchronous!=`boolean`&&(n=o(`asynchronous`,a.asynchronous)),!n&&a.asynchronous&&t&&(n=Error(`Custom rule `+a.names.join(`/`)+` at index `+e+` is asynchronous and can not be used in a synchronous context.`)),!n){for(let t of a.names){let i=t.toUpperCase();!n&&r[i]!==void 0&&(n=Error(`Name '`+t+`' of custom rule at index `+e+` is already used as a name or tag.`)),r[i]=!0}for(let t of a.tags){let i=t.toUpperCase();!n&&r[i]&&(n=Error(`Tag '`+t+`' of custom rule at index `+e+` is already used as a name.`)),r[i]=!1}}}return n}function NW(e,t){let n=[];if(t){let r=e.match(t);if(r&&!r.index){let t=r[0];e=e.slice(t.length),n=t.split(Z.newLineRe),n.length>0&&n[n.length-1]===``&&n.length--}}return{content:e,frontMatterLines:n}}function PW(e){let t={};for(let n of e){let e=n.names[0].toUpperCase();for(let r of n.names){let n=r.toUpperCase();t[n]=[e]}for(let r of n.tags){let n=r.toUpperCase(),i=t[n]||[];i.push(e),t[n]=i}}return t}function FW(e,t,n){let r=!0,i=`error`;Object.entries(t).every(([e,t])=>e.toUpperCase()===`DEFAULT`?(r=!!t,t===`warning`&&(i=`warning`),!1):!0);let a={},o=new Map,s=new Map,c=Object.freeze({});for(let t of e.map(e=>e.names[0].toUpperCase()))a[t]=c,o.set(t,r),s.set(t,i);for(let[e,r]of Object.entries(t)){let t=e.toUpperCase(),i=!1,c=`error`,l={};if(r)if(r instanceof Object){let e=r;i=e.enabled===void 0?!0:!!e.enabled,c=e.severity===`warning`?`warning`:`error`,l=Object.fromEntries(Object.entries(r).filter(([e])=>e!==`enabled`&&e!==`severity`))}else i=!0,c=r===`warning`?`warning`:`error`;for(let e of n[t]||[])Object.freeze(l),a[e]=l,o.set(e,i),s.set(e,c)}return{effectiveConfig:a,rulesEnabled:o,rulesSeverity:s}}function IW(e,t,n,r,i,a,o){let s=new Map,c=s,l=Array(1+n.length);function u(e,t,n=void 0){for(let[i,a]of e.entries()){if(!r){let e=null;for(;e=Z.inlineCommentStartRe.exec(a);){let n=e[2].toUpperCase(),r=e.index+e[1].length,o=a.indexOf(`-->`,r);if(o===-1)break;t(n,a.slice(r,o),i+1)}}n&&n()}}function d(e,t){if(e===`CONFIGURE-FILE`){let{config:e}=jW(`CONFIGURE-FILE`,t,a);e&&(i={...i,...e})}}function f(e,t,n){n=new Map(n);let r=e.startsWith(`ENABLE`),i=t&&t.trim(),a=i?i.toUpperCase().split(/\s+/):b;for(let e of a)for(let t of o[e]||[])n.set(t,r);return n}function p(e,t){(e===`ENABLE-FILE`||e===`DISABLE-FILE`)&&(s=f(e,t,s))}function m(e,t){e===`CAPTURE`?c=s:e===`RESTORE`?s=c:(e===`ENABLE`||e===`DISABLE`)&&(s=f(e,t,s))}function h(){l.push(s)}function g(e,t,r){let i=e===`DISABLE-LINE`,a=e===`DISABLE-NEXT-LINE`;if(i||a){let i=n.length+r+ +!!a;l[i]=f(e,t,l[i])}}u([t.join(`
380
+ `)],d);let{effectiveConfig:_,rulesEnabled:v,rulesSeverity:y}=FW(e,i,o),b=[...v.keys()];return s=new Map(v),c=s,u(t,p),u(t,m,h),u(t,g),{effectiveConfig:_,enabledRulesPerLineNumber:l,enabledRuleList:e.filter(e=>{let t=e.names[0].toUpperCase();return l.some(e=>e.get(t))}),rulesSeverity:y}}function LW(e,t,n,i,a,s,c,l,u,d,f,p){let m=e=>p(e instanceof Error?e:Error(e));i=i.replace(/^\uFEFF/,``);let h=NW(i,l),{frontMatterLines:g}=h;i=h.content;let{effectiveConfig:_,enabledRulesPerLineNumber:v,enabledRuleList:y,rulesSeverity:b}=IW(e,i.split(Z.newLineRe),g,d,s,c,t),x=y.some(e=>e.parser===`markdownit`||e.parser===void 0),S=y.some(e=>e.parser===`micromark`),C=e.length!==AW.length,w=S?$H(i,{freezeTokens:C}):[],T=i;i=Z.clearHtmlCommentText(i);let E=i.split(Z.newLineRe),ee=e=>{let t=Object.freeze({markdownit:Object.freeze({tokens:e})}),r=Object.freeze({micromark:Object.freeze({tokens:w})}),i=Object.freeze({}),a={name:n,version:lV,lines:Object.freeze(E),frontMatterLines:Object.freeze(g)};iV({...a,parsers:r,config:{}});let o=[],s=s=>{let c=s.names[0].toUpperCase(),l={},d=i;s.parser===void 0?(l.tokens=e,d=t):s.parser===`markdownit`?d=t:s.parser===`micromark`&&(d=r);let f=Object.freeze({...a,...l,parsers:d,config:_[c]});function p(e){throw Error(`Value of '${e}' passed to onError by '${c}' is incorrect for '${n}'.`)}function m(e){(!e||!Z.isNumber(e.lineNumber)||e.lineNumber<1||e.lineNumber>E.length)&&p(`lineNumber`);let t=e.lineNumber+g.length;if(!v[t].get(c))return;e.detail&&!Z.isString(e.detail)&&p(`detail`),e.context&&!Z.isString(e.context)&&p(`context`),e.information&&!Z.isUrl(e.information)&&p(`information`),e.range&&(!Array.isArray(e.range)||e.range.length!==2||!Z.isNumber(e.range[0])||e.range[0]<1||!Z.isNumber(e.range[1])||e.range[1]<1||e.range[0]+e.range[1]-1>E[e.lineNumber-1].length)&&p(`range`);let n=e.fixInfo,r={};if(n){Z.isObject(n)||p(`fixInfo`),n.lineNumber!==void 0&&((!Z.isNumber(n.lineNumber)||n.lineNumber<1||n.lineNumber>E.length)&&p(`fixInfo.lineNumber`),r.lineNumber=n.lineNumber+g.length);let t=n.lineNumber||e.lineNumber;n.editColumn!==void 0&&((!Z.isNumber(n.editColumn)||n.editColumn<1||n.editColumn>E[t-1].length+1)&&p(`fixInfo.editColumn`),r.editColumn=n.editColumn),n.deleteCount!==void 0&&((!Z.isNumber(n.deleteCount)||n.deleteCount<-1||n.deleteCount>E[t-1].length)&&p(`fixInfo.deleteCount`),r.deleteCount=n.deleteCount),n.insertText!==void 0&&(Z.isString(n.insertText)||p(`fixInfo.insertText`),r.insertText=n.insertText)}let i=e.information||s.information;o.push({lineNumber:t,ruleNames:s.names,ruleDescription:s.description,ruleInformation:i?i.href:null,errorDetail:e.detail?.replace(Z.newLineRe,` `)||null,errorContext:e.context?.replace(Z.newLineRe,` `)||null,errorRange:e.range?[...e.range]:null,fixInfo:n?r:null,severity:b.get(c)})}let h=e=>m({lineNumber:1,detail:`This rule threw an exception: ${e.message||e}`}),y=()=>s.function(f,m);if(s.asynchronous){let e=Promise.resolve().then(y);return u?e.catch(h):e}try{y()}catch(e){if(u)h(e);else throw e}return null},c=()=>(o.sort((e,t)=>e.ruleNames[0].localeCompare(t.ruleNames[0])||e.lineNumber-t.lineNumber),o),l=y.filter(e=>e.asynchronous),d=y.filter(e=>!e.asynchronous),f=[...l,...d],h=()=>p(null,c());try{let e=f.map(s);l.length>0?Promise.all(e.slice(0,l.length)).then(h).catch(m):h()}catch(e){m(e)}finally{iV()}};!x||f?ee(x?(0,fV.requireMarkdownItCjs)().getMarkdownItTokens(a(),T,E):[]):Promise.all([o(()=>import(`./markdownit-YwcN3EvW.js`).then(e=>r(e.t(),1)),__vite__mapDeps([0,1]),import.meta.url),new Promise(e=>e(a()))]).then(([e,t])=>{ee(e.getMarkdownItTokens(t,T,E))}).catch(m)}function RW(e,t,n,r,i,a,o,s,c,l,u,d){function f(l,f){return l?d(l):LW(e,t,n,f,r,i,a,o,s,c,u,d)}u?f(null,l.readFileSync(n,`utf8`)):l.readFile(n,`utf8`,f)}function zW(e,t,n){e||={},n||=()=>{};let r=[e.customRules||[]].flat().map(e=>({names:Z.cloneIfArray(e.names),description:e.description,information:Z.cloneIfUrl(e.information),tags:Z.cloneIfArray(e.tags),parser:e.parser,asynchronous:e.asynchronous,function:e.function})),i=AW.concat(r),a=MW(i,t);if(a){n(a);return}let o=[];Array.isArray(e.files)?o=[...e.files]:e.files&&(o=[String(e.files)]);let s=e.strings||{},c=Object.keys(s),l=e.config||{default:!0},u=e.configParsers||void 0,d=e.frontMatter===void 0?Z.frontMatterRe:e.frontMatter,f=!!e.handleRuleFailures,p=!!e.noInlineConfig,m=e.markdownItFactory||(()=>{throw Error(`The option 'markdownItFactory' was required (due to the option 'customRules' including a rule requiring the 'markdown-it' parser), but 'markdownItFactory' was not set.`)}),h=e.fs||$B,g=PW(i),_={},v=!1,y=0;function b(){let e;function r(r,i){return y--,r?(v=!0,n(r)):(_[e]=i,t||b(),null)}if(!v){if(e=o.shift())y++,RW(i,g,e,m,l,u,d,f,p,h,t,r);else if(e=c.shift())y++,LW(i,g,e,s[e]||``,m,l,u,d,f,p,t,r);else if(y===0){v=!0;let e=Object.entries(_);e.sort(([e],[t])=>e.localeCompare(t));let t=Object.fromEntries(e);return n(null,t)}}return null}if(t)for(;!v;)b();else b(),b(),b(),b(),b(),b(),b(),b()}function BW(e){let t=null;return zW(e,!0,function(e,n){if(e)throw e;t=n}),t}function VW(e,t=0){return{lineNumber:e.lineNumber||t,editColumn:e.editColumn||1,deleteCount:e.deleteCount||0,insertText:e.insertText||``}}function HW(e,t,n=`
381
+ `){let{editColumn:r,deleteCount:i,insertText:a}=VW(t),o=r-1;return i===-1?null:e.slice(0,o)+a.replace(/\n/g,n)+e.slice(o+i)}function UW(e,t){let n=Z.getPreferredLineEnding(e,eV),r=e.split(Z.newLineRe),i=t.filter(e=>e.fixInfo).map(e=>VW(e.fixInfo,e.lineNumber));i.sort((e,t)=>{let n=e.deleteCount===-1,r=t.deleteCount===-1;return t.lineNumber-e.lineNumber||(n?1:r?-1:0)||t.editColumn-e.editColumn||t.insertText.length-e.insertText.length});let a={};i=i.filter(e=>{let t=e.lineNumber!==a.lineNumber||e.editColumn!==a.editColumn||e.deleteCount!==a.deleteCount||e.insertText!==a.insertText;return a=e,t}),a={lineNumber:-1};for(let e of i)e.lineNumber===a.lineNumber&&e.editColumn===a.editColumn&&!e.insertText&&e.deleteCount>0&&a.insertText&&!a.deleteCount&&(e.insertText=a.insertText,a.lineNumber=0),a=e;i=i.filter(e=>e.lineNumber);let o=-1,s=-1;for(let e of i){let{lineNumber:t,editColumn:i,deleteCount:a}=e,c=t-1,l=i-1;(c!==o||a===-1||l+a<=s-(a>0?0:1))&&(r[c]=HW(r[c],e,n)),o=c,s=l}return r.filter(e=>e!==null).join(n)}var WW=/^>|^->|<!--|-->|--!>|<!-$/g,GW=[`>`],KW=[`<`,`>`];function qW(e,t,n,r){return r.settings.bogusComments?`<?`+oF(e.value,Object.assign({},r.settings.characterReferences,{subset:GW}))+`>`:`<!--`+e.value.replace(WW,i)+`-->`;function i(e){return oF(e,Object.assign({},r.settings.characterReferences,{subset:KW}))}}function JW(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}var YW=QW(1),XW=QW(-1),ZW=[];function QW(e){return t;function t(t,n,r){let i=t?t.children:ZW,a=(n||0)+e,o=i[a];if(!r)for(;o&&re(o);)a+=e,o=i[a];return o}}var $W={}.hasOwnProperty;function eG(e){return t;function t(t,n,r){return $W.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var tG=eG({body:iG,caption:nG,colgroup:nG,dd:cG,dt:sG,head:nG,html:rG,li:oG,optgroup:uG,option:dG,p:aG,rp:lG,rt:lG,tbody:pG,td:gG,tfoot:mG,th:gG,thead:fG,tr:hG});function nG(e,t,n){let r=YW(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&re(r.value.charAt(0)))}function rG(e,t,n){let r=YW(n,t);return!r||r.type!==`comment`}function iG(e,t,n){let r=YW(n,t);return!r||r.type!==`comment`}function aG(e,t,n){let r=YW(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||!(n.type===`element`&&(n.tagName===`a`||n.tagName===`audio`||n.tagName===`del`||n.tagName===`ins`||n.tagName===`map`||n.tagName===`noscript`||n.tagName===`video`))}function oG(e,t,n){let r=YW(n,t);return!r||r.type===`element`&&r.tagName===`li`}function sG(e,t,n){let r=YW(n,t);return!!(r&&r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`))}function cG(e,t,n){let r=YW(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function lG(e,t,n){let r=YW(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function uG(e,t,n){let r=YW(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function dG(e,t,n){let r=YW(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function fG(e,t,n){let r=YW(n,t);return!!(r&&r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`))}function pG(e,t,n){let r=YW(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function mG(e,t,n){return!YW(n,t)}function hG(e,t,n){let r=YW(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function gG(e,t,n){let r=YW(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var _G=eG({body:bG,colgroup:xG,head:yG,html:vG,tbody:SG});function vG(e){let t=YW(e,-1);return!t||t.type!==`comment`}function yG(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function bG(e){let t=YW(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&re(t.value.charAt(0)))&&!(t.type===`element`&&(t.tagName===`meta`||t.tagName===`link`||t.tagName===`script`||t.tagName===`style`||t.tagName===`template`))}function xG(e,t,n){let r=XW(n,t),i=YW(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&tG(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function SG(e,t,n){let r=XW(n,t),i=YW(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&tG(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var CG={name:[[`
382
382
  \f\r &/=>`.split(``),`
383
383
  \f\r "&'/=>\``.split(``)],[`\0
384
384
  \f\r "&'/<=>`.split(``),`\0
@@ -386,11 +386,11 @@ ${t.slice(l+2)}`,d+=1;else break}t.push({indent:l,number:parseInt(s,10),content:
386
386
  \f\r &>`.split(``),`\0
387
387
  \f\r "&'<=>\``.split(``)],[`\0
388
388
  \f\r "&'<=>\``.split(``),`\0
389
- \f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function TG(e,t,n,r){let i=r.schema,a=i.space===`svg`?!1:r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=he);let l=EG(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!vG(e,t,n))&&(s.push(`<`,e.tagName,l?` `+l:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c===`/`||c&&c!==`"`&&c!==`'`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(u),!o&&(!a||!nG(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function EG(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=DG(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function DG(e,t,n){let r=Oe(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=+!e.settings.allowDangerousCharacters,o=e.quote,s;if(r.overloadedBoolean&&(n===r.attribute||n===``)?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!=`string`||n===r.attribute||n===``)&&(n=!!n),n==null||n===!1||typeof n==`number`&&Number.isNaN(n))return``;let c=sF(r.attribute,Object.assign({},e.settings.characterReferences,{subset:wG.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?Te:be)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=sF(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:wG.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&T(n,o)>T(n,e.alternative)&&(o=e.alternative),s=o+sF(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?wG.single:wG.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var OG=[`<`,`&`];function kG(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:sF(e.value,Object.assign({},r.settings.characterReferences,{subset:OG}))}function AG(e,t,n,r){return r.settings.allowDangerousHtml?e.value:kG(e,t,n,r)}function jG(e,t,n,r){return r.all(e)}var MG=fe(`type`,{invalid:NG,unknown:PG,handlers:{comment:JW,doctype:YW,element:TG,raw:AG,root:jG,text:kG}});function NG(e){throw Error("Expected node, not `"+e+"`")}function PG(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var FG={},IG={},LG=[];function RG(e,t){let n=t||FG,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:zG,all:BG,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||ve,characterReferences:n.characterReferences||IG,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?he:O,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function zG(e,t,n){return MG(e,t,n,this)}function BG(e){let t=[],n=e&&e.children||LG,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}function VG(e){let t=this,n={...t.data(`settings`),...e};t.compiler=r;function r(e){return RG(e,n)}}var HG=a(((e,t)=>{var n=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32},r=-1,i=1,a=0;n.Diff=function(e,t){return[e,t]},n.prototype.diff_main=function(e,t,r,i){i===void 0&&(i=this.Diff_Timeout<=0?Number.MAX_VALUE:new Date().getTime()+this.Diff_Timeout*1e3);var o=i;if(e==null||t==null)throw Error(`Null input. (diff_main)`);if(e==t)return e?[new n.Diff(a,e)]:[];r===void 0&&(r=!0);var s=r,c=this.diff_commonPrefix(e,t),l=e.substring(0,c);e=e.substring(c),t=t.substring(c),c=this.diff_commonSuffix(e,t);var u=e.substring(e.length-c);e=e.substring(0,e.length-c),t=t.substring(0,t.length-c);var d=this.diff_compute_(e,t,s,o);return l&&d.unshift(new n.Diff(a,l)),u&&d.push(new n.Diff(a,u)),this.diff_cleanupMerge(d),d},n.prototype.diff_compute_=function(e,t,o,s){var c;if(!e)return[new n.Diff(i,t)];if(!t)return[new n.Diff(r,e)];var l=e.length>t.length?e:t,u=e.length>t.length?t:e,d=l.indexOf(u);if(d!=-1)return c=[new n.Diff(i,l.substring(0,d)),new n.Diff(a,u),new n.Diff(i,l.substring(d+u.length))],e.length>t.length&&(c[0][0]=c[2][0]=r),c;if(u.length==1)return[new n.Diff(r,e),new n.Diff(i,t)];var f=this.diff_halfMatch_(e,t);if(f){var p=f[0],m=f[1],h=f[2],g=f[3],_=f[4],v=this.diff_main(p,h,o,s),y=this.diff_main(m,g,o,s);return v.concat([new n.Diff(a,_)],y)}return o&&e.length>100&&t.length>100?this.diff_lineMode_(e,t,s):this.diff_bisect_(e,t,s)},n.prototype.diff_lineMode_=function(e,t,o){var s=this.diff_linesToChars_(e,t);e=s.chars1,t=s.chars2;var c=s.lineArray,l=this.diff_main(e,t,!1,o);this.diff_charsToLines_(l,c),this.diff_cleanupSemantic(l),l.push(new n.Diff(a,``));for(var u=0,d=0,f=0,p=``,m=``;u<l.length;){switch(l[u][0]){case i:f++,m+=l[u][1];break;case r:d++,p+=l[u][1];break;case a:if(d>=1&&f>=1){l.splice(u-d-f,d+f),u=u-d-f;for(var h=this.diff_main(p,m,!1,o),g=h.length-1;g>=0;g--)l.splice(u,0,h[g]);u+=h.length}f=0,d=0,p=``,m=``;break}u++}return l.pop(),l},n.prototype.diff_bisect_=function(e,t,a){for(var o=e.length,s=t.length,c=Math.ceil((o+s)/2),l=c,u=2*c,d=Array(u),f=Array(u),p=0;p<u;p++)d[p]=-1,f[p]=-1;d[l+1]=0,f[l+1]=0;for(var m=o-s,h=m%2!=0,g=0,_=0,v=0,y=0,b=0;b<c&&!(new Date().getTime()>a);b++){for(var x=-b+g;x<=b-_;x+=2){for(var S=l+x,C=x==-b||x!=b&&d[S-1]<d[S+1]?d[S+1]:d[S-1]+1,w=C-x;C<o&&w<s&&e.charAt(C)==t.charAt(w);)C++,w++;if(d[S]=C,C>o)_+=2;else if(w>s)g+=2;else if(h){var T=l+m-x;if(T>=0&&T<u&&f[T]!=-1){var E=o-f[T];if(C>=E)return this.diff_bisectSplit_(e,t,C,w,a)}}}for(var ee=-b+v;ee<=b-y;ee+=2){for(var T=l+ee,E=ee==-b||ee!=b&&f[T-1]<f[T+1]?f[T+1]:f[T-1]+1,te=E-ee;E<o&&te<s&&e.charAt(o-E-1)==t.charAt(s-te-1);)E++,te++;if(f[T]=E,E>o)y+=2;else if(te>s)v+=2;else if(!h){var S=l+m-ee;if(S>=0&&S<u&&d[S]!=-1){var C=d[S],w=l+C-S;if(E=o-E,C>=E)return this.diff_bisectSplit_(e,t,C,w,a)}}}}return[new n.Diff(r,e),new n.Diff(i,t)]},n.prototype.diff_bisectSplit_=function(e,t,n,r,i){var a=e.substring(0,n),o=t.substring(0,r),s=e.substring(n),c=t.substring(r),l=this.diff_main(a,o,!1,i),u=this.diff_main(s,c,!1,i);return l.concat(u)},n.prototype.diff_linesToChars_=function(e,t){var n=[],r={};n[0]=``;function i(e){for(var t=``,i=0,o=-1,s=n.length;o<e.length-1;){o=e.indexOf(`
389
+ \f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function wG(e,t,n,r){let i=r.schema,a=i.space===`svg`?!1:r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=he);let l=TG(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!_G(e,t,n))&&(s.push(`<`,e.tagName,l?` `+l:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c===`/`||c&&c!==`"`&&c!==`'`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(u),!o&&(!a||!tG(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function TG(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=EG(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function EG(e,t,n){let r=Oe(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=+!e.settings.allowDangerousCharacters,o=e.quote,s;if(r.overloadedBoolean&&(n===r.attribute||n===``)?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!=`string`||n===r.attribute||n===``)&&(n=!!n),n==null||n===!1||typeof n==`number`&&Number.isNaN(n))return``;let c=oF(r.attribute,Object.assign({},e.settings.characterReferences,{subset:CG.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?Te:be)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=oF(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:CG.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&T(n,o)>T(n,e.alternative)&&(o=e.alternative),s=o+oF(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?CG.single:CG.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var DG=[`<`,`&`];function OG(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:oF(e.value,Object.assign({},r.settings.characterReferences,{subset:DG}))}function kG(e,t,n,r){return r.settings.allowDangerousHtml?e.value:OG(e,t,n,r)}function AG(e,t,n,r){return r.all(e)}var jG=fe(`type`,{invalid:MG,unknown:NG,handlers:{comment:qW,doctype:JW,element:wG,raw:kG,root:AG,text:OG}});function MG(e){throw Error("Expected node, not `"+e+"`")}function NG(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var PG={},FG={},IG=[];function LG(e,t){let n=t||PG,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:RG,all:zG,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||ve,characterReferences:n.characterReferences||FG,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?he:O,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function RG(e,t,n){return jG(e,t,n,this)}function zG(e){let t=[],n=e&&e.children||IG,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}function BG(e){let t=this,n={...t.data(`settings`),...e};t.compiler=r;function r(e){return LG(e,n)}}var VG=a(((e,t)=>{var n=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32},r=-1,i=1,a=0;n.Diff=function(e,t){return[e,t]},n.prototype.diff_main=function(e,t,r,i){i===void 0&&(i=this.Diff_Timeout<=0?Number.MAX_VALUE:new Date().getTime()+this.Diff_Timeout*1e3);var o=i;if(e==null||t==null)throw Error(`Null input. (diff_main)`);if(e==t)return e?[new n.Diff(a,e)]:[];r===void 0&&(r=!0);var s=r,c=this.diff_commonPrefix(e,t),l=e.substring(0,c);e=e.substring(c),t=t.substring(c),c=this.diff_commonSuffix(e,t);var u=e.substring(e.length-c);e=e.substring(0,e.length-c),t=t.substring(0,t.length-c);var d=this.diff_compute_(e,t,s,o);return l&&d.unshift(new n.Diff(a,l)),u&&d.push(new n.Diff(a,u)),this.diff_cleanupMerge(d),d},n.prototype.diff_compute_=function(e,t,o,s){var c;if(!e)return[new n.Diff(i,t)];if(!t)return[new n.Diff(r,e)];var l=e.length>t.length?e:t,u=e.length>t.length?t:e,d=l.indexOf(u);if(d!=-1)return c=[new n.Diff(i,l.substring(0,d)),new n.Diff(a,u),new n.Diff(i,l.substring(d+u.length))],e.length>t.length&&(c[0][0]=c[2][0]=r),c;if(u.length==1)return[new n.Diff(r,e),new n.Diff(i,t)];var f=this.diff_halfMatch_(e,t);if(f){var p=f[0],m=f[1],h=f[2],g=f[3],_=f[4],v=this.diff_main(p,h,o,s),y=this.diff_main(m,g,o,s);return v.concat([new n.Diff(a,_)],y)}return o&&e.length>100&&t.length>100?this.diff_lineMode_(e,t,s):this.diff_bisect_(e,t,s)},n.prototype.diff_lineMode_=function(e,t,o){var s=this.diff_linesToChars_(e,t);e=s.chars1,t=s.chars2;var c=s.lineArray,l=this.diff_main(e,t,!1,o);this.diff_charsToLines_(l,c),this.diff_cleanupSemantic(l),l.push(new n.Diff(a,``));for(var u=0,d=0,f=0,p=``,m=``;u<l.length;){switch(l[u][0]){case i:f++,m+=l[u][1];break;case r:d++,p+=l[u][1];break;case a:if(d>=1&&f>=1){l.splice(u-d-f,d+f),u=u-d-f;for(var h=this.diff_main(p,m,!1,o),g=h.length-1;g>=0;g--)l.splice(u,0,h[g]);u+=h.length}f=0,d=0,p=``,m=``;break}u++}return l.pop(),l},n.prototype.diff_bisect_=function(e,t,a){for(var o=e.length,s=t.length,c=Math.ceil((o+s)/2),l=c,u=2*c,d=Array(u),f=Array(u),p=0;p<u;p++)d[p]=-1,f[p]=-1;d[l+1]=0,f[l+1]=0;for(var m=o-s,h=m%2!=0,g=0,_=0,v=0,y=0,b=0;b<c&&!(new Date().getTime()>a);b++){for(var x=-b+g;x<=b-_;x+=2){for(var S=l+x,C=x==-b||x!=b&&d[S-1]<d[S+1]?d[S+1]:d[S-1]+1,w=C-x;C<o&&w<s&&e.charAt(C)==t.charAt(w);)C++,w++;if(d[S]=C,C>o)_+=2;else if(w>s)g+=2;else if(h){var T=l+m-x;if(T>=0&&T<u&&f[T]!=-1){var E=o-f[T];if(C>=E)return this.diff_bisectSplit_(e,t,C,w,a)}}}for(var ee=-b+v;ee<=b-y;ee+=2){for(var T=l+ee,E=ee==-b||ee!=b&&f[T-1]<f[T+1]?f[T+1]:f[T-1]+1,te=E-ee;E<o&&te<s&&e.charAt(o-E-1)==t.charAt(s-te-1);)E++,te++;if(f[T]=E,E>o)y+=2;else if(te>s)v+=2;else if(!h){var S=l+m-ee;if(S>=0&&S<u&&d[S]!=-1){var C=d[S],w=l+C-S;if(E=o-E,C>=E)return this.diff_bisectSplit_(e,t,C,w,a)}}}}return[new n.Diff(r,e),new n.Diff(i,t)]},n.prototype.diff_bisectSplit_=function(e,t,n,r,i){var a=e.substring(0,n),o=t.substring(0,r),s=e.substring(n),c=t.substring(r),l=this.diff_main(a,o,!1,i),u=this.diff_main(s,c,!1,i);return l.concat(u)},n.prototype.diff_linesToChars_=function(e,t){var n=[],r={};n[0]=``;function i(e){for(var t=``,i=0,o=-1,s=n.length;o<e.length-1;){o=e.indexOf(`
390
390
  `,i),o==-1&&(o=e.length-1);var c=e.substring(i,o+1);(r.hasOwnProperty?r.hasOwnProperty(c):r[c]!==void 0)?t+=String.fromCharCode(r[c]):(s==a&&(c=e.substring(i),o=e.length),t+=String.fromCharCode(s),r[c]=s,n[s++]=c),i=o+1}return t}var a=4e4,o=i(e);return a=65535,{chars1:o,chars2:i(t),lineArray:n}},n.prototype.diff_charsToLines_=function(e,t){for(var n=0;n<e.length;n++){for(var r=e[n][1],i=[],a=0;a<r.length;a++)i[a]=t[r.charCodeAt(a)];e[n][1]=i.join(``)}},n.prototype.diff_commonPrefix=function(e,t){if(!e||!t||e.charAt(0)!=t.charAt(0))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,a=0;n<i;)e.substring(a,i)==t.substring(a,i)?(n=i,a=n):r=i,i=Math.floor((r-n)/2+n);return i},n.prototype.diff_commonSuffix=function(e,t){if(!e||!t||e.charAt(e.length-1)!=t.charAt(t.length-1))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,a=0;n<i;)e.substring(e.length-i,e.length-a)==t.substring(t.length-i,t.length-a)?(n=i,a=n):r=i,i=Math.floor((r-n)/2+n);return i},n.prototype.diff_commonOverlap_=function(e,t){var n=e.length,r=t.length;if(n==0||r==0)return 0;n>r?e=e.substring(n-r):n<r&&(t=t.substring(0,n));var i=Math.min(n,r);if(e==t)return i;for(var a=0,o=1;;){var s=e.substring(i-o),c=t.indexOf(s);if(c==-1)return a;o+=c,(c==0||e.substring(i-o)==t.substring(0,o))&&(a=o,o++)}},n.prototype.diff_halfMatch_=function(e,t){if(this.Diff_Timeout<=0)return null;var n=e.length>t.length?e:t,r=e.length>t.length?t:e;if(n.length<4||r.length*2<n.length)return null;var i=this;function a(e,t,n){for(var r=e.substring(n,n+Math.floor(e.length/4)),a=-1,o=``,s,c,l,u;(a=t.indexOf(r,a+1))!=-1;){var d=i.diff_commonPrefix(e.substring(n),t.substring(a)),f=i.diff_commonSuffix(e.substring(0,n),t.substring(0,a));o.length<f+d&&(o=t.substring(a-f,a)+t.substring(a,a+d),s=e.substring(0,n-f),c=e.substring(n+d),l=t.substring(0,a-f),u=t.substring(a+d))}return o.length*2>=e.length?[s,c,l,u,o]:null}var o=a(n,r,Math.ceil(n.length/4)),s=a(n,r,Math.ceil(n.length/2)),c;if(!o&&!s)return null;c=s?o&&o[4].length>s[4].length?o:s:o;var l,u,d,f;e.length>t.length?(l=c[0],u=c[1],d=c[2],f=c[3]):(d=c[0],f=c[1],l=c[2],u=c[3]);var p=c[4];return[l,u,d,f,p]},n.prototype.diff_cleanupSemantic=function(e){for(var t=!1,o=[],s=0,c=null,l=0,u=0,d=0,f=0,p=0;l<e.length;)e[l][0]==a?(o[s++]=l,u=f,d=p,f=0,p=0,c=e[l][1]):(e[l][0]==i?f+=e[l][1].length:p+=e[l][1].length,c&&c.length<=Math.max(u,d)&&c.length<=Math.max(f,p)&&(e.splice(o[s-1],0,new n.Diff(r,c)),e[o[s-1]+1][0]=i,s--,s--,l=s>0?o[s-1]:-1,u=0,d=0,f=0,p=0,c=null,t=!0)),l++;for(t&&this.diff_cleanupMerge(e),this.diff_cleanupSemanticLossless(e),l=1;l<e.length;){if(e[l-1][0]==r&&e[l][0]==i){var m=e[l-1][1],h=e[l][1],g=this.diff_commonOverlap_(m,h),_=this.diff_commonOverlap_(h,m);g>=_?(g>=m.length/2||g>=h.length/2)&&(e.splice(l,0,new n.Diff(a,h.substring(0,g))),e[l-1][1]=m.substring(0,m.length-g),e[l+1][1]=h.substring(g),l++):(_>=m.length/2||_>=h.length/2)&&(e.splice(l,0,new n.Diff(a,m.substring(0,_))),e[l-1][0]=i,e[l-1][1]=h.substring(0,h.length-_),e[l+1][0]=r,e[l+1][1]=m.substring(_),l++),l++}l++}},n.prototype.diff_cleanupSemanticLossless=function(e){function t(e,t){if(!e||!t)return 6;var r=e.charAt(e.length-1),i=t.charAt(0),a=r.match(n.nonAlphaNumericRegex_),o=i.match(n.nonAlphaNumericRegex_),s=a&&r.match(n.whitespaceRegex_),c=o&&i.match(n.whitespaceRegex_),l=s&&r.match(n.linebreakRegex_),u=c&&i.match(n.linebreakRegex_),d=l&&e.match(n.blanklineEndRegex_),f=u&&t.match(n.blanklineStartRegex_);return d||f?5:l||u?4:a&&!s&&c?3:s||c?2:a||o?1:0}for(var r=1;r<e.length-1;){if(e[r-1][0]==a&&e[r+1][0]==a){var i=e[r-1][1],o=e[r][1],s=e[r+1][1],c=this.diff_commonSuffix(i,o);if(c){var l=o.substring(o.length-c);i=i.substring(0,i.length-c),o=l+o.substring(0,o.length-c),s=l+s}for(var u=i,d=o,f=s,p=t(i,o)+t(o,s);o.charAt(0)===s.charAt(0);){i+=o.charAt(0),o=o.substring(1)+s.charAt(0),s=s.substring(1);var m=t(i,o)+t(o,s);m>=p&&(p=m,u=i,d=o,f=s)}e[r-1][1]!=u&&(u?e[r-1][1]=u:(e.splice(r-1,1),r--),e[r][1]=d,f?e[r+1][1]=f:(e.splice(r+1,1),r--))}r++}},n.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,n.whitespaceRegex_=/\s/,n.linebreakRegex_=/[\r\n]/,n.blanklineEndRegex_=/\n\r?\n$/,n.blanklineStartRegex_=/^\r?\n\r?\n/,n.prototype.diff_cleanupEfficiency=function(e){for(var t=!1,o=[],s=0,c=null,l=0,u=!1,d=!1,f=!1,p=!1;l<e.length;)e[l][0]==a?(e[l][1].length<this.Diff_EditCost&&(f||p)?(o[s++]=l,u=f,d=p,c=e[l][1]):(s=0,c=null),f=p=!1):(e[l][0]==r?p=!0:f=!0,c&&(u&&d&&f&&p||c.length<this.Diff_EditCost/2&&u+d+f+p==3)&&(e.splice(o[s-1],0,new n.Diff(r,c)),e[o[s-1]+1][0]=i,s--,c=null,u&&d?(f=p=!0,s=0):(s--,l=s>0?o[s-1]:-1,f=p=!1),t=!0)),l++;t&&this.diff_cleanupMerge(e)},n.prototype.diff_cleanupMerge=function(e){e.push(new n.Diff(a,``));for(var t=0,o=0,s=0,c=``,l=``,u;t<e.length;)switch(e[t][0]){case i:s++,l+=e[t][1],t++;break;case r:o++,c+=e[t][1],t++;break;case a:o+s>1?(o!==0&&s!==0&&(u=this.diff_commonPrefix(l,c),u!==0&&(t-o-s>0&&e[t-o-s-1][0]==a?e[t-o-s-1][1]+=l.substring(0,u):(e.splice(0,0,new n.Diff(a,l.substring(0,u))),t++),l=l.substring(u),c=c.substring(u)),u=this.diff_commonSuffix(l,c),u!==0&&(e[t][1]=l.substring(l.length-u)+e[t][1],l=l.substring(0,l.length-u),c=c.substring(0,c.length-u))),t-=o+s,e.splice(t,o+s),c.length&&(e.splice(t,0,new n.Diff(r,c)),t++),l.length&&(e.splice(t,0,new n.Diff(i,l)),t++),t++):t!==0&&e[t-1][0]==a?(e[t-1][1]+=e[t][1],e.splice(t,1)):t++,s=0,o=0,c=``,l=``;break}e[e.length-1][1]===``&&e.pop();var d=!1;for(t=1;t<e.length-1;)e[t-1][0]==a&&e[t+1][0]==a&&(e[t][1].substring(e[t][1].length-e[t-1][1].length)==e[t-1][1]?(e[t][1]=e[t-1][1]+e[t][1].substring(0,e[t][1].length-e[t-1][1].length),e[t+1][1]=e[t-1][1]+e[t+1][1],e.splice(t-1,1),d=!0):e[t][1].substring(0,e[t+1][1].length)==e[t+1][1]&&(e[t-1][1]+=e[t+1][1],e[t][1]=e[t][1].substring(e[t+1][1].length)+e[t+1][1],e.splice(t+1,1),d=!0)),t++;d&&this.diff_cleanupMerge(e)},n.prototype.diff_xIndex=function(e,t){var n=0,a=0,o=0,s=0,c;for(c=0;c<e.length&&(e[c][0]!==i&&(n+=e[c][1].length),e[c][0]!==r&&(a+=e[c][1].length),!(n>t));c++)o=n,s=a;return e.length!=c&&e[c][0]===r?s:s+(t-o)},n.prototype.diff_prettyHtml=function(e){for(var t=[],n=/&/g,o=/</g,s=/>/g,c=/\n/g,l=0;l<e.length;l++){var u=e[l][0],d=e[l][1].replace(n,`&amp;`).replace(o,`&lt;`).replace(s,`&gt;`).replace(c,`&para;<br>`);switch(u){case i:t[l]=`<ins style="background:#e6ffe6;">`+d+`</ins>`;break;case r:t[l]=`<del style="background:#ffe6e6;">`+d+`</del>`;break;case a:t[l]=`<span>`+d+`</span>`;break}}return t.join(``)},n.prototype.diff_text1=function(e){for(var t=[],n=0;n<e.length;n++)e[n][0]!==i&&(t[n]=e[n][1]);return t.join(``)},n.prototype.diff_text2=function(e){for(var t=[],n=0;n<e.length;n++)e[n][0]!==r&&(t[n]=e[n][1]);return t.join(``)},n.prototype.diff_levenshtein=function(e){for(var t=0,n=0,o=0,s=0;s<e.length;s++){var c=e[s][0],l=e[s][1];switch(c){case i:n+=l.length;break;case r:o+=l.length;break;case a:t+=Math.max(n,o),n=0,o=0;break}}return t+=Math.max(n,o),t},n.prototype.diff_toDelta=function(e){for(var t=[],n=0;n<e.length;n++)switch(e[n][0]){case i:t[n]=`+`+encodeURI(e[n][1]);break;case r:t[n]=`-`+e[n][1].length;break;case a:t[n]=`=`+e[n][1].length;break}return t.join(` `).replace(/%20/g,` `)},n.prototype.diff_fromDelta=function(e,t){for(var o=[],s=0,c=0,l=t.split(/\t/g),u=0;u<l.length;u++){var d=l[u].substring(1);switch(l[u].charAt(0)){case`+`:try{o[s++]=new n.Diff(i,decodeURI(d))}catch{throw Error(`Illegal escape in diff_fromDelta: `+d)}break;case`-`:case`=`:var f=parseInt(d,10);if(isNaN(f)||f<0)throw Error(`Invalid number in diff_fromDelta: `+d);var p=e.substring(c,c+=f);l[u].charAt(0)==`=`?o[s++]=new n.Diff(a,p):o[s++]=new n.Diff(r,p);break;default:if(l[u])throw Error(`Invalid diff operation in diff_fromDelta: `+l[u])}}if(c!=e.length)throw Error(`Delta length (`+c+`) does not equal source text length (`+e.length+`).`);return o},n.prototype.match_main=function(e,t,n){if(e==null||t==null||n==null)throw Error(`Null input. (match_main)`);return n=Math.max(0,Math.min(n,e.length)),e==t?0:e.length?e.substring(n,n+t.length)==t?n:this.match_bitap_(e,t,n):-1},n.prototype.match_bitap_=function(e,t,n){if(t.length>this.Match_MaxBits)throw Error(`Pattern too long for this browser.`);var r=this.match_alphabet_(t),i=this;function a(e,r){var a=e/t.length,o=Math.abs(n-r);return i.Match_Distance?a+o/i.Match_Distance:o?1:a}var o=this.Match_Threshold,s=e.indexOf(t,n);s!=-1&&(o=Math.min(a(0,s),o),s=e.lastIndexOf(t,n+t.length),s!=-1&&(o=Math.min(a(0,s),o)));var c=1<<t.length-1;s=-1;for(var l,u,d=t.length+e.length,f,p=0;p<t.length;p++){for(l=0,u=d;l<u;)a(p,n+u)<=o?l=u:d=u,u=Math.floor((d-l)/2+l);d=u;var m=Math.max(1,n-u+1),h=Math.min(n+u,e.length)+t.length,g=Array(h+2);g[h+1]=(1<<p)-1;for(var _=h;_>=m;_--){var v=r[e.charAt(_-1)];if(p===0?g[_]=(g[_+1]<<1|1)&v:g[_]=(g[_+1]<<1|1)&v|(f[_+1]|f[_])<<1|1|f[_+1],g[_]&c){var y=a(p,_-1);if(y<=o)if(o=y,s=_-1,s>n)m=Math.max(1,2*n-s);else break}}if(a(p+1,n)>o)break;f=g}return s},n.prototype.match_alphabet_=function(e){for(var t={},n=0;n<e.length;n++)t[e.charAt(n)]=0;for(var n=0;n<e.length;n++)t[e.charAt(n)]|=1<<e.length-n-1;return t},n.prototype.patch_addContext_=function(e,t){if(t.length!=0){if(e.start2===null)throw Error(`patch not initialized`);for(var r=t.substring(e.start2,e.start2+e.length1),i=0;t.indexOf(r)!=t.lastIndexOf(r)&&r.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)i+=this.Patch_Margin,r=t.substring(e.start2-i,e.start2+e.length1+i);i+=this.Patch_Margin;var o=t.substring(e.start2-i,e.start2);o&&e.diffs.unshift(new n.Diff(a,o));var s=t.substring(e.start2+e.length1,e.start2+e.length1+i);s&&e.diffs.push(new n.Diff(a,s)),e.start1-=o.length,e.start2-=o.length,e.length1+=o.length+s.length,e.length2+=o.length+s.length}},n.prototype.patch_make=function(e,t,o){var s,c;if(typeof e==`string`&&typeof t==`string`&&o===void 0)s=e,c=this.diff_main(s,t,!0),c.length>2&&(this.diff_cleanupSemantic(c),this.diff_cleanupEfficiency(c));else if(e&&typeof e==`object`&&t===void 0&&o===void 0)c=e,s=this.diff_text1(c);else if(typeof e==`string`&&t&&typeof t==`object`&&o===void 0)s=e,c=t;else if(typeof e==`string`&&typeof t==`string`&&o&&typeof o==`object`)s=e,c=o;else throw Error(`Unknown call format to patch_make.`);if(c.length===0)return[];for(var l=[],u=new n.patch_obj,d=0,f=0,p=0,m=s,h=s,g=0;g<c.length;g++){var _=c[g][0],v=c[g][1];switch(!d&&_!==a&&(u.start1=f,u.start2=p),_){case i:u.diffs[d++]=c[g],u.length2+=v.length,h=h.substring(0,p)+v+h.substring(p);break;case r:u.length1+=v.length,u.diffs[d++]=c[g],h=h.substring(0,p)+h.substring(p+v.length);break;case a:v.length<=2*this.Patch_Margin&&d&&c.length!=g+1?(u.diffs[d++]=c[g],u.length1+=v.length,u.length2+=v.length):v.length>=2*this.Patch_Margin&&d&&(this.patch_addContext_(u,m),l.push(u),u=new n.patch_obj,d=0,m=h,f=p);break}_!==i&&(f+=v.length),_!==r&&(p+=v.length)}return d&&(this.patch_addContext_(u,m),l.push(u)),l},n.prototype.patch_deepCopy=function(e){for(var t=[],r=0;r<e.length;r++){var i=e[r],a=new n.patch_obj;a.diffs=[];for(var o=0;o<i.diffs.length;o++)a.diffs[o]=new n.Diff(i.diffs[o][0],i.diffs[o][1]);a.start1=i.start1,a.start2=i.start2,a.length1=i.length1,a.length2=i.length2,t[r]=a}return t},n.prototype.patch_apply=function(e,t){if(e.length==0)return[t,[]];e=this.patch_deepCopy(e);var n=this.patch_addPadding(e);t=n+t+n,this.patch_splitMax(e);for(var o=0,s=[],c=0;c<e.length;c++){var l=e[c].start2+o,u=this.diff_text1(e[c].diffs),d,f=-1;if(u.length>this.Match_MaxBits?(d=this.match_main(t,u.substring(0,this.Match_MaxBits),l),d!=-1&&(f=this.match_main(t,u.substring(u.length-this.Match_MaxBits),l+u.length-this.Match_MaxBits),(f==-1||d>=f)&&(d=-1))):d=this.match_main(t,u,l),d==-1)s[c]=!1,o-=e[c].length2-e[c].length1;else{s[c]=!0,o=d-l;var p=f==-1?t.substring(d,d+u.length):t.substring(d,f+this.Match_MaxBits);if(u==p)t=t.substring(0,d)+this.diff_text2(e[c].diffs)+t.substring(d+u.length);else{var m=this.diff_main(u,p,!1);if(u.length>this.Match_MaxBits&&this.diff_levenshtein(m)/u.length>this.Patch_DeleteThreshold)s[c]=!1;else{this.diff_cleanupSemanticLossless(m);for(var h=0,g,_=0;_<e[c].diffs.length;_++){var v=e[c].diffs[_];v[0]!==a&&(g=this.diff_xIndex(m,h)),v[0]===i?t=t.substring(0,d+g)+v[1]+t.substring(d+g):v[0]===r&&(t=t.substring(0,d+g)+t.substring(d+this.diff_xIndex(m,h+v[1].length))),v[0]!==r&&(h+=v[1].length)}}}}}return t=t.substring(n.length,t.length-n.length),[t,s]},n.prototype.patch_addPadding=function(e){for(var t=this.Patch_Margin,r=``,i=1;i<=t;i++)r+=String.fromCharCode(i);for(var i=0;i<e.length;i++)e[i].start1+=t,e[i].start2+=t;var o=e[0],s=o.diffs;if(s.length==0||s[0][0]!=a)s.unshift(new n.Diff(a,r)),o.start1-=t,o.start2-=t,o.length1+=t,o.length2+=t;else if(t>s[0][1].length){var c=t-s[0][1].length;s[0][1]=r.substring(s[0][1].length)+s[0][1],o.start1-=c,o.start2-=c,o.length1+=c,o.length2+=c}if(o=e[e.length-1],s=o.diffs,s.length==0||s[s.length-1][0]!=a)s.push(new n.Diff(a,r)),o.length1+=t,o.length2+=t;else if(t>s[s.length-1][1].length){var c=t-s[s.length-1][1].length;s[s.length-1][1]+=r.substring(0,c),o.length1+=c,o.length2+=c}return r},n.prototype.patch_splitMax=function(e){for(var t=this.Match_MaxBits,o=0;o<e.length;o++)if(!(e[o].length1<=t)){var s=e[o];e.splice(o--,1);for(var c=s.start1,l=s.start2,u=``;s.diffs.length!==0;){var d=new n.patch_obj,f=!0;for(d.start1=c-u.length,d.start2=l-u.length,u!==``&&(d.length1=d.length2=u.length,d.diffs.push(new n.Diff(a,u)));s.diffs.length!==0&&d.length1<t-this.Patch_Margin;){var p=s.diffs[0][0],m=s.diffs[0][1];p===i?(d.length2+=m.length,l+=m.length,d.diffs.push(s.diffs.shift()),f=!1):p===r&&d.diffs.length==1&&d.diffs[0][0]==a&&m.length>2*t?(d.length1+=m.length,c+=m.length,f=!1,d.diffs.push(new n.Diff(p,m)),s.diffs.shift()):(m=m.substring(0,t-d.length1-this.Patch_Margin),d.length1+=m.length,c+=m.length,p===a?(d.length2+=m.length,l+=m.length):f=!1,d.diffs.push(new n.Diff(p,m)),m==s.diffs[0][1]?s.diffs.shift():s.diffs[0][1]=s.diffs[0][1].substring(m.length))}u=this.diff_text2(d.diffs),u=u.substring(u.length-this.Patch_Margin);var h=this.diff_text1(s.diffs).substring(0,this.Patch_Margin);h!==``&&(d.length1+=h.length,d.length2+=h.length,d.diffs.length!==0&&d.diffs[d.diffs.length-1][0]===a?d.diffs[d.diffs.length-1][1]+=h:d.diffs.push(new n.Diff(a,h))),f||e.splice(++o,0,d)}}},n.prototype.patch_toText=function(e){for(var t=[],n=0;n<e.length;n++)t[n]=e[n];return t.join(``)},n.prototype.patch_fromText=function(e){var t=[];if(!e)return t;for(var o=e.split(`
391
391
  `),s=0,c=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;s<o.length;){var l=o[s].match(c);if(!l)throw Error(`Invalid patch string: `+o[s]);var u=new n.patch_obj;for(t.push(u),u.start1=parseInt(l[1],10),l[2]===``?(u.start1--,u.length1=1):l[2]==`0`?u.length1=0:(u.start1--,u.length1=parseInt(l[2],10)),u.start2=parseInt(l[3],10),l[4]===``?(u.start2--,u.length2=1):l[4]==`0`?u.length2=0:(u.start2--,u.length2=parseInt(l[4],10)),s++;s<o.length;){var d=o[s].charAt(0);try{var f=decodeURI(o[s].substring(1))}catch{throw Error(`Illegal escape in patch_fromText: `+f)}if(d==`-`)u.diffs.push(new n.Diff(r,f));else if(d==`+`)u.diffs.push(new n.Diff(i,f));else if(d==` `)u.diffs.push(new n.Diff(a,f));else if(d==`@`)break;else if(d!==``)throw Error(`Invalid patch mode "`+d+`" in: `+f);s++}}return t},n.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0},n.patch_obj.prototype.toString=function(){for(var e=this.length1===0?this.start1+`,0`:this.length1==1?this.start1+1:this.start1+1+`,`+this.length1,t=this.length2===0?this.start2+`,0`:this.length2==1?this.start2+1:this.start2+1+`,`+this.length2,n=[`@@ -`+e+` +`+t+` @@
392
392
  `],o,s=0;s<this.diffs.length;s++){switch(this.diffs[s][0]){case i:o=`+`;break;case r:o=`-`;break;case a:o=` `;break}n[s+1]=o+encodeURI(this.diffs[s][1])+`
393
- `}return n.join(``).replace(/%20/g,` `)},t.exports=n,t.exports.diff_match_patch=n,t.exports.DIFF_DELETE=r,t.exports.DIFF_INSERT=i,t.exports.DIFF_EQUAL=a})),UG={arabic:`ar`,armenian:`am`,bulgarian:`bg`,czech:`cz`,danish:`dk`,dutch:`nl`,english:`en`,finnish:`fi`,french:`fr`,german:`de`,greek:`gr`,hungarian:`hu`,indian:`in`,indonesian:`id`,irish:`ie`,italian:`it`,lithuanian:`lt`,nepali:`np`,norwegian:`no`,portuguese:`pt`,romanian:`ro`,russian:`ru`,serbian:`rs`,slovenian:`ru`,spanish:`es`,swedish:`se`,tamil:`ta`,turkish:`tr`,ukrainian:`uk`,sanskrit:`sk`},WG={dutch:/[^A-Za-zàèéìòóù0-9_'-]+/gim,english:/[^A-Za-zàèéìòóù0-9_'-]+/gim,french:/[^a-z0-9äâàéèëêïîöôùüûœç-]+/gim,italian:/[^A-Za-zàèéìòóù0-9_'-]+/gim,norwegian:/[^a-z0-9_æøåÆØÅäÄöÖüÜ]+/gim,portuguese:/[^a-z0-9à-úÀ-Ú]/gim,russian:/[^a-z0-9а-яА-ЯёЁ]+/gim,spanish:/[^a-z0-9A-Zá-úÁ-ÚñÑüÜ]+/gim,swedish:/[^a-z0-9_åÅäÄöÖüÜ-]+/gim,german:/[^a-z0-9A-ZäöüÄÖÜß]+/gim,finnish:/[^a-z0-9äöÄÖ]+/gim,danish:/[^a-z0-9æøåÆØÅ]+/gim,hungarian:/[^a-z0-9áéíóöőúüűÁÉÍÓÖŐÚÜŰ]+/gim,romanian:/[^a-z0-9ăâîșțĂÂÎȘȚ]+/gim,serbian:/[^a-z0-9čćžšđČĆŽŠĐ]+/gim,turkish:/[^a-z0-9çÇğĞıİöÖşŞüÜ]+/gim,lithuanian:/[^a-z0-9ąčęėįšųūžĄČĘĖĮŠŲŪŽ]+/gim,arabic:/[^a-z0-9أ-ي]+/gim,nepali:/[^a-z0-9अ-ह]+/gim,irish:/[^a-z0-9áéíóúÁÉÍÓÚ]+/gim,indian:/[^a-z0-9अ-ह]+/gim,armenian:/[^a-z0-9ա-ֆ]+/gim,greek:/[^a-z0-9α-ωά-ώ]+/gim,indonesian:/[^a-z0-9]+/gim,ukrainian:/[^a-z0-9а-яА-ЯіїєІЇЄ]+/gim,slovenian:/[^a-z0-9螚ȎŠ]+/gim,bulgarian:/[^a-z0-9а-яА-Я]+/gim,tamil:/[^a-z0-9அ-ஹ]+/gim,sanskrit:/[^a-z0-9A-Zāīūṛḷṃṁḥśṣṭḍṇṅñḻḹṝ]+/gim,czech:/[^A-Z0-9a-zěščřžýáíéúůóťďĚŠČŘŽÝÁÍÉÓÚŮŤĎ-]+/gim},GG=Object.keys(UG);function KG(e){return e!==void 0&&GG.includes(e)?UG[e]:void 0}var qG=Date.now().toString().slice(5),JG=0,YG=BigInt(1e3),XG=BigInt(1e6),ZG=BigInt(1e9),QG=65535;function $G(e,t){if(t.length<65535)Array.prototype.push.apply(e,t);else{let n=t.length;for(let r=0;r<n;r+=QG)Array.prototype.push.apply(e,t.slice(r,r+QG))}}function eK(e,...t){return e.replace(/%(?:(?<position>\d+)\$)?(?<width>-?\d*\.?\d*)(?<type>[dfs])/g,function(...e){let{width:n,type:r,position:i}=e[e.length-1],a=i?t[Number.parseInt(i)-1]:t.shift(),o=n===``?0:Number.parseInt(n);switch(r){case`d`:return a.toString().padStart(o,`0`);case`f`:{let e=a,[t,r]=n.split(`.`).map(e=>Number.parseFloat(e));return typeof r==`number`&&r>=0&&(e=e.toFixed(r)),typeof t==`number`&&t>=0?e.toString().padStart(o,`0`):e.toString()}case`s`:return o<0?a.toString().padEnd(-o,` `):a.toString().padStart(o,` `);default:return a}})}function tK(){return typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope}function nK(){return typeof process<`u`&&process.release&&process.release.name===`node`}function rK(){return BigInt(Math.floor(performance.now()*1e6))}function iK(e){return typeof e==`number`&&(e=BigInt(e)),e<YG?`${e}ns`:e<XG?`${e/YG}μs`:e<ZG?`${e/XG}ms`:`${e/ZG}s`}function aK(){return tK()?rK():nK()||typeof process<`u`&&typeof process?.hrtime?.bigint==`function`?process.hrtime.bigint():typeof performance<`u`?rK():BigInt(0)}function oK(){return`${qG}-${JG++}`}function sK(e,t){return Object.hasOwn===void 0?Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0:Object.hasOwn(e,t)?e[t]:void 0}function cK(e,t){return t[1]===e[1]?e[0]-t[0]:t[1]-e[1]}function lK(e){if(e.length===0)return[];if(e.length===1)return e[0];for(let t=1;t<e.length;t++)if(e[t].length<e[0].length){let n=e[0];e[0]=e[t],e[t]=n}let t=new Map;for(let n of e[0])t.set(n,1);for(let n=1;n<e.length;n++){let r=0;for(let i of e[n]){let e=t.get(i);e===n&&(t.set(i,e+1),r++)}if(r===0)return[]}return e[0].filter(n=>{let r=t.get(n);return r!==void 0&&t.set(n,0),r===e.length})}function uK(e,t){let n={},r=t.length;for(let i=0;i<r;i++){let r=t[i],a=r.split(`.`),o=e,s=a.length;for(let e=0;e<s;e++)if(o=o[a[e]],typeof o==`object`){if(o!==null&&`lat`in o&&`lon`in o&&typeof o.lat==`number`&&typeof o.lon==`number`){o=n[r]=o;break}else if(!Array.isArray(o)&&o!==null&&e===s-1){o=void 0;break}}else if((typeof o!=`object`||!o)&&e<s-1){o=void 0;break}o!==void 0&&(n[r]=o)}return n}function dK(e,t){return uK(e,[t])[t]}var fK={cm:.01,m:1,km:1e3,ft:.3048,yd:.9144,mi:1609.344};function pK(e,t){let n=fK[t];if(n===void 0)throw Error(CK(`INVALID_DISTANCE_SUFFIX`,e).message);return e*n}function mK(e,t){e.hits=e.hits.map(e=>({...e,document:{...e.document,...t.reduce((e,t)=>{let n=t.split(`.`),r=n.pop(),i=e;for(let e of n)i[e]=i[e]??{},i=i[e];return i[r]=null,e},e.document)}}))}function hK(e){return Array.isArray(e)?e.some(e=>hK(e)):e?.constructor?.name===`AsyncFunction`}var gK=`intersection`in new Set;function _K(...e){if(e.length===0)return new Set;if(e.length===1)return e[0];if(e.length===2){let t=e[0],n=e[1];if(gK)return t.intersection(n);let r=new Set,i=t.size<n.size?t:n,a=i===t?n:t;for(let e of i)a.has(e)&&r.add(e);return r}let t={index:0,size:e[0].size};for(let n=1;n<e.length;n++)e[n].size<t.size&&(t.index=n,t.size=e[n].size);if(gK){let n=e[t.index];for(let r=0;r<e.length;r++)r!==t.index&&(n=n.intersection(e[r]));return n}let n=e[t.index];for(let r=0;r<e.length;r++){if(r===t.index)continue;let i=e[r];for(let e of n)i.has(e)||n.delete(e)}return n}var vK=`union`in new Set;function yK(e,t){return vK?e?e.union(t):t:e?new Set([...e,...t]):new Set(t)}function bK(e,t){let n=new Set;for(let r of e)t.has(r)||n.add(r);return n}function xK(e){if(typeof SharedArrayBuffer<`u`&&typeof Atomics<`u`){let t=new Int32Array(new SharedArrayBuffer(4));if(!(e>0&&e<1/0))throw typeof e!=`number`&&typeof e!=`bigint`?TypeError(`sleep: ms must be a number`):RangeError(`sleep: ms must be a number that is greater than 0 but less than Infinity`);Atomics.wait(t,0,0,Number(e))}else{if(!(e>0&&e<1/0))throw typeof e!=`number`&&typeof e!=`bigint`?TypeError(`sleep: ms must be a number`):RangeError(`sleep: ms must be a number that is greater than 0 but less than Infinity`);let t=Date.now()+Number(e);for(;t>Date.now(););}}var SK={NO_LANGUAGE_WITH_CUSTOM_TOKENIZER:`Do not pass the language option to create when using a custom tokenizer.`,LANGUAGE_NOT_SUPPORTED:`Language "%s" is not supported.\nSupported languages are:\n - ${GG.join(`
393
+ `}return n.join(``).replace(/%20/g,` `)},t.exports=n,t.exports.diff_match_patch=n,t.exports.DIFF_DELETE=r,t.exports.DIFF_INSERT=i,t.exports.DIFF_EQUAL=a})),HG={arabic:`ar`,armenian:`am`,bulgarian:`bg`,czech:`cz`,danish:`dk`,dutch:`nl`,english:`en`,finnish:`fi`,french:`fr`,german:`de`,greek:`gr`,hungarian:`hu`,indian:`in`,indonesian:`id`,irish:`ie`,italian:`it`,lithuanian:`lt`,nepali:`np`,norwegian:`no`,portuguese:`pt`,romanian:`ro`,russian:`ru`,serbian:`rs`,slovenian:`ru`,spanish:`es`,swedish:`se`,tamil:`ta`,turkish:`tr`,ukrainian:`uk`,sanskrit:`sk`},UG={dutch:/[^A-Za-zàèéìòóù0-9_'-]+/gim,english:/[^A-Za-zàèéìòóù0-9_'-]+/gim,french:/[^a-z0-9äâàéèëêïîöôùüûœç-]+/gim,italian:/[^A-Za-zàèéìòóù0-9_'-]+/gim,norwegian:/[^a-z0-9_æøåÆØÅäÄöÖüÜ]+/gim,portuguese:/[^a-z0-9à-úÀ-Ú]/gim,russian:/[^a-z0-9а-яА-ЯёЁ]+/gim,spanish:/[^a-z0-9A-Zá-úÁ-ÚñÑüÜ]+/gim,swedish:/[^a-z0-9_åÅäÄöÖüÜ-]+/gim,german:/[^a-z0-9A-ZäöüÄÖÜß]+/gim,finnish:/[^a-z0-9äöÄÖ]+/gim,danish:/[^a-z0-9æøåÆØÅ]+/gim,hungarian:/[^a-z0-9áéíóöőúüűÁÉÍÓÖŐÚÜŰ]+/gim,romanian:/[^a-z0-9ăâîșțĂÂÎȘȚ]+/gim,serbian:/[^a-z0-9čćžšđČĆŽŠĐ]+/gim,turkish:/[^a-z0-9çÇğĞıİöÖşŞüÜ]+/gim,lithuanian:/[^a-z0-9ąčęėįšųūžĄČĘĖĮŠŲŪŽ]+/gim,arabic:/[^a-z0-9أ-ي]+/gim,nepali:/[^a-z0-9अ-ह]+/gim,irish:/[^a-z0-9áéíóúÁÉÍÓÚ]+/gim,indian:/[^a-z0-9अ-ह]+/gim,armenian:/[^a-z0-9ա-ֆ]+/gim,greek:/[^a-z0-9α-ωά-ώ]+/gim,indonesian:/[^a-z0-9]+/gim,ukrainian:/[^a-z0-9а-яА-ЯіїєІЇЄ]+/gim,slovenian:/[^a-z0-9螚ȎŠ]+/gim,bulgarian:/[^a-z0-9а-яА-Я]+/gim,tamil:/[^a-z0-9அ-ஹ]+/gim,sanskrit:/[^a-z0-9A-Zāīūṛḷṃṁḥśṣṭḍṇṅñḻḹṝ]+/gim,czech:/[^A-Z0-9a-zěščřžýáíéúůóťďĚŠČŘŽÝÁÍÉÓÚŮŤĎ-]+/gim},WG=Object.keys(HG);function GG(e){return e!==void 0&&WG.includes(e)?HG[e]:void 0}var KG=Date.now().toString().slice(5),qG=0,JG=BigInt(1e3),YG=BigInt(1e6),XG=BigInt(1e9),ZG=65535;function QG(e,t){if(t.length<65535)Array.prototype.push.apply(e,t);else{let n=t.length;for(let r=0;r<n;r+=ZG)Array.prototype.push.apply(e,t.slice(r,r+ZG))}}function $G(e,...t){return e.replace(/%(?:(?<position>\d+)\$)?(?<width>-?\d*\.?\d*)(?<type>[dfs])/g,function(...e){let{width:n,type:r,position:i}=e[e.length-1],a=i?t[Number.parseInt(i)-1]:t.shift(),o=n===``?0:Number.parseInt(n);switch(r){case`d`:return a.toString().padStart(o,`0`);case`f`:{let e=a,[t,r]=n.split(`.`).map(e=>Number.parseFloat(e));return typeof r==`number`&&r>=0&&(e=e.toFixed(r)),typeof t==`number`&&t>=0?e.toString().padStart(o,`0`):e.toString()}case`s`:return o<0?a.toString().padEnd(-o,` `):a.toString().padStart(o,` `);default:return a}})}function eK(){return typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope}function tK(){return typeof process<`u`&&process.release&&process.release.name===`node`}function nK(){return BigInt(Math.floor(performance.now()*1e6))}function rK(e){return typeof e==`number`&&(e=BigInt(e)),e<JG?`${e}ns`:e<YG?`${e/JG}μs`:e<XG?`${e/YG}ms`:`${e/XG}s`}function iK(){return eK()?nK():tK()||typeof process<`u`&&typeof process?.hrtime?.bigint==`function`?process.hrtime.bigint():typeof performance<`u`?nK():BigInt(0)}function aK(){return`${KG}-${qG++}`}function oK(e,t){return Object.hasOwn===void 0?Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0:Object.hasOwn(e,t)?e[t]:void 0}function sK(e,t){return t[1]===e[1]?e[0]-t[0]:t[1]-e[1]}function cK(e){if(e.length===0)return[];if(e.length===1)return e[0];for(let t=1;t<e.length;t++)if(e[t].length<e[0].length){let n=e[0];e[0]=e[t],e[t]=n}let t=new Map;for(let n of e[0])t.set(n,1);for(let n=1;n<e.length;n++){let r=0;for(let i of e[n]){let e=t.get(i);e===n&&(t.set(i,e+1),r++)}if(r===0)return[]}return e[0].filter(n=>{let r=t.get(n);return r!==void 0&&t.set(n,0),r===e.length})}function lK(e,t){let n={},r=t.length;for(let i=0;i<r;i++){let r=t[i],a=r.split(`.`),o=e,s=a.length;for(let e=0;e<s;e++)if(o=o[a[e]],typeof o==`object`){if(o!==null&&`lat`in o&&`lon`in o&&typeof o.lat==`number`&&typeof o.lon==`number`){o=n[r]=o;break}else if(!Array.isArray(o)&&o!==null&&e===s-1){o=void 0;break}}else if((typeof o!=`object`||!o)&&e<s-1){o=void 0;break}o!==void 0&&(n[r]=o)}return n}function uK(e,t){return lK(e,[t])[t]}var dK={cm:.01,m:1,km:1e3,ft:.3048,yd:.9144,mi:1609.344};function fK(e,t){let n=dK[t];if(n===void 0)throw Error(SK(`INVALID_DISTANCE_SUFFIX`,e).message);return e*n}function pK(e,t){e.hits=e.hits.map(e=>({...e,document:{...e.document,...t.reduce((e,t)=>{let n=t.split(`.`),r=n.pop(),i=e;for(let e of n)i[e]=i[e]??{},i=i[e];return i[r]=null,e},e.document)}}))}function mK(e){return Array.isArray(e)?e.some(e=>mK(e)):e?.constructor?.name===`AsyncFunction`}var hK=`intersection`in new Set;function gK(...e){if(e.length===0)return new Set;if(e.length===1)return e[0];if(e.length===2){let t=e[0],n=e[1];if(hK)return t.intersection(n);let r=new Set,i=t.size<n.size?t:n,a=i===t?n:t;for(let e of i)a.has(e)&&r.add(e);return r}let t={index:0,size:e[0].size};for(let n=1;n<e.length;n++)e[n].size<t.size&&(t.index=n,t.size=e[n].size);if(hK){let n=e[t.index];for(let r=0;r<e.length;r++)r!==t.index&&(n=n.intersection(e[r]));return n}let n=e[t.index];for(let r=0;r<e.length;r++){if(r===t.index)continue;let i=e[r];for(let e of n)i.has(e)||n.delete(e)}return n}var _K=`union`in new Set;function vK(e,t){return _K?e?e.union(t):t:e?new Set([...e,...t]):new Set(t)}function yK(e,t){let n=new Set;for(let r of e)t.has(r)||n.add(r);return n}function bK(e){if(typeof SharedArrayBuffer<`u`&&typeof Atomics<`u`){let t=new Int32Array(new SharedArrayBuffer(4));if(!(e>0&&e<1/0))throw typeof e!=`number`&&typeof e!=`bigint`?TypeError(`sleep: ms must be a number`):RangeError(`sleep: ms must be a number that is greater than 0 but less than Infinity`);Atomics.wait(t,0,0,Number(e))}else{if(!(e>0&&e<1/0))throw typeof e!=`number`&&typeof e!=`bigint`?TypeError(`sleep: ms must be a number`):RangeError(`sleep: ms must be a number that is greater than 0 but less than Infinity`);let t=Date.now()+Number(e);for(;t>Date.now(););}}var xK={NO_LANGUAGE_WITH_CUSTOM_TOKENIZER:`Do not pass the language option to create when using a custom tokenizer.`,LANGUAGE_NOT_SUPPORTED:`Language "%s" is not supported.\nSupported languages are:\n - ${WG.join(`
394
394
  - `)}`,INVALID_STEMMER_FUNCTION_TYPE:`config.stemmer property must be a function.`,MISSING_STEMMER:`As of version 1.0.0 @orama/orama does not ship non English stemmers by default. To solve this, please explicitly import and specify the "%s" stemmer from the package @orama/stemmers. See https://docs.orama.com/docs/orama-js/text-analysis/stemming for more information.`,CUSTOM_STOP_WORDS_MUST_BE_FUNCTION_OR_ARRAY:`Custom stop words array must only contain strings.`,UNSUPPORTED_COMPONENT:`Unsupported component "%s".`,COMPONENT_MUST_BE_FUNCTION:`The component "%s" must be a function.`,COMPONENT_MUST_BE_FUNCTION_OR_ARRAY_FUNCTIONS:`The component "%s" must be a function or an array of functions.`,INVALID_SCHEMA_TYPE:`Unsupported schema type "%s" at "%s". Expected "string", "boolean" or "number" or array of them.`,DOCUMENT_ID_MUST_BE_STRING:`Document id must be of type "string". Got "%s" instead.`,DOCUMENT_ALREADY_EXISTS:`A document with id "%s" already exists.`,DOCUMENT_DOES_NOT_EXIST:`A document with id "%s" does not exists.`,MISSING_DOCUMENT_PROPERTY:`Missing searchable property "%s".`,INVALID_DOCUMENT_PROPERTY:`Invalid document property "%s": expected "%s", got "%s"`,UNKNOWN_INDEX:`Invalid property name "%s". Expected a wildcard string ("*") or array containing one of the following properties: %s`,INVALID_BOOST_VALUE:`Boost value must be a number greater than, or less than 0.`,INVALID_FILTER_OPERATION:`You can only use one operation per filter, you requested %d.`,SCHEMA_VALIDATION_FAILURE:`Cannot insert document due schema validation failure on "%s" property.`,INVALID_SORT_SCHEMA_TYPE:`Unsupported sort schema type "%s" at "%s". Expected "string" or "number".`,CANNOT_SORT_BY_ARRAY:`Cannot configure sort for "%s" because it is an array (%s).`,UNABLE_TO_SORT_ON_UNKNOWN_FIELD:`Unable to sort on unknown field "%s". Allowed fields: %s`,SORT_DISABLED:`Sort is disabled. Please read the documentation at https://docs.orama.com/docs/orama-js for more information.`,UNKNOWN_GROUP_BY_PROPERTY:`Unknown groupBy property "%s".`,INVALID_GROUP_BY_PROPERTY:`Invalid groupBy property "%s". Allowed types: "%s", but given "%s".`,UNKNOWN_FILTER_PROPERTY:`Unknown filter property "%s".`,UNKNOWN_VECTOR_PROPERTY:`Unknown vector property "%s". Make sure the property exists in the schema and is configured as a vector.`,INVALID_VECTOR_SIZE:`Vector size must be a number greater than 0. Got "%s" instead.`,INVALID_VECTOR_VALUE:`Vector value must be a number greater than 0. Got "%s" instead.`,INVALID_INPUT_VECTOR:`Property "%s" was declared as a %s-dimensional vector, but got a %s-dimensional vector instead.
395
395
  Input vectors must be of the size declared in the schema, as calculating similarity between vectors of different sizes can lead to unexpected results.`,WRONG_SEARCH_PROPERTY_TYPE:`Property "%s" is not searchable. Only "string" properties are searchable.`,FACET_NOT_SUPPORTED:`Facet doens't support the type "%s".`,INVALID_DISTANCE_SUFFIX:`Invalid distance suffix "%s". Valid suffixes are: cm, m, km, mi, yd, ft.`,INVALID_SEARCH_MODE:`Invalid search mode "%s". Valid modes are: "fulltext", "vector", "hybrid".`,MISSING_VECTOR_AND_SECURE_PROXY:`No vector was provided and no secure proxy was configured. Please provide a vector or configure an Orama Secure Proxy to perform hybrid search.`,MISSING_TERM:`"term" is a required parameter when performing hybrid search. Please provide a search term.`,INVALID_VECTOR_INPUT:`Invalid "vector" property. Expected an object with "value" and "property" properties, but got "%s" instead.`,PLUGIN_CRASHED:`A plugin crashed during initialization. Please check the error message for more information:`,PLUGIN_SECURE_PROXY_NOT_FOUND:`Could not find '@orama/secure-proxy-plugin' installed in your Orama instance.
396
396
  Please install it before proceeding with creating an answer session.
@@ -398,9 +398,9 @@ Read more at https://docs.orama.com/docs/orama-js/plugins/plugin-secure-proxy#pl
398
398
  `,PLUGIN_SECURE_PROXY_MISSING_CHAT_MODEL:`Could not find a chat model defined in the secure proxy plugin configuration.
399
399
  Please provide a chat model before proceeding with creating an answer session.
400
400
  Read more at https://docs.orama.com/docs/orama-js/plugins/plugin-secure-proxy#plugin-secure-proxy
401
- `,ANSWER_SESSION_LAST_MESSAGE_IS_NOT_ASSISTANT:`The last message in the session is not an assistant message. Cannot regenerate non-assistant messages.`,PLUGIN_COMPONENT_CONFLICT:`The component "%s" is already defined. The plugin "%s" is trying to redefine it.`};function CK(e,...t){let n=Error(eK(SK[e]??`Unsupported Orama Error code: ${e}`,...t));return n.code=e,`captureStackTrace`in Error.prototype&&Error.captureStackTrace(n),n}function wK(e){return{raw:Number(e),formatted:iK(e)}}function TK(e){if(e.id){if(typeof e.id!=`string`)throw CK(`DOCUMENT_ID_MUST_BE_STRING`,typeof e.id);return e.id}return oK()}function EK(e,t){for(let[n,r]of Object.entries(t)){let t=e[n];if(t!==void 0&&!(r===`geopoint`&&typeof t==`object`&&typeof t.lon==`number`&&typeof t.lat==`number`)&&!(r===`enum`&&(typeof t==`string`||typeof t==`number`))){if(r===`enum[]`&&Array.isArray(t)){let e=t.length;for(let r=0;r<e;r++)if(typeof t[r]!=`string`&&typeof t[r]!=`number`)return n+`.`+r;continue}if(AK(r)){let e=NK(r);if(!Array.isArray(t)||t.length!==e)throw CK(`INVALID_INPUT_VECTOR`,n,e,t.length);continue}if(jK(r)){if(!Array.isArray(t))return n;let e=MK(r),i=t.length;for(let r=0;r<i;r++)if(typeof t[r]!==e)return n+`.`+r;continue}if(typeof r==`object`){if(!t||typeof t!=`object`)return n;let e=EK(t,r);if(e)return n+`.`+e;continue}if(typeof t!==r)return n}}}var DK={string:!1,number:!1,boolean:!1,enum:!1,geopoint:!1,"string[]":!0,"number[]":!0,"boolean[]":!0,"enum[]":!0},OK={"string[]":`string`,"number[]":`number`,"boolean[]":`boolean`,"enum[]":`enum`};function kK(e){return e===`geopoint`}function AK(e){return typeof e==`string`&&/^vector\[\d+\]$/.test(e)}function jK(e){return typeof e==`string`&&DK[e]}function MK(e){return OK[e]}function NK(e){let t=Number(e.slice(7,-1));switch(!0){case isNaN(t):throw CK(`INVALID_VECTOR_VALUE`,e);case t<=0:throw CK(`INVALID_VECTOR_SIZE`,e);default:return t}}function PK(){return{idToInternalId:new Map,internalIdToId:[],save:FK,load:IK}}function FK(e){return{internalIdToId:e.internalIdToId}}function IK(e,t){let{internalIdToId:n}=t;e.internalDocumentIDStore.idToInternalId.clear(),e.internalDocumentIDStore.internalIdToId=[];let r=n.length;for(let t=0;t<r;t++){let r=n[t];e.internalDocumentIDStore.idToInternalId.set(r,t+1),e.internalDocumentIDStore.internalIdToId.push(r)}}function LK(e,t){if(typeof t==`string`){let n=e.idToInternalId.get(t);if(n)return n;let r=e.idToInternalId.size+1;return e.idToInternalId.set(t,r),e.internalIdToId.push(t),r}return t>e.internalIdToId.length?LK(e,t.toString()):t}function RK(e,t){if(e.internalIdToId.length<t)throw Error(`Invalid internalId ${t}`);return e.internalIdToId[t-1]}function zK(e,t){return{sharedInternalDocumentStore:t,docs:{},count:0}}function BK(e,t){let n=LK(e.sharedInternalDocumentStore,t);return e.docs[n]}function VK(e,t){let n=t.length,r=Array.from({length:n});for(let i=0;i<n;i++){let n=LK(e.sharedInternalDocumentStore,t[i]);r[i]=e.docs[n]}return r}function HK(e){return e.docs}function UK(e,t,n,r){return e.docs[n]===void 0?(e.docs[n]=r,e.count++,!0):!1}function WK(e,t){let n=LK(e.sharedInternalDocumentStore,t);return e.docs[n]===void 0?!1:(delete e.docs[n],e.count--,!0)}function GK(e){return e.count}function KK(e,t){let n=t;return{docs:n.docs,count:n.count,sharedInternalDocumentStore:e}}function qK(e){return{docs:e.docs,count:e.count}}function JK(){return{create:zK,get:BK,getMultiple:VK,getAll:HK,store:UK,remove:WK,count:GK,load:KK,save:qK}}var YK=[`beforeInsert`,`afterInsert`,`beforeRemove`,`afterRemove`,`beforeUpdate`,`afterUpdate`,`beforeUpsert`,`afterUpsert`,`beforeSearch`,`afterSearch`,`beforeInsertMultiple`,`afterInsertMultiple`,`beforeRemoveMultiple`,`afterRemoveMultiple`,`beforeUpdateMultiple`,`afterUpdateMultiple`,`beforeUpsertMultiple`,`afterUpsertMultiple`,`beforeLoad`,`afterLoad`,`afterCreate`];function XK(e,t){let n=[],r=e.plugins?.length;if(!r)return n;for(let i=0;i<r;i++)try{let r=e.plugins[i];typeof r[t]==`function`&&n.push(r[t])}catch(e){throw console.error(`Caught error in getAllPluginsByHook:`,e),CK(`PLUGIN_CRASHED`)}return n}var ZK=[`tokenizer`,`index`,`documentsStore`,`sorter`,`pinning`],QK=[`validateSchema`,`getDocumentIndexId`,`getDocumentProperties`,`formatElapsedTime`];function $K(e,t,n,r){if(e.some(hK))return(async()=>{for(let i of e)await i(t,n,r)})();for(let i of e)i(t,n,r)}function eq(e,t,n){if(e.some(hK))return(async()=>{for(let r of e)await r(t,n)})();for(let r of e)r(t,n)}function tq(e,t,n,r,i){if(e.some(hK))return(async()=>{for(let a of e)await a(t,n,r,i)})();for(let a of e)a(t,n,r,i)}function nq(e,t,n,r){if(e.some(hK))return(async()=>{for(let i of e)await i(t,n,r)})();for(let i of e)i(t,n,r)}function rq(e,t){if(e.some(hK))return(async()=>{for(let n of e)await n(t)})();for(let n of e)n(t)}var iq=class e{k;v;l=null;r=null;h=1;constructor(e,t){this.k=e,this.v=new Set(t)}updateHeight(){this.h=Math.max(e.getHeight(this.l),e.getHeight(this.r))+1}static getHeight(e){return e?e.h:0}getBalanceFactor(){return e.getHeight(this.l)-e.getHeight(this.r)}rotateLeft(){let e=this.r;return this.r=e.l,e.l=this,this.updateHeight(),e.updateHeight(),e}rotateRight(){let e=this.l;return this.l=e.r,e.r=this,this.updateHeight(),e.updateHeight(),e}toJSON(){return{k:this.k,v:Array.from(this.v),l:this.l?this.l.toJSON():null,r:this.r?this.r.toJSON():null,h:this.h}}static fromJSON(t){let n=new e(t.k,t.v);return n.l=t.l?e.fromJSON(t.l):null,n.r=t.r?e.fromJSON(t.r):null,n.h=t.h,n}},aq=class e{root=null;insertCount=0;constructor(e,t){e!==void 0&&t!==void 0&&(this.root=new iq(e,t))}insert(e,t,n=1e3){this.root=this.insertNode(this.root,e,t,n)}insertMultiple(e,t,n=1e3){for(let r of t)this.insert(e,r,n)}rebalance(){this.root&&=this.rebalanceNode(this.root)}toJSON(){return{root:this.root?this.root.toJSON():null,insertCount:this.insertCount}}static fromJSON(t){let n=new e;return n.root=t.root?iq.fromJSON(t.root):null,n.insertCount=t.insertCount||0,n}insertNode(e,t,n,r){if(e===null)return new iq(t,[n]);let i=[],a=e,o=null;for(;a!==null;)if(i.push({parent:o,node:a}),t<a.k)if(a.l===null){a.l=new iq(t,[n]),i.push({parent:a,node:a.l});break}else o=a,a=a.l;else if(t>a.k)if(a.r===null){a.r=new iq(t,[n]),i.push({parent:a,node:a.r});break}else o=a,a=a.r;else return a.v.add(n),e;let s=!1;this.insertCount++%r===0&&(s=!0);for(let t=i.length-1;t>=0;t--){let{parent:n,node:r}=i[t];if(r.updateHeight(),s){let t=this.rebalanceNode(r);n?n.l===r?n.l=t:n.r===r&&(n.r=t):e=t}}return e}rebalanceNode(e){let t=e.getBalanceFactor();if(t>1){if(e.l&&e.l.getBalanceFactor()>=0)return e.rotateRight();if(e.l)return e.l=e.l.rotateLeft(),e.rotateRight()}if(t<-1){if(e.r&&e.r.getBalanceFactor()<=0)return e.rotateLeft();if(e.r)return e.r=e.r.rotateRight(),e.rotateLeft()}return e}find(e){let t=this.findNodeByKey(e);return t?t.v:null}contains(e){return this.find(e)!==null}getSize(){let e=0,t=[],n=this.root;for(;n||t.length>0;){for(;n;)t.push(n),n=n.l;n=t.pop(),e++,n=n.r}return e}isBalanced(){if(!this.root)return!0;let e=[this.root];for(;e.length>0;){let t=e.pop(),n=t.getBalanceFactor();if(Math.abs(n)>1)return!1;t.l&&e.push(t.l),t.r&&e.push(t.r)}return!0}remove(e){this.root=this.removeNode(this.root,e)}removeDocument(e,t){let n=this.findNodeByKey(e);n&&(n.v.size===1?this.root=this.removeNode(this.root,e):n.v=new Set([...n.v.values()].filter(e=>e!==t)))}findNodeByKey(e){let t=this.root;for(;t;)if(e<t.k)t=t.l;else if(e>t.k)t=t.r;else return t;return null}removeNode(e,t){if(e===null)return null;let n=[],r=e;for(;r!==null&&r.k!==t;)n.push(r),r=t<r.k?r.l:r.r;if(r===null)return e;if(r.l===null||r.r===null){let t=r.l?r.l:r.r;if(n.length===0)e=t;else{let e=n[n.length-1];e.l===r?e.l=t:e.r=t}}else{let e=r,t=r.r;for(;t.l!==null;)e=t,t=t.l;r.k=t.k,r.v=t.v,e.l===t?e.l=t.r:e.r=t.r,r=e}n.push(r);for(let t=n.length-1;t>=0;t--){let r=n[t];r.updateHeight();let i=this.rebalanceNode(r);if(t>0){let e=n[t-1];e.l===r?e.l=i:e.r===r&&(e.r=i)}else e=i}return e}rangeSearch(e,t){let n=new Set,r=[],i=this.root;for(;i||r.length>0;){for(;i;)r.push(i),i=i.l;if(i=r.pop(),i.k>=e&&i.k<=t)for(let e of i.v)n.add(e);if(i.k>t)break;i=i.r}return n}greaterThan(e,t=!1){let n=new Set,r=[],i=this.root;for(;i||r.length>0;){for(;i;)r.push(i),i=i.r;if(i=r.pop(),t&&i.k>=e||!t&&i.k>e)for(let e of i.v)n.add(e);else if(i.k<=e)break;i=i.l}return n}lessThan(e,t=!1){let n=new Set,r=[],i=this.root;for(;i||r.length>0;){for(;i;)r.push(i),i=i.l;if(i=r.pop(),t&&i.k<=e||!t&&i.k<e)for(let e of i.v)n.add(e);else if(i.k>e)break;i=i.r}return n}},oq=class e{numberToDocumentId;constructor(){this.numberToDocumentId=new Map}insert(e,t){this.numberToDocumentId.has(e)?this.numberToDocumentId.get(e).add(t):this.numberToDocumentId.set(e,new Set([t]))}find(e){let t=this.numberToDocumentId.get(e);return t?Array.from(t):null}remove(e){this.numberToDocumentId.delete(e)}removeDocument(e,t){let n=this.numberToDocumentId.get(t);n&&(n.delete(e),n.size===0&&this.numberToDocumentId.delete(t))}contains(e){return this.numberToDocumentId.has(e)}getSize(){let e=0;for(let t of this.numberToDocumentId.values())e+=t.size;return e}filter(e){let t=Object.keys(e);if(t.length!==1)throw Error(`Invalid operation`);let n=t[0];switch(n){case`eq`:{let t=e[n],r=this.numberToDocumentId.get(t);return r?Array.from(r):[]}case`in`:{let t=e[n],r=new Set;for(let e of t){let t=this.numberToDocumentId.get(e);if(t)for(let e of t)r.add(e)}return Array.from(r)}case`nin`:{let t=new Set(e[n]),r=new Set;for(let[e,n]of this.numberToDocumentId.entries())if(!t.has(e))for(let e of n)r.add(e);return Array.from(r)}default:throw Error(`Invalid operation`)}}filterArr(e){let t=Object.keys(e);if(t.length!==1)throw Error(`Invalid operation`);let n=t[0];switch(n){case`containsAll`:{let t=e[n].map(e=>this.numberToDocumentId.get(e)??new Set);if(t.length===0)return[];let r=t.reduce((e,t)=>new Set([...e].filter(e=>t.has(e))));return Array.from(r)}case`containsAny`:{let t=e[n].map(e=>this.numberToDocumentId.get(e)??new Set);if(t.length===0)return[];let r=t.reduce((e,t)=>new Set([...e,...t]));return Array.from(r)}default:throw Error(`Invalid operation`)}}static fromJSON(t){if(!t.numberToDocumentId)throw Error(`Invalid Flat Tree JSON`);let n=new e;for(let[e,r]of t.numberToDocumentId)n.numberToDocumentId.set(e,new Set(r));return n}toJSON(){return{numberToDocumentId:Array.from(this.numberToDocumentId.entries()).map(([e,t])=>[e,Array.from(t)])}}};function sq(e,t,n){if(n<0)return-1;if(e===t)return 0;let r=e.length,i=t.length;if(r===0)return i<=n?i:-1;if(i===0)return r<=n?r:-1;let a=Math.abs(r-i);if(e.startsWith(t))return a<=n?a:-1;if(t.startsWith(e))return 0;if(a>n)return-1;let o=[];for(let e=0;e<=r;e++){o[e]=[e];for(let t=1;t<=i;t++)o[e][t]=e===0?t:0}for(let a=1;a<=r;a++){let r=1/0;for(let n=1;n<=i;n++)e[a-1]===t[n-1]?o[a][n]=o[a-1][n-1]:o[a][n]=Math.min(o[a-1][n]+1,o[a][n-1]+1,o[a-1][n-1]+1),r=Math.min(r,o[a][n]);if(r>n)return-1}return o[r][i]<=n?o[r][i]:-1}function cq(e,t,n){let r=sq(e,t,n);return{distance:r,isBounded:r>=0}}var lq=class e{k;s;c=new Map;d=new Set;e;w=``;constructor(e,t,n){this.k=e,this.s=t,this.e=n}updateParent(e){this.w=e.w+this.s}addDocument(e){this.d.add(e)}removeDocument(e){return this.d.delete(e)}findAllWords(e,t,n,r){let i=[this];for(;i.length>0;){let a=i.pop();if(a.e){let{w:i,d:o}=a;if(n&&i!==t)continue;if(sK(e,i)!==null)if(r)if(Math.abs(t.length-i.length)<=r&&cq(t,i,r).isBounded)e[i]=[];else continue;else e[i]=[];if(sK(e,i)!=null&&o.size>0){let t=e[i];for(let e of o)t.includes(e)||t.push(e)}}a.c.size>0&&i.push(...a.c.values())}return e}insert(t,n){let r=this,i=0,a=t.length;for(;i<a;){let o=t[i],s=r.c.get(o);if(s){let o=s.s,c=o.length,l=0;for(;l<c&&i+l<a&&o[l]===t[i+l];)l++;if(l===c){if(r=s,i+=l,i===a){s.e||=!0,s.addDocument(n);return}continue}let u=o.slice(0,l),d=o.slice(l),f=t.slice(i+l),p=new e(u[0],u,!1);if(r.c.set(u[0],p),p.updateParent(r),s.s=d,s.k=d[0],p.c.set(d[0],s),s.updateParent(p),f){let t=new e(f[0],f,!0);t.addDocument(n),p.c.set(f[0],t),t.updateParent(p)}else p.e=!0,p.addDocument(n);return}else{let a=new e(o,t.slice(i),!0);a.addDocument(n),r.c.set(o,a),a.updateParent(r);return}}r.e||=!0,r.addDocument(n)}_findLevenshtein(e,t,n,r,i){let a=[{node:this,index:t,tolerance:n}];for(;a.length>0;){let{node:t,index:n,tolerance:o}=a.pop();if(t.w.startsWith(e)){t.findAllWords(i,e,!1,0);continue}if(o<0)continue;if(t.e){let{w:n,d:a}=t;if(n&&(cq(e,n,r).isBounded&&(i[n]=[]),sK(i,n)!==void 0&&a.size>0)){let e=new Set(i[n]);for(let t of a)e.add(t);i[n]=Array.from(e)}}if(n>=e.length)continue;let s=e[n];if(t.c.has(s)){let e=t.c.get(s);a.push({node:e,index:n+1,tolerance:o})}a.push({node:t,index:n+1,tolerance:o-1});for(let[e,r]of t.c)a.push({node:r,index:n,tolerance:o-1}),e!==s&&a.push({node:r,index:n+1,tolerance:o-1})}}find(e){let{term:t,exact:n,tolerance:r}=e;if(r&&!n){let e={};return this._findLevenshtein(t,0,r,r,e),e}else{let e=this,i=0,a=t.length;for(;i<a;){let o=t[i],s=e.c.get(o);if(s){let o=s.s,c=o.length,l=0;for(;l<c&&i+l<a&&o[l]===t[i+l];)l++;if(l===c)e=s,i+=l;else if(i+l===a)if(l===a-i){if(n)return{};{let e={};return s.findAllWords(e,t,n,r),e}}else return{};else return{}}else return{}}let o={};return e.findAllWords(o,t,n,r),o}}contains(e){let t=this,n=0,r=e.length;for(;n<r;){let i=e[n],a=t.c.get(i);if(a){let i=a.s,o=i.length,s=0;for(;s<o&&n+s<r&&i[s]===e[n+s];)s++;if(s<o)return!1;n+=o,t=a}else return!1}return!0}removeWord(e){if(!e)return!1;let t=this,n=e.length,r=[];for(let i=0;i<n;i++){let n=e[i];if(t.c.has(n)){let e=t.c.get(n);r.push({parent:t,character:n}),i+=e.s.length-1,t=e}else return!1}for(t.d.clear(),t.e=!1;r.length>0&&t.c.size===0&&!t.e&&t.d.size===0;){let{parent:e,character:n}=r.pop();e.c.delete(n),t=e}return!0}removeDocumentByWord(e,t,n=!0){if(!e)return!0;let r=this,i=e.length;for(let a=0;a<i;a++){let i=e[a];if(r.c.has(i)){let o=r.c.get(i);a+=o.s.length-1,r=o,n&&r.w!==e||r.removeDocument(t)}else return!1}return!0}static getCommonPrefix(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e.charCodeAt(r)===t.charCodeAt(r);)r++;return e.slice(0,r)}toJSON(){return{w:this.w,s:this.s,e:this.e,k:this.k,d:Array.from(this.d),c:Array.from(this.c?.entries())?.map(([e,t])=>[e,t.toJSON()])}}static fromJSON(t){let n=new e(t.k,t.s,t.e);return n.w=t.w,n.d=new Set(t.d),n.c=new Map(t?.c?.map(([t,n])=>[t,e.fromJSON(n)])||[]),n}},uq=class e extends lq{constructor(){super(``,``,!1)}static fromJSON(t){let n=new e;return n.w=t.w,n.s=t.s,n.e=t.e,n.k=t.k,n.d=new Set(t.d),n.c=new Map(t?.c?.map(([e,t])=>[e,lq.fromJSON(t)])||[]),n}toJSON(){return super.toJSON()}},dq=2,fq=6371e3,pq=class e{point;docIDs;left;right;parent;constructor(e,t){this.point=e,this.docIDs=new Set(t),this.left=null,this.right=null,this.parent=null}toJSON(){return{point:this.point,docIDs:Array.from(this.docIDs),left:this.left?this.left.toJSON():null,right:this.right?this.right.toJSON():null}}static fromJSON(t,n=null){let r=new e(t.point,t.docIDs);return r.parent=n,t.left&&(r.left=e.fromJSON(t.left,r)),t.right&&(r.right=e.fromJSON(t.right,r)),r}},mq=class e{root;nodeMap;constructor(){this.root=null,this.nodeMap=new Map}getPointKey(e){return`${e.lon},${e.lat}`}insert(e,t){let n=this.getPointKey(e),r=this.nodeMap.get(n);if(r){t.forEach(e=>r.docIDs.add(e));return}let i=new pq(e,t);if(this.nodeMap.set(n,i),this.root==null){this.root=i;return}let a=this.root,o=0;for(;;){if(o%dq===0)if(e.lon<a.point.lon){if(a.left==null){a.left=i,i.parent=a;return}a=a.left}else{if(a.right==null){a.right=i,i.parent=a;return}a=a.right}else if(e.lat<a.point.lat){if(a.left==null){a.left=i,i.parent=a;return}a=a.left}else{if(a.right==null){a.right=i,i.parent=a;return}a=a.right}o++}}contains(e){let t=this.getPointKey(e);return this.nodeMap.has(t)}getDocIDsByCoordinates(e){let t=this.getPointKey(e),n=this.nodeMap.get(t);return n?Array.from(n.docIDs):null}removeDocByID(e,t){let n=this.getPointKey(e),r=this.nodeMap.get(n);r&&(r.docIDs.delete(t),r.docIDs.size===0&&(this.nodeMap.delete(n),this.deleteNode(r)))}deleteNode(e){let t=e.parent,n=e.left?e.left:e.right;n&&(n.parent=t),t?t.left===e?t.left=n:t.right===e&&(t.right=n):(this.root=n,this.root&&(this.root.parent=null))}searchByRadius(t,n,r=!0,i=`asc`,a=!1){let o=a?e.vincentyDistance:e.haversineDistance,s=[{node:this.root,depth:0}],c=[];for(;s.length>0;){let{node:e,depth:i}=s.pop();if(e==null)continue;let a=o(t,e.point);(r?a<=n:a>n)&&c.push({point:e.point,docIDs:Array.from(e.docIDs)}),e.left!=null&&s.push({node:e.left,depth:i+1}),e.right!=null&&s.push({node:e.right,depth:i+1})}return i&&c.sort((e,n)=>{let r=o(t,e.point),a=o(t,n.point);return i.toLowerCase()===`asc`?r-a:a-r}),c}searchByPolygon(t,n=!0,r=null,i=!1){let a=[{node:this.root,depth:0}],o=[];for(;a.length>0;){let{node:r,depth:i}=a.pop();if(r==null)continue;r.left!=null&&a.push({node:r.left,depth:i+1}),r.right!=null&&a.push({node:r.right,depth:i+1});let s=e.isPointInPolygon(t,r.point);(s&&n||!s&&!n)&&o.push({point:r.point,docIDs:Array.from(r.docIDs)})}let s=e.calculatePolygonCentroid(t);if(r){let t=i?e.vincentyDistance:e.haversineDistance;o.sort((e,n)=>{let i=t(s,e.point),a=t(s,n.point);return r.toLowerCase()===`asc`?i-a:a-i})}return o}toJSON(){return{root:this.root?this.root.toJSON():null}}static fromJSON(t){let n=new e;return t.root&&(n.root=pq.fromJSON(t.root),n.buildNodeMap(n.root)),n}buildNodeMap(e){if(e==null)return;let t=this.getPointKey(e.point);this.nodeMap.set(t,e),e.left&&this.buildNodeMap(e.left),e.right&&this.buildNodeMap(e.right)}static calculatePolygonCentroid(e){let t=0,n=0,r=0,i=e.length;for(let a=0,o=i-1;a<i;o=a++){let i=e[a].lon,s=e[a].lat,c=e[o].lon,l=e[o].lat,u=i*l-c*s;t+=u,n+=(i+c)*u,r+=(s+l)*u}t/=2;let a=6*t;return n/=a,r/=a,{lon:n,lat:r}}static isPointInPolygon(e,t){let n=!1,r=t.lon,i=t.lat,a=e.length;for(let t=0,o=a-1;t<a;o=t++){let a=e[t].lon,s=e[t].lat,c=e[o].lon,l=e[o].lat;s>i!=l>i&&r<(c-a)*(i-s)/(l-s)+a&&(n=!n)}return n}static haversineDistance(e,t){let n=Math.PI/180,r=e.lat*n,i=t.lat*n,a=(t.lat-e.lat)*n,o=(t.lon-e.lon)*n,s=Math.sin(a/2)*Math.sin(a/2)+Math.cos(r)*Math.cos(i)*Math.sin(o/2)*Math.sin(o/2);return fq*(2*Math.atan2(Math.sqrt(s),Math.sqrt(1-s)))}static vincentyDistance(e,t){let n=6378137,r=1/298.257223563,i=(1-r)*n,a=Math.PI/180,o=e.lat*a,s=t.lat*a,c=(t.lon-e.lon)*a,l=Math.atan((1-r)*Math.tan(o)),u=Math.atan((1-r)*Math.tan(s)),d=Math.sin(l),f=Math.cos(l),p=Math.sin(u),m=Math.cos(u),h=c,g,_=1e3,v,y,b,x,S,C;do{let e=Math.sin(h),t=Math.cos(h);if(v=Math.sqrt(m*e*(m*e)+(f*p-d*m*t)*(f*p-d*m*t)),v===0)return 0;y=d*p+f*m*t,b=Math.atan2(v,y),x=f*m*e/v,S=1-x*x,C=y-2*d*p/S,isNaN(C)&&(C=0);let n=r/16*S*(4+r*(4-3*S));g=h,h=c+(1-n)*r*x*(b+n*v*(C+n*y*(-1+2*C*C)))}while(Math.abs(h-g)>1e-12&&--_>0);if(_===0)return NaN;let w=S*(n*n-i*i)/(i*i),T=1+w/16384*(4096+w*(-768+w*(320-175*w))),E=w/1024*(256+w*(-128+w*(74-47*w))),ee=E*v*(C+E/4*(y*(-1+2*C*C)-E/6*C*(-3+4*v*v)*(-3+4*C*C)));return i*T*(b-ee)}},hq=class e{true;false;constructor(){this.true=new Set,this.false=new Set}insert(e,t){t?this.true.add(e):this.false.add(e)}delete(e,t){t?this.true.delete(e):this.false.delete(e)}getSize(){return this.true.size+this.false.size}toJSON(){return{true:Array.from(this.true),false:Array.from(this.false)}}static fromJSON(t){let n=new e;return n.true=new Set(t.true),n.false=new Set(t.false),n}};function gq(e,t,n,r,i,{k:a,b:o,d:s}){return Math.log(1+(n-t+.5)/(t+.5))*(s+e*(a+1))/(e+a*(1-o+o*r/i))}var _q=class e{size;vectors=new Map;constructor(e){this.size=e}add(e,t){t instanceof Float32Array||(t=new Float32Array(t));let n=vq(t,this.size);this.vectors.set(e,[n,t])}remove(e){this.vectors.delete(e)}find(e,t,n){return e instanceof Float32Array||(e=new Float32Array(e)),yq(e,n,this.vectors,this.size,t)}toJSON(){let e=[];for(let[t,[n,r]]of this.vectors)e.push([t,[n,Array.from(r)]]);return{size:this.size,vectors:e}}static fromJSON(t){let n=t,r=new e(n.size);for(let[e,[t,i]]of n.vectors)r.vectors.set(e,[t,new Float32Array(i)]);return r}};function vq(e,t){let n=0;for(let r=0;r<t;r++)n+=e[r]*e[r];return Math.sqrt(n)}function yq(e,t,n,r,i){let a=vq(e,r),o=[],s=t||n.keys();for(let t of s){let s=n.get(t);if(!s)continue;let c=s[0],l=s[1],u=0;for(let t=0;t<r;t++)u+=e[t]*l[t];let d=u/(a*c);d>=i&&o.push([t,d])}return o}function bq(e,t,n,r,i){let a=LK(e.sharedInternalDocumentStore,n);e.avgFieldLength[t]=((e.avgFieldLength[t]??0)*(i-1)+r.length)/i,e.fieldLengths[t][a]=r.length,e.frequencies[t][a]={}}function xq(e,t,n,r,i){let a=0;for(let e of r)e===i&&a++;let o=LK(e.sharedInternalDocumentStore,n),s=a/r.length;e.frequencies[t][o][i]=s,i in e.tokenOccurrences[t]||(e.tokenOccurrences[t][i]=0),e.tokenOccurrences[t][i]=(e.tokenOccurrences[t][i]??0)+1}function Sq(e,t,n,r){let i=LK(e.sharedInternalDocumentStore,n);r>1?e.avgFieldLength[t]=(e.avgFieldLength[t]*r-e.fieldLengths[t][i])/(r-1):e.avgFieldLength[t]=void 0,e.fieldLengths[t][i]=void 0,e.frequencies[t][i]=void 0}function Cq(e,t,n){e.tokenOccurrences[t][n]--}function wq(e,t,n,r,i=``){r||={sharedInternalDocumentStore:t,indexes:{},vectorIndexes:{},searchableProperties:[],searchablePropertiesWithTypes:{},frequencies:{},tokenOccurrences:{},avgFieldLength:{},fieldLengths:{}};for(let[a,o]of Object.entries(n)){let n=`${i}${i?`.`:``}${a}`;if(typeof o==`object`&&!Array.isArray(o)){wq(e,t,o,r,n);continue}if(AK(o))r.searchableProperties.push(n),r.searchablePropertiesWithTypes[n]=o,r.vectorIndexes[n]={type:`Vector`,node:new _q(NK(o)),isArray:!1};else{let e=/\[/.test(o);switch(o){case`boolean`:case`boolean[]`:r.indexes[n]={type:`Bool`,node:new hq,isArray:e};break;case`number`:case`number[]`:r.indexes[n]={type:`AVL`,node:new aq(0,[]),isArray:e};break;case`string`:case`string[]`:r.indexes[n]={type:`Radix`,node:new uq,isArray:e},r.avgFieldLength[n]=0,r.frequencies[n]={},r.tokenOccurrences[n]={},r.fieldLengths[n]={};break;case`enum`:case`enum[]`:r.indexes[n]={type:`Flat`,node:new oq,isArray:e};break;case`geopoint`:r.indexes[n]={type:`BKD`,node:new mq,isArray:e};break;default:throw CK(`INVALID_SCHEMA_TYPE`,Array.isArray(o)?`array`:o,n)}r.searchableProperties.push(n),r.searchablePropertiesWithTypes[n]=o}}return r}function Tq(e,t,n,r,i,a,o,s){return c=>{let{type:l,node:u}=t.indexes[n];switch(l){case`Bool`:u[c?`true`:`false`].add(r);break;case`AVL`:{let e=s?.avlRebalanceThreshold??1;u.insert(c,r,e);break}case`Radix`:{let s=a.tokenize(c,i,n,!1);e.insertDocumentScoreParameters(t,n,r,s,o);for(let i of s)e.insertTokenScoreParameters(t,n,r,s,i),u.insert(i,r);break}case`Flat`:u.insert(c,r);break;case`BKD`:u.insert(c,[r]);break}}}function Eq(e,t,n,r,i,a,o,s,c,l,u){if(AK(o))return Dq(t,n,a,r,i);let d=Tq(e,t,n,i,s,c,l,u);if(!jK(o))return d(a);let f=a,p=f.length;for(let e=0;e<p;e++)d(f[e])}function Dq(e,t,n,r,i){e.vectorIndexes[t].node.add(i,n)}function Oq(e,t,n,r,i,a,o,s,c,l){if(AK(o))return t.vectorIndexes[n].node.remove(i),!0;let{type:u,node:d}=t.indexes[n];switch(u){case`AVL`:return d.removeDocument(a,i),!0;case`Bool`:return d[a?`true`:`false`].delete(i),!0;case`Radix`:{let o=c.tokenize(a,s,n);e.removeDocumentScoreParameters(t,n,r,l);for(let r of o)e.removeTokenScoreParameters(t,n,r),d.removeDocumentByWord(r,i);return!0}case`Flat`:return d.removeDocument(i,a),!0;case`BKD`:return d.removeDocByID(a,i),!1}}function kq(e,t,n,r,i,a,o,s,c,l){if(!jK(o))return Oq(e,t,n,r,i,a,o,s,c,l);let u=MK(o),d=a,f=d.length;for(let a=0;a<f;a++)Oq(e,t,n,r,i,d[a],u,s,c,l);return!0}function Aq(e,t,n,r,i,a,o,s,c,l){let u=Array.from(r),d=e.avgFieldLength[t],f=e.fieldLengths[t],p=e.tokenOccurrences[t],m=e.frequencies[t],h=typeof p[n]==`number`?p[n]??0:0,g=u.length;for(let e=0;e<g;e++){let r=u[e];if(c&&!c.has(r))continue;l.has(r)||l.set(r,new Map);let p=l.get(r);p.set(t,(p.get(t)||0)+1);let g=gq(m?.[r]?.[n]??0,h,i,f[r],d,a);o.has(r)?o.set(r,o.get(r)+g*s):o.set(r,g*s)}}function jq(e,t,n,r,i,a,o,s,c,l,u,d=0){let f=n.tokenize(t,r),p=f.length||1,m=new Map,h=new Map,g=new Map;for(let n of i){if(!(n in e.indexes))continue;let r=e.indexes[n],{type:i}=r;if(i!==`Radix`)throw CK(`WRONG_SEARCH_PROPERTY_TYPE`,n);let d=s[n]??1;if(d<=0)throw CK(`INVALID_BOOST_VALUE`,d);f.length===0&&!t&&f.push(``);let p=f.length;for(let t=0;t<p;t++){let i=f[t],s=r.node.find({term:i,exact:a,tolerance:o}),p=Object.keys(s);p.length>0&&h.set(i,!0);let _=p.length;for(let t=0;t<_;t++){let r=p[t],i=s[r];Aq(e,n,r,i,l,c,g,d,u,m)}}}let _=Array.from(g.entries()).map(([e,t])=>[e,t]).sort((e,t)=>t[1]-e[1]);if(_.length===0)return[];if(d===1)return _;if(d===0){if(p===1)return _;for(let e of f)if(!h.get(e))return[];return _.filter(([e])=>{let t=m.get(e);return t?Array.from(t.values()).some(e=>e===p):!1})}let v=_.filter(([e])=>{let t=m.get(e);return t?Array.from(t.values()).some(e=>e===p):!1});if(v.length>0){let e=_.filter(([e])=>!v.some(([t])=>t===e)),t=Math.ceil(e.length*d);return[...v,...e.slice(0,t)]}return _}function Mq(e,t,n,r){if(`and`in n&&n.and&&Array.isArray(n.and)){let i=n.and;return i.length===0?new Set:_K(...i.map(n=>Mq(e,t,n,r)))}if(`or`in n&&n.or&&Array.isArray(n.or)){let i=n.or;return i.length===0?new Set:i.map(n=>Mq(e,t,n,r)).reduce((e,t)=>yK(e,t),new Set)}if(`not`in n&&n.not){let i=n.not,a=new Set,o=e.sharedInternalDocumentStore;for(let e=1;e<=o.internalIdToId.length;e++)a.add(e);return bK(a,Mq(e,t,i,r))}let i=Object.keys(n),a=i.reduce((e,t)=>({[t]:new Set,...e}),{});for(let o of i){let i=n[o];if(e.indexes[o]===void 0)throw CK(`UNKNOWN_FILTER_PROPERTY`,o);let{node:s,type:c,isArray:l}=e.indexes[o];if(c===`Bool`){let e=s,t=i?e.true:e.false;a[o]=yK(a[o],t);continue}if(c===`BKD`){let e;if(`radius`in i)e=`radius`;else if(`polygon`in i)e=`polygon`;else throw Error(`Invalid operation ${i}`);if(e===`radius`){let{value:t,coordinates:n,unit:r=`m`,inside:c=!0,highPrecision:l=!1}=i[e],u=pK(t,r),d=s.searchByRadius(n,u,c,void 0,l);a[o]=Rq(a[o],d)}else{let{coordinates:t,inside:n=!0,highPrecision:r=!1}=i[e],c=s.searchByPolygon(t,n,void 0,r);a[o]=Rq(a[o],c)}continue}if(c===`Radix`&&(typeof i==`string`||Array.isArray(i))){for(let e of[i].flat()){let n=t.tokenize(e,r,o);for(let e of n){let t=s.find({term:e,exact:!0});a[o]=Hq(a[o],t)}}continue}let u=Object.keys(i);if(u.length>1)throw CK(`INVALID_FILTER_OPERATION`,u.length);if(c===`Flat`){let e=new Set(l?s.filterArr(i):s.filter(i));a[o]=yK(a[o],e);continue}if(c===`AVL`){let e=u[0],t=i[e],n;switch(e){case`gt`:n=s.greaterThan(t,!1);break;case`gte`:n=s.greaterThan(t,!0);break;case`lt`:n=s.lessThan(t,!1);break;case`lte`:n=s.lessThan(t,!0);break;case`eq`:n=s.find(t)??new Set;break;case`between`:{let[e,r]=t;n=s.rangeSearch(e,r);break}default:throw CK(`INVALID_FILTER_OPERATION`,e)}a[o]=yK(a[o],n)}}return _K(...Object.values(a))}function Nq(e){return e.searchableProperties}function Pq(e){return e.searchablePropertiesWithTypes}function Fq(e,t){let{indexes:n,vectorIndexes:r,searchableProperties:i,searchablePropertiesWithTypes:a,frequencies:o,tokenOccurrences:s,avgFieldLength:c,fieldLengths:l}=t,u={},d={};for(let e of Object.keys(n)){let{node:t,type:r,isArray:i}=n[e];switch(r){case`Radix`:u[e]={type:`Radix`,node:uq.fromJSON(t),isArray:i};break;case`Flat`:u[e]={type:`Flat`,node:oq.fromJSON(t),isArray:i};break;case`AVL`:u[e]={type:`AVL`,node:aq.fromJSON(t),isArray:i};break;case`BKD`:u[e]={type:`BKD`,node:mq.fromJSON(t),isArray:i};break;case`Bool`:u[e]={type:`Bool`,node:hq.fromJSON(t),isArray:i};break;default:u[e]=n[e]}}for(let e of Object.keys(r))d[e]={type:`Vector`,isArray:!1,node:_q.fromJSON(r[e])};return{sharedInternalDocumentStore:e,indexes:u,vectorIndexes:d,searchableProperties:i,searchablePropertiesWithTypes:a,frequencies:o,tokenOccurrences:s,avgFieldLength:c,fieldLengths:l}}function Iq(e){let{indexes:t,vectorIndexes:n,searchableProperties:r,searchablePropertiesWithTypes:i,frequencies:a,tokenOccurrences:o,avgFieldLength:s,fieldLengths:c}=e,l={};for(let e of Object.keys(n))l[e]=n[e].node.toJSON();let u={};for(let e of Object.keys(t)){let{type:n,node:r,isArray:i}=t[e];n===`Flat`||n===`Radix`||n===`AVL`||n===`BKD`||n===`Bool`?u[e]={type:n,node:r.toJSON(),isArray:i}:(u[e]=t[e],u[e].node=u[e].node.toJSON())}return{indexes:u,vectorIndexes:l,searchableProperties:r,searchablePropertiesWithTypes:i,frequencies:a,tokenOccurrences:o,avgFieldLength:s,fieldLengths:c}}function Lq(){return{create:wq,insert:Eq,remove:kq,insertDocumentScoreParameters:bq,insertTokenScoreParameters:xq,removeDocumentScoreParameters:Sq,removeTokenScoreParameters:Cq,calculateResultScores:Aq,search:jq,searchByWhereClause:Mq,getSearchableProperties:Nq,getSearchablePropertiesWithTypes:Pq,load:Fq,save:Iq}}function Rq(e,t){e||=new Set;let n=t.length;for(let r=0;r<n;r++){let n=t[r].docIDs,i=n.length;for(let t=0;t<i;t++)e.add(n[t])}return e}function zq(e,t,n=!1){let r=n?mq.vincentyDistance:mq.haversineDistance,i=[],a=[];for(let{point:n}of e)a.push(r(t,n));let o=Math.max(...a),s=0;for(let{docIDs:t}of e){let e=o-a[s]+1;for(let n of t)i.push([n,e]);s++}return i.sort((e,t)=>t[1]-e[1]),i}function Bq(e,t){let n=Object.keys(e);if(n.length!==1)return{isGeoOnly:!1};let r=n[0],i=e[r];if(t.indexes[r]===void 0)return{isGeoOnly:!1};let{type:a}=t.indexes[r];return a===`BKD`&&i&&(`radius`in i||`polygon`in i)?{isGeoOnly:!0,geoProperty:r,geoOperation:i}:{isGeoOnly:!1}}function Vq(e,t){let n=e,r=Bq(t,n);if(!r.isGeoOnly||!r.geoProperty||!r.geoOperation)return null;let{node:i}=n.indexes[r.geoProperty],a=r.geoOperation,o=i,s;if(`radius`in a){let{value:e,coordinates:t,unit:n=`m`,inside:r=!0,highPrecision:i=!1}=a.radius,c=t,l=pK(e,n);return s=o.searchByRadius(c,l,r,`asc`,i),zq(s,c,i)}else if(`polygon`in a){let{coordinates:e,inside:t=!0,highPrecision:n=!1}=a.polygon;s=o.searchByPolygon(e,t,`asc`,n);let r=mq.calculatePolygonCentroid(e);return zq(s,r,n)}return null}function Hq(e,t){e||=new Set;let n=Object.keys(t),r=n.length;for(let i=0;i<r;i++){let r=t[n[i]],a=r.length;for(let t=0;t<a;t++)e.add(r[t])}return e}function Uq(e,t,n,r,i){let a={language:e.tokenizer.language,sharedInternalDocumentStore:t,enabled:!0,isSorted:!0,sortableProperties:[],sortablePropertiesWithTypes:{},sorts:{}};for(let[o,s]of Object.entries(n)){let n=`${i}${i?`.`:``}${o}`;if(!r.includes(n)){if(typeof s==`object`&&!Array.isArray(s)){let i=Uq(e,t,s,r,n);$G(a.sortableProperties,i.sortableProperties),a.sorts={...a.sorts,...i.sorts},a.sortablePropertiesWithTypes={...a.sortablePropertiesWithTypes,...i.sortablePropertiesWithTypes};continue}if(!AK(s))switch(s){case`boolean`:case`number`:case`string`:a.sortableProperties.push(n),a.sortablePropertiesWithTypes[n]=s,a.sorts[n]={docs:new Map,orderedDocsToRemove:new Map,orderedDocs:[],type:s};break;case`geopoint`:case`enum`:continue;case`enum[]`:case`boolean[]`:case`number[]`:case`string[]`:continue;default:throw CK(`INVALID_SORT_SCHEMA_TYPE`,Array.isArray(s)?`array`:s,n)}}}return a}function Wq(e,t,n,r){return r?.enabled===!1?{disabled:!0}:Uq(e,t,n,(r||{}).unsortableProperties||[],``)}function Gq(e,t,n,r){if(!e.enabled)return;e.isSorted=!1;let i=LK(e.sharedInternalDocumentStore,n),a=e.sorts[t];a.orderedDocsToRemove.has(i)&&Qq(e,t),a.docs.set(i,a.orderedDocs.length),a.orderedDocs.push([i,r])}function Kq(e){if(e.isSorted||!e.enabled)return;let t=Object.keys(e.sorts);for(let n of t)Xq(e,n);e.isSorted=!0}function qq(e,t,n){return t[1].localeCompare(n[1],KG(e))}function Jq(e,t){return e[1]-t[1]}function Yq(e,t){return t[1]?-1:1}function Xq(e,t){let n=e.sorts[t],r;switch(n.type){case`string`:r=qq.bind(null,e.language);break;case`number`:r=Jq.bind(null);break;case`boolean`:r=Yq.bind(null);break}n.orderedDocs.sort(r);let i=n.orderedDocs.length;for(let e=0;e<i;e++){let t=n.orderedDocs[e][0];n.docs.set(t,e)}}function Zq(e){let t=Object.keys(e.sorts);for(let n of t)Qq(e,n)}function Qq(e,t){let n=e.sorts[t];n.orderedDocsToRemove.size&&(n.orderedDocs=n.orderedDocs.filter(e=>!n.orderedDocsToRemove.has(e[0])),n.orderedDocsToRemove.clear())}function $q(e,t,n){if(!e.enabled)return;let r=e.sorts[t],i=LK(e.sharedInternalDocumentStore,n);r.docs.get(i)&&(r.docs.delete(i),r.orderedDocsToRemove.set(i,!0))}function eJ(e,t,n){if(!e.enabled)throw CK(`SORT_DISABLED`);let r=n.property,i=n.order===`DESC`,a=e.sorts[r];if(!a)throw CK(`UNABLE_TO_SORT_ON_UNKNOWN_FIELD`,r,e.sortableProperties.join(`, `));return Qq(e,r),Kq(e),t.sort((t,n)=>{let r=a.docs.get(LK(e.sharedInternalDocumentStore,t[0])),o=a.docs.get(LK(e.sharedInternalDocumentStore,n[0])),s=r!==void 0,c=o!==void 0;return!s&&!c?0:s?c?i?o-r:r-o:-1:1}),t}function tJ(e){return e.enabled?e.sortableProperties:[]}function nJ(e){return e.enabled?e.sortablePropertiesWithTypes:{}}function rJ(e,t){let n=t;if(!n.enabled)return{enabled:!1};let r=Object.keys(n.sorts).reduce((e,t)=>{let{docs:r,orderedDocs:i,type:a}=n.sorts[t];return e[t]={docs:new Map(Object.entries(r).map(([e,t])=>[+e,t])),orderedDocsToRemove:new Map,orderedDocs:i,type:a},e},{});return{sharedInternalDocumentStore:e,language:n.language,sortableProperties:n.sortableProperties,sortablePropertiesWithTypes:n.sortablePropertiesWithTypes,sorts:r,enabled:!0,isSorted:n.isSorted}}function iJ(e){if(!e.enabled)return{enabled:!1};Zq(e),Kq(e);let t=Object.keys(e.sorts).reduce((t,n)=>{let{docs:r,orderedDocs:i,type:a}=e.sorts[n];return t[n]={docs:Object.fromEntries(r.entries()),orderedDocs:i,type:a},t},{});return{language:e.language,sortableProperties:e.sortableProperties,sortablePropertiesWithTypes:e.sortablePropertiesWithTypes,sorts:t,enabled:e.enabled,isSorted:e.isSorted}}function aJ(){return{create:Wq,insert:Gq,remove:$q,save:iJ,load:rJ,sortBy:eJ,getSortableProperties:tJ,getSortablePropertiesWithTypes:nJ}}var oJ=192,sJ=383,cJ=[65,65,65,65,65,65,65,67,69,69,69,69,73,73,73,73,69,78,79,79,79,79,79,null,79,85,85,85,85,89,80,115,97,97,97,97,97,97,97,99,101,101,101,101,105,105,105,105,101,110,111,111,111,111,111,null,111,117,117,117,117,121,112,121,65,97,65,97,65,97,67,99,67,99,67,99,67,99,68,100,68,100,69,101,69,101,69,101,69,101,69,101,71,103,71,103,71,103,71,103,72,104,72,104,73,105,73,105,73,105,73,105,73,105,73,105,74,106,75,107,107,76,108,76,108,76,108,76,108,76,108,78,110,78,110,78,110,110,78,110,79,111,79,111,79,111,79,111,82,114,82,114,82,114,83,115,83,115,83,115,83,115,84,116,84,116,84,116,85,117,85,117,85,117,85,117,85,117,85,117,87,119,89,121,89,90,122,90,122,90,122,115];function lJ(e){return e<oJ||e>sJ?e:cJ[e-oJ]||e}function uJ(e){let t=[];for(let n=0;n<e.length;n++)t[n]=lJ(e.charCodeAt(n));return String.fromCharCode(...t)}var dJ={ational:`ate`,tional:`tion`,enci:`ence`,anci:`ance`,izer:`ize`,bli:`ble`,alli:`al`,entli:`ent`,eli:`e`,ousli:`ous`,ization:`ize`,ation:`ate`,ator:`ate`,alism:`al`,iveness:`ive`,fulness:`ful`,ousness:`ous`,aliti:`al`,iviti:`ive`,biliti:`ble`,logi:`log`},fJ={icate:`ic`,ative:``,alize:`al`,iciti:`ic`,ical:`ic`,ful:``,ness:``},pJ=`[^aeiou]`,mJ=`[aeiouy]`,hJ=pJ+`[^aeiouy]*`;mJ+``;var gJ=`^(`+hJ+`)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*`,_J=`^(`+hJ+`)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*([aeiouy][aeiou]*)?$`,vJ=`^(`+hJ+`)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*[aeiouy][aeiou]*[^aeiou][^aeiouy]*`,yJ=`^(`+hJ+`)?[aeiouy]`;function bJ(e){let t,n,r,i,a,o;if(e.length<3)return e;let s=e.substring(0,1);if(s==`y`&&(e=s.toUpperCase()+e.substring(1)),r=/^(.+?)(ss|i)es$/,i=/^(.+?)([^s])s$/,r.test(e)?e=e.replace(r,`$1$2`):i.test(e)&&(e=e.replace(i,`$1$2`)),r=/^(.+?)eed$/,i=/^(.+?)(ed|ing)$/,r.test(e)){let t=r.exec(e);r=new RegExp(gJ),r.test(t[1])&&(r=/.$/,e=e.replace(r,``))}else i.test(e)&&(t=i.exec(e)[1],i=new RegExp(yJ),i.test(t)&&(e=t,i=/(at|bl|iz)$/,a=RegExp(`([^aeiouylsz])\\1$`),o=RegExp(`^`+hJ+mJ+`[^aeiouwxy]$`),i.test(e)?e+=`e`:a.test(e)?(r=/.$/,e=e.replace(r,``)):o.test(e)&&(e+=`e`)));if(r=/^(.+?)y$/,r.test(e)&&(t=r.exec(e)?.[1],r=new RegExp(yJ),t&&r.test(t)&&(e=t+`i`)),r=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,r.test(e)){let i=r.exec(e);t=i?.[1],n=i?.[2],r=new RegExp(gJ),t&&r.test(t)&&(e=t+dJ[n])}if(r=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,r.test(e)){let i=r.exec(e);t=i?.[1],n=i?.[2],r=new RegExp(gJ),t&&r.test(t)&&(e=t+fJ[n])}if(r=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,i=/^(.+?)(s|t)(ion)$/,r.test(e))t=r.exec(e)?.[1],r=new RegExp(vJ),t&&r.test(t)&&(e=t);else if(i.test(e)){let n=i.exec(e);t=n?.[1]??``+n?.[2]??``,i=new RegExp(vJ),i.test(t)&&(e=t)}return r=/^(.+?)e$/,r.test(e)&&(t=r.exec(e)?.[1],r=new RegExp(vJ),i=new RegExp(_J),a=RegExp(`^`+hJ+mJ+`[^aeiouwxy]$`),t&&(r.test(t)||i.test(t)&&!a.test(t))&&(e=t)),r=/ll$/,i=new RegExp(vJ),r.test(e)&&i.test(e)&&(r=/.$/,e=e.replace(r,``)),s==`y`&&(e=s.toLowerCase()+e.substring(1)),e}function xJ(e,t,n=!0){let r=`${this.language}:${e}:${t}`;return n&&this.normalizationCache.has(r)?this.normalizationCache.get(r):this.stopWords?.includes(t)?(n&&this.normalizationCache.set(r,``),``):(this.stemmer&&!this.stemmerSkipProperties.has(e)&&(t=this.stemmer(t)),t=uJ(t),n&&this.normalizationCache.set(r,t),t)}function SJ(e){for(;e[e.length-1]===``;)e.pop();for(;e[0]===``;)e.shift();return e}function CJ(e,t,n,r=!0){if(t&&t!==this.language)throw CK(`LANGUAGE_NOT_SUPPORTED`,t);if(typeof e!=`string`)return[e];let i=this.normalizeToken.bind(this,n??``),a;if(n&&this.tokenizeSkipProperties.has(n))a=[i(e,r)];else{let t=WG[this.language];a=e.toLowerCase().split(t).map(e=>i(e,r)).filter(Boolean)}let o=SJ(a);return this.allowDuplicates?o:Array.from(new Set(o))}function wJ(e={}){if(!e.language)e.language=`english`;else if(!GG.includes(e.language))throw CK(`LANGUAGE_NOT_SUPPORTED`,e.language);let t;if(e.stemming||e.stemmer&&!(`stemming`in e))if(e.stemmer){if(typeof e.stemmer!=`function`)throw CK(`INVALID_STEMMER_FUNCTION_TYPE`);t=e.stemmer}else if(e.language===`english`)t=bJ;else throw CK(`MISSING_STEMMER`,e.language);let n;if(e.stopWords!==!1){if(n=[],Array.isArray(e.stopWords))n=e.stopWords;else if(typeof e.stopWords==`function`)n=e.stopWords(n);else if(e.stopWords)throw CK(`CUSTOM_STOP_WORDS_MUST_BE_FUNCTION_OR_ARRAY`);if(!Array.isArray(n))throw CK(`CUSTOM_STOP_WORDS_MUST_BE_FUNCTION_OR_ARRAY`);for(let e of n)if(typeof e!=`string`)throw CK(`CUSTOM_STOP_WORDS_MUST_BE_FUNCTION_OR_ARRAY`)}let r={tokenize:CJ,language:e.language,stemmer:t,stemmerSkipProperties:new Set(e.stemmerSkipProperties?[e.stemmerSkipProperties].flat():[]),tokenizeSkipProperties:new Set(e.tokenizeSkipProperties?[e.tokenizeSkipProperties].flat():[]),stopWords:n,allowDuplicates:!!e.allowDuplicates,normalizeToken:xJ,normalizationCache:new Map};return r.tokenize=CJ.bind(r),r.normalizeToken=xJ,r}function TJ(e){return{sharedInternalDocumentStore:e,rules:new Map}}function EJ(e,t){if(e.rules.has(t.id))throw Error(`PINNING_RULE_ALREADY_EXISTS: A pinning rule with id "${t.id}" already exists. Use updateRule to modify it.`);e.rules.set(t.id,t)}function DJ(e,t){if(!e.rules.has(t.id))throw Error(`PINNING_RULE_NOT_FOUND: Cannot update pinning rule with id "${t.id}" because it does not exist. Use addRule to create it.`);e.rules.set(t.id,t)}function OJ(e,t){return e.rules.delete(t)}function kJ(e,t){return e.rules.get(t)}function AJ(e){return Array.from(e.rules.values())}function jJ(e,t){let n=e.toLowerCase().trim(),r=t.pattern.toLowerCase().trim();switch(t.anchoring){case`is`:return n===r;case`starts_with`:return n.startsWith(r);case`contains`:return n.includes(r);default:return!1}}function MJ(e,t){return e?t.conditions.every(t=>jJ(e,t)):!1}function NJ(e,t){if(!t)return[];let n=[];for(let r of e.rules.values())MJ(t,r)&&n.push(r);return n}function PJ(e,t){return{sharedInternalDocumentStore:e,rules:new Map(t?.rules??[])}}function FJ(e){return{rules:Array.from(e.rules.entries())}}function IJ(){return{create:TJ,addRule:EJ,updateRule:DJ,removeRule:OJ,getRule:kJ,getAllRules:AJ,getMatchingRules:NJ,load:PJ,save:FJ}}function LJ(e){let t={formatElapsedTime:wK,getDocumentIndexId:TK,getDocumentProperties:uK,validateSchema:EK};for(let n of QK){let r=n;if(e[r]){if(typeof e[r]!=`function`)throw CK(`COMPONENT_MUST_BE_FUNCTION`,r)}else e[r]=t[r]}for(let t of Object.keys(e))if(!ZK.includes(t)&&!QK.includes(t))throw CK(`UNSUPPORTED_COMPONENT`,t)}function RJ({schema:e,sort:t,language:n,components:r,id:i,plugins:a}){r||={};for(let t of a??[]){if(!(`getComponents`in t)||typeof t.getComponents!=`function`)continue;let n=t.getComponents(e),i=Object.keys(n);for(let e of i)if(r[e])throw CK(`PLUGIN_COMPONENT_CONFLICT`,e,t.name);r={...r,...n}}i||=oK();let o=r.tokenizer,s=r.index,c=r.documentsStore,l=r.sorter,u=r.pinning;if(o=o?o.tokenize?o:wJ(o):wJ({language:n??`english`}),r.tokenizer&&n)throw CK(`NO_LANGUAGE_WITH_CUSTOM_TOKENIZER`);let d=PK();s||=Lq(),l||=aJ(),c||=JK(),u||=IJ(),LJ(r);let{getDocumentProperties:f,getDocumentIndexId:p,validateSchema:m,formatElapsedTime:h}=r,g={data:{},caches:{},schema:e,tokenizer:o,index:s,sorter:l,documentsStore:c,pinning:u,internalDocumentIDStore:d,getDocumentProperties:f,getDocumentIndexId:p,validateSchema:m,beforeInsert:[],afterInsert:[],beforeRemove:[],afterRemove:[],beforeUpdate:[],afterUpdate:[],beforeUpsert:[],afterUpsert:[],beforeSearch:[],afterSearch:[],beforeInsertMultiple:[],afterInsertMultiple:[],beforeRemoveMultiple:[],afterRemoveMultiple:[],beforeUpdateMultiple:[],afterUpdateMultiple:[],beforeUpsertMultiple:[],afterUpsertMultiple:[],afterCreate:[],formatElapsedTime:h,id:i,plugins:a,version:zJ()};g.data={index:g.index.create(g,d,e),docs:g.documentsStore.create(g,d),sorting:g.sorter.create(g,d,e,t),pinning:g.pinning.create(d)};for(let e of YK)g[e]=(g[e]??[]).concat(XK(g,e));let _=g.afterCreate;return _&&rq(_,g),g}function zJ(){return`{{VERSION}}`}function BJ(e){return e.documentsStore.count(e.data.docs)}function VJ(e,t,n,r,i){let a=e.validateSchema(t,e.schema);if(a)throw CK(`SCHEMA_VALIDATION_FAILURE`,a);return hK(e.beforeInsert)||hK(e.afterInsert)||hK(e.index.beforeInsert)||hK(e.index.insert)||hK(e.index.afterInsert)?WJ(e,t,n,r,i):GJ(e,t,n,r,i)}var HJ=new Set([`enum`,`enum[]`]),UJ=new Set([`string`,`number`]);async function WJ(e,t,n,r,i){let{index:a,docs:o}=e.data,s=e.getDocumentIndexId(t);if(typeof s!=`string`)throw CK(`DOCUMENT_ID_MUST_BE_STRING`,typeof s);let c=LK(e.internalDocumentIDStore,s);if(r||await $K(e.beforeInsert,e,s,t),!e.documentsStore.store(o,s,c,t))throw CK(`DOCUMENT_ALREADY_EXISTS`,s);let l=e.documentsStore.count(o),u=e.index.getSearchableProperties(a),d=e.index.getSearchablePropertiesWithTypes(a),f=e.getDocumentProperties(t,u);for(let[e,t]of Object.entries(f)){if(t===void 0)continue;let n=typeof t,r=d[e];KJ(n,r,e,t)}return await qJ(e,s,u,f,l,n,t,i),r||await $K(e.afterInsert,e,s,t),s}function GJ(e,t,n,r,i){let{index:a,docs:o}=e.data,s=e.getDocumentIndexId(t);if(typeof s!=`string`)throw CK(`DOCUMENT_ID_MUST_BE_STRING`,typeof s);let c=LK(e.internalDocumentIDStore,s);if(r||$K(e.beforeInsert,e,s,t),!e.documentsStore.store(o,s,c,t))throw CK(`DOCUMENT_ALREADY_EXISTS`,s);let l=e.documentsStore.count(o),u=e.index.getSearchableProperties(a),d=e.index.getSearchablePropertiesWithTypes(a),f=e.getDocumentProperties(t,u);for(let[e,t]of Object.entries(f)){if(t===void 0)continue;let n=typeof t,r=d[e];KJ(n,r,e,t)}return JJ(e,s,u,f,l,n,t,i),r||$K(e.afterInsert,e,s,t),s}function KJ(e,t,n,r){if(!(kK(t)&&typeof r==`object`&&typeof r.lon==`number`&&typeof r.lat==`number`)&&!(AK(t)&&Array.isArray(r))&&!(jK(t)&&Array.isArray(r))&&!(HJ.has(t)&&UJ.has(e))&&e!==t)throw CK(`INVALID_DOCUMENT_PROPERTY`,n,t,e)}async function qJ(e,t,n,r,i,a,o,s){for(let o of n){let n=r[o];if(n===void 0)continue;let c=e.index.getSearchablePropertiesWithTypes(e.data.index)[o];await e.index.beforeInsert?.(e.data.index,o,t,n,c,a,e.tokenizer,i);let l=e.internalDocumentIDStore.idToInternalId.get(t);await e.index.insert(e.index,e.data.index,o,t,l,n,c,a,e.tokenizer,i,s),await e.index.afterInsert?.(e.data.index,o,t,n,c,a,e.tokenizer,i)}let c=e.sorter.getSortableProperties(e.data.sorting),l=e.getDocumentProperties(o,c);for(let n of c){let r=l[n];if(r===void 0)continue;let i=e.sorter.getSortablePropertiesWithTypes(e.data.sorting)[n];e.sorter.insert(e.data.sorting,n,t,r,i,a)}}function JJ(e,t,n,r,i,a,o,s){for(let o of n){let n=r[o];if(n===void 0)continue;let c=e.index.getSearchablePropertiesWithTypes(e.data.index)[o],l=LK(e.internalDocumentIDStore,t);e.index.beforeInsert?.(e.data.index,o,t,n,c,a,e.tokenizer,i),e.index.insert(e.index,e.data.index,o,t,l,n,c,a,e.tokenizer,i,s),e.index.afterInsert?.(e.data.index,o,t,n,c,a,e.tokenizer,i)}let c=e.sorter.getSortableProperties(e.data.sorting),l=e.getDocumentProperties(o,c);for(let n of c){let r=l[n];if(r===void 0)continue;let i=e.sorter.getSortablePropertiesWithTypes(e.data.sorting)[n];e.sorter.insert(e.data.sorting,n,t,r,i,a)}}function YJ(e,t,n,r,i,a){return hK(e.afterInsertMultiple)||hK(e.beforeInsertMultiple)||hK(e.index.beforeInsert)||hK(e.index.insert)||hK(e.index.afterInsert)?XJ(e,t,n,r,i,a):ZJ(e,t,n,r,i,a)}async function XJ(e,t,n=1e3,r,i,a=0){let o=[],s=async a=>{let s=Math.min(a+n,t.length),c=t.slice(a,s);for(let t of c){let n=await VJ(e,t,r,i,{avlRebalanceThreshold:c.length});o.push(n)}return s};return await(async()=>{let e=0;for(;e<t.length;){let t=Date.now();if(e=await s(e),a>0){let e=a-(Date.now()-t);e>0&&xK(e)}}})(),i||await eq(e.afterInsertMultiple,e,t),o}function ZJ(e,t,n=1e3,r,i,a=0){let o=[],s=0;function c(){let a=t.slice(s*n,(s+1)*n);if(a.length===0)return!1;for(let t of a){let n=VJ(e,t,r,i,{avlRebalanceThreshold:a.length});o.push(n)}return s++,!0}function l(){let e=Date.now();for(;c();)if(a>0){let t=Date.now()-e;if(t>=a){let e=a-t%a;e>0&&xK(e)}}}return l(),i||eq(e.afterInsertMultiple,e,t),o}function QJ(e,t){return e[1]-t[1]}function $J(e,t){return t[1]-e[1]}function eY(e=`desc`){return e.toLowerCase()===`asc`?QJ:$J}function tY(e,t,n){let r={},i=t.map(([e])=>e),a=e.documentsStore.getMultiple(e.data.docs,i),o=Object.keys(n),s=e.index.getSearchablePropertiesWithTypes(e.data.index);for(let e of o){let t;if(s[e]===`number`){let{ranges:r}=n[e],i=r.length,a=Array.from({length:i});for(let e=0;e<i;e++){let t=r[e];a[e]=[`${t.from}-${t.to}`,0]}t=Object.fromEntries(a)}r[e]={count:0,values:t??{}}}let c=a.length;for(let e=0;e<c;e++){let t=a[e];for(let e of o){let i=e.includes(`.`)?dK(t,e):t[e],a=s[e],o=r[e].values;switch(a){case`number`:{let t=n[e].ranges;nY(t,o)(i);break}case`number[]`:{let t=new Set,r=n[e].ranges,a=nY(r,o,t);for(let e of i)a(e);break}case`boolean`:case`enum`:case`string`:rY(o,a)(i);break;case`boolean[]`:case`enum[]`:case`string[]`:{let e=rY(o,a===`boolean[]`?`boolean`:`string`,new Set);for(let t of i)e(t);break}default:throw CK(`FACET_NOT_SUPPORTED`,a)}}}for(let e of o){let t=r[e];if(t.count=Object.keys(t.values).length,s[e]===`string`){let r=n[e],i=eY(r.sort);t.values=Object.fromEntries(Object.entries(t.values).sort(i).slice(r.offset??0,r.limit??10))}}return r}function nY(e,t,n){return r=>{for(let i of e){let e=`${i.from}-${i.to}`;n?.has(e)||r>=i.from&&r<=i.to&&(t[e]===void 0?t[e]=1:(t[e]++,n?.add(e)))}}}function rY(e,t,n){let r=t===`boolean`?`false`:``;return t=>{let i=t?.toString()??r;n?.has(i)||(e[i]=(e[i]??0)+1,n?.add(i))}}var iY={reducer:(e,t,n,r)=>(t[r]=n,t),getInitialValue:e=>Array.from({length:e})},aY=[`string`,`number`,`boolean`];function oY(e,t,n){let r=n.properties,i=r.length,a=e.index.getSearchablePropertiesWithTypes(e.data.index);for(let e=0;e<i;e++){let t=r[e];if(a[t]===void 0)throw CK(`UNKNOWN_GROUP_BY_PROPERTY`,t);if(!aY.includes(a[t]))throw CK(`INVALID_GROUP_BY_PROPERTY`,t,aY.join(`, `),a[t])}let o=t.map(([t])=>RK(e.internalDocumentIDStore,t)),s=e.documentsStore.getMultiple(e.data.docs,o),c=s.length,l=n.maxResult||2**53-1,u=[],d={};for(let e=0;e<i;e++){let t=r[e],n={property:t,perValue:{}},i=new Set;for(let e=0;e<c;e++){let r=s[e],a=dK(r,t);if(a===void 0)continue;let o=typeof a==`boolean`?``+a:a,c=n.perValue[o]??{indexes:[],count:0};c.count>=l||(c.indexes.push(e),c.count++,n.perValue[o]=c,i.add(a))}u.push(Array.from(i)),d[t]=n}let f=sY(u),p=f.length,m=[];for(let e=0;e<p;e++){let t=f[e],n=t.length,i={values:[],indexes:[]},a=[];for(let e=0;e<n;e++){let n=t[e],o=r[e];a.push(d[o].perValue[typeof n==`boolean`?``+n:n].indexes),i.values.push(n)}i.indexes=lK(a).sort((e,t)=>e-t),i.indexes.length!==0&&m.push(i)}let h=m.length,g=Array.from({length:h});for(let e=0;e<h;e++){let r=m[e],i=n.reduce||iY,a=r.indexes.map(e=>({id:o[e],score:t[e][1],document:s[e]})),c=i.reducer.bind(null,r.values),l=i.getInitialValue(r.indexes.length),u=a.reduce(c,l);g[e]={values:r.values,result:u}}return g}function sY(e,t=0){if(t+1===e.length)return e[t].map(e=>[e]);let n=e[t],r=sY(e,t+1),i=[];for(let e of n)for(let t of r){let n=[e];$G(n,t),i.push(n)}return i}function cY(e,t,n,r){let i=NJ(t,r);if(i.length===0)return n;let a=i.flatMap(e=>e.consequence.promote);a.sort((e,t)=>e.position-t.position);let o=new Set,s=new Map,c=new Set;for(let t of a){let n=LK(e.internalDocumentIDStore,t.doc_id);if(n!==void 0){if(s.has(n)){let e=s.get(n);t.position<e&&s.set(n,t.position);continue}c.has(t.position)||(o.add(n),s.set(n,t.position),c.add(t.position))}}if(s.size===0)return n;let l=n.filter(([e])=>!o.has(e)),u=[];for(let[t,r]of s.entries())n.find(([e])=>e===t)?u.push([t,1e6-r]):e.documentsStore.get(e.data.docs,t)&&u.push([t,0]);u.sort((e,t)=>(s.get(e[0])??1/0)-(s.get(t[0])??1/0));let d=[],f=new Map;for(let e of u){let t=s.get(e[0]);f.set(t,e)}let p=0,m=0;for(;m<l.length+u.length;)if(f.has(m))d.push(f.get(m)),m++;else if(p<l.length)d.push(l[p]),p++,m++;else break;for(let[e,t]of f.entries())e>=d.length&&d.push(t);return d}function lY(e,t,n){let{term:r,properties:i}=t,a=e.data.index,o=e.caches.propertiesToSearch;if(!o){let t=e.index.getSearchablePropertiesWithTypes(a);o=e.index.getSearchableProperties(a),o=o.filter(e=>t[e].startsWith(`string`)),e.caches.propertiesToSearch=o}if(i&&i!==`*`){for(let e of i)if(!o.includes(e))throw CK(`UNKNOWN_INDEX`,e,o.join(`, `));o=o.filter(e=>i.includes(e))}let s=Object.keys(t.where??{}).length>0,c;s&&(c=e.index.searchByWhereClause(a,e.tokenizer,t.where,n));let l,u=t.threshold!==void 0&&t.threshold!==null?t.threshold:1;if(r||i){let i=BJ(e);if(l=e.index.search(a,r||``,e.tokenizer,n,o,t.exact||!1,t.tolerance||0,t.boost||{},mY(t.relevance),i,c,u),t.exact&&r){let t=r.trim().split(/\s+/);l=l.filter(([n])=>{let r=e.documentsStore.get(e.data.docs,n);if(!r)return!1;for(let e of o){let n=dY(r,e);if(typeof n==`string`&&t.every(e=>RegExp(`\\b${uY(e)}\\b`).test(n)))return!0}return!1})}}else l=s?Vq(a,t.where)||(c?Array.from(c):[]).map(e=>[+e,0]):Object.keys(e.documentsStore.getAll(e.data.docs)).map(e=>[+e,0]);return l}function uY(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function dY(e,t){let n=t.split(`.`),r=e;for(let e of n)if(r&&typeof r==`object`&&e in r)r=r[e];else return;return r}function fY(e,t,n){let r=aK();function i(){let i=Object.keys(e.data.index.vectorIndexes),a=t.facets&&Object.keys(t.facets).length>0,{limit:o=10,offset:s=0,distinctOn:c,includeVectors:l=!1}=t,u=t.preflight===!0,d=lY(e,t,n);if(t.sortBy)if(typeof t.sortBy==`function`){let n=d.map(([e])=>e),r=e.documentsStore.getMultiple(e.data.docs,n).map((e,t)=>[d[t][0],d[t][1],e]);r.sort(t.sortBy),d=r.map(([e,t])=>[e,t])}else d=e.sorter.sortBy(e.data.sorting,d,t.sortBy).map(([t,n])=>[LK(e.internalDocumentIDStore,t),n]);else d=d.sort(cK);d=cY(e,e.data.pinning,d,t.term);let f;u||(f=c?EY(e,d,s,o,c):DY(e,d,s,o));let p={elapsed:{formatted:``,raw:0},hits:[],count:d.length};return f!==void 0&&(p.hits=f.filter(Boolean),l||mK(p,i)),a&&(p.facets=tY(e,d,t.facets)),t.groupBy&&(p.groups=oY(e,d,t.groupBy)),p.elapsed=e.formatElapsedTime(aK()-r),p}async function a(){e.beforeSearch&&await nq(e.beforeSearch,e,t,n);let r=i();return e.afterSearch&&await tq(e.afterSearch,e,t,n,r),r}return e.beforeSearch?.length||e.afterSearch?.length?a():i()}var pY={k:1.2,b:.75,d:.5};function mY(e){let t=e??{};return t.k=t.k??pY.k,t.b=t.b??pY.b,t.d=t.d??pY.d,t}function hY(e,t,n){let r=t.vector;if(r&&(!(`value`in r)||!(`property`in r)))throw CK(`INVALID_VECTOR_INPUT`,Object.keys(r).join(`, `));let i=e.data.index.vectorIndexes[r.property];if(!i)throw CK(`UNKNOWN_VECTOR_PROPERTY`,r.property);let a=i.node.size;if(r?.value.length!==a)throw r?.property===void 0||r?.value.length===void 0?CK(`INVALID_INPUT_VECTOR`,`undefined`,a,`undefined`):CK(`INVALID_INPUT_VECTOR`,r.property,a,r.value.length);let o=e.data.index,s;return Object.keys(t.where??{}).length>0&&(s=e.index.searchByWhereClause(o,e.tokenizer,t.where,n)),i.node.find(r.value,t.similarity??.8,s)}function gY(e,t,n=`english`){let r=aK();function i(){let i=hY(e,t,n).sort(cK);i=cY(e,e.data.pinning,i,void 0);let a=[];t.facets&&Object.keys(t.facets).length>0&&(a=tY(e,i,t.facets));let o=t.vector.property,s=t.includeVectors??!1,c=t.limit??10,l=t.offset??0,u=Array.from({length:c});for(let t=0;t<c;t++){let n=i[t+l];if(!n)break;let r=e.data.docs.docs[n[0]];r&&(s||(r[o]=null),u[t]={id:RK(e.internalDocumentIDStore,n[0]),score:n[1],document:r})}let d=[];t.groupBy&&(d=oY(e,i,t.groupBy));let f=aK()-r;return{count:i.length,hits:u.filter(Boolean),elapsed:{raw:Number(f),formatted:iK(f)},...a?{facets:a}:{},...d?{groups:d}:{}}}async function a(){e.beforeSearch&&await nq(e.beforeSearch,e,t,n);let r=i();return e.afterSearch&&await tq(e.afterSearch,e,t,n,r),r}return e.beforeSearch?.length||e.afterSearch?.length?a():i()}function _Y(e,t,n){let r=bY(lY(e,t,n)),i=hY(e,t,n),a=t.hybridWeights;return CY(r,i,t.term??``,a)}function vY(e,t,n){let r=aK();function i(){let i=_Y(e,t,n);i=cY(e,e.data.pinning,i,t.term);let a;t.facets&&Object.keys(t.facets).length>0&&(a=tY(e,i,t.facets));let o;t.groupBy&&(o=oY(e,i,t.groupBy));let s=t.offset??0,c=t.limit??10,l=DY(e,i,s,c).filter(Boolean),u=aK(),d={count:i.length,elapsed:{raw:Number(u-r),formatted:iK(u-r)},hits:l,...a?{facets:a}:{},...o?{groups:o}:{}};return(t.includeVectors??!1)||mK(d,Object.keys(e.data.index.vectorIndexes)),d}async function a(){e.beforeSearch&&await nq(e.beforeSearch,e,t,n);let r=i();return e.afterSearch&&await tq(e.afterSearch,e,t,n,r),r}return e.beforeSearch?.length||e.afterSearch?.length?a():i()}function yY(e){return e[1]}function bY(e){let t=Math.max.apply(Math,e.map(yY));return e.map(([e,n])=>[e,n/t])}function xY(e,t){return e/t}function SY(e,t){return(n,r)=>n*e+r*t}function CY(e,t,n,r){let i=Math.max.apply(Math,e.map(yY)),a=Math.max.apply(Math,t.map(yY)),{text:o,vector:s}=r&&r.text&&r.vector?r:wY(n),c=new Map,l=e.length,u=SY(o,s);for(let t=0;t<l;t++){let[n,r]=e[t],a=u(xY(r,i),0);c.set(n,a)}let d=t.length;for(let e=0;e<d;e++){let[n,r]=t[e],i=xY(r,a),o=c.get(n)??0;c.set(n,o+u(0,i))}return[...c].sort((e,t)=>t[1]-e[1])}function wY(e){return{text:.5,vector:.5}}function TY(e,t,n){let r=t.mode??`fulltext`;if(r===`fulltext`)return fY(e,t,n);if(r===`vector`)return gY(e,t);if(r===`hybrid`)return vY(e,t);throw CK(`INVALID_SEARCH_MODE`,r)}function EY(e,t,n,r,i){let a=e.data.docs,o=new Map,s=[],c=new Set,l=t.length,u=0;for(let d=0;d<l;d++){let l=t[d];if(l===void 0)continue;let[f,p]=l;if(c.has(f))continue;let m=e.documentsStore.get(a,f),h=dK(m,i);if(!(h===void 0||o.has(h))&&(o.set(h,!0),u++,!(u<=n)&&(s.push({id:RK(e.internalDocumentIDStore,f),score:p,document:m}),c.add(f),u>=n+r)))break}return s}function DY(e,t,n,r){let i=e.data.docs,a=Array.from({length:r}),o=new Set;for(let s=n;s<r+n;s++){let n=t[s];if(n===void 0)break;let[r,c]=n;if(!o.has(r)){let t=e.documentsStore.get(i,r);a[s]={id:RK(e.internalDocumentIDStore,r),score:c,document:t},o.add(r)}}return a}var OY=r(HG(),1),kY=Eo({at:P(),transport:P(),outcome:P(),reference:P().optional(),error:P().optional()}),AY=Eo({reason:P(),at:P()});Eo({version:F().int().catch(1),id:P(),createdAt:P(),bundleLevel:P(),zipBytes:F().int().nonnegative().catch(0),zipDeleted:I().optional(),state:P(),systemWide:I().optional(),projectSlug:P().nullable().optional(),reference:P().optional(),lastError:AY.optional(),attempts:L(kY).optional(),note:P().optional()});var jY=`0.0.0-unknown`,MY={protocol:`x-ok-client-protocol`,runtime:`x-ok-client-runtime`,kind:`x-ok-client-kind`};function NY({kind:e,runtimeVersion:t}){return{[MY.protocol]:`1`,[MY.runtime]:t,[MY.kind]:e}}function PY({kind:e,runtimeVersion:t}){return{clientProtocolVersion:1,clientRuntimeVersion:t,clientKind:e}}var FY=`extra/screenshot.png`,IY=[{name:`macos-home-path`,regex:/\/Users\/[^/]+\//g,replacement:`~/`},{name:`linux-home-path`,regex:/\/home\/[^/]+\//g,replacement:`~/`},{name:`github-pat`,regex:/\b(ghp_|gho_|ghu_|ghs_|ghr_)[A-Za-z0-9]{36,}\b/g,replacement:`[REDACTED-GH-PAT]`},{name:`aws-access-key`,regex:/\b(AKIA|ASIA|ABIA)[A-Z2-7]{16}\b/g,replacement:`[REDACTED-AWS-KEY]`},{name:`anthropic-key`,regex:/\bsk-ant-api03-[A-Za-z0-9_-]{20,}\b/g,replacement:`[REDACTED-ANTHROPIC]`},{name:`openai-key`,regex:/\bsk-[A-Za-z0-9]{20,}\b/g,replacement:`[REDACTED-OPENAI]`},{name:`bearer-token`,regex:/([Aa]uthorization:\s*[Bb]earer\s+)\S+/g,replacement:`$1[REDACTED]`},{name:`jwt`,regex:/eyJ[A-Za-z0-9_-]{8,}\.eyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}/g,replacement:`[REDACTED-JWT]`},{name:`url-credentials`,regex:/:\/\/[^/\s:@]+:[^/\s:@]+@/g,replacement:`://[REDACTED]@`},{name:`github-pat-fine-grained`,regex:/\bgithub_pat_[0-9A-Za-z_]{20,}/g,replacement:`[REDACTED-GH-PAT]`},{name:`openai-key-modern`,regex:/\bsk-(?:proj|svcacct|admin|None)-[A-Za-z0-9_-]{20,}/g,replacement:`[REDACTED-OPENAI]`},{name:`slack-token`,regex:/\bxox[a-z]-[A-Za-z0-9-]{10,}/g,replacement:`[REDACTED-SLACK]`},{name:`google-api-key`,regex:/\bAIza[0-9A-Za-z_-]{35}/g,replacement:`[REDACTED-GOOGLE]`},{name:`stripe-secret-key`,regex:/\b(?:sk|rk)_live_[0-9A-Za-z]{16,}\b/g,replacement:`[REDACTED-STRIPE]`},{name:`gitlab-pat`,regex:/\bglpat-[0-9A-Za-z_-]{20,}/g,replacement:`[REDACTED-GITLAB]`},{name:`bearer-token-json`,regex:/("[Aa]uthorization"\s*:\s*"[Bb]earer\s+)[^"]+/g,replacement:`$1[REDACTED]`}];IY.map(e=>e.name);function LY(e){let t=new Set,n=0;return{redacted:e.split(`
402
- `).map(e=>{let r=e,i=!1;for(let{name:e,regex:n,replacement:a}of IY)n.lastIndex=0,n.test(r)&&(t.add(e),i=!0,n.lastIndex=0,r=r.replace(n,a));return i&&n++,r}).join(`
403
- `),patterns:[...t],lineCount:n}}function RY(e){return LY(e).redacted}var zY=8192,BY=32768,VY=`…[truncated]`;function HY(e){let t=e.trim();if(t.length===0||t[0]!==`{`)return null;let n;try{n=JSON.parse(t)}catch{return null}if(typeof n!=`object`||!n||Array.isArray(n))return null;let r=n;return{event:typeof r.event==`string`?r.event:void 0,fields:r}}function UY(e){return e.length<=8192?e:`${e.slice(0,zY-12)}${VY}`}function WY(e,t){return!(e.host===`desktop`&&t.host!==`desktop`||e.singleFileHidden&&t.singleFile||e.requiresTerminalLive&&!t.terminalLive||e.requiresCanExpandAll&&!t.canExpandAll||e.requiresCanCollapseAll&&!t.canCollapseAll||e.requiresActiveDoc&&!t.hasActiveDoc||e.requiresInstallSkill&&!t.showInstallSkill||e.requiresTargetKinds&&!e.requiresTargetKinds.includes(t.activeTargetKind))}var GY=[{id:`navigate-back`,menuActionId:`navigate-back`,labelKey:`back`,keywords:[`previous history`],shortcutId:`navigate-back`,shortcutDesktopOnly:!0,availability:{host:`desktop`},palette:{group:`commands`,visibility:`search-only`},menu:[{section:`view-history`,order:0,platform:`mac`,accelerator:`Cmd+[`},{section:`view-history`,order:0,platform:`other`,accelerator:`Alt+Left`}]},{id:`navigate-forward`,menuActionId:`navigate-forward`,labelKey:`forward`,keywords:[`next history`],shortcutId:`navigate-forward`,shortcutDesktopOnly:!0,availability:{host:`desktop`},palette:{group:`commands`,visibility:`search-only`},menu:[{section:`view-history`,order:1,platform:`mac`,accelerator:`Cmd+]`},{section:`view-history`,order:1,platform:`other`,accelerator:`Alt+Right`}]},{id:`new-file`,menuActionId:`new-doc`,labelKey:`newFile`,keywords:[`create file`],shortcutId:`new-item`,availability:{},palette:{group:`commands`,visibility:`always`},menu:[{section:`file-create`,order:0,accelerator:`CmdOrCtrl+N`}]},{id:`new-folder`,menuActionId:`new-folder`,labelKey:`newFolder`,keywords:[`create folder`],shortcutId:`new-folder`,shortcutDesktopOnly:!0,availability:{},palette:{group:`commands`,visibility:`always`},menu:[{section:`file-create`,order:1,accelerator:`CmdOrCtrl+Shift+N`}]},{id:`open-graph`,labelKey:`openGraph`,keywords:[`graph panel network`],availability:{requiresActiveDoc:!0},palette:{group:`commands`,visibility:`always`}},{id:`initialize-starter-pack`,labelKey:`initializeStarterPack`,keywords:[`scaffold`,`seed`,`pack`,`starter`],availability:{},palette:{group:`commands`,visibility:`always`}},{id:`new-project`,menuActionId:`new-project`,labelKey:`newProject`,keywords:[`create new project scaffold`],availability:{host:`desktop`},palette:{group:`project`,visibility:`always`},menu:[{section:`file-project`,order:0,ellipsis:!0}]},{id:`open-folder`,labelKey:`openFolderOnDisk`,keywords:[`project`,`folder`,`disk`],shortcutId:`open-folder`,availability:{host:`desktop`},palette:{group:`project`,visibility:`always`},menu:[{section:`file-project`,order:2,accelerator:`CmdOrCtrl+O`,ellipsis:!0,menuLabelKey:`openFolder`}]},{id:`open-file`,labelKey:`openFileOnDisk`,keywords:[`file`,`markdown`,`single`,`standalone`,`temporary`],shortcutId:`open-file`,availability:{host:`desktop`},palette:{group:`project`,visibility:`always`},menu:[{section:`file-project`,order:3,accelerator:`CmdOrCtrl+Shift+O`,ellipsis:!0,menuLabelKey:`openFile`}]},{id:`switch-project`,labelKey:`switchProject`,keywords:[`switch project navigator projects`],shortcutId:`switch-project`,availability:{host:`desktop`,singleFileHidden:!0},palette:{group:`project`,visibility:`always`},menu:[{section:`file-project`,order:1,accelerator:`CmdOrCtrl+Shift+P`,ellipsis:!0}]},{id:`settings`,labelKey:`settings`,keywords:[`preferences config`],shortcutId:`settings`,availability:{singleFileHidden:!0},palette:{group:`project`,visibility:`always`},menu:[{section:`app-settings`,order:0,platform:`mac`,accelerator:`CmdOrCtrl+,`,ellipsis:!0},{section:`file-settings`,order:0,platform:`other`,accelerator:`CmdOrCtrl+,`,ellipsis:!0}]},{id:`install-claude-desktop`,labelKey:`installClaudeDesktop`,keywords:[`claude desktop install cowork`],availability:{requiresInstallSkill:!0},palette:{group:`project`,visibility:`always`},menu:[{section:`help-install`,order:0,ellipsis:!0,menuLabelText:`Install for Claude Chat & Cowork (desktop app)`}]},{id:`report-bug`,menuActionId:`report-bug`,labelKey:`reportBug`,keywords:[`bug report issue feedback problem`],availability:{host:`desktop`},palette:{group:`project`,visibility:`always`},menu:[{section:`help-links`,order:1,ellipsis:!0}]},{id:`bug-report-history`,labelKey:`bugReportHistory`,keywords:[`bug report history previous reports past retry resend`],availability:{host:`desktop`},palette:{group:`project`,visibility:`always`}},{id:`send-feedback`,menuActionId:`send-feedback`,labelKey:`sendFeedback`,keywords:[`feedback`,`suggestion`,`idea`,`rate`,`survey`,`contact`],availability:{},palette:{group:`project`,visibility:`always`},menu:[{section:`help-links`,order:2,ellipsis:!0}]},{id:`new-from-template`,menuActionId:`new-from-template`,labelKey:`newFromTemplate`,keywords:[`template`,`create`,`new`],availability:{singleFileHidden:!0},palette:{group:`file`,visibility:`search-only`},menu:[{section:`file-create`,order:2,ellipsis:!0}]},{id:`rename`,menuActionId:`rename`,labelKey:`rename`,keywords:[`rename`,`file`,`folder`],availability:{host:`desktop`,requiresTargetKinds:[`doc`,`folder`,`asset`]},palette:{group:`file`,visibility:`search-only`},menu:[{section:`file-item`,order:1}]},{id:`duplicate`,menuActionId:`duplicate`,labelKey:`duplicate`,keywords:[`duplicate`,`copy`,`file`,`folder`],shortcutId:`file-tree-duplicate`,availability:{host:`desktop`,requiresTargetKinds:[`doc`,`folder`]},palette:{group:`file`,visibility:`search-only`},menu:[{section:`file-item`,order:0,accelerator:`CmdOrCtrl+D`}]},{id:`move-to-trash`,menuActionId:`move-to-trash`,labelKey:`moveToTrash`,keywords:[`delete`,`trash`,`remove`],shortcutId:`file-tree-delete`,availability:{host:`desktop`,requiresTargetKinds:[`doc`,`folder`,`asset`]},palette:{group:`file`,visibility:`search-only`},menu:[{section:`file-item`,order:2,accelerator:`CmdOrCtrl+Delete`}]},{id:`reveal-in-finder`,menuActionId:`reveal-in-finder`,labelKey:`revealInFinder`,keywords:[`finder`,`reveal`,`show`,`file`],availability:{host:`desktop`,requiresTargetKinds:[`doc`,`folder`,`asset`,`project`]},palette:{group:`file`,visibility:`search-only`},menu:[{section:`file-reveal`,order:0}]},{id:`send-to-ai`,menuActionId:`send-to-ai`,labelKey:`openWithAi`,keywords:[`ai`,`agent`,`handoff`],availability:{host:`desktop`,requiresTargetKinds:[`doc`,`folder`,`project`]},menu:[{section:`file-reveal`,order:1}]},{id:`copy-full-path`,menuActionId:`copy-full-path`,labelKey:`copyFullPath`,keywords:[`copy`,`path`,`absolute`,`full`],availability:{host:`desktop`,requiresTargetKinds:[`doc`,`folder`,`asset`,`project`]},palette:{group:`file`,visibility:`search-only`},menu:[{section:`file-copy-path`,order:0,menuLabelKey:`fullPath`}]},{id:`copy-relative-path`,menuActionId:`copy-relative-path`,labelKey:`copyRelativePath`,keywords:[`copy`,`path`,`relative`],availability:{host:`desktop`,requiresTargetKinds:[`doc`,`folder`,`asset`,`project`]},palette:{group:`file`,visibility:`search-only`},menu:[{section:`file-copy-path`,order:1,menuLabelKey:`relativePath`}]},{id:`close-tab`,menuActionId:`close-active-tab-or-window`,labelKey:`closeTab`,keywords:[`close`,`tab`,`window`],availability:{host:`desktop`},palette:{group:`file`,visibility:`search-only`},menu:[{section:`file-close`,order:0,platform:`mac`,accelerator:`CmdOrCtrl+W`}]},{id:`new-worktree`,menuActionId:`new-worktree`,labelKey:`newWorktree`,keywords:[`worktree`,`branch`,`new`],availability:{host:`desktop`},palette:{group:`file`,visibility:`search-only`},menu:[{section:`file-worktree`,order:0,ellipsis:!0}]},{id:`switch-worktree`,menuActionId:`switch-worktree`,labelKey:`switchWorktree`,keywords:[`worktree`,`switch`,`branch`],availability:{host:`desktop`},palette:{group:`file`,visibility:`search-only`},menu:[{section:`file-worktree`,order:1,ellipsis:!0}]},{id:`toggle-sidebar`,menuActionId:`toggle-sidebar`,labelKey:`sidebarHide`,keywords:[`sidebar`,`files`,`panel`,`toggle`],shortcutId:`toggle-files-sidebar`,stateToggle:{showKey:`sidebarShow`,hideKey:`sidebarHide`,stateField:`sidebarVisible`,defaultVisible:!0},availability:{},palette:{group:`view`,visibility:`search-only`},menu:[{section:`view-panels`,order:0,accelerator:`CmdOrCtrl+Alt+S`}]},{id:`toggle-doc-panel`,menuActionId:`toggle-doc-panel`,labelKey:`docPanelHide`,keywords:[`document`,`panel`,`info`,`toggle`],shortcutId:`toggle-document-panel`,stateToggle:{showKey:`docPanelShow`,hideKey:`docPanelHide`,stateField:`docPanelVisible`,defaultVisible:!0},availability:{},palette:{group:`view`,visibility:`search-only`},menu:[{section:`view-panels`,order:1,accelerator:`CmdOrCtrl+Alt+B`}]},{id:`toggle-terminal`,menuActionId:`toggle-terminal`,labelKey:`terminalShow`,keywords:[`terminal`,`shell`,`console`,`toggle`],shortcutId:`toggle-terminal-panel`,stateToggle:{showKey:`terminalShow`,hideKey:`terminalHide`,stateField:`terminalVisible`,defaultVisible:!1},availability:{host:`desktop`},palette:{group:`view`,visibility:`search-only`},menu:[{section:`view-panels`,order:2,accelerator:`CmdOrCtrl+J`}]},{id:`toggle-show-hidden-files`,menuActionId:`toggle-show-hidden-files`,labelKey:`showHiddenFiles`,keywords:[`hidden`,`dotfiles`,`files`,`show`],checkField:`showHiddenFiles`,availability:{},palette:{group:`view`,visibility:`search-only`},menu:[{section:`view-visibility`,order:0,accelerator:`CmdOrCtrl+Shift+.`,checkbox:!0}]},{id:`toggle-show-ok-folders`,menuActionId:`toggle-show-ok-folders`,labelKey:`showOkFolders`,keywords:[`ok`,`folders`,`hidden`,`show`],checkField:`showOkFolders`,availability:{},palette:{group:`view`,visibility:`search-only`},menu:[{section:`view-visibility`,order:1,checkbox:!0}]},{id:`toggle-show-only-markdown-files`,menuActionId:`toggle-show-only-markdown-files`,labelKey:`showOnlyMarkdownFiles`,keywords:[`markdown`,`filter`,`files`,`only`],checkField:`showOnlyMarkdownFiles`,availability:{},palette:{group:`view`,visibility:`search-only`},menu:[{section:`view-visibility`,order:2,checkbox:!0}]},{id:`toggle-show-skills-section`,menuActionId:`toggle-show-skills-section`,labelKey:`showSkillsSection`,keywords:[`skills`,`section`,`sidebar`,`show`],checkField:`showSkillsSection`,availability:{},palette:{group:`view`,visibility:`search-only`},menu:[{section:`view-visibility`,order:3,checkbox:!0}]},{id:`expand-all-tree`,menuActionId:`expand-all-tree`,labelKey:`expandAll`,keywords:[`expand`,`tree`,`folders`,`all`],availability:{requiresCanExpandAll:!0},palette:{group:`view`,visibility:`search-only`},menu:[{section:`view-tree`,order:0,smartHide:!0}]},{id:`collapse-all-tree`,menuActionId:`collapse-all-tree`,labelKey:`collapseAll`,keywords:[`collapse`,`tree`,`folders`,`all`],availability:{requiresCanCollapseAll:!0},palette:{group:`view`,visibility:`search-only`},menu:[{section:`view-tree`,order:1,smartHide:!0}]},{id:`new-terminal`,menuActionId:`new-terminal`,labelKey:`newTerminal`,keywords:[`terminal`,`shell`,`new`,`tab`],availability:{host:`desktop`},palette:{group:`terminal`,visibility:`search-only`},menu:[{section:`terminal`,order:0}]},{id:`new-terminal-window`,keywords:[],availability:{host:`desktop`},menu:[{section:`terminal`,order:1,menuLabelText:`New Terminal Window`}]},{id:`kill-terminal`,menuActionId:`kill-terminal`,labelKey:`killTerminal`,keywords:[`terminal`,`kill`,`close`,`session`],availability:{host:`desktop`,requiresTerminalLive:!0},palette:{group:`terminal`,visibility:`search-only`},menu:[{section:`terminal`,order:2}]},{id:`check-for-updates`,labelKey:`checkForUpdates`,keywords:[`update`,`upgrade`,`version`,`check`],availability:{host:`desktop`},palette:{group:`app`,visibility:`search-only`},menu:[{section:`app-updates`,order:0,platform:`mac`,ellipsis:!0},{section:`help-updates`,order:0,platform:`other`,ellipsis:!0}]},{id:`set-up-integrations`,labelKey:`setUpIntegrations`,keywords:[`integrations`,`mcp`,`setup`,`claude`,`configure`],availability:{host:`desktop`},palette:{group:`app`,visibility:`search-only`},menu:[{section:`file-integrations`,order:0,ellipsis:!0}]},{id:`toggle-spell-check`,labelKey:`checkSpelling`,keywords:[`spell`,`spelling`,`check`,`typing`],availability:{host:`desktop`},palette:{group:`app`,visibility:`search-only`},menu:[{section:`edit-spell`,order:0,checkbox:!0}]},{id:`open-github`,labelKey:`openOnGithub`,keywords:[`github`,`source`,`repository`,`code`],availability:{},palette:{group:`app`,visibility:`search-only`},menu:[{section:`help-links`,order:0}]},{id:`uninstall`,keywords:[],availability:{host:`desktop`},menu:[{section:`app-uninstall`,order:0,platform:`mac`,ellipsis:!0,menuLabelText:`Uninstall OpenKnowledge`}]}],KY=`source`;function qY(e){return{ok:!1,error:e}}function JY(e){return{ok:!0,...e}}function YY(){return Tf.parse({})}function XY(e,t){let n=e.toString();if(n.length===0)return YY();let r=Qu(n);if(r.errors.length>0)return console.warn(`[bindConfigDoc:${t}] Y.Text contains invalid YAML; returning schema defaults. Errors: ${r.errors.map(e=>e.message).join(`; `)}`),YY();let i=r.toJSON()??{},a=Tf.safeParse(i);return a.success?a.data:(console.warn(`[bindConfigDoc:${t}] Y.Text content fails schema validation; returning schema defaults. First issue: ${a.error.issues[0]?.message??`(unknown)`}`),YY())}function ZY(e,t,n={}){return Df(`config.bind`,{"config.scope":t,"config.transport":`ytext`},()=>QY(e,t,n))}function QY(e,t,n){let{ytextKey:r=KY}=n,i=e.document,a=i.getText(r),o=new Set,s=new Set,c=!1,l=!1;function u(){if(c)return;let e=XY(a,t);for(let n of o)try{n(e)}catch(e){console.warn(`[bindConfigDoc:${t}] listener threw:`,e)}}function d(){if(c||(u(),l))return;l=!0;let e=[...s];s.clear();for(let n of e)try{n()}catch(e){console.warn(`[bindConfigDoc:${t}] synced listener threw:`,e)}}a.observe(u),e.on(`synced`,d);function f(e){if(c)return qY({code:`WRITE_ERROR`,detail:`ConfigBinding (${t}) has been disposed`});let n=Nf(e,t);if(n!==null)return qY(n);let r=Qu(a.toString()),o=r.contents!==null&&!Ss(r.contents);if(r.errors.length>0||o){Of(`config.corrupt-ytext-reset`,{"config.scope":t,"config.parse.errorCount":r.errors.length,"config.parse.topLevelNonMap":o});let e=r.errors.length>0?r.errors.map(e=>e.message).join(`; `):`top-level YAML is not a mapping`;console.warn(`[bindConfigDoc:${t}] dropping corrupt Y.Text and re-applying patch onto empty doc. Reason: ${e}`),r=Qu(``)}r.contents===null&&(r.contents=r.createNode({}));let s=Ff(r,e),l=r.toJSON()??{},u=Df(`config.validate`,{"config.scope":t,"config.validation.layer":`L1`},e=>{let t=Tf.safeParse(l);if(e.setAttribute(`config.outcome`,t.success?`success`:`rejected`),!t.success)for(let e of t.error.issues)Of(`config.validation.issue`,{"issue.path":e.path.map(e=>String(e)).join(`.`),"issue.message":e.message});return t});if(!u.success)return qY({code:`SCHEMA_INVALID`,issues:u.error.issues.map(If)});let d=r.toString();return i.transact(()=>{a.length>0&&a.delete(0,a.length),a.insert(0,d)}),JY({effective:u.data,appliedPaths:s})}return{current(){return XY(a,t)},patch(e){return Df(`config.patch`,{"config.scope":t,"config.transport":`ytext`},t=>{let n=f(e);return t.setAttribute(`config.outcome`,n.ok?`success`:`rejected`),n.ok||t.setAttribute(`config.error.code`,n.error.code),n})},subscribe(e){return o.add(e),()=>{o.delete(e)}},hasSynced(){return l},subscribeSynced(e){if(c)return()=>{};if(l){let n=!1;return queueMicrotask(()=>{if(!(n||c))try{e()}catch(e){console.warn(`[bindConfigDoc:${t}] synced listener threw:`,e)}}),()=>{n=!0}}return s.add(e),()=>{s.delete(e)}},dispose(){c||(c=!0,a.unobserve(u),e.off(`synced`,d),o.clear(),s.clear())}}}var $Y=`source`,eX=800;function tX(e){return{ok:!1,error:e}}function nX(e){return{ok:!0,...e}}function rX(e,t={}){let{ytextKey:n=$Y,acceptanceDelayMs:r=eX}=t,i=e.document,a=i.getText(n),o=new Set,s=new Set,c=new Set,l=!1,u=`idle`,d=null;function f(){d!==null&&(clearTimeout(d),d=null)}function p(e){if(!l&&u!==e){u=e;for(let t of c)try{t(e)}catch(e){console.warn(`[bindOkignoreDoc] status listener threw:`,e)}}}function m(){if(l)return;let e=a.toString();for(let t of o)try{t(e)}catch(e){console.warn(`[bindOkignoreDoc] text listener threw:`,e)}}function h(e){if(!l)for(let t of s)try{t(e)}catch(e){console.warn(`[bindOkignoreDoc] rejection listener threw:`,e)}}return a.observe(m),e.on(`synced`,m),{current(){return a.toString()},patch(e){return l?tX({code:`WRITE_ERROR`,detail:`OkignoreBinding has been disposed`}):(i.transact(()=>{a.length>0&&a.delete(0,a.length),e.length>0&&a.insert(0,e)}),f(),p(`pending`),d=setTimeout(()=>{d=null,!l&&u===`pending`&&p(`accepted`)},r),nX({text:e}))},subscribe(e){return o.add(e),()=>{o.delete(e)}},subscribeRejection(e){return s.add(e),()=>{s.delete(e)}},subscribeStatus(e){return c.add(e),()=>{c.delete(e)}},status(){return u},notifyRejection(e){l||(f(),p(`rejected`),h({error:e,text:a.toString()}))},dispose(){l||(l=!0,f(),a.unobserve(m),e.off(`synced`,m),o.clear(),s.clear(),c.clear())}}}function iX(e,t,n){return aX([e,t,n],[])}function aX(e,t){if(t.length>0){let n=jf(Tf,t);if(n?.scope===`user`)return e[0];if(n?.scope===`project`)return e[1]??e[0];if(n?.scope===`project-local`)return e[2]??e[1]??e[0]}let n=oX(e);if(n===void 0)return;if(n===null)return null;if(Array.isArray(n)||typeof n!=`object`)return n;let r=e.map(e=>sX(e)?e:void 0),i=new Set;for(let e of r)if(e!==void 0)for(let t of Object.keys(e))i.add(t);let a={};for(let e of i)a[e]=aX(r.map(t=>t===void 0?void 0:t[e]),[...t,e]);return a}function oX(e){for(let t=e.length-1;t>=0;t--)if(e[t]!==void 0)return e[t]}function sX(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var cX=2e3;function lX(e){let t=Date.now();for(let[n,r]of e.entries()){let i=r;i.timestamp&&t-i.timestamp>3e4&&e.delete(n)}}function uX(e,t){for(let[,n]of e.entries()){let e=n;if(e.timestamp&&e.timestamp>t)return!0}return!1}var dX=`__system__`,fX=`__config__/project`,pX=`__user__/config.yml`,mX=`__local__/project`,hX=`__config__/okignore`;Object.freeze([fX,mX,pX,hX]);var gX=`__skill__/`,_X=`__template__/`,vX=[`project`,`global`];function yX(e){return e.startsWith(`__skill__/`)||e.startsWith(`__template__/`)}var bX=`.ok/skills`;function xX(e){return`${bX}/${e}/SKILL`}var SX=/^__skill__\/global\/([^/]+)(?:\/(references\/.+))?$/;function CX(e){let t=SX.exec(e);if(!t)return null;let n=t[1],r=t[2];return r===void 0?{name:n,kind:`skill`,rel:null}:{name:n,kind:`reference`,rel:r.slice(11)}}function wX(e,t){return e===`project`?xX(t):`${gX}${e}/${t}`}function TX(e){if(e===``)return``;try{return e.split(`/`).map(e=>decodeURIComponent(e)).join(`/`)}catch{return e}}function EX(e){if(e.startsWith(`__skill__/`)){let t=e.slice(10),n=t.indexOf(`/`);if(n<0)return null;let r=t.slice(0,n);if(r!==`global`&&r!==`project`)return null;let i=t.slice(n+1);return i?{kind:`skill`,scope:r,name:TX(i)}:null}if(e.startsWith(`__template__/`)){let t=e.slice(13);if(!t)return null;let n=t.lastIndexOf(`/`),r=n<0?t:t.slice(n+1);return r?{kind:`template`,folder:TX(n<0?``:t.slice(0,n)),name:TX(r)}:null}return null}var DX=/^(?:(.+)\/)?\.ok\/templates\/([^/]+?)(?:\.mdx?)?$/;function OX(e){let t=DX.exec(e);if(t){let e=(t[1]??``).replace(/^\/+|\/+$/g,``);return`${_X}${e?`${e}/`:``}${t[2]}`}return null}var kX=`#fafafa`,AX=`#171717`,jX=[`invalid-args`,`nested-project`,`target-not-empty`,`mkdir-failed`,`git-init-failed`,`init-failed`,`discovery-failed`],MX=[`.mdx`,`.md`],NX=`epoch`,PX=512*1024;function FX(e,t=PX){return typeof e==`number`&&Number.isFinite(e)&&e>t}var IX=[`claude`,`claude-desktop`,`cursor`,`codex`,`copilot`,`opencode`,`openclaw`,`pi`,`antigravity`,`lm-studio`,`hermes`],LX={claude:`Claude`,"claude-desktop":`Claude Desktop`,cursor:`Cursor`,codex:`Codex`,copilot:`GitHub Copilot`,opencode:`OpenCode`,openclaw:`OpenClaw`,pi:`Pi`,antigravity:`Antigravity`,"lm-studio":`LM Studio`,hermes:`Hermes`},RX={claude:`.claude/skills`,"claude-desktop":null,cursor:`.cursor/skills`,codex:`.codex/skills`,copilot:`.github/skills`,opencode:`.opencode/skills`,openclaw:null,pi:`.pi/skills`,antigravity:null,"lm-studio":null,hermes:null},zX=IX.filter(e=>RX[e]!==null),BX=`open-knowledge`;IX.flatMap(e=>{let t=RX[e];return t===null?[]:[`${t}/${BX}/`]}),zX.filter(e=>e!==`pi`&&e!==`copilot`).map(e=>({hostDir:(RX[e]??``).split(`/`)[0],editorId:e}));var VX={claude:`claude-code`,"claude-desktop":`claude-code`,cursor:`cursor`,codex:`codex`,copilot:`github-copilot-cli`,opencode:`opencode`,openclaw:`openclaw`,pi:`pi`,antigravity:`antigravity`,"lm-studio":`lm-studio`,hermes:`hermes`},HX={cursor:/\bCursor(?:\([^)]+\))?\/\d/,codex:/\bCodex(?:\([^)]+\))?\/\d/,"claude-desktop":/\bClaude(?:\([^)]+\))?\/\d/};function UX(){if(typeof navigator>`u`)return null;let e=navigator.userAgent;for(let[t,n]of Object.entries(HX))if(n.test(e))return t;return null}var WX=[`incoming`,`outgoing`,`both`];function GX(e){return WX.includes(e)}var KX=`open-knowledge`,qX=`https://github.com/inkeep/open-knowledge`,JX=[{id:`chart`,title:`Chart`,description:`A bar chart whose series colors track the OK chart palette.`,html:`<div style="font-family:system-ui,sans-serif;padding:20px;color:var(--foreground)">
401
+ `,ANSWER_SESSION_LAST_MESSAGE_IS_NOT_ASSISTANT:`The last message in the session is not an assistant message. Cannot regenerate non-assistant messages.`,PLUGIN_COMPONENT_CONFLICT:`The component "%s" is already defined. The plugin "%s" is trying to redefine it.`};function SK(e,...t){let n=Error($G(xK[e]??`Unsupported Orama Error code: ${e}`,...t));return n.code=e,`captureStackTrace`in Error.prototype&&Error.captureStackTrace(n),n}function CK(e){return{raw:Number(e),formatted:rK(e)}}function wK(e){if(e.id){if(typeof e.id!=`string`)throw SK(`DOCUMENT_ID_MUST_BE_STRING`,typeof e.id);return e.id}return aK()}function TK(e,t){for(let[n,r]of Object.entries(t)){let t=e[n];if(t!==void 0&&!(r===`geopoint`&&typeof t==`object`&&typeof t.lon==`number`&&typeof t.lat==`number`)&&!(r===`enum`&&(typeof t==`string`||typeof t==`number`))){if(r===`enum[]`&&Array.isArray(t)){let e=t.length;for(let r=0;r<e;r++)if(typeof t[r]!=`string`&&typeof t[r]!=`number`)return n+`.`+r;continue}if(kK(r)){let e=MK(r);if(!Array.isArray(t)||t.length!==e)throw SK(`INVALID_INPUT_VECTOR`,n,e,t.length);continue}if(AK(r)){if(!Array.isArray(t))return n;let e=jK(r),i=t.length;for(let r=0;r<i;r++)if(typeof t[r]!==e)return n+`.`+r;continue}if(typeof r==`object`){if(!t||typeof t!=`object`)return n;let e=TK(t,r);if(e)return n+`.`+e;continue}if(typeof t!==r)return n}}}var EK={string:!1,number:!1,boolean:!1,enum:!1,geopoint:!1,"string[]":!0,"number[]":!0,"boolean[]":!0,"enum[]":!0},DK={"string[]":`string`,"number[]":`number`,"boolean[]":`boolean`,"enum[]":`enum`};function OK(e){return e===`geopoint`}function kK(e){return typeof e==`string`&&/^vector\[\d+\]$/.test(e)}function AK(e){return typeof e==`string`&&EK[e]}function jK(e){return DK[e]}function MK(e){let t=Number(e.slice(7,-1));switch(!0){case isNaN(t):throw SK(`INVALID_VECTOR_VALUE`,e);case t<=0:throw SK(`INVALID_VECTOR_SIZE`,e);default:return t}}function NK(){return{idToInternalId:new Map,internalIdToId:[],save:PK,load:FK}}function PK(e){return{internalIdToId:e.internalIdToId}}function FK(e,t){let{internalIdToId:n}=t;e.internalDocumentIDStore.idToInternalId.clear(),e.internalDocumentIDStore.internalIdToId=[];let r=n.length;for(let t=0;t<r;t++){let r=n[t];e.internalDocumentIDStore.idToInternalId.set(r,t+1),e.internalDocumentIDStore.internalIdToId.push(r)}}function IK(e,t){if(typeof t==`string`){let n=e.idToInternalId.get(t);if(n)return n;let r=e.idToInternalId.size+1;return e.idToInternalId.set(t,r),e.internalIdToId.push(t),r}return t>e.internalIdToId.length?IK(e,t.toString()):t}function LK(e,t){if(e.internalIdToId.length<t)throw Error(`Invalid internalId ${t}`);return e.internalIdToId[t-1]}function RK(e,t){return{sharedInternalDocumentStore:t,docs:{},count:0}}function zK(e,t){let n=IK(e.sharedInternalDocumentStore,t);return e.docs[n]}function BK(e,t){let n=t.length,r=Array.from({length:n});for(let i=0;i<n;i++){let n=IK(e.sharedInternalDocumentStore,t[i]);r[i]=e.docs[n]}return r}function VK(e){return e.docs}function HK(e,t,n,r){return e.docs[n]===void 0?(e.docs[n]=r,e.count++,!0):!1}function UK(e,t){let n=IK(e.sharedInternalDocumentStore,t);return e.docs[n]===void 0?!1:(delete e.docs[n],e.count--,!0)}function WK(e){return e.count}function GK(e,t){let n=t;return{docs:n.docs,count:n.count,sharedInternalDocumentStore:e}}function KK(e){return{docs:e.docs,count:e.count}}function qK(){return{create:RK,get:zK,getMultiple:BK,getAll:VK,store:HK,remove:UK,count:WK,load:GK,save:KK}}var JK=[`beforeInsert`,`afterInsert`,`beforeRemove`,`afterRemove`,`beforeUpdate`,`afterUpdate`,`beforeUpsert`,`afterUpsert`,`beforeSearch`,`afterSearch`,`beforeInsertMultiple`,`afterInsertMultiple`,`beforeRemoveMultiple`,`afterRemoveMultiple`,`beforeUpdateMultiple`,`afterUpdateMultiple`,`beforeUpsertMultiple`,`afterUpsertMultiple`,`beforeLoad`,`afterLoad`,`afterCreate`];function YK(e,t){let n=[],r=e.plugins?.length;if(!r)return n;for(let i=0;i<r;i++)try{let r=e.plugins[i];typeof r[t]==`function`&&n.push(r[t])}catch(e){throw console.error(`Caught error in getAllPluginsByHook:`,e),SK(`PLUGIN_CRASHED`)}return n}var XK=[`tokenizer`,`index`,`documentsStore`,`sorter`,`pinning`],ZK=[`validateSchema`,`getDocumentIndexId`,`getDocumentProperties`,`formatElapsedTime`];function QK(e,t,n,r){if(e.some(mK))return(async()=>{for(let i of e)await i(t,n,r)})();for(let i of e)i(t,n,r)}function $K(e,t,n){if(e.some(mK))return(async()=>{for(let r of e)await r(t,n)})();for(let r of e)r(t,n)}function eq(e,t,n,r,i){if(e.some(mK))return(async()=>{for(let a of e)await a(t,n,r,i)})();for(let a of e)a(t,n,r,i)}function tq(e,t,n,r){if(e.some(mK))return(async()=>{for(let i of e)await i(t,n,r)})();for(let i of e)i(t,n,r)}function nq(e,t){if(e.some(mK))return(async()=>{for(let n of e)await n(t)})();for(let n of e)n(t)}var rq=class e{k;v;l=null;r=null;h=1;constructor(e,t){this.k=e,this.v=new Set(t)}updateHeight(){this.h=Math.max(e.getHeight(this.l),e.getHeight(this.r))+1}static getHeight(e){return e?e.h:0}getBalanceFactor(){return e.getHeight(this.l)-e.getHeight(this.r)}rotateLeft(){let e=this.r;return this.r=e.l,e.l=this,this.updateHeight(),e.updateHeight(),e}rotateRight(){let e=this.l;return this.l=e.r,e.r=this,this.updateHeight(),e.updateHeight(),e}toJSON(){return{k:this.k,v:Array.from(this.v),l:this.l?this.l.toJSON():null,r:this.r?this.r.toJSON():null,h:this.h}}static fromJSON(t){let n=new e(t.k,t.v);return n.l=t.l?e.fromJSON(t.l):null,n.r=t.r?e.fromJSON(t.r):null,n.h=t.h,n}},iq=class e{root=null;insertCount=0;constructor(e,t){e!==void 0&&t!==void 0&&(this.root=new rq(e,t))}insert(e,t,n=1e3){this.root=this.insertNode(this.root,e,t,n)}insertMultiple(e,t,n=1e3){for(let r of t)this.insert(e,r,n)}rebalance(){this.root&&=this.rebalanceNode(this.root)}toJSON(){return{root:this.root?this.root.toJSON():null,insertCount:this.insertCount}}static fromJSON(t){let n=new e;return n.root=t.root?rq.fromJSON(t.root):null,n.insertCount=t.insertCount||0,n}insertNode(e,t,n,r){if(e===null)return new rq(t,[n]);let i=[],a=e,o=null;for(;a!==null;)if(i.push({parent:o,node:a}),t<a.k)if(a.l===null){a.l=new rq(t,[n]),i.push({parent:a,node:a.l});break}else o=a,a=a.l;else if(t>a.k)if(a.r===null){a.r=new rq(t,[n]),i.push({parent:a,node:a.r});break}else o=a,a=a.r;else return a.v.add(n),e;let s=!1;this.insertCount++%r===0&&(s=!0);for(let t=i.length-1;t>=0;t--){let{parent:n,node:r}=i[t];if(r.updateHeight(),s){let t=this.rebalanceNode(r);n?n.l===r?n.l=t:n.r===r&&(n.r=t):e=t}}return e}rebalanceNode(e){let t=e.getBalanceFactor();if(t>1){if(e.l&&e.l.getBalanceFactor()>=0)return e.rotateRight();if(e.l)return e.l=e.l.rotateLeft(),e.rotateRight()}if(t<-1){if(e.r&&e.r.getBalanceFactor()<=0)return e.rotateLeft();if(e.r)return e.r=e.r.rotateRight(),e.rotateLeft()}return e}find(e){let t=this.findNodeByKey(e);return t?t.v:null}contains(e){return this.find(e)!==null}getSize(){let e=0,t=[],n=this.root;for(;n||t.length>0;){for(;n;)t.push(n),n=n.l;n=t.pop(),e++,n=n.r}return e}isBalanced(){if(!this.root)return!0;let e=[this.root];for(;e.length>0;){let t=e.pop(),n=t.getBalanceFactor();if(Math.abs(n)>1)return!1;t.l&&e.push(t.l),t.r&&e.push(t.r)}return!0}remove(e){this.root=this.removeNode(this.root,e)}removeDocument(e,t){let n=this.findNodeByKey(e);n&&(n.v.size===1?this.root=this.removeNode(this.root,e):n.v=new Set([...n.v.values()].filter(e=>e!==t)))}findNodeByKey(e){let t=this.root;for(;t;)if(e<t.k)t=t.l;else if(e>t.k)t=t.r;else return t;return null}removeNode(e,t){if(e===null)return null;let n=[],r=e;for(;r!==null&&r.k!==t;)n.push(r),r=t<r.k?r.l:r.r;if(r===null)return e;if(r.l===null||r.r===null){let t=r.l?r.l:r.r;if(n.length===0)e=t;else{let e=n[n.length-1];e.l===r?e.l=t:e.r=t}}else{let e=r,t=r.r;for(;t.l!==null;)e=t,t=t.l;r.k=t.k,r.v=t.v,e.l===t?e.l=t.r:e.r=t.r,r=e}n.push(r);for(let t=n.length-1;t>=0;t--){let r=n[t];r.updateHeight();let i=this.rebalanceNode(r);if(t>0){let e=n[t-1];e.l===r?e.l=i:e.r===r&&(e.r=i)}else e=i}return e}rangeSearch(e,t){let n=new Set,r=[],i=this.root;for(;i||r.length>0;){for(;i;)r.push(i),i=i.l;if(i=r.pop(),i.k>=e&&i.k<=t)for(let e of i.v)n.add(e);if(i.k>t)break;i=i.r}return n}greaterThan(e,t=!1){let n=new Set,r=[],i=this.root;for(;i||r.length>0;){for(;i;)r.push(i),i=i.r;if(i=r.pop(),t&&i.k>=e||!t&&i.k>e)for(let e of i.v)n.add(e);else if(i.k<=e)break;i=i.l}return n}lessThan(e,t=!1){let n=new Set,r=[],i=this.root;for(;i||r.length>0;){for(;i;)r.push(i),i=i.l;if(i=r.pop(),t&&i.k<=e||!t&&i.k<e)for(let e of i.v)n.add(e);else if(i.k>e)break;i=i.r}return n}},aq=class e{numberToDocumentId;constructor(){this.numberToDocumentId=new Map}insert(e,t){this.numberToDocumentId.has(e)?this.numberToDocumentId.get(e).add(t):this.numberToDocumentId.set(e,new Set([t]))}find(e){let t=this.numberToDocumentId.get(e);return t?Array.from(t):null}remove(e){this.numberToDocumentId.delete(e)}removeDocument(e,t){let n=this.numberToDocumentId.get(t);n&&(n.delete(e),n.size===0&&this.numberToDocumentId.delete(t))}contains(e){return this.numberToDocumentId.has(e)}getSize(){let e=0;for(let t of this.numberToDocumentId.values())e+=t.size;return e}filter(e){let t=Object.keys(e);if(t.length!==1)throw Error(`Invalid operation`);let n=t[0];switch(n){case`eq`:{let t=e[n],r=this.numberToDocumentId.get(t);return r?Array.from(r):[]}case`in`:{let t=e[n],r=new Set;for(let e of t){let t=this.numberToDocumentId.get(e);if(t)for(let e of t)r.add(e)}return Array.from(r)}case`nin`:{let t=new Set(e[n]),r=new Set;for(let[e,n]of this.numberToDocumentId.entries())if(!t.has(e))for(let e of n)r.add(e);return Array.from(r)}default:throw Error(`Invalid operation`)}}filterArr(e){let t=Object.keys(e);if(t.length!==1)throw Error(`Invalid operation`);let n=t[0];switch(n){case`containsAll`:{let t=e[n].map(e=>this.numberToDocumentId.get(e)??new Set);if(t.length===0)return[];let r=t.reduce((e,t)=>new Set([...e].filter(e=>t.has(e))));return Array.from(r)}case`containsAny`:{let t=e[n].map(e=>this.numberToDocumentId.get(e)??new Set);if(t.length===0)return[];let r=t.reduce((e,t)=>new Set([...e,...t]));return Array.from(r)}default:throw Error(`Invalid operation`)}}static fromJSON(t){if(!t.numberToDocumentId)throw Error(`Invalid Flat Tree JSON`);let n=new e;for(let[e,r]of t.numberToDocumentId)n.numberToDocumentId.set(e,new Set(r));return n}toJSON(){return{numberToDocumentId:Array.from(this.numberToDocumentId.entries()).map(([e,t])=>[e,Array.from(t)])}}};function oq(e,t,n){if(n<0)return-1;if(e===t)return 0;let r=e.length,i=t.length;if(r===0)return i<=n?i:-1;if(i===0)return r<=n?r:-1;let a=Math.abs(r-i);if(e.startsWith(t))return a<=n?a:-1;if(t.startsWith(e))return 0;if(a>n)return-1;let o=[];for(let e=0;e<=r;e++){o[e]=[e];for(let t=1;t<=i;t++)o[e][t]=e===0?t:0}for(let a=1;a<=r;a++){let r=1/0;for(let n=1;n<=i;n++)e[a-1]===t[n-1]?o[a][n]=o[a-1][n-1]:o[a][n]=Math.min(o[a-1][n]+1,o[a][n-1]+1,o[a-1][n-1]+1),r=Math.min(r,o[a][n]);if(r>n)return-1}return o[r][i]<=n?o[r][i]:-1}function sq(e,t,n){let r=oq(e,t,n);return{distance:r,isBounded:r>=0}}var cq=class e{k;s;c=new Map;d=new Set;e;w=``;constructor(e,t,n){this.k=e,this.s=t,this.e=n}updateParent(e){this.w=e.w+this.s}addDocument(e){this.d.add(e)}removeDocument(e){return this.d.delete(e)}findAllWords(e,t,n,r){let i=[this];for(;i.length>0;){let a=i.pop();if(a.e){let{w:i,d:o}=a;if(n&&i!==t)continue;if(oK(e,i)!==null)if(r)if(Math.abs(t.length-i.length)<=r&&sq(t,i,r).isBounded)e[i]=[];else continue;else e[i]=[];if(oK(e,i)!=null&&o.size>0){let t=e[i];for(let e of o)t.includes(e)||t.push(e)}}a.c.size>0&&i.push(...a.c.values())}return e}insert(t,n){let r=this,i=0,a=t.length;for(;i<a;){let o=t[i],s=r.c.get(o);if(s){let o=s.s,c=o.length,l=0;for(;l<c&&i+l<a&&o[l]===t[i+l];)l++;if(l===c){if(r=s,i+=l,i===a){s.e||=!0,s.addDocument(n);return}continue}let u=o.slice(0,l),d=o.slice(l),f=t.slice(i+l),p=new e(u[0],u,!1);if(r.c.set(u[0],p),p.updateParent(r),s.s=d,s.k=d[0],p.c.set(d[0],s),s.updateParent(p),f){let t=new e(f[0],f,!0);t.addDocument(n),p.c.set(f[0],t),t.updateParent(p)}else p.e=!0,p.addDocument(n);return}else{let a=new e(o,t.slice(i),!0);a.addDocument(n),r.c.set(o,a),a.updateParent(r);return}}r.e||=!0,r.addDocument(n)}_findLevenshtein(e,t,n,r,i){let a=[{node:this,index:t,tolerance:n}];for(;a.length>0;){let{node:t,index:n,tolerance:o}=a.pop();if(t.w.startsWith(e)){t.findAllWords(i,e,!1,0);continue}if(o<0)continue;if(t.e){let{w:n,d:a}=t;if(n&&(sq(e,n,r).isBounded&&(i[n]=[]),oK(i,n)!==void 0&&a.size>0)){let e=new Set(i[n]);for(let t of a)e.add(t);i[n]=Array.from(e)}}if(n>=e.length)continue;let s=e[n];if(t.c.has(s)){let e=t.c.get(s);a.push({node:e,index:n+1,tolerance:o})}a.push({node:t,index:n+1,tolerance:o-1});for(let[e,r]of t.c)a.push({node:r,index:n,tolerance:o-1}),e!==s&&a.push({node:r,index:n+1,tolerance:o-1})}}find(e){let{term:t,exact:n,tolerance:r}=e;if(r&&!n){let e={};return this._findLevenshtein(t,0,r,r,e),e}else{let e=this,i=0,a=t.length;for(;i<a;){let o=t[i],s=e.c.get(o);if(s){let o=s.s,c=o.length,l=0;for(;l<c&&i+l<a&&o[l]===t[i+l];)l++;if(l===c)e=s,i+=l;else if(i+l===a)if(l===a-i){if(n)return{};{let e={};return s.findAllWords(e,t,n,r),e}}else return{};else return{}}else return{}}let o={};return e.findAllWords(o,t,n,r),o}}contains(e){let t=this,n=0,r=e.length;for(;n<r;){let i=e[n],a=t.c.get(i);if(a){let i=a.s,o=i.length,s=0;for(;s<o&&n+s<r&&i[s]===e[n+s];)s++;if(s<o)return!1;n+=o,t=a}else return!1}return!0}removeWord(e){if(!e)return!1;let t=this,n=e.length,r=[];for(let i=0;i<n;i++){let n=e[i];if(t.c.has(n)){let e=t.c.get(n);r.push({parent:t,character:n}),i+=e.s.length-1,t=e}else return!1}for(t.d.clear(),t.e=!1;r.length>0&&t.c.size===0&&!t.e&&t.d.size===0;){let{parent:e,character:n}=r.pop();e.c.delete(n),t=e}return!0}removeDocumentByWord(e,t,n=!0){if(!e)return!0;let r=this,i=e.length;for(let a=0;a<i;a++){let i=e[a];if(r.c.has(i)){let o=r.c.get(i);a+=o.s.length-1,r=o,n&&r.w!==e||r.removeDocument(t)}else return!1}return!0}static getCommonPrefix(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e.charCodeAt(r)===t.charCodeAt(r);)r++;return e.slice(0,r)}toJSON(){return{w:this.w,s:this.s,e:this.e,k:this.k,d:Array.from(this.d),c:Array.from(this.c?.entries())?.map(([e,t])=>[e,t.toJSON()])}}static fromJSON(t){let n=new e(t.k,t.s,t.e);return n.w=t.w,n.d=new Set(t.d),n.c=new Map(t?.c?.map(([t,n])=>[t,e.fromJSON(n)])||[]),n}},lq=class e extends cq{constructor(){super(``,``,!1)}static fromJSON(t){let n=new e;return n.w=t.w,n.s=t.s,n.e=t.e,n.k=t.k,n.d=new Set(t.d),n.c=new Map(t?.c?.map(([e,t])=>[e,cq.fromJSON(t)])||[]),n}toJSON(){return super.toJSON()}},uq=2,dq=6371e3,fq=class e{point;docIDs;left;right;parent;constructor(e,t){this.point=e,this.docIDs=new Set(t),this.left=null,this.right=null,this.parent=null}toJSON(){return{point:this.point,docIDs:Array.from(this.docIDs),left:this.left?this.left.toJSON():null,right:this.right?this.right.toJSON():null}}static fromJSON(t,n=null){let r=new e(t.point,t.docIDs);return r.parent=n,t.left&&(r.left=e.fromJSON(t.left,r)),t.right&&(r.right=e.fromJSON(t.right,r)),r}},pq=class e{root;nodeMap;constructor(){this.root=null,this.nodeMap=new Map}getPointKey(e){return`${e.lon},${e.lat}`}insert(e,t){let n=this.getPointKey(e),r=this.nodeMap.get(n);if(r){t.forEach(e=>r.docIDs.add(e));return}let i=new fq(e,t);if(this.nodeMap.set(n,i),this.root==null){this.root=i;return}let a=this.root,o=0;for(;;){if(o%uq===0)if(e.lon<a.point.lon){if(a.left==null){a.left=i,i.parent=a;return}a=a.left}else{if(a.right==null){a.right=i,i.parent=a;return}a=a.right}else if(e.lat<a.point.lat){if(a.left==null){a.left=i,i.parent=a;return}a=a.left}else{if(a.right==null){a.right=i,i.parent=a;return}a=a.right}o++}}contains(e){let t=this.getPointKey(e);return this.nodeMap.has(t)}getDocIDsByCoordinates(e){let t=this.getPointKey(e),n=this.nodeMap.get(t);return n?Array.from(n.docIDs):null}removeDocByID(e,t){let n=this.getPointKey(e),r=this.nodeMap.get(n);r&&(r.docIDs.delete(t),r.docIDs.size===0&&(this.nodeMap.delete(n),this.deleteNode(r)))}deleteNode(e){let t=e.parent,n=e.left?e.left:e.right;n&&(n.parent=t),t?t.left===e?t.left=n:t.right===e&&(t.right=n):(this.root=n,this.root&&(this.root.parent=null))}searchByRadius(t,n,r=!0,i=`asc`,a=!1){let o=a?e.vincentyDistance:e.haversineDistance,s=[{node:this.root,depth:0}],c=[];for(;s.length>0;){let{node:e,depth:i}=s.pop();if(e==null)continue;let a=o(t,e.point);(r?a<=n:a>n)&&c.push({point:e.point,docIDs:Array.from(e.docIDs)}),e.left!=null&&s.push({node:e.left,depth:i+1}),e.right!=null&&s.push({node:e.right,depth:i+1})}return i&&c.sort((e,n)=>{let r=o(t,e.point),a=o(t,n.point);return i.toLowerCase()===`asc`?r-a:a-r}),c}searchByPolygon(t,n=!0,r=null,i=!1){let a=[{node:this.root,depth:0}],o=[];for(;a.length>0;){let{node:r,depth:i}=a.pop();if(r==null)continue;r.left!=null&&a.push({node:r.left,depth:i+1}),r.right!=null&&a.push({node:r.right,depth:i+1});let s=e.isPointInPolygon(t,r.point);(s&&n||!s&&!n)&&o.push({point:r.point,docIDs:Array.from(r.docIDs)})}let s=e.calculatePolygonCentroid(t);if(r){let t=i?e.vincentyDistance:e.haversineDistance;o.sort((e,n)=>{let i=t(s,e.point),a=t(s,n.point);return r.toLowerCase()===`asc`?i-a:a-i})}return o}toJSON(){return{root:this.root?this.root.toJSON():null}}static fromJSON(t){let n=new e;return t.root&&(n.root=fq.fromJSON(t.root),n.buildNodeMap(n.root)),n}buildNodeMap(e){if(e==null)return;let t=this.getPointKey(e.point);this.nodeMap.set(t,e),e.left&&this.buildNodeMap(e.left),e.right&&this.buildNodeMap(e.right)}static calculatePolygonCentroid(e){let t=0,n=0,r=0,i=e.length;for(let a=0,o=i-1;a<i;o=a++){let i=e[a].lon,s=e[a].lat,c=e[o].lon,l=e[o].lat,u=i*l-c*s;t+=u,n+=(i+c)*u,r+=(s+l)*u}t/=2;let a=6*t;return n/=a,r/=a,{lon:n,lat:r}}static isPointInPolygon(e,t){let n=!1,r=t.lon,i=t.lat,a=e.length;for(let t=0,o=a-1;t<a;o=t++){let a=e[t].lon,s=e[t].lat,c=e[o].lon,l=e[o].lat;s>i!=l>i&&r<(c-a)*(i-s)/(l-s)+a&&(n=!n)}return n}static haversineDistance(e,t){let n=Math.PI/180,r=e.lat*n,i=t.lat*n,a=(t.lat-e.lat)*n,o=(t.lon-e.lon)*n,s=Math.sin(a/2)*Math.sin(a/2)+Math.cos(r)*Math.cos(i)*Math.sin(o/2)*Math.sin(o/2);return dq*(2*Math.atan2(Math.sqrt(s),Math.sqrt(1-s)))}static vincentyDistance(e,t){let n=6378137,r=1/298.257223563,i=(1-r)*n,a=Math.PI/180,o=e.lat*a,s=t.lat*a,c=(t.lon-e.lon)*a,l=Math.atan((1-r)*Math.tan(o)),u=Math.atan((1-r)*Math.tan(s)),d=Math.sin(l),f=Math.cos(l),p=Math.sin(u),m=Math.cos(u),h=c,g,_=1e3,v,y,b,x,S,C;do{let e=Math.sin(h),t=Math.cos(h);if(v=Math.sqrt(m*e*(m*e)+(f*p-d*m*t)*(f*p-d*m*t)),v===0)return 0;y=d*p+f*m*t,b=Math.atan2(v,y),x=f*m*e/v,S=1-x*x,C=y-2*d*p/S,isNaN(C)&&(C=0);let n=r/16*S*(4+r*(4-3*S));g=h,h=c+(1-n)*r*x*(b+n*v*(C+n*y*(-1+2*C*C)))}while(Math.abs(h-g)>1e-12&&--_>0);if(_===0)return NaN;let w=S*(n*n-i*i)/(i*i),T=1+w/16384*(4096+w*(-768+w*(320-175*w))),E=w/1024*(256+w*(-128+w*(74-47*w))),ee=E*v*(C+E/4*(y*(-1+2*C*C)-E/6*C*(-3+4*v*v)*(-3+4*C*C)));return i*T*(b-ee)}},mq=class e{true;false;constructor(){this.true=new Set,this.false=new Set}insert(e,t){t?this.true.add(e):this.false.add(e)}delete(e,t){t?this.true.delete(e):this.false.delete(e)}getSize(){return this.true.size+this.false.size}toJSON(){return{true:Array.from(this.true),false:Array.from(this.false)}}static fromJSON(t){let n=new e;return n.true=new Set(t.true),n.false=new Set(t.false),n}};function hq(e,t,n,r,i,{k:a,b:o,d:s}){return Math.log(1+(n-t+.5)/(t+.5))*(s+e*(a+1))/(e+a*(1-o+o*r/i))}var gq=class e{size;vectors=new Map;constructor(e){this.size=e}add(e,t){t instanceof Float32Array||(t=new Float32Array(t));let n=_q(t,this.size);this.vectors.set(e,[n,t])}remove(e){this.vectors.delete(e)}find(e,t,n){return e instanceof Float32Array||(e=new Float32Array(e)),vq(e,n,this.vectors,this.size,t)}toJSON(){let e=[];for(let[t,[n,r]]of this.vectors)e.push([t,[n,Array.from(r)]]);return{size:this.size,vectors:e}}static fromJSON(t){let n=t,r=new e(n.size);for(let[e,[t,i]]of n.vectors)r.vectors.set(e,[t,new Float32Array(i)]);return r}};function _q(e,t){let n=0;for(let r=0;r<t;r++)n+=e[r]*e[r];return Math.sqrt(n)}function vq(e,t,n,r,i){let a=_q(e,r),o=[],s=t||n.keys();for(let t of s){let s=n.get(t);if(!s)continue;let c=s[0],l=s[1],u=0;for(let t=0;t<r;t++)u+=e[t]*l[t];let d=u/(a*c);d>=i&&o.push([t,d])}return o}function yq(e,t,n,r,i){let a=IK(e.sharedInternalDocumentStore,n);e.avgFieldLength[t]=((e.avgFieldLength[t]??0)*(i-1)+r.length)/i,e.fieldLengths[t][a]=r.length,e.frequencies[t][a]={}}function bq(e,t,n,r,i){let a=0;for(let e of r)e===i&&a++;let o=IK(e.sharedInternalDocumentStore,n),s=a/r.length;e.frequencies[t][o][i]=s,i in e.tokenOccurrences[t]||(e.tokenOccurrences[t][i]=0),e.tokenOccurrences[t][i]=(e.tokenOccurrences[t][i]??0)+1}function xq(e,t,n,r){let i=IK(e.sharedInternalDocumentStore,n);r>1?e.avgFieldLength[t]=(e.avgFieldLength[t]*r-e.fieldLengths[t][i])/(r-1):e.avgFieldLength[t]=void 0,e.fieldLengths[t][i]=void 0,e.frequencies[t][i]=void 0}function Sq(e,t,n){e.tokenOccurrences[t][n]--}function Cq(e,t,n,r,i=``){r||={sharedInternalDocumentStore:t,indexes:{},vectorIndexes:{},searchableProperties:[],searchablePropertiesWithTypes:{},frequencies:{},tokenOccurrences:{},avgFieldLength:{},fieldLengths:{}};for(let[a,o]of Object.entries(n)){let n=`${i}${i?`.`:``}${a}`;if(typeof o==`object`&&!Array.isArray(o)){Cq(e,t,o,r,n);continue}if(kK(o))r.searchableProperties.push(n),r.searchablePropertiesWithTypes[n]=o,r.vectorIndexes[n]={type:`Vector`,node:new gq(MK(o)),isArray:!1};else{let e=/\[/.test(o);switch(o){case`boolean`:case`boolean[]`:r.indexes[n]={type:`Bool`,node:new mq,isArray:e};break;case`number`:case`number[]`:r.indexes[n]={type:`AVL`,node:new iq(0,[]),isArray:e};break;case`string`:case`string[]`:r.indexes[n]={type:`Radix`,node:new lq,isArray:e},r.avgFieldLength[n]=0,r.frequencies[n]={},r.tokenOccurrences[n]={},r.fieldLengths[n]={};break;case`enum`:case`enum[]`:r.indexes[n]={type:`Flat`,node:new aq,isArray:e};break;case`geopoint`:r.indexes[n]={type:`BKD`,node:new pq,isArray:e};break;default:throw SK(`INVALID_SCHEMA_TYPE`,Array.isArray(o)?`array`:o,n)}r.searchableProperties.push(n),r.searchablePropertiesWithTypes[n]=o}}return r}function wq(e,t,n,r,i,a,o,s){return c=>{let{type:l,node:u}=t.indexes[n];switch(l){case`Bool`:u[c?`true`:`false`].add(r);break;case`AVL`:{let e=s?.avlRebalanceThreshold??1;u.insert(c,r,e);break}case`Radix`:{let s=a.tokenize(c,i,n,!1);e.insertDocumentScoreParameters(t,n,r,s,o);for(let i of s)e.insertTokenScoreParameters(t,n,r,s,i),u.insert(i,r);break}case`Flat`:u.insert(c,r);break;case`BKD`:u.insert(c,[r]);break}}}function Tq(e,t,n,r,i,a,o,s,c,l,u){if(kK(o))return Eq(t,n,a,r,i);let d=wq(e,t,n,i,s,c,l,u);if(!AK(o))return d(a);let f=a,p=f.length;for(let e=0;e<p;e++)d(f[e])}function Eq(e,t,n,r,i){e.vectorIndexes[t].node.add(i,n)}function Dq(e,t,n,r,i,a,o,s,c,l){if(kK(o))return t.vectorIndexes[n].node.remove(i),!0;let{type:u,node:d}=t.indexes[n];switch(u){case`AVL`:return d.removeDocument(a,i),!0;case`Bool`:return d[a?`true`:`false`].delete(i),!0;case`Radix`:{let o=c.tokenize(a,s,n);e.removeDocumentScoreParameters(t,n,r,l);for(let r of o)e.removeTokenScoreParameters(t,n,r),d.removeDocumentByWord(r,i);return!0}case`Flat`:return d.removeDocument(i,a),!0;case`BKD`:return d.removeDocByID(a,i),!1}}function Oq(e,t,n,r,i,a,o,s,c,l){if(!AK(o))return Dq(e,t,n,r,i,a,o,s,c,l);let u=jK(o),d=a,f=d.length;for(let a=0;a<f;a++)Dq(e,t,n,r,i,d[a],u,s,c,l);return!0}function kq(e,t,n,r,i,a,o,s,c,l){let u=Array.from(r),d=e.avgFieldLength[t],f=e.fieldLengths[t],p=e.tokenOccurrences[t],m=e.frequencies[t],h=typeof p[n]==`number`?p[n]??0:0,g=u.length;for(let e=0;e<g;e++){let r=u[e];if(c&&!c.has(r))continue;l.has(r)||l.set(r,new Map);let p=l.get(r);p.set(t,(p.get(t)||0)+1);let g=hq(m?.[r]?.[n]??0,h,i,f[r],d,a);o.has(r)?o.set(r,o.get(r)+g*s):o.set(r,g*s)}}function Aq(e,t,n,r,i,a,o,s,c,l,u,d=0){let f=n.tokenize(t,r),p=f.length||1,m=new Map,h=new Map,g=new Map;for(let n of i){if(!(n in e.indexes))continue;let r=e.indexes[n],{type:i}=r;if(i!==`Radix`)throw SK(`WRONG_SEARCH_PROPERTY_TYPE`,n);let d=s[n]??1;if(d<=0)throw SK(`INVALID_BOOST_VALUE`,d);f.length===0&&!t&&f.push(``);let p=f.length;for(let t=0;t<p;t++){let i=f[t],s=r.node.find({term:i,exact:a,tolerance:o}),p=Object.keys(s);p.length>0&&h.set(i,!0);let _=p.length;for(let t=0;t<_;t++){let r=p[t],i=s[r];kq(e,n,r,i,l,c,g,d,u,m)}}}let _=Array.from(g.entries()).map(([e,t])=>[e,t]).sort((e,t)=>t[1]-e[1]);if(_.length===0)return[];if(d===1)return _;if(d===0){if(p===1)return _;for(let e of f)if(!h.get(e))return[];return _.filter(([e])=>{let t=m.get(e);return t?Array.from(t.values()).some(e=>e===p):!1})}let v=_.filter(([e])=>{let t=m.get(e);return t?Array.from(t.values()).some(e=>e===p):!1});if(v.length>0){let e=_.filter(([e])=>!v.some(([t])=>t===e)),t=Math.ceil(e.length*d);return[...v,...e.slice(0,t)]}return _}function jq(e,t,n,r){if(`and`in n&&n.and&&Array.isArray(n.and)){let i=n.and;return i.length===0?new Set:gK(...i.map(n=>jq(e,t,n,r)))}if(`or`in n&&n.or&&Array.isArray(n.or)){let i=n.or;return i.length===0?new Set:i.map(n=>jq(e,t,n,r)).reduce((e,t)=>vK(e,t),new Set)}if(`not`in n&&n.not){let i=n.not,a=new Set,o=e.sharedInternalDocumentStore;for(let e=1;e<=o.internalIdToId.length;e++)a.add(e);return yK(a,jq(e,t,i,r))}let i=Object.keys(n),a=i.reduce((e,t)=>({[t]:new Set,...e}),{});for(let o of i){let i=n[o];if(e.indexes[o]===void 0)throw SK(`UNKNOWN_FILTER_PROPERTY`,o);let{node:s,type:c,isArray:l}=e.indexes[o];if(c===`Bool`){let e=s,t=i?e.true:e.false;a[o]=vK(a[o],t);continue}if(c===`BKD`){let e;if(`radius`in i)e=`radius`;else if(`polygon`in i)e=`polygon`;else throw Error(`Invalid operation ${i}`);if(e===`radius`){let{value:t,coordinates:n,unit:r=`m`,inside:c=!0,highPrecision:l=!1}=i[e],u=fK(t,r),d=s.searchByRadius(n,u,c,void 0,l);a[o]=Lq(a[o],d)}else{let{coordinates:t,inside:n=!0,highPrecision:r=!1}=i[e],c=s.searchByPolygon(t,n,void 0,r);a[o]=Lq(a[o],c)}continue}if(c===`Radix`&&(typeof i==`string`||Array.isArray(i))){for(let e of[i].flat()){let n=t.tokenize(e,r,o);for(let e of n){let t=s.find({term:e,exact:!0});a[o]=Vq(a[o],t)}}continue}let u=Object.keys(i);if(u.length>1)throw SK(`INVALID_FILTER_OPERATION`,u.length);if(c===`Flat`){let e=new Set(l?s.filterArr(i):s.filter(i));a[o]=vK(a[o],e);continue}if(c===`AVL`){let e=u[0],t=i[e],n;switch(e){case`gt`:n=s.greaterThan(t,!1);break;case`gte`:n=s.greaterThan(t,!0);break;case`lt`:n=s.lessThan(t,!1);break;case`lte`:n=s.lessThan(t,!0);break;case`eq`:n=s.find(t)??new Set;break;case`between`:{let[e,r]=t;n=s.rangeSearch(e,r);break}default:throw SK(`INVALID_FILTER_OPERATION`,e)}a[o]=vK(a[o],n)}}return gK(...Object.values(a))}function Mq(e){return e.searchableProperties}function Nq(e){return e.searchablePropertiesWithTypes}function Pq(e,t){let{indexes:n,vectorIndexes:r,searchableProperties:i,searchablePropertiesWithTypes:a,frequencies:o,tokenOccurrences:s,avgFieldLength:c,fieldLengths:l}=t,u={},d={};for(let e of Object.keys(n)){let{node:t,type:r,isArray:i}=n[e];switch(r){case`Radix`:u[e]={type:`Radix`,node:lq.fromJSON(t),isArray:i};break;case`Flat`:u[e]={type:`Flat`,node:aq.fromJSON(t),isArray:i};break;case`AVL`:u[e]={type:`AVL`,node:iq.fromJSON(t),isArray:i};break;case`BKD`:u[e]={type:`BKD`,node:pq.fromJSON(t),isArray:i};break;case`Bool`:u[e]={type:`Bool`,node:mq.fromJSON(t),isArray:i};break;default:u[e]=n[e]}}for(let e of Object.keys(r))d[e]={type:`Vector`,isArray:!1,node:gq.fromJSON(r[e])};return{sharedInternalDocumentStore:e,indexes:u,vectorIndexes:d,searchableProperties:i,searchablePropertiesWithTypes:a,frequencies:o,tokenOccurrences:s,avgFieldLength:c,fieldLengths:l}}function Fq(e){let{indexes:t,vectorIndexes:n,searchableProperties:r,searchablePropertiesWithTypes:i,frequencies:a,tokenOccurrences:o,avgFieldLength:s,fieldLengths:c}=e,l={};for(let e of Object.keys(n))l[e]=n[e].node.toJSON();let u={};for(let e of Object.keys(t)){let{type:n,node:r,isArray:i}=t[e];n===`Flat`||n===`Radix`||n===`AVL`||n===`BKD`||n===`Bool`?u[e]={type:n,node:r.toJSON(),isArray:i}:(u[e]=t[e],u[e].node=u[e].node.toJSON())}return{indexes:u,vectorIndexes:l,searchableProperties:r,searchablePropertiesWithTypes:i,frequencies:a,tokenOccurrences:o,avgFieldLength:s,fieldLengths:c}}function Iq(){return{create:Cq,insert:Tq,remove:Oq,insertDocumentScoreParameters:yq,insertTokenScoreParameters:bq,removeDocumentScoreParameters:xq,removeTokenScoreParameters:Sq,calculateResultScores:kq,search:Aq,searchByWhereClause:jq,getSearchableProperties:Mq,getSearchablePropertiesWithTypes:Nq,load:Pq,save:Fq}}function Lq(e,t){e||=new Set;let n=t.length;for(let r=0;r<n;r++){let n=t[r].docIDs,i=n.length;for(let t=0;t<i;t++)e.add(n[t])}return e}function Rq(e,t,n=!1){let r=n?pq.vincentyDistance:pq.haversineDistance,i=[],a=[];for(let{point:n}of e)a.push(r(t,n));let o=Math.max(...a),s=0;for(let{docIDs:t}of e){let e=o-a[s]+1;for(let n of t)i.push([n,e]);s++}return i.sort((e,t)=>t[1]-e[1]),i}function zq(e,t){let n=Object.keys(e);if(n.length!==1)return{isGeoOnly:!1};let r=n[0],i=e[r];if(t.indexes[r]===void 0)return{isGeoOnly:!1};let{type:a}=t.indexes[r];return a===`BKD`&&i&&(`radius`in i||`polygon`in i)?{isGeoOnly:!0,geoProperty:r,geoOperation:i}:{isGeoOnly:!1}}function Bq(e,t){let n=e,r=zq(t,n);if(!r.isGeoOnly||!r.geoProperty||!r.geoOperation)return null;let{node:i}=n.indexes[r.geoProperty],a=r.geoOperation,o=i,s;if(`radius`in a){let{value:e,coordinates:t,unit:n=`m`,inside:r=!0,highPrecision:i=!1}=a.radius,c=t,l=fK(e,n);return s=o.searchByRadius(c,l,r,`asc`,i),Rq(s,c,i)}else if(`polygon`in a){let{coordinates:e,inside:t=!0,highPrecision:n=!1}=a.polygon;s=o.searchByPolygon(e,t,`asc`,n);let r=pq.calculatePolygonCentroid(e);return Rq(s,r,n)}return null}function Vq(e,t){e||=new Set;let n=Object.keys(t),r=n.length;for(let i=0;i<r;i++){let r=t[n[i]],a=r.length;for(let t=0;t<a;t++)e.add(r[t])}return e}function Hq(e,t,n,r,i){let a={language:e.tokenizer.language,sharedInternalDocumentStore:t,enabled:!0,isSorted:!0,sortableProperties:[],sortablePropertiesWithTypes:{},sorts:{}};for(let[o,s]of Object.entries(n)){let n=`${i}${i?`.`:``}${o}`;if(!r.includes(n)){if(typeof s==`object`&&!Array.isArray(s)){let i=Hq(e,t,s,r,n);QG(a.sortableProperties,i.sortableProperties),a.sorts={...a.sorts,...i.sorts},a.sortablePropertiesWithTypes={...a.sortablePropertiesWithTypes,...i.sortablePropertiesWithTypes};continue}if(!kK(s))switch(s){case`boolean`:case`number`:case`string`:a.sortableProperties.push(n),a.sortablePropertiesWithTypes[n]=s,a.sorts[n]={docs:new Map,orderedDocsToRemove:new Map,orderedDocs:[],type:s};break;case`geopoint`:case`enum`:continue;case`enum[]`:case`boolean[]`:case`number[]`:case`string[]`:continue;default:throw SK(`INVALID_SORT_SCHEMA_TYPE`,Array.isArray(s)?`array`:s,n)}}}return a}function Uq(e,t,n,r){return r?.enabled===!1?{disabled:!0}:Hq(e,t,n,(r||{}).unsortableProperties||[],``)}function Wq(e,t,n,r){if(!e.enabled)return;e.isSorted=!1;let i=IK(e.sharedInternalDocumentStore,n),a=e.sorts[t];a.orderedDocsToRemove.has(i)&&Zq(e,t),a.docs.set(i,a.orderedDocs.length),a.orderedDocs.push([i,r])}function Gq(e){if(e.isSorted||!e.enabled)return;let t=Object.keys(e.sorts);for(let n of t)Yq(e,n);e.isSorted=!0}function Kq(e,t,n){return t[1].localeCompare(n[1],GG(e))}function qq(e,t){return e[1]-t[1]}function Jq(e,t){return t[1]?-1:1}function Yq(e,t){let n=e.sorts[t],r;switch(n.type){case`string`:r=Kq.bind(null,e.language);break;case`number`:r=qq.bind(null);break;case`boolean`:r=Jq.bind(null);break}n.orderedDocs.sort(r);let i=n.orderedDocs.length;for(let e=0;e<i;e++){let t=n.orderedDocs[e][0];n.docs.set(t,e)}}function Xq(e){let t=Object.keys(e.sorts);for(let n of t)Zq(e,n)}function Zq(e,t){let n=e.sorts[t];n.orderedDocsToRemove.size&&(n.orderedDocs=n.orderedDocs.filter(e=>!n.orderedDocsToRemove.has(e[0])),n.orderedDocsToRemove.clear())}function Qq(e,t,n){if(!e.enabled)return;let r=e.sorts[t],i=IK(e.sharedInternalDocumentStore,n);r.docs.get(i)&&(r.docs.delete(i),r.orderedDocsToRemove.set(i,!0))}function $q(e,t,n){if(!e.enabled)throw SK(`SORT_DISABLED`);let r=n.property,i=n.order===`DESC`,a=e.sorts[r];if(!a)throw SK(`UNABLE_TO_SORT_ON_UNKNOWN_FIELD`,r,e.sortableProperties.join(`, `));return Zq(e,r),Gq(e),t.sort((t,n)=>{let r=a.docs.get(IK(e.sharedInternalDocumentStore,t[0])),o=a.docs.get(IK(e.sharedInternalDocumentStore,n[0])),s=r!==void 0,c=o!==void 0;return!s&&!c?0:s?c?i?o-r:r-o:-1:1}),t}function eJ(e){return e.enabled?e.sortableProperties:[]}function tJ(e){return e.enabled?e.sortablePropertiesWithTypes:{}}function nJ(e,t){let n=t;if(!n.enabled)return{enabled:!1};let r=Object.keys(n.sorts).reduce((e,t)=>{let{docs:r,orderedDocs:i,type:a}=n.sorts[t];return e[t]={docs:new Map(Object.entries(r).map(([e,t])=>[+e,t])),orderedDocsToRemove:new Map,orderedDocs:i,type:a},e},{});return{sharedInternalDocumentStore:e,language:n.language,sortableProperties:n.sortableProperties,sortablePropertiesWithTypes:n.sortablePropertiesWithTypes,sorts:r,enabled:!0,isSorted:n.isSorted}}function rJ(e){if(!e.enabled)return{enabled:!1};Xq(e),Gq(e);let t=Object.keys(e.sorts).reduce((t,n)=>{let{docs:r,orderedDocs:i,type:a}=e.sorts[n];return t[n]={docs:Object.fromEntries(r.entries()),orderedDocs:i,type:a},t},{});return{language:e.language,sortableProperties:e.sortableProperties,sortablePropertiesWithTypes:e.sortablePropertiesWithTypes,sorts:t,enabled:e.enabled,isSorted:e.isSorted}}function iJ(){return{create:Uq,insert:Wq,remove:Qq,save:rJ,load:nJ,sortBy:$q,getSortableProperties:eJ,getSortablePropertiesWithTypes:tJ}}var aJ=192,oJ=383,sJ=[65,65,65,65,65,65,65,67,69,69,69,69,73,73,73,73,69,78,79,79,79,79,79,null,79,85,85,85,85,89,80,115,97,97,97,97,97,97,97,99,101,101,101,101,105,105,105,105,101,110,111,111,111,111,111,null,111,117,117,117,117,121,112,121,65,97,65,97,65,97,67,99,67,99,67,99,67,99,68,100,68,100,69,101,69,101,69,101,69,101,69,101,71,103,71,103,71,103,71,103,72,104,72,104,73,105,73,105,73,105,73,105,73,105,73,105,74,106,75,107,107,76,108,76,108,76,108,76,108,76,108,78,110,78,110,78,110,110,78,110,79,111,79,111,79,111,79,111,82,114,82,114,82,114,83,115,83,115,83,115,83,115,84,116,84,116,84,116,85,117,85,117,85,117,85,117,85,117,85,117,87,119,89,121,89,90,122,90,122,90,122,115];function cJ(e){return e<aJ||e>oJ?e:sJ[e-aJ]||e}function lJ(e){let t=[];for(let n=0;n<e.length;n++)t[n]=cJ(e.charCodeAt(n));return String.fromCharCode(...t)}var uJ={ational:`ate`,tional:`tion`,enci:`ence`,anci:`ance`,izer:`ize`,bli:`ble`,alli:`al`,entli:`ent`,eli:`e`,ousli:`ous`,ization:`ize`,ation:`ate`,ator:`ate`,alism:`al`,iveness:`ive`,fulness:`ful`,ousness:`ous`,aliti:`al`,iviti:`ive`,biliti:`ble`,logi:`log`},dJ={icate:`ic`,ative:``,alize:`al`,iciti:`ic`,ical:`ic`,ful:``,ness:``},fJ=`[^aeiou]`,pJ=`[aeiouy]`,mJ=fJ+`[^aeiouy]*`;pJ+``;var hJ=`^(`+mJ+`)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*`,gJ=`^(`+mJ+`)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*([aeiouy][aeiou]*)?$`,_J=`^(`+mJ+`)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*[aeiouy][aeiou]*[^aeiou][^aeiouy]*`,vJ=`^(`+mJ+`)?[aeiouy]`;function yJ(e){let t,n,r,i,a,o;if(e.length<3)return e;let s=e.substring(0,1);if(s==`y`&&(e=s.toUpperCase()+e.substring(1)),r=/^(.+?)(ss|i)es$/,i=/^(.+?)([^s])s$/,r.test(e)?e=e.replace(r,`$1$2`):i.test(e)&&(e=e.replace(i,`$1$2`)),r=/^(.+?)eed$/,i=/^(.+?)(ed|ing)$/,r.test(e)){let t=r.exec(e);r=new RegExp(hJ),r.test(t[1])&&(r=/.$/,e=e.replace(r,``))}else i.test(e)&&(t=i.exec(e)[1],i=new RegExp(vJ),i.test(t)&&(e=t,i=/(at|bl|iz)$/,a=RegExp(`([^aeiouylsz])\\1$`),o=RegExp(`^`+mJ+pJ+`[^aeiouwxy]$`),i.test(e)?e+=`e`:a.test(e)?(r=/.$/,e=e.replace(r,``)):o.test(e)&&(e+=`e`)));if(r=/^(.+?)y$/,r.test(e)&&(t=r.exec(e)?.[1],r=new RegExp(vJ),t&&r.test(t)&&(e=t+`i`)),r=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,r.test(e)){let i=r.exec(e);t=i?.[1],n=i?.[2],r=new RegExp(hJ),t&&r.test(t)&&(e=t+uJ[n])}if(r=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,r.test(e)){let i=r.exec(e);t=i?.[1],n=i?.[2],r=new RegExp(hJ),t&&r.test(t)&&(e=t+dJ[n])}if(r=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,i=/^(.+?)(s|t)(ion)$/,r.test(e))t=r.exec(e)?.[1],r=new RegExp(_J),t&&r.test(t)&&(e=t);else if(i.test(e)){let n=i.exec(e);t=n?.[1]??``+n?.[2]??``,i=new RegExp(_J),i.test(t)&&(e=t)}return r=/^(.+?)e$/,r.test(e)&&(t=r.exec(e)?.[1],r=new RegExp(_J),i=new RegExp(gJ),a=RegExp(`^`+mJ+pJ+`[^aeiouwxy]$`),t&&(r.test(t)||i.test(t)&&!a.test(t))&&(e=t)),r=/ll$/,i=new RegExp(_J),r.test(e)&&i.test(e)&&(r=/.$/,e=e.replace(r,``)),s==`y`&&(e=s.toLowerCase()+e.substring(1)),e}function bJ(e,t,n=!0){let r=`${this.language}:${e}:${t}`;return n&&this.normalizationCache.has(r)?this.normalizationCache.get(r):this.stopWords?.includes(t)?(n&&this.normalizationCache.set(r,``),``):(this.stemmer&&!this.stemmerSkipProperties.has(e)&&(t=this.stemmer(t)),t=lJ(t),n&&this.normalizationCache.set(r,t),t)}function xJ(e){for(;e[e.length-1]===``;)e.pop();for(;e[0]===``;)e.shift();return e}function SJ(e,t,n,r=!0){if(t&&t!==this.language)throw SK(`LANGUAGE_NOT_SUPPORTED`,t);if(typeof e!=`string`)return[e];let i=this.normalizeToken.bind(this,n??``),a;if(n&&this.tokenizeSkipProperties.has(n))a=[i(e,r)];else{let t=UG[this.language];a=e.toLowerCase().split(t).map(e=>i(e,r)).filter(Boolean)}let o=xJ(a);return this.allowDuplicates?o:Array.from(new Set(o))}function CJ(e={}){if(!e.language)e.language=`english`;else if(!WG.includes(e.language))throw SK(`LANGUAGE_NOT_SUPPORTED`,e.language);let t;if(e.stemming||e.stemmer&&!(`stemming`in e))if(e.stemmer){if(typeof e.stemmer!=`function`)throw SK(`INVALID_STEMMER_FUNCTION_TYPE`);t=e.stemmer}else if(e.language===`english`)t=yJ;else throw SK(`MISSING_STEMMER`,e.language);let n;if(e.stopWords!==!1){if(n=[],Array.isArray(e.stopWords))n=e.stopWords;else if(typeof e.stopWords==`function`)n=e.stopWords(n);else if(e.stopWords)throw SK(`CUSTOM_STOP_WORDS_MUST_BE_FUNCTION_OR_ARRAY`);if(!Array.isArray(n))throw SK(`CUSTOM_STOP_WORDS_MUST_BE_FUNCTION_OR_ARRAY`);for(let e of n)if(typeof e!=`string`)throw SK(`CUSTOM_STOP_WORDS_MUST_BE_FUNCTION_OR_ARRAY`)}let r={tokenize:SJ,language:e.language,stemmer:t,stemmerSkipProperties:new Set(e.stemmerSkipProperties?[e.stemmerSkipProperties].flat():[]),tokenizeSkipProperties:new Set(e.tokenizeSkipProperties?[e.tokenizeSkipProperties].flat():[]),stopWords:n,allowDuplicates:!!e.allowDuplicates,normalizeToken:bJ,normalizationCache:new Map};return r.tokenize=SJ.bind(r),r.normalizeToken=bJ,r}function wJ(e){return{sharedInternalDocumentStore:e,rules:new Map}}function TJ(e,t){if(e.rules.has(t.id))throw Error(`PINNING_RULE_ALREADY_EXISTS: A pinning rule with id "${t.id}" already exists. Use updateRule to modify it.`);e.rules.set(t.id,t)}function EJ(e,t){if(!e.rules.has(t.id))throw Error(`PINNING_RULE_NOT_FOUND: Cannot update pinning rule with id "${t.id}" because it does not exist. Use addRule to create it.`);e.rules.set(t.id,t)}function DJ(e,t){return e.rules.delete(t)}function OJ(e,t){return e.rules.get(t)}function kJ(e){return Array.from(e.rules.values())}function AJ(e,t){let n=e.toLowerCase().trim(),r=t.pattern.toLowerCase().trim();switch(t.anchoring){case`is`:return n===r;case`starts_with`:return n.startsWith(r);case`contains`:return n.includes(r);default:return!1}}function jJ(e,t){return e?t.conditions.every(t=>AJ(e,t)):!1}function MJ(e,t){if(!t)return[];let n=[];for(let r of e.rules.values())jJ(t,r)&&n.push(r);return n}function NJ(e,t){return{sharedInternalDocumentStore:e,rules:new Map(t?.rules??[])}}function PJ(e){return{rules:Array.from(e.rules.entries())}}function FJ(){return{create:wJ,addRule:TJ,updateRule:EJ,removeRule:DJ,getRule:OJ,getAllRules:kJ,getMatchingRules:MJ,load:NJ,save:PJ}}function IJ(e){let t={formatElapsedTime:CK,getDocumentIndexId:wK,getDocumentProperties:lK,validateSchema:TK};for(let n of ZK){let r=n;if(e[r]){if(typeof e[r]!=`function`)throw SK(`COMPONENT_MUST_BE_FUNCTION`,r)}else e[r]=t[r]}for(let t of Object.keys(e))if(!XK.includes(t)&&!ZK.includes(t))throw SK(`UNSUPPORTED_COMPONENT`,t)}function LJ({schema:e,sort:t,language:n,components:r,id:i,plugins:a}){r||={};for(let t of a??[]){if(!(`getComponents`in t)||typeof t.getComponents!=`function`)continue;let n=t.getComponents(e),i=Object.keys(n);for(let e of i)if(r[e])throw SK(`PLUGIN_COMPONENT_CONFLICT`,e,t.name);r={...r,...n}}i||=aK();let o=r.tokenizer,s=r.index,c=r.documentsStore,l=r.sorter,u=r.pinning;if(o=o?o.tokenize?o:CJ(o):CJ({language:n??`english`}),r.tokenizer&&n)throw SK(`NO_LANGUAGE_WITH_CUSTOM_TOKENIZER`);let d=NK();s||=Iq(),l||=iJ(),c||=qK(),u||=FJ(),IJ(r);let{getDocumentProperties:f,getDocumentIndexId:p,validateSchema:m,formatElapsedTime:h}=r,g={data:{},caches:{},schema:e,tokenizer:o,index:s,sorter:l,documentsStore:c,pinning:u,internalDocumentIDStore:d,getDocumentProperties:f,getDocumentIndexId:p,validateSchema:m,beforeInsert:[],afterInsert:[],beforeRemove:[],afterRemove:[],beforeUpdate:[],afterUpdate:[],beforeUpsert:[],afterUpsert:[],beforeSearch:[],afterSearch:[],beforeInsertMultiple:[],afterInsertMultiple:[],beforeRemoveMultiple:[],afterRemoveMultiple:[],beforeUpdateMultiple:[],afterUpdateMultiple:[],beforeUpsertMultiple:[],afterUpsertMultiple:[],afterCreate:[],formatElapsedTime:h,id:i,plugins:a,version:RJ()};g.data={index:g.index.create(g,d,e),docs:g.documentsStore.create(g,d),sorting:g.sorter.create(g,d,e,t),pinning:g.pinning.create(d)};for(let e of JK)g[e]=(g[e]??[]).concat(YK(g,e));let _=g.afterCreate;return _&&nq(_,g),g}function RJ(){return`{{VERSION}}`}function zJ(e){return e.documentsStore.count(e.data.docs)}function BJ(e,t,n,r,i){let a=e.validateSchema(t,e.schema);if(a)throw SK(`SCHEMA_VALIDATION_FAILURE`,a);return mK(e.beforeInsert)||mK(e.afterInsert)||mK(e.index.beforeInsert)||mK(e.index.insert)||mK(e.index.afterInsert)?UJ(e,t,n,r,i):WJ(e,t,n,r,i)}var VJ=new Set([`enum`,`enum[]`]),HJ=new Set([`string`,`number`]);async function UJ(e,t,n,r,i){let{index:a,docs:o}=e.data,s=e.getDocumentIndexId(t);if(typeof s!=`string`)throw SK(`DOCUMENT_ID_MUST_BE_STRING`,typeof s);let c=IK(e.internalDocumentIDStore,s);if(r||await QK(e.beforeInsert,e,s,t),!e.documentsStore.store(o,s,c,t))throw SK(`DOCUMENT_ALREADY_EXISTS`,s);let l=e.documentsStore.count(o),u=e.index.getSearchableProperties(a),d=e.index.getSearchablePropertiesWithTypes(a),f=e.getDocumentProperties(t,u);for(let[e,t]of Object.entries(f)){if(t===void 0)continue;let n=typeof t,r=d[e];GJ(n,r,e,t)}return await KJ(e,s,u,f,l,n,t,i),r||await QK(e.afterInsert,e,s,t),s}function WJ(e,t,n,r,i){let{index:a,docs:o}=e.data,s=e.getDocumentIndexId(t);if(typeof s!=`string`)throw SK(`DOCUMENT_ID_MUST_BE_STRING`,typeof s);let c=IK(e.internalDocumentIDStore,s);if(r||QK(e.beforeInsert,e,s,t),!e.documentsStore.store(o,s,c,t))throw SK(`DOCUMENT_ALREADY_EXISTS`,s);let l=e.documentsStore.count(o),u=e.index.getSearchableProperties(a),d=e.index.getSearchablePropertiesWithTypes(a),f=e.getDocumentProperties(t,u);for(let[e,t]of Object.entries(f)){if(t===void 0)continue;let n=typeof t,r=d[e];GJ(n,r,e,t)}return qJ(e,s,u,f,l,n,t,i),r||QK(e.afterInsert,e,s,t),s}function GJ(e,t,n,r){if(!(OK(t)&&typeof r==`object`&&typeof r.lon==`number`&&typeof r.lat==`number`)&&!(kK(t)&&Array.isArray(r))&&!(AK(t)&&Array.isArray(r))&&!(VJ.has(t)&&HJ.has(e))&&e!==t)throw SK(`INVALID_DOCUMENT_PROPERTY`,n,t,e)}async function KJ(e,t,n,r,i,a,o,s){for(let o of n){let n=r[o];if(n===void 0)continue;let c=e.index.getSearchablePropertiesWithTypes(e.data.index)[o];await e.index.beforeInsert?.(e.data.index,o,t,n,c,a,e.tokenizer,i);let l=e.internalDocumentIDStore.idToInternalId.get(t);await e.index.insert(e.index,e.data.index,o,t,l,n,c,a,e.tokenizer,i,s),await e.index.afterInsert?.(e.data.index,o,t,n,c,a,e.tokenizer,i)}let c=e.sorter.getSortableProperties(e.data.sorting),l=e.getDocumentProperties(o,c);for(let n of c){let r=l[n];if(r===void 0)continue;let i=e.sorter.getSortablePropertiesWithTypes(e.data.sorting)[n];e.sorter.insert(e.data.sorting,n,t,r,i,a)}}function qJ(e,t,n,r,i,a,o,s){for(let o of n){let n=r[o];if(n===void 0)continue;let c=e.index.getSearchablePropertiesWithTypes(e.data.index)[o],l=IK(e.internalDocumentIDStore,t);e.index.beforeInsert?.(e.data.index,o,t,n,c,a,e.tokenizer,i),e.index.insert(e.index,e.data.index,o,t,l,n,c,a,e.tokenizer,i,s),e.index.afterInsert?.(e.data.index,o,t,n,c,a,e.tokenizer,i)}let c=e.sorter.getSortableProperties(e.data.sorting),l=e.getDocumentProperties(o,c);for(let n of c){let r=l[n];if(r===void 0)continue;let i=e.sorter.getSortablePropertiesWithTypes(e.data.sorting)[n];e.sorter.insert(e.data.sorting,n,t,r,i,a)}}function JJ(e,t,n,r,i,a){return mK(e.afterInsertMultiple)||mK(e.beforeInsertMultiple)||mK(e.index.beforeInsert)||mK(e.index.insert)||mK(e.index.afterInsert)?YJ(e,t,n,r,i,a):XJ(e,t,n,r,i,a)}async function YJ(e,t,n=1e3,r,i,a=0){let o=[],s=async a=>{let s=Math.min(a+n,t.length),c=t.slice(a,s);for(let t of c){let n=await BJ(e,t,r,i,{avlRebalanceThreshold:c.length});o.push(n)}return s};return await(async()=>{let e=0;for(;e<t.length;){let t=Date.now();if(e=await s(e),a>0){let e=a-(Date.now()-t);e>0&&bK(e)}}})(),i||await $K(e.afterInsertMultiple,e,t),o}function XJ(e,t,n=1e3,r,i,a=0){let o=[],s=0;function c(){let a=t.slice(s*n,(s+1)*n);if(a.length===0)return!1;for(let t of a){let n=BJ(e,t,r,i,{avlRebalanceThreshold:a.length});o.push(n)}return s++,!0}function l(){let e=Date.now();for(;c();)if(a>0){let t=Date.now()-e;if(t>=a){let e=a-t%a;e>0&&bK(e)}}}return l(),i||$K(e.afterInsertMultiple,e,t),o}function ZJ(e,t){return e[1]-t[1]}function QJ(e,t){return t[1]-e[1]}function $J(e=`desc`){return e.toLowerCase()===`asc`?ZJ:QJ}function eY(e,t,n){let r={},i=t.map(([e])=>e),a=e.documentsStore.getMultiple(e.data.docs,i),o=Object.keys(n),s=e.index.getSearchablePropertiesWithTypes(e.data.index);for(let e of o){let t;if(s[e]===`number`){let{ranges:r}=n[e],i=r.length,a=Array.from({length:i});for(let e=0;e<i;e++){let t=r[e];a[e]=[`${t.from}-${t.to}`,0]}t=Object.fromEntries(a)}r[e]={count:0,values:t??{}}}let c=a.length;for(let e=0;e<c;e++){let t=a[e];for(let e of o){let i=e.includes(`.`)?uK(t,e):t[e],a=s[e],o=r[e].values;switch(a){case`number`:{let t=n[e].ranges;tY(t,o)(i);break}case`number[]`:{let t=new Set,r=n[e].ranges,a=tY(r,o,t);for(let e of i)a(e);break}case`boolean`:case`enum`:case`string`:nY(o,a)(i);break;case`boolean[]`:case`enum[]`:case`string[]`:{let e=nY(o,a===`boolean[]`?`boolean`:`string`,new Set);for(let t of i)e(t);break}default:throw SK(`FACET_NOT_SUPPORTED`,a)}}}for(let e of o){let t=r[e];if(t.count=Object.keys(t.values).length,s[e]===`string`){let r=n[e],i=$J(r.sort);t.values=Object.fromEntries(Object.entries(t.values).sort(i).slice(r.offset??0,r.limit??10))}}return r}function tY(e,t,n){return r=>{for(let i of e){let e=`${i.from}-${i.to}`;n?.has(e)||r>=i.from&&r<=i.to&&(t[e]===void 0?t[e]=1:(t[e]++,n?.add(e)))}}}function nY(e,t,n){let r=t===`boolean`?`false`:``;return t=>{let i=t?.toString()??r;n?.has(i)||(e[i]=(e[i]??0)+1,n?.add(i))}}var rY={reducer:(e,t,n,r)=>(t[r]=n,t),getInitialValue:e=>Array.from({length:e})},iY=[`string`,`number`,`boolean`];function aY(e,t,n){let r=n.properties,i=r.length,a=e.index.getSearchablePropertiesWithTypes(e.data.index);for(let e=0;e<i;e++){let t=r[e];if(a[t]===void 0)throw SK(`UNKNOWN_GROUP_BY_PROPERTY`,t);if(!iY.includes(a[t]))throw SK(`INVALID_GROUP_BY_PROPERTY`,t,iY.join(`, `),a[t])}let o=t.map(([t])=>LK(e.internalDocumentIDStore,t)),s=e.documentsStore.getMultiple(e.data.docs,o),c=s.length,l=n.maxResult||2**53-1,u=[],d={};for(let e=0;e<i;e++){let t=r[e],n={property:t,perValue:{}},i=new Set;for(let e=0;e<c;e++){let r=s[e],a=uK(r,t);if(a===void 0)continue;let o=typeof a==`boolean`?``+a:a,c=n.perValue[o]??{indexes:[],count:0};c.count>=l||(c.indexes.push(e),c.count++,n.perValue[o]=c,i.add(a))}u.push(Array.from(i)),d[t]=n}let f=oY(u),p=f.length,m=[];for(let e=0;e<p;e++){let t=f[e],n=t.length,i={values:[],indexes:[]},a=[];for(let e=0;e<n;e++){let n=t[e],o=r[e];a.push(d[o].perValue[typeof n==`boolean`?``+n:n].indexes),i.values.push(n)}i.indexes=cK(a).sort((e,t)=>e-t),i.indexes.length!==0&&m.push(i)}let h=m.length,g=Array.from({length:h});for(let e=0;e<h;e++){let r=m[e],i=n.reduce||rY,a=r.indexes.map(e=>({id:o[e],score:t[e][1],document:s[e]})),c=i.reducer.bind(null,r.values),l=i.getInitialValue(r.indexes.length),u=a.reduce(c,l);g[e]={values:r.values,result:u}}return g}function oY(e,t=0){if(t+1===e.length)return e[t].map(e=>[e]);let n=e[t],r=oY(e,t+1),i=[];for(let e of n)for(let t of r){let n=[e];QG(n,t),i.push(n)}return i}function sY(e,t,n,r){let i=MJ(t,r);if(i.length===0)return n;let a=i.flatMap(e=>e.consequence.promote);a.sort((e,t)=>e.position-t.position);let o=new Set,s=new Map,c=new Set;for(let t of a){let n=IK(e.internalDocumentIDStore,t.doc_id);if(n!==void 0){if(s.has(n)){let e=s.get(n);t.position<e&&s.set(n,t.position);continue}c.has(t.position)||(o.add(n),s.set(n,t.position),c.add(t.position))}}if(s.size===0)return n;let l=n.filter(([e])=>!o.has(e)),u=[];for(let[t,r]of s.entries())n.find(([e])=>e===t)?u.push([t,1e6-r]):e.documentsStore.get(e.data.docs,t)&&u.push([t,0]);u.sort((e,t)=>(s.get(e[0])??1/0)-(s.get(t[0])??1/0));let d=[],f=new Map;for(let e of u){let t=s.get(e[0]);f.set(t,e)}let p=0,m=0;for(;m<l.length+u.length;)if(f.has(m))d.push(f.get(m)),m++;else if(p<l.length)d.push(l[p]),p++,m++;else break;for(let[e,t]of f.entries())e>=d.length&&d.push(t);return d}function cY(e,t,n){let{term:r,properties:i}=t,a=e.data.index,o=e.caches.propertiesToSearch;if(!o){let t=e.index.getSearchablePropertiesWithTypes(a);o=e.index.getSearchableProperties(a),o=o.filter(e=>t[e].startsWith(`string`)),e.caches.propertiesToSearch=o}if(i&&i!==`*`){for(let e of i)if(!o.includes(e))throw SK(`UNKNOWN_INDEX`,e,o.join(`, `));o=o.filter(e=>i.includes(e))}let s=Object.keys(t.where??{}).length>0,c;s&&(c=e.index.searchByWhereClause(a,e.tokenizer,t.where,n));let l,u=t.threshold!==void 0&&t.threshold!==null?t.threshold:1;if(r||i){let i=zJ(e);if(l=e.index.search(a,r||``,e.tokenizer,n,o,t.exact||!1,t.tolerance||0,t.boost||{},pY(t.relevance),i,c,u),t.exact&&r){let t=r.trim().split(/\s+/);l=l.filter(([n])=>{let r=e.documentsStore.get(e.data.docs,n);if(!r)return!1;for(let e of o){let n=uY(r,e);if(typeof n==`string`&&t.every(e=>RegExp(`\\b${lY(e)}\\b`).test(n)))return!0}return!1})}}else l=s?Bq(a,t.where)||(c?Array.from(c):[]).map(e=>[+e,0]):Object.keys(e.documentsStore.getAll(e.data.docs)).map(e=>[+e,0]);return l}function lY(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function uY(e,t){let n=t.split(`.`),r=e;for(let e of n)if(r&&typeof r==`object`&&e in r)r=r[e];else return;return r}function dY(e,t,n){let r=iK();function i(){let i=Object.keys(e.data.index.vectorIndexes),a=t.facets&&Object.keys(t.facets).length>0,{limit:o=10,offset:s=0,distinctOn:c,includeVectors:l=!1}=t,u=t.preflight===!0,d=cY(e,t,n);if(t.sortBy)if(typeof t.sortBy==`function`){let n=d.map(([e])=>e),r=e.documentsStore.getMultiple(e.data.docs,n).map((e,t)=>[d[t][0],d[t][1],e]);r.sort(t.sortBy),d=r.map(([e,t])=>[e,t])}else d=e.sorter.sortBy(e.data.sorting,d,t.sortBy).map(([t,n])=>[IK(e.internalDocumentIDStore,t),n]);else d=d.sort(sK);d=sY(e,e.data.pinning,d,t.term);let f;u||(f=c?TY(e,d,s,o,c):EY(e,d,s,o));let p={elapsed:{formatted:``,raw:0},hits:[],count:d.length};return f!==void 0&&(p.hits=f.filter(Boolean),l||pK(p,i)),a&&(p.facets=eY(e,d,t.facets)),t.groupBy&&(p.groups=aY(e,d,t.groupBy)),p.elapsed=e.formatElapsedTime(iK()-r),p}async function a(){e.beforeSearch&&await tq(e.beforeSearch,e,t,n);let r=i();return e.afterSearch&&await eq(e.afterSearch,e,t,n,r),r}return e.beforeSearch?.length||e.afterSearch?.length?a():i()}var fY={k:1.2,b:.75,d:.5};function pY(e){let t=e??{};return t.k=t.k??fY.k,t.b=t.b??fY.b,t.d=t.d??fY.d,t}function mY(e,t,n){let r=t.vector;if(r&&(!(`value`in r)||!(`property`in r)))throw SK(`INVALID_VECTOR_INPUT`,Object.keys(r).join(`, `));let i=e.data.index.vectorIndexes[r.property];if(!i)throw SK(`UNKNOWN_VECTOR_PROPERTY`,r.property);let a=i.node.size;if(r?.value.length!==a)throw r?.property===void 0||r?.value.length===void 0?SK(`INVALID_INPUT_VECTOR`,`undefined`,a,`undefined`):SK(`INVALID_INPUT_VECTOR`,r.property,a,r.value.length);let o=e.data.index,s;return Object.keys(t.where??{}).length>0&&(s=e.index.searchByWhereClause(o,e.tokenizer,t.where,n)),i.node.find(r.value,t.similarity??.8,s)}function hY(e,t,n=`english`){let r=iK();function i(){let i=mY(e,t,n).sort(sK);i=sY(e,e.data.pinning,i,void 0);let a=[];t.facets&&Object.keys(t.facets).length>0&&(a=eY(e,i,t.facets));let o=t.vector.property,s=t.includeVectors??!1,c=t.limit??10,l=t.offset??0,u=Array.from({length:c});for(let t=0;t<c;t++){let n=i[t+l];if(!n)break;let r=e.data.docs.docs[n[0]];r&&(s||(r[o]=null),u[t]={id:LK(e.internalDocumentIDStore,n[0]),score:n[1],document:r})}let d=[];t.groupBy&&(d=aY(e,i,t.groupBy));let f=iK()-r;return{count:i.length,hits:u.filter(Boolean),elapsed:{raw:Number(f),formatted:rK(f)},...a?{facets:a}:{},...d?{groups:d}:{}}}async function a(){e.beforeSearch&&await tq(e.beforeSearch,e,t,n);let r=i();return e.afterSearch&&await eq(e.afterSearch,e,t,n,r),r}return e.beforeSearch?.length||e.afterSearch?.length?a():i()}function gY(e,t,n){let r=yY(cY(e,t,n)),i=mY(e,t,n),a=t.hybridWeights;return SY(r,i,t.term??``,a)}function _Y(e,t,n){let r=iK();function i(){let i=gY(e,t,n);i=sY(e,e.data.pinning,i,t.term);let a;t.facets&&Object.keys(t.facets).length>0&&(a=eY(e,i,t.facets));let o;t.groupBy&&(o=aY(e,i,t.groupBy));let s=t.offset??0,c=t.limit??10,l=EY(e,i,s,c).filter(Boolean),u=iK(),d={count:i.length,elapsed:{raw:Number(u-r),formatted:rK(u-r)},hits:l,...a?{facets:a}:{},...o?{groups:o}:{}};return(t.includeVectors??!1)||pK(d,Object.keys(e.data.index.vectorIndexes)),d}async function a(){e.beforeSearch&&await tq(e.beforeSearch,e,t,n);let r=i();return e.afterSearch&&await eq(e.afterSearch,e,t,n,r),r}return e.beforeSearch?.length||e.afterSearch?.length?a():i()}function vY(e){return e[1]}function yY(e){let t=Math.max.apply(Math,e.map(vY));return e.map(([e,n])=>[e,n/t])}function bY(e,t){return e/t}function xY(e,t){return(n,r)=>n*e+r*t}function SY(e,t,n,r){let i=Math.max.apply(Math,e.map(vY)),a=Math.max.apply(Math,t.map(vY)),{text:o,vector:s}=r&&r.text&&r.vector?r:CY(n),c=new Map,l=e.length,u=xY(o,s);for(let t=0;t<l;t++){let[n,r]=e[t],a=u(bY(r,i),0);c.set(n,a)}let d=t.length;for(let e=0;e<d;e++){let[n,r]=t[e],i=bY(r,a),o=c.get(n)??0;c.set(n,o+u(0,i))}return[...c].sort((e,t)=>t[1]-e[1])}function CY(e){return{text:.5,vector:.5}}function wY(e,t,n){let r=t.mode??`fulltext`;if(r===`fulltext`)return dY(e,t,n);if(r===`vector`)return hY(e,t);if(r===`hybrid`)return _Y(e,t);throw SK(`INVALID_SEARCH_MODE`,r)}function TY(e,t,n,r,i){let a=e.data.docs,o=new Map,s=[],c=new Set,l=t.length,u=0;for(let d=0;d<l;d++){let l=t[d];if(l===void 0)continue;let[f,p]=l;if(c.has(f))continue;let m=e.documentsStore.get(a,f),h=uK(m,i);if(!(h===void 0||o.has(h))&&(o.set(h,!0),u++,!(u<=n)&&(s.push({id:LK(e.internalDocumentIDStore,f),score:p,document:m}),c.add(f),u>=n+r)))break}return s}function EY(e,t,n,r){let i=e.data.docs,a=Array.from({length:r}),o=new Set;for(let s=n;s<r+n;s++){let n=t[s];if(n===void 0)break;let[r,c]=n;if(!o.has(r)){let t=e.documentsStore.get(i,r);a[s]={id:LK(e.internalDocumentIDStore,r),score:c,document:t},o.add(r)}}return a}var DY=r(VG(),1),OY=Eo({at:P(),transport:P(),outcome:P(),reference:P().optional(),error:P().optional()}),kY=Eo({reason:P(),at:P()});Eo({version:F().int().catch(1),id:P(),createdAt:P(),bundleLevel:P(),zipBytes:F().int().nonnegative().catch(0),zipDeleted:I().optional(),state:P(),systemWide:I().optional(),projectSlug:P().nullable().optional(),reference:P().optional(),lastError:kY.optional(),attempts:L(OY).optional(),note:P().optional()});var AY=`0.0.0-unknown`,jY={protocol:`x-ok-client-protocol`,runtime:`x-ok-client-runtime`,kind:`x-ok-client-kind`};function MY({kind:e,runtimeVersion:t}){return{[jY.protocol]:`1`,[jY.runtime]:t,[jY.kind]:e}}function NY({kind:e,runtimeVersion:t}){return{clientProtocolVersion:1,clientRuntimeVersion:t,clientKind:e}}var PY=`extra/screenshot.png`,FY=[{name:`macos-home-path`,regex:/\/Users\/[^/]+\//g,replacement:`~/`},{name:`linux-home-path`,regex:/\/home\/[^/]+\//g,replacement:`~/`},{name:`github-pat`,regex:/\b(ghp_|gho_|ghu_|ghs_|ghr_)[A-Za-z0-9]{36,}\b/g,replacement:`[REDACTED-GH-PAT]`},{name:`aws-access-key`,regex:/\b(AKIA|ASIA|ABIA)[A-Z2-7]{16}\b/g,replacement:`[REDACTED-AWS-KEY]`},{name:`anthropic-key`,regex:/\bsk-ant-api03-[A-Za-z0-9_-]{20,}\b/g,replacement:`[REDACTED-ANTHROPIC]`},{name:`openai-key`,regex:/\bsk-[A-Za-z0-9]{20,}\b/g,replacement:`[REDACTED-OPENAI]`},{name:`bearer-token`,regex:/([Aa]uthorization:\s*[Bb]earer\s+)\S+/g,replacement:`$1[REDACTED]`},{name:`jwt`,regex:/eyJ[A-Za-z0-9_-]{8,}\.eyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}/g,replacement:`[REDACTED-JWT]`},{name:`url-credentials`,regex:/:\/\/[^/\s:@]+:[^/\s:@]+@/g,replacement:`://[REDACTED]@`},{name:`github-pat-fine-grained`,regex:/\bgithub_pat_[0-9A-Za-z_]{20,}/g,replacement:`[REDACTED-GH-PAT]`},{name:`openai-key-modern`,regex:/\bsk-(?:proj|svcacct|admin|None)-[A-Za-z0-9_-]{20,}/g,replacement:`[REDACTED-OPENAI]`},{name:`slack-token`,regex:/\bxox[a-z]-[A-Za-z0-9-]{10,}/g,replacement:`[REDACTED-SLACK]`},{name:`google-api-key`,regex:/\bAIza[0-9A-Za-z_-]{35}/g,replacement:`[REDACTED-GOOGLE]`},{name:`stripe-secret-key`,regex:/\b(?:sk|rk)_live_[0-9A-Za-z]{16,}\b/g,replacement:`[REDACTED-STRIPE]`},{name:`gitlab-pat`,regex:/\bglpat-[0-9A-Za-z_-]{20,}/g,replacement:`[REDACTED-GITLAB]`},{name:`bearer-token-json`,regex:/("[Aa]uthorization"\s*:\s*"[Bb]earer\s+)[^"]+/g,replacement:`$1[REDACTED]`}];FY.map(e=>e.name);function IY(e){let t=new Set,n=0;return{redacted:e.split(`
402
+ `).map(e=>{let r=e,i=!1;for(let{name:e,regex:n,replacement:a}of FY)n.lastIndex=0,n.test(r)&&(t.add(e),i=!0,n.lastIndex=0,r=r.replace(n,a));return i&&n++,r}).join(`
403
+ `),patterns:[...t],lineCount:n}}function LY(e){return IY(e).redacted}var RY=8192,zY=32768,BY=`…[truncated]`;function VY(e){let t=e.trim();if(t.length===0||t[0]!==`{`)return null;let n;try{n=JSON.parse(t)}catch{return null}if(typeof n!=`object`||!n||Array.isArray(n))return null;let r=n;return{event:typeof r.event==`string`?r.event:void 0,fields:r}}function HY(e){return e.length<=8192?e:`${e.slice(0,RY-12)}${BY}`}function UY(e,t){return!(e.host===`desktop`&&t.host!==`desktop`||e.singleFileHidden&&t.singleFile||e.requiresTerminalLive&&!t.terminalLive||e.requiresCanExpandAll&&!t.canExpandAll||e.requiresCanCollapseAll&&!t.canCollapseAll||e.requiresActiveDoc&&!t.hasActiveDoc||e.requiresInstallSkill&&!t.showInstallSkill||e.requiresTargetKinds&&!e.requiresTargetKinds.includes(t.activeTargetKind))}var WY=[{id:`navigate-back`,menuActionId:`navigate-back`,labelKey:`back`,keywords:[`previous history`],shortcutId:`navigate-back`,shortcutDesktopOnly:!0,availability:{host:`desktop`},palette:{group:`commands`,visibility:`search-only`},menu:[{section:`view-history`,order:0,platform:`mac`,accelerator:`Cmd+[`},{section:`view-history`,order:0,platform:`other`,accelerator:`Alt+Left`}]},{id:`navigate-forward`,menuActionId:`navigate-forward`,labelKey:`forward`,keywords:[`next history`],shortcutId:`navigate-forward`,shortcutDesktopOnly:!0,availability:{host:`desktop`},palette:{group:`commands`,visibility:`search-only`},menu:[{section:`view-history`,order:1,platform:`mac`,accelerator:`Cmd+]`},{section:`view-history`,order:1,platform:`other`,accelerator:`Alt+Right`}]},{id:`new-file`,menuActionId:`new-doc`,labelKey:`newFile`,keywords:[`create file`],shortcutId:`new-item`,availability:{},palette:{group:`commands`,visibility:`always`},menu:[{section:`file-create`,order:0,accelerator:`CmdOrCtrl+N`}]},{id:`new-folder`,menuActionId:`new-folder`,labelKey:`newFolder`,keywords:[`create folder`],shortcutId:`new-folder`,shortcutDesktopOnly:!0,availability:{},palette:{group:`commands`,visibility:`always`},menu:[{section:`file-create`,order:1,accelerator:`CmdOrCtrl+Shift+N`}]},{id:`open-graph`,labelKey:`openGraph`,keywords:[`graph panel network`],availability:{requiresActiveDoc:!0},palette:{group:`commands`,visibility:`always`}},{id:`initialize-starter-pack`,labelKey:`initializeStarterPack`,keywords:[`scaffold`,`seed`,`pack`,`starter`],availability:{},palette:{group:`commands`,visibility:`always`}},{id:`new-project`,menuActionId:`new-project`,labelKey:`newProject`,keywords:[`create new project scaffold`],availability:{host:`desktop`},palette:{group:`project`,visibility:`always`},menu:[{section:`file-project`,order:0,ellipsis:!0}]},{id:`open-folder`,labelKey:`openFolderOnDisk`,keywords:[`project`,`folder`,`disk`],shortcutId:`open-folder`,availability:{host:`desktop`},palette:{group:`project`,visibility:`always`},menu:[{section:`file-project`,order:2,accelerator:`CmdOrCtrl+O`,ellipsis:!0,menuLabelKey:`openFolder`}]},{id:`open-file`,labelKey:`openFileOnDisk`,keywords:[`file`,`markdown`,`single`,`standalone`,`temporary`],shortcutId:`open-file`,availability:{host:`desktop`},palette:{group:`project`,visibility:`always`},menu:[{section:`file-project`,order:3,accelerator:`CmdOrCtrl+Shift+O`,ellipsis:!0,menuLabelKey:`openFile`}]},{id:`switch-project`,labelKey:`switchProject`,keywords:[`switch project navigator projects`],shortcutId:`switch-project`,availability:{host:`desktop`,singleFileHidden:!0},palette:{group:`project`,visibility:`always`},menu:[{section:`file-project`,order:1,accelerator:`CmdOrCtrl+Shift+P`,ellipsis:!0}]},{id:`settings`,labelKey:`settings`,keywords:[`preferences config`],shortcutId:`settings`,availability:{singleFileHidden:!0},palette:{group:`project`,visibility:`always`},menu:[{section:`app-settings`,order:0,platform:`mac`,accelerator:`CmdOrCtrl+,`,ellipsis:!0},{section:`file-settings`,order:0,platform:`other`,accelerator:`CmdOrCtrl+,`,ellipsis:!0}]},{id:`install-claude-desktop`,labelKey:`installClaudeDesktop`,keywords:[`claude desktop install cowork`],availability:{requiresInstallSkill:!0},palette:{group:`project`,visibility:`always`},menu:[{section:`help-install`,order:0,ellipsis:!0,menuLabelText:`Install for Claude Chat & Cowork (desktop app)`}]},{id:`report-bug`,menuActionId:`report-bug`,labelKey:`reportBug`,keywords:[`bug report issue feedback problem`],availability:{host:`desktop`},palette:{group:`project`,visibility:`always`},menu:[{section:`help-links`,order:1,ellipsis:!0}]},{id:`bug-report-history`,labelKey:`bugReportHistory`,keywords:[`bug report history previous reports past retry resend`],availability:{host:`desktop`},palette:{group:`project`,visibility:`always`}},{id:`send-feedback`,menuActionId:`send-feedback`,labelKey:`sendFeedback`,keywords:[`feedback`,`suggestion`,`idea`,`rate`,`survey`,`contact`],availability:{},palette:{group:`project`,visibility:`always`},menu:[{section:`help-links`,order:2,ellipsis:!0}]},{id:`new-from-template`,menuActionId:`new-from-template`,labelKey:`newFromTemplate`,keywords:[`template`,`create`,`new`],availability:{singleFileHidden:!0},palette:{group:`file`,visibility:`search-only`},menu:[{section:`file-create`,order:2,ellipsis:!0}]},{id:`rename`,menuActionId:`rename`,labelKey:`rename`,keywords:[`rename`,`file`,`folder`],availability:{host:`desktop`,requiresTargetKinds:[`doc`,`folder`,`asset`]},palette:{group:`file`,visibility:`search-only`},menu:[{section:`file-item`,order:1}]},{id:`duplicate`,menuActionId:`duplicate`,labelKey:`duplicate`,keywords:[`duplicate`,`copy`,`file`,`folder`],shortcutId:`file-tree-duplicate`,availability:{host:`desktop`,requiresTargetKinds:[`doc`,`folder`]},palette:{group:`file`,visibility:`search-only`},menu:[{section:`file-item`,order:0,accelerator:`CmdOrCtrl+D`}]},{id:`move-to-trash`,menuActionId:`move-to-trash`,labelKey:`moveToTrash`,keywords:[`delete`,`trash`,`remove`],shortcutId:`file-tree-delete`,availability:{host:`desktop`,requiresTargetKinds:[`doc`,`folder`,`asset`]},palette:{group:`file`,visibility:`search-only`},menu:[{section:`file-item`,order:2,accelerator:`CmdOrCtrl+Delete`}]},{id:`reveal-in-finder`,menuActionId:`reveal-in-finder`,labelKey:`revealInFinder`,keywords:[`finder`,`reveal`,`show`,`file`],availability:{host:`desktop`,requiresTargetKinds:[`doc`,`folder`,`asset`,`project`]},palette:{group:`file`,visibility:`search-only`},menu:[{section:`file-reveal`,order:0}]},{id:`send-to-ai`,menuActionId:`send-to-ai`,labelKey:`openWithAi`,keywords:[`ai`,`agent`,`handoff`],availability:{host:`desktop`,requiresTargetKinds:[`doc`,`folder`,`project`]},menu:[{section:`file-reveal`,order:1}]},{id:`copy-full-path`,menuActionId:`copy-full-path`,labelKey:`copyFullPath`,keywords:[`copy`,`path`,`absolute`,`full`],availability:{host:`desktop`,requiresTargetKinds:[`doc`,`folder`,`asset`,`project`]},palette:{group:`file`,visibility:`search-only`},menu:[{section:`file-copy-path`,order:0,menuLabelKey:`fullPath`}]},{id:`copy-relative-path`,menuActionId:`copy-relative-path`,labelKey:`copyRelativePath`,keywords:[`copy`,`path`,`relative`],availability:{host:`desktop`,requiresTargetKinds:[`doc`,`folder`,`asset`,`project`]},palette:{group:`file`,visibility:`search-only`},menu:[{section:`file-copy-path`,order:1,menuLabelKey:`relativePath`}]},{id:`close-tab`,menuActionId:`close-active-tab-or-window`,labelKey:`closeTab`,keywords:[`close`,`tab`,`window`],availability:{host:`desktop`},palette:{group:`file`,visibility:`search-only`},menu:[{section:`file-close`,order:0,platform:`mac`,accelerator:`CmdOrCtrl+W`}]},{id:`new-worktree`,menuActionId:`new-worktree`,labelKey:`newWorktree`,keywords:[`worktree`,`branch`,`new`],availability:{host:`desktop`},palette:{group:`file`,visibility:`search-only`},menu:[{section:`file-worktree`,order:0,ellipsis:!0}]},{id:`switch-worktree`,menuActionId:`switch-worktree`,labelKey:`switchWorktree`,keywords:[`worktree`,`switch`,`branch`],availability:{host:`desktop`},palette:{group:`file`,visibility:`search-only`},menu:[{section:`file-worktree`,order:1,ellipsis:!0}]},{id:`toggle-sidebar`,menuActionId:`toggle-sidebar`,labelKey:`sidebarHide`,keywords:[`sidebar`,`files`,`panel`,`toggle`],shortcutId:`toggle-files-sidebar`,stateToggle:{showKey:`sidebarShow`,hideKey:`sidebarHide`,stateField:`sidebarVisible`,defaultVisible:!0},availability:{},palette:{group:`view`,visibility:`search-only`},menu:[{section:`view-panels`,order:0,accelerator:`CmdOrCtrl+Alt+S`}]},{id:`toggle-doc-panel`,menuActionId:`toggle-doc-panel`,labelKey:`docPanelHide`,keywords:[`document`,`panel`,`info`,`toggle`],shortcutId:`toggle-document-panel`,stateToggle:{showKey:`docPanelShow`,hideKey:`docPanelHide`,stateField:`docPanelVisible`,defaultVisible:!0},availability:{},palette:{group:`view`,visibility:`search-only`},menu:[{section:`view-panels`,order:1,accelerator:`CmdOrCtrl+Alt+B`}]},{id:`toggle-terminal`,menuActionId:`toggle-terminal`,labelKey:`terminalShow`,keywords:[`terminal`,`shell`,`console`,`toggle`],shortcutId:`toggle-terminal-panel`,stateToggle:{showKey:`terminalShow`,hideKey:`terminalHide`,stateField:`terminalVisible`,defaultVisible:!1},availability:{host:`desktop`},palette:{group:`view`,visibility:`search-only`},menu:[{section:`view-panels`,order:2,accelerator:`CmdOrCtrl+J`}]},{id:`toggle-show-hidden-files`,menuActionId:`toggle-show-hidden-files`,labelKey:`showHiddenFiles`,keywords:[`hidden`,`dotfiles`,`files`,`show`],checkField:`showHiddenFiles`,availability:{},palette:{group:`view`,visibility:`search-only`},menu:[{section:`view-visibility`,order:0,accelerator:`CmdOrCtrl+Shift+.`,checkbox:!0}]},{id:`toggle-show-ok-folders`,menuActionId:`toggle-show-ok-folders`,labelKey:`showOkFolders`,keywords:[`ok`,`folders`,`hidden`,`show`],checkField:`showOkFolders`,availability:{},palette:{group:`view`,visibility:`search-only`},menu:[{section:`view-visibility`,order:1,checkbox:!0}]},{id:`toggle-show-only-markdown-files`,menuActionId:`toggle-show-only-markdown-files`,labelKey:`showOnlyMarkdownFiles`,keywords:[`markdown`,`filter`,`files`,`only`],checkField:`showOnlyMarkdownFiles`,availability:{},palette:{group:`view`,visibility:`search-only`},menu:[{section:`view-visibility`,order:2,checkbox:!0}]},{id:`toggle-show-skills-section`,menuActionId:`toggle-show-skills-section`,labelKey:`showSkillsSection`,keywords:[`skills`,`section`,`sidebar`,`show`],checkField:`showSkillsSection`,availability:{},palette:{group:`view`,visibility:`search-only`},menu:[{section:`view-visibility`,order:3,checkbox:!0}]},{id:`expand-all-tree`,menuActionId:`expand-all-tree`,labelKey:`expandAll`,keywords:[`expand`,`tree`,`folders`,`all`],availability:{requiresCanExpandAll:!0},palette:{group:`view`,visibility:`search-only`},menu:[{section:`view-tree`,order:0,smartHide:!0}]},{id:`collapse-all-tree`,menuActionId:`collapse-all-tree`,labelKey:`collapseAll`,keywords:[`collapse`,`tree`,`folders`,`all`],availability:{requiresCanCollapseAll:!0},palette:{group:`view`,visibility:`search-only`},menu:[{section:`view-tree`,order:1,smartHide:!0}]},{id:`new-terminal`,menuActionId:`new-terminal`,labelKey:`newTerminal`,keywords:[`terminal`,`shell`,`new`,`tab`],availability:{host:`desktop`},palette:{group:`terminal`,visibility:`search-only`},menu:[{section:`terminal`,order:0}]},{id:`new-terminal-window`,keywords:[],availability:{host:`desktop`},menu:[{section:`terminal`,order:1,menuLabelText:`New Terminal Window`}]},{id:`kill-terminal`,menuActionId:`kill-terminal`,labelKey:`killTerminal`,keywords:[`terminal`,`kill`,`close`,`session`],availability:{host:`desktop`,requiresTerminalLive:!0},palette:{group:`terminal`,visibility:`search-only`},menu:[{section:`terminal`,order:2}]},{id:`check-for-updates`,labelKey:`checkForUpdates`,keywords:[`update`,`upgrade`,`version`,`check`],availability:{host:`desktop`},palette:{group:`app`,visibility:`search-only`},menu:[{section:`app-updates`,order:0,platform:`mac`,ellipsis:!0},{section:`help-updates`,order:0,platform:`other`,ellipsis:!0}]},{id:`set-up-integrations`,labelKey:`setUpIntegrations`,keywords:[`integrations`,`mcp`,`setup`,`claude`,`configure`],availability:{host:`desktop`},palette:{group:`app`,visibility:`search-only`},menu:[{section:`file-integrations`,order:0,ellipsis:!0}]},{id:`toggle-spell-check`,labelKey:`checkSpelling`,keywords:[`spell`,`spelling`,`check`,`typing`],availability:{host:`desktop`},palette:{group:`app`,visibility:`search-only`},menu:[{section:`edit-spell`,order:0,checkbox:!0}]},{id:`open-github`,labelKey:`openOnGithub`,keywords:[`github`,`source`,`repository`,`code`],availability:{},palette:{group:`app`,visibility:`search-only`},menu:[{section:`help-links`,order:0}]},{id:`uninstall`,keywords:[],availability:{host:`desktop`},menu:[{section:`app-uninstall`,order:0,platform:`mac`,ellipsis:!0,menuLabelText:`Uninstall OpenKnowledge`}]}],GY=`source`;function KY(e){return{ok:!1,error:e}}function qY(e){return{ok:!0,...e}}function JY(){return Tf.parse({})}function YY(e,t){let n=e.toString();if(n.length===0)return JY();let r=Qu(n);if(r.errors.length>0)return console.warn(`[bindConfigDoc:${t}] Y.Text contains invalid YAML; returning schema defaults. Errors: ${r.errors.map(e=>e.message).join(`; `)}`),JY();let i=r.toJSON()??{},a=Tf.safeParse(i);return a.success?a.data:(console.warn(`[bindConfigDoc:${t}] Y.Text content fails schema validation; returning schema defaults. First issue: ${a.error.issues[0]?.message??`(unknown)`}`),JY())}function XY(e,t,n={}){return Df(`config.bind`,{"config.scope":t,"config.transport":`ytext`},()=>ZY(e,t,n))}function ZY(e,t,n){let{ytextKey:r=GY}=n,i=e.document,a=i.getText(r),o=new Set,s=new Set,c=!1,l=!1;function u(){if(c)return;let e=YY(a,t);for(let n of o)try{n(e)}catch(e){console.warn(`[bindConfigDoc:${t}] listener threw:`,e)}}function d(){if(c||(u(),l))return;l=!0;let e=[...s];s.clear();for(let n of e)try{n()}catch(e){console.warn(`[bindConfigDoc:${t}] synced listener threw:`,e)}}a.observe(u),e.on(`synced`,d);function f(e){if(c)return KY({code:`WRITE_ERROR`,detail:`ConfigBinding (${t}) has been disposed`});let n=Nf(e,t);if(n!==null)return KY(n);let r=Qu(a.toString()),o=r.contents!==null&&!Ss(r.contents);if(r.errors.length>0||o){Of(`config.corrupt-ytext-reset`,{"config.scope":t,"config.parse.errorCount":r.errors.length,"config.parse.topLevelNonMap":o});let e=r.errors.length>0?r.errors.map(e=>e.message).join(`; `):`top-level YAML is not a mapping`;console.warn(`[bindConfigDoc:${t}] dropping corrupt Y.Text and re-applying patch onto empty doc. Reason: ${e}`),r=Qu(``)}r.contents===null&&(r.contents=r.createNode({}));let s=Ff(r,e),l=r.toJSON()??{},u=Df(`config.validate`,{"config.scope":t,"config.validation.layer":`L1`},e=>{let t=Tf.safeParse(l);if(e.setAttribute(`config.outcome`,t.success?`success`:`rejected`),!t.success)for(let e of t.error.issues)Of(`config.validation.issue`,{"issue.path":e.path.map(e=>String(e)).join(`.`),"issue.message":e.message});return t});if(!u.success)return KY({code:`SCHEMA_INVALID`,issues:u.error.issues.map(If)});let d=r.toString();return i.transact(()=>{a.length>0&&a.delete(0,a.length),a.insert(0,d)}),qY({effective:u.data,appliedPaths:s})}return{current(){return YY(a,t)},patch(e){return Df(`config.patch`,{"config.scope":t,"config.transport":`ytext`},t=>{let n=f(e);return t.setAttribute(`config.outcome`,n.ok?`success`:`rejected`),n.ok||t.setAttribute(`config.error.code`,n.error.code),n})},subscribe(e){return o.add(e),()=>{o.delete(e)}},hasSynced(){return l},subscribeSynced(e){if(c)return()=>{};if(l){let n=!1;return queueMicrotask(()=>{if(!(n||c))try{e()}catch(e){console.warn(`[bindConfigDoc:${t}] synced listener threw:`,e)}}),()=>{n=!0}}return s.add(e),()=>{s.delete(e)}},dispose(){c||(c=!0,a.unobserve(u),e.off(`synced`,d),o.clear(),s.clear())}}}var QY=`source`,$Y=800;function eX(e){return{ok:!1,error:e}}function tX(e){return{ok:!0,...e}}function nX(e,t={}){let{ytextKey:n=QY,acceptanceDelayMs:r=$Y}=t,i=e.document,a=i.getText(n),o=new Set,s=new Set,c=new Set,l=!1,u=`idle`,d=null;function f(){d!==null&&(clearTimeout(d),d=null)}function p(e){if(!l&&u!==e){u=e;for(let t of c)try{t(e)}catch(e){console.warn(`[bindOkignoreDoc] status listener threw:`,e)}}}function m(){if(l)return;let e=a.toString();for(let t of o)try{t(e)}catch(e){console.warn(`[bindOkignoreDoc] text listener threw:`,e)}}function h(e){if(!l)for(let t of s)try{t(e)}catch(e){console.warn(`[bindOkignoreDoc] rejection listener threw:`,e)}}return a.observe(m),e.on(`synced`,m),{current(){return a.toString()},patch(e){return l?eX({code:`WRITE_ERROR`,detail:`OkignoreBinding has been disposed`}):(i.transact(()=>{a.length>0&&a.delete(0,a.length),e.length>0&&a.insert(0,e)}),f(),p(`pending`),d=setTimeout(()=>{d=null,!l&&u===`pending`&&p(`accepted`)},r),tX({text:e}))},subscribe(e){return o.add(e),()=>{o.delete(e)}},subscribeRejection(e){return s.add(e),()=>{s.delete(e)}},subscribeStatus(e){return c.add(e),()=>{c.delete(e)}},status(){return u},notifyRejection(e){l||(f(),p(`rejected`),h({error:e,text:a.toString()}))},dispose(){l||(l=!0,f(),a.unobserve(m),e.off(`synced`,m),o.clear(),s.clear(),c.clear())}}}function rX(e,t,n){return iX([e,t,n],[])}function iX(e,t){if(t.length>0){let n=jf(Tf,t);if(n?.scope===`user`)return e[0];if(n?.scope===`project`)return e[1]??e[0];if(n?.scope===`project-local`)return e[2]??e[1]??e[0]}let n=aX(e);if(n===void 0)return;if(n===null)return null;if(Array.isArray(n)||typeof n!=`object`)return n;let r=e.map(e=>oX(e)?e:void 0),i=new Set;for(let e of r)if(e!==void 0)for(let t of Object.keys(e))i.add(t);let a={};for(let e of i)a[e]=iX(r.map(t=>t===void 0?void 0:t[e]),[...t,e]);return a}function aX(e){for(let t=e.length-1;t>=0;t--)if(e[t]!==void 0)return e[t]}function oX(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var sX=2e3;function cX(e){let t=Date.now();for(let[n,r]of e.entries()){let i=r;i.timestamp&&t-i.timestamp>3e4&&e.delete(n)}}function lX(e,t){for(let[,n]of e.entries()){let e=n;if(e.timestamp&&e.timestamp>t)return!0}return!1}var uX=`__system__`,dX=`__config__/project`,fX=`__user__/config.yml`,pX=`__local__/project`,mX=`__config__/okignore`;Object.freeze([dX,pX,fX,mX]);var hX=`__skill__/`,gX=`__template__/`,_X=[`project`,`global`];function vX(e){return e.startsWith(`__skill__/`)||e.startsWith(`__template__/`)}var yX=`.ok/skills`;function bX(e){return`${yX}/${e}/SKILL`}var xX=/^__skill__\/global\/([^/]+)(?:\/(references\/.+))?$/;function SX(e){let t=xX.exec(e);if(!t)return null;let n=t[1],r=t[2];return r===void 0?{name:n,kind:`skill`,rel:null}:{name:n,kind:`reference`,rel:r.slice(11)}}function CX(e,t){return e===`project`?bX(t):`${hX}${e}/${t}`}function wX(e){if(e===``)return``;try{return e.split(`/`).map(e=>decodeURIComponent(e)).join(`/`)}catch{return e}}function TX(e){if(e.startsWith(`__skill__/`)){let t=e.slice(10),n=t.indexOf(`/`);if(n<0)return null;let r=t.slice(0,n);if(r!==`global`&&r!==`project`)return null;let i=t.slice(n+1);return i?{kind:`skill`,scope:r,name:wX(i)}:null}if(e.startsWith(`__template__/`)){let t=e.slice(13);if(!t)return null;let n=t.lastIndexOf(`/`),r=n<0?t:t.slice(n+1);return r?{kind:`template`,folder:wX(n<0?``:t.slice(0,n)),name:wX(r)}:null}return null}var EX=/^(?:(.+)\/)?\.ok\/templates\/([^/]+?)(?:\.mdx?)?$/;function DX(e){let t=EX.exec(e);if(t){let e=(t[1]??``).replace(/^\/+|\/+$/g,``);return`${gX}${e?`${e}/`:``}${t[2]}`}return null}var OX=`#fafafa`,kX=`#171717`,AX=[`invalid-args`,`nested-project`,`target-not-empty`,`mkdir-failed`,`git-init-failed`,`init-failed`,`discovery-failed`],jX=[`.mdx`,`.md`],MX=`epoch`,NX=512*1024;function PX(e,t=NX){return typeof e==`number`&&Number.isFinite(e)&&e>t}var FX=[`claude`,`claude-desktop`,`cursor`,`codex`,`copilot`,`opencode`,`openclaw`,`pi`,`antigravity`,`lm-studio`,`hermes`],IX={claude:`Claude`,"claude-desktop":`Claude Desktop`,cursor:`Cursor`,codex:`Codex`,copilot:`GitHub Copilot`,opencode:`OpenCode`,openclaw:`OpenClaw`,pi:`Pi`,antigravity:`Antigravity`,"lm-studio":`LM Studio`,hermes:`Hermes`},LX={claude:`.claude/skills`,"claude-desktop":null,cursor:`.cursor/skills`,codex:`.codex/skills`,copilot:`.github/skills`,opencode:`.opencode/skills`,openclaw:null,pi:`.pi/skills`,antigravity:null,"lm-studio":null,hermes:null},RX=FX.filter(e=>LX[e]!==null),zX=`open-knowledge`;FX.flatMap(e=>{let t=LX[e];return t===null?[]:[`${t}/${zX}/`]}),RX.filter(e=>e!==`pi`&&e!==`copilot`).map(e=>({hostDir:(LX[e]??``).split(`/`)[0],editorId:e}));var BX={claude:`claude-code`,"claude-desktop":`claude-code`,cursor:`cursor`,codex:`codex`,copilot:`github-copilot-cli`,opencode:`opencode`,openclaw:`openclaw`,pi:`pi`,antigravity:`antigravity`,"lm-studio":`lm-studio`,hermes:`hermes`},VX={cursor:/\bCursor(?:\([^)]+\))?\/\d/,codex:/\bCodex(?:\([^)]+\))?\/\d/,"claude-desktop":/\bClaude(?:\([^)]+\))?\/\d/};function HX(){if(typeof navigator>`u`)return null;let e=navigator.userAgent;for(let[t,n]of Object.entries(VX))if(n.test(e))return t;return null}var UX=[`incoming`,`outgoing`,`both`];function WX(e){return UX.includes(e)}var GX=`open-knowledge`,KX=`https://github.com/inkeep/open-knowledge`,qX=[{id:`chart`,title:`Chart`,description:`A bar chart whose series colors track the OK chart palette.`,html:`<div style="font-family:system-ui,sans-serif;padding:20px;color:var(--foreground)">
404
404
  <h3 style="margin:0 0 14px;font-size:15px;font-weight:600">Revenue by region</h3>
405
405
  <div id="bars" style="display:flex;align-items:flex-end;gap:14px;height:170px"></div>
406
406
  <script>
@@ -462,55 +462,57 @@ Read more at https://docs.orama.com/docs/orama-js/plugins/plugin-secure-proxy#pl
462
462
  out.textContent = '$' + Number(amt.value).toLocaleString();
463
463
  });
464
464
  <\/script>
465
- </div>`}],YX=[{name:`--chart-1`,light:`oklch(0.62 0.19 259)`,dark:`oklch(0.72 0.14 259)`},{name:`--chart-2`,light:`oklch(0.58 0.14 145)`,dark:`oklch(0.73 0.13 145)`},{name:`--chart-3`,light:`oklch(0.62 0.15 70)`,dark:`oklch(0.77 0.14 70)`},{name:`--chart-4`,light:`oklch(0.55 0.18 290)`,dark:`oklch(0.72 0.16 290)`},{name:`--chart-5`,light:`oklch(0.58 0.21 25)`,dark:`oklch(0.72 0.2 25)`},{name:`--primary`,light:`oklch(0.6321 0.1983 259.59)`,dark:`#69a3ff`},{name:`--primary-foreground`,light:`oklch(0.985 0 0)`,dark:`oklch(0.205 0 0)`},{name:`--foreground`,light:`oklch(0.145 0 0)`,dark:`oklch(0.985 0 0)`},{name:`--background`,light:`oklch(1 0 0)`,dark:`oklch(0.145 0 0)`},{name:`--card`,light:`oklch(1 0 0)`,dark:`oklch(0.205 0 0)`},{name:`--card-foreground`,light:`oklch(0.145 0 0)`,dark:`oklch(0.985 0 0)`},{name:`--muted-foreground`,light:`oklch(0.556 0 0)`,dark:`oklch(0.708 0 0)`},{name:`--border`,light:`oklch(0.922 0 0)`,dark:`oklch(1 0 0 / 10%)`},{name:`--destructive`,light:`oklch(0.577 0.245 27.325)`,dark:`oklch(0.704 0.191 22.216)`},{name:`--radius`,light:`0.625rem`,dark:`0.625rem`}],XX=Object.freeze([{value:`workflow-fit`,label:`It didn't fit into my workflow`},{value:`missing-feature`,label:`It was missing a feature I needed`},{value:`hard-to-start`,label:`It was too hard to set up or get started`},{value:`unreliable`,label:`Bugs, crashes, or it felt unreliable`},{value:`switched-tool`,label:`I'm switching to another tool`},{value:`one-off`,label:`It was a trial or one-off project`},{value:`other`,label:`Something else`}]),ZX=1e4;new Set(XX.map(e=>e.value));var QX=Xw.extend({priority:60,addAttributes(){return{...this.parent?.(),fenceDelimiter:{default:"`"},fenceLength:{default:3},meta:{default:null},sourceStyle:{default:`fenced`},sourceClosingFenceLength:{default:null,rendered:!1},sourceUnclosedFence:{default:!1,rendered:!1},sourceFenceIndent:{default:null,rendered:!1},sourceInfoPadding:{default:null,rendered:!1},sourceIndents:{default:null,rendered:!1}}}}),$X=lT.extend({name:`emphasis`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`*`}}},addInputRules(){return[xw({find:iT,type:this.type,getAttributes:{sourceDelimiter:`*`}}),xw({find:oT,type:this.type,getAttributes:{sourceDelimiter:`_`}})]}}),eZ=rT.extend({name:`strong`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`**`}}},addInputRules(){return[xw({find:Qw,type:this.type,getAttributes:{sourceDelimiter:`**`}}),xw({find:eT,type:this.type,getAttributes:{sourceDelimiter:`__`}})]}}),tZ=XC.create({name:`escapeMark`,priority:10,excludes:``,inclusive:!1,parseHTML(){return[{tag:`span[data-escape-mark]`}]},renderHTML(){return[`span`,{"data-escape-mark":``},0]}}),nZ=Uw.create({name:`footnoteDefinition`,group:`block`,content:`block+`,defining:!0,priority:60,addAttributes(){return{identifier:{default:``},label:{default:null}}},parseHTML(){let e=e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-footnote-id`)||``;return{identifier:t,label:t||null}};return[{tag:`aside[data-footnote-def]`,getAttrs:e},{tag:`aside.footnote-def`,getAttrs:e}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.identifier??``);return[`aside`,{...t,"data-footnote-def":``,"data-footnote-id":n,id:`fn-${n}`,class:`footnote-def`},[`div`,{class:`footnote-body`},0],[`a`,{href:`#fnref-${n}`,class:`footnote-backref`,contentEditable:`false`,"aria-label":`Back to reference`},`↩`]]},addCommands(){return{insertFootnoteDefinition:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{identifier:e,label:e},content:[{type:`paragraph`}]})}}});function rZ(e){let t=0;for(let n of e){let e=Number.parseInt(n,10);!Number.isNaN(e)&&e>t&&(t=e)}return String(t+1)}function iZ(e){let t=[];return e.descendants(e=>(e.type.name===`footnoteDefinition`&&t.push(String(e.attrs.identifier??``)),!0)),t}function aZ(e){let t=null;return e.forEach((e,n)=>{e.type.name===`footnoteDefinition`&&(t=n+e.nodeSize)}),t??e.content.size}var oZ=Uw.create({name:`footnoteReference`,marks:`_`,group:`inline`,inline:!0,atom:!0,selectable:!0,draggable:!1,priority:60,addAttributes(){return{identifier:{default:``},label:{default:null}}},parseHTML(){return[{tag:`sup[data-footnote-ref]`,getAttrs:e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-footnote-id`)||``;return{identifier:t,label:t||null}}}]},renderHTML({node:e}){let t=String(e.attrs.identifier??``);return[`sup`,{id:`fnref-${t}`,"data-footnote-ref":``,"data-footnote-id":t,class:`footnote-ref`},[`a`,{href:`#fn-${t}`,class:`footnote-ref-link`},`[${t}]`]]},addCommands(){return{insertFootnoteReference:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{identifier:e,label:e}})}}}),sZ=/^---[ \t]*\r?\n([\s\S]*?\r?\n)?---[ \t]*(\r?\n|$)/,cZ=/^---[ \t]*$/;function lZ(e){let t=e.match(sZ);return t?{frontmatter:t[0],body:e.slice(t[0].length)}:{frontmatter:``,body:e}}function uZ(e,t){return e?e+t:t}function dZ(e){if(e===``)return``;let t=e.match(sZ);return t?(t[1]??``).replace(/\r?\n$/,``):e}var fZ=dT.extend({marks:`_`,priority:60,addAttributes(){return{...this.parent?.(),hardBreakStyle:{default:`backslash`},sourceRaw:{default:null}}}}),pZ=pT.extend({priority:60,addAttributes(){return{...this.parent?.(),headingStyle:{default:`atx`},sourceTrailingHashes:{default:null},sourceUnderlineLength:{default:null},sourceContiguousNext:{default:!1},sourceLeadingIndent:{default:null,rendered:!1},sourceInteriorSpacing:{default:null,rendered:!1}}}}),mZ=Uw.create({name:`htmlBlock`,group:`block`,atom:!0,priority:60,addAttributes(){return{content:{default:``}}},parseHTML(){return[{tag:`div[data-html-block]`}]},renderHTML({node:e}){return[`div`,{"data-html-block":``,class:`html-block`},e.attrs.content]}});function hZ(e){if(typeof e!=`string`||!e.startsWith(`/`))return e;let t=globalThis.window?.okDesktop?.config?.apiOrigin;return typeof t==`string`&&t?t+e:e}var gZ=hT.extend({marks:`_`,priority:60,addAttributes(){return{...this.parent?.(),sourceUrl:{default:null,rendered:!1}}},renderHTML({HTMLAttributes:e}){let t=PS(this.options.HTMLAttributes,e);return typeof t.src==`string`&&(t.src=hZ(t.src)),[`img`,t]}}),_Z=Uw.create({name:`jsxComponent`,group:`block`,atom:!1,content:`block*`,isolating:!0,selectable:!0,defining:!0,priority:60,addAttributes(){return{componentName:{default:``},kind:{default:`element`},attributes:{default:[]},sourceRaw:{default:``},sourceDirty:{default:!1},props:{default:{}}}},parseHTML(){return[{tag:`div[data-jsx-component]`,getAttrs:e=>typeof e==`string`?!1:{componentName:e.getAttribute(`data-component-name`)||``,sourceRaw:e.getAttribute(`data-source-raw`)||``}}]},renderHTML({HTMLAttributes:e}){return[`div`,{"data-jsx-component":``,"data-component-name":e.componentName,"data-source-raw":e.sourceRaw},0]},addCommands(){return{insertJsxComponent:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{sourceRaw:e}})}}}),vZ=Uw.create({name:`jsxInline`,group:`inline`,inline:!0,atom:!1,content:`text*`,isolating:!1,selectable:!0,priority:60,addAttributes(){return{}},parseHTML(){return[{tag:`span[data-jsx-inline]`}]},renderHTML(){return[`span`,{"data-jsx-inline":``},0]}}),yZ=[`https`,`http`,`mailto`,`tel`,`ftp`,`sms`],bZ=yZ.map(e=>`${e}:`).join(`|`),xZ=RegExp(`^(?:${bZ}|\\/|#|\\?|\\.\\/|\\.\\.\\/)`,`i`);function SZ(e){let t=e.trim();return t===``?!0:xZ.test(t)}function CZ(e){let t=e.trim();if(t===``)return!0;let n=t.indexOf(`:`);if(n===-1)return!0;let r=t.indexOf(`/`),i=t.indexOf(`?`),a=t.indexOf(`#`);return n>Math.min(r===-1?1/0:r,i===-1?1/0:i,a===-1?1/0:a)}var wZ=new Set(yZ.map(e=>`${e}:`)),TZ=`https://placeholder.invalid`;function EZ(e){try{let t=new URL(e,TZ);return wZ.has(t.protocol.toLowerCase())}catch{return!1}}var DZ=jD.extend({priority:60,addOptions(){return{openOnClick:!1,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer`},isAllowedUri:EZ,validate:EZ,shouldAutoLink:()=>!0}},addAttributes(){return{...this.parent?.(),linkStyle:{default:`inline`,rendered:!1},refLabel:{default:null,rendered:!1},sourceForm:{default:null,rendered:!1},target:{default:null,rendered:!1},anchor:{default:null,rendered:!1},alias:{default:null,rendered:!1},sourceUrlForm:{default:null,rendered:!1},sourceTitleMarker:{default:null,rendered:!1}}}}),OZ=Uw.create({name:`linkRefDef`,group:`block`,atom:!0,priority:60,addAttributes(){return{label:{default:``},href:{default:``},title:{default:null},sourceLayout:{default:null},sourceTitleMarker:{default:null}}},parseHTML(){return[{tag:`div[data-link-ref-def]`}]},renderHTML({node:e}){let{label:t,href:n,title:r}=e.attrs;return[`div`,{"data-link-ref-def":``,class:`link-ref-def`},r?`[${t}]: ${n} "${r}"`:`[${t}]: ${n}`]}});function kZ(e){return e.type.name===`list`&&!e.attrs.ordered}function AZ(e){return e.type.name===`list`&&!!e.attrs.ordered}function jZ(e){let t=!1;return e.forEach(e=>{e.type.name===`listItem`&&e.attrs.checked!==null&&(t=!0)}),t}function MZ(e,t,n,r,i,a,o){let s=wS(e=>e.type.name===`list`)(e.selection);if(s&&i(s.node)){let{$from:n,$to:i}=e.selection;return n.blockRange(i)?Ng(r)(e,t):!1}if(s){if(!t)return!0;let{tr:n}=e;return n.setNodeMarkup(s.pos,void 0,{...s.node.attrs,...a}),o!==void 0&&s.node.forEach((e,t)=>{if(e.type.name===`listItem`){let r=s.pos+1+t;n.setNodeMarkup(r,void 0,{...e.attrs,...o})}}),t(n),!0}return Mg(n,a)(e,void 0)?t?Mg(n,a)(e,n=>{if(o){let t=n.mapping.map(e.selection.$from.pos),r=n.doc.resolve(t);for(let e=r.depth;e>0;e--){let t=r.node(e);if(t.type.name===`listItem`){n.setNodeMarkup(r.before(e),void 0,{...t.attrs,...o});break}}}t(n)}):!0:!1}var NZ=Uw.create({name:`list`,group:`block list`,content:`listItem+`,priority:60,addAttributes(){return{ordered:{default:!1},start:{default:1},spread:{default:!1},bulletMarker:{default:null},listMarkerDelimiter:{default:null}}},parseHTML(){return[{tag:`ul`,getAttrs:()=>({ordered:!1})},{tag:`ol`,getAttrs:e=>({ordered:!0,start:e.getAttribute(`start`)?Number(e.getAttribute(`start`)):1})}]},renderHTML({node:e,HTMLAttributes:t}){let n=e.attrs.ordered?`ol`:`ul`,r={};return e.attrs.ordered&&e.attrs.start!==1&&(r.start=e.attrs.start),[n,PS(t,r),0]},addCommands(){return{toggleBulletList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:MZ(e,t,n,r,e=>kZ(e)&&!jZ(e),{ordered:!1},{checked:null})},toggleOrderedList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:MZ(e,t,n,r,e=>AZ(e),{ordered:!0},{checked:null})},toggleTaskList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:MZ(e,t,n,r,e=>kZ(e)&&jZ(e),{ordered:!1},{checked:!1})}}},addInputRules(){return[ww({find:/^\s*([-+*])(?!\s*\[[ xX]\])\s$/,type:this.type,getAttributes:e=>({ordered:!1,bulletMarker:e[1]}),joinPredicate:(e,t)=>t.attrs.ordered===!1}),ww({find:/^\s*(\d+)([.)])\s$/,type:this.type,getAttributes:e=>({ordered:!0,start:Number(e[1]),listMarkerDelimiter:e[2]}),joinPredicate:(e,t)=>t.attrs.ordered===!0}),new HC({find:/^\s*[-*+]\s\[([ xX])\]\s$/,handler:({state:e,range:t,match:n})=>{let r=e.schema.nodes.list;if(!r)return null;let i=n[1]!==` `,a=e.tr.delete(t.from,t.to),o=a.doc.resolve(t.from).blockRange();if(!o)return null;let s=Jm(o,r,{ordered:!1});if(!s)return null;a.wrap(o,s);let c=a.doc.resolve(a.mapping.map(t.from));for(let e=c.depth;e>0;e--){let t=c.node(e);if(t.type.name===`listItem`){a.setNodeMarkup(c.before(e),void 0,{...t.attrs,checked:i});break}}}})]},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList(),"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList(),"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),PZ=Uw.create({name:`listItem`,content:`paragraph block*`,defining:!0,addAttributes(){return{checked:{default:null},spread:{default:!1},sourceMarkerSpacing:{default:null,rendered:!1},sourceOrdinal:{default:null,rendered:!1},sourceCheckboxChar:{default:null,rendered:!1},sourceContinuationIndent:{default:null,rendered:!1}}},parseHTML(){return[{tag:`li`,getAttrs:e=>{let t=e.querySelector(`input[type="checkbox"]`);return{checked:t?t.checked:null}}}]},renderHTML({node:e,HTMLAttributes:t}){return e.attrs.checked===null?[`li`,PS(t),0]:[`li`,PS(t,{"data-type":`taskItem`,"data-checked":e.attrs.checked?`true`:`false`}),[`label`,{contenteditable:`false`},[`input`,{type:`checkbox`,...e.attrs.checked?{checked:`checked`}:{}}]],[`div`,0]]},addNodeView(){return({node:e,getPos:t,editor:n,HTMLAttributes:r})=>{let i=document.createElement(`li`);Object.entries(PS(r,e.attrs.checked===null?{}:{"data-type":`taskItem`,"data-checked":String(!!e.attrs.checked)})).forEach(([e,t])=>{t!=null&&i.setAttribute(e,String(t))});let a=null,o=null,s=document.createElement(`div`),c=()=>{o&&(o.disabled=!n.isEditable)};return e.attrs.checked!==null&&(a=document.createElement(`label`),a.contentEditable=`false`,o=document.createElement(`input`),o.type=`checkbox`,o.checked=!!e.attrs.checked,c(),n.on(`update`,c),o.addEventListener(`change`,()=>{let r=t();r===void 0||typeof r!=`number`||n.view.dispatch(n.view.state.tr.setNodeMarkup(r,void 0,{...e.attrs,checked:o?.checked??!1}))}),a.appendChild(o),i.appendChild(a)),i.appendChild(s),{dom:i,contentDOM:s,update(t){return t.type!==e.type||t.attrs.checked!==null!=(e.attrs.checked!==null)?!1:(o&&t.attrs.checked!==null&&(o.checked=!!t.attrs.checked,o.disabled=!n.isEditable,i.setAttribute(`data-checked`,String(!!t.attrs.checked))),e=t,!0)},destroy(){n.off(`update`,c)}}}},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>{let{$from:e}=this.editor.state.selection;for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return this.editor.commands.sinkListItem(this.name);return!1},"Shift-Tab":()=>{let{$from:e}=this.editor.state.selection;for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return this.editor.commands.liftListItem(this.name);return!1}}}}),FZ=NZ,IZ=PZ,LZ=Uw.create({name:`mathInline`,marks:`_`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,addAttributes(){return{formula:{default:``},id:{default:null},language:{default:`latex`},sourceDelimiter:{default:null,rendered:!1}}},parseHTML(){return[{tag:`span[data-math-inline]`,getAttrs:e=>typeof e==`string`?!1:{formula:e.getAttribute(`data-formula`)||``,id:e.getAttribute(`id`)||null,language:e.getAttribute(`data-language`)||`latex`}}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-math-inline":``,"data-formula":e.formula,"data-language":e.language,...e.id?{id:e.id}:{}}]},addCommands(){return{insertMathInline:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{formula:e}})}}}),RZ=Uw.create({name:`rawMdxFallback`,group:`block`,atom:!1,content:`text*`,isolating:!0,selectable:!0,defining:!0,priority:60,addAttributes(){return{reason:{default:``},originalSpan:{default:{start:0,end:0}}}},parseHTML(){let e=e=>typeof e==`string`?!1:{reason:e.getAttribute(`data-reason`)||``};return[{tag:`div[data-raw-mdx-fallback]`,getAttrs:e},{tag:`pre[data-raw-mdx-fallback]`,getAttrs:e}]},renderHTML({HTMLAttributes:e}){return[`div`,{"data-raw-mdx-fallback":``,"data-raw-badge":`raw`,"data-reason":e.reason,contenteditable:`false`,class:`raw-mdx-fallback`},0]},addNodeView(){return({HTMLAttributes:e})=>{let t=document.createElement(`div`);t.setAttribute(`data-raw-mdx-fallback`,``),t.setAttribute(`data-raw-badge`,`raw`),t.setAttribute(`contenteditable`,`false`),t.classList.add(`raw-mdx-fallback`),e.reason&&t.setAttribute(`data-reason`,e.reason);let n=document.createElement(`pre`);return n.classList.add(`raw-mdx-fallback-content`),n.setAttribute(`contenteditable`,`false`),t.appendChild(n),{dom:t,contentDOM:n,ignoreMutation:()=>!0}}}}),zZ=Wk.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceMarkerSpacings:{default:null}}}}),BZ=Jk.extend({excludes:``,addAttributes(){return{...this.parent?.(),sourceFenceChar:{default:"`"},sourceFenceLength:{default:1},sourcePadded:{default:!1,rendered:!1}}}}),VZ=Uw.create({name:`commentBlock`,group:`block`,content:`block+`,defining:!0,priority:60,addAttributes(){return{sourceForm:{default:`percent`,parseHTML:e=>e.getAttribute(`data-source-form`)===`html`?`html`:`percent`,renderHTML:e=>e.sourceForm===`html`?{"data-source-form":`html`}:{}},sourceLayout:{default:`block`,parseHTML:e=>e.getAttribute(`data-source-layout`)===`inline`?`inline`:`block`,renderHTML:e=>e.sourceLayout===`inline`?{"data-source-layout":`inline`}:{}}}},parseHTML(){return[{tag:`aside[data-comment-block]`},{tag:`aside.comment-block`}]},renderHTML({HTMLAttributes:e}){return[`aside`,{"data-comment-block":``,"data-clipboard-omit":`true`,class:`comment-block`,...e},0]},addCommands(){return{setCommentBlock:()=>({commands:e})=>e.wrapIn(this.name),toggleCommentBlock:()=>({commands:e})=>e.toggleWrap(this.name),unsetCommentBlock:()=>({commands:e})=>e.lift(this.name)}}}),HZ=XC.create({name:`comment`,priority:10,excludes:``,inclusive:!1,addAttributes(){return{sourceForm:{default:`percent`,parseHTML:e=>e.getAttribute(`data-source-form`)===`html`?`html`:`percent`,renderHTML:e=>e.sourceForm===`html`?{"data-source-form":`html`}:{}}}},parseHTML(){return[{tag:`span[data-comment-mark]`}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-comment-mark":``,"data-clipboard-omit":`true`,class:`comment-mark`,...e},0]},addCommands(){return{setComment:()=>({commands:e})=>e.setMark(this.name),toggleComment:()=>({commands:e})=>e.toggleMark(this.name),unsetComment:()=>({commands:e})=>e.unsetMark(this.name)}}}),UZ=aw.create({name:`docFidelity`,addGlobalAttributes(){return[{types:[`doc`],attributes:{sourceDocBoundary:{default:null,rendered:!1}}}]}}),WZ=Uw.create({name:`imageReference`,marks:`_`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{alt:{default:``},label:{default:``},identifier:{default:``},referenceType:{default:`shortcut`}}},parseHTML(){return[{tag:`img[data-image-reference]`}]},renderHTML({node:e}){let{alt:t,label:n,referenceType:r}=e.attrs;return[`img`,{"data-image-reference":``,"data-reference-type":r,"data-label":n,alt:t||n}]}});function GZ(e){for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return t;return null}function KZ(e){let t=!1;return e.descendants(e=>t?!1:(e.type.name===`list`&&(t=!0),!t)),t}function qZ(e){let{selection:t}=e;return t instanceof K?t.$cursor:null}function JZ(e){let t=qZ(e);if(!t||t.parentOffset!==0)return!1;let n=GZ(t);if(n===null||t.depth!==n+1||t.index(n)!==0)return!1;let r=t.index(n-1);return r===0?!1:KZ(t.node(n-1).child(r-1))}function YZ(e,t){for(let n=t-1;n>=0;n--){let t=e.node(n),r=e.index(n);if(r<t.childCount-1){let e=t.child(r+1),i=n+1;for(;e.type.name===`list`&&e.firstChild;)e=e.firstChild,i+=1;return e.type.name===`listItem`?i:null}}return null}function XZ(e){let t=qZ(e);if(!t||t.parentOffset!==t.parent.content.size)return!1;let n=GZ(t);if(n===null)return!1;for(let e=t.depth;e>n;e--)if(t.index(e-1)!==t.node(e-1).childCount-1)return!1;let r=YZ(t,n);return r!==null&&r<n}var ZZ=aw.create({name:`listBoundaryMerge`,addKeyboardShortcuts(){let e=()=>{let{editor:e}=this;if(!JZ(e.state))return!1;if(e.commands.undoInputRule())return!0;let{state:t,view:n}=e;return ag(t,n.dispatch,n)},t=()=>{let{editor:e}=this;if(!XZ(e.state))return!1;let{state:t,view:n}=e;return og(t,n.dispatch,n)};return{Backspace:e,"Mod-Backspace":e,Delete:t,"Mod-Delete":t}}}),QZ=new Map([[32,` `],[9,` `],[160,`\xA0`]]);function $Z(e){let t=/^&#(x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);$/.exec(e);if(!t)return null;let n=t[1],r=n[0]===`x`||n[0]===`X`,i=Number.parseInt(r?n.slice(1):n,r?16:10);return Number.isNaN(i)?null:i}function eQ(e){let t=$Z(e);return t!==null&&QZ.has(t)}function tQ(e){let t=$Z(e);return t===null?null:QZ.get(t)??null}var nQ=/&#(?:x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);/g;function rQ(e){nQ.lastIndex=0;let t=e.match(nQ);if(t===null||t.join(``)!==e)return null;let n=``;for(let e of t){let t=tQ(e);if(t===null)return null;n+=t}return n}var iQ=XC.create({name:`sourceLiteral`,priority:10,excludes:``,inclusive:!1,addAttributes(){return{sourceRaw:{default:``}}},parseHTML(){return[{tag:`span[data-source-literal]`}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-source-literal":``,...e},0]}});function aQ(e,t){if(typeof e!=`string`||typeof t!=`string`||/[\x00-\x1F\x7F]/.test(e))return!1;let n=e.replaceAll(`\xA0`,` `),r=t.replaceAll(`\xA0`,` `);return n===r||oQ(n)===r?!0:rQ(e)===t}function oQ(e){return e.replace(/\\([!-/:-@[-`{-~])/g,`$1`)}var sQ=fte.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`~~`,rendered:!1}}}}),cQ=Vk.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDashCounts:{default:null},sourceOuterPipes:{default:null,rendered:!1},sourceAlignmentPadding:{default:null,rendered:!1}}}}),lQ=Ek.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),uQ=Dk.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),dQ=Uw.create({name:`tag`,marks:`_`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,addAttributes(){return{value:{default:``}}},parseHTML(){return[{tag:`a[data-tag]`,getAttrs:e=>typeof e==`string`?!1:{value:e.getAttribute(`data-tag`)||``}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.value??``);return[`a`,{...t,"data-tag":n,href:`#tag/${n}`,class:`tag`},`#${n}`]},addCommands(){return{insertTag:e=>({chain:t})=>t().insertContent({type:`tag`,attrs:{value:e}}).run()}}}),fQ=/^(?:---|—-|___\s|\*\*\*\s)$/;function pQ(e){let t=String(e[0]??``).replace(/\s+$/,``);return t===`—-`?`---`:t}var mQ=Zee.extend({name:`thematicBreak`,priority:60,addAttributes(){return{...this.parent?.(),sourceRaw:{default:`---`}}},addInputRules(){return[Sw({find:fQ,type:this.type,getAttributes:e=>({sourceRaw:pQ(e)})})]}}),hQ=/^\[\[([^[\]|#]+?)(?:#([^\]|]+?))?(?:\|([^\]]+?))?\]\]/;function gQ(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function _Q(e){let t=e.match(hQ);if(!t)return null;let n=t[1]?.trim()??``;return n?{type:`wikilink`,raw:t[0],target:n,anchor:gQ(t[2]),alias:gQ(t[3])}:null}function vQ(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}var yQ=Uw.create({name:`wikiLink`,marks:`_`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{target:{default:``},alias:{default:null},anchor:{default:null},resolved:{default:!1},sourceTarget:{default:null,rendered:!1},sourceAnchor:{default:null,rendered:!1},sourceAlias:{default:null,rendered:!1}}},parseHTML(){return[{tag:`span[data-wiki-link]`,getAttrs:e=>typeof e==`string`?!1:{target:e.getAttribute(`data-target`)||``,alias:gQ(e.getAttribute(`data-alias`)),anchor:gQ(e.getAttribute(`data-anchor`)),resolved:e.getAttribute(`data-resolved`)===`true`}},{tag:`a.wiki-link[data-target]`,priority:100,getAttrs:e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-target`)??``;return t?{target:t,alias:gQ(e.getAttribute(`data-alias`)),anchor:gQ(e.getAttribute(`data-anchor`)),resolved:!1}:!1}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=gQ(e.attrs.alias),i=gQ(e.attrs.anchor),a=e.attrs.resolved===!0;return[`span`,{...t,"data-wiki-link":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,"data-resolved":a?`true`:`false`},vQ({target:n,alias:r,anchor:i})]}});function bQ(e){let t=e.split(`/`).pop()??e,n=t.lastIndexOf(`.`);return n<=0||n===t.length-1?``:t.slice(n+1).toLowerCase()}function xQ(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}var SQ=Uw.create({name:`wikiLinkEmbed`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{target:{default:``},alias:{default:null},anchor:{default:null},resolvedSrc:{default:null,rendered:!1,parseHTML:()=>null}}},parseHTML(){let e=e=>typeof e==`string`||!e.hasAttribute(`data-wiki-embed`)?!1:{target:e.getAttribute(`data-target`)||``,alias:gQ(e.getAttribute(`data-alias`)),anchor:gQ(e.getAttribute(`data-anchor`))};return[{tag:`img[data-wiki-embed]`,getAttrs:e,priority:100},{tag:`a[data-wiki-embed]`,getAttrs:e,priority:100}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=gQ(e.attrs.alias),i=gQ(e.attrs.anchor),a=gQ(e.attrs.resolvedSrc),o=bQ(n);if(xd.has(o))return[`img`,{...t,"data-wiki-embed":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,src:a??n,alt:r??n}];let s=a??n;return[`a`,{...t,"data-wiki-embed":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,href:i?`${s}#${i}`:s,target:`_blank`,rel:`noopener noreferrer`},xQ({target:n,alias:r,anchor:i})]}}),CQ=[_Z,RZ,vZ,LZ,yQ,SQ,dQ,FZ,IZ,$X,eZ,sQ,BZ,QX,zZ,pZ,mQ,DZ,mZ,OZ,fZ,tZ,UZ,iQ,zte.configure({undoRedo:!1,bulletList:!1,orderedList:!1,listItem:!1,listKeymap:{listTypes:[{itemName:`listItem`,wrapperNames:[`list`]}]},italic:!1,bold:!1,strike:!1,code:!1,codeBlock:!1,heading:!1,horizontalRule:!1,hardBreak:!1,link:!1,blockquote:!1,dropcursor:{color:`color-mix(in oklch, var(--primary) 50%, transparent)`,width:2}}),ZZ,cQ.configure({resizable:!0}),Ok,uQ,lQ,gZ.configure({inline:!0}),WZ,PD,HZ,VZ,oZ,nZ];function wQ(e){let t=e.indexOf(`/`);return t===-1?e:e.slice(t+1)}function TQ(e,t){let n=encodeURIComponent(t.projectDir);if(t.prompt===``)return`claude://${e.mode}/new?folder=${n}`;let r=encodeURIComponent(t.prompt);return`claude://${e.mode}/new?q=${r}&folder=${n}`}function EQ(e){let t=encodeURIComponent(e.projectDir);return e.prompt===``?`codex://new?path=${t}`:`codex://new?prompt=${encodeURIComponent(e.prompt)}&path=${t}`}function DQ(e){let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`));return t<0?e:e.substring(t+1)}function OQ(e){let t=encodeURIComponent(DQ(e.projectDir));return e.prompt===``?`cursor://anysphere.cursor-deeplink/prompt?workspace=${t}&mode=agent`:`cursor://anysphere.cursor-deeplink/prompt?text=${encodeURIComponent(encodeURIComponent(e.prompt))}&workspace=${t}&mode=agent`}function kQ(e){return`'${e.replace(/'/g,`'\\''`)}'`}var AQ=[`mcp__${KX}`,`Bash(ok open:*)`],jQ=[`delete`,`move`,`share_link`,`install`].map(e=>`mcp__${KX}__${e}`),MQ=`-c ${kQ(`mcp_servers.${KX}.default_tools_approval_mode="approve"`)}`;function ane(e){let t={};return e.mcpPreApprove===!0&&(t.enabledMcpjsonServers=[KX]),e.autoApproveOkTools===!0&&(t.permissions={allow:[...AQ],deny:[...jQ]}),t.enabledMcpjsonServers===void 0&&t.permissions===void 0?``:`--settings ${kQ(JSON.stringify(t))}`}var NQ=`\x1B`,PQ=`${NQ}[200~`,FQ=`${NQ}[201~`,IQ={claude:{bin:`claude`,displayName:`Claude`,docsUrl:`https://docs.claude.com/en/docs/claude-code`,handoffTarget:`claude-code`},codex:{bin:`codex`,displayName:`Codex`,docsUrl:`https://developers.openai.com/codex/cli`,handoffTarget:`codex`,autoApproveArg:MQ},copilot:{bin:`copilot`,displayName:`GitHub Copilot`,docsUrl:`https://docs.github.com/en/copilot/how-tos/copilot-cli/cli-getting-started`,handoffTarget:`copilot`,promptFlag:`--interactive`},cursor:{bin:`cursor-agent`,displayName:`Cursor`,docsUrl:`https://cursor.com/docs/cli/overview`,handoffTarget:`cursor`},opencode:{bin:`opencode`,displayName:`OpenCode`,docsUrl:`https://opencode.ai/docs`,handoffTarget:`opencode`,promptFlag:`--prompt`},pi:{bin:`pi`,displayName:`Pi`,docsUrl:`https://pi.dev`,handoffTarget:`pi`},antigravity:{bin:`agy`,displayName:`Antigravity`,docsUrl:`https://antigravity.google/docs/cli-getting-started`,handoffTarget:`antigravity`,promptFlag:`--prompt-interactive`},openclaw:{bin:`openclaw`,subcommand:`chat`,displayName:`OpenClaw`,docsUrl:`https://docs.openclaw.ai/cli/tui`,handoffTarget:`openclaw`,promptFlag:`--message`},hermes:{bin:`hermes`,subcommand:`chat`,displayName:`Hermes`,docsUrl:`https://hermes-agent.nousresearch.com/docs/user-guide/cli`,handoffTarget:`hermes`,startupInjection:{submit:`\r`,readyMarker:`\x1B[?2004h`,settleMs:300,capMs:4e3}}},LQ=[`claude`,`codex`,`opencode`,`cursor`,`copilot`,`pi`,`antigravity`,`openclaw`,`hermes`];function RQ(e,t,n={}){let r=IQ[e],i=e===`claude`?ane(n):n.autoApproveOkTools===!0&&r.autoApproveArg?r.autoApproveArg:``,a=i?`${i} `:``,o=r.subcommand?`${r.subcommand} `:``;if(r.startupInjection!=null||t==null||t.length===0)return`${r.bin} ${o}${a}`.trimEnd();let s=r.promptFlag?`${r.promptFlag} `:``;return`${r.bin} ${o}${a}${s}${kQ(t)}`}function zQ(e){return IQ[e].startupInjection}function BQ(e,t){let n=zQ(e);return n==null||t==null||t.length===0?null:`${PQ}${t.replaceAll(NQ,``)}${FQ}${n.submit}`}var VQ=RegExp("[\\u0000-\\u001f\\u007f-\\u009f\\u200b-\\u200f\\u2028-\\u202e\\u2060-\\u2069\\ufeff`]+",`g`),HQ=RegExp("[ \\u00a0\\u0000-\\u001f\\u007f-\\u009f\\u200b-\\u200f\\u2028-\\u202e\\u2060-\\u2069\\ufeff`]+",`g`);function UQ(e){return e.replace(VQ,`_`)}function WQ(e){return e.replace(HQ,`_`)}var GQ="This is an OpenKnowledge project: load the `open-knowledge` skill and use the OpenKnowledge MCP tools for all markdown — don't probe for `.ok/` or use native file tools on `.md` / `.mdx`.";function KQ(e){return`${GQ} ${e}`}var qQ=`You're running in the terminal of the OpenKnowledge desktop app.`,JQ=`You're an agent working inside OpenKnowledge, with its MCP tools available to you.`;function YQ(e){return`${JQ} ${GQ} ${e===null?`Then stop.`:`Read \`${UQ(e)}\` via the OpenKnowledge MCP server, then stop.`}`}function XQ(e){return`${qQ} ${GQ} ${e===null?`Then stop.`:`Read \`${UQ(e)}\` via the OpenKnowledge MCP server, then stop.`}`}function ZQ(e,t,n,r=`url`){let i=`Let's work on \`${UQ(e)}\` using OpenKnowledge.`;return b$(t?`${i} Open the OK editor in web view.`:i,n,r)}function QQ(e,t,n){let r=`Use your open-knowledge-write-skill skill to author the ${t} Open Knowledge skill \`${UQ(e)}\`. Edit it with the Open Knowledge tools.`;return n?`${r} Open the OK editor in web view.`:r}function $Q(e,t,n,r=`url`){let i=`Let's work on the \`${UQ(e)}\` folder using OpenKnowledge.`;return b$(t?`${i} Open the OK editor in web view.`:i,n,r)}function e$(e,t,n=`url`){let r=`Let's work on this project using OpenKnowledge.`;return b$(e?`${r} Open the OK editor in web view.`:r,t,n)}function t$(e,t,n,r,i=`url`){let a=t?`Open the OK editor in web view.`:``,o=e=>a===``?e:e.includes(`
465
+ </div>`}],JX=[{name:`--chart-1`,light:`oklch(0.62 0.19 259)`,dark:`oklch(0.72 0.14 259)`},{name:`--chart-2`,light:`oklch(0.58 0.14 145)`,dark:`oklch(0.73 0.13 145)`},{name:`--chart-3`,light:`oklch(0.62 0.15 70)`,dark:`oklch(0.77 0.14 70)`},{name:`--chart-4`,light:`oklch(0.55 0.18 290)`,dark:`oklch(0.72 0.16 290)`},{name:`--chart-5`,light:`oklch(0.58 0.21 25)`,dark:`oklch(0.72 0.2 25)`},{name:`--primary`,light:`oklch(0.6321 0.1983 259.59)`,dark:`#69a3ff`},{name:`--primary-foreground`,light:`oklch(0.985 0 0)`,dark:`oklch(0.205 0 0)`},{name:`--foreground`,light:`oklch(0.145 0 0)`,dark:`oklch(0.985 0 0)`},{name:`--background`,light:`oklch(1 0 0)`,dark:`oklch(0.145 0 0)`},{name:`--card`,light:`oklch(1 0 0)`,dark:`oklch(0.205 0 0)`},{name:`--card-foreground`,light:`oklch(0.145 0 0)`,dark:`oklch(0.985 0 0)`},{name:`--muted-foreground`,light:`oklch(0.556 0 0)`,dark:`oklch(0.708 0 0)`},{name:`--border`,light:`oklch(0.922 0 0)`,dark:`oklch(1 0 0 / 10%)`},{name:`--destructive`,light:`oklch(0.577 0.245 27.325)`,dark:`oklch(0.704 0.191 22.216)`},{name:`--radius`,light:`0.625rem`,dark:`0.625rem`}],YX=Object.freeze([{value:`workflow-fit`,label:`It didn't fit into my workflow`},{value:`missing-feature`,label:`It was missing a feature I needed`},{value:`hard-to-start`,label:`It was too hard to set up or get started`},{value:`unreliable`,label:`Bugs, crashes, or it felt unreliable`},{value:`switched-tool`,label:`I'm switching to another tool`},{value:`one-off`,label:`It was a trial or one-off project`},{value:`other`,label:`Something else`}]),XX=1e4;new Set(YX.map(e=>e.value));var ZX=Xw.extend({priority:60,addAttributes(){return{...this.parent?.(),fenceDelimiter:{default:"`"},fenceLength:{default:3},meta:{default:null},sourceStyle:{default:`fenced`},sourceClosingFenceLength:{default:null,rendered:!1},sourceUnclosedFence:{default:!1,rendered:!1},sourceFenceIndent:{default:null,rendered:!1},sourceInfoPadding:{default:null,rendered:!1},sourceIndents:{default:null,rendered:!1}}}}),QX=lT.extend({name:`emphasis`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`*`}}},addInputRules(){return[xw({find:iT,type:this.type,getAttributes:{sourceDelimiter:`*`}}),xw({find:oT,type:this.type,getAttributes:{sourceDelimiter:`_`}})]}}),$X=rT.extend({name:`strong`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`**`}}},addInputRules(){return[xw({find:Qw,type:this.type,getAttributes:{sourceDelimiter:`**`}}),xw({find:eT,type:this.type,getAttributes:{sourceDelimiter:`__`}})]}}),eZ=XC.create({name:`escapeMark`,priority:10,excludes:``,inclusive:!1,parseHTML(){return[{tag:`span[data-escape-mark]`}]},renderHTML(){return[`span`,{"data-escape-mark":``},0]}}),tZ=Uw.create({name:`footnoteDefinition`,group:`block`,content:`block+`,defining:!0,priority:60,addAttributes(){return{identifier:{default:``},label:{default:null}}},parseHTML(){let e=e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-footnote-id`)||``;return{identifier:t,label:t||null}};return[{tag:`aside[data-footnote-def]`,getAttrs:e},{tag:`aside.footnote-def`,getAttrs:e}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.identifier??``);return[`aside`,{...t,"data-footnote-def":``,"data-footnote-id":n,id:`fn-${n}`,class:`footnote-def`},[`div`,{class:`footnote-body`},0],[`a`,{href:`#fnref-${n}`,class:`footnote-backref`,contentEditable:`false`,"aria-label":`Back to reference`},`↩`]]},addCommands(){return{insertFootnoteDefinition:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{identifier:e,label:e},content:[{type:`paragraph`}]})}}});function nZ(e){let t=0;for(let n of e){let e=Number.parseInt(n,10);!Number.isNaN(e)&&e>t&&(t=e)}return String(t+1)}function rZ(e){let t=[];return e.descendants(e=>(e.type.name===`footnoteDefinition`&&t.push(String(e.attrs.identifier??``)),!0)),t}function iZ(e){let t=null;return e.forEach((e,n)=>{e.type.name===`footnoteDefinition`&&(t=n+e.nodeSize)}),t??e.content.size}var aZ=Uw.create({name:`footnoteReference`,marks:`_`,group:`inline`,inline:!0,atom:!0,selectable:!0,draggable:!1,priority:60,addAttributes(){return{identifier:{default:``},label:{default:null}}},parseHTML(){return[{tag:`sup[data-footnote-ref]`,getAttrs:e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-footnote-id`)||``;return{identifier:t,label:t||null}}}]},renderHTML({node:e}){let t=String(e.attrs.identifier??``);return[`sup`,{id:`fnref-${t}`,"data-footnote-ref":``,"data-footnote-id":t,class:`footnote-ref`},[`a`,{href:`#fn-${t}`,class:`footnote-ref-link`},`[${t}]`]]},addCommands(){return{insertFootnoteReference:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{identifier:e,label:e}})}}}),oZ=/^---[ \t]*\r?\n([\s\S]*?\r?\n)?---[ \t]*(\r?\n|$)/,sZ=/^---[ \t]*$/;function cZ(e){let t=e.match(oZ);return t?{frontmatter:t[0],body:e.slice(t[0].length)}:{frontmatter:``,body:e}}function lZ(e,t){return e?e+t:t}function uZ(e){if(e===``)return``;let t=e.match(oZ);return t?(t[1]??``).replace(/\r?\n$/,``):e}var dZ=dT.extend({marks:`_`,priority:60,addAttributes(){return{...this.parent?.(),hardBreakStyle:{default:`backslash`},sourceRaw:{default:null}}}}),fZ=pT.extend({priority:60,addAttributes(){return{...this.parent?.(),headingStyle:{default:`atx`},sourceTrailingHashes:{default:null},sourceUnderlineLength:{default:null},sourceContiguousNext:{default:!1},sourceLeadingIndent:{default:null,rendered:!1},sourceInteriorSpacing:{default:null,rendered:!1}}}}),pZ=Uw.create({name:`htmlBlock`,group:`block`,atom:!0,priority:60,addAttributes(){return{content:{default:``}}},parseHTML(){return[{tag:`div[data-html-block]`}]},renderHTML({node:e}){return[`div`,{"data-html-block":``,class:`html-block`},e.attrs.content]}});function mZ(e){if(typeof e!=`string`||!e.startsWith(`/`))return e;let t=globalThis.window?.okDesktop?.config?.apiOrigin;return typeof t==`string`&&t?t+e:e}var hZ=hT.extend({marks:`_`,priority:60,addAttributes(){return{...this.parent?.(),sourceUrl:{default:null,rendered:!1}}},renderHTML({HTMLAttributes:e}){let t=PS(this.options.HTMLAttributes,e);return typeof t.src==`string`&&(t.src=mZ(t.src)),[`img`,t]}}),gZ=Uw.create({name:`jsxComponent`,group:`block`,atom:!1,content:`block*`,isolating:!0,selectable:!0,defining:!0,priority:60,addAttributes(){return{componentName:{default:``},kind:{default:`element`},attributes:{default:[]},sourceRaw:{default:``},sourceDirty:{default:!1},props:{default:{}}}},parseHTML(){return[{tag:`div[data-jsx-component]`,getAttrs:e=>typeof e==`string`?!1:{componentName:e.getAttribute(`data-component-name`)||``,sourceRaw:e.getAttribute(`data-source-raw`)||``}}]},renderHTML({HTMLAttributes:e}){return[`div`,{"data-jsx-component":``,"data-component-name":e.componentName,"data-source-raw":e.sourceRaw},0]},addCommands(){return{insertJsxComponent:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{sourceRaw:e}})}}}),_Z=Uw.create({name:`jsxInline`,group:`inline`,inline:!0,atom:!1,content:`text*`,isolating:!1,selectable:!0,priority:60,addAttributes(){return{}},parseHTML(){return[{tag:`span[data-jsx-inline]`}]},renderHTML(){return[`span`,{"data-jsx-inline":``},0]}}),vZ=[`https`,`http`,`mailto`,`tel`,`ftp`,`sms`],yZ=vZ.map(e=>`${e}:`).join(`|`),bZ=RegExp(`^(?:${yZ}|\\/|#|\\?|\\.\\/|\\.\\.\\/)`,`i`);function xZ(e){let t=e.trim();return t===``?!0:bZ.test(t)}function SZ(e){let t=e.trim();if(t===``)return!0;let n=t.indexOf(`:`);if(n===-1)return!0;let r=t.indexOf(`/`),i=t.indexOf(`?`),a=t.indexOf(`#`);return n>Math.min(r===-1?1/0:r,i===-1?1/0:i,a===-1?1/0:a)}var CZ=new Set(vZ.map(e=>`${e}:`)),wZ=`https://placeholder.invalid`;function TZ(e){try{let t=new URL(e,wZ);return CZ.has(t.protocol.toLowerCase())}catch{return!1}}var EZ=jD.extend({priority:60,addOptions(){return{openOnClick:!1,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer`},isAllowedUri:TZ,validate:TZ,shouldAutoLink:()=>!0}},addAttributes(){return{...this.parent?.(),linkStyle:{default:`inline`,rendered:!1},refLabel:{default:null,rendered:!1},sourceForm:{default:null,rendered:!1},target:{default:null,rendered:!1},anchor:{default:null,rendered:!1},alias:{default:null,rendered:!1},sourceUrlForm:{default:null,rendered:!1},sourceTitleMarker:{default:null,rendered:!1}}}}),DZ=Uw.create({name:`linkRefDef`,group:`block`,atom:!0,priority:60,addAttributes(){return{label:{default:``},href:{default:``},title:{default:null},sourceLayout:{default:null},sourceTitleMarker:{default:null}}},parseHTML(){return[{tag:`div[data-link-ref-def]`}]},renderHTML({node:e}){let{label:t,href:n,title:r}=e.attrs;return[`div`,{"data-link-ref-def":``,class:`link-ref-def`},r?`[${t}]: ${n} "${r}"`:`[${t}]: ${n}`]}});function OZ(e){return e.type.name===`list`&&!e.attrs.ordered}function kZ(e){return e.type.name===`list`&&!!e.attrs.ordered}function AZ(e){let t=!1;return e.forEach(e=>{e.type.name===`listItem`&&e.attrs.checked!==null&&(t=!0)}),t}function jZ(e,t,n,r,i,a,o){let s=wS(e=>e.type.name===`list`)(e.selection);if(s&&i(s.node)){let{$from:n,$to:i}=e.selection;return n.blockRange(i)?Ng(r)(e,t):!1}if(s){if(!t)return!0;let{tr:n}=e;return n.setNodeMarkup(s.pos,void 0,{...s.node.attrs,...a}),o!==void 0&&s.node.forEach((e,t)=>{if(e.type.name===`listItem`){let r=s.pos+1+t;n.setNodeMarkup(r,void 0,{...e.attrs,...o})}}),t(n),!0}return Mg(n,a)(e,void 0)?t?Mg(n,a)(e,n=>{if(o){let t=n.mapping.map(e.selection.$from.pos),r=n.doc.resolve(t);for(let e=r.depth;e>0;e--){let t=r.node(e);if(t.type.name===`listItem`){n.setNodeMarkup(r.before(e),void 0,{...t.attrs,...o});break}}}t(n)}):!0:!1}var MZ=Uw.create({name:`list`,group:`block list`,content:`listItem+`,priority:60,addAttributes(){return{ordered:{default:!1},start:{default:1},spread:{default:!1},bulletMarker:{default:null},listMarkerDelimiter:{default:null}}},parseHTML(){return[{tag:`ul`,getAttrs:()=>({ordered:!1})},{tag:`ol`,getAttrs:e=>({ordered:!0,start:e.getAttribute(`start`)?Number(e.getAttribute(`start`)):1})}]},renderHTML({node:e,HTMLAttributes:t}){let n=e.attrs.ordered?`ol`:`ul`,r={};return e.attrs.ordered&&e.attrs.start!==1&&(r.start=e.attrs.start),[n,PS(t,r),0]},addCommands(){return{toggleBulletList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:jZ(e,t,n,r,e=>OZ(e)&&!AZ(e),{ordered:!1},{checked:null})},toggleOrderedList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:jZ(e,t,n,r,e=>kZ(e),{ordered:!0},{checked:null})},toggleTaskList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:jZ(e,t,n,r,e=>OZ(e)&&AZ(e),{ordered:!1},{checked:!1})}}},addInputRules(){return[ww({find:/^\s*([-+*])(?!\s*\[[ xX]\])\s$/,type:this.type,getAttributes:e=>({ordered:!1,bulletMarker:e[1]}),joinPredicate:(e,t)=>t.attrs.ordered===!1}),ww({find:/^\s*(\d+)([.)])\s$/,type:this.type,getAttributes:e=>({ordered:!0,start:Number(e[1]),listMarkerDelimiter:e[2]}),joinPredicate:(e,t)=>t.attrs.ordered===!0}),new HC({find:/^\s*[-*+]\s\[([ xX])\]\s$/,handler:({state:e,range:t,match:n})=>{let r=e.schema.nodes.list;if(!r)return null;let i=n[1]!==` `,a=e.tr.delete(t.from,t.to),o=a.doc.resolve(t.from).blockRange();if(!o)return null;let s=Jm(o,r,{ordered:!1});if(!s)return null;a.wrap(o,s);let c=a.doc.resolve(a.mapping.map(t.from));for(let e=c.depth;e>0;e--){let t=c.node(e);if(t.type.name===`listItem`){a.setNodeMarkup(c.before(e),void 0,{...t.attrs,checked:i});break}}}})]},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList(),"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList(),"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),NZ=Uw.create({name:`listItem`,content:`paragraph block*`,defining:!0,addAttributes(){return{checked:{default:null},spread:{default:!1},sourceMarkerSpacing:{default:null,rendered:!1},sourceOrdinal:{default:null,rendered:!1},sourceCheckboxChar:{default:null,rendered:!1},sourceContinuationIndent:{default:null,rendered:!1}}},parseHTML(){return[{tag:`li`,getAttrs:e=>{let t=e.querySelector(`input[type="checkbox"]`);return{checked:t?t.checked:null}}}]},renderHTML({node:e,HTMLAttributes:t}){return e.attrs.checked===null?[`li`,PS(t),0]:[`li`,PS(t,{"data-type":`taskItem`,"data-checked":e.attrs.checked?`true`:`false`}),[`label`,{contenteditable:`false`},[`input`,{type:`checkbox`,...e.attrs.checked?{checked:`checked`}:{}}]],[`div`,0]]},addNodeView(){return({node:e,getPos:t,editor:n,HTMLAttributes:r})=>{let i=document.createElement(`li`);Object.entries(PS(r,e.attrs.checked===null?{}:{"data-type":`taskItem`,"data-checked":String(!!e.attrs.checked)})).forEach(([e,t])=>{t!=null&&i.setAttribute(e,String(t))});let a=null,o=null,s=document.createElement(`div`),c=()=>{o&&(o.disabled=!n.isEditable)};return e.attrs.checked!==null&&(a=document.createElement(`label`),a.contentEditable=`false`,o=document.createElement(`input`),o.type=`checkbox`,o.checked=!!e.attrs.checked,c(),n.on(`update`,c),o.addEventListener(`change`,()=>{let r=t();r===void 0||typeof r!=`number`||n.view.dispatch(n.view.state.tr.setNodeMarkup(r,void 0,{...e.attrs,checked:o?.checked??!1}))}),a.appendChild(o),i.appendChild(a)),i.appendChild(s),{dom:i,contentDOM:s,update(t){return t.type!==e.type||t.attrs.checked!==null!=(e.attrs.checked!==null)?!1:(o&&t.attrs.checked!==null&&(o.checked=!!t.attrs.checked,o.disabled=!n.isEditable,i.setAttribute(`data-checked`,String(!!t.attrs.checked))),e=t,!0)},destroy(){n.off(`update`,c)}}}},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>{let{$from:e}=this.editor.state.selection;for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return this.editor.commands.sinkListItem(this.name);return!1},"Shift-Tab":()=>{let{$from:e}=this.editor.state.selection;for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return this.editor.commands.liftListItem(this.name);return!1}}}}),PZ=MZ,FZ=NZ,IZ=Uw.create({name:`mathInline`,marks:`_`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,addAttributes(){return{formula:{default:``},id:{default:null},language:{default:`latex`},sourceDelimiter:{default:null,rendered:!1}}},parseHTML(){return[{tag:`span[data-math-inline]`,getAttrs:e=>typeof e==`string`?!1:{formula:e.getAttribute(`data-formula`)||``,id:e.getAttribute(`id`)||null,language:e.getAttribute(`data-language`)||`latex`}}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-math-inline":``,"data-formula":e.formula,"data-language":e.language,...e.id?{id:e.id}:{}}]},addCommands(){return{insertMathInline:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{formula:e}})}}}),LZ=Uw.create({name:`rawMdxFallback`,group:`block`,atom:!1,content:`text*`,isolating:!0,selectable:!0,defining:!0,priority:60,addAttributes(){return{reason:{default:``},originalSpan:{default:{start:0,end:0}}}},parseHTML(){let e=e=>typeof e==`string`?!1:{reason:e.getAttribute(`data-reason`)||``};return[{tag:`div[data-raw-mdx-fallback]`,getAttrs:e},{tag:`pre[data-raw-mdx-fallback]`,getAttrs:e}]},renderHTML({HTMLAttributes:e}){return[`div`,{"data-raw-mdx-fallback":``,"data-raw-badge":`raw`,"data-reason":e.reason,contenteditable:`false`,class:`raw-mdx-fallback`},0]},addNodeView(){return({HTMLAttributes:e})=>{let t=document.createElement(`div`);t.setAttribute(`data-raw-mdx-fallback`,``),t.setAttribute(`data-raw-badge`,`raw`),t.setAttribute(`contenteditable`,`false`),t.classList.add(`raw-mdx-fallback`),e.reason&&t.setAttribute(`data-reason`,e.reason);let n=document.createElement(`pre`);return n.classList.add(`raw-mdx-fallback-content`),n.setAttribute(`contenteditable`,`false`),t.appendChild(n),{dom:t,contentDOM:n,ignoreMutation:()=>!0}}}}),RZ=Wk.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceMarkerSpacings:{default:null}}}}),zZ=Xee.extend({excludes:``,addAttributes(){return{...this.parent?.(),sourceFenceChar:{default:"`"},sourceFenceLength:{default:1},sourcePadded:{default:!1,rendered:!1}}}}),BZ=Uw.create({name:`commentBlock`,group:`block`,content:`block+`,defining:!0,priority:60,addAttributes(){return{sourceForm:{default:`percent`,parseHTML:e=>e.getAttribute(`data-source-form`)===`html`?`html`:`percent`,renderHTML:e=>e.sourceForm===`html`?{"data-source-form":`html`}:{}},sourceLayout:{default:`block`,parseHTML:e=>e.getAttribute(`data-source-layout`)===`inline`?`inline`:`block`,renderHTML:e=>e.sourceLayout===`inline`?{"data-source-layout":`inline`}:{}}}},parseHTML(){return[{tag:`aside[data-comment-block]`},{tag:`aside.comment-block`}]},renderHTML({HTMLAttributes:e}){return[`aside`,{"data-comment-block":``,"data-clipboard-omit":`true`,class:`comment-block`,...e},0]},addCommands(){return{setCommentBlock:()=>({commands:e})=>e.wrapIn(this.name),toggleCommentBlock:()=>({commands:e})=>e.toggleWrap(this.name),unsetCommentBlock:()=>({commands:e})=>e.lift(this.name)}}}),VZ=XC.create({name:`comment`,priority:10,excludes:``,inclusive:!1,addAttributes(){return{sourceForm:{default:`percent`,parseHTML:e=>e.getAttribute(`data-source-form`)===`html`?`html`:`percent`,renderHTML:e=>e.sourceForm===`html`?{"data-source-form":`html`}:{}}}},parseHTML(){return[{tag:`span[data-comment-mark]`}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-comment-mark":``,"data-clipboard-omit":`true`,class:`comment-mark`,...e},0]},addCommands(){return{setComment:()=>({commands:e})=>e.setMark(this.name),toggleComment:()=>({commands:e})=>e.toggleMark(this.name),unsetComment:()=>({commands:e})=>e.unsetMark(this.name)}}}),HZ=aw.create({name:`docFidelity`,addGlobalAttributes(){return[{types:[`doc`],attributes:{sourceDocBoundary:{default:null,rendered:!1}}}]}}),UZ=Uw.create({name:`imageReference`,marks:`_`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{alt:{default:``},label:{default:``},identifier:{default:``},referenceType:{default:`shortcut`}}},parseHTML(){return[{tag:`img[data-image-reference]`}]},renderHTML({node:e}){let{alt:t,label:n,referenceType:r}=e.attrs;return[`img`,{"data-image-reference":``,"data-reference-type":r,"data-label":n,alt:t||n}]}});function WZ(e){for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return t;return null}function GZ(e){let t=!1;return e.descendants(e=>t?!1:(e.type.name===`list`&&(t=!0),!t)),t}function KZ(e){let{selection:t}=e;return t instanceof K?t.$cursor:null}function qZ(e){let t=KZ(e);if(!t||t.parentOffset!==0)return!1;let n=WZ(t);if(n===null||t.depth!==n+1||t.index(n)!==0)return!1;let r=t.index(n-1);return r===0?!1:GZ(t.node(n-1).child(r-1))}function JZ(e,t){for(let n=t-1;n>=0;n--){let t=e.node(n),r=e.index(n);if(r<t.childCount-1){let e=t.child(r+1),i=n+1;for(;e.type.name===`list`&&e.firstChild;)e=e.firstChild,i+=1;return e.type.name===`listItem`?i:null}}return null}function YZ(e){let t=KZ(e);if(!t||t.parentOffset!==t.parent.content.size)return!1;let n=WZ(t);if(n===null)return!1;for(let e=t.depth;e>n;e--)if(t.index(e-1)!==t.node(e-1).childCount-1)return!1;let r=JZ(t,n);return r!==null&&r<n}var XZ=aw.create({name:`listBoundaryMerge`,addKeyboardShortcuts(){let e=()=>{let{editor:e}=this;if(!qZ(e.state))return!1;if(e.commands.undoInputRule())return!0;let{state:t,view:n}=e;return ag(t,n.dispatch,n)},t=()=>{let{editor:e}=this;if(!YZ(e.state))return!1;let{state:t,view:n}=e;return og(t,n.dispatch,n)};return{Backspace:e,"Mod-Backspace":e,Delete:t,"Mod-Delete":t}}}),ZZ=new Map([[32,` `],[9,` `],[160,`\xA0`]]);function QZ(e){let t=/^&#(x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);$/.exec(e);if(!t)return null;let n=t[1],r=n[0]===`x`||n[0]===`X`,i=Number.parseInt(r?n.slice(1):n,r?16:10);return Number.isNaN(i)?null:i}function $Z(e){let t=QZ(e);return t!==null&&ZZ.has(t)}function eQ(e){let t=QZ(e);return t===null?null:ZZ.get(t)??null}var tQ=/&#(?:x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);/g;function nQ(e){tQ.lastIndex=0;let t=e.match(tQ);if(t===null||t.join(``)!==e)return null;let n=``;for(let e of t){let t=eQ(e);if(t===null)return null;n+=t}return n}var rQ=XC.create({name:`sourceLiteral`,priority:10,excludes:``,inclusive:!1,addAttributes(){return{sourceRaw:{default:``}}},parseHTML(){return[{tag:`span[data-source-literal]`}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-source-literal":``,...e},0]}});function iQ(e,t){if(typeof e!=`string`||typeof t!=`string`||/[\x00-\x1F\x7F]/.test(e))return!1;let n=e.replaceAll(`\xA0`,` `),r=t.replaceAll(`\xA0`,` `);return n===r||aQ(n)===r?!0:nQ(e)===t}function aQ(e){return e.replace(/\\([!-/:-@[-`{-~])/g,`$1`)}var oQ=pte.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`~~`,rendered:!1}}}}),sQ=Vk.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDashCounts:{default:null},sourceOuterPipes:{default:null,rendered:!1},sourceAlignmentPadding:{default:null,rendered:!1}}}}),cQ=Ek.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),lQ=Dk.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),uQ=Uw.create({name:`tag`,marks:`_`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,addAttributes(){return{value:{default:``}}},parseHTML(){return[{tag:`a[data-tag]`,getAttrs:e=>typeof e==`string`?!1:{value:e.getAttribute(`data-tag`)||``}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.value??``);return[`a`,{...t,"data-tag":n,href:`#tag/${n}`,class:`tag`},`#${n}`]},addCommands(){return{insertTag:e=>({chain:t})=>t().insertContent({type:`tag`,attrs:{value:e}}).run()}}}),dQ=/^(?:---|—-|___\s|\*\*\*\s)$/;function fQ(e){let t=String(e[0]??``).replace(/\s+$/,``);return t===`—-`?`---`:t}var pQ=Qee.extend({name:`thematicBreak`,priority:60,addAttributes(){return{...this.parent?.(),sourceRaw:{default:`---`}}},addInputRules(){return[Sw({find:dQ,type:this.type,getAttributes:e=>({sourceRaw:fQ(e)})})]}}),mQ=/^\[\[([^[\]|#]+?)(?:#([^\]|]+?))?(?:\|([^\]]+?))?\]\]/;function hQ(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function gQ(e){let t=e.match(mQ);if(!t)return null;let n=t[1]?.trim()??``;return n?{type:`wikilink`,raw:t[0],target:n,anchor:hQ(t[2]),alias:hQ(t[3])}:null}function _Q(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}var vQ=Uw.create({name:`wikiLink`,marks:`_`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{target:{default:``},alias:{default:null},anchor:{default:null},resolved:{default:!1},sourceTarget:{default:null,rendered:!1},sourceAnchor:{default:null,rendered:!1},sourceAlias:{default:null,rendered:!1}}},parseHTML(){return[{tag:`span[data-wiki-link]`,getAttrs:e=>typeof e==`string`?!1:{target:e.getAttribute(`data-target`)||``,alias:hQ(e.getAttribute(`data-alias`)),anchor:hQ(e.getAttribute(`data-anchor`)),resolved:e.getAttribute(`data-resolved`)===`true`}},{tag:`a.wiki-link[data-target]`,priority:100,getAttrs:e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-target`)??``;return t?{target:t,alias:hQ(e.getAttribute(`data-alias`)),anchor:hQ(e.getAttribute(`data-anchor`)),resolved:!1}:!1}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=hQ(e.attrs.alias),i=hQ(e.attrs.anchor),a=e.attrs.resolved===!0;return[`span`,{...t,"data-wiki-link":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,"data-resolved":a?`true`:`false`},_Q({target:n,alias:r,anchor:i})]}});function yQ(e){let t=e.split(`/`).pop()??e,n=t.lastIndexOf(`.`);return n<=0||n===t.length-1?``:t.slice(n+1).toLowerCase()}function bQ(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}var xQ=Uw.create({name:`wikiLinkEmbed`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{target:{default:``},alias:{default:null},anchor:{default:null},resolvedSrc:{default:null,rendered:!1,parseHTML:()=>null}}},parseHTML(){let e=e=>typeof e==`string`||!e.hasAttribute(`data-wiki-embed`)?!1:{target:e.getAttribute(`data-target`)||``,alias:hQ(e.getAttribute(`data-alias`)),anchor:hQ(e.getAttribute(`data-anchor`))};return[{tag:`img[data-wiki-embed]`,getAttrs:e,priority:100},{tag:`a[data-wiki-embed]`,getAttrs:e,priority:100}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=hQ(e.attrs.alias),i=hQ(e.attrs.anchor),a=hQ(e.attrs.resolvedSrc),o=yQ(n);if(xd.has(o))return[`img`,{...t,"data-wiki-embed":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,src:a??n,alt:r??n}];let s=a??n;return[`a`,{...t,"data-wiki-embed":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,href:i?`${s}#${i}`:s,target:`_blank`,rel:`noopener noreferrer`},bQ({target:n,alias:r,anchor:i})]}}),SQ=[gZ,LZ,_Z,IZ,vQ,xQ,uQ,PZ,FZ,QX,$X,oQ,zZ,ZX,RZ,fZ,pQ,EZ,pZ,DZ,dZ,eZ,HZ,rQ,Bte.configure({undoRedo:!1,bulletList:!1,orderedList:!1,listItem:!1,listKeymap:{listTypes:[{itemName:`listItem`,wrapperNames:[`list`]}]},italic:!1,bold:!1,strike:!1,code:!1,codeBlock:!1,heading:!1,horizontalRule:!1,hardBreak:!1,link:!1,blockquote:!1,dropcursor:{color:`color-mix(in oklch, var(--primary) 50%, transparent)`,width:2}}),XZ,sQ.configure({resizable:!0}),Ok,lQ,cQ,hZ.configure({inline:!0}),UZ,PD,VZ,BZ,aZ,tZ];function CQ(e){let t=e.indexOf(`/`);return t===-1?e:e.slice(t+1)}function wQ(e,t){let n=encodeURIComponent(t.projectDir);if(t.prompt===``)return`claude://${e.mode}/new?folder=${n}`;let r=encodeURIComponent(t.prompt);return`claude://${e.mode}/new?q=${r}&folder=${n}`}function TQ(e){let t=encodeURIComponent(e.projectDir);return e.prompt===``?`codex://new?path=${t}`:`codex://new?prompt=${encodeURIComponent(e.prompt)}&path=${t}`}function EQ(e){let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`));return t<0?e:e.substring(t+1)}function DQ(e){let t=encodeURIComponent(EQ(e.projectDir));return e.prompt===``?`cursor://anysphere.cursor-deeplink/prompt?workspace=${t}&mode=agent`:`cursor://anysphere.cursor-deeplink/prompt?text=${encodeURIComponent(encodeURIComponent(e.prompt))}&workspace=${t}&mode=agent`}function OQ(e){return`'${e.replace(/'/g,`'\\''`)}'`}var kQ=[`mcp__${GX}`,`Bash(ok open:*)`],AQ=[`delete`,`move`,`share_link`,`install`].map(e=>`mcp__${GX}__${e}`),jQ=`-c ${OQ(`mcp_servers.${GX}.default_tools_approval_mode="approve"`)}`;function one(e){let t={};return e.mcpPreApprove===!0&&(t.enabledMcpjsonServers=[GX]),e.autoApproveOkTools===!0&&(t.permissions={allow:[...kQ],deny:[...AQ]}),t.enabledMcpjsonServers===void 0&&t.permissions===void 0?``:`--settings ${OQ(JSON.stringify(t))}`}var MQ=`\x1B`,NQ=`${MQ}[200~`,PQ=`${MQ}[201~`,FQ={claude:{bin:`claude`,displayName:`Claude`,docsUrl:`https://docs.claude.com/en/docs/claude-code`,handoffTarget:`claude-code`},codex:{bin:`codex`,displayName:`Codex`,docsUrl:`https://developers.openai.com/codex/cli`,handoffTarget:`codex`,autoApproveArg:jQ},copilot:{bin:`copilot`,displayName:`GitHub Copilot`,docsUrl:`https://docs.github.com/en/copilot/how-tos/copilot-cli/cli-getting-started`,handoffTarget:`copilot`,promptFlag:`--interactive`},cursor:{bin:`cursor-agent`,displayName:`Cursor`,docsUrl:`https://cursor.com/docs/cli/overview`,handoffTarget:`cursor`},opencode:{bin:`opencode`,displayName:`OpenCode`,docsUrl:`https://opencode.ai/docs`,handoffTarget:`opencode`,promptFlag:`--prompt`},pi:{bin:`pi`,displayName:`Pi`,docsUrl:`https://pi.dev`,handoffTarget:`pi`},antigravity:{bin:`agy`,displayName:`Antigravity`,docsUrl:`https://antigravity.google/docs/cli-getting-started`,handoffTarget:`antigravity`,promptFlag:`--prompt-interactive`},openclaw:{bin:`openclaw`,subcommand:`chat`,displayName:`OpenClaw`,docsUrl:`https://docs.openclaw.ai/cli/tui`,handoffTarget:`openclaw`,promptFlag:`--message`},hermes:{bin:`hermes`,subcommand:`chat`,displayName:`Hermes`,docsUrl:`https://hermes-agent.nousresearch.com/docs/user-guide/cli`,handoffTarget:`hermes`,startupInjection:{submit:`\r`,readyMarker:`\x1B[?2004h`,settleMs:300,capMs:4e3}}},IQ=[`claude`,`codex`,`opencode`,`cursor`,`copilot`,`pi`,`antigravity`,`openclaw`,`hermes`];function LQ(e,t,n={}){let r=FQ[e],i=e===`claude`?one(n):n.autoApproveOkTools===!0&&r.autoApproveArg?r.autoApproveArg:``,a=i?`${i} `:``,o=r.subcommand?`${r.subcommand} `:``;if(r.startupInjection!=null||t==null||t.length===0)return`${r.bin} ${o}${a}`.trimEnd();let s=r.promptFlag?`${r.promptFlag} `:``;return`${r.bin} ${o}${a}${s}${OQ(t)}`}function RQ(e){return FQ[e].startupInjection}function zQ(e,t){let n=RQ(e);return n==null||t==null||t.length===0?null:`${NQ}${t.replaceAll(MQ,``)}${PQ}${n.submit}`}var BQ=RegExp("[\\u0000-\\u001f\\u007f-\\u009f\\u200b-\\u200f\\u2028-\\u202e\\u2060-\\u2069\\ufeff`]+",`g`),VQ=RegExp("[ \\u00a0\\u0000-\\u001f\\u007f-\\u009f\\u200b-\\u200f\\u2028-\\u202e\\u2060-\\u2069\\ufeff`]+",`g`);function HQ(e){return e.replace(BQ,`_`)}function UQ(e){return e.replace(VQ,`_`)}var WQ="This is an OpenKnowledge project: load the `open-knowledge` skill and use the OpenKnowledge MCP tools for all markdown — don't probe for `.ok/` or use native file tools on `.md` / `.mdx`.";function GQ(e){return`${WQ} ${e}`}var KQ=`You're running in the terminal of the OpenKnowledge desktop app.`,qQ=`You're an agent working inside OpenKnowledge, with its MCP tools available to you.`;function JQ(e){return`${qQ} ${WQ} ${e===null?`Then stop.`:`Read \`${HQ(e)}\` via the OpenKnowledge MCP server, then stop.`}`}function YQ(e){return`${KQ} ${WQ} ${e===null?`Then stop.`:`Read \`${HQ(e)}\` via the OpenKnowledge MCP server, then stop.`}`}function XQ(e,t,n,r=`url`){let i=`Let's work on \`${HQ(e)}\` using OpenKnowledge.`;return y$(t?`${i} Open the OK editor in web view.`:i,n,r)}function ZQ(e,t,n){let r=`Use your open-knowledge-write-skill skill to author the ${t} Open Knowledge skill \`${HQ(e)}\`. Edit it with the Open Knowledge tools.`;return n?`${r} Open the OK editor in web view.`:r}function QQ(e,t,n,r=`url`){let i=`Let's work on the \`${HQ(e)}\` folder using OpenKnowledge.`;return y$(t?`${i} Open the OK editor in web view.`:i,n,r)}function $Q(e,t,n=`url`){let r=`Let's work on this project using OpenKnowledge.`;return y$(e?`${r} Open the OK editor in web view.`:r,t,n)}function e$(e,t,n,r,i=`url`){let a=t?`Open the OK editor in web view.`:``,o=e=>a===``?e:e.includes(`
466
466
  `)?[e,``,a].join(`
467
467
  `):`${e} ${a}`,s=e=>e.split(`
468
468
  `).map(e=>`> ${e}`).join(`
469
- `),c=M$(r),l=e=>{let t=e.trim();if(n===`existing-repo`){let e=t===``?`Let's work on this project using OpenKnowledge.`:[`Here's what I'd like to do in this OpenKnowledge project:`,``,s(t)].join(`
469
+ `),c=j$(r),l=e=>{let t=e.trim();if(n===`existing-repo`){let e=t===``?`Let's work on this project using OpenKnowledge.`:[`Here's what I'd like to do in this OpenKnowledge project:`,``,s(t)].join(`
470
470
  `);return o(c===``?e:[e,``,c].join(`
471
471
  `))}let r=`Scaffold the folders, templates, and AI-readable rules to match, using OpenKnowledge.`;return o(t===``?c===``?`Let's set up a new OpenKnowledge project. ${r}`:[`Let's set up a new OpenKnowledge project. ${r}`,``,c].join(`
472
472
  `):[`I'm setting up a new OpenKnowledge project. Here's what I want to create:`,``,s(t),...c===``?[]:[``,c],``,r].join(`
473
- `))};return l(v$(l,e.trim(),`cursor`,i,r$))}var n$=3072,r$=n$-m$(`${GQ} `,`cursor`),i$=100*1024-1024,a$=new TextEncoder;function o$(e,t,n){return n===`terminal`?a$.encode(kQ(e)).length:m$(e,t)}function s$(e,t){return e===`terminal`?i$:t}var c$=160,l$=3,u$=` …`;function d$(e){let t=0,n=0;for(let r of e)r==="`"?(n+=1,n>t&&(t=n)):n=0;return t}function f$(e){return"`".repeat(Math.max(d$(e)+1,l$))}function p$(e){let t=e.trimStart(),n=t.indexOf(`
474
- `),r=n===-1?t:t.slice(0,n);return Array.from(r).slice(0,c$).join(``).trimEnd()}function m$(e,t){let n=encodeURIComponent(e);return t===`cursor`?encodeURIComponent(n).length:n.length}function h$(e){return`Let's work on the selected passage in @${e} using OpenKnowledge.`}function g$(e){let t=e.trim();return t===``?[]:[`Instruction:`,``,t.split(`
473
+ `))};return l(_$(l,e.trim(),`cursor`,i,n$))}var t$=3072,n$=t$-p$(`${WQ} `,`cursor`),r$=100*1024-1024,i$=new TextEncoder;function a$(e,t,n){return n===`terminal`?i$.encode(OQ(e)).length:p$(e,t)}function o$(e,t){return e===`terminal`?r$:t}var s$=160,c$=3,l$=` …`;function u$(e){let t=0,n=0;for(let r of e)r==="`"?(n+=1,n>t&&(t=n)):n=0;return t}function d$(e){return"`".repeat(Math.max(u$(e)+1,c$))}function f$(e){let t=e.trimStart(),n=t.indexOf(`
474
+ `),r=n===-1?t:t.slice(0,n);return Array.from(r).slice(0,s$).join(``).trimEnd()}function p$(e,t){let n=encodeURIComponent(e);return t===`cursor`?encodeURIComponent(n).length:n.length}function m$(e){return`Let's work on the selected passage in @${e} using OpenKnowledge.`}function h$(e){let t=e.trim();return t===``?[]:[`Instruction:`,``,t.split(`
475
475
  `).map(e=>`> ${e}`).join(`
476
- `),``]}function _$(e,t){let n=g$(t);return n.length===0?e:[e,``,...n].join(`
477
- `).trimEnd()}function v$(e,t,n,r=`url`,i=n$){let a=s$(r,i),o=t=>o$(e(t),n,r)<=a;if(o(t))return t;let s=Array.from(t),c=0,l=s.length;for(;c<l;){let e=Math.ceil((c+l)/2);o(s.slice(0,e).join(``).trimEnd()+u$)?c=e:l=e-1}let u=s.slice(0,c).join(``).trimEnd();return u===``?``:u+u$}function y$(e,t,n){return v$(t=>_$(e,t),t,`cursor`,n,r$)}function b$(e,t,n){return _$(e,y$(e,t??``,n))}function x$(e,t,n){let r=f$(n);return[h$(e),``,...g$(t),`Here is the passage:`,``,r,n,r].join(`
478
- `)}function S$(e,t,n){let r=p$(n),i=f$(r);return[h$(e),``,...g$(t),`The passage begins:`,``,i,r,i,``,`Read the full passage from @${e} via the OpenKnowledge MCP server before editing.`].join(`
479
- `)}function C$(e,t,n,r=`url`){return v$(n,e,t,r)}function w$(e){let t=WQ(e.relativePath),n=e.transport??`url`,r=x$(t,e.instruction,e.selectionMarkdown);return o$(r,e.target,n)<=s$(n,n$)?r:S$(t,C$(e.instruction,e.target,n=>S$(t,n,e.selectionMarkdown),n),e.selectionMarkdown)}function T$(e,t,n){let r=`Let's work on @${e} using OpenKnowledge.`,i=n?`Open the OK editor in web view.`:``,a=t.trim();if(a===``)return i===``?r:`${r} ${i}`;let o=[r,``,a.split(`
476
+ `),``]}function g$(e,t){let n=h$(t);return n.length===0?e:[e,``,...n].join(`
477
+ `).trimEnd()}function _$(e,t,n,r=`url`,i=t$){let a=o$(r,i),o=t=>a$(e(t),n,r)<=a;if(o(t))return t;let s=Array.from(t),c=0,l=s.length;for(;c<l;){let e=Math.ceil((c+l)/2);o(s.slice(0,e).join(``).trimEnd()+l$)?c=e:l=e-1}let u=s.slice(0,c).join(``).trimEnd();return u===``?``:u+l$}function v$(e,t,n){return _$(t=>g$(e,t),t,`cursor`,n,n$)}function y$(e,t,n){return g$(e,v$(e,t??``,n))}function b$(e,t,n){let r=d$(n);return[m$(e),``,...h$(t),`Here is the passage:`,``,r,n,r].join(`
478
+ `)}function x$(e,t,n){let r=f$(n),i=d$(r);return[m$(e),``,...h$(t),`The passage begins:`,``,i,r,i,``,`Read the full passage from @${e} via the OpenKnowledge MCP server before editing.`].join(`
479
+ `)}function S$(e,t,n,r=`url`){return _$(n,e,t,r)}function C$(e){let t=UQ(e.relativePath),n=e.transport??`url`,r=b$(t,e.instruction,e.selectionMarkdown);return a$(r,e.target,n)<=o$(n,t$)?r:x$(t,S$(e.instruction,e.target,n=>x$(t,n,e.selectionMarkdown),n),e.selectionMarkdown)}function w$(e,t,n){let r=`Let's work on @${e} using OpenKnowledge.`,i=n?`Open the OK editor in web view.`:``,a=t.trim();if(a===``)return i===``?r:`${r} ${i}`;let o=[r,``,a.split(`
480
480
  `).map(e=>`> ${e}`).join(`
481
481
  `)];return i!==``&&o.push(``,i),o.join(`
482
- `)}function E$(e,t,n,r,i=`url`){let a=WQ(e);return T$(a,C$(t,r,e=>T$(a,e,n),i),n)}var D$=`Open the OK editor in web view.`;function O$(e){return e.split(`
482
+ `)}function T$(e,t,n,r,i=`url`){let a=UQ(e);return w$(a,S$(t,r,e=>w$(a,e,n),i),n)}var E$=`Open the OK editor in web view.`;function D$(e){return e.split(`
483
483
  `).map(e=>`> ${e}`).join(`
484
- `)}function k$(e){let t=f$(e);return[`Here is the passage:`,``,t,e,t].join(`
485
- `)}function A$(e,t){let n=p$(e),r=f$(n);return[`The passage begins:`,``,r,n,r,``,`Read the full passage from @${t} via the OpenKnowledge MCP server before editing.`].join(`
486
- `)}function j$(e,t,n){return`The selected passage is ${e===t?`line ${e}`:`lines ${e}-${t}`} of @${n}. Read it from @${n} via the OpenKnowledge MCP server before editing.`}function M$(e){let t=e.map(e=>WQ(e)).filter(e=>e!==``);return t.length===0?``:[`Also reference:`,``,...t.map(e=>`@${e}`)].join(`
487
- `)}function N$(e){return e.scope===`doc`?`Let's work on @${WQ(e.docRelativePath)} using OpenKnowledge.`:e.scope===`folder`?`Let's work on the @${WQ(e.folderRelativePath)} folder using OpenKnowledge.`:`Let's work on this project using OpenKnowledge.`}function P$(e,t,n,r,i){let a=t.trim();if(!(a!==``||n!==``||r!==``))return i===``?e:`${e} ${i}`;let o=[e];return a!==``&&o.push(O$(a)),n!==``&&o.push(n),r!==``&&o.push(r),i!==``&&o.push(i),o.join(`
488
-
489
- `)}function F$(e,t,n,r,i,a,o){if(e.kind===`lines`)return j$(e.startLine,e.endLine,n);if(e.kind===`anchor`)return A$(e.markdown,n);let s=k$(e.markdown);return o$(P$(t,``,s,r,i),a,o)<=s$(o,n$)?s:A$(e.markdown,n)}function I$(e,t,n,r){let{target:i}=e,a=e.transport??`url`,o=WQ(e.docRelativePath),s=`Let's work on @${o} using OpenKnowledge.`,c=F$(t,s,o,n,r,i,a);return P$(s,C$(e.instruction,i,e=>P$(s,e,c,n,r),a),c,n,r)}function L$(e){let{target:t}=e,n=e.autoOpen?D$:``,r=M$(e.mentions);if(e.scope===`doc`&&e.selection!==void 0)return I$(e,e.selection,r,n);let i=N$(e);return P$(i,C$(e.instruction,t,e=>P$(i,e,``,r,n),e.transport??`url`),``,r,n)}function R$(e){let t=WQ(e.relativePath),n=e.ruleAlias===void 0?`${e.source}/${e.code}`:`${e.source}/${e.code} (${e.ruleAlias})`,r=[`Fix this lint problem in @${t} using OpenKnowledge.`,``,`Problem: ${n} at line ${e.line}, column ${e.column}:`,``,O$(e.message.trim())],i=e.lineText??``;if(i.trim()!==``){let t=f$(i);r.push(``,`Line ${e.line} reads:`,``,t,i,t)}return r.push(``,`Edit @${t} via the OpenKnowledge MCP server, then re-lint it to confirm the problem is resolved.`),r.join(`
490
- `)}function z$(e){if(e.length===0)return{ok:!1,reason:`docName must not be empty`};if(e.trim().length===0)return{ok:!1,reason:`docName must not be blank (whitespace only)`};if(e!==e.trim())return{ok:!1,reason:`docName must not have leading or trailing whitespace`};for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<32||n===127)return{ok:!1,reason:`docName must not contain control characters`}}if(e.includes(`..`)||e.startsWith(`/`)||e.includes(`\\`))return{ok:!1,reason:`docName must not contain "..", a leading "/", or a backslash`};for(let t of e.split(`/`)){if(t.length===0)return{ok:!1,reason:`docName must not contain empty path segments (no leading, trailing, or doubled "/")`};if(t.startsWith(`.`))return{ok:!1,reason:`docName path segments must not start with "." (hidden files are not addressable)`}}return{ok:!0}}var B$=new Set([`opencode.json`]);function V$(e){return e.split(`/`).some(e=>e.startsWith(`.`))?!0:B$.has(e.slice(e.lastIndexOf(`/`)+1))}function H$(e,t){let n=z$(e);n.ok||t.addIssue({code:`custom`,message:n.reason})}var U$=P().superRefine(H$).optional(),W$=P().superRefine(H$),G$={agentId:P().optional(),agentName:P().optional(),colorSeed:P().optional(),clientName:P().optional(),clientVersion:P().optional(),label:P().optional()},K$=P().optional(),q$=/^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;Ao(`kind`,[R({kind:B(`doc`),docPath:P().min(1)}).loose(),R({kind:B(`folder`),folderPath:P()}).loose()]);var J$=z([`no-remote`,`detached-head`,`branch-not-on-origin`,`non-github-remote`,`invalid-path`]),Y$=z([`current`,`stale`,`absent`,`empty`]),X$=Ao(`ok`,[R({ok:B(!0),shareUrl:P().min(1),sharedUrl:P().min(1),branch:P().min(1),freshness:Y$.optional().catch(void 0)}).loose(),R({ok:B(!1),error:J$,branch:P().min(1).optional()}).loose()]),Z$=z([`user`,`org`]),Q$=R({login:P().min(1),kind:Z$,avatarUrl:P().optional()}).loose(),$$=z([`auth-required`,`network`]),e1=Ao(`ok`,[R({ok:B(!0),owners:L(Q$)}).loose(),R({ok:B(!1),error:$$}).loose()]),t1=Ao(`ok`,[R({ok:B(!0),available:I()}).loose(),R({ok:B(!1),error:$$}).loose()]),n1=z([`public`,`private`]);R({owner:P().min(1),name:P().min(1),visibility:n1,description:P().optional()}).loose();var r1=z([`name-conflict`,`saml-sso`,`auth-required`,`push-failed`,`init-failed`,`network`,`no-project`]),i1=Ao(`ok`,[R({ok:B(!0),ownerLogin:P().min(1),repoName:P().min(1),cloneUrl:P().min(1),defaultBranch:P().min(1)}).loose(),R({ok:B(!1),error:r1}).loose()]);function a1(e){return!(typeof e!=`string`||e.length===0||e.startsWith(`-`)||/[\x00-\x1F\x7F]/.test(e)||/\s/.test(e)||e.includes(`:`)||e.split(`/`).includes(`..`))}var o1=e=>e.refine(a1,`invalid branch name`),s1={shareTargetExists:I(),dirtyConflicts:R({conflicts:I(),files:L(P().min(1))}).loose(),branchIsLocal:I(),shareTargetOnOriginBranch:I().optional()};Ao(`detached`,[R({detached:B(!1),currentBranch:P().min(1).nullable(),currentHeadSha:yo(),...s1}).loose(),R({detached:B(!0),currentBranch:yo(),currentHeadSha:P().min(1),...s1}).loose()]),R({branch:o1(P().min(1)),principalId:P().optional(),fastForward:I().optional()}).loose();var c1=z([`dirty-conflict`,`branch-not-found`,`fetch-failed`,`checkout-failed`,`branch-in-other-worktree`,`ff-diverged`]);Ao(`ok`,[R({ok:B(!0)}).loose(),R({ok:B(!1),reason:c1,files:L(P().min(1)).optional(),otherWorktreePath:P().min(1).optional()}).loose()]),z([`on-origin`,`renamed`,`deleted`,`never-on-branch`,`changed-locally`,`unknown`]),R({branch:o1(P().min(1)),path:P(),kind:z([`doc`,`folder`])}).loose(),Ao(`verdict`,[R({verdict:B(`on-origin`)}).loose(),R({verdict:B(`renamed`),renamedTo:P().min(1)}).loose(),R({verdict:B(`deleted`)}).loose(),R({verdict:B(`never-on-branch`)}).loose(),R({verdict:B(`changed-locally`)}).loose(),R({verdict:B(`unknown`)}).loose()]).catch({verdict:`unknown`});var l1=R({startedAt:P().min(1),httpListenMs:F().nonnegative().optional(),seedWalkMs:F().nonnegative().optional(),indexesMs:F().nonnegative().optional(),readyMs:F().nonnegative().optional(),fileCount:F().nonnegative().optional()}),u1=R({serverInstanceId:P().min(1),currentBranch:P().min(1).optional(),currentDiskAckSVs:Po(P().min(1),P().min(1)).optional(),boot:l1.optional()}).loose(),d1=R({id:P().min(1),display_name:P().min(1),display_email:P(),source:z([`git-config`,`synthesized`]),created_at:P().min(1)}).loose();R({collabUrl:P().nullable(),previewUrl:P().nullable(),port:F(),singleFile:I().default(!1)}).loose();var f1=z(`urn:ok:error:malformed-upload.urn:ok:error:collision-exhaustion.urn:ok:error:storage-full.urn:ok:error:storage-readonly.urn:ok:error:storage-error.urn:ok:error:no-file-received.urn:ok:error:path-escape.urn:ok:error:method-not-allowed.urn:ok:error:invalid-request.urn:ok:error:payload-too-large.urn:ok:error:request-timeout.urn:ok:error:internal-server-error.urn:ok:error:loopback-required.urn:ok:error:invalid-origin.urn:ok:error:url-not-allowed.urn:ok:error:dir-outside-home.urn:ok:error:concurrent-operation.urn:ok:error:clone-failed.urn:ok:error:clone-timeout.urn:ok:error:server-start-failed.urn:ok:error:reserved-doc-name.urn:ok:error:target-not-found.urn:ok:error:stale-target.urn:ok:error:frontmatter-edit-not-supported.urn:ok:error:invalid-frontmatter-patch.urn:ok:error:frontmatter-malformed.urn:ok:error:no-active-session.urn:ok:error:too-many-agent-sessions.urn:ok:error:disk-divergence.urn:ok:error:doc-not-found.urn:ok:error:doc-already-exists.urn:ok:error:doc-not-open.urn:ok:error:rollback-not-configured.urn:ok:error:doc-not-available.urn:ok:error:backlink-index-not-configured.urn:ok:error:file-rescan-not-configured.urn:ok:error:shadow-not-configured.urn:ok:error:host-not-allowed.urn:ok:error:principal-not-available.urn:ok:error:not-found.urn:ok:error:auth-failed.urn:ok:error:no-project-dir.urn:ok:error:server-open-failed.urn:ok:error:doc-in-conflict.urn:ok:error:no-conflict-tracked.urn:ok:error:sync-not-active.urn:ok:error:project-repo-not-configured.urn:ok:error:seed-prerequisite-missing.urn:ok:error:seed-invalid-root.urn:ok:error:tag-index-not-configured.urn:ok:error:template-not-found.urn:ok:error:unsupported-asset-type.urn:ok:error:asset-not-found.urn:ok:error:single-file-mode.urn:ok:error:collab-server-not-running.urn:ok:error:gateway-timeout.urn:ok:error:cursor-not-installed.urn:ok:error:cursor-spawn-timeout.urn:ok:error:cursor-spawn-failed.urn:ok:error:handoff-target-not-installed.urn:ok:error:handoff-spawn-timeout.urn:ok:error:handoff-spawn-failed.urn:ok:error:registry-unreachable.urn:ok:error:config-not-writable`.split(`.`)),p1=R({type:f1,title:P().min(1),status:F().int().min(400).max(599),instance:P().regex(q$,`instance must be urn:uuid:<uuid>`).optional(),detail:P().optional()}).loose();R({parentDocName:P().min(1),placement:z([`configured-attachments`,`parent-dir`]).default(`configured-attachments`),agentId:P().min(1).optional(),agentName:P().min(1).optional()}).loose();var m1=R({src:P().min(1),path:P().min(1).optional(),deduped:I().optional()}).loose();R({url:P().min(1),dir:P().min(1),branch:P().min(1).refine(a1,`invalid branch name`).optional()}).loose(),R({type:B(`error`),problem:p1}).loose();function h1(e){return e.includes("`")?`~`:"`"}function g1(e,t,n=3){let r=RegExp(`^ {0,3}(\\${e}+)[ \\t]*$`),i=Math.max(3,n);for(let e of t.split(`
491
- `)){let t=r.exec(e);t&&t[1].length>=i&&(i=t[1].length+1)}return i}var _1=/notionvc:/i,v1=()=>e=>{y1(e)&&(b1(e),x1(e))};function y1(e){if(!(`children`in e)||!Array.isArray(e.children))return!1;for(let t of e.children){if(t.type===`comment`){let e=String(t.value??``);if(_1.test(e))return!0}if(t.type===`element`&&y1(t))return!0}return!1}function b1(e){if(!(`children`in e)||!Array.isArray(e.children))return;for(let t of e.children)t.type===`element`&&b1(t);let t=[];for(let n of e.children){if(n.type!==`text`){t.push(n);continue}let e=String(n.value??``);if(!e.includes(`
484
+ `)}function O$(e){let t=d$(e);return[`Here is the passage:`,``,t,e,t].join(`
485
+ `)}function k$(e,t){let n=f$(e),r=d$(n);return[`The passage begins:`,``,r,n,r,``,`Read the full passage from @${t} via the OpenKnowledge MCP server before editing.`].join(`
486
+ `)}function A$(e,t,n){return`The selected passage is ${e===t?`line ${e}`:`lines ${e}-${t}`} of @${n}. Read it from @${n} via the OpenKnowledge MCP server before editing.`}function j$(e){let t=e.map(e=>UQ(e)).filter(e=>e!==``);return t.length===0?``:[`Also reference:`,``,...t.map(e=>`@${e}`)].join(`
487
+ `)}function M$(e){return e.scope===`doc`?`Let's work on @${UQ(e.docRelativePath)} using OpenKnowledge.`:e.scope===`folder`?`Let's work on the @${UQ(e.folderRelativePath)} folder using OpenKnowledge.`:`Let's work on this project using OpenKnowledge.`}function N$(e,t,n,r,i){let a=t.trim();if(!(a!==``||n!==``||r!==``))return i===``?e:`${e} ${i}`;let o=[e];return a!==``&&o.push(D$(a)),n!==``&&o.push(n),r!==``&&o.push(r),i!==``&&o.push(i),o.join(`
488
+
489
+ `)}function P$(e,t,n,r,i,a,o){if(e.kind===`lines`)return A$(e.startLine,e.endLine,n);if(e.kind===`anchor`)return k$(e.markdown,n);let s=O$(e.markdown);return a$(N$(t,``,s,r,i),a,o)<=o$(o,t$)?s:k$(e.markdown,n)}function F$(e,t,n,r){let{target:i}=e,a=e.transport??`url`,o=UQ(e.docRelativePath),s=`Let's work on @${o} using OpenKnowledge.`,c=P$(t,s,o,n,r,i,a);return N$(s,S$(e.instruction,i,e=>N$(s,e,c,n,r),a),c,n,r)}function I$(e){let{target:t}=e,n=e.autoOpen?E$:``,r=j$(e.mentions);if(e.scope===`doc`&&e.selection!==void 0)return F$(e,e.selection,r,n);let i=M$(e);return N$(i,S$(e.instruction,t,e=>N$(i,e,``,r,n),e.transport??`url`),``,r,n)}function L$(e){let t=UQ(e.relativePath),n=e.ruleAlias===void 0?`${e.source}/${e.code}`:`${e.source}/${e.code} (${e.ruleAlias})`,r=[`Fix this lint problem in @${t} using OpenKnowledge.`,``,`Problem: ${n} at line ${e.line}, column ${e.column}:`,``,D$(e.message.trim())],i=e.lineText??``;if(i.trim()!==``){let t=d$(i);r.push(``,`Line ${e.line} reads:`,``,t,i,t)}return r.push(``,`Edit @${t} via the OpenKnowledge MCP server, then re-lint it to confirm the problem is resolved.`),r.join(`
490
+ `)}function R$(e){if(e.length===0)return{ok:!1,reason:`docName must not be empty`};if(e.trim().length===0)return{ok:!1,reason:`docName must not be blank (whitespace only)`};if(e!==e.trim())return{ok:!1,reason:`docName must not have leading or trailing whitespace`};for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<32||n===127)return{ok:!1,reason:`docName must not contain control characters`}}if(e.includes(`..`)||e.startsWith(`/`)||e.includes(`\\`))return{ok:!1,reason:`docName must not contain "..", a leading "/", or a backslash`};for(let t of e.split(`/`)){if(t.length===0)return{ok:!1,reason:`docName must not contain empty path segments (no leading, trailing, or doubled "/")`};if(t.startsWith(`.`))return{ok:!1,reason:`docName path segments must not start with "." (hidden files are not addressable)`}}return{ok:!0}}var z$=new Set([`opencode.json`]);function B$(e){return e.split(`/`).some(e=>e.startsWith(`.`))?!0:z$.has(e.slice(e.lastIndexOf(`/`)+1))}function V$(e,t){let n=R$(e);n.ok||t.addIssue({code:`custom`,message:n.reason})}var H$=P().superRefine(V$).optional(),U$=P().superRefine(V$),W$={agentId:P().optional(),agentName:P().optional(),colorSeed:P().optional(),clientName:P().optional(),clientVersion:P().optional(),label:P().optional()},G$=P().optional(),K$=/^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;Ao(`kind`,[R({kind:B(`doc`),docPath:P().min(1)}).loose(),R({kind:B(`folder`),folderPath:P()}).loose()]);var q$=z([`no-remote`,`detached-head`,`branch-not-on-origin`,`non-github-remote`,`invalid-path`]),J$=z([`current`,`stale`,`absent`,`empty`]),Y$=Ao(`ok`,[R({ok:B(!0),shareUrl:P().min(1),sharedUrl:P().min(1),branch:P().min(1),freshness:J$.optional().catch(void 0)}).loose(),R({ok:B(!1),error:q$,branch:P().min(1).optional()}).loose()]),X$=z([`user`,`org`]),Z$=R({login:P().min(1),kind:X$,avatarUrl:P().optional()}).loose(),Q$=z([`auth-required`,`network`]),$$=Ao(`ok`,[R({ok:B(!0),owners:L(Z$)}).loose(),R({ok:B(!1),error:Q$}).loose()]),e1=Ao(`ok`,[R({ok:B(!0),available:I()}).loose(),R({ok:B(!1),error:Q$}).loose()]),t1=z([`public`,`private`]);R({owner:P().min(1),name:P().min(1),visibility:t1,description:P().optional()}).loose();var n1=z([`name-conflict`,`saml-sso`,`auth-required`,`push-failed`,`init-failed`,`network`,`no-project`]),r1=Ao(`ok`,[R({ok:B(!0),ownerLogin:P().min(1),repoName:P().min(1),cloneUrl:P().min(1),defaultBranch:P().min(1)}).loose(),R({ok:B(!1),error:n1}).loose()]);function i1(e){return!(typeof e!=`string`||e.length===0||e.startsWith(`-`)||/[\x00-\x1F\x7F]/.test(e)||/\s/.test(e)||e.includes(`:`)||e.split(`/`).includes(`..`))}var a1=e=>e.refine(i1,`invalid branch name`),o1={shareTargetExists:I(),dirtyConflicts:R({conflicts:I(),files:L(P().min(1))}).loose(),branchIsLocal:I(),shareTargetOnOriginBranch:I().optional()};Ao(`detached`,[R({detached:B(!1),currentBranch:P().min(1).nullable(),currentHeadSha:yo(),...o1}).loose(),R({detached:B(!0),currentBranch:yo(),currentHeadSha:P().min(1),...o1}).loose()]),R({branch:a1(P().min(1)),principalId:P().optional(),fastForward:I().optional()}).loose();var s1=z([`dirty-conflict`,`branch-not-found`,`fetch-failed`,`checkout-failed`,`branch-in-other-worktree`,`ff-diverged`]);Ao(`ok`,[R({ok:B(!0)}).loose(),R({ok:B(!1),reason:s1,files:L(P().min(1)).optional(),otherWorktreePath:P().min(1).optional()}).loose()]),z([`on-origin`,`renamed`,`deleted`,`never-on-branch`,`changed-locally`,`unknown`]),R({branch:a1(P().min(1)),path:P(),kind:z([`doc`,`folder`])}).loose(),Ao(`verdict`,[R({verdict:B(`on-origin`)}).loose(),R({verdict:B(`renamed`),renamedTo:P().min(1)}).loose(),R({verdict:B(`deleted`)}).loose(),R({verdict:B(`never-on-branch`)}).loose(),R({verdict:B(`changed-locally`)}).loose(),R({verdict:B(`unknown`)}).loose()]).catch({verdict:`unknown`});var c1=R({startedAt:P().min(1),httpListenMs:F().nonnegative().optional(),seedWalkMs:F().nonnegative().optional(),indexesMs:F().nonnegative().optional(),readyMs:F().nonnegative().optional(),fileCount:F().nonnegative().optional()}),l1=R({serverInstanceId:P().min(1),currentBranch:P().min(1).optional(),currentDiskAckSVs:Po(P().min(1),P().min(1)).optional(),boot:c1.optional()}).loose(),u1=R({id:P().min(1),display_name:P().min(1),display_email:P(),source:z([`git-config`,`synthesized`]),created_at:P().min(1)}).loose();R({collabUrl:P().nullable(),previewUrl:P().nullable(),port:F(),singleFile:I().default(!1)}).loose();var d1=z(`urn:ok:error:malformed-upload.urn:ok:error:collision-exhaustion.urn:ok:error:storage-full.urn:ok:error:storage-readonly.urn:ok:error:storage-error.urn:ok:error:no-file-received.urn:ok:error:path-escape.urn:ok:error:method-not-allowed.urn:ok:error:invalid-request.urn:ok:error:payload-too-large.urn:ok:error:request-timeout.urn:ok:error:internal-server-error.urn:ok:error:loopback-required.urn:ok:error:invalid-origin.urn:ok:error:url-not-allowed.urn:ok:error:dir-outside-home.urn:ok:error:concurrent-operation.urn:ok:error:clone-failed.urn:ok:error:clone-timeout.urn:ok:error:server-start-failed.urn:ok:error:reserved-doc-name.urn:ok:error:target-not-found.urn:ok:error:stale-target.urn:ok:error:frontmatter-edit-not-supported.urn:ok:error:invalid-frontmatter-patch.urn:ok:error:frontmatter-malformed.urn:ok:error:no-active-session.urn:ok:error:too-many-agent-sessions.urn:ok:error:disk-divergence.urn:ok:error:doc-not-found.urn:ok:error:doc-already-exists.urn:ok:error:doc-not-open.urn:ok:error:rollback-not-configured.urn:ok:error:doc-not-available.urn:ok:error:backlink-index-not-configured.urn:ok:error:file-rescan-not-configured.urn:ok:error:shadow-not-configured.urn:ok:error:host-not-allowed.urn:ok:error:principal-not-available.urn:ok:error:not-found.urn:ok:error:auth-failed.urn:ok:error:no-project-dir.urn:ok:error:server-open-failed.urn:ok:error:doc-in-conflict.urn:ok:error:no-conflict-tracked.urn:ok:error:sync-not-active.urn:ok:error:project-repo-not-configured.urn:ok:error:seed-prerequisite-missing.urn:ok:error:seed-invalid-root.urn:ok:error:tag-index-not-configured.urn:ok:error:template-not-found.urn:ok:error:unsupported-asset-type.urn:ok:error:asset-not-found.urn:ok:error:single-file-mode.urn:ok:error:collab-server-not-running.urn:ok:error:gateway-timeout.urn:ok:error:cursor-not-installed.urn:ok:error:cursor-spawn-timeout.urn:ok:error:cursor-spawn-failed.urn:ok:error:handoff-target-not-installed.urn:ok:error:handoff-spawn-timeout.urn:ok:error:handoff-spawn-failed.urn:ok:error:registry-unreachable.urn:ok:error:config-not-writable`.split(`.`)),f1=R({type:d1,title:P().min(1),status:F().int().min(400).max(599),instance:P().regex(K$,`instance must be urn:uuid:<uuid>`).optional(),detail:P().optional()}).loose();R({parentDocName:P().min(1),placement:z([`configured-attachments`,`parent-dir`]).default(`configured-attachments`),agentId:P().min(1).optional(),agentName:P().min(1).optional()}).loose();var p1=R({src:P().min(1),path:P().min(1).optional(),deduped:I().optional()}).loose();R({url:P().min(1),dir:P().min(1),branch:P().min(1).refine(i1,`invalid branch name`).optional()}).loose(),R({type:B(`error`),problem:f1}).loose();function m1(e){return e.includes("`")?`~`:"`"}function h1(e,t,n=3){let r=RegExp(`^ {0,3}(\\${e}+)[ \\t]*$`),i=Math.max(3,n);for(let e of t.split(`
491
+ `)){let t=r.exec(e);t&&t[1].length>=i&&(i=t[1].length+1)}return i}var g1=/notionvc:/i,_1=()=>e=>{v1(e)&&(y1(e),b1(e))};function v1(e){if(!(`children`in e)||!Array.isArray(e.children))return!1;for(let t of e.children){if(t.type===`comment`){let e=String(t.value??``);if(g1.test(e))return!0}if(t.type===`element`&&v1(t))return!0}return!1}function y1(e){if(!(`children`in e)||!Array.isArray(e.children))return;for(let t of e.children)t.type===`element`&&y1(t);let t=[];for(let n of e.children){if(n.type!==`text`){t.push(n);continue}let e=String(n.value??``);if(!e.includes(`
492
492
  `)){t.push(n);continue}let r=e.split(`
493
- `);for(let e=0;e<r.length;e++)r[e]&&t.push({type:`text`,value:r[e]??``}),e<r.length-1&&t.push({type:`element`,tagName:`br`,properties:{},children:[]})}e.children=t}function x1(e){if(!(!(`children`in e)||!Array.isArray(e.children))){e.children=e.children.filter(e=>e.type===`comment`?!_1.test(String(e.value??``)):!0);for(let t of e.children)t.type===`element`&&x1(t)}}var S1=new Set([`Apple-tab-span`,`Apple-converted-space`,`Apple-style-span`]),C1=()=>e=>{w1(e)};function w1(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&w1(t);e.children=e.children.flatMap(e=>{if(e.type!==`element`)return[e];let t=e;return T1(t)?[]:E1(t)?t.children:[t]})}}function T1(e){if(e.tagName!==`meta`)return!1;let t=e.properties?.name,n=e.properties?.content;return t===`Generator`&&typeof n==`string`&&/Cocoa/i.test(n)}function E1(e){if(e.tagName!==`span`)return!1;let t=e.properties?.className;return Array.isArray(t)?t.length>0&&t.every(e=>S1.has(String(e))):!1}var D1=`docs-internal-guid-`;function O1(e,t){let n=e.children[t];!n||n.type!==`element`||e.children.splice(t,1,...n.children)}var k1=()=>e=>{A1(e)};function A1(e){if(!(`children`in e)||!Array.isArray(e.children))return;for(let t of e.children)t.type===`element`&&A1(t);let t=0;for(;t<e.children.length;){let n=e.children[t];if(!n||n.type!==`element`){t++;continue}let r=n;if(j1(r)||M1(r)){O1(e,t);continue}t++}}function j1(e){if(e.tagName!==`b`)return!1;let t=e.properties?.id;return typeof t==`string`&&t.startsWith(D1)}function M1(e){if(e.tagName!==`div`||e.properties?.dir!==`ltr`)return!1;let t=e.children.filter(e=>e.type===`element`);return t.length===1?t[0]?.tagName===`table`:!1}var N1=new Set([`commit-link`,`user-mention`,`team-mention`,`issue-link`]),P1=()=>e=>{F1(e)};function F1(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&F1(t);for(let t of e.children)t.type===`element`&&I1(t)}}function I1(e){if(!e.properties)return;for(let t of Object.keys(e.properties))t.startsWith(`dataHovercard`)&&delete e.properties[t];let t=e.properties.className;if(Array.isArray(t)){let n=t.filter(e=>!N1.has(String(e)));n.length===0?delete e.properties.className:e.properties.className=n}}var L1=/^gmail_/,R1=()=>e=>{z1(e)};function z1(e){if(!(`children`in e)||!Array.isArray(e.children))return;for(let t of e.children)t.type===`element`&&z1(t);let t=0;for(;t<e.children.length;){let n=e.children[t];if(n.type!==`element`){t++;continue}let r=n;if(r.tagName===`div`&&B1(r,`gmail_quote`)&&(r.tagName=`blockquote`),V1(r),H1(r)){e.children.splice(t,1,...r.children);continue}t++}}function B1(e,t){let n=e.properties?.className;return Array.isArray(n)?n.some(e=>String(e)===t):!1}function V1(e){let t=e.properties?.className;if(!Array.isArray(t))return;let n=t.filter(e=>!L1.test(String(e)));n.length===0?delete e.properties?.className:e.properties&&(e.properties.className=n)}function H1(e){if(e.tagName!==`div`||e.properties?.dir!==`ltr`)return!1;let t=e.properties?.className;return t!=null&&!(Array.isArray(t)&&t.length===0)?!1:e.children.filter(e=>e.type===`element`).length<=1}var U1=()=>e=>{W1(e)};function W1(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&W1(t);e.children=e.children.flatMap(e=>{if(e.type!==`element`)return[e];let t=e;return t.tagName===`google-sheets-html-origin`?t.children:t.tagName===`style`?[]:(G1(t),[t])})}}function G1(e){if(e.properties)for(let t of Object.keys(e.properties))t.startsWith(`dataSheets`)&&delete e.properties[t]}var K1=[`o:`,`w:`,`m:`,`v:`,`u1:`],q1=/^Mso[A-Z]/,J1=/^\s*\[if\s+[^\]]*\]/,Y1=()=>e=>{X1(e)};function X1(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&X1(t);e.children=e.children.flatMap(e=>{if(e.type===`comment`){let t=String(e.value??``);return J1.test(t)?[]:[e]}if(e.type!==`element`)return[e];let t=e;return Z1(t)?[]:(Q1(t),[t])})}}function Z1(e){return K1.some(t=>e.tagName.startsWith(t))}function Q1(e){let t=e.properties;if(!t)return;let n=t.className;if(Array.isArray(n)){let e=n.filter(e=>typeof e==`string`&&!q1.test(e));e.length===0?delete t.className:t.className=e}else typeof n==`string`&&q1.test(n)&&delete t.className;let r=t.style;typeof r==`string`&&/mso-/i.test(r)&&delete t.style;for(let e of Object.keys(t))if(e.startsWith(`xmlns:`)){let n=e.slice(6);K1.some(e=>e===`${n}:`)&&delete t[e]}}var $1=/^c-(message_kit__|message__|compose|timestamp)/,e0=()=>e=>{t0(e)};function t0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&t0(t);e.children=e.children.flatMap(e=>{if(e.type!==`element`)return[e];let t=e;return n0(t)?[]:(r0(t),[t])})}}function n0(e){let t=e.properties?.className;return Array.isArray(t)?t.some(e=>String(e)===`c-timestamp`||String(e).startsWith(`c-timestamp`)):!1}function r0(e){let t=e.properties?.className;if(!Array.isArray(t))return;let n=t.filter(e=>!$1.test(String(e)));n.length===0?delete e.properties?.className:e.properties&&(e.properties.className=n)}var i0=()=>e=>{a0(e)};function a0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&a0(t);for(let t=0;t<e.children.length;t++){let n=e.children[t];if(n.type!==`element`)continue;let r=n;o0(r)&&(e.children[t]=c0(r))}}}function o0(e){if(e.tagName!==`div`)return!1;let t=e.children.filter(e=>e.type===`element`&&e.tagName===`div`);return t.length<2?!1:t.some(e=>s0(e))}function s0(e){for(let t of e.children){if(t.type!==`element`)continue;let e=t,n=e.properties?.style;if(typeof n==`string`&&/color\s*:/i.test(n)||s0(e))return!0}return!1}function c0(e){return{type:`element`,tagName:`pre`,properties:{},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:e.children.filter(e=>e.type===`element`&&e.tagName===`div`).map(e=>l0(e)).join(`
494
- `)}]}]}}function l0(e){let t=``;for(let n of e.children)n.type===`text`?t+=n.value??``:n.type===`element`&&(t+=l0(n));return t}var u0=new Set([`break`,`delete`,`emphasis`,`footnoteReference`,`html`,`image`,`imageReference`,`inlineCode`,`link`,`linkReference`,`strong`,`text`]);function d0(e){let t=e.children;Array.isArray(t)&&t.forEach((e,n)=>{if(e.type===`break`){t[n]={type:`html`,value:`<br />`};return}d0(e)})}function f0(e){let t=e.children;if(Array.isArray(t))for(let e of t)(e.type===`inlineCode`||e.type===`html`)&&(e.value.includes(`
495
- `)&&(e.value=e.value.replace(/[ \t]*\n[ \t]*/g,` `)),e.type===`html`&&e.value.includes(`|`)&&(e.value=e.value.replace(/\|/g,`\\|`))),f0(e)}function p0(e){D(e,`tableCell`,e=>{e.children.some(e=>!u0.has(e.type))&&(e.children=m0(e.children)),d0(e),f0(e)})}function m0(e){let t=[],n=0,r=()=>{t.length>0&&(n+=1)},i=e=>{for(;n>0;)t.push({type:`break`}),--n;t.push(e)},a=e=>{e.split(`
496
- `).forEach((e,t)=>{t>0&&r(),e.length>0&&i({type:`text`,value:e})})},o=e=>{let t=e.ordered===!0,n=typeof e.start==`number`?e.start:1,a=e.data,o=typeof a?.bulletMarker==`string`?a.bulletMarker:`-`,c=typeof a?.listMarkerDelimiter==`string`?a.listMarkerDelimiter:`.`;e.children.forEach((e,a)=>{a>0&&r(),i({type:`text`,value:t?`${n+a}${c} `:`${o} `}),e.children.forEach((e,t)=>{t>0&&r(),s(e)})})},s=e=>{switch(e.type){case`paragraph`:case`heading`:e.children.forEach(i);return;case`list`:o(e);return;case`code`:case`html`:a(e.value);return;case`thematicBreak`:i({type:`text`,value:e.data?.sourceRaw??`---`});return;default:{let t=e;if(Array.isArray(t.children)&&t.children.length>0){t.children.forEach((e,t)=>{t>0&&r(),s(e)});return}let n=e;if(typeof n.value==`string`){a(n.value);return}console.warn(JSON.stringify({event:`table-cell-flatten-dropped-block`,nodeType:e.type}))}}};return e.forEach((e,t)=>{t>0&&r(),s(e)}),t}var h0=class extends Error{htmlBytes;maxBytes;constructor(e,t){super(`HTML payload (${e} bytes) exceeds htmlToMdast ceiling (${t} bytes); falling through to plain text`),this.name=`HtmlPayloadTooLargeError`,this.htmlBytes=e,this.maxBytes=t}},g0=[k1,Y1,C1,R1,v1,i0,U1,e0,P1];function _0(e){D(e,e=>{e.type===`strong`?(e.data??={},e.data.sourceDelimiter=`**`):e.type===`emphasis`?(e.data??={},e.data.sourceDelimiter=`*`):e.type===`inlineCode`?(e.data??={},e.data.sourceFenceChar="`",e.data.sourceFenceLength=1):e.type===`code`&&(e.data??={},e.data.sourceFenceChar="`",e.data.sourceFenceLength=3)})}function v0(e){D(e,`list`,e=>{for(let t of e.children){let e=t.children.filter(e=>e.type!==`list`).length;t.spread=t.spread===!0&&e>1}e.spread=e.children.some(e=>e.spread===!0)})}function y0(e,t){let n=t?.maxBytes??5242880;if(e.length>n)throw new h0(e.length,n);let r=le().use(Zte,{fragment:!0});for(let e of g0)r.use(e);for(let e of t?.additionalCleanupPlugins??[])r.use(e);r.use(YM);let i=r.parse(e),a=r.runSync(i);return v0(a),_0(a),a}function b0(e){return p0(e),String(le().use(ue).use(SN,{bullet:`-`,rule:`-`,fences:!0}).stringify(e))}function x0(e,t){let n=0;for(let r=0;r<t.length&&n<e.length;r++)e[n]===t[r]&&n++;return n===e.length}var S0=new Set([`sourceRaw`,`sourceDirty`,`position`]),C0=new Set([`jsxComponent`,`table`,`tableRow`,`tableCell`,`tableHeader`,`list`,`listItem`,`blockquote`,`codeBlock`,`heading`]),w0={type:`__br__`},T0=/^<br\s*\/?>$/i;function E0(e){let t=j0(e,E0);return(t.type===`tableCell`||t.type===`tableHeader`)&&t.content?{...t,content:D0(t.content)}:t}function D0(e){let t=[];for(let n of e){let e=O0(n);e.length!==0&&(t.length>0&&t.push(w0),t.push(...e))}return t}function O0(e){return e.text!==void 0||e.type===`hardBreak`||e.type===`jsxInline`?[e]:!e.content||e.content.length===0?[]:e.content.some(e=>e.text===void 0&&e.type!==`hardBreak`&&e.type!==`jsxInline`&&!!e.content)?D0(e.content):e.content}function k0(e){return e.type===`hardBreak`||e.type===w0.type||e.text!==void 0&&T0.test(e.text.trim())?w0:j0(e,k0)}var A0=[{label:`table-cell-block-flatten`,severity:`pm-model-caused`,rationale:`GFM table cells have no block spelling; a block placed in a cell is flattened to inline on serialize, so a cell-with-blocks and a cell-with-inline describe the same persisted document.`,proofPointer:`markdown/table-cell-flatten.ts flattenCellBlocks (table-cell-flatten-dropped-block event)`,canonicalize:E0},{label:`void-hardbreak-br`,severity:`serializer-caused`,rationale:`A void hardBreak inside a table cell or heading serializes to a literal <br /> that a fresh parse keeps as text; the node form and the literal form are the same break.`,proofPointer:`markdown/void-br-promoter.ts + markdown/to-markdown-handlers.ts break handler`,canonicalize:k0}];function j0(e,t){return e.content?{...e,content:e.content.map(t)}:e}function M0(e,t){let n={};e.type!==void 0&&(n.type=e.type),e.text!==void 0&&(n.text=e.text);let r=N0(e.attrs,t);return r&&(n.attrs=r),e.marks&&e.marks.length>0&&(n.marks=[...e.marks].map(e=>({type:e.type,attrs:N0(e.attrs,t)})).sort((e,t)=>F0(e).localeCompare(F0(t)))),e.content&&e.content.length>0&&(n.content=e.content.map(e=>M0(e,t))),n}function N0(e,t){if(!e)return null;let n={};for(let r of Object.keys(e).sort()){if(S0.has(r)||t?.(r))continue;let i=e[r];i!=null&&(n[r]=t?P0(i,t):i)}return Object.keys(n).length>0?n:null}function P0(e,t){if(Array.isArray(e))return e.map(e=>P0(e,t));if(e&&typeof e==`object`){let n={};for(let[r,i]of Object.entries(e))t(r)||(n[r]=P0(i,t));return n}return e}function F0(e){return JSON.stringify(e,(e,t)=>{if(t&&typeof t==`object`&&!Array.isArray(t)){let e={};for(let n of Object.keys(t).sort())e[n]=t[n];return e}return t})}function I0(e){let t=``,n=e=>{if(e.text!==void 0&&(t+=e.text),e.content)for(let t of e.content)n(t)};return n(e),t.replace(/\s+/g,``)}function L0(e){let t=[],n=e=>{if(e.type&&C0.has(e.type)){let n=e.type===`jsxComponent`?String(e.attrs?.componentName??``):``;t.push(n?`${e.type}:${n}`:e.type)}if(e.content)for(let t of e.content)n(t)};return n(e),t.sort()}function R0(e){let t=e,n=[];for(let e of A0){let r=F0(t),i=e.canonicalize(t);F0(i)!==r&&n.push(e.label),t=i}return{normalized:t,fired:n}}function z0(e,t,n={}){let r=R0(e),i=R0(t),a=[...new Set([...r.fired,...i.fired])];if(!x0(I0(r.normalized),I0(i.normalized)))return{equivalent:!1,level:`L1`,reason:`content-loss`,appliedDegrades:a,detail:`authored text did not survive the round-trip`};let o=L0(r.normalized),s=L0(i.normalized);if(F0(o)!==F0(s))return{equivalent:!1,level:`L1`,reason:`structural-shatter`,appliedDegrades:a,detail:`container multiset diverged: [${o.join(`, `)}] vs [${s.join(`, `)}]`};let c=M0(r.normalized,n.ignoreAttrs),l=M0(i.normalized,n.ignoreAttrs);return F0(c)===F0(l)?{equivalent:!0,level:a.length>0?`L2`:`L1`,appliedDegrades:a}:{equivalent:!1,level:`L2`,reason:`structural-divergence`,appliedDegrades:a,detail:B0(c,l)}}function B0(e,t,n=`doc`){let r=e,i=t;if(!r||!i)return`${n}: node presence differs`;if(r.type!==i.type)return`${n}: type ${String(r.type)} vs ${String(i.type)}`;let a=r.content??[],o=i.content??[];if(a.length!==o.length)return`${n}(${String(r.type)}): child count ${a.length} vs ${o.length}`;for(let e=0;e<a.length;e++)if(F0(a[e])!==F0(o[e]))return B0(a[e],o[e],`${n}>${String(r.type)}[${e}]`);return`${n}(${String(r.type)}): attrs or marks differ`}function V0(e,t,n){return!z0(e,t,{ignoreAttrs:n}).equivalent}var H0=new Set([`src`,`href`,`size`]),U0=new Set([`WikiEmbedImage`,`WikiEmbedVideo`,`WikiEmbedAudio`,`WikiEmbedFile`]);function W0(e){if(Array.isArray(e))return e.map(e=>W0(e));if(e&&typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))H0.has(n)||(t[n]=W0(r));return t}return e}function G0(e){return e.type===`jsxComponent`&&typeof e.attrs?.componentName==`string`&&U0.has(e.attrs.componentName)?W0(e):e.content?{...e,content:e.content.map(G0)}:e}function K0(e){if(Array.isArray(e))return e.map(e=>K0(e));if(e&&typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))n!==`position`&&(t[n]=K0(r));return t}return e}function q0(e){if(e.type===`jsxComponent`)return e;if(e.content)for(let t of e.content){let e=q0(t);if(e)return e}}function J0(e){let t=e.cacheLimit??2048,n=new Map,r=r=>{let i=n.get(r);if(i!==void 0)return i;let a=q0(e.parse(r)),o=a?G0(K0(a)):null;if(n.size>=t){let e=n.keys().next().value;e!==void 0&&n.delete(e)}return n.set(r,o),o};return{isDiverged(e){if(e.type!==`jsxComponent`||!e.attrs||e.attrs.kind===`expression`)return!1;let t=e.attrs.sourceRaw;if(typeof t!=`string`||t.length===0)return!1;let n=r(t);return n?V0(n,G0(K0(e))):!1}}}function Y0(e,t){let n=Array.isArray(e.attrs.attributes)?e.attrs.attributes.filter(e=>typeof e==`object`&&!!e&&`type`in e):[],r=e.attrs.props??{},i=new Map,a=new Set;if(t)for(let e of t)e.omitOnDefault===!0&&`defaultValue`in e&&e.defaultValue!==void 0&&i.set(e.name,e.defaultValue),e.type===`string`&&e.required===!1&&e.defaultValue===void 0&&a.add(e.name);for(let[e,t]of Object.entries(r)){let r=n.findIndex(t=>t.type===`mdxJsxAttribute`&&t.name===e);if(i.has(e)&&Object.is(i.get(e),t)){r>=0&&n.splice(r,1);continue}if(a.has(e)&&t===``){r>=0&&n.splice(r,1);continue}if(r>=0){let e=n[r];if(e.type===`mdxJsxAttribute`&&e.value!=null&&typeof e.value==`object`&&e.value.type===`mdxJsxAttributeValueExpression`&&X0(e.value.value,t))continue}let o=Z0(e,t);r>=0?n[r]=o:n.push(o)}return n}function X0(e,t){try{return JSON.stringify(JSON.parse(e))===JSON.stringify(t)}catch{return!1}}function Z0(e,t){if(t===!0)return{type:`mdxJsxAttribute`,name:e,value:null};if(t===!1)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:`false`}};if(t==null)return{type:`mdxJsxAttribute`,name:e,value:null};if(typeof t==`string`)return{type:`mdxJsxAttribute`,name:e,value:t};if(typeof t==`number`)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:JSON.stringify(t)}};if(typeof t==`object`){let n;try{n=JSON.stringify(t)}catch{n=String(t)}return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:n}}}return{type:`mdxJsxAttribute`,name:e,value:String(t)}}function Q0(e,t,n,r){return{type:`mdxJsxFlowElement`,name:e,attributes:Y0(t,r),children:n.all(t),data:{}}}var $0=/^[A-Za-z0-9]{20,}$/,e2=/^(?:\d+s?|(?:\d+h)?(?:\d+m)?(?:\d+s)?)$/;function t2(e){let t=e.toLowerCase();return t===`loom.com`||t===`www.loom.com`}function n2(e){let t=e.pathname.match(/^\/(?:share|embed)\/([A-Za-z0-9]+)\/?$/);if(!t)return null;let n=t[1]??``;return $0.test(n)?n:null}function r2(e){if(typeof e!=`string`||e.length===0)return null;let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`||!t2(t.hostname))return null;let n=n2(t);if(!n)return null;let r=t.searchParams.get(`t`);return{id:n,startRaw:r&&r.length>0&&e2.test(r)?r:null}}function i2(e){return r2(e)!==null}function a2(e){let t=e.toLowerCase();return t===`vimeo.com`||t===`www.vimeo.com`||t===`player.vimeo.com`}function o2(e){if(typeof e!=`string`||e.length===0)return!1;let t;try{t=new URL(e)}catch{return!1}return t.protocol!==`http:`&&t.protocol!==`https:`?!1:a2(t.hostname)}var s2=/^[A-Za-z0-9_-]{11}$/;function c2(e){let t=e.toLowerCase();return t===`youtube.com`||t===`www.youtube.com`||t===`m.youtube.com`||t===`music.youtube.com`||t===`youtu.be`||t===`youtube-nocookie.com`||t===`www.youtube-nocookie.com`}function l2(e){if(e.length===0)return null;if(/^[0-9]+$/.test(e)){let t=Number.parseInt(e,10);return t>0?t:null}let t=e.match(/^(?:([0-9]+)h)?(?:([0-9]+)m)?(?:([0-9]+)s?)?$/);if(!t)return null;let n=t[1]?Number.parseInt(t[1],10):0,r=t[2]?Number.parseInt(t[2],10):0,i=t[3]?Number.parseInt(t[3],10):0,a=n*3600+r*60+i;return a>0?a:null}function u2(e){if(e.hostname.toLowerCase()===`youtu.be`){let t=e.pathname.replace(/^\//,``).split(`/`)[0]??``;return s2.test(t)?t:null}if(e.pathname===`/watch`){let t=e.searchParams.get(`v`)??``;return s2.test(t)?t:null}let t=e.pathname.match(/^\/(?:embed|shorts|v)\/([A-Za-z0-9_-]{11})\/?$/);return t?t[1]??null:null}function d2(e){if(typeof e!=`string`||e.length===0)return null;let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`||!c2(t.hostname))return null;let n=u2(t);if(!n)return null;let r=t.searchParams.get(`t`)??t.searchParams.get(`start`)??``;return{id:n,startSeconds:r.length>0?l2(r):null,noCookie:t.hostname.toLowerCase().endsWith(`youtube-nocookie.com`)}}var f2=[{name:`type`,type:`enum`,enumValues:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`],defaultValue:`note`,required:!1,description:`Callout variant`},{name:`title`,type:`string`,required:!1,description:`Optional heading shown above the body`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Lightbulb`)",iconPicker:!0},{name:`color`,type:`string`,required:!1,advanced:!0,description:"Optional accent color override (hex — e.g. `#F05032`)",colorPicker:!0},{name:`collapsible`,type:`boolean`,required:!1,defaultValue:!1,advanced:!0,description:"Render as a foldable `<details>` (Obsidian `[!TYPE]+/-`)"},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,description:`When collapsible, start in the open state`,hideWhen:e=>e.collapsible!==!0},{name:`children`,type:`reactnode`,required:!0,description:`Callout content`}],p2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Image source URL`,accept:_d,autoFocus:!0},{name:`alt`,type:`string`,required:!0,description:`Alt text`},{name:`width`,type:`number`,required:!1,advanced:!0,description:`Image width`},{name:`height`,type:`number`,required:!1,advanced:!0,description:`Image height`},{name:`srcset`,type:`string`,required:!1,advanced:!0,description:`Responsive image candidate set (e.g. "x.png 1x, y.png 2x")`},{name:`sizes`,type:`string`,required:!1,advanced:!0,description:`Responsive image sizes hint paired with srcset`},{name:`loading`,type:`enum`,enumValues:[`eager`,`lazy`],defaultValue:`lazy`,required:!1,advanced:!0,omitOnDefault:!0,description:`Native img loading strategy (defaults to lazy)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`decoding`,type:`enum`,enumValues:[`sync`,`async`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,omitOnDefault:!0,description:`Hint for how the browser should decode the image`},{name:`fetchpriority`,type:`enum`,enumValues:[`high`,`low`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,omitOnDefault:!0,description:`Resource fetch priority hint`},{name:`crossorigin`,type:`enum`,enumValues:[`anonymous`,`use-credentials`],required:!1,advanced:!0,description:`CORS mode for the image fetch`},{name:`referrerpolicy`,type:`string`,required:!1,advanced:!0,description:`Referrer policy for the image fetch (HTML referrerpolicy values)`},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],m2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Embedded page URL (must start with http:// or https://)`,autoFocus:!0},{name:`title`,type:`string`,required:!1,description:`Iframe title (accessible label for screen readers)`},{name:`width`,type:`string`,required:!1,advanced:!0,description:`Embed width as a CSS length (e.g. "100%", "640px")`,cssLengthInput:!0},{name:`height`,type:`string`,required:!1,advanced:!0,description:`Embed height as a CSS length (e.g. "26rem", "480px")`,cssLengthInput:!0},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],h2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Video source URL`,accept:vd,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,omitOnDefault:!0,description:`Show native HTML5 video controls (defaults to true)`,hideWhen:e=>typeof e.src==`string`&&(o2(e.src)||i2(e.src))},{name:`autoplay`,type:`boolean`,required:!1,advanced:!0,description:`Begin playback as soon as possible (usually requires muted)`},{name:`poster`,type:`string`,required:!1,advanced:!0,description:`Poster image URL shown before playback`,accept:_d,hideWhen:e=>typeof e.src==`string`&&(o2(e.src)||i2(e.src))},{name:`width`,type:`number`,required:!1,advanced:!0,description:`Video width`},{name:`height`,type:`number`,required:!1,advanced:!0,description:`Video height`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`,hideWhen:e=>typeof e.src==`string`&&i2(e.src)},{name:`playsinline`,type:`boolean`,required:!1,advanced:!0,description:`Play inline on iOS rather than entering fullscreen`,hideWhen:e=>typeof e.src==`string`&&(o2(e.src)||i2(e.src))},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the video to preload`,hideWhen:e=>typeof e.src==`string`&&(d2(e.src)!==null||o2(e.src)||i2(e.src))},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],g2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Audio source URL`,accept:yd,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,omitOnDefault:!0,description:`Show native HTML5 audio controls (defaults to true)`},{name:`autoplay`,type:`boolean`,required:!1,advanced:!0,description:`Begin playback as soon as possible (usually requires muted)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the audio to preload`}],_2=[{name:`title`,type:`string`,required:!0,description:`Accordion heading shown inside the <summary>`},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!1,description:`When true, the accordion renders expanded on initial load`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Rocket`)",iconPicker:!0},{name:`description`,type:`string`,required:!1,advanced:!0,description:`Optional subtitle rendered below the title inside <summary>`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#advanced-options`)"},{name:`name`,type:`string`,required:!1,advanced:!0,description:`HTML5 <details name=> group — siblings with the same name are mutually exclusive`}],v2=[f2[0],f2[1],f2[4],f2[5],f2[6]],y2=[p2[0],p2[1],p2[7]],b2=[_2[0],_2[1],_2[4],_2[5]],x2=[{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`,`justify`],required:!1,defaultValue:`center`,description:"Block alignment from the `<div align>` attribute."},{name:`tag`,type:`string`,required:!1,defaultValue:`div`,hidden:!0,description:`Source wrapper tag (div or center).`},{name:`sourceAttrs`,type:`string`,required:!1,defaultValue:``,hidden:!0,description:`Raw opener-tag attribute bytes preserved for round-trip.`}],S2=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Alt text (Obsidian alias syntax: `![[file.png|alt text]]`)"}],C2=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[clip.mp4|title]]`)"}],w2=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[song.mp3|title]]`)"}],T2=[{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#install-tabs`)"}],E2=[{name:`label`,type:`string`,required:!0,autoFocus:!0,defaultValue:`Tab`,description:`Tab strip label — shown in the clickable pill at the top`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#tab-npm`)"}],D2=[{name:`formula`,type:`string`,required:!0,autoFocus:!0,language:`latex`,description:`LaTeX math source (rendered with KaTeX in the browser)`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#eq-pythagoras`)"},{name:`language`,type:`string`,required:!1,advanced:!0,description:"Forward-compat hint for the math source language (default `latex`). Reserved for future MathJax / Typst / AsciiMath substrates."}],O2=[D2[0]],k2=[D2[0]],A2=[{name:`chart`,type:`string`,required:!0,hidden:!0,description:`Mermaid chart source (graph / flowchart / sequenceDiagram / class / state / etc.)`}],j2=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Display name override (Obsidian alias syntax: `![[file.zip|label]]`)"}],M2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`File URL`,accept:[`*/*`],autoFocus:!0}],N2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`PDF source URL`,accept:bd,autoFocus:!0},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Accessible label for the embedded PDF viewer`},{name:`anchor`,type:`string`,required:!1,advanced:!0,description:"PDF viewer parameters as a single URL-fragment string (e.g. `page=3&height=600`)"}],P2=[{name:`src`,type:`string`,required:!0,description:"Path of the source doc, extension-less (e.g. `api-spec`).",autoFocus:!0},{name:`anchor`,type:`string`,required:!0,description:"Id of the `<MirrorSource>` block within the source doc."}],F2=[{name:`id`,type:`string`,required:!0,description:"Stable id agents and authors use to reference this block from `<Mirror>` elsewhere.",autoFocus:!0},{name:`children`,type:`reactnode`,required:!0,description:`Block content this MirrorSource owns — paragraphs, callouts, code, nested JSX, anything.`}];function I2(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function L2(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function R2(e){let t=e.attrs.props,n=t?.target??``,r=typeof t?.alias==`string`&&t.alias.length>0?t.alias:null,i=typeof t?.anchor==`string`&&t.anchor.length>0?t.anchor:null,a=r??(i?`${n}#${i}`:n);return{type:`wikiLinkEmbed`,value:a,data:{target:n,anchor:i,alias:r},children:[{type:`text`,value:a}]}}var z2=[{name:`Callout`,surface:`canonical`,hasChildren:!0,props:f2,icon:`MessageSquareWarning`,category:`content`,displayName:`Callout`,description:`Alert / admonition with 15 type variants — 5 GFM (note, tip, important, warning, caution) plus 10 Obsidian-parity (abstract, info, todo, success, question, failure, danger, bug, example, quote)`,searchTerms:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`,`alert`,`admonition`,`callout`],serialize:(e,t)=>Q0(`Callout`,e,t,f2)},{name:`img`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:p2,icon:`Image`,category:`media`,displayName:`Image`,description:`Image with click-to-zoom and HTML-native attributes`,searchTerms:[`image`,`zoom`,`picture`,`photo`],placeholder:{label:`Add an image`},serialize:(e,t)=>Q0(`img`,e,t,p2)},{name:`video`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:h2,icon:`SquarePlay`,category:`media`,displayName:`Video`,description:`HTML5 video player with native controls`,searchTerms:[`video`,`media`,`player`,`mp4`,`webm`,`movie`],placeholder:{label:`Add a video`},serialize:(e,t)=>Q0(`video`,e,t,h2)},{name:`audio`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:g2,icon:`Volume2`,category:`media`,displayName:`Audio`,description:`HTML5 audio player with native controls`,searchTerms:[`audio`,`sound`,`music`,`mp3`,`podcast`,`player`],placeholder:{label:`Add audio`},serialize:(e,t)=>Q0(`audio`,e,t,g2)},{name:`Pdf`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:N2,icon:`FileText`,category:`media`,displayName:`PDF`,description:"Embedded PDF viewer (`#page=N` to open at page N, `#height=N` for viewer height)",searchTerms:[`pdf`,`document`,`embed`,`pdfjs`],placeholder:{label:`Add a PDF`},serialize:(e,t)=>Q0(`Pdf`,e,t,N2)},{name:`File`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:M2,icon:`Paperclip`,category:`media`,displayName:`File`,description:`Downloadable file attachment — inline row with name + size + download link`,searchTerms:[`file`,`attachment`,`download`,`document`,`zip`,`docx`,`doc`],placeholder:{label:`Add a file`},serialize:(e,t)=>Q0(`File`,e,t,M2)},{name:`Embed`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:m2,icon:`AppWindow`,category:`media`,displayName:`Embed`,description:'Inline web embed (iframe) — drop a URL, get a resizable preview pane. For YouTube / Vimeo / Loom prefer `<video src="…">` (player props, click-facade); `<Embed>` auto-rewrites watch URLs as a fallback.',searchTerms:[`embed`,`iframe`,`website`,`page`,`inline`,`frame`,`preview`],placeholder:{label:`Embed a URL`},serialize:(e,t)=>Q0(`Embed`,e,t,m2)},{name:`Accordion`,surface:`canonical`,hasChildren:!0,props:_2,icon:`ChevronRight`,category:`content`,displayName:`Accordion`,description:"Standalone expand/collapse via native HTML5 <details>/<summary>. Group siblings with the `name` prop for exclusive-accordion UX.",searchTerms:[`toggle`,`accordion`,`expandable`,`details`,`disclosure`,`collapse`,`fold`],exampleBody:`Body content revealed when the accordion is expanded.`,serialize:(e,t)=>Q0(`Accordion`,e,t,_2)},{name:`Tabs`,surface:`canonical`,hasChildren:!0,emptyChildName:`Tab`,props:T2,icon:`LayoutPanelTop`,category:`content`,displayName:`Tabs`,description:"Horizontal tab strip + active panel below. Each `<Tab>` child is one panel; clickable pills at the top switch the active one. Active selection is ephemeral (resets on reload).",searchTerms:[`tabs`,`tabbed`,`panels`,`tabgroup`,`switcher`],exampleBody:`<Tab label="One">Body of the first tab panel.</Tab>
497
- <Tab label="Two">Body of the second tab panel.</Tab>`,serialize:(e,t)=>Q0(`Tabs`,e,t,T2)},{name:`Tab`,surface:`canonical`,hasChildren:!0,props:E2,icon:`PanelTop`,category:`content`,displayName:`Tab`,description:"A single tab panel inside a `<Tabs>` container — carries the strip label and the block-content body.",searchTerms:[`tab`,`panel`],exampleBody:"Panel content — must be nested inside a `<Tabs>` parent.",serialize:(e,t)=>Q0(`Tab`,e,t,E2)},{name:`Math`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:D2,icon:`Sigma`,category:`content`,displayName:`Math`,description:`Block math equation rendered with KaTeX from a LaTeX source string`,searchTerms:[`math`,`latex`,`equation`,`formula`,`katex`,`tex`],serialize:(e,t)=>Q0(`Math`,e,t,D2)},{name:`MermaidFence`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:A2,icon:`Workflow`,category:`content`,displayName:`Mermaid`,placeholder:{label:`Add a Mermaid diagram`},description:"Diagram rendered from Mermaid source (flowchart, sequence, class, state, ER, gantt, pie). Authored exclusively as ` ```mermaid ` fenced code.",searchTerms:[`mermaid`,`diagram`,`flowchart`,`graph`,`sequence`,`sequencediagram`,`class`,`state`,`er`,`erdiagram`,`gantt`,`pie`,`chart`],serialize:e=>({type:`code`,lang:`mermaid`,meta:null,value:e.attrs.props?.chart??``})},{name:`Mirror`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:P2,icon:`CopyPlus`,category:`content`,displayName:`Mirror`,description:"Render a read-only copy of a `<MirrorSource>` block from another doc. Use to keep the same content in sync across multiple docs without copy-paste — edits land at the source, every Mirror reflects the change.",searchTerms:[`mirror`,`sync`,`synced`,`transclude`,`embed`,`reference`,`shared block`],serialize:(e,t)=>Q0(`Mirror`,e,t,P2)},{name:`MirrorSource`,surface:`canonical`,hasChildren:!0,props:F2,icon:`GitBranch`,category:`content`,displayName:`Mirror Source`,description:'Mark a block as the source of truth for content that appears in multiple docs. Wrap any block content; `<Mirror src="…" anchor="<id>">` references render this verbatim read-only at every call-site. Edit here, propagate everywhere.',searchTerms:[`mirror source`,`sync source`,`source block`,`master block`,`shared`],exampleBody:"Authoritative content lives inside this block — edits here propagate to every `<Mirror>` that references this id.",serialize:(e,t)=>Q0(`MirrorSource`,e,t,F2)},{name:`GFMCallout`,surface:`compat`,hasChildren:!0,props:v2,icon:`MessageSquareWarning`,category:`content`,displayName:`GFM Callout`,description:"GFM blockquote alert (`> [!NOTE]`) — read-only compat. Preserves `> [!NOTE]` syntax on round-trip; insert a fresh Callout block for the full prop surface.",rendersAs:`Callout`,translateProps:e=>e,serialize:(e,t)=>{let n=e.attrs.props,r=new Set([`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`]),i=n?.type??`note`;return{type:`blockquote`,children:[{type:`html`,value:`[!${(r.has(i.toLowerCase())?i:`note`).toUpperCase()}]${n?.collapsible?n.defaultOpen===!1?`-`:`+`:``}${n?.title?` ${n.title}`:``}`},...t.all(e).filter(e=>{if(e.type!==`paragraph`)return!0;let t=e;return Array.isArray(t.children)&&t.children.length>0})]}}},{name:`CommonMarkImage`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:y2,icon:`Image`,category:`media`,displayName:`CommonMark Image`,description:'CommonMark image (`![alt](src "title")`) — read-only compat. Preserves `![alt](src)` syntax on round-trip; insert a fresh Image block for the full HTML-native attribute surface (srcset, sizes, decoding, etc.).',rendersAs:`img`,translateProps:e=>e,serialize:e=>{let t=e.attrs.props;return{type:`paragraph`,children:[{type:`image`,url:t?.sourceUrl??t?.src??``,alt:t?.alt??``,title:t?.title??null}]}}},{name:`WikiEmbedImage`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:S2,icon:`ZoomIn`,category:`media`,displayName:`Wiki Embed Image`,description:"Obsidian-style `![[file.png]]` wiki-embed — read-only compat. Edit the alt-text via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`img`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,alt:t??n}},serialize:R2},{name:`WikiEmbedVideo`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:C2,icon:`Film`,category:`media`,displayName:`Wiki Embed Video`,description:"Obsidian-style `![[clip.mp4]]` wiki-embed — read-only compat. Edit the title via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`video`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,title:t??n}},serialize:R2},{name:`WikiEmbedAudio`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:w2,icon:`Volume2`,category:`media`,displayName:`Wiki Embed Audio`,description:"Obsidian-style `![[song.mp3]]` wiki-embed — read-only compat. Edit the title via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`audio`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,title:t??n}},serialize:R2},{name:`WikiEmbedFile`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:j2,icon:`Paperclip`,category:`media`,displayName:`Wiki Embed File`,description:"Obsidian-style `![[file.zip]]` wiki-embed — read-only compat for arbitrary downloadable attachments. Renders through the `File` canonical (inline row with file-up icon + bold name + optional dim size). Edit the display name via the alias slot.",rendersAs:`File`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.size==`string`&&e.size.length>0?e.size:null;return{src:e.src,name:t??void 0,size:n??void 0}},serialize:R2},{name:`HtmlDetailsAccordion`,surface:`compat`,hasChildren:!0,props:b2,icon:`ChevronRight`,category:`content`,displayName:`HTML5 Details`,description:"HTML5 `<details><summary>` collapsible — read-only compat. Preserves `<details>` syntax on round-trip; insert a fresh Accordion block for icon / description / group-name props.",rendersAs:`Accordion`,translateProps:e=>e,serialize:(e,t)=>{let n=e.attrs.props,r=n?.defaultOpen?` open`:``,i=n?.name?` name="${I2(n.name)}"`:``,a=n?.id?` id="${I2(n.id)}"`:``,o=n?.title?.trim(),s=o?`<summary>${L2(o)}</summary>`:``;return{type:`mdxJsxFlowElement`,name:`HtmlDetailsAccordion`,attributes:[],children:t.all(e),data:{htmlBoundary:{opener:`<details${r}${i}${a}>\n${s}`,closer:`</details>`}}}}},{name:`HtmlAlignBlock`,surface:`canonical`,hasChildren:!0,props:x2,icon:`AlignCenter`,category:`content`,displayName:`Align block`,description:"GitHub-style `<div align>` wrapper. Children render as normal blocks with the alignment applied; the `<div align>` syntax is preserved on round-trip.",searchTerms:[`align`,`center`,`centered`,`div`],serialize:(e,t)=>{let n=e.attrs.props,r=n?.tag===`center`?`center`:`div`,i=typeof n?.align==`string`&&n.align?n.align:null,a=typeof n?.sourceAttrs==`string`?n.sourceAttrs:``,o=/(\balign\s*=\s*)(?:"[^"]*"|'[^']*'|[^\s"'<>]+)/i;return i!==null&&(r===`div`||i!==`center`)?a=o.test(a)?a.replace(o,`$1"${I2(i)}"`):`${a} align="${I2(i)}"`:(i===null||r===`center`&&i===`center`)&&(a=a.replace(RegExp(`\\s*${o.source}`,`i`),``)),{type:`mdxJsxFlowElement`,name:`HtmlAlignBlock`,attributes:[],children:t.all(e),data:{htmlBoundary:{opener:`<${r}${a}>`,closer:`</${r}>`}}}}},{name:`DollarMath`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:O2,icon:`Sigma`,category:`content`,displayName:`Dollar Math`,description:"Block math via `$$…$$` syntax — read-only compat. Preserves `$$…$$` form on round-trip; insert a fresh Math block for the full prop surface (id, language).",rendersAs:`Math`,translateProps:e=>e,serialize:e=>({type:`math`,value:e.attrs.props?.formula??``})},{name:`MathFence`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:k2,icon:`Sigma`,category:`content`,displayName:`Math Fence`,description:"Block math via ` ```math ` fenced code syntax — read-only compat. Preserves the fence form on round-trip; insert a fresh Math block for the full prop surface (id, language).",rendersAs:`Math`,translateProps:e=>e,serialize:e=>({type:`code`,lang:`math`,meta:null,value:e.attrs.props?.formula??``})}],B2={name:`*`,surface:`canonical`,hasChildren:!0,props:[],description:`Unregistered component — children editable as markdown`,serialize:(e,t)=>Q0(e.attrs.componentName||`*`,e,t)};function V2(){let e=new Map;e.set(`*`,B2);for(let t of z2)e.set(t.name,t);return{get(t){return e.get(t)},getOrWildcard(t){return e.get(t)??e.get(`*`)},set(t,n){e.set(t,n)},has(t){return e.has(t)},entries(){return e.entries()}}}var H2={parseFallback:{blockLevel:0,wholeDoc:0,wholeDocBudget:0},jsxRenderFailure:{},jsxAutoConvertFailed:{},jsxAutoConvertSucceeded:{},jsxPropDropped:{},jsxMoveFailed:{},jsxStuckCopyFailed:{},jsxStuckDeleteFailed:{},jsxPopoverCloseRestoreFailed:{},jsxKeyboardDeleteFailed:{},blockGripClickSelectFailed:{},jsxArrowNodeSelectFailed:{}};function U2(){H2.parseFallback.blockLevel++}function W2(){H2.parseFallback.wholeDoc++}function G2(){H2.parseFallback.wholeDocBudget++}function K2(e){H2.jsxRenderFailure[e]=(H2.jsxRenderFailure[e]??0)+1}function q2(e){H2.jsxAutoConvertFailed[e]=(H2.jsxAutoConvertFailed[e]??0)+1}function J2(e){H2.jsxAutoConvertSucceeded[e]=(H2.jsxAutoConvertSucceeded[e]??0)+1}function Y2(e){H2.jsxPropDropped[e]=(H2.jsxPropDropped[e]??0)+1}function X2(e){H2.jsxMoveFailed[e]=(H2.jsxMoveFailed[e]??0)+1}function Z2(e){H2.jsxStuckCopyFailed[e]=(H2.jsxStuckCopyFailed[e]??0)+1}function Q2(e){H2.jsxStuckDeleteFailed[e]=(H2.jsxStuckDeleteFailed[e]??0)+1}function $2(e){H2.jsxPopoverCloseRestoreFailed[e]=(H2.jsxPopoverCloseRestoreFailed[e]??0)+1}function e4(e){H2.jsxKeyboardDeleteFailed[e]=(H2.jsxKeyboardDeleteFailed[e]??0)+1}function t4(e){H2.blockGripClickSelectFailed[e]=(H2.blockGripClickSelectFailed[e]??0)+1}function n4(e){H2.jsxArrowNodeSelectFailed[e]=(H2.jsxArrowNodeSelectFailed[e]??0)+1}var r4=/^(`{3,}|~{3,})/gm;function i4(e){let t=[],n=null;for(let r of e.matchAll(r4)){let e=r[1],i=r.index;n?e[0]===n.marker[0]&&e.length>=n.marker.length&&(t.push([n.offset,i+r[0].length]),n=null):n={marker:e,offset:i}}return n&&t.push([n.offset,e.length]),t}function a4(e,t){return t.some(([t,n])=>e>=t&&e<n)}var o4=/^[ \t]{0,3}\[([^\]]+)\]:\s*(\S+)(\s+(?:"[^"]*"|'[^']*'|\([^)]*\)))?\s*$/gm;function s4(e){let t=i4(e),n=[];for(let r of e.matchAll(o4))a4(r.index,t)||n.push(r[0].trimEnd());return n.length>0?`${n.join(`
498
- `)}\n\n`:``}var c4=500,l4=1e3;function u4(e,t){let n={startMs:typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),calls:0};return m4(e,t.parse,0,n)}function d4(e){return e.calls>=l4?!0:(typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now())-e.startMs>=c4}var f4=500;function p4(e){return e instanceof Error?{name:e.name,message:e.message.slice(0,f4),stack:e.stack?.split(`
493
+ `);for(let e=0;e<r.length;e++)r[e]&&t.push({type:`text`,value:r[e]??``}),e<r.length-1&&t.push({type:`element`,tagName:`br`,properties:{},children:[]})}e.children=t}function b1(e){if(!(!(`children`in e)||!Array.isArray(e.children))){e.children=e.children.filter(e=>e.type===`comment`?!g1.test(String(e.value??``)):!0);for(let t of e.children)t.type===`element`&&b1(t)}}var x1=new Set([`Apple-tab-span`,`Apple-converted-space`,`Apple-style-span`]),S1=()=>e=>{C1(e)};function C1(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&C1(t);e.children=e.children.flatMap(e=>{if(e.type!==`element`)return[e];let t=e;return w1(t)?[]:T1(t)?t.children:[t]})}}function w1(e){if(e.tagName!==`meta`)return!1;let t=e.properties?.name,n=e.properties?.content;return t===`Generator`&&typeof n==`string`&&/Cocoa/i.test(n)}function T1(e){if(e.tagName!==`span`)return!1;let t=e.properties?.className;return Array.isArray(t)?t.length>0&&t.every(e=>x1.has(String(e))):!1}var E1=`docs-internal-guid-`;function D1(e,t){let n=e.children[t];!n||n.type!==`element`||e.children.splice(t,1,...n.children)}var O1=()=>e=>{k1(e)};function k1(e){if(!(`children`in e)||!Array.isArray(e.children))return;for(let t of e.children)t.type===`element`&&k1(t);let t=0;for(;t<e.children.length;){let n=e.children[t];if(!n||n.type!==`element`){t++;continue}let r=n;if(A1(r)||j1(r)){D1(e,t);continue}t++}}function A1(e){if(e.tagName!==`b`)return!1;let t=e.properties?.id;return typeof t==`string`&&t.startsWith(E1)}function j1(e){if(e.tagName!==`div`||e.properties?.dir!==`ltr`)return!1;let t=e.children.filter(e=>e.type===`element`);return t.length===1?t[0]?.tagName===`table`:!1}var M1=new Set([`commit-link`,`user-mention`,`team-mention`,`issue-link`]),N1=()=>e=>{P1(e)};function P1(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&P1(t);for(let t of e.children)t.type===`element`&&F1(t)}}function F1(e){if(!e.properties)return;for(let t of Object.keys(e.properties))t.startsWith(`dataHovercard`)&&delete e.properties[t];let t=e.properties.className;if(Array.isArray(t)){let n=t.filter(e=>!M1.has(String(e)));n.length===0?delete e.properties.className:e.properties.className=n}}var I1=/^gmail_/,L1=()=>e=>{R1(e)};function R1(e){if(!(`children`in e)||!Array.isArray(e.children))return;for(let t of e.children)t.type===`element`&&R1(t);let t=0;for(;t<e.children.length;){let n=e.children[t];if(n.type!==`element`){t++;continue}let r=n;if(r.tagName===`div`&&z1(r,`gmail_quote`)&&(r.tagName=`blockquote`),B1(r),V1(r)){e.children.splice(t,1,...r.children);continue}t++}}function z1(e,t){let n=e.properties?.className;return Array.isArray(n)?n.some(e=>String(e)===t):!1}function B1(e){let t=e.properties?.className;if(!Array.isArray(t))return;let n=t.filter(e=>!I1.test(String(e)));n.length===0?delete e.properties?.className:e.properties&&(e.properties.className=n)}function V1(e){if(e.tagName!==`div`||e.properties?.dir!==`ltr`)return!1;let t=e.properties?.className;return t!=null&&!(Array.isArray(t)&&t.length===0)?!1:e.children.filter(e=>e.type===`element`).length<=1}var H1=()=>e=>{U1(e)};function U1(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&U1(t);e.children=e.children.flatMap(e=>{if(e.type!==`element`)return[e];let t=e;return t.tagName===`google-sheets-html-origin`?t.children:t.tagName===`style`?[]:(W1(t),[t])})}}function W1(e){if(e.properties)for(let t of Object.keys(e.properties))t.startsWith(`dataSheets`)&&delete e.properties[t]}var G1=[`o:`,`w:`,`m:`,`v:`,`u1:`],K1=/^Mso[A-Z]/,q1=/^\s*\[if\s+[^\]]*\]/,J1=()=>e=>{Y1(e)};function Y1(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&Y1(t);e.children=e.children.flatMap(e=>{if(e.type===`comment`){let t=String(e.value??``);return q1.test(t)?[]:[e]}if(e.type!==`element`)return[e];let t=e;return X1(t)?[]:(Z1(t),[t])})}}function X1(e){return G1.some(t=>e.tagName.startsWith(t))}function Z1(e){let t=e.properties;if(!t)return;let n=t.className;if(Array.isArray(n)){let e=n.filter(e=>typeof e==`string`&&!K1.test(e));e.length===0?delete t.className:t.className=e}else typeof n==`string`&&K1.test(n)&&delete t.className;let r=t.style;typeof r==`string`&&/mso-/i.test(r)&&delete t.style;for(let e of Object.keys(t))if(e.startsWith(`xmlns:`)){let n=e.slice(6);G1.some(e=>e===`${n}:`)&&delete t[e]}}var Q1=/^c-(message_kit__|message__|compose|timestamp)/,$1=()=>e=>{e0(e)};function e0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&e0(t);e.children=e.children.flatMap(e=>{if(e.type!==`element`)return[e];let t=e;return t0(t)?[]:(n0(t),[t])})}}function t0(e){let t=e.properties?.className;return Array.isArray(t)?t.some(e=>String(e)===`c-timestamp`||String(e).startsWith(`c-timestamp`)):!1}function n0(e){let t=e.properties?.className;if(!Array.isArray(t))return;let n=t.filter(e=>!Q1.test(String(e)));n.length===0?delete e.properties?.className:e.properties&&(e.properties.className=n)}var r0=()=>e=>{i0(e)};function i0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&i0(t);for(let t=0;t<e.children.length;t++){let n=e.children[t];if(n.type!==`element`)continue;let r=n;a0(r)&&(e.children[t]=s0(r))}}}function a0(e){if(e.tagName!==`div`)return!1;let t=e.children.filter(e=>e.type===`element`&&e.tagName===`div`);return t.length<2?!1:t.some(e=>o0(e))}function o0(e){for(let t of e.children){if(t.type!==`element`)continue;let e=t,n=e.properties?.style;if(typeof n==`string`&&/color\s*:/i.test(n)||o0(e))return!0}return!1}function s0(e){return{type:`element`,tagName:`pre`,properties:{},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:e.children.filter(e=>e.type===`element`&&e.tagName===`div`).map(e=>c0(e)).join(`
494
+ `)}]}]}}function c0(e){let t=``;for(let n of e.children)n.type===`text`?t+=n.value??``:n.type===`element`&&(t+=c0(n));return t}var l0=new Set([`break`,`delete`,`emphasis`,`footnoteReference`,`html`,`image`,`imageReference`,`inlineCode`,`link`,`linkReference`,`strong`,`text`]);function u0(e){let t=e.children;Array.isArray(t)&&t.forEach((e,n)=>{if(e.type===`break`){t[n]={type:`html`,value:`<br />`};return}u0(e)})}function d0(e){let t=e.children;if(Array.isArray(t))for(let e of t)(e.type===`inlineCode`||e.type===`html`)&&(e.value.includes(`
495
+ `)&&(e.value=e.value.replace(/[ \t]*\n[ \t]*/g,` `)),e.type===`html`&&e.value.includes(`|`)&&(e.value=e.value.replace(/\|/g,`\\|`))),d0(e)}function f0(e){D(e,`tableCell`,e=>{e.children.some(e=>!l0.has(e.type))&&(e.children=p0(e.children)),u0(e),d0(e)})}function p0(e){let t=[],n=0,r=()=>{t.length>0&&(n+=1)},i=e=>{for(;n>0;)t.push({type:`break`}),--n;t.push(e)},a=e=>{e.split(`
496
+ `).forEach((e,t)=>{t>0&&r(),e.length>0&&i({type:`text`,value:e})})},o=e=>{let t=e.ordered===!0,n=typeof e.start==`number`?e.start:1,a=e.data,o=typeof a?.bulletMarker==`string`?a.bulletMarker:`-`,c=typeof a?.listMarkerDelimiter==`string`?a.listMarkerDelimiter:`.`;e.children.forEach((e,a)=>{a>0&&r(),i({type:`text`,value:t?`${n+a}${c} `:`${o} `}),e.children.forEach((e,t)=>{t>0&&r(),s(e)})})},s=e=>{switch(e.type){case`paragraph`:case`heading`:e.children.forEach(i);return;case`list`:o(e);return;case`code`:case`html`:a(e.value);return;case`thematicBreak`:i({type:`text`,value:e.data?.sourceRaw??`---`});return;default:{let t=e;if(Array.isArray(t.children)&&t.children.length>0){t.children.forEach((e,t)=>{t>0&&r(),s(e)});return}let n=e;if(typeof n.value==`string`){a(n.value);return}console.warn(JSON.stringify({event:`table-cell-flatten-dropped-block`,nodeType:e.type}))}}};return e.forEach((e,t)=>{t>0&&r(),s(e)}),t}var m0=class extends Error{htmlBytes;maxBytes;constructor(e,t){super(`HTML payload (${e} bytes) exceeds htmlToMdast ceiling (${t} bytes); falling through to plain text`),this.name=`HtmlPayloadTooLargeError`,this.htmlBytes=e,this.maxBytes=t}},h0=[O1,J1,S1,L1,_1,r0,H1,$1,N1];function g0(e){D(e,e=>{e.type===`strong`?(e.data??={},e.data.sourceDelimiter=`**`):e.type===`emphasis`?(e.data??={},e.data.sourceDelimiter=`*`):e.type===`inlineCode`?(e.data??={},e.data.sourceFenceChar="`",e.data.sourceFenceLength=1):e.type===`code`&&(e.data??={},e.data.sourceFenceChar="`",e.data.sourceFenceLength=3)})}function _0(e){D(e,`list`,e=>{for(let t of e.children){let e=t.children.filter(e=>e.type!==`list`).length;t.spread=t.spread===!0&&e>1}e.spread=e.children.some(e=>e.spread===!0)})}function v0(e,t){let n=t?.maxBytes??5242880;if(e.length>n)throw new m0(e.length,n);let r=le().use(Qte,{fragment:!0});for(let e of h0)r.use(e);for(let e of t?.additionalCleanupPlugins??[])r.use(e);r.use(JM);let i=r.parse(e),a=r.runSync(i);return _0(a),g0(a),a}function y0(e){return f0(e),String(le().use(ue).use(xN,{bullet:`-`,rule:`-`,fences:!0}).stringify(e))}function b0(e,t){let n=0;for(let r=0;r<t.length&&n<e.length;r++)e[n]===t[r]&&n++;return n===e.length}var x0=new Set([`sourceRaw`,`sourceDirty`,`position`]),S0=new Set([`jsxComponent`,`table`,`tableRow`,`tableCell`,`tableHeader`,`list`,`listItem`,`blockquote`,`codeBlock`,`heading`]),C0={type:`__br__`},w0=/^<br\s*\/?>$/i;function T0(e){let t=A0(e,T0);return(t.type===`tableCell`||t.type===`tableHeader`)&&t.content?{...t,content:E0(t.content)}:t}function E0(e){let t=[];for(let n of e){let e=D0(n);e.length!==0&&(t.length>0&&t.push(C0),t.push(...e))}return t}function D0(e){return e.text!==void 0||e.type===`hardBreak`||e.type===`jsxInline`?[e]:!e.content||e.content.length===0?[]:e.content.some(e=>e.text===void 0&&e.type!==`hardBreak`&&e.type!==`jsxInline`&&!!e.content)?E0(e.content):e.content}function O0(e){return e.type===`hardBreak`||e.type===C0.type||e.text!==void 0&&w0.test(e.text.trim())?C0:A0(e,O0)}var k0=[{label:`table-cell-block-flatten`,severity:`pm-model-caused`,rationale:`GFM table cells have no block spelling; a block placed in a cell is flattened to inline on serialize, so a cell-with-blocks and a cell-with-inline describe the same persisted document.`,proofPointer:`markdown/table-cell-flatten.ts flattenCellBlocks (table-cell-flatten-dropped-block event)`,canonicalize:T0},{label:`void-hardbreak-br`,severity:`serializer-caused`,rationale:`A void hardBreak inside a table cell or heading serializes to a literal <br /> that a fresh parse keeps as text; the node form and the literal form are the same break.`,proofPointer:`markdown/void-br-promoter.ts + markdown/to-markdown-handlers.ts break handler`,canonicalize:O0}];function A0(e,t){return e.content?{...e,content:e.content.map(t)}:e}function j0(e,t){let n={};e.type!==void 0&&(n.type=e.type),e.text!==void 0&&(n.text=e.text);let r=M0(e.attrs,t);return r&&(n.attrs=r),e.marks&&e.marks.length>0&&(n.marks=[...e.marks].map(e=>({type:e.type,attrs:M0(e.attrs,t)})).sort((e,t)=>P0(e).localeCompare(P0(t)))),e.content&&e.content.length>0&&(n.content=e.content.map(e=>j0(e,t))),n}function M0(e,t){if(!e)return null;let n={};for(let r of Object.keys(e).sort()){if(x0.has(r)||t?.(r))continue;let i=e[r];i!=null&&(n[r]=t?N0(i,t):i)}return Object.keys(n).length>0?n:null}function N0(e,t){if(Array.isArray(e))return e.map(e=>N0(e,t));if(e&&typeof e==`object`){let n={};for(let[r,i]of Object.entries(e))t(r)||(n[r]=N0(i,t));return n}return e}function P0(e){return JSON.stringify(e,(e,t)=>{if(t&&typeof t==`object`&&!Array.isArray(t)){let e={};for(let n of Object.keys(t).sort())e[n]=t[n];return e}return t})}function F0(e){let t=``,n=e=>{if(e.text!==void 0&&(t+=e.text),e.content)for(let t of e.content)n(t)};return n(e),t.replace(/\s+/g,``)}function I0(e){let t=[],n=e=>{if(e.type&&S0.has(e.type)){let n=e.type===`jsxComponent`?String(e.attrs?.componentName??``):``;t.push(n?`${e.type}:${n}`:e.type)}if(e.content)for(let t of e.content)n(t)};return n(e),t.sort()}function L0(e){let t=e,n=[];for(let e of k0){let r=P0(t),i=e.canonicalize(t);P0(i)!==r&&n.push(e.label),t=i}return{normalized:t,fired:n}}function R0(e,t,n={}){let r=L0(e),i=L0(t),a=[...new Set([...r.fired,...i.fired])];if(!b0(F0(r.normalized),F0(i.normalized)))return{equivalent:!1,level:`L1`,reason:`content-loss`,appliedDegrades:a,detail:`authored text did not survive the round-trip`};let o=I0(r.normalized),s=I0(i.normalized);if(P0(o)!==P0(s))return{equivalent:!1,level:`L1`,reason:`structural-shatter`,appliedDegrades:a,detail:`container multiset diverged: [${o.join(`, `)}] vs [${s.join(`, `)}]`};let c=j0(r.normalized,n.ignoreAttrs),l=j0(i.normalized,n.ignoreAttrs);return P0(c)===P0(l)?{equivalent:!0,level:a.length>0?`L2`:`L1`,appliedDegrades:a}:{equivalent:!1,level:`L2`,reason:`structural-divergence`,appliedDegrades:a,detail:z0(c,l)}}function z0(e,t,n=`doc`){let r=e,i=t;if(!r||!i)return`${n}: node presence differs`;if(r.type!==i.type)return`${n}: type ${String(r.type)} vs ${String(i.type)}`;let a=r.content??[],o=i.content??[];if(a.length!==o.length)return`${n}(${String(r.type)}): child count ${a.length} vs ${o.length}`;for(let e=0;e<a.length;e++)if(P0(a[e])!==P0(o[e]))return z0(a[e],o[e],`${n}>${String(r.type)}[${e}]`);return`${n}(${String(r.type)}): attrs or marks differ`}function B0(e,t,n){return!R0(e,t,{ignoreAttrs:n}).equivalent}var V0=new Set([`src`,`href`,`size`]),H0=new Set([`WikiEmbedImage`,`WikiEmbedVideo`,`WikiEmbedAudio`,`WikiEmbedFile`]);function U0(e){if(Array.isArray(e))return e.map(e=>U0(e));if(e&&typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))V0.has(n)||(t[n]=U0(r));return t}return e}function W0(e){return e.type===`jsxComponent`&&typeof e.attrs?.componentName==`string`&&H0.has(e.attrs.componentName)?U0(e):e.content?{...e,content:e.content.map(W0)}:e}function G0(e){if(Array.isArray(e))return e.map(e=>G0(e));if(e&&typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))n!==`position`&&(t[n]=G0(r));return t}return e}function K0(e){if(e.type===`jsxComponent`)return e;if(e.content)for(let t of e.content){let e=K0(t);if(e)return e}}function q0(e){let t=e.cacheLimit??2048,n=new Map,r=r=>{let i=n.get(r);if(i!==void 0)return i;let a=K0(e.parse(r)),o=a?W0(G0(a)):null;if(n.size>=t){let e=n.keys().next().value;e!==void 0&&n.delete(e)}return n.set(r,o),o};return{isDiverged(e){if(e.type!==`jsxComponent`||!e.attrs||e.attrs.kind===`expression`)return!1;let t=e.attrs.sourceRaw;if(typeof t!=`string`||t.length===0)return!1;let n=r(t);return n?B0(n,W0(G0(e))):!1}}}function J0(e,t){let n=Array.isArray(e.attrs.attributes)?e.attrs.attributes.filter(e=>typeof e==`object`&&!!e&&`type`in e):[],r=e.attrs.props??{},i=new Map,a=new Set;if(t)for(let e of t)e.omitOnDefault===!0&&`defaultValue`in e&&e.defaultValue!==void 0&&i.set(e.name,e.defaultValue),e.type===`string`&&e.required===!1&&e.defaultValue===void 0&&a.add(e.name);for(let[e,t]of Object.entries(r)){let r=n.findIndex(t=>t.type===`mdxJsxAttribute`&&t.name===e);if(i.has(e)&&Object.is(i.get(e),t)){r>=0&&n.splice(r,1);continue}if(a.has(e)&&t===``){r>=0&&n.splice(r,1);continue}if(r>=0){let e=n[r];if(e.type===`mdxJsxAttribute`&&e.value!=null&&typeof e.value==`object`&&e.value.type===`mdxJsxAttributeValueExpression`&&Y0(e.value.value,t))continue}let o=X0(e,t);r>=0?n[r]=o:n.push(o)}return n}function Y0(e,t){try{return JSON.stringify(JSON.parse(e))===JSON.stringify(t)}catch{return!1}}function X0(e,t){if(t===!0)return{type:`mdxJsxAttribute`,name:e,value:null};if(t===!1)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:`false`}};if(t==null)return{type:`mdxJsxAttribute`,name:e,value:null};if(typeof t==`string`)return{type:`mdxJsxAttribute`,name:e,value:t};if(typeof t==`number`)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:JSON.stringify(t)}};if(typeof t==`object`){let n;try{n=JSON.stringify(t)}catch{n=String(t)}return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:n}}}return{type:`mdxJsxAttribute`,name:e,value:String(t)}}function Z0(e,t,n,r){return{type:`mdxJsxFlowElement`,name:e,attributes:J0(t,r),children:n.all(t),data:{}}}var Q0=/^[A-Za-z0-9]{20,}$/,$0=/^(?:\d+s?|(?:\d+h)?(?:\d+m)?(?:\d+s)?)$/;function e2(e){let t=e.toLowerCase();return t===`loom.com`||t===`www.loom.com`}function t2(e){let t=e.pathname.match(/^\/(?:share|embed)\/([A-Za-z0-9]+)\/?$/);if(!t)return null;let n=t[1]??``;return Q0.test(n)?n:null}function n2(e){if(typeof e!=`string`||e.length===0)return null;let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`||!e2(t.hostname))return null;let n=t2(t);if(!n)return null;let r=t.searchParams.get(`t`);return{id:n,startRaw:r&&r.length>0&&$0.test(r)?r:null}}function r2(e){return n2(e)!==null}function i2(e){let t=e.toLowerCase();return t===`vimeo.com`||t===`www.vimeo.com`||t===`player.vimeo.com`}function a2(e){if(typeof e!=`string`||e.length===0)return!1;let t;try{t=new URL(e)}catch{return!1}return t.protocol!==`http:`&&t.protocol!==`https:`?!1:i2(t.hostname)}var o2=/^[A-Za-z0-9_-]{11}$/;function s2(e){let t=e.toLowerCase();return t===`youtube.com`||t===`www.youtube.com`||t===`m.youtube.com`||t===`music.youtube.com`||t===`youtu.be`||t===`youtube-nocookie.com`||t===`www.youtube-nocookie.com`}function c2(e){if(e.length===0)return null;if(/^[0-9]+$/.test(e)){let t=Number.parseInt(e,10);return t>0?t:null}let t=e.match(/^(?:([0-9]+)h)?(?:([0-9]+)m)?(?:([0-9]+)s?)?$/);if(!t)return null;let n=t[1]?Number.parseInt(t[1],10):0,r=t[2]?Number.parseInt(t[2],10):0,i=t[3]?Number.parseInt(t[3],10):0,a=n*3600+r*60+i;return a>0?a:null}function l2(e){if(e.hostname.toLowerCase()===`youtu.be`){let t=e.pathname.replace(/^\//,``).split(`/`)[0]??``;return o2.test(t)?t:null}if(e.pathname===`/watch`){let t=e.searchParams.get(`v`)??``;return o2.test(t)?t:null}let t=e.pathname.match(/^\/(?:embed|shorts|v)\/([A-Za-z0-9_-]{11})\/?$/);return t?t[1]??null:null}function u2(e){if(typeof e!=`string`||e.length===0)return null;let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`||!s2(t.hostname))return null;let n=l2(t);if(!n)return null;let r=t.searchParams.get(`t`)??t.searchParams.get(`start`)??``;return{id:n,startSeconds:r.length>0?c2(r):null,noCookie:t.hostname.toLowerCase().endsWith(`youtube-nocookie.com`)}}var d2=[{name:`type`,type:`enum`,enumValues:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`],defaultValue:`note`,required:!1,description:`Callout variant`},{name:`title`,type:`string`,required:!1,description:`Optional heading shown above the body`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Lightbulb`)",iconPicker:!0},{name:`color`,type:`string`,required:!1,advanced:!0,description:"Optional accent color override (hex — e.g. `#F05032`)",colorPicker:!0},{name:`collapsible`,type:`boolean`,required:!1,defaultValue:!1,advanced:!0,description:"Render as a foldable `<details>` (Obsidian `[!TYPE]+/-`)"},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,description:`When collapsible, start in the open state`,hideWhen:e=>e.collapsible!==!0},{name:`children`,type:`reactnode`,required:!0,description:`Callout content`}],f2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Image source URL`,accept:_d,autoFocus:!0},{name:`alt`,type:`string`,required:!0,description:`Alt text`},{name:`width`,type:`number`,required:!1,advanced:!0,description:`Image width`},{name:`height`,type:`number`,required:!1,advanced:!0,description:`Image height`},{name:`srcset`,type:`string`,required:!1,advanced:!0,description:`Responsive image candidate set (e.g. "x.png 1x, y.png 2x")`},{name:`sizes`,type:`string`,required:!1,advanced:!0,description:`Responsive image sizes hint paired with srcset`},{name:`loading`,type:`enum`,enumValues:[`eager`,`lazy`],defaultValue:`lazy`,required:!1,advanced:!0,omitOnDefault:!0,description:`Native img loading strategy (defaults to lazy)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`decoding`,type:`enum`,enumValues:[`sync`,`async`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,omitOnDefault:!0,description:`Hint for how the browser should decode the image`},{name:`fetchpriority`,type:`enum`,enumValues:[`high`,`low`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,omitOnDefault:!0,description:`Resource fetch priority hint`},{name:`crossorigin`,type:`enum`,enumValues:[`anonymous`,`use-credentials`],required:!1,advanced:!0,description:`CORS mode for the image fetch`},{name:`referrerpolicy`,type:`string`,required:!1,advanced:!0,description:`Referrer policy for the image fetch (HTML referrerpolicy values)`},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],p2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Embedded page URL (must start with http:// or https://)`,autoFocus:!0},{name:`title`,type:`string`,required:!1,description:`Iframe title (accessible label for screen readers)`},{name:`width`,type:`string`,required:!1,advanced:!0,description:`Embed width as a CSS length (e.g. "100%", "640px")`,cssLengthInput:!0},{name:`height`,type:`string`,required:!1,advanced:!0,description:`Embed height as a CSS length (e.g. "26rem", "480px")`,cssLengthInput:!0},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],m2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Video source URL`,accept:vd,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,omitOnDefault:!0,description:`Show native HTML5 video controls (defaults to true)`,hideWhen:e=>typeof e.src==`string`&&(a2(e.src)||r2(e.src))},{name:`autoplay`,type:`boolean`,required:!1,advanced:!0,description:`Begin playback as soon as possible (usually requires muted)`},{name:`poster`,type:`string`,required:!1,advanced:!0,description:`Poster image URL shown before playback`,accept:_d,hideWhen:e=>typeof e.src==`string`&&(a2(e.src)||r2(e.src))},{name:`width`,type:`number`,required:!1,advanced:!0,description:`Video width`},{name:`height`,type:`number`,required:!1,advanced:!0,description:`Video height`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`,hideWhen:e=>typeof e.src==`string`&&r2(e.src)},{name:`playsinline`,type:`boolean`,required:!1,advanced:!0,description:`Play inline on iOS rather than entering fullscreen`,hideWhen:e=>typeof e.src==`string`&&(a2(e.src)||r2(e.src))},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the video to preload`,hideWhen:e=>typeof e.src==`string`&&(u2(e.src)!==null||a2(e.src)||r2(e.src))},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],h2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Audio source URL`,accept:yd,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,omitOnDefault:!0,description:`Show native HTML5 audio controls (defaults to true)`},{name:`autoplay`,type:`boolean`,required:!1,advanced:!0,description:`Begin playback as soon as possible (usually requires muted)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the audio to preload`}],g2=[{name:`title`,type:`string`,required:!0,description:`Accordion heading shown inside the <summary>`},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!1,description:`When true, the accordion renders expanded on initial load`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Rocket`)",iconPicker:!0},{name:`description`,type:`string`,required:!1,advanced:!0,description:`Optional subtitle rendered below the title inside <summary>`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#advanced-options`)"},{name:`name`,type:`string`,required:!1,advanced:!0,description:`HTML5 <details name=> group — siblings with the same name are mutually exclusive`}],_2=[d2[0],d2[1],d2[4],d2[5],d2[6]],v2=[f2[0],f2[1],f2[7]],y2=[g2[0],g2[1],g2[4],g2[5]],b2=[{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`,`justify`],required:!1,defaultValue:`center`,description:"Block alignment from the `<div align>` attribute."},{name:`tag`,type:`string`,required:!1,defaultValue:`div`,hidden:!0,description:`Source wrapper tag (div or center).`},{name:`sourceAttrs`,type:`string`,required:!1,defaultValue:``,hidden:!0,description:`Raw opener-tag attribute bytes preserved for round-trip.`}],x2=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Alt text (Obsidian alias syntax: `![[file.png|alt text]]`)"}],S2=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[clip.mp4|title]]`)"}],C2=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[song.mp3|title]]`)"}],w2=[{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#install-tabs`)"}],T2=[{name:`label`,type:`string`,required:!0,autoFocus:!0,defaultValue:`Tab`,description:`Tab strip label — shown in the clickable pill at the top`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#tab-npm`)"}],E2=[{name:`formula`,type:`string`,required:!0,autoFocus:!0,language:`latex`,description:`LaTeX math source (rendered with KaTeX in the browser)`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#eq-pythagoras`)"},{name:`language`,type:`string`,required:!1,advanced:!0,description:"Forward-compat hint for the math source language (default `latex`). Reserved for future MathJax / Typst / AsciiMath substrates."}],D2=[E2[0]],O2=[E2[0]],k2=[{name:`chart`,type:`string`,required:!0,hidden:!0,description:`Mermaid chart source (graph / flowchart / sequenceDiagram / class / state / etc.)`}],A2=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Display name override (Obsidian alias syntax: `![[file.zip|label]]`)"}],j2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`File URL`,accept:[`*/*`],autoFocus:!0}],M2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`PDF source URL`,accept:bd,autoFocus:!0},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Accessible label for the embedded PDF viewer`},{name:`anchor`,type:`string`,required:!1,advanced:!0,description:"PDF viewer parameters as a single URL-fragment string (e.g. `page=3&height=600`)"}],N2=[{name:`src`,type:`string`,required:!0,description:"Path of the source doc, extension-less (e.g. `api-spec`).",autoFocus:!0},{name:`anchor`,type:`string`,required:!0,description:"Id of the `<MirrorSource>` block within the source doc."}],P2=[{name:`id`,type:`string`,required:!0,description:"Stable id agents and authors use to reference this block from `<Mirror>` elsewhere.",autoFocus:!0},{name:`children`,type:`reactnode`,required:!0,description:`Block content this MirrorSource owns — paragraphs, callouts, code, nested JSX, anything.`}];function F2(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function I2(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function L2(e){let t=e.attrs.props,n=t?.target??``,r=typeof t?.alias==`string`&&t.alias.length>0?t.alias:null,i=typeof t?.anchor==`string`&&t.anchor.length>0?t.anchor:null,a=r??(i?`${n}#${i}`:n);return{type:`wikiLinkEmbed`,value:a,data:{target:n,anchor:i,alias:r},children:[{type:`text`,value:a}]}}var R2=[{name:`Callout`,surface:`canonical`,hasChildren:!0,props:d2,icon:`MessageSquareWarning`,category:`content`,displayName:`Callout`,description:`Alert / admonition with 15 type variants — 5 GFM (note, tip, important, warning, caution) plus 10 Obsidian-parity (abstract, info, todo, success, question, failure, danger, bug, example, quote)`,searchTerms:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`,`alert`,`admonition`,`callout`],serialize:(e,t)=>Z0(`Callout`,e,t,d2)},{name:`img`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:f2,icon:`Image`,category:`media`,displayName:`Image`,description:`Image with click-to-zoom and HTML-native attributes`,searchTerms:[`image`,`zoom`,`picture`,`photo`],placeholder:{label:`Add an image`},serialize:(e,t)=>Z0(`img`,e,t,f2)},{name:`video`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:m2,icon:`SquarePlay`,category:`media`,displayName:`Video`,description:`HTML5 video player with native controls`,searchTerms:[`video`,`media`,`player`,`mp4`,`webm`,`movie`],placeholder:{label:`Add a video`},serialize:(e,t)=>Z0(`video`,e,t,m2)},{name:`audio`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:h2,icon:`Volume2`,category:`media`,displayName:`Audio`,description:`HTML5 audio player with native controls`,searchTerms:[`audio`,`sound`,`music`,`mp3`,`podcast`,`player`],placeholder:{label:`Add audio`},serialize:(e,t)=>Z0(`audio`,e,t,h2)},{name:`Pdf`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:M2,icon:`FileText`,category:`media`,displayName:`PDF`,description:"Embedded PDF viewer (`#page=N` to open at page N, `#height=N` for viewer height)",searchTerms:[`pdf`,`document`,`embed`,`pdfjs`],placeholder:{label:`Add a PDF`},serialize:(e,t)=>Z0(`Pdf`,e,t,M2)},{name:`File`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:j2,icon:`Paperclip`,category:`media`,displayName:`File`,description:`Downloadable file attachment — inline row with name + size + download link`,searchTerms:[`file`,`attachment`,`download`,`document`,`zip`,`docx`,`doc`],placeholder:{label:`Add a file`},serialize:(e,t)=>Z0(`File`,e,t,j2)},{name:`Embed`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:p2,icon:`AppWindow`,category:`media`,displayName:`Embed`,description:'Inline web embed (iframe) — drop a URL, get a resizable preview pane. For YouTube / Vimeo / Loom prefer `<video src="…">` (player props, click-facade); `<Embed>` auto-rewrites watch URLs as a fallback.',searchTerms:[`embed`,`iframe`,`website`,`page`,`inline`,`frame`,`preview`],placeholder:{label:`Embed a URL`},serialize:(e,t)=>Z0(`Embed`,e,t,p2)},{name:`Accordion`,surface:`canonical`,hasChildren:!0,props:g2,icon:`ChevronRight`,category:`content`,displayName:`Accordion`,description:"Standalone expand/collapse via native HTML5 <details>/<summary>. Group siblings with the `name` prop for exclusive-accordion UX.",searchTerms:[`toggle`,`accordion`,`expandable`,`details`,`disclosure`,`collapse`,`fold`],exampleBody:`Body content revealed when the accordion is expanded.`,serialize:(e,t)=>Z0(`Accordion`,e,t,g2)},{name:`Tabs`,surface:`canonical`,hasChildren:!0,emptyChildName:`Tab`,props:w2,icon:`LayoutPanelTop`,category:`content`,displayName:`Tabs`,description:"Horizontal tab strip + active panel below. Each `<Tab>` child is one panel; clickable pills at the top switch the active one. Active selection is ephemeral (resets on reload).",searchTerms:[`tabs`,`tabbed`,`panels`,`tabgroup`,`switcher`],exampleBody:`<Tab label="One">Body of the first tab panel.</Tab>
497
+ <Tab label="Two">Body of the second tab panel.</Tab>`,serialize:(e,t)=>Z0(`Tabs`,e,t,w2)},{name:`Tab`,surface:`canonical`,hasChildren:!0,props:T2,icon:`PanelTop`,category:`content`,displayName:`Tab`,description:"A single tab panel inside a `<Tabs>` container — carries the strip label and the block-content body.",searchTerms:[`tab`,`panel`],exampleBody:"Panel content — must be nested inside a `<Tabs>` parent.",serialize:(e,t)=>Z0(`Tab`,e,t,T2)},{name:`Math`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:E2,icon:`Sigma`,category:`content`,displayName:`Math`,description:`Block math equation rendered with KaTeX from a LaTeX source string`,searchTerms:[`math`,`latex`,`equation`,`formula`,`katex`,`tex`],serialize:(e,t)=>Z0(`Math`,e,t,E2)},{name:`MermaidFence`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:k2,icon:`Workflow`,category:`content`,displayName:`Mermaid`,placeholder:{label:`Add a Mermaid diagram`},description:"Diagram rendered from Mermaid source (flowchart, sequence, class, state, ER, gantt, pie). Authored exclusively as ` ```mermaid ` fenced code.",searchTerms:[`mermaid`,`diagram`,`flowchart`,`graph`,`sequence`,`sequencediagram`,`class`,`state`,`er`,`erdiagram`,`gantt`,`pie`,`chart`],serialize:e=>({type:`code`,lang:`mermaid`,meta:null,value:e.attrs.props?.chart??``})},{name:`Mirror`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:N2,icon:`CopyPlus`,category:`content`,displayName:`Mirror`,description:"Render a read-only copy of a `<MirrorSource>` block from another doc. Use to keep the same content in sync across multiple docs without copy-paste — edits land at the source, every Mirror reflects the change.",searchTerms:[`mirror`,`sync`,`synced`,`transclude`,`embed`,`reference`,`shared block`],serialize:(e,t)=>Z0(`Mirror`,e,t,N2)},{name:`MirrorSource`,surface:`canonical`,hasChildren:!0,props:P2,icon:`GitBranch`,category:`content`,displayName:`Mirror Source`,description:'Mark a block as the source of truth for content that appears in multiple docs. Wrap any block content; `<Mirror src="…" anchor="<id>">` references render this verbatim read-only at every call-site. Edit here, propagate everywhere.',searchTerms:[`mirror source`,`sync source`,`source block`,`master block`,`shared`],exampleBody:"Authoritative content lives inside this block — edits here propagate to every `<Mirror>` that references this id.",serialize:(e,t)=>Z0(`MirrorSource`,e,t,P2)},{name:`GFMCallout`,surface:`compat`,hasChildren:!0,props:_2,icon:`MessageSquareWarning`,category:`content`,displayName:`GFM Callout`,description:"GFM blockquote alert (`> [!NOTE]`) — read-only compat. Preserves `> [!NOTE]` syntax on round-trip; insert a fresh Callout block for the full prop surface.",rendersAs:`Callout`,translateProps:e=>e,serialize:(e,t)=>{let n=e.attrs.props,r=new Set([`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`]),i=n?.type??`note`;return{type:`blockquote`,children:[{type:`html`,value:`[!${(r.has(i.toLowerCase())?i:`note`).toUpperCase()}]${n?.collapsible?n.defaultOpen===!1?`-`:`+`:``}${n?.title?` ${n.title}`:``}`},...t.all(e).filter(e=>{if(e.type!==`paragraph`)return!0;let t=e;return Array.isArray(t.children)&&t.children.length>0})]}}},{name:`CommonMarkImage`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:v2,icon:`Image`,category:`media`,displayName:`CommonMark Image`,description:'CommonMark image (`![alt](src "title")`) — read-only compat. Preserves `![alt](src)` syntax on round-trip; insert a fresh Image block for the full HTML-native attribute surface (srcset, sizes, decoding, etc.).',rendersAs:`img`,translateProps:e=>e,serialize:e=>{let t=e.attrs.props;return{type:`paragraph`,children:[{type:`image`,url:t?.sourceUrl??t?.src??``,alt:t?.alt??``,title:t?.title??null}]}}},{name:`WikiEmbedImage`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:x2,icon:`ZoomIn`,category:`media`,displayName:`Wiki Embed Image`,description:"Obsidian-style `![[file.png]]` wiki-embed — read-only compat. Edit the alt-text via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`img`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,alt:t??n}},serialize:L2},{name:`WikiEmbedVideo`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:S2,icon:`Film`,category:`media`,displayName:`Wiki Embed Video`,description:"Obsidian-style `![[clip.mp4]]` wiki-embed — read-only compat. Edit the title via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`video`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,title:t??n}},serialize:L2},{name:`WikiEmbedAudio`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:C2,icon:`Volume2`,category:`media`,displayName:`Wiki Embed Audio`,description:"Obsidian-style `![[song.mp3]]` wiki-embed — read-only compat. Edit the title via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`audio`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,title:t??n}},serialize:L2},{name:`WikiEmbedFile`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:A2,icon:`Paperclip`,category:`media`,displayName:`Wiki Embed File`,description:"Obsidian-style `![[file.zip]]` wiki-embed — read-only compat for arbitrary downloadable attachments. Renders through the `File` canonical (inline row with file-up icon + bold name + optional dim size). Edit the display name via the alias slot.",rendersAs:`File`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.size==`string`&&e.size.length>0?e.size:null;return{src:e.src,name:t??void 0,size:n??void 0}},serialize:L2},{name:`HtmlDetailsAccordion`,surface:`compat`,hasChildren:!0,props:y2,icon:`ChevronRight`,category:`content`,displayName:`HTML5 Details`,description:"HTML5 `<details><summary>` collapsible — read-only compat. Preserves `<details>` syntax on round-trip; insert a fresh Accordion block for icon / description / group-name props.",rendersAs:`Accordion`,translateProps:e=>e,serialize:(e,t)=>{let n=e.attrs.props,r=n?.defaultOpen?` open`:``,i=n?.name?` name="${F2(n.name)}"`:``,a=n?.id?` id="${F2(n.id)}"`:``,o=n?.title?.trim(),s=o?`<summary>${I2(o)}</summary>`:``;return{type:`mdxJsxFlowElement`,name:`HtmlDetailsAccordion`,attributes:[],children:t.all(e),data:{htmlBoundary:{opener:`<details${r}${i}${a}>\n${s}`,closer:`</details>`}}}}},{name:`HtmlAlignBlock`,surface:`canonical`,hasChildren:!0,props:b2,icon:`AlignCenter`,category:`content`,displayName:`Align block`,description:"GitHub-style `<div align>` wrapper. Children render as normal blocks with the alignment applied; the `<div align>` syntax is preserved on round-trip.",searchTerms:[`align`,`center`,`centered`,`div`],serialize:(e,t)=>{let n=e.attrs.props,r=n?.tag===`center`?`center`:`div`,i=typeof n?.align==`string`&&n.align?n.align:null,a=typeof n?.sourceAttrs==`string`?n.sourceAttrs:``,o=/(\balign\s*=\s*)(?:"[^"]*"|'[^']*'|[^\s"'<>]+)/i;return i!==null&&(r===`div`||i!==`center`)?a=o.test(a)?a.replace(o,`$1"${F2(i)}"`):`${a} align="${F2(i)}"`:(i===null||r===`center`&&i===`center`)&&(a=a.replace(RegExp(`\\s*${o.source}`,`i`),``)),{type:`mdxJsxFlowElement`,name:`HtmlAlignBlock`,attributes:[],children:t.all(e),data:{htmlBoundary:{opener:`<${r}${a}>`,closer:`</${r}>`}}}}},{name:`DollarMath`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:D2,icon:`Sigma`,category:`content`,displayName:`Dollar Math`,description:"Block math via `$$…$$` syntax — read-only compat. Preserves `$$…$$` form on round-trip; insert a fresh Math block for the full prop surface (id, language).",rendersAs:`Math`,translateProps:e=>e,serialize:e=>({type:`math`,value:e.attrs.props?.formula??``})},{name:`MathFence`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:O2,icon:`Sigma`,category:`content`,displayName:`Math Fence`,description:"Block math via ` ```math ` fenced code syntax — read-only compat. Preserves the fence form on round-trip; insert a fresh Math block for the full prop surface (id, language).",rendersAs:`Math`,translateProps:e=>e,serialize:e=>({type:`code`,lang:`math`,meta:null,value:e.attrs.props?.formula??``})}],z2={name:`*`,surface:`canonical`,hasChildren:!0,props:[],description:`Unregistered component — children editable as markdown`,serialize:(e,t)=>Z0(e.attrs.componentName||`*`,e,t)};function B2(){let e=new Map;e.set(`*`,z2);for(let t of R2)e.set(t.name,t);return{get(t){return e.get(t)},getOrWildcard(t){return e.get(t)??e.get(`*`)},set(t,n){e.set(t,n)},has(t){return e.has(t)},entries(){return e.entries()}}}var V2={parseFallback:{blockLevel:0,wholeDoc:0,wholeDocBudget:0},jsxRenderFailure:{},jsxAutoConvertFailed:{},jsxAutoConvertSucceeded:{},jsxPropDropped:{},jsxMoveFailed:{},jsxStuckCopyFailed:{},jsxStuckDeleteFailed:{},jsxPopoverCloseRestoreFailed:{},jsxKeyboardDeleteFailed:{},blockGripClickSelectFailed:{},jsxArrowNodeSelectFailed:{}};function H2(){V2.parseFallback.blockLevel++}function U2(){V2.parseFallback.wholeDoc++}function W2(){V2.parseFallback.wholeDocBudget++}function G2(e){V2.jsxRenderFailure[e]=(V2.jsxRenderFailure[e]??0)+1}function K2(e){V2.jsxAutoConvertFailed[e]=(V2.jsxAutoConvertFailed[e]??0)+1}function q2(e){V2.jsxAutoConvertSucceeded[e]=(V2.jsxAutoConvertSucceeded[e]??0)+1}function J2(e){V2.jsxPropDropped[e]=(V2.jsxPropDropped[e]??0)+1}function Y2(e){V2.jsxMoveFailed[e]=(V2.jsxMoveFailed[e]??0)+1}function X2(e){V2.jsxStuckCopyFailed[e]=(V2.jsxStuckCopyFailed[e]??0)+1}function Z2(e){V2.jsxStuckDeleteFailed[e]=(V2.jsxStuckDeleteFailed[e]??0)+1}function Q2(e){V2.jsxPopoverCloseRestoreFailed[e]=(V2.jsxPopoverCloseRestoreFailed[e]??0)+1}function $2(e){V2.jsxKeyboardDeleteFailed[e]=(V2.jsxKeyboardDeleteFailed[e]??0)+1}function e4(e){V2.blockGripClickSelectFailed[e]=(V2.blockGripClickSelectFailed[e]??0)+1}function t4(e){V2.jsxArrowNodeSelectFailed[e]=(V2.jsxArrowNodeSelectFailed[e]??0)+1}var n4=/^(`{3,}|~{3,})/gm;function r4(e){let t=[],n=null;for(let r of e.matchAll(n4)){let e=r[1],i=r.index;n?e[0]===n.marker[0]&&e.length>=n.marker.length&&(t.push([n.offset,i+r[0].length]),n=null):n={marker:e,offset:i}}return n&&t.push([n.offset,e.length]),t}function i4(e,t){return t.some(([t,n])=>e>=t&&e<n)}var a4=/^[ \t]{0,3}\[([^\]]+)\]:\s*(\S+)(\s+(?:"[^"]*"|'[^']*'|\([^)]*\)))?\s*$/gm;function o4(e){let t=r4(e),n=[];for(let r of e.matchAll(a4))i4(r.index,t)||n.push(r[0].trimEnd());return n.length>0?`${n.join(`
498
+ `)}\n\n`:``}var s4=500,c4=1e3;function l4(e,t){let n={startMs:typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),calls:0};return p4(e,t.parse,0,n)}function u4(e){return e.calls>=c4?!0:(typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now())-e.startMs>=s4}var d4=500;function f4(e){return e instanceof Error?{name:e.name,message:e.message.slice(0,d4),stack:e.stack?.split(`
499
499
  `).slice(0,4).join(`
500
- `)}:{name:`UnknownError`,message:String(e??`unknown`).slice(0,f4)}}function m4(e,t,n,r){if(n>20)return W2(),console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:`MAX_SPLIT_DEPTH exceeded`})),w4(e);if(r){if(d4(r))return G2(),console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:`parse budget exhausted`,calls:r.calls})),w4(e);r.calls+=1}try{return t(e)}catch(i){let a=h4(i),o=p4(i);if(a===void 0){if(n===0){let n=C4(e,t,i,r);if(n)return n}return W2(),console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:o.message,error:o})),w4(e)}U2(),console.warn(JSON.stringify({event:`mdx-block-fallback`,offset:a,reason:o.message,error:o}));try{let i=x4(e,a),s=e.slice(0,i.start),c=e.slice(i.start,i.end),l=e.slice(i.end),u=s.trim()?m4(s,t,n+1,r):{type:`doc`,content:[]},d=l.trim()?m4(s4(s)+l,t,n+1,r):{type:`doc`,content:[]},f={type:`rawMdxFallback`,attrs:{reason:o.message,originalSpan:{start:i.start,end:i.end}},content:c?[{type:`text`,text:c}]:[]},p=[...u.content??[],f,...d.content??[]];return{type:`doc`,content:p.length>0?p:[{type:`paragraph`,content:[]}]}}catch(t){W2();let n=p4(t);return console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:`Recovery failed: ${n.message}`,recoveryPath:`block-split-then-rejoin`,error:n,originalError:o})),w4(e)}}}function h4(e){if(!e||typeof e!=`object`)return;let t=e;if(t.place&&typeof t.place.offset==`number`)return t.place.offset;if(t.place?.start&&typeof t.place.start.offset==`number`)return t.place.start.offset;if(t.position&&typeof t.position.offset==`number`)return t.position.offset;if(t.position?.start&&typeof t.position.start.offset==`number`)return t.position.start.offset}function g4(e,t){let n=/\n\s*\n/g,r=null;for(let i of e.matchAll(n)){if(i.index>=t)break;r=i.index+i[0].length}return r}function _4(e,t){for(let n of e.matchAll(/\n\s*\n/g))if(n.index>=t)return n.index;return null}var v4=32*1024;function y4(e,t){let n=[];for(let r of e.matchAll(/<(\/?)([A-Z][A-Za-z0-9.]*)/g)){let i=r.index;if(a4(i,t))continue;let a=r[1]===`/`,o=r[2],s=i+r[0].length,c=Math.min(e.length,s+v4),l=!1,u=0,d=-1,f=!1;for(let t=s;t<c;t++){let n=e[t];if(l){n===`"`&&(l=!1),n===`\\`&&t+1<c&&t++;continue}if(n===`"`){l=!0;continue}if(n===`{`){u++;continue}if(n===`}`&&u>0){u--;continue}if(!(u>0)&&n===`>`){d=t,t>0&&e[t-1]===`/`&&(f=!0);break}}if(d===-1)continue;let p=d+1;a?n.push({kind:`close`,name:o,start:i,end:p}):f?n.push({kind:`self-close`,name:o,start:i,end:p}):n.push({kind:`open`,name:o,start:i,end:p})}return n}function b4(e){let t=y4(e,i4(e)),n=[],r=[];for(let i of t){if(i.kind===`self-close`)continue;if(i.kind===`open`){n.push(i);continue}let t=-1;for(let e=n.length-1;e>=0;e--)if(n[e].name===i.name){t=e;break}if(t!==-1){for(let a=n.length-1;a>t;a--){let t=n[a],o=_4(e,t.start)??e.length;r.push({start:t.start,end:Math.min(i.start,o),source:`unmatched`})}r.push({start:n[t].start,end:i.end,source:`pair`}),n.length=t}}for(let t of n){let n=_4(e,t.start)??e.length;r.push({start:t.start,end:Math.min(e.length,n),source:`unmatched`})}return r}function x4(e,t){let n=b4(e),r=null;for(let e of n)e.start<=t&&t<=e.end&&(!r||e.end-e.start<r.end-r.start)&&(r=e);return r?{start:r.start,end:r.end}:{start:g4(e,t)??0,end:_4(e,t)??e.length}}function S4(e){let t=i4(e),n=/\n[ \t]*\n/g,r=[0];for(let i of e.matchAll(n)){let e=i.index;a4(e,t)||r.push(e+i[0].length)}r.push(e.length);let i=[];for(let t=0;t<r.length-1;t++){let n=r[t],a=r[t+1];if(a<=n)continue;let o=e.slice(n,a);o.trim()&&i.push({src:o,start:n,end:a})}return i}function C4(e,t,n,r){let i=S4(e);if(i.length<2)return null;let a=[],o=!1,s=``;for(let e of i){if(r&&d4(r))break;r&&(r.calls+=1);let i=s+e.src;try{let n=t(i).content??[];s+=s4(e.src);let r=n.filter(e=>e.type!==`paragraph`||Array.isArray(e.content)&&e.content.length>0);if(r.length===0&&n.length>0){o=!0;continue}a.push(...r),o=!0}catch(t){U2();let r=t?.message?.slice(0,200)??`unknown block error`,i=n?.message?.slice(0,160)??`unknown`;console.warn(JSON.stringify({event:`mdx-block-fallback`,offset:e.start,reason:`Per-block recovery after position-less error: ${i}`,blockError:r,blockErrorName:t?.name})),a.push({type:`rawMdxFallback`,attrs:{reason:r,originalSpan:{start:e.start,end:e.end}},content:[{type:`text`,text:e.src}]})}}return o?{type:`doc`,content:a.length>0?a:[{type:`paragraph`,content:[]}]}:null}function w4(e){return{type:`doc`,content:[{type:`paragraph`,content:[{type:`text`,text:e}]}]}}var T4=``,E4=``,D4=``,O4=``,k4=``,A4=[[T4,``],[E4,``],[D4,``],[O4,``],[k4,``]],j4=/[\uE000-\uE004]/,M4=/[\uE005-\uE009]/;A4.map(([e,t])=>({from:e,to:t}));var N4=/<([a-zA-Z][a-zA-Z0-9+.-]*:[^\s<>]+)>/g,P4=/<!--[\s\S]*?-->/g,F4=/<\/([a-z][a-z0-9]*)\s*>/g,I4=/<([a-z][a-z0-9]*)(\s[^>]*)?\/?>/g,L4=new Set([`img`,`video`,`audio`]),R4=new Set([`mark`]),z4=/<\/([A-Z][A-Za-z0-9.]*)>/g;function B4(e,t){let n=0,r=e.length;for(;n<r;){let i=n+r>>>1;e[i]<t?n=i+1:r=i}return n}function V4(e){let t=new Map,n=new RegExp(z4.source,`g`),r=n.exec(e);for(;r!==null;){let i=t.get(r[1]);i?i.push(r.index):t.set(r[1],[r.index]),r=n.exec(e)}return t}function H4(e){let t=[],n=/\n\s*\n/g,r=n.exec(e);for(;r!==null;)t.push(r.index),r=n.exec(e);return t}function U4(e){let t=[],n=e.indexOf(`/>`);for(;n!==-1;)t.push(n),n=e.indexOf(`/>`,n+2);return t}function W4(e){let t=[],n=e.indexOf(`>`);for(;n!==-1;)t.push(n),n=e.indexOf(`>`,n+1);return t}var G4=1024;function K4(e,t){if(t[e-1]!==`(`||t[e-2]!==`]`)return!1;let n=e-2,r=0;for(let e=n-1;e>=0&&t[e]===`\\`;e--)r++;if(r%2==1)return!1;let i=!1,a=Math.max(0,n-G4);for(let e=n-1;e>=a;e--){let n=t[e];if(n===`
501
- `||n===`\r`||n==="`")return!1;if(n!==`[`&&n!==`]`)continue;let r=0;for(let n=e-1;n>=0&&t[n]===`\\`;n--)r++;if(r%2!=1){if(n===`]`||t[e+1]===`^`||t[e-1]===`]`)return!1;i=!0;break}}if(!i)return!1;let o=!1,s=-1,c=Math.min(t.length,e+1+G4);for(let n=e+1;n<c;n++){let e=t[n];if(e===`>`){s=n;break}if(e===`<`||e===`\\`||e===`
502
- `||e===`\r`||e===T4||e===E4||e===D4||e===O4||e===k4)return!1;(e===` `||e===` `)&&(o=!0)}return s===-1||!o?!1:t[s+1]===`)`}function q4(e,t,n,r){let i=B4(n,e);if(i>=n.length)return!1;let a=n[i],o=B4(r,e);return a>=(o<r.length?r[o]:t.length)?!1:t[a-1]===`/`}function J4(e){let t=e;if(j4.test(t))for(let[e,n]of A4)t=t.replaceAll(e,n);t=t.replace(P4,e=>e.replace(/</g,T4).replace(/>/g,E4)),t=t.replace(N4,(e,t)=>`${T4}${t.replaceAll(`:`,D4).replaceAll(`@`,O4)}${E4}`),t=t.replace(F4,(e,t)=>R4.has(t)?e:e.replace(/</g,T4).replace(/>/g,E4)),t=t.replace(I4,(e,t)=>L4.has(t)&&e.endsWith(`/>`)||R4.has(t)?e:t[0]===t[0].toLowerCase()&&t[0]!==t[0].toUpperCase()?e.replace(/</g,T4).replace(/>/g,E4):e),t=t.replace(/<>/g,`${T4}${E4}`);let n=V4(t),r=H4(t),i=U4(t),a=W4(t);t=t.replace(/</g,(e,o)=>{if(K4(o,t))return e;let s=t.slice(o,o+256);if(s[1]===`/`)return/^<\/[a-zA-Z][a-zA-Z0-9.]*[ \t]*>/.test(s)?e:T4;let c=/^<([a-z][a-z0-9]*)/.exec(s);if(c&&L4.has(c[1])&&q4(o,t,a,r))return e;let l=/^<([a-z][a-z0-9]*)([\s/>])/.exec(s);if(l&&R4.has(l[1])){let n=l[1];return s.startsWith(`<${n}/>`)||t.indexOf(`</${n}>`,o)!==-1?e:T4}let u=/^<([A-Z][a-zA-Z0-9.]*)[\s/>]/.exec(s);if(!u)return T4;let d=u[1],f=B4(r,o),p=B4(i,f<r.length?r[f]:t.length);if(p>0){let n=i[p-1];if(n>o){let r=o+u[0].length-1;if(!t.slice(r,n).replace(/"[^"]*"|'[^']*'/g,``).includes(`/`))return e}}let m=n.get(d);return m&&B4(m,o)<m.length?e:T4});{let e=[],n=[];for(let r=0;r<t.length;r++){if(t[r]===`
500
+ `)}:{name:`UnknownError`,message:String(e??`unknown`).slice(0,d4)}}function p4(e,t,n,r){if(n>20)return U2(),console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:`MAX_SPLIT_DEPTH exceeded`})),C4(e);if(r){if(u4(r))return W2(),console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:`parse budget exhausted`,calls:r.calls})),C4(e);r.calls+=1}try{return t(e)}catch(i){let a=m4(i),o=f4(i);if(a===void 0){if(n===0){let n=S4(e,t,i,r);if(n)return n}return U2(),console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:o.message,error:o})),C4(e)}H2(),console.warn(JSON.stringify({event:`mdx-block-fallback`,offset:a,reason:o.message,error:o}));try{let i=b4(e,a),s=e.slice(0,i.start),c=e.slice(i.start,i.end),l=e.slice(i.end),u=s.trim()?p4(s,t,n+1,r):{type:`doc`,content:[]},d=l.trim()?p4(o4(s)+l,t,n+1,r):{type:`doc`,content:[]},f={type:`rawMdxFallback`,attrs:{reason:o.message,originalSpan:{start:i.start,end:i.end}},content:c?[{type:`text`,text:c}]:[]},p=[...u.content??[],f,...d.content??[]];return{type:`doc`,content:p.length>0?p:[{type:`paragraph`,content:[]}]}}catch(t){U2();let n=f4(t);return console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:`Recovery failed: ${n.message}`,recoveryPath:`block-split-then-rejoin`,error:n,originalError:o})),C4(e)}}}function m4(e){if(!e||typeof e!=`object`)return;let t=e;if(t.place&&typeof t.place.offset==`number`)return t.place.offset;if(t.place?.start&&typeof t.place.start.offset==`number`)return t.place.start.offset;if(t.position&&typeof t.position.offset==`number`)return t.position.offset;if(t.position?.start&&typeof t.position.start.offset==`number`)return t.position.start.offset}function h4(e,t){let n=/\n\s*\n/g,r=null;for(let i of e.matchAll(n)){if(i.index>=t)break;r=i.index+i[0].length}return r}function g4(e,t){for(let n of e.matchAll(/\n\s*\n/g))if(n.index>=t)return n.index;return null}var _4=32*1024;function v4(e,t){let n=[];for(let r of e.matchAll(/<(\/?)([A-Z][A-Za-z0-9.]*)/g)){let i=r.index;if(i4(i,t))continue;let a=r[1]===`/`,o=r[2],s=i+r[0].length,c=Math.min(e.length,s+_4),l=!1,u=0,d=-1,f=!1;for(let t=s;t<c;t++){let n=e[t];if(l){n===`"`&&(l=!1),n===`\\`&&t+1<c&&t++;continue}if(n===`"`){l=!0;continue}if(n===`{`){u++;continue}if(n===`}`&&u>0){u--;continue}if(!(u>0)&&n===`>`){d=t,t>0&&e[t-1]===`/`&&(f=!0);break}}if(d===-1)continue;let p=d+1;a?n.push({kind:`close`,name:o,start:i,end:p}):f?n.push({kind:`self-close`,name:o,start:i,end:p}):n.push({kind:`open`,name:o,start:i,end:p})}return n}function y4(e){let t=v4(e,r4(e)),n=[],r=[];for(let i of t){if(i.kind===`self-close`)continue;if(i.kind===`open`){n.push(i);continue}let t=-1;for(let e=n.length-1;e>=0;e--)if(n[e].name===i.name){t=e;break}if(t!==-1){for(let a=n.length-1;a>t;a--){let t=n[a],o=g4(e,t.start)??e.length;r.push({start:t.start,end:Math.min(i.start,o),source:`unmatched`})}r.push({start:n[t].start,end:i.end,source:`pair`}),n.length=t}}for(let t of n){let n=g4(e,t.start)??e.length;r.push({start:t.start,end:Math.min(e.length,n),source:`unmatched`})}return r}function b4(e,t){let n=y4(e),r=null;for(let e of n)e.start<=t&&t<=e.end&&(!r||e.end-e.start<r.end-r.start)&&(r=e);return r?{start:r.start,end:r.end}:{start:h4(e,t)??0,end:g4(e,t)??e.length}}function x4(e){let t=r4(e),n=/\n[ \t]*\n/g,r=[0];for(let i of e.matchAll(n)){let e=i.index;i4(e,t)||r.push(e+i[0].length)}r.push(e.length);let i=[];for(let t=0;t<r.length-1;t++){let n=r[t],a=r[t+1];if(a<=n)continue;let o=e.slice(n,a);o.trim()&&i.push({src:o,start:n,end:a})}return i}function S4(e,t,n,r){let i=x4(e);if(i.length<2)return null;let a=[],o=!1,s=``;for(let e of i){if(r&&u4(r))break;r&&(r.calls+=1);let i=s+e.src;try{let n=t(i).content??[];s+=o4(e.src);let r=n.filter(e=>e.type!==`paragraph`||Array.isArray(e.content)&&e.content.length>0);if(r.length===0&&n.length>0){o=!0;continue}a.push(...r),o=!0}catch(t){H2();let r=t?.message?.slice(0,200)??`unknown block error`,i=n?.message?.slice(0,160)??`unknown`;console.warn(JSON.stringify({event:`mdx-block-fallback`,offset:e.start,reason:`Per-block recovery after position-less error: ${i}`,blockError:r,blockErrorName:t?.name})),a.push({type:`rawMdxFallback`,attrs:{reason:r,originalSpan:{start:e.start,end:e.end}},content:[{type:`text`,text:e.src}]})}}return o?{type:`doc`,content:a.length>0?a:[{type:`paragraph`,content:[]}]}:null}function C4(e){return{type:`doc`,content:[{type:`paragraph`,content:[{type:`text`,text:e}]}]}}var w4=``,T4=``,E4=``,D4=``,O4=``,k4=[[w4,``],[T4,``],[E4,``],[D4,``],[O4,``]],A4=/[\uE000-\uE004]/,j4=/[\uE005-\uE009]/;k4.map(([e,t])=>({from:e,to:t}));var M4=/<([a-zA-Z][a-zA-Z0-9+.-]*:[^\s<>]+)>/g,N4=/<!--[\s\S]*?-->/g,P4=/<\/([a-z][a-z0-9]*)\s*>/g,F4=/<([a-z][a-z0-9]*)(\s[^>]*)?\/?>/g,I4=new Set([`img`,`video`,`audio`]),L4=new Set([`mark`]),R4=/<\/([A-Z][A-Za-z0-9.]*)>/g;function z4(e,t){let n=0,r=e.length;for(;n<r;){let i=n+r>>>1;e[i]<t?n=i+1:r=i}return n}function B4(e){let t=new Map,n=new RegExp(R4.source,`g`),r=n.exec(e);for(;r!==null;){let i=t.get(r[1]);i?i.push(r.index):t.set(r[1],[r.index]),r=n.exec(e)}return t}function V4(e){let t=[],n=/\n\s*\n/g,r=n.exec(e);for(;r!==null;)t.push(r.index),r=n.exec(e);return t}function H4(e){let t=[],n=e.indexOf(`>`);for(;n!==-1;)t.push(n),n=e.indexOf(`>`,n+1);return t}var U4=1024;function W4(e,t){if(t[e-1]!==`(`||t[e-2]!==`]`)return!1;let n=e-2,r=0;for(let e=n-1;e>=0&&t[e]===`\\`;e--)r++;if(r%2==1)return!1;let i=!1,a=Math.max(0,n-U4);for(let e=n-1;e>=a;e--){let n=t[e];if(n===`
501
+ `||n===`\r`||n==="`")return!1;if(n!==`[`&&n!==`]`)continue;let r=0;for(let n=e-1;n>=0&&t[n]===`\\`;n--)r++;if(r%2!=1){if(n===`]`||t[e+1]===`^`||t[e-1]===`]`)return!1;i=!0;break}}if(!i)return!1;let o=!1,s=-1,c=Math.min(t.length,e+1+U4);for(let n=e+1;n<c;n++){let e=t[n];if(e===`>`){s=n;break}if(e===`<`||e===`\\`||e===`
502
+ `||e===`\r`||e===w4||e===T4||e===E4||e===D4||e===O4)return!1;(e===` `||e===` `)&&(o=!0)}return s===-1||!o?!1:t[s+1]===`)`}function G4(e,t,n,r){let i=z4(n,e);if(i>=n.length)return!1;let a=n[i],o=z4(r,e);return a>=(o<r.length?r[o]:t.length)?!1:t[a-1]===`/`}function K4(e){let t=[];for(let n of e.matchAll(/<\/?([A-Z][A-Za-z0-9.]*)/g)){let r=n.index;if(t.length>0){let[e,n]=t[t.length-1];if(r>e&&r<=n)continue}let i=r+n[0].length,a=!1,o=!1,s=!1,c=0,l=-1;for(;i<e.length;){let t=e[i];if(a)t===`'`?a=!1:t===`\\`&&i+1<e.length&&i++;else if(o)t===`"`?o=!1:t===`\\`&&i+1<e.length&&i++;else if(s)t==="`"?s=!1:t===`\\`&&i+1<e.length&&i++;else if(t===`'`)a=!0;else if(t===`"`)o=!0;else if(t==="`")s=!0;else if(t===`{`)c++;else if(t===`}`&&c>0)c--;else if(c===0&&t===`>`){l=i;break}i++}if(l!==-1){if(e.slice(r,l).includes(`
503
+
504
+ `))continue;t.push([r,l])}}return t}function q4(e,t){if(t.length===0)return!1;let n=0,r=t.length-1;for(;n<=r;){let i=n+r>>>1,[a,o]=t[i];if(e<=a)r=i-1;else if(e>o)n=i+1;else return!0}return!1}function J4(e,t,n){let r=Math.min(t.length,n),i=!1,a=0;for(let n=e;n<r;n++){let e=t[n];if(i){e===`"`&&(i=!1),e===`\\`&&n+1<r&&n++;continue}if(e===`"`){i=!0;continue}if(e===`{`){a++;continue}if(e===`}`&&a>0){a--;continue}if(!(a>0)&&e===`>`)return n>0&&t[n-1]===`/`}return!1}function Y4(e){let t=e;if(A4.test(t))for(let[e,n]of k4)t=t.replaceAll(e,n);t=t.replace(N4,e=>e.replace(/</g,w4).replace(/>/g,T4)),t=t.replace(M4,(e,t)=>`${w4}${t.replaceAll(`:`,E4).replaceAll(`@`,D4)}${T4}`),t=t.replace(P4,(e,t)=>L4.has(t)?e:e.replace(/</g,w4).replace(/>/g,T4)),t=t.replace(F4,(e,t)=>I4.has(t)&&e.endsWith(`/>`)||L4.has(t)?e:t[0]===t[0].toLowerCase()&&t[0]!==t[0].toUpperCase()?e.replace(/</g,w4).replace(/>/g,T4):e),t=t.replace(/<>/g,`${w4}${T4}`);let n=B4(t),r=V4(t),i=H4(t),a=K4(t);t=t.replace(/</g,(e,o)=>{if(W4(o,t)||q4(o,a))return e;let s=t.slice(o,o+256);if(s[1]===`/`)return/^<\/[a-zA-Z][a-zA-Z0-9.]*[ \t]*>/.test(s)?e:w4;let c=/^<([a-z][a-z0-9]*)/.exec(s);if(c&&I4.has(c[1])&&G4(o,t,i,r))return e;let l=/^<([a-z][a-z0-9]*)([\s/>])/.exec(s);if(l&&L4.has(l[1])){let n=l[1];return s.startsWith(`<${n}/>`)||t.indexOf(`</${n}>`,o)!==-1?e:w4}let u=/^<([A-Z][a-zA-Z0-9.]*)[\s/>]/.exec(s);if(!u)return w4;let d=u[1],f=z4(r,o),p=f<r.length?r[f]:t.length;if(J4(o+1+d.length,t,p))return e;let m=n.get(d);return m&&z4(m,o)<m.length?e:w4});{let e=[],n=[];for(let r=0;r<t.length;r++){if(t[r]===`
503
505
  `){let i=t[r+1];if(i===`
504
506
  `||i===`>`){if(e.push(...n),n.length=0,i===`
505
507
  `)for(;t[r+1]===`
506
- `;)r++;continue}}if(t[r]===`{`||t[r]===`}`){let e=0;for(let n=r-1;n>=0&&t[n]===`\\`;n--)e++;if(e%2==1)continue;t[r]===`{`?n.push(r):n.length>0&&n.pop()}}if(e.push(...n),e.length>0){let n=t.split(``);for(let t of e)n[t]=k4;t=n.join(``)}}return t}function Y4(e){return j4.test(e)||M4.test(e)}function X4(){return e=>{D(e,e=>{let t=e;typeof t.value==`string`&&Y4(t.value)&&(t.value=Z4(t.value)),typeof t.url==`string`&&Y4(t.url)&&(t.url=Z4(t.url)),typeof t.title==`string`&&Y4(t.title)&&(t.title=Z4(t.title)),typeof t.alt==`string`&&Y4(t.alt)&&(t.alt=Z4(t.alt)),typeof t.lang==`string`&&Y4(t.lang)&&(t.lang=Z4(t.lang)),typeof t.meta==`string`&&Y4(t.meta)&&(t.meta=Z4(t.meta))})}}function Z4(e){let t=e.replaceAll(T4,`<`).replaceAll(E4,`>`).replaceAll(D4,`:`).replaceAll(O4,`@`).replaceAll(k4,`{`);if(M4.test(t))for(let[e,n]of A4)t=t.replaceAll(n,e);return t}var Q4=``,$4=``,e3=/&(?:[A-Za-z][A-Za-z0-9]*|#[0-9]+|#[xX][0-9A-Fa-f]+);/g;function t3(e,t){let n=0;for(let r=t-1;r>=0&&e[r]===`\\`;r--)n++;return n}function n3(e,t,n){return t.lastIndex=0,e.replace(t,(t,r)=>typeof r!=`number`||t3(e,r)%2==1?t:n(t))}function r3(e){return e3.lastIndex=0,e.replace(e3,e=>{let t=e.slice(1,-1);if(t.startsWith(`#`)){let e=t[1]===`x`||t[1]===`X`;return E(t.slice(e?2:1),e?16:10)}let n=f(t);return n===!1?e:n})}function i3(e){return n3(e,e3,e=>`${Q4}${e.slice(1,-1)}${$4}`)}var a3=RegExp(`${Q4}([^${$4}]+)${$4}`,`g`);function o3(e){if(!e.includes(Q4))return{value:e,spans:[]};let t=[],n=``,r=0;a3.lastIndex=0;let i=a3.exec(e);for(;i!==null;){i.index>r&&(n+=e.slice(r,i.index));let a=`&${i[1]??``};`;t.push({offset:n.length,length:a.length,raw:a}),n+=a,r=i.index+i[0].length,i=a3.exec(e)}return r<e.length&&(n+=e.slice(r)),{value:n,spans:t}}function s3(){return e=>{D(e,e=>{let t=e;if(typeof t.value==`string`&&t.value.includes(Q4)){let{value:n,spans:r}=o3(t.value);if(t.value=n,e.type===`text`&&r.length>0){let t=e;t.data??={},t.data.entityRefSpans=r}}for(let e of[`url`,`title`,`alt`,`lang`,`meta`]){let n=t[e];typeof n==`string`&&n.includes(Q4)&&(t[e]=o3(n).value)}})}}var c3=``,l3=/\\</g;function u3(e){return n3(e,l3,e=>`${c3}${e.slice(1)}`)}function d3(){return e=>{D(e,e=>{let t=e;typeof t.value==`string`&&t.value.includes(c3)&&(t.value=t.value.split(c3).join(``));for(let e of[`url`,`title`,`alt`]){let n=t[e];typeof n==`string`&&n.includes(c3)&&(t[e]=n.split(c3).join(``))}})}}var f3=new Set([`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`]),p3={note:`note`,tip:`tip`,important:`important`,warning:`warning`,caution:`caution`,abstract:`abstract`,info:`info`,todo:`todo`,success:`success`,question:`question`,failure:`failure`,danger:`danger`,bug:`bug`,example:`example`,quote:`quote`,summary:`abstract`,tldr:`abstract`,check:`success`,done:`success`,help:`question`,faq:`question`,fail:`failure`,missing:`failure`,error:`danger`,cite:`quote`,idea:`tip`,hint:`tip`,warn:`warning`,attention:`warning`},m3=`ok-alert`,h3=RegExp(`(?:^|\\s)${m3}-(\\w+)(?:\\s|$)`),g3=/^>\s*\[!(\w+)\]([+-])?(?:\s+(.*?))?\s*$/i;function _3(e,t){if(t<0||t>=e.length)return null;let n=e.indexOf(`
507
- `,t),r=(n===-1?e.slice(t):e.slice(t,n)).match(g3);return r?{rawType:r[1],foldableMarker:r[2]===`+`||r[2]===`-`?r[2]:null,title:r[3]?.trim()||null}:null}function v3(e){if(e.data?.hName!==`div`)return null;let t=e.data?.hProperties?.class;if(typeof t!=`string`)return null;let n=t.match(h3);return n?n[1].toLowerCase():null}function y3(e){return p3[e.toLowerCase()]??null}function b3(e,t,n,r,i=null){let a=[{type:`mdxJsxAttribute`,name:`type`,value:t}];n&&a.push({type:`mdxJsxAttribute`,name:`title`,value:n}),i&&a.push({type:`mdxJsxAttribute`,name:`data-authored-as`,value:i}),r!==null&&(a.push({type:`mdxJsxAttribute`,name:`collapsible`,value:null}),r===`+`?a.push({type:`mdxJsxAttribute`,name:`defaultOpen`,value:null}):a.push({type:`mdxJsxAttribute`,name:`defaultOpen`,value:{type:`mdxJsxAttributeValueExpression`,value:`false`}}));let o=e.children.slice(1),s=e.position?.start.line;return{type:`mdxJsxFlowElement`,name:`GFMCallout`,attributes:a,children:n&&o.length>0&&s!==void 0&&x3(o[0],s)?o.slice(1):o,position:e.position}}function x3(e,t){if(!e||typeof e!=`object`)return!1;let n=e;if(n.type!==`paragraph`)return!1;let r=n.position?.start?.line,i=n.position?.end?.line;return r===t&&i===t}function S3(e){if(!e||typeof e!=`object`||e.type!==`paragraph`)return!1;let t=e.data?.hProperties?.class;return typeof t==`string`&&t.includes(`${m3}-title`)}function C3(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;D(e,`blockquote`,(e,t,r)=>{if(r===void 0||typeof t!=`number`)return;let i=v3(e);if(!i)return;let a=y3(i),o=null,s=null;e.position?.start?.offset!==void 0&&(s=_3(n,e.position.start.offset),s&&(o=s.title,a||=y3(s.rawType)));let c=a??`note`,l=s&&f3.has(c)?s.foldableMarker:null,u=(()=>{if(e.position?.start?.offset!==void 0){let t=_3(n,e.position.start.offset);if(t?.rawType)return t.rawType}return i})(),d=u.toLowerCase()===c?null:u;if(!S3(e.children[0]))return;let f=b3(e,c,o,l,d);r.children[t]=f})}}var w3=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"></svg>`,T3={markers:`*`,classPrefix:m3,matchCaseSensitive:!1,icons:new Proxy({},{get:()=>w3})};function E3(e,t,n){return e[t]===`\\`&&t+1<e.length&&e[t+1]===n}function D3(e,t,n,r){let i=t,a=0;for(;a<r&&i<e.length;)i+=E3(e,i,n[a])?2:1,a+=1;return i}var O3=new Set;function k3(e,t){if(!e||!t.position||typeof t.position.start?.offset!=`number`)return null;let n=t.position.start.offset,r=t.value,i=Math.min(t.position.end?.offset??e.length,n+2*r.length,e.length),a=!1;for(let t=n;t<i;t++)if(e.charCodeAt(t)===92){a=!0;break}if(!a)return O3;let o=null,s=n,c=0;for(;c<r.length&&s<e.length;){if(E3(e,s,r[c]))o===null&&(o=new Set),o.add(c),s+=2;else if(e[s]===r[c])s+=1;else break;c+=1}return o??O3}function A3(e,t,n){if(e===null||e.size===0)return!1;for(let r=0;r<n;r++)if(e.has(t+r))return!0;return!1}function j3(e,t){let n=1,r=1;for(let i=0;i<t&&i<e.length;i++)e[i]===`
508
- `?(n+=1,r=1):r+=1;return{line:n,column:r,offset:t}}function M3(e,t,n){return{start:j3(e,t),end:j3(e,n)}}function N3(e,t,n,r){if(!e||!t.position||typeof t.position.start?.offset!=`number`)return;let i=t.position.start.offset;return M3(e,D3(e,i,t.value,n),D3(e,i,t.value,r))}var P3=/(?<!%)%%([^\n]*?[^\n%])%%(?!%)/g,F3=/<!--([\s\S]*?)-->/g;function I3(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;R3(e,n),D(e,`text`,(e,t,r)=>{if(r===void 0||t==null)return;let i=e.value;if(i.indexOf(`%%`)===-1&&i.indexOf(`<!--`)===-1)return;let a=L3(i,k3(n,e));if(a.length===0)return;let o=[],s=0;for(let t of a){if(t.start>s){let r={type:`text`,value:i.slice(s,t.start)},a=N3(n,e,s,t.start);a&&(r.position=a),o.push(r)}let r={type:`comment`,children:[{type:`text`,value:t.body}],data:{sourceForm:t.sourceForm}},a=N3(n,e,t.start,t.end);a&&(r.position=a),o.push(r),s=t.end}if(s<i.length){let t={type:`text`,value:i.slice(s)},r=N3(n,e,s,i.length);r&&(t.position=r),o.push(t)}return r.children.splice(t,1,...o),[g,t+o.length]})}}function L3(e,t){let n=[];P3.lastIndex=0;let r;for(;(r=P3.exec(e))!==null;){if(A3(t,r.index,2)||A3(t,r.index+r[0].length-2,2)){P3.lastIndex=r.index+1;continue}r[1].trim().length!==0&&n.push({start:r.index,end:r.index+r[0].length,body:r[1],sourceForm:`percent`})}F3.lastIndex=0;let i;for(;(i=F3.exec(e))!==null;){if(A3(t,i.index,4)||A3(t,i.index+i[0].length-3,3)){F3.lastIndex=i.index+1;continue}let e=i[1].trim();e!==``&&n.push({start:i.index,end:i.index+i[0].length,body:e,sourceForm:`html`})}n.sort((e,t)=>e.start-t.start);let a=[],o=-1;for(let e of n)e.start<o||(a.push(e),o=e.end);return a}function R3(e,t){let n=e.children,r=0;for(;r<n.length;){let e=n[r];if(e.type===`paragraph`){let i=V3(e);if(i!==null){let a=e.children[0],o,s=()=>(o===void 0&&(o=k3(t,a)),o),c=H3(i);if(c!==null&&!A3(s(),0,2)&&!A3(s(),i.length-2,2)){let e={type:`commentBlock`,children:[{type:`paragraph`,children:[{type:`text`,value:c}]}],data:{sourceForm:`percent`,sourceLayout:`block`}};n.splice(r,1,e),r+=1;continue}let l=U3(i);if(l!==null&&!A3(s(),i.length-i.trimStart().length,4)&&!A3(s(),i.trimEnd().length-3,3)){let e={type:`commentBlock`,children:[{type:`paragraph`,children:[{type:`text`,value:l}]}],data:{sourceForm:`html`,sourceLayout:`inline`}};n.splice(r,1,e),r+=1;continue}}let a=W3(e);if(a!==null&&!B3(t,e,4,3)){let e={type:`commentBlock`,children:[a],data:{sourceForm:`html`,sourceLayout:`inline`}};n.splice(r,1,e),r+=1;continue}let o=G3(e);if(o!==null&&!B3(t,e,2,2)){let e={type:`commentBlock`,children:[o],data:{sourceForm:`percent`,sourceLayout:`inline`}};n.splice(r,1,e),r+=1;continue}}if(e.type===`paragraph`&&q3(e,t)){let e=r+1;for(;e<n.length;){let r=n[e];if(r.type===`paragraph`&&q3(r,t))break;e+=1}if(e<n.length&&e>r+1){let t={type:`commentBlock`,children:n.slice(r+1,e),data:{sourceForm:`percent`,sourceLayout:`block`}};n.splice(r,e-r+1,t),r+=1;continue}}r+=1}}function z3(e,t,n,r){return A3(k3(e,t),n,r)}function B3(e,t,n,r){let i=t.children[0],a=t.children[t.children.length-1];if(i.type!==`text`||a.type!==`text`)return!1;let o=i.value.length-i.value.trimStart().length,s=a.value.trimEnd().length-r,c=k3(e,i);return A3(c,o,n)?!0:A3(a===i?c:k3(e,a),s,r)}function V3(e){if(e.children.length!==1)return null;let t=e.children[0];return t.type===`text`?t.value:null}function H3(e){let t=e.match(/^%%\n((?:.|\n(?!\n))+?)\n%%$/);return t===null?null:t[1]}function U3(e){let t=e.trim();if(!t.startsWith(`<!--`)||!t.endsWith(`-->`))return null;let n=t.slice(4,-3);if(n.includes(`-->`)||n.includes(`<!--`))return null;let r=n.trim();return r===``?null:r}function W3(e){if(e.children.length<2)return null;let t=e.children[0],n=e.children[e.children.length-1];if(t.type!==`text`||n.type!==`text`)return null;let r=t.value.trimStart();if(!r.startsWith(`<!--`))return null;let i=n.value.trimEnd();if(!i.endsWith(`-->`))return null;for(let t=0;t<e.children.length;t++){let n=e.children[t];if(n.type!==`text`)continue;let r=n.value;if(t===0){if(K3(r,`<!--`)>1||K3(r,`-->`)>0)return null}else if(t===e.children.length-1){if(K3(r,`<!--`)>0||K3(r,`-->`)>1)return null}else if(r.includes(`<!--`)||r.includes(`-->`))return null}let a=r.slice(4);a.startsWith(` `)&&(a=a.slice(1));let o=i.slice(0,-3);o.endsWith(` `)&&(o=o.slice(0,-1));let s=[];a.length>0&&s.push({...t,value:a});for(let t=1;t<e.children.length-1;t++)s.push(e.children[t]);return o.length>0&&s.push({...n,value:o}),s.length===0?null:{type:`paragraph`,children:s}}function G3(e){if(e.children.length<2)return null;let t=e.children[0],n=e.children[e.children.length-1];if(t.type!==`text`||n.type!==`text`)return null;let r=t.value.trimStart();if(!r.startsWith(`%%`)||r.startsWith(`%%%`))return null;let i=n.value.trimEnd();if(!i.endsWith(`%%`)||i.endsWith(`%%%`))return null;let a=r.slice(2);a.startsWith(` `)&&(a=a.slice(1));let o=i.slice(0,-2);if(o.endsWith(` `)&&(o=o.slice(0,-1)),a.indexOf(`%%`)!==-1||o.indexOf(`%%`)!==-1)return null;for(let t=1;t<e.children.length-1;t++){let n=e.children[t];if(n.type===`text`&&n.value.indexOf(`%%`)!==-1)return null}if(!(e.children.slice(1,-1).some(e=>e.type===`text`?e.value.trim().length>0:!0)||a.trim().length>0||o.trim().length>0))return null;let s=[];a.length>0&&s.push({...t,value:a});for(let t=1;t<e.children.length-1;t++)s.push(e.children[t]);return o.length>0&&s.push({...n,value:o}),s.length===0?null:{type:`paragraph`,children:s}}function K3(e,t){if(!t)return 0;let n=0,r=0;for(;;){let i=e.indexOf(t,r);if(i===-1)break;n+=1,r=i+t.length}return n}function q3(e,t){let n=V3(e);return n===null||n.trim()!==`%%`?!1:!z3(t,e.children[0],n.indexOf(`%%`),2)}var J3=/^([ ]{1,3})(<\/[A-Z][A-Za-z0-9_]*\s*>)([ \t]*)$/gm,Y3=/^[ ]{0,3}([-*+]|\d{1,9}[.)])([ \t]|$)/;function X3(e,t){if(t===0)return!1;let n=t-1;for(;n>=0;){let r=n;for(;r>0&&e[r-1]!==`
509
- `;)r--;let i=e.slice(r,n===t-1?n:n+1);if(i.trim().length===0){n=r-2;continue}return Y3.test(i)}return!1}function Z3(e){if(!e.includes(`</`))return e;let t=i4(e),n=!1,r=e.replace(J3,(r,i,a,o,s)=>a4(s,t)||!X3(e,s)?r:(n=!0,`${a}${o}`));return n?r:e}var Q3=/^<details(\s[^>]*)?>\s*<summary>([\s\S]*?)<\/summary>([\s\S]*?)<\/details>\s*$/,$3=/^<details(\s[^>]*)?>(?:\s*<summary>([\s\S]*?)<\/summary>)?[\s\S]*$/,e6=/^\s*<\/details>\s*$/;function t6(e){let t=!1,n=null,r=null;if(!e)return{defaultOpen:t,name:n,id:r};let i=/(\w+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'<>]+)))?/g,a=i.exec(e);for(;a!==null;){let o=a[1].toLowerCase(),s=a[2]??a[3]??a[4]??null;o===`open`?t=!0:o===`name`?n=s:o===`id`&&(r=s),a=i.exec(e)}return{defaultOpen:t,name:n,id:r}}function n6(e){let t=[];return e.title!==null&&t.push({type:`mdxJsxAttribute`,name:`title`,value:e.title}),e.defaultOpen&&t.push({type:`mdxJsxAttribute`,name:`defaultOpen`,value:null}),e.name!==null&&t.push({type:`mdxJsxAttribute`,name:`name`,value:e.name}),e.id!==null&&t.push({type:`mdxJsxAttribute`,name:`id`,value:e.id}),t}function r6(e){if(e.type!==`paragraph`)return!1;let t=e.children;return t.length===1&&t[0].type===`text`}function i6(e){return e.children[0].value??``}function a6(e){if(!r6(e))return null;let t=i6(e).match(Q3);if(!t)return null;let{defaultOpen:n,name:r,id:i}=t6(t[1]),a=t[2].trim()||null,o=t[3].trim(),s=o?[{type:`paragraph`,children:[{type:`text`,value:o}]}]:[];return{type:`mdxJsxFlowElement`,name:`HtmlDetailsAccordion`,attributes:n6({title:a,defaultOpen:n,name:r,id:i}),children:s,position:e.position}}function o6(e,t){let n=e[t];if(!r6(n))return null;let r=i6(n);if(!r.startsWith(`<details`)||r.includes(`</details>`))return null;let i=r.match($3);if(!i)return null;let{defaultOpen:a,name:o,id:s}=t6(i[1]),c=i[2]?.trim()||null;for(let n=t+1;n<e.length;n++){let t=e[n];if(!r6(t))continue;let r=i6(t);if(e6.test(r))return{closerIdx:n,title:c,defaultOpen:a,name:o,id:s};if(r.includes(`</details>`))return null}return null}function s6(e){let t=e.children,n=0;for(;n<t.length;){let e=t[n];if(r6(e)){let r=a6(e);if(r){t[n]=r,n++;continue}let i=o6(t,n);if(i){let r=e,a=t[i.closerIdx],o=n+1,s=i.closerIdx,c=t.slice(o,s),l=r.position,u=a.position,d={type:`mdxJsxFlowElement`,name:`HtmlDetailsAccordion`,attributes:n6(i),children:c,position:l&&u?{start:l.start,end:u.end}:void 0},f=i.closerIdx-n+1;t.splice(n,f,d),n++;continue}}n++}}function c6(){return e=>{D(e,e=>{`children`in e&&Array.isArray(e.children)&&s6(e)})}}var l6=/^<(div|center)(\s[^>]*?)?\s*>$/i,u6=new Set([`center`,`left`,`right`,`justify`]);function d6(e){if(!e)return null;let t=e.match(/\balign\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'<>]+))/i);if(!t)return null;let n=(t[1]??t[2]??t[3]??``).toLowerCase();return u6.has(n)?n:null}function f6(e){if(e.type!==`paragraph`)return!1;let t=e.children;return t.length===1&&t[0].type===`text`}function p6(e){return e.children[0].value??``}function m6(e){if(!f6(e))return null;let t=p6(e).trim().match(l6);if(!t)return null;let n=t[1].toLowerCase(),r=t[2]??``;return{tag:n,align:d6(r)??(n===`center`?`center`:null),sourceAttrs:r}}function h6(e,t,n){let r=new RegExp(String.raw`^\s*</${n}>\s*$`,`i`);for(let i=t+1;i<e.length;i++){let t=e[i];if(!f6(t))continue;let a=p6(t);if(r.test(a))return i;let o=a.trimStart().toLowerCase();if(o.startsWith(`<div`)||o.startsWith(`<center`)||o.includes(`</${n}>`))return null}return null}function g6(e){let t=e.children,n=0;for(;n<t.length;){let e=m6(t[n]);if(e!==null){let r=h6(t,n,e.tag);if(r!==null){let i=t[n],a=t[r],o=t.slice(n+1,r),s=i.position,c=a.position,l={type:`mdxJsxFlowElement`,name:`HtmlAlignBlock`,attributes:[...e.align===null?[]:[{type:`mdxJsxAttribute`,name:`align`,value:e.align}],{type:`mdxJsxAttribute`,name:`tag`,value:e.tag},{type:`mdxJsxAttribute`,name:`sourceAttrs`,value:e.sourceAttrs}],children:o,position:s&&c?{start:s.start,end:c.end}:void 0};t.splice(n,r-n+1,l),n++;continue}}n++}}function _6(){return e=>{D(e,e=>{`children`in e&&Array.isArray(e.children)&&g6(e)})}}var v6=`&#x20;`;function y6(e){return e.type===`listItem`&&typeof e.checked==`boolean`}function b6(e){let t=e.children??[];if(t.length!==1)return!1;let n=t[0];return n?.type===`paragraph`&&(n.children?.length??0)===0}function x6(e){let t=e.children??[];if(t.length!==1)return!1;let n=t[0];if(n?.type!==`paragraph`||(n.children?.length??0)!==1)return!1;let r=n.children[0];if(r?.type!==`text`||r.value!==v6)return!1;let i=r.data?.entityRefSpans;if(!Array.isArray(i)||i.length!==1)return!1;let a=i[0];return a?.offset===0&&a.length===6&&a.raw===v6}function S6(e){D(e,`listItem`,e=>{if(!y6(e)||!b6(e))return;let t=e.children[0];t.children=[{type:`text`,value:` `,data:{sourceRaw:v6}}]})}function C6(e){D(e,`listItem`,e=>{!y6(e)||!x6(e)||(e.children[0].children=[])})}function w6(){return e=>{C6(e)}}var T6=/(?<!=)==(?=\S)([^\n]*?[^\s=])==(?!=)/g;function E6(e){return e.type===`strong`||e.type===`emphasis`||e.type===`delete`||e.type===`inlineCode`}function D6(e){return e.type===`text`||e.type===`inlineCode`?e.value.length>0?e.value.charAt(0):null:`children`in e&&Array.isArray(e.children)&&e.children.length>0?D6(e.children[0]):null}function O6(e){if(e.type===`text`||e.type===`inlineCode`)return e.value.length>0?e.value.slice(-1):null;if(`children`in e&&Array.isArray(e.children)&&e.children.length>0){let t=e.children;return O6(t[t.length-1])}return null}function k6(e,t,n){let r={type:`text`,value:e.value.slice(t,n)},i=e.data?.entityRefSpans;if(i?.length){let e=i.filter(e=>e.offset>=t&&e.offset+e.length<=n).map(e=>({...e,offset:e.offset-t}));e.length>0&&(r.data={entityRefSpans:e})}return r}function A6(e,t){let n=e.children,r=new Map,i=e=>{let n=r.get(e);if(n!==void 0)return n;let i=k3(t,e);return r.set(e,i),i},a=0;for(;a<n.length;){let e=n[a];if(e.type!==`text`){a++;continue}let t=e.value,r=-1;for(let o=0;o<=t.length-2;o++){if(t.charCodeAt(o)!==61||t.charCodeAt(o+1)!==61||o>0&&t.charCodeAt(o-1)===61||A3(i(e),o,2))continue;let s;if(o+2<t.length)s=t.charAt(o+2);else{let e=n[a+1];if(!e)continue;s=D6(e)}if(!(s===null||/\s/.test(s))){r=o;break}}if(r===-1){a++;continue}let o=-1,s=-1,c=!1;for(let s=r+3;s<=t.length-2;s++){if(t.charCodeAt(s)!==61||t.charCodeAt(s+1)!==61||A3(i(e),s,2))continue;let r=t.charAt(s-1);if(/[\s=]/.test(r))continue;let c;if(s+2<t.length)c=t.charAt(s+2);else{let e=n[a+1];c=e?e.type===`text`?e.value[0]??null:D6(e):null}if(c!==`=`){o=-2;break}}if(o===-2){a++;continue}for(let e=a+1;e<n.length;e++){let t=n[e];if(t.type===`text`){for(let r=0;r<=t.value.length-2;r++){if(t.value.charCodeAt(r)!==61||t.value.charCodeAt(r+1)!==61||A3(i(t),r,2))continue;let a;if(r>0)a=t.value.charAt(r-1);else{let t=n[e-1];a=O6(t)}if(a===null||/[\s=]/.test(a))continue;let l;if(r+2<t.value.length)l=t.value.charAt(r+2);else{let t=n[e+1];l=t?t.type===`text`?t.value[0]??null:D6(t):null}if(l!==`=`){o=e,s=r,c=!0;break}}if(o>=0)break}else if(!E6(t))break}if(o<0){a++;continue}let l=n[o],u=t.slice(0,r),d=t.slice(r+2),f=l.value.slice(0,s),p=l.value.slice(s+2),m=[];d.length>0&&m.push(k6(e,r+2,t.length));for(let e=a+1;e<o;e++)m.push(n[e]);if(f.length>0&&m.push(k6(l,0,s)),!c){a++;continue}let h={type:`mark`,children:m},g=[];u.length>0&&g.push(k6(e,0,r)),g.push(h),p.length>0&&g.push(k6(l,s+2,l.value.length)),n.splice(a,o-a+1,...g),a+=+(u.length>0)+1}}function j6(e,t){if(`children`in e&&Array.isArray(e.children)){A6(e,t);for(let n of e.children)j6(n,t)}}function M6(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;D(e,`text`,(e,t,r)=>{if(r===void 0||t==null)return;let i=e.value;if(i.indexOf(`==`)===-1)return;let a=k3(n,e);T6.lastIndex=0;let o=[],s;for(;(s=T6.exec(i))!==null;){let e=s.index,t=e+s[0].length;if(A3(a,e,2)||A3(a,t-2,2)){T6.lastIndex=e+1;continue}o.push(s)}if(o.length===0)return;let c=[],l=0;for(let t of o){let r=t.index,i=r+t[0].length;if(r>l){let t=k6(e,l,r),i=N3(n,e,l,r);i&&(t.position=i),c.push(t)}let a=k6(e,r+2,i-2),o=N3(n,e,r+2,i-2);o&&(a.position=o);let s={type:`mark`,children:[a]},u=N3(n,e,r,i);u&&(s.position=u),c.push(s),l=i}if(l<i.length){let t=k6(e,l,i.length),r=N3(n,e,l,i.length);r&&(t.position=r),c.push(t)}return r.children.splice(t,1,...c),[g,t+c.length]}),j6(e,n),D(e,`mdxJsxTextElement`,(e,t,n)=>{if(n===void 0||t==null||e.name!==`mark`)return;let r={type:`mark`,children:e.children??[]};return n.children.splice(t,1,r),t+1})}}function N6(){return e=>{D(e,`paragraph`,(e,t,n)=>{if(!n||t==null||e.children.length!==1)return;let r=e.children[0];if(!r||r.type!==`image`)return;let i=P6(r,e);n.children[t]=i})}}function P6(e,t){let n=[{type:`mdxJsxAttribute`,name:`src`,value:e.url}];typeof e.alt==`string`&&n.push({type:`mdxJsxAttribute`,name:`alt`,value:e.alt}),e.title&&n.push({type:`mdxJsxAttribute`,name:`title`,value:e.title});let r={type:`mdxJsxFlowElement`,name:`CommonMarkImage`,attributes:n,children:[]};return t.position&&(r.position=t.position),r}var F6=/^( {4}|\t)/;function I6(e){let t=e.split(`
510
- `),n=!1;for(let e of t)if(e.length!==0&&(n=!0,!F6.test(e)))return!1;return n}function L6(e){return e.split(`
508
+ `;)r++;continue}}if(t[r]===`{`||t[r]===`}`){let e=0;for(let n=r-1;n>=0&&t[n]===`\\`;n--)e++;if(e%2==1)continue;t[r]===`{`?n.push(r):n.length>0&&n.pop()}}if(e.push(...n),e.length>0){let n=t.split(``);for(let t of e)n[t]=O4;t=n.join(``)}}return t}function X4(e){return A4.test(e)||j4.test(e)}function Z4(){return e=>{D(e,e=>{let t=e;typeof t.value==`string`&&X4(t.value)&&(t.value=Q4(t.value)),typeof t.url==`string`&&X4(t.url)&&(t.url=Q4(t.url)),typeof t.title==`string`&&X4(t.title)&&(t.title=Q4(t.title)),typeof t.alt==`string`&&X4(t.alt)&&(t.alt=Q4(t.alt)),typeof t.lang==`string`&&X4(t.lang)&&(t.lang=Q4(t.lang)),typeof t.meta==`string`&&X4(t.meta)&&(t.meta=Q4(t.meta))})}}function Q4(e){let t=e.replaceAll(w4,`<`).replaceAll(T4,`>`).replaceAll(E4,`:`).replaceAll(D4,`@`).replaceAll(O4,`{`);if(j4.test(t))for(let[e,n]of k4)t=t.replaceAll(n,e);return t}var $4=``,e3=``,t3=/&(?:[A-Za-z][A-Za-z0-9]*|#[0-9]+|#[xX][0-9A-Fa-f]+);/g;function n3(e,t){let n=0;for(let r=t-1;r>=0&&e[r]===`\\`;r--)n++;return n}function r3(e,t,n){return t.lastIndex=0,e.replace(t,(t,r)=>typeof r!=`number`||n3(e,r)%2==1?t:n(t))}function i3(e){return t3.lastIndex=0,e.replace(t3,e=>{let t=e.slice(1,-1);if(t.startsWith(`#`)){let e=t[1]===`x`||t[1]===`X`;return E(t.slice(e?2:1),e?16:10)}let n=f(t);return n===!1?e:n})}function a3(e){return r3(e,t3,e=>`${$4}${e.slice(1,-1)}${e3}`)}var o3=RegExp(`${$4}([^${e3}]+)${e3}`,`g`);function s3(e){if(!e.includes($4))return{value:e,spans:[]};let t=[],n=``,r=0;o3.lastIndex=0;let i=o3.exec(e);for(;i!==null;){i.index>r&&(n+=e.slice(r,i.index));let a=`&${i[1]??``};`;t.push({offset:n.length,length:a.length,raw:a}),n+=a,r=i.index+i[0].length,i=o3.exec(e)}return r<e.length&&(n+=e.slice(r)),{value:n,spans:t}}function c3(){return e=>{D(e,e=>{let t=e;if(typeof t.value==`string`&&t.value.includes($4)){let{value:n,spans:r}=s3(t.value);if(t.value=n,e.type===`text`&&r.length>0){let t=e;t.data??={},t.data.entityRefSpans=r}}for(let e of[`url`,`title`,`alt`,`lang`,`meta`]){let n=t[e];typeof n==`string`&&n.includes($4)&&(t[e]=s3(n).value)}})}}var l3=``,u3=/\\</g;function d3(e){return r3(e,u3,e=>`${l3}${e.slice(1)}`)}function f3(){return e=>{D(e,e=>{let t=e;typeof t.value==`string`&&t.value.includes(l3)&&(t.value=t.value.split(l3).join(``));for(let e of[`url`,`title`,`alt`]){let n=t[e];typeof n==`string`&&n.includes(l3)&&(t[e]=n.split(l3).join(``))}})}}var p3=new Set([`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`]),m3={note:`note`,tip:`tip`,important:`important`,warning:`warning`,caution:`caution`,abstract:`abstract`,info:`info`,todo:`todo`,success:`success`,question:`question`,failure:`failure`,danger:`danger`,bug:`bug`,example:`example`,quote:`quote`,summary:`abstract`,tldr:`abstract`,check:`success`,done:`success`,help:`question`,faq:`question`,fail:`failure`,missing:`failure`,error:`danger`,cite:`quote`,idea:`tip`,hint:`tip`,warn:`warning`,attention:`warning`},h3=`ok-alert`,g3=RegExp(`(?:^|\\s)${h3}-(\\w+)(?:\\s|$)`),_3=/^>\s*\[!(\w+)\]([+-])?(?:\s+(.*?))?\s*$/i;function v3(e,t){if(t<0||t>=e.length)return null;let n=e.indexOf(`
509
+ `,t),r=(n===-1?e.slice(t):e.slice(t,n)).match(_3);return r?{rawType:r[1],foldableMarker:r[2]===`+`||r[2]===`-`?r[2]:null,title:r[3]?.trim()||null}:null}function y3(e){if(e.data?.hName!==`div`)return null;let t=e.data?.hProperties?.class;if(typeof t!=`string`)return null;let n=t.match(g3);return n?n[1].toLowerCase():null}function b3(e){return m3[e.toLowerCase()]??null}function x3(e,t,n,r,i=null){let a=[{type:`mdxJsxAttribute`,name:`type`,value:t}];n&&a.push({type:`mdxJsxAttribute`,name:`title`,value:n}),i&&a.push({type:`mdxJsxAttribute`,name:`data-authored-as`,value:i}),r!==null&&(a.push({type:`mdxJsxAttribute`,name:`collapsible`,value:null}),r===`+`?a.push({type:`mdxJsxAttribute`,name:`defaultOpen`,value:null}):a.push({type:`mdxJsxAttribute`,name:`defaultOpen`,value:{type:`mdxJsxAttributeValueExpression`,value:`false`}}));let o=e.children.slice(1),s=e.position?.start.line;return{type:`mdxJsxFlowElement`,name:`GFMCallout`,attributes:a,children:n&&o.length>0&&s!==void 0&&S3(o[0],s)?o.slice(1):o,position:e.position}}function S3(e,t){if(!e||typeof e!=`object`)return!1;let n=e;if(n.type!==`paragraph`)return!1;let r=n.position?.start?.line,i=n.position?.end?.line;return r===t&&i===t}function C3(e){if(!e||typeof e!=`object`||e.type!==`paragraph`)return!1;let t=e.data?.hProperties?.class;return typeof t==`string`&&t.includes(`${h3}-title`)}function w3(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;D(e,`blockquote`,(e,t,r)=>{if(r===void 0||typeof t!=`number`)return;let i=y3(e);if(!i)return;let a=b3(i),o=null,s=null;e.position?.start?.offset!==void 0&&(s=v3(n,e.position.start.offset),s&&(o=s.title,a||=b3(s.rawType)));let c=a??`note`,l=s&&p3.has(c)?s.foldableMarker:null,u=(()=>{if(e.position?.start?.offset!==void 0){let t=v3(n,e.position.start.offset);if(t?.rawType)return t.rawType}return i})(),d=u.toLowerCase()===c?null:u;if(!C3(e.children[0]))return;let f=x3(e,c,o,l,d);r.children[t]=f})}}var T3=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"></svg>`,E3={markers:`*`,classPrefix:h3,matchCaseSensitive:!1,icons:new Proxy({},{get:()=>T3})};function D3(e,t,n){return e[t]===`\\`&&t+1<e.length&&e[t+1]===n}function O3(e,t,n,r){let i=t,a=0;for(;a<r&&i<e.length;)i+=D3(e,i,n[a])?2:1,a+=1;return i}var k3=new Set;function A3(e,t){if(!e||!t.position||typeof t.position.start?.offset!=`number`)return null;let n=t.position.start.offset,r=t.value,i=Math.min(t.position.end?.offset??e.length,n+2*r.length,e.length),a=!1;for(let t=n;t<i;t++)if(e.charCodeAt(t)===92){a=!0;break}if(!a)return k3;let o=null,s=n,c=0;for(;c<r.length&&s<e.length;){if(D3(e,s,r[c]))o===null&&(o=new Set),o.add(c),s+=2;else if(e[s]===r[c])s+=1;else break;c+=1}return o??k3}function j3(e,t,n){if(e===null||e.size===0)return!1;for(let r=0;r<n;r++)if(e.has(t+r))return!0;return!1}function M3(e,t){let n=1,r=1;for(let i=0;i<t&&i<e.length;i++)e[i]===`
510
+ `?(n+=1,r=1):r+=1;return{line:n,column:r,offset:t}}function N3(e,t,n){return{start:M3(e,t),end:M3(e,n)}}function P3(e,t,n,r){if(!e||!t.position||typeof t.position.start?.offset!=`number`)return;let i=t.position.start.offset;return N3(e,O3(e,i,t.value,n),O3(e,i,t.value,r))}var F3=/(?<!%)%%([^\n]*?[^\n%])%%(?!%)/g,I3=/<!--([\s\S]*?)-->/g;function L3(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;z3(e,n),D(e,`text`,(e,t,r)=>{if(r===void 0||t==null)return;let i=e.value;if(i.indexOf(`%%`)===-1&&i.indexOf(`<!--`)===-1)return;let a=R3(i,A3(n,e));if(a.length===0)return;let o=[],s=0;for(let t of a){if(t.start>s){let r={type:`text`,value:i.slice(s,t.start)},a=P3(n,e,s,t.start);a&&(r.position=a),o.push(r)}let r={type:`comment`,children:[{type:`text`,value:t.body}],data:{sourceForm:t.sourceForm}},a=P3(n,e,t.start,t.end);a&&(r.position=a),o.push(r),s=t.end}if(s<i.length){let t={type:`text`,value:i.slice(s)},r=P3(n,e,s,i.length);r&&(t.position=r),o.push(t)}return r.children.splice(t,1,...o),[g,t+o.length]})}}function R3(e,t){let n=[];F3.lastIndex=0;let r;for(;(r=F3.exec(e))!==null;){if(j3(t,r.index,2)||j3(t,r.index+r[0].length-2,2)){F3.lastIndex=r.index+1;continue}r[1].trim().length!==0&&n.push({start:r.index,end:r.index+r[0].length,body:r[1],sourceForm:`percent`})}I3.lastIndex=0;let i;for(;(i=I3.exec(e))!==null;){if(j3(t,i.index,4)||j3(t,i.index+i[0].length-3,3)){I3.lastIndex=i.index+1;continue}let e=i[1].trim();e!==``&&n.push({start:i.index,end:i.index+i[0].length,body:e,sourceForm:`html`})}n.sort((e,t)=>e.start-t.start);let a=[],o=-1;for(let e of n)e.start<o||(a.push(e),o=e.end);return a}function z3(e,t){let n=e.children,r=0;for(;r<n.length;){let e=n[r];if(e.type===`paragraph`){let i=H3(e);if(i!==null){let a=e.children[0],o,s=()=>(o===void 0&&(o=A3(t,a)),o),c=U3(i);if(c!==null&&!j3(s(),0,2)&&!j3(s(),i.length-2,2)){let e={type:`commentBlock`,children:[{type:`paragraph`,children:[{type:`text`,value:c}]}],data:{sourceForm:`percent`,sourceLayout:`block`}};n.splice(r,1,e),r+=1;continue}let l=W3(i);if(l!==null&&!j3(s(),i.length-i.trimStart().length,4)&&!j3(s(),i.trimEnd().length-3,3)){let e={type:`commentBlock`,children:[{type:`paragraph`,children:[{type:`text`,value:l}]}],data:{sourceForm:`html`,sourceLayout:`inline`}};n.splice(r,1,e),r+=1;continue}}let a=G3(e);if(a!==null&&!V3(t,e,4,3)){let e={type:`commentBlock`,children:[a],data:{sourceForm:`html`,sourceLayout:`inline`}};n.splice(r,1,e),r+=1;continue}let o=K3(e);if(o!==null&&!V3(t,e,2,2)){let e={type:`commentBlock`,children:[o],data:{sourceForm:`percent`,sourceLayout:`inline`}};n.splice(r,1,e),r+=1;continue}}if(e.type===`paragraph`&&J3(e,t)){let e=r+1;for(;e<n.length;){let r=n[e];if(r.type===`paragraph`&&J3(r,t))break;e+=1}if(e<n.length&&e>r+1){let t={type:`commentBlock`,children:n.slice(r+1,e),data:{sourceForm:`percent`,sourceLayout:`block`}};n.splice(r,e-r+1,t),r+=1;continue}}r+=1}}function B3(e,t,n,r){return j3(A3(e,t),n,r)}function V3(e,t,n,r){let i=t.children[0],a=t.children[t.children.length-1];if(i.type!==`text`||a.type!==`text`)return!1;let o=i.value.length-i.value.trimStart().length,s=a.value.trimEnd().length-r,c=A3(e,i);return j3(c,o,n)?!0:j3(a===i?c:A3(e,a),s,r)}function H3(e){if(e.children.length!==1)return null;let t=e.children[0];return t.type===`text`?t.value:null}function U3(e){let t=e.match(/^%%\n((?:.|\n(?!\n))+?)\n%%$/);return t===null?null:t[1]}function W3(e){let t=e.trim();if(!t.startsWith(`<!--`)||!t.endsWith(`-->`))return null;let n=t.slice(4,-3);if(n.includes(`-->`)||n.includes(`<!--`))return null;let r=n.trim();return r===``?null:r}function G3(e){if(e.children.length<2)return null;let t=e.children[0],n=e.children[e.children.length-1];if(t.type!==`text`||n.type!==`text`)return null;let r=t.value.trimStart();if(!r.startsWith(`<!--`))return null;let i=n.value.trimEnd();if(!i.endsWith(`-->`))return null;for(let t=0;t<e.children.length;t++){let n=e.children[t];if(n.type!==`text`)continue;let r=n.value;if(t===0){if(q3(r,`<!--`)>1||q3(r,`-->`)>0)return null}else if(t===e.children.length-1){if(q3(r,`<!--`)>0||q3(r,`-->`)>1)return null}else if(r.includes(`<!--`)||r.includes(`-->`))return null}let a=r.slice(4);a.startsWith(` `)&&(a=a.slice(1));let o=i.slice(0,-3);o.endsWith(` `)&&(o=o.slice(0,-1));let s=[];a.length>0&&s.push({...t,value:a});for(let t=1;t<e.children.length-1;t++)s.push(e.children[t]);return o.length>0&&s.push({...n,value:o}),s.length===0?null:{type:`paragraph`,children:s}}function K3(e){if(e.children.length<2)return null;let t=e.children[0],n=e.children[e.children.length-1];if(t.type!==`text`||n.type!==`text`)return null;let r=t.value.trimStart();if(!r.startsWith(`%%`)||r.startsWith(`%%%`))return null;let i=n.value.trimEnd();if(!i.endsWith(`%%`)||i.endsWith(`%%%`))return null;let a=r.slice(2);a.startsWith(` `)&&(a=a.slice(1));let o=i.slice(0,-2);if(o.endsWith(` `)&&(o=o.slice(0,-1)),a.indexOf(`%%`)!==-1||o.indexOf(`%%`)!==-1)return null;for(let t=1;t<e.children.length-1;t++){let n=e.children[t];if(n.type===`text`&&n.value.indexOf(`%%`)!==-1)return null}if(!(e.children.slice(1,-1).some(e=>e.type===`text`?e.value.trim().length>0:!0)||a.trim().length>0||o.trim().length>0))return null;let s=[];a.length>0&&s.push({...t,value:a});for(let t=1;t<e.children.length-1;t++)s.push(e.children[t]);return o.length>0&&s.push({...n,value:o}),s.length===0?null:{type:`paragraph`,children:s}}function q3(e,t){if(!t)return 0;let n=0,r=0;for(;;){let i=e.indexOf(t,r);if(i===-1)break;n+=1,r=i+t.length}return n}function J3(e,t){let n=H3(e);return n===null||n.trim()!==`%%`?!1:!B3(t,e.children[0],n.indexOf(`%%`),2)}var Y3=/^([ ]{1,3})(<\/[A-Z][A-Za-z0-9_]*\s*>)([ \t]*)$/gm,X3=/^[ ]{0,3}([-*+]|\d{1,9}[.)])([ \t]|$)/;function Z3(e,t){if(t===0)return!1;let n=t-1;for(;n>=0;){let r=n;for(;r>0&&e[r-1]!==`
511
+ `;)r--;let i=e.slice(r,n===t-1?n:n+1);if(i.trim().length===0){n=r-2;continue}return X3.test(i)}return!1}function Q3(e){if(!e.includes(`</`))return e;let t=r4(e),n=!1,r=e.replace(Y3,(r,i,a,o,s)=>i4(s,t)||!Z3(e,s)?r:(n=!0,`${a}${o}`));return n?r:e}var $3=/^<details(\s[^>]*)?>\s*<summary>([\s\S]*?)<\/summary>([\s\S]*?)<\/details>\s*$/,e6=/^<details(\s[^>]*)?>(?:\s*<summary>([\s\S]*?)<\/summary>)?[\s\S]*$/,t6=/^\s*<\/details>\s*$/;function n6(e){let t=!1,n=null,r=null;if(!e)return{defaultOpen:t,name:n,id:r};let i=/(\w+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'<>]+)))?/g,a=i.exec(e);for(;a!==null;){let o=a[1].toLowerCase(),s=a[2]??a[3]??a[4]??null;o===`open`?t=!0:o===`name`?n=s:o===`id`&&(r=s),a=i.exec(e)}return{defaultOpen:t,name:n,id:r}}function r6(e){let t=[];return e.title!==null&&t.push({type:`mdxJsxAttribute`,name:`title`,value:e.title}),e.defaultOpen&&t.push({type:`mdxJsxAttribute`,name:`defaultOpen`,value:null}),e.name!==null&&t.push({type:`mdxJsxAttribute`,name:`name`,value:e.name}),e.id!==null&&t.push({type:`mdxJsxAttribute`,name:`id`,value:e.id}),t}function i6(e){if(e.type!==`paragraph`)return!1;let t=e.children;return t.length===1&&t[0].type===`text`}function a6(e){return e.children[0].value??``}function o6(e){if(!i6(e))return null;let t=a6(e).match($3);if(!t)return null;let{defaultOpen:n,name:r,id:i}=n6(t[1]),a=t[2].trim()||null,o=t[3].trim(),s=o?[{type:`paragraph`,children:[{type:`text`,value:o}]}]:[];return{type:`mdxJsxFlowElement`,name:`HtmlDetailsAccordion`,attributes:r6({title:a,defaultOpen:n,name:r,id:i}),children:s,position:e.position}}function s6(e,t){let n=e[t];if(!i6(n))return null;let r=a6(n);if(!r.startsWith(`<details`)||r.includes(`</details>`))return null;let i=r.match(e6);if(!i)return null;let{defaultOpen:a,name:o,id:s}=n6(i[1]),c=i[2]?.trim()||null;for(let n=t+1;n<e.length;n++){let t=e[n];if(!i6(t))continue;let r=a6(t);if(t6.test(r))return{closerIdx:n,title:c,defaultOpen:a,name:o,id:s};if(r.includes(`</details>`))return null}return null}function c6(e){let t=e.children,n=0;for(;n<t.length;){let e=t[n];if(i6(e)){let r=o6(e);if(r){t[n]=r,n++;continue}let i=s6(t,n);if(i){let r=e,a=t[i.closerIdx],o=n+1,s=i.closerIdx,c=t.slice(o,s),l=r.position,u=a.position,d={type:`mdxJsxFlowElement`,name:`HtmlDetailsAccordion`,attributes:r6(i),children:c,position:l&&u?{start:l.start,end:u.end}:void 0},f=i.closerIdx-n+1;t.splice(n,f,d),n++;continue}}n++}}function l6(){return e=>{D(e,e=>{`children`in e&&Array.isArray(e.children)&&c6(e)})}}var u6=/^<(div|center)(\s[^>]*?)?\s*>$/i,d6=new Set([`center`,`left`,`right`,`justify`]);function f6(e){if(!e)return null;let t=e.match(/\balign\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'<>]+))/i);if(!t)return null;let n=(t[1]??t[2]??t[3]??``).toLowerCase();return d6.has(n)?n:null}function p6(e){if(e.type!==`paragraph`)return!1;let t=e.children;return t.length===1&&t[0].type===`text`}function m6(e){return e.children[0].value??``}function h6(e){if(!p6(e))return null;let t=m6(e).trim().match(u6);if(!t)return null;let n=t[1].toLowerCase(),r=t[2]??``;return{tag:n,align:f6(r)??(n===`center`?`center`:null),sourceAttrs:r}}function g6(e,t,n){let r=new RegExp(String.raw`^\s*</${n}>\s*$`,`i`);for(let i=t+1;i<e.length;i++){let t=e[i];if(!p6(t))continue;let a=m6(t);if(r.test(a))return i;let o=a.trimStart().toLowerCase();if(o.startsWith(`<div`)||o.startsWith(`<center`)||o.includes(`</${n}>`))return null}return null}function _6(e){let t=e.children,n=0;for(;n<t.length;){let e=h6(t[n]);if(e!==null){let r=g6(t,n,e.tag);if(r!==null){let i=t[n],a=t[r],o=t.slice(n+1,r),s=i.position,c=a.position,l={type:`mdxJsxFlowElement`,name:`HtmlAlignBlock`,attributes:[...e.align===null?[]:[{type:`mdxJsxAttribute`,name:`align`,value:e.align}],{type:`mdxJsxAttribute`,name:`tag`,value:e.tag},{type:`mdxJsxAttribute`,name:`sourceAttrs`,value:e.sourceAttrs}],children:o,position:s&&c?{start:s.start,end:c.end}:void 0};t.splice(n,r-n+1,l),n++;continue}}n++}}function v6(){return e=>{D(e,e=>{`children`in e&&Array.isArray(e.children)&&_6(e)})}}var y6=`&#x20;`;function b6(e){return e.type===`listItem`&&typeof e.checked==`boolean`}function x6(e){let t=e.children??[];if(t.length!==1)return!1;let n=t[0];return n?.type===`paragraph`&&(n.children?.length??0)===0}function S6(e){let t=e.children??[];if(t.length!==1)return!1;let n=t[0];if(n?.type!==`paragraph`||(n.children?.length??0)!==1)return!1;let r=n.children[0];if(r?.type!==`text`||r.value!==y6)return!1;let i=r.data?.entityRefSpans;if(!Array.isArray(i)||i.length!==1)return!1;let a=i[0];return a?.offset===0&&a.length===6&&a.raw===y6}function C6(e){D(e,`listItem`,e=>{if(!b6(e)||!x6(e))return;let t=e.children[0];t.children=[{type:`text`,value:` `,data:{sourceRaw:y6}}]})}function w6(e){D(e,`listItem`,e=>{!b6(e)||!S6(e)||(e.children[0].children=[])})}function T6(){return e=>{w6(e)}}var E6=/(?<!=)==(?=\S)([^\n]*?[^\s=])==(?!=)/g;function D6(e){return e.type===`strong`||e.type===`emphasis`||e.type===`delete`||e.type===`inlineCode`}function O6(e){return e.type===`text`||e.type===`inlineCode`?e.value.length>0?e.value.charAt(0):null:`children`in e&&Array.isArray(e.children)&&e.children.length>0?O6(e.children[0]):null}function k6(e){if(e.type===`text`||e.type===`inlineCode`)return e.value.length>0?e.value.slice(-1):null;if(`children`in e&&Array.isArray(e.children)&&e.children.length>0){let t=e.children;return k6(t[t.length-1])}return null}function A6(e,t,n){let r={type:`text`,value:e.value.slice(t,n)},i=e.data?.entityRefSpans;if(i?.length){let e=i.filter(e=>e.offset>=t&&e.offset+e.length<=n).map(e=>({...e,offset:e.offset-t}));e.length>0&&(r.data={entityRefSpans:e})}return r}function j6(e,t){let n=e.children,r=new Map,i=e=>{let n=r.get(e);if(n!==void 0)return n;let i=A3(t,e);return r.set(e,i),i},a=0;for(;a<n.length;){let e=n[a];if(e.type!==`text`){a++;continue}let t=e.value,r=-1;for(let o=0;o<=t.length-2;o++){if(t.charCodeAt(o)!==61||t.charCodeAt(o+1)!==61||o>0&&t.charCodeAt(o-1)===61||j3(i(e),o,2))continue;let s;if(o+2<t.length)s=t.charAt(o+2);else{let e=n[a+1];if(!e)continue;s=O6(e)}if(!(s===null||/\s/.test(s))){r=o;break}}if(r===-1){a++;continue}let o=-1,s=-1,c=!1;for(let s=r+3;s<=t.length-2;s++){if(t.charCodeAt(s)!==61||t.charCodeAt(s+1)!==61||j3(i(e),s,2))continue;let r=t.charAt(s-1);if(/[\s=]/.test(r))continue;let c;if(s+2<t.length)c=t.charAt(s+2);else{let e=n[a+1];c=e?e.type===`text`?e.value[0]??null:O6(e):null}if(c!==`=`){o=-2;break}}if(o===-2){a++;continue}for(let e=a+1;e<n.length;e++){let t=n[e];if(t.type===`text`){for(let r=0;r<=t.value.length-2;r++){if(t.value.charCodeAt(r)!==61||t.value.charCodeAt(r+1)!==61||j3(i(t),r,2))continue;let a;if(r>0)a=t.value.charAt(r-1);else{let t=n[e-1];a=k6(t)}if(a===null||/[\s=]/.test(a))continue;let l;if(r+2<t.value.length)l=t.value.charAt(r+2);else{let t=n[e+1];l=t?t.type===`text`?t.value[0]??null:O6(t):null}if(l!==`=`){o=e,s=r,c=!0;break}}if(o>=0)break}else if(!D6(t))break}if(o<0){a++;continue}let l=n[o],u=t.slice(0,r),d=t.slice(r+2),f=l.value.slice(0,s),p=l.value.slice(s+2),m=[];d.length>0&&m.push(A6(e,r+2,t.length));for(let e=a+1;e<o;e++)m.push(n[e]);if(f.length>0&&m.push(A6(l,0,s)),!c){a++;continue}let h={type:`mark`,children:m},g=[];u.length>0&&g.push(A6(e,0,r)),g.push(h),p.length>0&&g.push(A6(l,s+2,l.value.length)),n.splice(a,o-a+1,...g),a+=+(u.length>0)+1}}function M6(e,t){if(`children`in e&&Array.isArray(e.children)){j6(e,t);for(let n of e.children)M6(n,t)}}function N6(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;D(e,`text`,(e,t,r)=>{if(r===void 0||t==null)return;let i=e.value;if(i.indexOf(`==`)===-1)return;let a=A3(n,e);E6.lastIndex=0;let o=[],s;for(;(s=E6.exec(i))!==null;){let e=s.index,t=e+s[0].length;if(j3(a,e,2)||j3(a,t-2,2)){E6.lastIndex=e+1;continue}o.push(s)}if(o.length===0)return;let c=[],l=0;for(let t of o){let r=t.index,i=r+t[0].length;if(r>l){let t=A6(e,l,r),i=P3(n,e,l,r);i&&(t.position=i),c.push(t)}let a=A6(e,r+2,i-2),o=P3(n,e,r+2,i-2);o&&(a.position=o);let s={type:`mark`,children:[a]},u=P3(n,e,r,i);u&&(s.position=u),c.push(s),l=i}if(l<i.length){let t=A6(e,l,i.length),r=P3(n,e,l,i.length);r&&(t.position=r),c.push(t)}return r.children.splice(t,1,...c),[g,t+c.length]}),M6(e,n),D(e,`mdxJsxTextElement`,(e,t,n)=>{if(n===void 0||t==null||e.name!==`mark`)return;let r={type:`mark`,children:e.children??[]};return n.children.splice(t,1,r),t+1})}}function P6(){return e=>{D(e,`paragraph`,(e,t,n)=>{if(!n||t==null||e.children.length!==1)return;let r=e.children[0];if(!r||r.type!==`image`)return;let i=F6(r,e);n.children[t]=i})}}function F6(e,t){let n=[{type:`mdxJsxAttribute`,name:`src`,value:e.url}];typeof e.alt==`string`&&n.push({type:`mdxJsxAttribute`,name:`alt`,value:e.alt}),e.title&&n.push({type:`mdxJsxAttribute`,name:`title`,value:e.title});let r={type:`mdxJsxFlowElement`,name:`CommonMarkImage`,attributes:n,children:[]};return t.position&&(r.position=t.position),r}var I6=/^( {4}|\t)/;function L6(e){let t=e.split(`
512
+ `),n=!1;for(let e of t)if(e.length!==0&&(n=!0,!I6.test(e)))return!1;return n}function R6(e){return e.split(`
511
513
  `).map(e=>e.length===0?e:e.startsWith(` `)?e.slice(4):e.startsWith(` `)?e.slice(1):e).join(`
512
- `)}function R6(e,t){let n=e.position;if(!n||typeof n.start.offset!=`number`||typeof n.end.offset!=`number`)return null;let r=n.start.offset,i=n.end.offset;if(r<0||i>t.length||r>=i)return null;let a=r;for(;a>0&&t[a-1]!==`
513
- `;)a--;if(a===r)return null;let o=t.slice(a,r);if(!F6.test(o))return null;let s=t.slice(a,i);if(!I6(s))return null;let c={start:{line:n.start.line,column:1,offset:a},end:n.end};return{type:`code`,lang:null,meta:null,value:L6(s).replace(/\n+$/,``),position:c,data:{sourceStyle:`indented`}}}var z6=function(){return(e,t)=>{let n=String(t.value??``);n&&D(e,`paragraph`,(e,t,r)=>{if(!r||r.type!==`root`||t==null)return;let i=r.children[t-1];if(i&&i.type===`list`)return;let a=R6(e,n);a&&(r.children[t]=a)})}},B6=3,V6=/^\n+$/;function H6(e){return e.length<B6||!V6.test(e)?0:e.length-2}function U6(e,t){let n=[],r=e.children;for(let e=1;e<r.length;e++){let i=r[e-1],a=r[e],o=i?.position?.end?.offset,s=i?.position?.end?.line,c=a?.position?.start?.offset;if(typeof o!=`number`||typeof c!=`number`||typeof s!=`number`||c<o)continue;let l=H6(t.slice(o,c));if(l===0)continue;let u=[],d=[];for(let e=0;e<l;e++)u.push(s+2+e),d.push(o+2+e);n.push({beforeChildIndex:e,lines:u,offsets:d})}return n}function W6(e,t){let n=U6(e,t);if(n.length===0)return;let r=[],i=0;for(let t=0;t<e.children.length;t++){let a=n[i];if(a&&a.beforeChildIndex===t){for(let e=0;e<a.lines.length;e++)r.push(G6(a.lines[e],a.offsets[e]));i+=1}r.push(e.children[t])}e.children=r}function G6(e,t){let n={line:e,column:1,offset:t};return{type:`paragraph`,children:[],position:{start:n,end:{...n}}}}function K6(e,t,n){let r={type:`mdxJsxFlowElement`,name:e,attributes:[{type:`mdxJsxAttribute`,name:`formula`,value:t}],children:[]};return n&&(r.position=n),r}function q6(){return e=>{D(e,`math`,(e,t,n)=>{if(!n||t==null)return;let r=K6(`DollarMath`,typeof e.value==`string`?e.value:``,e.position);n.children[t]=r}),D(e,`code`,(e,t,n)=>{if(!n||t==null||e.lang!==`math`)return;let r=K6(`MathFence`,typeof e.value==`string`?e.value:``,e.position);n.children[t]=r})}}var J6=/<([a-zA-Z][a-zA-Z0-9+.-]*:[^\s<>]+)>/g;function Y6(e,t=``){let n=[],r=!1;for(let i of e.children){if(i.type!==`text`){n.push(i);continue}let e=i.value;J6.lastIndex=0;let a=[],o=0;for(;;){let n=J6.exec(e);if(n===null)break;let s=n[0],c=n[1],l=n.index;if(l>o){let n={type:`text`,value:e.slice(o,l)},r=N3(t,i,o,l);r&&(n.position=r),a.push(n)}let u={type:`text`,value:c},d=N3(t,i,l+1,l+1+c.length);d&&(u.position=d);let f={type:`link`,url:c,title:null,children:[u],data:{sourceStyle:`autolink`}},p=N3(t,i,l,l+s.length);p&&(f.position=p),a.push(f),o=l+s.length,r=!0}if(a.length===0)n.push(i);else{if(o<e.length){let n={type:`text`,value:e.slice(o)},r=N3(t,i,o,e.length);r&&(n.position=r),a.push(n)}n.push(...a)}}r&&(e.children=n)}var X6=new Set(`!"#$%&'()*+,-./:;<=>?@[\\]^_\`{|}~`.split(``));function Z6(e){let t=[],n=``;for(let r=0;r<e.length;r++){let i=e[r];if(i===`\\`&&r+1<e.length&&e[r+1]===`|`){n+=`${i}|`,r++;continue}if(i===`|`){t.push(n),n=``;continue}n+=i}return t.push(n),t}function Q6(e,t,n=!1,r){if(!t)return;let i=e.position;if(!i||typeof i.start?.offset!=`number`){n&&console.warn(`[position-slice] node type=${e.type} has no position — fidelity defaults apply`);return}let a=i.start.offset,o=i.end?.offset??a;if(a<0||o>t.length){n&&console.warn(`[position-slice] node type=${e.type} position out of bounds: start=${a} end=${o} sourceLen=${t.length}`);return}switch(e.data??={},e.type){case`text`:{let n=t.slice(a,o),r=e.value??``;if(n.length>r.length&&n.includes(`\\`)){let t=[],i=0,a=0;for(;i<n.length&&a<r.length;)n[i]===`\\`&&i+1<n.length&&X6.has(n[i+1])&&r[a]===n[i+1]?(t.push({offset:a,char:n[i+1]}),i+=2,a+=1):(i++,a++);t.length>0&&(e.data.escapedChars=t)}n.endsWith(`\\`)&&r.endsWith(`\\`)&&(e.data.sourceRaw=n);break}case`emphasis`:{let n=t[a];(n===`*`||n===`_`)&&(e.data.sourceDelimiter=n);break}case`strong`:{let n=t.slice(a,a+2);(n===`**`||n===`__`)&&(e.data.sourceDelimiter=n);break}case`heading`:{let n=t[a],i=t.slice(a,o);if(n===`#`){if(e.data.sourceStyle=`atx`,r?.type===`root`){let n=a;for(;n>0&&t[n-1]!==`
514
+ `)}function z6(e,t){let n=e.position;if(!n||typeof n.start.offset!=`number`||typeof n.end.offset!=`number`)return null;let r=n.start.offset,i=n.end.offset;if(r<0||i>t.length||r>=i)return null;let a=r;for(;a>0&&t[a-1]!==`
515
+ `;)a--;if(a===r)return null;let o=t.slice(a,r);if(!I6.test(o))return null;let s=t.slice(a,i);if(!L6(s))return null;let c={start:{line:n.start.line,column:1,offset:a},end:n.end};return{type:`code`,lang:null,meta:null,value:R6(s).replace(/\n+$/,``),position:c,data:{sourceStyle:`indented`}}}var B6=function(){return(e,t)=>{let n=String(t.value??``);n&&D(e,`paragraph`,(e,t,r)=>{if(!r||r.type!==`root`||t==null)return;let i=r.children[t-1];if(i&&i.type===`list`)return;let a=z6(e,n);a&&(r.children[t]=a)})}},V6=3,H6=/^\n+$/;function U6(e){return e.length<V6||!H6.test(e)?0:e.length-2}function W6(e,t){let n=[],r=e.children;for(let e=1;e<r.length;e++){let i=r[e-1],a=r[e],o=i?.position?.end?.offset,s=i?.position?.end?.line,c=a?.position?.start?.offset;if(typeof o!=`number`||typeof c!=`number`||typeof s!=`number`||c<o)continue;let l=U6(t.slice(o,c));if(l===0)continue;let u=[],d=[];for(let e=0;e<l;e++)u.push(s+2+e),d.push(o+2+e);n.push({beforeChildIndex:e,lines:u,offsets:d})}return n}function G6(e,t){let n=W6(e,t);if(n.length===0)return;let r=[],i=0;for(let t=0;t<e.children.length;t++){let a=n[i];if(a&&a.beforeChildIndex===t){for(let e=0;e<a.lines.length;e++)r.push(K6(a.lines[e],a.offsets[e]));i+=1}r.push(e.children[t])}e.children=r}function K6(e,t){let n={line:e,column:1,offset:t};return{type:`paragraph`,children:[],position:{start:n,end:{...n}}}}function q6(e,t,n){let r={type:`mdxJsxFlowElement`,name:e,attributes:[{type:`mdxJsxAttribute`,name:`formula`,value:t}],children:[]};return n&&(r.position=n),r}function J6(){return e=>{D(e,`math`,(e,t,n)=>{if(!n||t==null)return;let r=q6(`DollarMath`,typeof e.value==`string`?e.value:``,e.position);n.children[t]=r}),D(e,`code`,(e,t,n)=>{if(!n||t==null||e.lang!==`math`)return;let r=q6(`MathFence`,typeof e.value==`string`?e.value:``,e.position);n.children[t]=r})}}var Y6=/<([a-zA-Z][a-zA-Z0-9+.-]*:[^\s<>]+)>/g;function X6(e,t=``){let n=[],r=!1;for(let i of e.children){if(i.type!==`text`){n.push(i);continue}let e=i.value;Y6.lastIndex=0;let a=[],o=0;for(;;){let n=Y6.exec(e);if(n===null)break;let s=n[0],c=n[1],l=n.index;if(l>o){let n={type:`text`,value:e.slice(o,l)},r=P3(t,i,o,l);r&&(n.position=r),a.push(n)}let u={type:`text`,value:c},d=P3(t,i,l+1,l+1+c.length);d&&(u.position=d);let f={type:`link`,url:c,title:null,children:[u],data:{sourceStyle:`autolink`}},p=P3(t,i,l,l+s.length);p&&(f.position=p),a.push(f),o=l+s.length,r=!0}if(a.length===0)n.push(i);else{if(o<e.length){let n={type:`text`,value:e.slice(o)},r=P3(t,i,o,e.length);r&&(n.position=r),a.push(n)}n.push(...a)}}r&&(e.children=n)}var Z6=new Set(`!"#$%&'()*+,-./:;<=>?@[\\]^_\`{|}~`.split(``));function Q6(e){let t=[],n=``;for(let r=0;r<e.length;r++){let i=e[r];if(i===`\\`&&r+1<e.length&&e[r+1]===`|`){n+=`${i}|`,r++;continue}if(i===`|`){t.push(n),n=``;continue}n+=i}return t.push(n),t}function $6(e,t,n=!1,r){if(!t)return;let i=e.position;if(!i||typeof i.start?.offset!=`number`){n&&console.warn(`[position-slice] node type=${e.type} has no position — fidelity defaults apply`);return}let a=i.start.offset,o=i.end?.offset??a;if(a<0||o>t.length){n&&console.warn(`[position-slice] node type=${e.type} position out of bounds: start=${a} end=${o} sourceLen=${t.length}`);return}switch(e.data??={},e.type){case`text`:{let n=t.slice(a,o),r=e.value??``;if(n.length>r.length&&n.includes(`\\`)){let t=[],i=0,a=0;for(;i<n.length&&a<r.length;)n[i]===`\\`&&i+1<n.length&&Z6.has(n[i+1])&&r[a]===n[i+1]?(t.push({offset:a,char:n[i+1]}),i+=2,a+=1):(i++,a++);t.length>0&&(e.data.escapedChars=t)}n.endsWith(`\\`)&&r.endsWith(`\\`)&&(e.data.sourceRaw=n);break}case`emphasis`:{let n=t[a];(n===`*`||n===`_`)&&(e.data.sourceDelimiter=n);break}case`strong`:{let n=t.slice(a,a+2);(n===`**`||n===`__`)&&(e.data.sourceDelimiter=n);break}case`heading`:{let n=t[a],i=t.slice(a,o);if(n===`#`){if(e.data.sourceStyle=`atx`,r?.type===`root`){let n=a;for(;n>0&&t[n-1]!==`
514
516
  `;)n--;let r=t.slice(n,a);r.length>=1&&r.length<=3&&/^ +$/.test(r)&&(e.data.sourceLeadingIndent=r.length)}let n=/^#+( {2,})[^ ]/.exec(i);n&&(e.data.sourceInteriorSpacing=n[1].length);let o=/^.*?[ \t](#+)[ \t]*$/.exec(i);o&&(e.data.sourceTrailingHashes=o[1].length)}else{let t=/\n(=+)[ \t]*$/.exec(i),n=/\n(-+)[ \t]*$/.exec(i),r=t??n;r?(e.data.sourceStyle=`setext`,e.data.sourceUnderlineLength=r[1].length):e.data.sourceStyle=`atx`}break}case`blockquote`:{let n=a;for(;n>0&&t[n-1]!==`
515
517
  `;)n--;let r=!1;for(let e=n;e<a;e++)if(t[e]===`>`){r=!0;break}let i=t.slice(a,o).split(`
516
518
  `),s=[];for(let e=0;e<i.length;e++){let t=i[e];if(t.trim().length===0)continue;if(r&&e>0)break;let n=t.replace(/^ {1,3}/,``);if(n[0]!==`>`){e>0&&t.trimStart()[0]!==`>`&&s.push(`lazy`);continue}if(n.slice(1).trimEnd()!==``)if(n[1]===` `)s.push(1);else{let e=0;for(;n[1+e]===` `;)e++;s.push(e)}}s.length>0&&(e.data.sourceMarkerSpacings=s);break}case`list`:{let n=e.children?.[0];if(n?.position?.start?.offset!=null){let r=n.position.start.offset;if(r>=0&&r<t.length){let n=t[r];if(!e.ordered&&(n===`-`||n===`*`||n===`+`))e.data.bulletMarker=n;else if(e.ordered){let n=t.slice(r,Math.min(r+10,t.length)).match(/^\d+([.)])/);n&&(e.data.listMarkerDelimiter=n[1])}}}break}case`listItem`:{let n=t.slice(a,o),r=/^(?:([-+*])|(\d{1,9})[.)])( *)/.exec(n);if(!r)break;let s=r[1]?1:(r[2]?.length??0)+1,c=r[3].length;c>=2&&c<=4&&(e.data.sourceMarkerSpacing=c),r[2]&&(e.data.sourceOrdinal=Number.parseInt(r[2],10)),e.checked!=null&&/^\[([xX])\] /.exec(n.slice(s+Math.max(c,1)))?.[1]===`X`&&(e.data.sourceCheckboxChar=`X`);let l=s+(c>=2&&c<=4?c:1),u=a;for(;u>0&&t[u-1]!==`
@@ -520,24 +522,24 @@ Read more at https://docs.orama.com/docs/orama-js/plugins/plugin-secure-proxy#pl
520
522
  `),r=(e.value??``).split(`
521
523
  `);if(n.length===r.length){let t=[],i=!1,a=!0;for(let e=0;e<n.length;e++){let o=n[e],s=r[e];if(!o.endsWith(s)){a=!1;break}let c=o.slice(0,o.length-s.length);if(!/^[ \t]*$/.test(c)){a=!1;break}t.push(c),c!==(s.length>0?` `:``)&&(i=!0)}a&&i&&(e.data.sourceIndents=t)}}break}case`inlineCode`:{let n=t[a];if(n==="`"||n===`~`){e.data.sourceFenceChar=n;let r=0;for(;a+r<t.length&&t[a+r]===n;)r++;r>=1&&(e.data.sourceFenceLength=r);let i=t.slice(a+r,o-r),s=e.value??``;i!==s&&i===` ${s} `&&(e.data.sourcePadded=!0)}break}case`inlineMath`:if(t[a]===`$`){let n=0;for(;a+n<t.length&&t[a+n]===`$`;)n++;e.data.sourceDelimiter=`$`.repeat(n)}break;case`thematicBreak`:e.data.sourceRaw=t.slice(a,o);break;case`table`:{let n=t.slice(a,o),r=n.indexOf(`
522
524
  `);if(r===-1)break;let i=n.slice(r+1),s=i.indexOf(`
523
- `),c=s===-1?i:i.slice(0,s),l=c.trim().replace(/^\|/,``).replace(/\|$/,``).split(`|`),u=[];for(let e of l){let t=e.match(/-/g);u.push(t?t.length:0)}u.some(e=>e>0)&&(e.data.sourceDashCounts=u);{let t=c.trim(),n=Z6(t);n.length>0&&n[0]===``&&t.startsWith(`|`)&&n.shift(),n.length>0&&n[n.length-1]===``&&t.endsWith(`|`)&&n.pop();let r=n.every(e=>/^[-: ]+$/.test(e)),i=[];for(let e of n){let t=0;for(;t<e.length&&e[t]===` `;)t++;let n=0;for(;n<e.length-t&&e[e.length-1-n]===` `;)n++;i.push({left:t,right:n})}r&&i.length>0&&(e.data.sourceAlignmentPadding=i)}{let t=n.split(`
525
+ `),c=s===-1?i:i.slice(0,s),l=c.trim().replace(/^\|/,``).replace(/\|$/,``).split(`|`),u=[];for(let e of l){let t=e.match(/-/g);u.push(t?t.length:0)}u.some(e=>e>0)&&(e.data.sourceDashCounts=u);{let t=c.trim(),n=Q6(t);n.length>0&&n[0]===``&&t.startsWith(`|`)&&n.shift(),n.length>0&&n[n.length-1]===``&&t.endsWith(`|`)&&n.pop();let r=n.every(e=>/^[-: ]+$/.test(e)),i=[];for(let e of n){let t=0;for(;t<e.length&&e[t]===` `;)t++;let n=0;for(;n<e.length-t&&e[e.length-1-n]===` `;)n++;i.push({left:t,right:n})}r&&i.length>0&&(e.data.sourceAlignmentPadding=i)}{let t=n.split(`
524
526
  `).filter(e=>e.trim().length>0);if(t.length>=2){let n=t.map(e=>e.trimStart().startsWith(`|`)),r=t.map(e=>/(^|[^\\])\|$/.test(e.trimEnd())),i=n.every(e=>e===n[0]),a=r.every(e=>e===r[0]);if(i&&a){let t=n[0],i=r[0];(!t||!i)&&(e.data.sourceOuterPipes={leading:t,trailing:i})}}}for(let n of e.children??[]){if(n.type!==`tableRow`||!n.position)continue;let e=n.position.start.offset,r=n.position.end.offset;if(typeof e!=`number`||typeof r!=`number`)continue;let i=t.slice(e,r),a=i.indexOf(`
525
- `);a!==-1&&(i=i.slice(0,a));let o=Z6(i);o.length>0&&o[0]===``&&i.startsWith(`|`)&&o.shift(),o.length>0&&o[o.length-1]===``&&i.endsWith(`|`)&&o.pop();let s=n.children??[],c=Math.min(s.length,o.length);for(let e=0;e<c;e++){let t=s[e];if(t.type!==`tableCell`)continue;let n=o[e],r=0;for(;r<n.length&&n[r]===` `;)r++;let i=0;for(;i<n.length-r&&n[n.length-1-i]===` `;)i++;t.data||={},t.data.sourcePadding={left:r,right:i}}}break}case`link`:case`linkReference`:if(`children`in e&&e.children.length===0&&(e.data.sourceRaw=t.slice(a,o)),e.type===`link`){let n=t[a];if(n!==`[`&&n!==`<`&&!e.title)e.data.sourceStyle=`gfm-autolink`;else if(n===`[`){let n=t.slice(a,o),r=n.lastIndexOf(`](`);if(r!==-1){let t=r+2;for(;t<n.length&&(n[t]===` `||n[t]===` `);)t++;if(n[t]===`<`&&(e.data.sourceUrlForm=`angle-bracketed`),e.title!==void 0&&e.title!==null&&n[n.length-1]===`)`){let t=n.length-2;for(;t>r+1&&(n[t]===` `||n[t]===` `||n[t]===`
527
+ `);a!==-1&&(i=i.slice(0,a));let o=Q6(i);o.length>0&&o[0]===``&&i.startsWith(`|`)&&o.shift(),o.length>0&&o[o.length-1]===``&&i.endsWith(`|`)&&o.pop();let s=n.children??[],c=Math.min(s.length,o.length);for(let e=0;e<c;e++){let t=s[e];if(t.type!==`tableCell`)continue;let n=o[e],r=0;for(;r<n.length&&n[r]===` `;)r++;let i=0;for(;i<n.length-r&&n[n.length-1-i]===` `;)i++;t.data||={},t.data.sourcePadding={left:r,right:i}}}break}case`link`:case`linkReference`:if(`children`in e&&e.children.length===0&&(e.data.sourceRaw=t.slice(a,o)),e.type===`link`){let n=t[a];if(n!==`[`&&n!==`<`&&!e.title)e.data.sourceStyle=`gfm-autolink`;else if(n===`[`){let n=t.slice(a,o),r=n.lastIndexOf(`](`);if(r!==-1){let t=r+2;for(;t<n.length&&(n[t]===` `||n[t]===` `);)t++;if(n[t]===`<`&&(e.data.sourceUrlForm=`angle-bracketed`),e.title!==void 0&&e.title!==null&&n[n.length-1]===`)`){let t=n.length-2;for(;t>r+1&&(n[t]===` `||n[t]===` `||n[t]===`
526
528
  `);)t--;n[t]===`"`?e.data.sourceTitleMarker=`double`:n[t]===`'`?e.data.sourceTitleMarker=`single`:n[t]===`)`&&(e.data.sourceTitleMarker=`paren`)}}}}break;case`definition`:{let n=t.slice(a,o);if(e.data.sourceLayout=n.includes(`
527
- `)?`multiline`:`inline`,typeof e.title==`string`&&n.length>0){let t=n[n.length-1];t===`"`?e.data.sourceTitleMarker=`double`:t===`'`?e.data.sourceTitleMarker=`single`:t===`)`&&(e.data.sourceTitleMarker=`paren`)}break}case`mdxJsxFlowElement`:case`mdxJsxTextElement`:case`mdxFlowExpression`:case`mdxTextExpression`:e.data.sourceRaw=t.slice(a,o);break;case`break`:if(e.data.sourceRaw)break;t.slice(a,o).includes(`\\`)?e.data.sourceStyle=`backslash`:e.data.sourceStyle=`spaces`;break}}var $6=`(^|\\s)#([a-zA-Z][\\w/-]*)`;function e8(){return new RegExp($6,`g`)}var t8=e8(),n8=/^[a-zA-Z][\w/-]*$/;function r8(e,t){if(t<=0||e[t-1]!==`\\`)return!1;let n=t-1,r=0;for(;n>=0&&e[n]===`\\`;)r++,n--;return r%2==1}function i8(e,t=``){let n=[],r=!1;for(let i of e.children){if(i.type!==`text`){n.push(i);continue}let e=i.value,a=typeof i.position?.start?.offset==`number`?i.position?.start?.offset??0:0;t8.lastIndex=0;let o=[],s=0;for(;;){let n=t8.exec(e);if(n===null)break;let c=n[1]??``,l=n[2]??``,u=n.index+c.length;if(t&&a>=0){let n=a,r=0,i=-1;for(;r<=u&&n<t.length;){let a=t[n]===`\\`&&n+1<t.length&&e[r]===t[n+1],o=a?n+1:n;if(r===u){i=o;break}n=a?n+2:n+1,r+=1}if(i>=0&&r8(t,i))continue}if(u>s){let n={type:`text`,value:e.slice(s,u)},r=N3(t,i,s,u);r&&(n.position=r),o.push(n)}let d={type:`tag`,value:l},f=N3(t,i,u,u+1+l.length);f&&(d.position=f),o.push(d),s=u+1+l.length,r=!0}if(o.length===0)n.push(i);else{if(s<e.length){let n={type:`text`,value:e.slice(s)},r=N3(t,i,s,e.length);r&&(n.position=r),o.push(n)}n.push(...o)}}r&&(e.children=n)}var a8=new Set(`root.paragraph.heading.text.emphasis.strong.blockquote.list.listItem.code.inlineCode.link.image.linkReference.imageReference.definition.html.thematicBreak.break.yaml.toml.table.tableRow.tableCell.delete.footnoteDefinition.footnoteReference.mdxFlowExpression.mdxJsxFlowElement.mdxJsxTextElement.mdxTextExpression.wikiLink.wikiLinkEmbed.tag.math.inlineMath.mark.comment.commentBlock.rawMdxFallbackMdast`.split(`.`));function o8(e,t){if(!e||typeof e!=`object`)return null;if(typeof e.offset==`number`)return e.offset>=0&&e.offset<=t.length?e.offset:null;let{line:n,column:r}=e;if(typeof n!=`number`||typeof r!=`number`||n<1||r<1)return null;let i=0;for(let e=1;e<n;e++){let e=t.indexOf(`
529
+ `)?`multiline`:`inline`,typeof e.title==`string`&&n.length>0){let t=n[n.length-1];t===`"`?e.data.sourceTitleMarker=`double`:t===`'`?e.data.sourceTitleMarker=`single`:t===`)`&&(e.data.sourceTitleMarker=`paren`)}break}case`mdxJsxFlowElement`:case`mdxJsxTextElement`:case`mdxFlowExpression`:case`mdxTextExpression`:e.data.sourceRaw=t.slice(a,o);break;case`break`:if(e.data.sourceRaw)break;t.slice(a,o).includes(`\\`)?e.data.sourceStyle=`backslash`:e.data.sourceStyle=`spaces`;break}}var e8=`(^|\\s)#([a-zA-Z][\\w/-]*)`;function t8(){return new RegExp(e8,`g`)}var n8=t8(),r8=/^[a-zA-Z][\w/-]*$/;function i8(e,t){if(t<=0||e[t-1]!==`\\`)return!1;let n=t-1,r=0;for(;n>=0&&e[n]===`\\`;)r++,n--;return r%2==1}function a8(e,t=``){let n=[],r=!1;for(let i of e.children){if(i.type!==`text`){n.push(i);continue}let e=i.value,a=typeof i.position?.start?.offset==`number`?i.position?.start?.offset??0:0;n8.lastIndex=0;let o=[],s=0;for(;;){let n=n8.exec(e);if(n===null)break;let c=n[1]??``,l=n[2]??``,u=n.index+c.length;if(t&&a>=0){let n=a,r=0,i=-1;for(;r<=u&&n<t.length;){let a=t[n]===`\\`&&n+1<t.length&&e[r]===t[n+1],o=a?n+1:n;if(r===u){i=o;break}n=a?n+2:n+1,r+=1}if(i>=0&&i8(t,i))continue}if(u>s){let n={type:`text`,value:e.slice(s,u)},r=P3(t,i,s,u);r&&(n.position=r),o.push(n)}let d={type:`tag`,value:l},f=P3(t,i,u,u+1+l.length);f&&(d.position=f),o.push(d),s=u+1+l.length,r=!0}if(o.length===0)n.push(i);else{if(s<e.length){let n={type:`text`,value:e.slice(s)},r=P3(t,i,s,e.length);r&&(n.position=r),o.push(n)}n.push(...o)}}r&&(e.children=n)}var o8=new Set(`root.paragraph.heading.text.emphasis.strong.blockquote.list.listItem.code.inlineCode.link.image.linkReference.imageReference.definition.html.thematicBreak.break.yaml.toml.table.tableRow.tableCell.delete.footnoteDefinition.footnoteReference.mdxFlowExpression.mdxJsxFlowElement.mdxJsxTextElement.mdxTextExpression.wikiLink.wikiLinkEmbed.tag.math.inlineMath.mark.comment.commentBlock.rawMdxFallbackMdast`.split(`.`));function s8(e,t){if(!e||typeof e!=`object`)return null;if(typeof e.offset==`number`)return e.offset>=0&&e.offset<=t.length?e.offset:null;let{line:n,column:r}=e;if(typeof n!=`number`||typeof r!=`number`||n<1||r<1)return null;let i=0;for(let e=1;e<n;e++){let e=t.indexOf(`
528
530
  `,i);if(e===-1)return null;i=e+1}let a=t.indexOf(`
529
- `,i),o=a===-1?t.length:a,s=i+r-1;return s<=o?s:null}function s8(e,t){if(!e)return null;let n=o8(e.start,t),r=o8(e.end,t);return n===null||r===null||r<n?null:t.slice(n,r)}function c8(e,t){let n=s8(e.position,t);return{type:`rawMdxFallbackMdast`,originalType:e.type??`unknown`,value:n??``,unresolvedPosition:n===null,position:e.position}}function l8(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``,r=typeof process<`u`&&{}?.OK_DEBUG_POSITION_SLICE===`1`;D(e,(e,t,i)=>{if(i!==void 0&&typeof t==`number`&&typeof e.type==`string`&&!a8.has(e.type)){let r=c8(e,n);return i.children[t]=r,g}if(`children`in e&&Array.isArray(e.children)){let t=e;t.children.some(e=>e.type===`text`)&&(Y6(t,n),i8(t,n))}if(Q6(e,n,r,i),e.type===`heading`&&i!==void 0&&typeof t==`number`){let n=e.position?.end?.line,r=i.children[t+1],a=r?.position?.start?.line;if(r?.type===`paragraph`&&typeof n==`number`&&typeof a==`number`&&a===n+1){let t=e;t.data??={},t.data.sourceContiguousNext=!0}}})}}function u8(e,t){let n={type:`mdxJsxFlowElement`,name:`MermaidFence`,attributes:[{type:`mdxJsxAttribute`,name:`chart`,value:e}],children:[]};return t&&(n.position=t),n}function d8(){return e=>{D(e,`code`,(e,t,n)=>{if(!n||t==null||e.lang!==`mermaid`)return;let r=u8(typeof e.value==`string`?e.value:``,e.position);n.children[t]=r})}}function f8(e){return e.data?.sourceRaw}function p8(e){return e.type===`text`?e.value===``:e.type===`mdxJsxTextElement`?f8(e)===``:!1}function m8(e){return e.type===`paragraph`?(e.children??[]).every(p8):!1}function h8(e){let t=e.children??[],n=t[0]?.children?.length??0,r=0;for(let e=1;e<t.length;e++)r=Math.max(r,t[e]?.children?.length??0);let i=e.align??[];return Math.max(n,r,i.length)}function g8(e){switch(e.type){case`table`:return h8(e)===0;case`code`:return e.data?.sourceStyle===`indented`&&/^\n*$/.test(e.value??``);case`thematicBreak`:return f8(e)===``;case`html`:return(e.value??``)===``;case`mdxJsxFlowElement`:return f8(e)===void 0&&e.data?.htmlBoundary===void 0&&(e.children??[]).length===0&&!e.name;case`list`:return(e.children??[]).length===0;default:return!1}}function _8(e){let t=[];for(let n of e.children){if(n.type===`table`&&h8(n)===0){console.warn(JSON.stringify({event:`table-serialize-dropped-empty`,rows:(n.children??[]).length}));continue}g8(n)||(n.type===`paragraph`&&n.children.length>0&&m8(n)&&(n.children=[]),t.push(n))}e.children=t}function v8(e,t){let n=e,r=t;return n.type===`heading`&&n.data?.sourceContiguousNext===!0&&r.type===`paragraph`}var y8=(e,t)=>{if(m8(e)||v8(e,t))return 0;let n=e.position,r=t.position;if(!n||!r)return;let i=r.start.line-n.end.line-1;return i>=1?i:void 0},b8=rI(),x8=SF(),S8=CF();function C8(){let e=this.data();e.micromarkExtensions||=[],e.fromMarkdownExtensions||=[],e.toMarkdownExtensions||=[];let t=e.micromarkExtensions;t.some(e=>e===b8)||t.push(b8);let n=e.fromMarkdownExtensions;n.some(e=>e===x8)||n.push(x8);let r=e.toMarkdownExtensions;r.some(e=>e===S8)||r.push(S8)}var w8=/(?<!\\)\$(?=\S)([^$\n]*?[^\s$])\$(?!\d)/g;function T8(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;D(e,`text`,(e,t,r)=>{if(r===void 0||t==null)return;let i=e.value;if(i.indexOf(`$`)===-1)return;let a=k3(n,e);w8.lastIndex=0;let o=[],s;for(;(s=w8.exec(i))!==null;){let e=s.index,t=e+s[0].length;if(A3(a,e,1)||A3(a,t-1,1)){w8.lastIndex=e+1;continue}o.push(s)}if(o.length===0)return;let c=[],l=0;for(let t of o){let r=t.index,a=r+t[0].length;if(r>l){let t={type:`text`,value:i.slice(l,r)},a=N3(n,e,l,r);a&&(t.position=a),c.push(t)}let o={type:`inlineMath`,value:t[1]},s=N3(n,e,r,a);s&&(o.position=s),c.push(o),l=a}if(l<i.length){let t={type:`text`,value:i.slice(l)},r=N3(n,e,l,i.length);r&&(t.position=r),c.push(t)}return r.children.splice(t,1,...c),[g,t+c.length]})}}var E8=new Set([`strong`,`emphasis`,`delete`,`link`,`mark`,`comment`]),D8=`<br />`;function O8(e){if(!e||e.type!==`break`)return!1;let t=e.data?.sourceRaw;return typeof t!=`string`||t.length===0}function k8(e){e.data??={},e.data.sourceRaw=D8,e.data.sourceStyle=`html`}function A8(e){if(!e||e.type!==`text`)return!1;let t=e.data?.sourceRaw;return typeof t!=`string`||t.length===0}var j8=/[ \t]+$/,M8=/^[ \t]*$/;function N8(e){return e.some(e=>!(A8(e)&&M8.test(e.value)))}function P8(e,t=!1){for(;e.length>0;){let n=e[e.length-1];if(O8(n)){k8(n);break}if(n&&E8.has(n.type)&&`children`in n){let t=n.children;if(P8(t,!0),t.length===0){e.pop();continue}}if(!t&&A8(n)&&j8.test(n.value)){let t=n.value.replace(j8,``);if(t.length>0){n.value=t;continue}if(N8(e.slice(0,-1))){e.pop();continue}if(e.every(e=>A8(e)&&M8.test(e.value))){let t=e[0];t.value=t.value.charAt(0),e.splice(1)}}break}}var F8=new Set([`paragraph`,`heading`,`tableCell`]);function I8(e){let t=e=>{if(F8.has(e.type)&&`children`in e&&P8(e.children),`children`in e)for(let n of e.children)t(n)};t(e)}var L8={handlers:{tag:e=>`#${e.value}`},unsafe:[{character:`#`,inConstruct:[`phrasing`],before:`\\s`,after:`[a-zA-Z]`}]};function R8(){let e=this.data();e.toMarkdownExtensions||=[],e.toMarkdownExtensions.some(e=>e===L8)||e.toMarkdownExtensions.push(L8)}var z8=/(?<!\uE102)<br[ \t]*\/?>/g,B8=new Set([`mdxJsxTextElement`,`mdxJsxFlowElement`]);function V8(e,t){let n=[],r=!1;for(let i of e.children){if(i.type!==`text`){n.push(i);continue}let e=i.value;z8.lastIndex=0;let a=[],o=0;for(;;){let n=z8.exec(e);if(n===null)break;let s=n.index;if(s>o){let n={type:`text`,value:e.slice(o,s)},r=N3(t,i,o,s);r&&(n.position=r),a.push(n)}let c={type:`break`,data:{sourceStyle:`html`,sourceRaw:n[0]}},l=N3(t,i,s,s+n[0].length);l&&(c.position=l),a.push(c),o=s+n[0].length,r=!0}if(a.length===0)n.push(i);else{if(o<e.length){let n={type:`text`,value:e.slice(o)},r=N3(t,i,o,e.length);r&&(n.position=r),a.push(n)}n.push(...a)}}r&&(e.children=n)}function H8(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;D(e,e=>{if(B8.has(e.type))return g;let t=e;Array.isArray(t.children)&&V8(e,n)})}}var U8=33,W8=91,G8=93,K8=124,q8=35,J8={name:`wikiLink`,tokenize:(e,t,n)=>{let r=0,i=0,a=0;return o;function o(t){return t===W8?(e.enter(`wikiLink`),e.enter(`wikiLinkMarker`),e.consume(t),s):n(t)}function s(t){return t===W8?(e.consume(t),e.exit(`wikiLinkMarker`),e.enter(`wikiLinkTarget`),c):n(t)}function c(t){return t===null||t===-5||t===-4||t===-3||t===W8?n(t):t===G8?r===0?n(t):(e.exit(`wikiLinkTarget`),d(t)):t===q8?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAnchor`),l):t===K8?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),u):(e.consume(t),r++,c)}function l(t){return t===null||t===-5||t===-4||t===-3||t===W8?n(t):t===G8?i===0?n(t):(e.exit(`wikiLinkAnchor`),d(t)):t===K8?i===0?n(t):(e.exit(`wikiLinkAnchor`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),u):(e.consume(t),i++,l)}function u(t){return t===null||t===-5||t===-4||t===-3||t===W8?n(t):t===G8?a===0?n(t):(e.exit(`wikiLinkAlias`),d(t)):(e.consume(t),a++,u)}function d(t){return t===G8?(e.enter(`wikiLinkMarker`),e.consume(t),f):n(t)}function f(r){return r===G8?(e.consume(r),e.exit(`wikiLinkMarker`),e.exit(`wikiLink`),t):n(r)}}},Y8={name:`wikiLinkEmbed`,tokenize:(e,t,n)=>{let r=0,i=0,a=0;return o;function o(t){return t===U8?(e.enter(`wikiLinkEmbed`),e.enter(`wikiLinkEmbedBang`),e.consume(t),e.exit(`wikiLinkEmbedBang`),s):n(t)}function s(t){return t===W8?(e.enter(`wikiLinkMarker`),e.consume(t),c):n(t)}function c(t){return t===W8?(e.consume(t),e.exit(`wikiLinkMarker`),e.enter(`wikiLinkTarget`),l):n(t)}function l(t){return t===null||t===-5||t===-4||t===-3||t===W8?n(t):t===G8?r===0?n(t):(e.exit(`wikiLinkTarget`),f(t)):t===q8?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAnchor`),u):t===K8?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),d):(e.consume(t),r++,l)}function u(t){return t===null||t===-5||t===-4||t===-3||t===W8?n(t):t===G8?i===0?n(t):(e.exit(`wikiLinkAnchor`),f(t)):t===K8?i===0?n(t):(e.exit(`wikiLinkAnchor`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),d):(e.consume(t),i++,u)}function d(t){return t===null||t===-5||t===-4||t===-3||t===W8?n(t):t===G8?a===0?n(t):(e.exit(`wikiLinkAlias`),f(t)):(e.consume(t),a++,d)}function f(t){return t===G8?(e.enter(`wikiLinkMarker`),e.consume(t),p):n(t)}function p(r){return r===G8?(e.consume(r),e.exit(`wikiLinkMarker`),e.exit(`wikiLinkEmbed`),t):n(r)}}};function X8(){return{text:{[W8]:J8,[U8]:Y8}}}function Z8(e){this.enter({type:`wikiLink`,value:``,data:{target:``,anchor:null,alias:null},children:[]},e)}function Q8(e){this.enter({type:`wikiLinkEmbed`,value:``,data:{target:``,anchor:null,alias:null},children:[]},e)}function $8(e){return e.stack[e.stack.length-1]}function e5(e){let t=$8(this),n=this.sliceSerialize(e);t.data.target=n.trim(),n!==t.data.target&&(t.data.sourceTarget=n)}function t5(e){let t=$8(this),n=this.sliceSerialize(e),r=n.trim();t.data.anchor=r.length?r:null,t.data.anchor!==null&&n!==r&&(t.data.sourceAnchor=n)}function n5(e){let t=$8(this),n=this.sliceSerialize(e),r=n.trim();t.data.alias=r.length?r:null,t.data.alias!==null&&n!==r&&(t.data.sourceAlias=n)}function r5(e){let{target:t,anchor:n,alias:r}=e.data,i=r||(n?`${t}#${n}`:t);e.value=i,e.children=[{type:`text`,value:i}]}function i5(e){r5($8(this)),this.exit(e)}function a5(e){r5($8(this)),this.exit(e)}var o5={enter:{wikiLink:Z8,wikiLinkEmbed:Q8},exit:{wikiLinkTarget:e5,wikiLinkAnchor:t5,wikiLinkAlias:n5,wikiLink:i5,wikiLinkEmbed:a5}};function s5(e,t){return typeof e==`string`&&e.trim()===t?e:t}var c5={handlers:{wikiLink:e=>{let t=e,n=t.data?.target??``,r=t.data?.anchor,i=t.data?.alias,a=`[[${s5(t.data?.sourceTarget,n)}`;return r&&(a+=`#${s5(t.data?.sourceAnchor,r)}`),i&&(a+=`|${s5(t.data?.sourceAlias,i)}`),`${a}]]`},wikiLinkEmbed:e=>{let t=e,n=t.data?.target??``,r=t.data?.anchor,i=t.data?.alias,a=`![[${n}`;return r&&(a+=`#${r}`),i&&(a+=`|${i}`),`${a}]]`}},unsafe:[{character:`[`,inConstruct:[`phrasing`]}]},l5=X8();function u5(){let e=this.data();e.micromarkExtensions||=[],e.micromarkExtensions.some(e=>e===l5)||e.micromarkExtensions.push(l5),e.fromMarkdownExtensions||=[],e.fromMarkdownExtensions.some(e=>e===o5)||e.fromMarkdownExtensions.push(o5),e.toMarkdownExtensions||=[],e.toMarkdownExtensions.some(e=>e===c5)||e.toMarkdownExtensions.push(c5)}function d5(e){return e.children.some(e=>{let t=e.type;return t!==`yaml`&&t!==`toml`})?e:{...e,children:[...e.children,{type:`paragraph`,children:[]}]}}var f5=[{name:`remark-parse`,plugin:ye},{name:`remark-mdx-agnostic`,plugin:C8},{name:`remark-gfm`,plugin:ue},{name:`remark-math`,plugin:SP,options:{singleDollarTextMath:!1}},{name:`remark-wiki-link`,plugin:u5},{name:`remark-github-alerts`,plugin:uP,options:T3},{name:`callout-transformer`,plugin:C3},{name:`restore-from-mdx`,plugin:X4},{name:`void-br-promoter`,plugin:H8},{name:`restore-entity-refs`,plugin:s3},{name:`restore-backslash-escapes`,plugin:d3},{name:`details-accordion-promoter`,plugin:c6},{name:`div-align-promoter`,plugin:_6},{name:`image-promoter`,plugin:N6},{name:`indented-code-promoter`,plugin:z6},{name:`math-promoter`,plugin:q6},{name:`single-dollar-math-promoter`,plugin:T8},{name:`highlight-promoter`,plugin:M6},{name:`mermaid-promoter`,plugin:d8},{name:`comment-promoter`,plugin:I3},{name:`merged-post-parse-walker`,plugin:l8},{name:`empty-task-item-unmint`,plugin:w6},{name:`ensure-non-empty-doc`,plugin:()=>d5}];function p5(e){let t=le();for(let e of f5)t=`options`in e&&e.options!==void 0?t.use(e.plugin,e.options):t.use(e.plugin);return t=t.use(FN,{schema:e.schema,handlers:e.handlers}),t.freeze(),t}function m5(e){let t=le().use(oP,[`yaml`]).use(ue,{tablePipeAlign:!1}).use(SP,{singleDollarTextMath:!1}).use(C8).use(u5).use(R8).use(SN,{bullet:`-`,fences:!0,rule:`-`,join:[y8],...e.toMarkdownHandlers?{handlers:e.toMarkdownHandlers}:{}});return t.freeze(),t}function h5(e){return e.charCodeAt(0)===65279?{source:e.slice(1),hadBom:!0}:{source:e,hadBom:!1}}var g5=/^\n+$/,_5=/^\n{2,}$/;function v5(e,t,n){let r,i,a=e.children;if(a.length>0){let e=a[0]?.position?.start?.offset;if(typeof e==`number`&&e>0){let n=t.slice(0,e);g5.test(n)&&(r=n)}let n=a[a.length-1]?.position?.end?.offset;if(typeof n==`number`&&n<=t.length){let e=t.slice(n);_5.test(e)&&(i=e)}}if(!n&&r===void 0&&i===void 0)return;let o={...n?{bom:!0}:{},...r===void 0?{}:{leading:r},...i===void 0?{}:{trailing:i}};return e.data??={},e.data.sourceDocBoundary=o,o}function y5(e){if(typeof e!=`object`||!e)return;let t=e,n={};return t.bom===!0&&(n.bom=!0),typeof t.leading==`string`&&g5.test(t.leading)&&(n.leading=t.leading),typeof t.trailing==`string`&&_5.test(t.trailing)&&(n.trailing=t.trailing),n.bom||n.leading||n.trailing?n:void 0}function b5(e,t){let{source:n,hadBom:r}=h5(e),i=Z3(n),a=new ie(i3(J4(u3(i)))),o=t.parse(a);a.value=i;let s=t.runSync(o,a);W6(s,i);let c=v5(s,i,r),l=t.stringify(s);return c?l.type.create({...l.attrs,sourceDocBoundary:c},l.content,l.marks):l}function x5(e,t){return C5(e,t,!1)}function S5(e,t){return C5(e,t,!0)}function C5(e,t,n){let{source:r,hadBom:i}=h5(e),a=Z3(r),o=new ie(i3(J4(u3(a)))),s=t.parse(o);o.value=a;let c=t.runSync(s,o);return n&&W6(c,a),v5(c,a,i),c}function w5(e,t,n){let r=LN(e,{schema:n.schema,nodeHandlers:n.pmNodeHandlers,markHandlers:n.pmMarkHandlers});S6(r),I8(r),_8(r);let i=y5(e.attrs?.sourceDocBoundary),a=String(t.stringify(r));return i?.leading&&(a=i.leading+a),i?.trailing&&(a=a.replace(/\n+$/,``)+i.trailing),i?.bom&&(a=`\uFEFF${a}`),a}function T5(){return!1}function E5(e){let t=e.lastIndexOf(`/`);return t===-1?``:t===0?`/`:e.slice(0,t)}function D5(e,t){let n=e?`${e}/${t}`:t,r=n.startsWith(`/`),i=[];for(let e of n.split(`/`))if(!(e===``||e===`.`)){if(e===`..`){let e=i[i.length-1];i.length>0&&e!==`..`?i.pop():r||i.push(`..`);continue}i.push(e)}let a=i.join(`/`);return r?`/${a}`:a}function O5(e,t){if(typeof e!=`string`||e===``||!t||e.startsWith(`/`)||!CZ(e))return e;let n=D5(E5(t),e);return n===``||n===`..`||n.startsWith(`../`)?(T5()&&console.warn(`[resolve-image-url] doc-relative path escapes contentDir; emitting raw URL: ${e} (from sourcePath ${t})`),e):`/${n}`}var k5=Object.assign(cne,{peek:()=>`$`}),A5=Object.assign(lne,{peek:()=>`~`}),j5=(()=>{for(let e of S8.extensions??[]){let t=e?.handlers?.mdxJsxFlowElement;if(typeof t==`function`)return t}throw Error(`mdast-util-mdx-jsx mdxJsxFlowElement to-markdown handler not found — the dirty MDX JSX serialize path cannot bind. Likely a breaking change in mdast-util-mdx-jsx (pinned in the root overrides); re-run the markdown-pipeline upgrade protocol (test:fidelity).`)})(),M5=/^[ \t]*(?:$|#{1,6}(?:[ \t]|[ \t]*$)|>|(?:[-+*]|\d{1,9}[.)])[ \t]|`{3,}|~{3,}|=+[ \t]*$|-+[ \t]*$|(?:\*[ \t]*){3,}$|(?:_[ \t]*){3,}$)/,N5={text(e,t,n,r){if(typeof e.data?.sourceRaw==`string`&&aQ(e.data.sourceRaw,e.value??``))return e.data.sourceRaw;if(e.data?.escapedChars?.length){let t=e.value??``,i=e.data.escapedChars,a=``,o=0;for(let{offset:e,char:s}of i)e>o&&(a+=W5(n,t.slice(o,e),{...r,before:r.before+a,after:`\\`})),a+=`\\${s}`,o=e+1;return o<t.length&&(a+=W5(n,t.slice(o),{...r,before:r.before+a})),a}return W5(n,e.value??``,r)},emphasis(e,t,n,r){let i=e.data?.sourceDelimiter??`*`,a=n.createTracker(r),o=n.enter(`emphasis`),s=a.move(i);return s+=Y5(n.containerPhrasing(e,{before:s,after:i,...a.current()}),r,i),s+=a.move(i),o(),s},strong(e,t,n,r){let i=e.data?.sourceDelimiter??`**`,a=n.createTracker(r),o=n.enter(`strong`),s=a.move(i);return s+=Y5(n.containerPhrasing(e,{before:s,after:i,...a.current()}),r,i),s+=a.move(i),o(),s},link(e,t,n,r){if(e.data?.sourceStyle===`autolink`)return`<${e.url??``}>`;if(e.data?.sourceStyle===`gfm-autolink`){let t=e.children?.length===1?e.children[0]:null;if(t?.type===`text`&&typeof t.value==`string`)return t.value}let i=n.createTracker(r),a=n.enter(`link`),o=n.enter(`label`),s=i.move(`[`);s+=i.move(n.containerPhrasing(e,{before:s,after:`](`,...i.current()})),s+=i.move(`](`),o();let c=n.enter(`destinationRaw`),l=String(e.url??``),u=e.data?.sourceUrlForm===`angle-bracketed`,d=l.startsWith(`<`)&&l.endsWith(`>`),f=u&&!d?`<${l}>`:R5(l);if(s+=i.move(f),c(),e.title){let t=e.data?.sourceTitleMarker??`double`;s+=i.move(L5(e.title,t))}return s+=i.move(`)`),a(),s},image(e,t,n,r){let i=n.createTracker(r),a=n.enter(`image`),o=n.enter(`label`),s=i.move(`![`);s+=i.move(n.safe(e.alt??``,{before:s,after:`](`,...i.current()})),s+=i.move(`](`),o();let c=n.enter(`destinationRaw`);if(s+=i.move(R5(String(e.url??``))),c(),e.title){let t=n.enter(`titleQuote`);s+=i.move(` "`),s+=i.move(n.safe(e.title,{before:s,after:`"`,...i.current()})),s+=i.move(`"`),t()}return s+=i.move(`)`),a(),s},definition(e,t,n,r){let i=e.data?.sourceLayout??`inline`,a=e.data?.sourceTitleMarker??`double`,o=n.enter(`definition`),s=n.createTracker(r),c=n.enter(`label`),l=s.move(`[`);l+=s.move(n.safe(n.associationId(e),{before:l,after:`]`,...s.current()})),l+=s.move(`]:`),c();let u=i===`multiline`?`
530
- `:` `;l+=s.move(u);let d=String(e.url??``);if(!d||/[\0- ]/.test(d)){let e=n.enter(`destinationLiteral`);l+=s.move(`<`),l+=s.move(n.safe(d,{before:l,after:`>`,...s.current()})),l+=s.move(`>`),e()}else{let e=n.enter(`destinationRaw`);l+=s.move(R5(d)),e()}if(e.title){let t=i===`multiline`?`
531
- `:` `;l+=s.move(L5(e.title,a,t))}return o(),l},thematicBreak(e){return e.data?.sourceRaw??`---`},break(e,t,n){let r=e.data?.sourceRaw;return typeof r==`string`&&r.length>0?r:n.stack.includes(`tableCell`)||n.stack.includes(`okAtxHeading`)?`<br />`:e.data?.sourceStyle===`backslash`?`\\
531
+ `,i),o=a===-1?t.length:a,s=i+r-1;return s<=o?s:null}function c8(e,t){if(!e)return null;let n=s8(e.start,t),r=s8(e.end,t);return n===null||r===null||r<n?null:t.slice(n,r)}function l8(e,t){let n=c8(e.position,t);return{type:`rawMdxFallbackMdast`,originalType:e.type??`unknown`,value:n??``,unresolvedPosition:n===null,position:e.position}}function u8(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``,r=typeof process<`u`&&{}?.OK_DEBUG_POSITION_SLICE===`1`;D(e,(e,t,i)=>{if(i!==void 0&&typeof t==`number`&&typeof e.type==`string`&&!o8.has(e.type)){let r=l8(e,n);return i.children[t]=r,g}if(`children`in e&&Array.isArray(e.children)){let t=e;t.children.some(e=>e.type===`text`)&&(X6(t,n),a8(t,n))}if($6(e,n,r,i),e.type===`heading`&&i!==void 0&&typeof t==`number`){let n=e.position?.end?.line,r=i.children[t+1],a=r?.position?.start?.line;if(r?.type===`paragraph`&&typeof n==`number`&&typeof a==`number`&&a===n+1){let t=e;t.data??={},t.data.sourceContiguousNext=!0}}})}}function d8(e,t){let n={type:`mdxJsxFlowElement`,name:`MermaidFence`,attributes:[{type:`mdxJsxAttribute`,name:`chart`,value:e}],children:[]};return t&&(n.position=t),n}function f8(){return e=>{D(e,`code`,(e,t,n)=>{if(!n||t==null||e.lang!==`mermaid`)return;let r=d8(typeof e.value==`string`?e.value:``,e.position);n.children[t]=r})}}function p8(e){return e.data?.sourceRaw}function m8(e){return e.type===`text`?e.value===``:e.type===`mdxJsxTextElement`?p8(e)===``:!1}function h8(e){return e.type===`paragraph`?(e.children??[]).every(m8):!1}function g8(e){let t=e.children??[],n=t[0]?.children?.length??0,r=0;for(let e=1;e<t.length;e++)r=Math.max(r,t[e]?.children?.length??0);let i=e.align??[];return Math.max(n,r,i.length)}function _8(e){switch(e.type){case`table`:return g8(e)===0;case`code`:return e.data?.sourceStyle===`indented`&&/^\n*$/.test(e.value??``);case`thematicBreak`:return p8(e)===``;case`html`:return(e.value??``)===``;case`mdxJsxFlowElement`:return p8(e)===void 0&&e.data?.htmlBoundary===void 0&&(e.children??[]).length===0&&!e.name;case`list`:return(e.children??[]).length===0;default:return!1}}function v8(e){let t=[];for(let n of e.children){if(n.type===`table`&&g8(n)===0){console.warn(JSON.stringify({event:`table-serialize-dropped-empty`,rows:(n.children??[]).length}));continue}_8(n)||(n.type===`paragraph`&&n.children.length>0&&h8(n)&&(n.children=[]),t.push(n))}e.children=t}function y8(e,t){let n=e,r=t;return n.type===`heading`&&n.data?.sourceContiguousNext===!0&&r.type===`paragraph`}var b8=(e,t)=>{if(h8(e)||y8(e,t))return 0;let n=e.position,r=t.position;if(!n||!r)return;let i=r.start.line-n.end.line-1;return i>=1?i:void 0},x8=nI(),S8=xF(),C8=SF();function w8(){let e=this.data();e.micromarkExtensions||=[],e.fromMarkdownExtensions||=[],e.toMarkdownExtensions||=[];let t=e.micromarkExtensions;t.some(e=>e===x8)||t.push(x8);let n=e.fromMarkdownExtensions;n.some(e=>e===S8)||n.push(S8);let r=e.toMarkdownExtensions;r.some(e=>e===C8)||r.push(C8)}var T8=/(?<!\\)\$(?=\S)([^$\n]*?[^\s$])\$(?!\d)/g;function E8(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;D(e,`text`,(e,t,r)=>{if(r===void 0||t==null)return;let i=e.value;if(i.indexOf(`$`)===-1)return;let a=A3(n,e);T8.lastIndex=0;let o=[],s;for(;(s=T8.exec(i))!==null;){let e=s.index,t=e+s[0].length;if(j3(a,e,1)||j3(a,t-1,1)){T8.lastIndex=e+1;continue}o.push(s)}if(o.length===0)return;let c=[],l=0;for(let t of o){let r=t.index,a=r+t[0].length;if(r>l){let t={type:`text`,value:i.slice(l,r)},a=P3(n,e,l,r);a&&(t.position=a),c.push(t)}let o={type:`inlineMath`,value:t[1]},s=P3(n,e,r,a);s&&(o.position=s),c.push(o),l=a}if(l<i.length){let t={type:`text`,value:i.slice(l)},r=P3(n,e,l,i.length);r&&(t.position=r),c.push(t)}return r.children.splice(t,1,...c),[g,t+c.length]})}}var D8=new Set([`strong`,`emphasis`,`delete`,`link`,`mark`,`comment`]),O8=`<br />`;function k8(e){if(!e||e.type!==`break`)return!1;let t=e.data?.sourceRaw;return typeof t!=`string`||t.length===0}function A8(e){e.data??={},e.data.sourceRaw=O8,e.data.sourceStyle=`html`}function j8(e){if(!e||e.type!==`text`)return!1;let t=e.data?.sourceRaw;return typeof t!=`string`||t.length===0}var M8=/[ \t]+$/,N8=/^[ \t]*$/;function P8(e){return e.some(e=>!(j8(e)&&N8.test(e.value)))}function F8(e,t=!1){for(;e.length>0;){let n=e[e.length-1];if(k8(n)){A8(n);break}if(n&&D8.has(n.type)&&`children`in n){let t=n.children;if(F8(t,!0),t.length===0){e.pop();continue}}if(!t&&j8(n)&&M8.test(n.value)){let t=n.value.replace(M8,``);if(t.length>0){n.value=t;continue}if(P8(e.slice(0,-1))){e.pop();continue}if(e.every(e=>j8(e)&&N8.test(e.value))){let t=e[0];t.value=t.value.charAt(0),e.splice(1)}}break}}var I8=new Set([`paragraph`,`heading`,`tableCell`]);function L8(e){let t=e=>{if(I8.has(e.type)&&`children`in e&&F8(e.children),`children`in e)for(let n of e.children)t(n)};t(e)}var R8={handlers:{tag:e=>`#${e.value}`},unsafe:[{character:`#`,inConstruct:[`phrasing`],before:`\\s`,after:`[a-zA-Z]`}]};function z8(){let e=this.data();e.toMarkdownExtensions||=[],e.toMarkdownExtensions.some(e=>e===R8)||e.toMarkdownExtensions.push(R8)}var B8=/(?<!\uE102)<br[ \t]*\/?>/g,V8=new Set([`mdxJsxTextElement`,`mdxJsxFlowElement`]);function H8(e,t){let n=[],r=!1;for(let i of e.children){if(i.type!==`text`){n.push(i);continue}let e=i.value;B8.lastIndex=0;let a=[],o=0;for(;;){let n=B8.exec(e);if(n===null)break;let s=n.index;if(s>o){let n={type:`text`,value:e.slice(o,s)},r=P3(t,i,o,s);r&&(n.position=r),a.push(n)}let c={type:`break`,data:{sourceStyle:`html`,sourceRaw:n[0]}},l=P3(t,i,s,s+n[0].length);l&&(c.position=l),a.push(c),o=s+n[0].length,r=!0}if(a.length===0)n.push(i);else{if(o<e.length){let n={type:`text`,value:e.slice(o)},r=P3(t,i,o,e.length);r&&(n.position=r),a.push(n)}n.push(...a)}}r&&(e.children=n)}function U8(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;D(e,e=>{if(V8.has(e.type))return g;let t=e;Array.isArray(t.children)&&H8(e,n)})}}var W8=33,G8=91,K8=93,q8=124,J8=35,Y8={name:`wikiLink`,tokenize:(e,t,n)=>{let r=0,i=0,a=0;return o;function o(t){return t===G8?(e.enter(`wikiLink`),e.enter(`wikiLinkMarker`),e.consume(t),s):n(t)}function s(t){return t===G8?(e.consume(t),e.exit(`wikiLinkMarker`),e.enter(`wikiLinkTarget`),c):n(t)}function c(t){return t===null||t===-5||t===-4||t===-3||t===G8?n(t):t===K8?r===0?n(t):(e.exit(`wikiLinkTarget`),d(t)):t===J8?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAnchor`),l):t===q8?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),u):(e.consume(t),r++,c)}function l(t){return t===null||t===-5||t===-4||t===-3||t===G8?n(t):t===K8?i===0?n(t):(e.exit(`wikiLinkAnchor`),d(t)):t===q8?i===0?n(t):(e.exit(`wikiLinkAnchor`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),u):(e.consume(t),i++,l)}function u(t){return t===null||t===-5||t===-4||t===-3||t===G8?n(t):t===K8?a===0?n(t):(e.exit(`wikiLinkAlias`),d(t)):(e.consume(t),a++,u)}function d(t){return t===K8?(e.enter(`wikiLinkMarker`),e.consume(t),f):n(t)}function f(r){return r===K8?(e.consume(r),e.exit(`wikiLinkMarker`),e.exit(`wikiLink`),t):n(r)}}},X8={name:`wikiLinkEmbed`,tokenize:(e,t,n)=>{let r=0,i=0,a=0;return o;function o(t){return t===W8?(e.enter(`wikiLinkEmbed`),e.enter(`wikiLinkEmbedBang`),e.consume(t),e.exit(`wikiLinkEmbedBang`),s):n(t)}function s(t){return t===G8?(e.enter(`wikiLinkMarker`),e.consume(t),c):n(t)}function c(t){return t===G8?(e.consume(t),e.exit(`wikiLinkMarker`),e.enter(`wikiLinkTarget`),l):n(t)}function l(t){return t===null||t===-5||t===-4||t===-3||t===G8?n(t):t===K8?r===0?n(t):(e.exit(`wikiLinkTarget`),f(t)):t===J8?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAnchor`),u):t===q8?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),d):(e.consume(t),r++,l)}function u(t){return t===null||t===-5||t===-4||t===-3||t===G8?n(t):t===K8?i===0?n(t):(e.exit(`wikiLinkAnchor`),f(t)):t===q8?i===0?n(t):(e.exit(`wikiLinkAnchor`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),d):(e.consume(t),i++,u)}function d(t){return t===null||t===-5||t===-4||t===-3||t===G8?n(t):t===K8?a===0?n(t):(e.exit(`wikiLinkAlias`),f(t)):(e.consume(t),a++,d)}function f(t){return t===K8?(e.enter(`wikiLinkMarker`),e.consume(t),p):n(t)}function p(r){return r===K8?(e.consume(r),e.exit(`wikiLinkMarker`),e.exit(`wikiLinkEmbed`),t):n(r)}}};function Z8(){return{text:{[G8]:Y8,[W8]:X8}}}function Q8(e){this.enter({type:`wikiLink`,value:``,data:{target:``,anchor:null,alias:null},children:[]},e)}function $8(e){this.enter({type:`wikiLinkEmbed`,value:``,data:{target:``,anchor:null,alias:null},children:[]},e)}function e5(e){return e.stack[e.stack.length-1]}function t5(e){let t=e5(this),n=this.sliceSerialize(e);t.data.target=n.trim(),n!==t.data.target&&(t.data.sourceTarget=n)}function n5(e){let t=e5(this),n=this.sliceSerialize(e),r=n.trim();t.data.anchor=r.length?r:null,t.data.anchor!==null&&n!==r&&(t.data.sourceAnchor=n)}function r5(e){let t=e5(this),n=this.sliceSerialize(e),r=n.trim();t.data.alias=r.length?r:null,t.data.alias!==null&&n!==r&&(t.data.sourceAlias=n)}function i5(e){let{target:t,anchor:n,alias:r}=e.data,i=r||(n?`${t}#${n}`:t);e.value=i,e.children=[{type:`text`,value:i}]}function a5(e){i5(e5(this)),this.exit(e)}function o5(e){i5(e5(this)),this.exit(e)}var s5={enter:{wikiLink:Q8,wikiLinkEmbed:$8},exit:{wikiLinkTarget:t5,wikiLinkAnchor:n5,wikiLinkAlias:r5,wikiLink:a5,wikiLinkEmbed:o5}};function c5(e,t){return typeof e==`string`&&e.trim()===t?e:t}var l5={handlers:{wikiLink:e=>{let t=e,n=t.data?.target??``,r=t.data?.anchor,i=t.data?.alias,a=`[[${c5(t.data?.sourceTarget,n)}`;return r&&(a+=`#${c5(t.data?.sourceAnchor,r)}`),i&&(a+=`|${c5(t.data?.sourceAlias,i)}`),`${a}]]`},wikiLinkEmbed:e=>{let t=e,n=t.data?.target??``,r=t.data?.anchor,i=t.data?.alias,a=`![[${n}`;return r&&(a+=`#${r}`),i&&(a+=`|${i}`),`${a}]]`}},unsafe:[{character:`[`,inConstruct:[`phrasing`]}]},u5=Z8();function d5(){let e=this.data();e.micromarkExtensions||=[],e.micromarkExtensions.some(e=>e===u5)||e.micromarkExtensions.push(u5),e.fromMarkdownExtensions||=[],e.fromMarkdownExtensions.some(e=>e===s5)||e.fromMarkdownExtensions.push(s5),e.toMarkdownExtensions||=[],e.toMarkdownExtensions.some(e=>e===l5)||e.toMarkdownExtensions.push(l5)}function f5(e){return e.children.some(e=>{let t=e.type;return t!==`yaml`&&t!==`toml`})?e:{...e,children:[...e.children,{type:`paragraph`,children:[]}]}}var p5=[{name:`remark-parse`,plugin:ye},{name:`remark-mdx-agnostic`,plugin:w8},{name:`remark-gfm`,plugin:ue},{name:`remark-math`,plugin:xP,options:{singleDollarTextMath:!1}},{name:`remark-wiki-link`,plugin:d5},{name:`remark-github-alerts`,plugin:lP,options:E3},{name:`callout-transformer`,plugin:w3},{name:`restore-from-mdx`,plugin:Z4},{name:`void-br-promoter`,plugin:U8},{name:`restore-entity-refs`,plugin:c3},{name:`restore-backslash-escapes`,plugin:f3},{name:`details-accordion-promoter`,plugin:l6},{name:`div-align-promoter`,plugin:v6},{name:`image-promoter`,plugin:P6},{name:`indented-code-promoter`,plugin:B6},{name:`math-promoter`,plugin:J6},{name:`single-dollar-math-promoter`,plugin:E8},{name:`highlight-promoter`,plugin:N6},{name:`mermaid-promoter`,plugin:f8},{name:`comment-promoter`,plugin:L3},{name:`merged-post-parse-walker`,plugin:u8},{name:`empty-task-item-unmint`,plugin:T6},{name:`ensure-non-empty-doc`,plugin:()=>f5}];function m5(e){let t=le();for(let e of p5)t=`options`in e&&e.options!==void 0?t.use(e.plugin,e.options):t.use(e.plugin);return t=t.use(PN,{schema:e.schema,handlers:e.handlers}),t.freeze(),t}function h5(e){let t=le().use(aP,[`yaml`]).use(ue,{tablePipeAlign:!1}).use(xP,{singleDollarTextMath:!1}).use(w8).use(d5).use(z8).use(xN,{bullet:`-`,fences:!0,rule:`-`,join:[b8],...e.toMarkdownHandlers?{handlers:e.toMarkdownHandlers}:{}});return t.freeze(),t}function g5(e){return e.charCodeAt(0)===65279?{source:e.slice(1),hadBom:!0}:{source:e,hadBom:!1}}var _5=/^\n+$/,v5=/^\n{2,}$/;function y5(e,t,n){let r,i,a=e.children;if(a.length>0){let e=a[0]?.position?.start?.offset;if(typeof e==`number`&&e>0){let n=t.slice(0,e);_5.test(n)&&(r=n)}let n=a[a.length-1]?.position?.end?.offset;if(typeof n==`number`&&n<=t.length){let e=t.slice(n);v5.test(e)&&(i=e)}}if(!n&&r===void 0&&i===void 0)return;let o={...n?{bom:!0}:{},...r===void 0?{}:{leading:r},...i===void 0?{}:{trailing:i}};return e.data??={},e.data.sourceDocBoundary=o,o}function b5(e){if(typeof e!=`object`||!e)return;let t=e,n={};return t.bom===!0&&(n.bom=!0),typeof t.leading==`string`&&_5.test(t.leading)&&(n.leading=t.leading),typeof t.trailing==`string`&&v5.test(t.trailing)&&(n.trailing=t.trailing),n.bom||n.leading||n.trailing?n:void 0}function x5(e,t){let{source:n,hadBom:r}=g5(e),i=Q3(n),a=new ie(a3(Y4(d3(i)))),o=t.parse(a);a.value=i;let s=t.runSync(o,a);G6(s,i);let c=y5(s,i,r),l=t.stringify(s);return c?l.type.create({...l.attrs,sourceDocBoundary:c},l.content,l.marks):l}function S5(e,t){return w5(e,t,!1)}function C5(e,t){return w5(e,t,!0)}function w5(e,t,n){let{source:r,hadBom:i}=g5(e),a=Q3(r),o=new ie(a3(Y4(d3(a)))),s=t.parse(o);o.value=a;let c=t.runSync(s,o);return n&&G6(c,a),y5(c,a,i),c}function T5(e,t,n){let r=IN(e,{schema:n.schema,nodeHandlers:n.pmNodeHandlers,markHandlers:n.pmMarkHandlers});C6(r),L8(r),v8(r);let i=b5(e.attrs?.sourceDocBoundary),a=String(t.stringify(r));return i?.leading&&(a=i.leading+a),i?.trailing&&(a=a.replace(/\n+$/,``)+i.trailing),i?.bom&&(a=`\uFEFF${a}`),a}function E5(){return!1}function D5(e){let t=e.lastIndexOf(`/`);return t===-1?``:t===0?`/`:e.slice(0,t)}function O5(e,t){let n=e?`${e}/${t}`:t,r=n.startsWith(`/`),i=[];for(let e of n.split(`/`))if(!(e===``||e===`.`)){if(e===`..`){let e=i[i.length-1];i.length>0&&e!==`..`?i.pop():r||i.push(`..`);continue}i.push(e)}let a=i.join(`/`);return r?`/${a}`:a}function k5(e,t){if(typeof e!=`string`||e===``||!t||e.startsWith(`/`)||!SZ(e))return e;let n=O5(D5(t),e);return n===``||n===`..`||n.startsWith(`../`)?(E5()&&console.warn(`[resolve-image-url] doc-relative path escapes contentDir; emitting raw URL: ${e} (from sourcePath ${t})`),e):`/${n}`}var A5=Object.assign(une,{peek:()=>`$`}),j5=Object.assign(dne,{peek:()=>`~`}),M5=(()=>{for(let e of C8.extensions??[]){let t=e?.handlers?.mdxJsxFlowElement;if(typeof t==`function`)return t}throw Error(`mdast-util-mdx-jsx mdxJsxFlowElement to-markdown handler not found — the dirty MDX JSX serialize path cannot bind. Likely a breaking change in mdast-util-mdx-jsx (pinned in the root overrides); re-run the markdown-pipeline upgrade protocol (test:fidelity).`)})(),N5=/^[ \t]*(?:$|#{1,6}(?:[ \t]|[ \t]*$)|>|(?:[-+*]|\d{1,9}[.)])[ \t]|`{3,}|~{3,}|=+[ \t]*$|-+[ \t]*$|(?:\*[ \t]*){3,}$|(?:_[ \t]*){3,}$)/,P5={text(e,t,n,r){if(typeof e.data?.sourceRaw==`string`&&iQ(e.data.sourceRaw,e.value??``))return e.data.sourceRaw;if(e.data?.escapedChars?.length){let t=e.value??``,i=e.data.escapedChars,a=``,o=0;for(let{offset:e,char:s}of i)e>o&&(a+=G5(n,t.slice(o,e),{...r,before:r.before+a,after:`\\`})),a+=`\\${s}`,o=e+1;return o<t.length&&(a+=G5(n,t.slice(o),{...r,before:r.before+a})),a}return G5(n,e.value??``,r)},emphasis(e,t,n,r){let i=e.data?.sourceDelimiter??`*`,a=n.createTracker(r),o=n.enter(`emphasis`),s=a.move(i);return s+=Y5(n.containerPhrasing(e,{before:s,after:i,...a.current()}),r,i),s+=a.move(i),o(),s},strong(e,t,n,r){let i=e.data?.sourceDelimiter??`**`,a=n.createTracker(r),o=n.enter(`strong`),s=a.move(i);return s+=Y5(n.containerPhrasing(e,{before:s,after:i,...a.current()}),r,i),s+=a.move(i),o(),s},link(e,t,n,r){if(e.data?.sourceStyle===`autolink`)return`<${e.url??``}>`;if(e.data?.sourceStyle===`gfm-autolink`){let t=e.children?.length===1?e.children[0]:null;if(t?.type===`text`&&typeof t.value==`string`)return t.value}let i=n.createTracker(r),a=n.enter(`link`),o=n.enter(`label`),s=i.move(`[`);s+=i.move(n.containerPhrasing(e,{before:s,after:`](`,...i.current()})),s+=i.move(`](`),o();let c=n.enter(`destinationRaw`),l=String(e.url??``),u=e.data?.sourceUrlForm===`angle-bracketed`,d=l.startsWith(`<`)&&l.endsWith(`>`),f=u&&!d?`<${l}>`:z5(l);if(s+=i.move(f),c(),e.title){let t=e.data?.sourceTitleMarker??`double`;s+=i.move(R5(e.title,t))}return s+=i.move(`)`),a(),s},image(e,t,n,r){let i=n.createTracker(r),a=n.enter(`image`),o=n.enter(`label`),s=i.move(`![`);s+=i.move(n.safe(e.alt??``,{before:s,after:`](`,...i.current()})),s+=i.move(`](`),o();let c=n.enter(`destinationRaw`);if(s+=i.move(z5(String(e.url??``))),c(),e.title){let t=n.enter(`titleQuote`);s+=i.move(` "`),s+=i.move(n.safe(e.title,{before:s,after:`"`,...i.current()})),s+=i.move(`"`),t()}return s+=i.move(`)`),a(),s},definition(e,t,n,r){let i=e.data?.sourceLayout??`inline`,a=e.data?.sourceTitleMarker??`double`,o=n.enter(`definition`),s=n.createTracker(r),c=n.enter(`label`),l=s.move(`[`);l+=s.move(n.safe(n.associationId(e),{before:l,after:`]`,...s.current()})),l+=s.move(`]:`),c();let u=i===`multiline`?`
532
+ `:` `;l+=s.move(u);let d=String(e.url??``);if(!d||/[\0- ]/.test(d)){let e=n.enter(`destinationLiteral`);l+=s.move(`<`),l+=s.move(n.safe(d,{before:l,after:`>`,...s.current()})),l+=s.move(`>`),e()}else{let e=n.enter(`destinationRaw`);l+=s.move(z5(d)),e()}if(e.title){let t=i===`multiline`?`
533
+ `:` `;l+=s.move(R5(e.title,a,t))}return o(),l},thematicBreak(e){return e.data?.sourceRaw??`---`},break(e,t,n){let r=e.data?.sourceRaw;return typeof r==`string`&&r.length>0?r:n.stack.includes(`tableCell`)||n.stack.includes(`okAtxHeading`)?`<br />`:e.data?.sourceStyle===`backslash`?`\\
532
534
  `:`
533
535
  `},code(e,t){let n=e.value??``;if(e.data?.sourceStyle===`indented`){let t=n.split(`
534
536
  `),r=e.data.sourceIndents;return Array.isArray(r)&&r.length===t.length?t.map((e,t)=>`${r[t]??(e.length>0?` `:``)}${e}`).join(`
535
537
  `):t.map(e=>e.length>0?` ${e}`:e).join(`
536
- `)}let r=e.data?.sourceFenceChar===`~`?`~`:"`",i=g1(r,n,e.data?.sourceFenceLength??3),a=e.data?.sourceClosingFenceLength,o=typeof a==`number`&&a>i?a:i,s=e.data?.sourceFenceIndent,c=typeof s==`number`&&s>=1&&s<=3?` `.repeat(s):``,l=e.data?.sourceInfoPadding,u=r.repeat(i),d=e.lang??``,f=d&&typeof l==`number`&&l>=1?` `.repeat(l):``,p=e.meta?` ${e.meta}`:``;if(e.data?.sourceUnclosedFence===!0&&t?.type===`root`&&t.children[t.children.length-1]===e){let e=`${u}${f}${d}${p}${n.length>0?`\n${n}`:``}`;return c?e.split(`
538
+ `)}let r=e.data?.sourceFenceChar===`~`?`~`:"`",i=h1(r,n,e.data?.sourceFenceLength??3),a=e.data?.sourceClosingFenceLength,o=typeof a==`number`&&a>i?a:i,s=e.data?.sourceFenceIndent,c=typeof s==`number`&&s>=1&&s<=3?` `.repeat(s):``,l=e.data?.sourceInfoPadding,u=r.repeat(i),d=e.lang??``,f=d&&typeof l==`number`&&l>=1?` `.repeat(l):``,p=e.meta?` ${e.meta}`:``;if(e.data?.sourceUnclosedFence===!0&&t?.type===`root`&&t.children[t.children.length-1]===e){let e=`${u}${f}${d}${p}${n.length>0?`\n${n}`:``}`;return c?e.split(`
537
539
  `).map(e=>e.length>0?`${c}${e}`:e).join(`
538
540
  `):e}let m=`${u}${f}${d}${p}\n${n}\n${r.repeat(o)}`;return c?m.split(`
539
541
  `).map(e=>e.length>0?`${c}${e}`:e).join(`
540
- `):m},inlineCode(e,t,n){let r=e.value??``,i=e.data?.sourceFenceChar===`~`?`~`:"`",a=typeof e.data?.sourceFenceLength==`number`&&e.data.sourceFenceLength>0?e.data.sourceFenceLength:1,o=i==="`"?"`":`~`,s=a;for(;RegExp(`(^|[^${o}])${o.repeat(s)}([^${o}]|$)`).test(r);)s+=1;let c=i.repeat(s);/[^ \r\n]/.test(r)&&(e.data?.sourcePadded===!0||/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||r.startsWith(i)||r.endsWith(i))&&(r=` ${r} `);let l=`${c}${r}${c}`;return n.stack.includes(`tableCell`)?l.replace(/\|/g,`\\$&`):l},inlineMath:k5,delete:A5,heading(e,t,n,r){let i=e.data?.sourceStyle??`atx`,a=e.depth;if(i===`setext`&&(a===1||a===2)){let t=n.containerPhrasing(e,{...r,before:`
542
+ `):m},inlineCode(e,t,n){let r=e.value??``,i=e.data?.sourceFenceChar===`~`?`~`:"`",a=typeof e.data?.sourceFenceLength==`number`&&e.data.sourceFenceLength>0?e.data.sourceFenceLength:1,o=i==="`"?"`":`~`,s=a;for(;RegExp(`(^|[^${o}])${o.repeat(s)}([^${o}]|$)`).test(r);)s+=1;let c=i.repeat(s);/[^ \r\n]/.test(r)&&(e.data?.sourcePadded===!0||/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||r.startsWith(i)||r.endsWith(i))&&(r=` ${r} `);let l=`${c}${r}${c}`;return n.stack.includes(`tableCell`)?l.replace(/\|/g,`\\$&`):l},inlineMath:A5,delete:j5,heading(e,t,n,r){let i=e.data?.sourceStyle??`atx`,a=e.depth;if(i===`setext`&&(a===1||a===2)){let t=n.containerPhrasing(e,{...r,before:`
541
543
  `,after:`
542
544
  `}),i=e.data?.sourceUnderlineLength,o=typeof i==`number`&&i>=1?i:Math.max(t.length,3);return`${t}\n${(a===1?`=`:`-`).repeat(o)}`}let o=e.data?.sourceLeadingIndent,s=typeof o==`number`&&o>=1&&o<=3?` `.repeat(o):``,c=e.data?.sourceInteriorSpacing,l=typeof c==`number`&&c>=2?` `.repeat(c):` `,u=`#`.repeat(a),d=n.enter(`okAtxHeading`),f=n.containerPhrasing(e,{...r,before:`${u} `,after:`
543
545
  `});d();let p=e.data?.sourceTrailingHashes;if(typeof p==`number`&&p>0){let e=`#`.repeat(p);return f?`${s}${u}${l}${f} ${e}`:`${s}${u} ${e}`}return f?`${s}${u}${l}${f}`:`${s}${u}`},list(e,t,n,r){let i=n.options.bullet||`-`,a=!!e.ordered,o=n.bulletCurrent,s=n.bulletLastUsed;if(!a){let t=e.data?.bulletMarker;(t===`-`||t===`*`||t===`+`)&&(n.bulletCurrent=t)}let c=e.children||[],l=[],u=a?e.data?.listMarkerDelimiter??`.`:null,d=e.start??1;for(let t=0;t<c.length;t++){let o=c[t],s=o.data?.sourceOrdinal,f=typeof s==`number`&&s>=0?s:d+t,p=a?`${f}${u}`:e.data?.bulletMarker??i,m=o.data?.sourceMarkerSpacing,h=typeof m==`number`&&m>=2&&m<=4?m:1,g=` `.repeat(h),_=p;o.checked===!0?_+=`${g}[${o.data?.sourceCheckboxChar===`X`?`X`:`x`}]`:o.checked===!1&&(_+=`${g}[ ]`);let v=o.data?.sourceContinuationIndent,y=p.length+h,b=typeof v==`number`&&v>=y&&v<=y+3?v:y,x=` `.repeat(b),S=o.checked===null||o.checked===void 0?g:` `,C=o.children??[],w=C[0]?.type===`list`,T;if(w){let e=o.checked!==null&&o.checked!==void 0,t=n.containerFlow({...o,children:[C[0]]},r),i=C.slice(1),a=i.length?n.containerFlow({...o,children:i},r):``,s=t.split(`
@@ -551,17 +553,17 @@ Read more at https://docs.orama.com/docs/orama-js/plugins/plugin-secure-proxy#pl
551
553
 
552
554
  `:`
553
555
  `;return l.join(f)},table(e,t,n,r){let i=n.enter(`table`),a=[],o=[],s=e.children??[];for(let e of s){let t=e.children??[],i=[],s=[];for(let e of t){let t=n.enter(`tableCell`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,{...r,before:` `,after:` `});a(),t(),i.push(o);let c=e.data?.sourcePadding;s.push(c&&typeof c.left==`number`&&typeof c.right==`number`?{left:c.left,right:c.right}:null)}a.push(i),o.push(s)}i();let c=e.align??[],l=e.data?.sourceDashCounts,u=a[0]?.length??0,d=a.slice(1).reduce((e,t)=>Math.max(e,t.length),0),f=Math.max(u,d,c.length);if(f===0)return console.warn(JSON.stringify({event:`table-serialize-dropped-empty`,rows:s.length})),``;let p=[];for(let e=0;e<f;e++){let t=c[e],n=``,r=``;t===`center`?(n=`:`,r=`:`):t===`left`?n=`:`:t===`right`&&(r=`:`);let i=l?.[e],a=typeof i==`number`&&i>=1?i:1;p.push(n+`-`.repeat(a)+r)}let m=(e,t)=>{let n=[];for(let r=0;r<f;r++){let i=e[r]??``,a=t[r]??{left:1,right:1};n.push(` `.repeat(a.left)+i+` `.repeat(a.right))}let r=v&&!v.leading?``:`|`,i=v&&!v.trailing?``:`|`;return`${r}${n.join(`|`)}${i}`},h=e.data?.sourceAlignmentPadding,g=Array.from({length:f},(e,t)=>{let n=h?.[t];return n&&typeof n.left==`number`&&typeof n.right==`number`?n:null}),_=e.data?.sourceOuterPipes,v=_&&f>=2&&a.every(e=>{let t=(e[0]??``).trim(),n=(e[f-1]??``).trim();return(_.leading||t.length>0)&&(_.trailing||n.length>0&&!n.endsWith(`\\`))})?_:null;if(a.length===0)return m(p,g);let y=[];y.push(m(a[0],o[0]??[])),y.push(m(p,g));for(let e=1;e<a.length;e++)y.push(m(a[e],o[e]??[]));return y.join(`
554
- `)},mdxJsxFlowElement(e,t,n,r){let i=e,a=i.data?.sourceRaw;if(typeof a==`string`)return a;let o=i.data?.htmlBoundary;if(o&&typeof o.opener==`string`&&typeof o.closer==`string`){let e=n.containerFlow({type:`root`,children:i.children??[]},r);return`${o.opener}\n\n${e}\n\n${o.closer}`}let s=i.name??``,c=P5(i.attributes??[]);return!i.children||i.children.length===0?s?c?`<${s} ${c} />`:`<${s} />`:``:j5({...i,attributes:(i.attributes??[]).map(I5)},t,n,r)},mark(e,t,n,r){let i=n.createTracker(r),a=n.enter(`mark`),o=i.move(`==`);return o+=Y5(n.containerPhrasing(e,{before:o,after:`==`,...i.current()}),r,`==`),o+=i.move(`==`),a(),o},comment(e,t,n,r){let i=e.data?.sourceForm,a=i===`html`?`<!-- `:`%%`,o=i===`html`?` -->`:`%%`,s=n.createTracker(r),c=n.enter(`comment`),l=s.move(a);return l+=n.containerPhrasing(e,{before:l,after:o,...s.current()}),l+=s.move(o),c(),l},commentBlock(e,t,n,r){let i=n.createTracker(r),a=n.enter(`commentBlock`),o=e.children??[],s=e.data?.sourceForm,c=e.data?.sourceLayout,l=o.length===1&&o[0]?.type===`paragraph`;if(s===`html`&&l){let e=o[0],t=n.containerPhrasing(e,{before:`<!-- `,after:` -->`,...i.current()});return a(),`<!-- ${t} -->`}if(c===`inline`&&l){let e=o[0],t=n.containerPhrasing(e,{before:`%% `,after:` %%`,...i.current()});return a(),`%% ${t} %%`}let u=n.containerFlow(e,i.current());return a(),`%%\n\n${u}\n\n%%`},mdxJsxTextElement(e){let t=e.data?.sourceRaw;if(typeof t==`string`)return t;let n=e.name??``,r=P5(e.attributes??[]);return r?`<${n} ${r} />`:`<${n}/>`},rawMdxFallback(e){return e.value??``},blockquote(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.containerFlow(e,a.current());i();let s=e.data?.sourceMarkerSpacings,c=0;return n.indentLines(o,(e,t,n)=>{if(n)return`>`;let r=c++,i=s?.[r];return i===`lazy`&&r>0&&!M5.test(e)?e:i===`none`||i===0?`>${e}`:typeof i==`number`&&i>=2&&!e.startsWith(` `)?`>${` `.repeat(i)}${e}`:`> ${e}`})}};function P5(e){let t=[];for(let n of e){if(n.type===`mdxJsxExpressionAttribute`){t.push(`{${n.value}}`);continue}let e=n.name;if(n.value===null||n.value===void 0){t.push(e);continue}if(typeof n.value==`string`){n.value.includes(`"`)?t.push(`${e}={${F5(n.value)}}`):t.push(`${e}="${n.value}"`);continue}t.push(`${e}={${n.value.value}}`)}return t.join(` `)}function F5(e){return`"${e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`}function I5(e){return e.type===`mdxJsxAttribute`&&typeof e.value==`string`&&e.value.includes(`"`)?{type:`mdxJsxAttribute`,name:e.name,value:{type:`mdxJsxAttributeValueExpression`,value:F5(e.value)}}:e}function L5(e,t,n=` `){return t===`single`?`${n}'${e.replace(/'/g,`\\'`)}'`:t===`paren`?`${n}(${e.replace(/[()]/g,`\\$&`)})`:`${n}"${e.replace(/"/g,`\\"`)}"`}function R5(e){if(!e)return``;let t=0,n=!0;for(let r of e)r===`(`?t++:r===`)`&&(t--,t<0&&(n=!1));return t!==0&&(n=!1),n?e:e.replace(/[\\()]/g,`\\$&`)}function z5(e){return e.replace(/(?<!\\)&(?=(#[0-9]+|#[xX][0-9A-Fa-f]+|[A-Za-z][A-Za-z0-9]*);)/g,(e,t)=>B5(t)?e:`\\${e}`)}function B5(e){if(e.charCodeAt(0)!==35)return!1;let t=e[1]===`x`||e[1]===`X`?Number.parseInt(e.slice(2),16):Number.parseInt(e.slice(1),10);return t===9||t===10||t===11||t===12||t===13||t===32||t===160}var V5=``,H5=/&#(?:x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);/g;function U5(e){return e.replace(H5,e=>eQ(e)?V5+e.slice(1):e)}function W5(e,t,n){let r=e.unsafe;e.unsafe=r.filter(e=>!(e.character===`&`&&e.after===`[#A-Za-z]`||e.character===`<`||e.character===`[`||e.character===`(`||e.character===`!`&&e.after===`\\[`&&e.inConstruct===`phrasing`||e.character===`@`&&e.before===`[+\\-.\\w]`||e.character===`{`&&Array.isArray(e.inConstruct)&&e.inConstruct.includes(`phrasing`)||e.character==="`"||(e.character===`*`||e.character===`_`||e.character===`~`)&&e.inConstruct===`phrasing`||e.character===`=`&&e.atBreak===!0||e.character===` `&&e.inConstruct===`phrasing`&&e.after===`[\\r\\n]`||e.character===` `&&e.inConstruct===`phrasing`&&e.after===`[\\r\\n]`)),e.unsafe=e.unsafe.map(e=>{if(e.character!==`)`||e.atBreak!==!0||e.before!==`\\d+`||e.after!==void 0)return e;let t={...e,after:`(?:[ \r
555
- ]|$)`};return delete t._compiled,t});let i;try{i=e.safe(U5(t),n)}finally{e.unsafe=r}return i=i.replaceAll(V5,`\\&`),z5(sne(i,n))}var G5=1,K5=2;function q5(e){if(Number.isNaN(e))return`ws`;let t=m(e);return t===G5?`ws`:t===K5?`punct`:`other`}function J5(e,t,n){let r=q5(t),i=q5(n),a=i!==`ws`&&(i===`other`||r!==`other`),o=r!==`ws`&&(r===`other`||i!==`other`);return e===`_`?a&&(!o||r===`punct`)||o&&(!a||i===`punct`):a||o}function one(e,t,n){let r=t;for(;r<e.length&&(e[r]===` `||e[r]===` `);)r++;if(r<e.length)return e[r]===`
556
- `||e[r]===`\r`;let i=n.after.charCodeAt(0);return Number.isNaN(i)||i===10||i===13}function sne(e,t){let n=``,r=0;for(;r<e.length;){let i=e.charAt(r);if(i===`\\`){n+=e.slice(r,r+2),r+=2;continue}if(i===`*`||i===`_`||i===`~`||i===`=`){let a=r+1;for(;a<e.length&&e.charAt(a)===i;)a++;let o=r===0?t.before.charCodeAt(t.before.length-1):e.charCodeAt(r-1);if(i===`=`)n+=(Number.isNaN(o)||o===10||o===13)&&one(e,a,t)?`\\${e.slice(r,a)}`:e.slice(r,a);else{let s=a<e.length?e.charCodeAt(a):t.after.charCodeAt(0);n+=J5(i,o,s)?`\\${i}`.repeat(a-r):e.slice(r,a)}r=a;continue}n+=i,r+=1}return n}function Y5(e,t,n){let r=n.startsWith(`_`)?`_`:`*`,i=t.before??``,a=t.after??``,o=e,s=o.charCodeAt(0);X5(i.charCodeAt(i.length-1),s,r)&&(o=Z5(s)+o.slice(1));let c=o.charCodeAt(o.length-1);return X5(a.charCodeAt(0),c,r)&&(o=o.slice(0,-1)+Z5(c)),o}function X5(e,t,n){return!(m(t)!==G5||n===`_`&&m(e)===void 0)}function Z5(e){return`&#x${e.toString(16).toUpperCase()};`}function cne(e,t,n,r){let i=e.value??``,a=e.data?.sourceDelimiter,o=typeof a==`string`&&/^\$+$/.test(a)?a.length:2;for(o===1&&!une(i,r)&&(o=2);RegExp(`(^|[^$])${`\\$`.repeat(o)}([^$]|$)`).test(i);)o++;let s=`$`.repeat(o);/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^\$|\$$/.test(i))&&(i=` ${i} `);let c=-1;for(;++c<n.unsafe.length;){let e=n.unsafe[c];if(!e.atBreak)continue;let t=n.compilePattern(e),r;for(;(r=t.exec(i))!==null;){let e=r.index;i.codePointAt(e)===10&&i.codePointAt(e-1)===13&&e--,i=`${i.slice(0,e)} ${i.slice(r.index+1)}`}}return s+i+s}function lne(e,t,n,r){let i=e.data?.sourceDelimiter===`~`?`~`:`~~`,a=n.createTracker(r),o=n.enter(`strikethrough`),s=a.move(i);return s+=Y5(n.containerPhrasing(e,{...a.current(),before:s,after:`~`}),r,i),s+=a.move(i),o(),s}function une(e,t){return!(e.length===0||!/^\S/.test(e)||!/\S$/.test(e)||/[$\r\n]/.test(e)||e.endsWith(`\\`)||/\\[!-/:-@[-`{-~]/.test(e)||/^\d/.test(t.after)||t.before.endsWith(`\\`))}function Q5(e){if(!Number.isFinite(e)||e<0)return``;if(e<1024)return`${e} B`;let t=[`KiB`,`MiB`,`GiB`,`TiB`],n=e/1024,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n.toFixed(1).replace(/\.0$/,``)} ${t[r]}`}var dne=class{schema;handlers;pmNodeHandlers;pmMarkHandlers;parseProcessor;serializeProcessor;parseCtx={current:{}};freshnessHolder={checker:void 0};constructor(e){this.schema=WS(e.extensions),this.handlers=_ne(this.schema,this.parseCtx),this.freshnessHolder.checker=e.deriveStructuralFreshness?J0({parse:e=>this.parseWithFallback(e)}):void 0;let{nodeHandlers:t,markHandlers:n}=vne(this.schema,this.freshnessHolder);this.pmNodeHandlers=t,this.pmMarkHandlers=n,this.parseProcessor=p5({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers}),this.serializeProcessor=m5({toMarkdownHandlers:N5})}parse(e,t){if(!e.trim())return{type:`doc`,content:[{type:`paragraph`,content:[]}]};this.parseCtx.current=t??{};try{return b5(e,this.parseProcessor).toJSON()}finally{this.parseCtx.current={}}}parseToMdast(e){return e.trim()?x5(e,this.parseProcessor):{type:`root`,children:[]}}parseToEditorMdast(e){return e.trim()?S5(e,this.parseProcessor):{type:`root`,children:[]}}parseWithFallback(e,t){return e.trim()?u4(e,{parse:e=>this.parse(e,t)}):{type:`doc`,content:[{type:`paragraph`,content:[]}]}}serialize(e,t){let n;try{n=this.schema.nodeFromJSON(e)}catch(t){let n=`MarkdownManager.serialize() failed: schema rejected JSONContent (type=${e.type}, childCount=${e.content?.length??0})`;throw Error(n,{cause:t})}let r=this.freshnessHolder.checker;t?.skipFreshnessDerive&&(this.freshnessHolder.checker=void 0);try{return w5(n,this.serializeProcessor,{schema:this.schema,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers})}finally{this.freshnessHolder.checker=r}}},$5=V2();function fne(e,t){let n=new Map;for(let e of t)n.set(e.name,e);let r={};for(let t of e){if(t.type===`mdxJsxExpressionAttribute`)continue;let e=t.name,i=n.get(e);if(t.value===null||t.value===void 0){r[e]=!0;continue}if(typeof t.value==`string`){if(i?.type===`number`){let n=Number(t.value);r[e]=Number.isNaN(n)?t.value:n}else i?.type===`boolean`?r[e]=t.value===`true`:r[e]=t.value;continue}let a=t.value.value;try{r[e]=JSON.parse(a)}catch{r[e]=a}}return r}function pne(e){let t=!1;return e.descendants(e=>t||e.type.name===`jsxInline`?!1:e.type.name===`jsxComponent`&&e.attrs.sourceDirty?(t=!0,!1):!0),t}function mne(e,t){return e.attrs.sourceDirty||pne(e)?!0:t?t.isDiverged(e.toJSON()):!1}function hne(e){if(e.type!==`paragraph`)return!1;let t=e.children??[];return t.length===0?!0:t.every(e=>e.type===`text`&&e.value===``)}function e7(e,t){if(!t)return e;let n={};return t.sourceFenceChar&&(n.sourceFenceChar=t.sourceFenceChar),typeof t.sourceFenceLength==`number`&&(n.sourceFenceLength=t.sourceFenceLength),t.sourcePadded===!0&&(n.sourcePadded=!0),Object.keys(n).length===0?e:{...e,data:n}}function t7(e,t){if(e.length===0)return e7({type:`inlineCode`,value:``},t);if(e.every(e=>e.type===`text`))return e7({type:`inlineCode`,value:e.map(e=>e.value).join(``)},t);if(e.length===1&&`children`in e[0]){let n=e[0];return{...n,children:[t7(n.children,t)]}}return e7({type:`inlineCode`,value:n7(e)},t)}function n7(e){let t=``;for(let n of e)n.type===`text`?t+=n.value:`children`in n&&Array.isArray(n.children)?t+=n7(n.children):`value`in n&&typeof n.value==`string`&&(t+=n.value);return t}var gne=xd;function _ne(e,t){let n=e.nodes,r=e.marks,i={};n.paragraph&&(i.paragraph=(e,t,r)=>{let i=r.all(e).flat(),a=i.some(e=>e?.isBlock&&!e?.isInline),o=i.some(e=>e?.isInline||e?.isText||e?.isTextblock);if(a&&!o)return i.length===1?i[0]:i;if(a&&o){let e=i.filter(e=>!e?.isBlock||e?.isInline),t=i.filter(e=>e?.isBlock&&!e?.isInline),r=[],a=n.paragraph.createAndFill(null,e.length>0?e:null);return a&&r.push(a),r.push(...t),r.length===1?r[0]:r}return n.paragraph.createAndFill(null,i.length>0?i:null)}),n.blockquote&&(i.blockquote=MN(n.blockquote,e=>({sourceMarkerSpacings:e.data?.sourceMarkerSpacings??null}))),n.tableCell&&(i.tableCell=(e=>(t,r,i)=>{let a=i.all(t).flat();if(a.length>0&&n.paragraph){let t=n.paragraph.create(null,a);return e.createAndFill(null,[t])}return e.createAndFill(null,null)})(n.tableCell)),n.tableRow&&(i.tableRow=MN(n.tableRow)),n.table&&n.tableRow&&n.tableCell&&(i.table=(e,t,r)=>{let i=e.align??[],a=e.children??[],o=[];for(let e=0;e<a.length;e++){let t=a[e];if(t.type!==`tableRow`)continue;let s=t.children??[],c=[];for(let t=0;t<s.length;t++){let a=s[t];if(a.type!==`tableCell`)continue;let o=r.all(a).flat(),l=o.length>0&&n.paragraph?[n.paragraph.create(null,o)]:null,u=i[t]??null,d=e===0&&n.tableHeader?n.tableHeader:n.tableCell,f=a.data?.sourcePadding??null,p=d.createAndFill({align:u,sourcePadding:f},l);p&&c.push(p)}let l=n.tableRow.createAndFill(null,c.length>0?c:null);l&&o.push(l)}let s=e.data?.sourceDashCounts??null,c=e.data?.sourceOuterPipes??null,l=e.data?.sourceAlignmentPadding??null;return n.table.createAndFill({sourceDashCounts:s,sourceOuterPipes:c,sourceAlignmentPadding:l},o.length>0?o:null)}),n.image&&(i.image=e=>{let r=e.url??``,i=O5(r,t.current.sourcePath);return n.image.createAndFill({src:i,alt:e.alt??null,title:e.title??null,sourceUrl:i===r?null:r})},n.imageReference?i.imageReference=e=>n.imageReference.createAndFill({alt:e.alt??``,label:e.label??e.identifier??``,identifier:e.identifier??``,referenceType:e.referenceType??`shortcut`}):i.imageReference=e=>n.image.createAndFill({src:``,alt:e.alt??null,title:null})),r.escapeMark&&(i.text=t=>{let n=t.value??``,i=typeof t.data?.sourceRaw==`string`?t.data.sourceRaw:null;if(!n&&!i)return null;if(i)return r.sourceLiteral?e.text(n,[r.sourceLiteral.create({sourceRaw:i})]):e.text(n);let a=t.data?.escapedChars,o=t.data?.entityRefSpans;if(!a?.length&&!o?.length)return e.text(n);let s=[...(a??[]).map(e=>({kind:`escape`,offset:e.offset,length:1})),...(o??[]).map(e=>({kind:`entity`,offset:e.offset,length:e.length,raw:e.raw}))];s.sort((e,t)=>e.offset-t.offset);let c=[];for(let e of s){let t=c[c.length-1];e.kind===`entity`&&t?.kind===`entity`&&t.offset+t.length===e.offset&&rQ(t.raw)!==null&&eQ(e.raw)?c[c.length-1]={kind:`entity`,offset:t.offset,length:t.length+e.length,raw:t.raw+e.raw}:c.push(e)}let l=[],u=0;for(let t of c){if(t.offset>u){let r=n.slice(u,t.offset);r&&l.push(e.text(r))}if(t.offset<n.length){let i=n.slice(t.offset,t.offset+t.length);if(i)if(t.kind===`escape`)l.push(e.text(i,[r.escapeMark.create()]));else if(r.sourceLiteral){let n=rQ(t.raw);l.push(e.text(n??i,[r.sourceLiteral.create({sourceRaw:t.raw})]))}else l.push(e.text(i));u=t.offset+t.length}}if(u<n.length){let t=n.slice(u);t&&l.push(e.text(t))}return l.length===1?l[0]:l}),r.code&&(i.inlineCode=t=>e.text(t.value,[r.code.create({sourceFenceChar:t.data?.sourceFenceChar??"`",sourceFenceLength:typeof t.data?.sourceFenceLength==`number`?t.data.sourceFenceLength:1,sourcePadded:t.data?.sourcePadded===!0})]));let a=r.strike??r.delete;if(a&&(i.delete=NN(a,e=>({sourceDelimiter:e.data?.sourceDelimiter===`~`?`~`:`~~`}))),r.highlight&&(i.mark=NN(r.highlight)),r.comment&&(i.comment=NN(r.comment,e=>({sourceForm:e.data?.sourceForm??`percent`}))),n.commentBlock&&(i.commentBlock=MN(n.commentBlock,e=>({sourceForm:e.data?.sourceForm??`percent`,sourceLayout:e.data?.sourceLayout??`block`}))),r.emphasis&&(i.emphasis=NN(r.emphasis,e=>({sourceDelimiter:e.data?.sourceDelimiter??`*`}))),r.strong&&(i.strong=NN(r.strong,e=>({sourceDelimiter:e.data?.sourceDelimiter??`**`}))),n.heading&&(i.heading=MN(n.heading,e=>({level:e.depth,headingStyle:e.data?.sourceStyle??`atx`,sourceTrailingHashes:e.data?.sourceTrailingHashes??null,sourceUnderlineLength:e.data?.sourceUnderlineLength??null,sourceContiguousNext:e.data?.sourceContiguousNext??!1,sourceLeadingIndent:e.data?.sourceLeadingIndent??null,sourceInteriorSpacing:e.data?.sourceInteriorSpacing??null}))),n.codeBlock&&(i.code=t=>{let r=t.value?[e.text(t.value)]:[];return n.codeBlock.createAndFill({language:t.lang??null,meta:t.meta??null,fenceDelimiter:t.data?.sourceFenceChar??"`",fenceLength:t.data?.sourceFenceLength??3,sourceStyle:t.data?.sourceStyle??`fenced`,sourceClosingFenceLength:t.data?.sourceClosingFenceLength??null,sourceUnclosedFence:t.data?.sourceUnclosedFence??!1,sourceFenceIndent:t.data?.sourceFenceIndent??null,sourceInfoPadding:t.data?.sourceInfoPadding??null,sourceIndents:t.data?.sourceIndents??null},r)}),n.thematicBreak&&(i.thematicBreak=e=>n.thematicBreak.createAndFill({sourceRaw:e.data?.sourceRaw??`---`})),n.hardBreak&&(i.break=e=>n.hardBreak.createAndFill({hardBreakStyle:e.data?.sourceStyle??`spaces`,sourceRaw:e.data?.sourceRaw??null})),n.list&&(i.list=MN(n.list,e=>({ordered:!!e.ordered,start:e.start??1,spread:!!e.spread,bulletMarker:e.data?.bulletMarker??null,listMarkerDelimiter:e.data?.listMarkerDelimiter??null}))),n.listItem&&(i.listItem=MN(n.listItem,e=>({checked:e.checked??null,spread:!!e.spread,sourceMarkerSpacing:e.data?.sourceMarkerSpacing??null,sourceOrdinal:e.data?.sourceOrdinal??null,sourceCheckboxChar:e.data?.sourceCheckboxChar??null,sourceContinuationIndent:e.data?.sourceContinuationIndent??null}))),r.link){let t=r.sourceLiteral;i.link=(n,i,a)=>{if((n.children??[]).length===0){let r=typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:`[](${n.url??``})`;return r?t?e.text(r,[t.create({sourceRaw:r})]):e.text(r):null}let o=a.all(n).flat(),s=r.link.create({href:n.url??``,title:n.title??null,linkStyle:n.data?.sourceStyle??`inline`,refLabel:null,sourceUrlForm:n.data?.sourceUrlForm??null,sourceTitleMarker:n.data?.sourceTitleMarker??null});return o.map(e=>e.mark(s.addToSet(e.marks)))},i.linkReference=(n,i,a)=>{if((n.children??[]).length===0){let r=typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:`[${n.label??``}][${n.identifier??``}]`;return r?t?e.text(r,[t.create({sourceRaw:r})]):e.text(r):null}let o=a.all(n).flat(),s=r.link.create({href:``,title:null,linkStyle:n.referenceType??`shortcut`,refLabel:n.label??n.identifier??null});return o.map(e=>e.mark(s.addToSet(e.marks)))}}n.htmlBlock&&(i.html=e=>n.htmlBlock.createAndFill({content:e.value??``}));let o=n.linkDefinition??n.linkRefDef;if(o){let e=!!o.spec.attrs?.url,t=!!o.spec.attrs?.href,n=!!o.spec.attrs?.identifier,r=!!o.spec.attrs?.sourceLayout,a=!!o.spec.attrs?.sourceTitleMarker;i.definition=i=>{let s={title:i.title??null};return n&&(s.identifier=i.identifier??``),s.label=i.label??i.identifier??``,e?s.url=i.url??``:t&&(s.href=i.url??``),r&&(s.sourceLayout=i.data?.sourceLayout??null),a&&(s.sourceTitleMarker=i.data?.sourceTitleMarker??null),o.createAndFill(s)}}if(n.jsxComponent){let r=e=>{if(e&&typeof e==`object`&&`sourceRaw`in e){let t=e.sourceRaw;if(typeof t==`string`)return t}};i.mdxJsxFlowElement=(e,i,a)=>{let o=e.name??``,s=$5.getOrWildcard(o),c=fne(e.attributes,s.props);if(o===`CommonMarkImage`&&typeof c.src==`string`){let e=c.src,n=O5(e,t.current.sourcePath);n!==e&&(c.src=n,c.sourceUrl=e)}let l=a.all(e).flat();return n.jsxComponent.createAndFill({componentName:o,kind:`element`,attributes:e.attributes,sourceRaw:r(e.data)??``,sourceDirty:!1,props:c},l.length?l:void 0)};let a=(e,t)=>{let n=e.attributes?.find(e=>e.type===`mdxJsxAttribute`&&e.name===t);return n&&typeof n.value==`string`?n.value:null};i.mdxJsxTextElement=t=>{if(t.name===`InlineMath`&&n.mathInline){let e=a(t,`formula`)??``,r=a(t,`id`);return n.mathInline.create({formula:e,id:r??null})}if(t.name===`Tag`&&n.tag){let e=a(t,`value`)??``;return n.tag.create({value:e})}if(n.jsxInline){let i=r(t.data)??``;return n.jsxInline.createAndFill({},i?[e.text(i)]:null)}return n.jsxComponent.createAndFill({sourceRaw:r(t.data)??``})},i.mdxFlowExpression=e=>{let t=r(e.data)??`{${e.value??``}}`;return n.jsxComponent.createAndFill({kind:`expression`,sourceRaw:t,sourceDirty:!1})},i.mdxTextExpression=t=>{let n=r(t.data)??`{${t.value??``}}`;return e.text(n)}}return n.wikiLink&&(i.wikiLink=e=>n.wikiLink.createAndFill({target:e.data?.target??``,alias:e.data?.alias??null,anchor:e.data?.anchor??null,sourceTarget:e.data?.sourceTarget??null,sourceAnchor:e.data?.sourceAnchor??null,sourceAlias:e.data?.sourceAlias??null})),n.tag&&(i.tag=e=>n.tag.createAndFill({value:e.value})),n.wikiLinkEmbed&&(i.wikiLinkEmbed=(i,a)=>{let o=i.data?.target??``,s=i.data?.alias??null,c=i.data?.anchor??null,l=bQ(o),{resolveEmbed:u,sourcePath:d}=t.current,f=u&&d?u(o,d)??null:null,p=f?`/${f}`:o,m=a?.type===`paragraph`&&Array.isArray(a.children)&&a.children.length===1;if(m&&gne.has(l)&&n.jsxComponent&&$5.has(`WikiEmbedImage`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedImage`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,alt:s??o,target:o,anchor:c,alias:s}});if(m&&Sd.has(l)&&n.jsxComponent&&$5.has(`WikiEmbedVideo`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedVideo`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,title:s??o,target:o,anchor:c,alias:s}});if(m&&wd.has(l)&&n.jsxComponent&&$5.has(`WikiEmbedAudio`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedAudio`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,title:s??o,target:o,anchor:c,alias:s}});if(m&&Td.has(l)&&n.jsxComponent&&$5.has(`WikiEmbedFile`)){let{resolveSize:e}=t.current,r=e&&d?e(o,d)??null:null,i=r===null?null:Q5(r);return n.jsxComponent.createAndFill({componentName:`WikiEmbedFile`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,target:o,anchor:c,alias:s,size:i}})}let h=s||(c?`${o}#${c}`:o);if(r.link){let t=r.link.create({href:p,title:null,linkStyle:`inline`,refLabel:null,sourceForm:`wikiembed`,target:o,anchor:c,alias:s});return e.text(h,[t])}throw Error("[wikiLinkEmbed handler] schema lacks `link` mark — cannot dispatch without violating the STOP rule against emitting PM wikiLinkEmbed server-side")}),n.mathInline&&(i.inlineMath=e=>n.mathInline.create({formula:e.value??``,sourceDelimiter:e.data?.sourceDelimiter??null})),i.math||=t=>{let r=t.value==null?`«unknown:${t.type}»`:t.value;return n.rawMdxFallback?(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled block mdast: ${t.type}`})),n.rawMdxFallback.createAndFill({reason:`Unhandled block mdast: ${t.type}`},r?[e.text(r)]:null)):null},i.inlineMath||=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled inline mdast: ${t.type}`})),t.value==null?e.text(`«unknown:${t.type}»`):e.text(t.value)),n.footnoteReference?i.footnoteReference=e=>n.footnoteReference.create({identifier:e.identifier,label:e.label??e.identifier}):i.footnoteReference||=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:`footnoteReference`,reason:`FootnoteReference extension missing — recovering [^id] source`})),e.text(`[^${t.label??t.identifier}]`)),n.footnoteDefinition?i.footnoteDefinition=MN(n.footnoteDefinition,e=>{let t=e;return{identifier:t.identifier,label:t.label??t.identifier}}):i.footnoteDefinition||=t=>{console.warn(JSON.stringify({event:`unknown-mdast-type`,type:`footnoteDefinition`,reason:`FootnoteDefinition extension missing — recovering [^id]: marker`}));let r=`[^${t.label??t.identifier}]: `;return n.paragraph?n.paragraph.create(null,e.text(r)):null},i.rawMdxFallbackMdast=t=>{if(!n.rawMdxFallback)return null;let r=t.position?{start:t.position.start?.offset??0,end:t.position.end?.offset??0}:{start:0,end:0};return console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.originalType,reason:`Unhandled mdast: ${t.originalType}`,unresolvedPosition:t.unresolvedPosition??!1})),n.rawMdxFallback.createAndFill({reason:`Unhandled mdast: ${t.originalType}`,originalSpan:r},t.value?[e.text(t.value)]:null)},i}function vne(e,t){let n={},r={},i=e.nodes,a=e.marks;i.paragraph&&(n.paragraph=RN(`paragraph`)),i.blockquote&&(n.blockquote=RN(`blockquote`,e=>{let t=e.attrs.sourceMarkerSpacings,n={};return Array.isArray(t)&&t.length>0&&(n.sourceMarkerSpacings=t),Object.keys(n).length>0?{data:n}:{}})),i.heading&&(n.heading=RN(`heading`,e=>({depth:e.attrs.level,data:{sourceStyle:e.attrs.headingStyle,sourceTrailingHashes:e.attrs.sourceTrailingHashes??void 0,sourceUnderlineLength:e.attrs.sourceUnderlineLength??void 0,sourceContiguousNext:e.attrs.sourceContiguousNext===!0?!0:void 0,sourceLeadingIndent:e.attrs.sourceLeadingIndent??void 0,sourceInteriorSpacing:e.attrs.sourceInteriorSpacing??void 0}}))),i.codeBlock&&(n.codeBlock=e=>{let t=e.attrs.sourceStyle===`indented`?`indented`:`fenced`;return{type:`code`,lang:t===`indented`?null:e.attrs.language??null,meta:t===`indented`?null:e.attrs.meta??null,value:e.textContent??``,data:{sourceFenceChar:e.attrs.fenceDelimiter,sourceFenceLength:e.attrs.fenceLength,sourceStyle:t,sourceClosingFenceLength:e.attrs.sourceClosingFenceLength??void 0,sourceUnclosedFence:e.attrs.sourceUnclosedFence===!0?!0:void 0,sourceFenceIndent:e.attrs.sourceFenceIndent??void 0,sourceInfoPadding:e.attrs.sourceInfoPadding??void 0,sourceIndents:e.attrs.sourceIndents??void 0}}}),i.thematicBreak&&(n.thematicBreak=e=>({type:`thematicBreak`,data:{sourceRaw:e.attrs.sourceRaw}})),i.hardBreak&&(n.hardBreak=e=>({type:`break`,data:{sourceStyle:e.attrs.hardBreakStyle,...typeof e.attrs.sourceRaw==`string`&&e.attrs.sourceRaw.length>0?{sourceRaw:e.attrs.sourceRaw}:{}}})),i.list&&(n.list=RN(`list`,e=>({ordered:e.attrs.ordered??!1,start:e.attrs.ordered?e.attrs.start??1:null,spread:e.attrs.spread??!1,data:{bulletMarker:e.attrs.bulletMarker,listMarkerDelimiter:e.attrs.listMarkerDelimiter}}))),i.listItem&&(n.listItem=(e,t,n)=>{let r=n.all(e),i=r.length>1&&hne(r[0])?r.slice(1):r,a={};return typeof e.attrs.sourceMarkerSpacing==`number`&&(a.sourceMarkerSpacing=e.attrs.sourceMarkerSpacing),typeof e.attrs.sourceOrdinal==`number`&&(a.sourceOrdinal=e.attrs.sourceOrdinal),e.attrs.sourceCheckboxChar===`X`&&(a.sourceCheckboxChar=`X`),typeof e.attrs.sourceContinuationIndent==`number`&&(a.sourceContinuationIndent=e.attrs.sourceContinuationIndent),{type:`listItem`,checked:e.attrs.checked??null,spread:e.attrs.spread??!1,...Object.keys(a).length>0?{data:a}:{},children:i}}),i.table&&(n.table=(e,t,n)=>{let r=n.all(e),i=[],a=e.firstChild;a&&a.forEach(e=>{let t=e.attrs.align;i.push(t===`left`||t===`right`||t===`center`?t:null)});let o=r.filter(e=>e.type===`tableRow`),s=e.attrs.sourceDashCounts,c={};Array.isArray(s)&&s.length>0&&(c.sourceDashCounts=s);let l=e.attrs.sourceOuterPipes;typeof l==`object`&&l&&typeof l.leading==`boolean`&&typeof l.trailing==`boolean`&&(c.sourceOuterPipes=l);let u=e.attrs.sourceAlignmentPadding;Array.isArray(u)&&u.length>0&&(c.sourceAlignmentPadding=u);let d=Object.keys(c).length>0?c:void 0,f={type:`table`,align:i,children:o};return d&&(f.data=d),f}),i.tableRow&&(n.tableRow=RN(`tableRow`));let o=(e,t)=>{let n={type:`tableCell`,children:m0(t)},r=e.attrs.sourcePadding;return typeof r==`object`&&r&&typeof r.left==`number`&&typeof r.right==`number`&&(n.data={sourcePadding:r}),n};if(i.tableCell&&(n.tableCell=(e,t,n)=>o(e,n.all(e))),i.tableHeader&&(n.tableHeader=(e,t,n)=>o(e,n.all(e))),i.image&&(n.image=e=>({type:`image`,url:e.attrs.sourceUrl??e.attrs.src,alt:e.attrs.alt,title:e.attrs.title})),i.imageReference&&(n.imageReference=e=>{let t=e.attrs.label??``,n=e.attrs.identifier??t;return{type:`imageReference`,alt:e.attrs.alt??``,identifier:n,label:t||n,referenceType:e.attrs.referenceType??`shortcut`}}),i.htmlBlock&&(n.htmlBlock=e=>({type:`html`,value:e.attrs.content})),i.linkDefinition??i.linkRefDef){let e=i.linkDefinition?`linkDefinition`:`linkRefDef`;n[e]=e=>{let t={},n=e.attrs.sourceLayout;(n===`multiline`||n===`inline`)&&(t.sourceLayout=n);let r=e.attrs.sourceTitleMarker;(r===`single`||r===`double`||r===`paren`)&&(t.sourceTitleMarker=r);let i={type:`definition`,identifier:e.attrs.identifier??e.attrs.label??``,label:e.attrs.label??e.attrs.identifier??``,url:e.attrs.url??e.attrs.href??``,title:e.attrs.title};return Object.keys(t).length>0&&(i.data=t),i}}if(i.jsxComponent&&(n.jsxComponent=(e,n,r)=>{if(e.attrs.kind===`expression`)return{type:`html`,value:e.attrs.sourceRaw??``};let i=e.attrs.componentName||null,a=Array.isArray(e.attrs.attributes)?e.attrs.attributes:[];return!mne(e,t.checker)&&e.attrs.sourceRaw?{type:`mdxJsxFlowElement`,name:i,attributes:a,children:[],data:{sourceRaw:String(e.attrs.sourceRaw)}}:$5.getOrWildcard(i??`*`).serialize(e,{all:e=>r.all(e),registry:$5,serializeChildren:()=>{throw Error(`SerializeContext.serializeChildren is not available in the PM→mdast handler. Compat descriptors that need markdown-byte body rendering must emit a marker mdast node and let the to-markdown handler render the body via state.containerFlow.`)}})}),i.rawMdxFallback&&(n.rawMdxFallback=e=>{let t=e.textContent??``,n=typeof e.attrs.reason==`string`?e.attrs.reason:``,r=e.attrs.originalSpan;return{type:`rawMdxFallback`,value:t,data:{reason:n,originalSpan:r&&typeof r==`object`&&`start`in r&&`end`in r?{start:Number(r.start)||0,end:Number(r.end)||0}:{start:0,end:0}}}}),i.jsxInline&&(n.jsxInline=e=>{let t=e.attrs.sourceRaw||e.textContent||``;return{type:`mdxJsxTextElement`,name:null,attributes:[],children:[],data:{sourceRaw:String(t)}}}),i.mathInline&&(n.mathInline=e=>{let t=e.attrs.formula??``,n=e.attrs.id;if(typeof n==`string`&&n.length>0)return{type:`mdxJsxTextElement`,name:`InlineMath`,attributes:[{type:`mdxJsxAttribute`,name:`formula`,value:t},{type:`mdxJsxAttribute`,name:`id`,value:n}],children:[]};let r=e.attrs.sourceDelimiter;return{type:`inlineMath`,value:t,...typeof r==`string`&&r.length>0?{data:{sourceDelimiter:r}}:{}}}),i.wikiLink&&(n.wikiLink=e=>{let t=e.attrs.target??``,n=e.attrs.anchor??null,r=e.attrs.alias??null,i=r||(n?`${t}#${n}`:t);return{type:`wikiLink`,value:i,data:{target:t,anchor:n,alias:r,sourceTarget:typeof e.attrs.sourceTarget==`string`?e.attrs.sourceTarget:null,sourceAnchor:typeof e.attrs.sourceAnchor==`string`?e.attrs.sourceAnchor:null,sourceAlias:typeof e.attrs.sourceAlias==`string`?e.attrs.sourceAlias:null},children:[{type:`text`,value:i}]}}),i.tag&&(n.tag=e=>({type:`tag`,value:String(e.attrs.value??``)})),i.wikiLinkEmbed&&(n.wikiLinkEmbed=e=>{let t=e.attrs.target??``,n=e.attrs.anchor??null,r=e.attrs.alias??null,i=r||(n?`${t}#${n}`:t);return{type:`wikiLinkEmbed`,value:i,data:{target:t,anchor:n,alias:r},children:[{type:`text`,value:i}]}}),a.emphasis&&(r.emphasis=zN(`emphasis`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),a.strong&&(r.strong=zN(`strong`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),a.code&&(r.code=(e,t,n)=>{let r=e.attrs.sourceFenceChar,i=e.attrs.sourceFenceLength;return t7(n,{sourceFenceChar:r,sourceFenceLength:i,sourcePadded:e.attrs.sourcePadded===!0?!0:void 0})}),a.strike??a.delete){let e=a.strike?`strike`:`delete`;r[e]=zN(`delete`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter===`~`?`~`:`~~`}}))}return a.highlight&&(r.highlight=zN(`mark`)),a.comment&&(r.comment=zN(`comment`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`}}))),i.commentBlock&&(n.commentBlock=RN(`commentBlock`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`,sourceLayout:e.attrs.sourceLayout===`inline`?`inline`:`block`}}))),i.footnoteReference&&(n.footnoteReference=e=>{let t=String(e.attrs.identifier??``);return{type:`footnoteReference`,identifier:t,label:e.attrs.label?String(e.attrs.label):t}}),i.footnoteDefinition&&(n.footnoteDefinition=RN(`footnoteDefinition`,e=>({identifier:String(e.attrs.identifier??``),label:e.attrs.label?String(e.attrs.label):String(e.attrs.identifier??``)}))),a.link&&(r.link=(e,t,n)=>{if(e.attrs.sourceForm===`wikiembed`){let t=typeof e.attrs.target==`string`&&e.attrs.target.length>0?e.attrs.target:e.attrs.href??``,r=typeof e.attrs.anchor==`string`&&e.attrs.anchor.length>0?e.attrs.anchor:null,i=typeof e.attrs.alias==`string`&&e.attrs.alias.length>0?e.attrs.alias:null,a=i||(r?`${t}#${r}`:t),o=n.map(e=>`value`in e&&typeof e.value==`string`?e.value:``).join(``);return o!==a&&o.trim().length>0&&!o.includes(`]]`)&&(i=o,a=o),{type:`wikiLinkEmbed`,value:a,data:{target:t,anchor:r,alias:i},children:[{type:`text`,value:a}]}}let r=e.attrs.linkStyle;if(r===`autolink`)return{type:`link`,url:e.attrs.href??``,title:null,children:n,data:{sourceStyle:`autolink`}};if(r===`gfm-autolink`)return{type:`link`,url:e.attrs.href??``,title:null,children:n,data:{sourceStyle:`gfm-autolink`}};if(r===`inline`||!r){let t={};e.attrs.sourceUrlForm===`angle-bracketed`&&(t.sourceUrlForm=`angle-bracketed`);let r=e.attrs.sourceTitleMarker;return(r===`single`||r===`double`||r===`paren`)&&(t.sourceTitleMarker=r),{type:`link`,url:e.attrs.href??``,title:e.attrs.title??null,children:n,...Object.keys(t).length>0?{data:t}:{}}}return{type:`linkReference`,identifier:(e.attrs.refLabel??``).toLowerCase(),label:e.attrs.refLabel,referenceType:r,children:n}}),a.escapeMark&&(r.escapeMark=(e,t,n)=>{for(let e of n)if(e.type===`text`&&e.value){let t=e;t.data??={},t.data.escapedChars??=[];for(let e=0;e<t.value.length;e++)t.data.escapedChars.push({offset:e,char:t.value[e]})}return n.length===1?n[0]:n}),a.sourceLiteral&&(r.sourceLiteral=(e,t,n)=>{let r=typeof e.attrs.sourceRaw==`string`?e.attrs.sourceRaw:``;if(n.length===1&&n[0]?.type===`text`){let e=n[0],t=r||e.value;return aQ(t,e.value)&&(e.data??={},e.data.sourceRaw=t),e}return{type:`text`,value:n.filter(e=>e.type===`text`).map(e=>e.value??``).join(``)||r}}),{nodeHandlers:n,markHandlers:r}}var r7={default:!0,MD013:!1};function i7(e){return e??r7}function yne(e){let t=e.replace(/\\/g,`/`);for(;t.startsWith(`./`);)t=t.slice(2);let n=t.toLowerCase();for(let e of MX)if(n.endsWith(e))return t.slice(0,-e.length);return t}function bne(e){let t=(e===void 0?[]:Array.isArray(e)?e:[e]).map(e=>e.trim()).filter(e=>e.length>0),n=[],r=[],i=[],a=[],o=0;for(let e of t){let t=e.startsWith(`!`),s=t?e.slice(1):e;if(t||(o+=1),s.length===0){n.push({pattern:e,detail:`empty pattern`});continue}try{let e=(0,ZB.default)(s,{dot:!0,strictBrackets:!0});(t?a:i).push(e)}catch(t){n.push({pattern:e,detail:t instanceof Error?t.message:String(t)});continue}if(s.endsWith(`/`))r.push({pattern:e,reason:`trailing-slash`});else if(s.startsWith(`/`))r.push({pattern:e,reason:`leading-slash`});else{let t=s.toLowerCase();MX.some(e=>t.endsWith(e))&&r.push({pattern:e,reason:`doc-extension`})}}let s=o===0;return{invalidPatterns:n,suspiciousPatterns:r,matches(e){if(e===void 0||e===``)return!1;let t=yne(e);return t===``||!(s||i.some(e=>e(t)))?!1:!a.some(e=>e(t))}}}var a7=/[*?[\]{}()+@!|]/;function xne(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);if(n===-1||e.indexOf(`{`,t+1)!==-1||e.indexOf(`}`,n+1)!==-1)return null;let r=e.slice(t+1,n).split(`,`);return r.length<2||r.some(e=>e.trim()===``||a7.test(e))?null:r.map(r=>e.slice(0,t)+r+e.slice(n+1))}function o7(e){if(e.endsWith(`/`)||e.startsWith(`/`))return{kind:`matches-nothing`,pattern:e};try{(0,ZB.default)(e,{dot:!0,strictBrackets:!0})}catch{return{kind:`invalid`,pattern:e}}if(e===`**`||e===`**/*`)return{kind:`everything`};{let t=e.match(/^\*\*\/(.+)\/\*\*$/)?.[1];if(t!==void 0&&!a7.test(t))return{kind:`folder-anywhere`,folder:t};let n=e.match(/^(.+)\/\*\*\/(.+)\/\*\*$/),r=n?.[1],i=n?.[2];if(r!==void 0&&i!==void 0&&!a7.test(r)&&!a7.test(i))return{kind:`folder-recursive-nested`,root:r,folder:i}}for(let t of[`/**/*`,`/**`])if(e.endsWith(t)){let n=e.slice(0,-t.length);if(n.length>0&&!a7.test(n))return{kind:`folder-recursive`,folder:n}}if(e.endsWith(`/*`)){let t=e.slice(0,-2);if(t.length>0&&!a7.test(t))return{kind:`folder-direct`,folder:t}}if(e.startsWith(`**/`)){let t=e.slice(3);if(t.length>0&&!t.includes(`/`)&&!a7.test(t))return{kind:`name-anywhere`,name:t}}return a7.test(e)?{kind:`pattern`,pattern:e}:{kind:`exact`,target:e}}function Sne(e){let t=o7(e);if(t.kind!==`pattern`)return[t];let n=xne(e);if(n!==null){let e=n.map(o7);if(e.every(e=>e.kind!==`pattern`))return e}return[t]}function Cne(e){let t=(e===void 0?[]:Array.isArray(e)?e:[e]).map(e=>e.trim()).filter(e=>e.length>0),n=[],r=[];for(let e of t){let t=e.startsWith(`!`),i=t?e.slice(1):e;i.length!==0&&(t?r:n).push(...Sne(i))}return{includes:n,excludes:r}}function s7(e,t){let n=new Set,r=[];for(let i of e){if(i.enabled===!1||!i.schema||!bne(i.appliesTo).matches(t))continue;let e=i.key??i.file;n.has(e)||(n.add(e),r.push({file:i.file,schema:i.schema}))}return r}var c7={"draft-06":`http://json-schema.org/draft-06/schema#`,"draft-07":`http://json-schema.org/draft-07/schema#`,"2019-09":`https://json-schema.org/draft/2019-09/schema`,"2020-12":`https://json-schema.org/draft/2020-12/schema`},wne=Object.keys(c7),Tne=`draft-07`,Ene=new Map(wne.map(e=>[l7(c7[e]),e]));function l7(e){return e.replace(/^https?:\/\//,``).replace(/#$/,``)}function Dne(e){let t=e.$schema;return t===void 0?Tne:typeof t==`string`?Ene.get(l7(t))??null:null}var u7=new Map;function One(e){throw Error(`Unhandled FrontmatterSchemaDialect: ${JSON.stringify(e)}`)}function kne(e){let t=u7.get(e);if(t)return t;let n={allErrors:!0,strict:!1},r;switch(e){case`2020-12`:r=new YB.default(n);break;case`2019-09`:r=new JB.default(n);break;case`draft-06`:case`draft-07`:r=new qB.default(n);break;default:return One(e)}return(0,XB.default)(r),u7.set(e,r),r}function Ane(e){let{$schema:t,...n}=e;return n}function jne(e,t){let n=kne(e),r=t.$id;return typeof r==`string`&&r!==``&&n.removeSchema(r),n.compile(Ane(t))}var d7=new Map,Mne=256;function Nne(e){let t=JSON.stringify(e),n=d7.get(t);if(n!==void 0)return n;let r=null,i=Dne(e);if(i!==null)try{r=jne(i,e)}catch{r=null}return d7.size>=Mne&&d7.clear(),d7.set(t,r),r}function Pne(e){let t=new Map;if(!sZ.test(e))return{data:{},keyLines:t};let{frontmatter:n}=lZ(e),r=dZ(n);if(r.trim()===``)return{data:{},keyLines:t};let i=Qu(r,{uniqueKeys:!1});if(i.errors.length>0)return{data:{},keyLines:t};let a=i.toJS();if(typeof a!=`object`||!a||Array.isArray(a))return{data:{},keyLines:t};if(Ss(i.contents))for(let e of i.contents.items){let n=e.key;if(!ws(n)||typeof n.value!=`string`||!n.range)continue;let i=0,a=Math.min(n.range[0],r.length);for(let e=0;e<a;e++)r.charCodeAt(e)===10&&i++;t.has(n.value)||t.set(n.value,i+1)}return{data:a,keyLines:t}}function Fne(e){if(e===void 0)return``;let t;if(typeof e==`string`)t=`"${e}"`;else try{t=JSON.stringify(e)??String(e)}catch{t=String(e)}return t.length>60&&(t=`${t.slice(0,57)}…`),` (got ${t})`}function Ine(e){if(!e.startsWith(`/`))return null;let t=e.slice(1).split(`/`)[0]??``;return t===``?null:t.replace(/~1/g,`/`).replace(/~0/g,`~`)}function Lne(e){return e.split(`/`).slice(1).map(e=>e.replace(/~1/g,`/`).replace(/~0/g,`~`)).join(`.`)}function Rne(e,t){if(t.length===0)return[];let{data:n,keyLines:r}=Pne(e),i=e.split(`
557
- `),a=e=>({start:{line:e,character:0},end:{line:e,character:i[e]?.length??0}}),o=[];for(let{schema:e}of t){let t=Nne(e);if(t&&!t(n))for(let e of t.errors??[]){let t=e.keyword,i=0,s;if(t===`required`&&e.instancePath===``)s=`Frontmatter property "${String(e.params.missingProperty??``)}" is required`;else if(e.instancePath===``)s=`Frontmatter ${e.message??`violates "${t}"`}`;else{let a=Ine(e.instancePath);a!==null&&(i=r.get(a)??0);let o=Lne(e.instancePath);if(t===`enum`){let t=e.params.allowedValues??[],r=a!==null&&o===a?n[a]:void 0;s=`Frontmatter property "${o}" must be one of: ${t.map(String).join(`, `)}${Fne(r)}`}else s=`Frontmatter property "${o}" ${e.message??`violates "${t}"`}`}o.push({range:a(i),severity:`warning`,source:`frontmatter`,code:t,message:s})}}return o}var f7=`doc`;function zne(e,t){return WW(e,VW({strings:{[f7]:e},config:t})[f7]??[])}function Bne(e,t){let n=VW({strings:{[f7]:e},config:t})[f7]??[],r=e.split(`
558
- `),i=Vne(t);return n.map(e=>Une(e,r,Hne(e,i)))}function Vne(e){let t=new Map;return Object.entries(e).forEach(([e,n],r)=>{let i=e.toUpperCase();if(i===`DEFAULT`)return;let a=null;if(n===`error`||n===`warning`)a=n;else if(typeof n==`object`&&n&&!Array.isArray(n)){let e=n.severity;(e===`error`||e===`warning`)&&(a=e)}a!==null&&t.set(i,{entryIndex:r,severity:a})}),t}function Hne(e,t){let n;for(let r of e.ruleNames){let e=t.get(r.toUpperCase());e!==void 0&&(n===void 0||e.entryIndex>n.entryIndex)&&(n=e)}return n?.severity??`warning`}function Une(e,t,n){let[r,i]=e.errorRange??[1,null],a=e.lineNumber-1,o=(r??1)-1,s=t[a]?.length??0,c=i==null?s:Math.min(o+i,s),l=e.fixInfo?[Wne(e.fixInfo,e.lineNumber,t)]:void 0;return{range:{start:{line:a,character:o},end:{line:a,character:Math.max(c,o)}},severity:n,source:`markdownlint`,code:e.ruleNames[0]??`MD000`,message:e.errorDetail?`${e.ruleDescription}: ${e.errorDetail}`:e.ruleDescription,...l?{fixes:l}:{}}}function Wne(e,t,n){let r=e.lineNumber??t,i=r-1;if(e.deleteCount===-1){if(r<n.length)return{range:{start:{line:i,character:0},end:{line:i+1,character:0}},newText:``};if(i>0){let e=n[i-1]?.length??0;return{range:{start:{line:i-1,character:e},end:{line:i,character:n[i]?.length??0}},newText:``}}return{range:{start:{line:0,character:0},end:{line:0,character:n[0]?.length??0}},newText:``}}let a=(e.editColumn??1)-1;return{range:{start:{line:i,character:a},end:{line:i,character:a+Math.max(0,e.deleteCount??0)}},newText:e.insertText??``}}var Gne=Oo([I(),z(Jd),Po(P(),xo())]),Kne={id:`markdownlint`,sliceSchema:R({enabled:I(),rules:Po(P(),Gne)}),defaultSlice:{enabled:!1,rules:r7},async lint(e,t){return Bne(e,i7(t.rules))},fix(e,t){return zne(e,i7(t.rules))}},qne=R({appliesTo:Oo([P(),L(P())]).optional(),file:P(),enabled:I().optional(),key:P().optional(),schema:Po(P(),xo()).optional()}),p7=[Kne,{id:`frontmatter`,sliceSchema:R({enabled:I(),schemas:L(qne)}),defaultSlice:{enabled:!1,schemas:[]},async lint(e,t,n){return Rne(e,s7(t.schemas,n.docName))}}],Jne={enabled:!0,plugins:Object.fromEntries(p7.map(e=>[e.id,e.defaultSlice]))},Yne=new Set([`.markdownlint.json`,`.markdownlint.jsonc`]);function Xne(e){return Yne.has(e)}function Zne(e){return{enabled:e.enabled??!0,plugins:{markdownlint:{...e.markdownlint,rules:e.markdownlint.rules??r7},frontmatter:{enabled:e.frontmatter?.enabled??!1,schemas:e.frontmatter?.schemas??[]}}}}var Qne=Object.fromEntries(p7.map(e=>[e.id,e.sliceSchema])),$ne=R({effective:R({enabled:I(),plugins:R(Qne)}),configFile:P().nullable().optional(),configProblems:L(P()).optional()}),ere=Oo([I(),Po(P(),xo())]);R({ruleId:P().min(1).max(64).regex(/^[A-Za-z][A-Za-z0-9_-]*$/),value:Oo([ere,yo()])}),R({file:P().min(1).max(512),delete:B(!0).optional(),field:P().min(1).max(256).optional(),parentPath:L(Oo([P().min(1).max(256),R({items:B(!0)}).strict()])).max(8).optional(),removeField:B(!0).optional(),renameTo:P().min(1).max(256).optional(),constraint:R({type:z([`string`,`number`,`boolean`,`array`,`object`]).nullable().optional(),enum:L(Oo([P(),F(),I()])).nullable().optional(),itemsEnum:L(Oo([P(),F(),I()])).nullable().optional(),itemsType:z([`string`,`number`,`boolean`,`object`]).nullable().optional(),pattern:P().nullable().optional(),format:P().nullable().optional(),description:P().max(2048).nullable().optional(),required:I().optional()}).optional()}).refine(e=>e.delete===void 0||e.field===void 0&&e.constraint===void 0&&e.removeField===void 0&&e.renameTo===void 0,{message:`delete cannot be combined with a field edit`}).refine(e=>[e.constraint,e.removeField,e.renameTo].filter(e=>e!==void 0).length<=1,{message:`constraint, removeField, and renameTo are mutually exclusive`}).refine(e=>e.removeField===void 0&&e.renameTo===void 0||e.field!==void 0,{message:`removeField and renameTo require field`}).refine(e=>e.parentPath===void 0||e.field!==void 0,{message:`parentPath requires field`}).refine(e=>e.field===void 0?e.constraint===void 0:e.constraint!==void 0||e.removeField!==void 0||e.renameTo!==void 0,{message:`field requires constraint, removeField, or renameTo`});var tre=R({schemas:L(P()),truncated:I()}).strict(),m7=R({line:F(),character:F()}),h7=R({start:m7,end:m7}),g7=R({range:h7,severity:z([`error`,`warning`,`info`,`hint`]),source:P(),code:P(),message:P(),fixes:L(R({range:h7,newText:P()})).optional()});R({files:L(R({file:P(),diagnostics:L(g7),warnings:L(P()).optional()})),fileCount:F(),errorCount:F(),warningCount:F(),warnings:L(P())});var nre=g7.extend({linkTarget:P().optional()}),rre=R({files:L(R({file:P(),diagnostics:L(nre)})),fileCount:F(),errorCount:F(),warningCount:F(),warnings:L(P())});R({docName:U$,summary:K$,...G$}).loose();var ire=R({file:P(),fixedCount:F(),diagnostics:L(g7),errorCount:F(),warningCount:F(),warning:P().optional()});function are(e){let t=e.trim().replace(/^\.\//,``);if(!t.startsWith(`.ok/schemas/`))return!1;let n=t.slice(12);return n.length>0&&!n.includes(`/`)&&!n.includes(`\\`)&&n!==`.`&&n!==`..`}function ore(e){let t=e.trim().toLowerCase().split(`/`).pop()??``;return t.endsWith(`.schema.json`)&&t.length>12?!0:are(e)&&t.endsWith(`.json`)}var _7=[{id:`MD001`,alias:`heading-increment`,aliases:[`heading-increment`],name:`Heading levels should only increment by one level at a time`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md001.md`,tags:[`headings`],options:[{key:`front_matter_title`,type:`string`,description:`RegExp for matching title in front matter`,default:`^\\s*title\\s*[:=]`}]},{id:`MD003`,alias:`heading-style`,aliases:[`heading-style`],name:`Heading style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md003.md`,tags:[`headings`],options:[{key:`style`,type:`enum`,description:`Heading style`,enum:[`consistent`,`atx`,`atx_closed`,`setext`,`setext_with_atx`,`setext_with_atx_closed`],default:`consistent`}]},{id:`MD004`,alias:`ul-style`,aliases:[`ul-style`],name:`Unordered list style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md004.md`,tags:[`bullet`,`ul`],options:[{key:`style`,type:`enum`,description:`List style`,enum:[`consistent`,`asterisk`,`plus`,`dash`,`sublist`],default:`consistent`}]},{id:`MD005`,alias:`list-indent`,aliases:[`list-indent`],name:`Inconsistent indentation for list items at the same level`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md005.md`,tags:[`bullet`,`ul`,`indentation`],options:[]},{id:`MD007`,alias:`ul-indent`,aliases:[`ul-indent`],name:`Unordered list indentation`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md007.md`,tags:[`bullet`,`ul`,`indentation`],options:[{key:`indent`,type:`integer`,description:`Spaces for indent`,default:2,minimum:1},{key:`start_indented`,type:`boolean`,description:`Whether to indent the first level of the list`,default:!1},{key:`start_indent`,type:`integer`,description:`Spaces for first level indent (when start_indented is set)`,default:2,minimum:1}]},{id:`MD009`,alias:`no-trailing-spaces`,aliases:[`no-trailing-spaces`],name:`Trailing spaces`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md009.md`,tags:[`whitespace`],options:[{key:`br_spaces`,type:`integer`,description:`Spaces for line break`,default:2,minimum:0},{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!1},{key:`list_item_empty_lines`,type:`boolean`,description:`Allow spaces for empty lines in list items`,default:!1},{key:`strict`,type:`boolean`,description:`Include unnecessary breaks`,default:!1}]},{id:`MD010`,alias:`no-hard-tabs`,aliases:[`no-hard-tabs`],name:`Hard tabs`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md010.md`,tags:[`whitespace`,`hard_tab`],options:[{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!0},{key:`ignore_code_languages`,type:`string-array`,description:`Fenced code languages to ignore`,default:[]},{key:`spaces_per_tab`,type:`integer`,description:`Number of spaces for each hard tab`,default:1,minimum:0}]},{id:`MD011`,alias:`no-reversed-links`,aliases:[`no-reversed-links`],name:`Reversed link syntax`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md011.md`,tags:[`links`],options:[]},{id:`MD012`,alias:`no-multiple-blanks`,aliases:[`no-multiple-blanks`],name:`Multiple consecutive blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md012.md`,tags:[`whitespace`,`blank_lines`],options:[{key:`maximum`,type:`integer`,description:`Consecutive blank lines`,default:1,minimum:1}]},{id:`MD013`,alias:`line-length`,aliases:[`line-length`],name:`Line length`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md013.md`,tags:[`line_length`],options:[{key:`line_length`,type:`integer`,description:`Number of characters`,default:80,minimum:1},{key:`heading_line_length`,type:`integer`,description:`Number of characters for headings`,default:80,minimum:1},{key:`code_block_line_length`,type:`integer`,description:`Number of characters for code blocks`,default:80,minimum:1},{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!0},{key:`tables`,type:`boolean`,description:`Include tables`,default:!0},{key:`headings`,type:`boolean`,description:`Include headings`,default:!0},{key:`strict`,type:`boolean`,description:`Strict length checking`,default:!1},{key:`stern`,type:`boolean`,description:`Stern length checking`,default:!1}]},{id:`MD014`,alias:`commands-show-output`,aliases:[`commands-show-output`],name:`Dollar signs used before commands without showing output`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md014.md`,tags:[`code`],options:[]},{id:`MD018`,alias:`no-missing-space-atx`,aliases:[`no-missing-space-atx`],name:`No space after hash on atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md018.md`,tags:[`headings`,`atx`,`spaces`],options:[]},{id:`MD019`,alias:`no-multiple-space-atx`,aliases:[`no-multiple-space-atx`],name:`Multiple spaces after hash on atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md019.md`,tags:[`headings`,`atx`,`spaces`],options:[]},{id:`MD020`,alias:`no-missing-space-closed-atx`,aliases:[`no-missing-space-closed-atx`],name:`No space inside hashes on closed atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md020.md`,tags:[`headings`,`spaces`,`atx_closed`],options:[]},{id:`MD021`,alias:`no-multiple-space-closed-atx`,aliases:[`no-multiple-space-closed-atx`],name:`Multiple spaces inside hashes on closed atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md021.md`,tags:[`headings`,`spaces`,`atx_closed`],options:[]},{id:`MD022`,alias:`blanks-around-headings`,aliases:[`blanks-around-headings`],name:`Headings should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md022.md`,tags:[`headings`,`blank_lines`],options:[{key:`include_front_matter`,type:`boolean`,description:`Include front matter content`,default:!1},{key:`lines_above`,type:`unsupported`,description:`Blank lines above heading`,default:1},{key:`lines_below`,type:`unsupported`,description:`Blank lines below heading`,default:1}]},{id:`MD023`,alias:`heading-start-left`,aliases:[`heading-start-left`],name:`Headings must start at the beginning of the line`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md023.md`,tags:[`headings`,`spaces`],options:[]},{id:`MD024`,alias:`no-duplicate-heading`,aliases:[`no-duplicate-heading`],name:`Multiple headings with the same content`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md024.md`,tags:[`headings`],options:[{key:`siblings_only`,type:`boolean`,description:`Only check sibling headings`,default:!1}]},{id:`MD025`,alias:`single-title`,aliases:[`single-title`,`single-h1`],name:`Multiple top-level headings in the same document`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md025.md`,tags:[`headings`],options:[{key:`front_matter_title`,type:`string`,description:`RegExp for matching title in front matter`,default:`^\\s*title\\s*[:=]`},{key:`level`,type:`integer`,description:`Heading level`,default:1,minimum:1,maximum:6}]},{id:`MD026`,alias:`no-trailing-punctuation`,aliases:[`no-trailing-punctuation`],name:`Trailing punctuation in heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md026.md`,tags:[`headings`],options:[{key:`punctuation`,type:`string`,description:`Punctuation characters`,default:`.,;:!。,;:!`}]},{id:`MD027`,alias:`no-multiple-space-blockquote`,aliases:[`no-multiple-space-blockquote`],name:`Multiple spaces after blockquote symbol`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md027.md`,tags:[`indentation`,`whitespace`,`blockquote`],options:[{key:`list_items`,type:`boolean`,description:`Include list items`,default:!0}]},{id:`MD028`,alias:`no-blanks-blockquote`,aliases:[`no-blanks-blockquote`],name:`Blank line inside blockquote`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md028.md`,tags:[`whitespace`,`blockquote`],options:[]},{id:`MD029`,alias:`ol-prefix`,aliases:[`ol-prefix`],name:`Ordered list item prefix`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md029.md`,tags:[`ol`],options:[{key:`style`,type:`enum`,description:`List style`,enum:[`one`,`ordered`,`one_or_ordered`,`zero`],default:`one_or_ordered`}]},{id:`MD030`,alias:`list-marker-space`,aliases:[`list-marker-space`],name:`Spaces after list markers`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md030.md`,tags:[`ul`,`whitespace`,`ol`],options:[{key:`ul_single`,type:`integer`,description:`Spaces for single-line unordered list items`,default:1,minimum:1},{key:`ol_single`,type:`integer`,description:`Spaces for single-line ordered list items`,default:1,minimum:1},{key:`ul_multi`,type:`integer`,description:`Spaces for multi-line unordered list items`,default:1,minimum:1},{key:`ol_multi`,type:`integer`,description:`Spaces for multi-line ordered list items`,default:1,minimum:1}]},{id:`MD031`,alias:`blanks-around-fences`,aliases:[`blanks-around-fences`],name:`Fenced code blocks should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md031.md`,tags:[`blank_lines`,`code`],options:[{key:`list_items`,type:`boolean`,description:`Include list items`,default:!0}]},{id:`MD032`,alias:`blanks-around-lists`,aliases:[`blanks-around-lists`],name:`Lists should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md032.md`,tags:[`bullet`,`ul`,`blank_lines`,`ol`],options:[]},{id:`MD033`,alias:`no-inline-html`,aliases:[`no-inline-html`],name:`Inline HTML`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md033.md`,tags:[`html`],options:[{key:`allowed_elements`,type:`string-array`,description:`Allowed elements`,default:[]},{key:`table_allowed_elements`,type:`string-array`,description:`Allowed elements in tables`,default:[]}]},{id:`MD034`,alias:`no-bare-urls`,aliases:[`no-bare-urls`],name:`Bare URL used`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md034.md`,tags:[`links`,`url`],options:[]},{id:`MD035`,alias:`hr-style`,aliases:[`hr-style`],name:`Horizontal rule style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md035.md`,tags:[`hr`],options:[{key:`style`,type:`string`,description:`Horizontal rule style`,default:`consistent`}]},{id:`MD036`,alias:`no-emphasis-as-heading`,aliases:[`no-emphasis-as-heading`],name:`Emphasis used instead of a heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md036.md`,tags:[`headings`,`emphasis`],options:[{key:`punctuation`,type:`string`,description:`Punctuation characters`,default:`.,;:!?。,;:!?`}]},{id:`MD037`,alias:`no-space-in-emphasis`,aliases:[`no-space-in-emphasis`],name:`Spaces inside emphasis markers`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md037.md`,tags:[`whitespace`,`emphasis`],options:[]},{id:`MD038`,alias:`no-space-in-code`,aliases:[`no-space-in-code`],name:`Spaces inside code span elements`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md038.md`,tags:[`whitespace`,`code`],options:[]},{id:`MD039`,alias:`no-space-in-links`,aliases:[`no-space-in-links`],name:`Spaces inside link text`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md039.md`,tags:[`whitespace`,`links`],options:[]},{id:`MD040`,alias:`fenced-code-language`,aliases:[`fenced-code-language`],name:`Fenced code blocks should have a language specified`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md040.md`,tags:[`code`,`language`],options:[{key:`allowed_languages`,type:`string-array`,description:`List of languages`,default:[]},{key:`language_only`,type:`boolean`,description:`Require language only`,default:!1}]},{id:`MD041`,alias:`first-line-heading`,aliases:[`first-line-heading`,`first-line-h1`],name:`First line in a file should be a top-level heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md041.md`,tags:[`headings`],options:[{key:`allow_preamble`,type:`boolean`,description:`Allow content before first heading`,default:!1},{key:`front_matter_title`,type:`string`,description:`RegExp for matching title in front matter`,default:`^\\s*title\\s*[:=]`},{key:`level`,type:`integer`,description:`Heading level`,default:1,minimum:1,maximum:6}]},{id:`MD042`,alias:`no-empty-links`,aliases:[`no-empty-links`],name:`No empty links`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md042.md`,tags:[`links`],options:[]},{id:`MD043`,alias:`required-headings`,aliases:[`required-headings`],name:`Required heading structure`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md043.md`,tags:[`headings`],options:[{key:`headings`,type:`string-array`,description:`List of headings`,default:[]},{key:`match_case`,type:`boolean`,description:`Match case of headings`,default:!1}]},{id:`MD044`,alias:`proper-names`,aliases:[`proper-names`],name:`Proper names should have the correct capitalization`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md044.md`,tags:[`spelling`],options:[{key:`names`,type:`string-array`,description:`List of proper names`,default:[]},{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!0},{key:`html_elements`,type:`boolean`,description:`Include HTML elements`,default:!0}]},{id:`MD045`,alias:`no-alt-text`,aliases:[`no-alt-text`],name:`Images should have alternate text (alt text)`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md045.md`,tags:[`accessibility`,`images`],options:[]},{id:`MD046`,alias:`code-block-style`,aliases:[`code-block-style`],name:`Code block style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md046.md`,tags:[`code`],options:[{key:`style`,type:`enum`,description:`Block style`,enum:[`consistent`,`fenced`,`indented`],default:`consistent`}]},{id:`MD047`,alias:`single-trailing-newline`,aliases:[`single-trailing-newline`],name:`Files should end with a single newline character`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md047.md`,tags:[`blank_lines`],options:[]},{id:`MD048`,alias:`code-fence-style`,aliases:[`code-fence-style`],name:`Code fence style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md048.md`,tags:[`code`],options:[{key:`style`,type:`enum`,description:`Code fence style`,enum:[`consistent`,`backtick`,`tilde`],default:`consistent`}]},{id:`MD049`,alias:`emphasis-style`,aliases:[`emphasis-style`],name:`Emphasis style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md049.md`,tags:[`emphasis`],options:[{key:`style`,type:`enum`,description:`Emphasis style`,enum:[`consistent`,`asterisk`,`underscore`],default:`consistent`}]},{id:`MD050`,alias:`strong-style`,aliases:[`strong-style`],name:`Strong style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md050.md`,tags:[`emphasis`],options:[{key:`style`,type:`enum`,description:`Strong style`,enum:[`consistent`,`asterisk`,`underscore`],default:`consistent`}]},{id:`MD051`,alias:`link-fragments`,aliases:[`link-fragments`],name:`Link fragments should be valid`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md051.md`,tags:[`links`],options:[{key:`ignore_case`,type:`boolean`,description:`Ignore case of fragments`,default:!1},{key:`ignored_pattern`,type:`string`,description:`Pattern for ignoring additional fragments`,default:``}]},{id:`MD052`,alias:`reference-links-images`,aliases:[`reference-links-images`],name:`Reference links and images should use a label that is defined`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md052.md`,tags:[`links`,`images`],options:[{key:`ignored_labels`,type:`string-array`,description:`Ignored link labels`,default:[`x`]},{key:`shortcut_syntax`,type:`boolean`,description:`Include shortcut syntax`,default:!1}]},{id:`MD053`,alias:`link-image-reference-definitions`,aliases:[`link-image-reference-definitions`],name:`Link and image reference definitions should be needed`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md053.md`,tags:[`links`,`images`],options:[{key:`ignored_definitions`,type:`string-array`,description:`Ignored definitions`,default:[`//`]}]},{id:`MD054`,alias:`link-image-style`,aliases:[`link-image-style`],name:`Link and image style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md054.md`,tags:[`links`,`images`],options:[{key:`autolink`,type:`boolean`,description:`Allow autolinks`,default:!0},{key:`inline`,type:`boolean`,description:`Allow inline links and images`,default:!0},{key:`full`,type:`boolean`,description:`Allow full reference links and images`,default:!0},{key:`collapsed`,type:`boolean`,description:`Allow collapsed reference links and images`,default:!0},{key:`shortcut`,type:`boolean`,description:`Allow shortcut reference links and images`,default:!0},{key:`url_inline`,type:`boolean`,description:`Allow URLs as inline links`,default:!0}]},{id:`MD055`,alias:`table-pipe-style`,aliases:[`table-pipe-style`],name:`Table pipe style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md055.md`,tags:[`table`],options:[{key:`style`,type:`enum`,description:`Table pipe style`,enum:[`consistent`,`leading_only`,`trailing_only`,`leading_and_trailing`,`no_leading_or_trailing`],default:`consistent`}]},{id:`MD056`,alias:`table-column-count`,aliases:[`table-column-count`],name:`Table column count`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md056.md`,tags:[`table`],options:[]},{id:`MD058`,alias:`blanks-around-tables`,aliases:[`blanks-around-tables`],name:`Tables should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md058.md`,tags:[`table`],options:[]},{id:`MD059`,alias:`descriptive-link-text`,aliases:[`descriptive-link-text`],name:`Link text should be descriptive`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md059.md`,tags:[`links`,`accessibility`],options:[{key:`prohibited_texts`,type:`string-array`,description:`Prohibited link texts`,default:[`click here`,`here`,`link`,`more`]}]},{id:`MD060`,alias:`table-column-style`,aliases:[`table-column-style`],name:`Table column style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md060.md`,tags:[`table`],options:[{key:`style`,type:`enum`,description:`Table column style`,enum:[`any`,`aligned`,`compact`,`tight`],default:`any`},{key:`aligned_delimiter`,type:`boolean`,description:`Aligned delimiter columns`,default:!1}]}],sre=(()=>{let e=new Map;for(let t of _7){e.set(t.id.toUpperCase(),t.id);for(let n of t.aliases)e.set(n.toUpperCase(),t.id)}return e})();function v7(e){return sre.get(e.toUpperCase())??null}function cre(e,t){let n=v7(t);if(n===null)return;let r;for(let[t,i]of Object.entries(e))v7(t)===n&&(r={key:t,value:i});return r}var lre=[`Headings`,`Lists`,`Whitespace`,`Code`,`Links & images`,`Style`],ure=[[`headings`,`Headings`],[`bullet`,`Lists`],[`ul`,`Lists`],[`ol`,`Lists`],[`links`,`Links & images`],[`images`,`Links & images`],[`accessibility`,`Links & images`],[`code`,`Code`],[`language`,`Code`],[`emphasis`,`Style`],[`html`,`Style`],[`line_length`,`Whitespace`],[`whitespace`,`Whitespace`],[`hard_tab`,`Whitespace`],[`blank_lines`,`Whitespace`],[`indentation`,`Whitespace`]];function dre(e){for(let[t,n]of ure)if(e.tags.includes(t))return n;return`Style`}async function fre(e,t,n){if(!t.enabled)return[];let r=[];for(let i of p7){let a=t.plugins[i.id];a.enabled&&r.push(...await i.lint(e,a,{docName:n}))}return r}var pre=/\p{M}+/gu,mre=/[^\p{L}\p{N}]+/gu,hre=/^-+|-+$/g;function y7(e){return e.trim().normalize(`NFKD`).replace(pre,``).toLowerCase().replace(mre,`-`).replace(hre,``)}function gre(e,t){let n=t.get(e)??0;return t.set(e,n+1),n===0?e:`${e}-${n}`}function _re(e,t){let n=y7(e);return n?gre(n,t):``}function b7(e,t){let n=y7(e);return t?`#${n}-${y7(t)}`:`#${n}`}var x7=new Set([`img`,`video`,`audio`,`mark`]),vre=new Map(z2.flatMap(e=>e.surface===`compat`&&x7.has(e.rendersAs)?[[e.name,e]]:[]));function S7(e){let t={};for(let n of e.attributes){if(n.type!==`mdxJsxAttribute`)return null;let e=n.name.toLowerCase();if(!(e.length>=3&&e.startsWith(`on`)))if(n.value===null)t[n.name]=!0;else if(typeof n.value==`string`)t[n.name]=n.value;else return null}return t}function C7(e){let t=e.name;if(!t||!x7.has(t))return null;let n=S7(e);return n===null?null:{type:`element`,tagName:t,properties:n,children:[]}}function w7(e){let t=e.name;if(!t)return null;let n=vre.get(t);if(!n)return null;let r=S7(e);if(r===null)return null;let i=n.translateProps(r),a={};for(let[e,t]of Object.entries(i))(typeof t==`string`||typeof t==`boolean`)&&(a[e]=t);return{type:`element`,tagName:n.rendersAs,properties:a,children:[]}}var yre=(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-link`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:b7(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},bre=(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-embed`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:b7(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},xre=(e,t)=>{let n=t,r=C7(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i=w7(n);if(i){e.patch(t,i);let n=e.applyData(t,i);return n.tagName===`img`?{type:`element`,tagName:`p`,properties:{},children:[n]}:n}let a={type:`element`,tagName:`pre`,properties:{className:[`mdx-component`]},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]}]};return e.patch(t,a),e.applyData(t,a)},Sre=(e,t)=>{let n=t,r=C7(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i=w7(n);if(i)return e.patch(t,i),e.applyData(t,i);let a={type:`element`,tagName:`span`,properties:{className:[`mdx-inline`],dataJsxInline:``},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]};return e.patch(t,a),e.applyData(t,a)},Cre=(e,t)=>{let n=t,r=n.data.reason||`unknown`,i=n.value||``,a=r.replace(/--/g,`—`),o={type:`comment`,value:` Parse error: ${a} `},s={type:`element`,tagName:`pre`,properties:{className:[`mdx-fallback`],dataRawMdxFallback:``,dataReason:a},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:i}]}]};return e.patch(t,s),[o,e.applyData(t,s)]},wre=(e,t)=>{let n={type:`element`,tagName:`mark`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)};function T7(e){if(typeof e!=`object`||!e)return``;let t=e;return typeof t.value==`string`?t.value:Array.isArray(t.children)?t.children.map(T7).join(``):``}var E7={wikiLink:yre,wikiLinkEmbed:bre,mdxJsxFlowElement:xre,mdxJsxTextElement:Sre,rawMdxFallback:Cre,mark:wre,tag:(e,t)=>{let n=t.value,r={type:`element`,tagName:`a`,properties:{className:[`tag`],dataTag:n,href:`#tag/${n}`},children:[{type:`text`,value:`#${n}`}]};return e.patch(t,r),e.applyData(t,r)},comment:(e,t)=>{let n={type:`comment`,value:T7(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},commentBlock:(e,t)=>{let n={type:`comment`,value:T7(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:(e,t)=>{let n=t.identifier,r={type:`element`,tagName:`sup`,properties:{id:`fnref-${n}`,dataFootnoteRef:``,dataFootnoteId:n,className:[`footnote-ref`]},children:[{type:`element`,tagName:`a`,properties:{href:`#fn-${n}`,className:[`footnote-ref-link`]},children:[{type:`text`,value:`[${n}]`}]}]};return e.patch(t,r),e.applyData(t,r)},footnoteDefinition:(e,t)=>{let n=t.identifier,r={type:`element`,tagName:`aside`,properties:{id:`fn-${n}`,dataFootnoteDef:``,dataFootnoteId:n,className:[`footnote-def`]},children:[{type:`element`,tagName:`div`,properties:{className:[`footnote-body`]},children:e.all(t)},{type:`element`,tagName:`a`,properties:{href:`#fnref-${n}`,className:[`footnote-backref`],ariaLabel:`Back to reference`},children:[{type:`text`,value:`↩`}]}]};return e.patch(t,r),e.applyData(t,r)}},Tre=/url\s*\(\s*['"]?\s*(?:javascript|vbscript|data)\s*:/i,Ere=/\bexpression\s*\(/i,Dre=1e4;function Ore(e){return!(e.length>Dre||Tre.test(e)||Ere.test(e))}function D7(e){for(let t of e.split(`,`)){let e=t.trim();if(e!==``&&!SZ(e.split(/\s+/)[0]??``))return!1}return!0}var kre={a:[`href`,`title`],img:[`src`,`alt`,`title`],video:[`src`,`title`],audio:[`src`,`title`],code:[`className`]},Are=new Set([`href`,`src`]),jre=ke(`<>`),O7=()=>e=>{D(e,`element`,e=>{let t=kre[e.tagName.toLowerCase()],n=e.properties;if(!(!t||!n))for(let e of t){let t=n[e];if(Array.isArray(t)){let r=t.map(e=>typeof e==`string`?r3(e):e);r.some((e,n)=>e!==t[n])&&(n[e]=r);continue}if(typeof t!=`string`)continue;let r;if(Are.has(e))if(t===`<>`||t===jre)r=``;else{let e=r3(t);r=e===t?t:ke(e)}else r=r3(t);r!==t&&(n[e]=r)}})},k7=()=>e=>{D(e,`element`,e=>{let t=e.tagName.toLowerCase(),n=e.properties;if(!n)return;if(t===`a`||t===`area`||t===`link`||t===`base`){let e=n.href;typeof e==`string`&&!SZ(e)&&delete n.href}if(t===`img`||t===`iframe`||t===`script`||t===`embed`||t===`source`||t===`audio`||t===`video`||t===`track`){let e=n.src;typeof e==`string`&&!SZ(e)&&delete n.src}if(t===`form`){let e=n.action;typeof e==`string`&&!SZ(e)&&delete n.action}if(t===`img`||t===`source`){let e=n.srcSet;typeof e==`string`&&!D7(e)&&delete n.srcSet;let t=n.srcset;typeof t==`string`&&!D7(t)&&delete n.srcset}if(t===`video`){let e=n.poster;typeof e==`string`&&!SZ(e)&&delete n.poster}let r=n.style;typeof r==`string`&&!Ore(r)&&delete n.style})};function Mre(e){let t=le().use(Ee,{handlers:E7}).use(O7).use(k7).use(VG),n=t.runSync(e);return String(t.stringify(n))}function Nre(e){let t=/\r?\n|\r/g,n=[],r=0,i=t.exec(e);for(;i!==null;)n.push(A7(e.slice(r,i.index),r>0,!0),i[0]),r=i.index+i[0].length,i=t.exec(e);return n.push(A7(e.slice(r),r>0,!1)),n.join(``)}function A7(e,t,n){let r=0,i=e.length,a=e=>e===9||e===32;for(;t&&r<i&&a(e.charCodeAt(r));)r++;for(;n&&i>r&&a(e.charCodeAt(i-1));)i--;return i>r?e.slice(r,i):``}var j7=/\r?\n|\r/,Pre=(e,t)=>{let n=Nre(String(t.value));if(!j7.test(n)){let r={type:`text`,value:n};return e.patch(t,r),e.applyData(t,r)}let r=n.split(j7),i=[];for(let e=0;e<r.length;e++)e>0&&i.push({type:`element`,tagName:`br`,properties:{},children:[]}),r[e].length>0&&i.push({type:`text`,value:r[e]});return i};function Fre(e){let t=le().use(ye).use(oP,[`yaml`]).use(C8).use(ue).use(u5).use(X4).use(H8).use(d3).use(Ee,{handlers:{...E7,text:Pre}}).use(O7).use(k7).use(VG);return String(t.processSync(J4(u3(e))))}rI(),SF(),CF();var M7=`frontmatter`,N7=[`text`,`number`,`boolean`,`date`,`list`,`object`];z(N7);var Ire=Oo([P(),F(),I()]),P7=as(()=>Oo([Ire.transform(e=>String(e)),Po(P(),F7),L(P7)])),F7=as(()=>Oo([P(),F(),I(),L(P7),Po(P(),F7)])),Lre=/^\d{4}-\d{2}-\d{2}$/;function Rre(e){return typeof e==`string`&&Lre.test(e)}function zre(e){return Array.isArray(e)?`list`:typeof e==`object`&&e?`object`:typeof e==`boolean`?`boolean`:typeof e==`number`?`number`:Rre(e)?`date`:`text`}function I7(e){if(Array.isArray(e)){let t=[];for(let n of e)n!==null&&t.push(I7(n));return t}if(typeof e==`object`&&e){let t={};for(let[n,r]of Object.entries(e))t[n]=r===null?``:I7(r);return t}return e}var L7=fs(I7,Po(P(),F7)),Bre=Po(P(),Oo([F7,yo()]));function Vre(e){return!!(e===null||typeof e==`string`&&e===``||Array.isArray(e)&&e.length===0)}function R7(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!R7(e[n],t[n]))return!1;return!0}if(e!==null&&t!==null&&typeof e==`object`&&typeof t==`object`&&!Array.isArray(e)&&!Array.isArray(t)){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.hasOwn(t,r)||!R7(e[r],t[r]))return!1;return!0}return!1}R({docName:U$,summary:K$,content:P().optional(),...G$}).loose(),R({docName:U$,summary:K$,markdown:P(),position:z([`append`,`prepend`,`replace`]).optional(),extension:z(MX).optional(),...G$}).loose(),R({docName:U$,summary:K$,find:P().min(1),replace:P(),offset:F().int().nonnegative().optional(),...G$}).loose(),R({docName:U$,connectionId:P().min(1),scope:z([`last`,`session`,`file`,`count`]).optional(),count:F().int().positive().optional(),...G$}).loose().refine(e=>e.scope!==`count`||e.count!==void 0,{message:`count is required when scope is 'count'`,path:[`count`]});var z7=R({value:P(),truncatedFrom:F().int().nonnegative().optional(),hint:P().optional()}).loose(),Hre=Ao(`kind`,[R({kind:B(`inline`),content:P()}),R({kind:B(`truncated`),byteLength:F().int().nonnegative(),hint:P()})]),B7=R({kind:B(`content-divergence`),intendedBytes:F().int().nonnegative(),actualBytes:F().int().nonnegative(),byteDelta:F().int(),divergenceType:P().optional(),currentState:Hre.optional(),hint:P().optional()}).loose(),Ure=R({type:B(`orphan`),parentCandidates:L(P()),message:P()}).loose(),V7=R({kind:B(`disk-edit-reconciled`),intendedBytes:F().int().nonnegative(),actualBytes:F().int().nonnegative(),byteDelta:F().int(),mergeOutcome:P().optional(),hint:P().optional()}).loose(),H7=Ao(`kind`,[B7,V7]),U7=L(Ao(`kind`,[B7,V7,R({kind:B(`mermaid-parse-error`),fenceIndex:F().int().positive(),fenceFirstLine:P(),message:P(),line:F().int().positive().optional()}).loose(),R({kind:B(`lint-violation`),source:P(),code:P(),message:P(),severity:z([`error`,`warning`,`info`,`hint`]),line:F().int().positive(),column:F().int().positive(),linkTarget:P().optional()}).loose()])).min(1),W7=L(R({href:P(),resolvedTo:P().nullable(),reason:z([`no-such-doc`,`no-such-file`,`unresolvable`])}).loose());R({timestamp:P().min(1),summary:z7.optional(),warning:H7.optional(),warnings:U7.optional()}).loose(),R({timestamp:P().min(1),subscriberCount:F().int().nonnegative(),systemSubscriberCount:F().int().nonnegative(),hints:L(Ure).optional(),summary:z7.optional(),warning:H7.optional(),warnings:U7.optional(),brokenLinks:W7}).loose(),R({timestamp:P().min(1),subscriberCount:F().int().nonnegative(),systemSubscriberCount:F().int().nonnegative(),summary:z7.optional(),warning:H7.optional(),warnings:U7.optional(),brokenLinks:W7}).loose(),R({docName:P().min(1),scope:z([`last`,`session`,`count`]),undone:I()}).loose(),R({docs:L(R({docName:W$,markdown:P(),position:z([`append`,`prepend`,`replace`]).optional(),extension:z(MX).optional(),summary:K$}).loose()).min(1).max(100),...G$}).loose();var Wre=R({type:f1,title:P(),detail:P().optional()}).loose(),Gre=Ao(`status`,[R({status:B(`written`),docName:P().min(1),summary:z7.optional(),warnings:U7.optional(),brokenLinks:W7}).loose(),R({status:B(`error`),docName:P().min(1),error:Wre}).loose()]);R({timestamp:P().min(1),results:L(Gre),written:F().int().nonnegative(),failed:F().int().nonnegative()}).loose(),R({docName:U$,patch:Po(P(),Oo([F7,yo()])),types:Po(P(),z(N7)).optional(),summary:K$,...G$}).loose(),R({timestamp:P().min(1),subscriberCount:F().int().nonnegative(),systemSubscriberCount:F().int().nonnegative(),appliedKeys:L(P()),summary:z7.optional(),warning:H7.optional(),warnings:U7.optional(),brokenLinks:W7}).loose(),R({entries:L(R({level:z([`info`,`warn`,`error`]),message:P().max(zY),event:P().optional(),fields:Po(P(),xo()).optional(),ts:F().optional(),sourceId:P().optional(),lineNumber:F().optional()}).loose()).max(100),droppedSinceLastFlush:F().int().min(0).optional()}).loose(),R({accepted:F().int().min(0)}).loose();var Kre=R({status:P().min(1),reason:P()}).loose(),qre=R({docName:P().min(1),content:P(),lifecycle:Kre.nullable()}).loose(),G7=R({kind:z([`document`,`asset`,`folder`,`file`]).default(`document`),docName:P().min(1).optional(),docExt:P().min(1).default(`.md`),size:F().int().nonnegative(),modified:P().min(1),isSymlink:I().default(!1),canonicalDocName:P().nullable().default(null),targetPath:P().nullable().default(null),path:P().min(1).optional(),assetExt:P().min(1).optional(),mediaKind:z([`image`,`video`,`audio`,`pdf`,`text`,`mermaid`]).nullable().optional(),referencedBy:L(P().min(1)).optional(),hasChildren:I().optional()}).loose().refine(e=>e.kind===`document`?e.docName!==void 0&&e.path===void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.kind===`folder`?e.docName===void 0&&e.path!==void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0:e.kind===`file`?e.path!==void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.path!==void 0&&e.assetExt!==void 0&&e.referencedBy!==void 0&&e.hasChildren===void 0,{message:`document/asset/folder/file kind must match its required fields (document → docName; asset → path+assetExt+referencedBy; folder → path only, no docName; file → path, no mediaKind/referencedBy/hasChildren)`}),Jre=R({documents:L(G7),truncated:I().optional()}).loose(),Yre=R({source:P().min(1),anchor:P().nullable(),title:P(),snippet:P().nullable()}).loose(),Xre=R({docName:P().min(1),backlinks:L(Yre)}).loose(),Zre=R({counts:Po(P().min(1),F().int().nonnegative())}).loose(),Qre=Ao(`kind`,[R({kind:B(`doc`),docName:P().min(1),anchor:P().nullable(),title:P(),snippet:P().nullable()}).loose(),R({kind:B(`external`),url:P().min(1),title:P(),snippet:P().nullable()}).loose()]),$re=R({docName:P().min(1),forwardLinks:L(Qre)}).loose(),eie=Ao(`kind`,[R({id:P().min(1),kind:B(`doc`),docName:P().min(1),anchor:P().nullable(),label:P(),cluster:P().nullable(),category:P().nullable(),tags:L(P()).nullable()}).loose(),R({id:P().min(1),kind:B(`external`),url:P().min(1),label:P()}).loose()]),tie=R({source:P().min(1),target:P().min(1)}).loose(),nie=R({nodes:L(eie),links:L(tie)}).loose(),rie=R({ts:F().int().min(0),url:P(),method:P(),ua:P().optional(),origin:P().optional(),referer:P().optional(),host:P().optional(),remote:P().optional(),secChUa:P().optional(),secChUaMobile:P().optional(),secChUaPlatform:P().optional(),secFetchSite:P().optional(),secFetchDest:P().optional(),secFetchMode:P().optional(),secFetchUser:P().optional()}).loose(),iie=R({app:Oo([B(`cursor`),B(`codex`),B(`claude`),yo()]),signals_fired:L(P())}).loose();R({entries:L(rie),count:F().int().min(0),detection:iie}).loose(),R({writers:L(R({id:P().min(1),name:P().optional(),email:P().optional()}).loose()).optional(),summary:K$,...G$}).loose(),R({checkpointRef:P().min(1)}).loose();var aie=R({v:F().int().optional(),id:P().min(1),name:P().min(1),colorSeed:P().optional(),docs:L(P()),summaries:L(P()).optional()}).loose();R({entries:L(R({sha:P().min(1),timestamp:P().min(1),author:P(),authorEmail:P(),type:z([`checkpoint`,`wip`,`upstream`,`park`]),message:P(),contributors:L(aie),checkpoint:xo().nullable(),parentSha:P().nullable().optional()}).loose()),total:F().int().nonnegative().optional(),truncated:I().optional(),hasMore:I().optional()}).loose(),R({sha:P().regex(/^[0-9a-f]{40}$/i),content:P(),timestamp:P(),author:P()}).loose();var oie=R({contentDir:P().min(1),pathSeparator:z([`/`,`\\`]),symlinkResolved:I()}).loose();L(Ao(`source`,[R({docName:P().min(1),timestamp:P().min(1),size:F().int().nonnegative(),source:B(`flat`)}).loose(),R({docName:P().min(1),timestamp:P().min(1),source:B(`timeline`),sha:P().min(1)}).loose()])).meta({description:"Flat array of rescue buffer entries; discriminated via `source`."});var sie=R({domain:P().min(1),title:P().optional(),description:P().optional(),siteName:P().optional(),faviconDataUri:P().optional()}).loose();R({url:P()}).loose();var cie=Ao(`ok`,[R({ok:B(!0),metadata:sie}).loose(),R({ok:B(!1),reason:P()}).loose()]),lie=R({orphans:L(R({docName:P().min(1),title:P()}).loose())}).loose(),uie=R({hubs:L(R({docName:P().min(1),title:P(),count:F().int().nonnegative()}).loose())}).loose(),die=R({source:P().min(1),title:P(),snippet:P().nullable()}).loose();R({deadLinks:L(R({target:P().min(1),sources:L(die)}).loose())}).loose(),R({target:R({docName:P().min(1),title:P(),aliases:L(P())}).loose(),mentions:L(R({source:P().min(1),excerpt:P(),offset:F().int().nonnegative()}).loose()),truncated:I()}).loose(),R({projectPath:P().min(1)}).loose();var fie=z([`not-a-git-worktree`,`init-failed`]);Ao(`ok`,[R({ok:B(!0),projectPath:P().min(1)}).loose(),R({ok:B(!1),reason:fie,message:P().min(1)}).loose()]),R({host:P().min(1).optional()}).loose(),R({host:P().min(1).optional(),token:P().min(1)}).loose(),R({host:P(),login:P()}).loose(),R({key:P().min(1)}).loose(),R({keyPresent:I()}).loose();var pie=z([`no_key`,`invalid_endpoint`,`rate_limit`,`timeout`,`http_error`,`network`,`dims_mismatch`,`malformed_response`]),mie=Ao(`ok`,[R({ok:B(!0),endpoint:P().min(1),model:P().min(1),dimensions:F().int().positive()}).loose(),R({ok:B(!1),endpoint:P().min(1),model:P().min(1),reason:pie,status:F().int().optional()}).loose()]);R({name:P().refine(e=>e.trim().length>0,{message:`name must be non-empty`}),email:P().refine(e=>e.trim().length>0,{message:`email must be non-empty`})}).loose(),R({authenticated:I()}).loose(),R({channel:z([`login`,`gh-login`]).default(`login`)}).loose(),R({}).loose();var hie=R({stackIndex:F().int().min(0),ts:F().int().min(0),additions:F().int().min(0),deletions:F().int().min(0)}).loose(),gie=R({docName:P().min(1),additionsTotal:F().int().min(0),deletionsTotal:F().int().min(0),lastTs:F().int().min(0),bursts:L(hie)}).loose(),K7=R({displayName:P().min(1),color:P().min(1),icon:P().optional(),connectionId:P().min(1)}).loose(),_ie=R({sessionAlive:I(),agent:K7.nullable(),files:L(gie)}).loose(),vie=R({diff:P(),before:P(),after:P(),generatedAt:F().int().min(0)}).loose();R({}).loose(),R({}).loose(),R({}).loose(),R({}).loose(),R({}).loose(),R({}).loose();var yie=R({displayName:P().min(1),icon:P(),color:P().min(1),currentDoc:P().nullable(),mode:z([`idle`,`writing`]),ts:F().int().min(0)}).loose();R({presence:Po(P().min(1),yie)}).loose();var bie=R({sessionId:P().min(1),agentType:P().min(1),ts:F().int().min(0),insertedChars:F().int().min(0),deletedChars:F().int().min(0)}).loose();R({effects:L(R({"doc.name":P().min(1),entries:L(bie)}).loose())}).loose(),R({decisions:L(R({ts:F().int().min(0),decision:P().min(1),kind:P().min(1),"doc.name":P().min(1),pathRole:P().min(1)}).loose())}).loose(),Po(P().min(1),I()).meta({description:`Flat boolean record keyed by agent-scheme name (claude / codex / cursor). True = installed.`}),R({path:P().min(1,`path must be non-empty`)}).loose(),R({}).loose();var xie=R({fromDocName:P().min(1),toDocName:P().min(1)}).loose(),Sie=R({fromPath:P().min(1),toPath:P().min(1)}).loose();R({}).loose(),R({path:P().min(1),...G$,summary:K$}).loose();var Cie=R({docName:P().min(1)}).loose();R({path:P().min(1),...G$,summary:K$}).loose();var wie=R({path:P().min(1)}).loose();R({kind:z([`file`,`folder`]),path:P().min(1),...G$,summary:K$}).loose();var Tie=R({kind:z([`file`,`folder`]),path:P().min(1),duplicatedDocNames:L(P().min(1))}).loose(),Eie=R({pages:L(R({docName:P().min(1),title:P(),docExt:P().min(1),size:F().int().nonnegative(),modified:P().min(1),icon:P().min(1).max(2048).optional()}).loose())}).loose(),Die=R({level:F().int().min(1).max(6),text:P(),slug:P()}).loose(),Oie=R({docName:P().min(1),headings:L(Die)}).loose(),kie=R({docName:P().min(1),rewrites:F().int().nonnegative()}).loose();R({kind:z([`file`,`folder`,`asset`]),fromPath:P().min(1),toPath:P().min(1),...G$,summary:K$}).loose();var Aie=R({renamed:L(xie),renamedAssets:L(Sie),rewrittenDocs:L(kie).optional(),summary:z7.optional()}).loose();R({kind:z([`file`,`folder`,`asset`]),path:P().min(1),...G$}).loose();var jie=R({deletedDocNames:L(P().min(1))}).loose();R({kind:z([`file`,`folder`,`asset`]),path:P().min(1),...G$,summary:K$}).loose();var Mie=R({deletedDocNames:L(P().min(1))}).loose();R({docName:P().min(1),commitSha:P().regex(/^[0-9a-f]{40}$/i,{message:`commitSha must be a 40-char git SHA`}),summary:K$,...G$}).loose(),R({restoredFrom:P().min(1),timestamp:P().min(1),summary:z7.optional(),warning:B7.optional(),warnings:U7.optional()}).loose();var Nie=z([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),Pie=R({label:P().min(1),webUrl:Za().nullable()}).loose(),Fie=Ao(`checkStatus`,[R({checkStatus:B(`allowed`)}).loose(),R({checkStatus:B(`denied`),deniedReason:z([`no-collaborator`,`private-no-access`,`repo-not-found`,`not-authenticated`])}).loose(),R({checkStatus:B(`unknown`),unknownError:z([`network`,`timeout`,`rate-limit`,`token-invalid`,`malformed-response`,`ssh-unverified`]).optional()}).loose()]),q7=z([`auth-403`,`auth-401`,`auth-scope-mismatch`,`auth-no-credential`,`semantic-protected-branch`]),Iie=z($u),Lie=z([`succeeded`,`up-to-date`,`conflict`,`refused`,`error`]);R({state:Nie,lastSyncUtc:P().nullable(),lastFetchUtc:P().nullable(),lastPushedSha:P().nullable(),ahead:F().int().min(0),behind:F().int().min(0),consecutiveFailures:F().int().min(0),conflictCount:F().int().min(0),hasRemote:I(),syncEnabled:I(),identityUnresolved:I(),remote:Pie.nullable().optional(),pushError:P().optional(),pushErrorCode:q7.optional(),pullError:P().optional(),pullErrorCode:q7.optional(),pausedReason:P().optional(),pushPermission:Fie.optional(),syncMode:Iie.optional(),lastPullUtc:P().nullable().optional(),lastPullOutcome:Lie.nullable().optional()}).loose(),R({op:z([`sync`,`push`,`pull`]).optional()}).loose(),R({op:z([`sync`,`push`,`pull`])}).loose(),R({conflicts:L(R({file:P().min(1),detectedAt:P().min(1),oursSha:P().optional(),theirsSha:P().optional(),baseSha:P().optional()}).loose())}).loose(),R({file:P().min(1),strategy:z([`mine`,`theirs`,`content`,`delete`]),content:P().optional()}).loose().refine(e=>e.strategy!==`content`||e.content!==void 0&&e.content!==``,{message:`content must be a non-empty string when strategy is 'content'`,path:[`content`]}),R({}).loose(),R({file:P().min(1),base:P(),ours:P(),theirs:P(),kind:z([`both-modified`,`delete-modify`,`modify-delete`]),lifecycleStatus:P().nullable()}).loose(),R({plan:cs(e=>e!==void 0,{message:`plan is required`})}).loose(),R({plan:cs(e=>e!==void 0,{message:`plan is required`})}).loose(),R({result:cs(e=>e!==void 0,{message:`result is required`})}).loose();var Rie=R({path:P().min(1),summary:P().min(1)}).loose(),zie=R({files:F().int().nonnegative(),folders:F().int().nonnegative()}).loose();R({packs:L(R({id:P().min(1),name:P().min(1),description:P().min(1),defaultSubfolder:P().optional(),folders:L(Rie),entryCounts:zie}).loose())}).loose(),R({noOpen:I().optional(),out:P().min(1).optional()}).loose();var Bie=R({reason:z([`unsupported-platform`,`spawn-error`]),message:P()}).loose();Ao(`status`,[R({status:B(`installed`),outputPath:P(),size:F().int().nonnegative(),sha256:P(),skillVersion:P()}).loose(),R({status:B(`built`),outputPath:P(),size:F().int().nonnegative(),sha256:P(),skillVersion:P(),handoffError:Bie.optional()}).loose(),R({status:B(`failed`),buildError:P()}).loose(),R({status:B(`skip-current`),skillVersion:P(),recordedAt:P().optional()}).loose()]);var J7=z(zX);Eo({schema:B(1),targets:L(J7).default([])}),R({tags:L(R({name:P().min(1),count:F().int().nonnegative(),isLeaf:I()}).loose())}).loose();var Vie=R({docName:P().min(1),title:P(),matchingTags:L(P().min(1)),snippet:P().nullable()}).loose();R({name:P().min(1),docs:L(Vie)}).loose(),R({folder:xo(),frontmatter_local:Po(P(),xo()).nullable()}).loose(),R({path:P(),frontmatter:Po(P(),xo()).optional()}).loose(),R({applied:xo()}).loose();var Y7=Po(P(),xo()).meta({description:`Free-form frontmatter map embedded in template payloads.`});R({template:R({name:P().min(1),folder:P(),scope:z([`local`,`inherited`]),path:P().min(1),frontmatter:Y7,body:P()}).strict()}).strict();var Hie=R({templates:L(R({name:P().min(1),title:P().optional(),description:P().optional(),path:P().min(1),source_folder:P()}).strict()),truncated:I()}).strict();R({folder:P(),name:P(),body:P().optional(),frontmatter:Y7.optional(),...G$,summary:K$}).strict(),R({path:P().min(1),created:I(),warnings:L(P())}).strict(),R({sourcePath:P().min(1),targetFolder:P(),name:P().optional(),title:P().optional(),deleteSource:I().optional(),...G$,summary:K$}).strict(),R({path:P().min(1),created:I(),warnings:L(P())}).strict(),R({existed:I(),path:P().min(1)}).strict(),R({fromFolder:P(),fromName:P(),toFolder:P(),toName:P(),body:P().optional(),frontmatter:Y7.optional(),...G$,summary:K$}).strict(),R({from:P().min(1),to:P().min(1),committed:I()}).strict();var X7=z(vX),Uie=/^[a-z0-9-]+$/,Wie=/^[A-Za-z0-9_-]+$/,Z7=R({name:P(),description:P()}).strict();R({skill:R({name:P().min(1),scope:X7,path:P().min(1),frontmatter:Z7,body:P(),files:L(R({path:P().min(1),text:P().nullable()})).optional(),managed:I().optional()}).strict()}).strict();var Gie=R({skills:L(R({name:P().min(1),description:P().optional(),scope:X7,path:P().min(1),absolutePath:P().min(1).optional(),installed:I(),hosts:L(P()),installedVersion:P().optional(),bundledVersion:P().optional(),updateAvailable:I().optional(),managed:I().optional()}).strict()),truncated:I()}).strict();R({scope:X7.default(`project`),name:P(),body:P().optional(),frontmatter:Z7,...G$,summary:K$}).strict(),R({path:P().min(1),created:I(),warnings:L(P())}).strict(),R({scope:X7.default(`project`),name:P(),...G$,summary:K$}).strict(),R({name:P().min(1),version:P().min(1),previousVersion:P().optional(),checkpointRef:P().optional()}).strict(),R({existed:I(),path:P().min(1)}).strict(),R({scope:X7.default(`project`),fromName:P(),toName:P(),body:P().optional(),frontmatter:Z7.optional(),...G$,summary:K$}).strict(),R({from:P().min(1),to:P().min(1),committed:I()}).strict();var Q7=z([`reference`,`script`]);R({scope:X7.default(`project`),name:P(),path:P().min(1),content:P(),...G$,summary:K$}).strict(),R({path:P().min(1),created:I(),kind:Q7,content:I()}).strict(),R({path:P().min(1),kind:Q7,text:P()}).strict(),R({path:P().min(1),existed:I(),kind:Q7}).strict(),R({scope:X7.default(`project`),name:P(),targets:L(J7).optional().meta({description:`Explicit editor ids to install into; omit to use project-configured editors.`}),...G$,summary:K$}).strict(),R({name:P().min(1),hosts:L(P()),scripts:I(),warnings:L(P()),warningCodes:L(z([`no-targets`,`scripts-present`]))}).strict(),R({scope:X7.default(`project`),name:P()}).strict(),R({name:P().min(1),uninstalled:I()}).strict();var Kie=R({targets:L(J7),configured:I()}).strict();R({targets:L(J7)}).strict(),R({targets:L(J7),reprojected:L(R({name:P(),hosts:L(P())}).strict()),bundleHosts:L(P()),removedFrom:L(P())}).strict(),R({scope:X7.default(`project`),name:P(),version:P().regex(/^[0-9a-f]{40}$/i),...G$,summary:K$}).strict(),R({name:P().min(1),version:P(),restoredFiles:L(P()),warnings:L(P())}).strict(),R({query:P().optional(),intent:z([`autocomplete`,`full_text`,`omnibar`]).optional(),ranking:z([`navigation`,`relevance`]).optional(),scopes:L(z([`page`,`folder`,`content`,`file`])).optional(),scope:P().optional(),limit:F().int().nonnegative().optional(),semantic:I().optional(),source:z([`omnibar`,`mcp`,`http`]).optional()}).loose();var qie=R({kind:z([`page`,`folder`,`content`,`file`]),path:P().min(1),title:P(),score:F(),signals:Po(P(),xo()),snippet:P().optional()}).loose(),Jie=R({capable:I(),applied:I(),coverage:R({embedded:F().int().nonnegative(),total:F().int().nonnegative()})}).loose();R({enabled:I(),keyPresent:I(),keyNotRequired:I(),keySource:z([`project`,`file`,`env`]).nullable(),keyHint:P().nullable(),ready:I(),capable:I(),embedded:F().int().nonnegative(),total:F().int().nonnegative()}).loose(),R({query:P(),intent:z([`autocomplete`,`full_text`,`omnibar`]),results:L(qie),elapsedMs:F().nonnegative(),semantic:Jie.optional(),truncated:I().optional(),ready:I().optional()}).loose();var Yie=R({version:P().min(1),recordedAt:P().min(1)}).loose();R({currentVersion:P().min(1),targets:Po(P(),Yie.nullable())}).loose();var Xie=`server-info`,Zie=`branch-switched`,Qie=`disk-ack`,$ie=`config-validation-rejected`,eae=`config-ignore-nested-error`,$7=z([`files`,`backlinks`,`graph`,`sync-status`,`session-activity`,`tags`,`lint-config`]),tae=R({v:B(1),ch:B(Xie),seq:F(),serverInstanceId:P().min(1),currentBranch:P().min(1).optional()}).loose(),nae=R({v:B(1),ch:B(Zie),seq:F(),branch:P().min(1)}).loose(),rae=R({v:B(1),ch:$7,seq:F()}).loose(),iae=R({v:B(1),ch:B(Qie),seq:F(),docName:P().min(1),sv:P().min(1)}).loose(),aae=R({v:B(1),ch:B($ie),seq:F(),docName:P().min(1),error:Uf}).loose(),oae=R({v:B(1),ch:B(eae),seq:F(),path:P().min(1),error:P().min(1)}).loose();function sae(e){let t;try{t=new URL(e)}catch{return null}let n=t.pathname.match(/^\/video\/(\d+)/);if(n)return n[1]??null;let r=t.pathname.match(/^\/(\d+)/);return r?r[1]??null:null}function cae(e){if(typeof e!=`string`||e.length===0)return e;let t=d2(e);if(t){let e=t.noCookie?`www.youtube-nocookie.com`:`www.youtube.com`,n=t.startSeconds===null?``:`?start=${t.startSeconds}`;return`https://${e}/embed/${t.id}${n}`}if(o2(e)){let t=sae(e);return t?`https://player.vimeo.com/video/${t}`:e}let n=r2(e);if(n){let e=n.startRaw===null?``:`?t=${n.startRaw}`;return`https://www.loom.com/embed/${n.id}${e}`}return e}var lae=`https://api.github.com/repos/inkeep/open-knowledge`;async function uae(e){let{signal:t,...n}=e??{},r=t?AbortSignal.any([AbortSignal.timeout(5e3),t]):AbortSignal.timeout(5e3);try{let e=await fetch(lae,{headers:{accept:`application/vnd.github+json`,"user-agent":`openknowledge.ai`},...n,signal:r});if(!e.ok)return console.warn(`[github-stars] GitHub API responded ${e.status}`),null;let t=await e.json();return typeof t.stargazers_count==`number`?t.stargazers_count:null}catch(e){return console.warn(`[github-stars] fetch failed: ${e instanceof Error?e.message:String(e)}`),null}}function dae(e){if(!e)return{height:null,viewerFragment:``};let t=e.split(`&`).filter(e=>e.length>0),n=null,r=[];for(let e of t){let t=e.indexOf(`=`);if(t===-1){r.push(e);continue}let i=e.slice(0,t),a=e.slice(t+1);if(i===`height`){let e=Number.parseInt(a,10);!Number.isNaN(e)&&e>0&&(n=e);continue}r.push(e)}return{height:n,viewerFragment:r.join(`&`)}}new OY.default;var fae=R({path:L(Oo([P(),F()])),message:P(),issueCode:P()});Ao(`code`,[R({code:B(`SCHEMA_INVALID`),issues:L(fae)}),R({code:B(`WRITE_ERROR`),detail:P()})]);function pae(e){return{path:e.path.map(e=>typeof e==`symbol`?String(e):e),message:e.message,issueCode:e.code}}function mae(e){if(e.code!==`SCHEMA_INVALID`)return{};let t={};for(let n of e.issues){let e=n.path[0];typeof e==`string`&&(t[e]=t[e]?`${t[e]}; ${n.message}`:n.message)}return t}var hae={defaultKeyType:`PLAIN`,defaultStringType:`PLAIN`,lineWidth:0};function gae(e){if(e.trim()===``)return{doc:new Vl({}),map:{}};let t;try{t=Qu(e)}catch(e){let t=e instanceof Error?e.message:String(e);return{doc:new Vl({}),map:null,parseError:`parse threw: ${t}`}}if(t.errors.length>0)return{doc:t,map:null,parseError:t.errors[0]?.message??`yaml parse errors`};let n;try{n=t.toJS()}catch(e){let n=e instanceof Error?e.message:String(e);return{doc:t,map:null,parseError:`toJS threw: ${n}`}}if(typeof n!=`object`||!n||Array.isArray(n))return{doc:t,map:null,parseError:`top-level value is not a mapping`};let r=L7.safeParse(n);if(!r.success){let e=r.error.issues[0],n=e&&Array.isArray(e.path)?e.path.join(`.`):``,i=e?.message??`unknown`;return{doc:t,map:null,parseError:n?`value at "${n}" failed schema: ${i}`:`schema validation failed: ${i}`}}return{doc:t,map:r.data}}function _ae(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function e9(e,t,n){if(Array.isArray(n)){let r=e.createNode(n),i=Ts(t)?t.flow:void 0;return i!==void 0&&(r.flow=i),r}if(_ae(n)){let r=e.createNode(n),i=Ss(t)?t.flow:void 0;return i!==void 0&&(r.flow=i),r}return n}function vae(e){return e===``?``:`---\n${e.endsWith(`
559
- `)?e.slice(0,-1):e}\n---\n`}var t9=65536;function n9(e){let t=e.match(sZ);return t?{fenced:t[0],body:e.slice(t[0].length)}:{fenced:``,body:e}}function yae(e){if(e.trim()===``)return{doc:new Vl({}),map:{}};let t;try{t=Qu(e,{uniqueKeys:!1})}catch(e){let t=e instanceof Error?e.message:String(e);return{doc:new Vl({}),map:null,parseError:`parse threw: ${t}`}}if(t.errors.length>0)return{doc:t,map:null,parseError:t.errors[0]?.message??`yaml parse errors`};let n;try{n=t.toJS()}catch(e){let n=e instanceof Error?e.message:String(e);return{doc:t,map:null,parseError:`toJS threw: ${n}`}}if(typeof n!=`object`||!n||Array.isArray(n))return{doc:t,map:null,parseError:`top-level value is not a mapping`};let r=L7.safeParse(n);if(!r.success){let e=r.error.issues[0],n=e&&Array.isArray(e.path)?e.path.join(`.`):``,i=e?.message??`unknown`;return{doc:t,map:null,parseError:n?`value at "${n}" failed schema: ${i}`:`schema validation failed: ${i}`}}return{doc:t,map:r.data}}function r9(e){return e===``?{doc:new Vl({}),map:{}}:yae(dZ(e))}function i9(e){let{fenced:t}=n9(e),{map:n,parseError:r}=r9(t);return{map:n??{},parseError:r}}function a9(e){let{fenced:t}=n9(e);if(t===``)return[];let{doc:n,map:r}=r9(t);return r===null?[]:l9(n)}function o9(e){return typeof e==`object`&&!!e&&`key`in e}function s9(e){let t=e.key;return typeof t==`string`?t:t&&typeof t==`object`&&`value`in t&&typeof t.value==`string`?t.value:null}function c9(e,t){let n=e.key;if(typeof n==`string`){e.key=t;return}if(n&&typeof n==`object`){n.value=t;return}e.key=t}function l9(e){let t=e.contents;if(!t||!(`items`in t)||!Array.isArray(t.items))return[];let n=[];for(let e of t.items){if(!o9(e))continue;let t=s9(e);t!==null&&n.push(t)}return n}function u9(e){if(e.contents==null||!(`items`in e.contents)){let t=e.createNode({});return e.contents=t,t}return e.contents}function bae(e){let t=e.contents;return!t||!(`items`in t)||(t.items?.length??0)===0?``:vae(e.toString(hae))}function xae(e){let t=new TextEncoder().encode(e).byteLength;return t>65536?{kind:`region_too_large`,bytes:t,limit:t9}:null}function d9(e){let t=bae(e),n=xae(t);return n?{ok:!1,error:n}:{ok:!0,nextFenced:t}}function Sae(e,t){if(Object.hasOwn(t,`frontmatter`))return{ok:!1,error:{kind:`reserved_key`,key:M7}};let{doc:n,map:r}=r9(e);if(r===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};try{u9(n);for(let[e,r]of Object.entries(t)){if(r===null){n.delete(e);continue}let t=F7.safeParse(r);if(!t.success)return{ok:!1,error:{kind:`invalid_value`,key:e,reason:t.error.issues[0]?.message??`invalid value`}};n.set(e,e9(n,n.get(e,!0),t.data))}return d9(n)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function Cae(e,t,n,r={}){if(t===`frontmatter`||n===`frontmatter`)return{ok:!1,error:{kind:`reserved_key`,key:M7}};let{doc:i,map:a}=r9(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};if(t===n)return{ok:!0,nextFenced:e};let o=i.contents;if(!o||!(`items`in o)||!Array.isArray(o.items))return{ok:!1,error:{kind:`unknown_key`,key:t}};let s=o.items.find(e=>o9(e)&&s9(e)===t);if(!s)return{ok:!1,error:{kind:`unknown_key`,key:t}};if(!r.allowDuplicate&&o.items.some(e=>o9(e)&&e!==s&&s9(e)===n))return{ok:!1,error:{kind:`duplicate_target`,key:n}};try{return c9(s,n),d9(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function f9(e,t){let{doc:n,map:r}=r9(e);if(r===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let i=n.contents;if(!i||!(`items`in i)||!Array.isArray(i.items))return{ok:!0,nextFenced:e};let a=l9(n);if(a.length!==t.length||!p9(a,t))return{ok:!1,error:{kind:`reorder_mismatch`,expected:a,got:[...t]}};try{let e=i.items.filter(o9),r=[];for(let n of t){let i=e.findIndex(e=>s9(e)===n);if(i===-1)return{ok:!1,error:{kind:`reorder_mismatch`,expected:a,got:[...t]}};let[o]=e.splice(i,1);o&&r.push(o)}return i.items=r,d9(n)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function p9(e,t){let n=new Map;for(let t of e)n.set(t,(n.get(t)??0)+1);for(let e of t){let t=(n.get(e)??0)-1;if(t<0)return!1;n.set(e,t)}for(let e of n.values())if(e!==0)return!1;return!0}function m9(e){if(e.length===0)return{kind:`invalid_path`,path:[...e],reason:`path must have at least one segment`};for(let t=0;t<e.length;t++){let n=e[t];if(typeof n!=`string`&&typeof n!=`number`)return{kind:`invalid_path`,path:[...e],reason:`path segment at index ${t} must be string or number`};if(typeof n==`number`&&(!Number.isInteger(n)||n<0))return{kind:`invalid_path`,path:[...e],reason:`numeric path segment at index ${t} must be a non-negative integer`}}return e[0]===`frontmatter`?{kind:`reserved_key`,key:M7}:null}function wae(e,t,n){let r=m9(t);if(r)return{ok:!1,error:r};let{doc:i,map:a}=r9(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let o=F7.safeParse(n);if(!o.success)return{ok:!1,error:{kind:`invalid_value`,key:String(t[t.length-1]),reason:o.error.issues[0]?.message??`invalid value`}};try{return u9(i),i.setIn(t,e9(i,i.getIn(t,!0),o.data)),d9(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function Tae(e,t){let n=m9(t);if(n)return{ok:!1,error:n};let{doc:r,map:i}=r9(e);if(i===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};try{return r.getIn(t,!0)===void 0?{ok:!0,nextFenced:e}:(r.deleteIn(t),d9(r))}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function Eae(e,t){if(t.length===0){let t=e.contents;return Ss(t)?t:null}let n=e.getIn(t,!0);return Ss(n)?n:null}function Dae(e,t,n,r={}){let i=m9(t);if(i)return{ok:!1,error:i};let a=t[t.length-1];if(typeof a!=`string`)return{ok:!1,error:{kind:`invalid_path`,path:[...t],reason:`cannot rename: last path segment must be a string (map key)`}};if(t.length===1&&n===`frontmatter`)return{ok:!1,error:{kind:`reserved_key`,key:M7}};let{doc:o,map:s}=r9(e);if(s===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};if(a===n)return{ok:!0,nextFenced:e};let c=Eae(o,t.slice(0,-1));if(!c)return{ok:!1,error:{kind:`unknown_key`,key:a}};let l=c.items.find(e=>o9(e)&&s9(e)===a);if(!l)return{ok:!1,error:{kind:`unknown_key`,key:a}};if(!r.allowDuplicate&&c.items.some(e=>o9(e)&&e!==l&&s9(e)===n))return{ok:!1,error:{kind:`duplicate_target`,key:n}};try{return c9(l,n),d9(o)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function Oae(e,t,n){if(t.length===0)return f9(e,n);let r=m9(t);if(r)return{ok:!1,error:r};let{doc:i,map:a}=r9(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let o=i.getIn(t,!0);if(!Ss(o))return{ok:!1,error:{kind:`invalid_path`,path:[...t],reason:`cannot reorder: target is not a map`}};let s=[];for(let e of o.items){if(!o9(e))continue;let t=s9(e);t!==null&&s.push(t)}if(s.length!==n.length||!p9(s,n))return{ok:!1,error:{kind:`reorder_mismatch`,expected:s,got:[...n]}};try{let e=o.items.filter(o9),t=[];for(let r of n){let i=e.findIndex(e=>s9(e)===r);if(i===-1)return{ok:!1,error:{kind:`reorder_mismatch`,expected:s,got:[...n]}};let[a]=e.splice(i,1);a&&t.push(a)}return o.items=t,d9(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function kae(e,t,n){let r=m9(t);if(r)return{ok:!1,error:r};let{doc:i,map:a}=r9(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let o=i.getIn(t,!0);if(!Ts(o))return{ok:!1,error:{kind:`invalid_path`,path:[...t],reason:`cannot reorder: target is not a sequence`}};let s=o,c=s.items.length,l=Array.from({length:c},(e,t)=>t),u=[...n];if(!Aae(u,c))return{ok:!1,error:{kind:`reorder_mismatch`,expected:l.map(String),got:u.map(String)}};try{let e=s.items.slice();return s.items=u.map(t=>e[t]),d9(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function Aae(e,t){if(e.length!==t)return!1;let n=Array(t).fill(!1);for(let r of e){if(!Number.isInteger(r)||r<0||r>=t||n[r])return!1;n[r]=!0}return!0}var jae=Object.freeze({source:`local`,skipStoreHooks:!1,context:Object.freeze({origin:`form-write`})});function h9(e){return{ok:!1,error:e}}function Mae(e){return{ok:!0,...e}}function Nae(e){return{ok:!0,...e}}function Pae(e){return{ok:!0,...e}}function g9(e){return{ok:!0,...e}}function _9(e){switch(e.kind){case`unknown_key`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:`unknown key '${e.key}'`,issueCode:`unknown_key`}]};case`duplicate_target`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:`key '${e.key}' already exists`,issueCode:`duplicate_target`}]};case`invalid_value`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:e.reason,issueCode:`invalid_value`}]};case`reserved_key`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:`'${e.key}' is a reserved frontmatter key`,issueCode:`reserved_key`}]};case`reorder_mismatch`:return{code:`WRITE_ERROR`,detail:`reorder list does not match current keys (state changed mid-drag)`};case`region_too_large`:return{code:`SCHEMA_INVALID`,issues:[{path:[],message:`Frontmatter region exceeds ${t9}-byte limit (would be ${e.bytes})`,issueCode:`region_too_large`}]};case`parse_failed`:return{code:`WRITE_ERROR`,detail:`Frontmatter YAML is malformed; fix in source mode to commit (${e.reason})`};case`invalid_path`:return{code:`SCHEMA_INVALID`,issues:[{path:[...e.path],message:e.reason,issueCode:`invalid_path`}]}}}function Fae(e,t){if(e.parseError!==t.parseError||e.keys.length!==t.keys.length)return!1;for(let n=0;n<e.keys.length;n++)if(e.keys[n]!==t.keys[n])return!1;for(let n of e.keys)if(!R7(e.map[n],t.map[n]))return!1;return!0}var Iae=5;function v9(e){let t=e.toString();return{snapshot:Lae(t),raw:t}}function Lae(e){let{map:t,parseError:n}=i9(e);return{map:t,keys:a9(e),parseError:n}}function y9(e){return e.startsWith(`---`)}function Rae(e){let t=e.document,n=t.getText(`source`),r=new Set,i=v9(n),a=i.snapshot,o=n9(i.raw).fenced,s=y9(i.raw),c=!1;function l(e=!1){if(c)return;let t,i;try{let e=v9(n);t=e.snapshot,i=e.raw}catch(e){console.warn(`[bindFrontmatterDoc] readSnapshotFromYText threw:`,e);return}if(!e&&Fae(a,t)){s=y9(i);return}a=t,o=n9(i).fenced,s=y9(i);for(let e of r)try{e(t)}catch(e){console.warn(`[bindFrontmatterDoc] listener threw:`,e)}}let u=e=>{c||zae(e,o.length,s)&&l()};n.observe(u),e.on(`synced`,d);function d(){l(!0)}function f(e){let r;return t.transact(()=>{let{fenced:t}=n9(n.toString());r=e(t),r.ok&&r.nextFenced!==t&&(n.delete(0,t.length),r.nextFenced!==``&&n.insert(0,r.nextFenced))},jae),r??{ok:!1,error:{kind:`parse_failed`,reason:`commit transact produced no result`}}}function p(e){if(c)return h9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});if(Object.hasOwn(e,`frontmatter`))return h9({code:`SCHEMA_INVALID`,issues:[{path:[M7],message:`'${M7}' is a reserved frontmatter key`,issueCode:`reserved_key`}]});let t=Bre.safeParse(e);if(!t.success)return h9({code:`SCHEMA_INVALID`,issues:t.error.issues.map(pae)});let n=t.data,r=Object.keys(n),i=f(e=>Sae(e,n));return i.ok?Mae({appliedKeys:r}):h9(_9(i.error))}function m(e,t,n={}){if(c)return h9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let r=f(r=>Cae(r,e,t,n));return r.ok?Nae({oldKey:e,newKey:t}):h9(_9(r.error))}function h(e){if(c)return h9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let t=f(t=>f9(t,e));return t.ok?Pae({orderedKeys:[...e]}):h9(_9(t.error))}function g(e,t){if(c)return h9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let n=f(n=>wae(n,e,t));return n.ok?g9({path:[...e]}):h9(_9(n.error))}function _(e){if(c)return h9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let t=f(t=>Tae(t,e));return t.ok?g9({path:[...e]}):h9(_9(t.error))}function v(e,t,n={}){if(c)return h9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let r=f(r=>Dae(r,e,t,n));return r.ok?g9({path:[...e]}):h9(_9(r.error))}function y(e,t){if(c)return h9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let n=f(n=>Oae(n,e,t));return n.ok?g9({path:[...e]}):h9(_9(n.error))}function b(e,t){if(c)return h9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let n=f(n=>kae(n,e,t));return n.ok?g9({path:[...e]}):h9(_9(n.error))}return{current(){return v9(n).snapshot},patch(e){return p(e)},rename(e,t,n){return m(e,t,n)},reorder(e){return h(e)},patchPath(e,t){return g(e,t)},deletePath(e){return _(e)},renamePath(e,t,n){return v(e,t,n)},reorderPath(e,t){return y(e,t)},reorderSeqPath(e,t){return b(e,t)},subscribe(e){return r.add(e),()=>{r.delete(e)}},dispose(){c||(c=!0,n.unobserve(u),e.off(`synced`,d),r.clear())}}}function zae(e,t,n){if(t===0&&n)return!0;let r=t>0?t:Iae,i=0;for(let t of e.delta){if(typeof t.retain==`number`){i+=t.retain;continue}if(typeof t.insert==`string`){if(i<r)return!0;i+=t.insert.length;continue}if(t.insert!==void 0){if(i<r)return!0;i+=1;continue}if(typeof t.delete==`number`&&i<r)return!0}return!1}var Bae=new OY.default;Bae.Match_Threshold=.5;var Vae=/\\([!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~])/g,b9=/^\s*\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)+\|?\s*$/,x9=/^[ \t]+([-+*]|\d+[.)]|[a-zA-Z][.)])\s/,Hae=/^\d+([.)])(?=\s)/,Uae=`1`,Wae=/\*\*\s*(`[^`]+`)\s*\*\*/g,Gae=/^(`{3,}|~{3,})/;function Kae(e){let t=new Set,n=null;for(let r=0;r<e.length;r++){let i=e[r].trimEnd(),a=Gae.exec(i);if(a){let e=a[1][0];if(n===null){n=e;continue}if(n===e){n=null;continue}}if(n!==null||r===0||!b9.test(i))continue;let o=e[r-1].trimEnd();if(!(!o.startsWith(`|`)||b9.test(o))){t.add(r-1),t.add(r);for(let n=r+1;n<e.length&&e[n].trimEnd().startsWith(`|`);n++)t.add(n)}}return t}function S9(e){return e.slice(0,-1).trimEnd()}var C9=/^(?:#{1,6}[ \t]|>|(?:[-+*]|\d{1,9}[.)])[ \t]|`{3,}|~{3,}|=+[ \t]*$|-+[ \t]*$|(?:\*[ \t]*){3,}$|(?:_[ \t]*){3,}$)/;function w9(e){let t=new Set,n=null;for(let r=0;r<e.length;r++){let i=e[r]??``,a=/^(`{3,}|~{3,})/.exec(i.trimStart());if(a?.[1]){let e=a[1][0];if(n===null){n=e;continue}if(n===e){n=null;continue}}n!==null&&t.add(r)}return t}var qae=/^<\/?[A-Z][A-Za-z0-9.]*(?:\s[^>]*)?>$/,Jae=/^<[A-Z][A-Za-z0-9.]*(?:\s[^>]*)?>$/,Yae=/^<\/[A-Z][A-Za-z0-9.]*\s*>$/,Xae=/<\/?[A-Z]/;function Zae(e){let t=!1;for(let n=0;n<e.length;n++)if(Xae.test(e[n]??``)){t=!0;break}if(!t)return e;let n=w9(e),r=[],i=[],a=0;for(let t=0;t<e.length;t++){let o=e[t]??``,s=o.trim();if(n.has(t)){r.push(!1),i.push(a);continue}let c=a>=1||!/^[ \t]/.test(o);r.push(c&&qae.test(s));let l=c&&Yae.test(s),u=c&&!l&&Jae.test(s)&&!s.endsWith(`/>`);l?(a=Math.max(0,a-1),i.push(a)):(i.push(a),u&&(a+=1))}let o=Array(e.length);for(let t=0,n=-1;t<e.length;t++)o[t]=n,(e[t]??``).trim()!==``&&(n=t);let s=Array(e.length);for(let t=e.length-1,n=e.length;t>=0;t--)s[t]=n,(e[t]??``).trim()!==``&&(n=t);let c=new Set;for(let t=0;t<e.length;t++){if((e[t]??``).trim()!==``||n.has(t)||(i[t]??0)<1)continue;let a=o[t]??-1,l=s[t]??e.length;(a>=0&&r[a]===!0||l<e.length&&r[l]===!0)&&c.add(t)}let l=[];for(let t=0;t<e.length;t++){if(c.has(t))continue;let n=e[t]??``;l.push(r[t]===!0&&(i[t]??0)>=1?n.replace(/^[ \t]+/,``):n)}return l}function Qae(e){let t=Zae(e.replace(/^/,``).replace(/\r/g,``).replace(Vae,`$1`).replace(Wae,`$1`).replace(/^\n+/,``).replace(/^[*-]{3,}(?=\n|$)/,`---`).replace(/(\n)([#>+-]|\d+[.)]|`{3,}|~{3,})/g,`
556
+ `)},mdxJsxFlowElement(e,t,n,r){let i=e,a=i.data?.sourceRaw;if(typeof a==`string`)return a;let o=i.data?.htmlBoundary;if(o&&typeof o.opener==`string`&&typeof o.closer==`string`){let e=n.containerFlow({type:`root`,children:i.children??[]},r);return`${o.opener}\n\n${e}\n\n${o.closer}`}let s=i.name??``,c=F5(i.attributes??[]);return!i.children||i.children.length===0?s?c?`<${s} ${c} />`:`<${s} />`:``:M5({...i,attributes:(i.attributes??[]).map(L5)},t,n,r)},mark(e,t,n,r){let i=n.createTracker(r),a=n.enter(`mark`),o=i.move(`==`);return o+=Y5(n.containerPhrasing(e,{before:o,after:`==`,...i.current()}),r,`==`),o+=i.move(`==`),a(),o},comment(e,t,n,r){let i=e.data?.sourceForm,a=i===`html`?`<!-- `:`%%`,o=i===`html`?` -->`:`%%`,s=n.createTracker(r),c=n.enter(`comment`),l=s.move(a);return l+=n.containerPhrasing(e,{before:l,after:o,...s.current()}),l+=s.move(o),c(),l},commentBlock(e,t,n,r){let i=n.createTracker(r),a=n.enter(`commentBlock`),o=e.children??[],s=e.data?.sourceForm,c=e.data?.sourceLayout,l=o.length===1&&o[0]?.type===`paragraph`;if(s===`html`&&l){let e=o[0],t=n.containerPhrasing(e,{before:`<!-- `,after:` -->`,...i.current()});return a(),`<!-- ${t} -->`}if(c===`inline`&&l){let e=o[0],t=n.containerPhrasing(e,{before:`%% `,after:` %%`,...i.current()});return a(),`%% ${t} %%`}let u=n.containerFlow(e,i.current());return a(),`%%\n\n${u}\n\n%%`},mdxJsxTextElement(e){let t=e.data?.sourceRaw;if(typeof t==`string`)return t;let n=e.name??``,r=F5(e.attributes??[]);return r?`<${n} ${r} />`:`<${n}/>`},rawMdxFallback(e){return e.value??``},blockquote(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.containerFlow(e,a.current());i();let s=e.data?.sourceMarkerSpacings,c=0;return n.indentLines(o,(e,t,n)=>{if(n)return`>`;let r=c++,i=s?.[r];return i===`lazy`&&r>0&&!N5.test(e)?e:i===`none`||i===0?`>${e}`:typeof i==`number`&&i>=2&&!e.startsWith(` `)?`>${` `.repeat(i)}${e}`:`> ${e}`})}};function F5(e){let t=[];for(let n of e){if(n.type===`mdxJsxExpressionAttribute`){t.push(`{${n.value}}`);continue}let e=n.name;if(n.value===null||n.value===void 0){t.push(e);continue}if(typeof n.value==`string`){n.value.includes(`"`)?t.push(`${e}={${I5(n.value)}}`):t.push(`${e}="${n.value}"`);continue}t.push(`${e}={${n.value.value}}`)}return t.join(` `)}function I5(e){return`"${e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`}function L5(e){return e.type===`mdxJsxAttribute`&&typeof e.value==`string`&&e.value.includes(`"`)?{type:`mdxJsxAttribute`,name:e.name,value:{type:`mdxJsxAttributeValueExpression`,value:I5(e.value)}}:e}function R5(e,t,n=` `){return t===`single`?`${n}'${e.replace(/'/g,`\\'`)}'`:t===`paren`?`${n}(${e.replace(/[()]/g,`\\$&`)})`:`${n}"${e.replace(/"/g,`\\"`)}"`}function z5(e){if(!e)return``;let t=0,n=!0;for(let r of e)r===`(`?t++:r===`)`&&(t--,t<0&&(n=!1));return t!==0&&(n=!1),n?e:e.replace(/[\\()]/g,`\\$&`)}function B5(e){return e.replace(/(?<!\\)&(?=(#[0-9]+|#[xX][0-9A-Fa-f]+|[A-Za-z][A-Za-z0-9]*);)/g,(e,t)=>V5(t)?e:`\\${e}`)}function V5(e){if(e.charCodeAt(0)!==35)return!1;let t=e[1]===`x`||e[1]===`X`?Number.parseInt(e.slice(2),16):Number.parseInt(e.slice(1),10);return t===9||t===10||t===11||t===12||t===13||t===32||t===160}var H5=``,U5=/&#(?:x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);/g;function W5(e){return e.replace(U5,e=>$Z(e)?H5+e.slice(1):e)}function G5(e,t,n){let r=e.unsafe;e.unsafe=r.filter(e=>!(e.character===`&`&&e.after===`[#A-Za-z]`||e.character===`<`||e.character===`[`||e.character===`(`||e.character===`!`&&e.after===`\\[`&&e.inConstruct===`phrasing`||e.character===`@`&&e.before===`[+\\-.\\w]`||e.character===`{`&&Array.isArray(e.inConstruct)&&e.inConstruct.includes(`phrasing`)||e.character==="`"||(e.character===`*`||e.character===`_`||e.character===`~`)&&e.inConstruct===`phrasing`||e.character===`=`&&e.atBreak===!0||e.character===` `&&e.inConstruct===`phrasing`&&e.after===`[\\r\\n]`||e.character===` `&&e.inConstruct===`phrasing`&&e.after===`[\\r\\n]`)),e.unsafe=e.unsafe.map(e=>{if(e.character!==`)`||e.atBreak!==!0||e.before!==`\\d+`||e.after!==void 0)return e;let t={...e,after:`(?:[ \r
557
+ ]|$)`};return delete t._compiled,t});let i;try{i=e.safe(W5(t),n)}finally{e.unsafe=r}return i=i.replaceAll(H5,`\\&`),B5(lne(i,n))}var K5=1,q5=2;function J5(e){if(Number.isNaN(e))return`ws`;let t=m(e);return t===K5?`ws`:t===q5?`punct`:`other`}function sne(e,t,n){let r=J5(t),i=J5(n),a=i!==`ws`&&(i===`other`||r!==`other`),o=r!==`ws`&&(r===`other`||i!==`other`);return e===`_`?a&&(!o||r===`punct`)||o&&(!a||i===`punct`):a||o}function cne(e,t,n){let r=t;for(;r<e.length&&(e[r]===` `||e[r]===` `);)r++;if(r<e.length)return e[r]===`
558
+ `||e[r]===`\r`;let i=n.after.charCodeAt(0);return Number.isNaN(i)||i===10||i===13}function lne(e,t){let n=``,r=0;for(;r<e.length;){let i=e.charAt(r);if(i===`\\`){n+=e.slice(r,r+2),r+=2;continue}if(i===`*`||i===`_`||i===`~`||i===`=`){let a=r+1;for(;a<e.length&&e.charAt(a)===i;)a++;let o=r===0?t.before.charCodeAt(t.before.length-1):e.charCodeAt(r-1);if(i===`=`)n+=(Number.isNaN(o)||o===10||o===13)&&cne(e,a,t)?`\\${e.slice(r,a)}`:e.slice(r,a);else{let s=a<e.length?e.charCodeAt(a):t.after.charCodeAt(0);n+=sne(i,o,s)?`\\${i}`.repeat(a-r):e.slice(r,a)}r=a;continue}n+=i,r+=1}return n}function Y5(e,t,n){let r=n.startsWith(`_`)?`_`:`*`,i=t.before??``,a=t.after??``,o=e,s=o.charCodeAt(0);X5(i.charCodeAt(i.length-1),s,r)&&(o=Z5(s)+o.slice(1));let c=o.charCodeAt(o.length-1);return X5(a.charCodeAt(0),c,r)&&(o=o.slice(0,-1)+Z5(c)),o}function X5(e,t,n){return!(m(t)!==K5||n===`_`&&m(e)===void 0)}function Z5(e){return`&#x${e.toString(16).toUpperCase()};`}function une(e,t,n,r){let i=e.value??``,a=e.data?.sourceDelimiter,o=typeof a==`string`&&/^\$+$/.test(a)?a.length:2;for(o===1&&!fne(i,r)&&(o=2);RegExp(`(^|[^$])${`\\$`.repeat(o)}([^$]|$)`).test(i);)o++;let s=`$`.repeat(o);/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^\$|\$$/.test(i))&&(i=` ${i} `);let c=-1;for(;++c<n.unsafe.length;){let e=n.unsafe[c];if(!e.atBreak)continue;let t=n.compilePattern(e),r;for(;(r=t.exec(i))!==null;){let e=r.index;i.codePointAt(e)===10&&i.codePointAt(e-1)===13&&e--,i=`${i.slice(0,e)} ${i.slice(r.index+1)}`}}return s+i+s}function dne(e,t,n,r){let i=e.data?.sourceDelimiter===`~`?`~`:`~~`,a=n.createTracker(r),o=n.enter(`strikethrough`),s=a.move(i);return s+=Y5(n.containerPhrasing(e,{...a.current(),before:s,after:`~`}),r,i),s+=a.move(i),o(),s}function fne(e,t){return!(e.length===0||!/^\S/.test(e)||!/\S$/.test(e)||/[$\r\n]/.test(e)||e.endsWith(`\\`)||/\\[!-/:-@[-`{-~]/.test(e)||/^\d/.test(t.after)||t.before.endsWith(`\\`))}function Q5(e){if(!Number.isFinite(e)||e<0)return``;if(e<1024)return`${e} B`;let t=[`KiB`,`MiB`,`GiB`,`TiB`],n=e/1024,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n.toFixed(1).replace(/\.0$/,``)} ${t[r]}`}var pne=class{schema;handlers;pmNodeHandlers;pmMarkHandlers;parseProcessor;serializeProcessor;parseCtx={current:{}};freshnessHolder={checker:void 0};constructor(e){this.schema=WS(e.extensions),this.handlers=yne(this.schema,this.parseCtx),this.freshnessHolder.checker=e.deriveStructuralFreshness?q0({parse:e=>this.parseWithFallback(e)}):void 0;let{nodeHandlers:t,markHandlers:n}=bne(this.schema,this.freshnessHolder);this.pmNodeHandlers=t,this.pmMarkHandlers=n,this.parseProcessor=m5({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers}),this.serializeProcessor=h5({toMarkdownHandlers:P5})}parse(e,t){if(!e.trim())return{type:`doc`,content:[{type:`paragraph`,content:[]}]};this.parseCtx.current=t??{};try{return x5(e,this.parseProcessor).toJSON()}finally{this.parseCtx.current={}}}parseToMdast(e){return e.trim()?S5(e,this.parseProcessor):{type:`root`,children:[]}}parseToEditorMdast(e){return e.trim()?C5(e,this.parseProcessor):{type:`root`,children:[]}}parseWithFallback(e,t){return e.trim()?l4(e,{parse:e=>this.parse(e,t)}):{type:`doc`,content:[{type:`paragraph`,content:[]}]}}serialize(e,t){let n;try{n=this.schema.nodeFromJSON(e)}catch(t){let n=`MarkdownManager.serialize() failed: schema rejected JSONContent (type=${e.type}, childCount=${e.content?.length??0})`;throw Error(n,{cause:t})}let r=this.freshnessHolder.checker;t?.skipFreshnessDerive&&(this.freshnessHolder.checker=void 0);try{return T5(n,this.serializeProcessor,{schema:this.schema,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers})}finally{this.freshnessHolder.checker=r}}},$5=B2();function mne(e,t){let n=new Map;for(let e of t)n.set(e.name,e);let r={};for(let t of e){if(t.type===`mdxJsxExpressionAttribute`)continue;let e=t.name,i=n.get(e);if(t.value===null||t.value===void 0){r[e]=!0;continue}if(typeof t.value==`string`){if(i?.type===`number`){let n=Number(t.value);r[e]=Number.isNaN(n)?t.value:n}else i?.type===`boolean`?r[e]=t.value===`true`:r[e]=t.value;continue}let a=t.value.value;try{r[e]=JSON.parse(a)}catch{r[e]=a}}return r}function hne(e){let t=!1;return e.descendants(e=>t||e.type.name===`jsxInline`?!1:e.type.name===`jsxComponent`&&e.attrs.sourceDirty?(t=!0,!1):!0),t}function gne(e,t){return e.attrs.sourceDirty||hne(e)?!0:t?t.isDiverged(e.toJSON()):!1}function _ne(e){if(e.type!==`paragraph`)return!1;let t=e.children??[];return t.length===0?!0:t.every(e=>e.type===`text`&&e.value===``)}function e7(e,t){if(!t)return e;let n={};return t.sourceFenceChar&&(n.sourceFenceChar=t.sourceFenceChar),typeof t.sourceFenceLength==`number`&&(n.sourceFenceLength=t.sourceFenceLength),t.sourcePadded===!0&&(n.sourcePadded=!0),Object.keys(n).length===0?e:{...e,data:n}}function t7(e,t){if(e.length===0)return e7({type:`inlineCode`,value:``},t);if(e.every(e=>e.type===`text`))return e7({type:`inlineCode`,value:e.map(e=>e.value).join(``)},t);if(e.length===1&&`children`in e[0]){let n=e[0];return{...n,children:[t7(n.children,t)]}}return e7({type:`inlineCode`,value:n7(e)},t)}function n7(e){let t=``;for(let n of e)n.type===`text`?t+=n.value:`children`in n&&Array.isArray(n.children)?t+=n7(n.children):`value`in n&&typeof n.value==`string`&&(t+=n.value);return t}var vne=xd;function yne(e,t){let n=e.nodes,r=e.marks,i={};n.paragraph&&(i.paragraph=(e,t,r)=>{let i=r.all(e).flat(),a=i.some(e=>e?.isBlock&&!e?.isInline),o=i.some(e=>e?.isInline||e?.isText||e?.isTextblock);if(a&&!o)return i.length===1?i[0]:i;if(a&&o){let e=i.filter(e=>!e?.isBlock||e?.isInline),t=i.filter(e=>e?.isBlock&&!e?.isInline),r=[],a=n.paragraph.createAndFill(null,e.length>0?e:null);return a&&r.push(a),r.push(...t),r.length===1?r[0]:r}return n.paragraph.createAndFill(null,i.length>0?i:null)}),n.blockquote&&(i.blockquote=jN(n.blockquote,e=>({sourceMarkerSpacings:e.data?.sourceMarkerSpacings??null}))),n.tableCell&&(i.tableCell=(e=>(t,r,i)=>{let a=i.all(t).flat();if(a.length>0&&n.paragraph){let t=n.paragraph.create(null,a);return e.createAndFill(null,[t])}return e.createAndFill(null,null)})(n.tableCell)),n.tableRow&&(i.tableRow=jN(n.tableRow)),n.table&&n.tableRow&&n.tableCell&&(i.table=(e,t,r)=>{let i=e.align??[],a=e.children??[],o=[];for(let e=0;e<a.length;e++){let t=a[e];if(t.type!==`tableRow`)continue;let s=t.children??[],c=[];for(let t=0;t<s.length;t++){let a=s[t];if(a.type!==`tableCell`)continue;let o=r.all(a).flat(),l=o.length>0&&n.paragraph?[n.paragraph.create(null,o)]:null,u=i[t]??null,d=e===0&&n.tableHeader?n.tableHeader:n.tableCell,f=a.data?.sourcePadding??null,p=d.createAndFill({align:u,sourcePadding:f},l);p&&c.push(p)}let l=n.tableRow.createAndFill(null,c.length>0?c:null);l&&o.push(l)}let s=e.data?.sourceDashCounts??null,c=e.data?.sourceOuterPipes??null,l=e.data?.sourceAlignmentPadding??null;return n.table.createAndFill({sourceDashCounts:s,sourceOuterPipes:c,sourceAlignmentPadding:l},o.length>0?o:null)}),n.image&&(i.image=e=>{let r=e.url??``,i=k5(r,t.current.sourcePath);return n.image.createAndFill({src:i,alt:e.alt??null,title:e.title??null,sourceUrl:i===r?null:r})},n.imageReference?i.imageReference=e=>n.imageReference.createAndFill({alt:e.alt??``,label:e.label??e.identifier??``,identifier:e.identifier??``,referenceType:e.referenceType??`shortcut`}):i.imageReference=e=>n.image.createAndFill({src:``,alt:e.alt??null,title:null})),r.escapeMark&&(i.text=t=>{let n=t.value??``,i=typeof t.data?.sourceRaw==`string`?t.data.sourceRaw:null;if(!n&&!i)return null;if(i)return r.sourceLiteral?e.text(n,[r.sourceLiteral.create({sourceRaw:i})]):e.text(n);let a=t.data?.escapedChars,o=t.data?.entityRefSpans;if(!a?.length&&!o?.length)return e.text(n);let s=[...(a??[]).map(e=>({kind:`escape`,offset:e.offset,length:1})),...(o??[]).map(e=>({kind:`entity`,offset:e.offset,length:e.length,raw:e.raw}))];s.sort((e,t)=>e.offset-t.offset);let c=[];for(let e of s){let t=c[c.length-1];e.kind===`entity`&&t?.kind===`entity`&&t.offset+t.length===e.offset&&nQ(t.raw)!==null&&$Z(e.raw)?c[c.length-1]={kind:`entity`,offset:t.offset,length:t.length+e.length,raw:t.raw+e.raw}:c.push(e)}let l=[],u=0;for(let t of c){if(t.offset>u){let r=n.slice(u,t.offset);r&&l.push(e.text(r))}if(t.offset<n.length){let i=n.slice(t.offset,t.offset+t.length);if(i)if(t.kind===`escape`)l.push(e.text(i,[r.escapeMark.create()]));else if(r.sourceLiteral){let n=nQ(t.raw);l.push(e.text(n??i,[r.sourceLiteral.create({sourceRaw:t.raw})]))}else l.push(e.text(i));u=t.offset+t.length}}if(u<n.length){let t=n.slice(u);t&&l.push(e.text(t))}return l.length===1?l[0]:l}),r.code&&(i.inlineCode=t=>e.text(t.value,[r.code.create({sourceFenceChar:t.data?.sourceFenceChar??"`",sourceFenceLength:typeof t.data?.sourceFenceLength==`number`?t.data.sourceFenceLength:1,sourcePadded:t.data?.sourcePadded===!0})]));let a=r.strike??r.delete;if(a&&(i.delete=MN(a,e=>({sourceDelimiter:e.data?.sourceDelimiter===`~`?`~`:`~~`}))),r.highlight&&(i.mark=MN(r.highlight)),r.comment&&(i.comment=MN(r.comment,e=>({sourceForm:e.data?.sourceForm??`percent`}))),n.commentBlock&&(i.commentBlock=jN(n.commentBlock,e=>({sourceForm:e.data?.sourceForm??`percent`,sourceLayout:e.data?.sourceLayout??`block`}))),r.emphasis&&(i.emphasis=MN(r.emphasis,e=>({sourceDelimiter:e.data?.sourceDelimiter??`*`}))),r.strong&&(i.strong=MN(r.strong,e=>({sourceDelimiter:e.data?.sourceDelimiter??`**`}))),n.heading&&(i.heading=jN(n.heading,e=>({level:e.depth,headingStyle:e.data?.sourceStyle??`atx`,sourceTrailingHashes:e.data?.sourceTrailingHashes??null,sourceUnderlineLength:e.data?.sourceUnderlineLength??null,sourceContiguousNext:e.data?.sourceContiguousNext??!1,sourceLeadingIndent:e.data?.sourceLeadingIndent??null,sourceInteriorSpacing:e.data?.sourceInteriorSpacing??null}))),n.codeBlock&&(i.code=t=>{let r=t.value?[e.text(t.value)]:[];return n.codeBlock.createAndFill({language:t.lang??null,meta:t.meta??null,fenceDelimiter:t.data?.sourceFenceChar??"`",fenceLength:t.data?.sourceFenceLength??3,sourceStyle:t.data?.sourceStyle??`fenced`,sourceClosingFenceLength:t.data?.sourceClosingFenceLength??null,sourceUnclosedFence:t.data?.sourceUnclosedFence??!1,sourceFenceIndent:t.data?.sourceFenceIndent??null,sourceInfoPadding:t.data?.sourceInfoPadding??null,sourceIndents:t.data?.sourceIndents??null},r)}),n.thematicBreak&&(i.thematicBreak=e=>n.thematicBreak.createAndFill({sourceRaw:e.data?.sourceRaw??`---`})),n.hardBreak&&(i.break=e=>n.hardBreak.createAndFill({hardBreakStyle:e.data?.sourceStyle??`spaces`,sourceRaw:e.data?.sourceRaw??null})),n.list&&(i.list=jN(n.list,e=>({ordered:!!e.ordered,start:e.start??1,spread:!!e.spread,bulletMarker:e.data?.bulletMarker??null,listMarkerDelimiter:e.data?.listMarkerDelimiter??null}))),n.listItem&&(i.listItem=jN(n.listItem,e=>({checked:e.checked??null,spread:!!e.spread,sourceMarkerSpacing:e.data?.sourceMarkerSpacing??null,sourceOrdinal:e.data?.sourceOrdinal??null,sourceCheckboxChar:e.data?.sourceCheckboxChar??null,sourceContinuationIndent:e.data?.sourceContinuationIndent??null}))),r.link){let t=r.sourceLiteral;i.link=(n,i,a)=>{if((n.children??[]).length===0){let r=typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:`[](${n.url??``})`;return r?t?e.text(r,[t.create({sourceRaw:r})]):e.text(r):null}let o=a.all(n).flat(),s=r.link.create({href:n.url??``,title:n.title??null,linkStyle:n.data?.sourceStyle??`inline`,refLabel:null,sourceUrlForm:n.data?.sourceUrlForm??null,sourceTitleMarker:n.data?.sourceTitleMarker??null});return o.map(e=>e.mark(s.addToSet(e.marks)))},i.linkReference=(n,i,a)=>{if((n.children??[]).length===0){let r=typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:`[${n.label??``}][${n.identifier??``}]`;return r?t?e.text(r,[t.create({sourceRaw:r})]):e.text(r):null}let o=a.all(n).flat(),s=r.link.create({href:``,title:null,linkStyle:n.referenceType??`shortcut`,refLabel:n.label??n.identifier??null});return o.map(e=>e.mark(s.addToSet(e.marks)))}}n.htmlBlock&&(i.html=e=>n.htmlBlock.createAndFill({content:e.value??``}));let o=n.linkDefinition??n.linkRefDef;if(o){let e=!!o.spec.attrs?.url,t=!!o.spec.attrs?.href,n=!!o.spec.attrs?.identifier,r=!!o.spec.attrs?.sourceLayout,a=!!o.spec.attrs?.sourceTitleMarker;i.definition=i=>{let s={title:i.title??null};return n&&(s.identifier=i.identifier??``),s.label=i.label??i.identifier??``,e?s.url=i.url??``:t&&(s.href=i.url??``),r&&(s.sourceLayout=i.data?.sourceLayout??null),a&&(s.sourceTitleMarker=i.data?.sourceTitleMarker??null),o.createAndFill(s)}}if(n.jsxComponent){let r=e=>{if(e&&typeof e==`object`&&`sourceRaw`in e){let t=e.sourceRaw;if(typeof t==`string`)return t}};i.mdxJsxFlowElement=(e,i,a)=>{let o=e.name??``,s=$5.getOrWildcard(o),c=mne(e.attributes,s.props);if(o===`CommonMarkImage`&&typeof c.src==`string`){let e=c.src,n=k5(e,t.current.sourcePath);n!==e&&(c.src=n,c.sourceUrl=e)}let l=a.all(e).flat();return n.jsxComponent.createAndFill({componentName:o,kind:`element`,attributes:e.attributes,sourceRaw:r(e.data)??``,sourceDirty:!1,props:c},l.length?l:void 0)};let a=(e,t)=>{let n=e.attributes?.find(e=>e.type===`mdxJsxAttribute`&&e.name===t);return n&&typeof n.value==`string`?n.value:null};i.mdxJsxTextElement=t=>{if(t.name===`InlineMath`&&n.mathInline){let e=a(t,`formula`)??``,r=a(t,`id`);return n.mathInline.create({formula:e,id:r??null})}if(t.name===`Tag`&&n.tag){let e=a(t,`value`)??``;return n.tag.create({value:e})}if(n.jsxInline){let i=r(t.data)??``;return n.jsxInline.createAndFill({},i?[e.text(i)]:null)}return n.jsxComponent.createAndFill({sourceRaw:r(t.data)??``})},i.mdxFlowExpression=e=>{let t=r(e.data)??`{${e.value??``}}`;return n.jsxComponent.createAndFill({kind:`expression`,sourceRaw:t,sourceDirty:!1})},i.mdxTextExpression=t=>{let n=r(t.data)??`{${t.value??``}}`;return e.text(n)}}return n.wikiLink&&(i.wikiLink=e=>n.wikiLink.createAndFill({target:e.data?.target??``,alias:e.data?.alias??null,anchor:e.data?.anchor??null,sourceTarget:e.data?.sourceTarget??null,sourceAnchor:e.data?.sourceAnchor??null,sourceAlias:e.data?.sourceAlias??null})),n.tag&&(i.tag=e=>n.tag.createAndFill({value:e.value})),n.wikiLinkEmbed&&(i.wikiLinkEmbed=(i,a)=>{let o=i.data?.target??``,s=i.data?.alias??null,c=i.data?.anchor??null,l=yQ(o),{resolveEmbed:u,sourcePath:d}=t.current,f=u&&d?u(o,d)??null:null,p=f?`/${f}`:o,m=a?.type===`paragraph`&&Array.isArray(a.children)&&a.children.length===1;if(m&&vne.has(l)&&n.jsxComponent&&$5.has(`WikiEmbedImage`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedImage`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,alt:s??o,target:o,anchor:c,alias:s}});if(m&&Sd.has(l)&&n.jsxComponent&&$5.has(`WikiEmbedVideo`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedVideo`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,title:s??o,target:o,anchor:c,alias:s}});if(m&&wd.has(l)&&n.jsxComponent&&$5.has(`WikiEmbedAudio`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedAudio`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,title:s??o,target:o,anchor:c,alias:s}});if(m&&Td.has(l)&&n.jsxComponent&&$5.has(`WikiEmbedFile`)){let{resolveSize:e}=t.current,r=e&&d?e(o,d)??null:null,i=r===null?null:Q5(r);return n.jsxComponent.createAndFill({componentName:`WikiEmbedFile`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,target:o,anchor:c,alias:s,size:i}})}let h=s||(c?`${o}#${c}`:o);if(r.link){let t=r.link.create({href:p,title:null,linkStyle:`inline`,refLabel:null,sourceForm:`wikiembed`,target:o,anchor:c,alias:s});return e.text(h,[t])}throw Error("[wikiLinkEmbed handler] schema lacks `link` mark — cannot dispatch without violating the STOP rule against emitting PM wikiLinkEmbed server-side")}),n.mathInline&&(i.inlineMath=e=>n.mathInline.create({formula:e.value??``,sourceDelimiter:e.data?.sourceDelimiter??null})),i.math||=t=>{let r=t.value==null?`«unknown:${t.type}»`:t.value;return n.rawMdxFallback?(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled block mdast: ${t.type}`})),n.rawMdxFallback.createAndFill({reason:`Unhandled block mdast: ${t.type}`},r?[e.text(r)]:null)):null},i.inlineMath||=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled inline mdast: ${t.type}`})),t.value==null?e.text(`«unknown:${t.type}»`):e.text(t.value)),n.footnoteReference?i.footnoteReference=e=>n.footnoteReference.create({identifier:e.identifier,label:e.label??e.identifier}):i.footnoteReference||=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:`footnoteReference`,reason:`FootnoteReference extension missing — recovering [^id] source`})),e.text(`[^${t.label??t.identifier}]`)),n.footnoteDefinition?i.footnoteDefinition=jN(n.footnoteDefinition,e=>{let t=e;return{identifier:t.identifier,label:t.label??t.identifier}}):i.footnoteDefinition||=t=>{console.warn(JSON.stringify({event:`unknown-mdast-type`,type:`footnoteDefinition`,reason:`FootnoteDefinition extension missing — recovering [^id]: marker`}));let r=`[^${t.label??t.identifier}]: `;return n.paragraph?n.paragraph.create(null,e.text(r)):null},i.rawMdxFallbackMdast=t=>{if(!n.rawMdxFallback)return null;let r=t.position?{start:t.position.start?.offset??0,end:t.position.end?.offset??0}:{start:0,end:0};return console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.originalType,reason:`Unhandled mdast: ${t.originalType}`,unresolvedPosition:t.unresolvedPosition??!1})),n.rawMdxFallback.createAndFill({reason:`Unhandled mdast: ${t.originalType}`,originalSpan:r},t.value?[e.text(t.value)]:null)},i}function bne(e,t){let n={},r={},i=e.nodes,a=e.marks;i.paragraph&&(n.paragraph=LN(`paragraph`)),i.blockquote&&(n.blockquote=LN(`blockquote`,e=>{let t=e.attrs.sourceMarkerSpacings,n={};return Array.isArray(t)&&t.length>0&&(n.sourceMarkerSpacings=t),Object.keys(n).length>0?{data:n}:{}})),i.heading&&(n.heading=LN(`heading`,e=>({depth:e.attrs.level,data:{sourceStyle:e.attrs.headingStyle,sourceTrailingHashes:e.attrs.sourceTrailingHashes??void 0,sourceUnderlineLength:e.attrs.sourceUnderlineLength??void 0,sourceContiguousNext:e.attrs.sourceContiguousNext===!0?!0:void 0,sourceLeadingIndent:e.attrs.sourceLeadingIndent??void 0,sourceInteriorSpacing:e.attrs.sourceInteriorSpacing??void 0}}))),i.codeBlock&&(n.codeBlock=e=>{let t=e.attrs.sourceStyle===`indented`?`indented`:`fenced`;return{type:`code`,lang:t===`indented`?null:e.attrs.language??null,meta:t===`indented`?null:e.attrs.meta??null,value:e.textContent??``,data:{sourceFenceChar:e.attrs.fenceDelimiter,sourceFenceLength:e.attrs.fenceLength,sourceStyle:t,sourceClosingFenceLength:e.attrs.sourceClosingFenceLength??void 0,sourceUnclosedFence:e.attrs.sourceUnclosedFence===!0?!0:void 0,sourceFenceIndent:e.attrs.sourceFenceIndent??void 0,sourceInfoPadding:e.attrs.sourceInfoPadding??void 0,sourceIndents:e.attrs.sourceIndents??void 0}}}),i.thematicBreak&&(n.thematicBreak=e=>({type:`thematicBreak`,data:{sourceRaw:e.attrs.sourceRaw}})),i.hardBreak&&(n.hardBreak=e=>({type:`break`,data:{sourceStyle:e.attrs.hardBreakStyle,...typeof e.attrs.sourceRaw==`string`&&e.attrs.sourceRaw.length>0?{sourceRaw:e.attrs.sourceRaw}:{}}})),i.list&&(n.list=LN(`list`,e=>({ordered:e.attrs.ordered??!1,start:e.attrs.ordered?e.attrs.start??1:null,spread:e.attrs.spread??!1,data:{bulletMarker:e.attrs.bulletMarker,listMarkerDelimiter:e.attrs.listMarkerDelimiter}}))),i.listItem&&(n.listItem=(e,t,n)=>{let r=n.all(e),i=r.length>1&&_ne(r[0])?r.slice(1):r,a={};return typeof e.attrs.sourceMarkerSpacing==`number`&&(a.sourceMarkerSpacing=e.attrs.sourceMarkerSpacing),typeof e.attrs.sourceOrdinal==`number`&&(a.sourceOrdinal=e.attrs.sourceOrdinal),e.attrs.sourceCheckboxChar===`X`&&(a.sourceCheckboxChar=`X`),typeof e.attrs.sourceContinuationIndent==`number`&&(a.sourceContinuationIndent=e.attrs.sourceContinuationIndent),{type:`listItem`,checked:e.attrs.checked??null,spread:e.attrs.spread??!1,...Object.keys(a).length>0?{data:a}:{},children:i}}),i.table&&(n.table=(e,t,n)=>{let r=n.all(e),i=[],a=e.firstChild;a&&a.forEach(e=>{let t=e.attrs.align;i.push(t===`left`||t===`right`||t===`center`?t:null)});let o=r.filter(e=>e.type===`tableRow`),s=e.attrs.sourceDashCounts,c={};Array.isArray(s)&&s.length>0&&(c.sourceDashCounts=s);let l=e.attrs.sourceOuterPipes;typeof l==`object`&&l&&typeof l.leading==`boolean`&&typeof l.trailing==`boolean`&&(c.sourceOuterPipes=l);let u=e.attrs.sourceAlignmentPadding;Array.isArray(u)&&u.length>0&&(c.sourceAlignmentPadding=u);let d=Object.keys(c).length>0?c:void 0,f={type:`table`,align:i,children:o};return d&&(f.data=d),f}),i.tableRow&&(n.tableRow=LN(`tableRow`));let o=(e,t)=>{let n={type:`tableCell`,children:p0(t)},r=e.attrs.sourcePadding;return typeof r==`object`&&r&&typeof r.left==`number`&&typeof r.right==`number`&&(n.data={sourcePadding:r}),n};if(i.tableCell&&(n.tableCell=(e,t,n)=>o(e,n.all(e))),i.tableHeader&&(n.tableHeader=(e,t,n)=>o(e,n.all(e))),i.image&&(n.image=e=>({type:`image`,url:e.attrs.sourceUrl??e.attrs.src,alt:e.attrs.alt,title:e.attrs.title})),i.imageReference&&(n.imageReference=e=>{let t=e.attrs.label??``,n=e.attrs.identifier??t;return{type:`imageReference`,alt:e.attrs.alt??``,identifier:n,label:t||n,referenceType:e.attrs.referenceType??`shortcut`}}),i.htmlBlock&&(n.htmlBlock=e=>({type:`html`,value:e.attrs.content})),i.linkDefinition??i.linkRefDef){let e=i.linkDefinition?`linkDefinition`:`linkRefDef`;n[e]=e=>{let t={},n=e.attrs.sourceLayout;(n===`multiline`||n===`inline`)&&(t.sourceLayout=n);let r=e.attrs.sourceTitleMarker;(r===`single`||r===`double`||r===`paren`)&&(t.sourceTitleMarker=r);let i={type:`definition`,identifier:e.attrs.identifier??e.attrs.label??``,label:e.attrs.label??e.attrs.identifier??``,url:e.attrs.url??e.attrs.href??``,title:e.attrs.title};return Object.keys(t).length>0&&(i.data=t),i}}if(i.jsxComponent&&(n.jsxComponent=(e,n,r)=>{if(e.attrs.kind===`expression`)return{type:`html`,value:e.attrs.sourceRaw??``};let i=e.attrs.componentName||null,a=Array.isArray(e.attrs.attributes)?e.attrs.attributes:[];return!gne(e,t.checker)&&e.attrs.sourceRaw?{type:`mdxJsxFlowElement`,name:i,attributes:a,children:[],data:{sourceRaw:String(e.attrs.sourceRaw)}}:$5.getOrWildcard(i??`*`).serialize(e,{all:e=>r.all(e),registry:$5,serializeChildren:()=>{throw Error(`SerializeContext.serializeChildren is not available in the PM→mdast handler. Compat descriptors that need markdown-byte body rendering must emit a marker mdast node and let the to-markdown handler render the body via state.containerFlow.`)}})}),i.rawMdxFallback&&(n.rawMdxFallback=e=>{let t=e.textContent??``,n=typeof e.attrs.reason==`string`?e.attrs.reason:``,r=e.attrs.originalSpan;return{type:`rawMdxFallback`,value:t,data:{reason:n,originalSpan:r&&typeof r==`object`&&`start`in r&&`end`in r?{start:Number(r.start)||0,end:Number(r.end)||0}:{start:0,end:0}}}}),i.jsxInline&&(n.jsxInline=e=>{let t=e.attrs.sourceRaw||e.textContent||``;return{type:`mdxJsxTextElement`,name:null,attributes:[],children:[],data:{sourceRaw:String(t)}}}),i.mathInline&&(n.mathInline=e=>{let t=e.attrs.formula??``,n=e.attrs.id;if(typeof n==`string`&&n.length>0)return{type:`mdxJsxTextElement`,name:`InlineMath`,attributes:[{type:`mdxJsxAttribute`,name:`formula`,value:t},{type:`mdxJsxAttribute`,name:`id`,value:n}],children:[]};let r=e.attrs.sourceDelimiter;return{type:`inlineMath`,value:t,...typeof r==`string`&&r.length>0?{data:{sourceDelimiter:r}}:{}}}),i.wikiLink&&(n.wikiLink=e=>{let t=e.attrs.target??``,n=e.attrs.anchor??null,r=e.attrs.alias??null,i=r||(n?`${t}#${n}`:t);return{type:`wikiLink`,value:i,data:{target:t,anchor:n,alias:r,sourceTarget:typeof e.attrs.sourceTarget==`string`?e.attrs.sourceTarget:null,sourceAnchor:typeof e.attrs.sourceAnchor==`string`?e.attrs.sourceAnchor:null,sourceAlias:typeof e.attrs.sourceAlias==`string`?e.attrs.sourceAlias:null},children:[{type:`text`,value:i}]}}),i.tag&&(n.tag=e=>({type:`tag`,value:String(e.attrs.value??``)})),i.wikiLinkEmbed&&(n.wikiLinkEmbed=e=>{let t=e.attrs.target??``,n=e.attrs.anchor??null,r=e.attrs.alias??null,i=r||(n?`${t}#${n}`:t);return{type:`wikiLinkEmbed`,value:i,data:{target:t,anchor:n,alias:r},children:[{type:`text`,value:i}]}}),a.emphasis&&(r.emphasis=RN(`emphasis`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),a.strong&&(r.strong=RN(`strong`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),a.code&&(r.code=(e,t,n)=>{let r=e.attrs.sourceFenceChar,i=e.attrs.sourceFenceLength;return t7(n,{sourceFenceChar:r,sourceFenceLength:i,sourcePadded:e.attrs.sourcePadded===!0?!0:void 0})}),a.strike??a.delete){let e=a.strike?`strike`:`delete`;r[e]=RN(`delete`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter===`~`?`~`:`~~`}}))}return a.highlight&&(r.highlight=RN(`mark`)),a.comment&&(r.comment=RN(`comment`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`}}))),i.commentBlock&&(n.commentBlock=LN(`commentBlock`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`,sourceLayout:e.attrs.sourceLayout===`inline`?`inline`:`block`}}))),i.footnoteReference&&(n.footnoteReference=e=>{let t=String(e.attrs.identifier??``);return{type:`footnoteReference`,identifier:t,label:e.attrs.label?String(e.attrs.label):t}}),i.footnoteDefinition&&(n.footnoteDefinition=LN(`footnoteDefinition`,e=>({identifier:String(e.attrs.identifier??``),label:e.attrs.label?String(e.attrs.label):String(e.attrs.identifier??``)}))),a.link&&(r.link=(e,t,n)=>{if(e.attrs.sourceForm===`wikiembed`){let t=typeof e.attrs.target==`string`&&e.attrs.target.length>0?e.attrs.target:e.attrs.href??``,r=typeof e.attrs.anchor==`string`&&e.attrs.anchor.length>0?e.attrs.anchor:null,i=typeof e.attrs.alias==`string`&&e.attrs.alias.length>0?e.attrs.alias:null,a=i||(r?`${t}#${r}`:t),o=n.map(e=>`value`in e&&typeof e.value==`string`?e.value:``).join(``);return o!==a&&o.trim().length>0&&!o.includes(`]]`)&&(i=o,a=o),{type:`wikiLinkEmbed`,value:a,data:{target:t,anchor:r,alias:i},children:[{type:`text`,value:a}]}}let r=e.attrs.linkStyle;if(r===`autolink`)return{type:`link`,url:e.attrs.href??``,title:null,children:n,data:{sourceStyle:`autolink`}};if(r===`gfm-autolink`)return{type:`link`,url:e.attrs.href??``,title:null,children:n,data:{sourceStyle:`gfm-autolink`}};if(r===`inline`||!r){let t={};e.attrs.sourceUrlForm===`angle-bracketed`&&(t.sourceUrlForm=`angle-bracketed`);let r=e.attrs.sourceTitleMarker;return(r===`single`||r===`double`||r===`paren`)&&(t.sourceTitleMarker=r),{type:`link`,url:e.attrs.href??``,title:e.attrs.title??null,children:n,...Object.keys(t).length>0?{data:t}:{}}}return{type:`linkReference`,identifier:(e.attrs.refLabel??``).toLowerCase(),label:e.attrs.refLabel,referenceType:r,children:n}}),a.escapeMark&&(r.escapeMark=(e,t,n)=>{for(let e of n)if(e.type===`text`&&e.value){let t=e;t.data??={},t.data.escapedChars??=[];for(let e=0;e<t.value.length;e++)t.data.escapedChars.push({offset:e,char:t.value[e]})}return n.length===1?n[0]:n}),a.sourceLiteral&&(r.sourceLiteral=(e,t,n)=>{let r=typeof e.attrs.sourceRaw==`string`?e.attrs.sourceRaw:``;if(n.length===1&&n[0]?.type===`text`){let e=n[0],t=r||e.value;return iQ(t,e.value)&&(e.data??={},e.data.sourceRaw=t),e}return{type:`text`,value:n.filter(e=>e.type===`text`).map(e=>e.value??``).join(``)||r}}),{nodeHandlers:n,markHandlers:r}}var r7={default:!0,MD013:!1};function i7(e){return e??r7}function xne(e){let t=e.replace(/\\/g,`/`);for(;t.startsWith(`./`);)t=t.slice(2);let n=t.toLowerCase();for(let e of jX)if(n.endsWith(e))return t.slice(0,-e.length);return t}function Sne(e){let t=(e===void 0?[]:Array.isArray(e)?e:[e]).map(e=>e.trim()).filter(e=>e.length>0),n=[],r=[],i=[],a=[],o=0;for(let e of t){let t=e.startsWith(`!`),s=t?e.slice(1):e;if(t||(o+=1),s.length===0){n.push({pattern:e,detail:`empty pattern`});continue}try{let e=(0,XB.default)(s,{dot:!0,strictBrackets:!0});(t?a:i).push(e)}catch(t){n.push({pattern:e,detail:t instanceof Error?t.message:String(t)});continue}if(s.endsWith(`/`))r.push({pattern:e,reason:`trailing-slash`});else if(s.startsWith(`/`))r.push({pattern:e,reason:`leading-slash`});else{let t=s.toLowerCase();jX.some(e=>t.endsWith(e))&&r.push({pattern:e,reason:`doc-extension`})}}let s=o===0;return{invalidPatterns:n,suspiciousPatterns:r,matches(e){if(e===void 0||e===``)return!1;let t=xne(e);return t===``||!(s||i.some(e=>e(t)))?!1:!a.some(e=>e(t))}}}var a7=/[*?[\]{}()+@!|]/;function Cne(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);if(n===-1||e.indexOf(`{`,t+1)!==-1||e.indexOf(`}`,n+1)!==-1)return null;let r=e.slice(t+1,n).split(`,`);return r.length<2||r.some(e=>e.trim()===``||a7.test(e))?null:r.map(r=>e.slice(0,t)+r+e.slice(n+1))}function o7(e){if(e.endsWith(`/`)||e.startsWith(`/`))return{kind:`matches-nothing`,pattern:e};try{(0,XB.default)(e,{dot:!0,strictBrackets:!0})}catch{return{kind:`invalid`,pattern:e}}if(e===`**`||e===`**/*`)return{kind:`everything`};{let t=e.match(/^\*\*\/(.+)\/\*\*$/)?.[1];if(t!==void 0&&!a7.test(t))return{kind:`folder-anywhere`,folder:t};let n=e.match(/^(.+)\/\*\*\/(.+)\/\*\*$/),r=n?.[1],i=n?.[2];if(r!==void 0&&i!==void 0&&!a7.test(r)&&!a7.test(i))return{kind:`folder-recursive-nested`,root:r,folder:i}}for(let t of[`/**/*`,`/**`])if(e.endsWith(t)){let n=e.slice(0,-t.length);if(n.length>0&&!a7.test(n))return{kind:`folder-recursive`,folder:n}}if(e.endsWith(`/*`)){let t=e.slice(0,-2);if(t.length>0&&!a7.test(t))return{kind:`folder-direct`,folder:t}}if(e.startsWith(`**/`)){let t=e.slice(3);if(t.length>0&&!t.includes(`/`)&&!a7.test(t))return{kind:`name-anywhere`,name:t}}return a7.test(e)?{kind:`pattern`,pattern:e}:{kind:`exact`,target:e}}function wne(e){let t=o7(e);if(t.kind!==`pattern`)return[t];let n=Cne(e);if(n!==null){let e=n.map(o7);if(e.every(e=>e.kind!==`pattern`))return e}return[t]}function Tne(e){let t=(e===void 0?[]:Array.isArray(e)?e:[e]).map(e=>e.trim()).filter(e=>e.length>0),n=[],r=[];for(let e of t){let t=e.startsWith(`!`),i=t?e.slice(1):e;i.length!==0&&(t?r:n).push(...wne(i))}return{includes:n,excludes:r}}function s7(e,t){let n=new Set,r=[];for(let i of e){if(i.enabled===!1||!i.schema||!Sne(i.appliesTo).matches(t))continue;let e=i.key??i.file;n.has(e)||(n.add(e),r.push({file:i.file,schema:i.schema}))}return r}var c7={"draft-06":`http://json-schema.org/draft-06/schema#`,"draft-07":`http://json-schema.org/draft-07/schema#`,"2019-09":`https://json-schema.org/draft/2019-09/schema`,"2020-12":`https://json-schema.org/draft/2020-12/schema`},Ene=Object.keys(c7),Dne=`draft-07`,One=new Map(Ene.map(e=>[l7(c7[e]),e]));function l7(e){return e.replace(/^https?:\/\//,``).replace(/#$/,``)}function kne(e){let t=e.$schema;return t===void 0?Dne:typeof t==`string`?One.get(l7(t))??null:null}var u7=new Map;function Ane(e){throw Error(`Unhandled FrontmatterSchemaDialect: ${JSON.stringify(e)}`)}function jne(e){let t=u7.get(e);if(t)return t;let n={allErrors:!0,strict:!1},r;switch(e){case`2020-12`:r=new JB.default(n);break;case`2019-09`:r=new qB.default(n);break;case`draft-06`:case`draft-07`:r=new KB.default(n);break;default:return Ane(e)}return(0,YB.default)(r),u7.set(e,r),r}function Mne(e){let{$schema:t,...n}=e;return n}function Nne(e,t){let n=jne(e),r=t.$id;return typeof r==`string`&&r!==``&&n.removeSchema(r),n.compile(Mne(t))}var d7=new Map,Pne=256;function Fne(e){let t=JSON.stringify(e),n=d7.get(t);if(n!==void 0)return n;let r=null,i=kne(e);if(i!==null)try{r=Nne(i,e)}catch{r=null}return d7.size>=Pne&&d7.clear(),d7.set(t,r),r}function Ine(e){let t=new Map;if(!oZ.test(e))return{data:{},keyLines:t};let{frontmatter:n}=cZ(e),r=uZ(n);if(r.trim()===``)return{data:{},keyLines:t};let i=Qu(r,{uniqueKeys:!1});if(i.errors.length>0)return{data:{},keyLines:t};let a=i.toJS();if(typeof a!=`object`||!a||Array.isArray(a))return{data:{},keyLines:t};if(Ss(i.contents))for(let e of i.contents.items){let n=e.key;if(!ws(n)||typeof n.value!=`string`||!n.range)continue;let i=0,a=Math.min(n.range[0],r.length);for(let e=0;e<a;e++)r.charCodeAt(e)===10&&i++;t.has(n.value)||t.set(n.value,i+1)}return{data:a,keyLines:t}}function Lne(e){if(e===void 0)return``;let t;if(typeof e==`string`)t=`"${e}"`;else try{t=JSON.stringify(e)??String(e)}catch{t=String(e)}return t.length>60&&(t=`${t.slice(0,57)}…`),` (got ${t})`}function Rne(e){if(!e.startsWith(`/`))return null;let t=e.slice(1).split(`/`)[0]??``;return t===``?null:t.replace(/~1/g,`/`).replace(/~0/g,`~`)}function zne(e){return e.split(`/`).slice(1).map(e=>e.replace(/~1/g,`/`).replace(/~0/g,`~`)).join(`.`)}function Bne(e,t){if(t.length===0)return[];let{data:n,keyLines:r}=Ine(e),i=e.split(`
559
+ `),a=e=>({start:{line:e,character:0},end:{line:e,character:i[e]?.length??0}}),o=[];for(let{schema:e}of t){let t=Fne(e);if(t&&!t(n))for(let e of t.errors??[]){let t=e.keyword,i=0,s;if(t===`required`&&e.instancePath===``)s=`Frontmatter property "${String(e.params.missingProperty??``)}" is required`;else if(e.instancePath===``)s=`Frontmatter ${e.message??`violates "${t}"`}`;else{let a=Rne(e.instancePath);a!==null&&(i=r.get(a)??0);let o=zne(e.instancePath);if(t===`enum`){let t=e.params.allowedValues??[],r=a!==null&&o===a?n[a]:void 0;s=`Frontmatter property "${o}" must be one of: ${t.map(String).join(`, `)}${Lne(r)}`}else s=`Frontmatter property "${o}" ${e.message??`violates "${t}"`}`}o.push({range:a(i),severity:`warning`,source:`frontmatter`,code:t,message:s})}}return o}var f7=`doc`;function Vne(e,t){return UW(e,BW({strings:{[f7]:e},config:t})[f7]??[])}function Hne(e,t){let n=BW({strings:{[f7]:e},config:t})[f7]??[],r=e.split(`
560
+ `),i=Une(t);return n.map(e=>Gne(e,r,Wne(e,i)))}function Une(e){let t=new Map;return Object.entries(e).forEach(([e,n],r)=>{let i=e.toUpperCase();if(i===`DEFAULT`)return;let a=null;if(n===`error`||n===`warning`)a=n;else if(typeof n==`object`&&n&&!Array.isArray(n)){let e=n.severity;(e===`error`||e===`warning`)&&(a=e)}a!==null&&t.set(i,{entryIndex:r,severity:a})}),t}function Wne(e,t){let n;for(let r of e.ruleNames){let e=t.get(r.toUpperCase());e!==void 0&&(n===void 0||e.entryIndex>n.entryIndex)&&(n=e)}return n?.severity??`warning`}function Gne(e,t,n){let[r,i]=e.errorRange??[1,null],a=e.lineNumber-1,o=(r??1)-1,s=t[a]?.length??0,c=i==null?s:Math.min(o+i,s),l=e.fixInfo?[Kne(e.fixInfo,e.lineNumber,t)]:void 0;return{range:{start:{line:a,character:o},end:{line:a,character:Math.max(c,o)}},severity:n,source:`markdownlint`,code:e.ruleNames[0]??`MD000`,message:e.errorDetail?`${e.ruleDescription}: ${e.errorDetail}`:e.ruleDescription,...l?{fixes:l}:{}}}function Kne(e,t,n){let r=e.lineNumber??t,i=r-1;if(e.deleteCount===-1){if(r<n.length)return{range:{start:{line:i,character:0},end:{line:i+1,character:0}},newText:``};if(i>0){let e=n[i-1]?.length??0;return{range:{start:{line:i-1,character:e},end:{line:i,character:n[i]?.length??0}},newText:``}}return{range:{start:{line:0,character:0},end:{line:0,character:n[0]?.length??0}},newText:``}}let a=(e.editColumn??1)-1;return{range:{start:{line:i,character:a},end:{line:i,character:a+Math.max(0,e.deleteCount??0)}},newText:e.insertText??``}}var qne=Oo([I(),z(Jd),Po(P(),xo())]),Jne={id:`markdownlint`,sliceSchema:R({enabled:I(),rules:Po(P(),qne)}),defaultSlice:{enabled:!1,rules:r7},async lint(e,t){return Hne(e,i7(t.rules))},fix(e,t){return Vne(e,i7(t.rules))}},Yne=R({appliesTo:Oo([P(),L(P())]).optional(),file:P(),enabled:I().optional(),key:P().optional(),schema:Po(P(),xo()).optional()}),p7=[Jne,{id:`frontmatter`,sliceSchema:R({enabled:I(),schemas:L(Yne)}),defaultSlice:{enabled:!1,schemas:[]},async lint(e,t,n){return Bne(e,s7(t.schemas,n.docName))}}],Xne={enabled:!0,plugins:Object.fromEntries(p7.map(e=>[e.id,e.defaultSlice]))},Zne=new Set([`.markdownlint.json`,`.markdownlint.jsonc`]);function Qne(e){return Zne.has(e)}function $ne(e){return{enabled:e.enabled??!0,plugins:{markdownlint:{...e.markdownlint,rules:e.markdownlint.rules??r7},frontmatter:{enabled:e.frontmatter?.enabled??!1,schemas:e.frontmatter?.schemas??[]}}}}var ere=Object.fromEntries(p7.map(e=>[e.id,e.sliceSchema])),tre=R({effective:R({enabled:I(),plugins:R(ere)}),configFile:P().nullable().optional(),configProblems:L(P()).optional()}),nre=Oo([I(),Po(P(),xo())]);R({ruleId:P().min(1).max(64).regex(/^[A-Za-z][A-Za-z0-9_-]*$/),value:Oo([nre,yo()])}),R({file:P().min(1).max(512),delete:B(!0).optional(),field:P().min(1).max(256).optional(),parentPath:L(Oo([P().min(1).max(256),R({items:B(!0)}).strict()])).max(8).optional(),removeField:B(!0).optional(),renameTo:P().min(1).max(256).optional(),constraint:R({type:z([`string`,`number`,`boolean`,`array`,`object`]).nullable().optional(),enum:L(Oo([P(),F(),I()])).nullable().optional(),itemsEnum:L(Oo([P(),F(),I()])).nullable().optional(),itemsType:z([`string`,`number`,`boolean`,`object`]).nullable().optional(),pattern:P().nullable().optional(),format:P().nullable().optional(),description:P().max(2048).nullable().optional(),required:I().optional()}).optional()}).refine(e=>e.delete===void 0||e.field===void 0&&e.constraint===void 0&&e.removeField===void 0&&e.renameTo===void 0,{message:`delete cannot be combined with a field edit`}).refine(e=>[e.constraint,e.removeField,e.renameTo].filter(e=>e!==void 0).length<=1,{message:`constraint, removeField, and renameTo are mutually exclusive`}).refine(e=>e.removeField===void 0&&e.renameTo===void 0||e.field!==void 0,{message:`removeField and renameTo require field`}).refine(e=>e.parentPath===void 0||e.field!==void 0,{message:`parentPath requires field`}).refine(e=>e.field===void 0?e.constraint===void 0:e.constraint!==void 0||e.removeField!==void 0||e.renameTo!==void 0,{message:`field requires constraint, removeField, or renameTo`});var rre=R({schemas:L(P()),truncated:I()}).strict(),m7=R({line:F(),character:F()}),h7=R({start:m7,end:m7}),g7=R({range:h7,severity:z([`error`,`warning`,`info`,`hint`]),source:P(),code:P(),message:P(),fixes:L(R({range:h7,newText:P()})).optional()});R({files:L(R({file:P(),diagnostics:L(g7),warnings:L(P()).optional()})),fileCount:F(),errorCount:F(),warningCount:F(),warnings:L(P())});var ire=g7.extend({linkTarget:P().optional()}),are=R({files:L(R({file:P(),diagnostics:L(ire)})),fileCount:F(),errorCount:F(),warningCount:F(),warnings:L(P())});R({docName:H$,summary:G$,...W$}).loose();var ore=R({file:P(),fixedCount:F(),diagnostics:L(g7),errorCount:F(),warningCount:F(),warning:P().optional()});function sre(e){let t=e.trim().replace(/^\.\//,``);if(!t.startsWith(`.ok/schemas/`))return!1;let n=t.slice(12);return n.length>0&&!n.includes(`/`)&&!n.includes(`\\`)&&n!==`.`&&n!==`..`}function cre(e){let t=e.trim().toLowerCase().split(`/`).pop()??``;return t.endsWith(`.schema.json`)&&t.length>12?!0:sre(e)&&t.endsWith(`.json`)}var _7=[{id:`MD001`,alias:`heading-increment`,aliases:[`heading-increment`],name:`Heading levels should only increment by one level at a time`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md001.md`,tags:[`headings`],options:[{key:`front_matter_title`,type:`string`,description:`RegExp for matching title in front matter`,default:`^\\s*title\\s*[:=]`}]},{id:`MD003`,alias:`heading-style`,aliases:[`heading-style`],name:`Heading style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md003.md`,tags:[`headings`],options:[{key:`style`,type:`enum`,description:`Heading style`,enum:[`consistent`,`atx`,`atx_closed`,`setext`,`setext_with_atx`,`setext_with_atx_closed`],default:`consistent`}]},{id:`MD004`,alias:`ul-style`,aliases:[`ul-style`],name:`Unordered list style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md004.md`,tags:[`bullet`,`ul`],options:[{key:`style`,type:`enum`,description:`List style`,enum:[`consistent`,`asterisk`,`plus`,`dash`,`sublist`],default:`consistent`}]},{id:`MD005`,alias:`list-indent`,aliases:[`list-indent`],name:`Inconsistent indentation for list items at the same level`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md005.md`,tags:[`bullet`,`ul`,`indentation`],options:[]},{id:`MD007`,alias:`ul-indent`,aliases:[`ul-indent`],name:`Unordered list indentation`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md007.md`,tags:[`bullet`,`ul`,`indentation`],options:[{key:`indent`,type:`integer`,description:`Spaces for indent`,default:2,minimum:1},{key:`start_indented`,type:`boolean`,description:`Whether to indent the first level of the list`,default:!1},{key:`start_indent`,type:`integer`,description:`Spaces for first level indent (when start_indented is set)`,default:2,minimum:1}]},{id:`MD009`,alias:`no-trailing-spaces`,aliases:[`no-trailing-spaces`],name:`Trailing spaces`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md009.md`,tags:[`whitespace`],options:[{key:`br_spaces`,type:`integer`,description:`Spaces for line break`,default:2,minimum:0},{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!1},{key:`list_item_empty_lines`,type:`boolean`,description:`Allow spaces for empty lines in list items`,default:!1},{key:`strict`,type:`boolean`,description:`Include unnecessary breaks`,default:!1}]},{id:`MD010`,alias:`no-hard-tabs`,aliases:[`no-hard-tabs`],name:`Hard tabs`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md010.md`,tags:[`whitespace`,`hard_tab`],options:[{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!0},{key:`ignore_code_languages`,type:`string-array`,description:`Fenced code languages to ignore`,default:[]},{key:`spaces_per_tab`,type:`integer`,description:`Number of spaces for each hard tab`,default:1,minimum:0}]},{id:`MD011`,alias:`no-reversed-links`,aliases:[`no-reversed-links`],name:`Reversed link syntax`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md011.md`,tags:[`links`],options:[]},{id:`MD012`,alias:`no-multiple-blanks`,aliases:[`no-multiple-blanks`],name:`Multiple consecutive blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md012.md`,tags:[`whitespace`,`blank_lines`],options:[{key:`maximum`,type:`integer`,description:`Consecutive blank lines`,default:1,minimum:1}]},{id:`MD013`,alias:`line-length`,aliases:[`line-length`],name:`Line length`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md013.md`,tags:[`line_length`],options:[{key:`line_length`,type:`integer`,description:`Number of characters`,default:80,minimum:1},{key:`heading_line_length`,type:`integer`,description:`Number of characters for headings`,default:80,minimum:1},{key:`code_block_line_length`,type:`integer`,description:`Number of characters for code blocks`,default:80,minimum:1},{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!0},{key:`tables`,type:`boolean`,description:`Include tables`,default:!0},{key:`headings`,type:`boolean`,description:`Include headings`,default:!0},{key:`strict`,type:`boolean`,description:`Strict length checking`,default:!1},{key:`stern`,type:`boolean`,description:`Stern length checking`,default:!1}]},{id:`MD014`,alias:`commands-show-output`,aliases:[`commands-show-output`],name:`Dollar signs used before commands without showing output`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md014.md`,tags:[`code`],options:[]},{id:`MD018`,alias:`no-missing-space-atx`,aliases:[`no-missing-space-atx`],name:`No space after hash on atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md018.md`,tags:[`headings`,`atx`,`spaces`],options:[]},{id:`MD019`,alias:`no-multiple-space-atx`,aliases:[`no-multiple-space-atx`],name:`Multiple spaces after hash on atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md019.md`,tags:[`headings`,`atx`,`spaces`],options:[]},{id:`MD020`,alias:`no-missing-space-closed-atx`,aliases:[`no-missing-space-closed-atx`],name:`No space inside hashes on closed atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md020.md`,tags:[`headings`,`spaces`,`atx_closed`],options:[]},{id:`MD021`,alias:`no-multiple-space-closed-atx`,aliases:[`no-multiple-space-closed-atx`],name:`Multiple spaces inside hashes on closed atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md021.md`,tags:[`headings`,`spaces`,`atx_closed`],options:[]},{id:`MD022`,alias:`blanks-around-headings`,aliases:[`blanks-around-headings`],name:`Headings should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md022.md`,tags:[`headings`,`blank_lines`],options:[{key:`include_front_matter`,type:`boolean`,description:`Include front matter content`,default:!1},{key:`lines_above`,type:`unsupported`,description:`Blank lines above heading`,default:1},{key:`lines_below`,type:`unsupported`,description:`Blank lines below heading`,default:1}]},{id:`MD023`,alias:`heading-start-left`,aliases:[`heading-start-left`],name:`Headings must start at the beginning of the line`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md023.md`,tags:[`headings`,`spaces`],options:[]},{id:`MD024`,alias:`no-duplicate-heading`,aliases:[`no-duplicate-heading`],name:`Multiple headings with the same content`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md024.md`,tags:[`headings`],options:[{key:`siblings_only`,type:`boolean`,description:`Only check sibling headings`,default:!1}]},{id:`MD025`,alias:`single-title`,aliases:[`single-title`,`single-h1`],name:`Multiple top-level headings in the same document`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md025.md`,tags:[`headings`],options:[{key:`front_matter_title`,type:`string`,description:`RegExp for matching title in front matter`,default:`^\\s*title\\s*[:=]`},{key:`level`,type:`integer`,description:`Heading level`,default:1,minimum:1,maximum:6}]},{id:`MD026`,alias:`no-trailing-punctuation`,aliases:[`no-trailing-punctuation`],name:`Trailing punctuation in heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md026.md`,tags:[`headings`],options:[{key:`punctuation`,type:`string`,description:`Punctuation characters`,default:`.,;:!。,;:!`}]},{id:`MD027`,alias:`no-multiple-space-blockquote`,aliases:[`no-multiple-space-blockquote`],name:`Multiple spaces after blockquote symbol`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md027.md`,tags:[`indentation`,`whitespace`,`blockquote`],options:[{key:`list_items`,type:`boolean`,description:`Include list items`,default:!0}]},{id:`MD028`,alias:`no-blanks-blockquote`,aliases:[`no-blanks-blockquote`],name:`Blank line inside blockquote`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md028.md`,tags:[`whitespace`,`blockquote`],options:[]},{id:`MD029`,alias:`ol-prefix`,aliases:[`ol-prefix`],name:`Ordered list item prefix`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md029.md`,tags:[`ol`],options:[{key:`style`,type:`enum`,description:`List style`,enum:[`one`,`ordered`,`one_or_ordered`,`zero`],default:`one_or_ordered`}]},{id:`MD030`,alias:`list-marker-space`,aliases:[`list-marker-space`],name:`Spaces after list markers`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md030.md`,tags:[`ul`,`whitespace`,`ol`],options:[{key:`ul_single`,type:`integer`,description:`Spaces for single-line unordered list items`,default:1,minimum:1},{key:`ol_single`,type:`integer`,description:`Spaces for single-line ordered list items`,default:1,minimum:1},{key:`ul_multi`,type:`integer`,description:`Spaces for multi-line unordered list items`,default:1,minimum:1},{key:`ol_multi`,type:`integer`,description:`Spaces for multi-line ordered list items`,default:1,minimum:1}]},{id:`MD031`,alias:`blanks-around-fences`,aliases:[`blanks-around-fences`],name:`Fenced code blocks should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md031.md`,tags:[`blank_lines`,`code`],options:[{key:`list_items`,type:`boolean`,description:`Include list items`,default:!0}]},{id:`MD032`,alias:`blanks-around-lists`,aliases:[`blanks-around-lists`],name:`Lists should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md032.md`,tags:[`bullet`,`ul`,`blank_lines`,`ol`],options:[]},{id:`MD033`,alias:`no-inline-html`,aliases:[`no-inline-html`],name:`Inline HTML`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md033.md`,tags:[`html`],options:[{key:`allowed_elements`,type:`string-array`,description:`Allowed elements`,default:[]},{key:`table_allowed_elements`,type:`string-array`,description:`Allowed elements in tables`,default:[]}]},{id:`MD034`,alias:`no-bare-urls`,aliases:[`no-bare-urls`],name:`Bare URL used`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md034.md`,tags:[`links`,`url`],options:[]},{id:`MD035`,alias:`hr-style`,aliases:[`hr-style`],name:`Horizontal rule style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md035.md`,tags:[`hr`],options:[{key:`style`,type:`string`,description:`Horizontal rule style`,default:`consistent`}]},{id:`MD036`,alias:`no-emphasis-as-heading`,aliases:[`no-emphasis-as-heading`],name:`Emphasis used instead of a heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md036.md`,tags:[`headings`,`emphasis`],options:[{key:`punctuation`,type:`string`,description:`Punctuation characters`,default:`.,;:!?。,;:!?`}]},{id:`MD037`,alias:`no-space-in-emphasis`,aliases:[`no-space-in-emphasis`],name:`Spaces inside emphasis markers`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md037.md`,tags:[`whitespace`,`emphasis`],options:[]},{id:`MD038`,alias:`no-space-in-code`,aliases:[`no-space-in-code`],name:`Spaces inside code span elements`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md038.md`,tags:[`whitespace`,`code`],options:[]},{id:`MD039`,alias:`no-space-in-links`,aliases:[`no-space-in-links`],name:`Spaces inside link text`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md039.md`,tags:[`whitespace`,`links`],options:[]},{id:`MD040`,alias:`fenced-code-language`,aliases:[`fenced-code-language`],name:`Fenced code blocks should have a language specified`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md040.md`,tags:[`code`,`language`],options:[{key:`allowed_languages`,type:`string-array`,description:`List of languages`,default:[]},{key:`language_only`,type:`boolean`,description:`Require language only`,default:!1}]},{id:`MD041`,alias:`first-line-heading`,aliases:[`first-line-heading`,`first-line-h1`],name:`First line in a file should be a top-level heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md041.md`,tags:[`headings`],options:[{key:`allow_preamble`,type:`boolean`,description:`Allow content before first heading`,default:!1},{key:`front_matter_title`,type:`string`,description:`RegExp for matching title in front matter`,default:`^\\s*title\\s*[:=]`},{key:`level`,type:`integer`,description:`Heading level`,default:1,minimum:1,maximum:6}]},{id:`MD042`,alias:`no-empty-links`,aliases:[`no-empty-links`],name:`No empty links`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md042.md`,tags:[`links`],options:[]},{id:`MD043`,alias:`required-headings`,aliases:[`required-headings`],name:`Required heading structure`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md043.md`,tags:[`headings`],options:[{key:`headings`,type:`string-array`,description:`List of headings`,default:[]},{key:`match_case`,type:`boolean`,description:`Match case of headings`,default:!1}]},{id:`MD044`,alias:`proper-names`,aliases:[`proper-names`],name:`Proper names should have the correct capitalization`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md044.md`,tags:[`spelling`],options:[{key:`names`,type:`string-array`,description:`List of proper names`,default:[]},{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!0},{key:`html_elements`,type:`boolean`,description:`Include HTML elements`,default:!0}]},{id:`MD045`,alias:`no-alt-text`,aliases:[`no-alt-text`],name:`Images should have alternate text (alt text)`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md045.md`,tags:[`accessibility`,`images`],options:[]},{id:`MD046`,alias:`code-block-style`,aliases:[`code-block-style`],name:`Code block style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md046.md`,tags:[`code`],options:[{key:`style`,type:`enum`,description:`Block style`,enum:[`consistent`,`fenced`,`indented`],default:`consistent`}]},{id:`MD047`,alias:`single-trailing-newline`,aliases:[`single-trailing-newline`],name:`Files should end with a single newline character`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md047.md`,tags:[`blank_lines`],options:[]},{id:`MD048`,alias:`code-fence-style`,aliases:[`code-fence-style`],name:`Code fence style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md048.md`,tags:[`code`],options:[{key:`style`,type:`enum`,description:`Code fence style`,enum:[`consistent`,`backtick`,`tilde`],default:`consistent`}]},{id:`MD049`,alias:`emphasis-style`,aliases:[`emphasis-style`],name:`Emphasis style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md049.md`,tags:[`emphasis`],options:[{key:`style`,type:`enum`,description:`Emphasis style`,enum:[`consistent`,`asterisk`,`underscore`],default:`consistent`}]},{id:`MD050`,alias:`strong-style`,aliases:[`strong-style`],name:`Strong style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md050.md`,tags:[`emphasis`],options:[{key:`style`,type:`enum`,description:`Strong style`,enum:[`consistent`,`asterisk`,`underscore`],default:`consistent`}]},{id:`MD051`,alias:`link-fragments`,aliases:[`link-fragments`],name:`Link fragments should be valid`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md051.md`,tags:[`links`],options:[{key:`ignore_case`,type:`boolean`,description:`Ignore case of fragments`,default:!1},{key:`ignored_pattern`,type:`string`,description:`Pattern for ignoring additional fragments`,default:``}]},{id:`MD052`,alias:`reference-links-images`,aliases:[`reference-links-images`],name:`Reference links and images should use a label that is defined`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md052.md`,tags:[`links`,`images`],options:[{key:`ignored_labels`,type:`string-array`,description:`Ignored link labels`,default:[`x`]},{key:`shortcut_syntax`,type:`boolean`,description:`Include shortcut syntax`,default:!1}]},{id:`MD053`,alias:`link-image-reference-definitions`,aliases:[`link-image-reference-definitions`],name:`Link and image reference definitions should be needed`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md053.md`,tags:[`links`,`images`],options:[{key:`ignored_definitions`,type:`string-array`,description:`Ignored definitions`,default:[`//`]}]},{id:`MD054`,alias:`link-image-style`,aliases:[`link-image-style`],name:`Link and image style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md054.md`,tags:[`links`,`images`],options:[{key:`autolink`,type:`boolean`,description:`Allow autolinks`,default:!0},{key:`inline`,type:`boolean`,description:`Allow inline links and images`,default:!0},{key:`full`,type:`boolean`,description:`Allow full reference links and images`,default:!0},{key:`collapsed`,type:`boolean`,description:`Allow collapsed reference links and images`,default:!0},{key:`shortcut`,type:`boolean`,description:`Allow shortcut reference links and images`,default:!0},{key:`url_inline`,type:`boolean`,description:`Allow URLs as inline links`,default:!0}]},{id:`MD055`,alias:`table-pipe-style`,aliases:[`table-pipe-style`],name:`Table pipe style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md055.md`,tags:[`table`],options:[{key:`style`,type:`enum`,description:`Table pipe style`,enum:[`consistent`,`leading_only`,`trailing_only`,`leading_and_trailing`,`no_leading_or_trailing`],default:`consistent`}]},{id:`MD056`,alias:`table-column-count`,aliases:[`table-column-count`],name:`Table column count`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md056.md`,tags:[`table`],options:[]},{id:`MD058`,alias:`blanks-around-tables`,aliases:[`blanks-around-tables`],name:`Tables should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md058.md`,tags:[`table`],options:[]},{id:`MD059`,alias:`descriptive-link-text`,aliases:[`descriptive-link-text`],name:`Link text should be descriptive`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md059.md`,tags:[`links`,`accessibility`],options:[{key:`prohibited_texts`,type:`string-array`,description:`Prohibited link texts`,default:[`click here`,`here`,`link`,`more`]}]},{id:`MD060`,alias:`table-column-style`,aliases:[`table-column-style`],name:`Table column style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md060.md`,tags:[`table`],options:[{key:`style`,type:`enum`,description:`Table column style`,enum:[`any`,`aligned`,`compact`,`tight`],default:`any`},{key:`aligned_delimiter`,type:`boolean`,description:`Aligned delimiter columns`,default:!1}]}],lre=(()=>{let e=new Map;for(let t of _7){e.set(t.id.toUpperCase(),t.id);for(let n of t.aliases)e.set(n.toUpperCase(),t.id)}return e})();function v7(e){return lre.get(e.toUpperCase())??null}function ure(e,t){let n=v7(t);if(n===null)return;let r;for(let[t,i]of Object.entries(e))v7(t)===n&&(r={key:t,value:i});return r}var dre=[`Headings`,`Lists`,`Whitespace`,`Code`,`Links & images`,`Style`],fre=[[`headings`,`Headings`],[`bullet`,`Lists`],[`ul`,`Lists`],[`ol`,`Lists`],[`links`,`Links & images`],[`images`,`Links & images`],[`accessibility`,`Links & images`],[`code`,`Code`],[`language`,`Code`],[`emphasis`,`Style`],[`html`,`Style`],[`line_length`,`Whitespace`],[`whitespace`,`Whitespace`],[`hard_tab`,`Whitespace`],[`blank_lines`,`Whitespace`],[`indentation`,`Whitespace`]];function pre(e){for(let[t,n]of fre)if(e.tags.includes(t))return n;return`Style`}async function mre(e,t,n){if(!t.enabled)return[];let r=[];for(let i of p7){let a=t.plugins[i.id];a.enabled&&r.push(...await i.lint(e,a,{docName:n}))}return r}var hre=/\p{M}+/gu,gre=/[^\p{L}\p{N}]+/gu,_re=/^-+|-+$/g;function y7(e){return e.trim().normalize(`NFKD`).replace(hre,``).toLowerCase().replace(gre,`-`).replace(_re,``)}function vre(e,t){let n=t.get(e)??0;return t.set(e,n+1),n===0?e:`${e}-${n}`}function yre(e,t){let n=y7(e);return n?vre(n,t):``}function b7(e,t){let n=y7(e);return t?`#${n}-${y7(t)}`:`#${n}`}var x7=new Set([`img`,`video`,`audio`,`mark`]),bre=new Map(R2.flatMap(e=>e.surface===`compat`&&x7.has(e.rendersAs)?[[e.name,e]]:[]));function S7(e){let t={};for(let n of e.attributes){if(n.type!==`mdxJsxAttribute`)return null;let e=n.name.toLowerCase();if(!(e.length>=3&&e.startsWith(`on`)))if(n.value===null)t[n.name]=!0;else if(typeof n.value==`string`)t[n.name]=n.value;else return null}return t}function C7(e){let t=e.name;if(!t||!x7.has(t))return null;let n=S7(e);return n===null?null:{type:`element`,tagName:t,properties:n,children:[]}}function w7(e){let t=e.name;if(!t)return null;let n=bre.get(t);if(!n)return null;let r=S7(e);if(r===null)return null;let i=n.translateProps(r),a={};for(let[e,t]of Object.entries(i))(typeof t==`string`||typeof t==`boolean`)&&(a[e]=t);return{type:`element`,tagName:n.rendersAs,properties:a,children:[]}}var xre=(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-link`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:b7(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},Sre=(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-embed`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:b7(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},Cre=(e,t)=>{let n=t,r=C7(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i=w7(n);if(i){e.patch(t,i);let n=e.applyData(t,i);return n.tagName===`img`?{type:`element`,tagName:`p`,properties:{},children:[n]}:n}let a={type:`element`,tagName:`pre`,properties:{className:[`mdx-component`]},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]}]};return e.patch(t,a),e.applyData(t,a)},wre=(e,t)=>{let n=t,r=C7(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i=w7(n);if(i)return e.patch(t,i),e.applyData(t,i);let a={type:`element`,tagName:`span`,properties:{className:[`mdx-inline`],dataJsxInline:``},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]};return e.patch(t,a),e.applyData(t,a)},Tre=(e,t)=>{let n=t,r=n.data.reason||`unknown`,i=n.value||``,a=r.replace(/--/g,`—`),o={type:`comment`,value:` Parse error: ${a} `},s={type:`element`,tagName:`pre`,properties:{className:[`mdx-fallback`],dataRawMdxFallback:``,dataReason:a},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:i}]}]};return e.patch(t,s),[o,e.applyData(t,s)]},Ere=(e,t)=>{let n={type:`element`,tagName:`mark`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)};function T7(e){if(typeof e!=`object`||!e)return``;let t=e;return typeof t.value==`string`?t.value:Array.isArray(t.children)?t.children.map(T7).join(``):``}var E7={wikiLink:xre,wikiLinkEmbed:Sre,mdxJsxFlowElement:Cre,mdxJsxTextElement:wre,rawMdxFallback:Tre,mark:Ere,tag:(e,t)=>{let n=t.value,r={type:`element`,tagName:`a`,properties:{className:[`tag`],dataTag:n,href:`#tag/${n}`},children:[{type:`text`,value:`#${n}`}]};return e.patch(t,r),e.applyData(t,r)},comment:(e,t)=>{let n={type:`comment`,value:T7(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},commentBlock:(e,t)=>{let n={type:`comment`,value:T7(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:(e,t)=>{let n=t.identifier,r={type:`element`,tagName:`sup`,properties:{id:`fnref-${n}`,dataFootnoteRef:``,dataFootnoteId:n,className:[`footnote-ref`]},children:[{type:`element`,tagName:`a`,properties:{href:`#fn-${n}`,className:[`footnote-ref-link`]},children:[{type:`text`,value:`[${n}]`}]}]};return e.patch(t,r),e.applyData(t,r)},footnoteDefinition:(e,t)=>{let n=t.identifier,r={type:`element`,tagName:`aside`,properties:{id:`fn-${n}`,dataFootnoteDef:``,dataFootnoteId:n,className:[`footnote-def`]},children:[{type:`element`,tagName:`div`,properties:{className:[`footnote-body`]},children:e.all(t)},{type:`element`,tagName:`a`,properties:{href:`#fnref-${n}`,className:[`footnote-backref`],ariaLabel:`Back to reference`},children:[{type:`text`,value:`↩`}]}]};return e.patch(t,r),e.applyData(t,r)}},Dre=/url\s*\(\s*['"]?\s*(?:javascript|vbscript|data)\s*:/i,Ore=/\bexpression\s*\(/i,kre=1e4;function Are(e){return!(e.length>kre||Dre.test(e)||Ore.test(e))}function D7(e){for(let t of e.split(`,`)){let e=t.trim();if(e!==``&&!xZ(e.split(/\s+/)[0]??``))return!1}return!0}var jre={a:[`href`,`title`],img:[`src`,`alt`,`title`],video:[`src`,`title`],audio:[`src`,`title`],code:[`className`]},Mre=new Set([`href`,`src`]),Nre=ke(`<>`),O7=()=>e=>{D(e,`element`,e=>{let t=jre[e.tagName.toLowerCase()],n=e.properties;if(!(!t||!n))for(let e of t){let t=n[e];if(Array.isArray(t)){let r=t.map(e=>typeof e==`string`?i3(e):e);r.some((e,n)=>e!==t[n])&&(n[e]=r);continue}if(typeof t!=`string`)continue;let r;if(Mre.has(e))if(t===`<>`||t===Nre)r=``;else{let e=i3(t);r=e===t?t:ke(e)}else r=i3(t);r!==t&&(n[e]=r)}})},k7=()=>e=>{D(e,`element`,e=>{let t=e.tagName.toLowerCase(),n=e.properties;if(!n)return;if(t===`a`||t===`area`||t===`link`||t===`base`){let e=n.href;typeof e==`string`&&!xZ(e)&&delete n.href}if(t===`img`||t===`iframe`||t===`script`||t===`embed`||t===`source`||t===`audio`||t===`video`||t===`track`){let e=n.src;typeof e==`string`&&!xZ(e)&&delete n.src}if(t===`form`){let e=n.action;typeof e==`string`&&!xZ(e)&&delete n.action}if(t===`img`||t===`source`){let e=n.srcSet;typeof e==`string`&&!D7(e)&&delete n.srcSet;let t=n.srcset;typeof t==`string`&&!D7(t)&&delete n.srcset}if(t===`video`){let e=n.poster;typeof e==`string`&&!xZ(e)&&delete n.poster}let r=n.style;typeof r==`string`&&!Are(r)&&delete n.style})};function Pre(e){let t=le().use(Ee,{handlers:E7}).use(O7).use(k7).use(BG),n=t.runSync(e);return String(t.stringify(n))}function Fre(e){let t=/\r?\n|\r/g,n=[],r=0,i=t.exec(e);for(;i!==null;)n.push(A7(e.slice(r,i.index),r>0,!0),i[0]),r=i.index+i[0].length,i=t.exec(e);return n.push(A7(e.slice(r),r>0,!1)),n.join(``)}function A7(e,t,n){let r=0,i=e.length,a=e=>e===9||e===32;for(;t&&r<i&&a(e.charCodeAt(r));)r++;for(;n&&i>r&&a(e.charCodeAt(i-1));)i--;return i>r?e.slice(r,i):``}var j7=/\r?\n|\r/,Ire=(e,t)=>{let n=Fre(String(t.value));if(!j7.test(n)){let r={type:`text`,value:n};return e.patch(t,r),e.applyData(t,r)}let r=n.split(j7),i=[];for(let e=0;e<r.length;e++)e>0&&i.push({type:`element`,tagName:`br`,properties:{},children:[]}),r[e].length>0&&i.push({type:`text`,value:r[e]});return i};function Lre(e){let t=le().use(ye).use(aP,[`yaml`]).use(w8).use(ue).use(d5).use(Z4).use(U8).use(f3).use(Ee,{handlers:{...E7,text:Ire}}).use(O7).use(k7).use(BG);return String(t.processSync(Y4(d3(e))))}nI(),xF(),SF();var M7=`frontmatter`,N7=[`text`,`number`,`boolean`,`date`,`list`,`object`];z(N7);var Rre=Oo([P(),F(),I()]),P7=as(()=>Oo([Rre.transform(e=>String(e)),Po(P(),F7),L(P7)])),F7=as(()=>Oo([P(),F(),I(),L(P7),Po(P(),F7)])),zre=/^\d{4}-\d{2}-\d{2}$/;function Bre(e){return typeof e==`string`&&zre.test(e)}function Vre(e){return Array.isArray(e)?`list`:typeof e==`object`&&e?`object`:typeof e==`boolean`?`boolean`:typeof e==`number`?`number`:Bre(e)?`date`:`text`}function I7(e){if(Array.isArray(e)){let t=[];for(let n of e)n!==null&&t.push(I7(n));return t}if(typeof e==`object`&&e){let t={};for(let[n,r]of Object.entries(e))t[n]=r===null?``:I7(r);return t}return e}var L7=fs(I7,Po(P(),F7)),Hre=Po(P(),Oo([F7,yo()]));function Ure(e){return!!(e===null||typeof e==`string`&&e===``||Array.isArray(e)&&e.length===0)}function R7(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!R7(e[n],t[n]))return!1;return!0}if(e!==null&&t!==null&&typeof e==`object`&&typeof t==`object`&&!Array.isArray(e)&&!Array.isArray(t)){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.hasOwn(t,r)||!R7(e[r],t[r]))return!1;return!0}return!1}R({docName:H$,summary:G$,content:P().optional(),...W$}).loose(),R({docName:H$,summary:G$,markdown:P(),position:z([`append`,`prepend`,`replace`]).optional(),extension:z(jX).optional(),...W$}).loose(),R({docName:H$,summary:G$,find:P().min(1),replace:P(),offset:F().int().nonnegative().optional(),...W$}).loose(),R({docName:H$,connectionId:P().min(1),scope:z([`last`,`session`,`file`,`count`]).optional(),count:F().int().positive().optional(),...W$}).loose().refine(e=>e.scope!==`count`||e.count!==void 0,{message:`count is required when scope is 'count'`,path:[`count`]});var z7=R({value:P(),truncatedFrom:F().int().nonnegative().optional(),hint:P().optional()}).loose(),Wre=Ao(`kind`,[R({kind:B(`inline`),content:P()}),R({kind:B(`truncated`),byteLength:F().int().nonnegative(),hint:P()})]),B7=R({kind:B(`content-divergence`),intendedBytes:F().int().nonnegative(),actualBytes:F().int().nonnegative(),byteDelta:F().int(),divergenceType:P().optional(),currentState:Wre.optional(),hint:P().optional()}).loose(),Gre=R({type:B(`orphan`),parentCandidates:L(P()),message:P()}).loose(),V7=R({kind:B(`disk-edit-reconciled`),intendedBytes:F().int().nonnegative(),actualBytes:F().int().nonnegative(),byteDelta:F().int(),mergeOutcome:P().optional(),hint:P().optional()}).loose(),H7=Ao(`kind`,[B7,V7]),U7=L(Ao(`kind`,[B7,V7,R({kind:B(`mermaid-parse-error`),fenceIndex:F().int().positive(),fenceFirstLine:P(),message:P(),line:F().int().positive().optional()}).loose(),R({kind:B(`lint-violation`),source:P(),code:P(),message:P(),severity:z([`error`,`warning`,`info`,`hint`]),line:F().int().positive(),column:F().int().positive(),linkTarget:P().optional()}).loose()])).min(1),W7=L(R({href:P(),resolvedTo:P().nullable(),reason:z([`no-such-doc`,`no-such-file`,`unresolvable`])}).loose());R({timestamp:P().min(1),summary:z7.optional(),warning:H7.optional(),warnings:U7.optional()}).loose(),R({timestamp:P().min(1),subscriberCount:F().int().nonnegative(),systemSubscriberCount:F().int().nonnegative(),hints:L(Gre).optional(),summary:z7.optional(),warning:H7.optional(),warnings:U7.optional(),brokenLinks:W7}).loose(),R({timestamp:P().min(1),subscriberCount:F().int().nonnegative(),systemSubscriberCount:F().int().nonnegative(),summary:z7.optional(),warning:H7.optional(),warnings:U7.optional(),brokenLinks:W7}).loose(),R({docName:P().min(1),scope:z([`last`,`session`,`count`]),undone:I()}).loose(),R({docs:L(R({docName:U$,markdown:P(),position:z([`append`,`prepend`,`replace`]).optional(),extension:z(jX).optional(),summary:G$}).loose()).min(1).max(100),...W$}).loose();var Kre=R({type:d1,title:P(),detail:P().optional()}).loose(),qre=Ao(`status`,[R({status:B(`written`),docName:P().min(1),summary:z7.optional(),warnings:U7.optional(),brokenLinks:W7}).loose(),R({status:B(`error`),docName:P().min(1),error:Kre}).loose()]);R({timestamp:P().min(1),results:L(qre),written:F().int().nonnegative(),failed:F().int().nonnegative()}).loose(),R({docName:H$,patch:Po(P(),Oo([F7,yo()])),types:Po(P(),z(N7)).optional(),summary:G$,...W$}).loose(),R({timestamp:P().min(1),subscriberCount:F().int().nonnegative(),systemSubscriberCount:F().int().nonnegative(),appliedKeys:L(P()),summary:z7.optional(),warning:H7.optional(),warnings:U7.optional(),brokenLinks:W7}).loose(),R({entries:L(R({level:z([`info`,`warn`,`error`]),message:P().max(RY),event:P().optional(),fields:Po(P(),xo()).optional(),ts:F().optional(),sourceId:P().optional(),lineNumber:F().optional()}).loose()).max(100),droppedSinceLastFlush:F().int().min(0).optional()}).loose(),R({accepted:F().int().min(0)}).loose();var Jre=R({status:P().min(1),reason:P()}).loose(),Yre=R({docName:P().min(1),content:P(),lifecycle:Jre.nullable()}).loose(),G7=R({kind:z([`document`,`asset`,`folder`,`file`]).default(`document`),docName:P().min(1).optional(),docExt:P().min(1).default(`.md`),size:F().int().nonnegative(),modified:P().min(1),isSymlink:I().default(!1),canonicalDocName:P().nullable().default(null),targetPath:P().nullable().default(null),path:P().min(1).optional(),assetExt:P().min(1).optional(),mediaKind:z([`image`,`video`,`audio`,`pdf`,`text`,`mermaid`]).nullable().optional(),referencedBy:L(P().min(1)).optional(),hasChildren:I().optional()}).loose().refine(e=>e.kind===`document`?e.docName!==void 0&&e.path===void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.kind===`folder`?e.docName===void 0&&e.path!==void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0:e.kind===`file`?e.path!==void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.path!==void 0&&e.assetExt!==void 0&&e.referencedBy!==void 0&&e.hasChildren===void 0,{message:`document/asset/folder/file kind must match its required fields (document → docName; asset → path+assetExt+referencedBy; folder → path only, no docName; file → path, no mediaKind/referencedBy/hasChildren)`}),Xre=R({documents:L(G7),truncated:I().optional()}).loose(),Zre=R({source:P().min(1),anchor:P().nullable(),title:P(),snippet:P().nullable()}).loose(),Qre=R({docName:P().min(1),backlinks:L(Zre)}).loose(),$re=R({counts:Po(P().min(1),F().int().nonnegative())}).loose(),eie=Ao(`kind`,[R({kind:B(`doc`),docName:P().min(1),anchor:P().nullable(),title:P(),snippet:P().nullable()}).loose(),R({kind:B(`external`),url:P().min(1),title:P(),snippet:P().nullable()}).loose()]),tie=R({docName:P().min(1),forwardLinks:L(eie)}).loose(),nie=Ao(`kind`,[R({id:P().min(1),kind:B(`doc`),docName:P().min(1),anchor:P().nullable(),label:P(),cluster:P().nullable(),category:P().nullable(),tags:L(P()).nullable()}).loose(),R({id:P().min(1),kind:B(`external`),url:P().min(1),label:P()}).loose()]),rie=R({source:P().min(1),target:P().min(1)}).loose(),iie=R({nodes:L(nie),links:L(rie)}).loose(),aie=R({ts:F().int().min(0),url:P(),method:P(),ua:P().optional(),origin:P().optional(),referer:P().optional(),host:P().optional(),remote:P().optional(),secChUa:P().optional(),secChUaMobile:P().optional(),secChUaPlatform:P().optional(),secFetchSite:P().optional(),secFetchDest:P().optional(),secFetchMode:P().optional(),secFetchUser:P().optional()}).loose(),oie=R({app:Oo([B(`cursor`),B(`codex`),B(`claude`),yo()]),signals_fired:L(P())}).loose();R({entries:L(aie),count:F().int().min(0),detection:oie}).loose(),R({writers:L(R({id:P().min(1),name:P().optional(),email:P().optional()}).loose()).optional(),summary:G$,...W$}).loose(),R({checkpointRef:P().min(1)}).loose();var sie=R({v:F().int().optional(),id:P().min(1),name:P().min(1),colorSeed:P().optional(),docs:L(P()),summaries:L(P()).optional()}).loose();R({entries:L(R({sha:P().min(1),timestamp:P().min(1),author:P(),authorEmail:P(),type:z([`checkpoint`,`wip`,`upstream`,`park`]),message:P(),contributors:L(sie),checkpoint:xo().nullable(),parentSha:P().nullable().optional()}).loose()),total:F().int().nonnegative().optional(),truncated:I().optional(),hasMore:I().optional()}).loose(),R({sha:P().regex(/^[0-9a-f]{40}$/i),content:P(),timestamp:P(),author:P()}).loose();var cie=R({contentDir:P().min(1),pathSeparator:z([`/`,`\\`]),symlinkResolved:I()}).loose();L(Ao(`source`,[R({docName:P().min(1),timestamp:P().min(1),size:F().int().nonnegative(),source:B(`flat`)}).loose(),R({docName:P().min(1),timestamp:P().min(1),source:B(`timeline`),sha:P().min(1)}).loose()])).meta({description:"Flat array of rescue buffer entries; discriminated via `source`."});var lie=R({domain:P().min(1),title:P().optional(),description:P().optional(),siteName:P().optional(),faviconDataUri:P().optional()}).loose();R({url:P()}).loose();var uie=Ao(`ok`,[R({ok:B(!0),metadata:lie}).loose(),R({ok:B(!1),reason:P()}).loose()]),die=R({orphans:L(R({docName:P().min(1),title:P()}).loose())}).loose(),fie=R({hubs:L(R({docName:P().min(1),title:P(),count:F().int().nonnegative()}).loose())}).loose(),pie=R({source:P().min(1),title:P(),snippet:P().nullable()}).loose();R({deadLinks:L(R({target:P().min(1),sources:L(pie)}).loose())}).loose(),R({target:R({docName:P().min(1),title:P(),aliases:L(P())}).loose(),mentions:L(R({source:P().min(1),excerpt:P(),offset:F().int().nonnegative()}).loose()),truncated:I()}).loose(),R({projectPath:P().min(1)}).loose();var mie=z([`not-a-git-worktree`,`init-failed`]);Ao(`ok`,[R({ok:B(!0),projectPath:P().min(1)}).loose(),R({ok:B(!1),reason:mie,message:P().min(1)}).loose()]),R({host:P().min(1).optional()}).loose(),R({host:P().min(1).optional(),token:P().min(1)}).loose(),R({host:P(),login:P()}).loose(),R({key:P().min(1)}).loose(),R({keyPresent:I()}).loose();var hie=z([`no_key`,`invalid_endpoint`,`rate_limit`,`timeout`,`http_error`,`network`,`dims_mismatch`,`malformed_response`]),gie=Ao(`ok`,[R({ok:B(!0),endpoint:P().min(1),model:P().min(1),dimensions:F().int().positive()}).loose(),R({ok:B(!1),endpoint:P().min(1),model:P().min(1),reason:hie,status:F().int().optional()}).loose()]);R({name:P().refine(e=>e.trim().length>0,{message:`name must be non-empty`}),email:P().refine(e=>e.trim().length>0,{message:`email must be non-empty`})}).loose(),R({authenticated:I()}).loose(),R({channel:z([`login`,`gh-login`]).default(`login`)}).loose(),R({}).loose();var _ie=R({stackIndex:F().int().min(0),ts:F().int().min(0),additions:F().int().min(0),deletions:F().int().min(0)}).loose(),vie=R({docName:P().min(1),additionsTotal:F().int().min(0),deletionsTotal:F().int().min(0),lastTs:F().int().min(0),bursts:L(_ie)}).loose(),yie=R({displayName:P().min(1),color:P().min(1),icon:P().optional(),connectionId:P().min(1)}).loose(),bie=R({sessionAlive:I(),agent:yie.nullable(),files:L(vie)}).loose(),xie=R({diff:P(),before:P(),after:P(),generatedAt:F().int().min(0)}).loose();R({}).loose(),R({}).loose(),R({}).loose(),R({}).loose(),R({}).loose(),R({}).loose();var Sie=R({displayName:P().min(1),icon:P(),color:P().min(1),currentDoc:P().nullable(),mode:z([`idle`,`writing`]),ts:F().int().min(0)}).loose();R({presence:Po(P().min(1),Sie)}).loose();var Cie=R({sessionId:P().min(1),agentType:P().min(1),ts:F().int().min(0),insertedChars:F().int().min(0),deletedChars:F().int().min(0)}).loose();R({effects:L(R({"doc.name":P().min(1),entries:L(Cie)}).loose())}).loose(),R({decisions:L(R({ts:F().int().min(0),decision:P().min(1),kind:P().min(1),"doc.name":P().min(1),pathRole:P().min(1)}).loose())}).loose(),Po(P().min(1),I()).meta({description:`Flat boolean record keyed by agent-scheme name (claude / codex / cursor). True = installed.`}),R({path:P().min(1,`path must be non-empty`)}).loose(),R({}).loose();var wie=R({fromDocName:P().min(1),toDocName:P().min(1)}).loose(),Tie=R({fromPath:P().min(1),toPath:P().min(1)}).loose();R({}).loose(),R({path:P().min(1),...W$,summary:G$}).loose();var Eie=R({docName:P().min(1)}).loose();R({path:P().min(1),...W$,summary:G$}).loose();var Die=R({path:P().min(1)}).loose();R({kind:z([`file`,`folder`]),path:P().min(1),...W$,summary:G$}).loose();var Oie=R({kind:z([`file`,`folder`]),path:P().min(1),duplicatedDocNames:L(P().min(1))}).loose(),kie=R({pages:L(R({docName:P().min(1),title:P(),docExt:P().min(1),size:F().int().nonnegative(),modified:P().min(1),icon:P().min(1).max(2048).optional()}).loose())}).loose(),Aie=R({level:F().int().min(1).max(6),text:P(),slug:P()}).loose(),jie=R({docName:P().min(1),headings:L(Aie)}).loose(),Mie=R({docName:P().min(1),rewrites:F().int().nonnegative()}).loose();R({kind:z([`file`,`folder`,`asset`]),fromPath:P().min(1),toPath:P().min(1),...W$,summary:G$}).loose();var Nie=R({renamed:L(wie),renamedAssets:L(Tie),rewrittenDocs:L(Mie).optional(),summary:z7.optional()}).loose();R({kind:z([`file`,`folder`,`asset`]),path:P().min(1),...W$}).loose();var Pie=R({deletedDocNames:L(P().min(1))}).loose();R({kind:z([`file`,`folder`,`asset`]),path:P().min(1),...W$,summary:G$}).loose();var Fie=R({deletedDocNames:L(P().min(1))}).loose();R({docName:P().min(1),commitSha:P().regex(/^[0-9a-f]{40}$/i,{message:`commitSha must be a 40-char git SHA`}),summary:G$,...W$}).loose(),R({restoredFrom:P().min(1),timestamp:P().min(1),summary:z7.optional(),warning:B7.optional(),warnings:U7.optional()}).loose();var Iie=z([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),Lie=R({label:P().min(1),webUrl:Za().nullable()}).loose(),K7=Ao(`checkStatus`,[R({checkStatus:B(`allowed`)}).loose(),R({checkStatus:B(`denied`),deniedReason:z([`no-collaborator`,`private-no-access`,`repo-not-found`,`not-authenticated`])}).loose(),R({checkStatus:B(`unknown`),unknownError:z([`network`,`timeout`,`rate-limit`,`token-invalid`,`malformed-response`,`ssh-unverified`]).optional()}).loose()]),q7=z([`auth-403`,`auth-401`,`auth-scope-mismatch`,`auth-no-credential`,`semantic-protected-branch`]),Rie=z($u),zie=z([`succeeded`,`up-to-date`,`conflict`,`refused`,`error`]);R({state:Iie,lastSyncUtc:P().nullable(),lastFetchUtc:P().nullable(),lastPushedSha:P().nullable(),ahead:F().int().min(0),behind:F().int().min(0),consecutiveFailures:F().int().min(0),conflictCount:F().int().min(0),hasRemote:I(),syncEnabled:I(),identityUnresolved:I(),remote:Lie.nullable().optional(),pushError:P().optional(),pushErrorCode:q7.optional(),pullError:P().optional(),pullErrorCode:q7.optional(),pausedReason:P().optional(),pushPermission:K7.optional(),syncMode:Rie.optional(),lastPullUtc:P().nullable().optional(),lastPullOutcome:zie.nullable().optional()}).loose(),R({op:z([`sync`,`push`,`pull`]).optional()}).loose(),R({op:z([`sync`,`push`,`pull`])}).loose(),R({conflicts:L(R({file:P().min(1),detectedAt:P().min(1),oursSha:P().optional(),theirsSha:P().optional(),baseSha:P().optional()}).loose())}).loose(),R({file:P().min(1),strategy:z([`mine`,`theirs`,`content`,`delete`]),content:P().optional()}).loose().refine(e=>e.strategy!==`content`||e.content!==void 0&&e.content!==``,{message:`content must be a non-empty string when strategy is 'content'`,path:[`content`]}),R({}).loose(),R({file:P().min(1),base:P(),ours:P(),theirs:P(),kind:z([`both-modified`,`delete-modify`,`modify-delete`]),lifecycleStatus:P().nullable()}).loose(),R({plan:cs(e=>e!==void 0,{message:`plan is required`})}).loose(),R({plan:cs(e=>e!==void 0,{message:`plan is required`})}).loose(),R({result:cs(e=>e!==void 0,{message:`result is required`})}).loose();var Bie=R({path:P().min(1),summary:P().min(1)}).loose(),Vie=R({files:F().int().nonnegative(),folders:F().int().nonnegative()}).loose();R({packs:L(R({id:P().min(1),name:P().min(1),description:P().min(1),defaultSubfolder:P().optional(),folders:L(Bie),entryCounts:Vie}).loose())}).loose(),R({noOpen:I().optional(),out:P().min(1).optional()}).loose();var Hie=R({reason:z([`unsupported-platform`,`spawn-error`]),message:P()}).loose();Ao(`status`,[R({status:B(`installed`),outputPath:P(),size:F().int().nonnegative(),sha256:P(),skillVersion:P()}).loose(),R({status:B(`built`),outputPath:P(),size:F().int().nonnegative(),sha256:P(),skillVersion:P(),handoffError:Hie.optional()}).loose(),R({status:B(`failed`),buildError:P()}).loose(),R({status:B(`skip-current`),skillVersion:P(),recordedAt:P().optional()}).loose()]);var J7=z(RX);Eo({schema:B(1),targets:L(J7).default([])}),R({tags:L(R({name:P().min(1),count:F().int().nonnegative(),isLeaf:I()}).loose())}).loose();var Uie=R({docName:P().min(1),title:P(),matchingTags:L(P().min(1)),snippet:P().nullable()}).loose();R({name:P().min(1),docs:L(Uie)}).loose(),R({folder:xo(),frontmatter_local:Po(P(),xo()).nullable()}).loose(),R({path:P(),frontmatter:Po(P(),xo()).optional()}).loose(),R({applied:xo()}).loose();var Y7=Po(P(),xo()).meta({description:`Free-form frontmatter map embedded in template payloads.`});R({template:R({name:P().min(1),folder:P(),scope:z([`local`,`inherited`]),path:P().min(1),frontmatter:Y7,body:P()}).strict()}).strict();var Wie=R({templates:L(R({name:P().min(1),title:P().optional(),description:P().optional(),path:P().min(1),source_folder:P()}).strict()),truncated:I()}).strict();R({folder:P(),name:P(),body:P().optional(),frontmatter:Y7.optional(),...W$,summary:G$}).strict(),R({path:P().min(1),created:I(),warnings:L(P())}).strict(),R({sourcePath:P().min(1),targetFolder:P(),name:P().optional(),title:P().optional(),deleteSource:I().optional(),...W$,summary:G$}).strict(),R({path:P().min(1),created:I(),warnings:L(P())}).strict(),R({existed:I(),path:P().min(1)}).strict(),R({fromFolder:P(),fromName:P(),toFolder:P(),toName:P(),body:P().optional(),frontmatter:Y7.optional(),...W$,summary:G$}).strict(),R({from:P().min(1),to:P().min(1),committed:I()}).strict();var X7=z(_X),Gie=/^[a-z0-9-]+$/,Kie=/^[A-Za-z0-9_-]+$/,Z7=R({name:P(),description:P()}).strict();R({skill:R({name:P().min(1),scope:X7,path:P().min(1),frontmatter:Z7,body:P(),files:L(R({path:P().min(1),text:P().nullable()})).optional(),managed:I().optional()}).strict()}).strict();var qie=R({skills:L(R({name:P().min(1),description:P().optional(),scope:X7,path:P().min(1),absolutePath:P().min(1).optional(),installed:I(),hosts:L(P()),installedVersion:P().optional(),bundledVersion:P().optional(),updateAvailable:I().optional(),managed:I().optional()}).strict()),truncated:I()}).strict();R({scope:X7.default(`project`),name:P(),body:P().optional(),frontmatter:Z7,...W$,summary:G$}).strict(),R({path:P().min(1),created:I(),warnings:L(P())}).strict(),R({scope:X7.default(`project`),name:P(),...W$,summary:G$}).strict(),R({name:P().min(1),version:P().min(1),previousVersion:P().optional(),checkpointRef:P().optional()}).strict(),R({existed:I(),path:P().min(1)}).strict(),R({scope:X7.default(`project`),fromName:P(),toName:P(),body:P().optional(),frontmatter:Z7.optional(),...W$,summary:G$}).strict(),R({from:P().min(1),to:P().min(1),committed:I()}).strict();var Q7=z([`reference`,`script`]);R({scope:X7.default(`project`),name:P(),path:P().min(1),content:P(),...W$,summary:G$}).strict(),R({path:P().min(1),created:I(),kind:Q7,content:I()}).strict(),R({path:P().min(1),kind:Q7,text:P()}).strict(),R({path:P().min(1),existed:I(),kind:Q7}).strict(),R({scope:X7.default(`project`),name:P(),targets:L(J7).optional().meta({description:`Explicit editor ids to install into; omit to use project-configured editors.`}),...W$,summary:G$}).strict(),R({name:P().min(1),hosts:L(P()),scripts:I(),warnings:L(P()),warningCodes:L(z([`no-targets`,`scripts-present`]))}).strict(),R({scope:X7.default(`project`),name:P()}).strict(),R({name:P().min(1),uninstalled:I()}).strict();var Jie=R({targets:L(J7),configured:I()}).strict();R({targets:L(J7)}).strict(),R({targets:L(J7),reprojected:L(R({name:P(),hosts:L(P())}).strict()),bundleHosts:L(P()),removedFrom:L(P())}).strict(),R({scope:X7.default(`project`),name:P(),version:P().regex(/^[0-9a-f]{40}$/i),...W$,summary:G$}).strict(),R({name:P().min(1),version:P(),restoredFiles:L(P()),warnings:L(P())}).strict(),R({query:P().optional(),intent:z([`autocomplete`,`full_text`,`omnibar`]).optional(),ranking:z([`navigation`,`relevance`]).optional(),scopes:L(z([`page`,`folder`,`content`,`file`])).optional(),scope:P().optional(),limit:F().int().nonnegative().optional(),semantic:I().optional(),source:z([`omnibar`,`mcp`,`http`]).optional()}).loose();var Yie=R({kind:z([`page`,`folder`,`content`,`file`]),path:P().min(1),title:P(),score:F(),signals:Po(P(),xo()),snippet:P().optional()}).loose(),Xie=R({capable:I(),applied:I(),coverage:R({embedded:F().int().nonnegative(),total:F().int().nonnegative()})}).loose();R({enabled:I(),keyPresent:I(),keyNotRequired:I(),keySource:z([`project`,`file`,`env`]).nullable(),keyHint:P().nullable(),ready:I(),capable:I(),embedded:F().int().nonnegative(),total:F().int().nonnegative()}).loose(),R({query:P(),intent:z([`autocomplete`,`full_text`,`omnibar`]),results:L(Yie),elapsedMs:F().nonnegative(),semantic:Xie.optional(),truncated:I().optional(),ready:I().optional()}).loose();var Zie=R({version:P().min(1),recordedAt:P().min(1)}).loose();R({currentVersion:P().min(1),targets:Po(P(),Zie.nullable())}).loose();var Qie=`server-info`,$ie=`branch-switched`,eae=`disk-ack`,tae=`config-validation-rejected`,nae=`config-ignore-nested-error`,$7=z([`files`,`backlinks`,`graph`,`sync-status`,`session-activity`,`tags`,`lint-config`]),rae=R({v:B(1),ch:B(Qie),seq:F(),serverInstanceId:P().min(1),currentBranch:P().min(1).optional()}).loose(),iae=R({v:B(1),ch:B($ie),seq:F(),branch:P().min(1)}).loose(),aae=R({v:B(1),ch:$7,seq:F()}).loose(),oae=R({v:B(1),ch:B(eae),seq:F(),docName:P().min(1),sv:P().min(1)}).loose(),sae=R({v:B(1),ch:B(tae),seq:F(),docName:P().min(1),error:Uf}).loose(),cae=R({v:B(1),ch:B(nae),seq:F(),path:P().min(1),error:P().min(1)}).loose();function lae(e){let t;try{t=new URL(e)}catch{return null}let n=t.pathname.match(/^\/video\/(\d+)/);if(n)return n[1]??null;let r=t.pathname.match(/^\/(\d+)/);return r?r[1]??null:null}function uae(e){if(typeof e!=`string`||e.length===0)return e;let t=u2(e);if(t){let e=t.noCookie?`www.youtube-nocookie.com`:`www.youtube.com`,n=t.startSeconds===null?``:`?start=${t.startSeconds}`;return`https://${e}/embed/${t.id}${n}`}if(a2(e)){let t=lae(e);return t?`https://player.vimeo.com/video/${t}`:e}let n=n2(e);if(n){let e=n.startRaw===null?``:`?t=${n.startRaw}`;return`https://www.loom.com/embed/${n.id}${e}`}return e}var dae=`https://api.github.com/repos/inkeep/open-knowledge`;async function fae(e){let{signal:t,...n}=e??{},r=t?AbortSignal.any([AbortSignal.timeout(5e3),t]):AbortSignal.timeout(5e3);try{let e=await fetch(dae,{headers:{accept:`application/vnd.github+json`,"user-agent":`openknowledge.ai`},...n,signal:r});if(!e.ok)return console.warn(`[github-stars] GitHub API responded ${e.status}`),null;let t=await e.json();return typeof t.stargazers_count==`number`?t.stargazers_count:null}catch(e){return console.warn(`[github-stars] fetch failed: ${e instanceof Error?e.message:String(e)}`),null}}function pae(e){if(!e)return{height:null,viewerFragment:``};let t=e.split(`&`).filter(e=>e.length>0),n=null,r=[];for(let e of t){let t=e.indexOf(`=`);if(t===-1){r.push(e);continue}let i=e.slice(0,t),a=e.slice(t+1);if(i===`height`){let e=Number.parseInt(a,10);!Number.isNaN(e)&&e>0&&(n=e);continue}r.push(e)}return{height:n,viewerFragment:r.join(`&`)}}new DY.default;var mae=R({path:L(Oo([P(),F()])),message:P(),issueCode:P()});Ao(`code`,[R({code:B(`SCHEMA_INVALID`),issues:L(mae)}),R({code:B(`WRITE_ERROR`),detail:P()})]);function hae(e){return{path:e.path.map(e=>typeof e==`symbol`?String(e):e),message:e.message,issueCode:e.code}}function gae(e){if(e.code!==`SCHEMA_INVALID`)return{};let t={};for(let n of e.issues){let e=n.path[0];typeof e==`string`&&(t[e]=t[e]?`${t[e]}; ${n.message}`:n.message)}return t}var _ae={defaultKeyType:`PLAIN`,defaultStringType:`PLAIN`,lineWidth:0};function vae(e){if(e.trim()===``)return{doc:new Vl({}),map:{}};let t;try{t=Qu(e)}catch(e){let t=e instanceof Error?e.message:String(e);return{doc:new Vl({}),map:null,parseError:`parse threw: ${t}`}}if(t.errors.length>0)return{doc:t,map:null,parseError:t.errors[0]?.message??`yaml parse errors`};let n;try{n=t.toJS()}catch(e){let n=e instanceof Error?e.message:String(e);return{doc:t,map:null,parseError:`toJS threw: ${n}`}}if(typeof n!=`object`||!n||Array.isArray(n))return{doc:t,map:null,parseError:`top-level value is not a mapping`};let r=L7.safeParse(n);if(!r.success){let e=r.error.issues[0],n=e&&Array.isArray(e.path)?e.path.join(`.`):``,i=e?.message??`unknown`;return{doc:t,map:null,parseError:n?`value at "${n}" failed schema: ${i}`:`schema validation failed: ${i}`}}return{doc:t,map:r.data}}function yae(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function e9(e,t,n){if(Array.isArray(n)){let r=e.createNode(n),i=Ts(t)?t.flow:void 0;return i!==void 0&&(r.flow=i),r}if(yae(n)){let r=e.createNode(n),i=Ss(t)?t.flow:void 0;return i!==void 0&&(r.flow=i),r}return n}function bae(e){return e===``?``:`---\n${e.endsWith(`
561
+ `)?e.slice(0,-1):e}\n---\n`}var t9=65536;function n9(e){let t=e.match(oZ);return t?{fenced:t[0],body:e.slice(t[0].length)}:{fenced:``,body:e}}function xae(e){if(e.trim()===``)return{doc:new Vl({}),map:{}};let t;try{t=Qu(e,{uniqueKeys:!1})}catch(e){let t=e instanceof Error?e.message:String(e);return{doc:new Vl({}),map:null,parseError:`parse threw: ${t}`}}if(t.errors.length>0)return{doc:t,map:null,parseError:t.errors[0]?.message??`yaml parse errors`};let n;try{n=t.toJS()}catch(e){let n=e instanceof Error?e.message:String(e);return{doc:t,map:null,parseError:`toJS threw: ${n}`}}if(typeof n!=`object`||!n||Array.isArray(n))return{doc:t,map:null,parseError:`top-level value is not a mapping`};let r=L7.safeParse(n);if(!r.success){let e=r.error.issues[0],n=e&&Array.isArray(e.path)?e.path.join(`.`):``,i=e?.message??`unknown`;return{doc:t,map:null,parseError:n?`value at "${n}" failed schema: ${i}`:`schema validation failed: ${i}`}}return{doc:t,map:r.data}}function r9(e){return e===``?{doc:new Vl({}),map:{}}:xae(uZ(e))}function i9(e){let{fenced:t}=n9(e),{map:n,parseError:r}=r9(t);return{map:n??{},parseError:r}}function a9(e){let{fenced:t}=n9(e);if(t===``)return[];let{doc:n,map:r}=r9(t);return r===null?[]:l9(n)}function o9(e){return typeof e==`object`&&!!e&&`key`in e}function s9(e){let t=e.key;return typeof t==`string`?t:t&&typeof t==`object`&&`value`in t&&typeof t.value==`string`?t.value:null}function c9(e,t){let n=e.key;if(typeof n==`string`){e.key=t;return}if(n&&typeof n==`object`){n.value=t;return}e.key=t}function l9(e){let t=e.contents;if(!t||!(`items`in t)||!Array.isArray(t.items))return[];let n=[];for(let e of t.items){if(!o9(e))continue;let t=s9(e);t!==null&&n.push(t)}return n}function u9(e){if(e.contents==null||!(`items`in e.contents)){let t=e.createNode({});return e.contents=t,t}return e.contents}function Sae(e){let t=e.contents;return!t||!(`items`in t)||(t.items?.length??0)===0?``:bae(e.toString(_ae))}function Cae(e){let t=new TextEncoder().encode(e).byteLength;return t>65536?{kind:`region_too_large`,bytes:t,limit:t9}:null}function d9(e){let t=Sae(e),n=Cae(t);return n?{ok:!1,error:n}:{ok:!0,nextFenced:t}}function wae(e,t){if(Object.hasOwn(t,`frontmatter`))return{ok:!1,error:{kind:`reserved_key`,key:M7}};let{doc:n,map:r}=r9(e);if(r===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};try{u9(n);for(let[e,r]of Object.entries(t)){if(r===null){n.delete(e);continue}let t=F7.safeParse(r);if(!t.success)return{ok:!1,error:{kind:`invalid_value`,key:e,reason:t.error.issues[0]?.message??`invalid value`}};n.set(e,e9(n,n.get(e,!0),t.data))}return d9(n)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function Tae(e,t,n,r={}){if(t===`frontmatter`||n===`frontmatter`)return{ok:!1,error:{kind:`reserved_key`,key:M7}};let{doc:i,map:a}=r9(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};if(t===n)return{ok:!0,nextFenced:e};let o=i.contents;if(!o||!(`items`in o)||!Array.isArray(o.items))return{ok:!1,error:{kind:`unknown_key`,key:t}};let s=o.items.find(e=>o9(e)&&s9(e)===t);if(!s)return{ok:!1,error:{kind:`unknown_key`,key:t}};if(!r.allowDuplicate&&o.items.some(e=>o9(e)&&e!==s&&s9(e)===n))return{ok:!1,error:{kind:`duplicate_target`,key:n}};try{return c9(s,n),d9(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function f9(e,t){let{doc:n,map:r}=r9(e);if(r===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let i=n.contents;if(!i||!(`items`in i)||!Array.isArray(i.items))return{ok:!0,nextFenced:e};let a=l9(n);if(a.length!==t.length||!p9(a,t))return{ok:!1,error:{kind:`reorder_mismatch`,expected:a,got:[...t]}};try{let e=i.items.filter(o9),r=[];for(let n of t){let i=e.findIndex(e=>s9(e)===n);if(i===-1)return{ok:!1,error:{kind:`reorder_mismatch`,expected:a,got:[...t]}};let[o]=e.splice(i,1);o&&r.push(o)}return i.items=r,d9(n)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function p9(e,t){let n=new Map;for(let t of e)n.set(t,(n.get(t)??0)+1);for(let e of t){let t=(n.get(e)??0)-1;if(t<0)return!1;n.set(e,t)}for(let e of n.values())if(e!==0)return!1;return!0}function m9(e){if(e.length===0)return{kind:`invalid_path`,path:[...e],reason:`path must have at least one segment`};for(let t=0;t<e.length;t++){let n=e[t];if(typeof n!=`string`&&typeof n!=`number`)return{kind:`invalid_path`,path:[...e],reason:`path segment at index ${t} must be string or number`};if(typeof n==`number`&&(!Number.isInteger(n)||n<0))return{kind:`invalid_path`,path:[...e],reason:`numeric path segment at index ${t} must be a non-negative integer`}}return e[0]===`frontmatter`?{kind:`reserved_key`,key:M7}:null}function Eae(e,t,n){let r=m9(t);if(r)return{ok:!1,error:r};let{doc:i,map:a}=r9(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let o=F7.safeParse(n);if(!o.success)return{ok:!1,error:{kind:`invalid_value`,key:String(t[t.length-1]),reason:o.error.issues[0]?.message??`invalid value`}};try{return u9(i),i.setIn(t,e9(i,i.getIn(t,!0),o.data)),d9(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function Dae(e,t){let n=m9(t);if(n)return{ok:!1,error:n};let{doc:r,map:i}=r9(e);if(i===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};try{return r.getIn(t,!0)===void 0?{ok:!0,nextFenced:e}:(r.deleteIn(t),d9(r))}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function Oae(e,t){if(t.length===0){let t=e.contents;return Ss(t)?t:null}let n=e.getIn(t,!0);return Ss(n)?n:null}function kae(e,t,n,r={}){let i=m9(t);if(i)return{ok:!1,error:i};let a=t[t.length-1];if(typeof a!=`string`)return{ok:!1,error:{kind:`invalid_path`,path:[...t],reason:`cannot rename: last path segment must be a string (map key)`}};if(t.length===1&&n===`frontmatter`)return{ok:!1,error:{kind:`reserved_key`,key:M7}};let{doc:o,map:s}=r9(e);if(s===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};if(a===n)return{ok:!0,nextFenced:e};let c=Oae(o,t.slice(0,-1));if(!c)return{ok:!1,error:{kind:`unknown_key`,key:a}};let l=c.items.find(e=>o9(e)&&s9(e)===a);if(!l)return{ok:!1,error:{kind:`unknown_key`,key:a}};if(!r.allowDuplicate&&c.items.some(e=>o9(e)&&e!==l&&s9(e)===n))return{ok:!1,error:{kind:`duplicate_target`,key:n}};try{return c9(l,n),d9(o)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function Aae(e,t,n){if(t.length===0)return f9(e,n);let r=m9(t);if(r)return{ok:!1,error:r};let{doc:i,map:a}=r9(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let o=i.getIn(t,!0);if(!Ss(o))return{ok:!1,error:{kind:`invalid_path`,path:[...t],reason:`cannot reorder: target is not a map`}};let s=[];for(let e of o.items){if(!o9(e))continue;let t=s9(e);t!==null&&s.push(t)}if(s.length!==n.length||!p9(s,n))return{ok:!1,error:{kind:`reorder_mismatch`,expected:s,got:[...n]}};try{let e=o.items.filter(o9),t=[];for(let r of n){let i=e.findIndex(e=>s9(e)===r);if(i===-1)return{ok:!1,error:{kind:`reorder_mismatch`,expected:s,got:[...n]}};let[a]=e.splice(i,1);a&&t.push(a)}return o.items=t,d9(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function jae(e,t,n){let r=m9(t);if(r)return{ok:!1,error:r};let{doc:i,map:a}=r9(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let o=i.getIn(t,!0);if(!Ts(o))return{ok:!1,error:{kind:`invalid_path`,path:[...t],reason:`cannot reorder: target is not a sequence`}};let s=o,c=s.items.length,l=Array.from({length:c},(e,t)=>t),u=[...n];if(!Mae(u,c))return{ok:!1,error:{kind:`reorder_mismatch`,expected:l.map(String),got:u.map(String)}};try{let e=s.items.slice();return s.items=u.map(t=>e[t]),d9(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function Mae(e,t){if(e.length!==t)return!1;let n=Array(t).fill(!1);for(let r of e){if(!Number.isInteger(r)||r<0||r>=t||n[r])return!1;n[r]=!0}return!0}var Nae=Object.freeze({source:`local`,skipStoreHooks:!1,context:Object.freeze({origin:`form-write`})});function h9(e){return{ok:!1,error:e}}function Pae(e){return{ok:!0,...e}}function Fae(e){return{ok:!0,...e}}function Iae(e){return{ok:!0,...e}}function g9(e){return{ok:!0,...e}}function _9(e){switch(e.kind){case`unknown_key`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:`unknown key '${e.key}'`,issueCode:`unknown_key`}]};case`duplicate_target`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:`key '${e.key}' already exists`,issueCode:`duplicate_target`}]};case`invalid_value`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:e.reason,issueCode:`invalid_value`}]};case`reserved_key`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:`'${e.key}' is a reserved frontmatter key`,issueCode:`reserved_key`}]};case`reorder_mismatch`:return{code:`WRITE_ERROR`,detail:`reorder list does not match current keys (state changed mid-drag)`};case`region_too_large`:return{code:`SCHEMA_INVALID`,issues:[{path:[],message:`Frontmatter region exceeds ${t9}-byte limit (would be ${e.bytes})`,issueCode:`region_too_large`}]};case`parse_failed`:return{code:`WRITE_ERROR`,detail:`Frontmatter YAML is malformed; fix in source mode to commit (${e.reason})`};case`invalid_path`:return{code:`SCHEMA_INVALID`,issues:[{path:[...e.path],message:e.reason,issueCode:`invalid_path`}]}}}function Lae(e,t){if(e.parseError!==t.parseError||e.keys.length!==t.keys.length)return!1;for(let n=0;n<e.keys.length;n++)if(e.keys[n]!==t.keys[n])return!1;for(let n of e.keys)if(!R7(e.map[n],t.map[n]))return!1;return!0}var Rae=5;function v9(e){let t=e.toString();return{snapshot:zae(t),raw:t}}function zae(e){let{map:t,parseError:n}=i9(e);return{map:t,keys:a9(e),parseError:n}}function y9(e){return e.startsWith(`---`)}function Bae(e){let t=e.document,n=t.getText(`source`),r=new Set,i=v9(n),a=i.snapshot,o=n9(i.raw).fenced,s=y9(i.raw),c=!1;function l(e=!1){if(c)return;let t,i;try{let e=v9(n);t=e.snapshot,i=e.raw}catch(e){console.warn(`[bindFrontmatterDoc] readSnapshotFromYText threw:`,e);return}if(!e&&Lae(a,t)){s=y9(i);return}a=t,o=n9(i).fenced,s=y9(i);for(let e of r)try{e(t)}catch(e){console.warn(`[bindFrontmatterDoc] listener threw:`,e)}}let u=e=>{c||Vae(e,o.length,s)&&l()};n.observe(u),e.on(`synced`,d);function d(){l(!0)}function f(e){let r;return t.transact(()=>{let{fenced:t}=n9(n.toString());r=e(t),r.ok&&r.nextFenced!==t&&(n.delete(0,t.length),r.nextFenced!==``&&n.insert(0,r.nextFenced))},Nae),r??{ok:!1,error:{kind:`parse_failed`,reason:`commit transact produced no result`}}}function p(e){if(c)return h9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});if(Object.hasOwn(e,`frontmatter`))return h9({code:`SCHEMA_INVALID`,issues:[{path:[M7],message:`'${M7}' is a reserved frontmatter key`,issueCode:`reserved_key`}]});let t=Hre.safeParse(e);if(!t.success)return h9({code:`SCHEMA_INVALID`,issues:t.error.issues.map(hae)});let n=t.data,r=Object.keys(n),i=f(e=>wae(e,n));return i.ok?Pae({appliedKeys:r}):h9(_9(i.error))}function m(e,t,n={}){if(c)return h9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let r=f(r=>Tae(r,e,t,n));return r.ok?Fae({oldKey:e,newKey:t}):h9(_9(r.error))}function h(e){if(c)return h9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let t=f(t=>f9(t,e));return t.ok?Iae({orderedKeys:[...e]}):h9(_9(t.error))}function g(e,t){if(c)return h9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let n=f(n=>Eae(n,e,t));return n.ok?g9({path:[...e]}):h9(_9(n.error))}function _(e){if(c)return h9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let t=f(t=>Dae(t,e));return t.ok?g9({path:[...e]}):h9(_9(t.error))}function v(e,t,n={}){if(c)return h9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let r=f(r=>kae(r,e,t,n));return r.ok?g9({path:[...e]}):h9(_9(r.error))}function y(e,t){if(c)return h9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let n=f(n=>Aae(n,e,t));return n.ok?g9({path:[...e]}):h9(_9(n.error))}function b(e,t){if(c)return h9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let n=f(n=>jae(n,e,t));return n.ok?g9({path:[...e]}):h9(_9(n.error))}return{current(){return v9(n).snapshot},patch(e){return p(e)},rename(e,t,n){return m(e,t,n)},reorder(e){return h(e)},patchPath(e,t){return g(e,t)},deletePath(e){return _(e)},renamePath(e,t,n){return v(e,t,n)},reorderPath(e,t){return y(e,t)},reorderSeqPath(e,t){return b(e,t)},subscribe(e){return r.add(e),()=>{r.delete(e)}},dispose(){c||(c=!0,n.unobserve(u),e.off(`synced`,d),r.clear())}}}function Vae(e,t,n){if(t===0&&n)return!0;let r=t>0?t:Rae,i=0;for(let t of e.delta){if(typeof t.retain==`number`){i+=t.retain;continue}if(typeof t.insert==`string`){if(i<r)return!0;i+=t.insert.length;continue}if(t.insert!==void 0){if(i<r)return!0;i+=1;continue}if(typeof t.delete==`number`&&i<r)return!0}return!1}var Hae=new DY.default;Hae.Match_Threshold=.5;var Uae=/\\([!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~])/g,b9=/^\s*\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)+\|?\s*$/,x9=/^[ \t]+([-+*]|\d+[.)]|[a-zA-Z][.)])\s/,Wae=/^\d+([.)])(?=\s)/,Gae=`1`,Kae=/\*\*\s*(`[^`]+`)\s*\*\*/g,qae=/^(`{3,}|~{3,})/;function Jae(e){let t=new Set,n=null;for(let r=0;r<e.length;r++){let i=e[r].trimEnd(),a=qae.exec(i);if(a){let e=a[1][0];if(n===null){n=e;continue}if(n===e){n=null;continue}}if(n!==null||r===0||!b9.test(i))continue;let o=e[r-1].trimEnd();if(!(!o.startsWith(`|`)||b9.test(o))){t.add(r-1),t.add(r);for(let n=r+1;n<e.length&&e[n].trimEnd().startsWith(`|`);n++)t.add(n)}}return t}function S9(e){return e.slice(0,-1).trimEnd()}var C9=/^(?:#{1,6}[ \t]|>|(?:[-+*]|\d{1,9}[.)])[ \t]|`{3,}|~{3,}|=+[ \t]*$|-+[ \t]*$|(?:\*[ \t]*){3,}$|(?:_[ \t]*){3,}$)/;function w9(e){let t=new Set,n=null;for(let r=0;r<e.length;r++){let i=e[r]??``,a=/^(`{3,}|~{3,})/.exec(i.trimStart());if(a?.[1]){let e=a[1][0];if(n===null){n=e;continue}if(n===e){n=null;continue}}n!==null&&t.add(r)}return t}var Yae=/^<\/?[A-Z][A-Za-z0-9.]*(?:\s[^>]*)?>$/,Xae=/^<[A-Z][A-Za-z0-9.]*(?:\s[^>]*)?>$/,Zae=/^<\/[A-Z][A-Za-z0-9.]*\s*>$/,Qae=/<\/?[A-Z]/;function $ae(e){let t=!1;for(let n=0;n<e.length;n++)if(Qae.test(e[n]??``)){t=!0;break}if(!t)return e;let n=w9(e),r=[],i=[],a=0;for(let t=0;t<e.length;t++){let o=e[t]??``,s=o.trim();if(n.has(t)){r.push(!1),i.push(a);continue}let c=a>=1||!/^[ \t]/.test(o);r.push(c&&Yae.test(s));let l=c&&Zae.test(s),u=c&&!l&&Xae.test(s)&&!s.endsWith(`/>`);l?(a=Math.max(0,a-1),i.push(a)):(i.push(a),u&&(a+=1))}let o=Array(e.length);for(let t=0,n=-1;t<e.length;t++)o[t]=n,(e[t]??``).trim()!==``&&(n=t);let s=Array(e.length);for(let t=e.length-1,n=e.length;t>=0;t--)s[t]=n,(e[t]??``).trim()!==``&&(n=t);let c=new Set;for(let t=0;t<e.length;t++){if((e[t]??``).trim()!==``||n.has(t)||(i[t]??0)<1)continue;let a=o[t]??-1,l=s[t]??e.length;(a>=0&&r[a]===!0||l<e.length&&r[l]===!0)&&c.add(t)}let l=[];for(let t=0;t<e.length;t++){if(c.has(t))continue;let n=e[t]??``;l.push(r[t]===!0&&(i[t]??0)>=1?n.replace(/^[ \t]+/,``):n)}return l}function eoe(e){let t=$ae(e.replace(/^/,``).replace(/\r/g,``).replace(Uae,`$1`).replace(Kae,`$1`).replace(/^\n+/,``).replace(/^[*-]{3,}(?=\n|$)/,`---`).replace(/(\n)([#>+-]|\d+[.)]|`{3,}|~{3,})/g,`
560
562
 
561
563
  $2`).replace(/^([#>+-].*|\d+[.)].*|`{3,}.*|~{3,}.*|<\/[A-Z][A-Za-z0-9]*>[ \t]*)\n([^\n])/gm,`$1
562
564
 
563
565
  $2`).split(`
564
- `)),n=Kae(t),r=w9(t);return t.map((e,i)=>{let a=e.trimEnd();if(i>0&&!r.has(i)&&/^[ \t]+\S/.test(a)&&(t[i-1]??``).trim()!==``&&!x9.test(a)&&!C9.test(a.trimStart())){let e=(t[i-1]??``).trimStart();if(!C9.test(e)&&!e.startsWith(`|`))return a.replace(/^[ \t]+/,``)}if(b9.test(a)){let e=a.replace(/\s+/g,``);return n.has(i)&&e.length>1&&e.startsWith(`|`)&&e.endsWith(`|`)?S9(e):e}let o=x9.test(a)?a.replace(/^[ \t]+/,``):a;return n.has(i)&&o.length>1&&o.startsWith(`|`)&&o.endsWith(`|`)&&(o=S9(o)),o.replace(Hae,`${Uae}$1`)}).join(`
566
+ `)),n=Jae(t),r=w9(t);return t.map((e,i)=>{let a=e.trimEnd();if(i>0&&!r.has(i)&&/^[ \t]+\S/.test(a)&&(t[i-1]??``).trim()!==``&&!x9.test(a)&&!C9.test(a.trimStart())){let e=(t[i-1]??``).trimStart();if(!C9.test(e)&&!e.startsWith(`|`))return a.replace(/^[ \t]+/,``)}if(b9.test(a)){let e=a.replace(/\s+/g,``);return n.has(i)&&e.length>1&&e.startsWith(`|`)&&e.endsWith(`|`)?S9(e):e}let o=x9.test(a)?a.replace(/^[ \t]+/,``):a;return n.has(i)&&o.length>1&&o.startsWith(`|`)&&o.endsWith(`|`)&&(o=S9(o)),o.replace(Wae,`${Gae}$1`)}).join(`
565
567
  `).replace(/\n{3,}/g,`
566
568
 
567
- `).replace(/\n+$/,``)}function T9(e){return[...e.replace(/^\n+/,``).replace(/\n+$/,``).matchAll(/\n{2,}/g)].map(e=>e[0].length)}function $ae(e,t){let n=T9(e),r=T9(t);return n.length===r.length?r.some((e,t)=>e>(n[t]??0)):!1}var E9=/^[a-zA-Z0-9][\w/-]*$/;function eoe(e){if(typeof e!=`string`)return!1;let t=e.startsWith(`#`)?e.slice(1):e;return E9.test(t)}var toe=`Tags must start with a letter or digit and contain only letters, digits, underscores, dashes, and slashes.`;function noe(e){return e.startsWith(`#`)?e.slice(1):e}function roe(e){return typeof e==`string`?[e]:Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function ioe(e){if(!e||e.trim()===``)return[];let{map:t}=gae(e);if(!t)return[];let n=roe(t.tags),r=[];for(let e of n){let t=noe(e);E9.test(t)&&r.push(t)}return r}var aoe=z(vX),ooe=Eo({hosts:L(P()),scope:aoe,scripts:I(),installedAt:ba()});Eo({schema:B(1),skills:Po(P(),ooe).default({})});var soe=100,coe=500,loe=450,uoe={id:`string`,kind:`enum`,path:`string`,title:`string`,name:`string`,pathSegments:`string`,content:`string`,modifiedTs:`number`},D9=new WeakMap;function doe(e){return e===void 0||!Number.isFinite(e)?20:Math.max(1,Math.min(100,Math.trunc(e)))}function O9(e){return e.trim().toLowerCase()}var foe=/\.(?:md|mdx)$/;function poe(e,t){if(t!==`page`)return e;let n=e.replace(foe,``);return n.length>0?n:e}function k9(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function moe(e){let t=k9(e.path),n=e.title?.trim()||t,r=e.modifiedTs??0,i=e.path.split(`/`).filter(Boolean),a=new Set(i),o=[...new Set((e.aliases??[]).flatMap(e=>e.split(`/`).filter(Boolean)).filter(e=>!a.has(e)))];return{id:`${e.kind}:${e.path}`,kind:e.kind,path:e.path,title:n,name:t,pathSegments:[...i,...o].join(` `),content:e.content??``,modifiedTs:Number.isFinite(r)?r:0}}function A9(e){let t=RJ({schema:uoe});return e.length>0&&YJ(t,e),t}function hoe(e){let t={documents:e};return D9.set(t,A9(e)),t}function goe(e){let t=D9.get(e);if(t)return t;let n=A9(e.documents);return D9.set(e,n),n}function _oe(e){return e===`autocomplete`?[`page`]:e===`full_text`?[`page`,`content`,`file`]:[`page`,`folder`,`file`]}function j9(e,t){return t.has(e.kind)?!0:e.kind===`page`&&t.has(`content`)}function voe(e,t){let n=O9(t);if(!n)return 0;let r=poe(n,e.kind),i=O9(e.title),a=O9(e.name),o=O9(e.path),s=o.split(`/`);return i===r||a===r?700:o===r?650:i.startsWith(r)||a.startsWith(r)?600:s.some(e=>e.startsWith(r))?550:i.includes(r)||a.includes(r)?500:o.includes(r)?450:-1}var yoe=.5;function M9(e,t){let n=voe(e,t);return n<=0?n:V$(e.path)?n*yoe:n}var boe=60;function xoe(e){return e===`file`?-boe:0}var Soe=1e3,N9=50,Coe=1,woe=1,Toe=.001;function Eoe(e,t,n,r,i){let a=i>0?t/i:0,o=N9>0?n/N9:0,s=r===`file`?-Toe:0,c=Coe*a+woe*o+s;return e*Soe+c}function P9(e,t,n,r){return e+t*20+n+xoe(r)}function F9(e,t,n,r,i,a){return e===`relevance`?P9(t,n,r,i):Eoe(t,n,r,i,a)}function Doe(e,t){return t||(e===`full_text`?`relevance`:`navigation`)}function I9(e,t){let n=0;for(let r of e){let e=t.get(r.id)??0;e>n&&(n=e)}return n}function Ooe(e){let t=e.map(e=>e.modifiedTs).filter(e=>Number.isFinite(e)&&e>0);if(t.length===0)return new Map;let n=1/0,r=-1/0;for(let e of t)e<n&&(n=e),e>r&&(r=e);let i=Math.max(1,r-n);return new Map(e.map(e=>[e.id,e.modifiedTs>0?(e.modifiedTs-n)/i*50:0]))}function koe(e){return e===`full_text`?[`title`,`name`,`path`,`pathSegments`,`content`]:[`title`,`name`,`path`,`pathSegments`]}function Aoe(e){return e===`full_text`?{title:8,name:7,path:5,pathSegments:4,content:1}:e===`autocomplete`?{title:10,name:9,path:5,pathSegments:4}:{title:8,name:7,path:5,pathSegments:4}}function joe(e,t){return O9(t).length<4?0:+(e===`full_text`)}function Moe(e){let{lexical:t,fullText:n}=e.signals;return t>=coe?`lexical`:t===loe&&n<=0?`pathOnly`:`body`}function Noe(e){let t=[],n=[],r=[];for(let i of e){let e=Moe(i);e===`lexical`?t.length<soe&&t.push(i):e===`body`?n.length<6&&n.push(i):r.length<4&&r.push(i)}return[...t,...n,...r]}function L9(e,t,n){if(t===`relevance`)return e.slice(0,n);let r=Noe(e),i=[],a=0,o=0;for(let e of r){if(e.document.kind===`folder`){if(a>=3)continue;a+=1}else if(e.document.kind===`file`){if(o>=3)continue;o+=1}if(i.push(e),i.length>=n)break}return i}function Poe(e,t,n={}){let r=n.intent??`omnibar`,i=Doe(r,n.ranking),a=doe(n.limit),o=new Set(n.scopes??_oe(r)),s=e.documents.filter(e=>j9(e,o)),c=O9(t);if(!c)return s.slice().sort((e,t)=>e.path.localeCompare(t.path)).slice(0,a).map(e=>({document:e,score:0,signals:{lexical:0,fullText:0,recency:0}}));let l=TY(goe(e),{term:c,properties:koe(r),boost:Aoe(r),tolerance:joe(r,c),limit:Math.max(a*4,40)}),u=new Map(l.hits.filter(e=>j9(e.document,o)).map(e=>[e.document.id,e.score])),d=Ooe(s),f=new Map;for(let e of s)M9(e,c)>=0&&f.set(e.id,e);for(let e of l.hits)j9(e.document,o)&&f.set(e.document.id,e.document);if(!n.semantic){let e=I9(f.values(),u);return L9([...f.values()].map(t=>{let n=Math.max(0,M9(t,c)),r=u.get(t.id)??0,a=d.get(t.id)??0;return{document:t,score:F9(i,n,r,a,t.kind,e),signals:{lexical:n,fullText:r,recency:a}}}).sort((e,t)=>e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score),i,a)}return L9(Foe({scopedDocuments:s,candidates:f,fullTextScores:u,recency:d,normalizedQuery:c,ranking:i,semantic:n.semantic}),i,a)}function R9(e){let t=new Map;return e.forEach((e,n)=>{t.set(e,n+1)}),t}function Foe(e){let{scopedDocuments:t,candidates:n,fullTextScores:r,recency:i,normalizedQuery:a,ranking:o,semantic:s}=e,c=s.rrfK??60,l=s.candidateLimit??64,u=s.similarityFloor??0,d=s.scores,f=new Map(t.map(e=>[e.id,e])),p=[...d.entries()].filter(([e,t])=>t>=u&&f.has(e)).sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])).slice(0,l);for(let[e]of p)if(!n.has(e)){let t=f.get(e);t&&n.set(e,t)}let m=I9(n.values(),r),h=[...n.values()].map(e=>{let t=Math.max(0,M9(e,a)),n=r.get(e.id)??0,s=i.get(e.id)??0,c=d.get(e.id),l=c!==void 0&&c>=u;return{document:e,score:t>0?F9(o,t,n,s,e.kind,m):P9(t,n,s,e.kind),signals:l?{lexical:t,fullText:n,recency:s,vector:c}:{lexical:t,fullText:n,recency:s},lexical:t,fullText:n,recency:s,cosine:c}}),g=R9(h.filter(e=>e.fullText>0).sort((e,t)=>t.fullText-e.fullText||e.document.path.localeCompare(t.document.path)).map(e=>e.document.id)),_=R9(h.filter(e=>e.cosine!==void 0&&e.cosine>=u).sort((e,t)=>t.cosine-e.cosine||e.document.path.localeCompare(t.document.path)).map(e=>e.document.id)),v=e=>{let t=0,n=g.get(e);n!==void 0&&(t+=1/(c+n));let r=_.get(e);return r!==void 0&&(t+=1/(c+r)),t};return h.sort((e,t)=>{let n=+(e.lexical>0),r=+(t.lexical>0);if(n!==r)return r-n;if(n===1)return e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score;let i=v(e.document.id),a=v(t.document.id);return i===a?e.recency===t.recency?e.document.path.localeCompare(t.document.path):t.recency-e.recency:a-i}).map(({document:e,score:t,signals:n})=>({document:e,score:t,signals:n}))}function Ioe(e){return`https://${e.host}/${e.owner}/${e.repo}.git`}function Loe(e,t){return!e||e.length===0?`true`:t.detached?`detached`:t.currentBranch===null||t.currentBranch===e?`true`:`false`}var z9=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),B9=globalThis;B9[z9]===void 0&&(B9[z9]=si());var V9=B9[z9],H9=Eo({version:P().regex(/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(V9,{description:`Recorded skill version for this target.`}),recordedAt:ba().register(V9,{description:`ISO 8601 timestamp of the most recent successful write. Updated on every write, including reinstalls of the same version.`}),surface:z([`server-build-and-open`,`electron-build-and-open`,`cli-npx-skills-add`,`desktop-direct`,`cli-start`]).register(V9,{description:`Install-source surface that recorded this entry.`}).optional()}),Roe=Eo({enabled:I().register(V9,{description:`Whether this user-global skill bundle is opted in.`}),decidedAt:ba().register(V9,{description:`ISO 8601 timestamp of the opt-in / opt-out decision.`})});Eo({schema:B(1).register(V9,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:Eo({"claude-cowork":H9.optional(),"cli-hosts":H9.optional()}).register(V9,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({}),bundles:Po(P(),Roe).register(V9,{description:`Per-bundle opt-in decisions keyed by install name. Absent key = no recorded decision.`}).optional()});var zoe=new Set([`(connected)`,`(agent thread)`]);function Boe(e){return e!=null&&zoe.has(e)}var U9=class extends Error{chunksCompleted;totalChunks;bytesWritten;bytesRemaining;cause;constructor(e,t){let n=e instanceof Error?e.message:typeof e==`string`?e:`unknown error`;super(`chunked insert failed after ${t.chunksCompleted}/${t.totalChunks} chunks (${t.bytesWritten} bytes written, ${t.bytesRemaining} bytes lost): ${n}`),this.name=`ChunkedInsertError`,this.chunksCompleted=t.chunksCompleted,this.totalChunks=t.totalChunks,this.bytesWritten=t.bytesWritten,this.bytesRemaining=t.bytesRemaining,this.cause=e}};async function Voe(e,t,n,r,i={}){let a=i.thresholdBytes??512e3,o=i.chunkSizeBytes??51200,s=i.origin,c=i.yieldFn??Hoe,l=i.resolveOffset??(e=>e);if(r.length<=a){e.transact(()=>{t.insert(n,r)},s);return}let u=Math.ceil(r.length/o),d=0,f=n,p=0,m=0;for(;d<r.length;){let n=Math.min(d+o,r.length),i=r.slice(d,n);try{let n=l(f);e.transact(()=>{t.insert(n,i)},s)}catch(e){throw new U9(e,{chunksCompleted:p,totalChunks:u,bytesWritten:m,bytesRemaining:r.length-d})}p++,m+=i.length,f+=i.length,d=n,d<r.length&&await c()}}function Hoe(){return new Promise(e=>{let t=globalThis;t.document?.hidden!==!0&&typeof t.requestAnimationFrame==`function`?t.requestAnimationFrame(()=>e()):setTimeout(()=>e(),0)})}function Uoe(){let e=!1,t=``,n=0;return r=>{let i=Woe(r);return e?(i&&i.char===t&&i.len>=n&&!i.hasInfo&&(e=!1,t=``,n=0),!0):i?(e=!0,t=i.char,n=i.len,!0):!1}}function Woe(e){let t=(e.endsWith(`\r`)?e.slice(0,-1):e).match(/^ {0,3}([`~])(\1{2,})(.*)$/);return t?{char:t[1],len:1+t[2].length,hasInfo:t[3].trim()!==``}:null}var Goe=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],Koe={claude:`#D97757`,cursor:`#1B1912`,windsurf:`#0B100F`,openai:`#7A9DFF`,github:`#8534F3`,cline:`#9663F0`,bot:`#727CF3`},qoe={cursor:`#FFFFFF`,windsurf:`#FFFFFF`},W9=[`#f0ece3`,`#fff5e1`,`#f9e1db`,`#f5def7`,`#ece2fb`,`#dce8fa`,`#DBF3FB`];function Joe(e,t=Goe){let n=0;for(let t of e)n=(n<<5)-n+t.charCodeAt(0)|0;return t[Math.abs(n)%t.length]}function Yoe(e){let t=e.trim();if(!t)return`?`;let n=t.split(/[-\s]+/).filter(Boolean);if(!n.length)return`?`;if(n.length>=2)return n.slice(0,2).map(e=>e[0]??``).join(``).toUpperCase();let r=n[0],i=[r[0]];for(let e=1;e<r.length&&i.length<2;e++){let t=r[e-1],n=r[e];t===t.toLowerCase()&&n===n.toUpperCase()&&n!==n.toLowerCase()&&i.push(n)}return i.length>=2?i.join(``).toUpperCase():r.slice(0,2).toUpperCase()}function Xoe(e){let t=e.trim();if(!t)return e;if(t.includes(` `)||!/[-_]/.test(t))return t;let n=t.split(/[-_]+/).filter(Boolean);return n.length?n.map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(` `):t}var Zoe={"claude-code":`claude`,"claude-ai":`claude`,cursor:`cursor`,"cursor-vscode":`cursor`,cascade:`windsurf`,codex:`openai`,"codex-mcp-client":`openai`,copilot:`github`,cline:`cline`};function Qoe(e){return e?Zoe[e]||(e.startsWith(`local-agent-mode-`)?`claude`:`bot`):`bot`}function $oe(e){let t=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,r=parseInt(e.slice(5,7),16)/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2;if(i===a)return[0,0,o*100];let s=i-a,c=o>.5?s/(2-i-a):s/(i+a),l;return l=i===t?((n-r)/s+(n<r?6:0))/6:i===n?((r-t)/s+2)/6:((t-n)/s+4)/6,[l*360,c*100,o*100]}function ese(e,t,n){let r=t/100,i=n/100,a=r*Math.min(i,1-i),o=t=>{let n=(t+e/30)%12,r=i-a*Math.max(Math.min(n-3,9-n,1),-1);return Math.round(255*r).toString(16).padStart(2,`0`)};return`#${o(0)}${o(8)}${o(4)}`}function tse(e){let[t]=$oe(e);return ese(t,45,32)}var nse=[`Curious`,`Brave`,`Clever`,`Swift`,`Gentle`,`Bright`,`Wise`,`Bold`,`Calm`,`Keen`],rse=[`Bird`,`Cat`,`Dog`,`Fish`,`Mouse`,`Rabbit`,`Shrimp`,`Snail`,`Squirrel`,`Turtle`],G9=`ok-user-name-v3`,K9=`ok-user-color-v3`;function q9(e){return e[Math.floor(Math.random()*e.length)]}function ise(){return`${q9(nse)} ${q9(rse)}`}function ase(){return q9(W9)}function J9(e){try{return localStorage.getItem(e)}catch{return null}}function Y9(e,t){try{localStorage.setItem(e,t)}catch{}}function ose(){let e=new URLSearchParams(window.location.search).get(`coeditor`)||`standalone`,t=crypto.randomUUID(),n=J9(G9),r=J9(K9);return n||(n=ise(),Y9(G9,n)),r||(r=ase(),Y9(K9,r)),{name:n,color:r,coeditor:e,tabId:t}}function sse(e,t){let n=e.trim();if(!n||/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n)||n.startsWith(`//`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=r>=0?n.slice(0,r):n,a=r>=0?n.slice(r+1):null,o=(i.split(`?`)[0]??``).trim();if(!o)return null;let s=(o.split(`/`).pop()??``).match(/\.([a-z0-9]+)$/i);if(s){let e=(s[1]??``).toLowerCase();if(e!==`md`&&e!==`mdx`)return null}let c=o.toLowerCase(),l=c.endsWith(`.mdx`)?o.slice(0,-4):c.endsWith(`.md`)?o.slice(0,-3):o,u=l.startsWith(`/`),d=u?l.slice(1):l,f=u?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of d.split(`/`))if(e===`..`){if(f.length===0)return null;f.pop()}else e!==`.`&&e!==``&&f.push(e);return f.length===0?null:{docName:f.join(`/`),anchor:a||null}}function cse(e){throw Error(`Unhandled ClassifiedLinkTarget variant: ${JSON.stringify(e)}`)}var X9=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function Z9(e){let t=(e.split(/[?#]/)[0]??e).match(/\.([a-z0-9]+)$/i);return t?(t[1]??``).toLowerCase():null}function Q9(e){return e.split(`/`).filter(Boolean)}function $9(e){let t=e.trim();return X9.test(t)||t.startsWith(`//`)}function lse(e,t){let n=e.trim();if(!n)return null;if(n.startsWith(`#`)){let e=n.slice(1).trim();return e?{kind:`anchor`,anchor:e}:null}if($9(n))return{kind:`external`,url:n};let r=sse(n,t);if(r)return{kind:`doc`,docName:r.docName,anchor:r.anchor};let i=Z9(n);return i&&i!==`md`&&i!==`mdx`?{kind:`asset`,url:n,ext:i}:null}function use(e,t){let n=e.trim();if(!n)return null;if($9(n))return{kind:`external`,url:t?`${n}#${t}`:n};let r=Z9(n);return r&&r!==`md`&&r!==`mdx`?{kind:`asset`,url:n,ext:r}:{kind:`doc`,docName:n,anchor:t?.trim()||null}}function dse(e,t){let n=e.trim();if(!n||X9.test(n)||n.startsWith(`//`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=((r>=0?n.slice(0,r):n).split(`?`)[0]??``).trim();if(!i)return null;let a=i.startsWith(`/`),o=a?i.slice(1):i,s=a?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of o.split(`/`))if(e===`..`){if(s.length===0)return null;s.pop()}else e!==`.`&&e!==``&&s.push(e);return s.length===0?null:s.join(`/`)}function fse(e,t,n=null,r=`.md`){let i=Q9(e);i.pop();let a=Q9(t),o=0;for(;o<i.length&&o<a.length&&i[o]===a[o];)o+=1;let s=i.slice(o).map(()=>`..`),c=a.slice(o),l=[...s,...c].join(`/`);return l||=a.at(-1)??t,!l.startsWith(`./`)&&!l.startsWith(`../`)&&(l=`./${l}`),`${l}${r}${n?`#${n}`:``}`}function pse(e){return e.replace(/[/\\:*?"<>|\0]/g,`-`).replace(/\s+/g,` `).replace(/-+/g,`-`).trim().replace(/^[-.\s]+|[-.\s]+$/g,``)}export{cie as $,z as $a,tx as $i,y0 as $n,Poe as $r,L$ as $t,jie as A,xd as Aa,HC as Ai,Uoe as An,Fre as Ar,dX as At,toe as B,ld as Ba,$S as Bi,Z9 as Bn,EX as Br,IQ as Bt,jX as C,Tf as Ca,LD as Ci,$Q as Cn,Boe as Cr,lre as Ct,Cie as D,Od as Da,fO as Di,XQ as Dn,o2 as Dr,xZ as Dt,wie as E,bf as Ea,WD as Ei,QQ as En,eoe as Er,yZ as Et,Tie as F,gd as Fa,yS as Fi,UX as Fn,Qae as Fr,i1 as Ft,h0 as G,ad as Ga,pC as Gi,Q5 as Gn,uZ as Gr,ZX as Gt,$re as H,Wf as Ha,WS as Hi,mae as Hn,HY as Hr,dQ as Ht,LX as I,uf as Ia,Ow as Ii,dre as In,O5 as Ir,J7 as It,gZ as J,fd as Ja,kx as Ji,uae as Jn,i9 as Jr,rre as Jt,uie as K,cd as Ka,kw as Ki,Xoe as Kn,xX as Kr,XX as Kt,VX as L,ud as La,xS as Li,WY as Ln,gQ as Lr,Kie as Lt,G7 as M,Sd as Ma,Uw as Mi,hoe as Mn,b0 as Mr,X$ as Mt,Jre as N,Ad as Na,Ww as Ni,moe as Nn,iX as Nr,t1 as Nt,Jne as O,qd as Oa,bw as Oi,YQ as On,fre as Or,bX as Ot,qre as P,Sf as Pa,Vw as Pi,tse as Pn,rZ as Pr,e1 as Pt,nie as Q,lf as Qa,Cw as Qi,uX as Qn,RY as Qr,$ae as Qt,cX as R,tf as Ra,SS as Ri,lX as Rn,CX as Rr,Gie as Rt,pX as S,wd as Sa,nO as Si,ZQ as Sn,GX as Sr,M7 as St,QX as T,yf as Ta,xO as Ti,w$ as Tn,SZ as Tr,Aie as Tt,tre as U,Wd as Ua,KS as Ui,aZ as Un,_Q as Ur,Hie as Ut,E9 as V,qf as Va,FS as Vi,ioe as Vn,dae as Vr,LQ as Vt,W9 as W,od as Wa,qS as Wi,cre as Wn,d2 as Wr,Mie as Wt,NX as X,Af as Xa,hC as Xi,ose as Xn,cae as Xr,SQ as Xt,_Z as Y,Cf as Ya,PS as Yi,_re as Yn,dse as Yr,yQ as Yt,DZ as Z,pd as Za,Bw as Zi,vQ as Zn,pse as Zr,oie as Zt,jY as _,U as _a,k9 as _i,iZ as _n,Vre as _r,Eie as _t,vie as a,Qh as aa,zQ as ai,RQ as an,R as ao,e4 as ar,_7 as at,fX as b,Xf as ba,IA as bi,t$ as bn,yX as br,BY as bt,Xre as c,Nh as ca,Cne as ci,fse as cn,Mt as co,Y2 as cr,qQ as ct,aae as d,Am as da,y7 as di,Voe as dn,Q2 as dr,WX as dt,ab as ea,s7 as ei,cse as en,ds as eo,Qoe as er,$ne as et,rae as f,Im as fa,UY as fi,Loe as fn,zre as fr,lie as ft,kX as g,fm as ga,KQ as gi,PY as gn,ore as gr,Oie as gt,AX as h,jh as ha,b7 as hi,NY as hn,$9 as hr,zX as ht,_ie as i,q as ia,wX as ii,TQ as in,B as io,J2 as ir,vX as it,$7 as j,of as ja,fC as ji,V2 as jn,Mre as jr,u1 as jt,PX as k,Td as ka,aw as ki,Yoe as kn,OX as kr,Uie as kt,nae as l,K as la,hZ as li,BQ as ln,Tt as lo,K2 as lr,JQ as lt,tae as m,zm as ma,g1 as mi,use as mn,FX as mr,YX as mt,qoe as n,Hb as na,CQ as ni,Rae as nn,I as no,n4 as nr,mie as nt,FY as o,tg as oa,lZ as oi,EQ as on,P as oo,X2 as or,dne as ot,iae as p,Bm as pa,dZ as pi,lse as pn,EZ as pr,JX as pt,n8 as q,Gd as qa,Qx as qi,R7 as qn,a9 as qr,m1 as qt,IX as r,Rh as ra,kQ as ri,rX as rn,qa as ro,q2 as rr,_X as rt,Zre as s,G as sa,wQ as si,OQ as sn,At as so,$2 as sr,LZ as st,Koe as t,cb as ta,h1 as ti,ZY as tn,L as to,t4 as tr,ire as tt,oae as u,Fm as ua,Zne as ui,Ioe as un,Z2 as ur,qX as ut,GY as v,xp as va,Ite as vi,Joe as vn,V$ as vr,d1 as vt,U9 as w,kd as wa,hO as wi,R$ as wn,CZ as wr,RZ as wt,mX as x,_d as xa,FA as xi,e$ as xn,Xne as xr,zY as xt,hX as y,W as ya,NA as yi,E$ as yn,i2 as yr,p1 as yt,cZ as z,pf as za,QS as zi,bQ as zn,r2 as zr,Wie as zt};
569
+ `).replace(/\n+$/,``)}function T9(e){return[...e.replace(/^\n+/,``).replace(/\n+$/,``).matchAll(/\n{2,}/g)].map(e=>e[0].length)}function toe(e,t){let n=T9(e),r=T9(t);return n.length===r.length?r.some((e,t)=>e>(n[t]??0)):!1}var E9=/^[a-zA-Z0-9][\w/-]*$/;function noe(e){if(typeof e!=`string`)return!1;let t=e.startsWith(`#`)?e.slice(1):e;return E9.test(t)}var roe=`Tags must start with a letter or digit and contain only letters, digits, underscores, dashes, and slashes.`;function ioe(e){return e.startsWith(`#`)?e.slice(1):e}function aoe(e){return typeof e==`string`?[e]:Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function ooe(e){if(!e||e.trim()===``)return[];let{map:t}=vae(e);if(!t)return[];let n=aoe(t.tags),r=[];for(let e of n){let t=ioe(e);E9.test(t)&&r.push(t)}return r}var soe=z(_X),coe=Eo({hosts:L(P()),scope:soe,scripts:I(),installedAt:ba()});Eo({schema:B(1),skills:Po(P(),coe).default({})});var loe=100,uoe=500,doe=450,foe={id:`string`,kind:`enum`,path:`string`,title:`string`,name:`string`,pathSegments:`string`,content:`string`,modifiedTs:`number`},D9=new WeakMap;function poe(e){return e===void 0||!Number.isFinite(e)?20:Math.max(1,Math.min(100,Math.trunc(e)))}function O9(e){return e.trim().toLowerCase()}var moe=/\.(?:md|mdx)$/;function hoe(e,t){if(t!==`page`)return e;let n=e.replace(moe,``);return n.length>0?n:e}function k9(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function goe(e){let t=k9(e.path),n=e.title?.trim()||t,r=e.modifiedTs??0,i=e.path.split(`/`).filter(Boolean),a=new Set(i),o=[...new Set((e.aliases??[]).flatMap(e=>e.split(`/`).filter(Boolean)).filter(e=>!a.has(e)))];return{id:`${e.kind}:${e.path}`,kind:e.kind,path:e.path,title:n,name:t,pathSegments:[...i,...o].join(` `),content:e.content??``,modifiedTs:Number.isFinite(r)?r:0}}function A9(e){let t=LJ({schema:foe});return e.length>0&&JJ(t,e),t}function _oe(e){let t={documents:e};return D9.set(t,A9(e)),t}function voe(e){let t=D9.get(e);if(t)return t;let n=A9(e.documents);return D9.set(e,n),n}function yoe(e){return e===`autocomplete`?[`page`]:e===`full_text`?[`page`,`content`,`file`]:[`page`,`folder`,`file`]}function j9(e,t){return t.has(e.kind)?!0:e.kind===`page`&&t.has(`content`)}function boe(e,t){let n=O9(t);if(!n)return 0;let r=hoe(n,e.kind),i=O9(e.title),a=O9(e.name),o=O9(e.path),s=o.split(`/`);return i===r||a===r?700:o===r?650:i.startsWith(r)||a.startsWith(r)?600:s.some(e=>e.startsWith(r))?550:i.includes(r)||a.includes(r)?500:o.includes(r)?450:-1}var xoe=.5;function M9(e,t){let n=boe(e,t);return n<=0?n:B$(e.path)?n*xoe:n}var Soe=60;function Coe(e){return e===`file`?-Soe:0}var woe=1e3,N9=50,Toe=1,Eoe=1,Doe=.001;function Ooe(e,t,n,r,i){let a=i>0?t/i:0,o=N9>0?n/N9:0,s=r===`file`?-Doe:0,c=Toe*a+Eoe*o+s;return e*woe+c}function P9(e,t,n,r){return e+t*20+n+Coe(r)}function F9(e,t,n,r,i,a){return e===`relevance`?P9(t,n,r,i):Ooe(t,n,r,i,a)}function koe(e,t){return t||(e===`full_text`?`relevance`:`navigation`)}function I9(e,t){let n=0;for(let r of e){let e=t.get(r.id)??0;e>n&&(n=e)}return n}function Aoe(e){let t=e.map(e=>e.modifiedTs).filter(e=>Number.isFinite(e)&&e>0);if(t.length===0)return new Map;let n=1/0,r=-1/0;for(let e of t)e<n&&(n=e),e>r&&(r=e);let i=Math.max(1,r-n);return new Map(e.map(e=>[e.id,e.modifiedTs>0?(e.modifiedTs-n)/i*50:0]))}function joe(e){return e===`full_text`?[`title`,`name`,`path`,`pathSegments`,`content`]:[`title`,`name`,`path`,`pathSegments`]}function Moe(e){return e===`full_text`?{title:8,name:7,path:5,pathSegments:4,content:1}:e===`autocomplete`?{title:10,name:9,path:5,pathSegments:4}:{title:8,name:7,path:5,pathSegments:4}}function Noe(e,t){return O9(t).length<4?0:+(e===`full_text`)}function Poe(e){let{lexical:t,fullText:n}=e.signals;return t>=uoe?`lexical`:t===doe&&n<=0?`pathOnly`:`body`}function Foe(e){let t=[],n=[],r=[];for(let i of e){let e=Poe(i);e===`lexical`?t.length<loe&&t.push(i):e===`body`?n.length<6&&n.push(i):r.length<4&&r.push(i)}return[...t,...n,...r]}function L9(e,t,n){if(t===`relevance`)return e.slice(0,n);let r=Foe(e),i=[],a=0,o=0;for(let e of r){if(e.document.kind===`folder`){if(a>=3)continue;a+=1}else if(e.document.kind===`file`){if(o>=3)continue;o+=1}if(i.push(e),i.length>=n)break}return i}function Ioe(e,t,n={}){let r=n.intent??`omnibar`,i=koe(r,n.ranking),a=poe(n.limit),o=new Set(n.scopes??yoe(r)),s=e.documents.filter(e=>j9(e,o)),c=O9(t);if(!c)return s.slice().sort((e,t)=>e.path.localeCompare(t.path)).slice(0,a).map(e=>({document:e,score:0,signals:{lexical:0,fullText:0,recency:0}}));let l=wY(voe(e),{term:c,properties:joe(r),boost:Moe(r),tolerance:Noe(r,c),limit:Math.max(a*4,40)}),u=new Map(l.hits.filter(e=>j9(e.document,o)).map(e=>[e.document.id,e.score])),d=Aoe(s),f=new Map;for(let e of s)M9(e,c)>=0&&f.set(e.id,e);for(let e of l.hits)j9(e.document,o)&&f.set(e.document.id,e.document);if(!n.semantic){let e=I9(f.values(),u);return L9([...f.values()].map(t=>{let n=Math.max(0,M9(t,c)),r=u.get(t.id)??0,a=d.get(t.id)??0;return{document:t,score:F9(i,n,r,a,t.kind,e),signals:{lexical:n,fullText:r,recency:a}}}).sort((e,t)=>e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score),i,a)}return L9(Loe({scopedDocuments:s,candidates:f,fullTextScores:u,recency:d,normalizedQuery:c,ranking:i,semantic:n.semantic}),i,a)}function R9(e){let t=new Map;return e.forEach((e,n)=>{t.set(e,n+1)}),t}function Loe(e){let{scopedDocuments:t,candidates:n,fullTextScores:r,recency:i,normalizedQuery:a,ranking:o,semantic:s}=e,c=s.rrfK??60,l=s.candidateLimit??64,u=s.similarityFloor??0,d=s.scores,f=new Map(t.map(e=>[e.id,e])),p=[...d.entries()].filter(([e,t])=>t>=u&&f.has(e)).sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])).slice(0,l);for(let[e]of p)if(!n.has(e)){let t=f.get(e);t&&n.set(e,t)}let m=I9(n.values(),r),h=[...n.values()].map(e=>{let t=Math.max(0,M9(e,a)),n=r.get(e.id)??0,s=i.get(e.id)??0,c=d.get(e.id),l=c!==void 0&&c>=u;return{document:e,score:t>0?F9(o,t,n,s,e.kind,m):P9(t,n,s,e.kind),signals:l?{lexical:t,fullText:n,recency:s,vector:c}:{lexical:t,fullText:n,recency:s},lexical:t,fullText:n,recency:s,cosine:c}}),g=R9(h.filter(e=>e.fullText>0).sort((e,t)=>t.fullText-e.fullText||e.document.path.localeCompare(t.document.path)).map(e=>e.document.id)),_=R9(h.filter(e=>e.cosine!==void 0&&e.cosine>=u).sort((e,t)=>t.cosine-e.cosine||e.document.path.localeCompare(t.document.path)).map(e=>e.document.id)),v=e=>{let t=0,n=g.get(e);n!==void 0&&(t+=1/(c+n));let r=_.get(e);return r!==void 0&&(t+=1/(c+r)),t};return h.sort((e,t)=>{let n=+(e.lexical>0),r=+(t.lexical>0);if(n!==r)return r-n;if(n===1)return e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score;let i=v(e.document.id),a=v(t.document.id);return i===a?e.recency===t.recency?e.document.path.localeCompare(t.document.path):t.recency-e.recency:a-i}).map(({document:e,score:t,signals:n})=>({document:e,score:t,signals:n}))}function Roe(e){return`https://${e.host}/${e.owner}/${e.repo}.git`}function zoe(e,t){return!e||e.length===0?`true`:t.detached?`detached`:t.currentBranch===null||t.currentBranch===e?`true`:`false`}var z9=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),B9=globalThis;B9[z9]===void 0&&(B9[z9]=si());var V9=B9[z9],H9=Eo({version:P().regex(/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(V9,{description:`Recorded skill version for this target.`}),recordedAt:ba().register(V9,{description:`ISO 8601 timestamp of the most recent successful write. Updated on every write, including reinstalls of the same version.`}),surface:z([`server-build-and-open`,`electron-build-and-open`,`cli-npx-skills-add`,`desktop-direct`,`cli-start`]).register(V9,{description:`Install-source surface that recorded this entry.`}).optional()}),Boe=Eo({enabled:I().register(V9,{description:`Whether this user-global skill bundle is opted in.`}),decidedAt:ba().register(V9,{description:`ISO 8601 timestamp of the opt-in / opt-out decision.`})});Eo({schema:B(1).register(V9,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:Eo({"claude-cowork":H9.optional(),"cli-hosts":H9.optional()}).register(V9,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({}),bundles:Po(P(),Boe).register(V9,{description:`Per-bundle opt-in decisions keyed by install name. Absent key = no recorded decision.`}).optional()});var Voe=new Set([`(connected)`,`(agent thread)`]);function Hoe(e){return e!=null&&Voe.has(e)}var U9=class extends Error{chunksCompleted;totalChunks;bytesWritten;bytesRemaining;cause;constructor(e,t){let n=e instanceof Error?e.message:typeof e==`string`?e:`unknown error`;super(`chunked insert failed after ${t.chunksCompleted}/${t.totalChunks} chunks (${t.bytesWritten} bytes written, ${t.bytesRemaining} bytes lost): ${n}`),this.name=`ChunkedInsertError`,this.chunksCompleted=t.chunksCompleted,this.totalChunks=t.totalChunks,this.bytesWritten=t.bytesWritten,this.bytesRemaining=t.bytesRemaining,this.cause=e}};async function Uoe(e,t,n,r,i={}){let a=i.thresholdBytes??512e3,o=i.chunkSizeBytes??51200,s=i.origin,c=i.yieldFn??Woe,l=i.resolveOffset??(e=>e);if(r.length<=a){e.transact(()=>{t.insert(n,r)},s);return}let u=Math.ceil(r.length/o),d=0,f=n,p=0,m=0;for(;d<r.length;){let n=Math.min(d+o,r.length),i=r.slice(d,n);try{let n=l(f);e.transact(()=>{t.insert(n,i)},s)}catch(e){throw new U9(e,{chunksCompleted:p,totalChunks:u,bytesWritten:m,bytesRemaining:r.length-d})}p++,m+=i.length,f+=i.length,d=n,d<r.length&&await c()}}function Woe(){return new Promise(e=>{let t=globalThis;t.document?.hidden!==!0&&typeof t.requestAnimationFrame==`function`?t.requestAnimationFrame(()=>e()):setTimeout(()=>e(),0)})}function Goe(){let e=!1,t=``,n=0;return r=>{let i=Koe(r);return e?(i&&i.char===t&&i.len>=n&&!i.hasInfo&&(e=!1,t=``,n=0),!0):i?(e=!0,t=i.char,n=i.len,!0):!1}}function Koe(e){let t=(e.endsWith(`\r`)?e.slice(0,-1):e).match(/^ {0,3}([`~])(\1{2,})(.*)$/);return t?{char:t[1],len:1+t[2].length,hasInfo:t[3].trim()!==``}:null}var qoe=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],Joe={claude:`#D97757`,cursor:`#1B1912`,windsurf:`#0B100F`,openai:`#7A9DFF`,github:`#8534F3`,cline:`#9663F0`,bot:`#727CF3`},Yoe={cursor:`#FFFFFF`,windsurf:`#FFFFFF`},W9=[`#f0ece3`,`#fff5e1`,`#f9e1db`,`#f5def7`,`#ece2fb`,`#dce8fa`,`#DBF3FB`];function Xoe(e,t=qoe){let n=0;for(let t of e)n=(n<<5)-n+t.charCodeAt(0)|0;return t[Math.abs(n)%t.length]}function Zoe(e){let t=e.trim();if(!t)return`?`;let n=t.split(/[-\s]+/).filter(Boolean);if(!n.length)return`?`;if(n.length>=2)return n.slice(0,2).map(e=>e[0]??``).join(``).toUpperCase();let r=n[0],i=[r[0]];for(let e=1;e<r.length&&i.length<2;e++){let t=r[e-1],n=r[e];t===t.toLowerCase()&&n===n.toUpperCase()&&n!==n.toLowerCase()&&i.push(n)}return i.length>=2?i.join(``).toUpperCase():r.slice(0,2).toUpperCase()}function Qoe(e){let t=e.trim();if(!t)return e;if(t.includes(` `)||!/[-_]/.test(t))return t;let n=t.split(/[-_]+/).filter(Boolean);return n.length?n.map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(` `):t}var $oe={"claude-code":`claude`,"claude-ai":`claude`,cursor:`cursor`,"cursor-vscode":`cursor`,cascade:`windsurf`,codex:`openai`,"codex-mcp-client":`openai`,copilot:`github`,cline:`cline`};function ese(e){return e?$oe[e]||(e.startsWith(`local-agent-mode-`)?`claude`:`bot`):`bot`}function tse(e){let t=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,r=parseInt(e.slice(5,7),16)/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2;if(i===a)return[0,0,o*100];let s=i-a,c=o>.5?s/(2-i-a):s/(i+a),l;return l=i===t?((n-r)/s+(n<r?6:0))/6:i===n?((r-t)/s+2)/6:((t-n)/s+4)/6,[l*360,c*100,o*100]}function nse(e,t,n){let r=t/100,i=n/100,a=r*Math.min(i,1-i),o=t=>{let n=(t+e/30)%12,r=i-a*Math.max(Math.min(n-3,9-n,1),-1);return Math.round(255*r).toString(16).padStart(2,`0`)};return`#${o(0)}${o(8)}${o(4)}`}function rse(e){let[t]=tse(e);return nse(t,45,32)}var ise=[`Curious`,`Brave`,`Clever`,`Swift`,`Gentle`,`Bright`,`Wise`,`Bold`,`Calm`,`Keen`],ase=[`Bird`,`Cat`,`Dog`,`Fish`,`Mouse`,`Rabbit`,`Shrimp`,`Snail`,`Squirrel`,`Turtle`],G9=`ok-user-name-v3`,K9=`ok-user-color-v3`;function q9(e){return e[Math.floor(Math.random()*e.length)]}function ose(){return`${q9(ise)} ${q9(ase)}`}function sse(){return q9(W9)}function J9(e){try{return localStorage.getItem(e)}catch{return null}}function Y9(e,t){try{localStorage.setItem(e,t)}catch{}}function cse(){let e=new URLSearchParams(window.location.search).get(`coeditor`)||`standalone`,t=crypto.randomUUID(),n=J9(G9),r=J9(K9);return n||(n=ose(),Y9(G9,n)),r||(r=sse(),Y9(K9,r)),{name:n,color:r,coeditor:e,tabId:t}}function lse(e,t){let n=e.trim();if(!n||/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n)||n.startsWith(`//`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=r>=0?n.slice(0,r):n,a=r>=0?n.slice(r+1):null,o=(i.split(`?`)[0]??``).trim();if(!o)return null;let s=(o.split(`/`).pop()??``).match(/\.([a-z0-9]+)$/i);if(s){let e=(s[1]??``).toLowerCase();if(e!==`md`&&e!==`mdx`)return null}let c=o.toLowerCase(),l=c.endsWith(`.mdx`)?o.slice(0,-4):c.endsWith(`.md`)?o.slice(0,-3):o,u=l.startsWith(`/`),d=u?l.slice(1):l,f=u?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of d.split(`/`))if(e===`..`){if(f.length===0)return null;f.pop()}else e!==`.`&&e!==``&&f.push(e);return f.length===0?null:{docName:f.join(`/`),anchor:a||null}}function use(e){throw Error(`Unhandled ClassifiedLinkTarget variant: ${JSON.stringify(e)}`)}var X9=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function Z9(e){let t=(e.split(/[?#]/)[0]??e).match(/\.([a-z0-9]+)$/i);return t?(t[1]??``).toLowerCase():null}function Q9(e){return e.split(`/`).filter(Boolean)}function $9(e){let t=e.trim();return X9.test(t)||t.startsWith(`//`)}function dse(e,t){let n=e.trim();if(!n)return null;if(n.startsWith(`#`)){let e=n.slice(1).trim();return e?{kind:`anchor`,anchor:e}:null}if($9(n))return{kind:`external`,url:n};let r=lse(n,t);if(r)return{kind:`doc`,docName:r.docName,anchor:r.anchor};let i=Z9(n);return i&&i!==`md`&&i!==`mdx`?{kind:`asset`,url:n,ext:i}:null}function fse(e,t){let n=e.trim();if(!n)return null;if($9(n))return{kind:`external`,url:t?`${n}#${t}`:n};let r=Z9(n);return r&&r!==`md`&&r!==`mdx`?{kind:`asset`,url:n,ext:r}:{kind:`doc`,docName:n,anchor:t?.trim()||null}}function pse(e,t){let n=e.trim();if(!n||X9.test(n)||n.startsWith(`//`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=((r>=0?n.slice(0,r):n).split(`?`)[0]??``).trim();if(!i)return null;let a=i.startsWith(`/`),o=a?i.slice(1):i,s=a?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of o.split(`/`))if(e===`..`){if(s.length===0)return null;s.pop()}else e!==`.`&&e!==``&&s.push(e);return s.length===0?null:s.join(`/`)}function mse(e,t,n=null,r=`.md`){let i=Q9(e);i.pop();let a=Q9(t),o=0;for(;o<i.length&&o<a.length&&i[o]===a[o];)o+=1;let s=i.slice(o).map(()=>`..`),c=a.slice(o),l=[...s,...c].join(`/`);return l||=a.at(-1)??t,!l.startsWith(`./`)&&!l.startsWith(`../`)&&(l=`./${l}`),`${l}${r}${n?`#${n}`:``}`}function hse(e){return e.replace(/[/\\:*?"<>|\0]/g,`-`).replace(/\s+/g,` `).replace(/-+/g,`-`).trim().replace(/^[-.\s]+|[-.\s]+$/g,``)}export{uie as $,z as $a,tx as $i,v0 as $n,Ioe as $r,I$ as $t,Pie as A,xd as Aa,HC as Ai,Goe as An,Lre as Ar,uX as At,roe as B,ld as Ba,$S as Bi,Z9 as Bn,TX as Br,FQ as Bt,AX as C,Tf as Ca,LD as Ci,QQ as Cn,Hoe as Cr,dre as Ct,Eie as D,Od as Da,fO as Di,YQ as Dn,a2 as Dr,bZ as Dt,Die as E,bf as Ea,WD as Ei,ZQ as En,noe as Er,vZ as Et,Oie as F,gd as Fa,yS as Fi,HX as Fn,eoe as Fr,r1 as Ft,m0 as G,ad as Ga,pC as Gi,Q5 as Gn,lZ as Gr,XX as Gt,tie as H,Wf as Ha,WS as Hi,gae as Hn,VY as Hr,uQ as Ht,IX as I,uf as Ia,Ow as Ii,pre as In,k5 as Ir,J7 as It,hZ as J,fd as Ja,kx as Ji,fae as Jn,i9 as Jr,are as Jt,fie as K,cd as Ka,kw as Ki,Qoe as Kn,bX as Kr,YX as Kt,BX as L,ud as La,xS as Li,UY as Ln,hQ as Lr,Jie as Lt,G7 as M,Sd as Ma,Uw as Mi,_oe as Mn,y0 as Mr,Y$ as Mt,Xre as N,Ad as Na,Ww as Ni,goe as Nn,rX as Nr,e1 as Nt,Xne as O,qd as Oa,bw as Oi,JQ as On,mre as Or,yX as Ot,Yre as P,Sf as Pa,Vw as Pi,rse as Pn,nZ as Pr,$$ as Pt,iie as Q,lf as Qa,Cw as Qi,lX as Qn,LY as Qr,toe as Qt,sX as R,tf as Ra,SS as Ri,cX as Rn,SX as Rr,qie as Rt,fX as S,wd as Sa,nO as Si,XQ as Sn,WX as Sr,M7 as St,ZX as T,yf as Ta,xO as Ti,C$ as Tn,xZ as Tr,Nie as Tt,rre as U,Wd as Ua,KS as Ui,iZ as Un,gQ as Ur,Wie as Ut,E9 as V,qf as Va,FS as Vi,ooe as Vn,pae as Vr,IQ as Vt,W9 as W,od as Wa,qS as Wi,ure as Wn,u2 as Wr,Fie as Wt,MX as X,Af as Xa,hC as Xi,cse as Xn,uae as Xr,xQ as Xt,gZ as Y,Cf as Ya,PS as Yi,yre as Yn,pse as Yr,vQ as Yt,EZ as Z,pd as Za,Bw as Zi,_Q as Zn,hse as Zr,cie as Zt,AY as _,U as _a,k9 as _i,rZ as _n,Ure as _r,kie as _t,xie as a,Qh as aa,RQ as ai,LQ as an,R as ao,$2 as ar,_7 as at,dX as b,Xf as ba,FA as bi,e$ as bn,vX as br,zY as bt,Qre as c,Nh as ca,Tne as ci,mse as cn,Mt as co,J2 as cr,KQ as ct,sae as d,Am as da,y7 as di,Uoe as dn,Z2 as dr,UX as dt,ab as ea,s7 as ei,use as en,ds as eo,ese as er,tre as et,aae as f,Im as fa,HY as fi,zoe as fn,Vre as fr,die as ft,OX as g,fm as ga,GQ as gi,NY as gn,cre as gr,jie as gt,kX as h,jh as ha,b7 as hi,MY as hn,$9 as hr,RX as ht,bie as i,q as ia,CX as ii,wQ as in,B as io,q2 as ir,_X as it,$7 as j,of as ja,fC as ji,B2 as jn,Pre as jr,l1 as jt,NX as k,Td as ka,aw as ki,Zoe as kn,DX as kr,Gie as kt,iae as l,K as la,mZ as li,zQ as ln,Tt as lo,G2 as lr,qQ as lt,rae as m,zm as ma,h1 as mi,fse as mn,PX as mr,JX as mt,Yoe as n,Hb as na,SQ as ni,Bae as nn,I as no,t4 as nr,gie as nt,PY as o,tg as oa,cZ as oi,TQ as on,P as oo,Y2 as or,pne as ot,oae as p,Bm as pa,uZ as pi,dse as pn,TZ as pr,qX as pt,r8 as q,Gd as qa,Qx as qi,R7 as qn,a9 as qr,p1 as qt,FX as r,Rh as ra,OQ as ri,nX as rn,qa as ro,K2 as rr,gX as rt,$re as s,G as sa,CQ as si,DQ as sn,At as so,Q2 as sr,IZ as st,Joe as t,cb as ta,m1 as ti,XY as tn,L as to,e4 as tr,ore as tt,cae as u,Fm as ua,$ne as ui,Roe as un,X2 as ur,KX as ut,WY as v,xp as va,Lte as vi,Xoe as vn,B$ as vr,u1 as vt,U9 as w,kd as wa,hO as wi,L$ as wn,SZ as wr,LZ as wt,pX as x,_d as xa,PA as xi,$Q as xn,Qne as xr,RY as xt,mX as y,W as ya,MA as yi,T$ as yn,r2 as yr,f1 as yt,sZ as z,pf as za,QS as zi,yQ as zn,n2 as zr,Kie as zt};