@inkeep/open-knowledge 0.58.0-beta.8 → 0.58.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{acp-harness-probe-dZsvbgrC.mjs → acp-harness-probe-EY118B13.mjs} +2 -2
- package/dist/cli.mjs +23 -23
- package/dist/config-schema.json +1 -1
- package/dist/config.project.schema.json +1 -1
- package/dist/constants-CGYatEBL.mjs +2 -0
- package/dist/fs-traced-BEuPZxxL.mjs +1 -0
- package/dist/{fs-traced-oq2wG9J_.mjs → fs-traced-xJfl5Rxd.mjs} +2 -2
- package/dist/git-handle-CcWdc2o_.mjs +1 -0
- package/dist/{git-handle-2o4Vxedu.mjs → git-handle-Dk7GEAfH.mjs} +2 -2
- package/dist/index.d.mts +2 -2600
- package/dist/index.mjs +3 -3
- package/dist/init-BglLqrOW.mjs +1 -0
- package/dist/{init-DasMrTCg.mjs → init-CjDJqCL6.mjs} +5 -5
- package/dist/{launch-json-removal-BCc3Wt5o.mjs → launch-json-removal-DBGHaxha.mjs} +2 -2
- package/dist/{loader-CFnKYZR2.mjs → loader-B7lXyJFO.mjs} +2 -2
- package/dist/loader-xqwijD2m.mjs +1 -0
- package/dist/md-manager-30TBxbTV.mjs +2 -0
- package/dist/{open-browser-CMs-r6aL.mjs → open-browser-BXT69qcq.mjs} +2 -2
- package/dist/parse-worker.mjs +1 -1
- package/dist/preview-BqXocFFE.mjs +1 -0
- package/dist/{preview-Dv9l315C.mjs → preview-EGTe7kIb.mjs} +2 -2
- package/dist/public/assets/ActivityModeContent-Bh8PvwWR.js +1 -0
- package/dist/public/assets/{AgentDiffPane-BuZT0CFj.js → AgentDiffPane-CxvPSRp5.js} +1 -1
- package/dist/public/assets/{AgentIconCluster-D_inolLQ.js → AgentIconCluster-CjMEI-L4.js} +1 -1
- package/dist/public/assets/{AgentThreadClientBinder-Db3J-HNk.js → AgentThreadClientBinder-CZt9gzGP.js} +1 -1
- package/dist/public/assets/{AppMenubar-DNz-YQ-n.js → AppMenubar-CiSfRgZz.js} +1 -1
- package/dist/public/assets/{BugReportHistory-3WmeKMdN.js → BugReportHistory-DAkLR0uT.js} +1 -1
- package/dist/public/assets/{BugReportHistoryDialog-B8G8dpLP.js → BugReportHistoryDialog-D3FmiOs-.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-B3PfIk_d.js → CodeMirrorPropInput-Bj9gYc9v.js} +1 -1
- package/dist/public/assets/ConsentDialogBody-ByUP5rlV.js +2 -0
- package/dist/public/assets/{DiffView-CjTilKZT.js → DiffView-BbCF3n86.js} +1 -1
- package/dist/public/assets/DocumentContext-CM98n-Wm.js +38 -0
- package/dist/public/assets/EditorModeToggle-BOtGsJ58.js +1 -0
- package/dist/public/assets/EnableSyncConfirmDialog-edPIQ6AO.js +1 -0
- package/dist/public/assets/FeedbackForm-B44dYSuT.js +1 -0
- package/dist/public/assets/{GraphPanel-CEcqZRWw.js → GraphPanel-Dbt6ehOx.js} +1 -1
- package/dist/public/assets/ImportSkillDialog-BYZRPrHX.js +1 -0
- package/dist/public/assets/{LintConfigEditor-Bcr2QKP1.js → LintConfigEditor-DPAgvzQo.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-D35GmczH.js +1 -0
- package/dist/public/assets/ManagedArtifactProperties-N6SxoaQN.js +1 -0
- package/dist/public/assets/McpConsentDialogBody-Cdxs_Q-f.js +1 -0
- package/dist/public/assets/{MermaidDocEditor-Co4QYa48.js → MermaidDocEditor-B-SpVE_4.js} +1 -1
- package/dist/public/assets/{OpenInAgentMenuItem-C_aRPIjj.js → OpenInAgentMenuItem--c5Kl0UJ.js} +1 -1
- package/dist/public/assets/{PropertyDisplayRow-CrYGlgp7.js → PropertyDisplayRow-JWrzMen3.js} +1 -1
- package/dist/public/assets/{ReportBugDialogBody-CN1i_Y7g.js → ReportBugDialogBody-Bn7KSO7Z.js} +1 -1
- package/dist/public/assets/SchemaConfigEditor-4ELQUjOk.js +1 -0
- package/dist/public/assets/SessionsHost-CkCwV0Gg.js +2 -0
- package/dist/public/assets/SettingsDialogBody-f_hQ7VPv.js +13 -0
- package/dist/public/assets/ShareBranchSwitchDialog-BcO94wih.js +1 -0
- package/dist/public/assets/ShareReceiveDialog-tG5J08TH.js +1 -0
- package/dist/public/assets/ShareReceiveMissDialog-ClfobBlL.js +1 -0
- package/dist/public/assets/{SkillCostValue-C0tQ5Ey6.js → SkillCostValue-XTEKNDJI.js} +1 -1
- package/dist/public/assets/{SkillDestinationList-DYjzv8JN.js → SkillDestinationList-Dw1naFS2.js} +1 -1
- package/dist/public/assets/{SkillEditBanner-DUbh82i0.js → SkillEditBanner-DFhrQ8xp.js} +1 -1
- package/dist/public/assets/{SkillInstallMenu-aKaOX_rG.js → SkillInstallMenu-B2HRT0pR.js} +1 -1
- package/dist/public/assets/{SkillOriginInline-Dcw5U9Gu.js → SkillOriginInline-Ba3UO-r0.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-CZNGVa1t.js → SkillToolbarControls-D_gVZcnp.js} +1 -1
- package/dist/public/assets/SlidesToolbarControls-Dtor0bv_.js +1 -0
- package/dist/public/assets/{SourceEditor-DrIQgn17.js → SourceEditor-CZ1cWoNO.js} +1 -1
- package/dist/public/assets/{TerminalPanel-C61cGKq0.js → TerminalPanel-D15yQGLN.js} +3 -3
- package/dist/public/assets/{TerminalWindowApp-Zyc8LXKG.js → TerminalWindowApp-DoVS1306.js} +1 -1
- package/dist/public/assets/{TextDocEditor-Dhfis_S6.js → TextDocEditor-gZsWz3eO.js} +1 -1
- package/dist/public/assets/{ThreadView-BZYcGOYJ.js → ThreadView-BQHsrBEu.js} +1 -1
- package/dist/public/assets/TimelineDiffPane-CT-ihYQ6.js +2 -0
- package/dist/public/assets/{auth-state-cache-CWPxRafc.js → auth-state-cache-BrvpmLJN.js} +4 -4
- package/dist/public/assets/{client-version-BsMRrwFS.js → client-version-vyi1QvTS.js} +1 -1
- package/dist/public/assets/comment-chips-C9lD2NUl.js +5 -0
- package/dist/public/assets/{config-provider-DkOV03RH.js → config-provider-D1oa8ar_.js} +3 -3
- package/dist/public/assets/{dist-CP7w45uR.js → dist-BrL2bd3x.js} +2 -2
- package/dist/public/assets/{doc-paths-CX0c2GkE.js → doc-paths-CeZpYfYr.js} +1 -1
- package/dist/public/assets/{documents-events-DGovPb4Q.js → documents-events-C6H3LrA9.js} +1 -1
- package/dist/public/assets/{file-tree-adapter-CNrTrjb9.js → file-tree-adapter-DFyrX-92.js} +1 -1
- package/dist/public/assets/{file-tree-utils-Ceep4GK6.js → file-tree-utils-C9zTW2_A.js} +1 -1
- package/dist/public/assets/{folder-config-api-BavUQIxi.js → folder-config-api-JwI3TW0L.js} +1 -1
- package/dist/public/assets/{follow-file-BDoShwy7.js → follow-file-H_OOuojl.js} +1 -1
- package/dist/public/assets/globals-CyRfFhRe.css +1 -0
- package/dist/public/assets/i18n-BdQmUBxL.js +1 -0
- package/dist/public/assets/index-BXv4_oa9.js +2095 -0
- package/dist/public/assets/{lint-config-client-BXCLXBm0.js → lint-config-client-qKPmO3Qw.js} +1 -1
- package/dist/public/assets/markdownlint-rule-browser-BNoonKhJ.js +1 -0
- package/dist/public/assets/{mcp-consent-store-lJGGM3y3.js → mcp-consent-store-Bxq-u2M3.js} +1 -1
- package/dist/public/assets/messages-BSrj3IKW.js +1 -0
- package/dist/public/assets/messages-BsTQ5dHv.js +1 -0
- package/dist/public/assets/messages-C-9-pube.js +1 -0
- package/dist/public/assets/messages-CH0H74g3.js +1 -0
- package/dist/public/assets/messages-C_U8ss6i.js +1 -0
- package/dist/public/assets/messages-Ce75_Ji3.js +1 -0
- package/dist/public/assets/messages-CyG8vSMs.js +1 -0
- package/dist/public/assets/messages-D2dSy_ch.js +1 -0
- package/dist/public/assets/messages-D7FYHWNu.js +1 -0
- package/dist/public/assets/messages-DavhhPbD.js +1 -0
- package/dist/public/assets/messages-DcmkySre.js +1 -0
- package/dist/public/assets/messages-YKhV6ZL8.js +1 -0
- package/dist/public/assets/{navigation-targets-B9ZSMArq.js → navigation-targets-Du1yYMa3.js} +1 -1
- package/dist/public/assets/{open-managed-artifact-tab-FyNAk92K.js → open-managed-artifact-tab-DA0xFMQL.js} +1 -1
- package/dist/public/assets/pending-receive-nav-store-jTqdW3b0.js +1 -0
- package/dist/public/assets/{platform-labels-C-SqHx4o.js → platform-labels-BW7YRK2j.js} +1 -1
- package/dist/public/assets/{project-paths-BShAgBI2.js → project-paths-xKaVJSAX.js} +1 -1
- package/dist/public/assets/{prop-types-BWoV6rdx.js → prop-types-LyJPmVUN.js} +1 -1
- package/dist/public/assets/{receive-store-sP45Lmaj.js → receive-store-C7uwmgHL.js} +1 -1
- package/dist/public/assets/{selection-context-jZhBCQUz.js → selection-context-BJ7u_a2a.js} +1 -1
- package/dist/public/assets/skill-actions-CUghpMeW.js +1 -0
- package/dist/public/assets/{skill-scope-C3ZLyDFU.js → skill-scope-41fjvVEv.js} +1 -1
- package/dist/public/assets/{skills-api-DkJBCb26.js → skills-api-BLsd0Xm0.js} +1 -1
- package/dist/public/assets/{src-DXY6B71v.js → src-TKA4AIQa.js} +1 -1
- package/dist/public/assets/{tag-pill-input-obzr2Bmc.js → tag-pill-input-BBAkEv9f.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-IjRnfQQ9.js → target-navigation-intent-BxG_VSFm.js} +1 -1
- package/dist/public/assets/{terminal-cli-display-fzswbBoR.js → terminal-cli-display-B3miHBqb.js} +1 -1
- package/dist/public/assets/{terminal-launch-events-BZw6Kevo.js → terminal-launch-events-D3Djrj2P.js} +1 -1
- package/dist/public/assets/{terminal-telemetry-BTfW00Ir.js → terminal-telemetry-yDrCOyY3.js} +1 -1
- package/dist/public/assets/thread-client-d5910s2I.js +1 -0
- package/dist/public/assets/{typing-burst-detector-adEL1lyg.js → typing-burst-detector-BgFZQX05.js} +2 -2
- package/dist/public/assets/{uninstall-DJb5IlCU.js → uninstall-CFA5w-m5.js} +1 -1
- package/dist/public/assets/{use-activity-panel-bJnzXq1_.js → use-activity-panel-DPJJ75w9.js} +1 -1
- package/dist/public/assets/{use-apply-config-color-theme-hdarUMLl.js → use-apply-config-color-theme-Eo0YlkiS.js} +1 -1
- package/dist/public/assets/{use-collab-url-BSs7OT15.js → use-collab-url-DtfgRTLQ.js} +1 -1
- package/dist/public/assets/{use-live-xterm-theme-BQNkHYLe.js → use-live-xterm-theme-DSbS2g15.js} +1 -1
- package/dist/public/assets/use-open-skill-CmlgDEiD.js +1 -0
- package/dist/public/assets/{use-popular-skills-DSYrjkIc.js → use-popular-skills-AdcFV1D_.js} +1 -1
- package/dist/public/assets/{use-settings-route-CAQ6W9p6.js → use-settings-route-B2jig6fs.js} +1 -1
- package/dist/public/assets/use-skill-origin-DXe-gG8s.js +1 -0
- package/dist/public/assets/{use-skills-BrC3Upu3.js → use-skills-Ct4t-6Ji.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-B-_ScHv6.js → use-terminal-enabled-DLCLwzPR.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-EyIHz_x3.js → use-timeline-entry-diff-B1RCXahh.js} +1 -1
- package/dist/public/assets/{use-workspace-CFSG46RY.js → use-workspace-DXg_fDor.js} +1 -1
- package/dist/public/index.html +56 -56
- package/dist/public/uninstall.html +7 -7
- package/dist/{repair-launch-json-BU_wTHU6.mjs → repair-launch-json-CnC1yFmy.mjs} +2 -2
- package/dist/{repair-mcp-configs-DLGnB9SW.mjs → repair-mcp-configs-CO6hDA8w.mjs} +2 -2
- package/dist/repair-skills-BmR0xC0t.mjs +1 -0
- package/dist/repair-skills-DC9YrDGX.mjs +4 -0
- package/dist/schemas/v0/config.project.schema.json +1 -1
- package/dist/server-lock-D-FV4bZf.mjs +1 -0
- package/dist/{server-lock-CucURT_N.mjs → server-lock-xhUgHytn.mjs} +2 -2
- package/dist/{skill-teardown-C2iNSWvT.mjs → skill-teardown-DVWO087y.mjs} +2 -2
- package/dist/{sleep-BU8QtSQy.mjs → sleep-D_nNc7T_.mjs} +2 -2
- package/dist/src-Bf9qn1Q1.mjs +1 -0
- package/dist/{src-C1pxKPYT.mjs → src-CBALwizo.mjs} +4 -4
- package/dist/src-CCW4TQuz.mjs +357 -0
- package/dist/src-D5ZZydZi.mjs +2017 -0
- package/dist/{src-CXbUZB_b.mjs → src-DT3BV-Jn.mjs} +1 -1
- package/dist/start-Df_2ALn7.mjs +1 -0
- package/dist/start-ZRhTJkN6.mjs +12 -0
- package/dist/{ui-UQBOE6mj.mjs → ui-D8O01OgQ.mjs} +3 -3
- package/dist/{write-project-skill-7xCQZ9iq.mjs → write-project-skill-BufydPiH.mjs} +3 -3
- package/package.json +4 -4
- package/dist/constants-CzhGjsFo.mjs +0 -2
- package/dist/fs-traced-corg4Obj.mjs +0 -1
- package/dist/git-handle-DEjt_7O0.mjs +0 -1
- package/dist/init-Ct7mqKVm.mjs +0 -1
- package/dist/loader-C6UUw0ZZ.mjs +0 -1
- package/dist/md-manager-FXuCv5zc.mjs +0 -2
- package/dist/preview-D9SZkYr5.mjs +0 -1
- package/dist/public/assets/ActivityModeContent-DB3zhNIv.js +0 -1
- package/dist/public/assets/ConsentDialogBody-DIXTiaxR.js +0 -2
- package/dist/public/assets/DocumentContext-BNs9Wc7G.js +0 -38
- package/dist/public/assets/EditorModeToggle-SBfl-yYh.js +0 -1
- package/dist/public/assets/EnableSyncConfirmDialog-BoBmQwEy.js +0 -1
- package/dist/public/assets/FeedbackForm-Bwghznhy.js +0 -1
- package/dist/public/assets/ImportSkillDialog-C7EVNmz7.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-B3ZJ9FFR.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-CZwQTU72.js +0 -1
- package/dist/public/assets/McpConsentDialogBody-CRg_BChy.js +0 -1
- package/dist/public/assets/SchemaConfigEditor-CntIIKsB.js +0 -1
- package/dist/public/assets/SessionsHost-CdJc0MSK.js +0 -2
- package/dist/public/assets/SettingsDialogBody-8GHLppL4.js +0 -13
- package/dist/public/assets/ShareBranchSwitchDialog-K6rF_BB-.js +0 -1
- package/dist/public/assets/ShareReceiveDialog-D2tJPvcw.js +0 -1
- package/dist/public/assets/ShareReceiveMissDialog-PifhU4tt.js +0 -1
- package/dist/public/assets/SlidesToolbarControls-Cf1lF5oY.js +0 -1
- package/dist/public/assets/TimelineDiffPane-BBmd35R9.js +0 -2
- package/dist/public/assets/comment-chips-DdMmWihZ.js +0 -5
- package/dist/public/assets/globals-BGlAio6U.css +0 -1
- package/dist/public/assets/i18n-fvzGnIHb.js +0 -1
- package/dist/public/assets/index-Br-j853R.js +0 -2095
- package/dist/public/assets/markdownlint-rule-browser-CjQ1_sCE.js +0 -1
- package/dist/public/assets/messages-6l97Z9l-.js +0 -1
- package/dist/public/assets/messages-B6xCk04J.js +0 -1
- package/dist/public/assets/messages-BdOR8jpl.js +0 -1
- package/dist/public/assets/messages-BiqhEyiZ.js +0 -1
- package/dist/public/assets/messages-CWuRF_g4.js +0 -1
- package/dist/public/assets/messages-ChE4ifHJ.js +0 -1
- package/dist/public/assets/messages-D-dvdC6u.js +0 -1
- package/dist/public/assets/messages-D3F4EU1O.js +0 -1
- package/dist/public/assets/messages-D7hPscmx.js +0 -1
- package/dist/public/assets/messages-Debu1u7T.js +0 -1
- package/dist/public/assets/messages-Dr79fPY9.js +0 -1
- package/dist/public/assets/messages-Dwk3zwPu.js +0 -1
- package/dist/public/assets/pending-receive-nav-store-DR3ooVas.js +0 -1
- package/dist/public/assets/skill-actions-BAWcLPFa.js +0 -1
- package/dist/public/assets/thread-client-rJFsjItr.js +0 -1
- package/dist/public/assets/use-open-skill-B2CpqHwW.js +0 -1
- package/dist/public/assets/use-skill-origin-DbGsYAIW.js +0 -1
- package/dist/repair-skills-6kXbAVAI.mjs +0 -1
- package/dist/repair-skills-B2XZB3Rs.mjs +0 -4
- package/dist/server-lock-Tb9AMsy7.mjs +0 -1
- package/dist/src-Bf5oIrhA.mjs +0 -1
- package/dist/src-BjPajWAS.mjs +0 -357
- package/dist/src-pjKDNsjY.mjs +0 -2017
- package/dist/start-C62GgsB9.mjs +0 -1
- package/dist/start-rya2hbae.mjs +0 -12
- /package/dist/public/assets/{dist-CMZSEMCN2.js → dist-CuH7ikCn.js} +0 -0
- /package/dist/public/assets/{dist-CdT2fVlj.js → dist-DUfEoSbR.js} +0 -0
- /package/dist/public/assets/{globals-BBuo3zzi.js → globals-OB7mlRhv.js} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -178,7 +178,7 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
|
|
|
178
178
|
|
|
179
179
|
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function Yi(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,`~standard`,{value:{...t[`~standard`],jsonSchema:{input:Qi(t,`input`,e.processors),output:Qi(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Xi(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return Xi(r.element,n);if(r.type===`set`)return Xi(r.valueType,n);if(r.type===`lazy`)return Xi(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type===`default`||r.type===`prefault`)return Xi(r.innerType,n);if(r.type===`intersection`)return Xi(r.left,n)||Xi(r.right,n);if(r.type===`record`||r.type===`map`)return Xi(r.keyType,n)||Xi(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:Xi(r.in,n)||Xi(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Xi(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Xi(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Xi(e,n))return!0;return!!(r.rest&&Xi(r.rest,n))}return!1}const Zi=(e,t={})=>n=>{let r=Ki({...n,processors:t});return qi(e,r),Ji(r,e),Yi(r,e)},Qi=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Ki({...i??{},target:a,io:t,processors:n});return qi(e,o),Ji(o,e),Yi(o,e)},$i={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},ea=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=$i[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},ta=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},na=(e,t,n,r)=>{n.type=`boolean`},ra=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},ia=(e,t,n,r)=>{n.not={}},aa=(e,t,n,r)=>{let i=e._zod.def,a=on(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},oa=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},sa=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},ca=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},la=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=qi(a.element,t,{...r,path:[...r.path,`items`]})},ua=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=qi(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=qi(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},da=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>qi(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},fa=(e,t,n,r)=>{let i=e._zod.def,a=qi(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=qi(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},pa=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=qi(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else (t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=qi(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=qi(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},ma=(e,t,n,r)=>{let i=e._zod.def,a=qi(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},ha=(e,t,n,r)=>{let i=e._zod.def;qi(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ga=(e,t,n,r)=>{let i=e._zod.def;qi(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},_a=(e,t,n,r)=>{let i=e._zod.def;qi(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},va=(e,t,n,r)=>{let i=e._zod.def;qi(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},ya=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;qi(o,t,r);let s=t.seen.get(e);s.ref=o},ba=(e,t,n,r)=>{let i=e._zod.def;qi(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},xa=(e,t,n,r)=>{let i=e._zod.def;qi(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Sa=(e,t,n,r)=>{let i=e._zod.innerType;qi(i,t,r);let a=t.seen.get(e);a.ref=i},Ca=P(`ZodISODateTime`,(e,t)=>{gte.init(e,t),Ya.init(e,t)});function wa(e){return di(Ca,e)}const Ta=P(`ZodISODate`,(e,t)=>{_te.init(e,t),Ya.init(e,t)});function Ea(e){return fi(Ta,e)}const Da=P(`ZodISOTime`,(e,t)=>{vte.init(e,t),Ya.init(e,t)});function Oa(e){return pi(Da,e)}const ka=P(`ZodISODuration`,(e,t)=>{yte.init(e,t),Ya.init(e,t)});function Aa(e){return mi(ka,e)}const ja=P(`ZodError`,(e,t)=>{jn.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Pn(e,t)},flatten:{value:t=>Nn(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,sn,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,sn,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Ma=Fn(ja),Na=In(ja),Pa=Ln(ja),Fa=zn(ja),Ia=Vn(ja),La=Hn(ja),Ra=Un(ja),za=Wn(ja),Ba=Gn(ja),Va=Kn(ja),Ha=qn(ja),Ua=Jn(ja),Wa=new WeakMap;function Ga(e,t,n){let r=Object.getPrototypeOf(e),i=Wa.get(r);if(i||(i=new Set,Wa.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}const Ka=P(`ZodType`,(e,t)=>(pr.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:Qi(e,`input`),output:Qi(e,`output`)}}),e.toJSONSchema=Zi(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.parse=(t,n)=>Ma(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Pa(e,t,n),e.parseAsync=async(t,n)=>Na(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Fa(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Ia(e,t,n),e.decode=(t,n)=>La(e,t,n),e.encodeAsync=async(t,n)=>Ra(e,t,n),e.decodeAsync=async(t,n)=>za(e,t,n),e.safeEncode=(t,n)=>Ba(e,t,n),e.safeDecode=(t,n)=>Va(e,t,n),e.safeEncodeAsync=async(t,n)=>Ha(e,t,n),e.safeDecodeAsync=async(t,n)=>Ua(e,t,n),Ga(e,`ZodType`,{check(...e){let t=this.def;return this.clone(hn(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Sn(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Rne(e,t))},superRefine(e,t){return this.check(zne(e,t))},overwrite(e){return this.check(Fi(e))},optional(){return mo(this)},exactOptional(){return Tne(this)},nullable(){return ho(this)},nullish(){return mo(ho(this))},nonoptional(e){return jne(this,e)},array(){return z(this)},or(e){return oo([this,e])},and(e){return co(this,e)},transform(e){return vo(this,fo(e))},default(e){return One(this,e)},prefault(e){return Ane(this,e)},catch(e){return Nne(this,e)},pipe(e){return vo(this,e)},readonly(){return Ine(this)},describe(e){let t=this.clone();return Vr.add(t,{description:e}),t},meta(...e){if(e.length===0)return Vr.get(this);let t=this.clone();return Vr.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,`description`,{get(){return Vr.get(e)?.description},configurable:!0}),e)),qa=P(`_ZodString`,(e,t)=>{mr.init(e,t),Ka.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ea(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,Ga(e,`_ZodString`,{regex(...e){return this.check(ki(...e))},includes(...e){return this.check(Mi(...e))},startsWith(...e){return this.check(Ni(...e))},endsWith(...e){return this.check(Pi(...e))},min(...e){return this.check(Di(...e))},max(...e){return this.check(Ei(...e))},length(...e){return this.check(Oi(...e))},nonempty(...e){return this.check(Di(1,...e))},lowercase(e){return this.check(Ai(e))},uppercase(e){return this.check(ji(e))},trim(){return this.check(Li())},normalize(...e){return this.check(Ii(...e))},toLowerCase(){return this.check(Ri())},toUpperCase(){return this.check(zi())},slugify(){return this.check(Bi())}})}),Ja=P(`ZodString`,(e,t)=>{mr.init(e,t),qa.init(e,t),e.email=t=>e.check(Ur(Xte,t)),e.url=t=>e.check(Yr(Qa,t)),e.jwt=t=>e.check(ui(fne,t)),e.emoji=t=>e.check(Xr(Qte,t)),e.guid=t=>e.check(Wr(Xa,t)),e.uuid=t=>e.check(Gr(Za,t)),e.uuidv4=t=>e.check(Kr(Za,t)),e.uuidv6=t=>e.check(qr(Za,t)),e.uuidv7=t=>e.check(Jr(Za,t)),e.nanoid=t=>e.check(Zr($te,t)),e.guid=t=>e.check(Wr(Xa,t)),e.cuid=t=>e.check(Qr(ene,t)),e.cuid2=t=>e.check($r(tne,t)),e.ulid=t=>e.check(ei(nne,t)),e.base64=t=>e.check(si(lne,t)),e.base64url=t=>e.check(ci(une,t)),e.xid=t=>e.check(ti(rne,t)),e.ksuid=t=>e.check(ni(ine,t)),e.ipv4=t=>e.check(ri(ane,t)),e.ipv6=t=>e.check(ii(one,t)),e.cidrv4=t=>e.check(ai(sne,t)),e.cidrv6=t=>e.check(oi(cne,t)),e.e164=t=>e.check(li(dne,t)),e.datetime=t=>e.check(wa(t)),e.date=t=>e.check(Ea(t)),e.time=t=>e.check(Oa(t)),e.duration=t=>e.check(Aa(t))});function F(e){return Hr(Ja,e)}const Ya=P(`ZodStringFormat`,(e,t)=>{hr.init(e,t),qa.init(e,t)}),Xte=P(`ZodEmail`,(e,t)=>{ste.init(e,t),Ya.init(e,t)}),Xa=P(`ZodGUID`,(e,t)=>{ate.init(e,t),Ya.init(e,t)}),Za=P(`ZodUUID`,(e,t)=>{ote.init(e,t),Ya.init(e,t)});function Zte(e){return Gr(Za,e)}const Qa=P(`ZodURL`,(e,t)=>{cte.init(e,t),Ya.init(e,t)});function $a(e){return Yr(Qa,e)}const Qte=P(`ZodEmoji`,(e,t)=>{lte.init(e,t),Ya.init(e,t)}),$te=P(`ZodNanoID`,(e,t)=>{ute.init(e,t),Ya.init(e,t)}),ene=P(`ZodCUID`,(e,t)=>{dte.init(e,t),Ya.init(e,t)}),tne=P(`ZodCUID2`,(e,t)=>{fte.init(e,t),Ya.init(e,t)}),nne=P(`ZodULID`,(e,t)=>{pte.init(e,t),Ya.init(e,t)}),rne=P(`ZodXID`,(e,t)=>{mte.init(e,t),Ya.init(e,t)}),ine=P(`ZodKSUID`,(e,t)=>{hte.init(e,t),Ya.init(e,t)}),ane=P(`ZodIPv4`,(e,t)=>{bte.init(e,t),Ya.init(e,t)}),one=P(`ZodIPv6`,(e,t)=>{xte.init(e,t),Ya.init(e,t)}),sne=P(`ZodCIDRv4`,(e,t)=>{Ste.init(e,t),Ya.init(e,t)}),cne=P(`ZodCIDRv6`,(e,t)=>{Cte.init(e,t),Ya.init(e,t)}),lne=P(`ZodBase64`,(e,t)=>{wte.init(e,t),Ya.init(e,t)}),une=P(`ZodBase64URL`,(e,t)=>{Ete.init(e,t),Ya.init(e,t)}),dne=P(`ZodE164`,(e,t)=>{Dte.init(e,t),Ya.init(e,t)}),fne=P(`ZodJWT`,(e,t)=>{kte.init(e,t),Ya.init(e,t)}),eo=P(`ZodNumber`,(e,t)=>{_r.init(e,t),Ka.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ta(e,t,n,r),Ga(e,`ZodNumber`,{gt(e,t){return this.check(Ci(e,t))},gte(e,t){return this.check(wi(e,t))},min(e,t){return this.check(wi(e,t))},lt(e,t){return this.check(xi(e,t))},lte(e,t){return this.check(Si(e,t))},max(e,t){return this.check(Si(e,t))},int(e){return this.check(to(e))},safe(e){return this.check(to(e))},positive(e){return this.check(Ci(0,e))},nonnegative(e){return this.check(wi(0,e))},negative(e){return this.check(xi(0,e))},nonpositive(e){return this.check(Si(0,e))},multipleOf(e,t){return this.check(Ti(e,t))},step(e,t){return this.check(Ti(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function I(e){return hi(eo,e)}const pne=P(`ZodNumberFormat`,(e,t)=>{Ate.init(e,t),eo.init(e,t)});function to(e){return gi(pne,e)}const mne=P(`ZodBoolean`,(e,t)=>{jte.init(e,t),Ka.init(e,t),e._zod.processJSONSchema=(t,n,r)=>na(e,t,n,r)});function L(e){return _i(mne,e)}const hne=P(`ZodNull`,(e,t)=>{Mte.init(e,t),Ka.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ra(e,t,n,r)});function no(e){return vi(hne,e)}const gne=P(`ZodUnknown`,(e,t)=>{Nte.init(e,t),Ka.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function R(){return yi(gne)}const _ne=P(`ZodNever`,(e,t)=>{Pte.init(e,t),Ka.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ia(e,t,n,r)});function vne(e){return bi(_ne,e)}const yne=P(`ZodArray`,(e,t)=>{Fte.init(e,t),Ka.init(e,t),e._zod.processJSONSchema=(t,n,r)=>la(e,t,n,r),e.element=t.element,Ga(e,`ZodArray`,{min(e,t){return this.check(Di(e,t))},nonempty(e){return this.check(Di(1,e))},max(e,t){return this.check(Ei(e,t))},length(e,t){return this.check(Oi(e,t))},unwrap(){return this.element}})});function z(e,t){return Vi(yne,e,t)}const ro=P(`ZodObject`,(e,t)=>{Lte.init(e,t),Ka.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ua(e,t,n,r),pn(e,`shape`,()=>t.shape),Ga(e,`ZodObject`,{keyof(){return H(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:R()})},loose(){return this.clone({...this._zod.def,catchall:R()})},strict(){return this.clone({...this._zod.def,catchall:vne()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return xee(this,e)},safeExtend(e){return See(this,e)},merge(e){return Cee(this,e)},pick(e){return yee(this,e)},omit(e){return bee(this,e)},partial(...e){return wee(po,this,e[0])},required(...e){return Tee(go,this,e[0])}})});function B(e,t){return new ro({type:`object`,shape:e??{},...Cn(t)})}function io(e,t){return new ro({type:`object`,shape:e,catchall:R(),...Cn(t)})}const ao=P(`ZodUnion`,(e,t)=>{Cr.init(e,t),Ka.init(e,t),e._zod.processJSONSchema=(t,n,r)=>da(e,t,n,r),e.options=t.options});function oo(e,t){return new ao({type:`union`,options:e,...Cn(t)})}const bne=P(`ZodDiscriminatedUnion`,(e,t)=>{ao.init(e,t),Rte.init(e,t)});function so(e,t,n){return new bne({type:`union`,options:t,discriminator:e,...Cn(n)})}const xne=P(`ZodIntersection`,(e,t)=>{zte.init(e,t),Ka.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fa(e,t,n,r)});function co(e,t){return new xne({type:`intersection`,left:e,right:t})}const lo=P(`ZodRecord`,(e,t)=>{Bte.init(e,t),Ka.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pa(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function V(e,t,n){return!t||!t._zod?new lo({type:`record`,keyType:F(),valueType:e,...Cn(t)}):new lo({type:`record`,keyType:e,valueType:t,...Cn(n)})}const uo=P(`ZodEnum`,(e,t)=>{Vte.init(e,t),Ka.init(e,t),e._zod.processJSONSchema=(t,n,r)=>aa(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new uo({...t,checks:[],...Cn(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new uo({...t,checks:[],...Cn(r),entries:i})}});function H(e,t){return new uo({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...Cn(t)})}const Sne=P(`ZodLiteral`,(e,t)=>{Hte.init(e,t),Ka.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oa(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,`value`,{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function U(e,t){return new Sne({type:`literal`,values:Array.isArray(e)?e:[e],...Cn(t)})}const Cne=P(`ZodTransform`,(e,t)=>{Ute.init(e,t),Ka.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ca(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new nn(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(kn(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(kn(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function fo(e){return new Cne({type:`transform`,transform:e})}const po=P(`ZodOptional`,(e,t)=>{Dr.init(e,t),Ka.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xa(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function mo(e){return new po({type:`optional`,innerType:e})}const wne=P(`ZodExactOptional`,(e,t)=>{Wte.init(e,t),Ka.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xa(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Tne(e){return new wne({type:`optional`,innerType:e})}const Ene=P(`ZodNullable`,(e,t)=>{Gte.init(e,t),Ka.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ma(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ho(e){return new Ene({type:`nullable`,innerType:e})}const Dne=P(`ZodDefault`,(e,t)=>{Kte.init(e,t),Ka.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ga(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function One(e,t){return new Dne({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():bn(t)}})}const kne=P(`ZodPrefault`,(e,t)=>{qte.init(e,t),Ka.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_a(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ane(e,t){return new kne({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():bn(t)}})}const go=P(`ZodNonOptional`,(e,t)=>{Jte.init(e,t),Ka.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ha(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function jne(e,t){return new go({type:`nonoptional`,innerType:e,...Cn(t)})}const Mne=P(`ZodCatch`,(e,t)=>{Yte.init(e,t),Ka.init(e,t),e._zod.processJSONSchema=(t,n,r)=>va(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Nne(e,t){return new Mne({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}const _o=P(`ZodPipe`,(e,t)=>{Ar.init(e,t),Ka.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ya(e,t,n,r),e.in=t.in,e.out=t.out});function vo(e,t){return new _o({type:`pipe`,in:e,out:t})}const Pne=P(`ZodPreprocess`,(e,t)=>{_o.init(e,t),Mr.init(e,t)}),Fne=P(`ZodReadonly`,(e,t)=>{Nr.init(e,t),Ka.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ba(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ine(e){return new Fne({type:`readonly`,innerType:e})}const Lne=P(`ZodLazy`,(e,t)=>{Fr.init(e,t),Ka.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Sa(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function yo(e){return new Lne({type:`lazy`,getter:e})}const bo=P(`ZodCustom`,(e,t)=>{Ir.init(e,t),Ka.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sa(e,t,n,r)});function xo(e,t){return Hi(bo,e??(()=>!0),t)}function Rne(e,t={}){return Ui(bo,e,t)}function zne(e,t){return Wi(e,t)}function So(e,t){return new Pne({type:`pipe`,in:fo(e),out:t})}const Bne=io({at:F(),transport:F(),outcome:F(),reference:F().optional(),error:F().optional()}),Vne=io({reason:F(),at:F()});io({version:I().int().catch(1),id:F(),createdAt:F(),bundleLevel:F(),zipBytes:I().int().nonnegative().catch(0),zipDeleted:L().optional(),state:F(),systemWide:L().optional(),projectSlug:F().nullable().optional(),reference:F().optional(),lastError:Vne.optional(),attempts:z(Bne).optional(),note:F().optional()});const Co=[{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]`}],Hne=Co.map(e=>e.name);function wo(e){let t=new Set,n=0;return{redacted:e.split(`
|
|
180
180
|
`).map(e=>{let r=e,i=!1;for(let{name:e,regex:n,replacement:a}of Co)n.lastIndex=0,n.test(r)&&(t.add(e),i=!0,n.lastIndex=0,r=r.replace(n,a));return i&&n++,r}).join(`
|
|
181
|
-
`),patterns:[...t],lineCount:n}}function To(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Do(e.position):`start`in e||`end`in e?Do(e):`line`in e||`column`in e?Eo(e):``}function Eo(e){return Oo(e&&e.line)+`:`+Oo(e&&e.column)}function Do(e){return Eo(e&&e.start)+`-`+Eo(e&&e.end)}function Oo(e){return e&&typeof e==`number`?e:1}var ko=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=To(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};ko.prototype.file=``,ko.prototype.name=``,ko.prototype.reason=``,ko.prototype.message=``,ko.prototype.stack=``,ko.prototype.column=void 0,ko.prototype.line=void 0,ko.prototype.ancestors=void 0,ko.prototype.cause=void 0,ko.prototype.fatal=void 0,ko.prototype.place=void 0,ko.prototype.ruleId=void 0,ko.prototype.source=void 0;const Une=[`off`,`follow`,`full`],Ao=`pull`,jo=[`off`,`follow`,`full`,Ao],Wne=[`follow`,`full`,Ao],Gne=new Set(Object.keys({sh:`bash`,zsh:`bash`,bash:`bash`,c:`c`,cc:`cpp`,cpp:`cpp`,cxx:`cpp`,"c++":`cpp`,h:`c`,hh:`cpp`,hpp:`cpp`,cs:`csharp`,css:`css`,less:`less`,scss:`scss`,sass:`scss`,diff:`diff`,patch:`diff`,feature:`gherkin`,go:`go`,gql:`graphql`,graphql:`graphql`,ini:`ini`,cfg:`ini`,conf:`ini`,properties:`ini`,java:`java`,js:`javascript`,jsx:`javascript`,mjs:`javascript`,cjs:`javascript`,json:`json`,jsonc:`json`,kt:`kotlin`,kts:`kotlin`,lua:`lua`,makefile:`makefile`,md:`markdown`,mdx:`markdown`,m:`objectivec`,mm:`objectivec`,pl:`perl`,pm:`perl`,php:`php`,phtml:`php`,py:`python`,pyi:`python`,pyx:`python`,r:`r`,rb:`ruby`,rs:`rust`,sql:`sql`,swift:`swift`,ts:`typescript`,tsx:`typescript`,xml:`xml`,yaml:`yaml`,yml:`yaml`})),Kne=new Set([`md`,`mdx`,`mmd`,`mermaid`]);new Set([...Gne,`txt`,`text`,`csv`,`tsv`,`log`,`toml`,`html`,`htm`,`svg`,`vue`,`svelte`,`astro`,`lock`].filter(e=>!Kne.has(e)));const Mo=[`image/jpeg`,`image/png`,`image/gif`,`image/webp`,`image/svg+xml`],qne=[`video/mp4`,`video/webm`,`video/ogg`],Jne=[`audio/mpeg`,`audio/wav`,`audio/ogg`],Yne=[`application/pdf`],No=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`avif`,`svg`]),Po=new Set([`mp4`,`webm`,`mov`,`m4v`,`mkv`]),Xne=new Set([`pdf`]),Fo=new Set([`mp3`,`wav`,`ogg`,`m4a`,`flac`,`aac`,`opus`]),Io=new Set(`pdf.docx.xlsx.pptx.doc.xls.ppt.zip.7z.tar.gz.rar.csv.tsv.rtf.json.yaml.yml.xml.txt.pages.numbers.key.odt.ods.odp.epub.mobi`.split(`.`)),Lo=new Set(`png.jpg.jpeg.gif.webp.avif.svg.apng.heic.heif.tiff.bmp.ico.pdf.mp4.webm.mov.m4v.mkv.avi.flv.wmv.mpeg.mpg.mp3.wav.ogg.m4a.flac.aac.opus.zip.7z.tar.gz.rar.woff.woff2.ttf.otf.eot.docx.xlsx.pptx.doc.xls.ppt.odt.ods.odp.pages.numbers.key.epub.mobi.csv.tsv.txt.rtf.json.yaml.yml.xml.toml.lock.gpx.html.htm`.split(`.`)),Zne=new Set(`png.jpg.jpeg.gif.webp.avif.apng.heic.heif.tiff.bmp.ico.svg.pdf.mp4.webm.mov.m4v.mkv.mp3.wav.ogg.m4a.flac.aac.opus.json.toml.lock`.split(`.`)),Ro=new Set(`png.jpg.jpeg.gif.webp.avif.svg.pdf.mp4.webm.mov.m4v.mkv.mp3.wav.ogg.m4a.flac.aac.opus.docx.xlsx.pptx.doc.xls.ppt.zip.7z.tar.gz.rar.csv.tsv.rtf.json.yaml.yml.xml.txt.pages.numbers.key.odt.ods.odp.epub.mobi`.split(`.`)),zo=[`png`,`jpg`,`jpeg`,`gif`,`webp`,`avif`],Bo=[`mp4`,`webm`,`mov`,`m4v`],Vo=[`mp3`,`wav`,`ogg`,`m4a`,`flac`,`aac`,`opus`],Ho=[`pdf`],Uo=[`json`,`toml`,`lock`];function Wo(e,t,n){for(let r of t)if(!n.has(r))throw Error(`${e}: ${r} is not present in canonical upload constants`)}Wo(`SIDEBAR_IMAGE_ASSET_EXTENSIONS`,zo,No),Wo(`SIDEBAR_VIDEO_ASSET_EXTENSIONS`,Bo,Po),Wo(`SIDEBAR_AUDIO_ASSET_EXTENSIONS`,Vo,Fo),Wo(`SIDEBAR_PDF_ASSET_EXTENSIONS`,Ho,Xne),Wo(`FILE_ATTACHMENT_EXTENSIONS`,[...Io],Ro),Wo(`WIKI_EMBED_EXTENSIONS`,[...Ro],Lo),new Set(zo),new Set(Bo),new Set(Vo),new Set(Ho),new Set(Uo),Wo(`SIDEBAR_RENDERABLE_ASSET_EXTENSIONS`,[...new Set([...zo,...Bo,...Vo,...Ho,...Uo])],Zne);const Qne=new Set([`base`,`canvas`]),$ne=new Set([`mmd`,`mermaid`]),Go=new Set([...Lo,...Qne,...$ne]),Ko=[`en`,`zh-Hans`,`zh-Hant`,`hi`,`es`,`ar`,`fr`,`bn`,`pt-BR`,`id`,`ur`,`ko`],ere=new Set([`ar`,`ur`]),tre=Ko.filter(e=>!ere.has(e)),nre=[`off`,`warning`,`error`],qo=`warning`,rre=[`error`,`warning`],Jo=[`base00`,`base01`,`base02`,`base03`,`base04`,`base05`,`base06`,`base07`,`base08`,`base09`,`base0A`,`base0B`,`base0C`,`base0D`,`base0E`,`base0F`],ire={base00:`default background`,base01:`alt background — cards, popovers, sidebar`,base02:`selection background, borders`,base03:`comments, invisibles`,base04:`secondary text`,base05:`default foreground`,base06:`light foreground`,base07:`lightest foreground`,base08:`red — variables, tags, diff deleted`,base09:`orange — numbers, constants`,base0A:`yellow — classes, search highlight`,base0B:`green — strings, diff inserted`,base0C:`cyan — support, escapes, quotes`,base0D:`blue — functions, headings, accent`,base0E:`magenta — keywords, storage`,base0F:`deprecated markers, embedded tags`},are=/\P{White_Space}/u;function ore(e){return are.test(e)}function sre(e){let t=e.palette;return{background:t.base00,foreground:t.base05,card:t.base01,"card-foreground":t.base05,popover:t.base01,"popover-foreground":t.base05,primary:t.base0D,"primary-foreground":t.base00,secondary:t.base01,"secondary-foreground":t.base05,muted:t.base01,"muted-foreground":t.base04,accent:t.base02,"accent-foreground":t.base05,destructive:t.base08,border:t.base02,input:t.base02,ring:t.base0D,"selection-soft":t.base02,"chart-1":t.base0D,"chart-2":t.base0B,"chart-3":t.base0A,"chart-4":t.base0E,"chart-5":t.base08,sidebar:t.base01,"sidebar-foreground":t.base05,"sidebar-primary":t.base0D,"sidebar-primary-foreground":t.base00,"sidebar-accent":t.base02,"sidebar-accent-foreground":t.base0D,"sidebar-hover":t.base02,"sidebar-border":t.base02,"sidebar-ring":t.base0D,"syntax-keyword":t.base0E,"syntax-tag":t.base08,"syntax-attr":t.base0D,"syntax-string":t.base0B,"syntax-number":t.base09,"syntax-atom":t.base0C,"syntax-comment":t.base03,"syntax-func":t.base0D,"syntax-var":t.base08,"syntax-type":t.base0A,"syntax-operator":t.base05,"syntax-meta":t.base0F,"syntax-bg":t.base01,"link-color":t.base0D,"broken-link-color":t.base08,"lint-warning-color":t.base0A,"lint-error-color":t.base08,"diff-added":t.base0B,"diff-removed":t.base08,"callout-note-color":t.base0D,"callout-info-color":t.base0D,"callout-todo-color":t.base0D,"callout-abstract-color":t.base0C,"callout-tip-color":t.base0B,"callout-success-color":t.base0B,"callout-important-color":t.base0E,"callout-example-color":t.base0E,"callout-question-color":t.base0E,"callout-warning-color":t.base0A,"callout-caution-color":t.base09,"callout-danger-color":t.base09,"callout-failure-color":t.base08,"callout-bug-color":t.base08,"callout-quote-color":t.base03,...lre(t)}}const Yo={black:`base00`,red:`base08`,green:`base0B`,yellow:`base0A`,blue:`base0D`,magenta:`base0E`,cyan:`base0C`,white:`base05`,brightBlack:`base03`,brightRed:`base08`,brightGreen:`base0B`,brightYellow:`base0A`,brightBlue:`base0D`,brightMagenta:`base0E`,brightCyan:`base0C`,brightWhite:`base07`},cre=Object.keys(Yo);function lre(e){let t={};for(let n of cre)t[`ansi-${ure(n)}`]=e[Yo[n]];return t}function ure(e){return e.replace(/([a-z])([A-Z])/g,`$1-$2`).toLowerCase()}const dre={name:`Dracula`,author:`clach04 (https://github.com/clach04)`,variant:`dark`,palette:{base00:`#282a36`,base01:`#21222c`,base02:`#44475a`,base03:`#6272a4`,base04:`#9ea8c7`,base05:`#f8f8f2`,base06:`#f8f8f2`,base07:`#ffffff`,base08:`#ff5555`,base09:`#ffb86c`,base0A:`#f1fa8c`,base0B:`#50fa7b`,base0C:`#8be9fd`,base0D:`#bd93f9`,base0E:`#ff79c6`,base0F:`#993333`}},fre={name:`Catppuccin Frappé`,author:`https://github.com/catppuccin/catppuccin`,variant:`dark`,palette:{base00:`#303446`,base01:`#292c3c`,base02:`#414559`,base03:`#51576d`,base04:`#626880`,base05:`#c6d0f5`,base06:`#f2d5cf`,base07:`#babbf1`,base08:`#e78284`,base09:`#ef9f76`,base0A:`#e5c890`,base0B:`#a6d189`,base0C:`#81c8be`,base0D:`#8caaee`,base0E:`#ca9ee6`,base0F:`#eebebe`}},pre={name:`Catppuccin Latte`,author:`https://github.com/catppuccin/catppuccin`,variant:`light`,palette:{base00:`#eff1f5`,base01:`#e6e9ef`,base02:`#ccd0da`,base03:`#bcc0cc`,base04:`#acb0be`,base05:`#4c4f69`,base06:`#dc8a78`,base07:`#7287fd`,base08:`#d20f39`,base09:`#fe640b`,base0A:`#df8e1d`,base0B:`#40a02b`,base0C:`#179299`,base0D:`#1e66f5`,base0E:`#8839ef`,base0F:`#dd7878`}},mre={name:`Monokai`,author:`Wimer Hazenberg (http://www.monokai.nl)`,variant:`dark`,palette:{base00:`#272822`,base01:`#383830`,base02:`#49483e`,base03:`#75715e`,base04:`#a59f85`,base05:`#f8f8f2`,base06:`#f5f4f1`,base07:`#f9f8f5`,base08:`#f92672`,base09:`#fd971f`,base0A:`#f4bf75`,base0B:`#a6e22e`,base0C:`#a1efe4`,base0D:`#66d9ef`,base0E:`#ae81ff`,base0F:`#cc6633`}},hre={name:`Gruvbox dark, medium`,author:`Dawid Kurek, morhetz (https://github.com/morhetz/gruvbox)`,variant:`dark`,palette:{base00:`#282828`,base01:`#3c3836`,base02:`#504945`,base03:`#665c54`,base04:`#bdae93`,base05:`#d5c4a1`,base06:`#ebdbb2`,base07:`#fbf1c7`,base08:`#fb4934`,base09:`#fe8019`,base0A:`#fabd2f`,base0B:`#b8bb26`,base0C:`#8ec07c`,base0D:`#83a598`,base0E:`#d3869b`,base0F:`#d65d0e`}},gre={name:`Solarized Dark`,author:`Ethan Schoonover (modified by aramisgithub)`,variant:`dark`,palette:{base00:`#002b36`,base01:`#073642`,base02:`#586e75`,base03:`#657b83`,base04:`#839496`,base05:`#93a1a1`,base06:`#eee8d5`,base07:`#fdf6e3`,base08:`#dc322f`,base09:`#cb4b16`,base0A:`#b58900`,base0B:`#859900`,base0C:`#2aa198`,base0D:`#268bd2`,base0E:`#6c71c4`,base0F:`#d33682`}};function Xo(e,t,n){return{id:e,label:t,kind:n.variant,scheme:n,toTokens:()=>sre(n)}}function Zo(e,t){return{id:e,label:t,kind:`system`}}const Qo=[Zo(`default`,`Default`),Xo(`dracula`,`Dracula`,dre),Xo(`catppuccin-frappe`,`Catppuccin Frappé`,fre),Xo(`catppuccin-latte`,`Catppuccin Latte`,pre),Xo(`monokai`,`Monokai`,mre),Xo(`gruvbox`,`Gruvbox`,hre),Xo(`solarized`,`Solarized`,gre),Zo(`custom`,`Custom`)],_re=Qo.map(e=>e.id),$o=/^[a-z0-9-]{1,32}$/;new Map(Qo.map(e=>[e.id,e]));const es=Symbol.for(`@inkeep/open-knowledge/field-registry`),ts=globalThis;ts[es]===void 0&&(ts[es]=Br());const ns=ts[es];function vre(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=yre(t)?ns.get(t):void 0;if(e!==void 0)return e;let n=t._zod?.def?.innerType;if(n===void 0)return;t=n}}function yre(e){return typeof e==`object`&&!!e&&`_zod`in e&&`parse`in e}function bre(){return Object.fromEntries(Jo.map(e=>[e,F().register(ns,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Custom theme: base16 ${e} — ${ire[e]}, as a #rrggbb hex string.`}).optional()]))}function rs(){return _re.filter(e=>e!==`default`&&e!==`custom`).map(e=>`'${e}'`).join(`, `)}const is=Object.freeze([`authorization`,`auth.token`,`auth.bearer`,`cookie`,`set-cookie`,`x-api-key`,`password`,`secret`]),as=52428800,ss=26214400,cs=12582912,ls=`https://api.openai.com/v1`,us=`text-embedding-3-small`,ds=Object.freeze([`127.0.0.1`]),xre=/^[1-9]\d*(s|m|h)$/,fs=/^https?:\/\//;function ps(e){let t=e.trim();return t===``?`./`:t}function ms(e){let t=ps(e);return t.includes(`\0`)||t.includes(`\\`)?!1:t===`/`?!0:!(t.startsWith(`/`)||/^[A-Za-z]:/.test(t)||t.split(`/`).some(e=>e===`..`))}const hs=io({content:io({dir:F().register(ns,{scope:`project`,agentSettable:!1,reload:`boot`,defaultScope:`project`,description:`Folder OpenKnowledge reads and writes documents under, relative to the project root (the folder that contains .ok/). Defaults to the project root. Exclude paths with .okignore. Read at server start; changing it requires a restart.`}).default(`.`),attachmentFolderPath:F().register(ns,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Where pasted and dropped assets are stored, relative to the content root. './' colocates beside the current document (default); '/' targets the content root; './subdir' targets a subfolder under the current document folder; 'folder' targets a fixed folder under the content root. Whitespace-only values are treated as './'.`}).refine(ms,{message:`Invalid attachment folder path: must not contain '..' segments, NUL bytes, backslashes, or OS absolute paths (use '/' for the content root).`}).default(`./`)}).default({dir:`.`,attachmentFolderPath:`./`}),appearance:io({theme:H([`light`,`dark`,`system`]).register(ns,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Editor color theme: 'light', 'dark', or 'system' (follow the OS). A personal preference (user scope) — not shared with the project.`}).optional(),language:H([`system`,...Ko]).register(ns,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Interface language. 'system' follows the operating system. A personal preference (user scope) — not shared with the project, and never applied to document content.`}).optional(),colorThemeLight:F().register(ns,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`IDE color palette applied in light mode: 'default' (no palette), 'custom' (your own colors from appearance.customTheme), one of ${rs()}, or the id of a saved theme. A short id of lowercase letters, digits, and hyphens (max 32 characters); an id no palette matches falls back to 'default' for this mode only, leaving the rest of your config untouched. A personal preference (user scope) — not shared with the project.`}).regex($o,{message:`Theme id must be lowercase letters, digits, and hyphens, 1–32 characters (e.g. 'dracula', 'custom', or a saved theme id).`}).optional(),colorThemeDark:F().register(ns,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`IDE color palette applied in dark mode: 'default' (no palette), 'custom' (your own colors from appearance.customTheme), one of ${rs()}, or the id of a saved theme. A short id of lowercase letters, digits, and hyphens (max 32 characters); an id no palette matches falls back to 'default' for this mode only, leaving the rest of your config untouched. A personal preference (user scope) — not shared with the project.`}).regex($o,{message:`Theme id must be lowercase letters, digits, and hyphens, 1–32 characters (e.g. 'dracula', 'custom', or a saved theme id).`}).optional(),colorTheme:F().register(ns,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Superseded by appearance.colorThemeLight / appearance.colorThemeDark. Read as the palette for both modes while neither of those is set. A short theme id (lowercase letters, digits, and hyphens; max 32 characters); an id no palette matches falls back to 'default'. A personal preference (user scope) — not shared with the project.`}).regex($o,{message:`Theme id must be lowercase letters, digits, and hyphens, 1–32 characters (e.g. 'dracula', 'custom', or a saved theme id).`}).optional(),colorThemeEnabled:L().register(ns,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Whether the Themes plugin appears in Settings → Plugins. A personal preference (user scope). Default on.`}).optional(),customTheme:io({name:F().register(ns,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Custom theme: the scheme's display name.`}).optional(),author:F().register(ns,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Custom theme: the scheme's author credit, carried through from an imported base16 scheme.`}).optional(),variant:H([`dark`,`light`]).register(ns,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Custom theme: whether the scheme is 'dark' or 'light'. Auto-detected from the palette when omitted.`}).optional(),...bre()}).optional(),preview:io({autoOpen:L().register(ns,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`When on, the agent opens or refreshes the live preview after each edit. Turn off if you manage your own preview window. A personal preference (user scope).`}).default(!0)}).default({autoOpen:!0}),sidebar:io({showHiddenFiles:L().register(ns,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Show dot-prefixed entries (e.g. .ok/, .okignore) in the file tree. Per-machine (project-local) — not shared with collaborators.`}).default(!1),showOnlyMarkdownFiles:L().register(ns,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Show only markdown documents (.md/.mdx) and folders in the file tree, hiding other file types from view. View-only: hidden files stay on disk and remain reachable via links and search. Per-machine (project-local) — not shared with collaborators.`}).default(!1),showSkillsSection:L().register(ns,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Show the Skills section in the sidebar. Skill documents remain reachable via links and search while the section is hidden. Per-machine (project-local) — not shared with collaborators.`}).default(!0),showOkFolders:L().register(ns,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Show .ok folders (skills, templates, and other OpenKnowledge-managed state) in the file tree as read-only entries. .ok/worktrees and .ok/local never appear. Per-machine (project-local) — not shared with collaborators.`}).default(!1)}).optional()}).default({preview:{autoOpen:!0}}),editor:io({wordWrap:L().register(ns,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Soft-wrap long lines in the source (CodeMirror) editor. A personal preference (user scope).`}).default(!0),previewTabs:L().register(ns,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Reuse one tab when clicking through the Files and Skills sidebars, the way an editor preview tab works. Turn off to open every click in its own tab. Pinned tabs keep their own tab either way. A personal preference (user scope).`}).default(!0)}).default({wordWrap:!0,previewTabs:!0}),agents:io({autoApproveOkTools:L().register(ns,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:"Auto-approve OpenKnowledge's own tools (and `ok open` on Claude) for agents launched from the built-in terminal. Destructive tools (delete/move/share/install) still prompt. Per-machine personal preference (user scope)."}).default(!0)}).default({autoApproveOkTools:!0}),autoSync:io({mode:H(jo).register(ns,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`How this machine syncs this project with its git remote: 'off' (no sync), 'follow' (one-directional — pull remote changes, never push your own; 'pull' is accepted as a legacy alias), or 'full' (bidirectional pull and push). null = not chosen yet (onboarding asks). Per-machine (project-local) — not shared. Supersedes the legacy autoSync.enabled boolean.`}).nullable().default(null),enabled:L().register(ns,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Legacy per-machine sync toggle, superseded by autoSync.mode. Read only when mode is absent (true = full, false = off). null = not chosen yet. Per-machine (project-local) — not shared.`}).nullable().default(null),resumeMode:H(Wne).register(ns,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`When sync is paused (autoSync.mode 'off') after having been enabled, the active mode to resume into ('follow' | 'full'). Per-machine UI memory; ignored while a mode is active. Not shared.`}).optional(),default:oo([L(),H(jo)]).register(ns,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Committed project default for a machine's sync mode on first open: 'off' | 'follow' | 'full', or the legacy boolean (true = full, false = off). null = ask (show the onboarding prompt). Shared via git. A per-machine autoSync.mode choice overrides it.`}).nullable().default(null)}).default({mode:null,enabled:null,default:null}),terminal:io({enabled:L().register(ns,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Opt-out for the in-app terminal (a real OS shell at full user privilege). The terminal is on by default; set false to disable it for this project on this machine. Per-machine (project-local) — never shared via git, clone, or sync.`}).nullable().default(null)}).default({enabled:null}),slides:io({enabled:L().register(ns,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:"Whether the Slides plugin appears in Settings → Plugins. When on, a document whose frontmatter has `slides: true` offers an action that opens the deck in a dedicated window (desktop only, requires a resolvable slidev). A personal preference (user scope). Default off."}).default(!1)}).default({enabled:!1}),telemetry:io({localSink:io({enabled:L().register(ns,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:"Write local diagnostic spans + logs under .ok/local/ for `ok diagnose bundle`. Local-only — never leaves the machine until you run bundle. Set false for sensitive workspaces. Shared across collaborators."}).default(!0),spans:io({maxBytes:I().register(ns,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Maximum size, in bytes, of the local diagnostic spans file before it rotates (default ~50 MB).`}).default(as)}).default({maxBytes:as}),logs:io({maxBytes:I().register(ns,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Maximum size, in bytes, of the local diagnostic logs file before it rotates (default ~25 MB).`}).default(ss)}).default({maxBytes:ss}),attributeDenylist:z(F()).register(ns,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Telemetry attribute keys whose values are redacted before any local span/log is written (credential / secret guard). Extends the built-in denylist.`}).default([...is])}).default({enabled:!0,spans:{maxBytes:as},logs:{maxBytes:ss},attributeDenylist:[...is]}),skillInstallReports:io({enabled:L().register(ns,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Report skill installs to skills.sh so a published skill shows an accurate install count. Sends the skill name, its source repo, and which agent tools it was installed for — never file contents, and never for a private or local source. One report per skill per machine. Default on; the DO_NOT_TRACK and DISABLE_TELEMETRY environment variables also turn it off.`}).default(!0)}).default({enabled:!0})}).default({localSink:{enabled:!0,spans:{maxBytes:as},logs:{maxBytes:ss},attributeDenylist:[...is]},skillInstallReports:{enabled:!0}}),lossCapture:io({enabled:L().register(ns,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:"Record bridge loss-class events (content-free) under .ok/local/loss-capture/ for `ok diagnose bundle`. Local-only — never leaves the machine until you run bundle. Set false for sensitive workspaces. Shared across collaborators."}).default(!0),maxBytes:I().register(ns,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Maximum size, in bytes, of the local loss-capture file before it rotates (default ~12 MB).`}).default(cs)}).default({enabled:!0,maxBytes:cs}),bridge:io({backgroundThrottle:io({enabled:L().register(ns,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Keep the desktop window's timers running at full rate while it holds unsynced work, so backgrounding the app never starves sync or recovery; when the window is idle the OS-default background throttling is restored (battery). Honored by the desktop app. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0}),deferGuard:io({enabled:L().register(ns,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Defer a drain-shaped Observer B re-derive when the WYSIWYG fragment holds an un-propagated keystroke Y.Text lacks, so the keystroke survives instead of being stomped. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0}),lossDetector:io({enabled:L().register(ns,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Detect content the bridge silently dropped at its reconciliation boundary (an Observer-A apply arm or a paired agent-undo derive) and write a recovery checkpoint plus a content-free loss event. Detection only — never blocks a write. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0}),fixedPoint:io({enabled:L().register(ns,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Bound the Y.Text→WYSIWYG re-derive loop with a drain-count backstop: a run of re-derive drains that never reaches a raw-byte fixed point freezes the re-derive loop and writes a recovery checkpoint plus a content-free loss event, instead of churning unbounded. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0}),preDrain:io({enabled:L().register(ns,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Before an agent write or undo rebuilds the WYSIWYG fragment, flush an un-propagated keystroke that provably does not overlap the operation into Y.Text so the keystroke survives instead of needing recovery; overlapping or unmodellable cases fall back to the checkpoint floor. Scope: appending writes and single-frame undos — a write that replaces the whole body (replace / edit) overwrites the keystroke either way, so those always take the checkpoint floor. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0}),flushOnHide:io({enabled:L().register(ns,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`On tab hide/unload, force-send each doc's unsynced work to the server and commit its local cache, and re-sync on return to foreground, so a backgrounded tab never strands edits that IndexedDB alone would lose on recycle. Honored client-side. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0})}).default({backgroundThrottle:{enabled:!0},deferGuard:{enabled:!0},lossDetector:{enabled:!0},fixedPoint:{enabled:!0},preDrain:{enabled:!0},flushOnHide:{enabled:!0}}),search:io({semantic:io({enabled:L().register(ns,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:"Add semantic (embeddings) ranking to the MCP search tool, fused with the lexical engine so conceptually-related pages surface even with no shared keywords. When ON and an API key is set (`ok embeddings set-key`), the search query and matching document content are sent to the configured embeddings provider — content egress. Default OFF. Per-machine (project-local) — not shared with collaborators."}).default(!1),baseUrl:F().register(ns,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:"Base URL of the OpenAI-compatible embeddings API (default https://api.openai.com/v1). Override to point at a self-hosted server (Ollama / vLLM / LM Studio) or another provider. The API key is NOT stored here — set it with `ok embeddings set-key` (`~/.ok/secrets.yml`); it is sent to whichever endpoint this names."}).default(ls),model:F().register(ns,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Embeddings model id (default text-embedding-3-small). Must be served by the provider at baseUrl. Changing it re-embeds the corpus (the cache is keyed by provider + model + dimensions).`}).default(us),dimensions:I().int().positive().register(ns,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Optional output vector dimensions. Omit (recommended) to detect the model's native size from its first response — that is what lets a non-OpenAI model work without knowing its size up front. Set a smaller value (text-embedding-3 supports e.g. 512 / 1024) to shrink the on-disk cache, trading a little retrieval quality; a server that ignores the request param then fails loudly instead of silently. Changing it re-embeds the corpus.`}).optional(),similarityFloor:I().min(0).max(1).register(ns,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Optional hard cutoff: drop any "by meaning" match whose cosine similarity is below this value. Off by default (0) because retrieval is rank-based (the closest pages are returned regardless of absolute score) and the right cutoff is model-specific. Set it only to suppress weak matches for a specific provider/model whose cosine scale you know. Most setups should leave it unset and rely on the result-count cap.`}).optional()}).default({enabled:!1,baseUrl:ls,model:us})}).default({semantic:{enabled:!1,baseUrl:ls,model:us}}),contentRules:io({markdownlint:B({enabled:L().register(ns,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether the markdownlint plugin (body rules) contributes diagnostics.`}).default(!1)}).default({enabled:!1}),frontmatter:B({enabled:L().register(ns,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether the frontmatter plugin (JSON-Schema validation of document frontmatter) contributes diagnostics.`}).default(!1),schemas:z(B({appliesTo:oo([F(),z(F())]).optional(),file:F(),enabled:L().optional()})).register(ns,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Frontmatter schema mappings: which docs (appliesTo globs) validate against which JSON Schema file (project-root-relative path).`}).default([])}).default({enabled:!1,schemas:[]}),okf:B({enabled:L().register(ns,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether the OKF plugin (Open Knowledge Format portability + conformance rules) contributes diagnostics. Advisory warnings; never blocks a write.`}).default(!1),rules:V(F(),L()).register(ns,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Per-rule opt-outs for the OKF plugin, keyed by rule id (e.g. no-wiki-links). Omit a rule to leave it enabled; set false to silence it while keeping the plugin on.`}).optional(),generate:B({index:L().register(ns,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether OK generates and maintains a navigation index.md in every folder that contains Markdown, each listing the documents in that folder grouped by frontmatter type and linking to its subfolders. OK owns these files: edits to them are replaced on the next rebuild.`}).default(!1)}).default({index:!1})}).default({enabled:!1,generate:{index:!1}})}).default({markdownlint:{enabled:!1},frontmatter:{enabled:!1,schemas:[]},okf:{enabled:!1,generate:{index:!1}}}),validation:io({links:H(nre).register(ns,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`How broken internal links are reported on the validation plane: 'off' hides them, 'warning' (default) or 'error' sets their severity.`}).default(qo),fileTreeIndicators:L().register(ns,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether the file tree tints and badges files that have validation problems.`}).default(!0)}).default({links:qo,fileTreeIndicators:!0}),linkPreviews:io({enabled:L().register(ns,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Show a rich preview card (site name, page title, description, favicon) when you hover an external link in the editor. When ON, hovering an external link sends that link's URL to the destination site to fetch its preview metadata — outbound egress, one request per previewed link. Default ON; set to false to turn external previews off. Per-machine (project-local) — not shared with collaborators. Previews of links to other documents in this project are read from the local index with no network request and are always on.`}).default(!0)}).default({enabled:!0}),remote:io({url:F().register(ns,{scope:`project`,agentSettable:!1,reload:`boot`,defaultScope:`project`,description:"Superseded by server.externalUrl — read only while server.externalUrl (and its deprecated server.publicUrl spelling) is absent. Public URL your tunnel gives you, e.g. https://myproject.ngrok.app. Used only with `ok start --remote` (config alone never enables remote access); its host is admitted through the Host-header allowlist. There is no server-side auth, so restrict access at the tunnel (ngrok OAuth, Cloudflare Access, Tailscale ACLs)."}).optional(),port:I().int().min(1).max(65535).register(ns,{scope:`project`,agentSettable:!1,reload:`boot`,defaultScope:`project`,description:`Superseded by server.port — read only while server.port is absent. TCP port the server binds when remote access is enabled (default 24550). Fixed so the tunnel's port mapping survives restarts. Set it only on a conflict. An explicit --port still wins; the PORT env var is ignored in remote mode.`}).optional()}).default({}),server:io({port:I().int().min(1).max(65535).register(ns,{scope:`project`,agentSettable:!1,reload:`boot`,defaultScope:`project`,description:`TCP port the server listens on. Unset by default: a local start picks a free port dynamically, and deployment platforms inject the PORT environment variable instead. Supersedes remote.port (still read while this key is absent). Read at server start; changing it requires a restart.`}).optional(),bind:z(F().min(1)).min(1).register(ns,{scope:`project-local`,agentSettable:!1,reload:`boot`,defaultScope:`project-local`,description:`Addresses the server binds, e.g. [127.0.0.1] or [0.0.0.0]. Default loopback-only ([127.0.0.1]): nothing off this machine can connect. A non-loopback bind additionally requires the server.allowExternal consent interlock. Per-machine (project-local): a value committed to .ok/config.yml is ignored, so one machine exposing the server can never break local clones for the rest of the team — the exposing host sets it via OK_BIND, --bind, or .ok/local/config.yml. Lists replace, never merge. Read at server start; changing it requires a restart.`}).default([...ds]),externalUrl:$a({protocol:/^https?$/}).regex(fs).register(ns,{scope:`project`,agentSettable:!1,reload:`boot`,defaultScope:`project`,description:`Canonical external origin the server is reached at, e.g. https://kb.example.com — its host joins the Host/Origin allowlists (external-Host + CORS admission). Unset by default: the server admits only loopback Hosts. Setting it declares external exposure, which additionally requires the server.allowExternal consent interlock. Supersedes server.publicUrl (its former name) and remote.url — both still read while this key is absent. Read at server start; changing it requires a restart.`}).optional(),publicUrl:$a({protocol:/^https?$/}).regex(fs).register(ns,{scope:`project`,agentSettable:!1,reload:`boot`,defaultScope:`project`,description:`Deprecated alias of server.externalUrl (the former name of that key) — read only while server.externalUrl is absent, with identical semantics. Use server.externalUrl instead; if this config is committed and shared, keep both keys until every collaborator has upgraded (older versions read only server.publicUrl).`}).optional(),allowExternal:L().register(ns,{scope:`project-local`,agentSettable:!1,reload:`boot`,defaultScope:`project-local`,description:`Exposure consent interlock. Once the unified server boot lands, a non-loopback server.bind or a server.externalUrl without allowExternal: true will be refused at boot with a one-line fix. Default off. Per-machine (project-local) — consent never travels via git, clone, or share; containers consent via the environment instead.`}).default(!1),openBrowser:L().register(ns,{scope:`project-local`,agentSettable:!1,reload:`boot`,defaultScope:`project-local`,description:`Open the UI in a browser when the server starts. Default derived: true when every bind address is loopback (a laptop start pops the UI), false otherwise (a container or exposed bind is headless and must never try). Acts once at start. Per-machine (project-local) — not shared.`}).optional(),idleShutdown:oo([U(`off`),F().regex(xre)]).register(ns,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Shut the server down after this long with no activity: a duration like '30m' (positive integer with unit s, m, or h), or 'off'. Default derived: '30m' when every bind address is loopback, 'off' otherwise (an exposed or containerized server stays up). Reloadable — a valid change applies without a restart. Per-machine (project-local) — not shared.`}).optional()}).default({bind:[...ds],allowExternal:!1})});var gs,_s=n((()=>{gs=`1.9.1`}));function Sre(e){let t=new Set([e]),n=new Set,r=e.match(vs);if(!r)return()=>!1;let i={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(i.prerelease!=null)return function(t){return t===e};function a(e){return n.add(e),!1}function o(e){return t.add(e),!0}return function(e){if(t.has(e))return!0;if(n.has(e))return!1;let r=e.match(vs);if(!r)return a(e);let s={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};return s.prerelease!=null||i.major!==s.major?a(e):i.major===0?i.minor===s.minor&&i.patch<=s.patch?o(e):a(e):i.minor<=s.minor?o(e):a(e)}}var vs,ys,Cre=n((()=>{_s(),vs=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/,ys=Sre(gs)}));function bs(e,t,n,r=!1){let i=Ts[ws]=Ts[ws]??{version:gs};if(!r&&i[e]){let t=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return n.error(t.stack||t.message),!1}if(i.version!==`1.9.1`){let t=Error(`@opentelemetry/api: Registration of version v${i.version} for ${e} does not match previously registered API v${gs}`);return n.error(t.stack||t.message),!1}return i[e]=t,n.debug(`@opentelemetry/api: Registered a global for ${e} v${gs}.`),!0}function xs(e){let t=Ts[ws]?.version;if(!(!t||!ys(t)))return Ts[ws]?.[e]}function Ss(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${gs}.`);let n=Ts[ws];n&&delete n[e]}var Cs,ws,Ts,Es=n((()=>{_s(),Cre(),Cs=gs.split(`.`)[0],ws=Symbol.for(`opentelemetry.js.api.${Cs}`),Ts=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{}}));function Ds(e,t,n){let r=xs(`diag`);if(r)return r[e](t,...n)}var Os,wre=n((()=>{Es(),Os=class{constructor(e){this._namespace=e.namespace||`DiagComponentLogger`}debug(...e){return Ds(`debug`,this._namespace,e)}error(...e){return Ds(`error`,this._namespace,e)}info(...e){return Ds(`info`,this._namespace,e)}warn(...e){return Ds(`warn`,this._namespace,e)}verbose(...e){return Ds(`verbose`,this._namespace,e)}}})),ks,As=n((()=>{(function(e){e[e.NONE=0]=`NONE`,e[e.ERROR=30]=`ERROR`,e[e.WARN=50]=`WARN`,e[e.INFO=60]=`INFO`,e[e.DEBUG=70]=`DEBUG`,e[e.VERBOSE=80]=`VERBOSE`,e[e.ALL=9999]=`ALL`})(ks||={})}));function Tre(e,t){e<ks.NONE?e=ks.NONE:e>ks.ALL&&(e=ks.ALL),t||={};function n(n,r){let i=t[n];return typeof i==`function`&&e>=r?i.bind(t):function(){}}return{error:n(`error`,ks.ERROR),warn:n(`warn`,ks.WARN),info:n(`info`,ks.INFO),debug:n(`debug`,ks.DEBUG),verbose:n(`verbose`,ks.VERBOSE)}}var Ere=n((()=>{As()})),js,Ms,Ns=n((()=>{wre(),Ere(),As(),Es(),js=`diag`,Ms=class e{static instance(){return this._instance||=new e,this._instance}constructor(){function e(e){return function(...t){let n=xs(`diag`);if(n)return n[e](...t)}}let t=this;t.setLogger=(e,n={logLevel:ks.INFO})=>{if(e===t){let e=Error(`Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation`);return t.error(e.stack??e.message),!1}typeof n==`number`&&(n={logLevel:n});let r=xs(`diag`),i=Tre(n.logLevel??ks.INFO,e);if(r&&!n.suppressOverrideMessage){let e=Error().stack??`<failed to generate stacktrace>`;r.warn(`Current logger will be overwritten from ${e}`),i.warn(`Current logger will overwrite one already registered from ${e}`)}return bs(`diag`,i,t,!0)},t.disable=()=>{Ss(js,t)},t.createComponentLogger=e=>new Os(e),t.verbose=e(`verbose`),t.debug=e(`debug`),t.info=e(`info`),t.warn=e(`warn`),t.error=e(`error`)}}}));function Dre(e){return Symbol.for(e)}var Ps,Fs,Is=n((()=>{Ps=class e{constructor(t){let n=this;n._currentContext=t?new Map(t):new Map,n.getValue=e=>n._currentContext.get(e),n.setValue=(t,r)=>{let i=new e(n._currentContext);return i._currentContext.set(t,r),i},n.deleteValue=t=>{let r=new e(n._currentContext);return r._currentContext.delete(t),r}}},Fs=new Ps})),Ls,Ore=n((()=>{Is(),Ls=class{active(){return Fs}with(e,t,n,...r){return t.call(n,...r)}bind(e,t){return t}enable(){return this}disable(){return this}}})),Rs,zs,Bs,Vs=n((()=>{Ore(),Es(),Ns(),Rs=`context`,zs=new Ls,Bs=class e{constructor(){}static getInstance(){return this._instance||=new e,this._instance}setGlobalContextManager(e){return bs(Rs,e,Ms.instance())}active(){return this._getContextManager().active()}with(e,t,n,...r){return this._getContextManager().with(e,t,n,...r)}bind(e,t){return this._getContextManager().bind(e,t)}_getContextManager(){return xs(Rs)||zs}disable(){this._getContextManager().disable(),Ss(Rs,Ms.instance())}}})),Hs,Us=n((()=>{(function(e){e[e.NONE=0]=`NONE`,e[e.SAMPLED=1]=`SAMPLED`})(Hs||={})})),Ws,Gs,Ks,qs=n((()=>{Us(),Ws=`0000000000000000`,Gs=`00000000000000000000000000000000`,Ks={traceId:Gs,spanId:Ws,traceFlags:Hs.NONE}})),Js,Ys=n((()=>{qs(),Js=class{constructor(e=Ks){this._spanContext=e}spanContext(){return this._spanContext}setAttribute(e,t){return this}setAttributes(e){return this}addEvent(e,t){return this}addLink(e){return this}addLinks(e){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,t){}}}));function Xs(e){return e.getValue(nc)||void 0}function Zs(){return Xs(Bs.getInstance().active())}function Qs(e,t){return e.setValue(nc,t)}function $s(e){return e.deleteValue(nc)}function ec(e,t){return Qs(e,new Js(t))}function tc(e){return Xs(e)?.spanContext()}var nc,rc=n((()=>{Is(),Ys(),Vs(),nc=Dre(`OpenTelemetry Context Key SPAN`)}));function ic(e,t){if(typeof e!=`string`||e.length!==t)return!1;let n=0;for(let t=0;t<e.length;t+=4)n+=(lc[e.charCodeAt(t)]|0)+(lc[e.charCodeAt(t+1)]|0)+(lc[e.charCodeAt(t+2)]|0)+(lc[e.charCodeAt(t+3)]|0);return n===t}function ac(e){return ic(e,32)&&e!==`00000000000000000000000000000000`}function oc(e){return ic(e,16)&&e!==`0000000000000000`}function sc(e){return ac(e.traceId)&&oc(e.spanId)}function cc(e){return new Js(e)}var lc,uc=n((()=>{qs(),Ys(),lc=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1])}));function dc(e){return typeof e==`object`&&!!e&&`spanId`in e&&typeof e.spanId==`string`&&`traceId`in e&&typeof e.traceId==`string`&&`traceFlags`in e&&typeof e.traceFlags==`number`}var fc,pc,mc=n((()=>{Vs(),rc(),Ys(),uc(),fc=Bs.getInstance(),pc=class{startSpan(e,t,n=fc.active()){if(t?.root)return new Js;let r=n&&tc(n);return dc(r)&&sc(r)?new Js(r):new Js}startActiveSpan(e,t,n,r){let i,a,o;if(arguments.length<2)return;arguments.length===2?o=t:arguments.length===3?(i=t,o=n):(i=t,a=n,o=r);let s=a??fc.active(),c=this.startSpan(e,i,s),l=Qs(s,c);return fc.with(l,o,void 0,c)}}})),hc,gc,_c=n((()=>{mc(),hc=new pc,gc=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}startSpan(e,t,n){return this._getTracer().startSpan(e,t,n)}startActiveSpan(e,t,n,r){let i=this._getTracer();return Reflect.apply(i.startActiveSpan,i,arguments)}_getTracer(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):hc}}})),vc,yc=n((()=>{mc(),vc=class{getTracer(e,t,n){return new pc}}})),bc,xc,Sc=n((()=>{_c(),yc(),bc=new vc,xc=class{getTracer(e,t,n){return this.getDelegateTracer(e,t,n)??new gc(this,e,t,n)}getDelegate(){return this._delegate??bc}setDelegate(e){this._delegate=e}getDelegateTracer(e,t,n){return this._delegate?.getTracer(e,t,n)}}})),Cc,wc=n((()=>{(function(e){e[e.UNSET=0]=`UNSET`,e[e.OK=1]=`OK`,e[e.ERROR=2]=`ERROR`})(Cc||={})})),Tc,Ec=n((()=>{Vs(),Tc=Bs.getInstance()})),Dc,Oc,kc=n((()=>{Es(),Sc(),uc(),rc(),Ns(),Dc=`trace`,Oc=class e{constructor(){this._proxyTracerProvider=new xc,this.wrapSpanContext=cc,this.isSpanContextValid=sc,this.deleteSpan=$s,this.getSpan=Xs,this.getActiveSpan=Zs,this.getSpanContext=tc,this.setSpan=Qs,this.setSpanContext=ec}static getInstance(){return this._instance||=new e,this._instance}setGlobalTracerProvider(e){let t=bs(Dc,this._proxyTracerProvider,Ms.instance());return t&&this._proxyTracerProvider.setDelegate(e),t}getTracerProvider(){return xs(Dc)||this._proxyTracerProvider}getTracer(e,t){return this.getTracerProvider().getTracer(e,t)}disable(){Ss(Dc,Ms.instance()),this._proxyTracerProvider=new xc}}})),Ac,jc=n((()=>{kc(),Ac=Oc.getInstance()})),Mc=n((()=>{Ns(),Is(),As(),_c(),Sc(),wc(),Us(),uc(),qs(),Ec(),jc()}));function Nc(e){let t=e;for(let e=0;e<16;e++){if(t==null||t?._zod?.def?.shape!==void 0)return t;let e=t?._zod?.def?.innerType;if(e===void 0)return t;t=e}return t}function Pc(e,t){let n=e;for(let e of t){n=Nc(n);let t=n?._zod?.def?.shape;if(!t||(n=t[String(e)],n===void 0))return}return n}function Fc(e,t){let n=Pc(e,t);if(n!==void 0)return vre(n)}const Ic=new Map([[`PORT`,[`server`,`port`]],[`OK_BIND`,[`server`,`bind`]],[`OK_EXTERNAL_URL`,[`server`,`externalUrl`]],[`OK_ALLOW_EXTERNAL`,[`server`,`allowExternal`]],[`OK_OPEN_BROWSER`,[`server`,`openBrowser`]],[`OK_IDLE_SHUTDOWN`,[`server`,`idleShutdown`]]]);function Lc(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1_$2`).toUpperCase()}function Rc(e){return`OK_${(e[0]===`server`?e.slice(1):e).map(Lc).join(`_`)}`}function zc(e,t){if(t.length===0)return e.contents??null;let n=e.getIn(t,!0);if((0,Jt.isNode)(n))return n;for(let n=t.length-1;n>=0;n--){let r=e.getIn(t.slice(0,n),!0);if((0,Jt.isNode)(r))return r}return e.contents??null}function Bc(e,t){let n=1,r=1,i=Math.min(t,e.length);for(let t=0;t<i;t++)e.charCodeAt(t)===10?(n++,r=1):r++;return{line:n,column:r}}function Vc(e,t,n,r,i){let a=e.split(`
|
|
181
|
+
`),patterns:[...t],lineCount:n}}function To(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Do(e.position):`start`in e||`end`in e?Do(e):`line`in e||`column`in e?Eo(e):``}function Eo(e){return Oo(e&&e.line)+`:`+Oo(e&&e.column)}function Do(e){return Eo(e&&e.start)+`-`+Eo(e&&e.end)}function Oo(e){return e&&typeof e==`number`?e:1}var ko=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=To(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};ko.prototype.file=``,ko.prototype.name=``,ko.prototype.reason=``,ko.prototype.message=``,ko.prototype.stack=``,ko.prototype.column=void 0,ko.prototype.line=void 0,ko.prototype.ancestors=void 0,ko.prototype.cause=void 0,ko.prototype.fatal=void 0,ko.prototype.place=void 0,ko.prototype.ruleId=void 0,ko.prototype.source=void 0;const Une=[`off`,`follow`,`full`],Ao=`pull`,jo=[`off`,`follow`,`full`,Ao],Wne=[`follow`,`full`,Ao],Gne=new Set(Object.keys({sh:`bash`,zsh:`bash`,bash:`bash`,c:`c`,cc:`cpp`,cpp:`cpp`,cxx:`cpp`,"c++":`cpp`,h:`c`,hh:`cpp`,hpp:`cpp`,cs:`csharp`,css:`css`,less:`less`,scss:`scss`,sass:`scss`,diff:`diff`,patch:`diff`,feature:`gherkin`,go:`go`,gql:`graphql`,graphql:`graphql`,ini:`ini`,cfg:`ini`,conf:`ini`,properties:`ini`,java:`java`,js:`javascript`,jsx:`javascript`,mjs:`javascript`,cjs:`javascript`,json:`json`,jsonc:`json`,kt:`kotlin`,kts:`kotlin`,lua:`lua`,makefile:`makefile`,md:`markdown`,mdx:`markdown`,m:`objectivec`,mm:`objectivec`,pl:`perl`,pm:`perl`,php:`php`,phtml:`php`,py:`python`,pyi:`python`,pyx:`python`,r:`r`,rb:`ruby`,rs:`rust`,sql:`sql`,swift:`swift`,ts:`typescript`,tsx:`typescript`,xml:`xml`,yaml:`yaml`,yml:`yaml`})),Kne=new Set([`md`,`mdx`,`mmd`,`mermaid`]);new Set([...Gne,`txt`,`text`,`csv`,`tsv`,`log`,`toml`,`html`,`htm`,`svg`,`vue`,`svelte`,`astro`,`lock`].filter(e=>!Kne.has(e)));const Mo=[`image/jpeg`,`image/png`,`image/gif`,`image/webp`,`image/svg+xml`],qne=[`video/mp4`,`video/webm`,`video/ogg`],Jne=[`audio/mpeg`,`audio/wav`,`audio/ogg`],Yne=[`application/pdf`],No=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`avif`,`svg`]),Po=new Set([`mp4`,`webm`,`mov`,`m4v`,`mkv`]),Xne=new Set([`pdf`]),Fo=new Set([`mp3`,`wav`,`ogg`,`m4a`,`flac`,`aac`,`opus`]),Io=new Set(`pdf.docx.xlsx.pptx.doc.xls.ppt.zip.7z.tar.gz.rar.csv.tsv.rtf.json.yaml.yml.xml.txt.pages.numbers.key.odt.ods.odp.epub.mobi`.split(`.`)),Lo=new Set(`png.jpg.jpeg.gif.webp.avif.svg.apng.heic.heif.tiff.bmp.ico.pdf.mp4.webm.mov.m4v.mkv.avi.flv.wmv.mpeg.mpg.mp3.wav.ogg.m4a.flac.aac.opus.zip.7z.tar.gz.rar.woff.woff2.ttf.otf.eot.docx.xlsx.pptx.doc.xls.ppt.odt.ods.odp.pages.numbers.key.epub.mobi.csv.tsv.txt.rtf.json.yaml.yml.xml.toml.lock.gpx.html.htm`.split(`.`)),Zne=new Set(`png.jpg.jpeg.gif.webp.avif.apng.heic.heif.tiff.bmp.ico.svg.pdf.mp4.webm.mov.m4v.mkv.mp3.wav.ogg.m4a.flac.aac.opus.json.toml.lock`.split(`.`)),Ro=new Set(`png.jpg.jpeg.gif.webp.avif.svg.pdf.mp4.webm.mov.m4v.mkv.mp3.wav.ogg.m4a.flac.aac.opus.docx.xlsx.pptx.doc.xls.ppt.zip.7z.tar.gz.rar.csv.tsv.rtf.json.yaml.yml.xml.txt.pages.numbers.key.odt.ods.odp.epub.mobi`.split(`.`)),zo=[`png`,`jpg`,`jpeg`,`gif`,`webp`,`avif`],Bo=[`mp4`,`webm`,`mov`,`m4v`],Vo=[`mp3`,`wav`,`ogg`,`m4a`,`flac`,`aac`,`opus`],Ho=[`pdf`],Uo=[`json`,`toml`,`lock`];function Wo(e,t,n){for(let r of t)if(!n.has(r))throw Error(`${e}: ${r} is not present in canonical upload constants`)}Wo(`SIDEBAR_IMAGE_ASSET_EXTENSIONS`,zo,No),Wo(`SIDEBAR_VIDEO_ASSET_EXTENSIONS`,Bo,Po),Wo(`SIDEBAR_AUDIO_ASSET_EXTENSIONS`,Vo,Fo),Wo(`SIDEBAR_PDF_ASSET_EXTENSIONS`,Ho,Xne),Wo(`FILE_ATTACHMENT_EXTENSIONS`,[...Io],Ro),Wo(`WIKI_EMBED_EXTENSIONS`,[...Ro],Lo),new Set(zo),new Set(Bo),new Set(Vo),new Set(Ho),new Set(Uo),Wo(`SIDEBAR_RENDERABLE_ASSET_EXTENSIONS`,[...new Set([...zo,...Bo,...Vo,...Ho,...Uo])],Zne);const Qne=new Set([`base`,`canvas`]),$ne=new Set([`mmd`,`mermaid`]),Go=new Set([...Lo,...Qne,...$ne]),Ko=[`en`,`zh-Hans`,`zh-Hant`,`hi`,`es`,`ar`,`fr`,`bn`,`pt-BR`,`id`,`ur`,`ko`],ere=new Set([`ar`,`ur`]),tre=Ko.filter(e=>!ere.has(e)),nre=[`off`,`warning`,`error`],qo=`warning`,rre=[`error`,`warning`],Jo=[`base00`,`base01`,`base02`,`base03`,`base04`,`base05`,`base06`,`base07`,`base08`,`base09`,`base0A`,`base0B`,`base0C`,`base0D`,`base0E`,`base0F`],ire={base00:`default background`,base01:`alt background — cards, popovers, sidebar`,base02:`selection background, borders`,base03:`comments, invisibles`,base04:`secondary text`,base05:`default foreground`,base06:`light foreground`,base07:`lightest foreground`,base08:`red — variables, tags, diff deleted`,base09:`orange — numbers, constants`,base0A:`yellow — classes, search highlight`,base0B:`green — strings, diff inserted`,base0C:`cyan — support, escapes, quotes`,base0D:`blue — functions, headings, accent`,base0E:`magenta — keywords, storage`,base0F:`deprecated markers, embedded tags`},are=/\P{White_Space}/u;function ore(e){return are.test(e)}function sre(e){let t=e.palette;return{background:t.base00,foreground:t.base05,card:t.base01,"card-foreground":t.base05,popover:t.base01,"popover-foreground":t.base05,primary:t.base0D,"primary-foreground":t.base00,secondary:t.base01,"secondary-foreground":t.base05,muted:t.base01,"muted-foreground":t.base04,accent:t.base02,"accent-foreground":t.base05,destructive:t.base08,border:t.base02,input:t.base02,ring:t.base0D,"selection-soft":t.base02,"chart-1":t.base0D,"chart-2":t.base0B,"chart-3":t.base0A,"chart-4":t.base0E,"chart-5":t.base08,sidebar:t.base01,"sidebar-foreground":t.base05,"sidebar-primary":t.base0D,"sidebar-primary-foreground":t.base00,"sidebar-accent":t.base02,"sidebar-accent-foreground":t.base0D,"sidebar-hover":t.base02,"sidebar-border":t.base02,"sidebar-ring":t.base0D,"syntax-keyword":t.base0E,"syntax-tag":t.base08,"syntax-attr":t.base0D,"syntax-string":t.base0B,"syntax-number":t.base09,"syntax-atom":t.base0C,"syntax-comment":t.base03,"syntax-func":t.base0D,"syntax-var":t.base08,"syntax-type":t.base0A,"syntax-operator":t.base05,"syntax-meta":t.base0F,"syntax-bg":t.base01,"link-color":t.base0D,"broken-link-color":t.base08,"lint-warning-color":t.base0A,"lint-error-color":t.base08,"diff-added":t.base0B,"diff-removed":t.base08,"callout-note-color":t.base0D,"callout-info-color":t.base0D,"callout-todo-color":t.base0D,"callout-abstract-color":t.base0C,"callout-tip-color":t.base0B,"callout-success-color":t.base0B,"callout-important-color":t.base0E,"callout-example-color":t.base0E,"callout-question-color":t.base0E,"callout-warning-color":t.base0A,"callout-caution-color":t.base09,"callout-danger-color":t.base09,"callout-failure-color":t.base08,"callout-bug-color":t.base08,"callout-quote-color":t.base03,...lre(t)}}const Yo={black:`base00`,red:`base08`,green:`base0B`,yellow:`base0A`,blue:`base0D`,magenta:`base0E`,cyan:`base0C`,white:`base05`,brightBlack:`base03`,brightRed:`base08`,brightGreen:`base0B`,brightYellow:`base0A`,brightBlue:`base0D`,brightMagenta:`base0E`,brightCyan:`base0C`,brightWhite:`base07`},cre=Object.keys(Yo);function lre(e){let t={};for(let n of cre)t[`ansi-${ure(n)}`]=e[Yo[n]];return t}function ure(e){return e.replace(/([a-z])([A-Z])/g,`$1-$2`).toLowerCase()}const dre={name:`Dracula`,author:`clach04 (https://github.com/clach04)`,variant:`dark`,palette:{base00:`#282a36`,base01:`#21222c`,base02:`#44475a`,base03:`#6272a4`,base04:`#9ea8c7`,base05:`#f8f8f2`,base06:`#f8f8f2`,base07:`#ffffff`,base08:`#ff5555`,base09:`#ffb86c`,base0A:`#f1fa8c`,base0B:`#50fa7b`,base0C:`#8be9fd`,base0D:`#bd93f9`,base0E:`#ff79c6`,base0F:`#993333`}},fre={name:`Catppuccin Frappé`,author:`https://github.com/catppuccin/catppuccin`,variant:`dark`,palette:{base00:`#303446`,base01:`#292c3c`,base02:`#414559`,base03:`#51576d`,base04:`#626880`,base05:`#c6d0f5`,base06:`#f2d5cf`,base07:`#babbf1`,base08:`#e78284`,base09:`#ef9f76`,base0A:`#e5c890`,base0B:`#a6d189`,base0C:`#81c8be`,base0D:`#8caaee`,base0E:`#ca9ee6`,base0F:`#eebebe`}},pre={name:`Catppuccin Latte`,author:`https://github.com/catppuccin/catppuccin`,variant:`light`,palette:{base00:`#eff1f5`,base01:`#e6e9ef`,base02:`#ccd0da`,base03:`#bcc0cc`,base04:`#acb0be`,base05:`#4c4f69`,base06:`#dc8a78`,base07:`#7287fd`,base08:`#d20f39`,base09:`#fe640b`,base0A:`#df8e1d`,base0B:`#40a02b`,base0C:`#179299`,base0D:`#1e66f5`,base0E:`#8839ef`,base0F:`#dd7878`}},mre={name:`Monokai`,author:`Wimer Hazenberg (http://www.monokai.nl)`,variant:`dark`,palette:{base00:`#272822`,base01:`#383830`,base02:`#49483e`,base03:`#75715e`,base04:`#a59f85`,base05:`#f8f8f2`,base06:`#f5f4f1`,base07:`#f9f8f5`,base08:`#f92672`,base09:`#fd971f`,base0A:`#f4bf75`,base0B:`#a6e22e`,base0C:`#a1efe4`,base0D:`#66d9ef`,base0E:`#ae81ff`,base0F:`#cc6633`}},hre={name:`Gruvbox dark, medium`,author:`Dawid Kurek, morhetz (https://github.com/morhetz/gruvbox)`,variant:`dark`,palette:{base00:`#282828`,base01:`#3c3836`,base02:`#504945`,base03:`#665c54`,base04:`#bdae93`,base05:`#d5c4a1`,base06:`#ebdbb2`,base07:`#fbf1c7`,base08:`#fb4934`,base09:`#fe8019`,base0A:`#fabd2f`,base0B:`#b8bb26`,base0C:`#8ec07c`,base0D:`#83a598`,base0E:`#d3869b`,base0F:`#d65d0e`}},gre={name:`Solarized Dark`,author:`Ethan Schoonover (modified by aramisgithub)`,variant:`dark`,palette:{base00:`#002b36`,base01:`#073642`,base02:`#586e75`,base03:`#657b83`,base04:`#839496`,base05:`#93a1a1`,base06:`#eee8d5`,base07:`#fdf6e3`,base08:`#dc322f`,base09:`#cb4b16`,base0A:`#b58900`,base0B:`#859900`,base0C:`#2aa198`,base0D:`#268bd2`,base0E:`#6c71c4`,base0F:`#d33682`}};function Xo(e,t,n){return{id:e,label:t,kind:n.variant,scheme:n,toTokens:()=>sre(n)}}function Zo(e,t){return{id:e,label:t,kind:`system`}}const Qo=[Zo(`default`,`Default`),Xo(`dracula`,`Dracula`,dre),Xo(`catppuccin-frappe`,`Catppuccin Frappé`,fre),Xo(`catppuccin-latte`,`Catppuccin Latte`,pre),Xo(`monokai`,`Monokai`,mre),Xo(`gruvbox`,`Gruvbox`,hre),Xo(`solarized`,`Solarized`,gre),Zo(`custom`,`Custom`)],_re=Qo.map(e=>e.id),$o=/^[a-z0-9-]{1,32}$/;new Map(Qo.map(e=>[e.id,e]));const es=Symbol.for(`@inkeep/open-knowledge/field-registry`),ts=globalThis;ts[es]===void 0&&(ts[es]=Br());const ns=ts[es];function vre(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=yre(t)?ns.get(t):void 0;if(e!==void 0)return e;let n=t._zod?.def?.innerType;if(n===void 0)return;t=n}}function yre(e){return typeof e==`object`&&!!e&&`_zod`in e&&`parse`in e}function bre(){return Object.fromEntries(Jo.map(e=>[e,F().register(ns,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Custom theme: base16 ${e} — ${ire[e]}, as a #rrggbb hex string.`}).optional()]))}function rs(){return _re.filter(e=>e!==`default`&&e!==`custom`).map(e=>`'${e}'`).join(`, `)}const is=Object.freeze([`authorization`,`auth.token`,`auth.bearer`,`cookie`,`set-cookie`,`x-api-key`,`password`,`secret`]),as=52428800,ss=26214400,cs=12582912,ls=`https://api.openai.com/v1`,us=`text-embedding-3-small`,ds=Object.freeze([`127.0.0.1`]),xre=/^[1-9]\d*(s|m|h)$/,fs=/^https?:\/\//;function ps(e){let t=e.trim();return t===``?`./`:t}function ms(e){let t=ps(e);return t.includes(`\0`)||t.includes(`\\`)?!1:t===`/`?!0:!(t.startsWith(`/`)||/^[A-Za-z]:/.test(t)||t.split(`/`).some(e=>e===`..`))}const hs=io({content:io({dir:F().register(ns,{scope:`project`,agentSettable:!1,reload:`boot`,defaultScope:`project`,description:`Folder OpenKnowledge reads and writes documents under, relative to the project root (the folder that contains .ok/). Defaults to the project root. Exclude paths with .okignore. Read at server start; changing it requires a restart.`}).default(`.`),attachmentFolderPath:F().register(ns,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Where pasted and dropped assets are stored, relative to the content root. './' colocates beside the current document (default); '/' targets the content root; './subdir' targets a subfolder under the current document folder; 'folder' targets a fixed folder under the content root. Whitespace-only values are treated as './'.`}).refine(ms,{message:`Invalid attachment folder path: must not contain '..' segments, NUL bytes, backslashes, or OS absolute paths (use '/' for the content root).`}).default(`./`)}).default({dir:`.`,attachmentFolderPath:`./`}),appearance:io({theme:H([`light`,`dark`,`system`]).register(ns,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Editor color theme: 'light', 'dark', or 'system' (follow the OS). A personal preference (user scope) — not shared with the project.`}).optional(),language:H([`system`,...Ko]).register(ns,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Interface language. 'system' follows the operating system. A personal preference (user scope) — not shared with the project, and never applied to document content.`}).optional(),colorThemeLight:F().register(ns,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`IDE color palette applied in light mode: 'default' (no palette), 'custom' (your own colors from appearance.customTheme), one of ${rs()}, or the id of a saved theme. A short id of lowercase letters, digits, and hyphens (max 32 characters); an id no palette matches falls back to 'default' for this mode only, leaving the rest of your config untouched. A personal preference (user scope) — not shared with the project.`}).regex($o,{message:`Theme id must be lowercase letters, digits, and hyphens, 1–32 characters (e.g. 'dracula', 'custom', or a saved theme id).`}).optional(),colorThemeDark:F().register(ns,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`IDE color palette applied in dark mode: 'default' (no palette), 'custom' (your own colors from appearance.customTheme), one of ${rs()}, or the id of a saved theme. A short id of lowercase letters, digits, and hyphens (max 32 characters); an id no palette matches falls back to 'default' for this mode only, leaving the rest of your config untouched. A personal preference (user scope) — not shared with the project.`}).regex($o,{message:`Theme id must be lowercase letters, digits, and hyphens, 1–32 characters (e.g. 'dracula', 'custom', or a saved theme id).`}).optional(),colorTheme:F().register(ns,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Superseded by appearance.colorThemeLight / appearance.colorThemeDark. Read as the palette for both modes while neither of those is set. A short theme id (lowercase letters, digits, and hyphens; max 32 characters); an id no palette matches falls back to 'default'. A personal preference (user scope) — not shared with the project.`}).regex($o,{message:`Theme id must be lowercase letters, digits, and hyphens, 1–32 characters (e.g. 'dracula', 'custom', or a saved theme id).`}).optional(),colorThemeEnabled:L().register(ns,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Whether the Themes plugin appears in Settings → Plugins. A personal preference (user scope). Default on.`}).optional(),customTheme:io({name:F().register(ns,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Custom theme: the scheme's display name.`}).optional(),author:F().register(ns,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Custom theme: the scheme's author credit, carried through from an imported base16 scheme.`}).optional(),variant:H([`dark`,`light`]).register(ns,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Custom theme: whether the scheme is 'dark' or 'light'. Auto-detected from the palette when omitted.`}).optional(),...bre()}).optional(),preview:io({autoOpen:L().register(ns,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`When on, the agent opens or refreshes the live preview after each edit. Turn off if you manage your own preview window. A personal preference (user scope).`}).default(!0)}).default({autoOpen:!0}),sidebar:io({showHiddenFiles:L().register(ns,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Show dot-prefixed entries (e.g. .ok/, .okignore) in the file tree. Per-machine (project-local) — not shared with collaborators.`}).default(!1),showOnlyMarkdownFiles:L().register(ns,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Show only markdown documents (.md/.mdx) and folders in the file tree, hiding other file types from view. View-only: hidden files stay on disk and remain reachable via links and search. Per-machine (project-local) — not shared with collaborators.`}).default(!1),showSkillsSection:L().register(ns,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Show the Skills section in the sidebar. Skill documents remain reachable via links and search while the section is hidden. Per-machine (project-local) — not shared with collaborators.`}).default(!0),showOkFolders:L().register(ns,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Show .ok folders (skills, templates, and other OpenKnowledge-managed state) in the file tree as read-only entries. .ok/worktrees and .ok/local never appear. Per-machine (project-local) — not shared with collaborators.`}).default(!1)}).optional()}).default({preview:{autoOpen:!0}}),editor:io({wordWrap:L().register(ns,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Soft-wrap long lines in the source (CodeMirror) editor. A personal preference (user scope).`}).default(!0),previewTabs:L().register(ns,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Reuse one tab when clicking through the Files and Skills sidebars, the way an editor preview tab works. Turn off to open every click in its own tab. Pinned tabs keep their own tab either way. A personal preference (user scope).`}).default(!0)}).default({wordWrap:!0,previewTabs:!0}),agents:io({autoApproveOkTools:L().register(ns,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:"Auto-approve OpenKnowledge's own tools (and `ok open` on Claude) for agents launched from the built-in terminal. Destructive tools (delete/move/share/install) still prompt. Per-machine personal preference (user scope)."}).default(!0)}).default({autoApproveOkTools:!0}),autoSync:io({mode:H(jo).register(ns,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`How this machine syncs this project with its git remote: 'off' (no sync), 'follow' (one-directional — pull remote changes, never push your own; 'pull' is accepted as a legacy alias), or 'full' (bidirectional pull and push). null = not chosen yet (onboarding asks). Per-machine (project-local) — not shared. Supersedes the legacy autoSync.enabled boolean.`}).nullable().default(null),enabled:L().register(ns,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Legacy per-machine sync toggle, superseded by autoSync.mode. Read only when mode is absent (true = full, false = off). null = not chosen yet. Per-machine (project-local) — not shared.`}).nullable().default(null),resumeMode:H(Wne).register(ns,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`When sync is paused (autoSync.mode 'off') after having been enabled, the active mode to resume into ('follow' | 'full'). Per-machine UI memory; ignored while a mode is active. Not shared.`}).optional(),default:oo([L(),H(jo)]).register(ns,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Committed project default for a machine's sync mode on first open: 'off' | 'follow' | 'full', or the legacy boolean (true = full, false = off). null = ask (show the onboarding prompt). Shared via git. A per-machine autoSync.mode choice overrides it.`}).nullable().default(null)}).default({mode:null,enabled:null,default:null}),terminal:io({enabled:L().register(ns,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Opt-out for the in-app terminal (a real OS shell at full user privilege). The terminal is on by default; set false to disable it for this project on this machine. Per-machine (project-local) — never shared via git, clone, or sync.`}).nullable().default(null)}).default({enabled:null}),slides:io({enabled:L().register(ns,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:"Whether the Slides plugin appears in Settings → Plugins. When on, a document whose frontmatter has `slides: true` offers an action that opens the deck in a dedicated window (desktop only, requires a resolvable slidev). A personal preference (user scope). Default off."}).default(!1)}).default({enabled:!1}),telemetry:io({localSink:io({enabled:L().register(ns,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:"Write local diagnostic spans + logs under .ok/local/ for `ok diagnose bundle`. Local-only — never leaves the machine until you run bundle. Set false for sensitive workspaces. Shared across collaborators."}).default(!0),spans:io({maxBytes:I().register(ns,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Maximum size, in bytes, of the local diagnostic spans file before it rotates (default ~50 MB).`}).default(as)}).default({maxBytes:as}),logs:io({maxBytes:I().register(ns,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Maximum size, in bytes, of the local diagnostic logs file before it rotates (default ~25 MB).`}).default(ss)}).default({maxBytes:ss}),attributeDenylist:z(F()).register(ns,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Telemetry attribute keys whose values are redacted before any local span/log is written (credential / secret guard). Extends the built-in denylist.`}).default([...is])}).default({enabled:!0,spans:{maxBytes:as},logs:{maxBytes:ss},attributeDenylist:[...is]}),skillInstallReports:io({enabled:L().register(ns,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Report skill installs to skills.sh so a published skill shows an accurate install count. Sends the skill name, its source repo, and which agent tools it was installed for — never file contents, and never for a private or local source. One report per skill per machine. Default on; the DO_NOT_TRACK and DISABLE_TELEMETRY environment variables also turn it off.`}).default(!0)}).default({enabled:!0})}).default({localSink:{enabled:!0,spans:{maxBytes:as},logs:{maxBytes:ss},attributeDenylist:[...is]},skillInstallReports:{enabled:!0}}),lossCapture:io({enabled:L().register(ns,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:"Record bridge loss-class events (content-free) under .ok/local/loss-capture/ for `ok diagnose bundle`. Local-only — never leaves the machine until you run bundle. Set false for sensitive workspaces. Shared across collaborators."}).default(!0),maxBytes:I().register(ns,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Maximum size, in bytes, of the local loss-capture file before it rotates (default ~12 MB).`}).default(cs)}).default({enabled:!0,maxBytes:cs}),bridge:io({backgroundThrottle:io({enabled:L().register(ns,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Keep the desktop window's timers running at full rate while it holds unsynced work, so backgrounding the app never starves sync or recovery; when the window is idle the OS-default background throttling is restored (battery). Honored by the desktop app. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0}),deferGuard:io({enabled:L().register(ns,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Defer a drain-shaped Observer B re-derive when the WYSIWYG fragment holds an un-propagated keystroke Y.Text lacks, so the keystroke survives instead of being stomped. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0}),lossDetector:io({enabled:L().register(ns,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Detect content the bridge silently dropped at its reconciliation boundary (an Observer-A apply arm or a paired agent-undo derive) and write a recovery checkpoint plus a content-free loss event. Detection only — never blocks a write. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0}),fixedPoint:io({enabled:L().register(ns,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Bound the Y.Text→WYSIWYG re-derive loop with a drain-count backstop: a run of re-derive drains that never reaches a raw-byte fixed point freezes the re-derive loop and writes a recovery checkpoint plus a content-free loss event, instead of churning unbounded. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0}),preDrain:io({enabled:L().register(ns,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Before an agent write or undo rebuilds the WYSIWYG fragment, flush an un-propagated keystroke that provably does not overlap the operation into Y.Text so the keystroke survives instead of needing recovery; overlapping or unmodellable cases fall back to the checkpoint floor. Scope: appending writes and single-frame undos — a write that replaces the whole body (replace / edit) overwrites the keystroke either way, so those always take the checkpoint floor. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0}),flushOnHide:io({enabled:L().register(ns,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`On tab hide/unload, force-send each doc's unsynced work to the server and commit its local cache, and re-sync on return to foreground, so a backgrounded tab never strands edits that IndexedDB alone would lose on recycle. Honored client-side. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0})}).default({backgroundThrottle:{enabled:!0},deferGuard:{enabled:!0},lossDetector:{enabled:!0},fixedPoint:{enabled:!0},preDrain:{enabled:!0},flushOnHide:{enabled:!0}}),search:io({semantic:io({enabled:L().register(ns,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:"Add semantic (embeddings) ranking to the MCP search tool, fused with the lexical engine so conceptually-related pages surface even with no shared keywords. When ON and an API key is set (`ok embeddings set-key`), the search query and matching document content are sent to the configured embeddings provider — content egress. Default OFF. Per-machine (project-local) — not shared with collaborators."}).default(!1),baseUrl:F().register(ns,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:"Base URL of the OpenAI-compatible embeddings API (default https://api.openai.com/v1). Override to point at a self-hosted server (Ollama / vLLM / LM Studio) or another provider. The API key is NOT stored here — set it with `ok embeddings set-key` (`~/.ok/secrets.yml`); it is sent to whichever endpoint this names."}).default(ls),model:F().register(ns,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Embeddings model id (default text-embedding-3-small). Must be served by the provider at baseUrl. Changing it re-embeds the corpus (the cache is keyed by provider + model + dimensions).`}).default(us),dimensions:I().int().positive().register(ns,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Optional output vector dimensions. Omit (recommended) to detect the model's native size from its first response — that is what lets a non-OpenAI model work without knowing its size up front. Set a smaller value (text-embedding-3 supports e.g. 512 / 1024) to shrink the on-disk cache, trading a little retrieval quality; a server that ignores the request param then fails loudly instead of silently. Changing it re-embeds the corpus.`}).optional(),similarityFloor:I().min(0).max(1).register(ns,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Optional hard cutoff: drop any "by meaning" match whose cosine similarity is below this value. Off by default (0) because retrieval is rank-based (the closest pages are returned regardless of absolute score) and the right cutoff is model-specific. Set it only to suppress weak matches for a specific provider/model whose cosine scale you know. Most setups should leave it unset and rely on the result-count cap.`}).optional()}).default({enabled:!1,baseUrl:ls,model:us})}).default({semantic:{enabled:!1,baseUrl:ls,model:us}}),contentRules:io({markdownlint:B({enabled:L().register(ns,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether the markdownlint plugin (body rules) contributes diagnostics.`}).default(!1)}).default({enabled:!1}),frontmatter:B({enabled:L().register(ns,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether the frontmatter plugin (JSON-Schema validation of document frontmatter) contributes diagnostics.`}).default(!1),schemas:z(B({appliesTo:oo([F(),z(F())]).optional(),file:F(),enabled:L().optional()})).register(ns,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Frontmatter schema mappings: which docs (appliesTo globs) validate against which JSON Schema file (project-root-relative path).`}).default([])}).default({enabled:!1,schemas:[]}),okf:B({enabled:L().register(ns,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether the OKF plugin (Open Knowledge Format portability + conformance rules) contributes diagnostics. Advisory warnings; never blocks a write.`}).default(!1),rules:V(F(),L()).register(ns,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Per-rule opt-outs for the OKF plugin, keyed by rule id (e.g. no-wiki-links). Omit a rule to leave it enabled; set false to silence it while keeping the plugin on.`}).optional(),generate:B({index:L().register(ns,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether OK generates and maintains a navigation index.md in every folder that contains Markdown, each listing the documents in that folder grouped by frontmatter type and linking to its subfolders. OK owns these files: edits to them are replaced on the next rebuild.`}).default(!1)}).default({index:!1})}).default({enabled:!1,generate:{index:!1}})}).default({markdownlint:{enabled:!1},frontmatter:{enabled:!1,schemas:[]},okf:{enabled:!1,generate:{index:!1}}}),validation:io({links:H(nre).register(ns,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`How broken internal links are reported on the validation plane: 'off' hides them, 'warning' (default) or 'error' sets their severity.`}).default(qo),fileTreeIndicators:L().register(ns,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether the file tree tints and badges files that have validation problems.`}).default(!0)}).default({links:qo,fileTreeIndicators:!0}),linkPreviews:io({enabled:L().register(ns,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Show a rich preview card (site name, page title, description, favicon) when you hover an external link in the editor. When ON, hovering an external link sends that link's URL to the destination site to fetch its preview metadata — outbound egress, one request per previewed link. Default ON; set to false to turn external previews off. Per-machine (project-local) — not shared with collaborators. Previews of links to other documents in this project are read from the local index with no network request and are always on.`}).default(!0)}).default({enabled:!0}),remote:io({url:F().register(ns,{scope:`project`,agentSettable:!1,reload:`boot`,defaultScope:`project`,description:"Superseded by server.externalUrl — read only while server.externalUrl (and its deprecated server.publicUrl spelling) is absent. Public URL your tunnel gives you, e.g. https://myproject.ngrok.app. Used only with `ok start --remote` (config alone never enables remote access); its host is admitted through the Host-header allowlist. There is no server-side auth, so restrict access at the tunnel (ngrok OAuth, Cloudflare Access, Tailscale ACLs)."}).optional(),port:I().int().min(1).max(65535).register(ns,{scope:`project`,agentSettable:!1,reload:`boot`,defaultScope:`project`,description:`Superseded by server.port — read only while server.port is absent. TCP port the server binds when remote access is enabled (default 24550). Fixed so the tunnel's port mapping survives restarts. Set it only on a conflict. An explicit --port still wins; the PORT env var is ignored in remote mode.`}).optional()}).default({}),server:io({port:I().int().min(1).max(65535).register(ns,{scope:`project`,agentSettable:!1,reload:`boot`,defaultScope:`project`,description:`TCP port the server listens on. Unset by default: a local start picks a free port dynamically, and deployment platforms inject the PORT environment variable instead. Supersedes remote.port (still read while this key is absent). Read at server start; changing it requires a restart.`}).optional(),bind:z(F().min(1)).min(1).register(ns,{scope:`project-local`,agentSettable:!1,reload:`boot`,defaultScope:`project-local`,description:`Addresses the server binds, e.g. [127.0.0.1] or [0.0.0.0]. Default loopback-only ([127.0.0.1]): nothing off this machine can connect. A non-loopback bind additionally requires the server.allowExternal consent interlock. Per-machine (project-local): a value committed to .ok/config.yml is ignored, so one machine exposing the server can never break local clones for the rest of the team — the exposing host sets it via OK_BIND, --bind, or .ok/local/config.yml. Lists replace, never merge. Read at server start; changing it requires a restart.`}).default([...ds]),externalUrl:$a({protocol:/^https?$/}).regex(fs).register(ns,{scope:`project`,agentSettable:!1,reload:`boot`,defaultScope:`project`,description:`Canonical external origin the server is reached at, e.g. https://kb.example.com — drives issued URLs and CORS. Unset by default: a loopback server derives http://localhost:<port>. Setting it declares external exposure, which additionally requires the server.allowExternal consent interlock. Supersedes server.publicUrl (its former name) and remote.url — both still read while this key is absent. Read at server start; changing it requires a restart.`}).optional(),publicUrl:$a({protocol:/^https?$/}).regex(fs).register(ns,{scope:`project`,agentSettable:!1,reload:`boot`,defaultScope:`project`,description:`Deprecated alias of server.externalUrl (the former name of that key) — read only while server.externalUrl is absent, with identical semantics. Use server.externalUrl instead; if this config is committed and shared, keep both keys until every collaborator has upgraded (older versions read only server.publicUrl).`}).optional(),allowExternal:L().register(ns,{scope:`project-local`,agentSettable:!1,reload:`boot`,defaultScope:`project-local`,description:`Exposure consent interlock. Once the unified server boot lands, a non-loopback server.bind or a server.externalUrl without allowExternal: true will be refused at boot with a one-line fix. Default off. Per-machine (project-local) — consent never travels via git, clone, or share; containers consent via the environment instead.`}).default(!1),openBrowser:L().register(ns,{scope:`project-local`,agentSettable:!1,reload:`boot`,defaultScope:`project-local`,description:`Open the UI in a browser when the server starts. Default derived: true when every bind address is loopback (a laptop start pops the UI), false otherwise (a container or exposed bind is headless and must never try). Acts once at start. Per-machine (project-local) — not shared.`}).optional(),idleShutdown:oo([U(`off`),F().regex(xre)]).register(ns,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Shut the server down after this long with no activity: a duration like '30m' (positive integer with unit s, m, or h), or 'off'. Default derived: '30m' when every bind address is loopback, 'off' otherwise (an exposed or containerized server stays up). Reloadable — a valid change applies without a restart. Per-machine (project-local) — not shared.`}).optional()}).default({bind:[...ds],allowExternal:!1})});var gs,_s=n((()=>{gs=`1.9.1`}));function Sre(e){let t=new Set([e]),n=new Set,r=e.match(vs);if(!r)return()=>!1;let i={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(i.prerelease!=null)return function(t){return t===e};function a(e){return n.add(e),!1}function o(e){return t.add(e),!0}return function(e){if(t.has(e))return!0;if(n.has(e))return!1;let r=e.match(vs);if(!r)return a(e);let s={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};return s.prerelease!=null||i.major!==s.major?a(e):i.major===0?i.minor===s.minor&&i.patch<=s.patch?o(e):a(e):i.minor<=s.minor?o(e):a(e)}}var vs,ys,Cre=n((()=>{_s(),vs=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/,ys=Sre(gs)}));function bs(e,t,n,r=!1){let i=Ts[ws]=Ts[ws]??{version:gs};if(!r&&i[e]){let t=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return n.error(t.stack||t.message),!1}if(i.version!==`1.9.1`){let t=Error(`@opentelemetry/api: Registration of version v${i.version} for ${e} does not match previously registered API v${gs}`);return n.error(t.stack||t.message),!1}return i[e]=t,n.debug(`@opentelemetry/api: Registered a global for ${e} v${gs}.`),!0}function xs(e){let t=Ts[ws]?.version;if(!(!t||!ys(t)))return Ts[ws]?.[e]}function Ss(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${gs}.`);let n=Ts[ws];n&&delete n[e]}var Cs,ws,Ts,Es=n((()=>{_s(),Cre(),Cs=gs.split(`.`)[0],ws=Symbol.for(`opentelemetry.js.api.${Cs}`),Ts=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{}}));function Ds(e,t,n){let r=xs(`diag`);if(r)return r[e](t,...n)}var Os,wre=n((()=>{Es(),Os=class{constructor(e){this._namespace=e.namespace||`DiagComponentLogger`}debug(...e){return Ds(`debug`,this._namespace,e)}error(...e){return Ds(`error`,this._namespace,e)}info(...e){return Ds(`info`,this._namespace,e)}warn(...e){return Ds(`warn`,this._namespace,e)}verbose(...e){return Ds(`verbose`,this._namespace,e)}}})),ks,As=n((()=>{(function(e){e[e.NONE=0]=`NONE`,e[e.ERROR=30]=`ERROR`,e[e.WARN=50]=`WARN`,e[e.INFO=60]=`INFO`,e[e.DEBUG=70]=`DEBUG`,e[e.VERBOSE=80]=`VERBOSE`,e[e.ALL=9999]=`ALL`})(ks||={})}));function Tre(e,t){e<ks.NONE?e=ks.NONE:e>ks.ALL&&(e=ks.ALL),t||={};function n(n,r){let i=t[n];return typeof i==`function`&&e>=r?i.bind(t):function(){}}return{error:n(`error`,ks.ERROR),warn:n(`warn`,ks.WARN),info:n(`info`,ks.INFO),debug:n(`debug`,ks.DEBUG),verbose:n(`verbose`,ks.VERBOSE)}}var Ere=n((()=>{As()})),js,Ms,Ns=n((()=>{wre(),Ere(),As(),Es(),js=`diag`,Ms=class e{static instance(){return this._instance||=new e,this._instance}constructor(){function e(e){return function(...t){let n=xs(`diag`);if(n)return n[e](...t)}}let t=this;t.setLogger=(e,n={logLevel:ks.INFO})=>{if(e===t){let e=Error(`Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation`);return t.error(e.stack??e.message),!1}typeof n==`number`&&(n={logLevel:n});let r=xs(`diag`),i=Tre(n.logLevel??ks.INFO,e);if(r&&!n.suppressOverrideMessage){let e=Error().stack??`<failed to generate stacktrace>`;r.warn(`Current logger will be overwritten from ${e}`),i.warn(`Current logger will overwrite one already registered from ${e}`)}return bs(`diag`,i,t,!0)},t.disable=()=>{Ss(js,t)},t.createComponentLogger=e=>new Os(e),t.verbose=e(`verbose`),t.debug=e(`debug`),t.info=e(`info`),t.warn=e(`warn`),t.error=e(`error`)}}}));function Dre(e){return Symbol.for(e)}var Ps,Fs,Is=n((()=>{Ps=class e{constructor(t){let n=this;n._currentContext=t?new Map(t):new Map,n.getValue=e=>n._currentContext.get(e),n.setValue=(t,r)=>{let i=new e(n._currentContext);return i._currentContext.set(t,r),i},n.deleteValue=t=>{let r=new e(n._currentContext);return r._currentContext.delete(t),r}}},Fs=new Ps})),Ls,Ore=n((()=>{Is(),Ls=class{active(){return Fs}with(e,t,n,...r){return t.call(n,...r)}bind(e,t){return t}enable(){return this}disable(){return this}}})),Rs,zs,Bs,Vs=n((()=>{Ore(),Es(),Ns(),Rs=`context`,zs=new Ls,Bs=class e{constructor(){}static getInstance(){return this._instance||=new e,this._instance}setGlobalContextManager(e){return bs(Rs,e,Ms.instance())}active(){return this._getContextManager().active()}with(e,t,n,...r){return this._getContextManager().with(e,t,n,...r)}bind(e,t){return this._getContextManager().bind(e,t)}_getContextManager(){return xs(Rs)||zs}disable(){this._getContextManager().disable(),Ss(Rs,Ms.instance())}}})),Hs,Us=n((()=>{(function(e){e[e.NONE=0]=`NONE`,e[e.SAMPLED=1]=`SAMPLED`})(Hs||={})})),Ws,Gs,Ks,qs=n((()=>{Us(),Ws=`0000000000000000`,Gs=`00000000000000000000000000000000`,Ks={traceId:Gs,spanId:Ws,traceFlags:Hs.NONE}})),Js,Ys=n((()=>{qs(),Js=class{constructor(e=Ks){this._spanContext=e}spanContext(){return this._spanContext}setAttribute(e,t){return this}setAttributes(e){return this}addEvent(e,t){return this}addLink(e){return this}addLinks(e){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,t){}}}));function Xs(e){return e.getValue(nc)||void 0}function Zs(){return Xs(Bs.getInstance().active())}function Qs(e,t){return e.setValue(nc,t)}function $s(e){return e.deleteValue(nc)}function ec(e,t){return Qs(e,new Js(t))}function tc(e){return Xs(e)?.spanContext()}var nc,rc=n((()=>{Is(),Ys(),Vs(),nc=Dre(`OpenTelemetry Context Key SPAN`)}));function ic(e,t){if(typeof e!=`string`||e.length!==t)return!1;let n=0;for(let t=0;t<e.length;t+=4)n+=(lc[e.charCodeAt(t)]|0)+(lc[e.charCodeAt(t+1)]|0)+(lc[e.charCodeAt(t+2)]|0)+(lc[e.charCodeAt(t+3)]|0);return n===t}function ac(e){return ic(e,32)&&e!==`00000000000000000000000000000000`}function oc(e){return ic(e,16)&&e!==`0000000000000000`}function sc(e){return ac(e.traceId)&&oc(e.spanId)}function cc(e){return new Js(e)}var lc,uc=n((()=>{qs(),Ys(),lc=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1])}));function dc(e){return typeof e==`object`&&!!e&&`spanId`in e&&typeof e.spanId==`string`&&`traceId`in e&&typeof e.traceId==`string`&&`traceFlags`in e&&typeof e.traceFlags==`number`}var fc,pc,mc=n((()=>{Vs(),rc(),Ys(),uc(),fc=Bs.getInstance(),pc=class{startSpan(e,t,n=fc.active()){if(t?.root)return new Js;let r=n&&tc(n);return dc(r)&&sc(r)?new Js(r):new Js}startActiveSpan(e,t,n,r){let i,a,o;if(arguments.length<2)return;arguments.length===2?o=t:arguments.length===3?(i=t,o=n):(i=t,a=n,o=r);let s=a??fc.active(),c=this.startSpan(e,i,s),l=Qs(s,c);return fc.with(l,o,void 0,c)}}})),hc,gc,_c=n((()=>{mc(),hc=new pc,gc=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}startSpan(e,t,n){return this._getTracer().startSpan(e,t,n)}startActiveSpan(e,t,n,r){let i=this._getTracer();return Reflect.apply(i.startActiveSpan,i,arguments)}_getTracer(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):hc}}})),vc,yc=n((()=>{mc(),vc=class{getTracer(e,t,n){return new pc}}})),bc,xc,Sc=n((()=>{_c(),yc(),bc=new vc,xc=class{getTracer(e,t,n){return this.getDelegateTracer(e,t,n)??new gc(this,e,t,n)}getDelegate(){return this._delegate??bc}setDelegate(e){this._delegate=e}getDelegateTracer(e,t,n){return this._delegate?.getTracer(e,t,n)}}})),Cc,wc=n((()=>{(function(e){e[e.UNSET=0]=`UNSET`,e[e.OK=1]=`OK`,e[e.ERROR=2]=`ERROR`})(Cc||={})})),Tc,Ec=n((()=>{Vs(),Tc=Bs.getInstance()})),Dc,Oc,kc=n((()=>{Es(),Sc(),uc(),rc(),Ns(),Dc=`trace`,Oc=class e{constructor(){this._proxyTracerProvider=new xc,this.wrapSpanContext=cc,this.isSpanContextValid=sc,this.deleteSpan=$s,this.getSpan=Xs,this.getActiveSpan=Zs,this.getSpanContext=tc,this.setSpan=Qs,this.setSpanContext=ec}static getInstance(){return this._instance||=new e,this._instance}setGlobalTracerProvider(e){let t=bs(Dc,this._proxyTracerProvider,Ms.instance());return t&&this._proxyTracerProvider.setDelegate(e),t}getTracerProvider(){return xs(Dc)||this._proxyTracerProvider}getTracer(e,t){return this.getTracerProvider().getTracer(e,t)}disable(){Ss(Dc,Ms.instance()),this._proxyTracerProvider=new xc}}})),Ac,jc=n((()=>{kc(),Ac=Oc.getInstance()})),Mc=n((()=>{Ns(),Is(),As(),_c(),Sc(),wc(),Us(),uc(),qs(),Ec(),jc()}));function Nc(e){let t=e;for(let e=0;e<16;e++){if(t==null||t?._zod?.def?.shape!==void 0)return t;let e=t?._zod?.def?.innerType;if(e===void 0)return t;t=e}return t}function Pc(e,t){let n=e;for(let e of t){n=Nc(n);let t=n?._zod?.def?.shape;if(!t||(n=t[String(e)],n===void 0))return}return n}function Fc(e,t){let n=Pc(e,t);if(n!==void 0)return vre(n)}const Ic=new Map([[`PORT`,[`server`,`port`]],[`OK_BIND`,[`server`,`bind`]],[`OK_EXTERNAL_URL`,[`server`,`externalUrl`]],[`OK_ALLOW_EXTERNAL`,[`server`,`allowExternal`]],[`OK_OPEN_BROWSER`,[`server`,`openBrowser`]],[`OK_IDLE_SHUTDOWN`,[`server`,`idleShutdown`]]]);function Lc(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1_$2`).toUpperCase()}function Rc(e){return`OK_${(e[0]===`server`?e.slice(1):e).map(Lc).join(`_`)}`}function zc(e,t){if(t.length===0)return e.contents??null;let n=e.getIn(t,!0);if((0,Jt.isNode)(n))return n;for(let n=t.length-1;n>=0;n--){let r=e.getIn(t.slice(0,n),!0);if((0,Jt.isNode)(r))return r}return e.contents??null}function Bc(e,t){let n=1,r=1,i=Math.min(t,e.length);for(let t=0;t<i;t++)e.charCodeAt(t)===10?(n++,r=1):r++;return{line:n,column:r}}function Vc(e,t,n,r,i){let a=e.split(`
|
|
182
182
|
`),o=r-1;if(o<0||o>=a.length)return``;let s=a[o]??``,c=t-(i-1)+s.length,l=Math.max(1,Math.min(n,c)-t),u=[],d=String(o+2).length;for(let e=Math.max(0,o-1);e<=Math.min(a.length-1,o+1);e++){let t=e===o,n=t?`>`:` `,r=String(e+1).padStart(d,` `);if(u.push(`${n} ${r} | ${a[e]??``}`),t){let e=` `.repeat(2+d+3+i-1);u.push(`${e}${`^`.repeat(l)}`)}}return u.join(`
|
|
183
183
|
`)}function Hc(e){let t=zc(e.doc,e.path);if(!t)return;let n=t.range;if(!n)return;let[r,,i=r]=n,{line:a,column:o}=Bc(e.source,r),s=(0,Jt.isCollection)(t)?Vc(e.source,r,r+1,a,o):Vc(e.source,r,i,a,o);return{file:e.file,line:a,column:o,snippet:s.length>0?s:void 0}}function Uc(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Wc(e){let{value:t,file:n,source:r,doc:i}=e,a=[],o=(e,t)=>{if(t.length>0){let e=Fc(hs,t);if(e!==void 0){if(e.scope===`project-local`){let e=Rc(t),o;i!=null&&r!=null&&n!=null&&(o=Hc({file:n,source:r,doc:i,path:t})),a.push({path:[...t],...Ic.has(e)?{envVar:e}:{},...o===void 0?{}:{source:o}})}return}}if(Uc(e))for(let[n,r]of Object.entries(e))o(r,[...t,n])};return o(t,[]),a}const Gc=B({file:F(),line:I().int().min(1),column:I().int().min(1),snippet:F().optional()}),Kc=B({path:z(oo([F(),I()])),message:F(),issueCode:F(),params:V(F(),R()).optional(),source:Gc.optional()}),qc=H([`user`,`project`,`project-local`,`either`]),Jc=H([`user`,`project`,`project-local`]),Yc=B({code:U(`YAML_PARSE`),detail:F()}),Xc=B({code:U(`UNREADABLE`),detail:F()}),Zc=B({code:U(`SCHEMA_INVALID`),issues:z(Kc)}),Qc=B({code:U(`REMOVED_KEY`),path:z(F()),redirect:F(),source:Gc.optional()}),$c=so(`code`,[Yc,Zc,Xc,B({code:U(`SCOPE_VIOLATION`),path:z(F()),expectedScope:qc,actualScope:Jc}),B({code:U(`NOT_AGENT_SETTABLE`),path:z(F())}),B({code:U(`MIXED_SCOPE`),paths:z(B({path:z(F()),scope:Jc}))}),Qc,B({code:U(`WRITE_ERROR`),detail:F()}),B({code:U(`OKIGNORE_INVALID`),detail:F(),lineNumber:I().int().min(1).optional()}),B({code:U(`UNKNOWN`),message:F().optional()})]);so(`code`,[Qc,Yc,Zc,Xc]),B({diagnostics:z(so(`code`,[B({code:U(`REMOVED_KEY`),scope:Jc,file:F(),path:z(F()),redirect:F()}),B({code:U(`YAML_PARSE`),scope:Jc,file:F()}),B({code:U(`SCHEMA_INVALID`),scope:Jc,file:F()}),B({code:U(`UNREADABLE`),scope:Jc,file:F()})]))});const el=new Set($c.options.map(e=>e.shape.code.value)),tl=oo([$c,io({code:F(),message:F().optional()})]);function nl(e){return el.has(e.code)}function rl(e){switch(e){case`user`:return`~/.ok/global.yml`;case`project`:return`.ok/config.yml`;case`project-local`:return`.ok/local/config.yml`;case`either`:return`.ok/config.yml or ~/.ok/global.yml`}}function il(e){switch(e){case`user`:return`personal to you, across all projects`;case`project`:return`shared with your team via git`;case`project-local`:return`this machine only, not shared`;case`either`:return`user or project`}}function al(e){if(!nl(e))return e.message??`Unknown error (${e.code}).`;switch(e.code){case`YAML_PARSE`:return`Failed to parse YAML: ${e.detail}`;case`UNREADABLE`:return`Could not read the file: ${e.detail}`;case`SCHEMA_INVALID`:{if(e.issues.length===0)return`Invalid configuration.`;let t=new Map;for(let n of e.issues){let e=n.source?.file??`<no source>`,r=t.get(e)??[];r.push(n),t.set(e,r)}let n=[];for(let[e,r]of t){e===`<no source>`?n.push(`Invalid configuration:`):n.push(`Invalid configuration at ${e}:`);for(let t of r){let r=t.path.length===0?`<root>`:t.path.join(`.`);if(t.source){if(n.push(` ${e}:${t.source.line}:${t.source.column}`),n.push(` ${r}: ${t.message}`),t.source.snippet&&t.source.snippet.length>0)for(let e of t.source.snippet.split(`
|
|
184
184
|
`))n.push(` ${e}`)}else n.push(` ${r}: ${t.message}`)}}return n.join(`
|
|
@@ -263,7 +263,7 @@ ${t.slice(l+2)}`,d+=1;else break}t.push({indent:l,number:parseInt(s,10),content:
|
|
|
263
263
|
`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Fae,this.editor.getAttributes(wC)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=Sy({find:TC,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=Sy({find:TC,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(wC)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[e]}}),Iae=/^\s*(\[([( |x])?\])\s$/,Lae=Iy.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`,U_(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)=>Py(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=W_(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[Sy({find:Iae,type:this.type,getAttributes:e=>({checked:e[e.length-1]===`x`})})]}}),Rae=Iy.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`,U_(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,`
|
|
264
264
|
`):``,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=Ny(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=Ny(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()}}});sy.create({name:`listKit`,addExtensions(){let e=[];return this.options.bulletList!==!1&&e.push(uC.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(dC.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(xC.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(EC.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(Lae.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(Rae.configure(this.options.taskList)),e}});var DC=` `,OC=`\xA0`,zae=Iy.create({name:`paragraph`,priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML({HTMLAttributes:e}){return[`p`,U_(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===DC||n[0].text===DC||n[0].raw===OC||n[0].text===OC)&&r.length===1&&r[0].type===`text`&&(r[0].text===DC||r[0].text===OC)?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?DC:``}return t.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Bae=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,Vae=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,kC=Qv.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`,U_(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[yy({find:Bae,type:this.type})]},addPasteRules(){return[Ly({find:Vae,type:this.type})]}}),Hae=kC,Uae=Iy.create({name:`text`,group:`inline`,parseMarkdown:e=>({type:`text`,text:e.text||``}),renderMarkdown:e=>e.text||``}),AC=Qv.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`,U_(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()}}}),Wae=AC;function Gae(e={}){return new lf({view(t){return new Kae(t,e)}})}var Kae=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=Pd(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)}},jC=class e extends Yd{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):Yd.near(r)}content(){return ql.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 qae(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!Jae(e)||!Yae(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&&!tf.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}}};jC.prototype.visible=!1,jC.findFrom=jC.findGapCursorFrom,Yd.jsonID(`gapcursor`,jC);var qae=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 jC.valid(t)?new jC(t):Yd.near(t)}};function MC(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function Jae(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||MC(e.type))return!0;if(e.inlineContent)return!1}}return!0}function Yae(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||MC(e.type))return!0;if(e.inlineContent)return!1}}return!0}function Xae(){return new lf({props:{decorations:eoe,createSelectionBetween(e,t,n){return t.pos==n.pos&&jC.valid(n)?new jC(n):null},handleClick:Qae,handleKeyDown:Zae,handleDOMEvents:{beforeinput:$ae}}})}const Zae=dg({ArrowLeft:NC(`horiz`,-1),ArrowRight:NC(`horiz`,1),ArrowUp:NC(`vert`,-1),ArrowDown:NC(`vert`,1)});function NC(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 $d){if(!i.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}let c=jC.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new jC(c))),!0):!1}}function Qae(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!jC.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&tf.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new jC(r))),!0)}function $ae(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof jC))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=W.empty;for(let e=r.length-1;e>=0;e--)i=W.from(r[e].createAndFill(null,i));let a=e.state.tr.replace(n.pos,n.pos,new ql(i,0,0));return a.setSelection($d.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function eoe(e){if(!(e.selection instanceof jC))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,uh.create(e.doc,[sh.widget(e.selection.head,t,{key:`gapcursor`})])}var PC=200,FC=function(){};FC.prototype.append=function(e){return e.length?(e=FC.from(e),!this.length&&e||e.length<PC&&this.leafAppend(e)||this.length<PC&&e.leafPrepend(this)||this.appendInner(e)):this},FC.prototype.prepend=function(e){return e.length?FC.from(e).append(this):this},FC.prototype.appendInner=function(e){return new toe(this,e)},FC.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?FC.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},FC.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},FC.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)},FC.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},FC.from=function(e){return e instanceof FC?e:e&&e.length?new IC(e):FC.empty};var IC=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<=PC)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=PC)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}(FC);FC.empty=new IC([]);var toe=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}(FC),LC=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 RC(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 RC(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 RC(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>roe&&(s=noe(s,l),o-=l),new e(s.append(a),o)}remapping(e,t){let n=new fd;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 RC(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 RC(i,o,l))}else r.push(new RC(i))},i);let l=[];for(let e=n;e<o;e++)l.push(new RC(a.maps[e]));let u=new e(this.items.slice(0,i).append(l).append(r),s);return u.emptyItemCount()>500&&(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 RC(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(FC.from(i.reverse()),a)}};LC.empty=new LC(FC.empty,0);function noe(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}var RC=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)}}},zC=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}};const roe=20;function ioe(e,t,n,r){let i=n.getMeta(GC),a;if(i)return i.historyState;n.getMeta(soe)&&(e=new zC(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(GC))return o.getMeta(GC).redo?new zC(e.done.addTransform(n,void 0,r,WC(t)),e.undone,BC(n.mapping.maps),e.prevTime,e.prevComposition):new zC(e.done,e.undone.addTransform(n,void 0,r,WC(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||!aoe(n,e.prevRanges)),s=o?VC(e.prevRanges,n.mapping):BC(n.mapping.maps);return new zC(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,WC(t)),LC.empty,s,n.time,i??e.prevComposition)}else if(a=n.getMeta(`rebased`))return new zC(e.done.rebased(n,a),e.undone.rebased(n,a),VC(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);else return new zC(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),VC(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function aoe(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 BC(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 VC(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 ooe(e,t,n){let r=WC(t),i=GC.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 zC(n?s:a.remaining,n?a.remaining:s,null,0,-1);return a.transform.setSelection(o).setMeta(GC,{redo:n,historyState:c})}let HC=!1,UC=null;function WC(e){let t=e.plugins;if(UC!=t){HC=!1,UC=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){HC=!0;break}}return HC}const GC=new ff(`history`),soe=new ff(`closeHistory`);function coe(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new lf({key:GC,state:{init(){return new zC(LC.empty,LC.empty,null,0,-1)},apply(t,n,r){return ioe(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r=n==`historyUndo`?qC:n==`historyRedo`?JC:null;return!r||!e.editable?!1:(t.preventDefault(),r(e.state,e.dispatch))}}}})}function KC(e,t){return(n,r)=>{let i=GC.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=ooe(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}const qC=KC(!1,!0),JC=KC(!0,!0);sy.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 lf({key:new ff(`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 loe=sy.create({name:`dropCursor`,addOptions(){return{color:`currentColor`,width:1,class:void 0}},addProseMirrorPlugins(){return[Gae(this.options)]}});sy.create({name:`focus`,addOptions(){return{className:`has-focus`,mode:`all`}},addProseMirrorPlugins(){return[new lf({key:new ff(`focus`),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,a=[];if(!n||!r)return uh.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(sh.node(t,t+e.nodeSize,{class:this.options.className}))}),uh.create(e,a)}}})]}});var uoe=sy.create({name:`gapCursor`,addProseMirrorPlugins(){return[Xae()]},extendNodeSchema(e){return{allowGapCursor:L_(N_(e,`allowGapCursor`,{name:e.name,options:e.options,storage:e.storage}))??null}}}),YC=`placeholder`;function doe(e){return e.replace(/\s+/g,`-`).replace(/[^a-zA-Z0-9-]/g,``).replace(/^[0-9-]+/,``).replace(/^-+/,``).toLowerCase()}sy.create({name:`placeholder`,addOptions(){return{emptyEditorClass:`is-editor-empty`,emptyNodeClass:`is-empty`,dataAttribute:YC,placeholder:`Write something …`,showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){let e=this.options.dataAttribute?`data-${doe(this.options.dataAttribute)}`:`data-${YC}`;return[new lf({key:new ff(`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&&_v(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=sh.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}),uh.create(t,a)}}})]}}),sy.create({name:`selection`,addOptions(){return{className:`selection`}},addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new lf({key:new ff(`selection`),props:{decorations(n){return n.selection.empty||e.isFocused||!e.isEditable||vv(n.selection)||e.view.dragging?null:uh.create(n.doc,[sh.inline(n.selection.from,n.selection.to,{class:t.className})])}}})]}});function XC({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}var foe=sy.create({name:`trailingNode`,addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){let e=new ff(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 lf({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!XC({node:r,types:n})},apply:(e,t)=>{if(!e.docChanged||e.getMeta(`__uniqueIDTransaction`))return t;let r=e.doc.lastChild;return!XC({node:r,types:n})}}})]}}),poe=sy.create({name:`undoRedo`,addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>qC(e,t),redo:()=>({state:e,dispatch:t})=>JC(e,t)}},addProseMirrorPlugins(){return[coe(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()}}}),moe=sy.create({name:`starterKit`,addExtensions(){let e=[];return this.options.bold!==!1&&e.push(Jy.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(aC.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(uC.configure(this.options.bulletList)),this.options.code!==!1&&e.push(oC.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(Vy.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(Eae.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(loe.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(uoe.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(ub.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(fb.configure(this.options.heading)),this.options.undoRedo!==!1&&e.push(poe.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&e.push(sC.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(eb.configure(this.options.italic)),this.options.listItem!==!1&&e.push(dC.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(xC.configure(this.options?.listKeymap)),this.options.link!==!1&&e.push(Mb.configure(this.options?.link)),this.options.orderedList!==!1&&e.push(EC.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(zae.configure(this.options.paragraph)),this.options.strike!==!1&&e.push(kC.configure(this.options.strike)),this.options.text!==!1&&e.push(Uae.configure(this.options.text)),this.options.underline!==!1&&e.push(AC.configure(this.options?.underline)),this.options.trailingNode!==!1&&e.push(foe.configure(this.options?.trailingNode)),e}});const hoe=Sae.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceMarkerSpacings:{default:null}}}}),goe=Tae.extend({excludes:``,addAttributes(){return{...this.parent?.(),sourceFenceChar:{default:"`"},sourceFenceLength:{default:1},sourcePadded:{default:!1,rendered:!1}}}}),_oe=Iy.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)}}}),voe=Qv.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)}}}),yoe=sy.create({name:`docFidelity`,addGlobalAttributes(){return[{types:[`doc`],attributes:{sourceDocBoundary:{default:null,rendered:!1}}}]}});function ZC(e){for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return t;return null}function boe(e){let t=!1;return e.descendants(e=>t?!1:(e.type.name===`list`&&(t=!0),!t)),t}function QC(e){let{selection:t}=e;return t instanceof $d?t.$cursor:null}function xoe(e){let t=QC(e);if(!t||t.parentOffset!==0)return!1;let n=ZC(t);if(n===null||t.depth!==n+1||t.index(n)!==0)return!1;let r=t.index(n-1);return r===0?!1:boe(t.node(n-1).child(r-1))}function Soe(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 Coe(e){let t=QC(e);if(!t||t.parentOffset!==t.parent.content.size)return!1;let n=ZC(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=Soe(t,n);return r!==null&&r<n}const woe=sy.create({name:`listBoundaryMerge`,addKeyboardShortcuts(){let e=()=>{let{editor:e}=this;if(!xoe(e.state))return!1;if(e.commands.undoInputRule())return!0;let{state:t,view:n}=e;return gf(t,n.dispatch,n)},t=()=>{let{editor:e}=this;if(!Coe(e.state))return!1;let{state:t,view:n}=e;return _f(t,n.dispatch,n)};return{Backspace:e,"Mod-Backspace":e,Delete:t,"Mod-Delete":t}}}),Toe=sy.create({name:`plainTextClipboard`,priority:1e3,addProseMirrorPlugins(){return[new lf({key:new ff(`okPlainTextClipboard`),props:{clipboardTextSerializer:e=>e.content.textBetween(0,e.content.size,`
|
|
265
265
|
|
|
266
|
-
`)}})]}}),$C=new Map([[32,` `],[9,` `],[160,`\xA0`]]);function ew(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 tw(e){let t=ew(e);return t!==null&&$C.has(t)}function Eoe(e){let t=ew(e);return t===null?null:$C.get(t)??null}const nw=/&#(?:x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);/g;function rw(e){nw.lastIndex=0;let t=e.match(nw);if(t===null||t.join(``)!==e)return null;let n=``;for(let e of t){let t=Eoe(e);if(t===null)return null;n+=t}return n}const Doe=Qv.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 iw(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||Ooe(n)===r?!0:rw(e)===t}function Ooe(e){return e.replace(/\\([!-/:-@[-`{-~])/g,`$1`)}const koe=Hae.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`~~`,rendered:!1}}}}),Aoe=iC.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDashCounts:{default:null},sourceOuterPipes:{default:null,rendered:!1},sourceAlignmentPadding:{default:null,rendered:!1}}}}),joe=US.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),Moe=WS.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),Noe=Iy.create({name:`tag`,marks:`_`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,renderText:ab,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()}}}),Poe=/^(?:---|—-|___\s|\*\*\*\s)$/;function Foe(e){let t=String(e[0]??``).replace(/\s+$/,``);return t===`—-`?`---`:t}const Ioe=Dae.extend({name:`thematicBreak`,priority:60,addAttributes(){return{...this.parent?.(),sourceRaw:{default:`---`}}},addInputRules(){return[by({find:Poe,type:this.type,getAttributes:e=>({sourceRaw:Foe(e)})})]}}),Loe=Wae.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceForm:{default:`u`,rendered:!1}}}});function aw(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function Roe(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}const zoe=Iy.create({name:`wikiLink`,marks:`_`,group:`inline`,inline:!0,atom:!0,priority:60,renderText:ab,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:aw(e.getAttribute(`data-alias`)),anchor:aw(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:aw(e.getAttribute(`data-alias`)),anchor:aw(e.getAttribute(`data-anchor`)),resolved:!1}:!1}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=aw(e.attrs.alias),i=aw(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`},Roe({target:n,alias:r,anchor:i})]}});function ow(e){let t=e.split(`/`).pop()??e,n=t.lastIndexOf(`.`);return n<=0||n===t.length-1?``:t.slice(n+1).toLowerCase()}function Boe(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}const sw=[bb,Xb,xb,Yb,zoe,Iy.create({name:`wikiLinkEmbed`,group:`inline`,inline:!0,atom:!0,priority:60,renderText:ab,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:aw(e.getAttribute(`data-alias`)),anchor:aw(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=aw(e.attrs.alias),i=aw(e.attrs.anchor),a=aw(e.attrs.resolvedSrc),o=ow(n);if(No.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`},Boe({target:n,alias:r,anchor:i})]}}),Noe,qb,Jb,tb,nb,koe,Loe,goe,Hy,hoe,pb,Ioe,zb,mb,Bb,db,rb,yoe,Doe,Toe,moe.configure({undoRedo:!1,bulletList:!1,orderedList:!1,listItem:!1,listKeymap:{listTypes:[{itemName:`listItem`,wrapperNames:[`list`]}]},italic:!1,bold:!1,strike:!1,underline:!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}}),woe,Aoe.configure({resizable:!0}),GS,Moe,joe,yb.configure({inline:!0}),hb,$b,voe,_oe,ob,ib];function Voe(e){return`'${e.replace(/'/g,`'\\''`)}'`}`${Pl}`,[`delete`,`move`,`share_link`,`install`,`import`].map(e=>`mcp__${Pl}__${e}`),`${Voe(`mcp_servers.${Pl}.default_tools_approval_mode="approve"`)}`,3072-Hoe("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`. ",`cursor`),new TextEncoder;function Hoe(e,t){let n=encodeURIComponent(e);return t===`cursor`?encodeURIComponent(n).length:n.length}function Uoe(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}}function cw(e,t){let n=Uoe(e);n.ok||t.addIssue({code:`custom`,message:n.reason})}const lw=F().superRefine(cw).optional(),Woe=F().superRefine(cw),uw={agentId:F().optional(),agentName:F().optional(),colorSeed:F().optional(),clientName:F().optional(),clientVersion:F().optional(),label:F().optional()},dw=F().optional(),Goe=/^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;so(`kind`,[B({kind:U(`doc`),docPath:F().min(1)}).loose(),B({kind:U(`folder`),folderPath:F()}).loose()]);const Koe=H([`no-remote`,`detached-head`,`branch-not-on-origin`,`non-github-remote`,`invalid-path`]),fw=H([`current`,`stale`,`absent`,`empty`]);so(`ok`,[B({ok:U(!0),shareUrl:F().min(1),sharedUrl:F().min(1),branch:F().min(1),freshness:fw.optional().catch(void 0)}).loose(),B({ok:U(!1),error:Koe,branch:F().min(1).optional()}).loose()]);const qoe=H([`user`,`org`]),Joe=B({login:F().min(1),kind:qoe,avatarUrl:F().optional()}).loose(),pw=H([`auth-required`,`network`]);so(`ok`,[B({ok:U(!0),owners:z(Joe)}).loose(),B({ok:U(!1),error:pw}).loose()]),so(`ok`,[B({ok:U(!0),available:L()}).loose(),B({ok:U(!1),error:pw}).loose()]);const Yoe=H([`public`,`private`]);B({owner:F().min(1),name:F().min(1),visibility:Yoe,description:F().optional()}).loose();const Xoe=H([`name-conflict`,`saml-sso`,`auth-required`,`push-failed`,`init-failed`,`network`,`no-project`]);so(`ok`,[B({ok:U(!0),ownerLogin:F().min(1),repoName:F().min(1),cloneUrl:F().min(1),defaultBranch:F().min(1)}).loose(),B({ok:U(!1),error:Xoe}).loose()]);function mw(e){return!(typeof e!=`string`||e.length===0||e.startsWith(`-`)||/[\x00-\x1F\x7F]/.test(e)||/\s/.test(e)||e.includes(`:`)||e.split(`/`).includes(`..`))}const hw=e=>e.refine(mw,`invalid branch name`),gw={shareTargetExists:L(),dirtyConflicts:B({conflicts:L(),files:z(F().min(1))}).loose(),branchIsLocal:L(),shareTargetOnOriginBranch:L().optional()};so(`detached`,[B({detached:U(!1),currentBranch:F().min(1).nullable(),currentHeadSha:no(),...gw}).loose(),B({detached:U(!0),currentBranch:no(),currentHeadSha:F().min(1),...gw}).loose()]),B({branch:hw(F().min(1)),principalId:F().optional(),fastForward:L().optional()}).loose();const Zoe=H([`dirty-conflict`,`branch-not-found`,`fetch-failed`,`checkout-failed`,`branch-in-other-worktree`,`ff-diverged`]);so(`ok`,[B({ok:U(!0)}).loose(),B({ok:U(!1),reason:Zoe,files:z(F().min(1)).optional(),otherWorktreePath:F().min(1).optional()}).loose()]),H([`on-origin`,`renamed`,`deleted`,`never-on-branch`,`changed-locally`,`unknown`]),B({branch:hw(F().min(1)),path:F(),kind:H([`doc`,`folder`]),contentRootDepth:I().int().min(1).max(65535).optional()}).loose(),so(`verdict`,[B({verdict:U(`on-origin`)}).loose(),B({verdict:U(`renamed`),renamedTo:F().min(1)}).loose(),B({verdict:U(`deleted`)}).loose(),B({verdict:U(`never-on-branch`)}).loose(),B({verdict:U(`changed-locally`)}).loose(),B({verdict:U(`unknown`)}).loose()]).catch({verdict:`unknown`});const Qoe=B({startedAt:F().min(1),httpListenMs:I().nonnegative().optional(),seedWalkMs:I().nonnegative().optional(),indexesMs:I().nonnegative().optional(),readyMs:I().nonnegative().optional(),fileCount:I().nonnegative().optional()});B({serverInstanceId:F().min(1),currentBranch:F().min(1).optional(),currentDiskAckSVs:V(F().min(1),F().min(1)).optional(),boot:Qoe.optional()}).loose(),B({id:F().min(1),display_name:F().min(1),display_email:F(),source:H([`git-config`,`synthesized`]),created_at:F().min(1)}).loose(),B({collabUrl:F().nullable(),previewUrl:F().nullable(),port:I(),singleFile:L().default(!1)}).loose();const _w=H(`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:derived-index-unavailable.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.urn:ok:error:audit-superseded.urn:ok:error:theme-name-taken.urn:ok:error:theme-name-invalid`.split(`.`)),$oe=B({type:_w,title:F().min(1),status:I().int().min(400).max(599),instance:F().regex(Goe,`instance must be urn:uuid:<uuid>`).optional(),detail:F().optional()}).loose();B({parentDocName:F().min(1),placement:H([`configured-attachments`,`parent-dir`]).default(`configured-attachments`),agentId:F().min(1).optional(),agentName:F().min(1).optional()}).loose(),B({src:F().min(1),path:F().min(1).optional(),deduped:L().optional()}).loose(),B({url:F().min(1),dir:F().min(1),branch:F().min(1).refine(mw,`invalid branch name`).optional()}).loose(),B({type:U(`error`),problem:$oe}).loose();function vw(e){try{let t=Intl.getCanonicalLocales(e)[0];return t===void 0?null:t}catch{return null}}function yw(e){try{let t=Intl.getCanonicalLocales(e)[0];if(t===void 0)return null;let n=new Intl.Locale(t).maximize();return!n.language||!n.script?null:`${n.language}-${n.script}`}catch{return null}}function bw(e,t){let n=t.map(e=>[yw(e),e]);for(let t of e){let e=yw(t);if(e===null)continue;let r=n.find(([t])=>t===e);if(r!==void 0)return r[1]}}function ese(e){let{override:t,storedPreference:n,preferenceList:r,supportedLocales:i}=e,a=e.autoDetectableLocales??i;if(t!==void 0){let e=bw([t],i);if(e!==void 0)return{locale:e,source:`override`}}if(n!==void 0&&n!==`system`&&i.includes(n))return{locale:n,source:`explicit`};let o=bw(r,a);return o===void 0?{locale:`en`,source:`fallback`}:{locale:o,source:`system`}}function tse(e,t,n=3){let r=RegExp(`^ {0,3}(\\${e}+)[ \\t]*$`),i=Math.max(3,n);for(let e of t.split(`
|
|
266
|
+
`)}})]}}),$C=new Map([[32,` `],[9,` `],[160,`\xA0`]]);function ew(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 tw(e){let t=ew(e);return t!==null&&$C.has(t)}function Eoe(e){let t=ew(e);return t===null?null:$C.get(t)??null}const nw=/&#(?:x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);/g;function rw(e){nw.lastIndex=0;let t=e.match(nw);if(t===null||t.join(``)!==e)return null;let n=``;for(let e of t){let t=Eoe(e);if(t===null)return null;n+=t}return n}const Doe=Qv.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 iw(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||Ooe(n)===r?!0:rw(e)===t}function Ooe(e){return e.replace(/\\([!-/:-@[-`{-~])/g,`$1`)}const koe=Hae.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`~~`,rendered:!1}}}}),Aoe=iC.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDashCounts:{default:null},sourceOuterPipes:{default:null,rendered:!1},sourceAlignmentPadding:{default:null,rendered:!1}}}}),joe=US.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),Moe=WS.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),Noe=Iy.create({name:`tag`,marks:`_`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,renderText:ab,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()}}}),Poe=/^(?:---|—-|___\s|\*\*\*\s)$/;function Foe(e){let t=String(e[0]??``).replace(/\s+$/,``);return t===`—-`?`---`:t}const Ioe=Dae.extend({name:`thematicBreak`,priority:60,addAttributes(){return{...this.parent?.(),sourceRaw:{default:`---`}}},addInputRules(){return[by({find:Poe,type:this.type,getAttributes:e=>({sourceRaw:Foe(e)})})]}}),Loe=Wae.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceForm:{default:`u`,rendered:!1}}}});function aw(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function Roe(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}const zoe=Iy.create({name:`wikiLink`,marks:`_`,group:`inline`,inline:!0,atom:!0,priority:60,renderText:ab,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:aw(e.getAttribute(`data-alias`)),anchor:aw(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:aw(e.getAttribute(`data-alias`)),anchor:aw(e.getAttribute(`data-anchor`)),resolved:!1}:!1}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=aw(e.attrs.alias),i=aw(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`},Roe({target:n,alias:r,anchor:i})]}});function ow(e){let t=e.split(`/`).pop()??e,n=t.lastIndexOf(`.`);return n<=0||n===t.length-1?``:t.slice(n+1).toLowerCase()}function Boe(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}const sw=[bb,Xb,xb,Yb,zoe,Iy.create({name:`wikiLinkEmbed`,group:`inline`,inline:!0,atom:!0,priority:60,renderText:ab,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:aw(e.getAttribute(`data-alias`)),anchor:aw(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=aw(e.attrs.alias),i=aw(e.attrs.anchor),a=aw(e.attrs.resolvedSrc),o=ow(n);if(No.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`},Boe({target:n,alias:r,anchor:i})]}}),Noe,qb,Jb,tb,nb,koe,Loe,goe,Hy,hoe,pb,Ioe,zb,mb,Bb,db,rb,yoe,Doe,Toe,moe.configure({undoRedo:!1,bulletList:!1,orderedList:!1,listItem:!1,listKeymap:{listTypes:[{itemName:`listItem`,wrapperNames:[`list`]}]},italic:!1,bold:!1,strike:!1,underline:!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}}),woe,Aoe.configure({resizable:!0}),GS,Moe,joe,yb.configure({inline:!0}),hb,$b,voe,_oe,ob,ib];function Voe(e){return`'${e.replace(/'/g,`'\\''`)}'`}`${Pl}`,[`delete`,`move`,`share_link`,`install`,`import`].map(e=>`mcp__${Pl}__${e}`),`${Voe(`mcp_servers.${Pl}.default_tools_approval_mode="approve"`)}`,3072-Hoe("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`. ",`cursor`),new TextEncoder;function Hoe(e,t){let n=encodeURIComponent(e);return t===`cursor`?encodeURIComponent(n).length:n.length}function Uoe(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}}function cw(e,t){let n=Uoe(e);n.ok||t.addIssue({code:`custom`,message:n.reason})}const lw=F().superRefine(cw).optional(),Woe=F().superRefine(cw),uw={agentId:F().optional(),agentName:F().optional(),colorSeed:F().optional(),clientName:F().optional(),clientVersion:F().optional(),label:F().optional()},dw=F().optional(),Goe=/^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;so(`kind`,[B({kind:U(`doc`),docPath:F().min(1)}).loose(),B({kind:U(`folder`),folderPath:F()}).loose()]);const Koe=H([`no-remote`,`detached-head`,`branch-not-on-origin`,`non-github-remote`,`invalid-path`]),fw=H([`current`,`stale`,`absent`,`empty`]);so(`ok`,[B({ok:U(!0),shareUrl:F().min(1),sharedUrl:F().min(1),branch:F().min(1),freshness:fw.optional().catch(void 0)}).loose(),B({ok:U(!1),error:Koe,branch:F().min(1).optional()}).loose()]);const qoe=H([`user`,`org`]),Joe=B({login:F().min(1),kind:qoe,avatarUrl:F().optional()}).loose(),pw=H([`auth-required`,`network`]);so(`ok`,[B({ok:U(!0),owners:z(Joe)}).loose(),B({ok:U(!1),error:pw}).loose()]),so(`ok`,[B({ok:U(!0),available:L()}).loose(),B({ok:U(!1),error:pw}).loose()]);const Yoe=H([`public`,`private`]);B({owner:F().min(1),name:F().min(1),visibility:Yoe,description:F().optional()}).loose();const Xoe=H([`name-conflict`,`saml-sso`,`auth-required`,`push-failed`,`init-failed`,`network`,`no-project`]);so(`ok`,[B({ok:U(!0),ownerLogin:F().min(1),repoName:F().min(1),cloneUrl:F().min(1),defaultBranch:F().min(1)}).loose(),B({ok:U(!1),error:Xoe}).loose()]);function mw(e){return!(typeof e!=`string`||e.length===0||e.startsWith(`-`)||/[\x00-\x1F\x7F]/.test(e)||/\s/.test(e)||e.includes(`:`)||e.split(`/`).includes(`..`))}const hw=e=>e.refine(mw,`invalid branch name`),gw={shareTargetExists:L(),dirtyConflicts:B({conflicts:L(),files:z(F().min(1))}).loose(),branchIsLocal:L(),shareTargetOnOriginBranch:L().optional()};so(`detached`,[B({detached:U(!1),currentBranch:F().min(1).nullable(),currentHeadSha:no(),...gw}).loose(),B({detached:U(!0),currentBranch:no(),currentHeadSha:F().min(1),...gw}).loose()]),B({branch:hw(F().min(1)),principalId:F().optional(),fastForward:L().optional()}).loose();const Zoe=H([`dirty-conflict`,`branch-not-found`,`fetch-failed`,`checkout-failed`,`branch-in-other-worktree`,`ff-diverged`]);so(`ok`,[B({ok:U(!0)}).loose(),B({ok:U(!1),reason:Zoe,files:z(F().min(1)).optional(),otherWorktreePath:F().min(1).optional()}).loose()]),H([`on-origin`,`renamed`,`deleted`,`never-on-branch`,`changed-locally`,`unknown`]),B({branch:hw(F().min(1)),path:F(),kind:H([`doc`,`folder`])}).loose(),so(`verdict`,[B({verdict:U(`on-origin`)}).loose(),B({verdict:U(`renamed`),renamedTo:F().min(1)}).loose(),B({verdict:U(`deleted`)}).loose(),B({verdict:U(`never-on-branch`)}).loose(),B({verdict:U(`changed-locally`)}).loose(),B({verdict:U(`unknown`)}).loose()]).catch({verdict:`unknown`});const Qoe=B({startedAt:F().min(1),httpListenMs:I().nonnegative().optional(),seedWalkMs:I().nonnegative().optional(),indexesMs:I().nonnegative().optional(),readyMs:I().nonnegative().optional(),fileCount:I().nonnegative().optional()});B({serverInstanceId:F().min(1),currentBranch:F().min(1).optional(),currentDiskAckSVs:V(F().min(1),F().min(1)).optional(),boot:Qoe.optional()}).loose(),B({id:F().min(1),display_name:F().min(1),display_email:F(),source:H([`git-config`,`synthesized`]),created_at:F().min(1)}).loose(),B({collabUrl:F().nullable(),previewUrl:F().nullable(),port:I(),singleFile:L().default(!1)}).loose();const _w=H(`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:derived-index-unavailable.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.urn:ok:error:audit-superseded.urn:ok:error:theme-name-taken.urn:ok:error:theme-name-invalid`.split(`.`)),$oe=B({type:_w,title:F().min(1),status:I().int().min(400).max(599),instance:F().regex(Goe,`instance must be urn:uuid:<uuid>`).optional(),detail:F().optional()}).loose();B({parentDocName:F().min(1),placement:H([`configured-attachments`,`parent-dir`]).default(`configured-attachments`),agentId:F().min(1).optional(),agentName:F().min(1).optional()}).loose(),B({src:F().min(1),path:F().min(1).optional(),deduped:L().optional()}).loose(),B({url:F().min(1),dir:F().min(1),branch:F().min(1).refine(mw,`invalid branch name`).optional()}).loose(),B({type:U(`error`),problem:$oe}).loose();function vw(e){try{let t=Intl.getCanonicalLocales(e)[0];return t===void 0?null:t}catch{return null}}function yw(e){try{let t=Intl.getCanonicalLocales(e)[0];if(t===void 0)return null;let n=new Intl.Locale(t).maximize();return!n.language||!n.script?null:`${n.language}-${n.script}`}catch{return null}}function bw(e,t){let n=t.map(e=>[yw(e),e]);for(let t of e){let e=yw(t);if(e===null)continue;let r=n.find(([t])=>t===e);if(r!==void 0)return r[1]}}function ese(e){let{override:t,storedPreference:n,preferenceList:r,supportedLocales:i}=e,a=e.autoDetectableLocales??i;if(t!==void 0){let e=bw([t],i);if(e!==void 0)return{locale:e,source:`override`}}if(n!==void 0&&n!==`system`&&i.includes(n))return{locale:n,source:`explicit`};let o=bw(r,a);return o===void 0?{locale:`en`,source:`fallback`}:{locale:o,source:`system`}}function tse(e,t,n=3){let r=RegExp(`^ {0,3}(\\${e}+)[ \\t]*$`),i=Math.max(3,n);for(let e of t.split(`
|
|
267
267
|
`)){let t=r.exec(e);t&&t[1].length>=i&&(i=t[1].length+1)}return i}function xw(e){return e>=2?e:0}function Sw(e,t){let n={line:e,column:1,offset:t};return{type:`paragraph`,children:[],position:{start:n,end:{...n}}}}function Cw(e,t){let n=e.children,r=n.length===0||t.leading===void 0?0:xw(t.leading.length),i=n.length===0||t.trailing===void 0?0:xw(t.trailing.length-1);if(r===0&&i===0)return t;let a=n[n.length-1]?.position?.end,o=[],s=[];if(r>0)for(let e=0;e<r;e++)o.push(Sw(1+e,e));if(i>0&&typeof a?.offset==`number`&&typeof a.line==`number`)for(let e=0;e<i;e++)s.push(Sw(a.line+1+e,a.offset+1+e));if(o.length===0&&s.length===0||(e.children=[...o,...n,...s],o.length>0&&delete t.leading,s.length>0&&delete t.trailing,t.bom!==void 0||t.leading!==void 0||t.trailing!==void 0))return t;e.data!==void 0&&delete e.data.sourceDocBoundary}var ww=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};ww.prototype.normal={},ww.prototype.property={},ww.prototype.space=void 0;function Tw(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new ww(n,r,t)}function Ew(e){return e.toLowerCase()}var Dw=class{constructor(e,t){this.attribute=t,this.property=e}};Dw.prototype.attribute=``,Dw.prototype.booleanish=!1,Dw.prototype.boolean=!1,Dw.prototype.commaOrSpaceSeparated=!1,Dw.prototype.commaSeparated=!1,Dw.prototype.defined=!1,Dw.prototype.mustUseProperty=!1,Dw.prototype.number=!1,Dw.prototype.overloadedBoolean=!1,Dw.prototype.property=``,Dw.prototype.spaceSeparated=!1,Dw.prototype.space=void 0;var Ow=r({boolean:()=>kw,booleanish:()=>Aw,commaOrSpaceSeparated:()=>Fw,commaSeparated:()=>Pw,number:()=>Mw,overloadedBoolean:()=>jw,spaceSeparated:()=>Nw});let nse=0;const kw=Iw(),Aw=Iw(),jw=Iw(),Mw=Iw(),Nw=Iw(),Pw=Iw(),Fw=Iw();function Iw(){return 2**++nse}const Lw=Object.keys(Ow);var Rw=class extends Dw{constructor(e,t,n,r){let i=-1;if(super(e,t),zw(this,`space`,r),typeof n==`number`)for(;++i<Lw.length;){let e=Lw[i];zw(this,Lw[i],(n&Ow[e])===Ow[e])}}};Rw.prototype.defined=!0;function zw(e,t,n){n&&(e[t]=n)}function Bw(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Rw(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Ew(r)]=r,n[Ew(a.attribute)]=r}return new ww(t,n,e.space)}const Vw=Bw({properties:{ariaActiveDescendant:null,ariaAtomic:Aw,ariaAutoComplete:null,ariaBusy:Aw,ariaChecked:Aw,ariaColCount:Mw,ariaColIndex:Mw,ariaColSpan:Mw,ariaControls:Nw,ariaCurrent:null,ariaDescribedBy:Nw,ariaDetails:null,ariaDisabled:Aw,ariaDropEffect:Nw,ariaErrorMessage:null,ariaExpanded:Aw,ariaFlowTo:Nw,ariaGrabbed:Aw,ariaHasPopup:null,ariaHidden:Aw,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Nw,ariaLevel:Mw,ariaLive:null,ariaModal:Aw,ariaMultiLine:Aw,ariaMultiSelectable:Aw,ariaOrientation:null,ariaOwns:Nw,ariaPlaceholder:null,ariaPosInSet:Mw,ariaPressed:Aw,ariaReadOnly:Aw,ariaRelevant:null,ariaRequired:Aw,ariaRoleDescription:Nw,ariaRowCount:Mw,ariaRowIndex:Mw,ariaRowSpan:Mw,ariaSelected:Aw,ariaSetSize:Mw,ariaSort:null,ariaValueMax:Mw,ariaValueMin:Mw,ariaValueNow:Mw,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function Hw(e,t){return t in e?e[t]:t}function Uw(e,t){return Hw(e,t.toLowerCase())}const rse=Bw({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:Pw,acceptCharset:Nw,accessKey:Nw,action:null,allow:null,allowFullScreen:kw,allowPaymentRequest:kw,allowUserMedia:kw,alpha:kw,alt:null,as:null,async:kw,autoCapitalize:null,autoComplete:Nw,autoFocus:kw,autoPlay:kw,blocking:Nw,capture:null,charSet:null,checked:kw,cite:null,className:Nw,closedBy:null,colorSpace:null,cols:Mw,colSpan:Mw,command:null,commandFor:null,content:null,contentEditable:Aw,controls:kw,controlsList:Nw,coords:Mw|Pw,crossOrigin:null,data:null,dateTime:null,decoding:null,default:kw,defer:kw,dir:null,dirName:null,disabled:kw,download:jw,draggable:Aw,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:kw,formTarget:null,headers:Nw,height:Mw,hidden:jw,high:Mw,href:null,hrefLang:null,htmlFor:Nw,httpEquiv:Nw,id:null,imageSizes:null,imageSrcSet:null,inert:kw,inputMode:null,integrity:null,is:null,isMap:kw,itemId:null,itemProp:Nw,itemRef:Nw,itemScope:kw,itemType:Nw,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:kw,low:Mw,manifest:null,max:null,maxLength:Mw,media:null,method:null,min:null,minLength:Mw,multiple:kw,muted:kw,name:null,nonce:null,noModule:kw,noValidate:kw,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:kw,optimum:Mw,pattern:null,ping:Nw,placeholder:null,playsInline:kw,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:kw,referrerPolicy:null,rel:Nw,required:kw,reversed:kw,rows:Mw,rowSpan:Mw,sandbox:Nw,scope:null,scoped:kw,seamless:kw,selected:kw,shadowRootClonable:kw,shadowRootCustomElementRegistry:kw,shadowRootDelegatesFocus:kw,shadowRootMode:null,shadowRootSerializable:kw,shape:null,size:Mw,sizes:null,slot:null,span:Mw,spellCheck:Aw,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Mw,step:null,style:null,tabIndex:Mw,target:null,title:null,translate:null,type:null,typeMustMatch:kw,useMap:null,value:Aw,width:Mw,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Nw,axis:null,background:null,bgColor:null,border:Mw,borderColor:null,bottomMargin:Mw,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:kw,declare:kw,event:null,face:null,frame:null,frameBorder:null,hSpace:Mw,leftMargin:Mw,link:null,longDesc:null,lowSrc:null,marginHeight:Mw,marginWidth:Mw,noResize:kw,noHref:kw,noShade:kw,noWrap:kw,object:null,profile:null,prompt:null,rev:null,rightMargin:Mw,rules:null,scheme:null,scrolling:Aw,standby:null,summary:null,text:null,topMargin:Mw,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Mw,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:kw,disablePictureInPicture:kw,disableRemotePlayback:kw,exportParts:Pw,part:Nw,prefix:null,property:null,results:Mw,security:null,unselectable:null},space:`html`,transform:Uw}),ise=Bw({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:Fw,accentHeight:Mw,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Mw,amplitude:Mw,arabicForm:null,ascent:Mw,attributeName:null,attributeType:null,azimuth:Mw,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Mw,by:null,calcMode:null,capHeight:Mw,className:Nw,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Mw,diffuseConstant:Mw,direction:null,display:null,dur:null,divisor:Mw,dominantBaseline:null,download:kw,dx:null,dy:null,edgeMode:null,editable:null,elevation:Mw,enableBackground:null,end:null,event:null,exponent:Mw,externalResourcesRequired:null,fill:null,fillOpacity:Mw,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Pw,g2:Pw,glyphName:Pw,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Mw,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Mw,horizOriginX:Mw,horizOriginY:Mw,id:null,ideographic:Mw,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Mw,k:Mw,k1:Mw,k2:Mw,k3:Mw,k4:Mw,kernelMatrix:Fw,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Mw,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Mw,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Mw,overlineThickness:Mw,paintOrder:null,panose1:null,path:null,pathLength:Mw,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Nw,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Mw,pointsAtY:Mw,pointsAtZ:Mw,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Fw,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Fw,rev:Fw,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Fw,requiredFeatures:Fw,requiredFonts:Fw,requiredFormats:Fw,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Mw,specularExponent:Mw,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Mw,strikethroughThickness:Mw,string:null,stroke:null,strokeDashArray:Fw,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Mw,strokeOpacity:Mw,strokeWidth:null,style:null,surfaceScale:Mw,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Fw,tabIndex:Mw,tableValues:null,target:null,targetX:Mw,targetY:Mw,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Fw,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Mw,underlineThickness:Mw,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Mw,values:null,vAlphabetic:Mw,vMathematical:Mw,vectorEffect:null,vHanging:Mw,vIdeographic:Mw,version:null,vertAdvY:Mw,vertOriginX:Mw,vertOriginY:Mw,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Mw,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:Hw}),Ww=Bw({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),Gw=Bw({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:Uw}),Kw=Bw({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),ase=/[A-Z]/g,qw=/-[a-z]/g,ose=/^data[-\w.:]+$/i;function Jw(e,t){let n=Ew(t),r=t,i=Dw;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&ose.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(qw,cse);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!qw.test(e)){let n=e.replace(ase,sse);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Rw}return new i(r,t)}function sse(e){return`-`+e.toLowerCase()}function cse(e){return e.charAt(1).toUpperCase()}const Yw=Tw([Vw,rse,Ww,Gw,Kw],`html`),Xw=Tw([Vw,ise,Ww,Gw,Kw],`svg`);function Zw(e){let t=[],n=String(e||``),r=n.indexOf(`,`),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);let e=n.slice(i,r).trim();(e||!a)&&t.push(e),i=r+1,r=n.indexOf(`,`,i)}return t}const Qw=/[#.]/g;function lse(e,t){let n=e||``,r={},i=0,a,o;for(;i<n.length;){Qw.lastIndex=i;let e=Qw.exec(n),t=n.slice(i,e?e.index:n.length);t&&(a?a===`#`?r.id=t:Array.isArray(r.className)?r.className.push(t):r.className=[t]:o=t,i+=t.length),e&&(a=e[0],i++)}return{type:`element`,tagName:o||t||`div`,properties:r,children:[]}}function $w(e){let t=String(e||``).trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function eT(e,t,n){let r=n?pse(n):void 0;function i(n,i,...a){let o;if(n==null){o={type:`root`,children:[]};let e=i;a.unshift(e)}else{o=lse(n,t);let s=o.tagName.toLowerCase(),c=r?r.get(s):void 0;if(o.tagName=c||s,use(i))a.unshift(i);else for(let[t,n]of Object.entries(i))dse(e,o.properties,t,n)}for(let e of a)tT(o.children,e);return o.type===`element`&&o.tagName===`template`&&(o.content={type:`root`,children:o.children},o.children=[]),o}return i}function use(e){if(typeof e!=`object`||!e||Array.isArray(e))return!0;if(typeof e.type!=`string`)return!1;let t=e,n=Object.keys(e);for(let e of n){let n=t[e];if(n&&typeof n==`object`){if(!Array.isArray(n))return!0;let e=n;for(let t of e)if(typeof t!=`number`&&typeof t!=`string`)return!0}}return!!(`children`in e&&Array.isArray(e.children))}function dse(e,t,n,r){let i=Jw(e,n),a;if(r!=null){if(typeof r==`number`){if(Number.isNaN(r))return;a=r}else a=typeof r==`boolean`?r:typeof r==`string`?i.spaceSeparated?$w(r):i.commaSeparated?Zw(r):i.commaOrSpaceSeparated?$w(Zw(r).join(` `)):nT(i,i.property,r):Array.isArray(r)?[...r]:i.property===`style`?fse(r):String(r);if(Array.isArray(a)){let e=[];for(let t of a)e.push(nT(i,i.property,t));a=e}i.property===`className`&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[i.property]=a}}function tT(e,t){if(t!=null)if(typeof t==`number`||typeof t==`string`)e.push({type:`text`,value:String(t)});else if(Array.isArray(t))for(let n of t)tT(e,n);else if(typeof t==`object`&&`type`in t)t.type===`root`?tT(e,t.children):e.push(t);else throw Error("Expected node, nodes, or string, got `"+t+"`")}function nT(e,t,n){if(typeof n==`string`){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===``||Ew(n)===Ew(t)))return!0}return n}function fse(e){let t=[];for(let[n,r]of Object.entries(e))t.push([n,r].join(`: `));return t.join(`; `)}function pse(e){let t=new Map;for(let n of e)t.set(n.toLowerCase(),n);return t}const mse=`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.glyphRef.linearGradient.radialGradient.solidColor.textArea.textPath`.split(`.`),hse=eT(Yw,`div`),gse=eT(Xw,`g`,mse);function _se(e){let t=String(e),n=[];return{toOffset:i,toPoint:r};function r(e){if(typeof e==`number`&&e>-1&&e<=t.length){let r=0;for(;;){let i=n[r];if(i===void 0){let e=rT(t,n[r-1]);i=e===-1?t.length+1:e+1,n[r]=i}if(i>e)return{line:r+1,column:e-(r>0?n[r-1]:0)+1,offset:e};r++}}}function i(e){if(e&&typeof e.line==`number`&&typeof e.column==`number`&&!Number.isNaN(e.line)&&!Number.isNaN(e.column)){for(;n.length<e.line;){let e=n[n.length-1],r=rT(t,e),i=r===-1?t.length+1:r+1;if(e===i)break;n.push(i)}let r=(e.line>1?n[e.line-2]:0)+e.column-1;if(r<n[e.line-1])return r}}}function rT(e,t){let n=e.indexOf(`\r`,t),r=e.indexOf(`
|
|
268
268
|
`,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const vse={html:`http://www.w3.org/1999/xhtml`,mathml:`http://www.w3.org/1998/Math/MathML`,svg:`http://www.w3.org/2000/svg`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`},iT={}.hasOwnProperty,yse=Object.prototype;function bse(e,t){let n=t||{};return aT({file:n.file||void 0,location:!1,schema:n.space===`svg`?Xw:Yw,verbose:n.verbose||!1},e)}function aT(e,t){let n;switch(t.nodeName){case`#comment`:{let r=t;return n={type:`comment`,value:r.data},sT(e,r,n),n}case`#document`:case`#document-fragment`:{let r=t,i=`mode`in r?r.mode===`quirks`||r.mode===`limited-quirks`:!1;if(n={type:`root`,children:oT(e,t.childNodes),data:{quirksMode:i}},e.file&&e.location){let t=String(e.file),r=_se(t),i=r.toPoint(0),a=r.toPoint(t.length);n.position={start:i,end:a}}return n}case`#documentType`:{let r=t;return n={type:`doctype`},sT(e,r,n),n}case`#text`:{let r=t;return n={type:`text`,value:r.value},sT(e,r,n),n}default:return n=xse(e,t),n}}function oT(e,t){let n=-1,r=[];for(;++n<t.length;){let i=aT(e,t[n]);r.push(i)}return r}function xse(e,t){let n=e.schema;e.schema=t.namespaceURI===vse.svg?Xw:Yw;let r=-1,i={};for(;++r<t.attrs.length;){let e=t.attrs[r],n=(e.prefix?e.prefix+`:`:``)+e.name;iT.call(yse,n)||(i[n]=e.value)}let a=(e.schema.space===`svg`?gse:hse)(t.tagName,i,oT(e,t.childNodes));if(sT(e,t,a),a.tagName===`template`){let n=t,r=n.sourceCodeLocation,i=r&&r.startTag&&cT(r.startTag),o=r&&r.endTag&&cT(r.endTag),s=aT(e,n.content);i&&o&&e.file&&(s.position={start:i.end,end:o.start}),a.content=s}return e.schema=n,a}function sT(e,t,n){if(`sourceCodeLocation`in t&&t.sourceCodeLocation&&e.file){let r=Sse(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function Sse(e,t,n){let r=cT(n);if(t.type===`element`){let i=t.children[t.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),e.verbose){let r={},i;if(n.attrs)for(i in n.attrs)iT.call(n.attrs,i)&&(r[Jw(e.schema,i).property]=cT(n.attrs[i]));n.startTag;let a=cT(n.startTag),o=n.endTag?cT(n.endTag):void 0,s={opening:a};o&&(s.closing=o),s.properties=r,t.data={position:s}}}return r}function cT(e){let t=lT({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=lT({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function lT(e){return e.line&&e.column?e:void 0}const Cse=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]);var G;(function(e){e[e.EOF=-1]=`EOF`,e[e.NULL=0]=`NULL`,e[e.TABULATION=9]=`TABULATION`,e[e.CARRIAGE_RETURN=13]=`CARRIAGE_RETURN`,e[e.LINE_FEED=10]=`LINE_FEED`,e[e.FORM_FEED=12]=`FORM_FEED`,e[e.SPACE=32]=`SPACE`,e[e.EXCLAMATION_MARK=33]=`EXCLAMATION_MARK`,e[e.QUOTATION_MARK=34]=`QUOTATION_MARK`,e[e.AMPERSAND=38]=`AMPERSAND`,e[e.APOSTROPHE=39]=`APOSTROPHE`,e[e.HYPHEN_MINUS=45]=`HYPHEN_MINUS`,e[e.SOLIDUS=47]=`SOLIDUS`,e[e.DIGIT_0=48]=`DIGIT_0`,e[e.DIGIT_9=57]=`DIGIT_9`,e[e.SEMICOLON=59]=`SEMICOLON`,e[e.LESS_THAN_SIGN=60]=`LESS_THAN_SIGN`,e[e.EQUALS_SIGN=61]=`EQUALS_SIGN`,e[e.GREATER_THAN_SIGN=62]=`GREATER_THAN_SIGN`,e[e.QUESTION_MARK=63]=`QUESTION_MARK`,e[e.LATIN_CAPITAL_A=65]=`LATIN_CAPITAL_A`,e[e.LATIN_CAPITAL_Z=90]=`LATIN_CAPITAL_Z`,e[e.RIGHT_SQUARE_BRACKET=93]=`RIGHT_SQUARE_BRACKET`,e[e.GRAVE_ACCENT=96]=`GRAVE_ACCENT`,e[e.LATIN_SMALL_A=97]=`LATIN_SMALL_A`,e[e.LATIN_SMALL_Z=122]=`LATIN_SMALL_Z`})(G||={});const uT={DASH_DASH:`--`,CDATA_START:`[CDATA[`,DOCTYPE:`doctype`,SCRIPT:`script`,PUBLIC:`public`,SYSTEM:`system`};function dT(e){return e>=55296&&e<=57343}function wse(e){return e>=56320&&e<=57343}function Tse(e,t){return(e-55296)*1024+9216+t}function fT(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function pT(e){return e>=64976&&e<=65007||Cse.has(e)}var K;(function(e){e.controlCharacterInInputStream=`control-character-in-input-stream`,e.noncharacterInInputStream=`noncharacter-in-input-stream`,e.surrogateInInputStream=`surrogate-in-input-stream`,e.nonVoidHtmlElementStartTagWithTrailingSolidus=`non-void-html-element-start-tag-with-trailing-solidus`,e.endTagWithAttributes=`end-tag-with-attributes`,e.endTagWithTrailingSolidus=`end-tag-with-trailing-solidus`,e.unexpectedSolidusInTag=`unexpected-solidus-in-tag`,e.unexpectedNullCharacter=`unexpected-null-character`,e.unexpectedQuestionMarkInsteadOfTagName=`unexpected-question-mark-instead-of-tag-name`,e.invalidFirstCharacterOfTagName=`invalid-first-character-of-tag-name`,e.unexpectedEqualsSignBeforeAttributeName=`unexpected-equals-sign-before-attribute-name`,e.missingEndTagName=`missing-end-tag-name`,e.unexpectedCharacterInAttributeName=`unexpected-character-in-attribute-name`,e.unknownNamedCharacterReference=`unknown-named-character-reference`,e.missingSemicolonAfterCharacterReference=`missing-semicolon-after-character-reference`,e.unexpectedCharacterAfterDoctypeSystemIdentifier=`unexpected-character-after-doctype-system-identifier`,e.unexpectedCharacterInUnquotedAttributeValue=`unexpected-character-in-unquoted-attribute-value`,e.eofBeforeTagName=`eof-before-tag-name`,e.eofInTag=`eof-in-tag`,e.missingAttributeValue=`missing-attribute-value`,e.missingWhitespaceBetweenAttributes=`missing-whitespace-between-attributes`,e.missingWhitespaceAfterDoctypePublicKeyword=`missing-whitespace-after-doctype-public-keyword`,e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers=`missing-whitespace-between-doctype-public-and-system-identifiers`,e.missingWhitespaceAfterDoctypeSystemKeyword=`missing-whitespace-after-doctype-system-keyword`,e.missingQuoteBeforeDoctypePublicIdentifier=`missing-quote-before-doctype-public-identifier`,e.missingQuoteBeforeDoctypeSystemIdentifier=`missing-quote-before-doctype-system-identifier`,e.missingDoctypePublicIdentifier=`missing-doctype-public-identifier`,e.missingDoctypeSystemIdentifier=`missing-doctype-system-identifier`,e.abruptDoctypePublicIdentifier=`abrupt-doctype-public-identifier`,e.abruptDoctypeSystemIdentifier=`abrupt-doctype-system-identifier`,e.cdataInHtmlContent=`cdata-in-html-content`,e.incorrectlyOpenedComment=`incorrectly-opened-comment`,e.eofInScriptHtmlCommentLikeText=`eof-in-script-html-comment-like-text`,e.eofInDoctype=`eof-in-doctype`,e.nestedComment=`nested-comment`,e.abruptClosingOfEmptyComment=`abrupt-closing-of-empty-comment`,e.eofInComment=`eof-in-comment`,e.incorrectlyClosedComment=`incorrectly-closed-comment`,e.eofInCdata=`eof-in-cdata`,e.absenceOfDigitsInNumericCharacterReference=`absence-of-digits-in-numeric-character-reference`,e.nullCharacterReference=`null-character-reference`,e.surrogateCharacterReference=`surrogate-character-reference`,e.characterReferenceOutsideUnicodeRange=`character-reference-outside-unicode-range`,e.controlCharacterReference=`control-character-reference`,e.noncharacterCharacterReference=`noncharacter-character-reference`,e.missingWhitespaceBeforeDoctypeName=`missing-whitespace-before-doctype-name`,e.missingDoctypeName=`missing-doctype-name`,e.invalidCharacterSequenceAfterDoctypeName=`invalid-character-sequence-after-doctype-name`,e.duplicateAttribute=`duplicate-attribute`,e.nonConformingDoctype=`non-conforming-doctype`,e.missingDoctype=`missing-doctype`,e.misplacedDoctype=`misplaced-doctype`,e.endTagWithoutMatchingOpenElement=`end-tag-without-matching-open-element`,e.closingOfElementWithOpenChildElements=`closing-of-element-with-open-child-elements`,e.disallowedContentInNoscriptInHead=`disallowed-content-in-noscript-in-head`,e.openElementsLeftAfterEof=`open-elements-left-after-eof`,e.abandonedHeadElementChild=`abandoned-head-element-child`,e.misplacedStartTagForHeadElement=`misplaced-start-tag-for-head-element`,e.nestedNoscriptInHead=`nested-noscript-in-head`,e.eofInElementThatCanContainOnlyText=`eof-in-element-that-can-contain-only-text`})(K||={});var Ese=class{constructor(e){this.handler=e,this.html=``,this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=65536,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+Number(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,t){let{line:n,col:r,offset:i}=this,a=r+t,o=i+t;return{code:e,startLine:n,endLine:n,startCol:a,endCol:a,startOffset:o,endOffset:o}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){let t=this.html.charCodeAt(this.pos+1);if(wse(t))return this.pos++,this._addGap(),Tse(e,t)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,G.EOF;return this._err(K.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,t){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=t}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,t){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(t)return this.html.startsWith(e,this.pos);for(let t=0;t<e.length;t++)if((this.html.charCodeAt(this.pos+t)|32)!==e.charCodeAt(t))return!1;return!0}peek(e){let t=this.pos+e;if(t>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,G.EOF;let n=this.html.charCodeAt(t);return n===G.CARRIAGE_RETURN?G.LINE_FEED:n}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,G.EOF;let e=this.html.charCodeAt(this.pos);return e===G.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,G.LINE_FEED):e===G.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,dT(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===G.LINE_FEED||e===G.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){fT(e)?this._err(K.controlCharacterInInputStream):pT(e)&&this._err(K.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}},mT;(function(e){e[e.CHARACTER=0]=`CHARACTER`,e[e.NULL_CHARACTER=1]=`NULL_CHARACTER`,e[e.WHITESPACE_CHARACTER=2]=`WHITESPACE_CHARACTER`,e[e.START_TAG=3]=`START_TAG`,e[e.END_TAG=4]=`END_TAG`,e[e.COMMENT=5]=`COMMENT`,e[e.DOCTYPE=6]=`DOCTYPE`,e[e.EOF=7]=`EOF`,e[e.HIBERNATION=8]=`HIBERNATION`})(mT||={});function hT(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const Dse=new Uint16Array(`ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻\xA0ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌`.split(``).map(e=>e.charCodeAt(0))),Ose=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);String.fromCodePoint;function kse(e){return e>=55296&&e<=57343||e>1114111?65533:Ose.get(e)??e}var gT;(function(e){e[e.NUM=35]=`NUM`,e[e.SEMI=59]=`SEMI`,e[e.EQUALS=61]=`EQUALS`,e[e.ZERO=48]=`ZERO`,e[e.NINE=57]=`NINE`,e[e.LOWER_A=97]=`LOWER_A`,e[e.LOWER_F=102]=`LOWER_F`,e[e.LOWER_X=120]=`LOWER_X`,e[e.LOWER_Z=122]=`LOWER_Z`,e[e.UPPER_A=65]=`UPPER_A`,e[e.UPPER_F=70]=`UPPER_F`,e[e.UPPER_Z=90]=`UPPER_Z`})(gT||={});var _T;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.BRANCH_LENGTH=16256]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(_T||={});function vT(e){return e>=gT.ZERO&&e<=gT.NINE}function Ase(e){return e>=gT.UPPER_A&&e<=gT.UPPER_F||e>=gT.LOWER_A&&e<=gT.LOWER_F}function jse(e){return e>=gT.UPPER_A&&e<=gT.UPPER_Z||e>=gT.LOWER_A&&e<=gT.LOWER_Z||vT(e)}function Mse(e){return e===gT.EQUALS||jse(e)}var yT;(function(e){e[e.EntityStart=0]=`EntityStart`,e[e.NumericStart=1]=`NumericStart`,e[e.NumericDecimal=2]=`NumericDecimal`,e[e.NumericHex=3]=`NumericHex`,e[e.NamedEntity=4]=`NamedEntity`})(yT||={});var bT;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(bT||={});var Nse=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=yT.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=bT.Strict}startEntity(e){this.decodeMode=e,this.state=yT.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case yT.EntityStart:return e.charCodeAt(t)===gT.NUM?(this.state=yT.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=yT.NamedEntity,this.stateNamedEntity(e,t));case yT.NumericStart:return this.stateNumericStart(e,t);case yT.NumericDecimal:return this.stateNumericDecimal(e,t);case yT.NumericHex:return this.stateNumericHex(e,t);case yT.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|32)===gT.LOWER_X?(this.state=yT.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=yT.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,r){if(t!==n){let i=n-t;this.result=this.result*r**+i+Number.parseInt(e.substr(t,i),r),this.consumed+=i}}stateNumericHex(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(vT(r)||Ase(r))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(vT(r))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)==null||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===gT.SEMI)this.consumed+=1;else if(this.decodeMode===bT.Strict)return 0;return this.emitCodePoint(kse(this.result),this.consumed),this.errors&&(e!==gT.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&_T.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){let a=e.charCodeAt(t);if(this.treeIndex=Pse(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===bT.Attribute&&(i===0||Mse(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&_T.VALUE_LENGTH)>>14,i!==0){if(a===gT.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==bT.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;let{result:t,decodeTree:n}=this,r=(n[t]&_T.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),(e=this.errors)==null||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~_T.VALUE_LENGTH:r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case yT.NamedEntity:return this.result!==0&&(this.decodeMode!==bT.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case yT.NumericDecimal:return this.emitNumericEntity(0,2);case yT.NumericHex:return this.emitNumericEntity(0,3);case yT.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case yT.EntityStart:return 0}}};function Pse(e,t,n,r){let i=(t&_T.BRANCH_LENGTH)>>7,a=t&_T.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){let t=r-a;return t<0||t>=i?-1:e[n+t]-1}let o=n,s=o+i-1;for(;o<=s;){let t=o+s>>>1,n=e[t];if(n<r)o=t+1;else if(n>r)s=t-1;else return e[t+i]}return-1}var q;(function(e){e.HTML=`http://www.w3.org/1999/xhtml`,e.MATHML=`http://www.w3.org/1998/Math/MathML`,e.SVG=`http://www.w3.org/2000/svg`,e.XLINK=`http://www.w3.org/1999/xlink`,e.XML=`http://www.w3.org/XML/1998/namespace`,e.XMLNS=`http://www.w3.org/2000/xmlns/`})(q||={});var xT;(function(e){e.TYPE=`type`,e.ACTION=`action`,e.ENCODING=`encoding`,e.PROMPT=`prompt`,e.NAME=`name`,e.COLOR=`color`,e.FACE=`face`,e.SIZE=`size`})(xT||={});var ST;(function(e){e.NO_QUIRKS=`no-quirks`,e.QUIRKS=`quirks`,e.LIMITED_QUIRKS=`limited-quirks`})(ST||={});var J;(function(e){e.A=`a`,e.ADDRESS=`address`,e.ANNOTATION_XML=`annotation-xml`,e.APPLET=`applet`,e.AREA=`area`,e.ARTICLE=`article`,e.ASIDE=`aside`,e.B=`b`,e.BASE=`base`,e.BASEFONT=`basefont`,e.BGSOUND=`bgsound`,e.BIG=`big`,e.BLOCKQUOTE=`blockquote`,e.BODY=`body`,e.BR=`br`,e.BUTTON=`button`,e.CAPTION=`caption`,e.CENTER=`center`,e.CODE=`code`,e.COL=`col`,e.COLGROUP=`colgroup`,e.DD=`dd`,e.DESC=`desc`,e.DETAILS=`details`,e.DIALOG=`dialog`,e.DIR=`dir`,e.DIV=`div`,e.DL=`dl`,e.DT=`dt`,e.EM=`em`,e.EMBED=`embed`,e.FIELDSET=`fieldset`,e.FIGCAPTION=`figcaption`,e.FIGURE=`figure`,e.FONT=`font`,e.FOOTER=`footer`,e.FOREIGN_OBJECT=`foreignObject`,e.FORM=`form`,e.FRAME=`frame`,e.FRAMESET=`frameset`,e.H1=`h1`,e.H2=`h2`,e.H3=`h3`,e.H4=`h4`,e.H5=`h5`,e.H6=`h6`,e.HEAD=`head`,e.HEADER=`header`,e.HGROUP=`hgroup`,e.HR=`hr`,e.HTML=`html`,e.I=`i`,e.IMG=`img`,e.IMAGE=`image`,e.INPUT=`input`,e.IFRAME=`iframe`,e.KEYGEN=`keygen`,e.LABEL=`label`,e.LI=`li`,e.LINK=`link`,e.LISTING=`listing`,e.MAIN=`main`,e.MALIGNMARK=`malignmark`,e.MARQUEE=`marquee`,e.MATH=`math`,e.MENU=`menu`,e.META=`meta`,e.MGLYPH=`mglyph`,e.MI=`mi`,e.MO=`mo`,e.MN=`mn`,e.MS=`ms`,e.MTEXT=`mtext`,e.NAV=`nav`,e.NOBR=`nobr`,e.NOFRAMES=`noframes`,e.NOEMBED=`noembed`,e.NOSCRIPT=`noscript`,e.OBJECT=`object`,e.OL=`ol`,e.OPTGROUP=`optgroup`,e.OPTION=`option`,e.P=`p`,e.PARAM=`param`,e.PLAINTEXT=`plaintext`,e.PRE=`pre`,e.RB=`rb`,e.RP=`rp`,e.RT=`rt`,e.RTC=`rtc`,e.RUBY=`ruby`,e.S=`s`,e.SCRIPT=`script`,e.SEARCH=`search`,e.SECTION=`section`,e.SELECT=`select`,e.SOURCE=`source`,e.SMALL=`small`,e.SPAN=`span`,e.STRIKE=`strike`,e.STRONG=`strong`,e.STYLE=`style`,e.SUB=`sub`,e.SUMMARY=`summary`,e.SUP=`sup`,e.TABLE=`table`,e.TBODY=`tbody`,e.TEMPLATE=`template`,e.TEXTAREA=`textarea`,e.TFOOT=`tfoot`,e.TD=`td`,e.TH=`th`,e.THEAD=`thead`,e.TITLE=`title`,e.TR=`tr`,e.TRACK=`track`,e.TT=`tt`,e.U=`u`,e.UL=`ul`,e.SVG=`svg`,e.VAR=`var`,e.WBR=`wbr`,e.XMP=`xmp`})(J||={});var Y;(function(e){e[e.UNKNOWN=0]=`UNKNOWN`,e[e.A=1]=`A`,e[e.ADDRESS=2]=`ADDRESS`,e[e.ANNOTATION_XML=3]=`ANNOTATION_XML`,e[e.APPLET=4]=`APPLET`,e[e.AREA=5]=`AREA`,e[e.ARTICLE=6]=`ARTICLE`,e[e.ASIDE=7]=`ASIDE`,e[e.B=8]=`B`,e[e.BASE=9]=`BASE`,e[e.BASEFONT=10]=`BASEFONT`,e[e.BGSOUND=11]=`BGSOUND`,e[e.BIG=12]=`BIG`,e[e.BLOCKQUOTE=13]=`BLOCKQUOTE`,e[e.BODY=14]=`BODY`,e[e.BR=15]=`BR`,e[e.BUTTON=16]=`BUTTON`,e[e.CAPTION=17]=`CAPTION`,e[e.CENTER=18]=`CENTER`,e[e.CODE=19]=`CODE`,e[e.COL=20]=`COL`,e[e.COLGROUP=21]=`COLGROUP`,e[e.DD=22]=`DD`,e[e.DESC=23]=`DESC`,e[e.DETAILS=24]=`DETAILS`,e[e.DIALOG=25]=`DIALOG`,e[e.DIR=26]=`DIR`,e[e.DIV=27]=`DIV`,e[e.DL=28]=`DL`,e[e.DT=29]=`DT`,e[e.EM=30]=`EM`,e[e.EMBED=31]=`EMBED`,e[e.FIELDSET=32]=`FIELDSET`,e[e.FIGCAPTION=33]=`FIGCAPTION`,e[e.FIGURE=34]=`FIGURE`,e[e.FONT=35]=`FONT`,e[e.FOOTER=36]=`FOOTER`,e[e.FOREIGN_OBJECT=37]=`FOREIGN_OBJECT`,e[e.FORM=38]=`FORM`,e[e.FRAME=39]=`FRAME`,e[e.FRAMESET=40]=`FRAMESET`,e[e.H1=41]=`H1`,e[e.H2=42]=`H2`,e[e.H3=43]=`H3`,e[e.H4=44]=`H4`,e[e.H5=45]=`H5`,e[e.H6=46]=`H6`,e[e.HEAD=47]=`HEAD`,e[e.HEADER=48]=`HEADER`,e[e.HGROUP=49]=`HGROUP`,e[e.HR=50]=`HR`,e[e.HTML=51]=`HTML`,e[e.I=52]=`I`,e[e.IMG=53]=`IMG`,e[e.IMAGE=54]=`IMAGE`,e[e.INPUT=55]=`INPUT`,e[e.IFRAME=56]=`IFRAME`,e[e.KEYGEN=57]=`KEYGEN`,e[e.LABEL=58]=`LABEL`,e[e.LI=59]=`LI`,e[e.LINK=60]=`LINK`,e[e.LISTING=61]=`LISTING`,e[e.MAIN=62]=`MAIN`,e[e.MALIGNMARK=63]=`MALIGNMARK`,e[e.MARQUEE=64]=`MARQUEE`,e[e.MATH=65]=`MATH`,e[e.MENU=66]=`MENU`,e[e.META=67]=`META`,e[e.MGLYPH=68]=`MGLYPH`,e[e.MI=69]=`MI`,e[e.MO=70]=`MO`,e[e.MN=71]=`MN`,e[e.MS=72]=`MS`,e[e.MTEXT=73]=`MTEXT`,e[e.NAV=74]=`NAV`,e[e.NOBR=75]=`NOBR`,e[e.NOFRAMES=76]=`NOFRAMES`,e[e.NOEMBED=77]=`NOEMBED`,e[e.NOSCRIPT=78]=`NOSCRIPT`,e[e.OBJECT=79]=`OBJECT`,e[e.OL=80]=`OL`,e[e.OPTGROUP=81]=`OPTGROUP`,e[e.OPTION=82]=`OPTION`,e[e.P=83]=`P`,e[e.PARAM=84]=`PARAM`,e[e.PLAINTEXT=85]=`PLAINTEXT`,e[e.PRE=86]=`PRE`,e[e.RB=87]=`RB`,e[e.RP=88]=`RP`,e[e.RT=89]=`RT`,e[e.RTC=90]=`RTC`,e[e.RUBY=91]=`RUBY`,e[e.S=92]=`S`,e[e.SCRIPT=93]=`SCRIPT`,e[e.SEARCH=94]=`SEARCH`,e[e.SECTION=95]=`SECTION`,e[e.SELECT=96]=`SELECT`,e[e.SOURCE=97]=`SOURCE`,e[e.SMALL=98]=`SMALL`,e[e.SPAN=99]=`SPAN`,e[e.STRIKE=100]=`STRIKE`,e[e.STRONG=101]=`STRONG`,e[e.STYLE=102]=`STYLE`,e[e.SUB=103]=`SUB`,e[e.SUMMARY=104]=`SUMMARY`,e[e.SUP=105]=`SUP`,e[e.TABLE=106]=`TABLE`,e[e.TBODY=107]=`TBODY`,e[e.TEMPLATE=108]=`TEMPLATE`,e[e.TEXTAREA=109]=`TEXTAREA`,e[e.TFOOT=110]=`TFOOT`,e[e.TD=111]=`TD`,e[e.TH=112]=`TH`,e[e.THEAD=113]=`THEAD`,e[e.TITLE=114]=`TITLE`,e[e.TR=115]=`TR`,e[e.TRACK=116]=`TRACK`,e[e.TT=117]=`TT`,e[e.U=118]=`U`,e[e.UL=119]=`UL`,e[e.SVG=120]=`SVG`,e[e.VAR=121]=`VAR`,e[e.WBR=122]=`WBR`,e[e.XMP=123]=`XMP`})(Y||={});const Fse=new Map([[J.A,Y.A],[J.ADDRESS,Y.ADDRESS],[J.ANNOTATION_XML,Y.ANNOTATION_XML],[J.APPLET,Y.APPLET],[J.AREA,Y.AREA],[J.ARTICLE,Y.ARTICLE],[J.ASIDE,Y.ASIDE],[J.B,Y.B],[J.BASE,Y.BASE],[J.BASEFONT,Y.BASEFONT],[J.BGSOUND,Y.BGSOUND],[J.BIG,Y.BIG],[J.BLOCKQUOTE,Y.BLOCKQUOTE],[J.BODY,Y.BODY],[J.BR,Y.BR],[J.BUTTON,Y.BUTTON],[J.CAPTION,Y.CAPTION],[J.CENTER,Y.CENTER],[J.CODE,Y.CODE],[J.COL,Y.COL],[J.COLGROUP,Y.COLGROUP],[J.DD,Y.DD],[J.DESC,Y.DESC],[J.DETAILS,Y.DETAILS],[J.DIALOG,Y.DIALOG],[J.DIR,Y.DIR],[J.DIV,Y.DIV],[J.DL,Y.DL],[J.DT,Y.DT],[J.EM,Y.EM],[J.EMBED,Y.EMBED],[J.FIELDSET,Y.FIELDSET],[J.FIGCAPTION,Y.FIGCAPTION],[J.FIGURE,Y.FIGURE],[J.FONT,Y.FONT],[J.FOOTER,Y.FOOTER],[J.FOREIGN_OBJECT,Y.FOREIGN_OBJECT],[J.FORM,Y.FORM],[J.FRAME,Y.FRAME],[J.FRAMESET,Y.FRAMESET],[J.H1,Y.H1],[J.H2,Y.H2],[J.H3,Y.H3],[J.H4,Y.H4],[J.H5,Y.H5],[J.H6,Y.H6],[J.HEAD,Y.HEAD],[J.HEADER,Y.HEADER],[J.HGROUP,Y.HGROUP],[J.HR,Y.HR],[J.HTML,Y.HTML],[J.I,Y.I],[J.IMG,Y.IMG],[J.IMAGE,Y.IMAGE],[J.INPUT,Y.INPUT],[J.IFRAME,Y.IFRAME],[J.KEYGEN,Y.KEYGEN],[J.LABEL,Y.LABEL],[J.LI,Y.LI],[J.LINK,Y.LINK],[J.LISTING,Y.LISTING],[J.MAIN,Y.MAIN],[J.MALIGNMARK,Y.MALIGNMARK],[J.MARQUEE,Y.MARQUEE],[J.MATH,Y.MATH],[J.MENU,Y.MENU],[J.META,Y.META],[J.MGLYPH,Y.MGLYPH],[J.MI,Y.MI],[J.MO,Y.MO],[J.MN,Y.MN],[J.MS,Y.MS],[J.MTEXT,Y.MTEXT],[J.NAV,Y.NAV],[J.NOBR,Y.NOBR],[J.NOFRAMES,Y.NOFRAMES],[J.NOEMBED,Y.NOEMBED],[J.NOSCRIPT,Y.NOSCRIPT],[J.OBJECT,Y.OBJECT],[J.OL,Y.OL],[J.OPTGROUP,Y.OPTGROUP],[J.OPTION,Y.OPTION],[J.P,Y.P],[J.PARAM,Y.PARAM],[J.PLAINTEXT,Y.PLAINTEXT],[J.PRE,Y.PRE],[J.RB,Y.RB],[J.RP,Y.RP],[J.RT,Y.RT],[J.RTC,Y.RTC],[J.RUBY,Y.RUBY],[J.S,Y.S],[J.SCRIPT,Y.SCRIPT],[J.SEARCH,Y.SEARCH],[J.SECTION,Y.SECTION],[J.SELECT,Y.SELECT],[J.SOURCE,Y.SOURCE],[J.SMALL,Y.SMALL],[J.SPAN,Y.SPAN],[J.STRIKE,Y.STRIKE],[J.STRONG,Y.STRONG],[J.STYLE,Y.STYLE],[J.SUB,Y.SUB],[J.SUMMARY,Y.SUMMARY],[J.SUP,Y.SUP],[J.TABLE,Y.TABLE],[J.TBODY,Y.TBODY],[J.TEMPLATE,Y.TEMPLATE],[J.TEXTAREA,Y.TEXTAREA],[J.TFOOT,Y.TFOOT],[J.TD,Y.TD],[J.TH,Y.TH],[J.THEAD,Y.THEAD],[J.TITLE,Y.TITLE],[J.TR,Y.TR],[J.TRACK,Y.TRACK],[J.TT,Y.TT],[J.U,Y.U],[J.UL,Y.UL],[J.SVG,Y.SVG],[J.VAR,Y.VAR],[J.WBR,Y.WBR],[J.XMP,Y.XMP]]);function CT(e){return Fse.get(e)??Y.UNKNOWN}const wT=Y,Ise={[q.HTML]:new Set([wT.ADDRESS,wT.APPLET,wT.AREA,wT.ARTICLE,wT.ASIDE,wT.BASE,wT.BASEFONT,wT.BGSOUND,wT.BLOCKQUOTE,wT.BODY,wT.BR,wT.BUTTON,wT.CAPTION,wT.CENTER,wT.COL,wT.COLGROUP,wT.DD,wT.DETAILS,wT.DIR,wT.DIV,wT.DL,wT.DT,wT.EMBED,wT.FIELDSET,wT.FIGCAPTION,wT.FIGURE,wT.FOOTER,wT.FORM,wT.FRAME,wT.FRAMESET,wT.H1,wT.H2,wT.H3,wT.H4,wT.H5,wT.H6,wT.HEAD,wT.HEADER,wT.HGROUP,wT.HR,wT.HTML,wT.IFRAME,wT.IMG,wT.INPUT,wT.LI,wT.LINK,wT.LISTING,wT.MAIN,wT.MARQUEE,wT.MENU,wT.META,wT.NAV,wT.NOEMBED,wT.NOFRAMES,wT.NOSCRIPT,wT.OBJECT,wT.OL,wT.P,wT.PARAM,wT.PLAINTEXT,wT.PRE,wT.SCRIPT,wT.SECTION,wT.SELECT,wT.SOURCE,wT.STYLE,wT.SUMMARY,wT.TABLE,wT.TBODY,wT.TD,wT.TEMPLATE,wT.TEXTAREA,wT.TFOOT,wT.TH,wT.THEAD,wT.TITLE,wT.TR,wT.TRACK,wT.UL,wT.WBR,wT.XMP]),[q.MATHML]:new Set([wT.MI,wT.MO,wT.MN,wT.MS,wT.MTEXT,wT.ANNOTATION_XML]),[q.SVG]:new Set([wT.TITLE,wT.FOREIGN_OBJECT,wT.DESC]),[q.XLINK]:new Set,[q.XML]:new Set,[q.XMLNS]:new Set},TT=new Set([wT.H1,wT.H2,wT.H3,wT.H4,wT.H5,wT.H6]);new Set([J.STYLE,J.SCRIPT,J.XMP,J.IFRAME,J.NOEMBED,J.NOFRAMES,J.PLAINTEXT]);var X;(function(e){e[e.DATA=0]=`DATA`,e[e.RCDATA=1]=`RCDATA`,e[e.RAWTEXT=2]=`RAWTEXT`,e[e.SCRIPT_DATA=3]=`SCRIPT_DATA`,e[e.PLAINTEXT=4]=`PLAINTEXT`,e[e.TAG_OPEN=5]=`TAG_OPEN`,e[e.END_TAG_OPEN=6]=`END_TAG_OPEN`,e[e.TAG_NAME=7]=`TAG_NAME`,e[e.RCDATA_LESS_THAN_SIGN=8]=`RCDATA_LESS_THAN_SIGN`,e[e.RCDATA_END_TAG_OPEN=9]=`RCDATA_END_TAG_OPEN`,e[e.RCDATA_END_TAG_NAME=10]=`RCDATA_END_TAG_NAME`,e[e.RAWTEXT_LESS_THAN_SIGN=11]=`RAWTEXT_LESS_THAN_SIGN`,e[e.RAWTEXT_END_TAG_OPEN=12]=`RAWTEXT_END_TAG_OPEN`,e[e.RAWTEXT_END_TAG_NAME=13]=`RAWTEXT_END_TAG_NAME`,e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]=`SCRIPT_DATA_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_END_TAG_OPEN=15]=`SCRIPT_DATA_END_TAG_OPEN`,e[e.SCRIPT_DATA_END_TAG_NAME=16]=`SCRIPT_DATA_END_TAG_NAME`,e[e.SCRIPT_DATA_ESCAPE_START=17]=`SCRIPT_DATA_ESCAPE_START`,e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]=`SCRIPT_DATA_ESCAPE_START_DASH`,e[e.SCRIPT_DATA_ESCAPED=19]=`SCRIPT_DATA_ESCAPED`,e[e.SCRIPT_DATA_ESCAPED_DASH=20]=`SCRIPT_DATA_ESCAPED_DASH`,e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]=`SCRIPT_DATA_ESCAPED_DASH_DASH`,e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]=`SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]=`SCRIPT_DATA_ESCAPED_END_TAG_OPEN`,e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]=`SCRIPT_DATA_ESCAPED_END_TAG_NAME`,e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]=`SCRIPT_DATA_DOUBLE_ESCAPE_START`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]=`SCRIPT_DATA_DOUBLE_ESCAPED`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]=`SCRIPT_DATA_DOUBLE_ESCAPED_DASH`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]=`SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]=`SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]=`SCRIPT_DATA_DOUBLE_ESCAPE_END`,e[e.BEFORE_ATTRIBUTE_NAME=31]=`BEFORE_ATTRIBUTE_NAME`,e[e.ATTRIBUTE_NAME=32]=`ATTRIBUTE_NAME`,e[e.AFTER_ATTRIBUTE_NAME=33]=`AFTER_ATTRIBUTE_NAME`,e[e.BEFORE_ATTRIBUTE_VALUE=34]=`BEFORE_ATTRIBUTE_VALUE`,e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]=`ATTRIBUTE_VALUE_DOUBLE_QUOTED`,e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]=`ATTRIBUTE_VALUE_SINGLE_QUOTED`,e[e.ATTRIBUTE_VALUE_UNQUOTED=37]=`ATTRIBUTE_VALUE_UNQUOTED`,e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]=`AFTER_ATTRIBUTE_VALUE_QUOTED`,e[e.SELF_CLOSING_START_TAG=39]=`SELF_CLOSING_START_TAG`,e[e.BOGUS_COMMENT=40]=`BOGUS_COMMENT`,e[e.MARKUP_DECLARATION_OPEN=41]=`MARKUP_DECLARATION_OPEN`,e[e.COMMENT_START=42]=`COMMENT_START`,e[e.COMMENT_START_DASH=43]=`COMMENT_START_DASH`,e[e.COMMENT=44]=`COMMENT`,e[e.COMMENT_LESS_THAN_SIGN=45]=`COMMENT_LESS_THAN_SIGN`,e[e.COMMENT_LESS_THAN_SIGN_BANG=46]=`COMMENT_LESS_THAN_SIGN_BANG`,e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]=`COMMENT_LESS_THAN_SIGN_BANG_DASH`,e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]=`COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH`,e[e.COMMENT_END_DASH=49]=`COMMENT_END_DASH`,e[e.COMMENT_END=50]=`COMMENT_END`,e[e.COMMENT_END_BANG=51]=`COMMENT_END_BANG`,e[e.DOCTYPE=52]=`DOCTYPE`,e[e.BEFORE_DOCTYPE_NAME=53]=`BEFORE_DOCTYPE_NAME`,e[e.DOCTYPE_NAME=54]=`DOCTYPE_NAME`,e[e.AFTER_DOCTYPE_NAME=55]=`AFTER_DOCTYPE_NAME`,e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]=`AFTER_DOCTYPE_PUBLIC_KEYWORD`,e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]=`BEFORE_DOCTYPE_PUBLIC_IDENTIFIER`,e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]=`DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED`,e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]=`DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED`,e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]=`AFTER_DOCTYPE_PUBLIC_IDENTIFIER`,e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]=`BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS`,e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]=`AFTER_DOCTYPE_SYSTEM_KEYWORD`,e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]=`BEFORE_DOCTYPE_SYSTEM_IDENTIFIER`,e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]=`DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED`,e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]=`DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED`,e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]=`AFTER_DOCTYPE_SYSTEM_IDENTIFIER`,e[e.BOGUS_DOCTYPE=67]=`BOGUS_DOCTYPE`,e[e.CDATA_SECTION=68]=`CDATA_SECTION`,e[e.CDATA_SECTION_BRACKET=69]=`CDATA_SECTION_BRACKET`,e[e.CDATA_SECTION_END=70]=`CDATA_SECTION_END`,e[e.CHARACTER_REFERENCE=71]=`CHARACTER_REFERENCE`,e[e.AMBIGUOUS_AMPERSAND=72]=`AMBIGUOUS_AMPERSAND`})(X||={});const ET={DATA:X.DATA,RCDATA:X.RCDATA,RAWTEXT:X.RAWTEXT,SCRIPT_DATA:X.SCRIPT_DATA,PLAINTEXT:X.PLAINTEXT,CDATA_SECTION:X.CDATA_SECTION};function Lse(e){return e>=G.DIGIT_0&&e<=G.DIGIT_9}function DT(e){return e>=G.LATIN_CAPITAL_A&&e<=G.LATIN_CAPITAL_Z}function Rse(e){return e>=G.LATIN_SMALL_A&&e<=G.LATIN_SMALL_Z}function OT(e){return Rse(e)||DT(e)}function kT(e){return OT(e)||Lse(e)}function AT(e){return e+32}function jT(e){return e===G.SPACE||e===G.LINE_FEED||e===G.TABULATION||e===G.FORM_FEED}function MT(e){return jT(e)||e===G.SOLIDUS||e===G.GREATER_THAN_SIGN}function zse(e){return e===G.NULL?K.nullCharacterReference:e>1114111?K.characterReferenceOutsideUnicodeRange:dT(e)?K.surrogateCharacterReference:pT(e)?K.noncharacterCharacterReference:fT(e)||e===G.CARRIAGE_RETURN?K.controlCharacterReference:null}var Bse=class{constructor(e,t){this.options=e,this.handler=t,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName=``,this.active=!1,this.state=X.DATA,this.returnState=X.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:``,value:``},this.preprocessor=new Ese(t),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new Nse(Dse,(e,t)=>{this.preprocessor.pos=this.entityStartPos+t-1,this._flushCodePointConsumedAsCharacterReference(e)},t.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(K.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:e=>{this._err(K.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+e)},validateNumericCharacterReference:e=>{let t=zse(e);t&&this._err(t,1)}}:void 0)}_err(e,t=0){var n,r;(r=(n=this.handler).onParseError)==null||r.call(n,this.preprocessor.getError(e,t))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;let e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw Error(`Parser was already resumed`);this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e?.())}write(e,t,n){this.active=!0,this.preprocessor.write(e,t),this._runParsingLoop(),this.paused||n?.()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let t=0;t<e;t++)this.preprocessor.advance()}_consumeSequenceIfMatch(e,t){return this.preprocessor.startsWith(e,t)?(this._advanceBy(e.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:mT.START_TAG,tagName:``,tagID:Y.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:mT.END_TAG,tagName:``,tagID:Y.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:mT.COMMENT,data:``,location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:mT.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(e,t){this.currentCharacterToken={type:e,chars:t,location:this.currentLocation}}_createAttr(e){this.currentAttr={name:e,value:``},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var e;let t=this.currentToken;if(hT(t,this.currentAttr.name)===null){if(t.attrs.push(this.currentAttr),t.location&&this.currentLocation){let n=(e=t.location).attrs??(e.attrs=Object.create(null));n[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(K.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(e){this._emitCurrentCharacterToken(e.location),this.currentToken=null,e.location&&(e.location.endLine=this.preprocessor.line,e.location.endCol=this.preprocessor.col+1,e.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){let e=this.currentToken;this.prepareToken(e),e.tagID=CT(e.tagName),e.type===mT.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(K.endTagWithAttributes),e.selfClosing&&this._err(K.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case mT.CHARACTER:this.handler.onCharacter(this.currentCharacterToken);break;case mT.NULL_CHARACTER:this.handler.onNullCharacter(this.currentCharacterToken);break;case mT.WHITESPACE_CHARACTER:this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}this.currentCharacterToken=null}}_emitEOFToken(){let e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:mT.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,t){if(this.currentCharacterToken)if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=t;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(e,t)}_emitCodePoint(e){let t=jT(e)?mT.WHITESPACE_CHARACTER:e===G.NULL?mT.NULL_CHARACTER:mT.CHARACTER;this._appendCharToCurrentCharacterToken(t,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(mT.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=X.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?bT.Attribute:bT.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===X.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===X.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===X.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case X.DATA:this._stateData(e);break;case X.RCDATA:this._stateRcdata(e);break;case X.RAWTEXT:this._stateRawtext(e);break;case X.SCRIPT_DATA:this._stateScriptData(e);break;case X.PLAINTEXT:this._statePlaintext(e);break;case X.TAG_OPEN:this._stateTagOpen(e);break;case X.END_TAG_OPEN:this._stateEndTagOpen(e);break;case X.TAG_NAME:this._stateTagName(e);break;case X.RCDATA_LESS_THAN_SIGN:this._stateRcdataLessThanSign(e);break;case X.RCDATA_END_TAG_OPEN:this._stateRcdataEndTagOpen(e);break;case X.RCDATA_END_TAG_NAME:this._stateRcdataEndTagName(e);break;case X.RAWTEXT_LESS_THAN_SIGN:this._stateRawtextLessThanSign(e);break;case X.RAWTEXT_END_TAG_OPEN:this._stateRawtextEndTagOpen(e);break;case X.RAWTEXT_END_TAG_NAME:this._stateRawtextEndTagName(e);break;case X.SCRIPT_DATA_LESS_THAN_SIGN:this._stateScriptDataLessThanSign(e);break;case X.SCRIPT_DATA_END_TAG_OPEN:this._stateScriptDataEndTagOpen(e);break;case X.SCRIPT_DATA_END_TAG_NAME:this._stateScriptDataEndTagName(e);break;case X.SCRIPT_DATA_ESCAPE_START:this._stateScriptDataEscapeStart(e);break;case X.SCRIPT_DATA_ESCAPE_START_DASH:this._stateScriptDataEscapeStartDash(e);break;case X.SCRIPT_DATA_ESCAPED:this._stateScriptDataEscaped(e);break;case X.SCRIPT_DATA_ESCAPED_DASH:this._stateScriptDataEscapedDash(e);break;case X.SCRIPT_DATA_ESCAPED_DASH_DASH:this._stateScriptDataEscapedDashDash(e);break;case X.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataEscapedLessThanSign(e);break;case X.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:this._stateScriptDataEscapedEndTagOpen(e);break;case X.SCRIPT_DATA_ESCAPED_END_TAG_NAME:this._stateScriptDataEscapedEndTagName(e);break;case X.SCRIPT_DATA_DOUBLE_ESCAPE_START:this._stateScriptDataDoubleEscapeStart(e);break;case X.SCRIPT_DATA_DOUBLE_ESCAPED:this._stateScriptDataDoubleEscaped(e);break;case X.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:this._stateScriptDataDoubleEscapedDash(e);break;case X.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:this._stateScriptDataDoubleEscapedDashDash(e);break;case X.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataDoubleEscapedLessThanSign(e);break;case X.SCRIPT_DATA_DOUBLE_ESCAPE_END:this._stateScriptDataDoubleEscapeEnd(e);break;case X.BEFORE_ATTRIBUTE_NAME:this._stateBeforeAttributeName(e);break;case X.ATTRIBUTE_NAME:this._stateAttributeName(e);break;case X.AFTER_ATTRIBUTE_NAME:this._stateAfterAttributeName(e);break;case X.BEFORE_ATTRIBUTE_VALUE:this._stateBeforeAttributeValue(e);break;case X.ATTRIBUTE_VALUE_DOUBLE_QUOTED:this._stateAttributeValueDoubleQuoted(e);break;case X.ATTRIBUTE_VALUE_SINGLE_QUOTED:this._stateAttributeValueSingleQuoted(e);break;case X.ATTRIBUTE_VALUE_UNQUOTED:this._stateAttributeValueUnquoted(e);break;case X.AFTER_ATTRIBUTE_VALUE_QUOTED:this._stateAfterAttributeValueQuoted(e);break;case X.SELF_CLOSING_START_TAG:this._stateSelfClosingStartTag(e);break;case X.BOGUS_COMMENT:this._stateBogusComment(e);break;case X.MARKUP_DECLARATION_OPEN:this._stateMarkupDeclarationOpen(e);break;case X.COMMENT_START:this._stateCommentStart(e);break;case X.COMMENT_START_DASH:this._stateCommentStartDash(e);break;case X.COMMENT:this._stateComment(e);break;case X.COMMENT_LESS_THAN_SIGN:this._stateCommentLessThanSign(e);break;case X.COMMENT_LESS_THAN_SIGN_BANG:this._stateCommentLessThanSignBang(e);break;case X.COMMENT_LESS_THAN_SIGN_BANG_DASH:this._stateCommentLessThanSignBangDash(e);break;case X.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:this._stateCommentLessThanSignBangDashDash(e);break;case X.COMMENT_END_DASH:this._stateCommentEndDash(e);break;case X.COMMENT_END:this._stateCommentEnd(e);break;case X.COMMENT_END_BANG:this._stateCommentEndBang(e);break;case X.DOCTYPE:this._stateDoctype(e);break;case X.BEFORE_DOCTYPE_NAME:this._stateBeforeDoctypeName(e);break;case X.DOCTYPE_NAME:this._stateDoctypeName(e);break;case X.AFTER_DOCTYPE_NAME:this._stateAfterDoctypeName(e);break;case X.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._stateAfterDoctypePublicKeyword(e);break;case X.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:this._stateBeforeDoctypePublicIdentifier(e);break;case X.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypePublicIdentifierDoubleQuoted(e);break;case X.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypePublicIdentifierSingleQuoted(e);break;case X.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:this._stateAfterDoctypePublicIdentifier(e);break;case X.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break;case X.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._stateAfterDoctypeSystemKeyword(e);break;case X.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:this._stateBeforeDoctypeSystemIdentifier(e);break;case X.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypeSystemIdentifierDoubleQuoted(e);break;case X.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypeSystemIdentifierSingleQuoted(e);break;case X.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:this._stateAfterDoctypeSystemIdentifier(e);break;case X.BOGUS_DOCTYPE:this._stateBogusDoctype(e);break;case X.CDATA_SECTION:this._stateCdataSection(e);break;case X.CDATA_SECTION_BRACKET:this._stateCdataSectionBracket(e);break;case X.CDATA_SECTION_END:this._stateCdataSectionEnd(e);break;case X.CHARACTER_REFERENCE:this._stateCharacterReference();break;case X.AMBIGUOUS_AMPERSAND:this._stateAmbiguousAmpersand(e);break;default:throw Error(`Unknown state`)}}_stateData(e){switch(e){case G.LESS_THAN_SIGN:this.state=X.TAG_OPEN;break;case G.AMPERSAND:this._startCharacterReference();break;case G.NULL:this._err(K.unexpectedNullCharacter),this._emitCodePoint(e);break;case G.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case G.AMPERSAND:this._startCharacterReference();break;case G.LESS_THAN_SIGN:this.state=X.RCDATA_LESS_THAN_SIGN;break;case G.NULL:this._err(K.unexpectedNullCharacter),this._emitChars(`�`);break;case G.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case G.LESS_THAN_SIGN:this.state=X.RAWTEXT_LESS_THAN_SIGN;break;case G.NULL:this._err(K.unexpectedNullCharacter),this._emitChars(`�`);break;case G.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case G.LESS_THAN_SIGN:this.state=X.SCRIPT_DATA_LESS_THAN_SIGN;break;case G.NULL:this._err(K.unexpectedNullCharacter),this._emitChars(`�`);break;case G.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case G.NULL:this._err(K.unexpectedNullCharacter),this._emitChars(`�`);break;case G.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateTagOpen(e){if(OT(e))this._createStartTagToken(),this.state=X.TAG_NAME,this._stateTagName(e);else switch(e){case G.EXCLAMATION_MARK:this.state=X.MARKUP_DECLARATION_OPEN;break;case G.SOLIDUS:this.state=X.END_TAG_OPEN;break;case G.QUESTION_MARK:this._err(K.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=X.BOGUS_COMMENT,this._stateBogusComment(e);break;case G.EOF:this._err(K.eofBeforeTagName),this._emitChars(`<`),this._emitEOFToken();break;default:this._err(K.invalidFirstCharacterOfTagName),this._emitChars(`<`),this.state=X.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(OT(e))this._createEndTagToken(),this.state=X.TAG_NAME,this._stateTagName(e);else switch(e){case G.GREATER_THAN_SIGN:this._err(K.missingEndTagName),this.state=X.DATA;break;case G.EOF:this._err(K.eofBeforeTagName),this._emitChars(`</`),this._emitEOFToken();break;default:this._err(K.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=X.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:this.state=X.BEFORE_ATTRIBUTE_NAME;break;case G.SOLIDUS:this.state=X.SELF_CLOSING_START_TAG;break;case G.GREATER_THAN_SIGN:this.state=X.DATA,this.emitCurrentTagToken();break;case G.NULL:this._err(K.unexpectedNullCharacter),t.tagName+=`�`;break;case G.EOF:this._err(K.eofInTag),this._emitEOFToken();break;default:t.tagName+=String.fromCodePoint(DT(e)?AT(e):e)}}_stateRcdataLessThanSign(e){e===G.SOLIDUS?this.state=X.RCDATA_END_TAG_OPEN:(this._emitChars(`<`),this.state=X.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){OT(e)?(this.state=X.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars(`</`),this.state=X.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();let t=this.currentToken;switch(t.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=X.BEFORE_ATTRIBUTE_NAME,!1;case G.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=X.SELF_CLOSING_START_TAG,!1;case G.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=X.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=X.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===G.SOLIDUS?this.state=X.RAWTEXT_END_TAG_OPEN:(this._emitChars(`<`),this.state=X.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){OT(e)?(this.state=X.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars(`</`),this.state=X.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=X.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case G.SOLIDUS:this.state=X.SCRIPT_DATA_END_TAG_OPEN;break;case G.EXCLAMATION_MARK:this.state=X.SCRIPT_DATA_ESCAPE_START,this._emitChars(`<!`);break;default:this._emitChars(`<`),this.state=X.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){OT(e)?(this.state=X.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars(`</`),this.state=X.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=X.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===G.HYPHEN_MINUS?(this.state=X.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars(`-`)):(this.state=X.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===G.HYPHEN_MINUS?(this.state=X.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars(`-`)):(this.state=X.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case G.HYPHEN_MINUS:this.state=X.SCRIPT_DATA_ESCAPED_DASH,this._emitChars(`-`);break;case G.LESS_THAN_SIGN:this.state=X.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case G.NULL:this._err(K.unexpectedNullCharacter),this._emitChars(`�`);break;case G.EOF:this._err(K.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case G.HYPHEN_MINUS:this.state=X.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case G.LESS_THAN_SIGN:this.state=X.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case G.NULL:this._err(K.unexpectedNullCharacter),this.state=X.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case G.EOF:this._err(K.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=X.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case G.HYPHEN_MINUS:this._emitChars(`-`);break;case G.LESS_THAN_SIGN:this.state=X.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case G.GREATER_THAN_SIGN:this.state=X.SCRIPT_DATA,this._emitChars(`>`);break;case G.NULL:this._err(K.unexpectedNullCharacter),this.state=X.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case G.EOF:this._err(K.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=X.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===G.SOLIDUS?this.state=X.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:OT(e)?(this._emitChars(`<`),this.state=X.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars(`<`),this.state=X.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){OT(e)?(this.state=X.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars(`</`),this.state=X.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=X.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(uT.SCRIPT,!1)&&MT(this.preprocessor.peek(uT.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<uT.SCRIPT.length;e++)this._emitCodePoint(this._consume());this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=X.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case G.HYPHEN_MINUS:this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars(`-`);break;case G.LESS_THAN_SIGN:this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case G.NULL:this._err(K.unexpectedNullCharacter),this._emitChars(`�`);break;case G.EOF:this._err(K.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case G.HYPHEN_MINUS:this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case G.LESS_THAN_SIGN:this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case G.NULL:this._err(K.unexpectedNullCharacter),this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case G.EOF:this._err(K.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case G.HYPHEN_MINUS:this._emitChars(`-`);break;case G.LESS_THAN_SIGN:this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case G.GREATER_THAN_SIGN:this.state=X.SCRIPT_DATA,this._emitChars(`>`);break;case G.NULL:this._err(K.unexpectedNullCharacter),this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case G.EOF:this._err(K.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===G.SOLIDUS?(this.state=X.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars(`/`)):(this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(uT.SCRIPT,!1)&&MT(this.preprocessor.peek(uT.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<uT.SCRIPT.length;e++)this._emitCodePoint(this._consume());this.state=X.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:break;case G.SOLIDUS:case G.GREATER_THAN_SIGN:case G.EOF:this.state=X.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case G.EQUALS_SIGN:this._err(K.unexpectedEqualsSignBeforeAttributeName),this._createAttr(`=`),this.state=X.ATTRIBUTE_NAME;break;default:this._createAttr(``),this.state=X.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:case G.SOLIDUS:case G.GREATER_THAN_SIGN:case G.EOF:this._leaveAttrName(),this.state=X.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case G.EQUALS_SIGN:this._leaveAttrName(),this.state=X.BEFORE_ATTRIBUTE_VALUE;break;case G.QUOTATION_MARK:case G.APOSTROPHE:case G.LESS_THAN_SIGN:this._err(K.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break;case G.NULL:this._err(K.unexpectedNullCharacter),this.currentAttr.name+=`�`;break;default:this.currentAttr.name+=String.fromCodePoint(DT(e)?AT(e):e)}}_stateAfterAttributeName(e){switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:break;case G.SOLIDUS:this.state=X.SELF_CLOSING_START_TAG;break;case G.EQUALS_SIGN:this.state=X.BEFORE_ATTRIBUTE_VALUE;break;case G.GREATER_THAN_SIGN:this.state=X.DATA,this.emitCurrentTagToken();break;case G.EOF:this._err(K.eofInTag),this._emitEOFToken();break;default:this._createAttr(``),this.state=X.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:break;case G.QUOTATION_MARK:this.state=X.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break;case G.APOSTROPHE:this.state=X.ATTRIBUTE_VALUE_SINGLE_QUOTED;break;case G.GREATER_THAN_SIGN:this._err(K.missingAttributeValue),this.state=X.DATA,this.emitCurrentTagToken();break;default:this.state=X.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case G.QUOTATION_MARK:this.state=X.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case G.AMPERSAND:this._startCharacterReference();break;case G.NULL:this._err(K.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case G.EOF:this._err(K.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case G.APOSTROPHE:this.state=X.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case G.AMPERSAND:this._startCharacterReference();break;case G.NULL:this._err(K.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case G.EOF:this._err(K.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:this._leaveAttrValue(),this.state=X.BEFORE_ATTRIBUTE_NAME;break;case G.AMPERSAND:this._startCharacterReference();break;case G.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=X.DATA,this.emitCurrentTagToken();break;case G.NULL:this._err(K.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case G.QUOTATION_MARK:case G.APOSTROPHE:case G.LESS_THAN_SIGN:case G.EQUALS_SIGN:case G.GRAVE_ACCENT:this._err(K.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break;case G.EOF:this._err(K.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:this._leaveAttrValue(),this.state=X.BEFORE_ATTRIBUTE_NAME;break;case G.SOLIDUS:this._leaveAttrValue(),this.state=X.SELF_CLOSING_START_TAG;break;case G.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=X.DATA,this.emitCurrentTagToken();break;case G.EOF:this._err(K.eofInTag),this._emitEOFToken();break;default:this._err(K.missingWhitespaceBetweenAttributes),this.state=X.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case G.GREATER_THAN_SIGN:{let e=this.currentToken;e.selfClosing=!0,this.state=X.DATA,this.emitCurrentTagToken();break}case G.EOF:this._err(K.eofInTag),this._emitEOFToken();break;default:this._err(K.unexpectedSolidusInTag),this.state=X.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){let t=this.currentToken;switch(e){case G.GREATER_THAN_SIGN:this.state=X.DATA,this.emitCurrentComment(t);break;case G.EOF:this.emitCurrentComment(t),this._emitEOFToken();break;case G.NULL:this._err(K.unexpectedNullCharacter),t.data+=`�`;break;default:t.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(uT.DASH_DASH,!0)?(this._createCommentToken(uT.DASH_DASH.length+1),this.state=X.COMMENT_START):this._consumeSequenceIfMatch(uT.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(uT.DOCTYPE.length+1),this.state=X.DOCTYPE):this._consumeSequenceIfMatch(uT.CDATA_START,!0)?this.inForeignNode?this.state=X.CDATA_SECTION:(this._err(K.cdataInHtmlContent),this._createCommentToken(uT.CDATA_START.length+1),this.currentToken.data=`[CDATA[`,this.state=X.BOGUS_COMMENT):this._ensureHibernation()||(this._err(K.incorrectlyOpenedComment),this._createCommentToken(2),this.state=X.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case G.HYPHEN_MINUS:this.state=X.COMMENT_START_DASH;break;case G.GREATER_THAN_SIGN:{this._err(K.abruptClosingOfEmptyComment),this.state=X.DATA;let e=this.currentToken;this.emitCurrentComment(e);break}default:this.state=X.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){let t=this.currentToken;switch(e){case G.HYPHEN_MINUS:this.state=X.COMMENT_END;break;case G.GREATER_THAN_SIGN:this._err(K.abruptClosingOfEmptyComment),this.state=X.DATA,this.emitCurrentComment(t);break;case G.EOF:this._err(K.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`-`,this.state=X.COMMENT,this._stateComment(e)}}_stateComment(e){let t=this.currentToken;switch(e){case G.HYPHEN_MINUS:this.state=X.COMMENT_END_DASH;break;case G.LESS_THAN_SIGN:t.data+=`<`,this.state=X.COMMENT_LESS_THAN_SIGN;break;case G.NULL:this._err(K.unexpectedNullCharacter),t.data+=`�`;break;case G.EOF:this._err(K.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){let t=this.currentToken;switch(e){case G.EXCLAMATION_MARK:t.data+=`!`,this.state=X.COMMENT_LESS_THAN_SIGN_BANG;break;case G.LESS_THAN_SIGN:t.data+=`<`;break;default:this.state=X.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===G.HYPHEN_MINUS?this.state=X.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=X.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===G.HYPHEN_MINUS?this.state=X.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=X.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==G.GREATER_THAN_SIGN&&e!==G.EOF&&this._err(K.nestedComment),this.state=X.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){let t=this.currentToken;switch(e){case G.HYPHEN_MINUS:this.state=X.COMMENT_END;break;case G.EOF:this._err(K.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`-`,this.state=X.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){let t=this.currentToken;switch(e){case G.GREATER_THAN_SIGN:this.state=X.DATA,this.emitCurrentComment(t);break;case G.EXCLAMATION_MARK:this.state=X.COMMENT_END_BANG;break;case G.HYPHEN_MINUS:t.data+=`-`;break;case G.EOF:this._err(K.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`--`,this.state=X.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){let t=this.currentToken;switch(e){case G.HYPHEN_MINUS:t.data+=`--!`,this.state=X.COMMENT_END_DASH;break;case G.GREATER_THAN_SIGN:this._err(K.incorrectlyClosedComment),this.state=X.DATA,this.emitCurrentComment(t);break;case G.EOF:this._err(K.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`--!`,this.state=X.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:this.state=X.BEFORE_DOCTYPE_NAME;break;case G.GREATER_THAN_SIGN:this.state=X.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break;case G.EOF:{this._err(K.eofInDoctype),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._err(K.missingWhitespaceBeforeDoctypeName),this.state=X.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(DT(e))this._createDoctypeToken(String.fromCharCode(AT(e))),this.state=X.DOCTYPE_NAME;else switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:break;case G.NULL:this._err(K.unexpectedNullCharacter),this._createDoctypeToken(`�`),this.state=X.DOCTYPE_NAME;break;case G.GREATER_THAN_SIGN:{this._err(K.missingDoctypeName),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this.state=X.DATA;break}case G.EOF:{this._err(K.eofInDoctype),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=X.DOCTYPE_NAME}}_stateDoctypeName(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:this.state=X.AFTER_DOCTYPE_NAME;break;case G.GREATER_THAN_SIGN:this.state=X.DATA,this.emitCurrentDoctype(t);break;case G.NULL:this._err(K.unexpectedNullCharacter),t.name+=`�`;break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.name+=String.fromCodePoint(DT(e)?AT(e):e)}}_stateAfterDoctypeName(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:break;case G.GREATER_THAN_SIGN:this.state=X.DATA,this.emitCurrentDoctype(t);break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._consumeSequenceIfMatch(uT.PUBLIC,!1)?this.state=X.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(uT.SYSTEM,!1)?this.state=X.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(K.invalidCharacterSequenceAfterDoctypeName),t.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:this.state=X.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break;case G.QUOTATION_MARK:this._err(K.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=X.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case G.APOSTROPHE:this._err(K.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=X.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case G.GREATER_THAN_SIGN:this._err(K.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=X.DATA,this.emitCurrentDoctype(t);break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(K.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:break;case G.QUOTATION_MARK:t.publicId=``,this.state=X.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case G.APOSTROPHE:t.publicId=``,this.state=X.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case G.GREATER_THAN_SIGN:this._err(K.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=X.DATA,this.emitCurrentDoctype(t);break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(K.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case G.QUOTATION_MARK:this.state=X.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case G.NULL:this._err(K.unexpectedNullCharacter),t.publicId+=`�`;break;case G.GREATER_THAN_SIGN:this._err(K.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=X.DATA;break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case G.APOSTROPHE:this.state=X.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case G.NULL:this._err(K.unexpectedNullCharacter),t.publicId+=`�`;break;case G.GREATER_THAN_SIGN:this._err(K.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=X.DATA;break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:this.state=X.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break;case G.GREATER_THAN_SIGN:this.state=X.DATA,this.emitCurrentDoctype(t);break;case G.QUOTATION_MARK:this._err(K.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case G.APOSTROPHE:this._err(K.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(K.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:break;case G.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=X.DATA;break;case G.QUOTATION_MARK:t.systemId=``,this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case G.APOSTROPHE:t.systemId=``,this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(K.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:this.state=X.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break;case G.QUOTATION_MARK:this._err(K.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case G.APOSTROPHE:this._err(K.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case G.GREATER_THAN_SIGN:this._err(K.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=X.DATA,this.emitCurrentDoctype(t);break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(K.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:break;case G.QUOTATION_MARK:t.systemId=``,this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case G.APOSTROPHE:t.systemId=``,this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case G.GREATER_THAN_SIGN:this._err(K.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=X.DATA,this.emitCurrentDoctype(t);break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(K.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case G.QUOTATION_MARK:this.state=X.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case G.NULL:this._err(K.unexpectedNullCharacter),t.systemId+=`�`;break;case G.GREATER_THAN_SIGN:this._err(K.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=X.DATA;break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case G.APOSTROPHE:this.state=X.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case G.NULL:this._err(K.unexpectedNullCharacter),t.systemId+=`�`;break;case G.GREATER_THAN_SIGN:this._err(K.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=X.DATA;break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:break;case G.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=X.DATA;break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(K.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){let t=this.currentToken;switch(e){case G.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=X.DATA;break;case G.NULL:this._err(K.unexpectedNullCharacter);break;case G.EOF:this.emitCurrentDoctype(t),this._emitEOFToken();break;default:}}_stateCdataSection(e){switch(e){case G.RIGHT_SQUARE_BRACKET:this.state=X.CDATA_SECTION_BRACKET;break;case G.EOF:this._err(K.eofInCdata),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===G.RIGHT_SQUARE_BRACKET?this.state=X.CDATA_SECTION_END:(this._emitChars(`]`),this.state=X.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case G.GREATER_THAN_SIGN:this.state=X.DATA;break;case G.RIGHT_SQUARE_BRACKET:this._emitChars(`]`);break;default:this._emitChars(`]]`),this.state=X.CDATA_SECTION,this._stateCdataSection(e)}}_stateCharacterReference(){let e=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(e<0)if(this.preprocessor.lastChunkWritten)e=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}e===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(G.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&kT(this.preprocessor.peek(1))?X.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){kT(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===G.SEMICOLON&&this._err(K.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}};const NT=new Set([Y.DD,Y.DT,Y.LI,Y.OPTGROUP,Y.OPTION,Y.P,Y.RB,Y.RP,Y.RT,Y.RTC]),PT=new Set([...NT,Y.CAPTION,Y.COLGROUP,Y.TBODY,Y.TD,Y.TFOOT,Y.TH,Y.THEAD,Y.TR]),FT=new Set([Y.APPLET,Y.CAPTION,Y.HTML,Y.MARQUEE,Y.OBJECT,Y.TABLE,Y.TD,Y.TEMPLATE,Y.TH]),Vse=new Set([...FT,Y.OL,Y.UL]),Hse=new Set([...FT,Y.BUTTON]),IT=new Set([Y.ANNOTATION_XML,Y.MI,Y.MN,Y.MO,Y.MS,Y.MTEXT]),LT=new Set([Y.DESC,Y.FOREIGN_OBJECT,Y.TITLE]),Use=new Set([Y.TR,Y.TEMPLATE,Y.HTML]),Wse=new Set([Y.TBODY,Y.TFOOT,Y.THEAD,Y.TEMPLATE,Y.HTML]),Gse=new Set([Y.TABLE,Y.TEMPLATE,Y.HTML]),Kse=new Set([Y.TD,Y.TH]);var qse=class{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,t,n){this.treeAdapter=t,this.handler=n,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=Y.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===Y.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===q.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,t){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=t,this.currentTagId=t,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,t,!0)}pop(){let e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,t){let n=this._indexOf(e);this.items[n]=t,n===this.stackTop&&(this.current=t)}insertAfter(e,t,n){let r=this._indexOf(e)+1;this.items.splice(r,0,t),this.tagIDs.splice(r,0,n),this.stackTop++,r===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,r===this.stackTop)}popUntilTagNamePopped(e){let t=this.stackTop+1;do t=this.tagIDs.lastIndexOf(e,t-1);while(t>0&&this.treeAdapter.getNamespaceURI(this.items[t])!==q.HTML);this.shortenToLength(Math.max(t,0))}shortenToLength(e){for(;this.stackTop>=e;){let t=this.current;this.tmplCount>0&&this._isInTemplate()&&--this.tmplCount,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,this.stackTop<e)}}popUntilElementPopped(e){let t=this._indexOf(e);this.shortenToLength(Math.max(t,0))}popUntilPopped(e,t){let n=this._indexOfTagNames(e,t);this.shortenToLength(Math.max(n,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(TT,q.HTML)}popUntilTableCellPopped(){this.popUntilPopped(Kse,q.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(e,t){for(let n=this.stackTop;n>=0;n--)if(e.has(this.tagIDs[n])&&this.treeAdapter.getNamespaceURI(this.items[n])===t)return n;return-1}clearBackTo(e,t){let n=this._indexOfTagNames(e,t);this.shortenToLength(n+1)}clearBackToTableContext(){this.clearBackTo(Gse,q.HTML)}clearBackToTableBodyContext(){this.clearBackTo(Wse,q.HTML)}clearBackToTableRowContext(){this.clearBackTo(Use,q.HTML)}remove(e){let t=this._indexOf(e);t>=0&&(t===this.stackTop?this.pop():(this.items.splice(t,1),this.tagIDs.splice(t,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===Y.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){let t=this._indexOf(e)-1;return t>=0?this.items[t]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===Y.HTML}hasInDynamicScope(e,t){for(let n=this.stackTop;n>=0;n--){let r=this.tagIDs[n];switch(this.treeAdapter.getNamespaceURI(this.items[n])){case q.HTML:if(r===e)return!0;if(t.has(r))return!1;break;case q.SVG:if(LT.has(r))return!1;break;case q.MATHML:if(IT.has(r))return!1;break}}return!0}hasInScope(e){return this.hasInDynamicScope(e,FT)}hasInListItemScope(e){return this.hasInDynamicScope(e,Vse)}hasInButtonScope(e){return this.hasInDynamicScope(e,Hse)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){let t=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case q.HTML:if(TT.has(t))return!0;if(FT.has(t))return!1;break;case q.SVG:if(LT.has(t))return!1;break;case q.MATHML:if(IT.has(t))return!1;break}}return!0}hasInTableScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===q.HTML)switch(this.tagIDs[t]){case e:return!0;case Y.TABLE:case Y.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===q.HTML)switch(this.tagIDs[e]){case Y.TBODY:case Y.THEAD:case Y.TFOOT:return!0;case Y.TABLE:case Y.HTML:return!1}return!0}hasInSelectScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===q.HTML)switch(this.tagIDs[t]){case e:return!0;case Y.OPTION:case Y.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&NT.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&PT.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&PT.has(this.currentTagId);)this.pop()}},RT;(function(e){e[e.Marker=0]=`Marker`,e[e.Element=1]=`Element`})(RT||={});const zT={type:RT.Marker};var Jse=class{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,t){let n=[],r=t.length,i=this.treeAdapter.getTagName(e),a=this.treeAdapter.getNamespaceURI(e);for(let e=0;e<this.entries.length;e++){let t=this.entries[e];if(t.type===RT.Marker)break;let{element:o}=t;if(this.treeAdapter.getTagName(o)===i&&this.treeAdapter.getNamespaceURI(o)===a){let t=this.treeAdapter.getAttrList(o);t.length===r&&n.push({idx:e,attrs:t})}}return n}_ensureNoahArkCondition(e){if(this.entries.length<3)return;let t=this.treeAdapter.getAttrList(e),n=this._getNoahArkConditionCandidates(e,t);if(n.length<3)return;let r=new Map(t.map(e=>[e.name,e.value])),i=0;for(let e=0;e<n.length;e++){let t=n[e];t.attrs.every(e=>r.get(e.name)===e.value)&&(i+=1,i>=3&&this.entries.splice(t.idx,1))}}insertMarker(){this.entries.unshift(zT)}pushElement(e,t){this._ensureNoahArkCondition(e),this.entries.unshift({type:RT.Element,element:e,token:t})}insertElementAfterBookmark(e,t){let n=this.entries.indexOf(this.bookmark);this.entries.splice(n,0,{type:RT.Element,element:e,token:t})}removeEntry(e){let t=this.entries.indexOf(e);t!==-1&&this.entries.splice(t,1)}clearToLastMarker(){let e=this.entries.indexOf(zT);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){let t=this.entries.find(t=>t.type===RT.Marker||this.treeAdapter.getTagName(t.element)===e);return t&&t.type===RT.Element?t:null}getElementEntry(e){return this.entries.find(t=>t.type===RT.Element&&t.element===e)}};const BT={createDocument(){return{nodeName:`#document`,mode:ST.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:`#document-fragment`,childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:`#comment`,data:e,parentNode:null}},createTextNode(e){return{nodeName:`#text`,value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){let r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){let i=e.childNodes.find(e=>e.nodeName===`#documentType`);if(i)i.name=t,i.publicId=n,i.systemId=r;else{let i={nodeName:`#documentType`,name:t,publicId:n,systemId:r,parentNode:null};BT.appendChild(e,i)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){let t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){let n=e.childNodes[e.childNodes.length-1];if(BT.isTextNode(n)){n.value+=t;return}}BT.appendChild(e,BT.createTextNode(t))},insertTextBefore(e,t,n){let r=e.childNodes[e.childNodes.indexOf(n)-1];r&&BT.isTextNode(r)?r.value+=t:BT.insertBefore(e,BT.createTextNode(t),n)},adoptAttributes(e,t){let n=new Set(e.attrs.map(e=>e.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName===`#text`},isCommentNode(e){return e.nodeName===`#comment`},isDocumentTypeNode(e){return e.nodeName===`#documentType`},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,`tagName`)},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},VT=`html`,HT=`+//silmaril//dtd html pro v0r11 19970101//,-//as//dtd html 3.0 aswedit + extensions//,-//advasoft ltd//dtd html 3.0 aswedit + extensions//,-//ietf//dtd html 2.0 level 1//,-//ietf//dtd html 2.0 level 2//,-//ietf//dtd html 2.0 strict level 1//,-//ietf//dtd html 2.0 strict level 2//,-//ietf//dtd html 2.0 strict//,-//ietf//dtd html 2.0//,-//ietf//dtd html 2.1e//,-//ietf//dtd html 3.0//,-//ietf//dtd html 3.2 final//,-//ietf//dtd html 3.2//,-//ietf//dtd html 3//,-//ietf//dtd html level 0//,-//ietf//dtd html level 1//,-//ietf//dtd html level 2//,-//ietf//dtd html level 3//,-//ietf//dtd html strict level 0//,-//ietf//dtd html strict level 1//,-//ietf//dtd html strict level 2//,-//ietf//dtd html strict level 3//,-//ietf//dtd html strict//,-//ietf//dtd html//,-//metrius//dtd metrius presentational//,-//microsoft//dtd internet explorer 2.0 html strict//,-//microsoft//dtd internet explorer 2.0 html//,-//microsoft//dtd internet explorer 2.0 tables//,-//microsoft//dtd internet explorer 3.0 html strict//,-//microsoft//dtd internet explorer 3.0 html//,-//microsoft//dtd internet explorer 3.0 tables//,-//netscape comm. corp.//dtd html//,-//netscape comm. corp.//dtd strict html//,-//o'reilly and associates//dtd html 2.0//,-//o'reilly and associates//dtd html extended 1.0//,-//o'reilly and associates//dtd html extended relaxed 1.0//,-//sq//dtd html 2.0 hotmetal + extensions//,-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//,-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//,-//spyglass//dtd html 2.0 extended//,-//sun microsystems corp.//dtd hotjava html//,-//sun microsystems corp.//dtd hotjava strict html//,-//w3c//dtd html 3 1995-03-24//,-//w3c//dtd html 3.2 draft//,-//w3c//dtd html 3.2 final//,-//w3c//dtd html 3.2//,-//w3c//dtd html 3.2s draft//,-//w3c//dtd html 4.0 frameset//,-//w3c//dtd html 4.0 transitional//,-//w3c//dtd html experimental 19960712//,-//w3c//dtd html experimental 970421//,-//w3c//dtd w3 html//,-//w3o//dtd w3 html 3.0//,-//webtechs//dtd mozilla html 2.0//,-//webtechs//dtd mozilla html//`.split(`,`),Yse=[...HT,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`],Xse=new Set([`-//w3o//dtd w3 html strict 3.0//en//`,`-/w3c/dtd html 4.0 transitional/en`,`html`]),UT=[`-//w3c//dtd xhtml 1.0 frameset//`,`-//w3c//dtd xhtml 1.0 transitional//`],Zse=[...UT,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`];function WT(e,t){return t.some(t=>e.startsWith(t))}function Qse(e){return e.name===VT&&e.publicId===null&&(e.systemId===null||e.systemId===`about:legacy-compat`)}function $se(e){if(e.name!==VT)return ST.QUIRKS;let{systemId:t}=e;if(t&&t.toLowerCase()===`http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd`)return ST.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),Xse.has(n))return ST.QUIRKS;let e=t===null?Yse:HT;if(WT(n,e))return ST.QUIRKS;if(e=t===null?UT:Zse,WT(n,e))return ST.LIMITED_QUIRKS}return ST.NO_QUIRKS}const GT={TEXT_HTML:`text/html`,APPLICATION_XML:`application/xhtml+xml`},ece=new Map(`attributeName.attributeType.baseFrequency.baseProfile.calcMode.clipPathUnits.diffuseConstant.edgeMode.filterUnits.glyphRef.gradientTransform.gradientUnits.kernelMatrix.kernelUnitLength.keyPoints.keySplines.keyTimes.lengthAdjust.limitingConeAngle.markerHeight.markerUnits.markerWidth.maskContentUnits.maskUnits.numOctaves.pathLength.patternContentUnits.patternTransform.patternUnits.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.refX.refY.repeatCount.repeatDur.requiredExtensions.requiredFeatures.specularConstant.specularExponent.spreadMethod.startOffset.stdDeviation.stitchTiles.surfaceScale.systemLanguage.tableValues.targetX.targetY.textLength.viewBox.viewTarget.xChannelSelector.yChannelSelector.zoomAndPan`.split(`.`).map(e=>[e.toLowerCase(),e])),tce=new Map([[`xlink:actuate`,{prefix:`xlink`,name:`actuate`,namespace:q.XLINK}],[`xlink:arcrole`,{prefix:`xlink`,name:`arcrole`,namespace:q.XLINK}],[`xlink:href`,{prefix:`xlink`,name:`href`,namespace:q.XLINK}],[`xlink:role`,{prefix:`xlink`,name:`role`,namespace:q.XLINK}],[`xlink:show`,{prefix:`xlink`,name:`show`,namespace:q.XLINK}],[`xlink:title`,{prefix:`xlink`,name:`title`,namespace:q.XLINK}],[`xlink:type`,{prefix:`xlink`,name:`type`,namespace:q.XLINK}],[`xml:lang`,{prefix:`xml`,name:`lang`,namespace:q.XML}],[`xml:space`,{prefix:`xml`,name:`space`,namespace:q.XML}],[`xmlns`,{prefix:``,name:`xmlns`,namespace:q.XMLNS}],[`xmlns:xlink`,{prefix:`xmlns`,name:`xlink`,namespace:q.XMLNS}]]),nce=new Map(`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.glyphRef.linearGradient.radialGradient.textPath`.split(`.`).map(e=>[e.toLowerCase(),e])),rce=new Set([Y.B,Y.BIG,Y.BLOCKQUOTE,Y.BODY,Y.BR,Y.CENTER,Y.CODE,Y.DD,Y.DIV,Y.DL,Y.DT,Y.EM,Y.EMBED,Y.H1,Y.H2,Y.H3,Y.H4,Y.H5,Y.H6,Y.HEAD,Y.HR,Y.I,Y.IMG,Y.LI,Y.LISTING,Y.MENU,Y.META,Y.NOBR,Y.OL,Y.P,Y.PRE,Y.RUBY,Y.S,Y.SMALL,Y.SPAN,Y.STRONG,Y.STRIKE,Y.SUB,Y.SUP,Y.TABLE,Y.TT,Y.U,Y.UL,Y.VAR]);function ice(e){let t=e.tagID;return t===Y.FONT&&e.attrs.some(({name:e})=>e===xT.COLOR||e===xT.SIZE||e===xT.FACE)||rce.has(t)}function KT(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===`definitionurl`){e.attrs[t].name=`definitionURL`;break}}function qT(e){for(let t=0;t<e.attrs.length;t++){let n=ece.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function JT(e){for(let t=0;t<e.attrs.length;t++){let n=tce.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function ace(e){let t=nce.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=CT(e.tagName))}function oce(e,t){return t===q.MATHML&&(e===Y.MI||e===Y.MO||e===Y.MN||e===Y.MS||e===Y.MTEXT)}function sce(e,t,n){if(t===q.MATHML&&e===Y.ANNOTATION_XML){for(let e=0;e<n.length;e++)if(n[e].name===xT.ENCODING){let t=n[e].value.toLowerCase();return t===GT.TEXT_HTML||t===GT.APPLICATION_XML}}return t===q.SVG&&(e===Y.FOREIGN_OBJECT||e===Y.DESC||e===Y.TITLE)}function cce(e,t,n,r){return(!r||r===q.HTML)&&sce(e,t,n)||(!r||r===q.MATHML)&&oce(e,t)}var Z;(function(e){e[e.INITIAL=0]=`INITIAL`,e[e.BEFORE_HTML=1]=`BEFORE_HTML`,e[e.BEFORE_HEAD=2]=`BEFORE_HEAD`,e[e.IN_HEAD=3]=`IN_HEAD`,e[e.IN_HEAD_NO_SCRIPT=4]=`IN_HEAD_NO_SCRIPT`,e[e.AFTER_HEAD=5]=`AFTER_HEAD`,e[e.IN_BODY=6]=`IN_BODY`,e[e.TEXT=7]=`TEXT`,e[e.IN_TABLE=8]=`IN_TABLE`,e[e.IN_TABLE_TEXT=9]=`IN_TABLE_TEXT`,e[e.IN_CAPTION=10]=`IN_CAPTION`,e[e.IN_COLUMN_GROUP=11]=`IN_COLUMN_GROUP`,e[e.IN_TABLE_BODY=12]=`IN_TABLE_BODY`,e[e.IN_ROW=13]=`IN_ROW`,e[e.IN_CELL=14]=`IN_CELL`,e[e.IN_SELECT=15]=`IN_SELECT`,e[e.IN_SELECT_IN_TABLE=16]=`IN_SELECT_IN_TABLE`,e[e.IN_TEMPLATE=17]=`IN_TEMPLATE`,e[e.AFTER_BODY=18]=`AFTER_BODY`,e[e.IN_FRAMESET=19]=`IN_FRAMESET`,e[e.AFTER_FRAMESET=20]=`AFTER_FRAMESET`,e[e.AFTER_AFTER_BODY=21]=`AFTER_AFTER_BODY`,e[e.AFTER_AFTER_FRAMESET=22]=`AFTER_AFTER_FRAMESET`})(Z||={});const lce={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},YT=new Set([Y.TABLE,Y.TBODY,Y.TFOOT,Y.THEAD,Y.TR]),XT={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:BT,onParseError:null};var ZT=class{constructor(e,t,n=null,r=null){this.fragmentContext=n,this.scriptHandler=r,this.currentToken=null,this.stopped=!1,this.insertionMode=Z.INITIAL,this.originalInsertionMode=Z.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...XT,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=t??this.treeAdapter.createDocument(),this.tokenizer=new Bse(this.options,this),this.activeFormattingElements=new Jse(this.treeAdapter),this.fragmentContextID=n?CT(this.treeAdapter.getTagName(n)):Y.UNKNOWN,this._setContextModes(n??this.document,this.fragmentContextID),this.openElements=new qse(this.document,this.treeAdapter,this)}static parse(e,t){let n=new this(t);return n.tokenizer.write(e,!0),n.document}static getFragmentParser(e,t){let n={...XT,...t};e??=n.treeAdapter.createElement(J.TEMPLATE,q.HTML,[]);let r=n.treeAdapter.createElement(`documentmock`,q.HTML,[]),i=new this(n,r,e);return i.fragmentContextID===Y.TEMPLATE&&i.tmplInsertionModeStack.unshift(Z.IN_TEMPLATE),i._initTokenizerForFragmentParsing(),i._insertFakeRootElement(),i._resetInsertionMode(),i._findFormInFragmentContext(),i}getFragment(){let e=this.treeAdapter.getFirstChild(this.document),t=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,t),t}_err(e,t,n){if(!this.onParseError)return;let r=e.location??lce,i={code:t,startLine:r.startLine,startCol:r.startCol,startOffset:r.startOffset,endLine:n?r.startLine:r.endLine,endCol:n?r.startCol:r.endCol,endOffset:n?r.startOffset:r.endOffset};this.onParseError(i)}onItemPush(e,t,n){var r,i;(i=(r=this.treeAdapter).onItemPush)==null||i.call(r,e),n&&this.openElements.stackTop>0&&this._setContextModes(e,t)}onItemPop(e,t){var n,r;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(r=(n=this.treeAdapter).onItemPop)==null||r.call(n,e,this.openElements.current),t){let e,t;this.openElements.stackTop===0&&this.fragmentContext?(e=this.fragmentContext,t=this.fragmentContextID):{current:e,currentTagId:t}=this.openElements,this._setContextModes(e,t)}}_setContextModes(e,t){let n=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===q.HTML;this.currentNotInHTML=!n,this.tokenizer.inForeignNode=!n&&e!==void 0&&t!==void 0&&!this._isIntegrationPoint(t,e)}_switchToTextParsing(e,t){this._insertElement(e,q.HTML),this.tokenizer.state=t,this.originalInsertionMode=this.insertionMode,this.insertionMode=Z.TEXT}switchToPlaintextParsing(){this.insertionMode=Z.TEXT,this.originalInsertionMode=Z.IN_BODY,this.tokenizer.state=ET.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===J.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==q.HTML))switch(this.fragmentContextID){case Y.TITLE:case Y.TEXTAREA:this.tokenizer.state=ET.RCDATA;break;case Y.STYLE:case Y.XMP:case Y.IFRAME:case Y.NOEMBED:case Y.NOFRAMES:case Y.NOSCRIPT:this.tokenizer.state=ET.RAWTEXT;break;case Y.SCRIPT:this.tokenizer.state=ET.SCRIPT_DATA;break;case Y.PLAINTEXT:this.tokenizer.state=ET.PLAINTEXT;break;default:}}_setDocumentType(e){let t=e.name||``,n=e.publicId||``,r=e.systemId||``;if(this.treeAdapter.setDocumentType(this.document,t,n,r),e.location){let t=this.treeAdapter.getChildNodes(this.document).find(e=>this.treeAdapter.isDocumentTypeNode(e));t&&this.treeAdapter.setNodeSourceCodeLocation(t,e.location)}}_attachElementToTree(e,t){if(this.options.sourceCodeLocationInfo){let n=t&&{...t,startTag:t};this.treeAdapter.setNodeSourceCodeLocation(e,n)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{let t=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(t??this.document,e)}}_appendElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location)}_insertElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID)}_insertFakeElement(e,t){let n=this.treeAdapter.createElement(e,q.HTML,[]);this._attachElementToTree(n,null),this.openElements.push(n,t)}_insertTemplate(e){let t=this.treeAdapter.createElement(e.tagName,q.HTML,e.attrs),n=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(t,n),this._attachElementToTree(t,e.location),this.openElements.push(t,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,null)}_insertFakeRootElement(){let e=this.treeAdapter.createElement(J.HTML,q.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,Y.HTML)}_appendCommentNode(e,t){let n=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(t,n),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,e.location)}_insertCharacters(e){let t,n;if(this._shouldFosterParentOnInsertion()?({parent:t,beforeElement:n}=this._findFosterParentingLocation(),n?this.treeAdapter.insertTextBefore(t,e.chars,n):this.treeAdapter.insertText(t,e.chars)):(t=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(t,e.chars)),!e.location)return;let r=this.treeAdapter.getChildNodes(t),i=r[(n?r.lastIndexOf(n):r.length)-1];if(this.treeAdapter.getNodeSourceCodeLocation(i)){let{endLine:t,endCol:n,endOffset:r}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(i,{endLine:t,endCol:n,endOffset:r})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,e.location)}_adoptNodes(e,t){for(let n=this.treeAdapter.getFirstChild(e);n;n=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(t,n)}_setEndLocation(e,t){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&t.location){let n=t.location,r=this.treeAdapter.getTagName(e),i=t.type===mT.END_TAG&&r===t.tagName?{endTag:{...n},endLine:n.endLine,endCol:n.endCol,endOffset:n.endOffset}:{endLine:n.startLine,endCol:n.startCol,endOffset:n.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,i)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let t,n;return this.openElements.stackTop===0&&this.fragmentContext?(t=this.fragmentContext,n=this.fragmentContextID):{current:t,currentTagId:n}=this.openElements,e.tagID===Y.SVG&&this.treeAdapter.getTagName(t)===J.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(t)===q.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===Y.MGLYPH||e.tagID===Y.MALIGNMARK)&&n!==void 0&&!this._isIntegrationPoint(n,t,q.HTML)}_processToken(e){switch(e.type){case mT.CHARACTER:this.onCharacter(e);break;case mT.NULL_CHARACTER:this.onNullCharacter(e);break;case mT.COMMENT:this.onComment(e);break;case mT.DOCTYPE:this.onDoctype(e);break;case mT.START_TAG:this._processStartTag(e);break;case mT.END_TAG:this.onEndTag(e);break;case mT.EOF:this.onEof(e);break;case mT.WHITESPACE_CHARACTER:this.onWhitespaceCharacter(e);break}}_isIntegrationPoint(e,t,n){return cce(e,this.treeAdapter.getNamespaceURI(t),this.treeAdapter.getAttrList(t),n)}_reconstructActiveFormattingElements(){let e=this.activeFormattingElements.entries.length;if(e){let t=this.activeFormattingElements.entries.findIndex(e=>e.type===RT.Marker||this.openElements.contains(e.element)),n=t===-1?e-1:t-1;for(let e=n;e>=0;e--){let t=this.activeFormattingElements.entries[e];this._insertElement(t.token,this.treeAdapter.getNamespaceURI(t.element)),t.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=Z.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(Y.P),this.openElements.popUntilTagNamePopped(Y.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case Y.TR:this.insertionMode=Z.IN_ROW;return;case Y.TBODY:case Y.THEAD:case Y.TFOOT:this.insertionMode=Z.IN_TABLE_BODY;return;case Y.CAPTION:this.insertionMode=Z.IN_CAPTION;return;case Y.COLGROUP:this.insertionMode=Z.IN_COLUMN_GROUP;return;case Y.TABLE:this.insertionMode=Z.IN_TABLE;return;case Y.BODY:this.insertionMode=Z.IN_BODY;return;case Y.FRAMESET:this.insertionMode=Z.IN_FRAMESET;return;case Y.SELECT:this._resetInsertionModeForSelect(e);return;case Y.TEMPLATE:this.insertionMode=this.tmplInsertionModeStack[0];return;case Y.HTML:this.insertionMode=this.headElement?Z.AFTER_HEAD:Z.BEFORE_HEAD;return;case Y.TD:case Y.TH:if(e>0){this.insertionMode=Z.IN_CELL;return}break;case Y.HEAD:if(e>0){this.insertionMode=Z.IN_HEAD;return}break}this.insertionMode=Z.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let t=e-1;t>0;t--){let e=this.openElements.tagIDs[t];if(e===Y.TEMPLATE)break;if(e===Y.TABLE){this.insertionMode=Z.IN_SELECT_IN_TABLE;return}}this.insertionMode=Z.IN_SELECT}_isElementCausesFosterParenting(e){return YT.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){let t=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case Y.TEMPLATE:if(this.treeAdapter.getNamespaceURI(t)===q.HTML)return{parent:this.treeAdapter.getTemplateContent(t),beforeElement:null};break;case Y.TABLE:{let n=this.treeAdapter.getParentNode(t);return n?{parent:n,beforeElement:t}:{parent:this.openElements.items[e-1],beforeElement:null}}default:}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){let t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertBefore(t.parent,e,t.beforeElement):this.treeAdapter.appendChild(t.parent,e)}_isSpecialElement(e,t){return Ise[this.treeAdapter.getNamespaceURI(e)].has(t)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){zle(this,e);return}switch(this.insertionMode){case Z.INITIAL:tE(this,e);break;case Z.BEFORE_HTML:nE(this,e);break;case Z.BEFORE_HEAD:rE(this,e);break;case Z.IN_HEAD:oE(this,e);break;case Z.IN_HEAD_NO_SCRIPT:sE(this,e);break;case Z.AFTER_HEAD:cE(this,e);break;case Z.IN_BODY:case Z.IN_CAPTION:case Z.IN_CELL:case Z.IN_TEMPLATE:dE(this,e);break;case Z.TEXT:case Z.IN_SELECT:case Z.IN_SELECT_IN_TABLE:this._insertCharacters(e);break;case Z.IN_TABLE:case Z.IN_TABLE_BODY:case Z.IN_ROW:bE(this,e);break;case Z.IN_TABLE_TEXT:TE(this,e);break;case Z.IN_COLUMN_GROUP:kE(this,e);break;case Z.AFTER_BODY:RE(this,e);break;case Z.AFTER_AFTER_BODY:zE(this,e);break;default:}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Rle(this,e);return}switch(this.insertionMode){case Z.INITIAL:tE(this,e);break;case Z.BEFORE_HTML:nE(this,e);break;case Z.BEFORE_HEAD:rE(this,e);break;case Z.IN_HEAD:oE(this,e);break;case Z.IN_HEAD_NO_SCRIPT:sE(this,e);break;case Z.AFTER_HEAD:cE(this,e);break;case Z.TEXT:this._insertCharacters(e);break;case Z.IN_TABLE:case Z.IN_TABLE_BODY:case Z.IN_ROW:bE(this,e);break;case Z.IN_COLUMN_GROUP:kE(this,e);break;case Z.AFTER_BODY:RE(this,e);break;case Z.AFTER_AFTER_BODY:zE(this,e);break;default:}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){$T(this,e);return}switch(this.insertionMode){case Z.INITIAL:case Z.BEFORE_HTML:case Z.BEFORE_HEAD:case Z.IN_HEAD:case Z.IN_HEAD_NO_SCRIPT:case Z.AFTER_HEAD:case Z.IN_BODY:case Z.IN_TABLE:case Z.IN_CAPTION:case Z.IN_COLUMN_GROUP:case Z.IN_TABLE_BODY:case Z.IN_ROW:case Z.IN_CELL:case Z.IN_SELECT:case Z.IN_SELECT_IN_TABLE:case Z.IN_TEMPLATE:case Z.IN_FRAMESET:case Z.AFTER_FRAMESET:$T(this,e);break;case Z.IN_TABLE_TEXT:EE(this,e);break;case Z.AFTER_BODY:gce(this,e);break;case Z.AFTER_AFTER_BODY:case Z.AFTER_AFTER_FRAMESET:_ce(this,e);break;default:}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case Z.INITIAL:vce(this,e);break;case Z.BEFORE_HEAD:case Z.IN_HEAD:case Z.IN_HEAD_NO_SCRIPT:case Z.AFTER_HEAD:this._err(e,K.misplacedDoctype);break;case Z.IN_TABLE_TEXT:EE(this,e);break;default:}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,K.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?Ble(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case Z.INITIAL:tE(this,e);break;case Z.BEFORE_HTML:yce(this,e);break;case Z.BEFORE_HEAD:xce(this,e);break;case Z.IN_HEAD:iE(this,e);break;case Z.IN_HEAD_NO_SCRIPT:wce(this,e);break;case Z.AFTER_HEAD:Ece(this,e);break;case Z.IN_BODY:gE(this,e);break;case Z.IN_TABLE:xE(this,e);break;case Z.IN_TABLE_TEXT:EE(this,e);break;case Z.IN_CAPTION:Sle(this,e);break;case Z.IN_COLUMN_GROUP:OE(this,e);break;case Z.IN_TABLE_BODY:AE(this,e);break;case Z.IN_ROW:ME(this,e);break;case Z.IN_CELL:Tle(this,e);break;case Z.IN_SELECT:PE(this,e);break;case Z.IN_SELECT_IN_TABLE:Dle(this,e);break;case Z.IN_TEMPLATE:kle(this,e);break;case Z.AFTER_BODY:jle(this,e);break;case Z.IN_FRAMESET:Mle(this,e);break;case Z.AFTER_FRAMESET:Ple(this,e);break;case Z.AFTER_AFTER_BODY:Ile(this,e);break;case Z.AFTER_AFTER_FRAMESET:Lle(this,e);break;default:}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?Vle(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case Z.INITIAL:tE(this,e);break;case Z.BEFORE_HTML:bce(this,e);break;case Z.BEFORE_HEAD:Sce(this,e);break;case Z.IN_HEAD:Cce(this,e);break;case Z.IN_HEAD_NO_SCRIPT:Tce(this,e);break;case Z.AFTER_HEAD:Dce(this,e);break;case Z.IN_BODY:vE(this,e);break;case Z.TEXT:fle(this,e);break;case Z.IN_TABLE:SE(this,e);break;case Z.IN_TABLE_TEXT:EE(this,e);break;case Z.IN_CAPTION:Cle(this,e);break;case Z.IN_COLUMN_GROUP:wle(this,e);break;case Z.IN_TABLE_BODY:jE(this,e);break;case Z.IN_ROW:NE(this,e);break;case Z.IN_CELL:Ele(this,e);break;case Z.IN_SELECT:FE(this,e);break;case Z.IN_SELECT_IN_TABLE:Ole(this,e);break;case Z.IN_TEMPLATE:Ale(this,e);break;case Z.AFTER_BODY:LE(this,e);break;case Z.IN_FRAMESET:Nle(this,e);break;case Z.AFTER_FRAMESET:Fle(this,e);break;case Z.AFTER_AFTER_BODY:zE(this,e);break;default:}}onEof(e){switch(this.insertionMode){case Z.INITIAL:tE(this,e);break;case Z.BEFORE_HTML:nE(this,e);break;case Z.BEFORE_HEAD:rE(this,e);break;case Z.IN_HEAD:oE(this,e);break;case Z.IN_HEAD_NO_SCRIPT:sE(this,e);break;case Z.AFTER_HEAD:cE(this,e);break;case Z.IN_BODY:case Z.IN_TABLE:case Z.IN_CAPTION:case Z.IN_COLUMN_GROUP:case Z.IN_TABLE_BODY:case Z.IN_ROW:case Z.IN_CELL:case Z.IN_SELECT:case Z.IN_SELECT_IN_TABLE:yE(this,e);break;case Z.TEXT:ple(this,e);break;case Z.IN_TABLE_TEXT:EE(this,e);break;case Z.IN_TEMPLATE:IE(this,e);break;case Z.AFTER_BODY:case Z.IN_FRAMESET:case Z.AFTER_FRAMESET:case Z.AFTER_AFTER_BODY:case Z.AFTER_AFTER_FRAMESET:eE(this,e);break;default:}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===G.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(e);return}switch(this.insertionMode){case Z.IN_HEAD:case Z.IN_HEAD_NO_SCRIPT:case Z.AFTER_HEAD:case Z.TEXT:case Z.IN_COLUMN_GROUP:case Z.IN_SELECT:case Z.IN_SELECT_IN_TABLE:case Z.IN_FRAMESET:case Z.AFTER_FRAMESET:this._insertCharacters(e);break;case Z.IN_BODY:case Z.IN_CAPTION:case Z.IN_CELL:case Z.IN_TEMPLATE:case Z.AFTER_BODY:case Z.AFTER_AFTER_BODY:case Z.AFTER_AFTER_FRAMESET:uE(this,e);break;case Z.IN_TABLE:case Z.IN_TABLE_BODY:case Z.IN_ROW:bE(this,e);break;case Z.IN_TABLE_TEXT:wE(this,e);break;default:}}};function uce(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):_E(e,t),n}function dce(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){let i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function fce(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let a=0,o=i;o!==n;a++,o=i){i=e.openElements.getCommonAncestor(o);let n=e.activeFormattingElements.getElementEntry(o),s=n&&a>=3;!n||s?(s&&e.activeFormattingElements.removeEntry(n),e.openElements.remove(o)):(o=pce(e,n),r===t&&(e.activeFormattingElements.bookmark=n),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(o,r),r=o)}return r}function pce(e,t){let n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function mce(e,t,n){let r=CT(e.treeAdapter.getTagName(t));if(e._isElementCausesFosterParenting(r))e._fosterParentElement(n);else{let i=e.treeAdapter.getNamespaceURI(t);r===Y.TEMPLATE&&i===q.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function hce(e,t,n){let r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,a=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,a,i.tagID)}function QT(e,t){for(let n=0;n<8;n++){let n=uce(e,t);if(!n)break;let r=dce(e,n);if(!r)break;e.activeFormattingElements.bookmark=n;let i=fce(e,r,n.element),a=e.openElements.getCommonAncestor(n.element);e.treeAdapter.detachNode(i),a&&mce(e,a,i),hce(e,r,n)}}function $T(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function gce(e,t){e._appendCommentNode(t,e.openElements.items[0])}function _ce(e,t){e._appendCommentNode(t,e.document)}function eE(e,t){if(e.stopped=!0,t.location){let n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){let n=e.openElements.items[0],r=e.treeAdapter.getNodeSourceCodeLocation(n);if(r&&!r.endTag&&(e._setEndLocation(n,t),e.openElements.stackTop>=1)){let n=e.openElements.items[1],r=e.treeAdapter.getNodeSourceCodeLocation(n);r&&!r.endTag&&e._setEndLocation(n,t)}}}}function vce(e,t){e._setDocumentType(t);let n=t.forceQuirks?ST.QUIRKS:$se(t);Qse(t)||e._err(t,K.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=Z.BEFORE_HTML}function tE(e,t){e._err(t,K.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,ST.QUIRKS),e.insertionMode=Z.BEFORE_HTML,e._processToken(t)}function yce(e,t){t.tagID===Y.HTML?(e._insertElement(t,q.HTML),e.insertionMode=Z.BEFORE_HEAD):nE(e,t)}function bce(e,t){let n=t.tagID;(n===Y.HTML||n===Y.HEAD||n===Y.BODY||n===Y.BR)&&nE(e,t)}function nE(e,t){e._insertFakeRootElement(),e.insertionMode=Z.BEFORE_HEAD,e._processToken(t)}function xce(e,t){switch(t.tagID){case Y.HTML:gE(e,t);break;case Y.HEAD:e._insertElement(t,q.HTML),e.headElement=e.openElements.current,e.insertionMode=Z.IN_HEAD;break;default:rE(e,t)}}function Sce(e,t){let n=t.tagID;n===Y.HEAD||n===Y.BODY||n===Y.HTML||n===Y.BR?rE(e,t):e._err(t,K.endTagWithoutMatchingOpenElement)}function rE(e,t){e._insertFakeElement(J.HEAD,Y.HEAD),e.headElement=e.openElements.current,e.insertionMode=Z.IN_HEAD,e._processToken(t)}function iE(e,t){switch(t.tagID){case Y.HTML:gE(e,t);break;case Y.BASE:case Y.BASEFONT:case Y.BGSOUND:case Y.LINK:case Y.META:e._appendElement(t,q.HTML),t.ackSelfClosing=!0;break;case Y.TITLE:e._switchToTextParsing(t,ET.RCDATA);break;case Y.NOSCRIPT:e.options.scriptingEnabled?e._switchToTextParsing(t,ET.RAWTEXT):(e._insertElement(t,q.HTML),e.insertionMode=Z.IN_HEAD_NO_SCRIPT);break;case Y.NOFRAMES:case Y.STYLE:e._switchToTextParsing(t,ET.RAWTEXT);break;case Y.SCRIPT:e._switchToTextParsing(t,ET.SCRIPT_DATA);break;case Y.TEMPLATE:e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=Z.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(Z.IN_TEMPLATE);break;case Y.HEAD:e._err(t,K.misplacedStartTagForHeadElement);break;default:oE(e,t)}}function Cce(e,t){switch(t.tagID){case Y.HEAD:e.openElements.pop(),e.insertionMode=Z.AFTER_HEAD;break;case Y.BODY:case Y.BR:case Y.HTML:oE(e,t);break;case Y.TEMPLATE:aE(e,t);break;default:e._err(t,K.endTagWithoutMatchingOpenElement)}}function aE(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==Y.TEMPLATE&&e._err(t,K.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(Y.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,K.endTagWithoutMatchingOpenElement)}function oE(e,t){e.openElements.pop(),e.insertionMode=Z.AFTER_HEAD,e._processToken(t)}function wce(e,t){switch(t.tagID){case Y.HTML:gE(e,t);break;case Y.BASEFONT:case Y.BGSOUND:case Y.HEAD:case Y.LINK:case Y.META:case Y.NOFRAMES:case Y.STYLE:iE(e,t);break;case Y.NOSCRIPT:e._err(t,K.nestedNoscriptInHead);break;default:sE(e,t)}}function Tce(e,t){switch(t.tagID){case Y.NOSCRIPT:e.openElements.pop(),e.insertionMode=Z.IN_HEAD;break;case Y.BR:sE(e,t);break;default:e._err(t,K.endTagWithoutMatchingOpenElement)}}function sE(e,t){let n=t.type===mT.EOF?K.openElementsLeftAfterEof:K.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=Z.IN_HEAD,e._processToken(t)}function Ece(e,t){switch(t.tagID){case Y.HTML:gE(e,t);break;case Y.BODY:e._insertElement(t,q.HTML),e.framesetOk=!1,e.insertionMode=Z.IN_BODY;break;case Y.FRAMESET:e._insertElement(t,q.HTML),e.insertionMode=Z.IN_FRAMESET;break;case Y.BASE:case Y.BASEFONT:case Y.BGSOUND:case Y.LINK:case Y.META:case Y.NOFRAMES:case Y.SCRIPT:case Y.STYLE:case Y.TEMPLATE:case Y.TITLE:e._err(t,K.abandonedHeadElementChild),e.openElements.push(e.headElement,Y.HEAD),iE(e,t),e.openElements.remove(e.headElement);break;case Y.HEAD:e._err(t,K.misplacedStartTagForHeadElement);break;default:cE(e,t)}}function Dce(e,t){switch(t.tagID){case Y.BODY:case Y.HTML:case Y.BR:cE(e,t);break;case Y.TEMPLATE:aE(e,t);break;default:e._err(t,K.endTagWithoutMatchingOpenElement)}}function cE(e,t){e._insertFakeElement(J.BODY,Y.BODY),e.insertionMode=Z.IN_BODY,lE(e,t)}function lE(e,t){switch(t.type){case mT.CHARACTER:dE(e,t);break;case mT.WHITESPACE_CHARACTER:uE(e,t);break;case mT.COMMENT:$T(e,t);break;case mT.START_TAG:gE(e,t);break;case mT.END_TAG:vE(e,t);break;case mT.EOF:yE(e,t);break;default:}}function uE(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function dE(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function Oce(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function kce(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function Ace(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,q.HTML),e.insertionMode=Z.IN_FRAMESET)}function jce(e,t){e.openElements.hasInButtonScope(Y.P)&&e._closePElement(),e._insertElement(t,q.HTML)}function Mce(e,t){e.openElements.hasInButtonScope(Y.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&TT.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,q.HTML)}function Nce(e,t){e.openElements.hasInButtonScope(Y.P)&&e._closePElement(),e._insertElement(t,q.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function Pce(e,t){let n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(Y.P)&&e._closePElement(),e._insertElement(t,q.HTML),n||(e.formElement=e.openElements.current))}function Fce(e,t){e.framesetOk=!1;let n=t.tagID;for(let t=e.openElements.stackTop;t>=0;t--){let r=e.openElements.tagIDs[t];if(n===Y.LI&&r===Y.LI||(n===Y.DD||n===Y.DT)&&(r===Y.DD||r===Y.DT)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r);break}if(r!==Y.ADDRESS&&r!==Y.DIV&&r!==Y.P&&e._isSpecialElement(e.openElements.items[t],r))break}e.openElements.hasInButtonScope(Y.P)&&e._closePElement(),e._insertElement(t,q.HTML)}function Ice(e,t){e.openElements.hasInButtonScope(Y.P)&&e._closePElement(),e._insertElement(t,q.HTML),e.tokenizer.state=ET.PLAINTEXT}function Lce(e,t){e.openElements.hasInScope(Y.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(Y.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,q.HTML),e.framesetOk=!1}function Rce(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(J.A);n&&(QT(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,q.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function zce(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,q.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Bce(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(Y.NOBR)&&(QT(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,q.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Vce(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,q.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function Hce(e,t){e.treeAdapter.getDocumentMode(e.document)!==ST.QUIRKS&&e.openElements.hasInButtonScope(Y.P)&&e._closePElement(),e._insertElement(t,q.HTML),e.framesetOk=!1,e.insertionMode=Z.IN_TABLE}function fE(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,q.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function pE(e){let t=hT(e,xT.TYPE);return t!=null&&t.toLowerCase()===`hidden`}function Uce(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,q.HTML),pE(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function Wce(e,t){e._appendElement(t,q.HTML),t.ackSelfClosing=!0}function Gce(e,t){e.openElements.hasInButtonScope(Y.P)&&e._closePElement(),e._appendElement(t,q.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Kce(e,t){t.tagName=J.IMG,t.tagID=Y.IMG,fE(e,t)}function qce(e,t){e._insertElement(t,q.HTML),e.skipNextNewLine=!0,e.tokenizer.state=ET.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=Z.TEXT}function Jce(e,t){e.openElements.hasInButtonScope(Y.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,ET.RAWTEXT)}function Yce(e,t){e.framesetOk=!1,e._switchToTextParsing(t,ET.RAWTEXT)}function mE(e,t){e._switchToTextParsing(t,ET.RAWTEXT)}function Xce(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,q.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===Z.IN_TABLE||e.insertionMode===Z.IN_CAPTION||e.insertionMode===Z.IN_TABLE_BODY||e.insertionMode===Z.IN_ROW||e.insertionMode===Z.IN_CELL?Z.IN_SELECT_IN_TABLE:Z.IN_SELECT}function Zce(e,t){e.openElements.currentTagId===Y.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,q.HTML)}function Qce(e,t){e.openElements.hasInScope(Y.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,q.HTML)}function $ce(e,t){e.openElements.hasInScope(Y.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(Y.RTC),e._insertElement(t,q.HTML)}function ele(e,t){e._reconstructActiveFormattingElements(),KT(t),JT(t),t.selfClosing?e._appendElement(t,q.MATHML):e._insertElement(t,q.MATHML),t.ackSelfClosing=!0}function tle(e,t){e._reconstructActiveFormattingElements(),qT(t),JT(t),t.selfClosing?e._appendElement(t,q.SVG):e._insertElement(t,q.SVG),t.ackSelfClosing=!0}function hE(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,q.HTML)}function gE(e,t){switch(t.tagID){case Y.I:case Y.S:case Y.B:case Y.U:case Y.EM:case Y.TT:case Y.BIG:case Y.CODE:case Y.FONT:case Y.SMALL:case Y.STRIKE:case Y.STRONG:zce(e,t);break;case Y.A:Rce(e,t);break;case Y.H1:case Y.H2:case Y.H3:case Y.H4:case Y.H5:case Y.H6:Mce(e,t);break;case Y.P:case Y.DL:case Y.OL:case Y.UL:case Y.DIV:case Y.DIR:case Y.NAV:case Y.MAIN:case Y.MENU:case Y.ASIDE:case Y.CENTER:case Y.FIGURE:case Y.FOOTER:case Y.HEADER:case Y.HGROUP:case Y.DIALOG:case Y.DETAILS:case Y.ADDRESS:case Y.ARTICLE:case Y.SEARCH:case Y.SECTION:case Y.SUMMARY:case Y.FIELDSET:case Y.BLOCKQUOTE:case Y.FIGCAPTION:jce(e,t);break;case Y.LI:case Y.DD:case Y.DT:Fce(e,t);break;case Y.BR:case Y.IMG:case Y.WBR:case Y.AREA:case Y.EMBED:case Y.KEYGEN:fE(e,t);break;case Y.HR:Gce(e,t);break;case Y.RB:case Y.RTC:Qce(e,t);break;case Y.RT:case Y.RP:$ce(e,t);break;case Y.PRE:case Y.LISTING:Nce(e,t);break;case Y.XMP:Jce(e,t);break;case Y.SVG:tle(e,t);break;case Y.HTML:Oce(e,t);break;case Y.BASE:case Y.LINK:case Y.META:case Y.STYLE:case Y.TITLE:case Y.SCRIPT:case Y.BGSOUND:case Y.BASEFONT:case Y.TEMPLATE:iE(e,t);break;case Y.BODY:kce(e,t);break;case Y.FORM:Pce(e,t);break;case Y.NOBR:Bce(e,t);break;case Y.MATH:ele(e,t);break;case Y.TABLE:Hce(e,t);break;case Y.INPUT:Uce(e,t);break;case Y.PARAM:case Y.TRACK:case Y.SOURCE:Wce(e,t);break;case Y.IMAGE:Kce(e,t);break;case Y.BUTTON:Lce(e,t);break;case Y.APPLET:case Y.OBJECT:case Y.MARQUEE:Vce(e,t);break;case Y.IFRAME:Yce(e,t);break;case Y.SELECT:Xce(e,t);break;case Y.OPTION:case Y.OPTGROUP:Zce(e,t);break;case Y.NOEMBED:case Y.NOFRAMES:mE(e,t);break;case Y.FRAMESET:Ace(e,t);break;case Y.TEXTAREA:qce(e,t);break;case Y.NOSCRIPT:e.options.scriptingEnabled?mE(e,t):hE(e,t);break;case Y.PLAINTEXT:Ice(e,t);break;case Y.COL:case Y.TH:case Y.TD:case Y.TR:case Y.HEAD:case Y.FRAME:case Y.TBODY:case Y.TFOOT:case Y.THEAD:case Y.CAPTION:case Y.COLGROUP:break;default:hE(e,t)}}function nle(e,t){if(e.openElements.hasInScope(Y.BODY)&&(e.insertionMode=Z.AFTER_BODY,e.options.sourceCodeLocationInfo)){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function rle(e,t){e.openElements.hasInScope(Y.BODY)&&(e.insertionMode=Z.AFTER_BODY,LE(e,t))}function ile(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function ale(e){let t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(Y.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(Y.FORM):n&&e.openElements.remove(n))}function ole(e){e.openElements.hasInButtonScope(Y.P)||e._insertFakeElement(J.P,Y.P),e._closePElement()}function sle(e){e.openElements.hasInListItemScope(Y.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(Y.LI),e.openElements.popUntilTagNamePopped(Y.LI))}function cle(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function lle(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function ule(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function dle(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(J.BR,Y.BR),e.openElements.pop(),e.framesetOk=!1}function _E(e,t){let n=t.tagName,r=t.tagID;for(let t=e.openElements.stackTop;t>0;t--){let i=e.openElements.items[t],a=e.openElements.tagIDs[t];if(r===a&&(r!==Y.UNKNOWN||e.treeAdapter.getTagName(i)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=t&&e.openElements.shortenToLength(t);break}if(e._isSpecialElement(i,a))break}}function vE(e,t){switch(t.tagID){case Y.A:case Y.B:case Y.I:case Y.S:case Y.U:case Y.EM:case Y.TT:case Y.BIG:case Y.CODE:case Y.FONT:case Y.NOBR:case Y.SMALL:case Y.STRIKE:case Y.STRONG:QT(e,t);break;case Y.P:ole(e);break;case Y.DL:case Y.UL:case Y.OL:case Y.DIR:case Y.DIV:case Y.NAV:case Y.PRE:case Y.MAIN:case Y.MENU:case Y.ASIDE:case Y.BUTTON:case Y.CENTER:case Y.FIGURE:case Y.FOOTER:case Y.HEADER:case Y.HGROUP:case Y.DIALOG:case Y.ADDRESS:case Y.ARTICLE:case Y.DETAILS:case Y.SEARCH:case Y.SECTION:case Y.SUMMARY:case Y.LISTING:case Y.FIELDSET:case Y.BLOCKQUOTE:case Y.FIGCAPTION:ile(e,t);break;case Y.LI:sle(e);break;case Y.DD:case Y.DT:cle(e,t);break;case Y.H1:case Y.H2:case Y.H3:case Y.H4:case Y.H5:case Y.H6:lle(e);break;case Y.BR:dle(e);break;case Y.BODY:nle(e,t);break;case Y.HTML:rle(e,t);break;case Y.FORM:ale(e);break;case Y.APPLET:case Y.OBJECT:case Y.MARQUEE:ule(e,t);break;case Y.TEMPLATE:aE(e,t);break;default:_E(e,t)}}function yE(e,t){e.tmplInsertionModeStack.length>0?IE(e,t):eE(e,t)}function fle(e,t){var n;t.tagID===Y.SCRIPT&&((n=e.scriptHandler)==null||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function ple(e,t){e._err(t,K.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function bE(e,t){if(e.openElements.currentTagId!==void 0&&YT.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=Z.IN_TABLE_TEXT,t.type){case mT.CHARACTER:TE(e,t);break;case mT.WHITESPACE_CHARACTER:wE(e,t);break}else CE(e,t)}function mle(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,q.HTML),e.insertionMode=Z.IN_CAPTION}function hle(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,q.HTML),e.insertionMode=Z.IN_COLUMN_GROUP}function gle(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(J.COLGROUP,Y.COLGROUP),e.insertionMode=Z.IN_COLUMN_GROUP,OE(e,t)}function _le(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,q.HTML),e.insertionMode=Z.IN_TABLE_BODY}function vle(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(J.TBODY,Y.TBODY),e.insertionMode=Z.IN_TABLE_BODY,AE(e,t)}function yle(e,t){e.openElements.hasInTableScope(Y.TABLE)&&(e.openElements.popUntilTagNamePopped(Y.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function ble(e,t){pE(t)?e._appendElement(t,q.HTML):CE(e,t),t.ackSelfClosing=!0}function xle(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,q.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function xE(e,t){switch(t.tagID){case Y.TD:case Y.TH:case Y.TR:vle(e,t);break;case Y.STYLE:case Y.SCRIPT:case Y.TEMPLATE:iE(e,t);break;case Y.COL:gle(e,t);break;case Y.FORM:xle(e,t);break;case Y.TABLE:yle(e,t);break;case Y.TBODY:case Y.TFOOT:case Y.THEAD:_le(e,t);break;case Y.INPUT:ble(e,t);break;case Y.CAPTION:mle(e,t);break;case Y.COLGROUP:hle(e,t);break;default:CE(e,t)}}function SE(e,t){switch(t.tagID){case Y.TABLE:e.openElements.hasInTableScope(Y.TABLE)&&(e.openElements.popUntilTagNamePopped(Y.TABLE),e._resetInsertionMode());break;case Y.TEMPLATE:aE(e,t);break;case Y.BODY:case Y.CAPTION:case Y.COL:case Y.COLGROUP:case Y.HTML:case Y.TBODY:case Y.TD:case Y.TFOOT:case Y.TH:case Y.THEAD:case Y.TR:break;default:CE(e,t)}}function CE(e,t){let n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,lE(e,t),e.fosterParentingEnabled=n}function wE(e,t){e.pendingCharacterTokens.push(t)}function TE(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function EE(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)CE(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const DE=new Set([Y.CAPTION,Y.COL,Y.COLGROUP,Y.TBODY,Y.TD,Y.TFOOT,Y.TH,Y.THEAD,Y.TR]);function Sle(e,t){let n=t.tagID;DE.has(n)?e.openElements.hasInTableScope(Y.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(Y.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=Z.IN_TABLE,xE(e,t)):gE(e,t)}function Cle(e,t){let n=t.tagID;switch(n){case Y.CAPTION:case Y.TABLE:e.openElements.hasInTableScope(Y.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(Y.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=Z.IN_TABLE,n===Y.TABLE&&SE(e,t));break;case Y.BODY:case Y.COL:case Y.COLGROUP:case Y.HTML:case Y.TBODY:case Y.TD:case Y.TFOOT:case Y.TH:case Y.THEAD:case Y.TR:break;default:vE(e,t)}}function OE(e,t){switch(t.tagID){case Y.HTML:gE(e,t);break;case Y.COL:e._appendElement(t,q.HTML),t.ackSelfClosing=!0;break;case Y.TEMPLATE:iE(e,t);break;default:kE(e,t)}}function wle(e,t){switch(t.tagID){case Y.COLGROUP:e.openElements.currentTagId===Y.COLGROUP&&(e.openElements.pop(),e.insertionMode=Z.IN_TABLE);break;case Y.TEMPLATE:aE(e,t);break;case Y.COL:break;default:kE(e,t)}}function kE(e,t){e.openElements.currentTagId===Y.COLGROUP&&(e.openElements.pop(),e.insertionMode=Z.IN_TABLE,e._processToken(t))}function AE(e,t){switch(t.tagID){case Y.TR:e.openElements.clearBackToTableBodyContext(),e._insertElement(t,q.HTML),e.insertionMode=Z.IN_ROW;break;case Y.TH:case Y.TD:e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(J.TR,Y.TR),e.insertionMode=Z.IN_ROW,ME(e,t);break;case Y.CAPTION:case Y.COL:case Y.COLGROUP:case Y.TBODY:case Y.TFOOT:case Y.THEAD:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=Z.IN_TABLE,xE(e,t));break;default:xE(e,t)}}function jE(e,t){let n=t.tagID;switch(t.tagID){case Y.TBODY:case Y.TFOOT:case Y.THEAD:e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=Z.IN_TABLE);break;case Y.TABLE:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=Z.IN_TABLE,SE(e,t));break;case Y.BODY:case Y.CAPTION:case Y.COL:case Y.COLGROUP:case Y.HTML:case Y.TD:case Y.TH:case Y.TR:break;default:SE(e,t)}}function ME(e,t){switch(t.tagID){case Y.TH:case Y.TD:e.openElements.clearBackToTableRowContext(),e._insertElement(t,q.HTML),e.insertionMode=Z.IN_CELL,e.activeFormattingElements.insertMarker();break;case Y.CAPTION:case Y.COL:case Y.COLGROUP:case Y.TBODY:case Y.TFOOT:case Y.THEAD:case Y.TR:e.openElements.hasInTableScope(Y.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=Z.IN_TABLE_BODY,AE(e,t));break;default:xE(e,t)}}function NE(e,t){switch(t.tagID){case Y.TR:e.openElements.hasInTableScope(Y.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=Z.IN_TABLE_BODY);break;case Y.TABLE:e.openElements.hasInTableScope(Y.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=Z.IN_TABLE_BODY,jE(e,t));break;case Y.TBODY:case Y.TFOOT:case Y.THEAD:(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(Y.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=Z.IN_TABLE_BODY,jE(e,t));break;case Y.BODY:case Y.CAPTION:case Y.COL:case Y.COLGROUP:case Y.HTML:case Y.TD:case Y.TH:break;default:SE(e,t)}}function Tle(e,t){let n=t.tagID;DE.has(n)?(e.openElements.hasInTableScope(Y.TD)||e.openElements.hasInTableScope(Y.TH))&&(e._closeTableCell(),ME(e,t)):gE(e,t)}function Ele(e,t){let n=t.tagID;switch(n){case Y.TD:case Y.TH:e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=Z.IN_ROW);break;case Y.TABLE:case Y.TBODY:case Y.TFOOT:case Y.THEAD:case Y.TR:e.openElements.hasInTableScope(n)&&(e._closeTableCell(),NE(e,t));break;case Y.BODY:case Y.CAPTION:case Y.COL:case Y.COLGROUP:case Y.HTML:break;default:vE(e,t)}}function PE(e,t){switch(t.tagID){case Y.HTML:gE(e,t);break;case Y.OPTION:e.openElements.currentTagId===Y.OPTION&&e.openElements.pop(),e._insertElement(t,q.HTML);break;case Y.OPTGROUP:e.openElements.currentTagId===Y.OPTION&&e.openElements.pop(),e.openElements.currentTagId===Y.OPTGROUP&&e.openElements.pop(),e._insertElement(t,q.HTML);break;case Y.HR:e.openElements.currentTagId===Y.OPTION&&e.openElements.pop(),e.openElements.currentTagId===Y.OPTGROUP&&e.openElements.pop(),e._appendElement(t,q.HTML),t.ackSelfClosing=!0;break;case Y.INPUT:case Y.KEYGEN:case Y.TEXTAREA:case Y.SELECT:e.openElements.hasInSelectScope(Y.SELECT)&&(e.openElements.popUntilTagNamePopped(Y.SELECT),e._resetInsertionMode(),t.tagID!==Y.SELECT&&e._processStartTag(t));break;case Y.SCRIPT:case Y.TEMPLATE:iE(e,t);break;default:}}function FE(e,t){switch(t.tagID){case Y.OPTGROUP:e.openElements.stackTop>0&&e.openElements.currentTagId===Y.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===Y.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===Y.OPTGROUP&&e.openElements.pop();break;case Y.OPTION:e.openElements.currentTagId===Y.OPTION&&e.openElements.pop();break;case Y.SELECT:e.openElements.hasInSelectScope(Y.SELECT)&&(e.openElements.popUntilTagNamePopped(Y.SELECT),e._resetInsertionMode());break;case Y.TEMPLATE:aE(e,t);break;default:}}function Dle(e,t){let n=t.tagID;n===Y.CAPTION||n===Y.TABLE||n===Y.TBODY||n===Y.TFOOT||n===Y.THEAD||n===Y.TR||n===Y.TD||n===Y.TH?(e.openElements.popUntilTagNamePopped(Y.SELECT),e._resetInsertionMode(),e._processStartTag(t)):PE(e,t)}function Ole(e,t){let n=t.tagID;n===Y.CAPTION||n===Y.TABLE||n===Y.TBODY||n===Y.TFOOT||n===Y.THEAD||n===Y.TR||n===Y.TD||n===Y.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(Y.SELECT),e._resetInsertionMode(),e.onEndTag(t)):FE(e,t)}function kle(e,t){switch(t.tagID){case Y.BASE:case Y.BASEFONT:case Y.BGSOUND:case Y.LINK:case Y.META:case Y.NOFRAMES:case Y.SCRIPT:case Y.STYLE:case Y.TEMPLATE:case Y.TITLE:iE(e,t);break;case Y.CAPTION:case Y.COLGROUP:case Y.TBODY:case Y.TFOOT:case Y.THEAD:e.tmplInsertionModeStack[0]=Z.IN_TABLE,e.insertionMode=Z.IN_TABLE,xE(e,t);break;case Y.COL:e.tmplInsertionModeStack[0]=Z.IN_COLUMN_GROUP,e.insertionMode=Z.IN_COLUMN_GROUP,OE(e,t);break;case Y.TR:e.tmplInsertionModeStack[0]=Z.IN_TABLE_BODY,e.insertionMode=Z.IN_TABLE_BODY,AE(e,t);break;case Y.TD:case Y.TH:e.tmplInsertionModeStack[0]=Z.IN_ROW,e.insertionMode=Z.IN_ROW,ME(e,t);break;default:e.tmplInsertionModeStack[0]=Z.IN_BODY,e.insertionMode=Z.IN_BODY,gE(e,t)}}function Ale(e,t){t.tagID===Y.TEMPLATE&&aE(e,t)}function IE(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(Y.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):eE(e,t)}function jle(e,t){t.tagID===Y.HTML?gE(e,t):RE(e,t)}function LE(e,t){if(t.tagID===Y.HTML){if(e.fragmentContext||(e.insertionMode=Z.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===Y.HTML){e._setEndLocation(e.openElements.items[0],t);let n=e.openElements.items[1];n&&!e.treeAdapter.getNodeSourceCodeLocation(n)?.endTag&&e._setEndLocation(n,t)}}else RE(e,t)}function RE(e,t){e.insertionMode=Z.IN_BODY,lE(e,t)}function Mle(e,t){switch(t.tagID){case Y.HTML:gE(e,t);break;case Y.FRAMESET:e._insertElement(t,q.HTML);break;case Y.FRAME:e._appendElement(t,q.HTML),t.ackSelfClosing=!0;break;case Y.NOFRAMES:iE(e,t);break;default:}}function Nle(e,t){t.tagID===Y.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==Y.FRAMESET&&(e.insertionMode=Z.AFTER_FRAMESET))}function Ple(e,t){switch(t.tagID){case Y.HTML:gE(e,t);break;case Y.NOFRAMES:iE(e,t);break;default:}}function Fle(e,t){t.tagID===Y.HTML&&(e.insertionMode=Z.AFTER_AFTER_FRAMESET)}function Ile(e,t){t.tagID===Y.HTML?gE(e,t):zE(e,t)}function zE(e,t){e.insertionMode=Z.IN_BODY,lE(e,t)}function Lle(e,t){switch(t.tagID){case Y.HTML:gE(e,t);break;case Y.NOFRAMES:iE(e,t);break;default:}}function Rle(e,t){t.chars=`�`,e._insertCharacters(t)}function zle(e,t){e._insertCharacters(t),e.framesetOk=!1}function BE(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==q.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function Ble(e,t){if(ice(t))BE(e),e._startTagOutsideForeignContent(t);else{let n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===q.MATHML?KT(t):r===q.SVG&&(ace(t),qT(t)),JT(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function Vle(e,t){if(t.tagID===Y.P||t.tagID===Y.BR){BE(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){let r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===q.HTML){e._endTagOutsideForeignContent(t);break}let i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}new Set([J.AREA,J.BASE,J.BASEFONT,J.BGSOUND,J.BR,J.COL,J.EMBED,J.FRAME,J.HR,J.IMG,J.INPUT,J.KEYGEN,J.LINK,J.META,J.PARAM,J.SOURCE,J.TRACK,J.WBR]);function Hle(e,t){return ZT.parse(e,t)}function Ule(e,t,n){typeof e==`string`&&(n=t,t=e,e=null);let r=ZT.getFragmentParser(e,n);return r.tokenizer.write(t,!0),r.getFragment()}function VE(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}const HE=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`];var UE=class{constructor(e){let t;t=e?VE(e)?{path:e}:typeof e==`string`||Wle(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:xe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<HE.length;){let e=HE[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)HE.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?de.basename(this.path):void 0}set basename(e){GE(e,`basename`),WE(e,`basename`),this.path=de.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?de.dirname(this.path):void 0}set dirname(e){KE(this.basename,`dirname`),this.path=de.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?de.extname(this.path):void 0}set extname(e){if(WE(e,`extname`),KE(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=de.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){VE(e)&&(e=Ce(e)),GE(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?de.basename(this.path,this.extname):void 0}set stem(e){GE(e,`stem`),WE(e,`stem`),this.path=de.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new ko(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function WE(e,t){if(e&&e.includes(de.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+de.sep+"`")}function GE(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function KE(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function Wle(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}const Gle={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`}},Kle=/-[a-z]/g,qle=/%c(?:([-+])(\d+))?/g,Jle=/%x/g,Yle={2:!0,1:!1,0:null},Xle={};function Zle(e,t){let n=t||Xle,r=n.onerror,i=e instanceof UE?e:new UE(e),a=n.fragment?Ule:Hle,o=String(i);return bse(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=Qle(t),s=n[a]??!0,c=typeof s==`number`?s:+!!s;if(c){let n=Gle[a],o=new ko(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=Yle[c],o.note=l(n.description),o.url=n.url===!1?void 0:`https://html.spec.whatwg.org/multipage/parsing.html#parse-error-`+t,r(o)}function l(t){return t.replace(qle,n).replace(Jle,r);function n(t,n,r){let i=(r?Number.parseInt(r,10):0)*(n===`-`?-1:1);return eue(o.charAt(e.startOffset+i))}function r(){return tue(o.charCodeAt(e.startOffset))}}}}function Qle(e){return e.replace(Kle,$le)}function $le(e){return e.charAt(1).toUpperCase()}function eue(e){return e==="`"?"` ` `":e}function tue(e){return`0x`+e.toString(16).toUpperCase()}const qE=(function(e,t,n,r,i){let a=JE(t);if(n!=null&&(typeof n!=`number`||n<0||n===1/0))throw Error(`Expected positive finite index`);if(r!=null&&(!qE(r)||!r.children))throw Error(`Expected parent node`);if(r==null!=(n==null))throw Error(`Expected both parent and index`);return XE(e)?a.call(i,e,n,r):!1}),JE=(function(e){if(e==null)return aue;if(typeof e==`function`)return YE(e);if(typeof e==`object`)return Array.isArray(e)?nue(e):rue(e);if(typeof e==`string`)return iue(e);throw Error(`Expected function, string, or object as test`)});function nue(e){let t=[],n=-1;for(;++n<e.length;)t[n]=JE(e[n]);return YE(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function rue(e){let t=e;return YE(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function iue(e){return YE(t);function t(t){return t&&t.type===e}}function YE(e){return t;function t(t,n,r){return!!(XE(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function aue(){return!0}function XE(e){return typeof e==`object`&&!!e&&`type`in e}function oue(e){return`\x1B[33m`+e+`\x1B[39m`}const ZE=[],QE=`skip`;function $E(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=JE(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,`name`,{value:`node (`+oue(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=ZE,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=sue(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function sue(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?ZE:[e]}function eD(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),$E(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}const cue={};function tD(e,t){let n=t||cue;return nD(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function nD(e,t,n){if(lue(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return rD(e.children,t,n)}return Array.isArray(e)?rD(e,t,n):``}function rD(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=nD(e[i],t,n);return r.join(``)}function lue(e){return!!(e&&typeof e==`object`)}const uue=JE([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function iD(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}const aD=mD(/[A-Za-z]/),oD=mD(/[\dA-Za-z]/),due=mD(/[#-'*+\--9=?A-Z^-~]/);function sD(e){return e!==null&&(e<32||e===127)}const cD=mD(/\d/),fue=mD(/[\dA-Fa-f]/),pue=mD(/[!-/:-@[-`{-~]/);function lD(e){return e!==null&&e<-2}function uD(e){return e!==null&&(e<0||e===32)}function dD(e){return e===-2||e===-1||e===32}const fD=mD(/\p{P}|\p{S}/u),pD=mD(/\s/);function mD(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function hD(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function mue(e,t,n){let r=JE((n||{}).ignore||[]),i=hue(t),a=-1;for(;++a<i.length;)$E(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function hue(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([gue(e[0]),_ue(e[1])])}return t}function gue(e){return typeof e==`string`?new RegExp(hD(e),`g`):e}function _ue(e){return typeof e==`function`?e:function(){return e}}const gD=`phrasing`,_D=[`autolink`,`link`,`image`,`label`];function vue(){return{transforms:[Tue],enter:{literalAutolink:bue,literalAutolinkEmail:vD,literalAutolinkHttp:vD,literalAutolinkWww:vD},exit:{literalAutolink:wue,literalAutolinkEmail:Cue,literalAutolinkHttp:xue,literalAutolinkWww:Sue}}}function yue(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:gD,notInConstruct:_D},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:gD,notInConstruct:_D},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:gD,notInConstruct:_D}]}}function bue(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function vD(e){this.config.enter.autolinkProtocol.call(this,e)}function xue(e){this.config.exit.autolinkProtocol.call(this,e)}function Sue(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function Cue(e){this.config.exit.autolinkEmail.call(this,e)}function wue(e){this.exit(e)}function Tue(e){mue(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Eue],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,Due]],{ignore:[`link`,`linkReference`]})}function Eue(e,t,n,r,i){let a=``;if(!yD(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!Oue(n)))return!1;let o=kue(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function Due(e,t,n,r){return!yD(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function Oue(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function kue(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=iD(e,`(`),a=iD(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function yD(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||pD(n)||fD(n))&&(!t||n!==47)}function bD(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}xD.peek=Rue;function Aue(){this.buffer()}function jue(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function Mue(){this.buffer()}function Nue(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function Pue(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=bD(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Fue(e){this.exit(e)}function Iue(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=bD(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Lue(e){this.exit(e)}function Rue(){return`[`}function xD(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function zue(){return{enter:{gfmFootnoteCallString:Aue,gfmFootnoteCall:jue,gfmFootnoteDefinitionLabelString:Mue,gfmFootnoteDefinition:Nue},exit:{gfmFootnoteCallString:Pue,gfmFootnoteCall:Fue,gfmFootnoteDefinitionLabelString:Iue,gfmFootnoteDefinition:Lue}}}function Bue(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:xD},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
269
269
|
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?SD:Vue))),s(),o}}function Vue(e,t,n){return t===0?e:SD(e,t,n)}function SD(e,t,n){return(n?``:` `)+e}const Hue=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];CD.peek=que;function Uue(){return{canContainEols:[`delete`],enter:{strikethrough:Gue},exit:{strikethrough:Kue}}}function Wue(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:Hue}],handlers:{delete:CD}}}function Gue(e){this.enter({type:`delete`,children:[]},e)}function Kue(e){this.exit(e)}function CD(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function que(){return`~`}function Jue(e){return e.length}function Yue(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Jue,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=Xue(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=wD(r[d]);else{let e=wD(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&!(n.alignDelimiters===!1&&i===``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
|
|
@@ -1520,6 +1520,6 @@ export default function okBridge(pi: {
|
|
|
1520
1520
|
`))}function A9(e,t){let n=S(e,`utf-8`);if(n.trim().length!==0)try{let r=O9(JSON.parse(n),t),i=n.endsWith(`
|
|
1521
1521
|
`)?`
|
|
1522
1522
|
`:``;ne(e,`${JSON.stringify(r,null,2)}${i}`)}catch{let r=D9(n,t.contentDir);r!==n&&ne(e,r)}}function j9(e,t){let n=S(e,`utf-8`),r=D9(n,t.contentDir);r!==n&&ne(e,r)}function M9(e){try{return C(e,{withFileTypes:!0}).filter(e=>e.isFile()).map(t=>N(e,t.name))}catch{return[]}}const Swe=new Set([`agent-presence.json`,`agent-effects.json`,`runtime.json`]);function N9(e){return/\.log\.\d+$/.test(e)}function Cwe(e){return e.endsWith(`.jsonl`)||e.endsWith(`.log`)||N9(e)}function wwe(e){let t={contentDir:e.contentDir};for(let n of[`telemetry`,`logs`,`process`])for(let r of M9(N(e.stagingDir,n)))Cwe(r)?k9(r,t):r.endsWith(`.json`)?A9(r,t):j9(r,t);for(let n of M9(N(e.stagingDir,`state`))){let e=fe(n);n.endsWith(`.jsonl`)?k9(n,t):Swe.has(e)?A9(n,t):j9(n,t)}}const P9=[`.ok`,`local`,`telemetry`],F9=[`.ok`,`local`,`logs`],I9=[`.ok`,`local`,`loss-capture`],L9=`spans-current.jsonl`,R9=`spans-prev.jsonl`,z9=`server-current.jsonl`,B9=`server-prev.jsonl`,V9=`loss-current.jsonl`,H9=`loss-prev.jsonl`;function Twe(e){return N(e,...P9,L9)}function Ewe(e){return N(e,...P9,R9)}function Dwe(e){return N(e,...F9,z9)}function Owe(e){return N(e,...F9,B9)}function kwe(e){return N(e,...I9,V9)}function Awe(e){return N(e,...I9,H9)}const U9=1e3;async function jwe(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/agent-presence`,{signal:AbortSignal.timeout(U9)});return t.ok?await t.text():null}catch{return null}}async function Mwe(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/agent-effects`,{signal:AbortSignal.timeout(U9)});return t.ok?await t.text():null}catch{return null}}async function Nwe(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/watcher-recent`,{signal:AbortSignal.timeout(U9)});return t.ok?await t.text():null}catch{return null}}function Pwe(e){try{let t=JSON.parse(e);if(typeof t!=`object`||!t)return null;let n=t.decisions;return Array.isArray(n)?n.length===0?``:`${n.map(e=>JSON.stringify(e)).join(`
|
|
1523
|
-
`)}\n`:null}catch{return null}}function Fwe(e){let t=N(e,`.git`,`ok`);if(!g(t))return null;let n=u(`git`,[`-C`,t,`log`,`--oneline`,`-50`],A3({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function Iwe(e){let t=N(e,`.git`,`ok`);if(!g(t))return null;let n=u(`git`,[`-C`,t,`for-each-ref`,`--sort=-creatordate`,`--count=50`,`--format=%(refname)%09%(creatordate:iso-strict)%09%(contents:subject)`,`refs/checkpoints/`],A3({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function W9(){let e=process.env.OK_DESKTOP_VERSION,t=process.env.OK_DESKTOP_PACKAGED,n=process.env.OK_DESKTOP_CHANNEL;return e===void 0||t===void 0||n===void 0?null:{electronVersion:e,packaged:t===`1`||t.toLowerCase()===`true`,channel:n}}function Lwe(){return{nodeVersion:process.version,platform:k(),arch:ie()}}function Rwe(){return process.env.OTEL_SDK_DISABLED===`false`}function G9(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function K9(e){if(!g(e))return{};let t;try{t=(0,Jt.parse)(S(e,`utf-8`))}catch(t){return console.warn(`[ok diagnose bundle] failed to parse ${e} for manifest config; manifest will report schema defaults. Reason: ${t instanceof Error?t.message:String(t)}`),{}}if(!G9(t))return{};let n=t.telemetry;if(!G9(n))return{};let r=n.localSink;return G9(r)?r:{}}function q9(e){return typeof e==`boolean`?e:void 0}function zwe(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:void 0}function J9(e){if(G9(e))return zwe(e.maxBytes)}function Y9(e){let t=K9(a$(`project`,e)),n=K9(a$(`project-local`,e));return{enabled:q9(n.enabled)??q9(t.enabled)??!0,spansMaxBytes:J9(n.spans)??J9(t.spans)??52428800,logsMaxBytes:J9(n.logs)??J9(t.logs)??26214400}}function Bwe(e){return Ae(`sha256`).update(e).digest(`hex`)}function Vwe(e){let t=S(e),n=0;for(let e=0;e<t.length;e++)t[e]===10&&n++;return n}function Hwe(e){let t=S(e,`utf-8`),n=`"doc.name"`,r=0,i=t.indexOf(n);for(;i!==-1;)r++,i=t.indexOf(n,i+10);return r}function X9(e,t){if(!g(e))return!1;try{return v(pe(t),{recursive:!0}),m(e,t),!0}catch{return!1}}function Z9(e){let t=[],n=e=>{let r=C(e,{withFileTypes:!0});for(let i of r){let r=N(e,i.name);i.isDirectory()?n(r):i.isFile()&&t.push(r)}};return n(e),t.sort()}const Uwe=new Set([`.jsonl`]);function Q9(e){let t=e.lastIndexOf(`.`);return t===-1?!1:Uwe.has(e.slice(t))}const Wwe=new Set([`.jsonl`,`.json`,`.txt`,`.log`,`.lock`]);function Gwe(e){if(N9(e))return!0;let t=e.lastIndexOf(`.`);return t===-1?!1:Wwe.has(e.slice(t))}function Kwe(e){let t=[];for(let n of Z9(e)){let r=$9(e,n);if(!Gwe(r))continue;let{redacted:i,patterns:a,lineCount:o}=wo(S(n,`utf-8`));a.length!==0&&(ne(n,i),t.push({file:r,lineCount:o,patterns:a}))}return{redactions:t,redactedLineCount:t.reduce((e,t)=>e+t.lineCount,0)}}function $9(e,t){return _e(e,t).split(ye).join(`/`)}async function qwe(e){let t=ve(e.contentDir),n=ve(e.projectDir??e.contentDir),r=e.deps??{},i=r.fetchAgentPresence??jwe,a=r.fetchAgentEffects??Mwe,o=r.fetchWatcherRecent??Nwe,s=r.readShadowHead??Fwe,c=r.readCheckpointRefs??Iwe,l=r.now??(()=>new Date),u=r.okVersion??(()=>`0.58.0
|
|
1523
|
+
`)}\n`:null}catch{return null}}function Fwe(e){let t=N(e,`.git`,`ok`);if(!g(t))return null;let n=u(`git`,[`-C`,t,`log`,`--oneline`,`-50`],A3({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function Iwe(e){let t=N(e,`.git`,`ok`);if(!g(t))return null;let n=u(`git`,[`-C`,t,`for-each-ref`,`--sort=-creatordate`,`--count=50`,`--format=%(refname)%09%(creatordate:iso-strict)%09%(contents:subject)`,`refs/checkpoints/`],A3({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function W9(){let e=process.env.OK_DESKTOP_VERSION,t=process.env.OK_DESKTOP_PACKAGED,n=process.env.OK_DESKTOP_CHANNEL;return e===void 0||t===void 0||n===void 0?null:{electronVersion:e,packaged:t===`1`||t.toLowerCase()===`true`,channel:n}}function Lwe(){return{nodeVersion:process.version,platform:k(),arch:ie()}}function Rwe(){return process.env.OTEL_SDK_DISABLED===`false`}function G9(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function K9(e){if(!g(e))return{};let t;try{t=(0,Jt.parse)(S(e,`utf-8`))}catch(t){return console.warn(`[ok diagnose bundle] failed to parse ${e} for manifest config; manifest will report schema defaults. Reason: ${t instanceof Error?t.message:String(t)}`),{}}if(!G9(t))return{};let n=t.telemetry;if(!G9(n))return{};let r=n.localSink;return G9(r)?r:{}}function q9(e){return typeof e==`boolean`?e:void 0}function zwe(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:void 0}function J9(e){if(G9(e))return zwe(e.maxBytes)}function Y9(e){let t=K9(a$(`project`,e)),n=K9(a$(`project-local`,e));return{enabled:q9(n.enabled)??q9(t.enabled)??!0,spansMaxBytes:J9(n.spans)??J9(t.spans)??52428800,logsMaxBytes:J9(n.logs)??J9(t.logs)??26214400}}function Bwe(e){return Ae(`sha256`).update(e).digest(`hex`)}function Vwe(e){let t=S(e),n=0;for(let e=0;e<t.length;e++)t[e]===10&&n++;return n}function Hwe(e){let t=S(e,`utf-8`),n=`"doc.name"`,r=0,i=t.indexOf(n);for(;i!==-1;)r++,i=t.indexOf(n,i+10);return r}function X9(e,t){if(!g(e))return!1;try{return v(pe(t),{recursive:!0}),m(e,t),!0}catch{return!1}}function Z9(e){let t=[],n=e=>{let r=C(e,{withFileTypes:!0});for(let i of r){let r=N(e,i.name);i.isDirectory()?n(r):i.isFile()&&t.push(r)}};return n(e),t.sort()}const Uwe=new Set([`.jsonl`]);function Q9(e){let t=e.lastIndexOf(`.`);return t===-1?!1:Uwe.has(e.slice(t))}const Wwe=new Set([`.jsonl`,`.json`,`.txt`,`.log`,`.lock`]);function Gwe(e){if(N9(e))return!0;let t=e.lastIndexOf(`.`);return t===-1?!1:Wwe.has(e.slice(t))}function Kwe(e){let t=[];for(let n of Z9(e)){let r=$9(e,n);if(!Gwe(r))continue;let{redacted:i,patterns:a,lineCount:o}=wo(S(n,`utf-8`));a.length!==0&&(ne(n,i),t.push({file:r,lineCount:o,patterns:a}))}return{redactions:t,redactedLineCount:t.reduce((e,t)=>e+t.lineCount,0)}}function $9(e,t){return _e(e,t).split(ye).join(`/`)}async function qwe(e){let t=ve(e.contentDir),n=ve(e.projectDir??e.contentDir),r=e.deps??{},i=r.fetchAgentPresence??jwe,a=r.fetchAgentEffects??Mwe,o=r.fetchWatcherRecent??Nwe,s=r.readShadowHead??Fwe,c=r.readCheckpointRefs??Iwe,l=r.now??(()=>new Date),u=r.okVersion??(()=>`0.58.0`),d=r.readDesktopEnv??W9,f=r.readLanguage??E9,p=r.readRuntime??Lwe,h=r.isOtlpPushEnabled??Rwe,_=y(N(le(),`ok-bundle-`));try{v(N(_,`telemetry`),{recursive:!0}),v(N(_,`logs`),{recursive:!0}),v(N(_,`state`),{recursive:!0}),X9(Twe(n),N(_,`telemetry`,L9)),X9(Ewe(n),N(_,`telemetry`,R9)),X9(Dwe(n),N(_,`logs`,z9)),X9(Owe(n),N(_,`logs`,B9));for(let t of e.userLogFiles??[])X9(t,N(_,`logs`,fe(t)));let y=N(n,`.ok`,`local`),b=N(y,`server.lock`),x=`not-running`,C=`no server.lock`,w=null;if(g(b)){X9(b,N(_,`state`,`server.lock`));try{let e=S(b,`utf-8`),t=JSON.parse(e);typeof t.port==`number`?w=t.port:C=`lock present but no port`}catch{C=`lock present but unparseable`}}if(w!==null){let e=await i(w);e===null?C=`agent-presence endpoint at :${w} unreachable`:(ne(N(_,`state`,`agent-presence.json`),e),x=`running`,C=``);let t=await a(w);t!==null&&ne(N(_,`state`,`agent-effects.json`),t);let n=await o(w);if(n!==null){let e=Pwe(n);e!==null&&ne(N(_,`state`,`watcher-recent.jsonl`),e)}}let T=s(t);T!==null&&ne(N(_,`state`,`shadow-head.txt`),T);let E=c(t);E!==null&&ne(N(_,`state`,`checkpoint-refs.txt`),E),X9(kwe(n),N(_,`state`,V9)),X9(Awe(n),N(_,`state`,H9)),X9(N(y,`last-spawn-error.log`),N(_,`state`,`last-spawn-error.log`)),X9(N(y,sX),N(_,`state`,sX)),X9(N(y,cX),N(_,`state`,cX));let te=p(),re=d(),ie=f(),ae={ok:{version:u(),nodeVersion:te.nodeVersion,platform:te.platform,arch:te.arch},host:{desktop:re,language:ie}};ne(N(_,`state`,`runtime.json`),`${JSON.stringify(ae,null,2)}\n`);let oe=x===`running`?`running
|
|
1524
1524
|
`:`not-running (${C})\n`;if(ne(N(_,`state`,`server-status.txt`),oe),e.processDir&&g(e.processDir)){let t=N(_,`process`);v(t,{recursive:!0}),m(e.processDir,t,{recursive:!0})}let O=e.redact===!0;O&&wwe({stagingDir:_,contentDir:t}),e.note&&ne(N(_,`note.txt`),e.note);let se=null;e.scrubSecrets===!0&&(se=Kwe(_));for(let t of e.extraFiles??[])X9(t.sourcePath,N(_,`extra`,t.zipName??fe(t.sourcePath)))||r.logger?.warn({sourcePath:t.sourcePath},`extra file missing; omitted from bundle`);let k=Y9(n),ce=Z9(_),le=[],ue=0,A=0;for(let e of ce){let t=$9(_,e),n=ee(e).size,r=Q9(t)?Vwe(e):0;le.push({path:t,bytes:n,lines:r}),ue+=n,t.startsWith(`telemetry/`)&&Q9(t)&&(A+=Hwe(e))}let j={applied:O};se!==null&&(j.secretScrub=se);let de={schemaVersion:2,createdAt:l().toISOString(),ok:{version:u(),nodeVersion:te.nodeVersion,platform:te.platform,arch:te.arch},host:{desktop:re,language:ie},contentDir:{pathSha256:Bwe(t),absolutePath:O?`<CONTENT_DIR>`:t},telemetry:{localSink:k,otlpPushEnabled:h()},redaction:j,serverStatus:x,files:le};ne(N(_,`manifest.json`),`${JSON.stringify(de,null,2)}\n`);let pe=ce.some(e=>{try{return S(e,`utf-8`).includes(t)}catch{return!1}}),me={totalBytes:ue,fileCount:le.length,docNameCount:A,contentDirVisible:pe,redacted:O},M=!1;return{stagingDir:_,manifest:de,summary:me,cleanup:()=>{M||(M=!0,D(_,{recursive:!0,force:!0}))}}}catch(e){throw D(_,{recursive:!0,force:!0}),e}}async function Jwe(e){let{collected:t,outputPath:n}=e,r=pe(n);if(!g(r))throw Error(`ok diagnose bundle: parent directory does not exist: ${r}. Create it or pass --out with an existing parent.`);let i=new Dye.ZipFile,a=Z9(t.stagingDir);for(let e of a){let n=$9(t.stagingDir,e);i.addFile(e,n)}i.end();let o=h(n);return i.outputStream.pipe(o),await new Promise((e,t)=>{o.on(`close`,e),o.on(`error`,t),i.outputStream.on(`error`,t)}),n}function Ywe(e,t){let n=N(e,`.ok`,`config.yml`);if(g(n))try{let t=(0,Jt.parse)(S(n,`utf-8`)),r=F7(t)?t.content:void 0,i=F7(r)?r.dir:void 0;if(typeof i==`string`&&i.length>0)return ve(e,i)}catch(e){t?.warn({configPath:n,err:e},`bug-report: failed to read .ok/config.yml; falling back to project root as content dir`)}return ve(e)}async function Xwe(e,t,n,r){let i=d9(t,e.logger),a=await qwe({contentDir:Ywe(t,e.logger),projectDir:t,redact:e.redact,scrubSecrets:e.redact,note:e.note,extraFiles:e.extraFiles,userLogFiles:[...KCe(i,e.userLogsDir??N(O(),`.ok`,`logs`)),...p9(e.cachesDir??N(O(),`Library`,`Caches`))],deps:{readDesktopEnv:n,readLanguage:r,logger:e.logger}});try{v(pe(e.outputPath),{recursive:!0}),await Jwe({collected:a,outputPath:e.outputPath});let t=a.manifest.redaction.secretScrub;return{zipPath:e.outputPath,summary:{level:`full`,systemWide:!1,projectSlug:i,files:a.manifest.files.map(e=>e.path),redactions:t?.redactions??[],redactedLineCount:t?.redactedLineCount??0,generatedAt:a.manifest.createdAt}}}finally{a.cleanup()}}async function Zwe(e){let{projectDir:t}=e,n=e.readDesktopEnv??W9,r=e.readLanguage??E9;if(e.level===`full`&&t!==void 0)return Xwe(e,t,n,r);let{zipPath:i,summary:a}=await XCe({projectDir:t,redact:e.redact,outputPath:e.outputPath,userLogsDir:e.userLogsDir,shipItLogFiles:p9(e.cachesDir??N(O(),`Library`,`Caches`)),logger:e.logger,note:e.note,extraFiles:e.extraFiles,desktop:n(),language:r()});return{zipPath:i,summary:{level:e.level,systemWide:t===void 0,projectSlug:a.projectSlug,files:a.files,redactions:a.redactions,redactedLineCount:a.redactedLineCount,generatedAt:a.generatedAt}}}export{V5 as ALL_EDITOR_IDS,H5 as EDITOR_LABELS,c7 as EDITOR_TARGETS,nSe as HOSTS_WITH_USER_SKILL_DIR,LCe as LAUNCH_CONFIG_NAME,dwe as PATH_SHIM_BEGIN,pwe as PATH_SHIM_BLOCK_RE,fwe as PATH_SHIM_END,yCe as addOkPathsToGitExclude,D7 as assertProjectPathSafe,Z5 as buildManagedServerEntry,nwe as buildMcpConfigDeclineEvent,rwe as buildMcpConfigMigrateEvent,l9 as classifyExistingMcpEntry,Zwe as collectReportBundle,Qt as createTokenStore,UCe as defaultBugReportZipPath,Be as detectGh,VCe as detectInstalledEditors,gSe as editorConfigPathDisplay,hSe as editorEntryLocator,W7 as formatTrackedRemediation,SCe as getExcludedOkPaths,H7 as getOkArtifactPaths,Y5 as isEntryUpToDate,Q5 as isOwnManagedEntry,cwe as loadConfig,pee as makeLazyProbeTokenStore,u9 as okBugReportsDir,S9 as parseGitHubBlobUrl,lwe as parseGitHubShareUrl,C9 as parseGitHubTreeUrl,x9 as parseGitUrl,mwe as pathInstallMarkerPath,XSe as previewContent,HCe as probeOwnManagedEditorMcpEntry,U7 as probeTrackedOkPaths,s9 as readExistingMcpEntry,xCe as readSharingMode,CCe as readSkillsShared,wo as redactContent,bCe as removeOkPathsFromGitExclude,QCe as removeOwnMcpEntry,cCe as removeProjectSkill,gwe as removeUserGlobalSkillBundle,iCe as resolveProjectRoot,owe as runStop,wCe as setSkillsShared,v9 as truncatePriorEntry,T9 as userGlobalSkillBundleTargets,uwe as validateLocalFolderForShare,o9 as writeEditorMcpConfig,ywe as writeProjectAiIntegrations,A7 as writeProjectSkill,BCe as writeUserMcpConfigs};
|
|
1525
1525
|
//# sourceMappingURL=index.mjs.map
|