@inkeep/open-knowledge 0.63.0-beta.9 → 0.63.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-B-xjxuR2.mjs → acp-harness-probe-C9yPXiOM.mjs} +2 -2
- package/dist/assets/skills/packs/codebase-wiki/references/generate-and-refresh.md +2 -2
- package/dist/assets/skills/packs/knowledge-base/research/SKILL.md +1 -1
- package/dist/assets/skills/packs/okf/SKILL.md +1 -1
- package/dist/assets/skills/packs/software-lifecycle/frame-a-proposal/SKILL.md +1 -1
- package/dist/assets/skills/packs/software-lifecycle/record-a-decision/SKILL.md +2 -2
- package/dist/assets/skills/packs/software-lifecycle/write-a-postmortem/SKILL.md +1 -1
- package/dist/assets/skills/packs/software-lifecycle/write-a-spec/SKILL.md +1 -1
- package/dist/assets/skills/project/SKILL.md +1 -1
- package/dist/assets/skills/project/references/folder-model.md +1 -1
- package/dist/assets/skills/project/references/linking.md +1 -1
- package/dist/assets/skills/project/references/media-and-assets.md +4 -4
- package/dist/assets/skills/project/references/onboard-existing-repo.md +5 -5
- package/dist/cli.mjs +6 -6
- package/dist/constants-B_S0YXmJ.mjs +2 -0
- package/dist/git-handle-Bp1KC5ON.mjs +1 -0
- package/dist/{git-handle-CIYTlUEZ.mjs → git-handle-DBSBLTQr.mjs} +2 -2
- package/dist/index.mjs +161 -165
- package/dist/{init-C5X8MWLw.mjs → init-BNpnwzdF.mjs} +3 -3
- package/dist/init-C1gbuEpT.mjs +1 -0
- package/dist/{launch-json-removal-BuklIvO9.mjs → launch-json-removal-CNwlrJ7q.mjs} +2 -2
- package/dist/{loader-C0hPcI3q.mjs → loader-BmZl2oTd.mjs} +2 -2
- package/dist/loader-JeCCG8GF.mjs +1 -0
- package/dist/md-manager-YCnEcytX.mjs +2 -0
- package/dist/{open-browser-C8W8YLUr.mjs → open-browser-ycZBGuNV.mjs} +2 -2
- package/dist/parse-worker.mjs +1 -1
- package/dist/preview-DU23sPTx.mjs +1 -0
- package/dist/{preview-xW7AU3WF.mjs → preview-DyXS_jLi.mjs} +2 -2
- package/dist/public/assets/{ActivityModeContent-BTKcB4s7.js → ActivityModeContent-DKNTU3xF.js} +1 -1
- package/dist/public/assets/{AddPropertiesButton-D7HalV7U.js → AddPropertiesButton-DqpU3aSu.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-ijX5j8oV.js → AgentDiffPane-9yWEGSlA.js} +1 -1
- package/dist/public/assets/{AgentThreadClientBinder-BnFaLWWD.js → AgentThreadClientBinder-B7GHdT50.js} +1 -1
- package/dist/public/assets/{BugReportHistory-Z6vKgPlz.js → BugReportHistory-CDjs-UvS.js} +1 -1
- package/dist/public/assets/{BugReportHistoryDialog-yatep397.js → BugReportHistoryDialog-gMqpgd_4.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-Bq-GOVaY.js → CodeMirrorPropInput-BkPz1S4U.js} +3 -3
- package/dist/public/assets/{ConsentDialogBody-tSHLrPbK.js → ConsentDialogBody-BrU01-jw.js} +1 -1
- package/dist/public/assets/{DiffView-BiSpsGNT.js → DiffView-DBOYN8TZ.js} +1 -1
- package/dist/public/assets/DocumentContext-uEkPWsfu.js +38 -0
- package/dist/public/assets/{EditorModeToggle-T-DEua_N.js → EditorModeToggle-BdGWhpIY.js} +1 -1
- package/dist/public/assets/{EnableSyncConfirmDialog-L0fDVr4w.js → EnableSyncConfirmDialog-BI3oSfND.js} +1 -1
- package/dist/public/assets/{ExcalidrawDocEditor-CxqDZYJT.js → ExcalidrawDocEditor-DBz9XgPR.js} +1 -1
- package/dist/public/assets/FeedbackForm-jEEgxvE6.js +1 -0
- package/dist/public/assets/{GraphPanel-BGmJGDQa.js → GraphPanel-fAs0m1k4.js} +1 -1
- package/dist/public/assets/{ImportSkillDialog-1Cbzf9hO.js → ImportSkillDialog-DoECJCyD.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-CzrTw7-N.js → LintConfigEditor-BbQC5XBO.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-BPM5-upl.js +1 -0
- package/dist/public/assets/ManagedArtifactProperties-gZ33ParZ.js +1 -0
- package/dist/public/assets/{McpConsentDialogBody-CAzcaI7R.js → McpConsentDialogBody-BhVT9dPx.js} +1 -1
- package/dist/public/assets/{Mermaid-eWUbMYt7.js → Mermaid-NYQ6RsUB.js} +1 -1
- package/dist/public/assets/{MermaidDocEditor-9oN0JLay.js → MermaidDocEditor-BLuA0Zbi.js} +1 -1
- package/dist/public/assets/{PropertyDisplayRow-Bk3DJiht.js → PropertyDisplayRow-CQC5Z0n6.js} +1 -1
- package/dist/public/assets/{ReportBugDialogBody-CxWq0sl_.js → ReportBugDialogBody-7G3gDx90.js} +1 -1
- package/dist/public/assets/{SchemaConfigEditor-DZz98wbc.js → SchemaConfigEditor-DJdskJ7F.js} +1 -1
- package/dist/public/assets/{SessionsHost-C0SgrJWZ.js → SessionsHost-zVHqq9cr.js} +2 -2
- package/dist/public/assets/{SettingsDialogBody-DfMiN6Fz.js → SettingsDialogBody-CHR0gEF6.js} +4 -4
- package/dist/public/assets/{ShareBranchSwitchDialog-C_2lIS4H.js → ShareBranchSwitchDialog-BVSorWIl.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-DODZ9lJO.js → ShareReceiveDialog-MMs7AIMS.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-VU9jVnF2.js → ShareReceiveMissDialog-Brs6R8I6.js} +1 -1
- package/dist/public/assets/{SkillCostValue-C0wQq_rb.js → SkillCostValue-_Y5l2XwJ.js} +1 -1
- package/dist/public/assets/{SkillEditBanner-B_co3gK-.js → SkillEditBanner-D7_vEL-Q.js} +1 -1
- package/dist/public/assets/{SkillInstallMenu-dLqh_jLu.js → SkillInstallMenu-B06AbDvI.js} +1 -1
- package/dist/public/assets/{SkillOriginInline-BSVuZQmJ.js → SkillOriginInline-CPhIPMvZ.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-_B6u1D0o.js → SkillToolbarControls-D53zgCnN.js} +1 -1
- package/dist/public/assets/{SlidesToolbarControls-BWTKaM60.js → SlidesToolbarControls-BMDuGCKO.js} +1 -1
- package/dist/public/assets/{SourceEditor-CKI37mlw.js → SourceEditor--mA47noe.js} +1 -1
- package/dist/public/assets/{TerminalPanel-BPoxkeWP.js → TerminalPanel-CyBB22vO.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-D0Y7fAlx.js → TerminalWindowApp-DuCRqNRC.js} +1 -1
- package/dist/public/assets/{TextDocEditor-1tsxK98Z.js → TextDocEditor-Bll9nONn.js} +1 -1
- package/dist/public/assets/ThreadView-CZ-jRmGS.js +14 -0
- package/dist/public/assets/{TimelineDiffPane-Dd8x4PB7.js → TimelineDiffPane-BQAeLDdZ.js} +1 -1
- package/dist/public/assets/{agent-diff-store-CDsDNb32.js → agent-diff-store-BqTBnCD3.js} +1 -1
- package/dist/public/assets/{alert-dialog-AUOAbMRk.js → alert-dialog-C8E8SkhJ.js} +1 -1
- package/dist/public/assets/auth-state-cache-CFoMX9IK.js +11 -0
- package/dist/public/assets/{bug-report-send-manager-Cla-OHd1.js → bug-report-send-manager-BVeLqplu.js} +1 -1
- package/dist/public/assets/{client-version-zlMsTjr7.js → client-version-D29tmSfy.js} +1 -1
- package/dist/public/assets/{cm-theme-CGAHtEG_.js → cm-theme-CqnwWjn0.js} +1 -1
- package/dist/public/assets/comment-chips-vycRkjQG.js +5 -0
- package/dist/public/assets/{config-provider-BthPv03F.js → config-provider-Cn54Nsso.js} +3 -3
- package/dist/public/assets/{dialog-CVDWyFAg.js → dialog-BH80AfFt.js} +1 -1
- package/dist/public/assets/{dist-BcgfSGhc.js → dist--D6RzOfD.js} +1 -1
- package/dist/public/assets/{dist-JRmCQvyK2.js → dist-1N70TEoy2.js} +1 -1
- package/dist/public/assets/{dist-CIoKswYf.js → dist-CFs5UHD5.js} +1 -1
- package/dist/public/assets/{dist-DTXRiVka.js → dist-CLS9aKf7.js} +1 -1
- package/dist/public/assets/{dist-BcBK7-Dp.js → dist-CPvLRdmt.js} +1 -1
- package/dist/public/assets/{dist-Ce8QgKUj2.js → dist-D3fPY7nj2.js} +11 -11
- package/dist/public/assets/{dist-BoZByILK2.js → dist-D8CXqbDc2.js} +1 -1
- package/dist/public/assets/{dist-D-kVP57h.js → dist-DxgTfwGf.js} +1 -1
- package/dist/public/assets/{dist-Btpne29j.js → dist-awmOdYf0.js} +1 -1
- package/dist/public/assets/{dist-DlLRNnIh.js → dist-cQHiWmQq.js} +1 -1
- package/dist/public/assets/{dist-C7UyijYm.js → dist-ezYezphN.js} +1 -1
- package/dist/public/assets/{dist-DEMReymG.js → dist-tUuSMxU2.js} +1 -1
- package/dist/public/assets/{dist-ChwF_jJh.js → dist-yHiImJTb.js} +1 -1
- package/dist/public/assets/{doc-paths-Ctsm9A3g.js → doc-paths-82OyHgqG.js} +1 -1
- package/dist/public/assets/{documents-events-xbEOOZ0r.js → documents-events-DuT0NGpP.js} +1 -1
- package/dist/public/assets/field-CtUgODi9.js +1 -0
- package/dist/public/assets/{file-tree-adapter-Ls8GiCCR.js → file-tree-adapter-QHHr7v_y.js} +1 -1
- package/dist/public/assets/{file-tree-utils-B0rpFzyn.js → file-tree-utils-dEjn4DTA.js} +1 -1
- package/dist/public/assets/{folder-config-api-CU0L7tKK.js → folder-config-api-CCs-JTL1.js} +1 -1
- package/dist/public/assets/globals-CgRBo3fB.css +1 -0
- package/dist/public/assets/i18n-CrTwsN89.js +1 -0
- package/dist/public/assets/index-uWwSanPO.js +2196 -0
- package/dist/public/assets/{input-group-CG4QcWr2.js → input-group-BG4x9Co0.js} +1 -1
- package/dist/public/assets/{lint-config-client-DRimdQdD.js → lint-config-client-sUKnaDfE.js} +1 -1
- package/dist/public/assets/markdownlint-rule-browser-DoSn8IJz.js +1 -0
- package/dist/public/assets/messages-B8yzAqdX.js +1 -0
- package/dist/public/assets/messages-B_leGMuj.js +1 -0
- package/dist/public/assets/messages-BjsESsFx.js +1 -0
- package/dist/public/assets/messages-CgRQxqOr.js +1 -0
- package/dist/public/assets/messages-ClYIPasG.js +1 -0
- package/dist/public/assets/messages-DKj1XaXP.js +1 -0
- package/dist/public/assets/messages-DoiuiDAc.js +1 -0
- package/dist/public/assets/messages-WY-HJ7CG.js +1 -0
- package/dist/public/assets/messages-XTC09BUs.js +1 -0
- package/dist/public/assets/messages-rsgDLMpR.js +1 -0
- package/dist/public/assets/messages-rvWZA8Dv.js +1 -0
- package/dist/public/assets/messages-su76b0h7.js +1 -0
- package/dist/public/assets/{ok-BdLqM2Gu.js → ok-D3euoYhD.js} +1 -1
- package/dist/public/assets/{page-list-cache-QkTJWl8s.js → page-list-cache-SxA5m5if.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-kUesnzvY.js → pending-receive-nav-store-DY4RHmGg.js} +1 -1
- package/dist/public/assets/progress-Cfh7jhIR.js +9 -0
- package/dist/public/assets/{project-paths-BQEzqGA4.js → project-paths-DFtdLgxL.js} +1 -1
- package/dist/public/assets/{prop-types-DPeMJ-QC.js → prop-types-CPMCR1bB.js} +1 -1
- package/dist/public/assets/{receive-store-BA-7J_9S.js → receive-store-DXkS-6fp.js} +1 -1
- package/dist/public/assets/{selection-context-sB0L4ytB.js → selection-context-C2jhGMgO.js} +1 -1
- package/dist/public/assets/separator-BmK42_9U.js +1 -0
- package/dist/public/assets/{skill-scope-DVS0Hl6u.js → skill-scope-CSgNqFEM.js} +1 -1
- package/dist/public/assets/skills-api-Bk-f3oIn.js +1 -0
- package/dist/public/assets/{src-B2g0kIMf.js → src-COmrouI5.js} +1 -1
- package/dist/public/assets/{tag-pill-input-DMkVt_d_.js → tag-pill-input-vXWkMHt_.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-CaN3Dafh.js → target-navigation-intent-B6pF65mo.js} +1 -1
- package/dist/public/assets/{telemetry-startup-D3po15VV.js → telemetry-startup-wvejDKve.js} +1 -1
- package/dist/public/assets/{terminal-cli-display-BOx5rFUv.js → terminal-cli-display-D8ya3OyM.js} +1 -1
- package/dist/public/assets/{terminal-launch-events-CLgfK16W.js → terminal-launch-events-CEw1ZoL3.js} +1 -1
- package/dist/public/assets/{terminal-telemetry-akEbrUKt.js → terminal-telemetry-BkPbxfR9.js} +1 -1
- package/dist/public/assets/{text-viewer-languages-DiEHGSrX.js → text-viewer-languages-D1G0H8jz.js} +2 -2
- package/dist/public/assets/{typing-burst-detector-DUYhlR1q.js → typing-burst-detector-D8opQPVA.js} +3 -3
- package/dist/public/assets/{uninstall-B_W5vlkD.js → uninstall-D6ZjikLo.js} +1 -1
- package/dist/public/assets/use-activity-panel-Cob7wbER.js +1 -0
- package/dist/public/assets/{use-apply-config-color-theme-DNsKMjZ7.js → use-apply-config-color-theme-Chbv5kIz.js} +1 -1
- package/dist/public/assets/{use-collab-url-rDCxo50p.js → use-collab-url-CLES09HL.js} +1 -1
- package/dist/public/assets/{use-live-xterm-theme-C2BpqZgC.js → use-live-xterm-theme-BeGlZWUx.js} +1 -1
- package/dist/public/assets/use-open-skill-DggswBlG.js +1 -0
- package/dist/public/assets/{use-settings-route-juHfAFnp.js → use-settings-route-1RDLdzh1.js} +1 -1
- package/dist/public/assets/{use-skill-origin-nFRJyGWt.js → use-skill-origin-BPSEVtzI.js} +1 -1
- package/dist/public/assets/use-skills-X0D5g-_u.js +1 -0
- package/dist/public/assets/{use-terminal-enabled-Cq6DIDKZ.js → use-terminal-enabled-FDOP0Dht.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-C7uHbazM.js → use-timeline-entry-diff-CDYxwT8Z.js} +2 -2
- package/dist/public/assets/{use-workspace-Cq3LTz0y.js → use-workspace-BuKQ4WE6.js} +1 -1
- package/dist/public/index.html +85 -85
- package/dist/public/uninstall.html +8 -8
- package/dist/{repair-launch-json-BGM5T2SA.mjs → repair-launch-json-CzMb2Eoh.mjs} +2 -2
- package/dist/{repair-mcp-configs-B-WnALb4.mjs → repair-mcp-configs-B3YgKg85.mjs} +2 -2
- package/dist/repair-skills-DnJVC8BQ.mjs +1 -0
- package/dist/{repair-skills-B7T9ybuC.mjs → repair-skills-Dye90u_k.mjs} +2 -2
- package/dist/{resolve-project-root-BF1NyEri.mjs → resolve-project-root-Bc1ADd86.mjs} +2 -2
- package/dist/server-lock-0Z4DgFB6.mjs +1 -0
- package/dist/{server-lock-C0j1Yr_I.mjs → server-lock-DmHwX0B4.mjs} +2 -2
- package/dist/{skill-teardown-B9-HO2ID.mjs → skill-teardown-D6lPMY6n.mjs} +2 -2
- package/dist/{src-Bt6_UxL9.mjs → src-BOzh5nAU.mjs} +60 -60
- package/dist/src-BqTdx7nf.mjs +2030 -0
- package/dist/{src-DQyTLMJF.mjs → src-CzJVDa-w.mjs} +1 -1
- package/dist/{src-pWpSZzzm.mjs → src-D6Uv1iWY.mjs} +2 -2
- package/dist/src-Lw-nFXot.mjs +1 -0
- package/dist/start-CEFh4ETh.mjs +1 -0
- package/dist/{start-BXQxKUGp.mjs → start-CjVQacxz.mjs} +3 -3
- package/package.json +4 -4
- package/dist/constants-au7a_EGv.mjs +0 -2
- package/dist/git-handle-B0iwHPX9.mjs +0 -1
- package/dist/init-B1lxqXtH.mjs +0 -1
- package/dist/loader-CKif709X.mjs +0 -1
- package/dist/md-manager-N3eB5SRj.mjs +0 -2
- package/dist/preview-qVTXt2N5.mjs +0 -1
- package/dist/public/assets/DocumentContext-BALlgby5.js +0 -38
- package/dist/public/assets/FeedbackForm-BXuYBean.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-Bi-E4YRv.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-CK9B-hm2.js +0 -1
- package/dist/public/assets/ThreadView-CsLuiypa.js +0 -14
- package/dist/public/assets/auth-state-cache-DVYBlfUl.js +0 -11
- package/dist/public/assets/comment-chips-BOg_nIYo.js +0 -5
- package/dist/public/assets/field-5c9smYxo.js +0 -1
- package/dist/public/assets/globals-BClfVevn.css +0 -1
- package/dist/public/assets/i18n-BRlTyJZZ.js +0 -1
- package/dist/public/assets/index-BRw4vLZd.js +0 -2196
- package/dist/public/assets/markdownlint-rule-browser-bLNgOZDj.js +0 -1
- package/dist/public/assets/messages-BMS7FJ_d.js +0 -1
- package/dist/public/assets/messages-BRhYVkgM.js +0 -1
- package/dist/public/assets/messages-BydmSYjg.js +0 -1
- package/dist/public/assets/messages-CVWvfqyb.js +0 -1
- package/dist/public/assets/messages-Chm_fdij.js +0 -1
- package/dist/public/assets/messages-DDHuYMhL.js +0 -1
- package/dist/public/assets/messages-DHLSa100.js +0 -1
- package/dist/public/assets/messages-DL85qpw8.js +0 -1
- package/dist/public/assets/messages-DZrrLggA.js +0 -1
- package/dist/public/assets/messages-DpGwrwba.js +0 -1
- package/dist/public/assets/messages-QvU0ijSD.js +0 -1
- package/dist/public/assets/messages-eeoJTDMn.js +0 -1
- package/dist/public/assets/progress-C2DqvF0S.js +0 -9
- package/dist/public/assets/rotate-ccw-Dh7y6tzD.js +0 -1
- package/dist/public/assets/skills-api-CLHdhjYN.js +0 -1
- package/dist/public/assets/use-activity-panel-BGjPHK7b.js +0 -1
- package/dist/public/assets/use-open-skill-BQQ22AWB.js +0 -1
- package/dist/public/assets/use-skills-Dqn_Ujd2.js +0 -1
- package/dist/repair-skills-D33RJQek.mjs +0 -1
- package/dist/server-lock-CJBewXA-.mjs +0 -1
- package/dist/src-DB9Clga0.mjs +0 -1
- package/dist/src-bhsVUHJJ.mjs +0 -2038
- package/dist/start-DG3IuMZ-.mjs +0 -1
- /package/dist/public/assets/{asset-dispatch-KsnhYIM1.js → asset-dispatch-CD6rGcnF.js} +0 -0
- /package/dist/public/assets/{badge-D4OsXAAp.js → badge-DGD9B_-e.js} +0 -0
- /package/dist/public/assets/{dist-DKm6IJJD.js → dist-EbTHn-HD.js} +0 -0
- /package/dist/public/assets/{documents-fetch-UmC9duIp.js → documents-fetch-Bw4lKnRN.js} +0 -0
- /package/dist/public/assets/{external-link-B0bVg1hn.js → external-link-DGqXfQJy.js} +0 -0
- /package/dist/public/assets/{file-tree-rename-validation-B5TvPsC_.js → file-tree-rename-validation-DmGgIR2S.js} +0 -0
- /package/dist/public/assets/{globals-DZdLwnph.js → globals-4Lwslben.js} +0 -0
- /package/dist/public/assets/{input-DJ1c1x-M.js → input-Cy2M_Avq.js} +0 -0
- /package/dist/public/assets/{popover-DSqCLFbz.js → popover-DAe-_3rj.js} +0 -0
- /package/dist/public/assets/{square-pen-Blyr7NAu.js → square-pen-BlKNuUz7.js} +0 -0
- /package/dist/public/assets/{startup-marks-Cdkh8q3E.js → startup-marks-BYurBbnW.js} +0 -0
- /package/dist/public/assets/{stex-C-5D68LN.js → stex-s_JxeNEZ.js} +0 -0
- /package/dist/public/assets/{terminal-DVIah3Gz.js → terminal-CmHqE3At.js} +0 -0
- /package/dist/public/assets/{trash-2-Do7iD2Jd.js → trash-2-BVoWHmfV.js} +0 -0
- /package/dist/public/assets/{triangle-alert-CVlKiRjP.js → triangle-alert-CJVfCxE0.js} +0 -0
- /package/dist/public/assets/{undo-2-BPqljtN7.js → undo-2-CXHp9Ngg.js} +0 -0
- /package/dist/public/assets/{wrench-Bdjt-UuV.js → wrench-JX3g_hHJ.js} +0 -0
- /package/dist/public/assets/{x-DYxy1Cx_.js → x-wQUDJS55.js} +0 -0
|
@@ -538,7 +538,7 @@ Read more at https://docs.orama.com/docs/orama-js/plugins/plugin-secure-proxy#pl
|
|
|
538
538
|
`,i);if(e===-1)return null;i=e+1}let a=t.indexOf(`
|
|
539
539
|
`,i),o=a===-1?t.length:a,s=i+r-1;return s<=o?s:null}function Sie(e,t){if(!e)return null;let n=a8(e.start,t),r=a8(e.end,t);return n===null||r===null||r<n?null:t.slice(n,r)}function Cie(e,t){let n=Sie(e.position,t);return{type:`rawMdxFallbackMdast`,originalType:e.type??`unknown`,value:n??``,unresolvedPosition:n===null,position:e.position}}function wie(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``,r=typeof process<`u`&&{}?.OK_DEBUG_POSITION_SLICE===`1`;h(e,(e,t,i)=>{if(i!==void 0&&typeof t==`number`&&typeof e.type==`string`&&!xie.has(e.type)){let r=Cie(e,n);return i.children[t]=r,D}if(`children`in e&&Array.isArray(e.children)){let t=e;t.children.some(e=>e.type===`text`)&&(pie(t,n),bie(t,n))}if(hie(e,n,r,i),e.type===`heading`&&i!==void 0&&typeof t==`number`){let n=e.position?.end?.line,r=i.children[t+1],a=r?.position?.start?.line;if(r?.type===`paragraph`&&typeof n==`number`&&typeof a==`number`&&a===n+1){let t=e;t.data??={},t.data.sourceContiguousNext=!0}}})}}function Tie(e,t){let n={type:`mdxJsxFlowElement`,name:`MermaidFence`,attributes:[{type:`mdxJsxAttribute`,name:`chart`,value:e}],children:[]};return t&&(n.position=t),n}function Eie(){return e=>{h(e,`code`,(e,t,n)=>{if(!n||t==null||e.lang!==`mermaid`)return;let r=Tie(typeof e.value==`string`?e.value:``,e.position);n.children[t]=r})}}function o8(){let e=!1,t=``,n=0;return r=>{let i=Die(r);return e?(i&&i.char===t&&i.len>=n&&!i.hasInfo&&(e=!1,t=``,n=0),!0):i?(e=!0,t=i.char,n=i.len,!0):!1}}function Die(e){let t=(e.endsWith(`\r`)?e.slice(0,-1):e).match(/^ {0,3}([`~])(\1{2,})(.*)$/);return t?{char:t[1],len:1+t[2].length,hasInfo:t[3].trim()!==``}:null}function s8(e,t,n){for(let r=t;r<n;r++)e[r]=` `}function Oie(e,t){if(e[t]!==`<`)return null;let n=e.slice(t).toLowerCase();for(let r of[`pre`,`code`]){if(!n.startsWith(`<${r}`))continue;let i=e[t+r.length+1];if(i===`>`||i===`/`||i===` `||i===` `)return r}return null}function kie(e,t){let n=null;for(let r=t;r<e.length;r++){let t=e[r];if(n!==null)t===n&&(n=null);else if(t===`"`||t===`'`)n=t;else if(t===`>`)return r+1}return null}function c8(e,t,n){let r=RegExp(`</${n}\\s*>`,`i`).exec(e.slice(t));return r?.index===void 0?null:t+r.index+r[0].length}function Aie(e,t){let n=0;for(;e[t+n]==="`";)n+=1;if(n===0)return null;let r=t+n,i=r;for(;i<e.length;){if(e[i]!=="`"){i+=1;continue}let t=0;for(;e[i+t]==="`";)t+=1;if(t===n)return i+n;i+=t}return r}function jie(e){let t=o8(),n=!1,r=null;return e.map(({text:e,start:i})=>{if(r===null&&!n&&t(e))return{text:` `.repeat(e.length),start:i};let a=e.split(``),o=0;for(;o<e.length;){if(n){let t=e.indexOf(`-->`,o),r=t<0?e.length:t+3;if(s8(a,o,r),o=r,t<0)break;n=!1;continue}if(r!==null){let t=c8(e,o,r);if(s8(a,o,t??e.length),t===null)break;o=t,r=null;continue}let t=e.indexOf(`<!--`,o),i=-1,s=null;for(let t=o;t<e.length;t++){let n=Oie(e,t);if(n!==null){i=t,s=n;break}}let c=e.indexOf("`",o),l=t<0?i:i<0?t:Math.min(t,i);if(c>=0&&(l<0||c<l)){o=Aie(e,c)??c+1;continue}if(t<0&&i<0)break;if(t>=0&&(i<0||t<i)){let r=e.indexOf(`-->`,t+4),i=r<0?e.length:r+3;if(s8(a,t,i),o=i,n=r<0,n)break;continue}let u=kie(e,i);if(u===null||s===null)break;let d=c8(e,u,s),f=d??e.length;if(s8(a,i,f),o=f,r=d===null?s:null,r!==null)break}return{text:a.join(``),start:i}})}function Mie(e){let t=[],n=0;for(let r=0;r<e.length;r++){let i=e[r];i===`
|
|
540
540
|
`?(t.push({text:e.slice(n,r),start:n}),n=r+1):i===`\r`&&(t.push({text:e.slice(n,r),start:n}),e[r+1]===`
|
|
541
|
-
`&&(r+=1),n=r+1)}t.push({text:e.slice(n),start:n});let r=jie(t),i=e.split(``);for(let e of r)for(let t=0;t<e.text.length;t++)i[e.start+t]=e.text[t];return i.join(``)}function Nie(e,t,n,r){return r<=n||e.slice(n,r).trim().length===0?!1:t.slice(n,r).trim().length===0}function Pie(e){return e.type===`link`||e.type===`linkReference`}function Fie(e,t,n,r){let i=n.position?.start.offset,a=n.position?.end.offset;if(i===void 0||a===void 0)return;let o=r.slice(i,a),s={type:`text`,value:o,data:{sourceRaw:o},position:n.position};e.children.splice(t,1,s)}function Iie(){return(e,t)=>{let n=typeof t.value==`string`?t.value:String(t.value??``);if(n.length===0||!n.includes(`<!--`)&&!/<(pre|code)[\s/>]/i.test(n))return;let r=Mie(n),i=e=>{for(let t=e.children.length-1;t>=0;t--){let a=e.children[t];if(!a||(`children`in a&&Array.isArray(a.children)&&i(a),!Pie(a)))continue;let o=a.position?.start.offset,s=a.position?.end.offset;o===void 0||s===void 0||Nie(n,r,o,s)&&Fie(e,t,a,n)}};i(e)}}function l8(e){return e.data?.sourceRaw}function Lie(e){return e.type===`text`?e.value===``:e.type===`mdxJsxTextElement`?l8(e)===``:!1}function u8(e){return e.type===`paragraph`?(e.children??[]).every(Lie):!1}function d8(e){let t=e.children??[],n=t[0]?.children?.length??0,r=0;for(let e=1;e<t.length;e++)r=Math.max(r,t[e]?.children?.length??0);let i=e.align??[];return Math.max(n,r,i.length)}function Rie(e){switch(e.type){case`table`:return d8(e)===0;case`code`:return e.data?.sourceStyle===`indented`&&/^\n*$/.test(e.value??``);case`thematicBreak`:return l8(e)===``;case`html`:return(e.value??``)===``;case`mdxJsxFlowElement`:return l8(e)===void 0&&e.data?.htmlBoundary===void 0&&(e.children??[]).length===0&&!e.name;case`list`:return(e.children??[]).length===0;default:return!1}}function zie(e){let t=[];for(let n of e.children){if(n.type===`table`&&d8(n)===0){console.warn(JSON.stringify({event:`table-serialize-dropped-empty`,rows:(n.children??[]).length}));continue}Rie(n)||(n.type===`paragraph`&&n.children.length>0&&u8(n)&&(n.children=[]),t.push(n))}e.children=t}function Bie(e,t){let n=e,r=t;return n.type===`heading`&&n.data?.sourceContiguousNext===!0&&r.type===`paragraph`}var Vie=(e,t)=>{if(u8(e)||Bie(e,t))return 0;let n=e.position,r=t.position;if(!n||!r)return;let i=r.start.line-n.end.line-1;return i>=1?i:void 0},f8=mI(),p8=NF(),m8=PF();function h8(){let e=this.data();e.micromarkExtensions||=[],e.fromMarkdownExtensions||=[],e.toMarkdownExtensions||=[];let t=e.micromarkExtensions;t.some(e=>e===f8)||t.push(f8);let n=e.fromMarkdownExtensions;n.some(e=>e===p8)||n.push(p8);let r=e.toMarkdownExtensions;r.some(e=>e===m8)||r.push(m8)}var g8=/(?<!\\)\$(?=\S)([^$\n]*?[^\s$])\$(?!\d)/g;function Hie(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;h(e,`text`,(e,t,r)=>{if(r===void 0||t==null)return;let i=e.value;if(i.indexOf(`$`)===-1)return;let a=U3(n,e);g8.lastIndex=0;let o=[],s;for(;(s=g8.exec(i))!==null;){let e=s.index,t=e+s[0].length;if(W3(a,e,1)||W3(a,t-1,1)){g8.lastIndex=e+1;continue}o.push(s)}if(o.length===0)return;let c=[],l=0;for(let t of o){let r=t.index,a=r+t[0].length;if(r>l){let t={type:`text`,value:i.slice(l,r)},a=q3(n,e,l,r);a&&(t.position=a),c.push(t)}let o={type:`inlineMath`,value:t[1]},s=q3(n,e,r,a);s&&(o.position=s),c.push(o),l=a}if(l<i.length){let t={type:`text`,value:i.slice(l)},r=q3(n,e,l,i.length);r&&(t.position=r),c.push(t)}return r.children.splice(t,1,...c),[D,t+c.length]})}}var Uie=new Set([`strong`,`emphasis`,`delete`,`link`,`mark`,`comment`]),Wie=`<br />`;function Gie(e){if(!e||e.type!==`break`)return!1;let t=e.data?.sourceRaw;return typeof t!=`string`||t.length===0}function Kie(e){e.data??={},e.data.sourceRaw=Wie,e.data.sourceStyle=`html`}function _8(e){if(!e||e.type!==`text`)return!1;let t=e.data?.sourceRaw;return typeof t!=`string`||t.length===0}var v8=/[ \t]+$/,y8=/^[ \t]*$/;function qie(e){return e.some(e=>!(_8(e)&&y8.test(e.value)))}function b8(e,t=!1){for(;e.length>0;){let n=e[e.length-1];if(Gie(n)){Kie(n);break}if(n&&Uie.has(n.type)&&`children`in n){let t=n.children;if(b8(t,!0),t.length===0){e.pop();continue}}if(!t&&_8(n)&&v8.test(n.value)){let t=n.value.replace(v8,``);if(t.length>0){n.value=t;continue}if(qie(e.slice(0,-1))){e.pop();continue}if(e.every(e=>_8(e)&&y8.test(e.value))){let t=e[0];t.value=t.value.charAt(0),e.splice(1)}}break}}var Jie=new Set([`paragraph`,`heading`,`tableCell`]);function Yie(e){let t=e=>{if(Jie.has(e.type)&&`children`in e&&b8(e.children),`children`in e)for(let n of e.children)t(n)};t(e)}var x8={handlers:{tag:e=>`#${e.value}`},unsafe:[{character:`#`,inConstruct:[`phrasing`],before:`\\s`,after:`[a-zA-Z]`}]};function Xie(){let e=this.data();e.toMarkdownExtensions||=[],e.toMarkdownExtensions.some(e=>e===x8)||e.toMarkdownExtensions.push(x8)}var Zie=new Set([`u`,`ins`]);function Qie(){return e=>{h(e,`mdxJsxTextElement`,(e,t,n)=>{if(n===void 0||t==null||e.name===null||!Zie.has(e.name)||(e.attributes??[]).length>0)return;let r={type:`underline`,children:e.children??[],data:{sourceForm:e.name===`ins`?`ins`:`u`}};return e.position&&(r.position=e.position),n.children.splice(t,1,r),t+1})}}var S8=/(?<!\uE102)<br[ \t]*\/?>/g,$ie=new Set([`mdxJsxTextElement`,`mdxJsxFlowElement`]);function eae(e,t){let n=[],r=!1;for(let i of e.children){if(i.type!==`text`){n.push(i);continue}let e=i.value;S8.lastIndex=0;let a=[],o=0;for(;;){let n=S8.exec(e);if(n===null)break;let s=n.index;if(s>o){let n={type:`text`,value:e.slice(o,s)},r=q3(t,i,o,s);r&&(n.position=r),a.push(n)}let c={type:`break`,data:{sourceStyle:`html`,sourceRaw:n[0]}},l=q3(t,i,s,s+n[0].length);l&&(c.position=l),a.push(c),o=s+n[0].length,r=!0}if(a.length===0)n.push(i);else{if(o<e.length){let n={type:`text`,value:e.slice(o)},r=q3(t,i,o,e.length);r&&(n.position=r),a.push(n)}n.push(...a)}}r&&(e.children=n)}function C8(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;h(e,e=>{if($ie.has(e.type))return D;let t=e;Array.isArray(t.children)&&eae(e,n)})}}var w8=33,T8=91,E8=93,D8=124,O8=35,tae={name:`wikiLink`,tokenize:(e,t,n)=>{let r=0,i=0,a=0;return o;function o(t){return t===T8?(e.enter(`wikiLink`),e.enter(`wikiLinkMarker`),e.consume(t),s):n(t)}function s(t){return t===T8?(e.consume(t),e.exit(`wikiLinkMarker`),e.enter(`wikiLinkTarget`),c):n(t)}function c(t){return t===null||t===-5||t===-4||t===-3||t===T8?n(t):t===E8?r===0?n(t):(e.exit(`wikiLinkTarget`),d(t)):t===O8?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAnchor`),l):t===D8?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),u):(e.consume(t),r++,c)}function l(t){return t===null||t===-5||t===-4||t===-3||t===T8?n(t):t===E8?i===0?n(t):(e.exit(`wikiLinkAnchor`),d(t)):t===D8?i===0?n(t):(e.exit(`wikiLinkAnchor`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),u):(e.consume(t),i++,l)}function u(t){return t===null||t===-5||t===-4||t===-3||t===T8?n(t):t===E8?a===0?n(t):(e.exit(`wikiLinkAlias`),d(t)):(e.consume(t),a++,u)}function d(t){return t===E8?(e.enter(`wikiLinkMarker`),e.consume(t),f):n(t)}function f(r){return r===E8?(e.consume(r),e.exit(`wikiLinkMarker`),e.exit(`wikiLink`),t):n(r)}}},nae={name:`wikiLinkEmbed`,tokenize:(e,t,n)=>{let r=0,i=0,a=0;return o;function o(t){return t===w8?(e.enter(`wikiLinkEmbed`),e.enter(`wikiLinkEmbedBang`),e.consume(t),e.exit(`wikiLinkEmbedBang`),s):n(t)}function s(t){return t===T8?(e.enter(`wikiLinkMarker`),e.consume(t),c):n(t)}function c(t){return t===T8?(e.consume(t),e.exit(`wikiLinkMarker`),e.enter(`wikiLinkTarget`),l):n(t)}function l(t){return t===null||t===-5||t===-4||t===-3||t===T8?n(t):t===E8?r===0?n(t):(e.exit(`wikiLinkTarget`),f(t)):t===O8?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAnchor`),u):t===D8?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),d):(e.consume(t),r++,l)}function u(t){return t===null||t===-5||t===-4||t===-3||t===T8?n(t):t===E8?i===0?n(t):(e.exit(`wikiLinkAnchor`),f(t)):t===D8?i===0?n(t):(e.exit(`wikiLinkAnchor`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),d):(e.consume(t),i++,u)}function d(t){return t===null||t===-5||t===-4||t===-3||t===T8?n(t):t===E8?a===0?n(t):(e.exit(`wikiLinkAlias`),f(t)):(e.consume(t),a++,d)}function f(t){return t===E8?(e.enter(`wikiLinkMarker`),e.consume(t),p):n(t)}function p(r){return r===E8?(e.consume(r),e.exit(`wikiLinkMarker`),e.exit(`wikiLinkEmbed`),t):n(r)}}};function rae(){return{text:{[T8]:tae,[w8]:nae}}}function iae(e){this.enter({type:`wikiLink`,value:``,data:{target:``,anchor:null,alias:null},children:[]},e)}function aae(e){this.enter({type:`wikiLinkEmbed`,value:``,data:{target:``,anchor:null,alias:null},children:[]},e)}function k8(e){return e.stack[e.stack.length-1]}function oae(e){let t=k8(this),n=this.sliceSerialize(e);t.data.target=n.trim(),n!==t.data.target&&(t.data.sourceTarget=n)}function sae(e){let t=k8(this),n=this.sliceSerialize(e),r=n.trim();t.data.anchor=r.length?r:null,t.data.anchor!==null&&n!==r&&(t.data.sourceAnchor=n)}function cae(e){let t=k8(this),n=this.sliceSerialize(e),r=n.trim();t.data.alias=r.length?r:null,t.data.alias!==null&&n!==r&&(t.data.sourceAlias=n)}function A8(e){let{target:t,anchor:n,alias:r}=e.data,i=r||(n?`${t}#${n}`:t);e.value=i,e.children=[{type:`text`,value:i}]}function lae(e){A8(k8(this)),this.exit(e)}function uae(e){A8(k8(this)),this.exit(e)}var j8={enter:{wikiLink:iae,wikiLinkEmbed:aae},exit:{wikiLinkTarget:oae,wikiLinkAnchor:sae,wikiLinkAlias:cae,wikiLink:lae,wikiLinkEmbed:uae}};function M8(e,t){return typeof e==`string`&&e.trim()===t?e:t}var N8={handlers:{wikiLink:e=>{let t=e,n=t.data?.target??``,r=t.data?.anchor,i=t.data?.alias,a=`[[${M8(t.data?.sourceTarget,n)}`;return r&&(a+=`#${M8(t.data?.sourceAnchor,r)}`),i&&(a+=`|${M8(t.data?.sourceAlias,i)}`),`${a}]]`},wikiLinkEmbed:e=>{let t=e,n=t.data?.target??``,r=t.data?.anchor,i=t.data?.alias,a=`![[${n}`;return r&&(a+=`#${r}`),i&&(a+=`|${i}`),`${a}]]`}},unsafe:[{character:`[`,inConstruct:[`phrasing`]}]},P8=rae();function F8(){let e=this.data();e.micromarkExtensions||=[],e.micromarkExtensions.some(e=>e===P8)||e.micromarkExtensions.push(P8),e.fromMarkdownExtensions||=[],e.fromMarkdownExtensions.some(e=>e===j8)||e.fromMarkdownExtensions.push(j8),e.toMarkdownExtensions||=[],e.toMarkdownExtensions.some(e=>e===N8)||e.toMarkdownExtensions.push(N8)}function dae(e){return e.children.some(e=>{let t=e.type;return t!==`yaml`&&t!==`toml`})?e:{...e,children:[...e.children,{type:`paragraph`,children:[]}]}}var fae=[{name:`remark-parse`,plugin:ie},{name:`remark-mdx-agnostic`,plugin:h8},{name:`remark-gfm`,plugin:O},{name:`remark-math`,plugin:rF,options:{singleDollarTextMath:!1}},{name:`remark-wiki-link`,plugin:F8},{name:`remark-github-alerts`,plugin:GP,options:z3},{name:`callout-transformer`,plugin:L3},{name:`restore-from-mdx`,plugin:u3},{name:`void-br-promoter`,plugin:C8},{name:`restore-entity-refs`,plugin:x3},{name:`restore-backslash-escapes`,plugin:T3},{name:`details-accordion-promoter`,plugin:S6},{name:`div-align-promoter`,plugin:j6},{name:`image-promoter`,plugin:q6},{name:`indented-code-promoter`,plugin:iie},{name:`math-promoter`,plugin:fie},{name:`single-dollar-math-promoter`,plugin:Hie},{name:`highlight-promoter`,plugin:K6},{name:`underline-promoter`,plugin:Qie},{name:`mermaid-promoter`,plugin:Eie},{name:`comment-promoter`,plugin:X3},{name:`merged-post-parse-walker`,plugin:wie},{name:`empty-task-item-unmint`,plugin:R6},{name:`link-reference-destination`,plugin:die},{name:`non-rendering-context-demote`,plugin:Iie},{name:`ensure-non-empty-doc`,plugin:()=>dae}];function pae(e){let t=Se();for(let e of fae)t=`options`in e&&e.options!==void 0?t.use(e.plugin,e.options):t.use(e.plugin);return t=t.use(gP,{schema:e.schema,handlers:e.handlers}),t.freeze(),t}function mae(e){let t=Se().use(VP,[`yaml`]).use(O,{tablePipeAlign:!1}).use(rF,{singleDollarTextMath:!1}).use(h8).use(F8).use(Xie).use(rP,{bullet:`-`,fences:!0,rule:`-`,join:[Vie],...e.toMarkdownHandlers?{handlers:e.toMarkdownHandlers}:{}});return t.freeze(),t}function I8(e){return e.charCodeAt(0)===65279?{source:e.slice(1),hadBom:!0}:{source:e,hadBom:!1}}var L8=/^\n+$/,R8=/^\n{2,}$/;function z8(e,t,n){let r,i,a=e.children;if(a.length>0){let e=a[0]?.position?.start?.offset;if(typeof e==`number`&&e>0){let n=t.slice(0,e);L8.test(n)&&(r=n)}let n=a[a.length-1]?.position?.end?.offset;if(typeof n==`number`&&n<=t.length){let e=t.slice(n);R8.test(e)&&(i=e)}}if(!n&&r===void 0&&i===void 0)return;let o={...n?{bom:!0}:{},...r===void 0?{}:{leading:r},...i===void 0?{}:{trailing:i}};return e.data??={},e.data.sourceDocBoundary=o,o}function hae(e){if(typeof e!=`object`||!e)return;let t=e,n={};return t.bom===!0&&(n.bom=!0),typeof t.leading==`string`&&L8.test(t.leading)&&(n.leading=t.leading),typeof t.trailing==`string`&&R8.test(t.trailing)&&(n.trailing=t.trailing),n.bom||n.leading||n.trailing?n:void 0}function gae(e,t){let{source:n,hadBom:r}=I8(e),i=d6(n),a=new _(v3(c3(w3(i)))),o=t.parse(a);a.value=i;let s=t.runSync(o,a);Q6(s,i);let c=z8(s,i,r),l=c?_1(s,c):void 0,u=t.stringify(s);return l?u.type.create({...u.attrs,sourceDocBoundary:l},u.content,u.marks):u}function _ae(e,t){return B8(e,t,!1)}function vae(e,t){return B8(e,t,!0)}function B8(e,t,n){let{source:r,hadBom:i}=I8(e),a=d6(r),o=new _(v3(c3(w3(a)))),s=t.parse(o);o.value=a;let c=t.runSync(s,o);n&&Q6(c,a);let l=z8(c,a,i);return n&&l&&_1(c,l),c}function yae(e,t,n){let r=vP(e,{schema:n.schema,nodeHandlers:n.pmNodeHandlers,markHandlers:n.pmMarkHandlers});I6(r),Yie(r),zie(r);let i=hae(e.attrs?.sourceDocBoundary),a=String(t.stringify(r));return i?.leading&&(a=i.leading+a),i?.trailing&&(a=a.replace(/\n+$/,``)+i.trailing),i?.bom&&(a=`\uFEFF${a}`),a}function bae(){return!1}function xae(e){let t=e.lastIndexOf(`/`);return t===-1?``:t===0?`/`:e.slice(0,t)}function Sae(e,t){let n=e?`${e}/${t}`:t,r=n.startsWith(`/`),i=[];for(let e of n.split(`/`))if(!(e===``||e===`.`)){if(e===`..`){let e=i[i.length-1];i.length>0&&e!==`..`?i.pop():r||i.push(`..`);continue}i.push(e)}let a=i.join(`/`);return r?`/${a}`:a}function V8(e,t){if(typeof e!=`string`||e===``||!t||e.startsWith(`/`)||!gZ(e))return e;let n=Sae(xae(t),e);return n===``||n===`..`||n.startsWith(`../`)?(bae()&&console.warn(`[resolve-image-url] doc-relative path escapes contentDir; emitting raw URL: ${e} (from sourcePath ${t})`),e):`/${n}`}var Cae=Object.assign(zae,{peek:()=>`$`}),wae=Object.assign(Bae,{peek:()=>`~`}),Tae=(()=>{for(let e of m8.extensions??[]){let t=e?.handlers?.mdxJsxFlowElement;if(typeof t==`function`)return t}throw Error(`mdast-util-mdx-jsx mdxJsxFlowElement to-markdown handler not found — the dirty MDX JSX serialize path cannot bind. Likely a breaking change in mdast-util-mdx-jsx (pinned in the root overrides); re-run the markdown-pipeline upgrade protocol (test:fidelity).`)})(),Eae=/^[ \t]*(?:$|#{1,6}(?:[ \t]|[ \t]*$)|>|(?:[-+*]|\d{1,9}[.)])[ \t]|`{3,}|~{3,}|=+[ \t]*$|-+[ \t]*$|(?:\*[ \t]*){3,}$|(?:_[ \t]*){3,}$)/;function Dae(e){let t=e;return t.type===`rawMdxFallback`?{type:`mdxJsxFlowElement`,name:null,attributes:[],children:[],data:{sourceRaw:t.value??``}}:e}var Oae={text(e,t,n,r){if(typeof e.data?.sourceRaw==`string`&&KZ(e.data.sourceRaw,e.value??``))return e.data.sourceRaw;if(e.data?.escapedChars?.length){let t=e.value??``,i=e.data.escapedChars,a=``,o=0;for(let{offset:e,char:s}of i)e>o&&(a+=q8(n,t.slice(o,e),{...r,before:r.before+a,after:`\\`})),a+=`\\${s}`,o=e+1;return o<t.length&&(a+=q8(n,t.slice(o),{...r,before:r.before+a})),a}return q8(n,e.value??``,r)},emphasis(e,t,n,r){let i=e.data?.sourceDelimiter??`*`,a=n.createTracker(r),o=n.enter(`emphasis`),s=a.move(i);return s+=Z8(n.containerPhrasing(e,{before:s,after:i,...a.current()}),r,i),s+=a.move(i),o(),s},strong(e,t,n,r){let i=e.data?.sourceDelimiter??`**`,a=n.createTracker(r),o=n.enter(`strong`),s=a.move(i);return s+=Z8(n.containerPhrasing(e,{before:s,after:i,...a.current()}),r,i),s+=a.move(i),o(),s},link(e,t,n,r){if(e.data?.sourceStyle===`autolink`)return`<${e.url??``}>`;if(e.data?.sourceStyle===`gfm-autolink`){let t=e.children?.length===1?e.children[0]:null;if(t?.type===`text`&&typeof t.value==`string`)return t.value}let i=n.createTracker(r),a=n.enter(`link`),o=n.enter(`label`),s=i.move(`[`);s+=i.move(n.containerPhrasing(e,{before:s,after:`](`,...i.current()})),s+=i.move(`](`),o();let c=n.enter(`destinationRaw`),l=String(e.url??``),u=e.data?.sourceUrlForm===`angle-bracketed`,d=l.startsWith(`<`)&&l.endsWith(`>`),f=u&&!d?`<${l}>`:G8(l);if(s+=i.move(f),c(),e.title){let t=e.data?.sourceTitleMarker??`double`;s+=i.move(W8(e.title,t))}return s+=i.move(`)`),a(),s},image(e,t,n,r){let i=n.createTracker(r),a=n.enter(`image`),o=n.enter(`label`),s=i.move(`})),s+=i.move(`](`),o();let c=n.enter(`destinationRaw`);if(s+=i.move(G8(String(e.url??``))),c(),e.title){let t=n.enter(`titleQuote`);s+=i.move(` "`),s+=i.move(n.safe(e.title,{before:s,after:`"`,...i.current()})),s+=i.move(`"`),t()}return s+=i.move(`)`),a(),s},definition(e,t,n,r){let i=e.data?.sourceLayout??`inline`,a=e.data?.sourceTitleMarker??`double`,o=n.enter(`definition`),s=n.createTracker(r),c=n.enter(`label`),l=s.move(`[`);l+=s.move(n.safe(n.associationId(e),{before:l,after:`]`,...s.current()})),l+=s.move(`]:`),c();let u=i===`multiline`?`
|
|
541
|
+
`&&(r+=1),n=r+1)}t.push({text:e.slice(n),start:n});let r=jie(t),i=e.split(``);for(let e of r)for(let t=0;t<e.text.length;t++)i[e.start+t]=e.text[t];return i.join(``)}function Nie(e,t,n,r){return r<=n||e.slice(n,r).trim().length===0?!1:t.slice(n,r).trim().length===0}function Pie(e){return e.type===`link`||e.type===`linkReference`}function Fie(e,t,n,r){let i=n.position?.start.offset,a=n.position?.end.offset;if(i===void 0||a===void 0)return;let o=r.slice(i,a),s={type:`text`,value:o,data:{sourceRaw:o},position:n.position};e.children.splice(t,1,s)}function Iie(){return(e,t)=>{let n=typeof t.value==`string`?t.value:String(t.value??``);if(n.length===0||!n.includes(`<!--`)&&!/<(pre|code)[\s/>]/i.test(n))return;let r=Mie(n),i=e=>{for(let t=e.children.length-1;t>=0;t--){let a=e.children[t];if(!a||(`children`in a&&Array.isArray(a.children)&&i(a),!Pie(a)))continue;let o=a.position?.start.offset,s=a.position?.end.offset;o===void 0||s===void 0||Nie(n,r,o,s)&&Fie(e,t,a,n)}};i(e)}}function l8(e){return e.data?.sourceRaw}function Lie(e){return e.type===`text`?e.value===``:e.type===`mdxJsxTextElement`?l8(e)===``:!1}function u8(e){return e.type===`paragraph`?(e.children??[]).every(Lie):!1}function d8(e){let t=e.children??[],n=t[0]?.children?.length??0,r=0;for(let e=1;e<t.length;e++)r=Math.max(r,t[e]?.children?.length??0);let i=e.align??[];return Math.max(n,r,i.length)}function Rie(e){switch(e.type){case`table`:return d8(e)===0;case`code`:return e.data?.sourceStyle===`indented`&&/^\n*$/.test(e.value??``);case`thematicBreak`:return l8(e)===``;case`html`:return(e.value??``)===``;case`mdxJsxFlowElement`:return l8(e)===void 0&&e.data?.htmlBoundary===void 0&&(e.children??[]).length===0&&!e.name;case`list`:return(e.children??[]).length===0;default:return!1}}function zie(e){let t=[];for(let n of e.children){if(n.type===`table`&&d8(n)===0){console.warn(JSON.stringify({event:`table-serialize-dropped-empty`,rows:(n.children??[]).length}));continue}Rie(n)||(n.type===`paragraph`&&n.children.length>0&&u8(n)&&(n.children=[]),t.push(n))}e.children=t}function Bie(e,t){let n=e,r=t;return n.type===`heading`&&n.data?.sourceContiguousNext===!0&&r.type===`paragraph`}var Vie=(e,t)=>{if(u8(e)||Bie(e,t))return 0;let n=e.position,r=t.position;if(!n||!r)return;let i=r.start.line-n.end.line-1;return i>=1?i:void 0},f8=mI(),p8=NF(),m8=PF();function h8(){let e=this.data();e.micromarkExtensions||=[],e.fromMarkdownExtensions||=[],e.toMarkdownExtensions||=[];let t=e.micromarkExtensions;t.some(e=>e===f8)||t.push(f8);let n=e.fromMarkdownExtensions;n.some(e=>e===p8)||n.push(p8);let r=e.toMarkdownExtensions;r.some(e=>e===m8)||r.push(m8)}var g8=/(?<!\\)\$(?=\S)([^$\n]*?[^\s$])\$(?!\d)/g;function Hie(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;h(e,`text`,(e,t,r)=>{if(r===void 0||t==null)return;let i=e.value;if(i.indexOf(`$`)===-1)return;let a=U3(n,e);g8.lastIndex=0;let o=[],s;for(;(s=g8.exec(i))!==null;){let e=s.index,t=e+s[0].length;if(W3(a,e,1)||W3(a,t-1,1)){g8.lastIndex=e+1;continue}o.push(s)}if(o.length===0)return;let c=[],l=0;for(let t of o){let r=t.index,a=r+t[0].length;if(r>l){let t={type:`text`,value:i.slice(l,r)},a=q3(n,e,l,r);a&&(t.position=a),c.push(t)}let o={type:`inlineMath`,value:t[1]},s=q3(n,e,r,a);s&&(o.position=s),c.push(o),l=a}if(l<i.length){let t={type:`text`,value:i.slice(l)},r=q3(n,e,l,i.length);r&&(t.position=r),c.push(t)}return r.children.splice(t,1,...c),[D,t+c.length]})}}var Uie=new Set([`strong`,`emphasis`,`delete`,`link`,`mark`,`comment`]),Wie=`<br />`;function Gie(e){if(!e||e.type!==`break`)return!1;let t=e.data?.sourceRaw;return typeof t!=`string`||t.length===0}function Kie(e){e.data??={},e.data.sourceRaw=Wie,e.data.sourceStyle=`html`}function _8(e){if(!e||e.type!==`text`)return!1;let t=e.data?.sourceRaw;return typeof t!=`string`||t.length===0}var v8=/[ \t]+$/,y8=/^[ \t]*$/;function qie(e){return e.some(e=>!(_8(e)&&y8.test(e.value)))}function b8(e,t=!1){for(;e.length>0;){let n=e[e.length-1];if(Gie(n)){Kie(n);break}if(n&&Uie.has(n.type)&&`children`in n){let t=n.children;if(b8(t,!0),t.length===0){e.pop();continue}}if(!t&&_8(n)&&v8.test(n.value)){let t=n.value.replace(v8,``);if(t.length>0){n.value=t;continue}if(qie(e.slice(0,-1))){e.pop();continue}if(e.every(e=>_8(e)&&y8.test(e.value))){let t=e[0];t.value=t.value.charAt(0),e.splice(1)}}break}}var Jie=new Set([`paragraph`,`heading`,`tableCell`]);function Yie(e){let t=e=>{if(Jie.has(e.type)&&`children`in e&&b8(e.children),`children`in e)for(let n of e.children)t(n)};t(e)}var x8={handlers:{tag:e=>`#${e.value}`},unsafe:[{character:`#`,inConstruct:[`phrasing`],before:`\\s`,after:`[a-zA-Z]`}]};function Xie(){let e=this.data();e.toMarkdownExtensions||=[],e.toMarkdownExtensions.some(e=>e===x8)||e.toMarkdownExtensions.push(x8)}var Zie=new Set([`u`,`ins`]);function Qie(){return e=>{h(e,`mdxJsxTextElement`,(e,t,n)=>{if(n===void 0||t==null||e.name===null||!Zie.has(e.name)||(e.attributes??[]).length>0)return;let r={type:`underline`,children:e.children??[],data:{sourceForm:e.name===`ins`?`ins`:`u`}};return e.position&&(r.position=e.position),n.children.splice(t,1,r),t+1})}}var S8=/(?<!\uE102)<br[ \t]*\/?>/g,$ie=new Set([`mdxJsxTextElement`,`mdxJsxFlowElement`]);function eae(e,t){let n=[],r=!1;for(let i of e.children){if(i.type!==`text`){n.push(i);continue}let e=i.value;S8.lastIndex=0;let a=[],o=0;for(;;){let n=S8.exec(e);if(n===null)break;let s=n.index;if(s>o){let n={type:`text`,value:e.slice(o,s)},r=q3(t,i,o,s);r&&(n.position=r),a.push(n)}let c={type:`break`,data:{sourceStyle:`html`,sourceRaw:n[0]}},l=q3(t,i,s,s+n[0].length);l&&(c.position=l),a.push(c),o=s+n[0].length,r=!0}if(a.length===0)n.push(i);else{if(o<e.length){let n={type:`text`,value:e.slice(o)},r=q3(t,i,o,e.length);r&&(n.position=r),a.push(n)}n.push(...a)}}r&&(e.children=n)}function C8(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;h(e,e=>{if($ie.has(e.type))return D;let t=e;Array.isArray(t.children)&&eae(e,n)})}}var w8=33,T8=91,E8=93,D8=124,O8=35,tae={name:`wikiLink`,tokenize:(e,t,n)=>{let r=0,i=0,a=0;return o;function o(t){return t===T8?(e.enter(`wikiLink`),e.enter(`wikiLinkMarker`),e.consume(t),s):n(t)}function s(t){return t===T8?(e.consume(t),e.exit(`wikiLinkMarker`),e.enter(`wikiLinkTarget`),c):n(t)}function c(t){return t===null||t===-5||t===-4||t===-3||t===T8?n(t):t===E8?r===0?n(t):(e.exit(`wikiLinkTarget`),d(t)):t===O8?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAnchor`),l):t===D8?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),u):(e.consume(t),r++,c)}function l(t){return t===null||t===-5||t===-4||t===-3||t===T8?n(t):t===E8?i===0?n(t):(e.exit(`wikiLinkAnchor`),d(t)):t===D8?i===0?n(t):(e.exit(`wikiLinkAnchor`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),u):(e.consume(t),i++,l)}function u(t){return t===null||t===-5||t===-4||t===-3||t===T8?n(t):t===E8?a===0?n(t):(e.exit(`wikiLinkAlias`),d(t)):(e.consume(t),a++,u)}function d(t){return t===E8?(e.enter(`wikiLinkMarker`),e.consume(t),f):n(t)}function f(r){return r===E8?(e.consume(r),e.exit(`wikiLinkMarker`),e.exit(`wikiLink`),t):n(r)}}},nae={name:`wikiLinkEmbed`,tokenize:(e,t,n)=>{let r=0,i=0,a=0;return o;function o(t){return t===w8?(e.enter(`wikiLinkEmbed`),e.enter(`wikiLinkEmbedBang`),e.consume(t),e.exit(`wikiLinkEmbedBang`),s):n(t)}function s(t){return t===T8?(e.enter(`wikiLinkMarker`),e.consume(t),c):n(t)}function c(t){return t===T8?(e.consume(t),e.exit(`wikiLinkMarker`),e.enter(`wikiLinkTarget`),l):n(t)}function l(t){return t===null||t===-5||t===-4||t===-3||t===T8?n(t):t===E8?r===0?n(t):(e.exit(`wikiLinkTarget`),f(t)):t===O8?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAnchor`),u):t===D8?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),d):(e.consume(t),r++,l)}function u(t){return t===null||t===-5||t===-4||t===-3||t===T8?n(t):t===E8?i===0?n(t):(e.exit(`wikiLinkAnchor`),f(t)):t===D8?i===0?n(t):(e.exit(`wikiLinkAnchor`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),d):(e.consume(t),i++,u)}function d(t){return t===null||t===-5||t===-4||t===-3||t===T8?n(t):t===E8?a===0?n(t):(e.exit(`wikiLinkAlias`),f(t)):(e.consume(t),a++,d)}function f(t){return t===E8?(e.enter(`wikiLinkMarker`),e.consume(t),p):n(t)}function p(r){return r===E8?(e.consume(r),e.exit(`wikiLinkMarker`),e.exit(`wikiLinkEmbed`),t):n(r)}}};function rae(){return{text:{[T8]:tae,[w8]:nae}}}function iae(e){this.enter({type:`wikiLink`,value:``,data:{target:``,anchor:null,alias:null},children:[]},e)}function aae(e){this.enter({type:`wikiLinkEmbed`,value:``,data:{target:``,anchor:null,alias:null},children:[]},e)}function k8(e){return e.stack[e.stack.length-1]}function oae(e){let t=k8(this),n=this.sliceSerialize(e);t.data.target=n.trim(),n!==t.data.target&&(t.data.sourceTarget=n)}function sae(e){let t=k8(this),n=this.sliceSerialize(e),r=n.trim();t.data.anchor=r.length?r:null,t.data.anchor!==null&&n!==r&&(t.data.sourceAnchor=n)}function cae(e){let t=k8(this),n=this.sliceSerialize(e),r=n.trim();t.data.alias=r.length?r:null,t.data.alias!==null&&n!==r&&(t.data.sourceAlias=n)}function A8(e){let{target:t,anchor:n,alias:r}=e.data,i=r||(n?`${t}#${n}`:t);e.value=i,e.children=[{type:`text`,value:i}]}function lae(e){A8(k8(this)),this.exit(e)}function uae(e){A8(k8(this)),this.exit(e)}var j8={enter:{wikiLink:iae,wikiLinkEmbed:aae},exit:{wikiLinkTarget:oae,wikiLinkAnchor:sae,wikiLinkAlias:cae,wikiLink:lae,wikiLinkEmbed:uae}};function M8(e,t){return typeof e==`string`&&e.trim()===t?e:t}var N8={handlers:{wikiLink:e=>{let t=e,n=t.data?.target??``,r=t.data?.anchor,i=t.data?.alias,a=`[[${M8(t.data?.sourceTarget,n)}`;return r&&(a+=`#${M8(t.data?.sourceAnchor,r)}`),i&&(a+=`|${M8(t.data?.sourceAlias,i)}`),`${a}]]`},wikiLinkEmbed:e=>{let t=e,n=t.data?.target??``,r=t.data?.anchor,i=t.data?.alias,a=`![[${n}`;return r&&(a+=`#${r}`),i&&(a+=`|${i}`),`${a}]]`}},unsafe:[{character:`[`,inConstruct:[`phrasing`]}]},P8=rae();function F8(){let e=this.data();e.micromarkExtensions||=[],e.micromarkExtensions.some(e=>e===P8)||e.micromarkExtensions.push(P8),e.fromMarkdownExtensions||=[],e.fromMarkdownExtensions.some(e=>e===j8)||e.fromMarkdownExtensions.push(j8),e.toMarkdownExtensions||=[],e.toMarkdownExtensions.some(e=>e===N8)||e.toMarkdownExtensions.push(N8)}function dae(e){return e.children.some(e=>{let t=e.type;return t!==`yaml`&&t!==`toml`})?e:{...e,children:[...e.children,{type:`paragraph`,children:[]}]}}var fae=[{name:`remark-parse`,plugin:ie},{name:`remark-mdx-agnostic`,plugin:h8},{name:`remark-gfm`,plugin:O},{name:`remark-math`,plugin:rF,options:{singleDollarTextMath:!1}},{name:`remark-wiki-link`,plugin:F8},{name:`remark-github-alerts`,plugin:GP,options:z3},{name:`callout-transformer`,plugin:L3},{name:`restore-from-mdx`,plugin:u3},{name:`void-br-promoter`,plugin:C8},{name:`restore-entity-refs`,plugin:x3},{name:`restore-backslash-escapes`,plugin:T3},{name:`details-accordion-promoter`,plugin:S6},{name:`div-align-promoter`,plugin:j6},{name:`image-promoter`,plugin:q6},{name:`indented-code-promoter`,plugin:iie},{name:`math-promoter`,plugin:fie},{name:`single-dollar-math-promoter`,plugin:Hie},{name:`highlight-promoter`,plugin:K6},{name:`underline-promoter`,plugin:Qie},{name:`mermaid-promoter`,plugin:Eie},{name:`comment-promoter`,plugin:X3},{name:`merged-post-parse-walker`,plugin:wie},{name:`empty-task-item-unmint`,plugin:R6},{name:`link-reference-destination`,plugin:die},{name:`non-rendering-context-demote`,plugin:Iie},{name:`ensure-non-empty-doc`,plugin:()=>dae}];function pae(e){let t=Se();for(let e of fae)t=`options`in e&&e.options!==void 0?t.use(e.plugin,e.options):t.use(e.plugin);return t=t.use(gP,{schema:e.schema,handlers:e.handlers}),t.freeze(),t}function mae(e){let t=Se().use(VP,[`yaml`]).use(O,{tablePipeAlign:!1}).use(rF,{singleDollarTextMath:!1}).use(h8).use(F8).use(Xie).use(rP,{bullet:`-`,fences:!0,rule:`-`,join:[Vie],...e.toMarkdownHandlers?{handlers:e.toMarkdownHandlers}:{}});return t.freeze(),t}function I8(e){return e.charCodeAt(0)===65279?{source:e.slice(1),hadBom:!0}:{source:e,hadBom:!1}}var L8=/^\n+$/,R8=/^\n{2,}$/;function z8(e,t,n){let r,i,a=e.children;if(a.length>0){let e=a[0]?.position?.start?.offset;if(typeof e==`number`&&e>0){let n=t.slice(0,e);L8.test(n)&&(r=n)}let n=a[a.length-1]?.position?.end?.offset;if(typeof n==`number`&&n<=t.length){let e=t.slice(n);R8.test(e)&&(i=e)}}if(!n&&r===void 0&&i===void 0)return;let o={...n?{bom:!0}:{},...r===void 0?{}:{leading:r},...i===void 0?{}:{trailing:i}};return e.data??={},e.data.sourceDocBoundary=o,o}function hae(e){if(typeof e!=`object`||!e)return;let t=e,n={};return t.bom===!0&&(n.bom=!0),typeof t.leading==`string`&&L8.test(t.leading)&&(n.leading=t.leading),typeof t.trailing==`string`&&R8.test(t.trailing)&&(n.trailing=t.trailing),n.bom||n.leading||n.trailing?n:void 0}function gae(e,t){let{source:n,hadBom:r}=I8(e),i=d6(n),a=new _(v3(c3(w3(i)))),o=t.parse(a);a.value=i;let s=t.runSync(o,a);Q6(s,i);let c=z8(s,i,r),l=c?_1(s,c):void 0,u=t.stringify(s);return l?u.type.create({...u.attrs,sourceDocBoundary:l},u.content,u.marks):u}function _ae(e,t){return B8(e,t,!1)}function vae(e,t){return B8(e,t,!0)}function B8(e,t,n){let{source:r,hadBom:i}=I8(e),a=d6(r),o=new _(v3(c3(w3(a)))),s=t.parse(o);o.value=a;let c=t.runSync(s,o);n&&Q6(c,a);let l=z8(c,a,i);return n&&l&&_1(c,l),c}function yae(e,t,n){let r=vP(e,{schema:n.schema,nodeHandlers:n.pmNodeHandlers,markHandlers:n.pmMarkHandlers});I6(r),Yie(r),zie(r);let i=hae(e.attrs?.sourceDocBoundary),a=String(t.stringify(r));return i?.leading&&(a=i.leading+a),i?.trailing&&(a=a.replace(/\n+$/,``)+i.trailing),i?.bom&&(a=`\uFEFF${a}`),a}function bae(){return!1}function xae(e){let t=e.lastIndexOf(`/`);return t===-1?``:t===0?`/`:e.slice(0,t)}function Sae(e,t){let n=e?`${e}/${t}`:t,r=n.startsWith(`/`),i=[];for(let e of n.split(`/`))if(!(e===``||e===`.`)){if(e===`..`){let e=i[i.length-1];i.length>0&&e!==`..`?i.pop():r||i.push(`..`);continue}i.push(e)}let a=i.join(`/`);return r?`/${a}`:a}function V8(e,t){if(typeof e!=`string`||e===``||!t||e.startsWith(`/`)||!gZ(e))return e;let n=Sae(xae(t),e);return n===``||n===`..`||n.startsWith(`../`)?(bae()&&console.warn(`[resolve-image-url] doc-relative path escapes contentDir; emitting raw URL: ${e} (from sourcePath ${t})`),e):`/${n}`}var Cae=Object.assign(Rae,{peek:()=>`$`}),wae=Object.assign(zae,{peek:()=>`~`}),Tae=(()=>{for(let e of m8.extensions??[]){let t=e?.handlers?.mdxJsxFlowElement;if(typeof t==`function`)return t}throw Error(`mdast-util-mdx-jsx mdxJsxFlowElement to-markdown handler not found — the dirty MDX JSX serialize path cannot bind. Likely a breaking change in mdast-util-mdx-jsx (pinned in the root overrides); re-run the markdown-pipeline upgrade protocol (test:fidelity).`)})(),Eae=/^[ \t]*(?:$|#{1,6}(?:[ \t]|[ \t]*$)|>|(?:[-+*]|\d{1,9}[.)])[ \t]|`{3,}|~{3,}|=+[ \t]*$|-+[ \t]*$|(?:\*[ \t]*){3,}$|(?:_[ \t]*){3,}$)/,Dae={text(e,t,n,r){if(typeof e.data?.sourceRaw==`string`&&KZ(e.data.sourceRaw,e.value??``))return e.data.sourceRaw;if(e.data?.escapedChars?.length){let t=e.value??``,i=e.data.escapedChars,a=``,o=0;for(let{offset:e,char:s}of i)e>o&&(a+=q8(n,t.slice(o,e),{...r,before:r.before+a,after:`\\`})),a+=`\\${s}`,o=e+1;return o<t.length&&(a+=q8(n,t.slice(o),{...r,before:r.before+a})),a}return q8(n,e.value??``,r)},emphasis(e,t,n,r){let i=e.data?.sourceDelimiter??`*`,a=n.createTracker(r),o=n.enter(`emphasis`),s=a.move(i);return s+=Z8(n.containerPhrasing(e,{before:s,after:i,...a.current()}),r,i),s+=a.move(i),o(),s},strong(e,t,n,r){let i=e.data?.sourceDelimiter??`**`,a=n.createTracker(r),o=n.enter(`strong`),s=a.move(i);return s+=Z8(n.containerPhrasing(e,{before:s,after:i,...a.current()}),r,i),s+=a.move(i),o(),s},link(e,t,n,r){if(e.data?.sourceStyle===`autolink`)return`<${e.url??``}>`;if(e.data?.sourceStyle===`gfm-autolink`){let t=e.children?.length===1?e.children[0]:null;if(t?.type===`text`&&typeof t.value==`string`)return t.value}let i=n.createTracker(r),a=n.enter(`link`),o=n.enter(`label`),s=i.move(`[`);s+=i.move(n.containerPhrasing(e,{before:s,after:`](`,...i.current()})),s+=i.move(`](`),o();let c=n.enter(`destinationRaw`),l=String(e.url??``),u=e.data?.sourceUrlForm===`angle-bracketed`,d=l.startsWith(`<`)&&l.endsWith(`>`),f=u&&!d?`<${l}>`:G8(l);if(s+=i.move(f),c(),e.title){let t=e.data?.sourceTitleMarker??`double`;s+=i.move(W8(e.title,t))}return s+=i.move(`)`),a(),s},image(e,t,n,r){let i=n.createTracker(r),a=n.enter(`image`),o=n.enter(`label`),s=i.move(`})),s+=i.move(`](`),o();let c=n.enter(`destinationRaw`);if(s+=i.move(G8(String(e.url??``))),c(),e.title){let t=n.enter(`titleQuote`);s+=i.move(` "`),s+=i.move(n.safe(e.title,{before:s,after:`"`,...i.current()})),s+=i.move(`"`),t()}return s+=i.move(`)`),a(),s},definition(e,t,n,r){let i=e.data?.sourceLayout??`inline`,a=e.data?.sourceTitleMarker??`double`,o=n.enter(`definition`),s=n.createTracker(r),c=n.enter(`label`),l=s.move(`[`);l+=s.move(n.safe(n.associationId(e),{before:l,after:`]`,...s.current()})),l+=s.move(`]:`),c();let u=i===`multiline`?`
|
|
542
542
|
`:` `;l+=s.move(u);let d=String(e.url??``);if(!d||/[\0- ]/.test(d)){let e=n.enter(`destinationLiteral`);l+=s.move(`<`),l+=s.move(n.safe(d,{before:l,after:`>`,...s.current()})),l+=s.move(`>`),e()}else{let e=n.enter(`destinationRaw`);l+=s.move(G8(d)),e()}if(e.title){let t=i===`multiline`?`
|
|
543
543
|
`:` `;l+=s.move(W8(e.title,a,t))}return o(),l},thematicBreak(e){return e.data?.sourceRaw??`---`},break(e,t,n){let r=e.data?.sourceRaw;return typeof r==`string`&&r.length>0?r:n.stack.includes(`tableCell`)||n.stack.includes(`okAtxHeading`)?`<br />`:e.data?.sourceStyle===`backslash`?`\\
|
|
544
544
|
`:`
|
|
@@ -563,21 +563,21 @@ Read more at https://docs.orama.com/docs/orama-js/plugins/plugin-secure-proxy#pl
|
|
|
563
563
|
|
|
564
564
|
`:`
|
|
565
565
|
`;return l.join(f)},table(e,t,n,r){let i=n.enter(`table`),a=[],o=[],s=e.children??[];for(let e of s){let t=e.children??[],i=[],s=[];for(let e of t){let t=n.enter(`tableCell`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,{...r,before:` `,after:` `});a(),t(),i.push(o);let c=e.data?.sourcePadding;s.push(c&&typeof c.left==`number`&&typeof c.right==`number`?{left:c.left,right:c.right}:null)}a.push(i),o.push(s)}i();let c=e.align??[],l=e.data?.sourceDashCounts,u=a[0]?.length??0,d=a.slice(1).reduce((e,t)=>Math.max(e,t.length),0),f=Math.max(u,d,c.length);if(f===0)return console.warn(JSON.stringify({event:`table-serialize-dropped-empty`,rows:s.length})),``;let p=[];for(let e=0;e<f;e++){let t=c[e],n=``,r=``;t===`center`?(n=`:`,r=`:`):t===`left`?n=`:`:t===`right`&&(r=`:`);let i=l?.[e],a=typeof i==`number`&&i>=1?i:1;p.push(n+`-`.repeat(a)+r)}let m=(e,t)=>{let n=[];for(let r=0;r<f;r++){let i=e[r]??``,a=t[r]??{left:1,right:1};n.push(` `.repeat(a.left)+i+` `.repeat(a.right))}let r=v&&!v.leading?``:`|`,i=v&&!v.trailing?``:`|`;return`${r}${n.join(`|`)}${i}`},h=e.data?.sourceAlignmentPadding,g=Array.from({length:f},(e,t)=>{let n=h?.[t];return n&&typeof n.left==`number`&&typeof n.right==`number`?n:null}),_=e.data?.sourceOuterPipes,v=_&&f>=2&&a.every(e=>{let t=(e[0]??``).trim(),n=(e[f-1]??``).trim();return(_.leading||t.length>0)&&(_.trailing||n.length>0&&!n.endsWith(`\\`))})?_:null;if(a.length===0)return m(p,g);let y=[];y.push(m(a[0],o[0]??[])),y.push(m(p,g));for(let e=1;e<a.length;e++)y.push(m(a[e],o[e]??[]));return y.join(`
|
|
566
|
-
`)},mdxJsxFlowElement(e,t,n,r){let i=e,a=i.data?.sourceRaw;if(typeof a==`string`)return a;let o=i.data?.htmlBoundary;if(o&&typeof o.opener==`string`&&typeof o.closer==`string`){let e=n.containerFlow({type:`root`,children:i.children??[]},r);return`${o.opener}\n\n${e}\n\n${o.closer}`}let s=i.name??``,c=H8(i.attributes??[]);return!i.children||i.children.length===0?s?c?`<${s} ${c} />`:`<${s} />`:``:Tae({...i,attributes:(i.attributes??[]).map(
|
|
567
|
-
]|$)`};return delete t._compiled,t});let i;try{i=e.safe(
|
|
568
|
-
`||e[r]===`\r`;let i=n.after.charCodeAt(0);return Number.isNaN(i)||i===10||i===13}function Rae(e,t){let n=``,r=0;for(;r<e.length;){let i=e.charAt(r);if(i===`\\`){n+=e.slice(r,r+2),r+=2;continue}if(i===`*`||i===`_`||i===`~`||i===`=`){let a=r+1;for(;a<e.length&&e.charAt(a)===i;)a++;let o=r===0?t.before.charCodeAt(t.before.length-1):e.charCodeAt(r-1);if(i===`=`)n+=(Number.isNaN(o)||o===10||o===13)&&Lae(e,a,t)?`\\${e.slice(r,a)}`:e.slice(r,a);else{let s=a<e.length?e.charCodeAt(a):t.after.charCodeAt(0);n+=Iae(i,o,s)?`\\${i}`.repeat(a-r):e.slice(r,a)}r=a;continue}n+=i,r+=1}return n}function Z8(e,t,n){let r=n.startsWith(`_`)?`_`:`*`,i=t.before??``,a=t.after??``,o=e,s=o.charCodeAt(0);Q8(i.charCodeAt(i.length-1),s,r)&&(o=$8(s)+o.slice(1));let c=o.charCodeAt(o.length-1);return Q8(a.charCodeAt(0),c,r)&&(o=o.slice(0,-1)+$8(c)),o}function Q8(e,t,n){return!(f(t)!==Y8||n===`_`&&f(e)===void 0)}function $8(e){return`&#x${e.toString(16).toUpperCase()};`}function zae(e,t,n,r){let i=e.value??``,a=e.data?.sourceDelimiter,o=typeof a==`string`&&/^\$+$/.test(a)?a.length:2;for(o===1&&!Vae(i,r)&&(o=2);RegExp(`(^|[^$])${`\\$`.repeat(o)}([^$]|$)`).test(i);)o++;let s=`$`.repeat(o);/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^\$|\$$/.test(i))&&(i=` ${i} `);let c=-1;for(;++c<n.unsafe.length;){let e=n.unsafe[c];if(!e.atBreak)continue;let t=n.compilePattern(e),r;for(;(r=t.exec(i))!==null;){let e=r.index;i.codePointAt(e)===10&&i.codePointAt(e-1)===13&&e--,i=`${i.slice(0,e)} ${i.slice(r.index+1)}`}}return s+i+s}function Bae(e,t,n,r){let i=e.data?.sourceDelimiter===`~`?`~`:`~~`,a=n.createTracker(r),o=n.enter(`strikethrough`),s=a.move(i);return s+=Z8(n.containerPhrasing(e,{...a.current(),before:s,after:`~`}),r,i),s+=a.move(i),o(),s}function Vae(e,t){return!(e.length===0||!/^\S/.test(e)||!/\S$/.test(e)||/[$\r\n]/.test(e)||e.endsWith(`\\`)||/\\[!-/:-@[-`{-~]/.test(e)||/^\d/.test(t.after)||t.before.endsWith(`\\`))}function e5(e){if(!Number.isFinite(e)||e<0)return``;if(e<1024)return`${e} B`;let t=[`KiB`,`MiB`,`GiB`,`TiB`],n=e/1024,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n.toFixed(1).replace(/\.0$/,``)} ${t[r]}`}var Hae=class{schema;handlers;pmNodeHandlers;pmMarkHandlers;parseProcessor;serializeProcessor;parseCtx={current:{}};freshnessHolder={checker:void 0};constructor(e){this.schema=Tw(e.extensions),this.handlers=qae(this.schema,this.parseCtx),this.freshnessHolder.checker=e.deriveStructuralFreshness?$0({parse:e=>this.parseWithFallback(e)}):void 0;let{nodeHandlers:t,markHandlers:n}=Jae(this.schema,this.freshnessHolder);this.pmNodeHandlers=t,this.pmMarkHandlers=n,this.parseProcessor=pae({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers}),this.serializeProcessor=mae({toMarkdownHandlers:Oae})}parse(e,t){if(!e.trim())return{type:`doc`,content:[{type:`paragraph`,content:[]}]};this.parseCtx.current=t??{};try{return gae(e,this.parseProcessor).toJSON()}finally{this.parseCtx.current={}}}parseToMdast(e){return e.trim()?_ae(e,this.parseProcessor):{type:`root`,children:[]}}parseToEditorMdast(e){return e.trim()?vae(e,this.parseProcessor):{type:`root`,children:[]}}parseWithFallback(e,t){return e.trim()?v4(e,{parse:e=>this.parse(e,t)}):{type:`doc`,content:[{type:`paragraph`,content:[]}]}}serialize(e,t){let n;try{n=this.schema.nodeFromJSON(e)}catch(t){let n=`MarkdownManager.serialize() failed: schema rejected JSONContent (type=${e.type}, childCount=${e.content?.length??0})`;throw Error(n,{cause:t})}let r=this.freshnessHolder.checker;t?.skipFreshnessDerive&&(this.freshnessHolder.checker=void 0);try{return yae(n,this.serializeProcessor,{schema:this.schema,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers})}finally{this.freshnessHolder.checker=r}}},t5=q2();function n5(e,t){let n=new Map;for(let e of t)n.set(e.name,e);let r={};for(let t of e){if(t.type===`mdxJsxExpressionAttribute`)continue;let e=t.name,i=n.get(e);if(t.value===null||t.value===void 0){r[e]=!0;continue}if(typeof t.value==`string`){if(i?.type===`number`){let n=Number(t.value);r[e]=Number.isNaN(n)?t.value:n}else i?.type===`boolean`?r[e]=t.value===`true`:r[e]=t.value;continue}let a=t.value.value;try{r[e]=JSON.parse(a)}catch{r[e]=a}}return r}function Uae(e){let t=!1;return e.descendants(e=>t?!1:e.type.name===`jsxInline`?(e.attrs.sourceDirty&&(t=!0),!1):e.type.name===`jsxComponent`&&e.attrs.sourceDirty?(t=!0,!1):!0),t}function Wae(e,t){return e.attrs.sourceDirty||Uae(e)?!0:t?t.isDiverged(e.toJSON()):!1}function Gae(e){if(e.type!==`paragraph`)return!1;let t=e.children??[];return t.length===0?!0:t.every(e=>e.type===`text`&&e.value===``)}function r5(e,t){if(!t)return e;let n={};return t.sourceFenceChar&&(n.sourceFenceChar=t.sourceFenceChar),typeof t.sourceFenceLength==`number`&&(n.sourceFenceLength=t.sourceFenceLength),t.sourcePadded===!0&&(n.sourcePadded=!0),Object.keys(n).length===0?e:{...e,data:n}}function i5(e,t){if(e.length===0)return r5({type:`inlineCode`,value:``},t);if(e.every(e=>e.type===`text`))return r5({type:`inlineCode`,value:e.map(e=>e.value).join(``)},t);if(e.length===1&&`children`in e[0]){let n=e[0];return{...n,children:[i5(n.children,t)]}}return r5({type:`inlineCode`,value:a5(e)},t)}function a5(e){let t=``;for(let n of e)n.type===`text`?t+=n.value:`children`in n&&Array.isArray(n.children)?t+=a5(n.children):`value`in n&&typeof n.value==`string`&&(t+=n.value);return t}var Kae=Vu;function qae(e,t){let n=e.nodes,r=e.marks,i={};n.paragraph&&(i.paragraph=(e,t,r)=>{let i=r.all(e).flat(),a=i.some(e=>e?.isBlock&&!e?.isInline),o=i.some(e=>e?.isInline||e?.isText||e?.isTextblock);if(a&&!o)return i.length===1?i[0]:i;if(a&&o){let e=i.filter(e=>!e?.isBlock||e?.isInline),t=i.filter(e=>e?.isBlock&&!e?.isInline),r=[],a=n.paragraph.createAndFill(null,e.length>0?e:null);return a&&r.push(a),r.push(...t),r.length===1?r[0]:r}return n.paragraph.createAndFill(null,i.length>0?i:null)}),n.blockquote&&(i.blockquote=pP(n.blockquote,e=>({sourceMarkerSpacings:e.data?.sourceMarkerSpacings??null}))),n.tableCell&&(i.tableCell=(e=>(t,r,i)=>{let a=i.all(t).flat();if(a.length>0&&n.paragraph){let t=n.paragraph.create(null,a);return e.createAndFill(null,[t])}return e.createAndFill(null,null)})(n.tableCell)),n.tableRow&&(i.tableRow=pP(n.tableRow)),n.table&&n.tableRow&&n.tableCell&&(i.table=(e,t,r)=>{let i=e.align??[],a=e.children??[],o=[];for(let e=0;e<a.length;e++){let t=a[e];if(t.type!==`tableRow`)continue;let s=t.children??[],c=[];for(let t=0;t<s.length;t++){let a=s[t];if(a.type!==`tableCell`)continue;let o=r.all(a).flat(),l=o.length>0&&n.paragraph?[n.paragraph.create(null,o)]:null,u=i[t]??null,d=e===0&&n.tableHeader?n.tableHeader:n.tableCell,f=a.data?.sourcePadding??null,p=d.createAndFill({align:u,sourcePadding:f},l);p&&c.push(p)}let l=n.tableRow.createAndFill(null,c.length>0?c:null);l&&o.push(l)}let s=e.data?.sourceDashCounts??null,c=e.data?.sourceOuterPipes??null,l=e.data?.sourceAlignmentPadding??null;return n.table.createAndFill({sourceDashCounts:s,sourceOuterPipes:c,sourceAlignmentPadding:l},o.length>0?o:null)}),n.image&&(i.image=e=>{let r=e.url??``,i=V8(r,t.current.sourcePath);return n.image.createAndFill({src:i,alt:e.alt??null,title:e.title??null,sourceUrl:i===r?null:r})},n.imageReference?i.imageReference=e=>n.imageReference.createAndFill({alt:e.alt??``,label:e.label??e.identifier??``,identifier:e.identifier??``,referenceType:e.referenceType??`shortcut`}):i.imageReference=e=>n.image.createAndFill({src:``,alt:e.alt??null,title:null})),r.escapeMark&&(i.text=t=>{let n=t.value??``,i=typeof t.data?.sourceRaw==`string`?t.data.sourceRaw:null;if(!n&&!i)return null;if(i)return r.sourceLiteral?e.text(n,[r.sourceLiteral.create({sourceRaw:i})]):e.text(n);let a=t.data?.escapedChars,o=t.data?.entityRefSpans;if(!a?.length&&!o?.length)return e.text(n);let s=[...(a??[]).map(e=>({kind:`escape`,offset:e.offset,length:1})),...(o??[]).map(e=>({kind:`entity`,offset:e.offset,length:e.length,raw:e.raw}))];s.sort((e,t)=>e.offset-t.offset);let c=[];for(let e of s){let t=c[c.length-1];e.kind===`entity`&&t?.kind===`entity`&&t.offset+t.length===e.offset&&wY(t.raw)!==null&&xY(e.raw)?c[c.length-1]={kind:`entity`,offset:t.offset,length:t.length+e.length,raw:t.raw+e.raw}:c.push(e)}let l=[],u=0;for(let t of c){if(t.offset>u){let r=n.slice(u,t.offset);r&&l.push(e.text(r))}if(t.offset<n.length){let i=n.slice(t.offset,t.offset+t.length);if(i)if(t.kind===`escape`)l.push(e.text(i,[r.escapeMark.create()]));else if(r.sourceLiteral){let n=wY(t.raw);l.push(e.text(n??i,[r.sourceLiteral.create({sourceRaw:t.raw})]))}else l.push(e.text(i));u=t.offset+t.length}}if(u<n.length){let t=n.slice(u);t&&l.push(e.text(t))}return l.length===1?l[0]:l}),r.code&&(i.inlineCode=t=>e.text(t.value,[r.code.create({sourceFenceChar:t.data?.sourceFenceChar??"`",sourceFenceLength:typeof t.data?.sourceFenceLength==`number`?t.data.sourceFenceLength:1,sourcePadded:t.data?.sourcePadded===!0})]));let a=r.strike??r.delete;if(a&&(i.delete=mP(a,e=>({sourceDelimiter:e.data?.sourceDelimiter===`~`?`~`:`~~`}))),r.highlight&&(i.mark=mP(r.highlight)),r.underline&&(i.underline=mP(r.underline,e=>({sourceForm:e.data?.sourceForm===`ins`?`ins`:`u`}))),r.comment&&(i.comment=mP(r.comment,e=>({sourceForm:e.data?.sourceForm??`percent`}))),n.commentBlock&&(i.commentBlock=pP(n.commentBlock,e=>({sourceForm:e.data?.sourceForm??`percent`,sourceLayout:e.data?.sourceLayout??`block`}))),r.emphasis&&(i.emphasis=mP(r.emphasis,e=>({sourceDelimiter:e.data?.sourceDelimiter??`*`}))),r.strong&&(i.strong=mP(r.strong,e=>({sourceDelimiter:e.data?.sourceDelimiter??`**`}))),n.heading&&(i.heading=pP(n.heading,e=>({level:e.depth,headingStyle:e.data?.sourceStyle??`atx`,sourceTrailingHashes:e.data?.sourceTrailingHashes??null,sourceUnderlineLength:e.data?.sourceUnderlineLength??null,sourceContiguousNext:e.data?.sourceContiguousNext??!1,sourceLeadingIndent:e.data?.sourceLeadingIndent??null,sourceInteriorSpacing:e.data?.sourceInteriorSpacing??null}))),n.codeBlock&&(i.code=t=>{let r=t.value?[e.text(t.value)]:[];return n.codeBlock.createAndFill({language:t.lang??null,meta:t.meta??null,fenceDelimiter:t.data?.sourceFenceChar??"`",fenceLength:t.data?.sourceFenceLength??3,sourceStyle:t.data?.sourceStyle??`fenced`,sourceClosingFenceLength:t.data?.sourceClosingFenceLength??null,sourceUnclosedFence:t.data?.sourceUnclosedFence??!1,sourceFenceIndent:t.data?.sourceFenceIndent??null,sourceInfoPadding:t.data?.sourceInfoPadding??null,sourceIndents:t.data?.sourceIndents??null},r)}),n.thematicBreak&&(i.thematicBreak=e=>n.thematicBreak.createAndFill({sourceRaw:e.data?.sourceRaw??`---`})),n.hardBreak&&(i.break=e=>n.hardBreak.createAndFill({hardBreakStyle:e.data?.sourceStyle??`spaces`,sourceRaw:e.data?.sourceRaw??null})),n.list&&(i.list=pP(n.list,e=>({ordered:!!e.ordered,start:e.start??1,spread:!!e.spread,bulletMarker:e.data?.bulletMarker??null,listMarkerDelimiter:e.data?.listMarkerDelimiter??null}))),n.listItem&&(i.listItem=pP(n.listItem,e=>({checked:e.checked??null,spread:!!e.spread,sourceMarkerSpacing:e.data?.sourceMarkerSpacing??null,sourceOrdinal:e.data?.sourceOrdinal??null,sourceCheckboxChar:e.data?.sourceCheckboxChar??null,sourceContinuationIndent:e.data?.sourceContinuationIndent??null}))),r.link){let t=r.sourceLiteral;i.link=(n,i,a)=>{if((n.children??[]).length===0){let r=typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:`[](${n.url??``})`;return r?t?e.text(r,[t.create({sourceRaw:r})]):e.text(r):null}let o=a.all(n).flat(),s=r.link.create({href:n.url??``,title:n.title??null,linkStyle:n.data?.sourceStyle??`inline`,refLabel:null,sourceUrlForm:n.data?.sourceUrlForm??null,sourceTitleMarker:n.data?.sourceTitleMarker??null});return o.map(e=>e.mark(s.addToSet(e.marks)))},i.linkReference=(n,i,a)=>{if((n.children??[]).length===0){let r=typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:`[${n.label??``}][${n.identifier??``}]`;return r?t?e.text(r,[t.create({sourceRaw:r})]):e.text(r):null}let o=a.all(n).flat(),s=r.link.create({href:n.data?.resolvedUrl??``,title:n.data?.resolvedTitle??null,linkStyle:n.referenceType??`shortcut`,refLabel:n.label??n.identifier??null});return o.map(e=>e.mark(s.addToSet(e.marks)))}}n.htmlBlock&&(i.html=e=>n.htmlBlock.createAndFill({content:e.value??``}));let o=n.linkDefinition??n.linkRefDef;if(o){let e=!!o.spec.attrs?.url,t=!!o.spec.attrs?.href,n=!!o.spec.attrs?.identifier,r=!!o.spec.attrs?.sourceLayout,a=!!o.spec.attrs?.sourceTitleMarker;i.definition=i=>{let s={title:i.title??null};return n&&(s.identifier=i.identifier??``),s.label=i.label??i.identifier??``,e?s.url=i.url??``:t&&(s.href=i.url??``),r&&(s.sourceLayout=i.data?.sourceLayout??null),a&&(s.sourceTitleMarker=i.data?.sourceTitleMarker??null),o.createAndFill(s)}}if(n.jsxComponent){let r=e=>{if(e&&typeof e==`object`&&`sourceRaw`in e){let t=e.sourceRaw;if(typeof t==`string`)return t}};i.mdxJsxFlowElement=(e,i,a)=>{let o=e.name??``,s=t5.getOrWildcard(o),c=n5(e.attributes,s.props);if(o===`CommonMarkImage`&&typeof c.src==`string`){let e=c.src,n=V8(e,t.current.sourcePath);n!==e&&(c.src=n,c.sourceUrl=e)}let l=a.all(e).flat();return n.jsxComponent.createAndFill({componentName:o,kind:`element`,attributes:e.attributes,sourceRaw:r(e.data)??``,sourceDirty:!1,props:c},l.length?l:void 0)};let a=(e,t)=>{let n=e.attributes?.find(e=>e.type===`mdxJsxAttribute`&&e.name===t);return n&&typeof n.value==`string`?n.value:null};i.mdxJsxTextElement=t=>{if(t.name===`InlineMath`&&n.mathInline){let e=a(t,`formula`)??``,r=a(t,`id`);return n.mathInline.create({formula:e,id:r??null})}if(t.name===`Tag`&&n.tag){let e=a(t,`value`)??``;return n.tag.create({value:e})}let i=t.name??``,o=i?t5.get(i):void 0;if(o&&n.jsxInline){let e=n5(t.attributes,o.props),a=r(t.data)??``,s=(t.children??[]).map(e=>e&&typeof e==`object`&&`value`in e?String(e.value??``):``).join(``);return s&&(e.children=s),n.jsxInline.createAndFill({componentName:i,attributes:t.attributes,sourceRaw:a,sourceDirty:!1,props:e})}if(n.jsxInline){let i=r(t.data)??``;return n.jsxInline.createAndFill({},i?[e.text(i)]:null)}return n.jsxComponent.createAndFill({sourceRaw:r(t.data)??``})},i.mdxFlowExpression=e=>{let t=r(e.data)??`{${e.value??``}}`;return n.jsxComponent.createAndFill({kind:`expression`,sourceRaw:t,sourceDirty:!1})},i.mdxTextExpression=t=>{let n=r(t.data)??`{${t.value??``}}`;return e.text(n)}}return n.wikiLink&&(i.wikiLink=e=>n.wikiLink.createAndFill({target:e.data?.target??``,alias:e.data?.alias??null,anchor:e.data?.anchor??null,sourceTarget:e.data?.sourceTarget??null,sourceAnchor:e.data?.sourceAnchor??null,sourceAlias:e.data?.sourceAlias??null})),n.tag&&(i.tag=e=>n.tag.createAndFill({value:e.value})),n.wikiLinkEmbed&&(i.wikiLinkEmbed=(i,a)=>{let o=i.data?.target??``,s=i.data?.alias??null,c=i.data?.anchor??null,l=cQ(o),{resolveEmbed:u,sourcePath:d}=t.current,f=u&&d?u(o,d)??null:null,p=f?`/${f}`:o,m=a?.type===`paragraph`&&Array.isArray(a.children)&&a.children.length===1;if(m&&Kae.has(l)&&n.jsxComponent&&t5.has(`WikiEmbedImage`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedImage`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,alt:s??o,target:o,anchor:c,alias:s}});if(m&&Hu.has(l)&&n.jsxComponent&&t5.has(`WikiEmbedVideo`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedVideo`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,title:s??o,target:o,anchor:c,alias:s}});if(m&&Wu.has(l)&&n.jsxComponent&&t5.has(`WikiEmbedAudio`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedAudio`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,title:s??o,target:o,anchor:c,alias:s}});if(m&&Gu.has(l)&&n.jsxComponent&&t5.has(`WikiEmbedFile`)){let{resolveSize:e}=t.current,r=e&&d?e(o,d)??null:null,i=r===null?null:e5(r);return n.jsxComponent.createAndFill({componentName:`WikiEmbedFile`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,target:o,anchor:c,alias:s,size:i}})}let h=s||(c?`${o}#${c}`:o);if(r.link){let t=r.link.create({href:p,title:null,linkStyle:`inline`,refLabel:null,sourceForm:`wikiembed`,target:o,anchor:c,alias:s});return e.text(h,[t])}throw Error("[wikiLinkEmbed handler] schema lacks `link` mark — cannot dispatch without violating the STOP rule against emitting PM wikiLinkEmbed server-side")}),n.mathInline&&(i.inlineMath=e=>n.mathInline.create({formula:e.value??``,sourceDelimiter:e.data?.sourceDelimiter??null})),i.math||=t=>{let r=t.value==null?`«unknown:${t.type}»`:t.value;return n.rawMdxFallback?(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled block mdast: ${t.type}`})),n.rawMdxFallback.createAndFill({reason:`Unhandled block mdast: ${t.type}`},r?[e.text(r)]:null)):null},i.inlineMath||=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled inline mdast: ${t.type}`})),t.value==null?e.text(`«unknown:${t.type}»`):e.text(t.value)),n.footnoteReference?i.footnoteReference=e=>n.footnoteReference.create({identifier:e.identifier,label:e.label??e.identifier}):i.footnoteReference||=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:`footnoteReference`,reason:`FootnoteReference extension missing — recovering [^id] source`})),e.text(`[^${t.label??t.identifier}]`)),n.footnoteDefinition?i.footnoteDefinition=pP(n.footnoteDefinition,e=>{let t=e;return{identifier:t.identifier,label:t.label??t.identifier}}):i.footnoteDefinition||=t=>{console.warn(JSON.stringify({event:`unknown-mdast-type`,type:`footnoteDefinition`,reason:`FootnoteDefinition extension missing — recovering [^id]: marker`}));let r=`[^${t.label??t.identifier}]: `;return n.paragraph?n.paragraph.create(null,e.text(r)):null},i.rawMdxFallbackMdast=t=>{if(!n.rawMdxFallback)return null;let r=t.position?{start:t.position.start?.offset??0,end:t.position.end?.offset??0}:{start:0,end:0};return console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.originalType,reason:`Unhandled mdast: ${t.originalType}`,unresolvedPosition:t.unresolvedPosition??!1})),n.rawMdxFallback.createAndFill({reason:`Unhandled mdast: ${t.originalType}`,originalSpan:r},t.value?[e.text(t.value)]:null)},i}function Jae(e,t){let n={},r={},i=e.nodes,a=e.marks;i.paragraph&&(n.paragraph=yP(`paragraph`)),i.blockquote&&(n.blockquote=yP(`blockquote`,e=>{let t=e.attrs.sourceMarkerSpacings,n={};return Array.isArray(t)&&t.length>0&&(n.sourceMarkerSpacings=t),Object.keys(n).length>0?{data:n}:{}})),i.heading&&(n.heading=yP(`heading`,e=>({depth:e.attrs.level,data:{sourceStyle:e.attrs.headingStyle,sourceTrailingHashes:e.attrs.sourceTrailingHashes??void 0,sourceUnderlineLength:e.attrs.sourceUnderlineLength??void 0,sourceContiguousNext:e.attrs.sourceContiguousNext===!0?!0:void 0,sourceLeadingIndent:e.attrs.sourceLeadingIndent??void 0,sourceInteriorSpacing:e.attrs.sourceInteriorSpacing??void 0}}))),i.codeBlock&&(n.codeBlock=e=>{let t=e.attrs.sourceStyle===`indented`?`indented`:`fenced`;return{type:`code`,lang:t===`indented`?null:e.attrs.language??null,meta:t===`indented`?null:e.attrs.meta??null,value:e.textContent??``,data:{sourceFenceChar:e.attrs.fenceDelimiter,sourceFenceLength:e.attrs.fenceLength,sourceStyle:t,sourceClosingFenceLength:e.attrs.sourceClosingFenceLength??void 0,sourceUnclosedFence:e.attrs.sourceUnclosedFence===!0?!0:void 0,sourceFenceIndent:e.attrs.sourceFenceIndent??void 0,sourceInfoPadding:e.attrs.sourceInfoPadding??void 0,sourceIndents:e.attrs.sourceIndents??void 0}}}),i.thematicBreak&&(n.thematicBreak=e=>({type:`thematicBreak`,data:{sourceRaw:e.attrs.sourceRaw}})),i.hardBreak&&(n.hardBreak=e=>({type:`break`,data:{sourceStyle:e.attrs.hardBreakStyle,...typeof e.attrs.sourceRaw==`string`&&e.attrs.sourceRaw.length>0?{sourceRaw:e.attrs.sourceRaw}:{}}})),i.list&&(n.list=yP(`list`,e=>({ordered:e.attrs.ordered??!1,start:e.attrs.ordered?e.attrs.start??1:null,spread:e.attrs.spread??!1,data:{bulletMarker:e.attrs.bulletMarker,listMarkerDelimiter:e.attrs.listMarkerDelimiter}}))),i.listItem&&(n.listItem=(e,t,n)=>{let r=n.all(e),i=r.length>1&&Gae(r[0])?r.slice(1):r,a={};return typeof e.attrs.sourceMarkerSpacing==`number`&&(a.sourceMarkerSpacing=e.attrs.sourceMarkerSpacing),typeof e.attrs.sourceOrdinal==`number`&&(a.sourceOrdinal=e.attrs.sourceOrdinal),e.attrs.sourceCheckboxChar===`X`&&(a.sourceCheckboxChar=`X`),typeof e.attrs.sourceContinuationIndent==`number`&&(a.sourceContinuationIndent=e.attrs.sourceContinuationIndent),{type:`listItem`,checked:e.attrs.checked??null,spread:e.attrs.spread??!1,...Object.keys(a).length>0?{data:a}:{},children:i}}),i.table&&(n.table=(e,t,n)=>{let r=n.all(e),i=[],a=e.firstChild;a&&a.forEach(e=>{let t=e.attrs.align;i.push(t===`left`||t===`right`||t===`center`?t:null)});let o=r.filter(e=>e.type===`tableRow`),s=e.attrs.sourceDashCounts,c={};Array.isArray(s)&&s.length>0&&(c.sourceDashCounts=s);let l=e.attrs.sourceOuterPipes;typeof l==`object`&&l&&typeof l.leading==`boolean`&&typeof l.trailing==`boolean`&&(c.sourceOuterPipes=l);let u=e.attrs.sourceAlignmentPadding;Array.isArray(u)&&u.length>0&&(c.sourceAlignmentPadding=u);let d=Object.keys(c).length>0?c:void 0,f={type:`table`,align:i,children:o};return d&&(f.data=d),f}),i.tableRow&&(n.tableRow=yP(`tableRow`));let o=(e,t)=>{let n={type:`tableCell`,children:h0(t)},r=e.attrs.sourcePadding;return typeof r==`object`&&r&&typeof r.left==`number`&&typeof r.right==`number`&&(n.data={sourcePadding:r}),n};if(i.tableCell&&(n.tableCell=(e,t,n)=>o(e,n.all(e))),i.tableHeader&&(n.tableHeader=(e,t,n)=>o(e,n.all(e))),i.image&&(n.image=e=>({type:`image`,url:e.attrs.sourceUrl??e.attrs.src,alt:e.attrs.alt,title:e.attrs.title})),i.imageReference&&(n.imageReference=e=>{let t=e.attrs.label??``,n=e.attrs.identifier??t;return{type:`imageReference`,alt:e.attrs.alt??``,identifier:n,label:t||n,referenceType:e.attrs.referenceType??`shortcut`}}),i.htmlBlock&&(n.htmlBlock=e=>({type:`html`,value:e.attrs.content})),i.linkDefinition??i.linkRefDef){let e=i.linkDefinition?`linkDefinition`:`linkRefDef`;n[e]=e=>{let t={},n=e.attrs.sourceLayout;(n===`multiline`||n===`inline`)&&(t.sourceLayout=n);let r=e.attrs.sourceTitleMarker;(r===`single`||r===`double`||r===`paren`)&&(t.sourceTitleMarker=r);let i={type:`definition`,identifier:e.attrs.identifier??e.attrs.label??``,label:e.attrs.label??e.attrs.identifier??``,url:e.attrs.url??e.attrs.href??``,title:e.attrs.title};return Object.keys(t).length>0&&(i.data=t),i}}if(i.jsxComponent&&(n.jsxComponent=(e,n,r)=>{if(e.attrs.kind===`expression`)return{type:`html`,value:e.attrs.sourceRaw??``};let i=e.attrs.componentName||null,a=Array.isArray(e.attrs.attributes)?e.attrs.attributes:[];return!Wae(e,t.checker)&&e.attrs.sourceRaw?{type:`mdxJsxFlowElement`,name:i,attributes:a,children:[],data:{sourceRaw:String(e.attrs.sourceRaw)}}:t5.getOrWildcard(i??`*`).serialize(e,{all:e=>r.all(e),registry:t5,serializeChildren:()=>{throw Error(`SerializeContext.serializeChildren is not available in the PM→mdast handler. Compat descriptors that need markdown-byte body rendering must emit a marker mdast node and let the to-markdown handler render the body via state.containerFlow.`)}})}),i.rawMdxFallback&&(n.rawMdxFallback=e=>{let t=e.textContent??``,n=typeof e.attrs.reason==`string`?e.attrs.reason:``,r=e.attrs.originalSpan;return{type:`rawMdxFallback`,value:t,data:{reason:n,originalSpan:r&&typeof r==`object`&&`start`in r&&`end`in r?{start:Number(r.start)||0,end:Number(r.end)||0}:{start:0,end:0}}}}),i.jsxInline&&(n.jsxInline=e=>{let t=e.attrs.componentName||``;if(t&&e.attrs.sourceDirty)return i2(t,e,t5.get(t)?.props);let n=e.attrs.attributes,r=e.attrs.sourceRaw||e.textContent||``;return{type:`mdxJsxTextElement`,name:t||null,attributes:Array.isArray(n)?n:[],children:[],data:{sourceRaw:String(r)}}}),i.mathInline&&(n.mathInline=e=>{let t=e.attrs.formula??``,n=e.attrs.id;if(typeof n==`string`&&n.length>0)return{type:`mdxJsxTextElement`,name:`InlineMath`,attributes:[{type:`mdxJsxAttribute`,name:`formula`,value:t},{type:`mdxJsxAttribute`,name:`id`,value:n}],children:[]};let r=e.attrs.sourceDelimiter;return{type:`inlineMath`,value:t,...typeof r==`string`&&r.length>0?{data:{sourceDelimiter:r}}:{}}}),i.wikiLink&&(n.wikiLink=e=>{let t=e.attrs.target??``,n=e.attrs.anchor??null,r=e.attrs.alias??null,i=r||(n?`${t}#${n}`:t);return{type:`wikiLink`,value:i,data:{target:t,anchor:n,alias:r,sourceTarget:typeof e.attrs.sourceTarget==`string`?e.attrs.sourceTarget:null,sourceAnchor:typeof e.attrs.sourceAnchor==`string`?e.attrs.sourceAnchor:null,sourceAlias:typeof e.attrs.sourceAlias==`string`?e.attrs.sourceAlias:null},children:[{type:`text`,value:i}]}}),i.tag&&(n.tag=e=>({type:`tag`,value:String(e.attrs.value??``)})),i.wikiLinkEmbed&&(n.wikiLinkEmbed=e=>{let t=e.attrs.target??``,n=e.attrs.anchor??null,r=e.attrs.alias??null,i=r||(n?`${t}#${n}`:t);return{type:`wikiLinkEmbed`,value:i,data:{target:t,anchor:n,alias:r},children:[{type:`text`,value:i}]}}),a.emphasis&&(r.emphasis=bP(`emphasis`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),a.strong&&(r.strong=bP(`strong`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),a.code&&(r.code=(e,t,n)=>{let r=e.attrs.sourceFenceChar,i=e.attrs.sourceFenceLength;return i5(n,{sourceFenceChar:r,sourceFenceLength:i,sourcePadded:e.attrs.sourcePadded===!0?!0:void 0})}),a.strike??a.delete){let e=a.strike?`strike`:`delete`;r[e]=bP(`delete`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter===`~`?`~`:`~~`}}))}return a.highlight&&(r.highlight=bP(`mark`)),a.underline&&(r.underline=bP(`underline`,e=>({data:{sourceForm:e.attrs.sourceForm===`ins`?`ins`:`u`}}))),a.comment&&(r.comment=bP(`comment`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`}}))),i.commentBlock&&(n.commentBlock=yP(`commentBlock`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`,sourceLayout:e.attrs.sourceLayout===`inline`?`inline`:`block`}}))),i.footnoteReference&&(n.footnoteReference=e=>{let t=String(e.attrs.identifier??``);return{type:`footnoteReference`,identifier:t,label:e.attrs.label?String(e.attrs.label):t}}),i.footnoteDefinition&&(n.footnoteDefinition=yP(`footnoteDefinition`,e=>({identifier:String(e.attrs.identifier??``),label:e.attrs.label?String(e.attrs.label):String(e.attrs.identifier??``)}))),a.link&&(r.link=(e,t,n)=>{if(e.attrs.sourceForm===`wikiembed`){let t=typeof e.attrs.target==`string`&&e.attrs.target.length>0?e.attrs.target:e.attrs.href??``,r=typeof e.attrs.anchor==`string`&&e.attrs.anchor.length>0?e.attrs.anchor:null,i=typeof e.attrs.alias==`string`&&e.attrs.alias.length>0?e.attrs.alias:null,a=i||(r?`${t}#${r}`:t),o=n.map(e=>`value`in e&&typeof e.value==`string`?e.value:``).join(``);return o!==a&&o.trim().length>0&&!o.includes(`]]`)&&(i=o,a=o),{type:`wikiLinkEmbed`,value:a,data:{target:t,anchor:r,alias:i},children:[{type:`text`,value:a}]}}let r=e.attrs.linkStyle;if(r===`autolink`)return{type:`link`,url:e.attrs.href??``,title:null,children:n,data:{sourceStyle:`autolink`}};if(r===`gfm-autolink`)return{type:`link`,url:e.attrs.href??``,title:null,children:n,data:{sourceStyle:`gfm-autolink`}};if(r===`inline`||!r){let t={};e.attrs.sourceUrlForm===`angle-bracketed`&&(t.sourceUrlForm=`angle-bracketed`);let r=e.attrs.sourceTitleMarker;return(r===`single`||r===`double`||r===`paren`)&&(t.sourceTitleMarker=r),{type:`link`,url:e.attrs.href??``,title:e.attrs.title??null,children:n,...Object.keys(t).length>0?{data:t}:{}}}return{type:`linkReference`,identifier:(e.attrs.refLabel??``).toLowerCase(),label:e.attrs.refLabel,referenceType:r,children:n}}),a.escapeMark&&(r.escapeMark=(e,t,n)=>{for(let e of n)if(e.type===`text`&&e.value){let t=e;t.data??={},t.data.escapedChars??=[];for(let e=0;e<t.value.length;e++)t.data.escapedChars.push({offset:e,char:t.value[e]})}return n.length===1?n[0]:n}),a.sourceLiteral&&(r.sourceLiteral=(e,t,n)=>{let r=typeof e.attrs.sourceRaw==`string`?e.attrs.sourceRaw:``;if(n.length===1&&n[0]?.type===`text`){let e=n[0],t=r||e.value;return KZ(t,e.value)&&(e.data??={},e.data.sourceRaw=t),e}return{type:`text`,value:n.filter(e=>e.type===`text`).map(e=>e.value??``).join(``)||r}}),{nodeHandlers:n,markHandlers:r}}var o5={default:!0,MD013:!1};function s5(e){return e??o5}function c5(e){let t=e.replace(/\\/g,`/`);for(;t.startsWith(`./`);)t=t.slice(2);let n=t.toLowerCase();for(let e of jX)if(n.endsWith(e))return t.slice(0,-e.length);return t}function l5(e){let t=(e===void 0?[]:Array.isArray(e)?e:[e]).map(e=>e.trim()).filter(e=>e.length>0),n=[],r=[],i=[],a=[],o=0;for(let e of t){let t=e.startsWith(`!`),s=t?e.slice(1):e;if(t||(o+=1),s.length===0){n.push({pattern:e,detail:`empty pattern`});continue}try{let e=(0,cV.default)(s,{dot:!0,strictBrackets:!0});(t?a:i).push(e)}catch(t){n.push({pattern:e,detail:t instanceof Error?t.message:String(t)});continue}if(s.endsWith(`/`))r.push({pattern:e,reason:`trailing-slash`});else if(s.startsWith(`/`))r.push({pattern:e,reason:`leading-slash`});else{let t=s.toLowerCase();jX.some(e=>t.endsWith(e))&&r.push({pattern:e,reason:`doc-extension`})}}let s=o===0;return{invalidPatterns:n,suspiciousPatterns:r,matches(e){if(e===void 0||e===``)return!1;let t=c5(e);return t===``||!(s||i.some(e=>e(t)))?!1:!a.some(e=>e(t))}}}function Yae(e,t){if(t.length===0)return[];let n=(e===void 0?[]:Array.isArray(e)?e:[e]).map(e=>e.trim()).filter(e=>e.length>0),r=t.map(c5).filter(e=>e!==``),i=[];for(let e of n){let t=e.startsWith(`!`)?e.slice(1):e;if(t.length===0)continue;let n;try{n=(0,cV.default)(t,{dot:!0,strictBrackets:!0})}catch{continue}r.some(e=>n(e))||i.push(e)}return i}var u5=/[*?[\]{}()+@!|]/;function Xae(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);if(n===-1||e.indexOf(`{`,t+1)!==-1||e.indexOf(`}`,n+1)!==-1)return null;let r=e.slice(t+1,n).split(`,`);return r.length<2||r.some(e=>e.trim()===``||u5.test(e))?null:r.map(r=>e.slice(0,t)+r+e.slice(n+1))}function d5(e){if(e.endsWith(`/`)||e.startsWith(`/`))return{kind:`matches-nothing`,pattern:e};try{(0,cV.default)(e,{dot:!0,strictBrackets:!0})}catch{return{kind:`invalid`,pattern:e}}if(e===`**`||e===`**/*`)return{kind:`everything`};{let t=e.match(/^\*\*\/(.+)\/\*\*$/)?.[1];if(t!==void 0&&!u5.test(t))return{kind:`folder-anywhere`,folder:t};let n=e.match(/^(.+)\/\*\*\/(.+)\/\*\*$/),r=n?.[1],i=n?.[2];if(r!==void 0&&i!==void 0&&!u5.test(r)&&!u5.test(i))return{kind:`folder-recursive-nested`,root:r,folder:i}}for(let t of[`/**/*`,`/**`])if(e.endsWith(t)){let n=e.slice(0,-t.length);if(n.length>0&&!u5.test(n))return{kind:`folder-recursive`,folder:n}}if(e.endsWith(`/*`)){let t=e.slice(0,-2);if(t.length>0&&!u5.test(t))return{kind:`folder-direct`,folder:t}}if(e.startsWith(`**/`)){let t=e.slice(3);if(t.length>0&&!t.includes(`/`)&&!u5.test(t))return{kind:`name-anywhere`,name:t}}return u5.test(e)?{kind:`pattern`,pattern:e}:{kind:`exact`,target:e}}function Zae(e){let t=d5(e);if(t.kind!==`pattern`)return[t];let n=Xae(e);if(n!==null){let e=n.map(d5);if(e.every(e=>e.kind!==`pattern`))return e}return[t]}function Qae(e){let t=(e===void 0?[]:Array.isArray(e)?e:[e]).map(e=>e.trim()).filter(e=>e.length>0),n=[],r=[];for(let e of t){let t=e.startsWith(`!`),i=t?e.slice(1):e;i.length!==0&&(t?r:n).push(...Zae(i))}return{includes:n,excludes:r}}function f5(e,t){let n=new Set,r=[];for(let i of e){if(i.enabled===!1||!i.schema||!l5(i.appliesTo).matches(t))continue;let e=i.key??i.file;n.has(e)||(n.add(e),r.push({file:i.file,schema:i.schema}))}return r}var p5={"draft-06":`http://json-schema.org/draft-06/schema#`,"draft-07":`http://json-schema.org/draft-07/schema#`,"2019-09":`https://json-schema.org/draft/2019-09/schema`,"2020-12":`https://json-schema.org/draft/2020-12/schema`},$ae=Object.keys(p5),eoe=`draft-07`,toe=new Map($ae.map(e=>[m5(p5[e]),e]));function m5(e){return e.replace(/^https?:\/\//,``).replace(/#$/,``)}function noe(e){let t=e.$schema;return t===void 0?eoe:typeof t==`string`?toe.get(m5(t))??null:null}var h5=new Map;function roe(e){throw Error(`Unhandled FrontmatterSchemaDialect: ${JSON.stringify(e)}`)}function ioe(e){let t=h5.get(e);if(t)return t;let n={allErrors:!0,strict:!1},r;switch(e){case`2020-12`:r=new oV.default(n);break;case`2019-09`:r=new aV.default(n);break;case`draft-06`:case`draft-07`:r=new iV.default(n);break;default:return roe(e)}return(0,sV.default)(r),h5.set(e,r),r}function aoe(e){let{$schema:t,...n}=e;return n}function ooe(e,t){let n=ioe(e),r=t.$id;return typeof r==`string`&&r!==``&&n.removeSchema(r),n.compile(aoe(t))}var g5=new Map,soe=256;function coe(e){let t=JSON.stringify(e),n=g5.get(t);if(n!==void 0)return n;let r=null,i=noe(e);if(i!==null)try{r=ooe(i,e)}catch{r=null}return g5.size>=soe&&g5.clear(),g5.set(t,r),r}function loe(e){let t=new Map;if(!om.test(e))return{data:{},keyLines:t};let{frontmatter:n}=cm(e),r=um(n);if(r.trim()===``)return{data:{},keyLines:t};let i=pu(r,{uniqueKeys:!1});if(i.errors.length>0)return{data:{},keyLines:t};let a=i.toJS();if(typeof a!=`object`||!a||Array.isArray(a))return{data:{},keyLines:t};if(Ko(i.contents))for(let e of i.contents.items){let n=e.key;if(!Jo(n)||typeof n.value!=`string`||!n.range)continue;let i=0,a=Math.min(n.range[0],r.length);for(let e=0;e<a;e++)r.charCodeAt(e)===10&&i++;t.has(n.value)||t.set(n.value,i+1)}return{data:a,keyLines:t}}function uoe(e){if(e===void 0)return``;let t;if(typeof e==`string`)t=`"${e}"`;else try{t=JSON.stringify(e)??String(e)}catch{t=String(e)}return t.length>60&&(t=`${t.slice(0,57)}…`),` (got ${t})`}function doe(e){if(!e.startsWith(`/`))return null;let t=e.slice(1).split(`/`)[0]??``;return t===``?null:t.replace(/~1/g,`/`).replace(/~0/g,`~`)}function foe(e){return e.split(`/`).slice(1).map(e=>e.replace(/~1/g,`/`).replace(/~0/g,`~`)).join(`.`)}function _5(e,t,n){if(t.length===0)return[];let r=n?.source??`frontmatter`,{data:i,keyLines:a}=loe(e),o=e.split(`
|
|
569
|
-
`),s=e=>({start:{line:e,character:0},end:{line:e,character:o[e]?.length??0}}),c=[];for(let{schema:e,ruleId:n}of t){let t=
|
|
570
|
-
`),i=hoe(t);return n.map(e=>_oe(e,r,goe(e,i)))}function hoe(e){let t=new Map;return Object.entries(e).forEach(([e,n],r)=>{let i=e.toUpperCase();if(i===`DEFAULT`)return;let a=null;if(n===`error`||n===`warning`)a=n;else if(typeof n==`object`&&n&&!Array.isArray(n)){let e=n.severity;(e===`error`||e===`warning`)&&(a=e)}a!==null&&t.set(i,{entryIndex:r,severity:a})}),t}function goe(e,t){let n;for(let r of e.ruleNames){let e=t.get(r.toUpperCase());e!==void 0&&(n===void 0||e.entryIndex>n.entryIndex)&&(n=e)}return n?.severity??`warning`}function _oe(e,t,n){let[r,i]=e.errorRange??[1,null],a=e.lineNumber-1,o=(r??1)-1,s=t[a]?.length??0,c=i==null?s:Math.min(o+i,s),l=e.fixInfo?[voe(e.fixInfo,e.lineNumber,t)]:void 0;return{range:{start:{line:a,character:o},end:{line:a,character:Math.max(c,o)}},severity:n,source:`markdownlint`,code:e.ruleNames[0]??`MD000`,message:e.errorDetail?`${e.ruleDescription}: ${e.errorDetail}`:e.ruleDescription,...l?{fixes:l}:{}}}function voe(e,t,n){let r=e.lineNumber??t,i=r-1;if(e.deleteCount===-1){if(r<n.length)return{range:{start:{line:i,character:0},end:{line:i+1,character:0}},newText:``};if(i>0){let e=n[i-1]?.length??0;return{range:{start:{line:i-1,character:e},end:{line:i,character:n[i]?.length??0}},newText:``}}return{range:{start:{line:0,character:0},end:{line:0,character:n[0]?.length??0}},newText:``}}let a=(e.editColumn??1)-1;return{range:{start:{line:i,character:a},end:{line:i,character:a+Math.max(0,e.deleteCount??0)}},newText:e.insertText??``}}var y5=[`no-wiki-links`,`log-shape`,`index-shape`,`reserved-casing`,`frontmatter-required`,`frontmatter-recommended`,`frontmatter-provenance`,`frontmatter-computation`,`frontmatter-reserved-index`,`frontmatter-root-index`,`project-no-mdx`];function b5(e,t){return e?.[t]!==!1}var yoe=[{id:`structure`,ids:[`no-wiki-links`,`log-shape`,`index-shape`,`reserved-casing`]},{id:`frontmatter`,ids:[`frontmatter-required`,`frontmatter-recommended`,`frontmatter-provenance`,`frontmatter-computation`,`frontmatter-reserved-index`,`frontmatter-root-index`]},{id:`project`,ids:[`project-no-mdx`]}];function boe(e){throw Error(`Unhandled OkfRuleId variant: ${JSON.stringify(e)}`)}function xoe(e){throw Error(`Unhandled OkfRuleGroupId variant: ${JSON.stringify(e)}`)}var Soe=`.ok/okf`;function Coe(e){return`${e.replace(/^frontmatter-/,``)}.schema.json`}function x5(e){return`${Soe}/${Coe(e)}`}var woe={$schema:`http://json-schema.org/draft-07/schema#`,title:`OKF v0.2 — required frontmatter`,description:"The OKF v0.2 conformance floor. A bundle is conformant when every non-reserved .md file contains a parseable YAML frontmatter block whose `type` is non-empty. This schema is the whole of that floor: a concept carrying only `type` is fully conformant. Section numbers cite OKF v0.2: https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/SPEC.md#11-conformance",type:`object`,required:[`type`],properties:{type:{type:`string`,pattern:`\\S`,description:"REQUIRED, and the only always-required key in OKF. A short string identifying the kind of concept; consumers use it for routing, filtering, and presentation. Type values are not registered centrally — pick something descriptive and self-explanatory (`BigQuery Table`, `BigQuery Dataset`, `API Endpoint`, `Metric`, `Playbook`, `Reference`, `Attested Computation`). Consumers must tolerate unknown types, typically by treating them as generic concepts. The `\\S` pattern is what makes §11 rule 2 mean what it says, and it replaces a `minLength` rather than joining one: a length check alone accepts a whitespace-only value that no consumer can route on, and having both would report one mistake twice. OKF v0.2 §4.1, §11."}}},Toe={$schema:`http://json-schema.org/draft-07/schema#`,title:`OKF v0.2 — recommended frontmatter`,description:"Shapes for the OKF v0.2 recommended keys. Every key here is optional, and nothing is constrained beyond the shape OKF states: declaring a key pins its YAML type when present (so `tags` written as a comma-separated string warns) and advertises it to agents at read time. Section numbers cite OKF v0.2: https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/SPEC.md#41-frontmatter",type:`object`,properties:{title:{type:`string`,description:`Human-readable display name. If omitted, consumers MAY derive a title from the filename. OKF v0.2 §4.1.`},description:{type:`string`,description:"A single sentence summarizing the concept. Used by `index.md` generators, search snippets, and previews. OKF v0.2 §4.1."},resource:{type:`string`,format:`uri-reference`,description:"A URI that uniquely identifies the underlying asset the concept describes. Absent for concepts that describe abstract ideas rather than physical resources. Path-valued: an absolute URL, a bundle-relative path beginning with `/`, or an ordinary relative path — hence `uri-reference`, not `uri`, which would reject `/tables/customers.md`. OKF v0.2 §4.1, §6.2."},tags:{type:`array`,items:{type:`string`},description:`A YAML list of short strings for cross-cutting categorization. Tags stay a first-class concept through this field; OKF specifies no separate per-tag file format, so a consumer that wants a tag-browsing view synthesizes one by scanning frontmatter. OKF v0.2 §3.1, §4.1.`},timestamp:{description:"LEGACY (OKF v0.1), superseded by `generated.at` in v0.2 — one of the two deliberate breaking changes. Consumers MAY fall back to it when `generated` is absent; new documents SHOULD write `generated: { by, at }` instead. Documented here so agents are told what it is and what replaced it, but deliberately left unconstrained: v0.2 does not define it as a producer field, so validating its shape would be a rule OKF no longer has. OKF v0.2 §5.2, §13.1."}}},Eoe={$schema:`http://json-schema.org/draft-07/schema#`,title:`OKF v0.2 — provenance, trust, and lifecycle frontmatter`,description:'The optional OKF v0.2 families that make "where did this come from", "how much should I trust it", and "is it still current" answerable from frontmatter alone. Every key is optional, and absence carries meaning rather than being an error: a concept with no `verified` is unverified, and a consumer must not reject it. Only `sources[].resource` and `generated.by` are required-when-their-parent-is-present, because those are the two fields OKF marks REQUIRED in this family; every other field is described but not mandated, so nothing else is enforced. Section numbers cite OKF v0.2: https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/SPEC.md#5-provenance-trust-and-lifecycle',type:`object`,properties:{sources:{type:`array`,description:"The materials this concept derives from, external or internal to the bundle. Lineage is expressed through links rather than a dedicated field: when an entry's `resource` points at another OKF concept, the derivation edge already exists in the bundle graph, so a consumer may recurse into that source's own `sources`. OKF v0.2 §5.1.",items:{type:`object`,required:[`resource`],properties:{resource:{type:`string`,description:"REQUIRED within an entry. Either a concrete artifact a consumer can follow (an absolute URL, a bundle-relative path, or a path into a `references/` subdirectory) or a population or scope descriptor it cannot, for example `all queries in BigQuery project X`. Deliberately NOT format-constrained: a scope descriptor is prose, so a `uri-reference` check here would warn on conformant documents. OKF v0.2 §5.1, §6.2, §6.3."},id:{type:`string`,description:"Optional. A stable key used to attribute individual claims: a markdown footnote whose label is this id (`[^ga4-schema]`) attributes the claim it follows. SHOULD be present when the body cites the source. Keyed rather than positional because agents constantly rewrite these documents — a positional index misattributes silently the moment the list is reordered. OKF v0.2 §5.1."},title:{type:`string`,description:`Optional. Human-readable label for the source. OKF v0.2 §5.1.`},author:{type:`string`,description:"Optional credibility signal — an authority signal: who or what produced the source. OKF describes this as following the actor convention (§7), but its own examples use a `team:<id>` prefix that the three §7 forms do not cover, so no pattern is enforced. OKF v0.2 §5.1, §7."},usage_count:{type:`integer`,description:"Optional credibility signal — an adoption and liveness signal: how often `resource` was exercised (dashboard views, query executions, page reads) over `usage_window`. For a single artifact it is that artifact's own exercise count; for a scope descriptor it is the number of exercises within the scope that touch the concept. Coarse by design: comparable at the alive-versus-dead and order-of-magnitude level and against a source's own history, but not a precise cross-kind ranking. Read as liveness and trend, not as a score. OKF v0.2 §5.1."},last_modified:{type:`string`,format:`date`,description:"Optional credibility signal — a recency signal: when the source itself last changed, as `YYYY-MM-DD`. Distinct from `generated.at`, which records when the concept was written. OKF v0.2 §5.1."},usage_window:{type:`object`,description:"Optional per-entry override of the `usage_window` written as a sibling of `sources`. OKF v0.2 §5.1.",properties:{from:{type:`string`,format:`date`,description:"Start of the window framing this entry's `usage_count`, as `YYYY-MM-DD`. OKF v0.2 §5.1."},to:{type:`string`,format:`date`,description:"End of the window framing this entry's `usage_count`, as `YYYY-MM-DD`. OKF v0.2 §5.1."}}}}}},usage_window:{type:`object`,description:"Written once as a sibling of `sources`, this frames every `usage_count` in the list with a `{ from, to }` date range. A single entry may carry its own `usage_window` to override it. OKF v0.2 §5.1.",properties:{from:{type:`string`,format:`date`,description:"Start of the shared usage window, as `YYYY-MM-DD`. OKF v0.2 §5.1."},to:{type:`string`,format:`date`,description:"End of the shared usage window, as `YYYY-MM-DD`. OKF v0.2 §5.1."}}},generated:{type:`object`,required:[`by`],description:"How the current content was produced. Kept distinct from `verified` because who wrote a concept need not be who confirmed it. OKF v0.2 §5.2.",properties:{by:{type:`string`,description:"REQUIRED within `generated`. An actor in the OKF convention: `<producer>/<version>` for agents and tools (`reference_agent/gemini-2.5-pro`), `human:<id>` for a person (`human:ahormati`), or `process:<id>` for an automated process (`process:finance-nightly`). Consumers that classify trust key off the `human:` prefix, so producers MUST use it for hand-authored or human-confirmed content — a rule about which form to pick for which content, which frontmatter alone cannot check, so the three forms are documented here rather than enforced by a pattern. OKF v0.2 §5.2, §7."},at:{type:`string`,format:`date-time`,description:"An ISO 8601 datetime marking the content's last meaningful change. Consumers use it to tell a recent edit from a stale fact. Supersedes v0.1's top-level `timestamp`. OKF v0.2 §5.2, §13.1."}}},verified:{description:'Who or what has confirmed the content against its sources or `resource` — a list of verification events. Multiple entries capture independent checks, for example a human sign-off plus a nightly process; "how recently" is the latest `at`. Independent of `generated.at`: content can change without re-confirmation, and facts can be re-confirmed without regeneration. A single verifier MAY be written as one bare `{ by, at }` mapping without the list dash, and consumers MUST treat that as a one-element list — hence the two accepted shapes here. Absence means unverified, which is a valid state, never a rejection. OKF v0.2 §5.2, §5.3, §11.',anyOf:[{type:`object`,description:`The bare single-verifier mapping form. OKF v0.2 §5.2.`,properties:{by:{type:`string`,description:"The verifying actor: `<producer>/<version>`, `human:<id>`, or `process:<id>`. A `human:` verifier is what raises the trust tier to human-reviewed; non-human verifiers alone yield machine-confirmed. OKF v0.2 §5.2, §5.3, §7."},at:{type:`string`,format:`date-time`,description:`ISO 8601 datetime of the verification event. OKF v0.2 §5.2.`}}},{type:`array`,description:`The list form: one entry per independent verification event. OKF v0.2 §5.2.`,items:{type:`object`,properties:{by:{type:`string`,description:"The verifying actor: `<producer>/<version>`, `human:<id>`, or `process:<id>`. A `human:` verifier is what raises the trust tier to human-reviewed; non-human verifiers alone yield machine-confirmed. OKF v0.2 §5.2, §5.3, §7."},at:{type:`string`,format:`date-time`,description:`ISO 8601 datetime of the verification event. OKF v0.2 §5.2.`}}}}]},status:{enum:[`draft`,`stable`,`deprecated`],description:"Lifecycle state. `draft` = not yet reviewed, possibly incomplete. `stable` = ready for consumption. `deprecated` = kept for links and history, no longer current. Absent means `stable`, so the key is only worth writing to say draft or deprecated. These three values are the whole set OKF defines, which is why this is the pack's only enum. OKF v0.2 §5.4."},stale_after:{type:`string`,format:`date`,description:"An absolute date, `YYYY-MM-DD`: the concept is stale when `today >= stale_after`. Absolute rather than a relative TTL so staleness stays a plain date comparison with no reference to when the concept was read. A date in the past is a freshness signal for consumers, not a violation. OKF v0.2 §5.5, §10.5."}}},Doe={$schema:`http://json-schema.org/draft-07/schema#`,title:`OKF v0.2 — Attested Computation frontmatter`,description:'Shapes for the OKF v0.2 computation keys, which turn a concept into a sanctioned way to compute a value so a consumer can confirm the agent ran the blessed computation instead of improvising its own. Provenance answers "where did this claim come from"; attestation answers "was this number produced the way we said it must be". This file also carries the one value-shaped rule in the pack: `runtime` is the single key OKF marks REQUIRED here, and only when `type` is `Attested Computation`. Ordinary concepts never match that condition and are unaffected, and no other key in the family is mandated. OKF records the computation and the means to check it and executes nothing itself; receipts and verdicts are runtime artifacts that are never stored in the bundle. Section numbers cite OKF v0.2: https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/SPEC.md#10-attested-computations-concept',type:`object`,if:{required:[`type`],properties:{type:{const:`Attested Computation`,description:"The condition, not a constraint: everything in `then` applies only to documents whose `type` is exactly `Attested Computation`. An ordinary concept never matches, so nothing in this schema is ever asked of it. `type` is also required inside the condition so a document with no type at all fails the conformance floor once, rather than also being told it is missing a `runtime` for a type it never claimed."}}},then:{required:[`runtime`]},properties:{runtime:{type:`string`,description:"REQUIRED for `type: Attested Computation`. The single field that says how to run the computation, and therefore how the executor and attester interpret it and what `parameters` mean — a parameter is a SQL bind variable, a dbt var, or a Python argument depending on the runtime. Keeping `runtime` and `parameters` in one frontmatter is what makes the binding semantics self-evident. Example values: `bigquery`, `postgres`, `dbt`, `python`, `Looker`. Not a closed set, so no enum. OKF v0.2 §10.1, §10.2."},parameters:{type:`array`,description:`The typed, named holes the agent may fill. An agent MAY only supply values for these parameters; it MUST NOT author or edit the computation. That parameter-only surface is what makes "did the sanctioned thing run" a mechanical comparison rather than a judgement call. OKF v0.2 §10.2, §10.3.`,items:{type:`object`,properties:{name:{type:`string`,description:"The parameter name the computation binds, for example `year` bound as `@year` in BigQuery SQL or `{{ var('year') }}` in dbt. OKF v0.2 §10.2, §10.3."},type:{type:`string`,description:"The parameter's type, interpreted by `runtime` (`integer`, `string`, and so on). Deliberately not constrained to JSON Schema type names, because the vocabulary belongs to the runtime. OKF v0.2 §10.2."},required:{type:`boolean`,description:`Whether the agent must supply a value for this parameter. OKF v0.2 §10.2.`}}}},computation:{type:`string`,format:`uri-reference`,description:"Optional. A path to a file holding the computation, used instead of an inline body fence — best for a long or generated computation, or one already kept as a real file shared with non-OKF tooling. When absent, the body's `# Computation` fence IS the computation. Path-valued: an absolute URL, a bundle-relative path beginning with `/`, or a relative path. OKF v0.2 §6.2, §10.2, §10.3."},executor:{type:`object`,description:"How the computation is run. A runner — an agent, or deterministic consumer code — follows `resource`, and the run returns a receipt shaped by `receipt`. Binding the computation with the parameter values into the executable artifact is the consumer's job. OKF v0.2 §10.2, §10.5.",properties:{resource:{type:`string`,format:`uri-reference`,description:"Names the run instructions or code. What sits behind it — a Skill, a script, a container — is a packaging choice; OKF fixes the interface, not the packaging. Conventionally points into a `references/` subdirectory, for example `references/skills/run-on-bq.md`. OKF v0.2 §1, §6.2, §6.3, §10.2."},receipt:{type:`array`,items:{type:`string`},description:"Declares the fields a run must return — the evidence the attester inspects, for example `[job_id, executed_sql, result]` for BigQuery or `[run_id, compiled_sql, result]` for dbt. Because the attester compares the expanded, compiled artifact the receipt carries, a rewritten query, a swapped computation file, or a mutated dependency fails the check. The receipt itself is a runtime artifact and is never stored in the bundle. OKF v0.2 §10.2, §10.3, §10.5."}}},attester:{type:`object`,description:"The deterministic check that inspects a receipt and returns a verdict. Meant to run consumer-side. Distinct from `verified`: `verified` confirms the definition still matches policy and is recorded in the bundle, while attestation confirms a single run produced the value the sanctioned way and is not stored. OKF v0.2 §10.2, §10.6.",properties:{resource:{type:`string`,format:`uri-reference`,description:"Names code — no LLM — that takes a receipt and returns a verdict, independently re-deriving the binding of `computation` with the claimed parameter values to compare against what actually ran. Conventionally points into a `references/` subdirectory, for example `references/attesters/sql-equality.py`. OKF v0.2 §6.2, §6.3, §10.2, §10.3."}}}}},Ooe={$schema:`http://json-schema.org/draft-07/schema#`,title:`OKF v0.2 — index files carry no frontmatter`,description:"`index.md` is a reserved filename at any level of the hierarchy and must not be used for a concept document. Index files contain no frontmatter, with exactly one exception — a bundle-root `index.md` may carry `okf_version` — which the scope carves out with a `!index` exclusion rather than a keyword here. `maxProperties: 0` is the mechanism rather than the boolean schema `false`, because a document with no frontmatter block validates as `{}` and `false` would reject that too, flagging the very documents that are correct. `log.md` is deliberately NOT covered: §9 constrains a log's date headings, ordering, and prose entries but never its frontmatter, and OKF's own reference bundle ships a `log.md` carrying `type` and `title`. Section numbers cite OKF v0.2: https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/SPEC.md#8-index-files",type:`object`,maxProperties:0},koe={$schema:`http://json-schema.org/draft-07/schema#`,title:`OKF v0.2 — bundle-root index.md`,description:"The bundle-root `index.md` is the only index file OKF permits frontmatter in, and `okf_version` is the key it names there. OKF states the declaration as a MAY, so it is not required here. Nor is the frontmatter closed to other keys: §8 grants the exception for `okf_version` specifically, but §11 tells consumers not to reject a bundle over unknown additional keys, and that ambiguity is resolved in favor of the looser reading. The one thing pinned is the value's shape, because a YAML float is provably lossy where a version string is not. Section numbers cite OKF v0.2: https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/SPEC.md#12-versioning",type:`object`,properties:{okf_version:{type:`string`,pattern:`^[0-9]+\\.[0-9]+$`,description:'The OKF version this bundle targets, as `<major>.<minor>` — currently `"0.2"`. Quote it: unquoted `0.2` parses as a YAML number, so a consumer comparing version strings sees a float instead, and `0.10` would silently become `0.1`. A minor bump is backward-compatible additions; a major bump may rename required fields or change reserved filenames. Consumers that do not understand the declared version should attempt best-effort consumption rather than refusing the bundle. OKF v0.2 §12.'}}},S5=[`**`,`!**/{index,log}`],C5=[{id:`frontmatter-required`,appliesTo:S5,schema:woe},{id:`frontmatter-recommended`,appliesTo:S5,schema:Toe},{id:`frontmatter-provenance`,appliesTo:S5,schema:Eoe},{id:`frontmatter-computation`,appliesTo:S5,schema:Doe},{id:`frontmatter-reserved-index`,appliesTo:[`**/index`,`!index`],schema:Ooe},{id:`frontmatter-root-index`,appliesTo:[`index`],schema:koe}],Aoe=Object.fromEntries(y5.filter(e=>!C5.some(t=>t.id===e)).map(e=>[e,!1]));function w5(e,t){return t===void 0?[]:C5.filter(n=>b5(e,n.id)&&l5([...n.appliesTo]).matches(t))}function joe(e){return C5.filter(t=>b5(e,t.id)).map(e=>({appliesTo:[...e.appliesTo],file:x5(e.id)}))}function Moe(e,t,n){let r=w5(t,n);return r.length===0?[]:_5(e,r.map(e=>({file:x5(e.id),schema:e.schema,ruleId:e.id})),{source:`okf`})}function T5(e,t){return nG(`okf:${e}`,(n,r)=>{try{t(n,r)}catch(t){console.warn(`[lint] OKF rule "${e}" failed${r.data.okfDocName?` on "${r.data.okfDocName}"`:``}`,t)}})}function E5(e,t,n){let r=l5(t);return T5(e,(e,t)=>{r.matches(t.data.okfDocName)&&n(e,t)})}var D5=e=>({line:e.line-1,character:e.column-1});function Noe(e,t){if(e&&`start`in e)return{start:D5(e.start),end:D5(e.end)};if(e){let n=D5(e);return{start:n,end:{line:n.line,character:t[n.line]?.length??0}}}return{start:{line:0,character:0},end:{line:0,character:t[0]?.length??0}}}function Poe(e,t){return{range:Noe(e.place,t),severity:`warning`,source:`okf`,code:e.ruleId??`okf`,message:e.reason}}function Foe(e,t,n){if(t.length===0)return[];let r=Se().use(ie).use(O).use(VP,[`yaml`]);for(let e of t)r.use(e);let i=new _({value:e});n!==void 0&&(i.data.okfDocName=n);let a=r.parse(i);r.runSync(a,i);let o=e.split(`
|
|
571
|
-
`);return i.messages.map(e=>
|
|
572
|
-
`?(c+=1,l=1):l+=1;return{line:c,column:l}};for(let e of o.matchAll(Woe)){let{index:i}=e;if((a===void 0?o[i-1]:n[a+i-1])===`!`)continue;let s=r&&a!==void 0?{start:u(i),end:u(i+e[0].length)}:void 0;t.message(Goe(e[0]),s)}})}),qoe=[`index`,`log`];function Joe(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);if(n<=0)return t;let r=t.slice(n).toLowerCase();return jX.includes(r)?t.slice(0,n):t}var Yoe=T5(`reserved-casing`,(e,t)=>{let n=t.data.okfDocName;if(n===void 0)return;let r=Joe(n),i=r.toLowerCase();qoe.includes(i)&&r!==i&&t.message(`This file is named "${r}", but the Open Knowledge Format only recognizes "${i}". On a case-sensitive filesystem a consumer reads it as an ordinary concept document rather than the reserved file it is meant to be.`)}),k5=[{id:`no-wiki-links`,rule:Koe},{id:`log-shape`,rule:Uoe},{id:`index-shape`,rule:Roe},{id:`reserved-casing`,rule:Yoe}],Xoe=k5.map(e=>e.rule);function Zoe(e){return e===void 0?Xoe:k5.filter(t=>b5(e,t.id)).map(e=>e.rule)}var Qoe=Qa([F(),z(Cd),io(N(),Ka())]),$oe={id:`markdownlint`,sliceSchema:L({enabled:F(),rules:io(N(),Qoe)}),defaultSlice:{enabled:!1,rules:o5},async lint(e,t){return moe(e,s5(t.rules))},fix(e,t){return poe(e,s5(t.rules))}},ese=L({appliesTo:Qa([N(),I(N())]).optional(),file:N(),enabled:F().optional(),key:N().optional(),schema:io(N(),Ka()).optional()}),A5=[$oe,{id:`frontmatter`,sliceSchema:L({enabled:F(),schemas:I(ese)}),defaultSlice:{enabled:!1,schemas:[]},async lint(e,t,n){return _5(e,f5(t.schemas,n.docName))},frontmatter:{schemasForDoc:(e,t)=>f5(e.schemas,t),narrowSliceToFrontmatter:e=>e,advertisedMappings:e=>e.schemas}},{id:`okf`,sliceSchema:L({enabled:F(),rules:io(N(),F()).optional(),generate:L({index:F().optional()}).optional()}),defaultSlice:{enabled:!1},async lint(e,t,n){return[...Foe(e,Zoe(t.rules),n.docName),...Moe(e,t.rules,n.docName)]},frontmatter:{schemasForDoc:(e,t)=>w5(e.rules,t),narrowSliceToFrontmatter:e=>({...e,rules:{...e.rules,...Aoe}}),advertisedMappings:e=>joe(e.rules)}}],tse={enabled:!0,plugins:Object.fromEntries(A5.map(e=>[e.id,e.defaultSlice]))};function nse(e,t){if(!e?.enabled||t===void 0||t===``)return[];let n=[];for(let r of A5){if(r.frontmatter===void 0)continue;let i=e.plugins[r.id];i?.enabled===!0&&n.push(...r.frontmatter.schemasForDoc(i,t))}return n}function rse(e){let t=Object.fromEntries(A5.map(t=>{let n=e.plugins[t.id]??t.defaultSlice;return t.frontmatter===void 0?[t.id,{...n,enabled:!1}]:[t.id,t.frontmatter.narrowSliceToFrontmatter(n)]}));return{...e,plugins:t}}var ise=new Set([`.markdownlint.json`,`.markdownlint.jsonc`]);function ase(e){return ise.has(e)}L({docName:F$,summary:R$,content:N().optional(),...L$}).loose(),L({docName:F$,summary:R$,markdown:N(),position:z([`append`,`prepend`,`replace`]).optional(),extension:z(jX).optional(),...L$}).loose(),L({docName:F$,summary:R$,find:N().min(1),replace:N(),offset:P().int().nonnegative().optional(),...L$}).loose(),L({docName:F$,connectionId:N().min(1),scope:z([`last`,`session`,`file`,`count`]).optional(),count:P().int().positive().optional(),...L$}).loose().refine(e=>e.scope!==`count`||e.count!==void 0,{message:`count is required when scope is 'count'`,path:[`count`]});var j5=L({value:N(),truncatedFrom:P().int().nonnegative().optional(),hint:N().optional()}).loose(),ose=eo(`kind`,[L({kind:B(`inline`),content:N()}),L({kind:B(`truncated`),byteLength:P().int().nonnegative(),hint:N()})]),M5=L({kind:B(`content-divergence`),intendedBytes:P().int().nonnegative(),actualBytes:P().int().nonnegative(),byteDelta:P().int(),divergenceType:N().optional(),currentState:ose.optional(),hint:N().optional()}).loose(),sse=L({type:B(`orphan`),parentCandidates:I(N()),message:N()}).loose(),N5=L({kind:B(`disk-edit-reconciled`),intendedBytes:P().int().nonnegative(),actualBytes:P().int().nonnegative(),byteDelta:P().int(),mergeOutcome:N().optional(),hint:N().optional()}).loose(),P5=eo(`kind`,[M5,N5]),cse=L({kind:B(`mermaid-parse-error`),fenceIndex:P().int().positive(),fenceFirstLine:N(),message:N(),line:P().int().positive().optional()}).loose(),F5=L({href:N(),targetKind:N(),role:N(),sourceForm:N(),resolvedTarget:N().nullable(),reason:N(),resolutionMethod:N(),fallbackTarget:N().nullable().optional(),definition:L({line:P().int().nonnegative(),label:N()}).loose().optional()}).loose(),I5=I(eo(`kind`,[M5,N5,cse,L({kind:B(`lint-violation`),source:N(),code:N(),message:N(),severity:z([`error`,`warning`,`info`,`hint`]),line:P().int().positive(),column:P().int().positive(),linkTarget:N().optional(),localTarget:F5.optional()}).loose()])).min(1),L5=I(L({href:N(),resolvedTo:N().nullable(),reason:z([`no-such-doc`,`no-such-file`,`unresolvable`]),localTarget:F5.optional()}).loose());L({timestamp:N().min(1),summary:j5.optional(),warning:P5.optional(),warnings:I5.optional()}).loose(),L({timestamp:N().min(1),subscriberCount:P().int().nonnegative(),systemSubscriberCount:P().int().nonnegative(),hints:I(sse).optional(),summary:j5.optional(),warning:P5.optional(),warnings:I5.optional(),brokenLinks:L5}).loose(),L({timestamp:N().min(1),subscriberCount:P().int().nonnegative(),systemSubscriberCount:P().int().nonnegative(),summary:j5.optional(),warning:P5.optional(),warnings:I5.optional(),brokenLinks:L5}).loose(),L({docName:N().min(1),scope:z([`last`,`session`,`count`]),undone:F()}).loose(),L({docs:I(L({docName:I$,markdown:N(),position:z([`append`,`prepend`,`replace`]).optional(),extension:z(jX).optional(),summary:R$}).loose()).min(1).max(100),...L$}).loose();var lse=L({type:i1,title:N(),detail:N().optional()}).loose(),use=eo(`status`,[L({status:B(`written`),docName:N().min(1),summary:j5.optional(),warnings:I5.optional(),brokenLinks:L5}).loose(),L({status:B(`error`),docName:N().min(1),error:lse}).loose()]);L({timestamp:N().min(1),results:I(use),written:P().int().nonnegative(),failed:P().int().nonnegative()}).loose(),L({docName:F$,patch:io(N(),Qa([hm,Wa()])),types:io(N(),z(fm)).optional(),summary:R$,...L$}).loose(),L({timestamp:N().min(1),subscriberCount:P().int().nonnegative(),systemSubscriberCount:P().int().nonnegative(),appliedKeys:I(N()),summary:j5.optional(),warning:P5.optional(),warnings:I5.optional(),brokenLinks:L5}).loose();function dse(e){return{enabled:e.enabled??!0,plugins:{markdownlint:{...e.markdownlint,rules:e.markdownlint.rules??o5},frontmatter:{enabled:e.frontmatter?.enabled??!1,schemas:e.frontmatter?.schemas??[]},okf:{enabled:e.okf?.enabled??!1,...e.okf?.rules===void 0?{}:{rules:e.okf.rules},generate:{index:e.okf?.generate?.index??!1}}}}}var fse=Object.fromEntries(A5.map(e=>[e.id,e.sliceSchema])),pse=L({effective:L({enabled:F(),plugins:L(fse)}),configFile:N().nullable().optional(),configProblems:I(N()).optional()}),mse=Qa([F(),io(N(),Ka())]);L({ruleId:N().min(1).max(64).regex(/^[A-Za-z][A-Za-z0-9_-]*$/),value:Qa([mse,Wa()])}),L({file:N().min(1).max(512),delete:B(!0).optional(),field:N().min(1).max(256).optional(),parentPath:I(Qa([N().min(1).max(256),L({items:B(!0)}).strict()])).max(8).optional(),removeField:B(!0).optional(),renameTo:N().min(1).max(256).optional(),constraint:L({type:z([`string`,`number`,`boolean`,`array`,`object`]).nullable().optional(),enum:I(Qa([N(),P(),F()])).nullable().optional(),itemsEnum:I(Qa([N(),P(),F()])).nullable().optional(),itemsType:z([`string`,`number`,`boolean`,`object`]).nullable().optional(),pattern:N().nullable().optional(),format:N().nullable().optional(),description:N().max(2048).nullable().optional(),required:F().optional()}).optional()}).refine(e=>e.delete===void 0||e.field===void 0&&e.constraint===void 0&&e.removeField===void 0&&e.renameTo===void 0,{message:`delete cannot be combined with a field edit`}).refine(e=>[e.constraint,e.removeField,e.renameTo].filter(e=>e!==void 0).length<=1,{message:`constraint, removeField, and renameTo are mutually exclusive`}).refine(e=>e.removeField===void 0&&e.renameTo===void 0||e.field!==void 0,{message:`removeField and renameTo require field`}).refine(e=>e.parentPath===void 0||e.field!==void 0,{message:`parentPath requires field`}).refine(e=>e.field===void 0?e.constraint===void 0:e.constraint!==void 0||e.removeField!==void 0||e.renameTo!==void 0,{message:`field requires constraint, removeField, or renameTo`});var hse=L({schemas:I(N()),truncated:F()}).strict(),R5=L({line:P(),character:P()}),z5=L({start:R5,end:R5}),B5=L({range:z5,severity:z([`error`,`warning`,`info`,`hint`]),source:N(),code:N(),message:N(),fixes:I(L({range:z5,newText:N()})).optional(),frontmatterScope:z(yd).optional(),frontmatterProperty:N().optional()});L({files:I(L({file:N(),diagnostics:I(B5),warnings:I(N()).optional()})),fileCount:P(),errorCount:P(),warningCount:P(),warnings:I(N())});var gse=B5.extend({linkTarget:N().optional(),localTarget:F5.optional()}),_se=L({files:I(L({file:N(),diagnostics:I(gse)})),fileCount:P(),errorCount:P(),warningCount:P(),warnings:I(N())}),V5=L({errorCount:P().int().nonnegative(),warningCount:P().int().nonnegative()}),vse=L({files:I(L({file:N(),lint:V5,links:V5})),fileCount:P().int().nonnegative(),errorCount:P().int().nonnegative(),warningCount:P().int().nonnegative(),warnings:I(N())});L({docName:F$,summary:R$,...L$}).loose();var yse=L({file:N(),fixedCount:P(),diagnostics:I(B5),errorCount:P(),warningCount:P(),warning:N().optional()});function bse(e){let t=e.trim().replace(/^\.\//,``);if(!t.startsWith(`.ok/schemas/`))return!1;let n=t.slice(12);return n.length>0&&!n.includes(`/`)&&!n.includes(`\\`)&&n!==`.`&&n!==`..`}function xse(e){let t=e.trim().toLowerCase().split(`/`).pop()??``;return t.endsWith(`.schema.json`)&&t.length>12?!0:bse(e)&&t.endsWith(`.json`)}var H5=[{id:`MD001`,alias:`heading-increment`,aliases:[`heading-increment`],name:`Heading levels should only increment by one level at a time`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md001.md`,tags:[`headings`],options:[{key:`front_matter_title`,type:`string`,description:`RegExp for matching title in front matter`,default:`^\\s*title\\s*[:=]`}]},{id:`MD003`,alias:`heading-style`,aliases:[`heading-style`],name:`Heading style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md003.md`,tags:[`headings`],options:[{key:`style`,type:`enum`,description:`Heading style`,enum:[`consistent`,`atx`,`atx_closed`,`setext`,`setext_with_atx`,`setext_with_atx_closed`],default:`consistent`}]},{id:`MD004`,alias:`ul-style`,aliases:[`ul-style`],name:`Unordered list style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md004.md`,tags:[`bullet`,`ul`],options:[{key:`style`,type:`enum`,description:`List style`,enum:[`consistent`,`asterisk`,`plus`,`dash`,`sublist`],default:`consistent`}]},{id:`MD005`,alias:`list-indent`,aliases:[`list-indent`],name:`Inconsistent indentation for list items at the same level`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md005.md`,tags:[`bullet`,`ul`,`indentation`],options:[]},{id:`MD007`,alias:`ul-indent`,aliases:[`ul-indent`],name:`Unordered list indentation`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md007.md`,tags:[`bullet`,`ul`,`indentation`],options:[{key:`indent`,type:`integer`,description:`Spaces for indent`,default:2,minimum:1},{key:`start_indented`,type:`boolean`,description:`Whether to indent the first level of the list`,default:!1},{key:`start_indent`,type:`integer`,description:`Spaces for first level indent (when start_indented is set)`,default:2,minimum:1}]},{id:`MD009`,alias:`no-trailing-spaces`,aliases:[`no-trailing-spaces`],name:`Trailing spaces`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md009.md`,tags:[`whitespace`],options:[{key:`br_spaces`,type:`integer`,description:`Spaces for line break`,default:2,minimum:0},{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!1},{key:`list_item_empty_lines`,type:`boolean`,description:`Allow spaces for empty lines in list items`,default:!1},{key:`strict`,type:`boolean`,description:`Include unnecessary breaks`,default:!1}]},{id:`MD010`,alias:`no-hard-tabs`,aliases:[`no-hard-tabs`],name:`Hard tabs`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md010.md`,tags:[`whitespace`,`hard_tab`],options:[{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!0},{key:`ignore_code_languages`,type:`string-array`,description:`Fenced code languages to ignore`,default:[]},{key:`spaces_per_tab`,type:`integer`,description:`Number of spaces for each hard tab`,default:1,minimum:0}]},{id:`MD011`,alias:`no-reversed-links`,aliases:[`no-reversed-links`],name:`Reversed link syntax`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md011.md`,tags:[`links`],options:[]},{id:`MD012`,alias:`no-multiple-blanks`,aliases:[`no-multiple-blanks`],name:`Multiple consecutive blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md012.md`,tags:[`whitespace`,`blank_lines`],options:[{key:`maximum`,type:`integer`,description:`Consecutive blank lines`,default:1,minimum:1}]},{id:`MD013`,alias:`line-length`,aliases:[`line-length`],name:`Line length`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md013.md`,tags:[`line_length`],options:[{key:`line_length`,type:`integer`,description:`Number of characters`,default:80,minimum:1},{key:`heading_line_length`,type:`integer`,description:`Number of characters for headings`,default:80,minimum:1},{key:`code_block_line_length`,type:`integer`,description:`Number of characters for code blocks`,default:80,minimum:1},{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!0},{key:`tables`,type:`boolean`,description:`Include tables`,default:!0},{key:`headings`,type:`boolean`,description:`Include headings`,default:!0},{key:`strict`,type:`boolean`,description:`Strict length checking`,default:!1},{key:`stern`,type:`boolean`,description:`Stern length checking`,default:!1}]},{id:`MD014`,alias:`commands-show-output`,aliases:[`commands-show-output`],name:`Dollar signs used before commands without showing output`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md014.md`,tags:[`code`],options:[]},{id:`MD018`,alias:`no-missing-space-atx`,aliases:[`no-missing-space-atx`],name:`No space after hash on atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md018.md`,tags:[`headings`,`atx`,`spaces`],options:[]},{id:`MD019`,alias:`no-multiple-space-atx`,aliases:[`no-multiple-space-atx`],name:`Multiple spaces after hash on atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md019.md`,tags:[`headings`,`atx`,`spaces`],options:[]},{id:`MD020`,alias:`no-missing-space-closed-atx`,aliases:[`no-missing-space-closed-atx`],name:`No space inside hashes on closed atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md020.md`,tags:[`headings`,`spaces`,`atx_closed`],options:[]},{id:`MD021`,alias:`no-multiple-space-closed-atx`,aliases:[`no-multiple-space-closed-atx`],name:`Multiple spaces inside hashes on closed atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md021.md`,tags:[`headings`,`spaces`,`atx_closed`],options:[]},{id:`MD022`,alias:`blanks-around-headings`,aliases:[`blanks-around-headings`],name:`Headings should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md022.md`,tags:[`headings`,`blank_lines`],options:[{key:`include_front_matter`,type:`boolean`,description:`Include front matter content`,default:!1},{key:`lines_above`,type:`unsupported`,description:`Blank lines above heading`,default:1},{key:`lines_below`,type:`unsupported`,description:`Blank lines below heading`,default:1}]},{id:`MD023`,alias:`heading-start-left`,aliases:[`heading-start-left`],name:`Headings must start at the beginning of the line`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md023.md`,tags:[`headings`,`spaces`],options:[]},{id:`MD024`,alias:`no-duplicate-heading`,aliases:[`no-duplicate-heading`],name:`Multiple headings with the same content`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md024.md`,tags:[`headings`],options:[{key:`siblings_only`,type:`boolean`,description:`Only check sibling headings`,default:!1}]},{id:`MD025`,alias:`single-title`,aliases:[`single-title`,`single-h1`],name:`Multiple top-level headings in the same document`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md025.md`,tags:[`headings`],options:[{key:`front_matter_title`,type:`string`,description:`RegExp for matching title in front matter`,default:`^\\s*title\\s*[:=]`},{key:`level`,type:`integer`,description:`Heading level`,default:1,minimum:1,maximum:6}]},{id:`MD026`,alias:`no-trailing-punctuation`,aliases:[`no-trailing-punctuation`],name:`Trailing punctuation in heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md026.md`,tags:[`headings`],options:[{key:`punctuation`,type:`string`,description:`Punctuation characters`,default:`.,;:!。,;:!`}]},{id:`MD027`,alias:`no-multiple-space-blockquote`,aliases:[`no-multiple-space-blockquote`],name:`Multiple spaces after blockquote symbol`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md027.md`,tags:[`indentation`,`whitespace`,`blockquote`],options:[{key:`list_items`,type:`boolean`,description:`Include list items`,default:!0}]},{id:`MD028`,alias:`no-blanks-blockquote`,aliases:[`no-blanks-blockquote`],name:`Blank line inside blockquote`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md028.md`,tags:[`whitespace`,`blockquote`],options:[]},{id:`MD029`,alias:`ol-prefix`,aliases:[`ol-prefix`],name:`Ordered list item prefix`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md029.md`,tags:[`ol`],options:[{key:`style`,type:`enum`,description:`List style`,enum:[`one`,`ordered`,`one_or_ordered`,`zero`],default:`one_or_ordered`}]},{id:`MD030`,alias:`list-marker-space`,aliases:[`list-marker-space`],name:`Spaces after list markers`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md030.md`,tags:[`ul`,`whitespace`,`ol`],options:[{key:`ul_single`,type:`integer`,description:`Spaces for single-line unordered list items`,default:1,minimum:1},{key:`ol_single`,type:`integer`,description:`Spaces for single-line ordered list items`,default:1,minimum:1},{key:`ul_multi`,type:`integer`,description:`Spaces for multi-line unordered list items`,default:1,minimum:1},{key:`ol_multi`,type:`integer`,description:`Spaces for multi-line ordered list items`,default:1,minimum:1}]},{id:`MD031`,alias:`blanks-around-fences`,aliases:[`blanks-around-fences`],name:`Fenced code blocks should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md031.md`,tags:[`blank_lines`,`code`],options:[{key:`list_items`,type:`boolean`,description:`Include list items`,default:!0}]},{id:`MD032`,alias:`blanks-around-lists`,aliases:[`blanks-around-lists`],name:`Lists should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md032.md`,tags:[`bullet`,`ul`,`blank_lines`,`ol`],options:[]},{id:`MD033`,alias:`no-inline-html`,aliases:[`no-inline-html`],name:`Inline HTML`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md033.md`,tags:[`html`],options:[{key:`allowed_elements`,type:`string-array`,description:`Allowed elements`,default:[]},{key:`table_allowed_elements`,type:`string-array`,description:`Allowed elements in tables`,default:[]}]},{id:`MD034`,alias:`no-bare-urls`,aliases:[`no-bare-urls`],name:`Bare URL used`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md034.md`,tags:[`links`,`url`],options:[]},{id:`MD035`,alias:`hr-style`,aliases:[`hr-style`],name:`Horizontal rule style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md035.md`,tags:[`hr`],options:[{key:`style`,type:`string`,description:`Horizontal rule style`,default:`consistent`}]},{id:`MD036`,alias:`no-emphasis-as-heading`,aliases:[`no-emphasis-as-heading`],name:`Emphasis used instead of a heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md036.md`,tags:[`headings`,`emphasis`],options:[{key:`punctuation`,type:`string`,description:`Punctuation characters`,default:`.,;:!?。,;:!?`}]},{id:`MD037`,alias:`no-space-in-emphasis`,aliases:[`no-space-in-emphasis`],name:`Spaces inside emphasis markers`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md037.md`,tags:[`whitespace`,`emphasis`],options:[]},{id:`MD038`,alias:`no-space-in-code`,aliases:[`no-space-in-code`],name:`Spaces inside code span elements`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md038.md`,tags:[`whitespace`,`code`],options:[]},{id:`MD039`,alias:`no-space-in-links`,aliases:[`no-space-in-links`],name:`Spaces inside link text`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md039.md`,tags:[`whitespace`,`links`],options:[]},{id:`MD040`,alias:`fenced-code-language`,aliases:[`fenced-code-language`],name:`Fenced code blocks should have a language specified`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md040.md`,tags:[`code`,`language`],options:[{key:`allowed_languages`,type:`string-array`,description:`List of languages`,default:[]},{key:`language_only`,type:`boolean`,description:`Require language only`,default:!1}]},{id:`MD041`,alias:`first-line-heading`,aliases:[`first-line-heading`,`first-line-h1`],name:`First line in a file should be a top-level heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md041.md`,tags:[`headings`],options:[{key:`allow_preamble`,type:`boolean`,description:`Allow content before first heading`,default:!1},{key:`front_matter_title`,type:`string`,description:`RegExp for matching title in front matter`,default:`^\\s*title\\s*[:=]`},{key:`level`,type:`integer`,description:`Heading level`,default:1,minimum:1,maximum:6}]},{id:`MD042`,alias:`no-empty-links`,aliases:[`no-empty-links`],name:`No empty links`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md042.md`,tags:[`links`],options:[]},{id:`MD043`,alias:`required-headings`,aliases:[`required-headings`],name:`Required heading structure`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md043.md`,tags:[`headings`],options:[{key:`headings`,type:`string-array`,description:`List of headings`,default:[]},{key:`match_case`,type:`boolean`,description:`Match case of headings`,default:!1}]},{id:`MD044`,alias:`proper-names`,aliases:[`proper-names`],name:`Proper names should have the correct capitalization`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md044.md`,tags:[`spelling`],options:[{key:`names`,type:`string-array`,description:`List of proper names`,default:[]},{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!0},{key:`html_elements`,type:`boolean`,description:`Include HTML elements`,default:!0}]},{id:`MD045`,alias:`no-alt-text`,aliases:[`no-alt-text`],name:`Images should have alternate text (alt text)`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md045.md`,tags:[`accessibility`,`images`],options:[]},{id:`MD046`,alias:`code-block-style`,aliases:[`code-block-style`],name:`Code block style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md046.md`,tags:[`code`],options:[{key:`style`,type:`enum`,description:`Block style`,enum:[`consistent`,`fenced`,`indented`],default:`consistent`}]},{id:`MD047`,alias:`single-trailing-newline`,aliases:[`single-trailing-newline`],name:`Files should end with a single newline character`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md047.md`,tags:[`blank_lines`],options:[]},{id:`MD048`,alias:`code-fence-style`,aliases:[`code-fence-style`],name:`Code fence style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md048.md`,tags:[`code`],options:[{key:`style`,type:`enum`,description:`Code fence style`,enum:[`consistent`,`backtick`,`tilde`],default:`consistent`}]},{id:`MD049`,alias:`emphasis-style`,aliases:[`emphasis-style`],name:`Emphasis style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md049.md`,tags:[`emphasis`],options:[{key:`style`,type:`enum`,description:`Emphasis style`,enum:[`consistent`,`asterisk`,`underscore`],default:`consistent`}]},{id:`MD050`,alias:`strong-style`,aliases:[`strong-style`],name:`Strong style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md050.md`,tags:[`emphasis`],options:[{key:`style`,type:`enum`,description:`Strong style`,enum:[`consistent`,`asterisk`,`underscore`],default:`consistent`}]},{id:`MD051`,alias:`link-fragments`,aliases:[`link-fragments`],name:`Link fragments should be valid`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md051.md`,tags:[`links`],options:[{key:`ignore_case`,type:`boolean`,description:`Ignore case of fragments`,default:!1},{key:`ignored_pattern`,type:`string`,description:`Pattern for ignoring additional fragments`,default:``}]},{id:`MD052`,alias:`reference-links-images`,aliases:[`reference-links-images`],name:`Reference links and images should use a label that is defined`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md052.md`,tags:[`links`,`images`],options:[{key:`ignored_labels`,type:`string-array`,description:`Ignored link labels`,default:[`x`]},{key:`shortcut_syntax`,type:`boolean`,description:`Include shortcut syntax`,default:!1}]},{id:`MD053`,alias:`link-image-reference-definitions`,aliases:[`link-image-reference-definitions`],name:`Link and image reference definitions should be needed`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md053.md`,tags:[`links`,`images`],options:[{key:`ignored_definitions`,type:`string-array`,description:`Ignored definitions`,default:[`//`]}]},{id:`MD054`,alias:`link-image-style`,aliases:[`link-image-style`],name:`Link and image style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md054.md`,tags:[`links`,`images`],options:[{key:`autolink`,type:`boolean`,description:`Allow autolinks`,default:!0},{key:`inline`,type:`boolean`,description:`Allow inline links and images`,default:!0},{key:`full`,type:`boolean`,description:`Allow full reference links and images`,default:!0},{key:`collapsed`,type:`boolean`,description:`Allow collapsed reference links and images`,default:!0},{key:`shortcut`,type:`boolean`,description:`Allow shortcut reference links and images`,default:!0},{key:`url_inline`,type:`boolean`,description:`Allow URLs as inline links`,default:!0}]},{id:`MD055`,alias:`table-pipe-style`,aliases:[`table-pipe-style`],name:`Table pipe style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md055.md`,tags:[`table`],options:[{key:`style`,type:`enum`,description:`Table pipe style`,enum:[`consistent`,`leading_only`,`trailing_only`,`leading_and_trailing`,`no_leading_or_trailing`],default:`consistent`}]},{id:`MD056`,alias:`table-column-count`,aliases:[`table-column-count`],name:`Table column count`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md056.md`,tags:[`table`],options:[]},{id:`MD058`,alias:`blanks-around-tables`,aliases:[`blanks-around-tables`],name:`Tables should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md058.md`,tags:[`table`],options:[]},{id:`MD059`,alias:`descriptive-link-text`,aliases:[`descriptive-link-text`],name:`Link text should be descriptive`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md059.md`,tags:[`links`,`accessibility`],options:[{key:`prohibited_texts`,type:`string-array`,description:`Prohibited link texts`,default:[`click here`,`here`,`link`,`more`]}]},{id:`MD060`,alias:`table-column-style`,aliases:[`table-column-style`],name:`Table column style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md060.md`,tags:[`table`],options:[{key:`style`,type:`enum`,description:`Table column style`,enum:[`any`,`aligned`,`compact`,`tight`],default:`any`},{key:`aligned_delimiter`,type:`boolean`,description:`Aligned delimiter columns`,default:!1}]}],Sse=(()=>{let e=new Map;for(let t of H5){e.set(t.id.toUpperCase(),t.id);for(let n of t.aliases)e.set(n.toUpperCase(),t.id)}return e})();function U5(e){return Sse.get(e.toUpperCase())??null}function Cse(e,t){let n=U5(t);if(n===null)return;let r;for(let[t,i]of Object.entries(e))U5(t)===n&&(r={key:t,value:i});return r}var wse=[`Headings`,`Lists`,`Whitespace`,`Code`,`Links & images`,`Style`],Tse=[[`headings`,`Headings`],[`bullet`,`Lists`],[`ul`,`Lists`],[`ol`,`Lists`],[`links`,`Links & images`],[`images`,`Links & images`],[`accessibility`,`Links & images`],[`code`,`Code`],[`language`,`Code`],[`emphasis`,`Style`],[`html`,`Style`],[`line_length`,`Whitespace`],[`whitespace`,`Whitespace`],[`hard_tab`,`Whitespace`],[`blank_lines`,`Whitespace`],[`indentation`,`Whitespace`]];function Ese(e){for(let[t,n]of Tse)if(e.tags.includes(t))return n;return`Style`}function Dse(e){let t={lint:{errorCount:0,warningCount:0},links:{errorCount:0,warningCount:0}};for(let n of e){let e=n.source===`links`?t.links:t.lint;n.severity===`error`?e.errorCount+=1:e.warningCount+=1}return t}async function Ose(e,t,n){if(!t.enabled)return[];let r=[];for(let i of A5){let a=t.plugins[i.id];if(a.enabled)try{r.push(...await i.lint(e,a,{docName:n}))}catch(e){console.warn(`[lint] plugin "${i.id}" failed${n?` on "${n}"`:``}`,e)}}return r}var kse=/\p{M}+/gu,Ase=/[^\p{L}\p{N}]+/gu,jse=/^-+|-+$/g;function W5(e){return e.trim().normalize(`NFKD`).replace(kse,``).toLowerCase().replace(Ase,`-`).replace(jse,``)}function Mse(e,t){let n=t.get(e)??0;return t.set(e,n+1),n===0?e:`${e}-${n}`}function G5(e,t){let n=W5(e);return n?Mse(n,t):``}function K5(e,t){let n=W5(e);return t?`#${n}-${W5(t)}`:`#${n}`}var q5=new Set([`img`,`video`,`audio`,`mark`,`u`,`ins`]),Nse=new Map(G2.flatMap(e=>e.surface===`compat`&&q5.has(e.rendersAs)?[[e.name,e]]:[]));function J5(e){let t={};for(let n of e.attributes){if(n.type!==`mdxJsxAttribute`)return null;let e=n.name.toLowerCase();if(!(e.length>=3&&e.startsWith(`on`)))if(n.value===null)t[n.name]=!0;else if(typeof n.value==`string`)t[n.name]=n.value;else return null}return t}function Y5(e){let t=e.name;if(!t||!q5.has(t))return null;let n=J5(e);return n===null?null:{type:`element`,tagName:t,properties:n,children:[]}}function X5(e){let t=e.name;if(!t)return null;let n=Nse.get(t);if(!n)return null;let r=J5(e);if(r===null)return null;let i=n.translateProps(r),a={};for(let[e,t]of Object.entries(i))(typeof t==`string`||typeof t==`boolean`)&&(a[e]=t);return{type:`element`,tagName:n.rendersAs,properties:a,children:[]}}var Pse=(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-link`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:K5(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},Fse=(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-embed`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:K5(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},Ise=(e,t)=>{let n=t,r=Y5(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i=X5(n);if(i){e.patch(t,i);let n=e.applyData(t,i);return n.tagName===`img`?{type:`element`,tagName:`p`,properties:{},children:[n]}:n}let a={type:`element`,tagName:`pre`,properties:{className:[`mdx-component`]},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]}]};return e.patch(t,a),e.applyData(t,a)},Lse=(e,t)=>{let n=t,r=Y5(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i=X5(n);if(i)return e.patch(t,i),e.applyData(t,i);let a={type:`element`,tagName:`span`,properties:{className:[`mdx-inline`],dataJsxInline:``},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]};return e.patch(t,a),e.applyData(t,a)},Rse=(e,t)=>{let n=t,r=n.data.reason||`unknown`,i=n.value||``,a=r.replace(/--/g,`—`),o={type:`comment`,value:` Parse error: ${a} `},s={type:`element`,tagName:`pre`,properties:{className:[`mdx-fallback`],dataRawMdxFallback:``,dataReason:a},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:i}]}]};return e.patch(t,s),[o,e.applyData(t,s)]},zse=(e,t)=>{let n={type:`element`,tagName:`mark`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},Bse=(e,t)=>{let n=t,r={type:`element`,tagName:n.data?.sourceForm===`ins`?`ins`:`u`,properties:{},children:e.all(n)};return e.patch(t,r),e.applyData(t,r)};function Z5(e){if(typeof e!=`object`||!e)return``;let t=e;return typeof t.value==`string`?t.value:Array.isArray(t.children)?t.children.map(Z5).join(``):``}var Q5={wikiLink:Pse,wikiLinkEmbed:Fse,mdxJsxFlowElement:Ise,mdxJsxTextElement:Lse,rawMdxFallback:Rse,mark:zse,underline:Bse,tag:(e,t)=>{let n=t.value,r={type:`element`,tagName:`a`,properties:{className:[`tag`],dataTag:n,href:`#tag/${n}`},children:[{type:`text`,value:`#${n}`}]};return e.patch(t,r),e.applyData(t,r)},comment:(e,t)=>{let n={type:`comment`,value:Z5(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},commentBlock:(e,t)=>{let n={type:`comment`,value:Z5(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:(e,t)=>{let n=t.identifier,r={type:`element`,tagName:`sup`,properties:{id:`fnref-${n}`,dataFootnoteRef:``,dataFootnoteId:n,className:[`footnote-ref`]},children:[{type:`element`,tagName:`a`,properties:{href:`#fn-${n}`,className:[`footnote-ref-link`]},children:[{type:`text`,value:`[${n}]`}]}]};return e.patch(t,r),e.applyData(t,r)},footnoteDefinition:(e,t)=>{let n=t.identifier,r={type:`element`,tagName:`aside`,properties:{id:`fn-${n}`,dataFootnoteDef:``,dataFootnoteId:n,className:[`footnote-def`]},children:[{type:`element`,tagName:`div`,properties:{className:[`footnote-body`]},children:e.all(t)},{type:`element`,tagName:`a`,properties:{href:`#fnref-${n}`,className:[`footnote-backref`],ariaLabel:`Back to reference`},children:[{type:`text`,value:`↩`}]}]};return e.patch(t,r),e.applyData(t,r)}},Vse=/url\s*\(\s*['"]?\s*(?:javascript|vbscript|data)\s*:/i,Hse=/\bexpression\s*\(/i,Use=1e4;function Wse(e){return!(e.length>Use||Vse.test(e)||Hse.test(e))}function $5(e){for(let t of e.split(`,`)){let e=t.trim();if(e!==``&&!hZ(e.split(/\s+/)[0]??``))return!1}return!0}var Gse={a:[`href`,`title`],img:[`src`,`alt`,`title`],video:[`src`,`title`],audio:[`src`,`title`],code:[`className`]},Kse=new Set([`href`,`src`]),qse=Ce(`<>`),e7=()=>e=>{h(e,`element`,e=>{let t=Gse[e.tagName.toLowerCase()],n=e.properties;if(!(!t||!n))for(let e of t){let t=n[e];if(Array.isArray(t)){let r=t.map(e=>typeof e==`string`?_3(e):e);r.some((e,n)=>e!==t[n])&&(n[e]=r);continue}if(typeof t!=`string`)continue;let r;if(Kse.has(e))if(t===`<>`||t===qse)r=``;else{let e=_3(t);r=e===t?t:Ce(e)}else r=_3(t);r!==t&&(n[e]=r)}})},t7=()=>e=>{h(e,`element`,e=>{let t=e.tagName.toLowerCase(),n=e.properties;if(!n)return;if(t===`a`||t===`area`||t===`link`||t===`base`){let e=n.href;typeof e==`string`&&!hZ(e)&&delete n.href}if(t===`img`||t===`iframe`||t===`script`||t===`embed`||t===`source`||t===`audio`||t===`video`||t===`track`){let e=n.src;typeof e==`string`&&!hZ(e)&&delete n.src}if(t===`form`){let e=n.action;typeof e==`string`&&!hZ(e)&&delete n.action}if(t===`img`||t===`source`){let e=n.srcSet;typeof e==`string`&&!$5(e)&&delete n.srcSet;let t=n.srcset;typeof t==`string`&&!$5(t)&&delete n.srcset}if(t===`video`){let e=n.poster;typeof e==`string`&&!hZ(e)&&delete n.poster}let r=n.style;typeof r==`string`&&!Wse(r)&&delete n.style})};function Jse(e){let t=Se().use(be,{handlers:Q5}).use(e7).use(t7).use(iG),n=t.runSync(e);return String(t.stringify(n))}function Yse(e){let t=/\r?\n|\r/g,n=[],r=0,i=t.exec(e);for(;i!==null;)n.push(n7(e.slice(r,i.index),r>0,!0),i[0]),r=i.index+i[0].length,i=t.exec(e);return n.push(n7(e.slice(r),r>0,!1)),n.join(``)}function n7(e,t,n){let r=0,i=e.length,a=e=>e===9||e===32;for(;t&&r<i&&a(e.charCodeAt(r));)r++;for(;n&&i>r&&a(e.charCodeAt(i-1));)i--;return i>r?e.slice(r,i):``}var r7=/\r?\n|\r/,Xse=(e,t)=>{let n=Yse(String(t.value));if(!r7.test(n)){let r={type:`text`,value:n};return e.patch(t,r),e.applyData(t,r)}let r=n.split(r7),i=[];for(let e=0;e<r.length;e++)e>0&&i.push({type:`element`,tagName:`br`,properties:{},children:[]}),r[e].length>0&&i.push({type:`text`,value:r[e]});return i};function Zse(e){let t=Se().use(ie).use(VP,[`yaml`]).use(h8).use(O).use(F8).use(u3).use(C8).use(T3).use(be,{handlers:{...Q5,text:Xse}}).use(e7).use(t7).use(iG);return String(t.processSync(c3(w3(e))))}mI(),NF(),PF(),L({entries:I(L({level:z([`info`,`warn`,`error`]),message:N().max(oY),event:N().optional(),fields:io(N(),Ka()).optional(),ts:P().optional(),sourceId:N().optional(),lineNumber:P().optional()}).loose()).max(100),droppedSinceLastFlush:P().int().min(0).optional()}).loose(),L({accepted:P().int().min(0)}).loose();var Qse=L({exact:N().min(1),prefix:N(),suffix:N(),start:P().int().nonnegative(),end:P().int().nonnegative()}),$se=I(Qa([N(),P().int().nonnegative()])),ece=eo(`kind`,[L({kind:B(`body`)}),L({kind:B(`property`),key:N().min(1),path:$se.default([])})]).default({kind:`body`}),tce=z([`anchored`,`orphaned`,`resolved`]),i7=L({threadId:N().min(1),docName:N().min(1),target:ece,anchor:Qse.nullable(),state:tce,queued:F(),latestComment:N(),createdBy:N().min(1),createdAt:P(),updatedAt:P().optional()}),a7=L({docName:N(),instruction:N(),property:N().nullable(),passage:L({exact:N(),prefix:N(),suffix:N()}).nullable(),anchorLost:F(),passageRepeats:F()}).loose(),o7=L({threadId:N(),ok:B(!0)}),s7=L({threadId:N(),ok:B(!1),error:B(`not-found`)});L({threads:I(i7)}).loose();var nce=L({meta:i7,orphaned:F()}).loose(),rce=L({threadId:N()}).loose();L({meta:i7,payload:a7}).loose();var ice=L({results:I(Qa([o7.extend({meta:i7,payload:a7}),s7]))}).loose(),ace=L({results:I(Qa([o7.extend({meta:i7}),s7]))}).loose(),oce=L({status:N().min(1),reason:N()}).loose(),sce=L({docName:N().min(1),content:N(),lifecycle:oce.nullable()}).loose(),c7=L({kind:z([`document`,`asset`,`folder`,`file`]).default(`document`),docName:N().min(1).optional(),docExt:N().min(1).default(`.md`),size:P().int().nonnegative(),modified:N().min(1),isSymlink:F().default(!1),canonicalDocName:N().nullable().default(null),targetPath:N().nullable().default(null),path:N().min(1).optional(),assetExt:N().min(1).optional(),mediaKind:z([`image`,`video`,`audio`,`pdf`,`text`,`mermaid`,`excalidraw`]).nullable().optional(),referencedBy:I(N().min(1)).optional(),hasChildren:F().optional()}).loose().refine(e=>e.kind===`document`?e.docName!==void 0&&e.path===void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.kind===`folder`?e.docName===void 0&&e.path!==void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0:e.kind===`file`?e.path!==void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.path!==void 0&&e.assetExt!==void 0&&e.referencedBy!==void 0&&e.hasChildren===void 0,{message:`document/asset/folder/file kind must match its required fields (document → docName; asset → path+assetExt+referencedBy; folder → path only, no docName; file → path, no mediaKind/referencedBy/hasChildren)`}),cce=L({documents:I(c7),truncated:F().optional()}).loose(),lce=L({source:N().min(1),anchor:N().nullable(),title:N(),snippet:N().nullable()}).loose(),uce=L({docName:N().min(1),backlinks:I(lce)}).loose(),dce=L({counts:io(N().min(1),P().int().nonnegative())}).loose();L({counts:io(N().min(1),P().int().nonnegative())}).loose();var fce=eo(`kind`,[L({kind:B(`doc`),docName:N().min(1),anchor:N().nullable(),title:N(),snippet:N().nullable()}).loose(),L({kind:B(`external`),url:N().min(1),title:N(),snippet:N().nullable()}).loose()]),pce=L({role:N().min(1),sourceForm:N().min(1),targetKind:N().min(1),href:N(),resolvedTarget:N().nullable(),status:N().min(1),reason:N().nullable(),resolutionMethod:N().min(1),fallbackTarget:N().nullable().default(null),range:L({start:P().int().nonnegative(),end:P().int().nonnegative()}),line:P().int().nonnegative(),column:P().int().nonnegative(),definition:L({label:N(),line:P().int().nonnegative()}).nullable().default(null)}).loose(),mce=L({docName:N().min(1),forwardLinks:I(fce),localTargets:I(pce).optional()}).loose(),hce=eo(`kind`,[L({id:N().min(1),kind:B(`doc`),docName:N().min(1),anchor:N().nullable(),label:N(),cluster:N().nullable(),category:N().nullable(),tags:I(N()).nullable(),managed:F().optional()}).loose(),L({id:N().min(1),kind:B(`external`),url:N().min(1),label:N()}).loose()]),gce=L({source:N().min(1),target:N().min(1)}).loose(),_ce=L({nodes:I(hce),links:I(gce)}).loose(),vce=L({ts:P().int().min(0),url:N(),method:N(),ua:N().optional(),origin:N().optional(),referer:N().optional(),host:N().optional(),remote:N().optional(),secChUa:N().optional(),secChUaMobile:N().optional(),secChUaPlatform:N().optional(),secFetchSite:N().optional(),secFetchDest:N().optional(),secFetchMode:N().optional(),secFetchUser:N().optional()}).loose(),yce=L({app:Qa([B(`cursor`),B(`codex`),B(`claude`),Wa()]),signals_fired:I(N())}).loose();L({entries:I(vce),count:P().int().min(0),detection:yce}).loose(),L({writers:I(L({id:N().min(1),name:N().optional(),email:N().optional()}).loose()).optional(),summary:R$,...L$}).loose(),L({checkpointRef:N().min(1)}).loose();var bce=L({v:P().int().optional(),id:N().min(1),name:N().min(1),colorSeed:N().optional(),docs:I(N()),summaries:I(N()).optional()}).loose();L({entries:I(L({sha:N().min(1),timestamp:N().min(1),author:N(),authorEmail:N(),type:z([`checkpoint`,`wip`,`upstream`,`park`]),message:N(),contributors:I(bce),checkpoint:Ka().nullable(),parentSha:N().nullable().optional()}).loose()),total:P().int().nonnegative().optional(),truncated:F().optional(),hasMore:F().optional()}).loose(),L({sha:N().regex(/^[0-9a-f]{40}$/i),content:N(),timestamp:N(),author:N()}).loose();var xce=L({contentDir:N().min(1),pathSeparator:z([`/`,`\\`]),symlinkResolved:F()}).loose();I(eo(`source`,[L({docName:N().min(1),timestamp:N().min(1),size:P().int().nonnegative(),source:B(`flat`)}).loose(),L({docName:N().min(1),timestamp:N().min(1),source:B(`timeline`),sha:N().min(1)}).loose()])).meta({description:"Flat array of rescue buffer entries; discriminated via `source`."});var Sce=L({domain:N().min(1),title:N().optional(),description:N().optional(),siteName:N().optional(),faviconDataUri:N().optional()}).loose();L({url:N()}).loose();var Cce=eo(`ok`,[L({ok:B(!0),metadata:Sce}).loose(),L({ok:B(!1),reason:N()}).loose()]),wce=L({orphans:I(L({docName:N().min(1),title:N()}).loose())}).loose(),Tce=L({hubs:I(L({docName:N().min(1),title:N(),count:P().int().nonnegative()}).loose())}).loose(),Ece=L({source:N().min(1),title:N(),snippet:N().nullable()}).loose();L({deadLinks:I(L({target:N().min(1),sources:I(Ece)}).loose())}).loose(),L({target:L({docName:N().min(1),title:N(),aliases:I(N())}).loose(),mentions:I(L({source:N().min(1),excerpt:N(),offset:P().int().nonnegative()}).loose()),truncated:F()}).loose(),L({projectPath:N().min(1)}).loose();var Dce=z([`not-a-git-worktree`,`init-failed`]);eo(`ok`,[L({ok:B(!0),projectPath:N().min(1)}).loose(),L({ok:B(!1),reason:Dce,message:N().min(1)}).loose()]),L({host:N().min(1).optional()}).loose(),L({host:N().min(1).optional(),token:N().min(1)}).loose(),L({host:N(),login:N()}).loose(),L({key:N().min(1)}).loose(),L({keyPresent:F()}).loose();var Oce=z([`no_key`,`invalid_endpoint`,`rate_limit`,`timeout`,`http_error`,`network`,`dims_mismatch`,`malformed_response`]),kce=eo(`ok`,[L({ok:B(!0),endpoint:N().min(1),model:N().min(1),dimensions:P().int().positive()}).loose(),L({ok:B(!1),endpoint:N().min(1),model:N().min(1),reason:Oce,status:P().int().optional()}).loose()]);L({name:N().refine(e=>e.trim().length>0,{message:`name must be non-empty`}),email:N().refine(e=>e.trim().length>0,{message:`email must be non-empty`})}).loose(),L({authenticated:F()}).loose(),L({channel:z([`login`,`gh-login`]).default(`login`)}).loose(),L({}).loose();var l7=65536;function u7(e){let t=e.match(om);return t?{fenced:t[0],body:e.slice(t[0].length)}:{fenced:``,body:e}}function Ace(e){if(e.trim()===``)return{doc:new nl({}),map:{}};let t;try{t=pu(e,{uniqueKeys:!1})}catch(e){let t=e instanceof Error?e.message:String(e);return{doc:new nl({}),map:null,parseError:`parse threw: ${t}`}}if(t.errors.length>0)return{doc:t,map:null,parseError:t.errors[0]?.message??`yaml parse errors`};let n;try{n=t.toJS()}catch(e){let n=e instanceof Error?e.message:String(e);return{doc:t,map:null,parseError:`toJS threw: ${n}`}}if(typeof n!=`object`||!n||Array.isArray(n))return{doc:t,map:null,parseError:`top-level value is not a mapping`};let r=bm.safeParse(n);if(!r.success){let e=r.error.issues[0],n=e&&Array.isArray(e.path)?e.path.join(`.`):``,i=e?.message??`unknown`;return{doc:t,map:null,parseError:n?`value at "${n}" failed schema: ${i}`:`schema validation failed: ${i}`}}return{doc:t,map:r.data}}function d7(e){return e===``?{doc:new nl({}),map:{}}:Ace(um(e))}function f7(e){let{fenced:t}=u7(e),{map:n,parseError:r}=d7(t);return{map:n??{},parseError:r}}function p7(e){let{fenced:t}=u7(e);if(t===``)return[];let{doc:n,map:r}=d7(t);return r===null?[]:_7(n)}function m7(e){return typeof e==`object`&&!!e&&`key`in e}function h7(e){let t=e.key;return typeof t==`string`?t:t&&typeof t==`object`&&`value`in t&&typeof t.value==`string`?t.value:null}function g7(e,t){let n=e.key;if(typeof n==`string`){e.key=t;return}if(n&&typeof n==`object`){n.value=t;return}e.key=t}function _7(e){let t=e.contents;if(!t||!(`items`in t)||!Array.isArray(t.items))return[];let n=[];for(let e of t.items){if(!m7(e))continue;let t=h7(e);t!==null&&n.push(t)}return n}function v7(e){if(e.contents==null||!(`items`in e.contents)){let t=e.createNode({});return e.contents=t,t}return e.contents}function jce(e){let t=e.contents;return!t||!(`items`in t)||(t.items?.length??0)===0?``:Om(e.toString(wm))}function Mce(e){let t=new TextEncoder().encode(e).byteLength;return t>65536?{kind:`region_too_large`,bytes:t,limit:l7}:null}function y7(e){let t=jce(e),n=Mce(t);return n?{ok:!1,error:n}:{ok:!0,nextFenced:t}}function Nce(e,t){if(Object.hasOwn(t,`frontmatter`))return{ok:!1,error:{kind:`reserved_key`,key:dm}};let{doc:n,map:r}=d7(e);if(r===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};try{v7(n);for(let[e,r]of Object.entries(t)){if(r===null){n.delete(e);continue}let t=hm.safeParse(r);if(!t.success)return{ok:!1,error:{kind:`invalid_value`,key:e,reason:t.error.issues[0]?.message??`invalid value`}};n.set(e,Dm(n,n.get(e,!0),t.data))}return y7(n)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function Pce(e,t,n,r={}){if(t===`frontmatter`||n===`frontmatter`)return{ok:!1,error:{kind:`reserved_key`,key:dm}};let{doc:i,map:a}=d7(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};if(t===n)return{ok:!0,nextFenced:e};let o=i.contents;if(!o||!(`items`in o)||!Array.isArray(o.items))return{ok:!1,error:{kind:`unknown_key`,key:t}};let s=o.items.find(e=>m7(e)&&h7(e)===t);if(!s)return{ok:!1,error:{kind:`unknown_key`,key:t}};if(!r.allowDuplicate&&o.items.some(e=>m7(e)&&e!==s&&h7(e)===n))return{ok:!1,error:{kind:`duplicate_target`,key:n}};try{return g7(s,n),y7(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function b7(e,t){let{doc:n,map:r}=d7(e);if(r===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let i=n.contents;if(!i||!(`items`in i)||!Array.isArray(i.items))return{ok:!0,nextFenced:e};let a=_7(n);if(a.length!==t.length||!x7(a,t))return{ok:!1,error:{kind:`reorder_mismatch`,expected:a,got:[...t]}};try{let e=i.items.filter(m7),r=[];for(let n of t){let i=e.findIndex(e=>h7(e)===n);if(i===-1)return{ok:!1,error:{kind:`reorder_mismatch`,expected:a,got:[...t]}};let[o]=e.splice(i,1);o&&r.push(o)}return i.items=r,y7(n)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function x7(e,t){let n=new Map;for(let t of e)n.set(t,(n.get(t)??0)+1);for(let e of t){let t=(n.get(e)??0)-1;if(t<0)return!1;n.set(e,t)}for(let e of n.values())if(e!==0)return!1;return!0}function S7(e){if(e.length===0)return{kind:`invalid_path`,path:[...e],reason:`path must have at least one segment`};for(let t=0;t<e.length;t++){let n=e[t];if(typeof n!=`string`&&typeof n!=`number`)return{kind:`invalid_path`,path:[...e],reason:`path segment at index ${t} must be string or number`};if(typeof n==`number`&&(!Number.isInteger(n)||n<0))return{kind:`invalid_path`,path:[...e],reason:`numeric path segment at index ${t} must be a non-negative integer`}}return e[0]===`frontmatter`?{kind:`reserved_key`,key:dm}:null}function Fce(e,t,n){let r=S7(t);if(r)return{ok:!1,error:r};let{doc:i,map:a}=d7(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let o=hm.safeParse(n);if(!o.success)return{ok:!1,error:{kind:`invalid_value`,key:String(t[t.length-1]),reason:o.error.issues[0]?.message??`invalid value`}};try{return v7(i),i.setIn(t,Dm(i,i.getIn(t,!0),o.data)),y7(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function Ice(e,t){let n=S7(t);if(n)return{ok:!1,error:n};let{doc:r,map:i}=d7(e);if(i===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};try{return r.getIn(t,!0)===void 0?{ok:!0,nextFenced:e}:(r.deleteIn(t),y7(r))}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function Lce(e,t){if(t.length===0){let t=e.contents;return Ko(t)?t:null}let n=e.getIn(t,!0);return Ko(n)?n:null}function Rce(e,t,n,r={}){let i=S7(t);if(i)return{ok:!1,error:i};let a=t[t.length-1];if(typeof a!=`string`)return{ok:!1,error:{kind:`invalid_path`,path:[...t],reason:`cannot rename: last path segment must be a string (map key)`}};if(t.length===1&&n===`frontmatter`)return{ok:!1,error:{kind:`reserved_key`,key:dm}};let{doc:o,map:s}=d7(e);if(s===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};if(a===n)return{ok:!0,nextFenced:e};let c=Lce(o,t.slice(0,-1));if(!c)return{ok:!1,error:{kind:`unknown_key`,key:a}};let l=c.items.find(e=>m7(e)&&h7(e)===a);if(!l)return{ok:!1,error:{kind:`unknown_key`,key:a}};if(!r.allowDuplicate&&c.items.some(e=>m7(e)&&e!==l&&h7(e)===n))return{ok:!1,error:{kind:`duplicate_target`,key:n}};try{return g7(l,n),y7(o)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function zce(e,t,n){if(t.length===0)return b7(e,n);let r=S7(t);if(r)return{ok:!1,error:r};let{doc:i,map:a}=d7(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let o=i.getIn(t,!0);if(!Ko(o))return{ok:!1,error:{kind:`invalid_path`,path:[...t],reason:`cannot reorder: target is not a map`}};let s=[];for(let e of o.items){if(!m7(e))continue;let t=h7(e);t!==null&&s.push(t)}if(s.length!==n.length||!x7(s,n))return{ok:!1,error:{kind:`reorder_mismatch`,expected:s,got:[...n]}};try{let e=o.items.filter(m7),t=[];for(let r of n){let i=e.findIndex(e=>h7(e)===r);if(i===-1)return{ok:!1,error:{kind:`reorder_mismatch`,expected:s,got:[...n]}};let[a]=e.splice(i,1);a&&t.push(a)}return o.items=t,y7(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function Bce(e,t,n){let r=S7(t);if(r)return{ok:!1,error:r};let{doc:i,map:a}=d7(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let o=i.getIn(t,!0);if(!Yo(o))return{ok:!1,error:{kind:`invalid_path`,path:[...t],reason:`cannot reorder: target is not a sequence`}};let s=o,c=s.items.length,l=Array.from({length:c},(e,t)=>t),u=[...n];if(!Vce(u,c))return{ok:!1,error:{kind:`reorder_mismatch`,expected:l.map(String),got:u.map(String)}};try{let e=s.items.slice();return s.items=u.map(t=>e[t]),y7(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function Vce(e,t){if(e.length!==t)return!1;let n=Array(t).fill(!1);for(let r of e){if(!Number.isInteger(r)||r<0||r>=t||n[r])return!1;n[r]=!0}return!0}var Hce=L({changes:I(eo(`kind`,[L({key:N(),kind:B(`added`),after:hm}).loose(),L({key:N(),kind:B(`removed`),before:hm}).loose(),L({key:N(),kind:B(`changed`),before:hm,after:hm}).loose()])),unparseable:L({before:N(),after:N()}).loose().nullable()}).loose();function C7(e){let{fenced:t}=u7(e),n=d7(t);if(n.map===null)return{fenced:t,map:{},keys:[],parseError:n.parseError};let r=km(n.doc);return{fenced:t,map:n.map,keys:r.length>0?r:Object.keys(n.map),parseError:void 0}}function Uce(e,t){let n=C7(e),r=C7(t);if(n.parseError!==void 0||r.parseError!==void 0)return{changes:[],unparseable:{before:n.fenced,after:r.fenced}};let i=[],a=new Set;for(let e of r.keys){if(a.has(e))continue;a.add(e);let t=r.map[e];if(t===void 0)continue;let o=n.map[e];if(o===void 0){i.push({key:e,kind:`added`,after:t});continue}Cm(o,t)||i.push({key:e,kind:`changed`,before:o,after:t})}for(let e of n.keys){if(a.has(e))continue;a.add(e);let t=n.map[e];t!==void 0&&i.push({key:e,kind:`removed`,before:t})}return{changes:i,unparseable:null}}var Wce=L({stackIndex:P().int().min(0),ts:P().int().min(0),additions:P().int().min(0),deletions:P().int().min(0)}).loose(),Gce=L({docName:N().min(1),additionsTotal:P().int().min(0),deletionsTotal:P().int().min(0),lastTs:P().int().min(0),bursts:I(Wce)}).loose(),Kce=L({displayName:N().min(1),color:N().min(1),icon:N().optional(),connectionId:N().min(1)}).loose(),qce=L({sessionAlive:F(),agent:Kce.nullable(),files:I(Gce)}).loose(),Jce=L({diff:N(),before:N(),after:N(),properties:Hce,generatedAt:P().int().min(0)}).loose();L({}).loose(),L({}).loose(),L({}).loose(),L({}).loose(),L({}).loose(),L({}).loose();var Yce=L({displayName:N().min(1),icon:N(),color:N().min(1),currentDoc:N().nullable(),mode:z([`idle`,`writing`]),ts:P().int().min(0)}).loose();L({presence:io(N().min(1),Yce)}).loose();var Xce=L({sessionId:N().min(1),agentType:N().min(1),ts:P().int().min(0),insertedChars:P().int().min(0),deletedChars:P().int().min(0)}).loose();L({effects:I(L({"doc.name":N().min(1),entries:I(Xce)}).loose())}).loose(),L({decisions:I(L({ts:P().int().min(0),decision:N().min(1),kind:N().min(1),"doc.name":N().min(1),pathRole:N().min(1)}).loose())}).loose(),io(N().min(1),F()).meta({description:`Flat boolean record keyed by agent-scheme name (claude / codex / cursor). True = installed.`}),L({path:N().min(1,`path must be non-empty`)}).loose(),L({}).loose();var Zce=L({fromDocName:N().min(1),toDocName:N().min(1)}).loose(),Qce=L({fromPath:N().min(1),toPath:N().min(1)}).loose();L({}).loose(),L({path:N().min(1),...L$,summary:R$}).loose();var $ce=L({docName:N().min(1)}).loose();L({path:N().min(1),...L$,summary:R$}).loose();var ele=L({path:N().min(1)}).loose();L({kind:z([`file`,`folder`]),path:N().min(1),...L$,summary:R$}).loose();var tle=L({kind:z([`file`,`folder`]),path:N().min(1),duplicatedDocNames:I(N().min(1))}).loose(),nle=L({pages:I(L({docName:N().min(1),title:N(),docExt:N().min(1),size:P().int().nonnegative(),modified:N().min(1),icon:N().min(1).max(2048).optional()}).loose())}).loose(),rle=L({level:P().int().min(1).max(6),text:N(),slug:N()}).loose(),ile=L({docName:N().min(1),headings:I(rle)}).loose(),ale=L({docName:N().min(1),rewrites:P().int().nonnegative()}).loose();L({kind:z([`file`,`folder`,`asset`]),fromPath:N().min(1),toPath:N().min(1),...L$,summary:R$}).loose();var ole=L({renamed:I(Zce),renamedAssets:I(Qce),rewrittenDocs:I(ale).optional(),summary:j5.optional()}).loose();L({kind:z([`file`,`folder`,`asset`]),path:N().min(1),...L$}).loose();var sle=L({deletedDocNames:I(N().min(1))}).loose();L({kind:z([`file`,`folder`,`asset`]),path:N().min(1),...L$,summary:R$}).loose();var cle=L({deletedDocNames:I(N().min(1))}).loose();L({docName:N().min(1),commitSha:N().regex(/^[0-9a-f]{40}$/i,{message:`commitSha must be a 40-char git SHA`}),summary:R$,...L$}).loose(),L({restoredFrom:N().min(1),timestamp:N().min(1),summary:j5.optional(),warning:M5.optional(),warnings:I5.optional()}).loose();var lle=/^#[0-9a-fA-F]{6}$/,ule=L(Object.fromEntries(wd.map(e=>[e,N().regex(lle,`must be a #rrggbb hex color`)]))),w7=N().min(1).refine(Od,{message:`must contain a non-whitespace character`}),T7=L({name:w7,author:w7.optional(),variant:z([`dark`,`light`]),palette:ule}).loose(),dle=L({name:N().min(1),scheme:T7,stem:N().min(1).optional(),extension:z([`.yaml`,`.yml`]).optional()}).loose(),fle=L({id:N().min(1),filename:N().min(1)}).loose(),ple=L({id:N().min(1),scheme:T7}).loose(),mle=L({id:N().min(1),filename:N().min(1)}).loose(),hle=eo(`existed`,[L({existed:B(!1)}).loose(),L({existed:B(!0),filename:N().min(1),scheme:T7}).loose()]),gle=L({themes:I(eo(`ok`,[L({ok:B(!0),id:N().min(1),filename:N().min(1),scheme:T7}),L({ok:B(!1),filename:N().min(1),id:N().min(1).optional(),code:N().min(1),conflictingFilenames:I(N().min(1)).min(2).optional()})])),truncated:F()}).loose(),_le=z([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),vle=L({label:N().min(1),webUrl:Ca().nullable()}).loose(),yle=eo(`checkStatus`,[L({checkStatus:B(`allowed`)}).loose(),L({checkStatus:B(`denied`),deniedReason:z([`no-collaborator`,`private-no-access`,`repo-not-found`,`not-authenticated`]),resolvedLogin:N().optional(),declaredLogin:N().optional(),declaredSource:N().optional()}).loose(),L({checkStatus:B(`unknown`),unknownError:z([`network`,`timeout`,`rate-limit`,`token-invalid`,`malformed-response`,`ssh-unverified`]).optional()}).loose()]),E7=z([`auth-403`,`auth-401`,`auth-scope-mismatch`,`auth-no-credential`,`auth-not-found-as-identity`,`semantic-protected-branch`]),ble=z(hu),xle=z([`succeeded`,`up-to-date`,`conflict`,`refused`,`error`]);L({state:_le,lastSyncUtc:N().nullable(),lastFetchUtc:N().nullable(),lastPushedSha:N().nullable(),ahead:P().int().min(0),behind:P().int().min(0),consecutiveFailures:P().int().min(0),conflictCount:P().int().min(0),hasRemote:F(),syncEnabled:F(),identityUnresolved:F(),remote:vle.nullable().optional(),pushError:N().optional(),pushErrorCode:E7.optional(),pullError:N().optional(),pullErrorCode:E7.optional(),pausedReason:N().optional(),pushPermission:yle.optional(),syncMode:ble.optional(),lastPullUtc:N().nullable().optional(),lastPullOutcome:xle.nullable().optional()}).loose(),L({op:z([`sync`,`push`,`pull`]).optional()}).loose(),L({op:z([`sync`,`push`,`pull`])}).loose(),L({conflicts:I(L({file:N().min(1),detectedAt:N().min(1),oursSha:N().optional(),theirsSha:N().optional(),baseSha:N().optional()}).loose())}).loose(),L({file:N().min(1),strategy:z([`mine`,`theirs`,`content`,`delete`]),content:N().optional()}).loose().refine(e=>e.strategy!==`content`||e.content!==void 0&&e.content!==``,{message:`content must be a non-empty string when strategy is 'content'`,path:[`content`]}),L({}).loose(),L({file:N().min(1),base:N(),ours:N(),theirs:N(),kind:z([`both-modified`,`delete-modify`,`modify-delete`]),lifecycleStatus:N().nullable()}).loose(),L({plan:Mo(e=>e!==void 0,{message:`plan is required`})}).loose(),L({plan:Mo(e=>e!==void 0,{message:`plan is required`})}).loose(),L({result:Mo(e=>e!==void 0,{message:`result is required`})}).loose(),L({packId:N().min(1)}).strict(),L({installedHosts:I(N()),skills:I(L({name:N().min(1),created:F()}).strict())}).strict();var Sle=L({path:N().min(1),summary:N().min(1)}).loose(),Cle=L({files:P().int().nonnegative(),folders:P().int().nonnegative()}).loose();L({packs:I(L({id:N().min(1),name:N().min(1),description:N().min(1),defaultSubfolder:N().optional(),folders:I(Sle),entryCounts:Cle}).loose())}).loose(),L({noOpen:F().optional(),out:N().min(1).optional()}).loose();var wle=L({reason:z([`unsupported-platform`,`spawn-error`]),message:N()}).loose();eo(`status`,[L({status:B(`installed`),outputPath:N(),size:P().int().nonnegative(),sha256:N(),skillVersion:N()}).loose(),L({status:B(`built`),outputPath:N(),size:P().int().nonnegative(),sha256:N(),skillVersion:N(),handoffError:wle.optional()}).loose(),L({status:B(`failed`),buildError:N()}).loose(),L({status:B(`skip-current`),skillVersion:N(),recordedAt:N().optional()}).loose()]);var D7=z(qp),O7=z(Jp);function Tle(e){return e===`agents`||Jp.includes(e)}var k7=L({alwaysOn:P().int().nonnegative(),onTrigger:P().int().nonnegative(),onDemand:P().int().nonnegative()}).strict(),Ele=[`.md`,`.mdx`,`.txt`],Dle=5e3,Ole=4;function A7(e){return Math.round(e/Ole)}function kle(e){let t=e.lastIndexOf(`.`);return t===-1?!1:Ele.includes(e.slice(t).toLowerCase())}function Ale(e){let t=A7((e.name??``).length+(e.description??``).length),n=A7(cm(e.skillMd).body.length),r=e.files.some(e=>e.relPath===`overlay.yaml`),i=0;for(let t of e.files)t.content!==null&&t.relPath!==`SKILL.md`&&(r&&t.relPath.startsWith(`upstream/`)||kle(t.relPath)&&(i+=t.content.length));return{alwaysOn:t,onTrigger:n,onDemand:A7(i)}}L({tags:I(L({name:N().min(1),count:P().int().nonnegative(),isLeaf:F()}).loose())}).loose();var jle=L({docName:N().min(1),title:N(),matchingTags:I(N().min(1)),snippet:N().nullable()}).loose();L({name:N().min(1),docs:I(jle)}).loose(),L({folder:Ka(),frontmatter_local:io(N(),Ka()).nullable()}).loose(),L({path:N(),frontmatter:io(N(),Ka()).optional()}).loose(),L({applied:Ka()}).loose();var j7=io(N(),Ka()).meta({description:`Free-form frontmatter map embedded in template payloads.`});L({template:L({name:N().min(1),folder:N(),scope:z([`local`,`inherited`]),path:N().min(1),frontmatter:j7,body:N()}).strict()}).strict();var Mle=L({templates:I(L({name:N().min(1),title:N().optional(),description:N().optional(),path:N().min(1),source_folder:N()}).strict()),truncated:F()}).strict();L({folder:N(),name:N(),body:N().optional(),frontmatter:j7.optional(),...L$,summary:R$}).strict(),L({path:N().min(1),created:F(),warnings:I(N())}).strict(),L({sourcePath:N().min(1),targetFolder:N(),name:N().optional(),title:N().optional(),deleteSource:F().optional(),...L$,summary:R$}).strict(),L({path:N().min(1),created:F(),warnings:I(N())}).strict(),L({existed:F(),path:N().min(1)}).strict(),L({fromFolder:N(),fromName:N(),toFolder:N(),toName:N(),body:N().optional(),frontmatter:j7.optional(),...L$,summary:R$}).strict(),L({from:N().min(1),to:N().min(1),committed:F()}).strict();var M7=z(vp),Nle=/^[a-z0-9-]+$/,Ple=/^[A-Za-z0-9_-]+$/,N7=L({name:N(),description:N(),metadata:L({pack:N()}).strict().optional()}).strict();L({skill:L({name:N().min(1),scope:M7,path:N().min(1),frontmatter:N7,body:N(),files:I(L({path:N().min(1),text:N().nullable()})).optional(),managed:F().optional()}).strict()}).strict();var Fle=L({source:N().min(1),publisher:N().optional(),skill:N().optional(),marketplaceUrl:N().optional(),importedAt:N().min(1),autoUpdate:F().optional()}).strict(),Ile=L({name:N().min(1),description:N().optional(),scope:M7,path:N().min(1),canonicalPath:N().min(1).optional(),filePaths:I(N()).optional(),absolutePath:N().min(1).optional(),installed:F(),hosts:I(N()),hostQualifier:N().optional().meta({description:"Set on a GLOBAL entry that shares its name with a distinct-content bundle in another host dir AND is not the by-name default: the host id whose root holds THIS bundle. Doc-name builders append it (`__skill__/global/<name>@<host>`) so each same-named bundle keeps its own tab and its own write-back path; the default bundle keeps the stable unqualified name."}),driftPaths:I(N()).optional().meta({description:`Recorded locations whose on-disk form (copy vs symlink) no longer matches what OK last wrote there — evidence another tool rewrote the path.`}),hostAliases:io(N(),N()).optional().meta({description:`Host skills roots that are symlink ALIASES of another location (host id → base-relative target root). An aliased folder is a derived view — no menu row, never a write target; the host's icon rides the target root's row.`}),conflictHosts:I(N()).optional().meta({description:`Hosts whose dir holds a DIFFERENT same-name skill (fork/conflict) — occupied, not this skill.`}),symlinkedHosts:I(N()).optional(),installableEditors:I(N()).optional(),linkMode:F().optional(),customPlacements:I(L({path:N(),mode:z([`copy`,`link`])}).strict()).optional(),plugin:L({name:N().min(1),marketplace:N().min(1),provider:N().min(1),url:N().optional()}).strict().optional(),managed:F().optional(),origin:Fle.optional(),pack:N().optional(),modified:F().optional(),revertable:F().optional(),ignored:F().optional(),size:k7.optional()}).strict();L({name:N().min(1),scope:M7,apply:F().optional()}).strict(),L({line:N().min(1),gitignorePath:N().min(1),applied:F(),alreadyTracked:F().optional()}).strict();var Lle=L({skills:I(Ile),truncated:F()}).strict();L({scope:M7.default(`project`),name:N().meta({description:`Managed skill name to create or update.`}),body:N().optional(),frontmatter:N7,...L$,summary:R$}).strict(),L({path:N().min(1),created:F(),warnings:I(N())}).strict(),L({scope:M7.default(`project`),name:N(),dryRun:F().optional(),setAutoUpdate:F().optional(),...L$,summary:R$}).strict(),L({name:N().min(1),updated:F(),source:N().min(1),localBody:N().optional(),upstreamBody:N().optional(),gitTracked:F().optional(),warnings:I(N())}).strict(),L({scope:M7.default(`project`),name:N(),...L$,summary:R$}).strict(),L({name:N().min(1),baselineRef:N().min(1),restoredFiles:I(N()),warnings:I(N())}).strict(),L({existed:F(),path:N().min(1)}).strict(),L({scope:M7.default(`project`),fromName:N(),toName:N(),body:N().optional(),frontmatter:N7.optional(),...L$,summary:R$}).strict(),L({from:N().min(1),to:N().min(1),committed:F()}).strict(),L({name:N(),fromScope:M7,toScope:M7,...L$,summary:R$}).strict(),L({scope:M7,path:N().optional()}).strict(),L({scope:M7,name:N(),toName:N(),...L$,summary:R$}).strict(),L({name:N().min(1)}).strict(),L({name:N(),home:N().min(1)}).strict(),L({docName:N().min(1)}).strict();var P7=z([`reference`,`script`,`file`]);L({scope:M7.default(`project`),name:N(),path:N().min(1),content:N(),...L$,summary:R$}).strict(),L({path:N().min(1),created:F(),kind:P7,content:F()}).strict(),L({scope:M7.default(`project`),name:N(),from:N().min(1),to:N().min(1),...L$,summary:R$}).strict(),L({from:N().min(1),to:N().min(1),fromDocName:N().optional(),toDocName:N().optional()}).strict(),L({path:N().min(1),kind:P7,text:N()}).strict(),L({path:N().min(1),existed:F(),kind:P7}).strict();var F7=Qa([O7,B(`agents`)]),I7=N().min(1).refine(e=>!e.startsWith(`/`)&&!e.startsWith(`~`)&&!/^[A-Za-z]:/.test(e),{error:`a custom root is base-relative (e.g. ".tim/skills"), not absolute or ~-prefixed`}).refine(e=>e.split(`/`).every(e=>e!==``&&e!==`.`&&e!==`..`),{error:`a custom root may not contain "..", "." or empty path segments`}).refine(e=>e.includes(`/`),{error:`a custom root is a path (e.g. ".tim/skills") — bare editor names are host ids`}),L7=Qa([F7,I7]);L({scope:M7.default(`project`),name:N(),targets:I(F7).optional().meta({description:'SET-EXACT install targets (editor ids, plus "agents" for the .agents hub — in-place skills only): the COMPLETE resulting host set. Omit to use project-configured editors; pass [] to uninstall everywhere. Stateless callers should prefer `add`/`remove`.'}),add:I(L7).optional().meta({description:`Locations to ADD the skill to (everything else untouched). Editor ids fan out a managed copy/symlink; a custom root path (".tim/skills") places the bundle there.`}),remove:I(L7).optional().meta({description:"Locations to REMOVE the skill from (lossless only — a hand-edited fork is refused, never deleted). The source cannot be removed; move it first with `source`."}),mode:z([`copy`,`link`]).optional().meta({description:`"link": one real folder (the source); every other location becomes a symlink to it. "copy": independent real folders, refreshed from the source until hand-edited (a hand-edit forks that copy). Converts existing locations losslessly. Omit to follow the form the skill already uses.`}),source:L7.optional().meta({description:`Move the skill's REAL folder to this location (the old source becomes a symlink to it — never a removal). Sticky across rescans.`}),linkMode:F().optional(),setSource:N().min(1).optional(),place:L({dir:N().min(1).meta({description:`Project-relative directory the bundle dir is created under (e.g. ".windsurf/skills").`}),mode:z([`copy`,`link`])}).strict().optional(),convert:L({target:L7.meta({description:`The installed location to convert — an editor id, "agents", or a recorded custom placement path.`}),mode:z([`copy`,`link`]).meta({description:`"link": replace this location with a symlink to the source. "copy": replace it with an independent real folder.`})}).strict().optional(),unplace:L({path:N().min(1).meta({description:`The recorded placement bundle path (e.g. ".windsurf/skills/my-skill").`})}).strict().optional(),...L$,summary:R$,fork:L({editor:N().min(1),action:z([`align`,`make-source`,`rename`]),toName:N().optional()}).strict().optional()}).strict().refine(e=>!(e.targets!==void 0&&(e.add!==void 0||e.remove!==void 0)),{error:"`targets` is set-exact; `add`/`remove` are additive — use one style per call"}).refine(e=>e.fork===void 0||e.targets===void 0&&e.add===void 0&&e.remove===void 0&&e.source===void 0&&e.setSource===void 0,{error:"`fork` is its own operation — run it in a separate call"}).refine(e=>e.fork?.action!==`rename`||e.fork.toName!==void 0,{error:"`fork.rename` requires `toName`"}).refine(e=>!(e.source!==void 0&&(e.add!==void 0||e.remove!==void 0)),{error:"a `source` move is its own operation — run it in a separate call from `add`/`remove`"}).refine(e=>[e.targets!==void 0||e.add!==void 0||e.remove!==void 0,e.place!==void 0,e.unplace!==void 0,e.convert!==void 0,e.source!==void 0||e.setSource!==void 0,e.fork!==void 0].filter(Boolean).length<=1,{error:"one operation per call — membership (`targets`/`add`/`remove`), `place`, `unplace`, `convert`, `source`, and `fork` are mutually exclusive"}),L({name:N().min(1).meta({description:`Managed skill name installed or uninstalled.`}),hosts:I(N()).meta({description:`Editor ids the skill is projected into after the operation; [] is expected after uninstall.`}),scripts:F().meta({description:`True when the skill ships executable scripts, projected but never run.`}),warnings:I(N()).meta({description:`Non-fatal install/uninstall warnings from target projection.`}),warningCodes:I(z([`no-targets`,`scripts-present`,`name-conflict`,`no-description`,`skill-fork-name-unpatched`,`place-path-invalid`,`place-fork-refused`])).meta({description:"Machine-readable warning codes aligned with `warnings`."}),placedAt:N().optional(),sourceMovedTo:N().optional()}).strict(),L({scope:M7.default(`project`),name:N().meta({description:`Managed skill name to uninstall without deleting source.`})}).strict(),L({name:N().min(1).meta({description:`Managed skill name requested for uninstall.`}),uninstalled:F().meta({description:`True when an install marker existed and was removed; false for an idempotent no-op.`})}).strict();var Rle=L({targets:I(D7),configured:F(),folders:I(L({scope:M7,host:N(),root:N(),state:z([`own`,`linked`,`linked-parent`,`absent`]),target:N().optional(),drift:B(!0).optional(),expected:N().optional()}).strict()).optional()}).strict(),R7=L({action:B(`link`),scope:M7,root:N().min(1).meta({description:`The folder to link (e.g. ".codex/skills").`}),target:N().min(1).meta({description:`The root it merges into (e.g. ".agents/skills"). Required.`})}),z7=L({action:B(`unlink`),scope:M7,root:N().min(1).meta({description:`The linked folder to materialize back.`}),exclude:I(N().min(1)).optional().meta({description:`Skill names to LEAVE OUT when materializing — the folder keeps every other skill it currently sees (as per-skill links) and stops auto-following the target root.`})}).strict(),B7=L({action:B(`add-root`),scope:M7,root:I7.meta({description:`New custom skills root to declare (base-relative, e.g. ".team/skills").`})}).strict(),zle=eo(`action`,[R7.extend({preview:F().optional().meta({description:`Return the merge plan only (moves, drops, removes, conflicts, strays) — nothing is written.`})}).strict(),z7,B7]);eo(`action`,[R7.strict(),z7,B7]),L({folderAction:zle}).strict();var V7=L({moves:I(N()),drops:I(N()),removes:I(N()),replaces:I(N()),conflicts:I(N()),strays:I(N())}).strict();L({targets:I(D7),reprojected:I(L({name:N(),hosts:I(N())}).strict()),bundleHosts:I(N()),removedFrom:I(N()),folder:L({moved:I(N()),dropped:I(N()),linked:I(N())}).strict().optional(),preview:V7.optional()}).strict(),L({scope:M7.default(`project`),name:N(),version:N().regex(/^[0-9a-f]{40}$/i),...L$,summary:R$}).strict(),L({name:N().min(1),version:N(),restoredFiles:I(N()),warnings:I(N())}).strict(),L({query:N().optional(),intent:z([`autocomplete`,`full_text`,`omnibar`]).optional(),ranking:z([`navigation`,`relevance`]).optional(),scopes:I(z([`page`,`folder`,`content`,`file`])).optional(),scope:N().optional(),limit:P().int().nonnegative().optional(),semantic:F().optional(),source:z([`omnibar`,`mcp`,`http`]).optional()}).loose();var Ble=L({kind:z([`page`,`folder`,`content`,`file`]),path:N().min(1),title:N(),score:P(),signals:io(N(),Ka()),snippet:N().optional()}).loose(),Vle=L({capable:F(),applied:F(),coverage:L({embedded:P().int().nonnegative(),total:P().int().nonnegative()})}).loose();L({enabled:F(),keyPresent:F(),keyNotRequired:F(),keySource:z([`project`,`file`,`env`]).nullable(),keyHint:N().nullable(),ready:F(),capable:F(),embedded:P().int().nonnegative(),total:P().int().nonnegative()}).loose(),L({query:N(),intent:z([`autocomplete`,`full_text`,`omnibar`]),results:I(Ble),elapsedMs:P().nonnegative(),semantic:Vle.optional(),truncated:F().optional(),ready:F().optional()}).loose();var Hle=L({version:N().min(1),recordedAt:N().min(1)}).loose();L({currentVersion:N().min(1),targets:io(N(),Hle.nullable())}).loose(),L({scope:M7.default(`project`),source:N().min(1).meta({description:`External skill source: full skills.sh skill-page URL (https://www.skills.sh/<owner>/<repo>/<skill>, or https://www.skills.sh/site/<hostname>/<skill> for a website catalog), GitHub owner/repo[/subpath], git URL, or local/file path.`}),skill:N().min(1).optional().meta({description:`Specific skill name to import from a multi-skill source.`}),install:F().optional().meta({description:`Pass false to import WITHOUT the default-editor auto-projection (the caller installs explicitly afterwards). Default true.`}),marketplace:F().optional().meta({description:"The source came from a skills.sh listing the user chose (the Explore tab), so the install is reported to skills.sh and counts toward that listing. Off by default: a hand-typed repo must not be announced to skills.sh. Honors the `telemetry.skillInstallReports.enabled` setting and DO_NOT_TRACK."}),...L$,summary:R$}).strict(),L({scope:M7.default(`project`),source:N().min(1).meta({description:`External skill source: full skills.sh skill-page URL, GitHub owner/repo[/subpath], git URL, or local/file path.`}),skills:I(N().min(1)).min(1).max(100).meta({description:`Skill names to import from the source.`}),install:F().optional().meta({description:`Pass false to import WITHOUT the default-editor auto-projection. Default true.`}),marketplace:F().optional().meta({description:"The source came from a skills.sh listing the user chose (a marketplace plugin bundle), so the import is reported to skills.sh as one batched install event and counts toward that listing. Off by default: a hand-typed repo must not be announced to skills.sh. Honors the `telemetry.skillInstallReports.enabled` setting and DO_NOT_TRACK."}),...L$,summary:R$}).strict(),L({results:I(L({requested:N(),status:z([`imported`,`already-imported`,`not-found`,`failed`]),name:N().optional(),collisionRenamedFrom:N().optional(),warnings:I(N()),error:N().optional()}).loose()),imported:P(),alreadyImported:P(),failed:P()}).loose(),L({scope:M7.default(`project`),names:I(N().min(1)).min(1).max(100).meta({description:`Managed skill names to refresh from their recorded upstreams.`}),...L$,summary:R$}).strict(),L({results:I(L({requested:N(),status:z([`updated`,`up-to-date`,`not-found`,`failed`]),source:N().optional(),warnings:I(N()),error:N().optional()}).loose()),updated:P(),upToDate:P(),failed:P()}).loose();var Ule=L({source:N(),ref:N().optional(),contentHash:N(),publisher:N().optional()}).loose();L({name:N().min(1).meta({description:`Managed skill name created or matched.`}),path:N().min(1).meta({description:`Store-relative path to the imported skill source.`}),created:F().meta({description:`True when this request created new source files.`}),alreadyImported:F().meta({description:`True when identical content was already present and no files changed.`}),collisionRenamedFrom:N().optional().meta({description:`Original source name when collision handling renamed the import.`}),provenance:Ule,warnings:I(N()).meta({description:`Non-fatal import warnings, such as skipped unsupported files.`})}).loose();var Wle=`server-info`,Gle=`branch-switched`,Kle=`disk-ack`,qle=`config-validation-rejected`,Jle=`config-ignore-nested-error`,H7=z([`files`,`backlinks`,`graph`,`sync-status`,`session-activity`,`tags`,`comments`,`lint-config`,`local-targets`]),Yle=L({v:B(1),ch:B(Wle),seq:P(),serverInstanceId:N().min(1),currentBranch:N().min(1).optional()}).loose(),Xle=L({v:B(1),ch:B(Gle),seq:P(),branch:N().min(1)}).loose(),Zle=L({v:B(1),ch:H7,seq:P()}).loose(),Qle=L({v:B(1),ch:B(Kle),seq:P(),docName:N().min(1),sv:N().min(1)}).loose(),$le=L({v:B(1),ch:B(qle),seq:P(),docName:N().min(1),error:np}).loose(),eue=L({v:B(1),ch:B(Jle),seq:P(),path:N().min(1),error:N().min(1)}).loose();function tue(e){let t;try{t=new URL(e)}catch{return null}let n=t.pathname.match(/^\/video\/(\d+)/);if(n)return n[1]??null;let r=t.pathname.match(/^\/(\d+)/);return r?r[1]??null:null}function nue(e){if(typeof e!=`string`||e.length===0)return e;let t=_2(e);if(t){let e=t.noCookie?`www.youtube-nocookie.com`:`www.youtube.com`,n=t.startSeconds===null?``:`?start=${t.startSeconds}`;return`https://${e}/embed/${t.id}${n}`}if(f2(e)){let t=tue(e);return t?`https://player.vimeo.com/video/${t}`:e}let n=l2(e);if(n){let e=n.startRaw===null?``:`?t=${n.startRaw}`;return`https://www.loom.com/embed/${n.id}${e}`}return e}var rue=`https://api.github.com/repos/inkeep/open-knowledge`;async function iue(e){let{signal:t,...n}=e??{},r=t?AbortSignal.any([AbortSignal.timeout(5e3),t]):AbortSignal.timeout(5e3);try{let e=await fetch(rue,{headers:{accept:`application/vnd.github+json`,"user-agent":`openknowledge.ai`},...n,signal:r});if(!e.ok)return console.warn(`[github-stars] GitHub API responded ${e.status}`),null;let t=await e.json();return typeof t.stargazers_count==`number`?t.stargazers_count:null}catch(e){return console.warn(`[github-stars] fetch failed: ${e instanceof Error?e.message:String(e)}`),null}}function aue(e){if(!e)return{height:null,viewerFragment:``};let t=e.split(`&`).filter(e=>e.length>0),n=null,r=[];for(let e of t){let t=e.indexOf(`=`);if(t===-1){r.push(e);continue}let i=e.slice(0,t),a=e.slice(t+1);if(i===`height`){let e=Number.parseInt(a,10);!Number.isNaN(e)&&e>0&&(n=e);continue}r.push(e)}return{height:n,viewerFragment:r.join(`&`)}}new GJ.default;var oue=L({path:I(Qa([N(),P()])),message:N(),issueCode:N()});eo(`code`,[L({code:B(`SCHEMA_INVALID`),issues:I(oue)}),L({code:B(`WRITE_ERROR`),detail:N()})]);function sue(e){return{path:e.path.map(e=>typeof e==`symbol`?String(e):e),message:e.message,issueCode:e.code}}function cue(e){if(e.code!==`SCHEMA_INVALID`)return{};let t={};for(let n of e.issues){let e=n.path[0];typeof e==`string`&&(t[e]=t[e]?`${t[e]}; ${n.message}`:n.message)}return t}var U7=/^---[ \t]*\r?\n---[ \t]*(\r?\n|$)/,lue=/^---([ \t]*)(?=\r?\n|$)/,W7=e=>e.includes(`\r
|
|
566
|
+
`)},mdxJsxFlowElement(e,t,n,r){let i=e,a=i.data?.sourceRaw;if(typeof a==`string`)return a;let o=i.data?.htmlBoundary;if(o&&typeof o.opener==`string`&&typeof o.closer==`string`){let e=n.containerFlow({type:`root`,children:i.children??[]},r);return`${o.opener}\n\n${e}\n\n${o.closer}`}let s=i.name??``,c=H8(i.attributes??[]);return!i.children||i.children.length===0?s?c?`<${s} ${c} />`:`<${s} />`:``:Tae({...i,attributes:(i.attributes??[]).map(Oae)},t,n,r)},mark(e,t,n,r){let i=n.createTracker(r),a=n.enter(`mark`),o=i.move(`==`);return o+=Z8(n.containerPhrasing(e,{before:o,after:`==`,...i.current()}),r,`==`),o+=i.move(`==`),a(),o},underline(e,t,n,r){let i=e.data?.sourceForm===`ins`?`<ins>`:`<u>`,a=e.data?.sourceForm===`ins`?`</ins>`:`</u>`,o=n.createTracker(r),s=n.enter(`underline`),c=o.move(i);return c+=n.containerPhrasing(e,{before:c,after:a,...o.current()}),c+=o.move(a),s(),c},comment(e,t,n,r){let i=e.data?.sourceForm,a=i===`html`?`<!-- `:`%%`,o=i===`html`?` -->`:`%%`,s=n.createTracker(r),c=n.enter(`comment`),l=s.move(a);return l+=n.containerPhrasing(e,{before:l,after:o,...s.current()}),l+=s.move(o),c(),l},commentBlock(e,t,n,r){let i=n.createTracker(r),a=n.enter(`commentBlock`),o=e.children??[],s=e.data?.sourceForm,c=e.data?.sourceLayout,l=o.length===1&&o[0]?.type===`paragraph`;if(s===`html`&&l){let e=o[0],t=n.containerPhrasing(e,{before:`<!-- `,after:` -->`,...i.current()});return a(),`<!-- ${t} -->`}if(c===`inline`&&l){let e=o[0],t=n.containerPhrasing(e,{before:`%% `,after:` %%`,...i.current()});return a(),`%% ${t} %%`}let u=n.containerFlow(e,i.current());return a(),`%%\n\n${u}\n\n%%`},mdxJsxTextElement(e){let t=e.data?.sourceRaw;if(typeof t==`string`)return t;let n=e.name??``,r=H8(e.attributes??[]),i=(e.children??[]).map(e=>e&&typeof e==`object`&&`value`in e?String(e.value??``):``).join(``);return i?r?`<${n} ${r}>${i}</${n}>`:`<${n}>${i}</${n}>`:r?`<${n} ${r} />`:`<${n}/>`},rawMdxFallback(e){return e.value??``},blockquote(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.containerFlow(e,a.current());i();let s=e.data?.sourceMarkerSpacings,c=0;return n.indentLines(o,(e,t,n)=>{if(n)return`>`;let r=c++,i=s?.[r];return i===`lazy`&&r>0&&!Eae.test(e)?e:i===`none`||i===0?`>${e}`:typeof i==`number`&&i>=2&&!e.startsWith(` `)?`>${` `.repeat(i)}${e}`:`> ${e}`})}};function H8(e){let t=[];for(let n of e){if(n.type===`mdxJsxExpressionAttribute`){t.push(`{${n.value}}`);continue}let e=n.name;if(n.value===null||n.value===void 0){t.push(e);continue}if(typeof n.value==`string`){n.value.includes(`"`)?t.push(`${e}={${U8(n.value)}}`):t.push(`${e}="${n.value}"`);continue}t.push(`${e}={${n.value.value}}`)}return t.join(` `)}function U8(e){return`"${e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`}function Oae(e){return e.type===`mdxJsxAttribute`&&typeof e.value==`string`&&e.value.includes(`"`)?{type:`mdxJsxAttribute`,name:e.name,value:{type:`mdxJsxAttributeValueExpression`,value:U8(e.value)}}:e}function W8(e,t,n=` `){return t===`single`?`${n}'${e.replace(/'/g,`\\'`)}'`:t===`paren`?`${n}(${e.replace(/[()]/g,`\\$&`)})`:`${n}"${e.replace(/"/g,`\\"`)}"`}function G8(e){if(!e)return``;let t=0,n=!0;for(let r of e)r===`(`?t++:r===`)`&&(t--,t<0&&(n=!1));return t!==0&&(n=!1),n?e:e.replace(/[\\()]/g,`\\$&`)}function kae(e){return e.replace(/(?<!\\)&(?=(#[0-9]+|#[xX][0-9A-Fa-f]+|[A-Za-z][A-Za-z0-9]*);)/g,(e,t)=>Aae(t)?e:`\\${e}`)}function Aae(e){if(e.charCodeAt(0)!==35)return!1;let t=e[1]===`x`||e[1]===`X`?Number.parseInt(e.slice(2),16):Number.parseInt(e.slice(1),10);return t===9||t===10||t===11||t===12||t===13||t===32||t===160}var K8=``,jae=/&#(?:x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);/g;function Mae(e){return e.replace(jae,e=>xY(e)?K8+e.slice(1):e)}function Nae(e){return/[\r\n][\t ]*$/.test(e)}function q8(e,t,n){let{matched:r}=a3(t,{escapeAware:!1});if(r.length===0)return J8(e,t,n);let i=``,a=0,o=r=>{r>a&&(i+=J8(e,t.slice(a,r),{...n,before:n.before+i,after:t.slice(r,r+1)||n.after})),a=r};for(let e of r)o(e.start),!Nae(n.before+i)&&(i+=t.slice(e.start,e.end),a=e.end);return o(t.length),i}function J8(e,t,n){let r=e.unsafe;e.unsafe=r.filter(e=>!(e.character===`&`&&e.after===`[#A-Za-z]`||e.character===`<`||e.character===`[`||e.character===`(`||e.character===`!`&&e.after===`\\[`&&e.inConstruct===`phrasing`||e.character===`@`&&e.before===`[+\\-.\\w]`||e.character===`{`&&Array.isArray(e.inConstruct)&&e.inConstruct.includes(`phrasing`)||e.character==="`"||(e.character===`*`||e.character===`_`||e.character===`~`)&&e.inConstruct===`phrasing`||e.character===`=`&&e.atBreak===!0||e.character===` `&&e.inConstruct===`phrasing`&&e.after===`[\\r\\n]`||e.character===` `&&e.inConstruct===`phrasing`&&e.after===`[\\r\\n]`)),e.unsafe=e.unsafe.map(e=>{if(e.character!==`)`||e.atBreak!==!0||e.before!==`\\d+`||e.after!==void 0)return e;let t={...e,after:`(?:[ \r
|
|
567
|
+
]|$)`};return delete t._compiled,t});let i;try{i=e.safe(Mae(t),n)}finally{e.unsafe=r}return i=i.replaceAll(K8,`\\&`),kae(Lae(i,n))}var Y8=1,Pae=2;function X8(e){if(Number.isNaN(e))return`ws`;let t=f(e);return t===Y8?`ws`:t===Pae?`punct`:`other`}function Fae(e,t,n){let r=X8(t),i=X8(n),a=i!==`ws`&&(i===`other`||r!==`other`),o=r!==`ws`&&(r===`other`||i!==`other`);return e===`_`?a&&(!o||r===`punct`)||o&&(!a||i===`punct`):a||o}function Iae(e,t,n){let r=t;for(;r<e.length&&(e[r]===` `||e[r]===` `);)r++;if(r<e.length)return e[r]===`
|
|
568
|
+
`||e[r]===`\r`;let i=n.after.charCodeAt(0);return Number.isNaN(i)||i===10||i===13}function Lae(e,t){let n=``,r=0;for(;r<e.length;){let i=e.charAt(r);if(i===`\\`){n+=e.slice(r,r+2),r+=2;continue}if(i===`*`||i===`_`||i===`~`||i===`=`){let a=r+1;for(;a<e.length&&e.charAt(a)===i;)a++;let o=r===0?t.before.charCodeAt(t.before.length-1):e.charCodeAt(r-1);if(i===`=`)n+=(Number.isNaN(o)||o===10||o===13)&&Iae(e,a,t)?`\\${e.slice(r,a)}`:e.slice(r,a);else{let s=a<e.length?e.charCodeAt(a):t.after.charCodeAt(0);n+=Fae(i,o,s)?`\\${i}`.repeat(a-r):e.slice(r,a)}r=a;continue}n+=i,r+=1}return n}function Z8(e,t,n){let r=n.startsWith(`_`)?`_`:`*`,i=t.before??``,a=t.after??``,o=e,s=o.charCodeAt(0);Q8(i.charCodeAt(i.length-1),s,r)&&(o=$8(s)+o.slice(1));let c=o.charCodeAt(o.length-1);return Q8(a.charCodeAt(0),c,r)&&(o=o.slice(0,-1)+$8(c)),o}function Q8(e,t,n){return!(f(t)!==Y8||n===`_`&&f(e)===void 0)}function $8(e){return`&#x${e.toString(16).toUpperCase()};`}function Rae(e,t,n,r){let i=e.value??``,a=e.data?.sourceDelimiter,o=typeof a==`string`&&/^\$+$/.test(a)?a.length:2;for(o===1&&!Bae(i,r)&&(o=2);RegExp(`(^|[^$])${`\\$`.repeat(o)}([^$]|$)`).test(i);)o++;let s=`$`.repeat(o);/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^\$|\$$/.test(i))&&(i=` ${i} `);let c=-1;for(;++c<n.unsafe.length;){let e=n.unsafe[c];if(!e.atBreak)continue;let t=n.compilePattern(e),r;for(;(r=t.exec(i))!==null;){let e=r.index;i.codePointAt(e)===10&&i.codePointAt(e-1)===13&&e--,i=`${i.slice(0,e)} ${i.slice(r.index+1)}`}}return s+i+s}function zae(e,t,n,r){let i=e.data?.sourceDelimiter===`~`?`~`:`~~`,a=n.createTracker(r),o=n.enter(`strikethrough`),s=a.move(i);return s+=Z8(n.containerPhrasing(e,{...a.current(),before:s,after:`~`}),r,i),s+=a.move(i),o(),s}function Bae(e,t){return!(e.length===0||!/^\S/.test(e)||!/\S$/.test(e)||/[$\r\n]/.test(e)||e.endsWith(`\\`)||/\\[!-/:-@[-`{-~]/.test(e)||/^\d/.test(t.after)||t.before.endsWith(`\\`))}function e5(e){if(!Number.isFinite(e)||e<0)return``;if(e<1024)return`${e} B`;let t=[`KiB`,`MiB`,`GiB`,`TiB`],n=e/1024,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n.toFixed(1).replace(/\.0$/,``)} ${t[r]}`}var Vae=class{schema;handlers;pmNodeHandlers;pmMarkHandlers;parseProcessor;serializeProcessor;parseCtx={current:{}};freshnessHolder={checker:void 0};constructor(e){this.schema=Tw(e.extensions),this.handlers=Kae(this.schema,this.parseCtx),this.freshnessHolder.checker=e.deriveStructuralFreshness?$0({parse:e=>this.parseWithFallback(e)}):void 0;let{nodeHandlers:t,markHandlers:n}=qae(this.schema,this.freshnessHolder);this.pmNodeHandlers=t,this.pmMarkHandlers=n,this.parseProcessor=pae({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers}),this.serializeProcessor=mae({toMarkdownHandlers:Dae})}parse(e,t){if(!e.trim())return{type:`doc`,content:[{type:`paragraph`,content:[]}]};this.parseCtx.current=t??{};try{return gae(e,this.parseProcessor).toJSON()}finally{this.parseCtx.current={}}}parseToMdast(e){return e.trim()?_ae(e,this.parseProcessor):{type:`root`,children:[]}}parseToEditorMdast(e){return e.trim()?vae(e,this.parseProcessor):{type:`root`,children:[]}}parseWithFallback(e,t){return e.trim()?v4(e,{parse:e=>this.parse(e,t)}):{type:`doc`,content:[{type:`paragraph`,content:[]}]}}serialize(e,t){let n;try{n=this.schema.nodeFromJSON(e)}catch(t){let n=`MarkdownManager.serialize() failed: schema rejected JSONContent (type=${e.type}, childCount=${e.content?.length??0})`;throw Error(n,{cause:t})}let r=this.freshnessHolder.checker;t?.skipFreshnessDerive&&(this.freshnessHolder.checker=void 0);try{return yae(n,this.serializeProcessor,{schema:this.schema,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers})}finally{this.freshnessHolder.checker=r}}},t5=q2();function n5(e,t){let n=new Map;for(let e of t)n.set(e.name,e);let r={};for(let t of e){if(t.type===`mdxJsxExpressionAttribute`)continue;let e=t.name,i=n.get(e);if(t.value===null||t.value===void 0){r[e]=!0;continue}if(typeof t.value==`string`){if(i?.type===`number`){let n=Number(t.value);r[e]=Number.isNaN(n)?t.value:n}else i?.type===`boolean`?r[e]=t.value===`true`:r[e]=t.value;continue}let a=t.value.value;try{r[e]=JSON.parse(a)}catch{r[e]=a}}return r}function Hae(e){let t=!1;return e.descendants(e=>t?!1:e.type.name===`jsxInline`?(e.attrs.sourceDirty&&(t=!0),!1):e.type.name===`jsxComponent`&&e.attrs.sourceDirty?(t=!0,!1):!0),t}function Uae(e,t){return e.attrs.sourceDirty||Hae(e)?!0:t?t.isDiverged(e.toJSON()):!1}function Wae(e){if(e.type!==`paragraph`)return!1;let t=e.children??[];return t.length===0?!0:t.every(e=>e.type===`text`&&e.value===``)}function r5(e,t){if(!t)return e;let n={};return t.sourceFenceChar&&(n.sourceFenceChar=t.sourceFenceChar),typeof t.sourceFenceLength==`number`&&(n.sourceFenceLength=t.sourceFenceLength),t.sourcePadded===!0&&(n.sourcePadded=!0),Object.keys(n).length===0?e:{...e,data:n}}function i5(e,t){if(e.length===0)return r5({type:`inlineCode`,value:``},t);if(e.every(e=>e.type===`text`))return r5({type:`inlineCode`,value:e.map(e=>e.value).join(``)},t);if(e.length===1&&`children`in e[0]){let n=e[0];return{...n,children:[i5(n.children,t)]}}return r5({type:`inlineCode`,value:a5(e)},t)}function a5(e){let t=``;for(let n of e)n.type===`text`?t+=n.value:`children`in n&&Array.isArray(n.children)?t+=a5(n.children):`value`in n&&typeof n.value==`string`&&(t+=n.value);return t}var Gae=Vu;function Kae(e,t){let n=e.nodes,r=e.marks,i={};n.paragraph&&(i.paragraph=(e,t,r)=>{let i=r.all(e).flat(),a=i.some(e=>e?.isBlock&&!e?.isInline),o=i.some(e=>e?.isInline||e?.isText||e?.isTextblock);if(a&&!o)return i.length===1?i[0]:i;if(a&&o){let e=i.filter(e=>!e?.isBlock||e?.isInline),t=i.filter(e=>e?.isBlock&&!e?.isInline),r=[],a=n.paragraph.createAndFill(null,e.length>0?e:null);return a&&r.push(a),r.push(...t),r.length===1?r[0]:r}return n.paragraph.createAndFill(null,i.length>0?i:null)}),n.blockquote&&(i.blockquote=pP(n.blockquote,e=>({sourceMarkerSpacings:e.data?.sourceMarkerSpacings??null}))),n.tableCell&&(i.tableCell=(e=>(t,r,i)=>{let a=i.all(t).flat();if(a.length>0&&n.paragraph){let t=n.paragraph.create(null,a);return e.createAndFill(null,[t])}return e.createAndFill(null,null)})(n.tableCell)),n.tableRow&&(i.tableRow=pP(n.tableRow)),n.table&&n.tableRow&&n.tableCell&&(i.table=(e,t,r)=>{let i=e.align??[],a=e.children??[],o=[];for(let e=0;e<a.length;e++){let t=a[e];if(t.type!==`tableRow`)continue;let s=t.children??[],c=[];for(let t=0;t<s.length;t++){let a=s[t];if(a.type!==`tableCell`)continue;let o=r.all(a).flat(),l=o.length>0&&n.paragraph?[n.paragraph.create(null,o)]:null,u=i[t]??null,d=e===0&&n.tableHeader?n.tableHeader:n.tableCell,f=a.data?.sourcePadding??null,p=d.createAndFill({align:u,sourcePadding:f},l);p&&c.push(p)}let l=n.tableRow.createAndFill(null,c.length>0?c:null);l&&o.push(l)}let s=e.data?.sourceDashCounts??null,c=e.data?.sourceOuterPipes??null,l=e.data?.sourceAlignmentPadding??null;return n.table.createAndFill({sourceDashCounts:s,sourceOuterPipes:c,sourceAlignmentPadding:l},o.length>0?o:null)}),n.image&&(i.image=e=>{let r=e.url??``,i=V8(r,t.current.sourcePath);return n.image.createAndFill({src:i,alt:e.alt??null,title:e.title??null,sourceUrl:i===r?null:r})},n.imageReference?i.imageReference=e=>n.imageReference.createAndFill({alt:e.alt??``,label:e.label??e.identifier??``,identifier:e.identifier??``,referenceType:e.referenceType??`shortcut`}):i.imageReference=e=>n.image.createAndFill({src:``,alt:e.alt??null,title:null})),r.escapeMark&&(i.text=t=>{let n=t.value??``,i=typeof t.data?.sourceRaw==`string`?t.data.sourceRaw:null;if(!n&&!i)return null;if(i)return r.sourceLiteral?e.text(n,[r.sourceLiteral.create({sourceRaw:i})]):e.text(n);let a=t.data?.escapedChars,o=t.data?.entityRefSpans;if(!a?.length&&!o?.length)return e.text(n);let s=[...(a??[]).map(e=>({kind:`escape`,offset:e.offset,length:1})),...(o??[]).map(e=>({kind:`entity`,offset:e.offset,length:e.length,raw:e.raw}))];s.sort((e,t)=>e.offset-t.offset);let c=[];for(let e of s){let t=c[c.length-1];e.kind===`entity`&&t?.kind===`entity`&&t.offset+t.length===e.offset&&wY(t.raw)!==null&&xY(e.raw)?c[c.length-1]={kind:`entity`,offset:t.offset,length:t.length+e.length,raw:t.raw+e.raw}:c.push(e)}let l=[],u=0;for(let t of c){if(t.offset>u){let r=n.slice(u,t.offset);r&&l.push(e.text(r))}if(t.offset<n.length){let i=n.slice(t.offset,t.offset+t.length);if(i)if(t.kind===`escape`)l.push(e.text(i,[r.escapeMark.create()]));else if(r.sourceLiteral){let n=wY(t.raw);l.push(e.text(n??i,[r.sourceLiteral.create({sourceRaw:t.raw})]))}else l.push(e.text(i));u=t.offset+t.length}}if(u<n.length){let t=n.slice(u);t&&l.push(e.text(t))}return l.length===1?l[0]:l}),r.code&&(i.inlineCode=t=>e.text(t.value,[r.code.create({sourceFenceChar:t.data?.sourceFenceChar??"`",sourceFenceLength:typeof t.data?.sourceFenceLength==`number`?t.data.sourceFenceLength:1,sourcePadded:t.data?.sourcePadded===!0})]));let a=r.strike??r.delete;if(a&&(i.delete=mP(a,e=>({sourceDelimiter:e.data?.sourceDelimiter===`~`?`~`:`~~`}))),r.highlight&&(i.mark=mP(r.highlight)),r.underline&&(i.underline=mP(r.underline,e=>({sourceForm:e.data?.sourceForm===`ins`?`ins`:`u`}))),r.comment&&(i.comment=mP(r.comment,e=>({sourceForm:e.data?.sourceForm??`percent`}))),n.commentBlock&&(i.commentBlock=pP(n.commentBlock,e=>({sourceForm:e.data?.sourceForm??`percent`,sourceLayout:e.data?.sourceLayout??`block`}))),r.emphasis&&(i.emphasis=mP(r.emphasis,e=>({sourceDelimiter:e.data?.sourceDelimiter??`*`}))),r.strong&&(i.strong=mP(r.strong,e=>({sourceDelimiter:e.data?.sourceDelimiter??`**`}))),n.heading&&(i.heading=pP(n.heading,e=>({level:e.depth,headingStyle:e.data?.sourceStyle??`atx`,sourceTrailingHashes:e.data?.sourceTrailingHashes??null,sourceUnderlineLength:e.data?.sourceUnderlineLength??null,sourceContiguousNext:e.data?.sourceContiguousNext??!1,sourceLeadingIndent:e.data?.sourceLeadingIndent??null,sourceInteriorSpacing:e.data?.sourceInteriorSpacing??null}))),n.codeBlock&&(i.code=t=>{let r=t.value?[e.text(t.value)]:[];return n.codeBlock.createAndFill({language:t.lang??null,meta:t.meta??null,fenceDelimiter:t.data?.sourceFenceChar??"`",fenceLength:t.data?.sourceFenceLength??3,sourceStyle:t.data?.sourceStyle??`fenced`,sourceClosingFenceLength:t.data?.sourceClosingFenceLength??null,sourceUnclosedFence:t.data?.sourceUnclosedFence??!1,sourceFenceIndent:t.data?.sourceFenceIndent??null,sourceInfoPadding:t.data?.sourceInfoPadding??null,sourceIndents:t.data?.sourceIndents??null},r)}),n.thematicBreak&&(i.thematicBreak=e=>n.thematicBreak.createAndFill({sourceRaw:e.data?.sourceRaw??`---`})),n.hardBreak&&(i.break=e=>n.hardBreak.createAndFill({hardBreakStyle:e.data?.sourceStyle??`spaces`,sourceRaw:e.data?.sourceRaw??null})),n.list&&(i.list=pP(n.list,e=>({ordered:!!e.ordered,start:e.start??1,spread:!!e.spread,bulletMarker:e.data?.bulletMarker??null,listMarkerDelimiter:e.data?.listMarkerDelimiter??null}))),n.listItem&&(i.listItem=pP(n.listItem,e=>({checked:e.checked??null,spread:!!e.spread,sourceMarkerSpacing:e.data?.sourceMarkerSpacing??null,sourceOrdinal:e.data?.sourceOrdinal??null,sourceCheckboxChar:e.data?.sourceCheckboxChar??null,sourceContinuationIndent:e.data?.sourceContinuationIndent??null}))),r.link){let t=r.sourceLiteral;i.link=(n,i,a)=>{if((n.children??[]).length===0){let r=typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:`[](${n.url??``})`;return r?t?e.text(r,[t.create({sourceRaw:r})]):e.text(r):null}let o=a.all(n).flat(),s=r.link.create({href:n.url??``,title:n.title??null,linkStyle:n.data?.sourceStyle??`inline`,refLabel:null,sourceUrlForm:n.data?.sourceUrlForm??null,sourceTitleMarker:n.data?.sourceTitleMarker??null});return o.map(e=>e.mark(s.addToSet(e.marks)))},i.linkReference=(n,i,a)=>{if((n.children??[]).length===0){let r=typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:`[${n.label??``}][${n.identifier??``}]`;return r?t?e.text(r,[t.create({sourceRaw:r})]):e.text(r):null}let o=a.all(n).flat(),s=r.link.create({href:n.data?.resolvedUrl??``,title:n.data?.resolvedTitle??null,linkStyle:n.referenceType??`shortcut`,refLabel:n.label??n.identifier??null});return o.map(e=>e.mark(s.addToSet(e.marks)))}}n.htmlBlock&&(i.html=e=>n.htmlBlock.createAndFill({content:e.value??``}));let o=n.linkDefinition??n.linkRefDef;if(o){let e=!!o.spec.attrs?.url,t=!!o.spec.attrs?.href,n=!!o.spec.attrs?.identifier,r=!!o.spec.attrs?.sourceLayout,a=!!o.spec.attrs?.sourceTitleMarker;i.definition=i=>{let s={title:i.title??null};return n&&(s.identifier=i.identifier??``),s.label=i.label??i.identifier??``,e?s.url=i.url??``:t&&(s.href=i.url??``),r&&(s.sourceLayout=i.data?.sourceLayout??null),a&&(s.sourceTitleMarker=i.data?.sourceTitleMarker??null),o.createAndFill(s)}}if(n.jsxComponent){let r=e=>{if(e&&typeof e==`object`&&`sourceRaw`in e){let t=e.sourceRaw;if(typeof t==`string`)return t}};i.mdxJsxFlowElement=(e,i,a)=>{let o=e.name??``,s=t5.getOrWildcard(o),c=n5(e.attributes,s.props);if(o===`CommonMarkImage`&&typeof c.src==`string`){let e=c.src,n=V8(e,t.current.sourcePath);n!==e&&(c.src=n,c.sourceUrl=e)}let l=a.all(e).flat();return n.jsxComponent.createAndFill({componentName:o,kind:`element`,attributes:e.attributes,sourceRaw:r(e.data)??``,sourceDirty:!1,props:c},l.length?l:void 0)};let a=(e,t)=>{let n=e.attributes?.find(e=>e.type===`mdxJsxAttribute`&&e.name===t);return n&&typeof n.value==`string`?n.value:null};i.mdxJsxTextElement=t=>{if(t.name===`InlineMath`&&n.mathInline){let e=a(t,`formula`)??``,r=a(t,`id`);return n.mathInline.create({formula:e,id:r??null})}if(t.name===`Tag`&&n.tag){let e=a(t,`value`)??``;return n.tag.create({value:e})}let i=t.name??``,o=i?t5.get(i):void 0;if(o&&n.jsxInline){let e=n5(t.attributes,o.props),a=r(t.data)??``,s=(t.children??[]).map(e=>e&&typeof e==`object`&&`value`in e?String(e.value??``):``).join(``);return s&&(e.children=s),n.jsxInline.createAndFill({componentName:i,attributes:t.attributes,sourceRaw:a,sourceDirty:!1,props:e})}if(n.jsxInline){let i=r(t.data)??``;return n.jsxInline.createAndFill({},i?[e.text(i)]:null)}return n.jsxComponent.createAndFill({sourceRaw:r(t.data)??``})},i.mdxFlowExpression=e=>{let t=r(e.data)??`{${e.value??``}}`;return n.jsxComponent.createAndFill({kind:`expression`,sourceRaw:t,sourceDirty:!1})},i.mdxTextExpression=t=>{let n=r(t.data)??`{${t.value??``}}`;return e.text(n)}}return n.wikiLink&&(i.wikiLink=e=>n.wikiLink.createAndFill({target:e.data?.target??``,alias:e.data?.alias??null,anchor:e.data?.anchor??null,sourceTarget:e.data?.sourceTarget??null,sourceAnchor:e.data?.sourceAnchor??null,sourceAlias:e.data?.sourceAlias??null})),n.tag&&(i.tag=e=>n.tag.createAndFill({value:e.value})),n.wikiLinkEmbed&&(i.wikiLinkEmbed=(i,a)=>{let o=i.data?.target??``,s=i.data?.alias??null,c=i.data?.anchor??null,l=cQ(o),{resolveEmbed:u,sourcePath:d}=t.current,f=u&&d?u(o,d)??null:null,p=f?`/${f}`:o,m=a?.type===`paragraph`&&Array.isArray(a.children)&&a.children.length===1;if(m&&Gae.has(l)&&n.jsxComponent&&t5.has(`WikiEmbedImage`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedImage`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,alt:s??o,target:o,anchor:c,alias:s}});if(m&&Hu.has(l)&&n.jsxComponent&&t5.has(`WikiEmbedVideo`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedVideo`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,title:s??o,target:o,anchor:c,alias:s}});if(m&&Wu.has(l)&&n.jsxComponent&&t5.has(`WikiEmbedAudio`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedAudio`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,title:s??o,target:o,anchor:c,alias:s}});if(m&&Gu.has(l)&&n.jsxComponent&&t5.has(`WikiEmbedFile`)){let{resolveSize:e}=t.current,r=e&&d?e(o,d)??null:null,i=r===null?null:e5(r);return n.jsxComponent.createAndFill({componentName:`WikiEmbedFile`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,target:o,anchor:c,alias:s,size:i}})}let h=s||(c?`${o}#${c}`:o);if(r.link){let t=r.link.create({href:p,title:null,linkStyle:`inline`,refLabel:null,sourceForm:`wikiembed`,target:o,anchor:c,alias:s});return e.text(h,[t])}throw Error("[wikiLinkEmbed handler] schema lacks `link` mark — cannot dispatch without violating the STOP rule against emitting PM wikiLinkEmbed server-side")}),n.mathInline&&(i.inlineMath=e=>n.mathInline.create({formula:e.value??``,sourceDelimiter:e.data?.sourceDelimiter??null})),i.math||=t=>{let r=t.value==null?`«unknown:${t.type}»`:t.value;return n.rawMdxFallback?(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled block mdast: ${t.type}`})),n.rawMdxFallback.createAndFill({reason:`Unhandled block mdast: ${t.type}`},r?[e.text(r)]:null)):null},i.inlineMath||=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled inline mdast: ${t.type}`})),t.value==null?e.text(`«unknown:${t.type}»`):e.text(t.value)),n.footnoteReference?i.footnoteReference=e=>n.footnoteReference.create({identifier:e.identifier,label:e.label??e.identifier}):i.footnoteReference||=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:`footnoteReference`,reason:`FootnoteReference extension missing — recovering [^id] source`})),e.text(`[^${t.label??t.identifier}]`)),n.footnoteDefinition?i.footnoteDefinition=pP(n.footnoteDefinition,e=>{let t=e;return{identifier:t.identifier,label:t.label??t.identifier}}):i.footnoteDefinition||=t=>{console.warn(JSON.stringify({event:`unknown-mdast-type`,type:`footnoteDefinition`,reason:`FootnoteDefinition extension missing — recovering [^id]: marker`}));let r=`[^${t.label??t.identifier}]: `;return n.paragraph?n.paragraph.create(null,e.text(r)):null},i.rawMdxFallbackMdast=t=>{if(!n.rawMdxFallback)return null;let r=t.position?{start:t.position.start?.offset??0,end:t.position.end?.offset??0}:{start:0,end:0};return console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.originalType,reason:`Unhandled mdast: ${t.originalType}`,unresolvedPosition:t.unresolvedPosition??!1})),n.rawMdxFallback.createAndFill({reason:`Unhandled mdast: ${t.originalType}`,originalSpan:r},t.value?[e.text(t.value)]:null)},i}function qae(e,t){let n={},r={},i=e.nodes,a=e.marks;i.paragraph&&(n.paragraph=yP(`paragraph`)),i.blockquote&&(n.blockquote=yP(`blockquote`,e=>{let t=e.attrs.sourceMarkerSpacings,n={};return Array.isArray(t)&&t.length>0&&(n.sourceMarkerSpacings=t),Object.keys(n).length>0?{data:n}:{}})),i.heading&&(n.heading=yP(`heading`,e=>({depth:e.attrs.level,data:{sourceStyle:e.attrs.headingStyle,sourceTrailingHashes:e.attrs.sourceTrailingHashes??void 0,sourceUnderlineLength:e.attrs.sourceUnderlineLength??void 0,sourceContiguousNext:e.attrs.sourceContiguousNext===!0?!0:void 0,sourceLeadingIndent:e.attrs.sourceLeadingIndent??void 0,sourceInteriorSpacing:e.attrs.sourceInteriorSpacing??void 0}}))),i.codeBlock&&(n.codeBlock=e=>{let t=e.attrs.sourceStyle===`indented`?`indented`:`fenced`;return{type:`code`,lang:t===`indented`?null:e.attrs.language??null,meta:t===`indented`?null:e.attrs.meta??null,value:e.textContent??``,data:{sourceFenceChar:e.attrs.fenceDelimiter,sourceFenceLength:e.attrs.fenceLength,sourceStyle:t,sourceClosingFenceLength:e.attrs.sourceClosingFenceLength??void 0,sourceUnclosedFence:e.attrs.sourceUnclosedFence===!0?!0:void 0,sourceFenceIndent:e.attrs.sourceFenceIndent??void 0,sourceInfoPadding:e.attrs.sourceInfoPadding??void 0,sourceIndents:e.attrs.sourceIndents??void 0}}}),i.thematicBreak&&(n.thematicBreak=e=>({type:`thematicBreak`,data:{sourceRaw:e.attrs.sourceRaw}})),i.hardBreak&&(n.hardBreak=e=>({type:`break`,data:{sourceStyle:e.attrs.hardBreakStyle,...typeof e.attrs.sourceRaw==`string`&&e.attrs.sourceRaw.length>0?{sourceRaw:e.attrs.sourceRaw}:{}}})),i.list&&(n.list=yP(`list`,e=>({ordered:e.attrs.ordered??!1,start:e.attrs.ordered?e.attrs.start??1:null,spread:e.attrs.spread??!1,data:{bulletMarker:e.attrs.bulletMarker,listMarkerDelimiter:e.attrs.listMarkerDelimiter}}))),i.listItem&&(n.listItem=(e,t,n)=>{let r=n.all(e),i=r.length>1&&Wae(r[0])?r.slice(1):r,a={};return typeof e.attrs.sourceMarkerSpacing==`number`&&(a.sourceMarkerSpacing=e.attrs.sourceMarkerSpacing),typeof e.attrs.sourceOrdinal==`number`&&(a.sourceOrdinal=e.attrs.sourceOrdinal),e.attrs.sourceCheckboxChar===`X`&&(a.sourceCheckboxChar=`X`),typeof e.attrs.sourceContinuationIndent==`number`&&(a.sourceContinuationIndent=e.attrs.sourceContinuationIndent),{type:`listItem`,checked:e.attrs.checked??null,spread:e.attrs.spread??!1,...Object.keys(a).length>0?{data:a}:{},children:i}}),i.table&&(n.table=(e,t,n)=>{let r=n.all(e),i=[],a=e.firstChild;a&&a.forEach(e=>{let t=e.attrs.align;i.push(t===`left`||t===`right`||t===`center`?t:null)});let o=r.filter(e=>e.type===`tableRow`),s=e.attrs.sourceDashCounts,c={};Array.isArray(s)&&s.length>0&&(c.sourceDashCounts=s);let l=e.attrs.sourceOuterPipes;typeof l==`object`&&l&&typeof l.leading==`boolean`&&typeof l.trailing==`boolean`&&(c.sourceOuterPipes=l);let u=e.attrs.sourceAlignmentPadding;Array.isArray(u)&&u.length>0&&(c.sourceAlignmentPadding=u);let d=Object.keys(c).length>0?c:void 0,f={type:`table`,align:i,children:o};return d&&(f.data=d),f}),i.tableRow&&(n.tableRow=yP(`tableRow`));let o=(e,t)=>{let n={type:`tableCell`,children:h0(t)},r=e.attrs.sourcePadding;return typeof r==`object`&&r&&typeof r.left==`number`&&typeof r.right==`number`&&(n.data={sourcePadding:r}),n};if(i.tableCell&&(n.tableCell=(e,t,n)=>o(e,n.all(e))),i.tableHeader&&(n.tableHeader=(e,t,n)=>o(e,n.all(e))),i.image&&(n.image=e=>({type:`image`,url:e.attrs.sourceUrl??e.attrs.src,alt:e.attrs.alt,title:e.attrs.title})),i.imageReference&&(n.imageReference=e=>{let t=e.attrs.label??``,n=e.attrs.identifier??t;return{type:`imageReference`,alt:e.attrs.alt??``,identifier:n,label:t||n,referenceType:e.attrs.referenceType??`shortcut`}}),i.htmlBlock&&(n.htmlBlock=e=>({type:`html`,value:e.attrs.content})),i.linkDefinition??i.linkRefDef){let e=i.linkDefinition?`linkDefinition`:`linkRefDef`;n[e]=e=>{let t={},n=e.attrs.sourceLayout;(n===`multiline`||n===`inline`)&&(t.sourceLayout=n);let r=e.attrs.sourceTitleMarker;(r===`single`||r===`double`||r===`paren`)&&(t.sourceTitleMarker=r);let i={type:`definition`,identifier:e.attrs.identifier??e.attrs.label??``,label:e.attrs.label??e.attrs.identifier??``,url:e.attrs.url??e.attrs.href??``,title:e.attrs.title};return Object.keys(t).length>0&&(i.data=t),i}}if(i.jsxComponent&&(n.jsxComponent=(e,n,r)=>{if(e.attrs.kind===`expression`)return{type:`html`,value:e.attrs.sourceRaw??``};let i=e.attrs.componentName||null,a=Array.isArray(e.attrs.attributes)?e.attrs.attributes:[];return!Uae(e,t.checker)&&e.attrs.sourceRaw?{type:`mdxJsxFlowElement`,name:i,attributes:a,children:[],data:{sourceRaw:String(e.attrs.sourceRaw)}}:t5.getOrWildcard(i??`*`).serialize(e,{all:e=>r.all(e),registry:t5,serializeChildren:()=>{throw Error(`SerializeContext.serializeChildren is not available in the PM→mdast handler. Compat descriptors that need markdown-byte body rendering must emit a marker mdast node and let the to-markdown handler render the body via state.containerFlow.`)}})}),i.rawMdxFallback&&(n.rawMdxFallback=e=>{let t=e.textContent??``,n=typeof e.attrs.reason==`string`?e.attrs.reason:``,r=e.attrs.originalSpan;return{type:`rawMdxFallback`,value:t,data:{reason:n,originalSpan:r&&typeof r==`object`&&`start`in r&&`end`in r?{start:Number(r.start)||0,end:Number(r.end)||0}:{start:0,end:0}}}}),i.jsxInline&&(n.jsxInline=e=>{let t=e.attrs.componentName||``;if(t&&e.attrs.sourceDirty)return i2(t,e,t5.get(t)?.props);let n=e.attrs.attributes,r=e.attrs.sourceRaw||e.textContent||``;return{type:`mdxJsxTextElement`,name:t||null,attributes:Array.isArray(n)?n:[],children:[],data:{sourceRaw:String(r)}}}),i.mathInline&&(n.mathInline=e=>{let t=e.attrs.formula??``,n=e.attrs.id;if(typeof n==`string`&&n.length>0)return{type:`mdxJsxTextElement`,name:`InlineMath`,attributes:[{type:`mdxJsxAttribute`,name:`formula`,value:t},{type:`mdxJsxAttribute`,name:`id`,value:n}],children:[]};let r=e.attrs.sourceDelimiter;return{type:`inlineMath`,value:t,...typeof r==`string`&&r.length>0?{data:{sourceDelimiter:r}}:{}}}),i.wikiLink&&(n.wikiLink=e=>{let t=e.attrs.target??``,n=e.attrs.anchor??null,r=e.attrs.alias??null,i=r||(n?`${t}#${n}`:t);return{type:`wikiLink`,value:i,data:{target:t,anchor:n,alias:r,sourceTarget:typeof e.attrs.sourceTarget==`string`?e.attrs.sourceTarget:null,sourceAnchor:typeof e.attrs.sourceAnchor==`string`?e.attrs.sourceAnchor:null,sourceAlias:typeof e.attrs.sourceAlias==`string`?e.attrs.sourceAlias:null},children:[{type:`text`,value:i}]}}),i.tag&&(n.tag=e=>({type:`tag`,value:String(e.attrs.value??``)})),i.wikiLinkEmbed&&(n.wikiLinkEmbed=e=>{let t=e.attrs.target??``,n=e.attrs.anchor??null,r=e.attrs.alias??null,i=r||(n?`${t}#${n}`:t);return{type:`wikiLinkEmbed`,value:i,data:{target:t,anchor:n,alias:r},children:[{type:`text`,value:i}]}}),a.emphasis&&(r.emphasis=bP(`emphasis`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),a.strong&&(r.strong=bP(`strong`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),a.code&&(r.code=(e,t,n)=>{let r=e.attrs.sourceFenceChar,i=e.attrs.sourceFenceLength;return i5(n,{sourceFenceChar:r,sourceFenceLength:i,sourcePadded:e.attrs.sourcePadded===!0?!0:void 0})}),a.strike??a.delete){let e=a.strike?`strike`:`delete`;r[e]=bP(`delete`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter===`~`?`~`:`~~`}}))}return a.highlight&&(r.highlight=bP(`mark`)),a.underline&&(r.underline=bP(`underline`,e=>({data:{sourceForm:e.attrs.sourceForm===`ins`?`ins`:`u`}}))),a.comment&&(r.comment=bP(`comment`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`}}))),i.commentBlock&&(n.commentBlock=yP(`commentBlock`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`,sourceLayout:e.attrs.sourceLayout===`inline`?`inline`:`block`}}))),i.footnoteReference&&(n.footnoteReference=e=>{let t=String(e.attrs.identifier??``);return{type:`footnoteReference`,identifier:t,label:e.attrs.label?String(e.attrs.label):t}}),i.footnoteDefinition&&(n.footnoteDefinition=yP(`footnoteDefinition`,e=>({identifier:String(e.attrs.identifier??``),label:e.attrs.label?String(e.attrs.label):String(e.attrs.identifier??``)}))),a.link&&(r.link=(e,t,n)=>{if(e.attrs.sourceForm===`wikiembed`){let t=typeof e.attrs.target==`string`&&e.attrs.target.length>0?e.attrs.target:e.attrs.href??``,r=typeof e.attrs.anchor==`string`&&e.attrs.anchor.length>0?e.attrs.anchor:null,i=typeof e.attrs.alias==`string`&&e.attrs.alias.length>0?e.attrs.alias:null,a=i||(r?`${t}#${r}`:t),o=n.map(e=>`value`in e&&typeof e.value==`string`?e.value:``).join(``);return o!==a&&o.trim().length>0&&!o.includes(`]]`)&&(i=o,a=o),{type:`wikiLinkEmbed`,value:a,data:{target:t,anchor:r,alias:i},children:[{type:`text`,value:a}]}}let r=e.attrs.linkStyle;if(r===`autolink`)return{type:`link`,url:e.attrs.href??``,title:null,children:n,data:{sourceStyle:`autolink`}};if(r===`gfm-autolink`)return{type:`link`,url:e.attrs.href??``,title:null,children:n,data:{sourceStyle:`gfm-autolink`}};if(r===`inline`||!r){let t={};e.attrs.sourceUrlForm===`angle-bracketed`&&(t.sourceUrlForm=`angle-bracketed`);let r=e.attrs.sourceTitleMarker;return(r===`single`||r===`double`||r===`paren`)&&(t.sourceTitleMarker=r),{type:`link`,url:e.attrs.href??``,title:e.attrs.title??null,children:n,...Object.keys(t).length>0?{data:t}:{}}}return{type:`linkReference`,identifier:(e.attrs.refLabel??``).toLowerCase(),label:e.attrs.refLabel,referenceType:r,children:n}}),a.escapeMark&&(r.escapeMark=(e,t,n)=>{for(let e of n)if(e.type===`text`&&e.value){let t=e;t.data??={},t.data.escapedChars??=[];for(let e=0;e<t.value.length;e++)t.data.escapedChars.push({offset:e,char:t.value[e]})}return n.length===1?n[0]:n}),a.sourceLiteral&&(r.sourceLiteral=(e,t,n)=>{let r=typeof e.attrs.sourceRaw==`string`?e.attrs.sourceRaw:``;if(n.length===1&&n[0]?.type===`text`){let e=n[0],t=r||e.value;return KZ(t,e.value)&&(e.data??={},e.data.sourceRaw=t),e}return{type:`text`,value:n.filter(e=>e.type===`text`).map(e=>e.value??``).join(``)||r}}),{nodeHandlers:n,markHandlers:r}}var o5={default:!0,MD013:!1};function s5(e){return e??o5}function c5(e){let t=e.replace(/\\/g,`/`);for(;t.startsWith(`./`);)t=t.slice(2);let n=t.toLowerCase();for(let e of jX)if(n.endsWith(e))return t.slice(0,-e.length);return t}function l5(e){let t=(e===void 0?[]:Array.isArray(e)?e:[e]).map(e=>e.trim()).filter(e=>e.length>0),n=[],r=[],i=[],a=[],o=0;for(let e of t){let t=e.startsWith(`!`),s=t?e.slice(1):e;if(t||(o+=1),s.length===0){n.push({pattern:e,detail:`empty pattern`});continue}try{let e=(0,cV.default)(s,{dot:!0,strictBrackets:!0});(t?a:i).push(e)}catch(t){n.push({pattern:e,detail:t instanceof Error?t.message:String(t)});continue}if(s.endsWith(`/`))r.push({pattern:e,reason:`trailing-slash`});else if(s.startsWith(`/`))r.push({pattern:e,reason:`leading-slash`});else{let t=s.toLowerCase();jX.some(e=>t.endsWith(e))&&r.push({pattern:e,reason:`doc-extension`})}}let s=o===0;return{invalidPatterns:n,suspiciousPatterns:r,matches(e){if(e===void 0||e===``)return!1;let t=c5(e);return t===``||!(s||i.some(e=>e(t)))?!1:!a.some(e=>e(t))}}}function Jae(e,t){if(t.length===0)return[];let n=(e===void 0?[]:Array.isArray(e)?e:[e]).map(e=>e.trim()).filter(e=>e.length>0),r=t.map(c5).filter(e=>e!==``),i=[];for(let e of n){let t=e.startsWith(`!`)?e.slice(1):e;if(t.length===0)continue;let n;try{n=(0,cV.default)(t,{dot:!0,strictBrackets:!0})}catch{continue}r.some(e=>n(e))||i.push(e)}return i}var u5=/[*?[\]{}()+@!|]/;function Yae(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);if(n===-1||e.indexOf(`{`,t+1)!==-1||e.indexOf(`}`,n+1)!==-1)return null;let r=e.slice(t+1,n).split(`,`);return r.length<2||r.some(e=>e.trim()===``||u5.test(e))?null:r.map(r=>e.slice(0,t)+r+e.slice(n+1))}function d5(e){if(e.endsWith(`/`)||e.startsWith(`/`))return{kind:`matches-nothing`,pattern:e};try{(0,cV.default)(e,{dot:!0,strictBrackets:!0})}catch{return{kind:`invalid`,pattern:e}}if(e===`**`||e===`**/*`)return{kind:`everything`};{let t=e.match(/^\*\*\/(.+)\/\*\*$/)?.[1];if(t!==void 0&&!u5.test(t))return{kind:`folder-anywhere`,folder:t};let n=e.match(/^(.+)\/\*\*\/(.+)\/\*\*$/),r=n?.[1],i=n?.[2];if(r!==void 0&&i!==void 0&&!u5.test(r)&&!u5.test(i))return{kind:`folder-recursive-nested`,root:r,folder:i}}for(let t of[`/**/*`,`/**`])if(e.endsWith(t)){let n=e.slice(0,-t.length);if(n.length>0&&!u5.test(n))return{kind:`folder-recursive`,folder:n}}if(e.endsWith(`/*`)){let t=e.slice(0,-2);if(t.length>0&&!u5.test(t))return{kind:`folder-direct`,folder:t}}if(e.startsWith(`**/`)){let t=e.slice(3);if(t.length>0&&!t.includes(`/`)&&!u5.test(t))return{kind:`name-anywhere`,name:t}}return u5.test(e)?{kind:`pattern`,pattern:e}:{kind:`exact`,target:e}}function Xae(e){let t=d5(e);if(t.kind!==`pattern`)return[t];let n=Yae(e);if(n!==null){let e=n.map(d5);if(e.every(e=>e.kind!==`pattern`))return e}return[t]}function Zae(e){let t=(e===void 0?[]:Array.isArray(e)?e:[e]).map(e=>e.trim()).filter(e=>e.length>0),n=[],r=[];for(let e of t){let t=e.startsWith(`!`),i=t?e.slice(1):e;i.length!==0&&(t?r:n).push(...Xae(i))}return{includes:n,excludes:r}}function f5(e,t){let n=new Set,r=[];for(let i of e){if(i.enabled===!1||!i.schema||!l5(i.appliesTo).matches(t))continue;let e=i.key??i.file;n.has(e)||(n.add(e),r.push({file:i.file,schema:i.schema}))}return r}var p5={"draft-06":`http://json-schema.org/draft-06/schema#`,"draft-07":`http://json-schema.org/draft-07/schema#`,"2019-09":`https://json-schema.org/draft/2019-09/schema`,"2020-12":`https://json-schema.org/draft/2020-12/schema`},Qae=Object.keys(p5),$ae=`draft-07`,eoe=new Map(Qae.map(e=>[m5(p5[e]),e]));function m5(e){return e.replace(/^https?:\/\//,``).replace(/#$/,``)}function toe(e){let t=e.$schema;return t===void 0?$ae:typeof t==`string`?eoe.get(m5(t))??null:null}var h5=new Map;function noe(e){throw Error(`Unhandled FrontmatterSchemaDialect: ${JSON.stringify(e)}`)}function roe(e){let t=h5.get(e);if(t)return t;let n={allErrors:!0,strict:!1},r;switch(e){case`2020-12`:r=new oV.default(n);break;case`2019-09`:r=new aV.default(n);break;case`draft-06`:case`draft-07`:r=new iV.default(n);break;default:return noe(e)}return(0,sV.default)(r),h5.set(e,r),r}function ioe(e){let{$schema:t,...n}=e;return n}function aoe(e,t){let n=roe(e),r=t.$id;return typeof r==`string`&&r!==``&&n.removeSchema(r),n.compile(ioe(t))}var g5=new Map,ooe=256;function soe(e){let t=JSON.stringify(e),n=g5.get(t);if(n!==void 0)return n;let r=null,i=toe(e);if(i!==null)try{r=aoe(i,e)}catch{r=null}return g5.size>=ooe&&g5.clear(),g5.set(t,r),r}function coe(e){let t=new Map;if(!om.test(e))return{data:{},keyLines:t};let{frontmatter:n}=cm(e),r=um(n);if(r.trim()===``)return{data:{},keyLines:t};let i=pu(r,{uniqueKeys:!1});if(i.errors.length>0)return{data:{},keyLines:t};let a=i.toJS();if(typeof a!=`object`||!a||Array.isArray(a))return{data:{},keyLines:t};if(Ko(i.contents))for(let e of i.contents.items){let n=e.key;if(!Jo(n)||typeof n.value!=`string`||!n.range)continue;let i=0,a=Math.min(n.range[0],r.length);for(let e=0;e<a;e++)r.charCodeAt(e)===10&&i++;t.has(n.value)||t.set(n.value,i+1)}return{data:a,keyLines:t}}function loe(e){if(e===void 0)return``;let t;if(typeof e==`string`)t=`"${e}"`;else try{t=JSON.stringify(e)??String(e)}catch{t=String(e)}return t.length>60&&(t=`${t.slice(0,57)}…`),` (got ${t})`}function uoe(e){if(!e.startsWith(`/`))return null;let t=e.slice(1).split(`/`)[0]??``;return t===``?null:t.replace(/~1/g,`/`).replace(/~0/g,`~`)}function doe(e){return e.split(`/`).slice(1).map(e=>e.replace(/~1/g,`/`).replace(/~0/g,`~`)).join(`.`)}function _5(e,t,n){if(t.length===0)return[];let r=n?.source??`frontmatter`,{data:i,keyLines:a}=coe(e),o=e.split(`
|
|
569
|
+
`),s=e=>({start:{line:e,character:0},end:{line:e,character:o[e]?.length??0}}),c=[];for(let{schema:e,ruleId:n}of t){let t=soe(e);if(t&&!t(i))for(let e of t.errors??[]){let t=e.keyword;if(t===`if`)continue;let o=0,l,u=`invalid`,d;if(t===`maxProperties`&&e.instancePath===``)l=`This document must not have frontmatter`;else if(t===`required`&&e.instancePath===``){let t=String(e.params.missingProperty??``);l=`Frontmatter property "${t}" is required`,u=`missing`,t!==``&&(d=t)}else if(e.instancePath===``)l=`Frontmatter ${e.message??`violates "${t}"`}`;else{let n=uoe(e.instancePath);n!==null&&(o=a.get(n)??0);let r=doe(e.instancePath);if(t===`enum`){let t=e.params.allowedValues??[],a=n!==null&&r===n?i[n]:void 0;l=`Frontmatter property "${r}" must be one of: ${t.map(String).join(`, `)}${loe(a)}`}else l=`Frontmatter property "${r}" ${e.message??`violates "${t}"`}`}c.push({range:s(o),severity:`warning`,source:r,code:n??t,message:l,frontmatterScope:u,...d===void 0?{}:{frontmatterProperty:d}})}}return c}var v5=`doc`;function foe(e,t){return tG(e,QW({strings:{[v5]:e},config:t})[v5]??[])}function poe(e,t){let n=QW({strings:{[v5]:e},config:t})[v5]??[],r=e.split(`
|
|
570
|
+
`),i=moe(t);return n.map(e=>goe(e,r,hoe(e,i)))}function moe(e){let t=new Map;return Object.entries(e).forEach(([e,n],r)=>{let i=e.toUpperCase();if(i===`DEFAULT`)return;let a=null;if(n===`error`||n===`warning`)a=n;else if(typeof n==`object`&&n&&!Array.isArray(n)){let e=n.severity;(e===`error`||e===`warning`)&&(a=e)}a!==null&&t.set(i,{entryIndex:r,severity:a})}),t}function hoe(e,t){let n;for(let r of e.ruleNames){let e=t.get(r.toUpperCase());e!==void 0&&(n===void 0||e.entryIndex>n.entryIndex)&&(n=e)}return n?.severity??`warning`}function goe(e,t,n){let[r,i]=e.errorRange??[1,null],a=e.lineNumber-1,o=(r??1)-1,s=t[a]?.length??0,c=i==null?s:Math.min(o+i,s),l=e.fixInfo?[_oe(e.fixInfo,e.lineNumber,t)]:void 0;return{range:{start:{line:a,character:o},end:{line:a,character:Math.max(c,o)}},severity:n,source:`markdownlint`,code:e.ruleNames[0]??`MD000`,message:e.errorDetail?`${e.ruleDescription}: ${e.errorDetail}`:e.ruleDescription,...l?{fixes:l}:{}}}function _oe(e,t,n){let r=e.lineNumber??t,i=r-1;if(e.deleteCount===-1){if(r<n.length)return{range:{start:{line:i,character:0},end:{line:i+1,character:0}},newText:``};if(i>0){let e=n[i-1]?.length??0;return{range:{start:{line:i-1,character:e},end:{line:i,character:n[i]?.length??0}},newText:``}}return{range:{start:{line:0,character:0},end:{line:0,character:n[0]?.length??0}},newText:``}}let a=(e.editColumn??1)-1;return{range:{start:{line:i,character:a},end:{line:i,character:a+Math.max(0,e.deleteCount??0)}},newText:e.insertText??``}}var y5=[`no-wiki-links`,`log-shape`,`index-shape`,`reserved-casing`,`frontmatter-required`,`frontmatter-recommended`,`frontmatter-provenance`,`frontmatter-computation`,`frontmatter-reserved-index`,`frontmatter-root-index`,`project-no-mdx`];function b5(e,t){return e?.[t]!==!1}var voe=[{id:`structure`,ids:[`no-wiki-links`,`log-shape`,`index-shape`,`reserved-casing`]},{id:`frontmatter`,ids:[`frontmatter-required`,`frontmatter-recommended`,`frontmatter-provenance`,`frontmatter-computation`,`frontmatter-reserved-index`,`frontmatter-root-index`]},{id:`project`,ids:[`project-no-mdx`]}];function yoe(e){throw Error(`Unhandled OkfRuleId variant: ${JSON.stringify(e)}`)}function boe(e){throw Error(`Unhandled OkfRuleGroupId variant: ${JSON.stringify(e)}`)}var xoe=`.ok/okf`;function Soe(e){return`${e.replace(/^frontmatter-/,``)}.schema.json`}function x5(e){return`${xoe}/${Soe(e)}`}var Coe={$schema:`http://json-schema.org/draft-07/schema#`,title:`OKF v0.2 — required frontmatter`,description:"The OKF v0.2 conformance floor. A bundle is conformant when every non-reserved .md file contains a parseable YAML frontmatter block whose `type` is non-empty. This schema is the whole of that floor: a concept carrying only `type` is fully conformant. Section numbers cite OKF v0.2: https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/SPEC.md#11-conformance",type:`object`,required:[`type`],properties:{type:{type:`string`,pattern:`\\S`,description:"REQUIRED, and the only always-required key in OKF. A short string identifying the kind of concept; consumers use it for routing, filtering, and presentation. Type values are not registered centrally — pick something descriptive and self-explanatory (`BigQuery Table`, `BigQuery Dataset`, `API Endpoint`, `Metric`, `Playbook`, `Reference`, `Attested Computation`). Consumers must tolerate unknown types, typically by treating them as generic concepts. The `\\S` pattern is what makes §11 rule 2 mean what it says, and it replaces a `minLength` rather than joining one: a length check alone accepts a whitespace-only value that no consumer can route on, and having both would report one mistake twice. OKF v0.2 §4.1, §11."}}},woe={$schema:`http://json-schema.org/draft-07/schema#`,title:`OKF v0.2 — recommended frontmatter`,description:"Shapes for the OKF v0.2 recommended keys. Every key here is optional, and nothing is constrained beyond the shape OKF states: declaring a key pins its YAML type when present (so `tags` written as a comma-separated string warns) and advertises it to agents at read time. Section numbers cite OKF v0.2: https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/SPEC.md#41-frontmatter",type:`object`,properties:{title:{type:`string`,description:`Human-readable display name. If omitted, consumers MAY derive a title from the filename. OKF v0.2 §4.1.`},description:{type:`string`,description:"A single sentence summarizing the concept. Used by `index.md` generators, search snippets, and previews. OKF v0.2 §4.1."},resource:{type:`string`,format:`uri-reference`,description:"A URI that uniquely identifies the underlying asset the concept describes. Absent for concepts that describe abstract ideas rather than physical resources. Path-valued: an absolute URL, a bundle-relative path beginning with `/`, or an ordinary relative path — hence `uri-reference`, not `uri`, which would reject `/tables/customers.md`. OKF v0.2 §4.1, §6.2."},tags:{type:`array`,items:{type:`string`},description:`A YAML list of short strings for cross-cutting categorization. Tags stay a first-class concept through this field; OKF specifies no separate per-tag file format, so a consumer that wants a tag-browsing view synthesizes one by scanning frontmatter. OKF v0.2 §3.1, §4.1.`},timestamp:{description:"LEGACY (OKF v0.1), superseded by `generated.at` in v0.2 — one of the two deliberate breaking changes. Consumers MAY fall back to it when `generated` is absent; new documents SHOULD write `generated: { by, at }` instead. Documented here so agents are told what it is and what replaced it, but deliberately left unconstrained: v0.2 does not define it as a producer field, so validating its shape would be a rule OKF no longer has. OKF v0.2 §5.2, §13.1."}}},Toe={$schema:`http://json-schema.org/draft-07/schema#`,title:`OKF v0.2 — provenance, trust, and lifecycle frontmatter`,description:'The optional OKF v0.2 families that make "where did this come from", "how much should I trust it", and "is it still current" answerable from frontmatter alone. Every key is optional, and absence carries meaning rather than being an error: a concept with no `verified` is unverified, and a consumer must not reject it. Only `sources[].resource` and `generated.by` are required-when-their-parent-is-present, because those are the two fields OKF marks REQUIRED in this family; every other field is described but not mandated, so nothing else is enforced. Section numbers cite OKF v0.2: https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/SPEC.md#5-provenance-trust-and-lifecycle',type:`object`,properties:{sources:{type:`array`,description:"The materials this concept derives from, external or internal to the bundle. Lineage is expressed through links rather than a dedicated field: when an entry's `resource` points at another OKF concept, the derivation edge already exists in the bundle graph, so a consumer may recurse into that source's own `sources`. OKF v0.2 §5.1.",items:{type:`object`,required:[`resource`],properties:{resource:{type:`string`,description:"REQUIRED within an entry. Either a concrete artifact a consumer can follow (an absolute URL, a bundle-relative path, or a path into a `references/` subdirectory) or a population or scope descriptor it cannot, for example `all queries in BigQuery project X`. Deliberately NOT format-constrained: a scope descriptor is prose, so a `uri-reference` check here would warn on conformant documents. OKF v0.2 §5.1, §6.2, §6.3."},id:{type:`string`,description:"Optional. A stable key used to attribute individual claims: a markdown footnote whose label is this id (`[^ga4-schema]`) attributes the claim it follows. SHOULD be present when the body cites the source. Keyed rather than positional because agents constantly rewrite these documents — a positional index misattributes silently the moment the list is reordered. OKF v0.2 §5.1."},title:{type:`string`,description:`Optional. Human-readable label for the source. OKF v0.2 §5.1.`},author:{type:`string`,description:"Optional credibility signal — an authority signal: who or what produced the source. OKF describes this as following the actor convention (§7), but its own examples use a `team:<id>` prefix that the three §7 forms do not cover, so no pattern is enforced. OKF v0.2 §5.1, §7."},usage_count:{type:`integer`,description:"Optional credibility signal — an adoption and liveness signal: how often `resource` was exercised (dashboard views, query executions, page reads) over `usage_window`. For a single artifact it is that artifact's own exercise count; for a scope descriptor it is the number of exercises within the scope that touch the concept. Coarse by design: comparable at the alive-versus-dead and order-of-magnitude level and against a source's own history, but not a precise cross-kind ranking. Read as liveness and trend, not as a score. OKF v0.2 §5.1."},last_modified:{type:`string`,format:`date`,description:"Optional credibility signal — a recency signal: when the source itself last changed, as `YYYY-MM-DD`. Distinct from `generated.at`, which records when the concept was written. OKF v0.2 §5.1."},usage_window:{type:`object`,description:"Optional per-entry override of the `usage_window` written as a sibling of `sources`. OKF v0.2 §5.1.",properties:{from:{type:`string`,format:`date`,description:"Start of the window framing this entry's `usage_count`, as `YYYY-MM-DD`. OKF v0.2 §5.1."},to:{type:`string`,format:`date`,description:"End of the window framing this entry's `usage_count`, as `YYYY-MM-DD`. OKF v0.2 §5.1."}}}}}},usage_window:{type:`object`,description:"Written once as a sibling of `sources`, this frames every `usage_count` in the list with a `{ from, to }` date range. A single entry may carry its own `usage_window` to override it. OKF v0.2 §5.1.",properties:{from:{type:`string`,format:`date`,description:"Start of the shared usage window, as `YYYY-MM-DD`. OKF v0.2 §5.1."},to:{type:`string`,format:`date`,description:"End of the shared usage window, as `YYYY-MM-DD`. OKF v0.2 §5.1."}}},generated:{type:`object`,required:[`by`],description:"How the current content was produced. Kept distinct from `verified` because who wrote a concept need not be who confirmed it. OKF v0.2 §5.2.",properties:{by:{type:`string`,description:"REQUIRED within `generated`. An actor in the OKF convention: `<producer>/<version>` for agents and tools (`reference_agent/gemini-2.5-pro`), `human:<id>` for a person (`human:ahormati`), or `process:<id>` for an automated process (`process:finance-nightly`). Consumers that classify trust key off the `human:` prefix, so producers MUST use it for hand-authored or human-confirmed content — a rule about which form to pick for which content, which frontmatter alone cannot check, so the three forms are documented here rather than enforced by a pattern. OKF v0.2 §5.2, §7."},at:{type:`string`,format:`date-time`,description:"An ISO 8601 datetime marking the content's last meaningful change. Consumers use it to tell a recent edit from a stale fact. Supersedes v0.1's top-level `timestamp`. OKF v0.2 §5.2, §13.1."}}},verified:{description:'Who or what has confirmed the content against its sources or `resource` — a list of verification events. Multiple entries capture independent checks, for example a human sign-off plus a nightly process; "how recently" is the latest `at`. Independent of `generated.at`: content can change without re-confirmation, and facts can be re-confirmed without regeneration. A single verifier MAY be written as one bare `{ by, at }` mapping without the list dash, and consumers MUST treat that as a one-element list — hence the two accepted shapes here. Absence means unverified, which is a valid state, never a rejection. OKF v0.2 §5.2, §5.3, §11.',anyOf:[{type:`object`,description:`The bare single-verifier mapping form. OKF v0.2 §5.2.`,properties:{by:{type:`string`,description:"The verifying actor: `<producer>/<version>`, `human:<id>`, or `process:<id>`. A `human:` verifier is what raises the trust tier to human-reviewed; non-human verifiers alone yield machine-confirmed. OKF v0.2 §5.2, §5.3, §7."},at:{type:`string`,format:`date-time`,description:`ISO 8601 datetime of the verification event. OKF v0.2 §5.2.`}}},{type:`array`,description:`The list form: one entry per independent verification event. OKF v0.2 §5.2.`,items:{type:`object`,properties:{by:{type:`string`,description:"The verifying actor: `<producer>/<version>`, `human:<id>`, or `process:<id>`. A `human:` verifier is what raises the trust tier to human-reviewed; non-human verifiers alone yield machine-confirmed. OKF v0.2 §5.2, §5.3, §7."},at:{type:`string`,format:`date-time`,description:`ISO 8601 datetime of the verification event. OKF v0.2 §5.2.`}}}}]},status:{enum:[`draft`,`stable`,`deprecated`],description:"Lifecycle state. `draft` = not yet reviewed, possibly incomplete. `stable` = ready for consumption. `deprecated` = kept for links and history, no longer current. Absent means `stable`, so the key is only worth writing to say draft or deprecated. These three values are the whole set OKF defines, which is why this is the pack's only enum. OKF v0.2 §5.4."},stale_after:{type:`string`,format:`date`,description:"An absolute date, `YYYY-MM-DD`: the concept is stale when `today >= stale_after`. Absolute rather than a relative TTL so staleness stays a plain date comparison with no reference to when the concept was read. A date in the past is a freshness signal for consumers, not a violation. OKF v0.2 §5.5, §10.5."}}},Eoe={$schema:`http://json-schema.org/draft-07/schema#`,title:`OKF v0.2 — Attested Computation frontmatter`,description:'Shapes for the OKF v0.2 computation keys, which turn a concept into a sanctioned way to compute a value so a consumer can confirm the agent ran the blessed computation instead of improvising its own. Provenance answers "where did this claim come from"; attestation answers "was this number produced the way we said it must be". This file also carries the one value-shaped rule in the pack: `runtime` is the single key OKF marks REQUIRED here, and only when `type` is `Attested Computation`. Ordinary concepts never match that condition and are unaffected, and no other key in the family is mandated. OKF records the computation and the means to check it and executes nothing itself; receipts and verdicts are runtime artifacts that are never stored in the bundle. Section numbers cite OKF v0.2: https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/SPEC.md#10-attested-computations-concept',type:`object`,if:{required:[`type`],properties:{type:{const:`Attested Computation`,description:"The condition, not a constraint: everything in `then` applies only to documents whose `type` is exactly `Attested Computation`. An ordinary concept never matches, so nothing in this schema is ever asked of it. `type` is also required inside the condition so a document with no type at all fails the conformance floor once, rather than also being told it is missing a `runtime` for a type it never claimed."}}},then:{required:[`runtime`]},properties:{runtime:{type:`string`,description:"REQUIRED for `type: Attested Computation`. The single field that says how to run the computation, and therefore how the executor and attester interpret it and what `parameters` mean — a parameter is a SQL bind variable, a dbt var, or a Python argument depending on the runtime. Keeping `runtime` and `parameters` in one frontmatter is what makes the binding semantics self-evident. Example values: `bigquery`, `postgres`, `dbt`, `python`, `Looker`. Not a closed set, so no enum. OKF v0.2 §10.1, §10.2."},parameters:{type:`array`,description:`The typed, named holes the agent may fill. An agent MAY only supply values for these parameters; it MUST NOT author or edit the computation. That parameter-only surface is what makes "did the sanctioned thing run" a mechanical comparison rather than a judgement call. OKF v0.2 §10.2, §10.3.`,items:{type:`object`,properties:{name:{type:`string`,description:"The parameter name the computation binds, for example `year` bound as `@year` in BigQuery SQL or `{{ var('year') }}` in dbt. OKF v0.2 §10.2, §10.3."},type:{type:`string`,description:"The parameter's type, interpreted by `runtime` (`integer`, `string`, and so on). Deliberately not constrained to JSON Schema type names, because the vocabulary belongs to the runtime. OKF v0.2 §10.2."},required:{type:`boolean`,description:`Whether the agent must supply a value for this parameter. OKF v0.2 §10.2.`}}}},computation:{type:`string`,format:`uri-reference`,description:"Optional. A path to a file holding the computation, used instead of an inline body fence — best for a long or generated computation, or one already kept as a real file shared with non-OKF tooling. When absent, the body's `# Computation` fence IS the computation. Path-valued: an absolute URL, a bundle-relative path beginning with `/`, or a relative path. OKF v0.2 §6.2, §10.2, §10.3."},executor:{type:`object`,description:"How the computation is run. A runner — an agent, or deterministic consumer code — follows `resource`, and the run returns a receipt shaped by `receipt`. Binding the computation with the parameter values into the executable artifact is the consumer's job. OKF v0.2 §10.2, §10.5.",properties:{resource:{type:`string`,format:`uri-reference`,description:"Names the run instructions or code. What sits behind it — a Skill, a script, a container — is a packaging choice; OKF fixes the interface, not the packaging. Conventionally points into a `references/` subdirectory, for example `references/skills/run-on-bq.md`. OKF v0.2 §1, §6.2, §6.3, §10.2."},receipt:{type:`array`,items:{type:`string`},description:"Declares the fields a run must return — the evidence the attester inspects, for example `[job_id, executed_sql, result]` for BigQuery or `[run_id, compiled_sql, result]` for dbt. Because the attester compares the expanded, compiled artifact the receipt carries, a rewritten query, a swapped computation file, or a mutated dependency fails the check. The receipt itself is a runtime artifact and is never stored in the bundle. OKF v0.2 §10.2, §10.3, §10.5."}}},attester:{type:`object`,description:"The deterministic check that inspects a receipt and returns a verdict. Meant to run consumer-side. Distinct from `verified`: `verified` confirms the definition still matches policy and is recorded in the bundle, while attestation confirms a single run produced the value the sanctioned way and is not stored. OKF v0.2 §10.2, §10.6.",properties:{resource:{type:`string`,format:`uri-reference`,description:"Names code — no LLM — that takes a receipt and returns a verdict, independently re-deriving the binding of `computation` with the claimed parameter values to compare against what actually ran. Conventionally points into a `references/` subdirectory, for example `references/attesters/sql-equality.py`. OKF v0.2 §6.2, §6.3, §10.2, §10.3."}}}}},Doe={$schema:`http://json-schema.org/draft-07/schema#`,title:`OKF v0.2 — index files carry no frontmatter`,description:"`index.md` is a reserved filename at any level of the hierarchy and must not be used for a concept document. Index files contain no frontmatter, with exactly one exception — a bundle-root `index.md` may carry `okf_version` — which the scope carves out with a `!index` exclusion rather than a keyword here. `maxProperties: 0` is the mechanism rather than the boolean schema `false`, because a document with no frontmatter block validates as `{}` and `false` would reject that too, flagging the very documents that are correct. `log.md` is deliberately NOT covered: §9 constrains a log's date headings, ordering, and prose entries but never its frontmatter, and OKF's own reference bundle ships a `log.md` carrying `type` and `title`. Section numbers cite OKF v0.2: https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/SPEC.md#8-index-files",type:`object`,maxProperties:0},Ooe={$schema:`http://json-schema.org/draft-07/schema#`,title:`OKF v0.2 — bundle-root index.md`,description:"The bundle-root `index.md` is the only index file OKF permits frontmatter in, and `okf_version` is the key it names there. OKF states the declaration as a MAY, so it is not required here. Nor is the frontmatter closed to other keys: §8 grants the exception for `okf_version` specifically, but §11 tells consumers not to reject a bundle over unknown additional keys, and that ambiguity is resolved in favor of the looser reading. The one thing pinned is the value's shape, because a YAML float is provably lossy where a version string is not. Section numbers cite OKF v0.2: https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/SPEC.md#12-versioning",type:`object`,properties:{okf_version:{type:`string`,pattern:`^[0-9]+\\.[0-9]+$`,description:'The OKF version this bundle targets, as `<major>.<minor>` — currently `"0.2"`. Quote it: unquoted `0.2` parses as a YAML number, so a consumer comparing version strings sees a float instead, and `0.10` would silently become `0.1`. A minor bump is backward-compatible additions; a major bump may rename required fields or change reserved filenames. Consumers that do not understand the declared version should attempt best-effort consumption rather than refusing the bundle. OKF v0.2 §12.'}}},S5=[`**`,`!**/{index,log}`],C5=[{id:`frontmatter-required`,appliesTo:S5,schema:Coe},{id:`frontmatter-recommended`,appliesTo:S5,schema:woe},{id:`frontmatter-provenance`,appliesTo:S5,schema:Toe},{id:`frontmatter-computation`,appliesTo:S5,schema:Eoe},{id:`frontmatter-reserved-index`,appliesTo:[`**/index`,`!index`],schema:Doe},{id:`frontmatter-root-index`,appliesTo:[`index`],schema:Ooe}],koe=Object.fromEntries(y5.filter(e=>!C5.some(t=>t.id===e)).map(e=>[e,!1]));function w5(e,t){return t===void 0?[]:C5.filter(n=>b5(e,n.id)&&l5([...n.appliesTo]).matches(t))}function Aoe(e){return C5.filter(t=>b5(e,t.id)).map(e=>({appliesTo:[...e.appliesTo],file:x5(e.id)}))}function joe(e,t,n){let r=w5(t,n);return r.length===0?[]:_5(e,r.map(e=>({file:x5(e.id),schema:e.schema,ruleId:e.id})),{source:`okf`})}function T5(e,t){return nG(`okf:${e}`,(n,r)=>{try{t(n,r)}catch(t){console.warn(`[lint] OKF rule "${e}" failed${r.data.okfDocName?` on "${r.data.okfDocName}"`:``}`,t)}})}function E5(e,t,n){let r=l5(t);return T5(e,(e,t)=>{r.matches(t.data.okfDocName)&&n(e,t)})}var D5=e=>({line:e.line-1,character:e.column-1});function Moe(e,t){if(e&&`start`in e)return{start:D5(e.start),end:D5(e.end)};if(e){let n=D5(e);return{start:n,end:{line:n.line,character:t[n.line]?.length??0}}}return{start:{line:0,character:0},end:{line:0,character:t[0]?.length??0}}}function Noe(e,t){return{range:Moe(e.place,t),severity:`warning`,source:`okf`,code:e.ruleId??`okf`,message:e.reason}}function Poe(e,t,n){if(t.length===0)return[];let r=Se().use(ie).use(O).use(VP,[`yaml`]);for(let e of t)r.use(e);let i=new _({value:e});n!==void 0&&(i.data.okfDocName=n);let a=r.parse(i);r.runSync(a,i);let o=e.split(`
|
|
571
|
+
`);return i.messages.map(e=>Noe(e,o))}var Foe=`**/index`;function Ioe(e){let t=!1;return h(e,[`link`,`linkReference`],()=>(t=!0,!1)),t}var Loe=E5(`index-shape`,Foe,(e,t)=>{let n=!1;for(let r of e.children){if(r.type===`heading`){n=!0;continue}r.type===`list`&&!n&&t.message(`This index list is not under a section heading, so an Open Knowledge Format consumer reading the file as navigation has no name to file its entries under — an index is one or more heading-led sections of bulleted links.`,r)}h(e,`listItem`,e=>{e.children.some(e=>e.type===`list`)||Ioe(e)||t.message(`This index entry has no link, so an Open Knowledge Format consumer reading the file as navigation has nowhere to follow it. Every entry in the format's own reference bundles is a link followed by a short description.`,e)})}),Roe=`**/log`,zoe=/^\s*(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])(?!\d)/;function Boe(e,t,n){let r=new Date(Date.UTC(e,t-1,n));return r.getUTCFullYear()===e&&r.getUTCMonth()===t-1&&r.getUTCDate()===n}var Voe=/^\s*\d{4}[-/.]\d{1,2}[-/.]\d{1,2}/;function O5(e){let t=e.trim();return t.length>60?`${t.slice(0,59)}…`:t}var Hoe=E5(`log-shape`,Roe,(e,t)=>{let n;h(e,`heading`,e=>{if(e.depth!==2)return;let r=w(e),i=zoe.exec(r);if(!i){t.message(Voe.test(r)?`Log date heading "${O5(r)}" is not in ISO 8601 YYYY-MM-DD form, the one form an Open Knowledge Format log requires of its date headings.`:`Log entry heading "${O5(r)}" is not a date, so it falls outside the dated-entry format an Open Knowledge Format consumer reads a log as — nothing under it reaches the change-history timeline.`,e);return}let a=`${i[1]}-${i[2]}-${i[3]}`;if(!Boe(Number(i[1]),Number(i[2]),Number(i[3]))){t.message(`Log date heading "${a}" is not a real calendar date, so it is not ISO 8601 — the one form an Open Knowledge Format log requires of its date headings.`,e);return}n!==void 0&&a>n&&t.message(`Log date heading "${a}" is newer than the entry above it — an Open Knowledge Format log is a flat list of date-grouped entries, newest first.`,e),n=a})}),Uoe=/\[\[[^[\]\n]+\]\]/g;function Woe(e){let t=`Wiki-link ${e} won't resolve for an external Open Knowledge Format consumer — it renders as literal text and its graph edge is lost.`;return e.includes(`|`)?`${t} The alias "|" also splits a GFM table cell.`:t}var Goe=T5(`no-wiki-links`,(e,t)=>{let n=typeof t.value==`string`?t.value:String(t.value);h(e,`text`,e=>{let r=e.position?.start,i=e.position?.end,a=r?.offset,o=a===void 0||i?.offset===void 0?e.value:n.slice(a,i.offset),s=0,c=r?.line??0,l=r?.column??0,u=e=>{for(;s<e;s+=1)o[s]===`
|
|
572
|
+
`?(c+=1,l=1):l+=1;return{line:c,column:l}};for(let e of o.matchAll(Uoe)){let{index:i}=e;if((a===void 0?o[i-1]:n[a+i-1])===`!`)continue;let s=r&&a!==void 0?{start:u(i),end:u(i+e[0].length)}:void 0;t.message(Woe(e[0]),s)}})}),Koe=[`index`,`log`];function qoe(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);if(n<=0)return t;let r=t.slice(n).toLowerCase();return jX.includes(r)?t.slice(0,n):t}var Joe=T5(`reserved-casing`,(e,t)=>{let n=t.data.okfDocName;if(n===void 0)return;let r=qoe(n),i=r.toLowerCase();Koe.includes(i)&&r!==i&&t.message(`This file is named "${r}", but the Open Knowledge Format only recognizes "${i}". On a case-sensitive filesystem a consumer reads it as an ordinary concept document rather than the reserved file it is meant to be.`)}),k5=[{id:`no-wiki-links`,rule:Goe},{id:`log-shape`,rule:Hoe},{id:`index-shape`,rule:Loe},{id:`reserved-casing`,rule:Joe}],Yoe=k5.map(e=>e.rule);function Xoe(e){return e===void 0?Yoe:k5.filter(t=>b5(e,t.id)).map(e=>e.rule)}var Zoe=Qa([F(),z(Cd),io(N(),Ka())]),Qoe={id:`markdownlint`,sliceSchema:L({enabled:F(),rules:io(N(),Zoe)}),defaultSlice:{enabled:!1,rules:o5},async lint(e,t){return poe(e,s5(t.rules))},fix(e,t){return foe(e,s5(t.rules))}},$oe=L({appliesTo:Qa([N(),I(N())]).optional(),file:N(),enabled:F().optional(),key:N().optional(),schema:io(N(),Ka()).optional()}),A5=[Qoe,{id:`frontmatter`,sliceSchema:L({enabled:F(),schemas:I($oe)}),defaultSlice:{enabled:!1,schemas:[]},async lint(e,t,n){return _5(e,f5(t.schemas,n.docName))},frontmatter:{schemasForDoc:(e,t)=>f5(e.schemas,t),narrowSliceToFrontmatter:e=>e,advertisedMappings:e=>e.schemas}},{id:`okf`,sliceSchema:L({enabled:F(),rules:io(N(),F()).optional(),generate:L({index:F().optional()}).optional()}),defaultSlice:{enabled:!1},async lint(e,t,n){return[...Poe(e,Xoe(t.rules),n.docName),...joe(e,t.rules,n.docName)]},frontmatter:{schemasForDoc:(e,t)=>w5(e.rules,t),narrowSliceToFrontmatter:e=>({...e,rules:{...e.rules,...koe}}),advertisedMappings:e=>Aoe(e.rules)}}],ese={enabled:!0,plugins:Object.fromEntries(A5.map(e=>[e.id,e.defaultSlice]))};function tse(e,t){if(!e?.enabled||t===void 0||t===``)return[];let n=[];for(let r of A5){if(r.frontmatter===void 0)continue;let i=e.plugins[r.id];i?.enabled===!0&&n.push(...r.frontmatter.schemasForDoc(i,t))}return n}function nse(e){let t=Object.fromEntries(A5.map(t=>{let n=e.plugins[t.id]??t.defaultSlice;return t.frontmatter===void 0?[t.id,{...n,enabled:!1}]:[t.id,t.frontmatter.narrowSliceToFrontmatter(n)]}));return{...e,plugins:t}}var rse=new Set([`.markdownlint.json`,`.markdownlint.jsonc`]);function ise(e){return rse.has(e)}L({docName:F$,summary:R$,content:N().optional(),...L$}).loose(),L({docName:F$,summary:R$,markdown:N(),position:z([`append`,`prepend`,`replace`]).optional(),extension:z(jX).optional(),...L$}).loose(),L({docName:F$,summary:R$,find:N().min(1),replace:N(),offset:P().int().nonnegative().optional(),...L$}).loose(),L({docName:F$,connectionId:N().min(1),scope:z([`last`,`session`,`file`,`count`]).optional(),count:P().int().positive().optional(),...L$}).loose().refine(e=>e.scope!==`count`||e.count!==void 0,{message:`count is required when scope is 'count'`,path:[`count`]});var j5=L({value:N(),truncatedFrom:P().int().nonnegative().optional(),hint:N().optional()}).loose(),ase=eo(`kind`,[L({kind:B(`inline`),content:N()}),L({kind:B(`truncated`),byteLength:P().int().nonnegative(),hint:N()})]),M5=L({kind:B(`content-divergence`),intendedBytes:P().int().nonnegative(),actualBytes:P().int().nonnegative(),byteDelta:P().int(),divergenceType:N().optional(),currentState:ase.optional(),hint:N().optional()}).loose(),ose=L({type:B(`orphan`),parentCandidates:I(N()),message:N()}).loose(),N5=L({kind:B(`disk-edit-reconciled`),intendedBytes:P().int().nonnegative(),actualBytes:P().int().nonnegative(),byteDelta:P().int(),mergeOutcome:N().optional(),hint:N().optional()}).loose(),P5=eo(`kind`,[M5,N5]),sse=L({kind:B(`mermaid-parse-error`),fenceIndex:P().int().positive(),fenceFirstLine:N(),message:N(),line:P().int().positive().optional()}).loose(),F5=L({href:N(),targetKind:N(),role:N(),sourceForm:N(),resolvedTarget:N().nullable(),reason:N(),resolutionMethod:N(),fallbackTarget:N().nullable().optional(),definition:L({line:P().int().nonnegative(),label:N()}).loose().optional()}).loose(),I5=I(eo(`kind`,[M5,N5,sse,L({kind:B(`lint-violation`),source:N(),code:N(),message:N(),severity:z([`error`,`warning`,`info`,`hint`]),line:P().int().positive(),column:P().int().positive(),linkTarget:N().optional(),localTarget:F5.optional()}).loose()])).min(1),L5=I(L({href:N(),resolvedTo:N().nullable(),reason:z([`no-such-doc`,`no-such-file`,`unresolvable`]),localTarget:F5.optional()}).loose());L({timestamp:N().min(1),summary:j5.optional(),warning:P5.optional(),warnings:I5.optional()}).loose(),L({timestamp:N().min(1),subscriberCount:P().int().nonnegative(),systemSubscriberCount:P().int().nonnegative(),hints:I(ose).optional(),summary:j5.optional(),warning:P5.optional(),warnings:I5.optional(),brokenLinks:L5}).loose(),L({timestamp:N().min(1),subscriberCount:P().int().nonnegative(),systemSubscriberCount:P().int().nonnegative(),summary:j5.optional(),warning:P5.optional(),warnings:I5.optional(),brokenLinks:L5}).loose(),L({docName:N().min(1),scope:z([`last`,`session`,`count`]),undone:F()}).loose(),L({docs:I(L({docName:I$,markdown:N(),position:z([`append`,`prepend`,`replace`]).optional(),extension:z(jX).optional(),summary:R$}).loose()).min(1).max(100),...L$}).loose();var cse=L({type:i1,title:N(),detail:N().optional()}).loose(),lse=eo(`status`,[L({status:B(`written`),docName:N().min(1),summary:j5.optional(),warnings:I5.optional(),brokenLinks:L5}).loose(),L({status:B(`error`),docName:N().min(1),error:cse}).loose()]);L({timestamp:N().min(1),results:I(lse),written:P().int().nonnegative(),failed:P().int().nonnegative()}).loose(),L({docName:F$,patch:io(N(),Qa([hm,Wa()])),types:io(N(),z(fm)).optional(),summary:R$,...L$}).loose(),L({timestamp:N().min(1),subscriberCount:P().int().nonnegative(),systemSubscriberCount:P().int().nonnegative(),appliedKeys:I(N()),summary:j5.optional(),warning:P5.optional(),warnings:I5.optional(),brokenLinks:L5}).loose();function use(e){return{enabled:e.enabled??!0,plugins:{markdownlint:{...e.markdownlint,rules:e.markdownlint.rules??o5},frontmatter:{enabled:e.frontmatter?.enabled??!1,schemas:e.frontmatter?.schemas??[]},okf:{enabled:e.okf?.enabled??!1,...e.okf?.rules===void 0?{}:{rules:e.okf.rules},generate:{index:e.okf?.generate?.index??!1}}}}}var dse=Object.fromEntries(A5.map(e=>[e.id,e.sliceSchema])),fse=L({effective:L({enabled:F(),plugins:L(dse)}),configFile:N().nullable().optional(),configProblems:I(N()).optional()}),pse=Qa([F(),io(N(),Ka())]);L({ruleId:N().min(1).max(64).regex(/^[A-Za-z][A-Za-z0-9_-]*$/),value:Qa([pse,Wa()])}),L({file:N().min(1).max(512),delete:B(!0).optional(),field:N().min(1).max(256).optional(),parentPath:I(Qa([N().min(1).max(256),L({items:B(!0)}).strict()])).max(8).optional(),removeField:B(!0).optional(),renameTo:N().min(1).max(256).optional(),constraint:L({type:z([`string`,`number`,`boolean`,`array`,`object`]).nullable().optional(),enum:I(Qa([N(),P(),F()])).nullable().optional(),itemsEnum:I(Qa([N(),P(),F()])).nullable().optional(),itemsType:z([`string`,`number`,`boolean`,`object`]).nullable().optional(),pattern:N().nullable().optional(),format:N().nullable().optional(),description:N().max(2048).nullable().optional(),required:F().optional()}).optional()}).refine(e=>e.delete===void 0||e.field===void 0&&e.constraint===void 0&&e.removeField===void 0&&e.renameTo===void 0,{message:`delete cannot be combined with a field edit`}).refine(e=>[e.constraint,e.removeField,e.renameTo].filter(e=>e!==void 0).length<=1,{message:`constraint, removeField, and renameTo are mutually exclusive`}).refine(e=>e.removeField===void 0&&e.renameTo===void 0||e.field!==void 0,{message:`removeField and renameTo require field`}).refine(e=>e.parentPath===void 0||e.field!==void 0,{message:`parentPath requires field`}).refine(e=>e.field===void 0?e.constraint===void 0:e.constraint!==void 0||e.removeField!==void 0||e.renameTo!==void 0,{message:`field requires constraint, removeField, or renameTo`});var mse=L({schemas:I(N()),truncated:F()}).strict(),R5=L({line:P(),character:P()}),z5=L({start:R5,end:R5}),B5=L({range:z5,severity:z([`error`,`warning`,`info`,`hint`]),source:N(),code:N(),message:N(),fixes:I(L({range:z5,newText:N()})).optional(),frontmatterScope:z(yd).optional(),frontmatterProperty:N().optional()});L({files:I(L({file:N(),diagnostics:I(B5),warnings:I(N()).optional()})),fileCount:P(),errorCount:P(),warningCount:P(),warnings:I(N())});var hse=B5.extend({linkTarget:N().optional(),localTarget:F5.optional()}),gse=L({files:I(L({file:N(),diagnostics:I(hse)})),fileCount:P(),errorCount:P(),warningCount:P(),warnings:I(N())}),V5=L({errorCount:P().int().nonnegative(),warningCount:P().int().nonnegative()}),_se=L({files:I(L({file:N(),lint:V5,links:V5})),fileCount:P().int().nonnegative(),errorCount:P().int().nonnegative(),warningCount:P().int().nonnegative(),warnings:I(N())});L({docName:F$,summary:R$,...L$}).loose();var vse=L({file:N(),fixedCount:P(),diagnostics:I(B5),errorCount:P(),warningCount:P(),warning:N().optional()});function yse(e){let t=e.trim().replace(/^\.\//,``);if(!t.startsWith(`.ok/schemas/`))return!1;let n=t.slice(12);return n.length>0&&!n.includes(`/`)&&!n.includes(`\\`)&&n!==`.`&&n!==`..`}function bse(e){let t=e.trim().toLowerCase().split(`/`).pop()??``;return t.endsWith(`.schema.json`)&&t.length>12?!0:yse(e)&&t.endsWith(`.json`)}var H5=[{id:`MD001`,alias:`heading-increment`,aliases:[`heading-increment`],name:`Heading levels should only increment by one level at a time`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md001.md`,tags:[`headings`],options:[{key:`front_matter_title`,type:`string`,description:`RegExp for matching title in front matter`,default:`^\\s*title\\s*[:=]`}]},{id:`MD003`,alias:`heading-style`,aliases:[`heading-style`],name:`Heading style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md003.md`,tags:[`headings`],options:[{key:`style`,type:`enum`,description:`Heading style`,enum:[`consistent`,`atx`,`atx_closed`,`setext`,`setext_with_atx`,`setext_with_atx_closed`],default:`consistent`}]},{id:`MD004`,alias:`ul-style`,aliases:[`ul-style`],name:`Unordered list style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md004.md`,tags:[`bullet`,`ul`],options:[{key:`style`,type:`enum`,description:`List style`,enum:[`consistent`,`asterisk`,`plus`,`dash`,`sublist`],default:`consistent`}]},{id:`MD005`,alias:`list-indent`,aliases:[`list-indent`],name:`Inconsistent indentation for list items at the same level`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md005.md`,tags:[`bullet`,`ul`,`indentation`],options:[]},{id:`MD007`,alias:`ul-indent`,aliases:[`ul-indent`],name:`Unordered list indentation`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md007.md`,tags:[`bullet`,`ul`,`indentation`],options:[{key:`indent`,type:`integer`,description:`Spaces for indent`,default:2,minimum:1},{key:`start_indented`,type:`boolean`,description:`Whether to indent the first level of the list`,default:!1},{key:`start_indent`,type:`integer`,description:`Spaces for first level indent (when start_indented is set)`,default:2,minimum:1}]},{id:`MD009`,alias:`no-trailing-spaces`,aliases:[`no-trailing-spaces`],name:`Trailing spaces`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md009.md`,tags:[`whitespace`],options:[{key:`br_spaces`,type:`integer`,description:`Spaces for line break`,default:2,minimum:0},{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!1},{key:`list_item_empty_lines`,type:`boolean`,description:`Allow spaces for empty lines in list items`,default:!1},{key:`strict`,type:`boolean`,description:`Include unnecessary breaks`,default:!1}]},{id:`MD010`,alias:`no-hard-tabs`,aliases:[`no-hard-tabs`],name:`Hard tabs`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md010.md`,tags:[`whitespace`,`hard_tab`],options:[{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!0},{key:`ignore_code_languages`,type:`string-array`,description:`Fenced code languages to ignore`,default:[]},{key:`spaces_per_tab`,type:`integer`,description:`Number of spaces for each hard tab`,default:1,minimum:0}]},{id:`MD011`,alias:`no-reversed-links`,aliases:[`no-reversed-links`],name:`Reversed link syntax`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md011.md`,tags:[`links`],options:[]},{id:`MD012`,alias:`no-multiple-blanks`,aliases:[`no-multiple-blanks`],name:`Multiple consecutive blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md012.md`,tags:[`whitespace`,`blank_lines`],options:[{key:`maximum`,type:`integer`,description:`Consecutive blank lines`,default:1,minimum:1}]},{id:`MD013`,alias:`line-length`,aliases:[`line-length`],name:`Line length`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md013.md`,tags:[`line_length`],options:[{key:`line_length`,type:`integer`,description:`Number of characters`,default:80,minimum:1},{key:`heading_line_length`,type:`integer`,description:`Number of characters for headings`,default:80,minimum:1},{key:`code_block_line_length`,type:`integer`,description:`Number of characters for code blocks`,default:80,minimum:1},{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!0},{key:`tables`,type:`boolean`,description:`Include tables`,default:!0},{key:`headings`,type:`boolean`,description:`Include headings`,default:!0},{key:`strict`,type:`boolean`,description:`Strict length checking`,default:!1},{key:`stern`,type:`boolean`,description:`Stern length checking`,default:!1}]},{id:`MD014`,alias:`commands-show-output`,aliases:[`commands-show-output`],name:`Dollar signs used before commands without showing output`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md014.md`,tags:[`code`],options:[]},{id:`MD018`,alias:`no-missing-space-atx`,aliases:[`no-missing-space-atx`],name:`No space after hash on atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md018.md`,tags:[`headings`,`atx`,`spaces`],options:[]},{id:`MD019`,alias:`no-multiple-space-atx`,aliases:[`no-multiple-space-atx`],name:`Multiple spaces after hash on atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md019.md`,tags:[`headings`,`atx`,`spaces`],options:[]},{id:`MD020`,alias:`no-missing-space-closed-atx`,aliases:[`no-missing-space-closed-atx`],name:`No space inside hashes on closed atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md020.md`,tags:[`headings`,`spaces`,`atx_closed`],options:[]},{id:`MD021`,alias:`no-multiple-space-closed-atx`,aliases:[`no-multiple-space-closed-atx`],name:`Multiple spaces inside hashes on closed atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md021.md`,tags:[`headings`,`spaces`,`atx_closed`],options:[]},{id:`MD022`,alias:`blanks-around-headings`,aliases:[`blanks-around-headings`],name:`Headings should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md022.md`,tags:[`headings`,`blank_lines`],options:[{key:`include_front_matter`,type:`boolean`,description:`Include front matter content`,default:!1},{key:`lines_above`,type:`unsupported`,description:`Blank lines above heading`,default:1},{key:`lines_below`,type:`unsupported`,description:`Blank lines below heading`,default:1}]},{id:`MD023`,alias:`heading-start-left`,aliases:[`heading-start-left`],name:`Headings must start at the beginning of the line`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md023.md`,tags:[`headings`,`spaces`],options:[]},{id:`MD024`,alias:`no-duplicate-heading`,aliases:[`no-duplicate-heading`],name:`Multiple headings with the same content`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md024.md`,tags:[`headings`],options:[{key:`siblings_only`,type:`boolean`,description:`Only check sibling headings`,default:!1}]},{id:`MD025`,alias:`single-title`,aliases:[`single-title`,`single-h1`],name:`Multiple top-level headings in the same document`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md025.md`,tags:[`headings`],options:[{key:`front_matter_title`,type:`string`,description:`RegExp for matching title in front matter`,default:`^\\s*title\\s*[:=]`},{key:`level`,type:`integer`,description:`Heading level`,default:1,minimum:1,maximum:6}]},{id:`MD026`,alias:`no-trailing-punctuation`,aliases:[`no-trailing-punctuation`],name:`Trailing punctuation in heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md026.md`,tags:[`headings`],options:[{key:`punctuation`,type:`string`,description:`Punctuation characters`,default:`.,;:!。,;:!`}]},{id:`MD027`,alias:`no-multiple-space-blockquote`,aliases:[`no-multiple-space-blockquote`],name:`Multiple spaces after blockquote symbol`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md027.md`,tags:[`indentation`,`whitespace`,`blockquote`],options:[{key:`list_items`,type:`boolean`,description:`Include list items`,default:!0}]},{id:`MD028`,alias:`no-blanks-blockquote`,aliases:[`no-blanks-blockquote`],name:`Blank line inside blockquote`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md028.md`,tags:[`whitespace`,`blockquote`],options:[]},{id:`MD029`,alias:`ol-prefix`,aliases:[`ol-prefix`],name:`Ordered list item prefix`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md029.md`,tags:[`ol`],options:[{key:`style`,type:`enum`,description:`List style`,enum:[`one`,`ordered`,`one_or_ordered`,`zero`],default:`one_or_ordered`}]},{id:`MD030`,alias:`list-marker-space`,aliases:[`list-marker-space`],name:`Spaces after list markers`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md030.md`,tags:[`ul`,`whitespace`,`ol`],options:[{key:`ul_single`,type:`integer`,description:`Spaces for single-line unordered list items`,default:1,minimum:1},{key:`ol_single`,type:`integer`,description:`Spaces for single-line ordered list items`,default:1,minimum:1},{key:`ul_multi`,type:`integer`,description:`Spaces for multi-line unordered list items`,default:1,minimum:1},{key:`ol_multi`,type:`integer`,description:`Spaces for multi-line ordered list items`,default:1,minimum:1}]},{id:`MD031`,alias:`blanks-around-fences`,aliases:[`blanks-around-fences`],name:`Fenced code blocks should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md031.md`,tags:[`blank_lines`,`code`],options:[{key:`list_items`,type:`boolean`,description:`Include list items`,default:!0}]},{id:`MD032`,alias:`blanks-around-lists`,aliases:[`blanks-around-lists`],name:`Lists should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md032.md`,tags:[`bullet`,`ul`,`blank_lines`,`ol`],options:[]},{id:`MD033`,alias:`no-inline-html`,aliases:[`no-inline-html`],name:`Inline HTML`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md033.md`,tags:[`html`],options:[{key:`allowed_elements`,type:`string-array`,description:`Allowed elements`,default:[]},{key:`table_allowed_elements`,type:`string-array`,description:`Allowed elements in tables`,default:[]}]},{id:`MD034`,alias:`no-bare-urls`,aliases:[`no-bare-urls`],name:`Bare URL used`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md034.md`,tags:[`links`,`url`],options:[]},{id:`MD035`,alias:`hr-style`,aliases:[`hr-style`],name:`Horizontal rule style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md035.md`,tags:[`hr`],options:[{key:`style`,type:`string`,description:`Horizontal rule style`,default:`consistent`}]},{id:`MD036`,alias:`no-emphasis-as-heading`,aliases:[`no-emphasis-as-heading`],name:`Emphasis used instead of a heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md036.md`,tags:[`headings`,`emphasis`],options:[{key:`punctuation`,type:`string`,description:`Punctuation characters`,default:`.,;:!?。,;:!?`}]},{id:`MD037`,alias:`no-space-in-emphasis`,aliases:[`no-space-in-emphasis`],name:`Spaces inside emphasis markers`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md037.md`,tags:[`whitespace`,`emphasis`],options:[]},{id:`MD038`,alias:`no-space-in-code`,aliases:[`no-space-in-code`],name:`Spaces inside code span elements`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md038.md`,tags:[`whitespace`,`code`],options:[]},{id:`MD039`,alias:`no-space-in-links`,aliases:[`no-space-in-links`],name:`Spaces inside link text`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md039.md`,tags:[`whitespace`,`links`],options:[]},{id:`MD040`,alias:`fenced-code-language`,aliases:[`fenced-code-language`],name:`Fenced code blocks should have a language specified`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md040.md`,tags:[`code`,`language`],options:[{key:`allowed_languages`,type:`string-array`,description:`List of languages`,default:[]},{key:`language_only`,type:`boolean`,description:`Require language only`,default:!1}]},{id:`MD041`,alias:`first-line-heading`,aliases:[`first-line-heading`,`first-line-h1`],name:`First line in a file should be a top-level heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md041.md`,tags:[`headings`],options:[{key:`allow_preamble`,type:`boolean`,description:`Allow content before first heading`,default:!1},{key:`front_matter_title`,type:`string`,description:`RegExp for matching title in front matter`,default:`^\\s*title\\s*[:=]`},{key:`level`,type:`integer`,description:`Heading level`,default:1,minimum:1,maximum:6}]},{id:`MD042`,alias:`no-empty-links`,aliases:[`no-empty-links`],name:`No empty links`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md042.md`,tags:[`links`],options:[]},{id:`MD043`,alias:`required-headings`,aliases:[`required-headings`],name:`Required heading structure`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md043.md`,tags:[`headings`],options:[{key:`headings`,type:`string-array`,description:`List of headings`,default:[]},{key:`match_case`,type:`boolean`,description:`Match case of headings`,default:!1}]},{id:`MD044`,alias:`proper-names`,aliases:[`proper-names`],name:`Proper names should have the correct capitalization`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md044.md`,tags:[`spelling`],options:[{key:`names`,type:`string-array`,description:`List of proper names`,default:[]},{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!0},{key:`html_elements`,type:`boolean`,description:`Include HTML elements`,default:!0}]},{id:`MD045`,alias:`no-alt-text`,aliases:[`no-alt-text`],name:`Images should have alternate text (alt text)`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md045.md`,tags:[`accessibility`,`images`],options:[]},{id:`MD046`,alias:`code-block-style`,aliases:[`code-block-style`],name:`Code block style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md046.md`,tags:[`code`],options:[{key:`style`,type:`enum`,description:`Block style`,enum:[`consistent`,`fenced`,`indented`],default:`consistent`}]},{id:`MD047`,alias:`single-trailing-newline`,aliases:[`single-trailing-newline`],name:`Files should end with a single newline character`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md047.md`,tags:[`blank_lines`],options:[]},{id:`MD048`,alias:`code-fence-style`,aliases:[`code-fence-style`],name:`Code fence style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md048.md`,tags:[`code`],options:[{key:`style`,type:`enum`,description:`Code fence style`,enum:[`consistent`,`backtick`,`tilde`],default:`consistent`}]},{id:`MD049`,alias:`emphasis-style`,aliases:[`emphasis-style`],name:`Emphasis style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md049.md`,tags:[`emphasis`],options:[{key:`style`,type:`enum`,description:`Emphasis style`,enum:[`consistent`,`asterisk`,`underscore`],default:`consistent`}]},{id:`MD050`,alias:`strong-style`,aliases:[`strong-style`],name:`Strong style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md050.md`,tags:[`emphasis`],options:[{key:`style`,type:`enum`,description:`Strong style`,enum:[`consistent`,`asterisk`,`underscore`],default:`consistent`}]},{id:`MD051`,alias:`link-fragments`,aliases:[`link-fragments`],name:`Link fragments should be valid`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md051.md`,tags:[`links`],options:[{key:`ignore_case`,type:`boolean`,description:`Ignore case of fragments`,default:!1},{key:`ignored_pattern`,type:`string`,description:`Pattern for ignoring additional fragments`,default:``}]},{id:`MD052`,alias:`reference-links-images`,aliases:[`reference-links-images`],name:`Reference links and images should use a label that is defined`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md052.md`,tags:[`links`,`images`],options:[{key:`ignored_labels`,type:`string-array`,description:`Ignored link labels`,default:[`x`]},{key:`shortcut_syntax`,type:`boolean`,description:`Include shortcut syntax`,default:!1}]},{id:`MD053`,alias:`link-image-reference-definitions`,aliases:[`link-image-reference-definitions`],name:`Link and image reference definitions should be needed`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md053.md`,tags:[`links`,`images`],options:[{key:`ignored_definitions`,type:`string-array`,description:`Ignored definitions`,default:[`//`]}]},{id:`MD054`,alias:`link-image-style`,aliases:[`link-image-style`],name:`Link and image style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md054.md`,tags:[`links`,`images`],options:[{key:`autolink`,type:`boolean`,description:`Allow autolinks`,default:!0},{key:`inline`,type:`boolean`,description:`Allow inline links and images`,default:!0},{key:`full`,type:`boolean`,description:`Allow full reference links and images`,default:!0},{key:`collapsed`,type:`boolean`,description:`Allow collapsed reference links and images`,default:!0},{key:`shortcut`,type:`boolean`,description:`Allow shortcut reference links and images`,default:!0},{key:`url_inline`,type:`boolean`,description:`Allow URLs as inline links`,default:!0}]},{id:`MD055`,alias:`table-pipe-style`,aliases:[`table-pipe-style`],name:`Table pipe style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md055.md`,tags:[`table`],options:[{key:`style`,type:`enum`,description:`Table pipe style`,enum:[`consistent`,`leading_only`,`trailing_only`,`leading_and_trailing`,`no_leading_or_trailing`],default:`consistent`}]},{id:`MD056`,alias:`table-column-count`,aliases:[`table-column-count`],name:`Table column count`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md056.md`,tags:[`table`],options:[]},{id:`MD058`,alias:`blanks-around-tables`,aliases:[`blanks-around-tables`],name:`Tables should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md058.md`,tags:[`table`],options:[]},{id:`MD059`,alias:`descriptive-link-text`,aliases:[`descriptive-link-text`],name:`Link text should be descriptive`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md059.md`,tags:[`links`,`accessibility`],options:[{key:`prohibited_texts`,type:`string-array`,description:`Prohibited link texts`,default:[`click here`,`here`,`link`,`more`]}]},{id:`MD060`,alias:`table-column-style`,aliases:[`table-column-style`],name:`Table column style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md060.md`,tags:[`table`],options:[{key:`style`,type:`enum`,description:`Table column style`,enum:[`any`,`aligned`,`compact`,`tight`],default:`any`},{key:`aligned_delimiter`,type:`boolean`,description:`Aligned delimiter columns`,default:!1}]}],xse=(()=>{let e=new Map;for(let t of H5){e.set(t.id.toUpperCase(),t.id);for(let n of t.aliases)e.set(n.toUpperCase(),t.id)}return e})();function U5(e){return xse.get(e.toUpperCase())??null}function Sse(e,t){let n=U5(t);if(n===null)return;let r;for(let[t,i]of Object.entries(e))U5(t)===n&&(r={key:t,value:i});return r}var Cse=[`Headings`,`Lists`,`Whitespace`,`Code`,`Links & images`,`Style`],wse=[[`headings`,`Headings`],[`bullet`,`Lists`],[`ul`,`Lists`],[`ol`,`Lists`],[`links`,`Links & images`],[`images`,`Links & images`],[`accessibility`,`Links & images`],[`code`,`Code`],[`language`,`Code`],[`emphasis`,`Style`],[`html`,`Style`],[`line_length`,`Whitespace`],[`whitespace`,`Whitespace`],[`hard_tab`,`Whitespace`],[`blank_lines`,`Whitespace`],[`indentation`,`Whitespace`]];function Tse(e){for(let[t,n]of wse)if(e.tags.includes(t))return n;return`Style`}function Ese(e){let t={lint:{errorCount:0,warningCount:0},links:{errorCount:0,warningCount:0}};for(let n of e){let e=n.source===`links`?t.links:t.lint;n.severity===`error`?e.errorCount+=1:e.warningCount+=1}return t}async function Dse(e,t,n){if(!t.enabled)return[];let r=[];for(let i of A5){let a=t.plugins[i.id];if(a.enabled)try{r.push(...await i.lint(e,a,{docName:n}))}catch(e){console.warn(`[lint] plugin "${i.id}" failed${n?` on "${n}"`:``}`,e)}}return r}var Ose=/\p{M}+/gu,kse=/[^\p{L}\p{N}]+/gu,Ase=/^-+|-+$/g;function W5(e){return e.trim().normalize(`NFKD`).replace(Ose,``).toLowerCase().replace(kse,`-`).replace(Ase,``)}function jse(e,t){let n=t.get(e)??0;return t.set(e,n+1),n===0?e:`${e}-${n}`}function G5(e,t){let n=W5(e);return n?jse(n,t):``}function K5(e,t){let n=W5(e);return t?`#${n}-${W5(t)}`:`#${n}`}var q5=new Set([`img`,`video`,`audio`,`mark`,`u`,`ins`]),Mse=new Map(G2.flatMap(e=>e.surface===`compat`&&q5.has(e.rendersAs)?[[e.name,e]]:[]));function J5(e){let t={};for(let n of e.attributes){if(n.type!==`mdxJsxAttribute`)return null;let e=n.name.toLowerCase();if(!(e.length>=3&&e.startsWith(`on`)))if(n.value===null)t[n.name]=!0;else if(typeof n.value==`string`)t[n.name]=n.value;else return null}return t}function Y5(e){let t=e.name;if(!t||!q5.has(t))return null;let n=J5(e);return n===null?null:{type:`element`,tagName:t,properties:n,children:[]}}function X5(e){let t=e.name;if(!t)return null;let n=Mse.get(t);if(!n)return null;let r=J5(e);if(r===null)return null;let i=n.translateProps(r),a={};for(let[e,t]of Object.entries(i))(typeof t==`string`||typeof t==`boolean`)&&(a[e]=t);return{type:`element`,tagName:n.rendersAs,properties:a,children:[]}}var Nse=(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-link`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:K5(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},Pse=(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-embed`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:K5(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},Fse=(e,t)=>{let n=t,r=Y5(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i=X5(n);if(i){e.patch(t,i);let n=e.applyData(t,i);return n.tagName===`img`?{type:`element`,tagName:`p`,properties:{},children:[n]}:n}let a={type:`element`,tagName:`pre`,properties:{className:[`mdx-component`]},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]}]};return e.patch(t,a),e.applyData(t,a)},Ise=(e,t)=>{let n=t,r=Y5(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i=X5(n);if(i)return e.patch(t,i),e.applyData(t,i);let a={type:`element`,tagName:`span`,properties:{className:[`mdx-inline`],dataJsxInline:``},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]};return e.patch(t,a),e.applyData(t,a)},Lse=(e,t)=>{let n=t,r=n.data.reason||`unknown`,i=n.value||``,a=r.replace(/--/g,`—`),o={type:`comment`,value:` Parse error: ${a} `},s={type:`element`,tagName:`pre`,properties:{className:[`mdx-fallback`],dataRawMdxFallback:``,dataReason:a},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:i}]}]};return e.patch(t,s),[o,e.applyData(t,s)]},Rse=(e,t)=>{let n={type:`element`,tagName:`mark`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},zse=(e,t)=>{let n=t,r={type:`element`,tagName:n.data?.sourceForm===`ins`?`ins`:`u`,properties:{},children:e.all(n)};return e.patch(t,r),e.applyData(t,r)};function Z5(e){if(typeof e!=`object`||!e)return``;let t=e;return typeof t.value==`string`?t.value:Array.isArray(t.children)?t.children.map(Z5).join(``):``}var Q5={wikiLink:Nse,wikiLinkEmbed:Pse,mdxJsxFlowElement:Fse,mdxJsxTextElement:Ise,rawMdxFallback:Lse,mark:Rse,underline:zse,tag:(e,t)=>{let n=t.value,r={type:`element`,tagName:`a`,properties:{className:[`tag`],dataTag:n,href:`#tag/${n}`},children:[{type:`text`,value:`#${n}`}]};return e.patch(t,r),e.applyData(t,r)},comment:(e,t)=>{let n={type:`comment`,value:Z5(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},commentBlock:(e,t)=>{let n={type:`comment`,value:Z5(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:(e,t)=>{let n=t.identifier,r={type:`element`,tagName:`sup`,properties:{id:`fnref-${n}`,dataFootnoteRef:``,dataFootnoteId:n,className:[`footnote-ref`]},children:[{type:`element`,tagName:`a`,properties:{href:`#fn-${n}`,className:[`footnote-ref-link`]},children:[{type:`text`,value:`[${n}]`}]}]};return e.patch(t,r),e.applyData(t,r)},footnoteDefinition:(e,t)=>{let n=t.identifier,r={type:`element`,tagName:`aside`,properties:{id:`fn-${n}`,dataFootnoteDef:``,dataFootnoteId:n,className:[`footnote-def`]},children:[{type:`element`,tagName:`div`,properties:{className:[`footnote-body`]},children:e.all(t)},{type:`element`,tagName:`a`,properties:{href:`#fnref-${n}`,className:[`footnote-backref`],ariaLabel:`Back to reference`},children:[{type:`text`,value:`↩`}]}]};return e.patch(t,r),e.applyData(t,r)}},Bse=/url\s*\(\s*['"]?\s*(?:javascript|vbscript|data)\s*:/i,Vse=/\bexpression\s*\(/i,Hse=1e4;function Use(e){return!(e.length>Hse||Bse.test(e)||Vse.test(e))}function $5(e){for(let t of e.split(`,`)){let e=t.trim();if(e!==``&&!hZ(e.split(/\s+/)[0]??``))return!1}return!0}var Wse={a:[`href`,`title`],img:[`src`,`alt`,`title`],video:[`src`,`title`],audio:[`src`,`title`],code:[`className`]},Gse=new Set([`href`,`src`]),Kse=Ce(`<>`),e7=()=>e=>{h(e,`element`,e=>{let t=Wse[e.tagName.toLowerCase()],n=e.properties;if(!(!t||!n))for(let e of t){let t=n[e];if(Array.isArray(t)){let r=t.map(e=>typeof e==`string`?_3(e):e);r.some((e,n)=>e!==t[n])&&(n[e]=r);continue}if(typeof t!=`string`)continue;let r;if(Gse.has(e))if(t===`<>`||t===Kse)r=``;else{let e=_3(t);r=e===t?t:Ce(e)}else r=_3(t);r!==t&&(n[e]=r)}})},t7=()=>e=>{h(e,`element`,e=>{let t=e.tagName.toLowerCase(),n=e.properties;if(!n)return;if(t===`a`||t===`area`||t===`link`||t===`base`){let e=n.href;typeof e==`string`&&!hZ(e)&&delete n.href}if(t===`img`||t===`iframe`||t===`script`||t===`embed`||t===`source`||t===`audio`||t===`video`||t===`track`){let e=n.src;typeof e==`string`&&!hZ(e)&&delete n.src}if(t===`form`){let e=n.action;typeof e==`string`&&!hZ(e)&&delete n.action}if(t===`img`||t===`source`){let e=n.srcSet;typeof e==`string`&&!$5(e)&&delete n.srcSet;let t=n.srcset;typeof t==`string`&&!$5(t)&&delete n.srcset}if(t===`video`){let e=n.poster;typeof e==`string`&&!hZ(e)&&delete n.poster}let r=n.style;typeof r==`string`&&!Use(r)&&delete n.style})};function qse(e){let t=Se().use(be,{handlers:Q5}).use(e7).use(t7).use(iG),n=t.runSync(e);return String(t.stringify(n))}function Jse(e){let t=/\r?\n|\r/g,n=[],r=0,i=t.exec(e);for(;i!==null;)n.push(n7(e.slice(r,i.index),r>0,!0),i[0]),r=i.index+i[0].length,i=t.exec(e);return n.push(n7(e.slice(r),r>0,!1)),n.join(``)}function n7(e,t,n){let r=0,i=e.length,a=e=>e===9||e===32;for(;t&&r<i&&a(e.charCodeAt(r));)r++;for(;n&&i>r&&a(e.charCodeAt(i-1));)i--;return i>r?e.slice(r,i):``}var r7=/\r?\n|\r/,Yse=(e,t)=>{let n=Jse(String(t.value));if(!r7.test(n)){let r={type:`text`,value:n};return e.patch(t,r),e.applyData(t,r)}let r=n.split(r7),i=[];for(let e=0;e<r.length;e++)e>0&&i.push({type:`element`,tagName:`br`,properties:{},children:[]}),r[e].length>0&&i.push({type:`text`,value:r[e]});return i};function Xse(e){let t=Se().use(ie).use(VP,[`yaml`]).use(h8).use(O).use(F8).use(u3).use(C8).use(T3).use(be,{handlers:{...Q5,text:Yse}}).use(e7).use(t7).use(iG);return String(t.processSync(c3(w3(e))))}mI(),NF(),PF(),L({entries:I(L({level:z([`info`,`warn`,`error`]),message:N().max(oY),event:N().optional(),fields:io(N(),Ka()).optional(),ts:P().optional(),sourceId:N().optional(),lineNumber:P().optional()}).loose()).max(100),droppedSinceLastFlush:P().int().min(0).optional()}).loose(),L({accepted:P().int().min(0)}).loose();var Zse=L({exact:N().min(1),prefix:N(),suffix:N(),start:P().int().nonnegative(),end:P().int().nonnegative()}),Qse=I(Qa([N(),P().int().nonnegative()])),$se=eo(`kind`,[L({kind:B(`body`)}),L({kind:B(`property`),key:N().min(1),path:Qse.default([])})]).default({kind:`body`}),ece=z([`anchored`,`orphaned`,`resolved`]),i7=L({threadId:N().min(1),docName:N().min(1),target:$se,anchor:Zse.nullable(),state:ece,queued:F(),latestComment:N(),createdBy:N().min(1),createdAt:P(),updatedAt:P().optional()}),a7=L({docName:N(),instruction:N(),property:N().nullable(),passage:L({exact:N(),prefix:N(),suffix:N()}).nullable(),anchorLost:F(),passageRepeats:F()}).loose(),o7=L({threadId:N(),ok:B(!0)}),s7=L({threadId:N(),ok:B(!1),error:B(`not-found`)});L({threads:I(i7)}).loose();var tce=L({meta:i7,orphaned:F()}).loose(),nce=L({threadId:N()}).loose();L({meta:i7,payload:a7}).loose();var rce=L({results:I(Qa([o7.extend({meta:i7,payload:a7}),s7]))}).loose(),ice=L({results:I(Qa([o7.extend({meta:i7}),s7]))}).loose(),ace=L({status:N().min(1),reason:N()}).loose(),oce=L({docName:N().min(1),content:N(),lifecycle:ace.nullable()}).loose(),c7=L({kind:z([`document`,`asset`,`folder`,`file`]).default(`document`),docName:N().min(1).optional(),docExt:N().min(1).default(`.md`),size:P().int().nonnegative(),modified:N().min(1),isSymlink:F().default(!1),canonicalDocName:N().nullable().default(null),targetPath:N().nullable().default(null),path:N().min(1).optional(),assetExt:N().min(1).optional(),mediaKind:z([`image`,`video`,`audio`,`pdf`,`text`,`mermaid`,`excalidraw`]).nullable().optional(),referencedBy:I(N().min(1)).optional(),hasChildren:F().optional()}).loose().refine(e=>e.kind===`document`?e.docName!==void 0&&e.path===void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.kind===`folder`?e.docName===void 0&&e.path!==void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0:e.kind===`file`?e.path!==void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.path!==void 0&&e.assetExt!==void 0&&e.referencedBy!==void 0&&e.hasChildren===void 0,{message:`document/asset/folder/file kind must match its required fields (document → docName; asset → path+assetExt+referencedBy; folder → path only, no docName; file → path, no mediaKind/referencedBy/hasChildren)`}),sce=L({documents:I(c7),truncated:F().optional()}).loose(),cce=L({source:N().min(1),anchor:N().nullable(),title:N(),snippet:N().nullable()}).loose(),lce=L({docName:N().min(1),backlinks:I(cce)}).loose(),uce=L({counts:io(N().min(1),P().int().nonnegative())}).loose();L({counts:io(N().min(1),P().int().nonnegative())}).loose();var dce=eo(`kind`,[L({kind:B(`doc`),docName:N().min(1),anchor:N().nullable(),title:N(),snippet:N().nullable()}).loose(),L({kind:B(`external`),url:N().min(1),title:N(),snippet:N().nullable()}).loose()]),fce=L({role:N().min(1),sourceForm:N().min(1),targetKind:N().min(1),href:N(),resolvedTarget:N().nullable(),status:N().min(1),reason:N().nullable(),resolutionMethod:N().min(1),fallbackTarget:N().nullable().default(null),range:L({start:P().int().nonnegative(),end:P().int().nonnegative()}),line:P().int().nonnegative(),column:P().int().nonnegative(),definition:L({label:N(),line:P().int().nonnegative()}).nullable().default(null)}).loose(),pce=L({docName:N().min(1),forwardLinks:I(dce),localTargets:I(fce).optional()}).loose(),mce=eo(`kind`,[L({id:N().min(1),kind:B(`doc`),docName:N().min(1),anchor:N().nullable(),label:N(),cluster:N().nullable(),category:N().nullable(),tags:I(N()).nullable(),managed:F().optional()}).loose(),L({id:N().min(1),kind:B(`external`),url:N().min(1),label:N()}).loose()]),hce=L({source:N().min(1),target:N().min(1)}).loose(),gce=L({nodes:I(mce),links:I(hce)}).loose(),_ce=L({ts:P().int().min(0),url:N(),method:N(),ua:N().optional(),origin:N().optional(),referer:N().optional(),host:N().optional(),remote:N().optional(),secChUa:N().optional(),secChUaMobile:N().optional(),secChUaPlatform:N().optional(),secFetchSite:N().optional(),secFetchDest:N().optional(),secFetchMode:N().optional(),secFetchUser:N().optional()}).loose(),vce=L({app:Qa([B(`cursor`),B(`codex`),B(`claude`),Wa()]),signals_fired:I(N())}).loose();L({entries:I(_ce),count:P().int().min(0),detection:vce}).loose(),L({writers:I(L({id:N().min(1),name:N().optional(),email:N().optional()}).loose()).optional(),summary:R$,...L$}).loose(),L({checkpointRef:N().min(1)}).loose();var yce=L({v:P().int().optional(),id:N().min(1),name:N().min(1),colorSeed:N().optional(),docs:I(N()),summaries:I(N()).optional()}).loose();L({entries:I(L({sha:N().min(1),timestamp:N().min(1),author:N(),authorEmail:N(),type:z([`checkpoint`,`wip`,`upstream`,`park`]),message:N(),contributors:I(yce),checkpoint:Ka().nullable(),parentSha:N().nullable().optional()}).loose()),total:P().int().nonnegative().optional(),truncated:F().optional(),hasMore:F().optional()}).loose(),L({sha:N().regex(/^[0-9a-f]{40}$/i),content:N(),timestamp:N(),author:N()}).loose();var bce=L({contentDir:N().min(1),pathSeparator:z([`/`,`\\`]),symlinkResolved:F()}).loose();I(eo(`source`,[L({docName:N().min(1),timestamp:N().min(1),size:P().int().nonnegative(),source:B(`flat`)}).loose(),L({docName:N().min(1),timestamp:N().min(1),source:B(`timeline`),sha:N().min(1)}).loose()])).meta({description:"Flat array of rescue buffer entries; discriminated via `source`."});var xce=L({domain:N().min(1),title:N().optional(),description:N().optional(),siteName:N().optional(),faviconDataUri:N().optional()}).loose();L({url:N()}).loose();var Sce=eo(`ok`,[L({ok:B(!0),metadata:xce}).loose(),L({ok:B(!1),reason:N()}).loose()]),Cce=L({orphans:I(L({docName:N().min(1),title:N()}).loose())}).loose(),wce=L({hubs:I(L({docName:N().min(1),title:N(),count:P().int().nonnegative()}).loose())}).loose(),Tce=L({source:N().min(1),title:N(),snippet:N().nullable()}).loose();L({deadLinks:I(L({target:N().min(1),sources:I(Tce)}).loose())}).loose(),L({target:L({docName:N().min(1),title:N(),aliases:I(N())}).loose(),mentions:I(L({source:N().min(1),excerpt:N(),offset:P().int().nonnegative()}).loose()),truncated:F()}).loose(),L({projectPath:N().min(1)}).loose();var Ece=z([`not-a-git-worktree`,`init-failed`]);eo(`ok`,[L({ok:B(!0),projectPath:N().min(1)}).loose(),L({ok:B(!1),reason:Ece,message:N().min(1)}).loose()]),L({host:N().min(1).optional()}).loose(),L({host:N().min(1).optional(),token:N().min(1)}).loose(),L({host:N(),login:N()}).loose(),L({key:N().min(1)}).loose(),L({keyPresent:F()}).loose();var Dce=z([`no_key`,`invalid_endpoint`,`rate_limit`,`timeout`,`http_error`,`network`,`dims_mismatch`,`malformed_response`]),Oce=eo(`ok`,[L({ok:B(!0),endpoint:N().min(1),model:N().min(1),dimensions:P().int().positive()}).loose(),L({ok:B(!1),endpoint:N().min(1),model:N().min(1),reason:Dce,status:P().int().optional()}).loose()]);L({name:N().refine(e=>e.trim().length>0,{message:`name must be non-empty`}),email:N().refine(e=>e.trim().length>0,{message:`email must be non-empty`})}).loose(),L({authenticated:F()}).loose(),L({channel:z([`login`,`gh-login`]).default(`login`)}).loose(),L({}).loose();var l7=65536;function u7(e){let t=e.match(om);return t?{fenced:t[0],body:e.slice(t[0].length)}:{fenced:``,body:e}}function kce(e){if(e.trim()===``)return{doc:new nl({}),map:{}};let t;try{t=pu(e,{uniqueKeys:!1})}catch(e){let t=e instanceof Error?e.message:String(e);return{doc:new nl({}),map:null,parseError:`parse threw: ${t}`}}if(t.errors.length>0)return{doc:t,map:null,parseError:t.errors[0]?.message??`yaml parse errors`};let n;try{n=t.toJS()}catch(e){let n=e instanceof Error?e.message:String(e);return{doc:t,map:null,parseError:`toJS threw: ${n}`}}if(typeof n!=`object`||!n||Array.isArray(n))return{doc:t,map:null,parseError:`top-level value is not a mapping`};let r=bm.safeParse(n);if(!r.success){let e=r.error.issues[0],n=e&&Array.isArray(e.path)?e.path.join(`.`):``,i=e?.message??`unknown`;return{doc:t,map:null,parseError:n?`value at "${n}" failed schema: ${i}`:`schema validation failed: ${i}`}}return{doc:t,map:r.data}}function d7(e){return e===``?{doc:new nl({}),map:{}}:kce(um(e))}function f7(e){let{fenced:t}=u7(e),{map:n,parseError:r}=d7(t);return{map:n??{},parseError:r}}function p7(e){let{fenced:t}=u7(e);if(t===``)return[];let{doc:n,map:r}=d7(t);return r===null?[]:_7(n)}function m7(e){return typeof e==`object`&&!!e&&`key`in e}function h7(e){let t=e.key;return typeof t==`string`?t:t&&typeof t==`object`&&`value`in t&&typeof t.value==`string`?t.value:null}function g7(e,t){let n=e.key;if(typeof n==`string`){e.key=t;return}if(n&&typeof n==`object`){n.value=t;return}e.key=t}function _7(e){let t=e.contents;if(!t||!(`items`in t)||!Array.isArray(t.items))return[];let n=[];for(let e of t.items){if(!m7(e))continue;let t=h7(e);t!==null&&n.push(t)}return n}function v7(e){if(e.contents==null||!(`items`in e.contents)){let t=e.createNode({});return e.contents=t,t}return e.contents}function Ace(e){let t=e.contents;return!t||!(`items`in t)||(t.items?.length??0)===0?``:Om(e.toString(wm))}function jce(e){let t=new TextEncoder().encode(e).byteLength;return t>65536?{kind:`region_too_large`,bytes:t,limit:l7}:null}function y7(e){let t=Ace(e),n=jce(t);return n?{ok:!1,error:n}:{ok:!0,nextFenced:t}}function Mce(e,t){if(Object.hasOwn(t,`frontmatter`))return{ok:!1,error:{kind:`reserved_key`,key:dm}};let{doc:n,map:r}=d7(e);if(r===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};try{v7(n);for(let[e,r]of Object.entries(t)){if(r===null){n.delete(e);continue}let t=hm.safeParse(r);if(!t.success)return{ok:!1,error:{kind:`invalid_value`,key:e,reason:t.error.issues[0]?.message??`invalid value`}};n.set(e,Dm(n,n.get(e,!0),t.data))}return y7(n)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function Nce(e,t,n,r={}){if(t===`frontmatter`||n===`frontmatter`)return{ok:!1,error:{kind:`reserved_key`,key:dm}};let{doc:i,map:a}=d7(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};if(t===n)return{ok:!0,nextFenced:e};let o=i.contents;if(!o||!(`items`in o)||!Array.isArray(o.items))return{ok:!1,error:{kind:`unknown_key`,key:t}};let s=o.items.find(e=>m7(e)&&h7(e)===t);if(!s)return{ok:!1,error:{kind:`unknown_key`,key:t}};if(!r.allowDuplicate&&o.items.some(e=>m7(e)&&e!==s&&h7(e)===n))return{ok:!1,error:{kind:`duplicate_target`,key:n}};try{return g7(s,n),y7(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function b7(e,t){let{doc:n,map:r}=d7(e);if(r===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let i=n.contents;if(!i||!(`items`in i)||!Array.isArray(i.items))return{ok:!0,nextFenced:e};let a=_7(n);if(a.length!==t.length||!x7(a,t))return{ok:!1,error:{kind:`reorder_mismatch`,expected:a,got:[...t]}};try{let e=i.items.filter(m7),r=[];for(let n of t){let i=e.findIndex(e=>h7(e)===n);if(i===-1)return{ok:!1,error:{kind:`reorder_mismatch`,expected:a,got:[...t]}};let[o]=e.splice(i,1);o&&r.push(o)}return i.items=r,y7(n)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function x7(e,t){let n=new Map;for(let t of e)n.set(t,(n.get(t)??0)+1);for(let e of t){let t=(n.get(e)??0)-1;if(t<0)return!1;n.set(e,t)}for(let e of n.values())if(e!==0)return!1;return!0}function S7(e){if(e.length===0)return{kind:`invalid_path`,path:[...e],reason:`path must have at least one segment`};for(let t=0;t<e.length;t++){let n=e[t];if(typeof n!=`string`&&typeof n!=`number`)return{kind:`invalid_path`,path:[...e],reason:`path segment at index ${t} must be string or number`};if(typeof n==`number`&&(!Number.isInteger(n)||n<0))return{kind:`invalid_path`,path:[...e],reason:`numeric path segment at index ${t} must be a non-negative integer`}}return e[0]===`frontmatter`?{kind:`reserved_key`,key:dm}:null}function Pce(e,t,n){let r=S7(t);if(r)return{ok:!1,error:r};let{doc:i,map:a}=d7(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let o=hm.safeParse(n);if(!o.success)return{ok:!1,error:{kind:`invalid_value`,key:String(t[t.length-1]),reason:o.error.issues[0]?.message??`invalid value`}};try{return v7(i),i.setIn(t,Dm(i,i.getIn(t,!0),o.data)),y7(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function Fce(e,t){let n=S7(t);if(n)return{ok:!1,error:n};let{doc:r,map:i}=d7(e);if(i===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};try{return r.getIn(t,!0)===void 0?{ok:!0,nextFenced:e}:(r.deleteIn(t),y7(r))}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function Ice(e,t){if(t.length===0){let t=e.contents;return Ko(t)?t:null}let n=e.getIn(t,!0);return Ko(n)?n:null}function Lce(e,t,n,r={}){let i=S7(t);if(i)return{ok:!1,error:i};let a=t[t.length-1];if(typeof a!=`string`)return{ok:!1,error:{kind:`invalid_path`,path:[...t],reason:`cannot rename: last path segment must be a string (map key)`}};if(t.length===1&&n===`frontmatter`)return{ok:!1,error:{kind:`reserved_key`,key:dm}};let{doc:o,map:s}=d7(e);if(s===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};if(a===n)return{ok:!0,nextFenced:e};let c=Ice(o,t.slice(0,-1));if(!c)return{ok:!1,error:{kind:`unknown_key`,key:a}};let l=c.items.find(e=>m7(e)&&h7(e)===a);if(!l)return{ok:!1,error:{kind:`unknown_key`,key:a}};if(!r.allowDuplicate&&c.items.some(e=>m7(e)&&e!==l&&h7(e)===n))return{ok:!1,error:{kind:`duplicate_target`,key:n}};try{return g7(l,n),y7(o)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function Rce(e,t,n){if(t.length===0)return b7(e,n);let r=S7(t);if(r)return{ok:!1,error:r};let{doc:i,map:a}=d7(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let o=i.getIn(t,!0);if(!Ko(o))return{ok:!1,error:{kind:`invalid_path`,path:[...t],reason:`cannot reorder: target is not a map`}};let s=[];for(let e of o.items){if(!m7(e))continue;let t=h7(e);t!==null&&s.push(t)}if(s.length!==n.length||!x7(s,n))return{ok:!1,error:{kind:`reorder_mismatch`,expected:s,got:[...n]}};try{let e=o.items.filter(m7),t=[];for(let r of n){let i=e.findIndex(e=>h7(e)===r);if(i===-1)return{ok:!1,error:{kind:`reorder_mismatch`,expected:s,got:[...n]}};let[a]=e.splice(i,1);a&&t.push(a)}return o.items=t,y7(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function zce(e,t,n){let r=S7(t);if(r)return{ok:!1,error:r};let{doc:i,map:a}=d7(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let o=i.getIn(t,!0);if(!Yo(o))return{ok:!1,error:{kind:`invalid_path`,path:[...t],reason:`cannot reorder: target is not a sequence`}};let s=o,c=s.items.length,l=Array.from({length:c},(e,t)=>t),u=[...n];if(!Bce(u,c))return{ok:!1,error:{kind:`reorder_mismatch`,expected:l.map(String),got:u.map(String)}};try{let e=s.items.slice();return s.items=u.map(t=>e[t]),y7(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function Bce(e,t){if(e.length!==t)return!1;let n=Array(t).fill(!1);for(let r of e){if(!Number.isInteger(r)||r<0||r>=t||n[r])return!1;n[r]=!0}return!0}var Vce=L({changes:I(eo(`kind`,[L({key:N(),kind:B(`added`),after:hm}).loose(),L({key:N(),kind:B(`removed`),before:hm}).loose(),L({key:N(),kind:B(`changed`),before:hm,after:hm}).loose()])),unparseable:L({before:N(),after:N()}).loose().nullable()}).loose();function C7(e){let{fenced:t}=u7(e),n=d7(t);if(n.map===null)return{fenced:t,map:{},keys:[],parseError:n.parseError};let r=km(n.doc);return{fenced:t,map:n.map,keys:r.length>0?r:Object.keys(n.map),parseError:void 0}}function Hce(e,t){let n=C7(e),r=C7(t);if(n.parseError!==void 0||r.parseError!==void 0)return{changes:[],unparseable:{before:n.fenced,after:r.fenced}};let i=[],a=new Set;for(let e of r.keys){if(a.has(e))continue;a.add(e);let t=r.map[e];if(t===void 0)continue;let o=n.map[e];if(o===void 0){i.push({key:e,kind:`added`,after:t});continue}Cm(o,t)||i.push({key:e,kind:`changed`,before:o,after:t})}for(let e of n.keys){if(a.has(e))continue;a.add(e);let t=n.map[e];t!==void 0&&i.push({key:e,kind:`removed`,before:t})}return{changes:i,unparseable:null}}var Uce=L({stackIndex:P().int().min(0),ts:P().int().min(0),additions:P().int().min(0),deletions:P().int().min(0)}).loose(),Wce=L({docName:N().min(1),additionsTotal:P().int().min(0),deletionsTotal:P().int().min(0),lastTs:P().int().min(0),bursts:I(Uce)}).loose(),Gce=L({displayName:N().min(1),color:N().min(1),icon:N().optional(),connectionId:N().min(1)}).loose(),Kce=L({sessionAlive:F(),agent:Gce.nullable(),files:I(Wce)}).loose(),qce=L({diff:N(),before:N(),after:N(),properties:Vce,generatedAt:P().int().min(0)}).loose();L({}).loose(),L({}).loose(),L({}).loose(),L({}).loose(),L({}).loose(),L({}).loose();var Jce=L({displayName:N().min(1),icon:N(),color:N().min(1),currentDoc:N().nullable(),mode:z([`idle`,`writing`]),ts:P().int().min(0)}).loose();L({presence:io(N().min(1),Jce)}).loose();var Yce=L({sessionId:N().min(1),agentType:N().min(1),ts:P().int().min(0),insertedChars:P().int().min(0),deletedChars:P().int().min(0)}).loose();L({effects:I(L({"doc.name":N().min(1),entries:I(Yce)}).loose())}).loose(),L({decisions:I(L({ts:P().int().min(0),decision:N().min(1),kind:N().min(1),"doc.name":N().min(1),pathRole:N().min(1)}).loose())}).loose(),io(N().min(1),F()).meta({description:`Flat boolean record keyed by agent-scheme name (claude / codex / cursor). True = installed.`}),L({path:N().min(1,`path must be non-empty`)}).loose(),L({}).loose();var Xce=L({fromDocName:N().min(1),toDocName:N().min(1)}).loose(),Zce=L({fromPath:N().min(1),toPath:N().min(1)}).loose();L({}).loose(),L({path:N().min(1),...L$,summary:R$}).loose();var Qce=L({docName:N().min(1)}).loose();L({path:N().min(1),...L$,summary:R$}).loose();var $ce=L({path:N().min(1)}).loose();L({kind:z([`file`,`folder`]),path:N().min(1),...L$,summary:R$}).loose();var ele=L({kind:z([`file`,`folder`]),path:N().min(1),duplicatedDocNames:I(N().min(1))}).loose(),tle=L({pages:I(L({docName:N().min(1),title:N(),docExt:N().min(1),size:P().int().nonnegative(),modified:N().min(1),icon:N().min(1).max(2048).optional()}).loose())}).loose(),nle=L({level:P().int().min(1).max(6),text:N(),slug:N()}).loose(),rle=L({docName:N().min(1),headings:I(nle)}).loose(),ile=L({docName:N().min(1),rewrites:P().int().nonnegative()}).loose();L({kind:z([`file`,`folder`,`asset`]),fromPath:N().min(1),toPath:N().min(1),...L$,summary:R$}).loose();var ale=L({renamed:I(Xce),renamedAssets:I(Zce),rewrittenDocs:I(ile).optional(),summary:j5.optional()}).loose();L({kind:z([`file`,`folder`,`asset`]),path:N().min(1),...L$}).loose();var ole=L({deletedDocNames:I(N().min(1))}).loose();L({kind:z([`file`,`folder`,`asset`]),path:N().min(1),...L$,summary:R$}).loose();var sle=L({deletedDocNames:I(N().min(1))}).loose();L({docName:N().min(1),commitSha:N().regex(/^[0-9a-f]{40}$/i,{message:`commitSha must be a 40-char git SHA`}),summary:R$,...L$}).loose(),L({restoredFrom:N().min(1),timestamp:N().min(1),summary:j5.optional(),warning:M5.optional(),warnings:I5.optional()}).loose();var cle=/^#[0-9a-fA-F]{6}$/,lle=L(Object.fromEntries(wd.map(e=>[e,N().regex(cle,`must be a #rrggbb hex color`)]))),w7=N().min(1).refine(Od,{message:`must contain a non-whitespace character`}),T7=L({name:w7,author:w7.optional(),variant:z([`dark`,`light`]),palette:lle}).loose(),ule=L({name:N().min(1),scheme:T7,stem:N().min(1).optional(),extension:z([`.yaml`,`.yml`]).optional()}).loose(),dle=L({id:N().min(1),filename:N().min(1)}).loose(),fle=L({id:N().min(1),scheme:T7}).loose(),ple=L({id:N().min(1),filename:N().min(1)}).loose(),mle=eo(`existed`,[L({existed:B(!1)}).loose(),L({existed:B(!0),filename:N().min(1),scheme:T7}).loose()]),hle=L({themes:I(eo(`ok`,[L({ok:B(!0),id:N().min(1),filename:N().min(1),scheme:T7}),L({ok:B(!1),filename:N().min(1),id:N().min(1).optional(),code:N().min(1),conflictingFilenames:I(N().min(1)).min(2).optional()})])),truncated:F()}).loose(),gle=z([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),_le=L({label:N().min(1),webUrl:Ca().nullable()}).loose(),vle=eo(`checkStatus`,[L({checkStatus:B(`allowed`)}).loose(),L({checkStatus:B(`denied`),deniedReason:z([`no-collaborator`,`private-no-access`,`repo-not-found`,`not-authenticated`]),resolvedLogin:N().optional(),declaredLogin:N().optional(),declaredSource:N().optional()}).loose(),L({checkStatus:B(`unknown`),unknownError:z([`network`,`timeout`,`rate-limit`,`token-invalid`,`malformed-response`,`ssh-unverified`]).optional()}).loose()]),E7=z([`auth-403`,`auth-401`,`auth-scope-mismatch`,`auth-no-credential`,`auth-not-found-as-identity`,`semantic-protected-branch`]),yle=z(hu),ble=z([`succeeded`,`up-to-date`,`conflict`,`refused`,`error`]);L({state:gle,lastSyncUtc:N().nullable(),lastFetchUtc:N().nullable(),lastPushedSha:N().nullable(),ahead:P().int().min(0),behind:P().int().min(0),consecutiveFailures:P().int().min(0),conflictCount:P().int().min(0),hasRemote:F(),syncEnabled:F(),identityUnresolved:F(),remote:_le.nullable().optional(),pushError:N().optional(),pushErrorCode:E7.optional(),pullError:N().optional(),pullErrorCode:E7.optional(),pausedReason:N().optional(),pushPermission:vle.optional(),syncMode:yle.optional(),lastPullUtc:N().nullable().optional(),lastPullOutcome:ble.nullable().optional()}).loose(),L({op:z([`sync`,`push`,`pull`]).optional()}).loose(),L({op:z([`sync`,`push`,`pull`])}).loose(),L({conflicts:I(L({file:N().min(1),detectedAt:N().min(1),oursSha:N().optional(),theirsSha:N().optional(),baseSha:N().optional()}).loose())}).loose(),L({file:N().min(1),strategy:z([`mine`,`theirs`,`content`,`delete`]),content:N().optional()}).loose().refine(e=>e.strategy!==`content`||e.content!==void 0&&e.content!==``,{message:`content must be a non-empty string when strategy is 'content'`,path:[`content`]}),L({}).loose(),L({file:N().min(1),base:N(),ours:N(),theirs:N(),kind:z([`both-modified`,`delete-modify`,`modify-delete`]),lifecycleStatus:N().nullable()}).loose(),L({plan:Mo(e=>e!==void 0,{message:`plan is required`})}).loose(),L({plan:Mo(e=>e!==void 0,{message:`plan is required`})}).loose(),L({result:Mo(e=>e!==void 0,{message:`result is required`})}).loose(),L({packId:N().min(1)}).strict(),L({installedHosts:I(N()),skills:I(L({name:N().min(1),created:F()}).strict())}).strict();var xle=L({path:N().min(1),summary:N().min(1)}).loose(),Sle=L({files:P().int().nonnegative(),folders:P().int().nonnegative()}).loose();L({packs:I(L({id:N().min(1),name:N().min(1),description:N().min(1),defaultSubfolder:N().optional(),folders:I(xle),entryCounts:Sle}).loose())}).loose(),L({noOpen:F().optional(),out:N().min(1).optional()}).loose();var Cle=L({reason:z([`unsupported-platform`,`spawn-error`]),message:N()}).loose();eo(`status`,[L({status:B(`installed`),outputPath:N(),size:P().int().nonnegative(),sha256:N(),skillVersion:N()}).loose(),L({status:B(`built`),outputPath:N(),size:P().int().nonnegative(),sha256:N(),skillVersion:N(),handoffError:Cle.optional()}).loose(),L({status:B(`failed`),buildError:N()}).loose(),L({status:B(`skip-current`),skillVersion:N(),recordedAt:N().optional()}).loose()]);var D7=z(qp),O7=z(Jp);function wle(e){return e===`agents`||Jp.includes(e)}var Tle=L({alwaysOn:P().int().nonnegative(),onTrigger:P().int().nonnegative(),onDemand:P().int().nonnegative()}).strict(),k7=[`.md`,`.mdx`,`.txt`],Ele=5e3,Dle=4;function A7(e){return Math.round(e/Dle)}function Ole(e){let t=e.lastIndexOf(`.`);return t===-1?!1:k7.includes(e.slice(t).toLowerCase())}function kle(e){let t=A7((e.name??``).length+(e.description??``).length),n=A7(cm(e.skillMd).body.length),r=e.files.some(e=>e.relPath===`overlay.yaml`),i=0;for(let t of e.files)t.content!==null&&t.relPath!==`SKILL.md`&&(r&&t.relPath.startsWith(`upstream/`)||Ole(t.relPath)&&(i+=t.content.length));return{alwaysOn:t,onTrigger:n,onDemand:A7(i)}}L({tags:I(L({name:N().min(1),count:P().int().nonnegative(),isLeaf:F()}).loose())}).loose();var Ale=L({docName:N().min(1),title:N(),matchingTags:I(N().min(1)),snippet:N().nullable()}).loose();L({name:N().min(1),docs:I(Ale)}).loose(),L({folder:Ka(),frontmatter_local:io(N(),Ka()).nullable()}).loose(),L({path:N(),frontmatter:io(N(),Ka()).optional()}).loose(),L({applied:Ka()}).loose();var j7=io(N(),Ka()).meta({description:`Free-form frontmatter map embedded in template payloads.`});L({template:L({name:N().min(1),folder:N(),scope:z([`local`,`inherited`]),path:N().min(1),frontmatter:j7,body:N()}).strict()}).strict();var jle=L({templates:I(L({name:N().min(1),title:N().optional(),description:N().optional(),path:N().min(1),source_folder:N()}).strict()),truncated:F()}).strict();L({folder:N(),name:N(),body:N().optional(),frontmatter:j7.optional(),...L$,summary:R$}).strict(),L({path:N().min(1),created:F(),warnings:I(N())}).strict(),L({sourcePath:N().min(1),targetFolder:N(),name:N().optional(),title:N().optional(),deleteSource:F().optional(),...L$,summary:R$}).strict(),L({path:N().min(1),created:F(),warnings:I(N())}).strict(),L({existed:F(),path:N().min(1)}).strict(),L({fromFolder:N(),fromName:N(),toFolder:N(),toName:N(),body:N().optional(),frontmatter:j7.optional(),...L$,summary:R$}).strict(),L({from:N().min(1),to:N().min(1),committed:F()}).strict();var M7=z(vp),Mle=/^[a-z0-9-]+$/,Nle=/^[A-Za-z0-9_-]+$/,N7=L({name:N(),description:N(),metadata:L({pack:N()}).strict().optional()}).strict();L({skill:L({name:N().min(1),scope:M7,path:N().min(1),frontmatter:N7,body:N(),files:I(L({path:N().min(1),text:N().nullable()})).optional(),managed:F().optional()}).strict()}).strict();var Ple=L({source:N().min(1),publisher:N().optional(),skill:N().optional(),marketplaceUrl:N().optional(),importedAt:N().min(1),autoUpdate:F().optional()}).strict(),Fle=L({name:N().min(1),description:N().optional(),scope:M7,path:N().min(1),canonicalPath:N().min(1).optional(),absolutePath:N().min(1).optional(),installed:F(),hosts:I(N()),hostQualifier:N().optional().meta({description:"Set on a GLOBAL entry that shares its name with a distinct-content bundle in another host dir AND is not the by-name default: the host id whose root holds THIS bundle. Doc-name builders append it (`__skill__/global/<name>@<host>`) so each same-named bundle keeps its own tab and its own write-back path; the default bundle keeps the stable unqualified name."}),driftPaths:I(N()).optional().meta({description:`Recorded locations whose on-disk form (copy vs symlink) no longer matches what OK last wrote there — evidence another tool rewrote the path.`}),hostAliases:io(N(),N()).optional().meta({description:`Host skills roots that are symlink ALIASES of another location (host id → base-relative target root). An aliased folder is a derived view — no menu row, never a write target; the host's icon rides the target root's row.`}),conflictHosts:I(N()).optional().meta({description:`Hosts whose dir holds a DIFFERENT same-name skill (fork/conflict) — occupied, not this skill.`}),symlinkedHosts:I(N()).optional(),installableEditors:I(N()).optional(),linkMode:F().optional(),customPlacements:I(L({path:N(),mode:z([`copy`,`link`])}).strict()).optional(),plugin:L({name:N().min(1),marketplace:N().min(1),provider:N().min(1),url:N().optional()}).strict().optional(),managed:F().optional(),origin:Ple.optional(),pack:N().optional(),modified:F().optional(),revertable:F().optional(),ignored:F().optional(),size:Tle.optional()}).strict();L({name:N().min(1),scope:M7,apply:F().optional()}).strict(),L({line:N().min(1),gitignorePath:N().min(1),applied:F(),alreadyTracked:F().optional()}).strict();var Ile=L({skills:I(Fle),truncated:F()}).strict();L({scope:M7.default(`project`),name:N().meta({description:`Managed skill name to create or update.`}),body:N().optional(),frontmatter:N7,...L$,summary:R$}).strict(),L({path:N().min(1),created:F(),warnings:I(N())}).strict(),L({scope:M7.default(`project`),name:N(),dryRun:F().optional(),setAutoUpdate:F().optional(),...L$,summary:R$}).strict(),L({name:N().min(1),updated:F(),source:N().min(1),localBody:N().optional(),upstreamBody:N().optional(),gitTracked:F().optional(),warnings:I(N())}).strict(),L({scope:M7.default(`project`),name:N(),...L$,summary:R$}).strict(),L({name:N().min(1),baselineRef:N().min(1),restoredFiles:I(N()),warnings:I(N())}).strict(),L({existed:F(),path:N().min(1)}).strict(),L({scope:M7.default(`project`),fromName:N(),toName:N(),body:N().optional(),frontmatter:N7.optional(),...L$,summary:R$}).strict(),L({from:N().min(1),to:N().min(1),committed:F()}).strict(),L({name:N(),fromScope:M7,toScope:M7,...L$,summary:R$}).strict(),L({scope:M7,path:N().optional()}).strict(),L({scope:M7,name:N(),toName:N(),...L$,summary:R$}).strict(),L({name:N().min(1)}).strict(),L({name:N(),home:N().min(1)}).strict(),L({docName:N().min(1)}).strict();var P7=z([`reference`,`script`,`file`]);L({scope:M7.default(`project`),name:N(),path:N().min(1),content:N(),...L$,summary:R$}).strict(),L({path:N().min(1),created:F(),kind:P7,content:F()}).strict(),L({scope:M7.default(`project`),name:N(),from:N().min(1),to:N().min(1),...L$,summary:R$}).strict(),L({from:N().min(1),to:N().min(1),fromDocName:N().optional(),toDocName:N().optional()}).strict(),L({path:N().min(1),kind:P7,text:N()}).strict(),L({path:N().min(1),existed:F(),kind:P7}).strict();var F7=Qa([O7,B(`agents`)]),I7=N().min(1).refine(e=>!e.startsWith(`/`)&&!e.startsWith(`~`)&&!/^[A-Za-z]:/.test(e),{error:`a custom root is base-relative (e.g. ".tim/skills"), not absolute or ~-prefixed`}).refine(e=>e.split(`/`).every(e=>e!==``&&e!==`.`&&e!==`..`),{error:`a custom root may not contain "..", "." or empty path segments`}).refine(e=>e.includes(`/`),{error:`a custom root is a path (e.g. ".tim/skills") — bare editor names are host ids`}),L7=Qa([F7,I7]);L({scope:M7.default(`project`),name:N(),targets:I(F7).optional().meta({description:'SET-EXACT install targets (editor ids, plus "agents" for the .agents hub — in-place skills only): the COMPLETE resulting host set. Omit to use project-configured editors; pass [] to uninstall everywhere. Stateless callers should prefer `add`/`remove`.'}),add:I(L7).optional().meta({description:`Locations to ADD the skill to (everything else untouched). Editor ids fan out a managed copy/symlink; a custom root path (".tim/skills") places the bundle there.`}),remove:I(L7).optional().meta({description:"Locations to REMOVE the skill from (lossless only — a hand-edited fork is refused, never deleted). The source cannot be removed; move it first with `source`."}),mode:z([`copy`,`link`]).optional().meta({description:`"link": one real folder (the source); every other location becomes a symlink to it. "copy": independent real folders, refreshed from the source until hand-edited (a hand-edit forks that copy). Converts existing locations losslessly. Omit to follow the form the skill already uses.`}),source:L7.optional().meta({description:`Move the skill's REAL folder to this location (the old source becomes a symlink to it — never a removal). Sticky across rescans.`}),linkMode:F().optional(),setSource:N().min(1).optional(),place:L({dir:N().min(1).meta({description:`Project-relative directory the bundle dir is created under (e.g. ".windsurf/skills").`}),mode:z([`copy`,`link`])}).strict().optional(),convert:L({target:L7.meta({description:`The installed location to convert — an editor id, "agents", or a recorded custom placement path.`}),mode:z([`copy`,`link`]).meta({description:`"link": replace this location with a symlink to the source. "copy": replace it with an independent real folder.`})}).strict().optional(),unplace:L({path:N().min(1).meta({description:`The recorded placement bundle path (e.g. ".windsurf/skills/my-skill").`})}).strict().optional(),...L$,summary:R$,fork:L({editor:N().min(1),action:z([`align`,`make-source`,`rename`]),toName:N().optional()}).strict().optional()}).strict().refine(e=>!(e.targets!==void 0&&(e.add!==void 0||e.remove!==void 0)),{error:"`targets` is set-exact; `add`/`remove` are additive — use one style per call"}).refine(e=>e.fork===void 0||e.targets===void 0&&e.add===void 0&&e.remove===void 0&&e.source===void 0&&e.setSource===void 0,{error:"`fork` is its own operation — run it in a separate call"}).refine(e=>e.fork?.action!==`rename`||e.fork.toName!==void 0,{error:"`fork.rename` requires `toName`"}).refine(e=>!(e.source!==void 0&&(e.add!==void 0||e.remove!==void 0)),{error:"a `source` move is its own operation — run it in a separate call from `add`/`remove`"}).refine(e=>[e.targets!==void 0||e.add!==void 0||e.remove!==void 0,e.place!==void 0,e.unplace!==void 0,e.convert!==void 0,e.source!==void 0||e.setSource!==void 0,e.fork!==void 0].filter(Boolean).length<=1,{error:"one operation per call — membership (`targets`/`add`/`remove`), `place`, `unplace`, `convert`, `source`, and `fork` are mutually exclusive"}),L({name:N().min(1).meta({description:`Managed skill name installed or uninstalled.`}),hosts:I(N()).meta({description:`Editor ids the skill is projected into after the operation; [] is expected after uninstall.`}),scripts:F().meta({description:`True when the skill ships executable scripts, projected but never run.`}),warnings:I(N()).meta({description:`Non-fatal install/uninstall warnings from target projection.`}),warningCodes:I(z([`no-targets`,`scripts-present`,`name-conflict`,`no-description`,`skill-fork-name-unpatched`,`place-path-invalid`,`place-fork-refused`])).meta({description:"Machine-readable warning codes aligned with `warnings`."}),placedAt:N().optional(),sourceMovedTo:N().optional()}).strict(),L({scope:M7.default(`project`),name:N().meta({description:`Managed skill name to uninstall without deleting source.`})}).strict(),L({name:N().min(1).meta({description:`Managed skill name requested for uninstall.`}),uninstalled:F().meta({description:`True when an install marker existed and was removed; false for an idempotent no-op.`})}).strict();var Lle=L({targets:I(D7),configured:F(),folders:I(L({scope:M7,host:N(),root:N(),state:z([`own`,`linked`,`linked-parent`,`absent`]),target:N().optional(),drift:B(!0).optional(),expected:N().optional()}).strict()).optional()}).strict(),R7=L({action:B(`link`),scope:M7,root:N().min(1).meta({description:`The folder to link (e.g. ".codex/skills").`}),target:N().min(1).meta({description:`The root it merges into (e.g. ".agents/skills"). Required.`})}),z7=L({action:B(`unlink`),scope:M7,root:N().min(1).meta({description:`The linked folder to materialize back.`}),exclude:I(N().min(1)).optional().meta({description:`Skill names to LEAVE OUT when materializing — the folder keeps every other skill it currently sees (as per-skill links) and stops auto-following the target root.`})}).strict(),B7=L({action:B(`add-root`),scope:M7,root:I7.meta({description:`New custom skills root to declare (base-relative, e.g. ".team/skills").`})}).strict(),Rle=eo(`action`,[R7.extend({preview:F().optional().meta({description:`Return the merge plan only (moves, drops, removes, conflicts, strays) — nothing is written.`})}).strict(),z7,B7]);eo(`action`,[R7.strict(),z7,B7]),L({folderAction:Rle}).strict();var V7=L({moves:I(N()),drops:I(N()),removes:I(N()),replaces:I(N()),conflicts:I(N()),strays:I(N())}).strict();L({targets:I(D7),reprojected:I(L({name:N(),hosts:I(N())}).strict()),bundleHosts:I(N()),removedFrom:I(N()),folder:L({moved:I(N()),dropped:I(N()),linked:I(N())}).strict().optional(),preview:V7.optional()}).strict(),L({scope:M7.default(`project`),name:N(),version:N().regex(/^[0-9a-f]{40}$/i),...L$,summary:R$}).strict(),L({name:N().min(1),version:N(),restoredFiles:I(N()),warnings:I(N())}).strict(),L({query:N().optional(),intent:z([`autocomplete`,`full_text`,`omnibar`]).optional(),ranking:z([`navigation`,`relevance`]).optional(),scopes:I(z([`page`,`folder`,`content`,`file`])).optional(),scope:N().optional(),limit:P().int().nonnegative().optional(),semantic:F().optional(),source:z([`omnibar`,`mcp`,`http`]).optional()}).loose();var zle=L({kind:z([`page`,`folder`,`content`,`file`]),path:N().min(1),title:N(),score:P(),signals:io(N(),Ka()),snippet:N().optional()}).loose(),Ble=L({capable:F(),applied:F(),coverage:L({embedded:P().int().nonnegative(),total:P().int().nonnegative()})}).loose();L({enabled:F(),keyPresent:F(),keyNotRequired:F(),keySource:z([`project`,`file`,`env`]).nullable(),keyHint:N().nullable(),ready:F(),capable:F(),embedded:P().int().nonnegative(),total:P().int().nonnegative()}).loose(),L({query:N(),intent:z([`autocomplete`,`full_text`,`omnibar`]),results:I(zle),elapsedMs:P().nonnegative(),semantic:Ble.optional(),truncated:F().optional(),ready:F().optional()}).loose();var Vle=L({version:N().min(1),recordedAt:N().min(1)}).loose();L({currentVersion:N().min(1),targets:io(N(),Vle.nullable())}).loose(),L({scope:M7.default(`project`),source:N().min(1).meta({description:`External skill source: full skills.sh skill-page URL (https://www.skills.sh/<owner>/<repo>/<skill>, or https://www.skills.sh/site/<hostname>/<skill> for a website catalog), GitHub owner/repo[/subpath], git URL, or local/file path.`}),skill:N().min(1).optional().meta({description:`Specific skill name to import from a multi-skill source.`}),install:F().optional().meta({description:`Pass false to import WITHOUT the default-editor auto-projection (the caller installs explicitly afterwards). Default true.`}),marketplace:F().optional().meta({description:"The source came from a skills.sh listing the user chose (the Explore tab), so the install is reported to skills.sh and counts toward that listing. Off by default: a hand-typed repo must not be announced to skills.sh. Honors the `telemetry.skillInstallReports.enabled` setting and DO_NOT_TRACK."}),...L$,summary:R$}).strict(),L({scope:M7.default(`project`),source:N().min(1).meta({description:`External skill source: full skills.sh skill-page URL, GitHub owner/repo[/subpath], git URL, or local/file path.`}),skills:I(N().min(1)).min(1).max(100).meta({description:`Skill names to import from the source.`}),install:F().optional().meta({description:`Pass false to import WITHOUT the default-editor auto-projection. Default true.`}),marketplace:F().optional().meta({description:"The source came from a skills.sh listing the user chose (a marketplace plugin bundle), so the import is reported to skills.sh as one batched install event and counts toward that listing. Off by default: a hand-typed repo must not be announced to skills.sh. Honors the `telemetry.skillInstallReports.enabled` setting and DO_NOT_TRACK."}),...L$,summary:R$}).strict(),L({results:I(L({requested:N(),status:z([`imported`,`already-imported`,`not-found`,`failed`]),name:N().optional(),collisionRenamedFrom:N().optional(),warnings:I(N()),error:N().optional()}).loose()),imported:P(),alreadyImported:P(),failed:P()}).loose(),L({scope:M7.default(`project`),names:I(N().min(1)).min(1).max(100).meta({description:`Managed skill names to refresh from their recorded upstreams.`}),...L$,summary:R$}).strict(),L({results:I(L({requested:N(),status:z([`updated`,`up-to-date`,`not-found`,`failed`]),source:N().optional(),warnings:I(N()),error:N().optional()}).loose()),updated:P(),upToDate:P(),failed:P()}).loose();var Hle=L({source:N(),ref:N().optional(),contentHash:N(),publisher:N().optional()}).loose();L({name:N().min(1).meta({description:`Managed skill name created or matched.`}),path:N().min(1).meta({description:`Store-relative path to the imported skill source.`}),created:F().meta({description:`True when this request created new source files.`}),alreadyImported:F().meta({description:`True when identical content was already present and no files changed.`}),collisionRenamedFrom:N().optional().meta({description:`Original source name when collision handling renamed the import.`}),provenance:Hle,warnings:I(N()).meta({description:`Non-fatal import warnings, such as skipped unsupported files.`})}).loose();var Ule=`server-info`,Wle=`branch-switched`,Gle=`disk-ack`,Kle=`config-validation-rejected`,qle=`config-ignore-nested-error`,H7=z([`files`,`backlinks`,`graph`,`sync-status`,`session-activity`,`tags`,`comments`,`lint-config`,`local-targets`]),Jle=L({v:B(1),ch:B(Ule),seq:P(),serverInstanceId:N().min(1),currentBranch:N().min(1).optional()}).loose(),Yle=L({v:B(1),ch:B(Wle),seq:P(),branch:N().min(1)}).loose(),Xle=L({v:B(1),ch:H7,seq:P()}).loose(),Zle=L({v:B(1),ch:B(Gle),seq:P(),docName:N().min(1),sv:N().min(1)}).loose(),Qle=L({v:B(1),ch:B(Kle),seq:P(),docName:N().min(1),error:np}).loose(),$le=L({v:B(1),ch:B(qle),seq:P(),path:N().min(1),error:N().min(1)}).loose();function eue(e){let t;try{t=new URL(e)}catch{return null}let n=t.pathname.match(/^\/video\/(\d+)/);if(n)return n[1]??null;let r=t.pathname.match(/^\/(\d+)/);return r?r[1]??null:null}function tue(e){if(typeof e!=`string`||e.length===0)return e;let t=_2(e);if(t){let e=t.noCookie?`www.youtube-nocookie.com`:`www.youtube.com`,n=t.startSeconds===null?``:`?start=${t.startSeconds}`;return`https://${e}/embed/${t.id}${n}`}if(f2(e)){let t=eue(e);return t?`https://player.vimeo.com/video/${t}`:e}let n=l2(e);if(n){let e=n.startRaw===null?``:`?t=${n.startRaw}`;return`https://www.loom.com/embed/${n.id}${e}`}return e}var nue=`https://api.github.com/repos/inkeep/open-knowledge`;async function rue(e){let{signal:t,...n}=e??{},r=t?AbortSignal.any([AbortSignal.timeout(5e3),t]):AbortSignal.timeout(5e3);try{let e=await fetch(nue,{headers:{accept:`application/vnd.github+json`,"user-agent":`openknowledge.ai`},...n,signal:r});if(!e.ok)return console.warn(`[github-stars] GitHub API responded ${e.status}`),null;let t=await e.json();return typeof t.stargazers_count==`number`?t.stargazers_count:null}catch(e){return console.warn(`[github-stars] fetch failed: ${e instanceof Error?e.message:String(e)}`),null}}function iue(e){if(!e)return{height:null,viewerFragment:``};let t=e.split(`&`).filter(e=>e.length>0),n=null,r=[];for(let e of t){let t=e.indexOf(`=`);if(t===-1){r.push(e);continue}let i=e.slice(0,t),a=e.slice(t+1);if(i===`height`){let e=Number.parseInt(a,10);!Number.isNaN(e)&&e>0&&(n=e);continue}r.push(e)}return{height:n,viewerFragment:r.join(`&`)}}new GJ.default;var aue=L({path:I(Qa([N(),P()])),message:N(),issueCode:N()});eo(`code`,[L({code:B(`SCHEMA_INVALID`),issues:I(aue)}),L({code:B(`WRITE_ERROR`),detail:N()})]);function oue(e){return{path:e.path.map(e=>typeof e==`symbol`?String(e):e),message:e.message,issueCode:e.code}}function sue(e){if(e.code!==`SCHEMA_INVALID`)return{};let t={};for(let n of e.issues){let e=n.path[0];typeof e==`string`&&(t[e]=t[e]?`${t[e]}; ${n.message}`:n.message)}return t}var U7=/^---[ \t]*\r?\n---[ \t]*(\r?\n|$)/,cue=/^---([ \t]*)(?=\r?\n|$)/,W7=e=>e.includes(`\r
|
|
573
573
|
`)?`\r
|
|
574
574
|
`:`
|
|
575
|
-
`,
|
|
575
|
+
`,lue=e=>e.replace(cue,`***$1`),G7=e=>`---${e}${e}---${e}`;function K7(e,t){let n=lm(e,t);return{md:n,frontmatter:n.slice(0,n.length-t.length)}}function q7(e,t){let{md:n,frontmatter:r}=K7(e,t),i=cm(n);return i.frontmatter===r&&i.body===t}function J7(e,t,n,r){let{md:i,frontmatter:a}=K7(t,n);return{md:i,frontmatter:a,body:n,adjusted:r===`none`&&a!==e?`frontmatter`:r}}function uue(e,t){if(q7(e,t))return J7(e,e,t,`none`);let n=lue(t);if(n!==t&&q7(e,n))return J7(e,e,n,`body`);if(U7.test(e)){let n=G7(W7(e));if(q7(n,t))return J7(e,n,t,`frontmatter`)}return J7(e,e,t,`unresolved`)}function due(e,t){if(q7(e,t))return J7(e,e,t,`none`);let n=G7(W7(e||t));return(e===``||U7.test(e))&&q7(n,t)?J7(e,n,t,`frontmatter`):J7(e,e,t,`unresolved`)}var fue=Object.freeze({source:`local`,skipStoreHooks:!1,context:Object.freeze({origin:`form-write`})});function Y7(e){return{ok:!1,error:e}}function pue(e){return{ok:!0,...e}}function mue(e){return{ok:!0,...e}}function hue(e){return{ok:!0,...e}}function X7(e){return{ok:!0,...e}}function Z7(e){switch(e.kind){case`unknown_key`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:`unknown key '${e.key}'`,issueCode:`unknown_key`}]};case`duplicate_target`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:`key '${e.key}' already exists`,issueCode:`duplicate_target`}]};case`invalid_value`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:e.reason,issueCode:`invalid_value`}]};case`reserved_key`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:`'${e.key}' is a reserved frontmatter key`,issueCode:`reserved_key`}]};case`reorder_mismatch`:return{code:`WRITE_ERROR`,detail:`reorder list does not match current keys (state changed mid-drag)`};case`region_too_large`:return{code:`SCHEMA_INVALID`,issues:[{path:[],message:`Frontmatter region exceeds ${l7}-byte limit (would be ${e.bytes})`,issueCode:`region_too_large`}]};case`parse_failed`:return{code:`WRITE_ERROR`,detail:`Frontmatter YAML is malformed; fix in source mode to commit (${e.reason})`};case`invalid_path`:return{code:`SCHEMA_INVALID`,issues:[{path:[...e.path],message:e.reason,issueCode:`invalid_path`}]}}}function gue(e,t){if(e.parseError!==t.parseError||e.keys.length!==t.keys.length)return!1;for(let n=0;n<e.keys.length;n++)if(e.keys[n]!==t.keys[n])return!1;for(let n of e.keys)if(!Cm(e.map[n],t.map[n]))return!1;return!0}var _ue=5;function Q7(e){let t=e.toString();return{snapshot:vue(t),raw:t}}function vue(e){let{map:t,parseError:n}=f7(e);return{map:t,keys:p7(e),parseError:n}}function $7(e){return e.startsWith(`---`)}function yue(e){let t=e.document,n=t.getText(`source`),r=new Set,i=Q7(n),a=i.snapshot,o=u7(i.raw).fenced,s=$7(i.raw),c=!1;function l(e=!1){if(c)return;let t,i;try{let e=Q7(n);t=e.snapshot,i=e.raw}catch(e){console.warn(`[bindFrontmatterDoc] readSnapshotFromYText threw:`,e);return}if(!e&&gue(a,t)){s=$7(i);return}a=t,o=u7(i).fenced,s=$7(i);for(let e of r)try{e(t)}catch(e){console.warn(`[bindFrontmatterDoc] listener threw:`,e)}}let u=e=>{c||bue(e,o.length,s)&&l()};n.observe(u),e.on(`synced`,d);function d(){l(!0)}function f(e){let r;return t.transact(()=>{let t=n.toString(),{fenced:i}=u7(t);if(r=e(i),!r.ok||r.nextFenced===i)return;let a=due(r.nextFenced,t.slice(i.length)).frontmatter;n.delete(0,i.length),a!==``&&n.insert(0,a)},fue),r??{ok:!1,error:{kind:`parse_failed`,reason:`commit transact produced no result`}}}function p(e){if(c)return Y7({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});if(Object.hasOwn(e,`frontmatter`))return Y7({code:`SCHEMA_INVALID`,issues:[{path:[dm],message:`'${dm}' is a reserved frontmatter key`,issueCode:`reserved_key`}]});let t=xm.safeParse(e);if(!t.success)return Y7({code:`SCHEMA_INVALID`,issues:t.error.issues.map(oue)});let n=t.data,r=Object.keys(n),i=f(e=>Mce(e,n));return i.ok?pue({appliedKeys:r}):Y7(Z7(i.error))}function m(e,t,n={}){if(c)return Y7({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let r=f(r=>Nce(r,e,t,n));return r.ok?mue({oldKey:e,newKey:t}):Y7(Z7(r.error))}function h(e){if(c)return Y7({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let t=f(t=>b7(t,e));return t.ok?hue({orderedKeys:[...e]}):Y7(Z7(t.error))}function g(e,t){if(c)return Y7({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let n=f(n=>Pce(n,e,t));return n.ok?X7({path:[...e]}):Y7(Z7(n.error))}function _(e){if(c)return Y7({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let t=f(t=>Fce(t,e));return t.ok?X7({path:[...e]}):Y7(Z7(t.error))}function v(e,t,n={}){if(c)return Y7({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let r=f(r=>Lce(r,e,t,n));return r.ok?X7({path:[...e]}):Y7(Z7(r.error))}function y(e,t){if(c)return Y7({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let n=f(n=>Rce(n,e,t));return n.ok?X7({path:[...e]}):Y7(Z7(n.error))}function b(e,t){if(c)return Y7({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let n=f(n=>zce(n,e,t));return n.ok?X7({path:[...e]}):Y7(Z7(n.error))}return{current(){return Q7(n).snapshot},patch(e){return p(e)},rename(e,t,n){return m(e,t,n)},reorder(e){return h(e)},patchPath(e,t){return g(e,t)},deletePath(e){return _(e)},renamePath(e,t,n){return v(e,t,n)},reorderPath(e,t){return y(e,t)},reorderSeqPath(e,t){return b(e,t)},subscribe(e){return r.add(e),()=>{r.delete(e)}},dispose(){c||(c=!0,n.unobserve(u),e.off(`synced`,d),r.clear())}}}function bue(e,t,n){if(t===0&&n)return!0;let r=t>0?t:_ue,i=0;for(let t of e.delta){if(typeof t.retain==`number`){i+=t.retain;continue}if(typeof t.insert==`string`){if(i<r)return!0;i+=t.insert.length;continue}if(t.insert!==void 0){if(i<r)return!0;i+=1;continue}if(typeof t.delete==`number`&&i<r)return!0}return!1}function xue(e,t){if(e===``)return{slot:``,body:t};let n=t.match(/^\r?\n/);return n?{slot:n[0],body:t.slice(n[0].length)}:{slot:``,body:t}}function e9(e){let{frontmatter:t,body:n}=cm(e);if(t===``)return h1(e);let r=xue(t,n).body;return/^\n*$/.test(r)?h1(e):h1(r)}var Sue=new GJ.default;Sue.Match_Threshold=.5;var Cue=/\\([!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~])/g,t9=/^\s*\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)+\|?\s*$/,n9=/^[ \t]+([-+*]|\d+[.)]|[a-zA-Z][.)])\s/,wue=/^\d+([.)])(?=\s)/,Tue=`1`,Eue=/\*\*\s*(`[^`]+`)\s*\*\*/g,Due=/^(`{3,}|~{3,})/;function Oue(e){let t=new Set,n=null;for(let r=0;r<e.length;r++){let i=e[r].trimEnd(),a=Due.exec(i);if(a){let e=a[1][0];if(n===null){n=e;continue}if(n===e){n=null;continue}}if(n!==null||r===0||!t9.test(i))continue;let o=e[r-1].trimEnd();if(!(!o.startsWith(`|`)||t9.test(o))){t.add(r-1),t.add(r);for(let n=r+1;n<e.length&&e[n].trimEnd().startsWith(`|`);n++)t.add(n)}}return t}function r9(e){return e.slice(0,-1).trimEnd()}var i9=/^(?:#{1,6}[ \t]|>|(?:[-+*]|\d{1,9}[.)])[ \t]|`{3,}|~{3,}|=+[ \t]*$|-+[ \t]*$|(?:\*[ \t]*){3,}$|(?:_[ \t]*){3,}$)/;function a9(e){let t=new Set,n=null;for(let r=0;r<e.length;r++){let i=e[r]??``,a=/^(`{3,}|~{3,})/.exec(i.trimStart());if(a?.[1]){let e=a[1][0];if(n===null){n=e;continue}if(n===e){n=null;continue}}n!==null&&t.add(r)}return t}var kue=/^<\/?[A-Z][A-Za-z0-9.]*(?:\s[^>]*)?>$/,Aue=/^<[A-Z][A-Za-z0-9.]*(?:\s[^>]*)?>$/,jue=/^<\/[A-Z][A-Za-z0-9.]*\s*>$/,Mue=/<\/?[A-Z]/;function Nue(e){let t=!1;for(let n=0;n<e.length;n++)if(Mue.test(e[n]??``)){t=!0;break}if(!t)return e;let n=a9(e),r=[],i=[],a=0;for(let t=0;t<e.length;t++){let o=e[t]??``,s=o.trim();if(n.has(t)){r.push(!1),i.push(a);continue}let c=a>=1||!/^[ \t]/.test(o);r.push(c&&kue.test(s));let l=c&&jue.test(s),u=c&&!l&&Aue.test(s)&&!s.endsWith(`/>`);l?(a=Math.max(0,a-1),i.push(a)):(i.push(a),u&&(a+=1))}let o=Array(e.length);for(let t=0,n=-1;t<e.length;t++)o[t]=n,(e[t]??``).trim()!==``&&(n=t);let s=Array(e.length);for(let t=e.length-1,n=e.length;t>=0;t--)s[t]=n,(e[t]??``).trim()!==``&&(n=t);let c=new Set;for(let t=0;t<e.length;t++){if((e[t]??``).trim()!==``||n.has(t)||(i[t]??0)<1)continue;let a=o[t]??-1,l=s[t]??e.length;(a>=0&&r[a]===!0||l<e.length&&r[l]===!0)&&c.add(t)}let l=[];for(let t=0;t<e.length;t++){if(c.has(t))continue;let n=e[t]??``;l.push(r[t]===!0&&(i[t]??0)>=1?n.replace(/^[ \t]+/,``):n)}return l}function Pue(e){let t=Nue(e.replace(/^/,``).replace(/\r/g,``).replace(Cue,`$1`).replace(Eue,`$1`).replace(/^\n+/,``).replace(/^[*-]{3,}(?=\n|$)/,`---`).replace(/(\n)([#>+-]|\d+[.)]|`{3,}|~{3,})/g,`
|
|
576
576
|
|
|
577
577
|
$2`).replace(/^([#>+-].*|\d+[.)].*|`{3,}.*|~{3,}.*|<\/[A-Z][A-Za-z0-9]*>[ \t]*)\n([^\n])/gm,`$1
|
|
578
578
|
|
|
579
579
|
$2`).split(`
|
|
580
|
-
`)),n=
|
|
580
|
+
`)),n=Oue(t),r=a9(t);return t.map((e,i)=>{let a=e.trimEnd();if(i>0&&!r.has(i)&&/^[ \t]+\S/.test(a)&&(t[i-1]??``).trim()!==``&&!n9.test(a)&&!i9.test(a.trimStart())){let e=(t[i-1]??``).trimStart();if(!i9.test(e)&&!e.startsWith(`|`))return a.replace(/^[ \t]+/,``)}if(t9.test(a)){let e=a.replace(/\s+/g,``);return n.has(i)&&e.length>1&&e.startsWith(`|`)&&e.endsWith(`|`)?r9(e):e}let o=n9.test(a)?a.replace(/^[ \t]+/,``):a;return n.has(i)&&o.length>1&&o.startsWith(`|`)&&o.endsWith(`|`)&&(o=r9(o)),o.replace(wue,`${Tue}$1`)}).join(`
|
|
581
581
|
`).replace(/\n{3,}/g,`
|
|
582
582
|
|
|
583
|
-
`).replace(/\n+$/,``)}function o9(e){return[...e.replace(/^\n+/,``).replace(/\n+$/,``).matchAll(/\n{2,}/g)].map(e=>e[0].length)}function Iue(e,t){let n=e9(e),r=e9(t);if(r.leading>n.leading||r.trailing>n.trailing)return!0;let i=o9(cm(e).body),a=o9(cm(t).body);return i.length===a.length?a.some((e,t)=>e>(i[t]??0)):!1}var s9=/^[a-zA-Z0-9][\w/-]*$/;function Lue(e){if(typeof e!=`string`)return!1;let t=e.startsWith(`#`)?e.slice(1):e;return s9.test(t)}var Rue=`Tags must start with a letter or digit and contain only letters, digits, underscores, dashes, and slashes.`;function zue(e){return e.startsWith(`#`)?e.slice(1):e}function Bue(e){return typeof e==`string`?[e]:Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function Vue(e){if(!e||e.trim()===``)return[];let{map:t}=Tm(e);if(!t)return[];let n=Bue(t.tags),r=[];for(let e of n){let t=zue(e);s9.test(t)&&r.push(t)}return r}var Hue=z(vp),Uue=R({hosts:I(N()),scope:Hue,scripts:F(),installedAt:Ki(),projection:z([`symlink`,`copy`]).optional(),contentHash:N().optional()});R({schema:B(1),skills:io(N(),Uue).default({})});var Wue=100,Gue=500,Kue=450,que={id:`string`,kind:`enum`,path:`string`,title:`string`,name:`string`,pathSegments:`string`,content:`string`,modifiedTs:`number`},c9=new WeakMap;function Jue(e){return e===void 0||!Number.isFinite(e)?20:Math.max(1,Math.min(100,Math.trunc(e)))}function l9(e){return e.trim().toLowerCase()}var Yue=/\.(?:md|mdx)$/;function Xue(e,t){if(t!==`page`)return e;let n=e.replace(Yue,``);return n.length>0?n:e}function u9(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function Zue(e){let t=u9(e.path),n=e.title?.trim()||t,r=e.modifiedTs??0,i=e.path.split(`/`).filter(Boolean),a=new Set(i),o=[...new Set((e.aliases??[]).flatMap(e=>e.split(`/`).filter(Boolean)).filter(e=>!a.has(e)))];return{id:`${e.kind}:${e.path}`,kind:e.kind,path:e.path,title:n,name:t,pathSegments:[...i,...o].join(` `),content:e.content??``,modifiedTs:Number.isFinite(r)?r:0}}var d9=/[^\P{L}a-zàèéìòóù]|[^\P{Nd}0-9]|\p{Nl}/iu,f9=(()=>{let e=globalThis.Intl.Segmenter;return e?new e(`en`,{granularity:`word`}):null})();function Que(){let e=Vq({language:`english`}),t=e.tokenize.bind(e);return e.tokenize=(e,n,r,i)=>{let a=t(e,n,r,i);if(!f9||typeof e!=`string`||!d9.test(e))return a;let o=new Set(a);for(let{segment:t,isWordLike:n}of f9.segment(e)){if(!n||!d9.test(t))continue;let e=t.toLowerCase();o.has(e)||(o.add(e),a.push(e))}return a},e}function p9(e){let t=tJ({schema:que,components:{tokenizer:Que()}});return e.length>0&&fJ(t,e),t}function $ue(e){let t={documents:e};return c9.set(t,p9(e)),t}function ede(e){let t=c9.get(e);if(t)return t;let n=p9(e.documents);return c9.set(e,n),n}function tde(e){return e===`autocomplete`?[`page`]:e===`full_text`?[`page`,`content`,`file`]:[`page`,`folder`,`file`]}function m9(e,t){return t.has(e.kind)?!0:e.kind===`page`&&t.has(`content`)}function nde(e,t){let n=l9(t);if(!n)return 0;let r=Xue(n,e.kind),i=l9(e.title),a=l9(e.name),o=l9(e.path),s=o.split(`/`);return i===r||a===r?700:o===r?650:i.startsWith(r)||a.startsWith(r)?600:s.some(e=>e.startsWith(r))?550:i.includes(r)||a.includes(r)?500:o.includes(r)?450:-1}var rde=.5;function h9(e,t){let n=nde(e,t);return n<=0?n:N$(e.path)?n*rde:n}var ide=60;function ade(e){return e===`file`?-ide:0}var ode=1e3,g9=50,sde=1,cde=1,lde=.001;function ude(e,t,n,r,i){let a=i>0?t/i:0,o=g9>0?n/g9:0,s=r===`file`?-lde:0,c=sde*a+cde*o+s;return e*ode+c}function _9(e,t,n,r){return e+t*20+n+ade(r)}function v9(e,t,n,r,i,a){return e===`relevance`?_9(t,n,r,i):ude(t,n,r,i,a)}function dde(e,t){return t||(e===`full_text`?`relevance`:`navigation`)}function y9(e,t){let n=0;for(let r of e){let e=t.get(r.id)??0;e>n&&(n=e)}return n}function fde(e){let t=e.map(e=>e.modifiedTs).filter(e=>Number.isFinite(e)&&e>0);if(t.length===0)return new Map;let n=1/0,r=-1/0;for(let e of t)e<n&&(n=e),e>r&&(r=e);let i=Math.max(1,r-n);return new Map(e.map(e=>[e.id,e.modifiedTs>0?(e.modifiedTs-n)/i*50:0]))}function pde(e){return e===`full_text`?[`title`,`name`,`path`,`pathSegments`,`content`]:[`title`,`name`,`path`,`pathSegments`]}function mde(e){return e===`full_text`?{title:8,name:7,path:5,pathSegments:4,content:1}:e===`autocomplete`?{title:10,name:9,path:5,pathSegments:4}:{title:8,name:7,path:5,pathSegments:4}}var hde=/[-ក- -〿-ゟ゠-ヿ㐀-䶿一-鿿\uf900--\u1100-\u11ff\u3130-\u318f\ua960-\ua97f\uac00-\ud7ff]/;function gde(e,t){let n=l9(t);return n.length<4||hde.test(n)?0:+(e===`full_text`)}function _de(e){let{lexical:t,fullText:n}=e.signals;return t>=Gue?`lexical`:t===Kue&&n<=0?`pathOnly`:`body`}function vde(e){let t=[],n=[],r=[];for(let i of e){let e=_de(i);e===`lexical`?t.length<Wue&&t.push(i):e===`body`?n.length<6&&n.push(i):r.length<4&&r.push(i)}return[...t,...n,...r]}function b9(e,t,n){if(t===`relevance`)return e.slice(0,n);let r=vde(e),i=[],a=0,o=0;for(let e of r){if(e.document.kind===`folder`){if(a>=3)continue;a+=1}else if(e.document.kind===`file`){if(o>=3)continue;o+=1}if(i.push(e),i.length>=n)break}return i}function yde(e,t,n={}){let r=n.intent??`omnibar`,i=dde(r,n.ranking),a=Jue(n.limit),o=new Set(n.scopes??tde(r)),s=e.documents.filter(e=>m9(e,o)),c=l9(t);if(!c)return s.slice().sort((e,t)=>e.path.localeCompare(t.path)).slice(0,a).map(e=>({document:e,score:0,signals:{lexical:0,fullText:0,recency:0}}));let l=HJ(ede(e),{term:c,properties:pde(r),boost:mde(r),tolerance:gde(r,c),limit:Math.max(a*4,40)}),u=new Map(l.hits.filter(e=>m9(e.document,o)).map(e=>[e.document.id,e.score])),d=fde(s),f=new Map;for(let e of s)h9(e,c)>=0&&f.set(e.id,e);for(let e of l.hits)m9(e.document,o)&&f.set(e.document.id,e.document);if(!n.semantic){let e=y9(f.values(),u);return b9([...f.values()].map(t=>{let n=Math.max(0,h9(t,c)),r=u.get(t.id)??0,a=d.get(t.id)??0;return{document:t,score:v9(i,n,r,a,t.kind,e),signals:{lexical:n,fullText:r,recency:a}}}).sort((e,t)=>e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score),i,a)}return b9(bde({scopedDocuments:s,candidates:f,fullTextScores:u,recency:d,normalizedQuery:c,ranking:i,semantic:n.semantic}),i,a)}function x9(e){let t=new Map;return e.forEach((e,n)=>{t.set(e,n+1)}),t}function bde(e){let{scopedDocuments:t,candidates:n,fullTextScores:r,recency:i,normalizedQuery:a,ranking:o,semantic:s}=e,c=s.rrfK??60,l=s.candidateLimit??64,u=s.similarityFloor??0,d=s.scores,f=new Map(t.map(e=>[e.id,e])),p=[...d.entries()].filter(([e,t])=>t>=u&&f.has(e)).sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])).slice(0,l);for(let[e]of p)if(!n.has(e)){let t=f.get(e);t&&n.set(e,t)}let m=y9(n.values(),r),h=[...n.values()].map(e=>{let t=Math.max(0,h9(e,a)),n=r.get(e.id)??0,s=i.get(e.id)??0,c=d.get(e.id),l=c!==void 0&&c>=u;return{document:e,score:t>0?v9(o,t,n,s,e.kind,m):_9(t,n,s,e.kind),signals:l?{lexical:t,fullText:n,recency:s,vector:c}:{lexical:t,fullText:n,recency:s},lexical:t,fullText:n,recency:s,cosine:c}}),g=x9(h.filter(e=>e.fullText>0).sort((e,t)=>t.fullText-e.fullText||e.document.path.localeCompare(t.document.path)).map(e=>e.document.id)),_=x9(h.filter(e=>e.cosine!==void 0&&e.cosine>=u).sort((e,t)=>t.cosine-e.cosine||e.document.path.localeCompare(t.document.path)).map(e=>e.document.id)),v=e=>{let t=0,n=g.get(e);n!==void 0&&(t+=1/(c+n));let r=_.get(e);return r!==void 0&&(t+=1/(c+r)),t};return h.sort((e,t)=>{let n=+(e.lexical>0),r=+(t.lexical>0);if(n!==r)return r-n;if(n===1)return e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score;let i=v(e.document.id),a=v(t.document.id);return i===a?e.recency===t.recency?e.document.path.localeCompare(t.document.path):t.recency-e.recency:a-i}).map(({document:e,score:t,signals:n})=>({document:e,score:t,signals:n}))}function xde(e){return e.created.length>0||e.packSkills?.some(e=>e.pending)===!0||e.requiredPlugins?.some(e=>e.pending)===!0}function Sde(e){return`https://${e.host}/${e.owner}/${e.repo}.git`}function Cde(e,t){return!e||e.length===0?`true`:t.detached?`detached`:t.currentBranch===null||t.currentBranch===e?`true`:`false`}var S9=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),C9=globalThis;C9[S9]===void 0&&(C9[S9]=Tr());var w9=C9[S9],T9=R({version:N().regex(/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(w9,{description:`Recorded skill version for this target.`}),recordedAt:Ki().register(w9,{description:`ISO 8601 timestamp of the most recent successful write. Updated on every write, including reinstalls of the same version.`}),surface:z([`server-build-and-open`,`electron-build-and-open`,`cli-npx-skills-add`,`desktop-direct`,`cli-start`]).register(w9,{description:`Install-source surface that recorded this entry.`}).optional()}),wde=R({enabled:F().register(w9,{description:`Whether this user-global skill bundle is opted in.`}),decidedAt:Ki().register(w9,{description:`ISO 8601 timestamp of the opt-in / opt-out decision.`})});R({schema:B(1).register(w9,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:R({"claude-cowork":T9.optional(),"cli-hosts":T9.optional()}).register(w9,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({}),bundles:io(N(),wde).register(w9,{description:`Per-bundle opt-in decisions keyed by install name. Absent key = no recorded decision.`}).optional(),installsReported:I(N()).register(w9,{description:"Skill installs already reported to skills.sh from this machine, as `<owner/repo>#<skill>`. Append-only; presence suppresses a re-report."}).optional()});var E9=`bottom`,D9=e=>e*8+4,O9=D9(92),k9=D9(40);function Tde(e){return e===`right`||e===`bottom`?e:E9}function Ede(e){return typeof e!=`number`||!Number.isFinite(e)?O9:Math.max(k9,Math.round(e))}var Dde=new Set([`(connected)`,`(agent thread)`]);function Ode(e){return e!=null&&Dde.has(e)}var A9=class extends Error{chunksCompleted;totalChunks;bytesWritten;bytesRemaining;cause;constructor(e,t){let n=e instanceof Error?e.message:typeof e==`string`?e:`unknown error`;super(`chunked insert failed after ${t.chunksCompleted}/${t.totalChunks} chunks (${t.bytesWritten} bytes written, ${t.bytesRemaining} bytes lost): ${n}`),this.name=`ChunkedInsertError`,this.chunksCompleted=t.chunksCompleted,this.totalChunks=t.totalChunks,this.bytesWritten=t.bytesWritten,this.bytesRemaining=t.bytesRemaining,this.cause=e}};async function kde(e,t,n,r,i={}){let a=i.thresholdBytes??512e3,o=i.chunkSizeBytes??51200,s=i.origin,c=i.yieldFn??Ade,l=i.resolveOffset??(e=>e);if(r.length<=a){e.transact(()=>{t.insert(n,r)},s);return}let u=Math.ceil(r.length/o),d=0,f=n,p=0,m=0;for(;d<r.length;){let n=Math.min(d+o,r.length),i=r.slice(d,n);try{let n=l(f);e.transact(()=>{t.insert(n,i)},s)}catch(e){throw new A9(e,{chunksCompleted:p,totalChunks:u,bytesWritten:m,bytesRemaining:r.length-d})}p++,m+=i.length,f+=i.length,d=n,d<r.length&&await c()}}function Ade(){return new Promise(e=>{let t=globalThis;t.document?.hidden!==!0&&typeof t.requestAnimationFrame==`function`?t.requestAnimationFrame(()=>e()):setTimeout(()=>e(),0)})}var jde=/^(#{1,6})\s+(.+)$/;function Mde(e,t){let n=(e.endsWith(`\r`)?e.slice(0,-1):e).match(jde);if(!n)return null;let r=n[2].trim(),i=G5(r,t);return i?{level:n[1].length,text:r,slug:i}:null}var Nde=Array.from({length:256},(e,t)=>(t+256).toString(16).slice(1));function j9(){let e=globalThis.crypto;if(e&&typeof e.randomUUID==`function`)return e.randomUUID();let t=new Uint8Array(16);if(e&&typeof e.getRandomValues==`function`)e.getRandomValues(t);else for(let e=0;e<16;e++)t[e]=Math.floor(Math.random()*256);t[6]=t[6]&15|64,t[8]=t[8]&63|128;let n=Nde;return`${n[t[0]]}${n[t[1]]}${n[t[2]]}${n[t[3]]}-${n[t[4]]}${n[t[5]]}-${n[t[6]]}${n[t[7]]}-${n[t[8]]}${n[t[9]]}-${n[t[10]]}${n[t[11]]}${n[t[12]]}${n[t[13]]}${n[t[14]]}${n[t[15]]}`}var Pde={fileSystem:`File System`,gitUpstream:`Git (upstream)`,service:`OpenKnowledge (service)`,generator:`OpenKnowledge (generated)`},Fde=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],Ide={claude:`#D97757`,cursor:`#1B1912`,windsurf:`#0B100F`,openai:`#7A9DFF`,github:`#8534F3`,cline:`#9663F0`,bot:`#727CF3`},Lde={cursor:`#FFFFFF`,windsurf:`#FFFFFF`},M9=[`#f0ece3`,`#fff5e1`,`#f9e1db`,`#f5def7`,`#ece2fb`,`#dce8fa`,`#DBF3FB`];function Rde(e,t=Fde){let n=0;for(let t of e)n=(n<<5)-n+t.charCodeAt(0)|0;return t[Math.abs(n)%t.length]}function zde(e){let t=e.trim();if(!t)return`?`;let n=t.split(/[-\s]+/).filter(Boolean);if(!n.length)return`?`;if(n.length>=2)return n.slice(0,2).map(e=>e[0]??``).join(``).toUpperCase();let r=n[0],i=[r[0]];for(let e=1;e<r.length&&i.length<2;e++){let t=r[e-1],n=r[e];t===t.toLowerCase()&&n===n.toUpperCase()&&n!==n.toLowerCase()&&i.push(n)}return i.length>=2?i.join(``).toUpperCase():r.slice(0,2).toUpperCase()}function Bde(e){let t=e.trim();if(!t)return e;if(t.includes(` `)||!/[-_]/.test(t))return t;let n=t.split(/[-_]+/).filter(Boolean);return n.length?n.map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(` `):t}var Vde={"claude-code":`claude`,"claude-ai":`claude`,cursor:`cursor`,"cursor-vscode":`cursor`,cascade:`windsurf`,codex:`openai`,"codex-mcp-client":`openai`,copilot:`github`,cline:`cline`,"claude-acp":`claude`,"codex-acp":`openai`,"github-copilot-cli":`github`};function Hde(e){return e?Vde[e]||(e.startsWith(`local-agent-mode-`)?`claude`:`bot`):`bot`}function Ude(e){let t=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,r=parseInt(e.slice(5,7),16)/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2;if(i===a)return[0,0,o*100];let s=i-a,c=o>.5?s/(2-i-a):s/(i+a),l;return l=i===t?((n-r)/s+(n<r?6:0))/6:i===n?((r-t)/s+2)/6:((t-n)/s+4)/6,[l*360,c*100,o*100]}function Wde(e,t,n){let r=t/100,i=n/100,a=r*Math.min(i,1-i),o=t=>{let n=(t+e/30)%12,r=i-a*Math.max(Math.min(n-3,9-n,1),-1);return Math.round(255*r).toString(16).padStart(2,`0`)};return`#${o(0)}${o(8)}${o(4)}`}function Gde(e){let[t]=Ude(e);return Wde(t,45,32)}var Kde=[`Curious`,`Brave`,`Clever`,`Swift`,`Gentle`,`Bright`,`Wise`,`Bold`,`Calm`,`Keen`],qde=[`Bird`,`Cat`,`Dog`,`Fish`,`Mouse`,`Rabbit`,`Shrimp`,`Snail`,`Squirrel`,`Turtle`],N9=`ok-user-name-v3`,P9=`ok-user-color-v3`;function F9(e){return e[Math.floor(Math.random()*e.length)]}function Jde(){return`${F9(Kde)} ${F9(qde)}`}function Yde(){return F9(M9)}function I9(e){try{return localStorage.getItem(e)}catch{return null}}function L9(e,t){try{localStorage.setItem(e,t)}catch{}}function Xde(){let e=new URLSearchParams(window.location.search).get(`coeditor`)||`standalone`,t=j9(),n=I9(N9),r=I9(P9);return n||(n=Jde(),L9(N9,n)),r||(r=Yde(),L9(P9,r)),{name:n,color:r,coeditor:e,tabId:t}}function R9(e){if(!e.includes(`%`))return e;let t;try{t=decodeURIComponent(e)}catch{return e}return t===`.`||t===`..`||t.includes(`/`)||t.includes(`\\`)||t.includes(`\0`)?e:t}function Zde(e){return e===`.`||e===`..`?e:encodeURIComponent(e).replace(/[!'()*]/g,e=>`%${e.codePointAt(0)?.toString(16).toUpperCase()}`)}function Qde(e){return e.split(`/`).map(Zde).join(`/`)}function $de(e){return e.split(`/`).map(R9).join(`/`)}function efe(e,t){let n=e.trim();if(!n||/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n)||n.startsWith(`//`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=r>=0?n.slice(0,r):n,a=r>=0?n.slice(r+1):null,o=(i.split(`?`)[0]??``).trim();if(!o)return null;let s=R9(o.split(`/`).pop()??``).match(/\.([a-z0-9]+)$/i);if(s){let e=`.${(s[1]??``).toLowerCase()}`;if(!jX.includes(e))return null}let c=o.startsWith(`/`),l=c?o.slice(1):o,u=c?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[],d=l.split(`/`),f=d.length-1;for(let e=0;e<d.length;e++){let t=R9(d[e]??``);if(e===f&&(t=wp(t)),t===`..`){if(u.length===0)return null;u.pop()}else t!==`.`&&t!==``&&u.push(t)}return u.length===0?null:{docName:u.join(`/`),anchor:a||null}}function tfe(e){throw Error(`Unhandled ClassifiedLinkTarget variant: ${JSON.stringify(e)}`)}var z9=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function B9(e){let t=(e.split(/[?#]/)[0]??e).match(/\.([a-z0-9]+)$/i);return t?(t[1]??``).toLowerCase():null}function V9(e){return e.split(`/`).filter(Boolean)}function H9(e){let t=e.trim();return z9.test(t)||t.startsWith(`//`)}function nfe(e,t){let n=e.trim();if(!n)return null;if(n.startsWith(`#`)){let e=n.slice(1).trim();return e?{kind:`anchor`,anchor:e}:null}if(H9(n))return{kind:`external`,url:n};let r=n.indexOf(`#`),i=$de(r<0?n:n.slice(0,r)),a=kp(i,t);if(a)return{kind:`doc`,docName:a,anchor:r<0?null:n.slice(r+1)};let o=Op(i,t);if(o)return{kind:`doc`,docName:o,anchor:r<0?null:n.slice(r+1)};let s=efe(n,t);if(s)return{kind:`doc`,docName:s.docName,anchor:s.anchor};let c=B9(i);return c&&c!==`md`&&c!==`mdx`?{kind:`asset`,url:n,ext:c,literal:!1}:null}function rfe(e,t){let n=e.trim();if(!n)return null;if(H9(n))return{kind:`external`,url:t?`${n}#${t}`:n};let r=B9(n);return r&&r!==`md`&&r!==`mdx`?{kind:`asset`,url:n,ext:r,literal:!0}:{kind:`doc`,docName:n,anchor:t?.trim()||null}}function ife(e,t,n){let r=e.trim();if(!r||z9.test(r)||r.startsWith(`//`)||r.startsWith(`#`))return null;let i=r.indexOf(`#`),a=((i>=0?r.slice(0,i):r).split(`?`)[0]??``).trim();if(!a)return null;let o=a.startsWith(`/`),s=o?a.slice(1):a,c=o?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of s.split(`/`))if(e===`..`){if(c.length===0)return null;c.pop()}else e!==`.`&&e!==``&&c.push(n.literal?e:R9(e));return c.length===0?null:c.join(`/`)}function afe(e,t,n=null,r=`.md`){let i=V9(e);i.pop();let a=V9(t),o=0;for(;o<i.length&&o<a.length&&i[o]===a[o];)o+=1;let s=i.slice(o).map(()=>`..`),c=a.slice(o),l=[...s,...c].join(`/`);return l||=a.at(-1)??t,!l.startsWith(`./`)&&!l.startsWith(`../`)&&(l=`./${l}`),`${Qde(l)}${r}${n?`#${n}`:``}`}function ofe(e){return e.replace(/[/\\:*?"<>|\0]/g,`-`).replace(/\s+/g,` `).replace(/-+/g,`-`).trim().replace(/^[-.\s]+|[-.\s]+$/g,``)}function U9(e){return`pagesBySlug`in e}function W9(e){return U9(e)?e.pages:e}function G9(e,t){return U9(e)?e.assetPaths??new Set:t??new Set}function K9(e,t){return U9(e)?e.filePaths??new Set:t??new Set}function q9(e,t){return e<t?-1:+(e>t)}function sfe(e,t){let n=new Map;for(let r of e){let e=t(r);e&&!n.has(e)&&n.set(e,r)}return n}function cfe(e,t){let n=new Map,r=[...e].sort(q9);for(let e of r){let r=e.lastIndexOf(`/`),i=t(r===-1?e:e.slice(r+1));i&&!n.has(i)&&n.set(i,e)}return n}function J9(e,t){let n=W5(e);if(n){if(U9(t))return t.pagesBySlug.get(n);for(let e of t)if(W5(e)===n)return e}}function Y9(e,t){if(e.includes(`/`))return;let n=W5(e);if(!n)return;if(U9(t))return t.pagesByBasename?.get(n);let r;for(let e of t){let t=e.lastIndexOf(`/`);W5(t===-1?e:e.slice(t+1))===n&&(r===void 0||q9(e,r)<0)&&(r=e)}return r}function X9(e){let t=e.trim();if(!t)return[];let n=W5(t);return n.length>0&&n!==t?[n]:[]}function Z9(e,t){let n=e.trim();if(!n)return;let r=W9(t);if(r.has(n))return n;let i=J9(n,t);if(i)return i;for(let e of X9(n))if(r.has(e))return e;return Q9(n,r)||Y9(n,t)}function Q9(e,t){let n=`${e}/index`;if(t.has(n))return n;let r=e.lastIndexOf(`/`),i=r===-1?e:e.slice(r+1),a=i?`${e}/${i}`:null;if(a&&t.has(a))return a}function lfe(e){let t=((e.trim().split(`#`)[0]??``).trim().split(`?`)[0]??``).trim();return t.startsWith(`/`)?t.slice(1):t}function $9(e,t,n){let r=lfe(e);if(!r)return null;let i=r.toLowerCase(),a=n?[t,n]:[t];for(let e of a){if(e.has(r))return r;for(let t of e)if(t.toLowerCase()===i)return t}if(r.includes(`/`))return null;let o=[];for(let e of a)for(let t of e){let e=t.lastIndexOf(`/`);(e===-1?t:t.slice(e+1)).toLowerCase()===i&&o.push(t)}return o.length===0?null:o.sort(q9)[0]??null}function ufe(e,t,n,r){let i=e.trim();if(!i)return!1;if($9(i,G9(t,n),K9(t,r)))return!0;let a=W9(t);return a.has(i)||X9(i).some(e=>a.has(e))||J9(i,t)!==void 0||Q9(i,a)?!0:Y9(i,t)!==void 0}function dfe(e,t,n){let r=rfe(e,t);return r===null||r.kind!==`asset`||$9(r.url,G9(n),K9(n))!==null||Z9(e,n)===void 0?r:{kind:`doc`,docName:e.trim(),anchor:t?.trim()||null}}export{pse as $,xg as $a,p1 as $i,oX as $n,wd as $o,gZ as $r,L as $s,EQ as $t,H7 as A,Jw as Aa,d1 as Ai,YJ as An,Sm as Ao,Hde as Ar,ud as As,fZ as At,M9 as B,Ux as Ba,f1 as Bi,h$ as Bn,Ep as Bo,r4 as Br,Bd as Bs,gle as Bt,ele as C,rw as Ca,_2 as Ci,gQ as Cn,dp as Co,iue as Cr,Tu as Cs,a1 as Ct,NX as D,Tw as Da,p7 as Di,kQ as Dn,Cm as Do,oQ as Dr,fd as Ds,wse as Dt,E9 as E,gw as Ea,s1 as Ei,afe as En,bp as Eo,X9 as Er,Iu as Es,oY as Et,TX as F,Xw as Fa,nue as Fi,tZ as Fn,Hp as Fo,o4 as Fr,zd as Fs,dle as Ft,lZ as G,__ as Ga,OQ as Gi,HQ as Gn,cm as Go,xse as Gr,ff as Gs,X$ as Gt,Tce as H,e_ as Ha,nse as Hi,UQ as Hn,Ip as Ho,yZ as Hr,df as Hs,H$ as Ht,Rue as I,xE as Ia,ofe as Ii,Rde as In,Rp as Io,n4 as Ir,Ou as Is,fle as It,MX as J,K as Ja,Qae as Ji,VQ as Jn,um as Jo,ase as Jr,Fo as Js,Rle as Jt,uZ as K,G as Ka,qJ as Ki,D$ as Kn,wp as Ko,N$ as Kr,uf as Ks,V7 as Kt,s9 as L,iE as La,Mde as Li,_Y as Ln,jp as Lo,a4 as Lr,Mf as Ls,T7 as Lt,cce as M,NC as Ma,dfe as Mi,nfe as Mn,am as Mo,c4 as Mr,xu as Ms,Nle as Mt,sce as N,uC as Na,Z9 as Ni,eY as Nn,Cp as No,$2 as Nr,wu as Ns,Pde as Nt,sle as O,Dw as Oa,f7 as Oi,Sde as On,vm as Oo,DX as Or,bd as Os,jZ as Ot,tle as P,hw as Pa,sX as Pi,tY as Pn,Np as Po,e4 as Pr,pd as Ps,hle as Pt,Cce as Q,Sg as Qa,uY as Qi,zde as Qn,_d as Qo,M$ as Qr,B as Qs,TQ as Qt,mce as R,IS as Ra,aY as Ri,vY as Rn,Hm as Ro,t4 as Rr,Ld as Rs,ple as Rt,ace as S,nw as Sa,aQ as Si,mQ as Sn,rm as So,Bde as Sr,gf as Ss,r1 as St,tse as T,Pw as Ta,j9 as Ti,sfe as Tn,xp as To,Xde as Tr,kd as Ts,sY as Tt,vie as U,q as Ua,dQ as Ui,BQ as Un,Pp as Uo,PX as Ur,zf as Us,q$ as Ut,g0 as V,CS as Va,rse as Vi,WQ as Vn,$p as Vo,i4 as Vr,pf as Vs,n1 as Vt,sZ as W,m_ as Wa,_Q as Wi,O$ as Wn,Um as Wo,H9 as Wr,ku as Ws,K$ as Wt,bZ as X,fg as Xa,dse as Xi,RQ as Xn,Ku as Xo,zX as Xr,F as Xs,Lle as Xt,A5 as Y,_g as Ya,cZ as Yi,zQ as Yn,Lu as Yo,b5 as Yr,I as Ys,O7 as Yt,_ce as Z,vg as Za,W5 as Zi,due as Zn,Wu as Zo,Ode as Zr,ya as Zs,Ple as Zt,fY as _,wE as _a,Tde as _i,pX as _n,vp as _o,$Y as _r,Id as _s,WX as _t,nY as a,KA as aa,Ose as ai,KX as an,Gm as ao,Zue as ar,Ju as as,AZ as at,JX as b,ew as ba,aue as bi,pQ as bn,dm as bo,Yae as br,of as bs,nle as bt,Xle as c,ok as ca,Zse as ci,_se as cn,fp as co,Uce as cr,Fu as cs,IQ as ct,Zle as d,lk as da,bX as di,xce as dn,Wp as do,dY as dr,hd as ds,UX as dt,K5 as ea,N as ec,ufe as ei,FX as en,qg as eo,aX as er,Td as es,yse as et,Qle as f,bne as fa,eZ as fi,Iue as fn,Zp as fo,EX as fr,md as fs,VX as ft,QJ as g,qw as ga,$6 as gi,boe as gn,sm as go,cue as gr,Ad as gs,O9 as gt,OX as h,CT as ha,iQ as hi,xoe as hn,Kp as ho,Vue as hr,Xu as hs,wce as ht,Jce as i,UA as ia,f2 as ii,qX as in,W as io,$ue as ir,Tf as is,Hae as it,c7 as j,uE as ja,$9 as ji,Cde as jn,yp as jo,s4 as jr,Su as js,mZ as jt,rce as k,Ow as ka,ife as ki,kde as kn,Sp as ko,w0 as kr,rp as ks,ole as kt,eue as l,xk as la,Jse as li,sQ as ln,mp as lo,Ese as lr,Gu as ls,LQ as lt,kX as m,BT as ma,V8 as mi,tfe as mn,Xp as mo,B9 as mr,Hu as ms,RX as mt,Lde as n,u9 as na,jt as nc,Tle as ni,Mle as nn,U as no,o8 as nr,Yu as ns,H5 as nt,dce as o,GA as oa,l1 as oi,o1 as on,em as oo,Gde as or,Sd as os,yoe as ot,Yle as p,tE as pa,Fue as pi,E$ as pn,Gp as po,cQ as pr,Xd as ps,HX as pt,dZ as q,Yg as qa,fQ as qi,p$ as qn,Bp as qo,u2 as qr,z as qs,D7 as qt,qce as r,XA as ra,wt as rc,Lue as ri,cle as rn,gh as ro,q2 as rr,wf as rs,k9 as rt,uce as s,_k as sa,JJ as si,vse as sn,hp as so,LX as sr,kf as ss,y5 as st,Ide as t,FQ as ta,kt as tc,hZ as ti,QZ as tn,Qh as to,Dse as tr,Pf as ts,kce as tt,$le as u,Sk as ua,T0 as ui,uQ as un,pp as uo,Ale as ur,Vu as us,Dle as ut,AX as v,qte as va,Ede as vi,bue as vn,nm as vo,nZ as vr,jf as vs,GX as vt,$ce as w,Nw as wa,xde as wi,cfe as wn,zm as wo,G5 as wr,op as ws,nce as wt,i7 as x,lE as xa,lY as xi,DQ as xn,Yp as xo,e5 as xr,Eu as xs,ice as xt,A9 as y,SE as ya,l2 as yi,yX as yn,tm as yo,Cse as yr,Mu as ys,ile as yt,hse as z,Bx as za,yde as zi,l5 as zn,Vp as zo,Q2 as zr,cf as zs,mle as zt};
|
|
583
|
+
`).replace(/\n+$/,``)}function o9(e){return[...e.replace(/^\n+/,``).replace(/\n+$/,``).matchAll(/\n{2,}/g)].map(e=>e[0].length)}function Fue(e,t){let n=e9(e),r=e9(t);if(r.leading>n.leading||r.trailing>n.trailing)return!0;let i=o9(cm(e).body),a=o9(cm(t).body);return i.length===a.length?a.some((e,t)=>e>(i[t]??0)):!1}var s9=/^[a-zA-Z0-9][\w/-]*$/;function Iue(e){if(typeof e!=`string`)return!1;let t=e.startsWith(`#`)?e.slice(1):e;return s9.test(t)}var Lue=`Tags must start with a letter or digit and contain only letters, digits, underscores, dashes, and slashes.`;function Rue(e){return e.startsWith(`#`)?e.slice(1):e}function zue(e){return typeof e==`string`?[e]:Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function Bue(e){if(!e||e.trim()===``)return[];let{map:t}=Tm(e);if(!t)return[];let n=zue(t.tags),r=[];for(let e of n){let t=Rue(e);s9.test(t)&&r.push(t)}return r}var Vue=z(vp),Hue=R({hosts:I(N()),scope:Vue,scripts:F(),installedAt:Ki(),projection:z([`symlink`,`copy`]).optional(),contentHash:N().optional()});R({schema:B(1),skills:io(N(),Hue).default({})});var Uue=100,Wue=500,Gue=450,Kue={id:`string`,kind:`enum`,path:`string`,title:`string`,name:`string`,pathSegments:`string`,content:`string`,modifiedTs:`number`},c9=new WeakMap;function que(e){return e===void 0||!Number.isFinite(e)?20:Math.max(1,Math.min(100,Math.trunc(e)))}function l9(e){return e.trim().toLowerCase()}var Jue=/\.(?:md|mdx)$/;function Yue(e,t){if(t!==`page`)return e;let n=e.replace(Jue,``);return n.length>0?n:e}function u9(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function Xue(e){let t=u9(e.path),n=e.title?.trim()||t,r=e.modifiedTs??0,i=e.path.split(`/`).filter(Boolean),a=new Set(i),o=[...new Set((e.aliases??[]).flatMap(e=>e.split(`/`).filter(Boolean)).filter(e=>!a.has(e)))];return{id:`${e.kind}:${e.path}`,kind:e.kind,path:e.path,title:n,name:t,pathSegments:[...i,...o].join(` `),content:e.content??``,modifiedTs:Number.isFinite(r)?r:0}}var d9=/[^\P{L}a-zàèéìòóù]|[^\P{Nd}0-9]|\p{Nl}/iu,f9=(()=>{let e=globalThis.Intl.Segmenter;return e?new e(`en`,{granularity:`word`}):null})();function Zue(){let e=Vq({language:`english`}),t=e.tokenize.bind(e);return e.tokenize=(e,n,r,i)=>{let a=t(e,n,r,i);if(!f9||typeof e!=`string`||!d9.test(e))return a;let o=new Set(a);for(let{segment:t,isWordLike:n}of f9.segment(e)){if(!n||!d9.test(t))continue;let e=t.toLowerCase();o.has(e)||(o.add(e),a.push(e))}return a},e}function p9(e){let t=tJ({schema:Kue,components:{tokenizer:Zue()}});return e.length>0&&fJ(t,e),t}function Que(e){let t={documents:e};return c9.set(t,p9(e)),t}function $ue(e){let t=c9.get(e);if(t)return t;let n=p9(e.documents);return c9.set(e,n),n}function ede(e){return e===`autocomplete`?[`page`]:e===`full_text`?[`page`,`content`,`file`]:[`page`,`folder`,`file`]}function m9(e,t){return t.has(e.kind)?!0:e.kind===`page`&&t.has(`content`)}function tde(e,t){let n=l9(t);if(!n)return 0;let r=Yue(n,e.kind),i=l9(e.title),a=l9(e.name),o=l9(e.path),s=o.split(`/`);return i===r||a===r?700:o===r?650:i.startsWith(r)||a.startsWith(r)?600:s.some(e=>e.startsWith(r))?550:i.includes(r)||a.includes(r)?500:o.includes(r)?450:-1}var nde=.5;function h9(e,t){let n=tde(e,t);return n<=0?n:N$(e.path)?n*nde:n}var rde=60;function ide(e){return e===`file`?-rde:0}var ade=1e3,g9=50,ode=1,sde=1,cde=.001;function lde(e,t,n,r,i){let a=i>0?t/i:0,o=g9>0?n/g9:0,s=r===`file`?-cde:0,c=ode*a+sde*o+s;return e*ade+c}function _9(e,t,n,r){return e+t*20+n+ide(r)}function v9(e,t,n,r,i,a){return e===`relevance`?_9(t,n,r,i):lde(t,n,r,i,a)}function ude(e,t){return t||(e===`full_text`?`relevance`:`navigation`)}function y9(e,t){let n=0;for(let r of e){let e=t.get(r.id)??0;e>n&&(n=e)}return n}function dde(e){let t=e.map(e=>e.modifiedTs).filter(e=>Number.isFinite(e)&&e>0);if(t.length===0)return new Map;let n=1/0,r=-1/0;for(let e of t)e<n&&(n=e),e>r&&(r=e);let i=Math.max(1,r-n);return new Map(e.map(e=>[e.id,e.modifiedTs>0?(e.modifiedTs-n)/i*50:0]))}function fde(e){return e===`full_text`?[`title`,`name`,`path`,`pathSegments`,`content`]:[`title`,`name`,`path`,`pathSegments`]}function pde(e){return e===`full_text`?{title:8,name:7,path:5,pathSegments:4,content:1}:e===`autocomplete`?{title:10,name:9,path:5,pathSegments:4}:{title:8,name:7,path:5,pathSegments:4}}var mde=/[-ក- -〿-ゟ゠-ヿ㐀-䶿一-鿿\uf900--\u1100-\u11ff\u3130-\u318f\ua960-\ua97f\uac00-\ud7ff]/;function hde(e,t){let n=l9(t);return n.length<4||mde.test(n)?0:+(e===`full_text`)}function gde(e){let{lexical:t,fullText:n}=e.signals;return t>=Wue?`lexical`:t===Gue&&n<=0?`pathOnly`:`body`}function _de(e){let t=[],n=[],r=[];for(let i of e){let e=gde(i);e===`lexical`?t.length<Uue&&t.push(i):e===`body`?n.length<6&&n.push(i):r.length<4&&r.push(i)}return[...t,...n,...r]}function b9(e,t,n){if(t===`relevance`)return e.slice(0,n);let r=_de(e),i=[],a=0,o=0;for(let e of r){if(e.document.kind===`folder`){if(a>=3)continue;a+=1}else if(e.document.kind===`file`){if(o>=3)continue;o+=1}if(i.push(e),i.length>=n)break}return i}function vde(e,t,n={}){let r=n.intent??`omnibar`,i=ude(r,n.ranking),a=que(n.limit),o=new Set(n.scopes??ede(r)),s=e.documents.filter(e=>m9(e,o)),c=l9(t);if(!c)return s.slice().sort((e,t)=>e.path.localeCompare(t.path)).slice(0,a).map(e=>({document:e,score:0,signals:{lexical:0,fullText:0,recency:0}}));let l=HJ($ue(e),{term:c,properties:fde(r),boost:pde(r),tolerance:hde(r,c),limit:Math.max(a*4,40)}),u=new Map(l.hits.filter(e=>m9(e.document,o)).map(e=>[e.document.id,e.score])),d=dde(s),f=new Map;for(let e of s)h9(e,c)>=0&&f.set(e.id,e);for(let e of l.hits)m9(e.document,o)&&f.set(e.document.id,e.document);if(!n.semantic){let e=y9(f.values(),u);return b9([...f.values()].map(t=>{let n=Math.max(0,h9(t,c)),r=u.get(t.id)??0,a=d.get(t.id)??0;return{document:t,score:v9(i,n,r,a,t.kind,e),signals:{lexical:n,fullText:r,recency:a}}}).sort((e,t)=>e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score),i,a)}return b9(yde({scopedDocuments:s,candidates:f,fullTextScores:u,recency:d,normalizedQuery:c,ranking:i,semantic:n.semantic}),i,a)}function x9(e){let t=new Map;return e.forEach((e,n)=>{t.set(e,n+1)}),t}function yde(e){let{scopedDocuments:t,candidates:n,fullTextScores:r,recency:i,normalizedQuery:a,ranking:o,semantic:s}=e,c=s.rrfK??60,l=s.candidateLimit??64,u=s.similarityFloor??0,d=s.scores,f=new Map(t.map(e=>[e.id,e])),p=[...d.entries()].filter(([e,t])=>t>=u&&f.has(e)).sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])).slice(0,l);for(let[e]of p)if(!n.has(e)){let t=f.get(e);t&&n.set(e,t)}let m=y9(n.values(),r),h=[...n.values()].map(e=>{let t=Math.max(0,h9(e,a)),n=r.get(e.id)??0,s=i.get(e.id)??0,c=d.get(e.id),l=c!==void 0&&c>=u;return{document:e,score:t>0?v9(o,t,n,s,e.kind,m):_9(t,n,s,e.kind),signals:l?{lexical:t,fullText:n,recency:s,vector:c}:{lexical:t,fullText:n,recency:s},lexical:t,fullText:n,recency:s,cosine:c}}),g=x9(h.filter(e=>e.fullText>0).sort((e,t)=>t.fullText-e.fullText||e.document.path.localeCompare(t.document.path)).map(e=>e.document.id)),_=x9(h.filter(e=>e.cosine!==void 0&&e.cosine>=u).sort((e,t)=>t.cosine-e.cosine||e.document.path.localeCompare(t.document.path)).map(e=>e.document.id)),v=e=>{let t=0,n=g.get(e);n!==void 0&&(t+=1/(c+n));let r=_.get(e);return r!==void 0&&(t+=1/(c+r)),t};return h.sort((e,t)=>{let n=+(e.lexical>0),r=+(t.lexical>0);if(n!==r)return r-n;if(n===1)return e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score;let i=v(e.document.id),a=v(t.document.id);return i===a?e.recency===t.recency?e.document.path.localeCompare(t.document.path):t.recency-e.recency:a-i}).map(({document:e,score:t,signals:n})=>({document:e,score:t,signals:n}))}function bde(e){return e.created.length>0||e.packSkills?.some(e=>e.pending)===!0||e.requiredPlugins?.some(e=>e.pending)===!0}function xde(e){return`https://${e.host}/${e.owner}/${e.repo}.git`}function Sde(e,t){return!e||e.length===0?`true`:t.detached?`detached`:t.currentBranch===null||t.currentBranch===e?`true`:`false`}var S9=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),C9=globalThis;C9[S9]===void 0&&(C9[S9]=Tr());var w9=C9[S9],T9=R({version:N().regex(/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(w9,{description:`Recorded skill version for this target.`}),recordedAt:Ki().register(w9,{description:`ISO 8601 timestamp of the most recent successful write. Updated on every write, including reinstalls of the same version.`}),surface:z([`server-build-and-open`,`electron-build-and-open`,`cli-npx-skills-add`,`desktop-direct`,`cli-start`]).register(w9,{description:`Install-source surface that recorded this entry.`}).optional()}),Cde=R({enabled:F().register(w9,{description:`Whether this user-global skill bundle is opted in.`}),decidedAt:Ki().register(w9,{description:`ISO 8601 timestamp of the opt-in / opt-out decision.`})});R({schema:B(1).register(w9,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:R({"claude-cowork":T9.optional(),"cli-hosts":T9.optional()}).register(w9,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({}),bundles:io(N(),Cde).register(w9,{description:`Per-bundle opt-in decisions keyed by install name. Absent key = no recorded decision.`}).optional(),installsReported:I(N()).register(w9,{description:"Skill installs already reported to skills.sh from this machine, as `<owner/repo>#<skill>`. Append-only; presence suppresses a re-report."}).optional()});var E9=`bottom`,D9=e=>e*8+4,O9=D9(92),k9=D9(40);function wde(e){return e===`right`||e===`bottom`?e:E9}function Tde(e){return typeof e!=`number`||!Number.isFinite(e)?O9:Math.max(k9,Math.round(e))}var Ede=new Set([`(connected)`,`(agent thread)`]);function Dde(e){return e!=null&&Ede.has(e)}var A9=class extends Error{chunksCompleted;totalChunks;bytesWritten;bytesRemaining;cause;constructor(e,t){let n=e instanceof Error?e.message:typeof e==`string`?e:`unknown error`;super(`chunked insert failed after ${t.chunksCompleted}/${t.totalChunks} chunks (${t.bytesWritten} bytes written, ${t.bytesRemaining} bytes lost): ${n}`),this.name=`ChunkedInsertError`,this.chunksCompleted=t.chunksCompleted,this.totalChunks=t.totalChunks,this.bytesWritten=t.bytesWritten,this.bytesRemaining=t.bytesRemaining,this.cause=e}};async function Ode(e,t,n,r,i={}){let a=i.thresholdBytes??512e3,o=i.chunkSizeBytes??51200,s=i.origin,c=i.yieldFn??kde,l=i.resolveOffset??(e=>e);if(r.length<=a){e.transact(()=>{t.insert(n,r)},s);return}let u=Math.ceil(r.length/o),d=0,f=n,p=0,m=0;for(;d<r.length;){let n=Math.min(d+o,r.length),i=r.slice(d,n);try{let n=l(f);e.transact(()=>{t.insert(n,i)},s)}catch(e){throw new A9(e,{chunksCompleted:p,totalChunks:u,bytesWritten:m,bytesRemaining:r.length-d})}p++,m+=i.length,f+=i.length,d=n,d<r.length&&await c()}}function kde(){return new Promise(e=>{let t=globalThis;t.document?.hidden!==!0&&typeof t.requestAnimationFrame==`function`?t.requestAnimationFrame(()=>e()):setTimeout(()=>e(),0)})}var Ade=/^(#{1,6})\s+(.+)$/;function jde(e,t){let n=(e.endsWith(`\r`)?e.slice(0,-1):e).match(Ade);if(!n)return null;let r=n[2].trim(),i=G5(r,t);return i?{level:n[1].length,text:r,slug:i}:null}var Mde=Array.from({length:256},(e,t)=>(t+256).toString(16).slice(1));function j9(){let e=globalThis.crypto;if(e&&typeof e.randomUUID==`function`)return e.randomUUID();let t=new Uint8Array(16);if(e&&typeof e.getRandomValues==`function`)e.getRandomValues(t);else for(let e=0;e<16;e++)t[e]=Math.floor(Math.random()*256);t[6]=t[6]&15|64,t[8]=t[8]&63|128;let n=Mde;return`${n[t[0]]}${n[t[1]]}${n[t[2]]}${n[t[3]]}-${n[t[4]]}${n[t[5]]}-${n[t[6]]}${n[t[7]]}-${n[t[8]]}${n[t[9]]}-${n[t[10]]}${n[t[11]]}${n[t[12]]}${n[t[13]]}${n[t[14]]}${n[t[15]]}`}var Nde={fileSystem:`File System`,gitUpstream:`Git (upstream)`,service:`OpenKnowledge (service)`,generator:`OpenKnowledge (generated)`},Pde=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],Fde={claude:`#D97757`,cursor:`#1B1912`,windsurf:`#0B100F`,openai:`#7A9DFF`,github:`#8534F3`,cline:`#9663F0`,bot:`#727CF3`},Ide={cursor:`#FFFFFF`,windsurf:`#FFFFFF`},M9=[`#f0ece3`,`#fff5e1`,`#f9e1db`,`#f5def7`,`#ece2fb`,`#dce8fa`,`#DBF3FB`];function Lde(e,t=Pde){let n=0;for(let t of e)n=(n<<5)-n+t.charCodeAt(0)|0;return t[Math.abs(n)%t.length]}function Rde(e){let t=e.trim();if(!t)return`?`;let n=t.split(/[-\s]+/).filter(Boolean);if(!n.length)return`?`;if(n.length>=2)return n.slice(0,2).map(e=>e[0]??``).join(``).toUpperCase();let r=n[0],i=[r[0]];for(let e=1;e<r.length&&i.length<2;e++){let t=r[e-1],n=r[e];t===t.toLowerCase()&&n===n.toUpperCase()&&n!==n.toLowerCase()&&i.push(n)}return i.length>=2?i.join(``).toUpperCase():r.slice(0,2).toUpperCase()}function zde(e){let t=e.trim();if(!t)return e;if(t.includes(` `)||!/[-_]/.test(t))return t;let n=t.split(/[-_]+/).filter(Boolean);return n.length?n.map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(` `):t}var Bde={"claude-code":`claude`,"claude-ai":`claude`,cursor:`cursor`,"cursor-vscode":`cursor`,cascade:`windsurf`,codex:`openai`,"codex-mcp-client":`openai`,copilot:`github`,cline:`cline`,"claude-acp":`claude`,"codex-acp":`openai`,"github-copilot-cli":`github`};function Vde(e){return e?Bde[e]||(e.startsWith(`local-agent-mode-`)?`claude`:`bot`):`bot`}function Hde(e){let t=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,r=parseInt(e.slice(5,7),16)/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2;if(i===a)return[0,0,o*100];let s=i-a,c=o>.5?s/(2-i-a):s/(i+a),l;return l=i===t?((n-r)/s+(n<r?6:0))/6:i===n?((r-t)/s+2)/6:((t-n)/s+4)/6,[l*360,c*100,o*100]}function Ude(e,t,n){let r=t/100,i=n/100,a=r*Math.min(i,1-i),o=t=>{let n=(t+e/30)%12,r=i-a*Math.max(Math.min(n-3,9-n,1),-1);return Math.round(255*r).toString(16).padStart(2,`0`)};return`#${o(0)}${o(8)}${o(4)}`}function Wde(e){let[t]=Hde(e);return Ude(t,45,32)}var Gde=[`Curious`,`Brave`,`Clever`,`Swift`,`Gentle`,`Bright`,`Wise`,`Bold`,`Calm`,`Keen`],Kde=[`Bird`,`Cat`,`Dog`,`Fish`,`Mouse`,`Rabbit`,`Shrimp`,`Snail`,`Squirrel`,`Turtle`],N9=`ok-user-name-v3`,P9=`ok-user-color-v3`;function F9(e){return e[Math.floor(Math.random()*e.length)]}function qde(){return`${F9(Gde)} ${F9(Kde)}`}function Jde(){return F9(M9)}function I9(e){try{return localStorage.getItem(e)}catch{return null}}function L9(e,t){try{localStorage.setItem(e,t)}catch{}}function Yde(){let e=new URLSearchParams(window.location.search).get(`coeditor`)||`standalone`,t=j9(),n=I9(N9),r=I9(P9);return n||(n=qde(),L9(N9,n)),r||(r=Jde(),L9(P9,r)),{name:n,color:r,coeditor:e,tabId:t}}function R9(e){if(!e.includes(`%`))return e;let t;try{t=decodeURIComponent(e)}catch{return e}return t===`.`||t===`..`||t.includes(`/`)||t.includes(`\\`)||t.includes(`\0`)?e:t}function Xde(e){return e===`.`||e===`..`?e:encodeURIComponent(e).replace(/[!'()*]/g,e=>`%${e.codePointAt(0)?.toString(16).toUpperCase()}`)}function Zde(e){return e.split(`/`).map(Xde).join(`/`)}function Qde(e){return e.split(`/`).map(R9).join(`/`)}function $de(e,t){let n=e.trim();if(!n||/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n)||n.startsWith(`//`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=r>=0?n.slice(0,r):n,a=r>=0?n.slice(r+1):null,o=(i.split(`?`)[0]??``).trim();if(!o)return null;let s=R9(o.split(`/`).pop()??``).match(/\.([a-z0-9]+)$/i);if(s){let e=`.${(s[1]??``).toLowerCase()}`;if(!jX.includes(e))return null}let c=o.startsWith(`/`),l=c?o.slice(1):o,u=c?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[],d=l.split(`/`),f=d.length-1;for(let e=0;e<d.length;e++){let t=R9(d[e]??``);if(e===f&&(t=wp(t)),t===`..`){if(u.length===0)return null;u.pop()}else t!==`.`&&t!==``&&u.push(t)}return u.length===0?null:{docName:u.join(`/`),anchor:a||null}}function efe(e){throw Error(`Unhandled ClassifiedLinkTarget variant: ${JSON.stringify(e)}`)}var z9=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function B9(e){let t=(e.split(/[?#]/)[0]??e).match(/\.([a-z0-9]+)$/i);return t?(t[1]??``).toLowerCase():null}function V9(e){return e.split(`/`).filter(Boolean)}function H9(e){let t=e.trim();return z9.test(t)||t.startsWith(`//`)}function tfe(e,t){let n=e.trim();if(!n)return null;if(n.startsWith(`#`)){let e=n.slice(1).trim();return e?{kind:`anchor`,anchor:e}:null}if(H9(n))return{kind:`external`,url:n};let r=n.indexOf(`#`),i=Qde(r<0?n:n.slice(0,r)),a=kp(i,t);if(a)return{kind:`doc`,docName:a,anchor:r<0?null:n.slice(r+1)};let o=Op(i,t);if(o)return{kind:`doc`,docName:o,anchor:r<0?null:n.slice(r+1)};let s=$de(n,t);if(s)return{kind:`doc`,docName:s.docName,anchor:s.anchor};let c=B9(i);return c&&c!==`md`&&c!==`mdx`?{kind:`asset`,url:n,ext:c,literal:!1}:null}function nfe(e,t){let n=e.trim();if(!n)return null;if(H9(n))return{kind:`external`,url:t?`${n}#${t}`:n};let r=B9(n);return r&&r!==`md`&&r!==`mdx`?{kind:`asset`,url:n,ext:r,literal:!0}:{kind:`doc`,docName:n,anchor:t?.trim()||null}}function rfe(e,t,n){let r=e.trim();if(!r||z9.test(r)||r.startsWith(`//`)||r.startsWith(`#`))return null;let i=r.indexOf(`#`),a=((i>=0?r.slice(0,i):r).split(`?`)[0]??``).trim();if(!a)return null;let o=a.startsWith(`/`),s=o?a.slice(1):a,c=o?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of s.split(`/`))if(e===`..`){if(c.length===0)return null;c.pop()}else e!==`.`&&e!==``&&c.push(n.literal?e:R9(e));return c.length===0?null:c.join(`/`)}function ife(e,t,n=null,r=`.md`){let i=V9(e);i.pop();let a=V9(t),o=0;for(;o<i.length&&o<a.length&&i[o]===a[o];)o+=1;let s=i.slice(o).map(()=>`..`),c=a.slice(o),l=[...s,...c].join(`/`);return l||=a.at(-1)??t,!l.startsWith(`./`)&&!l.startsWith(`../`)&&(l=`./${l}`),`${Zde(l)}${r}${n?`#${n}`:``}`}function afe(e){return e.replace(/[/\\:*?"<>|\0]/g,`-`).replace(/\s+/g,` `).replace(/-+/g,`-`).trim().replace(/^[-.\s]+|[-.\s]+$/g,``)}function U9(e){return`pagesBySlug`in e}function W9(e){return U9(e)?e.pages:e}function G9(e,t){return U9(e)?e.assetPaths??new Set:t??new Set}function K9(e,t){return U9(e)?e.filePaths??new Set:t??new Set}function q9(e,t){return e<t?-1:+(e>t)}function ofe(e,t){let n=new Map;for(let r of e){let e=t(r);e&&!n.has(e)&&n.set(e,r)}return n}function sfe(e,t){let n=new Map,r=[...e].sort(q9);for(let e of r){let r=e.lastIndexOf(`/`),i=t(r===-1?e:e.slice(r+1));i&&!n.has(i)&&n.set(i,e)}return n}function J9(e,t){let n=W5(e);if(n){if(U9(t))return t.pagesBySlug.get(n);for(let e of t)if(W5(e)===n)return e}}function Y9(e,t){if(e.includes(`/`))return;let n=W5(e);if(!n)return;if(U9(t))return t.pagesByBasename?.get(n);let r;for(let e of t){let t=e.lastIndexOf(`/`);W5(t===-1?e:e.slice(t+1))===n&&(r===void 0||q9(e,r)<0)&&(r=e)}return r}function X9(e){let t=e.trim();if(!t)return[];let n=W5(t);return n.length>0&&n!==t?[n]:[]}function Z9(e,t){let n=e.trim();if(!n)return;let r=W9(t);if(r.has(n))return n;let i=J9(n,t);if(i)return i;for(let e of X9(n))if(r.has(e))return e;return Q9(n,r)||Y9(n,t)}function Q9(e,t){let n=`${e}/index`;if(t.has(n))return n;let r=e.lastIndexOf(`/`),i=r===-1?e:e.slice(r+1),a=i?`${e}/${i}`:null;if(a&&t.has(a))return a}function cfe(e){let t=((e.trim().split(`#`)[0]??``).trim().split(`?`)[0]??``).trim();return t.startsWith(`/`)?t.slice(1):t}function $9(e,t,n){let r=cfe(e);if(!r)return null;let i=r.toLowerCase(),a=n?[t,n]:[t];for(let e of a){if(e.has(r))return r;for(let t of e)if(t.toLowerCase()===i)return t}if(r.includes(`/`))return null;let o=[];for(let e of a)for(let t of e){let e=t.lastIndexOf(`/`);(e===-1?t:t.slice(e+1)).toLowerCase()===i&&o.push(t)}return o.length===0?null:o.sort(q9)[0]??null}function lfe(e,t,n,r){let i=e.trim();if(!i)return!1;if($9(i,G9(t,n),K9(t,r)))return!0;let a=W9(t);return a.has(i)||X9(i).some(e=>a.has(e))||J9(i,t)!==void 0||Q9(i,a)?!0:Y9(i,t)!==void 0}function ufe(e,t,n){let r=nfe(e,t);return r===null||r.kind!==`asset`||$9(r.url,G9(n),K9(n))!==null||Z9(e,n)===void 0?r:{kind:`doc`,docName:e.trim(),anchor:t?.trim()||null}}export{fse as $,xg as $a,p1 as $i,oX as $n,wd as $o,gZ as $r,L as $s,EQ as $t,H7 as A,Jw as Aa,d1 as Ai,YJ as An,Sm as Ao,Vde as Ar,ud as As,fZ as At,M9 as B,Ux as Ba,f1 as Bi,h$ as Bn,Ep as Bo,r4 as Br,Bd as Bs,hle as Bt,$ce as C,rw as Ca,_2 as Ci,gQ as Cn,dp as Co,rue as Cr,Tu as Cs,a1 as Ct,NX as D,Tw as Da,p7 as Di,kQ as Dn,Cm as Do,oQ as Dr,fd as Ds,Cse as Dt,E9 as E,gw as Ea,s1 as Ei,ife as En,bp as Eo,X9 as Er,Iu as Es,oY as Et,TX as F,Xw as Fa,tue as Fi,tZ as Fn,Hp as Fo,o4 as Fr,zd as Fs,ule as Ft,lZ as G,__ as Ga,OQ as Gi,HQ as Gn,cm as Go,bse as Gr,ff as Gs,X$ as Gt,wce as H,e_ as Ha,tse as Hi,UQ as Hn,Ip as Ho,yZ as Hr,df as Hs,H$ as Ht,Lue as I,xE as Ia,afe as Ii,Lde as In,Rp as Io,n4 as Ir,Ou as Is,dle as It,MX as J,K as Ja,Zae as Ji,VQ as Jn,um as Jo,ise as Jr,Fo as Js,Lle as Jt,uZ as K,G as Ka,qJ as Ki,D$ as Kn,wp as Ko,N$ as Kr,uf as Ks,V7 as Kt,s9 as L,iE as La,jde as Li,_Y as Ln,jp as Lo,a4 as Lr,Mf as Ls,T7 as Lt,sce as M,NC as Ma,ufe as Mi,tfe as Mn,am as Mo,c4 as Mr,xu as Ms,Mle as Mt,oce as N,uC as Na,Z9 as Ni,eY as Nn,Cp as No,$2 as Nr,wu as Ns,Nde as Nt,ole as O,Dw as Oa,f7 as Oi,xde as On,vm as Oo,DX as Or,bd as Os,jZ as Ot,ele as P,hw as Pa,sX as Pi,tY as Pn,Np as Po,e4 as Pr,pd as Ps,mle as Pt,Sce as Q,Sg as Qa,uY as Qi,Rde as Qn,_d as Qo,M$ as Qr,B as Qs,TQ as Qt,pce as R,IS as Ra,aY as Ri,vY as Rn,Hm as Ro,t4 as Rr,Ld as Rs,fle as Rt,ice as S,nw as Sa,aQ as Si,mQ as Sn,rm as So,zde as Sr,gf as Ss,r1 as St,ese as T,Pw as Ta,j9 as Ti,ofe as Tn,xp as To,Yde as Tr,kd as Ts,sY as Tt,vie as U,q as Ua,dQ as Ui,BQ as Un,Pp as Uo,PX as Ur,zf as Us,q$ as Ut,g0 as V,CS as Va,nse as Vi,WQ as Vn,$p as Vo,i4 as Vr,pf as Vs,n1 as Vt,sZ as W,m_ as Wa,_Q as Wi,O$ as Wn,Um as Wo,H9 as Wr,ku as Ws,K$ as Wt,bZ as X,fg as Xa,use as Xi,RQ as Xn,Ku as Xo,zX as Xr,F as Xs,Ile as Xt,A5 as Y,_g as Ya,cZ as Yi,zQ as Yn,Lu as Yo,b5 as Yr,I as Ys,O7 as Yt,gce as Z,vg as Za,W5 as Zi,uue as Zn,Wu as Zo,Dde as Zr,ya as Zs,Nle as Zt,fY as _,wE as _a,wde as _i,pX as _n,vp as _o,$Y as _r,Id as _s,WX as _t,nY as a,KA as aa,Dse as ai,KX as an,Gm as ao,Xue as ar,Ju as as,AZ as at,JX as b,ew as ba,iue as bi,pQ as bn,dm as bo,Jae as br,of as bs,tle as bt,Yle as c,ok as ca,Xse as ci,gse as cn,fp as co,Hce as cr,Fu as cs,IQ as ct,Xle as d,lk as da,bX as di,bce as dn,Wp as do,dY as dr,hd as ds,UX as dt,K5 as ea,N as ec,lfe as ei,FX as en,qg as eo,aX as er,Td as es,vse as et,Zle as f,bne as fa,eZ as fi,Fue as fn,Zp as fo,EX as fr,md as fs,VX as ft,QJ as g,qw as ga,$6 as gi,yoe as gn,sm as go,sue as gr,Ad as gs,O9 as gt,OX as h,CT as ha,iQ as hi,boe as hn,Kp as ho,Bue as hr,Xu as hs,Cce as ht,qce as i,UA as ia,f2 as ii,qX as in,W as io,Que as ir,Tf as is,Vae as it,c7 as j,uE as ja,$9 as ji,Sde as jn,yp as jo,s4 as jr,Su as js,mZ as jt,nce as k,Ow as ka,rfe as ki,Ode as kn,Sp as ko,w0 as kr,rp as ks,ale as kt,$le as l,xk as la,qse as li,sQ as ln,mp as lo,Tse as lr,Gu as ls,LQ as lt,kX as m,BT as ma,V8 as mi,efe as mn,Xp as mo,B9 as mr,Hu as ms,RX as mt,Ide as n,u9 as na,jt as nc,wle as ni,jle as nn,U as no,o8 as nr,Yu as ns,H5 as nt,uce as o,GA as oa,l1 as oi,o1 as on,em as oo,Wde as or,Sd as os,voe as ot,Jle as p,tE as pa,Pue as pi,E$ as pn,Gp as po,cQ as pr,Xd as ps,HX as pt,dZ as q,Yg as qa,fQ as qi,p$ as qn,Bp as qo,u2 as qr,z as qs,D7 as qt,Kce as r,XA as ra,wt as rc,Iue as ri,sle as rn,gh as ro,q2 as rr,wf as rs,k9 as rt,lce as s,_k as sa,JJ as si,_se as sn,hp as so,LX as sr,kf as ss,y5 as st,Fde as t,FQ as ta,kt as tc,hZ as ti,QZ as tn,Qh as to,Ese as tr,Pf as ts,Oce as tt,Qle as u,Sk as ua,T0 as ui,uQ as un,pp as uo,kle as ur,Vu as us,Ele as ut,AX as v,qte as va,Tde as vi,yue as vn,nm as vo,nZ as vr,jf as vs,GX as vt,Qce as w,Nw as wa,bde as wi,sfe as wn,zm as wo,G5 as wr,op as ws,tce as wt,i7 as x,lE as xa,lY as xi,DQ as xn,Yp as xo,e5 as xr,Eu as xs,rce as xt,A9 as y,SE as ya,l2 as yi,yX as yn,tm as yo,Sse as yr,Mu as ys,rle as yt,mse as z,Bx as za,vde as zi,l5 as zn,Vp as zo,Q2 as zr,cf as zs,ple as zt};
|